react-sync-board 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react-sync-board.js
CHANGED
|
@@ -94,7 +94,7 @@ function Ur() {
|
|
|
94
94
|
var X = b.displayName || b.name || "";
|
|
95
95
|
return X !== "" ? R + "(" + X + ")" : R;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function A(i) {
|
|
98
98
|
return i.displayName || "Context";
|
|
99
99
|
}
|
|
100
100
|
function N(i) {
|
|
@@ -122,10 +122,10 @@ function Ur() {
|
|
|
122
122
|
switch (i.$$typeof) {
|
|
123
123
|
case u:
|
|
124
124
|
var b = i;
|
|
125
|
-
return
|
|
125
|
+
return A(b) + ".Consumer";
|
|
126
126
|
case a:
|
|
127
127
|
var R = i;
|
|
128
|
-
return
|
|
128
|
+
return A(R._context) + ".Provider";
|
|
129
129
|
case l:
|
|
130
130
|
return M(i, i.render, "ForwardRef");
|
|
131
131
|
case c:
|
|
@@ -142,18 +142,18 @@ function Ur() {
|
|
|
142
142
|
}
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
|
-
var U = Object.assign, J = 0, P, $,
|
|
146
|
-
function Z() {
|
|
147
|
-
}
|
|
148
|
-
Z.__reactDisabledLog = !0;
|
|
145
|
+
var U = Object.assign, J = 0, P, $, z, V, Y, F, H;
|
|
149
146
|
function te() {
|
|
147
|
+
}
|
|
148
|
+
te.__reactDisabledLog = !0;
|
|
149
|
+
function Z() {
|
|
150
150
|
{
|
|
151
151
|
if (J === 0) {
|
|
152
|
-
P = console.log, $ = console.info,
|
|
152
|
+
P = console.log, $ = console.info, z = console.warn, V = console.error, Y = console.group, F = console.groupCollapsed, H = console.groupEnd;
|
|
153
153
|
var i = {
|
|
154
154
|
configurable: !0,
|
|
155
155
|
enumerable: !0,
|
|
156
|
-
value:
|
|
156
|
+
value: te,
|
|
157
157
|
writable: !0
|
|
158
158
|
};
|
|
159
159
|
Object.defineProperties(console, {
|
|
@@ -169,7 +169,7 @@ function Ur() {
|
|
|
169
169
|
J++;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ne() {
|
|
173
173
|
{
|
|
174
174
|
if (J--, J === 0) {
|
|
175
175
|
var i = {
|
|
@@ -185,13 +185,13 @@ function Ur() {
|
|
|
185
185
|
value: $
|
|
186
186
|
}),
|
|
187
187
|
warn: U({}, i, {
|
|
188
|
-
value:
|
|
188
|
+
value: z
|
|
189
189
|
}),
|
|
190
190
|
error: U({}, i, {
|
|
191
191
|
value: V
|
|
192
192
|
}),
|
|
193
193
|
group: U({}, i, {
|
|
194
|
-
value:
|
|
194
|
+
value: Y
|
|
195
195
|
}),
|
|
196
196
|
groupCollapsed: U({}, i, {
|
|
197
197
|
value: F
|
|
@@ -204,7 +204,7 @@ function Ur() {
|
|
|
204
204
|
J < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
var
|
|
207
|
+
var ie = y.ReactCurrentDispatcher, me;
|
|
208
208
|
function ge(i, b, R) {
|
|
209
209
|
{
|
|
210
210
|
if (me === void 0)
|
|
@@ -236,7 +236,7 @@ function Ur() {
|
|
|
236
236
|
var X = Error.prepareStackTrace;
|
|
237
237
|
Error.prepareStackTrace = void 0;
|
|
238
238
|
var W;
|
|
239
|
-
W =
|
|
239
|
+
W = ie.current, ie.current = null, Z();
|
|
240
240
|
try {
|
|
241
241
|
if (b) {
|
|
242
242
|
var B = function() {
|
|
@@ -249,39 +249,39 @@ function Ur() {
|
|
|
249
249
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
250
250
|
try {
|
|
251
251
|
Reflect.construct(B, []);
|
|
252
|
-
} catch (
|
|
253
|
-
D =
|
|
252
|
+
} catch (ae) {
|
|
253
|
+
D = ae;
|
|
254
254
|
}
|
|
255
255
|
Reflect.construct(i, [], B);
|
|
256
256
|
} else {
|
|
257
257
|
try {
|
|
258
258
|
B.call();
|
|
259
|
-
} catch (
|
|
260
|
-
D =
|
|
259
|
+
} catch (ae) {
|
|
260
|
+
D = ae;
|
|
261
261
|
}
|
|
262
262
|
i.call(B.prototype);
|
|
263
263
|
}
|
|
264
264
|
} else {
|
|
265
265
|
try {
|
|
266
266
|
throw Error();
|
|
267
|
-
} catch (
|
|
268
|
-
D =
|
|
267
|
+
} catch (ae) {
|
|
268
|
+
D = ae;
|
|
269
269
|
}
|
|
270
270
|
i();
|
|
271
271
|
}
|
|
272
|
-
} catch (
|
|
273
|
-
if (
|
|
274
|
-
for (var
|
|
272
|
+
} catch (ae) {
|
|
273
|
+
if (ae && D && typeof ae.stack == "string") {
|
|
274
|
+
for (var L = ae.stack.split(`
|
|
275
275
|
`), ee = D.stack.split(`
|
|
276
|
-
`), q =
|
|
276
|
+
`), q = L.length - 1, G = ee.length - 1; q >= 1 && G >= 0 && L[q] !== ee[G]; )
|
|
277
277
|
G--;
|
|
278
278
|
for (; q >= 1 && G >= 0; q--, G--)
|
|
279
|
-
if (
|
|
279
|
+
if (L[q] !== ee[G]) {
|
|
280
280
|
if (q !== 1 || G !== 1)
|
|
281
281
|
do
|
|
282
|
-
if (q--, G--, G < 0 ||
|
|
282
|
+
if (q--, G--, G < 0 || L[q] !== ee[G]) {
|
|
283
283
|
var re = `
|
|
284
|
-
` +
|
|
284
|
+
` + L[q].replace(" at new ", " at ");
|
|
285
285
|
return i.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", i.displayName)), typeof i == "function" && je.set(i, re), re;
|
|
286
286
|
}
|
|
287
287
|
while (q >= 1 && G >= 0);
|
|
@@ -289,7 +289,7 @@ function Ur() {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
} finally {
|
|
292
|
-
Ke = !1,
|
|
292
|
+
Ke = !1, ie.current = W, ne(), Error.prepareStackTrace = X;
|
|
293
293
|
}
|
|
294
294
|
var ve = i ? i.displayName || i.name : "", Tt = ve ? ge(ve) : "";
|
|
295
295
|
return typeof i == "function" && je.set(i, Tt), Tt;
|
|
@@ -343,17 +343,17 @@ function Ur() {
|
|
|
343
343
|
var W = Function.call.bind($e);
|
|
344
344
|
for (var B in i)
|
|
345
345
|
if (W(i, B)) {
|
|
346
|
-
var
|
|
346
|
+
var L = void 0;
|
|
347
347
|
try {
|
|
348
348
|
if (typeof i[B] != "function") {
|
|
349
349
|
var ee = Error((D || "React class") + ": " + R + " type `" + B + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[B] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
350
350
|
throw ee.name = "Invariant Violation", ee;
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
L = i[B](b, B, D, R, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
353
353
|
} catch (q) {
|
|
354
|
-
|
|
354
|
+
L = q;
|
|
355
355
|
}
|
|
356
|
-
|
|
356
|
+
L && !(L instanceof Error) && (Ae(X), C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", D || "React class", R, B, typeof L), Ae(null)), L instanceof Error && !(L.message in vt) && (vt[L.message] = !0, Ae(X), C("Failed %s type: %s", R, L.message), Ae(null));
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
}
|
|
@@ -433,7 +433,7 @@ function Ur() {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
var Ir = function(i, b, R, D, X, W, B) {
|
|
436
|
-
var
|
|
436
|
+
var L = {
|
|
437
437
|
// This tag allows us to uniquely identify this as a React Element
|
|
438
438
|
$$typeof: t,
|
|
439
439
|
// Built-in properties that belong on the element
|
|
@@ -444,27 +444,27 @@ function Ur() {
|
|
|
444
444
|
// Record the component responsible for creating this element.
|
|
445
445
|
_owner: W
|
|
446
446
|
};
|
|
447
|
-
return
|
|
447
|
+
return L._store = {}, Object.defineProperty(L._store, "validated", {
|
|
448
448
|
configurable: !1,
|
|
449
449
|
enumerable: !1,
|
|
450
450
|
writable: !0,
|
|
451
451
|
value: !1
|
|
452
|
-
}), Object.defineProperty(
|
|
452
|
+
}), Object.defineProperty(L, "_self", {
|
|
453
453
|
configurable: !1,
|
|
454
454
|
enumerable: !1,
|
|
455
455
|
writable: !1,
|
|
456
456
|
value: D
|
|
457
|
-
}), Object.defineProperty(
|
|
457
|
+
}), Object.defineProperty(L, "_source", {
|
|
458
458
|
configurable: !1,
|
|
459
459
|
enumerable: !1,
|
|
460
460
|
writable: !1,
|
|
461
461
|
value: X
|
|
462
|
-
}), Object.freeze && (Object.freeze(
|
|
462
|
+
}), Object.freeze && (Object.freeze(L.props), Object.freeze(L)), L;
|
|
463
463
|
};
|
|
464
464
|
function Or(i, b, R, D, X) {
|
|
465
465
|
{
|
|
466
|
-
var W, B = {},
|
|
467
|
-
R !== void 0 && (_t(R),
|
|
466
|
+
var W, B = {}, L = null, ee = null;
|
|
467
|
+
R !== void 0 && (_t(R), L = "" + R), wr(b) && (_t(b.key), L = "" + b.key), Er(b) && (ee = b.ref, Cr(b, X));
|
|
468
468
|
for (W in b)
|
|
469
469
|
$e.call(b, W) && !br.hasOwnProperty(W) && (B[W] = b[W]);
|
|
470
470
|
if (i && i.defaultProps) {
|
|
@@ -472,11 +472,11 @@ function Ur() {
|
|
|
472
472
|
for (W in q)
|
|
473
473
|
B[W] === void 0 && (B[W] = q[W]);
|
|
474
474
|
}
|
|
475
|
-
if (
|
|
475
|
+
if (L || ee) {
|
|
476
476
|
var G = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
|
477
|
-
|
|
477
|
+
L && xr(B, G), ee && Rr(B, G);
|
|
478
478
|
}
|
|
479
|
-
return Ir(i,
|
|
479
|
+
return Ir(i, L, ee, X, D, be.current, B);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
var Ge = y.ReactCurrentOwner, wt = y.ReactDebugCurrentFrame;
|
|
@@ -601,12 +601,12 @@ Check the top-level render call using <` + R + ">.");
|
|
|
601
601
|
{
|
|
602
602
|
var B = j(i);
|
|
603
603
|
if (!B) {
|
|
604
|
-
var
|
|
605
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (
|
|
604
|
+
var L = "";
|
|
605
|
+
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (L += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
606
606
|
var ee = Tr(X);
|
|
607
|
-
ee ?
|
|
607
|
+
ee ? L += ee : L += Ct();
|
|
608
608
|
var q;
|
|
609
|
-
i === null ? q = "null" : He(i) ? q = "array" : i !== void 0 && i.$$typeof === t ? (q = "<" + (N(i.type) || "Unknown") + " />",
|
|
609
|
+
i === null ? q = "null" : He(i) ? q = "array" : i !== void 0 && i.$$typeof === t ? (q = "<" + (N(i.type) || "Unknown") + " />", L = " Did you accidentally export a JSX literal instead of a component?") : q = typeof i, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, L);
|
|
610
610
|
}
|
|
611
611
|
var G = Or(i, b, R, X, W);
|
|
612
612
|
if (G == null)
|
|
@@ -640,7 +640,7 @@ Check the top-level render call using <` + R + ">.");
|
|
|
640
640
|
(function(e) {
|
|
641
641
|
process.env.NODE_ENV === "production" ? e.exports = Xr() : e.exports = Ur();
|
|
642
642
|
})(Nr);
|
|
643
|
-
const Wr = Ie.Fragment, T = Ie.jsx,
|
|
643
|
+
const Wr = Ie.Fragment, T = Ie.jsx, le = Ie.jsxs;
|
|
644
644
|
let Vr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, r) => (r &= 63, r < 36 ? t += r.toString(36) : r < 62 ? t += (r - 26).toString(36).toUpperCase() : r > 62 ? t += "-" : t += "_", t), "");
|
|
645
645
|
class Fr {
|
|
646
646
|
constructor(t, r, n = null) {
|
|
@@ -1055,10 +1055,10 @@ function en() {
|
|
|
1055
1055
|
value: null
|
|
1056
1056
|
}, E.current = I) : I = E.current;
|
|
1057
1057
|
var y = u(function() {
|
|
1058
|
-
var w = !1, m, S, O = function(
|
|
1058
|
+
var w = !1, m, S, O = function(A) {
|
|
1059
1059
|
if (!w) {
|
|
1060
|
-
w = !0, m =
|
|
1061
|
-
var N = _(
|
|
1060
|
+
w = !0, m = A;
|
|
1061
|
+
var N = _(A);
|
|
1062
1062
|
if (v !== void 0 && I.hasValue) {
|
|
1063
1063
|
var U = I.value;
|
|
1064
1064
|
if (v(U, N))
|
|
@@ -1067,10 +1067,10 @@ function en() {
|
|
|
1067
1067
|
return S = N, N;
|
|
1068
1068
|
}
|
|
1069
1069
|
var J = m, P = S;
|
|
1070
|
-
if (n(J,
|
|
1070
|
+
if (n(J, A))
|
|
1071
1071
|
return P;
|
|
1072
|
-
var $ = _(
|
|
1073
|
-
return v !== void 0 && v(P, $) ? P : (m =
|
|
1072
|
+
var $ = _(A);
|
|
1073
|
+
return v !== void 0 && v(P, $) ? P : (m = A, S = $, $);
|
|
1074
1074
|
}, k = h === void 0 ? null : h, j = function() {
|
|
1075
1075
|
return O(c());
|
|
1076
1076
|
}, M = k === null ? void 0 : function() {
|
|
@@ -1124,8 +1124,16 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1124
1124
|
const r = t.getBoundingClientRect();
|
|
1125
1125
|
return nn(e, r);
|
|
1126
1126
|
}, Ne = (e, t) => {
|
|
1127
|
-
|
|
1128
|
-
|
|
1127
|
+
try {
|
|
1128
|
+
const n = e.getElementsByClassName(`item ${t}`)[0];
|
|
1129
|
+
return n || console.error(`Missing item ${t}`), n;
|
|
1130
|
+
} catch {
|
|
1131
|
+
console.error(
|
|
1132
|
+
`Error while getting item with id ${t} with wrapper`,
|
|
1133
|
+
e
|
|
1134
|
+
);
|
|
1135
|
+
return;
|
|
1136
|
+
}
|
|
1129
1137
|
}, Te = (e) => {
|
|
1130
1138
|
var r, n;
|
|
1131
1139
|
const t = (r = e == null ? void 0 : e.dataset) == null ? void 0 : r.id;
|
|
@@ -1379,11 +1387,11 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1379
1387
|
l.ready && (u(), s(!0));
|
|
1380
1388
|
});
|
|
1381
1389
|
}, [a]), o ? /* @__PURE__ */ T(ar.Provider, { value: a, children: t }) : null;
|
|
1382
|
-
},
|
|
1390
|
+
}, oe = (e, t) => {
|
|
1383
1391
|
const r = _e(ar);
|
|
1384
1392
|
return We(r, e, t || Ve);
|
|
1385
1393
|
}, ns = () => {
|
|
1386
|
-
const [e, t] =
|
|
1394
|
+
const [e, t] = oe((n) => [
|
|
1387
1395
|
n.itemIds,
|
|
1388
1396
|
n.items
|
|
1389
1397
|
]);
|
|
@@ -1392,7 +1400,7 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1392
1400
|
[e, t]
|
|
1393
1401
|
);
|
|
1394
1402
|
}, os = () => {
|
|
1395
|
-
const [e, t, r] =
|
|
1403
|
+
const [e, t, r] = oe((a) => [
|
|
1396
1404
|
a.items,
|
|
1397
1405
|
a.itemIds,
|
|
1398
1406
|
a.getItemList
|
|
@@ -1448,7 +1456,7 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1448
1456
|
}),
|
|
1449
1457
|
callInteractions: (r, n) => {
|
|
1450
1458
|
t().interactions[r] && t().interactions[r].forEach((o) => {
|
|
1451
|
-
o(n);
|
|
1459
|
+
setTimeout(() => o(n), 0);
|
|
1452
1460
|
});
|
|
1453
1461
|
}
|
|
1454
1462
|
}), vn = (e, t) => ({
|
|
@@ -1595,7 +1603,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1595
1603
|
p.config.itemExtent,
|
|
1596
1604
|
p.getConfiguration,
|
|
1597
1605
|
p.updateConfiguration
|
|
1598
|
-
]), s = g.useRef([0.15, 5]), [a] =
|
|
1606
|
+
]), s = g.useRef([0.15, 5]), [a] = oe((p) => [p.getItemList]), u = g.useCallback(() => {
|
|
1599
1607
|
const { translateX: p, translateY: w, scale: m, rotate: S } = e();
|
|
1600
1608
|
return { translateX: p, translateY: w, scale: m, rotate: S };
|
|
1601
1609
|
}, [e]), l = g.useCallback(
|
|
@@ -1621,7 +1629,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1621
1629
|
translateX: k,
|
|
1622
1630
|
translateY: j,
|
|
1623
1631
|
scale: M,
|
|
1624
|
-
rotate:
|
|
1632
|
+
rotate: A
|
|
1625
1633
|
} = {
|
|
1626
1634
|
...O,
|
|
1627
1635
|
...p(O)
|
|
@@ -1631,7 +1639,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1631
1639
|
x: k,
|
|
1632
1640
|
y: j,
|
|
1633
1641
|
scale: N,
|
|
1634
|
-
rotate:
|
|
1642
|
+
rotate: A,
|
|
1635
1643
|
itemExtent: w,
|
|
1636
1644
|
boardWrapperRect: m,
|
|
1637
1645
|
boardSize: S
|
|
@@ -1639,7 +1647,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1639
1647
|
translateX: U,
|
|
1640
1648
|
translateY: J,
|
|
1641
1649
|
scale: N,
|
|
1642
|
-
rotate:
|
|
1650
|
+
rotate: A
|
|
1643
1651
|
});
|
|
1644
1652
|
},
|
|
1645
1653
|
[c, e, n, t]
|
|
@@ -1663,10 +1671,10 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1663
1671
|
x: m.left + m.width / 2,
|
|
1664
1672
|
y: m.top + m.height / 2
|
|
1665
1673
|
});
|
|
1666
|
-
const O = e(), k = c(O.scale * w), j = S.x - m.left, M = S.y - m.top,
|
|
1674
|
+
const O = e(), k = c(O.scale * w), j = S.x - m.left, M = S.y - m.top, A = j - (j - O.translateX) * k / O.scale, N = M - (M - O.translateY) * k / O.scale;
|
|
1667
1675
|
h((U) => ({
|
|
1668
1676
|
...U,
|
|
1669
|
-
translateX:
|
|
1677
|
+
translateX: A,
|
|
1670
1678
|
translateY: N,
|
|
1671
1679
|
scale: k
|
|
1672
1680
|
}));
|
|
@@ -1674,16 +1682,16 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1674
1682
|
[c, e, n, h]
|
|
1675
1683
|
), E = g.useCallback(
|
|
1676
1684
|
({ x: p, y: w, radius: m }) => {
|
|
1677
|
-
const { rotate: S } = e(), { boardWrapperRect: O, boardSize: k } = n(), j = O.width / (m * 2), M = O.height / (m * 2),
|
|
1685
|
+
const { rotate: S } = e(), { boardWrapperRect: O, boardSize: k } = n(), j = O.width / (m * 2), M = O.height / (m * 2), A = c(Math.min(j, M) * bn), [N, U] = Be(
|
|
1678
1686
|
[-k / 2 - p, -k / 2 - w],
|
|
1679
1687
|
{
|
|
1680
1688
|
translateX: O.width / 2,
|
|
1681
1689
|
translateY: O.height / 2,
|
|
1682
|
-
scale:
|
|
1690
|
+
scale: A,
|
|
1683
1691
|
rotate: S
|
|
1684
1692
|
}
|
|
1685
1693
|
);
|
|
1686
|
-
h((J) => ({ ...J, translateX: N, translateY: U, scale:
|
|
1694
|
+
h((J) => ({ ...J, translateX: N, translateY: U, scale: A }));
|
|
1687
1695
|
},
|
|
1688
1696
|
[c, e, n, h]
|
|
1689
1697
|
), I = g.useCallback(() => {
|
|
@@ -1699,13 +1707,13 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1699
1707
|
const p = a(), { boardWrapper: w, boardSize: m } = n(), S = p.reduce(
|
|
1700
1708
|
(k, j) => {
|
|
1701
1709
|
const M = Ne(w, j.id);
|
|
1702
|
-
return k.left = Math.min(j.x, k.left), k.top = Math.min(j.y, k.top), k.right = Math.max(
|
|
1710
|
+
return M && (k.left = Math.min(j.x, k.left), k.top = Math.min(j.y, k.top), k.right = Math.max(
|
|
1703
1711
|
j.x + M.offsetWidth,
|
|
1704
1712
|
k.right
|
|
1705
1713
|
), k.bottom = Math.max(
|
|
1706
1714
|
j.y + M.offsetHeight,
|
|
1707
1715
|
k.bottom
|
|
1708
|
-
), k;
|
|
1716
|
+
)), k;
|
|
1709
1717
|
},
|
|
1710
1718
|
{
|
|
1711
1719
|
left: m / 2,
|
|
@@ -1781,39 +1789,40 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1781
1789
|
getItemList: v,
|
|
1782
1790
|
insertItems: E,
|
|
1783
1791
|
setItemList: I
|
|
1784
|
-
} =
|
|
1792
|
+
} = oe(
|
|
1785
1793
|
({
|
|
1786
1794
|
getItems: P,
|
|
1787
1795
|
getItemIds: $,
|
|
1788
|
-
setItemIds:
|
|
1796
|
+
setItemIds: z,
|
|
1789
1797
|
updateItems: V,
|
|
1790
|
-
moveItems:
|
|
1798
|
+
moveItems: Y,
|
|
1791
1799
|
removeItemsById: F,
|
|
1792
1800
|
getItemList: H,
|
|
1793
|
-
insertItems:
|
|
1794
|
-
setItemList:
|
|
1801
|
+
insertItems: te,
|
|
1802
|
+
setItemList: Z
|
|
1795
1803
|
}) => ({
|
|
1796
1804
|
getItems: P,
|
|
1797
1805
|
getItemIds: $,
|
|
1798
|
-
setItemIds:
|
|
1806
|
+
setItemIds: z,
|
|
1799
1807
|
updateItems: V,
|
|
1800
|
-
moveItems:
|
|
1808
|
+
moveItems: Y,
|
|
1801
1809
|
removeItemsById: F,
|
|
1802
1810
|
getItemList: H,
|
|
1803
|
-
insertItems:
|
|
1804
|
-
setItemList:
|
|
1811
|
+
insertItems: te,
|
|
1812
|
+
setItemList: Z
|
|
1805
1813
|
})
|
|
1806
1814
|
), y = g.useCallback(
|
|
1807
|
-
(P, $,
|
|
1815
|
+
(P, $, z = !1) => {
|
|
1808
1816
|
let V = $;
|
|
1809
1817
|
typeof $ == "object" && (V = () => $);
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1818
|
+
const Y = d().filter((Z) => P.includes(Z)), F = l(), H = Y.map((Z) => {
|
|
1819
|
+
const ne = F[Z];
|
|
1820
|
+
return z ? [Z, V(ne)] : [Z, V({ ...ne })];
|
|
1821
|
+
}).filter(([, Z]) => Z);
|
|
1822
|
+
if (H.length === 0)
|
|
1823
|
+
return;
|
|
1824
|
+
const te = Object.fromEntries(H);
|
|
1825
|
+
c(te, z), n();
|
|
1817
1826
|
},
|
|
1818
1827
|
[d, l, n, c]
|
|
1819
1828
|
), C = g.useCallback(
|
|
@@ -1822,8 +1831,8 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1822
1831
|
},
|
|
1823
1832
|
[o, I, n]
|
|
1824
1833
|
), x = g.useCallback(
|
|
1825
|
-
(P, $,
|
|
1826
|
-
y([P], $,
|
|
1834
|
+
(P, $, z = !1) => {
|
|
1835
|
+
y([P], $, z);
|
|
1827
1836
|
},
|
|
1828
1837
|
[y]
|
|
1829
1838
|
), p = g.useCallback(
|
|
@@ -1836,31 +1845,31 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1836
1845
|
[d, l, h, n]
|
|
1837
1846
|
), w = g.useCallback(
|
|
1838
1847
|
(P) => {
|
|
1839
|
-
const $ = d(),
|
|
1840
|
-
(
|
|
1848
|
+
const $ = d(), z = $.filter((Y) => !P.includes(Y)), V = $.filter(
|
|
1849
|
+
(Y) => P.includes(Y)
|
|
1841
1850
|
);
|
|
1842
|
-
f([...
|
|
1851
|
+
f([...z, ...V]);
|
|
1843
1852
|
},
|
|
1844
1853
|
[d, f]
|
|
1845
1854
|
), m = g.useCallback(
|
|
1846
|
-
(P, { type: $, size:
|
|
1855
|
+
(P, { type: $, size: z } = {}) => {
|
|
1847
1856
|
const { boardWrapper: V } = u();
|
|
1848
1857
|
y(
|
|
1849
1858
|
P,
|
|
1850
|
-
(
|
|
1851
|
-
const F = Ne(V,
|
|
1859
|
+
(Y) => {
|
|
1860
|
+
const F = Ne(V, Y.id);
|
|
1852
1861
|
if (!F)
|
|
1853
1862
|
return;
|
|
1854
1863
|
const H = {
|
|
1855
1864
|
type: $ || "grid",
|
|
1856
|
-
size:
|
|
1865
|
+
size: z || 1,
|
|
1857
1866
|
offset: { x: 0, y: 0 },
|
|
1858
|
-
...
|
|
1867
|
+
...Y.grid
|
|
1859
1868
|
};
|
|
1860
1869
|
return an(
|
|
1861
1870
|
{
|
|
1862
|
-
x:
|
|
1863
|
-
y:
|
|
1871
|
+
x: Y.x,
|
|
1872
|
+
y: Y.y,
|
|
1864
1873
|
width: F.clientWidth,
|
|
1865
1874
|
height: F.clientHeight
|
|
1866
1875
|
},
|
|
@@ -1873,15 +1882,12 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1873
1882
|
[u, y]
|
|
1874
1883
|
), S = g.useCallback(
|
|
1875
1884
|
(P, $) => {
|
|
1876
|
-
const
|
|
1885
|
+
const z = Bt(
|
|
1877
1886
|
l(),
|
|
1878
1887
|
d(),
|
|
1879
1888
|
P
|
|
1880
1889
|
);
|
|
1881
|
-
w(
|
|
1882
|
-
const A = { ...V };
|
|
1883
|
-
return delete A.moving, A;
|
|
1884
|
-
}), m(Y, $), e(P), n();
|
|
1890
|
+
w(z), y(z, { moving: !1 }, !0), m(z, $), e(P), n();
|
|
1885
1891
|
},
|
|
1886
1892
|
[
|
|
1887
1893
|
y,
|
|
@@ -1899,40 +1905,44 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1899
1905
|
[f]
|
|
1900
1906
|
), k = g.useCallback(
|
|
1901
1907
|
(P) => {
|
|
1902
|
-
const $ = d(),
|
|
1903
|
-
(
|
|
1904
|
-
), V = $.map((
|
|
1908
|
+
const $ = d(), z = $.filter(
|
|
1909
|
+
(Y) => P.includes(Y)
|
|
1910
|
+
), V = $.map((Y) => P.includes(Y) ? z.pop() : Y);
|
|
1905
1911
|
f(V), s();
|
|
1906
1912
|
},
|
|
1907
1913
|
[d, s, f]
|
|
1908
1914
|
), j = g.useCallback(
|
|
1909
1915
|
(P, $) => {
|
|
1910
|
-
const
|
|
1911
|
-
$.map((H,
|
|
1912
|
-
const
|
|
1916
|
+
const z = l(), V = Object.fromEntries(
|
|
1917
|
+
$.map((H, te) => {
|
|
1918
|
+
const Z = z[P[te]];
|
|
1913
1919
|
return [
|
|
1914
1920
|
H,
|
|
1915
1921
|
{
|
|
1916
|
-
x:
|
|
1917
|
-
y:
|
|
1922
|
+
x: Z.x,
|
|
1923
|
+
y: Z.y
|
|
1918
1924
|
}
|
|
1919
1925
|
];
|
|
1920
1926
|
})
|
|
1921
1927
|
);
|
|
1922
|
-
y(
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1928
|
+
y(
|
|
1929
|
+
P,
|
|
1930
|
+
(H) => V[H.id],
|
|
1931
|
+
!0
|
|
1932
|
+
);
|
|
1933
|
+
const Y = Object.fromEntries(
|
|
1934
|
+
P.map((H, te) => [H, $[te]])
|
|
1935
|
+
), F = d().map((H) => P.includes(H) ? Y[H] : H);
|
|
1926
1936
|
f(F);
|
|
1927
1937
|
},
|
|
1928
1938
|
[l, y, d, f]
|
|
1929
1939
|
), M = g.useCallback(
|
|
1930
1940
|
(P, $) => {
|
|
1931
|
-
const
|
|
1941
|
+
const z = r(), V = P.map((Y, F) => !Y.x || !Y.y ? { ...Y, x: z.x + 2 * F, y: z.y + 2 * F } : Y);
|
|
1932
1942
|
E(V, $), n();
|
|
1933
1943
|
},
|
|
1934
1944
|
[r, E, n]
|
|
1935
|
-
),
|
|
1945
|
+
), A = g.useCallback(
|
|
1936
1946
|
(P, $) => {
|
|
1937
1947
|
M([P], $);
|
|
1938
1948
|
},
|
|
@@ -1945,28 +1955,28 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1945
1955
|
), U = g.useCallback(
|
|
1946
1956
|
(P) => {
|
|
1947
1957
|
const $ = l();
|
|
1948
|
-
return P.map((
|
|
1958
|
+
return P.map((z) => $[z]);
|
|
1949
1959
|
},
|
|
1950
1960
|
[l]
|
|
1951
1961
|
), J = g.useCallback(
|
|
1952
|
-
({ target: P, clientX: $, clientY:
|
|
1962
|
+
({ target: P, clientX: $, clientY: z }, { returnLocked: V = !1, passLocked: Y = !1 } = {}) => {
|
|
1953
1963
|
if (["INPUT", "TEXTAREA"].includes(P.tagName))
|
|
1954
1964
|
return null;
|
|
1955
1965
|
const F = Oe(P, "item");
|
|
1956
1966
|
if (F) {
|
|
1957
1967
|
if (ye(F, "selected"))
|
|
1958
1968
|
return F;
|
|
1959
|
-
if (!
|
|
1969
|
+
if (!Y && ye(F, "locked") && !ye(P, "passthrough"))
|
|
1960
1970
|
return V ? F : null;
|
|
1961
1971
|
if (ye(P, "passthrough")) {
|
|
1962
|
-
const H = d(), { boardWrapper:
|
|
1963
|
-
const me = Ne(
|
|
1964
|
-
return ft({ x: $, y:
|
|
1972
|
+
const H = d(), { boardWrapper: te } = u(), Z = H.reduce((ne, ie) => {
|
|
1973
|
+
const me = Ne(te, ie), ge = me.getBoundingClientRect();
|
|
1974
|
+
return ft({ x: $, y: z }, ge) && ne.unshift(me), ne;
|
|
1965
1975
|
}, []);
|
|
1966
|
-
for (let
|
|
1967
|
-
const
|
|
1968
|
-
if (
|
|
1969
|
-
return
|
|
1976
|
+
for (let ne = 0; ne < Z.length; ne += 1) {
|
|
1977
|
+
const ie = Z[ne];
|
|
1978
|
+
if (ie !== F && (Y || !ye(ie, "locked")))
|
|
1979
|
+
return ie;
|
|
1970
1980
|
}
|
|
1971
1981
|
return null;
|
|
1972
1982
|
}
|
|
@@ -1985,7 +1995,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1985
1995
|
swapItems: j,
|
|
1986
1996
|
reverseItemsOrder: k,
|
|
1987
1997
|
setItemList: C,
|
|
1988
|
-
pushItem:
|
|
1998
|
+
pushItem: A,
|
|
1989
1999
|
pushItems: M,
|
|
1990
2000
|
removeItems: N,
|
|
1991
2001
|
getItemList: v,
|
|
@@ -2068,7 +2078,7 @@ const xn = (e, t) => {
|
|
|
2068
2078
|
const { actions: r = xn(e, t) } = e;
|
|
2069
2079
|
return r.map((n) => typeof n == "string" ? { name: n } : n);
|
|
2070
2080
|
}, is = () => {
|
|
2071
|
-
const [e, t] =
|
|
2081
|
+
const [e, t] = oe((c) => [
|
|
2072
2082
|
c.items,
|
|
2073
2083
|
c.getItems
|
|
2074
2084
|
]), [r, n, o] = Q((c) => [
|
|
@@ -2262,7 +2272,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2262
2272
|
joinSpace: o
|
|
2263
2273
|
};
|
|
2264
2274
|
}, us = () => {
|
|
2265
|
-
const [e, t, r] =
|
|
2275
|
+
const [e, t, r] = oe(
|
|
2266
2276
|
(o) => [o.boardConfig, o.getBoardConfig, o.setBoardConfig]
|
|
2267
2277
|
), n = g.useCallback(
|
|
2268
2278
|
(o) => {
|
|
@@ -2278,7 +2288,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2278
2288
|
const [e] = Q((t) => [t.boardState]);
|
|
2279
2289
|
return e;
|
|
2280
2290
|
}, fs = () => {
|
|
2281
|
-
const [e, t, r, n] =
|
|
2291
|
+
const [e, t, r, n] = oe((o) => [
|
|
2282
2292
|
o.getSessionInfo,
|
|
2283
2293
|
o.setSessionInfo,
|
|
2284
2294
|
o.updateSessionInfo,
|
|
@@ -2455,7 +2465,7 @@ class zn {
|
|
|
2455
2465
|
});
|
|
2456
2466
|
}
|
|
2457
2467
|
}
|
|
2458
|
-
const
|
|
2468
|
+
const se = new zn(), Fe = ({
|
|
2459
2469
|
children: e,
|
|
2460
2470
|
onDrag: t = de,
|
|
2461
2471
|
onDragStart: r = de,
|
|
@@ -2485,7 +2495,7 @@ const oe = new zn(), Fe = ({
|
|
|
2485
2495
|
} = y;
|
|
2486
2496
|
if (!(O || S && !nt()))
|
|
2487
2497
|
if (nt() && !S)
|
|
2488
|
-
|
|
2498
|
+
se.add(o, {
|
|
2489
2499
|
deltaX: -2 * C,
|
|
2490
2500
|
deltaY: -2 * x,
|
|
2491
2501
|
button: 1,
|
|
@@ -2506,7 +2516,7 @@ const oe = new zn(), Fe = ({
|
|
|
2506
2516
|
M *= $n;
|
|
2507
2517
|
break;
|
|
2508
2518
|
}
|
|
2509
|
-
nt() && (M *= 2),
|
|
2519
|
+
nt() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: w, event: y });
|
|
2510
2520
|
}
|
|
2511
2521
|
}, _ = (y) => {
|
|
2512
2522
|
const {
|
|
@@ -2523,11 +2533,11 @@ const oe = new zn(), Fe = ({
|
|
|
2523
2533
|
if (c.current.pointers[m] = { clientX: p, clientY: w }, j && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
|
|
2524
2534
|
if (c.current.mainPointer !== m)
|
|
2525
2535
|
try {
|
|
2526
|
-
const { clientX: M, clientY:
|
|
2536
|
+
const { clientX: M, clientY: A } = qt(
|
|
2527
2537
|
c.current.pointers,
|
|
2528
2538
|
m
|
|
2529
|
-
), N = (M + p) / 2, U = (
|
|
2530
|
-
[M,
|
|
2539
|
+
), N = (M + p) / 2, U = (A + w) / 2, J = Gt(
|
|
2540
|
+
[M, A],
|
|
2531
2541
|
[p, w]
|
|
2532
2542
|
);
|
|
2533
2543
|
Object.assign(c.current, {
|
|
@@ -2561,7 +2571,7 @@ const oe = new zn(), Fe = ({
|
|
|
2561
2571
|
target: C,
|
|
2562
2572
|
timeStart: Date.now(),
|
|
2563
2573
|
longTapTimeout: setTimeout(async () => {
|
|
2564
|
-
c.current.noTap = !0,
|
|
2574
|
+
c.current.noTap = !0, se.add(a, {
|
|
2565
2575
|
clientX: p,
|
|
2566
2576
|
clientY: w,
|
|
2567
2577
|
altKey: S,
|
|
@@ -2594,23 +2604,23 @@ const oe = new zn(), Fe = ({
|
|
|
2594
2604
|
clientY: p
|
|
2595
2605
|
}, c.current.moving = !0;
|
|
2596
2606
|
const j = Object.keys(c.current.pointers).length === 2;
|
|
2597
|
-
let M,
|
|
2607
|
+
let M, A, N = 0;
|
|
2598
2608
|
if (j) {
|
|
2599
|
-
const { clientX: $, clientY:
|
|
2609
|
+
const { clientX: $, clientY: z } = qt(
|
|
2600
2610
|
c.current.pointers,
|
|
2601
2611
|
C
|
|
2602
2612
|
);
|
|
2603
|
-
M = ($ + x) / 2,
|
|
2604
|
-
[$,
|
|
2613
|
+
M = ($ + x) / 2, A = (z + p) / 2, N = Gt(
|
|
2614
|
+
[$, z],
|
|
2605
2615
|
[x, p]
|
|
2606
2616
|
);
|
|
2607
2617
|
} else
|
|
2608
|
-
M = x,
|
|
2618
|
+
M = x, A = p;
|
|
2609
2619
|
let U = m || w || S || O || k !== 1;
|
|
2610
2620
|
d !== "drag" && (U = !U);
|
|
2611
2621
|
const J = !U, P = U;
|
|
2612
2622
|
if (J) {
|
|
2613
|
-
c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout),
|
|
2623
|
+
c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout), se.add(r, {
|
|
2614
2624
|
deltaX: 0,
|
|
2615
2625
|
deltaY: 0,
|
|
2616
2626
|
startX: c.current.startX,
|
|
@@ -2627,16 +2637,16 @@ const oe = new zn(), Fe = ({
|
|
|
2627
2637
|
target: c.current.target,
|
|
2628
2638
|
event: c.current.pointerDownEvent
|
|
2629
2639
|
}));
|
|
2630
|
-
const $ = M - c.current.prevX,
|
|
2631
|
-
|
|
2640
|
+
const $ = M - c.current.prevX, z = A - c.current.prevY, V = M - c.current.startX, Y = A - c.current.startY;
|
|
2641
|
+
se.add(t, {
|
|
2632
2642
|
deltaX: $,
|
|
2633
|
-
deltaY:
|
|
2643
|
+
deltaY: z,
|
|
2634
2644
|
startX: c.current.startX,
|
|
2635
2645
|
startY: c.current.startY,
|
|
2636
2646
|
clientX: M,
|
|
2637
|
-
clientY:
|
|
2647
|
+
clientY: A,
|
|
2638
2648
|
distanceX: V,
|
|
2639
|
-
distanceY:
|
|
2649
|
+
distanceY: Y,
|
|
2640
2650
|
button: c.current.currentButton,
|
|
2641
2651
|
altKey: w,
|
|
2642
2652
|
shiftKey: m,
|
|
@@ -2648,10 +2658,10 @@ const oe = new zn(), Fe = ({
|
|
|
2648
2658
|
}
|
|
2649
2659
|
if (P) {
|
|
2650
2660
|
c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout));
|
|
2651
|
-
const $ = M - c.current.prevX,
|
|
2652
|
-
if (
|
|
2661
|
+
const $ = M - c.current.prevX, z = A - c.current.prevY, { target: V } = c.current;
|
|
2662
|
+
if (se.add(o, {
|
|
2653
2663
|
deltaX: $,
|
|
2654
|
-
deltaY:
|
|
2664
|
+
deltaY: z,
|
|
2655
2665
|
button: c.current.currentButton,
|
|
2656
2666
|
altKey: w,
|
|
2657
2667
|
shiftKey: m,
|
|
@@ -2660,16 +2670,16 @@ const oe = new zn(), Fe = ({
|
|
|
2660
2670
|
target: V,
|
|
2661
2671
|
event: y
|
|
2662
2672
|
}), N !== c.current.prevDistance && l) {
|
|
2663
|
-
const
|
|
2664
|
-
Math.abs(
|
|
2665
|
-
scale:
|
|
2673
|
+
const Y = c.current.prevDistance - N;
|
|
2674
|
+
Math.abs(Y) > 0 && (se.add(l, {
|
|
2675
|
+
scale: Y * 3,
|
|
2666
2676
|
clientX: M,
|
|
2667
|
-
clientY:
|
|
2677
|
+
clientY: A,
|
|
2668
2678
|
event: y
|
|
2669
2679
|
}), c.current.prevDistance = N);
|
|
2670
2680
|
}
|
|
2671
2681
|
}
|
|
2672
|
-
c.current.prevX = M, c.current.prevY =
|
|
2682
|
+
c.current.prevX = M, c.current.prevY = A;
|
|
2673
2683
|
}
|
|
2674
2684
|
}, E = (y) => {
|
|
2675
2685
|
const {
|
|
@@ -2712,7 +2722,7 @@ const oe = new zn(), Fe = ({
|
|
|
2712
2722
|
}
|
|
2713
2723
|
}
|
|
2714
2724
|
if (c.current.mainPointer = void 0, c.current.pressed = !1, clearTimeout(c.current.longTapTimeout), c.current.moving)
|
|
2715
|
-
c.current.moving = !1,
|
|
2725
|
+
c.current.moving = !1, se.add(n, {
|
|
2716
2726
|
deltaX: C - c.current.prevX,
|
|
2717
2727
|
deltaY: x - c.current.prevY,
|
|
2718
2728
|
startX: c.current.startX,
|
|
@@ -2730,7 +2740,7 @@ const oe = new zn(), Fe = ({
|
|
|
2730
2740
|
}), f.current.style.cursor = "auto";
|
|
2731
2741
|
else {
|
|
2732
2742
|
const j = Date.now();
|
|
2733
|
-
c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - j < 300 &&
|
|
2743
|
+
c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - j < 300 && se.add(s, {
|
|
2734
2744
|
clientX: C,
|
|
2735
2745
|
clientY: x,
|
|
2736
2746
|
altKey: p,
|
|
@@ -2755,7 +2765,7 @@ const oe = new zn(), Fe = ({
|
|
|
2755
2765
|
onPointerCancel: E,
|
|
2756
2766
|
onDoubleClick: (y) => {
|
|
2757
2767
|
const { clientX: C, clientY: x, altKey: p, shiftKey: w, ctrlKey: m, metaKey: S, target: O } = y;
|
|
2758
|
-
|
|
2768
|
+
se.add(u, {
|
|
2759
2769
|
clientX: C,
|
|
2760
2770
|
clientY: x,
|
|
2761
2771
|
altKey: p,
|
|
@@ -2789,7 +2799,7 @@ let Yn = { data: "" }, Bn = (e) => typeof window == "object" ? ((e ? e.querySele
|
|
|
2789
2799
|
s[0] == "@" ? s[1] == "i" ? r = s + " " + a + ";" : n += s[1] == "f" ? fe(a, s) : s + "{" + fe(a, s[1] == "k" ? "" : t) + "}" : typeof a == "object" ? n += fe(a, t ? t.replace(/([^,])+/g, (u) => s.replace(/(^:.*)|([^,])+/g, (l) => /&/.test(l) ? l.replace(/&/g, u) : u ? u + " " + l : l)) : s) : a != null && (s = /^--/.test(s) ? s : s.replace(/[A-Z]/g, "-$&").toLowerCase(), o += fe.p ? fe.p(s, a) : s + ":" + a + ";");
|
|
2790
2800
|
}
|
|
2791
2801
|
return r + (t && o ? t + "{" + o + "}" : o) + n;
|
|
2792
|
-
},
|
|
2802
|
+
}, ce = {}, pr = (e) => {
|
|
2793
2803
|
if (typeof e == "object") {
|
|
2794
2804
|
let t = "";
|
|
2795
2805
|
for (let r in e)
|
|
@@ -2798,25 +2808,25 @@ let Yn = { data: "" }, Bn = (e) => typeof window == "object" ? ((e ? e.querySele
|
|
|
2798
2808
|
}
|
|
2799
2809
|
return e;
|
|
2800
2810
|
}, Un = (e, t, r, n, o) => {
|
|
2801
|
-
let s = pr(e), a =
|
|
2811
|
+
let s = pr(e), a = ce[s] || (ce[s] = ((l) => {
|
|
2802
2812
|
let d = 0, f = 11;
|
|
2803
2813
|
for (; d < l.length; )
|
|
2804
2814
|
f = 101 * f + l.charCodeAt(d++) >>> 0;
|
|
2805
2815
|
return "go" + f;
|
|
2806
2816
|
})(s));
|
|
2807
|
-
if (!
|
|
2817
|
+
if (!ce[a]) {
|
|
2808
2818
|
let l = s !== e ? e : ((d) => {
|
|
2809
2819
|
let f, c, h = [{}];
|
|
2810
2820
|
for (; f = Nn.exec(d.replace(Xn, "")); )
|
|
2811
2821
|
f[4] ? h.shift() : f[3] ? (c = f[3].replace(Jt, " ").trim(), h.unshift(h[0][c] = h[0][c] || {})) : h[0][f[1]] = f[2].replace(Jt, " ").trim();
|
|
2812
2822
|
return h[0];
|
|
2813
2823
|
})(e);
|
|
2814
|
-
|
|
2824
|
+
ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
|
|
2815
2825
|
}
|
|
2816
|
-
let u = r &&
|
|
2817
|
-
return r && (
|
|
2826
|
+
let u = r && ce.g ? ce.g : null;
|
|
2827
|
+
return r && (ce.g = ce[a]), ((l, d, f, c) => {
|
|
2818
2828
|
c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
|
|
2819
|
-
})(
|
|
2829
|
+
})(ce[a], t, n, u), a;
|
|
2820
2830
|
}, Wn = (e, t, r) => e.reduce((n, o, s) => {
|
|
2821
2831
|
let a = t[s];
|
|
2822
2832
|
if (a && a.call) {
|
|
@@ -2918,7 +2928,7 @@ const Kn = K`
|
|
|
2918
2928
|
cursor: nwse-resize;
|
|
2919
2929
|
bottom: -6px;
|
|
2920
2930
|
right: -6px;
|
|
2921
|
-
`, no = ({ onReload: e }) => /* @__PURE__ */
|
|
2931
|
+
`, no = ({ onReload: e }) => /* @__PURE__ */ le(
|
|
2922
2932
|
"div",
|
|
2923
2933
|
{
|
|
2924
2934
|
className: `syncboard-error-item ${K({
|
|
@@ -3012,12 +3022,12 @@ const so = (e) => {
|
|
|
3012
3022
|
o && I.push("locked"), l && (I.push("selected"), I.push(Hn));
|
|
3013
3023
|
const y = I.join(" "), C = ({ width: S = 0, height: O = 0, keepRatio: k }) => {
|
|
3014
3024
|
E((j) => {
|
|
3015
|
-
const { offsetWidth: M, offsetHeight:
|
|
3025
|
+
const { offsetWidth: M, offsetHeight: A } = c.current;
|
|
3016
3026
|
return v({
|
|
3017
3027
|
prevState: j,
|
|
3018
3028
|
width: S,
|
|
3019
3029
|
height: O,
|
|
3020
|
-
actualHeight:
|
|
3030
|
+
actualHeight: A,
|
|
3021
3031
|
actualWidth: M,
|
|
3022
3032
|
keepRatio: k
|
|
3023
3033
|
});
|
|
@@ -3035,7 +3045,7 @@ const so = (e) => {
|
|
|
3035
3045
|
style: { transform: `rotate(${r}deg` },
|
|
3036
3046
|
"data-id": n,
|
|
3037
3047
|
className: y,
|
|
3038
|
-
children: /* @__PURE__ */
|
|
3048
|
+
children: /* @__PURE__ */ le(
|
|
3039
3049
|
"div",
|
|
3040
3050
|
{
|
|
3041
3051
|
style: { display: "flex" },
|
|
@@ -3058,7 +3068,7 @@ const so = (e) => {
|
|
|
3058
3068
|
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${Zn}` }),
|
|
3059
3069
|
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${Jn}` }),
|
|
3060
3070
|
/* @__PURE__ */ T("div", { className: `center ${Ce} ${Qn}` }),
|
|
3061
|
-
f && /* @__PURE__ */
|
|
3071
|
+
f && /* @__PURE__ */ le(Wr, { children: [
|
|
3062
3072
|
_.b && /* @__PURE__ */ T(
|
|
3063
3073
|
ot,
|
|
3064
3074
|
{
|
|
@@ -3128,7 +3138,7 @@ const so = (e) => {
|
|
|
3128
3138
|
}
|
|
3129
3139
|
);
|
|
3130
3140
|
}, po = rr(fo), mo = () => {
|
|
3131
|
-
const { updateItem: e } = gt(), [t, r] =
|
|
3141
|
+
const { updateItem: e } = gt(), [t, r] = oe((d) => [
|
|
3132
3142
|
d.itemIds,
|
|
3133
3143
|
d.items
|
|
3134
3144
|
]), [n, o, s, a] = Q(
|
|
@@ -3173,7 +3183,7 @@ function vo(e, ...t) {
|
|
|
3173
3183
|
e && e.removeEventListener && e.removeEventListener(...t);
|
|
3174
3184
|
}
|
|
3175
3185
|
const yo = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
3176
|
-
function
|
|
3186
|
+
function ue(e, ...t) {
|
|
3177
3187
|
const r = go(), n = pt(t[1]), o = lt(
|
|
3178
3188
|
() => (
|
|
3179
3189
|
// as some event listeners designed to be used through `this`
|
|
@@ -3225,12 +3235,12 @@ const So = K({
|
|
|
3225
3235
|
m.getConfiguration,
|
|
3226
3236
|
m.getBoardState,
|
|
3227
3237
|
m.updateBoardState
|
|
3228
|
-
]), { findElementUnderPointer: l } = gt(), [d] =
|
|
3238
|
+
]), { findElementUnderPointer: l } = gt(), [d] = oe((m) => [m.getItems]), [f, c] = g.useState({}), [, h] = g.useTransition(), [_, v] = g.useState(!1), E = g.useRef(null), I = g.useRef({
|
|
3229
3239
|
moving: !1
|
|
3230
3240
|
});
|
|
3231
|
-
return
|
|
3241
|
+
return ue(document, "keydown", (m) => {
|
|
3232
3242
|
m.key === "l" && v(!0);
|
|
3233
|
-
}),
|
|
3243
|
+
}), ue(document, "keyup", (m) => {
|
|
3234
3244
|
m.key === "l" && v(!1);
|
|
3235
3245
|
}), g.useEffect(() => (n(), () => {
|
|
3236
3246
|
n();
|
|
@@ -3251,8 +3261,8 @@ const So = K({
|
|
|
3251
3261
|
},
|
|
3252
3262
|
onDrag: ({ distanceY: m, distanceX: S, startX: O, startY: k }) => {
|
|
3253
3263
|
if (I.current.moving) {
|
|
3254
|
-
const { top: j, left: M } = E.current.getBoundingClientRect(),
|
|
3255
|
-
S > 0 ? (I.current.left =
|
|
3264
|
+
const { top: j, left: M } = E.current.getBoundingClientRect(), A = O - M, N = k - j;
|
|
3265
|
+
S > 0 ? (I.current.left = A, I.current.width = S) : (I.current.left = A + S, I.current.width = -S), m > 0 ? (I.current.top = N, I.current.height = m) : (I.current.top = N + m, I.current.height = -m), c({ ...I.current, moving: !0 });
|
|
3256
3266
|
}
|
|
3257
3267
|
},
|
|
3258
3268
|
onDragEnd: () => {
|
|
@@ -3270,8 +3280,8 @@ const So = K({
|
|
|
3270
3280
|
n();
|
|
3271
3281
|
return;
|
|
3272
3282
|
}
|
|
3273
|
-
const
|
|
3274
|
-
j && !
|
|
3283
|
+
const A = r();
|
|
3284
|
+
j && !A.includes(M) && (O || k ? s([M]) : o([M]));
|
|
3275
3285
|
}
|
|
3276
3286
|
},
|
|
3277
3287
|
onLongTap: ({ target: m }) => {
|
|
@@ -3282,7 +3292,7 @@ const So = K({
|
|
|
3282
3292
|
}
|
|
3283
3293
|
},
|
|
3284
3294
|
mainAction: t ? "pan" : "drag",
|
|
3285
|
-
children: /* @__PURE__ */
|
|
3295
|
+
children: /* @__PURE__ */ le("div", { ref: E, children: [
|
|
3286
3296
|
f.moving && /* @__PURE__ */ T(
|
|
3287
3297
|
"div",
|
|
3288
3298
|
{
|
|
@@ -3305,7 +3315,7 @@ const So = K({
|
|
|
3305
3315
|
y.getSelection,
|
|
3306
3316
|
y.getBoardState,
|
|
3307
3317
|
y.updateBoardState
|
|
3308
|
-
]), [f] =
|
|
3318
|
+
]), [f] = oe((y) => [y.getBoardConfig]), c = g.useRef({}), h = g.useRef({
|
|
3309
3319
|
items: []
|
|
3310
3320
|
}), _ = (y) => {
|
|
3311
3321
|
const { ctrlKey: C, metaKey: x, event: p } = y, w = n(y);
|
|
@@ -3340,7 +3350,7 @@ const So = K({
|
|
|
3340
3350
|
}), d({ movingItems: !1 });
|
|
3341
3351
|
}
|
|
3342
3352
|
};
|
|
3343
|
-
return
|
|
3353
|
+
return ue(document, "keydown", (y) => {
|
|
3344
3354
|
if (["INPUT", "TEXTAREA"].includes(y.target.tagName))
|
|
3345
3355
|
return;
|
|
3346
3356
|
const C = u();
|
|
@@ -3380,12 +3390,12 @@ const So = K({
|
|
|
3380
3390
|
}), /* @__PURE__ */ T(Fe, { onDragStart: _, onDrag: v, onDragEnd: E, children: e });
|
|
3381
3391
|
}, wo = (e) => {
|
|
3382
3392
|
const t = g.useRef({ hover: !1, x: 0, y: 0 });
|
|
3383
|
-
return
|
|
3393
|
+
return ue(e.current, "mousemove", (n) => {
|
|
3384
3394
|
const { clientX: o, clientY: s } = n;
|
|
3385
3395
|
t.current.x = o, t.current.y = s;
|
|
3386
|
-
}),
|
|
3396
|
+
}), ue(e.current, "mouseenter", () => {
|
|
3387
3397
|
t.current.hover = !0;
|
|
3388
|
-
}),
|
|
3398
|
+
}), ue(e.current, "mouseleave", () => {
|
|
3389
3399
|
t.current.hover = !1;
|
|
3390
3400
|
}), g.useCallback(() => t.current, []);
|
|
3391
3401
|
}, Co = [...Array(5).keys()].map((e) => `Digit${e + 1}`), xo = () => {
|
|
@@ -3393,7 +3403,7 @@ const So = K({
|
|
|
3393
3403
|
o.getBoardState,
|
|
3394
3404
|
o.updateBoardState
|
|
3395
3405
|
]);
|
|
3396
|
-
return
|
|
3406
|
+
return ue(document, "keydown", (o) => {
|
|
3397
3407
|
if (!["INPUT", "TEXTAREA"].includes(o.target.tagName) && Co.includes(o.code)) {
|
|
3398
3408
|
const s = o.code, { translateX: a, translateY: u, scale: l } = r();
|
|
3399
3409
|
o.altKey || o.metaKey || o.ctrlKey || o.shiftKey ? t((d) => ({
|
|
@@ -3477,7 +3487,7 @@ const So = K({
|
|
|
3477
3487
|
}, x = (p) => {
|
|
3478
3488
|
["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && v().hover && l({ factor: 1 / 3, to: v() });
|
|
3479
3489
|
};
|
|
3480
|
-
return
|
|
3490
|
+
return ue(document, "keydown", C), ue(document, "keyup", x), /* @__PURE__ */ T(
|
|
3481
3491
|
Fe,
|
|
3482
3492
|
{
|
|
3483
3493
|
onPan: y,
|
|
@@ -3525,7 +3535,7 @@ const So = K({
|
|
|
3525
3535
|
translateY: c.boardState.translateY,
|
|
3526
3536
|
scale: c.boardState.scale
|
|
3527
3537
|
}
|
|
3528
|
-
]), [l] =
|
|
3538
|
+
]), [l] = oe((c) => [c.items]), d = g.useCallback(() => {
|
|
3529
3539
|
const c = t(), { boardWrapperRect: h, boardWrapper: _ } = o();
|
|
3530
3540
|
if (c.length === 0) {
|
|
3531
3541
|
n(null);
|
|
@@ -3711,8 +3721,8 @@ const Fo = K({
|
|
|
3711
3721
|
pointerEvents: "none"
|
|
3712
3722
|
}), Ho = ({ color: e = "#666", size: t = 40, text: r }) => {
|
|
3713
3723
|
const n = Vo(e) ? "#222" : "#EEE";
|
|
3714
|
-
return /* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3724
|
+
return /* @__PURE__ */ le("div", { className: Fo, children: [
|
|
3725
|
+
/* @__PURE__ */ le(
|
|
3716
3726
|
"svg",
|
|
3717
3727
|
{
|
|
3718
3728
|
version: "1.1",
|
|
@@ -3795,7 +3805,7 @@ const Fo = K({
|
|
|
3795
3805
|
}, h = () => {
|
|
3796
3806
|
d(o.id);
|
|
3797
3807
|
}, _ = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
|
|
3798
|
-
return /* @__PURE__ */
|
|
3808
|
+
return /* @__PURE__ */ le("div", { onPointerMove: c, onPointerLeave: h, children: [
|
|
3799
3809
|
e,
|
|
3800
3810
|
Object.entries(_).map(([v, E]) => {
|
|
3801
3811
|
const [I, y] = n(E.x, E.y), C = {
|
|
@@ -3868,14 +3878,14 @@ const Fo = K({
|
|
|
3868
3878
|
});
|
|
3869
3879
|
});
|
|
3870
3880
|
const _ = K({ ...es, ...r });
|
|
3871
|
-
return /* @__PURE__ */
|
|
3881
|
+
return /* @__PURE__ */ le(
|
|
3872
3882
|
"div",
|
|
3873
3883
|
{
|
|
3874
3884
|
ref: l,
|
|
3875
3885
|
id: d,
|
|
3876
3886
|
className: `sync-board ${_}`,
|
|
3877
3887
|
children: [
|
|
3878
|
-
/* @__PURE__ */ T(Zo, { children: /* @__PURE__ */ T(bo, { moveFirst: e, children: /* @__PURE__ */ T(Ro, { moveFirst: e, children: /* @__PURE__ */ T(Eo, { moveFirst: e, children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */
|
|
3888
|
+
/* @__PURE__ */ T(Zo, { children: /* @__PURE__ */ T(bo, { moveFirst: e, children: /* @__PURE__ */ T(Ro, { moveFirst: e, children: /* @__PURE__ */ T(Eo, { moveFirst: e, children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */ le(
|
|
3879
3889
|
"div",
|
|
3880
3890
|
{
|
|
3881
3891
|
onContextMenu: (v) => {
|