@aiquants/drag-drop-panels 0.8.0 → 0.8.1
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/README.md +81 -81
- package/dist/DragDropLayout.d.ts.map +1 -1
- package/dist/index.es.js +174 -165
- package/dist/index.umd.js +1 -1
- package/dist/styles/drag-drop-panels.standalone.css +1 -1
- package/package.json +1 -1
- package/src/DragDropLayout.spec.tsx +64 -0
- package/src/DragDropLayout.tsx +10 -1
package/dist/index.es.js
CHANGED
|
@@ -25,7 +25,7 @@ function dt() {
|
|
|
25
25
|
}
|
|
26
26
|
var xe = {};
|
|
27
27
|
var We;
|
|
28
|
-
function
|
|
28
|
+
function mt() {
|
|
29
29
|
return We || (We = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function r(s) {
|
|
31
31
|
if (s == null) return null;
|
|
@@ -127,7 +127,7 @@ function ht() {
|
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function m() {
|
|
131
131
|
var s = r(this.type);
|
|
132
132
|
return N[s] || (N[s] = !0, console.error(
|
|
133
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
@@ -143,7 +143,7 @@ function ht() {
|
|
|
143
143
|
_owner: X
|
|
144
144
|
}, (B !== void 0 ? B : null) !== null ? Object.defineProperty(s, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: m
|
|
147
147
|
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -220,7 +220,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
function M(s) {
|
|
221
221
|
return typeof s == "object" && s !== null && s.$$typeof === a;
|
|
222
222
|
}
|
|
223
|
-
var y = Fe, a = /* @__PURE__ */ Symbol.for("react.transitional.element"), j = /* @__PURE__ */ Symbol.for("react.portal"), D = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), L = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Y = /* @__PURE__ */ Symbol.for("react.forward_ref"), U = /* @__PURE__ */ Symbol.for("react.suspense"), O = /* @__PURE__ */ Symbol.for("react.suspense_list"), _ = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), g = /* @__PURE__ */ Symbol.for("react.activity"), C = /* @__PURE__ */ Symbol.for("react.client.reference"), W = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, p = Array.isArray,
|
|
223
|
+
var y = Fe, a = /* @__PURE__ */ Symbol.for("react.transitional.element"), j = /* @__PURE__ */ Symbol.for("react.portal"), D = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), L = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Y = /* @__PURE__ */ Symbol.for("react.forward_ref"), U = /* @__PURE__ */ Symbol.for("react.suspense"), O = /* @__PURE__ */ Symbol.for("react.suspense_list"), _ = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), g = /* @__PURE__ */ Symbol.for("react.activity"), C = /* @__PURE__ */ Symbol.for("react.client.reference"), W = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, p = Array.isArray, h = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
y = {
|
|
@@ -231,7 +231,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
var b, N = {}, T = y.react_stack_bottom_frame.bind(
|
|
232
232
|
y,
|
|
233
233
|
i
|
|
234
|
-
)(), A =
|
|
234
|
+
)(), A = h(l(i)), H = {};
|
|
235
235
|
xe.Fragment = D, xe.jsx = function(s, d, k) {
|
|
236
236
|
var X = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
237
237
|
return v(
|
|
@@ -240,7 +240,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
240
240
|
k,
|
|
241
241
|
!1,
|
|
242
242
|
X ? Error("react-stack-top-frame") : T,
|
|
243
|
-
X ?
|
|
243
|
+
X ? h(l(s)) : A
|
|
244
244
|
);
|
|
245
245
|
}, xe.jsxs = function(s, d, k) {
|
|
246
246
|
var X = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
@@ -250,16 +250,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
250
250
|
k,
|
|
251
251
|
!0,
|
|
252
252
|
X ? Error("react-stack-top-frame") : T,
|
|
253
|
-
X ?
|
|
253
|
+
X ? h(l(s)) : A
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
256
|
})()), xe;
|
|
257
257
|
}
|
|
258
258
|
var ze;
|
|
259
|
-
function
|
|
260
|
-
return ze || (ze = 1, process.env.NODE_ENV === "production" ? ye.exports = dt() : ye.exports =
|
|
259
|
+
function ht() {
|
|
260
|
+
return ze || (ze = 1, process.env.NODE_ENV === "production" ? ye.exports = dt() : ye.exports = mt()), ye.exports;
|
|
261
261
|
}
|
|
262
|
-
var e =
|
|
262
|
+
var e = ht();
|
|
263
263
|
const le = class le {
|
|
264
264
|
/**
|
|
265
265
|
* @constructor
|
|
@@ -392,8 +392,8 @@ const ft = ({ config: r, panelId: t, sizeInfo: n, onSizeInfoClick: l }) => r.sho
|
|
|
392
392
|
)
|
|
393
393
|
) : null, E = (r, t, ...n) => {
|
|
394
394
|
(r.logLevel ?? 0) >= t && ke.info(...n);
|
|
395
|
-
}, qe = Fe.memo(({ index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag:
|
|
396
|
-
const S = o && o.columnIndex === t && (o.panelIndex === r || o.panelIndex + 1 === r), v = !S && l?.columnIndex === t && l?.insertIndex === r, $ = F(null), [M, y] = te(null), a = n || (
|
|
395
|
+
}, qe = Fe.memo(({ index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: m }) => {
|
|
396
|
+
const S = o && o.columnIndex === t && (o.panelIndex === r || o.panelIndex + 1 === r), v = !S && l?.columnIndex === t && l?.insertIndex === r, $ = F(null), [M, y] = te(null), a = n || (m?.isActive ?? !1);
|
|
397
397
|
return K(() => {
|
|
398
398
|
if ($.current) {
|
|
399
399
|
const j = $.current.getBoundingClientRect(), D = {
|
|
@@ -458,11 +458,11 @@ const Ie = ({ columnIndex: r, isDragging: t, dragOverPosition: n, children: l, c
|
|
|
458
458
|
const i = F(null), [u, c] = te(null);
|
|
459
459
|
return K(() => {
|
|
460
460
|
if (i.current && t) {
|
|
461
|
-
const
|
|
462
|
-
width: Math.round(
|
|
463
|
-
height: Math.round(
|
|
464
|
-
x: Math.round(
|
|
465
|
-
y: Math.round(
|
|
461
|
+
const m = i.current.getBoundingClientRect(), S = n?.columnIndex === r, v = {
|
|
462
|
+
width: Math.round(m.width),
|
|
463
|
+
height: Math.round(m.height),
|
|
464
|
+
x: Math.round(m.left),
|
|
465
|
+
y: Math.round(m.top),
|
|
466
466
|
isActive: S
|
|
467
467
|
};
|
|
468
468
|
c(v), S && E(o, 1, `🎯 アクティブドロップゾーン ${r}:`, {
|
|
@@ -524,10 +524,10 @@ const xt = 0.25, gt = typeof window < "u" ? Ee : K, pt = (r, t = xt) => {
|
|
|
524
524
|
return;
|
|
525
525
|
}
|
|
526
526
|
const u = () => {
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
527
|
+
const m = i.clientWidth;
|
|
528
|
+
if (m <= 0)
|
|
529
529
|
return;
|
|
530
|
-
const S =
|
|
530
|
+
const S = m >= r ? 1 : Math.max(m / r, t);
|
|
531
531
|
o((v) => Math.abs(v - S) < 5e-3 ? v : S);
|
|
532
532
|
};
|
|
533
533
|
u();
|
|
@@ -535,21 +535,21 @@ const xt = 0.25, gt = typeof window < "u" ? Ee : K, pt = (r, t = xt) => {
|
|
|
535
535
|
return c.observe(i), () => c.disconnect();
|
|
536
536
|
}, [r, t]), { containerRef: n, scale: l };
|
|
537
537
|
}, Ue = ({ columnId: r, onResizeStart: t, onResize: n, onResizeEnd: l, isResizing: o = !1, position: i = "right", className: u = "", debug: c = {} }) => {
|
|
538
|
-
const
|
|
538
|
+
const m = F(!1), S = F(null);
|
|
539
539
|
K(() => {
|
|
540
|
-
!o &&
|
|
540
|
+
!o && m.current && (E(c, 1, "外部からのリサイズ解除を検出、ドラッグ状態を強制解除:", r), m.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
541
541
|
}, [o, r, c]);
|
|
542
542
|
const v = w(
|
|
543
543
|
(y) => {
|
|
544
|
-
y.preventDefault(), y.stopPropagation(), E(c, 2, "リサイズハンドル マウスダウン:", r),
|
|
544
|
+
y.preventDefault(), y.stopPropagation(), E(c, 2, "リサイズハンドル マウスダウン:", r), m.current = !0, t(r, y.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
|
|
545
545
|
},
|
|
546
546
|
[r, t, c]
|
|
547
547
|
);
|
|
548
548
|
K(() => {
|
|
549
549
|
const y = (j) => {
|
|
550
|
-
|
|
550
|
+
m.current && (j.preventDefault(), n(j.clientX));
|
|
551
551
|
}, a = () => {
|
|
552
|
-
|
|
552
|
+
m.current && (E(c, 2, "リサイズハンドル マウスアップ:", r), m.current = !1, l(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
553
553
|
};
|
|
554
554
|
return document.addEventListener("mousemove", y), document.addEventListener("mouseup", a), () => {
|
|
555
555
|
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", a);
|
|
@@ -559,24 +559,24 @@ const xt = 0.25, gt = typeof window < "u" ? Ee : K, pt = (r, t = xt) => {
|
|
|
559
559
|
(y) => {
|
|
560
560
|
y.preventDefault(), y.stopPropagation();
|
|
561
561
|
const a = y.touches[0];
|
|
562
|
-
E(c, 2, "リサイズハンドル タッチスタート:", r),
|
|
562
|
+
E(c, 2, "リサイズハンドル タッチスタート:", r), m.current = !0, t(r, a.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
|
|
563
563
|
},
|
|
564
564
|
[r, t, c]
|
|
565
565
|
);
|
|
566
566
|
K(() => {
|
|
567
567
|
const y = (j) => {
|
|
568
|
-
if (!
|
|
568
|
+
if (!m.current) return;
|
|
569
569
|
j.preventDefault();
|
|
570
570
|
const D = j.touches[0];
|
|
571
571
|
n(D.clientX);
|
|
572
572
|
}, a = () => {
|
|
573
|
-
|
|
573
|
+
m.current && (E(c, 2, "リサイズハンドル タッチエンド:", r), m.current = !1, l(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
574
574
|
};
|
|
575
575
|
return document.addEventListener("touchmove", y, { passive: !1 }), document.addEventListener("touchend", a), () => {
|
|
576
576
|
document.removeEventListener("touchmove", y), document.removeEventListener("touchend", a);
|
|
577
577
|
};
|
|
578
578
|
}, [r, n, l, c]), K(() => () => {
|
|
579
|
-
|
|
579
|
+
m.current && (E(c, 1, "リサイズハンドルアンマウント時のクリーンアップ:", r), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
580
580
|
}, [r, c]);
|
|
581
581
|
const M = ["resize-handle", i, o ? "resizing" : "", u].filter(Boolean).join(" ");
|
|
582
582
|
return (
|
|
@@ -591,14 +591,14 @@ const xt = 0.25, gt = typeof window < "u" ? Ee : K, pt = (r, t = xt) => {
|
|
|
591
591
|
] })
|
|
592
592
|
] })
|
|
593
593
|
);
|
|
594
|
-
}, kt = ({ columnId: r, width: t, minWidth: n = 100, maxWidth: l = 800, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c = !1, resizable:
|
|
594
|
+
}, kt = ({ columnId: r, width: t, minWidth: n = 100, maxWidth: l = 800, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c = !1, resizable: m = !0, className: S = "", debug: v = {}, children: $ }) => {
|
|
595
595
|
const M = ["resizable-column", c ? "resizing" : "", S].filter(Boolean).join(" ");
|
|
596
596
|
return K(() => {
|
|
597
597
|
const y = document.querySelector(`[data-column-id="${r}"]`);
|
|
598
598
|
y && (y.style.setProperty("--column-width", `${t}px`), y.style.setProperty("--column-min-width", `${n}px`), y.style.setProperty("--column-max-width", `${l}px`));
|
|
599
599
|
}, [r, t, n, l]), /* @__PURE__ */ e.jsxs("div", { className: M, "data-column-id": r, "data-width": t, "data-min-width": n, "data-max-width": l, children: [
|
|
600
600
|
$,
|
|
601
|
-
|
|
601
|
+
m && /* @__PURE__ */ e.jsx(Ue, { columnId: r, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c, position: "right", debug: v }),
|
|
602
602
|
v.showPanelSizes && /* @__PURE__ */ e.jsxs("div", { className: "column-debug-size", children: [
|
|
603
603
|
t,
|
|
604
604
|
"px",
|
|
@@ -615,8 +615,8 @@ const xt = 0.25, gt = typeof window < "u" ? Ee : K, pt = (r, t = xt) => {
|
|
|
615
615
|
onDragEnter: i,
|
|
616
616
|
onDragLeave: u,
|
|
617
617
|
debugConfig: c,
|
|
618
|
-
customDrag:
|
|
619
|
-
}) => /* @__PURE__ */ e.jsx(qe, { index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag:
|
|
618
|
+
customDrag: m
|
|
619
|
+
}) => /* @__PURE__ */ e.jsx(qe, { index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: m })
|
|
620
620
|
);
|
|
621
621
|
Ce.displayName = "LocalInsertPlaceholder";
|
|
622
622
|
const Ct = ({
|
|
@@ -629,7 +629,7 @@ const Ct = ({
|
|
|
629
629
|
dragState: i,
|
|
630
630
|
dragOverPosition: u,
|
|
631
631
|
originalPanelPosition: c,
|
|
632
|
-
dragModes:
|
|
632
|
+
dragModes: m,
|
|
633
633
|
onDragStart: S,
|
|
634
634
|
onDragEnd: v,
|
|
635
635
|
onPlaceholderDragEnter: $,
|
|
@@ -653,7 +653,7 @@ const Ct = ({
|
|
|
653
653
|
onResizeEnd: W,
|
|
654
654
|
isResizing: x = !1,
|
|
655
655
|
resizingColumn: p,
|
|
656
|
-
onPanelSizeInfoClick:
|
|
656
|
+
onPanelSizeInfoClick: h,
|
|
657
657
|
onToggleDragMode: b,
|
|
658
658
|
onPanelClose: N,
|
|
659
659
|
onPanelMaximizeChange: T,
|
|
@@ -681,12 +681,12 @@ const Ct = ({
|
|
|
681
681
|
} : void 0, de = F({}), De = F(/* @__PURE__ */ new Map());
|
|
682
682
|
K(() => {
|
|
683
683
|
E(Q.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
|
|
684
|
-
dragModes:
|
|
684
|
+
dragModes: m,
|
|
685
685
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
686
|
-
keys: Object.keys(
|
|
687
|
-
values: Object.values(
|
|
686
|
+
keys: Object.keys(m),
|
|
687
|
+
values: Object.values(m)
|
|
688
688
|
});
|
|
689
|
-
}, [
|
|
689
|
+
}, [m]);
|
|
690
690
|
const Ne = Xe(() => {
|
|
691
691
|
const P = {};
|
|
692
692
|
return t.forEach((V) => {
|
|
@@ -713,23 +713,23 @@ const Ct = ({
|
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
const V = De.current, ee = 300,
|
|
716
|
+
const V = De.current, ee = 300, me = /* @__PURE__ */ new Set();
|
|
717
717
|
Object.values(n).forEach((q) => {
|
|
718
718
|
q.forEach((ne) => {
|
|
719
|
-
|
|
719
|
+
me.add(ne);
|
|
720
720
|
});
|
|
721
721
|
}), new Set(V.keys()).forEach((q) => {
|
|
722
|
-
|
|
722
|
+
me.has(q) || (E(Q.current, 1, "パネル削除検出 - クリーンアップ:", q), V.delete(q), de.current[q] && delete de.current[q]);
|
|
723
723
|
}), P.forEach((q, ne) => {
|
|
724
724
|
const ue = V.get(ne);
|
|
725
725
|
if (ue) {
|
|
726
|
-
const J = ue.rect.left - q.rect.left,
|
|
727
|
-
if (J !== 0 ||
|
|
728
|
-
E(Q.current, 2, "パネル移動検出 - アニメーション開始:", ne, { dx: J, dy:
|
|
726
|
+
const J = ue.rect.left - q.rect.left, he = ue.rect.top - q.rect.top;
|
|
727
|
+
if (J !== 0 || he !== 0) {
|
|
728
|
+
E(Q.current, 2, "パネル移動検出 - アニメーション開始:", ne, { dx: J, dy: he });
|
|
729
729
|
const oe = de.current[ne];
|
|
730
730
|
if (oe) {
|
|
731
731
|
const pe = ge.current || 1;
|
|
732
|
-
oe.style.transform = `translate(${J / pe}px, ${
|
|
732
|
+
oe.style.transform = `translate(${J / pe}px, ${he / pe}px)`, oe.style.transition = "none", oe.classList.add("is-moving"), requestAnimationFrame(() => {
|
|
733
733
|
oe.style.transition = `transform ${ee}ms cubic-bezier(0.2, 0, 0.2, 1)`, oe.style.transform = "translate(0, 0)", setTimeout(() => {
|
|
734
734
|
oe.style.transition = "", oe.style.transform = "", oe.classList.remove("is-moving");
|
|
735
735
|
}, ee);
|
|
@@ -758,7 +758,7 @@ const Ct = ({
|
|
|
758
758
|
const V = Ne[P];
|
|
759
759
|
if (!V)
|
|
760
760
|
return E(Q.current, 1, `Panel config not found for panelId: ${P}`), null;
|
|
761
|
-
const ee = V.component,
|
|
761
|
+
const ee = V.component, me = V.title, ce = i.draggedPanel === P, q = m[P] || "normal";
|
|
762
762
|
E(Q.current, 2, `🎨 renderPanel - ${P}:`, {
|
|
763
763
|
panelId: P,
|
|
764
764
|
dragMode: q,
|
|
@@ -776,7 +776,16 @@ const Ct = ({
|
|
|
776
776
|
maxHeight: Re.maxHeight
|
|
777
777
|
});
|
|
778
778
|
});
|
|
779
|
-
}, ue = U[P], J = s === P,
|
|
779
|
+
}, ue = U[P], J = s === P, he = !!T, oe = () => T?.(J ? null : P), pe = J ? {
|
|
780
|
+
position: "fixed",
|
|
781
|
+
top: "var(--aqdd-maximize-top, 0px)",
|
|
782
|
+
right: "var(--aqdd-maximize-right, 0px)",
|
|
783
|
+
bottom: "var(--aqdd-maximize-bottom, 0px)",
|
|
784
|
+
left: "var(--aqdd-maximize-left, 0px)",
|
|
785
|
+
zIndex: 50,
|
|
786
|
+
minHeight: 0,
|
|
787
|
+
maxHeight: "none"
|
|
788
|
+
} : {
|
|
780
789
|
minHeight: V.minHeight ?? "200px",
|
|
781
790
|
maxHeight: V.maxHeight ?? "500px"
|
|
782
791
|
}, be = H === "header", Oe = q === "normal" && !be && !J, Te = q === "normal" && be && !J, Ae = ce ? "cursor-grabbing" : "cursor-grab", Me = `panel-draggable group relative flex flex-col overflow-hidden border border-slate-200 text-left shadow-lg backdrop-blur-lg ${q === "custom" ? "select-none" : ""}`, Qe = J ? (
|
|
@@ -810,12 +819,12 @@ const Ct = ({
|
|
|
810
819
|
className: `group relative mb-3 flex items-center justify-between ${be && !J ? Ae : ""}`,
|
|
811
820
|
draggable: Te,
|
|
812
821
|
onDragStart: (I) => Te && S(I, P),
|
|
813
|
-
onDoubleClick:
|
|
822
|
+
onDoubleClick: he ? (I) => {
|
|
814
823
|
I.stopPropagation(), oe();
|
|
815
824
|
} : void 0,
|
|
816
825
|
children: [
|
|
817
826
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
818
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-lg text-slate-700 transition-colors group-hover:text-slate-900", children:
|
|
827
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-lg text-slate-700 transition-colors group-hover:text-slate-900", children: me }),
|
|
819
828
|
q === "custom" && /* @__PURE__ */ e.jsx("span", { className: "rounded-md bg-orange-100 px-2 py-1 font-medium text-orange-600 text-xs", children: "Custom" })
|
|
820
829
|
] }),
|
|
821
830
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
@@ -850,7 +859,7 @@ const Ct = ({
|
|
|
850
859
|
children: /* @__PURE__ */ e.jsx(Le, { className: "h-4 w-4" })
|
|
851
860
|
}
|
|
852
861
|
),
|
|
853
|
-
|
|
862
|
+
he && /* @__PURE__ */ e.jsx(
|
|
854
863
|
"button",
|
|
855
864
|
{
|
|
856
865
|
type: "button",
|
|
@@ -879,7 +888,7 @@ const Ct = ({
|
|
|
879
888
|
}
|
|
880
889
|
),
|
|
881
890
|
/* @__PURE__ */ e.jsx("div", { "data-aqdd-scroll-area": !0, className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ e.jsx(ee, { ...V.props || {} }) }),
|
|
882
|
-
/* @__PURE__ */ e.jsx(ft, { config: Y, panelId: P, sizeInfo: ue, onSizeInfoClick: (I) =>
|
|
891
|
+
/* @__PURE__ */ e.jsx(ft, { config: Y, panelId: P, sizeInfo: ue, onSizeInfoClick: (I) => h?.(I, P) })
|
|
883
892
|
]
|
|
884
893
|
},
|
|
885
894
|
P
|
|
@@ -887,10 +896,10 @@ const Ct = ({
|
|
|
887
896
|
);
|
|
888
897
|
}, Je = (P, V) => {
|
|
889
898
|
const ee = n[P] || [];
|
|
890
|
-
let
|
|
899
|
+
let me = !1;
|
|
891
900
|
for (const q of ee)
|
|
892
901
|
if (l[q]) {
|
|
893
|
-
|
|
902
|
+
me = !0;
|
|
894
903
|
break;
|
|
895
904
|
}
|
|
896
905
|
const ce = i.isDragging || (A?.isActive ?? !1);
|
|
@@ -952,7 +961,7 @@ const Ct = ({
|
|
|
952
961
|
)
|
|
953
962
|
] }, `panel-${q}`);
|
|
954
963
|
}),
|
|
955
|
-
!(
|
|
964
|
+
!(me || ce) && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 rounded-xl border-2 border-slate-200 border-dashed bg-white/30 p-8 text-center text-slate-400 transition-all duration-200", children: /* @__PURE__ */ e.jsx("div", { className: "text-sm", children: "このエリアは空です" }) })
|
|
956
965
|
]
|
|
957
966
|
}
|
|
958
967
|
) });
|
|
@@ -981,7 +990,7 @@ const Ct = ({
|
|
|
981
990
|
})
|
|
982
991
|
] }) }),
|
|
983
992
|
/* @__PURE__ */ e.jsx("div", { ref: B, className: "relative min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "h-full w-full", style: Ze, children: /* @__PURE__ */ e.jsx("main", { "data-aqdd-scroll-root": !0, className: "no-scrollbar h-full max-w-full flex-1 overflow-auto px-4 py-6 sm:px-6", children: /* @__PURE__ */ e.jsx("div", { className: "relative flex h-full items-start gap-6 pr-4", children: r.map((P, V) => {
|
|
984
|
-
const ee = f?.[P.id] || P.initialWidth || 350,
|
|
993
|
+
const ee = f?.[P.id] || P.initialWidth || 350, me = _ && (P.resizable ?? !0);
|
|
985
994
|
return /* @__PURE__ */ e.jsx(et, { children: /* @__PURE__ */ e.jsxs(
|
|
986
995
|
"div",
|
|
987
996
|
{
|
|
@@ -996,13 +1005,13 @@ const Ct = ({
|
|
|
996
1005
|
},
|
|
997
1006
|
children: [
|
|
998
1007
|
Je(P.key, V),
|
|
999
|
-
|
|
1008
|
+
me && g && C && W && /* @__PURE__ */ e.jsx(Ue, { columnId: P.id, onResizeStart: g, onResize: C, onResizeEnd: W, isResizing: x && p === P.id, position: "right", debug: Y })
|
|
1000
1009
|
]
|
|
1001
1010
|
}
|
|
1002
1011
|
) }, P.id);
|
|
1003
1012
|
}) }) }) }) })
|
|
1004
1013
|
] });
|
|
1005
|
-
}, $t = ({ columnCount: r, onColumnCountChange: t, onAutoBalance: n, onResetWidths: l, minColumns: o = 2, maxColumns: i = 6, isResizing: u = !1, isResponsiveMode: c = !1, responsiveColumnCount:
|
|
1014
|
+
}, $t = ({ columnCount: r, onColumnCountChange: t, onAutoBalance: n, onResetWidths: l, minColumns: o = 2, maxColumns: i = 6, isResizing: u = !1, isResponsiveMode: c = !1, responsiveColumnCount: m }) => {
|
|
1006
1015
|
const S = r > o && !c, v = r < i && !c;
|
|
1007
1016
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-slate-200 bg-white/80 px-4 py-2 shadow-sm backdrop-blur-lg", children: [
|
|
1008
1017
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1019,7 +1028,7 @@ const Ct = ({
|
|
|
1019
1028
|
}
|
|
1020
1029
|
),
|
|
1021
1030
|
/* @__PURE__ */ e.jsxs("div", { className: `min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${c ? "border-blue-300 bg-blue-50 text-blue-700" : "border-slate-300 bg-slate-100 text-slate-700"}`, children: [
|
|
1022
|
-
c ?
|
|
1031
|
+
c ? m ?? r : r,
|
|
1023
1032
|
c && /* @__PURE__ */ e.jsx("span", { className: "ml-1 text-xs", children: "自動" })
|
|
1024
1033
|
] }),
|
|
1025
1034
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1071,7 +1080,7 @@ const Ct = ({
|
|
|
1071
1080
|
] })
|
|
1072
1081
|
] });
|
|
1073
1082
|
}, Ot = ({ columnCount: r, onInsertColumn: t, onDeleteColumn: n, minColumns: l = 1, maxColumns: o = 6, isResizing: i = !1, disabled: u = !1 }) => {
|
|
1074
|
-
const c = r < o && !u,
|
|
1083
|
+
const c = r < o && !u, m = r > l && !u;
|
|
1075
1084
|
return /* @__PURE__ */ e.jsxs("div", { className: `flex items-center justify-center gap-1 rounded-lg border border-slate-200 px-4 py-2 shadow-sm backdrop-blur-lg ${u ? "bg-slate-100/80 opacity-60" : "bg-white/80"}`, children: [
|
|
1076
1085
|
u && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ e.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
|
|
1077
1086
|
!u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -1089,7 +1098,7 @@ const Ct = ({
|
|
|
1089
1098
|
Array.from({ length: r }, (S, v) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1090
1099
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
|
|
1091
1100
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: v + 1 }),
|
|
1092
|
-
|
|
1101
|
+
m && !i && /* @__PURE__ */ e.jsx(
|
|
1093
1102
|
"button",
|
|
1094
1103
|
{
|
|
1095
1104
|
type: "button",
|
|
@@ -1294,7 +1303,7 @@ const Ct = ({
|
|
|
1294
1303
|
return i.forEach((u) => {
|
|
1295
1304
|
o[u] = [];
|
|
1296
1305
|
}), l.forEach((u, c) => {
|
|
1297
|
-
const
|
|
1306
|
+
const m = c % t, S = i[m];
|
|
1298
1307
|
o[S].push(u);
|
|
1299
1308
|
}), o;
|
|
1300
1309
|
}, Lt = ({ initialColumns: r, initialPanels: t, debug: n = {}, onLayoutChange: l }) => {
|
|
@@ -1314,7 +1323,7 @@ const Ct = ({
|
|
|
1314
1323
|
K(() => {
|
|
1315
1324
|
l?.(o);
|
|
1316
1325
|
}, [o, l]);
|
|
1317
|
-
const
|
|
1326
|
+
const m = w(
|
|
1318
1327
|
(f, g) => {
|
|
1319
1328
|
E(n, 1, "カラム追加:", f.id, "at position:", g), i((C) => {
|
|
1320
1329
|
const W = [...C.columns], x = g ?? W.length;
|
|
@@ -1322,7 +1331,7 @@ const Ct = ({
|
|
|
1322
1331
|
const p = {
|
|
1323
1332
|
...C.columnWidths,
|
|
1324
1333
|
[f.id]: f.initialWidth || 400
|
|
1325
|
-
},
|
|
1334
|
+
}, h = {
|
|
1326
1335
|
...C.columnPanels,
|
|
1327
1336
|
[f.id]: []
|
|
1328
1337
|
};
|
|
@@ -1330,7 +1339,7 @@ const Ct = ({
|
|
|
1330
1339
|
...C,
|
|
1331
1340
|
columns: W,
|
|
1332
1341
|
columnWidths: p,
|
|
1333
|
-
columnPanels:
|
|
1342
|
+
columnPanels: h
|
|
1334
1343
|
};
|
|
1335
1344
|
});
|
|
1336
1345
|
},
|
|
@@ -1343,11 +1352,11 @@ const Ct = ({
|
|
|
1343
1352
|
return E(n, 1, "警告: 最後のカラムを削除しようとしています"), g;
|
|
1344
1353
|
const x = W[0].id, p = { ...g.columnPanels };
|
|
1345
1354
|
C.length > 0 && (p[x] = [...p[x], ...C]), delete p[f];
|
|
1346
|
-
const
|
|
1347
|
-
return delete
|
|
1355
|
+
const h = { ...g.columnWidths };
|
|
1356
|
+
return delete h[f], {
|
|
1348
1357
|
...g,
|
|
1349
1358
|
columns: W,
|
|
1350
|
-
columnWidths:
|
|
1359
|
+
columnWidths: h,
|
|
1351
1360
|
columnPanels: p
|
|
1352
1361
|
};
|
|
1353
1362
|
});
|
|
@@ -1418,9 +1427,9 @@ const Ct = ({
|
|
|
1418
1427
|
(f, g, C, W) => {
|
|
1419
1428
|
E(n, 1, "パネル移動:", f, "from", g, "to", C, "at", W), i((x) => {
|
|
1420
1429
|
const p = { ...x.columnPanels };
|
|
1421
|
-
if (g in p && (p[g] = p[g].filter((
|
|
1422
|
-
const
|
|
1423
|
-
|
|
1430
|
+
if (g in p && (p[g] = p[g].filter((h) => h !== f)), C in p) {
|
|
1431
|
+
const h = [...p[C]];
|
|
1432
|
+
h.splice(W, 0, f), p[C] = h;
|
|
1424
1433
|
}
|
|
1425
1434
|
return {
|
|
1426
1435
|
...x,
|
|
@@ -1434,8 +1443,8 @@ const Ct = ({
|
|
|
1434
1443
|
E(n, 1, "パネル追加:", f, "to column:", g), i((W) => {
|
|
1435
1444
|
const x = { ...W.columnPanels };
|
|
1436
1445
|
g in x || (x[g] = []);
|
|
1437
|
-
const p = [...x[g]],
|
|
1438
|
-
return p.splice(
|
|
1446
|
+
const p = [...x[g]], h = C ?? p.length;
|
|
1447
|
+
return p.splice(h, 0, f), x[g] = p, {
|
|
1439
1448
|
...W,
|
|
1440
1449
|
columnPanels: x
|
|
1441
1450
|
};
|
|
@@ -1462,7 +1471,7 @@ const Ct = ({
|
|
|
1462
1471
|
if (f === C) return g;
|
|
1463
1472
|
const W = vt(g.columnPanels, f, ae), x = Ve(f, ae), p = g.isResizing && g.resizingColumn && !x.includes(g.resizingColumn);
|
|
1464
1473
|
p && E(n, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", g.resizingColumn);
|
|
1465
|
-
const
|
|
1474
|
+
const h = x.map((A, H) => ({
|
|
1466
1475
|
id: A,
|
|
1467
1476
|
title: `カラム ${H + 1}`,
|
|
1468
1477
|
minWidth: 350,
|
|
@@ -1483,7 +1492,7 @@ const Ct = ({
|
|
|
1483
1492
|
}
|
|
1484
1493
|
return {
|
|
1485
1494
|
...g,
|
|
1486
|
-
columns:
|
|
1495
|
+
columns: h,
|
|
1487
1496
|
columnPanels: W,
|
|
1488
1497
|
columnWidths: b,
|
|
1489
1498
|
isResizing: p ? !1 : g.isResizing,
|
|
@@ -1527,7 +1536,7 @@ const Ct = ({
|
|
|
1527
1536
|
}, []);
|
|
1528
1537
|
return {
|
|
1529
1538
|
layoutState: o,
|
|
1530
|
-
addColumn:
|
|
1539
|
+
addColumn: m,
|
|
1531
1540
|
removeColumn: S,
|
|
1532
1541
|
moveColumn: v,
|
|
1533
1542
|
startResize: $,
|
|
@@ -1553,11 +1562,11 @@ const Ct = ({
|
|
|
1553
1562
|
const { triggerDistance: o, scrollSpeed: i, maxScrollSpeed: u } = n;
|
|
1554
1563
|
let c;
|
|
1555
1564
|
l ? c = l.getBoundingClientRect() : c = new DOMRect(0, 0, window.innerWidth, window.innerHeight);
|
|
1556
|
-
const { left:
|
|
1565
|
+
const { left: m, top: S, right: v, bottom: $ } = c;
|
|
1557
1566
|
let M = 0, y = 0;
|
|
1558
|
-
if (r >=
|
|
1559
|
-
if (r <
|
|
1560
|
-
const a = Math.max(0, (
|
|
1567
|
+
if (r >= m && r <= v && t >= S && t <= $) {
|
|
1568
|
+
if (r < m + o) {
|
|
1569
|
+
const a = Math.max(0, (m + o - r) / o);
|
|
1561
1570
|
M = -Math.min(u, i + a * (u - i));
|
|
1562
1571
|
} else if (r > v - o) {
|
|
1563
1572
|
const a = Math.max(0, (r - (v - o)) / o);
|
|
@@ -1611,7 +1620,7 @@ const wt = ({
|
|
|
1611
1620
|
isMouseDown: i,
|
|
1612
1621
|
dragOverPosition: u,
|
|
1613
1622
|
setCustomDrag: c,
|
|
1614
|
-
setDragState:
|
|
1623
|
+
setDragState: m,
|
|
1615
1624
|
setDragOverPosition: S,
|
|
1616
1625
|
setOriginalPanelPosition: v,
|
|
1617
1626
|
setClickState: $,
|
|
@@ -1635,7 +1644,7 @@ const wt = ({
|
|
|
1635
1644
|
}) => {
|
|
1636
1645
|
const x = F(r);
|
|
1637
1646
|
x.current = r;
|
|
1638
|
-
const p = F(null),
|
|
1647
|
+
const p = F(null), h = F(null), b = F(0), N = F(new Be(Pe));
|
|
1639
1648
|
K(() => {
|
|
1640
1649
|
const d = document.querySelector("main[data-aqdd-scroll-root]");
|
|
1641
1650
|
d && N.current.setScrollElement(d);
|
|
@@ -1657,7 +1666,7 @@ const wt = ({
|
|
|
1657
1666
|
if (X) {
|
|
1658
1667
|
document.body.classList.add("droppable");
|
|
1659
1668
|
const G = X.getAttribute("data-column-index"), Q = G ? parseInt(G, 10) : null;
|
|
1660
|
-
Q !== null && Q !== t.dragOverColumn &&
|
|
1669
|
+
Q !== null && Q !== t.dragOverColumn && m((re) => ({ ...re, dragOverColumn: Q }));
|
|
1661
1670
|
const B = k?.closest("[data-placeholder-index]");
|
|
1662
1671
|
if (B) {
|
|
1663
1672
|
const re = B.getAttribute("data-placeholder-index"), ie = B.getAttribute("data-placeholder-column");
|
|
@@ -1668,13 +1677,13 @@ const wt = ({
|
|
|
1668
1677
|
} else
|
|
1669
1678
|
W();
|
|
1670
1679
|
} else
|
|
1671
|
-
document.body.classList.remove("droppable"), S(null),
|
|
1680
|
+
document.body.classList.remove("droppable"), S(null), m((G) => ({ ...G, dragOverColumn: null }));
|
|
1672
1681
|
} else if (i && l.isClicked && l.panelId) {
|
|
1673
1682
|
if (o[l.panelId] !== "custom" || Z(d.clientX, d.clientY) < 10) return;
|
|
1674
1683
|
E(x.current, 1, "🚀 カスタムドラッグ開始 -", l.panelId);
|
|
1675
1684
|
const X = document.querySelector(`[data-panel-id="${l.panelId}"]`);
|
|
1676
|
-
if (X &&
|
|
1677
|
-
const G = X.getBoundingClientRect(), Q =
|
|
1685
|
+
if (X && h.current) {
|
|
1686
|
+
const G = X.getBoundingClientRect(), Q = h.current.x - G.left, B = h.current.y - G.top;
|
|
1678
1687
|
_(l.panelId, Q, B), document.body.classList.add("custom-dragging"), c({
|
|
1679
1688
|
isActive: !0,
|
|
1680
1689
|
panelId: l.panelId,
|
|
@@ -1682,7 +1691,7 @@ const wt = ({
|
|
|
1682
1691
|
startY: B
|
|
1683
1692
|
});
|
|
1684
1693
|
}
|
|
1685
|
-
|
|
1694
|
+
m({ isDragging: !0, draggedPanel: l.panelId, dragOverColumn: null }), v(y(l.panelId)), j(d.clientX, d.clientY), $({ isClicked: !1, panelId: null }), M(!1), Y(), h.current = null, p.current && (clearTimeout(p.current), p.current = null);
|
|
1686
1695
|
}
|
|
1687
1696
|
},
|
|
1688
1697
|
[
|
|
@@ -1692,7 +1701,7 @@ const wt = ({
|
|
|
1692
1701
|
o,
|
|
1693
1702
|
i,
|
|
1694
1703
|
D,
|
|
1695
|
-
|
|
1704
|
+
m,
|
|
1696
1705
|
S,
|
|
1697
1706
|
Z,
|
|
1698
1707
|
y,
|
|
@@ -1727,15 +1736,15 @@ const wt = ({
|
|
|
1727
1736
|
} else if (z(d.clientX, d.clientY)) {
|
|
1728
1737
|
const X = document.elementFromPoint(d.clientX, d.clientY)?.closest("[data-panel-id]"), G = X?.getAttribute("data-panel-id") ?? null;
|
|
1729
1738
|
if (!(X && G) || o[G] !== "custom") {
|
|
1730
|
-
p.current && (clearTimeout(p.current), p.current = null), O(),
|
|
1739
|
+
p.current && (clearTimeout(p.current), p.current = null), O(), h.current = null, b.current = 0;
|
|
1731
1740
|
return;
|
|
1732
1741
|
}
|
|
1733
1742
|
b.current += 1, l.isClicked === !1 && b.current === 1 ? (E(x.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", G), $({ isClicked: !0, panelId: G }), p.current = window.setTimeout(() => {
|
|
1734
|
-
E(x.current, 1, "⏳ クリック待機状態を自動解除:", G), O(),
|
|
1735
|
-
}, 2e3)) : (E(x.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", G), p.current && (clearTimeout(p.current), p.current = null), O(),
|
|
1743
|
+
E(x.current, 1, "⏳ クリック待機状態を自動解除:", G), O(), h.current = null, b.current = 0;
|
|
1744
|
+
}, 2e3)) : (E(x.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", G), p.current && (clearTimeout(p.current), p.current = null), O(), h.current = null, b.current = 0, p.current = window.setTimeout(() => {
|
|
1736
1745
|
E(x.current, 1, "⏳ 仮想クリック検出再開:", G);
|
|
1737
1746
|
}, 2e3));
|
|
1738
|
-
} else l.isClicked && (O(),
|
|
1747
|
+
} else l.isClicked && (O(), h.current = null, b.current = 0);
|
|
1739
1748
|
i && M(!1);
|
|
1740
1749
|
},
|
|
1741
1750
|
[n.isActive, n.panelId, l, o, i, a, U, O, z, $, M, g]
|
|
@@ -1745,7 +1754,7 @@ const wt = ({
|
|
|
1745
1754
|
E(x.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", k);
|
|
1746
1755
|
return;
|
|
1747
1756
|
}
|
|
1748
|
-
R(d.clientX, d.clientY), l.isClicked && l.panelId === k && (M(!0), p.current !== null && (clearTimeout(p.current), p.current = null), L(d.clientX, d.clientY),
|
|
1757
|
+
R(d.clientX, d.clientY), l.isClicked && l.panelId === k && (M(!0), p.current !== null && (clearTimeout(p.current), p.current = null), L(d.clientX, d.clientY), h.current = { x: d.clientX, y: d.clientY });
|
|
1749
1758
|
},
|
|
1750
1759
|
[l, o, R, M, L]
|
|
1751
1760
|
);
|
|
@@ -1766,7 +1775,7 @@ const wt = ({
|
|
|
1766
1775
|
panelId: "",
|
|
1767
1776
|
startX: 0,
|
|
1768
1777
|
startY: 0
|
|
1769
|
-
}), [
|
|
1778
|
+
}), [m, S] = te({
|
|
1770
1779
|
isClicked: !1,
|
|
1771
1780
|
panelId: null
|
|
1772
1781
|
}), [v, $] = te({
|
|
@@ -1801,7 +1810,7 @@ const wt = ({
|
|
|
1801
1810
|
dragOverPosition: n,
|
|
1802
1811
|
originalPanelPosition: o,
|
|
1803
1812
|
customDrag: u,
|
|
1804
|
-
clickState:
|
|
1813
|
+
clickState: m,
|
|
1805
1814
|
touchDragState: v,
|
|
1806
1815
|
isMouseDown: M,
|
|
1807
1816
|
// Stabilized Setters / 安定化されたセッター
|
|
@@ -1831,7 +1840,7 @@ const wt = ({
|
|
|
1831
1840
|
y: a,
|
|
1832
1841
|
isVisible: j.isVisible
|
|
1833
1842
|
});
|
|
1834
|
-
}, []),
|
|
1843
|
+
}, []), m = w((y, a) => {
|
|
1835
1844
|
l.current = Date.now(), o.current = { x: y, y: a };
|
|
1836
1845
|
}, []), S = w((y, a) => {
|
|
1837
1846
|
n.current = { x: y, y: a };
|
|
@@ -1851,7 +1860,7 @@ const wt = ({
|
|
|
1851
1860
|
showMousePosition: i,
|
|
1852
1861
|
hideMousePosition: u,
|
|
1853
1862
|
updateMousePosition: c,
|
|
1854
|
-
recordMouseDown:
|
|
1863
|
+
recordMouseDown: m,
|
|
1855
1864
|
recordClickPosition: S,
|
|
1856
1865
|
isVirtualClick: v,
|
|
1857
1866
|
calculateMoveDistance: $,
|
|
@@ -1866,7 +1875,7 @@ const wt = ({
|
|
|
1866
1875
|
dragOverPosition: i,
|
|
1867
1876
|
originalPanelPosition: u,
|
|
1868
1877
|
setDragState: c,
|
|
1869
|
-
setDragOverPosition:
|
|
1878
|
+
setDragOverPosition: m,
|
|
1870
1879
|
setOriginalPanelPosition: S,
|
|
1871
1880
|
performPanelMove: v,
|
|
1872
1881
|
showMousePosition: $,
|
|
@@ -1904,10 +1913,10 @@ const wt = ({
|
|
|
1904
1913
|
return;
|
|
1905
1914
|
}
|
|
1906
1915
|
E(R.current, 1, "ドラッグ開始:", p);
|
|
1907
|
-
const
|
|
1916
|
+
const h = Object.keys(L.current);
|
|
1908
1917
|
let b = null;
|
|
1909
|
-
for (let N = 0; N <
|
|
1910
|
-
const T =
|
|
1918
|
+
for (let N = 0; N < h.length; N++) {
|
|
1919
|
+
const T = h[N], A = L.current[T].indexOf(p);
|
|
1911
1920
|
if (A !== -1) {
|
|
1912
1921
|
b = { columnIndex: N, panelIndex: A };
|
|
1913
1922
|
break;
|
|
@@ -1938,7 +1947,7 @@ const wt = ({
|
|
|
1938
1947
|
(x, p) => {
|
|
1939
1948
|
if (x.preventDefault(), x.dataTransfer.dropEffect = "move", !z.current.isDragging) return;
|
|
1940
1949
|
M(x.clientX, x.clientY), p !== z.current.dragOverColumn && c((N) => ({ ...N, dragOverColumn: p }));
|
|
1941
|
-
const
|
|
1950
|
+
const h = document.elementFromPoint(x.clientX, x.clientY), b = h?.closest("[data-placeholder-index]");
|
|
1942
1951
|
if (b) {
|
|
1943
1952
|
const N = b.getAttribute("data-placeholder-index"), T = b.getAttribute("data-placeholder-column");
|
|
1944
1953
|
if (N && T) {
|
|
@@ -1946,26 +1955,26 @@ const wt = ({
|
|
|
1946
1955
|
a(H, A);
|
|
1947
1956
|
}
|
|
1948
1957
|
} else
|
|
1949
|
-
|
|
1958
|
+
h?.closest("[data-drop-zone]") || j();
|
|
1950
1959
|
},
|
|
1951
1960
|
[M, c, a, j]
|
|
1952
1961
|
), C = w(
|
|
1953
1962
|
(x, p) => {
|
|
1954
1963
|
x.preventDefault();
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1957
|
-
draggedPanel:
|
|
1964
|
+
const h = x.dataTransfer.getData("text/plain"), b = Z.current;
|
|
1965
|
+
h && b && (E(R.current, 1, "🎯 ドロップ完了:", {
|
|
1966
|
+
draggedPanel: h,
|
|
1958
1967
|
targetColumn: p,
|
|
1959
1968
|
insertPosition: `カラム${b.columnIndex} - 位置${b.insertIndex}`
|
|
1960
|
-
}), v(
|
|
1969
|
+
}), v(h, p, b.insertIndex), m(null), f());
|
|
1961
1970
|
},
|
|
1962
|
-
[v,
|
|
1971
|
+
[v, m, f]
|
|
1963
1972
|
), W = w(
|
|
1964
1973
|
(x) => {
|
|
1965
|
-
const p = x.currentTarget,
|
|
1966
|
-
|
|
1974
|
+
const p = x.currentTarget, h = x.relatedTarget;
|
|
1975
|
+
h && p.contains(h) || (m(null), c((b) => ({ ...b, dragOverColumn: null })));
|
|
1967
1976
|
},
|
|
1968
|
-
[
|
|
1977
|
+
[m, c]
|
|
1969
1978
|
);
|
|
1970
1979
|
return K(() => {
|
|
1971
1980
|
const x = (p) => {
|
|
@@ -1985,7 +1994,7 @@ const wt = ({
|
|
|
1985
1994
|
handleColumnDragLeave: W
|
|
1986
1995
|
};
|
|
1987
1996
|
}, Nt = (r, t = 1) => {
|
|
1988
|
-
const [n, l] = te(r), [o, i] = te({}), u = F({}), c = F(null),
|
|
1997
|
+
const [n, l] = te(r), [o, i] = te({}), u = F({}), c = F(null), m = F({ x: 0, y: 0 }), S = F(t);
|
|
1989
1998
|
S.current = t;
|
|
1990
1999
|
const v = w((L) => document.querySelector(`[data-panel-id="${L}"]`), []), $ = w(
|
|
1991
2000
|
(L, z) => {
|
|
@@ -2020,12 +2029,12 @@ const wt = ({
|
|
|
2020
2029
|
const Y = v(L);
|
|
2021
2030
|
if (!Y || c.current) return;
|
|
2022
2031
|
const U = S.current, O = Y.getBoundingClientRect(), _ = Y.cloneNode(!0);
|
|
2023
|
-
_.removeAttribute("data-panel-id"), _.style.position = "fixed", _.style.top = "0px", _.style.left = "0px", _.style.width = `${Y.offsetWidth}px`, _.style.height = `${Y.offsetHeight}px`, _.style.pointerEvents = "none", _.style.zIndex = "1000", _.style.opacity = "0.5", _.style.margin = "0", _.style.transition = "none", _.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", _.style.transformOrigin = "top left", _.style.transform = `translate(${O.left}px, ${O.top}px) scale(${U})`, _.id = `drag-image-${L}`, document.body.appendChild(_), c.current = _,
|
|
2032
|
+
_.removeAttribute("data-panel-id"), _.style.position = "fixed", _.style.top = "0px", _.style.left = "0px", _.style.width = `${Y.offsetWidth}px`, _.style.height = `${Y.offsetHeight}px`, _.style.pointerEvents = "none", _.style.zIndex = "1000", _.style.opacity = "0.5", _.style.margin = "0", _.style.transition = "none", _.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", _.style.transformOrigin = "top left", _.style.transform = `translate(${O.left}px, ${O.top}px) scale(${U})`, _.id = `drag-image-${L}`, document.body.appendChild(_), c.current = _, m.current = { x: z, y: Z };
|
|
2024
2033
|
},
|
|
2025
2034
|
[v]
|
|
2026
2035
|
), j = w((L, z) => {
|
|
2027
2036
|
if (c.current) {
|
|
2028
|
-
const Z = L -
|
|
2037
|
+
const Z = L - m.current.x, Y = z - m.current.y;
|
|
2029
2038
|
c.current.style.transform = `translate(${Z}px, ${Y}px) scale(${S.current * 1.05})`;
|
|
2030
2039
|
}
|
|
2031
2040
|
}, []), D = w(() => {
|
|
@@ -2054,43 +2063,43 @@ const wt = ({
|
|
|
2054
2063
|
removeDragImage: D
|
|
2055
2064
|
};
|
|
2056
2065
|
}, _t = ({ initialColumnPanels: r, initialPanelVisibility: t, initialDragModes: n = {}, debugConfig: l, onPanelMove: o, onDragModeChange: i, onColumnPanelsChange: u, scale: c = 1 }) => {
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2066
|
+
const m = F(l);
|
|
2067
|
+
m.current = l;
|
|
2059
2068
|
const [S, v] = te(r), [$, M] = te(n), y = F(S);
|
|
2060
2069
|
y.current = S;
|
|
2061
2070
|
const a = jt(), j = Pt(), D = Nt(t, c), R = F({
|
|
2062
2071
|
mousemove: null,
|
|
2063
2072
|
mouseup: null
|
|
2064
|
-
}), L = w((
|
|
2073
|
+
}), L = w((h) => {
|
|
2065
2074
|
const b = Object.keys(y.current), N = bt(b, ae);
|
|
2066
2075
|
for (let T = 0; T < N.length; T++) {
|
|
2067
|
-
const A = N[T], H = y.current[A]?.indexOf(
|
|
2076
|
+
const A = N[T], H = y.current[A]?.indexOf(h) ?? -1;
|
|
2068
2077
|
if (H !== -1)
|
|
2069
2078
|
return { columnIndex: T, panelIndex: H };
|
|
2070
2079
|
}
|
|
2071
2080
|
return null;
|
|
2072
2081
|
}, []), z = w(
|
|
2073
|
-
(
|
|
2074
|
-
E(
|
|
2075
|
-
const A = { ...T }, H = Object.keys(A).find((s) => A[s].includes(
|
|
2082
|
+
(h, b, N) => {
|
|
2083
|
+
E(m.current, 1, "🔄 パネル移動実行:", h, "→", b, "@", N), v((T) => {
|
|
2084
|
+
const A = { ...T }, H = Object.keys(A).find((s) => A[s].includes(h));
|
|
2076
2085
|
if (!H)
|
|
2077
|
-
return console.error("Source column not found for panel:",
|
|
2086
|
+
return console.error("Source column not found for panel:", h), T;
|
|
2078
2087
|
if (!A[b])
|
|
2079
2088
|
return console.error("Target column not found:", b), T;
|
|
2080
2089
|
if (H === b) {
|
|
2081
|
-
const s = [...A[H]], d = s.indexOf(
|
|
2090
|
+
const s = [...A[H]], d = s.indexOf(h), [k] = s.splice(d, 1), X = d < N ? N - 1 : N;
|
|
2082
2091
|
s.splice(X, 0, k), A[b] = s;
|
|
2083
2092
|
} else {
|
|
2084
|
-
A[H] = A[H].filter((d) => d !==
|
|
2093
|
+
A[H] = A[H].filter((d) => d !== h);
|
|
2085
2094
|
const s = [...A[b]];
|
|
2086
|
-
s.splice(N, 0,
|
|
2095
|
+
s.splice(N, 0, h), A[b] = s;
|
|
2087
2096
|
}
|
|
2088
|
-
if (E(
|
|
2097
|
+
if (E(m.current, 1, "✅ パネル移動完了:", h, "→", b), u && requestAnimationFrame(() => {
|
|
2089
2098
|
u(A);
|
|
2090
2099
|
}), o) {
|
|
2091
|
-
const s = Object.keys(T).find((d) => T[d].includes(
|
|
2100
|
+
const s = Object.keys(T).find((d) => T[d].includes(h));
|
|
2092
2101
|
s && requestAnimationFrame(() => {
|
|
2093
|
-
o(
|
|
2102
|
+
o(h, s, b, N);
|
|
2094
2103
|
});
|
|
2095
2104
|
}
|
|
2096
2105
|
return A;
|
|
@@ -2098,34 +2107,34 @@ const wt = ({
|
|
|
2098
2107
|
},
|
|
2099
2108
|
[u, o]
|
|
2100
2109
|
), Z = w(
|
|
2101
|
-
(
|
|
2110
|
+
(h, b) => {
|
|
2102
2111
|
if (!(a.dragState.isDragging || a.customDrag.isActive)) return;
|
|
2103
2112
|
const N = a.originalPanelPosition;
|
|
2104
|
-
if (N && N.columnIndex ===
|
|
2105
|
-
E(
|
|
2113
|
+
if (N && N.columnIndex === h && (N.panelIndex === b || N.panelIndex + 1 === b)) {
|
|
2114
|
+
E(m.current, 1, `元の位置への挿入をスキップ: カラム${h}, 位置${b}`);
|
|
2106
2115
|
return;
|
|
2107
2116
|
}
|
|
2108
2117
|
const T = a.dragOverPosition;
|
|
2109
|
-
(!T || T.columnIndex !==
|
|
2118
|
+
(!T || T.columnIndex !== h || T.insertIndex !== b) && (E(m.current, 1, `プレースホルダーエンター: カラム${h}, 位置${b}`), a.setDragOverPosition({ columnIndex: h, insertIndex: b }), a.setDragState((A) => ({ ...A, dragOverColumn: h })));
|
|
2110
2119
|
},
|
|
2111
2120
|
[a]
|
|
2112
2121
|
), Y = w(
|
|
2113
|
-
(
|
|
2122
|
+
(h, b, N) => {
|
|
2114
2123
|
if (a.dragState.isDragging || a.customDrag.isActive) {
|
|
2115
2124
|
if (a.customDrag.isActive)
|
|
2116
|
-
E(
|
|
2117
|
-
else if (a.dragState.isDragging &&
|
|
2125
|
+
E(m.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), a.setDragOverPosition(null);
|
|
2126
|
+
else if (a.dragState.isDragging && h && b !== void 0 && N !== void 0) {
|
|
2118
2127
|
const T = a.dragOverPosition;
|
|
2119
2128
|
if (T && T.columnIndex === b && T.insertIndex === N) {
|
|
2120
|
-
const A =
|
|
2121
|
-
H && A.contains(H) || (E(
|
|
2129
|
+
const A = h.currentTarget, H = h.relatedTarget;
|
|
2130
|
+
H && A.contains(H) || (E(m.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${b}, 位置${N}。ハイライトを解除します。`), a.setDragOverPosition(null));
|
|
2122
2131
|
}
|
|
2123
2132
|
}
|
|
2124
2133
|
}
|
|
2125
2134
|
},
|
|
2126
2135
|
[a]
|
|
2127
2136
|
), U = wt({
|
|
2128
|
-
debugConfig:
|
|
2137
|
+
debugConfig: m.current,
|
|
2129
2138
|
dragState: a.dragState,
|
|
2130
2139
|
customDrag: a.customDrag,
|
|
2131
2140
|
clickState: a.clickState,
|
|
@@ -2156,7 +2165,7 @@ const wt = ({
|
|
|
2156
2165
|
handlePlaceholderDragEnter: Z,
|
|
2157
2166
|
handlePlaceholderDragLeave: Y
|
|
2158
2167
|
}), O = Dt({
|
|
2159
|
-
debugConfig:
|
|
2168
|
+
debugConfig: m.current,
|
|
2160
2169
|
dragState: a.dragState,
|
|
2161
2170
|
customDrag: a.customDrag,
|
|
2162
2171
|
dragModes: $,
|
|
@@ -2173,24 +2182,24 @@ const wt = ({
|
|
|
2173
2182
|
handlePlaceholderDragEnter: Z,
|
|
2174
2183
|
handlePlaceholderDragLeave: Y,
|
|
2175
2184
|
scale: c
|
|
2176
|
-
}), _ = w((
|
|
2177
|
-
R.current.mousemove && R.current.mousemove(
|
|
2178
|
-
}, []), f = w((
|
|
2179
|
-
R.current.mouseup && R.current.mouseup(
|
|
2185
|
+
}), _ = w((h) => {
|
|
2186
|
+
R.current.mousemove && R.current.mousemove(h);
|
|
2187
|
+
}, []), f = w((h) => {
|
|
2188
|
+
R.current.mouseup && R.current.mouseup(h);
|
|
2180
2189
|
}, []);
|
|
2181
|
-
K(() => (E(
|
|
2182
|
-
E(
|
|
2190
|
+
K(() => (E(m.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", _), document.addEventListener("mouseup", f), () => {
|
|
2191
|
+
E(m.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", f);
|
|
2183
2192
|
}), [_, f]), K(() => {
|
|
2184
|
-
const
|
|
2185
|
-
if (
|
|
2186
|
-
const N =
|
|
2187
|
-
E(
|
|
2193
|
+
const h = !a.clickState.isClicked && Object.entries($).some(([, N]) => N === "custom"), b = a.clickState.isClicked && a.clickState.panelId;
|
|
2194
|
+
if (h || b) {
|
|
2195
|
+
const N = h ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
|
|
2196
|
+
E(m.current, 1, `🔧 イベントハンドラー設定開始: ${N}`), R.current.mousemove = U.handleGlobalMouseMove, R.current.mouseup = U.handleGlobalMouseUp;
|
|
2188
2197
|
} else
|
|
2189
2198
|
a.customDrag.isActive || a.dragState.isDragging || (R.current.mousemove = null, R.current.mouseup = null);
|
|
2190
2199
|
}, [a.clickState.isClicked, a.clickState.panelId, $, a.customDrag.isActive, a.dragState.isDragging, U.handleGlobalMouseMove, U.handleGlobalMouseUp]);
|
|
2191
2200
|
const g = w(
|
|
2192
|
-
(
|
|
2193
|
-
const N =
|
|
2201
|
+
(h, b) => {
|
|
2202
|
+
const N = h.touches[0], T = h.currentTarget;
|
|
2194
2203
|
a.setTouchDragState({
|
|
2195
2204
|
isTouchDragging: !0,
|
|
2196
2205
|
startX: N.clientX,
|
|
@@ -2206,10 +2215,10 @@ const wt = ({
|
|
|
2206
2215
|
},
|
|
2207
2216
|
[a]
|
|
2208
2217
|
), C = w(
|
|
2209
|
-
(
|
|
2218
|
+
(h) => {
|
|
2210
2219
|
if (!a.touchDragState.isTouchDragging) return;
|
|
2211
|
-
|
|
2212
|
-
const b =
|
|
2220
|
+
h.preventDefault();
|
|
2221
|
+
const b = h.touches[0];
|
|
2213
2222
|
a.setTouchDragState((N) => ({
|
|
2214
2223
|
...N,
|
|
2215
2224
|
currentX: b.clientX,
|
|
@@ -2218,7 +2227,7 @@ const wt = ({
|
|
|
2218
2227
|
},
|
|
2219
2228
|
[a.touchDragState.isTouchDragging, a]
|
|
2220
2229
|
), W = w(
|
|
2221
|
-
(
|
|
2230
|
+
(h) => {
|
|
2222
2231
|
a.touchDragState.isTouchDragging && (a.setTouchDragState({
|
|
2223
2232
|
isTouchDragging: !1,
|
|
2224
2233
|
startX: 0,
|
|
@@ -2230,12 +2239,12 @@ const wt = ({
|
|
|
2230
2239
|
},
|
|
2231
2240
|
[a.touchDragState.isTouchDragging, a, O]
|
|
2232
2241
|
), x = w(
|
|
2233
|
-
(
|
|
2234
|
-
E(
|
|
2235
|
-
const T = (b[
|
|
2242
|
+
(h) => {
|
|
2243
|
+
E(m.current, 1, "🔄 toggleDragMode called:", { panelId: h }), M((b) => {
|
|
2244
|
+
const T = (b[h] || "normal") === "normal" ? "custom" : "normal", A = { ...b, [h]: T };
|
|
2236
2245
|
if (i)
|
|
2237
2246
|
try {
|
|
2238
|
-
i(
|
|
2247
|
+
i(h, T);
|
|
2239
2248
|
} catch (H) {
|
|
2240
2249
|
console.error("🔄 Error in onDragModeChange:", H);
|
|
2241
2250
|
}
|
|
@@ -2243,8 +2252,8 @@ const wt = ({
|
|
|
2243
2252
|
});
|
|
2244
2253
|
},
|
|
2245
2254
|
[i]
|
|
2246
|
-
), p = w((
|
|
2247
|
-
|
|
2255
|
+
), p = w((h, b) => {
|
|
2256
|
+
h.stopPropagation(), E(m.current, 2, "パネルサイズ情報クリック:", b);
|
|
2248
2257
|
}, []);
|
|
2249
2258
|
return {
|
|
2250
2259
|
// 状態
|
|
@@ -2282,7 +2291,7 @@ const wt = ({
|
|
|
2282
2291
|
findPanelPosition: L
|
|
2283
2292
|
};
|
|
2284
2293
|
}, Wt = ({ minColumnWidth: r = 350, defaultColumns: t = 3, maxColumns: n = 6, minColumns: l = 1, currentColumnWidths: o = {} } = {}) => {
|
|
2285
|
-
const [i, u] = te(0), c = F(0),
|
|
2294
|
+
const [i, u] = te(0), c = F(0), m = F(null), [S, v] = te(!1), $ = F(t);
|
|
2286
2295
|
K(() => {
|
|
2287
2296
|
if (typeof window > "u")
|
|
2288
2297
|
return;
|
|
@@ -2290,13 +2299,13 @@ const wt = ({
|
|
|
2290
2299
|
const D = window.visualViewport?.width ?? 0, R = document?.documentElement?.clientWidth ?? 0, L = document?.body?.clientWidth ?? 0, z = window.innerWidth ?? 0;
|
|
2291
2300
|
return R > 0 ? Math.floor(R) : D > 0 ? Math.floor(D) : L > 0 ? Math.floor(L) : Math.floor(z);
|
|
2292
2301
|
}, j = () => {
|
|
2293
|
-
|
|
2302
|
+
m.current !== null && cancelAnimationFrame(m.current), m.current = requestAnimationFrame(() => {
|
|
2294
2303
|
const D = a();
|
|
2295
|
-
|
|
2304
|
+
m.current = null, D !== 0 && (Math.abs(c.current - D) < 2 || (c.current = D, u(D)));
|
|
2296
2305
|
});
|
|
2297
2306
|
};
|
|
2298
2307
|
return j(), window.addEventListener("resize", j), window.addEventListener("orientationchange", j), window.visualViewport?.addEventListener("resize", j), () => {
|
|
2299
|
-
|
|
2308
|
+
m.current !== null && cancelAnimationFrame(m.current), window.removeEventListener("resize", j), window.removeEventListener("orientationchange", j), window.visualViewport?.removeEventListener("resize", j);
|
|
2300
2309
|
};
|
|
2301
2310
|
}, []);
|
|
2302
2311
|
const M = Xe(() => {
|