@dxos/plugin-stack 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51

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.
Files changed (82) hide show
  1. package/dist/lib/browser/index.mjs +21 -47
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +37 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/lib/browser/types/index.mjs +21 -4
  7. package/dist/lib/browser/types/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/index.mjs +22 -47
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/lib/node-esm/translations.mjs +39 -0
  12. package/dist/lib/node-esm/translations.mjs.map +7 -0
  13. package/dist/lib/node-esm/types/index.mjs +22 -4
  14. package/dist/lib/node-esm/types/index.mjs.map +4 -4
  15. package/dist/types/src/capabilities/index.d.ts +2 -1
  16. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  18. package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
  19. package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
  20. package/dist/types/src/components/StackContext/index.d.ts +2 -0
  21. package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
  22. package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
  23. package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
  24. package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
  25. package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
  26. package/dist/types/src/components/StackSection/index.d.ts +2 -0
  27. package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
  28. package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
  29. package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
  30. package/dist/types/src/components/StackSettings/index.d.ts +2 -0
  31. package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
  32. package/dist/types/src/containers/StackContainer/StackContainer.d.ts +3 -5
  33. package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -1
  34. package/dist/types/src/containers/StackContainer/index.d.ts +1 -2
  35. package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -1
  36. package/dist/types/src/meta.d.ts +1 -1
  37. package/dist/types/src/translations.d.ts +30 -30
  38. package/dist/types/src/translations.d.ts.map +1 -1
  39. package/dist/types/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +43 -36
  41. package/src/StackPlugin.ts +4 -4
  42. package/src/capabilities/index.ts +3 -1
  43. package/src/capabilities/react-surface.tsx +28 -0
  44. package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
  45. package/src/components/StackContext/index.ts +5 -0
  46. package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +23 -20
  47. package/src/components/StackSection/index.ts +5 -0
  48. package/src/components/StackSettings/StackSettings.tsx +28 -0
  49. package/src/components/StackSettings/index.ts +5 -0
  50. package/src/containers/StackContainer/StackContainer.tsx +29 -28
  51. package/src/containers/StackContainer/index.ts +1 -3
  52. package/src/meta.ts +2 -2
  53. package/src/translations.ts +23 -22
  54. package/src/types/stack.ts +1 -1
  55. package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs +0 -289
  56. package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs.map +0 -7
  57. package/dist/lib/browser/chunk-4X7CK6FM.mjs +0 -21
  58. package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +0 -7
  59. package/dist/lib/browser/chunk-CD32XYEB.mjs +0 -27
  60. package/dist/lib/browser/chunk-CD32XYEB.mjs.map +0 -7
  61. package/dist/lib/browser/react-surface-PVND4UCN.mjs +0 -34
  62. package/dist/lib/browser/react-surface-PVND4UCN.mjs.map +0 -7
  63. package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs +0 -290
  64. package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs.map +0 -7
  65. package/dist/lib/node-esm/chunk-26XWE7UY.mjs +0 -29
  66. package/dist/lib/node-esm/chunk-26XWE7UY.mjs.map +0 -7
  67. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs +0 -23
  68. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
  69. package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs +0 -35
  70. package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs.map +0 -7
  71. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  72. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  73. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  74. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  75. package/dist/types/src/components/StackContext.d.ts.map +0 -1
  76. package/dist/types/src/components/StackSection.d.ts.map +0 -1
  77. package/dist/types/src/components/StackSettings.d.ts.map +0 -1
  78. package/src/capabilities/react-surface/index.ts +0 -7
  79. package/src/capabilities/react-surface/react-surface.tsx +0 -34
  80. package/src/components/StackSettings.tsx +0 -30
  81. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  82. /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
@@ -1,289 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-4X7CK6FM.mjs";
4
-
5
- // src/containers/StackContainer/StackContainer.tsx
6
- import { Atom, useAtomValue } from "@effect-atom/atom-react";
7
- import * as Option from "effect/Option";
8
- import React4, { useCallback, useState as useState2 } from "react";
9
- import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
10
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
11
- import { useAppGraph } from "@dxos/app-toolkit/ui";
12
- import { Obj } from "@dxos/echo";
13
- import { AtomObj } from "@dxos/echo-atom";
14
- import { Graph } from "@dxos/plugin-graph";
15
- import { SpaceOperation } from "@dxos/plugin-space/types";
16
- import { Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
17
- import { AttentionProvider } from "@dxos/react-ui-attention";
18
- import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
19
- import { isNonNullable } from "@dxos/util";
20
-
21
- // src/components/StackContext.tsx
22
- import { createContext, useContext } from "react";
23
- var StackContext = /* @__PURE__ */ createContext({
24
- onCollapse: () => {
25
- },
26
- onNavigate: async () => {
27
- },
28
- onDelete: async () => {
29
- },
30
- onAdd: () => {
31
- }
32
- });
33
- var useStack = () => useContext(StackContext);
34
-
35
- // src/components/StackSection.tsx
36
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
37
- import React2, { useMemo, useState } from "react";
38
- import { Surface } from "@dxos/app-framework/ui";
39
- import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
40
- import { useAttentionAttributes } from "@dxos/react-ui-attention";
41
- import { StackItem } from "@dxos/react-ui-stack";
42
- import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
43
-
44
- // src/components/CaretDownUp.tsx
45
- import React from "react";
46
- var CaretDownUp = ({ children, ...props }) => {
47
- return /* @__PURE__ */ React.createElement("svg", {
48
- xmlns: "http://www.w3.org/2000/svg",
49
- viewBox: "0 0 256 256",
50
- ...props
51
- }, /* @__PURE__ */ React.createElement("rect", {
52
- width: "256",
53
- height: "256",
54
- fill: "none"
55
- }), /* @__PURE__ */ React.createElement("polyline", {
56
- points: "80 224 128 176 176 224",
57
- fill: "none",
58
- stroke: "currentColor",
59
- strokeLinecap: "round",
60
- strokeLinejoin: "round",
61
- strokeWidth: "16"
62
- }), /* @__PURE__ */ React.createElement("polyline", {
63
- points: "80 32 128 80 176 32",
64
- fill: "none",
65
- stroke: "currentColor",
66
- strokeLinecap: "round",
67
- strokeLinejoin: "round",
68
- strokeWidth: "16"
69
- }), children);
70
- };
71
-
72
- // src/components/StackSection.tsx
73
- var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
74
- var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
75
- const { t } = useTranslation(meta.id);
76
- const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
77
- const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
78
- const attentionAttrs = useAttentionAttributes(id);
79
- const stackItem = useMemo(() => ({
80
- id
81
- }), [
82
- id
83
- ]);
84
- return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
85
- asChild: true,
86
- open: !view.collapsed,
87
- onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
88
- }, /* @__PURE__ */ React2.createElement(StackItem.Root, {
89
- item: stackItem,
90
- role: "section",
91
- ...attentionAttrs
92
- }, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
93
- classNames: "dx-attention-surface"
94
- }, /* @__PURE__ */ React2.createElement("span", {
95
- className: "sr-only"
96
- }, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
97
- open: optionsMenuOpen,
98
- onOpenChange: setOptionsMenuOpen
99
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
100
- asChild: true
101
- }, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
102
- icon,
103
- size: 5,
104
- classNames: "transition-opacity"
105
- }))), /* @__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, {
106
- onClick: () => onNavigate(id),
107
- "data-testid": "section.navigate-to"
108
- }, /* @__PURE__ */ React2.createElement(Icon, {
109
- icon: "ph--arrow-right--regular",
110
- size: 5
111
- }), /* @__PURE__ */ React2.createElement("span", {
112
- className: "ms-2 grow"
113
- }, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
114
- asChild: true
115
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
116
- className: getSize(5)
117
- }), /* @__PURE__ */ React2.createElement("span", {
118
- className: "ms-2 grow"
119
- }, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
120
- onClick: () => onAdd(id, "before"),
121
- "data-testid": "section.add-before"
122
- }, /* @__PURE__ */ React2.createElement(Icon, {
123
- icon: "ph--arrow-line-up--regular",
124
- size: 5
125
- }), /* @__PURE__ */ React2.createElement("span", {
126
- className: "ms-2 grow"
127
- }, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
128
- onClick: () => onAdd(id, "after"),
129
- "data-testid": "section.add-after"
130
- }, /* @__PURE__ */ React2.createElement(Icon, {
131
- icon: "ph--arrow-line-down--regular",
132
- size: 5
133
- }), /* @__PURE__ */ React2.createElement("span", {
134
- className: "ms-2 grow"
135
- }, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
136
- onClick: () => onDelete(id),
137
- "data-testid": "section.remove"
138
- }, /* @__PURE__ */ React2.createElement(Icon, {
139
- icon: "ph--trash--regular",
140
- size: 5
141
- }), /* @__PURE__ */ React2.createElement("span", {
142
- className: "ms-2 grow"
143
- }, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
144
- asChild: true
145
- }, /* @__PURE__ */ React2.createElement(IconButton, {
146
- iconOnly: true,
147
- variant: "ghost",
148
- label: t("expand label"),
149
- icon: "ph--caret-up-down--regular",
150
- classNames: sectionActionDimensions
151
- })) : /* @__PURE__ */ React2.createElement(IconButton, {
152
- iconOnly: true,
153
- variant: "ghost",
154
- onClick: () => onNavigate(id),
155
- label: t("navigate to section label"),
156
- icon: "ph--arrow-right--regular",
157
- "data-testid": "section.navigate-to",
158
- classNames: sectionActionDimensions
159
- }))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
160
- role: "section",
161
- data: {
162
- subject: object
163
- },
164
- limit: 1,
165
- placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
166
- })), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
167
- classNames: "dx-attention-surface"
168
- }, /* @__PURE__ */ React2.createElement("h2", {
169
- className: mx("flex items-center p-4 font-medium", textBlockWidth)
170
- }, view.title))));
171
- };
172
-
173
- // src/components/StackSettings.tsx
174
- import React3 from "react";
175
- import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
176
- import { Settings } from "@dxos/react-ui-form";
177
-
178
- // src/containers/StackContainer/StackContainer.tsx
179
- var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
180
- const snapshot = get(AtomObj.make(collection));
181
- return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
182
- }));
183
- var StackContainer = ({ id, subject: collection }) => {
184
- const { invokePromise } = useOperationInvoker();
185
- const { graph } = useAppGraph();
186
- const { t } = useTranslation3(meta.id);
187
- const allMetadata = useCapabilities(AppCapabilities.Metadata);
188
- const [collapsedSections, setCollapsedSections] = useState2({});
189
- const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
190
- const items = collectionObjects.map((object) => {
191
- const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
192
- const view = {
193
- // ...stack.sections[object.id],
194
- collapsed: collapsedSections[Obj.getDXN(object).toString()],
195
- title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
196
- toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
197
- };
198
- return {
199
- id: Obj.getDXN(object).toString(),
200
- object,
201
- metadata,
202
- view
203
- };
204
- });
205
- const handleDelete = useCallback(async (id2) => {
206
- const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id2);
207
- const object = collection.objects[index].target;
208
- if (Obj.isObject(object)) {
209
- await invokePromise(SpaceOperation.RemoveObjects, {
210
- objects: [
211
- object
212
- ],
213
- target: collection
214
- });
215
- }
216
- }, [
217
- collection,
218
- invokePromise
219
- ]);
220
- const handleAdd = useCallback(async (id2, position) => {
221
- await invokePromise(LayoutOperation.UpdateDialog, {
222
- subject: `${meta.id}/AddSectionDialog`,
223
- blockAlign: "start",
224
- props: {
225
- path: id2,
226
- position,
227
- collection
228
- }
229
- });
230
- }, [
231
- collection,
232
- invokePromise
233
- ]);
234
- const handleNavigate = useCallback(async (id2) => {
235
- await invokePromise(LayoutOperation.Open, {
236
- subject: [
237
- id2
238
- ]
239
- });
240
- }, [
241
- invokePromise
242
- ]);
243
- const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
244
- ...prev,
245
- [id2]: collapsed
246
- })), []);
247
- const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
248
- target: collection,
249
- navigable: false
250
- }), [
251
- collection,
252
- invokePromise
253
- ]);
254
- return /* @__PURE__ */ React4.createElement(StackItem2.Content, {
255
- toolbar: true,
256
- classNames: "dx-article overflow-hidden border-l border-r border-subdued-separator"
257
- }, /* @__PURE__ */ React4.createElement(Toolbar.Root, null, /* @__PURE__ */ React4.createElement(Toolbar.IconButton, {
258
- icon: "ph--plus--regular",
259
- iconOnly: true,
260
- label: "Add section",
261
- "data-testid": "stack.addSection",
262
- onClick: handleAddSection
263
- })), /* @__PURE__ */ React4.createElement(AttentionProvider, {
264
- id
265
- }, /* @__PURE__ */ React4.createElement(StackContext.Provider, {
266
- value: {
267
- onCollapse: handleCollapse,
268
- onNavigate: handleNavigate,
269
- onDelete: handleDelete,
270
- onAdd: handleAdd
271
- }
272
- }, /* @__PURE__ */ React4.createElement(Stack, {
273
- orientation: "vertical",
274
- size: "intrinsic",
275
- id,
276
- "data-testid": "main.stack",
277
- classNames: "overflow-y-auto"
278
- }, items.map((item) => /* @__PURE__ */ React4.createElement(StackSection, {
279
- key: item.id,
280
- ...item
281
- }))))));
282
- };
283
-
284
- // src/containers/StackContainer/index.ts
285
- var StackContainer_default = StackContainer;
286
- export {
287
- StackContainer_default as default
288
- };
289
- //# sourceMappingURL=StackContainer-BIFUBD3Y.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/StackContainer/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx", "../../../src/components/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 { AttentionProvider } from '@dxos/react-ui-attention';\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 id: string;\n};\n\nexport const StackContainer = ({ id, 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 <AttentionProvider id={id}>\n <StackContext.Provider\n value={{\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </AttentionProvider>\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 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 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 { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attentionAttrs = useAttentionAttributes(id);\n const stackItem = useMemo(() => ({ id }), [id]);\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={{ subject: object }} 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,iBAAi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D;QACN+C;QACA3D;MACF;IACF,CAAA;EACF,GACA;IAACA;IAAYc;GAAc;AAG7B,QAAMmD,iBAAiBf,YACrB,OAAOtC,QAAAA;AACL,UAAME,cAAc8C,gBAAgBM,MAAM;MAAErD,SAAS;QAACD;;IAAI,CAAA;EAC5D,GACA;IAACE;GAAc;AAGjB,QAAMqD,iBAAiBjB,YACrB,CAACtC,KAAY0B,cAAuBZ,qBAAqB,CAAC0C,UAAU;IAAE,GAAGA;IAAM,CAACxD,GAAAA,GAAK0B;EAAU,EAAA,GAC/F,CAAA,CAAE;AAGJ,QAAM+B,mBAAmBnB,YACvB,MACEpC,cAAc0C,eAAec,kBAAkB;IAC7ClB,QAAQpD;IACRuE,WAAW;EACb,CAAA,GACF;IAACvE;IAAYc;GAAc;AAG7B,SACE,gBAAA0D,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,mBAAAA;IAAkBxE;KACjB,gBAAA4D,OAAA,cAACa,aAAaC,UAAQ;IACpBC,OAAO;MACLC,YAAYrB;MACZsB,YAAYxB;MACZyB,UAAUzC;MACV0C,OAAOjC;IACT;KAEA,gBAAAc,OAAA,cAACoB,OAAAA;IAAMC,aAAY;IAAWC,MAAK;IAAYlF;IAAQsE,eAAY;IAAaN,YAAW;KACxF9C,MAAMxB,IAAI,CAACyF,SACV,gBAAAvB,OAAA,cAACwB,cAAAA;IAAaC,KAAKF,KAAKnF;IAAK,GAAGmF;;AAO9C;;;AKlKA,IAAA,yBAAeG;",
6
- "names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "AtomObj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "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", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "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", "data", "subject", "limit", "placeholder", "h2", "mx", "textBlockWidth", "React", "Input", "useTranslation", "Settings", "collectionObjectsFamily", "Atom", "family", "collection", "make", "get", "snapshot", "AtomObj", "objects", "map", "ref", "makeWithReactive", "filter", "isNonNullable", "StackContainer", "id", "subject", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "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", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key", "StackContainer"]
7
- }
@@ -1,21 +0,0 @@
1
- // src/meta.ts
2
- import { trim } from "@dxos/util";
3
- var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
4
- var meta = {
5
- id: "dxos.org/plugin/stack",
6
- // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
7
- // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
8
- name: "Collections",
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
- `,
13
- icon: "ph--stack-simple--regular",
14
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
15
- };
16
-
17
- export {
18
- SECTION_IDENTIFIER,
19
- meta
20
- };
21
- //# sourceMappingURL=chunk-4X7CK6FM.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/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
- }
@@ -1,27 +0,0 @@
1
- // src/types/stack.ts
2
- import * as Schema from "effect/Schema";
3
- import { Type } from "@dxos/echo";
4
- var SectionSchema = Schema.Struct({
5
- height: Schema.optional(Schema.Number),
6
- // Space for data that isn't stack-specific but is specific to this view instance.
7
- // e.g. cover/fill for an image
8
- custom: Schema.optional(Schema.Record({
9
- key: Schema.String,
10
- value: Schema.Any
11
- }))
12
- });
13
- var StackViewType = Schema.Struct({
14
- sections: Schema.Record({
15
- key: Schema.String,
16
- value: SectionSchema
17
- })
18
- }).pipe(Type.object({
19
- typename: "dxos.org/type/StackView",
20
- version: "0.1.0"
21
- }));
22
-
23
- export {
24
- SectionSchema,
25
- StackViewType
26
- };
27
- //# sourceMappingURL=chunk-CD32XYEB.mjs.map
@@ -1,7 +0,0 @@
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: 'dxos.org/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,KACDC,KAAKC,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", "Type", "object", "typename", "version"]
7
- }
@@ -1,34 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-4X7CK6FM.mjs";
4
-
5
- // src/capabilities/react-surface/react-surface.tsx
6
- import * as Effect from "effect/Effect";
7
- import React from "react";
8
- import { Capabilities, Capability } from "@dxos/app-framework";
9
- import { Surface } from "@dxos/app-framework/ui";
10
- import { Obj } from "@dxos/echo";
11
- import { Collection } from "@dxos/echo";
12
-
13
- // src/containers/index.ts
14
- import { lazy } from "react";
15
- var StackContainer = lazy(() => import("./StackContainer-BIFUBD3Y.mjs"));
16
-
17
- // src/capabilities/react-surface/react-surface.tsx
18
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
19
- id: `${meta.id}/article`,
20
- role: "article",
21
- filter: (data) => Obj.instanceOf(Collection.Collection, data.subject),
22
- component: ({ role, data }) => {
23
- const id = typeof data.id === "string" ? data.id : void 0;
24
- return /* @__PURE__ */ React.createElement(StackContainer, {
25
- id: id ?? Obj.getDXN(data.subject).toString(),
26
- role,
27
- subject: data.subject
28
- });
29
- }
30
- }))));
31
- export {
32
- react_surface_default as default
33
- };
34
- //# sourceMappingURL=react-surface-PVND4UCN.mjs.map
@@ -1,7 +0,0 @@
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 { id?: string; subject: Collection.Collection } =>\n Obj.instanceOf(Collection.Collection, data.subject),\n component: ({ role, data }) => {\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n return <StackContainer id={id ?? Obj.getDXN(data.subject).toString()} 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,SACPC,IAAIC,WAAWC,WAAWA,YAAYH,KAAKI,OAAO;EACpDC,WAAW,CAAC,EAAEP,MAAME,KAAI,MAAE;AAGxB,UAAMJ,KAAK,OAAOI,KAAKJ,OAAO,WAAWI,KAAKJ,KAAKU;AACnD,WAAO,sBAAA,cAACC,gBAAAA;MAAeX,IAAIA,MAAMK,IAAIO,OAAOR,KAAKI,OAAO,EAAEK,SAAQ;MAAIX;MAAYM,SAASJ,KAAKI;;EAClG;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", "Obj", "instanceOf", "Collection", "subject", "component", "undefined", "StackContainer", "getDXN", "toString"]
7
- }