@woven-canvas/vue 1.7.2 → 1.7.3
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/build/composables/useImageCreation.d.ts.map +1 -1
- package/build/index.js +212 -216
- package/build/index.umd.cjs +17 -17
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Synced as Hh, defineCanvasSingleton as Vh, CanvasStore as W0 } from "@woven-ecs/canvas-store";
|
|
2
2
|
import { CanvasComponentDef as cI, CanvasSingletonDef as uI, CanvasStore as dI, Synced as fI, defineCanvasComponent as hI, defineCanvasSingleton as pI } from "@woven-ecs/canvas-store";
|
|
3
3
|
import { ArrowHeadKind as Qe, ArcArrow as fn, ElbowArrow as hn, createArrowsPlugin as j0 } from "@woven-canvas/plugin-arrows";
|
|
4
|
-
import { inject as ge, shallowRef as Ae, onUnmounted as $e, defineComponent as q, computed as O, openBlock as C, createElementBlock as A, unref as z, Fragment as ie, createElementVNode as x, createCommentVNode as j, ref as B, onMounted as kt, createBlock as ee, renderList as Se, toDisplayString as _e, normalizeStyle as ve, watch as pe, normalizeClass as Te, withAsyncContext as Dr, h as Xi, getCurrentInstance as Mc, watchEffect as Ws, nextTick as
|
|
5
|
-
import { hasComponent as Fe, Color as Zo, EmbedProvider as de, Embed as Ma, Block as le, Frame as js, FrameDropTarget as Y0, UploadState as
|
|
6
|
-
import { Arc as rn, Vec2 as
|
|
4
|
+
import { inject as ge, shallowRef as Ae, onUnmounted as $e, defineComponent as q, computed as O, openBlock as C, createElementBlock as A, unref as z, Fragment as ie, createElementVNode as x, createCommentVNode as j, ref as B, onMounted as kt, createBlock as ee, renderList as Se, toDisplayString as _e, normalizeStyle as ve, watch as pe, normalizeClass as Te, withAsyncContext as Dr, h as Xi, getCurrentInstance as Mc, watchEffect as Ws, nextTick as Jn, onBeforeUnmount as U0, markRaw as K0, customRef as q0, toValue as st, reactive as Wh, readonly as Rl, createVNode as Z, mergeProps as Xo, getCurrentScope as jh, onScopeDispose as Uh, shallowReadonly as Lo, provide as ho, withModifiers as ut, renderSlot as me, Teleport as ps, withCtx as se, Transition as Tc, withDirectives as Kh, withKeys as nd, vModelText as qh, useSlots as Jh, resolveDynamicComponent as Sa, createTextVNode as Ca, normalizeProps as Gh, guardReactiveProps as Yh, Suspense as J0, createSlots as G0 } from "vue";
|
|
5
|
+
import { hasComponent as Fe, Color as Zo, EmbedProvider as de, Embed as Ma, Block as le, Frame as js, FrameDropTarget as Y0, UploadState as Wn, Asset as gn, Image as Us, getBlockDef as Xh, Grid as Gn, RankBounds as Zh, createEntity as Zi, addComponent as He, Synced as Et, defineQuery as ct, Selected as Qi, Mouse as Ta, Camera as Pe, canBlockEdit as Ec, EditAfterPlacing as Ac, SelectBlock as X0, isAlive as Z0, cascadeDelete as Q0, getResources as cr, deselectAll as Ea, selectBlock as Aa, findFrameAtPoint as ey, AssignFrameChildren as ty, Text as it, getDescendants as ny, Aabb as Uo, DeselectAll as Ic, Edited as Oc, Screen as eo, TransformBoxStateSingleton as _c, TransformBoxState as oy, UpdateTransformBox as Dc, SelectionStateSingleton as el, SelectionState as Jr, TransformHandle as od, TransformHandleKind as ry, removeEntity as Ia, ResetKeyboard as sy, VerticalAlignment as Ze, StrokeKind as Tt, Shape as Gt, VerticalAlign as Ks, ResizeMode as Pl, DuplicateSelected as iy, BringForwardSelected as ly, SendBackwardSelected as ay, RemoveSelected as Qh, TextAlignment as un, getPluginResources as Io, Undo as Nc, Redo as qs, detectEmbedProvider as cy, validateEmbedUrl as uy, resolveEmbedUrl as dy, Controls as Bt, Cursor as Rc, field as pn, defineEditorState as fy, defineEditorSystem as tl, isReadonly as nl, getPointerInput as Pc, PointerButton as ep, PlaceBlockEvent as Js, Held as Oa, on as rd, Key as Ll, Connector as sd, Hovered as hy, Opacity as id, User as $l, Layer as py, UserData as my, Editor as gy, SINGLETON_ENTITY_ID as yy, EventType as $o, resolveLayerRank as ld, compareBlockOrder as vy } from "@woven-canvas/core";
|
|
6
|
+
import { Arc as rn, Vec2 as An, Aabb as Pn, Rect as wy } from "@woven-canvas/math";
|
|
7
7
|
import { EraserStroke as ky, POINTS_CAPACITY as ad, createEraserPlugin as by } from "@woven-canvas/plugin-eraser";
|
|
8
8
|
import { PenStrokeKind as _a, PenStroke as Da, createPenPlugin as xy } from "@woven-canvas/plugin-pen";
|
|
9
9
|
import { CONTROLS_PLUGIN_NAME as Sy, DEFAULT_CONTROLS_OPTIONS as Cy, CanvasControlsPlugin as My } from "@woven-canvas/plugin-canvas-controls";
|
|
@@ -64,7 +64,7 @@ function De(n, e) {
|
|
|
64
64
|
s();
|
|
65
65
|
}), o;
|
|
66
66
|
}
|
|
67
|
-
const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Iy = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Oy = ["points", "fill"], _y = ["cx", "cy", "r", "fill"], Dy = ["points", "fill"], Ny = 15, Ry = 2,
|
|
67
|
+
const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Iy = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Oy = ["points", "fill"], _y = ["cx", "cy", "r", "fill"], Dy = ["points", "fill"], Ny = 15, Ry = 2, Ln = /* @__PURE__ */ q({
|
|
68
68
|
__name: "ArrowHead",
|
|
69
69
|
props: {
|
|
70
70
|
position: {},
|
|
@@ -256,7 +256,7 @@ const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
256
256
|
"stroke-linecap": "round"
|
|
257
257
|
}, null, 8, $y)) : j("", !0),
|
|
258
258
|
m.value ? (C(), A(ie, { key: 2 }, [
|
|
259
|
-
m.value.startHead !== "none" ? (C(), ee(
|
|
259
|
+
m.value.startHead !== "none" ? (C(), ee(Ln, {
|
|
260
260
|
key: 0,
|
|
261
261
|
position: m.value.start,
|
|
262
262
|
direction: m.value.startDir,
|
|
@@ -265,7 +265,7 @@ const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
265
265
|
color: a.value,
|
|
266
266
|
kind: m.value.startHead
|
|
267
267
|
}, null, 8, ["position", "direction", "thickness", "arrow-thickness", "color", "kind"])) : j("", !0),
|
|
268
|
-
m.value.endHead !== "none" ? (C(), ee(
|
|
268
|
+
m.value.endHead !== "none" ? (C(), ee(Ln, {
|
|
269
269
|
key: 1,
|
|
270
270
|
position: m.value.end,
|
|
271
271
|
direction: m.value.endDir,
|
|
@@ -293,7 +293,7 @@ const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
293
293
|
style: { "stroke-width": "calc(2px / var(--wov-zoom))" },
|
|
294
294
|
"stroke-linecap": "round"
|
|
295
295
|
}, null, 8, zy)) : j("", !0),
|
|
296
|
-
m.value.startHead !== "none" ? (C(), ee(
|
|
296
|
+
m.value.startHead !== "none" ? (C(), ee(Ln, {
|
|
297
297
|
key: 2,
|
|
298
298
|
position: m.value.start,
|
|
299
299
|
direction: m.value.startDir,
|
|
@@ -302,7 +302,7 @@ const Ey = { key: 0 }, Ay = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
302
302
|
color: "var(--wov-highlighted-block-outline-color)",
|
|
303
303
|
kind: m.value.startHead
|
|
304
304
|
}, null, 8, ["position", "direction", "arrow-thickness", "kind"])) : j("", !0),
|
|
305
|
-
m.value.endHead !== "none" ? (C(), ee(
|
|
305
|
+
m.value.endHead !== "none" ? (C(), ee(Ln, {
|
|
306
306
|
key: 3,
|
|
307
307
|
position: m.value.end,
|
|
308
308
|
direction: m.value.endDir,
|
|
@@ -411,7 +411,7 @@ const Gy = /* @__PURE__ */ Oo(Ky, [["render", Jy]]), Yy = {
|
|
|
411
411
|
const _ = [];
|
|
412
412
|
for (let V = 0; V < g.length - 1; V++)
|
|
413
413
|
_.push({ start: g[V], end: g[V + 1] });
|
|
414
|
-
return
|
|
414
|
+
return An.scale(v, -1), {
|
|
415
415
|
points: g,
|
|
416
416
|
lines: _,
|
|
417
417
|
startPos: g[0],
|
|
@@ -451,7 +451,7 @@ const Gy = /* @__PURE__ */ Oo(Ky, [["render", Jy]]), Yy = {
|
|
|
451
451
|
"stroke-width": d.value,
|
|
452
452
|
"stroke-linecap": "round"
|
|
453
453
|
}, null, 8, Zy))), 128)),
|
|
454
|
-
p.value.startHead !== "none" ? (C(), ee(
|
|
454
|
+
p.value.startHead !== "none" ? (C(), ee(Ln, {
|
|
455
455
|
key: 0,
|
|
456
456
|
position: p.value.startPos,
|
|
457
457
|
direction: p.value.startDir,
|
|
@@ -460,7 +460,7 @@ const Gy = /* @__PURE__ */ Oo(Ky, [["render", Jy]]), Yy = {
|
|
|
460
460
|
color: c.value,
|
|
461
461
|
kind: p.value.startHead
|
|
462
462
|
}, null, 8, ["position", "direction", "thickness", "arrow-thickness", "color", "kind"])) : j("", !0),
|
|
463
|
-
p.value.endHead !== "none" ? (C(), ee(
|
|
463
|
+
p.value.endHead !== "none" ? (C(), ee(Ln, {
|
|
464
464
|
key: 1,
|
|
465
465
|
position: p.value.endPos,
|
|
466
466
|
direction: p.value.endDir,
|
|
@@ -481,7 +481,7 @@ const Gy = /* @__PURE__ */ Oo(Ky, [["render", Jy]]), Yy = {
|
|
|
481
481
|
style: { "stroke-width": "calc(2px / var(--wov-zoom))" },
|
|
482
482
|
"stroke-linecap": "round"
|
|
483
483
|
}, null, 8, Qy))), 128)),
|
|
484
|
-
p.value.startHead !== "none" ? (C(), ee(
|
|
484
|
+
p.value.startHead !== "none" ? (C(), ee(Ln, {
|
|
485
485
|
key: 0,
|
|
486
486
|
position: p.value.startPos,
|
|
487
487
|
direction: p.value.startDir,
|
|
@@ -490,7 +490,7 @@ const Gy = /* @__PURE__ */ Oo(Ky, [["render", Jy]]), Yy = {
|
|
|
490
490
|
color: "var(--wov-highlighted-block-outline-color)",
|
|
491
491
|
kind: p.value.startHead
|
|
492
492
|
}, null, 8, ["position", "direction", "arrow-thickness", "kind"])) : j("", !0),
|
|
493
|
-
p.value.endHead !== "none" ? (C(), ee(
|
|
493
|
+
p.value.endHead !== "none" ? (C(), ee(Ln, {
|
|
494
494
|
key: 1,
|
|
495
495
|
position: p.value.endPos,
|
|
496
496
|
direction: p.value.endDir,
|
|
@@ -594,13 +594,13 @@ function Xt(n, e) {
|
|
|
594
594
|
function hd(n, e, t) {
|
|
595
595
|
return n[0] = e[0] + t[0], n[1] = e[1] + t[1], n;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function jn(n, e) {
|
|
598
598
|
return [n[0] - e[0], n[1] - e[1]];
|
|
599
599
|
}
|
|
600
600
|
function Na(n, e, t) {
|
|
601
601
|
return n[0] = e[0] - t[0], n[1] = e[1] - t[1], n;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function $n(n, e) {
|
|
604
604
|
return [n[0] * e, n[1] * e];
|
|
605
605
|
}
|
|
606
606
|
function zl(n, e, t) {
|
|
@@ -644,18 +644,18 @@ function gd(n, e, t, o) {
|
|
|
644
644
|
return n[0] = a + t[0], n[1] = c + t[1], n;
|
|
645
645
|
}
|
|
646
646
|
function yd(n, e, t) {
|
|
647
|
-
return Xt(n,
|
|
647
|
+
return Xt(n, $n(jn(e, n), t));
|
|
648
648
|
}
|
|
649
649
|
function fv(n, e, t, o) {
|
|
650
650
|
let r = t[0] - e[0], s = t[1] - e[1];
|
|
651
651
|
return n[0] = e[0] + r * o, n[1] = e[1] + s * o, n;
|
|
652
652
|
}
|
|
653
653
|
function lp(n, e, t) {
|
|
654
|
-
return Xt(n,
|
|
654
|
+
return Xt(n, $n(e, t));
|
|
655
655
|
}
|
|
656
|
-
const Ye = [0, 0],
|
|
656
|
+
const Ye = [0, 0], Cn = [0, 0], Mn = [0, 0];
|
|
657
657
|
function hv(n, e) {
|
|
658
|
-
let t = lp(n, ip(sp(
|
|
658
|
+
let t = lp(n, ip(sp(jn(n, Xt(n, [1, 1])))), -e), o = [], r = 1 / 13;
|
|
659
659
|
for (let s = r; s <= 1; s += r) o.push(Bc(t, n, Yr * 2 * s));
|
|
660
660
|
return o;
|
|
661
661
|
}
|
|
@@ -665,8 +665,8 @@ function pv(n, e, t) {
|
|
|
665
665
|
return o;
|
|
666
666
|
}
|
|
667
667
|
function mv(n, e, t) {
|
|
668
|
-
let o =
|
|
669
|
-
return [
|
|
668
|
+
let o = jn(e, t), r = $n(o, 0.5), s = $n(o, 0.51);
|
|
669
|
+
return [jn(n, r), jn(n, s), Xt(n, s), Xt(n, r)];
|
|
670
670
|
}
|
|
671
671
|
function gv(n, e, t, o) {
|
|
672
672
|
let r = [], s = lp(n, e, t), i = 1 / o;
|
|
@@ -674,7 +674,7 @@ function gv(n, e, t, o) {
|
|
|
674
674
|
return r;
|
|
675
675
|
}
|
|
676
676
|
function yv(n, e, t) {
|
|
677
|
-
return [Xt(n,
|
|
677
|
+
return [Xt(n, $n(e, t)), Xt(n, $n(e, t * 0.99)), jn(n, $n(e, t * 0.99)), jn(n, $n(e, t))];
|
|
678
678
|
}
|
|
679
679
|
function vd(n, e, t) {
|
|
680
680
|
return n === !1 || n === void 0 ? 0 : n === !0 ? Math.max(e, t) : n;
|
|
@@ -695,18 +695,18 @@ function wv(n, e = {}) {
|
|
|
695
695
|
r ? (s && (X = rp(w, fe, t)), b = fd(t, r, X, i)) : b = t / 2, M === void 0 && (M = b);
|
|
696
696
|
let qe = ke < m ? d(ke / m) : 1, xt = p - ke < g ? h((p - ke) / g) : 1;
|
|
697
697
|
b = Math.max(0.01, b * Math.min(qe, xt));
|
|
698
|
-
let Dt = (Be ? n[J] : n[J + 1]).vector,
|
|
698
|
+
let Dt = (Be ? n[J] : n[J + 1]).vector, Sn = Be ? 1 : pd(re, Dt), yr = pd(re, S) < 0 && !N, oo = Sn !== null && Sn < 0;
|
|
699
699
|
if (yr || oo) {
|
|
700
700
|
Fl(Ye, S), zl(Ye, Ye, b);
|
|
701
|
-
for (let Vt = 0; Vt <= 1; Vt += 0.07692307692307693) Na(
|
|
701
|
+
for (let Vt = 0; Vt <= 1; Vt += 0.07692307692307693) Na(Cn, Y, Ye), gd(Cn, Cn, Y, Yr * Vt), _ = [Cn[0], Cn[1]], k.push(_), hd(Mn, Y, Ye), gd(Mn, Mn, Y, Yr * -Vt), D = [Mn[0], Mn[1]], v.push(D);
|
|
702
702
|
T = _, E = D, oo && (N = !0);
|
|
703
703
|
continue;
|
|
704
704
|
}
|
|
705
705
|
if (N = !1, Be) {
|
|
706
|
-
Fl(Ye, re), zl(Ye, Ye, b), k.push(
|
|
706
|
+
Fl(Ye, re), zl(Ye, Ye, b), k.push(jn(Y, Ye)), v.push(Xt(Y, Ye));
|
|
707
707
|
continue;
|
|
708
708
|
}
|
|
709
|
-
fv(Ye, Dt, re,
|
|
709
|
+
fv(Ye, Dt, re, Sn), Fl(Ye, Ye), zl(Ye, Ye, b), Na(Cn, Y, Ye), _ = [Cn[0], Cn[1]], (J <= 1 || md(T, _) > y) && (k.push(_), T = _), hd(Mn, Y, Ye), D = [Mn[0], Mn[1]], (J <= 1 || md(E, D) > y) && (v.push(D), E = D), w = X, S = re;
|
|
710
710
|
}
|
|
711
711
|
let R = [n[0].point[0], n[0].point[1]], W = n.length > 1 ? [n[n.length - 1].point[0], n[n.length - 1].point[1]] : Xt(n[0].point, [1, 1]), V = [], te = [];
|
|
712
712
|
if (n.length === 1) {
|
|
@@ -912,7 +912,7 @@ const Ev = { class: "wov-image-block" }, Av = {
|
|
|
912
912
|
throw new Error("ImageBlock must be used within a WovenCanvas component");
|
|
913
913
|
const s = r, i = De(o.entityId, gn), l = De(o.entityId, Us), a = s.getAssetManager(), c = O(() => {
|
|
914
914
|
const b = i.value;
|
|
915
|
-
return !(b != null && b.identifier) || b.uploadState !==
|
|
915
|
+
return !(b != null && b.identifier) || b.uploadState !== Wn.Pending && b.uploadState !== Wn.Uploading ? !1 : !(a != null && a.hasPendingUpload(b.identifier));
|
|
916
916
|
});
|
|
917
917
|
function u() {
|
|
918
918
|
var S, T;
|
|
@@ -961,7 +961,7 @@ const Ev = { class: "wov-image-block" }, Av = {
|
|
|
961
961
|
d.width = M.width, d.height = M.height;
|
|
962
962
|
const S = await (a == null ? void 0 : a.getDisplayUrl(b.identifier, M));
|
|
963
963
|
if (!y) return;
|
|
964
|
-
S ? k(S) : b.uploadState ===
|
|
964
|
+
S ? k(S) : b.uploadState === Wn.Failed && (g.value = !0, m.value = !1);
|
|
965
965
|
} catch (M) {
|
|
966
966
|
if (!y) return;
|
|
967
967
|
console.error("Failed to get display URL:", M), g.value = !0, m.value = !1;
|
|
@@ -4293,7 +4293,7 @@ function zc(n, e, t) {
|
|
|
4293
4293
|
}
|
|
4294
4294
|
return $.fromArray(o);
|
|
4295
4295
|
}
|
|
4296
|
-
class
|
|
4296
|
+
class Bn extends at {
|
|
4297
4297
|
/**
|
|
4298
4298
|
Create a mark step.
|
|
4299
4299
|
*/
|
|
@@ -4309,10 +4309,10 @@ class zn extends at {
|
|
|
4309
4309
|
}
|
|
4310
4310
|
map(e) {
|
|
4311
4311
|
let t = e.mapResult(this.from, 1), o = e.mapResult(this.to, -1);
|
|
4312
|
-
return t.deleted && o.deleted || t.pos >= o.pos ? null : new
|
|
4312
|
+
return t.deleted && o.deleted || t.pos >= o.pos ? null : new Bn(t.pos, o.pos, this.mark);
|
|
4313
4313
|
}
|
|
4314
4314
|
merge(e) {
|
|
4315
|
-
return e instanceof
|
|
4315
|
+
return e instanceof Bn && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Bn(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
|
|
4316
4316
|
}
|
|
4317
4317
|
toJSON() {
|
|
4318
4318
|
return {
|
|
@@ -4328,10 +4328,10 @@ class zn extends at {
|
|
|
4328
4328
|
static fromJSON(e, t) {
|
|
4329
4329
|
if (typeof t.from != "number" || typeof t.to != "number")
|
|
4330
4330
|
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
|
|
4331
|
-
return new
|
|
4331
|
+
return new Bn(t.from, t.to, e.markFromJSON(t.mark));
|
|
4332
4332
|
}
|
|
4333
4333
|
}
|
|
4334
|
-
at.jsonID("addMark",
|
|
4334
|
+
at.jsonID("addMark", Bn);
|
|
4335
4335
|
class Lt extends at {
|
|
4336
4336
|
/**
|
|
4337
4337
|
Create a mark-removing step.
|
|
@@ -4344,7 +4344,7 @@ class Lt extends at {
|
|
|
4344
4344
|
return Le.fromReplace(e, this.from, this.to, o);
|
|
4345
4345
|
}
|
|
4346
4346
|
invert() {
|
|
4347
|
-
return new
|
|
4347
|
+
return new Bn(this.from, this.to, this.mark);
|
|
4348
4348
|
}
|
|
4349
4349
|
map(e) {
|
|
4350
4350
|
let t = e.mapResult(this.from, 1), o = e.mapResult(this.to, -1);
|
|
@@ -4371,7 +4371,7 @@ class Lt extends at {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
}
|
|
4373
4373
|
at.jsonID("removeMark", Lt);
|
|
4374
|
-
class
|
|
4374
|
+
class zn extends at {
|
|
4375
4375
|
/**
|
|
4376
4376
|
Create a node mark step.
|
|
4377
4377
|
*/
|
|
@@ -4392,15 +4392,15 @@ class Fn extends at {
|
|
|
4392
4392
|
if (o.length == t.marks.length) {
|
|
4393
4393
|
for (let r = 0; r < t.marks.length; r++)
|
|
4394
4394
|
if (!t.marks[r].isInSet(o))
|
|
4395
|
-
return new
|
|
4396
|
-
return new
|
|
4395
|
+
return new zn(this.pos, t.marks[r]);
|
|
4396
|
+
return new zn(this.pos, this.mark);
|
|
4397
4397
|
}
|
|
4398
4398
|
}
|
|
4399
4399
|
return new So(this.pos, this.mark);
|
|
4400
4400
|
}
|
|
4401
4401
|
map(e) {
|
|
4402
4402
|
let t = e.mapResult(this.pos, 1);
|
|
4403
|
-
return t.deletedAfter ? null : new
|
|
4403
|
+
return t.deletedAfter ? null : new zn(t.pos, this.mark);
|
|
4404
4404
|
}
|
|
4405
4405
|
toJSON() {
|
|
4406
4406
|
return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
|
|
@@ -4411,10 +4411,10 @@ class Fn extends at {
|
|
|
4411
4411
|
static fromJSON(e, t) {
|
|
4412
4412
|
if (typeof t.pos != "number")
|
|
4413
4413
|
throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
|
|
4414
|
-
return new
|
|
4414
|
+
return new zn(t.pos, e.markFromJSON(t.mark));
|
|
4415
4415
|
}
|
|
4416
4416
|
}
|
|
4417
|
-
at.jsonID("addNodeMark",
|
|
4417
|
+
at.jsonID("addNodeMark", zn);
|
|
4418
4418
|
class So extends at {
|
|
4419
4419
|
/**
|
|
4420
4420
|
Create a mark-removing step.
|
|
@@ -4431,7 +4431,7 @@ class So extends at {
|
|
|
4431
4431
|
}
|
|
4432
4432
|
invert(e) {
|
|
4433
4433
|
let t = e.nodeAt(this.pos);
|
|
4434
|
-
return !t || !this.mark.isInSet(t.marks) ? this : new
|
|
4434
|
+
return !t || !this.mark.isInSet(t.marks) ? this : new zn(this.pos, this.mark);
|
|
4435
4435
|
}
|
|
4436
4436
|
map(e) {
|
|
4437
4437
|
let t = e.mapResult(this.pos, 1);
|
|
@@ -4584,7 +4584,7 @@ function h1(n, e, t, o) {
|
|
|
4584
4584
|
let f = Math.max(c, e), h = Math.min(c + a.nodeSize, t), p = o.addToSet(d);
|
|
4585
4585
|
for (let m = 0; m < d.length; m++)
|
|
4586
4586
|
d[m].isInSet(p) || (i && i.to == f && i.mark.eq(d[m]) ? i.to = h : r.push(i = new Lt(f, h, d[m])));
|
|
4587
|
-
l && l.to == f ? l.to = h : s.push(l = new
|
|
4587
|
+
l && l.to == f ? l.to = h : s.push(l = new Bn(f, h, o));
|
|
4588
4588
|
}
|
|
4589
4589
|
}), r.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
|
|
4590
4590
|
}
|
|
@@ -5412,7 +5412,7 @@ class Fp {
|
|
|
5412
5412
|
Add a mark to the node at position `pos`.
|
|
5413
5413
|
*/
|
|
5414
5414
|
addNodeMark(e, t) {
|
|
5415
|
-
return this.step(new
|
|
5415
|
+
return this.step(new zn(e, t)), this;
|
|
5416
5416
|
}
|
|
5417
5417
|
/**
|
|
5418
5418
|
Remove a mark (or all marks of the given type) from the node at
|
|
@@ -6831,7 +6831,7 @@ function cw(n, e, t) {
|
|
|
6831
6831
|
return { node: o.startContainer, offset: Math.min(At(o.startContainer), o.startOffset) };
|
|
6832
6832
|
}
|
|
6833
6833
|
}
|
|
6834
|
-
const Zt = typeof navigator < "u" ? navigator : null, Wd = typeof document < "u" ? document : null, to = Zt && Zt.userAgent || "", Va = /Edge\/(\d+)/.exec(to), tm = /MSIE \d/.exec(to), Wa = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(to), gt = !!(tm || Wa || Va),
|
|
6834
|
+
const Zt = typeof navigator < "u" ? navigator : null, Wd = typeof document < "u" ? document : null, to = Zt && Zt.userAgent || "", Va = /Edge\/(\d+)/.exec(to), tm = /MSIE \d/.exec(to), Wa = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(to), gt = !!(tm || Wa || Va), Un = tm ? document.documentMode : Wa ? +Wa[1] : Va ? +Va[1] : 0, It = !gt && /gecko\/(\d+)/i.test(to);
|
|
6835
6835
|
It && +(/Firefox\/(\d+)/.exec(to) || [0, 0])[1];
|
|
6836
6836
|
const ja = !gt && /Chrome\/(\d+)/.exec(to), nt = !!ja, nm = ja ? +ja[1] : 0, lt = !gt && !!Zt && /Apple Computer/.test(Zt.vendor), nr = lt && (/Mobile\/\w+/.test(to) || !!Zt && Zt.maxTouchPoints > 2), Mt = nr || (Zt ? /Mac/.test(Zt.platform) : !1), om = Zt ? /Win/.test(Zt.platform) : !1, mn = /Android \d/.test(to), gs = !!Wd && "webkitFontSmoothing" in Wd.documentElement.style, uw = gs ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6837
6837
|
function dw(n) {
|
|
@@ -6958,7 +6958,7 @@ function gw(n, e) {
|
|
|
6958
6958
|
let t = n.nodeValue.length, o = document.createRange(), r;
|
|
6959
6959
|
for (let s = 0; s < t; s++) {
|
|
6960
6960
|
o.setEnd(n, s + 1), o.setStart(n, s);
|
|
6961
|
-
let i =
|
|
6961
|
+
let i = En(o, 1);
|
|
6962
6962
|
if (i.top != i.bottom && qc(e, i)) {
|
|
6963
6963
|
r = { node: n, offset: s + (e.left >= (i.left + i.right) / 2 ? 1 : 0) };
|
|
6964
6964
|
break;
|
|
@@ -7039,7 +7039,7 @@ function kw(n, e) {
|
|
|
7039
7039
|
function Ud(n) {
|
|
7040
7040
|
return n.top < n.bottom || n.left < n.right;
|
|
7041
7041
|
}
|
|
7042
|
-
function
|
|
7042
|
+
function En(n, e) {
|
|
7043
7043
|
let t = n.getClientRects();
|
|
7044
7044
|
if (t.length) {
|
|
7045
7045
|
let o = t[e < 0 ? 0 : t.length - 1];
|
|
@@ -7053,11 +7053,11 @@ function am(n, e, t) {
|
|
|
7053
7053
|
let { node: o, offset: r, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), i = gs || It;
|
|
7054
7054
|
if (o.nodeType == 3)
|
|
7055
7055
|
if (i && (bw.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
|
|
7056
|
-
let a =
|
|
7056
|
+
let a = En(dn(o, r, r), t);
|
|
7057
7057
|
if (It && r && /\s/.test(o.nodeValue[r - 1]) && r < o.nodeValue.length) {
|
|
7058
|
-
let c =
|
|
7058
|
+
let c = En(dn(o, r - 1, r - 1), -1);
|
|
7059
7059
|
if (c.top == a.top) {
|
|
7060
|
-
let u =
|
|
7060
|
+
let u = En(dn(o, r, r + 1), -1);
|
|
7061
7061
|
if (u.top != a.top)
|
|
7062
7062
|
return kr(u, u.left < c.left);
|
|
7063
7063
|
}
|
|
@@ -7065,7 +7065,7 @@ function am(n, e, t) {
|
|
|
7065
7065
|
return a;
|
|
7066
7066
|
} else {
|
|
7067
7067
|
let a = r, c = r, u = t < 0 ? 1 : -1;
|
|
7068
|
-
return t < 0 && !r ? (c++, u = -1) : t >= 0 && r == o.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, kr(
|
|
7068
|
+
return t < 0 && !r ? (c++, u = -1) : t >= 0 && r == o.nodeValue.length ? (a--, u = 1) : t < 0 ? a-- : c++, kr(En(dn(o, a, c), u), u < 0);
|
|
7069
7069
|
}
|
|
7070
7070
|
if (!n.state.doc.resolve(e - (s || 0)).parent.inlineContent) {
|
|
7071
7071
|
if (s == null && r && (t < 0 || r == At(o))) {
|
|
@@ -7083,7 +7083,7 @@ function am(n, e, t) {
|
|
|
7083
7083
|
if (s == null && r && (t < 0 || r == At(o))) {
|
|
7084
7084
|
let a = o.childNodes[r - 1], c = a.nodeType == 3 ? dn(a, At(a) - (i ? 0 : 1)) : a.nodeType == 1 && (a.nodeName != "BR" || !a.nextSibling) ? a : null;
|
|
7085
7085
|
if (c)
|
|
7086
|
-
return kr(
|
|
7086
|
+
return kr(En(c, 1), !1);
|
|
7087
7087
|
}
|
|
7088
7088
|
if (s == null && r < At(o)) {
|
|
7089
7089
|
let a = o.childNodes[r];
|
|
@@ -7091,9 +7091,9 @@ function am(n, e, t) {
|
|
|
7091
7091
|
a = a.nextSibling;
|
|
7092
7092
|
let c = a ? a.nodeType == 3 ? dn(a, 0, i ? 0 : 1) : a.nodeType == 1 ? a : null : null;
|
|
7093
7093
|
if (c)
|
|
7094
|
-
return kr(
|
|
7094
|
+
return kr(En(c, -1), !0);
|
|
7095
7095
|
}
|
|
7096
|
-
return kr(
|
|
7096
|
+
return kr(En(o.nodeType == 3 ? dn(o) : o, -t), t >= 0);
|
|
7097
7097
|
}
|
|
7098
7098
|
function kr(n, e) {
|
|
7099
7099
|
if (n.width == 0)
|
|
@@ -7610,7 +7610,7 @@ class Mo extends ys {
|
|
|
7610
7610
|
this.spec.destroy && this.spec.destroy(), super.destroy();
|
|
7611
7611
|
}
|
|
7612
7612
|
}
|
|
7613
|
-
class
|
|
7613
|
+
class Kn extends ys {
|
|
7614
7614
|
constructor(e, t, o, r, s, i, l, a, c) {
|
|
7615
7615
|
super(e, [], s, i), this.node = t, this.outerDeco = o, this.innerDeco = r, this.nodeDOM = l;
|
|
7616
7616
|
}
|
|
@@ -7638,7 +7638,7 @@ class qn extends ys {
|
|
|
7638
7638
|
} else u || ({ dom: u, contentDOM: d } = _o.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
|
|
7639
7639
|
!d && !t.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), t.type.spec.draggable && (u.draggable = !0));
|
|
7640
7640
|
let f = u;
|
|
7641
|
-
return u = pm(u, o, t), c ? a = new Ew(e, t, o, r, u, d || null, f, c, s, i + 1) : t.isText ? new al(e, t, o, r, u, f, s) : new
|
|
7641
|
+
return u = pm(u, o, t), c ? a = new Ew(e, t, o, r, u, d || null, f, c, s, i + 1) : t.isText ? new al(e, t, o, r, u, f, s) : new Kn(e, t, o, r, u, d || null, f, s, i + 1);
|
|
7642
7642
|
}
|
|
7643
7643
|
parseRule() {
|
|
7644
7644
|
if (this.node.type.spec.reparseInView)
|
|
@@ -7738,10 +7738,10 @@ class qn extends ys {
|
|
|
7738
7738
|
}
|
|
7739
7739
|
function Yd(n, e, t, o, r) {
|
|
7740
7740
|
pm(o, e, n);
|
|
7741
|
-
let s = new
|
|
7741
|
+
let s = new Kn(void 0, n, e, t, o, o, o, r, 0);
|
|
7742
7742
|
return s.contentDOM && s.updateChildren(r, 0), s;
|
|
7743
7743
|
}
|
|
7744
|
-
class al extends
|
|
7744
|
+
class al extends Kn {
|
|
7745
7745
|
constructor(e, t, o, r, s, i, l) {
|
|
7746
7746
|
super(e, t, o, r, s, null, i, l, 0);
|
|
7747
7747
|
}
|
|
@@ -7798,7 +7798,7 @@ class dm extends ys {
|
|
|
7798
7798
|
return this.dom.nodeName == "IMG";
|
|
7799
7799
|
}
|
|
7800
7800
|
}
|
|
7801
|
-
class Ew extends
|
|
7801
|
+
class Ew extends Kn {
|
|
7802
7802
|
constructor(e, t, o, r, s, i, l, a, c, u) {
|
|
7803
7803
|
super(e, t, o, r, s, i, l, c, u), this.spec = a;
|
|
7804
7804
|
}
|
|
@@ -8010,7 +8010,7 @@ class Iw {
|
|
|
8010
8010
|
updateNextNode(e, t, o, r, s, i) {
|
|
8011
8011
|
for (let l = this.index; l < this.top.children.length; l++) {
|
|
8012
8012
|
let a = this.top.children[l];
|
|
8013
|
-
if (a instanceof
|
|
8013
|
+
if (a instanceof Kn) {
|
|
8014
8014
|
let c = this.preMatch.matched.get(a);
|
|
8015
8015
|
if (c != null && c != s)
|
|
8016
8016
|
return !1;
|
|
@@ -8029,7 +8029,7 @@ class Iw {
|
|
|
8029
8029
|
recreateWrapper(e, t, o, r, s, i) {
|
|
8030
8030
|
if (e.dirty || t.isAtom || !e.children.length || !e.node.content.eq(t.content) || !ni(o, e.outerDeco) || !r.eq(e.innerDeco))
|
|
8031
8031
|
return null;
|
|
8032
|
-
let l =
|
|
8032
|
+
let l = Kn.create(this.top, t, o, r, s, i);
|
|
8033
8033
|
if (l.contentDOM) {
|
|
8034
8034
|
l.children = e.children, e.children = [];
|
|
8035
8035
|
for (let a of l.children)
|
|
@@ -8039,7 +8039,7 @@ class Iw {
|
|
|
8039
8039
|
}
|
|
8040
8040
|
// Insert the node as a newly created node desc.
|
|
8041
8041
|
addNode(e, t, o, r, s) {
|
|
8042
|
-
let i =
|
|
8042
|
+
let i = Kn.create(this.top, e, t, o, r, s);
|
|
8043
8043
|
i.contentDOM && i.updateChildren(r, s + 1), this.top.children.splice(this.index++, 0, i), this.changed = !0;
|
|
8044
8044
|
}
|
|
8045
8045
|
placeWidget(e, t, o) {
|
|
@@ -8283,7 +8283,7 @@ function Lw(n) {
|
|
|
8283
8283
|
if (!e)
|
|
8284
8284
|
return;
|
|
8285
8285
|
let t = n.cursorWrapper.dom, o = t.nodeName == "IMG";
|
|
8286
|
-
o ? e.collapse(t.parentNode, et(t) + 1) : e.collapse(t, 0), !o && !n.state.selection.visible && gt &&
|
|
8286
|
+
o ? e.collapse(t.parentNode, et(t) + 1) : e.collapse(t, 0), !o && !n.state.selection.visible && gt && Un <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
8287
8287
|
}
|
|
8288
8288
|
function gm(n, e) {
|
|
8289
8289
|
if (e instanceof oe) {
|
|
@@ -8319,7 +8319,7 @@ function qa(n, e) {
|
|
|
8319
8319
|
let { $anchor: t, $head: o } = n.selection, r = e > 0 ? t.max(o) : t.min(o), s = r.parent.inlineContent ? r.depth ? n.doc.resolve(e > 0 ? r.after() : r.before()) : null : r;
|
|
8320
8320
|
return s && ue.findFrom(s, e);
|
|
8321
8321
|
}
|
|
8322
|
-
function
|
|
8322
|
+
function In(n, e) {
|
|
8323
8323
|
return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()), !0;
|
|
8324
8324
|
}
|
|
8325
8325
|
function of(n, e, t) {
|
|
@@ -8330,25 +8330,25 @@ function of(n, e, t) {
|
|
|
8330
8330
|
if (!s || s.isText || !s.isLeaf)
|
|
8331
8331
|
return !1;
|
|
8332
8332
|
let i = n.state.doc.resolve(r.pos + s.nodeSize * (e < 0 ? -1 : 1));
|
|
8333
|
-
return
|
|
8333
|
+
return In(n, new ae(o.$anchor, i));
|
|
8334
8334
|
} else if (o.empty) {
|
|
8335
8335
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
8336
8336
|
let r = qa(n.state, e);
|
|
8337
|
-
return r && r instanceof oe ?
|
|
8337
|
+
return r && r instanceof oe ? In(n, r) : !1;
|
|
8338
8338
|
} else if (!(Mt && t.indexOf("m") > -1)) {
|
|
8339
8339
|
let r = o.$head, s = r.textOffset ? null : e < 0 ? r.nodeBefore : r.nodeAfter, i;
|
|
8340
8340
|
if (!s || s.isText)
|
|
8341
8341
|
return !1;
|
|
8342
8342
|
let l = e < 0 ? r.pos - s.nodeSize : r.pos;
|
|
8343
|
-
return s.isAtom || (i = n.docView.descAt(l)) && !i.contentDOM ? oe.isSelectable(s) ?
|
|
8343
|
+
return s.isAtom || (i = n.docView.descAt(l)) && !i.contentDOM ? oe.isSelectable(s) ? In(n, new oe(e < 0 ? n.state.doc.resolve(r.pos - s.nodeSize) : r)) : gs ? In(n, new ae(n.state.doc.resolve(e < 0 ? l : l + s.nodeSize))) : !1 : !1;
|
|
8344
8344
|
}
|
|
8345
8345
|
} else return !1;
|
|
8346
8346
|
else {
|
|
8347
8347
|
if (o instanceof oe && o.node.isInline)
|
|
8348
|
-
return
|
|
8348
|
+
return In(n, new ae(e > 0 ? o.$to : o.$from));
|
|
8349
8349
|
{
|
|
8350
8350
|
let r = qa(n.state, e);
|
|
8351
|
-
return r ?
|
|
8351
|
+
return r ? In(n, r) : !1;
|
|
8352
8352
|
}
|
|
8353
8353
|
}
|
|
8354
8354
|
}
|
|
@@ -8501,11 +8501,11 @@ function sf(n, e, t) {
|
|
|
8501
8501
|
if (!r.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
8502
8502
|
let i = qa(n.state, e);
|
|
8503
8503
|
if (i && i instanceof oe)
|
|
8504
|
-
return
|
|
8504
|
+
return In(n, i);
|
|
8505
8505
|
}
|
|
8506
8506
|
if (!r.parent.inlineContent) {
|
|
8507
8507
|
let i = e < 0 ? r : s, l = o instanceof vt ? ue.near(i, e) : ue.findFrom(i, e);
|
|
8508
|
-
return l ?
|
|
8508
|
+
return l ? In(n, l) : !1;
|
|
8509
8509
|
}
|
|
8510
8510
|
return !1;
|
|
8511
8511
|
}
|
|
@@ -8772,7 +8772,7 @@ function Qw(n) {
|
|
|
8772
8772
|
}
|
|
8773
8773
|
lt && n.dom.addEventListener("input", () => null), Ya(n);
|
|
8774
8774
|
}
|
|
8775
|
-
function
|
|
8775
|
+
function Fn(n, e) {
|
|
8776
8776
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
8777
8777
|
}
|
|
8778
8778
|
function ek(n) {
|
|
@@ -8814,7 +8814,7 @@ ht.keydown = (n, e) => {
|
|
|
8814
8814
|
n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
8815
8815
|
n.input.lastIOSEnter == o && (n.someProp("handleKeyDown", (r) => r(n, so(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
8816
8816
|
}, 200);
|
|
8817
|
-
} else n.someProp("handleKeyDown", (o) => o(n, t)) || jw(n, t) ? t.preventDefault() :
|
|
8817
|
+
} else n.someProp("handleKeyDown", (o) => o(n, t)) || jw(n, t) ? t.preventDefault() : Fn(n, "key");
|
|
8818
8818
|
};
|
|
8819
8819
|
ht.keyup = (n, e) => {
|
|
8820
8820
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
@@ -8913,7 +8913,7 @@ ft.mousedown = (n, e) => {
|
|
|
8913
8913
|
let o = Qc(n), r = Date.now(), s = "singleClick";
|
|
8914
8914
|
r - n.input.lastClick.time < 500 && ok(t, n.input.lastClick) && !t[Mm] && n.input.lastClick.button == t.button && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: s, button: t.button };
|
|
8915
8915
|
let i = n.posAtCoords(cl(t));
|
|
8916
|
-
i && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new uk(n, i, t, !!o)) : (s == "doubleClick" ? lk : ak)(n, i.pos, i.inside, t) ? t.preventDefault() :
|
|
8916
|
+
i && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new uk(n, i, t, !!o)) : (s == "doubleClick" ? lk : ak)(n, i.pos, i.inside, t) ? t.preventDefault() : Fn(n, "pointer"));
|
|
8917
8917
|
};
|
|
8918
8918
|
class uk {
|
|
8919
8919
|
constructor(e, t, o, r) {
|
|
@@ -8935,7 +8935,7 @@ class uk {
|
|
|
8935
8935
|
setUneditable: !!(this.target && It && !this.target.hasAttribute("contentEditable"))
|
|
8936
8936
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
8937
8937
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
8938
|
-
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)),
|
|
8938
|
+
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), Fn(e, "pointer");
|
|
8939
8939
|
}
|
|
8940
8940
|
done() {
|
|
8941
8941
|
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => kn(this.view)), this.view.input.mouseDown = null;
|
|
@@ -8944,7 +8944,7 @@ class uk {
|
|
|
8944
8944
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
8945
8945
|
return;
|
|
8946
8946
|
let t = this.pos;
|
|
8947
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(cl(e))), this.updateAllowDefault(e), this.allowDefault || !t ?
|
|
8947
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(cl(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fn(this.view, "pointer") : ik(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
8948
8948
|
lt && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
8949
8949
|
// cursor, but still report that the node is selected
|
|
8950
8950
|
// when asked through getSelection. You'll then get a
|
|
@@ -8952,20 +8952,20 @@ class uk {
|
|
|
8952
8952
|
// (hidden) cursor is doesn't change the selection, and
|
|
8953
8953
|
// thus doesn't get a reaction from ProseMirror. This
|
|
8954
8954
|
// works around that.
|
|
8955
|
-
nt && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (Go(this.view, ue.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) :
|
|
8955
|
+
nt && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (Go(this.view, ue.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : Fn(this.view, "pointer");
|
|
8956
8956
|
}
|
|
8957
8957
|
move(e) {
|
|
8958
|
-
this.updateAllowDefault(e),
|
|
8958
|
+
this.updateAllowDefault(e), Fn(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
8959
8959
|
}
|
|
8960
8960
|
updateAllowDefault(e) {
|
|
8961
8961
|
!this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
|
|
8962
8962
|
}
|
|
8963
8963
|
}
|
|
8964
8964
|
ft.touchstart = (n) => {
|
|
8965
|
-
n.input.lastTouch = Date.now(), Qc(n),
|
|
8965
|
+
n.input.lastTouch = Date.now(), Qc(n), Fn(n, "pointer");
|
|
8966
8966
|
};
|
|
8967
8967
|
ft.touchmove = (n) => {
|
|
8968
|
-
n.input.lastTouch = Date.now(),
|
|
8968
|
+
n.input.lastTouch = Date.now(), Fn(n, "pointer");
|
|
8969
8969
|
};
|
|
8970
8970
|
ft.contextmenu = (n) => Qc(n);
|
|
8971
8971
|
function Tm(n, e) {
|
|
@@ -9055,7 +9055,7 @@ function mk(n, e) {
|
|
|
9055
9055
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
9056
9056
|
}, 50);
|
|
9057
9057
|
}
|
|
9058
|
-
const ts = gt &&
|
|
9058
|
+
const ts = gt && Un < 15 || nr && uw < 604;
|
|
9059
9059
|
ft.copy = ht.cut = (n, e) => {
|
|
9060
9060
|
let t = e, o = n.state.selection, r = t.type == "cut";
|
|
9061
9061
|
if (o.empty)
|
|
@@ -9228,7 +9228,7 @@ class si {
|
|
|
9228
9228
|
this.spec.destroy && this.spec.destroy(e);
|
|
9229
9229
|
}
|
|
9230
9230
|
}
|
|
9231
|
-
class
|
|
9231
|
+
class qn {
|
|
9232
9232
|
constructor(e, t) {
|
|
9233
9233
|
this.attrs = e, this.spec = t || go;
|
|
9234
9234
|
}
|
|
@@ -9240,10 +9240,10 @@ class Jn {
|
|
|
9240
9240
|
return t.from < t.to;
|
|
9241
9241
|
}
|
|
9242
9242
|
eq(e) {
|
|
9243
|
-
return this == e || e instanceof
|
|
9243
|
+
return this == e || e instanceof qn && rs(this.attrs, e.attrs) && rs(this.spec, e.spec);
|
|
9244
9244
|
}
|
|
9245
9245
|
static is(e) {
|
|
9246
|
-
return e.type instanceof
|
|
9246
|
+
return e.type instanceof qn;
|
|
9247
9247
|
}
|
|
9248
9248
|
destroy() {
|
|
9249
9249
|
}
|
|
@@ -9310,7 +9310,7 @@ class dt {
|
|
|
9310
9310
|
each inline node between `from` and `to`.
|
|
9311
9311
|
*/
|
|
9312
9312
|
static inline(e, t, o, r) {
|
|
9313
|
-
return new dt(e, t, new
|
|
9313
|
+
return new dt(e, t, new qn(o, r));
|
|
9314
9314
|
}
|
|
9315
9315
|
/**
|
|
9316
9316
|
Creates a node decoration. `from` and `to` should point precisely
|
|
@@ -9331,7 +9331,7 @@ class dt {
|
|
|
9331
9331
|
@internal
|
|
9332
9332
|
*/
|
|
9333
9333
|
get inline() {
|
|
9334
|
-
return this.type instanceof
|
|
9334
|
+
return this.type instanceof qn;
|
|
9335
9335
|
}
|
|
9336
9336
|
/**
|
|
9337
9337
|
@internal
|
|
@@ -9462,14 +9462,14 @@ class Ee {
|
|
|
9462
9462
|
let s = e + 1, i = s + t.content.size;
|
|
9463
9463
|
for (let l = 0; l < this.local.length; l++) {
|
|
9464
9464
|
let a = this.local[l];
|
|
9465
|
-
if (a.from < i && a.to > s && a.type instanceof
|
|
9465
|
+
if (a.from < i && a.to > s && a.type instanceof qn) {
|
|
9466
9466
|
let c = Math.max(s, a.from) - s, u = Math.min(i, a.to) - s;
|
|
9467
9467
|
c < u && (r || (r = [])).push(a.copy(c, u));
|
|
9468
9468
|
}
|
|
9469
9469
|
}
|
|
9470
9470
|
if (r) {
|
|
9471
9471
|
let l = new Ee(r.sort(yo), Vo);
|
|
9472
|
-
return o ? new
|
|
9472
|
+
return o ? new Dn([l, o]) : l;
|
|
9473
9473
|
}
|
|
9474
9474
|
return o || rt;
|
|
9475
9475
|
}
|
|
@@ -9501,11 +9501,11 @@ class Ee {
|
|
|
9501
9501
|
localsInner(e) {
|
|
9502
9502
|
if (this == rt)
|
|
9503
9503
|
return Vo;
|
|
9504
|
-
if (e.inlineContent || !this.local.some(
|
|
9504
|
+
if (e.inlineContent || !this.local.some(qn.is))
|
|
9505
9505
|
return this.local;
|
|
9506
9506
|
let t = [];
|
|
9507
9507
|
for (let o = 0; o < this.local.length; o++)
|
|
9508
|
-
this.local[o].type instanceof
|
|
9508
|
+
this.local[o].type instanceof qn || t.push(this.local[o]);
|
|
9509
9509
|
return t;
|
|
9510
9510
|
}
|
|
9511
9511
|
forEachSet(e) {
|
|
@@ -9515,13 +9515,13 @@ class Ee {
|
|
|
9515
9515
|
Ee.empty = new Ee([], []);
|
|
9516
9516
|
Ee.removeOverlap = tu;
|
|
9517
9517
|
const rt = Ee.empty;
|
|
9518
|
-
class
|
|
9518
|
+
class Dn {
|
|
9519
9519
|
constructor(e) {
|
|
9520
9520
|
this.members = e;
|
|
9521
9521
|
}
|
|
9522
9522
|
map(e, t) {
|
|
9523
9523
|
const o = this.members.map((r) => r.map(e, t, go));
|
|
9524
|
-
return
|
|
9524
|
+
return Dn.from(o);
|
|
9525
9525
|
}
|
|
9526
9526
|
forChild(e, t) {
|
|
9527
9527
|
if (t.isLeaf)
|
|
@@ -9529,12 +9529,12 @@ class Nn {
|
|
|
9529
9529
|
let o = [];
|
|
9530
9530
|
for (let r = 0; r < this.members.length; r++) {
|
|
9531
9531
|
let s = this.members[r].forChild(e, t);
|
|
9532
|
-
s != rt && (s instanceof
|
|
9532
|
+
s != rt && (s instanceof Dn ? o = o.concat(s.members) : o.push(s));
|
|
9533
9533
|
}
|
|
9534
|
-
return
|
|
9534
|
+
return Dn.from(o);
|
|
9535
9535
|
}
|
|
9536
9536
|
eq(e) {
|
|
9537
|
-
if (!(e instanceof
|
|
9537
|
+
if (!(e instanceof Dn) || e.members.length != this.members.length)
|
|
9538
9538
|
return !1;
|
|
9539
9539
|
for (let t = 0; t < this.members.length; t++)
|
|
9540
9540
|
if (!this.members[t].eq(e.members[t]))
|
|
@@ -9565,7 +9565,7 @@ class Nn {
|
|
|
9565
9565
|
case 1:
|
|
9566
9566
|
return e[0];
|
|
9567
9567
|
default:
|
|
9568
|
-
return new
|
|
9568
|
+
return new Dn(e.every((t) => t instanceof Ee) ? e : e.reduce((t, o) => t.concat(o instanceof Ee ? o : o.members), []));
|
|
9569
9569
|
}
|
|
9570
9570
|
}
|
|
9571
9571
|
forEachSet(e) {
|
|
@@ -9705,7 +9705,7 @@ function Zl(n) {
|
|
|
9705
9705
|
return n.someProp("decorations", (t) => {
|
|
9706
9706
|
let o = t(n.state);
|
|
9707
9707
|
o && o != rt && e.push(o);
|
|
9708
|
-
}), n.cursorWrapper && e.push(Ee.create(n.state.doc, [n.cursorWrapper.deco])),
|
|
9708
|
+
}), n.cursorWrapper && e.push(Ee.create(n.state.doc, [n.cursorWrapper.deco])), Dn.from(e);
|
|
9709
9709
|
}
|
|
9710
9710
|
const xk = {
|
|
9711
9711
|
childList: !0,
|
|
@@ -9714,7 +9714,7 @@ const xk = {
|
|
|
9714
9714
|
attributes: !0,
|
|
9715
9715
|
attributeOldValue: !0,
|
|
9716
9716
|
subtree: !0
|
|
9717
|
-
}, Sk = gt &&
|
|
9717
|
+
}, Sk = gt && Un <= 11;
|
|
9718
9718
|
class Ck {
|
|
9719
9719
|
constructor() {
|
|
9720
9720
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
@@ -9734,7 +9734,7 @@ class Mk {
|
|
|
9734
9734
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Ck(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
|
|
9735
9735
|
for (let r = 0; r < o.length; r++)
|
|
9736
9736
|
this.queue.push(o[r]);
|
|
9737
|
-
gt &&
|
|
9737
|
+
gt && Un <= 11 && o.some((r) => r.type == "childList" && r.removedNodes.length || r.type == "characterData" && r.oldValue.length > r.target.nodeValue.length) ? this.flushSoon() : lt && e.composing && o.some((r) => r.type == "childList" && r.target.nodeName == "TR") ? (e.input.badSafariComposition = !0, this.flushSoon()) : this.flush();
|
|
9738
9738
|
}), Sk && (this.onCharData = (o) => {
|
|
9739
9739
|
this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
|
|
9740
9740
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
@@ -9775,7 +9775,7 @@ class Mk {
|
|
|
9775
9775
|
if (nf(this.view)) {
|
|
9776
9776
|
if (this.suppressingSelectionUpdates)
|
|
9777
9777
|
return kn(this.view);
|
|
9778
|
-
if (gt &&
|
|
9778
|
+
if (gt && Un <= 11 && !this.view.state.selection.empty) {
|
|
9779
9779
|
let e = this.view.domSelectionRange();
|
|
9780
9780
|
if (e.focusNode && Co(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
|
|
9781
9781
|
return this.flushSoon();
|
|
@@ -9859,7 +9859,7 @@ class Mk {
|
|
|
9859
9859
|
if (o.contentDOM && o.contentDOM != o.dom && !o.contentDOM.contains(e.target))
|
|
9860
9860
|
return { from: o.posBefore, to: o.posAfter };
|
|
9861
9861
|
let r = e.previousSibling, s = e.nextSibling;
|
|
9862
|
-
if (gt &&
|
|
9862
|
+
if (gt && Un <= 11 && e.addedNodes.length)
|
|
9863
9863
|
for (let u = 0; u < e.addedNodes.length; u++) {
|
|
9864
9864
|
let { previousSibling: d, nextSibling: f } = e.addedNodes[u];
|
|
9865
9865
|
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (r = d), (!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (s = f);
|
|
@@ -10008,7 +10008,7 @@ function Nk(n, e, t, o, r) {
|
|
|
10008
10008
|
}
|
|
10009
10009
|
return;
|
|
10010
10010
|
}
|
|
10011
|
-
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof ae && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), gt &&
|
|
10011
|
+
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof ae && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), gt && Un <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
10012
10012
|
let m = c.doc.resolveNoCache(p.start - c.from), g = c.doc.resolveNoCache(p.endB - c.from), y = u.resolve(p.start), k = m.sameParent(g) && m.parent.inlineContent && y.end() >= p.endA;
|
|
10013
10013
|
if ((nr && n.input.lastIOSEnter > Date.now() - 225 && (!k || r.some((S) => S.nodeName == "DIV" || S.nodeName == "P")) || !k && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && m.pos < g.pos && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", ""))) && n.someProp("handleKeyDown", (S) => S(n, so(13, "Enter")))) {
|
|
10014
10014
|
n.input.lastIOSEnter = 0;
|
|
@@ -10033,7 +10033,7 @@ function Nk(n, e, t, o, r) {
|
|
|
10033
10033
|
}, M;
|
|
10034
10034
|
if (k)
|
|
10035
10035
|
if (m.pos == g.pos) {
|
|
10036
|
-
gt &&
|
|
10036
|
+
gt && Un <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => kn(n), 20));
|
|
10037
10037
|
let S = b(n.state.tr.delete(v, w)), T = u.resolve(p.start).marksAcross(u.resolve(p.endA));
|
|
10038
10038
|
T && S.ensureMarks(T), n.dispatch(S);
|
|
10039
10039
|
} else if (
|
|
@@ -10904,7 +10904,7 @@ function ru(n, e, t) {
|
|
|
10904
10904
|
to: c
|
|
10905
10905
|
};
|
|
10906
10906
|
}
|
|
10907
|
-
function
|
|
10907
|
+
function bn(n, e) {
|
|
10908
10908
|
if (typeof n == "string") {
|
|
10909
10909
|
if (!e.marks[n])
|
|
10910
10910
|
throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);
|
|
@@ -10913,7 +10913,7 @@ function xn(n, e) {
|
|
|
10913
10913
|
return n;
|
|
10914
10914
|
}
|
|
10915
10915
|
var ib = (n, e = {}) => ({ tr: t, state: o, dispatch: r }) => {
|
|
10916
|
-
const s =
|
|
10916
|
+
const s = bn(n, o.schema), { doc: i, selection: l } = t, { $from: a, from: c, to: u } = l;
|
|
10917
10917
|
if (r) {
|
|
10918
10918
|
const d = ru(a, s, e);
|
|
10919
10919
|
if (d && d.from <= c && d.to >= u) {
|
|
@@ -11214,7 +11214,7 @@ var Ib = (n, e) => ({ tr: t, state: o, dispatch: r }) => {
|
|
|
11214
11214
|
);
|
|
11215
11215
|
if (!l)
|
|
11216
11216
|
return !1;
|
|
11217
|
-
l === "node" && (s = je(n, o.schema)), l === "mark" && (i =
|
|
11217
|
+
l === "node" && (s = je(n, o.schema)), l === "mark" && (i = bn(n, o.schema));
|
|
11218
11218
|
let a = !1;
|
|
11219
11219
|
return t.selection.ranges.forEach((c) => {
|
|
11220
11220
|
o.doc.nodesBetween(c.$from.pos, c.$to.pos, (u, d) => {
|
|
@@ -11251,7 +11251,7 @@ var $b = (n, { errorOnInvalidContent: e, emitUpdate: t = !0, parseOptions: o = {
|
|
|
11251
11251
|
});
|
|
11252
11252
|
};
|
|
11253
11253
|
function Wm(n, e) {
|
|
11254
|
-
const t =
|
|
11254
|
+
const t = bn(e, n.schema), { from: o, to: r, empty: s } = n.selection, i = [];
|
|
11255
11255
|
s ? (n.storedMarks && i.push(...n.storedMarks), i.push(...n.selection.$head.marks())) : n.doc.nodesBetween(o, r, (a) => {
|
|
11256
11256
|
i.push(...a.marks);
|
|
11257
11257
|
});
|
|
@@ -11702,7 +11702,7 @@ var Yb = (n, e = 500) => {
|
|
|
11702
11702
|
}), t;
|
|
11703
11703
|
};
|
|
11704
11704
|
function Za(n, e, t = {}) {
|
|
11705
|
-
const { empty: o, ranges: r } = n.selection, s = e ?
|
|
11705
|
+
const { empty: o, ranges: r } = n.selection, s = e ? bn(e, n.schema) : null;
|
|
11706
11706
|
if (o)
|
|
11707
11707
|
return !!(n.storedMarks || n.selection.$from.marks()).filter((d) => s ? s.name === d.type.name : !0).find((d) => ai(d.attrs, t, { strict: !1 }));
|
|
11708
11708
|
let i = 0;
|
|
@@ -11828,7 +11828,7 @@ function t2(n, e, t) {
|
|
|
11828
11828
|
});
|
|
11829
11829
|
}
|
|
11830
11830
|
var n2 = (n, e = {}) => ({ tr: t, state: o, dispatch: r }) => {
|
|
11831
|
-
const { selection: s } = t, { empty: i, ranges: l } = s, a =
|
|
11831
|
+
const { selection: s } = t, { empty: i, ranges: l } = s, a = bn(n, o.schema);
|
|
11832
11832
|
if (r)
|
|
11833
11833
|
if (i) {
|
|
11834
11834
|
const c = Wm(o, a);
|
|
@@ -12010,7 +12010,7 @@ var c2 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: o, editor
|
|
|
12010
12010
|
return s.ensureMarks(S), M ? !0 : c.clearNodes();
|
|
12011
12011
|
}).wrapInList(h, o).command(() => na(s, h)).command(() => oa(s, h)).run();
|
|
12012
12012
|
}, f2 = (n, e = {}, t = {}) => ({ state: o, commands: r }) => {
|
|
12013
|
-
const { extendEmptyMarkRange: s = !1 } = t, i =
|
|
12013
|
+
const { extendEmptyMarkRange: s = !1 } = t, i = bn(n, o.schema);
|
|
12014
12014
|
return Za(o, i, e) ? r.unsetMark(i, { extendEmptyMarkRange: s }) : r.setMark(i, e);
|
|
12015
12015
|
}, h2 = (n, e, t = {}) => ({ state: o, commands: r }) => {
|
|
12016
12016
|
const s = je(n, o.schema), i = je(e, o.schema), l = is(o, s, t);
|
|
@@ -12046,7 +12046,7 @@ var c2 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: o, editor
|
|
|
12046
12046
|
}), !0;
|
|
12047
12047
|
}, y2 = (n, e = {}) => ({ tr: t, state: o, dispatch: r }) => {
|
|
12048
12048
|
var s;
|
|
12049
|
-
const { extendEmptyMarkRange: i = !1 } = e, { selection: l } = t, a =
|
|
12049
|
+
const { extendEmptyMarkRange: i = !1 } = e, { selection: l } = t, a = bn(n, o.schema), { $from: c, empty: u, ranges: d } = l;
|
|
12050
12050
|
if (!r)
|
|
12051
12051
|
return !0;
|
|
12052
12052
|
if (u && i) {
|
|
@@ -12075,7 +12075,7 @@ var c2 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: o, editor
|
|
|
12075
12075
|
);
|
|
12076
12076
|
if (!l)
|
|
12077
12077
|
return !1;
|
|
12078
|
-
l === "node" && (s = je(n, o.schema)), l === "mark" && (i =
|
|
12078
|
+
l === "node" && (s = je(n, o.schema)), l === "mark" && (i = bn(n, o.schema));
|
|
12079
12079
|
let a = !1;
|
|
12080
12080
|
return t.selection.ranges.forEach((c) => {
|
|
12081
12081
|
const u = c.$from.pos, d = c.$to.pos;
|
|
@@ -12697,7 +12697,7 @@ var ml = class {
|
|
|
12697
12697
|
options: t.options,
|
|
12698
12698
|
storage: this.editor.extensionStorage[t.name],
|
|
12699
12699
|
editor: n,
|
|
12700
|
-
type:
|
|
12700
|
+
type: bn(t.name, this.schema)
|
|
12701
12701
|
}, s = Q(t, "addMarkView", r);
|
|
12702
12702
|
if (!s)
|
|
12703
12703
|
return [];
|
|
@@ -14180,7 +14180,7 @@ var q2 = class extends $2 {
|
|
|
14180
14180
|
const e = B(), t = Mc();
|
|
14181
14181
|
return Ws(() => {
|
|
14182
14182
|
const o = n.editor;
|
|
14183
|
-
o && o.options.element && e.value &&
|
|
14183
|
+
o && o.options.element && e.value && Jn(() => {
|
|
14184
14184
|
var r;
|
|
14185
14185
|
if (!e.value || !((r = o.view.dom) != null && r.parentNode))
|
|
14186
14186
|
return;
|
|
@@ -14671,7 +14671,7 @@ mt.prototype = {
|
|
|
14671
14671
|
return r.j[n] = i, i;
|
|
14672
14672
|
}
|
|
14673
14673
|
};
|
|
14674
|
-
const ce = (n, e, t, o, r) => n.ta(e, t, o, r), Ie = (n, e, t, o, r) => n.tr(e, t, o, r), Rf = (n, e, t, o, r) => n.ts(e, t, o, r), H = (n, e, t, o, r) => n.tt(e, t, o, r), cn = "WORD", oc = "UWORD", Sg = "ASCIINUMERICAL", Cg = "ALPHANUMERICAL", as = "LOCALHOST", rc = "TLD", sc = "UTLD", zs = "SCHEME", Wo = "SLASH_SCHEME", hu = "NUM", ic = "WS", pu = "NL", zr = "OPENBRACE", Fr = "CLOSEBRACE", fi = "OPENBRACKET", hi = "CLOSEBRACKET", pi = "OPENPAREN", mi = "CLOSEPAREN", gi = "OPENANGLEBRACKET", yi = "CLOSEANGLEBRACKET", vi = "FULLWIDTHLEFTPAREN", wi = "FULLWIDTHRIGHTPAREN", ki = "LEFTCORNERBRACKET", bi = "RIGHTCORNERBRACKET", xi = "LEFTWHITECORNERBRACKET", Si = "RIGHTWHITECORNERBRACKET", Ci = "FULLWIDTHLESSTHAN", Mi = "FULLWIDTHGREATERTHAN", Ti = "AMPERSAND", Ei = "APOSTROPHE", Ai = "ASTERISK",
|
|
14674
|
+
const ce = (n, e, t, o, r) => n.ta(e, t, o, r), Ie = (n, e, t, o, r) => n.tr(e, t, o, r), Rf = (n, e, t, o, r) => n.ts(e, t, o, r), H = (n, e, t, o, r) => n.tt(e, t, o, r), cn = "WORD", oc = "UWORD", Sg = "ASCIINUMERICAL", Cg = "ALPHANUMERICAL", as = "LOCALHOST", rc = "TLD", sc = "UTLD", zs = "SCHEME", Wo = "SLASH_SCHEME", hu = "NUM", ic = "WS", pu = "NL", zr = "OPENBRACE", Fr = "CLOSEBRACE", fi = "OPENBRACKET", hi = "CLOSEBRACKET", pi = "OPENPAREN", mi = "CLOSEPAREN", gi = "OPENANGLEBRACKET", yi = "CLOSEANGLEBRACKET", vi = "FULLWIDTHLEFTPAREN", wi = "FULLWIDTHRIGHTPAREN", ki = "LEFTCORNERBRACKET", bi = "RIGHTCORNERBRACKET", xi = "LEFTWHITECORNERBRACKET", Si = "RIGHTWHITECORNERBRACKET", Ci = "FULLWIDTHLESSTHAN", Mi = "FULLWIDTHGREATERTHAN", Ti = "AMPERSAND", Ei = "APOSTROPHE", Ai = "ASTERISK", On = "AT", Ii = "BACKSLASH", Oi = "BACKTICK", _i = "CARET", Nn = "COLON", mu = "COMMA", Di = "DOLLAR", Kt = "DOT", Ni = "EQUALS", gu = "EXCLAMATION", Ct = "HYPHEN", Hr = "PERCENT", Ri = "PIPE", Pi = "PLUS", Li = "POUND", Vr = "QUERY", yu = "QUOTE", Mg = "FULLWIDTHMIDDLEDOT", vu = "SEMI", qt = "SLASH", Wr = "TILDE", $i = "UNDERSCORE", Tg = "EMOJI", Bi = "SYM";
|
|
14675
14675
|
var Eg = /* @__PURE__ */ Object.freeze({
|
|
14676
14676
|
__proto__: null,
|
|
14677
14677
|
ALPHANUMERICAL: Cg,
|
|
@@ -14679,7 +14679,7 @@ var Eg = /* @__PURE__ */ Object.freeze({
|
|
|
14679
14679
|
APOSTROPHE: Ei,
|
|
14680
14680
|
ASCIINUMERICAL: Sg,
|
|
14681
14681
|
ASTERISK: Ai,
|
|
14682
|
-
AT:
|
|
14682
|
+
AT: On,
|
|
14683
14683
|
BACKSLASH: Ii,
|
|
14684
14684
|
BACKTICK: Oi,
|
|
14685
14685
|
CARET: _i,
|
|
@@ -14687,7 +14687,7 @@ var Eg = /* @__PURE__ */ Object.freeze({
|
|
|
14687
14687
|
CLOSEBRACE: Fr,
|
|
14688
14688
|
CLOSEBRACKET: hi,
|
|
14689
14689
|
CLOSEPAREN: mi,
|
|
14690
|
-
COLON:
|
|
14690
|
+
COLON: Nn,
|
|
14691
14691
|
COMMA: mu,
|
|
14692
14692
|
DOLLAR: Di,
|
|
14693
14693
|
DOT: Kt,
|
|
@@ -14737,7 +14737,7 @@ function vx(n = []) {
|
|
|
14737
14737
|
const e = {};
|
|
14738
14738
|
mt.groups = e;
|
|
14739
14739
|
const t = new mt();
|
|
14740
|
-
Is == null && (Is = Lf(ux)), Os == null && (Os = Lf(dx)), H(t, "'", Ei), H(t, "{", zr), H(t, "}", Fr), H(t, "[", fi), H(t, "]", hi), H(t, "(", pi), H(t, ")", mi), H(t, "<", gi), H(t, ">", yi), H(t, "(", vi), H(t, ")", wi), H(t, "「", ki), H(t, "」", bi), H(t, "『", xi), H(t, "』", Si), H(t, "<", Ci), H(t, ">", Mi), H(t, "&", Ti), H(t, "*", Ai), H(t, "@",
|
|
14740
|
+
Is == null && (Is = Lf(ux)), Os == null && (Os = Lf(dx)), H(t, "'", Ei), H(t, "{", zr), H(t, "}", Fr), H(t, "[", fi), H(t, "]", hi), H(t, "(", pi), H(t, ")", mi), H(t, "<", gi), H(t, ">", yi), H(t, "(", vi), H(t, ")", wi), H(t, "「", ki), H(t, "」", bi), H(t, "『", xi), H(t, "』", Si), H(t, "<", Ci), H(t, ">", Mi), H(t, "&", Ti), H(t, "*", Ai), H(t, "@", On), H(t, "`", Oi), H(t, "^", _i), H(t, ":", Nn), H(t, ",", mu), H(t, "$", Di), H(t, ".", Kt), H(t, "=", Ni), H(t, "!", gu), H(t, "-", Ct), H(t, "%", Hr), H(t, "|", Ri), H(t, "+", Pi), H(t, "#", Li), H(t, "?", Vr), H(t, '"', yu), H(t, "/", qt), H(t, ";", vu), H(t, "~", Wr), H(t, "_", $i), H(t, "\\", Ii), H(t, "・", Mg);
|
|
14741
14741
|
const o = Ie(t, an, hu, {
|
|
14742
14742
|
[Qa]: !0
|
|
14743
14743
|
});
|
|
@@ -14770,16 +14770,16 @@ function vx(n = []) {
|
|
|
14770
14770
|
H(f, "#"), Ie(f, sa, d);
|
|
14771
14771
|
const h = [[ln, i], [an, r]], p = [[ln, null], [xr, l], [an, s]];
|
|
14772
14772
|
for (let m = 0; m < Is.length; m++)
|
|
14773
|
-
|
|
14773
|
+
Tn(t, Is[m], rc, cn, h);
|
|
14774
14774
|
for (let m = 0; m < Os.length; m++)
|
|
14775
|
-
|
|
14775
|
+
Tn(t, Os[m], sc, oc, p);
|
|
14776
14776
|
co(rc, {
|
|
14777
14777
|
tld: !0,
|
|
14778
14778
|
ascii: !0
|
|
14779
14779
|
}, e), co(sc, {
|
|
14780
14780
|
utld: !0,
|
|
14781
14781
|
alpha: !0
|
|
14782
|
-
}, e),
|
|
14782
|
+
}, e), Tn(t, "file", zs, cn, h), Tn(t, "mailto", zs, cn, h), Tn(t, "http", Wo, cn, h), Tn(t, "https", Wo, cn, h), Tn(t, "ftp", Wo, cn, h), Tn(t, "ftps", Wo, cn, h), co(zs, {
|
|
14783
14783
|
scheme: !0,
|
|
14784
14784
|
ascii: !0
|
|
14785
14785
|
}, e), co(Wo, {
|
|
@@ -14832,7 +14832,7 @@ function wx(n) {
|
|
|
14832
14832
|
}
|
|
14833
14833
|
return e;
|
|
14834
14834
|
}
|
|
14835
|
-
function
|
|
14835
|
+
function Tn(n, e, t, o, r) {
|
|
14836
14836
|
let s;
|
|
14837
14837
|
const i = e.length;
|
|
14838
14838
|
for (let l = 0; l < i - 1; l++) {
|
|
@@ -15087,18 +15087,18 @@ const Bf = gl("email", {
|
|
|
15087
15087
|
*/
|
|
15088
15088
|
hasProtocol() {
|
|
15089
15089
|
const n = this.tk;
|
|
15090
|
-
return n.length >= 2 && n[0].t !== as && n[1].t ===
|
|
15090
|
+
return n.length >= 2 && n[0].t !== as && n[1].t === Nn;
|
|
15091
15091
|
}
|
|
15092
15092
|
}), St = (n) => new mt(n);
|
|
15093
15093
|
function bx({
|
|
15094
15094
|
groups: n
|
|
15095
15095
|
}) {
|
|
15096
|
-
const e = n.domain.concat([Ti, Ai,
|
|
15096
|
+
const e = n.domain.concat([Ti, Ai, On, Ii, Oi, _i, Di, Ni, Ct, hu, Hr, Ri, Pi, Li, qt, Bi, Wr, $i]), t = [Ei, Nn, mu, Kt, gu, Hr, Vr, yu, vu, gi, yi, zr, Fr, hi, fi, pi, mi, vi, wi, ki, bi, xi, Si, Ci, Mi], o = [Ti, Ei, Ai, Ii, Oi, _i, Di, Ni, Ct, zr, Fr, Hr, Ri, Pi, Li, Vr, qt, Bi, Wr, $i], r = St(), s = H(r, Wr);
|
|
15097
15097
|
ce(s, o, s), ce(s, n.domain, s);
|
|
15098
15098
|
const i = St(), l = St(), a = St();
|
|
15099
15099
|
ce(r, n.domain, i), ce(r, n.scheme, l), ce(r, n.slashscheme, a), ce(i, o, s), ce(i, n.domain, i);
|
|
15100
|
-
const c = H(i,
|
|
15101
|
-
H(s,
|
|
15100
|
+
const c = H(i, On);
|
|
15101
|
+
H(s, On, c), H(l, On, c), H(a, On, c);
|
|
15102
15102
|
const u = H(s, Kt);
|
|
15103
15103
|
ce(u, o, s), ce(u, n.domain, s);
|
|
15104
15104
|
const d = St();
|
|
@@ -15109,17 +15109,17 @@ function bx({
|
|
|
15109
15109
|
ce(f, n.tld, h), ce(f, n.utld, h), H(c, as, h);
|
|
15110
15110
|
const p = H(d, Ct);
|
|
15111
15111
|
H(p, Ct, p), ce(p, n.domain, d), ce(h, n.domain, d), H(h, Kt, f), H(h, Ct, p);
|
|
15112
|
-
const m = H(h,
|
|
15112
|
+
const m = H(h, Nn);
|
|
15113
15113
|
ce(m, n.numeric, Bf);
|
|
15114
15114
|
const g = H(i, Ct), y = H(i, Kt);
|
|
15115
15115
|
H(g, Ct, g), ce(g, n.domain, i), ce(y, o, s), ce(y, n.domain, i);
|
|
15116
15116
|
const k = St(_s);
|
|
15117
|
-
ce(y, n.tld, k), ce(y, n.utld, k), ce(k, n.domain, i), ce(k, o, s), H(k, Kt, y), H(k, Ct, g), H(k,
|
|
15118
|
-
const v = H(k,
|
|
15117
|
+
ce(y, n.tld, k), ce(y, n.utld, k), ce(k, n.domain, i), ce(k, o, s), H(k, Kt, y), H(k, Ct, g), H(k, On, c);
|
|
15118
|
+
const v = H(k, Nn), w = St(_s);
|
|
15119
15119
|
ce(v, n.numeric, w);
|
|
15120
15120
|
const b = St(_s), M = St();
|
|
15121
15121
|
ce(b, e, b), ce(b, t, M), ce(M, e, b), ce(M, t, M), H(k, qt, b), H(w, qt, b);
|
|
15122
|
-
const S = H(l,
|
|
15122
|
+
const S = H(l, Nn), T = H(a, Nn), E = H(T, qt), _ = H(E, qt);
|
|
15123
15123
|
ce(l, n.domain, i), H(l, Kt, y), H(l, Ct, g), ce(a, n.domain, i), H(a, Kt, y), H(a, Ct, g), ce(S, n.domain, b), H(S, qt, b), H(S, Vr, b), ce(_, n.domain, b), ce(_, e, b), H(_, qt, b);
|
|
15124
15124
|
const D = [
|
|
15125
15125
|
[zr, Fr],
|
|
@@ -16310,7 +16310,7 @@ class Jt {
|
|
|
16310
16310
|
}
|
|
16311
16311
|
}
|
|
16312
16312
|
}
|
|
16313
|
-
class
|
|
16313
|
+
class _n {
|
|
16314
16314
|
constructor(e, t, o, r, s) {
|
|
16315
16315
|
this.done = e, this.undone = t, this.prevRanges = o, this.prevTime = r, this.prevComposition = s;
|
|
16316
16316
|
}
|
|
@@ -16320,16 +16320,16 @@ function tS(n, e, t, o) {
|
|
|
16320
16320
|
let r = t.getMeta(vo), s;
|
|
16321
16321
|
if (r)
|
|
16322
16322
|
return r.historyState;
|
|
16323
|
-
t.getMeta(rS) && (n = new
|
|
16323
|
+
t.getMeta(rS) && (n = new _n(n.done, n.undone, null, 0, -1));
|
|
16324
16324
|
let i = t.getMeta("appendedTransaction");
|
|
16325
16325
|
if (t.steps.length == 0)
|
|
16326
16326
|
return n;
|
|
16327
16327
|
if (i && i.getMeta(vo))
|
|
16328
|
-
return i.getMeta(vo).redo ? new
|
|
16328
|
+
return i.getMeta(vo).redo ? new _n(n.done.addTransform(t, void 0, o, Fs(e)), n.undone, Hf(t.mapping.maps), n.prevTime, n.prevComposition) : new _n(n.done, n.undone.addTransform(t, void 0, o, Fs(e)), null, n.prevTime, n.prevComposition);
|
|
16329
16329
|
if (t.getMeta("addToHistory") !== !1 && !(i && i.getMeta("addToHistory") === !1)) {
|
|
16330
16330
|
let l = t.getMeta("composition"), a = n.prevTime == 0 || !i && n.prevComposition != l && (n.prevTime < (t.time || 0) - o.newGroupDelay || !nS(t, n.prevRanges)), c = i ? ua(n.prevRanges, t.mapping) : Hf(t.mapping.maps);
|
|
16331
|
-
return new
|
|
16332
|
-
} else return (s = t.getMeta("rebased")) ? new
|
|
16331
|
+
return new _n(n.done.addTransform(t, a ? e.selection.getBookmark() : void 0, o, Fs(e)), Pt.empty, c, t.time, l ?? n.prevComposition);
|
|
16332
|
+
} else return (s = t.getMeta("rebased")) ? new _n(n.done.rebased(t, s), n.undone.rebased(t, s), ua(n.prevRanges, t.mapping), n.prevTime, n.prevComposition) : new _n(n.done.addMaps(t.mapping.maps), n.undone.addMaps(t.mapping.maps), ua(n.prevRanges, t.mapping), n.prevTime, n.prevComposition);
|
|
16333
16333
|
}
|
|
16334
16334
|
function nS(n, e) {
|
|
16335
16335
|
if (!e)
|
|
@@ -16362,7 +16362,7 @@ function oS(n, e, t) {
|
|
|
16362
16362
|
let o = Fs(e), r = vo.get(e).spec.config, s = (t ? n.undone : n.done).popEvent(e, o);
|
|
16363
16363
|
if (!s)
|
|
16364
16364
|
return null;
|
|
16365
|
-
let i = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), r, o), a = new
|
|
16365
|
+
let i = s.selection.resolve(s.transform.doc), l = (t ? n.done : n.undone).addTransform(s.transform, e.selection.getBookmark(), r, o), a = new _n(t ? l : s.remaining, t ? s.remaining : l, null, 0, -1);
|
|
16366
16366
|
return s.transform.setSelection(i).setMeta(vo, { redo: t, historyState: a });
|
|
16367
16367
|
}
|
|
16368
16368
|
let da = !1, Vf = null;
|
|
@@ -16387,7 +16387,7 @@ function sS(n = {}) {
|
|
|
16387
16387
|
key: vo,
|
|
16388
16388
|
state: {
|
|
16389
16389
|
init() {
|
|
16390
|
-
return new
|
|
16390
|
+
return new _n(Pt.empty, Pt.empty, null, 0, -1);
|
|
16391
16391
|
},
|
|
16392
16392
|
apply(e, t, o) {
|
|
16393
16393
|
return tS(t, o, e, n);
|
|
@@ -16728,7 +16728,7 @@ function us(n, e, t) {
|
|
|
16728
16728
|
if (!o)
|
|
16729
16729
|
throw new Error(`Block placement: block definition for tag "${e.block.tag}" not found`);
|
|
16730
16730
|
const r = e.block.size ?? [100, 100], s = [t[0] - r[0] / 2, t[1] - r[1] / 2];
|
|
16731
|
-
|
|
16731
|
+
Gn.snapPosition(n, s);
|
|
16732
16732
|
const [i, l] = s, a = e.block.rank ?? Zh.genNext(n), c = Zi(n);
|
|
16733
16733
|
"synced" in e || He(n, c, Et, {
|
|
16734
16734
|
id: crypto.randomUUID()
|
|
@@ -16994,7 +16994,7 @@ function cS(n) {
|
|
|
16994
16994
|
const { componentsById: o } = cr(n), r = new Map([...o].filter(([, d]) => d.sync === "document")), s = Et._getComponentId(n), i = /* @__PURE__ */ new Set();
|
|
16995
16995
|
for (const d of e)
|
|
16996
16996
|
Fe(n, d, Et) && i.add(Et.read(n, d).id);
|
|
16997
|
-
const l = new Set(e), a = [], c =
|
|
16997
|
+
const l = new Set(e), a = [], c = Pn.zero();
|
|
16998
16998
|
let u = !1;
|
|
16999
16999
|
for (const d of e) {
|
|
17000
17000
|
const f = {};
|
|
@@ -17016,12 +17016,12 @@ function cS(n) {
|
|
|
17016
17016
|
}
|
|
17017
17017
|
if (a.push(f), Fe(n, d, Uo)) {
|
|
17018
17018
|
const { value: h } = Uo.read(n, d);
|
|
17019
|
-
u ?
|
|
17019
|
+
u ? Pn.union(c, h) : (Pn.copy(c, h), u = !0);
|
|
17020
17020
|
}
|
|
17021
17021
|
}
|
|
17022
17022
|
return {
|
|
17023
17023
|
version: Wg,
|
|
17024
|
-
center:
|
|
17024
|
+
center: Pn.center(c),
|
|
17025
17025
|
entities: a
|
|
17026
17026
|
};
|
|
17027
17027
|
}
|
|
@@ -17079,10 +17079,10 @@ function Gf(n, e, t, o) {
|
|
|
17079
17079
|
const { componentsById: r } = cr(n), s = new Map([...r].filter(([, h]) => h.sync === "document")), i = Et._getComponentId(n), l = le._getComponentId(n);
|
|
17080
17080
|
let a;
|
|
17081
17081
|
if (o)
|
|
17082
|
-
a =
|
|
17082
|
+
a = An.clone(o), An.sub(a, t);
|
|
17083
17083
|
else {
|
|
17084
17084
|
const h = Pe.getWorldCenter(n);
|
|
17085
|
-
a =
|
|
17085
|
+
a = An.clone(h), An.sub(a, t), Gn.snapPosition(n, a);
|
|
17086
17086
|
}
|
|
17087
17087
|
const c = [...e].sort((h, p) => {
|
|
17088
17088
|
var y, k;
|
|
@@ -17101,8 +17101,8 @@ function Gf(n, e, t, o) {
|
|
|
17101
17101
|
const v = { ...y };
|
|
17102
17102
|
if (g === l) {
|
|
17103
17103
|
if (!(y.parentId != null)) {
|
|
17104
|
-
const S =
|
|
17105
|
-
|
|
17104
|
+
const S = An.clone(v.position);
|
|
17105
|
+
An.add(S, a), v.position = S;
|
|
17106
17106
|
}
|
|
17107
17107
|
v.rank = Zh.genNext(n);
|
|
17108
17108
|
}
|
|
@@ -17228,7 +17228,7 @@ function mS(n, e = {}) {
|
|
|
17228
17228
|
p && (p.removeEventListener("paste", h), p.removeEventListener("copy", d), p.removeEventListener("cut", f));
|
|
17229
17229
|
});
|
|
17230
17230
|
}
|
|
17231
|
-
function
|
|
17231
|
+
function xn(n, e) {
|
|
17232
17232
|
const t = ge(Ue);
|
|
17233
17233
|
if (!t)
|
|
17234
17234
|
throw new Error("useComponents must be used within a WovenCanvas component");
|
|
@@ -17292,22 +17292,18 @@ function Kg() {
|
|
|
17292
17292
|
});
|
|
17293
17293
|
}
|
|
17294
17294
|
async function o(s, i, l, a = {}) {
|
|
17295
|
-
const { maxSize: c = 400 } = a, u = await t(s), d = await e(), f = Math.min(1, c / Math.max(u.width, u.height));
|
|
17296
|
-
|
|
17297
|
-
const
|
|
17298
|
-
|
|
17299
|
-
const
|
|
17300
|
-
He(d,
|
|
17301
|
-
const
|
|
17302
|
-
|
|
17303
|
-
const
|
|
17304
|
-
He(d,
|
|
17305
|
-
const v = gn.write(d, g);
|
|
17306
|
-
v.identifier = k, v.uploadState = jn.Pending, He(d, g, Us);
|
|
17307
|
-
const w = Us.write(d, g);
|
|
17308
|
-
return w.width = u.width, w.height = u.height, w.alt = s.name, He(d, g, Hh, {
|
|
17295
|
+
const { maxSize: c = 400 } = a, u = await t(s), d = await e(), f = Math.min(1, c / Math.max(u.width, u.height)), h = u.width * f, p = u.height * f, m = Zi(d);
|
|
17296
|
+
He(d, m, le);
|
|
17297
|
+
const g = le.write(d, m);
|
|
17298
|
+
g.tag = "image", g.position[0] = i - h / 2, g.position[1] = l - p / 2, g.size[0] = h, g.size[1] = p, Gn.snapPosition(d, g.position);
|
|
17299
|
+
const y = crypto.randomUUID();
|
|
17300
|
+
He(d, m, gn);
|
|
17301
|
+
const k = gn.write(d, m);
|
|
17302
|
+
k.identifier = y, k.uploadState = Wn.Pending, He(d, m, Us);
|
|
17303
|
+
const v = Us.write(d, m);
|
|
17304
|
+
return v.width = u.width, v.height = u.height, v.alt = s.name, He(d, m, Hh, {
|
|
17309
17305
|
id: crypto.randomUUID()
|
|
17310
|
-
}), (n == null ? void 0 : n.getAssetManager()) && r(
|
|
17306
|
+
}), (n == null ? void 0 : n.getAssetManager()) && r(m, y, s), m;
|
|
17311
17307
|
}
|
|
17312
17308
|
function r(s, i, l) {
|
|
17313
17309
|
const a = n == null ? void 0 : n.getAssetManager();
|
|
@@ -17612,7 +17608,7 @@ function eh(n, e, t, o) {
|
|
|
17612
17608
|
return r.remove(), l;
|
|
17613
17609
|
}
|
|
17614
17610
|
function IS(n) {
|
|
17615
|
-
const { nextEditorTick: e } = Ce(), t = ge(Ue), o =
|
|
17611
|
+
const { nextEditorTick: e } = Ce(), t = ge(Ue), o = xn(n, it), r = ot(Pe), s = ot(eo), i = fr(), l = ge(Lc, void 0), a = O(() => {
|
|
17616
17612
|
const v = l == null ? void 0 : l.value.extensions;
|
|
17617
17613
|
return v && v.length > 0 ? [...Yf, ...v] : Yf;
|
|
17618
17614
|
}), c = (v) => Ub(v, a.value), u = (v) => jb(v, a.value), d = (v, w) => {
|
|
@@ -17815,7 +17811,7 @@ function IS(n) {
|
|
|
17815
17811
|
const R = le.write(S, T);
|
|
17816
17812
|
R.size = [E, _], le.setWorldPosition(S, T, [D, N]);
|
|
17817
17813
|
}
|
|
17818
|
-
Qf(S),
|
|
17814
|
+
Qf(S), Jn(() => {
|
|
17819
17815
|
var T;
|
|
17820
17816
|
i.updateCounter.value++, (T = i.editor.value) == null || T.commands.focus();
|
|
17821
17817
|
});
|
|
@@ -18133,7 +18129,7 @@ const $S = { key: 1 }, BS = ["innerHTML"], Iu = /* @__PURE__ */ q({
|
|
|
18133
18129
|
() => o.edited,
|
|
18134
18130
|
async (_) => {
|
|
18135
18131
|
if (_) {
|
|
18136
|
-
if (h.value || await
|
|
18132
|
+
if (h.value || await Jn(), !h.value || (m.value = k(), await v(m.value), !o.blockElement)) return;
|
|
18137
18133
|
a.register(m.value, h.value, o.blockElement);
|
|
18138
18134
|
} else m.value && (a.unregister(), w(m.value), m.value.destroy(), m.value = null);
|
|
18139
18135
|
},
|
|
@@ -18142,7 +18138,7 @@ const $S = { key: 1 }, BS = ["innerHTML"], Iu = /* @__PURE__ */ q({
|
|
|
18142
18138
|
async function v(_) {
|
|
18143
18139
|
var W;
|
|
18144
18140
|
const D = (W = d.value) == null ? void 0 : W.position, N = l.value;
|
|
18145
|
-
await
|
|
18141
|
+
await Jn(), await new Promise((V) => requestAnimationFrame(V));
|
|
18146
18142
|
const R = h.value;
|
|
18147
18143
|
if (D && N && R) {
|
|
18148
18144
|
const V = D[0] + N.left, te = D[1] + N.top, J = _.view.posAtCoords({ left: V, top: te });
|
|
@@ -18370,7 +18366,7 @@ const $S = { key: 1 }, BS = ["innerHTML"], Iu = /* @__PURE__ */ q({
|
|
|
18370
18366
|
f = w.height;
|
|
18371
18367
|
const b = await k.getDisplayUrl(v.identifier, w);
|
|
18372
18368
|
if (!g) return;
|
|
18373
|
-
b ? (h.value = b, p.value = !1) : v.uploadState ===
|
|
18369
|
+
b ? (h.value = b, p.value = !1) : v.uploadState === Wn.Failed && (m.value = !0, p.value = !1);
|
|
18374
18370
|
} catch (w) {
|
|
18375
18371
|
if (!g) return;
|
|
18376
18372
|
console.error("Failed to get tape display URL:", w), m.value = !0, p.value = !1;
|
|
@@ -18476,11 +18472,11 @@ function Yg(n) {
|
|
|
18476
18472
|
return n === "y" ? "height" : "width";
|
|
18477
18473
|
}
|
|
18478
18474
|
const tC = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
18479
|
-
function
|
|
18475
|
+
function Hn(n) {
|
|
18480
18476
|
return tC.has(To(n)) ? "y" : "x";
|
|
18481
18477
|
}
|
|
18482
18478
|
function Xg(n) {
|
|
18483
|
-
return Gg(
|
|
18479
|
+
return Gg(Hn(n));
|
|
18484
18480
|
}
|
|
18485
18481
|
function nC(n, e, t) {
|
|
18486
18482
|
t === void 0 && (t = !1);
|
|
@@ -18556,7 +18552,7 @@ function rh(n, e, t) {
|
|
|
18556
18552
|
reference: o,
|
|
18557
18553
|
floating: r
|
|
18558
18554
|
} = n;
|
|
18559
|
-
const s =
|
|
18555
|
+
const s = Hn(e), i = Xg(e), l = Yg(i), a = To(e), c = s === "y", u = o.x + o.width / 2 - r.width / 2, d = o.y + o.height / 2 - r.height / 2, f = o[l] / 2 - r[l] / 2;
|
|
18560
18556
|
let h;
|
|
18561
18557
|
switch (a) {
|
|
18562
18558
|
case "top":
|
|
@@ -18732,7 +18728,7 @@ const dC = async (n, e, t) => {
|
|
|
18732
18728
|
} = vl(n, e);
|
|
18733
18729
|
if ((t = s.arrow) != null && t.alignmentOffset)
|
|
18734
18730
|
return {};
|
|
18735
|
-
const y = To(r), k =
|
|
18731
|
+
const y = To(r), k = Hn(l), v = To(l) === l, w = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), b = f || (v || !m ? [Wi(l)] : oC(l)), M = p !== "none";
|
|
18736
18732
|
!f && M && b.push(...lC(l, m, p, w));
|
|
18737
18733
|
const S = [l, ...b], T = await a.detectOverflow(e, g), E = [];
|
|
18738
18734
|
let _ = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
@@ -18746,9 +18742,9 @@ const dC = async (n, e, t) => {
|
|
|
18746
18742
|
}], !E.every((W) => W <= 0)) {
|
|
18747
18743
|
var D, N;
|
|
18748
18744
|
const W = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, V = S[W];
|
|
18749
|
-
if (V && (!(d === "alignment" ? k !==
|
|
18745
|
+
if (V && (!(d === "alignment" ? k !== Hn(V) : !1) || // We leave the current main axis only if every placement on that axis
|
|
18750
18746
|
// overflows the main axis.
|
|
18751
|
-
_.every((X) =>
|
|
18747
|
+
_.every((X) => Hn(X.placement) === k ? X.overflows[0] > 0 : !0)))
|
|
18752
18748
|
return {
|
|
18753
18749
|
data: {
|
|
18754
18750
|
index: W,
|
|
@@ -18765,7 +18761,7 @@ const dC = async (n, e, t) => {
|
|
|
18765
18761
|
var R;
|
|
18766
18762
|
const J = (R = _.filter((X) => {
|
|
18767
18763
|
if (M) {
|
|
18768
|
-
const Y =
|
|
18764
|
+
const Y = Hn(X.placement);
|
|
18769
18765
|
return Y === k || // Create a bias to the `y` side axis due to horizontal
|
|
18770
18766
|
// reading directions favoring greater width.
|
|
18771
18767
|
Y === "y";
|
|
@@ -18795,7 +18791,7 @@ async function pC(n, e) {
|
|
|
18795
18791
|
placement: t,
|
|
18796
18792
|
platform: o,
|
|
18797
18793
|
elements: r
|
|
18798
|
-
} = n, s = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), i = To(t), l = wl(t), a =
|
|
18794
|
+
} = n, s = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), i = To(t), l = wl(t), a = Hn(t) === "y", c = hC.has(i) ? -1 : 1, u = s && a ? -1 : 1, d = vl(e, n);
|
|
18799
18795
|
let {
|
|
18800
18796
|
mainAxis: f,
|
|
18801
18797
|
crossAxis: h,
|
|
@@ -18868,7 +18864,7 @@ const mC = function(n) {
|
|
|
18868
18864
|
} = vl(n, e), u = {
|
|
18869
18865
|
x: t,
|
|
18870
18866
|
y: o
|
|
18871
|
-
}, d = await s.detectOverflow(e, c), f =
|
|
18867
|
+
}, d = await s.detectOverflow(e, c), f = Hn(To(r)), h = Gg(f);
|
|
18872
18868
|
let p = u[h], m = u[f];
|
|
18873
18869
|
if (i) {
|
|
18874
18870
|
const y = h === "y" ? "top" : "left", k = h === "y" ? "bottom" : "right", v = p + d[y], w = p - d[k];
|
|
@@ -19811,7 +19807,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
19811
19807
|
entityIds: {}
|
|
19812
19808
|
},
|
|
19813
19809
|
setup(n) {
|
|
19814
|
-
const e = n, { nextEditorTick: t } = Ce(), o = ot(_c), r =
|
|
19810
|
+
const e = n, { nextEditorTick: t } = Ce(), o = ot(_c), r = xn(() => e.entityIds, le), s = O(() => {
|
|
19815
19811
|
for (const l of r.value.values())
|
|
19816
19812
|
if ((l == null ? void 0 : l.resizeMode) === Pl.Free) return !1;
|
|
19817
19813
|
return !0;
|
|
@@ -20245,7 +20241,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20245
20241
|
withOpacity: { type: Boolean }
|
|
20246
20242
|
},
|
|
20247
20243
|
setup(n) {
|
|
20248
|
-
const e = n, { nextEditorTick: t } = Ce(), o =
|
|
20244
|
+
const e = n, { nextEditorTick: t } = Ce(), o = xn(() => e.entityIds, Zo), r = O(() => {
|
|
20249
20245
|
const c = /* @__PURE__ */ new Set();
|
|
20250
20246
|
for (const u of o.value.values())
|
|
20251
20247
|
if (u) {
|
|
@@ -20344,7 +20340,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20344
20340
|
{ label: "S", value: 4 },
|
|
20345
20341
|
{ label: "M", value: 8 },
|
|
20346
20342
|
{ label: "L", value: 16 }
|
|
20347
|
-
], t = n, { nextEditorTick: o } = Ce(), r =
|
|
20343
|
+
], t = n, { nextEditorTick: o } = Ce(), r = xn(() => t.entityIds, Da), s = O(() => {
|
|
20348
20344
|
let a = !1;
|
|
20349
20345
|
for (const c of r.value.values())
|
|
20350
20346
|
if (c) {
|
|
@@ -20433,7 +20429,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20433
20429
|
entityIds: {}
|
|
20434
20430
|
},
|
|
20435
20431
|
setup(n) {
|
|
20436
|
-
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r =
|
|
20432
|
+
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r = xn(() => e.entityIds, Gt), s = [
|
|
20437
20433
|
{ mode: "solid", label: "Solid", alpha: 255 },
|
|
20438
20434
|
{ mode: "faded", label: "Faded", alpha: 128 },
|
|
20439
20435
|
{ mode: "none", label: "None", alpha: 0 }
|
|
@@ -20556,7 +20552,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20556
20552
|
entityIds: {}
|
|
20557
20553
|
},
|
|
20558
20554
|
setup(n) {
|
|
20559
|
-
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r =
|
|
20555
|
+
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r = xn(() => e.entityIds, Gt), s = O(() => {
|
|
20560
20556
|
const c = r.value.values().next().value;
|
|
20561
20557
|
return (c == null ? void 0 : c.kind) ?? "rectangle";
|
|
20562
20558
|
}), i = O(() => {
|
|
@@ -20693,7 +20689,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20693
20689
|
entityIds: {}
|
|
20694
20690
|
},
|
|
20695
20691
|
setup(n) {
|
|
20696
|
-
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r =
|
|
20692
|
+
const e = n, { nextEditorTick: t, setDefaults: o } = Ce(), r = xn(() => e.entityIds, Gt), s = B(!1), i = O(() => {
|
|
20697
20693
|
const m = /* @__PURE__ */ new Set();
|
|
20698
20694
|
for (const g of r.value.values())
|
|
20699
20695
|
if (g) {
|
|
@@ -20823,7 +20819,7 @@ const _t = /* @__PURE__ */ Oo(UC, [["render", qC]]), JC = { class: "wov-menu-but
|
|
|
20823
20819
|
name: "Flowers",
|
|
20824
20820
|
url: "https://storage.googleapis.com/download/storage/v1/b/zine-maker-public/o/tapes%2Fc1a1b89a-543f-4817-8afa-76544e94d776.png?generation=1715183194007112&alt=media"
|
|
20825
20821
|
}
|
|
20826
|
-
], t = n, { nextEditorTick: o } = Ce(), r =
|
|
20822
|
+
], t = n, { nextEditorTick: o } = Ce(), r = xn(() => t.entityIds, gn), s = O(() => {
|
|
20827
20823
|
for (const l of r.value.values())
|
|
20828
20824
|
if (l != null && l.identifier) return l.identifier;
|
|
20829
20825
|
return null;
|
|
@@ -20970,7 +20966,7 @@ function uT(n) {
|
|
|
20970
20966
|
return Mc();
|
|
20971
20967
|
}
|
|
20972
20968
|
function dT(n, e = !0, t) {
|
|
20973
|
-
uT() ? kt(n, t) : e ? n() :
|
|
20969
|
+
uT() ? kt(n, t) : e ? n() : Jn(n);
|
|
20974
20970
|
}
|
|
20975
20971
|
function fT(n, e, t) {
|
|
20976
20972
|
return pe(n, e, {
|
|
@@ -21421,7 +21417,7 @@ const vT = { class: "wov-font-family-button" }, wT = { class: "wov-font-family-l
|
|
|
21421
21417
|
whileElementsMounted: Cl
|
|
21422
21418
|
});
|
|
21423
21419
|
function d() {
|
|
21424
|
-
s.value = t.linkHref ?? "", r.value = !0,
|
|
21420
|
+
s.value = t.linkHref ?? "", r.value = !0, Jn(() => {
|
|
21425
21421
|
var m, g;
|
|
21426
21422
|
(m = i.value) == null || m.focus(), (g = i.value) == null || g.select();
|
|
21427
21423
|
});
|
|
@@ -21607,7 +21603,7 @@ const vT = { class: "wov-font-family-button" }, wT = { class: "wov-font-family-l
|
|
|
21607
21603
|
entityIds: {}
|
|
21608
21604
|
},
|
|
21609
21605
|
setup(n) {
|
|
21610
|
-
const e = n, { nextEditorTick: t } = Ce(), { state: o } = nn(() => e.entityIds), r = [Ze.Top, Ze.Center, Ze.Bottom], s =
|
|
21606
|
+
const e = n, { nextEditorTick: t } = Ce(), { state: o } = nn(() => e.entityIds), r = [Ze.Top, Ze.Center, Ze.Bottom], s = xn(() => e.entityIds, Ks), i = O(() => {
|
|
21611
21607
|
let a = null;
|
|
21612
21608
|
for (const c of s.value.values()) {
|
|
21613
21609
|
const u = (c == null ? void 0 : c.value) ?? Ze.Top;
|
|
@@ -21781,7 +21777,7 @@ const vT = { class: "wov-font-family-button" }, wT = { class: "wov-font-family-l
|
|
|
21781
21777
|
}, o = O(() => ({
|
|
21782
21778
|
...t,
|
|
21783
21779
|
...e.background
|
|
21784
|
-
})), r = ot(Pe), s = ot(
|
|
21780
|
+
})), r = ot(Pe), s = ot(Gn), i = ge("containerRef"), l = B({ width: 0, height: 0 });
|
|
21785
21781
|
let a = null;
|
|
21786
21782
|
const c = B(null);
|
|
21787
21783
|
let u = null;
|
|
@@ -22220,7 +22216,7 @@ const qT = /* @__PURE__ */ q({
|
|
|
22220
22216
|
const _ = e == null ? void 0 : e.getEditor(), D = _ == null ? void 0 : _._getContext();
|
|
22221
22217
|
for (const N of t.value) {
|
|
22222
22218
|
const R = N.block.value, W = D ? le.getWorldPosition(D, N.entityId) : R.position;
|
|
22223
|
-
wy.getAabb(W, R.size, R.rotateZ, d),
|
|
22219
|
+
wy.getAabb(W, R.size, R.rotateZ, d), Pn.translate(d, [-T.left, -T.top]), Pn.scale(d, T.zoom), E === null ? E = Pn.clone(d) : Pn.union(E, d);
|
|
22224
22220
|
}
|
|
22225
22221
|
return E;
|
|
22226
22222
|
}), p = ge("containerRef"), m = O(() => {
|
|
@@ -22962,7 +22958,7 @@ const qT = /* @__PURE__ */ q({
|
|
|
22962
22958
|
a.value = !a.value, c.value = null, u.value = "", d.value = "";
|
|
22963
22959
|
}
|
|
22964
22960
|
function y(T) {
|
|
22965
|
-
c.value = T, u.value = "", d.value = "",
|
|
22961
|
+
c.value = T, u.value = "", d.value = "", Jn(() => {
|
|
22966
22962
|
var E;
|
|
22967
22963
|
(E = l.value) == null || E.focus();
|
|
22968
22964
|
});
|
|
@@ -23015,12 +23011,12 @@ const qT = /* @__PURE__ */ q({
|
|
|
23015
23011
|
N = 600, R = 400;
|
|
23016
23012
|
break;
|
|
23017
23013
|
}
|
|
23018
|
-
const W = await e(), V = Pe.read(W), te = eo.read(W), J = V.left + te.width / V.zoom / 2, X = V.top + te.height / V.zoom / 2, Y =
|
|
23014
|
+
const W = await e(), V = Pe.read(W), te = eo.read(W), J = V.left + te.width / V.zoom / 2, X = V.top + te.height / V.zoom / 2, Y = Gn.read(W);
|
|
23019
23015
|
Y.enabled && (N = Math.max(Y.colWidth, Math.round(N / Y.colWidth) * Y.colWidth), R = Math.max(Y.rowHeight, Math.round(R / Y.rowHeight) * Y.rowHeight));
|
|
23020
23016
|
const re = Zi(W);
|
|
23021
23017
|
He(W, re, le);
|
|
23022
23018
|
const fe = le.write(W, re);
|
|
23023
|
-
fe.tag = "embed", fe.position[0] = J - N / 2, fe.position[1] = X - R / 2, fe.size[0] = N, fe.size[1] = R,
|
|
23019
|
+
fe.tag = "embed", fe.position[0] = J - N / 2, fe.position[1] = X - R / 2, fe.size[0] = N, fe.size[1] = R, Gn.snapPosition(W, fe.position), He(W, re, Ma);
|
|
23024
23020
|
const ke = Ma.write(W, re);
|
|
23025
23021
|
ke.url = T, ke.embedUrl = D, ke.provider = E, He(W, re, Hh, {
|
|
23026
23022
|
id: crypto.randomUUID()
|
|
@@ -23360,9 +23356,9 @@ const qT = /* @__PURE__ */ q({
|
|
|
23360
23356
|
const re = v.value - 40 - 20, fe = y.value, ke = k.value;
|
|
23361
23357
|
let Be = 0, qe = 0;
|
|
23362
23358
|
for (let xt = 0; xt < g.value.length; xt++) {
|
|
23363
|
-
const Dt = g.value[xt],
|
|
23364
|
-
if (Be +
|
|
23365
|
-
Be +=
|
|
23359
|
+
const Dt = g.value[xt], Sn = Be > 0 ? Dt + fe : Dt, Vt = g.value.length - xt - 1 > 0 ? ke : 0;
|
|
23360
|
+
if (Be + Sn + Vt <= re)
|
|
23361
|
+
Be += Sn, qe++;
|
|
23366
23362
|
else
|
|
23367
23363
|
break;
|
|
23368
23364
|
}
|
|
@@ -23371,7 +23367,7 @@ const qT = /* @__PURE__ */ q({
|
|
|
23371
23367
|
pe(v, () => {
|
|
23372
23368
|
g.value.length > 0 && M();
|
|
23373
23369
|
}), kt(() => {
|
|
23374
|
-
|
|
23370
|
+
Jn(() => {
|
|
23375
23371
|
b(), M();
|
|
23376
23372
|
});
|
|
23377
23373
|
});
|
|
@@ -24352,7 +24348,7 @@ function Dh(n, e) {
|
|
|
24352
24348
|
function g0(n) {
|
|
24353
24349
|
return y0(n) ? n : [n];
|
|
24354
24350
|
}
|
|
24355
|
-
function
|
|
24351
|
+
function Vn(n) {
|
|
24356
24352
|
return n === void 0 ? [] : g0(n);
|
|
24357
24353
|
}
|
|
24358
24354
|
function kc(n, e, t, o) {
|
|
@@ -24375,7 +24371,7 @@ function jo(n) {
|
|
|
24375
24371
|
}
|
|
24376
24372
|
function v0(n) {
|
|
24377
24373
|
if (!(n === void 0 || n === y3))
|
|
24378
|
-
return
|
|
24374
|
+
return Vn(n);
|
|
24379
24375
|
}
|
|
24380
24376
|
function bc(n, e, t) {
|
|
24381
24377
|
var s, i, l;
|
|
@@ -25144,7 +25140,7 @@ function B3(n) {
|
|
|
25144
25140
|
const s = e[r], i = typeof s == "string" ? {
|
|
25145
25141
|
target: s
|
|
25146
25142
|
} : s, l = Number.isNaN(+r) ? r : +r, a = t(l);
|
|
25147
|
-
return
|
|
25143
|
+
return Vn(i).map((c) => ({
|
|
25148
25144
|
...c,
|
|
25149
25145
|
event: a,
|
|
25150
25146
|
delay: l
|
|
@@ -25154,15 +25150,15 @@ function B3(n) {
|
|
|
25154
25150
|
delay: s
|
|
25155
25151
|
} = r;
|
|
25156
25152
|
return {
|
|
25157
|
-
...
|
|
25153
|
+
...Rn(n, r.event, r),
|
|
25158
25154
|
delay: s
|
|
25159
25155
|
};
|
|
25160
25156
|
});
|
|
25161
25157
|
}
|
|
25162
|
-
function
|
|
25158
|
+
function Rn(n, e, t) {
|
|
25163
25159
|
const o = v0(t.target), r = t.reenter ?? !1, s = V3(n, o), i = {
|
|
25164
25160
|
...t,
|
|
25165
|
-
actions:
|
|
25161
|
+
actions: Vn(t.actions),
|
|
25166
25162
|
guard: t.guard,
|
|
25167
25163
|
target: s,
|
|
25168
25164
|
source: n,
|
|
@@ -25183,24 +25179,24 @@ function z3(n) {
|
|
|
25183
25179
|
if (t === d0)
|
|
25184
25180
|
throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');
|
|
25185
25181
|
const o = n.config.on[t];
|
|
25186
|
-
e.set(t, jo(o).map((r) =>
|
|
25182
|
+
e.set(t, jo(o).map((r) => Rn(n, t, r)));
|
|
25187
25183
|
}
|
|
25188
25184
|
if (n.config.onDone) {
|
|
25189
25185
|
const t = `xstate.done.state.${n.id}`;
|
|
25190
|
-
e.set(t, jo(n.config.onDone).map((o) =>
|
|
25186
|
+
e.set(t, jo(n.config.onDone).map((o) => Rn(n, t, o)));
|
|
25191
25187
|
}
|
|
25192
25188
|
for (const t of n.invoke) {
|
|
25193
25189
|
if (t.onDone) {
|
|
25194
25190
|
const o = `xstate.done.actor.${t.id}`;
|
|
25195
|
-
e.set(o, jo(t.onDone).map((r) =>
|
|
25191
|
+
e.set(o, jo(t.onDone).map((r) => Rn(n, o, r)));
|
|
25196
25192
|
}
|
|
25197
25193
|
if (t.onError) {
|
|
25198
25194
|
const o = `xstate.error.actor.${t.id}`;
|
|
25199
|
-
e.set(o, jo(t.onError).map((r) =>
|
|
25195
|
+
e.set(o, jo(t.onError).map((r) => Rn(n, o, r)));
|
|
25200
25196
|
}
|
|
25201
25197
|
if (t.onSnapshot) {
|
|
25202
25198
|
const o = `xstate.snapshot.${t.id}`;
|
|
25203
|
-
e.set(o, jo(t.onSnapshot).map((r) =>
|
|
25199
|
+
e.set(o, jo(t.onSnapshot).map((r) => Rn(n, o, r)));
|
|
25204
25200
|
}
|
|
25205
25201
|
}
|
|
25206
25202
|
for (const t of n.after) {
|
|
@@ -25218,7 +25214,7 @@ function F3(n) {
|
|
|
25218
25214
|
guard: l,
|
|
25219
25215
|
target: `#${s}`
|
|
25220
25216
|
};
|
|
25221
|
-
e.push(
|
|
25217
|
+
e.push(Rn(n, "xstate.route", a));
|
|
25222
25218
|
}
|
|
25223
25219
|
r.states && t(r.states);
|
|
25224
25220
|
});
|
|
@@ -25234,7 +25230,7 @@ function H3(n, e) {
|
|
|
25234
25230
|
);
|
|
25235
25231
|
const o = {
|
|
25236
25232
|
source: n,
|
|
25237
|
-
actions: !e || typeof e == "string" ? [] :
|
|
25233
|
+
actions: !e || typeof e == "string" ? [] : Vn(e.actions),
|
|
25238
25234
|
eventType: null,
|
|
25239
25235
|
reenter: !1,
|
|
25240
25236
|
target: t ? [t] : [],
|
|
@@ -25994,11 +25990,11 @@ class Yi {
|
|
|
25994
25990
|
_machine: this.machine
|
|
25995
25991
|
})) : gA, this.type === "compound" && !this.config.initial)
|
|
25996
25992
|
throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);
|
|
25997
|
-
this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry =
|
|
25993
|
+
this.history = this.config.history === !0 ? "shallow" : this.config.history || !1, this.entry = Vn(this.config.entry).slice(), this.exit = Vn(this.config.exit).slice(), this.meta = this.config.meta, this.output = this.type === "final" || !this.parent ? this.config.output : void 0, this.tags = Vn(e.tags).slice();
|
|
25998
25994
|
}
|
|
25999
25995
|
/** @internal */
|
|
26000
25996
|
_initialize() {
|
|
26001
|
-
this.transitions = z3(this), this.config.always && (this.always = jo(this.config.always).map((e) =>
|
|
25997
|
+
this.transitions = z3(this), this.config.always && (this.always = jo(this.config.always).map((e) => Rn(this, d0, e))), Object.keys(this.states).forEach((e) => {
|
|
26002
25998
|
this.states[e]._initialize();
|
|
26003
25999
|
});
|
|
26004
26000
|
}
|
|
@@ -26045,7 +26041,7 @@ class Yi {
|
|
|
26045
26041
|
}
|
|
26046
26042
|
/** The logic invoked as actors by this state node. */
|
|
26047
26043
|
get invoke() {
|
|
26048
|
-
return Fo(this, "invoke", () =>
|
|
26044
|
+
return Fo(this, "invoke", () => Vn(this.config.invoke).map((e, t) => {
|
|
26049
26045
|
const {
|
|
26050
26046
|
src: o,
|
|
26051
26047
|
systemId: r
|
|
@@ -26531,7 +26527,7 @@ function _0({
|
|
|
26531
26527
|
}
|
|
26532
26528
|
const OA = 4, zh = 1, Fh = "draw", _A = _0({
|
|
26533
26529
|
guards: {
|
|
26534
|
-
isThresholdReached: ({ context: n, event: e }) =>
|
|
26530
|
+
isThresholdReached: ({ context: n, event: e }) => An.distance(n.pointingStartWorld, e.worldPosition) * e.cameraZoom >= OA
|
|
26535
26531
|
},
|
|
26536
26532
|
actions: {
|
|
26537
26533
|
setPointingStart: fo({
|
|
@@ -26552,7 +26548,7 @@ const OA = 4, zh = 1, Fh = "draw", _A = _0({
|
|
|
26552
26548
|
drawEntity: ({ context: n, event: e }) => {
|
|
26553
26549
|
if (!n.activeEntity) return;
|
|
26554
26550
|
const t = [n.pointingStartWorld[0], n.pointingStartWorld[1]], o = [e.worldPosition[0], e.worldPosition[1]];
|
|
26555
|
-
|
|
26551
|
+
Gn.snapPosition(e.ctx, t), Gn.snapPosition(e.ctx, o);
|
|
26556
26552
|
const r = Math.min(t[0], o[0]), s = Math.min(t[1], o[1]), i = Math.max(Math.abs(o[0] - t[0]), 1), l = Math.max(Math.abs(o[1] - t[1]), 1), a = le.write(e.ctx, n.activeEntity);
|
|
26557
26553
|
a.size = [i, l], le.setWorldPosition(e.ctx, n.activeEntity, [r, s]);
|
|
26558
26554
|
},
|
|
@@ -26961,7 +26957,7 @@ const LA = /* @__PURE__ */ q({
|
|
|
26961
26957
|
N.delete(I);
|
|
26962
26958
|
};
|
|
26963
26959
|
}
|
|
26964
|
-
function
|
|
26960
|
+
function Sn() {
|
|
26965
26961
|
return M.sessionId;
|
|
26966
26962
|
}
|
|
26967
26963
|
function yr(I) {
|
|
@@ -26971,7 +26967,7 @@ const LA = /* @__PURE__ */ q({
|
|
|
26971
26967
|
hasEntity: (I) => S.has(I),
|
|
26972
26968
|
getEditor: () => b.value,
|
|
26973
26969
|
getAssetManager: () => Ge,
|
|
26974
|
-
getSessionId:
|
|
26970
|
+
getSessionId: Sn,
|
|
26975
26971
|
getUserBySessionId: yr,
|
|
26976
26972
|
subscribeComponent: ke,
|
|
26977
26973
|
subscribeSingleton: qe,
|
|
@@ -27089,7 +27085,7 @@ const LA = /* @__PURE__ */ q({
|
|
|
27089
27085
|
gn.read(ye, jt).identifier === ne && gn.patch(ye, jt, { uploadState: he });
|
|
27090
27086
|
});
|
|
27091
27087
|
};
|
|
27092
|
-
Ge.onUploadStart((ne) => L(ne,
|
|
27088
|
+
Ge.onUploadStart((ne) => L(ne, Wn.Uploading)), Ge.onUploadComplete((ne) => L(ne, Wn.Complete)), Ge.onUploadError((ne) => L(ne, Wn.Failed));
|
|
27093
27089
|
}
|
|
27094
27090
|
await (Ge == null ? void 0 : Ge.resumePendingUploads()), pe(V, (L, ne) => {
|
|
27095
27091
|
L && !ne && (Ge == null || Ge.resumePendingUploads().catch((he) => console.error("Failed to resume uploads:", he)));
|
|
@@ -27455,7 +27451,7 @@ export {
|
|
|
27455
27451
|
Hy as ArcArrow,
|
|
27456
27452
|
sI as ArcArrowTool,
|
|
27457
27453
|
Uy as ArrowHandle,
|
|
27458
|
-
|
|
27454
|
+
Ln as ArrowHead,
|
|
27459
27455
|
dh as ArrowHeadButton,
|
|
27460
27456
|
Gy as ArrowTerminal,
|
|
27461
27457
|
eM as ArrowThicknessButton,
|
|
@@ -27531,7 +27527,7 @@ export {
|
|
|
27531
27527
|
pI as defineCanvasSingleton,
|
|
27532
27528
|
Gr as getArrowHead,
|
|
27533
27529
|
De as useComponent,
|
|
27534
|
-
|
|
27530
|
+
xn as useComponents,
|
|
27535
27531
|
Ce as useEditorContext,
|
|
27536
27532
|
yT as useFonts,
|
|
27537
27533
|
Kg as useImageCreation,
|