@dxos/react-ui-mosaic 0.8.4-main.bc674ce → 0.8.4-main.ef1bc66f44
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-UMBPEG4F.mjs → chunk-Y6GU2CCU.mjs} +833 -992
- package/dist/lib/browser/chunk-Y6GU2CCU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +407 -45
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +28 -218
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-X6GV7SMK.mjs → chunk-KTLFCRVA.mjs} +833 -992
- package/dist/lib/node-esm/chunk-KTLFCRVA.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +407 -45
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +28 -218
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Board/Board.d.ts +65 -0
- package/dist/types/src/components/Board/Board.d.ts.map +1 -0
- package/dist/types/src/components/{Mosaic/Mosaic.stories.d.ts → Board/Board.stories.d.ts} +9 -1
- package/dist/types/src/components/Board/Board.stories.d.ts.map +1 -0
- package/dist/types/src/components/Board/Column.d.ts +29 -0
- package/dist/types/src/components/Board/Column.d.ts.map +1 -0
- package/dist/types/src/components/Board/Item.d.ts +9 -0
- package/dist/types/src/components/Board/Item.d.ts.map +1 -0
- package/dist/types/src/components/Board/index.d.ts +2 -0
- package/dist/types/src/components/Board/index.d.ts.map +1 -0
- package/dist/types/src/components/Card/Card.d.ts +5 -3
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts +5 -4
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
- package/dist/types/src/components/Focus/styles.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Mosaic.d.ts +8 -17
- package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/styles.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/types.d.ts +0 -2
- package/dist/types/src/components/Mosaic/types.d.ts.map +1 -1
- package/dist/types/src/components/Stack/Stack.d.ts +3 -3
- package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Stack/Stack.stories.d.ts.map +1 -1
- package/dist/types/src/{testing/Virtualizer.stories.d.ts → components/Stack/virtualizer.stories.d.ts} +2 -2
- package/dist/types/src/components/Stack/virtualizer.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/testing/CardContainer.d.ts +1 -1
- package/dist/types/src/testing/CardContainer.d.ts.map +1 -1
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/types.d.ts +21 -0
- package/dist/types/src/testing/types.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +4 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -26
- package/src/components/{Mosaic/Mosaic.stories.tsx → Board/Board.stories.tsx} +52 -8
- package/src/components/Board/Board.tsx +166 -0
- package/src/components/Board/Column.tsx +253 -0
- package/src/components/Board/Item.tsx +80 -0
- package/src/components/{Layout → Board}/index.ts +1 -1
- package/src/components/Card/Card.stories.tsx +1 -1
- package/src/components/Card/styles.ts +1 -1
- package/src/components/Focus/Focus.tsx +7 -9
- package/src/components/Focus/styles.ts +3 -6
- package/src/components/Image/Image.stories.tsx +1 -1
- package/src/components/Mosaic/Mosaic.tsx +40 -39
- package/src/components/Mosaic/styles.ts +9 -8
- package/src/components/Mosaic/types.ts +0 -4
- package/src/components/Stack/Stack.stories.tsx +23 -19
- package/src/components/Stack/Stack.tsx +34 -25
- package/src/{testing/Virtualizer.stories.tsx → components/Stack/virtualizer.stories.tsx} +47 -37
- package/src/components/index.ts +1 -1
- package/src/hooks/useContainerDebug.tsx +4 -2
- package/src/testing/CardContainer.tsx +12 -7
- package/src/testing/index.ts +1 -1
- package/src/testing/types.ts +38 -0
- package/src/translations.ts +4 -1
- package/dist/lib/browser/chunk-UMBPEG4F.mjs.map +0 -7
- package/dist/lib/browser/index.css +0 -13
- package/dist/lib/browser/index.css.map +0 -7
- package/dist/lib/browser/testing/index.css +0 -13
- package/dist/lib/browser/testing/index.css.map +0 -7
- package/dist/lib/node-esm/chunk-X6GV7SMK.mjs.map +0 -7
- package/dist/lib/node-esm/index.css +0 -13
- package/dist/lib/node-esm/index.css.map +0 -7
- package/dist/lib/node-esm/testing/index.css +0 -13
- package/dist/lib/node-esm/testing/index.css.map +0 -7
- package/dist/types/src/components/Layout/Layout.d.ts +0 -33
- package/dist/types/src/components/Layout/Layout.d.ts.map +0 -1
- package/dist/types/src/components/Layout/Layout.stories.d.ts +0 -10
- package/dist/types/src/components/Layout/Layout.stories.d.ts.map +0 -1
- package/dist/types/src/components/Layout/index.d.ts +0 -2
- package/dist/types/src/components/Layout/index.d.ts.map +0 -1
- package/dist/types/src/components/Mosaic/Mosaic.stories.d.ts.map +0 -1
- package/dist/types/src/components/Scrollable/Scrollable.d.ts +0 -24
- package/dist/types/src/components/Scrollable/Scrollable.d.ts.map +0 -1
- package/dist/types/src/components/Scrollable/Scrollable.stories.d.ts +0 -10
- package/dist/types/src/components/Scrollable/Scrollable.stories.d.ts.map +0 -1
- package/dist/types/src/components/Scrollable/index.d.ts +0 -2
- package/dist/types/src/components/Scrollable/index.d.ts.map +0 -1
- package/dist/types/src/testing/Board.d.ts +0 -45
- package/dist/types/src/testing/Board.d.ts.map +0 -1
- package/dist/types/src/testing/Slot.stories.d.ts +0 -14
- package/dist/types/src/testing/Slot.stories.d.ts.map +0 -1
- package/dist/types/src/testing/Virtualizer.stories.d.ts.map +0 -1
- package/src/components/Layout/Layout.stories.tsx +0 -59
- package/src/components/Layout/Layout.tsx +0 -108
- package/src/components/Scrollable/Scrollable.stories.tsx +0 -59
- package/src/components/Scrollable/Scrollable.tsx +0 -88
- package/src/components/Scrollable/index.ts +0 -5
- package/src/components/Scrollable/scrollable.css +0 -20
- package/src/testing/Board.tsx +0 -278
- package/src/testing/Slot.stories.tsx +0 -101
|
@@ -9,26 +9,149 @@ import {
|
|
|
9
9
|
styles,
|
|
10
10
|
styles2,
|
|
11
11
|
styles3,
|
|
12
|
+
translationKey,
|
|
12
13
|
useContainerContext,
|
|
13
|
-
useContainerDebug,
|
|
14
|
-
useEventHandlerAdapter,
|
|
15
14
|
useFocus,
|
|
16
15
|
useRootContext,
|
|
17
16
|
useTileContext,
|
|
18
17
|
useVisibleItems
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Y6GU2CCU.mjs";
|
|
20
19
|
|
|
21
|
-
// src/components/
|
|
22
|
-
import
|
|
20
|
+
// src/components/Board/Board.tsx
|
|
21
|
+
import { createContext } from "@radix-ui/react-context";
|
|
22
|
+
import React5, { forwardRef as forwardRef4, useRef as useRef4, useState as useState2 } from "react";
|
|
23
|
+
import { Layout, ScrollArea as ScrollArea2 } from "@dxos/react-ui";
|
|
24
|
+
import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
25
|
+
import { mx as mx4 } from "@dxos/ui-theme";
|
|
26
|
+
|
|
27
|
+
// src/hooks/useContainerDebug.tsx
|
|
28
|
+
import React, { forwardRef, useMemo, useRef } from "react";
|
|
29
|
+
import { createPortal } from "react-dom";
|
|
30
|
+
import { Json } from "@dxos/react-ui-syntax-highlighter";
|
|
23
31
|
import { mx } from "@dxos/ui-theme";
|
|
32
|
+
var useContainerDebug = (debug) => {
|
|
33
|
+
const debugRef = useRef(null);
|
|
34
|
+
return useMemo(() => {
|
|
35
|
+
if (!debug) {
|
|
36
|
+
return [
|
|
37
|
+
() => null,
|
|
38
|
+
void 0
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
return [
|
|
42
|
+
({ classNames }) => /* @__PURE__ */ React.createElement("div", {
|
|
43
|
+
role: "none",
|
|
44
|
+
className: mx("overflow-hidden", classNames),
|
|
45
|
+
ref: debugRef
|
|
46
|
+
}),
|
|
47
|
+
() => debugRef.current && /* @__PURE__ */ createPortal(/* @__PURE__ */ React.createElement(ContainerInfo, null), debugRef.current)
|
|
48
|
+
];
|
|
49
|
+
}, [
|
|
50
|
+
debug,
|
|
51
|
+
debugRef
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
var CONTAINER_INFO_NAME = "ContainerInfo";
|
|
55
|
+
var ContainerInfo = /* @__PURE__ */ forwardRef(({ classNames }, forwardedRef) => {
|
|
56
|
+
const { id, state, activeLocation, scrolling } = useContainerContext(CONTAINER_INFO_NAME);
|
|
57
|
+
const counter = useRef(0);
|
|
58
|
+
return /* @__PURE__ */ React.createElement(Json, {
|
|
59
|
+
data: {
|
|
60
|
+
id,
|
|
61
|
+
activeLocation,
|
|
62
|
+
scrolling,
|
|
63
|
+
state,
|
|
64
|
+
count: counter.current++
|
|
65
|
+
},
|
|
66
|
+
classNames: mx("text-xs", classNames),
|
|
67
|
+
ref: forwardedRef
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
ContainerInfo.displayName = CONTAINER_INFO_NAME;
|
|
71
|
+
|
|
72
|
+
// src/hooks/useEventHandlerAdapter.ts
|
|
73
|
+
import { useMemo as useMemo2 } from "react";
|
|
74
|
+
import { log } from "@dxos/log";
|
|
75
|
+
import { arrayMove } from "@dxos/util";
|
|
76
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-mosaic/src/hooks/useEventHandlerAdapter.ts";
|
|
77
|
+
var useEventHandlerAdapter = ({ items, getId, get, make, onChange, ...props }) => {
|
|
78
|
+
return useMemo2(() => ({
|
|
79
|
+
...props,
|
|
80
|
+
onTake: ({ source }, cb) => {
|
|
81
|
+
log.info("onTake", {
|
|
82
|
+
source
|
|
83
|
+
}, {
|
|
84
|
+
F: __dxlog_file,
|
|
85
|
+
L: 58,
|
|
86
|
+
S: void 0,
|
|
87
|
+
C: (f, a) => f(...a)
|
|
88
|
+
});
|
|
89
|
+
const mutate = (items2) => {
|
|
90
|
+
const from = items2.findIndex((item) => getId(item) === source.id);
|
|
91
|
+
if (from !== -1) {
|
|
92
|
+
items2.splice(from, 1);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
if (onChange) {
|
|
96
|
+
onChange(mutate);
|
|
97
|
+
} else {
|
|
98
|
+
mutate(items);
|
|
99
|
+
}
|
|
100
|
+
void cb(source.data);
|
|
101
|
+
},
|
|
102
|
+
onDrop: ({ source, target }) => {
|
|
103
|
+
const to = target?.type === "tile" || target?.type === "placeholder" ? target.location : -1;
|
|
104
|
+
log.info("onDrop", {
|
|
105
|
+
source,
|
|
106
|
+
target,
|
|
107
|
+
to
|
|
108
|
+
}, {
|
|
109
|
+
F: __dxlog_file,
|
|
110
|
+
L: 76,
|
|
111
|
+
S: void 0,
|
|
112
|
+
C: (f, a) => f(...a)
|
|
113
|
+
});
|
|
114
|
+
const mutate = (items2) => {
|
|
115
|
+
const from = items2.findIndex((item) => getId(item) === source.id);
|
|
116
|
+
if (to !== -1) {
|
|
117
|
+
if (from !== -1) {
|
|
118
|
+
arrayMove(items2, from, to);
|
|
119
|
+
} else {
|
|
120
|
+
items2.splice(to, 0, make(get(source.data)));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
if (onChange) {
|
|
125
|
+
onChange(mutate);
|
|
126
|
+
} else {
|
|
127
|
+
mutate(items);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}), [
|
|
131
|
+
items,
|
|
132
|
+
onChange
|
|
133
|
+
]);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// src/components/Board/Column.tsx
|
|
137
|
+
import React4, { forwardRef as forwardRef3, useMemo as useMemo3, useRef as useRef3, useState } from "react";
|
|
138
|
+
import { Obj as Obj2, Ref } from "@dxos/echo";
|
|
139
|
+
import { useObject } from "@dxos/react-client/echo";
|
|
140
|
+
import { IconButton, ScrollArea, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
141
|
+
import { mx as mx3 } from "@dxos/ui-theme";
|
|
142
|
+
import { isNonNullable } from "@dxos/util";
|
|
143
|
+
|
|
144
|
+
// src/components/Card/CardDragPreview.tsx
|
|
145
|
+
import React2 from "react";
|
|
146
|
+
import { mx as mx2 } from "@dxos/ui-theme";
|
|
24
147
|
var CardDragPreviewRoot = ({ children }) => {
|
|
25
|
-
return /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
26
149
|
className: "p-2"
|
|
27
150
|
}, children);
|
|
28
151
|
};
|
|
29
152
|
var CardDragPreviewContent = ({ children }) => {
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className:
|
|
153
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
154
|
+
className: mx2(styles3.root, "ring-focusLine ring-neutralFocusIndicator")
|
|
32
155
|
}, children);
|
|
33
156
|
};
|
|
34
157
|
var CardDragPreview = {
|
|
@@ -36,58 +159,297 @@ var CardDragPreview = {
|
|
|
36
159
|
Content: CardDragPreviewContent
|
|
37
160
|
};
|
|
38
161
|
|
|
39
|
-
// src/components/
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
162
|
+
// src/components/Board/Item.tsx
|
|
163
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
164
|
+
import React3, { forwardRef as forwardRef2, useRef as useRef2 } from "react";
|
|
165
|
+
import { Obj } from "@dxos/echo";
|
|
166
|
+
import { Tag } from "@dxos/react-ui";
|
|
167
|
+
import { getHashStyles } from "@dxos/ui-theme";
|
|
168
|
+
var BOARD_ITEM_NAME = "Board.Item";
|
|
169
|
+
var BoardItemInner = /* @__PURE__ */ forwardRef2(({ classNames, data: ref, location, debug }, forwardedRef) => {
|
|
170
|
+
const rootRef = useRef2(null);
|
|
171
|
+
const composedRef = useComposedRefs(rootRef, forwardedRef);
|
|
172
|
+
const dragHandleRef = useRef2(null);
|
|
173
|
+
const object = ref.target;
|
|
174
|
+
if (!object) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const label = Obj.getLabel(object);
|
|
178
|
+
const description = Obj.getDescription(object);
|
|
179
|
+
return /* @__PURE__ */ React3.createElement(Mosaic.Tile, {
|
|
180
|
+
asChild: true,
|
|
181
|
+
dragHandle: dragHandleRef.current,
|
|
182
|
+
id: ref.dxn.toString(),
|
|
183
|
+
data: ref,
|
|
184
|
+
location,
|
|
185
|
+
debug
|
|
186
|
+
}, /* @__PURE__ */ React3.createElement(Focus.Group, {
|
|
187
|
+
asChild: true
|
|
188
|
+
}, /* @__PURE__ */ React3.createElement(Card.Root, {
|
|
189
|
+
classNames,
|
|
190
|
+
onClick: () => rootRef.current?.focus(),
|
|
191
|
+
ref: composedRef
|
|
192
|
+
}, /* @__PURE__ */ React3.createElement(Card.Toolbar, null, /* @__PURE__ */ React3.createElement(Card.DragHandle, {
|
|
193
|
+
ref: dragHandleRef
|
|
194
|
+
}), /* @__PURE__ */ React3.createElement(Card.Title, null, label), /* @__PURE__ */ React3.createElement(Card.Menu, {
|
|
195
|
+
context: object
|
|
196
|
+
})), /* @__PURE__ */ React3.createElement(Card.Row, {
|
|
197
|
+
icon: "ph--note--regular",
|
|
198
|
+
classNames: "text-description"
|
|
199
|
+
}, description), /* @__PURE__ */ React3.createElement(Card.Row, {
|
|
200
|
+
icon: "ph--tag--regular"
|
|
201
|
+
}, label && /* @__PURE__ */ React3.createElement("div", {
|
|
202
|
+
role: "none",
|
|
203
|
+
className: "shrink-0 flex gap-1 items-center text-xs"
|
|
204
|
+
}, /* @__PURE__ */ React3.createElement(Tag, {
|
|
205
|
+
palette: getHashStyles(label).hue
|
|
206
|
+
}, label))))));
|
|
207
|
+
});
|
|
208
|
+
BoardItemInner.displayName = BOARD_ITEM_NAME;
|
|
209
|
+
var BoardItem = BoardItemInner;
|
|
210
|
+
|
|
211
|
+
// src/components/Board/Column.tsx
|
|
212
|
+
var BOARD_COLUMN_NAME = "Board.Column";
|
|
213
|
+
var BoardColumnRootInner = /* @__PURE__ */ forwardRef3(({ classNames, children, location, data, debug, dragHandleRef }, forwardedRef) => {
|
|
214
|
+
return /* @__PURE__ */ React4.createElement(Mosaic.Tile, {
|
|
215
|
+
asChild: true,
|
|
216
|
+
location,
|
|
217
|
+
id: data.id,
|
|
218
|
+
data,
|
|
219
|
+
debug,
|
|
220
|
+
dragHandle: dragHandleRef.current
|
|
221
|
+
}, /* @__PURE__ */ React4.createElement(Focus.Group, {
|
|
222
|
+
classNames: mx3(
|
|
223
|
+
// NOTE: Reserves 2px for outer Focus.Group border.
|
|
224
|
+
"bs-full overflow-hidden is-[calc(100vw-2px)] md:is-card-default-width snap-center bg-deckSurface",
|
|
225
|
+
classNames
|
|
226
|
+
),
|
|
227
|
+
ref: forwardedRef
|
|
228
|
+
}, children));
|
|
229
|
+
});
|
|
230
|
+
BoardColumnRootInner.displayName = BOARD_COLUMN_NAME;
|
|
231
|
+
var BoardColumnRootImpl = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
232
|
+
const dragHandleRef = useRef3(null);
|
|
233
|
+
return /* @__PURE__ */ React4.createElement(BoardColumnRootInner, {
|
|
234
|
+
...props,
|
|
235
|
+
dragHandleRef,
|
|
236
|
+
ref: forwardedRef
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
BoardColumnRootImpl.displayName = "Board.Column.Root";
|
|
240
|
+
var BoardColumnRoot = BoardColumnRootImpl;
|
|
241
|
+
var BOARD_COLUMN_HEADER_NAME = "Board.Column.Header";
|
|
242
|
+
var BoardColumnHeader = /* @__PURE__ */ forwardRef3(({ classNames, label, dragHandleRef }, forwardedRef) => {
|
|
243
|
+
return /* @__PURE__ */ React4.createElement(Card.Toolbar, {
|
|
244
|
+
classNames,
|
|
245
|
+
ref: forwardedRef
|
|
246
|
+
}, /* @__PURE__ */ React4.createElement(Card.DragHandle, {
|
|
247
|
+
ref: dragHandleRef
|
|
248
|
+
}), /* @__PURE__ */ React4.createElement(Card.Title, null, label), /* @__PURE__ */ React4.createElement(Card.Menu, {
|
|
249
|
+
items: []
|
|
250
|
+
}));
|
|
251
|
+
});
|
|
252
|
+
BoardColumnHeader.displayName = BOARD_COLUMN_HEADER_NAME;
|
|
253
|
+
var BOARD_COLUMN_BODY_NAME = "Board.Column.Body";
|
|
254
|
+
var BoardColumnBody = ({ data, Tile = BoardItem, debug }) => {
|
|
255
|
+
const { t } = useTranslation(translationKey);
|
|
256
|
+
const { model } = useBoardContext(BOARD_COLUMN_BODY_NAME);
|
|
257
|
+
const [column, updateColumn] = useObject(data);
|
|
258
|
+
const [viewport, setViewport] = useState(null);
|
|
259
|
+
const eventHandler = useEventHandlerAdapter({
|
|
260
|
+
id: data.id,
|
|
261
|
+
items: model.getItems(column),
|
|
262
|
+
getId: (data2) => data2.dxn.toString(),
|
|
263
|
+
get: (data2) => data2.target,
|
|
264
|
+
make: (object) => Ref.make(object),
|
|
265
|
+
canDrop: ({ source }) => source.data.target ? model.isItem(source.data.target) : false,
|
|
266
|
+
onChange: (mutator) => updateColumn((column2) => mutator(model.getItems(column2)))
|
|
267
|
+
});
|
|
268
|
+
const menuItems = useMemo3(() => [
|
|
269
|
+
model.onItemDelete && {
|
|
270
|
+
label: t("delete menu label"),
|
|
271
|
+
onClick: (obj) => {
|
|
272
|
+
model.onItemDelete?.(data, obj);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
].filter(isNonNullable), [
|
|
276
|
+
model.onItemDelete,
|
|
277
|
+
data,
|
|
278
|
+
t
|
|
52
279
|
]);
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
280
|
+
return /* @__PURE__ */ React4.createElement(Card.Context, {
|
|
281
|
+
value: {
|
|
282
|
+
menuItems
|
|
283
|
+
}
|
|
284
|
+
}, /* @__PURE__ */ React4.createElement(Mosaic.Container, {
|
|
285
|
+
asChild: true,
|
|
286
|
+
withFocus: true,
|
|
287
|
+
orientation: "vertical",
|
|
288
|
+
autoScroll: viewport,
|
|
289
|
+
eventHandler,
|
|
290
|
+
debug
|
|
291
|
+
}, /* @__PURE__ */ React4.createElement(ScrollArea.Root, {
|
|
292
|
+
orientation: "vertical",
|
|
293
|
+
thin: true,
|
|
294
|
+
margin: true,
|
|
295
|
+
padding: true
|
|
296
|
+
}, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, {
|
|
297
|
+
classNames: "snap-y md:snap-none",
|
|
298
|
+
ref: setViewport
|
|
299
|
+
}, /* @__PURE__ */ React4.createElement(Mosaic.Stack, {
|
|
300
|
+
items: model.getItems(column),
|
|
301
|
+
getId: (data2) => data2.dxn.toString(),
|
|
302
|
+
Tile
|
|
303
|
+
})))));
|
|
304
|
+
};
|
|
305
|
+
BoardColumnBody.displayName = BOARD_COLUMN_BODY_NAME;
|
|
306
|
+
var BOARD_COLUMN_FOOTER_NAME = "Board.Column.Footer";
|
|
307
|
+
var BoardColumnFooter = /* @__PURE__ */ forwardRef3(({ classNames }, forwardedRef) => {
|
|
308
|
+
const { t } = useTranslation(translationKey);
|
|
309
|
+
const { model } = useBoardContext(BOARD_COLUMN_FOOTER_NAME);
|
|
310
|
+
return /* @__PURE__ */ React4.createElement(Toolbar.Root, {
|
|
311
|
+
classNames: mx3("rounded-b-sm", classNames),
|
|
312
|
+
ref: forwardedRef
|
|
313
|
+
}, model.onItemCreate && /* @__PURE__ */ React4.createElement(IconButton, {
|
|
314
|
+
classNames: "group-hover/column:opacity-100 opacity-0 transition transition-opacity duration-500",
|
|
315
|
+
variant: "ghost",
|
|
316
|
+
icon: "ph--plus--regular",
|
|
317
|
+
iconOnly: true,
|
|
318
|
+
label: t("add item label")
|
|
319
|
+
}));
|
|
59
320
|
});
|
|
60
|
-
|
|
61
|
-
|
|
321
|
+
BoardColumnFooter.displayName = BOARD_COLUMN_FOOTER_NAME;
|
|
322
|
+
var BOARD_DEFAULT_COLUMN_NAME = "Board.DefaultColumn";
|
|
323
|
+
var DefaultBoardColumn = /* @__PURE__ */ forwardRef3(({ classNames, location, data, debug, Tile = BoardItem }, forwardedRef) => {
|
|
324
|
+
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
325
|
+
const dragHandleRef = useRef3(null);
|
|
326
|
+
return /* @__PURE__ */ React4.createElement(BoardColumnRootInner, {
|
|
327
|
+
location,
|
|
328
|
+
data,
|
|
329
|
+
dragHandleRef,
|
|
330
|
+
ref: forwardedRef
|
|
331
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
332
|
+
role: "none",
|
|
333
|
+
className: mx3("group/column grid bs-full overflow-hidden", debug ? "grid-rows-[var(--rail-action)_1fr_20rem]" : "grid-rows-[var(--rail-action)_1fr_var(--rail-action)]", classNames)
|
|
334
|
+
}, /* @__PURE__ */ React4.createElement(BoardColumnHeader, {
|
|
335
|
+
classNames: "border-be border-separator",
|
|
336
|
+
label: Obj2.getLabel(data) ?? data.id,
|
|
337
|
+
dragHandleRef
|
|
338
|
+
}), /* @__PURE__ */ React4.createElement(BoardColumnBody, {
|
|
339
|
+
data,
|
|
340
|
+
debug: debugHandler,
|
|
341
|
+
Tile
|
|
342
|
+
}), /* @__PURE__ */ React4.createElement("div", {
|
|
343
|
+
role: "none",
|
|
344
|
+
className: "flex flex-col"
|
|
345
|
+
}, /* @__PURE__ */ React4.createElement(BoardColumnFooter, {
|
|
346
|
+
classNames: "border-bs border-separator"
|
|
347
|
+
}), /* @__PURE__ */ React4.createElement(DebugInfo, null))));
|
|
348
|
+
});
|
|
349
|
+
DefaultBoardColumn.displayName = BOARD_DEFAULT_COLUMN_NAME;
|
|
350
|
+
var BoardColumn = {
|
|
351
|
+
Root: BoardColumnRoot,
|
|
352
|
+
Header: BoardColumnHeader,
|
|
353
|
+
Body: BoardColumnBody,
|
|
354
|
+
Footer: BoardColumnFooter
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
// src/components/Board/Board.tsx
|
|
358
|
+
var BOARD_NAME = "Board";
|
|
359
|
+
var [BoardContextProvider, useBoardContext] = createContext(BOARD_NAME);
|
|
360
|
+
var BOARD_ROOT_NAME = "Board.Root";
|
|
361
|
+
var BoardRootInner = /* @__PURE__ */ forwardRef4(({ classNames, id, model, debug, Tile = DefaultBoardColumn }, forwardedRef) => {
|
|
362
|
+
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
363
|
+
const [viewport, setViewport] = useState2(null);
|
|
364
|
+
const items = model.getColumns();
|
|
365
|
+
const eventHandler = useEventHandlerAdapter({
|
|
366
|
+
id,
|
|
367
|
+
items,
|
|
368
|
+
getId: (data) => data.id,
|
|
369
|
+
get: (data) => data,
|
|
370
|
+
make: (object) => object,
|
|
371
|
+
canDrop: ({ source }) => model.isColumn(source.data)
|
|
372
|
+
});
|
|
373
|
+
return /* @__PURE__ */ React5.createElement(BoardContextProvider, {
|
|
374
|
+
model
|
|
375
|
+
}, /* @__PURE__ */ React5.createElement(Layout.Main, {
|
|
62
376
|
ref: forwardedRef,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
377
|
+
classNames: mx4("border-red-500", classNames)
|
|
378
|
+
}, /* @__PURE__ */ React5.createElement(Focus.Group, {
|
|
379
|
+
asChild: true,
|
|
380
|
+
orientation: "horizontal"
|
|
381
|
+
}, /* @__PURE__ */ React5.createElement(Mosaic.Container, {
|
|
382
|
+
asChild: true,
|
|
383
|
+
withFocus: true,
|
|
384
|
+
orientation: "horizontal",
|
|
385
|
+
autoScroll: viewport,
|
|
386
|
+
eventHandler,
|
|
387
|
+
debug: debugHandler
|
|
388
|
+
}, /* @__PURE__ */ React5.createElement(ScrollArea2.Root, {
|
|
389
|
+
orientation: "horizontal",
|
|
390
|
+
classNames: "md:pbs-3",
|
|
391
|
+
margin: true,
|
|
392
|
+
padding: true
|
|
393
|
+
}, /* @__PURE__ */ React5.createElement(ScrollArea2.Viewport, {
|
|
394
|
+
classNames: "snap-mandatory snap-x md:snap-none",
|
|
395
|
+
ref: setViewport
|
|
396
|
+
}, /* @__PURE__ */ React5.createElement(Mosaic.Stack, {
|
|
397
|
+
items,
|
|
398
|
+
getId: (item) => item.id,
|
|
399
|
+
Tile,
|
|
400
|
+
debug
|
|
401
|
+
}))))), /* @__PURE__ */ React5.createElement(DebugInfo, null)));
|
|
66
402
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
403
|
+
BoardRootInner.displayName = BOARD_ROOT_NAME;
|
|
404
|
+
var BoardRoot = BoardRootInner;
|
|
405
|
+
var BOARD_PLACEHOLDER_NAME = "Board.Placeholder";
|
|
406
|
+
var BoardPlaceholder = (props) => {
|
|
407
|
+
return /* @__PURE__ */ React5.createElement(Mosaic.Placeholder, {
|
|
408
|
+
...props,
|
|
409
|
+
classNames: styles2.placeholder.root
|
|
410
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
411
|
+
className: mx4("flex bs-full border border-dashed border-separator rounded-sm", styles2.placeholder.content)
|
|
412
|
+
}));
|
|
72
413
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
414
|
+
BoardPlaceholder.displayName = BOARD_PLACEHOLDER_NAME;
|
|
415
|
+
var BOARD_DEBUG_NAME = "Board.Debug";
|
|
416
|
+
var BoardDebug = /* @__PURE__ */ forwardRef4(({ classNames }, forwardedRef) => {
|
|
417
|
+
const { containers, dragging } = useRootContext(BOARD_DEBUG_NAME);
|
|
418
|
+
const counter = useRef4(0);
|
|
419
|
+
return /* @__PURE__ */ React5.createElement(Json2, {
|
|
420
|
+
data: {
|
|
421
|
+
containers,
|
|
422
|
+
dragging,
|
|
423
|
+
count: counter.current++
|
|
424
|
+
},
|
|
425
|
+
classNames: mx4("text-xs", classNames),
|
|
426
|
+
ref: forwardedRef
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
BoardDebug.displayName = BOARD_DEBUG_NAME;
|
|
430
|
+
var Board = {
|
|
431
|
+
Root: BoardRoot,
|
|
432
|
+
Column: BoardColumn,
|
|
433
|
+
Item: BoardItem,
|
|
434
|
+
Placeholder: BoardPlaceholder,
|
|
435
|
+
Debug: BoardDebug
|
|
77
436
|
};
|
|
78
437
|
export {
|
|
438
|
+
Board,
|
|
439
|
+
BoardContextProvider,
|
|
440
|
+
BoardDebug,
|
|
79
441
|
Card,
|
|
80
442
|
CardDragPreview,
|
|
81
443
|
Focus,
|
|
82
444
|
Image,
|
|
83
|
-
Layout,
|
|
84
445
|
Mosaic,
|
|
85
446
|
Stack,
|
|
86
447
|
VirtualStack,
|
|
87
|
-
|
|
448
|
+
styles3 as cardStyles,
|
|
88
449
|
dropHandler,
|
|
89
|
-
|
|
90
|
-
|
|
450
|
+
styles as focusStyles,
|
|
451
|
+
styles2 as mosaicStyles,
|
|
452
|
+
useBoardContext,
|
|
91
453
|
useContainerDebug,
|
|
92
454
|
useEventHandlerAdapter,
|
|
93
455
|
useFocus,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/Card/CardDragPreview.tsx", "../../../src/components/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { styles } from './styles';\n\n// TODO(burdon): Why p-2?\nconst CardDragPreviewRoot = ({ children }: PropsWithChildren<{}>) => {\n return <div className='p-2'>{children}</div>;\n};\n\nconst CardDragPreviewContent = ({ children }: PropsWithChildren<{}>) => {\n return <div className={mx(styles.root, 'ring-focusLine ring-neutralFocusIndicator')}>{children}</div>;\n};\n\nexport const CardDragPreview = {\n Root: CardDragPreviewRoot,\n Content: CardDragPreviewContent,\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { type HTMLAttributes, type PropsWithChildren, forwardRef, useMemo } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\n//\n// Main\n//\n\ntype MainProps = ThemedClassName<\n PropsWithChildren<{\n role?: string;\n toolbar?: boolean;\n statusbar?: boolean;\n }>\n>;\n\n// TODO(burdon): Borders.\nconst Main = forwardRef<HTMLDivElement, MainProps>(\n ({ classNames, children, role, toolbar, statusbar }, forwardedRef) => {\n const style = useMemo(\n () => ({\n gridTemplateRows: [toolbar && 'var(--toolbar-size)', '1fr', statusbar && 'var(--statusbar-size)']\n .filter(Boolean)\n .join(' '),\n }),\n [toolbar, statusbar],\n );\n\n return (\n <div\n ref={forwardedRef}\n role={role ?? 'none'}\n style={style}\n className={mx(\n 'bs-full is-full grid grid-cols-[100%] overflow-hidden',\n toolbar && '[&>.dx-toolbar]:relative [&>.dx-toolbar]:border-be [&>.dx-toolbar]:border-subduedSeparator',\n classNames,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\n//\n// Container\n//\n\ntype ContainerProps = ThemedClassName<\n PropsWithChildren<{\n role?: string;\n scrollable?: boolean;\n }>\n>;\n\nconst Container = forwardRef<HTMLDivElement, ContainerProps>(\n ({ classNames, children, role, scrollable }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n role={role ?? 'none'}\n className={mx('grid bs-full', scrollable ? 'overflow-y-auto' : 'overflow-hidden', classNames)}\n >\n {children}\n </div>\n );\n },\n);\n\n//\n// Flex\n//\n\ntype FlexProps = ThemedClassName<\n HTMLAttributes<HTMLDivElement> & {\n column?: boolean;\n grow?: boolean;\n }\n>;\n\nconst Flex = ({ children, classNames, role, column, grow }: FlexProps) => {\n return (\n <div\n role={role ?? 'none'}\n className={mx('flex', column && 'flex-col', grow && 'flex-1 overflow-hidden', classNames)}\n >\n {children}\n </div>\n );\n};\n\n//\n// Layout\n//\n\nexport const Layout = {\n Main,\n Container,\n Flex,\n};\n\nexport type { MainProps as LayoutMainProps, ContainerProps as LayoutContainerProps, FlexProps as LayoutFlexProps };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["React", "mx", "CardDragPreviewRoot", "children", "div", "className", "CardDragPreviewContent", "mx", "styles", "root", "CardDragPreview", "Root", "Content", "React", "forwardRef", "
|
|
3
|
+
"sources": ["../../../src/components/Board/Board.tsx", "../../../src/hooks/useContainerDebug.tsx", "../../../src/hooks/useEventHandlerAdapter.ts", "../../../src/components/Board/Column.tsx", "../../../src/components/Card/CardDragPreview.tsx", "../../../src/components/Board/Item.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type ReactElement, type Ref as ReactRef, forwardRef, useRef, useState } from 'react';\n\nimport { type Obj, type Ref } from '@dxos/echo';\nimport { Layout, ScrollArea, type ThemedClassName } from '@dxos/react-ui';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useContainerDebug, useEventHandlerAdapter } from '../../hooks';\nimport { Focus } from '../Focus';\nimport { Mosaic, type MosiacPlaceholderProps, mosaicStyles, useMosaic } from '../Mosaic';\nimport { type StackProps } from '../Stack';\n\nimport { BoardColumn, type BoardColumnProps, DefaultBoardColumn } from './Column';\nimport { BoardItem, type BoardItemProps } from './Item';\n\n//\n// Model\n//\n\nexport interface BoardModel<TColumn extends Obj.Unknown = any, TItem extends Obj.Unknown = any> {\n isColumn: (obj: Obj.Unknown) => obj is TColumn;\n isItem: (obj: Obj.Unknown) => obj is TItem;\n // TODO(burdon): Normalize Column/Item object vs refs?\n getColumns: () => TColumn[];\n getItems: (column: TColumn) => Ref.Ref<TItem>[];\n onColumnDelete?: (column: TColumn) => void;\n onColumnCreate?: () => Promise<TColumn>;\n onItemDelete?: (column: TColumn, item: TItem) => void;\n onItemCreate?: (column: TColumn) => Promise<TItem>;\n}\n\n//\n// Context\n//\n\nconst BOARD_NAME = 'Board';\n\ntype BoardContextValue<TColumn extends Obj.Unknown = any, TItem extends Obj.Unknown = any> = {\n model: BoardModel<TColumn, TItem>;\n};\n\n/**\n * @internal\n */\nexport const [BoardContextProvider, useBoardContext] = createContext<BoardContextValue>(BOARD_NAME);\n\n//\n// Root\n//\n\nconst BOARD_ROOT_NAME = 'Board.Root';\n\ntype BoardRootProps<TColumn extends Obj.Unknown = any, TItem extends Obj.Unknown = any> = ThemedClassName<\n {\n id: string;\n debug?: boolean;\n Tile?: StackProps<TColumn>['Tile'];\n } & BoardContextValue<TColumn, TItem>\n>;\n\nconst BoardRootInner = forwardRef<HTMLDivElement, BoardRootProps>(\n ({ classNames, id, model, debug, Tile = DefaultBoardColumn }, forwardedRef) => {\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n\n const items = model.getColumns();\n const eventHandler = useEventHandlerAdapter({\n id,\n items,\n getId: (data) => data.id,\n get: (data) => data,\n make: (object) => object,\n canDrop: ({ source }) => model.isColumn(source.data),\n });\n\n return (\n <BoardContextProvider model={model}>\n <Layout.Main ref={forwardedRef} classNames={mx('border-red-500', classNames)}>\n <Focus.Group asChild orientation='horizontal'>\n <Mosaic.Container\n asChild\n withFocus\n orientation='horizontal'\n autoScroll={viewport}\n eventHandler={eventHandler}\n debug={debugHandler}\n >\n <ScrollArea.Root orientation='horizontal' classNames='md:pbs-3' margin padding>\n <ScrollArea.Viewport classNames='snap-mandatory snap-x md:snap-none' ref={setViewport}>\n <Mosaic.Stack items={items} getId={(item) => item.id} Tile={Tile} debug={debug} />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n </Focus.Group>\n <DebugInfo />\n </Layout.Main>\n </BoardContextProvider>\n );\n },\n);\n\nBoardRootInner.displayName = BOARD_ROOT_NAME;\n\nconst BoardRoot = BoardRootInner as <TColumn extends Obj.Unknown>(\n props: BoardRootProps<TColumn> & { ref?: ReactRef<HTMLDivElement> },\n) => ReactElement;\n\n//\n// Placeholder\n//\n\nconst BOARD_PLACEHOLDER_NAME = 'Board.Placeholder';\n\nconst BoardPlaceholder = (props: MosiacPlaceholderProps<number>) => {\n return (\n <Mosaic.Placeholder {...props} classNames={mosaicStyles.placeholder.root}>\n <div\n className={mx(\n 'flex bs-full border border-dashed border-separator rounded-sm',\n mosaicStyles.placeholder.content,\n )}\n />\n </Mosaic.Placeholder>\n );\n};\n\nBoardPlaceholder.displayName = BOARD_PLACEHOLDER_NAME;\n\n//\n// Debug\n//\n\nconst BOARD_DEBUG_NAME = 'Board.Debug';\n\nexport const BoardDebug = forwardRef<HTMLDivElement, ThemedClassName>(({ classNames }, forwardedRef) => {\n const { containers, dragging } = useMosaic(BOARD_DEBUG_NAME);\n const counter = useRef(0);\n return (\n <Json\n data={{ containers, dragging, count: counter.current++ }}\n classNames={mx('text-xs', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nBoardDebug.displayName = BOARD_DEBUG_NAME;\n\n//\n// Board\n//\n\nexport const Board = {\n Root: BoardRoot,\n Column: BoardColumn,\n Item: BoardItem,\n Placeholder: BoardPlaceholder,\n Debug: BoardDebug,\n};\n\nexport type { BoardRootProps, BoardColumnProps, BoardItemProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type FC, type ReactNode, forwardRef, useMemo, useRef } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { Json } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/ui-theme';\n\nimport { useMosaicContainer } from '../components';\n\nexport type UseContainerDebug = [FC<ThemedClassName>, (() => ReactNode) | undefined];\n\n/**\n * Hook that returns a component to be rendered in the container's viewport (within the context),\n * and a component that creates a portal in the container's debug area.\n */\nexport const useContainerDebug = (debug?: boolean): UseContainerDebug => {\n const debugRef = useRef<HTMLDivElement | null>(null);\n return useMemo(() => {\n if (!debug) {\n return [() => null, undefined];\n }\n\n return [\n ({ classNames }) => <div role='none' className={mx('overflow-hidden', classNames)} ref={debugRef} />,\n () => debugRef.current && createPortal(<ContainerInfo />, debugRef.current),\n ];\n }, [debug, debugRef]);\n};\n\nconst CONTAINER_INFO_NAME = 'ContainerInfo';\n\nconst ContainerInfo = forwardRef<HTMLDivElement, ThemedClassName>(({ classNames }, forwardedRef) => {\n const { id, state, activeLocation, scrolling } = useMosaicContainer(CONTAINER_INFO_NAME);\n const counter = useRef(0);\n return (\n <Json\n data={{ id, activeLocation, scrolling, state, count: counter.current++ }}\n classNames={mx('text-xs', classNames)}\n ref={forwardedRef}\n />\n );\n});\n\nContainerInfo.displayName = CONTAINER_INFO_NAME;\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { type Obj } from '@dxos/echo';\nimport { log } from '@dxos/log';\nimport { arrayMove } from '@dxos/util';\n\nimport { type GetId, type MosaicEventHandler } from '../components';\n\nexport type UseEventHandlerProps<TItem = any, TObject = any> = Pick<MosaicEventHandler<TItem>, 'id' | 'canDrop'> & {\n /**\n * The items to manage.\n */\n items: TItem[];\n\n /**\n * ID getter.\n */\n getId: GetId<TItem>;\n\n /**\n * Extracts the object from an item.\n */\n get: (item: TItem) => TObject;\n\n /**\n * Creates a new item from the dragged object.\n */\n make: (object: TObject) => TItem;\n\n /**\n * Optional change callback for wrapping mutations in Obj.change style.\n * When provided, all array mutations will be wrapped in this callback.\n * When not provided, mutations happen directly on the items array.\n */\n onChange?: (mutator: (items: TItem[]) => void) => void;\n};\n\n/**\n * Returns a handler for the given items.\n * NOTE: This supports arrays of objects, or arrays of refs to objects.\n */\nexport const useEventHandlerAdapter = <TItem = any, TObject extends Obj.Unknown = Obj.Unknown>({\n items,\n getId,\n get,\n make,\n onChange,\n ...props\n}: UseEventHandlerProps<TItem, TObject>): MosaicEventHandler<TItem> => {\n return useMemo<MosaicEventHandler<TItem>>(\n () => ({\n ...props,\n onTake: ({ source }, cb) => {\n log.info('onTake', { source });\n const mutate = (items: TItem[]) => {\n const from = items.findIndex((item) => getId(item) === source.id);\n if (from !== -1) {\n items.splice(from, 1);\n }\n };\n\n if (onChange) {\n onChange(mutate);\n } else {\n mutate(items);\n }\n\n void cb(source.data);\n },\n onDrop: ({ source, target }) => {\n const to = target?.type === 'tile' || target?.type === 'placeholder' ? target.location : -1;\n log.info('onDrop', { source, target, to });\n\n const mutate = (items: TItem[]) => {\n const from = items.findIndex((item) => getId(item) === source.id);\n if (to !== -1) {\n if (from !== -1) {\n arrayMove(items, from, to);\n } else {\n // TODO(burdon): This should be the responsibility of the source container.\n items.splice(to, 0, make(get(source.data)));\n }\n }\n };\n\n if (onChange) {\n onChange(mutate);\n } else {\n mutate(items);\n }\n },\n }),\n [items, onChange],\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, {\n type PropsWithChildren,\n type ReactElement,\n type Ref as ReactRef,\n type RefObject,\n forwardRef,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport { useObject } from '@dxos/react-client/echo';\nimport { IconButton, ScrollArea, type ThemedClassName, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\nimport { isNonNullable } from '@dxos/util';\n\nimport { useContainerDebug, useEventHandlerAdapter } from '../../hooks';\nimport { translationKey } from '../../translations';\nimport { Card, type CardMenuProps } from '../Card';\nimport { Focus } from '../Focus';\nimport { Mosaic, type MosaicContainerProps, type MosaicTileProps } from '../Mosaic';\nimport { type StackProps } from '../Stack';\n\nimport { useBoardContext } from './Board';\nimport { BoardItem } from './Item';\n\n//\n// Column\n//\n\nconst BOARD_COLUMN_NAME = 'Board.Column';\n\ntype BoardColumnProps<TColumn extends Obj.Unknown = any> = Pick<\n MosaicTileProps<TColumn>,\n 'classNames' | 'location' | 'data' | 'debug'\n>;\n\ntype BoardColumnRootInnerProps<TColumn extends Obj.Unknown = any> = BoardColumnProps<TColumn> & {\n dragHandleRef: RefObject<HTMLButtonElement | null>;\n};\n\nconst BoardColumnRootInner = forwardRef<HTMLDivElement, PropsWithChildren<BoardColumnRootInnerProps>>(\n ({ classNames, children, location, data, debug, dragHandleRef }, forwardedRef) => {\n return (\n <Mosaic.Tile\n asChild\n location={location}\n id={data.id}\n data={data}\n debug={debug}\n dragHandle={dragHandleRef.current}\n >\n <Focus.Group\n classNames={mx(\n // NOTE: Reserves 2px for outer Focus.Group border.\n 'bs-full overflow-hidden is-[calc(100vw-2px)] md:is-card-default-width snap-center bg-deckSurface',\n classNames,\n )}\n ref={forwardedRef}\n >\n {children}\n </Focus.Group>\n </Mosaic.Tile>\n );\n },\n);\n\nBoardColumnRootInner.displayName = BOARD_COLUMN_NAME;\n\nconst BoardColumnRootImpl = forwardRef<HTMLDivElement, BoardColumnProps>((props, forwardedRef) => {\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n return <BoardColumnRootInner {...props} dragHandleRef={dragHandleRef} ref={forwardedRef} />;\n});\n\nBoardColumnRootImpl.displayName = 'Board.Column.Root';\n\nconst BoardColumnRoot = BoardColumnRootImpl as <TColumn extends Obj.Unknown = any>(\n props: BoardColumnProps<TColumn> & { ref?: ReactRef<HTMLDivElement> },\n) => ReactElement;\n\n//\n// Column Header\n//\n\nconst BOARD_COLUMN_HEADER_NAME = 'Board.Column.Header';\n\ntype BoardColumnHeaderProps = ThemedClassName<{ label: string; dragHandleRef: ReactRef<HTMLButtonElement> }>;\n\nconst BoardColumnHeader = forwardRef<HTMLDivElement, BoardColumnHeaderProps>(\n ({ classNames, label, dragHandleRef }, forwardedRef) => {\n return (\n <Card.Toolbar classNames={classNames} ref={forwardedRef}>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{label}</Card.Title>\n <Card.Menu items={[]} />\n </Card.Toolbar>\n );\n },\n);\n\nBoardColumnHeader.displayName = BOARD_COLUMN_HEADER_NAME;\n\n//\n// Column Body\n//\n\nconst BOARD_COLUMN_BODY_NAME = 'Board.Column.Body';\n\ntype BoardColumnBodyProps = Pick<BoardColumnProps, 'data'> & {\n Tile?: StackProps<Ref.Ref<Obj.Unknown>>['Tile'];\n} & Pick<MosaicContainerProps, 'debug'>;\n\nconst BoardColumnBody = ({ data, Tile = BoardItem, debug }: BoardColumnBodyProps) => {\n const { t } = useTranslation(translationKey);\n const { model } = useBoardContext(BOARD_COLUMN_BODY_NAME);\n const [column, updateColumn] = useObject(data);\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n\n const eventHandler = useEventHandlerAdapter<Ref.Unknown>({\n id: data.id,\n items: model.getItems(column),\n getId: (data) => data.dxn.toString(),\n get: (data) => data.target!,\n make: (object) => Ref.make(object),\n canDrop: ({ source }) => (source.data.target ? model.isItem(source.data.target) : false),\n onChange: (mutator) => updateColumn((column) => mutator(model.getItems(column))),\n });\n\n // Context menu for items.\n const menuItems = useMemo<NonNullable<CardMenuProps<Obj.Unknown>['items']>>(\n () =>\n [\n model.onItemDelete && {\n label: t('delete menu label'),\n onClick: (obj: Obj.Unknown) => {\n model.onItemDelete?.(data, obj);\n },\n },\n ].filter(isNonNullable),\n [model.onItemDelete, data, t],\n );\n\n return (\n <Card.Context value={{ menuItems }}>\n <Mosaic.Container\n asChild\n withFocus\n orientation='vertical'\n autoScroll={viewport}\n eventHandler={eventHandler}\n debug={debug}\n >\n <ScrollArea.Root orientation='vertical' thin margin padding>\n <ScrollArea.Viewport classNames='snap-y md:snap-none' ref={setViewport}>\n <Mosaic.Stack items={model.getItems(column)} getId={(data) => data.dxn.toString()} Tile={Tile} />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n </Card.Context>\n );\n};\n\nBoardColumnBody.displayName = BOARD_COLUMN_BODY_NAME;\n\n//\n// Column Footer\n//\n\nconst BOARD_COLUMN_FOOTER_NAME = 'Board.Column.Footer';\n\ntype BoardColumnFooterProps = ThemedClassName;\n\nconst BoardColumnFooter = forwardRef<HTMLDivElement, BoardColumnFooterProps>(({ classNames }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { model } = useBoardContext(BOARD_COLUMN_FOOTER_NAME);\n\n return (\n <Toolbar.Root classNames={mx('rounded-b-sm', classNames)} ref={forwardedRef}>\n {model.onItemCreate && (\n <IconButton\n classNames='group-hover/column:opacity-100 opacity-0 transition transition-opacity duration-500'\n variant='ghost'\n icon='ph--plus--regular'\n iconOnly\n label={t('add item label')}\n />\n )}\n </Toolbar.Root>\n );\n});\n\nBoardColumnFooter.displayName = BOARD_COLUMN_FOOTER_NAME;\n\n//\n// DefaultBoardColumn\n//\n\nconst BOARD_DEFAULT_COLUMN_NAME = 'Board.DefaultColumn';\n\ntype DefaultBoardColumnProps = BoardColumnProps & Pick<BoardColumnBodyProps, 'Tile'>;\n\nconst DefaultBoardColumn = forwardRef<HTMLDivElement, DefaultBoardColumnProps>(\n ({ classNames, location, data, debug, Tile = BoardItem }, forwardedRef) => {\n const [DebugInfo, debugHandler] = useContainerDebug(debug);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n\n return (\n <BoardColumnRootInner location={location} data={data} dragHandleRef={dragHandleRef} ref={forwardedRef}>\n <div\n role='none'\n className={mx(\n 'group/column grid bs-full overflow-hidden',\n debug\n ? 'grid-rows-[var(--rail-action)_1fr_20rem]'\n : 'grid-rows-[var(--rail-action)_1fr_var(--rail-action)]',\n classNames,\n )}\n >\n <BoardColumnHeader\n classNames='border-be border-separator'\n label={Obj.getLabel(data) ?? data.id}\n dragHandleRef={dragHandleRef}\n />\n <BoardColumnBody data={data} debug={debugHandler} Tile={Tile} />\n <div role='none' className='flex flex-col'>\n <BoardColumnFooter classNames='border-bs border-separator' />\n <DebugInfo />\n </div>\n </div>\n </BoardColumnRootInner>\n );\n },\n);\n\nDefaultBoardColumn.displayName = BOARD_DEFAULT_COLUMN_NAME;\n\n//\n// BoardColumn\n//\n\nconst BoardColumn = {\n Root: BoardColumnRoot,\n Header: BoardColumnHeader,\n Body: BoardColumnBody,\n Footer: BoardColumnFooter,\n};\n\nexport { BoardColumn, DefaultBoardColumn, type BoardColumnProps };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren } from 'react';\n\nimport { mx } from '@dxos/ui-theme';\n\nimport { styles } from './styles';\n\n// TODO(burdon): Why p-2?\nconst CardDragPreviewRoot = ({ children }: PropsWithChildren<{}>) => {\n return <div className='p-2'>{children}</div>;\n};\n\nconst CardDragPreviewContent = ({ children }: PropsWithChildren<{}>) => {\n return <div className={mx(styles.root, 'ring-focusLine ring-neutralFocusIndicator')}>{children}</div>;\n};\n\nexport const CardDragPreview = {\n Root: CardDragPreviewRoot,\n Content: CardDragPreviewContent,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport React, { type ReactElement, type Ref as ReactRef, forwardRef, useRef } from 'react';\n\nimport { Obj, type Ref } from '@dxos/echo';\nimport { Tag } from '@dxos/react-ui';\nimport { getHashStyles } from '@dxos/ui-theme';\n\nimport { Card } from '../Card';\nimport { Focus } from '../Focus';\nimport { Mosaic, type MosaicTileProps } from '../Mosaic';\n\n//\n// Item\n//\n\nconst BOARD_ITEM_NAME = 'Board.Item';\n\ntype BoardItemProps<TItem extends Obj.Unknown = any> = Pick<\n MosaicTileProps<Ref.Ref<TItem>>,\n 'classNames' | 'location' | 'data' | 'debug'\n>;\n\nconst BoardItemInner = forwardRef<HTMLDivElement, BoardItemProps>(\n ({ classNames, data: ref, location, debug }, forwardedRef) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs<HTMLDivElement>(rootRef, forwardedRef);\n const dragHandleRef = useRef<HTMLButtonElement>(null);\n const object = ref.target;\n if (!object) {\n return null;\n }\n\n const label = Obj.getLabel(object);\n const description = Obj.getDescription(object);\n\n return (\n <Mosaic.Tile\n asChild\n dragHandle={dragHandleRef.current}\n id={ref.dxn.toString()}\n data={ref}\n location={location}\n debug={debug}\n >\n <Focus.Group asChild>\n <Card.Root classNames={classNames} onClick={() => rootRef.current?.focus()} ref={composedRef}>\n <Card.Toolbar>\n <Card.DragHandle ref={dragHandleRef} />\n <Card.Title>{label}</Card.Title>\n <Card.Menu context={object} />\n </Card.Toolbar>\n {/* TODO(burdon): Replace with surface. */}\n <Card.Row icon='ph--note--regular' classNames='text-description'>\n {description}\n </Card.Row>\n <Card.Row icon='ph--tag--regular'>\n {label && (\n <div role='none' className='shrink-0 flex gap-1 items-center text-xs'>\n <Tag palette={getHashStyles(label).hue}>{label}</Tag>\n </div>\n )}\n </Card.Row>\n </Card.Root>\n </Focus.Group>\n </Mosaic.Tile>\n );\n },\n);\n\nBoardItemInner.displayName = BOARD_ITEM_NAME;\n\nconst BoardItem = BoardItemInner as <TItem extends Obj.Unknown = any>(\n props: BoardItemProps<TItem> & { ref?: ReactRef<HTMLDivElement> },\n) => ReactElement;\n\nexport { BoardItem, type BoardItemProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAIA,SAASA,qBAAqB;AAC9B,OAAOC,UAAkDC,cAAAA,aAAYC,UAAAA,SAAQC,YAAAA,iBAAgB;AAG7F,SAASC,QAAQC,cAAAA,mBAAwC;AACzD,SAASC,QAAAA,aAAY;AACrB,SAASC,MAAAA,WAAU;;;ACNnB,OAAOC,SAAkCC,YAAYC,SAASC,cAAc;AAC5E,SAASC,oBAAoB;AAG7B,SAASC,YAAY;AACrB,SAASC,UAAU;AAUZ,IAAMC,oBAAoB,CAACC,UAAAA;AAChC,QAAMC,WAAWC,OAA8B,IAAA;AAC/C,SAAOC,QAAQ,MAAA;AACb,QAAI,CAACH,OAAO;AACV,aAAO;QAAC,MAAM;QAAMI;;IACtB;AAEA,WAAO;MACL,CAAC,EAAEC,WAAU,MAAO,sBAAA,cAACC,OAAAA;QAAIC,MAAK;QAAOC,WAAWC,GAA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,OAAOK;KAEP,gBAAAiB,OAAA,cAACa,YAAWC,MAAI;IAACN,aAAY;IAAajC,YAAW;IAAWwC,QAAAA;IAAOC,SAAAA;KACrE,gBAAAhB,OAAA,cAACa,YAAWI,UAAQ;IAAC1C,YAAW;IAAqC4B,KAAKjB;KACxE,gBAAAc,OAAA,cAACS,OAAOS,OAAK;IAAC9B;IAAcI,OAAO,CAAC2B,SAASA,KAAK3C;IAAIG;IAAYD;UAK1E,gBAAAsB,OAAA,cAAClB,WAAAA,IAAAA,CAAAA,CAAAA;AAIT,CAAA;AAGFT,eAAe+C,cAAchD;AAE7B,IAAMiD,YAAYhD;AAQlB,IAAMiD,yBAAyB;AAE/B,IAAMC,mBAAmB,CAACC,UAAAA;AACxB,SACE,gBAAAxB,OAAA,cAACS,OAAOgB,aAAW;IAAE,GAAGD;IAAOjD,YAAYmD,QAAaC,YAAYC;KAClE,gBAAA5B,OAAA,cAAC6B,OAAAA;IACCC,WAAW1B,IACT,iEACAsB,QAAaC,YAAYI,OAAO;;AAK1C;AAEAR,iBAAiBH,cAAcE;AAM/B,IAAMU,mBAAmB;AAElB,IAAMC,aAAa3D,gBAAAA,YAA4C,CAAC,EAAEC,WAAU,GAAIM,iBAAAA;AACrF,QAAM,EAAEqD,YAAYC,SAAQ,IAAKC,eAAUJ,gBAAAA;AAC3C,QAAMK,UAAUC,QAAO,CAAA;AACvB,SACE,gBAAAtC,OAAA,cAACuC,OAAAA;IACC9C,MAAM;MAAEyC;MAAYC;MAAUK,OAAOH,QAAQI;IAAU;IACvDlE,YAAY6B,IAAG,WAAW7B,UAAAA;IAC1B4B,KAAKtB;;AAGX,CAAA;AAEAoD,WAAWb,cAAcY;AAMlB,IAAMU,QAAQ;EACnB5B,MAAMO;EACNsB,QAAQC;EACRC,MAAMC;EACNrB,aAAaF;EACbwB,OAAOd;AACT;",
|
|
6
|
+
"names": ["createContext", "React", "forwardRef", "useRef", "useState", "Layout", "ScrollArea", "Json", "mx", "React", "forwardRef", "useMemo", "useRef", "createPortal", "Json", "mx", "useContainerDebug", "debug", "debugRef", "useRef", "useMemo", "undefined", "classNames", "div", "role", "className", "mx", "ref", "current", "createPortal", "ContainerInfo", "CONTAINER_INFO_NAME", "forwardRef", "forwardedRef", "id", "state", "activeLocation", "scrolling", "useMosaicContainer", "counter", "Json", "data", "count", "displayName", "useMemo", "log", "arrayMove", "useEventHandlerAdapter", "items", "getId", "get", "make", "onChange", "props", "onTake", "source", "cb", "info", "mutate", "from", "findIndex", "item", "id", "splice", "data", "onDrop", "target", "to", "type", "location", "React", "forwardRef", "useMemo", "useRef", "useState", "Obj", "Ref", "useObject", "IconButton", "ScrollArea", "Toolbar", "useTranslation", "mx", "isNonNullable", "React", "mx", "CardDragPreviewRoot", "children", "React", "div", "className", "CardDragPreviewContent", "mx", "styles", "root", "CardDragPreview", "Root", "Content", "useComposedRefs", "React", "forwardRef", "useRef", "Obj", "Tag", "getHashStyles", "BOARD_ITEM_NAME", "BoardItemInner", "forwardRef", "classNames", "data", "ref", "location", "debug", "forwardedRef", "rootRef", "useRef", "composedRef", "useComposedRefs", "dragHandleRef", "object", "target", "label", "Obj", "getLabel", "description", "getDescription", "React", "Mosaic", "Tile", "asChild", "dragHandle", "current", "id", "dxn", "toString", "Focus", "Group", "Card", "Root", "onClick", "focus", "Toolbar", "DragHandle", "Title", "Menu", "context", "Row", "icon", "div", "role", "className", "Tag", "palette", "getHashStyles", "hue", "displayName", "BoardItem", "BOARD_COLUMN_NAME", "BoardColumnRootInner", "forwardRef", "classNames", "children", "location", "data", "debug", "dragHandleRef", "forwardedRef", "React", "Mosaic", "Tile", "asChild", "id", "dragHandle", "current", "Focus", "Group", "mx", "ref", "displayName", "BoardColumnRootImpl", "props", "useRef", "BoardColumnRoot", "BOARD_COLUMN_HEADER_NAME", "BoardColumnHeader", "label", "Card", "Toolbar", "DragHandle", "Title", "Menu", "items", "BOARD_COLUMN_BODY_NAME", "BoardColumnBody", "BoardItem", "t", "useTranslation", "translationKey", "model", "useBoardContext", "column", "updateColumn", "useObject", "viewport", "setViewport", "useState", "eventHandler", "useEventHandlerAdapter", "getItems", "getId", "dxn", "toString", "get", "target", "make", "object", "Ref", "canDrop", "source", "isItem", "onChange", "mutator", "menuItems", "useMemo", "onItemDelete", "onClick", "obj", "filter", "isNonNullable", "Context", "value", "Container", "withFocus", "orientation", "autoScroll", "ScrollArea", "Root", "thin", "margin", "padding", "Viewport", "Stack", "BOARD_COLUMN_FOOTER_NAME", "BoardColumnFooter", "onItemCreate", "IconButton", "variant", "icon", "iconOnly", "BOARD_DEFAULT_COLUMN_NAME", "DefaultBoardColumn", "DebugInfo", "debugHandler", "useContainerDebug", "div", "role", "className", "Obj", "getLabel", "BoardColumn", "Header", "Body", "Footer", "BOARD_NAME", "BoardContextProvider", "useBoardContext", "createContext", "BOARD_ROOT_NAME", "BoardRootInner", "forwardRef", "classNames", "id", "model", "debug", "Tile", "DefaultBoardColumn", "forwardedRef", "DebugInfo", "debugHandler", "useContainerDebug", "viewport", "setViewport", "useState", "items", "getColumns", "eventHandler", "useEventHandlerAdapter", "getId", "data", "get", "make", "object", "canDrop", "source", "isColumn", "React", "Layout", "Main", "ref", "mx", "Focus", "Group", "asChild", "orientation", "Mosaic", "Container", "withFocus", "autoScroll", "ScrollArea", "Root", "margin", "padding", "Viewport", "Stack", "item", "displayName", "BoardRoot", "BOARD_PLACEHOLDER_NAME", "BoardPlaceholder", "props", "Placeholder", "mosaicStyles", "placeholder", "root", "div", "className", "content", "BOARD_DEBUG_NAME", "BoardDebug", "containers", "dragging", "useMosaic", "counter", "useRef", "Json", "count", "current", "Board", "Column", "BoardColumn", "Item", "BoardItem", "Debug"]
|
|
7
7
|
}
|