@dxos/plugin-stack 0.6.13 → 0.6.14-main.7bd9c89

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 (58) hide show
  1. package/dist/lib/browser/{StackMain-XRQRNZ4I.mjs → StackMain-ILYVK656.mjs} +12 -11
  2. package/dist/lib/browser/StackMain-ILYVK656.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-R5KXWF2W.mjs → chunk-6PHTGCQZ.mjs} +9 -3
  4. package/dist/lib/browser/chunk-6PHTGCQZ.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-AYDYMPJK.mjs → chunk-ONAKM24Z.mjs} +3 -6
  6. package/dist/lib/browser/chunk-ONAKM24Z.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +17 -17
  8. package/dist/lib/browser/index.mjs.map +3 -3
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/meta.mjs +1 -1
  11. package/dist/lib/browser/types/index.mjs +1 -1
  12. package/dist/lib/node/{StackMain-XJGYFDDN.cjs → StackMain-LAYSQV2S.cjs} +26 -25
  13. package/dist/lib/node/StackMain-LAYSQV2S.cjs.map +7 -0
  14. package/dist/lib/node/{chunk-EMD6A66G.cjs → chunk-3D3FPZWK.cjs} +12 -6
  15. package/dist/lib/node/chunk-3D3FPZWK.cjs.map +7 -0
  16. package/dist/lib/node/{chunk-I42JKRXR.cjs → chunk-O5SQVKNW.cjs} +5 -18
  17. package/dist/lib/node/chunk-O5SQVKNW.cjs.map +7 -0
  18. package/dist/lib/node/index.cjs +53 -53
  19. package/dist/lib/node/index.cjs.map +3 -3
  20. package/dist/lib/node/meta.cjs +4 -4
  21. package/dist/lib/node/meta.cjs.map +1 -1
  22. package/dist/lib/node/meta.json +1 -1
  23. package/dist/lib/node/types/index.cjs +3 -3
  24. package/dist/lib/node/types/index.cjs.map +1 -1
  25. package/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs +278 -0
  26. package/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs.map +7 -0
  27. package/dist/lib/node-esm/chunk-HRY4R5UU.mjs +29 -0
  28. package/dist/lib/node-esm/chunk-HRY4R5UU.mjs.map +7 -0
  29. package/dist/lib/node-esm/chunk-J57BXQJY.mjs +18 -0
  30. package/dist/lib/node-esm/chunk-J57BXQJY.mjs.map +7 -0
  31. package/dist/lib/node-esm/index.mjs +286 -0
  32. package/dist/lib/node-esm/index.mjs.map +7 -0
  33. package/dist/lib/node-esm/meta.json +1 -0
  34. package/dist/lib/node-esm/meta.mjs +12 -0
  35. package/dist/lib/node-esm/meta.mjs.map +7 -0
  36. package/dist/lib/node-esm/types/index.mjs +10 -0
  37. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  38. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  39. package/dist/types/src/components/AddSectionDialog.d.ts.map +1 -1
  40. package/dist/types/src/components/StackMain.d.ts +2 -1
  41. package/dist/types/src/components/StackMain.d.ts.map +1 -1
  42. package/dist/types/src/components/index.d.ts +3 -3
  43. package/dist/types/src/components/index.d.ts.map +1 -1
  44. package/dist/types/src/meta.d.ts +1 -4
  45. package/dist/types/src/meta.d.ts.map +1 -1
  46. package/package.json +34 -29
  47. package/src/StackPlugin.tsx +15 -7
  48. package/src/components/AddSectionDialog.tsx +1 -2
  49. package/src/components/StackMain.tsx +50 -47
  50. package/src/components/index.ts +2 -3
  51. package/src/{meta.tsx → meta.ts} +3 -5
  52. package/src/types/stack.ts +3 -3
  53. package/dist/lib/browser/StackMain-XRQRNZ4I.mjs.map +0 -7
  54. package/dist/lib/browser/chunk-AYDYMPJK.mjs.map +0 -7
  55. package/dist/lib/browser/chunk-R5KXWF2W.mjs.map +0 -7
  56. package/dist/lib/node/StackMain-XJGYFDDN.cjs.map +0 -7
  57. package/dist/lib/node/chunk-EMD6A66G.cjs.map +0 -7
  58. package/dist/lib/node/chunk-I42JKRXR.cjs.map +0 -7
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/stack.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\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 = S.Struct({\n height: S.optional(S.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: S.optional(S.Record({ key: S.String, value: S.Any })),\n});\n\nexport class StackViewType extends TypedObject({ typename: 'dxos.org/type/StackView', version: '0.1.0' })({\n sections: S.mutable(S.Record({ key: S.String, value: SectionSchema })),\n}) {}\n"],
5
+ "mappings": ";;;AAIA,SAASA,GAAGC,mBAAmB;AAOxB,IAAMC,gBAAgBC,EAAEC,OAAO;EACpCC,QAAQF,EAAEG,SAASH,EAAEI,MAAM;;;EAG3BC,QAAQL,EAAEG,SAASH,EAAEM,OAAO;IAAEC,KAAKP,EAAEQ;IAAQC,OAAOT,EAAEU;EAAI,CAAA,CAAA;AAC5D,CAAA;AAEO,IAAMC,gBAAN,cAA4BC,YAAY;EAAEC,UAAU;EAA2BC,SAAS;AAAQ,CAAA,EAAG;EACxGC,UAAUf,EAAEgB,QAAQhB,EAAEM,OAAO;IAAEC,KAAKP,EAAEQ;IAAQC,OAAOV;EAAc,CAAA,CAAA;AACrE,CAAA,EAAA;AAAI;",
6
+ "names": ["S", "TypedObject", "SectionSchema", "S", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "TypedObject", "typename", "version", "sections", "mutable"]
7
+ }
@@ -0,0 +1,18 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // packages/plugins/plugin-stack/src/meta.ts
4
+ var STACK_PLUGIN = "dxos.org/plugin/stack";
5
+ var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
6
+ var meta_default = {
7
+ id: STACK_PLUGIN,
8
+ // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
9
+ name: "Collections",
10
+ icon: "ph--stack-simple--regular"
11
+ };
12
+
13
+ export {
14
+ STACK_PLUGIN,
15
+ SECTION_IDENTIFIER,
16
+ meta_default
17
+ };
18
+ //# sourceMappingURL=chunk-J57BXQJY.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const STACK_PLUGIN = 'dxos.org/plugin/stack';\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport default {\n id: STACK_PLUGIN,\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n name: 'Collections',\n icon: 'ph--stack-simple--regular',\n} satisfies PluginMeta;\n"],
5
+ "mappings": ";;;AAMO,IAAMA,eAAe;AACrB,IAAMC,qBAAqB;AAElC,IAAA,eAAe;EACbC,IAAIF;;EAEJG,MAAM;EACNC,MAAM;AACR;",
6
+ "names": ["STACK_PLUGIN", "SECTION_IDENTIFIER", "id", "name", "icon"]
7
+ }
@@ -0,0 +1,286 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ SECTION_IDENTIFIER,
4
+ STACK_PLUGIN,
5
+ meta_default
6
+ } from "./chunk-J57BXQJY.mjs";
7
+ import {
8
+ SectionSchema,
9
+ StackViewType
10
+ } from "./chunk-HRY4R5UU.mjs";
11
+
12
+ // packages/plugins/plugin-stack/src/StackPlugin.tsx
13
+ import React3 from "react";
14
+ import { create as create2, fullyQualifiedId } from "@dxos/client/echo";
15
+ import { LocalStorageStore } from "@dxos/local-storage";
16
+ import { CollectionType } from "@dxos/plugin-space/types";
17
+ import { Main } from "@dxos/react-ui";
18
+ import { baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd } from "@dxos/react-ui-theme";
19
+
20
+ // packages/plugins/plugin-stack/src/components/index.ts
21
+ import { lazy } from "react";
22
+
23
+ // packages/plugins/plugin-stack/src/components/StackSettings.tsx
24
+ import React from "react";
25
+ import { SettingsValue } from "@dxos/plugin-settings";
26
+ import { Input, useTranslation } from "@dxos/react-ui";
27
+ var StackSettings = ({ settings }) => {
28
+ const { t } = useTranslation(STACK_PLUGIN);
29
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SettingsValue, {
30
+ label: t("settings separation label")
31
+ }, /* @__PURE__ */ React.createElement(Input.Switch, {
32
+ checked: settings.separation,
33
+ onCheckedChange: (checked) => settings.separation = !!checked
34
+ })));
35
+ };
36
+
37
+ // packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx
38
+ import { FilePlus } from "@phosphor-icons/react";
39
+ import React2, { useCallback, useRef, useState } from "react";
40
+ import { usePlugin, useIntent, LayoutAction, useResolvePlugin, parseFileManagerPlugin } from "@dxos/app-framework";
41
+ import { create, getSpace } from "@dxos/client/echo";
42
+ import { FileType } from "@dxos/plugin-ipfs/types";
43
+ import { Dialog, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
44
+ import { Path } from "@dxos/react-ui-mosaic";
45
+ import { SearchList } from "@dxos/react-ui-searchlist";
46
+ import { getSize, mx } from "@dxos/react-ui-theme";
47
+ import { nonNullable } from "@dxos/util";
48
+ var dataHasAddSectionDialogProps = (data) => {
49
+ return "subject" in data && typeof data.subject === "object" && !!data.subject && "position" in data.subject && typeof data.subject.position === "string" && "collection" in data.subject;
50
+ };
51
+ var AddSectionDialog = ({ path, position, collection }) => {
52
+ const { t } = useTranslation2(STACK_PLUGIN);
53
+ const stackPlugin = usePlugin(STACK_PLUGIN);
54
+ const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);
55
+ const fileRef = useRef(null);
56
+ const { dispatch } = useIntent();
57
+ const space = getSpace(collection);
58
+ const [pending, setPending] = useState(false);
59
+ const [uploadError, setUploadError] = useState();
60
+ const handleAdd = useCallback((sectionObject) => {
61
+ const index = position === "beforeAll" ? 0 : position === "afterAll" ? collection.objects.length : collection.objects.filter(nonNullable).findIndex((section) => section.id === Path.last(path));
62
+ collection.objects.splice(index + (position === "after" ? 1 : 0), 0, sectionObject);
63
+ const stack = collection.views[StackViewType.typename];
64
+ if (stack) {
65
+ stack.sections[sectionObject.id] = {};
66
+ }
67
+ setPending(false);
68
+ void dispatch?.({
69
+ action: LayoutAction.SET_LAYOUT,
70
+ data: {
71
+ element: "dialog",
72
+ state: false
73
+ }
74
+ });
75
+ }, [
76
+ collection,
77
+ path,
78
+ position,
79
+ dispatch
80
+ ]);
81
+ const handleFileUpload = fileManagerPlugin?.provides.file.upload && space ? async (file) => {
82
+ const filename = file.name.split(".")[0];
83
+ try {
84
+ const info = await fileManagerPlugin.provides.file.upload?.(file, space);
85
+ if (info) {
86
+ const obj = create(FileType, {
87
+ type: file.type,
88
+ name: filename,
89
+ filename,
90
+ cid: info.cid
91
+ });
92
+ handleAdd(obj);
93
+ }
94
+ } catch (err) {
95
+ setUploadError(err);
96
+ }
97
+ } : void 0;
98
+ return /* @__PURE__ */ React2.createElement(Dialog.Content, null, /* @__PURE__ */ React2.createElement(Dialog.Title, null, t(`add section ${position} dialog title`)), /* @__PURE__ */ React2.createElement(SearchList.Root, {
99
+ label: t("add section input placeholder")
100
+ }, /* @__PURE__ */ React2.createElement(SearchList.Input, {
101
+ placeholder: t("add section input placeholder"),
102
+ classNames: "pli-3",
103
+ disabled: pending
104
+ }), /* @__PURE__ */ React2.createElement(SearchList.Content, {
105
+ classNames: "min-bs-24 bs-fit max-bs-64 overflow-auto",
106
+ ...pending && {
107
+ inert: "true"
108
+ }
109
+ }, stackPlugin?.provides?.stack.creators?.map(({ id, icon: Icon, label: propsLabel, testId, intent }) => {
110
+ const label = toLocalizedString(propsLabel, t);
111
+ return /* @__PURE__ */ React2.createElement(SearchList.Item, {
112
+ value: label,
113
+ key: id,
114
+ onSelect: async () => {
115
+ setPending(true);
116
+ const { data: nextSection } = await dispatch({
117
+ ...intent,
118
+ data: {
119
+ space
120
+ }
121
+ }) ?? {};
122
+ handleAdd(nextSection);
123
+ },
124
+ classNames: "flex items-center gap-2 pli-2",
125
+ "data-testid": testId
126
+ }, Icon && /* @__PURE__ */ React2.createElement(Icon, {
127
+ className: mx(getSize(4), "shrink-0")
128
+ }), /* @__PURE__ */ React2.createElement("span", {
129
+ className: "grow truncate"
130
+ }, label));
131
+ }), handleFileUpload && /* @__PURE__ */ React2.createElement(SearchList.Item, {
132
+ value: t("upload file label"),
133
+ classNames: "flex items-center gap-2 pli-2",
134
+ onSelect: () => fileRef.current?.click()
135
+ }, /* @__PURE__ */ React2.createElement(FilePlus, null), /* @__PURE__ */ React2.createElement("span", {
136
+ className: "grow truncate"
137
+ }, t("upload file label"))), uploadError && /* @__PURE__ */ React2.createElement("div", {
138
+ className: "text-error-500"
139
+ }, uploadError.message))), handleFileUpload && /* @__PURE__ */ React2.createElement("input", {
140
+ type: "file",
141
+ className: "sr-only",
142
+ ref: fileRef,
143
+ onChange: ({ target: { files } }) => files && handleFileUpload(files[0])
144
+ }));
145
+ };
146
+
147
+ // packages/plugins/plugin-stack/src/components/index.ts
148
+ var StackMain = lazy(() => import("./StackMain-KH6IEQQ6.mjs"));
149
+
150
+ // packages/plugins/plugin-stack/src/translations.ts
151
+ import { translations as stackTranslations } from "@dxos/react-ui-stack";
152
+ var translations_default = [
153
+ {
154
+ "en-US": {
155
+ [STACK_PLUGIN]: {
156
+ "plugin name": "Stacks",
157
+ "settings separation label": "Separate sections",
158
+ "add section beforeAll dialog title": "Add a section to the start",
159
+ "add section afterAll dialog title": "Add a section to the end",
160
+ "add section before dialog title": "Add a section",
161
+ "add section after dialog title": "Add a section",
162
+ "add section input placeholder": "Find the type of section to add",
163
+ "upload file label": "Add file",
164
+ "add section label": "Add section"
165
+ }
166
+ }
167
+ },
168
+ ...stackTranslations
169
+ ];
170
+
171
+ // packages/plugins/plugin-stack/src/StackPlugin.tsx
172
+ var StackPlugin = () => {
173
+ const settings = new LocalStorageStore(STACK_PLUGIN, {
174
+ separation: true
175
+ });
176
+ const stackState = create2({
177
+ creators: []
178
+ });
179
+ return {
180
+ meta: meta_default,
181
+ ready: async (plugins) => {
182
+ settings.prop({
183
+ key: "separation",
184
+ type: LocalStorageStore.bool()
185
+ });
186
+ for (const plugin of plugins) {
187
+ if (plugin.meta.id === STACK_PLUGIN) {
188
+ continue;
189
+ }
190
+ if (Array.isArray(plugin.provides?.stack?.creators)) {
191
+ stackState.creators.push(...plugin.provides.stack.creators ?? []);
192
+ }
193
+ }
194
+ },
195
+ provides: {
196
+ settings: settings.values,
197
+ metadata: {
198
+ records: {
199
+ [StackViewType.typename]: {
200
+ placeholder: [
201
+ "stack title placeholder",
202
+ {
203
+ ns: STACK_PLUGIN
204
+ }
205
+ ],
206
+ icon: "ph--stack-simple--regular"
207
+ },
208
+ [SECTION_IDENTIFIER]: {
209
+ parse: (section, type) => {
210
+ switch (type) {
211
+ case "node":
212
+ return {
213
+ id: section.object.id,
214
+ label: section.object.title,
215
+ data: section.object
216
+ };
217
+ case "object":
218
+ return section.object;
219
+ case "view-object":
220
+ return section;
221
+ }
222
+ }
223
+ }
224
+ }
225
+ },
226
+ translations: translations_default,
227
+ echo: {
228
+ schema: [
229
+ StackViewType
230
+ ]
231
+ },
232
+ surface: {
233
+ component: ({ data, role }) => {
234
+ switch (data.component) {
235
+ case `${STACK_PLUGIN}/AddSectionDialog`:
236
+ return dataHasAddSectionDialogProps(data) ? /* @__PURE__ */ React3.createElement(AddSectionDialog, data.subject) : null;
237
+ }
238
+ const primary = data.active ?? data.object;
239
+ const id = typeof data.id === "string" ? data.id : void 0;
240
+ switch (role) {
241
+ case "main":
242
+ return primary instanceof CollectionType ? /* @__PURE__ */ React3.createElement(Main.Content, {
243
+ bounce: true,
244
+ classNames: [
245
+ baseSurface,
246
+ topbarBlockPaddingStart,
247
+ bottombarBlockPaddingEnd
248
+ ]
249
+ }, /* @__PURE__ */ React3.createElement(StackMain, {
250
+ id: id ?? fullyQualifiedId(primary),
251
+ collection: primary,
252
+ separation: settings.values.separation
253
+ })) : null;
254
+ case "article":
255
+ return primary instanceof CollectionType ? /* @__PURE__ */ React3.createElement("div", {
256
+ role: "none",
257
+ className: "row-span-2 overflow-auto"
258
+ }, /* @__PURE__ */ React3.createElement(StackMain, {
259
+ id: id ?? fullyQualifiedId(primary),
260
+ collection: primary,
261
+ separation: settings.values.separation
262
+ })) : null;
263
+ case "settings": {
264
+ return data.plugin === meta_default.id ? /* @__PURE__ */ React3.createElement(StackSettings, {
265
+ settings: settings.values
266
+ }) : null;
267
+ }
268
+ default:
269
+ return null;
270
+ }
271
+ }
272
+ },
273
+ stack: stackState
274
+ }
275
+ };
276
+ };
277
+
278
+ // packages/plugins/plugin-stack/src/index.ts
279
+ var src_default = StackPlugin;
280
+ export {
281
+ SectionSchema,
282
+ StackPlugin,
283
+ StackViewType,
284
+ src_default as default
285
+ };
286
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/StackPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/StackSettings.tsx", "../../../src/components/AddSectionDialog.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin, type PluginDefinition } from '@dxos/app-framework';\nimport { create, type EchoReactiveObject, fullyQualifiedId } from '@dxos/client/echo';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { Main } from '@dxos/react-ui';\nimport { baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';\n\nimport { StackMain, StackSettings, AddSectionDialog, dataHasAddSectionDialogProps } from './components';\nimport meta, { SECTION_IDENTIFIER, STACK_PLUGIN } from './meta';\nimport translations from './translations';\nimport { StackViewType } from './types';\nimport { type StackPluginProvides, type StackProvides, type StackState, type StackSettingsProps } from './types';\n\nexport const StackPlugin = (): PluginDefinition<StackPluginProvides> => {\n const settings = new LocalStorageStore<StackSettingsProps>(STACK_PLUGIN, { separation: true });\n const stackState = create<StackState>({ creators: [] });\n\n return {\n meta,\n ready: async (plugins) => {\n settings.prop({ key: 'separation', type: LocalStorageStore.bool() });\n\n for (const plugin of plugins) {\n if (plugin.meta.id === STACK_PLUGIN) {\n continue;\n }\n\n if (Array.isArray((plugin as Plugin<StackProvides>).provides?.stack?.creators)) {\n stackState.creators.push(...((plugin as Plugin<StackProvides>).provides.stack.creators ?? []));\n }\n }\n },\n provides: {\n settings: settings.values,\n metadata: {\n records: {\n [StackViewType.typename]: {\n placeholder: ['stack title placeholder', { ns: STACK_PLUGIN }],\n icon: 'ph--stack-simple--regular',\n },\n [SECTION_IDENTIFIER]: {\n parse: (section: { object: EchoReactiveObject<any> }, type: string) => {\n switch (type) {\n case 'node':\n // TODO(wittjosiah): Remove cast.\n return { id: section.object.id, label: section.object.title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n },\n translations,\n echo: {\n schema: [StackViewType],\n },\n surface: {\n component: ({ data, role }) => {\n switch (data.component) {\n case `${STACK_PLUGIN}/AddSectionDialog`:\n return dataHasAddSectionDialogProps(data) ? <AddSectionDialog {...data.subject} /> : null;\n }\n\n const primary = data.active ?? data.object;\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n switch (role) {\n case 'main':\n return primary instanceof CollectionType ? (\n <Main.Content bounce classNames={[baseSurface, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}>\n <StackMain\n id={id ?? fullyQualifiedId(primary)}\n collection={primary}\n separation={settings.values.separation}\n />\n </Main.Content>\n ) : null;\n case 'article':\n return primary instanceof CollectionType ? (\n <div role='none' className='row-span-2 overflow-auto'>\n <StackMain\n id={id ?? fullyQualifiedId(primary)}\n collection={primary}\n separation={settings.values.separation}\n />\n </div>\n ) : null;\n case 'settings': {\n return data.plugin === meta.id ? <StackSettings settings={settings.values} /> : null;\n }\n default:\n return null;\n }\n },\n },\n stack: stackState,\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const StackMain = lazy(() => import('./StackMain'));\n\nexport * from './StackSettings';\nexport * from './AddSectionDialog';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { type StackSettingsProps } from '../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(STACK_PLUGIN);\n\n return (\n <>\n <SettingsValue label={t('settings separation label')}>\n <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />\n </SettingsValue>\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { FilePlus } from '@phosphor-icons/react';\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { usePlugin, useIntent, LayoutAction, useResolvePlugin, parseFileManagerPlugin } from '@dxos/app-framework';\nimport { type EchoReactiveObject, create, getSpace } from '@dxos/client/echo';\nimport { FileType } from '@dxos/plugin-ipfs/types';\nimport { type CollectionType } from '@dxos/plugin-space/types';\nimport { Dialog, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Path } from '@dxos/react-ui-mosaic';\nimport { SearchList } from '@dxos/react-ui-searchlist';\nimport { type AddSectionPosition } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { STACK_PLUGIN } from '../meta';\nimport { StackViewType, type StackPluginProvides } from '../types';\n\ntype AddSectionDialogProps = { path?: string; position: AddSectionPosition; collection: CollectionType };\n\nexport const dataHasAddSectionDialogProps = (data: any): data is { subject: AddSectionDialogProps } => {\n return (\n 'subject' in data &&\n typeof data.subject === 'object' &&\n !!data.subject &&\n 'position' in data.subject &&\n typeof data.subject.position === 'string' &&\n 'collection' in data.subject\n );\n};\n\nexport const AddSectionDialog = ({ path, position, collection }: AddSectionDialogProps) => {\n const { t } = useTranslation(STACK_PLUGIN);\n const stackPlugin = usePlugin<StackPluginProvides>(STACK_PLUGIN);\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n const fileRef = useRef<HTMLInputElement | null>(null);\n const { dispatch } = useIntent();\n const space = getSpace(collection);\n const [pending, setPending] = useState<boolean>(false);\n const [uploadError, setUploadError] = useState<Error | undefined>();\n\n const handleAdd = useCallback(\n (sectionObject: EchoReactiveObject<any>) => {\n const index =\n position === 'beforeAll'\n ? 0\n : position === 'afterAll'\n ? collection.objects.length\n : collection.objects.filter(nonNullable).findIndex((section) => section.id === Path.last(path!));\n\n collection.objects.splice(index + (position === 'after' ? 1 : 0), 0, sectionObject);\n const stack = collection.views[StackViewType.typename];\n if (stack) {\n stack.sections[sectionObject.id] = {};\n }\n setPending(false);\n void dispatch?.({ action: LayoutAction.SET_LAYOUT, data: { element: 'dialog', state: false } });\n },\n [collection, path, position, dispatch],\n );\n\n const handleFileUpload =\n fileManagerPlugin?.provides.file.upload && space\n ? async (file: File) => {\n const filename = file.name.split('.')[0];\n try {\n const info = await fileManagerPlugin.provides.file.upload?.(file, space);\n if (info) {\n const obj = create(FileType, { type: file.type, name: filename, filename, cid: info.cid });\n handleAdd(obj);\n }\n } catch (err: any) {\n setUploadError(err);\n }\n }\n : undefined;\n\n return (\n <Dialog.Content>\n <Dialog.Title>{t(`add section ${position} dialog title`)}</Dialog.Title>\n <SearchList.Root label={t('add section input placeholder')}>\n <SearchList.Input placeholder={t('add section input placeholder')} classNames='pli-3' disabled={pending} />\n <SearchList.Content classNames='min-bs-24 bs-fit max-bs-64 overflow-auto' {...(pending && { inert: 'true' })}>\n {stackPlugin?.provides?.stack.creators?.map(({ id, icon: Icon, label: propsLabel, testId, intent }) => {\n const label = toLocalizedString(propsLabel, t);\n return (\n <SearchList.Item\n value={label}\n key={id}\n onSelect={async () => {\n setPending(true);\n const { data: nextSection } = (await dispatch({ ...intent, data: { space } })) ?? {};\n handleAdd(nextSection);\n }}\n classNames='flex items-center gap-2 pli-2'\n data-testid={testId}\n >\n {Icon && <Icon className={mx(getSize(4), 'shrink-0')} />}\n <span className='grow truncate'>{label}</span>\n </SearchList.Item>\n );\n })}\n {handleFileUpload && (\n <SearchList.Item\n value={t('upload file label')}\n classNames='flex items-center gap-2 pli-2'\n onSelect={() => fileRef.current?.click()}\n >\n <FilePlus />\n <span className='grow truncate'>{t('upload file label')}</span>\n </SearchList.Item>\n )}\n {uploadError && <div className='text-error-500'>{uploadError.message}</div>}\n </SearchList.Content>\n </SearchList.Root>\n {handleFileUpload && (\n <input\n type='file'\n className='sr-only'\n ref={fileRef}\n onChange={({ target: { files } }) => files && handleFileUpload(files[0])}\n />\n )}\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { STACK_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [STACK_PLUGIN]: {\n 'plugin name': 'Stacks',\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 },\n },\n },\n ...stackTranslations,\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackPlugin } from './StackPlugin';\n\nexport default StackPlugin;\n\nexport * from './types';\n\nexport * from './StackPlugin';\n"],
5
+ "mappings": ";;;;;;;;;;;;AAIA,OAAOA,YAAW;AAGlB,SAASC,U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AY;AACf,qBAAOgC,KAAKrB,WAAWP,aAAKQ,KAAK,gBAAA4B,OAAA,cAACmB,eAAAA;gBAAc9D,UAAUA,SAASqB;mBAAa;YAClF;YACA;AACE,qBAAO;UACX;QACF;MACF;MACAF,OAAOf;IACT;EACF;AACF;;;AKtGA,IAAA,cAAe2D;",
6
+ "names": ["React", "create", "fullyQualifiedId", "LocalStorageStore", "CollectionType", "Main", "baseSurface", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "lazy", "React", "SettingsValue", "Input", "useTranslation", "StackSettings", "settings", "t", "useTranslation", "STACK_PLUGIN", "SettingsValue", "label", "Input", "Switch", "checked", "separation", "onCheckedChange", "FilePlus", "React", "useCallback", "useRef", "useState", "usePlugin", "useIntent", "LayoutAction", "useResolvePlugin", "parseFileManagerPlugin", "create", "getSpace", "FileType", "Dialog", "toLocalizedString", "useTranslation", "Path", "SearchList", "getSize", "mx", "nonNullable", "dataHasAddSectionDialogProps", "data", "subject", "position", "AddSectionDialog", "path", "collection", "t", "useTranslation", "STACK_PLUGIN", "stackPlugin", "usePlugin", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "fileRef", "useRef", "dispatch", "useIntent", "space", "getSpace", "pending", "setPending", "useState", "uploadError", "setUploadError", "handleAdd", "useCallback", "sectionObject", "index", "objects", "length", "filter", "nonNullable", "findIndex", "section", "id", "Path", "last", "splice", "stack", "views", "StackViewType", "typename", "sections", "action", "LayoutAction", "SET_LAYOUT", "element", "state", "handleFileUpload", "provides", "file", "upload", "filename", "name", "split", "info", "obj", "create", "FileType", "type", "cid", "err", "undefined", "React", "Dialog", "Content", "Title", "SearchList", "Root", "label", "Input", "placeholder", "classNames", "disabled", "inert", "creators", "map", "icon", "Icon", "propsLabel", "testId", "intent", "toLocalizedString", "Item", "value", "key", "onSelect", "nextSection", "data-testid", "className", "mx", "getSize", "span", "current", "click", "FilePlus", "div", "message", "input", "ref", "onChange", "target", "files", "StackMain", "lazy", "translations", "stackTranslations", "STACK_PLUGIN", "stackTranslations", "StackPlugin", "settings", "LocalStorageStore", "STACK_PLUGIN", "separation", "stackState", "create", "creators", "meta", "ready", "plugins", "prop", "key", "type", "bool", "plugin", "id", "Array", "isArray", "provides", "stack", "push", "values", "metadata", "records", "StackViewType", "typename", "placeholder", "ns", "icon", "SECTION_IDENTIFIER", "parse", "section", "object", "label", "title", "data", "translations", "echo", "schema", "surface", "component", "role", "dataHasAddSectionDialogProps", "React", "AddSectionDialog", "subject", "primary", "active", "undefined", "CollectionType", "Main", "Content", "bounce", "classNames", "baseSurface", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "StackMain", "fullyQualifiedId", "collection", "div", "className", "StackSettings", "StackPlugin"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytes":1525,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytes":2578,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/types/stack.ts":{"bytes":3287,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/types/types.ts":{"bytes":2031,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/types/index.ts":{"bytes":581,"imports":[{"path":"packages/plugins/plugin-stack/src/types/stack.ts","kind":"import-statement","original":"./stack"},{"path":"packages/plugins/plugin-stack/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytes":18312,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytes":10461,"imports":[{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytes":27006,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/AddSection.tsx","kind":"import-statement","original":"./AddSection"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/index.ts":{"bytes":981,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx","kind":"import-statement","original":"./AddSectionDialog"},{"path":"packages/plugins/plugin-stack/src/components/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"packages/plugins/plugin-stack/src/translations.ts":{"bytes":2731,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytes":15679,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/local-storage","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-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-stack/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-stack/src/index.ts":{"bytes":854,"imports":[{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"},{"path":"packages/plugins/plugin-stack/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-stack/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":20135},"packages/plugins/plugin-stack/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-J57BXQJY.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-HRY4R5UU.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/local-storage","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-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-ipfs/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-searchlist","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SectionSchema","StackPlugin","StackViewType","default"],"entryPoint":"packages/plugins/plugin-stack/src/index.ts","inputs":{"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytesInOutput":3735},"packages/plugins/plugin-stack/src/components/index.ts":{"bytesInOutput":94},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytesInOutput":554},"packages/plugins/plugin-stack/src/components/AddSectionDialog.tsx":{"bytesInOutput":4601},"packages/plugins/plugin-stack/src/translations.ts":{"bytesInOutput":710},"packages/plugins/plugin-stack/src/index.ts":{"bytesInOutput":31}},"bytes":10566},"packages/plugins/plugin-stack/dist/lib/node-esm/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node-esm/meta.mjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-J57BXQJY.mjs","kind":"import-statement"}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-stack/src/meta.ts","inputs":{},"bytes":295},"packages/plugins/plugin-stack/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-HRY4R5UU.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"packages/plugins/plugin-stack/src/types/index.ts","inputs":{},"bytes":246},"packages/plugins/plugin-stack/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19500},"packages/plugins/plugin-stack/dist/lib/node-esm/StackMain-KH6IEQQ6.mjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-J57BXQJY.mjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-HRY4R5UU.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@fluentui/react-tabster","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-stack/src/components/StackMain.tsx","inputs":{"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytesInOutput":6330},"packages/plugins/plugin-stack/src/components/AddSection.tsx":{"bytesInOutput":2546}},"bytes":9382},"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-J57BXQJY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":712},"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-J57BXQJY.mjs":{"imports":[],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytesInOutput":299}},"bytes":547},"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-HRY4R5UU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1571},"packages/plugins/plugin-stack/dist/lib/node-esm/chunk-HRY4R5UU.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"packages/plugins/plugin-stack/src/types/stack.ts":{"bytesInOutput":515},"packages/plugins/plugin-stack/src/types/index.ts":{"bytesInOutput":0}},"bytes":750}}}
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ SECTION_IDENTIFIER,
4
+ STACK_PLUGIN,
5
+ meta_default
6
+ } from "./chunk-J57BXQJY.mjs";
7
+ export {
8
+ SECTION_IDENTIFIER,
9
+ STACK_PLUGIN,
10
+ meta_default as default
11
+ };
12
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ SectionSchema,
4
+ StackViewType
5
+ } from "../chunk-HRY4R5UU.mjs";
6
+ export {
7
+ SectionSchema,
8
+ StackViewType
9
+ };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"StackPlugin.d.ts","sourceRoot":"","sources":["../../../src/StackPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAYzE,OAAO,EAAE,KAAK,mBAAmB,EAAgE,MAAM,SAAS,CAAC;AAEjH,eAAO,MAAM,WAAW,QAAO,gBAAgB,CAAC,mBAAmB,CA+ElE,CAAC"}
1
+ {"version":3,"file":"StackPlugin.d.ts","sourceRoot":"","sources":["../../../src/StackPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWzE,OAAO,EAAE,KAAK,mBAAmB,EAAgE,MAAM,SAAS,CAAC;AAEjH,eAAO,MAAM,WAAW,QAAO,gBAAgB,CAAC,mBAAmB,CAyFlE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AddSectionDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/AddSectionDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO/D,KAAK,qBAAqB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAAE,CAAC;AAEzG,eAAO,MAAM,4BAA4B,SAAU,GAAG,KAAG,IAAI,IAAI;IAAE,OAAO,EAAE,qBAAqB,CAAA;CAShG,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAAoC,qBAAqB,sBA8FrF,CAAC"}
1
+ {"version":3,"file":"AddSectionDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/AddSectionDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAK7D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO/D,KAAK,qBAAqB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,UAAU,EAAE,cAAc,CAAA;CAAE,CAAC;AAEzG,eAAO,MAAM,4BAA4B,SAAU,GAAG,KAAG,IAAI,IAAI;IAAE,OAAO,EAAE,qBAAqB,CAAA;CAShG,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAAoC,qBAAqB,sBA8FrF,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { type CollectionType } from '@dxos/plugin-space/types';
3
3
  type StackMainProps = {
4
+ id: string;
4
5
  collection: CollectionType;
5
6
  separation?: boolean;
6
7
  };
7
- declare const StackMain: ({ collection, separation }: StackMainProps) => React.JSX.Element;
8
+ declare const StackMain: ({ id, collection, separation }: StackMainProps) => React.JSX.Element;
8
9
  export default StackMain;
9
10
  //# sourceMappingURL=StackMain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackMain.d.ts","sourceRoot":"","sources":["../../../../src/components/StackMain.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAa5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAsB/D,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,SAAS,+BAAgC,cAAc,sBA2K5D,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"StackMain.d.ts","sourceRoot":"","sources":["../../../../src/components/StackMain.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAa5D,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAsB/D,KAAK,cAAc,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,SAAS,mCAAoC,cAAc,sBA6KhE,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,8 +1,8 @@
1
- import React from 'react';
2
- export declare const StackMain: React.LazyExoticComponent<({ collection, separation }: {
1
+ export declare const StackMain: import("react").LazyExoticComponent<({ id, collection, separation }: {
2
+ id: string;
3
3
  collection: import("packages/plugins/plugin-space/dist/types/src").CollectionType;
4
4
  separation?: boolean;
5
- }) => React.JSX.Element>;
5
+ }) => import("react").JSX.Element>;
6
6
  export * from './StackSettings';
7
7
  export * from './AddSectionDialog';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,SAAS;;;wBAA0C,CAAC;AAEjE,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;kCAAoC,CAAC;AAE3D,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -1,12 +1,9 @@
1
- import { type IconProps } from '@phosphor-icons/react';
2
- import React from 'react';
3
1
  export declare const STACK_PLUGIN = "dxos.org/plugin/stack";
4
2
  export declare const SECTION_IDENTIFIER = "dxos.org/type/StackSection";
5
3
  declare const _default: {
6
4
  id: string;
7
5
  name: string;
8
- iconComponent: (props: IconProps) => React.JSX.Element;
9
- iconSymbol: string;
6
+ icon: string;
10
7
  };
11
8
  export default _default;
12
9
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,YAAY,0BAA0B,CAAC;AACpD,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;;;;2BAMtC,SAAS;;;AAJlC,wBAME"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,0BAA0B,CAAC;AACpD,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;;;;;;AAE/D,wBAKuB"}