@dxos/plugin-board 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/{browser/BoardContainer-ANMIIXMG.mjs → neutral/BoardArticle-6DBQWLP5.mjs} +49 -34
- package/dist/lib/neutral/BoardArticle-6DBQWLP5.mjs.map +7 -0
- package/dist/lib/neutral/BoardPlugin.mjs +30 -0
- package/dist/lib/neutral/BoardPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-F24SVFD3.mjs → neutral/chunk-BWSKEQIG.mjs} +6 -2
- package/dist/lib/neutral/chunk-BWSKEQIG.mjs.map +7 -0
- package/dist/lib/{browser/chunk-UWECQOHO.mjs → neutral/chunk-XXGRE3CK.mjs} +1 -1
- package/dist/lib/{browser/chunk-UWECQOHO.mjs.map → neutral/chunk-XXGRE3CK.mjs.map} +2 -2
- package/dist/lib/neutral/components/index.mjs +1 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-OWHPPT3P.mjs +27 -0
- package/dist/lib/neutral/create-object-OWHPPT3P.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +12 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-M5JHK3ZQ.mjs +26 -0
- package/dist/lib/neutral/react-surface-M5JHK3ZQ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +29 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +1 -1
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- 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/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/containers/BoardArticle/BoardArticle.d.ts +6 -0
- package/dist/types/src/containers/BoardArticle/BoardArticle.d.ts.map +1 -0
- package/dist/types/src/containers/BoardArticle/BoardArticle.stories.d.ts +54 -0
- package/dist/types/src/containers/BoardArticle/BoardArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/BoardArticle/index.d.ts +2 -0
- package/dist/types/src/containers/BoardArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- 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 +91 -55
- package/src/BoardPlugin.test.ts +27 -0
- package/src/BoardPlugin.tsx +8 -31
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +4 -1
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/containers/{BoardContainer/BoardContainer.stories.tsx → BoardArticle/BoardArticle.stories.tsx} +20 -20
- package/src/containers/{BoardContainer/BoardContainer.tsx → BoardArticle/BoardArticle.tsx} +50 -22
- package/src/containers/BoardArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/index.ts +0 -2
- package/src/meta.ts +2 -0
- package/src/plugin.ts +9 -0
- package/src/translations.ts +12 -12
- package/dist/lib/browser/BoardContainer-ANMIIXMG.mjs.map +0 -7
- package/dist/lib/browser/chunk-F24SVFD3.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -80
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-LEGRWMJS.mjs +0 -39
- package/dist/lib/browser/react-surface-LEGRWMJS.mjs.map +0 -7
- package/dist/lib/node-esm/BoardContainer-FDVFXDZP.mjs +0 -150
- package/dist/lib/node-esm/BoardContainer-FDVFXDZP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-RCYQ2LGJ.mjs +0 -38
- package/dist/lib/node-esm/chunk-RCYQ2LGJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RIBFHKLN.mjs +0 -21
- package/dist/lib/node-esm/chunk-RIBFHKLN.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -81
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-ISI4UNAF.mjs +0 -40
- package/dist/lib/node-esm/react-surface-ISI4UNAF.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts +0 -6
- package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts.map +0 -1
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts +0 -46
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts.map +0 -1
- package/dist/types/src/containers/BoardContainer/index.d.ts +0 -3
- package/dist/types/src/containers/BoardContainer/index.d.ts.map +0 -1
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -30
- package/src/containers/BoardContainer/index.ts +0 -7
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ Surface plugin for card baords.
|
|
|
12
12
|
|
|
13
13
|
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
14
|
|
|
15
|
-
License: [
|
|
15
|
+
License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -1,30 +1,47 @@
|
|
|
1
1
|
import "./chunk-J5LGTIGS.mjs";
|
|
2
2
|
|
|
3
|
-
// src/containers/
|
|
3
|
+
// src/containers/BoardArticle/BoardArticle.tsx
|
|
4
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
5
|
+
import * as Atom from "@effect-atom/atom/Atom";
|
|
4
6
|
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
5
7
|
import { Surface } from "@dxos/app-framework/ui";
|
|
8
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
6
9
|
import { Filter, Obj, Ref } from "@dxos/echo";
|
|
7
|
-
import {
|
|
10
|
+
import { AtomObj } from "@dxos/echo-atom";
|
|
11
|
+
import { useObject } from "@dxos/echo-react";
|
|
8
12
|
import { invariant } from "@dxos/invariant";
|
|
13
|
+
import { Markdown } from "@dxos/plugin-markdown";
|
|
9
14
|
import { useQuery } from "@dxos/react-client/echo";
|
|
10
15
|
import { Panel } from "@dxos/react-ui";
|
|
11
16
|
import { useAttention } from "@dxos/react-ui-attention";
|
|
12
17
|
import { Board } from "@dxos/react-ui-board";
|
|
13
18
|
import { ObjectPicker } from "@dxos/react-ui-form";
|
|
14
19
|
import { isNonNullable } from "@dxos/util";
|
|
15
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-board/src/containers/
|
|
20
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-board/src/containers/BoardArticle/BoardArticle.tsx";
|
|
16
21
|
var DEFAULT_POSITION = {
|
|
17
22
|
x: 0,
|
|
18
23
|
y: 0
|
|
19
24
|
};
|
|
20
|
-
var
|
|
21
|
-
const
|
|
25
|
+
var BoardArticle = ({ role, subject: board, attendableId }) => {
|
|
26
|
+
const { hasAttention } = useAttention(attendableId);
|
|
27
|
+
const db = Obj.getDatabase(board);
|
|
22
28
|
const [boardItems] = useObject(board, "items");
|
|
23
|
-
const
|
|
29
|
+
const itemsAtom = useMemo(() => Atom.make((get) => {
|
|
30
|
+
const result = [];
|
|
31
|
+
for (const ref of boardItems ?? []) {
|
|
32
|
+
const obj = get(AtomObj.makeWithReactive(ref));
|
|
33
|
+
if (obj) {
|
|
34
|
+
result.push(obj);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}), [
|
|
39
|
+
boardItems
|
|
40
|
+
]);
|
|
41
|
+
const items = useAtomValue(itemsAtom);
|
|
42
|
+
const controller = useRef(null);
|
|
24
43
|
const addTriggerRef = useRef(null);
|
|
25
44
|
const [pickerState, setPickerState] = useState(null);
|
|
26
|
-
const { hasAttention } = useAttention(attendableId);
|
|
27
|
-
const db = Obj.getDatabase(board);
|
|
28
45
|
const objects = useQuery(db, Filter.everything());
|
|
29
46
|
const options = useMemo(() => objects.filter((obj) => obj.id !== board.id).map((obj) => {
|
|
30
47
|
const label = Obj.getLabel(obj);
|
|
@@ -38,39 +55,39 @@ var BoardContainer = ({ role, subject: board, attendableId }) => {
|
|
|
38
55
|
}).filter(isNonNullable).sort(({ label: a }, { label: b }) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())), [
|
|
39
56
|
objects
|
|
40
57
|
]);
|
|
41
|
-
const handleAdd = useCallback(async (anchor, position
|
|
58
|
+
const handleAdd = useCallback(async (anchor, position) => {
|
|
42
59
|
const db2 = Obj.getDatabase(board);
|
|
43
|
-
invariant(db2, void 0, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
60
|
+
invariant(db2, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 60, S: void 0, A: ["db", ""] });
|
|
61
|
+
if (position) {
|
|
62
|
+
const doc = db2.add(Markdown.make());
|
|
63
|
+
Obj.update(board, (board2) => {
|
|
64
|
+
board2.items.push(Ref.make(doc));
|
|
65
|
+
board2.layout.cells[doc.id.toString()] = position;
|
|
66
|
+
});
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
52
69
|
addTriggerRef.current = anchor;
|
|
53
70
|
setPickerState({
|
|
54
|
-
position
|
|
71
|
+
position: DEFAULT_POSITION
|
|
55
72
|
});
|
|
56
73
|
}, [
|
|
57
74
|
board
|
|
58
75
|
]);
|
|
59
76
|
const handleDelete = useCallback((id) => {
|
|
60
77
|
const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);
|
|
61
|
-
Obj.
|
|
78
|
+
Obj.update(board, (board2) => {
|
|
62
79
|
if (idx !== -1) {
|
|
63
|
-
|
|
80
|
+
board2.items.splice(idx, 1);
|
|
64
81
|
}
|
|
65
|
-
delete
|
|
82
|
+
delete board2.layout.cells[id];
|
|
66
83
|
});
|
|
67
84
|
}, [
|
|
68
85
|
board
|
|
69
86
|
]);
|
|
70
87
|
const handleMove = useCallback((id, position) => {
|
|
71
88
|
const layout = board.layout.cells[id];
|
|
72
|
-
Obj.
|
|
73
|
-
|
|
89
|
+
Obj.update(board, (board2) => {
|
|
90
|
+
board2.layout.cells[id] = {
|
|
74
91
|
...layout,
|
|
75
92
|
...position
|
|
76
93
|
};
|
|
@@ -86,9 +103,9 @@ var BoardContainer = ({ role, subject: board, attendableId }) => {
|
|
|
86
103
|
if (!Obj.isObject(selectedObject)) {
|
|
87
104
|
return;
|
|
88
105
|
}
|
|
89
|
-
Obj.
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
Obj.update(board, (board2) => {
|
|
107
|
+
board2.items.push(Ref.make(selectedObject));
|
|
108
|
+
board2.layout.cells[selectedObject.id.toString()] = pickerState.position;
|
|
92
109
|
});
|
|
93
110
|
setPickerState(null);
|
|
94
111
|
}, [
|
|
@@ -127,9 +144,10 @@ var BoardContainer = ({ role, subject: board, attendableId }) => {
|
|
|
127
144
|
y: 0
|
|
128
145
|
}
|
|
129
146
|
}, /* @__PURE__ */ React.createElement(Surface.Surface, {
|
|
130
|
-
|
|
147
|
+
type: AppSurface.Card,
|
|
131
148
|
data: {
|
|
132
|
-
subject: item
|
|
149
|
+
subject: item,
|
|
150
|
+
editable: true
|
|
133
151
|
},
|
|
134
152
|
limit: 1
|
|
135
153
|
})))))))), /* @__PURE__ */ React.createElement(ObjectPicker.Content, {
|
|
@@ -140,10 +158,7 @@ var BoardContainer = ({ role, subject: board, attendableId }) => {
|
|
|
140
158
|
virtualRef: addTriggerRef
|
|
141
159
|
})));
|
|
142
160
|
};
|
|
143
|
-
|
|
144
|
-
// src/containers/BoardContainer/index.ts
|
|
145
|
-
var BoardContainer_default = BoardContainer;
|
|
146
161
|
export {
|
|
147
|
-
|
|
162
|
+
BoardArticle as default
|
|
148
163
|
};
|
|
149
|
-
//# sourceMappingURL=
|
|
164
|
+
//# sourceMappingURL=BoardArticle-6DBQWLP5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/BoardArticle/BoardArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Atom from '@effect-atom/atom/Atom';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Filter, Obj, Ref } from '@dxos/echo';\nimport { AtomObj } from '@dxos/echo-atom';\nimport { useObject } from '@dxos/echo-react';\nimport { invariant } from '@dxos/invariant';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\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 { 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 BoardArticleProps = AppSurface.ObjectArticleProps<BoardType.Board>;\n\nexport const BoardArticle = ({ role, subject: board, attendableId }: BoardArticleProps) => {\n const { hasAttention } = useAttention(attendableId);\n const db = Obj.getDatabase(board);\n const [boardItems] = useObject(board, 'items');\n const itemsAtom = useMemo(\n () =>\n Atom.make((get) => {\n const result: Obj.Unknown[] = [];\n for (const ref of boardItems ?? []) {\n const obj = get(AtomObj.makeWithReactive(ref));\n if (obj) {\n result.push(obj);\n }\n }\n return result;\n }),\n [boardItems],\n );\n const items = useAtomValue(itemsAtom);\n\n const controller = useRef<BoardController>(null);\n const addTriggerRef = useRef<HTMLButtonElement | null>(null);\n const [pickerState, setPickerState] = useState<PickerState | null>(null);\n\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) => {\n const db = Obj.getDatabase(board);\n invariant(db);\n // Grid backdrop \"+\" supplies a position → create a new Markdown document directly.\n // Toolbar \"+\" omits position → fall back to the picker over existing objects.\n if (position) {\n const doc = db.add(Markdown.make());\n Obj.update(board, (board) => {\n board.items.push(Ref.make(doc));\n board.layout.cells[doc.id.toString()] = position;\n });\n return;\n }\n\n addTriggerRef.current = anchor;\n setPickerState({ position: DEFAULT_POSITION });\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.update(board, (board) => {\n if (idx !== -1) {\n board.items.splice(idx, 1);\n }\n delete board.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.update(board, (board) => {\n board.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.update(board, (board) => {\n board.items.push(Ref.make(selectedObject));\n\n // Set the layout position for the new item.\n board.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 <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Board.Toolbar disabled={!hasAttention} />\n </Panel.Toolbar>\n <Panel.Content asChild>\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.Surface type={AppSurface.Card} data={{ subject: item, editable: true }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </Panel.Content>\n </Panel.Root>\n <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='dx-card-popover-width' />\n <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />\n </ObjectPicker.Root>\n </Board.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["useAtomValue", "Atom", "React", "useCallback", "useMemo", "useRef", "useState", "Surface", "AppSurface", "Filter", "Obj", "Ref", "AtomObj", "useObject", "invariant", "Markdown", "useQuery", "Panel", "useAttention", "Board", "ObjectPicker", "isNonNullable", "DEFAULT_POSITION", "y", "db", "getDatabase", "board", "boardItems", "itemsAtom", "result", "obj", "get", "push", "addTriggerRef", "pickerState", "setPickerState", "objects", "everything", "label", "getLabel", "id", "hue", "filter", "items", "make", "doc", "layout", "cells", "findIndex", "ref", "idx", "position", "selectedObject", "toString", "onAdd", "onDelete", "handleDelete", "onMove", "open", "onOpenChange", "nextOpen", "role", "Toolbar", "asChild", "disabled", "Container", "classNames", "Backdrop", "Content", "item", "index", "x", "type", "subject", "editable", "limit", "options", "onSelect", "handleSelect", "virtualRef"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/BoardPlugin.tsx
|
|
4
|
+
import { Plugin } from "@dxos/app-framework";
|
|
5
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
+
import { translations as boardTranslations } from "@dxos/react-ui-board/translations";
|
|
7
|
+
import { CreateObject, ReactSurface } from "#capabilities";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
import { translations } from "#translations";
|
|
10
|
+
import { Board } from "#types";
|
|
11
|
+
var BoardPlugin = Plugin.define(meta).pipe(AppPlugin.addCreateObjectModule({
|
|
12
|
+
activate: CreateObject
|
|
13
|
+
}), AppPlugin.addSchemaModule({
|
|
14
|
+
schema: [
|
|
15
|
+
Board.Board
|
|
16
|
+
]
|
|
17
|
+
}), AppPlugin.addSurfaceModule({
|
|
18
|
+
activate: ReactSurface
|
|
19
|
+
}), AppPlugin.addTranslationsModule({
|
|
20
|
+
translations: [
|
|
21
|
+
...translations,
|
|
22
|
+
...boardTranslations
|
|
23
|
+
]
|
|
24
|
+
}), Plugin.make);
|
|
25
|
+
var BoardPlugin_default = BoardPlugin;
|
|
26
|
+
export {
|
|
27
|
+
BoardPlugin,
|
|
28
|
+
BoardPlugin_default as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=BoardPlugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/BoardPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { translations as boardTranslations } from '@dxos/react-ui-board/translations';\n\nimport { CreateObject, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Board } from '#types';\n\nexport const BoardPlugin = Plugin.define(meta).pipe(\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addSchemaModule({ schema: [Board.Board] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations: [...translations, ...boardTranslations] }),\n Plugin.make,\n);\n\nexport default BoardPlugin;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,gBAAgBC,yBAAyB;AAElD,SAASC,cAAcC,oBAAoB;AAC3C,SAASC,YAAY;AACrB,SAASJ,oBAAoB;AAC7B,SAASK,aAAa;AAEf,IAAMC,cAAcR,OAAOS,OAAOH,IAAAA,EAAMI,KAC7CT,UAAUU,sBAAsB;EAAEC,UAAUR;AAAa,CAAA,GACzDH,UAAUY,gBAAgB;EAAEC,QAAQ;IAACP,MAAMA;;AAAO,CAAA,GAClDN,UAAUc,iBAAiB;EAAEH,UAAUP;AAAa,CAAA,GACpDJ,UAAUe,sBAAsB;EAAEd,cAAc;OAAIA;OAAiBC;;AAAmB,CAAA,GACxFH,OAAOiB,IAAI;AAGb,IAAA,sBAAeT;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "translations", "boardTranslations", "CreateObject", "ReactSurface", "meta", "Board", "BoardPlugin", "define", "pipe", "addCreateObjectModule", "activate", "addSchemaModule", "schema", "addSurfaceModule", "addTranslationsModule", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/index.ts
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-OWHPPT3P.mjs"));
|
|
6
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-M5JHK3ZQ.mjs"));
|
|
7
|
+
export {
|
|
8
|
+
CreateObject,
|
|
9
|
+
ReactSurface
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAEpB,IAAMC,eAAeD,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "CreateObject", "lazy", "ReactSurface"]
|
|
7
|
+
}
|
|
@@ -3,6 +3,7 @@ import { trim } from "@dxos/util";
|
|
|
3
3
|
var meta = {
|
|
4
4
|
id: "org.dxos.plugin.board",
|
|
5
5
|
name: "Board",
|
|
6
|
+
author: "DXOS",
|
|
6
7
|
description: trim`
|
|
7
8
|
Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.
|
|
8
9
|
Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.
|
|
@@ -10,10 +11,13 @@ var meta = {
|
|
|
10
11
|
icon: "ph--squares-four--regular",
|
|
11
12
|
iconHue: "green",
|
|
12
13
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board",
|
|
13
|
-
screenshots: []
|
|
14
|
+
screenshots: [],
|
|
15
|
+
tags: [
|
|
16
|
+
"labs"
|
|
17
|
+
]
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
export {
|
|
17
21
|
meta
|
|
18
22
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-BWSKEQIG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\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: 'org.dxos.plugin.board',\n name: 'Board',\n author: 'DXOS',\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 tags: ['labs'],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;EAIbM,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;EACbC,MAAM;IAAC;;AACT;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "author", "description", "icon", "iconHue", "source", "screenshots", "tags"]
|
|
7
|
+
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/Board.ts"],
|
|
4
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,
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "
|
|
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,OAAOZ,IAAIA,IAAID,IAAIc,OAAO,EAAEH,KAAYI,cAAOZ,oBAAoBa,IAAI,KAAA,CAAA;EACvEC,QAAQZ,YAAYM,KAAKR,oBAAoBa,IAAI,KAAA,CAAA;AACnD,CAAA,EAAGL,KACDT,KAAKgB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAhB,gBAAgBY,IAAI;EAAC;CAAO,GAC5BjB,WAAWsB,eAAeL,IAAI;EAC5BM,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,YAAY,CAACC,QAA8C,CAAC,MACvEzB,IAAI0B,KAAKnB,OAAO;EACdM,OAAO,CAAA;EACPI,QAAQX;EACR,GAAGmB;AACL,CAAA;",
|
|
6
|
+
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Unknown", "Array", "set", "layout", "object", "typename", "version", "IconAnnotation", "icon", "hue", "makeBoard", "props", "make"]
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const BoardArticle: ComponentType<any> = lazy(() => import('./BoardArticle'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,eAAmCD,KAAK,MAAM,OAAO,8BAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "BoardArticle"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/create-object.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capability } from "@dxos/app-framework";
|
|
6
|
+
import { Operation } from "@dxos/compute";
|
|
7
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
8
|
+
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
9
|
+
import { Board } from "#types";
|
|
10
|
+
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
11
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
12
|
+
id: Board.Board.typename,
|
|
13
|
+
createObject: (props, options) => Effect.gen(function* () {
|
|
14
|
+
const object = Board.makeBoard(props);
|
|
15
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
16
|
+
object,
|
|
17
|
+
target: options.target,
|
|
18
|
+
hidden: true,
|
|
19
|
+
targetNodeId: options.targetNodeId
|
|
20
|
+
});
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}));
|
|
24
|
+
export {
|
|
25
|
+
create_object_default as default
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=create-object-OWHPPT3P.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/create-object.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\n\nimport { Board } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Board.Board.typename,\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = Board.makeBoard(props);\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAElC,SAASC,aAAa;AAEtB,IAAA,wBAAeJ,WAAWK,WACjBC,kBAAW,aAAA;AAChB,SAAON,WAAWO,YAAYJ,kBAAkBK,mBAAmB;IACjEC,IAAIL,MAAMA,MAAMM;IAChBC,cAAc,CAACC,OAAOC,YACbC,WAAI,aAAA;AACT,YAAMC,SAASX,MAAMY,UAAUJ,KAAAA;AAC/B,aAAO,OAAOX,UAAUgB,OAAOf,eAAegB,WAAW;QACvDH;QACAI,QAAQN,QAAQM;QAChBC,QAAQ;QACRC,cAAcR,QAAQQ;MACxB,CAAA;IACF,CAAA;EACJ,CAAA;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "Operation", "SpaceOperation", "SpaceCapabilities", "Board", "makeModule", "fnUntraced", "contributes", "CreateObjectEntry", "id", "typename", "createObject", "props", "options", "gen", "object", "makeBoard", "invoke", "AddObject", "target", "hidden", "targetNodeId"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":2050,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/Board.ts":{"bytes":3777,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":422,"imports":[{"path":"src/types/Board.ts","kind":"import-statement","original":"./Board"}],"format":"esm"},"src/index.ts":{"bytes":449,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/BoardPlugin.tsx":{"bytes":3049,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board/translations","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/create-object.ts":{"bytes":3347,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3684,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1130,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/create-object.ts","kind":"dynamic-import","original":"./create-object"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/components/index.ts":{"bytes":288,"imports":[],"format":"esm"},"src/containers/BoardArticle/BoardArticle.tsx":{"bytes":21883,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@effect-atom/atom/Atom","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/containers/BoardArticle/index.ts":{"bytes":506,"imports":[{"path":"src/containers/BoardArticle/BoardArticle.tsx","kind":"import-statement","original":"./BoardArticle"}],"format":"esm"},"src/containers/index.ts":{"bytes":702,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/BoardArticle/index.ts","kind":"dynamic-import","original":"./BoardArticle"}],"format":"esm"},"src/plugin.ts":{"bytes":850,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":2495,"imports":[{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XXGRE3CK.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Board"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":161},"dist/lib/neutral/create-object-OWHPPT3P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1750},"dist/lib/neutral/create-object-OWHPPT3P.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/create-object.ts","inputs":{"src/capabilities/create-object.ts":{"bytesInOutput":774}},"bytes":942},"dist/lib/neutral/react-surface-M5JHK3ZQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1871},"dist/lib/neutral/react-surface-M5JHK3ZQ.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":895}},"bytes":1064},"dist/lib/neutral/BoardArticle-6DBQWLP5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10654},"dist/lib/neutral/BoardArticle-6DBQWLP5.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"@effect-atom/atom/Atom","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-atom","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/BoardArticle/index.ts","inputs":{"src/containers/BoardArticle/BoardArticle.tsx":{"bytesInOutput":5193},"src/containers/BoardArticle/index.ts":{"bytesInOutput":0}},"bytes":5362},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XXGRE3CK.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-BWSKEQIG.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Board","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":214},"dist/lib/neutral/chunk-XXGRE3CK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2027},"dist/lib/neutral/chunk-XXGRE3CK.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true}],"exports":["Board_exports"],"inputs":{"src/types/Board.ts":{"bytesInOutput":867},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1014},"dist/lib/neutral/BoardPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1575},"dist/lib/neutral/BoardPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board/translations","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["BoardPlugin","default"],"entryPoint":"src/BoardPlugin.tsx","inputs":{"src/BoardPlugin.tsx":{"bytesInOutput":735}},"bytes":891},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":602},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/create-object-OWHPPT3P.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-M5JHK3ZQ.mjs","kind":"dynamic-import"}],"exports":["CreateObject","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":248}},"bytes":388},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/components/index.mjs":{"imports":[],"exports":[],"entryPoint":"src/components/index.ts","inputs":{"src/components/index.ts":{"bytesInOutput":0}},"bytes":35},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":397},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/BoardArticle-6DBQWLP5.mjs","kind":"dynamic-import"}],"exports":["BoardArticle"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":101}},"bytes":223},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-BWSKEQIG.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":438},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-BWSKEQIG.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["BoardPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":108}},"bytes":266},"dist/lib/neutral/chunk-BWSKEQIG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1023},"dist/lib/neutral/chunk-BWSKEQIG.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":525}},"bytes":604},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1211},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":602}},"bytes":726},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-BWSKEQIG.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/plugin.ts
|
|
7
|
+
import { Plugin } from "@dxos/app-framework";
|
|
8
|
+
var BoardPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
+
export {
|
|
10
|
+
BoardPlugin
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const BoardPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,cAAcC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
+
"names": ["Plugin", "BoardPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/react-surface.tsx
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
7
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
8
|
+
import { AppSurface } from "@dxos/app-toolkit/ui";
|
|
9
|
+
import { BoardArticle } from "#containers";
|
|
10
|
+
import { Board } from "#types";
|
|
11
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
12
|
+
Surface.create({
|
|
13
|
+
id: "root",
|
|
14
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
15
|
+
filter: AppSurface.oneOf(AppSurface.object(AppSurface.Article, Board.Board), AppSurface.object(AppSurface.Section, Board.Board)),
|
|
16
|
+
component: ({ role, data }) => /* @__PURE__ */ React.createElement(BoardArticle, {
|
|
17
|
+
role,
|
|
18
|
+
subject: data.subject,
|
|
19
|
+
attendableId: data.attendableId
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
])));
|
|
23
|
+
export {
|
|
24
|
+
react_surface_default as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=react-surface-M5JHK3ZQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { BoardArticle } from '#containers';\nimport { Board } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'root',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Board.Board),\n AppSurface.object(AppSurface.Section, Board.Board),\n ),\n component: ({ role, data }) => (\n <BoardArticle role={role} subject={data.subject} attendableId={data.attendableId} />\n ),\n }),\n ]),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAE3B,SAASC,oBAAoB;AAC7B,SAASC,aAAa;AAEtB,IAAA,wBAAeJ,WAAWK,WAAW,MAC5BC,eACLN,WAAWO,YAAYR,aAAaS,cAAc;EAChDP,QAAQQ,OAAO;IACbC,IAAI;;IAEJC,QAAQT,WAAWU,MACjBV,WAAWW,OAAOX,WAAWY,SAASV,MAAMA,KAAK,GACjDF,WAAWW,OAAOX,WAAWa,SAASX,MAAMA,KAAK,CAAA;IAEnDY,WAAW,CAAC,EAAEC,MAAMC,KAAI,MACtB,sBAAA,cAACf,cAAAA;MAAac;MAAYE,SAASD,KAAKC;MAASC,cAAcF,KAAKE;;EAExE,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "AppSurface", "BoardArticle", "Board", "makeModule", "succeed", "contributes", "ReactSurface", "create", "id", "filter", "oneOf", "object", "Article", "Section", "component", "role", "data", "subject", "attendableId"]
|
|
7
|
+
}
|