@floegence/floe-webapp-core 0.36.60 → 0.36.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/workbench/WorkbenchLayerObjects.js +354 -354
- package/dist/components/workbench/WorkbenchWidget.js +184 -176
- package/dist/components/workbench/useWorkbenchModel.js +236 -239
- package/dist/components/workbench/workbenchHelpers.d.ts +9 -2
- package/dist/components/workbench/workbenchHelpers.js +157 -139
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as S, For as se, Show as te, createEffect as
|
|
1
|
+
import { insert as R, createComponent as k, memo as ge, effect as U, template as O, classList as Ie, setAttribute as _, style as ve, addEventListener as V, use as fe, setStyleProperty as me, delegateEvents as Qe } from "solid-js/web";
|
|
2
|
+
import { createMemo as S, For as se, Show as te, createEffect as Re, onCleanup as ke, createSignal as re, untrack as ze, batch as Me } from "solid-js";
|
|
3
3
|
import { GripVertical as Ye, Check as Ze, Copy as et, Trash as Te, ChevronDown as tt, Minus as nt, Plus as it } from "../icons/index.js";
|
|
4
4
|
import { startHotInteraction as Ue } from "../../utils/hotInteraction.js";
|
|
5
5
|
import { startPointerSession as Ke } from "../ui/pointerSession.js";
|
|
6
|
-
import { WORKBENCH_STICKY_NOTE_COLORS as ot, WORKBENCH_REGION_FILL_OPTIONS as rt, WORKBENCH_BACKGROUND_MATERIALS as at, WORKBENCH_TEXT_FONT_OPTIONS as
|
|
7
|
-
import {
|
|
6
|
+
import { WORKBENCH_STICKY_NOTE_COLORS as ot, WORKBENCH_REGION_FILL_OPTIONS as rt, WORKBENCH_BACKGROUND_MATERIALS as at, WORKBENCH_TEXT_FONT_OPTIONS as Pe, WORKBENCH_TEXT_COLOR_OPTIONS as ct, WORKBENCH_TEXT_EMOJI_OPTIONS as lt } from "./workbenchOptions.js";
|
|
7
|
+
import { compareWorkbenchLayerRenderOrder as st, createWorkbenchWidgetSurfaceMetrics as dt } from "./workbenchHelpers.js";
|
|
8
8
|
import { createOwnerSafePropAccessor as n } from "./workbenchOwnerSafeAccessors.js";
|
|
9
|
-
var
|
|
10
|
-
const Et = 190, Pt = 132,
|
|
9
|
+
var ut = /* @__PURE__ */ O('<div class=workbench-sticky__actions data-floe-workbench-sticky-local=true><button type=button class=workbench-sticky__tool aria-label="Copy sticky note content"></button><button type=button class=workbench-sticky__tool aria-label="Change sticky note color"title="Change sticky note color"><span class=workbench-sticky__color-dot aria-hidden=true></span></button><button type=button class="workbench-sticky__tool is-danger"aria-label="Delete sticky note"title="Delete sticky note">'), ht = /* @__PURE__ */ O('<button type=button class="workbench-layer-resize workbench-sticky__resize"aria-label="Resize sticky note">'), wt = /* @__PURE__ */ O('<article class=workbench-sticky data-floe-canvas-interactive=true data-floe-workbench-widget-root=true data-wb-plane=work data-wb-object-kind=sticky tabindex=0><div class=workbench-sticky__surface><header class=workbench-sticky__header><button type=button class=workbench-sticky__grip aria-label="Drag sticky note"data-floe-workbench-sticky-local=true data-wb-part=move></button></header><div class=workbench-sticky__body role=textbox aria-multiline=true aria-label="Sticky note body"data-floe-workbench-text-selection-surface=true data-wb-text-editor=plain data-floe-workbench-sticky-local=true data-wb-part=content>'), mt = /* @__PURE__ */ O("<article class=workbench-text-annotation data-wb-plane=annotation data-wb-object-kind=text data-wb-part=body><div class=workbench-text-annotation__content data-floe-workbench-text-selection-surface=true data-wb-text-editor=plain data-wb-part=content>"), gt = /* @__PURE__ */ O("<article class=workbench-background-region data-wb-plane=background data-wb-object-kind=region data-wb-part=body>"), vt = /* @__PURE__ */ O('<div class=workbench-text-font-popover role=menu aria-label="Bold font">'), bt = /* @__PURE__ */ O("<div class=workbench-text-emoji-popover role=menu aria-label=Emoji>"), yt = /* @__PURE__ */ O('<div class="workbench-layer-control workbench-layer-control--text"data-floe-canvas-interactive=true data-wb-plane=overlay data-wb-object-kind=text data-wb-part=toolbar><div class="workbench-layer-control__selection is-text"aria-hidden=true></div><div class=workbench-text-annotation__toolbar data-floe-canvas-interactive=true><button type=button aria-label="Move text"title="Move text"class="workbench-layer-mini-button workbench-layer-move-handle"data-wb-part=move></button><div class=workbench-text-font-picker data-floe-canvas-interactive=true><button type=button aria-label="Choose bold font"aria-haspopup=menu title="Choose bold font"class=workbench-text-font-trigger><span class=workbench-text-font-trigger__sample>Aa</span><span class=workbench-text-font-trigger__label></span></button></div><div class=workbench-text-size-stepper role=group aria-label="Text size"><button type=button aria-label="Decrease text size"title="Decrease text size"class=workbench-text-size-stepper__button></button><input class=workbench-text-annotation__size-input type=text inputmode=numeric pattern=[0-9]* aria-label="Text size value"><button type=button aria-label="Increase text size"title="Increase text size"class=workbench-text-size-stepper__button></button></div><div class=workbench-text-emoji-picker data-floe-canvas-interactive=true><button type=button aria-label="Insert emoji"aria-haspopup=menu title="Insert emoji"class=workbench-text-emoji-trigger>✨</button></div><button type=button class=workbench-layer-mini-button></button><button type=button class="workbench-layer-mini-button is-danger"aria-label="Delete text"></button></div><button type=button class=workbench-layer-resize aria-label="Resize text"data-wb-part=resize>'), ft = /* @__PURE__ */ O("<button type=button role=menuitemradio class=workbench-text-font-option><span class=workbench-text-font-option__sample>Aa</span><span class=workbench-text-font-option__label>"), kt = /* @__PURE__ */ O("<button type=button class=workbench-layer-swatch>"), xt = /* @__PURE__ */ O("<button type=button role=menuitem class=workbench-text-emoji-option>"), $t = /* @__PURE__ */ O('<div class="workbench-layer-control workbench-layer-control--region"data-floe-canvas-interactive=true data-wb-plane=overlay data-wb-object-kind=region data-wb-part=toolbar><div class="workbench-layer-control__selection is-region"aria-hidden=true></div><div class=workbench-background-region__toolbar data-floe-canvas-interactive=true><div class=workbench-region-material-group role=group aria-label="Region material"></div><button type=button class=workbench-layer-mini-button>%</button><button type=button class="workbench-layer-mini-button is-danger"aria-label="Delete background region"></button></div><button type=button class=workbench-layer-resize aria-label="Resize background region"data-wb-part=resize>'), _t = /* @__PURE__ */ O('<button type=button class="workbench-layer-swatch workbench-layer-swatch--region">'), Ct = /* @__PURE__ */ O("<button type=button class=workbench-region-material><span class=workbench-region-material__sample aria-hidden=true>"), St = /* @__PURE__ */ O("<div class=workbench-region-visibility-outline aria-hidden=true data-wb-plane=overlay data-wb-object-kind=region-outline>"), pt = /* @__PURE__ */ O("<div class=workbench-region-visibility-outline-layer aria-hidden=true>"), zt = /* @__PURE__ */ O("<div class=workbench-background-layer>"), Mt = /* @__PURE__ */ O("<div class=workbench-annotation-layer>"), Rt = /* @__PURE__ */ O("<div class=workbench-control-overlay-layer data-wb-plane=overlay>");
|
|
10
|
+
const Et = 190, Pt = 132, It = 180, Tt = 120, jt = 96, Lt = 42, Fe = {
|
|
11
11
|
solid: "Solid",
|
|
12
12
|
dotted: "Dotted",
|
|
13
13
|
grid: "Grid",
|
|
14
14
|
hatched: "Hatched",
|
|
15
15
|
glass: "Glass"
|
|
16
|
-
},
|
|
16
|
+
}, Dt = {
|
|
17
17
|
amber: "is-amber",
|
|
18
18
|
sage: "is-sage",
|
|
19
19
|
azure: "is-azure",
|
|
@@ -21,12 +21,12 @@ const Et = 190, Pt = 132, Rt = 180, It = 120, Tt = 96, jt = 42, Fe = {
|
|
|
21
21
|
rose: "is-rose",
|
|
22
22
|
graphite: "is-graphite"
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function Zt() {
|
|
25
25
|
const e = /* @__PURE__ */ new Map();
|
|
26
26
|
return {
|
|
27
|
-
register(t,
|
|
28
|
-
return e.set(t,
|
|
29
|
-
e.get(t) ===
|
|
27
|
+
register(t, u) {
|
|
28
|
+
return e.set(t, u), () => {
|
|
29
|
+
e.get(t) === u && e.delete(t);
|
|
30
30
|
};
|
|
31
31
|
},
|
|
32
32
|
get(t) {
|
|
@@ -35,80 +35,80 @@ function Qt() {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function je(e) {
|
|
38
|
-
return [...e].sort(
|
|
38
|
+
return [...e].sort(st);
|
|
39
39
|
}
|
|
40
40
|
function Le(e) {
|
|
41
41
|
return new Map(e.map((t) => [t.id, t]));
|
|
42
42
|
}
|
|
43
43
|
function Ve(e, t) {
|
|
44
|
-
const
|
|
45
|
-
return e[(
|
|
44
|
+
const u = e.findIndex((i) => i === t);
|
|
45
|
+
return e[(u + 1) % e.length] ?? e[0];
|
|
46
46
|
}
|
|
47
|
-
function Be(e, t,
|
|
48
|
-
|
|
47
|
+
function Be(e, t, u) {
|
|
48
|
+
Re(() => {
|
|
49
49
|
if (!e() || typeof document > "u") return;
|
|
50
|
-
const i = (
|
|
50
|
+
const i = (v) => {
|
|
51
51
|
const y = t();
|
|
52
|
-
y &&
|
|
53
|
-
},
|
|
54
|
-
|
|
52
|
+
y && v.target instanceof Node && y.contains(v.target) || u();
|
|
53
|
+
}, c = (v) => {
|
|
54
|
+
v.key === "Escape" && u();
|
|
55
55
|
};
|
|
56
|
-
document.addEventListener("pointerdown", i, !0), document.addEventListener("keydown",
|
|
57
|
-
document.removeEventListener("pointerdown", i, !0), document.removeEventListener("keydown",
|
|
56
|
+
document.addEventListener("pointerdown", i, !0), document.addEventListener("keydown", c), ke(() => {
|
|
57
|
+
document.removeEventListener("pointerdown", i, !0), document.removeEventListener("keydown", c);
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ot(e, t) {
|
|
62
62
|
if (!e || e.rangeCount <= 0) return !1;
|
|
63
|
-
const
|
|
64
|
-
return
|
|
63
|
+
const u = e.getRangeAt(0).commonAncestorContainer;
|
|
64
|
+
return u === t || t.contains(u);
|
|
65
65
|
}
|
|
66
66
|
function Je(e) {
|
|
67
|
-
const [t,
|
|
67
|
+
const [t, u] = re(), [i, c] = re(!1), [v, y] = re(!1), p = () => t()?.textContent ?? "", b = (h) => u(h), E = (h) => {
|
|
68
68
|
const f = h.innerHTML ?? "";
|
|
69
69
|
f !== e.value() && e.onCommit(f);
|
|
70
70
|
};
|
|
71
|
-
return
|
|
71
|
+
return Re(() => {
|
|
72
72
|
const h = t();
|
|
73
|
-
if (!h || i() ||
|
|
73
|
+
if (!h || i() || v()) return;
|
|
74
74
|
const f = e.value();
|
|
75
75
|
(h.innerHTML ?? "") !== f && (h.innerHTML = f);
|
|
76
76
|
}), {
|
|
77
|
-
bind:
|
|
77
|
+
bind: b,
|
|
78
78
|
readText: p,
|
|
79
79
|
focus: () => t()?.focus(),
|
|
80
80
|
insertTextAtSelection: (h) => {
|
|
81
81
|
const f = t();
|
|
82
82
|
if (!f) return;
|
|
83
83
|
f.focus();
|
|
84
|
-
const
|
|
85
|
-
r || (
|
|
84
|
+
const a = document.getSelection(), r = Ot(a, f), l = r && a ? a.getRangeAt(0) : document.createRange();
|
|
85
|
+
r || (l.selectNodeContents(f), l.collapse(!1)), l.deleteContents();
|
|
86
86
|
const o = document.createTextNode(h);
|
|
87
|
-
|
|
87
|
+
l.insertNode(o), l.setStartAfter(o), l.collapse(!0), a?.removeAllRanges(), a?.addRange(l), E(f);
|
|
88
88
|
},
|
|
89
89
|
handleFocus: () => {
|
|
90
90
|
y(!0);
|
|
91
91
|
},
|
|
92
92
|
handleBlur: (h) => {
|
|
93
|
-
i() ||
|
|
93
|
+
i() || E(h.currentTarget), y(!1);
|
|
94
94
|
},
|
|
95
95
|
handleInput: (h) => {
|
|
96
|
-
i() || h.isComposing ||
|
|
96
|
+
i() || h.isComposing || E(h.currentTarget);
|
|
97
97
|
},
|
|
98
98
|
handleKeyDown: (h) => {
|
|
99
99
|
if (i()) return;
|
|
100
100
|
const f = h.ctrlKey || h.metaKey;
|
|
101
|
-
f && h.key === "b" ? (h.preventDefault(), document.execCommand("bold", !1),
|
|
101
|
+
f && h.key === "b" ? (h.preventDefault(), document.execCommand("bold", !1), E(h.currentTarget)) : f && h.key === "i" && (h.preventDefault(), document.execCommand("italic", !1), E(h.currentTarget));
|
|
102
102
|
},
|
|
103
103
|
handleCompositionStart: () => {
|
|
104
|
-
|
|
104
|
+
c(!0);
|
|
105
105
|
},
|
|
106
106
|
handleCompositionEnd: (h) => {
|
|
107
|
-
|
|
107
|
+
E(h.currentTarget), c(!1);
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Wt(e) {
|
|
112
112
|
return Math.max(8, Math.min(160, Math.round(e)));
|
|
113
113
|
}
|
|
114
114
|
function qe(e) {
|
|
@@ -118,10 +118,10 @@ function Xe(e) {
|
|
|
118
118
|
return `${Math.round(qe(e) * 1e3) / 10}%`;
|
|
119
119
|
}
|
|
120
120
|
function De(e) {
|
|
121
|
-
const t = qe(e.opacity),
|
|
121
|
+
const t = qe(e.opacity), u = `color-mix(in srgb, ${e.fill} ${Math.round(t * 100)}%, transparent)`;
|
|
122
122
|
return {
|
|
123
123
|
"--workbench-region-fill": e.fill,
|
|
124
|
-
"--workbench-region-surface":
|
|
124
|
+
"--workbench-region-surface": u,
|
|
125
125
|
"--workbench-region-ink": `color-mix(in srgb, color-mix(in srgb, ${e.fill} 48%, var(--foreground, #111) 52%) ${Xe(Math.max(t, 0.42) * 0.72)}, transparent)`,
|
|
126
126
|
"--workbench-region-highlight": `color-mix(in srgb, white ${Xe(Math.max(t, 0.32) * 0.2)}, transparent)`
|
|
127
127
|
};
|
|
@@ -138,8 +138,8 @@ function Y(e) {
|
|
|
138
138
|
function A(e) {
|
|
139
139
|
e.stopPropagation();
|
|
140
140
|
}
|
|
141
|
-
function xe(e, t,
|
|
142
|
-
return e?.kind === t && e.id ===
|
|
141
|
+
function xe(e, t, u) {
|
|
142
|
+
return e?.kind === t && e.id === u ? e : null;
|
|
143
143
|
}
|
|
144
144
|
function pe(e) {
|
|
145
145
|
const t = typeof window < "u" && Number.isFinite(window.devicePixelRatio) && window.devicePixelRatio > 0 ? window.devicePixelRatio : 1;
|
|
@@ -173,11 +173,11 @@ function Ce(e) {
|
|
|
173
173
|
height: e.preview?.height ?? e.height
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
const t = n(() => e.readPosition()),
|
|
176
|
+
function Ee(e) {
|
|
177
|
+
const t = n(() => e.readPosition()), u = n(() => e.readGeometry?.() ?? {
|
|
178
178
|
width: 0,
|
|
179
179
|
height: 0
|
|
180
|
-
}), i = n(() => e.viewportScale()),
|
|
180
|
+
}), i = n(() => e.viewportScale()), c = n(() => e.onCommitMove), v = n(() => e.onPreviewMove), y = n(() => e.onPreviewEnd), p = n(() => e.onInteractionStart), b = n(() => e.onInteractionEnd), E = n(() => e.onCommitStart), [$, j] = re(null);
|
|
181
181
|
let L;
|
|
182
182
|
return ke(() => {
|
|
183
183
|
L?.stop({
|
|
@@ -199,65 +199,65 @@ function Pe(e) {
|
|
|
199
199
|
reason: "manual_stop",
|
|
200
200
|
commit: !1
|
|
201
201
|
});
|
|
202
|
-
const
|
|
202
|
+
const s = t(), m = Math.max(i(), 1e-3), h = Ue({
|
|
203
203
|
kind: "drag",
|
|
204
204
|
cursor: "grabbing"
|
|
205
205
|
});
|
|
206
206
|
let f = !1;
|
|
207
207
|
p()?.();
|
|
208
|
-
const
|
|
209
|
-
f || (f = !0, h(),
|
|
210
|
-
}, r =
|
|
208
|
+
const a = () => {
|
|
209
|
+
f || (f = !0, h(), b()?.());
|
|
210
|
+
}, r = u(), l = v(), o = y(), T = E(), q = c();
|
|
211
211
|
j({
|
|
212
212
|
pointerId: C.pointerId,
|
|
213
213
|
startClientX: C.clientX,
|
|
214
214
|
startClientY: C.clientY,
|
|
215
|
-
startWorldX:
|
|
216
|
-
startWorldY:
|
|
217
|
-
worldX:
|
|
218
|
-
worldY:
|
|
215
|
+
startWorldX: s.x,
|
|
216
|
+
startWorldY: s.y,
|
|
217
|
+
worldX: s.x,
|
|
218
|
+
worldY: s.y,
|
|
219
219
|
scale: m,
|
|
220
220
|
moved: !1,
|
|
221
|
-
stopInteraction:
|
|
221
|
+
stopInteraction: a
|
|
222
222
|
}), L = Ke({
|
|
223
223
|
pointerEvent: C,
|
|
224
224
|
captureEl: C.currentTarget,
|
|
225
225
|
onMove: (F) => {
|
|
226
|
-
let
|
|
226
|
+
let W = null;
|
|
227
227
|
Me(() => {
|
|
228
228
|
j((M) => {
|
|
229
229
|
if (!M || M.pointerId !== F.pointerId) return M;
|
|
230
|
-
const
|
|
230
|
+
const g = {
|
|
231
231
|
x: M.startWorldX + (F.clientX - M.startClientX) / M.scale,
|
|
232
232
|
y: M.startWorldY + (F.clientY - M.startClientY) / M.scale
|
|
233
233
|
};
|
|
234
|
-
return
|
|
234
|
+
return W = {
|
|
235
235
|
x: M.startWorldX + (F.clientX - M.startClientX) / M.scale,
|
|
236
236
|
y: M.startWorldY + (F.clientY - M.startClientY) / M.scale,
|
|
237
237
|
width: r.width,
|
|
238
238
|
height: r.height
|
|
239
239
|
}, {
|
|
240
240
|
...M,
|
|
241
|
-
worldX:
|
|
242
|
-
worldY:
|
|
243
|
-
moved: M.moved || Math.abs(
|
|
241
|
+
worldX: g.x,
|
|
242
|
+
worldY: g.y,
|
|
243
|
+
moved: M.moved || Math.abs(g.x - M.startWorldX) > 2 || Math.abs(g.y - M.startWorldY) > 2
|
|
244
244
|
};
|
|
245
|
-
}),
|
|
245
|
+
}), W && l?.(W);
|
|
246
246
|
});
|
|
247
247
|
},
|
|
248
248
|
onEnd: ({
|
|
249
249
|
commit: F
|
|
250
250
|
}) => {
|
|
251
|
-
const
|
|
251
|
+
const W = ze($);
|
|
252
252
|
Me(() => {
|
|
253
|
-
if (
|
|
253
|
+
if (W && F) {
|
|
254
254
|
const M = {
|
|
255
|
-
x:
|
|
256
|
-
y:
|
|
255
|
+
x: W.worldX,
|
|
256
|
+
y: W.worldY
|
|
257
257
|
};
|
|
258
|
-
T?.(M),
|
|
258
|
+
T?.(M), W.moved && q(M);
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
W?.stopInteraction(), j(null), L = void 0, o?.();
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
});
|
|
@@ -265,38 +265,38 @@ function Pe(e) {
|
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
function Oe(e) {
|
|
268
|
-
const t = n(() => e.readSize()),
|
|
268
|
+
const t = n(() => e.readSize()), u = n(() => e.viewportScale()), i = n(() => e.onCommitResize), c = n(() => e.onPreviewResize), v = n(() => e.onPreviewEnd), y = n(() => e.onInteractionStart), p = n(() => e.onInteractionEnd), [b, E] = re(null);
|
|
269
269
|
let $;
|
|
270
270
|
return ke(() => {
|
|
271
271
|
$?.stop({
|
|
272
272
|
reason: "manual_stop",
|
|
273
273
|
commit: !1
|
|
274
|
-
}), $ = void 0, ze(
|
|
274
|
+
}), $ = void 0, ze(b)?.stopInteraction();
|
|
275
275
|
}), {
|
|
276
276
|
size: S(() => {
|
|
277
|
-
const w =
|
|
277
|
+
const w = b();
|
|
278
278
|
return w ? {
|
|
279
279
|
width: w.width,
|
|
280
280
|
height: w.height
|
|
281
281
|
} : t();
|
|
282
282
|
}),
|
|
283
|
-
isResizing: () =>
|
|
283
|
+
isResizing: () => b() !== null,
|
|
284
284
|
beginResize: (w) => {
|
|
285
285
|
if (w.button !== 0) return;
|
|
286
286
|
w.preventDefault(), w.stopPropagation(), $?.stop({
|
|
287
287
|
reason: "manual_stop",
|
|
288
288
|
commit: !1
|
|
289
289
|
});
|
|
290
|
-
const z = t(), C = Math.max(
|
|
290
|
+
const z = t(), C = Math.max(u(), 1e-3), s = Ue({
|
|
291
291
|
kind: "resize",
|
|
292
292
|
cursor: "nwse-resize"
|
|
293
293
|
});
|
|
294
294
|
let m = !1;
|
|
295
295
|
y()?.();
|
|
296
296
|
const h = () => {
|
|
297
|
-
m || (m = !0,
|
|
298
|
-
}, f =
|
|
299
|
-
|
|
297
|
+
m || (m = !0, s(), p()?.());
|
|
298
|
+
}, f = c(), a = v(), r = i();
|
|
299
|
+
E({
|
|
300
300
|
pointerId: w.pointerId,
|
|
301
301
|
startClientX: w.clientX,
|
|
302
302
|
startClientY: w.clientY,
|
|
@@ -309,12 +309,12 @@ function Oe(e) {
|
|
|
309
309
|
}), $ = Ke({
|
|
310
310
|
pointerEvent: w,
|
|
311
311
|
captureEl: w.currentTarget,
|
|
312
|
-
onMove: (
|
|
312
|
+
onMove: (l) => {
|
|
313
313
|
let o = null;
|
|
314
314
|
Me(() => {
|
|
315
|
-
|
|
316
|
-
width: Math.max(e.minWidth, T.startWidth + (
|
|
317
|
-
height: Math.max(e.minHeight, T.startHeight + (
|
|
315
|
+
E((T) => !T || T.pointerId !== l.pointerId ? T : (o = {
|
|
316
|
+
width: Math.max(e.minWidth, T.startWidth + (l.clientX - T.startClientX) / T.scale),
|
|
317
|
+
height: Math.max(e.minHeight, T.startHeight + (l.clientY - T.startClientY) / T.scale)
|
|
318
318
|
}, {
|
|
319
319
|
...T,
|
|
320
320
|
width: o.width,
|
|
@@ -323,27 +323,27 @@ function Oe(e) {
|
|
|
323
323
|
});
|
|
324
324
|
},
|
|
325
325
|
onEnd: ({
|
|
326
|
-
commit:
|
|
326
|
+
commit: l
|
|
327
327
|
}) => {
|
|
328
|
-
const o = ze(
|
|
328
|
+
const o = ze(b);
|
|
329
329
|
Me(() => {
|
|
330
|
-
o &&
|
|
330
|
+
o && l && r({
|
|
331
331
|
width: o.width,
|
|
332
332
|
height: o.height
|
|
333
|
-
}), o?.stopInteraction(),
|
|
333
|
+
}), o?.stopInteraction(), E(null), $ = void 0, a?.();
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const t = n(() => e.item),
|
|
340
|
+
function en(e) {
|
|
341
|
+
const t = n(() => e.item), u = n(() => e.selected), i = n(() => e.viewportScale), c = n(() => e.projectedViewport), v = n(() => e.surfaceReady ?? !0), y = n(() => e.renderLayer), p = n(() => e.topRenderLayer), b = n(() => e.locked), E = n(() => e.filtered), $ = n(() => e.optimisticFront ?? !1), j = n(() => e.onSelect), L = n(() => e.onContextMenu), w = n(() => e.onStartOptimisticFront), z = n(() => e.onCommitFront), C = n(() => e.onCommitMove), s = n(() => e.onCommitResize), m = n(() => e.onUpdate), h = n(() => e.onDelete), f = n(() => e.onLayoutInteractionStart), a = n(() => e.onLayoutInteractionEnd), r = Je({
|
|
342
342
|
value: () => t().body,
|
|
343
|
-
onCommit: (
|
|
344
|
-
body:
|
|
343
|
+
onCommit: (P) => m()(t().id, {
|
|
344
|
+
body: P
|
|
345
345
|
})
|
|
346
|
-
}), [
|
|
346
|
+
}), [l, o] = re(!1);
|
|
347
347
|
let T;
|
|
348
348
|
const q = () => {
|
|
349
349
|
typeof window > "u" || T === void 0 || (window.clearTimeout(T), T = void 0);
|
|
@@ -353,22 +353,22 @@ function Zt(e) {
|
|
|
353
353
|
}, 720));
|
|
354
354
|
};
|
|
355
355
|
ke(() => q());
|
|
356
|
-
const
|
|
356
|
+
const W = async () => {
|
|
357
357
|
typeof navigator > "u" || !navigator.clipboard?.writeText || (await navigator.clipboard.writeText(r.readText()), F());
|
|
358
|
-
}, M = (
|
|
359
|
-
if (
|
|
358
|
+
}, M = (P) => {
|
|
359
|
+
if (P.button !== 0) return;
|
|
360
360
|
const oe = t();
|
|
361
|
-
j()(oe.id), !
|
|
362
|
-
},
|
|
361
|
+
j()(oe.id), !b() && (P.target instanceof Element && P.target.closest('[data-floe-workbench-sticky-local="true"]') || (w()?.(oe.id), g.beginDrag(P)));
|
|
362
|
+
}, g = Ee({
|
|
363
363
|
viewportScale: i,
|
|
364
364
|
readPosition: () => ({
|
|
365
365
|
x: t().x,
|
|
366
366
|
y: t().y
|
|
367
367
|
}),
|
|
368
|
-
onCommitMove: (
|
|
368
|
+
onCommitMove: (P) => C()(t().id, P),
|
|
369
369
|
onCommitStart: () => z()?.(t().id),
|
|
370
370
|
onInteractionStart: () => f()?.(),
|
|
371
|
-
onInteractionEnd: () =>
|
|
371
|
+
onInteractionEnd: () => a()?.()
|
|
372
372
|
}), H = Oe({
|
|
373
373
|
viewportScale: i,
|
|
374
374
|
readSize: () => ({
|
|
@@ -377,52 +377,52 @@ function Zt(e) {
|
|
|
377
377
|
}),
|
|
378
378
|
minWidth: Et,
|
|
379
379
|
minHeight: Pt,
|
|
380
|
-
onCommitResize: (
|
|
380
|
+
onCommitResize: (P) => s()(t().id, P),
|
|
381
381
|
onInteractionStart: () => f()?.(),
|
|
382
|
-
onInteractionEnd: () =>
|
|
383
|
-
}), J = S(() =>
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
return
|
|
382
|
+
onInteractionEnd: () => a()?.()
|
|
383
|
+
}), J = S(() => g.position()), Q = S(() => H.size()), K = S(() => {
|
|
384
|
+
const P = c();
|
|
385
|
+
if (P)
|
|
386
|
+
return dt({
|
|
387
387
|
widgetId: t().id,
|
|
388
388
|
worldX: J().x,
|
|
389
389
|
worldY: J().y,
|
|
390
390
|
worldWidth: Q().width,
|
|
391
391
|
worldHeight: Q().height,
|
|
392
|
-
viewport:
|
|
393
|
-
ready:
|
|
392
|
+
viewport: P(),
|
|
393
|
+
ready: v()
|
|
394
394
|
});
|
|
395
|
-
}), de = S(() => K()?.rect.viewportScale ?? Math.max(i(), 1e-3)),
|
|
395
|
+
}), de = S(() => K()?.rect.viewportScale ?? Math.max(i(), 1e-3)), be = S(() => ({
|
|
396
396
|
width: `${Q().width}px`,
|
|
397
397
|
height: `${Q().height}px`,
|
|
398
|
-
transform:
|
|
398
|
+
transform: c() ? `translate(${K()?.rect.screenX ?? 0}px, ${K()?.rect.screenY ?? 0}px) scale(${de()})` : `translate(${J().x}px, ${J().y}px)`,
|
|
399
399
|
"transform-origin": "0 0",
|
|
400
|
-
"z-index": `${
|
|
400
|
+
"z-index": `${u() || $() || g.isDragging() || H.isResizing() ? p() + 1 : y()}`
|
|
401
401
|
}));
|
|
402
402
|
return (() => {
|
|
403
|
-
var
|
|
404
|
-
|
|
403
|
+
var P = wt(), oe = P.firstChild, ue = oe.firstChild, Z = ue.firstChild, B = ue.nextSibling;
|
|
404
|
+
P.$$contextmenu = (x) => {
|
|
405
405
|
x.preventDefault(), x.stopPropagation(), L()?.(x, t());
|
|
406
|
-
},
|
|
406
|
+
}, P.addEventListener("focus", () => j()(t().id)), P.$$pointerdown = M, Z.$$pointerdown = (x) => {
|
|
407
407
|
const X = t();
|
|
408
|
-
j()(X.id), w()?.(X.id),
|
|
409
|
-
},
|
|
408
|
+
j()(X.id), w()?.(X.id), g.beginDrag(x);
|
|
409
|
+
}, R(Z, k(Ye, {
|
|
410
410
|
class: "w-3.5 h-3.5"
|
|
411
411
|
})), V(B, "compositionend", r.handleCompositionEnd), V(B, "compositionstart", r.handleCompositionStart), V(B, "keydown", r.handleKeyDown, !0), V(B, "input", r.handleInput, !0), V(B, "blur", r.handleBlur), V(B, "focus", r.handleFocus), B.$$pointerdown = (x) => {
|
|
412
412
|
x.stopPropagation(), j()(t().id);
|
|
413
413
|
};
|
|
414
414
|
var ee = r.bind;
|
|
415
|
-
return typeof ee == "function" ? fe(ee, B) : r.bind = B, _(B, "spellcheck", !1),
|
|
415
|
+
return typeof ee == "function" ? fe(ee, B) : r.bind = B, _(B, "spellcheck", !1), R(P, k(te, {
|
|
416
416
|
get when() {
|
|
417
|
-
return
|
|
417
|
+
return ge(() => !!u())() && !b();
|
|
418
418
|
},
|
|
419
419
|
get children() {
|
|
420
|
-
var x =
|
|
420
|
+
var x = ut(), X = x.firstChild, ne = X.nextSibling, ae = ne.nextSibling;
|
|
421
421
|
return X.$$click = async (N) => {
|
|
422
|
-
A(N), await
|
|
423
|
-
}, X.$$pointerdown = Y,
|
|
422
|
+
A(N), await W();
|
|
423
|
+
}, X.$$pointerdown = Y, R(X, k(te, {
|
|
424
424
|
get when() {
|
|
425
|
-
return
|
|
425
|
+
return l();
|
|
426
426
|
},
|
|
427
427
|
get fallback() {
|
|
428
428
|
return k(et, {
|
|
@@ -442,35 +442,35 @@ function Zt(e) {
|
|
|
442
442
|
});
|
|
443
443
|
}, ne.$$pointerdown = Y, ae.$$click = (N) => {
|
|
444
444
|
A(N), h()(t().id);
|
|
445
|
-
}, ae.$$pointerdown = Y,
|
|
445
|
+
}, ae.$$pointerdown = Y, R(ae, k(Te, {
|
|
446
446
|
class: "w-3.5 h-3.5"
|
|
447
447
|
})), U((N) => {
|
|
448
|
-
var ie = !!
|
|
448
|
+
var ie = !!l(), ce = l() ? "Sticky note content copied" : "Copy sticky note content";
|
|
449
449
|
return ie !== N.e && X.classList.toggle("is-success", N.e = ie), ce !== N.t && _(X, "title", N.t = ce), N;
|
|
450
450
|
}, {
|
|
451
451
|
e: void 0,
|
|
452
452
|
t: void 0
|
|
453
453
|
}), x;
|
|
454
454
|
}
|
|
455
|
-
}), null),
|
|
455
|
+
}), null), R(P, k(te, {
|
|
456
456
|
get when() {
|
|
457
|
-
return !
|
|
457
|
+
return !b();
|
|
458
458
|
},
|
|
459
459
|
get children() {
|
|
460
|
-
var x =
|
|
460
|
+
var x = ht();
|
|
461
461
|
return V(x, "pointerdown", H.beginResize, !0), x;
|
|
462
462
|
}
|
|
463
463
|
}), null), U((x) => {
|
|
464
464
|
var X = {
|
|
465
|
-
"is-selected":
|
|
466
|
-
"is-locked":
|
|
467
|
-
"is-filtered-out":
|
|
468
|
-
"is-dragging":
|
|
465
|
+
"is-selected": u(),
|
|
466
|
+
"is-locked": b(),
|
|
467
|
+
"is-filtered-out": E(),
|
|
468
|
+
"is-dragging": g.isDragging(),
|
|
469
469
|
"is-resizing": H.isResizing(),
|
|
470
|
-
"is-copied":
|
|
471
|
-
[
|
|
472
|
-
}, ne = t().id, ae = t().id, N = t().id, ie =
|
|
473
|
-
return x.e = Ie(
|
|
470
|
+
"is-copied": l(),
|
|
471
|
+
[Dt[t().color]]: !0
|
|
472
|
+
}, ne = t().id, ae = t().id, N = t().id, ie = be(), ce = !b(), d = b() ? "true" : void 0;
|
|
473
|
+
return x.e = Ie(P, X, x.e), ne !== x.t && _(P, "data-floe-workbench-widget-id", x.t = ne), ae !== x.a && _(P, "data-wb-object-id", x.a = ae), N !== x.o && _(P, "data-floe-workbench-sticky-id", x.o = N), x.i = ve(P, ie, x.i), ce !== x.n && _(B, "contenteditable", x.n = ce), d !== x.s && _(B, "aria-disabled", x.s = d), x;
|
|
474
474
|
}, {
|
|
475
475
|
e: void 0,
|
|
476
476
|
t: void 0,
|
|
@@ -479,32 +479,32 @@ function Zt(e) {
|
|
|
479
479
|
i: void 0,
|
|
480
480
|
n: void 0,
|
|
481
481
|
s: void 0
|
|
482
|
-
}),
|
|
482
|
+
}), P;
|
|
483
483
|
})();
|
|
484
484
|
}
|
|
485
485
|
function Gt(e) {
|
|
486
|
-
const t = n(() => e.item),
|
|
486
|
+
const t = n(() => e.item), u = n(() => e.selected), i = n(() => e.editable), c = n(() => e.viewportScale), v = n(() => e.viewport ?? {
|
|
487
487
|
x: 0,
|
|
488
488
|
y: 0,
|
|
489
489
|
scale: 1
|
|
490
|
-
}), y = n(() => e.projection), p = n(() => e.preview),
|
|
490
|
+
}), y = n(() => e.projection), p = n(() => e.preview), b = n(() => e.textEditorRegistry), E = n(() => e.onPreviewGeometry), $ = n(() => e.onSelect), j = n(() => e.onContextMenu), L = n(() => e.onCommitMove), w = n(() => e.onUpdate), z = Je({
|
|
491
491
|
value: () => t().text,
|
|
492
|
-
onCommit: (
|
|
493
|
-
text:
|
|
492
|
+
onCommit: (a) => w()(t().id, {
|
|
493
|
+
text: a
|
|
494
494
|
})
|
|
495
495
|
});
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
if (!
|
|
499
|
-
const r =
|
|
496
|
+
Re(() => {
|
|
497
|
+
const a = b();
|
|
498
|
+
if (!a) return;
|
|
499
|
+
const r = a.register(t().id, {
|
|
500
500
|
focus: z.focus,
|
|
501
501
|
insertTextAtSelection: z.insertTextAtSelection,
|
|
502
502
|
readText: z.readText
|
|
503
503
|
});
|
|
504
504
|
ke(r);
|
|
505
505
|
});
|
|
506
|
-
const C =
|
|
507
|
-
viewportScale:
|
|
506
|
+
const C = Ee({
|
|
507
|
+
viewportScale: c,
|
|
508
508
|
readPosition: () => ({
|
|
509
509
|
x: t().x,
|
|
510
510
|
y: t().y
|
|
@@ -513,27 +513,27 @@ function Gt(e) {
|
|
|
513
513
|
width: t().width,
|
|
514
514
|
height: t().height
|
|
515
515
|
}),
|
|
516
|
-
onCommitMove: (
|
|
517
|
-
onPreviewMove: (
|
|
516
|
+
onCommitMove: (a) => L()(t().id, a),
|
|
517
|
+
onPreviewMove: (a) => E()?.({
|
|
518
518
|
kind: "annotation",
|
|
519
519
|
id: t().id,
|
|
520
|
-
...
|
|
520
|
+
...a
|
|
521
521
|
}),
|
|
522
|
-
onPreviewEnd: () =>
|
|
523
|
-
}),
|
|
524
|
-
const
|
|
522
|
+
onPreviewEnd: () => E()?.(null)
|
|
523
|
+
}), s = S(() => {
|
|
524
|
+
const a = t(), r = xe(p(), "annotation", a.id);
|
|
525
525
|
return $e({
|
|
526
526
|
geometry: Ce({
|
|
527
527
|
preview: r,
|
|
528
528
|
position: C.position(),
|
|
529
|
-
width:
|
|
530
|
-
height:
|
|
529
|
+
width: a.width,
|
|
530
|
+
height: a.height
|
|
531
531
|
}),
|
|
532
|
-
viewport:
|
|
532
|
+
viewport: v(),
|
|
533
533
|
projection: y()
|
|
534
534
|
});
|
|
535
|
-
}), m = S(() => y() === "screen" ? Math.max(
|
|
536
|
-
..._e(
|
|
535
|
+
}), m = S(() => y() === "screen" ? Math.max(v().scale, 1e-3) : 1), h = S(() => ({
|
|
536
|
+
..._e(s()),
|
|
537
537
|
"z-index": `${t().z_index}`,
|
|
538
538
|
"--workbench-text-color": t().color,
|
|
539
539
|
"--workbench-text-size": `${t().font_size}px`,
|
|
@@ -542,22 +542,22 @@ function Gt(e) {
|
|
|
542
542
|
"--workbench-text-family": t().font_family,
|
|
543
543
|
"--workbench-text-content-scale": `${m()}`,
|
|
544
544
|
"--workbench-text-content-inverse-scale": `${1 / m()}`
|
|
545
|
-
})), f = (
|
|
546
|
-
!i() ||
|
|
545
|
+
})), f = (a) => {
|
|
546
|
+
!i() || a.button !== 0 || a.target instanceof Element && a.target.closest(".workbench-text-annotation__content") || (a.stopPropagation(), $()(t().id));
|
|
547
547
|
};
|
|
548
548
|
return (() => {
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
var a = mt(), r = a.firstChild;
|
|
550
|
+
a.$$contextmenu = (o) => {
|
|
551
551
|
i() && (o.preventDefault(), o.stopPropagation(), $()(t().id), j()?.(o, t()));
|
|
552
|
-
},
|
|
552
|
+
}, a.$$pointerdown = f, V(r, "compositionend", z.handleCompositionEnd), V(r, "compositionstart", z.handleCompositionStart), V(r, "input", z.handleInput, !0), V(r, "blur", z.handleBlur), r.addEventListener("focus", (o) => {
|
|
553
553
|
z.handleFocus(o), i() && $()(t().id);
|
|
554
554
|
}), r.$$pointerdown = (o) => {
|
|
555
555
|
!i() || o.button !== 0 || $()(t().id);
|
|
556
556
|
};
|
|
557
|
-
var
|
|
558
|
-
return typeof
|
|
559
|
-
var T = !!
|
|
560
|
-
return T !== o.e &&
|
|
557
|
+
var l = z.bind;
|
|
558
|
+
return typeof l == "function" ? fe(l, r) : z.bind = r, _(r, "spellcheck", !1), U((o) => {
|
|
559
|
+
var T = !!u(), q = !!i(), F = i() ? "true" : void 0, W = t().id, M = h(), g = i() ? "plaintext-only" : !1, H = i() ? 0 : void 0, J = i() ? "textbox" : void 0, Q = i() ? "true" : void 0, K = i() ? void 0 : "true";
|
|
560
|
+
return T !== o.e && a.classList.toggle("is-selected", o.e = T), q !== o.t && a.classList.toggle("is-editable", o.t = q), F !== o.a && _(a, "data-floe-canvas-interactive", o.a = F), W !== o.o && _(a, "data-wb-object-id", o.o = W), o.i = ve(a, M, o.i), g !== o.n && _(r, "contenteditable", o.n = g), H !== o.s && _(r, "tabindex", o.s = H), J !== o.h && _(r, "role", o.h = J), Q !== o.r && _(r, "aria-multiline", o.r = Q), K !== o.d && _(r, "aria-disabled", o.d = K), o;
|
|
561
561
|
}, {
|
|
562
562
|
e: void 0,
|
|
563
563
|
t: void 0,
|
|
@@ -569,16 +569,16 @@ function Gt(e) {
|
|
|
569
569
|
h: void 0,
|
|
570
570
|
r: void 0,
|
|
571
571
|
d: void 0
|
|
572
|
-
}),
|
|
572
|
+
}), a;
|
|
573
573
|
})();
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
const t = n(() => e.item),
|
|
575
|
+
function Ht(e) {
|
|
576
|
+
const t = n(() => e.item), u = n(() => e.selected), i = n(() => e.editable), c = n(() => e.viewportScale), v = n(() => e.viewport ?? {
|
|
577
577
|
x: 0,
|
|
578
578
|
y: 0,
|
|
579
579
|
scale: 1
|
|
580
|
-
}), y = n(() => e.projection), p = n(() => e.preview),
|
|
581
|
-
viewportScale:
|
|
580
|
+
}), y = n(() => e.projection), p = n(() => e.preview), b = n(() => e.onPreviewGeometry), E = n(() => e.onSelect), $ = n(() => e.onContextMenu), j = n(() => e.onCommitMove), L = Ee({
|
|
581
|
+
viewportScale: c,
|
|
582
582
|
readPosition: () => ({
|
|
583
583
|
x: t().x,
|
|
584
584
|
y: t().y
|
|
@@ -587,62 +587,62 @@ function Wt(e) {
|
|
|
587
587
|
width: t().width,
|
|
588
588
|
height: t().height
|
|
589
589
|
}),
|
|
590
|
-
onCommitMove: (
|
|
591
|
-
onPreviewMove: (
|
|
590
|
+
onCommitMove: (s) => j()(t().id, s),
|
|
591
|
+
onPreviewMove: (s) => b()?.({
|
|
592
592
|
kind: "background_layer",
|
|
593
593
|
id: t().id,
|
|
594
|
-
...
|
|
594
|
+
...s
|
|
595
595
|
}),
|
|
596
|
-
onPreviewEnd: () =>
|
|
596
|
+
onPreviewEnd: () => b()?.(null)
|
|
597
597
|
}), w = S(() => {
|
|
598
|
-
const
|
|
598
|
+
const s = t(), m = xe(p(), "background_layer", s.id);
|
|
599
599
|
return $e({
|
|
600
600
|
geometry: Ce({
|
|
601
601
|
preview: m,
|
|
602
602
|
position: L.position(),
|
|
603
|
-
width:
|
|
604
|
-
height:
|
|
603
|
+
width: s.width,
|
|
604
|
+
height: s.height
|
|
605
605
|
}),
|
|
606
|
-
viewport:
|
|
606
|
+
viewport: v(),
|
|
607
607
|
projection: y()
|
|
608
608
|
});
|
|
609
609
|
}), z = S(() => ({
|
|
610
610
|
..._e(w()),
|
|
611
611
|
"z-index": `${t().z_index}`,
|
|
612
612
|
...De(t())
|
|
613
|
-
})), C = (
|
|
614
|
-
!i() ||
|
|
613
|
+
})), C = (s) => {
|
|
614
|
+
!i() || s.button !== 0 || s.target instanceof Element && s.target.closest(".workbench-background-region__toolbar, .workbench-layer-resize") || (E()(t().id), L.beginDrag(s));
|
|
615
615
|
};
|
|
616
616
|
return (() => {
|
|
617
|
-
var
|
|
618
|
-
return
|
|
619
|
-
i() && (m.preventDefault(), m.stopPropagation(),
|
|
620
|
-
},
|
|
617
|
+
var s = gt();
|
|
618
|
+
return s.$$contextmenu = (m) => {
|
|
619
|
+
i() && (m.preventDefault(), m.stopPropagation(), E()(t().id), $()?.(m, t()));
|
|
620
|
+
}, s.addEventListener("focus", () => i() && E()(t().id)), s.$$pointerdown = C, U((m) => {
|
|
621
621
|
var h = {
|
|
622
|
-
"is-selected":
|
|
622
|
+
"is-selected": u(),
|
|
623
623
|
"is-editable": i(),
|
|
624
624
|
"is-transforming": L.isDragging(),
|
|
625
625
|
[`is-material-${t().material}`]: !0
|
|
626
|
-
}, f = i() ? "true" : void 0,
|
|
627
|
-
return m.e = Ie(
|
|
626
|
+
}, f = i() ? "true" : void 0, a = t().id, r = z(), l = i() ? 0 : void 0;
|
|
627
|
+
return m.e = Ie(s, h, m.e), f !== m.t && _(s, "data-floe-canvas-interactive", m.t = f), a !== m.a && _(s, "data-wb-object-id", m.a = a), m.o = ve(s, r, m.o), l !== m.i && _(s, "tabindex", m.i = l), m;
|
|
628
628
|
}, {
|
|
629
629
|
e: void 0,
|
|
630
630
|
t: void 0,
|
|
631
631
|
a: void 0,
|
|
632
632
|
o: void 0,
|
|
633
633
|
i: void 0
|
|
634
|
-
}),
|
|
634
|
+
}), s;
|
|
635
635
|
})();
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
const t = n(() => e.item),
|
|
637
|
+
function Nt(e) {
|
|
638
|
+
const t = n(() => e.item), u = n(() => e.viewportScale), i = n(() => e.viewport ?? {
|
|
639
639
|
x: 0,
|
|
640
640
|
y: 0,
|
|
641
641
|
scale: 1
|
|
642
|
-
}),
|
|
642
|
+
}), c = n(() => e.projection), v = n(() => e.preview), y = n(() => e.textEditorRegistry), p = n(() => e.onPreviewGeometry), b = n(() => e.onCommitMove), E = n(() => e.onCommitResize), $ = n(() => e.onUpdate), j = n(() => e.onDelete);
|
|
643
643
|
let L, w, z;
|
|
644
|
-
const [C,
|
|
645
|
-
viewportScale:
|
|
644
|
+
const [C, s] = re(""), [m, h] = re(!1), [f, a] = re(!1), r = S(() => Pe.find((g) => g.fontFamily === t().font_family) ?? Pe[0]), l = Ee({
|
|
645
|
+
viewportScale: u,
|
|
646
646
|
readPosition: () => ({
|
|
647
647
|
x: t().x,
|
|
648
648
|
y: t().y
|
|
@@ -651,91 +651,91 @@ function Ht(e) {
|
|
|
651
651
|
width: t().width,
|
|
652
652
|
height: t().height
|
|
653
653
|
}),
|
|
654
|
-
onCommitMove: (
|
|
655
|
-
onPreviewMove: (
|
|
654
|
+
onCommitMove: (g) => b()(t().id, g),
|
|
655
|
+
onPreviewMove: (g) => p()?.({
|
|
656
656
|
kind: "annotation",
|
|
657
657
|
id: t().id,
|
|
658
|
-
...
|
|
658
|
+
...g
|
|
659
659
|
}),
|
|
660
660
|
onPreviewEnd: () => p()?.(null)
|
|
661
661
|
}), o = Oe({
|
|
662
|
-
viewportScale:
|
|
662
|
+
viewportScale: u,
|
|
663
663
|
readSize: () => ({
|
|
664
664
|
width: t().width,
|
|
665
665
|
height: t().height
|
|
666
666
|
}),
|
|
667
|
-
minWidth:
|
|
668
|
-
minHeight:
|
|
669
|
-
onCommitResize: (
|
|
670
|
-
onPreviewResize: (
|
|
667
|
+
minWidth: jt,
|
|
668
|
+
minHeight: Lt,
|
|
669
|
+
onCommitResize: (g) => E()(t().id, g),
|
|
670
|
+
onPreviewResize: (g) => p()?.({
|
|
671
671
|
kind: "annotation",
|
|
672
672
|
id: t().id,
|
|
673
673
|
x: t().x,
|
|
674
674
|
y: t().y,
|
|
675
|
-
width:
|
|
676
|
-
height:
|
|
675
|
+
width: g.width,
|
|
676
|
+
height: g.height
|
|
677
677
|
}),
|
|
678
678
|
onPreviewEnd: () => p()?.(null)
|
|
679
679
|
}), T = S(() => {
|
|
680
|
-
const
|
|
680
|
+
const g = t(), H = xe(v(), "annotation", g.id);
|
|
681
681
|
return $e({
|
|
682
682
|
geometry: Ce({
|
|
683
683
|
preview: H,
|
|
684
|
-
position:
|
|
684
|
+
position: l.position(),
|
|
685
685
|
width: o.size().width,
|
|
686
686
|
height: o.size().height
|
|
687
687
|
}),
|
|
688
688
|
viewport: i(),
|
|
689
|
-
projection:
|
|
689
|
+
projection: c()
|
|
690
690
|
});
|
|
691
691
|
}), q = S(() => ({
|
|
692
692
|
..._e(T()),
|
|
693
693
|
"z-index": `${t().z_index}`,
|
|
694
694
|
"--workbench-layer-control-inverse-scale": `${1 / Math.max(T().scale, 1e-3)}`
|
|
695
|
-
})), F = () => Ve(["left", "center", "right"], t().align),
|
|
696
|
-
if (!Number.isFinite(
|
|
697
|
-
const H =
|
|
698
|
-
|
|
695
|
+
})), F = () => Ve(["left", "center", "right"], t().align), W = (g) => {
|
|
696
|
+
if (!Number.isFinite(g)) return;
|
|
697
|
+
const H = Wt(g);
|
|
698
|
+
s(String(H)), $()(t().id, {
|
|
699
699
|
font_size: H
|
|
700
700
|
});
|
|
701
701
|
}, M = () => {
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
|
|
702
|
+
const g = C().trim(), H = Number(g);
|
|
703
|
+
if (g.length > 0 && Number.isFinite(H)) {
|
|
704
|
+
W(H);
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
|
|
707
|
+
s(String(t().font_size));
|
|
708
708
|
};
|
|
709
|
-
return
|
|
710
|
-
typeof document < "u" && document.activeElement === L ||
|
|
711
|
-
}), Be(m, () => w, () => h(!1)), Be(f, () => z, () =>
|
|
712
|
-
var
|
|
713
|
-
J.$$click = we, J.$$pointerdown = he, Q.$$click = A, V(Q, "pointerdown",
|
|
709
|
+
return Re(() => {
|
|
710
|
+
typeof document < "u" && document.activeElement === L || s(String(t().font_size));
|
|
711
|
+
}), Be(m, () => w, () => h(!1)), Be(f, () => z, () => a(!1)), (() => {
|
|
712
|
+
var g = yt(), H = g.firstChild, J = H.nextSibling, Q = J.firstChild, K = Q.nextSibling, de = K.firstChild, be = de.firstChild, P = be.nextSibling, oe = K.nextSibling, ue = oe.firstChild, Z = ue.nextSibling, B = Z.nextSibling, ee = oe.nextSibling, x = ee.firstChild, X = ee.nextSibling, ne = X.nextSibling, ae = J.nextSibling;
|
|
713
|
+
J.$$click = we, J.$$pointerdown = he, Q.$$click = A, V(Q, "pointerdown", l.beginDrag, !0), R(Q, k(Ye, {
|
|
714
714
|
class: "w-3.5 h-3.5"
|
|
715
715
|
})), K.$$click = we, K.$$pointerdown = he;
|
|
716
716
|
var N = w;
|
|
717
|
-
typeof N == "function" ? fe(N, K) : w = K, de.$$click = (
|
|
718
|
-
A(
|
|
719
|
-
}, de.$$pointerdown = Y,
|
|
717
|
+
typeof N == "function" ? fe(N, K) : w = K, de.$$click = (d) => {
|
|
718
|
+
A(d), h((I) => !I);
|
|
719
|
+
}, de.$$pointerdown = Y, R(P, () => r().label), R(de, k(tt, {
|
|
720
720
|
class: "workbench-text-font-trigger__icon"
|
|
721
|
-
}), null),
|
|
721
|
+
}), null), R(K, k(te, {
|
|
722
722
|
get when() {
|
|
723
723
|
return m();
|
|
724
724
|
},
|
|
725
725
|
get children() {
|
|
726
|
-
var
|
|
727
|
-
return
|
|
728
|
-
each:
|
|
726
|
+
var d = vt();
|
|
727
|
+
return R(d, k(se, {
|
|
728
|
+
each: Pe,
|
|
729
729
|
children: (I) => (() => {
|
|
730
|
-
var D =
|
|
731
|
-
return D.$$click = (
|
|
732
|
-
A(
|
|
730
|
+
var D = ft(), le = D.firstChild, Se = le.nextSibling;
|
|
731
|
+
return D.$$click = (G) => {
|
|
732
|
+
A(G), $()(t().id, {
|
|
733
733
|
font_family: I.fontFamily,
|
|
734
734
|
font_weight: I.fontWeight
|
|
735
735
|
}), h(!1);
|
|
736
|
-
}, D.$$pointerdown = Y,
|
|
737
|
-
var ye = t().font_family === I.fontFamily,
|
|
738
|
-
return ye !==
|
|
736
|
+
}, D.$$pointerdown = Y, R(Se, () => I.label), U((G) => {
|
|
737
|
+
var ye = t().font_family === I.fontFamily, We = `Use ${I.label} bold font`, Ge = `${I.label} bold`, He = t().font_family === I.fontFamily, Ne = I.fontFamily, Ae = `${I.fontWeight}`;
|
|
738
|
+
return ye !== G.e && _(D, "aria-checked", G.e = ye), We !== G.t && _(D, "aria-label", G.t = We), Ge !== G.a && _(D, "title", G.a = Ge), He !== G.o && D.classList.toggle("is-active", G.o = He), Ne !== G.i && me(le, "font-family", G.i = Ne), Ae !== G.n && me(le, "font-weight", G.n = Ae), G;
|
|
739
739
|
}, {
|
|
740
740
|
e: void 0,
|
|
741
741
|
t: void 0,
|
|
@@ -745,61 +745,61 @@ function Ht(e) {
|
|
|
745
745
|
n: void 0
|
|
746
746
|
}), D;
|
|
747
747
|
})()
|
|
748
|
-
})),
|
|
748
|
+
})), d;
|
|
749
749
|
}
|
|
750
|
-
}), null), oe.$$click = we, oe.$$pointerdown = he, ue.$$click = (
|
|
751
|
-
A(
|
|
752
|
-
}, ue.$$pointerdown = Y,
|
|
750
|
+
}), null), oe.$$click = we, oe.$$pointerdown = he, ue.$$click = (d) => {
|
|
751
|
+
A(d), W(t().font_size - 1);
|
|
752
|
+
}, ue.$$pointerdown = Y, R(ue, k(nt, {
|
|
753
753
|
class: "w-3 h-3"
|
|
754
|
-
})), Z.$$keydown = (
|
|
755
|
-
|
|
756
|
-
}, Z.addEventListener("blur", M), Z.$$input = (
|
|
754
|
+
})), Z.$$keydown = (d) => {
|
|
755
|
+
d.key === "Enter" && (d.preventDefault(), M(), d.currentTarget.blur());
|
|
756
|
+
}, Z.addEventListener("blur", M), Z.$$input = (d) => s(d.currentTarget.value), Z.$$click = we, Z.$$pointerdown = he;
|
|
757
757
|
var ie = L;
|
|
758
|
-
typeof ie == "function" ? fe(ie, Z) : L = Z, B.$$click = (
|
|
759
|
-
A(
|
|
760
|
-
}, B.$$pointerdown = Y,
|
|
758
|
+
typeof ie == "function" ? fe(ie, Z) : L = Z, B.$$click = (d) => {
|
|
759
|
+
A(d), W(t().font_size + 1);
|
|
760
|
+
}, B.$$pointerdown = Y, R(B, k(it, {
|
|
761
761
|
class: "w-3 h-3"
|
|
762
|
-
})),
|
|
762
|
+
})), R(J, k(se, {
|
|
763
763
|
each: ct,
|
|
764
|
-
children: (
|
|
765
|
-
var I =
|
|
764
|
+
children: (d) => (() => {
|
|
765
|
+
var I = kt();
|
|
766
766
|
return I.$$click = (D) => {
|
|
767
767
|
A(D), $()(t().id, {
|
|
768
|
-
color:
|
|
768
|
+
color: d
|
|
769
769
|
});
|
|
770
|
-
}, I.$$pointerdown = Y, _(I, "aria-label", `Use text color ${
|
|
770
|
+
}, I.$$pointerdown = Y, _(I, "aria-label", `Use text color ${d}`), me(I, "background", d), U(() => I.classList.toggle("is-active", t().color === d)), I;
|
|
771
771
|
})()
|
|
772
772
|
}), ee), ee.$$click = we, ee.$$pointerdown = he;
|
|
773
773
|
var ce = z;
|
|
774
|
-
return typeof ce == "function" ? fe(ce, ee) : z = ee, x.$$click = (
|
|
775
|
-
A(
|
|
776
|
-
}, x.$$pointerdown = Y,
|
|
774
|
+
return typeof ce == "function" ? fe(ce, ee) : z = ee, x.$$click = (d) => {
|
|
775
|
+
A(d), a((I) => !I);
|
|
776
|
+
}, x.$$pointerdown = Y, R(ee, k(te, {
|
|
777
777
|
get when() {
|
|
778
778
|
return f();
|
|
779
779
|
},
|
|
780
780
|
get children() {
|
|
781
|
-
var
|
|
782
|
-
return
|
|
781
|
+
var d = bt();
|
|
782
|
+
return R(d, k(se, {
|
|
783
783
|
each: lt,
|
|
784
784
|
children: (I) => (() => {
|
|
785
|
-
var D =
|
|
785
|
+
var D = xt();
|
|
786
786
|
return D.$$click = (le) => {
|
|
787
|
-
A(le), y()?.get(t().id)?.insertTextAtSelection(I),
|
|
788
|
-
}, D.$$pointerdown = Y, _(D, "aria-label", `Insert emoji ${I}`), _(D, "title", `Insert ${I}`),
|
|
787
|
+
A(le), y()?.get(t().id)?.insertTextAtSelection(I), a(!1);
|
|
788
|
+
}, D.$$pointerdown = Y, _(D, "aria-label", `Insert emoji ${I}`), _(D, "title", `Insert ${I}`), R(D, I), D;
|
|
789
789
|
})()
|
|
790
|
-
})),
|
|
790
|
+
})), d;
|
|
791
791
|
}
|
|
792
|
-
}), null), X.$$click = (
|
|
793
|
-
A(
|
|
792
|
+
}), null), X.$$click = (d) => {
|
|
793
|
+
A(d), $()(t().id, {
|
|
794
794
|
align: F()
|
|
795
795
|
});
|
|
796
|
-
}, X.$$pointerdown = Y,
|
|
797
|
-
A(
|
|
798
|
-
}, ne.$$pointerdown = Y,
|
|
796
|
+
}, X.$$pointerdown = Y, R(X, () => t().align), ne.$$click = (d) => {
|
|
797
|
+
A(d), j()(t().id);
|
|
798
|
+
}, ne.$$pointerdown = Y, R(ne, k(Te, {
|
|
799
799
|
class: "w-3.5 h-3.5"
|
|
800
|
-
})), V(ae, "pointerdown", o.beginResize, !0), U((
|
|
801
|
-
var I = t().id, D = q(), le = m(), Se = r().fontFamily,
|
|
802
|
-
return I !==
|
|
800
|
+
})), V(ae, "pointerdown", o.beginResize, !0), U((d) => {
|
|
801
|
+
var I = t().id, D = q(), le = m(), Se = r().fontFamily, G = `${r().fontWeight}`, ye = f();
|
|
802
|
+
return I !== d.e && _(g, "data-wb-object-id", d.e = I), d.t = ve(g, D, d.t), le !== d.a && _(de, "aria-expanded", d.a = le), Se !== d.o && me(be, "font-family", d.o = Se), G !== d.i && me(be, "font-weight", d.i = G), ye !== d.n && _(x, "aria-expanded", d.n = ye), d;
|
|
803
803
|
}, {
|
|
804
804
|
e: void 0,
|
|
805
805
|
t: void 0,
|
|
@@ -807,22 +807,22 @@ function Ht(e) {
|
|
|
807
807
|
o: void 0,
|
|
808
808
|
i: void 0,
|
|
809
809
|
n: void 0
|
|
810
|
-
}), U(() => Z.value = C()),
|
|
810
|
+
}), U(() => Z.value = C()), g;
|
|
811
811
|
})();
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
const t = n(() => e.item),
|
|
813
|
+
function At(e) {
|
|
814
|
+
const t = n(() => e.item), u = n(() => e.viewportScale), i = n(() => e.viewport ?? {
|
|
815
815
|
x: 0,
|
|
816
816
|
y: 0,
|
|
817
817
|
scale: 1
|
|
818
|
-
}),
|
|
819
|
-
viewportScale:
|
|
818
|
+
}), c = n(() => e.projection), v = n(() => e.preview), y = n(() => e.onPreviewGeometry), p = n(() => e.onCommitResize), b = n(() => e.onUpdate), E = n(() => e.onDelete), $ = Oe({
|
|
819
|
+
viewportScale: u,
|
|
820
820
|
readSize: () => ({
|
|
821
821
|
width: t().width,
|
|
822
822
|
height: t().height
|
|
823
823
|
}),
|
|
824
|
-
minWidth:
|
|
825
|
-
minHeight:
|
|
824
|
+
minWidth: It,
|
|
825
|
+
minHeight: Tt,
|
|
826
826
|
onCommitResize: (w) => p()(t().id, w),
|
|
827
827
|
onPreviewResize: (w) => y()?.({
|
|
828
828
|
kind: "background_layer",
|
|
@@ -834,7 +834,7 @@ function Nt(e) {
|
|
|
834
834
|
}),
|
|
835
835
|
onPreviewEnd: () => y()?.(null)
|
|
836
836
|
}), j = S(() => {
|
|
837
|
-
const w = t(), z = xe(
|
|
837
|
+
const w = t(), z = xe(v(), "background_layer", w.id);
|
|
838
838
|
return $e({
|
|
839
839
|
geometry: Ce({
|
|
840
840
|
preview: z,
|
|
@@ -846,7 +846,7 @@ function Nt(e) {
|
|
|
846
846
|
height: $.size().height
|
|
847
847
|
}),
|
|
848
848
|
viewport: i(),
|
|
849
|
-
projection:
|
|
849
|
+
projection: c()
|
|
850
850
|
});
|
|
851
851
|
}), L = S(() => ({
|
|
852
852
|
..._e(j()),
|
|
@@ -855,60 +855,60 @@ function Nt(e) {
|
|
|
855
855
|
...De(t())
|
|
856
856
|
}));
|
|
857
857
|
return (() => {
|
|
858
|
-
var w =
|
|
859
|
-
return C.$$click = we, C.$$pointerdown = he,
|
|
858
|
+
var w = $t(), z = w.firstChild, C = z.nextSibling, s = C.firstChild, m = s.nextSibling, h = m.firstChild, f = m.nextSibling, a = C.nextSibling;
|
|
859
|
+
return C.$$click = we, C.$$pointerdown = he, R(C, k(se, {
|
|
860
860
|
each: rt,
|
|
861
861
|
children: (r) => (() => {
|
|
862
|
-
var
|
|
863
|
-
return
|
|
864
|
-
A(o),
|
|
862
|
+
var l = _t();
|
|
863
|
+
return l.$$click = (o) => {
|
|
864
|
+
A(o), b()(t().id, {
|
|
865
865
|
fill: r
|
|
866
866
|
});
|
|
867
|
-
},
|
|
867
|
+
}, l.$$pointerdown = Y, _(l, "aria-label", `Use region color ${r}`), me(l, "background", r), U(() => l.classList.toggle("is-active", t().fill === r)), l;
|
|
868
868
|
})()
|
|
869
|
-
}),
|
|
869
|
+
}), s), s.$$click = we, s.$$pointerdown = he, R(s, k(se, {
|
|
870
870
|
each: at,
|
|
871
871
|
children: (r) => (() => {
|
|
872
|
-
var
|
|
873
|
-
return
|
|
874
|
-
A(o),
|
|
872
|
+
var l = Ct();
|
|
873
|
+
return l.$$click = (o) => {
|
|
874
|
+
A(o), b()(t().id, {
|
|
875
875
|
material: r
|
|
876
876
|
});
|
|
877
|
-
},
|
|
877
|
+
}, l.$$pointerdown = Y, U((o) => {
|
|
878
878
|
var T = `Use region material ${Fe[r]}`, q = Fe[r], F = {
|
|
879
879
|
"is-active": t().material === r,
|
|
880
880
|
[`is-${r}`]: !0
|
|
881
881
|
};
|
|
882
|
-
return T !== o.e && _(
|
|
882
|
+
return T !== o.e && _(l, "aria-label", o.e = T), q !== o.t && _(l, "title", o.t = q), o.a = Ie(l, F, o.a), o;
|
|
883
883
|
}, {
|
|
884
884
|
e: void 0,
|
|
885
885
|
t: void 0,
|
|
886
886
|
a: void 0
|
|
887
|
-
}),
|
|
887
|
+
}), l;
|
|
888
888
|
})()
|
|
889
889
|
})), m.$$click = (r) => {
|
|
890
|
-
A(r),
|
|
890
|
+
A(r), b()(t().id, {
|
|
891
891
|
opacity: t().opacity >= 0.88 ? 0.42 : t().opacity + 0.18
|
|
892
892
|
});
|
|
893
|
-
}, m.$$pointerdown = Y,
|
|
894
|
-
A(r),
|
|
895
|
-
}, f.$$pointerdown = Y,
|
|
893
|
+
}, m.$$pointerdown = Y, R(m, () => Math.round(t().opacity * 100), h), f.$$click = (r) => {
|
|
894
|
+
A(r), E()(t().id);
|
|
895
|
+
}, f.$$pointerdown = Y, R(f, k(Te, {
|
|
896
896
|
class: "w-3.5 h-3.5"
|
|
897
|
-
})), V(
|
|
898
|
-
var
|
|
899
|
-
return
|
|
897
|
+
})), V(a, "pointerdown", $.beginResize, !0), U((r) => {
|
|
898
|
+
var l = t().id, o = L();
|
|
899
|
+
return l !== r.e && _(w, "data-wb-object-id", r.e = l), r.t = ve(w, o, r.t), r;
|
|
900
900
|
}, {
|
|
901
901
|
e: void 0,
|
|
902
902
|
t: void 0
|
|
903
903
|
}), w;
|
|
904
904
|
})();
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
const t = n(() => e.item),
|
|
908
|
-
const p = t(),
|
|
906
|
+
function Ft(e) {
|
|
907
|
+
const t = n(() => e.item), u = n(() => e.viewport), i = n(() => e.projection), c = n(() => e.preview), v = S(() => {
|
|
908
|
+
const p = t(), b = xe(c(), "background_layer", p.id);
|
|
909
909
|
return $e({
|
|
910
910
|
geometry: Ce({
|
|
911
|
-
preview:
|
|
911
|
+
preview: b,
|
|
912
912
|
position: {
|
|
913
913
|
x: p.x,
|
|
914
914
|
y: p.y
|
|
@@ -916,19 +916,19 @@ function At(e) {
|
|
|
916
916
|
width: p.width,
|
|
917
917
|
height: p.height
|
|
918
918
|
}),
|
|
919
|
-
viewport:
|
|
919
|
+
viewport: u(),
|
|
920
920
|
projection: i()
|
|
921
921
|
});
|
|
922
922
|
}), y = S(() => ({
|
|
923
|
-
..._e(
|
|
924
|
-
"--workbench-region-outline-scale": `${1 / Math.max(
|
|
923
|
+
..._e(v()),
|
|
924
|
+
"--workbench-region-outline-scale": `${1 / Math.max(v().scale, 1e-3)}`,
|
|
925
925
|
...De(t())
|
|
926
926
|
}));
|
|
927
927
|
return (() => {
|
|
928
|
-
var p =
|
|
929
|
-
return U((
|
|
930
|
-
var
|
|
931
|
-
return
|
|
928
|
+
var p = St();
|
|
929
|
+
return U((b) => {
|
|
930
|
+
var E = !!e.selected, $ = t().id, j = y();
|
|
931
|
+
return E !== b.e && p.classList.toggle("is-selected-region", b.e = E), $ !== b.t && _(p, "data-wb-object-id", b.t = $), b.a = ve(p, j, b.a), b;
|
|
932
932
|
}, {
|
|
933
933
|
e: void 0,
|
|
934
934
|
t: void 0,
|
|
@@ -936,26 +936,26 @@ function At(e) {
|
|
|
936
936
|
}), p;
|
|
937
937
|
})();
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
const t = S(() => Le(e.items)),
|
|
939
|
+
function Bt(e) {
|
|
940
|
+
const t = S(() => Le(e.items)), u = S(() => je(e.items).map((i) => i.id));
|
|
941
941
|
return (() => {
|
|
942
|
-
var i =
|
|
943
|
-
return
|
|
942
|
+
var i = pt();
|
|
943
|
+
return R(i, k(se, {
|
|
944
944
|
get each() {
|
|
945
|
-
return
|
|
945
|
+
return u();
|
|
946
946
|
},
|
|
947
|
-
children: (
|
|
948
|
-
const
|
|
947
|
+
children: (c) => {
|
|
948
|
+
const v = S(() => t().get(c) ?? null);
|
|
949
949
|
return k(te, {
|
|
950
950
|
get when() {
|
|
951
|
-
return
|
|
951
|
+
return v();
|
|
952
952
|
},
|
|
953
|
-
children: (y) => k(
|
|
953
|
+
children: (y) => k(Ft, {
|
|
954
954
|
get item() {
|
|
955
955
|
return y();
|
|
956
956
|
},
|
|
957
957
|
get selected() {
|
|
958
|
-
return
|
|
958
|
+
return ge(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === c;
|
|
959
959
|
},
|
|
960
960
|
get viewport() {
|
|
961
961
|
return e.viewport;
|
|
@@ -972,26 +972,26 @@ function Ft(e) {
|
|
|
972
972
|
})), i;
|
|
973
973
|
})();
|
|
974
974
|
}
|
|
975
|
-
function
|
|
976
|
-
const t = S(() => Le(e.items)),
|
|
975
|
+
function tn(e) {
|
|
976
|
+
const t = S(() => Le(e.items)), u = S(() => je(e.items).map((i) => i.id));
|
|
977
977
|
return (() => {
|
|
978
|
-
var i =
|
|
979
|
-
return
|
|
978
|
+
var i = zt();
|
|
979
|
+
return R(i, k(se, {
|
|
980
980
|
get each() {
|
|
981
|
-
return
|
|
981
|
+
return u();
|
|
982
982
|
},
|
|
983
|
-
children: (
|
|
984
|
-
const
|
|
983
|
+
children: (c) => {
|
|
984
|
+
const v = S(() => t().get(c) ?? null);
|
|
985
985
|
return k(te, {
|
|
986
986
|
get when() {
|
|
987
|
-
return
|
|
987
|
+
return v();
|
|
988
988
|
},
|
|
989
|
-
children: (y) => k(
|
|
989
|
+
children: (y) => k(Ht, {
|
|
990
990
|
get item() {
|
|
991
991
|
return y();
|
|
992
992
|
},
|
|
993
993
|
get selected() {
|
|
994
|
-
return
|
|
994
|
+
return ge(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === c;
|
|
995
995
|
},
|
|
996
996
|
get editable() {
|
|
997
997
|
return e.editable;
|
|
@@ -1023,35 +1023,35 @@ function en(e) {
|
|
|
1023
1023
|
})
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
|
-
})), U((
|
|
1027
|
-
var
|
|
1028
|
-
return
|
|
1026
|
+
})), U((c) => {
|
|
1027
|
+
var v = !!e.editable, y = !!e.filtered;
|
|
1028
|
+
return v !== c.e && i.classList.toggle("is-editable", c.e = v), y !== c.t && i.classList.toggle("is-filtered-out", c.t = y), c;
|
|
1029
1029
|
}, {
|
|
1030
1030
|
e: void 0,
|
|
1031
1031
|
t: void 0
|
|
1032
1032
|
}), i;
|
|
1033
1033
|
})();
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
const t = S(() => Le(e.items)),
|
|
1035
|
+
function nn(e) {
|
|
1036
|
+
const t = S(() => Le(e.items)), u = S(() => je(e.items).map((i) => i.id));
|
|
1037
1037
|
return (() => {
|
|
1038
|
-
var i =
|
|
1039
|
-
return
|
|
1038
|
+
var i = Mt();
|
|
1039
|
+
return R(i, k(se, {
|
|
1040
1040
|
get each() {
|
|
1041
|
-
return
|
|
1041
|
+
return u();
|
|
1042
1042
|
},
|
|
1043
|
-
children: (
|
|
1044
|
-
const
|
|
1043
|
+
children: (c) => {
|
|
1044
|
+
const v = S(() => t().get(c) ?? null);
|
|
1045
1045
|
return k(te, {
|
|
1046
1046
|
get when() {
|
|
1047
|
-
return
|
|
1047
|
+
return v();
|
|
1048
1048
|
},
|
|
1049
1049
|
children: (y) => k(Gt, {
|
|
1050
1050
|
get item() {
|
|
1051
1051
|
return y();
|
|
1052
1052
|
},
|
|
1053
1053
|
get selected() {
|
|
1054
|
-
return
|
|
1054
|
+
return ge(() => e.selectedObject?.kind === "annotation")() && e.selectedObject.id === c;
|
|
1055
1055
|
},
|
|
1056
1056
|
get editable() {
|
|
1057
1057
|
return e.editable;
|
|
@@ -1089,25 +1089,25 @@ function tn(e) {
|
|
|
1089
1089
|
})
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
|
-
})), U((
|
|
1093
|
-
var
|
|
1094
|
-
return
|
|
1092
|
+
})), U((c) => {
|
|
1093
|
+
var v = !!e.editable, y = !!e.filtered;
|
|
1094
|
+
return v !== c.e && i.classList.toggle("is-editable", c.e = v), y !== c.t && i.classList.toggle("is-filtered-out", c.t = y), c;
|
|
1095
1095
|
}, {
|
|
1096
1096
|
e: void 0,
|
|
1097
1097
|
t: void 0
|
|
1098
1098
|
}), i;
|
|
1099
1099
|
})();
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1102
|
-
const t = S(() => e.selectedObject?.kind === "annotation" ? e.annotations.find((i) => i.id === e.selectedObject?.id && i.kind === "text") ?? null : null),
|
|
1101
|
+
function on(e) {
|
|
1102
|
+
const t = S(() => e.selectedObject?.kind === "annotation" ? e.annotations.find((i) => i.id === e.selectedObject?.id && i.kind === "text") ?? null : null), u = S(() => e.selectedObject?.kind === "background_layer" ? e.backgroundLayers.find((i) => i.id === e.selectedObject?.id) ?? null : null);
|
|
1103
1103
|
return (() => {
|
|
1104
|
-
var i =
|
|
1105
|
-
return
|
|
1104
|
+
var i = Rt();
|
|
1105
|
+
return R(i, k(te, {
|
|
1106
1106
|
get when() {
|
|
1107
1107
|
return e.showRegionOutlines;
|
|
1108
1108
|
},
|
|
1109
1109
|
get children() {
|
|
1110
|
-
return k(
|
|
1110
|
+
return k(Bt, {
|
|
1111
1111
|
get items() {
|
|
1112
1112
|
return e.backgroundLayers;
|
|
1113
1113
|
},
|
|
@@ -1125,13 +1125,13 @@ function nn(e) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
|
-
}), null),
|
|
1128
|
+
}), null), R(i, k(te, {
|
|
1129
1129
|
get when() {
|
|
1130
|
-
return
|
|
1130
|
+
return ge(() => !!e.editable)() && u();
|
|
1131
1131
|
},
|
|
1132
|
-
children: (
|
|
1132
|
+
children: (c) => k(At, {
|
|
1133
1133
|
get item() {
|
|
1134
|
-
return
|
|
1134
|
+
return c();
|
|
1135
1135
|
},
|
|
1136
1136
|
get viewportScale() {
|
|
1137
1137
|
return e.viewport.scale;
|
|
@@ -1158,13 +1158,13 @@ function nn(e) {
|
|
|
1158
1158
|
return e.onDeleteBackgroundLayer;
|
|
1159
1159
|
}
|
|
1160
1160
|
})
|
|
1161
|
-
}), null),
|
|
1161
|
+
}), null), R(i, k(te, {
|
|
1162
1162
|
get when() {
|
|
1163
|
-
return
|
|
1163
|
+
return ge(() => !!e.editable)() && t();
|
|
1164
1164
|
},
|
|
1165
|
-
children: (
|
|
1165
|
+
children: (c) => k(Nt, {
|
|
1166
1166
|
get item() {
|
|
1167
|
-
return
|
|
1167
|
+
return c();
|
|
1168
1168
|
},
|
|
1169
1169
|
get viewportScale() {
|
|
1170
1170
|
return e.viewport.scale;
|
|
@@ -1202,11 +1202,11 @@ function nn(e) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
Qe(["pointerdown", "contextmenu", "input", "keydown", "click"]);
|
|
1204
1204
|
export {
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1205
|
+
nn as WorkbenchAnnotationLayerView,
|
|
1206
|
+
tn as WorkbenchBackgroundLayerView,
|
|
1207
|
+
Ht as WorkbenchBackgroundRegion,
|
|
1208
|
+
on as WorkbenchLayerControlOverlayView,
|
|
1209
|
+
en as WorkbenchStickyNote,
|
|
1210
1210
|
Gt as WorkbenchTextAnnotation,
|
|
1211
|
-
|
|
1211
|
+
Zt as createWorkbenchTextEditorRegistry
|
|
1212
1212
|
};
|