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