@dxos/plugin-stack 0.8.4-main.3f58842 → 0.8.4-main.3fbcb4aa9b
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/StackContainer-KZ5Q5YKJ.mjs +126 -0
- package/dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs.map +7 -0
- package/dist/lib/neutral/StackPlugin.mjs +22 -0
- package/dist/lib/neutral/StackPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +7 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-UN5PA7TK.mjs → neutral/chunk-3ISQZKGO.mjs} +8 -8
- package/dist/lib/neutral/chunk-3ISQZKGO.mjs.map +7 -0
- package/dist/lib/{browser/chunk-IRTROCUQ.mjs → neutral/chunk-IPU3C6TT.mjs} +10 -11
- package/dist/lib/neutral/chunk-IPU3C6TT.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +182 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +7 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +15 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +9 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-4ZA44TMR.mjs +23 -0
- package/dist/lib/neutral/react-surface-4ZA44TMR.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +37 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/StackPlugin.d.ts +3 -1
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
- package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
- package/dist/types/src/components/StackContext/index.d.ts +2 -0
- package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
- package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
- package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
- package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
- package/dist/types/src/components/StackSection/index.d.ts +2 -0
- package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
- package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
- package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
- package/dist/types/src/components/StackSettings/index.d.ts +2 -0
- package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts +7 -0
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -0
- package/dist/types/src/containers/StackContainer/index.d.ts +2 -0
- package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +31 -30
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/stack.d.ts +13 -14
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +3 -3
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +92 -50
- package/src/StackPlugin.ts +14 -46
- package/src/capabilities/index.ts +2 -2
- package/src/capabilities/react-surface.tsx +20 -26
- package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
- package/src/components/StackContext/index.ts +5 -0
- package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +30 -26
- package/src/components/StackSection/index.ts +5 -0
- package/src/components/StackSettings/StackSettings.tsx +28 -0
- package/src/components/StackSettings/index.ts +5 -0
- package/src/components/index.ts +2 -4
- package/src/containers/StackContainer/StackContainer.tsx +170 -0
- package/src/containers/StackContainer/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +9 -6
- package/src/plugin.ts +9 -0
- package/src/translations.ts +23 -21
- package/src/types/stack.ts +12 -8
- package/src/types/types.ts +3 -3
- package/dist/lib/browser/StackMain-ET24BQFZ.mjs +0 -299
- package/dist/lib/browser/StackMain-ET24BQFZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FVB7LGW7.mjs +0 -19
- package/dist/lib/browser/chunk-FVB7LGW7.mjs.map +0 -7
- package/dist/lib/browser/chunk-IRTROCUQ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -100
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-KODSQDIY.mjs +0 -46
- package/dist/lib/browser/react-surface-KODSQDIY.mjs.map +0 -7
- package/dist/lib/node-esm/StackMain-LCMLZ4MS.mjs +0 -300
- package/dist/lib/node-esm/StackMain-LCMLZ4MS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LRAZXJ65.mjs +0 -30
- package/dist/lib/node-esm/chunk-LRAZXJ65.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UN5PA7TK.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -101
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-SWMUVIYU.mjs +0 -47
- package/dist/lib/node-esm/react-surface-SWMUVIYU.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -10
- package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
- package/dist/types/src/components/StackContext.d.ts.map +0 -1
- package/dist/types/src/components/StackMain.d.ts +0 -9
- package/dist/types/src/components/StackMain.d.ts.map +0 -1
- package/dist/types/src/components/StackSection.d.ts.map +0 -1
- package/dist/types/src/components/StackSettings.d.ts.map +0 -1
- package/src/components/StackMain.tsx +0 -159
- package/src/components/StackSettings.tsx +0 -23
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// src/containers/StackContainer/StackContainer.tsx
|
|
2
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import React, { useCallback, useState } from "react";
|
|
5
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
+
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
+
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
8
|
+
import { Annotation, Obj } from "@dxos/echo";
|
|
9
|
+
import { AtomObj } from "@dxos/echo-atom";
|
|
10
|
+
import { Graph } from "@dxos/plugin-graph";
|
|
11
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
12
|
+
import { Toolbar, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
13
|
+
import { Stack, StackItem } from "@dxos/react-ui-stack";
|
|
14
|
+
import { isNonNullable } from "@dxos/util";
|
|
15
|
+
import { StackContext, StackSection } from "#components";
|
|
16
|
+
import { meta } from "#meta";
|
|
17
|
+
var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
|
|
18
|
+
const snapshot = get(AtomObj.make(collection));
|
|
19
|
+
return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
|
|
20
|
+
}));
|
|
21
|
+
var StackContainer = ({ attendableId, subject: collection }) => {
|
|
22
|
+
const { invokePromise } = useOperationInvoker();
|
|
23
|
+
const { graph } = useAppGraph();
|
|
24
|
+
const { t } = useTranslation(meta.id);
|
|
25
|
+
const [collapsedSections, setCollapsedSections] = useState({});
|
|
26
|
+
const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
|
|
27
|
+
const items = collectionObjects.map((object) => {
|
|
28
|
+
const schema = Obj.getSchema(object);
|
|
29
|
+
const iconAnnotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : void 0;
|
|
30
|
+
const metadata = {
|
|
31
|
+
icon: iconAnnotation?.icon
|
|
32
|
+
};
|
|
33
|
+
const view = {
|
|
34
|
+
// ...stack.sections[object.id],
|
|
35
|
+
collapsed: collapsedSections[Obj.getDXN(object).toString()],
|
|
36
|
+
title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
|
|
37
|
+
toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
id: Obj.getDXN(object).toString(),
|
|
41
|
+
object,
|
|
42
|
+
metadata,
|
|
43
|
+
view
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const handleDelete = useCallback(async (id) => {
|
|
47
|
+
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id);
|
|
48
|
+
const object = collection.objects[index].target;
|
|
49
|
+
if (Obj.isObject(object)) {
|
|
50
|
+
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
51
|
+
objects: [
|
|
52
|
+
object
|
|
53
|
+
],
|
|
54
|
+
target: collection
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
collection,
|
|
59
|
+
invokePromise
|
|
60
|
+
]);
|
|
61
|
+
const handleAdd = useCallback(async (id, position) => {
|
|
62
|
+
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
63
|
+
subject: `${meta.id}.AddSectionDialog`,
|
|
64
|
+
blockAlign: "start",
|
|
65
|
+
props: {
|
|
66
|
+
path: id,
|
|
67
|
+
position,
|
|
68
|
+
collection
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}, [
|
|
72
|
+
collection,
|
|
73
|
+
invokePromise
|
|
74
|
+
]);
|
|
75
|
+
const handleNavigate = useCallback(async (id) => {
|
|
76
|
+
await invokePromise(LayoutOperation.Open, {
|
|
77
|
+
subject: [
|
|
78
|
+
id
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}, [
|
|
82
|
+
invokePromise
|
|
83
|
+
]);
|
|
84
|
+
const handleCollapse = useCallback((id, collapsed) => setCollapsedSections((prev) => ({
|
|
85
|
+
...prev,
|
|
86
|
+
[id]: collapsed
|
|
87
|
+
})), []);
|
|
88
|
+
const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
|
|
89
|
+
target: collection,
|
|
90
|
+
navigable: false
|
|
91
|
+
}), [
|
|
92
|
+
collection,
|
|
93
|
+
invokePromise
|
|
94
|
+
]);
|
|
95
|
+
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
96
|
+
toolbar: true,
|
|
97
|
+
classNames: "dx-document"
|
|
98
|
+
}, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
|
|
99
|
+
icon: "ph--plus--regular",
|
|
100
|
+
iconOnly: true,
|
|
101
|
+
label: "Add section",
|
|
102
|
+
"data-testid": "stack.addSection",
|
|
103
|
+
onClick: handleAddSection
|
|
104
|
+
})), /* @__PURE__ */ React.createElement(StackContext.Provider, {
|
|
105
|
+
value: {
|
|
106
|
+
attendableId,
|
|
107
|
+
onCollapse: handleCollapse,
|
|
108
|
+
onNavigate: handleNavigate,
|
|
109
|
+
onDelete: handleDelete,
|
|
110
|
+
onAdd: handleAdd
|
|
111
|
+
}
|
|
112
|
+
}, /* @__PURE__ */ React.createElement(Stack, {
|
|
113
|
+
orientation: "vertical",
|
|
114
|
+
size: "intrinsic",
|
|
115
|
+
id: Obj.getDXN(collection).toString(),
|
|
116
|
+
"data-testid": "main.stack",
|
|
117
|
+
classNames: "overflow-y-auto"
|
|
118
|
+
}, items.map((item) => /* @__PURE__ */ React.createElement(StackSection, {
|
|
119
|
+
key: item.id,
|
|
120
|
+
...item
|
|
121
|
+
})))));
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
StackContainer as default
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=StackContainer-KZ5Q5YKJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/StackContainer/StackContainer.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 { Annotation, Obj, type Ref } from '@dxos/echo';\nimport { type Collection } from '@dxos/echo';\nimport { AtomObj } from '@dxos/echo-atom';\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(AtomObj.make(collection));\n return (\n snapshot.objects\n // TODO(wittjosiah): Why isn't this type inferred correctly?\n .map((ref: Ref.Ref<Obj.Unknown>) => get(AtomObj.makeWithReactive(ref)))\n .filter(isNonNullable)\n );\n }),\n);\n\ntype StackContainerProps = AppSurface.ObjectArticleProps<Collection.Collection>;\n\nexport const StackContainer = ({ attendableId, subject: collection }: StackContainerProps) => {\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 schema = Obj.getSchema(object);\n const iconAnnotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : undefined;\n const metadata: StackSectionMetadata = { icon: iconAnnotation?.icon };\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[Obj.getDXN(object).toString()],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(\n Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label,\n t,\n ),\n } as StackSectionView;\n return { id: Obj.getDXN(object).toString(), 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.getDXN(section).toString() === 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.getDXN(collection).toString()}\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
|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M,CAACxC,EAAAA,GAAKe;EAAU,EAAA,GAC/F,CAAA,CAAE;AAGJ,QAAM0B,mBAAmB7E,YACvB,MACEiC,cAAcxB,eAAeqE,kBAAkB;IAC7ChB,QAAQzC;IACR0D,WAAW;EACb,CAAA,GACF;IAAC1D;IAAYY;GAAc;AAG7B,SACE,sBAAA,cAACnB,UAAUkE,SAAO;IAACC,SAAAA;IAAQC,YAAW;KACpC,sBAAA,cAACxE,QAAQyE,MAAI,MACX,sBAAA,cAACzE,QAAQ0E,YAAU;IACjBnC,MAAK;IACLoC,UAAAA;IACA1B,OAAM;IACN2B,eAAY;IACZC,SAASV;OAGb,sBAAA,cAAC7D,aAAawE,UAAQ;IACpBC,OAAO;MACL1D;MACA2D,YAAYf;MACZgB,YAAYlB;MACZmB,UAAUhC;MACViC,OAAO1B;IACT;KAEA,sBAAA,cAACtD,OAAAA;IACCiF,aAAY;IACZC,MAAK;IACL3D,IAAI9B,IAAI8C,OAAO/B,UAAAA,EAAYgC,SAAQ;IACnCiC,eAAY;IACZJ,YAAW;KAEV1C,MAAMd,IAAI,CAACsE,SACV,sBAAA,cAAC/E,cAAAA;IAAagF,KAAKD,KAAK5D;IAAK,GAAG4D;;AAM5C;",
|
|
6
|
+
"names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useOperationInvoker", "LayoutOperation", "useAppGraph", "Annotation", "Obj", "AtomObj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "Stack", "StackItem", "isNonNullable", "StackContext", "StackSection", "meta", "collectionObjectsFamily", "family", "collection", "make", "get", "snapshot", "objects", "map", "ref", "makeWithReactive", "filter", "StackContainer", "attendableId", "subject", "invokePromise", "graph", "t", "id", "collapsedSections", "setCollapsedSections", "collectionObjects", "items", "object", "schema", "getSchema", "iconAnnotation", "getOrUndefined", "IconAnnotation", "undefined", "metadata", "icon", "view", "collapsed", "getDXN", "toString", "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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/StackPlugin.ts
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
4
|
+
import { ReactSurface } from "#capabilities";
|
|
5
|
+
import { meta } from "#meta";
|
|
6
|
+
import { translations } from "#translations";
|
|
7
|
+
import { StackViewType } from "#types";
|
|
8
|
+
var StackPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
|
|
9
|
+
schema: [
|
|
10
|
+
StackViewType
|
|
11
|
+
]
|
|
12
|
+
}), AppPlugin.addSurfaceModule({
|
|
13
|
+
activate: ReactSurface
|
|
14
|
+
}), AppPlugin.addTranslationsModule({
|
|
15
|
+
translations
|
|
16
|
+
}), Plugin.make);
|
|
17
|
+
var StackPlugin_default = StackPlugin;
|
|
18
|
+
export {
|
|
19
|
+
StackPlugin,
|
|
20
|
+
StackPlugin_default as default
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=StackPlugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/StackPlugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { StackViewType } from '#types';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [StackViewType] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n\nexport default StackPlugin;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,oBAAoB;AAC7B,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAEvB,IAAMC,cAAcN,OAAOO,OAAOJ,IAAAA,EAAMK,KAC7CP,UAAUQ,gBAAgB;EAAEC,QAAQ;IAACL;;AAAe,CAAA,GACpDJ,UAAUU,iBAAiB;EAAEC,UAAUV;AAAa,CAAA,GACpDD,UAAUY,sBAAsB;EAAET;AAAa,CAAA,GAC/CJ,OAAOc,IAAI;AAGb,IAAA,sBAAeR;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "ReactSurface", "meta", "translations", "StackViewType", "StackPlugin", "define", "pipe", "addSchemaModule", "schema", "addSurfaceModule", "activate", "addTranslationsModule", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,kBAAkB;AAEpB,IAAMC,eAAeD,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "ReactSurface", "lazy"]
|
|
7
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
1
|
// src/meta.ts
|
|
4
|
-
|
|
5
|
-
var SECTION_IDENTIFIER = "dxos.
|
|
2
|
+
import { trim } from "@dxos/util";
|
|
3
|
+
var SECTION_IDENTIFIER = "org.dxos.type.stackSection";
|
|
6
4
|
var meta = {
|
|
7
|
-
id:
|
|
5
|
+
id: "org.dxos.plugin.stack",
|
|
8
6
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
9
7
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
10
8
|
name: "Collections",
|
|
11
|
-
description:
|
|
9
|
+
description: trim`
|
|
10
|
+
Organize and view curated collections of workspace objects in customizable layouts.
|
|
11
|
+
Group related items together and manage collections with sections and filtering.
|
|
12
|
+
`,
|
|
12
13
|
icon: "ph--stack-simple--regular",
|
|
13
14
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export {
|
|
17
|
-
STACK_PLUGIN,
|
|
18
18
|
SECTION_IDENTIFIER,
|
|
19
19
|
meta
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-3ISQZKGO.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'org.dxos.type.stackSection';\n\nexport const meta: Plugin.Meta = {\n id: '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 description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAoB;EAC/BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaL;;;;EAIbM,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/types/stack.ts
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { Type } from "@dxos/echo";
|
|
4
4
|
var SectionSchema = Schema.Struct({
|
|
5
5
|
height: Schema.optional(Schema.Number),
|
|
6
6
|
// Space for data that isn't stack-specific but is specific to this view instance.
|
|
@@ -10,19 +10,18 @@ var SectionSchema = Schema.Struct({
|
|
|
10
10
|
value: Schema.Any
|
|
11
11
|
}))
|
|
12
12
|
});
|
|
13
|
-
var StackViewType =
|
|
14
|
-
|
|
15
|
-
version: "0.1.0"
|
|
16
|
-
})({
|
|
17
|
-
sections: Schema.mutable(Schema.Record({
|
|
13
|
+
var StackViewType = Schema.Struct({
|
|
14
|
+
sections: Schema.Record({
|
|
18
15
|
key: Schema.String,
|
|
19
16
|
value: SectionSchema
|
|
20
|
-
})
|
|
21
|
-
})
|
|
22
|
-
|
|
17
|
+
})
|
|
18
|
+
}).pipe(Type.object({
|
|
19
|
+
typename: "org.dxos.type.stackView",
|
|
20
|
+
version: "0.1.0"
|
|
21
|
+
}));
|
|
23
22
|
|
|
24
23
|
export {
|
|
25
24
|
SectionSchema,
|
|
26
25
|
StackViewType
|
|
27
26
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-IPU3C6TT.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.Record({ key: Schema.String, value: SectionSchema }),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.stackView',\n version: '0.1.0',\n }),\n);\n\nexport interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}\n"],
|
|
5
|
+
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAY;AAOd,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAuBV,cAAO;EACzCW,UAAiBN,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA;AACrE,CAAA,EAAGa,KACDd,KAAKe,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
|
+
"names": ["Schema", "Type", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "sections", "pipe", "object", "typename", "version"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// src/components/StackContext/StackContext.tsx
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
var StackContext = /* @__PURE__ */ createContext({
|
|
4
|
+
attendableId: "",
|
|
5
|
+
onCollapse: () => {
|
|
6
|
+
},
|
|
7
|
+
onNavigate: async () => {
|
|
8
|
+
},
|
|
9
|
+
onDelete: async () => {
|
|
10
|
+
},
|
|
11
|
+
onAdd: () => {
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var useStack = () => useContext(StackContext);
|
|
15
|
+
|
|
16
|
+
// src/components/StackSection/StackSection.tsx
|
|
17
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
18
|
+
import React2, { useMemo, useState } from "react";
|
|
19
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
20
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
21
|
+
import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
22
|
+
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
23
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
24
|
+
import { getSize, mx } from "@dxos/ui-theme";
|
|
25
|
+
import { meta } from "#meta";
|
|
26
|
+
|
|
27
|
+
// src/components/StackSection/CaretDownUp.tsx
|
|
28
|
+
import React from "react";
|
|
29
|
+
var CaretDownUp = ({ children, ...props }) => {
|
|
30
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
viewBox: "0 0 256 256",
|
|
33
|
+
...props
|
|
34
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
35
|
+
width: "256",
|
|
36
|
+
height: "256",
|
|
37
|
+
fill: "none"
|
|
38
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
39
|
+
points: "80 224 128 176 176 224",
|
|
40
|
+
fill: "none",
|
|
41
|
+
stroke: "currentColor",
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round",
|
|
44
|
+
strokeWidth: "16"
|
|
45
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
46
|
+
points: "80 32 128 80 176 32",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round",
|
|
51
|
+
strokeWidth: "16"
|
|
52
|
+
}), children);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/components/StackSection/StackSection.tsx
|
|
56
|
+
var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
|
|
57
|
+
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
58
|
+
const { t } = useTranslation(meta.id);
|
|
59
|
+
const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
60
|
+
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
61
|
+
const attendableId = `${parentAttendableId}/${object.id}`;
|
|
62
|
+
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
63
|
+
const stackItem = useMemo(() => ({
|
|
64
|
+
id
|
|
65
|
+
}), [
|
|
66
|
+
id
|
|
67
|
+
]);
|
|
68
|
+
const data = useMemo(() => ({
|
|
69
|
+
attendableId,
|
|
70
|
+
subject: object
|
|
71
|
+
}), [
|
|
72
|
+
object,
|
|
73
|
+
attendableId
|
|
74
|
+
]);
|
|
75
|
+
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
76
|
+
asChild: true,
|
|
77
|
+
open: !view.collapsed,
|
|
78
|
+
onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
|
|
79
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Root, {
|
|
80
|
+
item: stackItem,
|
|
81
|
+
role: "section",
|
|
82
|
+
...attentionAttrs
|
|
83
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
84
|
+
classNames: "dx-attention-surface"
|
|
85
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
86
|
+
className: "sr-only"
|
|
87
|
+
}, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
|
|
88
|
+
open: optionsMenuOpen,
|
|
89
|
+
onOpenChange: setOptionsMenuOpen
|
|
90
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
|
|
91
|
+
asChild: true
|
|
92
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
93
|
+
icon,
|
|
94
|
+
classNames: "transition-opacity"
|
|
95
|
+
}))), /* @__PURE__ */ React2.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Viewport, null, view.collapsed ? /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
96
|
+
onClick: () => onNavigate(id),
|
|
97
|
+
"data-testid": "section.navigate-to"
|
|
98
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
99
|
+
icon: "ph--arrow-right--regular"
|
|
100
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
101
|
+
className: "ms-2 grow"
|
|
102
|
+
}, t("navigate-to-section.label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
103
|
+
asChild: true
|
|
104
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
|
|
105
|
+
className: getSize(5)
|
|
106
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
107
|
+
className: "ms-2 grow"
|
|
108
|
+
}, t("collapse.label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
109
|
+
onClick: () => onAdd(id, "before"),
|
|
110
|
+
"data-testid": "section.add-before"
|
|
111
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
112
|
+
icon: "ph--arrow-line-up--regular"
|
|
113
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
114
|
+
className: "ms-2 grow"
|
|
115
|
+
}, t("add-section-before.label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
116
|
+
onClick: () => onAdd(id, "after"),
|
|
117
|
+
"data-testid": "section.add-after"
|
|
118
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
119
|
+
icon: "ph--arrow-line-down--regular"
|
|
120
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
121
|
+
className: "ms-2 grow"
|
|
122
|
+
}, t("add-section-after.label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
123
|
+
onClick: () => onDelete(id),
|
|
124
|
+
"data-testid": "section.remove"
|
|
125
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
126
|
+
icon: "ph--trash--regular"
|
|
127
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
128
|
+
className: "ms-2 grow"
|
|
129
|
+
}, t("remove-section.label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
130
|
+
asChild: true
|
|
131
|
+
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
132
|
+
iconOnly: true,
|
|
133
|
+
variant: "ghost",
|
|
134
|
+
label: t("expand.label"),
|
|
135
|
+
icon: "ph--caret-up-down--regular",
|
|
136
|
+
classNames: sectionActionDimensions
|
|
137
|
+
})) : /* @__PURE__ */ React2.createElement(IconButton, {
|
|
138
|
+
iconOnly: true,
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
onClick: () => onNavigate(id),
|
|
141
|
+
label: t("navigate-to-section.label"),
|
|
142
|
+
icon: "ph--arrow-right--regular",
|
|
143
|
+
"data-testid": "section.navigate-to",
|
|
144
|
+
classNames: sectionActionDimensions
|
|
145
|
+
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
146
|
+
type: AppSurface.Section,
|
|
147
|
+
data,
|
|
148
|
+
limit: 1,
|
|
149
|
+
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
150
|
+
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
151
|
+
classNames: "dx-attention-surface"
|
|
152
|
+
}, /* @__PURE__ */ React2.createElement("h2", {
|
|
153
|
+
className: mx("flex items-center p-4 font-medium")
|
|
154
|
+
}, view.title))));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/components/StackSettings/StackSettings.tsx
|
|
158
|
+
import React3 from "react";
|
|
159
|
+
import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
160
|
+
import { Settings as SettingsForm } from "@dxos/react-ui-form";
|
|
161
|
+
import { meta as meta2 } from "#meta";
|
|
162
|
+
var StackSettings = ({ settings }) => {
|
|
163
|
+
const { t } = useTranslation2(meta2.id);
|
|
164
|
+
return /* @__PURE__ */ React3.createElement(SettingsForm.Viewport, null, /* @__PURE__ */ React3.createElement(SettingsForm.Section, {
|
|
165
|
+
title: t("settings.title", {
|
|
166
|
+
ns: meta2.id
|
|
167
|
+
})
|
|
168
|
+
}, /* @__PURE__ */ React3.createElement(SettingsForm.Item, {
|
|
169
|
+
title: t("settings.separation.label"),
|
|
170
|
+
description: t("settings.separation.description")
|
|
171
|
+
}, /* @__PURE__ */ React3.createElement(Input.Switch, {
|
|
172
|
+
checked: settings.separation,
|
|
173
|
+
onCheckedChange: (checked) => settings.separation = !!checked
|
|
174
|
+
}))));
|
|
175
|
+
};
|
|
176
|
+
export {
|
|
177
|
+
StackContext,
|
|
178
|
+
StackSection,
|
|
179
|
+
StackSettings,
|
|
180
|
+
useStack
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/StackContext/StackContext.tsx", "../../../../src/components/StackSection/StackSection.tsx", "../../../../src/components/StackSection/CaretDownUp.tsx", "../../../../src/components/StackSettings/StackSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '#types';\n\nexport type StackContextValue = {\n attendableId: string;\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n attendableId: '',\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\nimport { type StackSectionItem } from '#types';\n\nimport { useStack } from '../StackContext';\nimport { CaretDownUp } from './CaretDownUp';\n\nconst sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attendableId = `${parentAttendableId}/${object.id}`;\n const attentionAttrs = useAttentionAttributes(attendableId);\n const stackItem = useMemo(() => ({ id }), [id]);\n const data = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='dx-attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' />\n <span className='ms-2 grow'>{t('navigate-to-section.label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='ms-2 grow'>{t('collapse.label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' />\n <span className='ms-2 grow'>{t('add-section-before.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' />\n <span className='ms-2 grow'>{t('add-section-after.label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' />\n <span className='ms-2 grow'>{t('remove-section.label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand.label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate-to-section.label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface.Surface type={AppSurface.Section} data={data} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='dx-attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium')}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type StackSettingsProps } from '#types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <SettingsForm.Viewport>\n <SettingsForm.Section title={t('settings.title', { ns: meta.id })}>\n <SettingsForm.Item title={t('settings.separation.label')} description={t('settings.separation.description')}>\n <Input.Switch\n checked={settings.separation}\n onCheckedChange={(checked) => (settings.separation = !!checked)}\n />\n </SettingsForm.Item>\n </SettingsForm.Section>\n </SettingsForm.Viewport>\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,eAAeC,kBAAkB;AAYnC,IAAMC,eAAeF,8BAAiC;EAC3DG,cAAc;EACdC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMC,WAAW,MAAMP,WAAWC,YAAAA;;;ACpBzC,YAAYO,0BAA0B;AACtC,OAAOC,UAASC,SAASC,gBAAgB;AAEzC,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,cAAcC,MAAMC,YAAYC,sBAAsB;AAC/D,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,SAASC,UAAU;AAE5B,SAASC,YAAY;;;ACVrB,OAAOC,WAA8C;AAE9C,IAAMC,cAAc,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAAwC;AACjF,SACE,sBAAA,cAACC,OAAAA;IAAIC,OAAM;IAA6BC,SAAQ;IAAe,GAAGH;KAChE,sBAAA,cAACI,QAAAA;IAAKC,OAAM;IAAMC,QAAO;IAAMC,MAAK;MACpC,sBAAA,cAACC,YAAAA;IACCC,QAAO;IACPF,MAAK;IACLG,QAAO;IACPC,eAAc;IACdC,gBAAe;IACfC,aAAY;MAEd,sBAAA,cAACL,YAAAA;IACCC,QAAO;IACPF,MAAK;IACLG,QAAO;IACPC,eAAc;IACdC,gBAAe;IACfC,aAAY;MAEbd,QAAAA;AAGP;;;ADTA,IAAMe,0BAA0B;AAIzB,IAAMC,eAAe,CAAC,EAC3BC,IACAC,MACAC,QACAC,UAAU,EAAEC,OAAO,2BAA0B,EAAE,MAC7B;AAClB,QAAM,EAAEC,EA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ACD;;AAMnE;",
|
|
6
|
+
"names": ["createContext", "useContext", "StackContext", "attendableId", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "AppSurface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "meta", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "attendableId", "parentAttendableId", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "data", "subject", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "type", "AppSurface", "Section", "limit", "placeholder", "h2", "mx", "React", "Input", "useTranslation", "Settings", "SettingsForm", "meta", "StackSettings", "settings", "t", "id", "Viewport", "Section", "title", "ns", "Item", "description", "Switch", "checked", "separation", "onCheckedChange"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const StackContainer: ComponentType<any> = lazy(() => import('./StackContainer'));\n"],
|
|
5
|
+
"mappings": ";AAIA,SAA6BA,YAAY;AAElC,IAAMC,iBAAqCD,KAAK,MAAM,OAAO,gCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "StackContainer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SectionSchema,
|
|
3
|
+
StackViewType
|
|
4
|
+
} from "./chunk-IPU3C6TT.mjs";
|
|
5
|
+
import {
|
|
6
|
+
SECTION_IDENTIFIER,
|
|
7
|
+
meta
|
|
8
|
+
} from "./chunk-3ISQZKGO.mjs";
|
|
9
|
+
export {
|
|
10
|
+
SECTION_IDENTIFIER,
|
|
11
|
+
SectionSchema,
|
|
12
|
+
StackViewType,
|
|
13
|
+
meta
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":2443,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/stack.ts":{"bytes":3664,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":409,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/index.ts":{"bytes":449,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":2330,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3142,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":802,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/components/StackContext/StackContext.tsx":{"bytes":1849,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackContext/index.ts":{"bytes":388,"imports":[{"path":"src/components/StackContext/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackSection/CaretDownUp.tsx":{"bytes":2864,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection/StackSection.tsx":{"bytes":17807,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","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-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"src/components/StackContext/index.ts","kind":"import-statement","original":"../StackContext"},{"path":"src/components/StackSection/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"}],"format":"esm"},"src/components/StackSection/index.ts":{"bytes":388,"imports":[{"path":"src/components/StackSection/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/StackSettings/StackSettings.tsx":{"bytes":3207,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSettings/index.ts":{"bytes":389,"imports":[{"path":"src/components/StackSettings/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"}],"format":"esm"},"src/components/index.ts":{"bytes":589,"imports":[{"path":"src/components/StackContext/index.ts","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection/index.ts","kind":"import-statement","original":"./StackSection"},{"path":"src/components/StackSettings/index.ts","kind":"import-statement","original":"./StackSettings"}],"format":"esm"},"src/containers/StackContainer/StackContainer.tsx":{"bytes":19478,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","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-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/containers/StackContainer/index.ts":{"bytes":518,"imports":[{"path":"src/containers/StackContainer/StackContainer.tsx","kind":"import-statement","original":"./StackContainer"}],"format":"esm"},"src/containers/index.ts":{"bytes":714,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/StackContainer/index.ts","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/plugin.ts":{"bytes":850,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":4619,"imports":[{"path":"@dxos/react-ui-stack/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-IPU3C6TT.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/neutral/react-surface-4ZA44TMR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1627},"dist/lib/neutral/react-surface-4ZA44TMR.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":745}},"bytes":882},"dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10159},"dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs":{"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","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-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/StackContainer/index.ts","inputs":{"src/containers/StackContainer/StackContainer.tsx":{"bytesInOutput":4293},"src/containers/StackContainer/index.ts":{"bytesInOutput":0}},"bytes":4438},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-IPU3C6TT.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-3ISQZKGO.mjs","kind":"import-statement"}],"exports":["SECTION_IDENTIFIER","SectionSchema","StackViewType","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":252},"dist/lib/neutral/chunk-IPU3C6TT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1753},"dist/lib/neutral/chunk-IPU3C6TT.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":575},"src/types/index.ts":{"bytesInOutput":0}},"bytes":687},"dist/lib/neutral/StackPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1222},"dist/lib/neutral/StackPlugin.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["StackPlugin","default"],"entryPoint":"src/StackPlugin.ts","inputs":{"src/StackPlugin.ts":{"bytesInOutput":528}},"bytes":651},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":432},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/react-surface-4ZA44TMR.mjs","kind":"dynamic-import"}],"exports":["ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":149}},"bytes":240},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13927},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","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-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["StackContext","StackSection","StackSettings","useStack"],"entryPoint":"src/components/index.ts","inputs":{"src/components/StackContext/StackContext.tsx":{"bytesInOutput":285},"src/components/StackContext/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/StackSection/StackSection.tsx":{"bytesInOutput":5242},"src/components/StackSection/CaretDownUp.tsx":{"bytesInOutput":771},"src/components/StackSection/index.ts":{"bytesInOutput":0},"src/components/StackSettings/StackSettings.tsx":{"bytesInOutput":814},"src/components/StackSettings/index.ts":{"bytesInOutput":0}},"bytes":7464},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":402},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs","kind":"dynamic-import"}],"exports":["StackContainer"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":105}},"bytes":196},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3ISQZKGO.mjs","kind":"import-statement"}],"exports":["SECTION_IDENTIFIER","meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":144},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":437},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-3ISQZKGO.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["StackPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":108}},"bytes":235},"dist/lib/neutral/chunk-3ISQZKGO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1157},"dist/lib/neutral/chunk-3ISQZKGO.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":695}},"bytes":796},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2139},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"@dxos/react-ui-stack/translations","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":1404}},"bytes":1496}}}
|