@dxos/plugin-stack 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs +126 -0
  2. package/dist/lib/neutral/StackContainer-KZ5Q5YKJ.mjs.map +7 -0
  3. package/dist/lib/neutral/StackPlugin.mjs +22 -0
  4. package/dist/lib/neutral/StackPlugin.mjs.map +7 -0
  5. package/dist/lib/neutral/capabilities/index.mjs +7 -0
  6. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  7. package/dist/lib/{browser/chunk-4X7CK6FM.mjs → neutral/chunk-3ISQZKGO.mjs} +3 -3
  8. package/dist/lib/{browser/chunk-4X7CK6FM.mjs.map → neutral/chunk-3ISQZKGO.mjs.map} +3 -3
  9. package/dist/lib/{browser/chunk-CD32XYEB.mjs → neutral/chunk-IPU3C6TT.mjs} +2 -2
  10. package/dist/lib/{browser/chunk-CD32XYEB.mjs.map → neutral/chunk-IPU3C6TT.mjs.map} +3 -3
  11. package/dist/lib/neutral/components/index.mjs +182 -0
  12. package/dist/lib/neutral/components/index.mjs.map +7 -0
  13. package/dist/lib/neutral/containers/index.mjs +7 -0
  14. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  15. package/dist/lib/neutral/index.mjs +15 -0
  16. package/dist/lib/neutral/meta.json +1 -0
  17. package/dist/lib/neutral/meta.mjs +9 -0
  18. package/dist/lib/neutral/plugin.mjs +11 -0
  19. package/dist/lib/neutral/plugin.mjs.map +7 -0
  20. package/dist/lib/neutral/react-surface-4ZA44TMR.mjs +23 -0
  21. package/dist/lib/neutral/react-surface-4ZA44TMR.mjs.map +7 -0
  22. package/dist/lib/neutral/translations.mjs +37 -0
  23. package/dist/lib/neutral/translations.mjs.map +7 -0
  24. package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
  25. package/dist/lib/neutral/types/index.mjs.map +7 -0
  26. package/dist/types/src/StackPlugin.d.ts +1 -0
  27. package/dist/types/src/StackPlugin.d.ts.map +1 -1
  28. package/dist/types/src/capabilities/index.d.ts +2 -1
  29. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  31. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  32. package/dist/types/src/components/{StackContext.d.ts → StackContext/StackContext.d.ts} +2 -1
  33. package/dist/types/src/components/StackContext/StackContext.d.ts.map +1 -0
  34. package/dist/types/src/components/StackContext/index.d.ts +2 -0
  35. package/dist/types/src/components/StackContext/index.d.ts.map +1 -0
  36. package/dist/types/src/components/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
  37. package/dist/types/src/components/StackSection/CaretDownUp.d.ts.map +1 -0
  38. package/dist/types/src/components/{StackSection.d.ts → StackSection/StackSection.d.ts} +1 -1
  39. package/dist/types/src/components/StackSection/StackSection.d.ts.map +1 -0
  40. package/dist/types/src/components/StackSection/index.d.ts +2 -0
  41. package/dist/types/src/components/StackSection/index.d.ts.map +1 -0
  42. package/dist/types/src/components/{StackSettings.d.ts → StackSettings/StackSettings.d.ts} +1 -1
  43. package/dist/types/src/components/StackSettings/StackSettings.d.ts.map +1 -0
  44. package/dist/types/src/components/StackSettings/index.d.ts +2 -0
  45. package/dist/types/src/components/StackSettings/index.d.ts.map +1 -0
  46. package/dist/types/src/components/index.d.ts +2 -9
  47. package/dist/types/src/components/index.d.ts.map +1 -1
  48. package/dist/types/src/containers/StackContainer/StackContainer.d.ts +7 -0
  49. package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +1 -0
  50. package/dist/types/src/containers/StackContainer/index.d.ts +2 -0
  51. package/dist/types/src/containers/StackContainer/index.d.ts.map +1 -0
  52. package/dist/types/src/containers/index.d.ts +3 -0
  53. package/dist/types/src/containers/index.d.ts.map +1 -0
  54. package/dist/types/src/index.d.ts +1 -1
  55. package/dist/types/src/index.d.ts.map +1 -1
  56. package/dist/types/src/meta.d.ts +1 -1
  57. package/dist/types/src/plugin.d.ts +3 -0
  58. package/dist/types/src/plugin.d.ts.map +1 -0
  59. package/dist/types/src/translations.d.ts +30 -30
  60. package/dist/types/src/translations.d.ts.map +1 -1
  61. package/dist/types/src/types/types.d.ts +1 -1
  62. package/dist/types/src/types/types.d.ts.map +1 -1
  63. package/dist/types/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +79 -42
  65. package/src/StackPlugin.ts +6 -22
  66. package/src/capabilities/index.ts +3 -1
  67. package/src/capabilities/react-surface.tsx +28 -0
  68. package/src/components/{StackContext.tsx → StackContext/StackContext.tsx} +3 -1
  69. package/src/components/StackContext/index.ts +5 -0
  70. package/src/components/{StackSection.tsx → StackSection/StackSection.tsx} +26 -23
  71. package/src/components/StackSection/index.ts +5 -0
  72. package/src/components/StackSettings/StackSettings.tsx +28 -0
  73. package/src/components/StackSettings/index.ts +5 -0
  74. package/src/components/index.ts +2 -4
  75. package/src/{components → containers/StackContainer}/StackContainer.tsx +65 -62
  76. package/src/containers/StackContainer/index.ts +5 -0
  77. package/src/containers/index.ts +7 -0
  78. package/src/index.ts +1 -1
  79. package/src/meta.ts +2 -2
  80. package/src/plugin.ts +9 -0
  81. package/src/translations.ts +23 -22
  82. package/src/types/stack.ts +1 -1
  83. package/src/types/types.ts +1 -1
  84. package/dist/lib/browser/StackContainer-TFG62M42.mjs +0 -275
  85. package/dist/lib/browser/StackContainer-TFG62M42.mjs.map +0 -7
  86. package/dist/lib/browser/index.mjs +0 -84
  87. package/dist/lib/browser/index.mjs.map +0 -7
  88. package/dist/lib/browser/meta.json +0 -1
  89. package/dist/lib/browser/react-surface-RMMCIEXY.mjs +0 -41
  90. package/dist/lib/browser/react-surface-RMMCIEXY.mjs.map +0 -7
  91. package/dist/lib/node-esm/StackContainer-G4QUICWO.mjs +0 -276
  92. package/dist/lib/node-esm/StackContainer-G4QUICWO.mjs.map +0 -7
  93. package/dist/lib/node-esm/chunk-26XWE7UY.mjs +0 -29
  94. package/dist/lib/node-esm/chunk-26XWE7UY.mjs.map +0 -7
  95. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs +0 -23
  96. package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
  97. package/dist/lib/node-esm/index.mjs +0 -85
  98. package/dist/lib/node-esm/index.mjs.map +0 -7
  99. package/dist/lib/node-esm/meta.json +0 -1
  100. package/dist/lib/node-esm/react-surface-R5QS3JT6.mjs +0 -42
  101. package/dist/lib/node-esm/react-surface-R5QS3JT6.mjs.map +0 -7
  102. package/dist/lib/node-esm/types/index.mjs +0 -10
  103. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  104. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  105. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  106. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  107. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  108. package/dist/types/src/components/StackContainer.d.ts +0 -9
  109. package/dist/types/src/components/StackContainer.d.ts.map +0 -1
  110. package/dist/types/src/components/StackContext.d.ts.map +0 -1
  111. package/dist/types/src/components/StackSection.d.ts.map +0 -1
  112. package/dist/types/src/components/StackSettings.d.ts.map +0 -1
  113. package/src/capabilities/react-surface/index.ts +0 -7
  114. package/src/capabilities/react-surface/react-surface.tsx +0 -34
  115. package/src/components/StackSettings.tsx +0 -30
  116. /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
  117. /package/dist/lib/{node-esm/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
  118. /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
package/src/index.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  //
4
4
 
5
5
  export * from './meta';
6
- export * from './StackPlugin';
6
+ export * from './types';
package/src/meta.ts CHANGED
@@ -5,10 +5,10 @@
5
5
  import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';
8
+ export const SECTION_IDENTIFIER = 'org.dxos.type.stackSection';
9
9
 
10
10
  export const meta: Plugin.Meta = {
11
- id: 'dxos.org/plugin/stack',
11
+ id: 'org.dxos.plugin.stack',
12
12
  // TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
13
13
  // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
14
14
  name: 'Collections',
package/src/plugin.ts ADDED
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const StackPlugin = Plugin.lazy(meta, () => import('#plugin'));
@@ -3,34 +3,35 @@
3
3
  //
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
- import { translations as stackTranslations } from '@dxos/react-ui-stack';
6
+ import { translations as stackTranslations } from '@dxos/react-ui-stack/translations';
7
7
 
8
- import { meta } from './meta';
8
+ import { meta } from '#meta';
9
9
 
10
10
  export const translations = [
11
11
  {
12
12
  'en-US': {
13
13
  [meta.id]: {
14
- 'plugin name': 'Stacks',
15
- 'settings title': 'Stack plugin settings',
16
- 'settings separation label': 'Separate sections',
17
- 'add section beforeAll dialog title': 'Add a section to the start',
18
- 'add section afterAll dialog title': 'Add a section to the end',
19
- 'add section before dialog title': 'Add a section',
20
- 'add section after dialog title': 'Add a section',
21
- 'add section input placeholder': 'Find the type of section to add',
22
- 'upload file label': 'Add file',
23
- 'add section label': 'Add section',
24
- 'empty stack message': 'Drag objects into the stack.',
25
- 'remove section label': 'Delete',
26
- 'navigate to section label': 'Navigate to object',
27
- 'untitled section title': 'Untitled section',
28
- 'add section before label': 'Add before',
29
- 'add section after label': 'Add after',
30
- 'expand label': 'Expand',
31
- 'collapse label': 'Collapse',
32
- 'open chat thread label': 'Open chat thread',
33
- 'drag handle label': 'Press space or enter to begin dragging this object.',
14
+ 'plugin.name': 'Stacks',
15
+ 'settings.title': 'Stack settings',
16
+ 'settings.separation.label': 'Separate sections',
17
+ 'settings.separation.description': 'Add visual dividers between sections in stacks.',
18
+ 'add-section-beforeAll-dialog.title': 'Add a section to the start',
19
+ 'add-section-afterAll-dialog.title': 'Add a section to the end',
20
+ 'add-section-before-dialog.title': 'Add a section',
21
+ 'add-section-after-dialog.title': 'Add a section',
22
+ 'add-section-input.placeholder': 'Find the type of section to add',
23
+ 'upload-file.label': 'Add file',
24
+ 'add-section.label': 'Add section',
25
+ 'empty-stack.message': 'Drag objects into the stack.',
26
+ 'remove-section.label': 'Delete',
27
+ 'navigate-to-section.label': 'Navigate to object',
28
+ 'untitled-section.title': 'Untitled section',
29
+ 'add-section-before.label': 'Add before',
30
+ 'add-section-after.label': 'Add after',
31
+ 'expand.label': 'Expand',
32
+ 'collapse.label': 'Collapse',
33
+ 'open-chat-thread.label': 'Open chat thread',
34
+ 'drag-handle.label': 'Press space or enter to begin dragging this object.',
34
35
  },
35
36
  },
36
37
  },
@@ -23,7 +23,7 @@ export const StackViewType = Schema.Struct({
23
23
  sections: Schema.Record({ key: Schema.String, value: SectionSchema }),
24
24
  }).pipe(
25
25
  Type.object({
26
- typename: 'dxos.org/type/StackView',
26
+ typename: 'org.dxos.type.stackView',
27
27
  version: '0.1.0',
28
28
  }),
29
29
  );
@@ -5,9 +5,9 @@
5
5
  import { type FC } from 'react';
6
6
 
7
7
  import { type Obj } from '@dxos/echo';
8
+ import { type Collection } from '@dxos/echo';
8
9
  import { type Label } from '@dxos/react-ui';
9
10
  import { type StackItemSize } from '@dxos/react-ui-stack';
10
- import { type Collection } from '@dxos/schema';
11
11
 
12
12
  export type AddSectionPosition = 'before' | 'after' | 'beforeAll' | 'afterAll';
13
13
 
@@ -1,275 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-4X7CK6FM.mjs";
4
-
5
- // src/components/StackContainer.tsx
6
- import * as Option from "effect/Option";
7
- import React3, { useCallback, useState as useState2 } from "react";
8
- import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
9
- import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
10
- import { useAppGraph } from "@dxos/app-toolkit/ui";
11
- import { Obj } from "@dxos/echo";
12
- import { Graph } from "@dxos/plugin-graph";
13
- import { SpaceOperation } from "@dxos/plugin-space/types";
14
- import { Toolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
15
- import { AttentionProvider } from "@dxos/react-ui-attention";
16
- import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
17
- import { isNonNullable } from "@dxos/util";
18
-
19
- // src/components/StackContext.tsx
20
- import { createContext, useContext } from "react";
21
- var StackContext = /* @__PURE__ */ createContext({
22
- onCollapse: () => {
23
- },
24
- onNavigate: async () => {
25
- },
26
- onDelete: async () => {
27
- },
28
- onAdd: () => {
29
- }
30
- });
31
- var useStack = () => useContext(StackContext);
32
-
33
- // src/components/StackSection.tsx
34
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
35
- import React2, { useMemo, useState } from "react";
36
- import { Surface } from "@dxos/app-framework/ui";
37
- import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
38
- import { useAttentionAttributes } from "@dxos/react-ui-attention";
39
- import { StackItem } from "@dxos/react-ui-stack";
40
- import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
41
-
42
- // src/components/CaretDownUp.tsx
43
- import React from "react";
44
- var CaretDownUp = ({ children, ...props }) => {
45
- return /* @__PURE__ */ React.createElement("svg", {
46
- xmlns: "http://www.w3.org/2000/svg",
47
- viewBox: "0 0 256 256",
48
- ...props
49
- }, /* @__PURE__ */ React.createElement("rect", {
50
- width: "256",
51
- height: "256",
52
- fill: "none"
53
- }), /* @__PURE__ */ React.createElement("polyline", {
54
- points: "80 224 128 176 176 224",
55
- fill: "none",
56
- stroke: "currentColor",
57
- strokeLinecap: "round",
58
- strokeLinejoin: "round",
59
- strokeWidth: "16"
60
- }), /* @__PURE__ */ React.createElement("polyline", {
61
- points: "80 32 128 80 176 32",
62
- fill: "none",
63
- stroke: "currentColor",
64
- strokeLinecap: "round",
65
- strokeLinejoin: "round",
66
- strokeWidth: "16"
67
- }), children);
68
- };
69
-
70
- // src/components/StackSection.tsx
71
- var sectionActionDimensions = "p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min";
72
- var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
73
- const { t } = useTranslation(meta.id);
74
- const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
75
- const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
76
- const attentionAttrs = useAttentionAttributes(id);
77
- const stackItem = useMemo(() => ({
78
- id
79
- }), [
80
- id
81
- ]);
82
- return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
83
- asChild: true,
84
- open: !view.collapsed,
85
- onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
86
- }, /* @__PURE__ */ React2.createElement(StackItem.Root, {
87
- item: stackItem,
88
- role: "section",
89
- ...attentionAttrs
90
- }, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
91
- classNames: "attention-surface"
92
- }, /* @__PURE__ */ React2.createElement("span", {
93
- className: "sr-only"
94
- }, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
95
- open: optionsMenuOpen,
96
- onOpenChange: setOptionsMenuOpen
97
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
98
- asChild: true
99
- }, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
100
- icon,
101
- size: 5,
102
- classNames: "transition-opacity"
103
- }))), /* @__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, {
104
- onClick: () => onNavigate(id),
105
- "data-testid": "section.navigate-to"
106
- }, /* @__PURE__ */ React2.createElement(Icon, {
107
- icon: "ph--arrow-right--regular",
108
- size: 5
109
- }), /* @__PURE__ */ React2.createElement("span", {
110
- className: "mis-2 grow"
111
- }, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
112
- asChild: true
113
- }, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
114
- className: getSize(5)
115
- }), /* @__PURE__ */ React2.createElement("span", {
116
- className: "mis-2 grow"
117
- }, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
118
- onClick: () => onAdd(id, "before"),
119
- "data-testid": "section.add-before"
120
- }, /* @__PURE__ */ React2.createElement(Icon, {
121
- icon: "ph--arrow-line-up--regular",
122
- size: 5
123
- }), /* @__PURE__ */ React2.createElement("span", {
124
- className: "mis-2 grow"
125
- }, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
126
- onClick: () => onAdd(id, "after"),
127
- "data-testid": "section.add-after"
128
- }, /* @__PURE__ */ React2.createElement(Icon, {
129
- icon: "ph--arrow-line-down--regular",
130
- size: 5
131
- }), /* @__PURE__ */ React2.createElement("span", {
132
- className: "mis-2 grow"
133
- }, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
134
- onClick: () => onDelete(id),
135
- "data-testid": "section.remove"
136
- }, /* @__PURE__ */ React2.createElement(Icon, {
137
- icon: "ph--trash--regular",
138
- size: 5
139
- }), /* @__PURE__ */ React2.createElement("span", {
140
- className: "mis-2 grow"
141
- }, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
142
- asChild: true
143
- }, /* @__PURE__ */ React2.createElement(IconButton, {
144
- iconOnly: true,
145
- variant: "ghost",
146
- label: t("expand label"),
147
- icon: "ph--caret-up-down--regular",
148
- classNames: sectionActionDimensions
149
- })) : /* @__PURE__ */ React2.createElement(IconButton, {
150
- iconOnly: true,
151
- variant: "ghost",
152
- onClick: () => onNavigate(id),
153
- label: t("navigate to section label"),
154
- icon: "ph--arrow-right--regular",
155
- "data-testid": "section.navigate-to",
156
- classNames: sectionActionDimensions
157
- }))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
158
- role: "section",
159
- data: {
160
- subject: object
161
- },
162
- limit: 1,
163
- placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
164
- })), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
165
- classNames: "attention-surface"
166
- }, /* @__PURE__ */ React2.createElement("h2", {
167
- className: mx("flex items-center p-4 font-medium", textBlockWidth)
168
- }, view.title))));
169
- };
170
-
171
- // src/components/StackContainer.tsx
172
- var StackContainer = ({ id, subject: collection }) => {
173
- const { invokePromise } = useOperationInvoker();
174
- const { graph } = useAppGraph();
175
- const { t } = useTranslation2(meta.id);
176
- const allMetadata = useCapabilities(AppCapabilities.Metadata);
177
- const [collapsedSections, setCollapsedSections] = useState2({});
178
- const items = collection.objects.map((object) => object.target).filter(isNonNullable).map((object) => {
179
- const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
180
- const view = {
181
- // ...stack.sections[object.id],
182
- collapsed: collapsedSections[Obj.getDXN(object).toString()],
183
- title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
184
- toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
185
- };
186
- return {
187
- id: Obj.getDXN(object).toString(),
188
- object,
189
- metadata,
190
- view
191
- };
192
- }) ?? [];
193
- const handleDelete = useCallback(async (id2) => {
194
- const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id2);
195
- const object = collection.objects[index].target;
196
- if (Obj.isObject(object)) {
197
- await invokePromise(SpaceOperation.RemoveObjects, {
198
- objects: [
199
- object
200
- ],
201
- target: collection
202
- });
203
- }
204
- }, [
205
- collection,
206
- invokePromise
207
- ]);
208
- const handleAdd = useCallback(async (id2, position) => {
209
- await invokePromise(LayoutOperation.UpdateDialog, {
210
- subject: `${meta.id}/AddSectionDialog`,
211
- blockAlign: "start",
212
- props: {
213
- path: id2,
214
- position,
215
- collection
216
- }
217
- });
218
- }, [
219
- collection,
220
- invokePromise
221
- ]);
222
- const handleNavigate = useCallback(async (id2) => {
223
- await invokePromise(LayoutOperation.Open, {
224
- subject: [
225
- id2
226
- ]
227
- });
228
- }, [
229
- invokePromise
230
- ]);
231
- const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
232
- ...prev,
233
- [id2]: collapsed
234
- })), []);
235
- const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
236
- target: collection,
237
- navigable: false
238
- }), [
239
- collection,
240
- invokePromise
241
- ]);
242
- return /* @__PURE__ */ React3.createElement(StackItem2.Content, {
243
- toolbar: true,
244
- classNames: "container-max-width overflow-hidden border-l border-r border-subduedSeparator"
245
- }, /* @__PURE__ */ React3.createElement(Toolbar.Root, null, /* @__PURE__ */ React3.createElement(Toolbar.IconButton, {
246
- icon: "ph--plus--regular",
247
- iconOnly: true,
248
- label: "Add section",
249
- "data-testid": "stack.addSection",
250
- onClick: handleAddSection
251
- })), /* @__PURE__ */ React3.createElement(AttentionProvider, {
252
- id
253
- }, /* @__PURE__ */ React3.createElement(StackContext.Provider, {
254
- value: {
255
- onCollapse: handleCollapse,
256
- onNavigate: handleNavigate,
257
- onDelete: handleDelete,
258
- onAdd: handleAdd
259
- }
260
- }, /* @__PURE__ */ React3.createElement(Stack, {
261
- orientation: "vertical",
262
- size: "intrinsic",
263
- id,
264
- "data-testid": "main.stack",
265
- classNames: "overflow-y-auto"
266
- }, items.map((item) => /* @__PURE__ */ React3.createElement(StackSection, {
267
- key: item.id,
268
- ...item
269
- }))))));
270
- };
271
- var StackContainer_default = StackContainer;
272
- export {
273
- StackContainer_default as default
274
- };
275
- //# sourceMappingURL=StackContainer-TFG62M42.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useState } from 'react';\n\nimport { 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 } from '@dxos/echo';\nimport { Graph } from '@dxos/plugin-graph';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';\nimport { AttentionProvider } from '@dxos/react-ui-attention';\nimport { Stack, StackItem } from '@dxos/react-ui-stack';\nimport { type Collection } from '@dxos/schema';\nimport { isNonNullable } from '@dxos/util';\n\nimport { meta } from '../meta';\nimport {\n type AddSectionPosition,\n type CollapsedSections,\n type StackSectionItem,\n type StackSectionMetadata,\n type StackSectionView,\n} from '../types';\n\nimport { StackContext } from './StackContext';\nimport { StackSection } from './StackSection';\n\ntype StackContainerProps = SurfaceComponentProps<Collection.Collection> & {\n id: string;\n};\n\nconst StackContainer = ({ id, subject: collection }: StackContainerProps) => {\n const { invokePromise } = useOperationInvoker();\n const { graph } = useAppGraph();\n const { t } = useTranslation(meta.id);\n const allMetadata = useCapabilities(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 items =\n collection.objects\n // TODO(wittjosiah): Should the database handle this differently?\n // TODO(wittjosiah): Render placeholders for missing objects so they can be removed from the stack?\n .map((object) => object.target)\n .filter(isNonNullable)\n .map((object) => {\n const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? 'never'))\n ?.metadata as StackSectionMetadata;\n const view = {\n // ...stack.sections[object.id],\n collapsed: collapsedSections[Obj.getDXN(object).toString()],\n title:\n (object as any)?.title ??\n // TODO(wittjosiah): `getNode` is not reactive.\n toLocalizedString(\n Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label,\n t,\n ),\n } as StackSectionView;\n return { id: Obj.getDXN(object).toString(), object, metadata, view } satisfies StackSectionItem;\n }) ?? [];\n\n const handleDelete = useCallback(\n async (id: string) => {\n const index = collection.objects\n .map((object) => object.target)\n .filter(isNonNullable)\n .findIndex((section) => Obj.getDXN(section).toString() === id);\n const object = collection.objects[index].target;\n if (Obj.isObject(object)) {\n await invokePromise(SpaceOperation.RemoveObjects, {\n objects: [object],\n target: collection,\n });\n\n // TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.\n // delete stack.sections[Path.last(path)];\n }\n },\n [collection, invokePromise],\n );\n\n const handleAdd = useCallback(\n async (id: string, position: AddSectionPosition) => {\n // TODO(wittjosiah): Use object creation dialog.\n await invokePromise(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\n toolbar\n classNames='container-max-width overflow-hidden border-l border-r border-subduedSeparator'\n >\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--plus--regular'\n iconOnly\n label='Add section'\n data-testid='stack.addSection'\n onClick={handleAddSection}\n />\n </Toolbar.Root>\n <AttentionProvider id={id}>\n <StackContext.Provider\n value={{\n onCollapse: handleCollapse,\n onNavigate: handleNavigate,\n onDelete: handleDelete,\n onAdd: handleAdd,\n }}\n >\n <Stack orientation='vertical' size='intrinsic' id={id} data-testid='main.stack' classNames='overflow-y-auto'>\n {items.map((item) => (\n <StackSection key={item.id} {...item} />\n ))}\n </Stack>\n </StackContext.Provider>\n </AttentionProvider>\n </StackItem.Content>\n );\n};\n\nexport default StackContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type AddSectionPosition } from '../types';\n\nexport type StackContextValue = {\n onCollapse: (id: string, collapsed: boolean) => void;\n onNavigate: (id: string) => Promise<void>;\n onDelete: (id: string) => Promise<void>;\n onAdd: (id: string, position: AddSectionPosition) => void;\n};\n\nexport const StackContext = createContext<StackContextValue>({\n onCollapse: () => {},\n onNavigate: async () => {},\n onDelete: async () => {},\n onAdd: () => {},\n});\n\nexport const useStack = () => useContext(StackContext);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible';\nimport React, { useMemo, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/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, textBlockWidth } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\nimport { type StackSectionItem } from '../types';\n\nimport { CaretDownUp } from './CaretDownUp';\nimport { useStack } from './StackContext';\n\nconst sectionActionDimensions = 'p-1 mlb-1 shrink-0 min-bs-0 is-[--rail-action] bs-min';\n\nexport type StackSectionProps = StackSectionItem;\n\nexport const StackSection = ({\n id,\n view,\n object,\n metadata: { icon = 'ph--placeholder--regular' },\n}: StackSectionProps) => {\n const { t } = useTranslation(meta.id);\n const { onNavigate, onAdd, onCollapse, onDelete } = useStack();\n const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);\n const attentionAttrs = useAttentionAttributes(id);\n const stackItem = useMemo(() => ({ id }), [id]);\n\n return (\n <CollapsiblePrimitive.Root asChild open={!view.collapsed} onOpenChange={(nextOpen) => onCollapse?.(id, !nextOpen)}>\n <StackItem.Root item={stackItem} role='section' {...attentionAttrs}>\n <StackItem.Heading classNames='attention-surface'>\n <span className='sr-only'>{view.title}</span>\n <StackItem.HeadingStickyContent>\n <DropdownMenu.Root\n {...{\n open: optionsMenuOpen,\n onOpenChange: setOptionsMenuOpen,\n }}\n >\n <DropdownMenu.Trigger asChild>\n <StackItem.SigilButton>\n <Icon icon={icon} size={5} classNames='transition-opacity' />\n </StackItem.SigilButton>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content>\n <DropdownMenu.Viewport>\n {view.collapsed ? (\n <DropdownMenu.Item onClick={() => onNavigate(id)} data-testid='section.navigate-to'>\n <Icon icon='ph--arrow-right--regular' size={5} />\n <span className='mis-2 grow'>{t('navigate to section label')}</span>\n </DropdownMenu.Item>\n ) : (\n <CollapsiblePrimitive.Trigger asChild>\n <DropdownMenu.Item>\n <CaretDownUp className={getSize(5)} />\n <span className='mis-2 grow'>{t('collapse label')}</span>\n </DropdownMenu.Item>\n </CollapsiblePrimitive.Trigger>\n )}\n <DropdownMenu.Item onClick={() => onAdd(id, 'before')} data-testid='section.add-before'>\n <Icon icon='ph--arrow-line-up--regular' size={5} />\n <span className='mis-2 grow'>{t('add section before label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onAdd(id, 'after')} data-testid='section.add-after'>\n <Icon icon='ph--arrow-line-down--regular' size={5} />\n <span className='mis-2 grow'>{t('add section after label')}</span>\n </DropdownMenu.Item>\n <DropdownMenu.Item onClick={() => onDelete(id)} data-testid='section.remove'>\n <Icon icon='ph--trash--regular' size={5} />\n <span className='mis-2 grow'>{t('remove section label')}</span>\n </DropdownMenu.Item>\n </DropdownMenu.Viewport>\n <DropdownMenu.Arrow />\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n {view.collapsed ? (\n <CollapsiblePrimitive.Trigger asChild>\n <IconButton\n iconOnly\n variant='ghost'\n label={t('expand label')}\n icon='ph--caret-up-down--regular'\n classNames={sectionActionDimensions}\n />\n </CollapsiblePrimitive.Trigger>\n ) : (\n <IconButton\n iconOnly\n variant='ghost'\n onClick={() => onNavigate(id)}\n label={t('navigate to section label')}\n icon='ph--arrow-right--regular'\n data-testid='section.navigate-to'\n classNames={sectionActionDimensions}\n />\n )}\n </StackItem.HeadingStickyContent>\n </StackItem.Heading>\n <CollapsiblePrimitive.Content>\n <Surface.Surface role='section' data={{ subject: object }} limit={1} placeholder={<></>} />\n </CollapsiblePrimitive.Content>\n {view.collapsed && (\n <StackItem.Content classNames='attention-surface'>\n <h2 className={mx('flex items-center p-4 font-medium', textBlockWidth)}>{view.title}</h2>\n </StackItem.Content>\n )}\n </StackItem.Root>\n </CollapsiblePrimitive.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { type ComponentPropsWithoutRef } from 'react';\n\nexport const CaretDownUp = ({ children, ...props }: ComponentPropsWithoutRef<'svg'>) => {\n return (\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' {...props}>\n <rect width='256' height='256' fill='none' />\n <polyline\n points='80 224 128 176 176 224'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n <polyline\n points='80 32 128 80 176 32'\n fill='none'\n stroke='currentColor'\n strokeLinecap='round'\n strokeLinejoin='round'\n strokeWidth='16'\n />\n {children}\n </svg>\n );\n};\n"],
5
- "mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,UAASC,aAAaC,YAAAA,iBAAgB;AAE7C,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,iBAAiBC,uBAAuB;AAEjD,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB,SAASC,aAAa;AACtB,SAASC,sBAAsB;AAC/B,SAASC,SAASC,mBAAmBC,kBAAAA,uBAAsB;AAC3D,SAASC,yBAAyB;AAClC,SAASC,OAAOC,aAAAA,kBAAiB;AAEjC,SAASC,qBAAqB;;;ACd9B,SAASC,eAAeC,kBAAkB;AAWnC,IAAMC,eAAeC,8BAAiC;EAC3DC,YAAY,MAAA;EAAO;EACnBC,YAAY,YAAA;EAAa;EACzBC,UAAU,YAAA;EAAa;EACvBC,OAAO,MAAA;EAAO;AAChB,CAAA;AAEO,IAAMC,WAAW,MAAMC,WAAWP,YAAAA;;;AClBzC,YAAYQ,0BAA0B;AACtC,OAAOC,UAASC,SAASC,gBAAgB;AAEzC,SAASC,eAAe;AACxB,SAASC,cAAcC,MAAMC,YAAYC,sBAAsB;AAC/D,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,SAASC,IAAIC,sBAAsB;;;ACP5C,OAAOC,WAA8C;AAE9C,IAAMC,cAAc,CAAC,EAAEC,UAAU,GAAGC,MAAAA,MAAwC;AACjF,SACE,sBAAA,cAACC,OAAAA;IAAIC,OAAM;IAA6BC,SAAQ;IAAe,GAAGH;KAChE,sBAAA,cAACI,QAAAA;IAAKC,OAAM;IAAMC,QAAO;IAAMC,MAAK;MACpC,sBAAA,cAACC,YAAAA;IACCC,QAAO;IACPF,MAAK;IACLG,QAAO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G7B,QAAMqD,iBAAiBd,YACrB,OAAO1C,QAAAA;AACL,UAAMG,cAAcgD,gBAAgBM,MAAM;MAAExD,SAAS;QAACD;;IAAI,CAAA;EAC5D,GACA;IAACG;GAAc;AAGjB,QAAMuD,iBAAiBhB,YACrB,CAAC1C,KAAY8B,cAAuBf,qBAAqB,CAAC4C,UAAU;IAAE,GAAGA;IAAM,CAAC3D,GAAAA,GAAK8B;EAAU,EAAA,GAC/F,CAAA,CAAE;AAGJ,QAAM8B,mBAAmBlB,YACvB,MACEvC,cAAc4C,eAAec,kBAAkB;IAC7CxC,QAAQnB;IACR4D,WAAW;EACb,CAAA,GACF;IAAC5D;IAAYC;GAAc;AAG7B,SACE,gBAAA4D,OAAA,cAACC,WAAUC,SAAO;IAChBC,SAAAA;IACAC,YAAW;KAEX,gBAAAJ,OAAA,cAACK,QAAQC,MAAI,MACX,gBAAAN,OAAA,cAACK,QAAQE,YAAU;IACjBC,MAAK;IACLC,UAAAA;IACAhC,OAAM;IACNiC,eAAY;IACZC,SAASd;OAGb,gBAAAG,OAAA,cAACY,mBAAAA;IAAkB3E;KACjB,gBAAA+D,OAAA,cAACa,aAAaC,UAAQ;IACpBC,OAAO;MACLC,YAAYrB;MACZsB,YAAYxB;MACZyB,UAAUxC;MACVyC,OAAOjC;IACT;KAEA,gBAAAc,OAAA,cAACoB,OAAAA;IAAMC,aAAY;IAAWC,MAAK;IAAYrF;IAAQyE,eAAY;IAAaN,YAAW;KACxFlD,MAAME,IAAI,CAACmE,SACV,gBAAAvB,OAAA,cAACwB,cAAAA;IAAaC,KAAKF,KAAKtF;IAAK,GAAGsF;;AAO9C;AAEA,IAAA,yBAAevF;",
6
- "names": ["Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "Graph", "SpaceOperation", "Toolbar", "toLocalizedString", "useTranslation", "AttentionProvider", "Stack", "StackItem", "isNonNullable", "createContext", "useContext", "StackContext", "createContext", "onCollapse", "onNavigate", "onDelete", "onAdd", "useStack", "useContext", "CollapsiblePrimitive", "React", "useMemo", "useState", "Surface", "DropdownMenu", "Icon", "IconButton", "useTranslation", "useAttentionAttributes", "StackItem", "getSize", "mx", "textBlockWidth", "React", "CaretDownUp", "children", "props", "svg", "xmlns", "viewBox", "rect", "width", "height", "fill", "polyline", "points", "stroke", "strokeLinecap", "strokeLinejoin", "strokeWidth", "sectionActionDimensions", "StackSection", "id", "view", "object", "metadata", "icon", "t", "useTranslation", "meta", "onNavigate", "onAdd", "onCollapse", "onDelete", "useStack", "optionsMenuOpen", "setOptionsMenuOpen", "useState", "attentionAttrs", "useAttentionAttributes", "stackItem", "useMemo", "React", "Root", "asChild", "open", "collapsed", "onOpenChange", "nextOpen", "StackItem", "item", "role", "Heading", "classNames", "span", "className", "title", "HeadingStickyContent", "DropdownMenu", "Trigger", "SigilButton", "Icon", "size", "Portal", "Content", "Viewport", "Item", "onClick", "data-testid", "CaretDownUp", "getSize", "Arrow", "IconButton", "iconOnly", "variant", "label", "Surface", "data", "subject", "limit", "placeholder", "h2", "mx", "textBlockWidth", "StackContainer", "id", "subject", "collection", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "allMetadata", "useCapabilities", "AppCapabilities", "Metadata", "collapsedSections", "setCollapsedSections", "useState", "items", "objects", "map", "object", "target", "filter", "isNonNullable", "metadata", "find", "m", "Obj", "getTypename", "view", "collapsed", "getDXN", "toString", "title", "toLocalizedString", "Graph", "getNode", "pipe", "getOrNull", "properties", "label", "handleDelete", "useCallback", "index", "findIndex", "section", "isObject", "SpaceOperation", "RemoveObjects", "handleAdd", "position", "LayoutOperation", "UpdateDialog", "blockAlign", "props", "path", "handleNavigate", "Open", "handleCollapse", "prev", "handleAddSection", "OpenCreateObject", "navigable", "React", "StackItem", "Content", "toolbar", "classNames", "Toolbar", "Root", "IconButton", "icon", "iconOnly", "data-testid", "onClick", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key"]
7
- }
@@ -1,84 +0,0 @@
1
- import {
2
- StackViewType
3
- } from "./chunk-CD32XYEB.mjs";
4
- import {
5
- SECTION_IDENTIFIER,
6
- meta
7
- } from "./chunk-4X7CK6FM.mjs";
8
-
9
- // src/StackPlugin.ts
10
- import { Plugin } from "@dxos/app-framework";
11
- import { AppPlugin } from "@dxos/app-toolkit";
12
-
13
- // src/capabilities/react-surface/index.ts
14
- import { Capability } from "@dxos/app-framework";
15
- var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-RMMCIEXY.mjs"));
16
-
17
- // src/translations.ts
18
- import { translations as stackTranslations } from "@dxos/react-ui-stack";
19
- var translations = [
20
- {
21
- "en-US": {
22
- [meta.id]: {
23
- "plugin name": "Stacks",
24
- "settings title": "Stack plugin settings",
25
- "settings separation label": "Separate sections",
26
- "add section beforeAll dialog title": "Add a section to the start",
27
- "add section afterAll dialog title": "Add a section to the end",
28
- "add section before dialog title": "Add a section",
29
- "add section after dialog title": "Add a section",
30
- "add section input placeholder": "Find the type of section to add",
31
- "upload file label": "Add file",
32
- "add section label": "Add section",
33
- "empty stack message": "Drag objects into the stack.",
34
- "remove section label": "Delete",
35
- "navigate to section label": "Navigate to object",
36
- "untitled section title": "Untitled section",
37
- "add section before label": "Add before",
38
- "add section after label": "Add after",
39
- "expand label": "Expand",
40
- "collapse label": "Collapse",
41
- "open chat thread label": "Open chat thread",
42
- "drag handle label": "Press space or enter to begin dragging this object."
43
- }
44
- }
45
- },
46
- ...stackTranslations
47
- ];
48
-
49
- // src/StackPlugin.ts
50
- var StackPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
51
- metadata: {
52
- id: SECTION_IDENTIFIER,
53
- metadata: {
54
- parse: (section, type) => {
55
- switch (type) {
56
- case "node":
57
- return {
58
- id: section.object.id,
59
- label: section.object.title,
60
- data: section.object
61
- };
62
- case "object":
63
- return section.object;
64
- case "view-object":
65
- return section;
66
- }
67
- }
68
- }
69
- }
70
- }), AppPlugin.addSchemaModule({
71
- schema: [
72
- StackViewType
73
- ]
74
- }), AppPlugin.addSurfaceModule({
75
- activate: ReactSurface
76
- }), AppPlugin.addTranslationsModule({
77
- translations
78
- }), Plugin.make);
79
- export {
80
- SECTION_IDENTIFIER,
81
- StackPlugin,
82
- meta
83
- };
84
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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 { 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
- }
@@ -1 +0,0 @@
1
- {"inputs":{"src/meta.ts":{"bytes":2522,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSettings.tsx":{"bytes":3224,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/StackContext.tsx":{"bytes":1834,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/CaretDownUp.tsx":{"bytes":2962,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/components/StackSection.tsx":{"bytes":17327,"imports":[{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/CaretDownUp.tsx","kind":"import-statement","original":"./CaretDownUp"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"}],"format":"esm"},"src/components/StackContainer.tsx":{"bytes":18964,"imports":[{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/StackContext.tsx","kind":"import-statement","original":"./StackContext"},{"path":"src/components/StackSection.tsx","kind":"import-statement","original":"./StackSection"}],"format":"esm"},"src/components/index.ts":{"bytes":858,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/StackSettings.tsx","kind":"import-statement","original":"./StackSettings"},{"path":"src/components/StackContainer.tsx","kind":"dynamic-import","original":"./StackContainer"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4504,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":909,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":486,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":4451,"imports":[{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/types/stack.ts":{"bytes":3750,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":499,"imports":[{"path":"src/types/stack.ts","kind":"import-statement","original":"./stack"}],"format":"esm"},"src/StackPlugin.ts":{"bytes":4334,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":547,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/StackPlugin.ts","kind":"import-statement","original":"./StackPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4449},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-RMMCIEXY.mjs","kind":"dynamic-import"},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","StackPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/StackPlugin.ts":{"bytesInOutput":797},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":1274}},"bytes":2549},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CD32XYEB.mjs","kind":"import-statement"}],"exports":["SectionSchema","StackViewType"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":154},"dist/lib/browser/chunk-CD32XYEB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1761},"dist/lib/browser/chunk-CD32XYEB.mjs":{"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["SectionSchema","StackViewType"],"inputs":{"src/types/stack.ts":{"bytesInOutput":575},"src/types/index.ts":{"bytesInOutput":0}},"bytes":687},"dist/lib/browser/StackContainer-TFG62M42.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":21740},"dist/lib/browser/StackContainer-TFG62M42.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-collapsible","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/components/StackContainer.tsx","inputs":{"src/components/StackContainer.tsx":{"bytesInOutput":4076},"src/components/StackContext.tsx":{"bytesInOutput":265},"src/components/StackSection.tsx":{"bytesInOutput":5062},"src/components/CaretDownUp.tsx":{"bytesInOutput":771}},"bytes":10541},"dist/lib/browser/react-surface-RMMCIEXY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3639},"dist/lib/browser/react-surface-RMMCIEXY.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4X7CK6FM.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"dist/lib/browser/StackContainer-TFG62M42.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":794},"src/components/index.ts":{"bytesInOutput":104},"src/components/StackSettings.tsx":{"bytesInOutput":131}},"bytes":1374},"dist/lib/browser/chunk-4X7CK6FM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1165},"dist/lib/browser/chunk-4X7CK6FM.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SECTION_IDENTIFIER","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":695}},"bytes":796}}}
@@ -1,41 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-4X7CK6FM.mjs";
4
-
5
- // src/capabilities/react-surface/react-surface.tsx
6
- import * as Effect from "effect/Effect";
7
- import React2 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/schema";
12
-
13
- // src/components/index.ts
14
- import { lazy } from "react";
15
-
16
- // src/components/StackSettings.tsx
17
- import React from "react";
18
- import { Input, useTranslation } from "@dxos/react-ui";
19
- import { Settings } from "@dxos/react-ui-form";
20
-
21
- // src/components/index.ts
22
- var StackContainer = lazy(() => import("./StackContainer-TFG62M42.mjs"));
23
-
24
- // src/capabilities/react-surface/react-surface.tsx
25
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, Surface.create({
26
- id: `${meta.id}/article`,
27
- role: "article",
28
- filter: (data) => Obj.instanceOf(Collection.Collection, data.subject),
29
- component: ({ role, data }) => {
30
- const id = typeof data.id === "string" ? data.id : void 0;
31
- return /* @__PURE__ */ React2.createElement(StackContainer, {
32
- id: id ?? Obj.getDXN(data.subject).toString(),
33
- role,
34
- subject: data.subject
35
- });
36
- }
37
- }))));
38
- export {
39
- react_surface_default as default
40
- };
41
- //# sourceMappingURL=react-surface-RMMCIEXY.mjs.map