@aiquants/drag-drop-panels 0.8.4 → 0.9.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,276 +1,276 @@
1
- import qe, { forwardRef as Ie, createElement as Ee, useRef as F, useState as te, useEffect as K, useLayoutEffect as Se, useCallback as w, memo as st, useMemo as Ue, Fragment as ot } from "react";
2
- var we = { exports: {} }, pe = {};
3
- var We;
4
- function at() {
5
- if (We) return pe;
6
- We = 1;
7
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
8
- function n(s, o, i) {
9
- var u = null;
10
- if (i !== void 0 && (u = "" + i), o.key !== void 0 && (u = "" + o.key), "key" in o) {
11
- i = {};
12
- for (var c in o)
13
- c !== "key" && (i[c] = o[c]);
14
- } else i = o;
15
- return o = i.ref, {
16
- $$typeof: r,
17
- type: s,
18
- key: u,
19
- ref: o !== void 0 ? o : null,
20
- props: i
1
+ import qt, { forwardRef as Wt, createElement as Ge, useRef as W, useState as se, useEffect as ee, useLayoutEffect as we, useCallback as D, memo as hn, useMemo as Re, useId as mn, Fragment as fn } from "react";
2
+ var _e = { exports: {} }, Oe = {};
3
+ var kt;
4
+ function pn() {
5
+ if (kt) return Oe;
6
+ kt = 1;
7
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
8
+ function e(o, r, a) {
9
+ var l = null;
10
+ if (a !== void 0 && (l = "" + a), r.key !== void 0 && (l = "" + r.key), "key" in r) {
11
+ a = {};
12
+ for (var u in r)
13
+ u !== "key" && (a[u] = r[u]);
14
+ } else a = r;
15
+ return r = a.ref, {
16
+ $$typeof: t,
17
+ type: o,
18
+ key: l,
19
+ ref: r !== void 0 ? r : null,
20
+ props: a
21
21
  };
22
22
  }
23
- return pe.Fragment = e, pe.jsx = n, pe.jsxs = n, pe;
23
+ return Oe.Fragment = n, Oe.jsx = e, Oe.jsxs = e, Oe;
24
24
  }
25
- var xe = {};
26
- var ze;
27
- function lt() {
28
- return ze || (ze = 1, process.env.NODE_ENV !== "production" && (function() {
29
- function r(a) {
30
- if (a == null) return null;
31
- if (typeof a == "function")
32
- return a.$$typeof === C ? null : a.displayName || a.name || null;
33
- if (typeof a == "string") return a;
34
- switch (a) {
25
+ var Ce = {};
26
+ var Nt;
27
+ function gn() {
28
+ return Nt || (Nt = 1, process.env.NODE_ENV !== "production" && (function() {
29
+ function t(h) {
30
+ if (h == null) return null;
31
+ if (typeof h == "function")
32
+ return h.$$typeof === L ? null : h.displayName || h.name || null;
33
+ if (typeof h == "string") return h;
34
+ switch (h) {
35
35
  case k:
36
36
  return "Fragment";
37
- case R:
37
+ case N:
38
38
  return "Profiler";
39
- case _:
39
+ case S:
40
40
  return "StrictMode";
41
- case U:
41
+ case T:
42
42
  return "Suspense";
43
- case $:
43
+ case Y:
44
44
  return "SuspenseList";
45
- case x:
45
+ case v:
46
46
  return "Activity";
47
47
  }
48
- if (typeof a == "object")
49
- switch (typeof a.tag == "number" && console.error(
48
+ if (typeof h == "object")
49
+ switch (typeof h.tag == "number" && console.error(
50
50
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
51
- ), a.$$typeof) {
52
- case j:
51
+ ), h.$$typeof) {
52
+ case P:
53
53
  return "Portal";
54
- case Z:
55
- return a.displayName || "Context";
56
- case z:
57
- return (a._context.displayName || "Context") + ".Consumer";
58
- case Y:
59
- var d = a.render;
60
- return a = a.displayName, a || (a = d.displayName || d.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
61
- case L:
62
- return d = a.displayName || null, d !== null ? d : r(a.type) || "Memo";
63
- case f:
64
- d = a._payload, a = a._init;
54
+ case d:
55
+ return h.displayName || "Context";
56
+ case R:
57
+ return (h._context.displayName || "Context") + ".Consumer";
58
+ case $:
59
+ var x = h.render;
60
+ return h = h.displayName, h || (h = x.displayName || x.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
61
+ case G:
62
+ return x = h.displayName || null, x !== null ? x : t(h.type) || "Memo";
63
+ case g:
64
+ x = h._payload, h = h._init;
65
65
  try {
66
- return r(a(d));
66
+ return t(h(x));
67
67
  } catch {
68
68
  }
69
69
  }
70
70
  return null;
71
71
  }
72
- function e(a) {
73
- return "" + a;
72
+ function n(h) {
73
+ return "" + h;
74
74
  }
75
- function n(a) {
75
+ function e(h) {
76
76
  try {
77
- e(a);
78
- var d = !1;
77
+ n(h);
78
+ var x = !1;
79
79
  } catch {
80
- d = !0;
80
+ x = !0;
81
81
  }
82
- if (d) {
83
- d = console;
84
- var S = d.error, X = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
85
- return S.call(
86
- d,
82
+ if (x) {
83
+ x = console;
84
+ var M = x.error, F = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
85
+ return M.call(
86
+ x,
87
87
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
88
- X
89
- ), e(a);
88
+ F
89
+ ), n(h);
90
90
  }
91
91
  }
92
- function s(a) {
93
- if (a === k) return "<>";
94
- if (typeof a == "object" && a !== null && a.$$typeof === f)
92
+ function o(h) {
93
+ if (h === k) return "<>";
94
+ if (typeof h == "object" && h !== null && h.$$typeof === g)
95
95
  return "<...>";
96
96
  try {
97
- var d = r(a);
98
- return d ? "<" + d + ">" : "<...>";
97
+ var x = t(h);
98
+ return x ? "<" + x + ">" : "<...>";
99
99
  } catch {
100
100
  return "<...>";
101
101
  }
102
102
  }
103
- function o() {
104
- var a = W.A;
105
- return a === null ? null : a.getOwner();
103
+ function r() {
104
+ var h = w.A;
105
+ return h === null ? null : h.getOwner();
106
106
  }
107
- function i() {
107
+ function a() {
108
108
  return Error("react-stack-top-frame");
109
109
  }
110
- function u(a) {
111
- if (p.call(a, "key")) {
112
- var d = Object.getOwnPropertyDescriptor(a, "key").get;
113
- if (d && d.isReactWarning) return !1;
110
+ function l(h) {
111
+ if (m.call(h, "key")) {
112
+ var x = Object.getOwnPropertyDescriptor(h, "key").get;
113
+ if (x && x.isReactWarning) return !1;
114
114
  }
115
- return a.key !== void 0;
115
+ return h.key !== void 0;
116
116
  }
117
- function c(a, d) {
118
- function S() {
119
- v || (v = !0, console.error(
117
+ function u(h, x) {
118
+ function M() {
119
+ _ || (_ = !0, console.error(
120
120
  "%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)",
121
- d
121
+ x
122
122
  ));
123
123
  }
124
- S.isReactWarning = !0, Object.defineProperty(a, "key", {
125
- get: S,
124
+ M.isReactWarning = !0, Object.defineProperty(h, "key", {
125
+ get: M,
126
126
  configurable: !0
127
127
  });
128
128
  }
129
- function h() {
130
- var a = r(this.type);
131
- return D[a] || (D[a] = !0, console.error(
129
+ function f() {
130
+ var h = t(this.type);
131
+ return I[h] || (I[h] = !0, console.error(
132
132
  "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."
133
- )), a = this.props.ref, a !== void 0 ? a : null;
133
+ )), h = this.props.ref, h !== void 0 ? h : null;
134
134
  }
135
- function N(a, d, S, X, G, Q) {
136
- var V = S.ref;
137
- return a = {
138
- $$typeof: l,
139
- type: a,
140
- key: d,
141
- props: S,
142
- _owner: X
143
- }, (V !== void 0 ? V : null) !== null ? Object.defineProperty(a, "ref", {
135
+ function b(h, x, M, F, Z, ae) {
136
+ var X = M.ref;
137
+ return h = {
138
+ $$typeof: c,
139
+ type: h,
140
+ key: x,
141
+ props: M,
142
+ _owner: F
143
+ }, (X !== void 0 ? X : null) !== null ? Object.defineProperty(h, "ref", {
144
144
  enumerable: !1,
145
- get: h
146
- }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
145
+ get: f
146
+ }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
147
147
  configurable: !1,
148
148
  enumerable: !1,
149
149
  writable: !0,
150
150
  value: 0
151
- }), Object.defineProperty(a, "_debugInfo", {
151
+ }), Object.defineProperty(h, "_debugInfo", {
152
152
  configurable: !1,
153
153
  enumerable: !1,
154
154
  writable: !0,
155
155
  value: null
156
- }), Object.defineProperty(a, "_debugStack", {
156
+ }), Object.defineProperty(h, "_debugStack", {
157
157
  configurable: !1,
158
158
  enumerable: !1,
159
159
  writable: !0,
160
- value: G
161
- }), Object.defineProperty(a, "_debugTask", {
160
+ value: Z
161
+ }), Object.defineProperty(h, "_debugTask", {
162
162
  configurable: !1,
163
163
  enumerable: !1,
164
164
  writable: !0,
165
- value: Q
166
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
165
+ value: ae
166
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
167
167
  }
168
- function b(a, d, S, X, G, Q) {
169
- var V = d.children;
170
- if (V !== void 0)
171
- if (X)
172
- if (g(V)) {
173
- for (X = 0; X < V.length; X++)
174
- M(V[X]);
175
- Object.freeze && Object.freeze(V);
168
+ function y(h, x, M, F, Z, ae) {
169
+ var X = x.children;
170
+ if (X !== void 0)
171
+ if (F)
172
+ if (p(X)) {
173
+ for (F = 0; F < X.length; F++)
174
+ A(X[F]);
175
+ Object.freeze && Object.freeze(X);
176
176
  } else
177
177
  console.error(
178
178
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
179
179
  );
180
- else M(V);
181
- if (p.call(d, "key")) {
182
- V = r(a);
183
- var re = Object.keys(d).filter(function(se) {
184
- return se !== "key";
180
+ else A(X);
181
+ if (m.call(x, "key")) {
182
+ X = t(h);
183
+ var H = Object.keys(x).filter(function(ue) {
184
+ return ue !== "key";
185
185
  });
186
- X = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", H[V + X] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
186
+ F = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", oe[X + F] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
187
187
  `A props object containing a "key" prop is being spread into JSX:
188
188
  let props = %s;
189
189
  <%s {...props} />
190
190
  React keys must be passed directly to JSX without using spread:
191
191
  let props = %s;
192
192
  <%s key={someKey} {...props} />`,
193
+ F,
193
194
  X,
194
- V,
195
- re,
196
- V
197
- ), H[V + X] = !0);
195
+ H,
196
+ X
197
+ ), oe[X + F] = !0);
198
198
  }
199
- if (V = null, S !== void 0 && (n(S), V = "" + S), u(d) && (n(d.key), V = "" + d.key), "key" in d) {
200
- S = {};
201
- for (var ce in d)
202
- ce !== "key" && (S[ce] = d[ce]);
203
- } else S = d;
204
- return V && c(
205
- S,
206
- typeof a == "function" ? a.displayName || a.name || "Unknown" : a
207
- ), N(
208
- a,
209
- V,
210
- S,
211
- o(),
212
- G,
213
- Q
199
+ if (X = null, M !== void 0 && (e(M), X = "" + M), l(x) && (e(x.key), X = "" + x.key), "key" in x) {
200
+ M = {};
201
+ for (var ve in x)
202
+ ve !== "key" && (M[ve] = x[ve]);
203
+ } else M = x;
204
+ return X && u(
205
+ M,
206
+ typeof h == "function" ? h.displayName || h.name || "Unknown" : h
207
+ ), b(
208
+ h,
209
+ X,
210
+ M,
211
+ r(),
212
+ Z,
213
+ ae
214
214
  );
215
215
  }
216
- function M(a) {
217
- T(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === f && (a._payload.status === "fulfilled" ? T(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
216
+ function A(h) {
217
+ z(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === g && (h._payload.status === "fulfilled" ? z(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
218
218
  }
219
- function T(a) {
220
- return typeof a == "object" && a !== null && a.$$typeof === l;
219
+ function z(h) {
220
+ return typeof h == "object" && h !== null && h.$$typeof === c;
221
221
  }
222
- var y = qe, l = /* @__PURE__ */ Symbol.for("react.transitional.element"), j = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), Z = /* @__PURE__ */ Symbol.for("react.context"), Y = /* @__PURE__ */ Symbol.for("react.forward_ref"), U = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), L = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), x = /* @__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, p = Object.prototype.hasOwnProperty, g = Array.isArray, m = console.createTask ? console.createTask : function() {
222
+ var E = qt, c = /* @__PURE__ */ Symbol.for("react.transitional.element"), P = /* @__PURE__ */ Symbol.for("react.portal"), k = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), N = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), d = /* @__PURE__ */ Symbol.for("react.context"), $ = /* @__PURE__ */ Symbol.for("react.forward_ref"), T = /* @__PURE__ */ Symbol.for("react.suspense"), Y = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), g = /* @__PURE__ */ Symbol.for("react.lazy"), v = /* @__PURE__ */ Symbol.for("react.activity"), L = /* @__PURE__ */ Symbol.for("react.client.reference"), w = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, m = Object.prototype.hasOwnProperty, p = Array.isArray, j = console.createTask ? console.createTask : function() {
223
223
  return null;
224
224
  };
225
- y = {
226
- react_stack_bottom_frame: function(a) {
227
- return a();
225
+ E = {
226
+ react_stack_bottom_frame: function(h) {
227
+ return h();
228
228
  }
229
229
  };
230
- var v, D = {}, A = y.react_stack_bottom_frame.bind(
231
- y,
232
- i
233
- )(), O = m(s(i)), H = {};
234
- xe.Fragment = k, xe.jsx = function(a, d, S) {
235
- var X = 1e4 > W.recentlyCreatedOwnerStacks++;
236
- return b(
237
- a,
238
- d,
239
- S,
230
+ var _, I = {}, re = E.react_stack_bottom_frame.bind(
231
+ E,
232
+ a
233
+ )(), V = j(o(a)), oe = {};
234
+ Ce.Fragment = k, Ce.jsx = function(h, x, M) {
235
+ var F = 1e4 > w.recentlyCreatedOwnerStacks++;
236
+ return y(
237
+ h,
238
+ x,
239
+ M,
240
240
  !1,
241
- X ? Error("react-stack-top-frame") : A,
242
- X ? m(s(a)) : O
241
+ F ? Error("react-stack-top-frame") : re,
242
+ F ? j(o(h)) : V
243
243
  );
244
- }, xe.jsxs = function(a, d, S) {
245
- var X = 1e4 > W.recentlyCreatedOwnerStacks++;
246
- return b(
247
- a,
248
- d,
249
- S,
244
+ }, Ce.jsxs = function(h, x, M) {
245
+ var F = 1e4 > w.recentlyCreatedOwnerStacks++;
246
+ return y(
247
+ h,
248
+ x,
249
+ M,
250
250
  !0,
251
- X ? Error("react-stack-top-frame") : A,
252
- X ? m(s(a)) : O
251
+ F ? Error("react-stack-top-frame") : re,
252
+ F ? j(o(h)) : V
253
253
  );
254
254
  };
255
- })()), xe;
255
+ })()), Ce;
256
256
  }
257
- var Ye;
258
- function it() {
259
- return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? we.exports = at() : we.exports = lt()), we.exports;
257
+ var Ot;
258
+ function xn() {
259
+ return Ot || (Ot = 1, process.env.NODE_ENV === "production" ? _e.exports = pn() : _e.exports = gn()), _e.exports;
260
260
  }
261
- var t = it();
262
- const ct = (r) => r.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ut = (r) => r.replace(
261
+ var s = xn();
262
+ const vn = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), bn = (t) => t.replace(
263
263
  /^([A-Z])|[\s-_]+(\w)/g,
264
- (e, n, s) => s ? s.toUpperCase() : n.toLowerCase()
265
- ), Fe = (r) => {
266
- const e = ut(r);
267
- return e.charAt(0).toUpperCase() + e.slice(1);
268
- }, Be = (...r) => r.filter((e, n, s) => !!e && e.trim() !== "" && s.indexOf(e) === n).join(" ").trim(), dt = (r) => {
269
- for (const e in r)
270
- if (e.startsWith("aria-") || e === "role" || e === "title")
264
+ (n, e, o) => o ? o.toUpperCase() : e.toLowerCase()
265
+ ), Ct = (t) => {
266
+ const n = bn(t);
267
+ return n.charAt(0).toUpperCase() + n.slice(1);
268
+ }, It = (...t) => t.filter((n, e, o) => !!n && n.trim() !== "" && o.indexOf(n) === e).join(" ").trim(), yn = (t) => {
269
+ for (const n in t)
270
+ if (n.startsWith("aria-") || n === "role" || n === "title")
271
271
  return !0;
272
272
  };
273
- var ht = {
273
+ var wn = {
274
274
  xmlns: "http://www.w3.org/2000/svg",
275
275
  width: 24,
276
276
  height: 24,
@@ -281,51 +281,67 @@ var ht = {
281
281
  strokeLinecap: "round",
282
282
  strokeLinejoin: "round"
283
283
  };
284
- const mt = Ie(
284
+ const jn = Wt(
285
285
  ({
286
- color: r = "currentColor",
287
- size: e = 24,
288
- strokeWidth: n = 2,
289
- absoluteStrokeWidth: s,
290
- className: o = "",
291
- children: i,
292
- iconNode: u,
293
- ...c
294
- }, h) => Ee(
286
+ color: t = "currentColor",
287
+ size: n = 24,
288
+ strokeWidth: e = 2,
289
+ absoluteStrokeWidth: o,
290
+ className: r = "",
291
+ children: a,
292
+ iconNode: l,
293
+ ...u
294
+ }, f) => Ge(
295
295
  "svg",
296
296
  {
297
- ref: h,
298
- ...ht,
299
- width: e,
300
- height: e,
301
- stroke: r,
302
- strokeWidth: s ? Number(n) * 24 / Number(e) : n,
303
- className: Be("lucide", o),
304
- ...!i && !dt(c) && { "aria-hidden": "true" },
305
- ...c
297
+ ref: f,
298
+ ...wn,
299
+ width: n,
300
+ height: n,
301
+ stroke: t,
302
+ strokeWidth: o ? Number(e) * 24 / Number(n) : e,
303
+ className: It("lucide", r),
304
+ ...!a && !yn(u) && { "aria-hidden": "true" },
305
+ ...u
306
306
  },
307
307
  [
308
- ...u.map(([N, b]) => Ee(N, b)),
309
- ...Array.isArray(i) ? i : [i]
308
+ ...l.map(([b, y]) => Ge(b, y)),
309
+ ...Array.isArray(a) ? a : [a]
310
310
  ]
311
311
  )
312
312
  );
313
- const oe = (r, e) => {
314
- const n = Ie(
315
- ({ className: s, ...o }, i) => Ee(mt, {
316
- ref: i,
317
- iconNode: e,
318
- className: Be(
319
- `lucide-${ct(Fe(r))}`,
320
- `lucide-${r}`,
321
- s
313
+ const ie = (t, n) => {
314
+ const e = Wt(
315
+ ({ className: o, ...r }, a) => Ge(jn, {
316
+ ref: a,
317
+ iconNode: n,
318
+ className: It(
319
+ `lucide-${vn(Ct(t))}`,
320
+ `lucide-${t}`,
321
+ o
322
322
  ),
323
- ...o
323
+ ...r
324
324
  })
325
325
  );
326
- return n.displayName = Fe(r), n;
326
+ return e.displayName = Ct(t), e;
327
327
  };
328
- const ft = [
328
+ const Pn = [
329
+ ["path", { d: "M12 5v14", key: "s699le" }],
330
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
331
+ ], En = ie("arrow-down", Pn);
332
+ const Dn = [
333
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
334
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
335
+ ], kn = ie("arrow-left", Dn);
336
+ const Nn = [
337
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
338
+ ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
339
+ ], On = ie("arrow-right", Nn);
340
+ const Cn = [
341
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
342
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
343
+ ], Mn = ie("arrow-up", Cn);
344
+ const Sn = [
329
345
  [
330
346
  "path",
331
347
  {
@@ -334,8 +350,8 @@ const ft = [
334
350
  }
335
351
  ],
336
352
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
337
- ], pt = oe("eye", ft);
338
- const xt = [
353
+ ], An = ie("eye", Sn);
354
+ const $n = [
339
355
  [
340
356
  "path",
341
357
  {
@@ -352,20 +368,20 @@ const xt = [
352
368
  }
353
369
  ],
354
370
  ["path", { d: "m2 2 20 20", key: "1ooewy" }]
355
- ], Xe = oe("eye-off", xt);
356
- const gt = [
371
+ ], Mt = ie("eye-off", $n);
372
+ const Tn = [
357
373
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
358
374
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
359
375
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
360
376
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
361
- ], bt = oe("maximize-2", gt);
362
- const vt = [
377
+ ], Ln = ie("maximize-2", Tn);
378
+ const _n = [
363
379
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
364
380
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
365
381
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
366
382
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
367
- ], yt = oe("minimize-2", vt);
368
- const wt = [
383
+ ], Rn = ie("minimize-2", _n);
384
+ const zn = [
369
385
  ["path", { d: "M12.586 12.586 19 19", key: "ea5xo7" }],
370
386
  [
371
387
  "path",
@@ -374,8 +390,8 @@ const wt = [
374
390
  key: "277e5u"
375
391
  }
376
392
  ]
377
- ], jt = oe("mouse-pointer", wt);
378
- const Pt = [
393
+ ], qn = ie("mouse-pointer", zn);
394
+ const Wn = [
379
395
  ["path", { d: "M14 4.1 12 6", key: "ita8i4" }],
380
396
  ["path", { d: "m5.1 8-2.9-.8", key: "1go3kf" }],
381
397
  ["path", { d: "m6 12-1.9 2", key: "mnht97" }],
@@ -387,19 +403,19 @@ const Pt = [
387
403
  key: "s0h3yz"
388
404
  }
389
405
  ]
390
- ], kt = oe("mouse-pointer-click", Pt);
391
- const Nt = [
406
+ ], In = ie("mouse-pointer-click", Wn);
407
+ const Hn = [
392
408
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
393
409
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
394
- ], Ve = oe("x", Nt), le = class le {
410
+ ], Ht = ie("x", Hn), me = class me {
395
411
  /**
396
412
  * @constructor
397
413
  * @param {LogLevel} [level=LogLevel.WARN] - The minimum log level to output.
398
414
  * @param {string} [prefix="[drag-drop-panels]"] - The prefix to add to all log messages.
399
415
  * @param {ILogger} [impl=console] - The implementation to use for logging.
400
416
  */
401
- constructor(e = 2, n = "[drag-drop-panels]", s = console) {
402
- this.level = e, this.prefix = n, this.impl = s;
417
+ constructor(n = 2, e = "[drag-drop-panels]", o = console) {
418
+ this.level = n, this.prefix = e, this.impl = o;
403
419
  }
404
420
  /**
405
421
  * @method setLevel
@@ -407,8 +423,8 @@ const Nt = [
407
423
  * @description 静的インスタンスの現在のログレベルを更新します。
408
424
  * @param {LogLevel} level - The new log level.
409
425
  */
410
- static setLevel(e) {
411
- le.instance.setLevel(e);
426
+ static setLevel(n) {
427
+ me.instance.setLevel(n);
412
428
  }
413
429
  /**
414
430
  * @method setLevel
@@ -416,8 +432,8 @@ const Nt = [
416
432
  * @description 現在のログレベルを更新します。
417
433
  * @param {LogLevel} level - The new log level.
418
434
  */
419
- setLevel(e) {
420
- this.level = e;
435
+ setLevel(n) {
436
+ this.level = n;
421
437
  }
422
438
  /**
423
439
  * @method setImplementation
@@ -425,8 +441,8 @@ const Nt = [
425
441
  * @description 静的インスタンスのロガーの実装を更新します。
426
442
  * @param {ILogger} impl - The new logger implementation.
427
443
  */
428
- static setImplementation(e) {
429
- le.instance.setImplementation(e);
444
+ static setImplementation(n) {
445
+ me.instance.setImplementation(n);
430
446
  }
431
447
  /**
432
448
  * @method setImplementation
@@ -434,8 +450,8 @@ const Nt = [
434
450
  * @description ロガーの実装を更新します。
435
451
  * @param {ILogger} impl - The new logger implementation.
436
452
  */
437
- setImplementation(e) {
438
- this.impl = e;
453
+ setImplementation(n) {
454
+ this.impl = n;
439
455
  }
440
456
  /**
441
457
  * @method setPrefix
@@ -443,8 +459,8 @@ const Nt = [
443
459
  * @description 静的インスタンスのログのプレフィックスを更新します。
444
460
  * @param {string} prefix - The new prefix.
445
461
  */
446
- static setPrefix(e) {
447
- le.instance.setPrefix(e);
462
+ static setPrefix(n) {
463
+ me.instance.setPrefix(n);
448
464
  }
449
465
  /**
450
466
  * @method setPrefix
@@ -452,462 +468,1038 @@ const Nt = [
452
468
  * @description ログのプレフィックスを更新します。
453
469
  * @param {string} prefix - The new prefix.
454
470
  */
455
- setPrefix(e) {
456
- this.prefix = e;
471
+ setPrefix(n) {
472
+ this.prefix = n;
457
473
  }
458
- formatMessage(e) {
459
- return typeof e == "string" ? [`${this.prefix} ${e}`] : [this.prefix, e];
474
+ formatMessage(n) {
475
+ return typeof n == "string" ? [`${this.prefix} ${n}`] : [this.prefix, n];
460
476
  }
461
- static debug(e, ...n) {
462
- le.instance.debug(e, ...n);
477
+ static debug(n, ...e) {
478
+ me.instance.debug(n, ...e);
463
479
  }
464
- debug(e, ...n) {
465
- this.level <= 0 && this.impl.debug(...this.formatMessage(e), ...n);
480
+ debug(n, ...e) {
481
+ this.level <= 0 && this.impl.debug(...this.formatMessage(n), ...e);
466
482
  }
467
- static info(e, ...n) {
468
- le.instance.info(e, ...n);
483
+ static info(n, ...e) {
484
+ me.instance.info(n, ...e);
469
485
  }
470
- info(e, ...n) {
471
- this.level <= 1 && this.impl.info(...this.formatMessage(e), ...n);
486
+ info(n, ...e) {
487
+ this.level <= 1 && this.impl.info(...this.formatMessage(n), ...e);
472
488
  }
473
- static warn(e, ...n) {
474
- le.instance.warn(e, ...n);
489
+ static warn(n, ...e) {
490
+ me.instance.warn(n, ...e);
475
491
  }
476
- warn(e, ...n) {
477
- this.level <= 2 && this.impl.warn(...this.formatMessage(e), ...n);
492
+ warn(n, ...e) {
493
+ this.level <= 2 && this.impl.warn(...this.formatMessage(n), ...e);
478
494
  }
479
- static error(e, ...n) {
480
- le.instance.error(e, ...n);
495
+ static error(n, ...e) {
496
+ me.instance.error(n, ...e);
481
497
  }
482
- error(e, ...n) {
483
- this.level <= 3 && this.impl.error(...this.formatMessage(e), ...n);
498
+ error(n, ...e) {
499
+ this.level <= 3 && this.impl.error(...this.formatMessage(n), ...e);
484
500
  }
485
501
  };
486
- le.instance = new le(2, "[drag-drop-panels]");
487
- let Ce = le;
488
- const Dt = ({ config: r, panelId: e, sizeInfo: n, onSizeInfoClick: s }) => r.showPanelSizes && n ? (
502
+ me.instance = new me(2, "[drag-drop-panels]");
503
+ let Ke = me;
504
+ const Yn = ({ config: t, panelId: n, sizeInfo: e, onSizeInfoClick: o }) => t.showPanelSizes && e ? (
489
505
  // biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素。デバッグ目的のため、インタラクティブ性は限定的。
490
506
  // biome-ignore lint/a11y/useKeyWithClickEvents: キーボード操作はデバッグ機能では優先度が低い。
491
- /* @__PURE__ */ t.jsxs(
507
+ /* @__PURE__ */ s.jsxs(
492
508
  "div",
493
509
  {
494
510
  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",
495
- onClick: s,
496
- onMouseDown: s,
497
- onTouchStart: (o) => o instanceof TouchEvent && s(o),
498
- onDragStart: s,
511
+ onClick: o,
512
+ onMouseDown: o,
513
+ onTouchStart: (r) => r instanceof TouchEvent && o(r),
514
+ onDragStart: o,
499
515
  children: [
500
- /* @__PURE__ */ t.jsxs("div", { className: "text-[10px] opacity-80", children: [
516
+ /* @__PURE__ */ s.jsxs("div", { className: "text-[10px] opacity-80", children: [
501
517
  "ID:",
502
- e
518
+ n
503
519
  ] }),
504
- /* @__PURE__ */ t.jsxs("div", { children: [
505
- n.width,
520
+ /* @__PURE__ */ s.jsxs("div", { children: [
521
+ e.width,
506
522
  "×",
507
- n.height
523
+ e.height
508
524
  ] }),
509
- /* @__PURE__ */ t.jsxs("div", { children: [
525
+ /* @__PURE__ */ s.jsxs("div", { children: [
510
526
  "X:",
511
- n.x,
527
+ e.x,
512
528
  " Y:",
513
- n.y
529
+ e.y
514
530
  ] }),
515
- /* @__PURE__ */ t.jsxs("div", { className: "text-[10px] opacity-80", children: [
531
+ /* @__PURE__ */ s.jsxs("div", { className: "text-[10px] opacity-80", children: [
516
532
  "min:",
517
- n.minHeight,
533
+ e.minHeight,
518
534
  " max:",
519
- n.maxHeight
535
+ e.maxHeight
520
536
  ] })
521
537
  ]
522
538
  }
523
539
  )
524
- ) : null, E = (r, e, ...n) => {
525
- (r.logLevel ?? 0) >= e && Ce.info(...n);
526
- }, Ze = qe.memo(({ index: r, columnIndex: e, isDragging: n, dragOverPosition: s, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: h }) => {
527
- const N = o && o.columnIndex === e && (o.panelIndex === r || o.panelIndex + 1 === r), b = !N && s?.columnIndex === e && s?.insertIndex === r, M = F(null), [T, y] = te(null), l = n || (h?.isActive ?? !1);
528
- return K(() => {
529
- if (M.current) {
530
- const j = M.current.getBoundingClientRect(), k = {
531
- width: Math.round(j.width),
532
- height: Math.round(j.height),
533
- x: Math.round(j.left),
534
- y: Math.round(j.top)
540
+ ) : null, O = (t, n, ...e) => {
541
+ (t.logLevel ?? 0) >= n && Ke.info(...e);
542
+ }, et = (t, n, e) => t.columnIndex === n && (t.panelIndex === e || t.panelIndex + 1 === e), Yt = (t, n, e, o) => {
543
+ const r = Object.keys(t).find((u) => t[u].includes(n));
544
+ if (r === void 0 || t[e] === void 0) return null;
545
+ const a = { ...t };
546
+ if (r === e) {
547
+ const u = [...t[r]], f = u.indexOf(n);
548
+ return u.splice(f, 1), u.splice(f < o ? o - 1 : o, 0, n), a[e] = u, a;
549
+ }
550
+ a[r] = t[r].filter((u) => u !== n);
551
+ const l = [...t[e]];
552
+ return l.splice(o, 0, n), a[e] = l, a;
553
+ }, De = Object.freeze(["previous-column", "next-column", "up", "down"]), Fn = (t, n) => t.columnPanels[n] ?? [], tt = (t) => t.columnKeys.map((n) => Fn(t, n).filter((e) => t.panelVisibility[e] === !0)), Pe = (t, n) => {
554
+ for (const [e, o] of tt(t).entries()) {
555
+ const r = o.indexOf(n);
556
+ if (r >= 0) return { column: e, index: r };
557
+ }
558
+ return null;
559
+ }, Ft = (t, n, e) => {
560
+ switch (e) {
561
+ case "previous-column":
562
+ case "next-column": {
563
+ const o = n.column + (e === "previous-column" ? -1 : 1), r = t[o];
564
+ return r === void 0 ? null : { column: o, index: Math.min(n.index, r.length) };
565
+ }
566
+ case "up":
567
+ return n.index > 0 ? { column: n.column, index: n.index - 1 } : null;
568
+ case "down":
569
+ return n.index < t[n.column].length - 1 ? { column: n.column, index: n.index + 1 } : null;
570
+ default: {
571
+ const o = e;
572
+ throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(o)}; expected one of ${De.join(", ")}`);
573
+ }
574
+ }
575
+ }, Un = (t, n, e, o) => {
576
+ const r = t.filter(n), a = (f) => [...t.slice(0, f), e, ...t.slice(f)], l = r[o];
577
+ if (l !== void 0) return a(t.indexOf(l));
578
+ const u = r[o - 1];
579
+ return a(u !== void 0 ? t.indexOf(u) + 1 : t.length);
580
+ }, Bn = (t, n) => {
581
+ const e = Pe(t, n);
582
+ if (e === null) return [];
583
+ const o = tt(t);
584
+ return De.filter((r) => Ft(o, e, r) !== null);
585
+ }, Xn = (t, n, e) => {
586
+ if (!De.includes(e)) throw new RangeError(`[@aiquants/drag-drop-panels] unknown panel move ${JSON.stringify(e)}; expected one of ${De.join(", ")}`);
587
+ const o = Pe(t, n);
588
+ if (o === null) return null;
589
+ const r = Ft(tt(t), o, e);
590
+ if (r === null) return null;
591
+ const a = (f) => t.panelVisibility[f] === !0, l = Object.fromEntries(Object.entries(t.columnPanels).map(([f, b]) => [f, b.filter((y) => y !== n)])), u = t.columnKeys[r.column];
592
+ return l[u] = Un(l[u] ?? [], a, n, r.index), { columnPanels: l, from: o, place: r };
593
+ }, Vn = (t, n, e) => {
594
+ const o = (r, a) => (r[a] ?? []).filter((l) => l !== e);
595
+ for (const r of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])) {
596
+ const a = o(t, r), l = o(n, r);
597
+ if (a.length !== l.length || a.some((u, f) => u !== l[f])) return !1;
598
+ }
599
+ return !0;
600
+ }, Ut = Object.freeze({
601
+ "previous-column": Object.freeze({ key: "ArrowLeft", aria: "Alt+Shift+ArrowLeft", text: "Alt+Shift+←" }),
602
+ "next-column": Object.freeze({ key: "ArrowRight", aria: "Alt+Shift+ArrowRight", text: "Alt+Shift+→" }),
603
+ up: Object.freeze({ key: "ArrowUp", aria: "Alt+Shift+ArrowUp", text: "Alt+Shift+↑" }),
604
+ down: Object.freeze({ key: "ArrowDown", aria: "Alt+Shift+ArrowDown", text: "Alt+Shift+↓" })
605
+ }), Zn = (t) => {
606
+ if (!(t.altKey && t.shiftKey) || t.ctrlKey || t.metaKey) return null;
607
+ const n = De.find((e) => Ut[e].key === t.key);
608
+ return n === void 0 ? null : n;
609
+ }, Bt = qt.memo(({ index: t, columnIndex: n, isDragging: e, dragOverPosition: o, originalPosition: r, onDragEnter: a, onDragLeave: l, config: u, customDrag: f, label: b }) => {
610
+ const y = r !== null && et(r, n, t), A = !y && o?.columnIndex === n && o?.insertIndex === t, z = W(null), [E, c] = se(null), P = e || (f?.isActive ?? !1), k = y || !P ? "hidden" : A ? "target" : "shown";
611
+ return ee(() => {
612
+ if (z.current) {
613
+ const S = z.current.getBoundingClientRect(), N = {
614
+ width: Math.round(S.width),
615
+ height: Math.round(S.height),
616
+ x: Math.round(S.left),
617
+ y: Math.round(S.top)
535
618
  };
536
- y(k), b && E(c, 1, `🎯 アクティブプレースホルダー ${r}-${e}:`, {
537
- size: `${k.width}×${k.height}`,
538
- position: `(${k.x}, ${k.y})`,
539
- bottomRight: `(${k.x + k.width}, ${k.y + k.height})`,
540
- center: `(${k.x + k.width / 2}, ${k.y + k.height / 2})`
619
+ c(N), A && O(u, 1, `🎯 アクティブプレースホルダー ${t}-${n}:`, {
620
+ size: `${N.width}×${N.height}`,
621
+ position: `(${N.x}, ${N.y})`,
622
+ bottomRight: `(${N.x + N.width}, ${N.y + N.height})`,
623
+ center: `(${N.x + N.width / 2}, ${N.y + N.height / 2})`
541
624
  });
542
625
  }
543
- }, [b, r, e, c]), E(c, 2, `プレースホルダー${r}-${e}: 表示中`, { isHighlighted: b, isDragging: n, dragOverPosition: s, shouldShow: l }), // biome-ignore lint/a11y/noStaticElementInteractions: ドラッグイベントを処理するための対話的な要素。デバッグ目的のため、キーボード操作は必須ではない。
544
- /* @__PURE__ */ t.jsxs(
626
+ }, [A, t, n, u]), O(u, 2, `プレースホルダー${t}-${n}: 表示中`, { isHighlighted: A, isDragging: e, dragOverPosition: o, shouldShow: P }), // biome-ignore lint/a11y/noStaticElementInteractions: ドラッグイベントを処理するための対話的な要素。デバッグ目的のため、キーボード操作は必須ではない。
627
+ /* @__PURE__ */ s.jsxs(
545
628
  "div",
546
629
  {
547
- ref: M,
548
- "data-placeholder-index": r,
549
- "data-placeholder-column": e,
550
- onDragEnter: () => i(e, r),
551
- onDragLeave: (j) => u(j, e, r),
552
- className: `relative flex w-full items-center justify-center transition-all duration-0 ${N ? "pointer-events-none h-0 overflow-hidden opacity-0" : l ? b ? "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"}`,
630
+ ref: z,
631
+ "data-placeholder-index": t,
632
+ "data-placeholder-column": n,
633
+ "data-aqdd-drop-placeholder": k,
634
+ onDragEnter: () => a(n, t),
635
+ onDragLeave: (S) => l(S, n, t),
636
+ className: `relative flex w-full items-center justify-center ${k === "hidden" ? "pointer-events-none h-0 overflow-hidden opacity-0" : k === "target" ? "my-2 scale-[1.02] rounded-xl border-4 border-dashed px-4 py-6 shadow-lg" : "my-2 rounded-xl border-2 border-dashed px-2 py-4"}`,
553
637
  children: [
554
- !N && l && c.showPlaceholderInfo && T && /* @__PURE__ */ t.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: [
555
- /* @__PURE__ */ t.jsxs("div", { children: [
556
- T.width,
638
+ !y && P && u.showPlaceholderInfo && E && /* @__PURE__ */ s.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: [
639
+ /* @__PURE__ */ s.jsxs("div", { children: [
640
+ E.width,
557
641
  "×",
558
- T.height
642
+ E.height
559
643
  ] }),
560
- /* @__PURE__ */ t.jsxs("div", { children: [
644
+ /* @__PURE__ */ s.jsxs("div", { children: [
561
645
  "X:",
562
- T.x,
646
+ E.x,
563
647
  " Y:",
564
- T.y
648
+ E.y
565
649
  ] }),
566
- /* @__PURE__ */ t.jsx("div", { className: "text-[10px] opacity-80", children: "min:200px max:500px" }),
567
- /* @__PURE__ */ t.jsxs("div", { className: "mt-0.5 text-[10px] opacity-80", children: [
650
+ /* @__PURE__ */ s.jsx("div", { className: "text-[10px] opacity-80", children: "min:200px max:500px" }),
651
+ /* @__PURE__ */ s.jsxs("div", { className: "mt-0.5 text-[10px] opacity-80", children: [
568
652
  "PH-",
569
- e,
653
+ n,
570
654
  "-",
571
- r,
655
+ t,
572
656
  " ",
573
- b ? "ACTIVE" : "IDLE"
657
+ A ? "ACTIVE" : "IDLE"
574
658
  ] })
575
659
  ] }),
576
- !N && l && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2 text-sky-600", children: [
577
- /* @__PURE__ */ t.jsxs("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
578
- /* @__PURE__ */ t.jsx("title", { children: "パネルをここにドロップ" }),
579
- /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6" })
580
- ] }),
581
- /* @__PURE__ */ t.jsx("span", { className: "font-medium text-sm", children: "パネルをここにドロップ" })
660
+ !y && P && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center space-x-2", children: [
661
+ /* @__PURE__ */ s.jsx("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6v6m0 0v6m0-6h6m-6 0H6" }) }),
662
+ /* @__PURE__ */ s.jsx("span", { lang: b.lang, className: "font-medium text-sm", children: b.text })
582
663
  ] })
583
664
  ]
584
665
  }
585
666
  );
586
667
  });
587
- Ze.displayName = "InsertPlaceholder";
588
- const Ge = ({ columnIndex: r, isDragging: e, dragOverPosition: n, children: s, config: o }) => {
589
- const i = F(null), [u, c] = te(null);
590
- return K(() => {
591
- if (i.current && e) {
592
- const h = i.current.getBoundingClientRect(), N = n?.columnIndex === r, b = {
593
- width: Math.round(h.width),
594
- height: Math.round(h.height),
595
- x: Math.round(h.left),
596
- y: Math.round(h.top),
597
- isActive: N
668
+ Bt.displayName = "InsertPlaceholder";
669
+ const Xt = ({ columnIndex: t, isDragging: n, dragOverPosition: e, children: o, config: r }) => {
670
+ const a = W(null), [l, u] = se(null);
671
+ return ee(() => {
672
+ if (a.current && n) {
673
+ const f = a.current.getBoundingClientRect(), b = e?.columnIndex === t, y = {
674
+ width: Math.round(f.width),
675
+ height: Math.round(f.height),
676
+ x: Math.round(f.left),
677
+ y: Math.round(f.top),
678
+ isActive: b
598
679
  };
599
- c(b), N && E(o, 1, `🎯 アクティブドロップゾーン ${r}:`, {
600
- size: `${b.width}×${b.height}`,
601
- position: `(${b.x}, ${b.y})`,
602
- bottomRight: `(${b.x + b.width}, ${b.y + b.height})`,
603
- center: `(${b.x + b.width / 2}, ${b.y + b.height / 2})`
680
+ u(y), b && O(r, 1, `🎯 アクティブドロップゾーン ${t}:`, {
681
+ size: `${y.width}×${y.height}`,
682
+ position: `(${y.x}, ${y.y})`,
683
+ bottomRight: `(${y.x + y.width}, ${y.y + y.height})`,
684
+ center: `(${y.x + y.width / 2}, ${y.y + y.height / 2})`
604
685
  });
605
686
  }
606
- }, [e, n, r, o]), /* @__PURE__ */ t.jsxs("div", { ref: i, className: "relative", children: [
607
- s,
608
- e && u && o.showDropZoneOutlines && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
609
- /* @__PURE__ */ t.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"}` }),
610
- /* @__PURE__ */ t.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: [
611
- /* @__PURE__ */ t.jsxs("div", { className: "font-bold", children: [
687
+ }, [n, e, t, r]), /* @__PURE__ */ s.jsxs("div", { ref: a, className: "relative", children: [
688
+ o,
689
+ n && l && r.showDropZoneOutlines && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
690
+ /* @__PURE__ */ s.jsx("div", { className: `pointer-events-none absolute inset-0 rounded-lg border-2 border-dashed transition-all duration-200 ${l.isActive ? "border-red-500 bg-red-100/20 shadow-lg" : "border-gray-400 bg-gray-100/10"}` }),
691
+ /* @__PURE__ */ s.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 ${l.isActive ? "bg-red-500/90 text-white" : "bg-gray-500/90 text-white"}`, children: [
692
+ /* @__PURE__ */ s.jsxs("div", { className: "font-bold", children: [
612
693
  "DropZone-",
613
- r
694
+ t
614
695
  ] }),
615
- /* @__PURE__ */ t.jsxs("div", { children: [
616
- u.width,
696
+ /* @__PURE__ */ s.jsxs("div", { children: [
697
+ l.width,
617
698
  "×",
618
- u.height
699
+ l.height
619
700
  ] }),
620
- /* @__PURE__ */ t.jsxs("div", { children: [
701
+ /* @__PURE__ */ s.jsxs("div", { children: [
621
702
  "X:",
622
- u.x,
703
+ l.x,
623
704
  " Y:",
624
- u.y
705
+ l.y
625
706
  ] }),
626
- /* @__PURE__ */ t.jsx("div", { className: "mt-0.5 text-[10px] opacity-80", children: u.isActive ? "ACTIVE" : "IDLE" })
707
+ /* @__PURE__ */ s.jsx("div", { className: "mt-0.5 text-[10px] opacity-80", children: l.isActive ? "ACTIVE" : "IDLE" })
627
708
  ] }),
628
- /* @__PURE__ */ t.jsx(
709
+ /* @__PURE__ */ s.jsx(
629
710
  "div",
630
711
  {
631
- className: `pointer-events-none absolute transition-all duration-200 ${u.isActive ? "opacity-100" : "opacity-50"}`,
712
+ className: `pointer-events-none absolute transition-all duration-200 ${l.isActive ? "opacity-100" : "opacity-50"}`,
632
713
  style: {
633
- left: `${u.width / 2 - 6}px`,
634
- top: `${u.height / 2 - 6}px`
714
+ left: `${l.width / 2 - 6}px`,
715
+ top: `${l.height / 2 - 6}px`
635
716
  },
636
- children: /* @__PURE__ */ t.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"}` })
717
+ children: /* @__PURE__ */ s.jsx("div", { className: `h-3 w-3 rounded-full border-2 ${l.isActive ? "border-red-700 bg-red-500" : "border-gray-700 bg-gray-500"}` })
637
718
  }
638
719
  ),
639
- u.isActive && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
640
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
641
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
642
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
643
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500" })
720
+ l.isActive && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
721
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute top-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
722
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500" }),
723
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 h-2 w-2 rounded-full bg-red-500" }),
724
+ /* @__PURE__ */ s.jsx("div", { className: "pointer-events-none absolute right-0 bottom-0 h-2 w-2 rounded-full bg-red-500" })
644
725
  ] })
645
726
  ] })
646
727
  ] });
647
728
  };
648
- Ge.displayName = "DropZoneDebugOverlay";
649
- const Et = 0.25, St = typeof window < "u" ? Se : K, Ct = (r, e = Et) => {
650
- const n = F(null), [s, o] = te(1);
651
- return St(() => {
652
- const i = n.current;
653
- if (!i || r <= 0) {
654
- o(1);
729
+ Xt.displayName = "DropZoneDebugOverlay";
730
+ const Vt = "[data-aqdd-scroll-root]", Ee = "data-aqdd-panel-action", Gn = 0.25, Kn = typeof window < "u" ? we : ee, Jn = (t, n = Gn) => {
731
+ const e = W(null), [o, r] = se(1);
732
+ return Kn(() => {
733
+ const a = e.current;
734
+ if (!a || t <= 0) {
735
+ r(1);
655
736
  return;
656
737
  }
657
- const u = () => {
658
- const h = i.clientWidth;
659
- if (h <= 0)
738
+ const l = () => {
739
+ const f = a.clientWidth;
740
+ if (f <= 0)
660
741
  return;
661
- const N = h >= r ? 1 : Math.max(h / r, e);
662
- o((b) => Math.abs(b - N) < 5e-3 ? b : N);
742
+ const b = f >= t ? 1 : Math.max(f / t, n);
743
+ r((y) => Math.abs(y - b) < 5e-3 ? y : b);
663
744
  };
664
- u();
665
- const c = new ResizeObserver(u);
666
- return c.observe(i), () => c.disconnect();
667
- }, [r, e]), { containerRef: n, scale: s };
668
- }, Je = ({ columnId: r, onResizeStart: e, onResize: n, onResizeEnd: s, isResizing: o = !1, position: i = "right", className: u = "", debug: c = {} }) => {
669
- const h = F(!1), N = F(null);
670
- K(() => {
671
- !o && h.current && (E(c, 1, "外部からのリサイズ解除を検出、ドラッグ状態を強制解除:", r), h.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
672
- }, [o, r, c]);
673
- const b = w(
674
- (y) => {
675
- y.preventDefault(), y.stopPropagation(), E(c, 2, "リサイズハンドル マウスダウン:", r), h.current = !0, e(r, y.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
745
+ l();
746
+ const u = new ResizeObserver(l);
747
+ return u.observe(a), () => u.disconnect();
748
+ }, [t, n]), { containerRef: e, scale: o };
749
+ }, Qn = Object.freeze([
750
+ "--aqdd-panel-surface",
751
+ "--aqdd-panel-border",
752
+ "--aqdd-panel-title-color",
753
+ "--aqdd-header-button-color",
754
+ "--aqdd-header-button-hover-color",
755
+ "--aqdd-header-button-hover-surface",
756
+ "--aqdd-custom-badge-color",
757
+ "--aqdd-custom-badge-surface",
758
+ "--aqdd-default-panel-surface",
759
+ "--aqdd-default-panel-border",
760
+ "--aqdd-default-panel-title-color",
761
+ "--aqdd-default-header-button-color",
762
+ "--aqdd-default-header-button-hover-color",
763
+ "--aqdd-default-header-button-hover-surface",
764
+ "--aqdd-default-header-close-hover-color",
765
+ "--aqdd-default-custom-badge-color",
766
+ "--aqdd-default-custom-badge-surface"
767
+ ]), Zt = (t, n) => {
768
+ const e = window.getComputedStyle(t);
769
+ for (const o of Qn) {
770
+ const r = e.getPropertyValue(o).trim();
771
+ r !== "" && n.style.setProperty(o, r);
772
+ }
773
+ }, Gt = (t, n, e) => {
774
+ const o = t.getBoundingClientRect(), r = t.cloneNode(!0);
775
+ return r.removeAttribute("data-panel-id"), Zt(t, r), r.style.position = "fixed", r.style.top = "0px", r.style.left = "0px", r.style.width = `${t.offsetWidth}px`, r.style.height = `${t.offsetHeight}px`, r.style.pointerEvents = "none", r.style.zIndex = "1000", r.style.opacity = "0.5", r.style.margin = "0", r.style.transition = "none", r.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", r.style.transformOrigin = "top left", r.style.transform = `translate(${o.left}px, ${o.top}px) scale(${e})`, r.id = `drag-image-${n}`, document.body.appendChild(r), r;
776
+ }, Kt = (t, n, e, o, r) => {
777
+ t.style.transform = `translate(${n - o.x}px, ${e - o.y}px) scale(${r * 1.05})`;
778
+ }, er = (t, n) => {
779
+ let e = n.closest("[data-drop-zone]");
780
+ for (; e !== null && e.closest("[data-aqdd-layout]") !== t; ) {
781
+ const o = e.parentElement;
782
+ e = o === null ? null : o.closest("[data-drop-zone]");
783
+ }
784
+ return e;
785
+ }, tr = (t, n, e) => {
786
+ const o = document.elementFromPoint(n, e), r = o === null ? null : er(t, o);
787
+ if (r === null) return null;
788
+ let a = null;
789
+ for (const l of r.querySelectorAll("[data-placeholder-index]")) {
790
+ if (l.closest("[data-drop-zone]") !== r) continue;
791
+ const { top: u, bottom: f } = l.getBoundingClientRect(), b = e < u ? u - e : e > f ? e - f : 0;
792
+ (a === null || b < a.distance) && (a = { insertIndex: Number(l.getAttribute("data-placeholder-index")), distance: b });
793
+ }
794
+ return a === null ? null : { columnIndex: Number(r.getAttribute("data-column-index")), insertIndex: a.insertIndex };
795
+ }, Se = {
796
+ triggerDistance: 80,
797
+ scrollSpeed: 5,
798
+ maxScrollSpeed: 20
799
+ }, nt = () => new DOMRect(0, 0, window.innerWidth, window.innerHeight), nr = (t) => {
800
+ const n = t.getBoundingClientRect(), e = nt(), o = Math.max(n.left, e.left), r = Math.max(n.top, e.top), a = Math.min(n.right, e.right), l = Math.min(n.bottom, e.bottom);
801
+ return a > o && l > r ? new DOMRect(o, r, a - o, l - r) : null;
802
+ }, St = (t, n, e = Se, o) => {
803
+ const { triggerDistance: r, scrollSpeed: a, maxScrollSpeed: l } = e, u = o === void 0 ? nt() : nr(o);
804
+ if (u === null) return { x: 0, y: 0 };
805
+ const { left: f, top: b, right: y, bottom: A } = u;
806
+ let z = 0, E = 0;
807
+ if (t >= f && t <= y && n >= b && n <= A) {
808
+ if (t < f + r) {
809
+ const c = Math.max(0, (f + r - t) / r);
810
+ z = -Math.min(l, a + c * (l - a));
811
+ } else if (t > y - r) {
812
+ const c = Math.max(0, (t - (y - r)) / r);
813
+ z = Math.min(l, a + c * (l - a));
814
+ }
815
+ if (n < b + r) {
816
+ const c = Math.max(0, (b + r - n) / r);
817
+ E = -Math.min(l, a + c * (l - a));
818
+ } else if (n > A - r) {
819
+ const c = Math.max(0, (n - (A - r)) / r);
820
+ E = Math.min(l, a + c * (l - a));
821
+ }
822
+ }
823
+ return { x: z, y: E };
824
+ }, rr = (t, n) => {
825
+ if (t === document.documentElement) return !1;
826
+ if (t === document.body) {
827
+ const r = window.getComputedStyle(document.documentElement);
828
+ if (r.overflowX === "visible" && r.overflowY === "visible") return !1;
829
+ }
830
+ const e = window.getComputedStyle(t), o = n === "x" ? e.overflowX : e.overflowY;
831
+ return o === "auto" || o === "scroll";
832
+ }, or = (t, n, e, o) => e === "x" ? o > 0 ? t.right - n.right : n.left - t.left : o > 0 ? t.bottom - n.bottom : n.top - t.top, Jt = (t, n, e) => {
833
+ const o = n === "x" ? t.scrollLeft : t.scrollTop;
834
+ return t.scrollBy(n === "x" ? { left: e, behavior: "instant" } : { top: e, behavior: "instant" }), (n === "x" ? t.scrollLeft : t.scrollTop) !== o;
835
+ }, At = (t, n, e, o, r) => {
836
+ const a = or(e, n, o, r);
837
+ return a > 0 && Jt(t, o, Math.sign(r) * Math.min(Math.abs(r), a));
838
+ }, $t = (t, n, e) => {
839
+ if (Jt(t, n, e)) return;
840
+ const o = t.getBoundingClientRect();
841
+ for (let a = t.parentElement; a !== null; a = a.parentElement)
842
+ if (rr(a, n) && At(a, a.getBoundingClientRect(), o, n, e)) return;
843
+ const r = document.scrollingElement;
844
+ r instanceof Element && r !== t && At(r, nt(), o, n, e);
845
+ }, sr = (t, n) => {
846
+ if (n === void 0) {
847
+ (t.x !== 0 || t.y !== 0) && window.scrollBy(t.x, t.y);
848
+ return;
849
+ }
850
+ t.x !== 0 && $t(n, "x", t.x), t.y !== 0 && $t(n, "y", t.y);
851
+ };
852
+ class rt {
853
+ /**
854
+ * Creates a manager for an element, or for the window without one.
855
+ * 要素 (無ければウインドウ) の管理役を作る。
856
+ *
857
+ * @param config - The edge bands and speeds. 端の帯と速さ。
858
+ * @param scrollElement - The element to scroll. スクロールする要素。
859
+ */
860
+ constructor(n = Se, e) {
861
+ this.intervalId = null, this.isActive = !1, this.pointX = 0, this.pointY = 0, this.config = n, this.scrollElement = e;
862
+ }
863
+ /**
864
+ * Sets the element to scroll (the window without one).
865
+ * スクロールする要素を設定する (無ければウインドウ)。
866
+ *
867
+ * @param element - The element. 要素。
868
+ */
869
+ setScrollElement(n) {
870
+ this.scrollElement = n;
871
+ }
872
+ /**
873
+ * Starts scrolling for a pointer at a point; while it runs, it only moves the point.
874
+ * ある点のポインタのスクロールを始める (動いている間は点だけを移す)。
875
+ *
876
+ * @param clientX - The pointer's viewport x. ポインタのビューポートの x。
877
+ * @param clientY - The pointer's viewport y. ポインタのビューポートの y。
878
+ */
879
+ start(n, e) {
880
+ this.pointX = n, this.pointY = e, !this.isActive && (this.isActive = !0, this.intervalId = window.setInterval(() => {
881
+ const o = St(this.pointX, this.pointY, this.config, this.scrollElement);
882
+ sr(o, this.scrollElement);
883
+ }, 16));
884
+ }
885
+ /**
886
+ * Follows the pointer to a new point: starts scrolling when it enters an edge band, keeps scrolling toward its latest
887
+ * point while it stays in one, and stops when it leaves them.
888
+ * ポインタを新しい点へ追う処理 (端の帯へ入るとスクロールを始め、帯の中にいる間は最新の点へ向けて続け、帯を出ると止める)。
889
+ *
890
+ * @param clientX - The pointer's viewport x. ポインタのビューポートの x。
891
+ * @param clientY - The pointer's viewport y. ポインタのビューポートの y。
892
+ */
893
+ update(n, e) {
894
+ this.pointX = n, this.pointY = e;
895
+ const o = St(n, e, this.config, this.scrollElement);
896
+ (o.x !== 0 || o.y !== 0) && !this.isActive ? this.start(n, e) : o.x === 0 && o.y === 0 && this.isActive && this.stop();
897
+ }
898
+ /**
899
+ * Stops scrolling.
900
+ * スクロールを止める。
901
+ */
902
+ stop() {
903
+ this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null), this.isActive = !1;
904
+ }
905
+ /**
906
+ * Whether it is scrolling now.
907
+ * 今スクロールしているか。
908
+ *
909
+ * @returns Whether a scroll runs. スクロールが動いているか。
910
+ */
911
+ isScrolling() {
912
+ return this.isActive;
913
+ }
914
+ /**
915
+ * Replaces the edge bands and speeds.
916
+ * 端の帯と速さを置き換える。
917
+ *
918
+ * @param newConfig - The edge bands and speeds. 端の帯と速さ。
919
+ */
920
+ updateConfig(n) {
921
+ this.config = n;
922
+ }
923
+ }
924
+ const Tt = "custom-dragging", ar = (t, n) => t === null ? n === null : n !== null && t.columnIndex === n.columnIndex && t.insertIndex === n.insertIndex, Lt = (t, n, e) => {
925
+ const { left: o, top: r, right: a, bottom: l } = t.getBoundingClientRect();
926
+ return n < o || n > a || e < r || e > l;
927
+ }, lr = (t, n) => {
928
+ let e = null;
929
+ const o = (d) => {
930
+ const $ = t(), T = $.layoutRef.current;
931
+ if (T === null || Lt(T, d.x, d.y)) return null;
932
+ const Y = tr(T, d.x, d.y), G = $.originOf(d.panelId);
933
+ return Y === null || G === null || et(G, Y.columnIndex, Y.insertIndex) ? null : Y;
934
+ }, r = () => {
935
+ if (e === null || e.phase !== "dragging") return;
936
+ const d = o(e);
937
+ n(($) => $ === null || ar($.over, d) ? $ : { panelId: $.panelId, over: d });
938
+ }, a = (d) => {
939
+ if (e === null || d.pointerId !== e.pointerId) return;
940
+ if (e.x = d.clientX, e.y = d.clientY, e.phase === "pressing") {
941
+ Math.hypot(e.x - e.startX, e.y - e.startY) > t().config.slop && E();
942
+ return;
943
+ }
944
+ const $ = t(), T = $.layoutRef.current;
945
+ if (T === null || Lt(T, e.x, e.y)) {
946
+ c();
947
+ return;
948
+ }
949
+ Kt(e.image, e.x, e.y, e.offset, $.scale), e.edgeScroll.update(e.x, e.y), r();
950
+ }, l = (d) => {
951
+ if (e === null || d.pointerId !== e.pointerId) return;
952
+ if (e.phase === "pressing") {
953
+ E();
954
+ return;
955
+ }
956
+ e.x = d.clientX, e.y = d.clientY;
957
+ const $ = o(e), T = E();
958
+ if (T === null) return;
959
+ const Y = t();
960
+ $ === null ? Y.onCancel(T.panelId) : Y.onDrop(T.panelId, $);
961
+ }, u = (d) => {
962
+ e !== null && d.pointerId === e.pointerId && c();
963
+ }, f = (d) => {
964
+ e !== null && e.phase === "pressing" && d.pointerId !== e.pointerId && E();
965
+ }, b = (d) => {
966
+ e !== null && e.phase === "dragging" && d.pointerId === e.pointerId && d.target === e.header && c();
967
+ }, y = (d) => {
968
+ e === null || e.phase !== "dragging" || d.key !== "Escape" || d.defaultPrevented || d.isComposing || (d.preventDefault(), c());
969
+ }, A = () => {
970
+ document.addEventListener("pointermove", a, !0), document.addEventListener("pointerup", l, !0), document.addEventListener("pointercancel", u, !0), document.addEventListener("pointerdown", f, !0), document.addEventListener("lostpointercapture", b, !0), document.addEventListener("keydown", y, !0);
971
+ }, z = () => {
972
+ document.removeEventListener("pointermove", a, !0), document.removeEventListener("pointerup", l, !0), document.removeEventListener("pointercancel", u, !0), document.removeEventListener("pointerdown", f, !0), document.removeEventListener("lostpointercapture", b, !0), document.removeEventListener("keydown", y, !0);
973
+ }, E = () => {
974
+ const d = e;
975
+ return d === null ? null : (e = null, z(), d.phase === "pressing" ? (window.clearTimeout(d.timer), d) : (document.removeEventListener("scroll", r, !0), d.edgeScroll.stop(), d.image.remove(), document.body.classList.remove(Tt), d.header.hasPointerCapture(d.pointerId) && d.header.releasePointerCapture(d.pointerId), n(null), d));
976
+ }, c = () => {
977
+ const d = E();
978
+ d !== null && d.phase === "dragging" && t().onCancel(d.panelId);
979
+ }, P = () => {
980
+ if (e === null || e.phase !== "pressing") return;
981
+ const d = e, $ = t(), T = $.panelElementOf(d.panelId), Y = $.scrollRootRef.current;
982
+ if (!$.canStart || T === null || Y === null || !d.header.isConnected) {
983
+ E();
984
+ return;
985
+ }
986
+ try {
987
+ d.header.setPointerCapture(d.pointerId);
988
+ } catch (v) {
989
+ if (v instanceof DOMException) {
990
+ E();
991
+ return;
992
+ }
993
+ throw v;
994
+ }
995
+ const { left: G, top: g } = T.getBoundingClientRect();
996
+ e = {
997
+ phase: "dragging",
998
+ pointerId: d.pointerId,
999
+ panelId: d.panelId,
1000
+ header: d.header,
1001
+ image: Gt(T, d.panelId, $.scale),
1002
+ offset: { x: d.x - G, y: d.y - g },
1003
+ edgeScroll: new rt(Se, Y),
1004
+ x: d.x,
1005
+ y: d.y
1006
+ }, document.addEventListener("scroll", r, { capture: !0, passive: !0 }), document.body.classList.add(Tt), n({ panelId: d.panelId, over: null }), $.onLift(d.panelId);
1007
+ };
1008
+ return { pressHeader: (d, $) => {
1009
+ if (e !== null || !d.isPrimary || d.button !== 0 || d.pointerType !== "touch" && d.pointerType !== "pen") return;
1010
+ const T = t();
1011
+ T.canStart && (d.target instanceof Element && d.target.closest(`[${Ee}]`) !== null || (e = {
1012
+ phase: "pressing",
1013
+ pointerId: d.pointerId,
1014
+ panelId: $,
1015
+ header: d.currentTarget,
1016
+ startX: d.clientX,
1017
+ startY: d.clientY,
1018
+ timer: window.setTimeout(P, T.config.longPressDelay),
1019
+ x: d.clientX,
1020
+ y: d.clientY
1021
+ }, A()));
1022
+ }, holdContextMenu: (d) => {
1023
+ e !== null && e.header === d.currentTarget && d.preventDefault();
1024
+ }, bindHeader: (d) => {
1025
+ if (d === null) return;
1026
+ const $ = (T) => {
1027
+ e !== null && e.phase === "dragging" && e.header === d && T.cancelable && T.preventDefault();
1028
+ };
1029
+ return d.addEventListener("touchmove", $, { passive: !1 }), () => d.removeEventListener("touchmove", $);
1030
+ }, cancel: c, dispose: () => {
1031
+ E();
1032
+ } };
1033
+ }, ir = (t) => {
1034
+ const n = W(t);
1035
+ we(() => {
1036
+ n.current = t;
1037
+ });
1038
+ const [e, o] = se(null), [r] = se(() => lr(() => n.current, o));
1039
+ return ee(() => r.dispose, [r]), { touchDrag: e, pressHeader: r.pressHeader, holdContextMenu: r.holdContextMenu, bindHeader: r.bindHeader, cancel: r.cancel };
1040
+ }, qe = Object.freeze({
1041
+ switchToCustomDragMode: { text: "カスタムドラッグモードに切り替え", lang: "ja" },
1042
+ switchToNormalDragMode: { text: "通常ドラッグモードに戻す", lang: "ja" },
1043
+ hidePanel: { text: "パネルを非表示", lang: "ja" },
1044
+ maximizePanel: { text: "パネルを最大化", lang: "ja" },
1045
+ restorePanel: { text: "元のサイズに戻す", lang: "ja" },
1046
+ closePanel: { text: "パネルを閉じる", lang: "ja" },
1047
+ movePanelToPreviousColumn: { text: "前の列へ移動", lang: "ja" },
1048
+ movePanelToNextColumn: { text: "次の列へ移動", lang: "ja" },
1049
+ movePanelUp: { text: "上へ移動", lang: "ja" },
1050
+ movePanelDown: { text: "下へ移動", lang: "ja" },
1051
+ customDragModeBadge: { text: "Custom", lang: "en" },
1052
+ panelMoved: { text: "{title} を {column} 列目の {position} 番目へ移動しました", lang: "ja" },
1053
+ panelMoveUnavailable: { text: "{title} は{move}できません", lang: "ja" },
1054
+ panelDragStarted: { text: "{title} を持ち上げました", lang: "ja" },
1055
+ panelDragCancelled: { text: "{title} の移動を取り消しました", lang: "ja" },
1056
+ hiddenPanels: { text: "非表示のパネル:", lang: "ja" },
1057
+ hiddenPanelBadge: { text: "非表示", lang: "ja" },
1058
+ hiddenPanelNotice: { text: "このパネルは非表示です", lang: "ja" },
1059
+ emptyColumn: { text: "このエリアは空です", lang: "ja" },
1060
+ dropZone: { text: "Drop zone for column {column}", lang: "en" },
1061
+ dropHere: { text: "パネルをここにドロップ", lang: "ja" },
1062
+ resizeColumn: { text: "{column} 列目のカラム幅を調整", lang: "ja" }
1063
+ }), _t = new Set(Object.keys(qe)), cr = Object.freeze({
1064
+ panelMoved: Object.freeze(["title", "column", "position"]),
1065
+ panelMoveUnavailable: Object.freeze(["title", "move"]),
1066
+ panelDragStarted: Object.freeze(["title"]),
1067
+ panelDragCancelled: Object.freeze(["title"]),
1068
+ dropZone: Object.freeze(["column"]),
1069
+ resizeColumn: Object.freeze(["column"])
1070
+ }), Qt = /\{(\w+)\}/g, Hr = Object.freeze(Object.fromEntries(Object.entries(qe).map(([t, n]) => [t, n.text]))), ur = (t) => {
1071
+ if (t !== void 0) {
1072
+ const e = t;
1073
+ if (e === null || typeof e != "object")
1074
+ throw new TypeError(`[@aiquants/drag-drop-panels] labels must be an object; got ${e === null ? "null" : typeof e}`);
1075
+ for (const o of Object.keys(e))
1076
+ if (!_t.has(o))
1077
+ throw new RangeError(`[@aiquants/drag-drop-panels] labels has the unknown key "${o}"; the labels are ${[..._t].join(", ")}`);
1078
+ }
1079
+ const n = {};
1080
+ for (const e of Object.keys(qe)) {
1081
+ const o = t?.[e];
1082
+ if (o === void 0) {
1083
+ n[e] = qe[e];
1084
+ continue;
1085
+ }
1086
+ if (typeof o != "string")
1087
+ throw new TypeError(`[@aiquants/drag-drop-panels] label "${e}" must be a string; got ${o === null ? "null" : typeof o}`);
1088
+ const r = cr[e];
1089
+ if (r !== void 0) {
1090
+ for (const [, a] of o.matchAll(Qt))
1091
+ if (!r.includes(a))
1092
+ throw new RangeError(`[@aiquants/drag-drop-panels] label "${e}" uses the unknown placeholder {${a}}; it accepts ${r.map((l) => `{${l}}`).join(", ")}`);
1093
+ }
1094
+ n[e] = { text: o, lang: void 0 };
1095
+ }
1096
+ return Object.freeze(n);
1097
+ }, ze = (t, n) => {
1098
+ const e = [], o = (r, a) => {
1099
+ if (r === "") return;
1100
+ const l = e[e.length - 1];
1101
+ if (l !== void 0 && l.lang === a) {
1102
+ e[e.length - 1] = { text: `${l.text}${r}`, lang: a };
1103
+ return;
1104
+ }
1105
+ e.push({ text: r, lang: a });
1106
+ };
1107
+ for (const [r, a] of t.text.split(Qt).entries()) {
1108
+ if (r % 2 === 0) {
1109
+ o(a, t.lang);
1110
+ continue;
1111
+ }
1112
+ const l = n[a];
1113
+ if (l === void 0) throw new RangeError(`[@aiquants/drag-drop-panels] no value for the placeholder {${a}} of "${t.text}"`);
1114
+ typeof l == "number" ? o(String(l), t.lang) : o(l.text, l.lang);
1115
+ }
1116
+ return e;
1117
+ }, Rt = (t, n) => ({
1118
+ text: ze(t, n).map((e) => e.text).join(""),
1119
+ lang: t.lang
1120
+ }), dr = 229, hr = /* @__PURE__ */ new Set(["", "auto", "hint"]), mr = (t) => {
1121
+ for (const n of t.querySelectorAll("[popover]")) {
1122
+ const e = n.getAttribute("popover");
1123
+ if (e !== null && hr.has(e.toLowerCase()) && n.matches(":popover-open")) return !0;
1124
+ }
1125
+ return !1;
1126
+ }, fr = (t) => t.key !== "Escape" || t.defaultPrevented || t.isComposing || t.keyCode === dr || t.target instanceof Element && t.target.closest("dialog[open]") !== null ? !1 : !("popover" in HTMLElement.prototype && mr(document)), en = ({ columnId: t, onResizeStart: n, onResize: e, onResizeEnd: o, isResizing: r = !1, position: a = "right", className: l = "", debug: u = {}, label: f }) => {
1127
+ const b = W(!1), y = W(null);
1128
+ ee(() => {
1129
+ !r && b.current && (O(u, 1, "外部からのリサイズ解除を検出、ドラッグ状態を強制解除:", t), b.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
1130
+ }, [r, t, u]);
1131
+ const A = D(
1132
+ (c) => {
1133
+ c.preventDefault(), c.stopPropagation(), O(u, 2, "リサイズハンドル マウスダウン:", t), b.current = !0, n(t, c.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
676
1134
  },
677
- [r, e, c]
1135
+ [t, n, u]
678
1136
  );
679
- K(() => {
680
- const y = (j) => {
681
- h.current && (j.preventDefault(), n(j.clientX));
682
- }, l = () => {
683
- h.current && (E(c, 2, "リサイズハンドル マウスアップ:", r), h.current = !1, s(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
1137
+ ee(() => {
1138
+ const c = (k) => {
1139
+ b.current && (k.preventDefault(), e(k.clientX));
1140
+ }, P = () => {
1141
+ b.current && (O(u, 2, "リサイズハンドル マウスアップ:", t), b.current = !1, o(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
684
1142
  };
685
- return document.addEventListener("mousemove", y), document.addEventListener("mouseup", l), () => {
686
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", l);
1143
+ return document.addEventListener("mousemove", c), document.addEventListener("mouseup", P), () => {
1144
+ document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", P);
687
1145
  };
688
- }, [r, n, s, c]);
689
- const M = w(
690
- (y) => {
691
- y.preventDefault(), y.stopPropagation();
692
- const l = y.touches[0];
693
- E(c, 2, "リサイズハンドル タッチスタート:", r), h.current = !0, e(r, l.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
1146
+ }, [t, e, o, u]);
1147
+ const z = D(
1148
+ (c) => {
1149
+ c.preventDefault(), c.stopPropagation();
1150
+ const P = c.touches[0];
1151
+ O(u, 2, "リサイズハンドル タッチスタート:", t), b.current = !0, n(t, P.clientX), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.body.classList.add("resizing-column");
694
1152
  },
695
- [r, e, c]
1153
+ [t, n, u]
696
1154
  );
697
- K(() => {
698
- const y = (j) => {
699
- if (!h.current) return;
700
- j.preventDefault();
701
- const k = j.touches[0];
702
- n(k.clientX);
703
- }, l = () => {
704
- h.current && (E(c, 2, "リサイズハンドル タッチエンド:", r), h.current = !1, s(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
1155
+ ee(() => {
1156
+ const c = (k) => {
1157
+ if (!b.current) return;
1158
+ k.preventDefault();
1159
+ const S = k.touches[0];
1160
+ e(S.clientX);
1161
+ }, P = () => {
1162
+ b.current && (O(u, 2, "リサイズハンドル タッチエンド:", t), b.current = !1, o(), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
705
1163
  };
706
- return document.addEventListener("touchmove", y, { passive: !1 }), document.addEventListener("touchend", l), () => {
707
- document.removeEventListener("touchmove", y), document.removeEventListener("touchend", l);
1164
+ return document.addEventListener("touchmove", c, { passive: !1 }), document.addEventListener("touchend", P), () => {
1165
+ document.removeEventListener("touchmove", c), document.removeEventListener("touchend", P);
708
1166
  };
709
- }, [r, n, s, c]), K(() => () => {
710
- h.current && (E(c, 1, "リサイズハンドルアンマウント時のクリーンアップ:", r), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
711
- }, [r, c]);
712
- const T = ["resize-handle", i, o ? "resizing" : "", u].filter(Boolean).join(" ");
1167
+ }, [t, e, o, u]), ee(() => () => {
1168
+ b.current && (O(u, 1, "リサイズハンドルアンマウント時のクリーンアップ:", t), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("resizing-column"));
1169
+ }, [t, u]);
1170
+ const E = ["resize-handle", a, r ? "resizing" : "", l].filter(Boolean).join(" ");
713
1171
  return (
714
1172
  // biome-ignore lint/a11y/useFocusableInteractive: リサイズハンドルとして機能するためインタラクティブである必要がある
715
1173
  // biome-ignore lint/a11y/useSemanticElements: divを使用するが、aria-roleでセマンティックな意味を提供している
716
1174
  // biome-ignore lint/a11y/useAriaPropsForRole: リサイズハンドルのため、値の範囲を指定することが難しい
717
- /* @__PURE__ */ t.jsxs("div", { ref: N, className: T, onMouseDown: b, onTouchStart: M, "data-column-id": r, "data-position": i, "aria-label": `${r}のカラム幅を調整`, role: "separator", "aria-orientation": "vertical", children: [
718
- /* @__PURE__ */ t.jsx("div", { className: "resize-handle-bar" }),
719
- c.showPanelSizes && /* @__PURE__ */ t.jsxs("div", { className: "resize-handle-debug-info", children: [
720
- r,
721
- o && " (resizing)"
1175
+ /* @__PURE__ */ s.jsxs("div", { ref: y, className: E, onMouseDown: A, onTouchStart: z, "data-column-id": t, "data-position": a, "aria-label": f.text, lang: f.lang, role: "separator", "aria-orientation": "vertical", children: [
1176
+ /* @__PURE__ */ s.jsx("div", { className: "resize-handle-bar" }),
1177
+ u.showPanelSizes && /* @__PURE__ */ s.jsxs("div", { className: "resize-handle-debug-info", children: [
1178
+ t,
1179
+ r && " (resizing)"
722
1180
  ] })
723
1181
  ] })
724
1182
  );
725
- }, Gt = ({ columnId: r, width: e, minWidth: n = 100, maxWidth: s = 800, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c = !1, resizable: h = !0, className: N = "", debug: b = {}, children: M }) => {
726
- const T = ["resizable-column", c ? "resizing" : "", N].filter(Boolean).join(" ");
727
- return K(() => {
728
- const y = document.querySelector(`[data-column-id="${r}"]`);
729
- y && (y.style.setProperty("--column-width", `${e}px`), y.style.setProperty("--column-min-width", `${n}px`), y.style.setProperty("--column-max-width", `${s}px`));
730
- }, [r, e, n, s]), /* @__PURE__ */ t.jsxs("div", { className: T, "data-column-id": r, "data-width": e, "data-min-width": n, "data-max-width": s, children: [
731
- M,
732
- h && /* @__PURE__ */ t.jsx(Je, { columnId: r, onResizeStart: o, onResize: i, onResizeEnd: u, isResizing: c, position: "right", debug: b }),
733
- b.showPanelSizes && /* @__PURE__ */ t.jsxs("div", { className: "column-debug-size", children: [
734
- e,
1183
+ }, Yr = ({ columnId: t, width: n, minWidth: e = 100, maxWidth: o = 800, onResizeStart: r, onResize: a, onResizeEnd: l, isResizing: u = !1, resizable: f = !0, className: b = "", debug: y = {}, resizeHandleLabel: A, children: z }) => {
1184
+ const E = ["resizable-column", u ? "resizing" : "", b].filter(Boolean).join(" ");
1185
+ return ee(() => {
1186
+ const c = document.querySelector(`[data-column-id="${t}"]`);
1187
+ c && (c.style.setProperty("--column-width", `${n}px`), c.style.setProperty("--column-min-width", `${e}px`), c.style.setProperty("--column-max-width", `${o}px`));
1188
+ }, [t, n, e, o]), /* @__PURE__ */ s.jsxs("div", { className: E, "data-column-id": t, "data-width": n, "data-min-width": e, "data-max-width": o, children: [
1189
+ z,
1190
+ f && /* @__PURE__ */ s.jsx(en, { columnId: t, onResizeStart: r, onResize: a, onResizeEnd: l, isResizing: u, position: "right", debug: y, label: A }),
1191
+ y.showPanelSizes && /* @__PURE__ */ s.jsxs("div", { className: "column-debug-size", children: [
1192
+ n,
735
1193
  "px",
736
- c && " ↔"
1194
+ u && " ↔"
737
1195
  ] })
738
1196
  ] });
739
- }, Me = st(
1197
+ }, pr = Object.freeze({ longPressDelay: 500, slop: 10 }), Ve = Object.freeze(["longPressDelay", "slop"]), gr = (t) => {
1198
+ const n = t;
1199
+ if (n === null || typeof n != "object")
1200
+ throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig must be an object; got ${n === null ? "null" : typeof n}`);
1201
+ for (const e of Object.keys(n))
1202
+ if (!Ve.includes(e))
1203
+ throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig has the unknown key "${e}"; the keys are ${Ve.join(", ")}`);
1204
+ for (const e of Ve) {
1205
+ const o = t[e];
1206
+ if (typeof o != "number")
1207
+ throw new TypeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a number; got ${o === null ? "null" : typeof o}`);
1208
+ if (!Number.isFinite(o) || o < 0)
1209
+ throw new RangeError(`[@aiquants/drag-drop-panels] touchDragConfig.${e} must be a finite number of 0 or more; got ${o}`);
1210
+ }
1211
+ }, zt = Object.freeze({
1212
+ "previous-column": "movePanelToPreviousColumn",
1213
+ "next-column": "movePanelToNextColumn",
1214
+ up: "movePanelUp",
1215
+ down: "movePanelDown"
1216
+ }), xr = Object.freeze({ "previous-column": kn, "next-column": On, up: Mn, down: En }), vr = 'input, textarea, select, [contenteditable]:not([contenteditable="false"])', Ze = (t, n) => ({ segments: n, serial: t === null ? 1 : t.serial + 1 }), br = "​", yr = "(prefers-reduced-motion: reduce)", wr = () => typeof window.matchMedia == "function" && window.matchMedia(yr).matches, jr = (t) => {
1217
+ t.key === "Enter" && t.repeat && t.preventDefault();
1218
+ }, Me = ({ action: t, label: n, tooltip: e, unavailable: o, keyShortcuts: r, onActivate: a, children: l }) => /* @__PURE__ */ s.jsx(
1219
+ "button",
1220
+ {
1221
+ type: "button",
1222
+ [Ee]: t,
1223
+ "aria-label": n.text,
1224
+ "aria-disabled": o ? !0 : void 0,
1225
+ "aria-keyshortcuts": r,
1226
+ title: e,
1227
+ lang: n.lang,
1228
+ className: "rounded p-1 motion-safe:transition-colors",
1229
+ onClick: (u) => {
1230
+ u.stopPropagation(), a();
1231
+ },
1232
+ children: l
1233
+ }
1234
+ ), Je = hn(
740
1235
  ({
741
- index: r,
742
- columnIndex: e,
743
- isDragging: n,
744
- dragOverPosition: s,
745
- originalPosition: o,
746
- onDragEnter: i,
747
- onDragLeave: u,
748
- debugConfig: c,
749
- customDrag: h
750
- }) => /* @__PURE__ */ t.jsx(Ze, { index: r, columnIndex: e, isDragging: n, dragOverPosition: s, originalPosition: o, onDragEnter: i, onDragLeave: u, config: c, customDrag: h })
1236
+ index: t,
1237
+ columnIndex: n,
1238
+ isDragging: e,
1239
+ dragOverPosition: o,
1240
+ originalPosition: r,
1241
+ onDragEnter: a,
1242
+ onDragLeave: l,
1243
+ debugConfig: u,
1244
+ customDrag: f,
1245
+ label: b
1246
+ }) => /* @__PURE__ */ s.jsx(Bt, { index: t, columnIndex: n, isDragging: e, dragOverPosition: o, originalPosition: r, onDragEnter: a, onDragLeave: l, config: u, customDrag: f, label: b })
751
1247
  );
752
- Me.displayName = "LocalInsertPlaceholder";
753
- const Jt = ({
754
- columns: r,
755
- panels: e,
756
- columnPanels: n,
757
- // onColumnPanelsChange,
758
- panelVisibility: s,
759
- onPanelVisibilityChange: o,
760
- dragState: i,
1248
+ Je.displayName = "LocalInsertPlaceholder";
1249
+ const Fr = ({
1250
+ columns: t,
1251
+ panels: n,
1252
+ columnPanels: e,
1253
+ onColumnPanelsChange: o,
1254
+ panelVisibility: r,
1255
+ onPanelVisibilityChange: a,
1256
+ dragState: l,
761
1257
  dragOverPosition: u,
762
- originalPanelPosition: c,
763
- dragModes: h,
764
- onDragStart: N,
765
- onDragEnd: b,
766
- onPlaceholderDragEnter: M,
767
- onPlaceholderDragLeave: T,
768
- onDragOverWithInsert: y,
769
- onDropWithInsert: l,
770
- onColumnDragLeave: j,
771
- onPanelClick: k,
772
- onPanelMouseDown: _,
773
- onTouchStart: R,
774
- onTouchMove: z,
775
- onTouchEnd: Z,
776
- debugConfig: Y,
777
- panelSizes: U,
1258
+ originalPanelPosition: f,
1259
+ dragModes: b,
1260
+ onDragStart: y,
1261
+ onDragEnd: A,
1262
+ onPlaceholderDragEnter: z,
1263
+ onPlaceholderDragLeave: E,
1264
+ onDragOverWithInsert: c,
1265
+ onDropWithInsert: P,
1266
+ onColumnDragLeave: k,
1267
+ onPanelClick: S,
1268
+ onPanelMouseDown: N,
1269
+ debugConfig: R,
1270
+ panelSizes: d,
778
1271
  setPanelRef: $,
779
- enableResize: L = !1,
780
- columnWidths: f,
1272
+ enableResize: T = !1,
1273
+ columnWidths: Y,
781
1274
  // onColumnWidthChange,
782
- onResizeStart: x,
783
- onResize: C,
784
- onResizeEnd: W,
785
- isResizing: p = !1,
786
- resizingColumn: g,
1275
+ onResizeStart: G,
1276
+ onResize: g,
1277
+ onResizeEnd: v,
1278
+ isResizing: L = !1,
1279
+ resizingColumn: w,
787
1280
  onPanelSizeInfoClick: m,
788
- onToggleDragMode: v,
789
- onPanelClose: D,
790
- onPanelMaximizeChange: A,
791
- customDrag: O,
792
- dragHandle: H = "panel",
793
- maximizedPanel: a = null,
794
- panelClassName: d = "",
795
- scale: S,
796
- autoScale: X,
797
- onScaleChange: G
1281
+ onToggleDragMode: p,
1282
+ onPanelClose: j,
1283
+ onPanelMaximizeChange: _,
1284
+ customDrag: I,
1285
+ dragHandle: re = "panel",
1286
+ maximizedPanel: V = null,
1287
+ panelClassName: oe = "",
1288
+ scale: h,
1289
+ autoScale: x,
1290
+ onScaleChange: M,
1291
+ scrollRootElement: F = "div",
1292
+ labels: Z,
1293
+ touchDragConfig: ae = pr
798
1294
  }) => {
799
- const Q = F(Y);
800
- K(() => {
801
- Q.current = Y;
802
- }, [Y]);
803
- const { containerRef: V, scale: re } = Ct(X?.requiredWidth ?? 0, X?.minScale), ce = a ? 1 : S ?? (X ? re : 1), se = Number.isFinite(ce) && ce > 0 ? ce : 1, ge = F(se);
804
- ge.current = se, K(() => {
805
- G && G(se);
806
- }, [se, G]);
807
- const et = se < 1 ? {
808
- width: `${100 / se}%`,
809
- height: `${100 / se}%`,
810
- transform: `scale(${se})`,
1295
+ if (F !== "div" && F !== "main")
1296
+ throw new RangeError(`[@aiquants/drag-drop-panels] scrollRootElement must be "div" or "main"; got ${JSON.stringify(F)}`);
1297
+ const X = F, H = Re(() => ur(Z), [Z]);
1298
+ gr(ae);
1299
+ const ve = mn(), ue = Re(() => {
1300
+ const i = {};
1301
+ return n.forEach((C) => {
1302
+ i[C.id] = C;
1303
+ }), i;
1304
+ }, [n]), pe = Re(
1305
+ () => ({
1306
+ columnKeys: t.map((i) => i.key),
1307
+ columnPanels: e,
1308
+ panelVisibility: Object.fromEntries(Object.keys(r).map((i) => [i, r[i] === !0 && ue[i] !== void 0]))
1309
+ }),
1310
+ [t, e, r, ue]
1311
+ ), ot = V === null ? null : Pe(pe, V), de = ot !== null, be = W(R);
1312
+ ee(() => {
1313
+ be.current = R;
1314
+ }, [R]);
1315
+ const { containerRef: nn, scale: rn } = Jn(x?.requiredWidth ?? 0, x?.minScale), He = de ? 1 : h ?? (x ? rn : 1), ge = Number.isFinite(He) && He > 0 ? He : 1, st = W(ge);
1316
+ st.current = ge, ee(() => {
1317
+ M && M(ge);
1318
+ }, [ge, M]);
1319
+ const on = ge < 1 ? {
1320
+ width: `${100 / ge}%`,
1321
+ height: `${100 / ge}%`,
1322
+ transform: `scale(${ge})`,
811
1323
  transformOrigin: "top left"
812
- } : void 0, he = F({}), Ne = F(/* @__PURE__ */ new Map());
813
- K(() => {
814
- E(Q.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
815
- dragModes: h,
1324
+ } : void 0, he = W({}), Ye = W(/* @__PURE__ */ new Map());
1325
+ ee(() => {
1326
+ O(be.current, 1, "🎨 DragDropLayout - dragModes props changed:", {
1327
+ dragModes: b,
816
1328
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
817
- keys: Object.keys(h),
818
- values: Object.values(h)
1329
+ keys: Object.keys(b),
1330
+ values: Object.values(b)
819
1331
  });
820
- }, [h]);
821
- const De = Ue(() => {
822
- const P = {};
823
- return e.forEach((B) => {
824
- P[B.id] = B;
825
- }), P;
826
- }, [e]);
827
- K(() => {
828
- if (!(a && A))
1332
+ }, [b]);
1333
+ const [Fe, Ue] = se(null), Ae = W(null), at = W({ arrangement: pe, labels: H, panelComponentMap: ue });
1334
+ we(() => {
1335
+ at.current = { arrangement: pe, labels: H, panelComponentMap: ue };
1336
+ });
1337
+ const lt = W(null), it = W(null), sn = D((i) => {
1338
+ it.current = i;
1339
+ }, []), ct = W(null), Be = (i, C) => {
1340
+ const q = ue[C];
1341
+ if (q === void 0) return;
1342
+ const K = ze(i, { title: { text: q.title, lang: void 0 } });
1343
+ Ue((J) => Ze(J, K));
1344
+ }, ut = (i, C, q, K) => {
1345
+ const J = he.current[i], te = document.activeElement, ne = J instanceof HTMLElement && te !== null && J.contains(te) ? te.closest(`[${Ee}]`)?.getAttribute(Ee) ?? K : null;
1346
+ Ae.current = { panelId: i, from: C, columnPanels: pe.columnPanels, focusAction: ne }, o(q);
1347
+ }, dt = (i) => {
1348
+ for (const [C, q] of t.entries()) {
1349
+ const K = (e[q.key] ?? []).indexOf(i);
1350
+ if (K >= 0) return { columnIndex: C, panelIndex: K };
1351
+ }
1352
+ return null;
1353
+ }, an = (i, C) => {
1354
+ const q = Pe(pe, i), K = t[C.columnIndex], J = q === null || K === void 0 ? null : Yt(e, i, K.key, C.insertIndex);
1355
+ if (q === null || J === null) {
1356
+ Be(H.panelDragCancelled, i);
829
1357
  return;
830
- const P = (B) => {
831
- B.key === "Escape" && A(null);
1358
+ }
1359
+ ut(i, q, J, null);
1360
+ }, ht = !(l.isDragging || I?.isActive === !0 || de), ke = ir({
1361
+ config: ae,
1362
+ layoutRef: lt,
1363
+ scrollRootRef: it,
1364
+ scale: ge,
1365
+ canStart: ht,
1366
+ panelElementOf: (i) => he.current[i] ?? null,
1367
+ originOf: dt,
1368
+ onLift: (i) => Be(H.panelDragStarted, i),
1369
+ onDrop: an,
1370
+ onCancel: (i) => Be(H.panelDragCancelled, i)
1371
+ }), { touchDrag: ye } = ke, mt = ye !== null && (!ht || Pe(pe, ye.panelId) === null), ft = ke.cancel;
1372
+ ee(() => {
1373
+ mt && ft();
1374
+ }, [mt, ft]);
1375
+ const $e = l.isDragging || I?.isActive === !0 || ye !== null;
1376
+ we(() => {
1377
+ $e && (Ae.current = null);
1378
+ }, [$e]), we(() => {
1379
+ const i = Ae.current;
1380
+ if (i === null || (Ae.current = null, !Vn(i.columnPanels, e, i.panelId))) return;
1381
+ const C = at.current, q = Pe({ ...C.arrangement, columnPanels: e }, i.panelId);
1382
+ if (q === null || q.column === i.from.column && q.index === i.from.index) return;
1383
+ const K = ze(C.labels.panelMoved, { title: { text: C.panelComponentMap[i.panelId].title, lang: void 0 }, column: q.column + 1, position: q.index + 1 });
1384
+ Ue((Q) => Ze(Q, K));
1385
+ const J = he.current[i.panelId];
1386
+ if (i.focusAction === null || J === null || J === void 0) return;
1387
+ const { activeElement: te, body: ne } = document;
1388
+ if (te === null || te === ne) {
1389
+ const Q = J.querySelector(`[${Ee}="${i.focusAction}"]`);
1390
+ Q instanceof HTMLElement && Q.focus({ preventScroll: !0 });
1391
+ }
1392
+ const U = document.activeElement;
1393
+ U instanceof HTMLElement && J.contains(U) && U.scrollIntoView({ block: "nearest", inline: "nearest" });
1394
+ }, [e]), ee(() => {
1395
+ if (!(de && _))
1396
+ return;
1397
+ const i = (C) => {
1398
+ fr(C) && (C.preventDefault(), _(null));
832
1399
  };
833
- return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
834
- }, [a, A]), Se(() => {
835
- const P = /* @__PURE__ */ new Map();
836
- Object.keys(he.current).forEach((q) => {
837
- const ne = he.current[q];
838
- if (ne) {
839
- const de = ne.getBoundingClientRect();
840
- P.set(q, {
841
- rect: de,
842
- height: ne.offsetHeight,
843
- width: ne.offsetWidth
1400
+ return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
1401
+ }, [de, _]), we(() => {
1402
+ const i = /* @__PURE__ */ new Map();
1403
+ Object.keys(he.current).forEach((ne) => {
1404
+ const U = he.current[ne];
1405
+ if (U) {
1406
+ const Q = U.getBoundingClientRect();
1407
+ i.set(ne, {
1408
+ rect: Q,
1409
+ height: U.offsetHeight,
1410
+ width: U.offsetWidth
844
1411
  });
845
1412
  }
846
1413
  });
847
- const B = Ne.current, ee = 300, me = /* @__PURE__ */ new Set();
848
- Object.values(n).forEach((q) => {
849
- q.forEach((ne) => {
850
- me.add(ne);
1414
+ const C = Ye.current, q = 300, K = /* @__PURE__ */ new Set();
1415
+ Object.values(e).forEach((ne) => {
1416
+ ne.forEach((U) => {
1417
+ K.add(U);
851
1418
  });
852
- }), new Set(B.keys()).forEach((q) => {
853
- me.has(q) || (E(Q.current, 1, "パネル削除検出 - クリーンアップ:", q), B.delete(q), he.current[q] && delete he.current[q]);
854
- }), P.forEach((q, ne) => {
855
- const de = B.get(ne);
856
- if (de) {
857
- const J = de.rect.left - q.rect.left, fe = de.rect.top - q.rect.top;
858
- if (J !== 0 || fe !== 0) {
859
- E(Q.current, 2, "パネル移動検出 - アニメーション開始:", ne, { dx: J, dy: fe });
860
- const ae = he.current[ne];
861
- if (ae) {
862
- const be = ge.current || 1;
863
- ae.style.transform = `translate(${J / be}px, ${fe / be}px)`, ae.style.transition = "none", ae.classList.add("is-moving"), requestAnimationFrame(() => {
864
- ae.style.transition = `transform ${ee}ms cubic-bezier(0.2, 0, 0.2, 1)`, ae.style.transform = "translate(0, 0)", setTimeout(() => {
865
- ae.style.transition = "", ae.style.transform = "", ae.classList.remove("is-moving");
866
- }, ee);
1419
+ }), new Set(C.keys()).forEach((ne) => {
1420
+ K.has(ne) || (O(be.current, 1, "パネル削除検出 - クリーンアップ:", ne), C.delete(ne), he.current[ne] && delete he.current[ne]);
1421
+ });
1422
+ const te = !wr();
1423
+ i.forEach((ne, U) => {
1424
+ if (!te) return;
1425
+ const Q = C.get(U);
1426
+ if (Q) {
1427
+ const le = Q.rect.left - ne.rect.left, xe = Q.rect.top - ne.rect.top;
1428
+ if (le !== 0 || xe !== 0) {
1429
+ O(be.current, 2, "パネル移動検出 - アニメーション開始:", U, { dx: le, dy: xe });
1430
+ const ce = he.current[U];
1431
+ if (ce) {
1432
+ const Te = st.current || 1;
1433
+ ce.style.transform = `translate(${le / Te}px, ${xe / Te}px)`, ce.style.transition = "none", ce.classList.add("is-moving"), requestAnimationFrame(() => {
1434
+ ce.style.transition = `transform ${q}ms cubic-bezier(0.2, 0, 0.2, 1)`, ce.style.transform = "translate(0, 0)", setTimeout(() => {
1435
+ ce.style.transition = "", ce.style.transform = "", ce.classList.remove("is-moving");
1436
+ }, q);
867
1437
  });
868
1438
  }
869
1439
  }
870
1440
  } else {
871
- E(Q.current, 1, "新規パネル検出 - フェードインアニメーション:", ne);
872
- const J = he.current[ne];
873
- J && (J.style.opacity = "0", J.style.transition = "none", requestAnimationFrame(() => {
874
- J.style.transition = `opacity ${ee}ms ease-out`, J.style.opacity = "1", setTimeout(() => {
875
- J.style.transition = "", J.style.opacity = "";
876
- }, ee);
1441
+ O(be.current, 1, "新規パネル検出 - フェードインアニメーション:", U);
1442
+ const le = he.current[U];
1443
+ le && (le.style.opacity = "0", le.style.transition = "none", requestAnimationFrame(() => {
1444
+ le.style.transition = `opacity ${q}ms ease-out`, le.style.opacity = "1", setTimeout(() => {
1445
+ le.style.transition = "", le.style.opacity = "";
1446
+ }, q);
877
1447
  }));
878
1448
  }
879
- }), Ne.current = P;
880
- }, [n]), Se(() => {
881
- const P = /* @__PURE__ */ new Map();
882
- Object.keys(he.current).forEach((B) => {
883
- const ee = he.current[B];
884
- ee && P.set(B, { rect: ee.getBoundingClientRect(), height: ee.offsetHeight, width: ee.offsetWidth });
885
- }), Ne.current = P;
886
- }, [se]);
887
- const tt = (P) => {
888
- if (!s[P]) return null;
889
- const B = De[P];
890
- if (!B)
891
- return E(Q.current, 1, `Panel config not found for panelId: ${P}`), null;
892
- const ee = B.component, me = B.title, ue = i.draggedPanel === P, q = h[P] || "normal";
893
- E(Q.current, 2, `🎨 renderPanel - ${P}:`, {
894
- panelId: P,
895
- dragMode: q,
1449
+ }), Ye.current = i;
1450
+ }, [e]), we(() => {
1451
+ const i = /* @__PURE__ */ new Map();
1452
+ Object.keys(he.current).forEach((C) => {
1453
+ const q = he.current[C];
1454
+ q && i.set(C, { rect: q.getBoundingClientRect(), height: q.offsetHeight, width: q.offsetWidth });
1455
+ }), Ye.current = i;
1456
+ }, [ge]);
1457
+ const pt = (i, C, q) => {
1458
+ if ($e) return;
1459
+ const K = Xn(pe, i, C);
1460
+ if (K === null) {
1461
+ if (q) {
1462
+ const J = ze(H.panelMoveUnavailable, { title: { text: ue[i].title, lang: void 0 }, move: H[zt[C]] });
1463
+ Ue((te) => Ze(te, J));
1464
+ }
1465
+ return;
1466
+ }
1467
+ ut(i, K.from, K.columnPanels, `move-${C}`);
1468
+ }, ln = (i, C) => {
1469
+ if (i.defaultPrevented || de || !(i.target instanceof Node && i.currentTarget.contains(i.target))) return;
1470
+ const q = Zn(i);
1471
+ q !== null && (i.target instanceof Element && i.target.closest(vr) !== null || (i.preventDefault(), !i.repeat && pt(C, q, !0)));
1472
+ }, gt = (i, C) => {
1473
+ const q = ct.current;
1474
+ if (q === "touch" || q === "pen") {
1475
+ i.preventDefault();
1476
+ return;
1477
+ }
1478
+ y(i, C);
1479
+ }, Xe = ye === null ? u : ye.over, xt = ye === null ? f : dt(ye.panelId), cn = (i) => {
1480
+ if (!r[i]) return null;
1481
+ const C = ue[i];
1482
+ if (!C)
1483
+ return O(be.current, 1, `Panel config not found for panelId: ${i}`), null;
1484
+ const q = C.component, K = C.title, J = l.draggedPanel === i || ye?.panelId === i, te = b[i] || "normal";
1485
+ O(be.current, 2, `🎨 renderPanel - ${i}:`, {
1486
+ panelId: i,
1487
+ dragMode: te,
896
1488
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
897
1489
  });
898
- const ne = (I) => {
899
- he.current[P] = I, $ && $(P, I), I && Y.showPanelSizes && requestAnimationFrame(() => {
900
- const ye = I.getBoundingClientRect(), Le = window.getComputedStyle(I);
901
- E(Q.current, 1, `Panel ${P} mounted with size:`, {
902
- width: ye.width,
903
- height: ye.height,
904
- x: ye.left,
905
- y: ye.top,
906
- minHeight: Le.minHeight,
907
- maxHeight: Le.maxHeight
1490
+ const ne = (B) => {
1491
+ he.current[i] = B, $ && $(i, B), B && R.showPanelSizes && requestAnimationFrame(() => {
1492
+ const je = B.getBoundingClientRect(), Ne = window.getComputedStyle(B);
1493
+ O(be.current, 1, `Panel ${i} mounted with size:`, {
1494
+ width: je.width,
1495
+ height: je.height,
1496
+ x: je.left,
1497
+ y: je.top,
1498
+ minHeight: Ne.minHeight,
1499
+ maxHeight: Ne.maxHeight
908
1500
  });
909
1501
  });
910
- }, de = U[P], J = a === P, fe = !!A, ae = () => A?.(J ? null : P), be = J ? {
1502
+ }, U = d[i], Q = V === i, le = !!_, xe = () => _?.(Q ? null : i), ce = Q ? null : new Set(Bn(pe, i)), Te = Q ? {
911
1503
  position: "fixed",
912
1504
  top: "var(--aqdd-maximize-top, 0px)",
913
1505
  right: "var(--aqdd-maximize-right, 0px)",
@@ -917,473 +1509,475 @@ const Jt = ({
917
1509
  minHeight: 0,
918
1510
  maxHeight: "none"
919
1511
  } : {
920
- minHeight: B.minHeight ?? "200px",
921
- maxHeight: B.maxHeight ?? "500px"
922
- }, ve = H === "header", Oe = q === "normal" && !ve && !J, Te = q === "normal" && ve && !J, _e = ue ? "cursor-grabbing" : "cursor-grab", Re = `panel-draggable group relative flex flex-col overflow-hidden border border-slate-200 text-left shadow-lg backdrop-blur-lg ${q === "custom" ? "select-none" : ""}`, rt = J ? (
923
- // 最大化中: 角丸・ホバー演出・grab カーソル無し、背景は不透過寄りで下のレイアウトを遮蔽
924
- `${Re} rounded-none bg-white/95 p-4 ${d}`
925
- ) : `${Re} rounded-2xl bg-white/80 p-4 transition-all duration-300 hover:-translate-y-1 hover:shadow-xl ${ve ? "" : _e} ${d}`;
1512
+ minHeight: C.minHeight ?? "200px",
1513
+ maxHeight: C.maxHeight ?? "500px"
1514
+ }, Le = re === "header", bt = te === "normal" && !Le && !Q, yt = te === "normal" && Le && !Q, wt = J ? "cursor-grabbing" : "cursor-grab", jt = `panel-draggable relative flex flex-col overflow-hidden border text-left shadow-lg backdrop-blur-lg ${te === "custom" ? "select-none" : ""}`, dn = Q ? (
1515
+ // 最大化中: 角丸・ホバー演出・grab カーソル無し (下のレイアウトを遮蔽する不透過寄りの面は CSS が data-maximized で描く)
1516
+ `${jt} rounded-none p-4 ${oe}`
1517
+ ) : `${jt} rounded-2xl p-4 motion-safe:transition-all motion-safe:duration-300 motion-safe:hover:-translate-y-1 hover:shadow-xl ${Le ? "" : wt} ${oe}`, Pt = te === "custom" ? H.switchToNormalDragMode : H.switchToCustomDragMode, Et = Q ? H.restorePanel : H.maximizePanel;
926
1518
  return (
927
1519
  // biome-ignore lint/a11y/noStaticElementInteractions: クリックイベントを持つ静的要素
928
- /* @__PURE__ */ t.jsxs(
1520
+ /* @__PURE__ */ s.jsxs(
929
1521
  "div",
930
1522
  {
931
1523
  ref: ne,
932
- "data-panel-id": P,
933
- "data-dragging": ue,
934
- "data-maximized": J || void 0,
1524
+ "data-panel-id": i,
1525
+ "data-aqdd-panel": !0,
1526
+ "data-aqdd-drag-mode": te,
1527
+ "data-dragging": J,
1528
+ "data-maximized": Q || void 0,
935
1529
  role: "presentation",
936
- draggable: Oe,
937
- onDragStart: (I) => Oe && N(I, P),
938
- onDragEnd: b,
939
- onClick: (I) => k?.(I, P),
940
- onMouseDown: (I) => _?.(I, P),
941
- onTouchStart: (I) => R?.(I, P),
942
- onTouchMove: z,
943
- onTouchEnd: Z,
944
- style: be,
945
- className: rt,
1530
+ draggable: bt,
1531
+ onDragStart: (B) => bt && gt(B, i),
1532
+ onDragEnd: A,
1533
+ onClick: (B) => S?.(B, i),
1534
+ onMouseDown: (B) => N?.(B, i),
1535
+ onKeyDown: (B) => ln(B, i),
1536
+ style: Te,
1537
+ className: dn,
946
1538
  children: [
947
- /* @__PURE__ */ t.jsxs(
1539
+ /* @__PURE__ */ s.jsxs(
948
1540
  "div",
949
1541
  {
950
- className: `group relative mb-3 flex items-center justify-between ${ve && !J ? _e : ""}`,
951
- draggable: Te,
952
- onDragStart: (I) => Te && N(I, P),
953
- onDoubleClick: fe ? (I) => {
954
- I.stopPropagation(), ae();
1542
+ ref: ke.bindHeader,
1543
+ "data-aqdd-panel-header": !0,
1544
+ className: `relative mb-3 ${Le && !Q ? wt : ""}`,
1545
+ draggable: yt,
1546
+ onDragStart: (B) => yt && gt(B, i),
1547
+ onPointerDown: (B) => ke.pressHeader(B, i),
1548
+ onContextMenu: ke.holdContextMenu,
1549
+ onKeyDown: jr,
1550
+ onDoubleClick: le ? (B) => {
1551
+ B.stopPropagation(), !(B.target instanceof Element && B.target.closest(`[${Ee}]`) !== null) && xe();
955
1552
  } : void 0,
956
1553
  children: [
957
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
958
- /* @__PURE__ */ t.jsx("h3", { className: "font-semibold text-lg text-slate-700 transition-colors group-hover:text-slate-900", children: me }),
959
- q === "custom" && /* @__PURE__ */ t.jsx("span", { className: "rounded-md bg-orange-100 px-2 py-1 font-medium text-orange-600 text-xs", children: "Custom" })
960
- ] }),
961
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-1 opacity-0 transition-opacity group-hover:opacity-100", children: [
962
- /* @__PURE__ */ t.jsx(
963
- "button",
964
- {
965
- type: "button",
966
- onClick: (I) => {
967
- I.stopPropagation(), v && v(P);
968
- },
969
- onKeyDown: (I) => {
970
- (I.key === "Enter" || I.key === " ") && (I.preventDefault(), I.stopPropagation(), v && v(P));
971
- },
972
- tabIndex: 0,
973
- className: `cursor-pointer rounded p-1 text-xs transition-colors ${q === "custom" ? "bg-orange-100 text-orange-600 hover:bg-orange-200" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600"}`,
974
- title: q === "custom" ? "通常ドラッグモードに戻す" : "カスタムドラッグモードに切り替え",
975
- children: q === "custom" ? /* @__PURE__ */ t.jsx(kt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(jt, { className: "h-4 w-4" })
976
- }
977
- ),
978
- !J && /* @__PURE__ */ t.jsx(
979
- "button",
980
- {
981
- type: "button",
982
- onClick: (I) => {
983
- I.stopPropagation(), o({
984
- ...s,
985
- [P]: !1
986
- });
987
- },
988
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
989
- title: "パネルを非表示",
990
- children: /* @__PURE__ */ t.jsx(Xe, { className: "h-4 w-4" })
991
- }
992
- ),
993
- fe && /* @__PURE__ */ t.jsx(
994
- "button",
995
- {
996
- type: "button",
997
- onClick: (I) => {
998
- I.stopPropagation(), ae();
999
- },
1000
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
1001
- title: J ? "元のサイズに戻す" : "パネルを最大化",
1002
- children: J ? /* @__PURE__ */ t.jsx(yt, { className: "h-4 w-4" }) : /* @__PURE__ */ t.jsx(bt, { className: "h-4 w-4" })
1003
- }
1004
- ),
1005
- D && /* @__PURE__ */ t.jsx(
1006
- "button",
1007
- {
1008
- type: "button",
1009
- onClick: (I) => {
1010
- I.stopPropagation(), D(P);
1011
- },
1012
- className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-red-500",
1013
- title: "パネルを閉じる",
1014
- children: /* @__PURE__ */ t.jsx(Ve, { className: "h-4 w-4" })
1015
- }
1016
- )
1554
+ /* @__PURE__ */ s.jsx("h3", { "data-aqdd-panel-title": !0, className: "font-semibold text-lg", children: K }),
1555
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-panel-controls": !0, children: [
1556
+ te === "custom" && /* @__PURE__ */ s.jsx("span", { "data-aqdd-custom-badge": !0, lang: H.customDragModeBadge.lang, className: "rounded-md px-2 py-1 font-medium text-xs", children: H.customDragModeBadge.text }),
1557
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-panel-buttons": !0, children: [
1558
+ ce !== null && De.map((B) => {
1559
+ const je = xr[B], Ne = H[zt[B]], Dt = Ut[B];
1560
+ return /* @__PURE__ */ s.jsx(Me, { action: `move-${B}`, label: Ne, tooltip: `${Ne.text} (${Dt.text})`, unavailable: !ce.has(B), keyShortcuts: Dt.aria, onActivate: () => pt(i, B, !1), children: /* @__PURE__ */ s.jsx(je, { className: "h-4 w-4", "aria-hidden": "true" }) }, B);
1561
+ }),
1562
+ /* @__PURE__ */ s.jsx(Me, { action: "drag-mode", label: Pt, tooltip: Pt.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => p?.(i), children: te === "custom" ? /* @__PURE__ */ s.jsx(In, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ s.jsx(qn, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1563
+ !Q && /* @__PURE__ */ s.jsx(Me, { action: "hide", label: H.hidePanel, tooltip: H.hidePanel.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => a({ ...r, [i]: !1 }), children: /* @__PURE__ */ s.jsx(Mt, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1564
+ le && /* @__PURE__ */ s.jsx(Me, { action: Q ? "restore" : "maximize", label: Et, tooltip: Et.text, unavailable: !1, keyShortcuts: void 0, onActivate: xe, children: Q ? /* @__PURE__ */ s.jsx(Rn, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ s.jsx(Ln, { className: "h-4 w-4", "aria-hidden": "true" }) }),
1565
+ j && /* @__PURE__ */ s.jsx(Me, { action: "close", label: H.closePanel, tooltip: H.closePanel.text, unavailable: !1, keyShortcuts: void 0, onActivate: () => j(i), children: /* @__PURE__ */ s.jsx(Ht, { className: "h-4 w-4", "aria-hidden": "true" }) })
1566
+ ] })
1017
1567
  ] })
1018
1568
  ]
1019
1569
  }
1020
1570
  ),
1021
- /* @__PURE__ */ t.jsx("div", { "data-aqdd-scroll-area": !0, className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ t.jsx(ee, { ...B.props || {} }) }),
1022
- /* @__PURE__ */ t.jsx(Dt, { config: Y, panelId: P, sizeInfo: de, onSizeInfoClick: (I) => m?.(I, P) })
1571
+ /* @__PURE__ */ s.jsx("div", { "data-aqdd-scroll-area": !0, className: "panel-scroll-area min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ s.jsx(q, { ...C.props || {} }) }),
1572
+ /* @__PURE__ */ s.jsx(Yn, { config: R, panelId: i, sizeInfo: U, onSizeInfoClick: (B) => m?.(B, i) })
1023
1573
  ]
1024
1574
  },
1025
- P
1575
+ i
1026
1576
  )
1027
1577
  );
1028
- }, nt = (P, B) => {
1029
- const ee = n[P] || [];
1030
- let me = !1;
1031
- for (const q of ee)
1032
- if (s[q]) {
1033
- me = !0;
1578
+ }, un = (i, C) => {
1579
+ const q = e[i] || [];
1580
+ let K = !1;
1581
+ for (const U of q)
1582
+ if (r[U]) {
1583
+ K = !0;
1034
1584
  break;
1035
1585
  }
1036
- const ue = i.isDragging || (O?.isActive ?? !1);
1037
- return /* @__PURE__ */ t.jsx(Ge, { columnIndex: B, isDragging: ue, dragOverPosition: u, config: Y, children: /* @__PURE__ */ t.jsxs(
1586
+ const J = $e, te = Rt(H.dropZone, { column: C + 1 }), ne = `${ve}-drop-zone-${C}`;
1587
+ return /* @__PURE__ */ s.jsx(Xt, { columnIndex: C, isDragging: J, dragOverPosition: Xe, config: R, children: /* @__PURE__ */ s.jsxs(
1038
1588
  "section",
1039
1589
  {
1040
1590
  "data-drop-zone": "true",
1041
- "data-column-key": P,
1042
- "data-column-index": B,
1043
- "aria-label": `Drop zone for column ${B + 1}`,
1044
- onDragOver: (q) => y(q, B),
1045
- onDrop: (q) => l(q, P),
1046
- onDragLeave: j,
1047
- className: "relative flex h-full flex-col transition-all duration-200",
1591
+ "data-column-key": i,
1592
+ "data-column-index": C,
1593
+ "aria-labelledby": ne,
1594
+ onDragOver: (U) => c(U, C),
1595
+ onDrop: (U) => P(U, i),
1596
+ onDragLeave: k,
1597
+ className: "relative flex h-full flex-col motion-safe:transition-all motion-safe:duration-200",
1048
1598
  children: [
1049
- /* @__PURE__ */ t.jsx("div", { className: "placeholder-container", children: /* @__PURE__ */ t.jsx(
1050
- Me,
1599
+ /* @__PURE__ */ s.jsx("span", { id: ne, hidden: !0, lang: te.lang, children: te.text }),
1600
+ /* @__PURE__ */ s.jsx("div", { className: "placeholder-container", inert: de, children: /* @__PURE__ */ s.jsx(
1601
+ Je,
1051
1602
  {
1052
1603
  index: 0,
1053
- columnIndex: B,
1054
- isDragging: ue,
1055
- dragOverPosition: u,
1056
- originalPosition: c,
1057
- onDragEnter: M,
1058
- onDragLeave: T,
1059
- debugConfig: Y,
1060
- customDrag: O
1604
+ columnIndex: C,
1605
+ isDragging: J,
1606
+ dragOverPosition: Xe,
1607
+ originalPosition: xt,
1608
+ onDragEnter: z,
1609
+ onDragLeave: E,
1610
+ debugConfig: R,
1611
+ customDrag: I,
1612
+ label: H.dropHere
1061
1613
  }
1062
1614
  ) }),
1063
- ee.map((q, ne) => {
1064
- const de = s[q], J = !(de || ue);
1065
- return /* @__PURE__ */ t.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: [
1066
- de ? tt(q) : ue ? (
1067
- /* ドラッグ中のみ隠されたパネルのダミー表示 */
1068
- /* @__PURE__ */ t.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: [
1069
- /* @__PURE__ */ t.jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [
1070
- /* @__PURE__ */ t.jsx("h3", { className: "font-semibold text-amber-700 text-base", children: De[q]?.title || q }),
1071
- /* @__PURE__ */ t.jsx("span", { className: "rounded-md bg-amber-100 px-2 py-1 font-medium text-amber-600 text-xs", children: "非表示" })
1072
- ] }),
1073
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ t.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ t.jsxs("div", { className: "text-center text-amber-600", children: [
1074
- /* @__PURE__ */ t.jsx(Xe, { className: "mx-auto h-6 w-6 opacity-50" }),
1075
- /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-xs", children: "このパネルは非表示です" })
1076
- ] }) }) })
1077
- ] })
1078
- ) : null,
1079
- /* @__PURE__ */ t.jsx(
1080
- Me,
1081
- {
1082
- index: ne + 1,
1083
- columnIndex: B,
1084
- isDragging: ue,
1085
- dragOverPosition: u,
1086
- originalPosition: c,
1087
- onDragEnter: M,
1088
- onDragLeave: T,
1089
- debugConfig: Y,
1090
- customDrag: O
1091
- }
1092
- )
1093
- ] }, `panel-${q}`);
1615
+ q.map((U, Q) => {
1616
+ const le = r[U], xe = !(le || J), ce = de && U === V;
1617
+ return /* @__PURE__ */ s.jsxs(
1618
+ "div",
1619
+ {
1620
+ className: `panel-with-placeholder ${xe ? "m-0 h-0 overflow-hidden p-0" : ""}`,
1621
+ "data-panel-hidden": xe ? "true" : void 0,
1622
+ "aria-hidden": xe ? "true" : void 0,
1623
+ inert: de && !ce,
1624
+ children: [
1625
+ le ? cn(U) : J ? (
1626
+ /* ドラッグ中のみ隠されたパネルの代わりを出す (面・枠線・文字・印の色は CSS が --aqdd-* の変数から描く) */
1627
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-hidden-panel-stand-in": !0, className: "hidden-panel-placeholder relative h-[120px] rounded-2xl border-2 border-dashed p-3 text-left shadow-lg backdrop-blur-lg", children: [
1628
+ /* @__PURE__ */ s.jsxs("div", { className: "mb-2 flex items-center space-x-2", children: [
1629
+ /* @__PURE__ */ s.jsx("h3", { className: "font-semibold text-base", children: ue[U]?.title || U }),
1630
+ /* @__PURE__ */ s.jsx("span", { "data-aqdd-hidden-panel-badge": !0, lang: H.hiddenPanelBadge.lang, className: "rounded-md px-2 py-1 font-medium text-xs", children: H.hiddenPanelBadge.text })
1631
+ ] }),
1632
+ /* @__PURE__ */ s.jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ s.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ s.jsxs("div", { className: "text-center", children: [
1633
+ /* @__PURE__ */ s.jsx(Mt, { className: "mx-auto h-6 w-6 opacity-50", "aria-hidden": "true" }),
1634
+ /* @__PURE__ */ s.jsx("p", { lang: H.hiddenPanelNotice.lang, className: "mt-1 text-xs", children: H.hiddenPanelNotice.text })
1635
+ ] }) }) })
1636
+ ] })
1637
+ ) : null,
1638
+ ce ? null : /* @__PURE__ */ s.jsx(
1639
+ Je,
1640
+ {
1641
+ index: Q + 1,
1642
+ columnIndex: C,
1643
+ isDragging: J,
1644
+ dragOverPosition: Xe,
1645
+ originalPosition: xt,
1646
+ onDragEnter: z,
1647
+ onDragLeave: E,
1648
+ debugConfig: R,
1649
+ customDrag: I,
1650
+ label: H.dropHere
1651
+ }
1652
+ )
1653
+ ]
1654
+ },
1655
+ `panel-${U}`
1656
+ );
1094
1657
  }),
1095
- !(me || ue) && /* @__PURE__ */ t.jsx("div", { className: "flex-shrink-0 rounded-xl border-2 border-slate-200 border-dashed bg-white/30 p-8 text-center text-slate-400 transition-all duration-200", children: /* @__PURE__ */ t.jsx("div", { className: "text-sm", children: "このエリアは空です" }) })
1658
+ !(K || J) && /* @__PURE__ */ s.jsx("div", { "data-aqdd-empty-column": !0, className: "flex-shrink-0 rounded-xl border-2 border-dashed p-8 text-center motion-safe:transition-all motion-safe:duration-200", inert: de, children: /* @__PURE__ */ s.jsx("div", { lang: H.emptyColumn.lang, className: "text-sm", children: H.emptyColumn.text }) })
1096
1659
  ]
1097
1660
  }
1098
1661
  ) });
1099
- }, Ae = Object.keys(s).filter((P) => !s[P]);
1100
- return /* @__PURE__ */ t.jsxs("div", { className: "flex h-full flex-col", children: [
1101
- Ae.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "border-slate-200 border-b bg-white/70 px-4 py-2 backdrop-blur-lg", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap gap-2", children: [
1102
- /* @__PURE__ */ t.jsx("span", { className: "mr-2 text-slate-600 text-sm", children: "非表示のパネル:" }),
1103
- Ae.map((P) => {
1104
- const ee = De[P]?.title || P;
1105
- return /* @__PURE__ */ t.jsxs(
1106
- "button",
1107
- {
1108
- type: "button",
1109
- onClick: () => o({
1110
- ...s,
1111
- [P]: !0
1112
- }),
1113
- 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",
1114
- children: [
1115
- /* @__PURE__ */ t.jsx(pt, { className: "h-3 w-3" }),
1116
- /* @__PURE__ */ t.jsx("span", { children: ee })
1117
- ]
1118
- },
1119
- P
1120
- );
1121
- })
1122
- ] }) }),
1123
- /* @__PURE__ */ t.jsx("div", { ref: V, className: "relative min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ t.jsx("div", { className: "h-full w-full", style: et, children: /* @__PURE__ */ t.jsx("main", { "data-aqdd-scroll-root": !0, className: "no-scrollbar h-full max-w-full flex-1 overflow-auto px-4 py-6 sm:px-6", children: /* @__PURE__ */ t.jsx("div", { className: "relative flex h-full items-start gap-6 pr-4", children: r.map((P, B) => {
1124
- const ee = f?.[P.id] || P.initialWidth || 350, me = L && (P.resizable ?? !0);
1125
- return /* @__PURE__ */ t.jsx(ot, { children: /* @__PURE__ */ t.jsxs(
1126
- "div",
1127
- {
1128
- className: `column relative ${P.className || ""} ${L ? "resize-enabled-column" : "auto-width-column"} ${p && g === P.id ? "column-resizing-active" : ""}`,
1129
- "data-column": B,
1130
- "data-column-id": P.id,
1131
- "data-min-width": P.minWidth || 350,
1132
- "data-max-width": P.maxWidth,
1133
- "data-column-width": L ? ee : void 0,
1134
- ...L && {
1135
- style: { "--column-width": `${ee}px` }
1136
- },
1137
- children: [
1138
- nt(P.key, B),
1139
- me && x && C && W && /* @__PURE__ */ t.jsx(Je, { columnId: P.id, onResizeStart: x, onResize: C, onResizeEnd: W, isResizing: p && g === P.id, position: "right", debug: Y })
1140
- ]
1141
- }
1142
- ) }, P.id);
1143
- }) }) }) }) })
1144
- ] });
1662
+ }, vt = Object.keys(r).filter((i) => !r[i]);
1663
+ return /* @__PURE__ */ s.jsxs(
1664
+ "div",
1665
+ {
1666
+ ref: lt,
1667
+ "data-aqdd-layout": !0,
1668
+ className: "flex h-full flex-col",
1669
+ onPointerDownCapture: (i) => {
1670
+ ct.current = i.pointerType;
1671
+ },
1672
+ children: [
1673
+ /* @__PURE__ */ s.jsxs("div", { "data-aqdd-announcer": !0, role: "status", "aria-live": "polite", "aria-atomic": "true", inert: de, children: [
1674
+ Fe?.segments.map(
1675
+ (i, C) => i.lang === void 0 ? i.text : /* @__PURE__ */ s.jsx("span", { lang: i.lang, children: i.text }, C)
1676
+ ),
1677
+ Fe !== null && Fe.serial % 2 === 0 ? br : null
1678
+ ] }),
1679
+ vt.length > 0 && /* @__PURE__ */ s.jsx("div", { "data-aqdd-hidden-panels": !0, className: "border-b px-4 py-2 backdrop-blur-lg", inert: de, children: /* @__PURE__ */ s.jsxs("div", { className: "flex flex-wrap gap-2", children: [
1680
+ /* @__PURE__ */ s.jsx("span", { lang: H.hiddenPanels.lang, className: "mr-2 text-sm", children: H.hiddenPanels.text }),
1681
+ vt.map((i) => {
1682
+ const q = ue[i]?.title || i;
1683
+ return /* @__PURE__ */ s.jsxs(
1684
+ "button",
1685
+ {
1686
+ type: "button",
1687
+ "data-aqdd-restore-panel": i,
1688
+ onClick: () => a({
1689
+ ...r,
1690
+ [i]: !0
1691
+ }),
1692
+ className: "flex items-center space-x-1 rounded-lg px-3 py-1 text-sm shadow-md hover:shadow-lg motion-safe:transition-all motion-safe:duration-200",
1693
+ children: [
1694
+ /* @__PURE__ */ s.jsx(An, { className: "h-3 w-3", "aria-hidden": "true" }),
1695
+ /* @__PURE__ */ s.jsx("span", { children: q })
1696
+ ]
1697
+ },
1698
+ i
1699
+ );
1700
+ })
1701
+ ] }) }),
1702
+ /* @__PURE__ */ s.jsx("div", { ref: nn, className: "relative min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ s.jsx("div", { className: "h-full w-full", style: on, children: /* @__PURE__ */ s.jsx(X, { ref: sn, "data-aqdd-scroll-root": !0, className: "no-scrollbar h-full max-w-full flex-1 overflow-auto", children: /* @__PURE__ */ s.jsx("div", { "data-aqdd-columns": !0, className: "relative flex h-full items-start", children: t.map((i, C) => {
1703
+ const q = Y?.[i.id] || i.initialWidth || 350, K = T && (i.resizable ?? !0);
1704
+ return /* @__PURE__ */ s.jsx(fn, { children: /* @__PURE__ */ s.jsxs(
1705
+ "div",
1706
+ {
1707
+ className: `column relative ${i.className || ""} ${T ? "resize-enabled-column" : "auto-width-column"} ${L && w === i.id ? "column-resizing-active" : ""}`,
1708
+ "data-column": C,
1709
+ "data-column-id": i.id,
1710
+ "data-min-width": i.minWidth || 350,
1711
+ "data-max-width": i.maxWidth,
1712
+ "data-column-width": T ? q : void 0,
1713
+ inert: de && C !== ot.column,
1714
+ ...T && {
1715
+ style: { "--column-width": `${q}px` }
1716
+ },
1717
+ children: [
1718
+ un(i.key, C),
1719
+ K && !de && G && g && v && /* @__PURE__ */ s.jsx(
1720
+ en,
1721
+ {
1722
+ columnId: i.id,
1723
+ onResizeStart: G,
1724
+ onResize: g,
1725
+ onResizeEnd: v,
1726
+ isResizing: L && w === i.id,
1727
+ position: "right",
1728
+ debug: R,
1729
+ label: Rt(H.resizeColumn, { column: C + 1 })
1730
+ }
1731
+ )
1732
+ ]
1733
+ }
1734
+ ) }, i.id);
1735
+ }) }) }) }) })
1736
+ ]
1737
+ }
1738
+ );
1145
1739
  };
1146
- const Mt = [
1740
+ const Pr = [
1147
1741
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
1148
1742
  ["path", { d: "M3 9h18", key: "1pudct" }],
1149
1743
  ["path", { d: "M3 15h18", key: "5xshup" }],
1150
1744
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
1151
1745
  ["path", { d: "M15 3v18", key: "14nvp0" }]
1152
- ], $t = oe("grid-3x3", Mt);
1153
- const At = [["path", { d: "M5 12h14", key: "1ays0h" }]], Ot = oe("minus", At);
1154
- const Tt = [
1746
+ ], Er = ie("grid-3x3", Pr);
1747
+ const Dr = [["path", { d: "M5 12h14", key: "1ays0h" }]], kr = ie("minus", Dr);
1748
+ const Nr = [
1155
1749
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1156
1750
  ["path", { d: "M12 5v14", key: "s699le" }]
1157
- ], $e = oe("plus", Tt);
1158
- const _t = [
1751
+ ], Qe = ie("plus", Nr);
1752
+ const Or = [
1159
1753
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
1160
1754
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
1161
- ], Rt = oe("rotate-ccw", _t), Qt = ({ columnCount: r, onColumnCountChange: e, onAutoBalance: n, onResetWidths: s, minColumns: o = 2, maxColumns: i = 6, isResizing: u = !1, isResponsiveMode: c = !1, responsiveColumnCount: h }) => {
1162
- const N = r > o && !c, b = r < i && !c;
1163
- return /* @__PURE__ */ t.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: [
1164
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1165
- /* @__PURE__ */ t.jsx("span", { className: "font-medium text-slate-700 text-sm", children: "カラム数:" }),
1166
- /* @__PURE__ */ t.jsx(
1755
+ ], Cr = ie("rotate-ccw", Or), Ur = ({ columnCount: t, onColumnCountChange: n, onAutoBalance: e, onResetWidths: o, minColumns: r = 2, maxColumns: a = 6, isResizing: l = !1, isResponsiveMode: u = !1, responsiveColumnCount: f }) => {
1756
+ const b = t > r && !u, y = t < a && !u;
1757
+ return /* @__PURE__ */ s.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: [
1758
+ /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
1759
+ /* @__PURE__ */ s.jsx("span", { className: "font-medium text-slate-700 text-sm", children: "カラム数:" }),
1760
+ /* @__PURE__ */ s.jsx(
1167
1761
  "button",
1168
1762
  {
1169
1763
  type: "button",
1170
- onClick: () => N && e(r - 1),
1171
- disabled: !N || u,
1172
- className: `rounded p-1 text-xs transition-colors ${N && !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"}`,
1173
- title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを削除 (最小: ${o}列)`,
1174
- children: /* @__PURE__ */ t.jsx(Ot, { className: "h-3 w-3" })
1764
+ onClick: () => b && n(t - 1),
1765
+ disabled: !b || l,
1766
+ className: `rounded p-1 text-xs transition-colors ${b && !l ? "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"}`,
1767
+ title: u ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを削除 (最小: ${r}列)`,
1768
+ children: /* @__PURE__ */ s.jsx(kr, { className: "h-3 w-3" })
1175
1769
  }
1176
1770
  ),
1177
- /* @__PURE__ */ t.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: [
1178
- c ? h ?? r : r,
1179
- c && /* @__PURE__ */ t.jsx("span", { className: "ml-1 text-xs", children: "自動" })
1771
+ /* @__PURE__ */ s.jsxs("div", { className: `min-w-[2rem] rounded border px-3 py-1 text-center font-mono text-sm ${u ? "border-blue-300 bg-blue-50 text-blue-700" : "border-slate-300 bg-slate-100 text-slate-700"}`, children: [
1772
+ u ? f ?? t : t,
1773
+ u && /* @__PURE__ */ s.jsx("span", { className: "ml-1 text-xs", children: "自動" })
1180
1774
  ] }),
1181
- /* @__PURE__ */ t.jsx(
1775
+ /* @__PURE__ */ s.jsx(
1182
1776
  "button",
1183
1777
  {
1184
1778
  type: "button",
1185
- onClick: () => b && e(r + 1),
1186
- disabled: !b || u,
1187
- className: `rounded p-1 text-xs transition-colors ${b && !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"}`,
1188
- title: c ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを追加 (最大: ${i}列)`,
1189
- children: /* @__PURE__ */ t.jsx($e, { className: "h-3 w-3" })
1779
+ onClick: () => y && n(t + 1),
1780
+ disabled: !y || l,
1781
+ className: `rounded p-1 text-xs transition-colors ${y && !l ? "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"}`,
1782
+ title: u ? "レスポンシブモード中:カラム数は自動調整されます" : `カラムを追加 (最大: ${a}列)`,
1783
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-3 w-3" })
1190
1784
  }
1191
1785
  )
1192
1786
  ] }),
1193
- /* @__PURE__ */ t.jsx("div", { className: "h-6 w-px bg-slate-300" }),
1194
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1195
- /* @__PURE__ */ t.jsxs(
1787
+ /* @__PURE__ */ s.jsx("div", { className: "h-6 w-px bg-slate-300" }),
1788
+ /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
1789
+ /* @__PURE__ */ s.jsxs(
1196
1790
  "button",
1197
1791
  {
1198
1792
  type: "button",
1199
- onClick: n,
1200
- disabled: u,
1201
- 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"}`,
1793
+ onClick: e,
1794
+ disabled: l,
1795
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${l ? "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"}`,
1202
1796
  title: "パネルを全カラムに均等分散",
1203
1797
  children: [
1204
- /* @__PURE__ */ t.jsx($t, { className: "h-3 w-3" }),
1205
- /* @__PURE__ */ t.jsx("span", { children: "バランス" })
1798
+ /* @__PURE__ */ s.jsx(Er, { className: "h-3 w-3" }),
1799
+ /* @__PURE__ */ s.jsx("span", { children: "バランス" })
1206
1800
  ]
1207
1801
  }
1208
1802
  ),
1209
- /* @__PURE__ */ t.jsxs(
1803
+ /* @__PURE__ */ s.jsxs(
1210
1804
  "button",
1211
1805
  {
1212
1806
  type: "button",
1213
- onClick: s,
1214
- disabled: u,
1215
- 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"}`,
1807
+ onClick: o,
1808
+ disabled: l,
1809
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${l ? "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"}`,
1216
1810
  title: "カラム幅を初期値にリセット",
1217
1811
  children: [
1218
- /* @__PURE__ */ t.jsx(Rt, { className: "h-3 w-3" }),
1219
- /* @__PURE__ */ t.jsx("span", { children: "幅リセット" })
1812
+ /* @__PURE__ */ s.jsx(Cr, { className: "h-3 w-3" }),
1813
+ /* @__PURE__ */ s.jsx("span", { children: "幅リセット" })
1220
1814
  ]
1221
1815
  }
1222
1816
  )
1223
1817
  ] }),
1224
- u && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-blue-600 text-xs", children: [
1225
- /* @__PURE__ */ t.jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-blue-500" }),
1226
- /* @__PURE__ */ t.jsx("span", { children: "リサイズ中..." })
1818
+ l && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1 text-blue-600 text-xs", children: [
1819
+ /* @__PURE__ */ s.jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-blue-500" }),
1820
+ /* @__PURE__ */ s.jsx("span", { children: "リサイズ中..." })
1227
1821
  ] })
1228
1822
  ] });
1229
- }, Kt = ({ columnCount: r, onInsertColumn: e, onDeleteColumn: n, minColumns: s = 1, maxColumns: o = 6, isResizing: i = !1, disabled: u = !1 }) => {
1230
- const c = r < o && !u, h = r > s && !u;
1231
- return /* @__PURE__ */ t.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: [
1232
- u && /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ t.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
1233
- !u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1234
- /* @__PURE__ */ t.jsx(
1823
+ }, Br = ({ columnCount: t, onInsertColumn: n, onDeleteColumn: e, minColumns: o = 1, maxColumns: r = 6, isResizing: a = !1, disabled: l = !1 }) => {
1824
+ const u = t < r && !l, f = t > o && !l;
1825
+ return /* @__PURE__ */ s.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 ${l ? "bg-slate-100/80 opacity-60" : "bg-white/80"}`, children: [
1826
+ l && /* @__PURE__ */ s.jsx("div", { className: "flex items-center gap-2 text-slate-500 text-xs", children: /* @__PURE__ */ s.jsx("span", { children: "レスポンシブモード有効中:カラム数は自動調整されます" }) }),
1827
+ !l && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1828
+ /* @__PURE__ */ s.jsx(
1235
1829
  "button",
1236
1830
  {
1237
1831
  type: "button",
1238
- onClick: () => c && e(0),
1239
- disabled: !c || i,
1240
- 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"}`,
1832
+ onClick: () => u && n(0),
1833
+ disabled: !u || a,
1834
+ className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${u && !a ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1241
1835
  title: "この位置に新しいカラムを挿入",
1242
- children: /* @__PURE__ */ t.jsx($e, { className: "h-4 w-4" })
1836
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-4 w-4" })
1243
1837
  }
1244
1838
  ),
1245
- Array.from({ length: r }, (N, b) => /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
1246
- /* @__PURE__ */ t.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
1247
- /* @__PURE__ */ t.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: b + 1 }),
1248
- h && !i && /* @__PURE__ */ t.jsx(
1839
+ Array.from({ length: t }, (b, y) => /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1", children: [
1840
+ /* @__PURE__ */ s.jsxs("div", { className: "relative flex h-8 w-12 items-center justify-center rounded border border-slate-300 bg-slate-100", children: [
1841
+ /* @__PURE__ */ s.jsx("span", { className: "font-medium font-mono text-slate-700 text-xs", children: y + 1 }),
1842
+ f && !a && /* @__PURE__ */ s.jsx(
1249
1843
  "button",
1250
1844
  {
1251
1845
  type: "button",
1252
- onClick: () => n(b),
1846
+ onClick: () => e(y),
1253
1847
  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",
1254
- title: `カラム ${b + 1} を削除`,
1255
- children: /* @__PURE__ */ t.jsx(Ve, { className: "h-2.5 w-2.5" })
1848
+ title: `カラム ${y + 1} を削除`,
1849
+ children: /* @__PURE__ */ s.jsx(Ht, { className: "h-2.5 w-2.5" })
1256
1850
  }
1257
1851
  )
1258
1852
  ] }),
1259
- /* @__PURE__ */ t.jsx(
1853
+ /* @__PURE__ */ s.jsx(
1260
1854
  "button",
1261
1855
  {
1262
1856
  type: "button",
1263
- onClick: () => c && e(b + 1),
1264
- disabled: !c || i,
1265
- 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"}`,
1857
+ onClick: () => u && n(y + 1),
1858
+ disabled: !u || a,
1859
+ className: `flex h-8 w-8 items-center justify-center rounded border-2 border-dashed text-xs transition-colors ${u && !a ? "border-blue-300 text-blue-600 hover:border-blue-500 hover:bg-blue-50" : "cursor-not-allowed border-slate-200 text-slate-300"}`,
1266
1860
  title: "この位置に新しいカラムを挿入",
1267
- children: /* @__PURE__ */ t.jsx($e, { className: "h-4 w-4" })
1861
+ children: /* @__PURE__ */ s.jsx(Qe, { className: "h-4 w-4" })
1268
1862
  }
1269
1863
  )
1270
- ] }, `column-${b}`))
1864
+ ] }, `column-${y}`))
1271
1865
  ] })
1272
1866
  ] });
1273
- }, en = ({ config: r, onConfigChange: e, isVisible: n, onToggleVisibility: s }) => n ? /* @__PURE__ */ t.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: [
1274
- /* @__PURE__ */ t.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1275
- /* @__PURE__ */ t.jsx("h3", { className: "font-bold text-gray-800 text-sm", children: "🛠️ デバッグ設定" }),
1276
- /* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, className: "text-gray-500 text-lg hover:text-gray-700", title: "閉じる", children: "✕" })
1867
+ }, Xr = ({ config: t, onConfigChange: n, isVisible: e, onToggleVisibility: o }) => e ? /* @__PURE__ */ s.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: [
1868
+ /* @__PURE__ */ s.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1869
+ /* @__PURE__ */ s.jsx("h3", { className: "font-bold text-gray-800 text-sm", children: "🛠️ デバッグ設定" }),
1870
+ /* @__PURE__ */ s.jsx("button", { type: "button", onClick: o, className: "text-gray-500 text-lg hover:text-gray-700", title: "閉じる", children: "✕" })
1277
1871
  ] }),
1278
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1279
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1280
- /* @__PURE__ */ t.jsx(
1872
+ /* @__PURE__ */ s.jsxs("div", { className: "space-y-2", children: [
1873
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1874
+ /* @__PURE__ */ s.jsx(
1281
1875
  "input",
1282
1876
  {
1283
1877
  type: "checkbox",
1284
- checked: r.showDebugPanel ?? !1,
1285
- onChange: (o) => e({
1286
- ...r,
1287
- showDebugPanel: o.target.checked
1878
+ checked: t.showDebugPanel ?? !1,
1879
+ onChange: (r) => n({
1880
+ ...t,
1881
+ showDebugPanel: r.target.checked
1288
1882
  }),
1289
1883
  className: "rounded"
1290
1884
  }
1291
1885
  ),
1292
- /* @__PURE__ */ t.jsx("span", { children: "デバッグパネル表示" })
1886
+ /* @__PURE__ */ s.jsx("span", { children: "デバッグパネル表示" })
1293
1887
  ] }),
1294
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1295
- /* @__PURE__ */ t.jsx(
1888
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1889
+ /* @__PURE__ */ s.jsx(
1296
1890
  "input",
1297
1891
  {
1298
1892
  type: "checkbox",
1299
- checked: r.showMousePosition ?? !1,
1300
- onChange: (o) => e({
1301
- ...r,
1302
- showMousePosition: o.target.checked
1893
+ checked: t.showMousePosition ?? !1,
1894
+ onChange: (r) => n({
1895
+ ...t,
1896
+ showMousePosition: r.target.checked
1303
1897
  }),
1304
1898
  className: "rounded"
1305
1899
  }
1306
1900
  ),
1307
- /* @__PURE__ */ t.jsx("span", { children: "マウス位置表示" })
1901
+ /* @__PURE__ */ s.jsx("span", { children: "マウス位置表示" })
1308
1902
  ] }),
1309
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1310
- /* @__PURE__ */ t.jsx(
1903
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1904
+ /* @__PURE__ */ s.jsx(
1311
1905
  "input",
1312
1906
  {
1313
1907
  type: "checkbox",
1314
- checked: r.showPanelSizes ?? !1,
1315
- onChange: (o) => e({
1316
- ...r,
1317
- showPanelSizes: o.target.checked
1908
+ checked: t.showPanelSizes ?? !1,
1909
+ onChange: (r) => n({
1910
+ ...t,
1911
+ showPanelSizes: r.target.checked
1318
1912
  }),
1319
1913
  className: "rounded"
1320
1914
  }
1321
1915
  ),
1322
- /* @__PURE__ */ t.jsx("span", { children: "パネルサイズ情報" })
1916
+ /* @__PURE__ */ s.jsx("span", { children: "パネルサイズ情報" })
1323
1917
  ] }),
1324
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1325
- /* @__PURE__ */ t.jsx(
1918
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1919
+ /* @__PURE__ */ s.jsx(
1326
1920
  "input",
1327
1921
  {
1328
1922
  type: "checkbox",
1329
- checked: r.showPlaceholderInfo ?? !1,
1330
- onChange: (o) => e({
1331
- ...r,
1332
- showPlaceholderInfo: o.target.checked
1923
+ checked: t.showPlaceholderInfo ?? !1,
1924
+ onChange: (r) => n({
1925
+ ...t,
1926
+ showPlaceholderInfo: r.target.checked
1333
1927
  }),
1334
1928
  className: "rounded"
1335
1929
  }
1336
1930
  ),
1337
- /* @__PURE__ */ t.jsx("span", { children: "プレースホルダー詳細" })
1931
+ /* @__PURE__ */ s.jsx("span", { children: "プレースホルダー詳細" })
1338
1932
  ] }),
1339
- /* @__PURE__ */ t.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1340
- /* @__PURE__ */ t.jsx(
1933
+ /* @__PURE__ */ s.jsxs("label", { className: "flex items-center space-x-2 text-sm", children: [
1934
+ /* @__PURE__ */ s.jsx(
1341
1935
  "input",
1342
1936
  {
1343
1937
  type: "checkbox",
1344
- checked: r.showDropZoneOutlines ?? !1,
1345
- onChange: (o) => e({
1346
- ...r,
1347
- showDropZoneOutlines: o.target.checked
1938
+ checked: t.showDropZoneOutlines ?? !1,
1939
+ onChange: (r) => n({
1940
+ ...t,
1941
+ showDropZoneOutlines: r.target.checked
1348
1942
  }),
1349
1943
  className: "rounded"
1350
1944
  }
1351
1945
  ),
1352
- /* @__PURE__ */ t.jsx("span", { children: "ドロップゾーン境界" })
1946
+ /* @__PURE__ */ s.jsx("span", { children: "ドロップゾーン境界" })
1353
1947
  ] }),
1354
- /* @__PURE__ */ t.jsxs("div", { className: "border-gray-200 border-t pt-2", children: [
1355
- /* @__PURE__ */ t.jsxs("label", { htmlFor: "log-level-slider", className: "mb-1 block text-sm", children: [
1948
+ /* @__PURE__ */ s.jsxs("div", { className: "border-gray-200 border-t pt-2", children: [
1949
+ /* @__PURE__ */ s.jsxs("label", { htmlFor: "log-level-slider", className: "mb-1 block text-sm", children: [
1356
1950
  "ログレベル: ",
1357
- r.logLevel ?? 0
1951
+ t.logLevel ?? 0
1358
1952
  ] }),
1359
- /* @__PURE__ */ t.jsx(
1953
+ /* @__PURE__ */ s.jsx(
1360
1954
  "input",
1361
1955
  {
1362
1956
  id: "log-level-slider",
1363
1957
  type: "range",
1364
1958
  min: "0",
1365
1959
  max: "2",
1366
- value: r.logLevel ?? 0,
1367
- onChange: (o) => e({
1368
- ...r,
1369
- logLevel: parseInt(o.target.value, 10)
1960
+ value: t.logLevel ?? 0,
1961
+ onChange: (r) => n({
1962
+ ...t,
1963
+ logLevel: parseInt(r.target.value, 10)
1370
1964
  }),
1371
1965
  className: "w-full",
1372
1966
  "aria-label": "ログレベル設定"
1373
1967
  }
1374
1968
  ),
1375
- /* @__PURE__ */ t.jsxs("div", { className: "mt-1 flex justify-between text-gray-500 text-xs", children: [
1376
- /* @__PURE__ */ t.jsx("span", { children: "無効" }),
1377
- /* @__PURE__ */ t.jsx("span", { children: "基本" }),
1378
- /* @__PURE__ */ t.jsx("span", { children: "詳細" })
1969
+ /* @__PURE__ */ s.jsxs("div", { className: "mt-1 flex justify-between text-gray-500 text-xs", children: [
1970
+ /* @__PURE__ */ s.jsx("span", { children: "無効" }),
1971
+ /* @__PURE__ */ s.jsx("span", { children: "基本" }),
1972
+ /* @__PURE__ */ s.jsx("span", { children: "詳細" })
1379
1973
  ] })
1380
1974
  ] }),
1381
- /* @__PURE__ */ t.jsxs("div", { className: "space-y-2 pt-2", children: [
1382
- /* @__PURE__ */ t.jsx(
1975
+ /* @__PURE__ */ s.jsxs("div", { className: "space-y-2 pt-2", children: [
1976
+ /* @__PURE__ */ s.jsx(
1383
1977
  "button",
1384
1978
  {
1385
1979
  type: "button",
1386
- onClick: () => e({
1980
+ onClick: () => n({
1387
1981
  showDebugPanel: !0,
1388
1982
  showMousePosition: !0,
1389
1983
  showPanelSizes: !0,
@@ -1395,11 +1989,11 @@ const _t = [
1395
1989
  children: "すべて有効"
1396
1990
  }
1397
1991
  ),
1398
- /* @__PURE__ */ t.jsx(
1992
+ /* @__PURE__ */ s.jsx(
1399
1993
  "button",
1400
1994
  {
1401
1995
  type: "button",
1402
- onClick: () => e({
1996
+ onClick: () => n({
1403
1997
  showDebugPanel: !1,
1404
1998
  showMousePosition: !1,
1405
1999
  showPanelSizes: !1,
@@ -1413,1104 +2007,979 @@ const _t = [
1413
2007
  )
1414
2008
  ] })
1415
2009
  ] })
1416
- ] }) : /* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, 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: "🛠️" }), ie = {
2010
+ ] }) : /* @__PURE__ */ s.jsx("button", { type: "button", onClick: o, 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: "🛠️" }), fe = {
1417
2011
  prefix: "column",
1418
2012
  startIndex: 1,
1419
2013
  separator: "_"
1420
- }, je = (r, e = ie) => {
1421
- const { prefix: n, startIndex: s, separator: o } = e, i = r + s;
1422
- return `${n}${o}${i}`;
1423
- }, Qe = (r, e = ie) => Array.from({ length: r }, (n, s) => je(s, e)), Pe = (r, e = ie) => {
1424
- const { prefix: n, startIndex: s, separator: o } = e, i = `${n}${o}`;
1425
- if (!r.startsWith(i))
2014
+ }, We = (t, n = fe) => {
2015
+ const { prefix: e, startIndex: o, separator: r } = n, a = t + o;
2016
+ return `${e}${r}${a}`;
2017
+ }, tn = (t, n = fe) => Array.from({ length: t }, (e, o) => We(o, n)), Ie = (t, n = fe) => {
2018
+ const { prefix: e, startIndex: o, separator: r } = n, a = `${e}${r}`;
2019
+ if (!t.startsWith(a))
1426
2020
  return null;
1427
- const u = r.slice(i.length), c = parseInt(u, 10);
1428
- return Number.isNaN(c) || c < s ? null : c - s;
1429
- }, tn = (r, e = ie) => Pe(r, e) !== null, nn = (r, e = ie) => {
1430
- const n = r.map((s) => Pe(s, e)).filter((s) => s !== null).sort((s, o) => s - o);
1431
- for (let s = 0; s < n.length; s++)
1432
- if (n[s] !== s)
1433
- return je(s, e);
1434
- return je(n.length, e);
1435
- }, Lt = (r, e = ie) => r.sort((n, s) => {
1436
- const o = Pe(n, e) ?? -1, i = Pe(s, e) ?? -1;
1437
- return o - i;
1438
- }), rn = (r, e = ie) => {
1439
- const n = {};
1440
- return r.forEach((s, o) => {
1441
- const i = je(o, e);
1442
- n[s] = i;
1443
- }), n;
1444
- }, Wt = (r, e, n = ie) => {
1445
- const s = [];
1446
- Object.values(r).forEach((u) => {
1447
- s.push(...u);
2021
+ const l = t.slice(a.length), u = parseInt(l, 10);
2022
+ return Number.isNaN(u) || u < o ? null : u - o;
2023
+ }, Vr = (t, n = fe) => Ie(t, n) !== null, Zr = (t, n = fe) => {
2024
+ const e = t.map((o) => Ie(o, n)).filter((o) => o !== null).sort((o, r) => o - r);
2025
+ for (let o = 0; o < e.length; o++)
2026
+ if (e[o] !== o)
2027
+ return We(o, n);
2028
+ return We(e.length, n);
2029
+ }, Mr = (t, n = fe) => t.sort((e, o) => {
2030
+ const r = Ie(e, n) ?? -1, a = Ie(o, n) ?? -1;
2031
+ return r - a;
2032
+ }), Gr = (t, n = fe) => {
2033
+ const e = {};
2034
+ return t.forEach((o, r) => {
2035
+ const a = We(r, n);
2036
+ e[o] = a;
2037
+ }), e;
2038
+ }, Sr = (t, n, e = fe) => {
2039
+ const o = [];
2040
+ Object.values(t).forEach((l) => {
2041
+ o.push(...l);
1448
2042
  });
1449
- const o = {}, i = Qe(e, n);
1450
- return i.forEach((u) => {
1451
- o[u] = [];
1452
- }), s.forEach((u, c) => {
1453
- const h = c % e, N = i[h];
1454
- o[N].push(u);
1455
- }), o;
1456
- }, sn = ({ initialColumns: r, initialPanels: e, debug: n = {}, onLayoutChange: s }) => {
1457
- const [o, i] = te(() => {
1458
- const f = {};
1459
- for (const x of r)
1460
- f[x.id] = x.initialWidth || 400;
2043
+ const r = {}, a = tn(n, e);
2044
+ return a.forEach((l) => {
2045
+ r[l] = [];
2046
+ }), o.forEach((l, u) => {
2047
+ const f = u % n, b = a[f];
2048
+ r[b].push(l);
2049
+ }), r;
2050
+ }, Kr = ({ initialColumns: t, initialPanels: n, debug: e = {}, onLayoutChange: o }) => {
2051
+ const [r, a] = se(() => {
2052
+ const g = {};
2053
+ for (const v of t)
2054
+ g[v.id] = v.initialWidth || 400;
1461
2055
  return {
1462
- columns: r,
1463
- columnWidths: f,
2056
+ columns: t,
2057
+ columnWidths: g,
1464
2058
  isResizing: !1,
1465
2059
  resizingColumn: null,
1466
- columnPanels: e,
2060
+ columnPanels: n,
1467
2061
  showInsertPlaceholders: !1
1468
2062
  };
1469
- }), u = F(0), c = F(0);
1470
- K(() => {
1471
- s?.(o);
1472
- }, [o, s]);
1473
- const h = w(
1474
- (f, x) => {
1475
- E(n, 1, "カラム追加:", f.id, "at position:", x), i((C) => {
1476
- const W = [...C.columns], p = x ?? W.length;
1477
- W.splice(p, 0, f);
1478
- const g = {
1479
- ...C.columnWidths,
1480
- [f.id]: f.initialWidth || 400
1481
- }, m = {
1482
- ...C.columnPanels,
1483
- [f.id]: []
2063
+ }), l = W(0), u = W(0);
2064
+ ee(() => {
2065
+ o?.(r);
2066
+ }, [r, o]);
2067
+ const f = D(
2068
+ (g, v) => {
2069
+ O(e, 1, "カラム追加:", g.id, "at position:", v), a((L) => {
2070
+ const w = [...L.columns], m = v ?? w.length;
2071
+ w.splice(m, 0, g);
2072
+ const p = {
2073
+ ...L.columnWidths,
2074
+ [g.id]: g.initialWidth || 400
2075
+ }, j = {
2076
+ ...L.columnPanels,
2077
+ [g.id]: []
1484
2078
  };
1485
2079
  return {
1486
- ...C,
1487
- columns: W,
1488
- columnWidths: g,
1489
- columnPanels: m
2080
+ ...L,
2081
+ columns: w,
2082
+ columnWidths: p,
2083
+ columnPanels: j
1490
2084
  };
1491
2085
  });
1492
2086
  },
1493
- [n]
1494
- ), N = w(
1495
- (f) => {
1496
- E(n, 1, "カラム削除:", f), i((x) => {
1497
- const C = x.columnPanels[f] || [], W = x.columns.filter((v) => v.id !== f);
1498
- if (W.length === 0)
1499
- return E(n, 1, "警告: 最後のカラムを削除しようとしています"), x;
1500
- const p = W[0].id, g = { ...x.columnPanels };
1501
- C.length > 0 && (g[p] = [...g[p], ...C]), delete g[f];
1502
- const m = { ...x.columnWidths };
1503
- return delete m[f], {
1504
- ...x,
1505
- columns: W,
1506
- columnWidths: m,
1507
- columnPanels: g
2087
+ [e]
2088
+ ), b = D(
2089
+ (g) => {
2090
+ O(e, 1, "カラム削除:", g), a((v) => {
2091
+ const L = v.columnPanels[g] || [], w = v.columns.filter((_) => _.id !== g);
2092
+ if (w.length === 0)
2093
+ return O(e, 1, "警告: 最後のカラムを削除しようとしています"), v;
2094
+ const m = w[0].id, p = { ...v.columnPanels };
2095
+ L.length > 0 && (p[m] = [...p[m], ...L]), delete p[g];
2096
+ const j = { ...v.columnWidths };
2097
+ return delete j[g], {
2098
+ ...v,
2099
+ columns: w,
2100
+ columnWidths: j,
2101
+ columnPanels: p
1508
2102
  };
1509
2103
  });
1510
2104
  },
1511
- [n]
1512
- ), b = w(
1513
- (f, x) => {
1514
- E(n, 1, "カラム移動:", f, "->", x), i((C) => {
1515
- const W = [...C.columns], [p] = W.splice(f, 1);
1516
- return W.splice(x, 0, p), {
1517
- ...C,
1518
- columns: W
2105
+ [e]
2106
+ ), y = D(
2107
+ (g, v) => {
2108
+ O(e, 1, "カラム移動:", g, "->", v), a((L) => {
2109
+ const w = [...L.columns], [m] = w.splice(g, 1);
2110
+ return w.splice(v, 0, m), {
2111
+ ...L,
2112
+ columns: w
1519
2113
  };
1520
2114
  });
1521
2115
  },
1522
- [n]
1523
- ), M = w(
1524
- (f, x) => {
1525
- E(n, 2, "リサイズ開始:", f, "at X:", x), u.current = x, c.current = o.columnWidths[f] || 300, i((C) => ({
1526
- ...C,
2116
+ [e]
2117
+ ), A = D(
2118
+ (g, v) => {
2119
+ O(e, 2, "リサイズ開始:", g, "at X:", v), l.current = v, u.current = r.columnWidths[g] || 300, a((L) => ({
2120
+ ...L,
1527
2121
  isResizing: !0,
1528
- resizingColumn: f
2122
+ resizingColumn: g
1529
2123
  }));
1530
2124
  },
1531
- [n, o.columnWidths]
1532
- ), T = w(
1533
- (f) => {
1534
- const { resizingColumn: x, isResizing: C } = o;
1535
- if (!(C && x)) return;
1536
- const W = f - u.current, p = Math.max(100, Math.min(800, c.current + W));
1537
- E(n, 2, "リサイズ中:", x, "new width:", p), i((g) => ({
1538
- ...g,
2125
+ [e, r.columnWidths]
2126
+ ), z = D(
2127
+ (g) => {
2128
+ const { resizingColumn: v, isResizing: L } = r;
2129
+ if (!(L && v)) return;
2130
+ const w = g - l.current, m = Math.max(100, Math.min(800, u.current + w));
2131
+ O(e, 2, "リサイズ中:", v, "new width:", m), a((p) => ({
2132
+ ...p,
1539
2133
  columnWidths: {
1540
- ...g.columnWidths,
1541
- [x]: p
2134
+ ...p.columnWidths,
2135
+ [v]: m
1542
2136
  }
1543
2137
  }));
1544
2138
  },
1545
- [n, o]
1546
- ), y = w(() => {
1547
- E(n, 2, "リサイズ終了"), i((f) => ({
1548
- ...f,
2139
+ [e, r]
2140
+ ), E = D(() => {
2141
+ O(e, 2, "リサイズ終了"), a((g) => ({
2142
+ ...g,
1549
2143
  isResizing: !1,
1550
2144
  resizingColumn: null
1551
2145
  }));
1552
- }, [n]), l = w(
1553
- (f, x) => {
1554
- E(n, 2, "カラム幅設定:", f, x), i((C) => ({
1555
- ...C,
2146
+ }, [e]), c = D(
2147
+ (g, v) => {
2148
+ O(e, 2, "カラム幅設定:", g, v), a((L) => ({
2149
+ ...L,
1556
2150
  columnWidths: {
1557
- ...C.columnWidths,
1558
- [f]: Math.max(100, Math.min(800, x))
2151
+ ...L.columnWidths,
2152
+ [g]: Math.max(100, Math.min(800, v))
1559
2153
  }
1560
2154
  }));
1561
2155
  },
1562
- [n]
1563
- ), j = w(() => {
1564
- E(n, 1, "カラム幅リセット"), i((f) => {
1565
- const x = {};
1566
- for (const C of f.columns)
1567
- x[C.id] = C.initialWidth || 400;
2156
+ [e]
2157
+ ), P = D(() => {
2158
+ O(e, 1, "カラム幅リセット"), a((g) => {
2159
+ const v = {};
2160
+ for (const L of g.columns)
2161
+ v[L.id] = L.initialWidth || 400;
1568
2162
  return {
1569
- ...f,
1570
- columnWidths: x
2163
+ ...g,
2164
+ columnWidths: v
1571
2165
  };
1572
2166
  });
1573
- }, [n]), k = w(
1574
- (f, x, C, W) => {
1575
- E(n, 1, "パネル移動:", f, "from", x, "to", C, "at", W), i((p) => {
1576
- const g = { ...p.columnPanels };
1577
- if (x in g && (g[x] = g[x].filter((m) => m !== f)), C in g) {
1578
- const m = [...g[C]];
1579
- m.splice(W, 0, f), g[C] = m;
2167
+ }, [e]), k = D(
2168
+ (g, v, L, w) => {
2169
+ O(e, 1, "パネル移動:", g, "from", v, "to", L, "at", w), a((m) => {
2170
+ const p = { ...m.columnPanels };
2171
+ if (v in p && (p[v] = p[v].filter((j) => j !== g)), L in p) {
2172
+ const j = [...p[L]];
2173
+ j.splice(w, 0, g), p[L] = j;
1580
2174
  }
1581
2175
  return {
1582
- ...p,
1583
- columnPanels: g
2176
+ ...m,
2177
+ columnPanels: p
1584
2178
  };
1585
2179
  });
1586
2180
  },
1587
- [n]
1588
- ), _ = w(
1589
- (f, x, C) => {
1590
- E(n, 1, "パネル追加:", f, "to column:", x), i((W) => {
1591
- const p = { ...W.columnPanels };
1592
- x in p || (p[x] = []);
1593
- const g = [...p[x]], m = C ?? g.length;
1594
- return g.splice(m, 0, f), p[x] = g, {
1595
- ...W,
1596
- columnPanels: p
2181
+ [e]
2182
+ ), S = D(
2183
+ (g, v, L) => {
2184
+ O(e, 1, "パネル追加:", g, "to column:", v), a((w) => {
2185
+ const m = { ...w.columnPanels };
2186
+ v in m || (m[v] = []);
2187
+ const p = [...m[v]], j = L ?? p.length;
2188
+ return p.splice(j, 0, g), m[v] = p, {
2189
+ ...w,
2190
+ columnPanels: m
1597
2191
  };
1598
2192
  });
1599
2193
  },
1600
- [n]
1601
- ), R = w(
1602
- (f) => {
1603
- E(n, 1, "パネル削除:", f), i((x) => {
1604
- const C = {};
1605
- for (const [W, p] of Object.entries(x.columnPanels))
1606
- C[W] = p.filter((g) => g !== f);
2194
+ [e]
2195
+ ), N = D(
2196
+ (g) => {
2197
+ O(e, 1, "パネル削除:", g), a((v) => {
2198
+ const L = {};
2199
+ for (const [w, m] of Object.entries(v.columnPanels))
2200
+ L[w] = m.filter((p) => p !== g);
1607
2201
  return {
1608
- ...x,
1609
- columnPanels: C
2202
+ ...v,
2203
+ columnPanels: L
1610
2204
  };
1611
2205
  });
1612
2206
  },
1613
- [n]
1614
- ), z = w(
1615
- (f) => {
1616
- E(n, 1, "カラム数更新:", f), i((x) => {
1617
- const C = x.columns.length;
1618
- if (f === C) return x;
1619
- const W = Wt(x.columnPanels, f, ie), p = Qe(f, ie), g = x.isResizing && x.resizingColumn && !p.includes(x.resizingColumn);
1620
- g && E(n, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", x.resizingColumn);
1621
- const m = p.map((O, H) => ({
1622
- id: O,
1623
- title: `カラム ${H + 1}`,
2207
+ [e]
2208
+ ), R = D(
2209
+ (g) => {
2210
+ O(e, 1, "カラム数更新:", g), a((v) => {
2211
+ const L = v.columns.length;
2212
+ if (g === L) return v;
2213
+ const w = Sr(v.columnPanels, g, fe), m = tn(g, fe), p = v.isResizing && v.resizingColumn && !m.includes(v.resizingColumn);
2214
+ p && O(e, 1, "リサイズ中のカラムが削除されるためリサイズを強制終了:", v.resizingColumn);
2215
+ const j = m.map((V, oe) => ({
2216
+ id: V,
2217
+ title: `カラム ${oe + 1}`,
1624
2218
  minWidth: 350,
1625
2219
  maxWidth: 800,
1626
2220
  initialWidth: 400,
1627
- resizable: !(H === 1 && f === 3)
1628
- })), v = {};
1629
- if (Object.entries(x.columnWidths).some(([, O]) => O !== 400))
1630
- p.forEach((O) => {
1631
- const H = x.columnWidths[O];
1632
- H && H !== 400 ? v[O] = H : v[O] = 400;
2221
+ resizable: !(oe === 1 && g === 3)
2222
+ })), _ = {};
2223
+ if (Object.entries(v.columnWidths).some(([, V]) => V !== 400))
2224
+ m.forEach((V) => {
2225
+ const oe = v.columnWidths[V];
2226
+ oe && oe !== 400 ? _[V] = oe : _[V] = 400;
1633
2227
  });
1634
2228
  else {
1635
- const O = C > f ? Object.values(x.columnWidths).reduce((a, d) => a + d, 0) : f * 400, H = Math.max(O / f, 350);
1636
- p.forEach((a) => {
1637
- v[a] = H;
2229
+ const V = L > g ? Object.values(v.columnWidths).reduce((h, x) => h + x, 0) : g * 400, oe = Math.max(V / g, 350);
2230
+ m.forEach((h) => {
2231
+ _[h] = oe;
1638
2232
  });
1639
2233
  }
1640
2234
  return {
1641
- ...x,
1642
- columns: m,
1643
- columnPanels: W,
1644
- columnWidths: v,
1645
- isResizing: g ? !1 : x.isResizing,
1646
- resizingColumn: g ? null : x.resizingColumn
2235
+ ...v,
2236
+ columns: j,
2237
+ columnPanels: w,
2238
+ columnWidths: _,
2239
+ isResizing: p ? !1 : v.isResizing,
2240
+ resizingColumn: p ? null : v.resizingColumn
1647
2241
  };
1648
2242
  });
1649
2243
  },
1650
- [n]
1651
- ), Z = w(() => {
1652
- E(n, 1, "カラム自動バランス調整"), i((f) => {
1653
- const x = [];
1654
- for (const p of Object.keys(f.columnPanels))
1655
- for (const g of f.columnPanels[p])
1656
- x.push(g);
1657
- const C = {};
1658
- for (const p of f.columns)
1659
- C[p.id] = [];
1660
- let W = 0;
1661
- for (const p of x) {
1662
- const g = f.columns[W % f.columns.length].id;
1663
- C[g].push(p), W += 1;
2244
+ [e]
2245
+ ), d = D(() => {
2246
+ O(e, 1, "カラム自動バランス調整"), a((g) => {
2247
+ const v = [];
2248
+ for (const m of Object.keys(g.columnPanels))
2249
+ for (const p of g.columnPanels[m])
2250
+ v.push(p);
2251
+ const L = {};
2252
+ for (const m of g.columns)
2253
+ L[m.id] = [];
2254
+ let w = 0;
2255
+ for (const m of v) {
2256
+ const p = g.columns[w % g.columns.length].id;
2257
+ L[p].push(m), w += 1;
1664
2258
  }
1665
2259
  return {
1666
- ...f,
1667
- columnPanels: C
2260
+ ...g,
2261
+ columnPanels: L
1668
2262
  };
1669
2263
  });
1670
- }, [n]), Y = w(
1671
- (f) => o.columns.find((x) => x.id === f),
1672
- [o.columns]
1673
- ), U = w(() => {
1674
- let f = 0;
1675
- for (const x of Object.values(o.columnWidths))
1676
- f += x;
1677
- return f;
1678
- }, [o.columnWidths]), $ = w((f) => document.querySelector(`[data-column-id="${f}"]`), []), L = w((f) => {
1679
- i((x) => ({
1680
- ...x,
1681
- showInsertPlaceholders: f
2264
+ }, [e]), $ = D(
2265
+ (g) => r.columns.find((v) => v.id === g),
2266
+ [r.columns]
2267
+ ), T = D(() => {
2268
+ let g = 0;
2269
+ for (const v of Object.values(r.columnWidths))
2270
+ g += v;
2271
+ return g;
2272
+ }, [r.columnWidths]), Y = D((g) => document.querySelector(`[data-column-id="${g}"]`), []), G = D((g) => {
2273
+ a((v) => ({
2274
+ ...v,
2275
+ showInsertPlaceholders: g
1682
2276
  }));
1683
2277
  }, []);
1684
2278
  return {
1685
- layoutState: o,
1686
- addColumn: h,
1687
- removeColumn: N,
1688
- moveColumn: b,
1689
- startResize: M,
1690
- handleResize: T,
1691
- endResize: y,
1692
- setColumnWidth: l,
1693
- resetColumnWidths: j,
2279
+ layoutState: r,
2280
+ addColumn: f,
2281
+ removeColumn: b,
2282
+ moveColumn: y,
2283
+ startResize: A,
2284
+ handleResize: z,
2285
+ endResize: E,
2286
+ setColumnWidth: c,
2287
+ resetColumnWidths: P,
1694
2288
  movePanel: k,
1695
- addPanel: _,
1696
- removePanel: R,
1697
- updateColumnCount: z,
1698
- autoBalanceColumns: Z,
1699
- getColumnById: Y,
1700
- getTotalWidth: U,
1701
- getColumnElement: $,
1702
- setShowInsertPlaceholders: L
2289
+ addPanel: S,
2290
+ removePanel: N,
2291
+ updateColumnCount: R,
2292
+ autoBalanceColumns: d,
2293
+ getColumnById: $,
2294
+ getTotalWidth: T,
2295
+ getColumnElement: Y,
2296
+ setShowInsertPlaceholders: G
1703
2297
  };
1704
- }, ke = {
1705
- triggerDistance: 80,
1706
- scrollSpeed: 5,
1707
- maxScrollSpeed: 20
1708
- }, He = (r, e, n = ke, s) => {
1709
- const { triggerDistance: o, scrollSpeed: i, maxScrollSpeed: u } = n;
1710
- let c;
1711
- s ? c = s.getBoundingClientRect() : c = new DOMRect(0, 0, window.innerWidth, window.innerHeight);
1712
- const { left: h, top: N, right: b, bottom: M } = c;
1713
- let T = 0, y = 0;
1714
- if (r >= h && r <= b && e >= N && e <= M) {
1715
- if (r < h + o) {
1716
- const l = Math.max(0, (h + o - r) / o);
1717
- T = -Math.min(u, i + l * (u - i));
1718
- } else if (r > b - o) {
1719
- const l = Math.max(0, (r - (b - o)) / o);
1720
- T = Math.min(u, i + l * (u - i));
1721
- }
1722
- if (e < N + o) {
1723
- const l = Math.max(0, (N + o - e) / o);
1724
- y = -Math.min(u, i + l * (u - i));
1725
- } else if (e > M - o) {
1726
- const l = Math.max(0, (e - (M - o)) / o);
1727
- y = Math.min(u, i + l * (u - i));
1728
- }
1729
- }
1730
- return { x: T, y };
1731
- }, zt = (r, e) => {
1732
- (r.x !== 0 || r.y !== 0) && (e ? e.scrollBy(r.x, r.y) : window.scrollBy(r.x, r.y));
1733
- };
1734
- class Ke {
1735
- constructor(e = ke, n) {
1736
- this.intervalId = null, this.isActive = !1, this.config = e, this.scrollElement = n;
1737
- }
1738
- setScrollElement(e) {
1739
- this.scrollElement = e;
1740
- }
1741
- start(e, n) {
1742
- this.isActive || (this.isActive = !0, this.intervalId = window.setInterval(() => {
1743
- const s = He(e, n, this.config, this.scrollElement);
1744
- zt(s, this.scrollElement);
1745
- }, 16));
1746
- }
1747
- update(e, n) {
1748
- const s = He(e, n, this.config, this.scrollElement);
1749
- (s.x !== 0 || s.y !== 0) && !this.isActive ? this.start(e, n) : s.x === 0 && s.y === 0 && this.isActive && this.stop();
1750
- }
1751
- stop() {
1752
- this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null), this.isActive = !1;
1753
- }
1754
- isScrolling() {
1755
- return this.isActive;
1756
- }
1757
- updateConfig(e) {
1758
- this.config = e;
1759
- }
1760
- }
1761
- const Yt = ({
1762
- debugConfig: r,
1763
- dragState: e,
1764
- customDrag: n,
1765
- clickState: s,
1766
- dragModes: o,
1767
- isMouseDown: i,
1768
- dragOverPosition: u,
1769
- setCustomDrag: c,
1770
- setDragState: h,
1771
- setDragOverPosition: N,
1772
- setOriginalPanelPosition: b,
1773
- setClickState: M,
1774
- setIsMouseDown: T,
1775
- findPanelPosition: y,
1776
- performPanelMove: l,
1777
- showMousePosition: j,
2298
+ }, Ar = ({
2299
+ debugConfig: t,
2300
+ dragState: n,
2301
+ customDrag: e,
2302
+ clickState: o,
2303
+ dragModes: r,
2304
+ isMouseDown: a,
2305
+ dragOverPosition: l,
2306
+ setCustomDrag: u,
2307
+ setDragState: f,
2308
+ setDragOverPosition: b,
2309
+ setOriginalPanelPosition: y,
2310
+ setClickState: A,
2311
+ setIsMouseDown: z,
2312
+ findPanelPosition: E,
2313
+ performPanelMove: c,
2314
+ showMousePosition: P,
1778
2315
  updateMousePosition: k,
1779
- recordMouseDown: _,
1780
- recordClickPosition: R,
1781
- isVirtualClick: z,
1782
- calculateMoveDistance: Z,
1783
- clearMouseTracking: Y,
1784
- resetDragState: U,
1785
- resetClickState: $,
1786
- createDragImage: L,
1787
- updateDragImagePosition: f,
1788
- removeDragImage: x,
1789
- handlePlaceholderDragEnter: C,
1790
- handlePlaceholderDragLeave: W
2316
+ recordMouseDown: S,
2317
+ recordClickPosition: N,
2318
+ isVirtualClick: R,
2319
+ calculateMoveDistance: d,
2320
+ clearMouseTracking: $,
2321
+ resetDragState: T,
2322
+ resetClickState: Y,
2323
+ createDragImage: G,
2324
+ updateDragImagePosition: g,
2325
+ removeDragImage: v,
2326
+ handlePlaceholderDragEnter: L,
2327
+ handlePlaceholderDragLeave: w
1791
2328
  }) => {
1792
- const p = F(r);
1793
- p.current = r;
1794
- const g = F(null), m = F(null), v = F(0), D = F(new Ke(ke));
1795
- K(() => {
1796
- const d = document.querySelector("main[data-aqdd-scroll-root]");
1797
- d && D.current.setScrollElement(d);
2329
+ const m = W(t);
2330
+ m.current = t;
2331
+ const p = W(null), j = W(null), _ = W(0), I = W(new rt(Se));
2332
+ ee(() => {
2333
+ const x = document.querySelector(Vt);
2334
+ x && I.current.setScrollElement(x);
1798
2335
  }, []);
1799
- const A = F(u);
1800
- K(() => {
1801
- A.current = u, E(p.current, 2, "dragOverPositionRef更新:", u);
1802
- }, [u]);
1803
- const O = w(
1804
- (d) => {
1805
- if (n.isActive || s.isClicked) {
1806
- d.preventDefault();
1807
- const S = window.getSelection();
1808
- S && S.rangeCount > 0 && S.removeAllRanges();
2336
+ const re = W(l);
2337
+ ee(() => {
2338
+ re.current = l, O(m.current, 2, "dragOverPositionRef更新:", l);
2339
+ }, [l]);
2340
+ const V = D(
2341
+ (x) => {
2342
+ if (e.isActive || o.isClicked) {
2343
+ x.preventDefault();
2344
+ const M = window.getSelection();
2345
+ M && M.rangeCount > 0 && M.removeAllRanges();
1809
2346
  }
1810
- if (n.isActive) {
1811
- k(d.clientX, d.clientY), f(d.clientX, d.clientY), D.current.update(d.clientX, d.clientY);
1812
- const S = document.elementFromPoint(d.clientX, d.clientY), X = S?.closest("[data-drop-zone]");
1813
- if (X) {
2347
+ if (e.isActive) {
2348
+ k(x.clientX, x.clientY), g(x.clientX, x.clientY), I.current.update(x.clientX, x.clientY);
2349
+ const M = document.elementFromPoint(x.clientX, x.clientY), F = M?.closest("[data-drop-zone]");
2350
+ if (F) {
1814
2351
  document.body.classList.add("droppable");
1815
- const G = X.getAttribute("data-column-index"), Q = G ? parseInt(G, 10) : null;
1816
- Q !== null && Q !== e.dragOverColumn && h((re) => ({ ...re, dragOverColumn: Q }));
1817
- const V = S?.closest("[data-placeholder-index]");
1818
- if (V) {
1819
- const re = V.getAttribute("data-placeholder-index"), ce = V.getAttribute("data-placeholder-column");
1820
- if (re && ce) {
1821
- const se = parseInt(re, 10), ge = parseInt(ce, 10);
1822
- C(ge, se);
2352
+ const Z = F.getAttribute("data-column-index"), ae = Z ? parseInt(Z, 10) : null;
2353
+ ae !== null && ae !== n.dragOverColumn && f((H) => ({ ...H, dragOverColumn: ae }));
2354
+ const X = M?.closest("[data-placeholder-index]");
2355
+ if (X) {
2356
+ const H = X.getAttribute("data-placeholder-index"), ve = X.getAttribute("data-placeholder-column");
2357
+ if (H && ve) {
2358
+ const ue = parseInt(H, 10), pe = parseInt(ve, 10);
2359
+ L(pe, ue);
1823
2360
  }
1824
2361
  } else
1825
- W();
2362
+ w();
1826
2363
  } else
1827
- document.body.classList.remove("droppable"), N(null), h((G) => ({ ...G, dragOverColumn: null }));
1828
- } else if (i && s.isClicked && s.panelId) {
1829
- if (o[s.panelId] !== "custom" || Z(d.clientX, d.clientY) < 10) return;
1830
- E(p.current, 1, "🚀 カスタムドラッグ開始 -", s.panelId);
1831
- const X = document.querySelector(`[data-panel-id="${s.panelId}"]`);
1832
- if (X && m.current) {
1833
- const G = X.getBoundingClientRect(), Q = m.current.x - G.left, V = m.current.y - G.top;
1834
- L(s.panelId, Q, V), document.body.classList.add("custom-dragging"), c({
2364
+ document.body.classList.remove("droppable"), b(null), f((Z) => ({ ...Z, dragOverColumn: null }));
2365
+ } else if (a && o.isClicked && o.panelId) {
2366
+ if (r[o.panelId] !== "custom" || d(x.clientX, x.clientY) < 10) return;
2367
+ O(m.current, 1, "🚀 カスタムドラッグ開始 -", o.panelId);
2368
+ const F = document.querySelector(`[data-panel-id="${o.panelId}"]`);
2369
+ if (F && j.current) {
2370
+ const Z = F.getBoundingClientRect(), ae = j.current.x - Z.left, X = j.current.y - Z.top;
2371
+ G(o.panelId, ae, X), document.body.classList.add("custom-dragging"), u({
1835
2372
  isActive: !0,
1836
- panelId: s.panelId,
1837
- startX: Q,
1838
- startY: V
2373
+ panelId: o.panelId,
2374
+ startX: ae,
2375
+ startY: X
1839
2376
  });
1840
2377
  }
1841
- h({ isDragging: !0, draggedPanel: s.panelId, dragOverColumn: null }), b(y(s.panelId)), j(d.clientX, d.clientY), M({ isClicked: !1, panelId: null }), T(!1), Y(), m.current = null, g.current && (clearTimeout(g.current), g.current = null);
2378
+ f({ isDragging: !0, draggedPanel: o.panelId, dragOverColumn: null }), y(E(o.panelId)), P(x.clientX, x.clientY), A({ isClicked: !1, panelId: null }), z(!1), $(), j.current = null, p.current && (clearTimeout(p.current), p.current = null);
1842
2379
  }
1843
2380
  },
1844
2381
  [
1845
- n.isActive,
1846
- s,
1847
- e.dragOverColumn,
2382
+ e.isActive,
1848
2383
  o,
1849
- i,
2384
+ n.dragOverColumn,
2385
+ r,
2386
+ a,
1850
2387
  k,
1851
- h,
1852
- N,
1853
- Z,
1854
- y,
1855
- c,
2388
+ f,
1856
2389
  b,
1857
- j,
1858
- M,
1859
- T,
1860
- Y,
2390
+ d,
2391
+ E,
2392
+ u,
2393
+ y,
2394
+ P,
2395
+ A,
2396
+ z,
2397
+ $,
2398
+ G,
2399
+ g,
1861
2400
  L,
1862
- f,
1863
- C,
1864
- W
2401
+ w
1865
2402
  ]
1866
- ), H = w(
1867
- (d) => {
1868
- if (E(p.current, 1, "🐭 カスタムドラッグハンドラー - グローバルマウスアップ", {
1869
- isActive: n.isActive,
1870
- panelId: n.panelId,
1871
- dragMode: n.panelId ? o[n.panelId] : "unknown"
1872
- }), n.isActive) {
1873
- D.current.stop();
1874
- const S = A.current;
1875
- if (S) {
1876
- const G = document.elementFromPoint(d.clientX, d.clientY)?.closest("[data-drop-zone]");
1877
- if (G) {
1878
- const Q = G.getAttribute("data-column-key");
1879
- Q && o[n.panelId] === "custom" ? (E(p.current, 1, "🔄 カスタムドラッグパネル移動実行:", n.panelId, "→", Q), l(n.panelId, Q, S.insertIndex)) : E(p.current, 1, "🚫 カスタムドラッグパネル移動スキップ:", n.panelId, "モード:", o[n.panelId]);
2403
+ ), oe = D(
2404
+ (x) => {
2405
+ if (O(m.current, 1, "🐭 カスタムドラッグハンドラー - グローバルマウスアップ", {
2406
+ isActive: e.isActive,
2407
+ panelId: e.panelId,
2408
+ dragMode: e.panelId ? r[e.panelId] : "unknown"
2409
+ }), e.isActive) {
2410
+ I.current.stop();
2411
+ const M = re.current;
2412
+ if (M) {
2413
+ const Z = document.elementFromPoint(x.clientX, x.clientY)?.closest("[data-drop-zone]");
2414
+ if (Z) {
2415
+ const ae = Z.getAttribute("data-column-key");
2416
+ ae && r[e.panelId] === "custom" ? (O(m.current, 1, "🔄 カスタムドラッグパネル移動実行:", e.panelId, "→", ae), c(e.panelId, ae, M.insertIndex)) : O(m.current, 1, "🚫 カスタムドラッグパネル移動スキップ:", e.panelId, "モード:", r[e.panelId]);
1880
2417
  }
1881
2418
  }
1882
- x(), document.body.classList.remove("custom-dragging", "droppable"), U(), v.current = 0;
1883
- } else if (z(d.clientX, d.clientY)) {
1884
- const X = document.elementFromPoint(d.clientX, d.clientY)?.closest("[data-panel-id]"), G = X?.getAttribute("data-panel-id") ?? null;
1885
- if (!(X && G) || o[G] !== "custom") {
1886
- g.current && (clearTimeout(g.current), g.current = null), $(), m.current = null, v.current = 0;
2419
+ v(), document.body.classList.remove("custom-dragging", "droppable"), T(), _.current = 0;
2420
+ } else if (R(x.clientX, x.clientY)) {
2421
+ const F = document.elementFromPoint(x.clientX, x.clientY)?.closest("[data-panel-id]"), Z = F?.getAttribute("data-panel-id") ?? null;
2422
+ if (!(F && Z) || r[Z] !== "custom") {
2423
+ p.current && (clearTimeout(p.current), p.current = null), Y(), j.current = null, _.current = 0;
1887
2424
  return;
1888
2425
  }
1889
- v.current += 1, s.isClicked === !1 && v.current === 1 ? (E(p.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", G), M({ isClicked: !0, panelId: G }), g.current = window.setTimeout(() => {
1890
- E(p.current, 1, "⏳ クリック待機状態を自動解除:", G), $(), m.current = null, v.current = 0;
1891
- }, 2e3)) : (E(p.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", G), g.current && (clearTimeout(g.current), g.current = null), $(), m.current = null, v.current = 0, g.current = window.setTimeout(() => {
1892
- E(p.current, 1, "⏳ 仮想クリック検出再開:", G);
2426
+ _.current += 1, o.isClicked === !1 && _.current === 1 ? (O(m.current, 1, "🖱️ 仮想クリック検出 - ドラッグ待機状態へ:", Z), A({ isClicked: !0, panelId: Z }), p.current = window.setTimeout(() => {
2427
+ O(m.current, 1, "⏳ クリック待機状態を自動解除:", Z), Y(), j.current = null, _.current = 0;
2428
+ }, 2e3)) : (O(m.current, 1, "🚫 クリック待機状態を解除 - 仮想クリック検出停止:", Z), p.current && (clearTimeout(p.current), p.current = null), Y(), j.current = null, _.current = 0, p.current = window.setTimeout(() => {
2429
+ O(m.current, 1, "⏳ 仮想クリック検出再開:", Z);
1893
2430
  }, 2e3));
1894
- } else s.isClicked && ($(), m.current = null, v.current = 0);
1895
- i && T(!1);
2431
+ } else o.isClicked && (Y(), j.current = null, _.current = 0);
2432
+ a && z(!1);
1896
2433
  },
1897
- [n.isActive, n.panelId, s, o, i, l, U, $, z, M, T, x]
1898
- ), a = w(
1899
- (d, S) => {
1900
- if (o[S] !== "custom") {
1901
- E(p.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", S);
2434
+ [e.isActive, e.panelId, o, r, a, c, T, Y, R, A, z, v]
2435
+ ), h = D(
2436
+ (x, M) => {
2437
+ if (r[M] !== "custom") {
2438
+ O(m.current, 1, "🚫 カスタムドラッグモードではない - スキップ:", M);
1902
2439
  return;
1903
2440
  }
1904
- _(d.clientX, d.clientY), s.isClicked && s.panelId === S && (T(!0), g.current !== null && (clearTimeout(g.current), g.current = null), R(d.clientX, d.clientY), m.current = { x: d.clientX, y: d.clientY });
2441
+ S(x.clientX, x.clientY), o.isClicked && o.panelId === M && (z(!0), p.current !== null && (clearTimeout(p.current), p.current = null), N(x.clientX, x.clientY), j.current = { x: x.clientX, y: x.clientY });
1905
2442
  },
1906
- [s, o, _, T, R]
2443
+ [o, r, S, z, N]
1907
2444
  );
1908
- return K(() => () => {
1909
- g.current !== null && clearTimeout(g.current), D.current.stop();
2445
+ return ee(() => () => {
2446
+ p.current !== null && clearTimeout(p.current), I.current.stop();
1910
2447
  }, []), {
1911
- handleGlobalMouseMove: O,
1912
- handleGlobalMouseUp: H,
1913
- handleMouseDown: a
2448
+ handleGlobalMouseMove: V,
2449
+ handleGlobalMouseUp: oe,
2450
+ handleMouseDown: h
1914
2451
  };
1915
- }, Ft = () => {
1916
- const [r, e] = te({
2452
+ }, $r = () => {
2453
+ const [t, n] = se({
1917
2454
  isDragging: !1,
1918
2455
  draggedPanel: null,
1919
2456
  dragOverColumn: null
1920
- }), [n, s] = te(null), [o, i] = te(null), [u, c] = te({
2457
+ }), [e, o] = se(null), [r, a] = se(null), [l, u] = se({
1921
2458
  isActive: !1,
1922
2459
  panelId: "",
1923
2460
  startX: 0,
1924
2461
  startY: 0
1925
- }), [h, N] = te({
2462
+ }), [f, b] = se({
1926
2463
  isClicked: !1,
1927
2464
  panelId: null
1928
- }), [b, M] = te({
1929
- isTouchDragging: !1,
1930
- startX: 0,
1931
- startY: 0,
1932
- currentX: 0,
1933
- currentY: 0,
1934
- draggedElement: null
1935
- }), [T, y] = te(!1), l = w(() => {
1936
- c({ isActive: !1, panelId: "", startX: 0, startY: 0 }), e({ isDragging: !1, draggedPanel: null, dragOverColumn: null }), s(null), i(null);
1937
- }, []), j = w(() => {
1938
- N({ isClicked: !1, panelId: null }), y(!1);
1939
- }, []), k = w(($) => {
1940
- e($);
1941
- }, []), _ = w(($) => {
1942
- s($);
1943
- }, []), R = w(($) => {
1944
- i($);
1945
- }, []), z = w(($) => {
1946
- c($);
1947
- }, []), Z = w(($) => {
1948
- N($);
1949
- }, []), Y = w(($) => {
1950
- M($);
1951
- }, []), U = w(($) => {
1952
- y($);
2465
+ }), [y, A] = se(!1), z = D(() => {
2466
+ u({ isActive: !1, panelId: "", startX: 0, startY: 0 }), n({ isDragging: !1, draggedPanel: null, dragOverColumn: null }), o(null), a(null);
2467
+ }, []), E = D(() => {
2468
+ b({ isClicked: !1, panelId: null }), A(!1);
2469
+ }, []), c = D((d) => {
2470
+ n(d);
2471
+ }, []), P = D((d) => {
2472
+ o(d);
2473
+ }, []), k = D((d) => {
2474
+ a(d);
2475
+ }, []), S = D((d) => {
2476
+ u(d);
2477
+ }, []), N = D((d) => {
2478
+ b(d);
2479
+ }, []), R = D((d) => {
2480
+ A(d);
1953
2481
  }, []);
1954
2482
  return {
1955
2483
  // States / 状態
1956
- dragState: r,
1957
- dragOverPosition: n,
1958
- originalPanelPosition: o,
1959
- customDrag: u,
1960
- clickState: h,
1961
- touchDragState: b,
1962
- isMouseDown: T,
2484
+ dragState: t,
2485
+ dragOverPosition: e,
2486
+ originalPanelPosition: r,
2487
+ customDrag: l,
2488
+ clickState: f,
2489
+ isMouseDown: y,
1963
2490
  // Stabilized Setters / 安定化されたセッター
1964
- setDragState: k,
1965
- setDragOverPosition: _,
1966
- setOriginalPanelPosition: R,
1967
- setCustomDrag: z,
1968
- setClickState: Z,
1969
- setTouchDragState: Y,
1970
- setIsMouseDown: U,
2491
+ setDragState: c,
2492
+ setDragOverPosition: P,
2493
+ setOriginalPanelPosition: k,
2494
+ setCustomDrag: S,
2495
+ setClickState: N,
2496
+ setIsMouseDown: R,
1971
2497
  // Utility Functions / ユーティリティ関数
1972
- resetDragState: l,
1973
- resetClickState: j
2498
+ resetDragState: z,
2499
+ resetClickState: E
1974
2500
  };
1975
- }, Xt = () => {
1976
- const [r, e] = te({
2501
+ }, Tr = () => {
2502
+ const [t, n] = se({
1977
2503
  x: 0,
1978
2504
  y: 0,
1979
2505
  isVisible: !1
1980
- }), n = F(null), s = F(0), o = F(null), i = w((y, l) => {
1981
- e({ x: y, y: l, isVisible: !0 });
1982
- }, []), u = w(() => {
1983
- e((y) => ({ ...y, isVisible: !1 }));
1984
- }, []), c = w((y, l) => {
1985
- e((j) => j.x === y && j.y === l ? j : {
1986
- x: y,
1987
- y: l,
1988
- isVisible: j.isVisible
2506
+ }), e = W(null), o = W(0), r = W(null), a = D((E, c) => {
2507
+ n({ x: E, y: c, isVisible: !0 });
2508
+ }, []), l = D(() => {
2509
+ n((E) => ({ ...E, isVisible: !1 }));
2510
+ }, []), u = D((E, c) => {
2511
+ n((P) => P.x === E && P.y === c ? P : {
2512
+ x: E,
2513
+ y: c,
2514
+ isVisible: P.isVisible
1989
2515
  });
1990
- }, []), h = w((y, l) => {
1991
- s.current = Date.now(), o.current = { x: y, y: l };
1992
- }, []), N = w((y, l) => {
1993
- n.current = { x: y, y: l };
1994
- }, []), b = w((y, l, j = 500, k = 5) => Date.now() - (s.current || 0) >= j || !o.current ? !1 : Math.sqrt((y - o.current.x) ** 2 + (l - o.current.y) ** 2) < k, []), M = w((y, l) => {
1995
- if (!n.current)
2516
+ }, []), f = D((E, c) => {
2517
+ o.current = Date.now(), r.current = { x: E, y: c };
2518
+ }, []), b = D((E, c) => {
2519
+ e.current = { x: E, y: c };
2520
+ }, []), y = D((E, c, P = 500, k = 5) => Date.now() - (o.current || 0) >= P || !r.current ? !1 : Math.sqrt((E - r.current.x) ** 2 + (c - r.current.y) ** 2) < k, []), A = D((E, c) => {
2521
+ if (!e.current)
1996
2522
  return 0;
1997
- const j = Math.abs(y - n.current.x), k = Math.abs(l - n.current.y);
1998
- return Math.sqrt(j * j + k * k);
1999
- }, []), T = w(() => {
2000
- n.current = null, s.current = 0, o.current = null;
2523
+ const P = Math.abs(E - e.current.x), k = Math.abs(c - e.current.y);
2524
+ return Math.sqrt(P * P + k * k);
2525
+ }, []), z = D(() => {
2526
+ e.current = null, o.current = 0, r.current = null;
2001
2527
  }, []);
2002
2528
  return {
2003
- mousePosition: r,
2004
- lastClickPosition: n.current,
2005
- mouseDownTime: s.current,
2006
- mouseDownPosition: o.current,
2007
- showMousePosition: i,
2008
- hideMousePosition: u,
2009
- updateMousePosition: c,
2010
- recordMouseDown: h,
2011
- recordClickPosition: N,
2012
- isVirtualClick: b,
2013
- calculateMoveDistance: M,
2014
- clearMouseTracking: T
2529
+ mousePosition: t,
2530
+ lastClickPosition: e.current,
2531
+ mouseDownTime: o.current,
2532
+ mouseDownPosition: r.current,
2533
+ showMousePosition: a,
2534
+ hideMousePosition: l,
2535
+ updateMousePosition: u,
2536
+ recordMouseDown: f,
2537
+ recordClickPosition: b,
2538
+ isVirtualClick: y,
2539
+ calculateMoveDistance: A,
2540
+ clearMouseTracking: z
2015
2541
  };
2016
- }, Ht = ({
2017
- debugConfig: r,
2018
- dragState: e,
2019
- customDrag: n,
2020
- dragModes: s,
2021
- columnPanels: o,
2022
- dragOverPosition: i,
2023
- originalPanelPosition: u,
2024
- setDragState: c,
2025
- setDragOverPosition: h,
2026
- setOriginalPanelPosition: N,
2027
- performPanelMove: b,
2028
- showMousePosition: M,
2029
- updateMousePosition: T,
2030
- resetDragState: y,
2031
- handlePlaceholderDragEnter: l,
2032
- handlePlaceholderDragLeave: j,
2542
+ }, Lr = ({
2543
+ debugConfig: t,
2544
+ dragState: n,
2545
+ customDrag: e,
2546
+ dragModes: o,
2547
+ columnPanels: r,
2548
+ dragOverPosition: a,
2549
+ originalPanelPosition: l,
2550
+ setDragState: u,
2551
+ setDragOverPosition: f,
2552
+ setOriginalPanelPosition: b,
2553
+ performPanelMove: y,
2554
+ showMousePosition: A,
2555
+ updateMousePosition: z,
2556
+ resetDragState: E,
2557
+ handlePlaceholderDragEnter: c,
2558
+ handlePlaceholderDragLeave: P,
2033
2559
  scale: k = 1
2034
2560
  }) => {
2035
- const _ = F(r);
2036
- _.current = r;
2037
- const R = F(o);
2038
- R.current = o;
2039
- const z = F(e);
2040
- z.current = e;
2041
- const Z = F(i);
2042
- Z.current = i;
2043
- const Y = F(u);
2044
- Y.current = u;
2045
- const U = F(k);
2046
- U.current = k;
2047
- const $ = F(new Ke(ke));
2048
- K(() => {
2049
- const p = document.querySelector("main[data-aqdd-scroll-root]");
2050
- p && $.current.setScrollElement(p);
2561
+ const S = W(t);
2562
+ S.current = t;
2563
+ const N = W(r);
2564
+ N.current = r;
2565
+ const R = W(n);
2566
+ R.current = n;
2567
+ const d = W(a);
2568
+ d.current = a;
2569
+ const $ = W(l);
2570
+ $.current = l;
2571
+ const T = W(k);
2572
+ T.current = k;
2573
+ const Y = W(new rt(Se));
2574
+ ee(() => {
2575
+ const m = document.querySelector(Vt);
2576
+ m && Y.current.setScrollElement(m);
2051
2577
  }, []);
2052
- const L = w(
2053
- (p, g) => {
2054
- if (n.isActive) {
2055
- E(_.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", g), p.preventDefault();
2578
+ const G = D(
2579
+ (m, p) => {
2580
+ if (e.isActive) {
2581
+ O(S.current, 2, "カスタムドラッグアクティブ中 - 通常ドラッグを無効化:", p), m.preventDefault();
2056
2582
  return;
2057
2583
  }
2058
- if (s[g] === "custom") {
2059
- E(_.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", g), p.preventDefault();
2584
+ if (o[p] === "custom") {
2585
+ O(S.current, 2, "カスタムドラッグモード - 通常ドラッグを無効化:", p), m.preventDefault();
2060
2586
  return;
2061
2587
  }
2062
- E(_.current, 1, "ドラッグ開始:", g);
2063
- const m = Object.keys(R.current);
2064
- let v = null;
2065
- for (let D = 0; D < m.length; D++) {
2066
- const A = m[D], O = R.current[A].indexOf(g);
2067
- if (O !== -1) {
2068
- v = { columnIndex: D, panelIndex: O };
2588
+ O(S.current, 1, "ドラッグ開始:", p);
2589
+ const j = Object.keys(N.current);
2590
+ let _ = null;
2591
+ for (let I = 0; I < j.length; I++) {
2592
+ const re = j[I], V = N.current[re].indexOf(p);
2593
+ if (V !== -1) {
2594
+ _ = { columnIndex: I, panelIndex: V };
2069
2595
  break;
2070
2596
  }
2071
2597
  }
2072
- if (N(v), p.dataTransfer) {
2073
- p.dataTransfer.setData("text/plain", g), p.dataTransfer.effectAllowed = "move";
2074
- const D = U.current;
2075
- if (D < 1) {
2076
- const A = p.currentTarget.closest("[data-panel-id]") ?? p.currentTarget, O = A.getBoundingClientRect(), H = A.offsetWidth, a = A.offsetHeight, d = A.cloneNode(!0);
2077
- d.removeAttribute("data-panel-id"), d.removeAttribute("id"), d.style.margin = "0", d.style.width = `${H}px`, d.style.height = `${a}px`, d.style.transform = `scale(${D})`, d.style.transformOrigin = "top left";
2078
- const S = document.createElement("div");
2079
- S.style.position = "fixed", S.style.top = "0", S.style.left = "-10000px", S.style.width = `${H * D}px`, S.style.height = `${a * D}px`, S.style.overflow = "hidden", S.style.opacity = "0.8", S.style.pointerEvents = "none", S.appendChild(d), document.body.appendChild(S), p.dataTransfer.setDragImage(S, p.clientX - O.left, p.clientY - O.top), requestAnimationFrame(() => S.remove());
2598
+ if (b(_), m.dataTransfer) {
2599
+ m.dataTransfer.setData("text/plain", p), m.dataTransfer.effectAllowed = "move";
2600
+ const I = T.current;
2601
+ if (I < 1) {
2602
+ const re = m.currentTarget.closest("[data-panel-id]") ?? m.currentTarget, V = re.getBoundingClientRect(), oe = re.offsetWidth, h = re.offsetHeight, x = re.cloneNode(!0);
2603
+ x.removeAttribute("data-panel-id"), x.removeAttribute("id"), Zt(re, x), x.style.margin = "0", x.style.width = `${oe}px`, x.style.height = `${h}px`, x.style.transform = `scale(${I})`, x.style.transformOrigin = "top left";
2604
+ const M = document.createElement("div");
2605
+ M.style.position = "fixed", M.style.top = "0", M.style.left = "-10000px", M.style.width = `${oe * I}px`, M.style.height = `${h * I}px`, M.style.overflow = "hidden", M.style.opacity = "0.8", M.style.pointerEvents = "none", M.appendChild(x), document.body.appendChild(M), m.dataTransfer.setDragImage(M, m.clientX - V.left, m.clientY - V.top), requestAnimationFrame(() => M.remove());
2080
2606
  }
2081
2607
  }
2082
- M(p.clientX, p.clientY), requestAnimationFrame(() => {
2083
- c({
2608
+ A(m.clientX, m.clientY), requestAnimationFrame(() => {
2609
+ u({
2084
2610
  isDragging: !0,
2085
- draggedPanel: g,
2611
+ draggedPanel: p,
2086
2612
  dragOverColumn: null
2087
2613
  });
2088
2614
  });
2089
2615
  },
2090
- [s, n.isActive, N, M, c]
2091
- ), f = w(() => {
2092
- E(_.current, 1, "ドラッグ終了"), $.current.stop(), y();
2093
- }, [y]), x = w(
2094
- (p, g) => {
2095
- if (p.preventDefault(), p.dataTransfer.dropEffect = "move", !z.current.isDragging) return;
2096
- T(p.clientX, p.clientY), g !== z.current.dragOverColumn && c((D) => ({ ...D, dragOverColumn: g }));
2097
- const m = document.elementFromPoint(p.clientX, p.clientY), v = m?.closest("[data-placeholder-index]");
2098
- if (v) {
2099
- const D = v.getAttribute("data-placeholder-index"), A = v.getAttribute("data-placeholder-column");
2100
- if (D && A) {
2101
- const O = parseInt(D, 10), H = parseInt(A, 10);
2102
- l(H, O);
2616
+ [o, e.isActive, b, A, u]
2617
+ ), g = D(() => {
2618
+ O(S.current, 1, "ドラッグ終了"), Y.current.stop(), E();
2619
+ }, [E]), v = D(
2620
+ (m, p) => {
2621
+ if (m.preventDefault(), m.dataTransfer.dropEffect = "move", !R.current.isDragging) return;
2622
+ z(m.clientX, m.clientY), p !== R.current.dragOverColumn && u((I) => ({ ...I, dragOverColumn: p }));
2623
+ const j = document.elementFromPoint(m.clientX, m.clientY), _ = j?.closest("[data-placeholder-index]");
2624
+ if (_) {
2625
+ const I = _.getAttribute("data-placeholder-index"), re = _.getAttribute("data-placeholder-column");
2626
+ if (I && re) {
2627
+ const V = parseInt(I, 10), oe = parseInt(re, 10);
2628
+ c(oe, V);
2103
2629
  }
2104
2630
  } else
2105
- m?.closest("[data-drop-zone]") || j();
2631
+ j?.closest("[data-drop-zone]") || P();
2106
2632
  },
2107
- [T, c, l, j]
2108
- ), C = w(
2109
- (p, g) => {
2110
- p.preventDefault();
2111
- const m = p.dataTransfer.getData("text/plain"), v = Z.current;
2112
- m && v && (E(_.current, 1, "🎯 ドロップ完了:", {
2113
- draggedPanel: m,
2114
- targetColumn: g,
2115
- insertPosition: `カラム${v.columnIndex} - 位置${v.insertIndex}`
2116
- }), b(m, g, v.insertIndex), h(null), f());
2633
+ [z, u, c, P]
2634
+ ), L = D(
2635
+ (m, p) => {
2636
+ m.preventDefault();
2637
+ const j = m.dataTransfer.getData("text/plain"), _ = d.current;
2638
+ j && _ && (O(S.current, 1, "🎯 ドロップ完了:", {
2639
+ draggedPanel: j,
2640
+ targetColumn: p,
2641
+ insertPosition: `カラム${_.columnIndex} - 位置${_.insertIndex}`
2642
+ }), y(j, p, _.insertIndex), f(null), g());
2117
2643
  },
2118
- [b, h, f]
2119
- ), W = w(
2120
- (p) => {
2121
- const g = p.currentTarget, m = p.relatedTarget;
2122
- m && g.contains(m) || (h(null), c((v) => ({ ...v, dragOverColumn: null })));
2644
+ [y, f, g]
2645
+ ), w = D(
2646
+ (m) => {
2647
+ const p = m.currentTarget, j = m.relatedTarget;
2648
+ j && p.contains(j) || (f(null), u((_) => ({ ..._, dragOverColumn: null })));
2123
2649
  },
2124
- [h, c]
2650
+ [f, u]
2125
2651
  );
2126
- return K(() => {
2127
- const p = (g) => {
2128
- z.current.isDragging && (T(g.clientX, g.clientY), $.current.update(g.clientX, g.clientY));
2652
+ return ee(() => {
2653
+ const m = (p) => {
2654
+ R.current.isDragging && (z(p.clientX, p.clientY), Y.current.update(p.clientX, p.clientY));
2129
2655
  };
2130
- if (e.isDragging)
2131
- return document.addEventListener("dragover", p), () => {
2132
- document.removeEventListener("dragover", p), $.current.stop();
2656
+ if (n.isDragging)
2657
+ return document.addEventListener("dragover", m), () => {
2658
+ document.removeEventListener("dragover", m), Y.current.stop();
2133
2659
  };
2134
- }, [e.isDragging, T]), K(() => () => {
2135
- $.current.stop();
2660
+ }, [n.isDragging, z]), ee(() => () => {
2661
+ Y.current.stop();
2136
2662
  }, []), {
2137
- handleDragStart: L,
2138
- handleDragEnd: f,
2139
- handleDragOverWithInsert: x,
2140
- handleDropWithInsert: C,
2141
- handleColumnDragLeave: W
2663
+ handleDragStart: G,
2664
+ handleDragEnd: g,
2665
+ handleDragOverWithInsert: v,
2666
+ handleDropWithInsert: L,
2667
+ handleColumnDragLeave: w
2142
2668
  };
2143
- }, qt = (r, e = 1) => {
2144
- const [n, s] = te(r), [o, i] = te({}), u = F({}), c = F(null), h = F({ x: 0, y: 0 }), N = F(e);
2145
- N.current = e;
2146
- const b = w((R) => document.querySelector(`[data-panel-id="${R}"]`), []), M = w(
2147
- (R, z) => {
2148
- const Z = z.getBoundingClientRect(), Y = window.getComputedStyle(z), U = {
2149
- width: Math.round(Z.width),
2150
- height: Math.round(Z.height),
2151
- x: Math.round(Z.left),
2152
- y: Math.round(Z.top),
2153
- minHeight: Y.minHeight || "auto",
2154
- maxHeight: Y.maxHeight || "none"
2155
- }, $ = u.current[R];
2156
- (!$ || Object.keys(U).some((L) => $[L] !== U[L])) && (u.current[R] = U, i((L) => ({
2157
- ...L,
2158
- [R]: U
2669
+ }, _r = (t, n = 1) => {
2670
+ const [e, o] = se(t), [r, a] = se({}), l = W({}), u = W(null), f = W({ x: 0, y: 0 }), b = W(n);
2671
+ b.current = n;
2672
+ const y = D((N) => document.querySelector(`[data-panel-id="${N}"]`), []), A = D(
2673
+ (N, R) => {
2674
+ const d = R.getBoundingClientRect(), $ = window.getComputedStyle(R), T = {
2675
+ width: Math.round(d.width),
2676
+ height: Math.round(d.height),
2677
+ x: Math.round(d.left),
2678
+ y: Math.round(d.top),
2679
+ minHeight: $.minHeight || "auto",
2680
+ maxHeight: $.maxHeight || "none"
2681
+ }, Y = l.current[N];
2682
+ (!Y || Object.keys(T).some((G) => Y[G] !== T[G])) && (l.current[N] = T, a((G) => ({
2683
+ ...G,
2684
+ [N]: T
2159
2685
  })));
2160
2686
  },
2161
2687
  []
2162
2688
  // setPanelSizes は React の state セッターなので依存配列に含める必要はありません
2163
- ), T = w(
2164
- (R) => {
2165
- const z = b(R);
2166
- z && M(R, z);
2689
+ ), z = D(
2690
+ (N) => {
2691
+ const R = y(N);
2692
+ R && A(N, R);
2167
2693
  },
2168
- [b, M]
2169
- ), y = w(
2170
- (R, z) => {
2171
- z && requestAnimationFrame(() => M(R, z));
2694
+ [y, A]
2695
+ ), E = D(
2696
+ (N, R) => {
2697
+ R && requestAnimationFrame(() => A(N, R));
2172
2698
  },
2173
- [M]
2174
- ), l = w(
2175
- (R, z, Z) => {
2176
- const Y = b(R);
2177
- if (!Y || c.current) return;
2178
- const U = N.current, $ = Y.getBoundingClientRect(), L = Y.cloneNode(!0);
2179
- L.removeAttribute("data-panel-id"), L.style.position = "fixed", L.style.top = "0px", L.style.left = "0px", L.style.width = `${Y.offsetWidth}px`, L.style.height = `${Y.offsetHeight}px`, L.style.pointerEvents = "none", L.style.zIndex = "1000", L.style.opacity = "0.5", L.style.margin = "0", L.style.transition = "none", L.style.boxShadow = "0 8px 32px rgba(0,0,0,0.3)", L.style.transformOrigin = "top left", L.style.transform = `translate(${$.left}px, ${$.top}px) scale(${U})`, L.id = `drag-image-${R}`, document.body.appendChild(L), c.current = L, h.current = { x: z, y: Z };
2699
+ [A]
2700
+ ), c = D(
2701
+ (N, R, d) => {
2702
+ const $ = y(N);
2703
+ !$ || u.current || (u.current = Gt($, N, b.current), f.current = { x: R, y: d });
2180
2704
  },
2181
- [b]
2182
- ), j = w((R, z) => {
2183
- if (c.current) {
2184
- const Z = R - h.current.x, Y = z - h.current.y;
2185
- c.current.style.transform = `translate(${Z}px, ${Y}px) scale(${N.current * 1.05})`;
2186
- }
2187
- }, []), k = w(() => {
2188
- c.current && (c.current.remove(), c.current = null);
2189
- }, []), _ = w((R) => {
2190
- s((z) => ({
2191
- ...z,
2192
- [R]: !z[R]
2705
+ [y]
2706
+ ), P = D((N, R) => {
2707
+ u.current && Kt(u.current, N, R, f.current, b.current);
2708
+ }, []), k = D(() => {
2709
+ u.current && (u.current.remove(), u.current = null);
2710
+ }, []), S = D((N) => {
2711
+ o((R) => ({
2712
+ ...R,
2713
+ [N]: !R[N]
2193
2714
  }));
2194
2715
  }, []);
2195
2716
  return {
2196
2717
  // State / 状態
2197
- panelVisibility: n,
2198
- panelSizes: o,
2718
+ panelVisibility: e,
2719
+ panelSizes: r,
2199
2720
  // State update functions / 状態更新関数
2200
- setPanelVisibility: s,
2201
- setPanelSizes: i,
2202
- setPanelRef: y,
2203
- updatePanelSize: T,
2204
- togglePanelVisibility: _,
2721
+ setPanelVisibility: o,
2722
+ setPanelSizes: a,
2723
+ setPanelRef: E,
2724
+ updatePanelSize: z,
2725
+ togglePanelVisibility: S,
2205
2726
  // Utility functions / ユーティリティ関数
2206
- getPanelElement: b,
2727
+ getPanelElement: y,
2207
2728
  // Functions for drag image management / ドラッグイメージ管理用の関数
2208
- createDragImage: l,
2209
- updateDragImagePosition: j,
2729
+ createDragImage: c,
2730
+ updateDragImagePosition: P,
2210
2731
  removeDragImage: k
2211
2732
  };
2212
- }, on = ({ initialColumnPanels: r, initialPanelVisibility: e, initialDragModes: n = {}, debugConfig: s, onPanelMove: o, onDragModeChange: i, onColumnPanelsChange: u, scale: c = 1 }) => {
2213
- const h = F(s);
2214
- h.current = s;
2215
- const [N, b] = te(r), [M, T] = te(n), y = F(N);
2216
- y.current = N;
2217
- const l = Ft(), j = Xt(), k = qt(e, c), _ = F({
2733
+ }, Jr = ({ initialColumnPanels: t, initialPanelVisibility: n, initialDragModes: e = {}, debugConfig: o, onPanelMove: r, onDragModeChange: a, onColumnPanelsChange: l, scale: u = 1 }) => {
2734
+ const f = W(o);
2735
+ f.current = o;
2736
+ const [b, y] = se(t), [A, z] = se(e), E = W(b);
2737
+ E.current = b;
2738
+ const c = $r(), P = Tr(), k = _r(n, u), S = W({
2218
2739
  mousemove: null,
2219
2740
  mouseup: null
2220
- }), R = w((m) => {
2221
- const v = Object.keys(y.current), D = Lt(v, ie);
2222
- for (let A = 0; A < D.length; A++) {
2223
- const O = D[A], H = y.current[O]?.indexOf(m) ?? -1;
2224
- if (H !== -1)
2225
- return { columnIndex: A, panelIndex: H };
2741
+ }), N = D((w) => {
2742
+ const m = Object.keys(E.current), p = Mr(m, fe);
2743
+ for (let j = 0; j < p.length; j++) {
2744
+ const _ = p[j], I = E.current[_]?.indexOf(w) ?? -1;
2745
+ if (I !== -1)
2746
+ return { columnIndex: j, panelIndex: I };
2226
2747
  }
2227
2748
  return null;
2228
- }, []), z = w(
2229
- (m, v, D) => {
2230
- E(h.current, 1, "🔄 パネル移動実行:", m, "→", v, "@", D), b((A) => {
2231
- const O = { ...A }, H = Object.keys(O).find((a) => O[a].includes(m));
2232
- if (!H)
2233
- return console.error("Source column not found for panel:", m), A;
2234
- if (!O[v])
2235
- return console.error("Target column not found:", v), A;
2236
- if (H === v) {
2237
- const a = [...O[H]], d = a.indexOf(m), [S] = a.splice(d, 1), X = d < D ? D - 1 : D;
2238
- a.splice(X, 0, S), O[v] = a;
2239
- } else {
2240
- O[H] = O[H].filter((d) => d !== m);
2241
- const a = [...O[v]];
2242
- a.splice(D, 0, m), O[v] = a;
2243
- }
2244
- if (E(h.current, 1, "✅ パネル移動完了:", m, "→", v), u && requestAnimationFrame(() => {
2245
- u(O);
2246
- }), o) {
2247
- const a = Object.keys(A).find((d) => A[d].includes(m));
2248
- a && requestAnimationFrame(() => {
2249
- o(m, a, v, D);
2749
+ }, []), R = D(
2750
+ (w, m, p) => {
2751
+ O(f.current, 1, "🔄 パネル移動実行:", w, "→", m, "@", p), y((j) => {
2752
+ if (!Object.values(j).some((I) => I.includes(w)))
2753
+ return console.error("Source column not found for panel:", w), j;
2754
+ if (!j[m])
2755
+ return console.error("Target column not found:", m), j;
2756
+ const _ = Yt(j, w, m, p);
2757
+ if (_ === null) return j;
2758
+ if (O(f.current, 1, "✅ パネル移動完了:", w, "→", m), l && requestAnimationFrame(() => {
2759
+ l(_);
2760
+ }), r) {
2761
+ const I = Object.keys(j).find((re) => j[re].includes(w));
2762
+ I && requestAnimationFrame(() => {
2763
+ r(w, I, m, p);
2250
2764
  });
2251
2765
  }
2252
- return O;
2766
+ return _;
2253
2767
  });
2254
2768
  },
2255
- [u, o]
2256
- ), Z = w(
2257
- (m, v) => {
2258
- if (!(l.dragState.isDragging || l.customDrag.isActive)) return;
2259
- const D = l.originalPanelPosition;
2260
- if (D && D.columnIndex === m && (D.panelIndex === v || D.panelIndex + 1 === v)) {
2261
- E(h.current, 1, `元の位置への挿入をスキップ: カラム${m}, 位置${v}`);
2769
+ [l, r]
2770
+ ), d = D(
2771
+ (w, m) => {
2772
+ if (!(c.dragState.isDragging || c.customDrag.isActive)) return;
2773
+ const p = c.originalPanelPosition;
2774
+ if (p !== null && et(p, w, m)) {
2775
+ O(f.current, 1, `元の位置への挿入をスキップ: カラム${w}, 位置${m}`);
2262
2776
  return;
2263
2777
  }
2264
- const A = l.dragOverPosition;
2265
- (!A || A.columnIndex !== m || A.insertIndex !== v) && (E(h.current, 1, `プレースホルダーエンター: カラム${m}, 位置${v}`), l.setDragOverPosition({ columnIndex: m, insertIndex: v }), l.setDragState((O) => ({ ...O, dragOverColumn: m })));
2778
+ const j = c.dragOverPosition;
2779
+ (!j || j.columnIndex !== w || j.insertIndex !== m) && (O(f.current, 1, `プレースホルダーエンター: カラム${w}, 位置${m}`), c.setDragOverPosition({ columnIndex: w, insertIndex: m }), c.setDragState((_) => ({ ..._, dragOverColumn: w })));
2266
2780
  },
2267
- [l]
2268
- ), Y = w(
2269
- (m, v, D) => {
2270
- if (l.dragState.isDragging || l.customDrag.isActive) {
2271
- if (l.customDrag.isActive)
2272
- E(h.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), l.setDragOverPosition(null);
2273
- else if (l.dragState.isDragging && m && v !== void 0 && D !== void 0) {
2274
- const A = l.dragOverPosition;
2275
- if (A && A.columnIndex === v && A.insertIndex === D) {
2276
- const O = m.currentTarget, H = m.relatedTarget;
2277
- H && O.contains(H) || (E(h.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${v}, 位置${D}。ハイライトを解除します。`), l.setDragOverPosition(null));
2781
+ [c]
2782
+ ), $ = D(
2783
+ (w, m, p) => {
2784
+ if (c.dragState.isDragging || c.customDrag.isActive) {
2785
+ if (c.customDrag.isActive)
2786
+ O(f.current, 1, "🚫 カスタムドラッグ - プレースホルダーリーブ: ハイライトを解除します。"), c.setDragOverPosition(null);
2787
+ else if (c.dragState.isDragging && w && m !== void 0 && p !== void 0) {
2788
+ const j = c.dragOverPosition;
2789
+ if (j && j.columnIndex === m && j.insertIndex === p) {
2790
+ const _ = w.currentTarget, I = w.relatedTarget;
2791
+ I && _.contains(I) || (O(f.current, 1, `ノーマルドラッグ - プレースホルダーリーブ: カラム${m}, 位置${p}。ハイライトを解除します。`), c.setDragOverPosition(null));
2278
2792
  }
2279
2793
  }
2280
2794
  }
2281
2795
  },
2282
- [l]
2283
- ), U = Yt({
2284
- debugConfig: h.current,
2285
- dragState: l.dragState,
2286
- customDrag: l.customDrag,
2287
- clickState: l.clickState,
2288
- dragModes: M,
2289
- isMouseDown: l.isMouseDown,
2290
- originalPanelPosition: l.originalPanelPosition,
2291
- dragOverPosition: l.dragOverPosition,
2292
- setCustomDrag: l.setCustomDrag,
2293
- setDragState: l.setDragState,
2294
- setDragOverPosition: l.setDragOverPosition,
2295
- setOriginalPanelPosition: l.setOriginalPanelPosition,
2296
- setClickState: l.setClickState,
2297
- setIsMouseDown: l.setIsMouseDown,
2298
- findPanelPosition: R,
2299
- performPanelMove: z,
2300
- showMousePosition: j.showMousePosition,
2301
- updateMousePosition: j.updateMousePosition,
2302
- recordMouseDown: j.recordMouseDown,
2303
- recordClickPosition: j.recordClickPosition,
2304
- isVirtualClick: j.isVirtualClick,
2305
- calculateMoveDistance: j.calculateMoveDistance,
2306
- clearMouseTracking: j.clearMouseTracking,
2307
- resetDragState: l.resetDragState,
2308
- resetClickState: l.resetClickState,
2796
+ [c]
2797
+ ), T = Ar({
2798
+ debugConfig: f.current,
2799
+ dragState: c.dragState,
2800
+ customDrag: c.customDrag,
2801
+ clickState: c.clickState,
2802
+ dragModes: A,
2803
+ isMouseDown: c.isMouseDown,
2804
+ originalPanelPosition: c.originalPanelPosition,
2805
+ dragOverPosition: c.dragOverPosition,
2806
+ setCustomDrag: c.setCustomDrag,
2807
+ setDragState: c.setDragState,
2808
+ setDragOverPosition: c.setDragOverPosition,
2809
+ setOriginalPanelPosition: c.setOriginalPanelPosition,
2810
+ setClickState: c.setClickState,
2811
+ setIsMouseDown: c.setIsMouseDown,
2812
+ findPanelPosition: N,
2813
+ performPanelMove: R,
2814
+ showMousePosition: P.showMousePosition,
2815
+ updateMousePosition: P.updateMousePosition,
2816
+ recordMouseDown: P.recordMouseDown,
2817
+ recordClickPosition: P.recordClickPosition,
2818
+ isVirtualClick: P.isVirtualClick,
2819
+ calculateMoveDistance: P.calculateMoveDistance,
2820
+ clearMouseTracking: P.clearMouseTracking,
2821
+ resetDragState: c.resetDragState,
2822
+ resetClickState: c.resetClickState,
2309
2823
  createDragImage: k.createDragImage,
2310
2824
  updateDragImagePosition: k.updateDragImagePosition,
2311
2825
  removeDragImage: k.removeDragImage,
2312
- handlePlaceholderDragEnter: Z,
2313
- handlePlaceholderDragLeave: Y
2314
- }), $ = Ht({
2315
- debugConfig: h.current,
2316
- dragState: l.dragState,
2317
- customDrag: l.customDrag,
2318
- dragModes: M,
2319
- columnPanels: N,
2320
- dragOverPosition: l.dragOverPosition,
2321
- originalPanelPosition: l.originalPanelPosition,
2322
- setDragState: l.setDragState,
2323
- setDragOverPosition: l.setDragOverPosition,
2324
- setOriginalPanelPosition: l.setOriginalPanelPosition,
2325
- performPanelMove: z,
2326
- showMousePosition: j.showMousePosition,
2327
- updateMousePosition: j.updateMousePosition,
2328
- resetDragState: l.resetDragState,
2329
- handlePlaceholderDragEnter: Z,
2330
- handlePlaceholderDragLeave: Y,
2331
- scale: c
2332
- }), L = w((m) => {
2333
- _.current.mousemove && _.current.mousemove(m);
2334
- }, []), f = w((m) => {
2335
- _.current.mouseup && _.current.mouseup(m);
2826
+ handlePlaceholderDragEnter: d,
2827
+ handlePlaceholderDragLeave: $
2828
+ }), Y = Lr({
2829
+ debugConfig: f.current,
2830
+ dragState: c.dragState,
2831
+ customDrag: c.customDrag,
2832
+ dragModes: A,
2833
+ columnPanels: b,
2834
+ dragOverPosition: c.dragOverPosition,
2835
+ originalPanelPosition: c.originalPanelPosition,
2836
+ setDragState: c.setDragState,
2837
+ setDragOverPosition: c.setDragOverPosition,
2838
+ setOriginalPanelPosition: c.setOriginalPanelPosition,
2839
+ performPanelMove: R,
2840
+ showMousePosition: P.showMousePosition,
2841
+ updateMousePosition: P.updateMousePosition,
2842
+ resetDragState: c.resetDragState,
2843
+ handlePlaceholderDragEnter: d,
2844
+ handlePlaceholderDragLeave: $,
2845
+ scale: u
2846
+ }), G = D((w) => {
2847
+ S.current.mousemove && S.current.mousemove(w);
2848
+ }, []), g = D((w) => {
2849
+ S.current.mouseup && S.current.mouseup(w);
2336
2850
  }, []);
2337
- K(() => (E(h.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", L), document.addEventListener("mouseup", f), () => {
2338
- E(h.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", f);
2339
- }), [L, f]), K(() => {
2340
- const m = !l.clickState.isClicked && Object.entries(M).some(([, D]) => D === "custom"), v = l.clickState.isClicked && l.clickState.panelId;
2341
- if (m || v) {
2342
- const D = m ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
2343
- E(h.current, 1, `🔧 イベントハンドラー設定開始: ${D}`), _.current.mousemove = U.handleGlobalMouseMove, _.current.mouseup = U.handleGlobalMouseUp;
2851
+ ee(() => (O(f.current, 1, "🔧 グローバルイベントリスナー初期化 - refベース管理開始"), document.addEventListener("mousemove", G), document.addEventListener("mouseup", g), () => {
2852
+ O(f.current, 1, "🔴 グローバルイベントリスナー終了 - refベース管理終了"), document.removeEventListener("mousemove", G), document.removeEventListener("mouseup", g);
2853
+ }), [G, g]), ee(() => {
2854
+ const w = !c.clickState.isClicked && Object.entries(A).some(([, p]) => p === "custom"), m = c.clickState.isClicked && c.clickState.panelId;
2855
+ if (w || m) {
2856
+ const p = w ? "パターン1(仮想クリック検出)" : "パターン2,3(ドラッグ準備)";
2857
+ O(f.current, 1, `🔧 イベントハンドラー設定開始: ${p}`), S.current.mousemove = T.handleGlobalMouseMove, S.current.mouseup = T.handleGlobalMouseUp;
2344
2858
  } else
2345
- l.customDrag.isActive || l.dragState.isDragging || (_.current.mousemove = null, _.current.mouseup = null);
2346
- }, [l.clickState.isClicked, l.clickState.panelId, M, l.customDrag.isActive, l.dragState.isDragging, U.handleGlobalMouseMove, U.handleGlobalMouseUp]);
2347
- const x = w(
2348
- (m, v) => {
2349
- const D = m.touches[0], A = m.currentTarget;
2350
- l.setTouchDragState({
2351
- isTouchDragging: !0,
2352
- startX: D.clientX,
2353
- startY: D.clientY,
2354
- currentX: D.clientX,
2355
- currentY: D.clientY,
2356
- draggedElement: A
2357
- }), l.setDragState({
2358
- isDragging: !0,
2359
- draggedPanel: v,
2360
- dragOverColumn: null
2361
- });
2362
- },
2363
- [l]
2364
- ), C = w(
2365
- (m) => {
2366
- if (!l.touchDragState.isTouchDragging) return;
2367
- m.preventDefault();
2368
- const v = m.touches[0];
2369
- l.setTouchDragState((D) => ({
2370
- ...D,
2371
- currentX: v.clientX,
2372
- currentY: v.clientY
2373
- }));
2374
- },
2375
- [l.touchDragState.isTouchDragging, l]
2376
- ), W = w(
2377
- (m) => {
2378
- l.touchDragState.isTouchDragging && (l.setTouchDragState({
2379
- isTouchDragging: !1,
2380
- startX: 0,
2381
- startY: 0,
2382
- currentX: 0,
2383
- currentY: 0,
2384
- draggedElement: null
2385
- }), $.handleDragEnd());
2386
- },
2387
- [l.touchDragState.isTouchDragging, l, $]
2388
- ), p = w(
2389
- (m) => {
2390
- E(h.current, 1, "🔄 toggleDragMode called:", { panelId: m }), T((v) => {
2391
- const A = (v[m] || "normal") === "normal" ? "custom" : "normal", O = { ...v, [m]: A };
2392
- if (i)
2859
+ c.customDrag.isActive || c.dragState.isDragging || (S.current.mousemove = null, S.current.mouseup = null);
2860
+ }, [c.clickState.isClicked, c.clickState.panelId, A, c.customDrag.isActive, c.dragState.isDragging, T.handleGlobalMouseMove, T.handleGlobalMouseUp]);
2861
+ const v = D(
2862
+ (w) => {
2863
+ O(f.current, 1, "🔄 toggleDragMode called:", { panelId: w }), z((m) => {
2864
+ const j = (m[w] || "normal") === "normal" ? "custom" : "normal", _ = { ...m, [w]: j };
2865
+ if (a)
2393
2866
  try {
2394
- i(m, A);
2395
- } catch (H) {
2396
- console.error("🔄 Error in onDragModeChange:", H);
2867
+ a(w, j);
2868
+ } catch (I) {
2869
+ console.error("🔄 Error in onDragModeChange:", I);
2397
2870
  }
2398
- return O;
2871
+ return _;
2399
2872
  });
2400
2873
  },
2401
- [i]
2402
- ), g = w((m, v) => {
2403
- m.stopPropagation(), E(h.current, 2, "パネルサイズ情報クリック:", v);
2874
+ [a]
2875
+ ), L = D((w, m) => {
2876
+ w.stopPropagation(), O(f.current, 2, "パネルサイズ情報クリック:", m);
2404
2877
  }, []);
2405
2878
  return {
2406
2879
  // 状態
2407
- columnPanels: N,
2880
+ columnPanels: b,
2408
2881
  panelVisibility: k.panelVisibility,
2409
- dragModes: M,
2410
- dragState: l.dragState,
2411
- dragOverPosition: l.dragOverPosition,
2412
- originalPanelPosition: l.originalPanelPosition,
2413
- touchDragState: l.touchDragState,
2414
- customDrag: l.customDrag,
2415
- clickState: l.clickState,
2416
- mousePosition: j.mousePosition,
2882
+ dragModes: A,
2883
+ dragState: c.dragState,
2884
+ dragOverPosition: c.dragOverPosition,
2885
+ originalPanelPosition: c.originalPanelPosition,
2886
+ customDrag: c.customDrag,
2887
+ clickState: c.clickState,
2888
+ mousePosition: P.mousePosition,
2417
2889
  panelSizes: k.panelSizes,
2418
2890
  // 状態更新関数
2419
- setColumnPanels: b,
2891
+ setColumnPanels: y,
2420
2892
  setPanelVisibility: k.setPanelVisibility,
2421
- setDragModes: T,
2893
+ setDragModes: z,
2422
2894
  setPanelRef: k.setPanelRef,
2423
2895
  // イベントハンドラー
2424
- handleDragStart: $.handleDragStart,
2425
- handleDragEnd: $.handleDragEnd,
2426
- handleMouseDown: U.handleMouseDown,
2427
- handleTouchStart: x,
2428
- handleTouchMove: C,
2429
- handleTouchEnd: W,
2430
- handlePlaceholderDragEnter: Z,
2431
- handlePlaceholderDragLeave: Y,
2432
- handleDragOverWithInsert: $.handleDragOverWithInsert,
2433
- handleDropWithInsert: $.handleDropWithInsert,
2434
- handleColumnDragLeave: $.handleColumnDragLeave,
2435
- handlePanelSizeInfoClick: g,
2896
+ handleDragStart: Y.handleDragStart,
2897
+ handleDragEnd: Y.handleDragEnd,
2898
+ handleMouseDown: T.handleMouseDown,
2899
+ handlePlaceholderDragEnter: d,
2900
+ handlePlaceholderDragLeave: $,
2901
+ handleDragOverWithInsert: Y.handleDragOverWithInsert,
2902
+ handleDropWithInsert: Y.handleDropWithInsert,
2903
+ handleColumnDragLeave: Y.handleColumnDragLeave,
2904
+ handlePanelSizeInfoClick: L,
2436
2905
  // ユーティリティ関数
2437
- toggleDragMode: p,
2438
- findPanelPosition: R
2906
+ toggleDragMode: v,
2907
+ findPanelPosition: N
2439
2908
  };
2440
- }, an = ({ minColumnWidth: r = 350, defaultColumns: e = 3, maxColumns: n = 6, minColumns: s = 1, currentColumnWidths: o = {} } = {}) => {
2441
- const [i, u] = te(0), c = F(0), h = F(null), [N, b] = te(!1), M = F(e);
2442
- K(() => {
2909
+ }, Qr = ({ minColumnWidth: t = 350, defaultColumns: n = 3, maxColumns: e = 6, minColumns: o = 1, currentColumnWidths: r = {} } = {}) => {
2910
+ const [a, l] = se(0), u = W(0), f = W(null), [b, y] = se(!1), A = W(n);
2911
+ ee(() => {
2443
2912
  if (typeof window > "u")
2444
2913
  return;
2445
- const l = () => {
2446
- const k = window.visualViewport?.width ?? 0, _ = document?.documentElement?.clientWidth ?? 0, R = document?.body?.clientWidth ?? 0, z = window.innerWidth ?? 0;
2447
- return _ > 0 ? Math.floor(_) : k > 0 ? Math.floor(k) : R > 0 ? Math.floor(R) : Math.floor(z);
2448
- }, j = () => {
2449
- h.current !== null && cancelAnimationFrame(h.current), h.current = requestAnimationFrame(() => {
2450
- const k = l();
2451
- h.current = null, k !== 0 && (Math.abs(c.current - k) < 2 || (c.current = k, u(k)));
2914
+ const c = () => {
2915
+ const k = window.visualViewport?.width ?? 0, S = document?.documentElement?.clientWidth ?? 0, N = document?.body?.clientWidth ?? 0, R = window.innerWidth ?? 0;
2916
+ return S > 0 ? Math.floor(S) : k > 0 ? Math.floor(k) : N > 0 ? Math.floor(N) : Math.floor(R);
2917
+ }, P = () => {
2918
+ f.current !== null && cancelAnimationFrame(f.current), f.current = requestAnimationFrame(() => {
2919
+ const k = c();
2920
+ f.current = null, k !== 0 && (Math.abs(u.current - k) < 2 || (u.current = k, l(k)));
2452
2921
  });
2453
2922
  };
2454
- return j(), window.addEventListener("resize", j), window.addEventListener("orientationchange", j), window.visualViewport?.addEventListener("resize", j), () => {
2455
- h.current !== null && cancelAnimationFrame(h.current), window.removeEventListener("resize", j), window.removeEventListener("orientationchange", j), window.visualViewport?.removeEventListener("resize", j);
2923
+ return P(), window.addEventListener("resize", P), window.addEventListener("orientationchange", P), window.visualViewport?.addEventListener("resize", P), () => {
2924
+ f.current !== null && cancelAnimationFrame(f.current), window.removeEventListener("resize", P), window.removeEventListener("orientationchange", P), window.visualViewport?.removeEventListener("resize", P);
2456
2925
  };
2457
2926
  }, []);
2458
- const T = Ue(() => {
2459
- if (!N || i === 0)
2460
- return M.current = e, e;
2461
- const l = Math.max(i - 64, 0), j = 24, k = Object.values(o);
2462
- let _;
2927
+ const z = Re(() => {
2928
+ if (!b || a === 0)
2929
+ return A.current = n, n;
2930
+ const c = Math.max(a - 64, 0), P = 24, k = Object.values(r);
2931
+ let S;
2463
2932
  if (k.length > 0) {
2464
- const R = k.reduce((Y, U) => Y + U, 0) / k.length, z = Math.max(r, R);
2465
- _ = Math.floor((l + j) / (z + j)), k.reduce((Y, U) => Y + U, 0) + (k.length - 1) * j > l && k.length > s && (_ = Math.min(_, k.length - 1));
2933
+ const N = k.reduce(($, T) => $ + T, 0) / k.length, R = Math.max(t, N);
2934
+ S = Math.floor((c + P) / (R + P)), k.reduce(($, T) => $ + T, 0) + (k.length - 1) * P > c && k.length > o && (S = Math.min(S, k.length - 1));
2466
2935
  } else
2467
- _ = Math.floor((l + j) / (r + j));
2468
- return _ = Math.max(s, Math.min(n, _)), M.current === _ ? M.current : (M.current = _, _);
2469
- }, [N, i, e, r, n, s, o]), y = w(() => {
2470
- b((l) => !l);
2936
+ S = Math.floor((c + P) / (t + P));
2937
+ return S = Math.max(o, Math.min(e, S)), A.current === S ? A.current : (A.current = S, S);
2938
+ }, [b, a, n, t, e, o, r]), E = D(() => {
2939
+ y((c) => !c);
2471
2940
  }, []);
2472
2941
  return {
2473
- responsiveColumnCount: T,
2474
- isResponsiveMode: N,
2475
- screenWidth: i,
2476
- toggleResponsiveMode: y
2942
+ responsiveColumnCount: z,
2943
+ isResponsiveMode: b,
2944
+ screenWidth: a,
2945
+ toggleResponsiveMode: E
2477
2946
  };
2478
2947
  };
2479
- const It = [
2948
+ const Rr = [
2480
2949
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
2481
2950
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
2482
2951
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
2483
- ], Ut = oe("monitor", It);
2484
- const Bt = [
2952
+ ], zr = ie("monitor", Rr);
2953
+ const qr = [
2485
2954
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
2486
2955
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
2487
- ], Vt = oe("smartphone", Bt), ln = ({ isResponsiveMode: r, responsiveColumnCount: e, currentColumnCount: n, screenWidth: s, onToggleResponsive: o }) => /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1", children: [
2488
- /* @__PURE__ */ t.jsxs(
2956
+ ], Wr = ie("smartphone", qr), eo = ({ isResponsiveMode: t, responsiveColumnCount: n, currentColumnCount: e, screenWidth: o, onToggleResponsive: r }) => /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-slate-300 bg-white/90 px-3 py-1", children: [
2957
+ /* @__PURE__ */ s.jsxs(
2489
2958
  "button",
2490
2959
  {
2491
2960
  type: "button",
2492
- onClick: o,
2493
- 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"}`,
2494
- title: r ? "レスポンシブモードを無効化" : "レスポンシブモードを有効化",
2961
+ onClick: r,
2962
+ className: `flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors ${t ? "border border-blue-300 bg-blue-100 text-blue-700" : "border border-slate-300 text-slate-600 hover:bg-blue-50 hover:text-blue-600"}`,
2963
+ title: t ? "レスポンシブモードを無効化" : "レスポンシブモードを有効化",
2495
2964
  children: [
2496
- r ? /* @__PURE__ */ t.jsx(Vt, { className: "h-3 w-3" }) : /* @__PURE__ */ t.jsx(Ut, { className: "h-3 w-3" }),
2497
- /* @__PURE__ */ t.jsx("span", { children: r ? "レスポンシブ" : "固定" })
2965
+ t ? /* @__PURE__ */ s.jsx(Wr, { className: "h-3 w-3" }) : /* @__PURE__ */ s.jsx(zr, { className: "h-3 w-3" }),
2966
+ /* @__PURE__ */ s.jsx("span", { children: t ? "レスポンシブ" : "固定" })
2498
2967
  ]
2499
2968
  }
2500
2969
  ),
2501
- r && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-slate-600 text-xs", children: [
2502
- /* @__PURE__ */ t.jsxs("span", { className: "font-mono", children: [
2503
- s,
2970
+ t && /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-1 text-slate-600 text-xs", children: [
2971
+ /* @__PURE__ */ s.jsxs("span", { className: "font-mono", children: [
2972
+ o,
2504
2973
  "px"
2505
2974
  ] }),
2506
- /* @__PURE__ */ t.jsx("span", { children: "→" }),
2507
- /* @__PURE__ */ t.jsxs("span", { className: "font-semibold text-blue-600", children: [
2508
- e,
2975
+ /* @__PURE__ */ s.jsx("span", { children: "→" }),
2976
+ /* @__PURE__ */ s.jsxs("span", { className: "font-semibold text-blue-600", children: [
2977
+ n,
2509
2978
  "列"
2510
2979
  ] }),
2511
- e !== n && /* @__PURE__ */ t.jsx("span", { className: "text-orange-600", children: "(変更予定)" })
2980
+ n !== e && /* @__PURE__ */ s.jsx("span", { className: "text-orange-600", children: "(変更予定)" })
2512
2981
  ] })
2513
- ] }), cn = {
2982
+ ] }), to = {
2514
2983
  showDebugPanel: !1,
2515
2984
  showMousePosition: !1,
2516
2985
  showPanelSizes: !1,
@@ -2519,37 +2988,49 @@ const Bt = [
2519
2988
  logLevel: 0
2520
2989
  };
2521
2990
  export {
2522
- Qt as ColumnControlPanel,
2523
- Kt as ColumnInsertPanel,
2524
- ie as DEFAULT_COLUMN_ID_CONFIG,
2525
- cn as DEFAULT_DEBUG_CONFIG,
2526
- ke as DEFAULT_EDGE_SCROLL_CONFIG,
2527
- en as DebugControlPanel,
2528
- Jt as DragDropLayout,
2529
- Ge as DropZoneDebugOverlay,
2530
- Ke as EdgeScrollManager,
2531
- Ze as InsertPlaceholder,
2532
- Dt as PanelSizeDisplay,
2533
- Gt as ResizableColumn,
2534
- Je as ResizeHandle,
2535
- ln as ResponsiveControl,
2536
- He as calculateScrollVector,
2537
- rn as createColumnIdMapping,
2538
- E as debugLog,
2539
- je as generateColumnId,
2540
- Qe as generateColumnIds,
2541
- nn as getNextColumnId,
2542
- tn as isValidColumnId,
2543
- Wt as normalizeColumnPanels,
2544
- Pe as parseColumnId,
2545
- zt as performScroll,
2546
- Lt as sortColumnIds,
2547
- sn as useColumnLayout,
2548
- Yt as useCustomDragHandlers,
2549
- on as useDragDropColumns,
2550
- Ft as useDragDropState,
2551
- Xt as useMouseTracking,
2552
- Ht as useNormalDragHandlers,
2553
- qt as usePanelManagement,
2554
- an as useResponsiveColumns
2991
+ Ur as ColumnControlPanel,
2992
+ Br as ColumnInsertPanel,
2993
+ fe as DEFAULT_COLUMN_ID_CONFIG,
2994
+ to as DEFAULT_DEBUG_CONFIG,
2995
+ Hr as DEFAULT_DRAG_DROP_LAYOUT_LABELS,
2996
+ Se as DEFAULT_EDGE_SCROLL_CONFIG,
2997
+ pr as DEFAULT_TOUCH_DRAG_CONFIG,
2998
+ Xr as DebugControlPanel,
2999
+ Fr as DragDropLayout,
3000
+ Xt as DropZoneDebugOverlay,
3001
+ rt as EdgeScrollManager,
3002
+ Bt as InsertPlaceholder,
3003
+ Ee as PANEL_ACTION_ATTRIBUTE,
3004
+ De as PANEL_MOVES,
3005
+ Ut as PANEL_MOVE_SHORTCUTS,
3006
+ Yn as PanelSizeDisplay,
3007
+ Yr as ResizableColumn,
3008
+ en as ResizeHandle,
3009
+ eo as ResponsiveControl,
3010
+ Vt as SCROLL_ROOT_SELECTOR,
3011
+ cr as TEMPLATE_PLACEHOLDERS,
3012
+ Bn as availablePanelMoves,
3013
+ St as calculateScrollVector,
3014
+ Gr as createColumnIdMapping,
3015
+ O as debugLog,
3016
+ We as generateColumnId,
3017
+ tn as generateColumnIds,
3018
+ Zr as getNextColumnId,
3019
+ Yt as insertPanelAt,
3020
+ Vr as isValidColumnId,
3021
+ Xn as movePanelInColumns,
3022
+ Sr as normalizeColumnPanels,
3023
+ Zn as panelMoveOfKey,
3024
+ Ie as parseColumnId,
3025
+ sr as performScroll,
3026
+ Pe as shownPanelPlace,
3027
+ Mr as sortColumnIds,
3028
+ Kr as useColumnLayout,
3029
+ Ar as useCustomDragHandlers,
3030
+ Jr as useDragDropColumns,
3031
+ $r as useDragDropState,
3032
+ Tr as useMouseTracking,
3033
+ Lr as useNormalDragHandlers,
3034
+ _r as usePanelManagement,
3035
+ Qr as useResponsiveColumns
2555
3036
  };