@dxos/plugin-kanban 0.6.8-main.046e6cf

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.
Files changed (74) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +15 -0
  3. package/dist/lib/browser/KanbanMain-OVUL576T.mjs +444 -0
  4. package/dist/lib/browser/KanbanMain-OVUL576T.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-DMDAZVOX.mjs +21 -0
  6. package/dist/lib/browser/chunk-DMDAZVOX.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-LEPZRV4E.mjs +47 -0
  8. package/dist/lib/browser/chunk-LEPZRV4E.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +176 -0
  10. package/dist/lib/browser/index.mjs.map +7 -0
  11. package/dist/lib/browser/meta.json +1 -0
  12. package/dist/lib/browser/meta.mjs +9 -0
  13. package/dist/lib/browser/meta.mjs.map +7 -0
  14. package/dist/lib/browser/types/index.mjs +14 -0
  15. package/dist/lib/browser/types/index.mjs.map +7 -0
  16. package/dist/lib/node/KanbanMain-RSRZLAM5.cjs +453 -0
  17. package/dist/lib/node/KanbanMain-RSRZLAM5.cjs.map +7 -0
  18. package/dist/lib/node/chunk-CJTEPA5Z.cjs +54 -0
  19. package/dist/lib/node/chunk-CJTEPA5Z.cjs.map +7 -0
  20. package/dist/lib/node/chunk-RYK4NJNG.cjs +67 -0
  21. package/dist/lib/node/chunk-RYK4NJNG.cjs.map +7 -0
  22. package/dist/lib/node/index.cjs +192 -0
  23. package/dist/lib/node/index.cjs.map +7 -0
  24. package/dist/lib/node/meta.cjs +30 -0
  25. package/dist/lib/node/meta.cjs.map +7 -0
  26. package/dist/lib/node/meta.json +1 -0
  27. package/dist/lib/node/types/index.cjs +36 -0
  28. package/dist/lib/node/types/index.cjs.map +7 -0
  29. package/dist/types/src/KanbanPlugin.d.ts +4 -0
  30. package/dist/types/src/KanbanPlugin.d.ts.map +1 -0
  31. package/dist/types/src/components/KanbanBoard.d.ts +6 -0
  32. package/dist/types/src/components/KanbanBoard.d.ts.map +1 -0
  33. package/dist/types/src/components/KanbanCard.d.ts +9 -0
  34. package/dist/types/src/components/KanbanCard.d.ts.map +1 -0
  35. package/dist/types/src/components/KanbanColumn.d.ts +14 -0
  36. package/dist/types/src/components/KanbanColumn.d.ts.map +1 -0
  37. package/dist/types/src/components/KanbanMain.d.ts +7 -0
  38. package/dist/types/src/components/KanbanMain.d.ts.map +1 -0
  39. package/dist/types/src/components/index.d.ts +5 -0
  40. package/dist/types/src/components/index.d.ts.map +1 -0
  41. package/dist/types/src/components/util.d.ts +7 -0
  42. package/dist/types/src/components/util.d.ts.map +1 -0
  43. package/dist/types/src/index.d.ts +4 -0
  44. package/dist/types/src/index.d.ts.map +1 -0
  45. package/dist/types/src/meta.d.ts +15 -0
  46. package/dist/types/src/meta.d.ts.map +1 -0
  47. package/dist/types/src/sanity.test.d.ts +2 -0
  48. package/dist/types/src/sanity.test.d.ts.map +1 -0
  49. package/dist/types/src/stories/testing.d.ts +19 -0
  50. package/dist/types/src/stories/testing.d.ts.map +1 -0
  51. package/dist/types/src/translations.d.ts +20 -0
  52. package/dist/types/src/translations.d.ts.map +1 -0
  53. package/dist/types/src/types/index.d.ts +3 -0
  54. package/dist/types/src/types/index.d.ts.map +1 -0
  55. package/dist/types/src/types/kanban.d.ts +76 -0
  56. package/dist/types/src/types/kanban.d.ts.map +1 -0
  57. package/dist/types/src/types/types.d.ts +18 -0
  58. package/dist/types/src/types/types.d.ts.map +1 -0
  59. package/package.json +85 -0
  60. package/src/KanbanPlugin.tsx +112 -0
  61. package/src/components/KanbanBoard.tsx +195 -0
  62. package/src/components/KanbanCard.tsx +82 -0
  63. package/src/components/KanbanColumn.tsx +143 -0
  64. package/src/components/KanbanMain.tsx +37 -0
  65. package/src/components/index.ts +8 -0
  66. package/src/components/util.ts +38 -0
  67. package/src/index.ts +9 -0
  68. package/src/meta.tsx +19 -0
  69. package/src/sanity.test.ts +13 -0
  70. package/src/stories/testing.ts +29 -0
  71. package/src/translations.ts +26 -0
  72. package/src/types/index.ts +6 -0
  73. package/src/types/kanban.ts +22 -0
  74. package/src/types/types.ts +57 -0
package/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ MIT License
2
+ Copyright (c) 2022 DXOS
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @dxos/plugin-kanban
2
+
3
+ Surface plugin for kanban entities.
4
+
5
+ ## DXOS Resources
6
+
7
+ - [Website](https://dxos.org)
8
+ - [Developer Documentation](https://docs.dxos.org)
9
+ - Talk to us on [Discord](https://dxos.org/discord)
10
+
11
+ ## Contributions
12
+
13
+ Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
14
+
15
+ License: [MIT](./LICENSE) Copyright 2023 © DXOS
@@ -0,0 +1,444 @@
1
+ import {
2
+ KanbanColumnType,
3
+ KanbanItemType
4
+ } from "./chunk-LEPZRV4E.mjs";
5
+ import {
6
+ KANBAN_PLUGIN
7
+ } from "./chunk-DMDAZVOX.mjs";
8
+
9
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanMain.tsx
10
+ import React4 from "react";
11
+ import { create } from "@dxos/echo-schema";
12
+ import { getSpace } from "@dxos/react-client/echo";
13
+ import { Main } from "@dxos/react-ui";
14
+ import { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from "@dxos/react-ui-theme";
15
+
16
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanBoard.tsx
17
+ import { DndContext, DragOverlay, MouseSensor, useSensor } from "@dnd-kit/core";
18
+ import { horizontalListSortingStrategy, SortableContext as SortableContext2 } from "@dnd-kit/sortable";
19
+ import React3, { useEffect as useEffect2, useState as useState2 } from "react";
20
+ import { createSubscription as createSubscription2 } from "@dxos/react-client/echo";
21
+ import { arrayMove, nonNullable as nonNullable3 } from "@dxos/util";
22
+
23
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanCard.tsx
24
+ import { useSortable } from "@dnd-kit/sortable";
25
+ import { CSS } from "@dnd-kit/utilities";
26
+ import { DotsSixVertical, X } from "@phosphor-icons/react";
27
+ import React from "react";
28
+ import { createDocAccessor } from "@dxos/react-client/echo";
29
+ import { Button, useThemeContext, useTranslation } from "@dxos/react-ui";
30
+ import { createBasicExtensions, createDataExtensions, createThemeExtensions, useTextEditor } from "@dxos/react-ui-editor";
31
+ import { getSize, mx, attentionSurface, focusRing } from "@dxos/react-ui-theme";
32
+ var DeleteItem = ({ onClick }) => {
33
+ const { t } = useTranslation(KANBAN_PLUGIN);
34
+ return /* @__PURE__ */ React.createElement(Button, {
35
+ variant: "ghost",
36
+ onClick,
37
+ classNames: "plb-0 pli-0.5 -mlb-1"
38
+ }, /* @__PURE__ */ React.createElement("span", {
39
+ className: "sr-only"
40
+ }, t("delete item label")), /* @__PURE__ */ React.createElement(X, {
41
+ className: getSize(4)
42
+ }));
43
+ };
44
+ var KanbanCardComponent = ({ column, item, debug = false, onDelete }) => {
45
+ const { themeMode } = useThemeContext();
46
+ const { t } = useTranslation(KANBAN_PLUGIN);
47
+ const { isDragging, attributes, listeners, transform, transition, setNodeRef } = useSortable({
48
+ id: item.id,
49
+ data: {
50
+ type: "item",
51
+ column
52
+ }
53
+ });
54
+ const tx = transform ? Object.assign(transform, {
55
+ scaleY: 1
56
+ }) : null;
57
+ const { parentRef, focusAttributes } = useTextEditor(() => ({
58
+ initialValue: item.name,
59
+ extensions: [
60
+ createDataExtensions({
61
+ id: item.id,
62
+ text: createDocAccessor(item, [
63
+ "name"
64
+ ])
65
+ }),
66
+ createBasicExtensions({
67
+ placeholder: t("item title placeholder")
68
+ }),
69
+ createThemeExtensions({
70
+ themeMode
71
+ })
72
+ ]
73
+ }), [
74
+ item,
75
+ themeMode
76
+ ]);
77
+ return /* @__PURE__ */ React.createElement("div", {
78
+ ref: setNodeRef,
79
+ style: {
80
+ transform: CSS.Transform.toString(tx),
81
+ transition
82
+ },
83
+ className: mx("flex grow", isDragging && "border border-neutral-400 dark:border-neutral-800")
84
+ }, /* @__PURE__ */ React.createElement("div", {
85
+ className: mx("flex items-start grow p-1", attentionSurface, isDragging && "opacity-10")
86
+ }, /* @__PURE__ */ React.createElement("button", {
87
+ className: "flex h-[40px] items-center",
88
+ ...attributes,
89
+ ...listeners
90
+ }, /* @__PURE__ */ React.createElement(DotsSixVertical, {
91
+ className: getSize(5)
92
+ })), /* @__PURE__ */ React.createElement("div", {
93
+ className: "flex flex-col grow pt-1"
94
+ }, /* @__PURE__ */ React.createElement("div", {
95
+ ...focusAttributes,
96
+ className: mx(focusRing, "rounded-sm p-1"),
97
+ ref: parentRef
98
+ }), debug && /* @__PURE__ */ React.createElement("div", {
99
+ className: "text-xs text-red-800"
100
+ }, item.id.slice(0, 9))), onDelete && /* @__PURE__ */ React.createElement("div", {
101
+ className: "flex h-[40px] items-center"
102
+ }, /* @__PURE__ */ React.createElement(DeleteItem, {
103
+ onClick: onDelete
104
+ }))));
105
+ };
106
+
107
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanColumn.tsx
108
+ import { useDroppable } from "@dnd-kit/core";
109
+ import { SortableContext, useSortable as useSortable2, verticalListSortingStrategy } from "@dnd-kit/sortable";
110
+ import { CSS as CSS2 } from "@dnd-kit/utilities";
111
+ import { DotsSixVertical as DotsSixVertical2, X as X2, Plus } from "@phosphor-icons/react";
112
+ import React2 from "react";
113
+ import { Button as Button2, Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
114
+ import { modalSurface, getSize as getSize2, groupSurface, mx as mx2 } from "@dxos/react-ui-theme";
115
+ import { nonNullable as nonNullable2 } from "@dxos/util";
116
+
117
+ // packages/plugins/experimental/plugin-kanban/src/components/util.ts
118
+ import { useEffect, useState } from "react";
119
+ import { createSubscription } from "@dxos/react-client/echo";
120
+ import { nonNullable } from "@dxos/util";
121
+ var useSubscription = (data) => {
122
+ const [_, setIter] = useState([]);
123
+ useEffect(() => {
124
+ const handle = createSubscription(() => setIter([]));
125
+ handle.update(data);
126
+ return () => handle.unsubscribe();
127
+ }, []);
128
+ };
129
+ var findLocation = (columns, id) => {
130
+ for (const column of columns) {
131
+ if (column.id === id) {
132
+ return {
133
+ column
134
+ };
135
+ } else {
136
+ const idx = column.items.filter(nonNullable).findIndex((item) => item.id === id);
137
+ if (idx !== -1) {
138
+ return {
139
+ column,
140
+ item: column.items[idx],
141
+ idx
142
+ };
143
+ }
144
+ }
145
+ }
146
+ };
147
+
148
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanColumn.tsx
149
+ var DeleteColumn = ({ onClick }) => {
150
+ const { t } = useTranslation2(KANBAN_PLUGIN);
151
+ return /* @__PURE__ */ React2.createElement(Button2, {
152
+ variant: "ghost",
153
+ onClick,
154
+ classNames: "plb-0 pli-0.5 -mlb-1"
155
+ }, /* @__PURE__ */ React2.createElement("span", {
156
+ className: "sr-only"
157
+ }, t("delete column label")), /* @__PURE__ */ React2.createElement(X2, {
158
+ className: getSize2(4)
159
+ }));
160
+ };
161
+ var AddItem = ({ onClick }) => {
162
+ const { t } = useTranslation2(KANBAN_PLUGIN);
163
+ return /* @__PURE__ */ React2.createElement(Button2, {
164
+ variant: "ghost",
165
+ onClick,
166
+ classNames: "plb-0 pli-0.5 -mlb-1"
167
+ }, /* @__PURE__ */ React2.createElement("span", {
168
+ className: "sr-only"
169
+ }, t("add item label")), /* @__PURE__ */ React2.createElement(Plus, {
170
+ className: getSize2(4)
171
+ }));
172
+ };
173
+ var KanbanColumnComponentPlaceholder = ({ onAdd }) => {
174
+ const { t } = useTranslation2(KANBAN_PLUGIN);
175
+ return /* @__PURE__ */ React2.createElement("div", {
176
+ className: mx2("flex flex-col justify-center shadow rounded w-[300px] h-[300px]", groupSurface)
177
+ }, /* @__PURE__ */ React2.createElement(Button2, {
178
+ variant: "ghost",
179
+ onClick: onAdd,
180
+ classNames: "plb-0 pli-0.5 -mlb-1"
181
+ }, /* @__PURE__ */ React2.createElement("span", {
182
+ className: "sr-only"
183
+ }, t("add column label")), /* @__PURE__ */ React2.createElement(Plus, {
184
+ className: getSize2(6)
185
+ })));
186
+ };
187
+ var KanbanColumnComponent = ({ column, itemMapper, debug = false, onCreate, onDelete }) => {
188
+ const { t } = useTranslation2(KANBAN_PLUGIN);
189
+ useSubscription([
190
+ column.items
191
+ ]);
192
+ const items = itemMapper?.(column.id, column.items.filter(nonNullable2)) ?? column.items;
193
+ const { setNodeRef: setDroppableNodeRef } = useDroppable({
194
+ id: column.id
195
+ });
196
+ const { isDragging, attributes, listeners, transform, transition, setNodeRef } = useSortable2({
197
+ id: column.id,
198
+ data: {
199
+ type: "column"
200
+ }
201
+ });
202
+ const tx = transform ? Object.assign(transform, {
203
+ scaleY: 1
204
+ }) : null;
205
+ const handleAddItem = onCreate ? () => {
206
+ const item = onCreate(column);
207
+ column.items.splice(column.items.length, 0, item);
208
+ } : void 0;
209
+ const handleDeleteItem = (id) => {
210
+ const index = column.items.filter(nonNullable2).findIndex((column2) => column2.id === id);
211
+ if (index >= 0) {
212
+ column.items.splice(index, 1);
213
+ }
214
+ };
215
+ return /* @__PURE__ */ React2.createElement("div", {
216
+ ref: setNodeRef,
217
+ style: {
218
+ transform: CSS2.Transform.toString(tx),
219
+ transition
220
+ },
221
+ className: mx2("flex flex-col snap-center overflow-y-hidden", isDragging && "relative z-10")
222
+ }, /* @__PURE__ */ React2.createElement("div", {
223
+ className: mx2("flex flex-col py-2 overflow-hidden shadow rounded w-[300px] min-h-[300px]", isDragging ? modalSurface : groupSurface)
224
+ }, /* @__PURE__ */ React2.createElement("div", {
225
+ className: "flex items-center mb-2 px-2"
226
+ }, /* @__PURE__ */ React2.createElement("button", {
227
+ ...attributes,
228
+ ...listeners
229
+ }, /* @__PURE__ */ React2.createElement(DotsSixVertical2, {
230
+ className: getSize2(5)
231
+ })), /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.Label, {
232
+ srOnly: true
233
+ }, t("column title label")), /* @__PURE__ */ React2.createElement(Input.TextInput, {
234
+ variant: "subdued",
235
+ classNames: "px-2",
236
+ placeholder: t("column title placeholder"),
237
+ defaultValue: column.name,
238
+ onChange: ({ target: { value } }) => column.name = value
239
+ })), onDelete && /* @__PURE__ */ React2.createElement(DeleteColumn, {
240
+ onClick: onDelete
241
+ })), /* @__PURE__ */ React2.createElement(SortableContext, {
242
+ strategy: verticalListSortingStrategy,
243
+ items: items.filter(nonNullable2).map(({ id }) => id)
244
+ }, /* @__PURE__ */ React2.createElement("div", {
245
+ ref: setDroppableNodeRef,
246
+ className: "flex flex-col grow overflow-y-scroll space-y-2 pr-4"
247
+ }, items.filter(nonNullable2).map((item) => /* @__PURE__ */ React2.createElement("div", {
248
+ key: item.id,
249
+ id: item.id,
250
+ className: "flex pl-2"
251
+ }, /* @__PURE__ */ React2.createElement(KanbanCardComponent, {
252
+ column,
253
+ item,
254
+ onDelete: () => handleDeleteItem(item.id)
255
+ }))))), handleAddItem && /* @__PURE__ */ React2.createElement("div", {
256
+ className: "flex justify-center mt-2"
257
+ }, /* @__PURE__ */ React2.createElement(AddItem, {
258
+ onClick: handleAddItem
259
+ })), debug && /* @__PURE__ */ React2.createElement("div", {
260
+ className: "px-2 text-xs text-red-800"
261
+ }, column.id.slice(0, 9))));
262
+ };
263
+
264
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanBoard.tsx
265
+ var KanbanBoard = ({ model }) => {
266
+ const kanban = model.root;
267
+ useSubscription(kanban.columns);
268
+ const [_, setIter] = useState2([]);
269
+ useEffect2(() => {
270
+ const handle = createSubscription2(() => setIter([]));
271
+ handle.update([
272
+ kanban.columns
273
+ ]);
274
+ return () => handle.unsubscribe();
275
+ }, []);
276
+ const mouseSensor = useSensor(MouseSensor, {
277
+ activationConstraint: {
278
+ distance: 8
279
+ }
280
+ });
281
+ const [draggingColumn, setDraggingColumn] = useState2();
282
+ const [draggingItem, setDraggingItem] = useState2();
283
+ const itemMapper = (column, items) => {
284
+ const { source, target } = draggingItem ?? {};
285
+ if (source && target) {
286
+ if (source?.column.id !== target?.column.id && (column === source?.column.id || column === target?.column.id)) {
287
+ const modified = [
288
+ ...items
289
+ ];
290
+ if (column === source.column.id) {
291
+ modified.splice(source.idx, 1);
292
+ } else if (column === target.column.id) {
293
+ modified.splice(target.idx ?? modified.length, 0, source.item);
294
+ }
295
+ return modified;
296
+ }
297
+ }
298
+ return items;
299
+ };
300
+ const handleDragStart = ({ active }) => {
301
+ kanban.columns.filter(nonNullable3).forEach((column) => {
302
+ if (column.id === active.id) {
303
+ setDraggingColumn(column);
304
+ } else {
305
+ const idx = column.items.filter(nonNullable3).findIndex((item) => item.id === active.id);
306
+ if (idx !== -1) {
307
+ setDraggingItem({
308
+ source: {
309
+ column,
310
+ item: column.items[idx],
311
+ idx
312
+ }
313
+ });
314
+ }
315
+ }
316
+ });
317
+ };
318
+ const handleDragMove = (event) => {
319
+ };
320
+ const handleDragOver = ({ active, over }) => {
321
+ if (draggingItem) {
322
+ const { source } = draggingItem;
323
+ const target = findLocation(kanban.columns.filter(nonNullable3), over?.id);
324
+ if (active.id !== over?.id) {
325
+ setDraggingItem({
326
+ source,
327
+ target
328
+ });
329
+ }
330
+ }
331
+ };
332
+ const handleDragEnd = (event) => {
333
+ if (draggingColumn) {
334
+ const { active, over } = event;
335
+ const oldIndex = kanban.columns.filter(nonNullable3).findIndex((column) => column.id === active.id);
336
+ const newIndex = kanban.columns.filter(nonNullable3).findIndex((column) => column.id === over?.id);
337
+ arrayMove(kanban.columns, oldIndex, newIndex);
338
+ } else if (draggingItem) {
339
+ const { source, target } = draggingItem;
340
+ if (source.column.id === target.column.id) {
341
+ if (target.idx !== void 0) {
342
+ arrayMove(source.column.items, source.idx, target.idx);
343
+ }
344
+ } else {
345
+ source.column.items.splice(source.idx, 1);
346
+ target.column.items.splice(target.idx ?? target.column.items.length, 0, source.item);
347
+ }
348
+ }
349
+ setDraggingColumn(void 0);
350
+ setDraggingItem(void 0);
351
+ };
352
+ const handleDragCancel = () => {
353
+ setDraggingColumn(void 0);
354
+ setDraggingItem(void 0);
355
+ };
356
+ const handleCreateColumn = () => {
357
+ const column = model.createColumn();
358
+ kanban.columns.splice(kanban.columns.length, 0, column);
359
+ };
360
+ const handleDeleteColumn = (id) => {
361
+ const index = kanban.columns.filter(nonNullable3).findIndex((column) => column.id === id);
362
+ if (index >= 0) {
363
+ kanban.columns.splice(index, 1);
364
+ }
365
+ };
366
+ const customModifier = ({ transform }) => {
367
+ if (draggingColumn) {
368
+ return {
369
+ ...transform,
370
+ y: 0
371
+ };
372
+ } else {
373
+ return transform;
374
+ }
375
+ };
376
+ return /* @__PURE__ */ React3.createElement("div", {
377
+ className: "flex overflow-x-scroll"
378
+ }, /* @__PURE__ */ React3.createElement("div", {
379
+ className: "flex m-4 space-x-4 snap-x"
380
+ }, /* @__PURE__ */ React3.createElement(DndContext, {
381
+ sensors: [
382
+ mouseSensor
383
+ ],
384
+ modifiers: [
385
+ customModifier
386
+ ],
387
+ onDragStart: handleDragStart,
388
+ onDragMove: handleDragMove,
389
+ onDragOver: handleDragOver,
390
+ onDragEnd: handleDragEnd,
391
+ onDragCancel: handleDragCancel
392
+ }, /* @__PURE__ */ React3.createElement(SortableContext2, {
393
+ strategy: horizontalListSortingStrategy,
394
+ items: kanban.columns.filter(nonNullable3).map(({ id }) => id)
395
+ }, kanban.columns.filter(nonNullable3).map((column) => /* @__PURE__ */ React3.createElement(KanbanColumnComponent, {
396
+ key: column.id,
397
+ column,
398
+ itemMapper,
399
+ onCreate: (column2) => model.createItem(column2),
400
+ onDelete: () => handleDeleteColumn(column.id)
401
+ }))), draggingItem && /* @__PURE__ */ React3.createElement(DragOverlay, {
402
+ style: {
403
+ margin: 0
404
+ }
405
+ }, /* @__PURE__ */ React3.createElement(KanbanCardComponent, {
406
+ item: draggingItem.source.item,
407
+ onDelete: () => {
408
+ }
409
+ })), handleCreateColumn && /* @__PURE__ */ React3.createElement(KanbanColumnComponentPlaceholder, {
410
+ onAdd: handleCreateColumn
411
+ }))));
412
+ };
413
+
414
+ // packages/plugins/experimental/plugin-kanban/src/components/KanbanMain.tsx
415
+ var KanbanMain = ({ kanban }) => {
416
+ const space = getSpace(kanban);
417
+ if (!space) {
418
+ return null;
419
+ }
420
+ const model = {
421
+ root: kanban,
422
+ createColumn: () => space.db.add(create(KanbanColumnType, {
423
+ items: []
424
+ })),
425
+ // TODO(burdon): Add metadata from column in the case of projections.
426
+ createItem: (column) => space.db.add(create(KanbanItemType, {
427
+ name: ""
428
+ }))
429
+ };
430
+ return /* @__PURE__ */ React4.createElement(Main.Content, {
431
+ classNames: [
432
+ fixedInsetFlexLayout,
433
+ topbarBlockPaddingStart,
434
+ bottombarBlockPaddingEnd
435
+ ]
436
+ }, /* @__PURE__ */ React4.createElement(KanbanBoard, {
437
+ model
438
+ }));
439
+ };
440
+ var KanbanMain_default = KanbanMain;
441
+ export {
442
+ KanbanMain_default as default
443
+ };
444
+ //# sourceMappingURL=KanbanMain-OVUL576T.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/KanbanMain.tsx", "../../../src/components/KanbanBoard.tsx", "../../../src/components/KanbanCard.tsx", "../../../src/components/KanbanColumn.tsx", "../../../src/components/util.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC } from 'react';\n\nimport { create } from '@dxos/echo-schema';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { Main } from '@dxos/react-ui';\nimport { topbarBlockPaddingStart, fixedInsetFlexLayout, bottombarBlockPaddingEnd } from '@dxos/react-ui-theme';\n\nimport { KanbanBoard } from './KanbanBoard';\nimport { type KanbanType, KanbanColumnType, KanbanItemType, type KanbanModel } from '../types';\n\nconst KanbanMain: FC<{ kanban: KanbanType }> = ({ kanban }) => {\n // const { t } = useTranslation(KANBAN_PLUGIN);\n const space = getSpace(kanban);\n if (!space) {\n return null;\n }\n\n // TODO(burdon): Should plugin create and pass in model?\n const model: KanbanModel = {\n root: kanban, // TODO(burdon): How to keep pure?\n createColumn: () => space.db.add(create(KanbanColumnType, { items: [] })),\n // TODO(burdon): Add metadata from column in the case of projections.\n createItem: (column) => space.db.add(create(KanbanItemType, { name: '' })),\n };\n\n return (\n <Main.Content classNames={[fixedInsetFlexLayout, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}>\n <KanbanBoard model={model} />\n </Main.Content>\n );\n};\n\nexport default KanbanMain;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n DndContext,\n type DragEndEvent,\n type DragMoveEvent,\n type DragOverEvent,\n DragOverlay,\n type DragStartEvent,\n type Modifier,\n MouseSensor,\n useSensor,\n} from '@dnd-kit/core';\nimport { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortable';\nimport React, { type FC, useEffect, useState } from 'react';\n\nimport { createSubscription } from '@dxos/react-client/echo';\nimport { arrayMove, nonNullable } from '@dxos/util';\n\nimport { KanbanCardComponent } from './KanbanCard';\nimport { type ItemsMapper, KanbanColumnComponent, KanbanColumnComponentPlaceholder } from './KanbanColumn';\nimport { findLocation, useSubscription } from './util';\nimport type { KanbanColumnType, KanbanItemType, Location, KanbanModel } from '../types';\n\n// TODO(burdon): Touch sensors.\n// TODO(burdon): Prevent browser nav back when swiping left/right.\n// TODO(burdon): Consistently use FC?\nexport const KanbanBoard: FC<{ model: KanbanModel }> = ({ model }) => {\n const kanban = model.root;\n // TODO(wittjosiah): Remove?\n useSubscription(kanban.columns);\n\n // TODO(burdon): Remove since now uses ECHO.\n const [_, setIter] = useState([]);\n\n useEffect(() => {\n const handle = createSubscription(() => setIter([]));\n handle.update([kanban.columns]);\n return () => handle.unsubscribe();\n }, []);\n\n const mouseSensor = useSensor(MouseSensor, {\n activationConstraint: {\n distance: 8,\n },\n });\n\n // Dragging column.\n // TODO(burdon): Dragging column causes flickering when dragging left to first column.\n const [draggingColumn, setDraggingColumn] = useState<KanbanColumnType | undefined>();\n\n // Dragging item.\n const [draggingItem, setDraggingItem] = useState<{ source: Location; target?: Location }>();\n // While dragging, temporarily remap which items should be visible inside each column.\n const itemMapper: ItemsMapper = (column: string, items: KanbanItemType[]) => {\n const { source, target } = draggingItem ?? {};\n if (source && target) {\n if (source?.column.id !== target?.column.id && (column === source?.column.id || column === target?.column.id)) {\n const modified = [...items];\n if (column === source.column.id) {\n // Temporarily remove from old column.\n modified.splice(source.idx!, 1);\n } else if (column === target.column.id) {\n // Temporarily insert into new column.\n // TODO(burdon): Use ref to track item being temporarily moved.\n modified.splice(target.idx ?? modified.length, 0, source.item!);\n }\n\n return modified;\n }\n }\n\n return items;\n };\n\n const handleDragStart = ({ active }: DragStartEvent) => {\n kanban.columns.filter(nonNullable).forEach((column) => {\n if (column.id === active.id) {\n setDraggingColumn(column);\n } else {\n const idx = column.items.filter(nonNullable).findIndex((item) => item.id === active.id);\n if (idx !== -1) {\n setDraggingItem({ source: { column, item: column.items![idx], idx } });\n }\n }\n });\n };\n\n const handleDragMove = (event: DragMoveEvent) => {};\n\n const handleDragOver = ({ active, over }: DragOverEvent) => {\n if (draggingItem) {\n const { source } = draggingItem;\n const target = findLocation(kanban.columns.filter(nonNullable), over?.id as string);\n if (active.id !== over?.id) {\n setDraggingItem({ source, target });\n }\n }\n };\n\n // TODO(burdon): Call model to update.\n const handleDragEnd = (event: DragEndEvent) => {\n if (draggingColumn) {\n const { active, over } = event;\n const oldIndex = kanban.columns.filter(nonNullable).findIndex((column) => column.id === active.id);\n const newIndex = kanban.columns.filter(nonNullable).findIndex((column) => column.id === over?.id);\n arrayMove(kanban.columns, oldIndex, newIndex);\n } else if (draggingItem) {\n const { source, target } = draggingItem;\n if (source.column.id === target!.column.id) {\n if (target!.idx !== undefined) {\n arrayMove(source.column.items!, source.idx!, target!.idx);\n }\n } else {\n source.column.items!.splice(source.idx!, 1);\n // TODO(burdon): Incorrect position when moving to new column.\n target!.column.items!.splice(target!.idx ?? target!.column.items!.length, 0, source.item!);\n }\n }\n\n setDraggingColumn(undefined);\n setDraggingItem(undefined);\n };\n\n const handleDragCancel = () => {\n setDraggingColumn(undefined);\n setDraggingItem(undefined);\n };\n\n const handleCreateColumn = () => {\n const column = model.createColumn();\n kanban.columns.splice(kanban.columns.length, 0, column);\n };\n\n // TODO(burdon): Move to model.\n const handleDeleteColumn = (id: string) => {\n const index = kanban.columns.filter(nonNullable).findIndex((column) => column.id === id);\n if (index >= 0) {\n kanban.columns.splice(index, 1);\n }\n };\n\n const customModifier: Modifier = ({ transform }) => {\n if (draggingColumn) {\n return {\n ...transform,\n y: 0,\n };\n } else {\n return transform;\n }\n };\n\n return (\n <div className='flex overflow-x-scroll'>\n <div className='flex m-4 space-x-4 snap-x'>\n <DndContext\n sensors={[mouseSensor]}\n modifiers={[customModifier]}\n onDragStart={handleDragStart}\n onDragMove={handleDragMove}\n onDragOver={handleDragOver}\n onDragEnd={handleDragEnd}\n onDragCancel={handleDragCancel}\n >\n <SortableContext\n strategy={horizontalListSortingStrategy}\n items={kanban.columns.filter(nonNullable).map(({ id }) => id!)}\n >\n {kanban.columns.filter(nonNullable).map((column) => (\n <KanbanColumnComponent\n key={column.id}\n column={column}\n itemMapper={itemMapper}\n onCreate={(column: KanbanColumnType) => model.createItem(column)}\n onDelete={() => handleDeleteColumn(column.id!)}\n />\n ))}\n </SortableContext>\n\n {/* Overlay required to drag across columns. */}\n {draggingItem && (\n <DragOverlay style={{ margin: 0 }}>\n <KanbanCardComponent item={draggingItem.source.item!} onDelete={() => {}} />\n </DragOverlay>\n )}\n\n {handleCreateColumn && <KanbanColumnComponentPlaceholder onAdd={handleCreateColumn} />}\n </DndContext>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { DotsSixVertical, X } from '@phosphor-icons/react';\nimport React, { type FC } from 'react';\n\nimport { createDocAccessor } from '@dxos/react-client/echo';\nimport { Button, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport {\n createBasicExtensions,\n createDataExtensions,\n createThemeExtensions,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { getSize, mx, attentionSurface, focusRing } from '@dxos/react-ui-theme';\n\nimport { KANBAN_PLUGIN } from '../meta';\nimport { type KanbanColumnType, type KanbanItemType } from '../types';\n\nconst DeleteItem = ({ onClick }: { onClick: () => void }) => {\n const { t } = useTranslation(KANBAN_PLUGIN);\n return (\n <Button variant='ghost' onClick={onClick} classNames='plb-0 pli-0.5 -mlb-1'>\n <span className='sr-only'>{t('delete item label')}</span>\n <X className={getSize(4)} />\n </Button>\n );\n};\n\nexport const KanbanCardComponent: FC<{\n column?: KanbanColumnType;\n item: KanbanItemType;\n debug?: boolean;\n onDelete?: () => void;\n}> = ({ column, item, debug = false, onDelete }) => {\n const { themeMode } = useThemeContext();\n const { t } = useTranslation(KANBAN_PLUGIN);\n const { isDragging, attributes, listeners, transform, transition, setNodeRef } = useSortable({\n id: item.id,\n data: { type: 'item', column },\n });\n const tx = transform ? Object.assign(transform, { scaleY: 1 }) : null;\n\n const { parentRef, focusAttributes } = useTextEditor(\n () => ({\n initialValue: item.name,\n extensions: [\n createDataExtensions({ id: item.id, text: createDocAccessor(item, ['name']) }),\n createBasicExtensions({ placeholder: t('item title placeholder') }),\n createThemeExtensions({ themeMode }),\n ],\n }),\n [item, themeMode],\n );\n\n return (\n <div\n ref={setNodeRef}\n style={{ transform: CSS.Transform.toString(tx), transition }}\n className={mx('flex grow', isDragging && 'border border-neutral-400 dark:border-neutral-800')}\n >\n <div className={mx('flex items-start grow p-1', attentionSurface, isDragging && 'opacity-10')}>\n {/* TODO(burdon): Standardize height (and below); e.g., via toolbar. */}\n <button className='flex h-[40px] items-center' {...attributes} {...listeners}>\n <DotsSixVertical className={getSize(5)} />\n </button>\n <div className='flex flex-col grow pt-1'>\n <div {...focusAttributes} className={mx(focusRing, 'rounded-sm p-1')} ref={parentRef} />\n {debug && <div className='text-xs text-red-800'>{item.id.slice(0, 9)}</div>}\n </div>\n {onDelete && (\n <div className='flex h-[40px] items-center'>\n <DeleteItem onClick={onDelete} />\n </div>\n )}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useDroppable } from '@dnd-kit/core';\nimport { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { DotsSixVertical, X, Plus } from '@phosphor-icons/react';\nimport React, { type FC } from 'react';\n\nimport { Button, Input, useTranslation } from '@dxos/react-ui';\nimport { modalSurface, getSize, groupSurface, mx } from '@dxos/react-ui-theme';\nimport { nonNullable } from '@dxos/util';\n\nimport { KanbanCardComponent } from './KanbanCard';\nimport { useSubscription } from './util';\nimport { KANBAN_PLUGIN } from '../meta';\nimport { type KanbanColumnType, type KanbanItemType } from '../types';\n\nexport type ItemsMapper = (column: string, items: KanbanItemType[]) => KanbanItemType[];\n\nconst DeleteColumn = ({ onClick }: { onClick: () => void }) => {\n const { t } = useTranslation(KANBAN_PLUGIN);\n return (\n <Button variant='ghost' onClick={onClick} classNames='plb-0 pli-0.5 -mlb-1'>\n <span className='sr-only'>{t('delete column label')}</span>\n <X className={getSize(4)} />\n </Button>\n );\n};\n\nconst AddItem = ({ onClick }: { onClick: () => void }) => {\n const { t } = useTranslation(KANBAN_PLUGIN);\n return (\n <Button variant='ghost' onClick={onClick} classNames='plb-0 pli-0.5 -mlb-1'>\n <span className='sr-only'>{t('add item label')}</span>\n <Plus className={getSize(4)} />\n </Button>\n );\n};\n\n// TODO(burdon): Factor out container.\nexport const KanbanColumnComponentPlaceholder: FC<{ onAdd: () => void }> = ({ onAdd }) => {\n const { t } = useTranslation(KANBAN_PLUGIN);\n return (\n <div className={mx('flex flex-col justify-center shadow rounded w-[300px] h-[300px]', groupSurface)}>\n <Button variant='ghost' onClick={onAdd} classNames='plb-0 pli-0.5 -mlb-1'>\n <span className='sr-only'>{t('add column label')}</span>\n <Plus className={getSize(6)} />\n </Button>\n </div>\n );\n};\n\nexport const KanbanColumnComponent: FC<{\n column: KanbanColumnType;\n itemMapper?: ItemsMapper;\n debug?: boolean; // TODO(burdon): Context.\n onCreate?: (column: KanbanColumnType) => KanbanItemType;\n onDelete?: () => void;\n}> = ({ column, itemMapper, debug = false, onCreate, onDelete }) => {\n const { t } = useTranslation(KANBAN_PLUGIN);\n\n // TODO(wittjosiah): Remove?\n useSubscription([column.items]);\n const items = itemMapper?.(column.id!, column.items.filter(nonNullable)) ?? column.items!;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({ id: column.id! });\n const { isDragging, attributes, listeners, transform, transition, setNodeRef } = useSortable({\n id: column.id!,\n data: { type: 'column' },\n });\n const tx = transform ? Object.assign(transform, { scaleY: 1 }) : null;\n\n const handleAddItem = onCreate\n ? () => {\n const item = onCreate(column);\n column.items!.splice(column.items!.length, 0, item);\n }\n : undefined;\n\n const handleDeleteItem = (id: string) => {\n const index = column.items.filter(nonNullable).findIndex((column) => column.id === id);\n if (index >= 0) {\n column.items!.splice(index, 1);\n }\n };\n\n return (\n <div\n ref={setNodeRef}\n style={{ transform: CSS.Transform.toString(tx), transition }}\n className={mx('flex flex-col snap-center overflow-y-hidden', isDragging && 'relative z-10')}\n >\n {/* TODO(burdon): Width approx mobile phone width. */}\n <div\n className={mx(\n 'flex flex-col py-2 overflow-hidden shadow rounded w-[300px] min-h-[300px]',\n isDragging ? modalSurface : groupSurface,\n )}\n >\n <div className='flex items-center mb-2 px-2'>\n <button {...attributes} {...listeners}>\n <DotsSixVertical className={getSize(5)} />\n </button>\n\n <Input.Root>\n <Input.Label srOnly>{t('column title label')}</Input.Label>\n <Input.TextInput\n variant='subdued'\n classNames='px-2'\n placeholder={t('column title placeholder')}\n defaultValue={column.name}\n onChange={({ target: { value } }) => (column.name = value)}\n />\n </Input.Root>\n\n {/* TODO(burdon): Menu. */}\n {onDelete && <DeleteColumn onClick={onDelete} />}\n </div>\n\n {/* TODO(burdon): Scrolling (radix; see kai/mosaic). */}\n <SortableContext strategy={verticalListSortingStrategy} items={items.filter(nonNullable).map(({ id }) => id)}>\n <div ref={setDroppableNodeRef} className='flex flex-col grow overflow-y-scroll space-y-2 pr-4'>\n {items.filter(nonNullable).map((item) => (\n <div key={item.id} id={item.id} className='flex pl-2'>\n <KanbanCardComponent column={column} item={item} onDelete={() => handleDeleteItem(item.id)} />\n </div>\n ))}\n </div>\n </SortableContext>\n\n {handleAddItem && (\n <div className='flex justify-center mt-2'>\n <AddItem onClick={handleAddItem} />\n </div>\n )}\n\n {debug && <div className='px-2 text-xs text-red-800'>{column.id!.slice(0, 9)}</div>}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { createSubscription } from '@dxos/react-client/echo';\nimport { nonNullable } from '@dxos/util';\n\nimport { type KanbanColumnType, type Location } from '../types';\n\n// TODO(burdon): Factor out.\nexport const useSubscription = (data: any) => {\n const [_, setIter] = useState([]);\n useEffect(() => {\n const handle = createSubscription(() => setIter([]));\n handle.update(data);\n return () => handle.unsubscribe();\n }, []);\n};\n\n/**\n * Find the column or item within the model.\n */\n// TODO(burdon): Move to model.\nexport const findLocation = (columns: KanbanColumnType[], id: string): Location | undefined => {\n for (const column of columns) {\n // TODO(burdon): Need transient ID for UX.\n if (column.id === id) {\n return { column };\n } else {\n const idx = column.items.filter(nonNullable).findIndex((item) => item.id === id);\n if (idx !== -1) {\n return { column, item: column.items![idx], idx };\n }\n }\n }\n};\n"],
5
+ "mappings": ";;;;;;;;;AAIA,OAAOA,YAAwB;AAE/B,SAASC,cAAc;AACvB,SAASC,gBAAgB;AACzB,SAASC,YAAY;AACrB,SAASC,yBAAyBC,sBAAsBC,gCAAgC;;;ACLxF,SACEC,YAIAC,aAGAC,aACAC,iBACK;AACP,SAASC,+BAA+BC,mBAAAA,wBAAuB;AAC/D,OAAOC,UAAkBC,aAAAA,YAAWC,YAAAA,iBAAgB;AAEpD,SAASC,sBAAAA,2BAA0B;AACnC,SAASC,WAAWC,eAAAA,oBAAmB;;;ACfvC,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB,SAASC,iBAAiBC,SAAS;AACnC,OAAOC,WAAwB;AAE/B,SAASC,yBAAyB;AAClC,SAASC,QAAQC,iBAAiBC,sBAAsB;AACxD,SACEC,uBACAC,sBACAC,uBACAC,qBACK;AACP,SAASC,SAASC,IAAIC,kBAAkBC,iBAAiB;AAKzD,IAAMC,aAAa,CAAC,EAAEC,QAAO,MAA2B;AACtD,QAAM,EAAEC,EAAC,IAAKC,eAAeC,aAAAA;AAC7B,SACE,sBAAA,cAACC,QAAAA;IAAOC,SAAQ;IAAQL;IAAkBM,YAAW;KACnD,sBAAA,cAACC,QAAAA;IAAKC,WAAU;KAAWP,EAAE,mBAAA,CAAA,GAC7B,sBAAA,cAACQ,GAAAA;I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IAAYC,OAAO;MAAEC,QAAQ;IAAE;KAC9B,gBAAAtB,OAAA,cAACuB,qBAAAA;IAAoBhD,MAAMZ,aAAaK,OAAOO;IAAO4C,UAAU,MAAA;IAAO;OAI1E1B,sBAAsB,gBAAAO,OAAA,cAACwB,kCAAAA;IAAiCC,OAAOhC;;AAK1E;;;ADpLA,IAAMiC,aAAyC,CAAC,EAAEC,OAAM,MAAE;AAExD,QAAMC,QAAQC,SAASF,MAAAA;AACvB,MAAI,CAACC,OAAO;AACV,WAAO;EACT;AAGA,QAAME,QAAqB;IACzBC,MAAMJ;IACNK,cAAc,MAAMJ,MAAMK,GAAGC,IAAIC,OAAOC,kBAAkB;MAAEC,OAAO,CAAA;IAAG,CAAA,CAAA;;IAEtEC,YAAY,CAACC,WAAWX,MAAMK,GAAGC,IAAIC,OAAOK,gBAAgB;MAAEC,MAAM;IAAG,CAAA,CAAA;EACzE;AAEA,SACE,gBAAAC,OAAA,cAACC,KAAKC,SAAO;IAACC,YAAY;MAACC;MAAsBC;MAAyBC;;KACxE,gBAAAN,OAAA,cAACO,aAAAA;IAAYnB;;AAGnB;AAEA,IAAA,qBAAeJ;",
6
+ "names": ["React", "create", "getSpace", "Main", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "DndContext", "DragOverlay", "MouseSensor", "useSensor", "horizontalListSortingStrategy", "SortableContext", "React", "useEffect", "useState", "createSubscription", "arrayMove", "nonNullable", "useSortable", "CSS", "DotsSixVertical", "X", "React", "createDocAccessor", "Button", "useThemeContext", "useTranslation", "createBasicExtensions", "createDataExtensions", "createThemeExtensions", "useTextEditor", "getSize", "mx", "attentionSurface", "focusRing", "DeleteItem", "onClick", "t", "useTranslation", "KANBAN_PLUGIN", "Button", "variant", "classNames", "span", "className", "X", "getSize", "KanbanCardComponent", "column", "item", "debug", "onDelete", "themeMode", "useThemeContext", "isDragging", "attributes", "listeners", "transform", "transition", "setNodeRef", "useSortable", "id", "data", "type", "tx", "Object", "assign", "scaleY", "parentRef", "focusAttributes", "useTextEditor", "initialValue", "name", "extensions", "createDataExtensions", "text", "createDocAccessor", "createBasicExtensions", "placeholder", "createThemeExtensions", "div", "ref", "style", "CSS", "Transform", "toString", "mx", "attentionSurface", "button", "DotsSixVertical", "focusRing", "slice", "useDroppable", "SortableContext", "useSortable", "verticalListSortingStrategy", "CSS", "DotsSixVertical", "X", "Plus", "React", "Button", "Input", "useTranslation", "modalSurface", "getSize", "groupSurface", "mx", "nonNullable", "useEffect", "useState", "createSubscription", "nonNullable", "useSubscription", "data", "_", "setIter", "useState", "useEffect", "handle", "createSubscription", "update", "unsubscribe", "findLocation", "columns", "id", "column", "idx", "items", "filter", "nonNullable", "findIndex", "item", "DeleteColumn", "onClick", "t", "useTranslation", "KANBAN_PLUGIN", "React", "Button", "variant", "classNames", "span", "className", "X", "getSize", "AddItem", "Plus", "KanbanColumnComponentPlaceholder", "onAdd", "div", "mx", "groupSurface", "KanbanColumnComponent", "column", "itemMapper", "debug", "onCreate", "onDelete", "useSubscription", "items", "id", "filter", "nonNullable", "setNodeRef", "setDroppableNodeRef", "useDroppable", "isDragging", "attributes", "listeners", "transform", "transition", "useSortable", "data", "type", "tx", "Object", "assign", "scaleY", "handleAddItem", "item", "splice", "length", "undefined", "handleDeleteItem", "index", "findIndex", "ref", "style", "CSS", "Transform", "toString", "modalSurface", "button", "DotsSixVertical", "Input", "Root", "Label", "srOnly", "TextInput", "placeholder", "defaultValue", "name", "onChange", "target", "value", "SortableContext", "strategy", "verticalListSortingStrategy", "map", "key", "KanbanCardComponent", "slice", "KanbanBoard", "model", "kanban", "root", "useSubscription", "columns", "_", "setIter", "useState", "useEffect", "handle", "createSubscription", "update", "unsubscribe", "mouseSensor", "useSensor", "MouseSensor", "activationConstraint", "distance", "draggingColumn", "setDraggingColumn", "draggingItem", "setDraggingItem", "itemMapper", "column", "items", "source", "target", "id", "modified", "splice", "idx", "length", "item", "handleDragStart", "active", "filter", "nonNullable", "forEach", "findIndex", "handleDragMove", "event", "handleDragOver", "over", "findLocation", "handleDragEnd", "oldIndex", "newIndex", "arrayMove", "undefined", "handleDragCancel", "handleCreateColumn", "createColumn", "handleDeleteColumn", "index", "customModifier", "transform", "y", "React", "div", "className", "DndContext", "sensors", "modifiers", "onDragStart", "onDragMove", "onDragOver", "onDragEnd", "onDragCancel", "SortableContext", "strategy", "horizontalListSortingStrategy", "map", "KanbanColumnComponent", "key", "onCreate", "createItem", "onDelete", "DragOverlay", "style", "margin", "KanbanCardComponent", "KanbanColumnComponentPlaceholder", "onAdd", "KanbanMain", "kanban", "space", "getSpace", "model", "root", "createColumn", "db", "add", "create", "KanbanColumnType", "items", "createItem", "column", "KanbanItemType", "name", "React", "Main", "Content", "classNames", "fixedInsetFlexLayout", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "KanbanBoard"]
7
+ }
@@ -0,0 +1,21 @@
1
+ // packages/plugins/experimental/plugin-kanban/src/meta.tsx
2
+ import { Kanban } from "@phosphor-icons/react";
3
+ import React from "react";
4
+ import { pluginMeta } from "@dxos/app-framework";
5
+ var KANBAN_PLUGIN = "dxos.org/plugin/kanban";
6
+ var meta_default = pluginMeta({
7
+ id: KANBAN_PLUGIN,
8
+ name: "Kanban",
9
+ description: "Kanban board for managing tasks.",
10
+ tags: [
11
+ "experimental"
12
+ ],
13
+ iconComponent: (props) => /* @__PURE__ */ React.createElement(Kanban, props),
14
+ iconSymbol: "ph--kanban--regular"
15
+ });
16
+
17
+ export {
18
+ KANBAN_PLUGIN,
19
+ meta_default
20
+ };
21
+ //# sourceMappingURL=chunk-DMDAZVOX.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Kanban, type IconProps } from '@phosphor-icons/react';\nimport React from 'react';\n\nimport { pluginMeta } from '@dxos/app-framework';\n\nexport const KANBAN_PLUGIN = 'dxos.org/plugin/kanban';\n\nexport default pluginMeta({\n id: KANBAN_PLUGIN,\n name: 'Kanban',\n description: 'Kanban board for managing tasks.',\n tags: ['experimental'],\n iconComponent: (props: IconProps) => <Kanban {...props} />,\n iconSymbol: 'ph--kanban--regular',\n});\n"],
5
+ "mappings": ";AAIA,SAASA,cAA8B;AACvC,OAAOC,WAAW;AAElB,SAASC,kBAAkB;AAEpB,IAAMC,gBAAgB;AAE7B,IAAA,eAAeC,WAAW;EACxBC,IAAIF;EACJG,MAAM;EACNC,aAAa;EACbC,MAAM;IAAC;;EACPC,eAAe,CAACC,UAAqB,sBAAA,cAACC,QAAWD,KAAAA;EACjDE,YAAY;AACd,CAAA;",
6
+ "names": ["Kanban", "React", "pluginMeta", "KANBAN_PLUGIN", "pluginMeta", "id", "name", "description", "tags", "iconComponent", "props", "Kanban", "iconSymbol"]
7
+ }
@@ -0,0 +1,47 @@
1
+ import {
2
+ KANBAN_PLUGIN
3
+ } from "./chunk-DMDAZVOX.mjs";
4
+
5
+ // packages/plugins/experimental/plugin-kanban/src/types/kanban.ts
6
+ import { Expando, ref, S, TypedObject } from "@dxos/echo-schema";
7
+ var KanbanItemType = class extends TypedObject({
8
+ typename: "dxos.org/type/KanbanItem",
9
+ version: "0.1.0"
10
+ })({
11
+ object: S.optional(ref(Expando)),
12
+ name: S.optional(S.String),
13
+ index: S.optional(S.String)
14
+ }) {
15
+ };
16
+ var KanbanColumnType = class extends TypedObject({
17
+ typename: "dxos.org/type/KanbanColumn",
18
+ version: "0.1.0"
19
+ })({
20
+ name: S.optional(S.String),
21
+ index: S.optional(S.String),
22
+ items: S.mutable(S.Array(ref(KanbanItemType)))
23
+ }) {
24
+ };
25
+ var KanbanType = class extends TypedObject({
26
+ typename: "dxos.org/type/Kanban",
27
+ version: "0.1.0"
28
+ })({
29
+ name: S.optional(S.String),
30
+ columns: S.mutable(S.Array(ref(KanbanColumnType)))
31
+ }) {
32
+ };
33
+
34
+ // packages/plugins/experimental/plugin-kanban/src/types/types.ts
35
+ var KANBAN_ACTION = `${KANBAN_PLUGIN}/action`;
36
+ var KanbanAction;
37
+ (function(KanbanAction2) {
38
+ KanbanAction2[KanbanAction2["CREATE"] = `${KANBAN_ACTION}/create`] = "CREATE";
39
+ })(KanbanAction || (KanbanAction = {}));
40
+
41
+ export {
42
+ KanbanItemType,
43
+ KanbanColumnType,
44
+ KanbanType,
45
+ KanbanAction
46
+ };
47
+ //# sourceMappingURL=chunk-LEPZRV4E.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/kanban.ts", "../../../src/types/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Expando, ref, S, TypedObject } from '@dxos/echo-schema';\n\nexport class KanbanItemType extends TypedObject({ typename: 'dxos.org/type/KanbanItem', version: '0.1.0' })({\n object: S.optional(ref(Expando)),\n name: S.optional(S.String),\n index: S.optional(S.String),\n}) {}\n\nexport class KanbanColumnType extends TypedObject({ typename: 'dxos.org/type/KanbanColumn', version: '0.1.0' })({\n name: S.optional(S.String),\n index: S.optional(S.String),\n items: S.mutable(S.Array(ref(KanbanItemType))),\n}) {}\n\nexport class KanbanType extends TypedObject({ typename: 'dxos.org/type/Kanban', version: '0.1.0' })({\n name: S.optional(S.String),\n columns: S.mutable(S.Array(ref(KanbanColumnType))),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type {\n GraphBuilderProvides,\n IntentResolverProvides,\n MetadataRecordsProvides,\n SurfaceProvides,\n TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\n\nimport { type KanbanColumnType, type KanbanItemType, type KanbanType } from './kanban';\nimport { KANBAN_PLUGIN } from '../meta';\n\n/**\n * Kanban data model.\n * A Kanban board is a collection of columns, each of which contains a collection of items.\n * The layout of columns and items is controlled by models.\n * The underlying data model may be represented by direct object relationships\n * (e.g., a column object containing an array of ordered items) or projections constructed\n * by the model (e.g., a query of items based on metadata within a column object).\n */\n\nconst KANBAN_ACTION = `${KANBAN_PLUGIN}/action`;\n\nexport enum KanbanAction {\n CREATE = `${KANBAN_ACTION}/create`,\n}\n\nexport type KanbanPluginProvides = SurfaceProvides &\n IntentResolverProvides &\n GraphBuilderProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides;\n\n// TODO(burdon): Undo?\n// TODO(burdon): Typescript types (replace proto with annotations?)\n// TODO(burdon): Should pure components depend on ECHO? Relationship between ECHO object/array and Observable.\n// TODO(burdon): Can the plugin configure the object based on the data? E.g., how are the models constructed?\n// TODO(burdon): Create models. Simple first based on actual data.\n// Model is always a projection since the dragging state is tentative.\n\n// TODO(burdon): Extend model for moving items (in and across columns).\nexport interface KanbanModel {\n root: KanbanType;\n createColumn(): KanbanColumnType;\n createItem(column: KanbanColumnType): KanbanItemType;\n}\n\nexport type Location = {\n column: KanbanColumnType;\n item?: KanbanItemType;\n idx?: number;\n};\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,SAASC,KAAKC,GAAGC,mBAAmB;AAEtC,IAAMC,iBAAN,cAA6BC,YAAY;EAAEC,UAAU;EAA4BC,SAAS;AAAQ,CAAA,EAAG;EAC1GC,QAAQC,EAAEC,SAASC,IAAIC,OAAAA,CAAAA;EACvBC,MAAMJ,EAAEC,SAASD,EAAEK,MAAM;EACzBC,OAAON,EAAEC,SAASD,EAAEK,MAAM;AAC5B,CAAA,EAAA;AAAI;AAEG,IAAME,mBAAN,cAA+BX,YAAY;EAAEC,UAAU;EAA8BC,SAAS;AAAQ,CAAA,EAAG;EAC9GM,MAAMJ,EAAEC,SAASD,EAAEK,MAAM;EACzBC,OAAON,EAAEC,SAASD,EAAEK,MAAM;EAC1BG,OAAOR,EAAES,QAAQT,EAAEU,MAAMR,IAAIP,cAAAA,CAAAA,CAAAA;AAC/B,CAAA,EAAA;AAAI;AAEG,IAAMgB,aAAN,cAAyBf,YAAY;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,EAAG;EAClGM,MAAMJ,EAAEC,SAASD,EAAEK,MAAM;EACzBO,SAASZ,EAAES,QAAQT,EAAEU,MAAMR,IAAIK,gBAAAA,CAAAA,CAAAA;AACjC,CAAA,EAAA;AAAI;;;ACIJ,IAAMM,gBAAgB,GAAGC,aAAAA;;UAEbC,eAAAA;0CACD,GAAGF,aAAAA,SAAsB,IAAA;GADxBE,iBAAAA,eAAAA,CAAAA,EAAAA;",
6
+ "names": ["Expando", "ref", "S", "TypedObject", "KanbanItemType", "TypedObject", "typename", "version", "object", "S", "optional", "ref", "Expando", "name", "String", "index", "KanbanColumnType", "items", "mutable", "Array", "KanbanType", "columns", "KANBAN_ACTION", "KANBAN_PLUGIN", "KanbanAction"]
7
+ }