@dxos/plugin-stack 0.8.4-main.c85a9c8dae → 0.8.4-main.d05673bc65
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/{StackContainer-BIFUBD3Y.mjs → StackContainer-OLHE5F4E.mjs} +33 -28
- package/dist/lib/browser/StackContainer-OLHE5F4E.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4X7CK6FM.mjs → chunk-G4CLPE5A.mjs} +3 -3
- package/dist/lib/browser/chunk-G4CLPE5A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CD32XYEB.mjs → chunk-YPQYUBQP.mjs} +2 -2
- package/dist/lib/browser/{chunk-CD32XYEB.mjs.map → chunk-YPQYUBQP.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-PVND4UCN.mjs → react-surface-JS4ERDMQ.mjs} +6 -7
- package/dist/lib/browser/react-surface-JS4ERDMQ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{StackContainer-7XVJHW4D.mjs → StackContainer-W3M7BKLT.mjs} +33 -28
- package/dist/lib/node-esm/StackContainer-W3M7BKLT.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-26XWE7UY.mjs → chunk-LELGTQAL.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-26XWE7UY.mjs.map → chunk-LELGTQAL.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-HEEGXPSW.mjs → chunk-LOZ6GH5A.mjs} +3 -3
- package/dist/lib/node-esm/chunk-LOZ6GH5A.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-SZETVRAZ.mjs → react-surface-YKS4OHR3.mjs} +6 -7
- package/dist/lib/node-esm/react-surface-YKS4OHR3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/react-surface/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/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/containers/StackContainer/StackContainer.d.ts +2 -4
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/src/capabilities/react-surface/react-surface.tsx +4 -7
- 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} +8 -6
- package/src/components/StackSection/index.ts +5 -0
- package/src/components/{StackSettings.tsx → StackSettings/StackSettings.tsx} +2 -2
- package/src/components/StackSettings/index.ts +5 -0
- package/src/containers/StackContainer/StackContainer.tsx +23 -21
- package/src/meta.ts +2 -2
- package/src/types/stack.ts +1 -1
- package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PVND4UCN.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs.map +0 -7
- 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/StackSection.d.ts.map +0 -1
- package/dist/types/src/components/StackSettings.d.ts.map +0 -1
- /package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +0 -0
- /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4CLPE5A.mjs";
|
|
4
4
|
|
|
5
5
|
// src/containers/StackContainer/StackContainer.tsx
|
|
6
6
|
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
@@ -14,13 +14,13 @@ import { AtomObj } from "@dxos/echo-atom";
|
|
|
14
14
|
import { Graph } from "@dxos/plugin-graph";
|
|
15
15
|
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
16
16
|
import { Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
17
|
-
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
18
17
|
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
19
18
|
import { isNonNullable } from "@dxos/util";
|
|
20
19
|
|
|
21
|
-
// src/components/StackContext.tsx
|
|
20
|
+
// src/components/StackContext/StackContext.tsx
|
|
22
21
|
import { createContext, useContext } from "react";
|
|
23
22
|
var StackContext = /* @__PURE__ */ createContext({
|
|
23
|
+
attendableId: "",
|
|
24
24
|
onCollapse: () => {
|
|
25
25
|
},
|
|
26
26
|
onNavigate: async () => {
|
|
@@ -32,7 +32,7 @@ var StackContext = /* @__PURE__ */ createContext({
|
|
|
32
32
|
});
|
|
33
33
|
var useStack = () => useContext(StackContext);
|
|
34
34
|
|
|
35
|
-
// src/components/StackSection.tsx
|
|
35
|
+
// src/components/StackSection/StackSection.tsx
|
|
36
36
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
37
37
|
import React2, { useMemo, useState } from "react";
|
|
38
38
|
import { Surface } from "@dxos/app-framework/ui";
|
|
@@ -41,7 +41,7 @@ import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
|
41
41
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
42
42
|
import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
|
|
43
43
|
|
|
44
|
-
// src/components/CaretDownUp.tsx
|
|
44
|
+
// src/components/StackSection/CaretDownUp.tsx
|
|
45
45
|
import React from "react";
|
|
46
46
|
var CaretDownUp = ({ children, ...props }) => {
|
|
47
47
|
return /* @__PURE__ */ React.createElement("svg", {
|
|
@@ -69,18 +69,26 @@ var CaretDownUp = ({ children, ...props }) => {
|
|
|
69
69
|
}), children);
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
// src/components/StackSection.tsx
|
|
72
|
+
// src/components/StackSection/StackSection.tsx
|
|
73
73
|
var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
|
|
74
74
|
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
75
75
|
const { t } = useTranslation(meta.id);
|
|
76
|
-
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
76
|
+
const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
77
77
|
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
78
|
-
const
|
|
78
|
+
const attendableId = `${parentAttendableId}/${object.id}`;
|
|
79
|
+
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
79
80
|
const stackItem = useMemo(() => ({
|
|
80
81
|
id
|
|
81
82
|
}), [
|
|
82
83
|
id
|
|
83
84
|
]);
|
|
85
|
+
const data = useMemo(() => ({
|
|
86
|
+
attendableId,
|
|
87
|
+
subject: object
|
|
88
|
+
}), [
|
|
89
|
+
object,
|
|
90
|
+
attendableId
|
|
91
|
+
]);
|
|
84
92
|
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
85
93
|
asChild: true,
|
|
86
94
|
open: !view.collapsed,
|
|
@@ -158,9 +166,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
158
166
|
classNames: sectionActionDimensions
|
|
159
167
|
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
160
168
|
role: "section",
|
|
161
|
-
data
|
|
162
|
-
subject: object
|
|
163
|
-
},
|
|
169
|
+
data,
|
|
164
170
|
limit: 1,
|
|
165
171
|
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
166
172
|
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
@@ -170,7 +176,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
170
176
|
}, view.title))));
|
|
171
177
|
};
|
|
172
178
|
|
|
173
|
-
// src/components/StackSettings.tsx
|
|
179
|
+
// src/components/StackSettings/StackSettings.tsx
|
|
174
180
|
import React3 from "react";
|
|
175
181
|
import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
176
182
|
import { Settings } from "@dxos/react-ui-form";
|
|
@@ -180,7 +186,7 @@ var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
|
|
|
180
186
|
const snapshot = get(AtomObj.make(collection));
|
|
181
187
|
return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
|
|
182
188
|
}));
|
|
183
|
-
var StackContainer = ({
|
|
189
|
+
var StackContainer = ({ attendableId, subject: collection }) => {
|
|
184
190
|
const { invokePromise } = useOperationInvoker();
|
|
185
191
|
const { graph } = useAppGraph();
|
|
186
192
|
const { t } = useTranslation3(meta.id);
|
|
@@ -202,8 +208,8 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
202
208
|
view
|
|
203
209
|
};
|
|
204
210
|
});
|
|
205
|
-
const handleDelete = useCallback(async (
|
|
206
|
-
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() ===
|
|
211
|
+
const handleDelete = useCallback(async (id) => {
|
|
212
|
+
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id);
|
|
207
213
|
const object = collection.objects[index].target;
|
|
208
214
|
if (Obj.isObject(object)) {
|
|
209
215
|
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
@@ -217,12 +223,12 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
217
223
|
collection,
|
|
218
224
|
invokePromise
|
|
219
225
|
]);
|
|
220
|
-
const handleAdd = useCallback(async (
|
|
226
|
+
const handleAdd = useCallback(async (id, position) => {
|
|
221
227
|
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
222
|
-
subject: `${meta.id}
|
|
228
|
+
subject: `${meta.id}.AddSectionDialog`,
|
|
223
229
|
blockAlign: "start",
|
|
224
230
|
props: {
|
|
225
|
-
path:
|
|
231
|
+
path: id,
|
|
226
232
|
position,
|
|
227
233
|
collection
|
|
228
234
|
}
|
|
@@ -231,18 +237,18 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
231
237
|
collection,
|
|
232
238
|
invokePromise
|
|
233
239
|
]);
|
|
234
|
-
const handleNavigate = useCallback(async (
|
|
240
|
+
const handleNavigate = useCallback(async (id) => {
|
|
235
241
|
await invokePromise(LayoutOperation.Open, {
|
|
236
242
|
subject: [
|
|
237
|
-
|
|
243
|
+
id
|
|
238
244
|
]
|
|
239
245
|
});
|
|
240
246
|
}, [
|
|
241
247
|
invokePromise
|
|
242
248
|
]);
|
|
243
|
-
const handleCollapse = useCallback((
|
|
249
|
+
const handleCollapse = useCallback((id, collapsed) => setCollapsedSections((prev) => ({
|
|
244
250
|
...prev,
|
|
245
|
-
[
|
|
251
|
+
[id]: collapsed
|
|
246
252
|
})), []);
|
|
247
253
|
const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
|
|
248
254
|
target: collection,
|
|
@@ -260,10 +266,9 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
260
266
|
label: "Add section",
|
|
261
267
|
"data-testid": "stack.addSection",
|
|
262
268
|
onClick: handleAddSection
|
|
263
|
-
})), /* @__PURE__ */ React4.createElement(
|
|
264
|
-
id
|
|
265
|
-
}, /* @__PURE__ */ React4.createElement(StackContext.Provider, {
|
|
269
|
+
})), /* @__PURE__ */ React4.createElement(StackContext.Provider, {
|
|
266
270
|
value: {
|
|
271
|
+
attendableId,
|
|
267
272
|
onCollapse: handleCollapse,
|
|
268
273
|
onNavigate: handleNavigate,
|
|
269
274
|
onDelete: handleDelete,
|
|
@@ -272,13 +277,13 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
272
277
|
}, /* @__PURE__ */ React4.createElement(Stack, {
|
|
273
278
|
orientation: "vertical",
|
|
274
279
|
size: "intrinsic",
|
|
275
|
-
id,
|
|
280
|
+
id: Obj.getDXN(collection).toString(),
|
|
276
281
|
"data-testid": "main.stack",
|
|
277
282
|
classNames: "overflow-y-auto"
|
|
278
283
|
}, items.map((item) => /* @__PURE__ */ React4.createElement(StackSection, {
|
|
279
284
|
key: item.id,
|
|
280
285
|
...item
|
|
281
|
-
})))))
|
|
286
|
+
})))));
|
|
282
287
|
};
|
|
283
288
|
|
|
284
289
|
// src/containers/StackContainer/index.ts
|
|
@@ -286,4 +291,4 @@ var StackContainer_default = StackContainer;
|
|
|
286
291
|
export {
|
|
287
292
|
StackContainer_default as default
|
|
288
293
|
};
|
|
289
|
-
//# sourceMappingURL=StackContainer-
|
|
294
|
+
//# sourceMappingURL=StackContainer-OLHE5F4E.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/StackContainer/StackContainer.tsx", "../../../src/components/StackContext/StackContext.tsx", "../../../src/components/StackSection/StackSection.tsx", "../../../src/components/StackSection/CaretDownUp.tsx", "../../../src/components/StackSettings/StackSettings.tsx", "../../../src/containers/StackContainer/index.ts"],
|
|
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 { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { 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/types';\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 = SurfaceComponentProps<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 allMetadata = useCapabilities(AppCapabilities.Metadata);\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 metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\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-article overflow-hidden border-l border-r border-subdued-separator'>\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: 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", "//\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 { 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, textBlockWidth } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { type StackSectionItem } from '../../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from '../StackContext';\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} size={5} 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' size={5} />\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' size={5} />\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' size={5} />\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' size={5} />\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 role='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', textBlockWidth)}>{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 } 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 <Settings.Root>\n <Settings.Section title={t('settings title', { ns: meta.id })}>\n <Settings.Group>\n <Settings.ItemInput title={t('settings separation label')}>\n <Input.Switch\n checked={settings.separation}\n onCheckedChange={(checked) => (settings.separation = !!checked)}\n />\n </Settings.ItemInput>\n </Settings.Group>\n </Settings.Section>\n </Settings.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackContainer } from './StackContainer';\n\nexport default StackContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,MAAMC,oBAAoB;AACnC,YAAYC,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,iBAAiBC,uBAAuB;AAEjD,SAASC,mBAAmB;AAC5B,SAASC,WAAqB;AAE9B,SAASC,eAAe;AACxB,SAASC,aAAa;AACtB,SAASC,sBAAsB;A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IACF,CAAA;EACF,GACA;IAACA;IAAYc;GAAc;AAG7B,QAAMoD,iBAAiBf,YACrB,OAAO9B,OAAAA;AACL,UAAMP,cAAc+C,gBAAgBM,MAAM;MAAEtD,SAAS;QAACQ;;IAAI,CAAA;EAC5D,GACA;IAACP;GAAc;AAGjB,QAAMsD,iBAAiBjB,YACrB,CAAC9B,IAAYkB,cAAuBZ,qBAAqB,CAAC0C,UAAU;IAAE,GAAGA;IAAM,CAAChD,EAAAA,GAAKkB;EAAU,EAAA,GAC/F,CAAA,CAAE;AAGJ,QAAM+B,mBAAmBnB,YACvB,MACErC,cAAc2C,eAAec,kBAAkB;IAC7ClB,QAAQrD;IACRwE,WAAW;EACb,CAAA,GACF;IAACxE;IAAYc;GAAc;AAG7B,SACE,gBAAA2D,OAAA,cAACC,WAAUC,SAAO;IAACC,SAAAA;IAAQC,YAAW;KACpC,gBAAAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;IACjBC,MAAK;IACLC,UAAAA;IACAjC,OAAM;IACNkC,eAAY;IACZC,SAASd;OAGb,gBAAAG,OAAA,cAACY,aAAaC,UAAQ;IACpBC,OAAO;MACL3E;MACA4E,YAAYpB;MACZqB,YAAYvB;MACZwB,UAAUxC;MACVyC,OAAOhC;IACT;KAEA,gBAAAc,OAAA,cAACmB,OAAAA;IACCC,aAAY;IACZC,MAAK;IACLzE,IAAIe,IAAII,OAAOxC,UAAAA,EAAYyC,SAAQ;IACnC0C,eAAY;IACZN,YAAW;KAEV9C,MAAMzB,IAAI,CAACyF,SACV,gBAAAtB,OAAA,cAACuB,cAAAA;IAAaC,KAAKF,KAAK1E;IAAK,GAAG0E;;AAM5C;;;AKpKA,IAAA,yBAAeG;",
|
|
6
|
+
"names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "AtomObj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "attendableId", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "textBlockWidth", "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", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "limit", "placeholder", "h2", "mx", "textBlockWidth", "React", "Input", "useTranslation", "Settings", "collectionObjectsFamily", "Atom", "family", "collection", "make", "get", "snapshot", "AtomObj", "objects", "map", "ref", "makeWithReactive", "filter", "isNonNullable", "StackContainer", "attendableId", "subject", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "id", "allMetadata", "useCapabilities", "AppCapabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "collectionObjects", "useAtomValue", "items", "object", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "getDXN", "toString", "title", "toLocalizedString", "Graph", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "target", "findIndex", "section", "isObject", "SpaceOperation", "RemoveObjects", "handleAdd", "position", "LayoutOperation", "UpdateDialog", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key", "StackContainer"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/meta.ts
|
|
2
2
|
import { trim } from "@dxos/util";
|
|
3
|
-
var SECTION_IDENTIFIER = "dxos.
|
|
3
|
+
var SECTION_IDENTIFIER = "org.dxos.type.stack-section";
|
|
4
4
|
var meta = {
|
|
5
|
-
id: "dxos.
|
|
5
|
+
id: "org.dxos.plugin.stack",
|
|
6
6
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
7
7
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
8
8
|
name: "Collections",
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
SECTION_IDENTIFIER,
|
|
19
19
|
meta
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-G4CLPE5A.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.stack-section';\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,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -16,7 +16,7 @@ var StackViewType = Schema.Struct({
|
|
|
16
16
|
value: SectionSchema
|
|
17
17
|
})
|
|
18
18
|
}).pipe(Type.object({
|
|
19
|
-
typename: "dxos.
|
|
19
|
+
typename: "org.dxos.type.stack-view",
|
|
20
20
|
version: "0.1.0"
|
|
21
21
|
}));
|
|
22
22
|
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
SectionSchema,
|
|
25
25
|
StackViewType
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-YPQYUBQP.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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: 'dxos.
|
|
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.stack-view',\n version: '0.1.0',\n }),\n);\n\nexport interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}\n"],
|
|
5
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,KACDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
6
|
"names": ["Schema", "Type", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "sections", "pipe", "Type", "object", "typename", "version"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StackViewType
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YPQYUBQP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SECTION_IDENTIFIER,
|
|
6
6
|
meta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G4CLPE5A.mjs";
|
|
8
8
|
|
|
9
9
|
// src/StackPlugin.ts
|
|
10
10
|
import { Plugin } from "@dxos/app-framework";
|
|
@@ -12,7 +12,7 @@ import { AppPlugin } from "@dxos/app-toolkit";
|
|
|
12
12
|
|
|
13
13
|
// src/capabilities/react-surface/index.ts
|
|
14
14
|
import { Capability } from "@dxos/app-framework";
|
|
15
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-
|
|
15
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-JS4ERDMQ.mjs"));
|
|
16
16
|
|
|
17
17
|
// src/translations.ts
|
|
18
18
|
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":2522,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":2962,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17327,"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/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":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3224,"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":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/index.ts":{"bytes":684,"imports":[{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"}],"format":"esm"},"src/containers/StackContainer/StackContainer.tsx":{"bytes":19926,"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/types","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/util","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/containers/StackContainer/index.ts":{"bytes":676,"imports":[{"path":"src/containers/StackContainer/StackContainer.tsx","kind":"import-statement","original":"./StackContainer"}],"format":"esm"},"src/containers/index.ts":{"bytes":809,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/StackContainer/index.ts","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4498,"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/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/containers/index.ts","kind":"import-statement","original":"../../containers"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":909,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":486,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4451,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3750,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":4334,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4449},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-PVND4UCN.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":797},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":1274}},"bytes":2549},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-CD32XYEB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1761},"dist/lib/browser/chunk-CD32XYEB.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/browser/StackContainer-BIFUBD3Y.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23640},"dist/lib/browser/StackContainer-BIFUBD3Y.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"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/types","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/util","kind":"import-statement","external":true},{"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/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":"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}],"exports":["default"],"entryPoint":"src/containers/StackContainer/index.ts","inputs":{"src/containers/StackContainer/StackContainer.tsx":{"bytesInOutput":4379},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/index.ts":{"bytesInOutput":0},"src/components/StackSection.tsx":{"bytesInOutput":5062},"src/components/CaretDownUp.tsx":{"bytesInOutput":771},"src/components/StackSettings.tsx":{"bytesInOutput":151},"src/containers/StackContainer/index.ts":{"bytesInOutput":45}},"bytes":11150},"dist/lib/browser/react-surface-PVND4UCN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2585},"dist/lib/browser/react-surface-PVND4UCN.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"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/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-BIFUBD3Y.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":790},"src/containers/index.ts":{"bytesInOutput":104}},"bytes":1174},"dist/lib/browser/chunk-4X7CK6FM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1165},"dist/lib/browser/chunk-4X7CK6FM.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":695}},"bytes":796}}}
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":2527,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackContext/StackContext.tsx":{"bytes":1969,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackContext/index.ts":{"bytes":492,"imports":[{"path":"src/components/StackContext/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackSection/CaretDownUp.tsx":{"bytes":2975,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection/StackSection.tsx":{"bytes":18057,"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/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":"src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"src/components/StackSection/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext/index.ts","kind":"import-statement","original":"../StackContext"}],"format":"esm"},"src/components/StackSection/index.ts":{"bytes":492,"imports":[{"path":"src/components/StackSection/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/StackSettings/StackSettings.tsx":{"bytes":3249,"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":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/components/StackSettings/index.ts":{"bytes":498,"imports":[{"path":"src/components/StackSettings/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"}],"format":"esm"},"src/components/index.ts":{"bytes":684,"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":19803,"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/types","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":"src/components/index.ts","kind":"import-statement","original":"../../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/containers/StackContainer/index.ts":{"bytes":676,"imports":[{"path":"src/containers/StackContainer/StackContainer.tsx","kind":"import-statement","original":"./StackContainer"}],"format":"esm"},"src/containers/index.ts":{"bytes":809,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/StackContainer/index.ts","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":3737,"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/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/containers/index.ts","kind":"import-statement","original":"../../containers"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":909,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":486,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4451,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3751,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":4334,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4449},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YPQYUBQP.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-G4CLPE5A.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-JS4ERDMQ.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":797},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":1274}},"bytes":2549},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-YPQYUBQP.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-YPQYUBQP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1762},"dist/lib/browser/chunk-YPQYUBQP.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":576},"src/types/index.ts":{"bytesInOutput":0}},"bytes":688},"dist/lib/browser/StackContainer-OLHE5F4E.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":24045},"dist/lib/browser/StackContainer-OLHE5F4E.mjs":{"imports":[{"path":"dist/lib/browser/chunk-G4CLPE5A.mjs","kind":"import-statement"},{"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/types","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":"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/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":"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}],"exports":["default"],"entryPoint":"src/containers/StackContainer/index.ts","inputs":{"src/containers/StackContainer/StackContainer.tsx":{"bytesInOutput":4303},"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":5249},"src/components/StackSection/CaretDownUp.tsx":{"bytesInOutput":771},"src/components/StackSection/index.ts":{"bytesInOutput":0},"src/components/StackSettings/StackSettings.tsx":{"bytesInOutput":151},"src/components/StackSettings/index.ts":{"bytesInOutput":0},"src/containers/StackContainer/index.ts":{"bytesInOutput":45}},"bytes":11347},"dist/lib/browser/react-surface-JS4ERDMQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2247},"dist/lib/browser/react-surface-JS4ERDMQ.mjs":{"imports":[{"path":"dist/lib/browser/chunk-G4CLPE5A.mjs","kind":"import-statement"},{"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/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-OLHE5F4E.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":754},"src/containers/index.ts":{"bytesInOutput":104}},"bytes":1138},"dist/lib/browser/chunk-G4CLPE5A.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1166},"dist/lib/browser/chunk-G4CLPE5A.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":696}},"bytes":797}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
meta
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G4CLPE5A.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/react-surface/react-surface.tsx
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
@@ -12,17 +12,16 @@ import { Collection } from "@dxos/echo";
|
|
|
12
12
|
|
|
13
13
|
// src/containers/index.ts
|
|
14
14
|
import { lazy } from "react";
|
|
15
|
-
var StackContainer = lazy(() => import("./StackContainer-
|
|
15
|
+
var StackContainer = lazy(() => import("./StackContainer-OLHE5F4E.mjs"));
|
|
16
16
|
|
|
17
17
|
// src/capabilities/react-surface/react-surface.tsx
|
|
18
18
|
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
|
|
19
|
-
id: `${meta.id}
|
|
19
|
+
id: `${meta.id}.article`,
|
|
20
20
|
role: "article",
|
|
21
|
-
filter: (data) => Obj.instanceOf(Collection.Collection, data.subject),
|
|
21
|
+
filter: (data) => typeof data.attendableId === "string" && Obj.instanceOf(Collection.Collection, data.subject),
|
|
22
22
|
component: ({ role, data }) => {
|
|
23
|
-
const id = typeof data.id === "string" ? data.id : void 0;
|
|
24
23
|
return /* @__PURE__ */ React.createElement(StackContainer, {
|
|
25
|
-
|
|
24
|
+
attendableId: data.attendableId,
|
|
26
25
|
role,
|
|
27
26
|
subject: data.subject
|
|
28
27
|
});
|
|
@@ -31,4 +30,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
31
30
|
export {
|
|
32
31
|
react_surface_default as default
|
|
33
32
|
};
|
|
34
|
-
//# sourceMappingURL=react-surface-
|
|
33
|
+
//# sourceMappingURL=react-surface-JS4ERDMQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\n\nimport { StackContainer } from '../../containers';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Capabilities.ReactSurface,\n Surface.create({\n id: `${meta.id}.article`,\n role: 'article',\n filter: (data): data is { attendableId: string; subject: Collection.Collection } =>\n typeof data.attendableId === 'string' && Obj.instanceOf(Collection.Collection, data.subject),\n component: ({ role, data }) => {\n return <StackContainer attendableId={data.attendableId} role={role} subject={data.subject} />;\n },\n }),\n ),\n ),\n);\n", "//\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,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,kBAAkB;;;ACN3B,SAA6BC,YAAY;AAElC,IAAMC,iBAAqCC,KAAK,MAAM,OAAO,+BAAA,CAAA;;;ADSpE,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,aAAaC,cACbC,QAAQC,OAAO;EACbC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;EACNC,QAAQ,CAACC,SACP,OAAOA,KAAKC,iBAAiB,YAAYC,IAAIC,WAAWC,WAAWA,YAAYJ,KAAKK,OAAO;EAC7FC,WAAW,CAAC,EAAER,MAAME,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACO,gBAAAA;MAAeN,cAAcD,KAAKC;MAAcH;MAAYO,SAASL,KAAKK;;EACpF;AACF,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Collection", "lazy", "StackContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "attendableId", "Obj", "instanceOf", "Collection", "subject", "component", "StackContainer"]
|
|
7
|
+
}
|