@dxos/plugin-board 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe

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 (67) hide show
  1. package/dist/lib/browser/{chunk-7VKDDGS7.mjs → chunk-FL67SBF5.mjs} +8 -5
  2. package/dist/lib/browser/chunk-FL67SBF5.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +60 -36
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +1 -1
  7. package/dist/lib/node-esm/{chunk-UGVRNKWV.mjs → chunk-5GGKJL4Z.mjs} +8 -5
  8. package/dist/lib/node-esm/chunk-5GGKJL4Z.mjs.map +7 -0
  9. package/dist/lib/node-esm/index.mjs +60 -36
  10. package/dist/lib/node-esm/index.mjs.map +4 -4
  11. package/dist/lib/node-esm/meta.json +1 -1
  12. package/dist/lib/node-esm/types/index.mjs +1 -1
  13. package/dist/types/src/BoardPlugin.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/index.d.ts +2 -1
  15. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  16. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  17. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  18. package/dist/types/src/components/index.d.ts +0 -1
  19. package/dist/types/src/components/index.d.ts.map +1 -1
  20. package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts +6 -0
  21. package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts.map +1 -0
  22. package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts +47 -0
  23. package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts.map +1 -0
  24. package/dist/types/src/containers/BoardContainer/index.d.ts +2 -0
  25. package/dist/types/src/containers/BoardContainer/index.d.ts.map +1 -0
  26. package/dist/types/src/containers/index.d.ts +3 -0
  27. package/dist/types/src/containers/index.d.ts.map +1 -0
  28. package/dist/types/src/index.d.ts +0 -1
  29. package/dist/types/src/index.d.ts.map +1 -1
  30. package/dist/types/src/translations.d.ts +12 -11
  31. package/dist/types/src/translations.d.ts.map +1 -1
  32. package/dist/types/src/types/Board.d.ts +3 -3
  33. package/dist/types/src/types/Board.d.ts.map +1 -1
  34. package/dist/types/tsconfig.tsbuildinfo +1 -1
  35. package/package.json +50 -42
  36. package/src/BoardPlugin.tsx +26 -12
  37. package/src/capabilities/index.ts +3 -1
  38. package/src/capabilities/react-surface.tsx +29 -0
  39. package/src/components/index.ts +0 -2
  40. package/src/{components → containers/BoardContainer}/BoardContainer.stories.tsx +18 -17
  41. package/src/{components → containers/BoardContainer}/BoardContainer.tsx +34 -30
  42. package/src/containers/BoardContainer/index.ts +5 -0
  43. package/src/containers/index.ts +7 -0
  44. package/src/index.ts +0 -1
  45. package/src/meta.ts +1 -1
  46. package/src/translations.ts +12 -11
  47. package/src/types/Board.ts +7 -3
  48. package/dist/lib/browser/chunk-2XGWSTZV.mjs +0 -159
  49. package/dist/lib/browser/chunk-2XGWSTZV.mjs.map +0 -7
  50. package/dist/lib/browser/chunk-7VKDDGS7.mjs.map +0 -7
  51. package/dist/lib/browser/react-surface-BEYXCLXI.mjs +0 -31
  52. package/dist/lib/browser/react-surface-BEYXCLXI.mjs.map +0 -7
  53. package/dist/lib/node-esm/chunk-JKPYRS2Z.mjs +0 -161
  54. package/dist/lib/node-esm/chunk-JKPYRS2Z.mjs.map +0 -7
  55. package/dist/lib/node-esm/chunk-UGVRNKWV.mjs.map +0 -7
  56. package/dist/lib/node-esm/react-surface-ZFKFUBJM.mjs +0 -32
  57. package/dist/lib/node-esm/react-surface-ZFKFUBJM.mjs.map +0 -7
  58. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  59. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  60. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  61. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  62. package/dist/types/src/components/BoardContainer.d.ts +0 -6
  63. package/dist/types/src/components/BoardContainer.d.ts.map +0 -1
  64. package/dist/types/src/components/BoardContainer.stories.d.ts +0 -45
  65. package/dist/types/src/components/BoardContainer.stories.d.ts.map +0 -1
  66. package/src/capabilities/react-surface/index.ts +0 -7
  67. package/src/capabilities/react-surface/react-surface.tsx +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-board",
3
- "version": "0.8.4-main.9735255",
3
+ "version": "0.8.4-main.9be5663bfe",
4
4
  "description": "Surface plugin for card baords",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,17 +12,24 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#components": "./src/components/index.ts",
18
+ "#containers": "./src/containers/index.ts",
19
+ "#meta": "./src/meta.ts",
20
+ "#types": "./src/types/index.ts"
21
+ },
15
22
  "exports": {
16
23
  ".": {
24
+ "source": "./src/index.ts",
17
25
  "browser": "./dist/lib/browser/index.mjs",
18
26
  "node": "./dist/lib/node-esm/index.mjs",
19
- "source": "./src/index.ts",
20
27
  "types": "./dist/types/src/index.d.ts"
21
28
  },
22
29
  "./types": {
30
+ "source": "./src/types/index.ts",
23
31
  "browser": "./dist/lib/browser/types/index.mjs",
24
32
  "node": "./dist/lib/node-esm/types/index.mjs",
25
- "source": "./src/types/index.ts",
26
33
  "types": "./dist/types/src/types/index.d.ts"
27
34
  }
28
35
  },
@@ -39,55 +46,56 @@
39
46
  "src"
40
47
  ],
41
48
  "dependencies": {
42
- "effect": "3.19.11",
43
- "@dxos/ai": "0.8.4-main.9735255",
44
- "@dxos/app-framework": "0.8.4-main.9735255",
45
- "@dxos/async": "0.8.4-main.9735255",
46
- "@dxos/assistant": "0.8.4-main.9735255",
47
- "@dxos/client": "0.8.4-main.9735255",
48
- "@dxos/blueprints": "0.8.4-main.9735255",
49
- "@dxos/echo": "0.8.4-main.9735255",
50
- "@dxos/effect": "0.8.4-main.9735255",
51
- "@dxos/invariant": "0.8.4-main.9735255",
52
- "@dxos/echo-react": "0.8.4-main.9735255",
53
- "@dxos/plugin-client": "0.8.4-main.9735255",
54
- "@dxos/log": "0.8.4-main.9735255",
55
- "@dxos/operation": "0.8.4-main.9735255",
56
- "@dxos/plugin-graph": "0.8.4-main.9735255",
57
- "@dxos/plugin-search": "0.8.4-main.9735255",
58
- "@dxos/random": "0.8.4-main.9735255",
59
- "@dxos/plugin-space": "0.8.4-main.9735255",
60
- "@dxos/react-client": "0.8.4-main.9735255",
61
- "@dxos/react-ui": "0.8.4-main.9735255",
62
- "@dxos/react-ui-attention": "0.8.4-main.9735255",
63
- "@dxos/react-ui-board": "0.8.4-main.9735255",
64
- "@dxos/react-ui-form": "0.8.4-main.9735255",
65
- "@dxos/react-ui-stack": "0.8.4-main.9735255",
66
- "@dxos/react-ui-mosaic": "0.8.4-main.9735255",
67
- "@dxos/schema": "0.8.4-main.9735255",
68
- "@dxos/types": "0.8.4-main.9735255",
69
- "@dxos/util": "0.8.4-main.9735255"
49
+ "effect": "3.20.0",
50
+ "@dxos/ai": "0.8.4-main.9be5663bfe",
51
+ "@dxos/app-framework": "0.8.4-main.9be5663bfe",
52
+ "@dxos/app-toolkit": "0.8.4-main.9be5663bfe",
53
+ "@dxos/assistant": "0.8.4-main.9be5663bfe",
54
+ "@dxos/async": "0.8.4-main.9be5663bfe",
55
+ "@dxos/blueprints": "0.8.4-main.9be5663bfe",
56
+ "@dxos/echo": "0.8.4-main.9be5663bfe",
57
+ "@dxos/client": "0.8.4-main.9be5663bfe",
58
+ "@dxos/invariant": "0.8.4-main.9be5663bfe",
59
+ "@dxos/echo-react": "0.8.4-main.9be5663bfe",
60
+ "@dxos/effect": "0.8.4-main.9be5663bfe",
61
+ "@dxos/log": "0.8.4-main.9be5663bfe",
62
+ "@dxos/plugin-client": "0.8.4-main.9be5663bfe",
63
+ "@dxos/plugin-search": "0.8.4-main.9be5663bfe",
64
+ "@dxos/plugin-graph": "0.8.4-main.9be5663bfe",
65
+ "@dxos/operation": "0.8.4-main.9be5663bfe",
66
+ "@dxos/random": "0.8.4-main.9be5663bfe",
67
+ "@dxos/plugin-space": "0.8.4-main.9be5663bfe",
68
+ "@dxos/react-client": "0.8.4-main.9be5663bfe",
69
+ "@dxos/react-ui-board": "0.8.4-main.9be5663bfe",
70
+ "@dxos/react-ui-form": "0.8.4-main.9be5663bfe",
71
+ "@dxos/react-ui-stack": "0.8.4-main.9be5663bfe",
72
+ "@dxos/react-ui-mosaic": "0.8.4-main.9be5663bfe",
73
+ "@dxos/schema": "0.8.4-main.9be5663bfe",
74
+ "@dxos/util": "0.8.4-main.9be5663bfe",
75
+ "@dxos/types": "0.8.4-main.9be5663bfe",
76
+ "@dxos/react-ui-attention": "0.8.4-main.9be5663bfe",
77
+ "@dxos/react-ui": "0.8.4-main.9be5663bfe"
70
78
  },
71
79
  "devDependencies": {
72
80
  "@types/react": "~19.2.7",
73
81
  "@types/react-dom": "~19.2.3",
74
82
  "react": "~19.2.3",
75
83
  "react-dom": "~19.2.3",
76
- "vite": "7.1.9",
77
- "@dxos/plugin-testing": "0.8.4-main.9735255",
78
- "@dxos/plugin-preview": "0.8.4-main.9735255",
79
- "@dxos/plugin-theme": "0.8.4-main.9735255",
80
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.9735255",
81
- "@dxos/storybook-utils": "0.8.4-main.9735255",
82
- "@dxos/test-utils": "0.8.4-main.9735255",
83
- "@dxos/ui-theme": "0.8.4-main.9735255"
84
+ "vite": "^7.1.11",
85
+ "@dxos/plugin-preview": "0.8.4-main.9be5663bfe",
86
+ "@dxos/plugin-testing": "0.8.4-main.9be5663bfe",
87
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.9be5663bfe",
88
+ "@dxos/plugin-theme": "0.8.4-main.9be5663bfe",
89
+ "@dxos/storybook-utils": "0.8.4-main.9be5663bfe",
90
+ "@dxos/test-utils": "0.8.4-main.9be5663bfe",
91
+ "@dxos/ui-theme": "0.8.4-main.9be5663bfe"
84
92
  },
85
93
  "peerDependencies": {
86
- "effect": "3.19.11",
94
+ "effect": "3.20.0",
87
95
  "react": "~19.2.3",
88
96
  "react-dom": "~19.2.3",
89
- "@dxos/react-ui": "0.8.4-main.9735255",
90
- "@dxos/ui-theme": "0.8.4-main.9735255"
97
+ "@dxos/react-ui": "0.8.4-main.9be5663bfe",
98
+ "@dxos/ui-theme": "0.8.4-main.9be5663bfe"
91
99
  },
92
100
  "publishConfig": {
93
101
  "access": "public"
@@ -3,30 +3,44 @@
3
3
  //
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
6
7
 
7
- import { Common, Plugin } from '@dxos/app-framework';
8
+ import { Plugin } from '@dxos/app-framework';
9
+ import { AppPlugin } from '@dxos/app-toolkit';
10
+ import { Annotation } from '@dxos/echo';
11
+ import { Operation } from '@dxos/operation';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
8
13
  import { type CreateObject } from '@dxos/plugin-space/types';
9
14
  import { translations as boardTranslations } from '@dxos/react-ui-board';
10
15
 
11
- import { ReactSurface } from './capabilities';
12
- import { meta } from './meta';
16
+ import { ReactSurface } from '#capabilities';
17
+ import { meta } from '#meta';
18
+ import { Board } from '#types';
19
+
13
20
  import { translations } from './translations';
14
- import { Board } from './types';
15
21
 
16
22
  export const BoardPlugin = Plugin.define(meta).pipe(
17
- Common.Plugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
18
- Common.Plugin.addMetadataModule({
23
+ AppPlugin.addMetadataModule({
19
24
  metadata: {
20
25
  id: Board.Board.typename,
21
26
  metadata: {
22
- icon: 'ph--squares-four--regular',
23
- iconHue: 'green',
24
- createObject: ((props) => Effect.sync(() => Board.makeBoard(props))) satisfies CreateObject,
25
- addToCollectionOnCreate: true,
27
+ icon: Annotation.IconAnnotation.get(Board.Board).pipe(Option.getOrThrow).icon,
28
+ iconHue: Annotation.IconAnnotation.get(Board.Board).pipe(Option.getOrThrow).hue ?? 'white',
29
+ createObject: ((props, options) =>
30
+ Effect.gen(function* () {
31
+ const object = Board.makeBoard(props);
32
+ return yield* Operation.invoke(SpaceOperation.AddObject, {
33
+ object,
34
+ target: options.target,
35
+ hidden: true,
36
+ targetNodeId: options.targetNodeId,
37
+ });
38
+ })) satisfies CreateObject,
26
39
  },
27
40
  },
28
41
  }),
29
- Common.Plugin.addSchemaModule({ schema: [Board.Board] }),
30
- Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
42
+ AppPlugin.addSchemaModule({ schema: [Board.Board] }),
43
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
44
+ AppPlugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
31
45
  Plugin.make,
32
46
  );
@@ -2,4 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './react-surface';
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,29 @@
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 { AppSurface } from '@dxos/app-toolkit/ui';
11
+
12
+ import { BoardContainer } from '#containers';
13
+ import { Board } from '#types';
14
+
15
+ export default Capability.makeModule(() =>
16
+ Effect.succeed(
17
+ Capability.contributes(Capabilities.ReactSurface, [
18
+ Surface.create({
19
+ id: 'root',
20
+ // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
21
+ role: ['article', 'section'],
22
+ filter: AppSurface.objectArticle(Board.Board),
23
+ component: ({ role, data }) => (
24
+ <BoardContainer role={role} subject={data.subject} attendableId={data.attendableId} />
25
+ ),
26
+ }),
27
+ ]),
28
+ ),
29
+ );
@@ -1,5 +1,3 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
-
5
- export * from './BoardContainer';
@@ -9,20 +9,21 @@ import React, { useEffect, useState } from 'react';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
10
  import { Obj } from '@dxos/echo';
11
11
  import { ClientPlugin } from '@dxos/plugin-client';
12
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
12
13
  import { PreviewPlugin } from '@dxos/plugin-preview';
13
14
  import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
14
- import { faker } from '@dxos/random';
15
+ import { random } from '@dxos/random';
15
16
  import { Filter, Ref, useQuery, useSpaces } from '@dxos/react-client/echo';
16
- import { withTheme } from '@dxos/react-ui/testing';
17
17
  import { translations as stackTranslations } from '@dxos/react-ui-stack';
18
+ import { withLayout } from '@dxos/react-ui/testing';
18
19
  import { Organization, Person } from '@dxos/types';
19
20
 
20
- import { translations } from '../translations';
21
- import { Board } from '../types';
21
+ import { Board } from '#types';
22
22
 
23
+ import { translations } from '../../translations';
23
24
  import { BoardContainer } from './BoardContainer';
24
25
 
25
- faker.seed(0);
26
+ random.seed(0);
26
27
 
27
28
  const createBoard = () =>
28
29
  Obj.make(Board.Board, {
@@ -36,12 +37,12 @@ const createBoard = () =>
36
37
 
37
38
  const createOrg = () =>
38
39
  Obj.make(Organization.Organization, {
39
- name: faker.commerce.productName(),
40
- description: faker.lorem.paragraph(),
41
- image: faker.image.url(),
42
- website: faker.internet.url(),
40
+ name: random.commerce.productName(),
41
+ description: random.lorem.paragraph(),
42
+ image: random.image.url(),
43
+ website: random.internet.url(),
43
44
  // TODO(burdon): Fix.
44
- // status: faker.helpers.arrayElement(Organization.StatusOptions).id,
45
+ // status: random.helpers.arrayElement(Organization.StatusOptions).id,
45
46
  });
46
47
 
47
48
  const DefaultStory = () => {
@@ -61,7 +62,7 @@ const DefaultStory = () => {
61
62
  return null;
62
63
  }
63
64
 
64
- return <BoardContainer role='board' subject={board} />;
65
+ return <BoardContainer role='board' subject={board} attendableId='test' />;
65
66
  };
66
67
 
67
68
  //
@@ -69,10 +70,10 @@ const DefaultStory = () => {
69
70
  //
70
71
 
71
72
  const meta = {
72
- title: 'plugins/plugin-board/Board',
73
+ title: 'plugins/plugin-board/containers/BoardContainer',
73
74
  render: DefaultStory,
74
75
  decorators: [
75
- withTheme,
76
+ withLayout({ layout: 'fullscreen' }),
76
77
  withPluginManager({
77
78
  plugins: [
78
79
  ...corePlugins(),
@@ -80,18 +81,18 @@ const meta = {
80
81
  types: [Organization.Organization, Person.Person, Board.Board],
81
82
  onClientInitialized: ({ client }) =>
82
83
  Effect.gen(function* () {
83
- yield* Effect.promise(() => client.halo.createIdentity());
84
+ yield* initializeIdentity(client);
84
85
  const space = yield* Effect.promise(() => client.spaces.create());
85
86
  yield* Effect.promise(() => space.waitUntilReady());
86
87
  const board = space.db.add(createBoard());
87
88
 
88
- Obj.change(board, (b) => {
89
+ Obj.change(board, (board) => {
89
90
  // Add some sample items
90
91
  Array.from({ length: 10 }).map(() => {
91
92
  const org = createOrg();
92
93
  space.db.add(org);
93
- b.items.push(Ref.make(org));
94
- b.layout.cells[org.id] = {
94
+ board.items.push(Ref.make(org));
95
+ board.layout.cells[org.id] = {
95
96
  x: Math.floor(Math.random() * 5) - 2,
96
97
  y: Math.floor(Math.random() * 5) - 2,
97
98
  width: 1,
@@ -4,18 +4,19 @@
4
4
 
5
5
  import React, { useCallback, useMemo, useRef, useState } from 'react';
6
6
 
7
- import { Surface, type SurfaceComponentProps } from '@dxos/app-framework/react';
7
+ import { Surface } from '@dxos/app-framework/ui';
8
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
8
9
  import { Filter, Obj, Ref } from '@dxos/echo';
9
10
  import { useObject, useObjects } from '@dxos/echo-react';
10
11
  import { invariant } from '@dxos/invariant';
11
12
  import { useQuery } from '@dxos/react-client/echo';
13
+ import { Panel } from '@dxos/react-ui';
12
14
  import { useAttention } from '@dxos/react-ui-attention';
13
15
  import { Board, type BoardController, type BoardRootProps, type Position } from '@dxos/react-ui-board';
14
16
  import { ObjectPicker, type ObjectPickerContentProps } from '@dxos/react-ui-form';
15
- import { Layout } from '@dxos/react-ui-mosaic';
16
17
  import { isNonNullable } from '@dxos/util';
17
18
 
18
- import { type Board as BoardType } from '../types';
19
+ import { type Board as BoardType } from '#types';
19
20
 
20
21
  const DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;
21
22
 
@@ -23,15 +24,14 @@ type PickerState = {
23
24
  position: Position;
24
25
  };
25
26
 
26
- export type BoardContainerProps = SurfaceComponentProps<BoardType.Board>;
27
+ export type BoardContainerProps = AppSurface.ObjectArticleProps<BoardType.Board>;
27
28
 
28
- export const BoardContainer = ({ role, subject: board }: BoardContainerProps) => {
29
+ export const BoardContainer = ({ role, subject: board, attendableId }: BoardContainerProps) => {
29
30
  const controller = useRef<BoardController>(null);
30
31
  const [boardItems] = useObject(board, 'items');
31
32
  const items = useObjects(boardItems ?? []);
32
33
  const addTriggerRef = useRef<HTMLButtonElement | null>(null);
33
34
  const [pickerState, setPickerState] = useState<PickerState | null>(null);
34
- const attendableId = Obj.getDXN(board).toString();
35
35
  const { hasAttention } = useAttention(attendableId);
36
36
 
37
37
  const db = Obj.getDatabase(board);
@@ -73,11 +73,11 @@ export const BoardContainer = ({ role, subject: board }: BoardContainerProps) =>
73
73
  (id) => {
74
74
  // TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.
75
75
  const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);
76
- Obj.change(board, (b) => {
76
+ Obj.change(board, (board) => {
77
77
  if (idx !== -1) {
78
- b.items.splice(idx, 1);
78
+ board.items.splice(idx, 1);
79
79
  }
80
- delete b.layout.cells[id];
80
+ delete board.layout.cells[id];
81
81
  });
82
82
  },
83
83
  [board],
@@ -86,8 +86,8 @@ export const BoardContainer = ({ role, subject: board }: BoardContainerProps) =>
86
86
  const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(
87
87
  (id, position) => {
88
88
  const layout = board.layout.cells[id];
89
- Obj.change(board, (b) => {
90
- b.layout.cells[id] = { ...layout, ...position };
89
+ Obj.change(board, (board) => {
90
+ board.layout.cells[id] = { ...layout, ...position };
91
91
  });
92
92
  },
93
93
  [board],
@@ -106,11 +106,11 @@ export const BoardContainer = ({ role, subject: board }: BoardContainerProps) =>
106
106
  }
107
107
 
108
108
  // Create a reference to the selected object and add it to the board.
109
- Obj.change(board, (b) => {
110
- b.items.push(Ref.make(selectedObject));
109
+ Obj.change(board, (board) => {
110
+ board.items.push(Ref.make(selectedObject));
111
111
 
112
112
  // Set the layout position for the new item.
113
- b.layout.cells[selectedObject.id.toString()] = pickerState.position;
113
+ board.layout.cells[selectedObject.id.toString()] = pickerState.position;
114
114
  });
115
115
 
116
116
  // Close the picker.
@@ -127,22 +127,26 @@ export const BoardContainer = ({ role, subject: board }: BoardContainerProps) =>
127
127
  setPickerState(nextOpen ? { position: DEFAULT_POSITION } : null);
128
128
  }}
129
129
  >
130
- <Layout.Main role={role} toolbar>
131
- <Board.Toolbar disabled={!hasAttention} />
132
- <Board.Container>
133
- <Board.Viewport classNames='border-none'>
134
- <Board.Backdrop />
135
- <Board.Content>
136
- {items?.map((item, index) => (
137
- <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>
138
- <Surface role='card--content' data={{ subject: item }} limit={1} />
139
- </Board.Cell>
140
- ))}
141
- </Board.Content>
142
- </Board.Viewport>
143
- </Board.Container>
144
- </Layout.Main>
145
- <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />
130
+ <Panel.Root role={role}>
131
+ <Panel.Toolbar asChild>
132
+ <Board.Toolbar disabled={!hasAttention} />
133
+ </Panel.Toolbar>
134
+ <Panel.Content asChild>
135
+ <Board.Container>
136
+ <Board.Viewport classNames='border-none'>
137
+ <Board.Backdrop />
138
+ <Board.Content>
139
+ {items?.map((item, index) => (
140
+ <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>
141
+ <Surface.Surface role='card--content' data={{ subject: item }} limit={1} />
142
+ </Board.Cell>
143
+ ))}
144
+ </Board.Content>
145
+ </Board.Viewport>
146
+ </Board.Container>
147
+ </Panel.Content>
148
+ </Panel.Root>
149
+ <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='dx-card-popover-width' />
146
150
  <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />
147
151
  </ObjectPicker.Root>
148
152
  </Board.Root>
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { BoardContainer as default } from './BoardContainer';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const BoardContainer: ComponentType<any> = lazy(() => import('./BoardContainer'));
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './components';
6
5
  export * from './meta';
7
6
  export * from './types';
8
7
 
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/board',
9
+ id: 'org.dxos.plugin.board',
10
10
  name: 'Board',
11
11
  description: trim`
12
12
  Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.
@@ -4,24 +4,25 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
8
- import { Board } from './types';
7
+ import { meta } from '#meta';
8
+ import { Board } from '#types';
9
9
 
10
10
  export const translations = [
11
11
  {
12
12
  'en-US': {
13
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',
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
+ 'add-object.label': 'Add board',
20
+ 'rename-object.label': 'Rename board',
21
+ 'delete-object.label': 'Delete board',
22
+ 'object-deleted.label': 'Board deleted',
22
23
  },
23
24
  [meta.id]: {
24
- 'plugin name': 'Board',
25
+ 'plugin.name': 'Board',
25
26
  },
26
27
  },
27
28
  },
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Obj, Type } from '@dxos/echo';
7
+ import { Annotation, Obj, Ref, Type } from '@dxos/echo';
8
8
  import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
9
  import { BoardLayout, defaultLayout } from '@dxos/react-ui-board';
10
10
 
@@ -13,14 +13,18 @@ import { BoardLayout, defaultLayout } from '@dxos/react-ui-board';
13
13
  */
14
14
  export const Board = Schema.Struct({
15
15
  name: Schema.String.pipe(Schema.optional),
16
- items: Type.Ref(Type.Obj).pipe(Schema.Array, FormInputAnnotation.set(false)),
16
+ items: Ref.Ref(Obj.Unknown).pipe(Schema.Array, FormInputAnnotation.set(false)),
17
17
  layout: BoardLayout.pipe(FormInputAnnotation.set(false)),
18
18
  }).pipe(
19
19
  Type.object({
20
- typename: 'dxos.org/type/Board',
20
+ typename: 'org.dxos.type.board',
21
21
  version: '0.1.0',
22
22
  }),
23
23
  LabelAnnotation.set(['name']),
24
+ Annotation.IconAnnotation.set({
25
+ icon: 'ph--squares-four--regular',
26
+ hue: 'green',
27
+ }),
24
28
  );
25
29
 
26
30
  export interface Board extends Schema.Schema.Type<typeof Board> {}