@dxos/plugin-stack 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
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-FUGH3ZJH.mjs +274 -0
- package/dist/lib/browser/StackContainer-FUGH3ZJH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UIKFKRFJ.mjs → chunk-4X7CK6FM.mjs} +1 -1
- package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NHMDZYOB.mjs → chunk-MZUNZ6A3.mjs} +7 -8
- package/dist/lib/browser/chunk-MZUNZ6A3.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +34 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-HVPK7YZQ.mjs → react-surface-ZEFLABZS.mjs} +12 -11
- package/dist/lib/browser/react-surface-ZEFLABZS.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/StackContainer-PTZGEQFQ.mjs +275 -0
- package/dist/lib/node-esm/StackContainer-PTZGEQFQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZZFA7HIV.mjs → chunk-BHDJHEFJ.mjs} +7 -8
- package/dist/lib/node-esm/chunk-BHDJHEFJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BGVQYUYP.mjs → chunk-HEEGXPSW.mjs} +1 -1
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +34 -50
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-HYSD7AC2.mjs → react-surface-JQOFHBYS.mjs} +12 -11
- package/dist/lib/node-esm/react-surface-JQOFHBYS.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/StackPlugin.d.ts +2 -1
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/StackContainer.d.ts +3 -3
- package/dist/types/src/components/StackContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -1
- package/dist/types/src/types/stack.d.ts +12 -13
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -35
- package/src/StackPlugin.ts +22 -38
- package/src/capabilities/index.ts +1 -3
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +33 -0
- package/src/components/StackContainer.tsx +37 -43
- package/src/components/StackSection.tsx +1 -1
- package/src/meta.ts +2 -2
- package/src/types/stack.ts +10 -6
- package/src/types/types.ts +1 -1
- package/dist/lib/browser/StackContainer-DD3ZD5OE.mjs +0 -299
- package/dist/lib/browser/StackContainer-DD3ZD5OE.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHMDZYOB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UIKFKRFJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HVPK7YZQ.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-JGWPXSUF.mjs +0 -300
- package/dist/lib/node-esm/StackContainer-JGWPXSUF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BGVQYUYP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZZFA7HIV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-HYSD7AC2.mjs.map +0 -7
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/src/capabilities/react-surface.tsx +0 -29
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-4X7CK6FM.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/StackContainer.tsx
|
|
6
|
+
import * as Option from "effect/Option";
|
|
7
|
+
import React3, { useCallback, useState as useState2 } from "react";
|
|
8
|
+
import { Common } from "@dxos/app-framework";
|
|
9
|
+
import { useAppGraph, useCapabilities, useOperationInvoker } from "@dxos/app-framework/react";
|
|
10
|
+
import { Obj } from "@dxos/echo";
|
|
11
|
+
import { Graph } from "@dxos/plugin-graph";
|
|
12
|
+
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
13
|
+
import { Toolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
14
|
+
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
15
|
+
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
16
|
+
import { isNonNullable } from "@dxos/util";
|
|
17
|
+
|
|
18
|
+
// src/components/StackContext.tsx
|
|
19
|
+
import { createContext, useContext } from "react";
|
|
20
|
+
var StackContext = /* @__PURE__ */ createContext({
|
|
21
|
+
onCollapse: () => {
|
|
22
|
+
},
|
|
23
|
+
onNavigate: async () => {
|
|
24
|
+
},
|
|
25
|
+
onDelete: async () => {
|
|
26
|
+
},
|
|
27
|
+
onAdd: () => {
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var useStack = () => useContext(StackContext);
|
|
31
|
+
|
|
32
|
+
// src/components/StackSection.tsx
|
|
33
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
34
|
+
import React2, { useMemo, useState } from "react";
|
|
35
|
+
import { Surface } from "@dxos/app-framework/react";
|
|
36
|
+
import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
37
|
+
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
38
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
39
|
+
import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
|
|
40
|
+
|
|
41
|
+
// src/components/CaretDownUp.tsx
|
|
42
|
+
import React from "react";
|
|
43
|
+
var CaretDownUp = ({ children, ...props }) => {
|
|
44
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
viewBox: "0 0 256 256",
|
|
47
|
+
...props
|
|
48
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
49
|
+
width: "256",
|
|
50
|
+
height: "256",
|
|
51
|
+
fill: "none"
|
|
52
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
53
|
+
points: "80 224 128 176 176 224",
|
|
54
|
+
fill: "none",
|
|
55
|
+
stroke: "currentColor",
|
|
56
|
+
strokeLinecap: "round",
|
|
57
|
+
strokeLinejoin: "round",
|
|
58
|
+
strokeWidth: "16"
|
|
59
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
60
|
+
points: "80 32 128 80 176 32",
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round",
|
|
65
|
+
strokeWidth: "16"
|
|
66
|
+
}), children);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/components/StackSection.tsx
|
|
70
|
+
var sectionActionDimensions = "p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min";
|
|
71
|
+
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
72
|
+
const { t } = useTranslation(meta.id);
|
|
73
|
+
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
74
|
+
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
75
|
+
const attentionAttrs = useAttentionAttributes(id);
|
|
76
|
+
const stackItem = useMemo(() => ({
|
|
77
|
+
id
|
|
78
|
+
}), [
|
|
79
|
+
id
|
|
80
|
+
]);
|
|
81
|
+
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
82
|
+
asChild: true,
|
|
83
|
+
open: !view.collapsed,
|
|
84
|
+
onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
|
|
85
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Root, {
|
|
86
|
+
item: stackItem,
|
|
87
|
+
role: "section",
|
|
88
|
+
...attentionAttrs
|
|
89
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
90
|
+
classNames: "attention-surface"
|
|
91
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
92
|
+
className: "sr-only"
|
|
93
|
+
}, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
|
|
94
|
+
open: optionsMenuOpen,
|
|
95
|
+
onOpenChange: setOptionsMenuOpen
|
|
96
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
|
|
97
|
+
asChild: true
|
|
98
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
99
|
+
icon,
|
|
100
|
+
size: 5,
|
|
101
|
+
classNames: "transition-opacity"
|
|
102
|
+
}))), /* @__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, {
|
|
103
|
+
onClick: () => onNavigate(id),
|
|
104
|
+
"data-testid": "section.navigate-to"
|
|
105
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
106
|
+
icon: "ph--arrow-right--regular",
|
|
107
|
+
size: 5
|
|
108
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
109
|
+
className: "mis-2 grow"
|
|
110
|
+
}, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
111
|
+
asChild: true
|
|
112
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
|
|
113
|
+
className: getSize(5)
|
|
114
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
115
|
+
className: "mis-2 grow"
|
|
116
|
+
}, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
117
|
+
onClick: () => onAdd(id, "before"),
|
|
118
|
+
"data-testid": "section.add-before"
|
|
119
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
120
|
+
icon: "ph--arrow-line-up--regular",
|
|
121
|
+
size: 5
|
|
122
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
123
|
+
className: "mis-2 grow"
|
|
124
|
+
}, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
125
|
+
onClick: () => onAdd(id, "after"),
|
|
126
|
+
"data-testid": "section.add-after"
|
|
127
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
128
|
+
icon: "ph--arrow-line-down--regular",
|
|
129
|
+
size: 5
|
|
130
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
131
|
+
className: "mis-2 grow"
|
|
132
|
+
}, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
133
|
+
onClick: () => onDelete(id),
|
|
134
|
+
"data-testid": "section.remove"
|
|
135
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
136
|
+
icon: "ph--trash--regular",
|
|
137
|
+
size: 5
|
|
138
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
139
|
+
className: "mis-2 grow"
|
|
140
|
+
}, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
141
|
+
asChild: true
|
|
142
|
+
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
143
|
+
iconOnly: true,
|
|
144
|
+
variant: "ghost",
|
|
145
|
+
label: t("expand label"),
|
|
146
|
+
icon: "ph--caret-up-down--regular",
|
|
147
|
+
classNames: sectionActionDimensions
|
|
148
|
+
})) : /* @__PURE__ */ React2.createElement(IconButton, {
|
|
149
|
+
iconOnly: true,
|
|
150
|
+
variant: "ghost",
|
|
151
|
+
onClick: () => onNavigate(id),
|
|
152
|
+
label: t("navigate to section label"),
|
|
153
|
+
icon: "ph--arrow-right--regular",
|
|
154
|
+
"data-testid": "section.navigate-to",
|
|
155
|
+
classNames: sectionActionDimensions
|
|
156
|
+
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface, {
|
|
157
|
+
role: "section",
|
|
158
|
+
data: {
|
|
159
|
+
subject: object
|
|
160
|
+
},
|
|
161
|
+
limit: 1,
|
|
162
|
+
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
163
|
+
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
164
|
+
classNames: "attention-surface"
|
|
165
|
+
}, /* @__PURE__ */ React2.createElement("h2", {
|
|
166
|
+
className: mx("flex items-center p-4 font-medium", textBlockWidth)
|
|
167
|
+
}, view.title))));
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// src/components/StackContainer.tsx
|
|
171
|
+
var StackContainer = ({ id, subject: collection }) => {
|
|
172
|
+
const { invokePromise } = useOperationInvoker();
|
|
173
|
+
const { graph } = useAppGraph();
|
|
174
|
+
const { t } = useTranslation2(meta.id);
|
|
175
|
+
const allMetadata = useCapabilities(Common.Capability.Metadata);
|
|
176
|
+
const [collapsedSections, setCollapsedSections] = useState2({});
|
|
177
|
+
const items = collection.objects.map((object) => object.target).filter(isNonNullable).map((object) => {
|
|
178
|
+
const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
|
|
179
|
+
const view = {
|
|
180
|
+
// ...stack.sections[object.id],
|
|
181
|
+
collapsed: collapsedSections[Obj.getDXN(object).toString()],
|
|
182
|
+
title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
|
|
183
|
+
toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
|
|
184
|
+
};
|
|
185
|
+
return {
|
|
186
|
+
id: Obj.getDXN(object).toString(),
|
|
187
|
+
object,
|
|
188
|
+
metadata,
|
|
189
|
+
view
|
|
190
|
+
};
|
|
191
|
+
}) ?? [];
|
|
192
|
+
const handleDelete = useCallback(async (id2) => {
|
|
193
|
+
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id2);
|
|
194
|
+
const object = collection.objects[index].target;
|
|
195
|
+
if (Obj.isObject(object)) {
|
|
196
|
+
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
197
|
+
objects: [
|
|
198
|
+
object
|
|
199
|
+
],
|
|
200
|
+
target: collection
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}, [
|
|
204
|
+
collection,
|
|
205
|
+
invokePromise
|
|
206
|
+
]);
|
|
207
|
+
const handleAdd = useCallback(async (id2, position) => {
|
|
208
|
+
await invokePromise(Common.LayoutOperation.UpdateDialog, {
|
|
209
|
+
subject: `${meta.id}/AddSectionDialog`,
|
|
210
|
+
blockAlign: "start",
|
|
211
|
+
props: {
|
|
212
|
+
path: id2,
|
|
213
|
+
position,
|
|
214
|
+
collection
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}, [
|
|
218
|
+
collection,
|
|
219
|
+
invokePromise
|
|
220
|
+
]);
|
|
221
|
+
const handleNavigate = useCallback(async (id2) => {
|
|
222
|
+
await invokePromise(Common.LayoutOperation.Open, {
|
|
223
|
+
subject: [
|
|
224
|
+
id2
|
|
225
|
+
]
|
|
226
|
+
});
|
|
227
|
+
}, [
|
|
228
|
+
invokePromise
|
|
229
|
+
]);
|
|
230
|
+
const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
|
|
231
|
+
...prev,
|
|
232
|
+
[id2]: collapsed
|
|
233
|
+
})), []);
|
|
234
|
+
const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
|
|
235
|
+
target: collection,
|
|
236
|
+
navigable: false
|
|
237
|
+
}), [
|
|
238
|
+
collection,
|
|
239
|
+
invokePromise
|
|
240
|
+
]);
|
|
241
|
+
return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
|
|
242
|
+
toolbar: true,
|
|
243
|
+
classNames: "container-max-width overflow-hidden border-l border-r border-subduedSeparator"
|
|
244
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar.Root, null, /* @__PURE__ */ React3.createElement(Toolbar.IconButton, {
|
|
245
|
+
icon: "ph--plus--regular",
|
|
246
|
+
iconOnly: true,
|
|
247
|
+
label: "Add section",
|
|
248
|
+
"data-testid": "stack.addSection",
|
|
249
|
+
onClick: handleAddSection
|
|
250
|
+
})), /* @__PURE__ */ React3.createElement(AttentionProvider, {
|
|
251
|
+
id
|
|
252
|
+
}, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
|
|
253
|
+
value: {
|
|
254
|
+
onCollapse: handleCollapse,
|
|
255
|
+
onNavigate: handleNavigate,
|
|
256
|
+
onDelete: handleDelete,
|
|
257
|
+
onAdd: handleAdd
|
|
258
|
+
}
|
|
259
|
+
}, /* @__PURE__ */ React3.createElement(Stack, {
|
|
260
|
+
orientation: "vertical",
|
|
261
|
+
size: "intrinsic",
|
|
262
|
+
id,
|
|
263
|
+
"data-testid": "main.stack",
|
|
264
|
+
classNames: "overflow-y-auto"
|
|
265
|
+
}, items.map((item) => /* @__PURE__ */ React3.createElement(StackSection, {
|
|
266
|
+
key: item.id,
|
|
267
|
+
...item
|
|
268
|
+
}))))));
|
|
269
|
+
};
|
|
270
|
+
var StackContainer_default = StackContainer;
|
|
271
|
+
export {
|
|
272
|
+
StackContainer_default as default
|
|
273
|
+
};
|
|
274
|
+
//# sourceMappingURL=StackContainer-FUGH3ZJH.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport { Common } from '@dxos/app-framework';\nimport { useAppGraph, useCapabilities, useOperationInvoker } from '@dxos/app-framework/react';\nimport { type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\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 { type Collection } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { meta } from '../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../types';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\n\ntype StackContainerProps = SurfaceComponentProps<Collection.Collection> & {\n id: string;\n};\n\nconst StackContainer = ({ id, subject: collection }: StackContainerProps) => {\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(Common.Capability.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 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(isNonNullable)\n .map((object) => {\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(Common.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(Common.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\n toolbar\n classNames='container-max-width overflow-hidden border-l border-r border-subduedSeparator'\n >\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\nexport default StackContainer;\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/react';\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 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-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='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='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-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\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 classNames='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"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SAASC,cAAc;AACvB,SAASC,aAAaC,iBAAiBC,2BAA2B;AAElE,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,SAASC,mBAAmBC,kBAAAA,uBAAsB;AAC3D,SAASC,yBAAyB;AAClC,SAASC,OAAOC,aAAAA,kBAAiB;AAEjC,SAASC,qBAAqB;;;ACb9B,SAASC,eAAeC,kBAAkB;AAWnC,IAAMC,eAAeC,8BAAiC;EAC3DC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMC,WAAW,MAAMC,WAAWP,YAAAA;;;AClBzC,YAAYQ,0BAA0B;AACtC,OAAOC,UAASC,SAASC,gBAAgB;AAEzC,SAASC,eAAe;AACxB,SAASC,cAAcC,MAAMC,YAAYC,sBAAsB;AAC/D,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,SAASC,IAAIC,sBAAsB;;;ACP5C,OAAOC,WAA8C;AAE9C,IAAMC,cAAc,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAAwC;AACjF,SACE,sBAAA,cAACC,OAAAA;IAAIC,OAAM;IAA6BC,SAAQ;IAAe,GAAGH;KAChE,s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ities", "useOperationInvoker", "Obj", "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", "StackContainer", "id", "subject", "collection", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "allMetadata", "useCapabilities", "Common", "Capability", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "items", "objects", "map", "object", "target", "filter", "isNonNullable", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "getDXN", "toString", "title", "toLocalizedString", "Graph", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "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"]
|
|
7
|
+
}
|
|
@@ -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 = '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,6 +1,6 @@
|
|
|
1
1
|
// src/types/stack.ts
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
|
-
import {
|
|
3
|
+
import { Type } from "@dxos/echo";
|
|
4
4
|
var SectionSchema = Schema.Struct({
|
|
5
5
|
height: Schema.optional(Schema.Number),
|
|
6
6
|
// Space for data that isn't stack-specific but is specific to this view instance.
|
|
@@ -10,19 +10,18 @@ var SectionSchema = Schema.Struct({
|
|
|
10
10
|
value: Schema.Any
|
|
11
11
|
}))
|
|
12
12
|
});
|
|
13
|
-
var StackViewType =
|
|
14
|
-
typename: "dxos.org/type/StackView",
|
|
15
|
-
version: "0.1.0"
|
|
16
|
-
})({
|
|
13
|
+
var StackViewType = Schema.Struct({
|
|
17
14
|
sections: Schema.mutable(Schema.Record({
|
|
18
15
|
key: Schema.String,
|
|
19
16
|
value: SectionSchema
|
|
20
17
|
}))
|
|
21
|
-
})
|
|
22
|
-
|
|
18
|
+
}).pipe(Type.object({
|
|
19
|
+
typename: "dxos.org/type/StackView",
|
|
20
|
+
version: "0.1.0"
|
|
21
|
+
}));
|
|
23
22
|
|
|
24
23
|
export {
|
|
25
24
|
SectionSchema,
|
|
26
25
|
StackViewType
|
|
27
26
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-MZUNZ6A3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.mutable(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,UAAiBC,eAAeP,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA,CAAA;AACpF,CAAA,EAAGc,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", "mutable", "pipe", "Type", "object", "typename", "version"]
|
|
7
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StackViewType
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MZUNZ6A3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SECTION_IDENTIFIER,
|
|
6
6
|
meta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4X7CK6FM.mjs";
|
|
8
8
|
|
|
9
9
|
// src/StackPlugin.ts
|
|
10
|
-
import {
|
|
11
|
-
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
10
|
+
import { Common, Plugin } from "@dxos/app-framework";
|
|
12
11
|
|
|
13
|
-
// src/capabilities/index.ts
|
|
14
|
-
import {
|
|
15
|
-
var ReactSurface = lazy(() => import("./react-surface-
|
|
12
|
+
// src/capabilities/react-surface/index.ts
|
|
13
|
+
import { Capability } from "@dxos/app-framework";
|
|
14
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-ZEFLABZS.mjs"));
|
|
16
15
|
|
|
17
16
|
// src/translations.ts
|
|
18
17
|
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
@@ -47,50 +46,35 @@ var translations = [
|
|
|
47
46
|
];
|
|
48
47
|
|
|
49
48
|
// src/StackPlugin.ts
|
|
50
|
-
var StackPlugin =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
label: section.object.title,
|
|
69
|
-
data: section.object
|
|
70
|
-
};
|
|
71
|
-
case "object":
|
|
72
|
-
return section.object;
|
|
73
|
-
case "view-object":
|
|
74
|
-
return section;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
49
|
+
var StackPlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule({
|
|
50
|
+
translations
|
|
51
|
+
}), Common.Plugin.addMetadataModule({
|
|
52
|
+
metadata: {
|
|
53
|
+
id: SECTION_IDENTIFIER,
|
|
54
|
+
metadata: {
|
|
55
|
+
parse: (section, type) => {
|
|
56
|
+
switch (type) {
|
|
57
|
+
case "node":
|
|
58
|
+
return {
|
|
59
|
+
id: section.object.id,
|
|
60
|
+
label: section.object.title,
|
|
61
|
+
data: section.object
|
|
62
|
+
};
|
|
63
|
+
case "object":
|
|
64
|
+
return section.object;
|
|
65
|
+
case "view-object":
|
|
66
|
+
return section;
|
|
77
67
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
defineModule({
|
|
89
|
-
id: `${meta.id}/module/react-surface`,
|
|
90
|
-
activatesOn: Events.SetupReactSurface,
|
|
91
|
-
activate: ReactSurface
|
|
92
|
-
})
|
|
93
|
-
]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}), Common.Plugin.addSchemaModule({
|
|
72
|
+
schema: [
|
|
73
|
+
StackViewType
|
|
74
|
+
]
|
|
75
|
+
}), Common.Plugin.addSurfaceModule({
|
|
76
|
+
activate: ReactSurface
|
|
77
|
+
}), Plugin.make);
|
|
94
78
|
export {
|
|
95
79
|
SECTION_IDENTIFIER,
|
|
96
80
|
StackPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/StackPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SAASA,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/StackPlugin.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Common, Plugin } from '@dxos/app-framework';\nimport { type Obj } from '@dxos/echo';\n\nimport { ReactSurface } from './capabilities';\nimport { SECTION_IDENTIFIER, meta } from './meta';\nimport { translations } from './translations';\nimport { StackViewType } from './types';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n Common.Plugin.addTranslationsModule({ translations }),\n Common.Plugin.addMetadataModule({\n metadata: {\n id: SECTION_IDENTIFIER,\n metadata: {\n parse: (section: { object: Obj.Unknown }, type: string) => {\n switch (type) {\n case 'node':\n return { id: section.object.id, label: (section.object as any).title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n }),\n Common.Plugin.addSchemaModule({ schema: [StackViewType] }),\n Common.Plugin.addSurfaceModule({ activate: ReactSurface }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Stacks',\n 'settings title': 'Stack plugin settings',\n 'settings separation label': 'Separate sections',\n 'add section beforeAll dialog title': 'Add a section to the start',\n 'add section afterAll dialog title': 'Add a section to the end',\n 'add section before dialog title': 'Add a section',\n 'add section after dialog title': 'Add a section',\n 'add section input placeholder': 'Find the type of section to add',\n 'upload file label': 'Add file',\n 'add section label': 'Add section',\n 'empty stack message': 'Drag objects into the stack.',\n 'remove section label': 'Delete',\n 'navigate to section label': 'Navigate to object',\n 'untitled section title': 'Untitled section',\n 'add section before label': 'Add before',\n 'add section after label': 'Add after',\n 'expand label': 'Expand',\n 'collapse label': 'Collapse',\n 'open chat thread label': 'Open chat thread',\n 'drag handle label': 'Press space or enter to begin dragging this object.',\n },\n },\n },\n ...stackTranslations,\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SAASA,QAAQC,cAAc;;;ACA/B,SAASC,kBAAkB;AAEpB,IAAMC,eAAeC,WAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACDzE,SAASC,gBAAgBC,yBAAyB;AAI3C,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,sCAAsC;QACtC,qCAAqC;QACrC,mCAAmC;QACnC,kCAAkC;QAClC,iCAAiC;QACjC,qBAAqB;QACrB,qBAAqB;QACrB,uBAAuB;QACvB,wBAAwB;QACxB,6BAA6B;QAC7B,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,gBAAgB;QAChB,kBAAkB;QAClB,0BAA0B;QAC1B,qBAAqB;MACvB;IACF;EACF;KACGC;;;;AFxBE,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,OAAOJ,OAAOK,sBAAsB;EAAEC;AAAa,CAAA,GACnDF,OAAOJ,OAAOO,kBAAkB;EAC9BC,UAAU;IACRC,IAAIC;IACJF,UAAU;MACRG,OAAO,CAACC,SAAkCC,SAAAA;AACxC,gBAAQA,MAAAA;UACN,KAAK;AACH,mBAAO;cAAEJ,IAAIG,QAAQE,OAAOL;cAAIM,OAAQH,QAAQE,OAAeE;cAAOC,MAAML,QAAQE;YAAO;UAC7F,KAAK;AACH,mBAAOF,QAAQE;UACjB,KAAK;AACH,mBAAOF;QACX;MACF;IACF;EACF;AACF,CAAA,GACAR,OAAOJ,OAAOkB,gBAAgB;EAAEC,QAAQ;IAACC;;AAAe,CAAA,GACxDhB,OAAOJ,OAAOqB,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACxDvB,OAAOwB,IAAI;",
|
|
6
|
+
"names": ["Common", "Plugin", "Capability", "ReactSurface", "Capability", "lazy", "translations", "stackTranslations", "translations", "meta", "id", "stackTranslations", "StackPlugin", "Plugin", "define", "meta", "pipe", "Common", "addTranslationsModule", "translations", "addMetadataModule", "metadata", "id", "SECTION_IDENTIFIER", "parse", "section", "type", "object", "label", "title", "data", "addSchemaModule", "schema", "StackViewType", "addSurfaceModule", "activate", "ReactSurface", "make"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":2526,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3545,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":3228,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17874,"imports":[{"path":"@preact-signals/safe-react/tracking","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/react","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/react-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/StackContainer.tsx":{"bytes":19859,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect/Option","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/react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","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/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/index.ts":{"bytes":858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"src/components/StackContainer.tsx","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3873,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","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/capabilities/index.ts":{"bytes":778,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/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":3643,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","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":6689,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","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":5378},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NHMDZYOB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-HVPK7YZQ.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":1394},"src/capabilities/index.ts":{"bytesInOutput":115},"src/translations.ts":{"bytesInOutput":1274}},"bytes":3099},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NHMDZYOB.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-NHMDZYOB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1695},"dist/lib/browser/chunk-NHMDZYOB.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":605},"src/types/index.ts":{"bytesInOutput":0}},"bytes":717},"dist/lib/browser/StackContainer-DD3ZD5OE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21901},"dist/lib/browser/StackContainer-DD3ZD5OE.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"effect/Option","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/react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","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":"@preact-signals/safe-react/tracking","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/react","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/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/StackContainer.tsx","inputs":{"src/components/StackContainer.tsx":{"bytesInOutput":4587},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/StackSection.tsx":{"bytesInOutput":5412},"src/components/CaretDownUp.tsx":{"bytesInOutput":972}},"bytes":11603},"dist/lib/browser/react-surface-HVPK7YZQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3434},"dist/lib/browser/react-surface-HVPK7YZQ.mjs":{"imports":[{"path":"dist/lib/browser/chunk-UIKFKRFJ.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-DD3ZD5OE.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":655},"src/components/index.ts":{"bytesInOutput":104},"src/components/StackSettings.tsx":{"bytesInOutput":263}},"bytes":1339},"dist/lib/browser/chunk-UIKFKRFJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1168},"dist/lib/browser/chunk-UIKFKRFJ.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":2522,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3327,"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/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":17302,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","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/StackContainer.tsx":{"bytes":18868,"imports":[{"path":"effect/Option","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/react","kind":"import-statement","external":true},{"path":"@dxos/echo","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/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/index.ts":{"bytes":858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"src/components/StackContainer.tsx","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4363,"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/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","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/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":3826,"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":4311,"imports":[{"path":"@dxos/app-framework","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":4431},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-MZUNZ6A3.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-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-ZEFLABZS.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":774},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":1274}},"bytes":2526},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-MZUNZ6A3.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-MZUNZ6A3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1799},"dist/lib/browser/chunk-MZUNZ6A3.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":591},"src/types/index.ts":{"bytesInOutput":0}},"bytes":703},"dist/lib/browser/StackContainer-FUGH3ZJH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21662},"dist/lib/browser/StackContainer-FUGH3ZJH.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"effect/Option","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/react","kind":"import-statement","external":true},{"path":"@dxos/echo","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/react","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}],"exports":["default"],"entryPoint":"src/components/StackContainer.tsx","inputs":{"src/components/StackContainer.tsx":{"bytesInOutput":4032},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/StackSection.tsx":{"bytesInOutput":5057},"src/components/CaretDownUp.tsx":{"bytesInOutput":771}},"bytes":10492},"dist/lib/browser/react-surface-ZEFLABZS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3667},"dist/lib/browser/react-surface-ZEFLABZS.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/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-FUGH3ZJH.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":749},"src/components/index.ts":{"bytesInOutput":104},"src/components/StackSettings.tsx":{"bytesInOutput":182}},"bytes":1380},"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}}}
|