@aiquants/drag-drop-panels 0.4.0 → 0.6.0
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/DragDropLayout.d.ts +5 -2
- package/dist/DragDropLayout.d.ts.map +1 -1
- package/dist/drag-drop/types.d.ts +32 -1
- package/dist/drag-drop/types.d.ts.map +1 -1
- package/dist/index.es.js +951 -896
- package/dist/index.umd.js +2 -2
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Eye as
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
1
|
+
import $e, { useRef as Y, useState as ee, useEffect as J, useCallback as P, memo as He, useMemo as Ae, useLayoutEffect as qe, Fragment as Ue } from "react";
|
|
2
|
+
import { Eye as Ie, EyeOff as ke, MousePointerClick as Ve, MousePointer as Be, Minimize2 as Ze, Maximize2 as Ge, X as Re, Minus as Je, Plus as we, Grid3X3 as Qe, RotateCcw as Ke, Smartphone as et, Monitor as tt } from "lucide-react";
|
|
3
|
+
var ge = { exports: {} }, me = {};
|
|
4
|
+
var Ce;
|
|
5
|
+
function nt() {
|
|
6
|
+
if (Ce) return me;
|
|
7
|
+
Ce = 1;
|
|
8
8
|
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
9
|
function n(l, s, u) {
|
|
10
10
|
var d = null;
|
|
@@ -21,27 +21,27 @@ function ze() {
|
|
|
21
21
|
props: u
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return me.Fragment = t, me.jsx = n, me.jsxs = n, me;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var he = {};
|
|
27
|
+
var Oe;
|
|
28
|
+
function rt() {
|
|
29
|
+
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function r(a) {
|
|
31
31
|
if (a == null) return null;
|
|
32
32
|
if (typeof a == "function")
|
|
33
|
-
return a.$$typeof ===
|
|
33
|
+
return a.$$typeof === b ? null : a.displayName || a.name || null;
|
|
34
34
|
if (typeof a == "string") return a;
|
|
35
35
|
switch (a) {
|
|
36
36
|
case m:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case z:
|
|
39
39
|
return "Profiler";
|
|
40
|
-
case
|
|
40
|
+
case T:
|
|
41
41
|
return "StrictMode";
|
|
42
|
-
case
|
|
42
|
+
case q:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case L:
|
|
45
45
|
return "SuspenseList";
|
|
46
46
|
case f:
|
|
47
47
|
return "Activity";
|
|
@@ -54,17 +54,17 @@ function Ye() {
|
|
|
54
54
|
return "Portal";
|
|
55
55
|
case B:
|
|
56
56
|
return a.displayName || "Context";
|
|
57
|
-
case
|
|
57
|
+
case H:
|
|
58
58
|
return (a._context.displayName || "Context") + ".Consumer";
|
|
59
59
|
case k:
|
|
60
|
-
var
|
|
61
|
-
return a = a.displayName, a || (a =
|
|
62
|
-
case
|
|
63
|
-
return
|
|
60
|
+
var x = a.render;
|
|
61
|
+
return a = a.displayName, a || (a = x.displayName || x.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
62
|
+
case K:
|
|
63
|
+
return x = a.displayName || null, x !== null ? x : r(a.type) || "Memo";
|
|
64
64
|
case h:
|
|
65
|
-
|
|
65
|
+
x = a._payload, a = a._init;
|
|
66
66
|
try {
|
|
67
|
-
return r(a(
|
|
67
|
+
return r(a(x));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -76,17 +76,17 @@ function Ye() {
|
|
|
76
76
|
function n(a) {
|
|
77
77
|
try {
|
|
78
78
|
t(a);
|
|
79
|
-
var
|
|
79
|
+
var x = !1;
|
|
80
80
|
} catch {
|
|
81
|
-
|
|
81
|
+
x = !0;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
return
|
|
87
|
-
|
|
83
|
+
if (x) {
|
|
84
|
+
x = console;
|
|
85
|
+
var O = x.error, R = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
86
|
+
return O.call(
|
|
87
|
+
x,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
89
|
+
R
|
|
90
90
|
), t(a);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -95,8 +95,8 @@ function Ye() {
|
|
|
95
95
|
if (typeof a == "object" && a !== null && a.$$typeof === h)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
98
|
+
var x = r(a);
|
|
99
|
+
return x ? "<" + x + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
@@ -109,41 +109,41 @@ function Ye() {
|
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
111
|
function d(a) {
|
|
112
|
-
if (
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
112
|
+
if (y.call(a, "key")) {
|
|
113
|
+
var x = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
114
|
+
if (x && x.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
116
|
return a.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function c(a,
|
|
119
|
-
function
|
|
118
|
+
function c(a, x) {
|
|
119
|
+
function O() {
|
|
120
120
|
E || (E = !0, console.error(
|
|
121
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
|
|
122
|
+
x
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
O.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
126
|
+
get: O,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function p() {
|
|
131
131
|
var a = r(this.type);
|
|
132
|
-
return
|
|
132
|
+
return A[a] || (A[a] = !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."
|
|
134
134
|
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
135
135
|
}
|
|
136
|
-
function C(a,
|
|
137
|
-
var
|
|
136
|
+
function C(a, x, O, R, Z, Q) {
|
|
137
|
+
var I = O.ref;
|
|
138
138
|
return a = {
|
|
139
|
-
$$typeof:
|
|
139
|
+
$$typeof: v,
|
|
140
140
|
type: a,
|
|
141
|
-
key:
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
141
|
+
key: x,
|
|
142
|
+
props: O,
|
|
143
|
+
_owner: R
|
|
144
|
+
}, (I !== void 0 ? I : null) !== null ? Object.defineProperty(a, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: p
|
|
147
147
|
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -158,69 +158,69 @@ function Ye() {
|
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
|
-
value:
|
|
161
|
+
value: Z
|
|
162
162
|
}), Object.defineProperty(a, "_debugTask", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
166
|
+
value: Q
|
|
167
167
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (i(
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
169
|
+
function w(a, x, O, R, Z, Q) {
|
|
170
|
+
var I = x.children;
|
|
171
|
+
if (I !== void 0)
|
|
172
|
+
if (R)
|
|
173
|
+
if (i(I)) {
|
|
174
|
+
for (R = 0; R < I.length; R++)
|
|
175
|
+
$(I[R]);
|
|
176
|
+
Object.freeze && Object.freeze(I);
|
|
177
177
|
} else
|
|
178
178
|
console.error(
|
|
179
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
180
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
return
|
|
181
|
+
else $(I);
|
|
182
|
+
if (y.call(x, "key")) {
|
|
183
|
+
I = r(a);
|
|
184
|
+
var re = Object.keys(x).filter(function(j) {
|
|
185
|
+
return j !== "key";
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
R = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", U[I + R] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
191
191
|
React keys must be passed directly to JSX without using spread:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s key={someKey} {...props} />`,
|
|
194
|
-
I,
|
|
195
194
|
R,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
I,
|
|
196
|
+
re,
|
|
197
|
+
I
|
|
198
|
+
), U[I + R] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
200
|
+
if (I = null, O !== void 0 && (n(O), I = "" + O), d(x) && (n(x.key), I = "" + x.key), "key" in x) {
|
|
201
|
+
O = {};
|
|
202
|
+
for (var ce in x)
|
|
203
|
+
ce !== "key" && (O[ce] = x[ce]);
|
|
204
|
+
} else O = x;
|
|
205
|
+
return I && c(
|
|
206
|
+
O,
|
|
207
207
|
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
208
208
|
), C(
|
|
209
209
|
a,
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
I,
|
|
211
|
+
O,
|
|
212
212
|
s(),
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
Z,
|
|
214
|
+
Q
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function $(a) {
|
|
218
|
+
M(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === h && (a._payload.status === "fulfilled" ? M(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof a == "object" && a !== null && a.$$typeof ===
|
|
220
|
+
function M(a) {
|
|
221
|
+
return typeof a == "object" && a !== null && a.$$typeof === v;
|
|
222
222
|
}
|
|
223
|
-
var o =
|
|
223
|
+
var o = $e, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), D = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), z = /* @__PURE__ */ Symbol.for("react.profiler"), H = /* @__PURE__ */ Symbol.for("react.consumer"), B = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.forward_ref"), q = /* @__PURE__ */ Symbol.for("react.suspense"), L = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), f = /* @__PURE__ */ Symbol.for("react.activity"), b = /* @__PURE__ */ Symbol.for("react.client.reference"), N = o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, i = Array.isArray, g = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
o = {
|
|
@@ -228,39 +228,39 @@ React keys must be passed directly to JSX without using spread:
|
|
|
228
228
|
return a();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var E,
|
|
231
|
+
var E, A = {}, _ = o.react_stack_bottom_frame.bind(
|
|
232
232
|
o,
|
|
233
233
|
u
|
|
234
|
-
)(),
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
234
|
+
)(), X = g(l(u)), U = {};
|
|
235
|
+
he.Fragment = m, he.jsx = function(a, x, O) {
|
|
236
|
+
var R = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return w(
|
|
238
238
|
a,
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
x,
|
|
240
|
+
O,
|
|
241
241
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
R ? Error("react-stack-top-frame") : _,
|
|
243
|
+
R ? g(l(a)) : X
|
|
244
244
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
245
|
+
}, he.jsxs = function(a, x, O) {
|
|
246
|
+
var R = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return w(
|
|
248
248
|
a,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
x,
|
|
250
|
+
O,
|
|
251
251
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
R ? Error("react-stack-top-frame") : _,
|
|
253
|
+
R ? g(l(a)) : X
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), he;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
258
|
+
var Te;
|
|
259
|
+
function st() {
|
|
260
|
+
return Te || (Te = 1, process.env.NODE_ENV === "production" ? ge.exports = nt() : ge.exports = rt()), ge.exports;
|
|
261
261
|
}
|
|
262
|
-
var e =
|
|
263
|
-
const
|
|
262
|
+
var e = st();
|
|
263
|
+
const oe = class oe {
|
|
264
264
|
/**
|
|
265
265
|
* @constructor
|
|
266
266
|
* @param {LogLevel} [level=LogLevel.WARN] - The minimum log level to output.
|
|
@@ -277,7 +277,7 @@ const ne = class ne {
|
|
|
277
277
|
* @param {LogLevel} level - The new log level.
|
|
278
278
|
*/
|
|
279
279
|
static setLevel(t) {
|
|
280
|
-
|
|
280
|
+
oe.instance.setLevel(t);
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
283
|
* @method setLevel
|
|
@@ -295,7 +295,7 @@ const ne = class ne {
|
|
|
295
295
|
* @param {ILogger} impl - The new logger implementation.
|
|
296
296
|
*/
|
|
297
297
|
static setImplementation(t) {
|
|
298
|
-
|
|
298
|
+
oe.instance.setImplementation(t);
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
301
|
* @method setImplementation
|
|
@@ -313,7 +313,7 @@ const ne = class ne {
|
|
|
313
313
|
* @param {string} prefix - The new prefix.
|
|
314
314
|
*/
|
|
315
315
|
static setPrefix(t) {
|
|
316
|
-
|
|
316
|
+
oe.instance.setPrefix(t);
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
319
|
* @method setPrefix
|
|
@@ -328,33 +328,33 @@ const ne = class ne {
|
|
|
328
328
|
return typeof t == "string" ? [`${this.prefix} ${t}`] : [this.prefix, t];
|
|
329
329
|
}
|
|
330
330
|
static debug(t, ...n) {
|
|
331
|
-
|
|
331
|
+
oe.instance.debug(t, ...n);
|
|
332
332
|
}
|
|
333
333
|
debug(t, ...n) {
|
|
334
334
|
this.level <= 0 && this.impl.debug(...this.formatMessage(t), ...n);
|
|
335
335
|
}
|
|
336
336
|
static info(t, ...n) {
|
|
337
|
-
|
|
337
|
+
oe.instance.info(t, ...n);
|
|
338
338
|
}
|
|
339
339
|
info(t, ...n) {
|
|
340
340
|
this.level <= 1 && this.impl.info(...this.formatMessage(t), ...n);
|
|
341
341
|
}
|
|
342
342
|
static warn(t, ...n) {
|
|
343
|
-
|
|
343
|
+
oe.instance.warn(t, ...n);
|
|
344
344
|
}
|
|
345
345
|
warn(t, ...n) {
|
|
346
346
|
this.level <= 2 && this.impl.warn(...this.formatMessage(t), ...n);
|
|
347
347
|
}
|
|
348
348
|
static error(t, ...n) {
|
|
349
|
-
|
|
349
|
+
oe.instance.error(t, ...n);
|
|
350
350
|
}
|
|
351
351
|
error(t, ...n) {
|
|
352
352
|
this.level <= 3 && this.impl.error(...this.formatMessage(t), ...n);
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
|
|
356
|
-
let
|
|
357
|
-
const
|
|
355
|
+
oe.instance = new oe(2, "[drag-drop-panels]");
|
|
356
|
+
let ye = oe;
|
|
357
|
+
const ot = ({ config: r, panelId: t, sizeInfo: n, onSizeInfoClick: l }) => r.showPanelSizes && n ? (
|
|
358
358
|
// biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素。デバッグ目的のため、インタラクティブ性は限定的。
|
|
359
359
|
// biome-ignore lint/a11y/useKeyWithClickEvents: キーボード操作はデバッグ機能では優先度が低い。
|
|
360
360
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -391,46 +391,46 @@ const Fe = ({ config: r, panelId: t, sizeInfo: n, onSizeInfoClick: l }) => r.sho
|
|
|
391
391
|
}
|
|
392
392
|
)
|
|
393
393
|
) : null, S = (r, t, ...n) => {
|
|
394
|
-
(r.logLevel ?? 0) >= t &&
|
|
395
|
-
},
|
|
396
|
-
const C = s && s.columnIndex === t && (s.panelIndex === r || s.panelIndex + 1 === r),
|
|
397
|
-
return
|
|
398
|
-
if (
|
|
399
|
-
const D =
|
|
394
|
+
(r.logLevel ?? 0) >= t && ye.info(...n);
|
|
395
|
+
}, Le = $e.memo(({ index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: s, onDragEnter: u, onDragLeave: d, config: c, customDrag: p }) => {
|
|
396
|
+
const C = s && s.columnIndex === t && (s.panelIndex === r || s.panelIndex + 1 === r), w = !C && l?.columnIndex === t && l?.insertIndex === r, $ = Y(null), [M, o] = ee(null), v = n || (p?.isActive ?? !1);
|
|
397
|
+
return J(() => {
|
|
398
|
+
if ($.current) {
|
|
399
|
+
const D = $.current.getBoundingClientRect(), m = {
|
|
400
400
|
width: Math.round(D.width),
|
|
401
401
|
height: Math.round(D.height),
|
|
402
402
|
x: Math.round(D.left),
|
|
403
403
|
y: Math.round(D.top)
|
|
404
404
|
};
|
|
405
|
-
o(m),
|
|
405
|
+
o(m), w && S(c, 1, `🎯 アクティブプレースホルダー ${r}-${t}:`, {
|
|
406
406
|
size: `${m.width}×${m.height}`,
|
|
407
407
|
position: `(${m.x}, ${m.y})`,
|
|
408
408
|
bottomRight: `(${m.x + m.width}, ${m.y + m.height})`,
|
|
409
409
|
center: `(${m.x + m.width / 2}, ${m.y + m.height / 2})`
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
}, [
|
|
412
|
+
}, [w, r, t, c]), S(c, 2, `プレースホルダー${r}-${t}: 表示中`, { isHighlighted: w, isDragging: n, dragOverPosition: l, shouldShow: v }), // biome-ignore lint/a11y/noStaticElementInteractions: ドラッグイベントを処理するための対話的な要素。デバッグ目的のため、キーボード操作は必須ではない。
|
|
413
413
|
/* @__PURE__ */ e.jsxs(
|
|
414
414
|
"div",
|
|
415
415
|
{
|
|
416
|
-
ref:
|
|
416
|
+
ref: $,
|
|
417
417
|
"data-placeholder-index": r,
|
|
418
418
|
"data-placeholder-column": t,
|
|
419
419
|
onDragEnter: () => u(t, r),
|
|
420
420
|
onDragLeave: (D) => d(D, t, r),
|
|
421
|
-
className: `relative flex w-full items-center justify-center transition-all duration-0 ${C ? "pointer-events-none h-0 overflow-hidden opacity-0" :
|
|
421
|
+
className: `relative flex w-full items-center justify-center transition-all duration-0 ${C ? "pointer-events-none h-0 overflow-hidden opacity-0" : v ? w ? "my-2 scale-[1.02] rounded-xl border-4 border-sky-500 border-dashed bg-sky-200 px-4 py-6 shadow-lg ring-2 ring-sky-400 ring-opacity-50" : "my-2 rounded-xl border-2 border-sky-300 border-dashed bg-sky-50/70 px-2 py-4 opacity-80" : "pointer-events-none h-0 overflow-hidden opacity-0"}`,
|
|
422
422
|
children: [
|
|
423
|
-
!C &&
|
|
423
|
+
!C && v && c.showPlaceholderInfo && M && /* @__PURE__ */ e.jsxs("div", { className: "absolute top-1 right-1 z-10 rounded-md bg-blue-500/90 px-2 py-1 font-mono text-white text-xs leading-tight shadow-lg", children: [
|
|
424
424
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
425
|
-
|
|
425
|
+
M.width,
|
|
426
426
|
"×",
|
|
427
|
-
|
|
427
|
+
M.height
|
|
428
428
|
] }),
|
|
429
429
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
430
430
|
"X:",
|
|
431
|
-
|
|
431
|
+
M.x,
|
|
432
432
|
" Y:",
|
|
433
|
-
|
|
433
|
+
M.y
|
|
434
434
|
] }),
|
|
435
435
|
/* @__PURE__ */ e.jsx("div", { className: "text-[10px] opacity-80", children: "min:200px max:500px" }),
|
|
436
436
|
/* @__PURE__ */ e.jsxs("div", { className: "mt-0.5 text-[10px] opacity-80", children: [
|
|
@@ -439,10 +439,10 @@ const Fe = ({ config: r, panelId: t, sizeInfo: n, onSizeInfoClick: l }) => r.sho
|
|
|
439
439
|
"-",
|
|
440
440
|
r,
|
|
441
441
|
" ",
|
|
442
|
-
|
|
442
|
+
w ? "ACTIVE" : "IDLE"
|
|
443
443
|
] })
|
|
444
444
|
] }),
|
|
445
|
-
!C &&
|
|
445
|
+
!C && v && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 text-sky-600", children: [
|
|
446
446
|
/* @__PURE__ */ e.jsxs("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
447
447
|
/* @__PURE__ */ e.jsx("title", { children: "パネルをここにドロップ" }),
|
|
448
448
|
/* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6" })
|
|
@@ -453,23 +453,23 @@ const Fe = ({ config: r, panelId: t, sizeInfo: n, onSizeInfoClick: l }) => r.sho
|
|
|
453
453
|
}
|
|
454
454
|
);
|
|
455
455
|
});
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
const u =
|
|
459
|
-
return
|
|
456
|
+
Le.displayName = "InsertPlaceholder";
|
|
457
|
+
const _e = ({ columnIndex: r, isDragging: t, dragOverPosition: n, children: l, config: s }) => {
|
|
458
|
+
const u = Y(null), [d, c] = ee(null);
|
|
459
|
+
return J(() => {
|
|
460
460
|
if (u.current && t) {
|
|
461
|
-
const
|
|
462
|
-
width: Math.round(
|
|
463
|
-
height: Math.round(
|
|
464
|
-
x: Math.round(
|
|
465
|
-
y: Math.round(
|
|
461
|
+
const p = u.current.getBoundingClientRect(), C = n?.columnIndex === r, w = {
|
|
462
|
+
width: Math.round(p.width),
|
|
463
|
+
height: Math.round(p.height),
|
|
464
|
+
x: Math.round(p.left),
|
|
465
|
+
y: Math.round(p.top),
|
|
466
466
|
isActive: C
|
|
467
467
|
};
|
|
468
|
-
c(
|
|
469
|
-
size: `${
|
|
470
|
-
position: `(${
|
|
471
|
-
bottomRight: `(${
|
|
472
|
-
center: `(${
|
|
468
|
+
c(w), C && S(s, 1, `🎯 アクティブドロップゾーン ${r}:`, {
|
|
469
|
+
size: `${w.width}×${w.height}`,
|
|
470
|
+
position: `(${w.x}, ${w.y})`,
|
|
471
|
+
bottomRight: `(${w.x + w.width}, ${w.y + w.height})`,
|
|
472
|
+
center: `(${w.x + w.width / 2}, ${w.y + w.height / 2})`
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
}, [t, n, r, s]), /* @__PURE__ */ e.jsxs("div", { ref: u, className: "relative", children: [
|
|
@@ -514,57 +514,57 @@ const Pe = ({ columnIndex: r, isDragging: t, dragOverPosition: n, children: l, c
|
|
|
514
514
|
] })
|
|
515
515
|
] });
|
|
516
516
|
};
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
!s &&
|
|
517
|
+
_e.displayName = "DropZoneDebugOverlay";
|
|
518
|
+
const We = ({ columnId: r, onResizeStart: t, onResize: n, onResizeEnd: l, isResizing: s = !1, position: u = "right", className: d = "", debug: c = {} }) => {
|
|
519
|
+
const p = Y(!1), C = Y(null);
|
|
520
|
+
J(() => {
|
|
521
|
+
!s && p.current && (S(c, 1, "外部からのリサイズ解除を検出、ドラッグ状態を強制解除:", r), p.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
522
522
|
}, [s, r, c]);
|
|
523
|
-
const
|
|
523
|
+
const w = P(
|
|
524
524
|
(o) => {
|
|
525
|
-
o.preventDefault(), o.stopPropagation(), S(c, 2, "リサイズハンドル マウスダウン:", r),
|
|
525
|
+
o.preventDefault(), o.stopPropagation(), S(c, 2, "リサイズハンドル マウスダウン:", r), p.current = !0, t(r, o.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
|
|
526
526
|
},
|
|
527
527
|
[r, t, c]
|
|
528
528
|
);
|
|
529
|
-
|
|
529
|
+
J(() => {
|
|
530
530
|
const o = (D) => {
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
|
|
531
|
+
p.current && (D.preventDefault(), n(D.clientX));
|
|
532
|
+
}, v = () => {
|
|
533
|
+
p.current && (S(c, 2, "リサイズハンドル マウスアップ:", r), p.current = !1, l(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
534
534
|
};
|
|
535
|
-
return document.addEventListener("mousemove", o), document.addEventListener("mouseup",
|
|
536
|
-
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup",
|
|
535
|
+
return document.addEventListener("mousemove", o), document.addEventListener("mouseup", v), () => {
|
|
536
|
+
document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", v);
|
|
537
537
|
};
|
|
538
538
|
}, [r, n, l, c]);
|
|
539
|
-
const
|
|
539
|
+
const $ = P(
|
|
540
540
|
(o) => {
|
|
541
541
|
o.preventDefault(), o.stopPropagation();
|
|
542
|
-
const
|
|
543
|
-
S(c, 2, "リサイズハンドル タッチスタート:", r),
|
|
542
|
+
const v = o.touches[0];
|
|
543
|
+
S(c, 2, "リサイズハンドル タッチスタート:", r), p.current = !0, t(r, v.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
|
|
544
544
|
},
|
|
545
545
|
[r, t, c]
|
|
546
546
|
);
|
|
547
|
-
|
|
547
|
+
J(() => {
|
|
548
548
|
const o = (D) => {
|
|
549
|
-
if (!
|
|
549
|
+
if (!p.current) return;
|
|
550
550
|
D.preventDefault();
|
|
551
551
|
const m = D.touches[0];
|
|
552
552
|
n(m.clientX);
|
|
553
|
-
},
|
|
554
|
-
|
|
553
|
+
}, v = () => {
|
|
554
|
+
p.current && (S(c, 2, "リサイズハンドル タッチエンド:", r), p.current = !1, l(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
555
555
|
};
|
|
556
|
-
return document.addEventListener("touchmove", o, { passive: !1 }), document.addEventListener("touchend",
|
|
557
|
-
document.removeEventListener("touchmove", o), document.removeEventListener("touchend",
|
|
556
|
+
return document.addEventListener("touchmove", o, { passive: !1 }), document.addEventListener("touchend", v), () => {
|
|
557
|
+
document.removeEventListener("touchmove", o), document.removeEventListener("touchend", v);
|
|
558
558
|
};
|
|
559
|
-
}, [r, n, l, c]),
|
|
560
|
-
|
|
559
|
+
}, [r, n, l, c]), J(() => () => {
|
|
560
|
+
p.current && (S(c, 1, "リサイズハンドルアンマウント時のクリーンアップ:", r), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
|
|
561
561
|
}, [r, c]);
|
|
562
|
-
const
|
|
562
|
+
const M = ["resize-handle", u, s ? "resizing" : "", d].filter(Boolean).join(" ");
|
|
563
563
|
return (
|
|
564
564
|
// biome-ignore lint/a11y/useFocusableInteractive: リサイズハンドルとして機能するためインタラクティブである必要がある
|
|
565
565
|
// biome-ignore lint/a11y/useSemanticElements: divを使用するが、aria-roleでセマンティックな意味を提供している
|
|
566
566
|
// biome-ignore lint/a11y/useAriaPropsForRole: リサイズハンドルのため、値の範囲を指定することが難しい
|
|
567
|
-
/* @__PURE__ */ e.jsxs("div", { ref: C, className:
|
|
567
|
+
/* @__PURE__ */ e.jsxs("div", { ref: C, className: M, onMouseDown: w, onTouchStart: $, "data-column-id": r, "data-position": u, "aria-label": `${r}のカラム幅を調整`, role: "separator", "aria-orientation": "vertical", children: [
|
|
568
568
|
/* @__PURE__ */ e.jsx("div", { className: "resize-handle-bar" }),
|
|
569
569
|
c.showPanelSizes && /* @__PURE__ */ e.jsxs("div", { className: "resize-handle-debug-info", children: [
|
|
570
570
|
r,
|
|
@@ -572,21 +572,21 @@ const De = ({ columnId: r, onResizeStart: t, onResize: n, onResizeEnd: l, isResi
|
|
|
572
572
|
] })
|
|
573
573
|
] })
|
|
574
574
|
);
|
|
575
|
-
},
|
|
576
|
-
const
|
|
577
|
-
return
|
|
575
|
+
}, gt = ({ columnId: r, width: t, minWidth: n = 100, maxWidth: l = 800, onResizeStart: s, onResize: u, onResizeEnd: d, isResizing: c = !1, resizable: p = !0, className: C = "", debug: w = {}, children: $ }) => {
|
|
576
|
+
const M = ["resizable-column", c ? "resizing" : "", C].filter(Boolean).join(" ");
|
|
577
|
+
return J(() => {
|
|
578
578
|
const o = document.querySelector(`[data-column-id="${r}"]`);
|
|
579
579
|
o && (o.style.setProperty("--column-width", `${t}px`), o.style.setProperty("--column-min-width", `${n}px`), o.style.setProperty("--column-max-width", `${l}px`));
|
|
580
|
-
}, [r, t, n, l]), /* @__PURE__ */ e.jsxs("div", { className:
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
}, [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: [
|
|
581
|
+
$,
|
|
582
|
+
p && /* @__PURE__ */ e.jsx(We, { columnId: r, onResizeStart: s, onResize: u, onResizeEnd: d, isResizing: c, position: "right", debug: w }),
|
|
583
|
+
w.showPanelSizes && /* @__PURE__ */ e.jsxs("div", { className: "column-debug-size", children: [
|
|
584
584
|
t,
|
|
585
585
|
"px",
|
|
586
586
|
c && " ↔"
|
|
587
587
|
] })
|
|
588
588
|
] });
|
|
589
|
-
},
|
|
589
|
+
}, je = He(
|
|
590
590
|
({
|
|
591
591
|
index: r,
|
|
592
592
|
columnIndex: t,
|
|
@@ -596,11 +596,11 @@ const De = ({ columnId: r, onResizeStart: t, onResize: n, onResizeEnd: l, isResi
|
|
|
596
596
|
onDragEnter: u,
|
|
597
597
|
onDragLeave: d,
|
|
598
598
|
debugConfig: c,
|
|
599
|
-
customDrag:
|
|
600
|
-
}) => /* @__PURE__ */ e.jsx(
|
|
599
|
+
customDrag: p
|
|
600
|
+
}) => /* @__PURE__ */ e.jsx(Le, { index: r, columnIndex: t, isDragging: n, dragOverPosition: l, originalPosition: s, onDragEnter: u, onDragLeave: d, config: c, customDrag: p })
|
|
601
601
|
);
|
|
602
|
-
|
|
603
|
-
const
|
|
602
|
+
je.displayName = "LocalInsertPlaceholder";
|
|
603
|
+
const pt = ({
|
|
604
604
|
columns: r,
|
|
605
605
|
panels: t,
|
|
606
606
|
columnPanels: n,
|
|
@@ -610,305 +610,360 @@ const et = ({
|
|
|
610
610
|
dragState: u,
|
|
611
611
|
dragOverPosition: d,
|
|
612
612
|
originalPanelPosition: c,
|
|
613
|
-
dragModes:
|
|
613
|
+
dragModes: p,
|
|
614
614
|
onDragStart: C,
|
|
615
|
-
onDragEnd:
|
|
616
|
-
onPlaceholderDragEnter:
|
|
617
|
-
onPlaceholderDragLeave:
|
|
615
|
+
onDragEnd: w,
|
|
616
|
+
onPlaceholderDragEnter: $,
|
|
617
|
+
onPlaceholderDragLeave: M,
|
|
618
618
|
onDragOverWithInsert: o,
|
|
619
|
-
onDropWithInsert:
|
|
619
|
+
onDropWithInsert: v,
|
|
620
620
|
onColumnDragLeave: D,
|
|
621
621
|
onPanelClick: m,
|
|
622
|
-
onPanelMouseDown:
|
|
623
|
-
onTouchStart:
|
|
624
|
-
onTouchMove:
|
|
622
|
+
onPanelMouseDown: T,
|
|
623
|
+
onTouchStart: z,
|
|
624
|
+
onTouchMove: H,
|
|
625
625
|
onTouchEnd: B,
|
|
626
626
|
debugConfig: k,
|
|
627
|
-
panelSizes:
|
|
628
|
-
setPanelRef:
|
|
629
|
-
enableResize:
|
|
627
|
+
panelSizes: q,
|
|
628
|
+
setPanelRef: L,
|
|
629
|
+
enableResize: K = !1,
|
|
630
630
|
columnWidths: h,
|
|
631
631
|
// onColumnWidthChange,
|
|
632
632
|
onResizeStart: f,
|
|
633
|
-
onResize:
|
|
633
|
+
onResize: b,
|
|
634
634
|
onResizeEnd: N,
|
|
635
|
-
isResizing:
|
|
635
|
+
isResizing: y = !1,
|
|
636
636
|
resizingColumn: i,
|
|
637
637
|
onPanelSizeInfoClick: g,
|
|
638
638
|
onToggleDragMode: E,
|
|
639
|
-
|
|
639
|
+
onPanelClose: A,
|
|
640
|
+
onPanelMaximizeChange: _,
|
|
641
|
+
customDrag: X,
|
|
642
|
+
dragHandle: U = "panel",
|
|
643
|
+
maximizedPanel: a = null,
|
|
644
|
+
panelClassName: x = ""
|
|
640
645
|
}) => {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
646
|
+
const O = Y(k);
|
|
647
|
+
J(() => {
|
|
648
|
+
O.current = k;
|
|
644
649
|
}, [k]);
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
S(
|
|
648
|
-
dragModes:
|
|
650
|
+
const R = Y({}), Z = Y(/* @__PURE__ */ new Map());
|
|
651
|
+
J(() => {
|
|
652
|
+
S(O.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
|
|
653
|
+
dragModes: p,
|
|
649
654
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
650
|
-
keys: Object.keys(
|
|
651
|
-
values: Object.values(
|
|
655
|
+
keys: Object.keys(p),
|
|
656
|
+
values: Object.values(p)
|
|
652
657
|
});
|
|
653
|
-
}, [
|
|
654
|
-
const
|
|
655
|
-
const
|
|
656
|
-
return t.forEach((
|
|
657
|
-
|
|
658
|
-
}),
|
|
658
|
+
}, [p]);
|
|
659
|
+
const Q = Ae(() => {
|
|
660
|
+
const j = {};
|
|
661
|
+
return t.forEach((V) => {
|
|
662
|
+
j[V.id] = V;
|
|
663
|
+
}), j;
|
|
659
664
|
}, [t]);
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
665
|
+
J(() => {
|
|
666
|
+
if (!(a && _))
|
|
667
|
+
return;
|
|
668
|
+
const j = (V) => {
|
|
669
|
+
V.key === "Escape" && _(null);
|
|
670
|
+
};
|
|
671
|
+
return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
|
|
672
|
+
}, [a, _]), qe(() => {
|
|
673
|
+
const j = /* @__PURE__ */ new Map();
|
|
674
|
+
Object.keys(R.current).forEach((W) => {
|
|
675
|
+
const te = R.current[W];
|
|
676
|
+
if (te) {
|
|
677
|
+
const ie = te.getBoundingClientRect();
|
|
678
|
+
j.set(W, {
|
|
679
|
+
rect: ie,
|
|
680
|
+
height: te.offsetHeight,
|
|
681
|
+
width: te.offsetWidth
|
|
670
682
|
});
|
|
671
683
|
}
|
|
672
684
|
});
|
|
673
|
-
const
|
|
674
|
-
Object.values(n).forEach((
|
|
675
|
-
|
|
676
|
-
|
|
685
|
+
const V = Z.current, ne = 300, ue = /* @__PURE__ */ new Set();
|
|
686
|
+
Object.values(n).forEach((W) => {
|
|
687
|
+
W.forEach((te) => {
|
|
688
|
+
ue.add(te);
|
|
677
689
|
});
|
|
678
|
-
}), new Set(
|
|
679
|
-
|
|
680
|
-
}),
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
S(
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
},
|
|
690
|
+
}), new Set(V.keys()).forEach((W) => {
|
|
691
|
+
ue.has(W) || (S(O.current, 1, "パネル削除検出 - クリーンアップ:", W), V.delete(W), R.current[W] && delete R.current[W]);
|
|
692
|
+
}), j.forEach((W, te) => {
|
|
693
|
+
const ie = V.get(te);
|
|
694
|
+
if (ie) {
|
|
695
|
+
const G = ie.rect.left - W.rect.left, de = ie.rect.top - W.rect.top;
|
|
696
|
+
if (G !== 0 || de !== 0) {
|
|
697
|
+
S(O.current, 2, "パネル移動検出 - アニメーション開始:", te, { dx: G, dy: de });
|
|
698
|
+
const se = R.current[te];
|
|
699
|
+
se && (se.style.transform = `translate(${G}px, ${de}px)`, se.style.transition = "none", se.classList.add("is-moving"), requestAnimationFrame(() => {
|
|
700
|
+
se.style.transition = `transform ${ne}ms cubic-bezier(0.2, 0, 0.2, 1)`, se.style.transform = "translate(0, 0)", setTimeout(() => {
|
|
701
|
+
se.style.transition = "", se.style.transform = "", se.classList.remove("is-moving");
|
|
702
|
+
}, ne);
|
|
691
703
|
}));
|
|
692
704
|
}
|
|
693
705
|
} else {
|
|
694
|
-
S(
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
},
|
|
706
|
+
S(O.current, 1, "新規パネル検出 - フェードインアニメーション:", te);
|
|
707
|
+
const G = R.current[te];
|
|
708
|
+
G && (G.style.opacity = "0", G.style.transition = "none", requestAnimationFrame(() => {
|
|
709
|
+
G.style.transition = `opacity ${ne}ms ease-out`, G.style.opacity = "1", setTimeout(() => {
|
|
710
|
+
G.style.transition = "", G.style.opacity = "";
|
|
711
|
+
}, ne);
|
|
700
712
|
}));
|
|
701
713
|
}
|
|
702
|
-
}),
|
|
714
|
+
}), Z.current = j;
|
|
703
715
|
}, [n]);
|
|
704
|
-
const
|
|
705
|
-
if (!l[
|
|
706
|
-
const
|
|
707
|
-
if (!
|
|
708
|
-
return S(
|
|
709
|
-
const
|
|
710
|
-
S(
|
|
711
|
-
panelId:
|
|
712
|
-
dragMode:
|
|
716
|
+
const I = (j) => {
|
|
717
|
+
if (!l[j]) return null;
|
|
718
|
+
const V = Q[j];
|
|
719
|
+
if (!V)
|
|
720
|
+
return S(O.current, 1, `Panel config not found for panelId: ${j}`), null;
|
|
721
|
+
const ne = V.component, ue = V.title, ae = u.draggedPanel === j, W = p[j] || "normal";
|
|
722
|
+
S(O.current, 2, `🎨 renderPanel - ${j}:`, {
|
|
723
|
+
panelId: j,
|
|
724
|
+
dragMode: W,
|
|
713
725
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
714
726
|
});
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
const
|
|
718
|
-
S(
|
|
719
|
-
width:
|
|
720
|
-
height:
|
|
721
|
-
x:
|
|
722
|
-
y:
|
|
723
|
-
minHeight:
|
|
724
|
-
maxHeight:
|
|
727
|
+
const te = (F) => {
|
|
728
|
+
R.current[j] = F, L && L(j, F), F && k.showPanelSizes && requestAnimationFrame(() => {
|
|
729
|
+
const xe = F.getBoundingClientRect(), Se = window.getComputedStyle(F);
|
|
730
|
+
S(O.current, 1, `Panel ${j} mounted with size:`, {
|
|
731
|
+
width: xe.width,
|
|
732
|
+
height: xe.height,
|
|
733
|
+
x: xe.left,
|
|
734
|
+
y: xe.top,
|
|
735
|
+
minHeight: Se.minHeight,
|
|
736
|
+
maxHeight: Se.maxHeight
|
|
725
737
|
});
|
|
726
738
|
});
|
|
727
|
-
},
|
|
739
|
+
}, ie = q[j], G = a === j, de = !!_, se = () => _?.(G ? null : j), Xe = G ? { position: "fixed", inset: 0, zIndex: 50, minHeight: 0, maxHeight: "none" } : {
|
|
740
|
+
minHeight: V.minHeight ?? "200px",
|
|
741
|
+
maxHeight: V.maxHeight ?? "500px"
|
|
742
|
+
}, fe = U === "header", Pe = W === "normal" && !fe && !G, De = W === "normal" && fe && !G, Ne = ae ? "cursor-grabbing" : "cursor-grab", Ee = `panel-draggable group relative flex flex-col overflow-hidden border border-slate-200 text-left shadow-lg backdrop-blur-lg ${W === "custom" ? "select-none" : ""}`, Fe = G ? (
|
|
743
|
+
// 最大化中: 角丸・ホバー演出・grab カーソル無し、背景は不透過寄りで下のレイアウトを遮蔽
|
|
744
|
+
`${Ee} rounded-none bg-white/95 p-4 ${x}`
|
|
745
|
+
) : `${Ee} rounded-2xl bg-white/80 p-4 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl ${fe ? "" : Ne} ${x}`;
|
|
728
746
|
return (
|
|
729
747
|
// biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素
|
|
730
748
|
/* @__PURE__ */ e.jsxs(
|
|
731
749
|
"div",
|
|
732
750
|
{
|
|
733
|
-
ref:
|
|
734
|
-
"data-panel-id":
|
|
735
|
-
"data-dragging":
|
|
751
|
+
ref: te,
|
|
752
|
+
"data-panel-id": j,
|
|
753
|
+
"data-dragging": ae,
|
|
754
|
+
"data-maximized": G || void 0,
|
|
736
755
|
role: "presentation",
|
|
737
|
-
draggable:
|
|
738
|
-
onDragStart: (
|
|
739
|
-
onDragEnd:
|
|
740
|
-
onClick: (
|
|
741
|
-
onMouseDown: (
|
|
742
|
-
onTouchStart: (
|
|
743
|
-
onTouchMove:
|
|
756
|
+
draggable: Pe,
|
|
757
|
+
onDragStart: (F) => Pe && C(F, j),
|
|
758
|
+
onDragEnd: w,
|
|
759
|
+
onClick: (F) => m?.(F, j),
|
|
760
|
+
onMouseDown: (F) => T?.(F, j),
|
|
761
|
+
onTouchStart: (F) => z?.(F, j),
|
|
762
|
+
onTouchMove: H,
|
|
744
763
|
onTouchEnd: B,
|
|
745
|
-
|
|
764
|
+
style: Xe,
|
|
765
|
+
className: Fe,
|
|
746
766
|
children: [
|
|
747
|
-
/* @__PURE__ */ e.jsxs(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
767
|
+
/* @__PURE__ */ e.jsxs(
|
|
768
|
+
"div",
|
|
769
|
+
{
|
|
770
|
+
className: `group relative mb-3 flex items-center justify-between ${fe && !G ? Ne : ""}`,
|
|
771
|
+
draggable: De,
|
|
772
|
+
onDragStart: (F) => De && C(F, j),
|
|
773
|
+
onDoubleClick: de ? (F) => {
|
|
774
|
+
F.stopPropagation(), se();
|
|
775
|
+
} : void 0,
|
|
776
|
+
children: [
|
|
777
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
778
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-lg text-slate-700 transition-colors group-hover:text-slate-900", children: ue }),
|
|
779
|
+
W === "custom" && /* @__PURE__ */ e.jsx("span", { className: "rounded-md bg-orange-100 px-2 py-1 font-medium text-orange-600 text-xs", children: "Custom" })
|
|
780
|
+
] }),
|
|
781
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
782
|
+
/* @__PURE__ */ e.jsx(
|
|
783
|
+
"button",
|
|
784
|
+
{
|
|
785
|
+
type: "button",
|
|
786
|
+
onClick: (F) => {
|
|
787
|
+
F.stopPropagation(), E && E(j);
|
|
788
|
+
},
|
|
789
|
+
onKeyDown: (F) => {
|
|
790
|
+
(F.key === "Enter" || F.key === " ") && (F.preventDefault(), F.stopPropagation(), E && E(j));
|
|
791
|
+
},
|
|
792
|
+
tabIndex: 0,
|
|
793
|
+
className: `cursor-pointer rounded p-1 text-xs transition-colors ${W === "custom" ? "bg-orange-100 text-orange-600 hover:bg-orange-200" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600"}`,
|
|
794
|
+
title: W === "custom" ? "通常ドラッグモードに戻す" : "カスタムドラッグモードに切り替え",
|
|
795
|
+
children: W === "custom" ? /* @__PURE__ */ e.jsx(Ve, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4" })
|
|
796
|
+
}
|
|
797
|
+
),
|
|
798
|
+
!G && /* @__PURE__ */ e.jsx(
|
|
799
|
+
"button",
|
|
800
|
+
{
|
|
801
|
+
type: "button",
|
|
802
|
+
onClick: (F) => {
|
|
803
|
+
F.stopPropagation(), s({
|
|
804
|
+
...l,
|
|
805
|
+
[j]: !1
|
|
806
|
+
});
|
|
807
|
+
},
|
|
808
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
809
|
+
title: "パネルを非表示",
|
|
810
|
+
children: /* @__PURE__ */ e.jsx(ke, { className: "h-4 w-4" })
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
de && /* @__PURE__ */ e.jsx(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
type: "button",
|
|
817
|
+
onClick: (F) => {
|
|
818
|
+
F.stopPropagation(), se();
|
|
819
|
+
},
|
|
820
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
821
|
+
title: G ? "元のサイズに戻す" : "パネルを最大化",
|
|
822
|
+
children: G ? /* @__PURE__ */ e.jsx(Ze, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Ge, { className: "h-4 w-4" })
|
|
823
|
+
}
|
|
824
|
+
),
|
|
825
|
+
A && /* @__PURE__ */ e.jsx(
|
|
826
|
+
"button",
|
|
827
|
+
{
|
|
828
|
+
type: "button",
|
|
829
|
+
onClick: (F) => {
|
|
830
|
+
F.stopPropagation(), A(j);
|
|
831
|
+
},
|
|
832
|
+
className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-red-500",
|
|
833
|
+
title: "パネルを閉じる",
|
|
834
|
+
children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4" })
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
] })
|
|
838
|
+
]
|
|
839
|
+
}
|
|
840
|
+
),
|
|
841
|
+
/* @__PURE__ */ e.jsx("div", { className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ e.jsx(ne, { ...V.props || {} }) }),
|
|
842
|
+
/* @__PURE__ */ e.jsx(ot, { config: k, panelId: j, sizeInfo: ie, onSizeInfoClick: (F) => g?.(F, j) })
|
|
788
843
|
]
|
|
789
844
|
},
|
|
790
|
-
|
|
845
|
+
j
|
|
791
846
|
)
|
|
792
847
|
);
|
|
793
|
-
},
|
|
794
|
-
const
|
|
795
|
-
let
|
|
796
|
-
for (const
|
|
797
|
-
if (l[
|
|
798
|
-
|
|
848
|
+
}, re = (j, V) => {
|
|
849
|
+
const ne = n[j] || [];
|
|
850
|
+
let ue = !1;
|
|
851
|
+
for (const W of ne)
|
|
852
|
+
if (l[W]) {
|
|
853
|
+
ue = !0;
|
|
799
854
|
break;
|
|
800
855
|
}
|
|
801
|
-
const
|
|
802
|
-
return /* @__PURE__ */ e.jsx(
|
|
856
|
+
const ae = u.isDragging || (X?.isActive ?? !1);
|
|
857
|
+
return /* @__PURE__ */ e.jsx(_e, { columnIndex: V, isDragging: ae, dragOverPosition: d, config: k, children: /* @__PURE__ */ e.jsxs(
|
|
803
858
|
"section",
|
|
804
859
|
{
|
|
805
860
|
"data-drop-zone": "true",
|
|
806
|
-
"data-column-key":
|
|
807
|
-
"data-column-index":
|
|
808
|
-
"aria-label": `Drop zone for column ${
|
|
809
|
-
onDragOver: (
|
|
810
|
-
onDrop: (
|
|
861
|
+
"data-column-key": j,
|
|
862
|
+
"data-column-index": V,
|
|
863
|
+
"aria-label": `Drop zone for column ${V + 1}`,
|
|
864
|
+
onDragOver: (W) => o(W, V),
|
|
865
|
+
onDrop: (W) => v(W, j),
|
|
811
866
|
onDragLeave: D,
|
|
812
867
|
className: "relative flex h-full flex-col transition-all duration-200",
|
|
813
868
|
children: [
|
|
814
869
|
/* @__PURE__ */ e.jsx("div", { className: "placeholder-container", children: /* @__PURE__ */ e.jsx(
|
|
815
|
-
|
|
870
|
+
je,
|
|
816
871
|
{
|
|
817
872
|
index: 0,
|
|
818
|
-
columnIndex:
|
|
819
|
-
isDragging:
|
|
873
|
+
columnIndex: V,
|
|
874
|
+
isDragging: ae,
|
|
820
875
|
dragOverPosition: d,
|
|
821
876
|
originalPosition: c,
|
|
822
|
-
onDragEnter:
|
|
823
|
-
onDragLeave:
|
|
877
|
+
onDragEnter: $,
|
|
878
|
+
onDragLeave: M,
|
|
824
879
|
debugConfig: k,
|
|
825
|
-
customDrag:
|
|
880
|
+
customDrag: X
|
|
826
881
|
}
|
|
827
882
|
) }),
|
|
828
|
-
|
|
829
|
-
const
|
|
830
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `panel-with-placeholder ${
|
|
831
|
-
|
|
883
|
+
ne.map((W, te) => {
|
|
884
|
+
const ie = l[W], G = !(ie || ae);
|
|
885
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `panel-with-placeholder ${G ? "m-0 h-0 overflow-hidden p-0" : ""}`, "data-panel-hidden": G ? "true" : void 0, "aria-hidden": G ? "true" : void 0, children: [
|
|
886
|
+
ie ? I(W) : ae ? (
|
|
832
887
|
/* ドラッグ中のみ隠されたパネルのダミー表示 */
|
|
833
888
|
/* @__PURE__ */ e.jsxs("div", { className: "hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-amber-300 border-dashed bg-gradient-to-br from-amber-50 to-orange-50 p-3 text-left shadow-lg backdrop-blur-lg", children: [
|
|
834
889
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [
|
|
835
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-amber-700 text-base", children:
|
|
890
|
+
/* @__PURE__ */ e.jsx("h3", { className: "font-semibold text-amber-700 text-base", children: Q[W]?.title || W }),
|
|
836
891
|
/* @__PURE__ */ e.jsx("span", { className: "rounded-md bg-amber-100 px-2 py-1 font-medium text-amber-600 text-xs", children: "非表示" })
|
|
837
892
|
] }),
|
|
838
893
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center text-amber-600", children: [
|
|
839
|
-
/* @__PURE__ */ e.jsx(
|
|
894
|
+
/* @__PURE__ */ e.jsx(ke, { className: "mx-auto h-6 w-6 opacity-50" }),
|
|
840
895
|
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-xs", children: "このパネルは非表示です" })
|
|
841
896
|
] }) }) })
|
|
842
897
|
] })
|
|
843
898
|
) : null,
|
|
844
899
|
/* @__PURE__ */ e.jsx(
|
|
845
|
-
|
|
900
|
+
je,
|
|
846
901
|
{
|
|
847
|
-
index:
|
|
848
|
-
columnIndex:
|
|
849
|
-
isDragging:
|
|
902
|
+
index: te + 1,
|
|
903
|
+
columnIndex: V,
|
|
904
|
+
isDragging: ae,
|
|
850
905
|
dragOverPosition: d,
|
|
851
906
|
originalPosition: c,
|
|
852
|
-
onDragEnter:
|
|
853
|
-
onDragLeave:
|
|
907
|
+
onDragEnter: $,
|
|
908
|
+
onDragLeave: M,
|
|
854
909
|
debugConfig: k,
|
|
855
|
-
customDrag:
|
|
910
|
+
customDrag: X
|
|
856
911
|
}
|
|
857
912
|
)
|
|
858
|
-
] }, `panel-${
|
|
913
|
+
] }, `panel-${W}`);
|
|
859
914
|
}),
|
|
860
|
-
!(
|
|
915
|
+
!(ue || ae) && /* @__PURE__ */ e.jsx("div", { className: "textcenter flex-shrink-0 rounded-xl border-2 border-slate-200 border-dashed bg-white/30 p-8 text-slate-400 transition-all duration-200", children: /* @__PURE__ */ e.jsx("div", { className: "text-sm", children: "このエリアは空です" }) })
|
|
861
916
|
]
|
|
862
917
|
}
|
|
863
918
|
) });
|
|
864
|
-
},
|
|
919
|
+
}, ce = Object.keys(l).filter((j) => !l[j]);
|
|
865
920
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
866
|
-
|
|
921
|
+
ce.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "border-slate-200 border-b bg-white/70 px-4 py-2 backdrop-blur-lg", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-2", children: [
|
|
867
922
|
/* @__PURE__ */ e.jsx("span", { className: "mr-2 text-slate-600 text-sm", children: "非表示のパネル:" }),
|
|
868
|
-
|
|
869
|
-
const
|
|
923
|
+
ce.map((j) => {
|
|
924
|
+
const ne = Q[j]?.title || j;
|
|
870
925
|
return /* @__PURE__ */ e.jsxs(
|
|
871
926
|
"button",
|
|
872
927
|
{
|
|
873
928
|
type: "button",
|
|
874
929
|
onClick: () => s({
|
|
875
930
|
...l,
|
|
876
|
-
[
|
|
931
|
+
[j]: !0
|
|
877
932
|
}),
|
|
878
933
|
className: "flex items-center space-x-1 rounded-lg border border-sky-300 bg-gradient-to-r from-sky-500 to-indigo-500 px-3 py-1 text-sm text-white shadow-md transition-all duration-200 hover:from-sky-600 hover:to-indigo-600 hover:shadow-lg",
|
|
879
934
|
children: [
|
|
880
|
-
/* @__PURE__ */ e.jsx(
|
|
881
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
935
|
+
/* @__PURE__ */ e.jsx(Ie, { className: "h-3 w-3" }),
|
|
936
|
+
/* @__PURE__ */ e.jsx("span", { children: ne })
|
|
882
937
|
]
|
|
883
938
|
},
|
|
884
|
-
|
|
939
|
+
j
|
|
885
940
|
);
|
|
886
941
|
})
|
|
887
942
|
] }) }),
|
|
888
|
-
/* @__PURE__ */ e.jsx("main", { className: "no-scrollbar 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((
|
|
889
|
-
const
|
|
890
|
-
return /* @__PURE__ */ e.jsx(
|
|
943
|
+
/* @__PURE__ */ e.jsx("main", { className: "no-scrollbar 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((j, V) => {
|
|
944
|
+
const ne = h?.[j.id] || j.initialWidth || 350, ue = K && (j.resizable ?? !0);
|
|
945
|
+
return /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsxs(
|
|
891
946
|
"div",
|
|
892
947
|
{
|
|
893
|
-
className: `column relative ${
|
|
894
|
-
"data-column":
|
|
895
|
-
"data-column-id":
|
|
896
|
-
"data-min-width":
|
|
897
|
-
"data-max-width":
|
|
898
|
-
"data-column-width":
|
|
899
|
-
...
|
|
900
|
-
style: { "--column-width": `${
|
|
948
|
+
className: `column relative ${j.className || ""} ${K ? "resize-enabled-column" : "auto-width-column"} ${y && i === j.id ? "column-resizing-active" : ""}`,
|
|
949
|
+
"data-column": V,
|
|
950
|
+
"data-column-id": j.id,
|
|
951
|
+
"data-min-width": j.minWidth || 350,
|
|
952
|
+
"data-max-width": j.maxWidth,
|
|
953
|
+
"data-column-width": K ? ne : void 0,
|
|
954
|
+
...K && {
|
|
955
|
+
style: { "--column-width": `${ne}px` }
|
|
901
956
|
},
|
|
902
957
|
children: [
|
|
903
|
-
|
|
904
|
-
|
|
958
|
+
re(j.key, V),
|
|
959
|
+
ue && f && b && N && /* @__PURE__ */ e.jsx(We, { columnId: j.id, onResizeStart: f, onResize: b, onResizeEnd: N, isResizing: y && i === j.id, position: "right", debug: k })
|
|
905
960
|
]
|
|
906
961
|
}
|
|
907
|
-
) },
|
|
962
|
+
) }, j.id);
|
|
908
963
|
}) }) })
|
|
909
964
|
] });
|
|
910
|
-
},
|
|
911
|
-
const C = r > s && !c,
|
|
965
|
+
}, bt = ({ columnCount: r, onColumnCountChange: t, onAutoBalance: n, onResetWidths: l, minColumns: s = 2, maxColumns: u = 6, isResizing: d = !1, isResponsiveMode: c = !1, responsiveColumnCount: p }) => {
|
|
966
|
+
const C = r > s && !c, w = r < u && !c;
|
|
912
967
|
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: [
|
|
913
968
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
914
969
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-slate-700 text-sm", children: "カラム数:" }),
|
|
@@ -920,22 +975,22 @@ const et = ({
|
|
|
920
975
|
disabled: !C || d,
|
|
921
976
|
className: `rounded p-1 text-xs transition-colors ${C && !d ? "border border-slate-300 text-slate-600 hover:border-red-300 hover:bg-red-50 hover:text-red-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
|
|
922
977
|
title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを削除 (最小: ${s}列)`,
|
|
923
|
-
children: /* @__PURE__ */ e.jsx(
|
|
978
|
+
children: /* @__PURE__ */ e.jsx(Je, { className: "h-3 w-3" })
|
|
924
979
|
}
|
|
925
980
|
),
|
|
926
981
|
/* @__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: [
|
|
927
|
-
c ?
|
|
982
|
+
c ? p ?? r : r,
|
|
928
983
|
c && /* @__PURE__ */ e.jsx("span", { className: "ml-1 text-xs", children: "自動" })
|
|
929
984
|
] }),
|
|
930
985
|
/* @__PURE__ */ e.jsx(
|
|
931
986
|
"button",
|
|
932
987
|
{
|
|
933
988
|
type: "button",
|
|
934
|
-
onClick: () =>
|
|
935
|
-
disabled: !
|
|
936
|
-
className: `rounded p-1 text-xs transition-colors ${
|
|
989
|
+
onClick: () => w && t(r + 1),
|
|
990
|
+
disabled: !w || d,
|
|
991
|
+
className: `rounded p-1 text-xs transition-colors ${w && !d ? "border border-slate-300 text-slate-600 hover:border-blue-300 hover:bg-blue-50 hover:text-blue-600" : "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300"}`,
|
|
937
992
|
title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを追加 (最大: ${u}列)`,
|
|
938
|
-
children: /* @__PURE__ */ e.jsx(
|
|
993
|
+
children: /* @__PURE__ */ e.jsx(we, { className: "h-3 w-3" })
|
|
939
994
|
}
|
|
940
995
|
)
|
|
941
996
|
] }),
|
|
@@ -950,7 +1005,7 @@ const et = ({
|
|
|
950
1005
|
className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${d ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-green-300 hover:bg-green-50 hover:text-green-600"}`,
|
|
951
1006
|
title: "パネルを全カラムに均等分散",
|
|
952
1007
|
children: [
|
|
953
|
-
/* @__PURE__ */ e.jsx(
|
|
1008
|
+
/* @__PURE__ */ e.jsx(Qe, { className: "h-3 w-3" }),
|
|
954
1009
|
/* @__PURE__ */ e.jsx("span", { children: "バランス" })
|
|
955
1010
|
]
|
|
956
1011
|
}
|
|
@@ -964,7 +1019,7 @@ const et = ({
|
|
|
964
1019
|
className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${d ? "cursor-not-allowed border border-slate-200 bg-slate-50 text-slate-300" : "border border-slate-300 text-slate-600 hover:border-orange-300 hover:bg-orange-50 hover:text-orange-600"}`,
|
|
965
1020
|
title: "カラム幅を初期値にリセット",
|
|
966
1021
|
children: [
|
|
967
|
-
/* @__PURE__ */ e.jsx(
|
|
1022
|
+
/* @__PURE__ */ e.jsx(Ke, { className: "h-3 w-3" }),
|
|
968
1023
|
/* @__PURE__ */ e.jsx("span", { children: "幅リセット" })
|
|
969
1024
|
]
|
|
970
1025
|
}
|
|
@@ -975,8 +1030,8 @@ const et = ({
|
|
|
975
1030
|
/* @__PURE__ */ e.jsx("span", { children: "リサイズ中..." })
|
|
976
1031
|
] })
|
|
977
1032
|
] });
|
|
978
|
-
},
|
|
979
|
-
const c = r < s && !d,
|
|
1033
|
+
}, vt = ({ columnCount: r, onInsertColumn: t, onDeleteColumn: n, minColumns: l = 1, maxColumns: s = 6, isResizing: u = !1, disabled: d = !1 }) => {
|
|
1034
|
+
const c = r < s && !d, p = r > l && !d;
|
|
980
1035
|
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 ${d ? "bg-slate-100/80 opacity-60" : "bg-white/80"}`, children: [
|
|
981
1036
|
d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ e.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
|
|
982
1037
|
!d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -988,22 +1043,22 @@ const et = ({
|
|
|
988
1043
|
disabled: !c || u,
|
|
989
1044
|
className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${c && !u ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
|
|
990
1045
|
title: "この位置に新しいカラムを挿入",
|
|
991
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1046
|
+
children: /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" })
|
|
992
1047
|
}
|
|
993
1048
|
),
|
|
994
|
-
Array.from({ length: r }, (C,
|
|
1049
|
+
Array.from({ length: r }, (C, w) => (
|
|
995
1050
|
// biome-ignore lint/suspicious/noArrayIndexKey: 表示目的の単純なリスト
|
|
996
1051
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
997
1052
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
|
|
998
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children:
|
|
999
|
-
|
|
1053
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: w + 1 }),
|
|
1054
|
+
p && !u && /* @__PURE__ */ e.jsx(
|
|
1000
1055
|
"button",
|
|
1001
1056
|
{
|
|
1002
1057
|
type: "button",
|
|
1003
|
-
onClick: () => n(
|
|
1058
|
+
onClick: () => n(w),
|
|
1004
1059
|
className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-red-300 bg-red-100 text-red-600 hover:bg-red-200",
|
|
1005
|
-
title: `カラム ${
|
|
1006
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1060
|
+
title: `カラム ${w + 1} を削除`,
|
|
1061
|
+
children: /* @__PURE__ */ e.jsx(Re, { className: "h-2.5 w-2.5" })
|
|
1007
1062
|
}
|
|
1008
1063
|
)
|
|
1009
1064
|
] }),
|
|
@@ -1011,18 +1066,18 @@ const et = ({
|
|
|
1011
1066
|
"button",
|
|
1012
1067
|
{
|
|
1013
1068
|
type: "button",
|
|
1014
|
-
onClick: () => c && t(
|
|
1069
|
+
onClick: () => c && t(w + 1),
|
|
1015
1070
|
disabled: !c || u,
|
|
1016
1071
|
className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${c && !u ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
|
|
1017
1072
|
title: "この位置に新しいカラムを挿入",
|
|
1018
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1073
|
+
children: /* @__PURE__ */ e.jsx(we, { className: "h-4 w-4" })
|
|
1019
1074
|
}
|
|
1020
1075
|
)
|
|
1021
|
-
] }, `column-${
|
|
1076
|
+
] }, `column-${w}`)
|
|
1022
1077
|
))
|
|
1023
1078
|
] })
|
|
1024
1079
|
] });
|
|
1025
|
-
},
|
|
1080
|
+
}, wt = ({ config: r, onConfigChange: t, isVisible: n, onToggleVisibility: l }) => n ? /* @__PURE__ */ e.jsxs("div", { className: "fixed right-4 bottom-4 z-50 max-w-sm rounded-lg border border-gray-300 bg-white p-4 shadow-xl", children: [
|
|
1026
1081
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
1027
1082
|
/* @__PURE__ */ e.jsx("h3", { className: "font-bold text-gray-800 text-sm", children: "🛠️ デバッグ設定" }),
|
|
1028
1083
|
/* @__PURE__ */ e.jsx("button", { type: "button", onClick: l, className: "text-gray-500 text-lg hover:text-gray-700", title: "閉じる", children: "✕" })
|
|
@@ -1165,47 +1220,47 @@ const et = ({
|
|
|
1165
1220
|
)
|
|
1166
1221
|
] })
|
|
1167
1222
|
] })
|
|
1168
|
-
] }) : /* @__PURE__ */ e.jsx("button", { type: "button", onClick: l, className: "fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700", title: "デバッグ設定を開く", children: "🛠️" }),
|
|
1223
|
+
] }) : /* @__PURE__ */ e.jsx("button", { type: "button", onClick: l, className: "fixed right-4 bottom-4 z-50 rounded-lg bg-gray-800 p-2 text-white shadow-lg transition-colors hover:bg-gray-700", title: "デバッグ設定を開く", children: "🛠️" }), le = {
|
|
1169
1224
|
prefix: "column",
|
|
1170
1225
|
startIndex: 1,
|
|
1171
1226
|
separator: "_"
|
|
1172
|
-
},
|
|
1227
|
+
}, pe = (r, t = le) => {
|
|
1173
1228
|
const { prefix: n, startIndex: l, separator: s } = t, u = r + l;
|
|
1174
1229
|
return `${n}${s}${u}`;
|
|
1175
|
-
},
|
|
1230
|
+
}, ze = (r, t = le) => Array.from({ length: r }, (n, l) => pe(l, t)), be = (r, t = le) => {
|
|
1176
1231
|
const { prefix: n, startIndex: l, separator: s } = t, u = `${n}${s}`;
|
|
1177
1232
|
if (!r.startsWith(u))
|
|
1178
1233
|
return null;
|
|
1179
1234
|
const d = r.slice(u.length), c = parseInt(d, 10);
|
|
1180
1235
|
return Number.isNaN(c) || c < l ? null : c - l;
|
|
1181
|
-
},
|
|
1182
|
-
const n = r.map((l) =>
|
|
1236
|
+
}, yt = (r, t = le) => be(r, t) !== null, jt = (r, t = le) => {
|
|
1237
|
+
const n = r.map((l) => be(l, t)).filter((l) => l !== null).sort((l, s) => l - s);
|
|
1183
1238
|
for (let l = 0; l < n.length; l++)
|
|
1184
1239
|
if (n[l] !== l)
|
|
1185
|
-
return
|
|
1186
|
-
return
|
|
1187
|
-
},
|
|
1188
|
-
const s =
|
|
1240
|
+
return pe(l, t);
|
|
1241
|
+
return pe(n.length, t);
|
|
1242
|
+
}, lt = (r, t = le) => r.sort((n, l) => {
|
|
1243
|
+
const s = be(n, t) ?? -1, u = be(l, t) ?? -1;
|
|
1189
1244
|
return s - u;
|
|
1190
|
-
}),
|
|
1245
|
+
}), Pt = (r, t = le) => {
|
|
1191
1246
|
const n = {};
|
|
1192
1247
|
return r.forEach((l, s) => {
|
|
1193
|
-
const u =
|
|
1248
|
+
const u = pe(s, t);
|
|
1194
1249
|
n[l] = u;
|
|
1195
1250
|
}), n;
|
|
1196
|
-
},
|
|
1251
|
+
}, at = (r, t, n = le) => {
|
|
1197
1252
|
const l = [];
|
|
1198
1253
|
Object.values(r).forEach((d) => {
|
|
1199
1254
|
l.push(...d);
|
|
1200
1255
|
});
|
|
1201
|
-
const s = {}, u =
|
|
1256
|
+
const s = {}, u = ze(t, n);
|
|
1202
1257
|
return u.forEach((d) => {
|
|
1203
1258
|
s[d] = [];
|
|
1204
1259
|
}), l.forEach((d, c) => {
|
|
1205
|
-
const
|
|
1260
|
+
const p = c % t, C = u[p];
|
|
1206
1261
|
s[C].push(d);
|
|
1207
1262
|
}), s;
|
|
1208
|
-
},
|
|
1263
|
+
}, Dt = ({ initialColumns: r, initialPanels: t, debug: n = {}, onLayoutChange: l }) => {
|
|
1209
1264
|
const [s, u] = ee(() => {
|
|
1210
1265
|
const h = {};
|
|
1211
1266
|
for (const f of r)
|
|
@@ -1218,24 +1273,24 @@ const et = ({
|
|
|
1218
1273
|
columnPanels: t,
|
|
1219
1274
|
showInsertPlaceholders: !1
|
|
1220
1275
|
};
|
|
1221
|
-
}), d =
|
|
1222
|
-
|
|
1276
|
+
}), d = Y(0), c = Y(0);
|
|
1277
|
+
J(() => {
|
|
1223
1278
|
l?.(s);
|
|
1224
1279
|
}, [s, l]);
|
|
1225
|
-
const
|
|
1280
|
+
const p = P(
|
|
1226
1281
|
(h, f) => {
|
|
1227
|
-
S(n, 1, "カラム追加:", h.id, "at position:", f), u((
|
|
1228
|
-
const N = [...
|
|
1229
|
-
N.splice(
|
|
1282
|
+
S(n, 1, "カラム追加:", h.id, "at position:", f), u((b) => {
|
|
1283
|
+
const N = [...b.columns], y = f ?? N.length;
|
|
1284
|
+
N.splice(y, 0, h);
|
|
1230
1285
|
const i = {
|
|
1231
|
-
...
|
|
1286
|
+
...b.columnWidths,
|
|
1232
1287
|
[h.id]: h.initialWidth || 400
|
|
1233
1288
|
}, g = {
|
|
1234
|
-
...
|
|
1289
|
+
...b.columnPanels,
|
|
1235
1290
|
[h.id]: []
|
|
1236
1291
|
};
|
|
1237
1292
|
return {
|
|
1238
|
-
...
|
|
1293
|
+
...b,
|
|
1239
1294
|
columns: N,
|
|
1240
1295
|
columnWidths: i,
|
|
1241
1296
|
columnPanels: g
|
|
@@ -1246,11 +1301,11 @@ const et = ({
|
|
|
1246
1301
|
), C = P(
|
|
1247
1302
|
(h) => {
|
|
1248
1303
|
S(n, 1, "カラム削除:", h), u((f) => {
|
|
1249
|
-
const
|
|
1304
|
+
const b = f.columnPanels[h] || [], N = f.columns.filter((E) => E.id !== h);
|
|
1250
1305
|
if (N.length === 0)
|
|
1251
1306
|
return S(n, 1, "警告: 最後のカラムを削除しようとしています"), f;
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1307
|
+
const y = N[0].id, i = { ...f.columnPanels };
|
|
1308
|
+
b.length > 0 && (i[y] = [...i[y], ...b]), delete i[h];
|
|
1254
1309
|
const g = { ...f.columnWidths };
|
|
1255
1310
|
return delete g[h], {
|
|
1256
1311
|
...f,
|
|
@@ -1261,36 +1316,36 @@ const et = ({
|
|
|
1261
1316
|
});
|
|
1262
1317
|
},
|
|
1263
1318
|
[n]
|
|
1264
|
-
),
|
|
1319
|
+
), w = P(
|
|
1265
1320
|
(h, f) => {
|
|
1266
|
-
S(n, 1, "カラム移動:", h, "->", f), u((
|
|
1267
|
-
const N = [...
|
|
1268
|
-
return N.splice(f, 0,
|
|
1269
|
-
...
|
|
1321
|
+
S(n, 1, "カラム移動:", h, "->", f), u((b) => {
|
|
1322
|
+
const N = [...b.columns], [y] = N.splice(h, 1);
|
|
1323
|
+
return N.splice(f, 0, y), {
|
|
1324
|
+
...b,
|
|
1270
1325
|
columns: N
|
|
1271
1326
|
};
|
|
1272
1327
|
});
|
|
1273
1328
|
},
|
|
1274
1329
|
[n]
|
|
1275
|
-
),
|
|
1330
|
+
), $ = P(
|
|
1276
1331
|
(h, f) => {
|
|
1277
|
-
S(n, 2, "リサイズ開始:", h, "at X:", f), d.current = f, c.current = s.columnWidths[h] || 300, u((
|
|
1278
|
-
...
|
|
1332
|
+
S(n, 2, "リサイズ開始:", h, "at X:", f), d.current = f, c.current = s.columnWidths[h] || 300, u((b) => ({
|
|
1333
|
+
...b,
|
|
1279
1334
|
isResizing: !0,
|
|
1280
1335
|
resizingColumn: h
|
|
1281
1336
|
}));
|
|
1282
1337
|
},
|
|
1283
1338
|
[n, s.columnWidths]
|
|
1284
|
-
),
|
|
1339
|
+
), M = P(
|
|
1285
1340
|
(h) => {
|
|
1286
|
-
const { resizingColumn: f, isResizing:
|
|
1287
|
-
if (!(
|
|
1288
|
-
const N = h - d.current,
|
|
1289
|
-
S(n, 2, "リサイズ中:", f, "new width:",
|
|
1341
|
+
const { resizingColumn: f, isResizing: b } = s;
|
|
1342
|
+
if (!(b && f)) return;
|
|
1343
|
+
const N = h - d.current, y = Math.max(100, Math.min(800, c.current + N));
|
|
1344
|
+
S(n, 2, "リサイズ中:", f, "new width:", y), u((i) => ({
|
|
1290
1345
|
...i,
|
|
1291
1346
|
columnWidths: {
|
|
1292
1347
|
...i.columnWidths,
|
|
1293
|
-
[f]:
|
|
1348
|
+
[f]: y
|
|
1294
1349
|
}
|
|
1295
1350
|
}));
|
|
1296
1351
|
},
|
|
@@ -1301,12 +1356,12 @@ const et = ({
|
|
|
1301
1356
|
isResizing: !1,
|
|
1302
1357
|
resizingColumn: null
|
|
1303
1358
|
}));
|
|
1304
|
-
}, [n]),
|
|
1359
|
+
}, [n]), v = P(
|
|
1305
1360
|
(h, f) => {
|
|
1306
|
-
S(n, 2, "カラム幅設定:", h, f), u((
|
|
1307
|
-
...
|
|
1361
|
+
S(n, 2, "カラム幅設定:", h, f), u((b) => ({
|
|
1362
|
+
...b,
|
|
1308
1363
|
columnWidths: {
|
|
1309
|
-
...
|
|
1364
|
+
...b.columnWidths,
|
|
1310
1365
|
[h]: Math.max(100, Math.min(800, f))
|
|
1311
1366
|
}
|
|
1312
1367
|
}));
|
|
@@ -1315,78 +1370,78 @@ const et = ({
|
|
|
1315
1370
|
), D = P(() => {
|
|
1316
1371
|
S(n, 1, "カラム幅リセット"), u((h) => {
|
|
1317
1372
|
const f = {};
|
|
1318
|
-
for (const
|
|
1319
|
-
f[
|
|
1373
|
+
for (const b of h.columns)
|
|
1374
|
+
f[b.id] = b.initialWidth || 400;
|
|
1320
1375
|
return {
|
|
1321
1376
|
...h,
|
|
1322
1377
|
columnWidths: f
|
|
1323
1378
|
};
|
|
1324
1379
|
});
|
|
1325
1380
|
}, [n]), m = P(
|
|
1326
|
-
(h, f,
|
|
1327
|
-
S(n, 1, "パネル移動:", h, "from", f, "to",
|
|
1328
|
-
const i = { ...
|
|
1329
|
-
if (f in i && (i[f] = i[f].filter((g) => g !== h)),
|
|
1330
|
-
const g = [...i[
|
|
1331
|
-
g.splice(N, 0, h), i[
|
|
1381
|
+
(h, f, b, N) => {
|
|
1382
|
+
S(n, 1, "パネル移動:", h, "from", f, "to", b, "at", N), u((y) => {
|
|
1383
|
+
const i = { ...y.columnPanels };
|
|
1384
|
+
if (f in i && (i[f] = i[f].filter((g) => g !== h)), b in i) {
|
|
1385
|
+
const g = [...i[b]];
|
|
1386
|
+
g.splice(N, 0, h), i[b] = g;
|
|
1332
1387
|
}
|
|
1333
1388
|
return {
|
|
1334
|
-
...
|
|
1389
|
+
...y,
|
|
1335
1390
|
columnPanels: i
|
|
1336
1391
|
};
|
|
1337
1392
|
});
|
|
1338
1393
|
},
|
|
1339
1394
|
[n]
|
|
1340
|
-
),
|
|
1341
|
-
(h, f,
|
|
1395
|
+
), T = P(
|
|
1396
|
+
(h, f, b) => {
|
|
1342
1397
|
S(n, 1, "パネル追加:", h, "to column:", f), u((N) => {
|
|
1343
|
-
const
|
|
1344
|
-
f in
|
|
1345
|
-
const i = [...
|
|
1346
|
-
return i.splice(g, 0, h),
|
|
1398
|
+
const y = { ...N.columnPanels };
|
|
1399
|
+
f in y || (y[f] = []);
|
|
1400
|
+
const i = [...y[f]], g = b ?? i.length;
|
|
1401
|
+
return i.splice(g, 0, h), y[f] = i, {
|
|
1347
1402
|
...N,
|
|
1348
|
-
columnPanels:
|
|
1403
|
+
columnPanels: y
|
|
1349
1404
|
};
|
|
1350
1405
|
});
|
|
1351
1406
|
},
|
|
1352
1407
|
[n]
|
|
1353
|
-
),
|
|
1408
|
+
), z = P(
|
|
1354
1409
|
(h) => {
|
|
1355
1410
|
S(n, 1, "パネル削除:", h), u((f) => {
|
|
1356
|
-
const
|
|
1357
|
-
for (const [N,
|
|
1358
|
-
|
|
1411
|
+
const b = {};
|
|
1412
|
+
for (const [N, y] of Object.entries(f.columnPanels))
|
|
1413
|
+
b[N] = y.filter((i) => i !== h);
|
|
1359
1414
|
return {
|
|
1360
1415
|
...f,
|
|
1361
|
-
columnPanels:
|
|
1416
|
+
columnPanels: b
|
|
1362
1417
|
};
|
|
1363
1418
|
});
|
|
1364
1419
|
},
|
|
1365
1420
|
[n]
|
|
1366
|
-
),
|
|
1421
|
+
), H = P(
|
|
1367
1422
|
(h) => {
|
|
1368
1423
|
S(n, 1, "カラム数更新:", h), u((f) => {
|
|
1369
|
-
const
|
|
1370
|
-
if (h ===
|
|
1371
|
-
const N =
|
|
1424
|
+
const b = f.columns.length;
|
|
1425
|
+
if (h === b) return f;
|
|
1426
|
+
const N = at(f.columnPanels, h, le), y = ze(h, le), i = f.isResizing && f.resizingColumn && !y.includes(f.resizingColumn);
|
|
1372
1427
|
i && S(n, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", f.resizingColumn);
|
|
1373
|
-
const g =
|
|
1374
|
-
id:
|
|
1375
|
-
title: `カラム ${
|
|
1428
|
+
const g = y.map((X, U) => ({
|
|
1429
|
+
id: X,
|
|
1430
|
+
title: `カラム ${U + 1}`,
|
|
1376
1431
|
minWidth: 350,
|
|
1377
1432
|
maxWidth: 800,
|
|
1378
1433
|
initialWidth: 400,
|
|
1379
|
-
resizable: !(
|
|
1434
|
+
resizable: !(U === 1 && h === 3)
|
|
1380
1435
|
})), E = {};
|
|
1381
|
-
if (Object.entries(f.columnWidths).some(([,
|
|
1382
|
-
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1436
|
+
if (Object.entries(f.columnWidths).some(([, X]) => X !== 400))
|
|
1437
|
+
y.forEach((X) => {
|
|
1438
|
+
const U = f.columnWidths[X];
|
|
1439
|
+
U && U !== 400 ? E[X] = U : E[X] = 400;
|
|
1385
1440
|
});
|
|
1386
1441
|
else {
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
E[a] =
|
|
1442
|
+
const X = b > h ? Object.values(f.columnWidths).reduce((a, x) => a + x, 0) : h * 400, U = Math.max(X / h, 350);
|
|
1443
|
+
y.forEach((a) => {
|
|
1444
|
+
E[a] = U;
|
|
1390
1445
|
});
|
|
1391
1446
|
}
|
|
1392
1447
|
return {
|
|
@@ -1403,31 +1458,31 @@ const et = ({
|
|
|
1403
1458
|
), B = P(() => {
|
|
1404
1459
|
S(n, 1, "カラム自動バランス調整"), u((h) => {
|
|
1405
1460
|
const f = [];
|
|
1406
|
-
for (const
|
|
1407
|
-
for (const i of h.columnPanels[
|
|
1461
|
+
for (const y of Object.keys(h.columnPanels))
|
|
1462
|
+
for (const i of h.columnPanels[y])
|
|
1408
1463
|
f.push(i);
|
|
1409
|
-
const
|
|
1410
|
-
for (const
|
|
1411
|
-
|
|
1464
|
+
const b = {};
|
|
1465
|
+
for (const y of h.columns)
|
|
1466
|
+
b[y.id] = [];
|
|
1412
1467
|
let N = 0;
|
|
1413
|
-
for (const
|
|
1468
|
+
for (const y of f) {
|
|
1414
1469
|
const i = h.columns[N % h.columns.length].id;
|
|
1415
|
-
|
|
1470
|
+
b[i].push(y), N += 1;
|
|
1416
1471
|
}
|
|
1417
1472
|
return {
|
|
1418
1473
|
...h,
|
|
1419
|
-
columnPanels:
|
|
1474
|
+
columnPanels: b
|
|
1420
1475
|
};
|
|
1421
1476
|
});
|
|
1422
1477
|
}, [n]), k = P(
|
|
1423
1478
|
(h) => s.columns.find((f) => f.id === h),
|
|
1424
1479
|
[s.columns]
|
|
1425
|
-
),
|
|
1480
|
+
), q = P(() => {
|
|
1426
1481
|
let h = 0;
|
|
1427
1482
|
for (const f of Object.values(s.columnWidths))
|
|
1428
1483
|
h += f;
|
|
1429
1484
|
return h;
|
|
1430
|
-
}, [s.columnWidths]),
|
|
1485
|
+
}, [s.columnWidths]), L = P((h) => document.querySelector(`[data-column-id="${h}"]`), []), K = P((h) => {
|
|
1431
1486
|
u((f) => ({
|
|
1432
1487
|
...f,
|
|
1433
1488
|
showInsertPlaceholders: h
|
|
@@ -1435,56 +1490,56 @@ const et = ({
|
|
|
1435
1490
|
}, []);
|
|
1436
1491
|
return {
|
|
1437
1492
|
layoutState: s,
|
|
1438
|
-
addColumn:
|
|
1493
|
+
addColumn: p,
|
|
1439
1494
|
removeColumn: C,
|
|
1440
|
-
moveColumn:
|
|
1441
|
-
startResize:
|
|
1442
|
-
handleResize:
|
|
1495
|
+
moveColumn: w,
|
|
1496
|
+
startResize: $,
|
|
1497
|
+
handleResize: M,
|
|
1443
1498
|
endResize: o,
|
|
1444
|
-
setColumnWidth:
|
|
1499
|
+
setColumnWidth: v,
|
|
1445
1500
|
resetColumnWidths: D,
|
|
1446
1501
|
movePanel: m,
|
|
1447
|
-
addPanel:
|
|
1448
|
-
removePanel:
|
|
1449
|
-
updateColumnCount:
|
|
1502
|
+
addPanel: T,
|
|
1503
|
+
removePanel: z,
|
|
1504
|
+
updateColumnCount: H,
|
|
1450
1505
|
autoBalanceColumns: B,
|
|
1451
1506
|
getColumnById: k,
|
|
1452
|
-
getTotalWidth:
|
|
1453
|
-
getColumnElement:
|
|
1454
|
-
setShowInsertPlaceholders:
|
|
1507
|
+
getTotalWidth: q,
|
|
1508
|
+
getColumnElement: L,
|
|
1509
|
+
setShowInsertPlaceholders: K
|
|
1455
1510
|
};
|
|
1456
|
-
},
|
|
1511
|
+
}, ve = {
|
|
1457
1512
|
triggerDistance: 80,
|
|
1458
1513
|
scrollSpeed: 5,
|
|
1459
1514
|
maxScrollSpeed: 20
|
|
1460
|
-
},
|
|
1515
|
+
}, Me = (r, t, n = ve, l) => {
|
|
1461
1516
|
const { triggerDistance: s, scrollSpeed: u, maxScrollSpeed: d } = n;
|
|
1462
1517
|
let c;
|
|
1463
1518
|
l ? c = l.getBoundingClientRect() : c = new DOMRect(0, 0, window.innerWidth, window.innerHeight);
|
|
1464
|
-
const { left:
|
|
1465
|
-
let
|
|
1466
|
-
if (r >=
|
|
1467
|
-
if (r <
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
} else if (r >
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1519
|
+
const { left: p, top: C, right: w, bottom: $ } = c;
|
|
1520
|
+
let M = 0, o = 0;
|
|
1521
|
+
if (r >= p && r <= w && t >= C && t <= $) {
|
|
1522
|
+
if (r < p + s) {
|
|
1523
|
+
const v = Math.max(0, (p + s - r) / s);
|
|
1524
|
+
M = -Math.min(d, u + v * (d - u));
|
|
1525
|
+
} else if (r > w - s) {
|
|
1526
|
+
const v = Math.max(0, (r - (w - s)) / s);
|
|
1527
|
+
M = Math.min(d, u + v * (d - u));
|
|
1473
1528
|
}
|
|
1474
1529
|
if (t < C + s) {
|
|
1475
|
-
const
|
|
1476
|
-
o = -Math.min(d, u +
|
|
1477
|
-
} else if (t >
|
|
1478
|
-
const
|
|
1479
|
-
o = Math.min(d, u +
|
|
1530
|
+
const v = Math.max(0, (C + s - t) / s);
|
|
1531
|
+
o = -Math.min(d, u + v * (d - u));
|
|
1532
|
+
} else if (t > $ - s) {
|
|
1533
|
+
const v = Math.max(0, (t - ($ - s)) / s);
|
|
1534
|
+
o = Math.min(d, u + v * (d - u));
|
|
1480
1535
|
}
|
|
1481
1536
|
}
|
|
1482
|
-
return { x:
|
|
1483
|
-
},
|
|
1537
|
+
return { x: M, y: o };
|
|
1538
|
+
}, it = (r, t) => {
|
|
1484
1539
|
(r.x !== 0 || r.y !== 0) && (t ? t.scrollBy(r.x, r.y) : window.scrollBy(r.x, r.y));
|
|
1485
1540
|
};
|
|
1486
|
-
class
|
|
1487
|
-
constructor(t =
|
|
1541
|
+
class Ye {
|
|
1542
|
+
constructor(t = ve, n) {
|
|
1488
1543
|
this.intervalId = null, this.isActive = !1, this.config = t, this.scrollElement = n;
|
|
1489
1544
|
}
|
|
1490
1545
|
setScrollElement(t) {
|
|
@@ -1492,12 +1547,12 @@ class Ee {
|
|
|
1492
1547
|
}
|
|
1493
1548
|
start(t, n) {
|
|
1494
1549
|
this.isActive || (this.isActive = !0, this.intervalId = window.setInterval(() => {
|
|
1495
|
-
const l =
|
|
1496
|
-
|
|
1550
|
+
const l = Me(t, n, this.config, this.scrollElement);
|
|
1551
|
+
it(l, this.scrollElement);
|
|
1497
1552
|
}, 16));
|
|
1498
1553
|
}
|
|
1499
1554
|
update(t, n) {
|
|
1500
|
-
const l =
|
|
1555
|
+
const l = Me(t, n, this.config, this.scrollElement);
|
|
1501
1556
|
(l.x !== 0 || l.y !== 0) && !this.isActive ? this.start(t, n) : l.x === 0 && l.y === 0 && this.isActive && this.stop();
|
|
1502
1557
|
}
|
|
1503
1558
|
stop() {
|
|
@@ -1510,7 +1565,7 @@ class Ee {
|
|
|
1510
1565
|
this.config = t;
|
|
1511
1566
|
}
|
|
1512
1567
|
}
|
|
1513
|
-
const
|
|
1568
|
+
const ct = ({
|
|
1514
1569
|
debugConfig: r,
|
|
1515
1570
|
dragState: t,
|
|
1516
1571
|
customDrag: n,
|
|
@@ -1519,78 +1574,78 @@ const Ue = ({
|
|
|
1519
1574
|
isMouseDown: u,
|
|
1520
1575
|
dragOverPosition: d,
|
|
1521
1576
|
setCustomDrag: c,
|
|
1522
|
-
setDragState:
|
|
1577
|
+
setDragState: p,
|
|
1523
1578
|
setDragOverPosition: C,
|
|
1524
|
-
setOriginalPanelPosition:
|
|
1525
|
-
setClickState:
|
|
1526
|
-
setIsMouseDown:
|
|
1579
|
+
setOriginalPanelPosition: w,
|
|
1580
|
+
setClickState: $,
|
|
1581
|
+
setIsMouseDown: M,
|
|
1527
1582
|
findPanelPosition: o,
|
|
1528
|
-
performPanelMove:
|
|
1583
|
+
performPanelMove: v,
|
|
1529
1584
|
showMousePosition: D,
|
|
1530
1585
|
updateMousePosition: m,
|
|
1531
|
-
recordMouseDown:
|
|
1532
|
-
recordClickPosition:
|
|
1533
|
-
isVirtualClick:
|
|
1586
|
+
recordMouseDown: T,
|
|
1587
|
+
recordClickPosition: z,
|
|
1588
|
+
isVirtualClick: H,
|
|
1534
1589
|
calculateMoveDistance: B,
|
|
1535
1590
|
clearMouseTracking: k,
|
|
1536
|
-
resetDragState:
|
|
1537
|
-
resetClickState:
|
|
1538
|
-
createDragImage:
|
|
1591
|
+
resetDragState: q,
|
|
1592
|
+
resetClickState: L,
|
|
1593
|
+
createDragImage: K,
|
|
1539
1594
|
updateDragImagePosition: h,
|
|
1540
1595
|
removeDragImage: f,
|
|
1541
|
-
handlePlaceholderDragEnter:
|
|
1596
|
+
handlePlaceholderDragEnter: b,
|
|
1542
1597
|
handlePlaceholderDragLeave: N
|
|
1543
1598
|
}) => {
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
const i =
|
|
1547
|
-
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1599
|
+
const y = Y(r);
|
|
1600
|
+
y.current = r;
|
|
1601
|
+
const i = Y(null), g = Y(null), E = Y(0), A = Y(new Ye(ve));
|
|
1602
|
+
J(() => {
|
|
1603
|
+
const x = document.querySelector("main.max-w-full.flex-1.overflow-auto");
|
|
1604
|
+
x && A.current.setScrollElement(x);
|
|
1550
1605
|
}, []);
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1553
|
-
|
|
1606
|
+
const _ = Y(d);
|
|
1607
|
+
J(() => {
|
|
1608
|
+
_.current = d, S(y.current, 2, "dragOverPositionRef更新:", d);
|
|
1554
1609
|
}, [d]);
|
|
1555
|
-
const
|
|
1556
|
-
(
|
|
1610
|
+
const X = P(
|
|
1611
|
+
(x) => {
|
|
1557
1612
|
if (n.isActive || l.isClicked) {
|
|
1558
|
-
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1613
|
+
x.preventDefault();
|
|
1614
|
+
const O = window.getSelection();
|
|
1615
|
+
O && O.rangeCount > 0 && O.removeAllRanges();
|
|
1561
1616
|
}
|
|
1562
1617
|
if (n.isActive) {
|
|
1563
|
-
m(
|
|
1564
|
-
const
|
|
1565
|
-
if (
|
|
1618
|
+
m(x.clientX, x.clientY), h(x.clientX, x.clientY), A.current.update(x.clientX, x.clientY);
|
|
1619
|
+
const O = document.elementFromPoint(x.clientX, x.clientY), R = O?.closest("[data-drop-zone]");
|
|
1620
|
+
if (R) {
|
|
1566
1621
|
document.body.classList.add("droppable");
|
|
1567
|
-
const
|
|
1568
|
-
|
|
1569
|
-
const
|
|
1570
|
-
if (
|
|
1571
|
-
const
|
|
1572
|
-
if (
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1622
|
+
const Z = R.getAttribute("data-column-index"), Q = Z ? parseInt(Z, 10) : null;
|
|
1623
|
+
Q !== null && Q !== t.dragOverColumn && p((re) => ({ ...re, dragOverColumn: Q }));
|
|
1624
|
+
const I = O?.closest("[data-placeholder-index]");
|
|
1625
|
+
if (I) {
|
|
1626
|
+
const re = I.getAttribute("data-placeholder-index"), ce = I.getAttribute("data-placeholder-column");
|
|
1627
|
+
if (re && ce) {
|
|
1628
|
+
const j = parseInt(re, 10), V = parseInt(ce, 10);
|
|
1629
|
+
b(V, j);
|
|
1575
1630
|
}
|
|
1576
1631
|
} else
|
|
1577
1632
|
N();
|
|
1578
1633
|
} else
|
|
1579
|
-
document.body.classList.remove("droppable"), C(null),
|
|
1634
|
+
document.body.classList.remove("droppable"), C(null), p((Z) => ({ ...Z, dragOverColumn: null }));
|
|
1580
1635
|
} else if (u && l.isClicked && l.panelId) {
|
|
1581
|
-
if (s[l.panelId] !== "custom" || B(
|
|
1582
|
-
S(
|
|
1583
|
-
const
|
|
1584
|
-
if (
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1636
|
+
if (s[l.panelId] !== "custom" || B(x.clientX, x.clientY) < 10) return;
|
|
1637
|
+
S(y.current, 1, "🚀 カスタムドラッグ開始 -", l.panelId);
|
|
1638
|
+
const R = document.querySelector(`[data-panel-id="${l.panelId}"]`);
|
|
1639
|
+
if (R && g.current) {
|
|
1640
|
+
const Z = R.getBoundingClientRect(), Q = g.current.x - Z.left, I = g.current.y - Z.top;
|
|
1641
|
+
K(l.panelId, Q, I), document.body.classList.add("custom-dragging"), c({
|
|
1587
1642
|
isActive: !0,
|
|
1588
1643
|
panelId: l.panelId,
|
|
1589
|
-
startX:
|
|
1590
|
-
startY:
|
|
1644
|
+
startX: Q,
|
|
1645
|
+
startY: I
|
|
1591
1646
|
});
|
|
1592
1647
|
}
|
|
1593
|
-
|
|
1648
|
+
p({ isDragging: !0, draggedPanel: l.panelId, dragOverColumn: null }), w(o(l.panelId)), D(x.clientX, x.clientY), $({ isClicked: !1, panelId: null }), M(!1), k(), g.current = null, i.current && (clearTimeout(i.current), i.current = null);
|
|
1594
1649
|
}
|
|
1595
1650
|
},
|
|
1596
1651
|
[
|
|
@@ -1600,71 +1655,71 @@ const Ue = ({
|
|
|
1600
1655
|
s,
|
|
1601
1656
|
u,
|
|
1602
1657
|
m,
|
|
1603
|
-
|
|
1658
|
+
p,
|
|
1604
1659
|
C,
|
|
1605
1660
|
B,
|
|
1606
1661
|
o,
|
|
1607
1662
|
c,
|
|
1608
|
-
|
|
1663
|
+
w,
|
|
1609
1664
|
D,
|
|
1610
|
-
|
|
1611
|
-
|
|
1665
|
+
$,
|
|
1666
|
+
M,
|
|
1612
1667
|
k,
|
|
1613
|
-
|
|
1668
|
+
K,
|
|
1614
1669
|
h,
|
|
1615
|
-
|
|
1670
|
+
b,
|
|
1616
1671
|
N
|
|
1617
1672
|
]
|
|
1618
|
-
),
|
|
1619
|
-
(
|
|
1620
|
-
if (S(
|
|
1673
|
+
), U = P(
|
|
1674
|
+
(x) => {
|
|
1675
|
+
if (S(y.current, 1, "🐭 カスタムドラッグハンドラー - グローバルマウスアップ", {
|
|
1621
1676
|
isActive: n.isActive,
|
|
1622
1677
|
panelId: n.panelId,
|
|
1623
1678
|
dragMode: n.panelId ? s[n.panelId] : "unknown"
|
|
1624
1679
|
}), n.isActive) {
|
|
1625
|
-
|
|
1626
|
-
const
|
|
1627
|
-
if (
|
|
1628
|
-
const
|
|
1629
|
-
if (
|
|
1630
|
-
const
|
|
1631
|
-
|
|
1680
|
+
A.current.stop();
|
|
1681
|
+
const O = _.current;
|
|
1682
|
+
if (O) {
|
|
1683
|
+
const Z = document.elementFromPoint(x.clientX, x.clientY)?.closest("[data-drop-zone]");
|
|
1684
|
+
if (Z) {
|
|
1685
|
+
const Q = Z.getAttribute("data-column-key");
|
|
1686
|
+
Q && s[n.panelId] === "custom" ? (S(y.current, 1, "🔄 カスタムドラッグパネル移動実行:", n.panelId, "→", Q), v(n.panelId, Q, O.insertIndex)) : S(y.current, 1, "🚫 カスタムドラッグパネル移動スキップ:", n.panelId, "モード:", s[n.panelId]);
|
|
1632
1687
|
}
|
|
1633
1688
|
}
|
|
1634
|
-
f(), document.body.classList.remove("custom-dragging", "droppable"),
|
|
1635
|
-
} else if (
|
|
1636
|
-
const
|
|
1637
|
-
if (!(
|
|
1638
|
-
i.current && (clearTimeout(i.current), i.current = null),
|
|
1689
|
+
f(), document.body.classList.remove("custom-dragging", "droppable"), q(), E.current = 0;
|
|
1690
|
+
} else if (H(x.clientX, x.clientY)) {
|
|
1691
|
+
const R = document.elementFromPoint(x.clientX, x.clientY)?.closest("[data-panel-id]"), Z = R?.getAttribute("data-panel-id") ?? null;
|
|
1692
|
+
if (!(R && Z) || s[Z] !== "custom") {
|
|
1693
|
+
i.current && (clearTimeout(i.current), i.current = null), L(), g.current = null, E.current = 0;
|
|
1639
1694
|
return;
|
|
1640
1695
|
}
|
|
1641
|
-
E.current += 1, l.isClicked === !1 && E.current === 1 ? (S(
|
|
1642
|
-
S(
|
|
1643
|
-
}, 2e3)) : (S(
|
|
1644
|
-
S(
|
|
1696
|
+
E.current += 1, l.isClicked === !1 && E.current === 1 ? (S(y.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", Z), $({ isClicked: !0, panelId: Z }), i.current = window.setTimeout(() => {
|
|
1697
|
+
S(y.current, 1, "⏳ クリック待機状態を自動解除:", Z), L(), g.current = null, E.current = 0;
|
|
1698
|
+
}, 2e3)) : (S(y.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", Z), i.current && (clearTimeout(i.current), i.current = null), L(), g.current = null, E.current = 0, i.current = window.setTimeout(() => {
|
|
1699
|
+
S(y.current, 1, "⏳ 仮想クリック検出再開:", Z);
|
|
1645
1700
|
}, 2e3));
|
|
1646
|
-
} else l.isClicked && (
|
|
1647
|
-
u &&
|
|
1701
|
+
} else l.isClicked && (L(), g.current = null, E.current = 0);
|
|
1702
|
+
u && M(!1);
|
|
1648
1703
|
},
|
|
1649
|
-
[n.isActive, n.panelId, l, s, u,
|
|
1704
|
+
[n.isActive, n.panelId, l, s, u, v, q, L, H, $, M, f]
|
|
1650
1705
|
), a = P(
|
|
1651
|
-
(
|
|
1652
|
-
if (s[
|
|
1653
|
-
S(
|
|
1706
|
+
(x, O) => {
|
|
1707
|
+
if (s[O] !== "custom") {
|
|
1708
|
+
S(y.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", O);
|
|
1654
1709
|
return;
|
|
1655
1710
|
}
|
|
1656
|
-
|
|
1711
|
+
T(x.clientX, x.clientY), l.isClicked && l.panelId === O && (M(!0), i.current !== null && (clearTimeout(i.current), i.current = null), z(x.clientX, x.clientY), g.current = { x: x.clientX, y: x.clientY });
|
|
1657
1712
|
},
|
|
1658
|
-
[l, s,
|
|
1713
|
+
[l, s, T, M, z]
|
|
1659
1714
|
);
|
|
1660
|
-
return
|
|
1661
|
-
i.current !== null && clearTimeout(i.current),
|
|
1715
|
+
return J(() => () => {
|
|
1716
|
+
i.current !== null && clearTimeout(i.current), A.current.stop();
|
|
1662
1717
|
}, []), {
|
|
1663
|
-
handleGlobalMouseMove:
|
|
1664
|
-
handleGlobalMouseUp:
|
|
1718
|
+
handleGlobalMouseMove: X,
|
|
1719
|
+
handleGlobalMouseUp: U,
|
|
1665
1720
|
handleMouseDown: a
|
|
1666
1721
|
};
|
|
1667
|
-
},
|
|
1722
|
+
}, ut = () => {
|
|
1668
1723
|
const [r, t] = ee({
|
|
1669
1724
|
isDragging: !1,
|
|
1670
1725
|
draggedPanel: null,
|
|
@@ -1674,34 +1729,34 @@ const Ue = ({
|
|
|
1674
1729
|
panelId: "",
|
|
1675
1730
|
startX: 0,
|
|
1676
1731
|
startY: 0
|
|
1677
|
-
}), [
|
|
1732
|
+
}), [p, C] = ee({
|
|
1678
1733
|
isClicked: !1,
|
|
1679
1734
|
panelId: null
|
|
1680
|
-
}), [
|
|
1735
|
+
}), [w, $] = ee({
|
|
1681
1736
|
isTouchDragging: !1,
|
|
1682
1737
|
startX: 0,
|
|
1683
1738
|
startY: 0,
|
|
1684
1739
|
currentX: 0,
|
|
1685
1740
|
currentY: 0,
|
|
1686
1741
|
draggedElement: null
|
|
1687
|
-
}), [
|
|
1742
|
+
}), [M, o] = ee(!1), v = P(() => {
|
|
1688
1743
|
c({ isActive: !1, panelId: "", startX: 0, startY: 0 }), t({ isDragging: !1, draggedPanel: null, dragOverColumn: null }), l(null), u(null);
|
|
1689
1744
|
}, []), D = P(() => {
|
|
1690
1745
|
C({ isClicked: !1, panelId: null }), o(!1);
|
|
1691
|
-
}, []), m = P((
|
|
1692
|
-
t(
|
|
1693
|
-
}, []),
|
|
1694
|
-
l(
|
|
1695
|
-
}, []),
|
|
1696
|
-
u(
|
|
1697
|
-
}, []),
|
|
1698
|
-
c(
|
|
1699
|
-
}, []), B = P((
|
|
1700
|
-
C(
|
|
1701
|
-
}, []), k = P((
|
|
1702
|
-
|
|
1703
|
-
}, []),
|
|
1704
|
-
o(
|
|
1746
|
+
}, []), m = P((L) => {
|
|
1747
|
+
t(L);
|
|
1748
|
+
}, []), T = P((L) => {
|
|
1749
|
+
l(L);
|
|
1750
|
+
}, []), z = P((L) => {
|
|
1751
|
+
u(L);
|
|
1752
|
+
}, []), H = P((L) => {
|
|
1753
|
+
c(L);
|
|
1754
|
+
}, []), B = P((L) => {
|
|
1755
|
+
C(L);
|
|
1756
|
+
}, []), k = P((L) => {
|
|
1757
|
+
$(L);
|
|
1758
|
+
}, []), q = P((L) => {
|
|
1759
|
+
o(L);
|
|
1705
1760
|
}, []);
|
|
1706
1761
|
return {
|
|
1707
1762
|
// States / 状態
|
|
@@ -1709,46 +1764,46 @@ const Ue = ({
|
|
|
1709
1764
|
dragOverPosition: n,
|
|
1710
1765
|
originalPanelPosition: s,
|
|
1711
1766
|
customDrag: d,
|
|
1712
|
-
clickState:
|
|
1713
|
-
touchDragState:
|
|
1714
|
-
isMouseDown:
|
|
1767
|
+
clickState: p,
|
|
1768
|
+
touchDragState: w,
|
|
1769
|
+
isMouseDown: M,
|
|
1715
1770
|
// Stabilized Setters / 安定化されたセッター
|
|
1716
1771
|
setDragState: m,
|
|
1717
|
-
setDragOverPosition:
|
|
1718
|
-
setOriginalPanelPosition:
|
|
1719
|
-
setCustomDrag:
|
|
1772
|
+
setDragOverPosition: T,
|
|
1773
|
+
setOriginalPanelPosition: z,
|
|
1774
|
+
setCustomDrag: H,
|
|
1720
1775
|
setClickState: B,
|
|
1721
1776
|
setTouchDragState: k,
|
|
1722
|
-
setIsMouseDown:
|
|
1777
|
+
setIsMouseDown: q,
|
|
1723
1778
|
// Utility Functions / ユーティリティ関数
|
|
1724
|
-
resetDragState:
|
|
1779
|
+
resetDragState: v,
|
|
1725
1780
|
resetClickState: D
|
|
1726
1781
|
};
|
|
1727
|
-
},
|
|
1782
|
+
}, dt = () => {
|
|
1728
1783
|
const [r, t] = ee({
|
|
1729
1784
|
x: 0,
|
|
1730
1785
|
y: 0,
|
|
1731
1786
|
isVisible: !1
|
|
1732
|
-
}), n =
|
|
1733
|
-
t({ x: o, y:
|
|
1787
|
+
}), n = Y(null), l = Y(0), s = Y(null), u = P((o, v) => {
|
|
1788
|
+
t({ x: o, y: v, isVisible: !0 });
|
|
1734
1789
|
}, []), d = P(() => {
|
|
1735
1790
|
t((o) => ({ ...o, isVisible: !1 }));
|
|
1736
|
-
}, []), c = P((o,
|
|
1737
|
-
t((D) => D.x === o && D.y ===
|
|
1791
|
+
}, []), c = P((o, v) => {
|
|
1792
|
+
t((D) => D.x === o && D.y === v ? D : {
|
|
1738
1793
|
x: o,
|
|
1739
|
-
y:
|
|
1794
|
+
y: v,
|
|
1740
1795
|
isVisible: D.isVisible
|
|
1741
1796
|
});
|
|
1742
|
-
}, []),
|
|
1743
|
-
l.current = Date.now(), s.current = { x: o, y:
|
|
1744
|
-
}, []), C = P((o,
|
|
1745
|
-
n.current = { x: o, y:
|
|
1746
|
-
}, []),
|
|
1797
|
+
}, []), p = P((o, v) => {
|
|
1798
|
+
l.current = Date.now(), s.current = { x: o, y: v };
|
|
1799
|
+
}, []), C = P((o, v) => {
|
|
1800
|
+
n.current = { x: o, y: v };
|
|
1801
|
+
}, []), w = P((o, v, D = 500, m = 5) => Date.now() - (l.current || 0) >= D || !s.current ? !1 : Math.sqrt((o - s.current.x) ** 2 + (v - s.current.y) ** 2) < m, []), $ = P((o, v) => {
|
|
1747
1802
|
if (!n.current)
|
|
1748
1803
|
return 0;
|
|
1749
|
-
const D = Math.abs(o - n.current.x), m = Math.abs(
|
|
1804
|
+
const D = Math.abs(o - n.current.x), m = Math.abs(v - n.current.y);
|
|
1750
1805
|
return Math.sqrt(D * D + m * m);
|
|
1751
|
-
}, []),
|
|
1806
|
+
}, []), M = P(() => {
|
|
1752
1807
|
n.current = null, l.current = 0, s.current = null;
|
|
1753
1808
|
}, []);
|
|
1754
1809
|
return {
|
|
@@ -1759,13 +1814,13 @@ const Ue = ({
|
|
|
1759
1814
|
showMousePosition: u,
|
|
1760
1815
|
hideMousePosition: d,
|
|
1761
1816
|
updateMousePosition: c,
|
|
1762
|
-
recordMouseDown:
|
|
1817
|
+
recordMouseDown: p,
|
|
1763
1818
|
recordClickPosition: C,
|
|
1764
|
-
isVirtualClick:
|
|
1765
|
-
calculateMoveDistance:
|
|
1766
|
-
clearMouseTracking:
|
|
1819
|
+
isVirtualClick: w,
|
|
1820
|
+
calculateMoveDistance: $,
|
|
1821
|
+
clearMouseTracking: M
|
|
1767
1822
|
};
|
|
1768
|
-
},
|
|
1823
|
+
}, mt = ({
|
|
1769
1824
|
debugConfig: r,
|
|
1770
1825
|
dragState: t,
|
|
1771
1826
|
customDrag: n,
|
|
@@ -1774,51 +1829,51 @@ const Ue = ({
|
|
|
1774
1829
|
dragOverPosition: u,
|
|
1775
1830
|
originalPanelPosition: d,
|
|
1776
1831
|
setDragState: c,
|
|
1777
|
-
setDragOverPosition:
|
|
1832
|
+
setDragOverPosition: p,
|
|
1778
1833
|
setOriginalPanelPosition: C,
|
|
1779
|
-
performPanelMove:
|
|
1780
|
-
showMousePosition:
|
|
1781
|
-
updateMousePosition:
|
|
1834
|
+
performPanelMove: w,
|
|
1835
|
+
showMousePosition: $,
|
|
1836
|
+
updateMousePosition: M,
|
|
1782
1837
|
resetDragState: o,
|
|
1783
|
-
handlePlaceholderDragEnter:
|
|
1838
|
+
handlePlaceholderDragEnter: v,
|
|
1784
1839
|
handlePlaceholderDragLeave: D
|
|
1785
1840
|
}) => {
|
|
1786
|
-
const m =
|
|
1841
|
+
const m = Y(r);
|
|
1787
1842
|
m.current = r;
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1794
|
-
const B =
|
|
1843
|
+
const T = Y(s);
|
|
1844
|
+
T.current = s;
|
|
1845
|
+
const z = Y(t);
|
|
1846
|
+
z.current = t;
|
|
1847
|
+
const H = Y(u);
|
|
1848
|
+
H.current = u;
|
|
1849
|
+
const B = Y(d);
|
|
1795
1850
|
B.current = d;
|
|
1796
|
-
const k =
|
|
1797
|
-
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1851
|
+
const k = Y(new Ye(ve));
|
|
1852
|
+
J(() => {
|
|
1853
|
+
const b = document.querySelector("main.max-w-full.flex-1.overflow-auto");
|
|
1854
|
+
b && k.current.setScrollElement(b);
|
|
1800
1855
|
}, []);
|
|
1801
|
-
const
|
|
1802
|
-
(
|
|
1856
|
+
const q = P(
|
|
1857
|
+
(b, N) => {
|
|
1803
1858
|
if (n.isActive) {
|
|
1804
|
-
S(m.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", N),
|
|
1859
|
+
S(m.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", N), b.preventDefault();
|
|
1805
1860
|
return;
|
|
1806
1861
|
}
|
|
1807
1862
|
if (l[N] === "custom") {
|
|
1808
|
-
S(m.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", N),
|
|
1863
|
+
S(m.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", N), b.preventDefault();
|
|
1809
1864
|
return;
|
|
1810
1865
|
}
|
|
1811
1866
|
S(m.current, 1, "ドラッグ開始:", N);
|
|
1812
|
-
const
|
|
1867
|
+
const y = Object.keys(T.current);
|
|
1813
1868
|
let i = null;
|
|
1814
|
-
for (let g = 0; g <
|
|
1815
|
-
const E =
|
|
1816
|
-
if (
|
|
1817
|
-
i = { columnIndex: g, panelIndex:
|
|
1869
|
+
for (let g = 0; g < y.length; g++) {
|
|
1870
|
+
const E = y[g], A = T.current[E].indexOf(N);
|
|
1871
|
+
if (A !== -1) {
|
|
1872
|
+
i = { columnIndex: g, panelIndex: A };
|
|
1818
1873
|
break;
|
|
1819
1874
|
}
|
|
1820
1875
|
}
|
|
1821
|
-
C(i),
|
|
1876
|
+
C(i), b.dataTransfer && (b.dataTransfer.setData("text/plain", N), b.dataTransfer.effectAllowed = "move"), $(b.clientX, b.clientY), requestAnimationFrame(() => {
|
|
1822
1877
|
c({
|
|
1823
1878
|
isDragging: !0,
|
|
1824
1879
|
draggedPanel: N,
|
|
@@ -1826,107 +1881,107 @@ const Ue = ({
|
|
|
1826
1881
|
});
|
|
1827
1882
|
});
|
|
1828
1883
|
},
|
|
1829
|
-
[l, n.isActive, C,
|
|
1830
|
-
),
|
|
1884
|
+
[l, n.isActive, C, $, c]
|
|
1885
|
+
), L = P(() => {
|
|
1831
1886
|
S(m.current, 1, "ドラッグ終了"), k.current.stop(), o();
|
|
1832
|
-
}, [o]),
|
|
1833
|
-
(
|
|
1834
|
-
if (
|
|
1835
|
-
|
|
1836
|
-
const
|
|
1887
|
+
}, [o]), K = P(
|
|
1888
|
+
(b, N) => {
|
|
1889
|
+
if (b.preventDefault(), b.dataTransfer.dropEffect = "move", !z.current.isDragging) return;
|
|
1890
|
+
M(b.clientX, b.clientY), N !== z.current.dragOverColumn && c((g) => ({ ...g, dragOverColumn: N }));
|
|
1891
|
+
const y = document.elementFromPoint(b.clientX, b.clientY), i = y?.closest("[data-placeholder-index]");
|
|
1837
1892
|
if (i) {
|
|
1838
1893
|
const g = i.getAttribute("data-placeholder-index"), E = i.getAttribute("data-placeholder-column");
|
|
1839
1894
|
if (g && E) {
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1895
|
+
const A = parseInt(g, 10), _ = parseInt(E, 10);
|
|
1896
|
+
v(_, A);
|
|
1842
1897
|
}
|
|
1843
1898
|
} else
|
|
1844
|
-
|
|
1899
|
+
y?.closest("[data-drop-zone]") || D();
|
|
1845
1900
|
},
|
|
1846
|
-
[
|
|
1901
|
+
[M, c, v, D]
|
|
1847
1902
|
), h = P(
|
|
1848
|
-
(
|
|
1849
|
-
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
draggedPanel:
|
|
1903
|
+
(b, N) => {
|
|
1904
|
+
b.preventDefault();
|
|
1905
|
+
const y = b.dataTransfer.getData("text/plain"), i = H.current;
|
|
1906
|
+
y && i && (S(m.current, 1, "🎯 ドロップ完了:", {
|
|
1907
|
+
draggedPanel: y,
|
|
1853
1908
|
targetColumn: N,
|
|
1854
1909
|
insertPosition: `カラム${i.columnIndex} - 位置${i.insertIndex}`
|
|
1855
|
-
}), y
|
|
1910
|
+
}), w(y, N, i.insertIndex), p(null), L());
|
|
1856
1911
|
},
|
|
1857
|
-
[
|
|
1912
|
+
[w, p, L]
|
|
1858
1913
|
), f = P(
|
|
1859
|
-
(
|
|
1860
|
-
const N =
|
|
1861
|
-
|
|
1914
|
+
(b) => {
|
|
1915
|
+
const N = b.currentTarget, y = b.relatedTarget;
|
|
1916
|
+
y && N.contains(y) || (p(null), c((i) => ({ ...i, dragOverColumn: null })));
|
|
1862
1917
|
},
|
|
1863
|
-
[
|
|
1918
|
+
[p, c]
|
|
1864
1919
|
);
|
|
1865
|
-
return
|
|
1866
|
-
const
|
|
1867
|
-
|
|
1920
|
+
return J(() => {
|
|
1921
|
+
const b = (N) => {
|
|
1922
|
+
z.current.isDragging && (M(N.clientX, N.clientY), k.current.update(N.clientX, N.clientY));
|
|
1868
1923
|
};
|
|
1869
1924
|
if (t.isDragging)
|
|
1870
|
-
return document.addEventListener("dragover",
|
|
1871
|
-
document.removeEventListener("dragover",
|
|
1925
|
+
return document.addEventListener("dragover", b), () => {
|
|
1926
|
+
document.removeEventListener("dragover", b), k.current.stop();
|
|
1872
1927
|
};
|
|
1873
|
-
}, [t.isDragging,
|
|
1928
|
+
}, [t.isDragging, M]), J(() => () => {
|
|
1874
1929
|
k.current.stop();
|
|
1875
1930
|
}, []), {
|
|
1876
|
-
handleDragStart:
|
|
1877
|
-
handleDragEnd:
|
|
1878
|
-
handleDragOverWithInsert:
|
|
1931
|
+
handleDragStart: q,
|
|
1932
|
+
handleDragEnd: L,
|
|
1933
|
+
handleDragOverWithInsert: K,
|
|
1879
1934
|
handleDropWithInsert: h,
|
|
1880
1935
|
handleColumnDragLeave: f
|
|
1881
1936
|
};
|
|
1882
|
-
},
|
|
1883
|
-
const [t, n] = ee(r), [l, s] = ee({}), u =
|
|
1884
|
-
(m,
|
|
1885
|
-
const
|
|
1886
|
-
width: Math.round(
|
|
1887
|
-
height: Math.round(
|
|
1888
|
-
x: Math.round(
|
|
1889
|
-
y: Math.round(
|
|
1890
|
-
minHeight:
|
|
1891
|
-
maxHeight:
|
|
1937
|
+
}, ht = (r) => {
|
|
1938
|
+
const [t, n] = ee(r), [l, s] = ee({}), u = Y({}), d = Y(null), c = Y({ x: 0, y: 0 }), p = P((m) => document.querySelector(`[data-panel-id="${m}"]`), []), C = P(
|
|
1939
|
+
(m, T) => {
|
|
1940
|
+
const z = T.getBoundingClientRect(), H = window.getComputedStyle(T), B = {
|
|
1941
|
+
width: Math.round(z.width),
|
|
1942
|
+
height: Math.round(z.height),
|
|
1943
|
+
x: Math.round(z.left),
|
|
1944
|
+
y: Math.round(z.top),
|
|
1945
|
+
minHeight: H.minHeight || "auto",
|
|
1946
|
+
maxHeight: H.maxHeight || "none"
|
|
1892
1947
|
}, k = u.current[m];
|
|
1893
|
-
(!k || Object.keys(B).some((
|
|
1894
|
-
...
|
|
1948
|
+
(!k || Object.keys(B).some((q) => k[q] !== B[q])) && (u.current[m] = B, s((q) => ({
|
|
1949
|
+
...q,
|
|
1895
1950
|
[m]: B
|
|
1896
1951
|
})));
|
|
1897
1952
|
},
|
|
1898
1953
|
[]
|
|
1899
1954
|
// setPanelSizes は React の state セッターなので依存配列に含める必要はありません
|
|
1900
|
-
),
|
|
1955
|
+
), w = P(
|
|
1901
1956
|
(m) => {
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1957
|
+
const T = p(m);
|
|
1958
|
+
T && C(m, T);
|
|
1904
1959
|
},
|
|
1905
|
-
[
|
|
1906
|
-
),
|
|
1907
|
-
(m,
|
|
1908
|
-
|
|
1960
|
+
[p, C]
|
|
1961
|
+
), $ = P(
|
|
1962
|
+
(m, T) => {
|
|
1963
|
+
T && requestAnimationFrame(() => C(m, T));
|
|
1909
1964
|
},
|
|
1910
1965
|
[C]
|
|
1911
|
-
),
|
|
1912
|
-
(m,
|
|
1913
|
-
const
|
|
1914
|
-
if (!
|
|
1915
|
-
const B =
|
|
1916
|
-
k.style.position = "fixed", k.style.top = "0px", k.style.left = "0px", k.style.width = `${B.width}px`, k.style.height = `${B.height}px`, k.style.pointerEvents = "none", k.style.zIndex = "1000", k.style.opacity = "0.5", k.style.margin = "0", k.style.transition = "none", k.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", k.style.transform = `translate(${B.left}px, ${B.top}px)`, k.id = `drag-image-${m}`, document.body.appendChild(k), d.current = k, c.current = { x:
|
|
1966
|
+
), M = P(
|
|
1967
|
+
(m, T, z) => {
|
|
1968
|
+
const H = p(m);
|
|
1969
|
+
if (!H || d.current) return;
|
|
1970
|
+
const B = H.getBoundingClientRect(), k = H.cloneNode(!0);
|
|
1971
|
+
k.style.position = "fixed", k.style.top = "0px", k.style.left = "0px", k.style.width = `${B.width}px`, k.style.height = `${B.height}px`, k.style.pointerEvents = "none", k.style.zIndex = "1000", k.style.opacity = "0.5", k.style.margin = "0", k.style.transition = "none", k.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", k.style.transform = `translate(${B.left}px, ${B.top}px)`, k.id = `drag-image-${m}`, document.body.appendChild(k), d.current = k, c.current = { x: T, y: z };
|
|
1917
1972
|
},
|
|
1918
|
-
[
|
|
1919
|
-
), o = P((m,
|
|
1973
|
+
[p]
|
|
1974
|
+
), o = P((m, T) => {
|
|
1920
1975
|
if (d.current) {
|
|
1921
|
-
const
|
|
1922
|
-
d.current.style.transform = `translate(${
|
|
1976
|
+
const z = m - c.current.x, H = T - c.current.y;
|
|
1977
|
+
d.current.style.transform = `translate(${z}px, ${H}px) scale(1.05)`;
|
|
1923
1978
|
}
|
|
1924
|
-
}, []),
|
|
1979
|
+
}, []), v = P(() => {
|
|
1925
1980
|
d.current && (d.current.remove(), d.current = null);
|
|
1926
1981
|
}, []), D = P((m) => {
|
|
1927
|
-
n((
|
|
1928
|
-
...
|
|
1929
|
-
[m]: !
|
|
1982
|
+
n((T) => ({
|
|
1983
|
+
...T,
|
|
1984
|
+
[m]: !T[m]
|
|
1930
1985
|
}));
|
|
1931
1986
|
}, []);
|
|
1932
1987
|
return {
|
|
@@ -1936,61 +1991,61 @@ const Ue = ({
|
|
|
1936
1991
|
// State update functions / 状態更新関数
|
|
1937
1992
|
setPanelVisibility: n,
|
|
1938
1993
|
setPanelSizes: s,
|
|
1939
|
-
setPanelRef:
|
|
1940
|
-
updatePanelSize:
|
|
1994
|
+
setPanelRef: $,
|
|
1995
|
+
updatePanelSize: w,
|
|
1941
1996
|
togglePanelVisibility: D,
|
|
1942
1997
|
// Utility functions / ユーティリティ関数
|
|
1943
|
-
getPanelElement:
|
|
1998
|
+
getPanelElement: p,
|
|
1944
1999
|
// Functions for drag image management / ドラッグイメージ管理用の関数
|
|
1945
|
-
createDragImage:
|
|
2000
|
+
createDragImage: M,
|
|
1946
2001
|
updateDragImagePosition: o,
|
|
1947
|
-
removeDragImage:
|
|
2002
|
+
removeDragImage: v
|
|
1948
2003
|
};
|
|
1949
|
-
},
|
|
1950
|
-
const c =
|
|
2004
|
+
}, Nt = ({ initialColumnPanels: r, initialPanelVisibility: t, initialDragModes: n = {}, debugConfig: l, onPanelMove: s, onDragModeChange: u, onColumnPanelsChange: d }) => {
|
|
2005
|
+
const c = Y(l);
|
|
1951
2006
|
c.current = l;
|
|
1952
|
-
const [
|
|
1953
|
-
|
|
1954
|
-
const o =
|
|
2007
|
+
const [p, C] = ee(r), [w, $] = ee(n), M = Y(p);
|
|
2008
|
+
M.current = p;
|
|
2009
|
+
const o = ut(), v = dt(), D = ht(t), m = Y({
|
|
1955
2010
|
mousemove: null,
|
|
1956
2011
|
mouseup: null
|
|
1957
|
-
}),
|
|
1958
|
-
const g = Object.keys(
|
|
1959
|
-
for (let
|
|
1960
|
-
const
|
|
1961
|
-
if (
|
|
1962
|
-
return { columnIndex:
|
|
2012
|
+
}), T = P((i) => {
|
|
2013
|
+
const g = Object.keys(M.current), E = lt(g, le);
|
|
2014
|
+
for (let A = 0; A < E.length; A++) {
|
|
2015
|
+
const _ = E[A], X = M.current[_]?.indexOf(i) ?? -1;
|
|
2016
|
+
if (X !== -1)
|
|
2017
|
+
return { columnIndex: A, panelIndex: X };
|
|
1963
2018
|
}
|
|
1964
2019
|
return null;
|
|
1965
|
-
}, []),
|
|
2020
|
+
}, []), z = P(
|
|
1966
2021
|
(i, g, E) => {
|
|
1967
|
-
S(c.current, 1, "🔄 パネル移動実行:", i, "→", g, "@", E), C((
|
|
1968
|
-
const
|
|
1969
|
-
if (!
|
|
1970
|
-
return console.error("Source column not found for panel:", i),
|
|
1971
|
-
if (!
|
|
1972
|
-
return console.error("Target column not found:", g),
|
|
1973
|
-
if (
|
|
1974
|
-
const
|
|
1975
|
-
|
|
2022
|
+
S(c.current, 1, "🔄 パネル移動実行:", i, "→", g, "@", E), C((A) => {
|
|
2023
|
+
const _ = { ...A }, X = Object.keys(_).find((U) => _[U].includes(i));
|
|
2024
|
+
if (!X)
|
|
2025
|
+
return console.error("Source column not found for panel:", i), A;
|
|
2026
|
+
if (!_[g])
|
|
2027
|
+
return console.error("Target column not found:", g), A;
|
|
2028
|
+
if (X === g) {
|
|
2029
|
+
const U = [..._[X]], a = U.indexOf(i), [x] = U.splice(a, 1), O = a < E ? E - 1 : E;
|
|
2030
|
+
U.splice(O, 0, x), _[g] = U;
|
|
1976
2031
|
} else {
|
|
1977
|
-
|
|
1978
|
-
const
|
|
1979
|
-
|
|
2032
|
+
_[X] = _[X].filter((a) => a !== i);
|
|
2033
|
+
const U = [..._[g]];
|
|
2034
|
+
U.splice(E, 0, i), _[g] = U;
|
|
1980
2035
|
}
|
|
1981
2036
|
if (S(c.current, 1, "✅ パネル移動完了:", i, "→", g), d && requestAnimationFrame(() => {
|
|
1982
|
-
d(
|
|
2037
|
+
d(_);
|
|
1983
2038
|
}), s) {
|
|
1984
|
-
const
|
|
1985
|
-
|
|
1986
|
-
s(i,
|
|
2039
|
+
const U = Object.keys(A).find((a) => A[a].includes(i));
|
|
2040
|
+
U && requestAnimationFrame(() => {
|
|
2041
|
+
s(i, U, g, E);
|
|
1987
2042
|
});
|
|
1988
2043
|
}
|
|
1989
|
-
return
|
|
2044
|
+
return _;
|
|
1990
2045
|
});
|
|
1991
2046
|
},
|
|
1992
2047
|
[d, s]
|
|
1993
|
-
),
|
|
2048
|
+
), H = P(
|
|
1994
2049
|
(i, g) => {
|
|
1995
2050
|
if (!(o.dragState.isDragging || o.customDrag.isActive)) return;
|
|
1996
2051
|
const E = o.originalPanelPosition;
|
|
@@ -1998,8 +2053,8 @@ const Ue = ({
|
|
|
1998
2053
|
S(c.current, 1, `元の位置への挿入をスキップ: カラム${i}, 位置${g}`);
|
|
1999
2054
|
return;
|
|
2000
2055
|
}
|
|
2001
|
-
const
|
|
2002
|
-
(
|
|
2056
|
+
const A = o.dragOverPosition;
|
|
2057
|
+
(!A || A.columnIndex !== i || A.insertIndex !== g) && (S(c.current, 1, `プレースホルダーエンター: カラム${i}, 位置${g}`), o.setDragOverPosition({ columnIndex: i, insertIndex: g }), o.setDragState((_) => ({ ..._, dragOverColumn: i })));
|
|
2003
2058
|
},
|
|
2004
2059
|
[o]
|
|
2005
2060
|
), B = P(
|
|
@@ -2008,21 +2063,21 @@ const Ue = ({
|
|
|
2008
2063
|
if (o.customDrag.isActive)
|
|
2009
2064
|
S(c.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), o.setDragOverPosition(null);
|
|
2010
2065
|
else if (o.dragState.isDragging && i && g !== void 0 && E !== void 0) {
|
|
2011
|
-
const
|
|
2012
|
-
if (
|
|
2013
|
-
const
|
|
2014
|
-
|
|
2066
|
+
const A = o.dragOverPosition;
|
|
2067
|
+
if (A && A.columnIndex === g && A.insertIndex === E) {
|
|
2068
|
+
const _ = i.currentTarget, X = i.relatedTarget;
|
|
2069
|
+
X && _.contains(X) || (S(c.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${g}, 位置${E}。ハイライトを解除します。`), o.setDragOverPosition(null));
|
|
2015
2070
|
}
|
|
2016
2071
|
}
|
|
2017
2072
|
}
|
|
2018
2073
|
},
|
|
2019
2074
|
[o]
|
|
2020
|
-
), k =
|
|
2075
|
+
), k = ct({
|
|
2021
2076
|
debugConfig: c.current,
|
|
2022
2077
|
dragState: o.dragState,
|
|
2023
2078
|
customDrag: o.customDrag,
|
|
2024
2079
|
clickState: o.clickState,
|
|
2025
|
-
dragModes:
|
|
2080
|
+
dragModes: w,
|
|
2026
2081
|
isMouseDown: o.isMouseDown,
|
|
2027
2082
|
originalPanelPosition: o.originalPanelPosition,
|
|
2028
2083
|
dragOverPosition: o.dragOverPosition,
|
|
@@ -2032,64 +2087,64 @@ const Ue = ({
|
|
|
2032
2087
|
setOriginalPanelPosition: o.setOriginalPanelPosition,
|
|
2033
2088
|
setClickState: o.setClickState,
|
|
2034
2089
|
setIsMouseDown: o.setIsMouseDown,
|
|
2035
|
-
findPanelPosition:
|
|
2036
|
-
performPanelMove:
|
|
2037
|
-
showMousePosition:
|
|
2038
|
-
updateMousePosition:
|
|
2039
|
-
recordMouseDown:
|
|
2040
|
-
recordClickPosition:
|
|
2041
|
-
isVirtualClick:
|
|
2042
|
-
calculateMoveDistance:
|
|
2043
|
-
clearMouseTracking:
|
|
2090
|
+
findPanelPosition: T,
|
|
2091
|
+
performPanelMove: z,
|
|
2092
|
+
showMousePosition: v.showMousePosition,
|
|
2093
|
+
updateMousePosition: v.updateMousePosition,
|
|
2094
|
+
recordMouseDown: v.recordMouseDown,
|
|
2095
|
+
recordClickPosition: v.recordClickPosition,
|
|
2096
|
+
isVirtualClick: v.isVirtualClick,
|
|
2097
|
+
calculateMoveDistance: v.calculateMoveDistance,
|
|
2098
|
+
clearMouseTracking: v.clearMouseTracking,
|
|
2044
2099
|
resetDragState: o.resetDragState,
|
|
2045
2100
|
resetClickState: o.resetClickState,
|
|
2046
2101
|
createDragImage: D.createDragImage,
|
|
2047
2102
|
updateDragImagePosition: D.updateDragImagePosition,
|
|
2048
2103
|
removeDragImage: D.removeDragImage,
|
|
2049
|
-
handlePlaceholderDragEnter:
|
|
2104
|
+
handlePlaceholderDragEnter: H,
|
|
2050
2105
|
handlePlaceholderDragLeave: B
|
|
2051
|
-
}),
|
|
2106
|
+
}), q = mt({
|
|
2052
2107
|
debugConfig: c.current,
|
|
2053
2108
|
dragState: o.dragState,
|
|
2054
2109
|
customDrag: o.customDrag,
|
|
2055
|
-
dragModes:
|
|
2056
|
-
columnPanels:
|
|
2110
|
+
dragModes: w,
|
|
2111
|
+
columnPanels: p,
|
|
2057
2112
|
dragOverPosition: o.dragOverPosition,
|
|
2058
2113
|
originalPanelPosition: o.originalPanelPosition,
|
|
2059
2114
|
setDragState: o.setDragState,
|
|
2060
2115
|
setDragOverPosition: o.setDragOverPosition,
|
|
2061
2116
|
setOriginalPanelPosition: o.setOriginalPanelPosition,
|
|
2062
|
-
performPanelMove:
|
|
2063
|
-
showMousePosition:
|
|
2064
|
-
updateMousePosition:
|
|
2117
|
+
performPanelMove: z,
|
|
2118
|
+
showMousePosition: v.showMousePosition,
|
|
2119
|
+
updateMousePosition: v.updateMousePosition,
|
|
2065
2120
|
resetDragState: o.resetDragState,
|
|
2066
|
-
handlePlaceholderDragEnter:
|
|
2121
|
+
handlePlaceholderDragEnter: H,
|
|
2067
2122
|
handlePlaceholderDragLeave: B
|
|
2068
|
-
}),
|
|
2123
|
+
}), L = P((i) => {
|
|
2069
2124
|
m.current.mousemove && m.current.mousemove(i);
|
|
2070
|
-
}, []),
|
|
2125
|
+
}, []), K = P((i) => {
|
|
2071
2126
|
m.current.mouseup && m.current.mouseup(i);
|
|
2072
2127
|
}, []);
|
|
2073
|
-
|
|
2074
|
-
S(c.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove",
|
|
2075
|
-
}), [
|
|
2076
|
-
const i = !o.clickState.isClicked && Object.entries(
|
|
2128
|
+
J(() => (S(c.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", L), document.addEventListener("mouseup", K), () => {
|
|
2129
|
+
S(c.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", K);
|
|
2130
|
+
}), [L, K]), J(() => {
|
|
2131
|
+
const i = !o.clickState.isClicked && Object.entries(w).some(([, E]) => E === "custom"), g = o.clickState.isClicked && o.clickState.panelId;
|
|
2077
2132
|
if (i || g) {
|
|
2078
2133
|
const E = i ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
|
|
2079
2134
|
S(c.current, 1, `🔧 イベントハンドラー設定開始: ${E}`), m.current.mousemove = k.handleGlobalMouseMove, m.current.mouseup = k.handleGlobalMouseUp;
|
|
2080
2135
|
} else
|
|
2081
2136
|
o.customDrag.isActive || o.dragState.isDragging || (m.current.mousemove = null, m.current.mouseup = null);
|
|
2082
|
-
}, [o.clickState.isClicked, o.clickState.panelId,
|
|
2137
|
+
}, [o.clickState.isClicked, o.clickState.panelId, w, o.customDrag.isActive, o.dragState.isDragging, k.handleGlobalMouseMove, k.handleGlobalMouseUp]);
|
|
2083
2138
|
const h = P(
|
|
2084
2139
|
(i, g) => {
|
|
2085
|
-
const E = i.touches[0],
|
|
2140
|
+
const E = i.touches[0], A = i.currentTarget;
|
|
2086
2141
|
o.setTouchDragState({
|
|
2087
2142
|
isTouchDragging: !0,
|
|
2088
2143
|
startX: E.clientX,
|
|
2089
2144
|
startY: E.clientY,
|
|
2090
2145
|
currentX: E.clientX,
|
|
2091
2146
|
currentY: E.clientY,
|
|
2092
|
-
draggedElement:
|
|
2147
|
+
draggedElement: A
|
|
2093
2148
|
}), o.setDragState({
|
|
2094
2149
|
isDragging: !0,
|
|
2095
2150
|
draggedPanel: g,
|
|
@@ -2109,7 +2164,7 @@ const Ue = ({
|
|
|
2109
2164
|
}));
|
|
2110
2165
|
},
|
|
2111
2166
|
[o.touchDragState.isTouchDragging, o]
|
|
2112
|
-
),
|
|
2167
|
+
), b = P(
|
|
2113
2168
|
(i) => {
|
|
2114
2169
|
o.touchDragState.isTouchDragging && (o.setTouchDragState({
|
|
2115
2170
|
isTouchDragging: !1,
|
|
@@ -2118,100 +2173,100 @@ const Ue = ({
|
|
|
2118
2173
|
currentX: 0,
|
|
2119
2174
|
currentY: 0,
|
|
2120
2175
|
draggedElement: null
|
|
2121
|
-
}),
|
|
2176
|
+
}), q.handleDragEnd());
|
|
2122
2177
|
},
|
|
2123
|
-
[o.touchDragState.isTouchDragging, o,
|
|
2178
|
+
[o.touchDragState.isTouchDragging, o, q]
|
|
2124
2179
|
), N = P(
|
|
2125
2180
|
(i) => {
|
|
2126
|
-
S(c.current, 1, "🔄 toggleDragMode called:", { panelId: i }),
|
|
2127
|
-
const
|
|
2181
|
+
S(c.current, 1, "🔄 toggleDragMode called:", { panelId: i }), $((g) => {
|
|
2182
|
+
const A = (g[i] || "normal") === "normal" ? "custom" : "normal", _ = { ...g, [i]: A };
|
|
2128
2183
|
if (u)
|
|
2129
2184
|
try {
|
|
2130
|
-
u(i,
|
|
2131
|
-
} catch (
|
|
2132
|
-
console.error("🔄 Error in onDragModeChange:",
|
|
2185
|
+
u(i, A);
|
|
2186
|
+
} catch (X) {
|
|
2187
|
+
console.error("🔄 Error in onDragModeChange:", X);
|
|
2133
2188
|
}
|
|
2134
|
-
return
|
|
2189
|
+
return _;
|
|
2135
2190
|
});
|
|
2136
2191
|
},
|
|
2137
2192
|
[u]
|
|
2138
|
-
),
|
|
2193
|
+
), y = P((i, g) => {
|
|
2139
2194
|
i.stopPropagation(), S(c.current, 2, "パネルサイズ情報クリック:", g);
|
|
2140
2195
|
}, []);
|
|
2141
2196
|
return {
|
|
2142
2197
|
// 状態
|
|
2143
|
-
columnPanels:
|
|
2198
|
+
columnPanels: p,
|
|
2144
2199
|
panelVisibility: D.panelVisibility,
|
|
2145
|
-
dragModes:
|
|
2200
|
+
dragModes: w,
|
|
2146
2201
|
dragState: o.dragState,
|
|
2147
2202
|
dragOverPosition: o.dragOverPosition,
|
|
2148
2203
|
originalPanelPosition: o.originalPanelPosition,
|
|
2149
2204
|
touchDragState: o.touchDragState,
|
|
2150
2205
|
customDrag: o.customDrag,
|
|
2151
2206
|
clickState: o.clickState,
|
|
2152
|
-
mousePosition:
|
|
2207
|
+
mousePosition: v.mousePosition,
|
|
2153
2208
|
panelSizes: D.panelSizes,
|
|
2154
2209
|
// 状態更新関数
|
|
2155
2210
|
setColumnPanels: C,
|
|
2156
2211
|
setPanelVisibility: D.setPanelVisibility,
|
|
2157
|
-
setDragModes:
|
|
2212
|
+
setDragModes: $,
|
|
2158
2213
|
setPanelRef: D.setPanelRef,
|
|
2159
2214
|
// イベントハンドラー
|
|
2160
|
-
handleDragStart:
|
|
2161
|
-
handleDragEnd:
|
|
2215
|
+
handleDragStart: q.handleDragStart,
|
|
2216
|
+
handleDragEnd: q.handleDragEnd,
|
|
2162
2217
|
handleMouseDown: k.handleMouseDown,
|
|
2163
2218
|
handleTouchStart: h,
|
|
2164
2219
|
handleTouchMove: f,
|
|
2165
|
-
handleTouchEnd:
|
|
2166
|
-
handlePlaceholderDragEnter:
|
|
2220
|
+
handleTouchEnd: b,
|
|
2221
|
+
handlePlaceholderDragEnter: H,
|
|
2167
2222
|
handlePlaceholderDragLeave: B,
|
|
2168
|
-
handleDragOverWithInsert:
|
|
2169
|
-
handleDropWithInsert:
|
|
2170
|
-
handleColumnDragLeave:
|
|
2171
|
-
handlePanelSizeInfoClick:
|
|
2223
|
+
handleDragOverWithInsert: q.handleDragOverWithInsert,
|
|
2224
|
+
handleDropWithInsert: q.handleDropWithInsert,
|
|
2225
|
+
handleColumnDragLeave: q.handleColumnDragLeave,
|
|
2226
|
+
handlePanelSizeInfoClick: y,
|
|
2172
2227
|
// ユーティリティ関数
|
|
2173
2228
|
toggleDragMode: N,
|
|
2174
|
-
findPanelPosition:
|
|
2229
|
+
findPanelPosition: T
|
|
2175
2230
|
};
|
|
2176
|
-
},
|
|
2177
|
-
const [u, d] = ee(0), c =
|
|
2178
|
-
|
|
2231
|
+
}, Et = ({ minColumnWidth: r = 350, defaultColumns: t = 3, maxColumns: n = 6, minColumns: l = 1, currentColumnWidths: s = {} } = {}) => {
|
|
2232
|
+
const [u, d] = ee(0), c = Y(0), p = Y(null), [C, w] = ee(!1), $ = Y(t);
|
|
2233
|
+
J(() => {
|
|
2179
2234
|
if (typeof window > "u")
|
|
2180
2235
|
return;
|
|
2181
|
-
const
|
|
2182
|
-
const m = window.visualViewport?.width ?? 0,
|
|
2183
|
-
return
|
|
2236
|
+
const v = () => {
|
|
2237
|
+
const m = window.visualViewport?.width ?? 0, T = document?.documentElement?.clientWidth ?? 0, z = document?.body?.clientWidth ?? 0, H = window.innerWidth ?? 0;
|
|
2238
|
+
return T > 0 ? Math.floor(T) : m > 0 ? Math.floor(m) : z > 0 ? Math.floor(z) : Math.floor(H);
|
|
2184
2239
|
}, D = () => {
|
|
2185
|
-
|
|
2186
|
-
const m =
|
|
2187
|
-
|
|
2240
|
+
p.current !== null && cancelAnimationFrame(p.current), p.current = requestAnimationFrame(() => {
|
|
2241
|
+
const m = v();
|
|
2242
|
+
p.current = null, m !== 0 && (Math.abs(c.current - m) < 2 || (c.current = m, d(m)));
|
|
2188
2243
|
});
|
|
2189
2244
|
};
|
|
2190
2245
|
return D(), window.addEventListener("resize", D), window.addEventListener("orientationchange", D), window.visualViewport?.addEventListener("resize", D), () => {
|
|
2191
|
-
|
|
2246
|
+
p.current !== null && cancelAnimationFrame(p.current), window.removeEventListener("resize", D), window.removeEventListener("orientationchange", D), window.visualViewport?.removeEventListener("resize", D);
|
|
2192
2247
|
};
|
|
2193
2248
|
}, []);
|
|
2194
|
-
const
|
|
2249
|
+
const M = Ae(() => {
|
|
2195
2250
|
if (!C || u === 0)
|
|
2196
|
-
return
|
|
2197
|
-
const
|
|
2198
|
-
let
|
|
2251
|
+
return $.current = t, t;
|
|
2252
|
+
const v = Math.max(u - 64, 0), D = 24, m = Object.values(s);
|
|
2253
|
+
let T;
|
|
2199
2254
|
if (m.length > 0) {
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2255
|
+
const z = m.reduce((k, q) => k + q, 0) / m.length, H = Math.max(r, z);
|
|
2256
|
+
T = Math.floor((v + D) / (H + D)), m.reduce((k, q) => k + q, 0) + (m.length - 1) * D > v && m.length > l && (T = Math.min(T, m.length - 1));
|
|
2202
2257
|
} else
|
|
2203
|
-
|
|
2204
|
-
return
|
|
2258
|
+
T = Math.floor((v + D) / (r + D));
|
|
2259
|
+
return T = Math.max(l, Math.min(n, T)), $.current === T ? $.current : ($.current = T, T);
|
|
2205
2260
|
}, [C, u, t, r, n, l, s]), o = P(() => {
|
|
2206
|
-
|
|
2261
|
+
w((v) => !v);
|
|
2207
2262
|
}, []);
|
|
2208
2263
|
return {
|
|
2209
|
-
responsiveColumnCount:
|
|
2264
|
+
responsiveColumnCount: M,
|
|
2210
2265
|
isResponsiveMode: C,
|
|
2211
2266
|
screenWidth: u,
|
|
2212
2267
|
toggleResponsiveMode: o
|
|
2213
2268
|
};
|
|
2214
|
-
},
|
|
2269
|
+
}, St = ({ isResponsiveMode: r, responsiveColumnCount: t, currentColumnCount: n, screenWidth: l, onToggleResponsive: s }) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1", children: [
|
|
2215
2270
|
/* @__PURE__ */ e.jsxs(
|
|
2216
2271
|
"button",
|
|
2217
2272
|
{
|
|
@@ -2220,7 +2275,7 @@ const Ue = ({
|
|
|
2220
2275
|
className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${r ? "border border-blue-300 bg-blue-100 text-blue-700" : "border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,
|
|
2221
2276
|
title: r ? "レスポンシブモードを無効化" : "レスポンシブモードを有効化",
|
|
2222
2277
|
children: [
|
|
2223
|
-
r ? /* @__PURE__ */ e.jsx(
|
|
2278
|
+
r ? /* @__PURE__ */ e.jsx(et, { className: "h-3 w-3" }) : /* @__PURE__ */ e.jsx(tt, { className: "h-3 w-3" }),
|
|
2224
2279
|
/* @__PURE__ */ e.jsx("span", { children: r ? "レスポンシブ" : "固定" })
|
|
2225
2280
|
]
|
|
2226
2281
|
}
|
|
@@ -2237,7 +2292,7 @@ const Ue = ({
|
|
|
2237
2292
|
] }),
|
|
2238
2293
|
t !== n && /* @__PURE__ */ e.jsx("span", { className: "text-orange-600", children: "(変更予定)" })
|
|
2239
2294
|
] })
|
|
2240
|
-
] }),
|
|
2295
|
+
] }), kt = {
|
|
2241
2296
|
showDebugPanel: !1,
|
|
2242
2297
|
showMousePosition: !1,
|
|
2243
2298
|
showPanelSizes: !1,
|
|
@@ -2246,37 +2301,37 @@ const Ue = ({
|
|
|
2246
2301
|
logLevel: 0
|
|
2247
2302
|
};
|
|
2248
2303
|
export {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2304
|
+
bt as ColumnControlPanel,
|
|
2305
|
+
vt as ColumnInsertPanel,
|
|
2306
|
+
le as DEFAULT_COLUMN_ID_CONFIG,
|
|
2307
|
+
kt as DEFAULT_DEBUG_CONFIG,
|
|
2308
|
+
ve as DEFAULT_EDGE_SCROLL_CONFIG,
|
|
2309
|
+
wt as DebugControlPanel,
|
|
2310
|
+
pt as DragDropLayout,
|
|
2311
|
+
_e as DropZoneDebugOverlay,
|
|
2312
|
+
Ye as EdgeScrollManager,
|
|
2313
|
+
Le as InsertPlaceholder,
|
|
2314
|
+
ot as PanelSizeDisplay,
|
|
2315
|
+
gt as ResizableColumn,
|
|
2316
|
+
We as ResizeHandle,
|
|
2317
|
+
St as ResponsiveControl,
|
|
2318
|
+
Me as calculateScrollVector,
|
|
2319
|
+
Pt as createColumnIdMapping,
|
|
2265
2320
|
S as debugLog,
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2321
|
+
pe as generateColumnId,
|
|
2322
|
+
ze as generateColumnIds,
|
|
2323
|
+
jt as getNextColumnId,
|
|
2324
|
+
yt as isValidColumnId,
|
|
2325
|
+
at as normalizeColumnPanels,
|
|
2326
|
+
be as parseColumnId,
|
|
2327
|
+
it as performScroll,
|
|
2328
|
+
lt as sortColumnIds,
|
|
2329
|
+
Dt as useColumnLayout,
|
|
2330
|
+
ct as useCustomDragHandlers,
|
|
2331
|
+
Nt as useDragDropColumns,
|
|
2332
|
+
ut as useDragDropState,
|
|
2333
|
+
dt as useMouseTracking,
|
|
2334
|
+
mt as useNormalDragHandlers,
|
|
2335
|
+
ht as usePanelManagement,
|
|
2336
|
+
Et as useResponsiveColumns
|
|
2282
2337
|
};
|