@dxos/plugin-board 0.8.4-main.1068cf700f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +15 -0
  3. package/dist/lib/browser/chunk-7VKDDGS7.mjs +36 -0
  4. package/dist/lib/browser/chunk-7VKDDGS7.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-DCLJ4HOC.mjs +159 -0
  6. package/dist/lib/browser/chunk-DCLJ4HOC.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +69 -0
  8. package/dist/lib/browser/index.mjs.map +7 -0
  9. package/dist/lib/browser/meta.json +1 -0
  10. package/dist/lib/browser/react-surface-3ECZMYLQ.mjs +32 -0
  11. package/dist/lib/browser/react-surface-3ECZMYLQ.mjs.map +7 -0
  12. package/dist/lib/browser/types/index.mjs +7 -0
  13. package/dist/lib/browser/types/index.mjs.map +7 -0
  14. package/dist/lib/node-esm/chunk-HICZFU5T.mjs +161 -0
  15. package/dist/lib/node-esm/chunk-HICZFU5T.mjs.map +7 -0
  16. package/dist/lib/node-esm/chunk-UGVRNKWV.mjs +37 -0
  17. package/dist/lib/node-esm/chunk-UGVRNKWV.mjs.map +7 -0
  18. package/dist/lib/node-esm/index.mjs +70 -0
  19. package/dist/lib/node-esm/index.mjs.map +7 -0
  20. package/dist/lib/node-esm/meta.json +1 -0
  21. package/dist/lib/node-esm/react-surface-W7FPI7BR.mjs +33 -0
  22. package/dist/lib/node-esm/react-surface-W7FPI7BR.mjs.map +7 -0
  23. package/dist/lib/node-esm/types/index.mjs +8 -0
  24. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  25. package/dist/types/src/BoardPlugin.d.ts +3 -0
  26. package/dist/types/src/BoardPlugin.d.ts.map +1 -0
  27. package/dist/types/src/capabilities/index.d.ts +2 -0
  28. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  29. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  30. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  32. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  33. package/dist/types/src/components/BoardContainer.d.ts +6 -0
  34. package/dist/types/src/components/BoardContainer.d.ts.map +1 -0
  35. package/dist/types/src/components/BoardContainer.stories.d.ts +45 -0
  36. package/dist/types/src/components/BoardContainer.stories.d.ts.map +1 -0
  37. package/dist/types/src/components/index.d.ts +2 -0
  38. package/dist/types/src/components/index.d.ts.map +1 -0
  39. package/dist/types/src/index.d.ts +5 -0
  40. package/dist/types/src/index.d.ts.map +1 -0
  41. package/dist/types/src/meta.d.ts +3 -0
  42. package/dist/types/src/meta.d.ts.map +1 -0
  43. package/dist/types/src/translations.d.ts +20 -0
  44. package/dist/types/src/translations.d.ts.map +1 -0
  45. package/dist/types/src/types/Board.d.ts +46 -0
  46. package/dist/types/src/types/Board.d.ts.map +1 -0
  47. package/dist/types/src/types/index.d.ts +2 -0
  48. package/dist/types/src/types/index.d.ts.map +1 -0
  49. package/dist/types/tsconfig.tsbuildinfo +1 -0
  50. package/package.json +96 -0
  51. package/src/BoardPlugin.tsx +33 -0
  52. package/src/capabilities/index.ts +5 -0
  53. package/src/capabilities/react-surface/index.ts +7 -0
  54. package/src/capabilities/react-surface/react-surface.tsx +27 -0
  55. package/src/components/BoardContainer.stories.tsx +121 -0
  56. package/src/components/BoardContainer.tsx +151 -0
  57. package/src/components/index.ts +5 -0
  58. package/src/index.ts +9 -0
  59. package/src/meta.ts +19 -0
  60. package/src/translations.ts +28 -0
  61. package/src/types/Board.ts +33 -0
  62. package/src/types/index.ts +5 -0
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@dxos/plugin-board",
3
+ "version": "0.8.4-main.1068cf700f",
4
+ "description": "Surface plugin for card baords",
5
+ "homepage": "https://dxos.org",
6
+ "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
11
+ "license": "MIT",
12
+ "author": "DXOS.org",
13
+ "sideEffects": true,
14
+ "type": "module",
15
+ "exports": {
16
+ ".": {
17
+ "browser": "./dist/lib/browser/index.mjs",
18
+ "node": "./dist/lib/node-esm/index.mjs",
19
+ "source": "./src/index.ts",
20
+ "types": "./dist/types/src/index.d.ts"
21
+ },
22
+ "./types": {
23
+ "browser": "./dist/lib/browser/types/index.mjs",
24
+ "node": "./dist/lib/node-esm/types/index.mjs",
25
+ "source": "./src/types/index.ts",
26
+ "types": "./dist/types/src/types/index.d.ts"
27
+ }
28
+ },
29
+ "types": "dist/types/src/index.d.ts",
30
+ "typesVersions": {
31
+ "*": {
32
+ "types": [
33
+ "dist/types/src/types/index.d.ts"
34
+ ]
35
+ }
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "src"
40
+ ],
41
+ "dependencies": {
42
+ "effect": "3.19.16",
43
+ "@dxos/ai": "0.8.4-main.1068cf700f",
44
+ "@dxos/app-framework": "0.8.4-main.1068cf700f",
45
+ "@dxos/assistant": "0.8.4-main.1068cf700f",
46
+ "@dxos/async": "0.8.4-main.1068cf700f",
47
+ "@dxos/blueprints": "0.8.4-main.1068cf700f",
48
+ "@dxos/echo": "0.8.4-main.1068cf700f",
49
+ "@dxos/client": "0.8.4-main.1068cf700f",
50
+ "@dxos/echo-react": "0.8.4-main.1068cf700f",
51
+ "@dxos/app-toolkit": "0.8.4-main.1068cf700f",
52
+ "@dxos/invariant": "0.8.4-main.1068cf700f",
53
+ "@dxos/log": "0.8.4-main.1068cf700f",
54
+ "@dxos/effect": "0.8.4-main.1068cf700f",
55
+ "@dxos/operation": "0.8.4-main.1068cf700f",
56
+ "@dxos/plugin-graph": "0.8.4-main.1068cf700f",
57
+ "@dxos/plugin-search": "0.8.4-main.1068cf700f",
58
+ "@dxos/plugin-space": "0.8.4-main.1068cf700f",
59
+ "@dxos/random": "0.8.4-main.1068cf700f",
60
+ "@dxos/plugin-client": "0.8.4-main.1068cf700f",
61
+ "@dxos/react-client": "0.8.4-main.1068cf700f",
62
+ "@dxos/react-ui-attention": "0.8.4-main.1068cf700f",
63
+ "@dxos/react-ui": "0.8.4-main.1068cf700f",
64
+ "@dxos/react-ui-board": "0.8.4-main.1068cf700f",
65
+ "@dxos/react-ui-form": "0.8.4-main.1068cf700f",
66
+ "@dxos/react-ui-stack": "0.8.4-main.1068cf700f",
67
+ "@dxos/react-ui-mosaic": "0.8.4-main.1068cf700f",
68
+ "@dxos/schema": "0.8.4-main.1068cf700f",
69
+ "@dxos/util": "0.8.4-main.1068cf700f",
70
+ "@dxos/types": "0.8.4-main.1068cf700f"
71
+ },
72
+ "devDependencies": {
73
+ "@types/react": "~19.2.7",
74
+ "@types/react-dom": "~19.2.3",
75
+ "react": "~19.2.3",
76
+ "react-dom": "~19.2.3",
77
+ "vite": "7.1.9",
78
+ "@dxos/plugin-testing": "0.8.4-main.1068cf700f",
79
+ "@dxos/plugin-preview": "0.8.4-main.1068cf700f",
80
+ "@dxos/plugin-theme": "0.8.4-main.1068cf700f",
81
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.1068cf700f",
82
+ "@dxos/storybook-utils": "0.8.4-main.1068cf700f",
83
+ "@dxos/test-utils": "0.8.4-main.1068cf700f",
84
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f"
85
+ },
86
+ "peerDependencies": {
87
+ "effect": "3.19.16",
88
+ "react": "~19.2.3",
89
+ "react-dom": "~19.2.3",
90
+ "@dxos/react-ui": "0.8.4-main.1068cf700f",
91
+ "@dxos/ui-theme": "0.8.4-main.1068cf700f"
92
+ },
93
+ "publishConfig": {
94
+ "access": "public"
95
+ }
96
+ }
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
9
+ import { type CreateObject } from '@dxos/plugin-space/types';
10
+ import { translations as boardTranslations } from '@dxos/react-ui-board';
11
+
12
+ import { ReactSurface } from './capabilities';
13
+ import { meta } from './meta';
14
+ import { translations } from './translations';
15
+ import { Board } from './types';
16
+
17
+ export const BoardPlugin = Plugin.define(meta).pipe(
18
+ AppPlugin.addMetadataModule({
19
+ metadata: {
20
+ id: Board.Board.typename,
21
+ metadata: {
22
+ icon: 'ph--squares-four--regular',
23
+ iconHue: 'green',
24
+ createObject: ((props) => Effect.sync(() => Board.makeBoard(props))) satisfies CreateObject,
25
+ addToCollectionOnCreate: true,
26
+ },
27
+ },
28
+ }),
29
+ AppPlugin.addSchemaModule({ schema: [Board.Board] }),
30
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
31
+ AppPlugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
32
+ Plugin.make,
33
+ );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './react-surface';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
10
+ import { Obj } from '@dxos/echo';
11
+
12
+ import { BoardContainer } from '../../components';
13
+ import { meta } from '../../meta';
14
+ import { Board } from '../../types';
15
+
16
+ export default Capability.makeModule(() =>
17
+ Effect.succeed(
18
+ Capability.contributes(Capabilities.ReactSurface, [
19
+ Surface.create({
20
+ id: meta.id,
21
+ role: ['article', 'section'],
22
+ filter: (data): data is { subject: Board.Board } => Obj.instanceOf(Board.Board, data.subject),
23
+ component: ({ role, data }) => <BoardContainer role={role} subject={data.subject} />,
24
+ }),
25
+ ]),
26
+ ),
27
+ );
@@ -0,0 +1,121 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import React, { useEffect, useState } from 'react';
8
+
9
+ import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { Obj } from '@dxos/echo';
11
+ import { ClientPlugin } from '@dxos/plugin-client';
12
+ import { PreviewPlugin } from '@dxos/plugin-preview';
13
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
14
+ import { faker } from '@dxos/random';
15
+ import { Filter, Ref, useQuery, useSpaces } from '@dxos/react-client/echo';
16
+ import { withTheme } from '@dxos/react-ui/testing';
17
+ import { translations as stackTranslations } from '@dxos/react-ui-stack';
18
+ import { Organization, Person } from '@dxos/types';
19
+
20
+ import { translations } from '../translations';
21
+ import { Board } from '../types';
22
+
23
+ import { BoardContainer } from './BoardContainer';
24
+
25
+ faker.seed(0);
26
+
27
+ const createBoard = () =>
28
+ Obj.make(Board.Board, {
29
+ name: 'Test Board',
30
+ items: [],
31
+ layout: {
32
+ size: { width: 7, height: 5 },
33
+ cells: {},
34
+ },
35
+ });
36
+
37
+ const createOrg = () =>
38
+ Obj.make(Organization.Organization, {
39
+ name: faker.commerce.productName(),
40
+ description: faker.lorem.paragraph(),
41
+ image: faker.image.url(),
42
+ website: faker.internet.url(),
43
+ // TODO(burdon): Fix.
44
+ // status: faker.helpers.arrayElement(Organization.StatusOptions).id,
45
+ });
46
+
47
+ const DefaultStory = () => {
48
+ const spaces = useSpaces();
49
+ const space = spaces[spaces.length - 1];
50
+ const boards = useQuery(space?.db, Filter.type(Board.Board));
51
+ const [board, setBoard] = useState<Board.Board>();
52
+
53
+ useEffect(() => {
54
+ if (boards.length && !board) {
55
+ const board = boards[0];
56
+ setBoard(board);
57
+ }
58
+ }, [boards]);
59
+
60
+ if (!board) {
61
+ return null;
62
+ }
63
+
64
+ return <BoardContainer role='board' subject={board} />;
65
+ };
66
+
67
+ //
68
+ // Story definitions
69
+ //
70
+
71
+ const meta = {
72
+ title: 'plugins/plugin-board/Board',
73
+ render: DefaultStory,
74
+ decorators: [
75
+ withTheme(),
76
+ withPluginManager({
77
+ plugins: [
78
+ ...corePlugins(),
79
+ ClientPlugin({
80
+ types: [Organization.Organization, Person.Person, Board.Board],
81
+ onClientInitialized: ({ client }) =>
82
+ Effect.gen(function* () {
83
+ yield* Effect.promise(() => client.halo.createIdentity());
84
+ const space = yield* Effect.promise(() => client.spaces.create());
85
+ yield* Effect.promise(() => space.waitUntilReady());
86
+ const board = space.db.add(createBoard());
87
+
88
+ Obj.change(board, (b) => {
89
+ // Add some sample items
90
+ Array.from({ length: 10 }).map(() => {
91
+ const org = createOrg();
92
+ space.db.add(org);
93
+ b.items.push(Ref.make(org));
94
+ b.layout.cells[org.id] = {
95
+ x: Math.floor(Math.random() * 5) - 2,
96
+ y: Math.floor(Math.random() * 5) - 2,
97
+ width: 1,
98
+ height: 1,
99
+ };
100
+ return org;
101
+ });
102
+ });
103
+ }),
104
+ }),
105
+
106
+ StorybookPlugin({}),
107
+ PreviewPlugin(),
108
+ ],
109
+ }),
110
+ ],
111
+ parameters: {
112
+ layout: 'fullscreen',
113
+ translations: [...translations, ...stackTranslations],
114
+ },
115
+ };
116
+
117
+ export default meta;
118
+
119
+ type Story = StoryObj<typeof meta>;
120
+
121
+ export const Default: Story = {};
@@ -0,0 +1,151 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { useCallback, useMemo, useRef, useState } from 'react';
6
+
7
+ import { Surface } from '@dxos/app-framework/ui';
8
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
9
+ import { Filter, Obj, Ref } from '@dxos/echo';
10
+ import { useObject, useObjects } from '@dxos/echo-react';
11
+ import { invariant } from '@dxos/invariant';
12
+ import { useQuery } from '@dxos/react-client/echo';
13
+ import { Layout } from '@dxos/react-ui';
14
+ import { useAttention } from '@dxos/react-ui-attention';
15
+ import { Board, type BoardController, type BoardRootProps, type Position } from '@dxos/react-ui-board';
16
+ import { ObjectPicker, type ObjectPickerContentProps } from '@dxos/react-ui-form';
17
+ import { isNonNullable } from '@dxos/util';
18
+
19
+ import { type Board as BoardType } from '../types';
20
+
21
+ const DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;
22
+
23
+ type PickerState = {
24
+ position: Position;
25
+ };
26
+
27
+ export type BoardContainerProps = SurfaceComponentProps<BoardType.Board>;
28
+
29
+ export const BoardContainer = ({ role, subject: board }: BoardContainerProps) => {
30
+ const controller = useRef<BoardController>(null);
31
+ const [boardItems] = useObject(board, 'items');
32
+ const items = useObjects(boardItems ?? []);
33
+ const addTriggerRef = useRef<HTMLButtonElement | null>(null);
34
+ const [pickerState, setPickerState] = useState<PickerState | null>(null);
35
+ const attendableId = Obj.getDXN(board).toString();
36
+ const { hasAttention } = useAttention(attendableId);
37
+
38
+ const db = Obj.getDatabase(board);
39
+ // TODO(burdon): Use search.
40
+ const objects = useQuery(db, Filter.everything());
41
+ const options = useMemo<ObjectPickerContentProps['options']>(
42
+ () =>
43
+ objects
44
+ .filter((obj) => obj.id !== board.id)
45
+ .map((obj) => {
46
+ const label = Obj.getLabel(obj);
47
+ if (label) {
48
+ return {
49
+ id: obj.id,
50
+ label,
51
+ hue: 'neutral' as const,
52
+ };
53
+ }
54
+ })
55
+ .filter(isNonNullable)
56
+ .sort(({ label: a }, { label: b }) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),
57
+ [objects],
58
+ );
59
+
60
+ const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(
61
+ async (anchor, position = DEFAULT_POSITION) => {
62
+ const db = Obj.getDatabase(board);
63
+ invariant(db);
64
+ addTriggerRef.current = anchor;
65
+ setPickerState({
66
+ position,
67
+ });
68
+ },
69
+ [board],
70
+ );
71
+
72
+ // TODO(burdon): Use intents so can be undone.
73
+ const handleDelete = useCallback<NonNullable<BoardRootProps['onDelete']>>(
74
+ (id) => {
75
+ // TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.
76
+ const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);
77
+ Obj.change(board, (b) => {
78
+ if (idx !== -1) {
79
+ b.items.splice(idx, 1);
80
+ }
81
+ delete b.layout.cells[id];
82
+ });
83
+ },
84
+ [board],
85
+ );
86
+
87
+ const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(
88
+ (id, position) => {
89
+ const layout = board.layout.cells[id];
90
+ Obj.change(board, (b) => {
91
+ b.layout.cells[id] = { ...layout, ...position };
92
+ });
93
+ },
94
+ [board],
95
+ );
96
+
97
+ const handleSelect = useCallback<NonNullable<ObjectPickerContentProps['onSelect']>>(
98
+ (id) => {
99
+ if (!pickerState) {
100
+ return;
101
+ }
102
+
103
+ // Find the selected object by id from the space.
104
+ const selectedObject = objects.find((obj) => obj.id === id);
105
+ if (!Obj.isObject(selectedObject)) {
106
+ return;
107
+ }
108
+
109
+ // Create a reference to the selected object and add it to the board.
110
+ Obj.change(board, (b) => {
111
+ b.items.push(Ref.make(selectedObject));
112
+
113
+ // Set the layout position for the new item.
114
+ b.layout.cells[selectedObject.id.toString()] = pickerState.position;
115
+ });
116
+
117
+ // Close the picker.
118
+ setPickerState(null);
119
+ },
120
+ [pickerState, objects, board],
121
+ );
122
+
123
+ return (
124
+ <Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>
125
+ <ObjectPicker.Root
126
+ open={!!pickerState}
127
+ onOpenChange={(nextOpen: boolean) => {
128
+ setPickerState(nextOpen ? { position: DEFAULT_POSITION } : null);
129
+ }}
130
+ >
131
+ <Layout.Main role={role} toolbar>
132
+ <Board.Toolbar disabled={!hasAttention} />
133
+ <Board.Container>
134
+ <Board.Viewport classNames='border-none'>
135
+ <Board.Backdrop />
136
+ <Board.Content>
137
+ {items?.map((item, index) => (
138
+ <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>
139
+ <Surface.Surface role='card--content' data={{ subject: item }} limit={1} />
140
+ </Board.Cell>
141
+ ))}
142
+ </Board.Content>
143
+ </Board.Viewport>
144
+ </Board.Container>
145
+ </Layout.Main>
146
+ <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />
147
+ <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />
148
+ </ObjectPicker.Root>
149
+ </Board.Root>
150
+ );
151
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export * from './BoardContainer';
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './components';
6
+ export * from './meta';
7
+ export * from './types';
8
+
9
+ export * from './BoardPlugin';
package/src/meta.ts ADDED
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
7
+
8
+ export const meta: Plugin.Meta = {
9
+ id: 'dxos.org/plugin/board',
10
+ name: 'Board',
11
+ description: trim`
12
+ Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.
13
+ Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.
14
+ `,
15
+ icon: 'ph--squares-four--regular',
16
+ iconHue: 'green',
17
+ source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',
18
+ screenshots: [],
19
+ };
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type Resource } from '@dxos/react-ui';
6
+
7
+ import { meta } from './meta';
8
+ import { Board } from './types';
9
+
10
+ export const translations = [
11
+ {
12
+ 'en-US': {
13
+ [Board.Board.typename]: {
14
+ 'typename label': 'Board',
15
+ 'typename label_zero': 'Boards',
16
+ 'typename label_one': 'Board',
17
+ 'typename label_other': 'Boards',
18
+ 'object name placeholder': 'New board',
19
+ 'rename object label': 'Rename board',
20
+ 'delete object label': 'Delete board',
21
+ 'object deleted label': 'Board deleted',
22
+ },
23
+ [meta.id]: {
24
+ 'plugin name': 'Board',
25
+ },
26
+ },
27
+ },
28
+ ] as const satisfies Resource[];
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { Obj, Type } from '@dxos/echo';
8
+ import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
+ import { BoardLayout, defaultLayout } from '@dxos/react-ui-board';
10
+
11
+ /**
12
+ * Board and layout.
13
+ */
14
+ export const Board = Schema.Struct({
15
+ name: Schema.String.pipe(Schema.optional),
16
+ items: Type.Ref(Type.Obj).pipe(Schema.Array, FormInputAnnotation.set(false)),
17
+ layout: BoardLayout.pipe(FormInputAnnotation.set(false)),
18
+ }).pipe(
19
+ Type.object({
20
+ typename: 'dxos.org/type/Board',
21
+ version: '0.1.0',
22
+ }),
23
+ LabelAnnotation.set(['name']),
24
+ );
25
+
26
+ export interface Board extends Schema.Schema.Type<typeof Board> {}
27
+
28
+ export const makeBoard = (props: Partial<Obj.MakeProps<typeof Board>> = {}) =>
29
+ Obj.make(Board, {
30
+ items: [],
31
+ layout: defaultLayout,
32
+ ...props,
33
+ });
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * as Board from './Board';