@dxos/plugin-stack 0.8.2-staging.7ac8446 → 0.8.2
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/StackMain-RIX67KLY.mjs +315 -0
- package/dist/lib/browser/StackMain-RIX67KLY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-L34RFJ2L.mjs → chunk-XOUJQIK6.mjs} +10 -9
- package/dist/lib/browser/chunk-XOUJQIK6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +10 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-ED2DI7B5.mjs +46 -0
- package/dist/lib/browser/react-surface-ED2DI7B5.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/StackMain-4DMJWHZ3.cjs +329 -0
- package/dist/lib/node/StackMain-4DMJWHZ3.cjs.map +7 -0
- package/dist/lib/node/{chunk-6IPBX635.cjs → chunk-5QWZH22T.cjs} +12 -11
- package/dist/lib/node/chunk-5QWZH22T.cjs.map +7 -0
- package/dist/lib/node/index.cjs +5 -29
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-L52YERMX.cjs +64 -0
- package/dist/lib/node/react-surface-L52YERMX.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/StackMain-7FHYHLK6.mjs +316 -0
- package/dist/lib/node-esm/StackMain-7FHYHLK6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3ZYHKSIS.mjs → chunk-3R62SZZT.mjs} +10 -9
- package/dist/lib/node-esm/chunk-3R62SZZT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -38
- 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-6WUOGQY6.mjs +47 -0
- package/dist/lib/node-esm/react-surface-6WUOGQY6.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/CaretDownUp.d.ts.map +1 -1
- package/dist/types/src/components/StackMain.d.ts.map +1 -1
- package/dist/types/src/components/StackSection.d.ts +2 -1
- package/dist/types/src/components/StackSection.d.ts.map +1 -1
- package/dist/types/src/components/StackSettings.d.ts.map +1 -1
- package/dist/types/src/types/stack.d.ts +11 -11
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -23
- package/src/StackPlugin.ts +53 -0
- package/src/capabilities/index.ts +7 -0
- package/src/capabilities/react-surface.tsx +33 -0
- package/src/components/StackMain.tsx +11 -9
- package/src/components/StackSection.tsx +5 -3
- package/src/types/stack.ts +7 -5
- package/src/types/types.ts +2 -2
- package/dist/lib/browser/StackMain-E42SHTS6.mjs +0 -295
- package/dist/lib/browser/StackMain-E42SHTS6.mjs.map +0 -7
- package/dist/lib/browser/chunk-L34RFJ2L.mjs.map +0 -7
- package/dist/lib/node/StackMain-4N6IFLMF.cjs +0 -309
- package/dist/lib/node/StackMain-4N6IFLMF.cjs.map +0 -7
- package/dist/lib/node/chunk-6IPBX635.cjs.map +0 -7
- package/dist/lib/node-esm/StackMain-QFKYWI2J.mjs +0 -296
- package/dist/lib/node-esm/StackMain-QFKYWI2J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3ZYHKSIS.mjs.map +0 -7
- package/src/StackPlugin.tsx +0 -76
package/dist/lib/node/index.cjs
CHANGED
|
@@ -34,20 +34,13 @@ __export(node_exports, {
|
|
|
34
34
|
meta: () => import_chunk_F7ZNJ53O.meta
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(node_exports);
|
|
37
|
+
var import_chunk_5QWZH22T = require("./chunk-5QWZH22T.cjs");
|
|
37
38
|
var import_chunk_F7ZNJ53O = require("./chunk-F7ZNJ53O.cjs");
|
|
38
|
-
var import_chunk_6IPBX635 = require("./chunk-6IPBX635.cjs");
|
|
39
|
-
var import_react = __toESM(require("react"));
|
|
40
39
|
var import_app_framework = require("@dxos/app-framework");
|
|
41
|
-
var import_echo = require("@dxos/client/echo");
|
|
42
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
43
40
|
var import_plugin_client = require("@dxos/plugin-client");
|
|
44
|
-
var
|
|
45
|
-
var import_react2 = require("react");
|
|
46
|
-
var import_react3 = __toESM(require("react"));
|
|
47
|
-
var import_react_ui = require("@dxos/react-ui");
|
|
48
|
-
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
41
|
+
var import_app_framework2 = require("@dxos/app-framework");
|
|
49
42
|
var import_react_ui_stack = require("@dxos/react-ui-stack");
|
|
50
|
-
var
|
|
43
|
+
var ReactSurface = (0, import_app_framework2.lazy)(() => import("./react-surface-L52YERMX.cjs"));
|
|
51
44
|
var translations_default = [
|
|
52
45
|
{
|
|
53
46
|
"en-US": {
|
|
@@ -111,30 +104,13 @@ var StackPlugin = () => (0, import_app_framework.definePlugin)(import_chunk_F7ZN
|
|
|
111
104
|
id: `${import_chunk_F7ZNJ53O.meta.id}/module/schema`,
|
|
112
105
|
activatesOn: import_plugin_client.ClientEvents.SetupSchema,
|
|
113
106
|
activate: () => (0, import_app_framework.contributes)(import_plugin_client.ClientCapabilities.Schema, [
|
|
114
|
-
|
|
107
|
+
import_chunk_5QWZH22T.StackViewType
|
|
115
108
|
])
|
|
116
109
|
}),
|
|
117
110
|
(0, import_app_framework.defineModule)({
|
|
118
111
|
id: `${import_chunk_F7ZNJ53O.meta.id}/module/react-surface`,
|
|
119
112
|
activatesOn: import_app_framework.Events.SetupReactSurface,
|
|
120
|
-
activate:
|
|
121
|
-
id: `${import_chunk_F7ZNJ53O.STACK_PLUGIN}/article`,
|
|
122
|
-
role: "article",
|
|
123
|
-
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.CollectionType, data.subject),
|
|
124
|
-
component: ({ data }) => {
|
|
125
|
-
const id = typeof data.id === "string" ? data.id : void 0;
|
|
126
|
-
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
127
|
-
role: "none",
|
|
128
|
-
className: "overflow-auto",
|
|
129
|
-
style: {
|
|
130
|
-
contain: "layout"
|
|
131
|
-
}
|
|
132
|
-
}, /* @__PURE__ */ import_react.default.createElement(StackMain, {
|
|
133
|
-
id: id ?? (0, import_echo.fullyQualifiedId)(data.subject),
|
|
134
|
-
collection: data.subject
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
}))
|
|
113
|
+
activate: ReactSurface
|
|
138
114
|
})
|
|
139
115
|
]);
|
|
140
116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/StackPlugin.
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/StackPlugin.ts", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { type AnyLiveObject } from '@dxos/client/echo';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { ReactSurface } from './capabilities';\nimport { meta, SECTION_IDENTIFIER } from './meta';\nimport translations from './translations';\nimport { StackViewType } from './types';\n\nexport const StackPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () => [\n contributes(Capabilities.Metadata, {\n id: SECTION_IDENTIFIER,\n metadata: {\n parse: (section: { object: AnyLiveObject<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 }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [StackViewType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const ReactSurface = lazy(() => import('./react-surface'));\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 'empty stack message': 'Drag items into the stack.',\n 'remove section label': 'Delete',\n 'navigate to section label': 'Navigate to item',\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 item.',\n },\n },\n },\n ...stackTranslations,\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA8E;AAE9E,2BAAiD;ACFjD,IAAAA,wBAAqB;ACArB,4BAAkD;ADE3C,IAAMC,mBAAeC,4BAAK,MAAM,OAAO,8BAAA,CAAA;ACE9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACC,kCAAAA,GAAe;QACd,eAAe;QACf,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,sBAAAA;;AFrBE,IAAMC,cAAc,UACzBC,mCAAaC,4BAAM;MACjBC,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOC;IACpBC,UAAU,UAAMC,kCAAYC,kCAAaC,cAAcC,oBAAAA;EACzD,CAAA;MACAT,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOO;IACpBL,UAAU,MAAM;UACdC,kCAAYC,kCAAaI,UAAU;QACjCV,IAAIW;QACJC,UAAU;UACRC,OAAO,CAACC,SAAyCC,SAAAA;AAC/C,oBAAQA,MAAAA;cACN,KAAK;AAEH,uBAAO;kBAAEf,IAAIc,QAAQE,OAAOhB;kBAAIiB,OAAOH,QAAQE,OAAOE;kBAAOC,MAAML,QAAQE;gBAAO;cACpF,KAAK;AACH,uBAAOF,QAAQE;cACjB,KAAK;AACH,uBAAOF;YACX;UACF;QACF;MACF,CAAA;;EAEJ,CAAA;MACAf,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAamB,kCAAaC;IAC1BjB,UAAU,UAAMC,kCAAYiB,wCAAmBC,QAAQ;MAACC;KAAc;EACxE,CAAA;MACAzB,mCAAa;IACXC,IAAI,GAAGF,2BAAKE,EAAE;IACdC,aAAaC,4BAAOuB;IACpBrB,UAAUZ;EACZ,CAAA;CACD;",
|
|
6
|
+
"names": ["import_app_framework", "ReactSurface", "lazy", "STACK_PLUGIN", "stackTranslations", "StackPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "SECTION_IDENTIFIER", "metadata", "parse", "section", "type", "object", "label", "title", "data", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "StackViewType", "SetupReactSurface"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytes":2262,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytes":2814,"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":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackContext.tsx":{"bytes":1887,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx":{"bytes":3039,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSection.tsx":{"bytes":17464,"imports":[{"path":"@radix-ui/react-collapsible","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-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":"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"packages/plugins/plugin-stack/src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/types/stack.ts":{"bytes":3411,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/types/types.ts":{"bytes":2111,"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/StackMain.tsx":{"bytes":18779,"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-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":"packages/plugins/plugin-stack/src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"packages/plugins/plugin-stack/src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"},{"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":873,"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/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"packages/plugins/plugin-stack/src/translations.ts":{"bytes":4239,"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":11027,"imports":[{"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/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","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":592,"imports":[{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-stack/src/StackPlugin.tsx","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-stack/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8229},"packages/plugins/plugin-stack/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-6IPBX635.cjs","kind":"import-statement"},{"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/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","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":"packages/plugins/plugin-stack/dist/lib/node/StackMain-4N6IFLMF.cjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","StackPlugin","meta"],"entryPoint":"packages/plugins/plugin-stack/src/index.ts","inputs":{"packages/plugins/plugin-stack/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-stack/src/StackPlugin.tsx":{"bytesInOutput":2245},"packages/plugins/plugin-stack/src/components/index.ts":{"bytesInOutput":94},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytesInOutput":167},"packages/plugins/plugin-stack/src/translations.ts":{"bytesInOutput":1230}},"bytes":4329},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-6IPBX635.cjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"packages/plugins/plugin-stack/src/types/index.ts","inputs":{},"bytes":154},"packages/plugins/plugin-stack/dist/lib/node/StackMain-4N6IFLMF.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21725},"packages/plugins/plugin-stack/dist/lib/node/StackMain-4N6IFLMF.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-6IPBX635.cjs","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-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","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":"react","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":4402},"packages/plugins/plugin-stack/src/components/StackContext.tsx":{"bytesInOutput":265},"packages/plugins/plugin-stack/src/components/StackSection.tsx":{"bytesInOutput":5146},"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx":{"bytesInOutput":771}},"bytes":11175},"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1034},"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs":{"imports":[],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","meta"],"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytesInOutput":557}},"bytes":704},"packages/plugins/plugin-stack/dist/lib/node/chunk-6IPBX635.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1614},"packages/plugins/plugin-stack/dist/lib/node/chunk-6IPBX635.cjs":{"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":657}}}
|
|
1
|
+
{"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytes":2218,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytes":2968,"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":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackContext.tsx":{"bytes":1847,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx":{"bytes":3241,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/components/StackSection.tsx":{"bytes":17900,"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","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":"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"packages/plugins/plugin-stack/src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-stack/src/types/stack.ts":{"bytes":3567,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-stack/src/types/types.ts":{"bytes":2067,"imports":[],"format":"esm"},"packages/plugins/plugin-stack/src/types/index.ts":{"bytes":549,"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/StackMain.tsx":{"bytes":19550,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"effect","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-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":"packages/plugins/plugin-stack/src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"packages/plugins/plugin-stack/src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"},{"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":837,"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/StackMain.tsx","kind":"dynamic-import","original":"./StackMain"}],"format":"esm"},"packages/plugins/plugin-stack/src/capabilities/react-surface.tsx":{"bytes":4565,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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"}],"format":"esm"},"packages/plugins/plugin-stack/src/capabilities/index.ts":{"bytes":791,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-stack/src/translations.ts":{"bytes":4167,"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.ts":{"bytes":6972,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-stack/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"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":560,"imports":[{"path":"packages/plugins/plugin-stack/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-stack/src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-stack/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5354},"packages/plugins/plugin-stack/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-5QWZH22T.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs","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":"packages/plugins/plugin-stack/dist/lib/node/react-surface-L52YERMX.cjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","StackPlugin","meta"],"entryPoint":"packages/plugins/plugin-stack/src/index.ts","inputs":{"packages/plugins/plugin-stack/src/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-stack/src/StackPlugin.ts":{"bytesInOutput":1402},"packages/plugins/plugin-stack/src/capabilities/index.ts":{"bytesInOutput":115},"packages/plugins/plugin-stack/src/translations.ts":{"bytesInOutput":1230}},"bytes":3215},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-stack/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-5QWZH22T.cjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"packages/plugins/plugin-stack/src/types/index.ts","inputs":{},"bytes":154},"packages/plugins/plugin-stack/dist/lib/node/StackMain-4DMJWHZ3.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21913},"packages/plugins/plugin-stack/dist/lib/node/StackMain-4DMJWHZ3.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-5QWZH22T.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"effect","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-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","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":"packages/plugins/plugin-stack/src/components/StackMain.tsx","inputs":{"packages/plugins/plugin-stack/src/components/StackMain.tsx":{"bytesInOutput":4888},"packages/plugins/plugin-stack/src/components/StackContext.tsx":{"bytesInOutput":265},"packages/plugins/plugin-stack/src/components/StackSection.tsx":{"bytesInOutput":5487},"packages/plugins/plugin-stack/src/components/CaretDownUp.tsx":{"bytesInOutput":972}},"bytes":12203},"packages/plugins/plugin-stack/dist/lib/node/chunk-5QWZH22T.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1718},"packages/plugins/plugin-stack/dist/lib/node/chunk-5QWZH22T.cjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"packages/plugins/plugin-stack/src/types/stack.ts":{"bytesInOutput":595},"packages/plugins/plugin-stack/src/types/index.ts":{"bytesInOutput":0}},"bytes":737},"packages/plugins/plugin-stack/dist/lib/node/react-surface-L52YERMX.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3556},"packages/plugins/plugin-stack/dist/lib/node/react-surface-L52YERMX.cjs":{"imports":[{"path":"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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":"packages/plugins/plugin-stack/dist/lib/node/StackMain-4DMJWHZ3.cjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-stack/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-stack/src/capabilities/react-surface.tsx":{"bytesInOutput":888},"packages/plugins/plugin-stack/src/components/index.ts":{"bytesInOutput":94},"packages/plugins/plugin-stack/src/components/StackSettings.tsx":{"bytesInOutput":248}},"bytes":1705},"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1034},"packages/plugins/plugin-stack/dist/lib/node/chunk-F7ZNJ53O.cjs":{"imports":[],"exports":["SECTION_IDENTIFIER","STACK_PLUGIN","meta"],"inputs":{"packages/plugins/plugin-stack/src/meta.ts":{"bytesInOutput":557}},"bytes":704}}}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_surface_L52YERMX_exports = {};
|
|
30
|
+
__export(react_surface_L52YERMX_exports, {
|
|
31
|
+
default: () => react_surface_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(react_surface_L52YERMX_exports);
|
|
34
|
+
var import_chunk_F7ZNJ53O = require("./chunk-F7ZNJ53O.cjs");
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_app_framework = require("@dxos/app-framework");
|
|
37
|
+
var import_echo_schema = require("@dxos/echo-schema");
|
|
38
|
+
var import_types = require("@dxos/plugin-space/types");
|
|
39
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
40
|
+
var import_react2 = require("react");
|
|
41
|
+
var import_tracking = require("@preact-signals/safe-react/tracking");
|
|
42
|
+
var import_react3 = __toESM(require("react"));
|
|
43
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
44
|
+
var import_react_ui_form = require("@dxos/react-ui-form");
|
|
45
|
+
var StackMain = (0, import_react2.lazy)(() => import("./StackMain-4DMJWHZ3.cjs"));
|
|
46
|
+
var react_surface_default = () => (0, import_app_framework.contributes)(import_app_framework.Capabilities.ReactSurface, (0, import_app_framework.createSurface)({
|
|
47
|
+
id: `${import_chunk_F7ZNJ53O.STACK_PLUGIN}/article`,
|
|
48
|
+
role: "article",
|
|
49
|
+
filter: (data) => (0, import_echo_schema.isInstanceOf)(import_types.CollectionType, data.subject),
|
|
50
|
+
component: ({ data }) => {
|
|
51
|
+
const id = typeof data.id === "string" ? data.id : void 0;
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
53
|
+
role: "none",
|
|
54
|
+
className: "overflow-auto",
|
|
55
|
+
style: {
|
|
56
|
+
contain: "layout"
|
|
57
|
+
}
|
|
58
|
+
}, /* @__PURE__ */ import_react.default.createElement(StackMain, {
|
|
59
|
+
id: id ?? (0, import_echo.fullyQualifiedId)(data.subject),
|
|
60
|
+
collection: data.subject
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
//# sourceMappingURL=react-surface-L52YERMX.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/index.ts", "../../../src/components/StackSettings.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, contributes, createSurface } from '@dxos/app-framework';\nimport { isInstanceOf } from '@dxos/echo-schema';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\n\nimport { StackMain } from '../components';\nimport { STACK_PLUGIN } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.ReactSurface,\n createSurface({\n id: `${STACK_PLUGIN}/article`,\n role: 'article',\n filter: (data): data is { id?: string; subject: CollectionType } => isInstanceOf(CollectionType, data.subject),\n component: ({ data }) => {\n // This allows the id to be overridden by the surface for situations where the id of the collection\n // is not the same as the id of what is being represented (e.g., a space with a root collection).\n const id = typeof data.id === 'string' ? data.id : undefined;\n return (\n <div role='none' className='overflow-auto' style={{ contain: 'layout' }}>\n <StackMain id={id ?? fullyQualifiedId(data.subject)} collection={data.subject} />\n </div>\n );\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';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';\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 <DeprecatedFormContainer>\n <DeprecatedFormInput label={t('settings separation label')}>\n <Input.Switch checked={settings.separation} onCheckedChange={(checked) => (settings.separation = !!checked)} />\n </DeprecatedFormInput>\n </DeprecatedFormContainer>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkB;AAElB,2BAAyD;AACzD,yBAA6B;AAC7B,mBAA+B;AAC/B,kBAAiC;ACLjC,IAAAA,gBAAqB;;ACArB,IAAAA,gBAAkB;AAElB,sBAAsC;AACtC,2BAA6D;ADDtD,IAAMC,gBAAYC,oBAAK,MAAM,OAAO,0BAAA,CAAA;ADQ3C,IAAA,wBAAe,UACbC,kCACEC,kCAAaC,kBACbC,oCAAc;EACZC,IAAI,GAAGC,kCAAAA;EACPC,MAAM;EACNC,QAAQ,CAACC,aAA2DC,iCAAaC,6BAAgBF,KAAKG,OAAO;EAC7GC,WAAW,CAAC,EAAEJ,KAAI,MAAE;AAGlB,UAAMJ,KAAK,OAAOI,KAAKJ,OAAO,WAAWI,KAAKJ,KAAKS;AACnD,WACEC,6BAAAA,QAAA,cAACC,OAAAA;MAAIT,MAAK;MAAOU,WAAU;MAAgBC,OAAO;QAAEC,SAAS;MAAS;OACpEJ,6BAAAA,QAAA,cAAChB,WAAAA;MAAUM,IAAIA,UAAMe,8BAAiBX,KAAKG,OAAO;MAAGS,YAAYZ,KAAKG;;EAG5E;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["import_react", "StackMain", "lazy", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "STACK_PLUGIN", "role", "filter", "data", "isInstanceOf", "CollectionType", "subject", "component", "undefined", "React", "div", "className", "style", "contain", "fullyQualifiedId", "collection"]
|
|
7
|
+
}
|
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
SectionSchema: () =>
|
|
22
|
-
StackViewType: () =>
|
|
21
|
+
SectionSchema: () => import_chunk_5QWZH22T.SectionSchema,
|
|
22
|
+
StackViewType: () => import_chunk_5QWZH22T.StackViewType
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(types_exports);
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_5QWZH22T = require("../chunk-5QWZH22T.cjs");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
SectionSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n SectionSchema,\n StackViewType\n} from \"../chunk-
|
|
4
|
+
"sourcesContent": ["import {\n SectionSchema,\n StackViewType\n} from \"../chunk-5QWZH22T.cjs\";\nexport {\n SectionSchema,\n StackViewType\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAGO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
StackViewType
|
|
4
|
+
} from "./chunk-3R62SZZT.mjs";
|
|
5
|
+
import {
|
|
6
|
+
STACK_PLUGIN
|
|
7
|
+
} from "./chunk-YW7WYA4H.mjs";
|
|
8
|
+
|
|
9
|
+
// packages/plugins/plugin-stack/src/components/StackMain.tsx
|
|
10
|
+
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
11
|
+
import { Plus } from "@phosphor-icons/react";
|
|
12
|
+
import { Option } from "effect";
|
|
13
|
+
import React3, { useCallback, useEffect, useMemo, useState as useState2 } from "react";
|
|
14
|
+
import { Capabilities, createIntent, LayoutAction, useAppGraph, useCapabilities, useIntentDispatcher } from "@dxos/app-framework";
|
|
15
|
+
import { fullyQualifiedId, getTypename, isLiveObject, live, makeRef } from "@dxos/client/echo";
|
|
16
|
+
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
17
|
+
import { Button, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
18
|
+
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
19
|
+
import { Stack } from "@dxos/react-ui-stack";
|
|
20
|
+
import { isNonNullable } from "@dxos/util";
|
|
21
|
+
|
|
22
|
+
// packages/plugins/plugin-stack/src/components/StackContext.tsx
|
|
23
|
+
import { createContext, useContext } from "react";
|
|
24
|
+
var StackContext = /* @__PURE__ */ createContext({
|
|
25
|
+
onCollapse: () => {
|
|
26
|
+
},
|
|
27
|
+
onNavigate: async () => {
|
|
28
|
+
},
|
|
29
|
+
onDelete: async () => {
|
|
30
|
+
},
|
|
31
|
+
onAdd: () => {
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var useStack = () => useContext(StackContext);
|
|
35
|
+
|
|
36
|
+
// packages/plugins/plugin-stack/src/components/StackSection.tsx
|
|
37
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
38
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
39
|
+
import React2, { useState } from "react";
|
|
40
|
+
import { Surface } from "@dxos/app-framework";
|
|
41
|
+
import { DropdownMenu, Icon, useTranslation, IconButton } from "@dxos/react-ui";
|
|
42
|
+
import { useAttendableAttributes } from "@dxos/react-ui-attention";
|
|
43
|
+
import { StackItem } from "@dxos/react-ui-stack";
|
|
44
|
+
import { mx, getSize, textBlockWidth } from "@dxos/react-ui-theme";
|
|
45
|
+
|
|
46
|
+
// packages/plugins/plugin-stack/src/components/CaretDownUp.tsx
|
|
47
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
48
|
+
import React from "react";
|
|
49
|
+
var CaretDownUp = ({ children, ...props }) => {
|
|
50
|
+
var _effect = _useSignals();
|
|
51
|
+
try {
|
|
52
|
+
return /* @__PURE__ */ React.createElement("svg", {
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
viewBox: "0 0 256 256",
|
|
55
|
+
...props
|
|
56
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
57
|
+
width: "256",
|
|
58
|
+
height: "256",
|
|
59
|
+
fill: "none"
|
|
60
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
61
|
+
points: "80 224 128 176 176 224",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeLinecap: "round",
|
|
65
|
+
strokeLinejoin: "round",
|
|
66
|
+
strokeWidth: "16"
|
|
67
|
+
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
68
|
+
points: "80 32 128 80 176 32",
|
|
69
|
+
fill: "none",
|
|
70
|
+
stroke: "currentColor",
|
|
71
|
+
strokeLinecap: "round",
|
|
72
|
+
strokeLinejoin: "round",
|
|
73
|
+
strokeWidth: "16"
|
|
74
|
+
}), children);
|
|
75
|
+
} finally {
|
|
76
|
+
_effect.f();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// packages/plugins/plugin-stack/src/components/StackSection.tsx
|
|
81
|
+
var sectionActionDimensions = "p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min";
|
|
82
|
+
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
83
|
+
var _effect = _useSignals2();
|
|
84
|
+
try {
|
|
85
|
+
const { t } = useTranslation(STACK_PLUGIN);
|
|
86
|
+
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
87
|
+
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
88
|
+
const attendableAttrs = useAttendableAttributes(id);
|
|
89
|
+
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
90
|
+
asChild: true,
|
|
91
|
+
open: !view.collapsed,
|
|
92
|
+
onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
|
|
93
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Root, {
|
|
94
|
+
item: {
|
|
95
|
+
id
|
|
96
|
+
},
|
|
97
|
+
role: "section",
|
|
98
|
+
...attendableAttrs,
|
|
99
|
+
classNames: "border-be border-separator"
|
|
100
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
101
|
+
classNames: "attention-surface border-ie !border-separator"
|
|
102
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
103
|
+
className: "sr-only"
|
|
104
|
+
}, view.title), /* @__PURE__ */ React2.createElement("div", {
|
|
105
|
+
role: "none",
|
|
106
|
+
className: "sticky -block-start-px bg-[--sticky-bg] p-1 is-full"
|
|
107
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
|
|
108
|
+
open: optionsMenuOpen,
|
|
109
|
+
onOpenChange: setOptionsMenuOpen
|
|
110
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
|
|
111
|
+
asChild: true
|
|
112
|
+
}, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
113
|
+
icon,
|
|
114
|
+
size: 5,
|
|
115
|
+
classNames: "transition-opacity"
|
|
116
|
+
}))), /* @__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, {
|
|
117
|
+
onClick: () => onNavigate(id),
|
|
118
|
+
"data-testid": "section.navigate-to"
|
|
119
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
120
|
+
icon: "ph--arrow-right--regular",
|
|
121
|
+
size: 5
|
|
122
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
123
|
+
className: "mis-2 grow"
|
|
124
|
+
}, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
125
|
+
asChild: true
|
|
126
|
+
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
|
|
127
|
+
className: getSize(5)
|
|
128
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
129
|
+
className: "mis-2 grow"
|
|
130
|
+
}, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
131
|
+
onClick: () => onAdd(id, "before"),
|
|
132
|
+
"data-testid": "section.add-before"
|
|
133
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
134
|
+
icon: "ph--arrow-line-up--regular",
|
|
135
|
+
size: 5
|
|
136
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
137
|
+
className: "mis-2 grow"
|
|
138
|
+
}, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
139
|
+
onClick: () => onAdd(id, "after"),
|
|
140
|
+
"data-testid": "section.add-after"
|
|
141
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
142
|
+
icon: "ph--arrow-line-down--regular",
|
|
143
|
+
size: 5
|
|
144
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
145
|
+
className: "mis-2 grow"
|
|
146
|
+
}, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
147
|
+
onClick: () => onDelete(id),
|
|
148
|
+
"data-testid": "section.remove"
|
|
149
|
+
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
150
|
+
icon: "ph--trash--regular",
|
|
151
|
+
size: 5
|
|
152
|
+
}), /* @__PURE__ */ React2.createElement("span", {
|
|
153
|
+
className: "mis-2 grow"
|
|
154
|
+
}, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
155
|
+
asChild: true
|
|
156
|
+
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
157
|
+
iconOnly: true,
|
|
158
|
+
variant: "ghost",
|
|
159
|
+
label: t("expand label"),
|
|
160
|
+
icon: "ph--caret-up-down--regular",
|
|
161
|
+
classNames: sectionActionDimensions
|
|
162
|
+
})) : /* @__PURE__ */ React2.createElement(IconButton, {
|
|
163
|
+
iconOnly: true,
|
|
164
|
+
variant: "ghost",
|
|
165
|
+
onClick: () => onNavigate(id),
|
|
166
|
+
label: t("navigate to section label"),
|
|
167
|
+
icon: "ph--arrow-right--regular",
|
|
168
|
+
"data-testid": "section.navigate-to",
|
|
169
|
+
classNames: sectionActionDimensions
|
|
170
|
+
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface, {
|
|
171
|
+
role: "section",
|
|
172
|
+
data: {
|
|
173
|
+
subject: object
|
|
174
|
+
},
|
|
175
|
+
limit: 1,
|
|
176
|
+
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
177
|
+
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
178
|
+
classNames: "attention-surface"
|
|
179
|
+
}, /* @__PURE__ */ React2.createElement("h2", {
|
|
180
|
+
className: mx("flex items-center p-4 font-medium", textBlockWidth)
|
|
181
|
+
}, view.title))));
|
|
182
|
+
} finally {
|
|
183
|
+
_effect.f();
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// packages/plugins/plugin-stack/src/components/StackMain.tsx
|
|
188
|
+
var StackMain = ({ id, collection }) => {
|
|
189
|
+
var _effect = _useSignals3();
|
|
190
|
+
try {
|
|
191
|
+
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
192
|
+
const { graph } = useAppGraph();
|
|
193
|
+
const { t } = useTranslation2(STACK_PLUGIN);
|
|
194
|
+
const allMetadata = useCapabilities(Capabilities.Metadata);
|
|
195
|
+
const defaultStack = useMemo(() => live(StackViewType, {
|
|
196
|
+
sections: {}
|
|
197
|
+
}), [
|
|
198
|
+
collection
|
|
199
|
+
]);
|
|
200
|
+
const stack = collection.views[StackViewType.typename]?.target ?? defaultStack;
|
|
201
|
+
const [collapsedSections, setCollapsedSections] = useState2({});
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
if (!collection.views[StackViewType.typename]) {
|
|
204
|
+
collection.views[StackViewType.typename] = makeRef(stack);
|
|
205
|
+
}
|
|
206
|
+
}, [
|
|
207
|
+
collection,
|
|
208
|
+
stack
|
|
209
|
+
]);
|
|
210
|
+
const items = collection.objects.map((object) => object.target).filter(isNonNullable).map((object) => {
|
|
211
|
+
const metadata = allMetadata.find((m) => m.id === (getTypename(object) ?? "never"))?.metadata;
|
|
212
|
+
const view = {
|
|
213
|
+
...stack.sections[object.id],
|
|
214
|
+
collapsed: collapsedSections[fullyQualifiedId(object)],
|
|
215
|
+
title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
|
|
216
|
+
toLocalizedString(graph.getNode(fullyQualifiedId(object)).pipe(Option.getOrNull)?.properties.label, t)
|
|
217
|
+
};
|
|
218
|
+
return {
|
|
219
|
+
id: fullyQualifiedId(object),
|
|
220
|
+
object,
|
|
221
|
+
metadata,
|
|
222
|
+
view
|
|
223
|
+
};
|
|
224
|
+
}) ?? [];
|
|
225
|
+
const handleDelete = useCallback(async (id2) => {
|
|
226
|
+
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => fullyQualifiedId(section) === id2);
|
|
227
|
+
const object = collection.objects[index].target;
|
|
228
|
+
if (isLiveObject(object)) {
|
|
229
|
+
await dispatch(createIntent(SpaceAction.RemoveObjects, {
|
|
230
|
+
objects: [
|
|
231
|
+
object
|
|
232
|
+
],
|
|
233
|
+
target: collection
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
}, [
|
|
237
|
+
collection,
|
|
238
|
+
dispatch
|
|
239
|
+
]);
|
|
240
|
+
const handleAdd = useCallback(async (id2, position) => {
|
|
241
|
+
await dispatch?.(
|
|
242
|
+
// TODO(wittjosiah): Use object creation dialog.
|
|
243
|
+
createIntent(LayoutAction.UpdateDialog, {
|
|
244
|
+
part: "dialog",
|
|
245
|
+
subject: `${STACK_PLUGIN}/AddSectionDialog`,
|
|
246
|
+
options: {
|
|
247
|
+
blockAlign: "start",
|
|
248
|
+
props: {
|
|
249
|
+
path: id2,
|
|
250
|
+
position,
|
|
251
|
+
collection
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
);
|
|
256
|
+
}, [
|
|
257
|
+
collection,
|
|
258
|
+
dispatch
|
|
259
|
+
]);
|
|
260
|
+
const handleNavigate = useCallback(async (id2) => {
|
|
261
|
+
await dispatch(createIntent(LayoutAction.Open, {
|
|
262
|
+
part: "main",
|
|
263
|
+
subject: [
|
|
264
|
+
id2
|
|
265
|
+
]
|
|
266
|
+
}));
|
|
267
|
+
}, [
|
|
268
|
+
dispatch
|
|
269
|
+
]);
|
|
270
|
+
const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
|
|
271
|
+
...prev,
|
|
272
|
+
[id2]: collapsed
|
|
273
|
+
})), []);
|
|
274
|
+
const handleAddSection = useCallback(() => dispatch?.(createIntent(SpaceAction.OpenCreateObject, {
|
|
275
|
+
target: collection,
|
|
276
|
+
navigable: false
|
|
277
|
+
})), [
|
|
278
|
+
collection,
|
|
279
|
+
dispatch
|
|
280
|
+
]);
|
|
281
|
+
return /* @__PURE__ */ React3.createElement(AttentionProvider, {
|
|
282
|
+
id
|
|
283
|
+
}, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
|
|
284
|
+
value: {
|
|
285
|
+
onCollapse: handleCollapse,
|
|
286
|
+
onNavigate: handleNavigate,
|
|
287
|
+
onDelete: handleDelete,
|
|
288
|
+
onAdd: handleAdd
|
|
289
|
+
}
|
|
290
|
+
}, /* @__PURE__ */ React3.createElement(Stack, {
|
|
291
|
+
orientation: "vertical",
|
|
292
|
+
size: "intrinsic",
|
|
293
|
+
id,
|
|
294
|
+
"data-testid": "main.stack"
|
|
295
|
+
}, items.map((item) => /* @__PURE__ */ React3.createElement(StackSection, {
|
|
296
|
+
key: item.id,
|
|
297
|
+
...item
|
|
298
|
+
}))), /* @__PURE__ */ React3.createElement("div", {
|
|
299
|
+
role: "none",
|
|
300
|
+
className: "flex mlb-2 pli-2 justify-center"
|
|
301
|
+
}, /* @__PURE__ */ React3.createElement(Button, {
|
|
302
|
+
"data-testid": "stack.createSection",
|
|
303
|
+
classNames: "gap-2",
|
|
304
|
+
onClick: handleAddSection
|
|
305
|
+
}, /* @__PURE__ */ React3.createElement(Plus, null), /* @__PURE__ */ React3.createElement("span", {
|
|
306
|
+
className: "sr-only"
|
|
307
|
+
}, t("add section label"))))));
|
|
308
|
+
} finally {
|
|
309
|
+
_effect.f();
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
var StackMain_default = StackMain;
|
|
313
|
+
export {
|
|
314
|
+
StackMain_default as default
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=StackMain-7FHYHLK6.mjs.map
|