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