@dxos/plugin-board 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6
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 +3 -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 -48
- package/src/BoardPlugin.tsx +37 -48
- package/src/capabilities/index.ts +2 -3
- package/src/capabilities/react-surface.tsx +21 -13
- package/src/components/index.ts +0 -2
- package/src/containers/BoardContainer/BoardContainer.stories.tsx +122 -0
- package/src/{components → containers/BoardContainer}/BoardContainer.tsx +53 -46
- package/src/containers/BoardContainer/index.ts +7 -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-IDV4P2SK.mjs +0 -143
- package/dist/lib/browser/chunk-IDV4P2SK.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-EACRLTVO.mjs +0 -30
- package/dist/lib/browser/react-surface-EACRLTVO.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/chunk-ZNNC2VAL.mjs +0 -145
- package/dist/lib/node-esm/chunk-ZNNC2VAL.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-PEYOXLWP.mjs +0 -31
- package/dist/lib/node-esm/react-surface-PEYOXLWP.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,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/BoardContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { getSpace } from '@dxos/client/echo';\nimport { Filter, Obj, Ref } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { useQuery } from '@dxos/react-client/echo';\nimport { fullyQualifiedId } from '@dxos/react-client/echo';\nimport { useSignalsMemo } 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 { StackItem } from '@dxos/react-ui-stack';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type Board as BoardType } from '../types';\n\nconst DEFAULT_POSITION = { x: 0, y: 0 } satisfies Position;\n\ntype PickerState = {\n position: Position;\n};\n\nexport type BoardContainerProps = {\n role?: string;\n board: BoardType.Board;\n};\n\nexport const BoardContainer = ({ board }: BoardContainerProps) => {\n const controller = useRef<BoardController>(null);\n const items = useSignalsMemo(() => board.items.map((ref) => ref.target).filter(isNonNullable), [board]);\n const addTriggerRef = useRef<HTMLButtonElement | null>(null);\n const [pickerState, setPickerState] = useState<PickerState | null>(null);\n const attendableId = fullyQualifiedId(board);\n const { hasAttention } = useAttention(attendableId);\n\n // Memoize options for ObjectPicker containing all ECHO objects in the same space as the Board.\n const objects = useQuery(getSpace(board), Filter.everything());\n const options = useMemo(\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 [objects],\n );\n\n const handleAdd = useCallback<NonNullable<BoardRootProps['onAdd']>>(\n async (anchor, position = DEFAULT_POSITION) => {\n const space = getSpace(board);\n invariant(space);\n addTriggerRef.current = anchor;\n setPickerState({\n position,\n });\n },\n [board],\n );\n\n // TODO(burdon): Use intents so can be undone.\n const handleDelete = useCallback<NonNullable<BoardRootProps['onDelete']>>(\n (id) => {\n // TODO(burdon): Impl. DXN.equals and pass in DXN from `id`.\n const idx = board.items.findIndex((ref) => ref.dxn.asEchoDXN()?.echoId === id);\n if (idx !== -1) {\n board.items.splice(idx, 1);\n }\n delete board.layout.cells[id];\n },\n [board],\n );\n\n const handleMove = useCallback<NonNullable<BoardRootProps['onMove']>>(\n (id, position) => {\n const layout = board.layout.cells[id];\n board.layout.cells[id] = { ...layout, ...position };\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 (!selectedObject) {\n return;\n }\n\n // Create a reference to the selected object and add it to the 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 // 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 <StackItem.Content toolbar>\n <Board.Toolbar disabled={!hasAttention} />\n <Board.Container>\n <Board.Viewport classNames='border-none'>\n <Board.Backdrop />\n <Board.Content>\n {items?.map((item, index) => (\n <Board.Cell item={item} key={index} layout={board.layout?.cells[item.id] ?? { x: 0, y: 0 }}>\n <Surface role='card--extrinsic' data={{ subject: item }} limit={1} />\n </Board.Cell>\n ))}\n </Board.Content>\n </Board.Viewport>\n </Board.Container>\n </StackItem.Content>\n {/* TODO(burdon): Currently clipped by sidebar. */}\n <ObjectPicker.Content options={options} onSelect={handleSelect} classNames='popover-card-width' />\n <ObjectPicker.VirtualTrigger virtualRef={addTriggerRef} />\n </ObjectPicker.Root>\n </Board.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;AAIA,OAAOA,SAASC,aAAaC,SAASC,QAAQC,gBAAgB;AAE9D,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,QAAQC,KAAKC,WAAW;AACjC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB;AACzB,SAASC,wBAAwB;AACjC,SAASC,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SAASC,aAAuE;AAChF,SAASC,oBAAmD;AAC5D,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;;AAI9B,IAAMC,mBAAmB;EAAEC,GAAG;EAAGC,GAAG;AAAE;AAW/B,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;;;AAC3D,UAAMC,aAAarB,OAAwB,IAAA;AAC3C,UAAMsB,QAAQZ,eAAe,MAAMU,MAAME,MAAMC,IAAI,CAACC,QAAQA,IAAIC,MAAM,EAAEC,OAAOX,aAAAA,GAAgB;MAACK;KAAM;AACtG,UAAMO,gBAAgB3B,OAAiC,IAAA;AACvD,UAAM,CAAC4B,aAAaC,cAAAA,IAAkB5B,SAA6B,IAAA;AACnE,UAAM6B,eAAerB,iBAAiBW,KAAAA;AACtC,UAAM,EAAEW,aAAY,IAAKpB,aAAamB,YAAAA;AAGtC,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filter", "Obj", "Ref", "invariant", "useQuery", "fullyQualifiedId", "useSignalsMemo", "useAttention", "Board", "ObjectPicker", "StackItem", "isNonNullable", "DEFAULT_POSITION", "x", "y", "BoardContainer", "board", "controller", "items", "map", "ref", "target", "filter", "addTriggerRef", "pickerState", "setPickerState", "attendableId", "hasAttention", "objects", "everything", "options", "obj", "id", "label", "getLabel", "handleAdd", "anchor", "position", "space", "current", "handleDelete", "idx", "findIndex", "dxn", "asEchoDXN", "echoId", "splice", "layout", "cells", "handleMove", "handleSelect", "selectedObject", "find", "push", "make", "toString", "Root", "onAdd", "onDelete", "onMove", "open", "onOpenChange", "nextOpen", "Content", "toolbar", "Toolbar", "disabled", "Container", "Viewport", "classNames", "Backdrop", "item", "index", "Cell", "key", "role", "data", "subject", "limit", "onSelect", "VirtualTrigger", "virtualRef"]
|
|
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-ZNNC2VAL.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-PEYOXLWP.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;AAetE,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 { DataType } from '@dxos/schema';
|
|
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(DataType.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(DataType.OrganizationStatusOptions).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: [DataType.Organization, DataType.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 = {};
|