@dxos/app-framework 0.6.4 → 0.6.5-staging.42fccfe

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.
@@ -112,6 +112,17 @@ var SLUG_ENTRY_SEPARATOR = "_";
112
112
  var SLUG_KEY_VALUE_SEPARATOR = "-";
113
113
  var SLUG_PATH_SEPARATOR = "~";
114
114
  var SLUG_COLLECTION_INDICATOR = "";
115
+ var SLUG_SOLO_INDICATOR = "$";
116
+ var parseSlug = (slug) => {
117
+ const solo = slug.startsWith(SLUG_SOLO_INDICATOR);
118
+ const cleanSlug = solo ? slug.replace(SLUG_SOLO_INDICATOR, "") : slug;
119
+ const [id, ...path] = cleanSlug.split(SLUG_PATH_SEPARATOR);
120
+ return {
121
+ id,
122
+ path,
123
+ solo
124
+ };
125
+ };
115
126
  var ActiveParts = z2.record(z2.string(), z2.union([
116
127
  z2.string(),
117
128
  z2.array(z2.string())
@@ -568,6 +579,7 @@ export {
568
579
  SLUG_KEY_VALUE_SEPARATOR,
569
580
  SLUG_LIST_SEPARATOR,
570
581
  SLUG_PATH_SEPARATOR,
582
+ SLUG_SOLO_INDICATOR,
571
583
  SettingsAction,
572
584
  Surface,
573
585
  SurfaceProvider,
@@ -597,6 +609,7 @@ export {
597
609
  parsePluginHost,
598
610
  parseRootSurfacePlugin,
599
611
  parseSettingsPlugin,
612
+ parseSlug,
600
613
  parseSurfacePlugin,
601
614
  parseTranslationsPlugin,
602
615
  pluginMeta,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/plugins/common/file.ts", "../../../src/plugins/common/graph.ts", "../../../src/plugins/common/layout.ts", "../../../src/plugins/common/metadata.ts", "../../../src/plugins/common/navigation.ts", "../../../src/plugins/common/settings.ts", "../../../src/plugins/common/translations.ts", "../../../src/plugins/PluginHost/plugin.ts", "../../../src/plugins/PluginHost/PluginContext.tsx", "../../../src/plugins/PluginHost/PluginHost.tsx", "../../../src/plugins/SurfacePlugin/helpers.ts", "../../../src/plugins/SurfacePlugin/ErrorBoundary.tsx", "../../../src/plugins/SurfacePlugin/Surface.tsx", "../../../src/App.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Space } from '@dxos/client-protocol';\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg', 'gif'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n url?: string;\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).\n};\n\nexport type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;\n\n/**\n * Generic interface provided by file plugins (e.g., IPFS, WNFS).\n */\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph, GraphBuilder } from '@dxos/app-graph';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n /**\n * @deprecated\n */\n complementarySidebarContent: z\n .any()\n .optional()\n .describe('DEPRECATED. Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n // TODO(wittjosiah): Custom properties?\n dialogBlockAlign: z.union([z.literal('start'), z.literal('center')]).optional(),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n\n scrollIntoView: z\n .string()\n .optional()\n .describe('The identifier of a component to scroll into view when it is mounted.'),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n\n // TODO(wittjosiah): Custom properties?\n\n /**\n * Block alignment for the dialog.\n */\n dialogBlockAlign?: 'start' | 'center';\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n// NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_LIST_SEPARATOR = '+';\nexport const SLUG_ENTRY_SEPARATOR = '_';\nexport const SLUG_KEY_VALUE_SEPARATOR = '-';\nexport const SLUG_PATH_SEPARATOR = '~';\nexport const SLUG_COLLECTION_INDICATOR = '';\n\n//\n// Provides\n//\n\nexport const ActiveParts = z.record(z.string(), z.union([z.string(), z.array(z.string())]));\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z\n .union([z.string(), ActiveParts])\n .optional()\n .describe('Id of currently active item, or record of item id(s) keyed by the app part in which they are active.'),\n closed: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Id or ids of recently closed items, in order of when they were closed.'),\n});\n\nexport const Attention = z.object({\n attended: z.set(z.string()).optional().describe('Ids of items which have focus.'),\n});\n\nexport type ActiveParts = z.infer<typeof ActiveParts>;\nexport type Location = z.infer<typeof Location>;\nexport type Attention = z.infer<typeof Attention>;\n\nexport type LayoutCoordinate = { part: string; index: number; partSize: number };\nexport type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;\nexport type NavigationAdjustment = { layoutCoordinate: LayoutCoordinate; type: NavigationAdjustmentType };\n\nexport const isActiveParts = (active: string | ActiveParts | undefined): active is ActiveParts =>\n !!active && typeof active !== 'string';\n\nexport const isAdjustTransaction = (data: IntentData | undefined): data is NavigationAdjustment =>\n !!data &&\n ('layoutCoordinate' satisfies keyof NavigationAdjustment) in data &&\n ('type' satisfies keyof NavigationAdjustment) in data;\n\nexport const firstMainId = (active: Location['active']): string =>\n isActiveParts(active) ? (Array.isArray(active.main) ? active.main[0] : active.main) : active ?? '';\n\nexport const activeIds = (active: string | ActiveParts | undefined): Set<string> =>\n active\n ? isActiveParts(active)\n ? Object.values(active).reduce((acc, ids) => {\n Array.isArray(ids) ? ids.forEach((id) => acc.add(id)) : acc.add(ids);\n return acc;\n }, new Set<string>())\n : new Set([active])\n : new Set();\n\nexport const isIdActive = (active: string | ActiveParts | undefined, id: string): boolean => {\n return active\n ? isActiveParts(active)\n ? Object.values(active).findIndex((ids) => (Array.isArray(ids) ? ids.indexOf(id) > -1 : ids === id)) > -1\n : active === id\n : false;\n};\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n OPEN = `${NAVIGATION_ACTION}/open`,\n ADD_TO_ACTIVE = `${NAVIGATION_ACTION}/add-to-active`,\n SET = `${NAVIGATION_ACTION}/set`,\n ADJUST = `${NAVIGATION_ACTION}/adjust`,\n CLOSE = `${NAVIGATION_ACTION}/close`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n /**\n * An additive overlay to apply to `location.active` (i.e. the result is a union of previous active and the argument)\n */\n export type Open = IntentData<{ activeParts: ActiveParts }>;\n /**\n * Payload for adding an item to the active items.\n */\n export type AddToActive = IntentData<{\n id: string;\n scrollIntoView?: boolean;\n pivot?: { id: string; position: 'add-before' | 'add-after' };\n }>;\n /**\n * A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)\n */\n export type Close = IntentData<{ activeParts: ActiveParts }>;\n /**\n * The active parts to directly set, to be used when working with URLs or restoring a specific state.\n */\n export type Set = IntentData<{ activeParts: ActiveParts }>;\n /**\n * An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.\n */\n export type Adjust = IntentData<NavigationAdjustment>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n */\n // TODO(wittjosiah): Convert to `icon` and make serializable.\n iconComponent?: FC<IconProps>;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type PropsWithChildren, type ReactNode, useEffect, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled.push(id);\n } else {\n const index = state.values.enabled.findIndex((enabled) => enabled === id);\n index !== -1 && state.values.enabled.splice(index, 1);\n }\n },\n });\n\n state.prop({ key: 'enabled', type: LocalStorageStore.json<string[]>() });\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = plugins;\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, Plugin, PluginHost } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const Context = host.provides.context;\n const Root = host.provides.root;\n\n return () => (\n <Context>\n <Root />\n </Context>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,IAAMA,mBAAmB;EAC9BC,QAAQ;IAAC;IAAO;IAAO;IAAQ;;EAC/BC,OAAO;IAAC;IAAO;IAAO;IAAO;;EAC7BC,MAAM;IAAC;IAAO;IAAO;;AACvB;AAmBO,IAAM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AAGC,OAAAA,MAAgC;AAC/G,QAAMC,OAAOC,WAAW;IACtBP,OAAO;MAACQ;MAAaC;SAAeT;;IACpCC,SAAS;MACP,GAAGA;MACH,CAACO,cAAYJ,EAAE,GAAGM,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;MAC3C,CAACF,aAAWL,EAAE,GAAGM,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;IAC5C;IACAT,MAAM;MAACM,cAAYJ;MAAIK,aAAWL;SAAOF;;IACzC,GAAGG;EACL,CAAA;AAEAO,YAAUN,KAAKO,UAAUC,SAAAA,QAAAA;;;;;;;;;AACzBF,YAAUN,KAAKO,UAAUE,MAAAA,QAAAA;;;;;;;;;AACzB,QAAMC,UAAUV,KAAKO,SAASC;AAC9B,QAAMG,QAAOX,KAAKO,SAASE;AAE3B,SAAO,MACL,gBAAAG,OAAA,cAACF,SAAAA,MACC,gBAAAE,OAAA,cAACD,OAAAA,IAAAA,CAAAA;AAGP;",
6
- "names": ["defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "plugin", "provides", "graph", "root", "undefined", "parseGraphBuilderPlugin", "builder", "z", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "dialogBlockAlign", "union", "literal", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "scrollIntoView", "parseLayoutPlugin", "plugin", "success", "safeParse", "provides", "layout", "undefined", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "plugin", "provides", "metadata", "records", "undefined", "parseMetadataResolverPlugin", "resolver", "z", "SLUG_LIST_SEPARATOR", "SLUG_ENTRY_SEPARATOR", "SLUG_KEY_VALUE_SEPARATOR", "SLUG_PATH_SEPARATOR", "SLUG_COLLECTION_INDICATOR", "ActiveParts", "z", "record", "string", "union", "array", "Location", "object", "active", "optional", "describe", "closed", "Attention", "attended", "set", "isActiveParts", "isAdjustTransaction", "data", "firstMainId", "Array", "isArray", "main", "activeIds", "Object", "values", "reduce", "acc", "ids", "forEach", "id", "add", "Set", "isIdActive", "findIndex", "indexOf", "parseNavigationPlugin", "plugin", "success", "safeParse", "provides", "location", "undefined", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "plugin", "provides", "settings", "undefined", "SETTINGS_ACTION", "SettingsAction", "z", "ResourceKey", "z", "union", "string", "record", "any", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "plugin", "success", "array", "safeParse", "provides", "translations", "undefined", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "createContext", "useContext", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "id", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "React", "useEffect", "useState", "LocalStorageStore", "log", "isObject", "data", "React", "Component", "ErrorBoundary", "Component", "constructor", "props", "state", "error", "undefined", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "this", "fallback", "reset", "children", "setState", "React", "forwardRef", "Fragment", "isValidElement", "Suspense", "createContext", "useContext", "raise", "Surface", "forwardRef", "role", "name", "fallback", "placeholder", "rest", "forwardedRef", "props", "context", "useContext", "SurfaceContext", "data", "surfaces", "resolver", "React", "SurfaceResolver", "ref", "suspense", "Suspense", "ErrorBoundary", "createContext", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "Provider", "value", "Object", "entries", "map", "key", "component", "result", "undefined", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "plugin", "provides", "plugins", "undefined", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "fallback", "DefaultFallback", "placeholder", "state", "LocalStorageStore", "ready", "enabled", "available", "filter", "id", "includes", "setPlugin", "values", "push", "index", "findIndex", "splice", "prop", "key", "type", "json", "meta", "name", "context", "children", "React", "PluginProvider", "value", "root", "ErrorBoundary", "Root", "error", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "corePluginIds", "setError", "useState", "useEffect", "log", "timeout", "setTimeout", "enabledIds", "sort", "a", "b", "indexA", "indexB", "Promise", "all", "map", "definition", "Boolean", "initializePlugin", "catch", "err", "then", "pluginDefinition", "clearTimeout", "ComposedContext", "composeContext", "rootComponents", "initialize", "Component", "node", "compose", "p", "contexts", "reduce", "Acc", "Next", "React", "invariant", "createApp", "order", "plugins", "core", "map", "id", "params", "host", "PluginHost", "SurfaceMeta", "IntentMeta", "Plugin", "lazy", "invariant", "provides", "context", "root", "Context", "Root", "React"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Space } from '@dxos/client-protocol';\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg', 'gif'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n url?: string;\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).\n};\n\nexport type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;\n\n/**\n * Generic interface provided by file plugins (e.g., IPFS, WNFS).\n */\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph, GraphBuilder } from '@dxos/app-graph';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n /**\n * @deprecated\n */\n complementarySidebarContent: z\n .any()\n .optional()\n .describe('DEPRECATED. Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n // TODO(wittjosiah): Custom properties?\n dialogBlockAlign: z.union([z.literal('start'), z.literal('center')]).optional(),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n\n scrollIntoView: z\n .string()\n .optional()\n .describe('The identifier of a component to scroll into view when it is mounted.'),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n\n // TODO(wittjosiah): Custom properties?\n\n /**\n * Block alignment for the dialog.\n */\n dialogBlockAlign?: 'start' | 'center';\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n// NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_LIST_SEPARATOR = '+';\nexport const SLUG_ENTRY_SEPARATOR = '_';\nexport const SLUG_KEY_VALUE_SEPARATOR = '-';\nexport const SLUG_PATH_SEPARATOR = '~';\nexport const SLUG_COLLECTION_INDICATOR = '';\nexport const SLUG_SOLO_INDICATOR = '$';\n\nexport const parseSlug = (slug: string): { id: string; path: string[]; solo: boolean } => {\n const solo = slug.startsWith(SLUG_SOLO_INDICATOR);\n const cleanSlug = solo ? slug.replace(SLUG_SOLO_INDICATOR, '') : slug;\n const [id, ...path] = cleanSlug.split(SLUG_PATH_SEPARATOR);\n\n return { id, path, solo };\n};\n\n//\n// Provides\n//\n\nexport const ActiveParts = z.record(z.string(), z.union([z.string(), z.array(z.string())]));\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z\n .union([z.string(), ActiveParts])\n .optional()\n .describe('Id of currently active item, or record of item id(s) keyed by the app part in which they are active.'),\n closed: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Id or ids of recently closed items, in order of when they were closed.'),\n});\n\nexport const Attention = z.object({\n attended: z.set(z.string()).optional().describe('Ids of items which have focus.'),\n});\n\nexport type ActiveParts = z.infer<typeof ActiveParts>;\nexport type Location = z.infer<typeof Location>;\nexport type Attention = z.infer<typeof Attention>;\n\n// QUESTION(Zan): Is fullscreen a part? Or a special case of 'main'?\nexport type LayoutPart = 'sidebar' | 'main' | 'complementary';\n\nexport type LayoutCoordinate = { part: LayoutPart; index: number; partSize: number; solo?: boolean };\nexport type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;\nexport type NavigationAdjustment = { layoutCoordinate: LayoutCoordinate; type: NavigationAdjustmentType };\n\nexport const isActiveParts = (active: string | ActiveParts | undefined): active is ActiveParts =>\n !!active && typeof active !== 'string';\n\nexport const isAdjustTransaction = (data: IntentData | undefined): data is NavigationAdjustment =>\n !!data &&\n ('layoutCoordinate' satisfies keyof NavigationAdjustment) in data &&\n ('type' satisfies keyof NavigationAdjustment) in data;\n\nexport const firstMainId = (active: Location['active']): string =>\n isActiveParts(active) ? (Array.isArray(active.main) ? active.main[0] : active.main) : active ?? '';\n\nexport const activeIds = (active: string | ActiveParts | undefined): Set<string> =>\n active\n ? isActiveParts(active)\n ? Object.values(active).reduce((acc, ids) => {\n Array.isArray(ids) ? ids.forEach((id) => acc.add(id)) : acc.add(ids);\n return acc;\n }, new Set<string>())\n : new Set([active])\n : new Set();\n\nexport const isIdActive = (active: string | ActiveParts | undefined, id: string): boolean => {\n return active\n ? isActiveParts(active)\n ? Object.values(active).findIndex((ids) => (Array.isArray(ids) ? ids.indexOf(id) > -1 : ids === id)) > -1\n : active === id\n : false;\n};\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n OPEN = `${NAVIGATION_ACTION}/open`,\n ADD_TO_ACTIVE = `${NAVIGATION_ACTION}/add-to-active`,\n SET = `${NAVIGATION_ACTION}/set`,\n ADJUST = `${NAVIGATION_ACTION}/adjust`,\n CLOSE = `${NAVIGATION_ACTION}/close`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n /**\n * An additive overlay to apply to `location.active` (i.e. the result is a union of previous active and the argument)\n */\n export type Open = IntentData<{ activeParts: ActiveParts }>;\n /**\n * Payload for adding an item to the active items.\n */\n export type AddToActive = IntentData<{\n id: string;\n scrollIntoView?: boolean;\n pivot?: { id: string; position: 'add-before' | 'add-after' };\n }>;\n /**\n * A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)\n */\n export type Close = IntentData<{ activeParts: ActiveParts }>;\n /**\n * The active parts to directly set, to be used when working with URLs or restoring a specific state.\n */\n export type Set = IntentData<{ activeParts: ActiveParts }>;\n /**\n * An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.\n */\n export type Adjust = IntentData<NavigationAdjustment>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n * @deprecated\n */\n iconComponent?: FC<IconProps>;\n\n /**\n * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.\n */\n iconSymbol?: string;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type PropsWithChildren, type ReactNode, useEffect, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled.push(id);\n } else {\n const index = state.values.enabled.findIndex((enabled) => enabled === id);\n index !== -1 && state.values.enabled.splice(index, 1);\n }\n },\n });\n\n state.prop({ key: 'enabled', type: LocalStorageStore.json<string[]>() });\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = plugins;\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, Plugin, PluginHost } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const Context = host.provides.context;\n const Root = host.provides.root;\n\n return () => (\n <Context>\n <Root />\n </Context>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,IAAMA,mBAAmB;EAC9BC,QAAQ;IAAC;IAAO;IAAO;IAAQ;;EAC/BC,OAAO;IAAC;IAAO;IAAO;IAAO;;EAC7BC,MAAM;IAAC;IAAO;IAAO;;AACvB;AAmBO,IAAMC,yBAAyB,CAACC,WAAAA;AACrC,SAAQA,OAAOC,SAAiBC,OAAQF,SAAyCG;AACnF;;;ACXO,IAAMC,mBAAmB,CAACC,WAC9BA,OAAOC,SAAiBC,OAAOC,OAAQH,SAAmCI;AAKtE,IAAMC,0BAA0B,CAACL,WACrCA,OAAOC,SAAiBC,OAAOI,UAAWN,SAA0CI;;;AC3BvF,SAASG,SAAS;AASX,IAAMC,QAAQC,EAAEC,OAAO;EAC5BC,IAAIF,EAAEG,OAAM;EACZC,OAAOJ,EAAEG,OAAM,EAAGE,SAAQ;EAC1BC,aAAaN,EAAEG,OAAM,EAAGE,SAAQ;;EAEhC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AACO,cAAYJ,EAAE,GAAGM,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;MAC3C,CAACF,aAAWL,EAAE,GAAGM,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;IAC5C;IACAT,MAAM;MAACM,cAAYJ;MAAIK,aAAWL;SAAOF;;IACzC,GAAGG;EACL,CAAA;AAEAO,YAAUN,KAAKO,UAAUC,SAAAA,QAAAA;;;;;;;;;AACzBF,YAAUN,KAAKO,UAAUE,MAAAA,QAAAA;;;;;;;;;AACzB,QAAMC,UAAUV,KAAKO,SAASC;AAC9B,QAAMG,QAAOX,KAAKO,SAASE;AAE3B,SAAO,MACL,gBAAAG,OAAA,cAACF,SAAAA,MACC,gBAAAE,OAAA,cAACD,OAAAA,IAAAA,CAAAA;AAGP;",
6
+ "names": ["defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "plugin", "provides", "graph", "root", "undefined", "parseGraphBuilderPlugin", "builder", "z", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "dialogBlockAlign", "union", "literal", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "scrollIntoView", "parseLayoutPlugin", "plugin", "success", "safeParse", "provides", "layout", "undefined", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "plugin", "provides", "metadata", "records", "undefined", "parseMetadataResolverPlugin", "resolver", "z", "SLUG_LIST_SEPARATOR", "SLUG_ENTRY_SEPARATOR", "SLUG_KEY_VALUE_SEPARATOR", "SLUG_PATH_SEPARATOR", "SLUG_COLLECTION_INDICATOR", "SLUG_SOLO_INDICATOR", "parseSlug", "slug", "solo", "startsWith", "cleanSlug", "replace", "id", "path", "split", "ActiveParts", "z", "record", "string", "union", "array", "Location", "object", "active", "optional", "describe", "closed", "Attention", "attended", "set", "isActiveParts", "isAdjustTransaction", "data", "firstMainId", "Array", "isArray", "main", "activeIds", "Object", "values", "reduce", "acc", "ids", "forEach", "add", "Set", "isIdActive", "findIndex", "indexOf", "parseNavigationPlugin", "plugin", "success", "safeParse", "provides", "location", "undefined", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "plugin", "provides", "settings", "undefined", "SETTINGS_ACTION", "SettingsAction", "z", "ResourceKey", "z", "union", "string", "record", "any", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "plugin", "success", "array", "safeParse", "provides", "translations", "undefined", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "createContext", "useContext", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "id", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "React", "useEffect", "useState", "LocalStorageStore", "log", "isObject", "data", "React", "Component", "ErrorBoundary", "Component", "constructor", "props", "state", "error", "undefined", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "this", "fallback", "reset", "children", "setState", "React", "forwardRef", "Fragment", "isValidElement", "Suspense", "createContext", "useContext", "raise", "Surface", "forwardRef", "role", "name", "fallback", "placeholder", "rest", "forwardedRef", "props", "context", "useContext", "SurfaceContext", "data", "surfaces", "resolver", "React", "SurfaceResolver", "ref", "suspense", "Suspense", "ErrorBoundary", "createContext", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "Provider", "value", "Object", "entries", "map", "key", "component", "result", "undefined", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "plugin", "provides", "plugins", "undefined", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "fallback", "DefaultFallback", "placeholder", "state", "LocalStorageStore", "ready", "enabled", "available", "filter", "id", "includes", "setPlugin", "values", "push", "index", "findIndex", "splice", "prop", "key", "type", "json", "meta", "name", "context", "children", "React", "PluginProvider", "value", "root", "ErrorBoundary", "Root", "error", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "corePluginIds", "setError", "useState", "useEffect", "log", "timeout", "setTimeout", "enabledIds", "sort", "a", "b", "indexA", "indexB", "Promise", "all", "map", "definition", "Boolean", "initializePlugin", "catch", "err", "then", "pluginDefinition", "clearTimeout", "ComposedContext", "composeContext", "rootComponents", "initialize", "Component", "node", "compose", "p", "contexts", "reduce", "Acc", "Next", "React", "invariant", "createApp", "order", "plugins", "core", "map", "id", "params", "host", "PluginHost", "SurfaceMeta", "IntentMeta", "Plugin", "lazy", "invariant", "provides", "context", "root", "Context", "Root", "React"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2950,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2157,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":10186,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2094,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":13241,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2093,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3521,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1046,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4410,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3845,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2719,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5320,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1817,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1970,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4343,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2803,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13897,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":917,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21462,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":890,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":726,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":734,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":3949,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":19387,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":7027,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":576,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49564},"packages/sdk/app-framework/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs","kind":"dynamic-import"}],"exports":["ActiveParts","Attention","ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SLUG_COLLECTION_INDICATOR","SLUG_ENTRY_SEPARATOR","SLUG_KEY_VALUE_SEPARATOR","SLUG_LIST_SEPARATOR","SLUG_PATH_SEPARATOR","SettingsAction","Surface","SurfaceProvider","Toast","activeIds","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","firstMainId","getPlugin","initializePlugin","isActiveParts","isAdjustTransaction","isIdActive","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":288},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1757},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":2352},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5192},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":705},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":18689},"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1945},"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":655}},"bytes":960},"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9484},"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4605},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5173},"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
1
+ {"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2950,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2157,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":10186,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2094,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":14776,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2093,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3521,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1046,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4410,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3845,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2719,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5480,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1817,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1970,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4343,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2803,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13897,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":917,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21462,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":890,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":726,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":734,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":3949,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":19387,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":7027,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":576,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":50550},"packages/sdk/app-framework/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs","kind":"dynamic-import"}],"exports":["ActiveParts","Attention","ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SLUG_COLLECTION_INDICATOR","SLUG_ENTRY_SEPARATOR","SLUG_KEY_VALUE_SEPARATOR","SLUG_LIST_SEPARATOR","SLUG_PATH_SEPARATOR","SLUG_SOLO_INDICATOR","SettingsAction","Surface","SurfaceProvider","Toast","activeIds","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","firstMainId","getPlugin","initializePlugin","isActiveParts","isAdjustTransaction","isIdActive","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSlug","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":288},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1757},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":2645},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5192},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":705},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":19018},"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1945},"packages/sdk/app-framework/dist/lib/browser/plugin-CSXEDCQT.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":655}},"bytes":960},"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/browser/chunk-7TTLFUDC.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9484},"packages/sdk/app-framework/dist/lib/browser/plugin-MM66VRCO.mjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4605},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5173},"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/browser/chunk-J45KR4DI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/browser/chunk-S5CI6EUQ.mjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
@@ -48,6 +48,7 @@ __export(node_exports, {
48
48
  SLUG_KEY_VALUE_SEPARATOR: () => SLUG_KEY_VALUE_SEPARATOR,
49
49
  SLUG_LIST_SEPARATOR: () => SLUG_LIST_SEPARATOR,
50
50
  SLUG_PATH_SEPARATOR: () => SLUG_PATH_SEPARATOR,
51
+ SLUG_SOLO_INDICATOR: () => SLUG_SOLO_INDICATOR,
51
52
  SettingsAction: () => SettingsAction,
52
53
  Surface: () => Surface,
53
54
  SurfaceProvider: () => import_chunk_BTZLKXA2.SurfaceProvider,
@@ -77,6 +78,7 @@ __export(node_exports, {
77
78
  parsePluginHost: () => parsePluginHost,
78
79
  parseRootSurfacePlugin: () => import_chunk_BTZLKXA2.parseRootSurfacePlugin,
79
80
  parseSettingsPlugin: () => parseSettingsPlugin,
81
+ parseSlug: () => parseSlug,
80
82
  parseSurfacePlugin: () => import_chunk_BTZLKXA2.parseSurfacePlugin,
81
83
  parseTranslationsPlugin: () => parseTranslationsPlugin,
82
84
  pluginMeta: () => pluginMeta,
@@ -185,6 +187,17 @@ var SLUG_ENTRY_SEPARATOR = "_";
185
187
  var SLUG_KEY_VALUE_SEPARATOR = "-";
186
188
  var SLUG_PATH_SEPARATOR = "~";
187
189
  var SLUG_COLLECTION_INDICATOR = "";
190
+ var SLUG_SOLO_INDICATOR = "$";
191
+ var parseSlug = (slug) => {
192
+ const solo = slug.startsWith(SLUG_SOLO_INDICATOR);
193
+ const cleanSlug = solo ? slug.replace(SLUG_SOLO_INDICATOR, "") : slug;
194
+ const [id, ...path] = cleanSlug.split(SLUG_PATH_SEPARATOR);
195
+ return {
196
+ id,
197
+ path,
198
+ solo
199
+ };
200
+ };
188
201
  var ActiveParts = import_zod2.z.record(import_zod2.z.string(), import_zod2.z.union([
189
202
  import_zod2.z.string(),
190
203
  import_zod2.z.array(import_zod2.z.string())
@@ -611,6 +624,7 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
611
624
  SLUG_KEY_VALUE_SEPARATOR,
612
625
  SLUG_LIST_SEPARATOR,
613
626
  SLUG_PATH_SEPARATOR,
627
+ SLUG_SOLO_INDICATOR,
614
628
  SettingsAction,
615
629
  Surface,
616
630
  SurfaceProvider,
@@ -640,6 +654,7 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
640
654
  parsePluginHost,
641
655
  parseRootSurfacePlugin,
642
656
  parseSettingsPlugin,
657
+ parseSlug,
643
658
  parseSurfacePlugin,
644
659
  parseTranslationsPlugin,
645
660
  pluginMeta,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/plugins/common/file.ts", "../../../src/plugins/common/graph.ts", "../../../src/plugins/common/layout.ts", "../../../src/plugins/common/metadata.ts", "../../../src/plugins/common/navigation.ts", "../../../src/plugins/common/settings.ts", "../../../src/plugins/common/translations.ts", "../../../src/plugins/PluginHost/plugin.ts", "../../../src/plugins/PluginHost/PluginContext.tsx", "../../../src/plugins/PluginHost/PluginHost.tsx", "../../../src/plugins/SurfacePlugin/helpers.ts", "../../../src/plugins/SurfacePlugin/ErrorBoundary.tsx", "../../../src/plugins/SurfacePlugin/Surface.tsx", "../../../src/App.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Space } from '@dxos/client-protocol';\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg', 'gif'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n url?: string;\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).\n};\n\nexport type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;\n\n/**\n * Generic interface provided by file plugins (e.g., IPFS, WNFS).\n */\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph, GraphBuilder } from '@dxos/app-graph';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n /**\n * @deprecated\n */\n complementarySidebarContent: z\n .any()\n .optional()\n .describe('DEPRECATED. Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n // TODO(wittjosiah): Custom properties?\n dialogBlockAlign: z.union([z.literal('start'), z.literal('center')]).optional(),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n\n scrollIntoView: z\n .string()\n .optional()\n .describe('The identifier of a component to scroll into view when it is mounted.'),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n\n // TODO(wittjosiah): Custom properties?\n\n /**\n * Block alignment for the dialog.\n */\n dialogBlockAlign?: 'start' | 'center';\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n// NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_LIST_SEPARATOR = '+';\nexport const SLUG_ENTRY_SEPARATOR = '_';\nexport const SLUG_KEY_VALUE_SEPARATOR = '-';\nexport const SLUG_PATH_SEPARATOR = '~';\nexport const SLUG_COLLECTION_INDICATOR = '';\n\n//\n// Provides\n//\n\nexport const ActiveParts = z.record(z.string(), z.union([z.string(), z.array(z.string())]));\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z\n .union([z.string(), ActiveParts])\n .optional()\n .describe('Id of currently active item, or record of item id(s) keyed by the app part in which they are active.'),\n closed: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Id or ids of recently closed items, in order of when they were closed.'),\n});\n\nexport const Attention = z.object({\n attended: z.set(z.string()).optional().describe('Ids of items which have focus.'),\n});\n\nexport type ActiveParts = z.infer<typeof ActiveParts>;\nexport type Location = z.infer<typeof Location>;\nexport type Attention = z.infer<typeof Attention>;\n\nexport type LayoutCoordinate = { part: string; index: number; partSize: number };\nexport type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;\nexport type NavigationAdjustment = { layoutCoordinate: LayoutCoordinate; type: NavigationAdjustmentType };\n\nexport const isActiveParts = (active: string | ActiveParts | undefined): active is ActiveParts =>\n !!active && typeof active !== 'string';\n\nexport const isAdjustTransaction = (data: IntentData | undefined): data is NavigationAdjustment =>\n !!data &&\n ('layoutCoordinate' satisfies keyof NavigationAdjustment) in data &&\n ('type' satisfies keyof NavigationAdjustment) in data;\n\nexport const firstMainId = (active: Location['active']): string =>\n isActiveParts(active) ? (Array.isArray(active.main) ? active.main[0] : active.main) : active ?? '';\n\nexport const activeIds = (active: string | ActiveParts | undefined): Set<string> =>\n active\n ? isActiveParts(active)\n ? Object.values(active).reduce((acc, ids) => {\n Array.isArray(ids) ? ids.forEach((id) => acc.add(id)) : acc.add(ids);\n return acc;\n }, new Set<string>())\n : new Set([active])\n : new Set();\n\nexport const isIdActive = (active: string | ActiveParts | undefined, id: string): boolean => {\n return active\n ? isActiveParts(active)\n ? Object.values(active).findIndex((ids) => (Array.isArray(ids) ? ids.indexOf(id) > -1 : ids === id)) > -1\n : active === id\n : false;\n};\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n OPEN = `${NAVIGATION_ACTION}/open`,\n ADD_TO_ACTIVE = `${NAVIGATION_ACTION}/add-to-active`,\n SET = `${NAVIGATION_ACTION}/set`,\n ADJUST = `${NAVIGATION_ACTION}/adjust`,\n CLOSE = `${NAVIGATION_ACTION}/close`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n /**\n * An additive overlay to apply to `location.active` (i.e. the result is a union of previous active and the argument)\n */\n export type Open = IntentData<{ activeParts: ActiveParts }>;\n /**\n * Payload for adding an item to the active items.\n */\n export type AddToActive = IntentData<{\n id: string;\n scrollIntoView?: boolean;\n pivot?: { id: string; position: 'add-before' | 'add-after' };\n }>;\n /**\n * A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)\n */\n export type Close = IntentData<{ activeParts: ActiveParts }>;\n /**\n * The active parts to directly set, to be used when working with URLs or restoring a specific state.\n */\n export type Set = IntentData<{ activeParts: ActiveParts }>;\n /**\n * An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.\n */\n export type Adjust = IntentData<NavigationAdjustment>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n */\n // TODO(wittjosiah): Convert to `icon` and make serializable.\n iconComponent?: FC<IconProps>;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type PropsWithChildren, type ReactNode, useEffect, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled.push(id);\n } else {\n const index = state.values.enabled.findIndex((enabled) => enabled === id);\n index !== -1 && state.values.enabled.splice(index, 1);\n }\n },\n });\n\n state.prop({ key: 'enabled', type: LocalStorageStore.json<string[]>() });\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = plugins;\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, Plugin, PluginHost } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const Context = host.provides.context;\n const Root = host.provides.root;\n\n return () => (\n <Context>\n <Root />\n </Context>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEIA,iBAAkB;AEAlB,IAAAA,cAAkB;AEAlB,IAAAA,cAAkB;AEAlB,mBAAuE;ACAvE,IAAAC,gBAA4F;AAE5F,2BAAkC;AAClC,iBAAoB;AEHpB,IAAAA,gBAAkE;ACAlE,IAAAA,gBAQO;AACP,IAAAA,gBAA0C;AAE1C,mBAAsB;ACXtB,IAAAA,gBAAkB;AAElB,uBAA0B;AbInB,IAAMC,mBAAmB;EAC9BC,QAAQ;IAAC;IAAO;IAAO;IAAQ;;EAC/BC,OAAO;IAAC;IAAO;IAAO;IAAO;;EAC7BC,MAAM;IAAC;IAAO;IAAO;;AACvB;AAmBO,IAAMC,yBAAyB,CAACC,WAAAA;AACrC,SAAQA,OAAOC,SAAiBC,OAAQF,SAAyCG;AACnF;ACXO,IAAMC,mBAAmB,CAACJ,WAC9BA,OAAOC,SAAiBI,OAAOC,OAAQN,SAAmCG;AAKtE,IAAMI,0BAA0B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AAgC;AAC/G,QAAMC,OAAOpD,WAAW;IACtBC,OAAO;MAACoD,sBAAAA;MAAaC;SAAerD;;IACpC1E,SAAS;MACP,GAAGA;MACH,CAAC8H,sBAAAA,aAAYnO,EAAE,GAAG0F,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;MAC3C,CAACyI,mCAAWpO,EAAE,GAAG0F,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;IAC5C;IACAsF,MAAM;MAACkD,sBAAAA,aAAYnO;MAAIoO,mCAAWpO;SAAOiL;;IACzC,GAAGgD;EACL,CAAA;AAEAI,kCAAUH,KAAK7O,UAAUoJ,SAAAA,QAAAA;;;;;;;;;AACzB4F,kCAAUH,KAAK7O,UAAUK,MAAAA,QAAAA;;;;;;;;;AACzB,QAAM4O,UAAUJ,KAAK7O,SAASoJ;AAC9B,QAAMmD,QAAOsC,KAAK7O,SAASK;AAE3B,SAAO,MACLkI,8BAAAA,QAAA,cAAC0G,SAAAA,MACC1G,8BAAAA,QAAA,cAACgE,OAAAA,IAAAA,CAAAA;AAGP;",
6
- "names": ["import_zod", "import_react", "defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "graph", "root", "parseGraphBuilderPlugin", "builder", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "dialogBlockAlign", "union", "literal", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "scrollIntoView", "parseLayoutPlugin", "success", "safeParse", "layout", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "metadata", "records", "parseMetadataResolverPlugin", "resolver", "SLUG_LIST_SEPARATOR", "SLUG_ENTRY_SEPARATOR", "SLUG_KEY_VALUE_SEPARATOR", "SLUG_PATH_SEPARATOR", "SLUG_COLLECTION_INDICATOR", "ActiveParts", "record", "Location", "active", "closed", "Attention", "attended", "set", "isActiveParts", "isAdjustTransaction", "data", "firstMainId", "Array", "isArray", "main", "activeIds", "Object", "values", "reduce", "acc", "ids", "forEach", "add", "Set", "isIdActive", "findIndex", "indexOf", "parseNavigationPlugin", "location", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "settings", "SETTINGS_ACTION", "SettingsAction", "ResourceKey", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "translations", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "isObject", "ErrorBoundary", "Component", "constructor", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "Surface", "forwardRef", "role", "name", "placeholder", "rest", "forwardedRef", "context", "SurfaceContext", "surfaces", "SurfaceResolver", "ref", "suspense", "Suspense", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "value", "entries", "map", "key", "component", "result", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "DefaultFallback", "LocalStorageStore", "includes", "push", "index", "splice", "prop", "type", "json", "Root", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "corePluginIds", "setError", "useState", "useEffect", "log", "timeout", "setTimeout", "enabledIds", "indexA", "indexB", "Promise", "all", "initializePlugin", "catch", "err", "pluginDefinition", "clearTimeout", "ComposedContext", "composeContext", "rootComponents", "initialize", "compose", "contexts", "Acc", "Next", "createApp", "params", "host", "SurfaceMeta", "IntentMeta", "invariant", "Context"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Space } from '@dxos/client-protocol';\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): See Accept attribute (uses MIME types).\n// E.g., 'image/*': ['.jpg', '.jpeg', '.png', '.gif'],\nexport const defaultFileTypes = {\n images: ['png', 'jpg', 'jpeg', 'gif'],\n media: ['mp3', 'mp4', 'mov', 'avi'],\n text: ['pdf', 'txt', 'md'],\n};\n\nexport type FileInfo = {\n url?: string;\n cid?: string; // TODO(burdon): Meta key? Or other common properties with other file management system? (e.g., WNFS).\n};\n\nexport type FileUploader = (file: File, space: Space) => Promise<FileInfo | undefined>;\n\n/**\n * Generic interface provided by file plugins (e.g., IPFS, WNFS).\n */\nexport type FileManagerProvides = {\n file: {\n upload?: FileUploader;\n };\n};\n\n// TODO(burdon): Better match against interface? and Return provided service type. What if multiple?\nexport const parseFileManagerPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).file ? (plugin as Plugin<FileManagerProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Graph, GraphBuilder } from '@dxos/app-graph';\n\nimport type { Plugin } from '../PluginHost';\n\n/**\n * Provides for a plugin that exposes the application graph.\n */\nexport type GraphProvides = {\n graph: Graph;\n};\n\nexport type GraphBuilderProvides = {\n graph: {\n builder: (plugins: Plugin[]) => Parameters<GraphBuilder['addExtension']>[0];\n };\n};\n\n/**\n * Type guard for graph plugins.\n */\nexport const parseGraphPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.root ? (plugin as Plugin<GraphProvides>) : undefined;\n\n/**\n * Type guard for graph builder plugins.\n */\nexport const parseGraphBuilderPlugin = (plugin: Plugin) =>\n (plugin.provides as any).graph?.builder ? (plugin as Plugin<GraphBuilderProvides>) : undefined;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport { type IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n//\n// Provides\n//\n\nexport const Toast = z.object({\n id: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n // TODO(wittjosiah): `icon` should be string to be parsed by an `Icon` component.\n icon: z.any().optional(),\n duration: z.number().optional(),\n closeLabel: z.string().optional(),\n actionLabel: z.string().optional(),\n actionAlt: z.string().optional(),\n onAction: z.function().optional(),\n});\n\nexport type Toast = z.infer<typeof Toast>;\n\n/**\n * Basic state provided by a layout plugin.\n *\n * Layout provides the state of global UI landmarks, such as the sidebar, dialog, and popover.\n * Generally only one dialog or popover should be open at a time, a layout plugin should manage this.\n * For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\nexport const Layout = z.object({\n fullscreen: z.boolean(),\n\n sidebarOpen: z.boolean(),\n\n complementarySidebarOpen: z.boolean(),\n /**\n * @deprecated\n */\n complementarySidebarContent: z\n .any()\n .optional()\n .describe('DEPRECATED. Data to be passed to the complementary sidebar Surface.'),\n\n dialogOpen: z.boolean(),\n dialogContent: z.any().optional().describe('Data to be passed to the dialog Surface.'),\n // TODO(wittjosiah): Custom properties?\n dialogBlockAlign: z.union([z.literal('start'), z.literal('center')]).optional(),\n\n popoverOpen: z.boolean(),\n popoverContent: z.any().optional().describe('Data to be passed to the popover Surface.'),\n popoverAnchorId: z.string().optional(),\n\n toasts: z.array(Toast),\n\n scrollIntoView: z\n .string()\n .optional()\n .describe('The identifier of a component to scroll into view when it is mounted.'),\n});\n\nexport type Layout = z.infer<typeof Layout>;\n\n/**\n * Provides for a plugin that can manage the app layout.\n */\nexport type LayoutProvides = {\n layout: Readonly<Layout>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseLayoutPlugin = (plugin: Plugin) => {\n const { success } = Layout.safeParse((plugin.provides as any).layout);\n return success ? (plugin as Plugin<LayoutProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst LAYOUT_ACTION = 'dxos.org/plugin/layout';\nexport enum LayoutAction {\n SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,\n SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,\n}\n\n/**\n * Expected payload for layout actions.\n */\nexport namespace LayoutAction {\n export type SetLayout = IntentData<{\n /**\n * Element to set the state of.\n */\n element: 'fullscreen' | 'sidebar' | 'complementary' | 'dialog' | 'popover' | 'toast';\n\n /**\n * Whether the element is on or off.\n *\n * If omitted, the element's state will be toggled or set based on other provided data.\n * For example, if `component` is provided, the state will be set to `true`.\n */\n state?: boolean;\n\n /**\n * Component to render in the dialog or popover.\n */\n component?: string;\n\n /**\n * Data to be passed to the dialog or popover Surface.\n */\n subject?: any;\n\n /**\n * Anchor ID for the popover.\n */\n anchorId?: string;\n\n // TODO(wittjosiah): Custom properties?\n\n /**\n * Block alignment for the dialog.\n */\n dialogBlockAlign?: 'start' | 'center';\n }>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\nexport type Metadata = Record<string, any>;\n\nexport type MetadataRecordsProvides = {\n metadata: {\n records: Record<string, Metadata>;\n };\n};\n\nexport type MetadataResolver = (type: string) => Metadata;\n\nexport type MetadataResolverProvides = {\n metadata: {\n resolver: MetadataResolver;\n };\n};\n\nexport const parseMetadataRecordsPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.records ? (plugin as Plugin<MetadataRecordsProvides>) : undefined;\n};\n\nexport const parseMetadataResolverPlugin = (plugin: Plugin) => {\n return (plugin.provides as any).metadata?.resolver ? (plugin as Plugin<MetadataResolverProvides>) : undefined;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { IntentData } from '../IntentPlugin';\nimport type { Plugin } from '../PluginHost';\n\n// NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_LIST_SEPARATOR = '+';\nexport const SLUG_ENTRY_SEPARATOR = '_';\nexport const SLUG_KEY_VALUE_SEPARATOR = '-';\nexport const SLUG_PATH_SEPARATOR = '~';\nexport const SLUG_COLLECTION_INDICATOR = '';\nexport const SLUG_SOLO_INDICATOR = '$';\n\nexport const parseSlug = (slug: string): { id: string; path: string[]; solo: boolean } => {\n const solo = slug.startsWith(SLUG_SOLO_INDICATOR);\n const cleanSlug = solo ? slug.replace(SLUG_SOLO_INDICATOR, '') : slug;\n const [id, ...path] = cleanSlug.split(SLUG_PATH_SEPARATOR);\n\n return { id, path, solo };\n};\n\n//\n// Provides\n//\n\nexport const ActiveParts = z.record(z.string(), z.union([z.string(), z.array(z.string())]));\n\n/**\n * Basic state provided by a navigation plugin.\n */\n// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.\n// TODO(wittjosiah): We should align this more with `window.location` along the lines of what React Router does.\nexport const Location = z.object({\n active: z\n .union([z.string(), ActiveParts])\n .optional()\n .describe('Id of currently active item, or record of item id(s) keyed by the app part in which they are active.'),\n closed: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Id or ids of recently closed items, in order of when they were closed.'),\n});\n\nexport const Attention = z.object({\n attended: z.set(z.string()).optional().describe('Ids of items which have focus.'),\n});\n\nexport type ActiveParts = z.infer<typeof ActiveParts>;\nexport type Location = z.infer<typeof Location>;\nexport type Attention = z.infer<typeof Attention>;\n\n// QUESTION(Zan): Is fullscreen a part? Or a special case of 'main'?\nexport type LayoutPart = 'sidebar' | 'main' | 'complementary';\n\nexport type LayoutCoordinate = { part: LayoutPart; index: number; partSize: number; solo?: boolean };\nexport type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;\nexport type NavigationAdjustment = { layoutCoordinate: LayoutCoordinate; type: NavigationAdjustmentType };\n\nexport const isActiveParts = (active: string | ActiveParts | undefined): active is ActiveParts =>\n !!active && typeof active !== 'string';\n\nexport const isAdjustTransaction = (data: IntentData | undefined): data is NavigationAdjustment =>\n !!data &&\n ('layoutCoordinate' satisfies keyof NavigationAdjustment) in data &&\n ('type' satisfies keyof NavigationAdjustment) in data;\n\nexport const firstMainId = (active: Location['active']): string =>\n isActiveParts(active) ? (Array.isArray(active.main) ? active.main[0] : active.main) : active ?? '';\n\nexport const activeIds = (active: string | ActiveParts | undefined): Set<string> =>\n active\n ? isActiveParts(active)\n ? Object.values(active).reduce((acc, ids) => {\n Array.isArray(ids) ? ids.forEach((id) => acc.add(id)) : acc.add(ids);\n return acc;\n }, new Set<string>())\n : new Set([active])\n : new Set();\n\nexport const isIdActive = (active: string | ActiveParts | undefined, id: string): boolean => {\n return active\n ? isActiveParts(active)\n ? Object.values(active).findIndex((ids) => (Array.isArray(ids) ? ids.indexOf(id) > -1 : ids === id)) > -1\n : active === id\n : false;\n};\n\n/**\n * Provides for a plugin that can manage the app navigation.\n */\nexport type LocationProvides = {\n location: Readonly<Location>;\n};\n\n/**\n * Type guard for layout plugins.\n */\nexport const parseNavigationPlugin = (plugin: Plugin) => {\n const { success } = Location.safeParse((plugin.provides as any).location);\n return success ? (plugin as Plugin<LocationProvides>) : undefined;\n};\n\n//\n// Intents\n//\n\nconst NAVIGATION_ACTION = 'dxos.org/plugin/navigation';\nexport enum NavigationAction {\n OPEN = `${NAVIGATION_ACTION}/open`,\n ADD_TO_ACTIVE = `${NAVIGATION_ACTION}/add-to-active`,\n SET = `${NAVIGATION_ACTION}/set`,\n ADJUST = `${NAVIGATION_ACTION}/adjust`,\n CLOSE = `${NAVIGATION_ACTION}/close`,\n}\n\n/**\n * Expected payload for navigation actions.\n */\nexport namespace NavigationAction {\n /**\n * An additive overlay to apply to `location.active` (i.e. the result is a union of previous active and the argument)\n */\n export type Open = IntentData<{ activeParts: ActiveParts }>;\n /**\n * Payload for adding an item to the active items.\n */\n export type AddToActive = IntentData<{\n id: string;\n scrollIntoView?: boolean;\n pivot?: { id: string; position: 'add-before' | 'add-after' };\n }>;\n /**\n * A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)\n */\n export type Close = IntentData<{ activeParts: ActiveParts }>;\n /**\n * The active parts to directly set, to be used when working with URLs or restoring a specific state.\n */\n export type Set = IntentData<{ activeParts: ActiveParts }>;\n /**\n * An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.\n */\n export type Adjust = IntentData<NavigationAdjustment>;\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '../PluginHost';\n\n// TODO(burdon): Plugins should export ts-effect object (see local-storage).\n// TODO(burdon): Auto generate form.\n// TODO(burdon): Set surface's data.type to plugin id (allow custom settings surface).\n\nexport type SettingsProvides<T extends Record<string, any> = Record<string, any>> = {\n settings: T; // TODO(burdon): Read-only.\n};\n\nexport const parseSettingsPlugin = (plugin: Plugin) => {\n return typeof (plugin.provides as any).settings === 'object' ? (plugin as Plugin<SettingsProvides>) : undefined;\n};\n\nconst SETTINGS_ACTION = 'dxos.org/plugin/settings';\nexport enum SettingsAction {\n OPEN = `${SETTINGS_ACTION}/open`,\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { z } from 'zod';\n\nimport type { Plugin } from '../PluginHost';\n\nexport const ResourceKey = z.union([z.string(), z.record(z.any())]);\nexport type ResourceKey = z.infer<typeof ResourceKey>;\n\nexport const ResourceLanguage = z.record(ResourceKey);\nexport type ResourceLanguage = z.infer<typeof ResourceLanguage>;\n\n/**\n * A resource is a collection of translations for a language.\n */\nexport const Resource = z.record(ResourceLanguage);\nexport type Resource = z.infer<typeof Resource>;\n\n/**\n * Provides for a plugin that exposes translations.\n */\n// TODO(wittjosiah): Rename to TranslationResourcesProvides.\nexport type TranslationsProvides = {\n translations: Readonly<Resource[]>;\n};\n\n// TODO(wittjosiah): Add TranslationsProvides.\n// export type TranslationsProvides = {\n// translations: {\n// t: TFunction;\n// };\n// };\n\n/**\n * Type guard for translation plugins.\n */\nexport const parseTranslationsPlugin = (plugin: Plugin) => {\n const { success } = z.array(Resource).safeParse((plugin.provides as any).translations);\n return success ? (plugin as Plugin<TranslationsProvides>) : undefined;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { IconProps } from '@phosphor-icons/react';\nimport type { FC, PropsWithChildren } from 'react';\n\n/**\n * Capabilities provided by a plugin.\n * The base surface capabilities are always included.\n */\nexport type PluginProvides<TProvides> = TProvides & {\n /**\n * React Context which is wrapped around the application to enable any hooks the plugin may provide.\n */\n context?: FC<PropsWithChildren>;\n\n /*\n * React component which is rendered at the root of the application.\n */\n root?: FC<PropsWithChildren>;\n};\n\n/**\n * A unit of containment of modular functionality that can be provided to an application.\n * Plugins provide things like components, state, actions, etc. to the application.\n */\nexport type Plugin<TProvides = {}> = {\n meta: {\n /**\n * Globally unique ID.\n *\n * Expected to be in the form of a valid URL.\n *\n * @example dxos.org/plugin/example\n */\n id: string;\n\n /**\n * Short ID for use in URLs.\n *\n * NOTE: This is especially experimental and likely to change.\n */\n // TODO(wittjosiah): How should these be managed?\n shortId?: string;\n\n /**\n * Human-readable name.\n */\n name?: string;\n\n /**\n * Short description of plugin functionality.\n */\n description?: string;\n\n /**\n * URL of home page.\n */\n homePage?: string;\n\n /**\n * Tags to help categorize the plugin.\n */\n tags?: string[];\n\n /**\n * Component to render icon for the plugin when displayed in a list.\n * @deprecated\n */\n iconComponent?: FC<IconProps>;\n\n /**\n * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.\n */\n iconSymbol?: string;\n };\n\n /**\n * Capabilities provided by the plugin.\n */\n provides: PluginProvides<TProvides>;\n};\n\n/**\n * Plugin definitions extend the base `Plugin` interface with additional lifecycle methods.\n */\nexport type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Plugin, 'provides'> & {\n /**\n * Capabilities provided by the plugin.\n */\n provides?: Plugin<TProvides>['provides'];\n\n /**\n * Initialize any async behavior required by the plugin.\n *\n * @return Capabilities provided by the plugin which are merged with base capabilities.\n */\n initialize?: () => Promise<PluginProvides<TInitializeProvides> | void>;\n\n /**\n * Called once all plugins have been initialized.\n * This is the place to do any initialization which requires other plugins to be ready.\n *\n * @param plugins All plugins which successfully initialized.\n */\n // TODO(wittjosiah): Rename `ready` to a verb?\n ready?: (plugins: Plugin[]) => Promise<void>;\n\n /**\n * Called when the plugin is unloaded.\n * This is the place to do any cleanup required by the plugin.\n */\n unload?: () => Promise<void>;\n};\n\nexport const pluginMeta = (meta: Plugin['meta']) => meta;\n\ntype LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;\n\nexport namespace Plugin {\n export const lazy = <T>(p: LazyPlugin<T>, props?: T) => {\n return () =>\n p().then(({ default: definition }) => {\n return definition(props as T);\n });\n };\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Context, type Provider, createContext, useContext } from 'react';\n\nimport { type Plugin } from './plugin';\nimport { findPlugin, resolvePlugin } from '../helpers';\n\nexport type PluginContext = {\n /**\n * All plugins are ready.\n */\n ready: boolean;\n\n /**\n * Ids of plugins which are enabled on this device.\n */\n enabled: string[];\n\n /**\n * Initialized and ready plugins.\n */\n plugins: Plugin[];\n\n /**\n * All available plugins.\n */\n available: Plugin['meta'][];\n\n /**\n * Mark plugin as enabled.\n * Requires reload to take effect.\n */\n setPlugin: (id: string, enabled: boolean) => void;\n};\n\nconst PluginContext: Context<PluginContext> = createContext<PluginContext>({\n ready: false,\n enabled: [],\n plugins: [],\n available: [],\n setPlugin: () => {},\n});\n\n/**\n * Get all plugins.\n */\nexport const usePlugins = (): PluginContext => useContext(PluginContext);\n\n/**\n * Get a plugin by ID.\n */\nexport const usePlugin = <T,>(id: string): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return findPlugin<T>(plugins, id);\n};\n\n/**\n * Resolve a plugin by predicate.\n */\nexport const useResolvePlugin = <T,>(predicate: (plugin: Plugin) => Plugin<T> | undefined): Plugin<T> | undefined => {\n const { plugins } = usePlugins();\n return resolvePlugin(plugins, predicate);\n};\n\nexport const PluginProvider: Provider<PluginContext> = PluginContext.Provider;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type PropsWithChildren, type ReactNode, useEffect, useState } from 'react';\n\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { log } from '@dxos/log';\n\nimport { type PluginContext, PluginProvider } from './PluginContext';\nimport { type Plugin, type PluginDefinition, type PluginProvides } from './plugin';\nimport { ErrorBoundary } from '../SurfacePlugin';\n\nexport type BootstrapPluginsParams = {\n order: PluginDefinition['meta'][];\n plugins: Record<string, () => Promise<PluginDefinition>>;\n core?: string[];\n defaults?: string[];\n fallback?: ErrorBoundary['props']['fallback'];\n placeholder?: ReactNode;\n};\n\nexport type PluginHostProvides = {\n plugins: PluginContext;\n};\n\nexport const parsePluginHost = (plugin: Plugin) =>\n (plugin.provides as PluginHostProvides).plugins ? (plugin as Plugin<PluginHostProvides>) : undefined;\n\nconst PLUGIN_HOST = 'dxos.org/plugin/host';\n\n/**\n * Bootstraps an application by initializing plugins and rendering root components.\n */\nexport const PluginHost = ({\n order,\n plugins: definitions,\n core = [],\n defaults = [],\n fallback = DefaultFallback,\n placeholder = null,\n}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {\n const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {\n ready: false,\n enabled: [...defaults],\n plugins: [],\n available: order.filter(({ id }) => !core.includes(id)),\n setPlugin: (id: string, enabled: boolean) => {\n if (enabled) {\n state.values.enabled.push(id);\n } else {\n const index = state.values.enabled.findIndex((enabled) => enabled === id);\n index !== -1 && state.values.enabled.splice(index, 1);\n }\n },\n });\n\n state.prop({ key: 'enabled', type: LocalStorageStore.json<string[]>() });\n\n return {\n meta: {\n id: PLUGIN_HOST,\n name: 'Plugin host',\n },\n provides: {\n plugins: state.values,\n context: ({ children }) => <PluginProvider value={state.values}>{children}</PluginProvider>,\n root: () => {\n return (\n <ErrorBoundary fallback={fallback}>\n <Root order={order} core={core} definitions={definitions} state={state.values} placeholder={placeholder} />\n </ErrorBoundary>\n );\n },\n },\n };\n};\n\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\ntype RootProps = {\n order: PluginDefinition['meta'][];\n state: PluginContext;\n definitions: Record<string, () => Promise<PluginDefinition>>;\n core: string[];\n placeholder: ReactNode;\n};\n\nconst Root = ({ order, core: corePluginIds, definitions, state, placeholder }: RootProps) => {\n const [error, setError] = useState<unknown>();\n\n useEffect(() => {\n log('initializing plugins', { enabled: state.enabled });\n const timeout = setTimeout(async () => {\n try {\n const enabledIds = [...corePluginIds, ...state.enabled].sort((a, b) => {\n const indexA = order.findIndex(({ id }) => id === a);\n const indexB = order.findIndex(({ id }) => id === b);\n return indexA - indexB;\n });\n\n const enabled = await Promise.all(\n enabledIds\n .map((id) => definitions[id])\n // If local storage indicates a plugin is enabled, but it is not available, ignore it.\n .filter((definition): definition is () => Promise<PluginDefinition> => Boolean(definition))\n .map((definition) => definition()),\n );\n\n const plugins = await Promise.all(\n enabled.map(async (definition) => {\n const plugin = await initializePlugin(definition).catch((err) => {\n log.error('Failed to initialize plugin:', { id: definition.meta.id, err });\n return undefined;\n });\n return plugin;\n }),\n ).then((plugins) => plugins.filter((plugin): plugin is Plugin => Boolean(plugin)));\n log('plugins initialized', { plugins });\n\n await Promise.all(enabled.map((pluginDefinition) => pluginDefinition.ready?.(plugins)));\n log('plugins ready', { plugins });\n\n state.plugins = plugins;\n state.ready = true;\n } catch (err) {\n setError(err);\n }\n });\n\n return () => {\n clearTimeout(timeout);\n state.ready = false;\n // TODO(wittjosiah): Does this ever need to be called prior to having dynamic plugins?\n // void Promise.all(enabled.map((definition) => definition.unload?.()));\n };\n }, []);\n\n if (error) {\n throw error;\n }\n\n if (!state.ready) {\n return <>{placeholder}</>;\n }\n\n const ComposedContext = composeContext(state.plugins);\n\n return <ComposedContext>{rootComponents(state.plugins)}</ComposedContext>;\n};\n\n/**\n * Resolve a `PluginDefinition` into a fully initialized `Plugin`.\n */\nexport const initializePlugin = async <T, U>(pluginDefinition: PluginDefinition<T, U>): Promise<Plugin<T & U>> => {\n const provides = await pluginDefinition.initialize?.();\n return {\n ...pluginDefinition,\n provides: {\n ...pluginDefinition.provides,\n ...provides,\n } as PluginProvides<T & U>,\n };\n};\n\nconst rootComponents = (plugins: Plugin[]) => {\n return plugins\n .map((plugin) => {\n const Component = plugin.provides.root;\n if (Component) {\n return <Component key={plugin.meta.id} />;\n } else {\n return null;\n }\n })\n .filter((node): node is JSX.Element => Boolean(node));\n};\n\nconst composeContext = (plugins: Plugin[]) => {\n return compose(plugins.map((p) => p.provides.context!).filter(Boolean));\n};\n\nconst compose = (contexts: FC<PropsWithChildren>[]) => {\n return [...contexts].reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\n/**\n * Checks if the given data is an object and not null.\n *\n * Useful inside surface component resolvers as a type guard.\n *\n * @example\n * ```ts\n * const old =\n * data.content &&\n * typeof data.content === 'object' &&\n * 'id' in data.content &&\n * typeof data.content.id === 'string';\n *\n * // becomes\n * const new = isObject(data.content) && typeof data.content.id === 'string';\n * ```\n */\nexport const isObject = (data: unknown): data is { [key: string]: unknown } => !!data && typeof data === 'object';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, {\n forwardRef,\n type ReactNode,\n Fragment,\n type ForwardedRef,\n type PropsWithChildren,\n isValidElement,\n Suspense,\n} from 'react';\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { type SurfaceComponent, type SurfaceResult, useSurfaceRoot } from './SurfaceRootContext';\n\n/**\n * Direction determines how multiple components are laid out.\n */\nexport type Direction = 'inline' | 'inline-reverse' | 'block' | 'block-reverse';\n\n/**\n * SurfaceProps are the props that are passed to the Surface component.\n */\nexport type SurfaceProps = PropsWithChildren<{\n /**\n * Role defines how the data should be rendered.\n */\n role?: string;\n\n /**\n * Names allow nested surfaces to be specified in the parent context, similar to a slot.\n * Defaults to the value of `role` if not specified.\n */\n name?: string;\n\n /**\n * The data to be rendered by the surface.\n */\n data?: Record<string, unknown>;\n\n /**\n * Configure nested surfaces (indexed by the surface's `name`).\n */\n surfaces?: Record<string, Pick<SurfaceProps, 'data' | 'surfaces'>>;\n\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: ErrorBoundary['props']['fallback'];\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n\n /**\n * If more than one component is resolved, the direction determines how they are laid out.\n * NOTE: This is not yet implemented.\n */\n direction?: Direction;\n\n /**\n * Additional props to pass to the component.\n * These props are not used by Surface itself but may be used by components which resolve the surface.\n */\n [key: string]: unknown;\n}>;\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = forwardRef<HTMLElement, SurfaceProps>(\n ({ role, name = role, fallback, placeholder, ...rest }, forwardedRef) => {\n const props = { role, name, fallback, ...rest };\n const context = useContext(SurfaceContext);\n const data = props.data ?? ((name && context?.surfaces?.[name]?.data) || {});\n\n const resolver = <SurfaceResolver {...props} ref={forwardedRef} />;\n const suspense = placeholder ? <Suspense fallback={placeholder}>{resolver}</Suspense> : resolver;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n);\n\nconst SurfaceContext = createContext<SurfaceProps | null>(null);\n\nexport const useSurface = (): SurfaceProps =>\n useContext(SurfaceContext) ?? raise(new Error('Surface context not found'));\n\nconst SurfaceResolver = forwardRef<HTMLElement, SurfaceProps>((props, forwardedRef) => {\n const { components } = useSurfaceRoot();\n const parent = useContext(SurfaceContext);\n const nodes = resolveNodes(components, props, parent, forwardedRef);\n const currentContext: SurfaceProps = {\n ...props,\n surfaces: {\n ...((props.name && parent?.surfaces?.[props.name]?.surfaces) || {}),\n ...props.surfaces,\n },\n };\n\n return <SurfaceContext.Provider value={currentContext}>{nodes}</SurfaceContext.Provider>;\n});\n\nconst resolveNodes = (\n components: Record<string, SurfaceComponent>,\n props: SurfaceProps,\n context: SurfaceProps | null,\n forwardedRef: ForwardedRef<HTMLElement>,\n): ReactNode[] => {\n const data = {\n ...((props.name && context?.surfaces?.[props.name]?.data) || {}),\n ...props.data,\n };\n\n const nodes = Object.entries(components)\n .map(([key, component]): [string, SurfaceResult] | undefined => {\n const result = component({ ...props, data }, forwardedRef);\n if (!result || typeof result !== 'object') {\n return undefined;\n }\n\n return 'node' in result ? [key, result] : isValidElement(result) ? [key, { node: result }] : undefined;\n })\n .filter((result): result is [string, SurfaceResult] => Boolean(result))\n .sort(([, a], [, b]) => {\n const aDisposition = a.disposition ?? 'default';\n const bDisposition = b.disposition ?? 'default';\n\n if (aDisposition === bDisposition) {\n return 0;\n } else if (aDisposition === 'hoist' || bDisposition === 'fallback') {\n return -1;\n } else if (bDisposition === 'hoist' || aDisposition === 'fallback') {\n return 1;\n }\n\n return 0;\n })\n .map(([key, result]) => <Fragment key={key}>{result.node}</Fragment>);\n\n return props.limit ? nodes.slice(0, props.limit) : nodes;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { invariant } from '@dxos/invariant';\n\nimport { type BootstrapPluginsParams, Plugin, PluginHost } from './plugins';\nimport IntentMeta from './plugins/IntentPlugin/meta';\nimport SurfaceMeta from './plugins/SurfacePlugin/meta';\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const order = [LayoutMeta, MyPluginMeta];\n * const plugins = {\n * [LayoutMeta.id]: Plugin.lazy(() => import('./plugins/LayoutPlugin/plugin')),\n * [MyPluginMeta.id]: Plugin.lazy(() => import('./plugins/MyPlugin/plugin')),\n * };\n * const core = [LayoutMeta.id];\n * const default = [MyPluginMeta.id];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ order, plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.order Total ordering of plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.default Default plugins are enabled by default but can be disabled by the user.\n * @param params.fallback Fallback component to render while plugins are initializing.\n */\nexport const createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }: BootstrapPluginsParams) => {\n const host = PluginHost({\n order: [SurfaceMeta, IntentMeta, ...order],\n plugins: {\n ...plugins,\n [SurfaceMeta.id]: Plugin.lazy(() => import('./plugins/SurfacePlugin/plugin')),\n [IntentMeta.id]: Plugin.lazy(() => import('./plugins/IntentPlugin/plugin')),\n },\n core: [SurfaceMeta.id, IntentMeta.id, ...core],\n ...params,\n });\n\n invariant(host.provides?.context);\n invariant(host.provides?.root);\n const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OAAO,uBAAA,CAAA;MAC3C,CAACyI,mCAAW7O,EAAE,GAAGmG,OAAOC,KAAK,MAAM,OAAO,uBAAA,CAAA;IAC5C;IACAsF,MAAM;MAACkD,sBAAAA,aAAY5O;MAAI6O,mCAAW7O;SAAO0L;;IACzC,GAAGgD;EACL,CAAA;AAEAI,kCAAUH,KAAKtP,UAAU6J,SAAAA,QAAAA;;;;;;;;;AACzB4F,kCAAUH,KAAKtP,UAAUK,MAAAA,QAAAA;;;;;;;;;AACzB,QAAMqP,UAAUJ,KAAKtP,SAAS6J;AAC9B,QAAMmD,QAAOsC,KAAKtP,SAASK;AAE3B,SAAO,MACL2I,8BAAAA,QAAA,cAAC0G,SAAAA,MACC1G,8BAAAA,QAAA,cAACgE,OAAAA,IAAAA,CAAAA;AAGP;",
6
+ "names": ["import_zod", "import_react", "defaultFileTypes", "images", "media", "text", "parseFileManagerPlugin", "plugin", "provides", "file", "undefined", "parseGraphPlugin", "graph", "root", "parseGraphBuilderPlugin", "builder", "Toast", "z", "object", "id", "string", "title", "optional", "description", "icon", "any", "duration", "number", "closeLabel", "actionLabel", "actionAlt", "onAction", "function", "Layout", "fullscreen", "boolean", "sidebarOpen", "complementarySidebarOpen", "complementarySidebarContent", "describe", "dialogOpen", "dialogContent", "dialogBlockAlign", "union", "literal", "popoverOpen", "popoverContent", "popoverAnchorId", "toasts", "array", "scrollIntoView", "parseLayoutPlugin", "success", "safeParse", "layout", "LAYOUT_ACTION", "LayoutAction", "parseMetadataRecordsPlugin", "metadata", "records", "parseMetadataResolverPlugin", "resolver", "SLUG_LIST_SEPARATOR", "SLUG_ENTRY_SEPARATOR", "SLUG_KEY_VALUE_SEPARATOR", "SLUG_PATH_SEPARATOR", "SLUG_COLLECTION_INDICATOR", "SLUG_SOLO_INDICATOR", "parseSlug", "slug", "solo", "startsWith", "cleanSlug", "replace", "path", "split", "ActiveParts", "record", "Location", "active", "closed", "Attention", "attended", "set", "isActiveParts", "isAdjustTransaction", "data", "firstMainId", "Array", "isArray", "main", "activeIds", "Object", "values", "reduce", "acc", "ids", "forEach", "add", "Set", "isIdActive", "findIndex", "indexOf", "parseNavigationPlugin", "location", "NAVIGATION_ACTION", "NavigationAction", "parseSettingsPlugin", "settings", "SETTINGS_ACTION", "SettingsAction", "ResourceKey", "ResourceLanguage", "Resource", "parseTranslationsPlugin", "translations", "pluginMeta", "meta", "Plugin", "lazy", "p", "props", "then", "default", "definition", "PluginContext", "createContext", "ready", "enabled", "plugins", "available", "setPlugin", "usePlugins", "useContext", "usePlugin", "findPlugin", "useResolvePlugin", "predicate", "resolvePlugin", "PluginProvider", "Provider", "isObject", "ErrorBoundary", "Component", "constructor", "state", "error", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "resetError", "render", "React", "this", "fallback", "reset", "children", "setState", "Surface", "forwardRef", "role", "name", "placeholder", "rest", "forwardedRef", "context", "SurfaceContext", "surfaces", "SurfaceResolver", "ref", "suspense", "Suspense", "useSurface", "raise", "Error", "components", "useSurfaceRoot", "parent", "nodes", "resolveNodes", "currentContext", "value", "entries", "map", "key", "component", "result", "isValidElement", "node", "filter", "Boolean", "sort", "a", "b", "aDisposition", "disposition", "bDisposition", "Fragment", "limit", "slice", "parsePluginHost", "PLUGIN_HOST", "PluginHost", "order", "definitions", "core", "defaults", "DefaultFallback", "LocalStorageStore", "includes", "push", "index", "splice", "prop", "type", "json", "Root", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "corePluginIds", "setError", "useState", "useEffect", "log", "timeout", "setTimeout", "enabledIds", "indexA", "indexB", "Promise", "all", "initializePlugin", "catch", "err", "pluginDefinition", "clearTimeout", "ComposedContext", "composeContext", "rootComponents", "initialize", "compose", "contexts", "Acc", "Next", "createApp", "params", "host", "SurfaceMeta", "IntentMeta", "invariant", "Context"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2950,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2157,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":10186,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2094,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":13241,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2093,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3521,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1046,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4410,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3845,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2719,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5320,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1817,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1970,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4343,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2803,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13897,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":917,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21462,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":890,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":726,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":734,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":3949,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":19387,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":7027,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":576,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49564},"packages/sdk/app-framework/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs","kind":"dynamic-import"}],"exports":["ActiveParts","Attention","ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SLUG_COLLECTION_INDICATOR","SLUG_ENTRY_SEPARATOR","SLUG_KEY_VALUE_SEPARATOR","SLUG_LIST_SEPARATOR","SLUG_PATH_SEPARATOR","SettingsAction","Surface","SurfaceProvider","Toast","activeIds","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","firstMainId","getPlugin","initializePlugin","isActiveParts","isAdjustTransaction","isIdActive","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":288},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1757},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":2352},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5192},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":705},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":18689},"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1945},"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":655}},"bytes":960},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9484},"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4605},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5173},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
1
+ {"inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytes":2950,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytes":2157,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytes":10186,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytes":2094,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytes":14776,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytes":2093,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytes":3521,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytes":1046,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/sdk/app-framework/src/plugins/common/graph.ts","kind":"import-statement","original":"./graph"},{"path":"packages/sdk/app-framework/src/plugins/common/layout.ts","kind":"import-statement","original":"./layout"},{"path":"packages/sdk/app-framework/src/plugins/common/metadata.ts","kind":"import-statement","original":"./metadata"},{"path":"packages/sdk/app-framework/src/plugins/common/navigation.ts","kind":"import-statement","original":"./navigation"},{"path":"packages/sdk/app-framework/src/plugins/common/settings.ts","kind":"import-statement","original":"./settings"},{"path":"packages/sdk/app-framework/src/plugins/common/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytes":4410,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts":{"bytes":3845,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytes":2719,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/intent.ts","kind":"import-statement","original":"./intent"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytes":5480,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytes":4090,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytes":1817,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytes":1970,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytes":4343,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytes":2803,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytes":13897,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytes":917,"imports":[{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx","kind":"import-statement","original":"./ErrorBoundary"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx","kind":"import-statement","original":"./Surface"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytes":21462,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"../SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytes":710,"imports":[{"path":"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts","kind":"import-statement","original":"./plugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx","kind":"import-statement","original":"./PluginContext"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx","kind":"import-statement","original":"./PluginHost"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/index.ts":{"bytes":890,"imports":[{"path":"packages/sdk/app-framework/src/plugins/common/index.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts","kind":"import-statement","original":"./IntentPlugin"},{"path":"packages/sdk/app-framework/src/plugins/PluginHost/index.ts","kind":"import-statement","original":"./PluginHost"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts","kind":"import-statement","original":"./SurfacePlugin"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytes":726,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytes":734,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytes":3949,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx","kind":"import-statement","original":"./SurfaceRootContext"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytes":1170,"imports":[],"format":"esm"},"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytes":19387,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx","kind":"import-statement","original":"./IntentContext"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts","kind":"import-statement","original":"./provides"},{"path":"packages/sdk/app-framework/src/plugins/helpers.ts","kind":"import-statement","original":"../helpers"}],"format":"esm"},"packages/sdk/app-framework/src/App.tsx":{"bytes":7027,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts","kind":"import-statement","original":"./plugins/IntentPlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts","kind":"import-statement","original":"./plugins/SurfacePlugin/meta"},{"path":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/SurfacePlugin/plugin"},{"path":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","kind":"dynamic-import","original":"./plugins/IntentPlugin/plugin"}],"format":"esm"},"packages/sdk/app-framework/src/index.ts":{"bytes":576,"imports":[{"path":"packages/sdk/app-framework/src/plugins/index.ts","kind":"import-statement","original":"./plugins"},{"path":"packages/sdk/app-framework/src/App.tsx","kind":"import-statement","original":"./App"}],"format":"esm"}},"outputs":{"packages/sdk/app-framework/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":50550},"packages/sdk/app-framework/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs","kind":"dynamic-import"},{"path":"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs","kind":"dynamic-import"}],"exports":["ActiveParts","Attention","ErrorBoundary","IntentAction","IntentProvider","Layout","LayoutAction","Location","NavigationAction","Plugin","PluginHost","PluginProvider","Resource","ResourceKey","ResourceLanguage","SLUG_COLLECTION_INDICATOR","SLUG_ENTRY_SEPARATOR","SLUG_KEY_VALUE_SEPARATOR","SLUG_LIST_SEPARATOR","SLUG_PATH_SEPARATOR","SLUG_SOLO_INDICATOR","SettingsAction","Surface","SurfaceProvider","Toast","activeIds","createApp","defaultFileTypes","definePlugin","filterPlugins","findPlugin","firstMainId","getPlugin","initializePlugin","isActiveParts","isAdjustTransaction","isIdActive","isObject","parseFileManagerPlugin","parseGraphBuilderPlugin","parseGraphPlugin","parseIntentPlugin","parseIntentResolverPlugin","parseLayoutPlugin","parseMetadataRecordsPlugin","parseMetadataResolverPlugin","parseNavigationPlugin","parsePluginHost","parseRootSurfacePlugin","parseSettingsPlugin","parseSlug","parseSurfacePlugin","parseTranslationsPlugin","pluginMeta","resolvePlugin","useIntent","useIntentDispatcher","useIntentResolver","usePlugin","usePlugins","useResolvePlugin","useSurface","useSurfaceRoot"],"entryPoint":"packages/sdk/app-framework/src/index.ts","inputs":{"packages/sdk/app-framework/src/plugins/common/file.ts":{"bytesInOutput":288},"packages/sdk/app-framework/src/plugins/common/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/common/graph.ts":{"bytesInOutput":174},"packages/sdk/app-framework/src/plugins/common/layout.ts":{"bytesInOutput":1757},"packages/sdk/app-framework/src/plugins/common/metadata.ts":{"bytesInOutput":226},"packages/sdk/app-framework/src/plugins/common/navigation.ts":{"bytesInOutput":2645},"packages/sdk/app-framework/src/plugins/common/settings.ts":{"bytesInOutput":341},"packages/sdk/app-framework/src/plugins/common/translations.ts":{"bytesInOutput":357},"packages/sdk/app-framework/src/plugins/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/IntentPlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts":{"bytesInOutput":230},"packages/sdk/app-framework/src/plugins/PluginHost/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/PluginHost/PluginContext.tsx":{"bytesInOutput":512},"packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx":{"bytesInOutput":5192},"packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts":{"bytesInOutput":61},"packages/sdk/app-framework/src/plugins/SurfacePlugin/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx":{"bytesInOutput":705},"packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx":{"bytesInOutput":2735},"packages/sdk/app-framework/src/index.ts":{"bytesInOutput":0},"packages/sdk/app-framework/src/App.tsx":{"bytesInOutput":1153}},"bytes":19018},"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1945},"packages/sdk/app-framework/dist/lib/node/plugin-WM3TAFFD.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/plugin.tsx":{"bytesInOutput":655}},"bytes":960},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3074},"packages/sdk/app-framework/dist/lib/node/chunk-BTZLKXA2.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["SurfaceProvider","meta_default","parseRootSurfacePlugin","parseSurfacePlugin","useSurfaceRoot"],"inputs":{"packages/sdk/app-framework/src/plugins/SurfacePlugin/provides.ts":{"bytesInOutput":191},"packages/sdk/app-framework/src/plugins/SurfacePlugin/SurfaceRootContext.tsx":{"bytesInOutput":239},"packages/sdk/app-framework/src/plugins/SurfacePlugin/meta.ts":{"bytesInOutput":87}},"bytes":887},"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9484},"packages/sdk/app-framework/dist/lib/node/plugin-QV7ESETI.cjs":{"imports":[{"path":"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs","kind":"import-statement"},{"path":"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx","inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/plugin.tsx":{"bytesInOutput":4605},"packages/sdk/app-framework/src/plugins/IntentPlugin/helpers.ts":{"bytesInOutput":94}},"bytes":5173},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3904},"packages/sdk/app-framework/dist/lib/node/chunk-DFST5IG5.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["IntentAction","IntentProvider","meta_default","parseIntentPlugin","parseIntentResolverPlugin","useIntent","useIntentDispatcher","useIntentResolver"],"inputs":{"packages/sdk/app-framework/src/plugins/IntentPlugin/provides.ts":{"bytesInOutput":406},"packages/sdk/app-framework/src/plugins/IntentPlugin/IntentContext.tsx":{"bytesInOutput":637},"packages/sdk/app-framework/src/plugins/IntentPlugin/meta.ts":{"bytesInOutput":84}},"bytes":1545},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2286},"packages/sdk/app-framework/dist/lib/node/chunk-62W6CMGM.cjs":{"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["definePlugin","filterPlugins","findPlugin","getPlugin","resolvePlugin"],"inputs":{"packages/sdk/app-framework/src/plugins/helpers.ts":{"bytesInOutput":564}},"bytes":750}}}
@@ -49,8 +49,13 @@ export type Plugin<TProvides = {}> = {
49
49
  tags?: string[];
50
50
  /**
51
51
  * Component to render icon for the plugin when displayed in a list.
52
+ * @deprecated
52
53
  */
53
54
  iconComponent?: FC<IconProps>;
55
+ /**
56
+ * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
57
+ */
58
+ iconSymbol?: string;
54
59
  };
55
60
  /**
56
61
  * Capabilities provided by the plugin.
@@ -117,8 +122,13 @@ export declare const pluginMeta: (meta: Plugin['meta']) => {
117
122
  tags?: string[] | undefined;
118
123
  /**
119
124
  * Component to render icon for the plugin when displayed in a list.
125
+ * @deprecated
120
126
  */
121
127
  iconComponent?: FC<IconProps> | undefined;
128
+ /**
129
+ * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
130
+ */
131
+ iconSymbol?: string | undefined;
122
132
  };
123
133
  type LazyPlugin<T> = () => Promise<{
124
134
  default: (props: T) => PluginDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/PluginHost/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,SAAS,IAAI,SAAS,GAAG;IAClD;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAKhC,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC;CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,MAAM,CAAC,SAAS,GAAG,EAAE,IAAI;IACnC,IAAI,EAAE;QACJ;;;;;;WAMG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;;;WAIG;QAEH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAEhB;;WAEG;QAEH,aAAa,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;KAC/B,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,SAAS,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG;IAClG;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,C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G;;CA0CiD,CAAC;AAEzD,KAAK,UAAU,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,gBAAgB,CAAA;CAAE,CAAC,CAAC;AAEhF,yBAAiB,MAAM,CAAC;IACf,MAAM,IAAI,SAAU,WAAW,CAAC,CAAC,UAAU,CAAC,4CAKlD,CAAC;CACH"}
@@ -6,6 +6,12 @@ export declare const SLUG_ENTRY_SEPARATOR = "_";
6
6
  export declare const SLUG_KEY_VALUE_SEPARATOR = "-";
7
7
  export declare const SLUG_PATH_SEPARATOR = "~";
8
8
  export declare const SLUG_COLLECTION_INDICATOR = "";
9
+ export declare const SLUG_SOLO_INDICATOR = "$";
10
+ export declare const parseSlug: (slug: string) => {
11
+ id: string;
12
+ path: string[];
13
+ solo: boolean;
14
+ };
9
15
  export declare const ActiveParts: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
10
16
  /**
11
17
  * Basic state provided by a navigation plugin.
@@ -30,10 +36,12 @@ export declare const Attention: z.ZodObject<{
30
36
  export type ActiveParts = z.infer<typeof ActiveParts>;
31
37
  export type Location = z.infer<typeof Location>;
32
38
  export type Attention = z.infer<typeof Attention>;
39
+ export type LayoutPart = 'sidebar' | 'main' | 'complementary';
33
40
  export type LayoutCoordinate = {
34
- part: string;
41
+ part: LayoutPart;
35
42
  index: number;
36
43
  partSize: number;
44
+ solo?: boolean;
37
45
  };
38
46
  export type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;
39
47
  export type NavigationAdjustment = {
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/common/navigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,M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AC,CAAC;IAC7D;;OAEG;IACH,KAAY,GAAG,GAAG,UAAU,CAAC;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC3D;;OAEG;IACH,KAAY,MAAM,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;CACvD"}
package/package.json CHANGED
@@ -1,33 +1,41 @@
1
1
  {
2
2
  "name": "@dxos/app-framework",
3
- "version": "0.6.4",
3
+ "version": "0.6.5-staging.42fccfe",
4
4
  "description": "A framework for building applications from composible plugins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
- "main": "dist/lib/node/index.cjs",
10
- "browser": {
11
- "./dist/lib/node/index.cjs": "./dist/lib/browser/index.mjs"
9
+ "exports": {
10
+ ".": {
11
+ "browser": "./dist/lib/browser/index.mjs",
12
+ "node": {
13
+ "default": "./dist/lib/node/index.cjs"
14
+ },
15
+ "types": "./dist/types/src/index.d.ts"
16
+ }
12
17
  },
13
18
  "types": "dist/types/src/index.d.ts",
19
+ "typesVersions": {
20
+ "*": {}
21
+ },
14
22
  "dependencies": {
15
23
  "@phosphor-icons/react": "^2.1.5",
16
24
  "@preact/signals-core": "^1.6.0",
17
25
  "zod": "^3.22.4",
18
- "@dxos/app-graph": "0.6.4",
19
- "@dxos/client-protocol": "0.6.4",
20
- "@dxos/invariant": "0.6.4",
21
- "@dxos/debug": "0.6.4",
22
- "@dxos/local-storage": "0.6.4",
23
- "@dxos/async": "0.6.4",
24
- "@dxos/log": "0.6.4",
25
- "@dxos/util": "0.6.4",
26
- "@dxos/echo-schema": "0.6.4"
26
+ "@dxos/async": "0.6.5-staging.42fccfe",
27
+ "@dxos/client-protocol": "0.6.5-staging.42fccfe",
28
+ "@dxos/app-graph": "0.6.5-staging.42fccfe",
29
+ "@dxos/echo-schema": "0.6.5-staging.42fccfe",
30
+ "@dxos/debug": "0.6.5-staging.42fccfe",
31
+ "@dxos/local-storage": "0.6.5-staging.42fccfe",
32
+ "@dxos/invariant": "0.6.5-staging.42fccfe",
33
+ "@dxos/log": "0.6.5-staging.42fccfe",
34
+ "@dxos/util": "0.6.5-staging.42fccfe"
27
35
  },
28
36
  "devDependencies": {
29
37
  "@types/react": "^18.0.21",
30
- "react": "^18.2.0"
38
+ "react": "~18.2.0"
31
39
  },
32
40
  "peerDependencies": {
33
41
  "react": "*"
@@ -66,9 +66,14 @@ export type Plugin<TProvides = {}> = {
66
66
 
67
67
  /**
68
68
  * Component to render icon for the plugin when displayed in a list.
69
+ * @deprecated
69
70
  */
70
- // TODO(wittjosiah): Convert to `icon` and make serializable.
71
71
  iconComponent?: FC<IconProps>;
72
+
73
+ /**
74
+ * A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
75
+ */
76
+ iconSymbol?: string;
72
77
  };
73
78
 
74
79
  /**
@@ -13,6 +13,15 @@ export const SLUG_ENTRY_SEPARATOR = '_';
13
13
  export const SLUG_KEY_VALUE_SEPARATOR = '-';
14
14
  export const SLUG_PATH_SEPARATOR = '~';
15
15
  export const SLUG_COLLECTION_INDICATOR = '';
16
+ export const SLUG_SOLO_INDICATOR = '$';
17
+
18
+ export const parseSlug = (slug: string): { id: string; path: string[]; solo: boolean } => {
19
+ const solo = slug.startsWith(SLUG_SOLO_INDICATOR);
20
+ const cleanSlug = solo ? slug.replace(SLUG_SOLO_INDICATOR, '') : slug;
21
+ const [id, ...path] = cleanSlug.split(SLUG_PATH_SEPARATOR);
22
+
23
+ return { id, path, solo };
24
+ };
16
25
 
17
26
  //
18
27
  // Provides
@@ -44,7 +53,10 @@ export type ActiveParts = z.infer<typeof ActiveParts>;
44
53
  export type Location = z.infer<typeof Location>;
45
54
  export type Attention = z.infer<typeof Attention>;
46
55
 
47
- export type LayoutCoordinate = { part: string; index: number; partSize: number };
56
+ // QUESTION(Zan): Is fullscreen a part? Or a special case of 'main'?
57
+ export type LayoutPart = 'sidebar' | 'main' | 'complementary';
58
+
59
+ export type LayoutCoordinate = { part: LayoutPart; index: number; partSize: number; solo?: boolean };
48
60
  export type NavigationAdjustmentType = `${'pin' | 'increment'}-${'start' | 'end'}`;
49
61
  export type NavigationAdjustment = { layoutCoordinate: LayoutCoordinate; type: NavigationAdjustmentType };
50
62