@woven-canvas/vue 1.0.15 → 1.0.16
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/components/WovenCanvasCore.vue.d.ts.map +1 -1
- package/build/index.js +492 -479
- package/build/index.umd.cjs +12 -12
- package/package.json +6 -6
package/build/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Synced as $h, defineCanvasSingleton as Bh, CanvasStore as B0 } from "@woven-ecs/canvas-store";
|
|
2
2
|
import { CanvasComponentDef as WA, CanvasSingletonDef as jA, CanvasStore as UA, Synced as KA, defineCanvasComponent as qA, defineCanvasSingleton as JA } from "@woven-ecs/canvas-store";
|
|
3
|
-
import { ArrowHeadKind as
|
|
4
|
-
import { inject as pe, shallowRef as Te, onUnmounted as Le, defineComponent as q, computed as I, openBlock as C, createElementBlock as M, unref as F, Fragment as ue, createElementVNode as b, createCommentVNode as j, ref as B, onMounted as kt, createBlock as
|
|
5
|
-
import { hasComponent as ze, Color as Zo, EmbedProvider as de, Embed as Ea, Block as ie, Frame as js, FrameDropTarget as U0, UploadState as jn, Asset as vn, Image as Us, getBlockDef as Uh, Grid as Sn, RankBounds as Kh, createEntity as Zi, addComponent as Fe, Synced as Et, defineQuery as
|
|
3
|
+
import { ArrowHeadKind as Xe, ArcArrow as pn, ElbowArrow as mn, createArrowsPlugin as z0 } from "@woven-canvas/plugin-arrows";
|
|
4
|
+
import { inject as pe, shallowRef as Te, onUnmounted as Le, defineComponent as q, computed as I, openBlock as C, createElementBlock as M, unref as F, Fragment as ue, createElementVNode as b, createCommentVNode as j, ref as B, onMounted as kt, createBlock as ne, renderList as Ee, toDisplayString as Ne, normalizeStyle as ye, watch as me, normalizeClass as Me, withAsyncContext as Dr, h as Xi, getCurrentInstance as Ec, watchEffect as Ws, nextTick as Gn, onBeforeUnmount as F0, markRaw as H0, customRef as V0, toValue as rt, reactive as zh, readonly as Rl, createVNode as Z, mergeProps as Jr, getCurrentScope as Fh, onScopeDispose as Hh, shallowReadonly as $o, provide as po, withModifiers as At, renderSlot as ge, Teleport as ms, withCtx as se, Transition as Mc, withDirectives as Vh, withKeys as td, vModelText as Wh, useSlots as jh, resolveDynamicComponent as xa, createTextVNode as Sa, normalizeProps as Ca, guardReactiveProps as Ta, Suspense as W0, createSlots as j0 } from "vue";
|
|
5
|
+
import { hasComponent as ze, Color as Zo, EmbedProvider as de, Embed as Ea, Block as ie, Frame as js, FrameDropTarget as U0, UploadState as jn, Asset as vn, Image as Us, getBlockDef as Uh, Grid as Sn, RankBounds as Kh, createEntity as Zi, addComponent as Fe, Synced as Et, defineQuery as ct, Selected as Qi, Mouse as Ma, Camera as Re, canBlockEdit as Ac, EditAfterPlacing as Ic, SelectBlock as K0, isAlive as q0, cascadeDelete as J0, getResources as cr, deselectAll as Aa, selectBlock as Ia, findFrameAtPoint as G0, AssignFrameChildren as Y0, Text as st, getDescendants as X0, Aabb as Ko, DeselectAll as Oc, Edited as _c, Screen as eo, TransformBoxStateSingleton as qh, TransformBoxState as Z0, UpdateTransformBox as Jh, SelectionStateSingleton as el, SelectionState as Gr, TransformHandle as nd, TransformHandleKind as Q0, removeEntity as Oa, ResetKeyboard as ey, VerticalAlignment as Ye, StrokeKind as Tt, Shape as Yt, VerticalAlign as Ks, TextAlignment as fn, getPluginResources as Oo, Undo as Dc, Redo as qs, RemoveSelected as ty, detectEmbedProvider as ny, validateEmbedUrl as oy, resolveEmbedUrl as ry, Controls as zt, Cursor as Nc, field as gn, defineEditorState as sy, defineEditorSystem as tl, isReadonly as nl, getPointerInput as Rc, PointerButton as Gh, PlaceBlockEvent as Js, Held as _a, on as od, Key as Pl, Connector as rd, Hovered as iy, Opacity as sd, User as Ll, Layer as ly, UserData as ay, Editor as cy, SINGLETON_ENTITY_ID as uy, EventType as Bo, resolveLayerRank as id, compareBlockOrder as dy } from "@woven-canvas/core";
|
|
6
6
|
import { Arc as ln, Vec2 as In, Aabb as Ln, Rect as fy } from "@woven-canvas/math";
|
|
7
7
|
import { EraserStroke as hy, POINTS_CAPACITY as ld, createEraserPlugin as py } from "@woven-canvas/plugin-eraser";
|
|
8
8
|
import { PenStrokeKind as Da, PenStroke as Na, createPenPlugin as my } from "@woven-canvas/plugin-pen";
|
|
@@ -10,31 +10,31 @@ import { CONTROLS_PLUGIN_NAME as gy, DEFAULT_CONTROLS_OPTIONS as yy, CanvasContr
|
|
|
10
10
|
import { createTapesPlugin as wy } from "@woven-canvas/plugin-tapes";
|
|
11
11
|
const Yh = [
|
|
12
12
|
{
|
|
13
|
-
kind:
|
|
13
|
+
kind: Xe.None,
|
|
14
14
|
label: "None",
|
|
15
15
|
gap: 0,
|
|
16
16
|
svg: ""
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
kind:
|
|
19
|
+
kind: Xe.V,
|
|
20
20
|
label: "Arrow",
|
|
21
21
|
gap: 15,
|
|
22
22
|
svg: '<polyline points="-10,-7 -1,0 -10,7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />'
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
kind:
|
|
25
|
+
kind: Xe.Delta,
|
|
26
26
|
label: "Triangle",
|
|
27
27
|
gap: 20,
|
|
28
28
|
svg: '<polygon points="-1,0 -12,-7 -12,7" fill="currentColor" />'
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
kind:
|
|
31
|
+
kind: Xe.Circle,
|
|
32
32
|
label: "Circle",
|
|
33
33
|
gap: 0,
|
|
34
34
|
svg: '<circle cx="-6" cy="0" r="6" fill="currentColor" />'
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
kind:
|
|
37
|
+
kind: Xe.Diamond,
|
|
38
38
|
label: "Diamond",
|
|
39
39
|
gap: 0,
|
|
40
40
|
svg: '<polygon points="0,0 -7,-6 -14,0 -7,6" fill="currentColor" />'
|
|
@@ -116,7 +116,7 @@ const ky = { key: 0 }, by = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
116
116
|
return `${y[0]},${y[1]} ${m[0]},${m[1]} ${p[0]},${p[1]} ${g[0]},${g[1]}`;
|
|
117
117
|
});
|
|
118
118
|
return (l, a) => t.value ? (C(), M("g", ky, [
|
|
119
|
-
n.kind === F(
|
|
119
|
+
n.kind === F(Xe).V && o.value ? (C(), M(ue, { key: 0 }, [
|
|
120
120
|
b("line", {
|
|
121
121
|
x1: o.value.p1[0],
|
|
122
122
|
y1: o.value.p1[1],
|
|
@@ -135,17 +135,17 @@ const ky = { key: 0 }, by = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
135
135
|
"stroke-width": n.thickness,
|
|
136
136
|
"stroke-linecap": "round"
|
|
137
137
|
}, null, 8, xy)
|
|
138
|
-
], 64)) : n.kind === F(
|
|
138
|
+
], 64)) : n.kind === F(Xe).Delta && r.value ? (C(), M("polygon", {
|
|
139
139
|
key: 1,
|
|
140
140
|
points: r.value,
|
|
141
141
|
fill: n.color
|
|
142
|
-
}, null, 8, Sy)) : n.kind === F(
|
|
142
|
+
}, null, 8, Sy)) : n.kind === F(Xe).Circle && s.value ? (C(), M("circle", {
|
|
143
143
|
key: 2,
|
|
144
144
|
cx: s.value.center[0],
|
|
145
145
|
cy: s.value.center[1],
|
|
146
146
|
r: s.value.radius,
|
|
147
147
|
fill: n.color
|
|
148
|
-
}, null, 8, Cy)) : n.kind === F(
|
|
148
|
+
}, null, 8, Cy)) : n.kind === F(Xe).Diamond && i.value ? (C(), M("polygon", {
|
|
149
149
|
key: 3,
|
|
150
150
|
points: i.value,
|
|
151
151
|
fill: n.color
|
|
@@ -256,7 +256,7 @@ const ky = { key: 0 }, by = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
|
|
|
256
256
|
"stroke-linecap": "round"
|
|
257
257
|
}, null, 8, Oy)) : j("", !0),
|
|
258
258
|
m.value ? (C(), M(ue, { key: 2 }, [
|
|
259
|
-
m.value.startHead !== "none" ? (C(),
|
|
259
|
+
m.value.startHead !== "none" ? (C(), ne($n, {
|
|
260
260
|
key: 0,
|
|
261
261
|
position: m.value.start,
|
|
262
262
|
direction: m.value.startDir,
|
|
@@ -265,7 +265,7 @@ const ky = { key: 0 }, by = ["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(),
|
|
268
|
+
m.value.endHead !== "none" ? (C(), ne($n, {
|
|
269
269
|
key: 1,
|
|
270
270
|
position: m.value.end,
|
|
271
271
|
direction: m.value.endDir,
|
|
@@ -293,7 +293,7 @@ const ky = { key: 0 }, by = ["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, Dy)) : j("", !0),
|
|
296
|
-
m.value.startHead !== "none" ? (C(),
|
|
296
|
+
m.value.startHead !== "none" ? (C(), ne($n, {
|
|
297
297
|
key: 2,
|
|
298
298
|
position: m.value.start,
|
|
299
299
|
direction: m.value.startDir,
|
|
@@ -302,7 +302,7 @@ const ky = { key: 0 }, by = ["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(),
|
|
305
|
+
m.value.endHead !== "none" ? (C(), ne($n, {
|
|
306
306
|
key: 3,
|
|
307
307
|
position: m.value.end,
|
|
308
308
|
direction: m.value.endDir,
|
|
@@ -451,7 +451,7 @@ const Vy = /* @__PURE__ */ _o(zy, [["render", Hy]]), Wy = {
|
|
|
451
451
|
"stroke-width": d.value,
|
|
452
452
|
"stroke-linecap": "round"
|
|
453
453
|
}, null, 8, Uy))), 128)),
|
|
454
|
-
p.value.startHead !== "none" ? (C(),
|
|
454
|
+
p.value.startHead !== "none" ? (C(), ne($n, {
|
|
455
455
|
key: 0,
|
|
456
456
|
position: p.value.startPos,
|
|
457
457
|
direction: p.value.startDir,
|
|
@@ -460,7 +460,7 @@ const Vy = /* @__PURE__ */ _o(zy, [["render", Hy]]), Wy = {
|
|
|
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(),
|
|
463
|
+
p.value.endHead !== "none" ? (C(), ne($n, {
|
|
464
464
|
key: 1,
|
|
465
465
|
position: p.value.endPos,
|
|
466
466
|
direction: p.value.endDir,
|
|
@@ -481,7 +481,7 @@ const Vy = /* @__PURE__ */ _o(zy, [["render", Hy]]), Wy = {
|
|
|
481
481
|
style: { "stroke-width": "calc(2px / var(--wov-zoom))" },
|
|
482
482
|
"stroke-linecap": "round"
|
|
483
483
|
}, null, 8, Ky))), 128)),
|
|
484
|
-
p.value.startHead !== "none" ? (C(),
|
|
484
|
+
p.value.startHead !== "none" ? (C(), ne($n, {
|
|
485
485
|
key: 0,
|
|
486
486
|
position: p.value.startPos,
|
|
487
487
|
direction: p.value.startDir,
|
|
@@ -490,7 +490,7 @@ const Vy = /* @__PURE__ */ _o(zy, [["render", Hy]]), Wy = {
|
|
|
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(),
|
|
493
|
+
p.value.endHead !== "none" ? (C(), ne($n, {
|
|
494
494
|
key: 1,
|
|
495
495
|
position: p.value.endPos,
|
|
496
496
|
direction: p.value.endDir,
|
|
@@ -653,7 +653,7 @@ function sv(n, e, t, o) {
|
|
|
653
653
|
function op(n, e, t) {
|
|
654
654
|
return Zt(n, Bn(e, t));
|
|
655
655
|
}
|
|
656
|
-
const
|
|
656
|
+
const qe = [0, 0], Tn = [0, 0], En = [0, 0];
|
|
657
657
|
function iv(n, e) {
|
|
658
658
|
let t = op(n, np(tp(Un(n, Zt(n, [1, 1])))), -e), o = [], r = 1 / 13;
|
|
659
659
|
for (let s = r; s <= 1; s += r) o.push(Lc(t, n, Xr * 2 * s));
|
|
@@ -690,23 +690,23 @@ function fv(n, e = {}) {
|
|
|
690
690
|
if (n.length === 0 || t <= 0) return [];
|
|
691
691
|
let p = n[n.length - 1].runningLength, m = yd(l.taper, t, p), g = yd(a.taper, t, p), y = (t * o) ** 2, v = [], k = [], w = dv(n, s, t), x = dd(t, r, n[n.length - 1].pressure, i), T, S = n[0].vector, E = n[0].point, _ = E, O = E, D = _, N = !1;
|
|
692
692
|
for (let J = 0; J < n.length; J++) {
|
|
693
|
-
let { pressure: X } = n[J], { point: Y, vector:
|
|
693
|
+
let { pressure: X } = n[J], { point: Y, vector: oe, distance: ve, runningLength: we } = n[J], $e = J === n.length - 1;
|
|
694
694
|
if (!$e && p - we < 3) continue;
|
|
695
695
|
r ? (s && (X = ep(w, ve, t)), x = dd(t, r, X, i)) : x = t / 2, T === void 0 && (T = x);
|
|
696
|
-
let
|
|
697
|
-
x = Math.max(0.01, x * Math.min(
|
|
698
|
-
let Nt = ($e ? n[J] : n[J + 1]).vector, sn = $e ? 1 : hd(
|
|
696
|
+
let nt = we < m ? d(we / m) : 1, bt = p - we < g ? f((p - we) / g) : 1;
|
|
697
|
+
x = Math.max(0.01, x * Math.min(nt, bt));
|
|
698
|
+
let Nt = ($e ? n[J] : n[J + 1]).vector, sn = $e ? 1 : hd(oe, Nt), Lo = hd(oe, S) < 0 && !N, ro = sn !== null && sn < 0;
|
|
699
699
|
if (Lo || ro) {
|
|
700
|
-
zl(
|
|
701
|
-
for (let Rt = 0; Rt <= 1; Rt += 0.07692307692307693) Ra(Tn, Y,
|
|
700
|
+
zl(qe, S), Bl(qe, qe, x);
|
|
701
|
+
for (let Rt = 0; Rt <= 1; Rt += 0.07692307692307693) Ra(Tn, Y, qe), md(Tn, Tn, Y, Xr * Rt), O = [Tn[0], Tn[1]], v.push(O), fd(En, Y, qe), md(En, En, Y, Xr * -Rt), D = [En[0], En[1]], k.push(D);
|
|
702
702
|
E = O, _ = D, ro && (N = !0);
|
|
703
703
|
continue;
|
|
704
704
|
}
|
|
705
705
|
if (N = !1, $e) {
|
|
706
|
-
zl(
|
|
706
|
+
zl(qe, oe), Bl(qe, qe, x), v.push(Un(Y, qe)), k.push(Zt(Y, qe));
|
|
707
707
|
continue;
|
|
708
708
|
}
|
|
709
|
-
sv(
|
|
709
|
+
sv(qe, Nt, oe, sn), zl(qe, qe), Bl(qe, qe, x), Ra(Tn, Y, qe), O = [Tn[0], Tn[1]], (J <= 1 || pd(E, O) > y) && (v.push(O), E = O), fd(En, Y, qe), D = [En[0], En[1]], (J <= 1 || pd(_, D) > y) && (k.push(D), _ = D), w = X, S = oe;
|
|
710
710
|
}
|
|
711
711
|
let H = [n[0].point[0], n[0].point[1]], V = n.length > 1 ? [n[n.length - 1].point[0], n[n.length - 1].point[1]] : Zt(n[0].point, [1, 1]), U = [], ee = [];
|
|
712
712
|
if (n.length === 1) {
|
|
@@ -785,7 +785,7 @@ const pv = { class: "wov-eraser-stroke" }, mv = { preserveAspectRatio: "none" },
|
|
|
785
785
|
g = m[w], y = m[w + 1], k += `${s(g[0], y[0]).toFixed(2)},${s(g[1], y[1]).toFixed(2)} `;
|
|
786
786
|
return k += `${y[0].toFixed(2)},${y[1].toFixed(2)} `, k += "Z", k;
|
|
787
787
|
}
|
|
788
|
-
return
|
|
788
|
+
return me(
|
|
789
789
|
[t, o],
|
|
790
790
|
([l, a]) => {
|
|
791
791
|
if (!l || !a) {
|
|
@@ -967,7 +967,7 @@ const kv = { class: "wov-image-block" }, bv = {
|
|
|
967
967
|
console.error("Failed to get display URL:", T), g.value = !0, m.value = !1;
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
|
|
970
|
+
me(
|
|
971
971
|
() => i.value,
|
|
972
972
|
() => {
|
|
973
973
|
k();
|
|
@@ -975,7 +975,7 @@ const kv = { class: "wov-image-block" }, bv = {
|
|
|
975
975
|
{ immediate: !0 }
|
|
976
976
|
), kt(() => {
|
|
977
977
|
k();
|
|
978
|
-
}),
|
|
978
|
+
}), me(
|
|
979
979
|
() => [o.block.size[0], o.block.size[1]],
|
|
980
980
|
() => {
|
|
981
981
|
const x = u();
|
|
@@ -1053,7 +1053,7 @@ const kv = { class: "wov-image-block" }, bv = {
|
|
|
1053
1053
|
const g = p[p.length - 1];
|
|
1054
1054
|
return m += `L${g[0].toFixed(2)},${g[1].toFixed(2)} `, m += "Z", m;
|
|
1055
1055
|
}
|
|
1056
|
-
|
|
1056
|
+
me(
|
|
1057
1057
|
[t, o],
|
|
1058
1058
|
([p, m]) => {
|
|
1059
1059
|
if (!p || !m) {
|
|
@@ -1141,11 +1141,11 @@ const kv = { class: "wov-image-block" }, bv = {
|
|
|
1141
1141
|
heart: "M50,16 C44,7 37,0 26,0 11,0 0,12 0,28 0,60 16,65 50,100 84,65 100,60 100,28 100,12 89,0 74,0 63,0 56,7 50,16 Z",
|
|
1142
1142
|
arrow: "M0,35 L60,35 L60,0 L100,50 L60,100 L60,65 L0,65 Z"
|
|
1143
1143
|
};
|
|
1144
|
-
function
|
|
1144
|
+
function Ge(n) {
|
|
1145
1145
|
this.content = n;
|
|
1146
1146
|
}
|
|
1147
|
-
|
|
1148
|
-
constructor:
|
|
1147
|
+
Ge.prototype = {
|
|
1148
|
+
constructor: Ge,
|
|
1149
1149
|
find: function(n) {
|
|
1150
1150
|
for (var e = 0; e < this.content.length; e += 2)
|
|
1151
1151
|
if (this.content[e] === n) return e;
|
|
@@ -1164,7 +1164,7 @@ Je.prototype = {
|
|
|
1164
1164
|
// given, the key of the binding will be replaced with that key.
|
|
1165
1165
|
update: function(n, e, t) {
|
|
1166
1166
|
var o = t && t != n ? this.remove(t) : this, r = o.find(n), s = o.content.slice();
|
|
1167
|
-
return r == -1 ? s.push(t || n, e) : (s[r + 1] = e, t && (s[r] = t)), new
|
|
1167
|
+
return r == -1 ? s.push(t || n, e) : (s[r + 1] = e, t && (s[r] = t)), new Ge(s);
|
|
1168
1168
|
},
|
|
1169
1169
|
// :: (string) → OrderedMap
|
|
1170
1170
|
// Return a map with the given key removed, if it existed.
|
|
@@ -1172,25 +1172,25 @@ Je.prototype = {
|
|
|
1172
1172
|
var e = this.find(n);
|
|
1173
1173
|
if (e == -1) return this;
|
|
1174
1174
|
var t = this.content.slice();
|
|
1175
|
-
return t.splice(e, 2), new
|
|
1175
|
+
return t.splice(e, 2), new Ge(t);
|
|
1176
1176
|
},
|
|
1177
1177
|
// :: (string, any) → OrderedMap
|
|
1178
1178
|
// Add a new key to the start of the map.
|
|
1179
1179
|
addToStart: function(n, e) {
|
|
1180
|
-
return new
|
|
1180
|
+
return new Ge([n, e].concat(this.remove(n).content));
|
|
1181
1181
|
},
|
|
1182
1182
|
// :: (string, any) → OrderedMap
|
|
1183
1183
|
// Add a new key to the end of the map.
|
|
1184
1184
|
addToEnd: function(n, e) {
|
|
1185
1185
|
var t = this.remove(n).content.slice();
|
|
1186
|
-
return t.push(n, e), new
|
|
1186
|
+
return t.push(n, e), new Ge(t);
|
|
1187
1187
|
},
|
|
1188
1188
|
// :: (string, string, any) → OrderedMap
|
|
1189
1189
|
// Add a key after the given key. If `place` is not found, the new
|
|
1190
1190
|
// key is added to the end.
|
|
1191
1191
|
addBefore: function(n, e, t) {
|
|
1192
1192
|
var o = this.remove(e), r = o.content.slice(), s = o.find(n);
|
|
1193
|
-
return r.splice(s == -1 ? r.length : s, 0, e, t), new
|
|
1193
|
+
return r.splice(s == -1 ? r.length : s, 0, e, t), new Ge(r);
|
|
1194
1194
|
},
|
|
1195
1195
|
// :: ((key: string, value: any))
|
|
1196
1196
|
// Call the given function for each key/value pair in the map, in
|
|
@@ -1203,20 +1203,20 @@ Je.prototype = {
|
|
|
1203
1203
|
// Create a new map by prepending the keys in this map that don't
|
|
1204
1204
|
// appear in `map` before the keys in `map`.
|
|
1205
1205
|
prepend: function(n) {
|
|
1206
|
-
return n =
|
|
1206
|
+
return n = Ge.from(n), n.size ? new Ge(n.content.concat(this.subtract(n).content)) : this;
|
|
1207
1207
|
},
|
|
1208
1208
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
1209
1209
|
// Create a new map by appending the keys in this map that don't
|
|
1210
1210
|
// appear in `map` after the keys in `map`.
|
|
1211
1211
|
append: function(n) {
|
|
1212
|
-
return n =
|
|
1212
|
+
return n = Ge.from(n), n.size ? new Ge(this.subtract(n).content.concat(n.content)) : this;
|
|
1213
1213
|
},
|
|
1214
1214
|
// :: (union<Object, OrderedMap>) → OrderedMap
|
|
1215
1215
|
// Create a map containing all the keys in this map that don't
|
|
1216
1216
|
// appear in `map`.
|
|
1217
1217
|
subtract: function(n) {
|
|
1218
1218
|
var e = this;
|
|
1219
|
-
n =
|
|
1219
|
+
n = Ge.from(n);
|
|
1220
1220
|
for (var t = 0; t < n.content.length; t += 2)
|
|
1221
1221
|
e = e.remove(n.content[t]);
|
|
1222
1222
|
return e;
|
|
@@ -1235,11 +1235,11 @@ Je.prototype = {
|
|
|
1235
1235
|
return this.content.length >> 1;
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
|
-
|
|
1239
|
-
if (n instanceof
|
|
1238
|
+
Ge.from = function(n) {
|
|
1239
|
+
if (n instanceof Ge) return n;
|
|
1240
1240
|
var e = [];
|
|
1241
1241
|
if (n) for (var t in n) e.push(t, n[t]);
|
|
1242
|
-
return new
|
|
1242
|
+
return new Ge(e);
|
|
1243
1243
|
};
|
|
1244
1244
|
function rp(n, e, t) {
|
|
1245
1245
|
for (let o = 0; ; o++) {
|
|
@@ -3193,7 +3193,7 @@ class wp {
|
|
|
3193
3193
|
let t = this.spec = {};
|
|
3194
3194
|
for (let r in e)
|
|
3195
3195
|
t[r] = e[r];
|
|
3196
|
-
t.nodes =
|
|
3196
|
+
t.nodes = Ge.from(e.nodes), t.marks = Ge.from(e.marks || {}), this.nodes = Cd.compile(this.spec.nodes, this), this.marks = ol.compile(this.spec.marks, this);
|
|
3197
3197
|
let o = /* @__PURE__ */ Object.create(null);
|
|
3198
3198
|
for (let r in this.nodes) {
|
|
3199
3199
|
if (r in this.marks)
|
|
@@ -4210,7 +4210,7 @@ class es {
|
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
4212
4212
|
const Vl = /* @__PURE__ */ Object.create(null);
|
|
4213
|
-
class
|
|
4213
|
+
class at {
|
|
4214
4214
|
/**
|
|
4215
4215
|
Get the step map that represents the changes made by this step,
|
|
4216
4216
|
and which can be used to transform between positions in the old
|
|
@@ -4293,7 +4293,7 @@ function $c(n, e, t) {
|
|
|
4293
4293
|
}
|
|
4294
4294
|
return P.fromArray(o);
|
|
4295
4295
|
}
|
|
4296
|
-
class zn extends
|
|
4296
|
+
class zn extends at {
|
|
4297
4297
|
/**
|
|
4298
4298
|
Create a mark step.
|
|
4299
4299
|
*/
|
|
@@ -4331,8 +4331,8 @@ class zn extends lt {
|
|
|
4331
4331
|
return new zn(t.from, t.to, e.markFromJSON(t.mark));
|
|
4332
4332
|
}
|
|
4333
4333
|
}
|
|
4334
|
-
|
|
4335
|
-
class $t extends
|
|
4334
|
+
at.jsonID("addMark", zn);
|
|
4335
|
+
class $t extends at {
|
|
4336
4336
|
/**
|
|
4337
4337
|
Create a mark-removing step.
|
|
4338
4338
|
*/
|
|
@@ -4370,8 +4370,8 @@ class $t extends lt {
|
|
|
4370
4370
|
return new $t(t.from, t.to, e.markFromJSON(t.mark));
|
|
4371
4371
|
}
|
|
4372
4372
|
}
|
|
4373
|
-
|
|
4374
|
-
class Fn extends
|
|
4373
|
+
at.jsonID("removeMark", $t);
|
|
4374
|
+
class Fn extends at {
|
|
4375
4375
|
/**
|
|
4376
4376
|
Create a node mark step.
|
|
4377
4377
|
*/
|
|
@@ -4414,8 +4414,8 @@ class Fn extends lt {
|
|
|
4414
4414
|
return new Fn(t.pos, e.markFromJSON(t.mark));
|
|
4415
4415
|
}
|
|
4416
4416
|
}
|
|
4417
|
-
|
|
4418
|
-
class Co extends
|
|
4417
|
+
at.jsonID("addNodeMark", Fn);
|
|
4418
|
+
class Co extends at {
|
|
4419
4419
|
/**
|
|
4420
4420
|
Create a mark-removing step.
|
|
4421
4421
|
*/
|
|
@@ -4449,8 +4449,8 @@ class Co extends lt {
|
|
|
4449
4449
|
return new Co(t.pos, e.markFromJSON(t.mark));
|
|
4450
4450
|
}
|
|
4451
4451
|
}
|
|
4452
|
-
|
|
4453
|
-
class Be extends
|
|
4452
|
+
at.jsonID("removeNodeMark", Co);
|
|
4453
|
+
class Be extends at {
|
|
4454
4454
|
/**
|
|
4455
4455
|
The given `slice` should fit the 'gap' between `from` and
|
|
4456
4456
|
`to`—the depths must line up, and the surrounding nodes must be
|
|
@@ -4501,8 +4501,8 @@ class Be extends lt {
|
|
|
4501
4501
|
return new Be(t.from, t.to, G.fromJSON(e, t.slice), !!t.structure);
|
|
4502
4502
|
}
|
|
4503
4503
|
}
|
|
4504
|
-
|
|
4505
|
-
class He extends
|
|
4504
|
+
at.jsonID("replace", Be);
|
|
4505
|
+
class He extends at {
|
|
4506
4506
|
/**
|
|
4507
4507
|
Create a replace-around step with the given range and gap.
|
|
4508
4508
|
`insert` should be the point in the slice into which the content
|
|
@@ -4559,7 +4559,7 @@ class He extends lt {
|
|
|
4559
4559
|
return new He(t.from, t.to, t.gapFrom, t.gapTo, G.fromJSON(e, t.slice), t.insert, !!t.structure);
|
|
4560
4560
|
}
|
|
4561
4561
|
}
|
|
4562
|
-
|
|
4562
|
+
at.jsonID("replaceAround", He);
|
|
4563
4563
|
function Ha(n, e, t) {
|
|
4564
4564
|
let o = n.resolve(e), r = t - e, s = o.depth;
|
|
4565
4565
|
for (; r > 0 && s > 0 && o.indexAfter(s) == o.node(s).childCount; )
|
|
@@ -5146,7 +5146,7 @@ function Pp(n, e) {
|
|
|
5146
5146
|
}
|
|
5147
5147
|
return t;
|
|
5148
5148
|
}
|
|
5149
|
-
class Go extends
|
|
5149
|
+
class Go extends at {
|
|
5150
5150
|
/**
|
|
5151
5151
|
Construct an attribute step.
|
|
5152
5152
|
*/
|
|
@@ -5183,8 +5183,8 @@ class Go extends lt {
|
|
|
5183
5183
|
return new Go(t.pos, t.attr, t.value);
|
|
5184
5184
|
}
|
|
5185
5185
|
}
|
|
5186
|
-
|
|
5187
|
-
class ts extends
|
|
5186
|
+
at.jsonID("attr", Go);
|
|
5187
|
+
class ts extends at {
|
|
5188
5188
|
/**
|
|
5189
5189
|
Construct an attribute step.
|
|
5190
5190
|
*/
|
|
@@ -5217,7 +5217,7 @@ class ts extends lt {
|
|
|
5217
5217
|
return new ts(t.attr, t.value);
|
|
5218
5218
|
}
|
|
5219
5219
|
}
|
|
5220
|
-
|
|
5220
|
+
at.jsonID("docAttr", ts);
|
|
5221
5221
|
let Qo = class extends Error {
|
|
5222
5222
|
};
|
|
5223
5223
|
Qo = function n(e) {
|
|
@@ -6718,7 +6718,7 @@ function G1(n) {
|
|
|
6718
6718
|
return !0;
|
|
6719
6719
|
};
|
|
6720
6720
|
}
|
|
6721
|
-
const
|
|
6721
|
+
const Ze = function(n) {
|
|
6722
6722
|
for (var e = 0; ; e++)
|
|
6723
6723
|
if (n = n.previousSibling, !n)
|
|
6724
6724
|
return e;
|
|
@@ -6743,7 +6743,7 @@ function Hd(n, e, t, o, r) {
|
|
|
6743
6743
|
let i = n.parentNode;
|
|
6744
6744
|
if (!i || i.nodeType != 1 || gs(n) || X1.test(n.nodeName) || n.contentEditable == "false")
|
|
6745
6745
|
return !1;
|
|
6746
|
-
e =
|
|
6746
|
+
e = Ze(n) + (r < 0 ? 0 : 1), n = i;
|
|
6747
6747
|
} else if (n.nodeType == 1) {
|
|
6748
6748
|
let i = n.childNodes[e + (r < 0 ? -1 : 0)];
|
|
6749
6749
|
if (i.nodeType == 1 && i.contentEditable == "false")
|
|
@@ -6769,7 +6769,7 @@ function Z1(n, e) {
|
|
|
6769
6769
|
return null;
|
|
6770
6770
|
n = n.childNodes[e - 1], e = Mt(n);
|
|
6771
6771
|
} else if (n.parentNode && !gs(n))
|
|
6772
|
-
e =
|
|
6772
|
+
e = Ze(n), n = n.parentNode;
|
|
6773
6773
|
else
|
|
6774
6774
|
return null;
|
|
6775
6775
|
}
|
|
@@ -6783,7 +6783,7 @@ function Q1(n, e) {
|
|
|
6783
6783
|
return null;
|
|
6784
6784
|
n = n.childNodes[e], e = 0;
|
|
6785
6785
|
} else if (n.parentNode && !gs(n))
|
|
6786
|
-
e =
|
|
6786
|
+
e = Ze(n) + 1, n = n.parentNode;
|
|
6787
6787
|
else
|
|
6788
6788
|
return null;
|
|
6789
6789
|
}
|
|
@@ -6792,7 +6792,7 @@ function ew(n, e, t) {
|
|
|
6792
6792
|
for (let o = e == 0, r = e == Mt(n); o || r; ) {
|
|
6793
6793
|
if (n == t)
|
|
6794
6794
|
return !0;
|
|
6795
|
-
let s =
|
|
6795
|
+
let s = Ze(n);
|
|
6796
6796
|
if (n = n.parentNode, !n)
|
|
6797
6797
|
return !1;
|
|
6798
6798
|
o = o && s == 0, r = r && s == Mt(n);
|
|
@@ -6833,7 +6833,7 @@ function nw(n, e, t) {
|
|
|
6833
6833
|
}
|
|
6834
6834
|
const Qt = typeof navigator < "u" ? navigator : null, Vd = typeof document < "u" ? document : null, to = Qt && Qt.userAgent || "", Wa = /Edge\/(\d+)/.exec(to), Xp = /MSIE \d/.exec(to), ja = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(to), gt = !!(Xp || ja || Wa), Kn = Xp ? document.documentMode : ja ? +ja[1] : Wa ? +Wa[1] : 0, It = !gt && /gecko\/(\d+)/i.test(to);
|
|
6835
6835
|
It && +(/Firefox\/(\d+)/.exec(to) || [0, 0])[1];
|
|
6836
|
-
const Ua = !gt && /Chrome\/(\d+)/.exec(to),
|
|
6836
|
+
const Ua = !gt && /Chrome\/(\d+)/.exec(to), et = !!Ua, Zp = Ua ? +Ua[1] : 0, lt = !gt && !!Qt && /Apple Computer/.test(Qt.vendor), nr = lt && (/Mobile\/\w+/.test(to) || !!Qt && Qt.maxTouchPoints > 2), Ct = nr || (Qt ? /Mac/.test(Qt.platform) : !1), Qp = Qt ? /Win/.test(Qt.platform) : !1, yn = /Android \d/.test(to), ys = !!Vd && "webkitFontSmoothing" in Vd.documentElement.style, ow = ys ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6837
6837
|
function rw(n) {
|
|
6838
6838
|
let e = n.defaultView && n.defaultView.visualViewport;
|
|
6839
6839
|
return e ? {
|
|
@@ -7021,7 +7021,7 @@ function hw(n, e) {
|
|
|
7021
7021
|
if (!Uc(e, c) || (i = om(n.dom, e, c), !i))
|
|
7022
7022
|
return null;
|
|
7023
7023
|
}
|
|
7024
|
-
if (
|
|
7024
|
+
if (lt)
|
|
7025
7025
|
for (let c = i; o && c; c = tr(c))
|
|
7026
7026
|
c.draggable && (o = void 0);
|
|
7027
7027
|
if (i = uw(i, e), o) {
|
|
@@ -7265,7 +7265,7 @@ class vs {
|
|
|
7265
7265
|
}
|
|
7266
7266
|
let r;
|
|
7267
7267
|
if (e == this.dom && this.contentDOM)
|
|
7268
|
-
r = t >
|
|
7268
|
+
r = t > Ze(this.contentDOM);
|
|
7269
7269
|
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
|
|
7270
7270
|
r = e.compareDocumentPosition(this.contentDOM) & 2;
|
|
7271
7271
|
else if (this.dom.firstChild) {
|
|
@@ -7355,12 +7355,12 @@ class vs {
|
|
|
7355
7355
|
let s, i = !0;
|
|
7356
7356
|
for (; s = o ? this.children[o - 1] : null, !(!s || s.dom.parentNode == this.contentDOM); o--, i = !1)
|
|
7357
7357
|
;
|
|
7358
|
-
return s && t && i && !s.border && !s.domAtom ? s.domFromPos(s.size, t) : { node: this.contentDOM, offset: s ?
|
|
7358
|
+
return s && t && i && !s.border && !s.domAtom ? s.domFromPos(s.size, t) : { node: this.contentDOM, offset: s ? Ze(s.dom) + 1 : 0 };
|
|
7359
7359
|
} else {
|
|
7360
7360
|
let s, i = !0;
|
|
7361
7361
|
for (; s = o < this.children.length ? this.children[o] : null, !(!s || s.dom.parentNode == this.contentDOM); o++, i = !1)
|
|
7362
7362
|
;
|
|
7363
|
-
return s && i && !s.border && !s.domAtom ? s.domFromPos(0, t) : { node: this.contentDOM, offset: s ?
|
|
7363
|
+
return s && i && !s.border && !s.domAtom ? s.domFromPos(0, t) : { node: this.contentDOM, offset: s ? Ze(s.dom) : this.contentDOM.childNodes.length };
|
|
7364
7364
|
}
|
|
7365
7365
|
}
|
|
7366
7366
|
// Used to find a DOM range in a single parent for a given changed
|
|
@@ -7379,7 +7379,7 @@ class vs {
|
|
|
7379
7379
|
for (let d = l; d > 0; d--) {
|
|
7380
7380
|
let h = this.children[d - 1];
|
|
7381
7381
|
if (h.size && h.dom.parentNode == this.contentDOM && !h.emptyChildAt(1)) {
|
|
7382
|
-
r =
|
|
7382
|
+
r = Ze(h.dom) + 1;
|
|
7383
7383
|
break;
|
|
7384
7384
|
}
|
|
7385
7385
|
e -= h.size;
|
|
@@ -7391,7 +7391,7 @@ class vs {
|
|
|
7391
7391
|
for (let u = l + 1; u < this.children.length; u++) {
|
|
7392
7392
|
let d = this.children[u];
|
|
7393
7393
|
if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(-1)) {
|
|
7394
|
-
s =
|
|
7394
|
+
s = Ze(d.dom);
|
|
7395
7395
|
break;
|
|
7396
7396
|
}
|
|
7397
7397
|
t += d.size;
|
|
@@ -7429,14 +7429,14 @@ class vs {
|
|
|
7429
7429
|
p = g;
|
|
7430
7430
|
}
|
|
7431
7431
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = o.root.getSelection(), u = o.domSelectionRange(), d = !1;
|
|
7432
|
-
if ((It ||
|
|
7432
|
+
if ((It || lt) && e == t) {
|
|
7433
7433
|
let { node: f, offset: p } = l;
|
|
7434
7434
|
if (f.nodeType == 3) {
|
|
7435
7435
|
if (d = !!(p && f.nodeValue[p - 1] == `
|
|
7436
7436
|
`), d && p == f.nodeValue.length)
|
|
7437
7437
|
for (let m = f, g; m; m = m.parentNode) {
|
|
7438
7438
|
if (g = m.nextSibling) {
|
|
7439
|
-
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset:
|
|
7439
|
+
g.nodeName == "BR" && (l = a = { node: g.parentNode, offset: Ze(g) + 1 });
|
|
7440
7440
|
break;
|
|
7441
7441
|
}
|
|
7442
7442
|
let y = m.pmViewDesc;
|
|
@@ -7452,7 +7452,7 @@ class vs {
|
|
|
7452
7452
|
let f = u.focusNode.childNodes[u.focusOffset];
|
|
7453
7453
|
f && f.contentEditable == "false" && (r = !0);
|
|
7454
7454
|
}
|
|
7455
|
-
if (!(r || d &&
|
|
7455
|
+
if (!(r || d && lt) && To(l.node, l.offset, u.anchorNode, u.anchorOffset) && To(a.node, a.offset, u.focusNode, u.focusOffset))
|
|
7456
7456
|
return;
|
|
7457
7457
|
let h = !1;
|
|
7458
7458
|
if ((c.extend || e == t) && !(d && It)) {
|
|
@@ -8058,7 +8058,7 @@ class xw {
|
|
|
8058
8058
|
for (; e instanceof Eo; )
|
|
8059
8059
|
t = e, e = t.children[t.children.length - 1];
|
|
8060
8060
|
(!e || // Empty textblock
|
|
8061
|
-
!(e instanceof al) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((
|
|
8061
|
+
!(e instanceof al) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((lt || et) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", t), this.addHackNode("BR", this.top));
|
|
8062
8062
|
}
|
|
8063
8063
|
addHackNode(e, t) {
|
|
8064
8064
|
if (t == this.top && this.index < t.children.length && t.children[this.index].matchesHack(e))
|
|
@@ -8234,7 +8234,7 @@ function dm(n) {
|
|
|
8234
8234
|
function xn(n, e = !1) {
|
|
8235
8235
|
let t = n.state.selection;
|
|
8236
8236
|
if (fm(n, t), !!dm(n)) {
|
|
8237
|
-
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault &&
|
|
8237
|
+
if (!e && n.input.mouseDown && n.input.mouseDown.allowDefault && et) {
|
|
8238
8238
|
let o = n.domSelectionRange(), r = n.domObserver.currentSelection;
|
|
8239
8239
|
if (o.anchorNode && r.anchorNode && To(o.anchorNode, o.anchorOffset, r.anchorNode, r.anchorOffset)) {
|
|
8240
8240
|
n.input.mouseDown.delayedSelectionSync = !0, n.domObserver.setCurSelection();
|
|
@@ -8250,10 +8250,10 @@ function xn(n, e = !1) {
|
|
|
8250
8250
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
8251
8251
|
}
|
|
8252
8252
|
}
|
|
8253
|
-
const Xd =
|
|
8253
|
+
const Xd = lt || et && Zp < 63;
|
|
8254
8254
|
function Zd(n, e) {
|
|
8255
8255
|
let { node: t, offset: o } = n.docView.domFromPos(e, 0), r = o < t.childNodes.length ? t.childNodes[o] : null, s = o ? t.childNodes[o - 1] : null;
|
|
8256
|
-
if (
|
|
8256
|
+
if (lt && r && r.contentEditable == "false")
|
|
8257
8257
|
return Gl(r);
|
|
8258
8258
|
if ((!r || r.contentEditable == "false") && (!s || s.contentEditable == "false")) {
|
|
8259
8259
|
if (r)
|
|
@@ -8263,7 +8263,7 @@ function Zd(n, e) {
|
|
|
8263
8263
|
}
|
|
8264
8264
|
}
|
|
8265
8265
|
function Gl(n) {
|
|
8266
|
-
return n.contentEditable = "true",
|
|
8266
|
+
return n.contentEditable = "true", lt && n.draggable && (n.draggable = !1, n.wasDraggable = !0), n;
|
|
8267
8267
|
}
|
|
8268
8268
|
function Qd(n) {
|
|
8269
8269
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
@@ -8283,7 +8283,7 @@ function Iw(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,
|
|
8286
|
+
o ? e.collapse(t.parentNode, Ze(t) + 1) : e.collapse(t, 0), !o && !n.state.selection.visible && gt && Kn <= 11 && (t.disabled = !0, t.disabled = !1);
|
|
8287
8287
|
}
|
|
8288
8288
|
function fm(n, e) {
|
|
8289
8289
|
if (e instanceof re) {
|
|
@@ -8386,7 +8386,7 @@ function _w(n) {
|
|
|
8386
8386
|
{
|
|
8387
8387
|
let l = t.previousSibling;
|
|
8388
8388
|
for (; l && Lr(l, -1); )
|
|
8389
|
-
r = t.parentNode, s =
|
|
8389
|
+
r = t.parentNode, s = Ze(l), l = l.previousSibling;
|
|
8390
8390
|
if (l)
|
|
8391
8391
|
t = l, o = oi(t);
|
|
8392
8392
|
else {
|
|
@@ -8418,7 +8418,7 @@ function Dw(n) {
|
|
|
8418
8418
|
{
|
|
8419
8419
|
let l = t.nextSibling;
|
|
8420
8420
|
for (; l && Lr(l, 1); )
|
|
8421
|
-
s = l.parentNode, i =
|
|
8421
|
+
s = l.parentNode, i = Ze(l) + 1, l = l.nextSibling;
|
|
8422
8422
|
if (l)
|
|
8423
8423
|
t = l, o = 0, r = oi(t);
|
|
8424
8424
|
else {
|
|
@@ -8436,7 +8436,7 @@ function pm(n) {
|
|
|
8436
8436
|
}
|
|
8437
8437
|
function Nw(n, e) {
|
|
8438
8438
|
for (; n && e == n.childNodes.length && !gs(n); )
|
|
8439
|
-
e =
|
|
8439
|
+
e = Ze(n) + 1, n = n.parentNode;
|
|
8440
8440
|
for (; n && e < n.childNodes.length; ) {
|
|
8441
8441
|
let t = n.childNodes[e];
|
|
8442
8442
|
if (t.nodeType == 3)
|
|
@@ -8448,7 +8448,7 @@ function Nw(n, e) {
|
|
|
8448
8448
|
}
|
|
8449
8449
|
function Rw(n, e) {
|
|
8450
8450
|
for (; n && !e && !gs(n); )
|
|
8451
|
-
e =
|
|
8451
|
+
e = Ze(n), n = n.parentNode;
|
|
8452
8452
|
for (; n && e; ) {
|
|
8453
8453
|
let t = n.childNodes[e - 1];
|
|
8454
8454
|
if (t.nodeType == 3)
|
|
@@ -8478,7 +8478,7 @@ function Ga(n, e, t) {
|
|
|
8478
8478
|
}
|
|
8479
8479
|
function of(n, e) {
|
|
8480
8480
|
let t = n.state.doc.resolve(e);
|
|
8481
|
-
if (!(
|
|
8481
|
+
if (!(et || Qp) && t.parent.inlineContent) {
|
|
8482
8482
|
let r = n.coordsAtPos(e);
|
|
8483
8483
|
if (e > t.start()) {
|
|
8484
8484
|
let s = n.coordsAtPos(e - 1), i = (s.top + s.bottom) / 2;
|
|
@@ -8530,7 +8530,7 @@ function lf(n, e, t) {
|
|
|
8530
8530
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
8531
8531
|
}
|
|
8532
8532
|
function Pw(n) {
|
|
8533
|
-
if (!
|
|
8533
|
+
if (!lt || n.state.selection.$head.parentOffset > 0)
|
|
8534
8534
|
return !1;
|
|
8535
8535
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
8536
8536
|
if (e && e.nodeType == 1 && t == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
|
|
@@ -8733,7 +8733,7 @@ function Hw(n) {
|
|
|
8733
8733
|
return t;
|
|
8734
8734
|
}
|
|
8735
8735
|
function Vw(n) {
|
|
8736
|
-
let e = n.querySelectorAll(
|
|
8736
|
+
let e = n.querySelectorAll(et ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
8737
8737
|
for (let t = 0; t < e.length; t++) {
|
|
8738
8738
|
let o = e[t];
|
|
8739
8739
|
o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), o);
|
|
@@ -8757,20 +8757,20 @@ function Ww(n, e) {
|
|
|
8757
8757
|
}
|
|
8758
8758
|
return new G(r, s, i);
|
|
8759
8759
|
}
|
|
8760
|
-
const
|
|
8760
|
+
const dt = {}, ft = {}, jw = { touchstart: !0, touchmove: !0 };
|
|
8761
8761
|
class Uw {
|
|
8762
8762
|
constructor() {
|
|
8763
8763
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "", button: 0 }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.badSafariComposition = !1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
8764
8764
|
}
|
|
8765
8765
|
}
|
|
8766
8766
|
function Kw(n) {
|
|
8767
|
-
for (let e in
|
|
8768
|
-
let t =
|
|
8767
|
+
for (let e in dt) {
|
|
8768
|
+
let t = dt[e];
|
|
8769
8769
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (o) => {
|
|
8770
|
-
Jw(n, o) && !Gc(n, o) && (n.editable || !(o.type in
|
|
8770
|
+
Jw(n, o) && !Gc(n, o) && (n.editable || !(o.type in ft)) && t(n, o);
|
|
8771
8771
|
}, jw[e] ? { passive: !0 } : void 0);
|
|
8772
8772
|
}
|
|
8773
|
-
|
|
8773
|
+
lt && n.dom.addEventListener("input", () => null), Xa(n);
|
|
8774
8774
|
}
|
|
8775
8775
|
function Hn(n, e) {
|
|
8776
8776
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
@@ -8804,11 +8804,11 @@ function Jw(n, e) {
|
|
|
8804
8804
|
return !0;
|
|
8805
8805
|
}
|
|
8806
8806
|
function Gw(n, e) {
|
|
8807
|
-
!Gc(n, e) &&
|
|
8807
|
+
!Gc(n, e) && dt[e.type] && (n.editable || !(e.type in ft)) && dt[e.type](n, e);
|
|
8808
8808
|
}
|
|
8809
|
-
|
|
8809
|
+
ft.keydown = (n, e) => {
|
|
8810
8810
|
let t = e;
|
|
8811
|
-
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !xm(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(yn &&
|
|
8811
|
+
if (n.input.shiftKey = t.keyCode == 16 || t.shiftKey, !xm(n, t) && (n.input.lastKeyCode = t.keyCode, n.input.lastKeyCodeTime = Date.now(), !(yn && et && t.keyCode == 13)))
|
|
8812
8812
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), nr && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
8813
8813
|
let o = Date.now();
|
|
8814
8814
|
n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
@@ -8816,10 +8816,10 @@ dt.keydown = (n, e) => {
|
|
|
8816
8816
|
}, 200);
|
|
8817
8817
|
} else n.someProp("handleKeyDown", (o) => o(n, t)) || $w(n, t) ? t.preventDefault() : Hn(n, "key");
|
|
8818
8818
|
};
|
|
8819
|
-
|
|
8819
|
+
ft.keyup = (n, e) => {
|
|
8820
8820
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
8821
8821
|
};
|
|
8822
|
-
|
|
8822
|
+
ft.keypress = (n, e) => {
|
|
8823
8823
|
let t = e;
|
|
8824
8824
|
if (xm(n, t) || !t.charCode || t.ctrlKey && !t.altKey || Ct && t.metaKey)
|
|
8825
8825
|
return;
|
|
@@ -8907,7 +8907,7 @@ function Xc(n) {
|
|
|
8907
8907
|
return ri(n);
|
|
8908
8908
|
}
|
|
8909
8909
|
const bm = Ct ? "metaKey" : "ctrlKey";
|
|
8910
|
-
|
|
8910
|
+
dt.mousedown = (n, e) => {
|
|
8911
8911
|
let t = e;
|
|
8912
8912
|
n.input.shiftKey = t.shiftKey;
|
|
8913
8913
|
let o = Xc(n), r = Date.now(), s = "singleClick";
|
|
@@ -8945,14 +8945,14 @@ class ok {
|
|
|
8945
8945
|
return;
|
|
8946
8946
|
let t = this.pos;
|
|
8947
8947
|
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(cl(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Hn(this.view, "pointer") : Qw(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
|
|
8951
8951
|
// situation where clicking at the point where that
|
|
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
|
-
|
|
8955
|
+
et && !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) ? (Yo(this.view, ce.near(this.view.state.doc.resolve(t.pos))), e.preventDefault()) : Hn(this.view, "pointer");
|
|
8956
8956
|
}
|
|
8957
8957
|
move(e) {
|
|
8958
8958
|
this.updateAllowDefault(e), Hn(this.view, "pointer"), e.buttons == 0 && this.done();
|
|
@@ -8961,22 +8961,22 @@ class ok {
|
|
|
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
|
+
dt.touchstart = (n) => {
|
|
8965
8965
|
n.input.lastTouch = Date.now(), Xc(n), Hn(n, "pointer");
|
|
8966
8966
|
};
|
|
8967
|
-
|
|
8967
|
+
dt.touchmove = (n) => {
|
|
8968
8968
|
n.input.lastTouch = Date.now(), Hn(n, "pointer");
|
|
8969
8969
|
};
|
|
8970
|
-
|
|
8970
|
+
dt.contextmenu = (n) => Xc(n);
|
|
8971
8971
|
function xm(n, e) {
|
|
8972
|
-
return n.composing ? !0 :
|
|
8972
|
+
return n.composing ? !0 : lt && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
8973
8973
|
}
|
|
8974
8974
|
const rk = yn ? 5e3 : -1;
|
|
8975
|
-
|
|
8975
|
+
ft.compositionstart = ft.compositionupdate = (n) => {
|
|
8976
8976
|
if (!n.composing) {
|
|
8977
8977
|
n.domObserver.flush();
|
|
8978
8978
|
let { state: e } = n, t = e.selection.$to;
|
|
8979
|
-
if (e.selection instanceof le && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((o) => o.type.spec.inclusive === !1) ||
|
|
8979
|
+
if (e.selection instanceof le && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((o) => o.type.spec.inclusive === !1) || et && Qp && sk(n)))
|
|
8980
8980
|
n.markCursor = n.state.storedMarks || t.marks(), ri(n, !0), n.markCursor = null;
|
|
8981
8981
|
else if (ri(n, !e.selection.empty), It && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
8982
8982
|
let o = n.domSelectionRange();
|
|
@@ -9003,7 +9003,7 @@ function sk(n) {
|
|
|
9003
9003
|
let o = e.childNodes[t];
|
|
9004
9004
|
return o.nodeType == 1 && o.contentEditable == "false";
|
|
9005
9005
|
}
|
|
9006
|
-
|
|
9006
|
+
ft.compositionend = (n, e) => {
|
|
9007
9007
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.badSafariComposition ? n.domObserver.forceFlush() : n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, Sm(n, 20));
|
|
9008
9008
|
};
|
|
9009
9009
|
function Sm(n, e) {
|
|
@@ -9056,7 +9056,7 @@ function ak(n, e) {
|
|
|
9056
9056
|
}, 50);
|
|
9057
9057
|
}
|
|
9058
9058
|
const ns = gt && Kn < 15 || nr && ow < 604;
|
|
9059
|
-
|
|
9059
|
+
dt.copy = ft.cut = (n, e) => {
|
|
9060
9060
|
let t = e, o = n.state.selection, r = t.type == "cut";
|
|
9061
9061
|
if (o.empty)
|
|
9062
9062
|
return;
|
|
@@ -9092,7 +9092,7 @@ function Tm(n) {
|
|
|
9092
9092
|
let t = n.getData("text/uri-list");
|
|
9093
9093
|
return t ? t.replace(/\r?\n/g, " ") : "";
|
|
9094
9094
|
}
|
|
9095
|
-
|
|
9095
|
+
ft.paste = (n, e) => {
|
|
9096
9096
|
let t = e;
|
|
9097
9097
|
if (n.composing && !yn)
|
|
9098
9098
|
return;
|
|
@@ -9109,7 +9109,7 @@ function Mm(n, e) {
|
|
|
9109
9109
|
let t = n.someProp("dragCopies", (o) => !o(e));
|
|
9110
9110
|
return t ?? !e[dk];
|
|
9111
9111
|
}
|
|
9112
|
-
|
|
9112
|
+
dt.dragstart = (n, e) => {
|
|
9113
9113
|
let t = e, o = n.input.mouseDown;
|
|
9114
9114
|
if (o && o.done(), !t.dataTransfer)
|
|
9115
9115
|
return;
|
|
@@ -9123,16 +9123,16 @@ ut.dragstart = (n, e) => {
|
|
|
9123
9123
|
}
|
|
9124
9124
|
}
|
|
9125
9125
|
let l = (i || n.state.selection).content(), { dom: a, text: c, slice: u } = Jc(n, l);
|
|
9126
|
-
(!t.dataTransfer.files.length || !
|
|
9126
|
+
(!t.dataTransfer.files.length || !et || Zp > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(ns ? "Text" : "text/html", a.innerHTML), t.dataTransfer.effectAllowed = "copyMove", ns || t.dataTransfer.setData("text/plain", c), n.dragging = new Em(u, Mm(n, t), i);
|
|
9127
9127
|
};
|
|
9128
|
-
|
|
9128
|
+
dt.dragend = (n) => {
|
|
9129
9129
|
let e = n.dragging;
|
|
9130
9130
|
window.setTimeout(() => {
|
|
9131
9131
|
n.dragging == e && (n.dragging = null);
|
|
9132
9132
|
}, 50);
|
|
9133
9133
|
};
|
|
9134
|
-
|
|
9135
|
-
|
|
9134
|
+
ft.dragover = ft.dragenter = (n, e) => e.preventDefault();
|
|
9135
|
+
ft.drop = (n, e) => {
|
|
9136
9136
|
try {
|
|
9137
9137
|
fk(n, e, n.dragging);
|
|
9138
9138
|
} finally {
|
|
@@ -9176,17 +9176,17 @@ function fk(n, e, t) {
|
|
|
9176
9176
|
}
|
|
9177
9177
|
n.focus(), n.dispatch(a.setMeta("uiEvent", "drop"));
|
|
9178
9178
|
}
|
|
9179
|
-
|
|
9179
|
+
dt.focus = (n) => {
|
|
9180
9180
|
n.input.lastFocus = Date.now(), n.focused || (n.domObserver.stop(), n.dom.classList.add("ProseMirror-focused"), n.domObserver.start(), n.focused = !0, setTimeout(() => {
|
|
9181
9181
|
n.docView && n.hasFocus() && !n.domObserver.currentSelection.eq(n.domSelectionRange()) && xn(n);
|
|
9182
9182
|
}, 20));
|
|
9183
9183
|
};
|
|
9184
|
-
|
|
9184
|
+
dt.blur = (n, e) => {
|
|
9185
9185
|
let t = e;
|
|
9186
9186
|
n.focused && (n.domObserver.stop(), n.dom.classList.remove("ProseMirror-focused"), n.domObserver.start(), t.relatedTarget && n.dom.contains(t.relatedTarget) && n.domObserver.currentSelection.clear(), n.focused = !1);
|
|
9187
9187
|
};
|
|
9188
|
-
|
|
9189
|
-
if (
|
|
9188
|
+
dt.beforeinput = (n, e) => {
|
|
9189
|
+
if (et && yn && e.inputType == "deleteContentBackward") {
|
|
9190
9190
|
n.domObserver.flushSoon();
|
|
9191
9191
|
let { domChangeCount: o } = n.input;
|
|
9192
9192
|
setTimeout(() => {
|
|
@@ -9197,8 +9197,8 @@ ut.beforeinput = (n, e) => {
|
|
|
9197
9197
|
}, 50);
|
|
9198
9198
|
}
|
|
9199
9199
|
};
|
|
9200
|
-
for (let n in
|
|
9201
|
-
|
|
9200
|
+
for (let n in ft)
|
|
9201
|
+
dt[n] = ft[n];
|
|
9202
9202
|
function ss(n, e) {
|
|
9203
9203
|
if (n == e)
|
|
9204
9204
|
return !0;
|
|
@@ -9216,7 +9216,7 @@ class si {
|
|
|
9216
9216
|
}
|
|
9217
9217
|
map(e, t, o, r) {
|
|
9218
9218
|
let { pos: s, deleted: i } = e.mapResult(t.from + r, this.side < 0 ? -1 : 1);
|
|
9219
|
-
return i ? null : new
|
|
9219
|
+
return i ? null : new ut(s - o, s - o, this);
|
|
9220
9220
|
}
|
|
9221
9221
|
valid() {
|
|
9222
9222
|
return !0;
|
|
@@ -9234,7 +9234,7 @@ class Jn {
|
|
|
9234
9234
|
}
|
|
9235
9235
|
map(e, t, o, r) {
|
|
9236
9236
|
let s = e.map(t.from + r, this.spec.inclusiveStart ? -1 : 1) - o, i = e.map(t.to + r, this.spec.inclusiveEnd ? 1 : -1) - o;
|
|
9237
|
-
return s >= i ? null : new
|
|
9237
|
+
return s >= i ? null : new ut(s, i, this);
|
|
9238
9238
|
}
|
|
9239
9239
|
valid(e, t) {
|
|
9240
9240
|
return t.from < t.to;
|
|
@@ -9257,7 +9257,7 @@ class Zc {
|
|
|
9257
9257
|
if (s.deleted)
|
|
9258
9258
|
return null;
|
|
9259
9259
|
let i = e.mapResult(t.to + r, -1);
|
|
9260
|
-
return i.deleted || i.pos <= s.pos ? null : new
|
|
9260
|
+
return i.deleted || i.pos <= s.pos ? null : new ut(s.pos - o, i.pos - o, this);
|
|
9261
9261
|
}
|
|
9262
9262
|
valid(e, t) {
|
|
9263
9263
|
let { index: o, offset: r } = e.content.findIndex(t.from), s;
|
|
@@ -9269,7 +9269,7 @@ class Zc {
|
|
|
9269
9269
|
destroy() {
|
|
9270
9270
|
}
|
|
9271
9271
|
}
|
|
9272
|
-
class
|
|
9272
|
+
class ut {
|
|
9273
9273
|
/**
|
|
9274
9274
|
@internal
|
|
9275
9275
|
*/
|
|
@@ -9280,7 +9280,7 @@ class ct {
|
|
|
9280
9280
|
@internal
|
|
9281
9281
|
*/
|
|
9282
9282
|
copy(e, t) {
|
|
9283
|
-
return new
|
|
9283
|
+
return new ut(e, t, this.type);
|
|
9284
9284
|
}
|
|
9285
9285
|
/**
|
|
9286
9286
|
@internal
|
|
@@ -9303,14 +9303,14 @@ class ct {
|
|
|
9303
9303
|
widget's current document position.
|
|
9304
9304
|
*/
|
|
9305
9305
|
static widget(e, t, o) {
|
|
9306
|
-
return new
|
|
9306
|
+
return new ut(e, e, new si(t, o));
|
|
9307
9307
|
}
|
|
9308
9308
|
/**
|
|
9309
9309
|
Creates an inline decoration, which adds the given attributes to
|
|
9310
9310
|
each inline node between `from` and `to`.
|
|
9311
9311
|
*/
|
|
9312
9312
|
static inline(e, t, o, r) {
|
|
9313
|
-
return new
|
|
9313
|
+
return new ut(e, t, new Jn(o, r));
|
|
9314
9314
|
}
|
|
9315
9315
|
/**
|
|
9316
9316
|
Creates a node decoration. `from` and `to` should point precisely
|
|
@@ -9318,7 +9318,7 @@ class ct {
|
|
|
9318
9318
|
node, will receive the given attributes.
|
|
9319
9319
|
*/
|
|
9320
9320
|
static node(e, t, o, r) {
|
|
9321
|
-
return new
|
|
9321
|
+
return new ut(e, t, new Zc(o, r));
|
|
9322
9322
|
}
|
|
9323
9323
|
/**
|
|
9324
9324
|
The spec provided when creating this decoration. Can be useful
|
|
@@ -9354,7 +9354,7 @@ class Ce {
|
|
|
9354
9354
|
you must make a copy if you want need to preserve that.
|
|
9355
9355
|
*/
|
|
9356
9356
|
static create(e, t) {
|
|
9357
|
-
return t.length ? ii(t, e, 0, yo) :
|
|
9357
|
+
return t.length ? ii(t, e, 0, yo) : ot;
|
|
9358
9358
|
}
|
|
9359
9359
|
/**
|
|
9360
9360
|
Find all decorations in this set which touch the given range
|
|
@@ -9384,7 +9384,7 @@ class Ce {
|
|
|
9384
9384
|
document.
|
|
9385
9385
|
*/
|
|
9386
9386
|
map(e, t, o) {
|
|
9387
|
-
return this ==
|
|
9387
|
+
return this == ot || e.maps.length == 0 ? this : this.mapInner(e, t, 0, 0, o || yo);
|
|
9388
9388
|
}
|
|
9389
9389
|
/**
|
|
9390
9390
|
@internal
|
|
@@ -9395,7 +9395,7 @@ class Ce {
|
|
|
9395
9395
|
let a = this.local[l].map(e, o, r);
|
|
9396
9396
|
a && a.type.valid(t, a) ? (i || (i = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
9397
9397
|
}
|
|
9398
|
-
return this.children.length ? hk(this.children, i || [], e, t, o, r, s) : i ? new Ce(i.sort(vo), Wo) :
|
|
9398
|
+
return this.children.length ? hk(this.children, i || [], e, t, o, r, s) : i ? new Ce(i.sort(vo), Wo) : ot;
|
|
9399
9399
|
}
|
|
9400
9400
|
/**
|
|
9401
9401
|
Add the given array of decorations to the ones in the set,
|
|
@@ -9404,7 +9404,7 @@ class Ce {
|
|
|
9404
9404
|
structure.
|
|
9405
9405
|
*/
|
|
9406
9406
|
add(e, t) {
|
|
9407
|
-
return t.length ? this ==
|
|
9407
|
+
return t.length ? this == ot ? Ce.create(e, t) : this.addInner(e, t, 0) : this;
|
|
9408
9408
|
}
|
|
9409
9409
|
addInner(e, t, o) {
|
|
9410
9410
|
let r, s = 0;
|
|
@@ -9426,7 +9426,7 @@ class Ce {
|
|
|
9426
9426
|
the ones in the given array.
|
|
9427
9427
|
*/
|
|
9428
9428
|
remove(e) {
|
|
9429
|
-
return e.length == 0 || this ==
|
|
9429
|
+
return e.length == 0 || this == ot ? this : this.removeInner(e, 0);
|
|
9430
9430
|
}
|
|
9431
9431
|
removeInner(e, t) {
|
|
9432
9432
|
let o = this.children, r = this.local;
|
|
@@ -9438,7 +9438,7 @@ class Ce {
|
|
|
9438
9438
|
continue;
|
|
9439
9439
|
o == this.children && (o = this.children.slice());
|
|
9440
9440
|
let c = o[s + 2].removeInner(i, l + 1);
|
|
9441
|
-
c !=
|
|
9441
|
+
c != ot ? o[s + 2] = c : (o.splice(s, 3), s -= 3);
|
|
9442
9442
|
}
|
|
9443
9443
|
if (r.length) {
|
|
9444
9444
|
for (let s = 0, i; s < e.length; s++)
|
|
@@ -9446,10 +9446,10 @@ class Ce {
|
|
|
9446
9446
|
for (let l = 0; l < r.length; l++)
|
|
9447
9447
|
r[l].eq(i, t) && (r == this.local && (r = this.local.slice()), r.splice(l--, 1));
|
|
9448
9448
|
}
|
|
9449
|
-
return o == this.children && r == this.local ? this : r.length || o.length ? new Ce(r, o) :
|
|
9449
|
+
return o == this.children && r == this.local ? this : r.length || o.length ? new Ce(r, o) : ot;
|
|
9450
9450
|
}
|
|
9451
9451
|
forChild(e, t) {
|
|
9452
|
-
if (this ==
|
|
9452
|
+
if (this == ot)
|
|
9453
9453
|
return this;
|
|
9454
9454
|
if (t.isLeaf)
|
|
9455
9455
|
return Ce.empty;
|
|
@@ -9471,7 +9471,7 @@ class Ce {
|
|
|
9471
9471
|
let l = new Ce(r.sort(vo), Wo);
|
|
9472
9472
|
return o ? new Nn([l, o]) : l;
|
|
9473
9473
|
}
|
|
9474
|
-
return o ||
|
|
9474
|
+
return o || ot;
|
|
9475
9475
|
}
|
|
9476
9476
|
/**
|
|
9477
9477
|
@internal
|
|
@@ -9499,7 +9499,7 @@ class Ce {
|
|
|
9499
9499
|
@internal
|
|
9500
9500
|
*/
|
|
9501
9501
|
localsInner(e) {
|
|
9502
|
-
if (this ==
|
|
9502
|
+
if (this == ot)
|
|
9503
9503
|
return Wo;
|
|
9504
9504
|
if (e.inlineContent || !this.local.some(Jn.is))
|
|
9505
9505
|
return this.local;
|
|
@@ -9514,7 +9514,7 @@ class Ce {
|
|
|
9514
9514
|
}
|
|
9515
9515
|
Ce.empty = new Ce([], []);
|
|
9516
9516
|
Ce.removeOverlap = Qc;
|
|
9517
|
-
const
|
|
9517
|
+
const ot = Ce.empty;
|
|
9518
9518
|
class Nn {
|
|
9519
9519
|
constructor(e) {
|
|
9520
9520
|
this.members = e;
|
|
@@ -9529,7 +9529,7 @@ 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 !=
|
|
9532
|
+
s != ot && (s instanceof Nn ? o = o.concat(s.members) : o.push(s));
|
|
9533
9533
|
}
|
|
9534
9534
|
return Nn.from(o);
|
|
9535
9535
|
}
|
|
@@ -9561,7 +9561,7 @@ class Nn {
|
|
|
9561
9561
|
static from(e) {
|
|
9562
9562
|
switch (e.length) {
|
|
9563
9563
|
case 0:
|
|
9564
|
-
return
|
|
9564
|
+
return ot;
|
|
9565
9565
|
case 1:
|
|
9566
9566
|
return e[0];
|
|
9567
9567
|
default:
|
|
@@ -9604,7 +9604,7 @@ function hk(n, e, t, o, r, s, i) {
|
|
|
9604
9604
|
let h = t.map(n[c + 1] + s, -1), f = h - r, { index: p, offset: m } = o.content.findIndex(d), g = o.maybeChild(p);
|
|
9605
9605
|
if (g && m == d && m + g.nodeSize == f) {
|
|
9606
9606
|
let y = l[c + 2].mapInner(t, g, u + 1, n[c] + s + 1, i);
|
|
9607
|
-
y !=
|
|
9607
|
+
y != ot ? (l[c] = d, l[c + 1] = f, l[c + 2] = y) : (l[c + 1] = -2, a = !0);
|
|
9608
9608
|
} else
|
|
9609
9609
|
a = !0;
|
|
9610
9610
|
}
|
|
@@ -9628,7 +9628,7 @@ function Am(n, e) {
|
|
|
9628
9628
|
let t = [];
|
|
9629
9629
|
for (let o = 0; o < n.length; o++) {
|
|
9630
9630
|
let r = n[o];
|
|
9631
|
-
t.push(new
|
|
9631
|
+
t.push(new ut(r.from + e, r.to + e, r.type));
|
|
9632
9632
|
}
|
|
9633
9633
|
return t;
|
|
9634
9634
|
}
|
|
@@ -9666,13 +9666,13 @@ function ii(n, e, t, o) {
|
|
|
9666
9666
|
if (c) {
|
|
9667
9667
|
s = !0;
|
|
9668
9668
|
let u = ii(c, l, t + a + 1, o);
|
|
9669
|
-
u !=
|
|
9669
|
+
u != ot && r.push(a, a + l.nodeSize, u);
|
|
9670
9670
|
}
|
|
9671
9671
|
});
|
|
9672
9672
|
let i = Am(s ? Om(n) : n, -t).sort(vo);
|
|
9673
9673
|
for (let l = 0; l < i.length; l++)
|
|
9674
9674
|
i[l].type.valid(e, i[l]) || (o.onRemove && o.onRemove(i[l].spec), i.splice(l--, 1));
|
|
9675
|
-
return i.length || r.length ? new Ce(i, r) :
|
|
9675
|
+
return i.length || r.length ? new Ce(i, r) : ot;
|
|
9676
9676
|
}
|
|
9677
9677
|
function vo(n, e) {
|
|
9678
9678
|
return n.from - e.from || n.to - e.to;
|
|
@@ -9704,7 +9704,7 @@ function Xl(n) {
|
|
|
9704
9704
|
let e = [];
|
|
9705
9705
|
return n.someProp("decorations", (t) => {
|
|
9706
9706
|
let o = t(n.state);
|
|
9707
|
-
o && o !=
|
|
9707
|
+
o && o != ot && e.push(o);
|
|
9708
9708
|
}), n.cursorWrapper && e.push(Ce.create(n.state.doc, [n.cursorWrapper.deco])), Nn.from(e);
|
|
9709
9709
|
}
|
|
9710
9710
|
const mk = {
|
|
@@ -9734,7 +9734,7 @@ class vk {
|
|
|
9734
9734
|
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new yk(), 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 && Kn <= 11 && o.some((r) => r.type == "childList" && r.removedNodes.length || r.type == "characterData" && r.oldValue.length > r.target.nodeValue.length) ? this.flushSoon() :
|
|
9737
|
+
gt && Kn <= 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
|
}), gk && (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);
|
|
@@ -9864,7 +9864,7 @@ class vk {
|
|
|
9864
9864
|
let { previousSibling: d, nextSibling: h } = e.addedNodes[u];
|
|
9865
9865
|
(!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (r = d), (!h || Array.prototype.indexOf.call(e.addedNodes, h) < 0) && (s = h);
|
|
9866
9866
|
}
|
|
9867
|
-
let i = r && r.parentNode == e.target ?
|
|
9867
|
+
let i = r && r.parentNode == e.target ? Ze(r) + 1 : 0, l = o.localPosFromDOM(e.target, i, -1), a = s && s.parentNode == e.target ? Ze(s) : e.target.childNodes.length, c = o.localPosFromDOM(e.target, a, 1);
|
|
9868
9868
|
return { from: l, to: c };
|
|
9869
9869
|
} else return e.type == "attributes" ? { from: o.posAtStart - o.border, to: o.posAtEnd + o.border } : (this.lastChangedTextNode = e.target, {
|
|
9870
9870
|
from: o.posAtStart,
|
|
@@ -9932,7 +9932,7 @@ function xk(n, e) {
|
|
|
9932
9932
|
}
|
|
9933
9933
|
function Sk(n, e, t) {
|
|
9934
9934
|
let { node: o, fromOffset: r, toOffset: s, from: i, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
|
|
9935
|
-
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], ll(a) || c.push({ node: a.focusNode, offset: a.focusOffset })),
|
|
9935
|
+
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], ll(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), et && n.input.lastKeyCode === 8)
|
|
9936
9936
|
for (let g = s; g > r; g--) {
|
|
9937
9937
|
let y = o.childNodes[g - 1], v = y.pmViewDesc;
|
|
9938
9938
|
if (y.nodeName == "BR" && !v) {
|
|
@@ -9964,10 +9964,10 @@ function Ck(n) {
|
|
|
9964
9964
|
if (e)
|
|
9965
9965
|
return e.parseRule();
|
|
9966
9966
|
if (n.nodeName == "BR" && n.parentNode) {
|
|
9967
|
-
if (
|
|
9967
|
+
if (lt && /^(ul|ol)$/i.test(n.parentNode.nodeName)) {
|
|
9968
9968
|
let t = document.createElement("div");
|
|
9969
9969
|
return t.appendChild(document.createElement("li")), { skip: t };
|
|
9970
|
-
} else if (n.parentNode.lastChild == n ||
|
|
9970
|
+
} else if (n.parentNode.lastChild == n || lt && /^(tr|table)$/i.test(n.parentNode.nodeName))
|
|
9971
9971
|
return { ignore: !0 };
|
|
9972
9972
|
} else if (n.nodeName == "IMG" && n.getAttribute("mark-placeholder"))
|
|
9973
9973
|
return { ignore: !0 };
|
|
@@ -9979,7 +9979,7 @@ function Ek(n, e, t, o, r) {
|
|
|
9979
9979
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9980
9980
|
let S = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, E = Kc(n, S);
|
|
9981
9981
|
if (E && !n.state.selection.eq(E)) {
|
|
9982
|
-
if (
|
|
9982
|
+
if (et && yn && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (O) => O(n, io(13, "Enter"))))
|
|
9983
9983
|
return;
|
|
9984
9984
|
let _ = n.state.tr.setSelection(E);
|
|
9985
9985
|
S == "pointer" ? _.setMeta("pointer", !0) : S == "key" && _.scrollIntoView(), s && _.setMeta("composition", s), n.dispatch(_);
|
|
@@ -10015,10 +10015,10 @@ function Ek(n, e, t, o, r) {
|
|
|
10015
10015
|
return;
|
|
10016
10016
|
}
|
|
10017
10017
|
if (n.state.selection.anchor > p.start && Ak(u, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (S) => S(n, io(8, "Backspace")))) {
|
|
10018
|
-
yn &&
|
|
10018
|
+
yn && et && n.domObserver.suppressSelectionUpdates();
|
|
10019
10019
|
return;
|
|
10020
10020
|
}
|
|
10021
|
-
|
|
10021
|
+
et && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), yn && !v && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, g = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
10022
10022
|
n.someProp("handleKeyDown", function(S) {
|
|
10023
10023
|
return S(n, io(13, "Enter"));
|
|
10024
10024
|
});
|
|
@@ -10027,7 +10027,7 @@ function Ek(n, e, t, o, r) {
|
|
|
10027
10027
|
let E = S || n.state.tr.replace(k, w, c.doc.slice(p.start - c.from, p.endB - c.from));
|
|
10028
10028
|
if (c.sel) {
|
|
10029
10029
|
let _ = pf(n, E.doc, c.sel);
|
|
10030
|
-
_ && !(
|
|
10030
|
+
_ && !(et && n.composing && _.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (_.head == k || _.head == E.mapping.map(w) - 1) || gt && _.empty && _.head == k) && E.setSelection(_);
|
|
10031
10031
|
}
|
|
10032
10032
|
return s && E.setMeta("composition", s), E.scrollIntoView();
|
|
10033
10033
|
}, T;
|
|
@@ -10200,9 +10200,9 @@ class _m {
|
|
|
10200
10200
|
let h = u == "preserve" && i && this.dom.style.overflowAnchor == null && iw(this);
|
|
10201
10201
|
if (i) {
|
|
10202
10202
|
this.domObserver.stop();
|
|
10203
|
-
let f = d && (gt ||
|
|
10203
|
+
let f = d && (gt || et) && !this.composing && !r.selection.empty && !e.selection.empty && Ok(r.selection, e.selection);
|
|
10204
10204
|
if (d) {
|
|
10205
|
-
let p =
|
|
10205
|
+
let p = et ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
10206
10206
|
this.composing && (this.input.compositionNode = ik(this)), (s || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Gd(e.doc, c, a, this.dom, this)), p && (!this.trackWrites || !this.dom.contains(this.trackWrites)) && (f = !0);
|
|
10207
10207
|
}
|
|
10208
10208
|
f || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Ow(this)) ? xn(this, f) : (fm(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
@@ -10446,7 +10446,7 @@ class _m {
|
|
|
10446
10446
|
*/
|
|
10447
10447
|
domSelectionRange() {
|
|
10448
10448
|
let e = this.domSelection();
|
|
10449
|
-
return e ?
|
|
10449
|
+
return e ? lt && this.root.nodeType === 11 && tw(this.dom.ownerDocument) == this.dom && kk(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
|
|
10450
10450
|
}
|
|
10451
10451
|
/**
|
|
10452
10452
|
@internal
|
|
@@ -10465,12 +10465,12 @@ function gf(n) {
|
|
|
10465
10465
|
if (typeof t == "function" && (t = t(n.state)), t)
|
|
10466
10466
|
for (let o in t)
|
|
10467
10467
|
o == "class" ? e.class += " " + t[o] : o == "style" ? e.style = (e.style ? e.style + ";" : "") + t[o] : !e[o] && o != "contenteditable" && o != "nodeName" && (e[o] = String(t[o]));
|
|
10468
|
-
}), e.translate || (e.translate = "no"), [
|
|
10468
|
+
}), e.translate || (e.translate = "no"), [ut.node(0, n.state.doc.content.size, e)];
|
|
10469
10469
|
}
|
|
10470
10470
|
function yf(n) {
|
|
10471
10471
|
if (n.markCursor) {
|
|
10472
10472
|
let e = document.createElement("img");
|
|
10473
|
-
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco:
|
|
10473
|
+
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), n.cursorWrapper = { dom: e, deco: ut.widget(n.state.selection.from, e, { raw: !0, marks: n.markCursor }) };
|
|
10474
10474
|
} else
|
|
10475
10475
|
n.cursorWrapper = null;
|
|
10476
10476
|
}
|
|
@@ -10583,10 +10583,10 @@ var Yn = {
|
|
|
10583
10583
|
221: "}",
|
|
10584
10584
|
222: '"'
|
|
10585
10585
|
}, Dk = typeof navigator < "u" && /Mac/.test(navigator.platform), Nk = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
10586
|
-
for (var
|
|
10587
|
-
for (var
|
|
10588
|
-
for (var
|
|
10589
|
-
Yn[
|
|
10586
|
+
for (var Qe = 0; Qe < 10; Qe++) Yn[48 + Qe] = Yn[96 + Qe] = String(Qe);
|
|
10587
|
+
for (var Qe = 1; Qe <= 24; Qe++) Yn[Qe + 111] = "F" + Qe;
|
|
10588
|
+
for (var Qe = 65; Qe <= 90; Qe++)
|
|
10589
|
+
Yn[Qe] = String.fromCharCode(Qe + 32), li[Qe] = String.fromCharCode(Qe);
|
|
10590
10590
|
for (var Ql in Yn) li.hasOwnProperty(Ql) || (li[Ql] = Yn[Ql]);
|
|
10591
10591
|
function Rk(n) {
|
|
10592
10592
|
var e = Dk && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || Nk && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? li : Yn)[n.keyCode] || n.key || "Unidentified";
|
|
@@ -16078,7 +16078,7 @@ function Hx(n) {
|
|
|
16078
16078
|
if (!(n.selection instanceof Oe))
|
|
16079
16079
|
return null;
|
|
16080
16080
|
let e = document.createElement("div");
|
|
16081
|
-
return e.className = "ProseMirror-gapcursor", Ce.create(n.doc, [
|
|
16081
|
+
return e.className = "ProseMirror-gapcursor", Ce.create(n.doc, [ut.widget(n.selection.head, e, { key: "gapcursor" })]);
|
|
16082
16082
|
}
|
|
16083
16083
|
var zi = 200, Ve = function() {
|
|
16084
16084
|
};
|
|
@@ -16531,7 +16531,7 @@ Se.create({
|
|
|
16531
16531
|
if (l += 1, this.options.mode === "deepest" && i - l > 0 || this.options.mode === "shallowest" && l > 1)
|
|
16532
16532
|
return this.options.mode === "deepest";
|
|
16533
16533
|
s.push(
|
|
16534
|
-
|
|
16534
|
+
ut.node(c, c + a.nodeSize, {
|
|
16535
16535
|
class: this.options.className
|
|
16536
16536
|
})
|
|
16537
16537
|
);
|
|
@@ -16592,7 +16592,7 @@ Se.create({
|
|
|
16592
16592
|
if ((c || !this.options.showOnlyCurrent) && u) {
|
|
16593
16593
|
const d = [this.options.emptyNodeClass];
|
|
16594
16594
|
i && d.push(this.options.emptyEditorClass);
|
|
16595
|
-
const h =
|
|
16595
|
+
const h = ut.node(a, a + l.nodeSize, {
|
|
16596
16596
|
class: d.join(" "),
|
|
16597
16597
|
[n]: typeof this.options.placeholder == "function" ? this.options.placeholder({
|
|
16598
16598
|
editor: this.editor,
|
|
@@ -16626,7 +16626,7 @@ Se.create({
|
|
|
16626
16626
|
props: {
|
|
16627
16627
|
decorations(t) {
|
|
16628
16628
|
return t.selection.empty || n.isFocused || !n.isEditable || Wb(t.selection) || n.view.dragging ? null : Ce.create(t.doc, [
|
|
16629
|
-
|
|
16629
|
+
ut.inline(t.selection.from, t.selection.to, {
|
|
16630
16630
|
class: e.className
|
|
16631
16631
|
})
|
|
16632
16632
|
]);
|
|
@@ -16857,93 +16857,93 @@ function Kf(n) {
|
|
|
16857
16857
|
const h = (p) => Math.round(p * 255).toString(16).padStart(2, "0"), f = Math.round(n.a).toString(16).padStart(2, "0");
|
|
16858
16858
|
return n.a < 255 ? `#${h(r)}${h(s)}${h(i)}${f}` : `#${h(r)}${h(s)}${h(i)}`;
|
|
16859
16859
|
}
|
|
16860
|
-
const
|
|
16860
|
+
const Je = Te(null), da = Te(null), fa = Te(null), Ut = B(0);
|
|
16861
16861
|
function hr() {
|
|
16862
16862
|
const n = {
|
|
16863
|
-
hasEditor: I(() =>
|
|
16863
|
+
hasEditor: I(() => Je.value !== null),
|
|
16864
16864
|
isBold: I(() => {
|
|
16865
16865
|
var s;
|
|
16866
|
-
return Ut.value, ((s =
|
|
16866
|
+
return Ut.value, ((s = Je.value) == null ? void 0 : s.isActive("bold")) ?? !1;
|
|
16867
16867
|
}),
|
|
16868
16868
|
isItalic: I(() => {
|
|
16869
16869
|
var s;
|
|
16870
|
-
return Ut.value, ((s =
|
|
16870
|
+
return Ut.value, ((s = Je.value) == null ? void 0 : s.isActive("italic")) ?? !1;
|
|
16871
16871
|
}),
|
|
16872
16872
|
isUnderline: I(() => {
|
|
16873
16873
|
var s;
|
|
16874
|
-
return Ut.value, ((s =
|
|
16874
|
+
return Ut.value, ((s = Je.value) == null ? void 0 : s.isActive("underline")) ?? !1;
|
|
16875
16875
|
}),
|
|
16876
16876
|
alignment: I(() => {
|
|
16877
16877
|
Ut.value;
|
|
16878
|
-
const s =
|
|
16878
|
+
const s = Je.value;
|
|
16879
16879
|
return s ? s.isActive({ textAlign: "center" }) ? "center" : s.isActive({ textAlign: "right" }) ? "right" : s.isActive({ textAlign: "justify" }) ? "justify" : "left" : "left";
|
|
16880
16880
|
}),
|
|
16881
16881
|
color: I(() => {
|
|
16882
16882
|
Ut.value;
|
|
16883
|
-
const s =
|
|
16883
|
+
const s = Je.value;
|
|
16884
16884
|
if (!s) return null;
|
|
16885
16885
|
const l = s.getAttributes("textStyle").color ?? null;
|
|
16886
16886
|
return l ? Bg(l) : null;
|
|
16887
16887
|
}),
|
|
16888
16888
|
linkHref: I(() => {
|
|
16889
16889
|
Ut.value;
|
|
16890
|
-
const s =
|
|
16890
|
+
const s = Je.value;
|
|
16891
16891
|
return s ? s.getAttributes("link").href ?? null : null;
|
|
16892
16892
|
})
|
|
16893
16893
|
}, e = {
|
|
16894
16894
|
toggleBold() {
|
|
16895
|
-
const s =
|
|
16895
|
+
const s = Je.value;
|
|
16896
16896
|
if (!s) return;
|
|
16897
16897
|
const { from: i, to: l } = s.state.selection, a = i === l;
|
|
16898
16898
|
let c = s.chain().focus();
|
|
16899
16899
|
a && (c = c.selectAll()), c = c.toggleBold(), a && (c = c.setTextSelection(l)), c.run();
|
|
16900
16900
|
},
|
|
16901
16901
|
toggleItalic() {
|
|
16902
|
-
const s =
|
|
16902
|
+
const s = Je.value;
|
|
16903
16903
|
if (!s) return;
|
|
16904
16904
|
const { from: i, to: l } = s.state.selection, a = i === l;
|
|
16905
16905
|
let c = s.chain().focus();
|
|
16906
16906
|
a && (c = c.selectAll()), c = c.toggleItalic(), a && (c = c.setTextSelection(l)), c.run();
|
|
16907
16907
|
},
|
|
16908
16908
|
toggleUnderline() {
|
|
16909
|
-
const s =
|
|
16909
|
+
const s = Je.value;
|
|
16910
16910
|
if (!s) return;
|
|
16911
16911
|
const { from: i, to: l } = s.state.selection, a = i === l;
|
|
16912
16912
|
let c = s.chain().focus();
|
|
16913
16913
|
a && (c = c.selectAll()), c = c.toggleUnderline(), a && (c = c.setTextSelection(l)), c.run();
|
|
16914
16914
|
},
|
|
16915
16915
|
setAlignment(s) {
|
|
16916
|
-
const i =
|
|
16916
|
+
const i = Je.value;
|
|
16917
16917
|
i && i.chain().selectAll().setTextAlign(s).run();
|
|
16918
16918
|
},
|
|
16919
16919
|
setColor(s) {
|
|
16920
|
-
const i =
|
|
16920
|
+
const i = Je.value;
|
|
16921
16921
|
if (!i) return;
|
|
16922
16922
|
const { from: l, to: a } = i.state.selection;
|
|
16923
16923
|
l === a ? i.chain().focus().selectAll().setColor(s).setTextSelection(a).run() : i.chain().focus().setColor(s).run();
|
|
16924
16924
|
},
|
|
16925
16925
|
setLink(s) {
|
|
16926
|
-
const i =
|
|
16926
|
+
const i = Je.value;
|
|
16927
16927
|
if (!i) return;
|
|
16928
16928
|
const { from: l, to: a } = i.state.selection;
|
|
16929
16929
|
l === a ? i.chain().focus().selectAll().setLink({ href: s }).setTextSelection(a).run() : i.chain().focus().setLink({ href: s }).run();
|
|
16930
16930
|
},
|
|
16931
16931
|
removeLink() {
|
|
16932
|
-
const s =
|
|
16932
|
+
const s = Je.value;
|
|
16933
16933
|
if (!s) return;
|
|
16934
16934
|
const { from: i, to: l } = s.state.selection;
|
|
16935
16935
|
i === l ? s.chain().focus().selectAll().unsetLink().setTextSelection(l).run() : s.chain().focus().unsetLink().run();
|
|
16936
16936
|
}
|
|
16937
16937
|
};
|
|
16938
16938
|
function t(s, i, l) {
|
|
16939
|
-
|
|
16939
|
+
Je.value = s, fa.value = i, da.value = l, s.on("selectionUpdate", () => {
|
|
16940
16940
|
Ut.value++;
|
|
16941
16941
|
}), s.on("transaction", () => {
|
|
16942
16942
|
Ut.value++;
|
|
16943
16943
|
});
|
|
16944
16944
|
}
|
|
16945
16945
|
function o() {
|
|
16946
|
-
|
|
16946
|
+
Je.value = null, fa.value = null, da.value = null;
|
|
16947
16947
|
}
|
|
16948
16948
|
function r() {
|
|
16949
16949
|
requestAnimationFrame(() => {
|
|
@@ -16953,7 +16953,7 @@ function hr() {
|
|
|
16953
16953
|
});
|
|
16954
16954
|
}
|
|
16955
16955
|
return {
|
|
16956
|
-
editor:
|
|
16956
|
+
editor: Je,
|
|
16957
16957
|
blockElement: da,
|
|
16958
16958
|
textElement: fa,
|
|
16959
16959
|
state: n,
|
|
@@ -16964,7 +16964,7 @@ function hr() {
|
|
|
16964
16964
|
repositionMenu: r
|
|
16965
16965
|
};
|
|
16966
16966
|
}
|
|
16967
|
-
const zg = 1, Fg = "Synced", qf = "application/x-woven-canvas", Hg =
|
|
16967
|
+
const zg = 1, Fg = "Synced", qf = "application/x-woven-canvas", Hg = ct((n) => n.with(ie, Qi));
|
|
16968
16968
|
function eS(n) {
|
|
16969
16969
|
let e = [...Hg.current(n)];
|
|
16970
16970
|
if (e.length === 0) return null;
|
|
@@ -17112,7 +17112,7 @@ function Jf(n, e, t, o) {
|
|
|
17112
17112
|
h.length > 0 && Y0.spawn(n, { assignments: h });
|
|
17113
17113
|
}
|
|
17114
17114
|
function sS(n, e, t, o) {
|
|
17115
|
-
const r =
|
|
17115
|
+
const r = st.default(), s = document.createElement("div");
|
|
17116
17116
|
if (s.style.position = "absolute", s.style.visibility = "hidden", s.style.fontFamily = r.fontFamily, s.style.fontSize = `${r.fontSizePx}px`, s.style.lineHeight = `${r.lineHeight}`, s.style.letterSpacing = `${r.letterSpacingEm}em`, s.style.width = "fit-content", s.style.wordBreak = "break-word", s.style.minWidth = "2px", e) {
|
|
17117
17117
|
const a = o / t, c = Math.min(Fi, a / 2);
|
|
17118
17118
|
s.style.maxWidth = `${c}px`, s.style.whiteSpace = "pre-wrap";
|
|
@@ -17131,7 +17131,7 @@ function iS(n, e = {}) {
|
|
|
17131
17131
|
const p = document.activeElement;
|
|
17132
17132
|
return p instanceof HTMLInputElement || p instanceof HTMLTextAreaElement || !!(p != null && p.isContentEditable);
|
|
17133
17133
|
}
|
|
17134
|
-
|
|
17134
|
+
me(
|
|
17135
17135
|
() => l.editor.value,
|
|
17136
17136
|
(p) => {
|
|
17137
17137
|
if (!p || !a) return;
|
|
@@ -17175,8 +17175,8 @@ function iS(n, e = {}) {
|
|
|
17175
17175
|
if (ee) {
|
|
17176
17176
|
const J = Ma.read(U);
|
|
17177
17177
|
if (J.position[0] !== 0 || J.position[1] !== 0) {
|
|
17178
|
-
const Y = Re.read(U),
|
|
17179
|
-
Jf(U, ee.entities, ee.center,
|
|
17178
|
+
const Y = Re.read(U), oe = [Y.left + J.position[0] / Y.zoom, Y.top + J.position[1] / Y.zoom];
|
|
17179
|
+
Jf(U, ee.entities, ee.center, oe);
|
|
17180
17180
|
} else
|
|
17181
17181
|
Jf(U, ee.entities, ee.center);
|
|
17182
17182
|
}
|
|
@@ -17242,8 +17242,8 @@ function no(n, e) {
|
|
|
17242
17242
|
c.delete(l), o.value = c;
|
|
17243
17243
|
}
|
|
17244
17244
|
}
|
|
17245
|
-
return
|
|
17246
|
-
() =>
|
|
17245
|
+
return me(
|
|
17246
|
+
() => rt(n),
|
|
17247
17247
|
(l, a) => {
|
|
17248
17248
|
const c = new Set(l), u = new Set(a ?? []);
|
|
17249
17249
|
for (const d of u)
|
|
@@ -17302,7 +17302,7 @@ function Vg() {
|
|
|
17302
17302
|
createImageBlock: o
|
|
17303
17303
|
};
|
|
17304
17304
|
}
|
|
17305
|
-
const lS =
|
|
17305
|
+
const lS = ct((n) => n.with(ie, _c, st));
|
|
17306
17306
|
function aS(n) {
|
|
17307
17307
|
const e = typeof window < "u" ? window.visualViewport : null;
|
|
17308
17308
|
if (!e) return;
|
|
@@ -17352,7 +17352,7 @@ function cS(n) {
|
|
|
17352
17352
|
const e = pe(je);
|
|
17353
17353
|
if (!e)
|
|
17354
17354
|
throw new Error("useQuery must be used within a WovenCanvas component");
|
|
17355
|
-
const t = Te([]), o =
|
|
17355
|
+
const t = Te([]), o = ct((d) => d.with(...n)), r = /* @__PURE__ */ new Map();
|
|
17356
17356
|
let s = !1;
|
|
17357
17357
|
function i(d) {
|
|
17358
17358
|
const h = e.getEditor();
|
|
@@ -17409,7 +17409,7 @@ function cS(n) {
|
|
|
17409
17409
|
l(d);
|
|
17410
17410
|
}), t;
|
|
17411
17411
|
}
|
|
17412
|
-
function
|
|
17412
|
+
function it(n) {
|
|
17413
17413
|
const e = pe(je);
|
|
17414
17414
|
if (!e)
|
|
17415
17415
|
throw new Error("useSingleton must be used within a WovenCanvas component");
|
|
@@ -17447,7 +17447,7 @@ function xu(n, e, t) {
|
|
|
17447
17447
|
top: u.y - h / 2
|
|
17448
17448
|
};
|
|
17449
17449
|
}
|
|
17450
|
-
const
|
|
17450
|
+
const tt = [
|
|
17451
17451
|
fg,
|
|
17452
17452
|
hg,
|
|
17453
17453
|
pg,
|
|
@@ -17497,7 +17497,7 @@ function fS(n) {
|
|
|
17497
17497
|
}
|
|
17498
17498
|
function hS(n, e) {
|
|
17499
17499
|
if (!n.trim()) return !1;
|
|
17500
|
-
const t = Vt(n,
|
|
17500
|
+
const t = Vt(n, tt);
|
|
17501
17501
|
let o = !1, r = !0, s = 0;
|
|
17502
17502
|
return nn(t, (i) => {
|
|
17503
17503
|
s++, dS(i, e) ? o = !0 : r = !1;
|
|
@@ -17505,7 +17505,7 @@ function hS(n, e) {
|
|
|
17505
17505
|
}
|
|
17506
17506
|
function pS(n) {
|
|
17507
17507
|
if (!n.trim()) return "left";
|
|
17508
|
-
const e = Vt(n,
|
|
17508
|
+
const e = Vt(n, tt);
|
|
17509
17509
|
let t = "left";
|
|
17510
17510
|
return Su(e, (o) => {
|
|
17511
17511
|
var s;
|
|
@@ -17515,7 +17515,7 @@ function pS(n) {
|
|
|
17515
17515
|
}
|
|
17516
17516
|
function mS(n) {
|
|
17517
17517
|
if (!n.trim()) return null;
|
|
17518
|
-
const e = Vt(n,
|
|
17518
|
+
const e = Vt(n, tt);
|
|
17519
17519
|
let t = null;
|
|
17520
17520
|
return nn(e, (o) => {
|
|
17521
17521
|
t === null && (t = fS(o));
|
|
@@ -17523,33 +17523,33 @@ function mS(n) {
|
|
|
17523
17523
|
}
|
|
17524
17524
|
function ha(n, e) {
|
|
17525
17525
|
if (!n.trim()) return n;
|
|
17526
|
-
const t = Vt(n,
|
|
17526
|
+
const t = Vt(n, tt);
|
|
17527
17527
|
return nn(t, (o) => {
|
|
17528
17528
|
const r = o.marks ?? [];
|
|
17529
17529
|
r.findIndex((i) => i.type === e) === -1 && (o.marks = [...r, { type: e }]);
|
|
17530
|
-
}), dr(t,
|
|
17530
|
+
}), dr(t, tt);
|
|
17531
17531
|
}
|
|
17532
17532
|
function pa(n, e) {
|
|
17533
17533
|
if (!n.trim()) return n;
|
|
17534
|
-
const t = Vt(n,
|
|
17534
|
+
const t = Vt(n, tt);
|
|
17535
17535
|
return nn(t, (o) => {
|
|
17536
17536
|
const r = o.marks ?? [];
|
|
17537
17537
|
o.marks = r.filter((s) => s.type !== e);
|
|
17538
|
-
}), dr(t,
|
|
17538
|
+
}), dr(t, tt);
|
|
17539
17539
|
}
|
|
17540
17540
|
function gS(n, e) {
|
|
17541
17541
|
if (!n.trim()) return n;
|
|
17542
|
-
const t = Vt(n,
|
|
17542
|
+
const t = Vt(n, tt);
|
|
17543
17543
|
return Su(t, (o) => {
|
|
17544
17544
|
o.attrs = {
|
|
17545
17545
|
...o.attrs,
|
|
17546
17546
|
textAlign: e
|
|
17547
17547
|
};
|
|
17548
|
-
}), dr(t,
|
|
17548
|
+
}), dr(t, tt);
|
|
17549
17549
|
}
|
|
17550
17550
|
function yS(n, e) {
|
|
17551
17551
|
if (!n.trim()) return n;
|
|
17552
|
-
const t = Vt(n,
|
|
17552
|
+
const t = Vt(n, tt);
|
|
17553
17553
|
return nn(t, (o) => {
|
|
17554
17554
|
const r = o.marks ?? [], s = r.findIndex((i) => i.type === "textStyle");
|
|
17555
17555
|
s !== -1 ? (r[s] = {
|
|
@@ -17559,11 +17559,11 @@ function yS(n, e) {
|
|
|
17559
17559
|
color: e
|
|
17560
17560
|
}
|
|
17561
17561
|
}, o.marks = r) : o.marks = [...r, { type: "textStyle", attrs: { color: e } }];
|
|
17562
|
-
}), dr(t,
|
|
17562
|
+
}), dr(t, tt);
|
|
17563
17563
|
}
|
|
17564
17564
|
function vS(n) {
|
|
17565
17565
|
if (!n.trim()) return null;
|
|
17566
|
-
const e = Vt(n,
|
|
17566
|
+
const e = Vt(n, tt);
|
|
17567
17567
|
let t = null;
|
|
17568
17568
|
return nn(e, (o) => {
|
|
17569
17569
|
var r, s;
|
|
@@ -17575,7 +17575,7 @@ function vS(n) {
|
|
|
17575
17575
|
}
|
|
17576
17576
|
function wS(n, e) {
|
|
17577
17577
|
if (!n.trim()) return n;
|
|
17578
|
-
const t = Vt(n,
|
|
17578
|
+
const t = Vt(n, tt);
|
|
17579
17579
|
return nn(t, (o) => {
|
|
17580
17580
|
const r = o.marks ?? [], s = r.findIndex((i) => i.type === "link");
|
|
17581
17581
|
s !== -1 ? (r[s] = {
|
|
@@ -17585,15 +17585,15 @@ function wS(n, e) {
|
|
|
17585
17585
|
href: e
|
|
17586
17586
|
}
|
|
17587
17587
|
}, o.marks = r) : o.marks = [...r, { type: "link", attrs: { href: e, target: "_blank", rel: "noopener noreferrer" } }];
|
|
17588
|
-
}), dr(t,
|
|
17588
|
+
}), dr(t, tt);
|
|
17589
17589
|
}
|
|
17590
17590
|
function kS(n) {
|
|
17591
17591
|
if (!n.trim()) return n;
|
|
17592
|
-
const e = Vt(n,
|
|
17592
|
+
const e = Vt(n, tt);
|
|
17593
17593
|
return nn(e, (t) => {
|
|
17594
17594
|
const o = t.marks ?? [];
|
|
17595
17595
|
t.marks = o.filter((r) => r.type !== "link");
|
|
17596
|
-
}), dr(e,
|
|
17596
|
+
}), dr(e, tt);
|
|
17597
17597
|
}
|
|
17598
17598
|
function Gf(n) {
|
|
17599
17599
|
const e = document.querySelector(`[data-entity-id="${n}"]`);
|
|
@@ -17617,7 +17617,7 @@ function Xf(n, e, t, o) {
|
|
|
17617
17617
|
return r.remove(), l;
|
|
17618
17618
|
}
|
|
17619
17619
|
function bS(n) {
|
|
17620
|
-
const { nextEditorTick: e } = Ae(), t = pe(je), o = no(n,
|
|
17620
|
+
const { nextEditorTick: e } = Ae(), t = pe(je), o = no(n, st), r = it(Re), s = it(eo), i = hr(), l = {
|
|
17621
17621
|
hasTextEntities: I(() => {
|
|
17622
17622
|
for (const f of o.value.values())
|
|
17623
17623
|
if (f) return !0;
|
|
@@ -17626,7 +17626,7 @@ function bS(n) {
|
|
|
17626
17626
|
hasTextContent: I(() => {
|
|
17627
17627
|
for (const f of o.value.values()) {
|
|
17628
17628
|
if (!f) continue;
|
|
17629
|
-
const p = f.content ? Vt(f.content,
|
|
17629
|
+
const p = f.content ? Vt(f.content, tt) : null;
|
|
17630
17630
|
if (p) {
|
|
17631
17631
|
let m = !1;
|
|
17632
17632
|
if (nn(p, (g) => {
|
|
@@ -17772,7 +17772,7 @@ function bS(n) {
|
|
|
17772
17772
|
}
|
|
17773
17773
|
};
|
|
17774
17774
|
function u(f, p) {
|
|
17775
|
-
const m =
|
|
17775
|
+
const m = rt(n), g = [];
|
|
17776
17776
|
for (const y of m) {
|
|
17777
17777
|
const v = o.value.get(y);
|
|
17778
17778
|
if (!v) continue;
|
|
@@ -17784,7 +17784,7 @@ function bS(n) {
|
|
|
17784
17784
|
}
|
|
17785
17785
|
e((y) => {
|
|
17786
17786
|
for (const v of m)
|
|
17787
|
-
p(
|
|
17787
|
+
p(st.write(y, v));
|
|
17788
17788
|
for (const { entityId: v, width: k, height: w, left: x, top: T } of g) {
|
|
17789
17789
|
const S = ie.write(y, v);
|
|
17790
17790
|
S.size = [k, w], ie.setWorldPosition(y, v, [x, T]);
|
|
@@ -17796,7 +17796,7 @@ function bS(n) {
|
|
|
17796
17796
|
});
|
|
17797
17797
|
}
|
|
17798
17798
|
function d(f) {
|
|
17799
|
-
const p =
|
|
17799
|
+
const p = rt(n), m = [];
|
|
17800
17800
|
for (const g of p) {
|
|
17801
17801
|
const y = o.value.get(g);
|
|
17802
17802
|
if (!y) continue;
|
|
@@ -17809,7 +17809,7 @@ function bS(n) {
|
|
|
17809
17809
|
}
|
|
17810
17810
|
e((g) => {
|
|
17811
17811
|
for (const { entityId: y, content: v, width: k, height: w, left: x, top: T } of m) {
|
|
17812
|
-
const S =
|
|
17812
|
+
const S = st.write(g, y);
|
|
17813
17813
|
if (S.content = v, k > 0 && w > 0) {
|
|
17814
17814
|
const E = ie.write(g, y);
|
|
17815
17815
|
E.size = [k, w], ie.setWorldPosition(g, y, [x, T]);
|
|
@@ -17819,10 +17819,10 @@ function bS(n) {
|
|
|
17819
17819
|
});
|
|
17820
17820
|
}
|
|
17821
17821
|
function h(f) {
|
|
17822
|
-
const p =
|
|
17822
|
+
const p = rt(n);
|
|
17823
17823
|
e((m) => {
|
|
17824
17824
|
for (const g of p) {
|
|
17825
|
-
const y =
|
|
17825
|
+
const y = st.write(m, g);
|
|
17826
17826
|
y.content = f(y.content);
|
|
17827
17827
|
}
|
|
17828
17828
|
});
|
|
@@ -17886,17 +17886,17 @@ function on(n) {
|
|
|
17886
17886
|
};
|
|
17887
17887
|
}
|
|
17888
17888
|
function Wg(n) {
|
|
17889
|
-
const e =
|
|
17889
|
+
const e = it(Re), t = it(eo), o = it(qh), r = it(el), { nextEditorTick: s } = Ae();
|
|
17890
17890
|
let i = !1, l = null;
|
|
17891
17891
|
function a(u, d) {
|
|
17892
|
-
const { entityId: h } =
|
|
17892
|
+
const { entityId: h } = rt(n.blockData), f = rt(n.minWidth) ?? 0, p = rt(n.minHeight) ?? 0, m = Math.max(d.width, f), g = Math.max(d.height, p), y = ie.read(u, h), v = Math.abs(y.size[0] - m) > 0.5, k = Math.abs(y.size[1] - g) > 0.5;
|
|
17893
17893
|
if (!v && !k) return;
|
|
17894
17894
|
const w = ie.write(u, h);
|
|
17895
17895
|
w.size = [m, g], ie.setWorldPosition(u, h, [d.left, d.top]), o.value.transformBoxId !== null && Jh.spawn(u, {
|
|
17896
17896
|
transformBoxId: o.value.transformBoxId
|
|
17897
17897
|
});
|
|
17898
17898
|
}
|
|
17899
|
-
|
|
17899
|
+
me(
|
|
17900
17900
|
() => r.value,
|
|
17901
17901
|
() => {
|
|
17902
17902
|
s((u) => {
|
|
@@ -17914,9 +17914,9 @@ function Wg(n) {
|
|
|
17914
17914
|
function c(u) {
|
|
17915
17915
|
const { content: d, ...h } = u;
|
|
17916
17916
|
s((f) => {
|
|
17917
|
-
const { entityId: p } =
|
|
17918
|
-
if (
|
|
17919
|
-
const g =
|
|
17917
|
+
const { entityId: p } = rt(n.blockData);
|
|
17918
|
+
if (st.read(f, p).content !== d) {
|
|
17919
|
+
const g = st.write(f, p);
|
|
17920
17920
|
g.content = d;
|
|
17921
17921
|
}
|
|
17922
17922
|
a(f, h);
|
|
@@ -18009,10 +18009,10 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18009
18009
|
emits: ["editEnd"],
|
|
18010
18010
|
setup(n, { expose: e, emit: t }) {
|
|
18011
18011
|
var _;
|
|
18012
|
-
const o = n, r = t, s = _e(o.entityId,
|
|
18012
|
+
const o = n, r = t, s = _e(o.entityId, st), i = it(Re), l = it(eo), a = hr(), { nextEditorTick: c, getEditor: u } = Ae(), d = it(Ma), h = pe(Qh, void 0), f = B(null);
|
|
18013
18013
|
e({ editableTextRef: f });
|
|
18014
18014
|
const p = B(((_ = s.value) == null ? void 0 : _.content) ?? ""), m = Te(null);
|
|
18015
|
-
|
|
18015
|
+
me(
|
|
18016
18016
|
() => {
|
|
18017
18017
|
var O;
|
|
18018
18018
|
return (O = s.value) == null ? void 0 : O.fontFamily;
|
|
@@ -18028,7 +18028,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18028
18028
|
f.value && (f.value.style.opacity = "0");
|
|
18029
18029
|
const O = await c(), D = ie.read(O, o.entityId), N = (((J = l.value) == null ? void 0 : J.width) ?? Fi) / (((X = i.value) == null ? void 0 : X.zoom) ?? 1), H = Math.min(Fi, N / 2), V = Math.max(D.size[0], H), U = ie.write(O, o.entityId);
|
|
18030
18030
|
U.size = [V, D.size[1]];
|
|
18031
|
-
const ee =
|
|
18031
|
+
const ee = st.write(O, o.entityId);
|
|
18032
18032
|
ee.constrainWidth = !0, ey.spawn(O), requestAnimationFrame(() => {
|
|
18033
18033
|
f.value && (f.value.style.opacity = ""), requestAnimationFrame(() => {
|
|
18034
18034
|
a.updateCounter.value++;
|
|
@@ -18042,9 +18042,9 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18042
18042
|
const H = ((ee = D.clipboardData) == null ? void 0 : ee.getData("text/html")) ?? "", V = ((J = D.clipboardData) == null ? void 0 : J.getData("text/plain")) ?? "";
|
|
18043
18043
|
if (!/<[^>]+data-pm-slice=/.test(H)) {
|
|
18044
18044
|
D.preventDefault();
|
|
18045
|
-
const Y = V.trimEnd().split(/\r?\n/).map((
|
|
18045
|
+
const Y = V.trimEnd().split(/\r?\n/).map((oe) => ({
|
|
18046
18046
|
type: "paragraph",
|
|
18047
|
-
content:
|
|
18047
|
+
content: oe ? [{ type: "text", text: oe }] : []
|
|
18048
18048
|
}));
|
|
18049
18049
|
return (X = m.value) == null || X.commands.insertContent(Y), !N.constrainWidth && V.length > ac && g(), !0;
|
|
18050
18050
|
}
|
|
@@ -18089,7 +18089,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18089
18089
|
}
|
|
18090
18090
|
});
|
|
18091
18091
|
}
|
|
18092
|
-
|
|
18092
|
+
me(
|
|
18093
18093
|
() => o.edited,
|
|
18094
18094
|
async (O) => {
|
|
18095
18095
|
if (O) {
|
|
@@ -18117,13 +18117,13 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18117
18117
|
let D = O.getHTML();
|
|
18118
18118
|
const H = D.replace(/<[^>]*>/g, "").trim().length > 0;
|
|
18119
18119
|
H || (D = ""), p.value = D, c((V) => {
|
|
18120
|
-
var Y,
|
|
18120
|
+
var Y, oe;
|
|
18121
18121
|
const U = Uh(V, o.block.tag);
|
|
18122
18122
|
if (!H && ((Y = U.editOptions) != null && Y.removeWhenTextEmpty)) {
|
|
18123
18123
|
Oa(V, o.entityId);
|
|
18124
18124
|
return;
|
|
18125
18125
|
}
|
|
18126
|
-
const ee = (
|
|
18126
|
+
const ee = (oe = f.value) == null ? void 0 : oe.closest(".wov-block"), J = (ee == null ? void 0 : ee.firstElementChild) ?? f.value;
|
|
18127
18127
|
if (!J) {
|
|
18128
18128
|
console.warn("EditableText: no element to measure");
|
|
18129
18129
|
return;
|
|
@@ -18132,7 +18132,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18132
18132
|
r("editEnd", { content: D, ...X });
|
|
18133
18133
|
});
|
|
18134
18134
|
}
|
|
18135
|
-
|
|
18135
|
+
me(
|
|
18136
18136
|
() => {
|
|
18137
18137
|
var O;
|
|
18138
18138
|
return (O = s.value) == null ? void 0 : O.content;
|
|
@@ -18185,7 +18185,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18185
18185
|
onPointerup: S,
|
|
18186
18186
|
onClick: E
|
|
18187
18187
|
}, [
|
|
18188
|
-
m.value ? (C(),
|
|
18188
|
+
m.value ? (C(), ne(F(z2), {
|
|
18189
18189
|
key: 0,
|
|
18190
18190
|
editor: m.value
|
|
18191
18191
|
}, null, 8, ["editor"])) : (C(), M("div", IS, [
|
|
@@ -18215,9 +18215,9 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18215
18215
|
},
|
|
18216
18216
|
setup(n) {
|
|
18217
18217
|
const e = n, t = _e(e.entityId, Yt), o = _e(e.entityId, Ks), r = B(null), s = {
|
|
18218
|
-
[
|
|
18219
|
-
[
|
|
18220
|
-
[
|
|
18218
|
+
[Ye.Top]: "flex-start",
|
|
18219
|
+
[Ye.Center]: "center",
|
|
18220
|
+
[Ye.Bottom]: "flex-end"
|
|
18221
18221
|
}, i = I(() => t.value ? `rgba(${t.value.fillRed}, ${t.value.fillGreen}, ${t.value.fillBlue}, ${(t.value.fillAlpha ?? 255) / 255})` : "rgba(0, 0, 0, 0)"), l = I(() => t.value ? t.value.strokeKind === Tt.None ? "none" : `rgba(${t.value.strokeRed}, ${t.value.strokeGreen}, ${t.value.strokeBlue}, ${t.value.strokeAlpha / 255})` : "rgba(0, 0, 0, 1)"), a = I(() => {
|
|
18222
18222
|
var m;
|
|
18223
18223
|
return ((m = t.value) == null ? void 0 : m.strokeWidth) ?? 2;
|
|
@@ -18241,13 +18241,13 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18241
18241
|
var m;
|
|
18242
18242
|
return {
|
|
18243
18243
|
overflow: e.edited ? "visible" : "hidden",
|
|
18244
|
-
alignItems: s[((m = o.value) == null ? void 0 : m.value) ??
|
|
18244
|
+
alignItems: s[((m = o.value) == null ? void 0 : m.value) ?? Ye.Top]
|
|
18245
18245
|
};
|
|
18246
18246
|
}), { nextEditorTick: f } = Ae();
|
|
18247
18247
|
function p(m) {
|
|
18248
18248
|
f((g) => {
|
|
18249
|
-
if (
|
|
18250
|
-
const v =
|
|
18249
|
+
if (st.read(g, e.entityId).content === m.content) return;
|
|
18250
|
+
const v = st.write(g, e.entityId);
|
|
18251
18251
|
v.content = m.content;
|
|
18252
18252
|
});
|
|
18253
18253
|
}
|
|
@@ -18336,7 +18336,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18336
18336
|
console.error("Failed to get tape display URL:", w), m.value = !0, p.value = !1;
|
|
18337
18337
|
}
|
|
18338
18338
|
}
|
|
18339
|
-
return
|
|
18339
|
+
return me(
|
|
18340
18340
|
() => i.value,
|
|
18341
18341
|
() => {
|
|
18342
18342
|
y();
|
|
@@ -18344,7 +18344,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18344
18344
|
{ immediate: !0 }
|
|
18345
18345
|
), kt(() => {
|
|
18346
18346
|
y();
|
|
18347
|
-
}),
|
|
18347
|
+
}), me(
|
|
18348
18348
|
() => o.block.size[1],
|
|
18349
18349
|
() => {
|
|
18350
18350
|
a().height > h && y();
|
|
@@ -18373,7 +18373,7 @@ const IS = { key: 1 }, OS = ["innerHTML"], Mu = /* @__PURE__ */ q({
|
|
|
18373
18373
|
connector: {}
|
|
18374
18374
|
},
|
|
18375
18375
|
setup(n) {
|
|
18376
|
-
const e = n, t = B(null), o = _e(e.entityId,
|
|
18376
|
+
const e = n, t = B(null), o = _e(e.entityId, st), r = I(() => {
|
|
18377
18377
|
var c;
|
|
18378
18378
|
return (((c = o.value) == null ? void 0 : c.content) ?? "").replace(/<[^>]*>/g, "").trim().length === 0;
|
|
18379
18379
|
}), s = I(() => {
|
|
@@ -18731,7 +18731,7 @@ const oC = async (n, e, t) => {
|
|
|
18731
18731
|
Y === "y";
|
|
18732
18732
|
}
|
|
18733
18733
|
return !0;
|
|
18734
|
-
}).map((X) => [X.placement, X.overflows.filter((Y) => Y > 0).reduce((Y,
|
|
18734
|
+
}).map((X) => [X.placement, X.overflows.filter((Y) => Y > 0).reduce((Y, oe) => Y + oe, 0)]).sort((X, Y) => X[1] - Y[1])[0]) == null ? void 0 : H[0];
|
|
18735
18735
|
J && (ee = J);
|
|
18736
18736
|
break;
|
|
18737
18737
|
}
|
|
@@ -19441,11 +19441,11 @@ function yr(n, e, t) {
|
|
|
19441
19441
|
function T() {
|
|
19442
19442
|
r.value || (g.value = !1);
|
|
19443
19443
|
}
|
|
19444
|
-
return
|
|
19444
|
+
return me([s, i, l, r], k, {
|
|
19445
19445
|
flush: "sync"
|
|
19446
|
-
}),
|
|
19446
|
+
}), me([c, u], x, {
|
|
19447
19447
|
flush: "sync"
|
|
19448
|
-
}),
|
|
19448
|
+
}), me(r, T, {
|
|
19449
19449
|
flush: "sync"
|
|
19450
19450
|
}), Fh() && Hh(w), {
|
|
19451
19451
|
x: $o(d),
|
|
@@ -19471,7 +19471,7 @@ const LC = ["menu-open"], _t = /* @__PURE__ */ q({
|
|
|
19471
19471
|
const t = n, o = e, r = pe("containerRef"), s = pe(Xh, null), i = pe(ad, 0), l = Math.random().toString(36).slice(2);
|
|
19472
19472
|
po(ad, i + 1);
|
|
19473
19473
|
const { show: a, hide: c } = oo(), u = B(!1);
|
|
19474
|
-
s &&
|
|
19474
|
+
s && me(
|
|
19475
19475
|
() => s.value.get(i),
|
|
19476
19476
|
(k) => {
|
|
19477
19477
|
k !== void 0 && k !== l && u.value && (u.value = !1);
|
|
@@ -19499,7 +19499,7 @@ const LC = ["menu-open"], _t = /* @__PURE__ */ q({
|
|
|
19499
19499
|
function v() {
|
|
19500
19500
|
c();
|
|
19501
19501
|
}
|
|
19502
|
-
return
|
|
19502
|
+
return me(u, (k) => {
|
|
19503
19503
|
k ? (c(), document.addEventListener("click", g, !0), s && (s.value.set(i, l), s.value = new Map(s.value)), o("open")) : (document.removeEventListener("click", g, !0), (s == null ? void 0 : s.value.get(i)) === l && (s.value.delete(i), s.value = new Map(s.value)), o("close"));
|
|
19504
19504
|
}), Le(() => {
|
|
19505
19505
|
document.removeEventListener("click", g, !0);
|
|
@@ -19515,9 +19515,9 @@ const LC = ["menu-open"], _t = /* @__PURE__ */ q({
|
|
|
19515
19515
|
onMouseenter: y,
|
|
19516
19516
|
onMouseleave: v
|
|
19517
19517
|
}, [
|
|
19518
|
-
|
|
19518
|
+
ge(k.$slots, "button", { isOpen: u.value })
|
|
19519
19519
|
], 42, LC),
|
|
19520
|
-
F(r) ? (C(),
|
|
19520
|
+
F(r) ? (C(), ne(ms, {
|
|
19521
19521
|
key: 0,
|
|
19522
19522
|
to: F(r)
|
|
19523
19523
|
}, [
|
|
@@ -19528,7 +19528,7 @@ const LC = ["menu-open"], _t = /* @__PURE__ */ q({
|
|
|
19528
19528
|
class: "wov-menu-dropdown",
|
|
19529
19529
|
style: ye(F(f))
|
|
19530
19530
|
}, [
|
|
19531
|
-
|
|
19531
|
+
ge(k.$slots, "dropdown", { close: m })
|
|
19532
19532
|
], 4)) : j("", !0)
|
|
19533
19533
|
], 8, ["to"])) : j("", !0)
|
|
19534
19534
|
], 64));
|
|
@@ -19551,7 +19551,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19551
19551
|
},
|
|
19552
19552
|
setup(n) {
|
|
19553
19553
|
const e = n, { nextEditorTick: t } = Ae(), o = Te(null), r = I(() => {
|
|
19554
|
-
const l = o.value ?? (e.side === "start" ?
|
|
19554
|
+
const l = o.value ?? (e.side === "start" ? Xe.None : Xe.V);
|
|
19555
19555
|
return Yr(l);
|
|
19556
19556
|
});
|
|
19557
19557
|
t((l) => {
|
|
@@ -19562,7 +19562,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19562
19562
|
if (a === null)
|
|
19563
19563
|
a = d;
|
|
19564
19564
|
else if (d !== a) {
|
|
19565
|
-
o.value = e.side === "start" ?
|
|
19565
|
+
o.value = e.side === "start" ? Xe.None : Xe.V;
|
|
19566
19566
|
return;
|
|
19567
19567
|
}
|
|
19568
19568
|
}
|
|
@@ -19571,7 +19571,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19571
19571
|
if (a === null)
|
|
19572
19572
|
a = d;
|
|
19573
19573
|
else if (d !== a) {
|
|
19574
|
-
o.value = e.side === "start" ?
|
|
19574
|
+
o.value = e.side === "start" ? Xe.None : Xe.V;
|
|
19575
19575
|
return;
|
|
19576
19576
|
}
|
|
19577
19577
|
}
|
|
@@ -19597,7 +19597,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19597
19597
|
const a = e.side === "start";
|
|
19598
19598
|
return `<line x1="${a ? 8 : 4}" y1="12" x2="${a ? 20 : 16}" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round" /><g transform="${`translate(${a ? 4 : 20}, 12) scale(${a ? "-0.8, 0.8" : "0.8"})`}">${l.svg}</g>`;
|
|
19599
19599
|
}
|
|
19600
|
-
return (l, a) => (C(),
|
|
19600
|
+
return (l, a) => (C(), ne(_t, {
|
|
19601
19601
|
title: n.side === "start" ? "Start Arrow Head" : "End Arrow Head"
|
|
19602
19602
|
}, {
|
|
19603
19603
|
button: se(() => [
|
|
@@ -19678,7 +19678,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19678
19678
|
}
|
|
19679
19679
|
});
|
|
19680
19680
|
}
|
|
19681
|
-
return (i, l) => (C(),
|
|
19681
|
+
return (i, l) => (C(), ne(_t, { title: "Thickness" }, {
|
|
19682
19682
|
button: se(() => [
|
|
19683
19683
|
b("div", jC, [
|
|
19684
19684
|
l[0] || (l[0] = b("svg", {
|
|
@@ -19733,7 +19733,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19733
19733
|
emits: ["update:modelValue"],
|
|
19734
19734
|
setup(n, { emit: e }) {
|
|
19735
19735
|
const t = n, o = e, r = B(t.modelValue ?? "");
|
|
19736
|
-
|
|
19736
|
+
me(
|
|
19737
19737
|
() => t.modelValue,
|
|
19738
19738
|
(u) => {
|
|
19739
19739
|
u && u !== r.value && (r.value = u);
|
|
@@ -19860,12 +19860,12 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19860
19860
|
function v(T) {
|
|
19861
19861
|
y(T), o("update:modelValue", t.withOpacity ? Kf(jf(T)) : T);
|
|
19862
19862
|
}
|
|
19863
|
-
y(t.modelValue),
|
|
19863
|
+
y(t.modelValue), me(
|
|
19864
19864
|
() => t.modelValue,
|
|
19865
19865
|
(T) => {
|
|
19866
19866
|
d.value || y(T);
|
|
19867
19867
|
}
|
|
19868
|
-
),
|
|
19868
|
+
), me([l, a, c], () => {
|
|
19869
19869
|
d.value && o("update:modelValue", m.value);
|
|
19870
19870
|
});
|
|
19871
19871
|
function k(T) {
|
|
@@ -19911,7 +19911,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19911
19911
|
thumbColor: f.value,
|
|
19912
19912
|
background: ZC
|
|
19913
19913
|
}, null, 8, ["modelValue", "thumbColor"]),
|
|
19914
|
-
n.withOpacity ? (C(),
|
|
19914
|
+
n.withOpacity ? (C(), ne(ch, {
|
|
19915
19915
|
key: 0,
|
|
19916
19916
|
ref_key: "opacitySliderRef",
|
|
19917
19917
|
ref: s,
|
|
@@ -19983,7 +19983,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
19983
19983
|
m && o("change", m);
|
|
19984
19984
|
}
|
|
19985
19985
|
return (p, m) => (C(), M("div", eT, [
|
|
19986
|
-
i.value ? (C(),
|
|
19986
|
+
i.value ? (C(), ne(QC, {
|
|
19987
19987
|
key: 0,
|
|
19988
19988
|
modelValue: l.value,
|
|
19989
19989
|
"onUpdate:modelValue": [
|
|
@@ -20042,7 +20042,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20042
20042
|
Zo.fromHex(d, h, u);
|
|
20043
20043
|
});
|
|
20044
20044
|
}
|
|
20045
|
-
return (c, u) => (C(),
|
|
20045
|
+
return (c, u) => (C(), ne(_t, { title: "Color" }, {
|
|
20046
20046
|
button: se(() => [
|
|
20047
20047
|
b("div", oT, [
|
|
20048
20048
|
b("div", rT, [
|
|
@@ -20091,7 +20091,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20091
20091
|
onMouseenter: a,
|
|
20092
20092
|
onMouseleave: c
|
|
20093
20093
|
}, [
|
|
20094
|
-
|
|
20094
|
+
ge(u.$slots, "default")
|
|
20095
20095
|
], 544));
|
|
20096
20096
|
}
|
|
20097
20097
|
}), iT = /* @__PURE__ */ q({
|
|
@@ -20116,7 +20116,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20116
20116
|
var u;
|
|
20117
20117
|
return a.value && t.value && ((u = e.value) == null ? void 0 : u.text);
|
|
20118
20118
|
});
|
|
20119
|
-
return (u, d) => (C(),
|
|
20119
|
+
return (u, d) => (C(), ne(ms, { to: "body" }, [
|
|
20120
20120
|
Z(Mc, { name: "wov-tooltip-fade" }, {
|
|
20121
20121
|
default: se(() => {
|
|
20122
20122
|
var h;
|
|
@@ -20171,7 +20171,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20171
20171
|
}
|
|
20172
20172
|
});
|
|
20173
20173
|
}
|
|
20174
|
-
return (a, c) => s.value ? (C(),
|
|
20174
|
+
return (a, c) => s.value ? (C(), ne(_t, {
|
|
20175
20175
|
key: 0,
|
|
20176
20176
|
title: "Thickness"
|
|
20177
20177
|
}, {
|
|
@@ -20280,7 +20280,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20280
20280
|
});
|
|
20281
20281
|
}
|
|
20282
20282
|
const f = B(!1);
|
|
20283
|
-
return (p, m) => (C(),
|
|
20283
|
+
return (p, m) => (C(), ne(_t, { title: "Fill Color" }, {
|
|
20284
20284
|
button: se(() => [
|
|
20285
20285
|
b("div", uT, [
|
|
20286
20286
|
m[1] || (m[1] = b("svg", {
|
|
@@ -20378,7 +20378,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20378
20378
|
}
|
|
20379
20379
|
});
|
|
20380
20380
|
}
|
|
20381
|
-
return (c, u) => (C(),
|
|
20381
|
+
return (c, u) => (C(), ne(_t, { title: "Shape Type" }, {
|
|
20382
20382
|
button: se(() => [
|
|
20383
20383
|
b("div", yT, [
|
|
20384
20384
|
u[0] || (u[0] = b("svg", {
|
|
@@ -20544,7 +20544,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20544
20544
|
}
|
|
20545
20545
|
});
|
|
20546
20546
|
}
|
|
20547
|
-
return (m, g) => (C(),
|
|
20547
|
+
return (m, g) => (C(), ne(_t, { title: "Stroke Color" }, {
|
|
20548
20548
|
button: se(() => [
|
|
20549
20549
|
b("div", AT, [
|
|
20550
20550
|
g[1] || (g[1] = b("svg", {
|
|
@@ -20565,7 +20565,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20565
20565
|
]),
|
|
20566
20566
|
dropdown: se(() => [
|
|
20567
20567
|
b("div", IT, [
|
|
20568
|
-
s.value ? j("", !0) : (C(),
|
|
20568
|
+
s.value ? j("", !0) : (C(), ne(MT, {
|
|
20569
20569
|
key: 0,
|
|
20570
20570
|
currentStyle: c.value,
|
|
20571
20571
|
hasMultipleStyles: u.value,
|
|
@@ -20636,7 +20636,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20636
20636
|
}
|
|
20637
20637
|
});
|
|
20638
20638
|
}
|
|
20639
|
-
return (l, a) => (C(),
|
|
20639
|
+
return (l, a) => (C(), ne(_t, { title: "Tape Style" }, {
|
|
20640
20640
|
button: se(() => [
|
|
20641
20641
|
b("div", PT, [
|
|
20642
20642
|
b("div", {
|
|
@@ -20697,7 +20697,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20697
20697
|
const i = r.indexOf(t.alignment), l = r[(i + 1) % r.length];
|
|
20698
20698
|
o.setAlignment(l);
|
|
20699
20699
|
}
|
|
20700
|
-
return (i, l) => F(t).showTextMenuButtons ? (C(),
|
|
20700
|
+
return (i, l) => F(t).showTextMenuButtons ? (C(), ne(vr, {
|
|
20701
20701
|
key: 0,
|
|
20702
20702
|
title: "Text Align",
|
|
20703
20703
|
onClick: s
|
|
@@ -20723,7 +20723,7 @@ const Dt = /* @__PURE__ */ _o($C, [["render", zC]]), FC = { class: "wov-menu-but
|
|
|
20723
20723
|
},
|
|
20724
20724
|
setup(n) {
|
|
20725
20725
|
const e = n, { state: t, commands: o } = on(() => e.entityIds);
|
|
20726
|
-
return (r, s) => F(t).showTextMenuButtons ? (C(),
|
|
20726
|
+
return (r, s) => F(t).showTextMenuButtons ? (C(), ne(vr, {
|
|
20727
20727
|
key: 0,
|
|
20728
20728
|
title: "Bold",
|
|
20729
20729
|
class: Me({ "wov-active": F(t).isBold }),
|
|
@@ -20759,7 +20759,7 @@ function JT(n, e = !0, t) {
|
|
|
20759
20759
|
qT() ? kt(n, t) : e ? n() : Gn(n);
|
|
20760
20760
|
}
|
|
20761
20761
|
function GT(n, e, t) {
|
|
20762
|
-
return
|
|
20762
|
+
return me(n, e, {
|
|
20763
20763
|
...t,
|
|
20764
20764
|
immediate: !0
|
|
20765
20765
|
});
|
|
@@ -20767,21 +20767,21 @@ function GT(n, e, t) {
|
|
|
20767
20767
|
const El = jT ? window : void 0;
|
|
20768
20768
|
function Bt(n) {
|
|
20769
20769
|
var e;
|
|
20770
|
-
const t =
|
|
20770
|
+
const t = rt(n);
|
|
20771
20771
|
return (e = t == null ? void 0 : t.$el) !== null && e !== void 0 ? e : t;
|
|
20772
20772
|
}
|
|
20773
20773
|
function ga(...n) {
|
|
20774
20774
|
const e = (o, r, s, i) => (o.addEventListener(r, s, i), () => o.removeEventListener(r, s, i)), t = I(() => {
|
|
20775
|
-
const o = Hs(
|
|
20775
|
+
const o = Hs(rt(n[0])).filter((r) => r != null);
|
|
20776
20776
|
return o.every((r) => typeof r != "string") ? o : void 0;
|
|
20777
20777
|
});
|
|
20778
20778
|
return GT(() => {
|
|
20779
20779
|
var o, r;
|
|
20780
20780
|
return [
|
|
20781
20781
|
(o = (r = t.value) === null || r === void 0 ? void 0 : r.map((s) => Bt(s))) !== null && o !== void 0 ? o : [El].filter((s) => s != null),
|
|
20782
|
-
Hs(
|
|
20782
|
+
Hs(rt(t.value ? n[1] : n[0])),
|
|
20783
20783
|
Hs(F(t.value ? n[2] : n[1])),
|
|
20784
|
-
|
|
20784
|
+
rt(t.value ? n[3] : n[2])
|
|
20785
20785
|
];
|
|
20786
20786
|
}, ([o, r, s, i], l, a) => {
|
|
20787
20787
|
if (!(o != null && o.length) || !(r != null && r.length) || !(s != null && s.length)) return;
|
|
@@ -20799,7 +20799,7 @@ function YT(n, e, t = {}) {
|
|
|
20799
20799
|
trigger: Ps
|
|
20800
20800
|
} : Ps;
|
|
20801
20801
|
let a = !0;
|
|
20802
|
-
const c = (g) =>
|
|
20802
|
+
const c = (g) => rt(r).some((y) => {
|
|
20803
20803
|
if (typeof y == "string") return Array.from(o.document.querySelectorAll(y)).some((v) => v === g.target || g.composedPath().includes(v));
|
|
20804
20804
|
{
|
|
20805
20805
|
const v = Bt(y);
|
|
@@ -20807,11 +20807,11 @@ function YT(n, e, t = {}) {
|
|
|
20807
20807
|
}
|
|
20808
20808
|
});
|
|
20809
20809
|
function u(g) {
|
|
20810
|
-
const y =
|
|
20810
|
+
const y = rt(g);
|
|
20811
20811
|
return y && y.$.subTree.shapeFlag === 16;
|
|
20812
20812
|
}
|
|
20813
20813
|
function d(g, y) {
|
|
20814
|
-
const v =
|
|
20814
|
+
const v = rt(g), k = v.$.subTree && v.$.subTree.children;
|
|
20815
20815
|
return k == null || !Array.isArray(k) ? !1 : k.some((w) => w.el === y.target || y.composedPath().includes(w.el));
|
|
20816
20816
|
}
|
|
20817
20817
|
const h = (g) => {
|
|
@@ -20873,8 +20873,8 @@ function QT(n, e, t = {}) {
|
|
|
20873
20873
|
let s;
|
|
20874
20874
|
const i = /* @__PURE__ */ ZT(() => o && "ResizeObserver" in o), l = () => {
|
|
20875
20875
|
s && (s.disconnect(), s = void 0);
|
|
20876
|
-
}, a =
|
|
20877
|
-
const u =
|
|
20876
|
+
}, a = me(I(() => {
|
|
20877
|
+
const u = rt(n);
|
|
20878
20878
|
return Array.isArray(u) ? u.map((d) => Bt(d)) : [Bt(u)];
|
|
20879
20879
|
}), (u) => {
|
|
20880
20880
|
if (l(), i.value && o) {
|
|
@@ -20917,7 +20917,7 @@ function n0(n, e = {
|
|
|
20917
20917
|
const d = Bt(n);
|
|
20918
20918
|
d && (i.value = "offsetWidth" in d ? d.offsetWidth : e.width, l.value = "offsetHeight" in d ? d.offsetHeight : e.height);
|
|
20919
20919
|
});
|
|
20920
|
-
const c =
|
|
20920
|
+
const c = me(() => Bt(n), (d) => {
|
|
20921
20921
|
i.value = d ? e.width : 0, l.value = d ? e.height : 0;
|
|
20922
20922
|
});
|
|
20923
20923
|
function u() {
|
|
@@ -20960,7 +20960,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
20960
20960
|
function c(u) {
|
|
20961
20961
|
u.stopPropagation();
|
|
20962
20962
|
}
|
|
20963
|
-
return (u, d) => F(t).showTextMenuButtons ? (C(),
|
|
20963
|
+
return (u, d) => F(t).showTextMenuButtons ? (C(), ne(_t, {
|
|
20964
20964
|
key: 0,
|
|
20965
20965
|
title: "Font Family"
|
|
20966
20966
|
}, {
|
|
@@ -21041,7 +21041,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21041
21041
|
function d(h) {
|
|
21042
21042
|
h.stopPropagation();
|
|
21043
21043
|
}
|
|
21044
|
-
return (h, f) => F(t).showTextMenuButtons ? (C(),
|
|
21044
|
+
return (h, f) => F(t).showTextMenuButtons ? (C(), ne(_t, {
|
|
21045
21045
|
key: 0,
|
|
21046
21046
|
title: "Font Size"
|
|
21047
21047
|
}, {
|
|
@@ -21094,7 +21094,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21094
21094
|
},
|
|
21095
21095
|
setup(n) {
|
|
21096
21096
|
const e = n, { state: t, commands: o } = on(() => e.entityIds);
|
|
21097
|
-
return (r, s) => F(t).showTextMenuButtons ? (C(),
|
|
21097
|
+
return (r, s) => F(t).showTextMenuButtons ? (C(), ne(vr, {
|
|
21098
21098
|
key: 0,
|
|
21099
21099
|
title: "Italic",
|
|
21100
21100
|
class: Me({ "wov-active": F(t).isItalic }),
|
|
@@ -21119,7 +21119,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21119
21119
|
},
|
|
21120
21120
|
setup(n) {
|
|
21121
21121
|
const e = n, { state: t, commands: o } = on(() => e.entityIds);
|
|
21122
|
-
return (r, s) => F(t).showTextMenuButtons ? (C(),
|
|
21122
|
+
return (r, s) => F(t).showTextMenuButtons ? (C(), ne(vr, {
|
|
21123
21123
|
key: 0,
|
|
21124
21124
|
title: "Underline",
|
|
21125
21125
|
class: Me({ "wov-active": F(t).isUnderline }),
|
|
@@ -21166,14 +21166,14 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21166
21166
|
const g = m.target;
|
|
21167
21167
|
!((y = l.value) != null && y.contains(g)) && !((v = a.value) != null && v.contains(g)) && (r.value = !1);
|
|
21168
21168
|
}
|
|
21169
|
-
return
|
|
21169
|
+
return me(r, (m) => {
|
|
21170
21170
|
m ? document.addEventListener("click", p, !0) : document.removeEventListener("click", p, !0);
|
|
21171
21171
|
}), (m, g) => (C(), M(ue, null, [
|
|
21172
21172
|
b("div", {
|
|
21173
21173
|
ref_key: "buttonRef",
|
|
21174
21174
|
ref: l
|
|
21175
21175
|
}, [
|
|
21176
|
-
F(t).showTextMenuButtons ? (C(),
|
|
21176
|
+
F(t).showTextMenuButtons ? (C(), ne(vr, {
|
|
21177
21177
|
key: 0,
|
|
21178
21178
|
title: "Link",
|
|
21179
21179
|
class: Me({ "wov-active": F(t).linkHref !== null }),
|
|
@@ -21191,7 +21191,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21191
21191
|
_: 1
|
|
21192
21192
|
}, 8, ["class"])) : j("", !0)
|
|
21193
21193
|
], 512),
|
|
21194
|
-
F(c) ? (C(),
|
|
21194
|
+
F(c) ? (C(), ne(ms, {
|
|
21195
21195
|
key: 0,
|
|
21196
21196
|
to: F(c)
|
|
21197
21197
|
}, [
|
|
@@ -21260,7 +21260,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21260
21260
|
function i(l) {
|
|
21261
21261
|
o.setColor(fs(l));
|
|
21262
21262
|
}
|
|
21263
|
-
return (l, a) => F(t).showTextMenuButtons ? (C(),
|
|
21263
|
+
return (l, a) => F(t).showTextMenuButtons ? (C(), ne(_t, {
|
|
21264
21264
|
key: 0,
|
|
21265
21265
|
title: "Text Color"
|
|
21266
21266
|
}, {
|
|
@@ -21335,10 +21335,10 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21335
21335
|
entityIds: {}
|
|
21336
21336
|
},
|
|
21337
21337
|
setup(n) {
|
|
21338
|
-
const e = n, { nextEditorTick: t } = Ae(), { state: o } = on(() => e.entityIds), r = [
|
|
21338
|
+
const e = n, { nextEditorTick: t } = Ae(), { state: o } = on(() => e.entityIds), r = [Ye.Top, Ye.Center, Ye.Bottom], s = no(() => e.entityIds, Ks), i = I(() => {
|
|
21339
21339
|
let a = null;
|
|
21340
21340
|
for (const c of s.value.values()) {
|
|
21341
|
-
const u = (c == null ? void 0 : c.value) ??
|
|
21341
|
+
const u = (c == null ? void 0 : c.value) ?? Ye.Top;
|
|
21342
21342
|
if (a === null)
|
|
21343
21343
|
a = u;
|
|
21344
21344
|
else if (a !== u)
|
|
@@ -21347,7 +21347,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21347
21347
|
return a;
|
|
21348
21348
|
});
|
|
21349
21349
|
function l() {
|
|
21350
|
-
const a = i.value ??
|
|
21350
|
+
const a = i.value ?? Ye.Top, c = r.indexOf(a), u = r[(c + 1) % r.length];
|
|
21351
21351
|
t((d) => {
|
|
21352
21352
|
for (const h of e.entityIds) {
|
|
21353
21353
|
const f = Ks.write(d, h);
|
|
@@ -21355,13 +21355,13 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21355
21355
|
}
|
|
21356
21356
|
});
|
|
21357
21357
|
}
|
|
21358
|
-
return (a, c) => F(o).showTextMenuButtons ? (C(),
|
|
21358
|
+
return (a, c) => F(o).showTextMenuButtons ? (C(), ne(vr, {
|
|
21359
21359
|
key: 0,
|
|
21360
21360
|
title: "Vertical Align",
|
|
21361
21361
|
onClick: l
|
|
21362
21362
|
}, {
|
|
21363
21363
|
default: se(() => [
|
|
21364
|
-
i.value === F(
|
|
21364
|
+
i.value === F(Ye).Top || i.value === null ? (C(), M("svg", gE, [...c[0] || (c[0] = [
|
|
21365
21365
|
b("rect", {
|
|
21366
21366
|
width: "14",
|
|
21367
21367
|
height: "6",
|
|
@@ -21377,7 +21377,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21377
21377
|
rx: "2"
|
|
21378
21378
|
}, null, -1),
|
|
21379
21379
|
b("path", { d: "M2 2h20" }, null, -1)
|
|
21380
|
-
])])) : i.value === F(
|
|
21380
|
+
])])) : i.value === F(Ye).Center ? (C(), M("svg", yE, [...c[1] || (c[1] = [
|
|
21381
21381
|
b("rect", {
|
|
21382
21382
|
width: "14",
|
|
21383
21383
|
height: "6",
|
|
@@ -21423,7 +21423,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21423
21423
|
setup(n) {
|
|
21424
21424
|
const e = n, { state: t } = on(() => e.entityIds), o = pe("containerRef"), { width: r } = n0(o), s = I(() => r.value > 0 && r.value < 600), i = B(/* @__PURE__ */ new Map());
|
|
21425
21425
|
return po(Xh, i), (l, a) => F(t).showTextMenuButtons ? (C(), M(ue, { key: 0 }, [
|
|
21426
|
-
s.value ? (C(),
|
|
21426
|
+
s.value ? (C(), ne(_t, {
|
|
21427
21427
|
key: 0,
|
|
21428
21428
|
title: "Text Formatting",
|
|
21429
21429
|
placement: "top"
|
|
@@ -21456,7 +21456,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21456
21456
|
a[2] || (a[2] = b("div", { class: "wov-text-group-spacer" }, null, -1)),
|
|
21457
21457
|
Z(yh, { entityIds: n.entityIds }, null, 8, ["entityIds"]),
|
|
21458
21458
|
Z(uh, { entityIds: n.entityIds }, null, 8, ["entityIds"]),
|
|
21459
|
-
n.showVerticalAlign ? (C(),
|
|
21459
|
+
n.showVerticalAlign ? (C(), ne(vh, {
|
|
21460
21460
|
key: 0,
|
|
21461
21461
|
entityIds: n.entityIds
|
|
21462
21462
|
}, null, 8, ["entityIds"])) : j("", !0)
|
|
@@ -21481,7 +21481,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21481
21481
|
}, null, -1)),
|
|
21482
21482
|
Z(yh, { entityIds: n.entityIds }, null, 8, ["entityIds"]),
|
|
21483
21483
|
Z(uh, { entityIds: n.entityIds }, null, 8, ["entityIds"]),
|
|
21484
|
-
n.showVerticalAlign ? (C(),
|
|
21484
|
+
n.showVerticalAlign ? (C(), ne(vh, {
|
|
21485
21485
|
key: 0,
|
|
21486
21486
|
entityIds: n.entityIds
|
|
21487
21487
|
}, null, 8, ["entityIds"])) : j("", !0)
|
|
@@ -21502,7 +21502,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21502
21502
|
}, o = I(() => ({
|
|
21503
21503
|
...t,
|
|
21504
21504
|
...e.background
|
|
21505
|
-
})), r =
|
|
21505
|
+
})), r = it(Re), s = it(Sn), i = pe("containerRef"), l = B({ width: 0, height: 0 });
|
|
21506
21506
|
let a = null;
|
|
21507
21507
|
const c = B(null);
|
|
21508
21508
|
let u = null;
|
|
@@ -21579,16 +21579,16 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21579
21579
|
else
|
|
21580
21580
|
break;
|
|
21581
21581
|
}
|
|
21582
|
-
const X = k * r.value.zoom, Y = w * r.value.zoom,
|
|
21582
|
+
const X = k * r.value.zoom, Y = w * r.value.zoom, oe = Math.max(1, Math.round(X)), ve = Math.max(1, Math.round(Y)), we = h(oe, ve, o.value);
|
|
21583
21583
|
if (!we) return;
|
|
21584
21584
|
we.setTransform(
|
|
21585
21585
|
new DOMMatrix().scale(
|
|
21586
|
-
X /
|
|
21586
|
+
X / oe,
|
|
21587
21587
|
Y / ve
|
|
21588
21588
|
)
|
|
21589
21589
|
);
|
|
21590
|
-
const $e = (V - E - k / 2) * r.value.zoom,
|
|
21591
|
-
v.save(), v.translate($e,
|
|
21590
|
+
const $e = (V - E - k / 2) * r.value.zoom, nt = (U - _ - w / 2) * r.value.zoom;
|
|
21591
|
+
v.save(), v.translate($e, nt), v.fillStyle = we, v.fillRect(
|
|
21592
21592
|
0,
|
|
21593
21593
|
0,
|
|
21594
21594
|
T + N * r.value.zoom,
|
|
@@ -21607,16 +21607,16 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21607
21607
|
else
|
|
21608
21608
|
break;
|
|
21609
21609
|
}
|
|
21610
|
-
const X = k * r.value.zoom, Y = w * r.value.zoom,
|
|
21610
|
+
const X = k * r.value.zoom, Y = w * r.value.zoom, oe = Math.max(1, Math.round(X)), ve = Math.max(1, Math.round(Y)), we = p(oe, ve, o.value);
|
|
21611
21611
|
if (!we) return;
|
|
21612
21612
|
we.setTransform(
|
|
21613
21613
|
new DOMMatrix().scale(
|
|
21614
|
-
X /
|
|
21614
|
+
X / oe,
|
|
21615
21615
|
Y / ve
|
|
21616
21616
|
)
|
|
21617
21617
|
);
|
|
21618
|
-
const $e = (V - E) * r.value.zoom,
|
|
21619
|
-
v.save(), v.translate($e,
|
|
21618
|
+
const $e = (V - E) * r.value.zoom, nt = (U - _) * r.value.zoom;
|
|
21619
|
+
v.save(), v.translate($e, nt), v.fillStyle = we, v.fillRect(
|
|
21620
21620
|
0,
|
|
21621
21621
|
0,
|
|
21622
21622
|
T + N * r.value.zoom,
|
|
@@ -21631,7 +21631,7 @@ const tE = { class: "wov-font-family-button" }, nE = { class: "wov-font-family-l
|
|
|
21631
21631
|
const { width: w, height: x } = l.value;
|
|
21632
21632
|
w === 0 || x === 0 || (v.width = w, v.height = x, k.clearRect(0, 0, w, x), k.fillStyle = o.value.color, k.fillRect(0, 0, w, x), o.value.kind === "dots" ? m(k) : o.value.kind === "grid" && g(k));
|
|
21633
21633
|
}
|
|
21634
|
-
return
|
|
21634
|
+
return me(
|
|
21635
21635
|
() => [o.value, r.value, s.value, l.value],
|
|
21636
21636
|
() => {
|
|
21637
21637
|
y();
|
|
@@ -21817,17 +21817,17 @@ const ME = /* @__PURE__ */ q({
|
|
|
21817
21817
|
class: "wov-floating-menu-bar",
|
|
21818
21818
|
onMouseleave: a
|
|
21819
21819
|
}, [
|
|
21820
|
-
(C(!0), M(ue, null, Ee(l.value, (d) =>
|
|
21820
|
+
(C(!0), M(ue, null, Ee(l.value, (d) => ge(c.$slots, `button:${d}`, {
|
|
21821
21821
|
key: d,
|
|
21822
21822
|
entityIds: F(r)
|
|
21823
21823
|
})), 128)),
|
|
21824
|
-
F(s).has("color") ?
|
|
21824
|
+
F(s).has("color") ? ge(c.$slots, "button:color", {
|
|
21825
21825
|
key: 0,
|
|
21826
21826
|
entityIds: F(r)
|
|
21827
21827
|
}, () => [
|
|
21828
21828
|
Z(sT, { entityIds: F(r) }, null, 8, ["entityIds"])
|
|
21829
21829
|
]) : j("", !0),
|
|
21830
|
-
F(s).has("shape") ?
|
|
21830
|
+
F(s).has("shape") ? ge(c.$slots, "button:shape", {
|
|
21831
21831
|
key: 1,
|
|
21832
21832
|
entityIds: F(r)
|
|
21833
21833
|
}, () => [
|
|
@@ -21835,36 +21835,36 @@ const ME = /* @__PURE__ */ q({
|
|
|
21835
21835
|
Z(gT, { entityIds: F(r) }, null, 8, ["entityIds"]),
|
|
21836
21836
|
Z(RT, { entityIds: F(r) }, null, 8, ["entityIds"])
|
|
21837
21837
|
]) : j("", !0),
|
|
21838
|
-
F(s).has("penStroke") ?
|
|
21838
|
+
F(s).has("penStroke") ? ge(c.$slots, "button:penStroke", {
|
|
21839
21839
|
key: 2,
|
|
21840
21840
|
entityIds: F(r)
|
|
21841
21841
|
}, () => [
|
|
21842
21842
|
Z(cT, { entityIds: F(r) }, null, 8, ["entityIds"])
|
|
21843
21843
|
]) : j("", !0),
|
|
21844
21844
|
F(s).has("elbowArrow") || F(s).has("arcArrow") ? (C(), M(ue, { key: 3 }, [
|
|
21845
|
-
|
|
21845
|
+
ge(c.$slots, "button:arrowThickness", { entityIds: F(r) }, () => [
|
|
21846
21846
|
Z(KC, { entityIds: F(r) }, null, 8, ["entityIds"])
|
|
21847
21847
|
]),
|
|
21848
|
-
|
|
21848
|
+
ge(c.$slots, "button:arrowHeadStart", { entityIds: F(r) }, () => [
|
|
21849
21849
|
Z(ah, {
|
|
21850
21850
|
entityIds: F(r),
|
|
21851
21851
|
side: "start"
|
|
21852
21852
|
}, null, 8, ["entityIds"])
|
|
21853
21853
|
]),
|
|
21854
|
-
|
|
21854
|
+
ge(c.$slots, "button:arrowHeadEnd", { entityIds: F(r) }, () => [
|
|
21855
21855
|
Z(ah, {
|
|
21856
21856
|
entityIds: F(r),
|
|
21857
21857
|
side: "end"
|
|
21858
21858
|
}, null, 8, ["entityIds"])
|
|
21859
21859
|
])
|
|
21860
21860
|
], 64)) : j("", !0),
|
|
21861
|
-
F(s).has("tape") ?
|
|
21861
|
+
F(s).has("tape") ? ge(c.$slots, "button:tape", {
|
|
21862
21862
|
key: 4,
|
|
21863
21863
|
entityIds: F(r)
|
|
21864
21864
|
}, () => [
|
|
21865
21865
|
Z(BT, { entityIds: F(r) }, null, 8, ["entityIds"])
|
|
21866
21866
|
]) : j("", !0),
|
|
21867
|
-
F(s).has("text") ?
|
|
21867
|
+
F(s).has("text") ? ge(c.$slots, "button:text", {
|
|
21868
21868
|
key: 5,
|
|
21869
21869
|
entityIds: F(r)
|
|
21870
21870
|
}, () => [
|
|
@@ -21878,7 +21878,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
21878
21878
|
}), AE = { class: "wov-floating-menu-inner" }, IE = /* @__PURE__ */ q({
|
|
21879
21879
|
__name: "FloatingMenu",
|
|
21880
21880
|
setup(n) {
|
|
21881
|
-
const e = pe(je), t = cS([ie, Qi]), o =
|
|
21881
|
+
const e = pe(je), t = cS([ie, Qi]), o = it(Re), r = it(eo), s = it(el), i = hr(), l = I(
|
|
21882
21882
|
() => t.value.map((T) => T.entityId)
|
|
21883
21883
|
), a = I(() => {
|
|
21884
21884
|
const T = e == null ? void 0 : e.getEditor();
|
|
@@ -21977,11 +21977,11 @@ const ME = /* @__PURE__ */ q({
|
|
|
21977
21977
|
() => t.value.length > 0 && !y.value && !v.includes(s.value.state)
|
|
21978
21978
|
), w = B(!1);
|
|
21979
21979
|
let x;
|
|
21980
|
-
return
|
|
21980
|
+
return me(k, (T) => {
|
|
21981
21981
|
clearTimeout(x), T ? x = setTimeout(() => {
|
|
21982
21982
|
w.value = !0;
|
|
21983
21983
|
}, 40) : w.value = !1;
|
|
21984
|
-
}, { immediate: !0 }), (T, S) => (C(),
|
|
21984
|
+
}, { immediate: !0 }), (T, S) => (C(), ne(Mc, { name: "wov-fade" }, {
|
|
21985
21985
|
default: se(() => [
|
|
21986
21986
|
w.value ? (C(), M("div", {
|
|
21987
21987
|
key: 0,
|
|
@@ -21991,7 +21991,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
21991
21991
|
style: ye(F(g))
|
|
21992
21992
|
}, [
|
|
21993
21993
|
b("div", AE, [
|
|
21994
|
-
|
|
21994
|
+
ge(T.$slots, "default", {}, () => [
|
|
21995
21995
|
Z(ME)
|
|
21996
21996
|
])
|
|
21997
21997
|
])
|
|
@@ -22018,7 +22018,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22018
22018
|
}, 100);
|
|
22019
22019
|
}), Le(() => {
|
|
22020
22020
|
o !== null && clearInterval(o);
|
|
22021
|
-
}), (r, s) => (C(),
|
|
22021
|
+
}), (r, s) => (C(), ne(Mc, { name: "wov-loading-fade" }, {
|
|
22022
22022
|
default: se(() => [
|
|
22023
22023
|
n.isLoading ? (C(), M("div", OE, [
|
|
22024
22024
|
b("div", _E, Ne(e.value), 1)
|
|
@@ -22163,7 +22163,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22163
22163
|
onMouseenter: d,
|
|
22164
22164
|
onMouseleave: h
|
|
22165
22165
|
}, [
|
|
22166
|
-
|
|
22166
|
+
ge(f.$slots, "default")
|
|
22167
22167
|
], 34));
|
|
22168
22168
|
}
|
|
22169
22169
|
}), PE = '<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4.35 4.75" width="20" height="20"><defs><style>.cls-1{stroke:#fff;stroke-miterlimit:10;stroke-width:.25px;}</style></defs><path class="cls-1" d="M2.39,2.88s-.04.01-.05.02c-.01,0-.02.01-.03.02,0,.01-.02.02-.03.05l-.77,1.44c-.07.13-.1.19-.14.2-.03.01-.07,0-.1-.01-.03-.02-.05-.09-.09-.23L.16.41c-.03-.13-.05-.19-.03-.23.02-.03.04-.05.08-.06.04,0,.1.02.21.08l3.59,1.94c.13.07.19.1.2.14.01.03,0,.07-.01.1-.02.03-.09.05-.23.09l-1.58.4Z"/></svg>', LE = '<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4.08 4.75" width="24" height="24"><defs><style>.cls-1{fill:#fff;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:.25px;}.cls-2{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:.51px;}</style></defs><path class="cls-1" d="M.89,2.25v.63M.89,2.25V.75c0-.21.17-.38.38-.38s.38.17.38.38M.89,2.25c0-.21-.17-.37-.38-.37s-.38.17-.38.37v.5c0,1.04.86,1.87,1.91,1.87s1.91-.84,1.91-1.87v-1.25c0-.21-.17-.38-.38-.38s-.38.17.38.38M1.66.75v1.38M1.66.75v-.25c0-.21.17-.38.38-.38s.38.17.38.38v.25M2.42.75v1.38M2.42.75c0-.21.17-.38.38-.38s.38.17.38.38v.75M3.19,1.5v.63"/><line class="cls-2" x1="2.8" y1=".77" x2="2.8" y2="2.03"/><line class="cls-2" x1="2.04" y1=".64" x2="2.04" y2="2.02"/><line class="cls-2" x1="1.27" y1=".84" x2="1.27" y2="2.29"/></svg>', $E = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 8v-2a2 2 0 0 1 2 -2h2" /><path d="M4 16v2a2 2 0 0 0 2 2h2" /><path d="M16 4h2a2 2 0 0 1 2 2v2" /><path d="M16 20h2a2 2 0 0 0 2 -2v-2" /><path d="M9 12l6 0" /><path d="M12 9l0 6" /></svg>', bo = {
|
|
@@ -22193,11 +22193,11 @@ const ME = /* @__PURE__ */ q({
|
|
|
22193
22193
|
__name: "SelectTool",
|
|
22194
22194
|
setup(n) {
|
|
22195
22195
|
const { nextEditorTick: e } = Ae(), { activeTool: t } = Cu();
|
|
22196
|
-
return
|
|
22196
|
+
return me(t, (o, r) => {
|
|
22197
22197
|
r === "select" && e((s) => {
|
|
22198
22198
|
Oc.spawn(s);
|
|
22199
22199
|
});
|
|
22200
|
-
}), (o, r) => (C(),
|
|
22200
|
+
}), (o, r) => (C(), ne(Wt, {
|
|
22201
22201
|
name: "select",
|
|
22202
22202
|
tooltip: "Select",
|
|
22203
22203
|
cursor: F(bo).Select
|
|
@@ -22220,7 +22220,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22220
22220
|
}), HE = /* @__PURE__ */ q({
|
|
22221
22221
|
__name: "HandTool",
|
|
22222
22222
|
setup(n) {
|
|
22223
|
-
return (e, t) => (C(),
|
|
22223
|
+
return (e, t) => (C(), ne(Wt, {
|
|
22224
22224
|
name: "hand",
|
|
22225
22225
|
tooltip: "Hand",
|
|
22226
22226
|
cursor: F(bo).Hand
|
|
@@ -22258,10 +22258,10 @@ const ME = /* @__PURE__ */ q({
|
|
|
22258
22258
|
...e.getDefaults("text")
|
|
22259
22259
|
},
|
|
22260
22260
|
verticalAlign: {
|
|
22261
|
-
value:
|
|
22261
|
+
value: Ye.Center
|
|
22262
22262
|
}
|
|
22263
22263
|
}));
|
|
22264
|
-
return (o, r) => (C(),
|
|
22264
|
+
return (o, r) => (C(), ne(Wt, {
|
|
22265
22265
|
name: "sticky-note",
|
|
22266
22266
|
tooltip: "Sticky Note",
|
|
22267
22267
|
"drag-out-snapshot": t.value,
|
|
@@ -22307,10 +22307,10 @@ const ME = /* @__PURE__ */ q({
|
|
|
22307
22307
|
...e.getDefaults("text")
|
|
22308
22308
|
},
|
|
22309
22309
|
verticalAlign: {
|
|
22310
|
-
value:
|
|
22310
|
+
value: Ye.Center
|
|
22311
22311
|
}
|
|
22312
22312
|
}));
|
|
22313
|
-
return (o, r) => (C(),
|
|
22313
|
+
return (o, r) => (C(), ne(Wt, {
|
|
22314
22314
|
name: "shape",
|
|
22315
22315
|
tooltip: "Shape",
|
|
22316
22316
|
"drag-out-snapshot": t.value,
|
|
@@ -22338,7 +22338,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22338
22338
|
}), jE = /* @__PURE__ */ q({
|
|
22339
22339
|
__name: "EraserTool",
|
|
22340
22340
|
setup(n) {
|
|
22341
|
-
return (e, t) => (C(),
|
|
22341
|
+
return (e, t) => (C(), ne(Wt, {
|
|
22342
22342
|
name: "eraser",
|
|
22343
22343
|
tooltip: "Eraser"
|
|
22344
22344
|
}, {
|
|
@@ -22357,7 +22357,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22357
22357
|
}), UE = /* @__PURE__ */ q({
|
|
22358
22358
|
__name: "PenTool",
|
|
22359
22359
|
setup(n) {
|
|
22360
|
-
return (e, t) => (C(),
|
|
22360
|
+
return (e, t) => (C(), ne(Wt, {
|
|
22361
22361
|
name: "pen",
|
|
22362
22362
|
tooltip: "Pen"
|
|
22363
22363
|
}, {
|
|
@@ -22407,7 +22407,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22407
22407
|
...e.getDefaults("text")
|
|
22408
22408
|
}
|
|
22409
22409
|
}));
|
|
22410
|
-
return (r, s) => (C(),
|
|
22410
|
+
return (r, s) => (C(), ne(Wt, {
|
|
22411
22411
|
name: "text",
|
|
22412
22412
|
tooltip: "Text",
|
|
22413
22413
|
"drag-out-snapshot": o.value,
|
|
@@ -22445,12 +22445,12 @@ const ME = /* @__PURE__ */ q({
|
|
|
22445
22445
|
elbowArrow: {
|
|
22446
22446
|
points: [0, 0, 0.5, 0, 0.5, 1, 1, 1],
|
|
22447
22447
|
pointCount: 4,
|
|
22448
|
-
startArrowHead:
|
|
22449
|
-
endArrowHead:
|
|
22448
|
+
startArrowHead: Xe.None,
|
|
22449
|
+
endArrowHead: Xe.V
|
|
22450
22450
|
},
|
|
22451
22451
|
connector: {}
|
|
22452
22452
|
});
|
|
22453
|
-
return (t, o) => (C(),
|
|
22453
|
+
return (t, o) => (C(), ne(Wt, {
|
|
22454
22454
|
name: "elbow-arrow",
|
|
22455
22455
|
tooltip: "Elbow Arrow",
|
|
22456
22456
|
cursor: "crosshair",
|
|
@@ -22714,12 +22714,12 @@ const ME = /* @__PURE__ */ q({
|
|
|
22714
22714
|
}
|
|
22715
22715
|
const V = await e(), U = Re.read(V), ee = eo.read(V), J = U.left + ee.width / U.zoom / 2, X = U.top + ee.height / U.zoom / 2, Y = Sn.read(V);
|
|
22716
22716
|
Y.enabled && (N = Math.max(Y.colWidth, Math.round(N / Y.colWidth) * Y.colWidth), H = Math.max(Y.rowHeight, Math.round(H / Y.rowHeight) * Y.rowHeight));
|
|
22717
|
-
const
|
|
22718
|
-
Fe(V,
|
|
22719
|
-
const ve = ie.write(V,
|
|
22720
|
-
ve.tag = "embed", ve.position[0] = J - N / 2, ve.position[1] = X - H / 2, ve.size[0] = N, ve.size[1] = H, Sn.snapPosition(V, ve.position), Fe(V,
|
|
22721
|
-
const we = Ea.write(V,
|
|
22722
|
-
we.url = E, we.embedUrl = D, we.provider = _, Fe(V,
|
|
22717
|
+
const oe = Zi(V);
|
|
22718
|
+
Fe(V, oe, ie);
|
|
22719
|
+
const ve = ie.write(V, oe);
|
|
22720
|
+
ve.tag = "embed", ve.position[0] = J - N / 2, ve.position[1] = X - H / 2, ve.size[0] = N, ve.size[1] = H, Sn.snapPosition(V, ve.position), Fe(V, oe, Ea);
|
|
22721
|
+
const we = Ea.write(V, oe);
|
|
22722
|
+
we.url = E, we.embedUrl = D, we.provider = _, Fe(V, oe, $h, {
|
|
22723
22723
|
id: crypto.randomUUID()
|
|
22724
22724
|
}), a.value = !1, c.value = null, u.value = "", r("select", {
|
|
22725
22725
|
cursor: bo.Select
|
|
@@ -22732,7 +22732,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22732
22732
|
const _ = E.target;
|
|
22733
22733
|
s.value && !s.value.contains(_) && i.value && !i.value.contains(_) && (a.value = !1);
|
|
22734
22734
|
}
|
|
22735
|
-
|
|
22735
|
+
me(a, (E) => {
|
|
22736
22736
|
E ? document.addEventListener("click", x, !0) : document.removeEventListener("click", x, !0);
|
|
22737
22737
|
});
|
|
22738
22738
|
function T() {
|
|
@@ -22767,7 +22767,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22767
22767
|
b("path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" })
|
|
22768
22768
|
], -1)
|
|
22769
22769
|
])], 34),
|
|
22770
|
-
F(h) ? (C(),
|
|
22770
|
+
F(h) ? (C(), ne(ms, {
|
|
22771
22771
|
key: 0,
|
|
22772
22772
|
to: F(h)
|
|
22773
22773
|
}, [
|
|
@@ -22932,7 +22932,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22932
22932
|
uploadState: "complete"
|
|
22933
22933
|
}
|
|
22934
22934
|
});
|
|
22935
|
-
return (t, o) => (C(),
|
|
22935
|
+
return (t, o) => (C(), ne(Wt, {
|
|
22936
22936
|
name: "tape",
|
|
22937
22937
|
tooltip: "Tape",
|
|
22938
22938
|
"drag-out-snapshot": F(e)
|
|
@@ -22998,7 +22998,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
22998
22998
|
label: "Frame"
|
|
22999
22999
|
}
|
|
23000
23000
|
}));
|
|
23001
|
-
return (t, o) => (C(),
|
|
23001
|
+
return (t, o) => (C(), ne(Wt, {
|
|
23002
23002
|
name: "frame",
|
|
23003
23003
|
tooltip: "Frame",
|
|
23004
23004
|
"drag-out-snapshot": e.value,
|
|
@@ -23025,7 +23025,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
23025
23025
|
}), mM = { class: "wov-toolbar-container" }, gM = /* @__PURE__ */ q({
|
|
23026
23026
|
__name: "Toolbar",
|
|
23027
23027
|
setup(n) {
|
|
23028
|
-
const e = jh(), { reset: t } = oo(), { nextEditorTick: o } = Ae(), r = B(null), s = B(null), i =
|
|
23028
|
+
const e = jh(), { reset: t } = oo(), { nextEditorTick: o } = Ae(), r = B(null), s = B(null), i = it(zt), l = I(() => i.value.activeToolName), a = [
|
|
23029
23029
|
FE,
|
|
23030
23030
|
HE,
|
|
23031
23031
|
KE,
|
|
@@ -23049,23 +23049,23 @@ const ME = /* @__PURE__ */ q({
|
|
|
23049
23049
|
m.value = X.length;
|
|
23050
23050
|
const Y = getComputedStyle(h.value);
|
|
23051
23051
|
y.value = parseFloat(Y.gap) || 8;
|
|
23052
|
-
const
|
|
23053
|
-
v.value =
|
|
23052
|
+
const oe = ((ve = f.value) == null ? void 0 : ve.offsetWidth) || 40;
|
|
23053
|
+
v.value = oe + y.value, g.value = X.map((we) => we.offsetWidth);
|
|
23054
23054
|
}
|
|
23055
23055
|
function T() {
|
|
23056
23056
|
if (g.value.length === 0) return;
|
|
23057
|
-
const
|
|
23058
|
-
let $e = 0,
|
|
23057
|
+
const oe = k.value - 40 - 20, ve = y.value, we = v.value;
|
|
23058
|
+
let $e = 0, nt = 0;
|
|
23059
23059
|
for (let bt = 0; bt < g.value.length; bt++) {
|
|
23060
23060
|
const Nt = g.value[bt], sn = $e > 0 ? Nt + ve : Nt, Rt = g.value.length - bt - 1 > 0 ? we : 0;
|
|
23061
|
-
if ($e + sn + Rt <=
|
|
23062
|
-
$e += sn,
|
|
23061
|
+
if ($e + sn + Rt <= oe)
|
|
23062
|
+
$e += sn, nt++;
|
|
23063
23063
|
else
|
|
23064
23064
|
break;
|
|
23065
23065
|
}
|
|
23066
|
-
p.value = Math.max(1,
|
|
23066
|
+
p.value = Math.max(1, nt);
|
|
23067
23067
|
}
|
|
23068
|
-
|
|
23068
|
+
me(k, () => {
|
|
23069
23069
|
g.value.length > 0 && T();
|
|
23070
23070
|
}), kt(() => {
|
|
23071
23071
|
Gn(() => {
|
|
@@ -23074,13 +23074,13 @@ const ME = /* @__PURE__ */ q({
|
|
|
23074
23074
|
});
|
|
23075
23075
|
const S = I(() => p.value < m.value);
|
|
23076
23076
|
Ws(() => {
|
|
23077
|
-
w().forEach((Y,
|
|
23078
|
-
Y.style.display =
|
|
23077
|
+
w().forEach((Y, oe) => {
|
|
23078
|
+
Y.style.display = oe < p.value ? "" : "none";
|
|
23079
23079
|
});
|
|
23080
23080
|
}), Ws(() => {
|
|
23081
23081
|
if (!u.value) return;
|
|
23082
|
-
Array.from(u.value.children).forEach((Y,
|
|
23083
|
-
Y.style.display =
|
|
23082
|
+
Array.from(u.value.children).forEach((Y, oe) => {
|
|
23083
|
+
Y.style.display = oe >= p.value ? "" : "none";
|
|
23084
23084
|
});
|
|
23085
23085
|
});
|
|
23086
23086
|
const { floatingStyles: E } = yr(f, u, {
|
|
@@ -23098,22 +23098,22 @@ const ME = /* @__PURE__ */ q({
|
|
|
23098
23098
|
const Y = X.target;
|
|
23099
23099
|
f.value && !f.value.contains(Y) && u.value && !u.value.contains(Y) && O();
|
|
23100
23100
|
}
|
|
23101
|
-
|
|
23101
|
+
me(d, (X) => {
|
|
23102
23102
|
X ? document.addEventListener("click", D, !0) : document.removeEventListener("click", D, !0);
|
|
23103
|
-
}),
|
|
23103
|
+
}), me(S, (X) => {
|
|
23104
23104
|
X || O();
|
|
23105
23105
|
});
|
|
23106
23106
|
function N(X, Y) {
|
|
23107
|
-
const { snapshot:
|
|
23108
|
-
s.value =
|
|
23109
|
-
const
|
|
23110
|
-
|
|
23107
|
+
const { snapshot: oe, drawSnapshot: ve, cursor: we } = Y ?? {};
|
|
23108
|
+
s.value = oe ?? ve ?? null, o(($e) => {
|
|
23109
|
+
const nt = zt.write($e);
|
|
23110
|
+
nt.activeToolName = X, ve ? (nt.leftMouseTool = "draw", nt.heldSnapshot = ve) : (nt.leftMouseTool = X, nt.heldSnapshot = oe ?? ""), we && Nc.setCursor($e, we);
|
|
23111
23111
|
});
|
|
23112
23112
|
}
|
|
23113
23113
|
function H(X) {
|
|
23114
23114
|
o((Y) => {
|
|
23115
|
-
const
|
|
23116
|
-
|
|
23115
|
+
const oe = zt.write(Y);
|
|
23116
|
+
oe.leftMouseTool = "drag-out", oe.heldSnapshot = X;
|
|
23117
23117
|
});
|
|
23118
23118
|
}
|
|
23119
23119
|
function V(X, Y) {
|
|
@@ -23140,7 +23140,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
23140
23140
|
class: "wov-toolbar",
|
|
23141
23141
|
onMouseleave: ee
|
|
23142
23142
|
}, [
|
|
23143
|
-
F(e).default ?
|
|
23143
|
+
F(e).default ? ge(X.$slots, "default", { key: 0 }) : (C(), M(ue, { key: 1 }, Ee(a, (oe, ve) => Z(xa(oe), { key: ve })), 64)),
|
|
23144
23144
|
S.value ? (C(), M("button", {
|
|
23145
23145
|
key: 2,
|
|
23146
23146
|
ref_key: "overflowBtnRef",
|
|
@@ -23169,7 +23169,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
23169
23169
|
], -1)
|
|
23170
23170
|
])], 2)) : j("", !0)
|
|
23171
23171
|
], 544),
|
|
23172
|
-
F(c) ? (C(),
|
|
23172
|
+
F(c) ? (C(), ne(ms, {
|
|
23173
23173
|
key: 0,
|
|
23174
23174
|
to: F(c)
|
|
23175
23175
|
}, [
|
|
@@ -23180,7 +23180,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
23180
23180
|
class: "wov-toolbar-overflow-menu",
|
|
23181
23181
|
style: ye(F(E))
|
|
23182
23182
|
}, [
|
|
23183
|
-
F(e).default ?
|
|
23183
|
+
F(e).default ? ge(X.$slots, "default", { key: 0 }) : (C(), M(ue, { key: 1 }, Ee(a, (oe, ve) => Z(xa(oe), { key: ve })), 64))
|
|
23184
23184
|
], 4)) : j("", !0)
|
|
23185
23185
|
], 8, ["to"])) : j("", !0)
|
|
23186
23186
|
]));
|
|
@@ -23188,7 +23188,7 @@ const ME = /* @__PURE__ */ q({
|
|
|
23188
23188
|
}), zA = /* @__PURE__ */ q({
|
|
23189
23189
|
__name: "ArcArrowTool",
|
|
23190
23190
|
setup(n) {
|
|
23191
|
-
return (e, t) => (C(),
|
|
23191
|
+
return (e, t) => (C(), ne(Wt, {
|
|
23192
23192
|
name: "arc-arrow",
|
|
23193
23193
|
tooltip: "Arc Arrow",
|
|
23194
23194
|
cursor: "crosshair"
|
|
@@ -23597,21 +23597,32 @@ var LM = class {
|
|
|
23597
23597
|
}
|
|
23598
23598
|
}
|
|
23599
23599
|
/**
|
|
23600
|
-
*
|
|
23601
|
-
*
|
|
23602
|
-
*
|
|
23600
|
+
* (Re)attempt every persisted upload that isn't already in flight.
|
|
23601
|
+
*
|
|
23602
|
+
* Call this after initialization AND whenever connectivity is regained — it is
|
|
23603
|
+
* the single entry point for "drain whatever is still pending now". It is
|
|
23604
|
+
* idempotent and safe to call repeatedly:
|
|
23605
|
+
* - uploads already in flight are skipped (no duplicate attempts),
|
|
23606
|
+
* - the local preview is only re-created when we don't already hold it (so a
|
|
23607
|
+
* same-session reconnect keeps its live blob URL instead of leaking a new one),
|
|
23608
|
+
* - each job's retry budget is reset, so an upload that exhausted its retries
|
|
23609
|
+
* during a long offline spell tries again instead of staying failed until reload.
|
|
23610
|
+
*
|
|
23611
|
+
* Note: resumed uploads have no promise to resolve since the original upload()
|
|
23612
|
+
* caller (if any) is from a previous session or has already settled.
|
|
23603
23613
|
*/
|
|
23604
23614
|
async resumePendingUploads() {
|
|
23605
23615
|
if (!this.jobsStore || !this.binariesStore)
|
|
23606
23616
|
throw new Error("AssetManager not initialized");
|
|
23607
23617
|
const n = await this.jobsStore.getAllEntries();
|
|
23608
|
-
for (const [e] of n) {
|
|
23609
|
-
|
|
23610
|
-
if (
|
|
23611
|
-
const
|
|
23612
|
-
this.blobUrls.set(e,
|
|
23618
|
+
for (const [e, t] of n) {
|
|
23619
|
+
if (this.uploading.has(e)) continue;
|
|
23620
|
+
if (!this.blobUrls.has(e)) {
|
|
23621
|
+
const r = await this.binariesStore.get(e);
|
|
23622
|
+
r && this.blobUrls.set(e, URL.createObjectURL(r));
|
|
23613
23623
|
}
|
|
23614
|
-
|
|
23624
|
+
const o = t;
|
|
23625
|
+
o != null && o.retryCount && await this.jobsStore.put(e, { ...o, retryCount: 0 }), this.startUpload(e);
|
|
23615
23626
|
}
|
|
23616
23627
|
}
|
|
23617
23628
|
/**
|
|
@@ -23744,16 +23755,16 @@ const HM = /* @__PURE__ */ q({
|
|
|
23744
23755
|
},
|
|
23745
23756
|
setup(n) {
|
|
23746
23757
|
const e = n, t = _e(e.entityId, Zo), o = _e(e.entityId, Ks), r = B(null), s = {
|
|
23747
|
-
[
|
|
23748
|
-
[
|
|
23749
|
-
[
|
|
23758
|
+
[Ye.Top]: "flex-start",
|
|
23759
|
+
[Ye.Center]: "center",
|
|
23760
|
+
[Ye.Bottom]: "flex-end"
|
|
23750
23761
|
}, i = I(() => {
|
|
23751
23762
|
var a;
|
|
23752
23763
|
return {
|
|
23753
23764
|
backgroundColor: t.value ? `rgb(${t.value.red}, ${t.value.green}, ${t.value.blue})` : void 0,
|
|
23754
23765
|
// Min-height = block width to maintain square minimum
|
|
23755
23766
|
minHeight: `${e.block.size[0]}px`,
|
|
23756
|
-
alignItems: s[((a = o.value) == null ? void 0 : a.value) ??
|
|
23767
|
+
alignItems: s[((a = o.value) == null ? void 0 : a.value) ?? Ye.Top]
|
|
23757
23768
|
};
|
|
23758
23769
|
}), { handleEditEnd: l } = Wg({
|
|
23759
23770
|
blockData: e,
|
|
@@ -23799,7 +23810,7 @@ const HM = /* @__PURE__ */ q({
|
|
|
23799
23810
|
state: gn.string().max(16).default(Pt.Idle),
|
|
23800
23811
|
activeEntity: gn.ref(),
|
|
23801
23812
|
pointingStartWorld: gn.tuple(gn.float64(), 2).default([0, 0])
|
|
23802
|
-
}), Ch =
|
|
23813
|
+
}), Ch = ct((n) => n.with(_c));
|
|
23803
23814
|
function Th(n, e, t, o, r) {
|
|
23804
23815
|
const s = ds(n, e, t);
|
|
23805
23816
|
Js.spawn(n, { entityId: s });
|
|
@@ -23883,9 +23894,9 @@ const jM = tl({ phase: "capture" }, (n) => {
|
|
|
23883
23894
|
const { getDefaults: p } = Oo(n, Ro), m = $g(f, p), { editor: g } = cr(n);
|
|
23884
23895
|
if (!(m.block.tag in g.blockDefs)) return;
|
|
23885
23896
|
const y = ds(n, m, r.worldPosition);
|
|
23886
|
-
if (Js.spawn(n, { entityId: y }), ze(n, y,
|
|
23897
|
+
if (Js.spawn(n, { entityId: y }), ze(n, y, st) && !st.read(n, y).fontFamily) {
|
|
23887
23898
|
const w = (h = g.fonts[0]) == null ? void 0 : h.name;
|
|
23888
|
-
w && (
|
|
23899
|
+
w && (st.write(n, y).fontFamily = w);
|
|
23889
23900
|
}
|
|
23890
23901
|
Fe(n, y, Qi, {}), Ac(n, m.block.tag) && Fe(n, y, Ic, {});
|
|
23891
23902
|
const v = qr.write(n);
|
|
@@ -26387,7 +26398,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26387
26398
|
},
|
|
26388
26399
|
setup(n) {
|
|
26389
26400
|
const e = n, t = pe("containerRef", B(null));
|
|
26390
|
-
return iS(t, e.options), (o, r) =>
|
|
26401
|
+
return iS(t, e.options), (o, r) => ge(o.$slots, "default");
|
|
26391
26402
|
}
|
|
26392
26403
|
}), yA = { class: "wov-user-cursors" }, vA = {
|
|
26393
26404
|
class: "wov-cursor-svg",
|
|
@@ -26467,7 +26478,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26467
26478
|
}), EA = /* @__PURE__ */ q({
|
|
26468
26479
|
__name: "BackToContentButton",
|
|
26469
26480
|
setup(n) {
|
|
26470
|
-
const { nextEditorTick: e } = Ae(), t =
|
|
26481
|
+
const { nextEditorTick: e } = Ae(), t = it(Re), o = ct((c) => c.with(Et, ie, Ko)), r = B(0), s = pe(je);
|
|
26471
26482
|
if (s) {
|
|
26472
26483
|
const c = s.registerTickCallback((u) => {
|
|
26473
26484
|
o.addedOrRemoved(u).length > 0 && (r.value = o.current(u).length);
|
|
@@ -26584,7 +26595,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26584
26595
|
embed: Zy,
|
|
26585
26596
|
tape: LS,
|
|
26586
26597
|
frame: wv
|
|
26587
|
-
}, s =
|
|
26598
|
+
}, s = ct((A) => A.tracking(ie)), i = ct((A) => A.with(vn)), l = ct((A) => A.with(ie).tracking(rd)), a = ct((A) => A.with(ie).tracking(Qi)), c = ct((A) => A.with(ie).tracking(_a)), u = ct((A) => A.with(ie).tracking(iy)), d = ct((A) => A.with(ie).tracking(_c)), h = ct((A) => A.with(ie).tracking(sd)), f = ct((A) => A.tracking(Ll)), p = ct((A) => A.tracking(ly)), m = n, g = I(() => new Set(m.omitBlockTags ?? [])), y = [
|
|
26588
26599
|
{ stratum: "background", class: "wov-canvas-background" },
|
|
26589
26600
|
{ stratum: "content", class: "wov-canvas-content" },
|
|
26590
26601
|
{ stratum: "overlay", class: "wov-canvas-overlay" }
|
|
@@ -26605,7 +26616,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26605
26616
|
}
|
|
26606
26617
|
V.value = U.value;
|
|
26607
26618
|
}
|
|
26608
|
-
const X = B(!1), Y = B(!m.initialState),
|
|
26619
|
+
const X = B(!1), Y = B(!m.initialState), oe = Te(Re.default());
|
|
26609
26620
|
function ve(A, W, L) {
|
|
26610
26621
|
let K = _.get(A);
|
|
26611
26622
|
K || (K = /* @__PURE__ */ new Map(), _.set(A, K));
|
|
@@ -26619,10 +26630,10 @@ const gA = /* @__PURE__ */ q({
|
|
|
26619
26630
|
if (!$) return;
|
|
26620
26631
|
const R = $.get(L.name);
|
|
26621
26632
|
if (!R || R.size === 0) return;
|
|
26622
|
-
let
|
|
26623
|
-
K || (
|
|
26633
|
+
let te = null;
|
|
26634
|
+
K || (te = L.snapshot(A, W));
|
|
26624
26635
|
for (const fe of R)
|
|
26625
|
-
fe(
|
|
26636
|
+
fe(te);
|
|
26626
26637
|
}
|
|
26627
26638
|
function $e(A, W) {
|
|
26628
26639
|
let L = O.get(A);
|
|
@@ -26630,7 +26641,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26630
26641
|
L.delete(W), L.size === 0 && O.delete(A);
|
|
26631
26642
|
};
|
|
26632
26643
|
}
|
|
26633
|
-
function
|
|
26644
|
+
function nt(A, W) {
|
|
26634
26645
|
const L = O.get(W.name);
|
|
26635
26646
|
if (!L || L.size === 0) return;
|
|
26636
26647
|
const K = W.snapshot(A);
|
|
@@ -26651,7 +26662,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26651
26662
|
const Lo = {
|
|
26652
26663
|
hasEntity: (A) => T.has(A),
|
|
26653
26664
|
getEditor: () => w.value,
|
|
26654
|
-
getAssetManager: () =>
|
|
26665
|
+
getAssetManager: () => Ke,
|
|
26655
26666
|
getSessionId: Nt,
|
|
26656
26667
|
getUserBySessionId: sn,
|
|
26657
26668
|
subscribeComponent: ve,
|
|
@@ -26672,9 +26683,9 @@ const gA = /* @__PURE__ */ q({
|
|
|
26672
26683
|
var W;
|
|
26673
26684
|
(W = w.value) == null || W.nextTick(A);
|
|
26674
26685
|
});
|
|
26675
|
-
let ro = 0, Rt = null,
|
|
26686
|
+
let ro = 0, Rt = null, ht = null;
|
|
26676
26687
|
const A0 = ((Yu = (Gu = m.store) == null ? void 0 : Gu.persistence) == null ? void 0 : Yu.documentId) ?? "default";
|
|
26677
|
-
let
|
|
26688
|
+
let Ke = new $M({
|
|
26678
26689
|
provider: m.assetProvider ?? new FM(),
|
|
26679
26690
|
documentId: A0
|
|
26680
26691
|
});
|
|
@@ -26710,30 +26721,30 @@ const gA = /* @__PURE__ */ q({
|
|
|
26710
26721
|
}
|
|
26711
26722
|
async function ju(A, W) {
|
|
26712
26723
|
const L = O0();
|
|
26713
|
-
A || (delete L.persistence, delete L.websocket), W && (L.initialState = W),
|
|
26724
|
+
A || (delete L.persistence, delete L.websocket), W && (L.initialState = W), ht = new B0(L);
|
|
26714
26725
|
const K = {
|
|
26715
26726
|
...m.editor,
|
|
26716
26727
|
user: x,
|
|
26717
|
-
plugins: I0(
|
|
26728
|
+
plugins: I0(ht),
|
|
26718
26729
|
controls: m.controls
|
|
26719
26730
|
}, $ = new cy(A, K);
|
|
26720
|
-
return await $.initialize(), await
|
|
26731
|
+
return await $.initialize(), await ht.initialize({
|
|
26721
26732
|
components: $.components,
|
|
26722
26733
|
singletons: $.singletons
|
|
26723
26734
|
}), $;
|
|
26724
26735
|
}
|
|
26725
26736
|
async function _l(A) {
|
|
26726
26737
|
A.nextTick((W) => {
|
|
26727
|
-
|
|
26738
|
+
ht && ht.sync(W), _0(W), D0(W);
|
|
26728
26739
|
for (const L of D)
|
|
26729
26740
|
L(W);
|
|
26730
26741
|
}), await A.tick();
|
|
26731
26742
|
}
|
|
26732
26743
|
async function Uu() {
|
|
26733
|
-
!w.value || !
|
|
26744
|
+
!w.value || !ht || (await _l(w.value), Rt = requestAnimationFrame(Uu));
|
|
26734
26745
|
}
|
|
26735
26746
|
if ($e(Re.name, (A) => {
|
|
26736
|
-
A && (
|
|
26747
|
+
A && (oe.value = A);
|
|
26737
26748
|
}), m.initialState && typeof window > "u") {
|
|
26738
26749
|
const A = ([t, o] = Dr(() => ju(null, m.initialState)), t = await t, o(), t);
|
|
26739
26750
|
[t, o] = Dr(() => _l(A)), await t, o(), [t, o] = Dr(() => _l(A)), await t, o(), w.value = A;
|
|
@@ -26749,50 +26760,52 @@ const gA = /* @__PURE__ */ q({
|
|
|
26749
26760
|
J(), window.addEventListener("online", bs), window.addEventListener("offline", bs), Ku = () => {
|
|
26750
26761
|
var R;
|
|
26751
26762
|
(R = k.value) == null || R.scrollTo(0, 0);
|
|
26752
|
-
}, k.value.addEventListener("scroll", Ku), w.value && (w.value.dispose(),
|
|
26763
|
+
}, k.value.addEventListener("scroll", Ku), w.value && (w.value.dispose(), ht == null || ht.close(), ht = null, ro = 0);
|
|
26753
26764
|
const A = await ju(k.value, m.initialState);
|
|
26754
|
-
if (w.value = A, Y.value = !1, await (
|
|
26755
|
-
const R = (
|
|
26765
|
+
if (w.value = A, Y.value = !1, await (Ke == null ? void 0 : Ke.init()), Ke) {
|
|
26766
|
+
const R = (te, fe) => {
|
|
26756
26767
|
A.nextTick((he) => {
|
|
26757
26768
|
for (const jt of i.current(he))
|
|
26758
|
-
vn.read(he, jt).identifier ===
|
|
26769
|
+
vn.read(he, jt).identifier === te && vn.patch(he, jt, { uploadState: fe });
|
|
26759
26770
|
});
|
|
26760
26771
|
};
|
|
26761
|
-
|
|
26772
|
+
Ke.onUploadStart((te) => R(te, jn.Uploading)), Ke.onUploadComplete((te) => R(te, jn.Complete)), Ke.onUploadError((te) => R(te, jn.Failed));
|
|
26762
26773
|
}
|
|
26763
|
-
await (
|
|
26774
|
+
await (Ke == null ? void 0 : Ke.resumePendingUploads()), me(V, (R, te) => {
|
|
26775
|
+
R && !te && (Ke == null || Ke.resumePendingUploads().catch((fe) => console.error("Failed to resume uploads:", fe)));
|
|
26776
|
+
}), Dl = setTimeout(() => {
|
|
26764
26777
|
ee.value = !0, J();
|
|
26765
26778
|
}, 3e3), Rt = requestAnimationFrame(Uu);
|
|
26766
26779
|
const W = ($ = (K = (L = w.value) == null ? void 0 : L.fonts) == null ? void 0 : K[0]) == null ? void 0 : $.name;
|
|
26767
|
-
W && Lo.setDefaults("text", { fontFamily: W }), v("ready", w.value,
|
|
26780
|
+
W && Lo.setDefaults("text", { fontFamily: W }), v("ready", w.value, ht);
|
|
26768
26781
|
}), Le(() => {
|
|
26769
26782
|
var A;
|
|
26770
|
-
Rt !== null && cancelAnimationFrame(Rt), Dl !== null && clearTimeout(Dl), window.removeEventListener("online", bs), window.removeEventListener("offline", bs),
|
|
26783
|
+
Rt !== null && cancelAnimationFrame(Rt), Dl !== null && clearTimeout(Dl), window.removeEventListener("online", bs), window.removeEventListener("offline", bs), Ke == null || Ke.close(), ht == null || ht.close(), (A = w.value) == null || A.dispose();
|
|
26771
26784
|
});
|
|
26772
26785
|
function _0(A) {
|
|
26773
26786
|
const { events: W, newIndex: L } = A.eventBuffer.readEvents(ro);
|
|
26774
26787
|
if (ro = L, W.length === 0) return;
|
|
26775
26788
|
const { componentsById: K, singletonsById: $ } = cr(A);
|
|
26776
|
-
for (const { entityId: R, eventType:
|
|
26789
|
+
for (const { entityId: R, eventType: te, componentId: fe } of W) {
|
|
26777
26790
|
if (R === uy) {
|
|
26778
|
-
if (
|
|
26791
|
+
if (te === Bo.CHANGED) {
|
|
26779
26792
|
const he = $.get(fe);
|
|
26780
|
-
he &&
|
|
26793
|
+
he && nt(A, he);
|
|
26781
26794
|
}
|
|
26782
26795
|
continue;
|
|
26783
26796
|
}
|
|
26784
|
-
if (
|
|
26797
|
+
if (te === Bo.ADDED)
|
|
26785
26798
|
T.add(R);
|
|
26786
|
-
else if (
|
|
26799
|
+
else if (te === Bo.REMOVED)
|
|
26787
26800
|
T.delete(R), _.delete(R);
|
|
26788
|
-
else if (
|
|
26801
|
+
else if (te === Bo.COMPONENT_ADDED) {
|
|
26789
26802
|
T.add(R);
|
|
26790
26803
|
const he = K.get(fe);
|
|
26791
26804
|
he && we(A, R, he);
|
|
26792
|
-
} else if (
|
|
26805
|
+
} else if (te === Bo.COMPONENT_REMOVED) {
|
|
26793
26806
|
const he = K.get(fe);
|
|
26794
26807
|
he && we(A, R, he, !0);
|
|
26795
|
-
} else if (
|
|
26808
|
+
} else if (te === Bo.CHANGED) {
|
|
26796
26809
|
const he = K.get(fe);
|
|
26797
26810
|
he && we(A, R, he);
|
|
26798
26811
|
}
|
|
@@ -26802,7 +26815,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26802
26815
|
var K;
|
|
26803
26816
|
let W = !1;
|
|
26804
26817
|
for (const $ of s.added(A)) {
|
|
26805
|
-
const R = ie.snapshot(A, $),
|
|
26818
|
+
const R = ie.snapshot(A, $), te = (K = w.value) == null ? void 0 : K.blockDefs[R.tag], fe = (te == null ? void 0 : te.stratum) ?? "content";
|
|
26806
26819
|
N.set(
|
|
26807
26820
|
$,
|
|
26808
26821
|
B({
|
|
@@ -26823,8 +26836,8 @@ const gA = /* @__PURE__ */ q({
|
|
|
26823
26836
|
for (const $ of s.changed(A)) {
|
|
26824
26837
|
const R = N.get($);
|
|
26825
26838
|
if (R) {
|
|
26826
|
-
const
|
|
26827
|
-
(R.value.block.rank !==
|
|
26839
|
+
const te = ie.snapshot(A, $);
|
|
26840
|
+
(R.value.block.rank !== te.rank || R.value.block.parentId !== te.parentId || R.value.block.layerId !== te.layerId) && (W = !0), R.value.block = te;
|
|
26828
26841
|
}
|
|
26829
26842
|
}
|
|
26830
26843
|
(p.addedOrChanged(A).length > 0 || p.removed(A).length > 0) && (W = !0);
|
|
@@ -26887,18 +26900,18 @@ const gA = /* @__PURE__ */ q({
|
|
|
26887
26900
|
R && R.value.connector !== null && (R.value.connector = null);
|
|
26888
26901
|
}
|
|
26889
26902
|
if (W) {
|
|
26890
|
-
const $ = Array.from(N.values()), R = (
|
|
26891
|
-
const fe = N.get(
|
|
26903
|
+
const $ = Array.from(N.values()), R = (te) => {
|
|
26904
|
+
const fe = N.get(te);
|
|
26892
26905
|
if (!fe) return null;
|
|
26893
26906
|
const he = fe.value;
|
|
26894
26907
|
return { rank: he.block.rank, stratum: he.stratum, parentId: he.block.parentId };
|
|
26895
26908
|
};
|
|
26896
|
-
$.sort((
|
|
26909
|
+
$.sort((te, fe) => {
|
|
26897
26910
|
const he = {
|
|
26898
|
-
rank:
|
|
26899
|
-
stratum:
|
|
26900
|
-
parentId:
|
|
26901
|
-
layerRank: id(A,
|
|
26911
|
+
rank: te.value.block.rank,
|
|
26912
|
+
stratum: te.value.stratum,
|
|
26913
|
+
parentId: te.value.block.parentId,
|
|
26914
|
+
layerRank: id(A, te.value.entityId)
|
|
26902
26915
|
}, jt = {
|
|
26903
26916
|
rank: fe.value.block.rank,
|
|
26904
26917
|
stratum: fe.value.stratum,
|
|
@@ -26925,8 +26938,8 @@ const gA = /* @__PURE__ */ q({
|
|
|
26925
26938
|
function xs(A, W, L, K) {
|
|
26926
26939
|
const $ = A - K[0], R = W - K[1];
|
|
26927
26940
|
if (L.rotateZ === 0) return [$, R];
|
|
26928
|
-
const
|
|
26929
|
-
return [he * wr - jt * kr +
|
|
26941
|
+
const te = L.size[0] / 2, fe = L.size[1] / 2, he = $ - te, jt = R - fe, wr = Math.cos(-L.rotateZ), kr = Math.sin(-L.rotateZ);
|
|
26942
|
+
return [he * wr - jt * kr + te, he * kr + jt * wr + fe];
|
|
26930
26943
|
}
|
|
26931
26944
|
function Nl(A) {
|
|
26932
26945
|
let W = A.block.position[0], L = A.block.position[1], K = A.block.parentId;
|
|
@@ -26947,33 +26960,33 @@ const gA = /* @__PURE__ */ q({
|
|
|
26947
26960
|
function P0(A) {
|
|
26948
26961
|
let W = -1 / 0, L = -1 / 0, K = 1 / 0, $ = 1 / 0, R = A.block.parentId;
|
|
26949
26962
|
for (; R !== null; ) {
|
|
26950
|
-
const
|
|
26951
|
-
if (!
|
|
26952
|
-
if (R0(
|
|
26953
|
-
const fe =
|
|
26963
|
+
const te = N.get(R);
|
|
26964
|
+
if (!te) break;
|
|
26965
|
+
if (R0(te.value.block.tag)) {
|
|
26966
|
+
const fe = te.value.block, he = Nl(te.value);
|
|
26954
26967
|
W = Math.max(W, he[0]), L = Math.max(L, he[1]), K = Math.min(K, he[0] + fe.size[0]), $ = Math.min($, he[1] + fe.size[1]);
|
|
26955
26968
|
}
|
|
26956
|
-
R =
|
|
26969
|
+
R = te.value.block.parentId;
|
|
26957
26970
|
}
|
|
26958
26971
|
return W === -1 / 0 ? null : [W, L, K, $];
|
|
26959
26972
|
}
|
|
26960
26973
|
function L0(A) {
|
|
26961
26974
|
const W = P0(A);
|
|
26962
26975
|
if (!W) return;
|
|
26963
|
-
const [L, K, $, R] = W,
|
|
26964
|
-
if (
|
|
26965
|
-
const Xu = K - fe[1], Zu = L - fe[0], Qu = fe[1] +
|
|
26976
|
+
const [L, K, $, R] = W, te = A.block, fe = Nl(A);
|
|
26977
|
+
if (te.rotateZ === 0) {
|
|
26978
|
+
const Xu = K - fe[1], Zu = L - fe[0], Qu = fe[1] + te.size[1] - R, ed = fe[0] + te.size[0] - $;
|
|
26966
26979
|
return Xu <= 0 && Zu <= 0 && Qu <= 0 && ed <= 0 ? void 0 : `inset(${Xu}px ${ed}px ${Qu}px ${Zu}px)`;
|
|
26967
26980
|
}
|
|
26968
|
-
const he = xs(L, K,
|
|
26981
|
+
const he = xs(L, K, te, fe), jt = xs($, K, te, fe), wr = xs($, R, te, fe), kr = xs(L, R, te, fe);
|
|
26969
26982
|
return `polygon(${he[0]}px ${he[1]}px, ${jt[0]}px ${jt[1]}px, ${wr[0]}px ${wr[1]}px, ${kr[0]}px ${kr[1]}px)`;
|
|
26970
26983
|
}
|
|
26971
26984
|
function $0(A) {
|
|
26972
|
-
const { block: W, opacity: L } = A, K = qu(A), $ = L !== null ? L.value / 255 : 1, R = A.edited ? void 0 : L0(A),
|
|
26985
|
+
const { block: W, opacity: L } = A, K = qu(A), $ = L !== null ? L.value / 255 : 1, R = A.edited ? void 0 : L0(A), te = Nl(A);
|
|
26973
26986
|
return {
|
|
26974
26987
|
position: "absolute",
|
|
26975
|
-
left: `${
|
|
26976
|
-
top: `${
|
|
26988
|
+
left: `${te[0]}px`,
|
|
26989
|
+
top: `${te[1]}px`,
|
|
26977
26990
|
width: `${W.size[0]}px`,
|
|
26978
26991
|
height: `${W.size[1]}px`,
|
|
26979
26992
|
transform: N0(W),
|
|
@@ -26997,7 +27010,7 @@ const gA = /* @__PURE__ */ q({
|
|
|
26997
27010
|
overflow: "hidden"
|
|
26998
27011
|
}
|
|
26999
27012
|
}, [
|
|
27000
|
-
n.background ?
|
|
27013
|
+
n.background ? ge(A.$slots, "background", {
|
|
27001
27014
|
key: 0,
|
|
27002
27015
|
background: n.background
|
|
27003
27016
|
}, () => [
|
|
@@ -27006,14 +27019,14 @@ const gA = /* @__PURE__ */ q({
|
|
|
27006
27019
|
(C(), M(ue, null, Ee(y, (L) => (C(), M(ue, {
|
|
27007
27020
|
key: L.class
|
|
27008
27021
|
}, [
|
|
27009
|
-
L.stratum === "content" ?
|
|
27022
|
+
L.stratum === "content" ? ge(A.$slots, "render-layer", { key: 0 }) : j("", !0),
|
|
27010
27023
|
b("div", {
|
|
27011
27024
|
class: Me(L.class),
|
|
27012
27025
|
style: ye({
|
|
27013
27026
|
position: "absolute",
|
|
27014
27027
|
transformOrigin: "0 0",
|
|
27015
|
-
transform: `scale(${
|
|
27016
|
-
"--wov-zoom":
|
|
27028
|
+
transform: `scale(${oe.value.zoom}) translate(${-oe.value.left}px, ${-oe.value.top}px)`,
|
|
27029
|
+
"--wov-zoom": oe.value.zoom
|
|
27017
27030
|
})
|
|
27018
27031
|
}, [
|
|
27019
27032
|
(C(!0), M(ue, null, Ee(H.value, (K) => (C(), M(ue, {
|
|
@@ -27029,8 +27042,8 @@ const gA = /* @__PURE__ */ q({
|
|
|
27029
27042
|
"data-edited": K.value.edited || void 0,
|
|
27030
27043
|
class: "wov-block"
|
|
27031
27044
|
}, [
|
|
27032
|
-
|
|
27033
|
-
r[K.value.block.tag] ? (C(),
|
|
27045
|
+
ge(A.$slots, `block:${K.value.block.tag}`, Jr({ ref_for: !0 }, K.value), () => [
|
|
27046
|
+
r[K.value.block.tag] ? (C(), ne(xa(r[K.value.block.tag]), Jr({
|
|
27034
27047
|
key: 0,
|
|
27035
27048
|
ref_for: !0
|
|
27036
27049
|
}, K.value), null, 16)) : j("", !0)
|
|
@@ -27039,50 +27052,50 @@ const gA = /* @__PURE__ */ q({
|
|
|
27039
27052
|
], 64))), 128))
|
|
27040
27053
|
], 6)
|
|
27041
27054
|
], 64))), 64)),
|
|
27042
|
-
w.value ?
|
|
27055
|
+
w.value ? ge(A.$slots, "user-cursors", {
|
|
27043
27056
|
key: 1,
|
|
27044
27057
|
users: E.value,
|
|
27045
27058
|
currentSessionId: F(x).sessionId,
|
|
27046
|
-
camera:
|
|
27059
|
+
camera: oe.value
|
|
27047
27060
|
}, () => [
|
|
27048
27061
|
Z(bA, {
|
|
27049
27062
|
users: E.value,
|
|
27050
27063
|
"current-session-id": F(x).sessionId,
|
|
27051
|
-
camera:
|
|
27064
|
+
camera: oe.value
|
|
27052
27065
|
}, null, 8, ["users", "current-session-id", "camera"])
|
|
27053
27066
|
]) : j("", !0),
|
|
27054
|
-
w.value ? (C(),
|
|
27067
|
+
w.value ? (C(), ne(IE, { key: 2 }, {
|
|
27055
27068
|
default: se((L) => [
|
|
27056
|
-
|
|
27069
|
+
ge(A.$slots, "floating-menu", Ca(Ta(L)))
|
|
27057
27070
|
]),
|
|
27058
27071
|
_: 3
|
|
27059
27072
|
})) : j("", !0),
|
|
27060
|
-
w.value ?
|
|
27073
|
+
w.value ? ge(A.$slots, "user-presence", {
|
|
27061
27074
|
key: 3,
|
|
27062
27075
|
users: E.value
|
|
27063
27076
|
}, () => [
|
|
27064
27077
|
Z(SM, { users: E.value }, null, 8, ["users"])
|
|
27065
27078
|
]) : j("", !0),
|
|
27066
|
-
w.value ?
|
|
27079
|
+
w.value ? ge(A.$slots, "toolbar", { key: 4 }, () => [
|
|
27067
27080
|
Z(gM)
|
|
27068
27081
|
]) : j("", !0),
|
|
27069
|
-
w.value ?
|
|
27070
|
-
|
|
27082
|
+
w.value ? ge(A.$slots, "default", { key: 5 }) : j("", !0),
|
|
27083
|
+
ge(A.$slots, "offline-indicator", { isOnline: V.value }, () => [
|
|
27071
27084
|
Z(SA, { "is-online": V.value }, null, 8, ["is-online"])
|
|
27072
27085
|
]),
|
|
27073
|
-
|
|
27086
|
+
ge(A.$slots, "version-mismatch", { versionMismatch: X.value }, () => [
|
|
27074
27087
|
Z(TA, { "version-mismatch": X.value }, null, 8, ["version-mismatch"])
|
|
27075
27088
|
]),
|
|
27076
|
-
|
|
27089
|
+
ge(A.$slots, "back-to-content", {}, () => [
|
|
27077
27090
|
Z(EA)
|
|
27078
27091
|
]),
|
|
27079
|
-
|
|
27092
|
+
ge(A.$slots, "loading", { isLoading: Y.value }, () => [
|
|
27080
27093
|
Z(DE, { "is-loading": Y.value }, null, 8, ["is-loading"])
|
|
27081
27094
|
]),
|
|
27082
|
-
w.value ?
|
|
27095
|
+
w.value ? ge(A.$slots, "file-drop-zone", { key: 6 }, () => [
|
|
27083
27096
|
Z(TE)
|
|
27084
27097
|
]) : j("", !0),
|
|
27085
|
-
w.value ? (C(),
|
|
27098
|
+
w.value ? (C(), ne(gA, {
|
|
27086
27099
|
key: 7,
|
|
27087
27100
|
options: m.copyPaste
|
|
27088
27101
|
}, null, 8, ["options"])) : j("", !0),
|
|
@@ -27093,13 +27106,13 @@ const gA = /* @__PURE__ */ q({
|
|
|
27093
27106
|
inheritAttrs: !1,
|
|
27094
27107
|
__name: "WovenCanvas",
|
|
27095
27108
|
setup(n) {
|
|
27096
|
-
return (e, t) => (C(),
|
|
27109
|
+
return (e, t) => (C(), ne(W0, null, {
|
|
27097
27110
|
default: se(() => [
|
|
27098
27111
|
Z(AA, Ca(Ta(e.$attrs)), j0({ _: 2 }, [
|
|
27099
27112
|
Ee(e.$slots, (o, r) => ({
|
|
27100
27113
|
name: r,
|
|
27101
27114
|
fn: se((s) => [
|
|
27102
|
-
|
|
27115
|
+
ge(e.$slots, r, Ca(Ta(s ?? {})))
|
|
27103
27116
|
])
|
|
27104
27117
|
}))
|
|
27105
27118
|
]), 1040)
|
|
@@ -27189,7 +27202,7 @@ export {
|
|
|
27189
27202
|
eE as useFonts,
|
|
27190
27203
|
Vg as useImageCreation,
|
|
27191
27204
|
cS as useQuery,
|
|
27192
|
-
|
|
27205
|
+
it as useSingleton,
|
|
27193
27206
|
bS as useTextBatchController,
|
|
27194
27207
|
hr as useTextEditorController,
|
|
27195
27208
|
on as useTextFormatting,
|