@dxos/plugin-stack 0.6.13-staging.1e988a3 → 0.6.14-main.7bd9c89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{StackMain-XRQRNZ4I.mjs → StackMain-ILYVK656.mjs} +12 -11
- package/dist/lib/browser/StackMain-ILYVK656.mjs.map +7 -0
- package/dist/lib/browser/{chunk-R5KXWF2W.mjs → chunk-6PHTGCQZ.mjs} +9 -3
- package/dist/lib/browser/chunk-6PHTGCQZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AYDYMPJK.mjs → chunk-ONAKM24Z.mjs} +3 -6
- package/dist/lib/browser/chunk-ONAKM24Z.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/meta.mjs +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{StackMain-XJGYFDDN.cjs → StackMain-LAYSQV2S.cjs} +26 -25
- package/dist/lib/node/StackMain-LAYSQV2S.cjs.map +7 -0
- package/dist/lib/node/{chunk-EMD6A66G.cjs → chunk-3D3FPZWK.cjs} +12 -6
- package/dist/lib/node/chunk-3D3FPZWK.cjs.map +7 -0
- package/dist/lib/node/{chunk-I42JKRXR.cjs → chunk-O5SQVKNW.cjs} +5 -18
- package/dist/lib/node/chunk-O5SQVKNW.cjs.map +7 -0
- package/dist/lib/node/index.cjs +53 -53
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.cjs +4 -4
- package/dist/lib/node/meta.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs +278 -0
- package/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HRY4R5UU.mjs +29 -0
- package/dist/lib/node-esm/chunk-HRY4R5UU.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-J57BXQJY.mjs +18 -0
- package/dist/lib/node-esm/chunk-J57BXQJY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +286 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/meta.mjs +12 -0
- package/dist/lib/node-esm/meta.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/components/AddSectionDialog.d.ts.map +1 -1
- package/dist/types/src/components/StackMain.d.ts +2 -1
- package/dist/types/src/components/StackMain.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/package.json +34 -29
- package/src/StackPlugin.tsx +15 -7
- package/src/components/AddSectionDialog.tsx +1 -2
- package/src/components/StackMain.tsx +50 -47
- package/src/components/index.ts +2 -3
- package/src/{meta.tsx → meta.ts} +3 -5
- package/src/types/stack.ts +3 -3
- package/dist/lib/browser/StackMain-XRQRNZ4I.mjs.map +0 -7
- package/dist/lib/browser/chunk-AYDYMPJK.mjs.map +0 -7
- package/dist/lib/browser/chunk-R5KXWF2W.mjs.map +0 -7
- package/dist/lib/node/StackMain-XJGYFDDN.cjs.map +0 -7
- package/dist/lib/node/chunk-EMD6A66G.cjs.map +0 -7
- package/dist/lib/node/chunk-I42JKRXR.cjs.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/StackPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/StackSettings.tsx", "../../../src/components/AddSectionDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackSimple, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { type Plugin, type PluginDefinition } from '@dxos/app-framework';\nimport { create } from '@dxos/echo-schema';\nimport { type EchoReactiveObject } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Main } from '@dxos/react-ui';\nimport { baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';\n\nimport { StackMain, StackSettings, AddSectionDialog, dataHasAddSectionDialogProps } from './components';\nimport meta, { SECTION_IDENTIFIER, STACK_PLUGIN } from './meta';\nimport translations from './translations';\nimport { StackViewType } from './types';\nimport { type StackPluginProvides, type StackProvides, type StackState, type StackSettingsProps } from './types';\n\nexport const StackPlugin = (): PluginDefinition<StackPluginProvides> => {\n const settings = new LocalStorageStore<StackSettingsProps>(STACK_PLUGIN, { separation: true });\n const stackState = create<StackState>({ creators: [] });\n\n return {\n meta,\n ready: async (plugins) => {\n settings.prop({ key: 'separation', type: LocalStorageStore.bool() });\n\n for (const plugin of plugins) {\n if (plugin.meta.id === STACK_PLUGIN) {\n continue;\n }\n\n if (Array.isArray((plugin as Plugin<StackProvides>).provides?.stack?.creators)) {\n stackState.creators.push(...((plugin as Plugin<StackProvides>).provides.stack.creators ?? []));\n }\n }\n },\n provides: {\n settings: settings.values,\n metadata: {\n records: {\n [StackViewType.typename]: {\n placeholder: ['stack title placeholder', { ns: STACK_PLUGIN }],\n icon: (props: IconProps) => <StackSimple {...props} />,\n iconSymbol: 'ph--stack-simple--regular',\n },\n [SECTION_IDENTIFIER]: {\n parse: (section: { object: EchoReactiveObject<any> }, type: string) => {\n switch (type) {\n case 'node':\n // TODO(wittjosiah): Remove cast.\n return { id: section.object.id, label: section.object.title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n },\n translations,\n echo: {\n schema: [StackViewType],\n },\n surface: {\n component: ({ data, role }) => {\n switch (data.component) {\n case `${STACK_PLUGIN}/AddSectionDialog`:\n return dataHasAddSectionDialogProps(data) ? <AddSectionDialog {...data.subject} /> : null;\n }\n\n const primary = data.active ?? data.object;\n switch (role) {\n case 'main':\n return primary instanceof CollectionType ? (\n <Main.Content bounce classNames={[baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}>\n <StackMain collection={primary} separation={settings.values.separation} />\n </Main.Content>\n ) : null;\n case 'article':\n return primary instanceof CollectionType ? (\n <div role='none' className='row-span-2 overflow-auto'>\n <StackMain collection={primary} separation={settings.values.separation} />\n </div>\n ) : null;\n case 'settings': {\n return data.plugin === meta.id ? <StackSettings settings={settings.values} /> : null;\n }\n default:\n return null;\n }\n },\n },\n stack: stackState,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const StackMain = React.lazy(() => import('./StackMain'));\n\nexport * from './StackSettings';\nexport * from './AddSectionDialog';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(STACK_PLUGIN);\n\n return (\n <>\n <SettingsValue label={t('settings separation label')}>\n <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />\n </SettingsValue>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { FilePlus } from '@phosphor-icons/react';\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { usePlugin, useIntent, LayoutAction, useResolvePlugin, parseFileManagerPlugin } from '@dxos/app-framework';\nimport { type EchoReactiveObject, create } from '@dxos/echo-schema';\nimport { FileType } from '@dxos/plugin-ipfs/types';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Dialog, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Path } from '@dxos/react-ui-mosaic';\nimport { SearchList } from '@dxos/react-ui-searchlist';\nimport { type AddSectionPosition } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { StackViewType, type StackPluginProvides } from '../types';\n\ntype AddSectionDialogProps = { path?: string; position: AddSectionPosition; collection: CollectionType };\n\nexport const dataHasAddSectionDialogProps = (data: any): data is { subject: AddSectionDialogProps } => {\n return (\n 'subject' in data &&\n typeof data.subject === 'object' &&\n !!data.subject &&\n 'position' in data.subject &&\n typeof data.subject.position === 'string' &&\n 'collection' in data.subject\n );\n};\n\nexport const AddSectionDialog = ({ path, position, collection }: AddSectionDialogProps) => {\n const { t } = useTranslation(STACK_PLUGIN);\n const stackPlugin = usePlugin<StackPluginProvides>(STACK_PLUGIN);\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n const fileRef = useRef<HTMLInputElement | null>(null);\n const { dispatch } = useIntent();\n const space = getSpace(collection);\n const [pending, setPending] = useState<boolean>(false);\n const [uploadError, setUploadError] = useState<Error | undefined>();\n\n const handleAdd = useCallback(\n (sectionObject: EchoReactiveObject<any>) => {\n const index =\n position === 'beforeAll'\n ? 0\n : position === 'afterAll'\n ? collection.objects.length\n : collection.objects.filter(nonNullable).findIndex((section) => section.id === Path.last(path!));\n\n collection.objects.splice(index + (position === 'after' ? 1 : 0), 0, sectionObject);\n const stack = collection.views[StackViewType.typename];\n if (stack) {\n stack.sections[sectionObject.id] = {};\n }\n setPending(false);\n void dispatch?.({ action: LayoutAction.SET_LAYOUT, data: { element: 'dialog', state: false } });\n },\n [collection, path, position, dispatch],\n );\n\n const handleFileUpload =\n fileManagerPlugin?.provides.file.upload && space\n ? async (file: File) => {\n const filename = file.name.split('.')[0];\n try {\n const info = await fileManagerPlugin.provides.file.upload?.(file, space);\n if (info) {\n const obj = create(FileType, { type: file.type, name: filename, filename, cid: info.cid });\n handleAdd(obj);\n }\n } catch (err: any) {\n setUploadError(err);\n }\n }\n : undefined;\n\n return (\n <Dialog.Content>\n <Dialog.Title>{t(`add section ${position} dialog title`)}</Dialog.Title>\n <SearchList.Root label={t('add section input placeholder')}>\n <SearchList.Input placeholder={t('add section input placeholder')} classNames='pli-3' disabled={pending} />\n <SearchList.Content classNames='min-bs-24 bs-fit max-bs-64 overflow-auto' {...(pending && { inert: 'true' })}>\n {stackPlugin?.provides?.stack.creators?.map(({ id, icon: Icon, label: propsLabel, testId, intent }) => {\n const label = toLocalizedString(propsLabel, t);\n return (\n <SearchList.Item\n value={label}\n key={id}\n onSelect={async () => {\n setPending(true);\n const { data: nextSection } = (await dispatch({ ...intent, data: { space } })) ?? {};\n handleAdd(nextSection);\n }}\n classNames='flex items-center gap-2 pli-2'\n data-testid={testId}\n >\n {Icon && <Icon className={mx(getSize(4), 'shrink-0')} />}\n <span className='grow truncate'>{label}</span>\n </SearchList.Item>\n );\n })}\n {handleFileUpload && (\n <SearchList.Item\n value={t('upload file label')}\n classNames='flex items-center gap-2 pli-2'\n onSelect={() => fileRef.current?.click()}\n >\n <FilePlus />\n <span className='grow truncate'>{t('upload file label')}</span>\n </SearchList.Item>\n )}\n {uploadError && <div className='text-error-500'>{uploadError.message}</div>}\n </SearchList.Content>\n </SearchList.Root>\n {handleFileUpload && (\n <input\n type='file'\n className='sr-only'\n ref={fileRef}\n onChange={({ target: { files } }) => files && handleFileUpload(files[0])}\n />\n )}\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { STACK_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [STACK_PLUGIN]: {\n 'plugin name': 'Stacks',\n 'settings separation label': 'Separate sections',\n 'add section beforeAll dialog title': 'Add a section to the start',\n 'add section afterAll dialog title': 'Add a section to the end',\n 'add section before dialog title': 'Add a section',\n 'add section after dialog title': 'Add a section',\n 'add section input placeholder': 'Find the type of section to add',\n 'upload file label': 'Add file',\n 'add section label': 'Add section',\n },\n },\n },\n ...stackTranslations,\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackPlugin } from './StackPlugin';\n\nexport default StackPlugin;\n\nexport * from './types';\n\nexport * from './StackPlugin';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,
|
|
6
|
-
"names": ["import_react", "import_react_ui", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin, type PluginDefinition } from '@dxos/app-framework';\nimport { create, type EchoReactiveObject, fullyQualifiedId } from '@dxos/client/echo';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Main } from '@dxos/react-ui';\nimport { baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';\n\nimport { StackMain, StackSettings, AddSectionDialog, dataHasAddSectionDialogProps } from './components';\nimport meta, { SECTION_IDENTIFIER, STACK_PLUGIN } from './meta';\nimport translations from './translations';\nimport { StackViewType } from './types';\nimport { type StackPluginProvides, type StackProvides, type StackState, type StackSettingsProps } from './types';\n\nexport const StackPlugin = (): PluginDefinition<StackPluginProvides> => {\n const settings = new LocalStorageStore<StackSettingsProps>(STACK_PLUGIN, { separation: true });\n const stackState = create<StackState>({ creators: [] });\n\n return {\n meta,\n ready: async (plugins) => {\n settings.prop({ key: 'separation', type: LocalStorageStore.bool() });\n\n for (const plugin of plugins) {\n if (plugin.meta.id === STACK_PLUGIN) {\n continue;\n }\n\n if (Array.isArray((plugin as Plugin<StackProvides>).provides?.stack?.creators)) {\n stackState.creators.push(...((plugin as Plugin<StackProvides>).provides.stack.creators ?? []));\n }\n }\n },\n provides: {\n settings: settings.values,\n metadata: {\n records: {\n [StackViewType.typename]: {\n placeholder: ['stack title placeholder', { ns: STACK_PLUGIN }],\n icon: 'ph--stack-simple--regular',\n },\n [SECTION_IDENTIFIER]: {\n parse: (section: { object: EchoReactiveObject<any> }, type: string) => {\n switch (type) {\n case 'node':\n // TODO(wittjosiah): Remove cast.\n return { id: section.object.id, label: section.object.title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n },\n translations,\n echo: {\n schema: [StackViewType],\n },\n surface: {\n component: ({ data, role }) => {\n switch (data.component) {\n case `${STACK_PLUGIN}/AddSectionDialog`:\n return dataHasAddSectionDialogProps(data) ? <AddSectionDialog {...data.subject} /> : null;\n }\n\n const primary = data.active ?? data.object;\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n switch (role) {\n case 'main':\n return primary instanceof CollectionType ? (\n <Main.Content bounce classNames={[baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}>\n <StackMain\n id={id ?? fullyQualifiedId(primary)}\n collection={primary}\n separation={settings.values.separation}\n />\n </Main.Content>\n ) : null;\n case 'article':\n return primary instanceof CollectionType ? (\n <div role='none' className='row-span-2 overflow-auto'>\n <StackMain\n id={id ?? fullyQualifiedId(primary)}\n collection={primary}\n separation={settings.values.separation}\n />\n </div>\n ) : null;\n case 'settings': {\n return data.plugin === meta.id ? <StackSettings settings={settings.values} /> : null;\n }\n default:\n return null;\n }\n },\n },\n stack: stackState,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const StackMain = lazy(() => import('./StackMain'));\n\nexport * from './StackSettings';\nexport * from './AddSectionDialog';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(STACK_PLUGIN);\n\n return (\n <>\n <SettingsValue label={t('settings separation label')}>\n <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />\n </SettingsValue>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { FilePlus } from '@phosphor-icons/react';\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { usePlugin, useIntent, LayoutAction, useResolvePlugin, parseFileManagerPlugin } from '@dxos/app-framework';\nimport { type EchoReactiveObject, create, getSpace } from '@dxos/client/echo';\nimport { FileType } from '@dxos/plugin-ipfs/types';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { Dialog, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Path } from '@dxos/react-ui-mosaic';\nimport { SearchList } from '@dxos/react-ui-searchlist';\nimport { type AddSectionPosition } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { StackViewType, type StackPluginProvides } from '../types';\n\ntype AddSectionDialogProps = { path?: string; position: AddSectionPosition; collection: CollectionType };\n\nexport const dataHasAddSectionDialogProps = (data: any): data is { subject: AddSectionDialogProps } => {\n return (\n 'subject' in data &&\n typeof data.subject === 'object' &&\n !!data.subject &&\n 'position' in data.subject &&\n typeof data.subject.position === 'string' &&\n 'collection' in data.subject\n );\n};\n\nexport const AddSectionDialog = ({ path, position, collection }: AddSectionDialogProps) => {\n const { t } = useTranslation(STACK_PLUGIN);\n const stackPlugin = usePlugin<StackPluginProvides>(STACK_PLUGIN);\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n const fileRef = useRef<HTMLInputElement | null>(null);\n const { dispatch } = useIntent();\n const space = getSpace(collection);\n const [pending, setPending] = useState<boolean>(false);\n const [uploadError, setUploadError] = useState<Error | undefined>();\n\n const handleAdd = useCallback(\n (sectionObject: EchoReactiveObject<any>) => {\n const index =\n position === 'beforeAll'\n ? 0\n : position === 'afterAll'\n ? collection.objects.length\n : collection.objects.filter(nonNullable).findIndex((section) => section.id === Path.last(path!));\n\n collection.objects.splice(index + (position === 'after' ? 1 : 0), 0, sectionObject);\n const stack = collection.views[StackViewType.typename];\n if (stack) {\n stack.sections[sectionObject.id] = {};\n }\n setPending(false);\n void dispatch?.({ action: LayoutAction.SET_LAYOUT, data: { element: 'dialog', state: false } });\n },\n [collection, path, position, dispatch],\n );\n\n const handleFileUpload =\n fileManagerPlugin?.provides.file.upload && space\n ? async (file: File) => {\n const filename = file.name.split('.')[0];\n try {\n const info = await fileManagerPlugin.provides.file.upload?.(file, space);\n if (info) {\n const obj = create(FileType, { type: file.type, name: filename, filename, cid: info.cid });\n handleAdd(obj);\n }\n } catch (err: any) {\n setUploadError(err);\n }\n }\n : undefined;\n\n return (\n <Dialog.Content>\n <Dialog.Title>{t(`add section ${position} dialog title`)}</Dialog.Title>\n <SearchList.Root label={t('add section input placeholder')}>\n <SearchList.Input placeholder={t('add section input placeholder')} classNames='pli-3' disabled={pending} />\n <SearchList.Content classNames='min-bs-24 bs-fit max-bs-64 overflow-auto' {...(pending && { inert: 'true' })}>\n {stackPlugin?.provides?.stack.creators?.map(({ id, icon: Icon, label: propsLabel, testId, intent }) => {\n const label = toLocalizedString(propsLabel, t);\n return (\n <SearchList.Item\n value={label}\n key={id}\n onSelect={async () => {\n setPending(true);\n const { data: nextSection } = (await dispatch({ ...intent, data: { space } })) ?? {};\n handleAdd(nextSection);\n }}\n classNames='flex items-center gap-2 pli-2'\n data-testid={testId}\n >\n {Icon && <Icon className={mx(getSize(4), 'shrink-0')} />}\n <span className='grow truncate'>{label}</span>\n </SearchList.Item>\n );\n })}\n {handleFileUpload && (\n <SearchList.Item\n value={t('upload file label')}\n classNames='flex items-center gap-2 pli-2'\n onSelect={() => fileRef.current?.click()}\n >\n <FilePlus />\n <span className='grow truncate'>{t('upload file label')}</span>\n </SearchList.Item>\n )}\n {uploadError && <div className='text-error-500'>{uploadError.message}</div>}\n </SearchList.Content>\n </SearchList.Root>\n {handleFileUpload && (\n <input\n type='file'\n className='sr-only'\n ref={fileRef}\n onChange={({ target: { files } }) => files && handleFileUpload(files[0])}\n />\n )}\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { STACK_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [STACK_PLUGIN]: {\n 'plugin name': 'Stacks',\n 'settings separation label': 'Separate sections',\n 'add section beforeAll dialog title': 'Add a section to the start',\n 'add section afterAll dialog title': 'Add a section to the end',\n 'add section before dialog title': 'Add a section',\n 'add section after dialog title': 'Add a section',\n 'add section input placeholder': 'Find the type of section to add',\n 'upload file label': 'Add file',\n 'add section label': 'Add section',\n },\n },\n },\n ...stackTranslations,\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackPlugin } from './StackPlugin';\n\nexport default StackPlugin;\n\nexport * from './types';\n\nexport * from './StackPlugin';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAGlB,kBAAkE;AAClE,2BAAkC;AAClC,mBAA+B;AAC/B,sBAAqB;AACrB,4BAA+E;ACP/E,IAAAA,gBAAqB;ACArB,IAAAA,gBAAkB;AAElB,6BAA8B;AAC9B,IAAAC,mBAAsC;ACHtC,IAAAD,gBAAyB;AACzB,IAAAA,gBAAqD;AAErD,2BAA6F;AAC7F,IAAAE,eAA0D;AAC1D,IAAAC,gBAAyB;AAEzB,IAAAF,mBAA0D;AAC1D,6BAAqB;AACrB,iCAA2B;AAE3B,IAAAG,yBAA4B;AAC5B,kBAA4B;ACZ5B,4BAAkD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MACX;MACAsF,SAAS;QACPC,WAAW,CAAC,EAAE7H,MAAM8H,KAAI,MAAE;AACxB,kBAAQ9H,KAAK6H,WAAS;YACpB,KAAK,GAAGvI,kCAAAA;AACN,qBAAOS,6BAA6BC,IAAAA,IAAQT,6BAAAA,QAAA,cAACY,kBAAqBH,KAAKC,OAAO,IAAO;UACzF;AAEA,gBAAM8H,UAAU/H,KAAKgI,UAAUhI,KAAKuH;AAGpC,gBAAMvF,KAAK,OAAOhC,KAAKgC,OAAO,WAAWhC,KAAKgC,KAAK4B;AACnD,kBAAQkE,MAAAA;YACN,KAAK;AACH,qBAAOC,mBAAmBE,8BACxB1I,6BAAAA,QAAA,cAAC2I,qBAAKpE,SAAO;gBAACqE,QAAAA;gBAAOhE,YAAY;kBAACiE;kBAAaC;kBAAyBC;;iBACtE/I,6BAAAA,QAAA,cAAC2G,WAAAA;gBACClE,IAAIA,UAAMuG,8BAAiBR,OAAAA;gBAC3B1H,YAAY0H;gBACZlI,YAAYV,SAAS8H,OAAOpH;oBAG9B;YACN,KAAK;AACH,qBAAOkI,mBAAmBE,8BACxB1I,6BAAAA,QAAA,cAACoG,OAAAA;gBAAImC,MAAK;gBAAO1C,WAAU;iBACzB7F,6BAAAA,QAAA,cAAC2G,WAAAA;gBACClE,IAAIA,UAAMuG,8BAAiBR,OAAAA;gBAC3B1H,YAAY0H;gBACZlI,YAAYV,SAAS8H,OAAOpH;oBAG9B;YACN,KAAK,YAAY;AACf,qBAAOG,KAAK6G,WAAWL,mCAAKxE,KAAKzC,6BAAAA,QAAA,cAACL,eAAAA;gBAAcC,UAAUA,SAAS8H;mBAAa;YAClF;YACA;AACE,qBAAO;UACX;QACF;MACF;MACA7E,OAAOmE;IACT;EACF;AACF;AKtGA,IAAA,cAAeF;",
|
|
6
|
+
"names": ["import_react", "import_react_ui", "import_echo", "import_types", "import_react_ui_theme", "StackSettings", "settings", "t", "useTranslation", "STACK_PLUGIN", "React", "SettingsValue", "label", "Input", "Switch", "checked", "separation", "onCheckedChange", "dataHasAddSectionDialogProps", "data", "subject", "position", "AddSectionDialog", "path", "collection", "stackPlugin", "usePlugin", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "fileRef", "useRef", "dispatch", "useIntent", "space", "getSpace", "pending", "setPending", "useState", "uploadError", "setUploadError", "handleAdd", "useCallback", "sectionObject", "index", "objects", "length", "filter", "nonNullable", "findIndex", "section", "id", "Path", "last", "splice", "stack", "views", "StackViewType", "typename", "sections", "action", "LayoutAction", "SET_LAYOUT", "element", "state", "handleFileUpload", "provides", "file", "upload", "filename", "name", "split", "info", "obj", "create", "FileType", "type", "cid", "err", "undefined", "Dialog", "Content", "Title", "SearchList", "Root", "placeholder", "classNames", "disabled", "inert", "creators", "map", "icon", "Icon", "propsLabel", "testId", "intent", "toLocalizedString", "Item", "value", "key", "onSelect", "nextSection", "data-testid", "className", "mx", "getSize", "span", "current", "click", "FilePlus", "div", "message", "input", "ref", "onChange", "target", "files", "StackMain", "lazy", "stackTranslations", "StackPlugin", "LocalStorageStore", "stackState", "meta", "ready", "plugins", "prop", "bool", "plugin", "Array", "isArray", "push", "values", "metadata", "records", "ns", "SECTION_IDENTIFIER", "parse", "object", "title", "translations", "echo", "schema", "surface", "component", "role", "primary", "active", "CollectionType", "Main", "bounce", "baseSurface", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "fullyQualifiedId"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.cjs
CHANGED
|
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var meta_exports = {};
|
|
20
20
|
__export(meta_exports, {
|
|
21
|
-
SECTION_IDENTIFIER: () =>
|
|
22
|
-
STACK_PLUGIN: () =>
|
|
23
|
-
default: () =>
|
|
21
|
+
SECTION_IDENTIFIER: () => import_chunk_O5SQVKNW.SECTION_IDENTIFIER,
|
|
22
|
+
STACK_PLUGIN: () => import_chunk_O5SQVKNW.STACK_PLUGIN,
|
|
23
|
+
default: () => import_chunk_O5SQVKNW.meta_default
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(meta_exports);
|
|
26
|
-
var
|
|
26
|
+
var import_chunk_O5SQVKNW = require("./chunk-O5SQVKNW.cjs");
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
|
29
29
|
SECTION_IDENTIFIER,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["meta.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n SECTION_IDENTIFIER,\n STACK_PLUGIN,\n meta_default\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n SECTION_IDENTIFIER,\n STACK_PLUGIN,\n meta_default\n} from \"./chunk-O5SQVKNW.cjs\";\nexport {\n SECTION_IDENTIFIER,\n STACK_PLUGIN,\n meta_default as default\n};\n//# sourceMappingURL=meta.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAIO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-stack/src/meta.tsx":{"bytes":2015,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytes":2578,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/types/stack.ts":{"bytes":3077,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/types/types.ts":{"bytes":2031,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/types/index.ts":{"bytes":581,"imports":[{"path":"packages/plugins/plugin-stack/src/types/stack.ts","kind":"import-statement","original":"./stack"},{"path":"packages/plugins/plugin-stack/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytes":18438,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytes":10461,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytes":26459,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/AddSection.tsx","kind":"import-statement","original":"./AddSection"},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/index.ts":{"bytes":1140,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx","kind":"import-statement","original":"./AddSectionDialog"},{"path":"packages/plugins/plugin-stack/src/components/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"packages/plugins/plugin-stack/src/translations.ts":{"bytes":2731,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytes":14740,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-stack/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-stack/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/index.ts":{"bytes":854,"imports":[{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-stack/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19831},"packages/plugins/plugin-stack/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-I42JKRXR.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-EMD6A66G.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/dist/lib/node/StackMain-XJGYFDDN.cjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SectionSchema","StackPlugin","StackViewType","default"],"entryPoint":"packages/plugins/plugin-stack/src/index.ts","inputs":{"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytesInOutput":3688},"packages/plugins/plugin-stack/src/components/index.ts":{"bytesInOutput":99},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytesInOutput":554},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytesInOutput":4643},"packages/plugins/plugin-stack/src/translations.ts":{"bytesInOutput":710},"packages/plugins/plugin-stack/src/index.ts":{"bytesInOutput":31}},"bytes":10474},"packages/plugins/plugin-stack/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-I42JKRXR.cjs","kind":"import-statement"}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-stack/src/meta.tsx","inputs":{},"bytes":203},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-EMD6A66G.cjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"packages/plugins/plugin-stack/src/types/index.ts","inputs":{},"bytes":154},"packages/plugins/plugin-stack/dist/lib/node/StackMain-XJGYFDDN.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19143},"packages/plugins/plugin-stack/dist/lib/node/StackMain-XJGYFDDN.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-I42JKRXR.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-EMD6A66G.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-stack/src/components/StackMain.tsx","inputs":{"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytesInOutput":6206},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytesInOutput":2546}},"bytes":9166},"packages/plugins/plugin-stack/dist/lib/node/chunk-I42JKRXR.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":962},"packages/plugins/plugin-stack/dist/lib/node/chunk-I42JKRXR.cjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-stack/src/meta.tsx":{"bytesInOutput":470}},"bytes":626},"packages/plugins/plugin-stack/dist/lib/node/chunk-EMD6A66G.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1475},"packages/plugins/plugin-stack/dist/lib/node/chunk-EMD6A66G.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"packages/plugins/plugin-stack/src/types/stack.ts":{"bytesInOutput":463},"packages/plugins/plugin-stack/src/types/index.ts":{"bytesInOutput":0}},"bytes":605}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytes":1525,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytes":2578,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/types/stack.ts":{"bytes":3287,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/types/types.ts":{"bytes":2031,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/types/index.ts":{"bytes":581,"imports":[{"path":"packages/plugins/plugin-stack/src/types/stack.ts","kind":"import-statement","original":"./stack"},{"path":"packages/plugins/plugin-stack/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytes":18312,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytes":10461,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytes":27006,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/AddSection.tsx","kind":"import-statement","original":"./AddSection"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/index.ts":{"bytes":981,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx","kind":"import-statement","original":"./AddSectionDialog"},{"path":"packages/plugins/plugin-stack/src/components/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"packages/plugins/plugin-stack/src/translations.ts":{"bytes":2731,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytes":15679,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-stack/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/index.ts":{"bytes":854,"imports":[{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-stack/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":20134},"packages/plugins/plugin-stack/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-O5SQVKNW.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-3D3FPZWK.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/dist/lib/node/StackMain-LAYSQV2S.cjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SectionSchema","StackPlugin","StackViewType","default"],"entryPoint":"packages/plugins/plugin-stack/src/index.ts","inputs":{"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytesInOutput":3735},"packages/plugins/plugin-stack/src/components/index.ts":{"bytesInOutput":94},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytesInOutput":554},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytesInOutput":4601},"packages/plugins/plugin-stack/src/translations.ts":{"bytesInOutput":710},"packages/plugins/plugin-stack/src/index.ts":{"bytesInOutput":31}},"bytes":10474},"packages/plugins/plugin-stack/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-O5SQVKNW.cjs","kind":"import-statement"}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-stack/src/meta.ts","inputs":{},"bytes":203},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-3D3FPZWK.cjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"packages/plugins/plugin-stack/src/types/index.ts","inputs":{},"bytes":154},"packages/plugins/plugin-stack/dist/lib/node/StackMain-LAYSQV2S.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19499},"packages/plugins/plugin-stack/dist/lib/node/StackMain-LAYSQV2S.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-O5SQVKNW.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-3D3FPZWK.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-stack/src/components/StackMain.tsx","inputs":{"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytesInOutput":6330},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytesInOutput":2546}},"bytes":9290},"packages/plugins/plugin-stack/dist/lib/node/chunk-O5SQVKNW.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":710},"packages/plugins/plugin-stack/dist/lib/node/chunk-O5SQVKNW.cjs":{"imports":[],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytesInOutput":299}},"bytes":454},"packages/plugins/plugin-stack/dist/lib/node/chunk-3D3FPZWK.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1569},"packages/plugins/plugin-stack/dist/lib/node/chunk-3D3FPZWK.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"packages/plugins/plugin-stack/src/types/stack.ts":{"bytesInOutput":515},"packages/plugins/plugin-stack/src/types/index.ts":{"bytesInOutput":0}},"bytes":657}}}
|
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
SectionSchema: () =>
|
|
22
|
-
StackViewType: () =>
|
|
21
|
+
SectionSchema: () => import_chunk_3D3FPZWK.SectionSchema,
|
|
22
|
+
StackViewType: () => import_chunk_3D3FPZWK.StackViewType
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(types_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_3D3FPZWK = require("../chunk-3D3FPZWK.cjs");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
SectionSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n SectionSchema,\n StackViewType\n} from \"../chunk-
|
|
4
|
+
"sourcesContent": ["import {\n SectionSchema,\n StackViewType\n} from \"../chunk-3D3FPZWK.cjs\";\nexport {\n SectionSchema,\n StackViewType\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SECTION_IDENTIFIER,
|
|
4
|
+
STACK_PLUGIN
|
|
5
|
+
} from "./chunk-J57BXQJY.mjs";
|
|
6
|
+
import {
|
|
7
|
+
StackViewType
|
|
8
|
+
} from "./chunk-HRY4R5UU.mjs";
|
|
9
|
+
|
|
10
|
+
// packages/plugins/plugin-stack/src/components/StackMain.tsx
|
|
11
|
+
import { Plus } from "@phosphor-icons/react";
|
|
12
|
+
import React2, { useEffect, useMemo, useState } from "react";
|
|
13
|
+
import { LayoutAction, NavigationAction, Surface, parseMetadataResolverPlugin, useIntentDispatcher as useIntentDispatcher2, useResolvePlugin } from "@dxos/app-framework";
|
|
14
|
+
import { create, getType, fullyQualifiedId, isReactiveObject } from "@dxos/client/echo";
|
|
15
|
+
import { useGraph } from "@dxos/plugin-graph";
|
|
16
|
+
import { SpaceAction } from "@dxos/plugin-space";
|
|
17
|
+
import { Button, toLocalizedString as toLocalizedString2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
18
|
+
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
19
|
+
import { Mosaic, Path } from "@dxos/react-ui-mosaic";
|
|
20
|
+
import { Stack } from "@dxos/react-ui-stack";
|
|
21
|
+
import { nonNullable } from "@dxos/util";
|
|
22
|
+
|
|
23
|
+
// packages/plugins/plugin-stack/src/components/AddSection.tsx
|
|
24
|
+
import { useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
25
|
+
import React, { useCallback } from "react";
|
|
26
|
+
import { usePlugin, useIntentDispatcher } from "@dxos/app-framework";
|
|
27
|
+
import { toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
28
|
+
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
29
|
+
var CreatorTile = ({ Icon, label, testId, handleAdd }) => {
|
|
30
|
+
const onClick = useCallback((_) => handleAdd(), [
|
|
31
|
+
handleAdd
|
|
32
|
+
]);
|
|
33
|
+
const onKeyDown = useCallback((event) => {
|
|
34
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
handleAdd();
|
|
37
|
+
}
|
|
38
|
+
}, [
|
|
39
|
+
handleAdd
|
|
40
|
+
]);
|
|
41
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
42
|
+
role: "button",
|
|
43
|
+
"aria-label": label,
|
|
44
|
+
tabIndex: 0,
|
|
45
|
+
className: mx("flex items-center w-[10rem] h-16 overflow-hidden", "border rounded-md border-separator shadow-sm hover:bg-hoverSurface cursor-pointer"),
|
|
46
|
+
onClick,
|
|
47
|
+
onKeyDown,
|
|
48
|
+
"data-testid": testId
|
|
49
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
50
|
+
className: "flex h-full w-12 items-center justify-center bg-scrim shrink-0 border-r border-separator"
|
|
51
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
52
|
+
weight: "thin",
|
|
53
|
+
className: getSize(6)
|
|
54
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
55
|
+
className: "overflow-hidden items-center p-2 px-3"
|
|
56
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
57
|
+
className: "capitalize"
|
|
58
|
+
}, label)));
|
|
59
|
+
};
|
|
60
|
+
var AddSection = ({ collection }) => {
|
|
61
|
+
const domAttributes = useArrowNavigationGroup({
|
|
62
|
+
axis: "grid"
|
|
63
|
+
});
|
|
64
|
+
const dispatch = useIntentDispatcher();
|
|
65
|
+
const { t } = useTranslation(STACK_PLUGIN);
|
|
66
|
+
const stackPlugin = usePlugin(STACK_PLUGIN);
|
|
67
|
+
const stackCreators = stackPlugin?.provides?.stack.creators ?? [];
|
|
68
|
+
const handleAdd = useCallback(async (creator) => {
|
|
69
|
+
const { data: section } = await dispatch(creator.intent) ?? {};
|
|
70
|
+
collection.objects = [
|
|
71
|
+
section
|
|
72
|
+
];
|
|
73
|
+
const stack = collection.views[StackViewType.typename];
|
|
74
|
+
if (stack) {
|
|
75
|
+
stack.sections[section.id] = {};
|
|
76
|
+
}
|
|
77
|
+
}, [
|
|
78
|
+
collection,
|
|
79
|
+
dispatch
|
|
80
|
+
]);
|
|
81
|
+
if (stackCreators.length === 0) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
85
|
+
...domAttributes,
|
|
86
|
+
role: "none",
|
|
87
|
+
className: "flex flex-wrap items-center p-8 gap-4"
|
|
88
|
+
}, stackCreators.map((creator) => {
|
|
89
|
+
const { id, type, icon, testId } = creator;
|
|
90
|
+
return /* @__PURE__ */ React.createElement(CreatorTile, {
|
|
91
|
+
key: id,
|
|
92
|
+
label: toLocalizedString(type, t),
|
|
93
|
+
testId,
|
|
94
|
+
Icon: icon,
|
|
95
|
+
handleAdd: () => handleAdd(creator)
|
|
96
|
+
});
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// packages/plugins/plugin-stack/src/components/StackMain.tsx
|
|
101
|
+
var SectionContent = ({ data }) => {
|
|
102
|
+
return /* @__PURE__ */ React2.createElement(Surface, {
|
|
103
|
+
role: "section",
|
|
104
|
+
data: {
|
|
105
|
+
object: data
|
|
106
|
+
},
|
|
107
|
+
limit: 1,
|
|
108
|
+
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
var StackMain = ({ id, collection, separation }) => {
|
|
112
|
+
const dispatch = useIntentDispatcher2();
|
|
113
|
+
const { graph } = useGraph();
|
|
114
|
+
const { t } = useTranslation2(STACK_PLUGIN);
|
|
115
|
+
const metadataPlugin = useResolvePlugin(parseMetadataResolverPlugin);
|
|
116
|
+
const defaultStack = useMemo(() => create(StackViewType, {
|
|
117
|
+
sections: {}
|
|
118
|
+
}), [
|
|
119
|
+
collection
|
|
120
|
+
]);
|
|
121
|
+
const stack = collection.views[StackViewType.typename] ?? defaultStack;
|
|
122
|
+
const [collapsedSections, setCollapsedSections] = useState({});
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (!collection.views[StackViewType.typename]) {
|
|
125
|
+
collection.views[StackViewType.typename] = stack;
|
|
126
|
+
}
|
|
127
|
+
}, [
|
|
128
|
+
collection,
|
|
129
|
+
stack
|
|
130
|
+
]);
|
|
131
|
+
const items = collection.objects.filter(nonNullable).map((object) => {
|
|
132
|
+
const metadata = metadataPlugin?.provides.metadata.resolver(getType(object)?.objectId ?? "never");
|
|
133
|
+
const view = {
|
|
134
|
+
...stack.sections[object.id],
|
|
135
|
+
collapsed: collapsedSections[fullyQualifiedId(object)],
|
|
136
|
+
title: object?.title ?? toLocalizedString2(graph.findNode(fullyQualifiedId(object))?.properties.label, t)
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
id: fullyQualifiedId(object),
|
|
140
|
+
object,
|
|
141
|
+
metadata,
|
|
142
|
+
view
|
|
143
|
+
};
|
|
144
|
+
}) ?? [];
|
|
145
|
+
const handleOver = ({ active, over }) => {
|
|
146
|
+
if (active.type !== SECTION_IDENTIFIER) {
|
|
147
|
+
return "reject";
|
|
148
|
+
}
|
|
149
|
+
if (Path.parent(active.path) === Path.parent(over.path)) {
|
|
150
|
+
return "rearrange";
|
|
151
|
+
}
|
|
152
|
+
const parseData = metadataPlugin?.provides.metadata.resolver(active.type)?.parse;
|
|
153
|
+
const data = parseData ? parseData(active.item, "object") : active.item;
|
|
154
|
+
if (!isReactiveObject(data)) {
|
|
155
|
+
return "reject";
|
|
156
|
+
}
|
|
157
|
+
const exists = items.findIndex(({ id: id2 }) => id2 === active.item.id) >= 0;
|
|
158
|
+
if (!exists) {
|
|
159
|
+
return "transfer";
|
|
160
|
+
} else {
|
|
161
|
+
return "reject";
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const handleDrop = ({ operation, active, over }) => {
|
|
165
|
+
if ((active.path === Path.create(id, active.item.id) || active.path === id) && (operation !== "copy" || over.path === Path.create(id, over.item.id) || over.path === id)) {
|
|
166
|
+
collection.objects.splice(active.position, 1);
|
|
167
|
+
delete stack.sections[active.item.id];
|
|
168
|
+
}
|
|
169
|
+
const parseData = metadataPlugin?.provides.metadata.resolver(active.type)?.parse;
|
|
170
|
+
const object = parseData?.(active.item, "object");
|
|
171
|
+
if (object && over.path === Path.create(id, over.item.id)) {
|
|
172
|
+
collection.objects.splice(over.position, 0, object);
|
|
173
|
+
} else if (object && over.path === id) {
|
|
174
|
+
collection.objects.push(object);
|
|
175
|
+
}
|
|
176
|
+
if (!stack.sections[object.id]) {
|
|
177
|
+
stack.sections[object.id] = {};
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
const handleDelete = async (path) => {
|
|
181
|
+
const index = collection.objects.filter(nonNullable).findIndex((section) => fullyQualifiedId(section) === Path.last(path));
|
|
182
|
+
if (index >= 0) {
|
|
183
|
+
await dispatch({
|
|
184
|
+
action: SpaceAction.REMOVE_OBJECT,
|
|
185
|
+
data: {
|
|
186
|
+
object: collection.objects[index],
|
|
187
|
+
collection
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const handleNavigate = async (object) => {
|
|
193
|
+
const toId = fullyQualifiedId(object);
|
|
194
|
+
await dispatch([
|
|
195
|
+
{
|
|
196
|
+
action: NavigationAction.OPEN,
|
|
197
|
+
data: {
|
|
198
|
+
activeParts: {
|
|
199
|
+
main: [
|
|
200
|
+
toId
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
action: LayoutAction.SCROLL_INTO_VIEW,
|
|
207
|
+
data: {
|
|
208
|
+
id: toId
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
]);
|
|
212
|
+
};
|
|
213
|
+
const handleAddSection = (path, position) => {
|
|
214
|
+
void dispatch?.({
|
|
215
|
+
action: LayoutAction.SET_LAYOUT,
|
|
216
|
+
data: {
|
|
217
|
+
element: "dialog",
|
|
218
|
+
component: `${STACK_PLUGIN}/AddSectionDialog`,
|
|
219
|
+
subject: {
|
|
220
|
+
path,
|
|
221
|
+
position,
|
|
222
|
+
collection
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
const handleCollapseSection = (id2, collapsed) => {
|
|
228
|
+
setCollapsedSections((prev) => ({
|
|
229
|
+
...prev,
|
|
230
|
+
[id2]: collapsed
|
|
231
|
+
}));
|
|
232
|
+
};
|
|
233
|
+
return /* @__PURE__ */ React2.createElement(AttentionProvider, {
|
|
234
|
+
id
|
|
235
|
+
}, /* @__PURE__ */ React2.createElement(Mosaic.Root, null, /* @__PURE__ */ React2.createElement(Mosaic.DragOverlay, null), /* @__PURE__ */ React2.createElement(Stack, {
|
|
236
|
+
id,
|
|
237
|
+
"data-testid": "main.stack",
|
|
238
|
+
SectionContent,
|
|
239
|
+
type: SECTION_IDENTIFIER,
|
|
240
|
+
items,
|
|
241
|
+
separation,
|
|
242
|
+
emptyComponent: /* @__PURE__ */ React2.createElement("span", {
|
|
243
|
+
"data-testid": "stack.empty"
|
|
244
|
+
}),
|
|
245
|
+
onDrop: handleDrop,
|
|
246
|
+
onOver: handleOver,
|
|
247
|
+
onDeleteSection: handleDelete,
|
|
248
|
+
onNavigateToSection: handleNavigate,
|
|
249
|
+
onAddSection: handleAddSection,
|
|
250
|
+
onCollapseSection: handleCollapseSection
|
|
251
|
+
}), items.length === 0 ? /* @__PURE__ */ React2.createElement(AddSection, {
|
|
252
|
+
collection
|
|
253
|
+
}) : /* @__PURE__ */ React2.createElement("div", {
|
|
254
|
+
role: "none",
|
|
255
|
+
className: "flex mlb-2 pli-2 justify-center"
|
|
256
|
+
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
257
|
+
"data-testid": "stack.createSection",
|
|
258
|
+
classNames: "gap-2",
|
|
259
|
+
onClick: () => dispatch?.({
|
|
260
|
+
action: LayoutAction.SET_LAYOUT,
|
|
261
|
+
data: {
|
|
262
|
+
element: "dialog",
|
|
263
|
+
component: "dxos.org/plugin/stack/AddSectionDialog",
|
|
264
|
+
subject: {
|
|
265
|
+
position: "afterAll",
|
|
266
|
+
collection
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
}, /* @__PURE__ */ React2.createElement(Plus, null), /* @__PURE__ */ React2.createElement("span", {
|
|
271
|
+
className: "sr-only"
|
|
272
|
+
}, t("add section label"))))));
|
|
273
|
+
};
|
|
274
|
+
var StackMain_default = StackMain;
|
|
275
|
+
export {
|
|
276
|
+
StackMain_default as default
|
|
277
|
+
};
|
|
278
|
+
//# sourceMappingURL=StackMain-KH6IEQQ6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/StackMain.tsx", "../../../src/components/AddSection.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plus } from '@phosphor-icons/react';\nimport React, { useEffect, useMemo, useState } from 'react';\n\nimport {\n LayoutAction,\n NavigationAction,\n Surface,\n parseMetadataResolverPlugin,\n useIntentDispatcher,\n useResolvePlugin,\n} from '@dxos/app-framework';\nimport { create, getType, fullyQualifiedId, isReactiveObject } from '@dxos/client/echo';\nimport { useGraph } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { Button, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { type MosaicDataItem, type MosaicDropEvent, type MosaicMoveEvent, Mosaic, Path } from '@dxos/react-ui-mosaic';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n Stack,\n type StackProps,\n type StackSectionItem,\n} from '@dxos/react-ui-stack';\nimport { nonNullable } from '@dxos/util';\n\nimport { AddSection } from './AddSection';\nimport { SECTION_IDENTIFIER, STACK_PLUGIN } from '../meta';\nimport { StackViewType } from '../types';\n\nconst SectionContent: StackProps['SectionContent'] = ({ data }) => {\n // TODO(wittjosiah): Better section placeholder.\n return <Surface role='section' data={{ object: data }} limit={1} placeholder={<></>} />;\n};\n\ntype StackMainProps = {\n id: string;\n collection: CollectionType;\n separation?: boolean;\n};\n\nconst StackMain = ({ id, collection, separation }: StackMainProps) => {\n const dispatch = useIntentDispatcher();\n const { graph } = useGraph();\n const { t } = useTranslation(STACK_PLUGIN);\n const metadataPlugin = useResolvePlugin(parseMetadataResolverPlugin);\n const defaultStack = useMemo(() => create(StackViewType, { sections: {} }), [collection]);\n const stack = (collection.views[StackViewType.typename] as StackViewType) ?? defaultStack;\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n useEffect(() => {\n if (!collection.views[StackViewType.typename]) {\n collection.views[StackViewType.typename] = stack;\n }\n }, [collection, stack]);\n\n const items =\n collection.objects\n // TODO(wittjosiah): Should the database handle this differently?\n // TODO(wittjosiah): Render placeholders for missing objects so they can be removed from the stack?\n .filter(nonNullable)\n .map((object) => {\n const metadata = metadataPlugin?.provides.metadata.resolver(\n getType(object)?.objectId ?? 'never',\n ) as StackSectionItem['metadata'];\n const view = {\n ...stack.sections[object.id],\n collapsed: collapsedSections[fullyQualifiedId(object)],\n title:\n (object as any)?.title ?? toLocalizedString(graph.findNode(fullyQualifiedId(object))?.properties.label, t),\n } as StackSectionItem['view'];\n return { id: fullyQualifiedId(object), object, metadata, view };\n }) ?? [];\n\n const handleOver = ({ active, over }: MosaicMoveEvent<number>) => {\n // TODO(thure): Eventually Stack should handle foreign draggables.\n if (active.type !== SECTION_IDENTIFIER) {\n return 'reject';\n }\n if (Path.parent(active.path) === Path.parent(over.path)) {\n return 'rearrange';\n }\n\n const parseData = metadataPlugin?.provides.metadata.resolver(active.type)?.parse;\n const data = parseData ? parseData(active.item, 'object') : active.item;\n\n // TODO(wittjosiah): Prevent dropping items which don't have a section renderer?\n // Perhaps stack plugin should just provide a fallback section renderer.\n if (!isReactiveObject(data)) {\n return 'reject';\n }\n\n const exists = items.findIndex(({ id }) => id === active.item.id) >= 0;\n if (!exists) {\n return 'transfer';\n } else {\n return 'reject';\n }\n };\n\n const handleDrop = ({ operation, active, over }: MosaicDropEvent<number>) => {\n if (\n (active.path === Path.create(id, active.item.id) || active.path === id) &&\n (operation !== 'copy' || over.path === Path.create(id, over.item.id) || over.path === id)\n ) {\n collection.objects.splice(active.position!, 1);\n delete stack.sections[active.item.id];\n }\n\n const parseData = metadataPlugin?.provides.metadata.resolver(active.type)?.parse;\n const object = parseData?.(active.item, 'object');\n if (object && over.path === Path.create(id, over.item.id)) {\n collection.objects.splice(over.position!, 0, object);\n } else if (object && over.path === id) {\n collection.objects.push(object);\n }\n\n if (!stack.sections[object.id]) {\n stack.sections[object.id] = {};\n }\n };\n\n const handleDelete = async (path: string) => {\n const index = collection.objects\n .filter(nonNullable)\n .findIndex((section) => fullyQualifiedId(section) === Path.last(path));\n if (index >= 0) {\n await dispatch({\n action: SpaceAction.REMOVE_OBJECT,\n data: { object: collection.objects[index], collection },\n });\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n };\n\n // TODO(wittjosiah): Factor out.\n\n const handleNavigate = async (object: MosaicDataItem) => {\n const toId = fullyQualifiedId(object);\n await dispatch([\n {\n action: NavigationAction.OPEN,\n data: { activeParts: { main: [toId] } },\n },\n {\n action: LayoutAction.SCROLL_INTO_VIEW,\n data: { id: toId },\n },\n ]);\n };\n\n const handleAddSection = (path: string, position: AddSectionPosition) => {\n void dispatch?.({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: `${STACK_PLUGIN}/AddSectionDialog`,\n subject: { path, position, collection },\n },\n });\n };\n\n const handleCollapseSection = (id: string, collapsed: boolean) => {\n setCollapsedSections((prev) => ({ ...prev, [id]: collapsed }));\n };\n\n return (\n <AttentionProvider id={id}>\n <Mosaic.Root>\n <Mosaic.DragOverlay />\n <Stack\n id={id}\n data-testid='main.stack'\n SectionContent={SectionContent}\n type={SECTION_IDENTIFIER}\n items={items}\n separation={separation}\n emptyComponent={<span data-testid='stack.empty'></span>}\n onDrop={handleDrop}\n onOver={handleOver}\n onDeleteSection={handleDelete}\n onNavigateToSection={handleNavigate}\n onAddSection={handleAddSection}\n onCollapseSection={handleCollapseSection}\n />\n\n {items.length === 0 ? (\n <AddSection collection={collection} />\n ) : (\n <div role='none' className='flex mlb-2 pli-2 justify-center'>\n <Button\n data-testid='stack.createSection'\n classNames='gap-2'\n onClick={() =>\n dispatch?.({\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'dialog',\n component: 'dxos.org/plugin/stack/AddSectionDialog',\n subject: { position: 'afterAll', collection },\n },\n })\n }\n >\n <Plus />\n <span className='sr-only'>{t('add section label')}</span>\n </Button>\n </div>\n )}\n </Mosaic.Root>\n </AttentionProvider>\n );\n};\n\nexport default StackMain;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { type IconProps } from '@phosphor-icons/react';\nimport React, { type FC, type KeyboardEvent, type MouseEvent, useCallback } from 'react';\n\nimport { usePlugin, useIntentDispatcher } from '@dxos/app-framework';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { StackViewType, type StackSectionCreator, type StackPluginProvides } from '../types';\n\nconst CreatorTile = ({\n Icon,\n label,\n testId,\n handleAdd,\n}: {\n Icon: FC<IconProps>;\n testId: string;\n label: string;\n handleAdd: () => void;\n}) => {\n const onClick = useCallback((_: MouseEvent<HTMLDivElement>) => handleAdd(), [handleAdd]);\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleAdd();\n }\n },\n [handleAdd],\n );\n\n return (\n <div\n role='button'\n aria-label={label}\n tabIndex={0}\n className={mx(\n 'flex items-center w-[10rem] h-16 overflow-hidden',\n 'border rounded-md border-separator shadow-sm hover:bg-hoverSurface cursor-pointer',\n )}\n onClick={onClick}\n onKeyDown={onKeyDown}\n data-testid={testId}\n >\n <div className='flex h-full w-12 items-center justify-center bg-scrim shrink-0 border-r border-separator'>\n <Icon weight='thin' className={getSize(6)} />\n </div>\n <div className='overflow-hidden items-center p-2 px-3'>\n <span className='capitalize'>{label}</span>\n </div>\n </div>\n );\n};\n\nexport const AddSection = ({ collection }: { collection: CollectionType }) => {\n const domAttributes = useArrowNavigationGroup({ axis: 'grid' });\n const dispatch = useIntentDispatcher();\n const { t } = useTranslation(STACK_PLUGIN);\n\n const stackPlugin = usePlugin<StackPluginProvides>(STACK_PLUGIN);\n const stackCreators = stackPlugin?.provides?.stack.creators ?? [];\n\n const handleAdd = useCallback(\n async (creator: StackSectionCreator) => {\n const { data: section } = (await dispatch(creator.intent)) ?? {};\n collection.objects = [section];\n const stack = collection.views[StackViewType.typename];\n if (stack) {\n stack.sections[section.id] = {};\n }\n },\n [collection, dispatch],\n );\n\n if (stackCreators.length === 0) {\n return null;\n }\n\n return (\n <div {...domAttributes} role='none' className='flex flex-wrap items-center p-8 gap-4'>\n {stackCreators.map((creator) => {\n const { id, type, icon, testId } = creator;\n return (\n <CreatorTile\n key={id}\n label={toLocalizedString(type, t)}\n testId={testId}\n Icon={icon}\n handleAdd={() => handleAdd(creator)}\n />\n );\n })}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,SAASA,YAAY;AACrB,OAAOC,UAASC,WAAWC,SAASC,gBAAgB;AAEpD,SACEC,cACAC,kBACAC,SACAC,6BACAC,uBAAAA,sBACAC,wBACK;AACP,SAASC,QAAQC,SAASC,kBAAkBC,wBAAwB;AACpE,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAE5B,SAASC,QAAQC,qBAAAA,oBAAmBC,kBAAAA,uBAAsB;AAC1D,SAASC,yBAAyB;AAClC,SAA0EC,QAAQC,YAAY;AAC9F,SAGEC,aAGK;AACP,SAASC,mBAAmB;;;ACzB5B,SAASC,+BAA+B;AAExC,OAAOC,SAAuDC,mBAAmB;AAEjF,SAASC,WAAWC,2BAA2B;AAE/C,SAASC,mBAAmBC,sBAAsB;AAClD,SAASC,SAASC,UAAU;AAK5B,IAAMC,cAAc,CAAC,EACnBC,MACAC,OACAC,QACAC,UAAS,MAMV;AACC,QAAMC,UAAUC,YAAY,CAACC,MAAkCH,UAAAA,GAAa;IAACA;GAAU;AACvF,QAAMI,YAAYF,YAChB,CAACG,UAAAA;AACC,QAAIA,MAAMC,QAAQ,WAAWD,MAAMC,QAAQ,KAAK;AAC9CD,YAAME,eAAc;AACpBP,gBAAAA;IACF;EACF,GACA;IAACA;GAAU;AAGb,SACE,sBAAA,cAACQ,OAAAA;IACCC,MAAK;IACLC,cAAYZ;IACZa,UAAU;IACVC,WAAWC,GACT,oDACA,mFAAA;IAEFZ;IACAG;IACAU,eAAaf;KAEb,sBAAA,cAACS,OAAAA;I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AAP,OAAA,cAAC4F,OAAOC,MAAI,MACV,gBAAA7F,OAAA,cAAC4F,OAAOE,aAAW,IAAA,GACnB,gBAAA9F,OAAA,cAAC+F,OAAAA;IACCxF;IACAyF,eAAY;IACZlG;IACAuD,MAAMC;IACNtB;IACAvB;IACAwF,gBAAgB,gBAAAjG,OAAA,cAACkG,QAAAA;MAAKF,eAAY;;IAClCG,QAAQnC;IACRoC,QAAQlD;IACRmD,iBAAiBhC;IACjBiC,qBAAqB1B;IACrB2B,cAAcnB;IACdoB,mBAAmBf;MAGpBzD,MAAMyE,WAAW,IAChB,gBAAAzG,OAAA,cAAC0G,YAAAA;IAAWlG;OAEZ,gBAAAR,OAAA,cAAC2G,OAAAA;IAAIzG,MAAK;IAAO0G,WAAU;KACzB,gBAAA5G,OAAA,cAAC6G,QAAAA;IACCb,eAAY;IACZc,YAAW;IACXC,SAAS,MACPrG,WAAW;MACT+D,QAAQS,aAAaG;MACrBtF,MAAM;QACJuF,SAAS;QACTC,WAAW;QACXC,SAAS;UAAErB,UAAU;UAAY3D;QAAW;MAC9C;IACF,CAAA;KAGF,gBAAAR,OAAA,cAACgH,MAAAA,IAAAA,GACD,gBAAAhH,OAAA,cAACkG,QAAAA;IAAKU,WAAU;KAAW9F,EAAE,mBAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAO3C;AAEA,IAAA,oBAAeR;",
|
|
6
|
+
"names": ["Plus", "React", "useEffect", "useMemo", "useState", "LayoutAction", "NavigationAction", "Surface", "parseMetadataResolverPlugin", "useIntentDispatcher", "useResolvePlugin", "create", "getType", "fullyQualifiedId", "isReactiveObject", "useGraph", "SpaceAction", "Button", "toLocalizedString", "useTranslation", "AttentionProvider", "Mosaic", "Path", "Stack", "nonNullable", "useArrowNavigationGroup", "React", "useCallback", "usePlugin", "useIntentDispatcher", "toLocalizedString", "useTranslation", "getSize", "mx", "CreatorTile", "Icon", "label", "testId", "handleAdd", "onClick", "useCallback", "_", "onKeyDown", "event", "key", "preventDefault", "div", "role", "aria-label", "tabIndex", "className", "mx", "data-testid", "weight", "getSize", "span", "AddSection", "collection", "domAttributes", "useArrowNavigationGroup", "axis", "dispatch", "useIntentDispatcher", "t", "useTranslation", "STACK_PLUGIN", "stackPlugin", "usePlugin", "stackCreators", "provides", "stack", "creators", "creator", "data", "section", "intent", "objects", "views", "StackViewType", "typename", "sections", "id", "length", "map", "type", "icon", "toLocalizedString", "SectionContent", "data", "React", "Surface", "role", "object", "limit", "placeholder", "StackMain", "id", "collection", "separation", "dispatch", "useIntentDispatcher", "graph", "useGraph", "t", "useTranslation", "STACK_PLUGIN", "metadataPlugin", "useResolvePlugin", "parseMetadataResolverPlugin", "defaultStack", "useMemo", "create", "StackViewType", "sections", "stack", "views", "typename", "collapsedSections", "setCollapsedSections", "useState", "useEffect", "items", "objects", "filter", "nonNullable", "map", "metadata", "provides", "resolver", "getType", "objectId", "view", "collapsed", "fullyQualifiedId", "title", "toLocalizedString", "findNode", "properties", "label", "handleOver", "active", "over", "type", "SECTION_IDENTIFIER", "Path", "parent", "path", "parseData", "parse", "item", "isReactiveObject", "exists", "findIndex", "handleDrop", "operation", "splice", "position", "push", "handleDelete", "index", "section", "last", "action", "SpaceAction", "REMOVE_OBJECT", "handleNavigate", "toId", "NavigationAction", "OPEN", "activeParts", "main", "LayoutAction", "SCROLL_INTO_VIEW", "handleAddSection", "SET_LAYOUT", "element", "component", "subject", "handleCollapseSection", "prev", "AttentionProvider", "Mosaic", "Root", "DragOverlay", "Stack", "data-testid", "emptyComponent", "span", "onDrop", "onOver", "onDeleteSection", "onNavigateToSection", "onAddSection", "onCollapseSection", "length", "AddSection", "div", "className", "Button", "classNames", "onClick", "Plus"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/plugins/plugin-stack/src/types/stack.ts
|
|
4
|
+
import { S, TypedObject } from "@dxos/echo-schema";
|
|
5
|
+
var SectionSchema = S.Struct({
|
|
6
|
+
height: S.optional(S.Number),
|
|
7
|
+
// Space for data that isn't stack-specific but is specific to this view instance.
|
|
8
|
+
// e.g. cover/fill for an image
|
|
9
|
+
custom: S.optional(S.Record({
|
|
10
|
+
key: S.String,
|
|
11
|
+
value: S.Any
|
|
12
|
+
}))
|
|
13
|
+
});
|
|
14
|
+
var StackViewType = class extends TypedObject({
|
|
15
|
+
typename: "dxos.org/type/StackView",
|
|
16
|
+
version: "0.1.0"
|
|
17
|
+
})({
|
|
18
|
+
sections: S.mutable(S.Record({
|
|
19
|
+
key: S.String,
|
|
20
|
+
value: SectionSchema
|
|
21
|
+
}))
|
|
22
|
+
}) {
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
SectionSchema,
|
|
27
|
+
StackViewType
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-HRY4R5UU.mjs.map
|