@dxos/plugin-stack 0.8.4-main.7ace549 → 0.8.4-main.937b3ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/StackContainer-FUGH3ZJH.mjs +274 -0
- package/dist/lib/browser/StackContainer-FUGH3ZJH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UIKFKRFJ.mjs → chunk-4X7CK6FM.mjs} +1 -1
- package/dist/lib/browser/chunk-4X7CK6FM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NHMDZYOB.mjs → chunk-MZUNZ6A3.mjs} +7 -8
- package/dist/lib/browser/chunk-MZUNZ6A3.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +34 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-HVPK7YZQ.mjs → react-surface-ZEFLABZS.mjs} +12 -11
- package/dist/lib/browser/react-surface-ZEFLABZS.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/StackContainer-PTZGEQFQ.mjs +275 -0
- package/dist/lib/node-esm/StackContainer-PTZGEQFQ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZZFA7HIV.mjs → chunk-BHDJHEFJ.mjs} +7 -8
- package/dist/lib/node-esm/chunk-BHDJHEFJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BGVQYUYP.mjs → chunk-HEEGXPSW.mjs} +1 -1
- package/dist/lib/node-esm/chunk-HEEGXPSW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +34 -50
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-HYSD7AC2.mjs → react-surface-JQOFHBYS.mjs} +12 -11
- package/dist/lib/node-esm/react-surface-JQOFHBYS.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/StackPlugin.d.ts +2 -1
- package/dist/types/src/StackPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/StackContainer.d.ts +3 -3
- package/dist/types/src/components/StackContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +7 -5
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -1
- package/dist/types/src/types/stack.d.ts +12 -13
- package/dist/types/src/types/stack.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -35
- package/src/StackPlugin.ts +22 -38
- package/src/capabilities/index.ts +1 -3
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +33 -0
- package/src/components/StackContainer.tsx +37 -43
- package/src/components/StackSection.tsx +1 -1
- package/src/meta.ts +2 -2
- package/src/types/stack.ts +10 -6
- package/src/types/types.ts +1 -1
- package/dist/lib/browser/StackContainer-DD3ZD5OE.mjs +0 -299
- package/dist/lib/browser/StackContainer-DD3ZD5OE.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHMDZYOB.mjs.map +0 -7
- package/dist/lib/browser/chunk-UIKFKRFJ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HVPK7YZQ.mjs.map +0 -7
- package/dist/lib/node-esm/StackContainer-JGWPXSUF.mjs +0 -300
- package/dist/lib/node-esm/StackContainer-JGWPXSUF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-BGVQYUYP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZZFA7HIV.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-HYSD7AC2.mjs.map +0 -7
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/src/capabilities/react-surface.tsx +0 -29
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-stack",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.937b3ca",
|
|
4
4
|
"description": "DXOS Surface plugin for Stack entities",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
@@ -35,49 +39,47 @@
|
|
|
35
39
|
"src"
|
|
36
40
|
],
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@fluentui/react-tabster": "
|
|
39
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
40
|
-
"@preact/signals-core": "^1.12.1",
|
|
42
|
+
"@fluentui/react-tabster": "9.26.11",
|
|
41
43
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
42
|
-
"effect": "3.
|
|
44
|
+
"effect": "3.19.11",
|
|
43
45
|
"node-fetch": "^2.6.0",
|
|
44
46
|
"react-is": "~19.2.0",
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
52
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
53
|
-
"@dxos/plugin-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/react-
|
|
56
|
-
"@dxos/react-ui-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/react-ui-
|
|
59
|
-
"@dxos/react-ui-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/util": "0.8.4-main.
|
|
47
|
+
"@dxos/client": "0.8.4-main.937b3ca",
|
|
48
|
+
"@dxos/app-framework": "0.8.4-main.937b3ca",
|
|
49
|
+
"@dxos/echo": "0.8.4-main.937b3ca",
|
|
50
|
+
"@dxos/async": "0.8.4-main.937b3ca",
|
|
51
|
+
"@dxos/operation": "0.8.4-main.937b3ca",
|
|
52
|
+
"@dxos/invariant": "0.8.4-main.937b3ca",
|
|
53
|
+
"@dxos/plugin-client": "0.8.4-main.937b3ca",
|
|
54
|
+
"@dxos/plugin-graph": "0.8.4-main.937b3ca",
|
|
55
|
+
"@dxos/plugin-space": "0.8.4-main.937b3ca",
|
|
56
|
+
"@dxos/react-client": "0.8.4-main.937b3ca",
|
|
57
|
+
"@dxos/react-ui-attention": "0.8.4-main.937b3ca",
|
|
58
|
+
"@dxos/react-ui-form": "0.8.4-main.937b3ca",
|
|
59
|
+
"@dxos/plugin-deck": "0.8.4-main.937b3ca",
|
|
60
|
+
"@dxos/react-ui-stack": "0.8.4-main.937b3ca",
|
|
61
|
+
"@dxos/react-ui-searchlist": "0.8.4-main.937b3ca",
|
|
62
|
+
"@dxos/schema": "0.8.4-main.937b3ca",
|
|
63
|
+
"@dxos/types": "0.8.4-main.937b3ca",
|
|
64
|
+
"@dxos/util": "0.8.4-main.937b3ca"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
67
|
"@babel/core": "^7.18.13",
|
|
66
|
-
"@types/react": "~19.2.
|
|
67
|
-
"@types/react-dom": "~19.2.
|
|
68
|
-
"react": "~19.2.
|
|
69
|
-
"react-dom": "~19.2.
|
|
68
|
+
"@types/react": "~19.2.7",
|
|
69
|
+
"@types/react-dom": "~19.2.3",
|
|
70
|
+
"react": "~19.2.3",
|
|
71
|
+
"react-dom": "~19.2.3",
|
|
70
72
|
"vite": "7.1.9",
|
|
71
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.937b3ca",
|
|
74
|
+
"@dxos/ui-theme": "0.8.4-main.937b3ca",
|
|
75
|
+
"@dxos/storybook-utils": "0.8.4-main.937b3ca"
|
|
74
76
|
},
|
|
75
77
|
"peerDependencies": {
|
|
76
|
-
"effect": "
|
|
77
|
-
"react": "
|
|
78
|
-
"react-dom": "
|
|
79
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
80
|
-
"@dxos/
|
|
78
|
+
"effect": "3.19.11",
|
|
79
|
+
"react": "~19.2.3",
|
|
80
|
+
"react-dom": "~19.2.3",
|
|
81
|
+
"@dxos/react-ui": "0.8.4-main.937b3ca",
|
|
82
|
+
"@dxos/ui-theme": "0.8.4-main.937b3ca"
|
|
81
83
|
},
|
|
82
84
|
"publishConfig": {
|
|
83
85
|
"access": "public"
|
package/src/StackPlugin.ts
CHANGED
|
@@ -2,50 +2,34 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Common, Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { type Obj } from '@dxos/echo';
|
|
7
|
-
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
7
|
|
|
9
8
|
import { ReactSurface } from './capabilities';
|
|
10
9
|
import { SECTION_IDENTIFIER, meta } from './meta';
|
|
11
10
|
import { translations } from './translations';
|
|
12
11
|
import { StackViewType } from './types';
|
|
13
12
|
|
|
14
|
-
export const StackPlugin =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
case 'node':
|
|
30
|
-
return { id: section.object.id, label: (section.object as any).title, data: section.object };
|
|
31
|
-
case 'object':
|
|
32
|
-
return section.object;
|
|
33
|
-
case 'view-object':
|
|
34
|
-
return section;
|
|
35
|
-
}
|
|
36
|
-
},
|
|
13
|
+
export const StackPlugin = Plugin.define(meta).pipe(
|
|
14
|
+
Common.Plugin.addTranslationsModule({ translations }),
|
|
15
|
+
Common.Plugin.addMetadataModule({
|
|
16
|
+
metadata: {
|
|
17
|
+
id: SECTION_IDENTIFIER,
|
|
18
|
+
metadata: {
|
|
19
|
+
parse: (section: { object: Obj.Unknown }, type: string) => {
|
|
20
|
+
switch (type) {
|
|
21
|
+
case 'node':
|
|
22
|
+
return { id: section.object.id, label: (section.object as any).title, data: section.object };
|
|
23
|
+
case 'object':
|
|
24
|
+
return section.object;
|
|
25
|
+
case 'view-object':
|
|
26
|
+
return section;
|
|
27
|
+
}
|
|
37
28
|
},
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
defineModule({
|
|
42
|
-
id: `${meta.id}/module/schema`,
|
|
43
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
44
|
-
activate: () => contributes(ClientCapabilities.Schema, [StackViewType]),
|
|
45
|
-
}),
|
|
46
|
-
defineModule({
|
|
47
|
-
id: `${meta.id}/module/react-surface`,
|
|
48
|
-
activatesOn: Events.SetupReactSurface,
|
|
49
|
-
activate: ReactSurface,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
50
31
|
}),
|
|
51
|
-
])
|
|
32
|
+
Common.Plugin.addSchemaModule({ schema: [StackViewType] }),
|
|
33
|
+
Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
|
|
34
|
+
Plugin.make,
|
|
35
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
10
|
+
import { Collection } from '@dxos/schema';
|
|
11
|
+
|
|
12
|
+
import { StackContainer } from '../../components';
|
|
13
|
+
import { meta } from '../../meta';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(() =>
|
|
16
|
+
Effect.succeed(
|
|
17
|
+
Capability.contributes(
|
|
18
|
+
Common.Capability.ReactSurface,
|
|
19
|
+
Common.createSurface({
|
|
20
|
+
id: `${meta.id}/article`,
|
|
21
|
+
role: 'article',
|
|
22
|
+
filter: (data): data is { id?: string; subject: Collection.Collection } =>
|
|
23
|
+
Obj.instanceOf(Collection.Collection, data.subject),
|
|
24
|
+
component: ({ role, data }) => {
|
|
25
|
+
// This allows the id to be overridden by the surface for situations where the id of the collection
|
|
26
|
+
// is not the same as the id of what is being represented (e.g., a space with a root collection).
|
|
27
|
+
const id = typeof data.id === 'string' ? data.id : undefined;
|
|
28
|
+
return <StackContainer id={id ?? Obj.getDXN(data.subject).toString()} role={role} subject={data.subject} />;
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
import React, { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { useAppGraph, useCapabilities,
|
|
10
|
-
import {
|
|
8
|
+
import { Common } from '@dxos/app-framework';
|
|
9
|
+
import { useAppGraph, useCapabilities, useOperationInvoker } from '@dxos/app-framework/react';
|
|
10
|
+
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
11
11
|
import { Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
12
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
13
|
+
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
13
14
|
import { Toolbar, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
14
15
|
import { AttentionProvider } from '@dxos/react-ui-attention';
|
|
15
16
|
import { Stack, StackItem } from '@dxos/react-ui-stack';
|
|
@@ -28,16 +29,15 @@ import {
|
|
|
28
29
|
import { StackContext } from './StackContext';
|
|
29
30
|
import { StackSection } from './StackSection';
|
|
30
31
|
|
|
31
|
-
type StackContainerProps = {
|
|
32
|
+
type StackContainerProps = SurfaceComponentProps<Collection.Collection> & {
|
|
32
33
|
id: string;
|
|
33
|
-
collection: Collection.Collection;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const StackContainer = ({ id, collection }: StackContainerProps) => {
|
|
37
|
-
const {
|
|
36
|
+
const StackContainer = ({ id, subject: collection }: StackContainerProps) => {
|
|
37
|
+
const { invokePromise } = useOperationInvoker();
|
|
38
38
|
const { graph } = useAppGraph();
|
|
39
39
|
const { t } = useTranslation(meta.id);
|
|
40
|
-
const allMetadata = useCapabilities(
|
|
40
|
+
const allMetadata = useCapabilities(Common.Capability.Metadata);
|
|
41
41
|
const [collapsedSections, setCollapsedSections] = useState<CollapsedSections>({});
|
|
42
42
|
|
|
43
43
|
// TODO(wittjosiah): Re-implement stack views with relations.
|
|
@@ -64,7 +64,10 @@ const StackContainer = ({ id, collection }: StackContainerProps) => {
|
|
|
64
64
|
title:
|
|
65
65
|
(object as any)?.title ??
|
|
66
66
|
// TODO(wittjosiah): `getNode` is not reactive.
|
|
67
|
-
toLocalizedString(
|
|
67
|
+
toLocalizedString(
|
|
68
|
+
Graph.getNode(graph, Obj.getDXN(object).toString()).pipe(Option.getOrNull)?.properties.label,
|
|
69
|
+
t,
|
|
70
|
+
),
|
|
68
71
|
} as StackSectionView;
|
|
69
72
|
return { id: Obj.getDXN(object).toString(), object, metadata, view } satisfies StackSectionItem;
|
|
70
73
|
}) ?? [];
|
|
@@ -76,47 +79,40 @@ const StackContainer = ({ id, collection }: StackContainerProps) => {
|
|
|
76
79
|
.filter(isNonNullable)
|
|
77
80
|
.findIndex((section) => Obj.getDXN(section).toString() === id);
|
|
78
81
|
const object = collection.objects[index].target;
|
|
79
|
-
if (
|
|
80
|
-
await
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
);
|
|
82
|
+
if (Obj.isObject(object)) {
|
|
83
|
+
await invokePromise(SpaceOperation.RemoveObjects, {
|
|
84
|
+
objects: [object],
|
|
85
|
+
target: collection,
|
|
86
|
+
});
|
|
86
87
|
|
|
87
88
|
// TODO(wittjosiah): The section should also be removed, but needs to be restored if the action is undone.
|
|
88
89
|
// delete stack.sections[Path.last(path)];
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
|
-
[collection,
|
|
92
|
+
[collection, invokePromise],
|
|
92
93
|
);
|
|
93
94
|
|
|
94
95
|
const handleAdd = useCallback(
|
|
95
96
|
async (id: string, position: AddSectionPosition) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
collection,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
}),
|
|
110
|
-
);
|
|
97
|
+
// TODO(wittjosiah): Use object creation dialog.
|
|
98
|
+
await invokePromise(Common.LayoutOperation.UpdateDialog, {
|
|
99
|
+
subject: `${meta.id}/AddSectionDialog`,
|
|
100
|
+
blockAlign: 'start',
|
|
101
|
+
props: {
|
|
102
|
+
path: id,
|
|
103
|
+
position,
|
|
104
|
+
collection,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
111
107
|
},
|
|
112
|
-
[collection,
|
|
108
|
+
[collection, invokePromise],
|
|
113
109
|
);
|
|
114
110
|
|
|
115
111
|
const handleNavigate = useCallback(
|
|
116
112
|
async (id: string) => {
|
|
117
|
-
await
|
|
113
|
+
await invokePromise(Common.LayoutOperation.Open, { subject: [id] });
|
|
118
114
|
},
|
|
119
|
-
[
|
|
115
|
+
[invokePromise],
|
|
120
116
|
);
|
|
121
117
|
|
|
122
118
|
const handleCollapse = useCallback(
|
|
@@ -126,13 +122,11 @@ const StackContainer = ({ id, collection }: StackContainerProps) => {
|
|
|
126
122
|
|
|
127
123
|
const handleAddSection = useCallback(
|
|
128
124
|
() =>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
),
|
|
135
|
-
[collection, dispatch],
|
|
125
|
+
invokePromise(SpaceOperation.OpenCreateObject, {
|
|
126
|
+
target: collection,
|
|
127
|
+
navigable: false,
|
|
128
|
+
}),
|
|
129
|
+
[collection, invokePromise],
|
|
136
130
|
);
|
|
137
131
|
|
|
138
132
|
return (
|
|
@@ -9,7 +9,7 @@ import { Surface } from '@dxos/app-framework/react';
|
|
|
9
9
|
import { DropdownMenu, Icon, IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
11
11
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
12
|
-
import { getSize, mx, textBlockWidth } from '@dxos/
|
|
12
|
+
import { getSize, mx, textBlockWidth } from '@dxos/ui-theme';
|
|
13
13
|
|
|
14
14
|
import { meta } from '../meta';
|
|
15
15
|
import { type StackSectionItem } from '../types';
|
package/src/meta.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const SECTION_IDENTIFIER = 'dxos.org/type/StackSection';
|
|
9
9
|
|
|
10
|
-
export const meta:
|
|
10
|
+
export const meta: Plugin.Meta = {
|
|
11
11
|
id: 'dxos.org/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.
|
package/src/types/stack.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { 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.
|
|
@@ -19,9 +19,13 @@ export const SectionSchema = Schema.Struct({
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// TODO(wittjosiah): This needs a relation to be connected to a stack.
|
|
22
|
-
export
|
|
23
|
-
typename: 'dxos.org/type/StackView',
|
|
24
|
-
version: '0.1.0',
|
|
25
|
-
})({
|
|
22
|
+
export const StackViewType = Schema.Struct({
|
|
26
23
|
sections: Schema.mutable(Schema.Record({ key: Schema.String, value: SectionSchema })),
|
|
27
|
-
})
|
|
24
|
+
}).pipe(
|
|
25
|
+
Type.object({
|
|
26
|
+
typename: 'dxos.org/type/StackView',
|
|
27
|
+
version: '0.1.0',
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export interface StackViewType extends Schema.Schema.Type<typeof StackViewType> {}
|