@dxos/plugin-board 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0
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/chunk-FL67SBF5.mjs +39 -0
- package/dist/lib/browser/chunk-FL67SBF5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +69 -67
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/chunk-5GGKJL4Z.mjs +40 -0
- package/dist/lib/node-esm/chunk-5GGKJL4Z.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +69 -67
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/BoardPlugin.d.ts +2 -1
- package/dist/types/src/BoardPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -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/BoardContainer/BoardContainer.d.ts +6 -0
- package/dist/types/src/containers/BoardContainer/BoardContainer.d.ts.map +1 -0
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts +47 -0
- package/dist/types/src/containers/BoardContainer/BoardContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/BoardContainer/index.d.ts +2 -0
- package/dist/types/src/containers/BoardContainer/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 -1
- 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/translations.d.ts +12 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Board.d.ts +25 -67
- package/dist/types/src/types/Board.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -49
- package/src/BoardPlugin.tsx +37 -48
- package/src/capabilities/index.ts +2 -3
- package/src/capabilities/react-surface.tsx +21 -14
- package/src/components/index.ts +0 -2
- package/src/containers/BoardContainer/BoardContainer.stories.tsx +122 -0
- package/src/{components → containers/BoardContainer}/BoardContainer.tsx +48 -40
- package/src/containers/BoardContainer/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/index.ts +0 -1
- package/src/meta.ts +3 -3
- package/src/translations.ts +12 -10
- package/src/types/Board.ts +10 -20
- 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/intent-resolver-MGJCQT3N.mjs +0 -33
- package/dist/lib/browser/intent-resolver-MGJCQT3N.mjs.map +0 -7
- 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/intent-resolver-TV2AARM7.mjs +0 -34
- package/dist/lib/node-esm/intent-resolver-TV2AARM7.mjs.map +0 -7
- 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/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
|
@@ -1,65 +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
|
-
Create: () => Create,
|
|
13
|
-
makeBoard: () => makeBoard
|
|
14
|
-
});
|
|
15
|
-
import * as Schema from "effect/Schema";
|
|
16
|
-
import { Obj, Type } from "@dxos/echo";
|
|
17
|
-
import { FormAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
18
|
-
import { BoardLayout, defaultLayout } from "@dxos/react-ui-board";
|
|
19
|
-
|
|
20
|
-
// src/meta.ts
|
|
21
|
-
import { trim } from "@dxos/util";
|
|
22
|
-
var meta = {
|
|
23
|
-
id: "dxos.org/plugin/board",
|
|
24
|
-
name: "Board",
|
|
25
|
-
description: trim`
|
|
26
|
-
Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.
|
|
27
|
-
Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.
|
|
28
|
-
`,
|
|
29
|
-
icon: "ph--squares-four--regular",
|
|
30
|
-
iconHue: "green",
|
|
31
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board",
|
|
32
|
-
screenshots: []
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// src/types/Board.ts
|
|
36
|
-
var Board = Schema.Struct({
|
|
37
|
-
name: Schema.String.pipe(Schema.optional),
|
|
38
|
-
items: Type.Ref(Type.Expando).pipe(Schema.Array, Schema.mutable, FormAnnotation.set(false)),
|
|
39
|
-
layout: BoardLayout.pipe(Schema.mutable, FormAnnotation.set(false))
|
|
40
|
-
}).pipe(Type.Obj({
|
|
41
|
-
typename: "dxos.org/type/Board",
|
|
42
|
-
version: "0.1.0"
|
|
43
|
-
}), LabelAnnotation.set([
|
|
44
|
-
"name"
|
|
45
|
-
]));
|
|
46
|
-
var makeBoard = (props = {}) => Obj.make(Board, {
|
|
47
|
-
items: [],
|
|
48
|
-
layout: defaultLayout,
|
|
49
|
-
...props
|
|
50
|
-
});
|
|
51
|
-
var Create = class extends Schema.TaggedClass()(`${meta.id}/action/create`, {
|
|
52
|
-
input: Schema.Struct({
|
|
53
|
-
name: Schema.optional(Schema.String)
|
|
54
|
-
}),
|
|
55
|
-
output: Schema.Struct({
|
|
56
|
-
object: Board
|
|
57
|
-
})
|
|
58
|
-
}) {
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
meta,
|
|
63
|
-
Board_exports
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=chunk-WFLKZNL3.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/Board.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { FormAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { BoardLayout, defaultLayout } from '@dxos/react-ui-board';\n\nimport { meta } from '../meta';\n\n/**\n * Board and layout.\n */\nexport const Board = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n items: Type.Ref(Type.Expando).pipe(Schema.Array, Schema.mutable, FormAnnotation.set(false)),\n layout: BoardLayout.pipe(Schema.mutable, FormAnnotation.set(false)),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Board',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n);\n\nexport interface Board extends Schema.Schema.Type<typeof Board> {}\n\nexport const makeBoard = (props: Partial<Obj.MakeProps<typeof Board>> = {}) =>\n Obj.make(Board, {\n items: [],\n layout: defaultLayout,\n ...props,\n });\n\n/**\n * Create board.\n */\nexport class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Board,\n }),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/board',\n name: 'Board',\n description: trim`\n Infinite canvas workspace that combines sticky notes, media, and whiteboarding tools.\n Arrange and connect ideas freely in a visual space perfect for brainstorming and creative collaboration.\n `,\n icon: 'ph--squares-four--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-board',\n screenshots: [],\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAAA;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,gBAAgBC,uBAAuB;AAChD,SAASC,aAAaC,qBAAqB;;;ACH3C,SAASC,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;AACf;;;ADHO,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EACxCC,OAAOC,KAAKC,IAAID,KAAKE,OAAO,EAAEL,KAAYM,cAAcC,gBAASC,eAAeC,IAAI,KAAA,CAAA;EACpFC,QAAQC,YAAYX,KAAYO,gBAASC,eAAeC,IAAI,KAAA,CAAA;AAC9D,CAAA,EAAGT,KACDG,KAAKS,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBN,IAAI;EAAC;CAAO,CAAA;AAKvB,IAAMO,YAAY,CAACC,QAA8C,CAAC,MACvEL,IAAIM,KAAKtB,OAAO;EACdM,OAAO,CAAA;EACPQ,QAAQS;EACR,GAAGF;AACL,CAAA;AAKK,IAAMG,SAAN,cAA4BC,mBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;EACnFC,OAAc3B,cAAO;IACnBC,MAAaG,gBAAgBF,aAAM;EACrC,CAAA;EACA0B,QAAe5B,cAAO;IACpB6B,QAAQ9B;EACV,CAAA;AACF,CAAA,EAAA;AAAI;",
|
|
6
|
-
"names": ["Schema", "Obj", "Type", "FormAnnotation", "LabelAnnotation", "BoardLayout", "defaultLayout", "trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots", "Board", "Struct", "name", "String", "pipe", "optional", "items", "Type", "Ref", "Expando", "Array", "mutable", "FormAnnotation", "set", "layout", "BoardLayout", "Obj", "typename", "version", "LabelAnnotation", "makeBoard", "props", "make", "defaultLayout", "Create", "TaggedClass", "meta", "id", "input", "output", "object"]
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Board_exports
|
|
4
|
-
} from "./chunk-WFLKZNL3.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/intent-resolver.ts
|
|
7
|
-
import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
|
|
8
|
-
import { Obj } from "@dxos/echo";
|
|
9
|
-
var intent_resolver_default = (() => [
|
|
10
|
-
contributes(Capabilities.IntentResolver, createResolver({
|
|
11
|
-
intent: Board_exports.Create,
|
|
12
|
-
resolve: ({ name }) => {
|
|
13
|
-
return {
|
|
14
|
-
data: {
|
|
15
|
-
object: Obj.make(Board_exports.Board, {
|
|
16
|
-
name,
|
|
17
|
-
items: [],
|
|
18
|
-
layout: {
|
|
19
|
-
size: {
|
|
20
|
-
width: 5,
|
|
21
|
-
height: 5
|
|
22
|
-
},
|
|
23
|
-
cells: {}
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}))
|
|
30
|
-
]);
|
|
31
|
-
export {
|
|
32
|
-
intent_resolver_default as default
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=intent-resolver-TV2AARM7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/intent-resolver.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\n\nimport { Board } from '../types';\n\nexport default () => [\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: Board.Create,\n resolve: ({ name }) => {\n return {\n data: {\n object: Obj.make(Board.Board, {\n name,\n items: [],\n layout: {\n size: {\n width: 5,\n height: 5,\n },\n cells: {},\n },\n }),\n },\n };\n },\n }),\n ),\n];\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,WAAW;AAIpB,IAAA,2BAAe,MAAM;EACnBC,YACEC,aAAaC,gBACbC,eAAe;IACbC,QAAQC,cAAMC;IACdC,SAAS,CAAC,EAAEC,KAAI,MAAE;AAChB,aAAO;QACLC,MAAM;UACJC,QAAQC,IAAIC,KAAKP,cAAMA,OAAO;YAC5BG;YACAK,OAAO,CAAA;YACPC,QAAQ;cACNC,MAAM;gBACJC,OAAO;gBACPC,QAAQ;cACV;cACAC,OAAO,CAAC;YACV;UACF,CAAA;QACF;MACF;IACF;EACF,CAAA,CAAA;;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createResolver", "Obj", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "Board", "Create", "resolve", "name", "data", "object", "Obj", "make", "items", "layout", "size", "width", "height", "cells"]
|
|
7
|
-
}
|
|
@@ -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 = {};
|