view x/static/js/4456.93a06b74.chunk.js.map @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
line wrap: on
line source

{"version":3,"file":"static/js/4456.93a06b74.chunk.js","mappings":"8LAqBO,SAASA,EAGdC,GACA,OAAOC,EAAAA,MACJC,MAAM,CAILC,GAAIC,EAAAA,UAIJC,KAAMJ,EAAAA,MAAMK,OAIZC,OAAQ,IAETC,UAAS,KAAM,CAOdC,eAAWC,EAOXC,aAASD,MAEVE,OAAMC,IAAQ,CAIb,QAAIC,GACF,OAAOC,EAAAA,EAAAA,WAA2BF,EACpC,MAEDD,OAAMC,IAAQ,CAIb,WAAIG,GACF,OAAOH,EAAKC,KAAKE,OACnB,EAIA,cAAIC,GACF,OAAOJ,EAAKC,KAAKG,UACnB,EAIA,iBAAIC,GACF,OAAOC,KAAKH,QAAQE,aACtB,EAIA,aAAIE,GACF,OAAOP,EAAKC,KAAKM,SACnB,EAKA,qBAAIC,GACF,OAAOR,EAAKC,KAAKO,iBACnB,MAEDT,OAAMC,IAAQ,CAIb,cAAIS,GACF,OAAOT,EAAKG,QAAQM,UACtB,MAEDC,SAAQV,IAAQ,CAMfW,YAAAA,CAAaC,GACXZ,EAAKJ,UAAYgB,CACnB,EAMAC,cAAAA,GACEb,EAAKJ,eAAYC,CACnB,EAIAiB,UAAAA,CAAWF,GACTZ,EAAKF,QAAUc,CACjB,KAEN,CASO,SAASG,EAAcH,GAC5B,MAAO,OAAQA,GAAS,SAAUA,GAAS,SAAUA,CACvD,C,qGC3HO,SAASI,EAAiCC,GAC/C,OAAO7B,EAAAA,MACJC,MAAM,CAIL6B,oBAAqB9B,EAAAA,MAAM+B,MACzBF,EAAcG,iBACZ,aACA,iBAILrB,OAAMC,IAAQ,CAIb,eAAIqB,GACF,MAAM,QAAElB,GAAYH,EACpB,OAAO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AAQ,IAG5CrE,GAAkBwD,EACpBpD,EAAAA,cAACkE,EAAmB,CAClBtE,eAAgBA,EAChBjE,MAAOyH,EACP1D,QAASA,IAET,KACJM,EAAAA,cAAA,OAAKwD,UAAWP,EAAQR,kBACtBzC,EAAAA,cAACmE,EAAAA,EAAM,CACLC,SAAyB,IAAfrB,EACVsB,QAASA,KACPrB,EAAcD,EAAa,EAAE,EAE/BS,UAAWP,EAAQV,QACpB,QAGDvC,EAAAA,cAACmE,EAAAA,EAAM,CACLC,WAEoB,IAAfrB,GAAoBnD,GACL,IAAfmD,GAAoBK,GAGzB5B,QAAQ,YACR8C,MAAM,UACND,QAASA,KACP,GAAItB,IAAeJ,EAAMzE,OAAS,EAAG,CACnC,GAAIkF,IAAe3D,EAAAA,EAAAA,GAAyBC,GAAU,CACpD,MAAM6E,EAAO7E,EAAQL,kBAAkB+D,GACvC1D,EAAQ9B,eAAe2G,EACzB,MACE7E,EAAQ8E,OAAO,2BAGbC,EAAAA,EAAAA,2BAA0B/E,IAC5BA,EAAQgF,WAAW/I,EAEvB,MACEqH,EAAcD,EAAa,EAC7B,EAEFS,UAAWP,EAAQV,OACnB,cAAY,qBAEXQ,IAAeJ,EAAMzE,OAAS,EAAI,UAAY,cASjE,G","sources":["../../../packages/product-core/src/Session/BaseSession.ts","../../../packages/product-core/src/Session/Connections.ts","../../../plugins/data-management/src/AddConnectionWidget/components/ConfigureConnection.tsx","../../../plugins/data-management/src/AddConnectionWidget/components/ConnectionTypeSelect.tsx","../../../plugins/data-management/src/AddConnectionWidget/components/AddConnectionWidget.tsx"],"sourcesContent":["import PluginManager from '@jbrowse/core/PluginManager'\nimport {\n  IAnyStateTreeNode,\n  Instance,\n  getParent,\n  isStateTreeNode,\n  types,\n} from 'mobx-state-tree'\nimport { AnyConfigurationSchemaType } from '@jbrowse/core/configuration'\nimport { BaseAssemblyConfigSchema } from '@jbrowse/core/assemblyManager'\n\n// locals\nimport type { BaseRootModelType } from '../RootModel/BaseRootModel'\nimport { ElementId } from '@jbrowse/core/util/types/mst'\n\n/**\n * #stateModel BaseSessionModel\n *\n * base session shared by all JBrowse products. Be careful what you include\n * here, everything will use it.\n */\nexport function BaseSessionModel<\n  ROOT_MODEL_TYPE extends BaseRootModelType,\n  JB_CONFIG_SCHEMA extends AnyConfigurationSchemaType,\n>(_pluginManager: PluginManager) {\n  return types\n    .model({\n      /**\n       * #property\n       */\n      id: ElementId,\n      /**\n       * #property\n       */\n      name: types.string,\n      /**\n       * #property\n       */\n      margin: 0,\n    })\n    .volatile(() => ({\n      /**\n       * #volatile\n       * this is the globally \"selected\" object. can be anything. code that\n       * wants to deal with this should examine it to see what kind of thing it\n       * is.\n       */\n      selection: undefined as unknown,\n      /**\n       * #volatile\n       * this is the globally \"hovered\" object. can be anything. code that\n       * wants to deal with this should examine it to see what kind of thing it\n       * is.\n       */\n      hovered: undefined as unknown,\n    }))\n    .views(self => ({\n      /**\n       * #getter\n       */\n      get root() {\n        return getParent<ROOT_MODEL_TYPE>(self)\n      },\n    }))\n    .views(self => ({\n      /**\n       * #getter\n       */\n      get jbrowse() {\n        return self.root.jbrowse\n      },\n      /**\n       * #getter\n       */\n      get rpcManager() {\n        return self.root.rpcManager\n      },\n      /**\n       * #getter\n       */\n      get configuration(): Instance<JB_CONFIG_SCHEMA> {\n        return this.jbrowse.configuration\n      },\n      /**\n       * #getter\n       */\n      get adminMode() {\n        return self.root.adminMode\n      },\n\n      /**\n       * #getter\n       */\n      get textSearchManager() {\n        return self.root.textSearchManager\n      },\n    }))\n    .views(self => ({\n      /**\n       * #getter\n       */\n      get assemblies(): Instance<BaseAssemblyConfigSchema>[] {\n        return self.jbrowse.assemblies\n      },\n    }))\n    .actions(self => ({\n      /**\n       * #action\n       * set the global selection, i.e. the globally-selected object. can be a\n       * feature, a view, just about anything\n       */\n      setSelection(thing: unknown) {\n        self.selection = thing\n      },\n\n      /**\n       * #action\n       * clears the global selection\n       */\n      clearSelection() {\n        self.selection = undefined\n      },\n      /**\n       * #action\n       */\n      setHovered(thing: unknown) {\n        self.hovered = thing\n      },\n    }))\n}\n\n/** Session mixin MST type for the most basic session */\nexport type BaseSessionType = ReturnType<typeof BaseSessionModel>\n\n/** Instance of the most basic possible session */\nexport type BaseSession = Instance<BaseSessionType>\n\n/** Type guard for BaseSession */\nexport function isBaseSession(thing: IAnyStateTreeNode): thing is BaseSession {\n  return 'id' in thing && 'name' in thing && 'root' in thing\n}\n\n/** Type guard for whether a thing is JBrowse session */\nexport function isSession(thing: unknown): thing is BaseSession {\n  return isStateTreeNode(thing) && isBaseSession(thing)\n}\n","import PluginManager from '@jbrowse/core/PluginManager'\nimport {\n  AnyConfigurationModel,\n  readConfObject,\n} from '@jbrowse/core/configuration'\nimport { IAnyStateTreeNode, Instance, types } from 'mobx-state-tree'\nimport { BaseConnectionConfigModel } from '@jbrowse/core/pluggableElementTypes/models/baseConnectionConfig'\nimport { BaseConnectionModel } from '@jbrowse/core/pluggableElementTypes/models/BaseConnectionModelFactory'\n\n// locals\nimport type { BaseRootModelType } from '../RootModel/BaseRootModel'\nimport type { SessionWithReferenceManagementType } from './ReferenceManagement'\nimport { isBaseSession } from './BaseSession'\n\n/**\n * #stateModel ConnectionManagementSessionMixin\n */\nexport function ConnectionManagementSessionMixin(pluginManager: PluginManager) {\n  return types\n    .model({\n      /**\n       * #property\n       */\n      connectionInstances: types.array(\n        pluginManager.pluggableMstType(\n          'connection',\n          'stateModel',\n        ) as BaseConnectionModel,\n      ),\n    })\n    .views(self => ({\n      /**\n       * #getter\n       */\n      get connections(): BaseConnectionConfigModel[] {\n        const { jbrowse } = self as typeof self & Instance<BaseRootModelType>\n        return jbrowse.connections\n      },\n    }))\n    .actions(self => ({\n      /**\n       * #action\n       */\n      makeConnection(\n        configuration: AnyConfigurationModel,\n        initialSnapshot = {},\n      ) {\n        const type = configuration.type as string\n        if (!type) {\n          throw new Error('track configuration has no `type` listed')\n        }\n        const name = readConfObject(configuration, 'name')\n        const connectionType = pluginManager.getConnectionType(type)\n        if (!connectionType) {\n          throw new Error(`unknown connection type ${type}`)\n        }\n        const length = self.connectionInstances.push({\n          ...initialSnapshot,\n          name,\n          // @ts-expect-error unsure why ts doesn't like `type` here, but is\n          // needed\n          type,\n          configuration,\n        })\n        return self.connectionInstances[length - 1]\n      },\n\n      /**\n       * #action\n       */\n      prepareToBreakConnection(configuration: AnyConfigurationModel) {\n        const root = self as typeof self &\n          Instance<SessionWithReferenceManagementType>\n        const callbacksToDeref: (() => void)[] = []\n        const derefTypeCount: Record<string, number> = {}\n        const name = readConfObject(configuration, 'name')\n        const connection = self.connectionInstances.find(c => c.name === name)\n        if (!connection) {\n          return undefined\n        }\n        for (const track of connection.tracks) {\n          const ref = root.getReferring(track)\n          root.removeReferring(ref, track, callbacksToDeref, derefTypeCount)\n        }\n        return [\n          () => {\n            callbacksToDeref.forEach(cb => {\n              cb()\n            })\n            this.breakConnection(configuration)\n          },\n          derefTypeCount,\n        ]\n      },\n\n      /**\n       * #action\n       */\n      breakConnection(configuration: AnyConfigurationModel) {\n        const name = readConfObject(configuration, 'name')\n        const connection = self.connectionInstances.find(c => c.name === name)\n        if (!connection) {\n          throw new Error(`no connection found with name ${name}`)\n        }\n        self.connectionInstances.remove(connection)\n      },\n\n      /**\n       * #action\n       */\n      deleteConnection(configuration: AnyConfigurationModel) {\n        const { jbrowse } = self as typeof self & Instance<BaseRootModelType>\n        return jbrowse.deleteConnectionConf(configuration)\n      },\n\n      /**\n       * #action\n       */\n      addConnectionConf(connectionConf: AnyConfigurationModel) {\n        const { jbrowse } = self as typeof self & Instance<BaseRootModelType>\n        return jbrowse.addConnectionConf(connectionConf)\n      },\n\n      /**\n       * #action\n       */\n      clearConnections() {\n        self.connectionInstances.clear()\n      },\n    }))\n}\n\n/** Session mixin MST type for a session that has connections */\nexport type SessionWithConnectionsType = ReturnType<\n  typeof ConnectionManagementSessionMixin\n>\n\n/** Instance of a session that has connections: `connectionInstances`,\n * `makeConnection()`, etc. */\nexport type SessionWithConnections = Instance<SessionWithConnectionsType>\n\n/** Type guard for SessionWithConnections */\nexport function isSessionWithConnections(\n  session: IAnyStateTreeNode,\n): session is SessionWithConnections {\n  return isBaseSession(session) && 'connectionInstances' in session\n}\n","import React, { Suspense } from 'react'\nimport { observer } from 'mobx-react'\nimport { ConfigurationEditor } from '@jbrowse/plugin-config'\nimport { ConnectionType } from '@jbrowse/core/pluggableElementTypes'\nimport { AnyConfigurationModel } from '@jbrowse/core/configuration'\nimport { AbstractSessionModel } from '@jbrowse/core/util'\nimport { LoadingEllipses } from '@jbrowse/core/ui'\n\nconst ConfigureConnection = observer(function ({\n  connectionType,\n  model,\n  session,\n}: {\n  connectionType: ConnectionType\n  model: AnyConfigurationModel\n  session: AbstractSessionModel\n}) {\n  const ConfigEditorComponent =\n    connectionType.configEditorComponent || ConfigurationEditor\n\n  return (\n    <Suspense fallback={<LoadingEllipses />}>\n      <ConfigEditorComponent model={{ target: model }} session={session} />\n    </Suspense>\n  )\n})\n\nexport default ConfigureConnection\n","import React, { useEffect } from 'react'\nimport { IconButton, MenuItem, TextField } from '@mui/material'\nimport { ConnectionType } from '@jbrowse/core/pluggableElementTypes'\nimport { observer } from 'mobx-react'\n\n// icons\nimport OpenInNewIcon from '@mui/icons-material/OpenInNew'\n\nconst ConnectionTypeSelect = observer(function ConnectionTypeSelect({\n  connectionTypeChoices,\n  connectionType,\n  setConnectionType,\n}: {\n  connectionTypeChoices: ConnectionType[]\n  connectionType?: ConnectionType\n  setConnectionType: (c?: ConnectionType) => void\n}) {\n  const firstChoice = connectionTypeChoices[0]\n  useEffect(() => {\n    if (!connectionType) {\n      setConnectionType(firstChoice)\n    }\n  }, [connectionType, firstChoice, setConnectionType])\n\n  return (\n    <form autoComplete=\"off\">\n      {connectionType ? (\n        <TextField\n          value={connectionType.name}\n          label=\"connectionType\"\n          helperText={\n            connectionType.description ? (\n              <>\n                {connectionType.description}\n                {connectionType.url ? (\n                  <IconButton\n                    href={connectionType.url}\n                    rel=\"noopener noreferrer\"\n                    target=\"_blank\"\n                  >\n                    <OpenInNewIcon />\n                  </IconButton>\n                ) : null}\n              </>\n            ) : null\n          }\n          select\n          fullWidth\n          onChange={event => {\n            setConnectionType(\n              connectionTypeChoices.find(c => c.name === event.target.value),\n            )\n          }}\n          variant=\"outlined\"\n        >\n          {connectionTypeChoices.map(c => (\n            <MenuItem key={c.name} value={c.name}>\n              {c.displayName || c.name}\n            </MenuItem>\n          ))}\n        </TextField>\n      ) : null}\n    </form>\n  )\n})\n\nexport default ConnectionTypeSelect\n","import React, { useMemo, useState } from 'react'\nimport { Button, Step, StepContent, StepLabel, Stepper } from '@mui/material'\nimport {\n  getSession,\n  getEnv,\n  isSessionModelWithWidgets,\n} from '@jbrowse/core/util'\nimport { makeStyles } from 'tss-react/mui'\nimport { observer } from 'mobx-react'\nimport { ConnectionType } from '@jbrowse/core/pluggableElementTypes'\n\n// locals\nimport ConfigureConnection from './ConfigureConnection'\nimport ConnectionTypeSelect from './ConnectionTypeSelect'\nimport { isSessionWithConnections } from '@jbrowse/product-core'\n\nconst useStyles = makeStyles()(theme => ({\n  root: {\n    marginTop: theme.spacing(1),\n  },\n  stepper: {\n    backgroundColor: theme.palette.background.default,\n  },\n  button: {\n    marginTop: theme.spacing(1),\n    marginRight: theme.spacing(1),\n  },\n  actionsContainer: {\n    marginBottom: theme.spacing(2),\n  },\n}))\n\nconst steps = ['Select a Connection Type', 'Configure Connection']\n\nconst AddConnectionWidget = observer(function ({ model }: { model: unknown }) {\n  const [connectionType, setConnectionType] = useState<ConnectionType>()\n  const [connectionId, setConnectionId] = useState<string>()\n  const [activeStep, setActiveStep] = useState(0)\n  const { classes } = useStyles()\n  const session = getSession(model)\n  const { pluginManager } = getEnv(session)\n\n  // useMemo is needed for react@18+mobx-react@9, previous code called configScema.create directly in a setConfigModel useState hook setter but this caused infinite loop\n  const configModel = useMemo(\n    () => connectionType?.configSchema.create({ connectionId }, getEnv(model)),\n    [connectionId, connectionType, model],\n  )\n\n  return (\n    <div className={classes.root}>\n      <Stepper\n        className={classes.stepper}\n        activeStep={activeStep}\n        orientation=\"vertical\"\n      >\n        {steps.map(label => (\n          <Step key={label}>\n            <StepLabel>{label}</StepLabel>\n            <StepContent>\n              {activeStep === 0 ? (\n                <ConnectionTypeSelect\n                  connectionTypeChoices={pluginManager.getConnectionElements()}\n                  connectionType={connectionType}\n                  setConnectionType={c => {\n                    setConnectionType(c)\n                    if (!c) {\n                      return\n                    }\n                    setConnectionId(`${c.name}-${Date.now()}`)\n                  }}\n                />\n              ) : connectionType && configModel ? (\n                <ConfigureConnection\n                  connectionType={connectionType}\n                  model={configModel}\n                  session={session}\n                />\n              ) : null}\n              <div className={classes.actionsContainer}>\n                <Button\n                  disabled={activeStep === 0}\n                  onClick={() => {\n                    setActiveStep(activeStep - 1)\n                  }}\n                  className={classes.button}\n                >\n                  Back\n                </Button>\n                <Button\n                  disabled={\n                    !(\n                      (activeStep === 0 && connectionType) ||\n                      (activeStep === 1 && configModel)\n                    )\n                  }\n                  variant=\"contained\"\n                  color=\"primary\"\n                  onClick={() => {\n                    if (activeStep === steps.length - 1) {\n                      if (configModel && isSessionWithConnections(session)) {\n                        const conf = session.addConnectionConf(configModel)\n                        session.makeConnection(conf)\n                      } else {\n                        session.notify('No config model to add')\n                      }\n\n                      if (isSessionModelWithWidgets(session)) {\n                        session.hideWidget(model)\n                      }\n                    } else {\n                      setActiveStep(activeStep + 1)\n                    }\n                  }}\n                  className={classes.button}\n                  data-testid=\"addConnectionNext\"\n                >\n                  {activeStep === steps.length - 1 ? 'Connect' : 'Next'}\n                </Button>\n              </div>\n            </StepContent>\n          </Step>\n        ))}\n      </Stepper>\n    </div>\n  )\n})\n\nexport default AddConnectionWidget\n"],"names":["BaseSessionModel","_pluginManager","types","model","id","ElementId","name","string","margin","volatile","selection","undefined","hovered","views","self","root","getParent","jbrowse","rpcManager","configuration","this","adminMode","textSearchManager","assemblies","actions","setSelection","thing","clearSelection","setHovered","isBaseSession","ConnectionManagementSessionMixin","pluginManager","connectionInstances","array","pluggableMstType","connections","makeConnection","initialSnapshot","type","Error","readConfObject","getConnectionType","length","push","prepareToBreakConnection","callbacksToDeref","derefTypeCount","connection","find","c","track","tracks","ref","getReferring","removeReferring","forEach","cb","breakConnection","remove","deleteConnection","deleteConnectionConf","addConnectionConf","connectionConf","clearConnections","clear","isSessionWithConnections","session","observer","connectionType","ConfigEditorComponent","configEditorComponent","ConfigurationEditor","React","Suspense","fallback","LoadingEllipses","target","connectionTypeChoices","setConnectionType","firstChoice","useEffect","autoComplete","TextField","value","label","helperText","description","url","IconButton","href","rel","OpenInNewIcon","select","fullWidth","onChange","event","variant","map","MenuItem","key","displayName","useStyles","makeStyles","theme","marginTop","spacing","stepper","backgroundColor","palette","background","default","button","marginRight","actionsContainer","marginBottom","steps","useState","connectionId","setConnectionId","activeStep","setActiveStep","classes","getSession","getEnv","configModel","useMemo","configSchema","create","className","Stepper","orientation","Step","StepLabel","StepContent","ConnectionTypeSelect","getConnectionElements","Date","now","ConfigureConnection","Button","disabled","onClick","color","conf","notify","isSessionModelWithWidgets","hideWidget"],"sourceRoot":""}