@aiquants/drag-drop-panels 0.3.1 → 0.6.0

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