@dxos/plugin-kanban 0.8.4-main.bc674ce → 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/blueprints/index.mjs +23 -4
- package/dist/lib/browser/blueprints/index.mjs.map +4 -4
- package/dist/lib/browser/chunk-A3PBV3S5.mjs +105 -0
- package/dist/lib/browser/chunk-A3PBV3S5.mjs.map +7 -0
- package/dist/lib/browser/delete-card-VPNVIWOA.mjs +32 -0
- package/dist/lib/browser/delete-card-VPNVIWOA.mjs.map +7 -0
- package/dist/lib/browser/delete-card-field-4HHF2GYX.mjs +50 -0
- package/dist/lib/browser/delete-card-field-4HHF2GYX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +84 -61
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/restore-card-4GG2RYKR.mjs +29 -0
- package/dist/lib/browser/restore-card-4GG2RYKR.mjs.map +7 -0
- package/dist/lib/browser/restore-card-field-3T26ACYX.mjs +48 -0
- package/dist/lib/browser/restore-card-field-3T26ACYX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +94 -8
- package/dist/lib/browser/types/index.mjs.map +4 -4
- package/dist/lib/node-esm/blueprints/index.mjs +23 -4
- package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-6LELYA2G.mjs +106 -0
- package/dist/lib/node-esm/chunk-6LELYA2G.mjs.map +7 -0
- package/dist/lib/node-esm/delete-card-5PW5OMFN.mjs +33 -0
- package/dist/lib/node-esm/delete-card-5PW5OMFN.mjs.map +7 -0
- package/dist/lib/node-esm/delete-card-field-KPJU2AQ3.mjs +51 -0
- package/dist/lib/node-esm/delete-card-field-KPJU2AQ3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +84 -61
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/restore-card-X2TKMU5A.mjs +30 -0
- package/dist/lib/node-esm/restore-card-X2TKMU5A.mjs.map +7 -0
- package/dist/lib/node-esm/restore-card-field-IUTL4RTR.mjs +49 -0
- package/dist/lib/node-esm/restore-card-field-IUTL4RTR.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +94 -8
- package/dist/lib/node-esm/types/index.mjs.map +4 -4
- package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/kanban-blueprint.d.ts +3 -21
- package/dist/types/src/blueprints/kanban-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/{artifact-definition/artifact-definition.d.ts → artifact-definition.d.ts} +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
- package/dist/types/src/components/KanbanBoard/KanbanBoard.d.ts +65 -0
- package/dist/types/src/components/KanbanBoard/KanbanBoard.d.ts.map +1 -0
- package/dist/types/src/components/KanbanBoard/KanbanBoard.stories.d.ts +72 -0
- package/dist/types/src/components/KanbanBoard/KanbanBoard.stories.d.ts.map +1 -0
- package/dist/types/src/components/KanbanBoard/KanbanCard.d.ts +10 -0
- package/dist/types/src/components/KanbanBoard/KanbanCard.d.ts.map +1 -0
- package/dist/types/src/components/KanbanBoard/KanbanColumn.d.ts +9 -0
- package/dist/types/src/components/KanbanBoard/KanbanColumn.d.ts.map +1 -0
- package/dist/types/src/components/KanbanBoard/index.d.ts +2 -0
- package/dist/types/src/components/KanbanBoard/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/KanbanContainer/KanbanContainer.d.ts +6 -0
- package/dist/types/src/containers/KanbanContainer/KanbanContainer.d.ts.map +1 -0
- package/dist/types/src/containers/KanbanContainer/KanbanContainer.stories.d.ts +79 -0
- package/dist/types/src/containers/KanbanContainer/KanbanContainer.stories.d.ts.map +1 -0
- package/dist/types/src/containers/KanbanContainer/index.d.ts +3 -0
- package/dist/types/src/containers/KanbanContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/KanbanViewEditor/KanbanViewEditor.d.ts +6 -0
- package/dist/types/src/containers/KanbanViewEditor/KanbanViewEditor.d.ts.map +1 -0
- package/dist/types/src/containers/KanbanViewEditor/index.d.ts +3 -0
- package/dist/types/src/containers/KanbanViewEditor/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +6 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useEchoChangeCallback.d.ts +13 -0
- package/dist/types/src/hooks/useEchoChangeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useKanbanBoardModel.d.ts +16 -0
- package/dist/types/src/hooks/useKanbanBoardModel.d.ts.map +1 -0
- package/dist/types/src/hooks/useKanbanBoardModel.test.d.ts +2 -0
- package/dist/types/src/hooks/useKanbanBoardModel.test.d.ts.map +1 -0
- package/dist/types/src/hooks/useKanbanColumnEventHandler.d.ts +22 -0
- package/dist/types/src/hooks/useKanbanColumnEventHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useKanbanItemEventHandler.d.ts +19 -0
- package/dist/types/src/hooks/useKanbanItemEventHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useProjectionModel.d.ts +15 -0
- package/dist/types/src/hooks/useProjectionModel.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +52 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/delete-card-field.d.ts +5 -0
- package/dist/types/src/operations/delete-card-field.d.ts.map +1 -0
- package/dist/types/src/operations/delete-card.d.ts +5 -0
- package/dist/types/src/operations/delete-card.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/restore-card-field.d.ts +5 -0
- package/dist/types/src/operations/restore-card-field.d.ts.map +1 -0
- package/dist/types/src/operations/restore-card.d.ts +5 -0
- package/dist/types/src/operations/restore-card.d.ts.map +1 -0
- package/dist/types/src/playwright/board-manager.d.ts +5 -0
- package/dist/types/src/playwright/board-manager.d.ts.map +1 -0
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/playwright/smoke.spec.d.ts +2 -0
- package/dist/types/src/playwright/smoke.spec.d.ts.map +1 -0
- package/dist/types/src/testing/KanbanCardTileSimple.d.ts +7 -0
- package/dist/types/src/testing/KanbanCardTileSimple.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +48 -32
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Kanban.d.ts +37 -0
- package/dist/types/src/types/Kanban.d.ts.map +1 -0
- package/dist/types/src/types/constants.d.ts +6 -0
- package/dist/types/src/types/constants.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +0 -103
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +28 -0
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/arrangement.d.ts +68 -0
- package/dist/types/src/util/arrangement.d.ts.map +1 -0
- package/dist/types/src/util/arrangement.test.d.ts +2 -0
- package/dist/types/src/util/arrangement.test.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +64 -42
- package/src/KanbanPlugin.tsx +35 -23
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/kanban-blueprint.ts +12 -8
- package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts} +10 -9
- package/src/capabilities/blueprint-definition.ts +17 -0
- package/src/capabilities/index.ts +10 -3
- package/src/capabilities/operation-handler.ts +14 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +15 -15
- package/src/capabilities/undo-mappings.ts +34 -0
- package/src/components/KanbanBoard/KanbanBoard.stories.tsx +142 -0
- package/src/components/KanbanBoard/KanbanBoard.tsx +193 -0
- package/src/components/KanbanBoard/KanbanCard.tsx +86 -0
- package/src/components/KanbanBoard/KanbanColumn.tsx +69 -0
- package/src/components/KanbanBoard/index.ts +5 -0
- package/src/components/index.ts +1 -2
- package/src/{components → containers/KanbanContainer}/KanbanContainer.stories.tsx +70 -87
- package/src/containers/KanbanContainer/KanbanContainer.tsx +96 -0
- package/src/containers/KanbanContainer/index.ts +7 -0
- package/src/{components → containers/KanbanViewEditor}/KanbanViewEditor.tsx +23 -19
- package/src/containers/KanbanViewEditor/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useEchoChangeCallback.ts +30 -0
- package/src/hooks/useKanbanBoardModel.test.ts +235 -0
- package/src/hooks/useKanbanBoardModel.ts +143 -0
- package/src/hooks/useKanbanColumnEventHandler.ts +106 -0
- package/src/hooks/useKanbanItemEventHandler.ts +133 -0
- package/src/hooks/useProjectionModel.ts +58 -0
- package/src/meta.ts +1 -1
- package/src/operations/definitions.ts +63 -0
- package/src/operations/delete-card-field.ts +47 -0
- package/src/operations/delete-card.ts +23 -0
- package/src/operations/index.ts +12 -0
- package/src/operations/restore-card-field.ts +41 -0
- package/src/operations/restore-card.ts +21 -0
- package/src/playwright/board-manager.ts +13 -0
- package/src/playwright/playwright.config.ts +19 -0
- package/src/playwright/smoke.spec.ts +107 -0
- package/src/testing/KanbanCardTileSimple.tsx +82 -0
- package/src/testing/index.ts +5 -0
- package/src/translations.ts +26 -18
- package/src/types/Kanban.ts +71 -0
- package/src/types/constants.ts +9 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +0 -76
- package/src/types/types.ts +35 -0
- package/src/util/arrangement.test.ts +208 -0
- package/src/util/arrangement.ts +167 -0
- package/src/util/index.ts +5 -0
- package/dist/lib/browser/blueprint-definition-T2544VMJ.mjs +0 -17
- package/dist/lib/browser/blueprint-definition-T2544VMJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-L6N4ZDZ7.mjs +0 -35
- package/dist/lib/browser/chunk-L6N4ZDZ7.mjs.map +0 -7
- package/dist/lib/browser/chunk-XYQO4VL7.mjs +0 -150
- package/dist/lib/browser/chunk-XYQO4VL7.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-UEJHX42A.mjs +0 -162
- package/dist/lib/browser/operation-resolver-UEJHX42A.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LFUJAPRL.mjs +0 -236
- package/dist/lib/browser/react-surface-LFUJAPRL.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-APJQFSHJ.mjs +0 -18
- package/dist/lib/node-esm/blueprint-definition-APJQFSHJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NN6JMKIT.mjs +0 -152
- package/dist/lib/node-esm/chunk-NN6JMKIT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs +0 -36
- package/dist/lib/node-esm/chunk-ZHRMUKTF.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-5RPWHZCF.mjs +0 -163
- package/dist/lib/node-esm/operation-resolver-5RPWHZCF.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7TSGBRJL.mjs +0 -237
- package/dist/lib/node-esm/react-surface-7TSGBRJL.mjs.map +0 -7
- package/dist/types/src/capabilities/artifact-definition/artifact-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/artifact-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/artifact-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -9
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- 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 +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/KanbanContainer.d.ts +0 -6
- package/dist/types/src/components/KanbanContainer.d.ts.map +0 -1
- package/dist/types/src/components/KanbanContainer.stories.d.ts +0 -75
- package/dist/types/src/components/KanbanContainer.stories.d.ts.map +0 -1
- package/dist/types/src/components/KanbanViewEditor.d.ts +0 -8
- package/dist/types/src/components/KanbanViewEditor.d.ts.map +0 -1
- package/src/capabilities/artifact-definition/index.ts +0 -7
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -23
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -133
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/components/KanbanContainer.tsx +0 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-kanban",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bcb3aa67d6",
|
|
4
4
|
"description": "Kanban DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,23 +12,40 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#blueprints": "./src/blueprints/index.ts",
|
|
17
|
+
"#capabilities": "./src/capabilities/index.ts",
|
|
18
|
+
"#components": "./src/components/index.ts",
|
|
19
|
+
"#containers": "./src/containers/index.ts",
|
|
20
|
+
"#hooks": "./src/hooks/index.ts",
|
|
21
|
+
"#meta": "./src/meta.ts",
|
|
22
|
+
"#operations": "./src/operations/index.ts",
|
|
23
|
+
"#testing": "./src/testing/index.ts",
|
|
24
|
+
"#types": "./src/types/index.ts"
|
|
25
|
+
},
|
|
15
26
|
"exports": {
|
|
16
27
|
".": {
|
|
28
|
+
"source": "./src/index.ts",
|
|
17
29
|
"browser": "./dist/lib/browser/index.mjs",
|
|
18
30
|
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
-
"source": "./src/index.ts",
|
|
20
31
|
"types": "./dist/types/src/index.d.ts"
|
|
21
32
|
},
|
|
22
33
|
"./blueprints": {
|
|
34
|
+
"source": "./src/blueprints/index.ts",
|
|
23
35
|
"browser": "./dist/lib/browser/blueprints/index.mjs",
|
|
24
36
|
"node": "./dist/lib/node-esm/blueprints/index.mjs",
|
|
25
|
-
"source": "./src/blueprints/index.ts",
|
|
26
37
|
"types": "./dist/types/src/blueprints/index.d.ts"
|
|
27
38
|
},
|
|
39
|
+
"./operations": {
|
|
40
|
+
"source": "./src/operations/index.ts",
|
|
41
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
42
|
+
"node": "./dist/lib/node-esm/operations/index.mjs",
|
|
43
|
+
"types": "./dist/types/src/operations/index.d.ts"
|
|
44
|
+
},
|
|
28
45
|
"./types": {
|
|
46
|
+
"source": "./src/types/index.ts",
|
|
29
47
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
30
48
|
"node": "./dist/lib/node-esm/types/index.mjs",
|
|
31
|
-
"source": "./src/types/index.ts",
|
|
32
49
|
"types": "./dist/types/src/types/index.d.ts"
|
|
33
50
|
}
|
|
34
51
|
},
|
|
@@ -48,54 +65,59 @@
|
|
|
48
65
|
"src"
|
|
49
66
|
],
|
|
50
67
|
"dependencies": {
|
|
51
|
-
"@effect-atom/atom-react": "^0.
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/app-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/functions": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/random": "0.8.4-main.
|
|
70
|
-
"@dxos/react-
|
|
71
|
-
"@dxos/react-ui
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
68
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
69
|
+
"@radix-ui/react-context": "1.1.1",
|
|
70
|
+
"effect": "3.20.0",
|
|
71
|
+
"@dxos/ai": "0.8.4-main.bcb3aa67d6",
|
|
72
|
+
"@dxos/app-toolkit": "0.8.4-main.bcb3aa67d6",
|
|
73
|
+
"@dxos/app-framework": "0.8.4-main.bcb3aa67d6",
|
|
74
|
+
"@dxos/blueprints": "0.8.4-main.bcb3aa67d6",
|
|
75
|
+
"@dxos/async": "0.8.4-main.bcb3aa67d6",
|
|
76
|
+
"@dxos/echo-atom": "0.8.4-main.bcb3aa67d6",
|
|
77
|
+
"@dxos/functions": "0.8.4-main.bcb3aa67d6",
|
|
78
|
+
"@dxos/echo": "0.8.4-main.bcb3aa67d6",
|
|
79
|
+
"@dxos/effect": "0.8.4-main.bcb3aa67d6",
|
|
80
|
+
"@dxos/log": "0.8.4-main.bcb3aa67d6",
|
|
81
|
+
"@dxos/operation": "0.8.4-main.bcb3aa67d6",
|
|
82
|
+
"@dxos/assistant": "0.8.4-main.bcb3aa67d6",
|
|
83
|
+
"@dxos/plugin-client": "0.8.4-main.bcb3aa67d6",
|
|
84
|
+
"@dxos/plugin-search": "0.8.4-main.bcb3aa67d6",
|
|
85
|
+
"@dxos/plugin-space": "0.8.4-main.bcb3aa67d6",
|
|
86
|
+
"@dxos/random": "0.8.4-main.bcb3aa67d6",
|
|
87
|
+
"@dxos/react-client": "0.8.4-main.bcb3aa67d6",
|
|
88
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
89
|
+
"@dxos/react-ui-menu": "0.8.4-main.bcb3aa67d6",
|
|
90
|
+
"@dxos/react-ui-form": "0.8.4-main.bcb3aa67d6",
|
|
91
|
+
"@dxos/invariant": "0.8.4-main.bcb3aa67d6",
|
|
92
|
+
"@dxos/plugin-graph": "0.8.4-main.bcb3aa67d6",
|
|
93
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bcb3aa67d6",
|
|
94
|
+
"@dxos/react-ui-stack": "0.8.4-main.bcb3aa67d6",
|
|
95
|
+
"@dxos/schema": "0.8.4-main.bcb3aa67d6",
|
|
96
|
+
"@dxos/types": "0.8.4-main.bcb3aa67d6",
|
|
97
|
+
"@dxos/util": "0.8.4-main.bcb3aa67d6"
|
|
78
98
|
},
|
|
79
99
|
"devDependencies": {
|
|
80
100
|
"@types/react": "~19.2.7",
|
|
81
101
|
"@types/react-dom": "~19.2.3",
|
|
82
102
|
"react": "~19.2.3",
|
|
83
103
|
"react-dom": "~19.2.3",
|
|
84
|
-
"vite": "7.1.
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/plugin-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
91
|
-
"@dxos/
|
|
104
|
+
"vite": "^7.1.11",
|
|
105
|
+
"@dxos/keys": "0.8.4-main.bcb3aa67d6",
|
|
106
|
+
"@dxos/echo-db": "0.8.4-main.bcb3aa67d6",
|
|
107
|
+
"@dxos/plugin-preview": "0.8.4-main.bcb3aa67d6",
|
|
108
|
+
"@dxos/plugin-testing": "0.8.4-main.bcb3aa67d6",
|
|
109
|
+
"@dxos/plugin-theme": "0.8.4-main.bcb3aa67d6",
|
|
110
|
+
"@dxos/storybook-utils": "0.8.4-main.bcb3aa67d6",
|
|
111
|
+
"@dxos/test-utils": "0.8.4-main.bcb3aa67d6",
|
|
112
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.bcb3aa67d6",
|
|
113
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
92
114
|
},
|
|
93
115
|
"peerDependencies": {
|
|
94
|
-
"effect": "3.
|
|
116
|
+
"effect": "3.20.0",
|
|
95
117
|
"react": "~19.2.3",
|
|
96
118
|
"react-dom": "~19.2.3",
|
|
97
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
98
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
119
|
+
"@dxos/react-ui": "0.8.4-main.bcb3aa67d6",
|
|
120
|
+
"@dxos/ui-theme": "0.8.4-main.bcb3aa67d6"
|
|
99
121
|
},
|
|
100
122
|
"publishConfig": {
|
|
101
123
|
"access": "public"
|
package/src/KanbanPlugin.tsx
CHANGED
|
@@ -3,43 +3,55 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { Plugin } from '@dxos/app-framework';
|
|
9
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Annotation, Type } from '@dxos/echo';
|
|
11
|
+
import { Operation } from '@dxos/operation';
|
|
9
12
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { View } from '@dxos/schema';
|
|
13
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
14
|
+
import { ViewModel } from '@dxos/schema';
|
|
13
15
|
|
|
14
|
-
import {
|
|
15
|
-
import { meta } from './meta';
|
|
16
|
+
import { meta } from '#meta';
|
|
16
17
|
import { translations } from './translations';
|
|
17
|
-
import { CreateKanbanSchema } from '
|
|
18
|
+
import { CreateKanbanSchema, Kanban } from '#types';
|
|
19
|
+
|
|
20
|
+
import { BlueprintDefinition, OperationHandler, UndoMappings, ReactSurface } from '#capabilities';
|
|
18
21
|
|
|
19
22
|
export const KanbanPlugin = Plugin.define(meta).pipe(
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),
|
|
24
|
+
AppPlugin.addMetadataModule({
|
|
22
25
|
metadata: {
|
|
23
26
|
id: Type.getTypename(Kanban.Kanban),
|
|
24
27
|
metadata: {
|
|
25
|
-
icon:
|
|
26
|
-
iconHue: '
|
|
28
|
+
icon: Annotation.IconAnnotation.get(Kanban.Kanban).pipe(Option.getOrThrow).icon,
|
|
29
|
+
iconHue: Annotation.IconAnnotation.get(Kanban.Kanban).pipe(Option.getOrThrow).hue ?? 'white',
|
|
27
30
|
inputSchema: CreateKanbanSchema,
|
|
28
|
-
createObject: ((props,
|
|
29
|
-
Effect.
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
createObject: ((props, options) =>
|
|
32
|
+
Effect.gen(function* () {
|
|
33
|
+
const object = yield* Effect.promise(async () => {
|
|
34
|
+
const { view } = await ViewModel.makeFromDatabase({
|
|
35
|
+
db: options.db,
|
|
36
|
+
typename: props.typename,
|
|
37
|
+
pivotFieldName: props.initialPivotColumn,
|
|
38
|
+
});
|
|
39
|
+
return Kanban.make({ name: props.name, view });
|
|
40
|
+
});
|
|
41
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
42
|
+
object,
|
|
43
|
+
target: options.target,
|
|
44
|
+
hidden: true,
|
|
45
|
+
targetNodeId: options.targetNodeId,
|
|
34
46
|
});
|
|
35
|
-
return Kanban.make({ name: props.name, view });
|
|
36
47
|
})) satisfies CreateObject,
|
|
37
48
|
},
|
|
38
49
|
},
|
|
39
50
|
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
52
|
+
AppPlugin.addOperationHandlerModule({ id: 'undo-mappings', activate: UndoMappings }),
|
|
53
|
+
AppPlugin.addSchemaModule({ schema: [Kanban.Kanban] }),
|
|
54
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
55
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
44
56
|
Plugin.make,
|
|
45
57
|
);
|
package/src/blueprints/index.ts
CHANGED
|
@@ -2,23 +2,27 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type AppCapabilities } from '@dxos/app-toolkit';
|
|
5
6
|
import { Blueprint, Template } from '@dxos/blueprints';
|
|
6
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
7
7
|
import { trim } from '@dxos/util';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
export const tools: string[] = [];
|
|
9
|
+
const BLUEPRINT_KEY = 'org.dxos.blueprint.kanban';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const make = () =>
|
|
11
|
+
const make = () =>
|
|
15
12
|
Blueprint.make({
|
|
16
|
-
key:
|
|
13
|
+
key: BLUEPRINT_KEY,
|
|
17
14
|
name: 'Kanban',
|
|
18
|
-
tools: Blueprint.toolDefinitions({
|
|
15
|
+
tools: Blueprint.toolDefinitions({ tools: [] }),
|
|
19
16
|
instructions: Template.make({
|
|
20
17
|
source: trim`
|
|
21
18
|
You can create and update kanban boards to show data in sorted columns defined by schema.
|
|
22
19
|
`,
|
|
23
20
|
}),
|
|
24
21
|
});
|
|
22
|
+
|
|
23
|
+
const blueprint: AppCapabilities.BlueprintDefinition = {
|
|
24
|
+
key: BLUEPRINT_KEY,
|
|
25
|
+
make,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default blueprint;
|
package/src/capabilities/{artifact-definition/artifact-definition.ts → artifact-definition.ts}
RENAMED
|
@@ -13,14 +13,15 @@ import { Capabilities, Capability, type PromiseIntentDispatcher } from '@dxos/ap
|
|
|
13
13
|
import { createArtifactElement } from '@dxos/assistant';
|
|
14
14
|
import { defineArtifact } from '@dxos/blueprints';
|
|
15
15
|
import { Obj, Query } from '@dxos/echo';
|
|
16
|
+
import { View } from '@dxos/echo';
|
|
16
17
|
import { invariant } from '@dxos/invariant';
|
|
17
|
-
import { SpaceOperation } from '@dxos/plugin-space/
|
|
18
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
18
19
|
import { Filter, type Space } from '@dxos/react-client/echo';
|
|
19
|
-
import {
|
|
20
|
-
import { View } from '@dxos/schema';
|
|
20
|
+
import { ViewModel } from '@dxos/schema';
|
|
21
21
|
import { isNonNullable } from '@dxos/util';
|
|
22
22
|
|
|
23
|
-
import { meta } from '
|
|
23
|
+
import { meta } from '#meta';
|
|
24
|
+
import { Kanban } from '#types';
|
|
24
25
|
|
|
25
26
|
const QualifiedId = Schema.String.annotations({
|
|
26
27
|
description: 'The fully qualified ID of the kanban `spaceID:objectID`',
|
|
@@ -43,7 +44,7 @@ export default Capability.makeModule(() =>
|
|
|
43
44
|
- When adding items, you must not include the 'id' field -- it is automatically generated
|
|
44
45
|
- BEFORE adding items, always make sure the board has been shown to the user!
|
|
45
46
|
`,
|
|
46
|
-
schema:
|
|
47
|
+
schema: Kanban.Kanban,
|
|
47
48
|
tools: [
|
|
48
49
|
createTool(meta.id, {
|
|
49
50
|
name: 'create',
|
|
@@ -69,7 +70,7 @@ export default Capability.makeModule(() =>
|
|
|
69
70
|
return ToolResult.Error(`Schema not found: ${typename}`);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
const { view } = await
|
|
73
|
+
const { view } = await ViewModel.makeFromDatabase({
|
|
73
74
|
db: extensions.space.db,
|
|
74
75
|
typename,
|
|
75
76
|
pivotFieldName: pivotColumn,
|
|
@@ -100,7 +101,7 @@ export default Capability.makeModule(() =>
|
|
|
100
101
|
const boardInfo = await Promise.all(
|
|
101
102
|
objects.map(async (view) => {
|
|
102
103
|
const kanban = await view.presentation.load();
|
|
103
|
-
if (!Obj.instanceOf(
|
|
104
|
+
if (!Obj.instanceOf(Kanban.Kanban, kanban)) {
|
|
104
105
|
return null;
|
|
105
106
|
}
|
|
106
107
|
|
|
@@ -129,7 +130,7 @@ export default Capability.makeModule(() =>
|
|
|
129
130
|
.first()) as View.View;
|
|
130
131
|
|
|
131
132
|
const kanban = await view.presentation.load();
|
|
132
|
-
invariant(Obj.instanceOf(
|
|
133
|
+
invariant(Obj.instanceOf(Kanban.Kanban, kanban));
|
|
133
134
|
|
|
134
135
|
const typename = view.query.typename;
|
|
135
136
|
const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();
|
|
@@ -137,7 +138,7 @@ export default Capability.makeModule(() =>
|
|
|
137
138
|
|
|
138
139
|
return ToolResult.Success({
|
|
139
140
|
schema,
|
|
140
|
-
columnField:
|
|
141
|
+
columnField: view.projection.pivotFieldId,
|
|
141
142
|
viewFields: view.projection.fields,
|
|
142
143
|
});
|
|
143
144
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
|
|
10
|
+
import { KanbanBlueprint } from '#blueprints';
|
|
11
|
+
|
|
12
|
+
const blueprintDefinition = Capability.makeModule<
|
|
13
|
+
[],
|
|
14
|
+
Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]
|
|
15
|
+
>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, KanbanBlueprint)]));
|
|
16
|
+
|
|
17
|
+
export default blueprintDefinition;
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));
|
|
9
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
10
|
+
'OperationHandler',
|
|
11
|
+
() => import('./operation-handler'),
|
|
12
|
+
);
|
|
13
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
14
|
+
export const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
6
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
import { KanbanOperationHandlerSet } from '#operations';
|
|
9
|
+
|
|
10
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
Effect.fnUntraced(function* () {
|
|
12
|
+
return Capability.contributes(Capabilities.OperationHandler, KanbanOperationHandlerSet);
|
|
13
|
+
}),
|
|
14
|
+
);
|
|
@@ -6,35 +6,35 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import type * as Schema from 'effect/Schema';
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
11
|
+
import { Database, JsonSchema, Obj } from '@dxos/echo';
|
|
12
|
+
import { type Collection } from '@dxos/echo';
|
|
11
13
|
import { findAnnotation } from '@dxos/effect';
|
|
12
14
|
import { type FormFieldComponentProps, SelectField, useFormValues } from '@dxos/react-ui-form';
|
|
13
|
-
import { Kanban } from '@dxos/react-ui-kanban/types';
|
|
14
|
-
import { type Collection } from '@dxos/schema';
|
|
15
15
|
|
|
16
|
-
import { KanbanContainer, KanbanViewEditor } from '
|
|
17
|
-
import { meta } from '
|
|
18
|
-
import { PivotColumnAnnotationId } from '
|
|
16
|
+
import { KanbanContainer, KanbanViewEditor } from '#containers';
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { Kanban, PivotColumnAnnotationId } from '#types';
|
|
19
19
|
|
|
20
20
|
export default Capability.makeModule(() =>
|
|
21
21
|
Effect.succeed(
|
|
22
|
-
Capability.contributes(
|
|
23
|
-
|
|
22
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
23
|
+
Surface.create({
|
|
24
24
|
id: meta.id,
|
|
25
25
|
role: ['article', 'section'],
|
|
26
26
|
filter: (data): data is { subject: Kanban.Kanban } => Obj.instanceOf(Kanban.Kanban, data.subject),
|
|
27
27
|
component: ({ data, role }) => <KanbanContainer role={role} subject={data.subject} />,
|
|
28
28
|
}),
|
|
29
|
-
|
|
30
|
-
id: `${meta.id}
|
|
29
|
+
Surface.create({
|
|
30
|
+
id: `${meta.id}.object-settings`,
|
|
31
31
|
role: 'object-settings',
|
|
32
32
|
position: 'hoist',
|
|
33
33
|
filter: (data): data is { subject: Kanban.Kanban } => Obj.instanceOf(Kanban.Kanban, data.subject),
|
|
34
|
-
component: ({ data }) => <KanbanViewEditor
|
|
34
|
+
component: ({ data }) => <KanbanViewEditor subject={data.subject} />,
|
|
35
35
|
}),
|
|
36
|
-
|
|
37
|
-
id: `${meta.id}
|
|
36
|
+
Surface.create({
|
|
37
|
+
id: `${meta.id}.create-initial-schema-form-[pivot-column]`,
|
|
38
38
|
role: 'form-input',
|
|
39
39
|
filter: (
|
|
40
40
|
data,
|
|
@@ -59,7 +59,7 @@ export default Capability.makeModule(() =>
|
|
|
59
59
|
[db, typename],
|
|
60
60
|
);
|
|
61
61
|
const singleSelectColumns = useMemo(() => {
|
|
62
|
-
const properties =
|
|
62
|
+
const properties = JsonSchema.toJsonSchema(selectedSchema).properties;
|
|
63
63
|
if (!properties) {
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright 2025 DXOS.org
|
|
2
|
+
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from '#meta';
|
|
8
|
+
import { KanbanOperation } from '#operations';
|
|
9
|
+
|
|
10
|
+
export default Capability.makeModule(() =>
|
|
11
|
+
Effect.succeed(
|
|
12
|
+
Capability.contributes(Capabilities.UndoMapping, [
|
|
13
|
+
UndoMapping.make({
|
|
14
|
+
operation: KanbanOperation.DeleteCardField,
|
|
15
|
+
inverse: KanbanOperation.RestoreCardField,
|
|
16
|
+
deriveContext: (input, output) => ({
|
|
17
|
+
view: input.view,
|
|
18
|
+
field: output.field,
|
|
19
|
+
props: output.props,
|
|
20
|
+
index: output.index,
|
|
21
|
+
}),
|
|
22
|
+
message: ['card-field-deleted.label', { ns: meta.id }],
|
|
23
|
+
}),
|
|
24
|
+
UndoMapping.make({
|
|
25
|
+
operation: KanbanOperation.DeleteCard,
|
|
26
|
+
inverse: KanbanOperation.RestoreCard,
|
|
27
|
+
deriveContext: (_input, output) => ({
|
|
28
|
+
card: output.card,
|
|
29
|
+
}),
|
|
30
|
+
message: ['card-deleted.label', { ns: meta.id }],
|
|
31
|
+
}),
|
|
32
|
+
]),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, RegistryContext } from '@effect-atom/atom-react';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
import { Filter, JsonSchema, Obj, Query } from '@dxos/echo';
|
|
10
|
+
import { type View } from '@dxos/echo';
|
|
11
|
+
import { faker } from '@dxos/random';
|
|
12
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
13
|
+
import { withMosaic } from '@dxos/react-ui-mosaic/testing';
|
|
14
|
+
import { ProjectionModel, ViewModel, createEchoChangeCallback } from '@dxos/schema';
|
|
15
|
+
import { withRegistry } from '@dxos/storybook-utils';
|
|
16
|
+
import { Organization } from '@dxos/types';
|
|
17
|
+
|
|
18
|
+
import { createEchoChangeCallback as createKanbanChangeCallback } from '#hooks';
|
|
19
|
+
import { KanbanCardTileSimple } from '#testing';
|
|
20
|
+
import { translations } from '../../translations';
|
|
21
|
+
import { Kanban } from '#types';
|
|
22
|
+
|
|
23
|
+
import { KanbanBoard } from './KanbanBoard';
|
|
24
|
+
|
|
25
|
+
faker.seed(1);
|
|
26
|
+
|
|
27
|
+
const createOrg = () => ({
|
|
28
|
+
name: faker.commerce.productName(),
|
|
29
|
+
description: faker.lorem.sentence(),
|
|
30
|
+
image: faker.image.url(),
|
|
31
|
+
website: faker.internet.url(),
|
|
32
|
+
status: faker.helpers.arrayElement(Organization.StatusOptions).id as Organization.Organization['status'],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* In-memory Kanban board: View + ProjectionModel + Kanban + items, no plugin manager or Space.
|
|
37
|
+
* Similar to react-ui-kanban Kanban.stories.tsx.
|
|
38
|
+
*/
|
|
39
|
+
const DefaultStory = () => {
|
|
40
|
+
const registry = useContext(RegistryContext);
|
|
41
|
+
const items = useMemo(() => Atom.make<Obj.Unknown[]>([]), []);
|
|
42
|
+
const [state, setState] = useState<{
|
|
43
|
+
view: View.View;
|
|
44
|
+
kanban: Kanban.Kanban;
|
|
45
|
+
projection: ProjectionModel;
|
|
46
|
+
change: ReturnType<typeof createKanbanChangeCallback>;
|
|
47
|
+
}>();
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const view = ViewModel.make({
|
|
51
|
+
query: Query.select(Filter.typename(Organization.Organization.typename)),
|
|
52
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
53
|
+
pivotFieldName: 'status',
|
|
54
|
+
});
|
|
55
|
+
const kanban = Kanban.make({ view });
|
|
56
|
+
const change = createKanbanChangeCallback(kanban);
|
|
57
|
+
const projection = new ProjectionModel({
|
|
58
|
+
registry,
|
|
59
|
+
view,
|
|
60
|
+
baseSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
61
|
+
change: createEchoChangeCallback(view),
|
|
62
|
+
});
|
|
63
|
+
projection.normalizeView();
|
|
64
|
+
|
|
65
|
+
const statuses = Organization.StatusOptions.map((o) => o.id);
|
|
66
|
+
const initialItems = Array.from({ length: 12 }, () =>
|
|
67
|
+
Obj.make(Organization.Organization, {
|
|
68
|
+
...createOrg(),
|
|
69
|
+
status: faker.helpers.arrayElement(statuses) as Organization.Organization['status'],
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
setState({ view, kanban, projection, change });
|
|
74
|
+
registry.set(items, initialItems);
|
|
75
|
+
}, [registry, items]);
|
|
76
|
+
|
|
77
|
+
const columnFieldPath =
|
|
78
|
+
state?.projection.tryGetFieldProjection(state.projection.getFieldId('status') ?? '')?.props.property ?? 'status';
|
|
79
|
+
|
|
80
|
+
const handleCardAdd = useCallback(
|
|
81
|
+
(columnValue: string | undefined) => {
|
|
82
|
+
if (!state || !columnFieldPath || !registry) return undefined;
|
|
83
|
+
const card = Obj.make(Organization.Organization, {
|
|
84
|
+
...createOrg(),
|
|
85
|
+
...(columnFieldPath ? { [columnFieldPath]: columnValue } : {}),
|
|
86
|
+
});
|
|
87
|
+
const current = registry.get(items) ?? [];
|
|
88
|
+
registry.set(items, [...current, card]);
|
|
89
|
+
return card.id;
|
|
90
|
+
},
|
|
91
|
+
[state, columnFieldPath, registry, items],
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const handleCardRemove = useCallback(
|
|
95
|
+
(card: Obj.Unknown) => {
|
|
96
|
+
if (!registry) return;
|
|
97
|
+
const current = registry.get(items) ?? [];
|
|
98
|
+
registry.set(
|
|
99
|
+
items,
|
|
100
|
+
current.filter((i) => i.id !== card.id),
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
[registry, items],
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
if (!state) {
|
|
107
|
+
return <></>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<KanbanBoard.Root
|
|
112
|
+
kanban={state.kanban}
|
|
113
|
+
projection={state.projection}
|
|
114
|
+
items={items}
|
|
115
|
+
itemTile={KanbanCardTileSimple}
|
|
116
|
+
change={state.change}
|
|
117
|
+
onCardAdd={handleCardAdd}
|
|
118
|
+
onCardRemove={handleCardRemove}
|
|
119
|
+
>
|
|
120
|
+
<KanbanBoard.Content />
|
|
121
|
+
</KanbanBoard.Root>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const meta = {
|
|
126
|
+
title: 'plugins/plugin-kanban/components/KanbanBoard',
|
|
127
|
+
component: DefaultStory,
|
|
128
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withMosaic(), withRegistry],
|
|
129
|
+
parameters: {
|
|
130
|
+
layout: 'fullscreen',
|
|
131
|
+
translations,
|
|
132
|
+
},
|
|
133
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
134
|
+
|
|
135
|
+
export default meta;
|
|
136
|
+
|
|
137
|
+
type Story = StoryObj<typeof meta>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* In-memory board with Echo-shaped objects. No plugin manager, client, or Space.
|
|
141
|
+
*/
|
|
142
|
+
export const Default: Story = {};
|