@almadar/ui 4.50.11 → 4.50.13
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/avl/index.cjs +32 -10
- package/dist/avl/index.js +32 -10
- package/dist/components/index.cjs +32 -10
- package/dist/components/index.js +32 -10
- package/dist/providers/index.cjs +32 -10
- package/dist/providers/index.js +32 -10
- package/dist/runtime/index.cjs +32 -10
- package/dist/runtime/index.js +32 -10
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -24948,6 +24948,7 @@ function useDataDnd(args) {
|
|
|
24948
24948
|
zonesRef.current.delete(zoneId2);
|
|
24949
24949
|
}, []);
|
|
24950
24950
|
const [activeDrag, setActiveDrag] = React93__namespace.default.useState(null);
|
|
24951
|
+
const [overZoneGroup, setOverZoneGroup] = React93__namespace.default.useState(null);
|
|
24951
24952
|
const zoneId = React93__namespace.default.useId();
|
|
24952
24953
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24953
24954
|
const meta = React93__namespace.default.useMemo(
|
|
@@ -25130,17 +25131,29 @@ function useDataDnd(args) {
|
|
|
25130
25131
|
});
|
|
25131
25132
|
const ctx = React93__namespace.default.useContext(RootCtx);
|
|
25132
25133
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25133
|
-
const
|
|
25134
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25135
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
25136
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
25137
|
+
dndLog.debug("dropzone:render", {
|
|
25138
|
+
group: ownGroup,
|
|
25139
|
+
isOver,
|
|
25140
|
+
isThisZoneOver,
|
|
25141
|
+
overZoneGroup: overZoneGroup2,
|
|
25142
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
25143
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
25144
|
+
showForeignPlaceholder,
|
|
25145
|
+
ctxAvailable: ctx != null
|
|
25146
|
+
});
|
|
25134
25147
|
React93__namespace.default.useEffect(() => {
|
|
25135
|
-
dndLog.
|
|
25136
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
25148
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25149
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25137
25150
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
25138
25151
|
Box,
|
|
25139
25152
|
{
|
|
25140
25153
|
ref: setNodeRef,
|
|
25141
25154
|
"data-dnd-zone": ownGroup,
|
|
25142
|
-
"data-dnd-is-over":
|
|
25143
|
-
className:
|
|
25155
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
25156
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
25144
25157
|
children: [
|
|
25145
25158
|
children,
|
|
25146
25159
|
showForeignPlaceholder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -25156,8 +25169,8 @@ function useDataDnd(args) {
|
|
|
25156
25169
|
);
|
|
25157
25170
|
};
|
|
25158
25171
|
const rootContextValue = React93__namespace.default.useMemo(
|
|
25159
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
25160
|
-
[registerZone, unregisterZone, activeDrag]
|
|
25172
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
25173
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
25161
25174
|
);
|
|
25162
25175
|
const handleDragStart = React93__namespace.default.useCallback((event) => {
|
|
25163
25176
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -25165,24 +25178,32 @@ function useDataDnd(args) {
|
|
|
25165
25178
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
25166
25179
|
if (sourceZone) {
|
|
25167
25180
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
25181
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
25182
|
+
} else {
|
|
25183
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
25168
25184
|
}
|
|
25169
25185
|
dndLog.info("dragStart", {
|
|
25170
25186
|
activeId: event.active.id,
|
|
25171
25187
|
activeData: event.active.data?.current,
|
|
25172
25188
|
sourceGroup: sourceZone?.group,
|
|
25173
25189
|
height,
|
|
25174
|
-
zoneCount: zonesRef.current.size
|
|
25190
|
+
zoneCount: zonesRef.current.size,
|
|
25191
|
+
isRoot
|
|
25175
25192
|
});
|
|
25176
|
-
}, [findZoneByItem]);
|
|
25193
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
25177
25194
|
const handleDragOver = React93__namespace.default.useCallback((event) => {
|
|
25195
|
+
const overData = event.over?.data?.current;
|
|
25196
|
+
const group = overData?.dndGroup ?? null;
|
|
25197
|
+
setOverZoneGroup(group);
|
|
25178
25198
|
dndLog.debug("dragOver", {
|
|
25179
25199
|
activeId: event.active.id,
|
|
25180
25200
|
overId: event.over?.id,
|
|
25181
|
-
|
|
25201
|
+
overGroup: group
|
|
25182
25202
|
});
|
|
25183
25203
|
}, []);
|
|
25184
25204
|
const handleDragCancel = React93__namespace.default.useCallback((event) => {
|
|
25185
25205
|
setActiveDrag(null);
|
|
25206
|
+
setOverZoneGroup(null);
|
|
25186
25207
|
dndLog.warn("dragCancel", {
|
|
25187
25208
|
activeId: event.active.id,
|
|
25188
25209
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -25191,6 +25212,7 @@ function useDataDnd(args) {
|
|
|
25191
25212
|
const handleDragEndWithCleanup = React93__namespace.default.useCallback((event) => {
|
|
25192
25213
|
handleDragEnd(event);
|
|
25193
25214
|
setActiveDrag(null);
|
|
25215
|
+
setOverZoneGroup(null);
|
|
25194
25216
|
}, [handleDragEnd]);
|
|
25195
25217
|
const wrapContainer = React93__namespace.default.useCallback(
|
|
25196
25218
|
(children) => {
|
package/dist/avl/index.js
CHANGED
|
@@ -24902,6 +24902,7 @@ function useDataDnd(args) {
|
|
|
24902
24902
|
zonesRef.current.delete(zoneId2);
|
|
24903
24903
|
}, []);
|
|
24904
24904
|
const [activeDrag, setActiveDrag] = React93__default.useState(null);
|
|
24905
|
+
const [overZoneGroup, setOverZoneGroup] = React93__default.useState(null);
|
|
24905
24906
|
const zoneId = React93__default.useId();
|
|
24906
24907
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24907
24908
|
const meta = React93__default.useMemo(
|
|
@@ -25084,17 +25085,29 @@ function useDataDnd(args) {
|
|
|
25084
25085
|
});
|
|
25085
25086
|
const ctx = React93__default.useContext(RootCtx);
|
|
25086
25087
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25087
|
-
const
|
|
25088
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25089
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
25090
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
25091
|
+
dndLog.debug("dropzone:render", {
|
|
25092
|
+
group: ownGroup,
|
|
25093
|
+
isOver,
|
|
25094
|
+
isThisZoneOver,
|
|
25095
|
+
overZoneGroup: overZoneGroup2,
|
|
25096
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
25097
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
25098
|
+
showForeignPlaceholder,
|
|
25099
|
+
ctxAvailable: ctx != null
|
|
25100
|
+
});
|
|
25088
25101
|
React93__default.useEffect(() => {
|
|
25089
|
-
dndLog.
|
|
25090
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
25102
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25103
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25091
25104
|
return /* @__PURE__ */ jsxs(
|
|
25092
25105
|
Box,
|
|
25093
25106
|
{
|
|
25094
25107
|
ref: setNodeRef,
|
|
25095
25108
|
"data-dnd-zone": ownGroup,
|
|
25096
|
-
"data-dnd-is-over":
|
|
25097
|
-
className:
|
|
25109
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
25110
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
25098
25111
|
children: [
|
|
25099
25112
|
children,
|
|
25100
25113
|
showForeignPlaceholder ? /* @__PURE__ */ jsx(
|
|
@@ -25110,8 +25123,8 @@ function useDataDnd(args) {
|
|
|
25110
25123
|
);
|
|
25111
25124
|
};
|
|
25112
25125
|
const rootContextValue = React93__default.useMemo(
|
|
25113
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
25114
|
-
[registerZone, unregisterZone, activeDrag]
|
|
25126
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
25127
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
25115
25128
|
);
|
|
25116
25129
|
const handleDragStart = React93__default.useCallback((event) => {
|
|
25117
25130
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -25119,24 +25132,32 @@ function useDataDnd(args) {
|
|
|
25119
25132
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
25120
25133
|
if (sourceZone) {
|
|
25121
25134
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
25135
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
25136
|
+
} else {
|
|
25137
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
25122
25138
|
}
|
|
25123
25139
|
dndLog.info("dragStart", {
|
|
25124
25140
|
activeId: event.active.id,
|
|
25125
25141
|
activeData: event.active.data?.current,
|
|
25126
25142
|
sourceGroup: sourceZone?.group,
|
|
25127
25143
|
height,
|
|
25128
|
-
zoneCount: zonesRef.current.size
|
|
25144
|
+
zoneCount: zonesRef.current.size,
|
|
25145
|
+
isRoot
|
|
25129
25146
|
});
|
|
25130
|
-
}, [findZoneByItem]);
|
|
25147
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
25131
25148
|
const handleDragOver = React93__default.useCallback((event) => {
|
|
25149
|
+
const overData = event.over?.data?.current;
|
|
25150
|
+
const group = overData?.dndGroup ?? null;
|
|
25151
|
+
setOverZoneGroup(group);
|
|
25132
25152
|
dndLog.debug("dragOver", {
|
|
25133
25153
|
activeId: event.active.id,
|
|
25134
25154
|
overId: event.over?.id,
|
|
25135
|
-
|
|
25155
|
+
overGroup: group
|
|
25136
25156
|
});
|
|
25137
25157
|
}, []);
|
|
25138
25158
|
const handleDragCancel = React93__default.useCallback((event) => {
|
|
25139
25159
|
setActiveDrag(null);
|
|
25160
|
+
setOverZoneGroup(null);
|
|
25140
25161
|
dndLog.warn("dragCancel", {
|
|
25141
25162
|
activeId: event.active.id,
|
|
25142
25163
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -25145,6 +25166,7 @@ function useDataDnd(args) {
|
|
|
25145
25166
|
const handleDragEndWithCleanup = React93__default.useCallback((event) => {
|
|
25146
25167
|
handleDragEnd(event);
|
|
25147
25168
|
setActiveDrag(null);
|
|
25169
|
+
setOverZoneGroup(null);
|
|
25148
25170
|
}, [handleDragEnd]);
|
|
25149
25171
|
const wrapContainer = React93__default.useCallback(
|
|
25150
25172
|
(children) => {
|
|
@@ -20115,6 +20115,7 @@ function useDataDnd(args) {
|
|
|
20115
20115
|
zonesRef.current.delete(zoneId2);
|
|
20116
20116
|
}, []);
|
|
20117
20117
|
const [activeDrag, setActiveDrag] = React75__namespace.default.useState(null);
|
|
20118
|
+
const [overZoneGroup, setOverZoneGroup] = React75__namespace.default.useState(null);
|
|
20118
20119
|
const zoneId = React75__namespace.default.useId();
|
|
20119
20120
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
20120
20121
|
const meta = React75__namespace.default.useMemo(
|
|
@@ -20297,17 +20298,29 @@ function useDataDnd(args) {
|
|
|
20297
20298
|
});
|
|
20298
20299
|
const ctx = React75__namespace.default.useContext(RootCtx);
|
|
20299
20300
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
20300
|
-
const
|
|
20301
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
20302
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
20303
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
20304
|
+
dndLog.debug("dropzone:render", {
|
|
20305
|
+
group: ownGroup,
|
|
20306
|
+
isOver,
|
|
20307
|
+
isThisZoneOver,
|
|
20308
|
+
overZoneGroup: overZoneGroup2,
|
|
20309
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
20310
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
20311
|
+
showForeignPlaceholder,
|
|
20312
|
+
ctxAvailable: ctx != null
|
|
20313
|
+
});
|
|
20301
20314
|
React75__namespace.default.useEffect(() => {
|
|
20302
|
-
dndLog.
|
|
20303
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
20315
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
20316
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
20304
20317
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20305
20318
|
exports.Box,
|
|
20306
20319
|
{
|
|
20307
20320
|
ref: setNodeRef,
|
|
20308
20321
|
"data-dnd-zone": ownGroup,
|
|
20309
|
-
"data-dnd-is-over":
|
|
20310
|
-
className:
|
|
20322
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
20323
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
20311
20324
|
children: [
|
|
20312
20325
|
children,
|
|
20313
20326
|
showForeignPlaceholder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20323,8 +20336,8 @@ function useDataDnd(args) {
|
|
|
20323
20336
|
);
|
|
20324
20337
|
};
|
|
20325
20338
|
const rootContextValue = React75__namespace.default.useMemo(
|
|
20326
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
20327
|
-
[registerZone, unregisterZone, activeDrag]
|
|
20339
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
20340
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
20328
20341
|
);
|
|
20329
20342
|
const handleDragStart = React75__namespace.default.useCallback((event) => {
|
|
20330
20343
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -20332,24 +20345,32 @@ function useDataDnd(args) {
|
|
|
20332
20345
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
20333
20346
|
if (sourceZone) {
|
|
20334
20347
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
20348
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
20349
|
+
} else {
|
|
20350
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
20335
20351
|
}
|
|
20336
20352
|
dndLog.info("dragStart", {
|
|
20337
20353
|
activeId: event.active.id,
|
|
20338
20354
|
activeData: event.active.data?.current,
|
|
20339
20355
|
sourceGroup: sourceZone?.group,
|
|
20340
20356
|
height,
|
|
20341
|
-
zoneCount: zonesRef.current.size
|
|
20357
|
+
zoneCount: zonesRef.current.size,
|
|
20358
|
+
isRoot
|
|
20342
20359
|
});
|
|
20343
|
-
}, [findZoneByItem]);
|
|
20360
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
20344
20361
|
const handleDragOver = React75__namespace.default.useCallback((event) => {
|
|
20362
|
+
const overData = event.over?.data?.current;
|
|
20363
|
+
const group = overData?.dndGroup ?? null;
|
|
20364
|
+
setOverZoneGroup(group);
|
|
20345
20365
|
dndLog.debug("dragOver", {
|
|
20346
20366
|
activeId: event.active.id,
|
|
20347
20367
|
overId: event.over?.id,
|
|
20348
|
-
|
|
20368
|
+
overGroup: group
|
|
20349
20369
|
});
|
|
20350
20370
|
}, []);
|
|
20351
20371
|
const handleDragCancel = React75__namespace.default.useCallback((event) => {
|
|
20352
20372
|
setActiveDrag(null);
|
|
20373
|
+
setOverZoneGroup(null);
|
|
20353
20374
|
dndLog.warn("dragCancel", {
|
|
20354
20375
|
activeId: event.active.id,
|
|
20355
20376
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -20358,6 +20379,7 @@ function useDataDnd(args) {
|
|
|
20358
20379
|
const handleDragEndWithCleanup = React75__namespace.default.useCallback((event) => {
|
|
20359
20380
|
handleDragEnd(event);
|
|
20360
20381
|
setActiveDrag(null);
|
|
20382
|
+
setOverZoneGroup(null);
|
|
20361
20383
|
}, [handleDragEnd]);
|
|
20362
20384
|
const wrapContainer = React75__namespace.default.useCallback(
|
|
20363
20385
|
(children) => {
|
package/dist/components/index.js
CHANGED
|
@@ -20069,6 +20069,7 @@ function useDataDnd(args) {
|
|
|
20069
20069
|
zonesRef.current.delete(zoneId2);
|
|
20070
20070
|
}, []);
|
|
20071
20071
|
const [activeDrag, setActiveDrag] = React75__default.useState(null);
|
|
20072
|
+
const [overZoneGroup, setOverZoneGroup] = React75__default.useState(null);
|
|
20072
20073
|
const zoneId = React75__default.useId();
|
|
20073
20074
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
20074
20075
|
const meta = React75__default.useMemo(
|
|
@@ -20251,17 +20252,29 @@ function useDataDnd(args) {
|
|
|
20251
20252
|
});
|
|
20252
20253
|
const ctx = React75__default.useContext(RootCtx);
|
|
20253
20254
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
20254
|
-
const
|
|
20255
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
20256
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
20257
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
20258
|
+
dndLog.debug("dropzone:render", {
|
|
20259
|
+
group: ownGroup,
|
|
20260
|
+
isOver,
|
|
20261
|
+
isThisZoneOver,
|
|
20262
|
+
overZoneGroup: overZoneGroup2,
|
|
20263
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
20264
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
20265
|
+
showForeignPlaceholder,
|
|
20266
|
+
ctxAvailable: ctx != null
|
|
20267
|
+
});
|
|
20255
20268
|
React75__default.useEffect(() => {
|
|
20256
|
-
dndLog.
|
|
20257
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
20269
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
20270
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
20258
20271
|
return /* @__PURE__ */ jsxs(
|
|
20259
20272
|
Box,
|
|
20260
20273
|
{
|
|
20261
20274
|
ref: setNodeRef,
|
|
20262
20275
|
"data-dnd-zone": ownGroup,
|
|
20263
|
-
"data-dnd-is-over":
|
|
20264
|
-
className:
|
|
20276
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
20277
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
20265
20278
|
children: [
|
|
20266
20279
|
children,
|
|
20267
20280
|
showForeignPlaceholder ? /* @__PURE__ */ jsx(
|
|
@@ -20277,8 +20290,8 @@ function useDataDnd(args) {
|
|
|
20277
20290
|
);
|
|
20278
20291
|
};
|
|
20279
20292
|
const rootContextValue = React75__default.useMemo(
|
|
20280
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
20281
|
-
[registerZone, unregisterZone, activeDrag]
|
|
20293
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
20294
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
20282
20295
|
);
|
|
20283
20296
|
const handleDragStart = React75__default.useCallback((event) => {
|
|
20284
20297
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -20286,24 +20299,32 @@ function useDataDnd(args) {
|
|
|
20286
20299
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
20287
20300
|
if (sourceZone) {
|
|
20288
20301
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
20302
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
20303
|
+
} else {
|
|
20304
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
20289
20305
|
}
|
|
20290
20306
|
dndLog.info("dragStart", {
|
|
20291
20307
|
activeId: event.active.id,
|
|
20292
20308
|
activeData: event.active.data?.current,
|
|
20293
20309
|
sourceGroup: sourceZone?.group,
|
|
20294
20310
|
height,
|
|
20295
|
-
zoneCount: zonesRef.current.size
|
|
20311
|
+
zoneCount: zonesRef.current.size,
|
|
20312
|
+
isRoot
|
|
20296
20313
|
});
|
|
20297
|
-
}, [findZoneByItem]);
|
|
20314
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
20298
20315
|
const handleDragOver = React75__default.useCallback((event) => {
|
|
20316
|
+
const overData = event.over?.data?.current;
|
|
20317
|
+
const group = overData?.dndGroup ?? null;
|
|
20318
|
+
setOverZoneGroup(group);
|
|
20299
20319
|
dndLog.debug("dragOver", {
|
|
20300
20320
|
activeId: event.active.id,
|
|
20301
20321
|
overId: event.over?.id,
|
|
20302
|
-
|
|
20322
|
+
overGroup: group
|
|
20303
20323
|
});
|
|
20304
20324
|
}, []);
|
|
20305
20325
|
const handleDragCancel = React75__default.useCallback((event) => {
|
|
20306
20326
|
setActiveDrag(null);
|
|
20327
|
+
setOverZoneGroup(null);
|
|
20307
20328
|
dndLog.warn("dragCancel", {
|
|
20308
20329
|
activeId: event.active.id,
|
|
20309
20330
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -20312,6 +20333,7 @@ function useDataDnd(args) {
|
|
|
20312
20333
|
const handleDragEndWithCleanup = React75__default.useCallback((event) => {
|
|
20313
20334
|
handleDragEnd(event);
|
|
20314
20335
|
setActiveDrag(null);
|
|
20336
|
+
setOverZoneGroup(null);
|
|
20315
20337
|
}, [handleDragEnd]);
|
|
20316
20338
|
const wrapContainer = React75__default.useCallback(
|
|
20317
20339
|
(children) => {
|
package/dist/providers/index.cjs
CHANGED
|
@@ -21360,6 +21360,7 @@ function useDataDnd(args) {
|
|
|
21360
21360
|
zonesRef.current.delete(zoneId2);
|
|
21361
21361
|
}, []);
|
|
21362
21362
|
const [activeDrag, setActiveDrag] = React81__namespace.default.useState(null);
|
|
21363
|
+
const [overZoneGroup, setOverZoneGroup] = React81__namespace.default.useState(null);
|
|
21363
21364
|
const zoneId = React81__namespace.default.useId();
|
|
21364
21365
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21365
21366
|
const meta = React81__namespace.default.useMemo(
|
|
@@ -21542,17 +21543,29 @@ function useDataDnd(args) {
|
|
|
21542
21543
|
});
|
|
21543
21544
|
const ctx = React81__namespace.default.useContext(RootCtx);
|
|
21544
21545
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
21545
|
-
const
|
|
21546
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
21547
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
21548
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
21549
|
+
dndLog.debug("dropzone:render", {
|
|
21550
|
+
group: ownGroup,
|
|
21551
|
+
isOver,
|
|
21552
|
+
isThisZoneOver,
|
|
21553
|
+
overZoneGroup: overZoneGroup2,
|
|
21554
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
21555
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
21556
|
+
showForeignPlaceholder,
|
|
21557
|
+
ctxAvailable: ctx != null
|
|
21558
|
+
});
|
|
21546
21559
|
React81__namespace.default.useEffect(() => {
|
|
21547
|
-
dndLog.
|
|
21548
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
21560
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
21561
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
21549
21562
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21550
21563
|
Box,
|
|
21551
21564
|
{
|
|
21552
21565
|
ref: setNodeRef,
|
|
21553
21566
|
"data-dnd-zone": ownGroup,
|
|
21554
|
-
"data-dnd-is-over":
|
|
21555
|
-
className:
|
|
21567
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
21568
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
21556
21569
|
children: [
|
|
21557
21570
|
children,
|
|
21558
21571
|
showForeignPlaceholder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21568,8 +21581,8 @@ function useDataDnd(args) {
|
|
|
21568
21581
|
);
|
|
21569
21582
|
};
|
|
21570
21583
|
const rootContextValue = React81__namespace.default.useMemo(
|
|
21571
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
21572
|
-
[registerZone, unregisterZone, activeDrag]
|
|
21584
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
21585
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
21573
21586
|
);
|
|
21574
21587
|
const handleDragStart = React81__namespace.default.useCallback((event) => {
|
|
21575
21588
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -21577,24 +21590,32 @@ function useDataDnd(args) {
|
|
|
21577
21590
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
21578
21591
|
if (sourceZone) {
|
|
21579
21592
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
21593
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
21594
|
+
} else {
|
|
21595
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
21580
21596
|
}
|
|
21581
21597
|
dndLog.info("dragStart", {
|
|
21582
21598
|
activeId: event.active.id,
|
|
21583
21599
|
activeData: event.active.data?.current,
|
|
21584
21600
|
sourceGroup: sourceZone?.group,
|
|
21585
21601
|
height,
|
|
21586
|
-
zoneCount: zonesRef.current.size
|
|
21602
|
+
zoneCount: zonesRef.current.size,
|
|
21603
|
+
isRoot
|
|
21587
21604
|
});
|
|
21588
|
-
}, [findZoneByItem]);
|
|
21605
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
21589
21606
|
const handleDragOver = React81__namespace.default.useCallback((event) => {
|
|
21607
|
+
const overData = event.over?.data?.current;
|
|
21608
|
+
const group = overData?.dndGroup ?? null;
|
|
21609
|
+
setOverZoneGroup(group);
|
|
21590
21610
|
dndLog.debug("dragOver", {
|
|
21591
21611
|
activeId: event.active.id,
|
|
21592
21612
|
overId: event.over?.id,
|
|
21593
|
-
|
|
21613
|
+
overGroup: group
|
|
21594
21614
|
});
|
|
21595
21615
|
}, []);
|
|
21596
21616
|
const handleDragCancel = React81__namespace.default.useCallback((event) => {
|
|
21597
21617
|
setActiveDrag(null);
|
|
21618
|
+
setOverZoneGroup(null);
|
|
21598
21619
|
dndLog.warn("dragCancel", {
|
|
21599
21620
|
activeId: event.active.id,
|
|
21600
21621
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -21603,6 +21624,7 @@ function useDataDnd(args) {
|
|
|
21603
21624
|
const handleDragEndWithCleanup = React81__namespace.default.useCallback((event) => {
|
|
21604
21625
|
handleDragEnd(event);
|
|
21605
21626
|
setActiveDrag(null);
|
|
21627
|
+
setOverZoneGroup(null);
|
|
21606
21628
|
}, [handleDragEnd]);
|
|
21607
21629
|
const wrapContainer = React81__namespace.default.useCallback(
|
|
21608
21630
|
(children) => {
|
package/dist/providers/index.js
CHANGED
|
@@ -21314,6 +21314,7 @@ function useDataDnd(args) {
|
|
|
21314
21314
|
zonesRef.current.delete(zoneId2);
|
|
21315
21315
|
}, []);
|
|
21316
21316
|
const [activeDrag, setActiveDrag] = React81__default.useState(null);
|
|
21317
|
+
const [overZoneGroup, setOverZoneGroup] = React81__default.useState(null);
|
|
21317
21318
|
const zoneId = React81__default.useId();
|
|
21318
21319
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21319
21320
|
const meta = React81__default.useMemo(
|
|
@@ -21496,17 +21497,29 @@ function useDataDnd(args) {
|
|
|
21496
21497
|
});
|
|
21497
21498
|
const ctx = React81__default.useContext(RootCtx);
|
|
21498
21499
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
21499
|
-
const
|
|
21500
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
21501
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
21502
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
21503
|
+
dndLog.debug("dropzone:render", {
|
|
21504
|
+
group: ownGroup,
|
|
21505
|
+
isOver,
|
|
21506
|
+
isThisZoneOver,
|
|
21507
|
+
overZoneGroup: overZoneGroup2,
|
|
21508
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
21509
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
21510
|
+
showForeignPlaceholder,
|
|
21511
|
+
ctxAvailable: ctx != null
|
|
21512
|
+
});
|
|
21500
21513
|
React81__default.useEffect(() => {
|
|
21501
|
-
dndLog.
|
|
21502
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
21514
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
21515
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
21503
21516
|
return /* @__PURE__ */ jsxs(
|
|
21504
21517
|
Box,
|
|
21505
21518
|
{
|
|
21506
21519
|
ref: setNodeRef,
|
|
21507
21520
|
"data-dnd-zone": ownGroup,
|
|
21508
|
-
"data-dnd-is-over":
|
|
21509
|
-
className:
|
|
21521
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
21522
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
21510
21523
|
children: [
|
|
21511
21524
|
children,
|
|
21512
21525
|
showForeignPlaceholder ? /* @__PURE__ */ jsx(
|
|
@@ -21522,8 +21535,8 @@ function useDataDnd(args) {
|
|
|
21522
21535
|
);
|
|
21523
21536
|
};
|
|
21524
21537
|
const rootContextValue = React81__default.useMemo(
|
|
21525
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
21526
|
-
[registerZone, unregisterZone, activeDrag]
|
|
21538
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
21539
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
21527
21540
|
);
|
|
21528
21541
|
const handleDragStart = React81__default.useCallback((event) => {
|
|
21529
21542
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -21531,24 +21544,32 @@ function useDataDnd(args) {
|
|
|
21531
21544
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
21532
21545
|
if (sourceZone) {
|
|
21533
21546
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
21547
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
21548
|
+
} else {
|
|
21549
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
21534
21550
|
}
|
|
21535
21551
|
dndLog.info("dragStart", {
|
|
21536
21552
|
activeId: event.active.id,
|
|
21537
21553
|
activeData: event.active.data?.current,
|
|
21538
21554
|
sourceGroup: sourceZone?.group,
|
|
21539
21555
|
height,
|
|
21540
|
-
zoneCount: zonesRef.current.size
|
|
21556
|
+
zoneCount: zonesRef.current.size,
|
|
21557
|
+
isRoot
|
|
21541
21558
|
});
|
|
21542
|
-
}, [findZoneByItem]);
|
|
21559
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
21543
21560
|
const handleDragOver = React81__default.useCallback((event) => {
|
|
21561
|
+
const overData = event.over?.data?.current;
|
|
21562
|
+
const group = overData?.dndGroup ?? null;
|
|
21563
|
+
setOverZoneGroup(group);
|
|
21544
21564
|
dndLog.debug("dragOver", {
|
|
21545
21565
|
activeId: event.active.id,
|
|
21546
21566
|
overId: event.over?.id,
|
|
21547
|
-
|
|
21567
|
+
overGroup: group
|
|
21548
21568
|
});
|
|
21549
21569
|
}, []);
|
|
21550
21570
|
const handleDragCancel = React81__default.useCallback((event) => {
|
|
21551
21571
|
setActiveDrag(null);
|
|
21572
|
+
setOverZoneGroup(null);
|
|
21552
21573
|
dndLog.warn("dragCancel", {
|
|
21553
21574
|
activeId: event.active.id,
|
|
21554
21575
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -21557,6 +21578,7 @@ function useDataDnd(args) {
|
|
|
21557
21578
|
const handleDragEndWithCleanup = React81__default.useCallback((event) => {
|
|
21558
21579
|
handleDragEnd(event);
|
|
21559
21580
|
setActiveDrag(null);
|
|
21581
|
+
setOverZoneGroup(null);
|
|
21560
21582
|
}, [handleDragEnd]);
|
|
21561
21583
|
const wrapContainer = React81__default.useCallback(
|
|
21562
21584
|
(children) => {
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -21129,6 +21129,7 @@ function useDataDnd(args) {
|
|
|
21129
21129
|
zonesRef.current.delete(zoneId2);
|
|
21130
21130
|
}, []);
|
|
21131
21131
|
const [activeDrag, setActiveDrag] = React80__namespace.default.useState(null);
|
|
21132
|
+
const [overZoneGroup, setOverZoneGroup] = React80__namespace.default.useState(null);
|
|
21132
21133
|
const zoneId = React80__namespace.default.useId();
|
|
21133
21134
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21134
21135
|
const meta = React80__namespace.default.useMemo(
|
|
@@ -21311,17 +21312,29 @@ function useDataDnd(args) {
|
|
|
21311
21312
|
});
|
|
21312
21313
|
const ctx = React80__namespace.default.useContext(RootCtx);
|
|
21313
21314
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
21314
|
-
const
|
|
21315
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
21316
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
21317
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
21318
|
+
dndLog.debug("dropzone:render", {
|
|
21319
|
+
group: ownGroup,
|
|
21320
|
+
isOver,
|
|
21321
|
+
isThisZoneOver,
|
|
21322
|
+
overZoneGroup: overZoneGroup2,
|
|
21323
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
21324
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
21325
|
+
showForeignPlaceholder,
|
|
21326
|
+
ctxAvailable: ctx != null
|
|
21327
|
+
});
|
|
21315
21328
|
React80__namespace.default.useEffect(() => {
|
|
21316
|
-
dndLog.
|
|
21317
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
21329
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
21330
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
21318
21331
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21319
21332
|
Box,
|
|
21320
21333
|
{
|
|
21321
21334
|
ref: setNodeRef,
|
|
21322
21335
|
"data-dnd-zone": ownGroup,
|
|
21323
|
-
"data-dnd-is-over":
|
|
21324
|
-
className:
|
|
21336
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
21337
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
21325
21338
|
children: [
|
|
21326
21339
|
children,
|
|
21327
21340
|
showForeignPlaceholder ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21337,8 +21350,8 @@ function useDataDnd(args) {
|
|
|
21337
21350
|
);
|
|
21338
21351
|
};
|
|
21339
21352
|
const rootContextValue = React80__namespace.default.useMemo(
|
|
21340
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
21341
|
-
[registerZone, unregisterZone, activeDrag]
|
|
21353
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
21354
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
21342
21355
|
);
|
|
21343
21356
|
const handleDragStart = React80__namespace.default.useCallback((event) => {
|
|
21344
21357
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -21346,24 +21359,32 @@ function useDataDnd(args) {
|
|
|
21346
21359
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
21347
21360
|
if (sourceZone) {
|
|
21348
21361
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
21362
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
21363
|
+
} else {
|
|
21364
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
21349
21365
|
}
|
|
21350
21366
|
dndLog.info("dragStart", {
|
|
21351
21367
|
activeId: event.active.id,
|
|
21352
21368
|
activeData: event.active.data?.current,
|
|
21353
21369
|
sourceGroup: sourceZone?.group,
|
|
21354
21370
|
height,
|
|
21355
|
-
zoneCount: zonesRef.current.size
|
|
21371
|
+
zoneCount: zonesRef.current.size,
|
|
21372
|
+
isRoot
|
|
21356
21373
|
});
|
|
21357
|
-
}, [findZoneByItem]);
|
|
21374
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
21358
21375
|
const handleDragOver = React80__namespace.default.useCallback((event) => {
|
|
21376
|
+
const overData = event.over?.data?.current;
|
|
21377
|
+
const group = overData?.dndGroup ?? null;
|
|
21378
|
+
setOverZoneGroup(group);
|
|
21359
21379
|
dndLog.debug("dragOver", {
|
|
21360
21380
|
activeId: event.active.id,
|
|
21361
21381
|
overId: event.over?.id,
|
|
21362
|
-
|
|
21382
|
+
overGroup: group
|
|
21363
21383
|
});
|
|
21364
21384
|
}, []);
|
|
21365
21385
|
const handleDragCancel = React80__namespace.default.useCallback((event) => {
|
|
21366
21386
|
setActiveDrag(null);
|
|
21387
|
+
setOverZoneGroup(null);
|
|
21367
21388
|
dndLog.warn("dragCancel", {
|
|
21368
21389
|
activeId: event.active.id,
|
|
21369
21390
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -21372,6 +21393,7 @@ function useDataDnd(args) {
|
|
|
21372
21393
|
const handleDragEndWithCleanup = React80__namespace.default.useCallback((event) => {
|
|
21373
21394
|
handleDragEnd(event);
|
|
21374
21395
|
setActiveDrag(null);
|
|
21396
|
+
setOverZoneGroup(null);
|
|
21375
21397
|
}, [handleDragEnd]);
|
|
21376
21398
|
const wrapContainer = React80__namespace.default.useCallback(
|
|
21377
21399
|
(children) => {
|
package/dist/runtime/index.js
CHANGED
|
@@ -21083,6 +21083,7 @@ function useDataDnd(args) {
|
|
|
21083
21083
|
zonesRef.current.delete(zoneId2);
|
|
21084
21084
|
}, []);
|
|
21085
21085
|
const [activeDrag, setActiveDrag] = React80__default.useState(null);
|
|
21086
|
+
const [overZoneGroup, setOverZoneGroup] = React80__default.useState(null);
|
|
21086
21087
|
const zoneId = React80__default.useId();
|
|
21087
21088
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
21088
21089
|
const meta = React80__default.useMemo(
|
|
@@ -21265,17 +21266,29 @@ function useDataDnd(args) {
|
|
|
21265
21266
|
});
|
|
21266
21267
|
const ctx = React80__default.useContext(RootCtx);
|
|
21267
21268
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
21268
|
-
const
|
|
21269
|
+
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
21270
|
+
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
21271
|
+
const showForeignPlaceholder = isThisZoneOver && activeDrag2 != null && activeDrag2.sourceGroup !== ownGroup;
|
|
21272
|
+
dndLog.debug("dropzone:render", {
|
|
21273
|
+
group: ownGroup,
|
|
21274
|
+
isOver,
|
|
21275
|
+
isThisZoneOver,
|
|
21276
|
+
overZoneGroup: overZoneGroup2,
|
|
21277
|
+
activeDragSourceGroup: activeDrag2?.sourceGroup ?? null,
|
|
21278
|
+
activeDragHeight: activeDrag2?.height ?? null,
|
|
21279
|
+
showForeignPlaceholder,
|
|
21280
|
+
ctxAvailable: ctx != null
|
|
21281
|
+
});
|
|
21269
21282
|
React80__default.useEffect(() => {
|
|
21270
|
-
dndLog.
|
|
21271
|
-
}, [droppableId, isOver, showForeignPlaceholder]);
|
|
21283
|
+
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
21284
|
+
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
21272
21285
|
return /* @__PURE__ */ jsxs(
|
|
21273
21286
|
Box,
|
|
21274
21287
|
{
|
|
21275
21288
|
ref: setNodeRef,
|
|
21276
21289
|
"data-dnd-zone": ownGroup,
|
|
21277
|
-
"data-dnd-is-over":
|
|
21278
|
-
className:
|
|
21290
|
+
"data-dnd-is-over": isThisZoneOver ? "true" : "false",
|
|
21291
|
+
className: isThisZoneOver ? "ring-2 ring-primary ring-offset-2 rounded-lg transition-all min-h-[3rem]" : "min-h-[3rem] rounded-lg transition-all",
|
|
21279
21292
|
children: [
|
|
21280
21293
|
children,
|
|
21281
21294
|
showForeignPlaceholder ? /* @__PURE__ */ jsx(
|
|
@@ -21291,8 +21304,8 @@ function useDataDnd(args) {
|
|
|
21291
21304
|
);
|
|
21292
21305
|
};
|
|
21293
21306
|
const rootContextValue = React80__default.useMemo(
|
|
21294
|
-
() => ({ registerZone, unregisterZone, activeDrag }),
|
|
21295
|
-
[registerZone, unregisterZone, activeDrag]
|
|
21307
|
+
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup }),
|
|
21308
|
+
[registerZone, unregisterZone, activeDrag, overZoneGroup]
|
|
21296
21309
|
);
|
|
21297
21310
|
const handleDragStart = React80__default.useCallback((event) => {
|
|
21298
21311
|
const sourceZone = findZoneByItem(event.active.id);
|
|
@@ -21300,24 +21313,32 @@ function useDataDnd(args) {
|
|
|
21300
21313
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
21301
21314
|
if (sourceZone) {
|
|
21302
21315
|
setActiveDrag({ sourceGroup: sourceZone.group, height });
|
|
21316
|
+
dndLog.info("dragStart:activeDrag:set", { sourceGroup: sourceZone.group, height, isRoot, hookZoneId: zoneId });
|
|
21317
|
+
} else {
|
|
21318
|
+
dndLog.warn("dragStart:no-source-zone", { activeId: event.active.id, zoneCount: zonesRef.current.size, isRoot });
|
|
21303
21319
|
}
|
|
21304
21320
|
dndLog.info("dragStart", {
|
|
21305
21321
|
activeId: event.active.id,
|
|
21306
21322
|
activeData: event.active.data?.current,
|
|
21307
21323
|
sourceGroup: sourceZone?.group,
|
|
21308
21324
|
height,
|
|
21309
|
-
zoneCount: zonesRef.current.size
|
|
21325
|
+
zoneCount: zonesRef.current.size,
|
|
21326
|
+
isRoot
|
|
21310
21327
|
});
|
|
21311
|
-
}, [findZoneByItem]);
|
|
21328
|
+
}, [findZoneByItem, isRoot, zoneId]);
|
|
21312
21329
|
const handleDragOver = React80__default.useCallback((event) => {
|
|
21330
|
+
const overData = event.over?.data?.current;
|
|
21331
|
+
const group = overData?.dndGroup ?? null;
|
|
21332
|
+
setOverZoneGroup(group);
|
|
21313
21333
|
dndLog.debug("dragOver", {
|
|
21314
21334
|
activeId: event.active.id,
|
|
21315
21335
|
overId: event.over?.id,
|
|
21316
|
-
|
|
21336
|
+
overGroup: group
|
|
21317
21337
|
});
|
|
21318
21338
|
}, []);
|
|
21319
21339
|
const handleDragCancel = React80__default.useCallback((event) => {
|
|
21320
21340
|
setActiveDrag(null);
|
|
21341
|
+
setOverZoneGroup(null);
|
|
21321
21342
|
dndLog.warn("dragCancel", {
|
|
21322
21343
|
activeId: event.active.id,
|
|
21323
21344
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
@@ -21326,6 +21347,7 @@ function useDataDnd(args) {
|
|
|
21326
21347
|
const handleDragEndWithCleanup = React80__default.useCallback((event) => {
|
|
21327
21348
|
handleDragEnd(event);
|
|
21328
21349
|
setActiveDrag(null);
|
|
21350
|
+
setOverZoneGroup(null);
|
|
21329
21351
|
}, [handleDragEnd]);
|
|
21330
21352
|
const wrapContainer = React80__default.useCallback(
|
|
21331
21353
|
(children) => {
|