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