@dxos/plugin-board 0.8.4-main.c1de068 → 0.8.4-main.f5c0578
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/{react-surface-XFSXU2JJ.mjs → chunk-2AR36W5A.mjs} +9 -33
- package/dist/lib/browser/chunk-2AR36W5A.mjs.map +7 -0
- package/dist/lib/browser/chunk-V67SBM4U.mjs +59 -0
- package/dist/lib/browser/chunk-V67SBM4U.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-TDOZP647.mjs → intent-resolver-6NM32ZSV.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-TDOZP647.mjs.map → intent-resolver-6NM32ZSV.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-S7H45RGL.mjs +30 -0
- package/dist/lib/browser/react-surface-S7H45RGL.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node-esm/{react-surface-ZHPQBZWO.mjs → chunk-AWGKINO6.mjs} +9 -32
- package/dist/lib/node-esm/chunk-AWGKINO6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCGDC6OV.mjs +60 -0
- package/dist/lib/node-esm/chunk-XCGDC6OV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +14 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-IHQWKJNT.mjs → intent-resolver-5DQ5PPTT.mjs} +5 -5
- package/dist/lib/node-esm/{intent-resolver-IHQWKJNT.mjs.map → intent-resolver-5DQ5PPTT.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-UGBLNFXL.mjs +31 -0
- package/dist/lib/node-esm/react-surface-UGBLNFXL.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -3
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/BoardContainer.d.ts +1 -1
- package/dist/types/src/components/BoardContainer.d.ts.map +1 -1
- package/dist/types/src/components/BoardContainer.stories.d.ts +1 -1
- package/dist/types/src/components/BoardContainer.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/types/Board.d.ts +88 -0
- package/dist/types/src/types/Board.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -33
- package/src/BoardPlugin.tsx +1 -1
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/components/BoardContainer.stories.tsx +6 -5
- package/src/components/BoardContainer.tsx +4 -4
- package/src/index.ts +2 -0
- package/src/types/Board.ts +47 -0
- package/src/types/index.ts +1 -1
- package/dist/lib/browser/chunk-TDV6SJ64.mjs +0 -46
- package/dist/lib/browser/chunk-TDV6SJ64.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XFSXU2JJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K6CHLZYU.mjs +0 -48
- package/dist/lib/node-esm/chunk-K6CHLZYU.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-ZHPQBZWO.mjs.map +0 -7
- package/dist/types/src/types/schema.d.ts +0 -65
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/types/schema.ts +0 -45
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-board",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.f5c0578",
|
|
4
4
|
"description": "Surface plugin for card baords",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./types": {
|
|
19
|
+
"source": "./src/types/index.ts",
|
|
18
20
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -36,30 +38,30 @@
|
|
|
36
38
|
"@preact-signals/safe-react": "^0.9.0",
|
|
37
39
|
"@preact/signals-core": "^1.9.0",
|
|
38
40
|
"@preact/signals-react": "^3.2.0",
|
|
39
|
-
"effect": "3.17.
|
|
40
|
-
"@dxos/ai": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/async": "0.8.4-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/echo": "0.8.4-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/log": "0.8.4-main.
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/random": "0.8.4-main.
|
|
56
|
-
"@dxos/react-
|
|
57
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
58
|
-
"@dxos/react-ui-
|
|
59
|
-
"@dxos/react-ui-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
41
|
+
"effect": "3.17.7",
|
|
42
|
+
"@dxos/ai": "0.8.4-main.f5c0578",
|
|
43
|
+
"@dxos/app-framework": "0.8.4-main.f5c0578",
|
|
44
|
+
"@dxos/assistant": "0.8.4-main.f5c0578",
|
|
45
|
+
"@dxos/async": "0.8.4-main.f5c0578",
|
|
46
|
+
"@dxos/blueprints": "0.8.4-main.f5c0578",
|
|
47
|
+
"@dxos/client": "0.8.4-main.f5c0578",
|
|
48
|
+
"@dxos/echo": "0.8.4-main.f5c0578",
|
|
49
|
+
"@dxos/echo-schema": "0.8.4-main.f5c0578",
|
|
50
|
+
"@dxos/invariant": "0.8.4-main.f5c0578",
|
|
51
|
+
"@dxos/plugin-client": "0.8.4-main.f5c0578",
|
|
52
|
+
"@dxos/log": "0.8.4-main.f5c0578",
|
|
53
|
+
"@dxos/plugin-graph": "0.8.4-main.f5c0578",
|
|
54
|
+
"@dxos/plugin-search": "0.8.4-main.f5c0578",
|
|
55
|
+
"@dxos/effect": "0.8.4-main.f5c0578",
|
|
56
|
+
"@dxos/plugin-space": "0.8.4-main.f5c0578",
|
|
57
|
+
"@dxos/random": "0.8.4-main.f5c0578",
|
|
58
|
+
"@dxos/react-ui": "0.8.4-main.f5c0578",
|
|
59
|
+
"@dxos/react-ui-board": "0.8.4-main.f5c0578",
|
|
60
|
+
"@dxos/react-ui-form": "0.8.4-main.f5c0578",
|
|
61
|
+
"@dxos/react-ui-stack": "0.8.4-main.f5c0578",
|
|
62
|
+
"@dxos/util": "0.8.4-main.f5c0578",
|
|
63
|
+
"@dxos/react-client": "0.8.4-main.f5c0578",
|
|
64
|
+
"@dxos/schema": "0.8.4-main.f5c0578"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
67
|
"@types/react": "~18.2.0",
|
|
@@ -67,19 +69,19 @@
|
|
|
67
69
|
"react": "~18.2.0",
|
|
68
70
|
"react-dom": "~18.2.0",
|
|
69
71
|
"vite": "5.4.7",
|
|
70
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
71
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
72
|
+
"@dxos/plugin-preview": "0.8.4-main.f5c0578",
|
|
73
|
+
"@dxos/plugin-theme": "0.8.4-main.f5c0578",
|
|
74
|
+
"@dxos/react-ui-theme": "0.8.4-main.f5c0578",
|
|
75
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.f5c0578",
|
|
76
|
+
"@dxos/storybook-utils": "0.8.4-main.f5c0578",
|
|
77
|
+
"@dxos/test-utils": "0.8.4-main.f5c0578"
|
|
76
78
|
},
|
|
77
79
|
"peerDependencies": {
|
|
78
80
|
"effect": "^3.13.3",
|
|
79
81
|
"react": "~18.2.0",
|
|
80
82
|
"react-dom": "~18.2.0",
|
|
81
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
82
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
83
|
+
"@dxos/react-ui": "0.8.4-main.f5c0578",
|
|
84
|
+
"@dxos/react-ui-theme": "0.8.4-main.f5c0578"
|
|
83
85
|
},
|
|
84
86
|
"publishConfig": {
|
|
85
87
|
"access": "public"
|
package/src/BoardPlugin.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, createIntent, defineModule, definePlugin
|
|
5
|
+
import { Capabilities, Events, contributes, createIntent, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
6
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
7
7
|
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
8
|
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Capabilities, type PluginContext, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
import { BoardContainer } from '../components';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
@@ -17,16 +17,17 @@ import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
|
17
17
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
18
18
|
import { faker } from '@dxos/random';
|
|
19
19
|
import { type Client, useClient } from '@dxos/react-client';
|
|
20
|
-
import { Filter,
|
|
20
|
+
import { Filter, Ref, type Space, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
21
21
|
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
22
22
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
23
23
|
import { DataType } from '@dxos/schema';
|
|
24
24
|
import { withLayout } from '@dxos/storybook-utils';
|
|
25
25
|
|
|
26
|
-
import { BoardContainer } from './BoardContainer';
|
|
27
26
|
import { translations } from '../translations';
|
|
28
27
|
import { Board } from '../types';
|
|
29
28
|
|
|
29
|
+
import { BoardContainer } from './BoardContainer';
|
|
30
|
+
|
|
30
31
|
faker.seed(0);
|
|
31
32
|
|
|
32
33
|
//
|
|
@@ -100,7 +101,7 @@ const meta: Meta<StoryProps> = {
|
|
|
100
101
|
ThemePlugin({ tx: defaultTx }),
|
|
101
102
|
ClientPlugin({
|
|
102
103
|
types: [DataType.Organization, DataType.Person, Board.Board],
|
|
103
|
-
onClientInitialized: async (
|
|
104
|
+
onClientInitialized: async ({ client }) => {
|
|
104
105
|
await client.halo.createIdentity();
|
|
105
106
|
const space = await client.spaces.create();
|
|
106
107
|
await space.waitUntilReady();
|
|
@@ -111,7 +112,7 @@ const meta: Meta<StoryProps> = {
|
|
|
111
112
|
space.db.add(board);
|
|
112
113
|
|
|
113
114
|
// Add some sample items
|
|
114
|
-
Array.from({ length: 10 }).map((
|
|
115
|
+
Array.from({ length: 10 }).map(() => {
|
|
115
116
|
const org = Obj.make(DataType.Organization, rollOrg());
|
|
116
117
|
space.db.add(org);
|
|
117
118
|
board.items.push(Ref.make(org));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { effect } from '@preact/signals-react';
|
|
6
6
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Surface, createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
9
9
|
import { getSpace } from '@dxos/client/echo';
|
|
10
10
|
import { type Obj, Ref, type Type } from '@dxos/echo';
|
|
11
11
|
import { invariant } from '@dxos/invariant';
|
|
@@ -18,7 +18,7 @@ import { isNonNullable } from '@dxos/util';
|
|
|
18
18
|
import { type Board as BoardType } from '../types';
|
|
19
19
|
|
|
20
20
|
export type BoardContainerProps = {
|
|
21
|
-
role
|
|
21
|
+
role?: string;
|
|
22
22
|
board: BoardType.Board;
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -84,8 +84,8 @@ export const BoardContainer = ({ role, board }: BoardContainerProps) => {
|
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
86
|
<Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>
|
|
87
|
-
<StackItem.Content toolbar>
|
|
88
|
-
<Board.
|
|
87
|
+
<StackItem.Content toolbar classNames='overflow-hidden'>
|
|
88
|
+
<Board.Toolbar />
|
|
89
89
|
<Board.Container>
|
|
90
90
|
<Board.Viewport classNames='border-none'>
|
|
91
91
|
<Board.Backdrop />
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Obj, Type } from '@dxos/echo';
|
|
8
|
+
import { LabelAnnotation } from '@dxos/echo-schema';
|
|
9
|
+
import { BoardLayout, defaultLayout } from '@dxos/react-ui-board';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../meta';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Board and layout.
|
|
15
|
+
*/
|
|
16
|
+
export const Board = Schema.Struct({
|
|
17
|
+
name: Schema.optional(Schema.String),
|
|
18
|
+
items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),
|
|
19
|
+
layout: Schema.mutable(BoardLayout),
|
|
20
|
+
}).pipe(
|
|
21
|
+
Type.Obj({
|
|
22
|
+
typename: 'dxos.org/type/Board',
|
|
23
|
+
version: '0.1.0',
|
|
24
|
+
}),
|
|
25
|
+
LabelAnnotation.set(['name']),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export interface Board extends Schema.Schema.Type<typeof Board> {}
|
|
29
|
+
|
|
30
|
+
export const makeBoard = (props: Partial<Obj.MakeProps<typeof Board>> = {}) =>
|
|
31
|
+
Obj.make(Board, {
|
|
32
|
+
items: [],
|
|
33
|
+
layout: defaultLayout,
|
|
34
|
+
...props,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create board.
|
|
39
|
+
*/
|
|
40
|
+
export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {
|
|
41
|
+
input: Schema.Struct({
|
|
42
|
+
name: Schema.optional(Schema.String),
|
|
43
|
+
}),
|
|
44
|
+
output: Schema.Struct({
|
|
45
|
+
object: Board,
|
|
46
|
+
}),
|
|
47
|
+
}) {}
|
package/src/types/index.ts
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// src/types/schema.ts
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { Type } from "@dxos/echo";
|
|
4
|
-
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
5
|
-
import { BoardLayout } from "@dxos/react-ui-board";
|
|
6
|
-
|
|
7
|
-
// src/meta.ts
|
|
8
|
-
var meta = {
|
|
9
|
-
id: "dxos.org/plugin/board",
|
|
10
|
-
name: "Board",
|
|
11
|
-
description: "A spatial, infinite canvas app combining notes, media, and whiteboarding in a tactile, visual interface.",
|
|
12
|
-
icon: "ph--squares-four--regular",
|
|
13
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board",
|
|
14
|
-
screenshots: []
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// src/types/schema.ts
|
|
18
|
-
(function(Board2) {
|
|
19
|
-
Board2.Board = Schema.Struct({
|
|
20
|
-
name: Schema.optional(Schema.String),
|
|
21
|
-
items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),
|
|
22
|
-
layout: Schema.mutable(BoardLayout)
|
|
23
|
-
}).pipe(Type.Obj({
|
|
24
|
-
typename: "dxos.org/type/Board",
|
|
25
|
-
version: "0.1.0"
|
|
26
|
-
}), LabelAnnotation.set([
|
|
27
|
-
"name"
|
|
28
|
-
]));
|
|
29
|
-
class Create extends Schema.TaggedClass()(`${meta.id}/action/create`, {
|
|
30
|
-
input: Schema.Struct({
|
|
31
|
-
name: Schema.optional(Schema.String)
|
|
32
|
-
}),
|
|
33
|
-
output: Schema.Struct({
|
|
34
|
-
object: Board2.Board
|
|
35
|
-
})
|
|
36
|
-
}) {
|
|
37
|
-
}
|
|
38
|
-
Board2.Create = Create;
|
|
39
|
-
})(Board || (Board = {}));
|
|
40
|
-
var Board;
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
meta,
|
|
44
|
-
Board
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=chunk-TDV6SJ64.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { BoardLayout } from '@dxos/react-ui-board';\n\nimport { meta } from '../meta';\n\nexport namespace Board {\n //\n // Types\n //\n\n // TODO(burdon): View?\n export const Board = Schema.Struct({\n name: Schema.optional(Schema.String),\n items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),\n layout: Schema.mutable(BoardLayout),\n }).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n );\n\n export interface Board extends Schema.Schema.Type<typeof Board> {}\n\n //\n // Actions\n //\n\n export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Board,\n }),\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/board',\n name: 'Board',\n description:\n 'A spatial, infinite canvas app combining notes, media, and whiteboarding in a tactile, visual interface.',\n icon: 'ph--squares-four--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',\n screenshots: [],\n};\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AAEvB,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;;;ACFrB,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa,CAAA;AACf;;;UDFiBC,QAAAA;SAMFA,QAAQC,OAAOC,OAAO;IACjCC,MAAMF,OAAOG,SAASH,OAAOI,MAAM;IACnCC,OAAOL,OAAOM,QAAQN,OAAOO,MAAMC,KAAKC,IAAID,KAAKE,OAAO,CAAA,CAAA;IACxDC,QAAQX,OAAOM,QAAQM,WAAAA;EACzB,CAAA,EAAGC,KACDL,KAAKM,IAAI;IACPC,UAAU;IACVC,SAAS;EACX,CAAA,GACAC,gBAAgBC,IAAI;IAAC;GAAO,CAAA;EASvB,MAAMC,eAAenB,OAAOoB,YAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAOvB,OAAOC,OAAO;MACnBC,MAAMF,OAAOG,SAASH,OAAOI,MAAM;IACrC,CAAA;IACAoB,QAAQxB,OAAOC,OAAO;MACpBwB,QAAM1B,OAAEA;IACV,CAAA;EACF,CAAA,EAAA;EAAI;SAPSoB,SAAAA;AAQf,GAhCiBpB,UAAAA,QAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "Type", "LabelAnnotation", "BoardLayout", "meta", "id", "name", "description", "icon", "source", "screenshots", "Board", "Schema", "Struct", "name", "optional", "String", "items", "mutable", "Array", "Type", "Ref", "Expando", "layout", "BoardLayout", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "Create", "TaggedClass", "meta", "id", "input", "output", "object"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/BoardContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { contributes, Capabilities, type PluginContext, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { BoardContainer } from '../components';\nimport { meta } from '../meta';\nimport { Board } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: meta.id,\n role: ['article', 'section'],\n filter: (data): data is { subject: Board.Board } => Obj.instanceOf(Board.Board, data.subject),\n component: ({ data, role }) => <BoardContainer board={data.subject} role={role} />,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-react';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { createIntent, Surface, useIntentDispatcher } from '@dxos/app-framework';\nimport { getSpace } from '@dxos/client/echo';\nimport { type Obj, Ref, type Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Board, type BoardController, type BoardRootProps } from '@dxos/react-ui-board';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\n// TODO(thure): There is debate about having to rename either the type or the React component. A best practice should be chosen and either Board or Kanban (or both) should be refactored to apply it.\nimport { type Board as BoardType } from '../types';\n\nexport type BoardContainerProps = {\n role: string;\n board: BoardType.Board;\n};\n\nexport const BoardContainer = ({ role, board }: BoardContainerProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const controller = useRef<BoardController>(null);\n\n // TODO(burdon): Create effect utility for reactive arrays.\n const [items, setItems] = useState<Type.Expando[]>([]);\n useEffect(() => {\n let t: NodeJS.Timeout;\n effect(() => {\n const refs = [...board.items];\n t = setTimeout(async () => {\n const items = await Ref.Array.loadAll(refs);\n setItems(items.filter(isNonNullable));\n });\n });\n\n return () => clearTimeout(t);\n }, [board.items]);\n\n const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(\n async (position = { x: 0, y: 0 }) => {\n const space = getSpace(board);\n invariant(space);\n await dispatch(\n createIntent(SpaceAction.OpenCreateObject, {\n target: space,\n navigable: false,\n onCreateObject: (object: Obj.Any) => {\n board.items.push(Ref.make(object));\n board.layout.cells[object.id] = { ...position, width: 1, height: 1 };\n controller.current?.center(position);\n },\n }),\n );\n },\n [board, controller, dispatch],\n );\n\n // TODO(burdon): Use intents so can be undone.\n const handleDelete = useCallback<NonNullable<BoardRootProps['onDelete']>>(\n (id) => {\n // TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.\n const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);\n if (idx !== -1) {\n board.items.splice(idx, 1);\n }\n delete board.layout.cells[id];\n setItems((items) => items.filter((item) => item.id !== id));\n },\n [board],\n );\n\n const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(\n (id, position) => {\n const layout = board.layout.cells[id];\n board.layout.cells[id] = { ...layout, ...position };\n },\n [board],\n );\n\n return (\n <Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>\n <StackItem.Content toolbar>\n <Board.Controls />\n <Board.Container>\n <Board.Viewport classNames='border-none'>\n <Board.Backdrop />\n <Board.Content>\n {items?.map((item, index) => (\n <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>\n <Surface role='card--extrinsic' data={{ subject: item }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </StackItem.Content>\n </Board.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,aAAaC,cAAkCC,qBAAqB;AAC7E,SAASC,WAAW;;;;ACHpB,SAASC,cAAc;AACvB,OAAOC,SAASC,aAAaC,WAAWC,QAAQC,gBAAgB;AAEhE,SAASC,cAAcC,SAASC,2BAA2B;AAC3D,SAASC,gBAAgB;AACzB,SAAmBC,WAAsB;AACzC,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,SAAAA,cAAwD;AACjE,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;;AAUvB,IAAMC,iBAAiB,CAAC,EAAEC,MAAMC,MAAK,MAAuB;;;AACjE,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKZ,oBAAAA;AACtC,UAAMa,aAAajB,OAAwB,IAAA;AAG3C,UAAM,CAACkB,OAAOC,QAAAA,IAAYlB,SAAyB,CAAA,CAAE;AACrDF,cAAU,MAAA;AACR,UAAIqB;AACJxB,aAAO,MAAA;AACL,cAAMyB,OAAO;aAAIP,MAAMI;;AACvBE,YAAIE,WAAW,YAAA;AACb,gBAAMJ,SAAQ,MAAMZ,IAAIiB,MAAMC,QAAQH,IAA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AGT,WACE,sBAAA,cAACL,OAAM+C,MAAI;MAACP,KAAKhC;MAAYsB,QAAQzB,MAAMyB;MAAQkB,OAAO9B;MAAW+B,UAAUZ;MAAca,QAAQJ;OACnG,sBAAA,cAAC7C,UAAUkD,SAAO;MAACC,SAAAA;OACjB,sBAAA,cAACpD,OAAMqD,UAAQ,IAAA,GACf,sBAAA,cAACrD,OAAMsD,WAAS,MACd,sBAAA,cAACtD,OAAMuD,UAAQ;MAACC,YAAW;OACzB,sBAAA,cAACxD,OAAMyD,UAAQ,IAAA,GACf,sBAAA,cAACzD,OAAMmD,SAAO,MACX1C,OAAOiD,IAAI,CAACb,MAAMc,UACjB,sBAAA,cAAC3D,OAAM4D,MAAI;MAACf;MAAYgB,KAAKF;MAAO7B,QAAQzB,MAAMyB,QAAQC,MAAMc,KAAKb,EAAE,KAAK;QAAEZ,GAAG;QAAGC,GAAG;MAAE;OACvF,sBAAA,cAAC3B,SAAAA;MAAQU,MAAK;MAAkB0D,MAAM;QAAEC,SAASlB;MAAK;MAAGmB,OAAO;;;;;AASlF;;;AD1FA,IAAA,wBAAe,CAACC,YACdC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAA2CC,IAAIC,WAAWC,MAAMA,OAAOH,KAAKI,OAAO;IAC5FC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,gBAAAQ,OAAA,cAACC,gBAAAA;MAAeC,OAAOR,KAAKI;MAASN;;EACtE,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "contributes", "Capabilities", "createSurface", "Obj", "effect", "React", "useCallback", "useEffect", "useRef", "useState", "createIntent", "Surface", "useIntentDispatcher", "getSpace", "Ref", "invariant", "SpaceAction", "Board", "StackItem", "isNonNullable", "BoardContainer", "role", "board", "dispatchPromise", "dispatch", "controller", "items", "setItems", "t", "refs", "setTimeout", "Array", "loadAll", "filter", "clearTimeout", "handleAdd", "position", "x", "y", "space", "OpenCreateObject", "target", "navigable", "onCreateObject", "object", "push", "make", "layout", "cells", "id", "width", "height", "current", "center", "handleDelete", "idx", "findIndex", "ref", "dxn", "asEchoDXN", "echoId", "splice", "item", "handleMove", "Root", "onAdd", "onDelete", "onMove", "Content", "toolbar", "Controls", "Container", "Viewport", "classNames", "Backdrop", "map", "index", "Cell", "key", "data", "subject", "limit", "context", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Board", "subject", "component", "React", "BoardContainer", "board"]
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/types/schema.ts
|
|
4
|
-
import { Schema } from "effect";
|
|
5
|
-
import { Type } from "@dxos/echo";
|
|
6
|
-
import { LabelAnnotation } from "@dxos/echo-schema";
|
|
7
|
-
import { BoardLayout } from "@dxos/react-ui-board";
|
|
8
|
-
|
|
9
|
-
// src/meta.ts
|
|
10
|
-
var meta = {
|
|
11
|
-
id: "dxos.org/plugin/board",
|
|
12
|
-
name: "Board",
|
|
13
|
-
description: "A spatial, infinite canvas app combining notes, media, and whiteboarding in a tactile, visual interface.",
|
|
14
|
-
icon: "ph--squares-four--regular",
|
|
15
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board",
|
|
16
|
-
screenshots: []
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// src/types/schema.ts
|
|
20
|
-
(function(Board2) {
|
|
21
|
-
Board2.Board = Schema.Struct({
|
|
22
|
-
name: Schema.optional(Schema.String),
|
|
23
|
-
items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),
|
|
24
|
-
layout: Schema.mutable(BoardLayout)
|
|
25
|
-
}).pipe(Type.Obj({
|
|
26
|
-
typename: "dxos.org/type/Board",
|
|
27
|
-
version: "0.1.0"
|
|
28
|
-
}), LabelAnnotation.set([
|
|
29
|
-
"name"
|
|
30
|
-
]));
|
|
31
|
-
class Create extends Schema.TaggedClass()(`${meta.id}/action/create`, {
|
|
32
|
-
input: Schema.Struct({
|
|
33
|
-
name: Schema.optional(Schema.String)
|
|
34
|
-
}),
|
|
35
|
-
output: Schema.Struct({
|
|
36
|
-
object: Board2.Board
|
|
37
|
-
})
|
|
38
|
-
}) {
|
|
39
|
-
}
|
|
40
|
-
Board2.Create = Create;
|
|
41
|
-
})(Board || (Board = {}));
|
|
42
|
-
var Board;
|
|
43
|
-
|
|
44
|
-
export {
|
|
45
|
-
meta,
|
|
46
|
-
Board
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=chunk-K6CHLZYU.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { Type } from '@dxos/echo';\nimport { LabelAnnotation } from '@dxos/echo-schema';\nimport { BoardLayout } from '@dxos/react-ui-board';\n\nimport { meta } from '../meta';\n\nexport namespace Board {\n //\n // Types\n //\n\n // TODO(burdon): View?\n export const Board = Schema.Struct({\n name: Schema.optional(Schema.String),\n items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),\n layout: Schema.mutable(BoardLayout),\n }).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n );\n\n export interface Board extends Schema.Schema.Type<typeof Board> {}\n\n //\n // Actions\n //\n\n export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Board,\n }),\n }) {}\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/board',\n name: 'Board',\n description:\n 'A spatial, infinite canvas app combining notes, media, and whiteboarding in a tactile, visual interface.',\n icon: 'ph--squares-four--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',\n screenshots: [],\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;AAEvB,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAChC,SAASC,mBAAmB;;;ACFrB,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;EACRC,aAAa,CAAA;AACf;;;UDFiBC,QAAAA;SAMFA,QAAQC,OAAOC,OAAO;IACjCC,MAAMF,OAAOG,SAASH,OAAOI,MAAM;IACnCC,OAAOL,OAAOM,QAAQN,OAAOO,MAAMC,KAAKC,IAAID,KAAKE,OAAO,CAAA,CAAA;IACxDC,QAAQX,OAAOM,QAAQM,WAAAA;EACzB,CAAA,EAAGC,KACDL,KAAKM,IAAI;IACPC,UAAU;IACVC,SAAS;EACX,CAAA,GACAC,gBAAgBC,IAAI;IAAC;GAAO,CAAA;EASvB,MAAMC,eAAenB,OAAOoB,YAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;IACnFC,OAAOvB,OAAOC,OAAO;MACnBC,MAAMF,OAAOG,SAASH,OAAOI,MAAM;IACrC,CAAA;IACAoB,QAAQxB,OAAOC,OAAO;MACpBwB,QAAM1B,OAAEA;IACV,CAAA;EACF,CAAA,EAAA;EAAI;SAPSoB,SAAAA;AAQf,GAhCiBpB,UAAAA,QAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["Schema", "Type", "LabelAnnotation", "BoardLayout", "meta", "id", "name", "description", "icon", "source", "screenshots", "Board", "Schema", "Struct", "name", "optional", "String", "items", "mutable", "Array", "Type", "Ref", "Expando", "layout", "BoardLayout", "pipe", "Obj", "typename", "version", "LabelAnnotation", "set", "Create", "TaggedClass", "meta", "id", "input", "output", "object"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx", "../../../src/components/BoardContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { contributes, Capabilities, type PluginContext, createSurface } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { BoardContainer } from '../components';\nimport { meta } from '../meta';\nimport { Board } from '../types';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.ReactSurface, [\n createSurface({\n id: meta.id,\n role: ['article', 'section'],\n filter: (data): data is { subject: Board.Board } => Obj.instanceOf(Board.Board, data.subject),\n component: ({ data, role }) => <BoardContainer board={data.subject} role={role} />,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-react';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { createIntent, Surface, useIntentDispatcher } from '@dxos/app-framework';\nimport { getSpace } from '@dxos/client/echo';\nimport { type Obj, Ref, type Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Board, type BoardController, type BoardRootProps } from '@dxos/react-ui-board';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\n// TODO(thure): There is debate about having to rename either the type or the React component. A best practice should be chosen and either Board or Kanban (or both) should be refactored to apply it.\nimport { type Board as BoardType } from '../types';\n\nexport type BoardContainerProps = {\n role: string;\n board: BoardType.Board;\n};\n\nexport const BoardContainer = ({ role, board }: BoardContainerProps) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n const controller = useRef<BoardController>(null);\n\n // TODO(burdon): Create effect utility for reactive arrays.\n const [items, setItems] = useState<Type.Expando[]>([]);\n useEffect(() => {\n let t: NodeJS.Timeout;\n effect(() => {\n const refs = [...board.items];\n t = setTimeout(async () => {\n const items = await Ref.Array.loadAll(refs);\n setItems(items.filter(isNonNullable));\n });\n });\n\n return () => clearTimeout(t);\n }, [board.items]);\n\n const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(\n async (position = { x: 0, y: 0 }) => {\n const space = getSpace(board);\n invariant(space);\n await dispatch(\n createIntent(SpaceAction.OpenCreateObject, {\n target: space,\n navigable: false,\n onCreateObject: (object: Obj.Any) => {\n board.items.push(Ref.make(object));\n board.layout.cells[object.id] = { ...position, width: 1, height: 1 };\n controller.current?.center(position);\n },\n }),\n );\n },\n [board, controller, dispatch],\n );\n\n // TODO(burdon): Use intents so can be undone.\n const handleDelete = useCallback<NonNullable<BoardRootProps['onDelete']>>(\n (id) => {\n // TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.\n const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);\n if (idx !== -1) {\n board.items.splice(idx, 1);\n }\n delete board.layout.cells[id];\n setItems((items) => items.filter((item) => item.id !== id));\n },\n [board],\n );\n\n const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(\n (id, position) => {\n const layout = board.layout.cells[id];\n board.layout.cells[id] = { ...layout, ...position };\n },\n [board],\n );\n\n return (\n <Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>\n <StackItem.Content toolbar>\n <Board.Controls />\n <Board.Container>\n <Board.Viewport classNames='border-none'>\n <Board.Backdrop />\n <Board.Content>\n {items?.map((item, index) => (\n <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>\n <Surface role='card--extrinsic' data={{ subject: item }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </StackItem.Content>\n </Board.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,aAAaC,cAAkCC,qBAAqB;AAC7E,SAASC,WAAW;;;;ACHpB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MAAkB0D,MAAM;QAAEC,SAASlB;MAAK;MAAGmB,OAAO;;;;;AASlF;;;AD1FA,IAAA,wBAAe,CAACC,YACdC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAA2CC,IAAIC,WAAWC,MAAMA,OAAOH,KAAKI,OAAO;IAC5FC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,gBAAAQ,OAAA,cAACC,gBAAAA;MAAeC,OAAOR,KAAKI;MAASN;;EACtE,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "contributes", "Capabilities", "createSurface", "Obj", "effect", "React", "useCallback", "useEffect", "useRef", "useState", "createIntent", "Surface", "useIntentDispatcher", "getSpace", "Ref", "invariant", "SpaceAction", "Board", "StackItem", "isNonNullable", "BoardContainer", "role", "board", "dispatchPromise", "dispatch", "controller", "items", "setItems", "t", "refs", "setTimeout", "Array", "loadAll", "filter", "clearTimeout", "handleAdd", "position", "x", "y", "space", "OpenCreateObject", "target", "navigable", "onCreateObject", "object", "push", "make", "layout", "cells", "id", "width", "height", "current", "center", "handleDelete", "idx", "findIndex", "ref", "dxn", "asEchoDXN", "echoId", "splice", "item", "handleMove", "Root", "onAdd", "onDelete", "onMove", "Content", "toolbar", "Controls", "Container", "Viewport", "classNames", "Backdrop", "map", "index", "Cell", "key", "data", "subject", "limit", "context", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Board", "subject", "component", "React", "BoardContainer", "board"]
|
|
7
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { Type } from '@dxos/echo';
|
|
3
|
-
export declare namespace Board {
|
|
4
|
-
export const Board: Type.obj<Schema.Struct<{
|
|
5
|
-
name: Schema.optional<typeof Schema.String>;
|
|
6
|
-
items: Schema.mutable<Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
|
|
7
|
-
[x: string]: any;
|
|
8
|
-
id: string;
|
|
9
|
-
}, never>>>>;
|
|
10
|
-
layout: Schema.mutable<Schema.Struct<{
|
|
11
|
-
size: Schema.Struct<{
|
|
12
|
-
width: typeof Schema.Number;
|
|
13
|
-
height: typeof Schema.Number;
|
|
14
|
-
}>;
|
|
15
|
-
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.extend<Schema.Struct<{
|
|
16
|
-
x: typeof Schema.Number;
|
|
17
|
-
y: typeof Schema.Number;
|
|
18
|
-
}>, Schema.SchemaClass<{
|
|
19
|
-
readonly width?: number | undefined;
|
|
20
|
-
readonly height?: number | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
readonly width?: number | undefined;
|
|
23
|
-
readonly height?: number | undefined;
|
|
24
|
-
}, never>>>>;
|
|
25
|
-
}>>;
|
|
26
|
-
}>>;
|
|
27
|
-
export interface Board extends Schema.Schema.Type<typeof Board> {
|
|
28
|
-
}
|
|
29
|
-
const Create_base: Schema.TaggedClass<Create, `${string}/action/create`, {
|
|
30
|
-
readonly _tag: Schema.tag<`${string}/action/create`>;
|
|
31
|
-
} & {
|
|
32
|
-
input: Schema.Struct<{
|
|
33
|
-
name: Schema.optional<typeof Schema.String>;
|
|
34
|
-
}>;
|
|
35
|
-
output: Schema.Struct<{
|
|
36
|
-
object: Type.obj<Schema.Struct<{
|
|
37
|
-
name: Schema.optional<typeof Schema.String>;
|
|
38
|
-
items: Schema.mutable<Schema.Array$<Type.ref<Schema.Schema<Type.Expando, {
|
|
39
|
-
[x: string]: any;
|
|
40
|
-
id: string;
|
|
41
|
-
}, never>>>>;
|
|
42
|
-
layout: Schema.mutable<Schema.Struct<{
|
|
43
|
-
size: Schema.Struct<{
|
|
44
|
-
width: typeof Schema.Number;
|
|
45
|
-
height: typeof Schema.Number;
|
|
46
|
-
}>;
|
|
47
|
-
cells: Schema.mutable<Schema.Record$<typeof Schema.String, Schema.extend<Schema.Struct<{
|
|
48
|
-
x: typeof Schema.Number;
|
|
49
|
-
y: typeof Schema.Number;
|
|
50
|
-
}>, Schema.SchemaClass<{
|
|
51
|
-
readonly width?: number | undefined;
|
|
52
|
-
readonly height?: number | undefined;
|
|
53
|
-
}, {
|
|
54
|
-
readonly width?: number | undefined;
|
|
55
|
-
readonly height?: number | undefined;
|
|
56
|
-
}, never>>>>;
|
|
57
|
-
}>>;
|
|
58
|
-
}>>;
|
|
59
|
-
}>;
|
|
60
|
-
}>;
|
|
61
|
-
export class Create extends Create_base {
|
|
62
|
-
}
|
|
63
|
-
export {};
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMlC,yBAAiB,KAAK,CAAC;IAMrB,MAAM,CAAC,MAAM,KAAK;;;;;;;;;;;;;;;8BA2BuL,CAAC;+BAA6C,CAAC;;8BAAqD,CAAC;+BAA6C,CAAC;;;OAjB3V,CAAC;IAEF,MAAM,WAAW,KAAM,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC;KAAG;;;;;;;;;;;;;;;;;;;;;;;sCAeuI,CAAC;uCAA6C,CAAC;;sCAAqD,CAAC;uCAA6C,CAAC;;;;;;IAT5V,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN"}
|
package/src/types/schema.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Schema } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { Type } from '@dxos/echo';
|
|
8
|
-
import { LabelAnnotation } from '@dxos/echo-schema';
|
|
9
|
-
import { BoardLayout } from '@dxos/react-ui-board';
|
|
10
|
-
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
|
|
13
|
-
export namespace Board {
|
|
14
|
-
//
|
|
15
|
-
// Types
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
// TODO(burdon): View?
|
|
19
|
-
export const Board = Schema.Struct({
|
|
20
|
-
name: Schema.optional(Schema.String),
|
|
21
|
-
items: Schema.mutable(Schema.Array(Type.Ref(Type.Expando))),
|
|
22
|
-
layout: Schema.mutable(BoardLayout),
|
|
23
|
-
}).pipe(
|
|
24
|
-
Type.Obj({
|
|
25
|
-
typename: 'dxos.org/type/Board',
|
|
26
|
-
version: '0.1.0',
|
|
27
|
-
}),
|
|
28
|
-
LabelAnnotation.set(['name']),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export interface Board extends Schema.Schema.Type<typeof Board> {}
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
// Actions
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
export class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {
|
|
38
|
-
input: Schema.Struct({
|
|
39
|
-
name: Schema.optional(Schema.String),
|
|
40
|
-
}),
|
|
41
|
-
output: Schema.Struct({
|
|
42
|
-
object: Board,
|
|
43
|
-
}),
|
|
44
|
-
}) {}
|
|
45
|
-
}
|