@dxos/plugin-stack 0.8.4-staging.60fe92afc8 → 0.9.1-main.c7dcc2e112
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/neutral/{StackArticle-R7IS6TYR.mjs → StackArticle-SBM3FBJM.mjs} +3 -3
- package/dist/lib/neutral/StackArticle-SBM3FBJM.mjs.map +7 -0
- package/dist/lib/neutral/StackPlugin.mjs +2 -2
- package/dist/lib/neutral/StackPlugin.mjs.map +4 -4
- package/dist/lib/neutral/chunk-CTWUHXK5.mjs +46 -0
- package/dist/lib/neutral/chunk-CTWUHXK5.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +5 -4
- package/dist/lib/neutral/components/index.mjs.map +3 -3
- package/dist/lib/neutral/containers/index.mjs +1 -1
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +1 -1
- package/dist/lib/neutral/translations.mjs +1 -1
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +28 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +34 -0
- package/package.json +22 -21
- package/src/StackPlugin.ts +1 -1
- package/src/components/StackSection/StackSection.tsx +3 -2
- package/src/components/StackSettings/StackSettings.tsx +2 -2
- package/src/containers/StackArticle/StackArticle.tsx +2 -2
- package/src/meta.ts +3 -26
- package/src/translations.ts +1 -1
- package/dist/lib/neutral/StackArticle-R7IS6TYR.mjs.map +0 -7
- package/dist/lib/neutral/chunk-RGJSGQGF.mjs +0 -36
- package/dist/lib/neutral/chunk-RGJSGQGF.mjs.map +0 -7
package/dx.config.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Config2 } from '@dxos/app-framework/config';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
export default Config2.make({
|
|
9
|
+
plugin: {
|
|
10
|
+
key: 'org.dxos.plugin.stack',
|
|
11
|
+
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
12
|
+
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
13
|
+
name: 'Collections',
|
|
14
|
+
author: 'DXOS',
|
|
15
|
+
description: trim`
|
|
16
|
+
StackPlugin renders any Collection object as a vertically scrollable stack of collapsible sections in the
|
|
17
|
+
Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering
|
|
18
|
+
to the section surface role, enabling any other plugin to contribute its own section renderer.
|
|
19
|
+
|
|
20
|
+
Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated
|
|
21
|
+
to directly, or removed from the collection. New sections can be inserted before or after any existing
|
|
22
|
+
section via a per-section dropdown menu, or appended via the toolbar Add button.
|
|
23
|
+
|
|
24
|
+
The plugin registers StackViewType with the ECHO schema module so that per-section view metadata
|
|
25
|
+
(height overrides, custom display data) can be stored and replicated alongside the collection.
|
|
26
|
+
|
|
27
|
+
A settings panel exposes a separation toggle that controls whether visual dividers are rendered between
|
|
28
|
+
sections.
|
|
29
|
+
`,
|
|
30
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',
|
|
31
|
+
icon: { key: 'ph--stack-simple--regular' },
|
|
32
|
+
spec: 'PLUGIN.mdl',
|
|
33
|
+
},
|
|
34
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-main.c7dcc2e112",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"types": "dist/types/src/index.d.ts",
|
|
71
71
|
"files": [
|
|
72
72
|
"dist",
|
|
73
|
+
"dx.config.ts",
|
|
73
74
|
"src",
|
|
74
75
|
"PLUGIN.mdl"
|
|
75
76
|
],
|
|
@@ -77,20 +78,20 @@
|
|
|
77
78
|
"@effect-atom/atom-react": "^0.5.0",
|
|
78
79
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
79
80
|
"effect": "3.21.3",
|
|
80
|
-
"@dxos/app-framework": "0.
|
|
81
|
-
"@dxos/app-toolkit": "0.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/plugin-
|
|
86
|
-
"@dxos/plugin-deck": "0.
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/react-ui-
|
|
92
|
-
"@dxos/
|
|
93
|
-
"@dxos/
|
|
81
|
+
"@dxos/app-framework": "0.9.1-main.c7dcc2e112",
|
|
82
|
+
"@dxos/app-toolkit": "0.9.1-main.c7dcc2e112",
|
|
83
|
+
"@dxos/invariant": "0.9.1-main.c7dcc2e112",
|
|
84
|
+
"@dxos/operation": "0.9.1-main.c7dcc2e112",
|
|
85
|
+
"@dxos/keys": "0.9.1-main.c7dcc2e112",
|
|
86
|
+
"@dxos/plugin-graph": "0.9.1-main.c7dcc2e112",
|
|
87
|
+
"@dxos/plugin-deck": "0.9.1-main.c7dcc2e112",
|
|
88
|
+
"@dxos/echo": "0.9.1-main.c7dcc2e112",
|
|
89
|
+
"@dxos/react-ui-attention": "0.9.1-main.c7dcc2e112",
|
|
90
|
+
"@dxos/plugin-space": "0.9.1-main.c7dcc2e112",
|
|
91
|
+
"@dxos/react-ui-stack": "0.9.1-main.c7dcc2e112",
|
|
92
|
+
"@dxos/react-ui-form": "0.9.1-main.c7dcc2e112",
|
|
93
|
+
"@dxos/plugin-client": "0.9.1-main.c7dcc2e112",
|
|
94
|
+
"@dxos/util": "0.9.1-main.c7dcc2e112"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
97
|
"@babel/core": "^7.18.13",
|
|
@@ -99,18 +100,18 @@
|
|
|
99
100
|
"react": "~19.2.3",
|
|
100
101
|
"react-dom": "~19.2.3",
|
|
101
102
|
"vite": "^8.0.16",
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/
|
|
103
|
+
"@dxos/storybook-utils": "0.9.1-main.c7dcc2e112",
|
|
104
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112",
|
|
105
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112",
|
|
106
|
+
"@dxos/plugin-testing": "0.9.1-main.c7dcc2e112"
|
|
106
107
|
},
|
|
107
108
|
"peerDependencies": {
|
|
108
109
|
"@effect-atom/atom-react": "^0.5.0",
|
|
109
110
|
"effect": "3.21.3",
|
|
110
111
|
"react": "~19.2.3",
|
|
111
112
|
"react-dom": "~19.2.3",
|
|
112
|
-
"@dxos/react-ui": "0.
|
|
113
|
-
"@dxos/ui-theme": "0.
|
|
113
|
+
"@dxos/react-ui": "0.9.1-main.c7dcc2e112",
|
|
114
|
+
"@dxos/ui-theme": "0.9.1-main.c7dcc2e112"
|
|
114
115
|
},
|
|
115
116
|
"publishConfig": {
|
|
116
117
|
"access": "public"
|
package/src/StackPlugin.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const StackPlugin = Plugin.define(meta).pipe(
|
|
|
18
18
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
19
19
|
AppPlugin.addTranslationsModule({ translations }),
|
|
20
20
|
AppPlugin.addPluginAssetModule({
|
|
21
|
-
asset: { pluginId: meta.
|
|
21
|
+
asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
22
22
|
}),
|
|
23
23
|
Plugin.make,
|
|
24
24
|
);
|
|
@@ -6,6 +6,7 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
+
import { Paths } from '@dxos/app-toolkit';
|
|
9
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
import { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';
|
|
11
12
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
@@ -28,10 +29,10 @@ export const StackSection = ({
|
|
|
28
29
|
object,
|
|
29
30
|
metadata: { icon = 'ph--circle-dashed--regular' },
|
|
30
31
|
}: StackSectionProps) => {
|
|
31
|
-
const { t } = useTranslation(meta.
|
|
32
|
+
const { t } = useTranslation(meta.profile.key);
|
|
32
33
|
const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
33
34
|
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
34
|
-
const attendableId =
|
|
35
|
+
const attendableId = Paths.getCollectionObjectPath(parentAttendableId, object.id);
|
|
35
36
|
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
36
37
|
const stackItem = useMemo(() => ({ id }), [id]);
|
|
37
38
|
const data = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);
|
|
@@ -11,11 +11,11 @@ import { meta } from '#meta';
|
|
|
11
11
|
import { type StackSettingsProps } from '#types';
|
|
12
12
|
|
|
13
13
|
export const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {
|
|
14
|
-
const { t } = useTranslation(meta.
|
|
14
|
+
const { t } = useTranslation(meta.profile.key);
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<SettingsForm.Viewport>
|
|
18
|
-
<SettingsForm.Section title={t('settings.title', { ns: meta.
|
|
18
|
+
<SettingsForm.Section title={t('settings.title', { ns: meta.profile.key })}>
|
|
19
19
|
<SettingsForm.Item title={t('settings.separation.label')} description={t('settings.separation.description')}>
|
|
20
20
|
<Input.Switch
|
|
21
21
|
checked={settings.separation}
|
|
@@ -43,7 +43,7 @@ type StackArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;
|
|
|
43
43
|
export const StackArticle = ({ attendableId, subject: collection }: StackArticleProps) => {
|
|
44
44
|
const { invokePromise } = useOperationInvoker();
|
|
45
45
|
const { graph } = useAppGraph();
|
|
46
|
-
const { t } = useTranslation(meta.
|
|
46
|
+
const { t } = useTranslation(meta.profile.key);
|
|
47
47
|
const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});
|
|
48
48
|
|
|
49
49
|
// TODO(wittjosiah): Re-implement stack views with relations.
|
|
@@ -94,7 +94,7 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
94
94
|
async (id: string, position: AddSectionPosition) => {
|
|
95
95
|
// TODO(wittjosiah): Use object creation dialog.
|
|
96
96
|
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
97
|
-
subject: `${meta.
|
|
97
|
+
subject: `${meta.profile.key}.AddSectionDialog`,
|
|
98
98
|
blockAlign: 'start',
|
|
99
99
|
props: {
|
|
100
100
|
path: id,
|
package/src/meta.ts
CHANGED
|
@@ -4,32 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { DXN } from '@dxos/keys';
|
|
7
|
-
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const meta = Plugin.makeMeta({
|
|
12
|
-
key: DXN.make('org.dxos.plugin.stack'),
|
|
13
|
-
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
14
|
-
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
15
|
-
name: 'Collections',
|
|
16
|
-
author: 'DXOS',
|
|
17
|
-
spec: 'PLUGIN.mdl',
|
|
18
|
-
description: trim`
|
|
19
|
-
StackPlugin renders any Collection object as a vertically scrollable stack of collapsible sections in the
|
|
20
|
-
Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering
|
|
21
|
-
to the section surface role, enabling any other plugin to contribute its own section renderer.
|
|
8
|
+
import config from '../dx.config';
|
|
22
9
|
|
|
23
|
-
|
|
24
|
-
to directly, or removed from the collection. New sections can be inserted before or after any existing
|
|
25
|
-
section via a per-section dropdown menu, or appended via the toolbar Add button.
|
|
26
|
-
|
|
27
|
-
The plugin registers StackViewType with the ECHO schema module so that per-section view metadata
|
|
28
|
-
(height overrides, custom display data) can be stored and replicated alongside the collection.
|
|
10
|
+
export const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');
|
|
29
11
|
|
|
30
|
-
|
|
31
|
-
sections.
|
|
32
|
-
`,
|
|
33
|
-
icon: 'ph--stack-simple--regular',
|
|
34
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',
|
|
35
|
-
});
|
|
12
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
package/src/translations.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/StackArticle/StackArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { useAppGraph, type AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Collection, Obj, type Ref } from '@dxos/echo';\nimport { Graph } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\nimport { StackContext, StackSection } from '#components';\nimport { meta } from '#meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '#types';\n\nconst collectionObjectsFamily = Atom.family((collection: Collection.Collection) =>\n Atom.make((get) => {\n const snapshot = get(Obj.atom(collection));\n return (\n snapshot.objects\n // TODO(wittjosiah): Why isn't this type inferred correctly?\n .map((ref: Ref.Ref<Obj.Unknown>) => get(Obj.atomReactive(ref)))\n .filter(isNonNullable)\n );\n }),\n);\n\ntype StackArticleProps = AppSurface.ObjectArticleProps<Collection.Collection>;\n\nexport const StackArticle = ({ attendableId, subject: collection }: StackArticleProps) => {\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n // TODO(wittjosiah): Re-implement stack views with relations.\n // const defaultStack = useMemo(() => Obj.make(StackViewType, { sections: {} }), [collection]);\n // const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n // useEffect(() => {\n // if (!collection.views[StackViewType.typename]) {\n // collection.views[StackViewType.typename] = Ref.make(stack);\n // }\n // }, [collection, stack]);\n\n const collectionObjects = useAtomValue(collectionObjectsFamily(collection));\n const items = collectionObjects.map((object: Obj.Unknown) => {\n const iconAnnotation = Obj.getIcon(object);\n const metadata: StackSectionMetadata = { icon: iconAnnotation?.icon };\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[Obj.getURI(object)],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(Graph.getNode(graph, Obj.getURI(object)).pipe(Option.getOrNull)?.properties.label, t),\n } as StackSectionView;\n return { id: Obj.getURI(object), object, metadata, view } satisfies StackSectionItem;\n });\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => Obj.getURI(section) === id);\n const object = collection.objects[index].target;\n if (Obj.isObject(object)) {\n await invokePromise(SpaceOperation.RemoveObjects, {\n objects: [object],\n target: 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 [collection, invokePromise],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n // TODO(wittjosiah): Use object creation dialog.\n await invokePromise(LayoutOperation.UpdateDialog, {\n subject: `${meta.id}.AddSectionDialog`,\n blockAlign: 'start',\n props: {\n path: id,\n position,\n collection,\n },\n });\n },\n [collection, invokePromise],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await invokePromise(LayoutOperation.Open, { subject: [id] });\n },\n [invokePromise],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () =>\n invokePromise(SpaceOperation.OpenCreateObject, {\n target: collection,\n navigable: false,\n }),\n [collection, invokePromise],\n );\n\n return (\n <StackItem.Content toolbar classNames='dx-document'>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <StackContext.Provider\n value={{\n attendableId,\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack\n orientation='vertical'\n size='intrinsic'\n id={Obj.getURI(collection)}\n data-testid='main.stack'\n classNames='overflow-y-auto'\n >\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </StackItem.Content>\n );\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Obj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "Stack", "StackItem", "isNonNullable", "StackContext", "StackSection", "meta", "collectionObjectsFamily", "family", "collection", "make", "get", "snapshot", "atom", "objects", "map", "ref", "atomReactive", "filter", "StackArticle", "attendableId", "subject", "invokePromise", "graph", "t", "id", "collapsedSections", "setCollapsedSections", "collectionObjects", "items", "object", "iconAnnotation", "getIcon", "metadata", "icon", "view", "collapsed", "getURI", "title", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "index", "target", "findIndex", "section", "isObject", "RemoveObjects", "handleAdd", "position", "UpdateDialog", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "Content", "toolbar", "classNames", "Root", "IconButton", "iconOnly", "data-testid", "onClick", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "orientation", "size", "item", "key"]
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { DXN } from "@dxos/keys";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var SECTION_IDENTIFIER = DXN.make("org.dxos.type.stackSection");
|
|
6
|
-
var meta = Plugin.makeMeta({
|
|
7
|
-
key: DXN.make("org.dxos.plugin.stack"),
|
|
8
|
-
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
9
|
-
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
10
|
-
name: "Collections",
|
|
11
|
-
author: "DXOS",
|
|
12
|
-
spec: "PLUGIN.mdl",
|
|
13
|
-
description: trim`
|
|
14
|
-
StackPlugin renders any Collection object as a vertically scrollable stack of collapsible sections in the
|
|
15
|
-
Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering
|
|
16
|
-
to the section surface role, enabling any other plugin to contribute its own section renderer.
|
|
17
|
-
|
|
18
|
-
Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated
|
|
19
|
-
to directly, or removed from the collection. New sections can be inserted before or after any existing
|
|
20
|
-
section via a per-section dropdown menu, or appended via the toolbar Add button.
|
|
21
|
-
|
|
22
|
-
The plugin registers StackViewType with the ECHO schema module so that per-section view metadata
|
|
23
|
-
(height overrides, custom display data) can be stored and replicated alongside the collection.
|
|
24
|
-
|
|
25
|
-
A settings panel exposes a separation toggle that controls whether visual dividers are rendered between
|
|
26
|
-
sections.
|
|
27
|
-
`,
|
|
28
|
-
icon: "ph--stack-simple--regular",
|
|
29
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
SECTION_IDENTIFIER,
|
|
34
|
-
meta
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-RGJSGQGF.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.stack'),\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n author: 'DXOS',\n spec: 'PLUGIN.mdl',\n description: trim`\n StackPlugin renders any Collection object as a vertically scrollable stack of collapsible sections in the\n Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering\n to the section surface role, enabling any other plugin to contribute its own section renderer.\n\n Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated\n to directly, or removed from the collection. New sections can be inserted before or after any existing\n section via a per-section dropdown menu, or appended via the toolbar Add button.\n\n The plugin registers StackViewType with the ECHO schema module so that per-section view metadata\n (height overrides, custom display data) can be stored and replicated alongside the collection.\n\n A settings panel exposes a separation toggle that controls whether visual dividers are rendered between\n sections.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,qBAAqBF,IAAIG,KAAK,4BAAA;AAEpC,IAAMC,OAAOL,OAAOM,SAAS;EAClCC,KAAKN,IAAIG,KAAK,uBAAA;;;EAGdI,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,aAAaT;;;;;;;;;;;;;;;EAebU,MAAM;EACNC,QAAQ;AACV,CAAA;",
|
|
6
|
-
"names": ["Plugin", "DXN", "trim", "SECTION_IDENTIFIER", "make", "meta", "makeMeta", "key", "name", "author", "spec", "description", "icon", "source"]
|
|
7
|
-
}
|