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