@dxos/react-ui-mosaic 0.8.4-main.bc674ce → 0.8.4-main.c85a9c8dae
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-7S4PIFKU.mjs +953 -0
- package/dist/lib/browser/chunk-7S4PIFKU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +596 -70
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/playwright/index.mjs +138 -0
- package/dist/lib/browser/playwright/index.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +61 -232
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/chunk-MK6KU66S.mjs +955 -0
- package/dist/lib/node-esm/chunk-MK6KU66S.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +596 -70
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/playwright/index.mjs +140 -0
- package/dist/lib/node-esm/playwright/index.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +61 -232
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Board/Board.d.ts +81 -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} +15 -1
- package/dist/types/src/components/Board/Board.stories.d.ts.map +1 -0
- package/dist/types/src/components/Board/Column.d.ts +40 -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/Focus/Focus.d.ts +5 -4
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
- package/dist/types/src/components/Focus/index.d.ts +0 -1
- package/dist/types/src/components/Focus/index.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Container.d.ts +42 -0
- package/dist/types/src/components/Mosaic/Container.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/Mosaic.d.ts +35 -118
- package/dist/types/src/components/Mosaic/Mosaic.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/Placeholder.d.ts +21 -0
- package/dist/types/src/components/Mosaic/Placeholder.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/Root.d.ts +36 -0
- package/dist/types/src/components/Mosaic/Root.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/Stack.d.ts +23 -0
- package/dist/types/src/components/Mosaic/Stack.d.ts.map +1 -0
- package/dist/types/src/components/{Stack → Mosaic}/Stack.stories.d.ts +2 -2
- package/dist/types/src/components/Mosaic/Stack.stories.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/Tile.d.ts +48 -0
- package/dist/types/src/components/Mosaic/Tile.d.ts.map +1 -0
- package/dist/types/src/components/Mosaic/styles.d.ts.map +1 -1
- package/dist/types/src/components/Mosaic/types.d.ts +9 -2
- package/dist/types/src/components/Mosaic/types.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDefaultColumnEventHandler.d.ts +15 -0
- package/dist/types/src/hooks/useDefaultColumnEventHandler.d.ts.map +1 -0
- package/dist/types/src/hooks/useEventHandlerAdapter.d.ts +1 -1
- package/dist/types/src/hooks/useEventHandlerAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisibleItems.d.ts +2 -2
- package/dist/types/src/hooks/useVisibleItems.d.ts.map +1 -1
- package/dist/types/src/playwright/board-manager.d.ts +45 -0
- package/dist/types/src/playwright/board-manager.d.ts.map +1 -0
- package/dist/types/src/playwright/index.d.ts +9 -0
- package/dist/types/src/playwright/index.d.ts.map +1 -0
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/playwright/smoke.spec.d.ts +2 -0
- package/dist/types/src/playwright/smoke.spec.d.ts.map +1 -0
- package/dist/types/src/testing/CardContainer.d.ts +5 -4
- package/dist/types/src/testing/CardContainer.d.ts.map +1 -1
- package/dist/types/src/testing/DefaultStackTile.d.ts +2 -2
- package/dist/types/src/testing/DefaultStackTile.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 +5 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -28
- package/src/components/Board/Board.stories.tsx +273 -0
- package/src/components/Board/Board.tsx +191 -0
- package/src/components/Board/Column.tsx +300 -0
- package/src/components/Board/Item.tsx +116 -0
- package/src/components/{Layout → Board}/index.ts +1 -1
- package/src/components/Focus/Focus.tsx +26 -17
- package/src/components/Focus/index.ts +0 -2
- package/src/components/Mosaic/Container.tsx +289 -0
- package/src/components/Mosaic/Mosaic.tsx +35 -913
- package/src/components/Mosaic/Placeholder.tsx +133 -0
- package/src/components/Mosaic/Root.tsx +292 -0
- package/src/components/{Stack → Mosaic}/Stack.stories.tsx +30 -26
- package/src/components/Mosaic/Stack.tsx +246 -0
- package/src/components/Mosaic/Tile.tsx +242 -0
- package/src/components/Mosaic/extension.ts +1 -1
- package/src/components/Mosaic/styles.ts +9 -8
- package/src/components/Mosaic/types.ts +15 -3
- package/src/components/index.ts +1 -4
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useContainerDebug.tsx +4 -2
- package/src/hooks/useDefaultColumnEventHandler.ts +35 -0
- package/src/hooks/useEventHandlerAdapter.ts +15 -6
- package/src/hooks/useVisibleItems.ts +7 -2
- package/src/playwright/board-manager.ts +154 -0
- package/src/playwright/index.ts +13 -0
- package/src/playwright/playwright.config.ts +17 -0
- package/src/playwright/smoke.spec.ts +138 -0
- package/src/testing/CardContainer.tsx +30 -18
- package/src/testing/DefaultStackTile.tsx +27 -16
- package/src/testing/index.ts +1 -1
- package/src/testing/types.ts +38 -0
- package/src/translations.ts +5 -1
- package/dist/lib/browser/chunk-UMBPEG4F.mjs +0 -1637
- 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 +0 -1639
- 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/Card/Card.d.ts +0 -121
- package/dist/types/src/components/Card/Card.d.ts.map +0 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +0 -21
- package/dist/types/src/components/Card/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Card/CardDragPreview.d.ts +0 -6
- package/dist/types/src/components/Card/CardDragPreview.d.ts.map +0 -1
- package/dist/types/src/components/Card/index.d.ts +0 -4
- package/dist/types/src/components/Card/index.d.ts.map +0 -1
- package/dist/types/src/components/Card/styles.d.ts +0 -13
- package/dist/types/src/components/Card/styles.d.ts.map +0 -1
- package/dist/types/src/components/Focus/styles.d.ts +0 -6
- package/dist/types/src/components/Focus/styles.d.ts.map +0 -1
- package/dist/types/src/components/Image/Image.d.ts +0 -14
- package/dist/types/src/components/Image/Image.d.ts.map +0 -1
- package/dist/types/src/components/Image/Image.stories.d.ts +0 -33
- package/dist/types/src/components/Image/Image.stories.d.ts.map +0 -1
- package/dist/types/src/components/Image/index.d.ts +0 -2
- package/dist/types/src/components/Image/index.d.ts.map +0 -1
- 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/components/Stack/Stack.d.ts +0 -22
- package/dist/types/src/components/Stack/Stack.d.ts.map +0 -1
- package/dist/types/src/components/Stack/Stack.stories.d.ts.map +0 -1
- package/dist/types/src/components/Stack/index.d.ts +0 -2
- package/dist/types/src/components/Stack/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 +0 -12
- package/dist/types/src/testing/Virtualizer.stories.d.ts.map +0 -1
- package/src/components/Card/Card.stories.tsx +0 -148
- package/src/components/Card/Card.tsx +0 -458
- package/src/components/Card/CardDragPreview.tsx +0 -23
- package/src/components/Card/index.ts +0 -8
- package/src/components/Card/styles.ts +0 -23
- package/src/components/Focus/styles.ts +0 -24
- package/src/components/Image/Image.stories.tsx +0 -86
- package/src/components/Image/Image.tsx +0 -223
- package/src/components/Image/index.ts +0 -5
- package/src/components/Layout/Layout.stories.tsx +0 -59
- package/src/components/Layout/Layout.tsx +0 -108
- package/src/components/Mosaic/Mosaic.stories.tsx +0 -113
- 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/components/Stack/Stack.tsx +0 -210
- package/src/components/Stack/index.ts +0 -5
- package/src/testing/Board.tsx +0 -278
- package/src/testing/Slot.stories.tsx +0 -101
- package/src/testing/Virtualizer.stories.tsx +0 -133
|
@@ -1,99 +1,625 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Card,
|
|
3
2
|
Focus,
|
|
4
|
-
Image,
|
|
5
3
|
Mosaic,
|
|
6
|
-
|
|
7
|
-
VirtualStack,
|
|
8
|
-
dropHandler,
|
|
4
|
+
getSourceData,
|
|
9
5
|
styles,
|
|
10
|
-
styles2,
|
|
11
|
-
styles3,
|
|
12
|
-
useContainerContext,
|
|
13
|
-
useContainerDebug,
|
|
14
|
-
useEventHandlerAdapter,
|
|
15
6
|
useFocus,
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
useMosaicContainerContext,
|
|
8
|
+
useMosaicRootContext,
|
|
9
|
+
useMosaicTileContext,
|
|
18
10
|
useVisibleItems
|
|
19
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7S4PIFKU.mjs";
|
|
20
12
|
|
|
21
|
-
// src/components/
|
|
22
|
-
import
|
|
13
|
+
// src/components/Board/Board.tsx
|
|
14
|
+
import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
|
|
15
|
+
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
16
|
+
import React4, { forwardRef as forwardRef4, useRef as useRef4, useState as useState2 } from "react";
|
|
17
|
+
import { ScrollArea as ScrollArea2 } from "@dxos/react-ui";
|
|
18
|
+
import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
|
|
19
|
+
import { mx as mx3 } from "@dxos/ui-theme";
|
|
20
|
+
|
|
21
|
+
// src/hooks/useContainerDebug.tsx
|
|
22
|
+
import React, { forwardRef, useMemo, useRef } from "react";
|
|
23
|
+
import { createPortal } from "react-dom";
|
|
24
|
+
import { Json } from "@dxos/react-ui-syntax-highlighter";
|
|
23
25
|
import { mx } from "@dxos/ui-theme";
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
var useContainerDebug = (debug) => {
|
|
27
|
+
const debugRef = useRef(null);
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
if (!debug) {
|
|
30
|
+
return [
|
|
31
|
+
() => null,
|
|
32
|
+
void 0
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
return [
|
|
36
|
+
({ classNames }) => /* @__PURE__ */ React.createElement("div", {
|
|
37
|
+
role: "none",
|
|
38
|
+
className: mx("overflow-hidden", classNames),
|
|
39
|
+
ref: debugRef
|
|
40
|
+
}),
|
|
41
|
+
() => debugRef.current && /* @__PURE__ */ createPortal(/* @__PURE__ */ React.createElement(ContainerInfo, null), debugRef.current)
|
|
42
|
+
];
|
|
43
|
+
}, [
|
|
44
|
+
debug,
|
|
45
|
+
debugRef
|
|
46
|
+
]);
|
|
28
47
|
};
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
var CONTAINER_INFO_NAME = "ContainerInfo";
|
|
49
|
+
var ContainerInfo = /* @__PURE__ */ forwardRef(({ classNames }, forwardedRef) => {
|
|
50
|
+
const { id, state, activeLocation, scrolling } = useMosaicContainerContext(CONTAINER_INFO_NAME);
|
|
51
|
+
const counter = useRef(0);
|
|
52
|
+
return /* @__PURE__ */ React.createElement(Json, {
|
|
53
|
+
data: {
|
|
54
|
+
id,
|
|
55
|
+
activeLocation,
|
|
56
|
+
scrolling,
|
|
57
|
+
state,
|
|
58
|
+
count: counter.current++
|
|
59
|
+
},
|
|
60
|
+
classNames: mx("text-xs", classNames),
|
|
61
|
+
ref: forwardedRef
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
ContainerInfo.displayName = CONTAINER_INFO_NAME;
|
|
65
|
+
|
|
66
|
+
// src/hooks/useEventHandlerAdapter.ts
|
|
67
|
+
import { useMemo as useMemo2 } from "react";
|
|
68
|
+
import { log } from "@dxos/log";
|
|
69
|
+
import { arrayMove } from "@dxos/util";
|
|
70
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-mosaic/src/hooks/useEventHandlerAdapter.ts";
|
|
71
|
+
var useEventHandlerAdapter = ({ items, getId, get, make, onChange, ...props }) => {
|
|
72
|
+
return useMemo2(() => ({
|
|
73
|
+
...props,
|
|
74
|
+
onTake: ({ source }, cb) => {
|
|
75
|
+
log.info("onTake", {
|
|
76
|
+
source
|
|
77
|
+
}, {
|
|
78
|
+
F: __dxlog_file,
|
|
79
|
+
L: 61,
|
|
80
|
+
S: void 0,
|
|
81
|
+
C: (f, a) => f(...a)
|
|
82
|
+
});
|
|
83
|
+
const mutate = (items2) => {
|
|
84
|
+
const from = items2.findIndex((item) => getId(item) === source.id);
|
|
85
|
+
if (from !== -1) {
|
|
86
|
+
items2.splice(from, 1);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
if (onChange) {
|
|
90
|
+
onChange(mutate);
|
|
91
|
+
} else {
|
|
92
|
+
mutate(items);
|
|
93
|
+
}
|
|
94
|
+
void cb(source.data);
|
|
95
|
+
},
|
|
96
|
+
onDrop: ({ source, target }) => {
|
|
97
|
+
log.info("onDrop", {
|
|
98
|
+
source,
|
|
99
|
+
target
|
|
100
|
+
}, {
|
|
101
|
+
F: __dxlog_file,
|
|
102
|
+
L: 78,
|
|
103
|
+
S: void 0,
|
|
104
|
+
C: (f, a) => f(...a)
|
|
105
|
+
});
|
|
106
|
+
const mutate = (items2) => {
|
|
107
|
+
const to = target?.type === "tile" || target?.type === "placeholder" ? target.location : target?.type === "container" ? items2.length : -1;
|
|
108
|
+
const from = items2.findIndex((item) => getId(item) === source.id);
|
|
109
|
+
const insertIndex = typeof to === "number" && to >= 0 ? Math.floor(to) : -1;
|
|
110
|
+
if (insertIndex !== -1) {
|
|
111
|
+
if (from !== -1) {
|
|
112
|
+
arrayMove(items2, from, insertIndex);
|
|
113
|
+
} else {
|
|
114
|
+
items2.splice(insertIndex, 0, make(get(source.data)));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
if (onChange) {
|
|
119
|
+
onChange(mutate);
|
|
120
|
+
} else {
|
|
121
|
+
mutate(items);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}), [
|
|
125
|
+
items,
|
|
126
|
+
onChange
|
|
127
|
+
]);
|
|
33
128
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
129
|
+
|
|
130
|
+
// src/hooks/useDefaultColumnEventHandler.ts
|
|
131
|
+
var useDefaultColumnEventHandler = (id, model, items) => useEventHandlerAdapter({
|
|
132
|
+
id,
|
|
133
|
+
items,
|
|
134
|
+
getId: model.getColumnId,
|
|
135
|
+
get: (data) => data,
|
|
136
|
+
make: (object) => object,
|
|
137
|
+
canDrop: ({ source }) => model.isColumn(source.data)
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// src/components/Mosaic/extension.ts
|
|
141
|
+
import { StateEffect, StateField } from "@codemirror/state";
|
|
142
|
+
import { Decoration, EditorView, ViewPlugin, WidgetType } from "@codemirror/view";
|
|
143
|
+
var dropHandler = ({ onDrop = handleDrop } = {}) => {
|
|
144
|
+
const views = /* @__PURE__ */ new Set();
|
|
145
|
+
let state = null;
|
|
146
|
+
const reset = () => {
|
|
147
|
+
views.forEach((view) => view.dispatch({
|
|
148
|
+
effects: setDrop.of(null)
|
|
149
|
+
}));
|
|
150
|
+
state = null;
|
|
151
|
+
};
|
|
152
|
+
const extension = [
|
|
153
|
+
dropField,
|
|
154
|
+
ViewPlugin.fromClass(class {
|
|
155
|
+
_view;
|
|
156
|
+
constructor(_view) {
|
|
157
|
+
this._view = _view;
|
|
158
|
+
views.add(_view);
|
|
159
|
+
}
|
|
160
|
+
destroy() {
|
|
161
|
+
views.delete(this._view);
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
];
|
|
165
|
+
return {
|
|
166
|
+
extension,
|
|
167
|
+
update: (position) => {
|
|
168
|
+
if (!position) {
|
|
169
|
+
reset();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
views.forEach((view) => {
|
|
173
|
+
const rect = view.dom.getBoundingClientRect();
|
|
174
|
+
if (position.x >= rect.left && position.x <= rect.right && position.y >= rect.top && position.y <= rect.bottom) {
|
|
175
|
+
let pos = view.posAtCoords(position);
|
|
176
|
+
if (pos !== null) {
|
|
177
|
+
const word = view.state.wordAt(pos);
|
|
178
|
+
if (word) {
|
|
179
|
+
const startDist = Math.abs(pos - word.from);
|
|
180
|
+
const endDist = Math.abs(pos - word.to);
|
|
181
|
+
pos = startDist < endDist ? word.from : word.to;
|
|
182
|
+
}
|
|
183
|
+
view.dispatch({
|
|
184
|
+
effects: setDrop.of(pos)
|
|
185
|
+
});
|
|
186
|
+
state = {
|
|
187
|
+
view,
|
|
188
|
+
pos
|
|
189
|
+
};
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
view.dispatch({
|
|
194
|
+
effects: setDrop.of(null)
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
cancel: () => {
|
|
199
|
+
reset();
|
|
200
|
+
},
|
|
201
|
+
drop: ({ text, url }) => {
|
|
202
|
+
if (state) {
|
|
203
|
+
onDrop(state.view, state.pos, {
|
|
204
|
+
text,
|
|
205
|
+
url
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
reset();
|
|
209
|
+
}
|
|
210
|
+
};
|
|
37
211
|
};
|
|
212
|
+
var handleDrop = (view, pos, event) => {
|
|
213
|
+
const line = view.state.doc.lineAt(pos);
|
|
214
|
+
if (line.text.trim() === "") {
|
|
215
|
+
view.dispatch({
|
|
216
|
+
changes: {
|
|
217
|
+
from: pos,
|
|
218
|
+
insert: `
|
|
219
|
+

|
|
220
|
+
`
|
|
221
|
+
},
|
|
222
|
+
effects: setDrop.of(null)
|
|
223
|
+
});
|
|
224
|
+
} else {
|
|
225
|
+
view.dispatch({
|
|
226
|
+
changes: {
|
|
227
|
+
from: pos,
|
|
228
|
+
insert: ` [${event.text}](${event.url})`
|
|
229
|
+
},
|
|
230
|
+
effects: setDrop.of(null)
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var setDrop = StateEffect.define();
|
|
235
|
+
var dropField = StateField.define({
|
|
236
|
+
create: () => Decoration.none,
|
|
237
|
+
update: (decorations, tr) => {
|
|
238
|
+
for (const effect of tr.effects) {
|
|
239
|
+
if (effect.is(setDrop)) {
|
|
240
|
+
if (effect.value === null) {
|
|
241
|
+
return Decoration.none;
|
|
242
|
+
}
|
|
243
|
+
return Decoration.set([
|
|
244
|
+
Decoration.widget({
|
|
245
|
+
widget: new class extends WidgetType {
|
|
246
|
+
toDOM() {
|
|
247
|
+
const dom = document.createElement("span");
|
|
248
|
+
dom.className = "cm-drop-cursor";
|
|
249
|
+
dom.style.borderLeft = "2px solid var(--color-accent-surface)";
|
|
250
|
+
dom.style.display = "inline-block";
|
|
251
|
+
dom.style.height = "1em";
|
|
252
|
+
dom.style.verticalAlign = "middle";
|
|
253
|
+
return dom;
|
|
254
|
+
}
|
|
255
|
+
}(),
|
|
256
|
+
side: 0
|
|
257
|
+
}).range(effect.value)
|
|
258
|
+
]);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return decorations.map(tr.changes);
|
|
262
|
+
},
|
|
263
|
+
provide: (field) => EditorView.decorations.from(field)
|
|
264
|
+
});
|
|
38
265
|
|
|
39
|
-
// src/components/
|
|
40
|
-
import
|
|
266
|
+
// src/components/Board/Column.tsx
|
|
267
|
+
import { useAtomValue } from "@effect-atom/atom-react";
|
|
268
|
+
import { createContext } from "@radix-ui/react-context";
|
|
269
|
+
import React3, { forwardRef as forwardRef3, useMemo as useMemo4, useRef as useRef3, useState } from "react";
|
|
270
|
+
import { Obj as Obj2, Ref } from "@dxos/echo";
|
|
271
|
+
import { useObject } from "@dxos/react-client/echo";
|
|
272
|
+
import { IconButton, ScrollArea, Toolbar as Toolbar2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
273
|
+
import { Menu as Menu2, createMenuAction as createMenuAction2 } from "@dxos/react-ui-menu";
|
|
41
274
|
import { mx as mx2 } from "@dxos/ui-theme";
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
275
|
+
|
|
276
|
+
// src/translations.ts
|
|
277
|
+
var translationKey = "@dxos/react-ui-mosaic";
|
|
278
|
+
var translations = [
|
|
279
|
+
{
|
|
280
|
+
"en-US": {
|
|
281
|
+
[translationKey]: {
|
|
282
|
+
"action menu label": "Actions",
|
|
283
|
+
"add item label": "Add item",
|
|
284
|
+
"delete menu label": "Delete"
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
];
|
|
289
|
+
|
|
290
|
+
// src/components/Board/Item.tsx
|
|
291
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
292
|
+
import React2, { forwardRef as forwardRef2, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
293
|
+
import { Obj } from "@dxos/echo";
|
|
294
|
+
import { Card, Tag, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
295
|
+
import { Menu, createMenuAction } from "@dxos/react-ui-menu";
|
|
296
|
+
import { getHashStyles } from "@dxos/ui-theme";
|
|
297
|
+
var BOARD_ITEM_NAME = "Board.Item";
|
|
298
|
+
var BoardItemInner = /* @__PURE__ */ forwardRef2(({ classNames, data, location, debug }, forwardedRef) => {
|
|
299
|
+
const { t } = useTranslation(translationKey);
|
|
300
|
+
const rootRef = useRef2(null);
|
|
301
|
+
const composedRef = useComposedRefs(rootRef, forwardedRef);
|
|
302
|
+
const dragHandleRef = useRef2(null);
|
|
303
|
+
const { model } = useBoard(BOARD_ITEM_NAME);
|
|
304
|
+
const column = useBoardColumn();
|
|
305
|
+
const items = useMemo3(() => column != null && model.onItemDelete ? [
|
|
306
|
+
createMenuAction("delete-item", () => model.onItemDelete?.(column, data), {
|
|
307
|
+
label: t("delete menu label"),
|
|
308
|
+
icon: "ph--trash--regular"
|
|
309
|
+
})
|
|
310
|
+
] : [], [
|
|
311
|
+
column,
|
|
312
|
+
data,
|
|
313
|
+
model.onItemDelete,
|
|
314
|
+
t
|
|
52
315
|
]);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
316
|
+
if (!data) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
const label = Obj.getLabel(data);
|
|
320
|
+
const description = Obj.getDescription(data);
|
|
321
|
+
return /* @__PURE__ */ React2.createElement(Mosaic.Tile, {
|
|
322
|
+
asChild: true,
|
|
323
|
+
dragHandle: dragHandleRef.current,
|
|
324
|
+
id: data.id,
|
|
325
|
+
data,
|
|
326
|
+
location,
|
|
327
|
+
debug
|
|
328
|
+
}, /* @__PURE__ */ React2.createElement(Focus.Group, {
|
|
329
|
+
asChild: true
|
|
330
|
+
}, /* @__PURE__ */ React2.createElement(Menu.Root, null, /* @__PURE__ */ React2.createElement(Card.Root, {
|
|
331
|
+
classNames,
|
|
332
|
+
"data-testid": "board-item",
|
|
333
|
+
onClick: () => rootRef.current?.focus(),
|
|
334
|
+
ref: composedRef
|
|
335
|
+
}, /* @__PURE__ */ React2.createElement(Card.Toolbar, null, /* @__PURE__ */ React2.createElement(Card.DragHandle, {
|
|
336
|
+
ref: dragHandleRef
|
|
337
|
+
}), /* @__PURE__ */ React2.createElement(Card.Title, null, label), /* @__PURE__ */ React2.createElement(Menu.Trigger, {
|
|
338
|
+
asChild: true,
|
|
339
|
+
disabled: !items?.length
|
|
340
|
+
}, /* @__PURE__ */ React2.createElement(Toolbar.IconButton, {
|
|
341
|
+
iconOnly: true,
|
|
342
|
+
variant: "ghost",
|
|
343
|
+
icon: "ph--dots-three-vertical--regular",
|
|
344
|
+
label: t("action menu label")
|
|
345
|
+
})), /* @__PURE__ */ React2.createElement(Menu.Content, {
|
|
346
|
+
items
|
|
347
|
+
})), /* @__PURE__ */ React2.createElement(Card.Row, {
|
|
348
|
+
icon: "ph--note--regular",
|
|
349
|
+
classNames: "text-description"
|
|
350
|
+
}, description), /* @__PURE__ */ React2.createElement(Card.Row, {
|
|
351
|
+
icon: "ph--tag--regular"
|
|
352
|
+
}, label && /* @__PURE__ */ React2.createElement("div", {
|
|
353
|
+
role: "none",
|
|
354
|
+
className: "shrink-0 flex gap-1 items-center text-xs"
|
|
355
|
+
}, /* @__PURE__ */ React2.createElement(Tag, {
|
|
356
|
+
palette: getHashStyles(label).hue
|
|
357
|
+
}, label)))))));
|
|
59
358
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
359
|
+
BoardItemInner.displayName = BOARD_ITEM_NAME;
|
|
360
|
+
var BoardItem = BoardItemInner;
|
|
361
|
+
|
|
362
|
+
// src/components/Board/Column.tsx
|
|
363
|
+
var BOARD_COLUMN_CONTEXT_NAME = "Board.Column";
|
|
364
|
+
var [BoardColumnProvider, useBoardColumnContext] = createContext(BOARD_COLUMN_CONTEXT_NAME, null);
|
|
365
|
+
function useBoardColumn() {
|
|
366
|
+
const value = useBoardColumnContext(BOARD_COLUMN_CONTEXT_NAME);
|
|
367
|
+
return value?.column;
|
|
368
|
+
}
|
|
369
|
+
var BOARD_COLUMN_ROOT_NAME = "Board.Column.Root";
|
|
370
|
+
var BoardColumnRootInner = /* @__PURE__ */ forwardRef3(({ classNames, children, location, data, debug, dragHandleRef: dragHandleRefProp, ...rest }, forwardedRef) => {
|
|
371
|
+
const { model } = useBoard(BOARD_COLUMN_ROOT_NAME);
|
|
372
|
+
const internalRef = useRef3(null);
|
|
373
|
+
const dragHandleRef = dragHandleRefProp ?? internalRef;
|
|
374
|
+
return /* @__PURE__ */ React3.createElement(Mosaic.Tile, {
|
|
375
|
+
asChild: true,
|
|
376
|
+
location,
|
|
377
|
+
id: model.getColumnId(data),
|
|
378
|
+
data,
|
|
379
|
+
debug,
|
|
380
|
+
dragHandle: dragHandleRef.current
|
|
381
|
+
}, /* @__PURE__ */ React3.createElement(Focus.Group, {
|
|
382
|
+
...rest,
|
|
383
|
+
"data-testid": "board-column",
|
|
384
|
+
classNames: mx2(
|
|
385
|
+
// NOTE: Reserves 2px for outer Focus.Group border.
|
|
386
|
+
"group/column h-full overflow-hidden w-[calc(100vw-2px)] md:w-card-default-width snap-center bg-deck-surface",
|
|
387
|
+
classNames
|
|
388
|
+
),
|
|
389
|
+
ref: forwardedRef
|
|
390
|
+
}, /* @__PURE__ */ React3.createElement(BoardColumnProvider, {
|
|
391
|
+
column: data
|
|
392
|
+
}, children)));
|
|
393
|
+
});
|
|
394
|
+
BoardColumnRootInner.displayName = BOARD_COLUMN_ROOT_NAME;
|
|
395
|
+
var BoardColumnRoot = BoardColumnRootInner;
|
|
396
|
+
var BOARD_COLUMN_HEADER_NAME = "Board.Column.Header";
|
|
397
|
+
var BoardColumnHeader = /* @__PURE__ */ forwardRef3(({ classNames, label, dragHandleRef }, forwardedRef) => {
|
|
398
|
+
const { t } = useTranslation2(translationKey);
|
|
399
|
+
const { model } = useBoard(BOARD_COLUMN_HEADER_NAME);
|
|
400
|
+
const column = useBoardColumn();
|
|
401
|
+
const columnMenuItems = useMemo4(() => column != null && model.onColumnDelete ? [
|
|
402
|
+
createMenuAction2("delete-column", () => model.onColumnDelete?.(column), {
|
|
403
|
+
label: t("delete menu label"),
|
|
404
|
+
icon: "ph--trash--regular"
|
|
405
|
+
})
|
|
406
|
+
] : [], [
|
|
407
|
+
column,
|
|
408
|
+
model.onColumnDelete,
|
|
409
|
+
t
|
|
410
|
+
]);
|
|
411
|
+
return /* @__PURE__ */ React3.createElement(Menu2.Root, null, /* @__PURE__ */ React3.createElement(Toolbar2.Root, {
|
|
412
|
+
classNames: mx2("border-b border-separator", classNames),
|
|
413
|
+
"data-testid": "board-column-header",
|
|
414
|
+
ref: forwardedRef
|
|
415
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar2.DragHandle, {
|
|
416
|
+
ref: dragHandleRef
|
|
417
|
+
}), /* @__PURE__ */ React3.createElement(Toolbar2.Text, null, label), /* @__PURE__ */ React3.createElement(Menu2.Trigger, {
|
|
418
|
+
asChild: true,
|
|
419
|
+
disabled: !columnMenuItems?.length
|
|
420
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar2.IconButton, {
|
|
421
|
+
iconOnly: true,
|
|
422
|
+
variant: "ghost",
|
|
423
|
+
icon: "ph--dots-three-vertical--regular",
|
|
424
|
+
label: t("action menu label")
|
|
425
|
+
})), /* @__PURE__ */ React3.createElement(Menu2.Content, {
|
|
426
|
+
items: columnMenuItems
|
|
427
|
+
})));
|
|
66
428
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
429
|
+
BoardColumnHeader.displayName = BOARD_COLUMN_HEADER_NAME;
|
|
430
|
+
var BOARD_COLUMN_BODY_NAME = "Board.Column.Body";
|
|
431
|
+
var BoardColumnBody = ({ data, eventHandler, Tile = BoardItem, debug }) => {
|
|
432
|
+
const { model } = useBoard(BOARD_COLUMN_BODY_NAME);
|
|
433
|
+
const [viewport, setViewport] = useState(null);
|
|
434
|
+
const items = useAtomValue(model.items(data));
|
|
435
|
+
return /* @__PURE__ */ React3.createElement(Mosaic.Container, {
|
|
436
|
+
asChild: true,
|
|
437
|
+
withFocus: true,
|
|
438
|
+
orientation: "vertical",
|
|
439
|
+
autoScroll: viewport,
|
|
440
|
+
eventHandler,
|
|
441
|
+
debug
|
|
442
|
+
}, /* @__PURE__ */ React3.createElement(ScrollArea.Root, {
|
|
443
|
+
orientation: "vertical",
|
|
444
|
+
thin: true,
|
|
445
|
+
margin: true,
|
|
446
|
+
padding: true
|
|
447
|
+
}, /* @__PURE__ */ React3.createElement(ScrollArea.Viewport, {
|
|
448
|
+
classNames: "snap-y md:snap-none",
|
|
449
|
+
ref: setViewport
|
|
450
|
+
}, /* @__PURE__ */ React3.createElement(Mosaic.Stack, {
|
|
451
|
+
items,
|
|
452
|
+
getId: model.getItemId,
|
|
453
|
+
Tile
|
|
454
|
+
}))));
|
|
455
|
+
};
|
|
456
|
+
BoardColumnBody.displayName = BOARD_COLUMN_BODY_NAME;
|
|
457
|
+
var BOARD_COLUMN_FOOTER_NAME = "Board.Column.Footer";
|
|
458
|
+
var BoardColumnFooter = /* @__PURE__ */ forwardRef3(({ classNames, data, onAdd }, forwardedRef) => {
|
|
459
|
+
const { t } = useTranslation2(translationKey);
|
|
460
|
+
const { model } = useBoard(BOARD_COLUMN_FOOTER_NAME);
|
|
461
|
+
const handleAdd = onAdd ?? (model.onItemCreate && data ? () => void model.onItemCreate?.(data) : void 0);
|
|
462
|
+
return /* @__PURE__ */ React3.createElement(Toolbar2.Root, {
|
|
463
|
+
classNames: mx2("rounded-b-sm border-t border-separator", classNames),
|
|
464
|
+
ref: forwardedRef
|
|
465
|
+
}, handleAdd && /* @__PURE__ */ React3.createElement(IconButton, {
|
|
466
|
+
"data-testid": "board-column-add-item",
|
|
467
|
+
classNames: "group-hover/column:opacity-100 md:opacity-0 transition transition-opacity duration-500",
|
|
468
|
+
variant: "ghost",
|
|
469
|
+
icon: "ph--plus--regular",
|
|
470
|
+
iconOnly: true,
|
|
471
|
+
label: t("add item label"),
|
|
472
|
+
onClick: handleAdd
|
|
473
|
+
}));
|
|
474
|
+
});
|
|
475
|
+
BoardColumnFooter.displayName = BOARD_COLUMN_FOOTER_NAME;
|
|
476
|
+
var BOARD_DEFAULT_COLUMN_NAME = "Board.DefaultColumn";
|
|
477
|
+
var DefaultBoardColumn = /* @__PURE__ */ forwardRef3(({ classNames, location, data, debug, Tile = BoardItem }, forwardedRef) => {
|
|
478
|
+
const { model } = useBoard(BOARD_DEFAULT_COLUMN_NAME);
|
|
479
|
+
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
480
|
+
const dragHandleRef = useRef3(null);
|
|
481
|
+
const [column, updateColumn] = useObject(data);
|
|
482
|
+
const eventHandler = useEventHandlerAdapter({
|
|
483
|
+
id: model.getColumnId(data),
|
|
484
|
+
items: column?.items ?? [],
|
|
485
|
+
getId: (ref) => ref.target?.id ?? ref.dxn.toString(),
|
|
486
|
+
get: (refOrObj) => Ref.isRef(refOrObj) ? refOrObj.target : refOrObj,
|
|
487
|
+
make: (object) => Ref.make(object),
|
|
488
|
+
canDrop: ({ source }) => {
|
|
489
|
+
const item = Ref.isRef(source.data) ? source.data.target : source.data;
|
|
490
|
+
return item != null && Obj2.isObject(item) && model.isItem(item);
|
|
491
|
+
},
|
|
492
|
+
onChange: (mutator) => updateColumn((col) => mutator(col.items))
|
|
493
|
+
});
|
|
494
|
+
return /* @__PURE__ */ React3.createElement(BoardColumnRootInner, {
|
|
495
|
+
classNames: mx2("group/column grid", debug ? "grid-rows-[var(--dx-rail-action)_1fr_20rem]" : "grid-rows-[var(--dx-rail-action)_1fr_var(--dx-rail-action)]", classNames),
|
|
496
|
+
location,
|
|
497
|
+
data,
|
|
498
|
+
dragHandleRef,
|
|
499
|
+
ref: forwardedRef
|
|
500
|
+
}, /* @__PURE__ */ React3.createElement(BoardColumnHeader, {
|
|
501
|
+
label: Obj2.getLabel(data) ?? data.id,
|
|
502
|
+
dragHandleRef
|
|
503
|
+
}), /* @__PURE__ */ React3.createElement(BoardColumnBody, {
|
|
504
|
+
data,
|
|
505
|
+
eventHandler,
|
|
506
|
+
debug: debugHandler,
|
|
507
|
+
Tile
|
|
508
|
+
}), /* @__PURE__ */ React3.createElement("div", {
|
|
509
|
+
role: "none",
|
|
510
|
+
className: "flex flex-col col-span-full"
|
|
511
|
+
}, /* @__PURE__ */ React3.createElement(BoardColumnFooter, {
|
|
512
|
+
data
|
|
513
|
+
}), /* @__PURE__ */ React3.createElement(DebugInfo, null)));
|
|
514
|
+
});
|
|
515
|
+
DefaultBoardColumn.displayName = BOARD_DEFAULT_COLUMN_NAME;
|
|
516
|
+
var BoardColumn = {
|
|
517
|
+
Root: BoardColumnRoot,
|
|
518
|
+
Header: BoardColumnHeader,
|
|
519
|
+
Body: BoardColumnBody,
|
|
520
|
+
Footer: BoardColumnFooter
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
// src/components/Board/Board.tsx
|
|
524
|
+
var BOARD_NAME = "Board";
|
|
525
|
+
var [BoardContextProvider, useBoardContext] = createContext2(BOARD_NAME);
|
|
526
|
+
function useBoard(displayName) {
|
|
527
|
+
return useBoardContext(displayName ?? BOARD_NAME);
|
|
528
|
+
}
|
|
529
|
+
var BOARD_ROOT_NAME = "Board.Root";
|
|
530
|
+
var BoardRootInner = ({ model, children }) => {
|
|
531
|
+
return /* @__PURE__ */ React4.createElement(BoardContextProvider, {
|
|
532
|
+
model
|
|
71
533
|
}, children);
|
|
72
534
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
535
|
+
BoardRootInner.displayName = BOARD_ROOT_NAME;
|
|
536
|
+
var BoardRoot = BoardRootInner;
|
|
537
|
+
var BOARD_CONTENT_NAME = "Board.Content";
|
|
538
|
+
var BoardContentInner = /* @__PURE__ */ forwardRef4(({ classNames, id: _id, debug, eventHandler, Tile = DefaultBoardColumn }, forwardedRef) => {
|
|
539
|
+
const { model } = useBoardContext(BOARD_CONTENT_NAME);
|
|
540
|
+
const [DebugInfo, debugHandler] = useContainerDebug(debug);
|
|
541
|
+
const [viewport, setViewport] = useState2(null);
|
|
542
|
+
const items = useAtomValue2(model.columns);
|
|
543
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
544
|
+
ref: forwardedRef,
|
|
545
|
+
className: mx3("flex h-full w-full overflow-hidden", classNames)
|
|
546
|
+
}, /* @__PURE__ */ React4.createElement(Focus.Group, {
|
|
547
|
+
asChild: true,
|
|
548
|
+
orientation: "horizontal"
|
|
549
|
+
}, /* @__PURE__ */ React4.createElement(Mosaic.Container, {
|
|
550
|
+
asChild: true,
|
|
551
|
+
withFocus: true,
|
|
552
|
+
orientation: "horizontal",
|
|
553
|
+
autoScroll: viewport,
|
|
554
|
+
eventHandler,
|
|
555
|
+
debug: debugHandler
|
|
556
|
+
}, /* @__PURE__ */ React4.createElement(ScrollArea2.Root, {
|
|
557
|
+
orientation: "horizontal",
|
|
558
|
+
classNames: "md:pt-3",
|
|
559
|
+
margin: true,
|
|
560
|
+
padding: true
|
|
561
|
+
}, /* @__PURE__ */ React4.createElement(ScrollArea2.Viewport, {
|
|
562
|
+
classNames: "snap-mandatory snap-x md:snap-none",
|
|
563
|
+
ref: setViewport
|
|
564
|
+
}, /* @__PURE__ */ React4.createElement(Mosaic.Stack, {
|
|
565
|
+
items,
|
|
566
|
+
getId: model.getColumnId,
|
|
567
|
+
Tile,
|
|
568
|
+
debug
|
|
569
|
+
}))))), /* @__PURE__ */ React4.createElement(DebugInfo, null));
|
|
570
|
+
});
|
|
571
|
+
BoardContentInner.displayName = BOARD_CONTENT_NAME;
|
|
572
|
+
var BoardContent = BoardContentInner;
|
|
573
|
+
var BOARD_PLACEHOLDER_NAME = "Board.Placeholder";
|
|
574
|
+
var BoardPlaceholder = (props) => {
|
|
575
|
+
return /* @__PURE__ */ React4.createElement(Mosaic.Placeholder, {
|
|
576
|
+
...props,
|
|
577
|
+
classNames: styles.placeholder.root
|
|
578
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
579
|
+
className: mx3("flex h-full border border-dashed border-separator rounded-xs", styles.placeholder.content)
|
|
580
|
+
}));
|
|
581
|
+
};
|
|
582
|
+
BoardPlaceholder.displayName = BOARD_PLACEHOLDER_NAME;
|
|
583
|
+
var BOARD_DEBUG_NAME = "Board.Debug";
|
|
584
|
+
var BoardDebug = /* @__PURE__ */ forwardRef4(({ classNames }, forwardedRef) => {
|
|
585
|
+
const { containers, dragging } = useMosaicRootContext(BOARD_DEBUG_NAME);
|
|
586
|
+
const counter = useRef4(0);
|
|
587
|
+
return /* @__PURE__ */ React4.createElement(Json2, {
|
|
588
|
+
data: {
|
|
589
|
+
containers,
|
|
590
|
+
dragging,
|
|
591
|
+
count: counter.current++
|
|
592
|
+
},
|
|
593
|
+
classNames: mx3("text-xs", classNames),
|
|
594
|
+
ref: forwardedRef
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
BoardDebug.displayName = BOARD_DEBUG_NAME;
|
|
598
|
+
var Board = {
|
|
599
|
+
Root: BoardRoot,
|
|
600
|
+
Content: BoardContent,
|
|
601
|
+
Column: BoardColumn,
|
|
602
|
+
Item: BoardItem,
|
|
603
|
+
Placeholder: BoardPlaceholder,
|
|
604
|
+
Debug: BoardDebug
|
|
77
605
|
};
|
|
78
606
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
607
|
+
Board,
|
|
608
|
+
BoardDebug,
|
|
81
609
|
Focus,
|
|
82
|
-
Image,
|
|
83
|
-
Layout,
|
|
84
610
|
Mosaic,
|
|
85
|
-
Stack,
|
|
86
|
-
VirtualStack,
|
|
87
|
-
styles as cardStyles,
|
|
88
611
|
dropHandler,
|
|
89
|
-
|
|
90
|
-
|
|
612
|
+
getSourceData,
|
|
613
|
+
styles as mosaicStyles,
|
|
614
|
+
useBoard,
|
|
615
|
+
useBoardColumn,
|
|
91
616
|
useContainerDebug,
|
|
617
|
+
useDefaultColumnEventHandler,
|
|
92
618
|
useEventHandlerAdapter,
|
|
93
619
|
useFocus,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
620
|
+
useMosaicRootContext as useMosaic,
|
|
621
|
+
useMosaicContainerContext as useMosaicContainer,
|
|
622
|
+
useMosaicTileContext as useMosaicTile,
|
|
97
623
|
useVisibleItems
|
|
98
624
|
};
|
|
99
625
|
//# sourceMappingURL=index.mjs.map
|