@dxos/plugin-board 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878
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/neutral/BoardArticle-YF4GDG2D.mjs +168 -0
- package/dist/lib/neutral/BoardArticle-YF4GDG2D.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/neutral/chunk-3MMGDTWD.mjs +34 -0
- package/dist/lib/neutral/chunk-3MMGDTWD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5H26NTXJ.mjs +30 -0
- package/dist/lib/neutral/chunk-5H26NTXJ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- 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-BRISOU7F.mjs +28 -0
- package/dist/lib/neutral/create-object-BRISOU7F.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +12 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -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 +30 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/types/index.mjs +2 -1
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/BoardPlugin.d.ts +3 -1
- 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 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- 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 +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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 -13
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Board.d.ts +27 -70
- package/dist/types/src/types/Board.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +103 -60
- package/src/BoardPlugin.test.ts +27 -0
- package/src/BoardPlugin.tsx +16 -51
- package/src/capabilities/create-object.ts +31 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +23 -14
- package/src/components/index.ts +0 -2
- package/src/containers/BoardArticle/BoardArticle.stories.tsx +122 -0
- package/src/containers/BoardArticle/BoardArticle.tsx +186 -0
- package/src/containers/BoardArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/index.ts +0 -3
- package/src/meta.ts +14 -5
- package/src/plugin.ts +9 -0
- package/src/translations.ts +14 -11
- package/src/types/Board.ts +10 -23
- package/dist/lib/browser/chunk-6IYOP7JD.mjs +0 -64
- package/dist/lib/browser/chunk-6IYOP7JD.mjs.map +0 -7
- package/dist/lib/browser/chunk-UDI6JPP5.mjs +0 -143
- package/dist/lib/browser/chunk-UDI6JPP5.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -90
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MGJCQT3N.mjs +0 -33
- package/dist/lib/browser/intent-resolver-MGJCQT3N.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-PBKZGBFJ.mjs +0 -30
- package/dist/lib/browser/react-surface-PBKZGBFJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LJPQ2ELJ.mjs +0 -145
- package/dist/lib/node-esm/chunk-LJPQ2ELJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WFLKZNL3.mjs +0 -65
- package/dist/lib/node-esm/chunk-WFLKZNL3.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -91
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-TV2AARM7.mjs +0 -34
- package/dist/lib/node-esm/intent-resolver-TV2AARM7.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-NELFNJ6M.mjs +0 -31
- package/dist/lib/node-esm/react-surface-NELFNJ6M.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -8
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/BoardContainer.d.ts +0 -8
- package/dist/types/src/components/BoardContainer.d.ts.map +0 -1
- package/dist/types/src/components/BoardContainer.stories.d.ts +0 -45
- package/dist/types/src/components/BoardContainer.stories.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -34
- package/src/components/BoardContainer.stories.tsx +0 -125
- package/src/components/BoardContainer.tsx +0 -146
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/components}/index.mjs.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/components/BoardContainer.tsx":{"bytes":18224,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":485,"imports":[{"path":"src/components/BoardContainer.tsx","kind":"import-statement","original":"./BoardContainer"}],"format":"esm"},"src/meta.ts":{"bytes":1967,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/Board.ts":{"bytes":4590,"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},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/types/index.ts":{"bytes":508,"imports":[{"path":"src/types/Board.ts","kind":"import-statement","original":"./Board"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":3014,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":2913,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1035,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2322,"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":7228,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":722,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/BoardPlugin.tsx","kind":"import-statement","original":"./BoardPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4966},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-LJPQ2ELJ.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WFLKZNL3.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui-board","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/intent-resolver-TV2AARM7.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/react-surface-NELFNJ6M.mjs","kind":"dynamic-import"}],"exports":["Board","BoardContainer","BoardPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/BoardPlugin.tsx":{"bytesInOutput":1642},"src/capabilities/index.ts":{"bytesInOutput":190},"src/translations.ts":{"bytesInOutput":458}},"bytes":2718},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-WFLKZNL3.mjs","kind":"import-statement"}],"exports":["Board"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":221},"dist/lib/node-esm/intent-resolver-TV2AARM7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1474},"dist/lib/node-esm/intent-resolver-TV2AARM7.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-WFLKZNL3.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":598}},"bytes":889},"dist/lib/node-esm/react-surface-NELFNJ6M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1430},"dist/lib/node-esm/react-surface-NELFNJ6M.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-LJPQ2ELJ.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-WFLKZNL3.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":528}},"bytes":879},"dist/lib/node-esm/chunk-LJPQ2ELJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9158},"dist/lib/node-esm/chunk-LJPQ2ELJ.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["BoardContainer"],"inputs":{"src/components/BoardContainer.tsx":{"bytesInOutput":4578},"src/components/index.ts":{"bytesInOutput":0}},"bytes":4782},"dist/lib/node-esm/chunk-WFLKZNL3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3299},"dist/lib/node-esm/chunk-WFLKZNL3.mjs":{"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},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Board_exports","meta"],"inputs":{"src/types/Board.ts":{"bytesInOutput":1009},"src/meta.ts":{"bytesInOutput":481},"src/types/index.ts":{"bytesInOutput":0}},"bytes":1892}}}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
BoardContainer
|
|
4
|
-
} from "./chunk-LJPQ2ELJ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Board_exports,
|
|
7
|
-
meta
|
|
8
|
-
} from "./chunk-WFLKZNL3.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/react-surface.tsx
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
|
|
13
|
-
import { Obj } from "@dxos/echo";
|
|
14
|
-
var react_surface_default = ((context) => contributes(Capabilities.ReactSurface, [
|
|
15
|
-
createSurface({
|
|
16
|
-
id: meta.id,
|
|
17
|
-
role: [
|
|
18
|
-
"article",
|
|
19
|
-
"section"
|
|
20
|
-
],
|
|
21
|
-
filter: (data) => Obj.instanceOf(Board_exports.Board, data.subject),
|
|
22
|
-
component: ({ data, role }) => /* @__PURE__ */ React.createElement(BoardContainer, {
|
|
23
|
-
board: data.subject,
|
|
24
|
-
role
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
]));
|
|
28
|
-
export {
|
|
29
|
-
react_surface_default as default
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=react-surface-NELFNJ6M.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Capabilities, type PluginContext, contributes, createSurface } 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 (context: PluginContext) =>\n contributes(Capabilities.ReactSurface, [\n 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: ({ data, role }) => <BoardContainer board={data.subject} role={role} />,\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,cAAkCC,aAAaC,qBAAqB;AAC7E,SAASC,WAAW;AAMpB,IAAA,yBAAe,CAACC,YACdC,YAAYC,aAAaC,cAAc;EACrCC,cAAc;IACZC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SAA2CC,IAAIC,WAAWC,cAAMA,OAAOH,KAAKI,OAAO;IAC5FC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,gBAAAA;MAAeC,OAAOP,KAAKI;MAASN;;EACtE,CAAA;CACD;",
|
|
6
|
-
"names": ["React", "Capabilities", "contributes", "createSurface", "Obj", "context", "contributes", "Capabilities", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Board", "subject", "component", "BoardContainer", "board"]
|
|
7
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Capabilities } from '@dxos/app-framework';
|
|
2
|
-
declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Capabilities.IntentResolver>>[];
|
|
3
|
-
export default _default;
|
|
4
|
-
//# sourceMappingURL=intent-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;;AAKhF,wBAwBE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Board as BoardType } from '../types';
|
|
3
|
-
export type BoardContainerProps = {
|
|
4
|
-
role?: string;
|
|
5
|
-
board: BoardType.Board;
|
|
6
|
-
};
|
|
7
|
-
export declare const BoardContainer: ({ board }: BoardContainerProps) => React.JSX.Element;
|
|
8
|
-
//# 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;AActE,OAAO,EAAE,KAAK,KAAK,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAQnD,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,WAAW,mBAAmB,sBAkH5D,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Board } from '../types';
|
|
4
|
-
declare const meta: {
|
|
5
|
-
title: string;
|
|
6
|
-
render: () => React.JSX.Element | null;
|
|
7
|
-
decorators: import("@storybook/react").Decorator[];
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: string;
|
|
10
|
-
translations: ({
|
|
11
|
-
readonly 'en-US': {
|
|
12
|
-
readonly [Board
|
|
13
|
-
.Board.typename]: {
|
|
14
|
-
readonly 'typename label': "Board";
|
|
15
|
-
readonly 'typename label_zero': "Boards";
|
|
16
|
-
readonly 'typename label_one': "Board";
|
|
17
|
-
readonly 'typename label_other': "Boards";
|
|
18
|
-
readonly 'object name placeholder': "New board";
|
|
19
|
-
readonly 'rename object label': "Rename board";
|
|
20
|
-
readonly 'delete object label': "Delete board";
|
|
21
|
-
};
|
|
22
|
-
readonly [meta.id]: {
|
|
23
|
-
readonly 'plugin name': "Board";
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
} | {
|
|
27
|
-
readonly 'en-US': {
|
|
28
|
-
readonly "react-ui-stack": {
|
|
29
|
-
readonly "resize label": "Drag to resize";
|
|
30
|
-
readonly "drag handle label": "Drag to rearrange";
|
|
31
|
-
readonly "pin start label": "Pin to the left sidebar";
|
|
32
|
-
readonly "pin end label": "Pin to the right sidebar";
|
|
33
|
-
readonly "increment start label": "Move to the left";
|
|
34
|
-
readonly "increment end label": "Move to the right";
|
|
35
|
-
readonly "close label": "Close";
|
|
36
|
-
readonly "minify label": "Minify";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
})[];
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export default meta;
|
|
43
|
-
type Story = StoryObj<typeof meta>;
|
|
44
|
-
export declare const Default: Story;
|
|
45
|
-
//# sourceMappingURL=BoardContainer.stories.d.ts.map
|
|
@@ -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;AACtD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAkDjC,QAAA,MAAM,IAAI;;;;;;;;yBAlE4C,CAAQ,KAAK;qBACnE,KAAK,CAAE,QAAO,CAAC;;;;;;;;;yBAMf,CAAS,IAAG,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;CAwGf,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
import { Obj } from '@dxos/echo';
|
|
7
|
-
|
|
8
|
-
import { Board } from '../types';
|
|
9
|
-
|
|
10
|
-
export default () => [
|
|
11
|
-
contributes(
|
|
12
|
-
Capabilities.IntentResolver,
|
|
13
|
-
createResolver({
|
|
14
|
-
intent: Board.Create,
|
|
15
|
-
resolve: ({ name }) => {
|
|
16
|
-
return {
|
|
17
|
-
data: {
|
|
18
|
-
object: Obj.make(Board.Board, {
|
|
19
|
-
name,
|
|
20
|
-
items: [],
|
|
21
|
-
layout: {
|
|
22
|
-
size: {
|
|
23
|
-
width: 5,
|
|
24
|
-
height: 5,
|
|
25
|
-
},
|
|
26
|
-
cells: {},
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
}),
|
|
33
|
-
),
|
|
34
|
-
];
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import React, { useEffect, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
13
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
14
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
15
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
16
|
-
import { faker } from '@dxos/random';
|
|
17
|
-
import { Filter, Ref, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
18
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
19
|
-
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
20
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
21
|
-
import { Organization, Person } from '@dxos/types';
|
|
22
|
-
|
|
23
|
-
import { translations } from '../translations';
|
|
24
|
-
import { Board } from '../types';
|
|
25
|
-
|
|
26
|
-
import { BoardContainer } from './BoardContainer';
|
|
27
|
-
|
|
28
|
-
faker.seed(0);
|
|
29
|
-
|
|
30
|
-
const createBoard = () =>
|
|
31
|
-
Obj.make(Board.Board, {
|
|
32
|
-
name: 'Test Board',
|
|
33
|
-
items: [],
|
|
34
|
-
layout: {
|
|
35
|
-
size: { width: 7, height: 5 },
|
|
36
|
-
cells: {},
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const createOrg = () =>
|
|
41
|
-
Obj.make(Organization.Organization, {
|
|
42
|
-
name: faker.commerce.productName(),
|
|
43
|
-
description: faker.lorem.paragraph(),
|
|
44
|
-
image: faker.image.url(),
|
|
45
|
-
website: faker.internet.url(),
|
|
46
|
-
// TODO(burdon): Fix.
|
|
47
|
-
// status: faker.helpers.arrayElement(Organization.StatusOptions).id,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const DefaultStory = () => {
|
|
51
|
-
const spaces = useSpaces();
|
|
52
|
-
const space = spaces[spaces.length - 1];
|
|
53
|
-
const boards = useQuery(space, Filter.type(Board.Board));
|
|
54
|
-
const [board, setBoard] = useState<Board.Board>();
|
|
55
|
-
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (boards.length && !board) {
|
|
58
|
-
const board = boards[0];
|
|
59
|
-
setBoard(board);
|
|
60
|
-
}
|
|
61
|
-
}, [boards]);
|
|
62
|
-
|
|
63
|
-
if (!board) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return <BoardContainer role='board' board={board} />;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
// Story definitions
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
const meta = {
|
|
75
|
-
title: 'plugins/plugin-board/Board',
|
|
76
|
-
render: DefaultStory,
|
|
77
|
-
decorators: [
|
|
78
|
-
withTheme,
|
|
79
|
-
withPluginManager({
|
|
80
|
-
plugins: [
|
|
81
|
-
ClientPlugin({
|
|
82
|
-
types: [Organization.Organization, Person.Person, Board.Board],
|
|
83
|
-
onClientInitialized: async ({ client }) => {
|
|
84
|
-
await client.halo.createIdentity();
|
|
85
|
-
const space = await client.spaces.create();
|
|
86
|
-
await space.waitUntilReady();
|
|
87
|
-
const board = space.db.add(createBoard());
|
|
88
|
-
|
|
89
|
-
// Add some sample items
|
|
90
|
-
Array.from({ length: 10 }).map(() => {
|
|
91
|
-
const org = createOrg();
|
|
92
|
-
space.db.add(org);
|
|
93
|
-
board.items.push(Ref.make(org));
|
|
94
|
-
board.layout.cells[org.id] = {
|
|
95
|
-
x: Math.floor(Math.random() * 5) - 2,
|
|
96
|
-
y: Math.floor(Math.random() * 5) - 2,
|
|
97
|
-
width: 1,
|
|
98
|
-
height: 1,
|
|
99
|
-
};
|
|
100
|
-
return org;
|
|
101
|
-
});
|
|
102
|
-
},
|
|
103
|
-
}),
|
|
104
|
-
SpacePlugin({}),
|
|
105
|
-
IntentPlugin(),
|
|
106
|
-
SettingsPlugin(),
|
|
107
|
-
|
|
108
|
-
// UI
|
|
109
|
-
ThemePlugin({ tx: defaultTx }),
|
|
110
|
-
PreviewPlugin(),
|
|
111
|
-
StorybookLayoutPlugin({}),
|
|
112
|
-
],
|
|
113
|
-
}),
|
|
114
|
-
],
|
|
115
|
-
parameters: {
|
|
116
|
-
layout: 'fullscreen',
|
|
117
|
-
translations: [...translations, ...stackTranslations],
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default meta;
|
|
122
|
-
|
|
123
|
-
type Story = StoryObj<typeof meta>;
|
|
124
|
-
|
|
125
|
-
export const Default: Story = {};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Surface } from '@dxos/app-framework/react';
|
|
8
|
-
import { getSpace } from '@dxos/client/echo';
|
|
9
|
-
import { Filter, Obj, Ref } from '@dxos/echo';
|
|
10
|
-
import { invariant } from '@dxos/invariant';
|
|
11
|
-
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
-
import { useSignalsMemo } from '@dxos/react-ui';
|
|
13
|
-
import { useAttention } from '@dxos/react-ui-attention';
|
|
14
|
-
import { Board, type BoardController, type BoardRootProps, type Position } from '@dxos/react-ui-board';
|
|
15
|
-
import { ObjectPicker, type ObjectPickerContentProps } from '@dxos/react-ui-form';
|
|
16
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
17
|
-
import { isNonNullable } from '@dxos/util';
|
|
18
|
-
|
|
19
|
-
import { type Board as BoardType } from '../types';
|
|
20
|
-
|
|
21
|
-
const DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;
|
|
22
|
-
|
|
23
|
-
type PickerState = {
|
|
24
|
-
position: Position;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type BoardContainerProps = {
|
|
28
|
-
role?: string;
|
|
29
|
-
board: BoardType.Board;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const BoardContainer = ({ board }: BoardContainerProps) => {
|
|
33
|
-
const controller = useRef<BoardController>(null);
|
|
34
|
-
const items = useSignalsMemo(() => board.items.map((ref) => ref.target).filter(isNonNullable), [board]);
|
|
35
|
-
const addTriggerRef = useRef<HTMLButtonElement | null>(null);
|
|
36
|
-
const [pickerState, setPickerState] = useState<PickerState | null>(null);
|
|
37
|
-
const attendableId = Obj.getDXN(board).toString();
|
|
38
|
-
const { hasAttention } = useAttention(attendableId);
|
|
39
|
-
|
|
40
|
-
// TODO(burdon): Use search.
|
|
41
|
-
const objects = useQuery(getSpace(board), Filter.everything());
|
|
42
|
-
const options = useMemo<ObjectPickerContentProps['options']>(
|
|
43
|
-
() =>
|
|
44
|
-
objects
|
|
45
|
-
.filter((obj) => obj.id !== board.id)
|
|
46
|
-
.map((obj) => {
|
|
47
|
-
const label = Obj.getLabel(obj);
|
|
48
|
-
if (label) {
|
|
49
|
-
return {
|
|
50
|
-
id: obj.id,
|
|
51
|
-
label,
|
|
52
|
-
hue: 'neutral' as const,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
.filter(isNonNullable)
|
|
57
|
-
.sort(({ label: a }, { label: b }) => a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())),
|
|
58
|
-
[objects],
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(
|
|
62
|
-
async (anchor, position = DEFAULT_POSITION) => {
|
|
63
|
-
const space = getSpace(board);
|
|
64
|
-
invariant(space);
|
|
65
|
-
addTriggerRef.current = anchor;
|
|
66
|
-
setPickerState({
|
|
67
|
-
position,
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
[board],
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
// TODO(burdon): Use intents so can be undone.
|
|
74
|
-
const handleDelete = useCallback<NonNullable<BoardRootProps['onDelete']>>(
|
|
75
|
-
(id) => {
|
|
76
|
-
// TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.
|
|
77
|
-
const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);
|
|
78
|
-
if (idx !== -1) {
|
|
79
|
-
board.items.splice(idx, 1);
|
|
80
|
-
}
|
|
81
|
-
delete board.layout.cells[id];
|
|
82
|
-
},
|
|
83
|
-
[board],
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(
|
|
87
|
-
(id, position) => {
|
|
88
|
-
const layout = board.layout.cells[id];
|
|
89
|
-
board.layout.cells[id] = { ...layout, ...position };
|
|
90
|
-
},
|
|
91
|
-
[board],
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const handleSelect = useCallback<NonNullable<ObjectPickerContentProps['onSelect']>>(
|
|
95
|
-
(id) => {
|
|
96
|
-
if (!pickerState) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Find the selected object by id from the space.
|
|
101
|
-
const selectedObject = objects.find((obj) => obj.id === id);
|
|
102
|
-
if (!selectedObject) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Create a reference to the selected object and add it to the board.
|
|
107
|
-
board.items.push(Ref.make(selectedObject));
|
|
108
|
-
|
|
109
|
-
// Set the layout position for the new item.
|
|
110
|
-
board.layout.cells[selectedObject.id.toString()] = pickerState.position;
|
|
111
|
-
|
|
112
|
-
// Close the picker.
|
|
113
|
-
setPickerState(null);
|
|
114
|
-
},
|
|
115
|
-
[pickerState, objects, board],
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<Board.Root ref={controller} layout={board.layout} onAdd={handleAdd} onDelete={handleDelete} onMove={handleMove}>
|
|
120
|
-
<ObjectPicker.Root
|
|
121
|
-
open={!!pickerState}
|
|
122
|
-
onOpenChange={(nextOpen: boolean) => {
|
|
123
|
-
setPickerState(nextOpen ? { position: DEFAULT_POSITION } : null);
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
<StackItem.Content toolbar>
|
|
127
|
-
<Board.Toolbar disabled={!hasAttention} />
|
|
128
|
-
<Board.Container>
|
|
129
|
-
<Board.Viewport classNames='border-none'>
|
|
130
|
-
<Board.Backdrop />
|
|
131
|
-
<Board.Content>
|
|
132
|
-
{items?.map((item, index) => (
|
|
133
|
-
<Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>
|
|
134
|
-
<Surface role='card--extrinsic' data={{ subject: item }} limit={1} />
|
|
135
|
-
</Board.Cell>
|
|
136
|
-
))}
|
|
137
|
-
</Board.Content>
|
|
138
|
-
</Board.Viewport>
|
|
139
|
-
</Board.Container>
|
|
140
|
-
</StackItem.Content>
|
|
141
|
-
<ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />
|
|
142
|
-
<ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />
|
|
143
|
-
</ObjectPicker.Root>
|
|
144
|
-
</Board.Root>
|
|
145
|
-
);
|
|
146
|
-
};
|
|
File without changes
|
|
File without changes
|