@dxos/plugin-stack 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/PLUGIN.mdl +326 -0
- package/README.md +1 -1
- package/dist/lib/neutral/StackArticle-M7AYNDZN.mjs +125 -0
- package/dist/lib/neutral/StackArticle-M7AYNDZN.mjs.map +7 -0
- package/dist/lib/neutral/StackPlugin.mjs +34 -0
- package/dist/lib/neutral/StackPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +7 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-RGJSGQGF.mjs +36 -0
- package/dist/lib/neutral/chunk-RGJSGQGF.mjs.map +7 -0
- package/dist/lib/{browser/chunk-CD32XYEB.mjs → neutral/chunk-T4NSFSPH.mjs} +3 -6
- package/dist/lib/neutral/chunk-T4NSFSPH.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +182 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +7 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +15 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +9 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-MD3CVY2N.mjs +23 -0
- package/dist/lib/neutral/react-surface-MD3CVY2N.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +37 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/StackPlugin.d.ts +1 -0
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- 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/{CaretDownUp.d.ts → StackSection/CaretDownUp.d.ts} +1 -1
- 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/containers/StackArticle/StackArticle.d.ts +7 -0
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts.map +1 -0
- package/dist/types/src/containers/StackArticle/index.d.ts +2 -0
- package/dist/types/src/containers/StackArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +3 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +30 -30
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/stack.d.ts +1 -2
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -2
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +76 -48
- package/src/StackPlugin.ts +12 -22
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/react-surface.tsx +28 -0
- 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} +24 -21
- package/src/components/StackSection/index.ts +5 -0
- package/src/components/StackSettings/StackSettings.tsx +28 -0
- package/src/components/StackSettings/index.ts +5 -0
- package/src/containers/{StackContainer/StackContainer.tsx → StackArticle/StackArticle.tsx} +38 -42
- package/src/containers/StackArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +21 -7
- package/src/plugin.ts +9 -0
- package/src/translations.ts +23 -22
- package/src/types/stack.ts +3 -8
- package/src/types/types.ts +1 -2
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs +0 -289
- package/dist/lib/browser/StackContainer-BIFUBD3Y.mjs.map +0 -7
- package/dist/lib/browser/chunk-4X7CK6FM.mjs +0 -21
- package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +0 -7
- package/dist/lib/browser/chunk-CD32XYEB.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -84
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-PVND4UCN.mjs +0 -34
- package/dist/lib/browser/react-surface-PVND4UCN.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs +0 -290
- package/dist/lib/node-esm/StackContainer-7XVJHW4D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-26XWE7UY.mjs +0 -29
- package/dist/lib/node-esm/chunk-26XWE7UY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs +0 -23
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -85
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs +0 -35
- package/dist/lib/node-esm/react-surface-SZETVRAZ.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -10
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/CaretDownUp.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/dist/types/src/containers/StackContainer/StackContainer.d.ts +0 -9
- package/dist/types/src/containers/StackContainer/StackContainer.d.ts.map +0 -1
- package/dist/types/src/containers/StackContainer/index.d.ts +0 -3
- package/dist/types/src/containers/StackContainer/index.d.ts.map +0 -1
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -34
- package/src/components/StackSettings.tsx +0 -30
- package/src/containers/StackContainer/index.ts +0 -7
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/src/components/{CaretDownUp.tsx → StackSection/CaretDownUp.tsx} +0 -0
package/src/meta.ts
CHANGED
|
@@ -2,20 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const SECTION_IDENTIFIER = 'dxos.
|
|
9
|
+
export const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');
|
|
9
10
|
|
|
10
|
-
export const meta
|
|
11
|
-
|
|
11
|
+
export const meta = Plugin.makeMeta({
|
|
12
|
+
key: DXN.make('org.dxos.plugin.stack'),
|
|
12
13
|
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
13
14
|
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
14
15
|
name: 'Collections',
|
|
16
|
+
author: 'DXOS',
|
|
17
|
+
spec: 'PLUGIN.mdl',
|
|
15
18
|
description: trim`
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
StackPlugin renders any Collection object as a vertically scrollable stack of collapsible sections in the
|
|
20
|
+
Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering
|
|
21
|
+
to the section surface role, enabling any other plugin to contribute its own section renderer.
|
|
22
|
+
|
|
23
|
+
Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated
|
|
24
|
+
to directly, or removed from the collection. New sections can be inserted before or after any existing
|
|
25
|
+
section via a per-section dropdown menu, or appended via the toolbar Add button.
|
|
26
|
+
|
|
27
|
+
The plugin registers StackViewType with the ECHO schema module so that per-section view metadata
|
|
28
|
+
(height overrides, custom display data) can be stored and replicated alongside the collection.
|
|
29
|
+
|
|
30
|
+
A settings panel exposes a separation toggle that controls whether visual dividers are rendered between
|
|
31
|
+
sections.
|
|
18
32
|
`,
|
|
19
33
|
icon: 'ph--stack-simple--regular',
|
|
20
34
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',
|
|
21
|
-
};
|
|
35
|
+
});
|
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -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 '
|
|
8
|
+
import { meta } from '#meta';
|
|
9
9
|
|
|
10
10
|
export const translations = [
|
|
11
11
|
{
|
|
12
12
|
'en-US': {
|
|
13
13
|
[meta.id]: {
|
|
14
|
-
'plugin
|
|
15
|
-
'settings
|
|
16
|
-
'settings
|
|
17
|
-
'
|
|
18
|
-
'add
|
|
19
|
-
'add
|
|
20
|
-
'add
|
|
21
|
-
'add
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'add
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
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
|
},
|
package/src/types/stack.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
7
|
+
import { DXN, Type } from '@dxos/echo';
|
|
8
8
|
|
|
9
9
|
// All section metadata needs to be optional/have defaults.
|
|
10
10
|
// Any objects added to the collection will start with the section defaults.
|
|
@@ -21,11 +21,6 @@ export const SectionSchema = Schema.Struct({
|
|
|
21
21
|
// TODO(wittjosiah): This needs a relation to be connected to a stack.
|
|
22
22
|
export const StackViewType = Schema.Struct({
|
|
23
23
|
sections: Schema.Record({ key: Schema.String, value: SectionSchema }),
|
|
24
|
-
}).pipe(
|
|
25
|
-
Type.object({
|
|
26
|
-
typename: 'dxos.org/type/StackView',
|
|
27
|
-
version: '0.1.0',
|
|
28
|
-
}),
|
|
29
|
-
);
|
|
24
|
+
}).pipe(Type.makeObject(DXN.make('org.dxos.type.stackView', '0.1.0')));
|
|
30
25
|
|
|
31
|
-
export
|
|
26
|
+
export type StackViewType = Type.InstanceType<typeof StackViewType>;
|
package/src/types/types.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type FC } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Obj } from '@dxos/echo';
|
|
8
|
-
import { type Collection } from '@dxos/echo';
|
|
7
|
+
import { type Collection, type Obj } from '@dxos/echo';
|
|
9
8
|
import { type Label } from '@dxos/react-ui';
|
|
10
9
|
import { type StackItemSize } from '@dxos/react-ui-stack';
|
|
11
10
|
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-4X7CK6FM.mjs";
|
|
4
|
-
|
|
5
|
-
// src/containers/StackContainer/StackContainer.tsx
|
|
6
|
-
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
7
|
-
import * as Option from "effect/Option";
|
|
8
|
-
import React4, { useCallback, useState as useState2 } from "react";
|
|
9
|
-
import { useCapabilities, useOperationInvoker } from "@dxos/app-framework/ui";
|
|
10
|
-
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
11
|
-
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
12
|
-
import { Obj } from "@dxos/echo";
|
|
13
|
-
import { AtomObj } from "@dxos/echo-atom";
|
|
14
|
-
import { Graph } from "@dxos/plugin-graph";
|
|
15
|
-
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
16
|
-
import { Toolbar, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
17
|
-
import { AttentionProvider } from "@dxos/react-ui-attention";
|
|
18
|
-
import { Stack, StackItem as StackItem2 } from "@dxos/react-ui-stack";
|
|
19
|
-
import { isNonNullable } from "@dxos/util";
|
|
20
|
-
|
|
21
|
-
// src/components/StackContext.tsx
|
|
22
|
-
import { createContext, useContext } from "react";
|
|
23
|
-
var StackContext = /* @__PURE__ */ createContext({
|
|
24
|
-
onCollapse: () => {
|
|
25
|
-
},
|
|
26
|
-
onNavigate: async () => {
|
|
27
|
-
},
|
|
28
|
-
onDelete: async () => {
|
|
29
|
-
},
|
|
30
|
-
onAdd: () => {
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
var useStack = () => useContext(StackContext);
|
|
34
|
-
|
|
35
|
-
// src/components/StackSection.tsx
|
|
36
|
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
37
|
-
import React2, { useMemo, useState } from "react";
|
|
38
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
39
|
-
import { DropdownMenu, Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
40
|
-
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
41
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
42
|
-
import { getSize, mx, textBlockWidth } from "@dxos/ui-theme";
|
|
43
|
-
|
|
44
|
-
// src/components/CaretDownUp.tsx
|
|
45
|
-
import React from "react";
|
|
46
|
-
var CaretDownUp = ({ children, ...props }) => {
|
|
47
|
-
return /* @__PURE__ */ React.createElement("svg", {
|
|
48
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
-
viewBox: "0 0 256 256",
|
|
50
|
-
...props
|
|
51
|
-
}, /* @__PURE__ */ React.createElement("rect", {
|
|
52
|
-
width: "256",
|
|
53
|
-
height: "256",
|
|
54
|
-
fill: "none"
|
|
55
|
-
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
56
|
-
points: "80 224 128 176 176 224",
|
|
57
|
-
fill: "none",
|
|
58
|
-
stroke: "currentColor",
|
|
59
|
-
strokeLinecap: "round",
|
|
60
|
-
strokeLinejoin: "round",
|
|
61
|
-
strokeWidth: "16"
|
|
62
|
-
}), /* @__PURE__ */ React.createElement("polyline", {
|
|
63
|
-
points: "80 32 128 80 176 32",
|
|
64
|
-
fill: "none",
|
|
65
|
-
stroke: "currentColor",
|
|
66
|
-
strokeLinecap: "round",
|
|
67
|
-
strokeLinejoin: "round",
|
|
68
|
-
strokeWidth: "16"
|
|
69
|
-
}), children);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// src/components/StackSection.tsx
|
|
73
|
-
var sectionActionDimensions = "p-1 my-1 shrink-0 min-h-0 w-(--dx-rail-action) h-min";
|
|
74
|
-
var StackSection = ({ id, view, object, metadata: { icon = "ph--placeholder--regular" } }) => {
|
|
75
|
-
const { t } = useTranslation(meta.id);
|
|
76
|
-
const { onNavigate, onAdd, onCollapse, onDelete } = useStack();
|
|
77
|
-
const [optionsMenuOpen, setOptionsMenuOpen] = useState(false);
|
|
78
|
-
const attentionAttrs = useAttentionAttributes(id);
|
|
79
|
-
const stackItem = useMemo(() => ({
|
|
80
|
-
id
|
|
81
|
-
}), [
|
|
82
|
-
id
|
|
83
|
-
]);
|
|
84
|
-
return /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Root, {
|
|
85
|
-
asChild: true,
|
|
86
|
-
open: !view.collapsed,
|
|
87
|
-
onOpenChange: (nextOpen) => onCollapse?.(id, !nextOpen)
|
|
88
|
-
}, /* @__PURE__ */ React2.createElement(StackItem.Root, {
|
|
89
|
-
item: stackItem,
|
|
90
|
-
role: "section",
|
|
91
|
-
...attentionAttrs
|
|
92
|
-
}, /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
93
|
-
classNames: "dx-attention-surface"
|
|
94
|
-
}, /* @__PURE__ */ React2.createElement("span", {
|
|
95
|
-
className: "sr-only"
|
|
96
|
-
}, view.title), /* @__PURE__ */ React2.createElement(StackItem.HeadingStickyContent, null, /* @__PURE__ */ React2.createElement(DropdownMenu.Root, {
|
|
97
|
-
open: optionsMenuOpen,
|
|
98
|
-
onOpenChange: setOptionsMenuOpen
|
|
99
|
-
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Trigger, {
|
|
100
|
-
asChild: true
|
|
101
|
-
}, /* @__PURE__ */ React2.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React2.createElement(Icon, {
|
|
102
|
-
icon,
|
|
103
|
-
size: 5,
|
|
104
|
-
classNames: "transition-opacity"
|
|
105
|
-
}))), /* @__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, {
|
|
106
|
-
onClick: () => onNavigate(id),
|
|
107
|
-
"data-testid": "section.navigate-to"
|
|
108
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
109
|
-
icon: "ph--arrow-right--regular",
|
|
110
|
-
size: 5
|
|
111
|
-
}), /* @__PURE__ */ React2.createElement("span", {
|
|
112
|
-
className: "ms-2 grow"
|
|
113
|
-
}, t("navigate to section label"))) : /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
114
|
-
asChild: true
|
|
115
|
-
}, /* @__PURE__ */ React2.createElement(DropdownMenu.Item, null, /* @__PURE__ */ React2.createElement(CaretDownUp, {
|
|
116
|
-
className: getSize(5)
|
|
117
|
-
}), /* @__PURE__ */ React2.createElement("span", {
|
|
118
|
-
className: "ms-2 grow"
|
|
119
|
-
}, t("collapse label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
120
|
-
onClick: () => onAdd(id, "before"),
|
|
121
|
-
"data-testid": "section.add-before"
|
|
122
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
123
|
-
icon: "ph--arrow-line-up--regular",
|
|
124
|
-
size: 5
|
|
125
|
-
}), /* @__PURE__ */ React2.createElement("span", {
|
|
126
|
-
className: "ms-2 grow"
|
|
127
|
-
}, t("add section before label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
128
|
-
onClick: () => onAdd(id, "after"),
|
|
129
|
-
"data-testid": "section.add-after"
|
|
130
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
131
|
-
icon: "ph--arrow-line-down--regular",
|
|
132
|
-
size: 5
|
|
133
|
-
}), /* @__PURE__ */ React2.createElement("span", {
|
|
134
|
-
className: "ms-2 grow"
|
|
135
|
-
}, t("add section after label"))), /* @__PURE__ */ React2.createElement(DropdownMenu.Item, {
|
|
136
|
-
onClick: () => onDelete(id),
|
|
137
|
-
"data-testid": "section.remove"
|
|
138
|
-
}, /* @__PURE__ */ React2.createElement(Icon, {
|
|
139
|
-
icon: "ph--trash--regular",
|
|
140
|
-
size: 5
|
|
141
|
-
}), /* @__PURE__ */ React2.createElement("span", {
|
|
142
|
-
className: "ms-2 grow"
|
|
143
|
-
}, t("remove section label")))), /* @__PURE__ */ React2.createElement(DropdownMenu.Arrow, null)))), view.collapsed ? /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Trigger, {
|
|
144
|
-
asChild: true
|
|
145
|
-
}, /* @__PURE__ */ React2.createElement(IconButton, {
|
|
146
|
-
iconOnly: true,
|
|
147
|
-
variant: "ghost",
|
|
148
|
-
label: t("expand label"),
|
|
149
|
-
icon: "ph--caret-up-down--regular",
|
|
150
|
-
classNames: sectionActionDimensions
|
|
151
|
-
})) : /* @__PURE__ */ React2.createElement(IconButton, {
|
|
152
|
-
iconOnly: true,
|
|
153
|
-
variant: "ghost",
|
|
154
|
-
onClick: () => onNavigate(id),
|
|
155
|
-
label: t("navigate to section label"),
|
|
156
|
-
icon: "ph--arrow-right--regular",
|
|
157
|
-
"data-testid": "section.navigate-to",
|
|
158
|
-
classNames: sectionActionDimensions
|
|
159
|
-
}))), /* @__PURE__ */ React2.createElement(CollapsiblePrimitive.Content, null, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
160
|
-
role: "section",
|
|
161
|
-
data: {
|
|
162
|
-
subject: object
|
|
163
|
-
},
|
|
164
|
-
limit: 1,
|
|
165
|
-
placeholder: /* @__PURE__ */ React2.createElement(React2.Fragment, null)
|
|
166
|
-
})), view.collapsed && /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
167
|
-
classNames: "dx-attention-surface"
|
|
168
|
-
}, /* @__PURE__ */ React2.createElement("h2", {
|
|
169
|
-
className: mx("flex items-center p-4 font-medium", textBlockWidth)
|
|
170
|
-
}, view.title))));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
// src/components/StackSettings.tsx
|
|
174
|
-
import React3 from "react";
|
|
175
|
-
import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
176
|
-
import { Settings } from "@dxos/react-ui-form";
|
|
177
|
-
|
|
178
|
-
// src/containers/StackContainer/StackContainer.tsx
|
|
179
|
-
var collectionObjectsFamily = Atom.family((collection) => Atom.make((get) => {
|
|
180
|
-
const snapshot = get(AtomObj.make(collection));
|
|
181
|
-
return snapshot.objects.map((ref) => get(AtomObj.makeWithReactive(ref))).filter(isNonNullable);
|
|
182
|
-
}));
|
|
183
|
-
var StackContainer = ({ id, subject: collection }) => {
|
|
184
|
-
const { invokePromise } = useOperationInvoker();
|
|
185
|
-
const { graph } = useAppGraph();
|
|
186
|
-
const { t } = useTranslation3(meta.id);
|
|
187
|
-
const allMetadata = useCapabilities(AppCapabilities.Metadata);
|
|
188
|
-
const [collapsedSections, setCollapsedSections] = useState2({});
|
|
189
|
-
const collectionObjects = useAtomValue(collectionObjectsFamily(collection));
|
|
190
|
-
const items = collectionObjects.map((object) => {
|
|
191
|
-
const metadata = allMetadata.find((m) => m.id === (Obj.getTypename(object) ?? "never"))?.metadata;
|
|
192
|
-
const view = {
|
|
193
|
-
// ...stack.sections[object.id],
|
|
194
|
-
collapsed: collapsedSections[Obj.getDXN(object).toString()],
|
|
195
|
-
title: object?.title ?? // TODO(wittjosiah): `getNode` is not reactive.
|
|
196
|
-
toLocalizedString(Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label, t)
|
|
197
|
-
};
|
|
198
|
-
return {
|
|
199
|
-
id: Obj.getDXN(object).toString(),
|
|
200
|
-
object,
|
|
201
|
-
metadata,
|
|
202
|
-
view
|
|
203
|
-
};
|
|
204
|
-
});
|
|
205
|
-
const handleDelete = useCallback(async (id2) => {
|
|
206
|
-
const index = collection.objects.map((object2) => object2.target).filter(isNonNullable).findIndex((section) => Obj.getDXN(section).toString() === id2);
|
|
207
|
-
const object = collection.objects[index].target;
|
|
208
|
-
if (Obj.isObject(object)) {
|
|
209
|
-
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
210
|
-
objects: [
|
|
211
|
-
object
|
|
212
|
-
],
|
|
213
|
-
target: collection
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, [
|
|
217
|
-
collection,
|
|
218
|
-
invokePromise
|
|
219
|
-
]);
|
|
220
|
-
const handleAdd = useCallback(async (id2, position) => {
|
|
221
|
-
await invokePromise(LayoutOperation.UpdateDialog, {
|
|
222
|
-
subject: `${meta.id}/AddSectionDialog`,
|
|
223
|
-
blockAlign: "start",
|
|
224
|
-
props: {
|
|
225
|
-
path: id2,
|
|
226
|
-
position,
|
|
227
|
-
collection
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
}, [
|
|
231
|
-
collection,
|
|
232
|
-
invokePromise
|
|
233
|
-
]);
|
|
234
|
-
const handleNavigate = useCallback(async (id2) => {
|
|
235
|
-
await invokePromise(LayoutOperation.Open, {
|
|
236
|
-
subject: [
|
|
237
|
-
id2
|
|
238
|
-
]
|
|
239
|
-
});
|
|
240
|
-
}, [
|
|
241
|
-
invokePromise
|
|
242
|
-
]);
|
|
243
|
-
const handleCollapse = useCallback((id2, collapsed) => setCollapsedSections((prev) => ({
|
|
244
|
-
...prev,
|
|
245
|
-
[id2]: collapsed
|
|
246
|
-
})), []);
|
|
247
|
-
const handleAddSection = useCallback(() => invokePromise(SpaceOperation.OpenCreateObject, {
|
|
248
|
-
target: collection,
|
|
249
|
-
navigable: false
|
|
250
|
-
}), [
|
|
251
|
-
collection,
|
|
252
|
-
invokePromise
|
|
253
|
-
]);
|
|
254
|
-
return /* @__PURE__ */ React4.createElement(StackItem2.Content, {
|
|
255
|
-
toolbar: true,
|
|
256
|
-
classNames: "dx-article overflow-hidden border-l border-r border-subdued-separator"
|
|
257
|
-
}, /* @__PURE__ */ React4.createElement(Toolbar.Root, null, /* @__PURE__ */ React4.createElement(Toolbar.IconButton, {
|
|
258
|
-
icon: "ph--plus--regular",
|
|
259
|
-
iconOnly: true,
|
|
260
|
-
label: "Add section",
|
|
261
|
-
"data-testid": "stack.addSection",
|
|
262
|
-
onClick: handleAddSection
|
|
263
|
-
})), /* @__PURE__ */ React4.createElement(AttentionProvider, {
|
|
264
|
-
id
|
|
265
|
-
}, /* @__PURE__ */ React4.createElement(StackContext.Provider, {
|
|
266
|
-
value: {
|
|
267
|
-
onCollapse: handleCollapse,
|
|
268
|
-
onNavigate: handleNavigate,
|
|
269
|
-
onDelete: handleDelete,
|
|
270
|
-
onAdd: handleAdd
|
|
271
|
-
}
|
|
272
|
-
}, /* @__PURE__ */ React4.createElement(Stack, {
|
|
273
|
-
orientation: "vertical",
|
|
274
|
-
size: "intrinsic",
|
|
275
|
-
id,
|
|
276
|
-
"data-testid": "main.stack",
|
|
277
|
-
classNames: "overflow-y-auto"
|
|
278
|
-
}, items.map((item) => /* @__PURE__ */ React4.createElement(StackSection, {
|
|
279
|
-
key: item.id,
|
|
280
|
-
...item
|
|
281
|
-
}))))));
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// src/containers/StackContainer/index.ts
|
|
285
|
-
var StackContainer_default = StackContainer;
|
|
286
|
-
export {
|
|
287
|
-
StackContainer_default as default
|
|
288
|
-
};
|
|
289
|
-
//# sourceMappingURL=StackContainer-BIFUBD3Y.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/StackContainer/StackContainer.tsx", "../../../src/components/StackContext.tsx", "../../../src/components/StackSection.tsx", "../../../src/components/CaretDownUp.tsx", "../../../src/components/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 { AttentionProvider } from '@dxos/react-ui-attention';\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 id: string;\n};\n\nexport const 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 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-article overflow-hidden border-l border-r border-subdued-separator'>\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", "//\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 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 { 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='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={{ subject: object }} 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', 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", "//\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\nex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A,IAAA,yBAAeG;",
|
|
6
|
-
"names": ["Atom", "useAtomValue", "Option", "React", "useCallback", "useState", "useCapabilities", "useOperationInvoker", "AppCapabilities", "LayoutOperation", "useAppGraph", "Obj", "AtomObj", "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", "React", "Input", "useTranslation", "Settings", "collectionObjectsFamily", "Atom", "family", "collection", "make", "get", "snapshot", "AtomObj", "objects", "map", "ref", "makeWithReactive", "filter", "isNonNullable", "StackContainer", "id", "subject", "invokePromise", "useOperationInvoker", "graph", "useAppGraph", "t", "useTranslation", "meta", "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", "AttentionProvider", "StackContext", "Provider", "value", "onCollapse", "onNavigate", "onDelete", "onAdd", "Stack", "orientation", "size", "item", "StackSection", "key", "StackContainer"]
|
|
7
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { trim } from "@dxos/util";
|
|
3
|
-
var SECTION_IDENTIFIER = "dxos.org/type/StackSection";
|
|
4
|
-
var meta = {
|
|
5
|
-
id: "dxos.org/plugin/stack",
|
|
6
|
-
// TODO(wittjosiah): Prevents "stacks" language from being exposed to users in settings panel.
|
|
7
|
-
// Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.
|
|
8
|
-
name: "Collections",
|
|
9
|
-
description: trim`
|
|
10
|
-
Organize and view curated collections of workspace objects in customizable layouts.
|
|
11
|
-
Group related items together and manage collections with sections and filtering.
|
|
12
|
-
`,
|
|
13
|
-
icon: "ph--stack-simple--regular",
|
|
14
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
SECTION_IDENTIFIER,
|
|
19
|
-
meta
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-4X7CK6FM.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/stack',\n // TODO(wittjosiah): Prevents \"stacks\" language from being exposed to users in settings panel.\n // Conside renaming this to the collection plugin and trying to factor more collections logic from the space plugin.\n name: 'Collections',\n description: trim`\n Organize and view curated collections of workspace objects in customizable layouts.\n Group related items together and manage collections with sections and filtering.\n `,\n icon: 'ph--stack-simple--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n};\n"],
|
|
5
|
-
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,qBAAqB;AAE3B,IAAMC,OAAoB;EAC/BC,IAAI;;;EAGJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["trim", "SECTION_IDENTIFIER", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/stack.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Type } from '@dxos/echo';\n\n// All section metadata needs to be optional/have defaults.\n// Any objects added to the collection will start with the section defaults.\n// If an object is removed from the collection without removing the section metadata this is fine.\n// Stack components should clean-up the superfluous data on future edits.\n\nexport const SectionSchema = Schema.Struct({\n height: Schema.optional(Schema.Number),\n // Space for data that isn't stack-specific but is specific to this view instance.\n // e.g. cover/fill for an image\n custom: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n});\n\n// TODO(wittjosiah): This needs a relation to be connected to a stack.\nexport const StackViewType = Schema.Struct({\n sections: Schema.Record({ key: Schema.String, value: SectionSchema }),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/StackView',\n version: '0.1.0',\n }),\n);\n\nexport interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,YAAY;AAOd,IAAMC,gBAAuBC,cAAO;EACzCC,QAAeC,gBAAgBC,aAAM;;;EAGrCC,QAAeF,gBAAgBG,cAAO;IAAEC,KAAYC;IAAQC,OAAcC;EAAI,CAAA,CAAA;AAChF,CAAA;AAGO,IAAMC,gBAAuBV,cAAO;EACzCW,UAAiBN,cAAO;IAAEC,KAAYC;IAAQC,OAAOT;EAAc,CAAA;AACrE,CAAA,EAAGa,KACDC,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Type", "SectionSchema", "Struct", "height", "optional", "Number", "custom", "Record", "key", "String", "value", "Any", "StackViewType", "sections", "pipe", "Type", "object", "typename", "version"]
|
|
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-PVND4UCN.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
|