@babylonjs/shared-ui-components 9.9.1 → 9.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fluent/hoc/childWindow.js +45 -130
- package/fluent/hoc/childWindow.js.map +1 -1
- package/fluent/hoc/popupWindow.d.ts +75 -0
- package/fluent/hoc/popupWindow.js +156 -0
- package/fluent/hoc/popupWindow.js.map +1 -0
- package/fluent/primitives/button.d.ts +12 -0
- package/fluent/primitives/button.js +2 -2
- package/fluent/primitives/button.js.map +1 -1
- package/fluent/primitives/dialog.js +1 -1
- package/fluent/primitives/dialog.js.map +1 -1
- package/fluent/primitives/toggleButton.d.ts +2 -0
- package/fluent/primitives/toggleButton.js +2 -2
- package/fluent/primitives/toggleButton.js.map +1 -1
- package/fluent/primitives/tooltip.d.ts +8 -0
- package/fluent/primitives/tooltip.js +2 -2
- package/fluent/primitives/tooltip.js.map +1 -1
- package/modularTool/components/errorBoundary.js +3 -0
- package/modularTool/components/errorBoundary.js.map +1 -1
- package/modularTool/components/theme.d.ts +5 -0
- package/modularTool/components/theme.js +27 -3
- package/modularTool/components/theme.js.map +1 -1
- package/modularTool/contexts/dialogContext.d.ts +14 -0
- package/modularTool/contexts/dialogContext.js +13 -0
- package/modularTool/contexts/dialogContext.js.map +1 -0
- package/modularTool/modularTool.js +64 -3
- package/modularTool/modularTool.js.map +1 -1
- package/modularTool/services/dialogService.d.ts +22 -0
- package/modularTool/services/dialogService.js +5 -0
- package/modularTool/services/dialogService.js.map +1 -0
- package/modularTool/services/shellService.js +15 -0
- package/modularTool/services/shellService.js.map +1 -1
- package/nodeGraphSystem/graphCanvas.d.ts +5 -1
- package/nodeGraphSystem/graphCanvas.js +6 -2
- package/nodeGraphSystem/graphCanvas.js.map +1 -1
- package/nodeGraphSystem/graphNode.d.ts +5 -1
- package/nodeGraphSystem/graphNode.js +13 -5
- package/nodeGraphSystem/graphNode.js.map +1 -1
- package/nodeGraphSystem/nodeLink.d.ts +6 -1
- package/nodeGraphSystem/nodeLink.js +9 -2
- package/nodeGraphSystem/nodeLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modularTool.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/modularTool/modularTool.tsx"],"names":[],"mappings":";AAAA,OAAO,EAMH,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,GACX,MAAM,OAAO,CAAC;AAGf,OAAO,EAA2C,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7G,OAAO,EAAqC,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAuB,aAAa,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAwD,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACzJ,OAAO,EAAkB,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAE7G,OAAO,EACH,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,MAAM,GACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAuC,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClH,OAAO,EAAsB,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AA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B,EAAE,SAAS,CAAC,IAAI,sCAAsC,GAAS,GACnG,EACX,KAAC,QAAQ,cACL,KAAC,KAAK,cAAE,GAAG,qBAAqB,EAAE,KAAK,EAAE,GAAS,GAC3C,IACR,GACK,EAChB,KAAC,aAAa,cACV,KAAC,MAAM,IAAC,UAAU,EAAC,SAAS,EAAC,OAAO,EAAE,mCAAmC,sBAEhE,GACG,IACP,GACD,GACX,EACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,OAAO,IAAC,SAAS,EAAE,OAAO,CAAC,OAAO,GAAI,YACvD,KAAC,OAAO,KAAG,GACJ,IACC,GACZ,GACuB,GACP,GACb,CAC1B,CAAC;QACN,CAAC;IACL,CAAC,CAAC;IAEF,+FAA+F;IAC/F,MAAM,+BAA+B,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC;IACvE,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAExC,8CAA8C;IAC9C,MAAM,SAAS,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC/C,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAE1D,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,OAAO;QACH,qEAAqE;QACrE,OAAO,EAAE,GAAG,EAAE;YACV,8DAA8D;YAC9D,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACZ,QAAQ,GAAG,IAAI,CAAC;gBAChB,SAAS,CAAC,OAAO,EAAE,CAAC;gBACpB,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,+BAA+B,CAAC;YACrE,CAAC;YACD,qDAAqD;YACrD,uDAAuD;YACvD,OAAO,eAAe,CAAC,OAAO,CAAC;QACnC,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {\r\n type ComponentType,\r\n type Context,\r\n type FunctionComponent,\r\n type PropsWithChildren,\r\n type ReactNode,\r\n createElement,\r\n Suspense,\r\n useCallback,\r\n useEffect,\r\n useReducer,\r\n useState,\r\n} from \"react\";\r\n\r\nimport { type IExtensionFeed } from \"./extensibility/extensionFeed\";\r\nimport { type IExtension, type InstallFailedInfo, ExtensionManager } from \"./extensibility/extensionManager\";\r\nimport { type WeaklyTypedServiceDefinition, ServiceContainer } from \"./modularity/serviceContainer\";\r\nimport { type ISettingsStore, SettingsStore, SettingsStoreIdentity } from \"./services/settingsStore\";\r\nimport { type IRootComponentService, type ShellServiceOptions, MakeShellServiceDefinition, RootComponentServiceIdentity } from \"./services/shellService\";\r\nimport { type ThemeMode, ThemeModeSettingDescriptor, ThemeServiceDefinition } from \"./services/themeService\";\r\n\r\nimport {\r\n Body1,\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogBody,\r\n DialogContent,\r\n DialogSurface,\r\n DialogTitle,\r\n List,\r\n ListItem,\r\n makeStyles,\r\n Spinner,\r\n tokens,\r\n} from \"@fluentui/react-components\";\r\nimport { ErrorCircleRegular } from \"@fluentui/react-icons\";\r\nimport { createRoot } from \"react-dom/client\";\r\n\r\nimport { Deferred } from \"core/Misc/deferred\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { type ToastHandle, type ToastOptions, ToastProvider } from \"shared-ui-components/fluent/primitives/toast\";\r\nimport { type IToastService, ToastServiceIdentity } from \"./services/toastService\";\r\nimport { Theme } from \"./components/theme\";\r\nimport { ExtensionManagerContext } from \"./contexts/extensionManagerContext\";\r\nimport { SettingsStoreContext } from \"./contexts/settingsContext\";\r\nimport { type IReactContextService, type ReactContextHandle, ReactContextServiceIdentity } from \"./services/reactContextService\";\r\nimport { ThemeSelectorServiceDefinition } from \"./services/themeSelectorService\";\r\n\r\nconst useStyles = makeStyles({\r\n app: {\r\n colorScheme: \"light dark\",\r\n flexGrow: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n spinner: {\r\n flexGrow: 1,\r\n animationDuration: \"1s\",\r\n animationName: {\r\n from: { opacity: 0 },\r\n to: { opacity: 1 },\r\n },\r\n },\r\n extensionErrorTitleDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n gap: tokens.spacingHorizontalS,\r\n },\r\n extensionErrorIcon: {\r\n color: tokens.colorPaletteRedForeground1,\r\n },\r\n});\r\n\r\ntype ReactContextEntry = {\r\n provider: Context<unknown>[\"Provider\"];\r\n value: unknown;\r\n order: number;\r\n};\r\n\r\ntype ReactContextAction =\r\n | { type: \"add\"; entry: ReactContextEntry }\r\n | { type: \"remove\"; provider: Context<unknown>[\"Provider\"] }\r\n | { type: \"update\"; provider: Context<unknown>[\"Provider\"]; value: unknown };\r\n\r\nconst ReactContextsWrapper: FunctionComponent<PropsWithChildren<{ contexts: readonly Readonly<ReactContextEntry>[] }>> = ({ contexts, children }) => {\r\n return <>{contexts.reduceRight<ReactNode>((acc, entry) => createElement(entry.provider, { value: entry.value }, acc), children)}</>;\r\n};\r\n\r\nexport type ModularToolOptions = {\r\n /**\r\n * The namespace for the tool, used for scoping persisted settings and other storage.\r\n */\r\n namespace: string;\r\n\r\n /**\r\n * The container element where the tool will be rendered.\r\n */\r\n containerElement: HTMLElement;\r\n\r\n /**\r\n * The service definitions to be registered with the tool.\r\n */\r\n serviceDefinitions: readonly WeaklyTypedServiceDefinition[];\r\n\r\n /**\r\n * The theme mode to use. If not specified, the default is \"system\", which uses the system/browser preference, and the last used mode is persisted.\r\n */\r\n themeMode?: ThemeMode;\r\n\r\n /**\r\n * Whether to show the theme selector in the toolbar. Default is true.\r\n */\r\n showThemeSelector?: boolean;\r\n\r\n /**\r\n * The extension feeds that provide optional extensions the user can install.\r\n */\r\n extensionFeeds?: readonly IExtensionFeed[];\r\n\r\n /**\r\n * An optional parent ServiceContainer. Dependencies not found in the tool's own container\r\n * will be resolved from this parent.\r\n */\r\n parentContainer?: ServiceContainer;\r\n} & ShellServiceOptions;\r\n\r\n/**\r\n * Creates a modular tool with a base set of common tool services, including the toolbar/side pane basic UI layout.\r\n * @param options The options for the tool.\r\n * @returns A token that can be used to dispose of the tool.\r\n */\r\nexport function MakeModularTool(options: ModularToolOptions) {\r\n const { namespace, containerElement, serviceDefinitions, themeMode, showThemeSelector = true, extensionFeeds = [], parentContainer } = options;\r\n\r\n // Create the settings store immediately as it will be exposed to services and through React context.\r\n const settingsStore = new SettingsStore(namespace);\r\n\r\n // If a theme mode is provided, just write the setting so it is the active theme.\r\n if (themeMode) {\r\n settingsStore.writeSetting(ThemeModeSettingDescriptor, themeMode);\r\n }\r\n\r\n // This deferred resolves once the React effect cleanup (which disposes the ServiceContainer) is complete.\r\n const disposeDeferred = new Deferred<void>();\r\n\r\n const modularToolRootComponent: FunctionComponent = () => {\r\n const classes = useStyles();\r\n const [extensionManagerContext, setExtensionManagerContext] = useState<ExtensionManagerContext>();\r\n const [requiredExtensions, setRequiredExtensions] = useState<string[]>();\r\n const [requiredExtensionsDeferred, setRequiredExtensionsDeferred] = useState<Deferred<boolean>>();\r\n const [extensionInstallError, setExtensionInstallError] = useState<InstallFailedInfo>();\r\n\r\n const [toastHandle, setToastHandle] = useState<ToastHandle | null>(null);\r\n const [toastQueue, setToastQueue] = useState<{ message: string; options?: ToastOptions }[]>([]);\r\n\r\n useEffect(() => {\r\n if (toastHandle && toastQueue.length > 0) {\r\n for (const { message, options } of toastQueue) {\r\n toastHandle.showToast(message, options);\r\n }\r\n setToastQueue([]);\r\n }\r\n }, [toastHandle, toastQueue]);\r\n\r\n const [rootComponentService, setRootComponentService] = useState<IRootComponentService>();\r\n\r\n const [contexts, updateContexts] = useReducer((state: ReactContextEntry[], action: ReactContextAction): ReactContextEntry[] => {\r\n switch (action.type) {\r\n case \"add\":\r\n return [...state, action.entry].sort((a, b) => a.order - b.order);\r\n case \"remove\":\r\n return state.filter((e) => e.provider !== action.provider);\r\n case \"update\":\r\n return state.map((e) => (e.provider === action.provider ? { ...e, value: action.value } : e));\r\n }\r\n }, []);\r\n\r\n // This is the main async initialization.\r\n useEffect(() => {\r\n const initializeExtensionManagerAsync = async () => {\r\n const serviceContainer = new ServiceContainer(\"ModularToolContainer\", parentContainer);\r\n\r\n // Expose the settings store as a service so other services can read/write settings.\r\n serviceContainer.addService<[ISettingsStore], []>({\r\n friendlyName: \"Settings Store\",\r\n produces: [SettingsStoreIdentity],\r\n factory: () => settingsStore,\r\n });\r\n\r\n // Expose the react context service so other services can add React context providers.\r\n serviceContainer.addService<[IReactContextService], []>({\r\n friendlyName: \"React Context Service\",\r\n produces: [ReactContextServiceIdentity],\r\n factory: (): IReactContextService => ({\r\n addContext<T>(provider: Context<T>[\"Provider\"], initialValue: T, options?: { order?: number }): ReactContextHandle<T> {\r\n const typedProvider = provider as Context<unknown>[\"Provider\"];\r\n updateContexts({ type: \"add\", entry: { provider: typedProvider, value: initialValue, order: options?.order ?? 0 } });\r\n return {\r\n updateValue: (newValue: T) => {\r\n updateContexts({ type: \"update\", provider: typedProvider, value: newValue });\r\n },\r\n dispose: () => {\r\n updateContexts({ type: \"remove\", provider: typedProvider });\r\n },\r\n };\r\n },\r\n }),\r\n });\r\n\r\n // Expose the toast service so non-React code (e.g. Observable callbacks) can show toasts.\r\n serviceContainer.addService<[IToastService], []>({\r\n friendlyName: \"Toast Service\",\r\n produces: [ToastServiceIdentity],\r\n factory: (): IToastService => ({\r\n showToast: (message, options) => {\r\n setToastQueue((prev) => [...prev, { message, options }]);\r\n },\r\n }),\r\n });\r\n\r\n // Register the shell service (top level toolbar/side pane UI layout).\r\n serviceContainer.addService(MakeShellServiceDefinition(options));\r\n\r\n // Register a service that simply consumes the services we need before first render.\r\n serviceContainer.addService<[], [IRootComponentService]>({\r\n friendlyName: \"Service Bootstrapper\",\r\n consumes: [RootComponentServiceIdentity],\r\n factory: (rootComponent) => {\r\n // Use function syntax for the state setter since the root component may be a function component.\r\n setRootComponentService(() => rootComponent);\r\n return {\r\n dispose: () => setRootComponentService(undefined),\r\n };\r\n },\r\n });\r\n\r\n // Register the theme service (exposes the current theme to other services).\r\n serviceContainer.addService(ThemeServiceDefinition);\r\n\r\n // Register the theme selector service (for selecting the theme) if theming is configured.\r\n if (showThemeSelector) {\r\n serviceContainer.addService(ThemeSelectorServiceDefinition);\r\n }\r\n\r\n // Register the extension list service (for browsing/installing extensions) if extension feeds are provided.\r\n if (extensionFeeds.length > 0) {\r\n const { ExtensionListServiceDefinition } = await import(\"./services/extensionsListService\");\r\n serviceContainer.addService(ExtensionListServiceDefinition);\r\n }\r\n\r\n // Register all external services (that make up a unique tool).\r\n serviceContainer.addServices(...serviceDefinitions);\r\n\r\n // Create the extension manager, passing along the registry for runtime changes to the registered services.\r\n const extensionManager = await ExtensionManager.CreateAsync(namespace, serviceContainer, extensionFeeds, setExtensionInstallError);\r\n\r\n // Check query params for required extensions. This lets users share links with sets of extensions.\r\n const queryParams = new URLSearchParams(window.location.search);\r\n const requiredExtensions = queryParams.getAll(\"babylon.requiredExtension\");\r\n const uninstalledExtensions: IExtension[] = [];\r\n for (const requiredExtension of requiredExtensions) {\r\n // These could possibly be parallelized to speed things up, but it's more complex so let's wait and see if we need it.\r\n // eslint-disable-next-line no-await-in-loop\r\n const query = await extensionManager.queryExtensionsAsync(requiredExtension);\r\n // eslint-disable-next-line no-await-in-loop\r\n const extensions = await query.getExtensionsAsync(0, query.totalCount);\r\n for (const extension of extensions) {\r\n if (!extension.isInstalled) {\r\n uninstalledExtensions.push(extension);\r\n }\r\n }\r\n }\r\n\r\n // Check if any required extensions are uninstalled or disabled. If so, show a dialog to the user.\r\n if (uninstalledExtensions.length > 0) {\r\n setRequiredExtensions(uninstalledExtensions.map((extension) => extension.metadata.name));\r\n const deferred = new Deferred<boolean>();\r\n setRequiredExtensionsDeferred(deferred);\r\n if (await deferred.promise) {\r\n for (const extension of uninstalledExtensions) {\r\n // This could possibly be parallelized to speed things up, but it's more complex so let's wait and see if we need it.\r\n // eslint-disable-next-line no-await-in-loop\r\n await extension.installAsync();\r\n }\r\n }\r\n }\r\n\r\n // Set the contexts.\r\n setExtensionManagerContext({ extensionManager });\r\n\r\n return () => {\r\n extensionManager.dispose();\r\n serviceContainer.dispose();\r\n serviceContainer.dispose();\r\n };\r\n };\r\n\r\n const disposePromise = initializeExtensionManagerAsync();\r\n\r\n return () => {\r\n disposePromise\r\n // eslint-disable-next-line github/no-then\r\n .then((dispose) => dispose())\r\n // eslint-disable-next-line github/no-then\r\n .catch((error) => {\r\n Logger.Error(`Failed to dispose of the modular tool: ${error}`);\r\n })\r\n .finally(() => disposeDeferred.resolve());\r\n };\r\n }, []);\r\n\r\n const onAcceptRequiredExtensions = useCallback(() => {\r\n setRequiredExtensions(undefined);\r\n requiredExtensionsDeferred?.resolve(true);\r\n }, [setRequiredExtensions, requiredExtensionsDeferred]);\r\n\r\n const onRejectRequiredExtensions = useCallback(() => {\r\n setRequiredExtensions(undefined);\r\n requiredExtensionsDeferred?.resolve(false);\r\n }, [setRequiredExtensions, requiredExtensionsDeferred]);\r\n\r\n const onAcknowledgedExtensionInstallError = useCallback(() => {\r\n setExtensionInstallError(undefined);\r\n }, [setExtensionInstallError]);\r\n\r\n // Show a spinner until a main view has been set.\r\n if (!rootComponentService) {\r\n return (\r\n <ReactContextsWrapper contexts={contexts}>\r\n <SettingsStoreContext.Provider value={settingsStore}>\r\n <Theme className={classes.app}>\r\n <Spinner className={classes.spinner} />\r\n </Theme>\r\n </SettingsStoreContext.Provider>\r\n </ReactContextsWrapper>\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const Content: ComponentType = rootComponentService.rootComponent;\r\n\r\n return (\r\n <ReactContextsWrapper contexts={contexts}>\r\n {/* Expose the settings store as a React context so that UI components can read/write\r\n settings without the ISettingsService needing to be explicitly passed around. */}\r\n <SettingsStoreContext.Provider value={settingsStore}>\r\n <ExtensionManagerContext.Provider value={extensionManagerContext}>\r\n <Theme className={classes.app}>\r\n <ToastProvider imperativeRef={setToastHandle}>\r\n <Dialog open={!!requiredExtensions} modalType=\"alert\">\r\n <DialogSurface>\r\n <DialogBody>\r\n <DialogTitle>Required Extensions</DialogTitle>\r\n <DialogContent>\r\n Opening this URL requires the following extensions to be installed and enabled:\r\n <ul>\r\n {requiredExtensions?.map((name) => (\r\n <li key={name}>{name}</li>\r\n ))}\r\n </ul>\r\n </DialogContent>\r\n <DialogActions>\r\n <Button appearance=\"primary\" onClick={onAcceptRequiredExtensions}>\r\n Install & Enable\r\n </Button>\r\n <Button appearance=\"secondary\" onClick={onRejectRequiredExtensions}>\r\n No Thanks\r\n </Button>\r\n </DialogActions>\r\n </DialogBody>\r\n </DialogSurface>\r\n </Dialog>\r\n <Dialog open={!!extensionInstallError} modalType=\"alert\">\r\n <DialogSurface>\r\n <DialogBody>\r\n <DialogTitle>\r\n <div className={classes.extensionErrorTitleDiv}>\r\n Extension Install Error\r\n <ErrorCircleRegular className={classes.extensionErrorIcon} />\r\n </div>\r\n </DialogTitle>\r\n <DialogContent>\r\n <List>\r\n <ListItem>\r\n <Body1>{`Extension \"${extensionInstallError?.extension.name}\" failed to install and was removed.`}</Body1>\r\n </ListItem>\r\n <ListItem>\r\n <Body1>{`${extensionInstallError?.error}`}</Body1>\r\n </ListItem>\r\n </List>\r\n </DialogContent>\r\n <DialogActions>\r\n <Button appearance=\"primary\" onClick={onAcknowledgedExtensionInstallError}>\r\n Close\r\n </Button>\r\n </DialogActions>\r\n </DialogBody>\r\n </DialogSurface>\r\n </Dialog>\r\n <Suspense fallback={<Spinner className={classes.spinner} />}>\r\n <Content />\r\n </Suspense>\r\n </ToastProvider>\r\n </Theme>\r\n </ExtensionManagerContext.Provider>\r\n </SettingsStoreContext.Provider>\r\n </ReactContextsWrapper>\r\n );\r\n }\r\n };\r\n\r\n // Set the container element to be a flex container so that the tool can be displayed properly.\r\n const originalContainerElementDisplay = containerElement.style.display;\r\n containerElement.style.display = \"flex\";\r\n\r\n // Create and render the react root component.\r\n const reactRoot = createRoot(containerElement);\r\n reactRoot.render(createElement(modularToolRootComponent));\r\n\r\n let disposed = false;\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async\r\n dispose: () => {\r\n // Unmount and restore the original container element display.\r\n if (!disposed) {\r\n disposed = true;\r\n reactRoot.unmount();\r\n containerElement.style.display = originalContainerElementDisplay;\r\n }\r\n // The promise resolves once the React effect cleanup\r\n // (which disposes the ServiceContainer) has completed.\r\n return disposeDeferred.promise;\r\n },\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"modularTool.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/modularTool/modularTool.tsx"],"names":[],"mappings":";AAAA,OAAO,EAMH,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,GACX,MAAM,OAAO,CAAC;AAGf,OAAO,EAA2C,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7G,OAAO,EAAqC,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAuB,aAAa,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAwD,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACzJ,OAAO,EAAkB,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAE7G,OAAO,EACH,KAAK,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,MAAM,GACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAuC,aAAa,EAAE,MAAM,8CAA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EAAqE;QACrE,OAAO,EAAE,GAAG,EAAE;YACV,8DAA8D;YAC9D,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACZ,QAAQ,GAAG,IAAI,CAAC;gBAChB,SAAS,CAAC,OAAO,EAAE,CAAC;gBACpB,gBAAgB,CAAC,KAAK,CAAC,OAAO,GAAG,+BAA+B,CAAC;YACrE,CAAC;YACD,qDAAqD;YACrD,uDAAuD;YACvD,OAAO,eAAe,CAAC,OAAO,CAAC;QACnC,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {\r\n type ComponentType,\r\n type Context,\r\n type FunctionComponent,\r\n type PropsWithChildren,\r\n type ReactNode,\r\n createElement,\r\n Suspense,\r\n useCallback,\r\n useEffect,\r\n useReducer,\r\n useState,\r\n} from \"react\";\r\n\r\nimport { type IExtensionFeed } from \"./extensibility/extensionFeed\";\r\nimport { type IExtension, type InstallFailedInfo, ExtensionManager } from \"./extensibility/extensionManager\";\r\nimport { type WeaklyTypedServiceDefinition, ServiceContainer } from \"./modularity/serviceContainer\";\r\nimport { type ISettingsStore, SettingsStore, SettingsStoreIdentity } from \"./services/settingsStore\";\r\nimport { type IRootComponentService, type ShellServiceOptions, MakeShellServiceDefinition, RootComponentServiceIdentity } from \"./services/shellService\";\r\nimport { type ThemeMode, ThemeModeSettingDescriptor, ThemeServiceDefinition } from \"./services/themeService\";\r\n\r\nimport {\r\n Body1,\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogBody,\r\n DialogContent,\r\n DialogSurface,\r\n DialogTitle,\r\n List,\r\n ListItem,\r\n makeStyles,\r\n Spinner,\r\n tokens,\r\n} from \"@fluentui/react-components\";\r\nimport { CheckmarkCircleRegular, ErrorCircleRegular, InfoRegular, WarningRegular } from \"@fluentui/react-icons\";\r\nimport { createRoot } from \"react-dom/client\";\r\n\r\nimport { Deferred } from \"core/Misc/deferred\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { type ToastHandle, type ToastOptions, ToastProvider } from \"shared-ui-components/fluent/primitives/toast\";\r\nimport { type DialogOptions, type IDialogService, DialogServiceIdentity } from \"./services/dialogService\";\r\nimport { type IToastService, ToastServiceIdentity } from \"./services/toastService\";\r\nimport { Theme } from \"./components/theme\";\r\nimport { DialogContext } from \"./contexts/dialogContext\";\r\nimport { ExtensionManagerContext } from \"./contexts/extensionManagerContext\";\r\nimport { SettingsStoreContext } from \"./contexts/settingsContext\";\r\nimport { type IReactContextService, type ReactContextHandle, ReactContextServiceIdentity } from \"./services/reactContextService\";\r\nimport { ThemeSelectorServiceDefinition } from \"./services/themeSelectorService\";\r\n\r\nconst useStyles = makeStyles({\r\n app: {\r\n colorScheme: \"light dark\",\r\n flexGrow: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n backgroundColor: tokens.colorTransparentBackground,\r\n },\r\n spinner: {\r\n flexGrow: 1,\r\n animationDuration: \"1s\",\r\n animationName: {\r\n from: { opacity: 0 },\r\n to: { opacity: 1 },\r\n },\r\n },\r\n extensionErrorTitleDiv: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n gap: tokens.spacingHorizontalS,\r\n },\r\n extensionErrorIcon: {\r\n color: tokens.colorPaletteRedForeground1,\r\n },\r\n dialogTitle: {\r\n display: \"flex\",\r\n flexDirection: \"row\",\r\n alignItems: \"center\",\r\n gap: tokens.spacingHorizontalS,\r\n },\r\n dialogIconSuccess: {\r\n color: tokens.colorStatusSuccessForeground1,\r\n },\r\n dialogIconError: {\r\n color: tokens.colorStatusDangerForeground1,\r\n },\r\n dialogIconWarning: {\r\n color: tokens.colorStatusWarningForeground1,\r\n },\r\n dialogIconInfo: {\r\n color: tokens.colorBrandForeground1,\r\n },\r\n});\r\n\r\ntype ReactContextEntry = {\r\n provider: Context<unknown>[\"Provider\"];\r\n value: unknown;\r\n order: number;\r\n};\r\n\r\ntype ReactContextAction =\r\n | { type: \"add\"; entry: ReactContextEntry }\r\n | { type: \"remove\"; provider: Context<unknown>[\"Provider\"] }\r\n | { type: \"update\"; provider: Context<unknown>[\"Provider\"]; value: unknown };\r\n\r\ntype DialogQueueAction = { type: \"enqueue\"; options: DialogOptions } | { type: \"dequeue\" };\r\n\r\nconst ReactContextsWrapper: FunctionComponent<PropsWithChildren<{ contexts: readonly Readonly<ReactContextEntry>[] }>> = ({ contexts, children }) => {\r\n return <>{contexts.reduceRight<ReactNode>((acc, entry) => createElement(entry.provider, { value: entry.value }, acc), children)}</>;\r\n};\r\n\r\nexport type ModularToolOptions = {\r\n /**\r\n * The namespace for the tool, used for scoping persisted settings and other storage.\r\n */\r\n namespace: string;\r\n\r\n /**\r\n * The container element where the tool will be rendered.\r\n */\r\n containerElement: HTMLElement;\r\n\r\n /**\r\n * The service definitions to be registered with the tool.\r\n */\r\n serviceDefinitions: readonly WeaklyTypedServiceDefinition[];\r\n\r\n /**\r\n * The theme mode to use. If not specified, the default is \"system\", which uses the system/browser preference, and the last used mode is persisted.\r\n */\r\n themeMode?: ThemeMode;\r\n\r\n /**\r\n * Whether to show the theme selector in the toolbar. Default is true.\r\n */\r\n showThemeSelector?: boolean;\r\n\r\n /**\r\n * The extension feeds that provide optional extensions the user can install.\r\n */\r\n extensionFeeds?: readonly IExtensionFeed[];\r\n\r\n /**\r\n * An optional parent ServiceContainer. Dependencies not found in the tool's own container\r\n * will be resolved from this parent.\r\n */\r\n parentContainer?: ServiceContainer;\r\n} & ShellServiceOptions;\r\n\r\n/**\r\n * Creates a modular tool with a base set of common tool services, including the toolbar/side pane basic UI layout.\r\n * @param options The options for the tool.\r\n * @returns A token that can be used to dispose of the tool.\r\n */\r\nexport function MakeModularTool(options: ModularToolOptions) {\r\n const { namespace, containerElement, serviceDefinitions, themeMode, showThemeSelector = true, extensionFeeds = [], parentContainer } = options;\r\n\r\n // Create the settings store immediately as it will be exposed to services and through React context.\r\n const settingsStore = new SettingsStore(namespace);\r\n\r\n // If a theme mode is provided, just write the setting so it is the active theme.\r\n if (themeMode) {\r\n settingsStore.writeSetting(ThemeModeSettingDescriptor, themeMode);\r\n }\r\n\r\n // This deferred resolves once the React effect cleanup (which disposes the ServiceContainer) is complete.\r\n const disposeDeferred = new Deferred<void>();\r\n\r\n const modularToolRootComponent: FunctionComponent = () => {\r\n const classes = useStyles();\r\n const [extensionManagerContext, setExtensionManagerContext] = useState<ExtensionManagerContext>();\r\n const [requiredExtensions, setRequiredExtensions] = useState<string[]>();\r\n const [requiredExtensionsDeferred, setRequiredExtensionsDeferred] = useState<Deferred<boolean>>();\r\n const [extensionInstallError, setExtensionInstallError] = useState<InstallFailedInfo>();\r\n\r\n const [toastHandle, setToastHandle] = useState<ToastHandle | null>(null);\r\n const [toastQueue, setToastQueue] = useState<{ message: string; options?: ToastOptions }[]>([]);\r\n\r\n useEffect(() => {\r\n if (toastHandle && toastQueue.length > 0) {\r\n for (const { message, options } of toastQueue) {\r\n toastHandle.showToast(message, options);\r\n }\r\n setToastQueue([]);\r\n }\r\n }, [toastHandle, toastQueue]);\r\n\r\n // Queue of dialogs to display. We show one at a time (the one at the head of the queue).\r\n const [dialogQueue, dispatchDialogQueue] = useReducer((state: readonly DialogOptions[], action: DialogQueueAction): readonly DialogOptions[] => {\r\n switch (action.type) {\r\n case \"enqueue\":\r\n return [...state, action.options];\r\n case \"dequeue\":\r\n return state.slice(1);\r\n }\r\n }, []);\r\n\r\n const showDialog = useCallback((dialogOptions: DialogOptions) => {\r\n dispatchDialogQueue({ type: \"enqueue\", options: dialogOptions });\r\n }, []);\r\n\r\n const onDismissDialog = useCallback(() => {\r\n dispatchDialogQueue({ type: \"dequeue\" });\r\n }, []);\r\n\r\n const [rootComponentService, setRootComponentService] = useState<IRootComponentService>();\r\n\r\n const [contexts, updateContexts] = useReducer((state: ReactContextEntry[], action: ReactContextAction): ReactContextEntry[] => {\r\n switch (action.type) {\r\n case \"add\":\r\n return [...state, action.entry].sort((a, b) => a.order - b.order);\r\n case \"remove\":\r\n return state.filter((e) => e.provider !== action.provider);\r\n case \"update\":\r\n return state.map((e) => (e.provider === action.provider ? { ...e, value: action.value } : e));\r\n }\r\n }, []);\r\n\r\n // This is the main async initialization.\r\n useEffect(() => {\r\n const initializeExtensionManagerAsync = async () => {\r\n const serviceContainer = new ServiceContainer(\"ModularToolContainer\", parentContainer);\r\n\r\n // Expose the settings store as a service so other services can read/write settings.\r\n serviceContainer.addService<[ISettingsStore], []>({\r\n friendlyName: \"Settings Store\",\r\n produces: [SettingsStoreIdentity],\r\n factory: () => settingsStore,\r\n });\r\n\r\n // Expose the react context service so other services can add React context providers.\r\n serviceContainer.addService<[IReactContextService], []>({\r\n friendlyName: \"React Context Service\",\r\n produces: [ReactContextServiceIdentity],\r\n factory: (): IReactContextService => ({\r\n addContext<T>(provider: Context<T>[\"Provider\"], initialValue: T, options?: { order?: number }): ReactContextHandle<T> {\r\n const typedProvider = provider as Context<unknown>[\"Provider\"];\r\n updateContexts({ type: \"add\", entry: { provider: typedProvider, value: initialValue, order: options?.order ?? 0 } });\r\n return {\r\n updateValue: (newValue: T) => {\r\n updateContexts({ type: \"update\", provider: typedProvider, value: newValue });\r\n },\r\n dispose: () => {\r\n updateContexts({ type: \"remove\", provider: typedProvider });\r\n },\r\n };\r\n },\r\n }),\r\n });\r\n\r\n // Expose the toast service so non-React code (e.g. Observable callbacks) can show toasts.\r\n serviceContainer.addService<[IToastService], []>({\r\n friendlyName: \"Toast Service\",\r\n produces: [ToastServiceIdentity],\r\n factory: (): IToastService => ({\r\n showToast: (message, options) => {\r\n setToastQueue((prev) => [...prev, { message, options }]);\r\n },\r\n }),\r\n });\r\n\r\n // Expose the dialog service so non-React code (e.g. Observable callbacks) can show dialogs.\r\n serviceContainer.addService<[IDialogService], []>({\r\n friendlyName: \"Dialog Service\",\r\n produces: [DialogServiceIdentity],\r\n factory: (): IDialogService => ({ showDialog }),\r\n });\r\n\r\n // Register the shell service (top level toolbar/side pane UI layout).\r\n serviceContainer.addService(MakeShellServiceDefinition(options));\r\n\r\n // Register a service that simply consumes the services we need before first render.\r\n serviceContainer.addService<[], [IRootComponentService]>({\r\n friendlyName: \"Service Bootstrapper\",\r\n consumes: [RootComponentServiceIdentity],\r\n factory: (rootComponent) => {\r\n // Use function syntax for the state setter since the root component may be a function component.\r\n setRootComponentService(() => rootComponent);\r\n return {\r\n dispose: () => setRootComponentService(undefined),\r\n };\r\n },\r\n });\r\n\r\n // Register the theme service (exposes the current theme to other services).\r\n serviceContainer.addService(ThemeServiceDefinition);\r\n\r\n // Register the theme selector service (for selecting the theme) if theming is configured.\r\n if (showThemeSelector) {\r\n serviceContainer.addService(ThemeSelectorServiceDefinition);\r\n }\r\n\r\n // Register the extension list service (for browsing/installing extensions) if extension feeds are provided.\r\n if (extensionFeeds.length > 0) {\r\n const { ExtensionListServiceDefinition } = await import(\"./services/extensionsListService\");\r\n serviceContainer.addService(ExtensionListServiceDefinition);\r\n }\r\n\r\n // Register all external services (that make up a unique tool).\r\n serviceContainer.addServices(...serviceDefinitions);\r\n\r\n // Create the extension manager, passing along the registry for runtime changes to the registered services.\r\n const extensionManager = await ExtensionManager.CreateAsync(namespace, serviceContainer, extensionFeeds, setExtensionInstallError);\r\n\r\n // Check query params for required extensions. This lets users share links with sets of extensions.\r\n const queryParams = new URLSearchParams(window.location.search);\r\n const requiredExtensions = queryParams.getAll(\"babylon.requiredExtension\");\r\n const uninstalledExtensions: IExtension[] = [];\r\n for (const requiredExtension of requiredExtensions) {\r\n // These could possibly be parallelized to speed things up, but it's more complex so let's wait and see if we need it.\r\n // eslint-disable-next-line no-await-in-loop\r\n const query = await extensionManager.queryExtensionsAsync(requiredExtension);\r\n // eslint-disable-next-line no-await-in-loop\r\n const extensions = await query.getExtensionsAsync(0, query.totalCount);\r\n for (const extension of extensions) {\r\n if (!extension.isInstalled) {\r\n uninstalledExtensions.push(extension);\r\n }\r\n }\r\n }\r\n\r\n // Check if any required extensions are uninstalled or disabled. If so, show a dialog to the user.\r\n if (uninstalledExtensions.length > 0) {\r\n setRequiredExtensions(uninstalledExtensions.map((extension) => extension.metadata.name));\r\n const deferred = new Deferred<boolean>();\r\n setRequiredExtensionsDeferred(deferred);\r\n if (await deferred.promise) {\r\n for (const extension of uninstalledExtensions) {\r\n // This could possibly be parallelized to speed things up, but it's more complex so let's wait and see if we need it.\r\n // eslint-disable-next-line no-await-in-loop\r\n await extension.installAsync();\r\n }\r\n }\r\n }\r\n\r\n // Set the contexts.\r\n setExtensionManagerContext({ extensionManager });\r\n\r\n return () => {\r\n extensionManager.dispose();\r\n serviceContainer.dispose();\r\n serviceContainer.dispose();\r\n };\r\n };\r\n\r\n const disposePromise = initializeExtensionManagerAsync();\r\n\r\n return () => {\r\n disposePromise\r\n // eslint-disable-next-line github/no-then\r\n .then((dispose) => dispose())\r\n // eslint-disable-next-line github/no-then\r\n .catch((error) => {\r\n Logger.Error(`Failed to dispose of the modular tool: ${error}`);\r\n })\r\n .finally(() => disposeDeferred.resolve());\r\n };\r\n }, []);\r\n\r\n const onAcceptRequiredExtensions = useCallback(() => {\r\n setRequiredExtensions(undefined);\r\n requiredExtensionsDeferred?.resolve(true);\r\n }, [setRequiredExtensions, requiredExtensionsDeferred]);\r\n\r\n const onRejectRequiredExtensions = useCallback(() => {\r\n setRequiredExtensions(undefined);\r\n requiredExtensionsDeferred?.resolve(false);\r\n }, [setRequiredExtensions, requiredExtensionsDeferred]);\r\n\r\n const onAcknowledgedExtensionInstallError = useCallback(() => {\r\n setExtensionInstallError(undefined);\r\n }, [setExtensionInstallError]);\r\n\r\n // The dialog at the head of the queue, if any, is the one currently being displayed.\r\n const currentDialog = dialogQueue[0];\r\n const currentDialogIcon = (() => {\r\n switch (currentDialog?.intent) {\r\n case \"success\":\r\n return <CheckmarkCircleRegular className={classes.dialogIconSuccess} />;\r\n case \"error\":\r\n return <ErrorCircleRegular className={classes.dialogIconError} />;\r\n case \"warning\":\r\n return <WarningRegular className={classes.dialogIconWarning} />;\r\n case \"info\":\r\n case undefined:\r\n return <InfoRegular className={classes.dialogIconInfo} />;\r\n }\r\n })();\r\n\r\n // Show a spinner until a main view has been set.\r\n if (!rootComponentService) {\r\n return (\r\n <ReactContextsWrapper contexts={contexts}>\r\n <SettingsStoreContext.Provider value={settingsStore}>\r\n <Theme className={classes.app} targetDocument={targetDocument}>\r\n <Spinner className={classes.spinner} />\r\n </Theme>\r\n </SettingsStoreContext.Provider>\r\n </ReactContextsWrapper>\r\n );\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const Content: ComponentType = rootComponentService.rootComponent;\r\n\r\n return (\r\n <ReactContextsWrapper contexts={contexts}>\r\n {/* Expose the settings store as a React context so that UI components can read/write\r\n settings without the ISettingsService needing to be explicitly passed around. */}\r\n <SettingsStoreContext.Provider value={settingsStore}>\r\n <ExtensionManagerContext.Provider value={extensionManagerContext}>\r\n <Theme className={classes.app} targetDocument={targetDocument}>\r\n <ToastProvider imperativeRef={setToastHandle}>\r\n <Dialog open={!!requiredExtensions} modalType=\"alert\">\r\n <DialogSurface>\r\n <DialogBody>\r\n <DialogTitle>Required Extensions</DialogTitle>\r\n <DialogContent>\r\n Opening this URL requires the following extensions to be installed and enabled:\r\n <ul>\r\n {requiredExtensions?.map((name) => (\r\n <li key={name}>{name}</li>\r\n ))}\r\n </ul>\r\n </DialogContent>\r\n <DialogActions>\r\n <Button appearance=\"primary\" onClick={onAcceptRequiredExtensions}>\r\n Install & Enable\r\n </Button>\r\n <Button appearance=\"secondary\" onClick={onRejectRequiredExtensions}>\r\n No Thanks\r\n </Button>\r\n </DialogActions>\r\n </DialogBody>\r\n </DialogSurface>\r\n </Dialog>\r\n <Dialog open={!!extensionInstallError} modalType=\"alert\">\r\n <DialogSurface>\r\n <DialogBody>\r\n <DialogTitle>\r\n <div className={classes.extensionErrorTitleDiv}>\r\n Extension Install Error\r\n <ErrorCircleRegular className={classes.extensionErrorIcon} />\r\n </div>\r\n </DialogTitle>\r\n <DialogContent>\r\n <List>\r\n <ListItem>\r\n <Body1>{`Extension \"${extensionInstallError?.extension.name}\" failed to install and was removed.`}</Body1>\r\n </ListItem>\r\n <ListItem>\r\n <Body1>{`${extensionInstallError?.error}`}</Body1>\r\n </ListItem>\r\n </List>\r\n </DialogContent>\r\n <DialogActions>\r\n <Button appearance=\"primary\" onClick={onAcknowledgedExtensionInstallError}>\r\n Close\r\n </Button>\r\n </DialogActions>\r\n </DialogBody>\r\n </DialogSurface>\r\n </Dialog>\r\n <Dialog open={!!currentDialog} modalType=\"alert\">\r\n <DialogSurface>\r\n <DialogBody>\r\n <DialogTitle>\r\n <div className={classes.dialogTitle}>\r\n {currentDialogIcon}\r\n {currentDialog?.title}\r\n </div>\r\n </DialogTitle>\r\n {currentDialog?.content && <DialogContent>{currentDialog.content}</DialogContent>}\r\n <DialogActions>\r\n <Button appearance=\"primary\" onClick={onDismissDialog}>\r\n OK\r\n </Button>\r\n </DialogActions>\r\n </DialogBody>\r\n </DialogSurface>\r\n </Dialog>\r\n <Suspense fallback={<Spinner className={classes.spinner} />}>\r\n <DialogContext.Provider value={{ showDialog }}>\r\n <Content />\r\n </DialogContext.Provider>\r\n </Suspense>\r\n </ToastProvider>\r\n </Theme>\r\n </ExtensionManagerContext.Provider>\r\n </SettingsStoreContext.Provider>\r\n </ReactContextsWrapper>\r\n );\r\n }\r\n };\r\n\r\n // Derive the target document from the container element. When the container is in a popup\r\n // window (or other document distinct from the main one), this is what makes Fluent inject\r\n // styles and render portals into the correct document.\r\n const containerOwnerDocument = containerElement.ownerDocument;\r\n const targetDocument = containerOwnerDocument && containerOwnerDocument !== document ? containerOwnerDocument : undefined;\r\n\r\n // Set the container element to be a flex container so that the tool can be displayed properly.\r\n const originalContainerElementDisplay = containerElement.style.display;\r\n containerElement.style.display = \"flex\";\r\n\r\n // Create and render the react root component.\r\n const reactRoot = createRoot(containerElement);\r\n reactRoot.render(createElement(modularToolRootComponent));\r\n\r\n let disposed = false;\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async\r\n dispose: () => {\r\n // Unmount and restore the original container element display.\r\n if (!disposed) {\r\n disposed = true;\r\n reactRoot.unmount();\r\n containerElement.style.display = originalContainerElementDisplay;\r\n }\r\n // The promise resolves once the React effect cleanup\r\n // (which disposes the ServiceContainer) has completed.\r\n return disposeDeferred.promise;\r\n },\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type IService } from "../modularity/serviceDefinition.js";
|
|
2
|
+
import { type ToastIntent } from "@fluentui/react-components";
|
|
3
|
+
export type DialogOptions = {
|
|
4
|
+
type: "alert";
|
|
5
|
+
intent?: ToastIntent;
|
|
6
|
+
title: string;
|
|
7
|
+
content?: JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The unique identity symbol for the dialog service.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DialogServiceIdentity: unique symbol;
|
|
13
|
+
/**
|
|
14
|
+
* Provides the ability to show dialog from non-React code (e.g. Observable callbacks).
|
|
15
|
+
*/
|
|
16
|
+
export interface IDialogService extends IService<typeof DialogServiceIdentity> {
|
|
17
|
+
/**
|
|
18
|
+
* Shows a dialog with the given content.
|
|
19
|
+
* @param options The dialog options to display.
|
|
20
|
+
*/
|
|
21
|
+
showDialog(options: DialogOptions): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialogService.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/modularTool/services/dialogService.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { type IService } from \"../modularity/serviceDefinition\";\r\n\r\nimport { type ToastIntent } from \"@fluentui/react-components\";\r\n\r\nexport type DialogOptions = {\r\n type: \"alert\";\r\n intent?: ToastIntent;\r\n title: string;\r\n content?: JSX.Element;\r\n};\r\n\r\n/**\r\n * The unique identity symbol for the dialog service.\r\n */\r\nexport const DialogServiceIdentity = Symbol(\"DialogService\");\r\n\r\n/**\r\n * Provides the ability to show dialog from non-React code (e.g. Observable callbacks).\r\n */\r\nexport interface IDialogService extends IService<typeof DialogServiceIdentity> {\r\n /**\r\n * Shows a dialog with the given content.\r\n * @param options The dialog options to display.\r\n */\r\n showDialog(options: DialogOptions): void;\r\n}\r\n"]}
|
|
@@ -125,6 +125,7 @@ const useStyles = makeStyles({
|
|
|
125
125
|
paneCollapseButton: {
|
|
126
126
|
padding: `0 0 0 ${tokens.spacingHorizontalXS}`,
|
|
127
127
|
borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,
|
|
128
|
+
backgroundColor: tokens.colorNeutralBackground2,
|
|
128
129
|
},
|
|
129
130
|
paneCollapseButtonWithBorder: {
|
|
130
131
|
borderLeft: `1px solid ${tokens.colorNeutralStroke2}`,
|
|
@@ -148,6 +149,11 @@ const useStyles = makeStyles({
|
|
|
148
149
|
paneContainer: {
|
|
149
150
|
display: "flex",
|
|
150
151
|
flexDirection: "column",
|
|
152
|
+
// Side panes hold the width requested by their `style.width` (or saved/dragged value)
|
|
153
|
+
// and never give it up to a neighboring pane growing. Without this, dragging the left
|
|
154
|
+
// pane wider would also squeeze the right pane (proportional flex-shrink). The central
|
|
155
|
+
// content (`flex-grow: 1`) is the only flex item that absorbs the change.
|
|
156
|
+
flexShrink: 0,
|
|
151
157
|
overflowX: "hidden",
|
|
152
158
|
overflowY: "hidden",
|
|
153
159
|
zIndex: 1,
|
|
@@ -459,16 +465,25 @@ function usePane(location, defaultWidth, minWidth, sidePanes, onSelectSidePane,
|
|
|
459
465
|
// registered). The Fluent hook's setValue will silently fail when the element doesn't exist (in relative mode,
|
|
460
466
|
// it measures the element before/after and reverts if unchanged, which always happens when the element is null).
|
|
461
467
|
// By composing the ref callback, we ensure the stored value is applied immediately after the element mounts.
|
|
468
|
+
//
|
|
469
|
+
// We also set the CSS variable directly as a fallback. The hook preserves its internal currentValue across
|
|
470
|
+
// re-mounts, so when (for example) the user undocks a resized pane and then re-docks it, currentValue already
|
|
471
|
+
// equals the persisted setting and the hook's setValue short-circuits — but the freshly-mounted DOM node has no
|
|
472
|
+
// inline CSS variable, so the pane visually reverts to the default width until the user drags. Setting the
|
|
473
|
+
// variable directly closes that gap. The order is important: setValue first (handles the first-mount case where
|
|
474
|
+
// currentValue starts at 0), then the direct setProperty as a redundant fallback for the no-op case.
|
|
462
475
|
const composedHorizontalElementRef = useCallback((node) => {
|
|
463
476
|
paneHorizontalResizeElementRef(node);
|
|
464
477
|
if (node) {
|
|
465
478
|
setPaneWidthAdjust(paneWidthSettingRef.current);
|
|
479
|
+
node.style.setProperty(paneWidthAdjustCSSVar, `${paneWidthSettingRef.current}px`);
|
|
466
480
|
}
|
|
467
481
|
}, [paneHorizontalResizeElementRef, setPaneWidthAdjust]);
|
|
468
482
|
const composedVerticalElementRef = useCallback((node) => {
|
|
469
483
|
paneVerticalResizeElementRef(node);
|
|
470
484
|
if (node) {
|
|
471
485
|
setPaneHeightAdjust(paneHeightSettingRef.current);
|
|
486
|
+
node.style.setProperty(paneHeightAdjustCSSVar, `${paneHeightSettingRef.current}px`);
|
|
472
487
|
}
|
|
473
488
|
}, [paneVerticalResizeElementRef, setPaneHeightAdjust]);
|
|
474
489
|
// Handle external setting changes (e.g. settings reset) after elements are already mounted.
|