@dxos/plugin-board 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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/BoardPlugin-MKXIWHZQ.mjs +50 -0
- package/dist/lib/browser/BoardPlugin-MKXIWHZQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +6 -71
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +29 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +31 -2
- package/dist/lib/browser/types/index.mjs.map +4 -4
- package/dist/lib/node-esm/BoardPlugin-FQMGBWI6.mjs +51 -0
- package/dist/lib/node-esm/BoardPlugin-FQMGBWI6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +6 -71
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +30 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +31 -2
- package/dist/lib/node-esm/types/index.mjs.map +4 -4
- package/dist/types/src/BoardPlugin.d.ts +1 -0
- package/dist/types/src/BoardPlugin.d.ts.map +1 -1
- package/dist/types/src/BoardPlugin.test.d.ts +2 -0
- package/dist/types/src/BoardPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts +1 -1
- package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts.map +1 -1
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts +30 -23
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +22 -15
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Board.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -46
- package/src/BoardPlugin.test.ts +27 -0
- package/src/BoardPlugin.tsx +5 -4
- package/src/capabilities/react-surface.tsx +4 -2
- package/src/containers/BoardContainer/BoardContainer.stories.tsx +3 -3
- package/src/containers/BoardContainer/BoardContainer.tsx +43 -14
- package/src/index.ts +6 -3
- package/dist/lib/browser/chunk-FL67SBF5.mjs +0 -39
- package/dist/lib/browser/chunk-FL67SBF5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5GGKJL4Z.mjs +0 -40
- package/dist/lib/node-esm/chunk-5GGKJL4Z.mjs.map +0 -7
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.abd8ff62ef",
|
|
4
4
|
"description": "Surface plugin for card baords",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
+
"#plugin": "./src/BoardPlugin.tsx",
|
|
16
17
|
"#capabilities": "./src/capabilities/index.ts",
|
|
17
18
|
"#components": "./src/components/index.ts",
|
|
18
19
|
"#containers": "./src/containers/index.ts",
|
|
19
20
|
"#meta": "./src/meta.ts",
|
|
21
|
+
"#translations": "./src/translations.ts",
|
|
20
22
|
"#types": "./src/types/index.ts"
|
|
21
23
|
},
|
|
22
24
|
"exports": {
|
|
@@ -26,6 +28,12 @@
|
|
|
26
28
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
27
29
|
"types": "./dist/types/src/index.d.ts"
|
|
28
30
|
},
|
|
31
|
+
"./translations": {
|
|
32
|
+
"source": "./src/translations.ts",
|
|
33
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
34
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
35
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
36
|
+
},
|
|
29
37
|
"./types": {
|
|
30
38
|
"source": "./src/types/index.ts",
|
|
31
39
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
@@ -34,68 +42,64 @@
|
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
"types": "dist/types/src/index.d.ts",
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {
|
|
39
|
-
"types": [
|
|
40
|
-
"dist/types/src/types/index.d.ts"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
45
|
"files": [
|
|
45
46
|
"dist",
|
|
46
47
|
"src"
|
|
47
48
|
],
|
|
48
49
|
"dependencies": {
|
|
50
|
+
"@effect-atom/atom": "^0.5.1",
|
|
51
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
49
52
|
"effect": "3.20.0",
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/echo": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/effect": "0.8.4-main.
|
|
61
|
-
"@dxos/log": "0.8.4-main.
|
|
62
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/react-
|
|
70
|
-
"@dxos/react-ui
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
53
|
+
"@dxos/app-framework": "0.8.4-main.abd8ff62ef",
|
|
54
|
+
"@dxos/ai": "0.8.4-main.abd8ff62ef",
|
|
55
|
+
"@dxos/assistant": "0.8.4-main.abd8ff62ef",
|
|
56
|
+
"@dxos/async": "0.8.4-main.abd8ff62ef",
|
|
57
|
+
"@dxos/client": "0.8.4-main.abd8ff62ef",
|
|
58
|
+
"@dxos/compute": "0.8.4-main.abd8ff62ef",
|
|
59
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
60
|
+
"@dxos/echo-atom": "0.8.4-main.abd8ff62ef",
|
|
61
|
+
"@dxos/echo-react": "0.8.4-main.abd8ff62ef",
|
|
62
|
+
"@dxos/invariant": "0.8.4-main.abd8ff62ef",
|
|
63
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
64
|
+
"@dxos/log": "0.8.4-main.abd8ff62ef",
|
|
65
|
+
"@dxos/plugin-client": "0.8.4-main.abd8ff62ef",
|
|
66
|
+
"@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/plugin-markdown": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/plugin-space": "0.8.4-main.abd8ff62ef",
|
|
70
|
+
"@dxos/random": "0.8.4-main.abd8ff62ef",
|
|
71
|
+
"@dxos/plugin-search": "0.8.4-main.abd8ff62ef",
|
|
72
|
+
"@dxos/react-client": "0.8.4-main.abd8ff62ef",
|
|
73
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
74
|
+
"@dxos/react-ui-attention": "0.8.4-main.abd8ff62ef",
|
|
75
|
+
"@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
|
|
76
|
+
"@dxos/react-ui-board": "0.8.4-main.abd8ff62ef",
|
|
77
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.abd8ff62ef",
|
|
78
|
+
"@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
|
|
79
|
+
"@dxos/schema": "0.8.4-main.abd8ff62ef",
|
|
80
|
+
"@dxos/types": "0.8.4-main.abd8ff62ef",
|
|
81
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef"
|
|
78
82
|
},
|
|
79
83
|
"devDependencies": {
|
|
80
84
|
"@types/react": "~19.2.7",
|
|
81
85
|
"@types/react-dom": "~19.2.3",
|
|
82
86
|
"react": "~19.2.3",
|
|
83
87
|
"react-dom": "~19.2.3",
|
|
84
|
-
"vite": "^
|
|
85
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
86
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
87
|
-
"@dxos/
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
91
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
88
|
+
"vite": "^8.0.10",
|
|
89
|
+
"@dxos/plugin-preview": "0.8.4-main.abd8ff62ef",
|
|
90
|
+
"@dxos/plugin-testing": "0.8.4-main.abd8ff62ef",
|
|
91
|
+
"@dxos/plugin-theme": "0.8.4-main.abd8ff62ef",
|
|
92
|
+
"@dxos/storybook-utils": "0.8.4-main.abd8ff62ef",
|
|
93
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.abd8ff62ef",
|
|
94
|
+
"@dxos/test-utils": "0.8.4-main.abd8ff62ef",
|
|
95
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
92
96
|
},
|
|
93
97
|
"peerDependencies": {
|
|
94
98
|
"effect": "3.20.0",
|
|
95
99
|
"react": "~19.2.3",
|
|
96
100
|
"react-dom": "~19.2.3",
|
|
97
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
98
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
101
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
102
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
99
103
|
},
|
|
100
104
|
"publishConfig": {
|
|
101
105
|
"access": "public"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
8
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
|
+
|
|
10
|
+
import { BoardPlugin } from '#plugin';
|
|
11
|
+
|
|
12
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('BoardPlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), BoardPlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Modules expected to be active after a normal startup.
|
|
23
|
+
expect(harness.manager.getActive()).toEqual(
|
|
24
|
+
expect.arrayContaining([moduleId('metadata'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/BoardPlugin.tsx
CHANGED
|
@@ -7,18 +7,17 @@ import * as Option from 'effect/Option';
|
|
|
7
7
|
|
|
8
8
|
import { Plugin } from '@dxos/app-framework';
|
|
9
9
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Annotation } from '@dxos/echo';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
12
|
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
13
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
|
-
import { translations as boardTranslations } from '@dxos/react-ui-board';
|
|
14
|
+
import { translations as boardTranslations } from '@dxos/react-ui-board/translations';
|
|
15
15
|
|
|
16
16
|
import { ReactSurface } from '#capabilities';
|
|
17
17
|
import { meta } from '#meta';
|
|
18
|
+
import { translations } from '#translations';
|
|
18
19
|
import { Board } from '#types';
|
|
19
20
|
|
|
20
|
-
import { translations } from './translations';
|
|
21
|
-
|
|
22
21
|
export const BoardPlugin = Plugin.define(meta).pipe(
|
|
23
22
|
AppPlugin.addMetadataModule({
|
|
24
23
|
metadata: {
|
|
@@ -44,3 +43,5 @@ export const BoardPlugin = Plugin.define(meta).pipe(
|
|
|
44
43
|
AppPlugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),
|
|
45
44
|
Plugin.make,
|
|
46
45
|
);
|
|
46
|
+
|
|
47
|
+
export default BoardPlugin;
|
|
@@ -18,8 +18,10 @@ export default Capability.makeModule(() =>
|
|
|
18
18
|
Surface.create({
|
|
19
19
|
id: 'root',
|
|
20
20
|
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
filter: AppSurface.oneOf(
|
|
22
|
+
AppSurface.object(AppSurface.Article, Board.Board),
|
|
23
|
+
AppSurface.object(AppSurface.Section, Board.Board),
|
|
24
|
+
),
|
|
23
25
|
component: ({ role, data }) => (
|
|
24
26
|
<BoardContainer role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
25
27
|
),
|
|
@@ -14,13 +14,13 @@ import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
|
14
14
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
15
15
|
import { random } from '@dxos/random';
|
|
16
16
|
import { Filter, Ref, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
|
-
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
17
|
+
import { translations as stackTranslations } from '@dxos/react-ui-stack/translations';
|
|
18
18
|
import { withLayout } from '@dxos/react-ui/testing';
|
|
19
19
|
import { Organization, Person } from '@dxos/types';
|
|
20
20
|
|
|
21
|
+
import { translations } from '#translations';
|
|
21
22
|
import { Board } from '#types';
|
|
22
23
|
|
|
23
|
-
import { translations } from '../../translations';
|
|
24
24
|
import { BoardContainer } from './BoardContainer';
|
|
25
25
|
|
|
26
26
|
random.seed(0);
|
|
@@ -86,7 +86,7 @@ const meta = {
|
|
|
86
86
|
yield* Effect.promise(() => space.waitUntilReady());
|
|
87
87
|
const board = space.db.add(createBoard());
|
|
88
88
|
|
|
89
|
-
Obj.
|
|
89
|
+
Obj.update(board, (board) => {
|
|
90
90
|
// Add some sample items
|
|
91
91
|
Array.from({ length: 10 }).map(() => {
|
|
92
92
|
const org = createOrg();
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Atom from '@effect-atom/atom/Atom';
|
|
5
7
|
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
8
|
|
|
7
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
-
import {
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
11
|
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
10
|
-
import {
|
|
12
|
+
import { AtomObj } from '@dxos/echo-atom';
|
|
13
|
+
import { useObject } from '@dxos/echo-react';
|
|
11
14
|
import { invariant } from '@dxos/invariant';
|
|
15
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
12
16
|
import { useQuery } from '@dxos/react-client/echo';
|
|
13
17
|
import { Panel } from '@dxos/react-ui';
|
|
14
18
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
@@ -27,14 +31,29 @@ type PickerState = {
|
|
|
27
31
|
export type BoardContainerProps = AppSurface.ObjectArticleProps<BoardType.Board>;
|
|
28
32
|
|
|
29
33
|
export const BoardContainer = ({ role, subject: board, attendableId }: BoardContainerProps) => {
|
|
30
|
-
const
|
|
34
|
+
const { hasAttention } = useAttention(attendableId);
|
|
35
|
+
const db = Obj.getDatabase(board);
|
|
31
36
|
const [boardItems] = useObject(board, 'items');
|
|
32
|
-
const
|
|
37
|
+
const itemsAtom = useMemo(
|
|
38
|
+
() =>
|
|
39
|
+
Atom.make((get) => {
|
|
40
|
+
const result: Obj.Unknown[] = [];
|
|
41
|
+
for (const ref of boardItems ?? []) {
|
|
42
|
+
const obj = get(AtomObj.makeWithReactive(ref));
|
|
43
|
+
if (obj) {
|
|
44
|
+
result.push(obj);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}),
|
|
49
|
+
[boardItems],
|
|
50
|
+
);
|
|
51
|
+
const items = useAtomValue(itemsAtom);
|
|
52
|
+
|
|
53
|
+
const controller = useRef<BoardController>(null);
|
|
33
54
|
const addTriggerRef = useRef<HTMLButtonElement | null>(null);
|
|
34
55
|
const [pickerState, setPickerState] = useState<PickerState | null>(null);
|
|
35
|
-
const { hasAttention } = useAttention(attendableId);
|
|
36
56
|
|
|
37
|
-
const db = Obj.getDatabase(board);
|
|
38
57
|
// TODO(burdon): Use search.
|
|
39
58
|
const objects = useQuery(db, Filter.everything());
|
|
40
59
|
const options = useMemo<ObjectPickerContentProps['options']>(
|
|
@@ -57,13 +76,22 @@ export const BoardContainer = ({ role, subject: board, attendableId }: BoardCont
|
|
|
57
76
|
);
|
|
58
77
|
|
|
59
78
|
const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(
|
|
60
|
-
async (anchor, position
|
|
79
|
+
async (anchor, position) => {
|
|
61
80
|
const db = Obj.getDatabase(board);
|
|
62
81
|
invariant(db);
|
|
82
|
+
// Grid backdrop "+" supplies a position → create a new Markdown document directly.
|
|
83
|
+
// Toolbar "+" omits position → fall back to the picker over existing objects.
|
|
84
|
+
if (position) {
|
|
85
|
+
const doc = db.add(Markdown.make());
|
|
86
|
+
Obj.update(board, (board) => {
|
|
87
|
+
board.items.push(Ref.make(doc));
|
|
88
|
+
board.layout.cells[doc.id.toString()] = position;
|
|
89
|
+
});
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
63
93
|
addTriggerRef.current = anchor;
|
|
64
|
-
setPickerState({
|
|
65
|
-
position,
|
|
66
|
-
});
|
|
94
|
+
setPickerState({ position: DEFAULT_POSITION });
|
|
67
95
|
},
|
|
68
96
|
[board],
|
|
69
97
|
);
|
|
@@ -73,7 +101,7 @@ export const BoardContainer = ({ role, subject: board, attendableId }: BoardCont
|
|
|
73
101
|
(id) => {
|
|
74
102
|
// TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.
|
|
75
103
|
const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);
|
|
76
|
-
Obj.
|
|
104
|
+
Obj.update(board, (board) => {
|
|
77
105
|
if (idx !== -1) {
|
|
78
106
|
board.items.splice(idx, 1);
|
|
79
107
|
}
|
|
@@ -86,7 +114,7 @@ export const BoardContainer = ({ role, subject: board, attendableId }: BoardCont
|
|
|
86
114
|
const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(
|
|
87
115
|
(id, position) => {
|
|
88
116
|
const layout = board.layout.cells[id];
|
|
89
|
-
Obj.
|
|
117
|
+
Obj.update(board, (board) => {
|
|
90
118
|
board.layout.cells[id] = { ...layout, ...position };
|
|
91
119
|
});
|
|
92
120
|
},
|
|
@@ -106,7 +134,7 @@ export const BoardContainer = ({ role, subject: board, attendableId }: BoardCont
|
|
|
106
134
|
}
|
|
107
135
|
|
|
108
136
|
// Create a reference to the selected object and add it to the board.
|
|
109
|
-
Obj.
|
|
137
|
+
Obj.update(board, (board) => {
|
|
110
138
|
board.items.push(Ref.make(selectedObject));
|
|
111
139
|
|
|
112
140
|
// Set the layout position for the new item.
|
|
@@ -138,7 +166,8 @@ export const BoardContainer = ({ role, subject: board, attendableId }: BoardCont
|
|
|
138
166
|
<Board.Content>
|
|
139
167
|
{items?.map((item, index) => (
|
|
140
168
|
<Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>
|
|
141
|
-
|
|
169
|
+
{/* `editable` opts the cell into the in-place editor variant — surfaces that don't recognize the flag fall back to the read-only card. */}
|
|
170
|
+
<Surface.Surface type={AppSurface.Card} data={{ subject: item, editable: true }} limit={1} />
|
|
142
171
|
</Board.Cell>
|
|
143
172
|
))}
|
|
144
173
|
</Board.Content>
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
7
8
|
|
|
8
|
-
export
|
|
9
|
+
export const BoardPlugin = Plugin.lazy(meta, () => import('./BoardPlugin'));
|
|
10
|
+
|
|
11
|
+
export * from './meta';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __export = (target, all) => {
|
|
3
|
-
for (var name in all)
|
|
4
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
// src/types/Board.ts
|
|
8
|
-
var Board_exports = {};
|
|
9
|
-
__export(Board_exports, {
|
|
10
|
-
Board: () => Board,
|
|
11
|
-
makeBoard: () => makeBoard
|
|
12
|
-
});
|
|
13
|
-
import * as Schema from "effect/Schema";
|
|
14
|
-
import { Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
15
|
-
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
16
|
-
import { BoardLayout, defaultLayout } from "@dxos/react-ui-board";
|
|
17
|
-
var Board = Schema.Struct({
|
|
18
|
-
name: Schema.String.pipe(Schema.optional),
|
|
19
|
-
items: Ref.Ref(Obj.Unknown).pipe(Schema.Array, FormInputAnnotation.set(false)),
|
|
20
|
-
layout: BoardLayout.pipe(FormInputAnnotation.set(false))
|
|
21
|
-
}).pipe(Type.object({
|
|
22
|
-
typename: "org.dxos.type.board",
|
|
23
|
-
version: "0.1.0"
|
|
24
|
-
}), LabelAnnotation.set([
|
|
25
|
-
"name"
|
|
26
|
-
]), Annotation.IconAnnotation.set({
|
|
27
|
-
icon: "ph--squares-four--regular",
|
|
28
|
-
hue: "green"
|
|
29
|
-
}));
|
|
30
|
-
var makeBoard = (props = {}) => Obj.make(Board, {
|
|
31
|
-
items: [],
|
|
32
|
-
layout: defaultLayout,
|
|
33
|
-
...props
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
Board_exports
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-FL67SBF5.mjs.map
|
|
@@ -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 { Annotation, Obj, Ref, 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: Ref.Ref(Obj.Unknown).pipe(Schema.Array, FormInputAnnotation.set(false)),\n layout: BoardLayout.pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--squares-four--regular',\n hue: 'green',\n }),\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,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,aAAaC,qBAAqB;AAKpC,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,OAAOC,IAAIA,IAAIC,IAAIC,OAAO,EAAEL,KAAYM,cAAOC,oBAAoBC,IAAI,KAAA,CAAA;EACvEC,QAAQC,YAAYV,KAAKO,oBAAoBC,IAAI,KAAA,CAAA;AACnD,CAAA,EAAGR,KACDW,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBP,IAAI;EAAC;CAAO,GAC5BQ,WAAWC,eAAeT,IAAI;EAC5BU,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,YAAY,CAACC,QAA8C,CAAC,MACvEjB,IAAIkB,KAAK1B,OAAO;EACdM,OAAO,CAAA;EACPO,QAAQc;EACR,GAAGF;AACL,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Ref", "Obj", "Unknown", "Array", "FormInputAnnotation", "set", "layout", "BoardLayout", "Type", "object", "typename", "version", "LabelAnnotation", "Annotation", "IconAnnotation", "icon", "hue", "makeBoard", "props", "make", "defaultLayout"]
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// src/types/Board.ts
|
|
9
|
-
var Board_exports = {};
|
|
10
|
-
__export(Board_exports, {
|
|
11
|
-
Board: () => Board,
|
|
12
|
-
makeBoard: () => makeBoard
|
|
13
|
-
});
|
|
14
|
-
import * as Schema from "effect/Schema";
|
|
15
|
-
import { Annotation, Obj, Ref, Type } from "@dxos/echo";
|
|
16
|
-
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
17
|
-
import { BoardLayout, defaultLayout } from "@dxos/react-ui-board";
|
|
18
|
-
var Board = Schema.Struct({
|
|
19
|
-
name: Schema.String.pipe(Schema.optional),
|
|
20
|
-
items: Ref.Ref(Obj.Unknown).pipe(Schema.Array, FormInputAnnotation.set(false)),
|
|
21
|
-
layout: BoardLayout.pipe(FormInputAnnotation.set(false))
|
|
22
|
-
}).pipe(Type.object({
|
|
23
|
-
typename: "org.dxos.type.board",
|
|
24
|
-
version: "0.1.0"
|
|
25
|
-
}), LabelAnnotation.set([
|
|
26
|
-
"name"
|
|
27
|
-
]), Annotation.IconAnnotation.set({
|
|
28
|
-
icon: "ph--squares-four--regular",
|
|
29
|
-
hue: "green"
|
|
30
|
-
}));
|
|
31
|
-
var makeBoard = (props = {}) => Obj.make(Board, {
|
|
32
|
-
items: [],
|
|
33
|
-
layout: defaultLayout,
|
|
34
|
-
...props
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
Board_exports
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=chunk-5GGKJL4Z.mjs.map
|
|
@@ -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 { Annotation, Obj, Ref, 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: Ref.Ref(Obj.Unknown).pipe(Schema.Array, FormInputAnnotation.set(false)),\n layout: BoardLayout.pipe(FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({\n icon: 'ph--squares-four--regular',\n hue: 'green',\n }),\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,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,aAAaC,qBAAqB;AAKpC,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,OAAOC,IAAIA,IAAIC,IAAIC,OAAO,EAAEL,KAAYM,cAAOC,oBAAoBC,IAAI,KAAA,CAAA;EACvEC,QAAQC,YAAYV,KAAKO,oBAAoBC,IAAI,KAAA,CAAA;AACnD,CAAA,EAAGR,KACDW,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBP,IAAI;EAAC;CAAO,GAC5BQ,WAAWC,eAAeT,IAAI;EAC5BU,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,YAAY,CAACC,QAA8C,CAAC,MACvEjB,IAAIkB,KAAK1B,OAAO;EACdM,OAAO,CAAA;EACPO,QAAQc;EACR,GAAGF;AACL,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Ref", "Obj", "Unknown", "Array", "FormInputAnnotation", "set", "layout", "BoardLayout", "Type", "object", "typename", "version", "LabelAnnotation", "Annotation", "IconAnnotation", "icon", "hue", "makeBoard", "props", "make", "defaultLayout"]
|
|
7
|
-
}
|