@dxos/plugin-board 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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 (73) hide show
  1. package/dist/lib/browser/{chunk-2XGWSTZV.mjs → BoardContainer-7XJCGSTI.mjs} +21 -31
  2. package/dist/lib/browser/BoardContainer-7XJCGSTI.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-F24SVFD3.mjs +19 -0
  4. package/dist/lib/browser/chunk-F24SVFD3.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-7VKDDGS7.mjs → chunk-JTC6DTNT.mjs} +7 -9
  8. package/dist/lib/browser/chunk-JTC6DTNT.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +16 -16
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/react-surface-VJMPZ7XG.mjs +39 -0
  13. package/dist/lib/browser/react-surface-VJMPZ7XG.mjs.map +7 -0
  14. package/dist/lib/browser/types/index.mjs +2 -1
  15. package/dist/lib/node-esm/{chunk-JKPYRS2Z.mjs → BoardContainer-KWKFMY3R.mjs} +20 -31
  16. package/dist/lib/node-esm/BoardContainer-KWKFMY3R.mjs.map +7 -0
  17. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  18. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  19. package/dist/lib/node-esm/{chunk-UGVRNKWV.mjs → chunk-P6U47SOA.mjs} +7 -9
  20. package/dist/lib/node-esm/chunk-P6U47SOA.mjs.map +7 -0
  21. package/dist/lib/node-esm/chunk-RIBFHKLN.mjs +21 -0
  22. package/dist/lib/node-esm/chunk-RIBFHKLN.mjs.map +7 -0
  23. package/dist/lib/node-esm/index.mjs +16 -16
  24. package/dist/lib/node-esm/index.mjs.map +3 -3
  25. package/dist/lib/node-esm/meta.json +1 -1
  26. package/dist/lib/node-esm/react-surface-WS7FWTDB.mjs +40 -0
  27. package/dist/lib/node-esm/react-surface-WS7FWTDB.mjs.map +7 -0
  28. package/dist/lib/node-esm/types/index.mjs +2 -1
  29. package/dist/types/src/BoardPlugin.d.ts.map +1 -1
  30. package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
  31. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
  32. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
  33. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
  34. package/dist/types/src/components/index.d.ts +0 -1
  35. package/dist/types/src/components/index.d.ts.map +1 -1
  36. package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts +6 -0
  37. package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts.map +1 -0
  38. package/dist/types/src/{components → containers/BoardContainer}/BoardContainer.stories.d.ts +2 -1
  39. package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts.map +1 -0
  40. package/dist/types/src/containers/BoardContainer/index.d.ts +3 -0
  41. package/dist/types/src/containers/BoardContainer/index.d.ts.map +1 -0
  42. package/dist/types/src/containers/index.d.ts +3 -0
  43. package/dist/types/src/containers/index.d.ts.map +1 -0
  44. package/dist/types/src/index.d.ts +0 -1
  45. package/dist/types/src/index.d.ts.map +1 -1
  46. package/dist/types/src/translations.d.ts +1 -0
  47. package/dist/types/src/translations.d.ts.map +1 -1
  48. package/dist/types/src/types/Board.d.ts +3 -3
  49. package/dist/types/src/types/Board.d.ts.map +1 -1
  50. package/dist/types/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +43 -42
  52. package/src/BoardPlugin.tsx +6 -6
  53. package/src/capabilities/react-surface/react-surface.tsx +10 -6
  54. package/src/components/index.ts +0 -2
  55. package/src/{components → containers/BoardContainer}/BoardContainer.stories.tsx +7 -6
  56. package/src/{components → containers/BoardContainer}/BoardContainer.tsx +25 -21
  57. package/src/containers/BoardContainer/index.ts +7 -0
  58. package/src/containers/index.ts +7 -0
  59. package/src/index.ts +0 -1
  60. package/src/meta.ts +1 -1
  61. package/src/translations.ts +1 -0
  62. package/src/types/Board.ts +3 -3
  63. package/dist/lib/browser/chunk-2XGWSTZV.mjs.map +0 -7
  64. package/dist/lib/browser/chunk-7VKDDGS7.mjs.map +0 -7
  65. package/dist/lib/browser/react-surface-BEYXCLXI.mjs +0 -31
  66. package/dist/lib/browser/react-surface-BEYXCLXI.mjs.map +0 -7
  67. package/dist/lib/node-esm/chunk-JKPYRS2Z.mjs.map +0 -7
  68. package/dist/lib/node-esm/chunk-UGVRNKWV.mjs.map +0 -7
  69. package/dist/lib/node-esm/react-surface-ZFKFUBJM.mjs +0 -32
  70. package/dist/lib/node-esm/react-surface-ZFKFUBJM.mjs.map +0 -7
  71. package/dist/types/src/components/BoardContainer.d.ts +0 -6
  72. package/dist/types/src/components/BoardContainer.d.ts.map +0 -1
  73. package/dist/types/src/components/BoardContainer.stories.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-board",
3
- "version": "0.8.4-main.69d29f4",
3
+ "version": "0.8.4-main.6fa680abb7",
4
4
  "description": "Surface plugin for card baords",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -14,15 +14,15 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
17
+ "source": "./src/index.ts",
17
18
  "browser": "./dist/lib/browser/index.mjs",
18
19
  "node": "./dist/lib/node-esm/index.mjs",
19
- "source": "./src/index.ts",
20
20
  "types": "./dist/types/src/index.d.ts"
21
21
  },
22
22
  "./types": {
23
+ "source": "./src/types/index.ts",
23
24
  "browser": "./dist/lib/browser/types/index.mjs",
24
25
  "node": "./dist/lib/node-esm/types/index.mjs",
25
- "source": "./src/types/index.ts",
26
26
  "types": "./dist/types/src/types/index.d.ts"
27
27
  }
28
28
  },
@@ -39,55 +39,56 @@
39
39
  "src"
40
40
  ],
41
41
  "dependencies": {
42
- "effect": "3.19.11",
43
- "@dxos/ai": "0.8.4-main.69d29f4",
44
- "@dxos/app-framework": "0.8.4-main.69d29f4",
45
- "@dxos/async": "0.8.4-main.69d29f4",
46
- "@dxos/assistant": "0.8.4-main.69d29f4",
47
- "@dxos/blueprints": "0.8.4-main.69d29f4",
48
- "@dxos/echo": "0.8.4-main.69d29f4",
49
- "@dxos/echo-react": "0.8.4-main.69d29f4",
50
- "@dxos/effect": "0.8.4-main.69d29f4",
51
- "@dxos/log": "0.8.4-main.69d29f4",
52
- "@dxos/invariant": "0.8.4-main.69d29f4",
53
- "@dxos/operation": "0.8.4-main.69d29f4",
54
- "@dxos/plugin-client": "0.8.4-main.69d29f4",
55
- "@dxos/plugin-graph": "0.8.4-main.69d29f4",
56
- "@dxos/plugin-search": "0.8.4-main.69d29f4",
57
- "@dxos/plugin-space": "0.8.4-main.69d29f4",
58
- "@dxos/client": "0.8.4-main.69d29f4",
59
- "@dxos/react-client": "0.8.4-main.69d29f4",
60
- "@dxos/react-ui": "0.8.4-main.69d29f4",
61
- "@dxos/random": "0.8.4-main.69d29f4",
62
- "@dxos/react-ui-attention": "0.8.4-main.69d29f4",
63
- "@dxos/react-ui-board": "0.8.4-main.69d29f4",
64
- "@dxos/react-ui-form": "0.8.4-main.69d29f4",
65
- "@dxos/react-ui-stack": "0.8.4-main.69d29f4",
66
- "@dxos/react-ui-mosaic": "0.8.4-main.69d29f4",
67
- "@dxos/schema": "0.8.4-main.69d29f4",
68
- "@dxos/types": "0.8.4-main.69d29f4",
69
- "@dxos/util": "0.8.4-main.69d29f4"
42
+ "effect": "3.19.16",
43
+ "@dxos/ai": "0.8.4-main.6fa680abb7",
44
+ "@dxos/app-framework": "0.8.4-main.6fa680abb7",
45
+ "@dxos/app-toolkit": "0.8.4-main.6fa680abb7",
46
+ "@dxos/assistant": "0.8.4-main.6fa680abb7",
47
+ "@dxos/blueprints": "0.8.4-main.6fa680abb7",
48
+ "@dxos/client": "0.8.4-main.6fa680abb7",
49
+ "@dxos/echo": "0.8.4-main.6fa680abb7",
50
+ "@dxos/echo-react": "0.8.4-main.6fa680abb7",
51
+ "@dxos/async": "0.8.4-main.6fa680abb7",
52
+ "@dxos/effect": "0.8.4-main.6fa680abb7",
53
+ "@dxos/invariant": "0.8.4-main.6fa680abb7",
54
+ "@dxos/operation": "0.8.4-main.6fa680abb7",
55
+ "@dxos/plugin-graph": "0.8.4-main.6fa680abb7",
56
+ "@dxos/plugin-client": "0.8.4-main.6fa680abb7",
57
+ "@dxos/plugin-search": "0.8.4-main.6fa680abb7",
58
+ "@dxos/random": "0.8.4-main.6fa680abb7",
59
+ "@dxos/react-client": "0.8.4-main.6fa680abb7",
60
+ "@dxos/react-ui-attention": "0.8.4-main.6fa680abb7",
61
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
62
+ "@dxos/plugin-space": "0.8.4-main.6fa680abb7",
63
+ "@dxos/log": "0.8.4-main.6fa680abb7",
64
+ "@dxos/react-ui-board": "0.8.4-main.6fa680abb7",
65
+ "@dxos/react-ui-form": "0.8.4-main.6fa680abb7",
66
+ "@dxos/react-ui-stack": "0.8.4-main.6fa680abb7",
67
+ "@dxos/types": "0.8.4-main.6fa680abb7",
68
+ "@dxos/schema": "0.8.4-main.6fa680abb7",
69
+ "@dxos/util": "0.8.4-main.6fa680abb7",
70
+ "@dxos/react-ui-mosaic": "0.8.4-main.6fa680abb7"
70
71
  },
71
72
  "devDependencies": {
72
73
  "@types/react": "~19.2.7",
73
74
  "@types/react-dom": "~19.2.3",
74
75
  "react": "~19.2.3",
75
76
  "react-dom": "~19.2.3",
76
- "vite": "7.1.9",
77
- "@dxos/plugin-testing": "0.8.4-main.69d29f4",
78
- "@dxos/plugin-preview": "0.8.4-main.69d29f4",
79
- "@dxos/plugin-theme": "0.8.4-main.69d29f4",
80
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.69d29f4",
81
- "@dxos/storybook-utils": "0.8.4-main.69d29f4",
82
- "@dxos/test-utils": "0.8.4-main.69d29f4",
83
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
77
+ "vite": "^7.1.11",
78
+ "@dxos/plugin-testing": "0.8.4-main.6fa680abb7",
79
+ "@dxos/plugin-preview": "0.8.4-main.6fa680abb7",
80
+ "@dxos/plugin-theme": "0.8.4-main.6fa680abb7",
81
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.6fa680abb7",
82
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
83
+ "@dxos/test-utils": "0.8.4-main.6fa680abb7",
84
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
84
85
  },
85
86
  "peerDependencies": {
86
- "effect": "3.19.11",
87
+ "effect": "3.19.16",
87
88
  "react": "~19.2.3",
88
89
  "react-dom": "~19.2.3",
89
- "@dxos/react-ui": "0.8.4-main.69d29f4",
90
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
90
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
91
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
91
92
  },
92
93
  "publishConfig": {
93
94
  "access": "public"
@@ -4,7 +4,8 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Common, Plugin } from '@dxos/app-framework';
7
+ import { Plugin } from '@dxos/app-framework';
8
+ import { AppPlugin } from '@dxos/app-toolkit';
8
9
  import { type CreateObject } from '@dxos/plugin-space/types';
9
10
  import { translations as boardTranslations } from '@dxos/react-ui-board';
10
11
 
@@ -14,19 +15,18 @@ import { translations } from './translations';
14
15
  import { Board } from './types';
15
16
 
16
17
  export const BoardPlugin = Plugin.define(meta).pipe(
17
- Common.Plugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
18
- Common.Plugin.addMetadataModule({
18
+ AppPlugin.addMetadataModule({
19
19
  metadata: {
20
20
  id: Board.Board.typename,
21
21
  metadata: {
22
22
  icon: 'ph--squares-four--regular',
23
23
  iconHue: 'green',
24
24
  createObject: ((props) => Effect.sync(() => Board.makeBoard(props))) satisfies CreateObject,
25
- addToCollectionOnCreate: true,
26
25
  },
27
26
  },
28
27
  }),
29
- Common.Plugin.addSchemaModule({ schema: [Board.Board] }),
30
- Common.Plugin.addSurfaceModule({ activate: ReactSurface }),
28
+ AppPlugin.addSchemaModule({ schema: [Board.Board] }),
29
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
30
+ AppPlugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
31
31
  Plugin.make,
32
32
  );
@@ -5,21 +5,25 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
  import React from 'react';
7
7
 
8
- import { Capability, Common } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
9
10
  import { Obj } from '@dxos/echo';
10
11
 
11
- import { BoardContainer } from '../../components';
12
+ import { BoardContainer } from '../../containers';
12
13
  import { meta } from '../../meta';
13
14
  import { Board } from '../../types';
14
15
 
15
16
  export default Capability.makeModule(() =>
16
17
  Effect.succeed(
17
- Capability.contributes(Common.Capability.ReactSurface, [
18
- Common.createSurface({
18
+ Capability.contributes(Capabilities.ReactSurface, [
19
+ Surface.create({
19
20
  id: meta.id,
20
21
  role: ['article', 'section'],
21
- filter: (data): data is { subject: Board.Board } => Obj.instanceOf(Board.Board, data.subject),
22
- component: ({ role, data }) => <BoardContainer role={role} subject={data.subject} />,
22
+ filter: (data): data is { attendableId: string; subject: Board.Board } =>
23
+ typeof data.attendableId === 'string' && Obj.instanceOf(Board.Board, data.subject),
24
+ component: ({ role, data }) => (
25
+ <BoardContainer role={role} subject={data.subject} attendableId={data.attendableId} />
26
+ ),
23
27
  }),
24
28
  ]),
25
29
  ),
@@ -1,5 +1,3 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
-
5
- export * from './BoardContainer';
@@ -13,12 +13,12 @@ import { PreviewPlugin } from '@dxos/plugin-preview';
13
13
  import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
14
14
  import { faker } from '@dxos/random';
15
15
  import { Filter, Ref, useQuery, useSpaces } from '@dxos/react-client/echo';
16
- import { withTheme } from '@dxos/react-ui/testing';
16
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
17
  import { translations as stackTranslations } from '@dxos/react-ui-stack';
18
18
  import { Organization, Person } from '@dxos/types';
19
19
 
20
- import { translations } from '../translations';
21
- import { Board } from '../types';
20
+ import { translations } from '../../translations';
21
+ import { Board } from '../../types';
22
22
 
23
23
  import { BoardContainer } from './BoardContainer';
24
24
 
@@ -61,7 +61,7 @@ const DefaultStory = () => {
61
61
  return null;
62
62
  }
63
63
 
64
- return <BoardContainer role='board' subject={board} />;
64
+ return <BoardContainer role='board' subject={board} attendableId='test' />;
65
65
  };
66
66
 
67
67
  //
@@ -69,10 +69,11 @@ const DefaultStory = () => {
69
69
  //
70
70
 
71
71
  const meta = {
72
- title: 'plugins/plugin-board/Board',
72
+ title: 'plugins/plugin-board/containers/BoardContainer',
73
73
  render: DefaultStory,
74
74
  decorators: [
75
- withTheme,
75
+ withTheme(),
76
+ withLayout({ layout: 'fullscreen' }),
76
77
  withPluginManager({
77
78
  plugins: [
78
79
  ...corePlugins(),
@@ -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 SurfaceComponentProps } 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
 
@@ -25,13 +26,12 @@ type PickerState = {
25
26
 
26
27
  export type BoardContainerProps = SurfaceComponentProps<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);
@@ -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,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { BoardContainer } from './BoardContainer';
6
+
7
+ export default 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.
@@ -16,6 +16,7 @@ export const translations = [
16
16
  'typename label_one': 'Board',
17
17
  'typename label_other': 'Boards',
18
18
  'object name placeholder': 'New board',
19
+ 'add object label': 'Add board',
19
20
  'rename object label': 'Rename board',
20
21
  'delete object label': 'Delete board',
21
22
  'object deleted label': 'Board deleted',
@@ -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 { 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,11 +13,11 @@ 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']),
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/BoardContainer.tsx", "../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Surface, type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Filter, Obj, Ref } from '@dxos/echo';\nimport { useObject, useObjects } from '@dxos/echo-react';\nimport { invariant } from '@dxos/invariant';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { Board, type BoardController, type BoardRootProps, type Position } from '@dxos/react-ui-board';\nimport { ObjectPicker, type ObjectPickerContentProps } from '@dxos/react-ui-form';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type Board as BoardType } from '../types';\n\nconst DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;\n\ntype PickerState = {\n position: Position;\n};\n\nexport type BoardContainerProps = SurfaceComponentProps<BoardType.Board>;\n\nexport const BoardContainer = ({ role, subject: board }: BoardContainerProps) => {\n const controller = useRef<BoardController>(null);\n const [boardItems] = useObject(board, 'items');\n const items = useObjects(boardItems ?? []);\n const addTriggerRef = useRef<HTMLButtonElement | null>(null);\n const [pickerState, setPickerState] = useState<PickerState | null>(null);\n const attendableId = Obj.getDXN(board).toString();\n const { hasAttention } = useAttention(attendableId);\n\n const db = Obj.getDatabase(board);\n // TODO(burdon): Use search.\n const objects = useQuery(db, Filter.everything());\n const options = useMemo<ObjectPickerContentProps['options']>(\n () =>\n objects\n .filter((obj) => obj.id !== board.id)\n .map((obj) => {\n const label = Obj.getLabel(obj);\n if (label) {\n return {\n id: obj.id,\n label,\n hue: 'neutral' as const,\n };\n }\n })\n .filter(isNonNullable)\n .sort(({ label: a }, { label: b }) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),\n [objects],\n );\n\n const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(\n async (anchor, position = DEFAULT_POSITION) => {\n const db = Obj.getDatabase(board);\n invariant(db);\n addTriggerRef.current = anchor;\n setPickerState({\n position,\n });\n },\n [board],\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 Obj.change(board, (b) => {\n if (idx !== -1) {\n b.items.splice(idx, 1);\n }\n delete b.layout.cells[id];\n });\n },\n [board],\n );\n\n const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(\n (id, position) => {\n const layout = board.layout.cells[id];\n Obj.change(board, (b) => {\n b.layout.cells[id] = { ...layout, ...position };\n });\n },\n [board],\n );\n\n const handleSelect = useCallback<NonNullable<ObjectPickerContentProps['onSelect']>>(\n (id) => {\n if (!pickerState) {\n return;\n }\n\n // Find the selected object by id from the space.\n const selectedObject = objects.find((obj) => obj.id === id);\n if (!Obj.isObject(selectedObject)) {\n return;\n }\n\n // Create a reference to the selected object and add it to the board.\n Obj.change(board, (b) => {\n b.items.push(Ref.make(selectedObject));\n\n // Set the layout position for the new item.\n b.layout.cells[selectedObject.id.toString()] = pickerState.position;\n });\n\n // Close the picker.\n setPickerState(null);\n },\n [pickerState, objects, board],\n );\n\n return (\n <Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>\n <ObjectPicker.Root\n open={!!pickerState}\n onOpenChange={(nextOpen: boolean) => {\n setPickerState(nextOpen ? { position: DEFAULT_POSITION } : null);\n }}\n >\n <Layout.Main role={role} toolbar>\n <Board.Toolbar disabled={!hasAttention} />\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--content' data={{ subject: item }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </Layout.Main>\n <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />\n <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />\n </ObjectPicker.Root>\n </Board.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/board',\n name: 'Board',\n description: trim`\n Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.\n Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.\n `,\n icon: 'ph--squares-four--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',\n screenshots: [],\n};\n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
6
- "names": ["React", "useCallback", "useMemo", "useRef", "useState", "Surface", "Filter", "Obj", "Ref", "useObject", "useObjects", "invariant", "useQuery", "useAttention", "Board", "ObjectPicker", "Layout", "isNonNullable", "DEFAULT_POSITION", "x", "y", "BoardContainer", "role", "subject", "board", "controller", "boardItems", "items", "addTriggerRef", "pickerState", "setPickerState", "attendableId", "getDXN", "toString", "hasAttention", "db", "getDatabase", "objects", "everything", "options", "filter", "obj", "id", "map", "label", "getLabel", "hue", "sort", "a", "b", "toLocaleLowerCase", "localeCompare", "handleAdd", "anchor", "position", "current", "handleDelete", "idx", "findIndex", "ref", "dxn", "asEchoDXN", "echoId", "change", "splice", "layout", "cells", "handleMove", "handleSelect", "selectedObject", "find", "isObject", "push", "make", "Root", "onAdd", "onDelete", "onMove", "open", "onOpenChange", "nextOpen", "Main", "toolbar", "Toolbar", "disabled", "Container", "Viewport", "classNames", "Backdrop", "Content", "item", "index", "Cell", "key", "data", "limit", "onSelect", "VirtualTrigger", "virtualRef", "trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Board.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { BoardLayout, defaultLayout } from '@dxos/react-ui-board';\n\n/**\n * Board and layout.\n */\nexport const Board = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n items: Type.Ref(Type.Obj).pipe(Schema.Array, FormInputAnnotation.set(false)),\n layout: BoardLayout.pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/Board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport interface Board extends Schema.Schema.Type<typeof Board> {}\n\nexport const makeBoard = (props: Partial<Obj.MakeProps<typeof Board>> = {}) =>\n Obj.make(Board, {\n items: [],\n layout: defaultLayout,\n ...props,\n });\n"],
5
- "mappings": ";;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,aAAaC,qBAAqB;AAKpC,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,OAAOC,KAAKC,IAAID,KAAKE,GAAG,EAAEL,KAAYM,cAAOC,oBAAoBC,IAAI,KAAA,CAAA;EACrEC,QAAQC,YAAYV,KAAKO,oBAAoBC,IAAI,KAAA,CAAA;AACnD,CAAA,EAAGR,KACDG,KAAKQ,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBN,IAAI;EAAC;CAAO,CAAA;AAKvB,IAAMO,YAAY,CAACC,QAA8C,CAAC,MACvEX,IAAIY,KAAKrB,OAAO;EACdM,OAAO,CAAA;EACPO,QAAQS;EACR,GAAGF;AACL,CAAA;",
6
- "names": ["Schema", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Type", "Ref", "Obj", "Array", "FormInputAnnotation", "set", "layout", "BoardLayout", "object", "typename", "version", "LabelAnnotation", "makeBoard", "props", "make", "defaultLayout"]
7
- }
@@ -1,31 +0,0 @@
1
- import {
2
- BoardContainer,
3
- meta
4
- } from "./chunk-2XGWSTZV.mjs";
5
- import {
6
- Board_exports
7
- } from "./chunk-7VKDDGS7.mjs";
8
-
9
- // src/capabilities/react-surface/react-surface.tsx
10
- import * as Effect from "effect/Effect";
11
- import React from "react";
12
- import { Capability, Common } from "@dxos/app-framework";
13
- import { Obj } from "@dxos/echo";
14
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
15
- Common.createSurface({
16
- id: meta.id,
17
- role: [
18
- "article",
19
- "section"
20
- ],
21
- filter: (data) => Obj.instanceOf(Board_exports.Board, data.subject),
22
- component: ({ role, data }) => /* @__PURE__ */ React.createElement(BoardContainer, {
23
- role,
24
- subject: data.subject
25
- })
26
- })
27
- ])));
28
- export {
29
- react_surface_default as default
30
- };
31
- //# sourceMappingURL=react-surface-BEYXCLXI.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } 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 Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.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: ({ role, data }) => <BoardContainer role={role} subject={data.subject} />,\n }),\n ]),\n ),\n);\n"],
5
- "mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AAMpB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAA2CC,IAAIC,WAAWC,cAAMA,OAAOH,KAAKI,OAAO;IAC5FC,WAAW,CAAC,EAAEP,MAAME,KAAI,MAAO,sBAAA,cAACM,gBAAAA;MAAeR;MAAYM,SAASJ,KAAKI;;EAC3E,CAAA;CACD,CAAA,CAAA;",
6
- "names": ["Effect", "React", "Capability", "Common", "Obj", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Board", "subject", "component", "BoardContainer"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/BoardContainer.tsx", "../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Surface, type SurfaceComponentProps } from '@dxos/app-framework/react';\nimport { Filter, Obj, Ref } from '@dxos/echo';\nimport { useObject, useObjects } from '@dxos/echo-react';\nimport { invariant } from '@dxos/invariant';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { useAttention } from '@dxos/react-ui-attention';\nimport { Board, type BoardController, type BoardRootProps, type Position } from '@dxos/react-ui-board';\nimport { ObjectPicker, type ObjectPickerContentProps } from '@dxos/react-ui-form';\nimport { Layout } from '@dxos/react-ui-mosaic';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type Board as BoardType } from '../types';\n\nconst DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;\n\ntype PickerState = {\n position: Position;\n};\n\nexport type BoardContainerProps = SurfaceComponentProps<BoardType.Board>;\n\nexport const BoardContainer = ({ role, subject: board }: BoardContainerProps) => {\n const controller = useRef<BoardController>(null);\n const [boardItems] = useObject(board, 'items');\n const items = useObjects(boardItems ?? []);\n const addTriggerRef = useRef<HTMLButtonElement | null>(null);\n const [pickerState, setPickerState] = useState<PickerState | null>(null);\n const attendableId = Obj.getDXN(board).toString();\n const { hasAttention } = useAttention(attendableId);\n\n const db = Obj.getDatabase(board);\n // TODO(burdon): Use search.\n const objects = useQuery(db, Filter.everything());\n const options = useMemo<ObjectPickerContentProps['options']>(\n () =>\n objects\n .filter((obj) => obj.id !== board.id)\n .map((obj) => {\n const label = Obj.getLabel(obj);\n if (label) {\n return {\n id: obj.id,\n label,\n hue: 'neutral' as const,\n };\n }\n })\n .filter(isNonNullable)\n .sort(({ label: a }, { label: b }) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),\n [objects],\n );\n\n const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(\n async (anchor, position = DEFAULT_POSITION) => {\n const db = Obj.getDatabase(board);\n invariant(db);\n addTriggerRef.current = anchor;\n setPickerState({\n position,\n });\n },\n [board],\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 Obj.change(board, (b) => {\n if (idx !== -1) {\n b.items.splice(idx, 1);\n }\n delete b.layout.cells[id];\n });\n },\n [board],\n );\n\n const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(\n (id, position) => {\n const layout = board.layout.cells[id];\n Obj.change(board, (b) => {\n b.layout.cells[id] = { ...layout, ...position };\n });\n },\n [board],\n );\n\n const handleSelect = useCallback<NonNullable<ObjectPickerContentProps['onSelect']>>(\n (id) => {\n if (!pickerState) {\n return;\n }\n\n // Find the selected object by id from the space.\n const selectedObject = objects.find((obj) => obj.id === id);\n if (!Obj.isObject(selectedObject)) {\n return;\n }\n\n // Create a reference to the selected object and add it to the board.\n Obj.change(board, (b) => {\n b.items.push(Ref.make(selectedObject));\n\n // Set the layout position for the new item.\n b.layout.cells[selectedObject.id.toString()] = pickerState.position;\n });\n\n // Close the picker.\n setPickerState(null);\n },\n [pickerState, objects, board],\n );\n\n return (\n <Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>\n <ObjectPicker.Root\n open={!!pickerState}\n onOpenChange={(nextOpen: boolean) => {\n setPickerState(nextOpen ? { position: DEFAULT_POSITION } : null);\n }}\n >\n <Layout.Main role={role} toolbar>\n <Board.Toolbar disabled={!hasAttention} />\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--content' data={{ subject: item }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </Layout.Main>\n <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />\n <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />\n </ObjectPicker.Root>\n </Board.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/board',\n name: 'Board',\n description: trim`\n Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.\n Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.\n `,\n icon: 'ph--squares-four--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',\n screenshots: [],\n};\n"],
5
- "mappings": ";;;AAIA,OAAOA,SAASC,aAAaC,SAASC,QAAQC,gBAAgB;AAE9D,SAASC,eAA2C;AACpD,SAASC,QAAQC,KAAKC,WAAW;AACjC,SAASC,WAAWC,kBAAkB;AACtC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,oBAAoB;AAC7B,SAASC,aAAuE;AAChF,SAASC,oBAAmD;AAC5D,SAASC,cAAc;AACvB,SAASC,qBAAqB;;AAI9B,IAAMC,mBAAmB;EAAEC,GAAG;EAAGC,GAAG;AAAE;AAQ/B,IAAMC,iBAAiB,CAAC,EAAEC,MAAMC,SAASC,MAAK,MAAuB;AAC1E,QAAMC,aAAatB,OAAwB,IAAA;AAC3C,QAAM,CAACuB,UAAAA,IAAcjB,UAAUe,OAAO,OAAA;AACtC,QAAMG,QAAQjB,WAAWgB,cAAc,CAAA,CAAE;AACzC,QAAME,gBAAgBzB,OAAiC,IAAA;AACvD,QAAM,CAAC0B,aAAaC,cAAAA,IAAk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UAAQ,IAAA,GACf,sBAAA,cAAC1E,MAAM2E,SAAO,MACX9D,OAAOgB,IAAI,CAAC+C,MAAMC,UACjB,sBAAA,cAAC7E,MAAM8E,MAAI;IAACF;IAAYG,KAAKF;IAAO1B,QAAQzC,MAAMyC,QAAQC,MAAMwB,KAAKhD,EAAE,KAAK;MAAEvB,GAAG;MAAGC,GAAG;IAAE;KACvF,sBAAA,cAACf,SAAAA;IAAQiB,MAAK;IAAgBwE,MAAM;MAAEvE,SAASmE;IAAK;IAAGK,OAAO;YAO1E,sBAAA,cAAChF,aAAa0E,SAAO;IAAClD;IAAkByD,UAAU5B;IAAcmB,YAAW;MAC3E,sBAAA,cAACxE,aAAakF,gBAAc;IAACC,YAAYtE;;AAIjD;;;AChJA,SAASuE,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;AACf;",
6
- "names": ["React", "useCallback", "useMemo", "useRef", "useState", "Surface", "Filter", "Obj", "Ref", "useObject", "useObjects", "invariant", "useQuery", "useAttention", "Board", "ObjectPicker", "Layout", "isNonNullable", "DEFAULT_POSITION", "x", "y", "BoardContainer", "role", "subject", "board", "controller", "boardItems", "items", "addTriggerRef", "pickerState", "setPickerState", "attendableId", "getDXN", "toString", "hasAttention", "db", "getDatabase", "objects", "everything", "options", "filter", "obj", "id", "map", "label", "getLabel", "hue", "sort", "a", "b", "toLocaleLowerCase", "localeCompare", "handleAdd", "anchor", "position", "current", "handleDelete", "idx", "findIndex", "ref", "dxn", "asEchoDXN", "echoId", "change", "splice", "layout", "cells", "handleMove", "handleSelect", "selectedObject", "find", "isObject", "push", "make", "Root", "onAdd", "onDelete", "onMove", "open", "onOpenChange", "nextOpen", "Main", "toolbar", "Toolbar", "disabled", "Container", "Viewport", "classNames", "Backdrop", "Content", "item", "index", "Cell", "key", "data", "limit", "onSelect", "VirtualTrigger", "virtualRef", "trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Board.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { BoardLayout, defaultLayout } from '@dxos/react-ui-board';\n\n/**\n * Board and layout.\n */\nexport const Board = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n items: Type.Ref(Type.Obj).pipe(Schema.Array, FormInputAnnotation.set(false)),\n layout: BoardLayout.pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/Board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport interface Board extends Schema.Schema.Type<typeof Board> {}\n\nexport const makeBoard = (props: Partial<Obj.MakeProps<typeof Board>> = {}) =>\n Obj.make(Board, {\n items: [],\n layout: defaultLayout,\n ...props,\n });\n"],
5
- "mappings": ";;;;;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,aAAaC,qBAAqB;AAKpC,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,OAAOC,KAAKC,IAAID,KAAKE,GAAG,EAAEL,KAAYM,cAAOC,oBAAoBC,IAAI,KAAA,CAAA;EACrEC,QAAQC,YAAYV,KAAKO,oBAAoBC,IAAI,KAAA,CAAA;AACnD,CAAA,EAAGR,KACDG,KAAKQ,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBN,IAAI;EAAC;CAAO,CAAA;AAKvB,IAAMO,YAAY,CAACC,QAA8C,CAAC,MACvEX,IAAIY,KAAKrB,OAAO;EACdM,OAAO,CAAA;EACPO,QAAQS;EACR,GAAGF;AACL,CAAA;",
6
- "names": ["Schema", "Obj", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Type", "Ref", "Obj", "Array", "FormInputAnnotation", "set", "layout", "BoardLayout", "object", "typename", "version", "LabelAnnotation", "makeBoard", "props", "make", "defaultLayout"]
7
- }
@@ -1,32 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- BoardContainer,
4
- meta
5
- } from "./chunk-JKPYRS2Z.mjs";
6
- import {
7
- Board_exports
8
- } from "./chunk-UGVRNKWV.mjs";
9
-
10
- // src/capabilities/react-surface/react-surface.tsx
11
- import * as Effect from "effect/Effect";
12
- import React from "react";
13
- import { Capability, Common } from "@dxos/app-framework";
14
- import { Obj } from "@dxos/echo";
15
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
16
- Common.createSurface({
17
- id: meta.id,
18
- role: [
19
- "article",
20
- "section"
21
- ],
22
- filter: (data) => Obj.instanceOf(Board_exports.Board, data.subject),
23
- component: ({ role, data }) => /* @__PURE__ */ React.createElement(BoardContainer, {
24
- role,
25
- subject: data.subject
26
- })
27
- })
28
- ])));
29
- export {
30
- react_surface_default as default
31
- };
32
- //# sourceMappingURL=react-surface-ZFKFUBJM.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/react-surface/react-surface.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capability, Common } 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 Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.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: ({ role, data }) => <BoardContainer role={role} subject={data.subject} />,\n }),\n ]),\n ),\n);\n"],
5
- "mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AAMpB,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAA2CC,IAAIC,WAAWC,cAAMA,OAAOH,KAAKI,OAAO;IAC5FC,WAAW,CAAC,EAAEP,MAAME,KAAI,MAAO,sBAAA,cAACM,gBAAAA;MAAeR;MAAYM,SAASJ,KAAKI;;EAC3E,CAAA;CACD,CAAA,CAAA;",
6
- "names": ["Effect", "React", "Capability", "Common", "Obj", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Board", "subject", "component", "BoardContainer"]
7
- }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { type SurfaceComponentProps } from '@dxos/app-framework/react';
3
- import { type Board as BoardType } from '../types';
4
- export type BoardContainerProps = SurfaceComponentProps<BoardType.Board>;
5
- export declare const BoardContainer: ({ role, subject: board }: BoardContainerProps) => React.JSX.Element;
6
- //# sourceMappingURL=BoardContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BoardContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/BoardContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAW,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAWhF,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAQnD,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAEzE,eAAO,MAAM,cAAc,GAAI,0BAA0B,mBAAmB,sBA0H3E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BoardContainer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/BoardContainer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAcnD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAkDjC,QAAA,MAAM,IAAI;;;;;;;;yBA9DG,CAAQ,KAAK,CAAC,KAAK,CAAE,QAAO,CAAC;;;;;;;;;;yBAO5B,CAAQ,IAAI,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CAmG7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}