@dxos/plugin-stack 0.7.4-staging.f7e8224 → 0.7.5-feature-compute.4d9d99a

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 (65) hide show
  1. package/dist/lib/browser/StackMain-VH3YESQL.mjs +295 -0
  2. package/dist/lib/browser/StackMain-VH3YESQL.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-DS5KGEJG.mjs → chunk-WTGFKPPQ.mjs} +3 -3
  4. package/dist/lib/browser/chunk-WTGFKPPQ.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +78 -235
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/node/StackMain-USQVAFKL.cjs +309 -0
  9. package/dist/lib/node/StackMain-USQVAFKL.cjs.map +7 -0
  10. package/dist/lib/node/{chunk-PA5PRDM6.cjs → chunk-CZCFFT2J.cjs} +7 -7
  11. package/dist/lib/node/chunk-CZCFFT2J.cjs.map +7 -0
  12. package/dist/lib/node/index.cjs +80 -231
  13. package/dist/lib/node/index.cjs.map +4 -4
  14. package/dist/lib/node/meta.json +1 -1
  15. package/dist/lib/node-esm/StackMain-DW27O56R.mjs +296 -0
  16. package/dist/lib/node-esm/StackMain-DW27O56R.mjs.map +7 -0
  17. package/dist/lib/node-esm/{chunk-JEQMG2E2.mjs → chunk-SJU6TPRI.mjs} +3 -3
  18. package/dist/lib/node-esm/chunk-SJU6TPRI.mjs.map +7 -0
  19. package/dist/lib/node-esm/index.mjs +78 -235
  20. package/dist/lib/node-esm/index.mjs.map +4 -4
  21. package/dist/lib/node-esm/meta.json +1 -1
  22. package/dist/types/src/StackPlugin.d.ts +1 -3
  23. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  24. package/dist/types/src/components/StackMain.d.ts.map +1 -1
  25. package/dist/types/src/components/StackSection.d.ts.map +1 -1
  26. package/dist/types/src/components/index.d.ts +1 -2
  27. package/dist/types/src/components/index.d.ts.map +1 -1
  28. package/dist/types/src/index.d.ts +1 -3
  29. package/dist/types/src/index.d.ts.map +1 -1
  30. package/dist/types/src/meta.d.ts +1 -2
  31. package/dist/types/src/meta.d.ts.map +1 -1
  32. package/dist/types/src/types/stack.d.ts +6 -12
  33. package/dist/types/src/types/stack.d.ts.map +1 -1
  34. package/dist/types/src/types/types.d.ts +2 -17
  35. package/dist/types/src/types/types.d.ts.map +1 -1
  36. package/dist/types/tsconfig.tsbuildinfo +1 -0
  37. package/package.json +22 -31
  38. package/src/StackPlugin.tsx +61 -73
  39. package/src/components/StackMain.tsx +66 -76
  40. package/src/components/StackSection.tsx +2 -4
  41. package/src/components/index.ts +0 -1
  42. package/src/index.ts +1 -6
  43. package/src/meta.ts +1 -1
  44. package/src/types/types.ts +2 -31
  45. package/dist/lib/browser/StackMain-4D4J4IRK.mjs +0 -391
  46. package/dist/lib/browser/StackMain-4D4J4IRK.mjs.map +0 -7
  47. package/dist/lib/browser/chunk-DS5KGEJG.mjs.map +0 -7
  48. package/dist/lib/browser/meta.mjs +0 -11
  49. package/dist/lib/browser/meta.mjs.map +0 -7
  50. package/dist/lib/node/StackMain-V7C55NCF.cjs +0 -403
  51. package/dist/lib/node/StackMain-V7C55NCF.cjs.map +0 -7
  52. package/dist/lib/node/chunk-PA5PRDM6.cjs.map +0 -7
  53. package/dist/lib/node/meta.cjs +0 -32
  54. package/dist/lib/node/meta.cjs.map +0 -7
  55. package/dist/lib/node-esm/StackMain-5I43UWGF.mjs +0 -392
  56. package/dist/lib/node-esm/StackMain-5I43UWGF.mjs.map +0 -7
  57. package/dist/lib/node-esm/chunk-JEQMG2E2.mjs.map +0 -7
  58. package/dist/lib/node-esm/meta.mjs +0 -12
  59. package/dist/lib/node-esm/meta.mjs.map +0 -7
  60. package/dist/types/src/components/AddSection.d.ts +0 -6
  61. package/dist/types/src/components/AddSection.d.ts.map +0 -1
  62. package/dist/types/src/components/AddSectionDialog.d.ts +0 -14
  63. package/dist/types/src/components/AddSectionDialog.d.ts.map +0 -1
  64. package/src/components/AddSection.tsx +0 -102
  65. package/src/components/AddSectionDialog.tsx +0 -128
@@ -0,0 +1,309 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var StackMain_USQVAFKL_exports = {};
30
+ __export(StackMain_USQVAFKL_exports, {
31
+ default: () => StackMain_default
32
+ });
33
+ module.exports = __toCommonJS(StackMain_USQVAFKL_exports);
34
+ var import_chunk_CZCFFT2J = require("./chunk-CZCFFT2J.cjs");
35
+ var import_chunk_6IPBX635 = require("./chunk-6IPBX635.cjs");
36
+ var import_react = require("@phosphor-icons/react");
37
+ var import_react2 = __toESM(require("react"));
38
+ var import_app_framework = require("@dxos/app-framework");
39
+ var import_echo = require("@dxos/client/echo");
40
+ var import_plugin_graph = require("@dxos/plugin-graph");
41
+ var import_types = require("@dxos/plugin-space/types");
42
+ var import_react_ui = require("@dxos/react-ui");
43
+ var import_react_ui_attention = require("@dxos/react-ui-attention");
44
+ var import_react_ui_stack = require("@dxos/react-ui-stack");
45
+ var import_util = require("@dxos/util");
46
+ var import_react3 = require("react");
47
+ var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
48
+ var import_react4 = __toESM(require("react"));
49
+ var import_app_framework2 = require("@dxos/app-framework");
50
+ var import_react_ui2 = require("@dxos/react-ui");
51
+ var import_react_ui_attention2 = require("@dxos/react-ui-attention");
52
+ var import_react_ui_stack2 = require("@dxos/react-ui-stack");
53
+ var import_react_ui_theme = require("@dxos/react-ui-theme");
54
+ var import_react5 = __toESM(require("react"));
55
+ var StackContext = /* @__PURE__ */ (0, import_react3.createContext)({
56
+ onCollapse: () => {
57
+ },
58
+ onNavigate: async () => {
59
+ },
60
+ onDelete: async () => {
61
+ },
62
+ onAdd: () => {
63
+ }
64
+ });
65
+ var useStack = () => (0, import_react3.useContext)(StackContext);
66
+ var CaretDownUp = ({ children, ...props }) => {
67
+ return /* @__PURE__ */ import_react5.default.createElement("svg", {
68
+ xmlns: "http://www.w3.org/2000/svg",
69
+ viewBox: "0 0 256 256",
70
+ ...props
71
+ }, /* @__PURE__ */ import_react5.default.createElement("rect", {
72
+ width: "256",
73
+ height: "256",
74
+ fill: "none"
75
+ }), /* @__PURE__ */ import_react5.default.createElement("polyline", {
76
+ points: "80 224 128 176 176 224",
77
+ fill: "none",
78
+ stroke: "currentColor",
79
+ strokeLinecap: "round",
80
+ strokeLinejoin: "round",
81
+ strokeWidth: "16"
82
+ }), /* @__PURE__ */ import_react5.default.createElement("polyline", {
83
+ points: "80 32 128 80 176 32",
84
+ fill: "none",
85
+ stroke: "currentColor",
86
+ strokeLinecap: "round",
87
+ strokeLinejoin: "round",
88
+ strokeWidth: "16"
89
+ }), children);
90
+ };
91
+ var sectionActionDimensions = "m-1 p-1 shrink-0 min-bs-0 is-[--rail-action] bs-min";
92
+ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
93
+ const { t } = (0, import_react_ui2.useTranslation)(import_chunk_CZCFFT2J.STACK_PLUGIN);
94
+ const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
95
+ const [optionsMenuOpen, setOptionsMenuOpen] = (0, import_react4.useState)(false);
96
+ const attendableAttrs = (0, import_react_ui_attention2.useAttendableAttributes)(id);
97
+ return /* @__PURE__ */ import_react4.default.createElement(CollapsiblePrimitive.Root, {
98
+ asChild: true,
99
+ open: !view.collapsed,
100
+ onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
101
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui_stack2.StackItem.Root, {
102
+ item: {
103
+ id
104
+ },
105
+ role: "section",
106
+ ...attendableAttrs,
107
+ classNames: "border-be border-separator"
108
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui_stack2.StackItem.Heading, {
109
+ classNames: "attention-surface border-ie !border-separator"
110
+ }, /* @__PURE__ */ import_react4.default.createElement("span", {
111
+ className: "sr-only"
112
+ }, view.title), /* @__PURE__ */ import_react4.default.createElement("div", {
113
+ role: "none",
114
+ className: "sticky -block-start-px bg-[--sticky-bg]"
115
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Root, {
116
+ open: optionsMenuOpen,
117
+ onOpenChange: setOptionsMenuOpen
118
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Trigger, {
119
+ asChild: true
120
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui_stack2.StackItem.SigilButton, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Icon, {
121
+ icon,
122
+ size: 5,
123
+ classNames: "transition-opacity"
124
+ }))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Portal, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Content, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Viewport, null, view.collapsed ? /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Item, {
125
+ onClick: () => onNavigate(id),
126
+ "data-testid": "section.navigate-to"
127
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Icon, {
128
+ icon: "ph--arrow-square-out--regular",
129
+ size: 5
130
+ }), /* @__PURE__ */ import_react4.default.createElement("span", {
131
+ className: "mis-2 grow"
132
+ }, t("navigate to section label"))) : /* @__PURE__ */ import_react4.default.createElement(CollapsiblePrimitive.Trigger, {
133
+ asChild: true
134
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Item, null, /* @__PURE__ */ import_react4.default.createElement(CaretDownUp, {
135
+ className: (0, import_react_ui_theme.getSize)(5)
136
+ }), /* @__PURE__ */ import_react4.default.createElement("span", {
137
+ className: "mis-2 grow"
138
+ }, t("collapse label")))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Item, {
139
+ onClick: () => onAdd(id, "before"),
140
+ "data-testid": "section.add-before"
141
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Icon, {
142
+ icon: "ph--arrow-line-up--regular",
143
+ size: 5
144
+ }), /* @__PURE__ */ import_react4.default.createElement("span", {
145
+ className: "mis-2 grow"
146
+ }, t("add section before label"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Item, {
147
+ onClick: () => onAdd(id, "after"),
148
+ "data-testid": "section.add-after"
149
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Icon, {
150
+ icon: "ph--arrow-line-down--regular",
151
+ size: 5
152
+ }), /* @__PURE__ */ import_react4.default.createElement("span", {
153
+ className: "mis-2 grow"
154
+ }, t("add section after label"))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Item, {
155
+ onClick: () => onDelete(id),
156
+ "data-testid": "section.remove"
157
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Icon, {
158
+ icon: "ph--trash--regular",
159
+ size: 5
160
+ }), /* @__PURE__ */ import_react4.default.createElement("span", {
161
+ className: "mis-2 grow"
162
+ }, t("remove section label")))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ import_react4.default.createElement(CollapsiblePrimitive.Trigger, {
163
+ asChild: true
164
+ }, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.IconButton, {
165
+ iconOnly: true,
166
+ variant: "ghost",
167
+ label: t("expand label"),
168
+ icon: "ph--caret-up-down--regular",
169
+ classNames: sectionActionDimensions
170
+ })) : /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.IconButton, {
171
+ iconOnly: true,
172
+ variant: "ghost",
173
+ onClick: () => onNavigate(id),
174
+ label: t("navigate to section label"),
175
+ icon: "ph--arrow-square-out--regular",
176
+ "data-testid": "section.navigate-to",
177
+ classNames: sectionActionDimensions
178
+ }))), /* @__PURE__ */ import_react4.default.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ import_react4.default.createElement(import_app_framework2.Surface, {
179
+ role: "section",
180
+ data: {
181
+ subject: object
182
+ },
183
+ limit: 1,
184
+ placeholder: /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null)
185
+ })), view.collapsed && /* @__PURE__ */ import_react4.default.createElement(import_react_ui_stack2.StackItem.Content, {
186
+ toolbar: false,
187
+ classNames: "attention-surface"
188
+ }, /* @__PURE__ */ import_react4.default.createElement("h2", {
189
+ className: (0, import_react_ui_theme.mx)("flex items-center p-4 font-medium is-full", import_react_ui_theme.textBlockWidth)
190
+ }, view.title))));
191
+ };
192
+ var StackMain = ({ id, collection }) => {
193
+ const { dispatchPromise: dispatch } = (0, import_app_framework.useIntentDispatcher)();
194
+ const { graph } = (0, import_plugin_graph.useGraph)();
195
+ const { t } = (0, import_react_ui.useTranslation)(import_chunk_CZCFFT2J.STACK_PLUGIN);
196
+ const allMetadata = (0, import_app_framework.useCapabilities)(import_app_framework.Capabilities.Metadata);
197
+ const defaultStack = (0, import_react2.useMemo)(() => (0, import_echo.create)(import_chunk_6IPBX635.StackViewType, {
198
+ sections: {}
199
+ }), [
200
+ collection
201
+ ]);
202
+ const stack = collection.views[import_chunk_6IPBX635.StackViewType.typename]?.target ?? defaultStack;
203
+ const [collapsedSections, setCollapsedSections] = (0, import_react2.useState)({});
204
+ (0, import_react2.useEffect)(() => {
205
+ if (!collection.views[import_chunk_6IPBX635.StackViewType.typename]) {
206
+ collection.views[import_chunk_6IPBX635.StackViewType.typename] = (0, import_echo.makeRef)(stack);
207
+ }
208
+ }, [
209
+ collection,
210
+ stack
211
+ ]);
212
+ const items = collection.objects.map((object) => object.target).filter(import_util.nonNullable).map((object) => {
213
+ const metadata = allMetadata.find((m) => m.id === ((0, import_echo.getType)(object)?.objectId ?? "never"))?.metadata;
214
+ const view = {
215
+ ...stack.sections[object.id],
216
+ collapsed: collapsedSections[(0, import_echo.fullyQualifiedId)(object)],
217
+ title: object?.title ?? (0, import_react_ui.toLocalizedString)(graph.findNode((0, import_echo.fullyQualifiedId)(object))?.properties.label, t)
218
+ };
219
+ return {
220
+ id: (0, import_echo.fullyQualifiedId)(object),
221
+ object,
222
+ metadata,
223
+ view
224
+ };
225
+ }) ?? [];
226
+ const handleDelete = (0, import_react2.useCallback)(async (id2) => {
227
+ const index = collection.objects.map((object2) => object2.target).filter(import_util.nonNullable).findIndex((section) => (0, import_echo.fullyQualifiedId)(section) === id2);
228
+ const object = collection.objects[index].target;
229
+ if ((0, import_echo.isReactiveObject)(object)) {
230
+ await dispatch((0, import_app_framework.createIntent)(import_types.SpaceAction.RemoveObjects, {
231
+ objects: [
232
+ object
233
+ ],
234
+ target: collection
235
+ }));
236
+ }
237
+ }, [
238
+ collection,
239
+ dispatch
240
+ ]);
241
+ const handleAdd = (0, import_react2.useCallback)(async (id2, position) => {
242
+ await dispatch?.((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.SetLayout, {
243
+ element: "dialog",
244
+ component: `${import_chunk_CZCFFT2J.STACK_PLUGIN}/AddSectionDialog`,
245
+ subject: {
246
+ path: id2,
247
+ position,
248
+ collection
249
+ }
250
+ }));
251
+ }, [
252
+ collection,
253
+ dispatch
254
+ ]);
255
+ const handleNavigate = (0, import_react2.useCallback)(async (id2) => {
256
+ await dispatch((0, import_app_framework.createIntent)(import_app_framework.NavigationAction.Open, {
257
+ activeParts: {
258
+ main: [
259
+ id2
260
+ ]
261
+ }
262
+ }));
263
+ await dispatch((0, import_app_framework.createIntent)(import_app_framework.LayoutAction.ScrollIntoView, {
264
+ id: id2
265
+ }));
266
+ }, [
267
+ dispatch
268
+ ]);
269
+ const handleCollapse = (0, import_react2.useCallback)((id2, collapsed) => setCollapsedSections((prev) => ({
270
+ ...prev,
271
+ [id2]: collapsed
272
+ })), []);
273
+ const handleAddSection = (0, import_react2.useCallback)(() => dispatch?.((0, import_app_framework.createIntent)(import_types.SpaceAction.OpenCreateObject, {
274
+ target: collection,
275
+ navigable: false
276
+ })), [
277
+ collection,
278
+ dispatch
279
+ ]);
280
+ return /* @__PURE__ */ import_react2.default.createElement(import_react_ui_attention.AttentionProvider, {
281
+ id
282
+ }, /* @__PURE__ */ import_react2.default.createElement(StackContext.Provider, {
283
+ value: {
284
+ onCollapse: handleCollapse,
285
+ onNavigate: handleNavigate,
286
+ onDelete: handleDelete,
287
+ onAdd: handleAdd
288
+ }
289
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui_stack.Stack, {
290
+ orientation: "vertical",
291
+ size: "intrinsic",
292
+ id,
293
+ "data-testid": "main.stack"
294
+ }, items.map((item) => /* @__PURE__ */ import_react2.default.createElement(StackSection, {
295
+ key: item.id,
296
+ ...item
297
+ }))), /* @__PURE__ */ import_react2.default.createElement("div", {
298
+ role: "none",
299
+ className: "flex mlb-2 pli-2 justify-center"
300
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Button, {
301
+ "data-testid": "stack.createSection",
302
+ classNames: "gap-2",
303
+ onClick: handleAddSection
304
+ }, /* @__PURE__ */ import_react2.default.createElement(import_react.Plus, null), /* @__PURE__ */ import_react2.default.createElement("span", {
305
+ className: "sr-only"
306
+ }, t("add section label"))))));
307
+ };
308
+ var StackMain_default = StackMain;
309
+ //# sourceMappingURL=StackMain-USQVAFKL.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/StackMain.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plus } from '@phosphor-icons/react';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport {\n Capabilities,\n createIntent,\n LayoutAction,\n NavigationAction,\n useCapabilities,\n useIntentDispatcher,\n} from '@dxos/app-framework';\nimport { create, getType, fullyQualifiedId, isReactiveObject, makeRef } from '@dxos/client/echo';\nimport { useGraph } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { Button, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack } from '@dxos/react-ui-stack';\nimport { nonNullable } from '@dxos/util';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\nimport { STACK_PLUGIN } from '../meta';\nimport {\n StackViewType,\n type CollapsedSections,\n type StackSectionMetadata,\n type StackSectionView,\n type StackSectionItem,\n type AddSectionPosition,\n} from '../types';\n\ntype StackMainProps = {\n id: string;\n collection: CollectionType;\n};\n\nconst StackMain = ({ id, collection }: StackMainProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const { graph } = useGraph();\n const { t } = useTranslation(STACK_PLUGIN);\n const allMetadata = useCapabilities(Capabilities.Metadata);\n const defaultStack = useMemo(() => create(StackViewType, { sections: {} }), [collection]);\n const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n useEffect(() => {\n if (!collection.views[StackViewType.typename]) {\n collection.views[StackViewType.typename] = makeRef(stack);\n }\n }, [collection, stack]);\n\n const items =\n collection.objects\n // TODO(wittjosiah): Should the database handle this differently?\n // TODO(wittjosiah): Render placeholders for missing objects so they can be removed from the stack?\n .map((object) => object.target)\n .filter(nonNullable)\n .map((object) => {\n const metadata = allMetadata.find((m) => m.id === (getType(object)?.objectId ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n ...stack.sections[object.id],\n collapsed: collapsedSections[fullyQualifiedId(object)],\n title:\n (object as any)?.title ?? toLocalizedString(graph.findNode(fullyQualifiedId(object))?.properties.label, t),\n } as StackSectionView;\n return { id: fullyQualifiedId(object), object, metadata, view } satisfies StackSectionItem;\n }) ?? [];\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(nonNullable)\n .findIndex((section) => fullyQualifiedId(section) === id);\n const object = collection.objects[index].target;\n if (isReactiveObject(object)) {\n await dispatch(createIntent(SpaceAction.RemoveObjects, { objects: [object], target: collection }));\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, dispatch],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n await dispatch?.(\n createIntent(LayoutAction.SetLayout, {\n element: 'dialog',\n component: `${STACK_PLUGIN}/AddSectionDialog`,\n subject: { path: id, position, collection },\n }),\n );\n },\n [collection, dispatch],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await dispatch(createIntent(NavigationAction.Open, { activeParts: { main: [id] } }));\n await dispatch(createIntent(LayoutAction.ScrollIntoView, { id }));\n },\n [dispatch],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () => dispatch?.(createIntent(SpaceAction.OpenCreateObject, { target: collection, navigable: false })),\n [collection, dispatch],\n );\n\n return (\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'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n\n <div role='none' className='flex mlb-2 pli-2 justify-center'>\n <Button data-testid='stack.createSection' classNames='gap-2' onClick={handleAddSection}>\n <Plus />\n <span className='sr-only'>{t('add section label')}</span>\n </Button>\n </div>\n </StackContext.Provider>\n </AttentionProvider>\n );\n};\n\nexport default StackMain;\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, { useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { DropdownMenu, Icon, useTranslation, IconButton } from '@dxos/react-ui';\nimport { useAttendableAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx, getSize, textBlockWidth } from '@dxos/react-ui-theme';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSectionItem } from '../types';\n\nconst sectionActionDimensions = 'm-1 p-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionItem) => {\n const { t } = useTranslation(STACK_PLUGIN);\n const { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attendableAttrs = useAttendableAttributes(id);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={{ id }} role='section' {...attendableAttrs} classNames='border-be border-separator'>\n <StackItem.Heading classNames='attention-surface border-ie !border-separator'>\n <span className='sr-only'>{view.title}</span>\n <div role='none' className='sticky -block-start-px bg-[--sticky-bg]'>\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-square-out--regular' size={5} />\n <span className='mis-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='mis-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='mis-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='mis-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='mis-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-square-out--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </div>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content toolbar={false} classNames='attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium is-full', 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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqB;AACrB,IAAAA,gBAAiE;AAEjE,2BAOO;AACP,kBAA6E;AAC7E,0BAAyB;AACzB,mBAA4B;AAE5B,sBAA0D;AAC1D,gCAAkC;AAClC,4BAAsB;AACtB,kBAA4B;AClB5B,IAAAA,gBAA0C;ACA1C,2BAAsC;AACtC,IAAAA,gBAAgC;AAEhC,IAAAC,wBAAwB;AACxB,IAAAC,mBAA+D;AAC/D,IAAAC,6BAAwC;AACxC,IAAAC,yBAA0B;AAC1B,4BAA4C;ACP5C,IAAAJ,gBAAqD;AFW9C,IAAMK,eAAeC,iDAAiC;EAC3DC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMC,WAAW,UAAMC,0BAAWP,YAAAA;AEhBlC,IAAMQ,cAAc,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAAwC;AACjF,SACE,8BAAAC,QAAA,cAACC,OAAAA;IAAIC,OAAM;IAA6BC,SAAQ;IAAe,GAAGJ;KAChE,8BAAAC,QAAA,cAACI,QAAAA;IAAKC,OAAM;IAAMC,QAAO;IAAMC,MAAK;MACpC,8BAAAP,QAAA,cAACQ,YAAAA;IACCC,QAAO;IACPF,MAAK;IACLG,QAAO;IACPC,eAAc;IACdC,gBAAe;IACfC,aAAY;MAEd,8BAAAb,QAAA,cAACQ,YAAAA;IACCC,QAAO;IACPF,MAAK;IACLG,QAAO;IACPC,eAAc;IACdC,gBAAe;IACfC,aAAY;MAEbf,QAAAA;AAGP;ADXA,IAAMgB,0BAA0B;AAEzB,IAAMC,eAAe,CAAC,EAC3BC,IACAC,MACAC,QACAC,UAAU,EAAEC,OAAO,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AC2C,OAAAA;IAAIN,MAAK;IAAOI,WAAU;KACzBzC,8BAAAA,QAAA,cAAC4I,wBAAAA;IAAOtF,eAAY;IAAsBhB,YAAW;IAAQe,SAAS8E;KACpEnI,8BAAAA,QAAA,cAAC6I,mBAAAA,IAAAA,GACD7I,8BAAAA,QAAA,cAACwC,QAAAA;IAAKC,WAAU;KAAWpB,EAAE,mBAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAMzC;AAEA,IAAA,oBAAeiD;",
6
+ "names": ["import_react", "import_app_framework", "import_react_ui", "import_react_ui_attention", "import_react_ui_stack", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CaretDownUp", "children", "props", "React", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "STACK_PLUGIN", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attendableAttrs", "useAttendableAttributes", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "classNames", "Heading", "span", "className", "title", "div", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "data", "subject", "limit", "placeholder", "toolbar", "h2", "mx", "textBlockWidth", "StackMain", "collection", "dispatchPromise", "dispatch", "useIntentDispatcher", "graph", "useGraph", "allMetadata", "useCapabilities", "Capabilities", "Metadata", "defaultStack", "useMemo", "create", "StackViewType", "sections", "stack", "views", "typename", "target", "collapsedSections", "setCollapsedSections", "useEffect", "makeRef", "items", "objects", "map", "filter", "nonNullable", "find", "m", "getType", "objectId", "fullyQualifiedId", "toLocalizedString", "findNode", "properties", "handleDelete", "useCallback", "index", "findIndex", "section", "isReactiveObject", "createIntent", "SpaceAction", "RemoveObjects", "handleAdd", "position", "LayoutAction", "SetLayout", "element", "component", "path", "handleNavigate", "NavigationAction", "Open", "activeParts", "main", "ScrollIntoView", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "AttentionProvider", "Provider", "value", "Stack", "orientation", "key", "Button", "Plus"]
7
+ }
@@ -16,16 +16,16 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_PA5PRDM6_exports = {};
20
- __export(chunk_PA5PRDM6_exports, {
19
+ var chunk_CZCFFT2J_exports = {};
20
+ __export(chunk_CZCFFT2J_exports, {
21
21
  SECTION_IDENTIFIER: () => SECTION_IDENTIFIER,
22
22
  STACK_PLUGIN: () => STACK_PLUGIN,
23
- meta_default: () => meta_default
23
+ meta: () => meta
24
24
  });
25
- module.exports = __toCommonJS(chunk_PA5PRDM6_exports);
25
+ module.exports = __toCommonJS(chunk_CZCFFT2J_exports);
26
26
  var STACK_PLUGIN = "dxos.org/plugin/stack";
27
27
  var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
28
- var meta_default = {
28
+ var meta = {
29
29
  id: STACK_PLUGIN,
30
30
  // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
31
31
  // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
@@ -38,6 +38,6 @@ var meta_default = {
38
38
  0 && (module.exports = {
39
39
  SECTION_IDENTIFIER,
40
40
  STACK_PLUGIN,
41
- meta_default
41
+ meta
42
42
  });
43
- //# sourceMappingURL=chunk-PA5PRDM6.cjs.map
43
+ //# sourceMappingURL=chunk-CZCFFT2J.cjs.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 PluginMeta } from '@dxos/app-framework';\n\nexport const STACK_PLUGIN = 'dxos.org/plugin/stack';\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta = {\n id: STACK_PLUGIN,\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: 'View collections of objects within the deck.',\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAMO,IAAMA,eAAe;AACrB,IAAMC,qBAAqB;AAE3B,IAAMC,OAAO;EAClBC,IAAIH;;;EAGJI,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;AACV;",
6
+ "names": ["STACK_PLUGIN", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "icon", "source"]
7
+ }