@dxos/plugin-stack 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{StackContainer-FUGH3ZJH.mjs → StackContainer-RE6RUEUV.mjs} +76 -56
- package/dist/lib/browser/StackContainer-RE6RUEUV.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4X7CK6FM.mjs → chunk-G4CLPE5A.mjs} +3 -3
- package/dist/lib/browser/chunk-G4CLPE5A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CD32XYEB.mjs → chunk-YPQYUBQP.mjs} +2 -2
- package/dist/lib/browser/{chunk-CD32XYEB.mjs.map → chunk-YPQYUBQP.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +10 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-FZ42XC67.mjs +33 -0
- package/dist/lib/browser/react-surface-FZ42XC67.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{StackContainer-PTZGEQFQ.mjs → StackContainer-OPQ76B4H.mjs} +76 -56
- package/dist/lib/node-esm/StackContainer-OPQ76B4H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-26XWE7UY.mjs → chunk-LELGTQAL.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-26XWE7UY.mjs.map → chunk-LELGTQAL.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-HEEGXPSW.mjs → chunk-LOZ6GH5A.mjs} +3 -3
- package/dist/lib/node-esm/chunk-LOZ6GH5A.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-CYNJK3QD.mjs +34 -0
- package/dist/lib/node-esm/react-surface-CYNJK3QD.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/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
- package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
- package/dist/types/src/components/StackContext/index.d.ts +2 -0
- package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
- package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
- package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
- package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
- package/dist/types/src/components/StackSection/index.d.ts +2 -0
- package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
- package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
- package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
- package/dist/types/src/components/StackSettings/index.d.ts +2 -0
- package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts +7 -0
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -0
- package/dist/types/src/containers/StackContainer/index.d.ts +3 -0
- package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -27
- package/src/StackPlugin.ts +6 -5
- package/src/capabilities/react-surface/react-surface.tsx +10 -12
- package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
- package/src/components/StackContext/index.ts +5 -0
- package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +19 -17
- package/src/components/StackSection/index.ts +5 -0
- package/src/components/StackSettings/StackSettings.tsx +30 -0
- package/src/components/StackSettings/index.ts +5 -0
- package/src/components/index.ts +2 -4
- package/src/{components → containers/StackContainer}/StackContainer.tsx +67 -62
- package/src/containers/StackContainer/index.ts +7 -0
- package/src/containers/index.ts +7 -0
- package/src/meta.ts +2 -2
- package/src/types/stack.ts +1 -1
- package/src/types/types.ts +1 -1
- package/dist/lib/browser/StackContainer-FUGH3ZJH.mjs.map +0 -7
- package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-ZEFLABZS.mjs +0 -40
- package/dist/lib/browser/react-surface-ZEFLABZS.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-PTZGEQFQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JQOFHBYS.mjs +0 -41
- package/dist/lib/node-esm/react-surface-JQOFHBYS.mjs.map +0 -7
- package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
- package/dist/types/src/components/StackContainer.d.ts +0 -9
- package/dist/types/src/components/StackContainer.d.ts.map +0 -1
- package/dist/types/src/components/StackContext.d.ts.map +0 -1
- package/dist/types/src/components/StackSection.d.ts.map +0 -1
- package/dist/types/src/components/StackSettings.d.ts.map +0 -1
- package/src/components/StackSettings.tsx +0 -30
- /package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +0 -0
- /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-G4CLPE5A.mjs";
|
|
4
|
+
|
|
5
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
10
|
+
import { Obj } from "@dxos/echo";
|
|
11
|
+
import { Collection } from "@dxos/echo";
|
|
12
|
+
|
|
13
|
+
// src/containers/index.ts
|
|
14
|
+
import { lazy } from "react";
|
|
15
|
+
var StackContainer = lazy(() => import("./StackContainer-RE6RUEUV.mjs"));
|
|
16
|
+
|
|
17
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
18
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
|
|
19
|
+
id: `${meta.id}.article`,
|
|
20
|
+
role: "article",
|
|
21
|
+
filter: (data) => typeof data.attendableId === "string" && Obj.instanceOf(Collection.Collection, data.subject),
|
|
22
|
+
component: ({ role, data }) => {
|
|
23
|
+
return /* @__PURE__ */ React.createElement(StackContainer, {
|
|
24
|
+
attendableId: data.attendableId,
|
|
25
|
+
role,
|
|
26
|
+
subject: data.subject
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}))));
|
|
30
|
+
export {
|
|
31
|
+
react_surface_default as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=react-surface-FZ42XC67.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\n\nimport { StackContainer } from '../../containers';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(\n Capabilities.ReactSurface,\n Surface.create({\n id: `${meta.id}.article`,\n role: 'article',\n filter: (data): data is { attendableId: string; subject: Collection.Collection } =>\n typeof data.attendableId === 'string' && Obj.instanceOf(Collection.Collection, data.subject),\n component: ({ role, data }) => {\n return <StackContainer attendableId={data.attendableId} role={role} subject={data.subject} />;\n },\n }),\n ),\n ),\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const StackContainer: ComponentType<any> = lazy(() => import('./StackContainer'));\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,kBAAkB;;;ACN3B,SAA6BC,YAAY;AAElC,IAAMC,iBAAqCC,KAAK,MAAM,OAAO,+BAAA,CAAA;;;ADSpE,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YACTC,aAAaC,cACbC,QAAQC,OAAO;EACbC,IAAI,GAAGC,KAAKD,EAAE;EACdE,MAAM;EACNC,QAAQ,CAACC,SACP,OAAOA,KAAKC,iBAAiB,YAAYC,IAAIC,WAAWC,WAAWA,YAAYJ,KAAKK,OAAO;EAC7FC,WAAW,CAAC,EAAER,MAAME,KAAI,MAAE;AACxB,WAAO,sBAAA,cAACO,gBAAAA;MAAeN,cAAcD,KAAKC;MAAcH;MAAYO,SAASL,KAAKK;;EACpF;AACF,CAAA,CAAA,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Collection", "lazy", "StackContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "attendableId", "Obj", "instanceOf", "Collection", "subject", "component", "StackContainer"]
|
|
7
|
+
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
meta
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LOZ6GH5A.mjs";
|
|
5
5
|
|
|
6
|
-
// src/
|
|
6
|
+
// src/containers/StackContainer/StackContainer.tsx
|
|
7
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
7
8
|
import * as Option from "effect/Option";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import React4, { useCallback, useState as useState2 } from "react";
|
|
10
|
+
import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
|
|
11
|
+
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
12
|
+
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
11
13
|
import { Obj } from "@dxos/echo";
|
|
14
|
+
import { AtomObj } from "@dxos/echo-atom";
|
|
12
15
|
import { Graph } from "@dxos/plugin-graph";
|
|
13
16
|
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
14
|
-
import { Toolbar, toLocalizedString, useTranslation as
|
|
15
|
-
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
17
|
+
import { Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
16
18
|
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
17
19
|
import { isNonNullable } from "@dxos/util";
|
|
18
20
|
|
|
19
|
-
// src/components/StackContext.tsx
|
|
21
|
+
// src/components/StackContext/StackContext.tsx
|
|
20
22
|
import { createContext, useContext } from "react";
|
|
21
23
|
var StackContext = /* @__PURE__ */ createContext({
|
|
24
|
+
attendableId: "",
|
|
22
25
|
onCollapse: () => {
|
|
23
26
|
},
|
|
24
27
|
onNavigate: async () => {
|
|
@@ -30,16 +33,16 @@ var StackContext = /* @__PURE__ */ createContext({
|
|
|
30
33
|
});
|
|
31
34
|
var useStack = () => useContext(StackContext);
|
|
32
35
|
|
|
33
|
-
// src/components/StackSection.tsx
|
|
36
|
+
// src/components/StackSection/StackSection.tsx
|
|
34
37
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
35
38
|
import React2, { useMemo, useState } from "react";
|
|
36
|
-
import { Surface } from "@dxos/app-framework/
|
|
39
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
37
40
|
import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
38
41
|
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
39
42
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
40
|
-
import { getSize, mx
|
|
43
|
+
import { getSize, mx } from "@dxos/ui-theme";
|
|
41
44
|
|
|
42
|
-
// src/components/CaretDownUp.tsx
|
|
45
|
+
// src/components/StackSection/CaretDownUp.tsx
|
|
43
46
|
import React from "react";
|
|
44
47
|
var CaretDownUp = ({ children, ...props }) => {
|
|
45
48
|
return /* @__PURE__ */ React.createElement("svg", {
|
|
@@ -67,18 +70,26 @@ var CaretDownUp = ({ children, ...props }) => {
|
|
|
67
70
|
}), children);
|
|
68
71
|
};
|
|
69
72
|
|
|
70
|
-
// src/components/StackSection.tsx
|
|
71
|
-
var sectionActionDimensions = "p-1
|
|
73
|
+
// src/components/StackSection/StackSection.tsx
|
|
74
|
+
var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
|
|
72
75
|
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
73
76
|
const { t } = useTranslation(meta.id);
|
|
74
|
-
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
77
|
+
const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
75
78
|
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
76
|
-
const
|
|
79
|
+
const attendableId = `${parentAttendableId}/${object.id}`;
|
|
80
|
+
const attentionAttrs = useAttentionAttributes(attendableId);
|
|
77
81
|
const stackItem = useMemo(() => ({
|
|
78
82
|
id
|
|
79
83
|
}), [
|
|
80
84
|
id
|
|
81
85
|
]);
|
|
86
|
+
const data = useMemo(() => ({
|
|
87
|
+
attendableId,
|
|
88
|
+
subject: object
|
|
89
|
+
}), [
|
|
90
|
+
object,
|
|
91
|
+
attendableId
|
|
92
|
+
]);
|
|
82
93
|
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
83
94
|
asChild: true,
|
|
84
95
|
open: !view.collapsed,
|
|
@@ -88,7 +99,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
88
99
|
role: "section",
|
|
89
100
|
...attentionAttrs
|
|
90
101
|
}, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
91
|
-
classNames: "attention-surface"
|
|
102
|
+
classNames: "dx-attention-surface"
|
|
92
103
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
93
104
|
className: "sr-only"
|
|
94
105
|
}, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
|
|
@@ -107,13 +118,13 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
107
118
|
icon: "ph--arrow-right--regular",
|
|
108
119
|
size: 5
|
|
109
120
|
}), /* @__PURE__ */ React2.createElement("span", {
|
|
110
|
-
className: "
|
|
121
|
+
className: "ms-2 grow"
|
|
111
122
|
}, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
112
123
|
asChild: true
|
|
113
124
|
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
|
|
114
125
|
className: getSize(5)
|
|
115
126
|
}), /* @__PURE__ */ React2.createElement("span", {
|
|
116
|
-
className: "
|
|
127
|
+
className: "ms-2 grow"
|
|
117
128
|
}, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
118
129
|
onClick: () => onAdd(id, "before"),
|
|
119
130
|
"data-testid": "section.add-before"
|
|
@@ -121,7 +132,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
121
132
|
icon: "ph--arrow-line-up--regular",
|
|
122
133
|
size: 5
|
|
123
134
|
}), /* @__PURE__ */ React2.createElement("span", {
|
|
124
|
-
className: "
|
|
135
|
+
className: "ms-2 grow"
|
|
125
136
|
}, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
126
137
|
onClick: () => onAdd(id, "after"),
|
|
127
138
|
"data-testid": "section.add-after"
|
|
@@ -129,7 +140,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
129
140
|
icon: "ph--arrow-line-down--regular",
|
|
130
141
|
size: 5
|
|
131
142
|
}), /* @__PURE__ */ React2.createElement("span", {
|
|
132
|
-
className: "
|
|
143
|
+
className: "ms-2 grow"
|
|
133
144
|
}, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
134
145
|
onClick: () => onDelete(id),
|
|
135
146
|
"data-testid": "section.remove"
|
|
@@ -137,7 +148,7 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
137
148
|
icon: "ph--trash--regular",
|
|
138
149
|
size: 5
|
|
139
150
|
}), /* @__PURE__ */ React2.createElement("span", {
|
|
140
|
-
className: "
|
|
151
|
+
className: "ms-2 grow"
|
|
141
152
|
}, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
142
153
|
asChild: true
|
|
143
154
|
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
@@ -154,28 +165,36 @@ var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--reg
|
|
|
154
165
|
icon: "ph--arrow-right--regular",
|
|
155
166
|
"data-testid": "section.navigate-to",
|
|
156
167
|
classNames: sectionActionDimensions
|
|
157
|
-
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface, {
|
|
168
|
+
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
158
169
|
role: "section",
|
|
159
|
-
data
|
|
160
|
-
subject: object
|
|
161
|
-
},
|
|
170
|
+
data,
|
|
162
171
|
limit: 1,
|
|
163
172
|
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
164
173
|
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
165
|
-
classNames: "attention-surface"
|
|
174
|
+
classNames: "dx-attention-surface"
|
|
166
175
|
}, /* @__PURE__ */ React2.createElement("h2", {
|
|
167
|
-
className: mx("flex items-center p-4 font-medium"
|
|
176
|
+
className: mx("flex items-center p-4 font-medium")
|
|
168
177
|
}, view.title))));
|
|
169
178
|
};
|
|
170
179
|
|
|
171
|
-
// src/components/
|
|
172
|
-
|
|
180
|
+
// src/components/StackSettings/StackSettings.tsx
|
|
181
|
+
import React3 from "react";
|
|
182
|
+
import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
183
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
184
|
+
|
|
185
|
+
// src/containers/StackContainer/StackContainer.tsx
|
|
186
|
+
var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
|
|
187
|
+
const snapshot = get(AtomObj.make(collection));
|
|
188
|
+
return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
|
|
189
|
+
}));
|
|
190
|
+
var StackContainer = ({ attendableId, subject: collection }) => {
|
|
173
191
|
const { invokePromise } = useOperationInvoker();
|
|
174
192
|
const { graph } = useAppGraph();
|
|
175
|
-
const { t } =
|
|
176
|
-
const allMetadata = useCapabilities(
|
|
193
|
+
const { t } = useTranslation3(meta.id);
|
|
194
|
+
const allMetadata = useCapabilities(AppCapabilities.Metadata);
|
|
177
195
|
const [collapsedSections, setCollapsedSections] = useState2({});
|
|
178
|
-
const
|
|
196
|
+
const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
|
|
197
|
+
const items = collectionObjects.map((object) => {
|
|
179
198
|
const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
|
|
180
199
|
const view = {
|
|
181
200
|
// ...stack.sections[object.id],
|
|
@@ -189,9 +208,9 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
189
208
|
metadata,
|
|
190
209
|
view
|
|
191
210
|
};
|
|
192
|
-
})
|
|
193
|
-
const handleDelete = useCallback(async (
|
|
194
|
-
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() ===
|
|
211
|
+
});
|
|
212
|
+
const handleDelete = useCallback(async (id) => {
|
|
213
|
+
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id);
|
|
195
214
|
const object = collection.objects[index].target;
|
|
196
215
|
if (Obj.isObject(object)) {
|
|
197
216
|
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
@@ -205,12 +224,12 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
205
224
|
collection,
|
|
206
225
|
invokePromise
|
|
207
226
|
]);
|
|
208
|
-
const handleAdd = useCallback(async (
|
|
209
|
-
await invokePromise(
|
|
210
|
-
subject: `${meta.id}
|
|
227
|
+
const handleAdd = useCallback(async (id, position) => {
|
|
228
|
+
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
229
|
+
subject: `${meta.id}.AddSectionDialog`,
|
|
211
230
|
blockAlign: "start",
|
|
212
231
|
props: {
|
|
213
|
-
path:
|
|
232
|
+
path: id,
|
|
214
233
|
position,
|
|
215
234
|
collection
|
|
216
235
|
}
|
|
@@ -219,18 +238,18 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
219
238
|
collection,
|
|
220
239
|
invokePromise
|
|
221
240
|
]);
|
|
222
|
-
const handleNavigate = useCallback(async (
|
|
223
|
-
await invokePromise(
|
|
241
|
+
const handleNavigate = useCallback(async (id) => {
|
|
242
|
+
await invokePromise(LayoutOperation.Open, {
|
|
224
243
|
subject: [
|
|
225
|
-
|
|
244
|
+
id
|
|
226
245
|
]
|
|
227
246
|
});
|
|
228
247
|
}, [
|
|
229
248
|
invokePromise
|
|
230
249
|
]);
|
|
231
|
-
const handleCollapse = useCallback((
|
|
250
|
+
const handleCollapse = useCallback((id, collapsed) => setCollapsedSections((prev) => ({
|
|
232
251
|
...prev,
|
|
233
|
-
[
|
|
252
|
+
[id]: collapsed
|
|
234
253
|
})), []);
|
|
235
254
|
const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
|
|
236
255
|
target: collection,
|
|
@@ -239,37 +258,38 @@ var StackContainer = ({ id, subject: collection }) => {
|
|
|
239
258
|
collection,
|
|
240
259
|
invokePromise
|
|
241
260
|
]);
|
|
242
|
-
return /* @__PURE__ */
|
|
261
|
+
return /* @__PURE__ */ React4.createElement(StackItem2.Content, {
|
|
243
262
|
toolbar: true,
|
|
244
|
-
classNames: "
|
|
245
|
-
}, /* @__PURE__ */
|
|
263
|
+
classNames: "dx-document"
|
|
264
|
+
}, /* @__PURE__ */ React4.createElement(Toolbar.Root, null, /* @__PURE__ */ React4.createElement(Toolbar.IconButton, {
|
|
246
265
|
icon: "ph--plus--regular",
|
|
247
266
|
iconOnly: true,
|
|
248
267
|
label: "Add section",
|
|
249
268
|
"data-testid": "stack.addSection",
|
|
250
269
|
onClick: handleAddSection
|
|
251
|
-
})), /* @__PURE__ */
|
|
252
|
-
id
|
|
253
|
-
}, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
|
|
270
|
+
})), /* @__PURE__ */ React4.createElement(StackContext.Provider, {
|
|
254
271
|
value: {
|
|
272
|
+
attendableId,
|
|
255
273
|
onCollapse: handleCollapse,
|
|
256
274
|
onNavigate: handleNavigate,
|
|
257
275
|
onDelete: handleDelete,
|
|
258
276
|
onAdd: handleAdd
|
|
259
277
|
}
|
|
260
|
-
}, /* @__PURE__ */
|
|
278
|
+
}, /* @__PURE__ */ React4.createElement(Stack, {
|
|
261
279
|
orientation: "vertical",
|
|
262
280
|
size: "intrinsic",
|
|
263
|
-
id,
|
|
281
|
+
id: Obj.getDXN(collection).toString(),
|
|
264
282
|
"data-testid": "main.stack",
|
|
265
283
|
classNames: "overflow-y-auto"
|
|
266
|
-
}, items.map((item) => /* @__PURE__ */
|
|
284
|
+
}, items.map((item) => /* @__PURE__ */ React4.createElement(StackSection, {
|
|
267
285
|
key: item.id,
|
|
268
286
|
...item
|
|
269
|
-
})))))
|
|
287
|
+
})))));
|
|
270
288
|
};
|
|
289
|
+
|
|
290
|
+
// src/containers/StackContainer/index.ts
|
|
271
291
|
var StackContainer_default = StackContainer;
|
|
272
292
|
export {
|
|
273
293
|
StackContainer_default as default
|
|
274
294
|
};
|
|
275
|
-
//# sourceMappingURL=StackContainer-
|
|
295
|
+
//# sourceMappingURL=StackContainer-OPQ76B4H.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/StackContainer/StackContainer.tsx", "../../../src/components/StackContext/StackContext.tsx", "../../../src/components/StackSection/StackSection.tsx", "../../../src/components/StackSection/CaretDownUp.tsx", "../../../src/components/StackSettings/StackSettings.tsx", "../../../src/containers/StackContainer/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { useAppGraph } from '@dxos/app-toolkit/ui';\nimport { Obj, type Ref } from '@dxos/echo';\nimport { type Collection } from '@dxos/echo';\nimport { AtomObj } from '@dxos/echo-atom';\nimport { Graph } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\nimport { StackContext, StackSection } from '../../components';\nimport { meta } from '../../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../../types';\n\nconst collectionObjectsFamily = Atom.family((collection: Collection.Collection) =>\n Atom.make((get) => {\n const snapshot = get(AtomObj.make(collection));\n return (\n snapshot.objects\n // TODO(wittjosiah): Why isn't this type inferred correctly?\n .map((ref: Ref.Ref<Obj.Unknown>) => get(AtomObj.makeWithReactive(ref)))\n .filter(isNonNullable)\n );\n }),\n);\n\ntype StackContainerProps = SurfaceComponentProps<Collection.Collection>;\n\nexport const StackContainer = ({ attendableId, subject: collection }: StackContainerProps) => {\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(AppCapabilities.Metadata);\n const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});\n\n // TODO(wittjosiah): Re-implement stack views with relations.\n // const defaultStack = useMemo(() => Obj.make(StackViewType, { sections: {} }), [collection]);\n // const stack = (collection.views[StackViewType.typename]?.target as StackViewType | undefined) ?? defaultStack;\n // useEffect(() => {\n // if (!collection.views[StackViewType.typename]) {\n // collection.views[StackViewType.typename] = Ref.make(stack);\n // }\n // }, [collection, stack]);\n\n const collectionObjects = useAtomValue(collectionObjectsFamily(collection));\n const items = collectionObjects.map((object: Obj.Unknown) => {\n const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[Obj.getDXN(object).toString()],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(\n Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label,\n t,\n ),\n } as StackSectionView;\n return { id: Obj.getDXN(object).toString(), object, metadata, view } satisfies StackSectionItem;\n });\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => Obj.getDXN(section).toString() === id);\n const object = collection.objects[index].target;\n if (Obj.isObject(object)) {\n await invokePromise(SpaceOperation.RemoveObjects, {\n objects: [object],\n target: collection,\n });\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n },\n [collection, invokePromise],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n // TODO(wittjosiah): Use object creation dialog.\n await invokePromise(LayoutOperation.UpdateDialog, {\n subject: `${meta.id}.AddSectionDialog`,\n blockAlign: 'start',\n props: {\n path: id,\n position,\n collection,\n },\n });\n },\n [collection, invokePromise],\n );\n\n const handleNavigate = useCallback(\n async (id: string) => {\n await invokePromise(LayoutOperation.Open, { subject: [id] });\n },\n [invokePromise],\n );\n\n const handleCollapse = useCallback(\n (id: string, collapsed: boolean) => setCollapsedSections((prev) => ({ ...prev, [id]: collapsed })),\n [],\n );\n\n const handleAddSection = useCallback(\n () =>\n invokePromise(SpaceOperation.OpenCreateObject, {\n target: collection,\n navigable: false,\n }),\n [collection, invokePromise],\n );\n\n return (\n <StackItem.Content toolbar classNames='dx-document'>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <StackContext.Provider\n value={{\n attendableId: attendableId!,\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack\n orientation='vertical'\n size='intrinsic'\n id={Obj.getDXN(collection).toString()}\n data-testid='main.stack'\n classNames='overflow-y-auto'\n >\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </StackItem.Content>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '../../types';\n\nexport type StackContextValue = {\n attendableId: string;\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n attendableId: '',\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { getSize, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { type StackSectionItem } from '../../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from '../StackContext';\n\nconst sectionActionDimensions = 'p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { attendableId: parentAttendableId, onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attendableId = `${parentAttendableId}/${object.id}`;\n const attentionAttrs = useAttentionAttributes(attendableId);\n const stackItem = useMemo(() => ({ id }), [id]);\n const data = useMemo(() => ({ attendableId, subject: object }), [object, attendableId]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='dx-attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} size={5} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' size={5} />\n <span className='ms-2 grow'>{t('navigate to section label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='ms-2 grow'>{t('collapse label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' size={5} />\n <span className='ms-2 grow'>{t('add section before label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' size={5} />\n <span className='ms-2 grow'>{t('add section after label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' size={5} />\n <span className='ms-2 grow'>{t('remove section label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate to section label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface.Surface role='section' data={data} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='dx-attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium')}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\nimport { type StackSettingsProps } from '../../types';\n\nexport const StackSettings = ({ settings }: { settings: StackSettingsProps }) => {\n const { t } = useTranslation(meta.id);\n\n return (\n <Settings.Root>\n <Settings.Section title={t('settings title', { ns: meta.id })}>\n <Settings.Group>\n <Settings.ItemInput title={t('settings separation label')}>\n <Input.Switch\n checked={settings.separation}\n onCheckedChange={(checked) => (settings.separation = !!checked)}\n />\n </Settings.ItemInput>\n </Settings.Group>\n </Settings.Section>\n </Settings.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { StackContainer } from './StackContainer';\n\nexport default StackContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,MAAMC,oBAAoB;AACnC,YAAYC,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,iBAAiBC,uBAAuB;AAEjD,SAASC,mBAAmB;AAC5B,SAASC,WAAqB;AAE9B,SAASC,eAAe;AACxB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,SAASC,mBAAmBC,kBAAAA,uBAAsB;AAC3D,SAASC,OAAOC,aAAAA,kBAAiB;AACjC,SAASC,qBAAqB;;;ACf9B,SAASC,eAAeC,kBAAkB;AAYnC,IAAMC,eAAeC,8BAAiC;EAC3DC,cAAc;EACdC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMC,WAAW,MAAMC,WAAWR,YAAAA;;;ACpBzC,YAAYS,0BAA0B;AACtC,OAAOC,UAASC,SAASC,gBAAgB;AAEzC,SAASC,eAAe;AACxB,SAASC,cAAcC,MAAMC,YAAYC,sBAAsB;AAC/D,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,SAASC,UAAU;;;ACP5B,O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AAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;IACjBC,MAAK;IACLC,UAAAA;IACAjC,OAAM;IACNkC,eAAY;IACZC,SAASd;OAGb,gBAAAG,OAAA,cAACY,aAAaC,UAAQ;IACpBC,OAAO;MACL3E;MACA4E,YAAYpB;MACZqB,YAAYvB;MACZwB,UAAUxC;MACVyC,OAAOhC;IACT;KAEA,gBAAAc,OAAA,cAACmB,OAAAA;IACCC,aAAY;IACZC,MAAK;IACLzE,IAAIe,IAAII,OAAOxC,UAAAA,EAAYyC,SAAQ;IACnC0C,eAAY;IACZN,YAAW;KAEV9C,MAAMzB,IAAI,CAACyF,SACV,gBAAAtB,OAAA,cAACuB,cAAAA;IAAaC,KAAKF,KAAK1E;IAAK,GAAG0E;;AAM5C;;;AKpKA,IAAA,yBAAeG;",
|
|
6
|
+
"names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "AtomObj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "attendableId", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "attendableId", "parentAttendableId", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "data", "subject", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "limit", "placeholder", "h2", "mx", "React", "Input", "useTranslation", "Settings", "collectionObjectsFamily", "Atom", "family", "collection", "make", "get", "snapshot", "AtomObj", "objects", "map", "ref", "makeWithReactive", "filter", "isNonNullable", "StackContainer", "attendableId", "subject", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "id", "allMetadata", "useCapabilities", "AppCapabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "collectionObjects", "useAtomValue", "items", "object", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "getDXN", "toString", "title", "toLocalizedString", "Graph", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "target", "findIndex", "section", "isObject", "SpaceOperation", "RemoveObjects", "handleAdd", "position", "LayoutOperation", "UpdateDialog", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key", "StackContainer"]
|
|
7
|
+
}
|
|
@@ -18,7 +18,7 @@ var StackViewType = Schema.Struct({
|
|
|
18
18
|
value: SectionSchema
|
|
19
19
|
})
|
|
20
20
|
}).pipe(Type.object({
|
|
21
|
-
typename: "dxos.
|
|
21
|
+
typename: "org.dxos.type.stack-view",
|
|
22
22
|
version: "0.1.0"
|
|
23
23
|
}));
|
|
24
24
|
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
SectionSchema,
|
|
27
27
|
StackViewType
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-LELGTQAL.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.Record({ key: Schema.String, value: SectionSchema }),\n}).pipe(\n Type.object({\n typename: 'dxos.
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.Record({ key: Schema.String, value: SectionSchema }),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.stack-view',\n version: '0.1.0',\n }),\n);\n\nexport interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}\n"],
|
|
5
5
|
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAY;AAOd,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAuBV,cAAO;EACzCW,UAAiBN,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA;AACrE,CAAA,EAAGa,KACDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
6
|
"names": ["Schema", "Type", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "sections", "pipe", "Type", "object", "typename", "version"]
|
|
7
7
|
}
|
|
@@ -2,9 +2,9 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
|
|
3
3
|
// src/meta.ts
|
|
4
4
|
import { trim } from "@dxos/util";
|
|
5
|
-
var SECTION_IDENTIFIER = "dxos.
|
|
5
|
+
var SECTION_IDENTIFIER = "org.dxos.type.stack-section";
|
|
6
6
|
var meta = {
|
|
7
|
-
id: "dxos.
|
|
7
|
+
id: "org.dxos.plugin.stack",
|
|
8
8
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
9
9
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
10
10
|
name: "Collections",
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
SECTION_IDENTIFIER,
|
|
21
21
|
meta
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-LOZ6GH5A.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 Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'org.dxos.type.stack-section';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.stack',\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAoB;EAC/BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
StackViewType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LELGTQAL.mjs";
|
|
5
5
|
import {
|
|
6
6
|
SECTION_IDENTIFIER,
|
|
7
7
|
meta
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LOZ6GH5A.mjs";
|
|
9
9
|
|
|
10
10
|
// src/StackPlugin.ts
|
|
11
|
-
import {
|
|
11
|
+
import { Plugin } from "@dxos/app-framework";
|
|
12
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
12
13
|
|
|
13
14
|
// src/capabilities/react-surface/index.ts
|
|
14
15
|
import { Capability } from "@dxos/app-framework";
|
|
15
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-
|
|
16
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-CYNJK3QD.mjs"));
|
|
16
17
|
|
|
17
18
|
// src/translations.ts
|
|
18
19
|
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
@@ -47,9 +48,7 @@ var translations = [
|
|
|
47
48
|
];
|
|
48
49
|
|
|
49
50
|
// src/StackPlugin.ts
|
|
50
|
-
var StackPlugin = Plugin.define(meta).pipe(
|
|
51
|
-
translations
|
|
52
|
-
}), Common.Plugin.addMetadataModule({
|
|
51
|
+
var StackPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
53
52
|
metadata: {
|
|
54
53
|
id: SECTION_IDENTIFIER,
|
|
55
54
|
metadata: {
|
|
@@ -69,12 +68,14 @@ var StackPlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule({
|
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
|
-
}),
|
|
71
|
+
}), AppPlugin.addSchemaModule({
|
|
73
72
|
schema: [
|
|
74
73
|
StackViewType
|
|
75
74
|
]
|
|
76
|
-
}),
|
|
75
|
+
}), AppPlugin.addSurfaceModule({
|
|
77
76
|
activate: ReactSurface
|
|
77
|
+
}), AppPlugin.addTranslationsModule({
|
|
78
|
+
translations
|
|
78
79
|
}), Plugin.make);
|
|
79
80
|
export {
|
|
80
81
|
SECTION_IDENTIFIER,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/StackPlugin.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,SAASA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { type Obj } from '@dxos/echo';\n\nimport { ReactSurface } from './capabilities';\nimport { SECTION_IDENTIFIER, meta } from './meta';\nimport { translations } from './translations';\nimport { StackViewType } from './types';\n\nexport const StackPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: SECTION_IDENTIFIER,\n metadata: {\n parse: (section: { object: Obj.Unknown }, type: string) => {\n switch (type) {\n case 'node':\n return { id: section.object.id, label: (section.object as any).title, data: section.object };\n case 'object':\n return section.object;\n case 'view-object':\n return section;\n }\n },\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [StackViewType] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\nimport { translations as stackTranslations } from '@dxos/react-ui-stack';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Stacks',\n 'settings title': 'Stack plugin settings',\n 'settings separation label': 'Separate sections',\n 'add section beforeAll dialog title': 'Add a section to the start',\n 'add section afterAll dialog title': 'Add a section to the end',\n 'add section before dialog title': 'Add a section',\n 'add section after dialog title': 'Add a section',\n 'add section input placeholder': 'Find the type of section to add',\n 'upload file label': 'Add file',\n 'add section label': 'Add section',\n 'empty stack message': 'Drag objects into the stack.',\n 'remove section label': 'Delete',\n 'navigate to section label': 'Navigate to object',\n 'untitled section title': 'Untitled section',\n 'add section before label': 'Add before',\n 'add section after label': 'Add after',\n 'expand label': 'Expand',\n 'collapse label': 'Collapse',\n 'open chat thread label': 'Open chat thread',\n 'drag handle label': 'Press space or enter to begin dragging this object.',\n },\n },\n },\n ...stackTranslations,\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;;;ACD1B,SAASC,kBAAkB;AAEpB,IAAMC,eAAeC,WAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACDzE,SAASC,gBAAgBC,yBAAyB;AAI3C,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,kBAAkB;QAClB,6BAA6B;QAC7B,sCAAsC;QACtC,qCAAqC;QACrC,mCAAmC;QACnC,kCAAkC;QAClC,iCAAiC;QACjC,qBAAqB;QACrB,qBAAqB;QACrB,uBAAuB;QACvB,wBAAwB;QACxB,6BAA6B;QAC7B,0BAA0B;QAC1B,4BAA4B;QAC5B,2BAA2B;QAC3B,gBAAgB;QAChB,kBAAkB;QAClB,0BAA0B;QAC1B,qBAAqB;MACvB;IACF;EACF;KACGC;;;;AFvBE,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC;IACJF,UAAU;MACRG,OAAO,CAACC,SAAkCC,SAAAA;AACxC,gBAAQA,MAAAA;UACN,KAAK;AACH,mBAAO;cAAEJ,IAAIG,QAAQE,OAAOL;cAAIM,OAAQH,QAAQE,OAAeE;cAAOC,MAAML,QAAQE;YAAO;UAC7F,KAAK;AACH,mBAAOF,QAAQE;UACjB,KAAK;AACH,mBAAOF;QACX;MACF;IACF;EACF;AACF,CAAA,GACAN,UAAUY,gBAAgB;EAAEC,QAAQ;IAACC;;AAAe,CAAA,GACpDd,UAAUe,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpDjB,UAAUkB,sBAAsB;EAAEC;AAAa,CAAA,GAC/CvB,OAAOwB,IAAI;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "Capability", "ReactSurface", "Capability", "lazy", "translations", "stackTranslations", "translations", "meta", "id", "stackTranslations", "StackPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "SECTION_IDENTIFIER", "parse", "section", "type", "object", "label", "title", "data", "addSchemaModule", "schema", "StackViewType", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations", "make"]
|
|
7
7
|
}
|