react-sync-board 1.2.3 → 1.2.5
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
|
@@ -28,19 +28,19 @@ function Xr() {
|
|
|
28
28
|
return Ee;
|
|
29
29
|
Pt = 1;
|
|
30
30
|
var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
31
|
-
function
|
|
32
|
-
var f,
|
|
31
|
+
function a(u, l, d) {
|
|
32
|
+
var f, c = {}, h = null, _ = null;
|
|
33
33
|
d !== void 0 && (h = "" + d), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (_ = l.ref);
|
|
34
34
|
for (f in l)
|
|
35
|
-
n.call(l, f) && !s.hasOwnProperty(f) && (
|
|
35
|
+
n.call(l, f) && !s.hasOwnProperty(f) && (c[f] = l[f]);
|
|
36
36
|
if (u && u.defaultProps)
|
|
37
37
|
for (f in l = u.defaultProps, l)
|
|
38
|
-
|
|
39
|
-
return { $$typeof: t, type: u, key: h, ref: _, props:
|
|
38
|
+
c[f] === void 0 && (c[f] = l[f]);
|
|
39
|
+
return { $$typeof: t, type: u, key: h, ref: _, props: c, _owner: o.current };
|
|
40
40
|
}
|
|
41
|
-
return Ee.Fragment = r, Ee.jsx =
|
|
41
|
+
return Ee.Fragment = r, Ee.jsx = a, Ee.jsxs = a, Ee;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var we = {};
|
|
44
44
|
/**
|
|
45
45
|
* @license React
|
|
46
46
|
* react-jsx-runtime.development.js
|
|
@@ -53,7 +53,7 @@ var Ce = {};
|
|
|
53
53
|
var Mt;
|
|
54
54
|
function Ur() {
|
|
55
55
|
return Mt || (Mt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
|
-
var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"),
|
|
56
|
+
var e = g, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), u = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), v = Symbol.iterator, E = "@@iterator";
|
|
57
57
|
function I(i) {
|
|
58
58
|
if (i === null || typeof i != "object")
|
|
59
59
|
return null;
|
|
@@ -61,46 +61,46 @@ function Ur() {
|
|
|
61
61
|
return typeof b == "function" ? b : null;
|
|
62
62
|
}
|
|
63
63
|
var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
64
|
-
function
|
|
64
|
+
function C(i) {
|
|
65
65
|
{
|
|
66
|
-
for (var b = arguments.length, R = new Array(b > 1 ? b - 1 : 0),
|
|
67
|
-
R[
|
|
66
|
+
for (var b = arguments.length, R = new Array(b > 1 ? b - 1 : 0), D = 1; D < b; D++)
|
|
67
|
+
R[D - 1] = arguments[D];
|
|
68
68
|
x("error", i, R);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
function x(i, b, R) {
|
|
72
72
|
{
|
|
73
|
-
var
|
|
73
|
+
var D = y.ReactDebugCurrentFrame, X = D.getStackAddendum();
|
|
74
74
|
X !== "" && (b += "%s", R = R.concat([X]));
|
|
75
|
-
var W = R.map(function(
|
|
76
|
-
return String(
|
|
75
|
+
var W = R.map(function(B) {
|
|
76
|
+
return String(B);
|
|
77
77
|
});
|
|
78
78
|
W.unshift("Warning: " + b), Function.prototype.apply.call(console[i], console, W);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
var p = !1,
|
|
81
|
+
var p = !1, w = !1, m = !1, S = !1, O = !1, k;
|
|
82
82
|
k = Symbol.for("react.module.reference");
|
|
83
|
-
function
|
|
84
|
-
return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || O || i === o || i === d || i === f || S || i === _ || p ||
|
|
83
|
+
function j(i) {
|
|
84
|
+
return !!(typeof i == "string" || typeof i == "function" || i === n || i === s || O || i === o || i === d || i === f || S || i === _ || p || w || m || typeof i == "object" && i !== null && (i.$$typeof === h || i.$$typeof === c || i.$$typeof === a || i.$$typeof === u || i.$$typeof === l || // This needs to include all possible module reference object
|
|
85
85
|
// types supported by any Flight configuration anywhere since
|
|
86
86
|
// we don't know which Flight build this will end up being used
|
|
87
87
|
// with.
|
|
88
88
|
i.$$typeof === k || i.getModuleId !== void 0));
|
|
89
89
|
}
|
|
90
90
|
function M(i, b, R) {
|
|
91
|
-
var
|
|
92
|
-
if (
|
|
93
|
-
return
|
|
91
|
+
var D = i.displayName;
|
|
92
|
+
if (D)
|
|
93
|
+
return D;
|
|
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) {
|
|
101
101
|
if (i == null)
|
|
102
102
|
return null;
|
|
103
|
-
if (typeof i.tag == "number" &&
|
|
103
|
+
if (typeof i.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
104
104
|
return i.displayName || i.name || null;
|
|
105
105
|
if (typeof i == "string")
|
|
106
106
|
return i;
|
|
@@ -122,19 +122,19 @@ function Ur() {
|
|
|
122
122
|
switch (i.$$typeof) {
|
|
123
123
|
case u:
|
|
124
124
|
var b = i;
|
|
125
|
-
return
|
|
126
|
-
case
|
|
125
|
+
return A(b) + ".Consumer";
|
|
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
|
-
case
|
|
132
|
-
var
|
|
133
|
-
return
|
|
131
|
+
case c:
|
|
132
|
+
var D = i.displayName || null;
|
|
133
|
+
return D !== null ? D : N(i.type) || "Memo";
|
|
134
134
|
case h: {
|
|
135
|
-
var X = i, W = X._payload,
|
|
135
|
+
var X = i, W = X._payload, B = X._init;
|
|
136
136
|
try {
|
|
137
|
-
return N(
|
|
137
|
+
return N(B(W));
|
|
138
138
|
} catch {
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
@@ -142,18 +142,18 @@ function Ur() {
|
|
|
142
142
|
}
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
|
-
var U = Object.assign, J = 0, P, $,
|
|
146
|
-
function
|
|
145
|
+
var U = Object.assign, J = 0, P, $, z, V, Y, F, H;
|
|
146
|
+
function te() {
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
function
|
|
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,114 +185,114 @@ 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
|
-
value:
|
|
197
|
+
value: F
|
|
198
198
|
}),
|
|
199
199
|
groupEnd: U({}, i, {
|
|
200
|
-
value:
|
|
200
|
+
value: H
|
|
201
201
|
})
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
J < 0 &&
|
|
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)
|
|
211
211
|
try {
|
|
212
212
|
throw Error();
|
|
213
213
|
} catch (X) {
|
|
214
|
-
var
|
|
215
|
-
me =
|
|
214
|
+
var D = X.stack.trim().match(/\n( *(at )?)/);
|
|
215
|
+
me = D && D[1] || "";
|
|
216
216
|
}
|
|
217
217
|
return `
|
|
218
218
|
` + me + i;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
var Ke = !1,
|
|
221
|
+
var Ke = !1, je;
|
|
222
222
|
{
|
|
223
223
|
var mr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
224
|
-
|
|
224
|
+
je = new mr();
|
|
225
225
|
}
|
|
226
226
|
function ht(i, b) {
|
|
227
227
|
if (!i || Ke)
|
|
228
228
|
return "";
|
|
229
229
|
{
|
|
230
|
-
var R =
|
|
230
|
+
var R = je.get(i);
|
|
231
231
|
if (R !== void 0)
|
|
232
232
|
return R;
|
|
233
233
|
}
|
|
234
|
-
var
|
|
234
|
+
var D;
|
|
235
235
|
Ke = !0;
|
|
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
|
-
var
|
|
242
|
+
var B = function() {
|
|
243
243
|
throw Error();
|
|
244
244
|
};
|
|
245
|
-
if (Object.defineProperty(
|
|
245
|
+
if (Object.defineProperty(B.prototype, "props", {
|
|
246
246
|
set: function() {
|
|
247
247
|
throw Error();
|
|
248
248
|
}
|
|
249
249
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
250
250
|
try {
|
|
251
|
-
Reflect.construct(
|
|
252
|
-
} catch (
|
|
253
|
-
|
|
251
|
+
Reflect.construct(B, []);
|
|
252
|
+
} catch (ae) {
|
|
253
|
+
D = ae;
|
|
254
254
|
}
|
|
255
|
-
Reflect.construct(i, [],
|
|
255
|
+
Reflect.construct(i, [], B);
|
|
256
256
|
} else {
|
|
257
257
|
try {
|
|
258
|
-
|
|
259
|
-
} catch (
|
|
260
|
-
|
|
258
|
+
B.call();
|
|
259
|
+
} catch (ae) {
|
|
260
|
+
D = ae;
|
|
261
261
|
}
|
|
262
|
-
i.call(
|
|
262
|
+
i.call(B.prototype);
|
|
263
263
|
}
|
|
264
264
|
} else {
|
|
265
265
|
try {
|
|
266
266
|
throw Error();
|
|
267
|
-
} catch (
|
|
268
|
-
|
|
267
|
+
} catch (ae) {
|
|
268
|
+
D = ae;
|
|
269
269
|
}
|
|
270
270
|
i();
|
|
271
271
|
}
|
|
272
|
-
} catch (
|
|
273
|
-
if (
|
|
274
|
-
for (var
|
|
275
|
-
`),
|
|
276
|
-
`), q =
|
|
272
|
+
} catch (ae) {
|
|
273
|
+
if (ae && D && typeof ae.stack == "string") {
|
|
274
|
+
for (var L = ae.stack.split(`
|
|
275
|
+
`), ee = D.stack.split(`
|
|
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 ||
|
|
283
|
-
var
|
|
284
|
-
` +
|
|
285
|
-
return i.displayName &&
|
|
282
|
+
if (q--, G--, G < 0 || L[q] !== ee[G]) {
|
|
283
|
+
var re = `
|
|
284
|
+
` + L[q].replace(" at new ", " at ");
|
|
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);
|
|
288
288
|
break;
|
|
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
|
-
return typeof i == "function" &&
|
|
295
|
+
return typeof i == "function" && je.set(i, Tt), Tt;
|
|
296
296
|
}
|
|
297
297
|
function gr(i, b, R) {
|
|
298
298
|
return ht(i, !1);
|
|
@@ -301,7 +301,7 @@ function Ur() {
|
|
|
301
301
|
var b = i.prototype;
|
|
302
302
|
return !!(b && b.isReactComponent);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function De(i, b, R) {
|
|
305
305
|
if (i == null)
|
|
306
306
|
return "";
|
|
307
307
|
if (typeof i == "function")
|
|
@@ -318,12 +318,12 @@ function Ur() {
|
|
|
318
318
|
switch (i.$$typeof) {
|
|
319
319
|
case l:
|
|
320
320
|
return gr(i.render);
|
|
321
|
-
case
|
|
322
|
-
return
|
|
321
|
+
case c:
|
|
322
|
+
return De(i.type, b, R);
|
|
323
323
|
case h: {
|
|
324
|
-
var
|
|
324
|
+
var D = i, X = D._payload, W = D._init;
|
|
325
325
|
try {
|
|
326
|
-
return
|
|
326
|
+
return De(W(X), b, R);
|
|
327
327
|
} catch {
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -333,27 +333,27 @@ function Ur() {
|
|
|
333
333
|
var $e = Object.prototype.hasOwnProperty, vt = {}, yt = y.ReactDebugCurrentFrame;
|
|
334
334
|
function Ae(i) {
|
|
335
335
|
if (i) {
|
|
336
|
-
var b = i._owner, R =
|
|
336
|
+
var b = i._owner, R = De(i.type, i._source, b ? b.type : null);
|
|
337
337
|
yt.setExtraStackFrame(R);
|
|
338
338
|
} else
|
|
339
339
|
yt.setExtraStackFrame(null);
|
|
340
340
|
}
|
|
341
|
-
function vr(i, b, R,
|
|
341
|
+
function vr(i, b, R, D, X) {
|
|
342
342
|
{
|
|
343
343
|
var W = Function.call.bind($e);
|
|
344
|
-
for (var
|
|
345
|
-
if (W(i,
|
|
346
|
-
var
|
|
344
|
+
for (var B in i)
|
|
345
|
+
if (W(i, B)) {
|
|
346
|
+
var L = void 0;
|
|
347
347
|
try {
|
|
348
|
-
if (typeof i[
|
|
349
|
-
var
|
|
350
|
-
throw
|
|
348
|
+
if (typeof i[B] != "function") {
|
|
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
|
+
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
|
}
|
|
@@ -379,7 +379,7 @@ function Ur() {
|
|
|
379
379
|
}
|
|
380
380
|
function _t(i) {
|
|
381
381
|
if (_r(i))
|
|
382
|
-
return
|
|
382
|
+
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Sr(i)), St(i);
|
|
383
383
|
}
|
|
384
384
|
var be = y.ReactCurrentOwner, br = {
|
|
385
385
|
key: !0,
|
|
@@ -396,7 +396,7 @@ function Ur() {
|
|
|
396
396
|
}
|
|
397
397
|
return i.ref !== void 0;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function wr(i) {
|
|
400
400
|
if ($e.call(i, "key")) {
|
|
401
401
|
var b = Object.getOwnPropertyDescriptor(i, "key").get;
|
|
402
402
|
if (b && b.isReactWarning)
|
|
@@ -404,16 +404,16 @@ function Ur() {
|
|
|
404
404
|
}
|
|
405
405
|
return i.key !== void 0;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Cr(i, b) {
|
|
408
408
|
if (typeof i.ref == "string" && be.current && b && be.current.stateNode !== b) {
|
|
409
409
|
var R = N(be.current.type);
|
|
410
|
-
qe[R] || (
|
|
410
|
+
qe[R] || (C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(be.current.type), i.ref), qe[R] = !0);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
function xr(i, b) {
|
|
414
414
|
{
|
|
415
415
|
var R = function() {
|
|
416
|
-
bt || (bt = !0,
|
|
416
|
+
bt || (bt = !0, C("%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://reactjs.org/link/special-props)", b));
|
|
417
417
|
};
|
|
418
418
|
R.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
419
419
|
get: R,
|
|
@@ -424,7 +424,7 @@ function Ur() {
|
|
|
424
424
|
function Rr(i, b) {
|
|
425
425
|
{
|
|
426
426
|
var R = function() {
|
|
427
|
-
Et || (Et = !0,
|
|
427
|
+
Et || (Et = !0, C("%s: `ref` 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://reactjs.org/link/special-props)", b));
|
|
428
428
|
};
|
|
429
429
|
R.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
430
430
|
get: R,
|
|
@@ -432,67 +432,67 @@ function Ur() {
|
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
|
-
var Ir = function(i, b, R,
|
|
436
|
-
var
|
|
435
|
+
var Ir = function(i, b, R, D, X, W, B) {
|
|
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
|
|
440
440
|
type: i,
|
|
441
441
|
key: b,
|
|
442
442
|
ref: R,
|
|
443
|
-
props:
|
|
443
|
+
props: B,
|
|
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
|
-
value:
|
|
457
|
-
}), Object.defineProperty(
|
|
456
|
+
value: D
|
|
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
|
-
function Or(i, b, R,
|
|
464
|
+
function Or(i, b, R, D, X) {
|
|
465
465
|
{
|
|
466
|
-
var W,
|
|
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
|
-
$e.call(b, W) && !br.hasOwnProperty(W) && (
|
|
469
|
+
$e.call(b, W) && !br.hasOwnProperty(W) && (B[W] = b[W]);
|
|
470
470
|
if (i && i.defaultProps) {
|
|
471
471
|
var q = i.defaultProps;
|
|
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
|
-
var Ge = y.ReactCurrentOwner,
|
|
482
|
+
var Ge = y.ReactCurrentOwner, wt = y.ReactDebugCurrentFrame;
|
|
483
483
|
function he(i) {
|
|
484
484
|
if (i) {
|
|
485
|
-
var b = i._owner, R =
|
|
486
|
-
|
|
485
|
+
var b = i._owner, R = De(i.type, i._source, b ? b.type : null);
|
|
486
|
+
wt.setExtraStackFrame(R);
|
|
487
487
|
} else
|
|
488
|
-
|
|
488
|
+
wt.setExtraStackFrame(null);
|
|
489
489
|
}
|
|
490
490
|
var Je;
|
|
491
491
|
Je = !1;
|
|
492
492
|
function Ze(i) {
|
|
493
493
|
return typeof i == "object" && i !== null && i.$$typeof === t;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Ct() {
|
|
496
496
|
{
|
|
497
497
|
if (Ge.current) {
|
|
498
498
|
var i = N(Ge.current.type);
|
|
@@ -518,7 +518,7 @@ Check your code at ` + b + ":" + R + ".";
|
|
|
518
518
|
var xt = {};
|
|
519
519
|
function kr(i) {
|
|
520
520
|
{
|
|
521
|
-
var b =
|
|
521
|
+
var b = Ct();
|
|
522
522
|
if (!b) {
|
|
523
523
|
var R = typeof i == "string" ? i : i.displayName || i.name;
|
|
524
524
|
R && (b = `
|
|
@@ -537,8 +537,8 @@ Check the top-level render call using <` + R + ">.");
|
|
|
537
537
|
if (xt[R])
|
|
538
538
|
return;
|
|
539
539
|
xt[R] = !0;
|
|
540
|
-
var
|
|
541
|
-
i && i._owner && i._owner !== Ge.current && (
|
|
540
|
+
var D = "";
|
|
541
|
+
i && i._owner && i._owner !== Ge.current && (D = " It was passed a child from " + N(i._owner.type) + "."), he(i), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', R, D), he(null);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
function It(i, b) {
|
|
@@ -547,16 +547,16 @@ Check the top-level render call using <` + R + ">.");
|
|
|
547
547
|
return;
|
|
548
548
|
if (He(i))
|
|
549
549
|
for (var R = 0; R < i.length; R++) {
|
|
550
|
-
var
|
|
551
|
-
Ze(
|
|
550
|
+
var D = i[R];
|
|
551
|
+
Ze(D) && Rt(D, b);
|
|
552
552
|
}
|
|
553
553
|
else if (Ze(i))
|
|
554
554
|
i._store && (i._store.validated = !0);
|
|
555
555
|
else if (i) {
|
|
556
556
|
var X = I(i);
|
|
557
557
|
if (typeof X == "function" && X !== i.entries)
|
|
558
|
-
for (var W = X.call(i),
|
|
559
|
-
Ze(
|
|
558
|
+
for (var W = X.call(i), B; !(B = W.next()).done; )
|
|
559
|
+
Ze(B.value) && Rt(B.value, b);
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
}
|
|
@@ -570,77 +570,77 @@ Check the top-level render call using <` + R + ">.");
|
|
|
570
570
|
R = b.propTypes;
|
|
571
571
|
else if (typeof b == "object" && (b.$$typeof === l || // Note: Memo only checks outer props here.
|
|
572
572
|
// Inner props are checked in the reconciler.
|
|
573
|
-
b.$$typeof ===
|
|
573
|
+
b.$$typeof === c))
|
|
574
574
|
R = b.propTypes;
|
|
575
575
|
else
|
|
576
576
|
return;
|
|
577
577
|
if (R) {
|
|
578
|
-
var
|
|
579
|
-
vr(R, i.props, "prop",
|
|
578
|
+
var D = N(b);
|
|
579
|
+
vr(R, i.props, "prop", D, i);
|
|
580
580
|
} else if (b.PropTypes !== void 0 && !Je) {
|
|
581
581
|
Je = !0;
|
|
582
582
|
var X = N(b);
|
|
583
|
-
|
|
583
|
+
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", X || "Unknown");
|
|
584
584
|
}
|
|
585
|
-
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved &&
|
|
585
|
+
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
588
|
function Mr(i) {
|
|
589
589
|
{
|
|
590
590
|
for (var b = Object.keys(i.props), R = 0; R < b.length; R++) {
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
593
|
-
he(i),
|
|
591
|
+
var D = b[R];
|
|
592
|
+
if (D !== "children" && D !== "key") {
|
|
593
|
+
he(i), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", D), he(null);
|
|
594
594
|
break;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
|
-
i.ref !== null && (he(i),
|
|
597
|
+
i.ref !== null && (he(i), C("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function Ot(i, b, R,
|
|
600
|
+
function Ot(i, b, R, D, X, W) {
|
|
601
601
|
{
|
|
602
|
-
var
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (
|
|
606
|
-
var
|
|
607
|
-
|
|
602
|
+
var B = j(i);
|
|
603
|
+
if (!B) {
|
|
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
|
+
var ee = Tr(X);
|
|
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)
|
|
613
613
|
return G;
|
|
614
|
-
if (
|
|
615
|
-
var
|
|
616
|
-
if (
|
|
617
|
-
if (
|
|
618
|
-
if (He(
|
|
619
|
-
for (var ve = 0; ve <
|
|
620
|
-
It(
|
|
621
|
-
Object.freeze && Object.freeze(
|
|
614
|
+
if (B) {
|
|
615
|
+
var re = b.children;
|
|
616
|
+
if (re !== void 0)
|
|
617
|
+
if (D)
|
|
618
|
+
if (He(re)) {
|
|
619
|
+
for (var ve = 0; ve < re.length; ve++)
|
|
620
|
+
It(re[ve], i);
|
|
621
|
+
Object.freeze && Object.freeze(re);
|
|
622
622
|
} else
|
|
623
|
-
|
|
623
|
+
C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
624
624
|
else
|
|
625
|
-
It(
|
|
625
|
+
It(re, i);
|
|
626
626
|
}
|
|
627
627
|
return i === n ? Mr(G) : Pr(G), G;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function jr(i, b, R) {
|
|
631
631
|
return Ot(i, b, R, !0);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Dr(i, b, R) {
|
|
634
634
|
return Ot(i, b, R, !1);
|
|
635
635
|
}
|
|
636
|
-
var $r =
|
|
637
|
-
|
|
638
|
-
}()),
|
|
636
|
+
var $r = Dr, Ar = jr;
|
|
637
|
+
we.Fragment = n, we.jsx = $r, we.jsxs = Ar;
|
|
638
|
+
}()), we;
|
|
639
639
|
}
|
|
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) {
|
|
@@ -648,9 +648,9 @@ class Fr {
|
|
|
648
648
|
() => {
|
|
649
649
|
this._socket.off(`${this.room}.isMaster`), this._socket.off(`${this.room}.roomJoined`), this._socket.off(`${this.room}._call`);
|
|
650
650
|
}
|
|
651
|
-
], this._left = !1, this.registeredRPC = {}, this._socket.on(`${this.room}._call`, async ({ callId: o, name: s, params:
|
|
651
|
+
], this._left = !1, this.registeredRPC = {}, this._socket.on(`${this.room}._call`, async ({ callId: o, name: s, params: a }) => {
|
|
652
652
|
try {
|
|
653
|
-
const u = await this.registeredRPC[s](
|
|
653
|
+
const u = await this.registeredRPC[s](a);
|
|
654
654
|
t.emit(`${this.room}._result.${o}`, {
|
|
655
655
|
ok: u || null
|
|
656
656
|
});
|
|
@@ -671,8 +671,8 @@ class Fr {
|
|
|
671
671
|
async _callServerRPC(t, r) {
|
|
672
672
|
const n = Vr();
|
|
673
673
|
return new Promise((o, s) => {
|
|
674
|
-
this._socket.once(`${this.room}._result.${n}`, (
|
|
675
|
-
|
|
674
|
+
this._socket.once(`${this.room}._result.${n}`, (a) => {
|
|
675
|
+
a.hasOwnProperty("ok") ? o(a.ok) : s(a.err);
|
|
676
676
|
}), this._socket.emit(`${this.room}._call`, { callId: n, name: t, params: r });
|
|
677
677
|
});
|
|
678
678
|
}
|
|
@@ -748,12 +748,12 @@ const Kr = ({
|
|
|
748
748
|
userId: o = null
|
|
749
749
|
}) => {
|
|
750
750
|
const s = new Fr(e, t, o);
|
|
751
|
-
return new Promise((
|
|
751
|
+
return new Promise((a) => {
|
|
752
752
|
let u = !0;
|
|
753
753
|
e.on(`${t}.isMaster`, () => {
|
|
754
754
|
s._left || n(t);
|
|
755
755
|
}), e.on(`${t}.roomJoined`, (l) => {
|
|
756
|
-
s._left || (s.userId = l, u = !1, r(s),
|
|
756
|
+
s._left || (s.userId = l, u = !1, r(s), a(s));
|
|
757
757
|
}), e.on("connect", () => {
|
|
758
758
|
s._left || u || e.emit("joinSuperSocket", {
|
|
759
759
|
room: t,
|
|
@@ -782,14 +782,14 @@ const Kr = ({
|
|
|
782
782
|
LoadingComponent: n = Hr,
|
|
783
783
|
children: o
|
|
784
784
|
}) => {
|
|
785
|
-
const [s,
|
|
785
|
+
const [s, a] = g.useState(!1), [u, l] = g.useState(!1), [d, f] = g.useState(null), c = g.useRef(null), h = g.useRef(!1), _ = _e(it), v = g.useRef(!1);
|
|
786
786
|
return g.useEffect(() => (h.current = !0, () => {
|
|
787
787
|
h.current = !1;
|
|
788
788
|
}), []), g.useEffect(() => {
|
|
789
789
|
if (!e)
|
|
790
790
|
return null;
|
|
791
791
|
const E = () => {
|
|
792
|
-
console.log(`Disconnected from ${r}…`), h.current && (
|
|
792
|
+
console.log(`Disconnected from ${r}…`), h.current && (a(!1), l(!1));
|
|
793
793
|
};
|
|
794
794
|
return e.on("disconnect", E), () => {
|
|
795
795
|
e.off("disconnect", E);
|
|
@@ -801,11 +801,11 @@ const Kr = ({
|
|
|
801
801
|
console.log(`Is now master on channel ${r}…`), h.current && l(!0);
|
|
802
802
|
},
|
|
803
803
|
onJoined: (E) => {
|
|
804
|
-
console.log(`Connected on channel ${r}…`),
|
|
804
|
+
console.log(`Connected on channel ${r}…`), c.current = E, h.current && (f(E), a(!0));
|
|
805
805
|
}
|
|
806
806
|
})), () => {
|
|
807
807
|
var E;
|
|
808
|
-
(E =
|
|
808
|
+
(E = c.current) == null || E.leave();
|
|
809
809
|
}) : null, [r, t, e]), !s || !d ? /* @__PURE__ */ T(n, {}) : /* @__PURE__ */ T(
|
|
810
810
|
it.Provider,
|
|
811
811
|
{
|
|
@@ -813,13 +813,13 @@ const Kr = ({
|
|
|
813
813
|
children: o
|
|
814
814
|
}
|
|
815
815
|
);
|
|
816
|
-
}, Xe = (e = "default") => (_e(it) || {})[e],
|
|
816
|
+
}, Xe = (e = "default") => (_e(it) || {})[e], jt = (e) => {
|
|
817
817
|
let t;
|
|
818
818
|
const r = /* @__PURE__ */ new Set(), n = (l, d) => {
|
|
819
819
|
const f = typeof l == "function" ? l(t) : l;
|
|
820
820
|
if (!Object.is(f, t)) {
|
|
821
|
-
const
|
|
822
|
-
t = d ?? typeof f != "object" ? f : Object.assign({}, t, f), r.forEach((h) => h(t,
|
|
821
|
+
const c = t;
|
|
822
|
+
t = d ?? typeof f != "object" ? f : Object.assign({}, t, f), r.forEach((h) => h(t, c));
|
|
823
823
|
}
|
|
824
824
|
}, o = () => t, u = { setState: n, getState: o, subscribe: (l) => (r.add(l), () => r.delete(l)), destroy: () => {
|
|
825
825
|
({ BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0 } && "production") !== "production" && console.warn(
|
|
@@ -827,7 +827,7 @@ const Kr = ({
|
|
|
827
827
|
), r.clear();
|
|
828
828
|
} };
|
|
829
829
|
return t = e(n, o, u), u;
|
|
830
|
-
}, Ue = (e) => e ?
|
|
830
|
+
}, Ue = (e) => e ? jt(e) : jt;
|
|
831
831
|
var at = {}, qr = {
|
|
832
832
|
get exports() {
|
|
833
833
|
return at;
|
|
@@ -852,37 +852,37 @@ var at = {}, qr = {
|
|
|
852
852
|
* This source code is licensed under the MIT license found in the
|
|
853
853
|
* LICENSE file in the root directory of this source tree.
|
|
854
854
|
*/
|
|
855
|
-
var
|
|
855
|
+
var Dt;
|
|
856
856
|
function Jr() {
|
|
857
|
-
if (
|
|
857
|
+
if (Dt)
|
|
858
858
|
return et;
|
|
859
|
-
|
|
859
|
+
Dt = 1;
|
|
860
860
|
var e = g;
|
|
861
|
-
function t(
|
|
862
|
-
return
|
|
861
|
+
function t(c, h) {
|
|
862
|
+
return c === h && (c !== 0 || 1 / c === 1 / h) || c !== c && h !== h;
|
|
863
863
|
}
|
|
864
|
-
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect,
|
|
865
|
-
function u(
|
|
864
|
+
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, a = e.useDebugValue;
|
|
865
|
+
function u(c, h) {
|
|
866
866
|
var _ = h(), v = n({ inst: { value: _, getSnapshot: h } }), E = v[0].inst, I = v[1];
|
|
867
867
|
return s(function() {
|
|
868
868
|
E.value = _, E.getSnapshot = h, l(E) && I({ inst: E });
|
|
869
|
-
}, [
|
|
870
|
-
return l(E) && I({ inst: E }),
|
|
869
|
+
}, [c, _, h]), o(function() {
|
|
870
|
+
return l(E) && I({ inst: E }), c(function() {
|
|
871
871
|
l(E) && I({ inst: E });
|
|
872
872
|
});
|
|
873
|
-
}, [
|
|
873
|
+
}, [c]), a(_), _;
|
|
874
874
|
}
|
|
875
|
-
function l(
|
|
876
|
-
var h =
|
|
877
|
-
|
|
875
|
+
function l(c) {
|
|
876
|
+
var h = c.getSnapshot;
|
|
877
|
+
c = c.value;
|
|
878
878
|
try {
|
|
879
879
|
var _ = h();
|
|
880
|
-
return !r(
|
|
880
|
+
return !r(c, _);
|
|
881
881
|
} catch {
|
|
882
882
|
return !0;
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
|
-
function d(
|
|
885
|
+
function d(c, h) {
|
|
886
886
|
return h();
|
|
887
887
|
}
|
|
888
888
|
var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : u;
|
|
@@ -905,16 +905,16 @@ function Zr() {
|
|
|
905
905
|
var e = g, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
906
906
|
function r(x) {
|
|
907
907
|
{
|
|
908
|
-
for (var p = arguments.length,
|
|
909
|
-
|
|
910
|
-
n("error", x,
|
|
908
|
+
for (var p = arguments.length, w = new Array(p > 1 ? p - 1 : 0), m = 1; m < p; m++)
|
|
909
|
+
w[m - 1] = arguments[m];
|
|
910
|
+
n("error", x, w);
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
function n(x, p,
|
|
913
|
+
function n(x, p, w) {
|
|
914
914
|
{
|
|
915
915
|
var m = t.ReactDebugCurrentFrame, S = m.getStackAddendum();
|
|
916
|
-
S !== "" && (p += "%s",
|
|
917
|
-
var O =
|
|
916
|
+
S !== "" && (p += "%s", w = w.concat([S]));
|
|
917
|
+
var O = w.map(function(k) {
|
|
918
918
|
return String(k);
|
|
919
919
|
});
|
|
920
920
|
O.unshift("Warning: " + p), Function.prototype.apply.call(console[x], console, O);
|
|
@@ -923,30 +923,30 @@ function Zr() {
|
|
|
923
923
|
function o(x, p) {
|
|
924
924
|
return x === p && (x !== 0 || 1 / x === 1 / p) || x !== x && p !== p;
|
|
925
925
|
}
|
|
926
|
-
var s = typeof Object.is == "function" ? Object.is : o,
|
|
927
|
-
function h(x, p,
|
|
926
|
+
var s = typeof Object.is == "function" ? Object.is : o, a = e.useState, u = e.useEffect, l = e.useLayoutEffect, d = e.useDebugValue, f = !1, c = !1;
|
|
927
|
+
function h(x, p, w) {
|
|
928
928
|
f || e.startTransition !== void 0 && (f = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
929
929
|
var m = p();
|
|
930
|
-
if (!
|
|
930
|
+
if (!c) {
|
|
931
931
|
var S = p();
|
|
932
|
-
s(m, S) || (r("The result of getSnapshot should be cached to avoid an infinite loop"),
|
|
932
|
+
s(m, S) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
|
|
933
933
|
}
|
|
934
|
-
var O =
|
|
934
|
+
var O = a({
|
|
935
935
|
inst: {
|
|
936
936
|
value: m,
|
|
937
937
|
getSnapshot: p
|
|
938
938
|
}
|
|
939
|
-
}), k = O[0].inst,
|
|
939
|
+
}), k = O[0].inst, j = O[1];
|
|
940
940
|
return l(function() {
|
|
941
|
-
k.value = m, k.getSnapshot = p, _(k) &&
|
|
941
|
+
k.value = m, k.getSnapshot = p, _(k) && j({
|
|
942
942
|
inst: k
|
|
943
943
|
});
|
|
944
944
|
}, [x, m, p]), u(function() {
|
|
945
|
-
_(k) &&
|
|
945
|
+
_(k) && j({
|
|
946
946
|
inst: k
|
|
947
947
|
});
|
|
948
948
|
var M = function() {
|
|
949
|
-
_(k) &&
|
|
949
|
+
_(k) && j({
|
|
950
950
|
inst: k
|
|
951
951
|
});
|
|
952
952
|
};
|
|
@@ -954,19 +954,19 @@ function Zr() {
|
|
|
954
954
|
}, [x]), d(m), m;
|
|
955
955
|
}
|
|
956
956
|
function _(x) {
|
|
957
|
-
var p = x.getSnapshot,
|
|
957
|
+
var p = x.getSnapshot, w = x.value;
|
|
958
958
|
try {
|
|
959
959
|
var m = p();
|
|
960
|
-
return !s(
|
|
960
|
+
return !s(w, m);
|
|
961
961
|
} catch {
|
|
962
962
|
return !0;
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
function v(x, p,
|
|
965
|
+
function v(x, p, w) {
|
|
966
966
|
return p();
|
|
967
967
|
}
|
|
968
|
-
var E = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", I = !E, y = I ? v : h,
|
|
969
|
-
tt.useSyncExternalStore =
|
|
968
|
+
var E = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", I = !E, y = I ? v : h, C = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : y;
|
|
969
|
+
tt.useSyncExternalStore = C, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
970
970
|
}()), tt;
|
|
971
971
|
}
|
|
972
972
|
var At;
|
|
@@ -993,8 +993,8 @@ function Qr() {
|
|
|
993
993
|
function r(d, f) {
|
|
994
994
|
return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f;
|
|
995
995
|
}
|
|
996
|
-
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef,
|
|
997
|
-
return Qe.useSyncExternalStoreWithSelector = function(d, f,
|
|
996
|
+
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
|
|
997
|
+
return Qe.useSyncExternalStoreWithSelector = function(d, f, c, h, _) {
|
|
998
998
|
var v = s(null);
|
|
999
999
|
if (v.current === null) {
|
|
1000
1000
|
var E = { hasValue: !1, value: null };
|
|
@@ -1003,8 +1003,8 @@ function Qr() {
|
|
|
1003
1003
|
E = v.current;
|
|
1004
1004
|
v = u(function() {
|
|
1005
1005
|
function y(m) {
|
|
1006
|
-
if (!
|
|
1007
|
-
if (
|
|
1006
|
+
if (!C) {
|
|
1007
|
+
if (C = !0, x = m, m = h(m), _ !== void 0 && E.hasValue) {
|
|
1008
1008
|
var S = E.value;
|
|
1009
1009
|
if (_(S, m))
|
|
1010
1010
|
return p = S;
|
|
@@ -1016,15 +1016,15 @@ function Qr() {
|
|
|
1016
1016
|
var O = h(m);
|
|
1017
1017
|
return _ !== void 0 && _(S, O) ? S : (x = m, p = O);
|
|
1018
1018
|
}
|
|
1019
|
-
var
|
|
1019
|
+
var C = !1, x, p, w = c === void 0 ? null : c;
|
|
1020
1020
|
return [function() {
|
|
1021
1021
|
return y(f());
|
|
1022
|
-
},
|
|
1023
|
-
return y(
|
|
1022
|
+
}, w === null ? void 0 : function() {
|
|
1023
|
+
return y(w());
|
|
1024
1024
|
}];
|
|
1025
|
-
}, [f,
|
|
1025
|
+
}, [f, c, h, _]);
|
|
1026
1026
|
var I = o(d, v[0], v[1]);
|
|
1027
|
-
return
|
|
1027
|
+
return a(function() {
|
|
1028
1028
|
E.hasValue = !0, E.value = I;
|
|
1029
1029
|
}, [I]), l(I), I;
|
|
1030
1030
|
}, Qe;
|
|
@@ -1044,21 +1044,21 @@ function en() {
|
|
|
1044
1044
|
return zt || (zt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1045
1045
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
1046
1046
|
var e = g, t = or();
|
|
1047
|
-
function r(f,
|
|
1048
|
-
return f ===
|
|
1047
|
+
function r(f, c) {
|
|
1048
|
+
return f === c && (f !== 0 || 1 / f === 1 / c) || f !== f && c !== c;
|
|
1049
1049
|
}
|
|
1050
|
-
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef,
|
|
1051
|
-
function d(f,
|
|
1050
|
+
var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, u = e.useMemo, l = e.useDebugValue;
|
|
1051
|
+
function d(f, c, h, _, v) {
|
|
1052
1052
|
var E = s(null), I;
|
|
1053
1053
|
E.current === null ? (I = {
|
|
1054
1054
|
hasValue: !1,
|
|
1055
1055
|
value: null
|
|
1056
1056
|
}, E.current = I) : I = E.current;
|
|
1057
1057
|
var y = u(function() {
|
|
1058
|
-
var
|
|
1059
|
-
if (!
|
|
1060
|
-
|
|
1061
|
-
var N = _(
|
|
1058
|
+
var w = !1, m, S, O = function(A) {
|
|
1059
|
+
if (!w) {
|
|
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,18 +1067,18 @@ 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 =
|
|
1074
|
-
}, k = h === void 0 ? null : h,
|
|
1075
|
-
return O(
|
|
1072
|
+
var $ = _(A);
|
|
1073
|
+
return v !== void 0 && v(P, $) ? P : (m = A, S = $, $);
|
|
1074
|
+
}, k = h === void 0 ? null : h, j = function() {
|
|
1075
|
+
return O(c());
|
|
1076
1076
|
}, M = k === null ? void 0 : function() {
|
|
1077
1077
|
return O(k());
|
|
1078
1078
|
};
|
|
1079
|
-
return [
|
|
1080
|
-
}, [
|
|
1081
|
-
return
|
|
1079
|
+
return [j, M];
|
|
1080
|
+
}, [c, h, _, v]), C = y[0], x = y[1], p = o(f, C, x);
|
|
1081
|
+
return a(function() {
|
|
1082
1082
|
I.hasValue = !0, I.value = p;
|
|
1083
1083
|
}, [p]), l(p), p;
|
|
1084
1084
|
}
|
|
@@ -1106,17 +1106,17 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1106
1106
|
const n = r * Math.PI / 180, o = e * Math.cos(n) - t * Math.sin(n), s = e * Math.sin(n) + t * Math.cos(n);
|
|
1107
1107
|
return [o, s];
|
|
1108
1108
|
}, ct = ([e, t], { scale: r, rotate: n, translateX: o, translateY: s }) => {
|
|
1109
|
-
const
|
|
1110
|
-
return sr(
|
|
1109
|
+
const a = (e - o) / r, u = (t - s) / r;
|
|
1110
|
+
return sr(a, u, -n);
|
|
1111
1111
|
}, Be = ([e, t], { scale: r, rotate: n, translateX: o, translateY: s }) => {
|
|
1112
|
-
const [
|
|
1113
|
-
return [
|
|
1112
|
+
const [a, u] = sr(e, t, n);
|
|
1113
|
+
return [a * r + o, u * r + s];
|
|
1114
1114
|
}, Yt = (e, t, r, n) => {
|
|
1115
|
-
const o = e.x, s = e.y,
|
|
1115
|
+
const o = e.x, s = e.y, a = t.x, u = t.y, l = r.x, d = r.y, f = a - o, c = u - s, h = o - l, _ = s - d, v = f * f + c * c, E = 2 * (h * f + _ * c), I = h * h + _ * _ - n * n, y = E * E - 4 * v * I;
|
|
1116
1116
|
if (y < 0)
|
|
1117
1117
|
return [];
|
|
1118
|
-
const
|
|
1119
|
-
return
|
|
1118
|
+
const C = (-E + Math.sqrt(y)) / (2 * v), x = (-E - Math.sqrt(y)) / (2 * v), p = [];
|
|
1119
|
+
return C >= 0 && C <= 1 && p.push({ x: o + C * f, y: s + C * c }), x >= 0 && x <= 1 && p.push({ x: o + x * f, y: s + x * c }), p;
|
|
1120
1120
|
}, ft = (e, t) => e.x > t.left && e.x < t.left + t.width && e.y > t.top && e.y < t.top + t.height, nn = (e, t) => Array.from(e.querySelectorAll(".corner")).every((n) => {
|
|
1121
1121
|
const { top: o, left: s } = n.getBoundingClientRect();
|
|
1122
1122
|
return ft({ x: s, y: o }, t);
|
|
@@ -1140,17 +1140,17 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1140
1140
|
const s = Ne(t, o);
|
|
1141
1141
|
if (!s)
|
|
1142
1142
|
return n || null;
|
|
1143
|
-
const { left:
|
|
1143
|
+
const { left: a, right: u, top: l, bottom: d } = s.getBoundingClientRect();
|
|
1144
1144
|
let f;
|
|
1145
1145
|
return n ? f = n : f = {
|
|
1146
|
-
left:
|
|
1146
|
+
left: a,
|
|
1147
1147
|
top: l,
|
|
1148
1148
|
right: u,
|
|
1149
1149
|
bottom: d
|
|
1150
|
-
}, f.left = Math.min(
|
|
1150
|
+
}, f.left = Math.min(a, f.left), f.top = Math.min(l, f.top), f.right = Math.max(u, f.right), f.bottom = Math.max(d, f.bottom), f;
|
|
1151
1151
|
}, null);
|
|
1152
1152
|
return r && (r.width = r.right - r.left, r.height = r.bottom - r.top, r);
|
|
1153
|
-
}, ir = (e, t, r = null) => (r === null && (r = /* @__PURE__ */ new Set()), !t || t.length === 0 ? [] : t.map((n) => r.has(n) ? [] : (r.add(n), [
|
|
1153
|
+
}, ir = (e, t, r = null) => (r === null && (r = /* @__PURE__ */ new Set()), !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => r.has(n) ? [] : (r.add(n), [
|
|
1154
1154
|
n,
|
|
1155
1155
|
...ir(
|
|
1156
1156
|
e,
|
|
@@ -1160,29 +1160,29 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1160
1160
|
])).flat()), Bt = (e, t, r) => {
|
|
1161
1161
|
const n = new Set(ir(e, r));
|
|
1162
1162
|
return t.filter((o) => n.has(o));
|
|
1163
|
-
}, an = ({ x: e, y: t, width: r, height: n }, { type: o = "grid", size: s = 1, offset:
|
|
1163
|
+
}, an = ({ x: e, y: t, width: r, height: n }, { type: o = "grid", size: s = 1, offset: a = { x: 0, y: 0 } }) => {
|
|
1164
1164
|
const [u, l] = [
|
|
1165
|
-
e + r / 2 -
|
|
1166
|
-
t + n / 2 -
|
|
1165
|
+
e + r / 2 - a.x,
|
|
1166
|
+
t + n / 2 - a.y
|
|
1167
1167
|
];
|
|
1168
|
-
let d, f,
|
|
1168
|
+
let d, f, c, h, _, v, E, I, y, C;
|
|
1169
1169
|
const x = s / 1.1547;
|
|
1170
1170
|
switch (o) {
|
|
1171
1171
|
case "grid":
|
|
1172
1172
|
d = Math.round(u / s) * s, f = Math.round(l / s) * s;
|
|
1173
1173
|
break;
|
|
1174
1174
|
case "hexH":
|
|
1175
|
-
|
|
1175
|
+
c = 2 * x, h = 3 * s, _ = Math.round(u / c) * c, E = Math.round(l / h) * h, v = _ > u ? _ - x : _ + x, I = E > l ? E - 1.5 * s : E + 1.5 * s, y = Math.hypot(_ - u, E - l), C = Math.hypot(v - u, I - l), y < C ? (d = _, f = E) : (d = v, f = I);
|
|
1176
1176
|
break;
|
|
1177
1177
|
case "hexV":
|
|
1178
|
-
|
|
1178
|
+
c = 3 * s, h = 2 * x, _ = Math.round(u / c) * c, E = Math.round(l / h) * h, v = _ > u ? _ - 1.5 * s : _ + 1.5 * s, I = E > l ? E - x : E + x, y = Math.hypot(_ - u, E - l), C = Math.hypot(v - u, I - l), y < C ? (d = _, f = E) : (d = v, f = I);
|
|
1179
1179
|
break;
|
|
1180
1180
|
default:
|
|
1181
1181
|
d = e + r / 2, f = t + n / 2;
|
|
1182
1182
|
}
|
|
1183
1183
|
return {
|
|
1184
|
-
x: d +
|
|
1185
|
-
y: f +
|
|
1184
|
+
x: d + a.x - r / 2,
|
|
1185
|
+
y: f + a.y - n / 2
|
|
1186
1186
|
};
|
|
1187
1187
|
}, Nt = [
|
|
1188
1188
|
"#037758",
|
|
@@ -1215,7 +1215,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1215
1215
|
"#007a4b",
|
|
1216
1216
|
"#bf0daa",
|
|
1217
1217
|
"#af0ad8"
|
|
1218
|
-
], Xt = () => Nt[Math.floor(Math.random() * Nt.length)], cn = !1, dt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s,
|
|
1218
|
+
], Xt = () => Nt[Math.floor(Math.random() * Nt.length)], cn = !1, dt = ({ wire: e, storeName: t, noSync: r = [], defaultValue: n }, o) => (s, a, u) => {
|
|
1219
1219
|
s({ ready: !1 });
|
|
1220
1220
|
const l = [];
|
|
1221
1221
|
(async () => {
|
|
@@ -1229,7 +1229,7 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1229
1229
|
await e.register(
|
|
1230
1230
|
`${t}_getValue`,
|
|
1231
1231
|
() => Object.fromEntries(
|
|
1232
|
-
Object.entries(
|
|
1232
|
+
Object.entries(a()).filter(
|
|
1233
1233
|
([_, v]) => typeof v != "function" && !r.includes(_)
|
|
1234
1234
|
)
|
|
1235
1235
|
),
|
|
@@ -1237,11 +1237,11 @@ const ye = (e, t) => e.classList && e.classList.contains(t), Oe = (e, t) => ye(e
|
|
|
1237
1237
|
)
|
|
1238
1238
|
), l.push(
|
|
1239
1239
|
e.subscribe(`${t}_call`, ([_, v]) => {
|
|
1240
|
-
|
|
1240
|
+
c[_](...v);
|
|
1241
1241
|
})
|
|
1242
1242
|
), s({ ready: !0 });
|
|
1243
1243
|
})();
|
|
1244
|
-
const f = o(s,
|
|
1244
|
+
const f = o(s, a, u), c = { ...f }, h = Object.fromEntries(
|
|
1245
1245
|
// Send the update message on all method calls
|
|
1246
1246
|
Object.entries(f).map(([_, v]) => typeof v == "function" && !_.startsWith("get") && !r.includes(_) ? [_, (...I) => {
|
|
1247
1247
|
const y = v(...I);
|
|
@@ -1285,12 +1285,14 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1285
1285
|
items: {},
|
|
1286
1286
|
getItems: () => t().items,
|
|
1287
1287
|
setItems: (r) => e({ items: r }),
|
|
1288
|
-
updateItems: (r) => e((
|
|
1288
|
+
updateItems: (r, n = !1) => e((o) => n ? { items: Object.fromEntries(
|
|
1289
|
+
Object.entries(o.items).map(([a, u]) => r[a] ? [a, { ...u, ...r[a] }] : [a, u])
|
|
1290
|
+
) } : { items: { ...o.items, ...r } }),
|
|
1289
1291
|
moveItems: (r, n) => e(({ items: o }) => {
|
|
1290
1292
|
const s = { ...o };
|
|
1291
|
-
return r.forEach((
|
|
1292
|
-
const u = o[
|
|
1293
|
-
u && (s[
|
|
1293
|
+
return r.forEach((a) => {
|
|
1294
|
+
const u = o[a];
|
|
1295
|
+
u && (s[a] = {
|
|
1294
1296
|
...u,
|
|
1295
1297
|
x: (u.x || 0) + n.x,
|
|
1296
1298
|
y: (u.y || 0) + n.y,
|
|
@@ -1336,12 +1338,12 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1336
1338
|
}),
|
|
1337
1339
|
insertItems: (r, n) => e((o) => {
|
|
1338
1340
|
let s;
|
|
1339
|
-
const
|
|
1341
|
+
const a = r.map(({ id: u }) => u);
|
|
1340
1342
|
if (n) {
|
|
1341
1343
|
const u = o.itemIds.findIndex((l) => l === n);
|
|
1342
|
-
s = [...o.itemIds], s.splice(u, 0, ...
|
|
1344
|
+
s = [...o.itemIds], s.splice(u, 0, ...a);
|
|
1343
1345
|
} else
|
|
1344
|
-
s = [...o.itemIds, ...
|
|
1346
|
+
s = [...o.itemIds, ...a];
|
|
1345
1347
|
return {
|
|
1346
1348
|
items: {
|
|
1347
1349
|
...o.items,
|
|
@@ -1361,7 +1363,7 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1361
1363
|
setSessionInfo: (r) => e({ session: r }),
|
|
1362
1364
|
updateSessionInfo: (r) => e((n) => ({ session: { ...n.session, ...r } }))
|
|
1363
1365
|
}), Ut = ({ storeName: e, children: t, defaultValue: r }) => {
|
|
1364
|
-
const { wire: n } = Xe("room"), [o, s] = g.useState(!1), [
|
|
1366
|
+
const { wire: n } = Xe("room"), [o, s] = g.useState(!1), [a] = g.useState(
|
|
1365
1367
|
() => Ue(
|
|
1366
1368
|
dt({ wire: n, storeName: e, defaultValue: r }, (...u) => ({
|
|
1367
1369
|
...un(...u),
|
|
@@ -1373,15 +1375,15 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1373
1375
|
)
|
|
1374
1376
|
);
|
|
1375
1377
|
return g.useEffect(() => {
|
|
1376
|
-
const u =
|
|
1378
|
+
const u = a.subscribe((l) => {
|
|
1377
1379
|
l.ready && (u(), s(!0));
|
|
1378
1380
|
});
|
|
1379
|
-
}, [
|
|
1380
|
-
},
|
|
1381
|
+
}, [a]), o ? /* @__PURE__ */ T(ar.Provider, { value: a, children: t }) : null;
|
|
1382
|
+
}, oe = (e, t) => {
|
|
1381
1383
|
const r = _e(ar);
|
|
1382
1384
|
return We(r, e, t || Ve);
|
|
1383
1385
|
}, ns = () => {
|
|
1384
|
-
const [e, t] =
|
|
1386
|
+
const [e, t] = oe((n) => [
|
|
1385
1387
|
n.itemIds,
|
|
1386
1388
|
n.items
|
|
1387
1389
|
]);
|
|
@@ -1390,15 +1392,15 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1390
1392
|
[e, t]
|
|
1391
1393
|
);
|
|
1392
1394
|
}, os = () => {
|
|
1393
|
-
const [e, t, r] =
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1395
|
+
const [e, t, r] = oe((a) => [
|
|
1396
|
+
a.items,
|
|
1397
|
+
a.itemIds,
|
|
1398
|
+
a.getItemList
|
|
1397
1399
|
]), [n, o] = g.useState(r()), [, s] = g.useTransition();
|
|
1398
1400
|
return g.useEffect(() => {
|
|
1399
|
-
const
|
|
1401
|
+
const a = r();
|
|
1400
1402
|
s(() => {
|
|
1401
|
-
o(
|
|
1403
|
+
o(a);
|
|
1402
1404
|
});
|
|
1403
1405
|
}, [e, t, r]), n;
|
|
1404
1406
|
}, cr = 5e4, ur = g.createContext(), mn = (e, t) => ({
|
|
@@ -1438,7 +1440,7 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1438
1440
|
}),
|
|
1439
1441
|
unregister: (r, n) => e((o) => {
|
|
1440
1442
|
const s = (o.interactions[r] || []).filter(
|
|
1441
|
-
(
|
|
1443
|
+
(a) => a !== n
|
|
1442
1444
|
);
|
|
1443
1445
|
return {
|
|
1444
1446
|
interactions: { ...o.interactions, [r]: s }
|
|
@@ -1446,7 +1448,7 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1446
1448
|
}),
|
|
1447
1449
|
callInteractions: (r, n) => {
|
|
1448
1450
|
t().interactions[r] && t().interactions[r].forEach((o) => {
|
|
1449
|
-
o(n);
|
|
1451
|
+
setTimeout(() => o(n), 0);
|
|
1450
1452
|
});
|
|
1451
1453
|
}
|
|
1452
1454
|
}), vn = (e, t) => ({
|
|
@@ -1479,11 +1481,11 @@ const ar = g.createContext(), un = (e, t) => ({
|
|
|
1479
1481
|
}))
|
|
1480
1482
|
);
|
|
1481
1483
|
return /* @__PURE__ */ T(ur.Provider, { value: t, children: e });
|
|
1482
|
-
},
|
|
1484
|
+
}, Q = (e, t) => {
|
|
1483
1485
|
const r = _e(ur);
|
|
1484
1486
|
return We(r, e, t || Ve);
|
|
1485
1487
|
}, ss = () => {
|
|
1486
|
-
const [e] =
|
|
1488
|
+
const [e] = Q((t) => [t.selection]);
|
|
1487
1489
|
return e;
|
|
1488
1490
|
};
|
|
1489
1491
|
function pt(e) {
|
|
@@ -1505,18 +1507,18 @@ function yn(e) {
|
|
|
1505
1507
|
);
|
|
1506
1508
|
}
|
|
1507
1509
|
function mt(e, t, r, n = 0) {
|
|
1508
|
-
const o = Re(), s = Re(),
|
|
1510
|
+
const o = Re(), s = Re(), a = Re(), u = () => {
|
|
1509
1511
|
o.current && (clearTimeout(o.current), o.current = void 0), s.current && (clearTimeout(s.current), s.current = void 0);
|
|
1510
1512
|
};
|
|
1511
1513
|
return yn(u), lt(
|
|
1512
1514
|
() => {
|
|
1513
1515
|
const l = () => {
|
|
1514
|
-
if (!
|
|
1516
|
+
if (!a.current)
|
|
1515
1517
|
return;
|
|
1516
|
-
const f =
|
|
1517
|
-
|
|
1518
|
+
const f = a.current;
|
|
1519
|
+
a.current = void 0, e.apply(f.this, f.args), u();
|
|
1518
1520
|
}, d = function(...f) {
|
|
1519
|
-
o.current && clearTimeout(o.current),
|
|
1521
|
+
o.current && clearTimeout(o.current), a.current = { args: f, this: this }, o.current = setTimeout(l, r), n > 0 && !s.current && (s.current = setTimeout(l, n));
|
|
1520
1522
|
};
|
|
1521
1523
|
return Object.defineProperties(d, {
|
|
1522
1524
|
length: { value: e.length },
|
|
@@ -1534,18 +1536,18 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1534
1536
|
rotate: n,
|
|
1535
1537
|
itemExtent: o,
|
|
1536
1538
|
boardWrapperRect: s,
|
|
1537
|
-
boardSize:
|
|
1539
|
+
boardSize: a
|
|
1538
1540
|
}) => {
|
|
1539
1541
|
let [u, l] = [e, t];
|
|
1540
1542
|
const d = ct(
|
|
1541
1543
|
[s.width / 2, s.height / 2],
|
|
1542
1544
|
{ translateX: u, translateY: l, scale: r, rotate: n }
|
|
1543
1545
|
), f = {
|
|
1544
|
-
x: o.x +
|
|
1545
|
-
y: o.y +
|
|
1546
|
-
},
|
|
1547
|
-
x:
|
|
1548
|
-
y:
|
|
1546
|
+
x: o.x + a / 2,
|
|
1547
|
+
y: o.y + a / 2
|
|
1548
|
+
}, c = {
|
|
1549
|
+
x: a / 2,
|
|
1550
|
+
y: a / 2
|
|
1549
1551
|
}, h = ze(d, [f.x, f.y]), _ = Math.min(s.width, s.height), v = o.radius + _ / 2 / r - Sn / r;
|
|
1550
1552
|
if (h > v) {
|
|
1551
1553
|
const y = Yt(
|
|
@@ -1553,30 +1555,30 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1553
1555
|
f,
|
|
1554
1556
|
f,
|
|
1555
1557
|
v - 1 / r
|
|
1556
|
-
)[0], [
|
|
1558
|
+
)[0], [C, x] = Be([-y.x, -y.y], {
|
|
1557
1559
|
translateX: s.width / 2,
|
|
1558
1560
|
translateY: s.height / 2,
|
|
1559
1561
|
scale: r,
|
|
1560
1562
|
rotate: n
|
|
1561
1563
|
});
|
|
1562
|
-
u =
|
|
1564
|
+
u = C, l = x;
|
|
1563
1565
|
}
|
|
1564
|
-
const E = ze(d, [
|
|
1566
|
+
const E = ze(d, [c.x, c.y]), I = a / 2 - ze([0, 0], [s.width, s.height]) / r;
|
|
1565
1567
|
if (E > I) {
|
|
1566
1568
|
const y = Yt(
|
|
1567
1569
|
{ x: d[0], y: d[1] },
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
+
c,
|
|
1571
|
+
c,
|
|
1570
1572
|
I - 1 / r
|
|
1571
1573
|
)[0];
|
|
1572
1574
|
if (y) {
|
|
1573
|
-
const [
|
|
1575
|
+
const [C, x] = Be([-y.x, -y.y], {
|
|
1574
1576
|
translateX: s.width / 2,
|
|
1575
1577
|
translateY: s.height / 2,
|
|
1576
1578
|
scale: r,
|
|
1577
1579
|
rotate: n
|
|
1578
1580
|
});
|
|
1579
|
-
u =
|
|
1581
|
+
u = C, l = x;
|
|
1580
1582
|
}
|
|
1581
1583
|
}
|
|
1582
1584
|
return [u, l];
|
|
@@ -1587,25 +1589,25 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1587
1589
|
r,
|
|
1588
1590
|
n,
|
|
1589
1591
|
o
|
|
1590
|
-
] =
|
|
1592
|
+
] = Q((p) => [
|
|
1591
1593
|
p.getBoardState,
|
|
1592
1594
|
p.updateBoardState,
|
|
1593
1595
|
p.config.itemExtent,
|
|
1594
1596
|
p.getConfiguration,
|
|
1595
1597
|
p.updateConfiguration
|
|
1596
|
-
]), s = g.useRef([0.15, 5]), [
|
|
1597
|
-
const { translateX: p, translateY:
|
|
1598
|
-
return { translateX: p, translateY:
|
|
1598
|
+
]), s = g.useRef([0.15, 5]), [a] = oe((p) => [p.getItemList]), u = g.useCallback(() => {
|
|
1599
|
+
const { translateX: p, translateY: w, scale: m, rotate: S } = e();
|
|
1600
|
+
return { translateX: p, translateY: w, scale: m, rotate: S };
|
|
1599
1601
|
}, [e]), l = g.useCallback(
|
|
1600
|
-
(p,
|
|
1602
|
+
(p, w) => ct([p, w], e()),
|
|
1601
1603
|
[e]
|
|
1602
1604
|
), d = g.useCallback(
|
|
1603
|
-
(p,
|
|
1605
|
+
(p, w) => Be([p, w], e()),
|
|
1604
1606
|
[e]
|
|
1605
1607
|
), f = g.useCallback(
|
|
1606
|
-
(p,
|
|
1608
|
+
(p, w) => {
|
|
1607
1609
|
const { scale: m, rotate: S } = e();
|
|
1608
|
-
return ct([p,
|
|
1610
|
+
return ct([p, w], {
|
|
1609
1611
|
translateX: 0,
|
|
1610
1612
|
translateY: 0,
|
|
1611
1613
|
rotate: S,
|
|
@@ -1613,40 +1615,40 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1613
1615
|
});
|
|
1614
1616
|
},
|
|
1615
1617
|
[e]
|
|
1616
|
-
),
|
|
1618
|
+
), c = g.useCallback((p) => p > s.current[1] ? s.current[1] : p < s.current[0] ? s.current[0] : p, []), h = g.useCallback(
|
|
1617
1619
|
(p) => {
|
|
1618
|
-
const { itemExtent:
|
|
1620
|
+
const { itemExtent: w, boardWrapperRect: m, boardSize: S } = n(), O = e(), {
|
|
1619
1621
|
translateX: k,
|
|
1620
|
-
translateY:
|
|
1622
|
+
translateY: j,
|
|
1621
1623
|
scale: M,
|
|
1622
|
-
rotate:
|
|
1624
|
+
rotate: A
|
|
1623
1625
|
} = {
|
|
1624
1626
|
...O,
|
|
1625
1627
|
...p(O)
|
|
1626
|
-
}, N =
|
|
1627
|
-
let [U, J] = [k,
|
|
1628
|
-
(k !== O.translateX ||
|
|
1628
|
+
}, N = c(M);
|
|
1629
|
+
let [U, J] = [k, j];
|
|
1630
|
+
(k !== O.translateX || j !== O.translateY) && ([U, J] = En({
|
|
1629
1631
|
x: k,
|
|
1630
|
-
y:
|
|
1632
|
+
y: j,
|
|
1631
1633
|
scale: N,
|
|
1632
|
-
rotate:
|
|
1633
|
-
itemExtent:
|
|
1634
|
+
rotate: A,
|
|
1635
|
+
itemExtent: w,
|
|
1634
1636
|
boardWrapperRect: m,
|
|
1635
1637
|
boardSize: S
|
|
1636
1638
|
})), t({
|
|
1637
1639
|
translateX: U,
|
|
1638
1640
|
translateY: J,
|
|
1639
1641
|
scale: N,
|
|
1640
|
-
rotate:
|
|
1642
|
+
rotate: A
|
|
1641
1643
|
});
|
|
1642
1644
|
},
|
|
1643
|
-
[
|
|
1645
|
+
[c, e, n, t]
|
|
1644
1646
|
), _ = g.useCallback(
|
|
1645
1647
|
(p) => {
|
|
1646
|
-
let
|
|
1647
|
-
typeof p == "function" && (
|
|
1648
|
+
let w = (m) => ({ ...m, ...p });
|
|
1649
|
+
typeof p == "function" && (w = p), h((m) => ({
|
|
1648
1650
|
...m,
|
|
1649
|
-
...
|
|
1651
|
+
...w({
|
|
1650
1652
|
translateX: m.translateX,
|
|
1651
1653
|
translateY: m.translateY
|
|
1652
1654
|
})
|
|
@@ -1654,54 +1656,54 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1654
1656
|
},
|
|
1655
1657
|
[h]
|
|
1656
1658
|
), v = g.useCallback(
|
|
1657
|
-
({ to: p, factor:
|
|
1659
|
+
({ to: p, factor: w }) => {
|
|
1658
1660
|
const { boardWrapperRect: m } = n();
|
|
1659
1661
|
let S = p;
|
|
1660
1662
|
S || (S = {
|
|
1661
1663
|
x: m.left + m.width / 2,
|
|
1662
1664
|
y: m.top + m.height / 2
|
|
1663
1665
|
});
|
|
1664
|
-
const O = e(), k =
|
|
1666
|
+
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;
|
|
1665
1667
|
h((U) => ({
|
|
1666
1668
|
...U,
|
|
1667
|
-
translateX:
|
|
1669
|
+
translateX: A,
|
|
1668
1670
|
translateY: N,
|
|
1669
1671
|
scale: k
|
|
1670
1672
|
}));
|
|
1671
1673
|
},
|
|
1672
|
-
[
|
|
1674
|
+
[c, e, n, h]
|
|
1673
1675
|
), E = g.useCallback(
|
|
1674
|
-
({ x: p, y:
|
|
1675
|
-
const { rotate: S } = e(), { boardWrapperRect: O, boardSize: k } = n(),
|
|
1676
|
-
[-k / 2 - p, -k / 2 -
|
|
1676
|
+
({ 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), A = c(Math.min(j, M) * bn), [N, U] = Be(
|
|
1678
|
+
[-k / 2 - p, -k / 2 - w],
|
|
1677
1679
|
{
|
|
1678
1680
|
translateX: O.width / 2,
|
|
1679
1681
|
translateY: O.height / 2,
|
|
1680
|
-
scale:
|
|
1682
|
+
scale: A,
|
|
1681
1683
|
rotate: S
|
|
1682
1684
|
}
|
|
1683
1685
|
);
|
|
1684
|
-
h((J) => ({ ...J, translateX: N, translateY: U, scale:
|
|
1686
|
+
h((J) => ({ ...J, translateX: N, translateY: U, scale: A }));
|
|
1685
1687
|
},
|
|
1686
|
-
[
|
|
1688
|
+
[c, e, n, h]
|
|
1687
1689
|
), I = g.useCallback(() => {
|
|
1688
|
-
const { boardWrapperRect: p, boardSize:
|
|
1690
|
+
const { boardWrapperRect: p, boardSize: w } = n(), [m, S] = l(
|
|
1689
1691
|
p.width / 2,
|
|
1690
1692
|
p.height / 2
|
|
1691
1693
|
);
|
|
1692
1694
|
return {
|
|
1693
|
-
x: m -
|
|
1694
|
-
y: S -
|
|
1695
|
+
x: m - w / 2,
|
|
1696
|
+
y: S - w / 2
|
|
1695
1697
|
};
|
|
1696
1698
|
}, [l, n]), y = g.useCallback(() => {
|
|
1697
|
-
const p =
|
|
1698
|
-
(k,
|
|
1699
|
-
const M = Ne(
|
|
1700
|
-
return k.left = Math.min(
|
|
1701
|
-
|
|
1699
|
+
const p = a(), { boardWrapper: w, boardSize: m } = n(), S = p.reduce(
|
|
1700
|
+
(k, j) => {
|
|
1701
|
+
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(
|
|
1703
|
+
j.x + M.offsetWidth,
|
|
1702
1704
|
k.right
|
|
1703
1705
|
), k.bottom = Math.max(
|
|
1704
|
-
|
|
1706
|
+
j.y + M.offsetHeight,
|
|
1705
1707
|
k.bottom
|
|
1706
1708
|
), k;
|
|
1707
1709
|
},
|
|
@@ -1719,10 +1721,10 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1719
1721
|
ze([O.x, O.y], [S.left, S.top]),
|
|
1720
1722
|
_n
|
|
1721
1723
|
), o({ itemExtent: O });
|
|
1722
|
-
}, [n,
|
|
1724
|
+
}, [n, a, o]), C = g.useCallback(
|
|
1723
1725
|
(p) => {
|
|
1724
|
-
let
|
|
1725
|
-
typeof p == "function" && (
|
|
1726
|
+
let w = () => p;
|
|
1727
|
+
typeof p == "function" && (w = p), h((m) => ({ ...m, rotate: w(m.rotate) })), y(), E(r);
|
|
1726
1728
|
},
|
|
1727
1729
|
[r, h, y, E]
|
|
1728
1730
|
), x = mt(
|
|
@@ -1732,7 +1734,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1732
1734
|
);
|
|
1733
1735
|
return {
|
|
1734
1736
|
setDim: h,
|
|
1735
|
-
rotateBoard:
|
|
1737
|
+
rotateBoard: C,
|
|
1736
1738
|
moveBoard: _,
|
|
1737
1739
|
getDim: u,
|
|
1738
1740
|
zoomTo: v,
|
|
@@ -1745,26 +1747,26 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1745
1747
|
fromBoardToWrapper: d
|
|
1746
1748
|
};
|
|
1747
1749
|
}, Vt = (e) => {
|
|
1748
|
-
const [t, r, n] =
|
|
1749
|
-
({ register:
|
|
1750
|
-
|
|
1750
|
+
const [t, r, n] = Q(
|
|
1751
|
+
({ register: a, unregister: u, callInteractions: l }) => [
|
|
1752
|
+
a,
|
|
1751
1753
|
u,
|
|
1752
1754
|
l
|
|
1753
1755
|
]
|
|
1754
1756
|
), o = g.useCallback(
|
|
1755
|
-
(
|
|
1756
|
-
r(e,
|
|
1757
|
+
(a) => (t(e, a), () => {
|
|
1758
|
+
r(e, a);
|
|
1757
1759
|
}),
|
|
1758
1760
|
[e, t, r]
|
|
1759
1761
|
), s = g.useCallback(
|
|
1760
|
-
(
|
|
1761
|
-
n(e,
|
|
1762
|
+
(a) => {
|
|
1763
|
+
n(e, a);
|
|
1762
1764
|
},
|
|
1763
1765
|
[n, e]
|
|
1764
1766
|
);
|
|
1765
1767
|
return { register: o, call: s };
|
|
1766
1768
|
}, gt = () => {
|
|
1767
|
-
const { call: e } = Vt("place"), { call: t } = Vt("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s,
|
|
1769
|
+
const { call: e } = Vt("place"), { call: t } = Vt("delete"), { getCenter: r, updateItemExtent: n } = Me(), [o, s, a, u] = Q((P) => [
|
|
1768
1770
|
P.clear,
|
|
1769
1771
|
P.reverse,
|
|
1770
1772
|
P.unselect,
|
|
@@ -1773,52 +1775,56 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1773
1775
|
getItems: l,
|
|
1774
1776
|
getItemIds: d,
|
|
1775
1777
|
setItemIds: f,
|
|
1776
|
-
updateItems:
|
|
1778
|
+
updateItems: c,
|
|
1777
1779
|
moveItems: h,
|
|
1778
1780
|
removeItemsById: _,
|
|
1779
1781
|
getItemList: v,
|
|
1780
1782
|
insertItems: E,
|
|
1781
1783
|
setItemList: I
|
|
1782
|
-
} =
|
|
1784
|
+
} = oe(
|
|
1783
1785
|
({
|
|
1784
1786
|
getItems: P,
|
|
1785
1787
|
getItemIds: $,
|
|
1786
|
-
setItemIds:
|
|
1788
|
+
setItemIds: z,
|
|
1787
1789
|
updateItems: V,
|
|
1788
|
-
moveItems:
|
|
1789
|
-
removeItemsById:
|
|
1790
|
-
getItemList:
|
|
1791
|
-
insertItems:
|
|
1792
|
-
setItemList:
|
|
1790
|
+
moveItems: Y,
|
|
1791
|
+
removeItemsById: F,
|
|
1792
|
+
getItemList: H,
|
|
1793
|
+
insertItems: te,
|
|
1794
|
+
setItemList: Z
|
|
1793
1795
|
}) => ({
|
|
1794
1796
|
getItems: P,
|
|
1795
1797
|
getItemIds: $,
|
|
1796
|
-
setItemIds:
|
|
1798
|
+
setItemIds: z,
|
|
1797
1799
|
updateItems: V,
|
|
1798
|
-
moveItems:
|
|
1799
|
-
removeItemsById:
|
|
1800
|
-
getItemList:
|
|
1801
|
-
insertItems:
|
|
1802
|
-
setItemList:
|
|
1800
|
+
moveItems: Y,
|
|
1801
|
+
removeItemsById: F,
|
|
1802
|
+
getItemList: H,
|
|
1803
|
+
insertItems: te,
|
|
1804
|
+
setItemList: Z
|
|
1803
1805
|
})
|
|
1804
1806
|
), y = g.useCallback(
|
|
1805
|
-
(P,
|
|
1806
|
-
let
|
|
1807
|
-
typeof $ == "object" && (
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1807
|
+
(P, $, z = !1) => {
|
|
1808
|
+
let V = $;
|
|
1809
|
+
typeof $ == "object" && (V = () => $);
|
|
1810
|
+
const Y = d().filter((Z) => P.includes(Z)), F = l(), H = Y.map((Z) => {
|
|
1811
|
+
const ne = F[Z];
|
|
1812
|
+
return z ? [Z, V(ne)] : [Z, V({ ...ne })];
|
|
1813
|
+
}).filter(([, Z]) => Z);
|
|
1814
|
+
if (H.length === 0)
|
|
1815
|
+
return;
|
|
1816
|
+
const te = Object.fromEntries(H);
|
|
1817
|
+
c(te, z), n();
|
|
1812
1818
|
},
|
|
1813
|
-
[d, l, n,
|
|
1814
|
-
),
|
|
1819
|
+
[d, l, n, c]
|
|
1820
|
+
), C = g.useCallback(
|
|
1815
1821
|
(P) => {
|
|
1816
1822
|
I(P), o(), n();
|
|
1817
1823
|
},
|
|
1818
1824
|
[o, I, n]
|
|
1819
1825
|
), x = g.useCallback(
|
|
1820
|
-
(P,
|
|
1821
|
-
y([P],
|
|
1826
|
+
(P, $, z = !1) => {
|
|
1827
|
+
y([P], $, z);
|
|
1822
1828
|
},
|
|
1823
1829
|
[y]
|
|
1824
1830
|
), p = g.useCallback(
|
|
@@ -1829,57 +1835,58 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1829
1835
|
), n();
|
|
1830
1836
|
},
|
|
1831
1837
|
[d, l, h, n]
|
|
1832
|
-
),
|
|
1838
|
+
), w = g.useCallback(
|
|
1833
1839
|
(P) => {
|
|
1834
|
-
const $ = d(),
|
|
1835
|
-
(
|
|
1840
|
+
const $ = d(), z = $.filter((Y) => !P.includes(Y)), V = $.filter(
|
|
1841
|
+
(Y) => P.includes(Y)
|
|
1836
1842
|
);
|
|
1837
|
-
f([...
|
|
1843
|
+
f([...z, ...V]);
|
|
1838
1844
|
},
|
|
1839
1845
|
[d, f]
|
|
1840
1846
|
), m = g.useCallback(
|
|
1841
|
-
(P, { type: $, size:
|
|
1847
|
+
(P, { type: $, size: z } = {}) => {
|
|
1842
1848
|
const { boardWrapper: V } = u();
|
|
1843
|
-
y(
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1849
|
+
y(
|
|
1850
|
+
P,
|
|
1851
|
+
(Y) => {
|
|
1852
|
+
const F = Ne(V, Y.id);
|
|
1853
|
+
if (!F)
|
|
1854
|
+
return;
|
|
1855
|
+
const H = {
|
|
1856
|
+
type: $ || "grid",
|
|
1857
|
+
size: z || 1,
|
|
1858
|
+
offset: { x: 0, y: 0 },
|
|
1859
|
+
...Y.grid
|
|
1860
|
+
};
|
|
1861
|
+
return an(
|
|
1862
|
+
{
|
|
1863
|
+
x: Y.x,
|
|
1864
|
+
y: Y.y,
|
|
1865
|
+
width: F.clientWidth,
|
|
1866
|
+
height: F.clientHeight
|
|
1867
|
+
},
|
|
1868
|
+
H
|
|
1869
|
+
);
|
|
1870
|
+
},
|
|
1871
|
+
!0
|
|
1872
|
+
);
|
|
1863
1873
|
},
|
|
1864
1874
|
[u, y]
|
|
1865
1875
|
), S = g.useCallback(
|
|
1866
1876
|
(P, $) => {
|
|
1867
|
-
const
|
|
1877
|
+
const z = Bt(
|
|
1868
1878
|
l(),
|
|
1869
1879
|
d(),
|
|
1870
1880
|
P
|
|
1871
1881
|
);
|
|
1872
|
-
|
|
1873
|
-
const A = { ...V };
|
|
1874
|
-
return delete A.moving, A;
|
|
1875
|
-
}), m(B, $), e(P), n();
|
|
1882
|
+
w(z), y(z, { moving: !1 }, !0), m(z, $), e(P), n();
|
|
1876
1883
|
},
|
|
1877
1884
|
[
|
|
1878
1885
|
y,
|
|
1879
1886
|
e,
|
|
1880
1887
|
d,
|
|
1881
1888
|
l,
|
|
1882
|
-
|
|
1889
|
+
w,
|
|
1883
1890
|
m,
|
|
1884
1891
|
n
|
|
1885
1892
|
]
|
|
@@ -1890,93 +1897,97 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1890
1897
|
[f]
|
|
1891
1898
|
), k = g.useCallback(
|
|
1892
1899
|
(P) => {
|
|
1893
|
-
const $ = d(),
|
|
1894
|
-
(
|
|
1895
|
-
), V = $.map((
|
|
1900
|
+
const $ = d(), z = $.filter(
|
|
1901
|
+
(Y) => P.includes(Y)
|
|
1902
|
+
), V = $.map((Y) => P.includes(Y) ? z.pop() : Y);
|
|
1896
1903
|
f(V), s();
|
|
1897
1904
|
},
|
|
1898
1905
|
[d, s, f]
|
|
1899
|
-
),
|
|
1906
|
+
), j = g.useCallback(
|
|
1900
1907
|
(P, $) => {
|
|
1901
|
-
const
|
|
1902
|
-
$.map((
|
|
1903
|
-
const
|
|
1908
|
+
const z = l(), V = Object.fromEntries(
|
|
1909
|
+
$.map((H, te) => {
|
|
1910
|
+
const Z = z[P[te]];
|
|
1904
1911
|
return [
|
|
1905
|
-
|
|
1912
|
+
H,
|
|
1906
1913
|
{
|
|
1907
|
-
x:
|
|
1908
|
-
y:
|
|
1914
|
+
x: Z.x,
|
|
1915
|
+
y: Z.y
|
|
1909
1916
|
}
|
|
1910
1917
|
];
|
|
1911
1918
|
})
|
|
1912
1919
|
);
|
|
1913
|
-
y(
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1920
|
+
y(
|
|
1921
|
+
P,
|
|
1922
|
+
(H) => V[H.id],
|
|
1923
|
+
!0
|
|
1924
|
+
);
|
|
1925
|
+
const Y = Object.fromEntries(
|
|
1926
|
+
P.map((H, te) => [H, $[te]])
|
|
1927
|
+
), F = d().map((H) => P.includes(H) ? Y[H] : H);
|
|
1928
|
+
f(F);
|
|
1918
1929
|
},
|
|
1919
1930
|
[l, y, d, f]
|
|
1920
1931
|
), M = g.useCallback(
|
|
1921
1932
|
(P, $) => {
|
|
1922
|
-
const
|
|
1933
|
+
const z = r(), V = P.map((Y, F) => !Y.x || !Y.y ? { ...Y, x: z.x + 2 * F, y: z.y + 2 * F } : Y);
|
|
1923
1934
|
E(V, $), n();
|
|
1924
1935
|
},
|
|
1925
1936
|
[r, E, n]
|
|
1926
|
-
),
|
|
1937
|
+
), A = g.useCallback(
|
|
1927
1938
|
(P, $) => {
|
|
1928
1939
|
M([P], $);
|
|
1929
1940
|
},
|
|
1930
1941
|
[M]
|
|
1931
1942
|
), N = g.useCallback(
|
|
1932
1943
|
(P) => {
|
|
1933
|
-
|
|
1944
|
+
a(P), _(P), t(P);
|
|
1934
1945
|
},
|
|
1935
|
-
[
|
|
1946
|
+
[a, _, t]
|
|
1936
1947
|
), U = g.useCallback(
|
|
1937
1948
|
(P) => {
|
|
1938
1949
|
const $ = l();
|
|
1939
|
-
return P.map((
|
|
1950
|
+
return P.map((z) => $[z]);
|
|
1940
1951
|
},
|
|
1941
1952
|
[l]
|
|
1942
1953
|
), J = g.useCallback(
|
|
1943
|
-
({ target: P, clientX: $, clientY:
|
|
1954
|
+
({ target: P, clientX: $, clientY: z }, { returnLocked: V = !1, passLocked: Y = !1 } = {}) => {
|
|
1944
1955
|
if (["INPUT", "TEXTAREA"].includes(P.tagName))
|
|
1945
1956
|
return null;
|
|
1946
|
-
const
|
|
1947
|
-
if (
|
|
1948
|
-
if (ye(
|
|
1949
|
-
return
|
|
1950
|
-
if (!
|
|
1951
|
-
return V ?
|
|
1957
|
+
const F = Oe(P, "item");
|
|
1958
|
+
if (F) {
|
|
1959
|
+
if (ye(F, "selected"))
|
|
1960
|
+
return F;
|
|
1961
|
+
if (!Y && ye(F, "locked") && !ye(P, "passthrough"))
|
|
1962
|
+
return V ? F : null;
|
|
1952
1963
|
if (ye(P, "passthrough")) {
|
|
1953
|
-
const
|
|
1954
|
-
const me = Ne(
|
|
1955
|
-
return ft({ x: $, y:
|
|
1964
|
+
const H = d(), { boardWrapper: te } = u(), Z = H.reduce((ne, ie) => {
|
|
1965
|
+
const me = Ne(te, ie), ge = me.getBoundingClientRect();
|
|
1966
|
+
return ft({ x: $, y: z }, ge) && ne.unshift(me), ne;
|
|
1956
1967
|
}, []);
|
|
1957
|
-
for (let
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
1960
|
-
return
|
|
1968
|
+
for (let ne = 0; ne < Z.length; ne += 1) {
|
|
1969
|
+
const ie = Z[ne];
|
|
1970
|
+
if (ie !== F && (Y || !ye(ie, "locked")))
|
|
1971
|
+
return ie;
|
|
1961
1972
|
}
|
|
1962
1973
|
return null;
|
|
1963
1974
|
}
|
|
1964
1975
|
}
|
|
1965
|
-
return
|
|
1976
|
+
return F;
|
|
1966
1977
|
},
|
|
1967
1978
|
[u, d]
|
|
1968
1979
|
);
|
|
1969
1980
|
return {
|
|
1970
|
-
putItemsOnTop:
|
|
1981
|
+
putItemsOnTop: w,
|
|
1971
1982
|
batchUpdateItems: y,
|
|
1972
1983
|
updateItemOrder: O,
|
|
1973
1984
|
moveItems: p,
|
|
1974
1985
|
placeItems: S,
|
|
1975
1986
|
updateItem: x,
|
|
1976
|
-
swapItems:
|
|
1987
|
+
swapItems: j,
|
|
1977
1988
|
reverseItemsOrder: k,
|
|
1978
|
-
setItemList:
|
|
1979
|
-
pushItem:
|
|
1989
|
+
setItemList: C,
|
|
1990
|
+
pushItem: A,
|
|
1980
1991
|
pushItems: M,
|
|
1981
1992
|
removeItems: N,
|
|
1982
1993
|
getItemList: v,
|
|
@@ -1984,7 +1995,7 @@ const Sn = 100, _n = 1e3, bn = 0.8, En = ({
|
|
|
1984
1995
|
getItems: U
|
|
1985
1996
|
};
|
|
1986
1997
|
};
|
|
1987
|
-
var
|
|
1998
|
+
var wn = function e(t, r) {
|
|
1988
1999
|
if (t === r)
|
|
1989
2000
|
return !0;
|
|
1990
2001
|
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
@@ -2038,15 +2049,15 @@ var Cn = function e(t, r) {
|
|
|
2038
2049
|
if (!Object.prototype.hasOwnProperty.call(r, s[o]))
|
|
2039
2050
|
return !1;
|
|
2040
2051
|
for (o = n; o-- !== 0; ) {
|
|
2041
|
-
var
|
|
2042
|
-
if (!e(t[
|
|
2052
|
+
var a = s[o];
|
|
2053
|
+
if (!e(t[a], r[a]))
|
|
2043
2054
|
return !1;
|
|
2044
2055
|
}
|
|
2045
2056
|
return !0;
|
|
2046
2057
|
}
|
|
2047
2058
|
return t !== t && r !== r;
|
|
2048
2059
|
};
|
|
2049
|
-
function
|
|
2060
|
+
function Cn(e, t, r, n = 0) {
|
|
2050
2061
|
Pe(mt(e, t, r, n), t);
|
|
2051
2062
|
}
|
|
2052
2063
|
const xn = (e, t) => {
|
|
@@ -2059,46 +2070,46 @@ const xn = (e, t) => {
|
|
|
2059
2070
|
const { actions: r = xn(e, t) } = e;
|
|
2060
2071
|
return r.map((n) => typeof n == "string" ? { name: n } : n);
|
|
2061
2072
|
}, is = () => {
|
|
2062
|
-
const [e, t] =
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
]), [r, n, o] =
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
]), [s,
|
|
2073
|
+
const [e, t] = oe((c) => [
|
|
2074
|
+
c.items,
|
|
2075
|
+
c.getItems
|
|
2076
|
+
]), [r, n, o] = Q((c) => [
|
|
2077
|
+
c.config.itemTemplates,
|
|
2078
|
+
c.selection,
|
|
2079
|
+
c.getSelection
|
|
2080
|
+
]), [s, a] = g.useState([]), u = g.useRef(!1), [, l] = g.useTransition();
|
|
2070
2081
|
g.useEffect(() => (u.current = !0, () => {
|
|
2071
2082
|
u.current = !1;
|
|
2072
2083
|
}), []);
|
|
2073
2084
|
const d = g.useCallback(
|
|
2074
|
-
(
|
|
2085
|
+
(c) => {
|
|
2075
2086
|
const h = t();
|
|
2076
|
-
if (
|
|
2077
|
-
return [
|
|
2087
|
+
if (c)
|
|
2088
|
+
return [c, c.map((v) => h[v])];
|
|
2078
2089
|
const _ = o();
|
|
2079
2090
|
return [_, _.map((v) => h[v])];
|
|
2080
2091
|
},
|
|
2081
2092
|
[t, o]
|
|
2082
2093
|
), f = tr(() => {
|
|
2083
|
-
const [
|
|
2084
|
-
if (
|
|
2094
|
+
const [c, h] = d();
|
|
2095
|
+
if (c.length > 0) {
|
|
2085
2096
|
if (!u.current)
|
|
2086
2097
|
return;
|
|
2087
2098
|
const _ = h.reduce((v, E) => {
|
|
2088
2099
|
const I = Ft(E, r);
|
|
2089
2100
|
return v.filter(
|
|
2090
|
-
(y) => I.some((
|
|
2101
|
+
(y) => I.some((C) => wn(y, C))
|
|
2091
2102
|
);
|
|
2092
2103
|
}, Ft(h[0], r));
|
|
2093
2104
|
l(() => {
|
|
2094
|
-
|
|
2105
|
+
a(_);
|
|
2095
2106
|
});
|
|
2096
2107
|
} else
|
|
2097
2108
|
l(() => {
|
|
2098
|
-
|
|
2109
|
+
a([]);
|
|
2099
2110
|
});
|
|
2100
2111
|
}, [d, r]);
|
|
2101
|
-
return
|
|
2112
|
+
return Cn(
|
|
2102
2113
|
() => f(),
|
|
2103
2114
|
[e, n, f],
|
|
2104
2115
|
100
|
|
@@ -2106,7 +2117,7 @@ const xn = (e, t) => {
|
|
|
2106
2117
|
availableActions: s
|
|
2107
2118
|
};
|
|
2108
2119
|
}, as = () => {
|
|
2109
|
-
const [e] =
|
|
2120
|
+
const [e] = Q((t) => [t.selectionBox]);
|
|
2110
2121
|
return e;
|
|
2111
2122
|
};
|
|
2112
2123
|
let pe = (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), "");
|
|
@@ -2144,16 +2155,16 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2144
2155
|
updateUser: (n, o) => t((s) => {
|
|
2145
2156
|
if (!s.users[n])
|
|
2146
2157
|
return {};
|
|
2147
|
-
const
|
|
2158
|
+
const a = {
|
|
2148
2159
|
...s.users[n],
|
|
2149
2160
|
...o,
|
|
2150
2161
|
id: n,
|
|
2151
2162
|
uid: s.users[n].uid
|
|
2152
2163
|
};
|
|
2153
|
-
return
|
|
2164
|
+
return a.id === e && ut(a), setTimeout(() => r().electSpaceMaster(), 100), {
|
|
2154
2165
|
users: {
|
|
2155
2166
|
...s.users,
|
|
2156
|
-
[n]:
|
|
2167
|
+
[n]: a
|
|
2157
2168
|
}
|
|
2158
2169
|
};
|
|
2159
2170
|
}),
|
|
@@ -2169,8 +2180,8 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2169
2180
|
uid: null,
|
|
2170
2181
|
timestamp: Date.now()
|
|
2171
2182
|
};
|
|
2172
|
-
Object.values(n).forEach(({ spaceJoinedTimestamp: s, id:
|
|
2173
|
-
s < o.timestamp && (o.id =
|
|
2183
|
+
Object.values(n).forEach(({ spaceJoinedTimestamp: s, id: a }) => {
|
|
2184
|
+
s < o.timestamp && (o.id = a, o.timestamp = s);
|
|
2174
2185
|
}), t({ isSpaceMaster: o.id === e });
|
|
2175
2186
|
}
|
|
2176
2187
|
}), On = (e) => ({
|
|
@@ -2181,7 +2192,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2181
2192
|
return delete n[t], { cursors: n };
|
|
2182
2193
|
})
|
|
2183
2194
|
}), fr = ({ storeName: e, children: t }) => {
|
|
2184
|
-
const { wire: r, isMaster: n } = Xe("room"), [o, s] = g.useState(null), [
|
|
2195
|
+
const { wire: r, isMaster: n } = Xe("room"), [o, s] = g.useState(null), [a, u] = g.useState(!1), l = g.useRef(!1);
|
|
2185
2196
|
return g.useEffect(() => {
|
|
2186
2197
|
let d = !0;
|
|
2187
2198
|
const f = [];
|
|
@@ -2229,7 +2240,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2229
2240
|
}
|
|
2230
2241
|
}, [n, o, r]), g.useEffect(() => {
|
|
2231
2242
|
n && o && o.getState().updateCurrentUser({ isMaster: n });
|
|
2232
|
-
}, [n, o, r]),
|
|
2243
|
+
}, [n, o, r]), a ? /* @__PURE__ */ T(lr.Provider, { value: o, children: t }) : null;
|
|
2233
2244
|
}, Se = (e, t) => {
|
|
2234
2245
|
const r = _e(lr);
|
|
2235
2246
|
return We(r, e, t || Ve);
|
|
@@ -2240,7 +2251,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2240
2251
|
u.users,
|
|
2241
2252
|
u.updateCurrentUser,
|
|
2242
2253
|
u.joinSpace
|
|
2243
|
-
]), s = g.useMemo(() => Object.values(r), [r]),
|
|
2254
|
+
]), s = g.useMemo(() => Object.values(r), [r]), a = g.useMemo(() => {
|
|
2244
2255
|
const { space: u } = t;
|
|
2245
2256
|
return s.filter(({ space: l }) => l === u);
|
|
2246
2257
|
}, [t, s]);
|
|
@@ -2249,27 +2260,27 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2249
2260
|
currentUser: t,
|
|
2250
2261
|
updateCurrentUser: n,
|
|
2251
2262
|
users: s,
|
|
2252
|
-
localUsers:
|
|
2263
|
+
localUsers: a,
|
|
2253
2264
|
joinSpace: o
|
|
2254
2265
|
};
|
|
2255
2266
|
}, us = () => {
|
|
2256
|
-
const [e, t, r] =
|
|
2267
|
+
const [e, t, r] = oe(
|
|
2257
2268
|
(o) => [o.boardConfig, o.getBoardConfig, o.setBoardConfig]
|
|
2258
2269
|
), n = g.useCallback(
|
|
2259
2270
|
(o) => {
|
|
2260
2271
|
let s = o;
|
|
2261
2272
|
typeof o == "object" && (s = () => o);
|
|
2262
|
-
const
|
|
2273
|
+
const a = t(), u = s(a);
|
|
2263
2274
|
r(u);
|
|
2264
2275
|
},
|
|
2265
2276
|
[t, r]
|
|
2266
2277
|
);
|
|
2267
2278
|
return [e, n];
|
|
2268
2279
|
}, ls = () => {
|
|
2269
|
-
const [e] =
|
|
2280
|
+
const [e] = Q((t) => [t.boardState]);
|
|
2270
2281
|
return e;
|
|
2271
2282
|
}, fs = () => {
|
|
2272
|
-
const [e, t, r, n] =
|
|
2283
|
+
const [e, t, r, n] = oe((o) => [
|
|
2273
2284
|
o.getSessionInfo,
|
|
2274
2285
|
o.setSessionInfo,
|
|
2275
2286
|
o.updateSessionInfo,
|
|
@@ -2324,17 +2335,17 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2324
2335
|
return We(r, e, t || Ve);
|
|
2325
2336
|
}, Mn = () => {
|
|
2326
2337
|
}, ds = (e = Mn) => {
|
|
2327
|
-
const t = Se((
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2338
|
+
const t = Se((a) => a.getUser()), [r, n, o] = Pn((a) => [
|
|
2339
|
+
a.messages,
|
|
2340
|
+
a.setMessages,
|
|
2341
|
+
a.sendMessage
|
|
2331
2342
|
]);
|
|
2332
2343
|
g.useEffect(() => {
|
|
2333
2344
|
r.length && e();
|
|
2334
2345
|
}, [r, e]);
|
|
2335
2346
|
const s = g.useCallback(
|
|
2336
|
-
(
|
|
2337
|
-
o(t,
|
|
2347
|
+
(a) => {
|
|
2348
|
+
o(t, a);
|
|
2338
2349
|
},
|
|
2339
2350
|
[t, o]
|
|
2340
2351
|
);
|
|
@@ -2351,11 +2362,11 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2351
2362
|
items: n = [],
|
|
2352
2363
|
messages: o = [],
|
|
2353
2364
|
LoadingComponent: s,
|
|
2354
|
-
...
|
|
2365
|
+
...a
|
|
2355
2366
|
}) => {
|
|
2356
2367
|
const [u] = g.useState(t || pe()), [l] = g.useState(r || pe()), [d] = g.useState(() => ({
|
|
2357
|
-
itemIds: n.map(({ id:
|
|
2358
|
-
items: Object.fromEntries(n.map((
|
|
2368
|
+
itemIds: n.map(({ id: c }) => c),
|
|
2369
|
+
items: Object.fromEntries(n.map((c) => [c.id, c]))
|
|
2359
2370
|
}));
|
|
2360
2371
|
return Xe("room") ? /* @__PURE__ */ T(
|
|
2361
2372
|
Kt,
|
|
@@ -2367,7 +2378,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2367
2378
|
{
|
|
2368
2379
|
storeName: `${l}_item`,
|
|
2369
2380
|
defaultValue: d,
|
|
2370
|
-
children: /* @__PURE__ */ T(Ht, { ...
|
|
2381
|
+
children: /* @__PURE__ */ T(Ht, { ...a, session: l })
|
|
2371
2382
|
}
|
|
2372
2383
|
) })
|
|
2373
2384
|
}
|
|
@@ -2388,7 +2399,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2388
2399
|
{
|
|
2389
2400
|
storeName: `${l}_item`,
|
|
2390
2401
|
defaultValue: d,
|
|
2391
|
-
children: /* @__PURE__ */ T(Ht, { ...
|
|
2402
|
+
children: /* @__PURE__ */ T(Ht, { ...a, session: l })
|
|
2392
2403
|
}
|
|
2393
2404
|
) })
|
|
2394
2405
|
}
|
|
@@ -2410,7 +2421,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2410
2421
|
}, nt = () => {
|
|
2411
2422
|
const e = navigator.userAgent.toLowerCase();
|
|
2412
2423
|
return /mac os ?x 10/.test(e);
|
|
2413
|
-
},
|
|
2424
|
+
}, jn = () => {
|
|
2414
2425
|
const e = document.createElement("iframe");
|
|
2415
2426
|
e.src = "#", document.body.appendChild(e);
|
|
2416
2427
|
const t = e.contentWindow.document;
|
|
@@ -2419,7 +2430,7 @@ const lr = g.createContext(), ut = (e) => {
|
|
|
2419
2430
|
), t.close();
|
|
2420
2431
|
const r = t.body.firstElementChild.offsetHeight;
|
|
2421
2432
|
return document.body.removeChild(e), r;
|
|
2422
|
-
},
|
|
2433
|
+
}, Dn = jn(), $n = 800, qt = (e, t) => {
|
|
2423
2434
|
const r = Object.keys(e).map((n) => Number(n)).find((n) => n !== t);
|
|
2424
2435
|
return e[r];
|
|
2425
2436
|
}, Gt = ([e, t], [r, n]) => {
|
|
@@ -2446,43 +2457,43 @@ class zn {
|
|
|
2446
2457
|
});
|
|
2447
2458
|
}
|
|
2448
2459
|
}
|
|
2449
|
-
const
|
|
2460
|
+
const se = new zn(), Fe = ({
|
|
2450
2461
|
children: e,
|
|
2451
2462
|
onDrag: t = de,
|
|
2452
2463
|
onDragStart: r = de,
|
|
2453
2464
|
onDragEnd: n = de,
|
|
2454
2465
|
onPan: o = de,
|
|
2455
2466
|
onTap: s = de,
|
|
2456
|
-
onLongTap:
|
|
2467
|
+
onLongTap: a = de,
|
|
2457
2468
|
onDoubleTap: u = de,
|
|
2458
2469
|
onZoom: l,
|
|
2459
2470
|
mainAction: d = "drag"
|
|
2460
2471
|
}) => {
|
|
2461
|
-
const f = g.useRef(null),
|
|
2472
|
+
const f = g.useRef(null), c = g.useRef({
|
|
2462
2473
|
moving: !1,
|
|
2463
2474
|
pointers: {},
|
|
2464
2475
|
mainPointer: void 0
|
|
2465
2476
|
}), h = (y) => {
|
|
2466
2477
|
const {
|
|
2467
|
-
deltaX:
|
|
2478
|
+
deltaX: C,
|
|
2468
2479
|
deltaY: x,
|
|
2469
2480
|
clientX: p,
|
|
2470
|
-
clientY:
|
|
2481
|
+
clientY: w,
|
|
2471
2482
|
deltaMode: m,
|
|
2472
2483
|
ctrlKey: S,
|
|
2473
2484
|
altKey: O,
|
|
2474
2485
|
metaKey: k,
|
|
2475
|
-
target:
|
|
2486
|
+
target: j
|
|
2476
2487
|
} = y;
|
|
2477
2488
|
if (!(O || S && !nt()))
|
|
2478
2489
|
if (nt() && !S)
|
|
2479
|
-
|
|
2480
|
-
deltaX: -2 *
|
|
2490
|
+
se.add(o, {
|
|
2491
|
+
deltaX: -2 * C,
|
|
2481
2492
|
deltaY: -2 * x,
|
|
2482
2493
|
button: 1,
|
|
2483
2494
|
ctrlKey: S,
|
|
2484
2495
|
metaKey: k,
|
|
2485
|
-
target:
|
|
2496
|
+
target: j,
|
|
2486
2497
|
event: y
|
|
2487
2498
|
});
|
|
2488
2499
|
else {
|
|
@@ -2491,241 +2502,241 @@ const ne = new zn(), Fe = ({
|
|
|
2491
2502
|
let M = x;
|
|
2492
2503
|
switch (m) {
|
|
2493
2504
|
case 1:
|
|
2494
|
-
M *=
|
|
2505
|
+
M *= Dn;
|
|
2495
2506
|
break;
|
|
2496
2507
|
case 2:
|
|
2497
2508
|
M *= $n;
|
|
2498
2509
|
break;
|
|
2499
2510
|
}
|
|
2500
|
-
nt() && (M *= 2),
|
|
2511
|
+
nt() && (M *= 2), se.add(l, { scale: M, clientX: p, clientY: w, event: y });
|
|
2501
2512
|
}
|
|
2502
2513
|
}, _ = (y) => {
|
|
2503
2514
|
const {
|
|
2504
|
-
target:
|
|
2515
|
+
target: C,
|
|
2505
2516
|
button: x,
|
|
2506
2517
|
clientX: p,
|
|
2507
|
-
clientY:
|
|
2518
|
+
clientY: w,
|
|
2508
2519
|
pointerId: m,
|
|
2509
2520
|
altKey: S,
|
|
2510
2521
|
ctrlKey: O,
|
|
2511
2522
|
metaKey: k,
|
|
2512
|
-
isPrimary:
|
|
2523
|
+
isPrimary: j
|
|
2513
2524
|
} = y;
|
|
2514
|
-
if (
|
|
2515
|
-
if (
|
|
2525
|
+
if (c.current.pointers[m] = { clientX: p, clientY: w }, j && (c.current.mainPointer = void 0), c.current.mainPointer !== void 0) {
|
|
2526
|
+
if (c.current.mainPointer !== m)
|
|
2516
2527
|
try {
|
|
2517
|
-
const { clientX: M, clientY:
|
|
2518
|
-
|
|
2528
|
+
const { clientX: M, clientY: A } = qt(
|
|
2529
|
+
c.current.pointers,
|
|
2519
2530
|
m
|
|
2520
|
-
), N = (M + p) / 2, U = (
|
|
2521
|
-
[M,
|
|
2522
|
-
[p,
|
|
2531
|
+
), N = (M + p) / 2, U = (A + w) / 2, J = Gt(
|
|
2532
|
+
[M, A],
|
|
2533
|
+
[p, w]
|
|
2523
2534
|
);
|
|
2524
|
-
Object.assign(
|
|
2535
|
+
Object.assign(c.current, {
|
|
2525
2536
|
pressed: !0,
|
|
2526
2537
|
moving: !1,
|
|
2527
2538
|
gestureStart: !1,
|
|
2528
2539
|
startX: p,
|
|
2529
|
-
startY:
|
|
2540
|
+
startY: w,
|
|
2530
2541
|
prevX: N,
|
|
2531
2542
|
prevY: U,
|
|
2532
2543
|
startDistance: J,
|
|
2533
2544
|
prevDistance: J
|
|
2534
2545
|
});
|
|
2535
2546
|
} catch (M) {
|
|
2536
|
-
console.log("Error while getting other pointer. Ignoring", M),
|
|
2547
|
+
console.log("Error while getting other pointer. Ignoring", M), c.current.mainPointer;
|
|
2537
2548
|
}
|
|
2538
2549
|
return;
|
|
2539
2550
|
}
|
|
2540
|
-
|
|
2551
|
+
c.current.mainPointer = m, Object.assign(c.current, {
|
|
2541
2552
|
pressed: !0,
|
|
2542
2553
|
moving: !1,
|
|
2543
2554
|
gestureStart: !1,
|
|
2544
2555
|
startX: p,
|
|
2545
|
-
startY:
|
|
2556
|
+
startY: w,
|
|
2546
2557
|
prevX: p,
|
|
2547
|
-
prevY:
|
|
2558
|
+
prevY: w,
|
|
2548
2559
|
currentButton: x,
|
|
2549
2560
|
pointerDownEvent: y,
|
|
2550
2561
|
startDistance: 0,
|
|
2551
2562
|
prevDistance: 0,
|
|
2552
|
-
target:
|
|
2563
|
+
target: C,
|
|
2553
2564
|
timeStart: Date.now(),
|
|
2554
2565
|
longTapTimeout: setTimeout(async () => {
|
|
2555
|
-
|
|
2566
|
+
c.current.noTap = !0, se.add(a, {
|
|
2556
2567
|
clientX: p,
|
|
2557
|
-
clientY:
|
|
2568
|
+
clientY: w,
|
|
2558
2569
|
altKey: S,
|
|
2559
2570
|
ctrlKey: O,
|
|
2560
2571
|
metaKey: k,
|
|
2561
|
-
target:
|
|
2572
|
+
target: C,
|
|
2562
2573
|
event: y
|
|
2563
2574
|
});
|
|
2564
2575
|
}, 750)
|
|
2565
2576
|
});
|
|
2566
2577
|
try {
|
|
2567
|
-
|
|
2578
|
+
C.setPointerCapture(m);
|
|
2568
2579
|
} catch (M) {
|
|
2569
2580
|
console.log("Fail to capture pointer", M);
|
|
2570
2581
|
}
|
|
2571
2582
|
}, v = (y) => {
|
|
2572
|
-
if (
|
|
2583
|
+
if (c.current.pressed) {
|
|
2573
2584
|
const {
|
|
2574
|
-
pointerId:
|
|
2585
|
+
pointerId: C,
|
|
2575
2586
|
clientX: x,
|
|
2576
2587
|
clientY: p,
|
|
2577
|
-
altKey:
|
|
2588
|
+
altKey: w,
|
|
2578
2589
|
shiftKey: m,
|
|
2579
2590
|
ctrlKey: S,
|
|
2580
2591
|
metaKey: O,
|
|
2581
2592
|
buttons: k
|
|
2582
2593
|
} = y;
|
|
2583
|
-
|
|
2594
|
+
c.current.pointers[C] = {
|
|
2584
2595
|
clientX: x,
|
|
2585
2596
|
clientY: p
|
|
2586
|
-
},
|
|
2587
|
-
const
|
|
2588
|
-
let M,
|
|
2589
|
-
if (
|
|
2590
|
-
const { clientX: $, clientY:
|
|
2591
|
-
|
|
2592
|
-
|
|
2597
|
+
}, c.current.moving = !0;
|
|
2598
|
+
const j = Object.keys(c.current.pointers).length === 2;
|
|
2599
|
+
let M, A, N = 0;
|
|
2600
|
+
if (j) {
|
|
2601
|
+
const { clientX: $, clientY: z } = qt(
|
|
2602
|
+
c.current.pointers,
|
|
2603
|
+
C
|
|
2593
2604
|
);
|
|
2594
|
-
M = ($ + x) / 2,
|
|
2595
|
-
[$,
|
|
2605
|
+
M = ($ + x) / 2, A = (z + p) / 2, N = Gt(
|
|
2606
|
+
[$, z],
|
|
2596
2607
|
[x, p]
|
|
2597
2608
|
);
|
|
2598
2609
|
} else
|
|
2599
|
-
M = x,
|
|
2600
|
-
let U = m ||
|
|
2610
|
+
M = x, A = p;
|
|
2611
|
+
let U = m || w || S || O || k !== 1;
|
|
2601
2612
|
d !== "drag" && (U = !U);
|
|
2602
2613
|
const J = !U, P = U;
|
|
2603
2614
|
if (J) {
|
|
2604
|
-
|
|
2615
|
+
c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout), se.add(r, {
|
|
2605
2616
|
deltaX: 0,
|
|
2606
2617
|
deltaY: 0,
|
|
2607
|
-
startX:
|
|
2608
|
-
startY:
|
|
2609
|
-
clientX:
|
|
2610
|
-
clientY:
|
|
2618
|
+
startX: c.current.startX,
|
|
2619
|
+
startY: c.current.startY,
|
|
2620
|
+
clientX: c.current.startX,
|
|
2621
|
+
clientY: c.current.startY,
|
|
2611
2622
|
distanceX: 0,
|
|
2612
2623
|
distanceY: 0,
|
|
2613
|
-
button:
|
|
2614
|
-
altKey:
|
|
2624
|
+
button: c.current.currentButton,
|
|
2625
|
+
altKey: w,
|
|
2615
2626
|
shiftKey: m,
|
|
2616
2627
|
ctrlKey: S,
|
|
2617
2628
|
metaKey: O,
|
|
2618
|
-
target:
|
|
2619
|
-
event:
|
|
2629
|
+
target: c.current.target,
|
|
2630
|
+
event: c.current.pointerDownEvent
|
|
2620
2631
|
}));
|
|
2621
|
-
const $ = M -
|
|
2622
|
-
|
|
2632
|
+
const $ = M - c.current.prevX, z = A - c.current.prevY, V = M - c.current.startX, Y = A - c.current.startY;
|
|
2633
|
+
se.add(t, {
|
|
2623
2634
|
deltaX: $,
|
|
2624
|
-
deltaY:
|
|
2625
|
-
startX:
|
|
2626
|
-
startY:
|
|
2635
|
+
deltaY: z,
|
|
2636
|
+
startX: c.current.startX,
|
|
2637
|
+
startY: c.current.startY,
|
|
2627
2638
|
clientX: M,
|
|
2628
|
-
clientY:
|
|
2639
|
+
clientY: A,
|
|
2629
2640
|
distanceX: V,
|
|
2630
|
-
distanceY:
|
|
2631
|
-
button:
|
|
2632
|
-
altKey:
|
|
2641
|
+
distanceY: Y,
|
|
2642
|
+
button: c.current.currentButton,
|
|
2643
|
+
altKey: w,
|
|
2633
2644
|
shiftKey: m,
|
|
2634
2645
|
ctrlKey: S,
|
|
2635
2646
|
metaKey: O,
|
|
2636
|
-
target:
|
|
2647
|
+
target: c.current.target,
|
|
2637
2648
|
event: y
|
|
2638
2649
|
});
|
|
2639
2650
|
}
|
|
2640
2651
|
if (P) {
|
|
2641
|
-
|
|
2642
|
-
const $ = M -
|
|
2643
|
-
if (
|
|
2652
|
+
c.current.gestureStart || (f.current.style.cursor = "move", c.current.gestureStart = !0, clearTimeout(c.current.longTapTimeout));
|
|
2653
|
+
const $ = M - c.current.prevX, z = A - c.current.prevY, { target: V } = c.current;
|
|
2654
|
+
if (se.add(o, {
|
|
2644
2655
|
deltaX: $,
|
|
2645
|
-
deltaY:
|
|
2646
|
-
button:
|
|
2647
|
-
altKey:
|
|
2656
|
+
deltaY: z,
|
|
2657
|
+
button: c.current.currentButton,
|
|
2658
|
+
altKey: w,
|
|
2648
2659
|
shiftKey: m,
|
|
2649
2660
|
ctrlKey: S,
|
|
2650
2661
|
metaKey: O,
|
|
2651
2662
|
target: V,
|
|
2652
2663
|
event: y
|
|
2653
|
-
}), N !==
|
|
2654
|
-
const
|
|
2655
|
-
Math.abs(
|
|
2656
|
-
scale:
|
|
2664
|
+
}), N !== c.current.prevDistance && l) {
|
|
2665
|
+
const Y = c.current.prevDistance - N;
|
|
2666
|
+
Math.abs(Y) > 0 && (se.add(l, {
|
|
2667
|
+
scale: Y * 3,
|
|
2657
2668
|
clientX: M,
|
|
2658
|
-
clientY:
|
|
2669
|
+
clientY: A,
|
|
2659
2670
|
event: y
|
|
2660
|
-
}),
|
|
2671
|
+
}), c.current.prevDistance = N);
|
|
2661
2672
|
}
|
|
2662
2673
|
}
|
|
2663
|
-
|
|
2674
|
+
c.current.prevX = M, c.current.prevY = A;
|
|
2664
2675
|
}
|
|
2665
2676
|
}, E = (y) => {
|
|
2666
2677
|
const {
|
|
2667
|
-
clientX:
|
|
2678
|
+
clientX: C,
|
|
2668
2679
|
clientY: x,
|
|
2669
2680
|
altKey: p,
|
|
2670
|
-
shiftKey:
|
|
2681
|
+
shiftKey: w,
|
|
2671
2682
|
ctrlKey: m,
|
|
2672
2683
|
metaKey: S,
|
|
2673
2684
|
target: O,
|
|
2674
2685
|
pointerId: k
|
|
2675
2686
|
} = y;
|
|
2676
|
-
if (
|
|
2677
|
-
if (delete
|
|
2678
|
-
const { clientX:
|
|
2679
|
-
Object.assign(
|
|
2680
|
-
prevX:
|
|
2687
|
+
if (c.current.pointers[k]) {
|
|
2688
|
+
if (delete c.current.pointers[k], c.current.mainPointer !== k) {
|
|
2689
|
+
const { clientX: j, clientY: M } = c.current.pointers[c.current.mainPointer];
|
|
2690
|
+
Object.assign(c.current, {
|
|
2691
|
+
prevX: j,
|
|
2681
2692
|
prevY: M,
|
|
2682
2693
|
prevDistance: 0,
|
|
2683
2694
|
startDistance: 0
|
|
2684
2695
|
});
|
|
2685
2696
|
return;
|
|
2686
2697
|
}
|
|
2687
|
-
for (; Object.keys(
|
|
2688
|
-
|
|
2689
|
-
Object.keys(
|
|
2698
|
+
for (; Object.keys(c.current.pointers).length > 0; ) {
|
|
2699
|
+
c.current.mainPointer = Number(
|
|
2700
|
+
Object.keys(c.current.pointers)[0]
|
|
2690
2701
|
);
|
|
2691
2702
|
try {
|
|
2692
|
-
|
|
2693
|
-
const { clientX:
|
|
2694
|
-
Object.assign(
|
|
2695
|
-
prevX:
|
|
2703
|
+
c.current.target.setPointerCapture(c.current.mainPointer);
|
|
2704
|
+
const { clientX: j, clientY: M } = c.current.pointers[c.current.mainPointer];
|
|
2705
|
+
Object.assign(c.current, {
|
|
2706
|
+
prevX: j,
|
|
2696
2707
|
prevY: M,
|
|
2697
2708
|
prevDistance: 0,
|
|
2698
2709
|
startDistance: 0
|
|
2699
2710
|
});
|
|
2700
2711
|
return;
|
|
2701
|
-
} catch (
|
|
2702
|
-
console.log("Fails to set pointer capture",
|
|
2712
|
+
} catch (j) {
|
|
2713
|
+
console.log("Fails to set pointer capture", j), c.current.mainPointer = void 0, delete c.current.pointers[Object.keys(c.current.pointers)[0]];
|
|
2703
2714
|
}
|
|
2704
2715
|
}
|
|
2705
|
-
if (
|
|
2706
|
-
|
|
2707
|
-
deltaX:
|
|
2708
|
-
deltaY: x -
|
|
2709
|
-
startX:
|
|
2710
|
-
startY:
|
|
2711
|
-
clientX:
|
|
2716
|
+
if (c.current.mainPointer = void 0, c.current.pressed = !1, clearTimeout(c.current.longTapTimeout), c.current.moving)
|
|
2717
|
+
c.current.moving = !1, se.add(n, {
|
|
2718
|
+
deltaX: C - c.current.prevX,
|
|
2719
|
+
deltaY: x - c.current.prevY,
|
|
2720
|
+
startX: c.current.startX,
|
|
2721
|
+
startY: c.current.startY,
|
|
2722
|
+
clientX: C,
|
|
2712
2723
|
clientY: x,
|
|
2713
|
-
distanceX:
|
|
2714
|
-
distanceY: x -
|
|
2715
|
-
button:
|
|
2724
|
+
distanceX: C - c.current.startX,
|
|
2725
|
+
distanceY: x - c.current.startY,
|
|
2726
|
+
button: c.current.currentButton,
|
|
2716
2727
|
altKey: p,
|
|
2717
|
-
shiftKey:
|
|
2728
|
+
shiftKey: w,
|
|
2718
2729
|
ctrlKey: m,
|
|
2719
2730
|
metaKey: S,
|
|
2720
2731
|
event: y
|
|
2721
2732
|
}), f.current.style.cursor = "auto";
|
|
2722
2733
|
else {
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
clientX:
|
|
2734
|
+
const j = Date.now();
|
|
2735
|
+
c.current.noTap ? c.current.noTap = !1 : c.current.timeStart - j < 300 && se.add(s, {
|
|
2736
|
+
clientX: C,
|
|
2726
2737
|
clientY: x,
|
|
2727
2738
|
altKey: p,
|
|
2728
|
-
shiftKey:
|
|
2739
|
+
shiftKey: w,
|
|
2729
2740
|
ctrlKey: m,
|
|
2730
2741
|
metaKey: S,
|
|
2731
2742
|
target: O,
|
|
@@ -2745,12 +2756,12 @@ const ne = new zn(), Fe = ({
|
|
|
2745
2756
|
onPointerLeave: E,
|
|
2746
2757
|
onPointerCancel: E,
|
|
2747
2758
|
onDoubleClick: (y) => {
|
|
2748
|
-
const { clientX:
|
|
2749
|
-
|
|
2750
|
-
clientX:
|
|
2759
|
+
const { clientX: C, clientY: x, altKey: p, shiftKey: w, ctrlKey: m, metaKey: S, target: O } = y;
|
|
2760
|
+
se.add(u, {
|
|
2761
|
+
clientX: C,
|
|
2751
2762
|
clientY: x,
|
|
2752
2763
|
altKey: p,
|
|
2753
|
-
shiftKey:
|
|
2764
|
+
shiftKey: w,
|
|
2754
2765
|
ctrlKey: m,
|
|
2755
2766
|
metaKey: S,
|
|
2756
2767
|
target: O,
|
|
@@ -2763,9 +2774,9 @@ const ne = new zn(), Fe = ({
|
|
|
2763
2774
|
}
|
|
2764
2775
|
);
|
|
2765
2776
|
}, ot = ({ onResize: e, ...t }) => {
|
|
2766
|
-
const [r] =
|
|
2767
|
-
return /* @__PURE__ */ T(Fe, { onDrag: ({ deltaX: o, deltaY: s, event:
|
|
2768
|
-
|
|
2777
|
+
const [r] = Q((o) => [o.getBoardState]);
|
|
2778
|
+
return /* @__PURE__ */ T(Fe, { onDrag: ({ deltaX: o, deltaY: s, event: a }) => {
|
|
2779
|
+
a.stopPropagation();
|
|
2769
2780
|
const { scale: u } = r();
|
|
2770
2781
|
e({
|
|
2771
2782
|
width: o / u,
|
|
@@ -2776,11 +2787,11 @@ const ne = new zn(), Fe = ({
|
|
|
2776
2787
|
let Yn = { data: "" }, Bn = (e) => typeof window == "object" ? ((e ? e.querySelector("#_goober") : window._goober) || Object.assign((e || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : e || Yn, Nn = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, Xn = /\/\*[^]*?\*\/| +/g, Jt = /\n+/g, fe = (e, t) => {
|
|
2777
2788
|
let r = "", n = "", o = "";
|
|
2778
2789
|
for (let s in e) {
|
|
2779
|
-
let
|
|
2780
|
-
s[0] == "@" ? s[1] == "i" ? r = s + " " +
|
|
2790
|
+
let a = e[s];
|
|
2791
|
+
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 + ";");
|
|
2781
2792
|
}
|
|
2782
2793
|
return r + (t && o ? t + "{" + o + "}" : o) + n;
|
|
2783
|
-
},
|
|
2794
|
+
}, ce = {}, pr = (e) => {
|
|
2784
2795
|
if (typeof e == "object") {
|
|
2785
2796
|
let t = "";
|
|
2786
2797
|
for (let r in e)
|
|
@@ -2789,39 +2800,39 @@ let Yn = { data: "" }, Bn = (e) => typeof window == "object" ? ((e ? e.querySele
|
|
|
2789
2800
|
}
|
|
2790
2801
|
return e;
|
|
2791
2802
|
}, Un = (e, t, r, n, o) => {
|
|
2792
|
-
let s = pr(e),
|
|
2803
|
+
let s = pr(e), a = ce[s] || (ce[s] = ((l) => {
|
|
2793
2804
|
let d = 0, f = 11;
|
|
2794
2805
|
for (; d < l.length; )
|
|
2795
2806
|
f = 101 * f + l.charCodeAt(d++) >>> 0;
|
|
2796
2807
|
return "go" + f;
|
|
2797
2808
|
})(s));
|
|
2798
|
-
if (!
|
|
2809
|
+
if (!ce[a]) {
|
|
2799
2810
|
let l = s !== e ? e : ((d) => {
|
|
2800
|
-
let f,
|
|
2811
|
+
let f, c, h = [{}];
|
|
2801
2812
|
for (; f = Nn.exec(d.replace(Xn, "")); )
|
|
2802
|
-
f[4] ? h.shift() : f[3] ? (
|
|
2813
|
+
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();
|
|
2803
2814
|
return h[0];
|
|
2804
2815
|
})(e);
|
|
2805
|
-
|
|
2816
|
+
ce[a] = fe(o ? { ["@keyframes " + a]: l } : l, r ? "" : "." + a);
|
|
2806
2817
|
}
|
|
2807
|
-
let u = r &&
|
|
2808
|
-
return r && (
|
|
2809
|
-
|
|
2810
|
-
})(
|
|
2818
|
+
let u = r && ce.g ? ce.g : null;
|
|
2819
|
+
return r && (ce.g = ce[a]), ((l, d, f, c) => {
|
|
2820
|
+
c ? d.data = d.data.replace(c, l) : d.data.indexOf(l) === -1 && (d.data = f ? l + d.data : d.data + l);
|
|
2821
|
+
})(ce[a], t, n, u), a;
|
|
2811
2822
|
}, Wn = (e, t, r) => e.reduce((n, o, s) => {
|
|
2812
|
-
let
|
|
2813
|
-
if (
|
|
2814
|
-
let u =
|
|
2815
|
-
|
|
2823
|
+
let a = t[s];
|
|
2824
|
+
if (a && a.call) {
|
|
2825
|
+
let u = a(r), l = u && u.props && u.props.className || /^go/.test(u) && u;
|
|
2826
|
+
a = l ? "." + l : u && typeof u == "object" ? u.props ? "" : fe(u, "") : u === !1 ? "" : u;
|
|
2816
2827
|
}
|
|
2817
|
-
return n + o + (
|
|
2828
|
+
return n + o + (a ?? "");
|
|
2818
2829
|
}, "");
|
|
2819
|
-
function
|
|
2830
|
+
function K(e) {
|
|
2820
2831
|
let t = this || {}, r = e.call ? e(t.p) : e;
|
|
2821
2832
|
return Un(r.unshift ? r.raw ? Wn(r, [].slice.call(arguments, 1), t.p) : r.reduce((n, o) => Object.assign(n, o && o.call ? o(t.p) : o), {}) : r, Bn(t.target), t.g, t.o, t.k);
|
|
2822
2833
|
}
|
|
2823
|
-
|
|
2824
|
-
|
|
2834
|
+
K.bind({ g: 1 });
|
|
2835
|
+
K.bind({ k: 1 });
|
|
2825
2836
|
function Vn(e, t, r, n) {
|
|
2826
2837
|
fe.p = t;
|
|
2827
2838
|
}
|
|
@@ -2852,44 +2863,44 @@ var Fn = function e(t, r) {
|
|
|
2852
2863
|
if (!Object.prototype.hasOwnProperty.call(r, s[o]))
|
|
2853
2864
|
return !1;
|
|
2854
2865
|
for (o = n; o-- !== 0; ) {
|
|
2855
|
-
var
|
|
2856
|
-
if (!e(t[
|
|
2866
|
+
var a = s[o];
|
|
2867
|
+
if (!e(t[a], r[a]))
|
|
2857
2868
|
return !1;
|
|
2858
2869
|
}
|
|
2859
2870
|
return !0;
|
|
2860
2871
|
}
|
|
2861
2872
|
return t !== t && r !== r;
|
|
2862
2873
|
};
|
|
2863
|
-
const Kn =
|
|
2874
|
+
const Kn = K`
|
|
2864
2875
|
display: inline-block;
|
|
2865
2876
|
transition: transform 150ms;
|
|
2866
2877
|
user-select: none;
|
|
2867
2878
|
padding: 2px;
|
|
2868
2879
|
box-sizing: border-box;
|
|
2869
|
-
`, Hn =
|
|
2880
|
+
`, Hn = K`
|
|
2870
2881
|
border: 2px dashed #db5034;
|
|
2871
2882
|
padding: 0px;
|
|
2872
2883
|
cursor: pointer;
|
|
2873
|
-
`,
|
|
2884
|
+
`, Ce = K`
|
|
2874
2885
|
position: absolute;
|
|
2875
2886
|
width: 0px;
|
|
2876
2887
|
height: 0px;
|
|
2877
|
-
`, qn =
|
|
2888
|
+
`, qn = K`
|
|
2878
2889
|
top: 0;
|
|
2879
2890
|
left: 0;
|
|
2880
|
-
`, Gn =
|
|
2891
|
+
`, Gn = K`
|
|
2881
2892
|
top: 0;
|
|
2882
2893
|
right: 0;
|
|
2883
|
-
`, Jn =
|
|
2894
|
+
`, Jn = K`
|
|
2884
2895
|
bottom: 0;
|
|
2885
2896
|
left: 0;
|
|
2886
|
-
`, Zn =
|
|
2897
|
+
`, Zn = K`
|
|
2887
2898
|
bottom: 0;
|
|
2888
2899
|
right: 0;
|
|
2889
|
-
`, Qn =
|
|
2900
|
+
`, Qn = K`
|
|
2890
2901
|
top: 50%;
|
|
2891
2902
|
left: 50%;
|
|
2892
|
-
`, st =
|
|
2903
|
+
`, st = K`
|
|
2893
2904
|
position: absolute;
|
|
2894
2905
|
|
|
2895
2906
|
width: 10px;
|
|
@@ -2897,22 +2908,22 @@ const Kn = H`
|
|
|
2897
2908
|
border: 2px solid #db5034;
|
|
2898
2909
|
background-color: #db5034;
|
|
2899
2910
|
cursor: move;
|
|
2900
|
-
`, eo =
|
|
2911
|
+
`, eo = K`
|
|
2901
2912
|
cursor: ew-resize;
|
|
2902
2913
|
right: -6px;
|
|
2903
2914
|
top: calc(50% - 5px);
|
|
2904
|
-
`, to =
|
|
2915
|
+
`, to = K`
|
|
2905
2916
|
cursor: ns-resize;
|
|
2906
2917
|
bottom: -6px;
|
|
2907
2918
|
left: calc(50% - 5px);
|
|
2908
|
-
`, ro =
|
|
2919
|
+
`, ro = K`
|
|
2909
2920
|
cursor: nwse-resize;
|
|
2910
2921
|
bottom: -6px;
|
|
2911
2922
|
right: -6px;
|
|
2912
|
-
`, no = ({ onReload: e }) => /* @__PURE__ */
|
|
2923
|
+
`, no = ({ onReload: e }) => /* @__PURE__ */ le(
|
|
2913
2924
|
"div",
|
|
2914
2925
|
{
|
|
2915
|
-
className: `syncboard-error-item ${
|
|
2926
|
+
className: `syncboard-error-item ${K({
|
|
2916
2927
|
width: "100px",
|
|
2917
2928
|
display: "flex",
|
|
2918
2929
|
flexDirection: "column",
|
|
@@ -2958,21 +2969,21 @@ const so = (e) => {
|
|
|
2958
2969
|
prevState: o,
|
|
2959
2970
|
keepRatio: s
|
|
2960
2971
|
}) => {
|
|
2961
|
-
let { width:
|
|
2962
|
-
if ([
|
|
2963
|
-
parseFloat(
|
|
2972
|
+
let { width: a, height: u } = o;
|
|
2973
|
+
if ([a, u] = [
|
|
2974
|
+
parseFloat(a),
|
|
2964
2975
|
parseFloat(u)
|
|
2965
|
-
], (!
|
|
2966
|
-
const l =
|
|
2976
|
+
], (!a || Number.isNaN(Number(a))) && (a = r), (!u || Number.isNaN(Number(u))) && (u = n), s) {
|
|
2977
|
+
const l = a / u;
|
|
2967
2978
|
return {
|
|
2968
2979
|
...o,
|
|
2969
|
-
width: (
|
|
2980
|
+
width: (a + e).toFixed(1),
|
|
2970
2981
|
height: (u + t / l).toFixed(1)
|
|
2971
2982
|
};
|
|
2972
2983
|
}
|
|
2973
2984
|
return {
|
|
2974
2985
|
...o,
|
|
2975
|
-
width: (
|
|
2986
|
+
width: (a + e).toFixed(1),
|
|
2976
2987
|
height: (u + t).toFixed(1)
|
|
2977
2988
|
};
|
|
2978
2989
|
}, ao = {
|
|
@@ -2981,44 +2992,44 @@ const so = (e) => {
|
|
|
2981
2992
|
b: !0
|
|
2982
2993
|
}, co = ({
|
|
2983
2994
|
setState: e,
|
|
2984
|
-
state: { type: t, rotation: r = 0, id: n, locked: o, extraClasses: s, ...
|
|
2995
|
+
state: { type: t, rotation: r = 0, id: n, locked: o, extraClasses: s, ...a } = {},
|
|
2985
2996
|
animate: u = "hvr-pop",
|
|
2986
2997
|
isSelected: l,
|
|
2987
2998
|
itemMap: d,
|
|
2988
2999
|
showResizeHandle: f = !0
|
|
2989
3000
|
}) => {
|
|
2990
3001
|
var m;
|
|
2991
|
-
const
|
|
3002
|
+
const c = g.useRef(null), {
|
|
2992
3003
|
component: h = () => null,
|
|
2993
3004
|
resizeDirections: _ = ao,
|
|
2994
3005
|
resize: v = io
|
|
2995
3006
|
} = d[t], E = g.useCallback(
|
|
2996
|
-
(S) => e(n, S),
|
|
3007
|
+
(S, O = !1) => e(n, S, O),
|
|
2997
3008
|
[e, n]
|
|
2998
3009
|
);
|
|
2999
3010
|
g.useEffect(() => {
|
|
3000
|
-
|
|
3011
|
+
c.current.className = u;
|
|
3001
3012
|
}, [u]);
|
|
3002
3013
|
const I = ["item", n, Kn];
|
|
3003
3014
|
o && I.push("locked"), l && (I.push("selected"), I.push(Hn));
|
|
3004
|
-
const y = I.join(" "),
|
|
3005
|
-
E((
|
|
3006
|
-
const { offsetWidth: M, offsetHeight:
|
|
3015
|
+
const y = I.join(" "), C = ({ width: S = 0, height: O = 0, keepRatio: k }) => {
|
|
3016
|
+
E((j) => {
|
|
3017
|
+
const { offsetWidth: M, offsetHeight: A } = c.current;
|
|
3007
3018
|
return v({
|
|
3008
|
-
prevState:
|
|
3019
|
+
prevState: j,
|
|
3009
3020
|
width: S,
|
|
3010
3021
|
height: O,
|
|
3011
|
-
actualHeight:
|
|
3022
|
+
actualHeight: A,
|
|
3012
3023
|
actualWidth: M,
|
|
3013
3024
|
keepRatio: k
|
|
3014
3025
|
});
|
|
3015
3026
|
});
|
|
3016
3027
|
}, x = ({ width: S }) => {
|
|
3017
|
-
|
|
3028
|
+
C({ width: S });
|
|
3018
3029
|
}, p = ({ height: S }) => {
|
|
3019
|
-
|
|
3020
|
-
},
|
|
3021
|
-
|
|
3030
|
+
C({ height: S });
|
|
3031
|
+
}, w = ({ width: S }) => {
|
|
3032
|
+
C({ height: S, width: S, keepRatio: !0 });
|
|
3022
3033
|
};
|
|
3023
3034
|
return /* @__PURE__ */ T(
|
|
3024
3035
|
"div",
|
|
@@ -3026,11 +3037,11 @@ const so = (e) => {
|
|
|
3026
3037
|
style: { transform: `rotate(${r}deg` },
|
|
3027
3038
|
"data-id": n,
|
|
3028
3039
|
className: y,
|
|
3029
|
-
children: /* @__PURE__ */
|
|
3040
|
+
children: /* @__PURE__ */ le(
|
|
3030
3041
|
"div",
|
|
3031
3042
|
{
|
|
3032
3043
|
style: { display: "flex" },
|
|
3033
|
-
ref:
|
|
3044
|
+
ref: c,
|
|
3034
3045
|
onAnimationEnd: so,
|
|
3035
3046
|
onKeyDown: (S) => S.stopPropagation(),
|
|
3036
3047
|
onKeyUp: (S) => S.stopPropagation(),
|
|
@@ -3039,22 +3050,22 @@ const so = (e) => {
|
|
|
3039
3050
|
oo,
|
|
3040
3051
|
{
|
|
3041
3052
|
itemId: n,
|
|
3042
|
-
state:
|
|
3053
|
+
state: a,
|
|
3043
3054
|
ErrorComponent: ((m = d == null ? void 0 : d.error) == null ? void 0 : m.component) || no,
|
|
3044
|
-
children: /* @__PURE__ */ T(h, { ...
|
|
3055
|
+
children: /* @__PURE__ */ T(h, { ...a, id: n, setState: E })
|
|
3045
3056
|
}
|
|
3046
3057
|
),
|
|
3047
|
-
/* @__PURE__ */ T("div", { className: `corner ${
|
|
3048
|
-
/* @__PURE__ */ T("div", { className: `corner ${
|
|
3049
|
-
/* @__PURE__ */ T("div", { className: `corner ${
|
|
3050
|
-
/* @__PURE__ */ T("div", { className: `corner ${
|
|
3051
|
-
/* @__PURE__ */ T("div", { className: `center ${
|
|
3052
|
-
f && /* @__PURE__ */
|
|
3058
|
+
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${qn}` }),
|
|
3059
|
+
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${Gn}` }),
|
|
3060
|
+
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${Zn}` }),
|
|
3061
|
+
/* @__PURE__ */ T("div", { className: `corner ${Ce} ${Jn}` }),
|
|
3062
|
+
/* @__PURE__ */ T("div", { className: `center ${Ce} ${Qn}` }),
|
|
3063
|
+
f && /* @__PURE__ */ le(Wr, { children: [
|
|
3053
3064
|
_.b && /* @__PURE__ */ T(
|
|
3054
3065
|
ot,
|
|
3055
3066
|
{
|
|
3056
3067
|
className: `${st} ${ro}`,
|
|
3057
|
-
onResize:
|
|
3068
|
+
onResize: w
|
|
3058
3069
|
}
|
|
3059
3070
|
),
|
|
3060
3071
|
_.h && /* @__PURE__ */ T(
|
|
@@ -3087,15 +3098,15 @@ const so = (e) => {
|
|
|
3087
3098
|
}, {
|
|
3088
3099
|
state: o,
|
|
3089
3100
|
setState: s,
|
|
3090
|
-
isSelected:
|
|
3101
|
+
isSelected: a,
|
|
3091
3102
|
showResizeHandle: u
|
|
3092
|
-
}) => r ===
|
|
3103
|
+
}) => r === a && n === u && t === s && Fn(e, o)
|
|
3093
3104
|
), lo = (e) => e, fo = ({ state: e = {}, getCurrentUser: t, className: r, ...n }) => {
|
|
3094
3105
|
if (!n.itemMap[e.type])
|
|
3095
3106
|
return null;
|
|
3096
3107
|
const { stateHook: o = lo } = n.itemMap[e.type], {
|
|
3097
3108
|
x: s = 0,
|
|
3098
|
-
y:
|
|
3109
|
+
y: a = 0,
|
|
3099
3110
|
layer: u = 0,
|
|
3100
3111
|
moving: l,
|
|
3101
3112
|
...d
|
|
@@ -3105,7 +3116,7 @@ const so = (e) => {
|
|
|
3105
3116
|
{
|
|
3106
3117
|
className: r,
|
|
3107
3118
|
style: {
|
|
3108
|
-
transform: `translate(${s}px, ${
|
|
3119
|
+
transform: `translate(${s}px, ${a}px)`,
|
|
3109
3120
|
zIndex: f
|
|
3110
3121
|
},
|
|
3111
3122
|
children: /* @__PURE__ */ T(
|
|
@@ -3119,17 +3130,17 @@ const so = (e) => {
|
|
|
3119
3130
|
}
|
|
3120
3131
|
);
|
|
3121
3132
|
}, po = rr(fo), mo = () => {
|
|
3122
|
-
const { updateItem: e } = gt(), [t, r] =
|
|
3133
|
+
const { updateItem: e } = gt(), [t, r] = oe((d) => [
|
|
3123
3134
|
d.itemIds,
|
|
3124
3135
|
d.items
|
|
3125
|
-
]), [n, o, s,
|
|
3136
|
+
]), [n, o, s, a] = Q(
|
|
3126
3137
|
(d) => [
|
|
3127
3138
|
d.config.boardSize,
|
|
3128
3139
|
d.config.showResizeHandle,
|
|
3129
3140
|
d.config.itemTemplates,
|
|
3130
3141
|
d.selection
|
|
3131
3142
|
]
|
|
3132
|
-
), [u] = Se((d) => [d.getUser]), l =
|
|
3143
|
+
), [u] = Se((d) => [d.getUser]), l = K({
|
|
3133
3144
|
position: "absolute",
|
|
3134
3145
|
top: `${n / 2}px`,
|
|
3135
3146
|
left: `${n / 2}px`,
|
|
@@ -3141,7 +3152,7 @@ const so = (e) => {
|
|
|
3141
3152
|
{
|
|
3142
3153
|
state: r[d],
|
|
3143
3154
|
setState: e,
|
|
3144
|
-
isSelected:
|
|
3155
|
+
isSelected: a.includes(d),
|
|
3145
3156
|
itemMap: s,
|
|
3146
3157
|
boardSize: n,
|
|
3147
3158
|
getCurrentUser: u,
|
|
@@ -3164,7 +3175,7 @@ function vo(e, ...t) {
|
|
|
3164
3175
|
e && e.removeEventListener && e.removeEventListener(...t);
|
|
3165
3176
|
}
|
|
3166
3177
|
const yo = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
3167
|
-
function
|
|
3178
|
+
function ue(e, ...t) {
|
|
3168
3179
|
const r = go(), n = pt(t[1]), o = lt(
|
|
3169
3180
|
() => (
|
|
3170
3181
|
// as some event listeners designed to be used through `this`
|
|
@@ -3182,11 +3193,11 @@ function ce(e, ...t) {
|
|
|
3182
3193
|
const s = e && yo(e, "current") ? e.current : e;
|
|
3183
3194
|
if (!s)
|
|
3184
3195
|
return;
|
|
3185
|
-
const
|
|
3186
|
-
return ho(s, t[0], o, ...
|
|
3196
|
+
const a = t.slice(2);
|
|
3197
|
+
return ho(s, t[0], o, ...a), () => vo(s, t[0], o, ...a);
|
|
3187
3198
|
}, [e, t[0]]);
|
|
3188
3199
|
}
|
|
3189
|
-
const So =
|
|
3200
|
+
const So = K({
|
|
3190
3201
|
zIndex: 210,
|
|
3191
3202
|
position: "absolute",
|
|
3192
3203
|
backgroundColor: "hsla(0, 40%, 50%, 10%)",
|
|
@@ -3197,7 +3208,7 @@ const So = H({
|
|
|
3197
3208
|
return [];
|
|
3198
3209
|
const o = n[0];
|
|
3199
3210
|
return Array.from(t.getElementsByClassName("item")).filter((s) => {
|
|
3200
|
-
const
|
|
3211
|
+
const a = Te(s), u = e[a];
|
|
3201
3212
|
return !u || !r && u.locked ? !1 : on(s, o);
|
|
3202
3213
|
}).map((s) => Te(s));
|
|
3203
3214
|
}, bo = ({ children: e, moveFirst: t }) => {
|
|
@@ -3206,9 +3217,9 @@ const So = H({
|
|
|
3206
3217
|
n,
|
|
3207
3218
|
o,
|
|
3208
3219
|
s,
|
|
3209
|
-
|
|
3220
|
+
a,
|
|
3210
3221
|
u
|
|
3211
|
-
] =
|
|
3222
|
+
] = Q((m) => [
|
|
3212
3223
|
m.getSelection,
|
|
3213
3224
|
m.clear,
|
|
3214
3225
|
m.setSelection,
|
|
@@ -3216,23 +3227,23 @@ const So = H({
|
|
|
3216
3227
|
m.getConfiguration,
|
|
3217
3228
|
m.getBoardState,
|
|
3218
3229
|
m.updateBoardState
|
|
3219
|
-
]), { findElementUnderPointer: l } = gt(), [d] =
|
|
3230
|
+
]), { 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({
|
|
3220
3231
|
moving: !1
|
|
3221
3232
|
});
|
|
3222
|
-
return
|
|
3233
|
+
return ue(document, "keydown", (m) => {
|
|
3223
3234
|
m.key === "l" && v(!0);
|
|
3224
|
-
}),
|
|
3235
|
+
}), ue(document, "keyup", (m) => {
|
|
3225
3236
|
m.key === "l" && v(!1);
|
|
3226
3237
|
}), g.useEffect(() => (n(), () => {
|
|
3227
3238
|
n();
|
|
3228
3239
|
}), [n]), g.useEffect(() => {
|
|
3229
3240
|
if (I.current.moving) {
|
|
3230
|
-
const m = d(), { boardWrapper: S } =
|
|
3241
|
+
const m = d(), { boardWrapper: S } = a(), O = _o(m, S, _);
|
|
3231
3242
|
h(() => {
|
|
3232
3243
|
o(O);
|
|
3233
3244
|
});
|
|
3234
3245
|
}
|
|
3235
|
-
}, [
|
|
3246
|
+
}, [a, d, f, o, _]), /* @__PURE__ */ T(
|
|
3236
3247
|
Fe,
|
|
3237
3248
|
{
|
|
3238
3249
|
onDragStart: async (m) => {
|
|
@@ -3242,27 +3253,27 @@ const So = H({
|
|
|
3242
3253
|
},
|
|
3243
3254
|
onDrag: ({ distanceY: m, distanceX: S, startX: O, startY: k }) => {
|
|
3244
3255
|
if (I.current.moving) {
|
|
3245
|
-
const { top:
|
|
3246
|
-
S > 0 ? (I.current.left =
|
|
3256
|
+
const { top: j, left: M } = E.current.getBoundingClientRect(), A = O - M, N = k - j;
|
|
3257
|
+
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 });
|
|
3247
3258
|
}
|
|
3248
3259
|
},
|
|
3249
3260
|
onDragEnd: () => {
|
|
3250
3261
|
I.current.moving && (h(() => {
|
|
3251
3262
|
u({ selecting: !1 });
|
|
3252
|
-
}), I.current.moving = !1,
|
|
3263
|
+
}), I.current.moving = !1, c({ moving: !1 }), E.current.style.cursor = "auto");
|
|
3253
3264
|
},
|
|
3254
3265
|
onTap: (m) => {
|
|
3255
|
-
const { target: S, ctrlKey: O, metaKey: k } = m,
|
|
3256
|
-
if (!
|
|
3266
|
+
const { target: S, ctrlKey: O, metaKey: k } = m, j = l(m);
|
|
3267
|
+
if (!j && Oe(S, "board"))
|
|
3257
3268
|
n();
|
|
3258
3269
|
else {
|
|
3259
|
-
const M = Te(
|
|
3270
|
+
const M = Te(j);
|
|
3260
3271
|
if (!M) {
|
|
3261
3272
|
n();
|
|
3262
3273
|
return;
|
|
3263
3274
|
}
|
|
3264
|
-
const
|
|
3265
|
-
|
|
3275
|
+
const A = r();
|
|
3276
|
+
j && !A.includes(M) && (O || k ? s([M]) : o([M]));
|
|
3266
3277
|
}
|
|
3267
3278
|
},
|
|
3268
3279
|
onLongTap: ({ target: m }) => {
|
|
@@ -3273,7 +3284,7 @@ const So = H({
|
|
|
3273
3284
|
}
|
|
3274
3285
|
},
|
|
3275
3286
|
mainAction: t ? "pan" : "drag",
|
|
3276
|
-
children: /* @__PURE__ */
|
|
3287
|
+
children: /* @__PURE__ */ le("div", { ref: E, children: [
|
|
3277
3288
|
f.moving && /* @__PURE__ */ T(
|
|
3278
3289
|
"div",
|
|
3279
3290
|
{
|
|
@@ -3290,54 +3301,54 @@ const So = H({
|
|
|
3290
3301
|
}
|
|
3291
3302
|
);
|
|
3292
3303
|
}, Eo = ({ children: e }) => {
|
|
3293
|
-
const { moveItems: t, placeItems: r, findElementUnderPointer: n } = gt(), { vectorFromWrapperToBoard: o } = Me(), [s,
|
|
3304
|
+
const { moveItems: t, placeItems: r, findElementUnderPointer: n } = gt(), { vectorFromWrapperToBoard: o } = Me(), [s, a, u, l, d] = Q((y) => [
|
|
3294
3305
|
y.select,
|
|
3295
3306
|
y.setSelection,
|
|
3296
3307
|
y.getSelection,
|
|
3297
3308
|
y.getBoardState,
|
|
3298
3309
|
y.updateBoardState
|
|
3299
|
-
]), [f] =
|
|
3310
|
+
]), [f] = oe((y) => [y.getBoardConfig]), c = g.useRef({}), h = g.useRef({
|
|
3300
3311
|
items: []
|
|
3301
3312
|
}), _ = (y) => {
|
|
3302
|
-
const { ctrlKey:
|
|
3303
|
-
if (
|
|
3313
|
+
const { ctrlKey: C, metaKey: x, event: p } = y, w = n(y);
|
|
3314
|
+
if (w) {
|
|
3304
3315
|
p.stopPropagation();
|
|
3305
3316
|
const m = u();
|
|
3306
3317
|
h.current.items = m;
|
|
3307
|
-
const S = Te(
|
|
3308
|
-
m.includes(S) || (
|
|
3318
|
+
const S = Te(w);
|
|
3319
|
+
m.includes(S) || (C || x ? (h.current.items = [...m, S], s([S])) : (h.current.items = [S], a([S]))), Object.assign(c.current, {
|
|
3309
3320
|
moving: !0
|
|
3310
3321
|
});
|
|
3311
3322
|
}
|
|
3312
|
-
}, v = ({ deltaX: y, deltaY:
|
|
3313
|
-
if (
|
|
3323
|
+
}, v = ({ deltaX: y, deltaY: C, event: x }) => {
|
|
3324
|
+
if (c.current.moving) {
|
|
3314
3325
|
x.stopPropagation();
|
|
3315
|
-
const { movingItems: p } = l(), [
|
|
3326
|
+
const { movingItems: p } = l(), [w, m] = o(y, C);
|
|
3316
3327
|
t(
|
|
3317
3328
|
h.current.items,
|
|
3318
3329
|
{
|
|
3319
|
-
x:
|
|
3330
|
+
x: w,
|
|
3320
3331
|
y: m
|
|
3321
3332
|
},
|
|
3322
3333
|
!0
|
|
3323
3334
|
), p || d({ movingItems: !0 });
|
|
3324
3335
|
}
|
|
3325
3336
|
}, E = () => {
|
|
3326
|
-
if (
|
|
3327
|
-
const { gridSize: y = 1 } = f(),
|
|
3328
|
-
|
|
3337
|
+
if (c.current.moving) {
|
|
3338
|
+
const { gridSize: y = 1 } = f(), C = y || 1;
|
|
3339
|
+
c.current = { moving: !1 }, r(h.current.items, {
|
|
3329
3340
|
type: "grid",
|
|
3330
|
-
size:
|
|
3341
|
+
size: C
|
|
3331
3342
|
}), d({ movingItems: !1 });
|
|
3332
3343
|
}
|
|
3333
3344
|
};
|
|
3334
|
-
return
|
|
3345
|
+
return ue(document, "keydown", (y) => {
|
|
3335
3346
|
if (["INPUT", "TEXTAREA"].includes(y.target.tagName))
|
|
3336
3347
|
return;
|
|
3337
|
-
const
|
|
3338
|
-
if (
|
|
3348
|
+
const C = u();
|
|
3349
|
+
if (C.length) {
|
|
3339
3350
|
const { gridSize: x = 1 } = f();
|
|
3340
|
-
let p = 0,
|
|
3351
|
+
let p = 0, w = 0;
|
|
3341
3352
|
switch (y.key) {
|
|
3342
3353
|
case "ArrowLeft":
|
|
3343
3354
|
p = -10;
|
|
@@ -3346,50 +3357,50 @@ const So = H({
|
|
|
3346
3357
|
p = 10;
|
|
3347
3358
|
break;
|
|
3348
3359
|
case "ArrowUp":
|
|
3349
|
-
|
|
3360
|
+
w = -10;
|
|
3350
3361
|
break;
|
|
3351
3362
|
case "ArrowDown":
|
|
3352
|
-
|
|
3363
|
+
w = 10;
|
|
3353
3364
|
break;
|
|
3354
3365
|
}
|
|
3355
|
-
if (p ||
|
|
3356
|
-
y.shiftKey && (p *= 5,
|
|
3357
|
-
const [m, S] = o(p,
|
|
3366
|
+
if (p || w) {
|
|
3367
|
+
y.shiftKey && (p *= 5, w *= 5), (y.ctrlKey || y.altKey || y.metaKey) && (p /= 10, w /= 10);
|
|
3368
|
+
const [m, S] = o(p, w);
|
|
3358
3369
|
t(
|
|
3359
|
-
|
|
3370
|
+
C,
|
|
3360
3371
|
{
|
|
3361
3372
|
x: m,
|
|
3362
3373
|
y: S
|
|
3363
3374
|
},
|
|
3364
3375
|
!0
|
|
3365
|
-
), r(
|
|
3376
|
+
), r(C, {
|
|
3366
3377
|
type: "grid",
|
|
3367
3378
|
size: x || 1
|
|
3368
3379
|
}), y.preventDefault();
|
|
3369
3380
|
}
|
|
3370
3381
|
}
|
|
3371
3382
|
}), /* @__PURE__ */ T(Fe, { onDragStart: _, onDrag: v, onDragEnd: E, children: e });
|
|
3372
|
-
},
|
|
3383
|
+
}, wo = (e) => {
|
|
3373
3384
|
const t = g.useRef({ hover: !1, x: 0, y: 0 });
|
|
3374
|
-
return
|
|
3385
|
+
return ue(e.current, "mousemove", (n) => {
|
|
3375
3386
|
const { clientX: o, clientY: s } = n;
|
|
3376
3387
|
t.current.x = o, t.current.y = s;
|
|
3377
|
-
}),
|
|
3388
|
+
}), ue(e.current, "mouseenter", () => {
|
|
3378
3389
|
t.current.hover = !0;
|
|
3379
|
-
}),
|
|
3390
|
+
}), ue(e.current, "mouseleave", () => {
|
|
3380
3391
|
t.current.hover = !1;
|
|
3381
3392
|
}), g.useCallback(() => t.current, []);
|
|
3382
|
-
},
|
|
3383
|
-
const [e, t] = g.useState({}), [r, n] =
|
|
3393
|
+
}, Co = [...Array(5).keys()].map((e) => `Digit${e + 1}`), xo = () => {
|
|
3394
|
+
const [e, t] = g.useState({}), [r, n] = Q((o) => [
|
|
3384
3395
|
o.getBoardState,
|
|
3385
3396
|
o.updateBoardState
|
|
3386
3397
|
]);
|
|
3387
|
-
return
|
|
3388
|
-
if (!["INPUT", "TEXTAREA"].includes(o.target.tagName) &&
|
|
3389
|
-
const s = o.code, { translateX:
|
|
3398
|
+
return ue(document, "keydown", (o) => {
|
|
3399
|
+
if (!["INPUT", "TEXTAREA"].includes(o.target.tagName) && Co.includes(o.code)) {
|
|
3400
|
+
const s = o.code, { translateX: a, translateY: u, scale: l } = r();
|
|
3390
3401
|
o.altKey || o.metaKey || o.ctrlKey || o.shiftKey ? t((d) => ({
|
|
3391
3402
|
...d,
|
|
3392
|
-
[s]: { translateX:
|
|
3403
|
+
[s]: { translateX: a, translateY: u, scale: l }
|
|
3393
3404
|
})) : e[s] && n(e[s]), o.preventDefault();
|
|
3394
3405
|
}
|
|
3395
3406
|
}), null;
|
|
@@ -3398,9 +3409,9 @@ const So = H({
|
|
|
3398
3409
|
n,
|
|
3399
3410
|
o,
|
|
3400
3411
|
s,
|
|
3401
|
-
|
|
3412
|
+
a,
|
|
3402
3413
|
u
|
|
3403
|
-
] =
|
|
3414
|
+
] = Q((p) => [
|
|
3404
3415
|
{
|
|
3405
3416
|
translateX: p.boardState.translateX,
|
|
3406
3417
|
translateY: p.boardState.translateY,
|
|
@@ -3411,36 +3422,36 @@ const So = H({
|
|
|
3411
3422
|
p.getConfiguration,
|
|
3412
3423
|
p.updateBoardState,
|
|
3413
3424
|
p.getSelection
|
|
3414
|
-
]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [
|
|
3425
|
+
]), { zoomToCenter: l, zoomToExtent: d, moveBoard: f } = Me(), [c, h] = g.useState(!1), _ = g.useRef({}), v = wo(r);
|
|
3415
3426
|
xo();
|
|
3416
3427
|
const E = g.useCallback(() => {
|
|
3417
3428
|
const { itemExtent: p } = s();
|
|
3418
3429
|
d(p);
|
|
3419
3430
|
}, [s, d]);
|
|
3420
3431
|
g.useEffect(() => {
|
|
3421
|
-
!
|
|
3422
|
-
}, [E,
|
|
3423
|
-
const I = ({ clientX: p, clientY:
|
|
3424
|
-
l({ to: { x: p, y:
|
|
3425
|
-
|
|
3426
|
-
}, 200),
|
|
3427
|
-
}, y = ({ deltaX: p, deltaY:
|
|
3432
|
+
!c && o.radius && (E(), h(!0));
|
|
3433
|
+
}, [E, c, o]);
|
|
3434
|
+
const I = ({ clientX: p, clientY: w, scale: m }) => {
|
|
3435
|
+
l({ to: { x: p, y: w }, factor: 1 - m / 500 }), clearTimeout(_.current.zoom), _.current.zoom = setTimeout(() => {
|
|
3436
|
+
a({ zooming: !1 });
|
|
3437
|
+
}, 200), a({ zooming: !0 });
|
|
3438
|
+
}, y = ({ deltaX: p, deltaY: w }) => {
|
|
3428
3439
|
f(({ translateX: m, translateY: S }) => ({
|
|
3429
3440
|
translateX: m + p,
|
|
3430
|
-
translateY: S +
|
|
3441
|
+
translateY: S + w
|
|
3431
3442
|
})), clearTimeout(_.current.pan), _.current.pan = setTimeout(() => {
|
|
3432
|
-
|
|
3433
|
-
}, 200),
|
|
3434
|
-
},
|
|
3443
|
+
a({ panning: !1 });
|
|
3444
|
+
}, 200), a({ panning: !0 });
|
|
3445
|
+
}, C = (p) => {
|
|
3435
3446
|
if (["INPUT", "TEXTAREA"].includes(p.target.tagName))
|
|
3436
3447
|
return;
|
|
3437
|
-
let
|
|
3448
|
+
let w = 0, m = 0, S = 1;
|
|
3438
3449
|
switch (p.key) {
|
|
3439
3450
|
case "ArrowLeft":
|
|
3440
|
-
|
|
3451
|
+
w = -10;
|
|
3441
3452
|
break;
|
|
3442
3453
|
case "ArrowRight":
|
|
3443
|
-
|
|
3454
|
+
w = 10;
|
|
3444
3455
|
break;
|
|
3445
3456
|
case "ArrowUp":
|
|
3446
3457
|
m = -10;
|
|
@@ -3455,20 +3466,20 @@ const So = H({
|
|
|
3455
3466
|
S = 0.8;
|
|
3456
3467
|
break;
|
|
3457
3468
|
}
|
|
3458
|
-
if (
|
|
3469
|
+
if (w || m || S !== 1) {
|
|
3459
3470
|
const O = u();
|
|
3460
3471
|
if (S === 1 && O.length)
|
|
3461
3472
|
return;
|
|
3462
|
-
p.shiftKey && (
|
|
3463
|
-
translateX: k +
|
|
3464
|
-
translateY:
|
|
3473
|
+
p.shiftKey && (w *= 5, m *= 5), (p.ctrlKey || p.altKey || p.metaKey) && (w /= 5, m /= 5), f(({ translateX: k, translateY: j }) => ({
|
|
3474
|
+
translateX: k + w,
|
|
3475
|
+
translateY: j + m
|
|
3465
3476
|
})), l({ factor: S }), p.preventDefault();
|
|
3466
3477
|
}
|
|
3467
3478
|
p.key === " " && !p.repeat && v().hover && l({ factor: 3, to: v() });
|
|
3468
3479
|
}, x = (p) => {
|
|
3469
3480
|
["INPUT", "TEXTAREA"].includes(p.target.tagName) || p.key === " " && v().hover && l({ factor: 1 / 3, to: v() });
|
|
3470
3481
|
};
|
|
3471
|
-
return
|
|
3482
|
+
return ue(document, "keydown", C), ue(document, "keyup", x), /* @__PURE__ */ T(
|
|
3472
3483
|
Fe,
|
|
3473
3484
|
{
|
|
3474
3485
|
onPan: y,
|
|
@@ -3489,7 +3500,7 @@ const So = H({
|
|
|
3489
3500
|
)
|
|
3490
3501
|
}
|
|
3491
3502
|
);
|
|
3492
|
-
}, Io =
|
|
3503
|
+
}, Io = K({
|
|
3493
3504
|
position: "absolute",
|
|
3494
3505
|
top: 0,
|
|
3495
3506
|
left: 0,
|
|
@@ -3504,33 +3515,33 @@ const So = H({
|
|
|
3504
3515
|
r,
|
|
3505
3516
|
n,
|
|
3506
3517
|
o,
|
|
3507
|
-
{ translateX: s, translateY:
|
|
3508
|
-
] =
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3518
|
+
{ translateX: s, translateY: a, scale: u }
|
|
3519
|
+
] = Q((c) => [
|
|
3520
|
+
c.selection,
|
|
3521
|
+
c.getSelection,
|
|
3522
|
+
c.selectionBox,
|
|
3523
|
+
c.setSelectionBox,
|
|
3524
|
+
c.getConfiguration,
|
|
3514
3525
|
{
|
|
3515
|
-
translateX:
|
|
3516
|
-
translateY:
|
|
3517
|
-
scale:
|
|
3526
|
+
translateX: c.boardState.translateX,
|
|
3527
|
+
translateY: c.boardState.translateY,
|
|
3528
|
+
scale: c.boardState.scale
|
|
3518
3529
|
}
|
|
3519
|
-
]), [l] =
|
|
3520
|
-
const
|
|
3521
|
-
if (
|
|
3530
|
+
]), [l] = oe((c) => [c.items]), d = g.useCallback(() => {
|
|
3531
|
+
const c = t(), { boardWrapperRect: h, boardWrapper: _ } = o();
|
|
3532
|
+
if (c.length === 0) {
|
|
3522
3533
|
n(null);
|
|
3523
3534
|
return;
|
|
3524
3535
|
}
|
|
3525
|
-
const v = sn(
|
|
3536
|
+
const v = sn(c, _);
|
|
3526
3537
|
if (!v) {
|
|
3527
3538
|
n(null);
|
|
3528
3539
|
return;
|
|
3529
3540
|
}
|
|
3530
|
-
const { left: E, top: I, width: y, height:
|
|
3541
|
+
const { left: E, top: I, width: y, height: C } = v, x = {
|
|
3531
3542
|
left: E - h.left,
|
|
3532
3543
|
top: I - h.top,
|
|
3533
|
-
height:
|
|
3544
|
+
height: C,
|
|
3534
3545
|
width: y
|
|
3535
3546
|
};
|
|
3536
3547
|
n(x);
|
|
@@ -3541,7 +3552,7 @@ const So = H({
|
|
|
3541
3552
|
e,
|
|
3542
3553
|
l,
|
|
3543
3554
|
s,
|
|
3544
|
-
|
|
3555
|
+
a,
|
|
3545
3556
|
u,
|
|
3546
3557
|
d,
|
|
3547
3558
|
f
|
|
@@ -3557,7 +3568,7 @@ const So = H({
|
|
|
3557
3568
|
}
|
|
3558
3569
|
);
|
|
3559
3570
|
}, To = () => {
|
|
3560
|
-
const [e] =
|
|
3571
|
+
const [e] = Q((t) => [t.boardState.movingItems]);
|
|
3561
3572
|
return e ? null : /* @__PURE__ */ T(Oo, {});
|
|
3562
3573
|
}, ko = typeof window < "u" && typeof navigator < "u" && typeof document < "u";
|
|
3563
3574
|
let Le;
|
|
@@ -3587,28 +3598,28 @@ function Po() {
|
|
|
3587
3598
|
function Mo(e, t, r = !0) {
|
|
3588
3599
|
const n = r && Po(), o = pt(t), s = e && "current" in e ? e.current : e;
|
|
3589
3600
|
Pe(() => {
|
|
3590
|
-
const
|
|
3591
|
-
if (!n || !
|
|
3601
|
+
const a = e && "current" in e ? e.current : e;
|
|
3602
|
+
if (!n || !a)
|
|
3592
3603
|
return;
|
|
3593
3604
|
let u = !0;
|
|
3594
3605
|
const l = (...d) => {
|
|
3595
3606
|
u && o.current(...d);
|
|
3596
3607
|
};
|
|
3597
|
-
return n.subscribe(
|
|
3598
|
-
u = !1, n.unsubscribe(
|
|
3608
|
+
return n.subscribe(a, l), () => {
|
|
3609
|
+
u = !1, n.unsubscribe(a, l);
|
|
3599
3610
|
};
|
|
3600
3611
|
}, [s, n]);
|
|
3601
3612
|
}
|
|
3602
3613
|
function Zt(e, t, r) {
|
|
3603
3614
|
return Math.min(Math.max(e, r), t);
|
|
3604
3615
|
}
|
|
3605
|
-
class
|
|
3616
|
+
class jo extends Error {
|
|
3606
3617
|
constructor(t) {
|
|
3607
3618
|
super(`Failed to parse color: "${t}"`);
|
|
3608
3619
|
}
|
|
3609
3620
|
}
|
|
3610
|
-
var xe =
|
|
3611
|
-
function
|
|
3621
|
+
var xe = jo;
|
|
3622
|
+
function Do(e) {
|
|
3612
3623
|
if (typeof e != "string")
|
|
3613
3624
|
throw new xe(e);
|
|
3614
3625
|
if (e.trim().toLowerCase() === "transparent")
|
|
@@ -3617,27 +3628,27 @@ function jo(e) {
|
|
|
3617
3628
|
t = Xo.test(e) ? Lo(e) : e;
|
|
3618
3629
|
const r = zo.exec(t);
|
|
3619
3630
|
if (r) {
|
|
3620
|
-
const
|
|
3621
|
-
return [...
|
|
3631
|
+
const a = Array.from(r).slice(1);
|
|
3632
|
+
return [...a.slice(0, 3).map((u) => parseInt(ke(u, 2), 16)), parseInt(ke(a[3] || "f", 2), 16) / 255];
|
|
3622
3633
|
}
|
|
3623
3634
|
const n = Yo.exec(t);
|
|
3624
3635
|
if (n) {
|
|
3625
|
-
const
|
|
3626
|
-
return [...
|
|
3636
|
+
const a = Array.from(n).slice(1);
|
|
3637
|
+
return [...a.slice(0, 3).map((u) => parseInt(u, 16)), parseInt(a[3] || "ff", 16) / 255];
|
|
3627
3638
|
}
|
|
3628
3639
|
const o = Bo.exec(t);
|
|
3629
3640
|
if (o) {
|
|
3630
|
-
const
|
|
3631
|
-
return [...
|
|
3641
|
+
const a = Array.from(o).slice(1);
|
|
3642
|
+
return [...a.slice(0, 3).map((u) => parseInt(u, 10)), parseFloat(a[3] || "1")];
|
|
3632
3643
|
}
|
|
3633
3644
|
const s = No.exec(t);
|
|
3634
3645
|
if (s) {
|
|
3635
|
-
const [
|
|
3646
|
+
const [a, u, l, d] = Array.from(s).slice(1).map(parseFloat);
|
|
3636
3647
|
if (Zt(0, 100, u) !== u)
|
|
3637
3648
|
throw new xe(e);
|
|
3638
3649
|
if (Zt(0, 100, l) !== l)
|
|
3639
3650
|
throw new xe(e);
|
|
3640
|
-
return [...Uo(
|
|
3651
|
+
return [...Uo(a, u, l), Number.isNaN(d) ? 1 : d];
|
|
3641
3652
|
}
|
|
3642
3653
|
throw new xe(e);
|
|
3643
3654
|
}
|
|
@@ -3664,32 +3675,32 @@ const ke = (e, t) => Array.from(Array(t)).map(() => e).join(""), zo = new RegExp
|
|
|
3664
3675
|
let n = r / 100;
|
|
3665
3676
|
if (t === 0)
|
|
3666
3677
|
return [n, n, n].map(er);
|
|
3667
|
-
const o = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * n - 1)) * (t / 100),
|
|
3678
|
+
const o = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * n - 1)) * (t / 100), a = s * (1 - Math.abs(o % 2 - 1));
|
|
3668
3679
|
let u = 0, l = 0, d = 0;
|
|
3669
|
-
o >= 0 && o < 1 ? (u = s, l =
|
|
3670
|
-
const f = n - s / 2,
|
|
3671
|
-
return [
|
|
3680
|
+
o >= 0 && o < 1 ? (u = s, l = a) : o >= 1 && o < 2 ? (u = a, l = s) : o >= 2 && o < 3 ? (l = s, d = a) : o >= 3 && o < 4 ? (l = a, d = s) : o >= 4 && o < 5 ? (u = a, d = s) : o >= 5 && o < 6 && (u = s, d = a);
|
|
3681
|
+
const f = n - s / 2, c = u + f, h = l + f, _ = d + f;
|
|
3682
|
+
return [c, h, _].map(er);
|
|
3672
3683
|
};
|
|
3673
3684
|
function Wo(e) {
|
|
3674
3685
|
if (e === "transparent")
|
|
3675
3686
|
return 0;
|
|
3676
3687
|
function t(s) {
|
|
3677
|
-
const
|
|
3678
|
-
return
|
|
3688
|
+
const a = s / 255;
|
|
3689
|
+
return a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
|
|
3679
3690
|
}
|
|
3680
|
-
const [r, n, o] =
|
|
3691
|
+
const [r, n, o] = Do(e);
|
|
3681
3692
|
return 0.2126 * t(r) + 0.7152 * t(n) + 0.0722 * t(o);
|
|
3682
3693
|
}
|
|
3683
3694
|
function Vo(e) {
|
|
3684
3695
|
return Wo(e) > 0.179;
|
|
3685
3696
|
}
|
|
3686
|
-
const Fo =
|
|
3697
|
+
const Fo = K({
|
|
3687
3698
|
display: "flex",
|
|
3688
3699
|
flexDirection: "row",
|
|
3689
3700
|
alignItems: "center",
|
|
3690
3701
|
zIndex: 210,
|
|
3691
3702
|
pointerEvents: "none"
|
|
3692
|
-
}), Ko =
|
|
3703
|
+
}), Ko = K({
|
|
3693
3704
|
fontWeight: "bold",
|
|
3694
3705
|
padding: "0 0.5em",
|
|
3695
3706
|
borderRadius: "2px",
|
|
@@ -3702,8 +3713,8 @@ const Fo = H({
|
|
|
3702
3713
|
pointerEvents: "none"
|
|
3703
3714
|
}), Ho = ({ color: e = "#666", size: t = 40, text: r }) => {
|
|
3704
3715
|
const n = Vo(e) ? "#222" : "#EEE";
|
|
3705
|
-
return /* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ le("div", { className: Fo, children: [
|
|
3717
|
+
/* @__PURE__ */ le(
|
|
3707
3718
|
"svg",
|
|
3708
3719
|
{
|
|
3709
3720
|
version: "1.1",
|
|
@@ -3747,7 +3758,7 @@ const Fo = H({
|
|
|
3747
3758
|
}
|
|
3748
3759
|
)
|
|
3749
3760
|
] });
|
|
3750
|
-
}, qo = g.memo(Ho), Go =
|
|
3761
|
+
}, qo = g.memo(Ho), Go = K({
|
|
3751
3762
|
top: 0,
|
|
3752
3763
|
left: 0,
|
|
3753
3764
|
zIndex: 210,
|
|
@@ -3763,11 +3774,11 @@ const Fo = H({
|
|
|
3763
3774
|
children: /* @__PURE__ */ T(qo, { ...t })
|
|
3764
3775
|
}
|
|
3765
3776
|
), Zo = ({ children: e }) => {
|
|
3766
|
-
const [t] =
|
|
3777
|
+
const [t] = Q((v) => [
|
|
3767
3778
|
v.getConfiguration,
|
|
3768
3779
|
v.boardState.scale
|
|
3769
3780
|
// We want to update this component when the scale changes
|
|
3770
|
-
]), { fromWrapperToBoard: r, fromBoardToWrapper: n } = Me(), [o, s,
|
|
3781
|
+
]), { fromWrapperToBoard: r, fromBoardToWrapper: n } = Me(), [o, s, a, u] = Se(
|
|
3771
3782
|
(v) => [
|
|
3772
3783
|
v.getUser(),
|
|
3773
3784
|
v.getLocalUsers(),
|
|
@@ -3777,7 +3788,7 @@ const Fo = H({
|
|
|
3777
3788
|
), [l, d] = Se((v) => [
|
|
3778
3789
|
v.moveCursor,
|
|
3779
3790
|
v.removeCursor
|
|
3780
|
-
]), { boardWrapperRect: f } = t(),
|
|
3791
|
+
]), { boardWrapperRect: f } = t(), c = ({ clientX: v, clientY: E }) => {
|
|
3781
3792
|
const [I, y] = r(
|
|
3782
3793
|
v - f.left,
|
|
3783
3794
|
E - f.top
|
|
@@ -3785,18 +3796,18 @@ const Fo = H({
|
|
|
3785
3796
|
l(o.id, { x: I, y });
|
|
3786
3797
|
}, h = () => {
|
|
3787
3798
|
d(o.id);
|
|
3788
|
-
}, _ = s.reduce((v, E) => (E.id !== o.id &&
|
|
3789
|
-
return /* @__PURE__ */
|
|
3799
|
+
}, _ = s.reduce((v, E) => (E.id !== o.id && a[E.id] && (v[E.id] = a[E.id]), v), {});
|
|
3800
|
+
return /* @__PURE__ */ le("div", { onPointerMove: c, onPointerLeave: h, children: [
|
|
3790
3801
|
e,
|
|
3791
3802
|
Object.entries(_).map(([v, E]) => {
|
|
3792
|
-
const [I, y] = n(E.x, E.y),
|
|
3803
|
+
const [I, y] = n(E.x, E.y), C = {
|
|
3793
3804
|
x: I + f.left,
|
|
3794
3805
|
y: y + f.top
|
|
3795
3806
|
};
|
|
3796
|
-
return ft(
|
|
3807
|
+
return ft(C, f) ? /* @__PURE__ */ T(
|
|
3797
3808
|
Jo,
|
|
3798
3809
|
{
|
|
3799
|
-
pos:
|
|
3810
|
+
pos: C,
|
|
3800
3811
|
text: u[v].name,
|
|
3801
3812
|
color: u[v].color
|
|
3802
3813
|
},
|
|
@@ -3815,13 +3826,13 @@ const Fo = H({
|
|
|
3815
3826
|
itemTemplates: n = {},
|
|
3816
3827
|
boardSize: o = cr,
|
|
3817
3828
|
children: s,
|
|
3818
|
-
showResizeHandle:
|
|
3829
|
+
showResizeHandle: a = !1,
|
|
3819
3830
|
Wrapper: u = Qo
|
|
3820
3831
|
}) => {
|
|
3821
|
-
const l = g.useRef(null), [d, f] =
|
|
3832
|
+
const l = g.useRef(null), [d, f] = Q((v) => [
|
|
3822
3833
|
v.config.uid,
|
|
3823
3834
|
v.updateConfiguration
|
|
3824
|
-
]), { updateItemExtent:
|
|
3835
|
+
]), { updateItemExtent: c } = Me(), h = {
|
|
3825
3836
|
userSelect: "none",
|
|
3826
3837
|
width: `${o}px`,
|
|
3827
3838
|
height: `${o}px`,
|
|
@@ -3847,26 +3858,26 @@ const Fo = H({
|
|
|
3847
3858
|
f({
|
|
3848
3859
|
itemTemplates: n,
|
|
3849
3860
|
boardSize: o,
|
|
3850
|
-
showResizeHandle:
|
|
3861
|
+
showResizeHandle: a
|
|
3851
3862
|
});
|
|
3852
|
-
}, [n, o,
|
|
3863
|
+
}, [n, o, a, f]), g.useEffect(() => {
|
|
3853
3864
|
f({
|
|
3854
3865
|
boardWrapperRect: l.current.getBoundingClientRect()
|
|
3855
|
-
}),
|
|
3856
|
-
}, [f,
|
|
3866
|
+
}), c(), setTimeout(c, 2e3);
|
|
3867
|
+
}, [f, c]), Mo(l, () => {
|
|
3857
3868
|
l.current && f({
|
|
3858
3869
|
boardWrapperRect: l.current.getBoundingClientRect()
|
|
3859
3870
|
});
|
|
3860
3871
|
});
|
|
3861
|
-
const _ =
|
|
3862
|
-
return /* @__PURE__ */
|
|
3872
|
+
const _ = K({ ...es, ...r });
|
|
3873
|
+
return /* @__PURE__ */ le(
|
|
3863
3874
|
"div",
|
|
3864
3875
|
{
|
|
3865
3876
|
ref: l,
|
|
3866
3877
|
id: d,
|
|
3867
3878
|
className: `sync-board ${_}`,
|
|
3868
3879
|
children: [
|
|
3869
|
-
/* @__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__ */
|
|
3880
|
+
/* @__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(
|
|
3870
3881
|
"div",
|
|
3871
3882
|
{
|
|
3872
3883
|
onContextMenu: (v) => {
|