@dxos/plugin-stack 0.11.1 → 0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e
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/PLUGIN.mdl +2 -2
- package/dist/lib/Stack.mjs +10 -0
- package/dist/lib/Stack.mjs.map +1 -0
- package/dist/lib/StackEvents.mjs +15 -0
- package/dist/lib/StackEvents.mjs.map +1 -0
- package/dist/lib/StackPlugin.mjs +12 -14
- package/dist/lib/StackPlugin.mjs.map +1 -1
- package/dist/lib/capabilities.mjs +14 -3
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +11 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +11 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-StackArticle.mjs +20 -17
- package/dist/lib/chunk-StackArticle.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +4 -3
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-schema.mjs +11 -0
- package/dist/lib/chunk-schema.mjs.map +1 -0
- package/dist/lib/components.mjs +2 -2
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/index.mjs +4 -3
- package/dist/lib/meta.mjs +36 -1
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/plugin.mjs +5 -4
- package/dist/lib/plugin.mjs.map +1 -1
- package/dist/lib/types.mjs +3 -2
- package/dist/types/src/StackPlugin.d.ts +36 -3
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/gen/node.d.ts +5 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +5 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/schema.d.ts +8 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/components/Stack/Stack.d.ts +11 -16
- package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.d.ts.map +1 -1
- package/dist/types/src/containers/StackArticle/StackArticle.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +2 -1
- package/dist/types/src/plugin.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/StackEvents.d.ts +8 -0
- package/dist/types/src/types/StackEvents.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +65 -45
- package/src/StackPlugin.ts +7 -18
- package/src/capabilities/gen/node.ts +16 -0
- package/src/capabilities/gen/workerd.ts +16 -0
- package/src/capabilities/index.ts +18 -2
- package/src/capabilities/react-surface.ts +3 -2
- package/src/capabilities/schema.ts +11 -0
- package/src/components/Stack/Stack.tsx +1 -1
- package/src/containers/StackArticle/StackArticle.stories.tsx +17 -17
- package/src/containers/StackArticle/StackArticle.tsx +22 -17
- package/src/index.ts +3 -2
- package/src/meta.ts +1 -1
- package/src/plugin.ts +12 -3
- package/src/types/StackEvents.ts +16 -0
- package/src/types/index.ts +2 -1
- package/dist/lib/chunk-meta.mjs +0 -37
- package/dist/lib/chunk-meta.mjs.map +0 -1
- package/dist/lib/chunk-types.mjs +0 -21
- package/dist/lib/chunk-types.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
16
|
"#capabilities": {
|
|
17
|
-
"source":
|
|
17
|
+
"source": {
|
|
18
|
+
"workerd": "./src/capabilities/gen/workerd.ts",
|
|
19
|
+
"node": "./src/capabilities/gen/node.ts",
|
|
20
|
+
"default": "./src/capabilities/index.ts"
|
|
21
|
+
},
|
|
18
22
|
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
23
|
+
"workerd": "./dist/lib/capabilities.workerd.mjs",
|
|
24
|
+
"node": "./dist/lib/capabilities.node.mjs",
|
|
19
25
|
"default": "./dist/lib/capabilities.mjs"
|
|
20
26
|
},
|
|
21
27
|
"#components": {
|
|
@@ -34,9 +40,9 @@
|
|
|
34
40
|
"default": "./dist/lib/meta.mjs"
|
|
35
41
|
},
|
|
36
42
|
"#plugin": {
|
|
37
|
-
"source": "./src/
|
|
38
|
-
"types": "./dist/types/src/
|
|
39
|
-
"default": "./dist/lib/
|
|
43
|
+
"source": "./src/plugin.ts",
|
|
44
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
45
|
+
"default": "./dist/lib/plugin.mjs"
|
|
40
46
|
},
|
|
41
47
|
"#translations": {
|
|
42
48
|
"source": "./src/translations.ts",
|
|
@@ -56,18 +62,39 @@
|
|
|
56
62
|
"import": "./dist/lib/index.mjs"
|
|
57
63
|
},
|
|
58
64
|
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
59
|
-
"./plugin": {
|
|
60
|
-
"source": "./src/plugin.ts",
|
|
61
|
-
"types": "./dist/types/src/plugin.d.ts",
|
|
62
|
-
"import": "./dist/lib/plugin.mjs"
|
|
63
|
-
},
|
|
64
65
|
"./translations": {
|
|
65
66
|
"source": "./src/translations.ts",
|
|
66
67
|
"types": "./dist/types/src/translations.d.ts",
|
|
67
68
|
"import": "./dist/lib/translations.mjs"
|
|
69
|
+
},
|
|
70
|
+
"./package.json": "./package.json",
|
|
71
|
+
"./Stack": {
|
|
72
|
+
"source": "./src/types/Stack.ts",
|
|
73
|
+
"types": "./dist/types/src/types/Stack.d.ts",
|
|
74
|
+
"import": "./dist/lib/Stack.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./StackEvents": {
|
|
77
|
+
"source": "./src/types/StackEvents.ts",
|
|
78
|
+
"types": "./dist/types/src/types/StackEvents.d.ts",
|
|
79
|
+
"import": "./dist/lib/StackEvents.mjs"
|
|
80
|
+
},
|
|
81
|
+
"./StackPlugin": {
|
|
82
|
+
"source": "./src/StackPlugin.ts",
|
|
83
|
+
"types": "./dist/types/src/StackPlugin.d.ts",
|
|
84
|
+
"import": "./dist/lib/StackPlugin.mjs"
|
|
68
85
|
}
|
|
69
86
|
},
|
|
70
87
|
"types": "dist/types/src/index.d.ts",
|
|
88
|
+
"typesVersions": {
|
|
89
|
+
"*": {
|
|
90
|
+
"Stack": [
|
|
91
|
+
"dist/types/src/types/Stack.d.ts"
|
|
92
|
+
],
|
|
93
|
+
"StackEvents": [
|
|
94
|
+
"dist/types/src/types/StackEvents.d.ts"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
71
98
|
"files": [
|
|
72
99
|
"dist",
|
|
73
100
|
"dx.config.ts",
|
|
@@ -75,51 +102,44 @@
|
|
|
75
102
|
"PLUGIN.mdl"
|
|
76
103
|
],
|
|
77
104
|
"dependencies": {
|
|
78
|
-
"@effect
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"@dxos/app-
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/plugin-graph": "0.11.1",
|
|
91
|
-
"@dxos/plugin-space": "0.11.1",
|
|
92
|
-
"@dxos/react-ui-attention": "0.11.1",
|
|
93
|
-
"@dxos/react-ui-dnd": "0.11.1",
|
|
94
|
-
"@dxos/react-ui-form": "0.11.1",
|
|
95
|
-
"@dxos/react-ui-menu": "0.11.1",
|
|
96
|
-
"@dxos/react-ui-mosaic": "0.11.1",
|
|
97
|
-
"@dxos/util": "0.11.1"
|
|
105
|
+
"@effect/atom-react": "4.0.0-rc.108",
|
|
106
|
+
"effect": "4.0.0-rc.108",
|
|
107
|
+
"@dxos/app-framework": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
108
|
+
"@dxos/app-toolkit": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
109
|
+
"@dxos/echo": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
110
|
+
"@dxos/keys": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
111
|
+
"@dxos/plugin-space": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
112
|
+
"@dxos/react-ui-attention": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
113
|
+
"@dxos/react-ui-dnd": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
114
|
+
"@dxos/react-ui-menu": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
115
|
+
"@dxos/react-ui-mosaic": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
116
|
+
"@dxos/util": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e"
|
|
98
117
|
},
|
|
99
118
|
"devDependencies": {
|
|
100
|
-
"@
|
|
119
|
+
"@storybook/react-vite": "^10.5.8",
|
|
101
120
|
"@types/react": "~19.2.17",
|
|
102
121
|
"@types/react-dom": "~19.2.3",
|
|
103
122
|
"react": "~19.2.7",
|
|
104
123
|
"react-dom": "~19.2.7",
|
|
105
|
-
"vite": "^8.1
|
|
106
|
-
"@dxos/
|
|
107
|
-
"@dxos/plugin-
|
|
108
|
-
"@dxos/plugin-
|
|
109
|
-
"@dxos/plugin-
|
|
110
|
-
"@dxos/
|
|
111
|
-
"@dxos/
|
|
112
|
-
"@dxos/
|
|
113
|
-
"@dxos/
|
|
114
|
-
"@dxos/ui-theme": "0.
|
|
124
|
+
"vite": "^8.2.1",
|
|
125
|
+
"@dxos/echo-react": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
126
|
+
"@dxos/plugin-illustrator": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
127
|
+
"@dxos/plugin-markdown": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
128
|
+
"@dxos/plugin-client": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
129
|
+
"@dxos/plugin-tldraw": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
130
|
+
"@dxos/plugin-testing": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
131
|
+
"@dxos/random": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
132
|
+
"@dxos/react-client": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
133
|
+
"@dxos/ui-theme": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
134
|
+
"@dxos/react-ui": "0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e"
|
|
115
135
|
},
|
|
116
136
|
"peerDependencies": {
|
|
117
|
-
"@effect
|
|
118
|
-
"effect": "
|
|
137
|
+
"@effect/atom-react": "4.0.0-rc.108",
|
|
138
|
+
"effect": "4.0.0-rc.108",
|
|
119
139
|
"react": "~19.2.7",
|
|
120
140
|
"react-dom": "~19.2.7",
|
|
121
|
-
"@dxos/react-ui": "^0.
|
|
122
|
-
"@dxos/ui-theme": "^0.
|
|
141
|
+
"@dxos/react-ui": "^0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e",
|
|
142
|
+
"@dxos/ui-theme": "^0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e"
|
|
123
143
|
},
|
|
124
144
|
"publishConfig": {
|
|
125
145
|
"access": "public"
|
package/src/StackPlugin.ts
CHANGED
|
@@ -2,25 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { AppPlugin } from '@dxos/app-toolkit';
|
|
5
|
+
// @import-as-namespace
|
|
7
6
|
|
|
8
|
-
import
|
|
9
|
-
import { meta } from '#meta';
|
|
10
|
-
import { translations } from '#translations';
|
|
11
|
-
import { Stack } from '#types';
|
|
7
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
import pluginSpec from '../PLUGIN.mdl?raw';
|
|
9
|
+
import { meta as pluginMeta } from '#meta';
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
19
|
-
AppPlugin.addTranslationsModule({ translations }),
|
|
20
|
-
AppPlugin.addPluginAssetModule({
|
|
21
|
-
asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
22
|
-
}),
|
|
23
|
-
Plugin.make,
|
|
24
|
-
);
|
|
11
|
+
/** Plugin metadata, available without loading the plugin body. */
|
|
12
|
+
export const meta = pluginMeta;
|
|
25
13
|
|
|
26
|
-
|
|
14
|
+
/** Constructs the plugin; the body loads on first enable. */
|
|
15
|
+
export const make = Plugin.lazy(meta, () => import('#plugin'));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.
|
|
6
|
+
|
|
7
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
8
|
+
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
11
|
+
export const Schema = AppCapability.schema(() => import('../schema'));
|
|
12
|
+
|
|
13
|
+
export const Translations = AppCapability.translations(translations);
|
|
14
|
+
|
|
15
|
+
export const PluginAsset = undefined;
|
|
16
|
+
export const ReactSurface = undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' condition.
|
|
6
|
+
|
|
7
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
8
|
+
|
|
9
|
+
import { translations } from '#translations';
|
|
10
|
+
|
|
11
|
+
export const Schema = AppCapability.schema(() => import('../schema'));
|
|
12
|
+
|
|
13
|
+
export const Translations = AppCapability.translations(translations);
|
|
14
|
+
|
|
15
|
+
export const PluginAsset = undefined;
|
|
16
|
+
export const ReactSurface = undefined;
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as AppCapability from '@dxos/app-toolkit/AppCapability';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { translations } from '#translations';
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line import/no-relative-packages
|
|
11
|
+
import pluginSpec from '../../PLUGIN.mdl?raw';
|
|
12
|
+
|
|
13
|
+
export const PluginAsset = AppCapability.pluginAsset({
|
|
14
|
+
pluginId: meta.profile.key,
|
|
15
|
+
path: 'PLUGIN.mdl',
|
|
16
|
+
content: pluginSpec,
|
|
17
|
+
mimeType: 'application/x-mdl',
|
|
18
|
+
});
|
|
19
|
+
export const ReactSurface = AppCapability.surface(() => import('./react-surface'), {
|
|
20
|
+
roles: ['org.dxos.role.article'],
|
|
21
|
+
});
|
|
22
|
+
export const Schema = AppCapability.schema(() => import('./schema'));
|
|
23
|
+
export const Translations = AppCapability.translations(translations);
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as Capabilities from '@dxos/app-framework/Capabilities';
|
|
8
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
8
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
9
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
import { Collection } from '@dxos/echo';
|
|
@@ -13,7 +14,7 @@ import { StackArticle } from '#containers';
|
|
|
13
14
|
|
|
14
15
|
export default Capability.makeModule(() =>
|
|
15
16
|
Effect.succeed(
|
|
16
|
-
Capability.
|
|
17
|
+
Capability.contribute(
|
|
17
18
|
Capabilities.ReactSurface,
|
|
18
19
|
Surface.create({
|
|
19
20
|
id: 'article',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Stack } from '#types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Schemas this plugin registers, loaded on demand: the capability activates at idle,
|
|
9
|
+
* so naming them here keeps them out of the plugin body's module graph.
|
|
10
|
+
*/
|
|
11
|
+
export default [Stack.Stack];
|
|
@@ -13,7 +13,7 @@ import React, {
|
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
15
|
import { Surface } from '@dxos/app-framework/ui';
|
|
16
|
-
import
|
|
16
|
+
import * as GraphPath from '@dxos/app-toolkit/GraphPath';
|
|
17
17
|
import { AppSurface, AttentionSigilButton } from '@dxos/app-toolkit/ui';
|
|
18
18
|
import { Obj } from '@dxos/echo';
|
|
19
19
|
import {
|
|
@@ -6,22 +6,23 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import * as Capability from '@dxos/app-framework/Capability';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
-
import
|
|
11
|
+
import * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';
|
|
12
12
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Collection, Filter, Ref } from '@dxos/echo';
|
|
14
14
|
import { useQuery } from '@dxos/echo-react';
|
|
15
15
|
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
16
|
+
import * as Drawing from '@dxos/plugin-illustrator/Drawing';
|
|
17
|
+
import * as IllustratorPlugin from '@dxos/plugin-illustrator/IllustratorPlugin';
|
|
18
|
+
import * as Markdown from '@dxos/plugin-markdown/Markdown';
|
|
19
19
|
import { MarkdownPlugin } from '@dxos/plugin-markdown/testing';
|
|
20
20
|
import { SpacePlugin } from '@dxos/plugin-space/testing';
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
21
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
22
|
+
import * as StorybookPlugin from '@dxos/plugin-testing/StorybookPlugin';
|
|
23
|
+
import * as Tldraw from '@dxos/plugin-tldraw/Tldraw';
|
|
24
|
+
import * as TldrawModel from '@dxos/plugin-tldraw/TldrawModel';
|
|
25
|
+
import * as TldrawPlugin from '@dxos/plugin-tldraw/TldrawPlugin';
|
|
25
26
|
import { random } from '@dxos/random';
|
|
26
27
|
import { useClient } from '@dxos/react-client';
|
|
27
28
|
import { withMosaic } from '@dxos/react-ui-mosaic/testing';
|
|
@@ -57,15 +58,14 @@ const meta: Meta<typeof StackArticle> = {
|
|
|
57
58
|
withMosaic(),
|
|
58
59
|
withLayout({ layout: 'fullscreen' }),
|
|
59
60
|
withPluginManager({
|
|
60
|
-
|
|
61
|
-
capabilities: [Capability.contributes(AppCapabilities.Translations, translations)],
|
|
61
|
+
capabilities: [Capability.contribute(AppCapabilities.Translations, translations)],
|
|
62
62
|
plugins: [
|
|
63
63
|
...corePlugins(),
|
|
64
|
-
ClientPlugin({
|
|
64
|
+
ClientPlugin.make({
|
|
65
65
|
types: [Collection.Collection, Markdown.Document, Drawing.Drawing, Drawing.Canvas],
|
|
66
66
|
onClientInitialized: ({ client }) =>
|
|
67
67
|
Effect.gen(function* () {
|
|
68
|
-
const {
|
|
68
|
+
const { defaultSpace: space } = yield* initializeIdentity(client);
|
|
69
69
|
|
|
70
70
|
const documents = Array.from({ length: 5 }).map(() =>
|
|
71
71
|
Ref.make(
|
|
@@ -104,11 +104,11 @@ const meta: Meta<typeof StackArticle> = {
|
|
|
104
104
|
);
|
|
105
105
|
}),
|
|
106
106
|
}),
|
|
107
|
-
MarkdownPlugin(),
|
|
108
|
-
IllustratorPlugin(),
|
|
109
|
-
TldrawPlugin(),
|
|
107
|
+
MarkdownPlugin.make(),
|
|
108
|
+
IllustratorPlugin.make(),
|
|
109
|
+
TldrawPlugin.make(),
|
|
110
110
|
SpacePlugin({}),
|
|
111
|
-
StorybookPlugin({}),
|
|
111
|
+
StorybookPlugin.make({}),
|
|
112
112
|
],
|
|
113
113
|
}),
|
|
114
114
|
],
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useAtomValue } from '@effect/atom-react/Hooks';
|
|
6
|
+
import * as Atom from 'effect/unstable/reactivity/Atom';
|
|
6
7
|
import React, { useCallback, useId, useMemo, useState } from 'react';
|
|
7
8
|
|
|
8
9
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
10
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
10
11
|
import { type Collection, Obj } from '@dxos/echo';
|
|
11
|
-
import
|
|
12
|
+
import * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';
|
|
12
13
|
import { Panel, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
13
14
|
import { type DndContainerHandler } from '@dxos/react-ui-dnd';
|
|
14
15
|
import { Menu, createMenuAction } from '@dxos/react-ui-menu';
|
|
@@ -114,22 +115,26 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
114
115
|
);
|
|
115
116
|
|
|
116
117
|
const handleAdd = useCallback(
|
|
117
|
-
(id: string) =>
|
|
118
|
-
invokePromise(SpaceOperation.
|
|
118
|
+
async (id: string) => {
|
|
119
|
+
const { data } = await invokePromise(SpaceOperation.OpenObjectForm, {
|
|
119
120
|
target: collection,
|
|
120
121
|
navigable: false,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
});
|
|
123
|
+
const object = data?.target;
|
|
124
|
+
if (!object) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// The created object is appended; move it to immediately after the originating section.
|
|
129
|
+
const from = findIndex(Obj.getURI(object));
|
|
130
|
+
const anchor = findIndex(id);
|
|
131
|
+
if (from >= 0 && anchor >= 0) {
|
|
132
|
+
Obj.update(collection, (collection) => {
|
|
133
|
+
const [ref] = collection.objects.splice(from, 1);
|
|
134
|
+
collection.objects.splice(anchor < from ? anchor + 1 : anchor, 0, ref);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
},
|
|
133
138
|
[collection, invokePromise, findIndex],
|
|
134
139
|
);
|
|
135
140
|
|
|
@@ -163,7 +168,7 @@ export const StackArticle = ({ attendableId, subject: collection }: StackArticle
|
|
|
163
168
|
|
|
164
169
|
const handleAddSection = useCallback(
|
|
165
170
|
() =>
|
|
166
|
-
invokePromise(SpaceOperation.
|
|
171
|
+
invokePromise(SpaceOperation.OpenObjectForm, {
|
|
167
172
|
target: collection,
|
|
168
173
|
navigable: false,
|
|
169
174
|
}),
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Plugin from '@dxos/app-framework/Plugin';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { PluginAsset, ReactSurface, Schema, Translations } from '#capabilities';
|
|
8
|
+
import { meta } from '#meta';
|
|
8
9
|
|
|
9
|
-
export const StackPlugin = Plugin.
|
|
10
|
+
export const StackPlugin = Plugin.define(meta).pipe(
|
|
11
|
+
Plugin.addModule(PluginAsset),
|
|
12
|
+
Plugin.addModule(ReactSurface),
|
|
13
|
+
Plugin.addModule(Schema),
|
|
14
|
+
Plugin.addModule(Translations),
|
|
15
|
+
Plugin.make,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default StackPlugin;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as ActivationEvent from '@dxos/app-framework/ActivationEvent';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The feature's start event: the plugin's start-gated modules (and cross-plugin
|
|
13
|
+
* contributions consumed by this feature) activate here. Fired on demand and by the
|
|
14
|
+
* host's idle trickle.
|
|
15
|
+
*/
|
|
16
|
+
export const Start = ActivationEvent.pluginStart(meta.profile.key);
|
package/src/types/index.ts
CHANGED
package/dist/lib/chunk-meta.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@dxos/app-framework";
|
|
2
|
-
import { DXN } from "@dxos/keys";
|
|
3
|
-
import { Config2 } from "@dxos/app-framework/config";
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
//#region dx.config.ts
|
|
6
|
-
var dx_config_default = Config2.make({ plugin: {
|
|
7
|
-
key: "org.dxos.plugin.stack",
|
|
8
|
-
name: "Stacks",
|
|
9
|
-
author: "DXOS",
|
|
10
|
-
description: trim`
|
|
11
|
-
The Stack plugin renders any Collection as a vertically scrollable stack of collapsible sections in the
|
|
12
|
-
Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering
|
|
13
|
-
to the section surface role, enabling any other plugin to contribute its own section renderer.
|
|
14
|
-
|
|
15
|
-
Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated
|
|
16
|
-
to directly, or removed from the collection. New sections can be inserted before or after any existing
|
|
17
|
-
section via a per-section dropdown menu, or appended via the toolbar Add button.
|
|
18
|
-
|
|
19
|
-
The plugin registers StackViewType with the ECHO schema module so that per-section view metadata
|
|
20
|
-
(height overrides, custom display data) can be stored and replicated alongside the collection.
|
|
21
|
-
|
|
22
|
-
A settings panel exposes a separation toggle that controls whether visual dividers are rendered between
|
|
23
|
-
sections.
|
|
24
|
-
`,
|
|
25
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack",
|
|
26
|
-
icon: { key: "ph--stack-simple--regular" },
|
|
27
|
-
spec: "PLUGIN.mdl",
|
|
28
|
-
tags: ["alpha"]
|
|
29
|
-
} });
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/meta.ts
|
|
32
|
-
var SECTION_IDENTIFIER = DXN.make("org.dxos.type.stackSection");
|
|
33
|
-
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
34
|
-
//#endregion
|
|
35
|
-
export { meta as n, SECTION_IDENTIFIER as t };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=chunk-meta.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.stack',\n name: 'Stacks',\n author: 'DXOS',\n description: trim`\n The Stack plugin renders any Collection as a vertically scrollable stack of collapsible sections in the\n Composer article surface. Each section wraps an arbitrary ECHO object and delegates its content rendering\n to the section surface role, enabling any other plugin to contribute its own section renderer.\n\n Sections can be individually collapsed to show only their title, expanded to reveal full content, navigated\n to directly, or removed from the collection. New sections can be inserted before or after any existing\n section via a per-section dropdown menu, or appended via the toolbar Add button.\n\n The plugin registers StackViewType with the ECHO schema module so that per-section view metadata\n (height overrides, custom display data) can be stored and replicated alongside the collection.\n\n A settings panel exposes a separation toggle that controls whether visual dividers are rendered between\n sections.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-stack',\n icon: { key: 'ph--stack-simple--regular' },\n spec: 'PLUGIN.mdl',\n tags: ['alpha'],\n },\n});\n","//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { DXN } from '@dxos/keys';\n\nimport config from '../dx.config';\n\nexport const SECTION_IDENTIFIER = DXN.make('org.dxos.type.stackSection');\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;CAejB,QAAQ;CACR,MAAM,EAAE,KAAK,4BAA4B;CACzC,MAAM;CACN,MAAM,CAAC,OAAO;AAChB,EACF,CAAC;;;ACvBD,IAAa,qBAAqB,IAAI,KAAK,4BAA4B;AAEvE,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
|
package/dist/lib/chunk-types.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { DXN, Type } from "@dxos/echo";
|
|
3
|
-
//#region \0rolldown/runtime.js
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __exportAll = (all, no_symbols) => {
|
|
6
|
-
let target = {};
|
|
7
|
-
for (var name in all) __defProp(target, name, {
|
|
8
|
-
get: all[name],
|
|
9
|
-
enumerable: true
|
|
10
|
-
});
|
|
11
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
12
|
-
return target;
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/types/Stack.ts
|
|
16
|
-
var Stack_exports = /* @__PURE__ */ __exportAll({ Stack: () => Stack });
|
|
17
|
-
var Stack = class extends Type.makeObject(DXN.make("org.dxos.type.stack", "0.1.0"))(Schema.Struct({})) {};
|
|
18
|
-
//#endregion
|
|
19
|
-
export { Stack_exports as t };
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=chunk-types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-types.mjs","names":[],"sources":["../../src/types/Stack.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { DXN, Type } from '@dxos/echo';\n\n// TODO(burdon): Placeholder.\nexport class Stack extends Type.makeObject<Stack>(DXN.make('org.dxos.type.stack', '0.1.0'))(Schema.Struct({})) {}\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,IAAa,QAAb,cAA2B,KAAK,WAAkB,IAAI,KAAK,uBAAuB,OAAO,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|