@floegence/floe-webapp-core 0.55.2 → 0.56.2
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/ui/SurfaceAnchoredLayer.d.ts +8 -0
- package/dist/components/ui/SurfaceAnchoredLayer.js +64 -52
- package/dist/components/workbench/WorkbenchCanvas.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvas.js +139 -133
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +1 -1
- package/dist/components/workbench/WorkbenchCanvasField.js +82 -76
- package/dist/components/workbench/WorkbenchCompositionToolbar.d.ts +22 -0
- package/dist/components/workbench/WorkbenchCompositionToolbar.js +261 -0
- package/dist/components/workbench/WorkbenchLayerObjects.d.ts +3 -1
- package/dist/components/workbench/WorkbenchLayerObjects.js +1020 -854
- package/dist/components/workbench/WorkbenchSurface.js +439 -437
- package/dist/components/workbench/types.d.ts +3 -1
- package/dist/components/workbench/useWorkbenchModel.d.ts +16 -1
- package/dist/components/workbench/useWorkbenchModel.js +302 -282
- package/dist/components/workbench/workbenchCompositionMessages.d.ts +37 -4
- package/dist/components/workbench/workbenchCompositionMessages.js +42 -12
- package/dist/components/workbench/workbenchHelpers.js +25 -21
- package/dist/components/workbench/workbenchInteractionAdapter.js +39 -39
- package/dist/components/workbench/workbenchOptions.d.ts +35 -5
- package/dist/components/workbench/workbenchOptions.js +29 -13
- package/dist/styles.css +1 -1
- package/dist/workbench-composition.css +911 -0
- package/dist/workbench.css +18 -536
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { CANVAS_WHEEL_INTERACTIVE_ATTR as
|
|
3
|
-
import {
|
|
1
|
+
import { insert as k, createComponent as g, memo as be, effect as P, template as A, addEventListener as U, use as se, classList as it, setAttribute as s, style as he, spread as dt, mergeProps as st, className as De, setStyleProperty as xe, delegateEvents as ut } from "solid-js/web";
|
|
2
|
+
import { CANVAS_WHEEL_INTERACTIVE_ATTR as vt } from "../ui/localInteractionSurface.js";
|
|
3
|
+
import { CompositionToolbar as Fe, CompositionIcon as ue, CompositionDivider as mt } from "./WorkbenchCompositionToolbar.js";
|
|
4
|
+
import { useWorkbenchCompositionText as _e, WorkbenchCompositionActionsContext as We } from "./workbenchCompositionMessages.js";
|
|
4
5
|
import { SurfaceAnchoredLayer as Ae } from "../ui/SurfaceAnchoredLayer.js";
|
|
5
|
-
import { createMemo as O, For as
|
|
6
|
-
import { GripVertical as
|
|
7
|
-
import { startHotInteraction as
|
|
8
|
-
import { startPointerSession as
|
|
9
|
-
import {
|
|
10
|
-
import { compareWorkbenchLayerRenderOrder as
|
|
11
|
-
import { createOwnerSafePropAccessor as
|
|
12
|
-
var
|
|
13
|
-
const
|
|
6
|
+
import { createSignal as re, createMemo as O, For as de, Show as oe, createEffect as fe, onCleanup as ye, useContext as Ne, untrack as Pe, batch as Te } from "solid-js";
|
|
7
|
+
import { GripVertical as Ge, Check as ot, ChevronDown as ht, Minus as wt, Plus as gt } from "../icons/index.js";
|
|
8
|
+
import { startHotInteraction as rt } from "../../utils/hotInteraction.js";
|
|
9
|
+
import { startPointerSession as at } from "../ui/pointerSession.js";
|
|
10
|
+
import { WORKBENCH_DEFAULT_TEXT_COLOR as bt, WORKBENCH_STICKY_NOTE_COLORS as ft, WORKBENCH_BACKGROUND_MATERIALS as yt, WORKBENCH_REGION_COLOR_OPTIONS as ct, WORKBENCH_TEXT_FONT_OPTIONS as Ie, WORKBENCH_TEXT_COLOR_OPTIONS as kt } from "./workbenchOptions.js";
|
|
11
|
+
import { compareWorkbenchLayerRenderOrder as xt, createWorkbenchWidgetSurfaceMetrics as $t } from "./workbenchHelpers.js";
|
|
12
|
+
import { createOwnerSafePropAccessor as c } from "./workbenchOwnerSafeAccessors.js";
|
|
13
|
+
var Ct = /* @__PURE__ */ A("<span class=workbench-note-preview><span class=workbench-preview-writing>"), _t = /* @__PURE__ */ A("<div class=workbench-sticky__title role=textbox aria-multiline=true data-floe-workbench-text-selection-surface=true data-floe-workbench-sticky-local=true data-wb-text-editor=plain data-wb-part=content>"), St = /* @__PURE__ */ A("<div class=workbench-composition-selection aria-hidden=true>"), zt = /* @__PURE__ */ A('<button type=button class="workbench-layer-resize workbench-sticky__resize">'), pt = /* @__PURE__ */ A("<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 data-floe-input-surface=true><button type=button class=workbench-sticky__grip data-floe-workbench-sticky-local=true data-wb-part=move></button><div class=workbench-sticky__content><div class=workbench-sticky__body role=textbox aria-multiline=true data-floe-workbench-text-selection-surface=true data-wb-text-editor=plain data-floe-workbench-sticky-local=true data-wb-part=content>"), lt = /* @__PURE__ */ A("<div class=workbench-color-options>"), Et = /* @__PURE__ */ A("<button type=button class=workbench-style-choice>"), ge = /* @__PURE__ */ A("<button type=button>"), He = /* @__PURE__ */ A("<button type=button class=is-danger>"), Rt = /* @__PURE__ */ A("<article class=workbench-text-annotation data-floe-input-surface=true 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>"), Pt = /* @__PURE__ */ A("<article class=workbench-background-region data-wb-plane=background data-wb-object-kind=region data-wb-part=body><div class=workbench-background-region__label data-floe-input-surface=true><div role=textbox data-floe-workbench-text-selection-surface=true></div></div><button type=button class=workbench-region-grip>"), Tt = /* @__PURE__ */ A("<select><option value=more>"), Mt = /* @__PURE__ */ A('<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><button type=button class=workbench-text-move data-wb-part=move></button><button type=button class=workbench-layer-resize data-wb-part=resize>'), Lt = /* @__PURE__ */ A("<div class=workbench-text-font-popover role=menu>"), It = /* @__PURE__ */ A("<div class=workbench-text-font-picker data-floe-canvas-interactive=true><button type=button aria-haspopup=menu class=workbench-text-font-trigger><span class=workbench-text-font-trigger__sample>Aa</span><span class=workbench-text-font-trigger__label>"), jt = /* @__PURE__ */ A("<div class=workbench-text-size-stepper role=group><button type=button class=workbench-text-size-stepper__button></button><input class=workbench-text-annotation__size-input type=text inputmode=numeric pattern=[0-9]*><button type=button class=workbench-text-size-stepper__button>"), Ot = /* @__PURE__ */ A("<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>"), Dt = /* @__PURE__ */ A("<button type=button class=workbench-layer-swatch>"), Ft = /* @__PURE__ */ A("<option>"), Wt = /* @__PURE__ */ A("<button type=button class=workbench-name-trigger><span>"), At = /* @__PURE__ */ A('<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><button type=button class=workbench-layer-resize data-wb-part=resize>'), Nt = /* @__PURE__ */ A("<span class=workbench-region-preview-mat><span>"), Gt = /* @__PURE__ */ A("<button type=button class=workbench-style-choice><span class=workbench-region-preview-mat><span>"), Ht = /* @__PURE__ */ A("<label><input type=range min=8 max=100>"), Bt = /* @__PURE__ */ A("<div aria-hidden=true data-wb-plane=overlay data-wb-object-kind=region-outline>"), Xt = /* @__PURE__ */ A("<div class=workbench-region-visibility-outline-layer aria-hidden=true>"), Yt = /* @__PURE__ */ A("<div class=workbench-background-layer>"), Ut = /* @__PURE__ */ A("<div class=workbench-annotation-layer>"), Kt = /* @__PURE__ */ A("<div class=workbench-control-overlay-layer data-wb-plane=overlay>");
|
|
14
|
+
const Vt = 190, qt = 132, Jt = 180, Qt = 120, Zt = 96, en = 42, tn = {
|
|
14
15
|
amber: "is-amber",
|
|
15
16
|
sage: "is-sage",
|
|
16
17
|
azure: "is-azure",
|
|
@@ -18,141 +19,161 @@ const Yt = 190, Kt = 132, Ut = 180, Vt = 120, Jt = 96, qt = 42, Qt = {
|
|
|
18
19
|
rose: "is-rose",
|
|
19
20
|
graphite: "is-graphite"
|
|
20
21
|
};
|
|
21
|
-
function
|
|
22
|
-
const e = /* @__PURE__ */ new Map();
|
|
22
|
+
function Sn() {
|
|
23
|
+
const e = /* @__PURE__ */ new Map(), [t, r] = re(0);
|
|
23
24
|
return {
|
|
24
|
-
register(
|
|
25
|
-
return e.set(
|
|
26
|
-
e.get(
|
|
25
|
+
register(v, o) {
|
|
26
|
+
return e.set(v, o), r((i) => i + 1), () => {
|
|
27
|
+
e.get(v) === o && (e.delete(v), r((i) => i + 1));
|
|
27
28
|
};
|
|
28
29
|
},
|
|
29
|
-
get(
|
|
30
|
-
return e.get(
|
|
30
|
+
get(v) {
|
|
31
|
+
return t(), e.get(v);
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
return [...e].sort(
|
|
35
|
+
function Be(e) {
|
|
36
|
+
return [...e].sort(xt);
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
return new Map(e.map((
|
|
38
|
+
function Xe(e) {
|
|
39
|
+
return new Map(e.map((t) => [t.id, t]));
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const r = e.findIndex((
|
|
41
|
+
function nn(e, t) {
|
|
42
|
+
const r = e.findIndex((v) => v === t);
|
|
42
43
|
return e[(r + 1) % e.length] ?? e[0];
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
45
|
+
function on(e, t, r) {
|
|
46
|
+
fe(() => {
|
|
46
47
|
if (!e() || typeof document > "u") return;
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
48
|
+
const v = (i) => {
|
|
49
|
+
const x = t();
|
|
50
|
+
x && i.target instanceof Node && x.contains(i.target) || r();
|
|
51
|
+
}, o = (i) => {
|
|
52
|
+
i.key === "Escape" && r();
|
|
52
53
|
};
|
|
53
|
-
document.addEventListener("pointerdown",
|
|
54
|
-
document.removeEventListener("pointerdown",
|
|
54
|
+
document.addEventListener("pointerdown", v, !0), document.addEventListener("keydown", o), ye(() => {
|
|
55
|
+
document.removeEventListener("pointerdown", v, !0), document.removeEventListener("keydown", o);
|
|
55
56
|
});
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function tt(e, t) {
|
|
59
60
|
if (!e || e.rangeCount <= 0) return !1;
|
|
60
61
|
const r = e.getRangeAt(0).commonAncestorContainer;
|
|
61
|
-
return r ===
|
|
62
|
+
return r === t || t.contains(r);
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
const [
|
|
65
|
-
let
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
|
|
64
|
+
function Me(e) {
|
|
65
|
+
const [t, r] = re(), [v, o] = re(!1), [i, x] = re(!1);
|
|
66
|
+
let z;
|
|
67
|
+
const D = () => t()?.textContent ?? "", B = (w) => r(w), F = (w) => {
|
|
68
|
+
const d = e.singleLine ? (w.textContent ?? "").trim() : w.innerHTML ?? "";
|
|
69
|
+
d !== e.value() && e.onCommit(d);
|
|
69
70
|
};
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
if (!
|
|
73
|
-
const
|
|
74
|
-
(
|
|
75
|
-
}), {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
t(
|
|
71
|
+
fe(() => {
|
|
72
|
+
const w = t();
|
|
73
|
+
if (!w || v() || i()) return;
|
|
74
|
+
const d = e.value();
|
|
75
|
+
(w.innerHTML ?? "") !== d && (e.singleLine ? w.textContent = d : w.innerHTML = d);
|
|
76
|
+
}), fe(() => {
|
|
77
|
+
const w = t();
|
|
78
|
+
if (!w || !i()) return;
|
|
79
|
+
const d = (h) => {
|
|
80
|
+
h.composedPath().includes(w) || w.blur();
|
|
81
|
+
}, T = w.ownerDocument;
|
|
82
|
+
T.addEventListener("pointerdown", d, !0), ye(() => T.removeEventListener("pointerdown", d, !0));
|
|
83
|
+
});
|
|
84
|
+
const p = () => {
|
|
85
|
+
x(!0);
|
|
86
|
+
}, Y = (w) => {
|
|
87
|
+
const d = document.getSelection();
|
|
88
|
+
tt(d, w.currentTarget) && (z = d.getRangeAt(0).cloneRange()), v() || F(w.currentTarget), x(!1);
|
|
89
|
+
}, E = (w) => {
|
|
90
|
+
if (w.stopPropagation(), v() || w.isComposing || w.keyCode === 229) return;
|
|
91
|
+
const d = w.ctrlKey || w.metaKey;
|
|
92
|
+
w.key === "Escape" || w.key === "Enter" && (d || e.singleLine) ? (w.preventDefault(), w.currentTarget.blur()) : d && w.key === "b" ? (w.preventDefault(), document.execCommand("bold", !1)) : d && w.key === "i" && (w.preventDefault(), document.execCommand("italic", !1));
|
|
93
|
+
}, I = () => {
|
|
94
|
+
o(!0);
|
|
95
|
+
}, C = (w) => {
|
|
96
|
+
document.activeElement !== w.currentTarget && F(w.currentTarget), o(!1);
|
|
97
|
+
}, G = () => {
|
|
98
|
+
x(!0), t()?.focus({
|
|
99
|
+
preventScroll: !0
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
bind: B,
|
|
104
|
+
blur: () => t()?.blur(),
|
|
105
|
+
isFocused: i,
|
|
106
|
+
readText: D,
|
|
107
|
+
focus: G,
|
|
108
|
+
insertTextAtSelection: (w) => {
|
|
109
|
+
const d = t();
|
|
110
|
+
if (!d) return;
|
|
111
|
+
const T = document.getSelection(), h = tt(T, d) ? T.getRangeAt(0).cloneRange() : void 0, l = z && d.contains(z.commonAncestorContainer) ? z : void 0, u = h ?? l?.cloneRange() ?? document.createRange();
|
|
112
|
+
if (G(), !h && !l && (u.selectNodeContents(d), u.collapse(!1)), T?.removeAllRanges(), T?.addRange(u), document.execCommand?.("insertText", !1, w)) return;
|
|
113
|
+
u.deleteContents();
|
|
114
|
+
const n = document.createTextNode(w);
|
|
115
|
+
u.insertNode(n), u.setStartAfter(n), u.collapse(!0), T?.removeAllRanges(), T?.addRange(u);
|
|
109
116
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
handleFocus: p,
|
|
118
|
+
handleBlur: Y,
|
|
119
|
+
handleKeyDown: E,
|
|
120
|
+
handleCompositionStart: I,
|
|
121
|
+
handleCompositionEnd: C
|
|
113
122
|
};
|
|
114
123
|
}
|
|
115
|
-
function
|
|
124
|
+
function rn(e) {
|
|
116
125
|
return Math.max(8, Math.min(160, Math.round(e)));
|
|
117
126
|
}
|
|
118
|
-
function
|
|
127
|
+
function an(e) {
|
|
119
128
|
return Math.max(0.08, Math.min(1, e));
|
|
120
129
|
}
|
|
121
|
-
function
|
|
130
|
+
function Ce(e) {
|
|
131
|
+
const t = ct.find((r) => r.fill === e.fill);
|
|
122
132
|
return {
|
|
123
133
|
"--workbench-region-fill": e.fill,
|
|
124
|
-
"--
|
|
134
|
+
"--region-hue": `${t?.hue ?? 0}`,
|
|
135
|
+
// Legacy and host-supplied fills retain their own hue through the same material renderer.
|
|
136
|
+
...t ? {} : {
|
|
137
|
+
"--region-face": "oklch(from var(--workbench-region-fill) var(--region-lightness) c h)",
|
|
138
|
+
"--region-edge": "oklch(from var(--region-face) calc(l + var(--region-edge-delta)) min(.032,c) h)",
|
|
139
|
+
"--region-outline": "oklch(from var(--workbench-region-fill) var(--region-outline-lightness) c h)"
|
|
140
|
+
},
|
|
141
|
+
...t?.color === "graphite" ? {
|
|
142
|
+
"--region-chroma": ".009",
|
|
143
|
+
"--region-outline-chroma": ".012"
|
|
144
|
+
} : {},
|
|
145
|
+
"--workbench-region-strength": `${Math.round(an(e.opacity) * 100)}%`
|
|
125
146
|
};
|
|
126
147
|
}
|
|
127
|
-
function
|
|
148
|
+
function je(e) {
|
|
128
149
|
e.stopPropagation();
|
|
129
150
|
}
|
|
130
|
-
function
|
|
151
|
+
function Oe(e) {
|
|
131
152
|
e.stopPropagation();
|
|
132
153
|
}
|
|
133
|
-
function
|
|
154
|
+
function Q(e) {
|
|
134
155
|
e.preventDefault(), e.stopPropagation();
|
|
135
156
|
}
|
|
136
|
-
function
|
|
157
|
+
function $e(e) {
|
|
137
158
|
e.stopPropagation();
|
|
138
159
|
}
|
|
139
|
-
function
|
|
140
|
-
return e?.kind ===
|
|
160
|
+
function Se(e, t, r) {
|
|
161
|
+
return e?.kind === t && e.id === r ? e : null;
|
|
141
162
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
return Math.round(e *
|
|
163
|
+
function Re(e) {
|
|
164
|
+
const t = typeof window < "u" && Number.isFinite(window.devicePixelRatio) && window.devicePixelRatio > 0 ? window.devicePixelRatio : 1;
|
|
165
|
+
return Math.round(e * t) / t;
|
|
145
166
|
}
|
|
146
|
-
function
|
|
147
|
-
const
|
|
167
|
+
function ze(e) {
|
|
168
|
+
const t = Math.max(e.viewport.scale, 1e-3);
|
|
148
169
|
return e.projection !== "screen" ? {
|
|
149
170
|
...e.geometry,
|
|
150
|
-
scale:
|
|
171
|
+
scale: t
|
|
151
172
|
} : {
|
|
152
|
-
x:
|
|
153
|
-
y:
|
|
154
|
-
width: Math.max(1,
|
|
155
|
-
height: Math.max(1,
|
|
173
|
+
x: Re(e.viewport.x + e.geometry.x * t),
|
|
174
|
+
y: Re(e.viewport.y + e.geometry.y * t),
|
|
175
|
+
width: Math.max(1, Re(e.geometry.width * t)),
|
|
176
|
+
height: Math.max(1, Re(e.geometry.height * t)),
|
|
156
177
|
scale: 1
|
|
157
178
|
};
|
|
158
179
|
}
|
|
@@ -163,7 +184,7 @@ function pe(e) {
|
|
|
163
184
|
transform: `translate(${e.x}px, ${e.y}px)`
|
|
164
185
|
};
|
|
165
186
|
}
|
|
166
|
-
function
|
|
187
|
+
function Ee(e) {
|
|
167
188
|
return {
|
|
168
189
|
x: e.preview?.x ?? e.position.x,
|
|
169
190
|
y: e.preview?.y ?? e.position.y,
|
|
@@ -171,381 +192,430 @@ function De(e) {
|
|
|
171
192
|
height: e.preview?.height ?? e.height
|
|
172
193
|
};
|
|
173
194
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
195
|
+
function Le(e) {
|
|
196
|
+
const t = c(() => e.readPosition()), r = c(() => e.readGeometry?.() ?? {
|
|
176
197
|
width: 0,
|
|
177
198
|
height: 0
|
|
178
|
-
}),
|
|
179
|
-
let
|
|
180
|
-
return
|
|
181
|
-
|
|
199
|
+
}), v = c(() => e.viewportScale()), o = c(() => e.onCommitMove), i = c(() => e.onPreviewMove), x = c(() => e.onPreviewEnd), z = c(() => e.onInteractionStart), D = c(() => e.onInteractionEnd), B = c(() => e.onCommitStart), [F, p] = re(null);
|
|
200
|
+
let Y;
|
|
201
|
+
return ye(() => {
|
|
202
|
+
Y?.stop({
|
|
182
203
|
reason: "manual_stop",
|
|
183
204
|
commit: !1
|
|
184
|
-
}),
|
|
205
|
+
}), Y = void 0, Pe(F)?.stopInteraction();
|
|
185
206
|
}), {
|
|
186
207
|
position: O(() => {
|
|
187
|
-
const
|
|
188
|
-
return
|
|
189
|
-
x:
|
|
190
|
-
y:
|
|
191
|
-
} :
|
|
208
|
+
const C = F();
|
|
209
|
+
return C ? {
|
|
210
|
+
x: C.worldX,
|
|
211
|
+
y: C.worldY
|
|
212
|
+
} : t();
|
|
192
213
|
}),
|
|
193
|
-
isDragging: () =>
|
|
194
|
-
beginDrag: (
|
|
195
|
-
if (
|
|
196
|
-
|
|
214
|
+
isDragging: () => F() !== null,
|
|
215
|
+
beginDrag: (C) => {
|
|
216
|
+
if (C.button !== 0) return;
|
|
217
|
+
C.preventDefault(), C.stopPropagation(), Y?.stop({
|
|
197
218
|
reason: "manual_stop",
|
|
198
219
|
commit: !1
|
|
199
220
|
});
|
|
200
|
-
const
|
|
221
|
+
const G = t(), q = Math.max(v(), 1e-3), w = rt({
|
|
201
222
|
kind: "drag",
|
|
202
223
|
cursor: "grabbing"
|
|
203
224
|
});
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
},
|
|
225
|
+
let d = !1;
|
|
226
|
+
z()?.();
|
|
227
|
+
const T = () => {
|
|
228
|
+
d || (d = !0, w(), D()?.());
|
|
229
|
+
}, h = r(), l = i(), u = x(), n = B(), L = o();
|
|
209
230
|
p({
|
|
210
|
-
pointerId:
|
|
211
|
-
startClientX:
|
|
212
|
-
startClientY:
|
|
213
|
-
startWorldX:
|
|
214
|
-
startWorldY:
|
|
215
|
-
worldX:
|
|
216
|
-
worldY:
|
|
217
|
-
scale:
|
|
231
|
+
pointerId: C.pointerId,
|
|
232
|
+
startClientX: C.clientX,
|
|
233
|
+
startClientY: C.clientY,
|
|
234
|
+
startWorldX: G.x,
|
|
235
|
+
startWorldY: G.y,
|
|
236
|
+
worldX: G.x,
|
|
237
|
+
worldY: G.y,
|
|
238
|
+
scale: q,
|
|
218
239
|
moved: !1,
|
|
219
|
-
stopInteraction:
|
|
220
|
-
}),
|
|
221
|
-
pointerEvent:
|
|
222
|
-
captureEl:
|
|
223
|
-
onMove: (
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
p((
|
|
227
|
-
if (!
|
|
228
|
-
const
|
|
229
|
-
x:
|
|
230
|
-
y:
|
|
240
|
+
stopInteraction: T
|
|
241
|
+
}), Y = at({
|
|
242
|
+
pointerEvent: C,
|
|
243
|
+
captureEl: C.currentTarget,
|
|
244
|
+
onMove: (X) => {
|
|
245
|
+
let j = null;
|
|
246
|
+
Te(() => {
|
|
247
|
+
p((S) => {
|
|
248
|
+
if (!S || S.pointerId !== X.pointerId) return S;
|
|
249
|
+
const te = {
|
|
250
|
+
x: S.startWorldX + (X.clientX - S.startClientX) / S.scale,
|
|
251
|
+
y: S.startWorldY + (X.clientY - S.startClientY) / S.scale
|
|
231
252
|
};
|
|
232
|
-
return
|
|
233
|
-
x:
|
|
234
|
-
y:
|
|
235
|
-
width:
|
|
236
|
-
height:
|
|
253
|
+
return j = {
|
|
254
|
+
x: S.startWorldX + (X.clientX - S.startClientX) / S.scale,
|
|
255
|
+
y: S.startWorldY + (X.clientY - S.startClientY) / S.scale,
|
|
256
|
+
width: h.width,
|
|
257
|
+
height: h.height
|
|
237
258
|
}, {
|
|
238
|
-
...
|
|
239
|
-
worldX:
|
|
240
|
-
worldY:
|
|
241
|
-
moved:
|
|
259
|
+
...S,
|
|
260
|
+
worldX: te.x,
|
|
261
|
+
worldY: te.y,
|
|
262
|
+
moved: S.moved || Math.abs(te.x - S.startWorldX) > 2 || Math.abs(te.y - S.startWorldY) > 2
|
|
242
263
|
};
|
|
243
|
-
}),
|
|
264
|
+
}), j && l?.(j);
|
|
244
265
|
});
|
|
245
266
|
},
|
|
246
267
|
onEnd: ({
|
|
247
|
-
commit:
|
|
268
|
+
commit: X
|
|
248
269
|
}) => {
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
x:
|
|
254
|
-
y:
|
|
270
|
+
const j = Pe(F);
|
|
271
|
+
Te(() => {
|
|
272
|
+
if (j && X) {
|
|
273
|
+
const S = {
|
|
274
|
+
x: j.worldX,
|
|
275
|
+
y: j.worldY
|
|
255
276
|
};
|
|
256
|
-
|
|
277
|
+
n?.(S), j.moved && L(S);
|
|
257
278
|
}
|
|
258
|
-
|
|
279
|
+
j?.stopInteraction(), p(null), Y = void 0, u?.();
|
|
259
280
|
});
|
|
260
281
|
}
|
|
261
282
|
});
|
|
262
283
|
}
|
|
263
284
|
};
|
|
264
285
|
}
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
let
|
|
268
|
-
return
|
|
269
|
-
|
|
286
|
+
function Ye(e) {
|
|
287
|
+
const t = c(() => e.readSize()), r = c(() => e.viewportScale()), v = c(() => e.onCommitResize), o = c(() => e.onPreviewResize), i = c(() => e.onPreviewEnd), x = c(() => e.onInteractionStart), z = c(() => e.onInteractionEnd), [D, B] = re(null);
|
|
288
|
+
let F;
|
|
289
|
+
return ye(() => {
|
|
290
|
+
F?.stop({
|
|
270
291
|
reason: "manual_stop",
|
|
271
292
|
commit: !1
|
|
272
|
-
}),
|
|
293
|
+
}), F = void 0, Pe(D)?.stopInteraction();
|
|
273
294
|
}), {
|
|
274
295
|
size: O(() => {
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
width:
|
|
278
|
-
height:
|
|
279
|
-
} :
|
|
296
|
+
const E = D();
|
|
297
|
+
return E ? {
|
|
298
|
+
width: E.width,
|
|
299
|
+
height: E.height
|
|
300
|
+
} : t();
|
|
280
301
|
}),
|
|
281
|
-
isResizing: () =>
|
|
282
|
-
beginResize: (
|
|
283
|
-
if (
|
|
284
|
-
|
|
302
|
+
isResizing: () => D() !== null,
|
|
303
|
+
beginResize: (E) => {
|
|
304
|
+
if (E.button !== 0) return;
|
|
305
|
+
E.preventDefault(), E.stopPropagation(), F?.stop({
|
|
285
306
|
reason: "manual_stop",
|
|
286
307
|
commit: !1
|
|
287
308
|
});
|
|
288
|
-
const
|
|
309
|
+
const I = t(), C = Math.max(r(), 1e-3), G = rt({
|
|
289
310
|
kind: "resize",
|
|
290
311
|
cursor: "nwse-resize"
|
|
291
312
|
});
|
|
292
|
-
let
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
pointerId:
|
|
299
|
-
startClientX:
|
|
300
|
-
startClientY:
|
|
301
|
-
startWidth:
|
|
302
|
-
startHeight:
|
|
303
|
-
width:
|
|
304
|
-
height:
|
|
305
|
-
scale:
|
|
306
|
-
stopInteraction:
|
|
307
|
-
}),
|
|
308
|
-
pointerEvent:
|
|
309
|
-
captureEl:
|
|
310
|
-
onMove: (
|
|
311
|
-
let
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
width: Math.max(e.minWidth,
|
|
315
|
-
height: Math.max(e.minHeight,
|
|
313
|
+
let q = !1;
|
|
314
|
+
x()?.();
|
|
315
|
+
const w = () => {
|
|
316
|
+
q || (q = !0, G(), z()?.());
|
|
317
|
+
}, d = o(), T = i(), h = v();
|
|
318
|
+
B({
|
|
319
|
+
pointerId: E.pointerId,
|
|
320
|
+
startClientX: E.clientX,
|
|
321
|
+
startClientY: E.clientY,
|
|
322
|
+
startWidth: I.width,
|
|
323
|
+
startHeight: I.height,
|
|
324
|
+
width: I.width,
|
|
325
|
+
height: I.height,
|
|
326
|
+
scale: C,
|
|
327
|
+
stopInteraction: w
|
|
328
|
+
}), F = at({
|
|
329
|
+
pointerEvent: E,
|
|
330
|
+
captureEl: E.currentTarget,
|
|
331
|
+
onMove: (l) => {
|
|
332
|
+
let u = null;
|
|
333
|
+
Te(() => {
|
|
334
|
+
B((n) => !n || n.pointerId !== l.pointerId ? n : (u = {
|
|
335
|
+
width: Math.max(e.minWidth, n.startWidth + (l.clientX - n.startClientX) / n.scale),
|
|
336
|
+
height: Math.max(e.minHeight, n.startHeight + (l.clientY - n.startClientY) / n.scale)
|
|
316
337
|
}, {
|
|
317
|
-
...
|
|
318
|
-
width:
|
|
319
|
-
height:
|
|
320
|
-
})),
|
|
338
|
+
...n,
|
|
339
|
+
width: u.width,
|
|
340
|
+
height: u.height
|
|
341
|
+
})), u && d?.(u);
|
|
321
342
|
});
|
|
322
343
|
},
|
|
323
344
|
onEnd: ({
|
|
324
|
-
commit:
|
|
345
|
+
commit: l
|
|
325
346
|
}) => {
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
width:
|
|
330
|
-
height:
|
|
331
|
-
}),
|
|
347
|
+
const u = Pe(D);
|
|
348
|
+
Te(() => {
|
|
349
|
+
u && l && h({
|
|
350
|
+
width: u.width,
|
|
351
|
+
height: u.height
|
|
352
|
+
}), u?.stopInteraction(), B(null), F = void 0, T?.();
|
|
332
353
|
});
|
|
333
354
|
}
|
|
334
355
|
});
|
|
335
356
|
}
|
|
336
357
|
};
|
|
337
358
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
359
|
+
function nt(e) {
|
|
360
|
+
return (() => {
|
|
361
|
+
var t = Ct();
|
|
362
|
+
return P((r) => {
|
|
363
|
+
var v = e.color, o = e.material;
|
|
364
|
+
return v !== r.e && s(t, "data-note-color", r.e = v), o !== r.t && s(t, "data-note-material", r.t = o), r;
|
|
365
|
+
}, {
|
|
366
|
+
e: void 0,
|
|
367
|
+
t: void 0
|
|
368
|
+
}), t;
|
|
369
|
+
})();
|
|
370
|
+
}
|
|
371
|
+
function zn(e) {
|
|
372
|
+
const t = _e(), [r, v] = re(), o = c(() => e.item), i = c(() => e.selected), x = c(() => e.viewportScale), z = c(() => e.projectedViewport), D = c(() => e.surfaceReady ?? !0), B = c(() => e.renderLayer), F = c(() => e.topRenderLayer), p = c(() => e.locked), Y = c(() => e.filtered), E = c(() => e.visualFront ?? !1), I = c(() => e.onSelect), C = c(() => e.onContextMenu), G = c(() => e.onClaimVisualFrontOwner), q = c(() => e.onCommitFront), w = c(() => e.onCommitMove), d = c(() => e.onCommitResize), T = c(() => e.onUpdate), h = c(() => e.onDelete), l = c(() => e.onLayoutInteractionStart), u = c(() => e.onLayoutInteractionEnd), n = Me({
|
|
373
|
+
value: () => o().body,
|
|
374
|
+
onCommit: ($) => T()(o().id, {
|
|
375
|
+
body: $
|
|
343
376
|
})
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
377
|
+
}), L = Me({
|
|
378
|
+
value: () => o().title ?? "",
|
|
379
|
+
onCommit: ($) => T()(o().id, {
|
|
380
|
+
title: $
|
|
381
|
+
})
|
|
382
|
+
});
|
|
383
|
+
fe(() => {
|
|
384
|
+
p() && (L.blur(), n.blur());
|
|
385
|
+
});
|
|
386
|
+
const [X, j] = re("body"), S = Ne(We), te = () => L.isFocused() || n.isFocused(), [ne, ae] = re(!1);
|
|
387
|
+
let _;
|
|
388
|
+
const J = () => {
|
|
389
|
+
typeof window > "u" || _ === void 0 || (window.clearTimeout(_), _ = void 0);
|
|
390
|
+
}, ce = () => {
|
|
391
|
+
ae(!0), J(), !(typeof window > "u") && (_ = window.setTimeout(() => {
|
|
392
|
+
_ = void 0, ae(!1);
|
|
351
393
|
}, 720));
|
|
352
394
|
};
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
typeof navigator > "u" || !navigator.clipboard?.writeText || (await navigator.clipboard.writeText(
|
|
356
|
-
},
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
viewportScale:
|
|
395
|
+
ye(() => J());
|
|
396
|
+
const ve = async () => {
|
|
397
|
+
typeof navigator > "u" || !navigator.clipboard?.writeText || (await navigator.clipboard.writeText(n.readText()), ce());
|
|
398
|
+
}, m = ($) => {
|
|
399
|
+
if ($.button !== 0) return;
|
|
400
|
+
const ie = o();
|
|
401
|
+
I()(ie.id), !p() && ($.target instanceof Element && $.target.closest('[data-floe-workbench-sticky-local="true"]') || (G()?.(ie.id), b.beginDrag($)));
|
|
402
|
+
}, b = Le({
|
|
403
|
+
viewportScale: x,
|
|
362
404
|
readPosition: () => ({
|
|
363
|
-
x:
|
|
364
|
-
y:
|
|
405
|
+
x: o().x,
|
|
406
|
+
y: o().y
|
|
365
407
|
}),
|
|
366
|
-
onCommitMove: (
|
|
367
|
-
onCommitStart: () =>
|
|
368
|
-
onInteractionStart: () =>
|
|
369
|
-
onInteractionEnd: () =>
|
|
370
|
-
}),
|
|
371
|
-
viewportScale:
|
|
408
|
+
onCommitMove: ($) => w()(o().id, $),
|
|
409
|
+
onCommitStart: () => q()?.(o().id),
|
|
410
|
+
onInteractionStart: () => l()?.(),
|
|
411
|
+
onInteractionEnd: () => u()?.()
|
|
412
|
+
}), y = Ye({
|
|
413
|
+
viewportScale: x,
|
|
372
414
|
readSize: () => ({
|
|
373
|
-
width:
|
|
374
|
-
height:
|
|
415
|
+
width: o().width,
|
|
416
|
+
height: o().height
|
|
375
417
|
}),
|
|
376
|
-
minWidth:
|
|
377
|
-
minHeight:
|
|
378
|
-
onCommitResize: (
|
|
379
|
-
onInteractionStart: () =>
|
|
380
|
-
onInteractionEnd: () =>
|
|
381
|
-
}),
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
return
|
|
385
|
-
widgetId:
|
|
386
|
-
worldX:
|
|
387
|
-
worldY:
|
|
388
|
-
worldWidth:
|
|
389
|
-
worldHeight:
|
|
390
|
-
viewport:
|
|
391
|
-
ready:
|
|
418
|
+
minWidth: Vt,
|
|
419
|
+
minHeight: qt,
|
|
420
|
+
onCommitResize: ($) => d()(o().id, $),
|
|
421
|
+
onInteractionStart: () => l()?.(),
|
|
422
|
+
onInteractionEnd: () => u()?.()
|
|
423
|
+
}), W = O(() => b.position()), H = O(() => y.size()), f = O(() => {
|
|
424
|
+
const $ = z();
|
|
425
|
+
if ($)
|
|
426
|
+
return $t({
|
|
427
|
+
widgetId: o().id,
|
|
428
|
+
worldX: W().x,
|
|
429
|
+
worldY: W().y,
|
|
430
|
+
worldWidth: H().width,
|
|
431
|
+
worldHeight: H().height,
|
|
432
|
+
viewport: $(),
|
|
433
|
+
ready: D()
|
|
392
434
|
});
|
|
393
|
-
}),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
435
|
+
}), K = O(() => f()?.rect.viewportScale ?? Math.max(x(), 1e-3)), Z = O(() => ({
|
|
436
|
+
"--workbench-layer-control-inverse-scale": `${1 / K()}`,
|
|
437
|
+
width: `${H().width}px`,
|
|
438
|
+
height: `${H().height}px`,
|
|
439
|
+
transform: z() ? `translate(${f()?.rect.screenX ?? 0}px, ${f()?.rect.screenY ?? 0}px) scale(${K()})` : `translate(${W().x}px, ${W().y}px)`,
|
|
397
440
|
"transform-origin": "0 0",
|
|
398
|
-
"z-index": `${
|
|
441
|
+
"z-index": `${i() || E() || b.isDragging() || y.isResizing() ? F() + 1 : B()}`
|
|
399
442
|
}));
|
|
400
443
|
return (() => {
|
|
401
|
-
var
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
},
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
444
|
+
var $ = pt(), ie = $.firstChild, N = ie.firstChild, le = N.nextSibling, ee = le.firstChild;
|
|
445
|
+
$.$$contextmenu = (a) => {
|
|
446
|
+
a.preventDefault(), a.stopPropagation(), C()?.(a, o());
|
|
447
|
+
}, $.addEventListener("focus", () => I()(o().id)), $.$$pointerdown = m, se(v, $), N.$$pointerdown = (a) => {
|
|
448
|
+
if (p()) return;
|
|
449
|
+
const M = o();
|
|
450
|
+
I()(M.id), G()?.(M.id), b.beginDrag(a);
|
|
451
|
+
}, k(N, g(Ge, {
|
|
408
452
|
class: "w-3.5 h-3.5"
|
|
409
|
-
}))
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
get contentEditable() {
|
|
415
|
-
return !p();
|
|
416
|
-
},
|
|
417
|
-
role: "textbox",
|
|
418
|
-
"aria-multiline": "true",
|
|
419
|
-
get "aria-disabled"() {
|
|
420
|
-
return p() ? "true" : void 0;
|
|
421
|
-
},
|
|
422
|
-
get "aria-label"() {
|
|
423
|
-
return n("stickyBody");
|
|
424
|
-
},
|
|
425
|
-
spellcheck: !1,
|
|
426
|
-
"data-floe-workbench-text-selection-surface": "true",
|
|
427
|
-
"data-wb-text-editor": "plain",
|
|
428
|
-
"data-floe-workbench-sticky-local": "true",
|
|
429
|
-
"data-wb-part": "content",
|
|
430
|
-
onPointerDown: ($) => {
|
|
431
|
-
$.stopPropagation(), H()(t().id);
|
|
432
|
-
},
|
|
433
|
-
get onFocus() {
|
|
434
|
-
return s.handleFocus;
|
|
435
|
-
},
|
|
436
|
-
get onBlur() {
|
|
437
|
-
return s.handleBlur;
|
|
438
|
-
},
|
|
439
|
-
get onKeyDown() {
|
|
440
|
-
return s.handleKeyDown;
|
|
441
|
-
},
|
|
442
|
-
get onCompositionStart() {
|
|
443
|
-
return s.handleCompositionStart;
|
|
453
|
+
})), dt(le, st(() => ({
|
|
454
|
+
[vt]: i() ? "true" : void 0
|
|
455
|
+
})), !1, !0), k(le, g(oe, {
|
|
456
|
+
get when() {
|
|
457
|
+
return o().title !== void 0;
|
|
444
458
|
},
|
|
445
|
-
get
|
|
446
|
-
|
|
459
|
+
get children() {
|
|
460
|
+
var a = _t();
|
|
461
|
+
U(a, "compositionend", L.handleCompositionEnd), U(a, "compositionstart", L.handleCompositionStart), U(a, "keydown", L.handleKeyDown, !0), U(a, "blur", L.handleBlur), a.addEventListener("focus", (R) => {
|
|
462
|
+
j("title"), L.handleFocus(R);
|
|
463
|
+
}), a.$$pointerdown = (R) => {
|
|
464
|
+
R.stopPropagation(), I()(o().id);
|
|
465
|
+
};
|
|
466
|
+
var M = L.bind;
|
|
467
|
+
return typeof M == "function" ? se(M, a) : L.bind = a, s(a, "spellcheck", !1), P((R) => {
|
|
468
|
+
var V = !p(), me = t("stickyTitle"), we = t("textPlaceholder");
|
|
469
|
+
return V !== R.e && s(a, "contenteditable", R.e = V), me !== R.t && s(a, "aria-label", R.t = me), we !== R.a && s(a, "data-placeholder", R.a = we), R;
|
|
470
|
+
}, {
|
|
471
|
+
e: void 0,
|
|
472
|
+
t: void 0,
|
|
473
|
+
a: void 0
|
|
474
|
+
}), a;
|
|
447
475
|
}
|
|
448
|
-
}),
|
|
476
|
+
}), ee), U(ee, "compositionend", n.handleCompositionEnd), U(ee, "compositionstart", n.handleCompositionStart), U(ee, "keydown", n.handleKeyDown, !0), U(ee, "blur", n.handleBlur), ee.addEventListener("focus", (a) => {
|
|
477
|
+
j("body"), n.handleFocus(a);
|
|
478
|
+
}), ee.$$pointerdown = (a) => {
|
|
479
|
+
a.stopPropagation(), I()(o().id);
|
|
480
|
+
};
|
|
481
|
+
var ke = n.bind;
|
|
482
|
+
return typeof ke == "function" ? se(ke, ee) : n.bind = ee, s(ee, "spellcheck", !1), k($, g(oe, {
|
|
449
483
|
get when() {
|
|
450
|
-
return
|
|
484
|
+
return be(() => !!i())() && !p();
|
|
451
485
|
},
|
|
452
486
|
get children() {
|
|
453
|
-
return
|
|
487
|
+
return g(Ae, {
|
|
488
|
+
reservedSpace: {
|
|
489
|
+
top: 64,
|
|
490
|
+
narrowTop: 106,
|
|
491
|
+
bottom: 86
|
|
492
|
+
},
|
|
454
493
|
get anchor() {
|
|
455
494
|
return r();
|
|
456
495
|
},
|
|
457
496
|
get revision() {
|
|
458
|
-
return
|
|
497
|
+
return Z();
|
|
459
498
|
},
|
|
460
499
|
class: "workbench-object-tools",
|
|
461
500
|
get children() {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
get
|
|
467
|
-
return
|
|
501
|
+
return g(Fe, {
|
|
502
|
+
kind: "sticky",
|
|
503
|
+
onInsertEmoji: (a) => (X() === "title" && o().title !== void 0 ? L : n).insertTextAtSelection(a),
|
|
504
|
+
materials: ["tint", "tab", "ruled"],
|
|
505
|
+
get material() {
|
|
506
|
+
return o().material ?? "tint";
|
|
468
507
|
},
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
508
|
+
materialLabel: (a) => t("useStickyMaterial", t(a)),
|
|
509
|
+
preview: (a) => g(nt, {
|
|
510
|
+
get color() {
|
|
511
|
+
return o().color;
|
|
512
|
+
},
|
|
513
|
+
material: a
|
|
514
|
+
}),
|
|
515
|
+
onMaterial: (a) => T()(o().id, {
|
|
516
|
+
material: a
|
|
517
|
+
}),
|
|
518
|
+
get palette() {
|
|
519
|
+
return (() => {
|
|
520
|
+
var a = lt();
|
|
521
|
+
return k(a, g(de, {
|
|
522
|
+
each: ft,
|
|
523
|
+
children: (M) => (() => {
|
|
524
|
+
var R = Et();
|
|
525
|
+
return R.$$click = () => T()(o().id, {
|
|
526
|
+
color: M
|
|
527
|
+
}), R.$$pointerdown = Q, k(R, g(nt, {
|
|
528
|
+
color: M,
|
|
529
|
+
get material() {
|
|
530
|
+
return o().material ?? "tint";
|
|
531
|
+
}
|
|
532
|
+
}), null), k(R, g(ot, {}), null), P((V) => {
|
|
533
|
+
var me = t("stickyColor", t(M)), we = o().color === M;
|
|
534
|
+
return me !== V.e && s(R, "aria-label", V.e = me), we !== V.t && s(R, "aria-pressed", V.t = we), V;
|
|
535
|
+
}, {
|
|
536
|
+
e: void 0,
|
|
537
|
+
t: void 0
|
|
538
|
+
}), R;
|
|
539
|
+
})()
|
|
540
|
+
})), a;
|
|
541
|
+
})();
|
|
473
542
|
},
|
|
474
|
-
get
|
|
475
|
-
return
|
|
476
|
-
|
|
477
|
-
|
|
543
|
+
get actions() {
|
|
544
|
+
return [g(oe, {
|
|
545
|
+
when: S,
|
|
546
|
+
get fallback() {
|
|
547
|
+
return (() => {
|
|
548
|
+
var a = ge();
|
|
549
|
+
return a.$$click = ve, a.$$pointerdown = Q, k(a, g(ue, {
|
|
550
|
+
name: "copy"
|
|
551
|
+
})), P((M) => {
|
|
552
|
+
var R = t("copySticky"), V = !!ne();
|
|
553
|
+
return R !== M.e && s(a, "aria-label", M.e = R), V !== M.t && a.classList.toggle("is-success", M.t = V), M;
|
|
554
|
+
}, {
|
|
555
|
+
e: void 0,
|
|
556
|
+
t: void 0
|
|
557
|
+
}), a;
|
|
558
|
+
})();
|
|
559
|
+
},
|
|
560
|
+
get children() {
|
|
561
|
+
var a = ge();
|
|
562
|
+
return a.$$click = () => S?.duplicate({
|
|
563
|
+
kind: "sticky_note",
|
|
564
|
+
id: o().id
|
|
565
|
+
}), a.$$pointerdown = Q, k(a, g(ue, {
|
|
566
|
+
name: "copy"
|
|
567
|
+
})), P((M) => {
|
|
568
|
+
var R = t("duplicate"), V = t("duplicate");
|
|
569
|
+
return R !== M.e && s(a, "aria-label", M.e = R), V !== M.t && s(a, "title", M.t = V), M;
|
|
570
|
+
}, {
|
|
571
|
+
e: void 0,
|
|
572
|
+
t: void 0
|
|
573
|
+
}), a;
|
|
574
|
+
}
|
|
575
|
+
}), (() => {
|
|
576
|
+
var a = He();
|
|
577
|
+
return a.$$click = () => h()(o().id), a.$$pointerdown = Q, k(a, g(ue, {
|
|
578
|
+
name: "trash"
|
|
579
|
+
})), P((M) => {
|
|
580
|
+
var R = t("deleteSticky"), V = t("deleteSticky");
|
|
581
|
+
return R !== M.e && s(a, "aria-label", M.e = R), V !== M.t && s(a, "title", M.t = V), M;
|
|
582
|
+
}, {
|
|
583
|
+
e: void 0,
|
|
584
|
+
t: void 0
|
|
585
|
+
}), a;
|
|
586
|
+
})()];
|
|
478
587
|
}
|
|
479
|
-
})
|
|
480
|
-
each: mt,
|
|
481
|
-
children: (z) => (() => {
|
|
482
|
-
var A = _t(), Z = A.firstChild;
|
|
483
|
-
return A.$$click = () => v()(t().id, {
|
|
484
|
-
color: z
|
|
485
|
-
}), A.$$pointerdown = K, c(Z, "data-note-color", z), F((o) => {
|
|
486
|
-
var g = n("stickyColor", n(z)), R = t().color === z, W = t().material ?? "tint";
|
|
487
|
-
return g !== o.e && c(A, "aria-label", o.e = g), R !== o.t && c(A, "aria-pressed", o.t = R), W !== o.a && c(Z, "data-note-material", o.a = W), o;
|
|
488
|
-
}, {
|
|
489
|
-
e: void 0,
|
|
490
|
-
t: void 0,
|
|
491
|
-
a: void 0
|
|
492
|
-
}), A;
|
|
493
|
-
})()
|
|
494
|
-
}), re), C(re, b(me, {
|
|
495
|
-
each: ["tint", "tab", "ruled"],
|
|
496
|
-
children: (z) => (() => {
|
|
497
|
-
var A = Et(), Z = A.firstChild, o = Z.nextSibling;
|
|
498
|
-
return A.$$click = () => v()(t().id, {
|
|
499
|
-
material: z
|
|
500
|
-
}), A.$$pointerdown = K, c(Z, "data-note-material", z), C(o, () => n(z)), F((g) => {
|
|
501
|
-
var R = n("useStickyMaterial", n(z)), W = (t().material ?? "tint") === z, ce = t().color;
|
|
502
|
-
return R !== g.e && c(A, "aria-label", g.e = R), W !== g.t && c(A, "aria-pressed", g.t = W), ce !== g.a && c(Z, "data-note-color", g.a = ce), g;
|
|
503
|
-
}, {
|
|
504
|
-
e: void 0,
|
|
505
|
-
t: void 0,
|
|
506
|
-
a: void 0
|
|
507
|
-
}), A;
|
|
508
|
-
})()
|
|
509
|
-
})), se.$$click = () => {
|
|
510
|
-
const z = document.activeElement;
|
|
511
|
-
z instanceof HTMLElement && z.blur();
|
|
512
|
-
}, se.$$pointerdown = K, C(se, () => n("done")), ae.$$click = (z) => {
|
|
513
|
-
Q(z), d()(t().id);
|
|
514
|
-
}, ae.$$pointerdown = K, C(ae, b(Be, {
|
|
515
|
-
class: "w-3.5 h-3.5"
|
|
516
|
-
})), F((z) => {
|
|
517
|
-
var A = !!h(), Z = n("copySticky"), o = n(h() ? "copiedSticky" : "copySticky"), g = n("stickyMaterial"), R = n("deleteSticky"), W = n("deleteSticky");
|
|
518
|
-
return A !== z.e && X.classList.toggle("is-success", z.e = A), Z !== z.t && c(X, "aria-label", z.t = Z), o !== z.a && c(X, "title", z.a = o), g !== z.o && c(re, "aria-label", z.o = g), R !== z.i && c(ae, "aria-label", z.i = R), W !== z.n && c(ae, "title", z.n = W), z;
|
|
519
|
-
}, {
|
|
520
|
-
e: void 0,
|
|
521
|
-
t: void 0,
|
|
522
|
-
a: void 0,
|
|
523
|
-
o: void 0,
|
|
524
|
-
i: void 0,
|
|
525
|
-
n: void 0
|
|
526
|
-
}), $;
|
|
588
|
+
});
|
|
527
589
|
}
|
|
528
590
|
});
|
|
529
591
|
}
|
|
530
|
-
}), null),
|
|
592
|
+
}), null), k($, g(oe, {
|
|
593
|
+
get when() {
|
|
594
|
+
return i();
|
|
595
|
+
},
|
|
596
|
+
get children() {
|
|
597
|
+
return St();
|
|
598
|
+
}
|
|
599
|
+
}), null), k($, g(oe, {
|
|
531
600
|
get when() {
|
|
532
601
|
return !p();
|
|
533
602
|
},
|
|
534
603
|
get children() {
|
|
535
|
-
var
|
|
536
|
-
return
|
|
604
|
+
var a = zt();
|
|
605
|
+
return U(a, "pointerdown", y.beginResize, !0), P(() => s(a, "aria-label", t("resizeSticky"))), a;
|
|
537
606
|
}
|
|
538
|
-
}), null),
|
|
539
|
-
var
|
|
540
|
-
"is-selected":
|
|
607
|
+
}), null), P((a) => {
|
|
608
|
+
var M = {
|
|
609
|
+
"is-selected": i(),
|
|
541
610
|
"is-locked": p(),
|
|
542
|
-
"is-filtered-out":
|
|
543
|
-
"is-dragging":
|
|
544
|
-
"is-resizing":
|
|
545
|
-
"is-copied":
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
611
|
+
"is-filtered-out": Y(),
|
|
612
|
+
"is-dragging": b.isDragging(),
|
|
613
|
+
"is-resizing": y.isResizing(),
|
|
614
|
+
"is-copied": ne(),
|
|
615
|
+
"is-editing": te(),
|
|
616
|
+
[tn[o().color]]: !0
|
|
617
|
+
}, R = o().id, V = o().id, me = o().id, we = Z(), Ue = o().color, Ke = o().material ?? "tint", Ve = t("dragSticky"), qe = p(), Je = t("textPlaceholder"), Qe = !p(), Ze = p() ? "true" : void 0, et = t("stickyBody");
|
|
618
|
+
return a.e = it($, M, a.e), R !== a.t && s($, "data-floe-workbench-widget-id", a.t = R), V !== a.a && s($, "data-wb-object-id", a.a = V), me !== a.o && s($, "data-floe-workbench-sticky-id", a.o = me), a.i = he($, we, a.i), Ue !== a.n && s(ie, "data-note-color", a.n = Ue), Ke !== a.s && s(ie, "data-note-material", a.s = Ke), Ve !== a.h && s(N, "aria-label", a.h = Ve), qe !== a.r && (N.disabled = a.r = qe), Je !== a.d && s(ee, "data-placeholder", a.d = Je), Qe !== a.l && s(ee, "contenteditable", a.l = Qe), Ze !== a.u && s(ee, "aria-disabled", a.u = Ze), et !== a.c && s(ee, "aria-label", a.c = et), a;
|
|
549
619
|
}, {
|
|
550
620
|
e: void 0,
|
|
551
621
|
t: void 0,
|
|
@@ -554,33 +624,40 @@ function $n(e) {
|
|
|
554
624
|
i: void 0,
|
|
555
625
|
n: void 0,
|
|
556
626
|
s: void 0,
|
|
557
|
-
h: void 0
|
|
558
|
-
|
|
627
|
+
h: void 0,
|
|
628
|
+
r: void 0,
|
|
629
|
+
d: void 0,
|
|
630
|
+
l: void 0,
|
|
631
|
+
u: void 0,
|
|
632
|
+
c: void 0
|
|
633
|
+
}), $;
|
|
559
634
|
})();
|
|
560
635
|
}
|
|
561
|
-
function
|
|
562
|
-
const
|
|
636
|
+
function cn(e) {
|
|
637
|
+
const t = _e(), r = c(() => e.item), v = c(() => e.selected), o = c(() => e.editable), i = c(() => e.viewportScale), x = c(() => e.viewport ?? {
|
|
563
638
|
x: 0,
|
|
564
639
|
y: 0,
|
|
565
640
|
scale: 1
|
|
566
|
-
}),
|
|
641
|
+
}), z = c(() => e.projection), D = c(() => e.preview), B = c(() => e.textEditorRegistry), F = c(() => e.onPreviewGeometry), p = c(() => e.onSelect), Y = c(() => e.onContextMenu), E = c(() => e.onCommitMove), I = c(() => e.onUpdate), C = Me({
|
|
567
642
|
value: () => r().text,
|
|
568
|
-
onCommit: (
|
|
569
|
-
text:
|
|
643
|
+
onCommit: (h) => I()(r().id, {
|
|
644
|
+
text: h
|
|
570
645
|
})
|
|
571
646
|
});
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
const
|
|
576
|
-
focus:
|
|
577
|
-
|
|
578
|
-
|
|
647
|
+
fe(() => {
|
|
648
|
+
const h = B();
|
|
649
|
+
if (!h) return;
|
|
650
|
+
const l = h.register(r().id, {
|
|
651
|
+
focus: C.focus,
|
|
652
|
+
blur: C.blur,
|
|
653
|
+
isFocused: C.isFocused,
|
|
654
|
+
insertTextAtSelection: C.insertTextAtSelection,
|
|
655
|
+
readText: C.readText
|
|
579
656
|
});
|
|
580
|
-
|
|
657
|
+
ye(l);
|
|
581
658
|
});
|
|
582
|
-
const
|
|
583
|
-
viewportScale:
|
|
659
|
+
const G = Le({
|
|
660
|
+
viewportScale: i,
|
|
584
661
|
readPosition: () => ({
|
|
585
662
|
x: r().x,
|
|
586
663
|
y: r().y
|
|
@@ -589,51 +666,56 @@ function on(e) {
|
|
|
589
666
|
width: r().width,
|
|
590
667
|
height: r().height
|
|
591
668
|
}),
|
|
592
|
-
onCommitMove: (
|
|
593
|
-
onPreviewMove: (
|
|
669
|
+
onCommitMove: (h) => E()(r().id, h),
|
|
670
|
+
onPreviewMove: (h) => F()?.({
|
|
594
671
|
kind: "annotation",
|
|
595
672
|
id: r().id,
|
|
596
|
-
...
|
|
673
|
+
...h
|
|
597
674
|
}),
|
|
598
|
-
onPreviewEnd: () =>
|
|
599
|
-
}),
|
|
600
|
-
const
|
|
601
|
-
return
|
|
602
|
-
geometry:
|
|
603
|
-
preview:
|
|
604
|
-
position:
|
|
605
|
-
width:
|
|
606
|
-
height:
|
|
675
|
+
onPreviewEnd: () => F()?.(null)
|
|
676
|
+
}), q = O(() => {
|
|
677
|
+
const h = r(), l = Se(D(), "annotation", h.id);
|
|
678
|
+
return ze({
|
|
679
|
+
geometry: Ee({
|
|
680
|
+
preview: l,
|
|
681
|
+
position: G.position(),
|
|
682
|
+
width: h.width,
|
|
683
|
+
height: h.height
|
|
607
684
|
}),
|
|
608
|
-
viewport:
|
|
609
|
-
projection:
|
|
685
|
+
viewport: x(),
|
|
686
|
+
projection: z()
|
|
610
687
|
});
|
|
611
|
-
}),
|
|
612
|
-
...pe(
|
|
688
|
+
}), w = O(() => z() === "screen" ? Math.max(x().scale, 1e-3) : 1), d = O(() => ({
|
|
689
|
+
...pe(q()),
|
|
613
690
|
"z-index": `${r().z_index}`,
|
|
614
691
|
"--workbench-text-color": r().color,
|
|
692
|
+
...r().color === bt ? {
|
|
693
|
+
"--workbench-text-ink": r().font_size < 16 ? "color-mix(in oklab,var(--workbench-canvas-ink) 95%,var(--wb-canvas))" : "var(--workbench-canvas-ink)"
|
|
694
|
+
} : {},
|
|
615
695
|
"--workbench-text-size": `${r().font_size}px`,
|
|
696
|
+
"--workbench-text-line-height": r().font_size >= 24 ? "1.35" : r().font_size >= 16 ? "1.8" : "1.7",
|
|
697
|
+
"--workbench-text-letter-spacing": r().font_size >= 40 ? "-1.2px" : r().font_size >= 24 ? "-.65px" : r().font_size >= 16 ? "0" : ".1px",
|
|
616
698
|
"--workbench-text-weight": `${r().font_weight}`,
|
|
617
699
|
"--workbench-text-align": r().align,
|
|
618
700
|
"--workbench-text-family": r().font_family,
|
|
619
|
-
"--workbench-text-content-scale": `${
|
|
620
|
-
"--workbench-text-content-inverse-scale": `${1 /
|
|
621
|
-
})),
|
|
622
|
-
!
|
|
701
|
+
"--workbench-text-content-scale": `${w()}`,
|
|
702
|
+
"--workbench-text-content-inverse-scale": `${1 / w()}`
|
|
703
|
+
})), T = (h) => {
|
|
704
|
+
!o() || h.button !== 0 || h.target instanceof Element && h.target.closest(".workbench-text-annotation__content") || (h.stopPropagation(), p()(r().id));
|
|
623
705
|
};
|
|
624
706
|
return (() => {
|
|
625
|
-
var
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
},
|
|
629
|
-
|
|
630
|
-
}),
|
|
631
|
-
!
|
|
707
|
+
var h = Rt(), l = h.firstChild;
|
|
708
|
+
h.$$contextmenu = (n) => {
|
|
709
|
+
o() && (n.preventDefault(), n.stopPropagation(), p()(r().id), Y()?.(n, r()));
|
|
710
|
+
}, h.$$pointerdown = T, U(l, "compositionend", C.handleCompositionEnd), U(l, "compositionstart", C.handleCompositionStart), U(l, "blur", C.handleBlur), U(l, "keydown", C.handleKeyDown, !0), l.addEventListener("focus", (n) => {
|
|
711
|
+
C.handleFocus(n), o() && p()(r().id);
|
|
712
|
+
}), l.$$pointerdown = (n) => {
|
|
713
|
+
!o() || n.button !== 0 || p()(r().id);
|
|
632
714
|
};
|
|
633
|
-
var
|
|
634
|
-
return typeof
|
|
635
|
-
var
|
|
636
|
-
return
|
|
715
|
+
var u = C.bind;
|
|
716
|
+
return typeof u == "function" ? se(u, l) : C.bind = l, s(l, "spellcheck", !1), P((n) => {
|
|
717
|
+
var L = !!v(), X = !!o(), j = o() ? "true" : void 0, S = r().id, te = d(), ne = o() ? "plaintext-only" : !1, ae = o() ? 0 : void 0, _ = o() ? "textbox" : void 0, J = t("textContent"), ce = o() ? "true" : void 0, ve = o() ? void 0 : "true";
|
|
718
|
+
return L !== n.e && h.classList.toggle("is-selected", n.e = L), X !== n.t && h.classList.toggle("is-editable", n.t = X), j !== n.a && s(h, "data-floe-canvas-interactive", n.a = j), S !== n.o && s(h, "data-wb-object-id", n.o = S), n.i = he(h, te, n.i), ne !== n.n && s(l, "contenteditable", n.n = ne), ae !== n.s && s(l, "tabindex", n.s = ae), _ !== n.h && s(l, "role", n.h = _), J !== n.r && s(l, "aria-label", n.r = J), ce !== n.d && s(l, "aria-multiline", n.d = ce), ve !== n.l && s(l, "aria-disabled", n.l = ve), n;
|
|
637
719
|
}, {
|
|
638
720
|
e: void 0,
|
|
639
721
|
t: void 0,
|
|
@@ -646,27 +728,27 @@ function on(e) {
|
|
|
646
728
|
r: void 0,
|
|
647
729
|
d: void 0,
|
|
648
730
|
l: void 0
|
|
649
|
-
}),
|
|
731
|
+
}), h;
|
|
650
732
|
})();
|
|
651
733
|
}
|
|
652
|
-
function
|
|
653
|
-
const
|
|
734
|
+
function ln(e) {
|
|
735
|
+
const t = _e(), r = c(() => e.item), v = c(() => e.selected), o = c(() => e.editable), i = c(() => e.viewportScale), x = c(() => e.viewport ?? {
|
|
654
736
|
x: 0,
|
|
655
737
|
y: 0,
|
|
656
738
|
scale: 1
|
|
657
|
-
}),
|
|
739
|
+
}), z = c(() => e.projection), D = c(() => e.preview), B = c(() => e.onPreviewGeometry), F = c(() => e.onSelect), p = c(() => e.onContextMenu), Y = c(() => e.onCommitMove), E = Me({
|
|
658
740
|
value: () => r().name,
|
|
659
741
|
singleLine: !0,
|
|
660
|
-
onCommit: (
|
|
661
|
-
name:
|
|
742
|
+
onCommit: (d) => e.onUpdate?.(r().id, {
|
|
743
|
+
name: d
|
|
662
744
|
})
|
|
663
745
|
});
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
|
|
746
|
+
fe(() => {
|
|
747
|
+
const d = e.textEditorRegistry?.register(r().id, E);
|
|
748
|
+
ye(() => d?.());
|
|
667
749
|
});
|
|
668
|
-
const
|
|
669
|
-
viewportScale:
|
|
750
|
+
const I = Le({
|
|
751
|
+
viewportScale: i,
|
|
670
752
|
readPosition: () => ({
|
|
671
753
|
x: r().x,
|
|
672
754
|
y: r().y
|
|
@@ -675,48 +757,52 @@ function rn(e) {
|
|
|
675
757
|
width: r().width,
|
|
676
758
|
height: r().height
|
|
677
759
|
}),
|
|
678
|
-
onCommitMove: (
|
|
679
|
-
onPreviewMove: (
|
|
760
|
+
onCommitMove: (d) => Y()(r().id, d),
|
|
761
|
+
onPreviewMove: (d) => B()?.({
|
|
680
762
|
kind: "background_layer",
|
|
681
763
|
id: r().id,
|
|
682
|
-
...
|
|
764
|
+
...d
|
|
683
765
|
}),
|
|
684
|
-
onPreviewEnd: () =>
|
|
685
|
-
}),
|
|
686
|
-
const
|
|
687
|
-
return
|
|
688
|
-
geometry:
|
|
689
|
-
preview:
|
|
690
|
-
position:
|
|
691
|
-
width:
|
|
692
|
-
height:
|
|
766
|
+
onPreviewEnd: () => B()?.(null)
|
|
767
|
+
}), C = O(() => {
|
|
768
|
+
const d = r(), T = Se(D(), "background_layer", d.id);
|
|
769
|
+
return ze({
|
|
770
|
+
geometry: Ee({
|
|
771
|
+
preview: T,
|
|
772
|
+
position: I.position(),
|
|
773
|
+
width: d.width,
|
|
774
|
+
height: d.height
|
|
693
775
|
}),
|
|
694
|
-
viewport:
|
|
695
|
-
projection:
|
|
776
|
+
viewport: x(),
|
|
777
|
+
projection: z()
|
|
696
778
|
});
|
|
697
|
-
}),
|
|
698
|
-
...pe(
|
|
779
|
+
}), G = O(() => z() === "screen" ? Math.max(x().scale, 1e-3) : 1), q = O(() => ({
|
|
780
|
+
...pe(C()),
|
|
699
781
|
"z-index": `${r().z_index}`,
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
782
|
+
"--workbench-layer-control-inverse-scale": `${1 / C().scale}`,
|
|
783
|
+
"--workbench-region-content-scale": `${G()}`,
|
|
784
|
+
"--workbench-region-content-inverse-scale": `${1 / G()}`,
|
|
785
|
+
...Ce(r())
|
|
786
|
+
})), w = (d) => {
|
|
787
|
+
!o() || d.button !== 0 || d.target instanceof Element && d.target.closest(".workbench-background-region__label, .workbench-background-region__toolbar, .workbench-layer-resize") || (F()(r().id), I.beginDrag(d));
|
|
703
788
|
};
|
|
704
789
|
return (() => {
|
|
705
|
-
var
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
},
|
|
709
|
-
|
|
790
|
+
var d = Pt(), T = d.firstChild, h = T.firstChild, l = T.nextSibling;
|
|
791
|
+
d.$$contextmenu = (n) => {
|
|
792
|
+
o() && (n.preventDefault(), n.stopPropagation(), F()(r().id), p()?.(n, r()));
|
|
793
|
+
}, d.addEventListener("focus", () => o() && F()(r().id)), d.$$pointerdown = w, U(h, "compositionend", E.handleCompositionEnd), U(h, "compositionstart", E.handleCompositionStart), U(h, "keydown", E.handleKeyDown, !0), U(h, "blur", E.handleBlur), U(h, "focus", E.handleFocus), h.$$pointerdown = (n) => {
|
|
794
|
+
n.stopPropagation(), F()(r().id);
|
|
710
795
|
};
|
|
711
|
-
var
|
|
712
|
-
return typeof
|
|
713
|
-
var
|
|
714
|
-
"is-selected":
|
|
715
|
-
"is-
|
|
716
|
-
"is-
|
|
796
|
+
var u = E.bind;
|
|
797
|
+
return typeof u == "function" ? se(u, h) : E.bind = h, l.$$pointerdown = w, k(l, g(Ge, {})), P((n) => {
|
|
798
|
+
var L = {
|
|
799
|
+
"is-selected": v(),
|
|
800
|
+
"is-editing": E.isFocused(),
|
|
801
|
+
"is-editable": o(),
|
|
802
|
+
"is-transforming": I.isDragging(),
|
|
717
803
|
[`is-material-${r().material}`]: !0
|
|
718
|
-
},
|
|
719
|
-
return
|
|
804
|
+
}, X = o() ? "true" : void 0, j = r().id, S = q(), te = o() ? 0 : void 0, ne = !r().name.trim() && !E.isFocused(), ae = o() ? "plaintext-only" : !1, _ = t("regionName"), J = t("regionPlaceholder"), ce = t("moveRegion");
|
|
805
|
+
return n.e = it(d, L, n.e), X !== n.t && s(d, "data-floe-canvas-interactive", n.t = X), j !== n.a && s(d, "data-wb-object-id", n.a = j), n.o = he(d, S, n.o), te !== n.i && s(d, "tabindex", n.i = te), ne !== n.n && T.classList.toggle("is-empty", n.n = ne), ae !== n.s && s(h, "contenteditable", n.s = ae), _ !== n.h && s(h, "aria-label", n.h = _), J !== n.r && s(h, "data-placeholder", n.r = J), ce !== n.d && s(l, "aria-label", n.d = ce), n;
|
|
720
806
|
}, {
|
|
721
807
|
e: void 0,
|
|
722
808
|
t: void 0,
|
|
@@ -725,417 +811,497 @@ function rn(e) {
|
|
|
725
811
|
i: void 0,
|
|
726
812
|
n: void 0,
|
|
727
813
|
s: void 0,
|
|
728
|
-
h: void 0
|
|
729
|
-
|
|
814
|
+
h: void 0,
|
|
815
|
+
r: void 0,
|
|
816
|
+
d: void 0
|
|
817
|
+
}), d;
|
|
730
818
|
})();
|
|
731
819
|
}
|
|
732
|
-
function
|
|
733
|
-
const
|
|
820
|
+
function dn(e) {
|
|
821
|
+
const t = _e(), r = Ne(We), [v, o] = re(), i = c(() => e.item), x = () => e.textEditorRegistry?.get(i().id), z = c(() => e.viewportScale), D = c(() => e.viewport ?? {
|
|
734
822
|
x: 0,
|
|
735
823
|
y: 0,
|
|
736
824
|
scale: 1
|
|
737
|
-
}),
|
|
738
|
-
let
|
|
739
|
-
const [
|
|
740
|
-
viewportScale:
|
|
825
|
+
}), B = c(() => e.projection), F = c(() => e.preview), p = c(() => e.onPreviewGeometry), Y = c(() => e.onCommitMove), E = c(() => e.onCommitResize), I = c(() => e.onUpdate), C = c(() => e.onDelete);
|
|
826
|
+
let G, q;
|
|
827
|
+
const [w, d] = re(!1), [T, h] = re(""), [l, u] = re(!1), n = O(() => Ie.find((_) => _.fontFamily === i().font_family) ?? Ie[0]), L = Le({
|
|
828
|
+
viewportScale: z,
|
|
741
829
|
readPosition: () => ({
|
|
742
|
-
x:
|
|
743
|
-
y:
|
|
830
|
+
x: i().x,
|
|
831
|
+
y: i().y
|
|
744
832
|
}),
|
|
745
833
|
readGeometry: () => ({
|
|
746
|
-
width:
|
|
747
|
-
height:
|
|
834
|
+
width: i().width,
|
|
835
|
+
height: i().height
|
|
748
836
|
}),
|
|
749
|
-
onCommitMove: (
|
|
750
|
-
onPreviewMove: (
|
|
837
|
+
onCommitMove: (_) => Y()(i().id, _),
|
|
838
|
+
onPreviewMove: (_) => p()?.({
|
|
751
839
|
kind: "annotation",
|
|
752
|
-
id:
|
|
753
|
-
...
|
|
840
|
+
id: i().id,
|
|
841
|
+
..._
|
|
754
842
|
}),
|
|
755
|
-
onPreviewEnd: () =>
|
|
756
|
-
}),
|
|
757
|
-
viewportScale:
|
|
843
|
+
onPreviewEnd: () => p()?.(null)
|
|
844
|
+
}), X = Ye({
|
|
845
|
+
viewportScale: z,
|
|
758
846
|
readSize: () => ({
|
|
759
|
-
width:
|
|
760
|
-
height:
|
|
847
|
+
width: i().width,
|
|
848
|
+
height: i().height
|
|
761
849
|
}),
|
|
762
|
-
minWidth:
|
|
763
|
-
minHeight:
|
|
764
|
-
onCommitResize: (
|
|
765
|
-
onPreviewResize: (
|
|
850
|
+
minWidth: Zt,
|
|
851
|
+
minHeight: en,
|
|
852
|
+
onCommitResize: (_) => E()(i().id, _),
|
|
853
|
+
onPreviewResize: (_) => p()?.({
|
|
766
854
|
kind: "annotation",
|
|
767
|
-
id:
|
|
768
|
-
x:
|
|
769
|
-
y:
|
|
770
|
-
width:
|
|
771
|
-
height:
|
|
855
|
+
id: i().id,
|
|
856
|
+
x: i().x,
|
|
857
|
+
y: i().y,
|
|
858
|
+
width: _.width,
|
|
859
|
+
height: _.height
|
|
772
860
|
}),
|
|
773
|
-
onPreviewEnd: () =>
|
|
774
|
-
}),
|
|
775
|
-
const
|
|
776
|
-
return
|
|
777
|
-
geometry:
|
|
778
|
-
preview:
|
|
779
|
-
position:
|
|
780
|
-
width:
|
|
781
|
-
height:
|
|
861
|
+
onPreviewEnd: () => p()?.(null)
|
|
862
|
+
}), j = O(() => {
|
|
863
|
+
const _ = i(), J = Se(F(), "annotation", _.id);
|
|
864
|
+
return ze({
|
|
865
|
+
geometry: Ee({
|
|
866
|
+
preview: J,
|
|
867
|
+
position: L.position(),
|
|
868
|
+
width: X.size().width,
|
|
869
|
+
height: X.size().height
|
|
782
870
|
}),
|
|
783
|
-
viewport:
|
|
784
|
-
projection:
|
|
871
|
+
viewport: D(),
|
|
872
|
+
projection: B()
|
|
785
873
|
});
|
|
786
|
-
}),
|
|
787
|
-
...pe(
|
|
788
|
-
"z-index": `${
|
|
789
|
-
"--workbench-layer-control-inverse-scale": `${1 / Math.max(
|
|
790
|
-
})),
|
|
791
|
-
if (!Number.isFinite(
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
font_size:
|
|
874
|
+
}), S = O(() => ({
|
|
875
|
+
...pe(j()),
|
|
876
|
+
"z-index": `${i().z_index}`,
|
|
877
|
+
"--workbench-layer-control-inverse-scale": `${1 / Math.max(j().scale, 1e-3)}`
|
|
878
|
+
})), te = () => nn(["left", "center", "right"], i().align), ne = (_) => {
|
|
879
|
+
if (!Number.isFinite(_)) return;
|
|
880
|
+
const J = rn(_);
|
|
881
|
+
h(String(J)), I()(i().id, {
|
|
882
|
+
font_size: J
|
|
795
883
|
});
|
|
796
|
-
},
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
|
|
884
|
+
}, ae = () => {
|
|
885
|
+
const _ = T().trim(), J = Number(_);
|
|
886
|
+
if (_.length > 0 && Number.isFinite(J)) {
|
|
887
|
+
ne(J);
|
|
800
888
|
return;
|
|
801
889
|
}
|
|
802
|
-
|
|
890
|
+
h(String(i().font_size));
|
|
803
891
|
};
|
|
804
|
-
return
|
|
805
|
-
typeof document < "u" && document.activeElement ===
|
|
806
|
-
}),
|
|
807
|
-
var
|
|
808
|
-
return
|
|
892
|
+
return fe(() => {
|
|
893
|
+
typeof document < "u" && document.activeElement === G || h(String(i().font_size));
|
|
894
|
+
}), on(l, () => q, () => u(!1)), (() => {
|
|
895
|
+
var _ = Mt(), J = _.firstChild, ce = J.nextSibling, ve = ce.nextSibling;
|
|
896
|
+
return se(o, _), U(ce, "pointerdown", L.beginDrag, !0), k(ce, g(Ge, {})), k(_, g(Ae, {
|
|
897
|
+
reservedSpace: {
|
|
898
|
+
top: 64,
|
|
899
|
+
narrowTop: 106,
|
|
900
|
+
bottom: 86
|
|
901
|
+
},
|
|
809
902
|
get anchor() {
|
|
810
|
-
return
|
|
903
|
+
return v();
|
|
811
904
|
},
|
|
812
905
|
get revision() {
|
|
813
|
-
return
|
|
906
|
+
return S();
|
|
814
907
|
},
|
|
815
908
|
class: "workbench-object-tools",
|
|
816
909
|
get children() {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
typeof z == "function" ? ge(z, ve) : P = ve, ie.$$click = (o) => {
|
|
823
|
-
Q(o), d((g) => !g);
|
|
824
|
-
}, ie.$$pointerdown = K, C(be, () => n(s().id)), C(ie, b(vt, {
|
|
825
|
-
class: "workbench-text-font-trigger__icon"
|
|
826
|
-
}), null), C(ve, b(ue, {
|
|
827
|
-
get when() {
|
|
828
|
-
return v();
|
|
910
|
+
return g(Fe, {
|
|
911
|
+
kind: "text",
|
|
912
|
+
onInsertEmoji: (m) => x()?.insertTextAtSelection(m),
|
|
913
|
+
get moreOpen() {
|
|
914
|
+
return w();
|
|
829
915
|
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
return g.$$click = (R) => {
|
|
872
|
-
Q(R), _()(t().id, {
|
|
873
|
-
color: o
|
|
874
|
-
});
|
|
875
|
-
}, g.$$pointerdown = K, Pe(g, "background", o), F((R) => {
|
|
876
|
-
var W = n("textColor", o), ce = t().color === o;
|
|
877
|
-
return W !== R.e && c(g, "aria-label", R.e = W), ce !== R.t && g.classList.toggle("is-active", R.t = ce), R;
|
|
916
|
+
onMoreClose: () => d(!1),
|
|
917
|
+
more: () => [(() => {
|
|
918
|
+
var m = It(), b = m.firstChild, y = b.firstChild, W = y.nextSibling;
|
|
919
|
+
m.$$click = Oe, m.$$pointerdown = je;
|
|
920
|
+
var H = q;
|
|
921
|
+
return typeof H == "function" ? se(H, m) : q = m, b.$$click = (f) => {
|
|
922
|
+
$e(f), u((K) => !K);
|
|
923
|
+
}, b.$$pointerdown = Q, k(W, () => t(n().id)), k(b, g(ht, {
|
|
924
|
+
class: "workbench-text-font-trigger__icon"
|
|
925
|
+
}), null), k(m, g(oe, {
|
|
926
|
+
get when() {
|
|
927
|
+
return l();
|
|
928
|
+
},
|
|
929
|
+
get children() {
|
|
930
|
+
var f = Lt();
|
|
931
|
+
return k(f, g(de, {
|
|
932
|
+
each: Ie,
|
|
933
|
+
children: (K) => (() => {
|
|
934
|
+
var Z = Ot(), $ = Z.firstChild, ie = $.nextSibling;
|
|
935
|
+
return Z.$$click = (N) => {
|
|
936
|
+
$e(N), I()(i().id, {
|
|
937
|
+
font_family: K.fontFamily,
|
|
938
|
+
font_weight: K.fontWeight
|
|
939
|
+
}), u(!1);
|
|
940
|
+
}, Z.$$pointerdown = Q, k(ie, () => t(K.id)), P((N) => {
|
|
941
|
+
var le = i().font_family === K.fontFamily, ee = t("useFont", t(K.id)), ke = t("fontPreview", t(K.id)), a = i().font_family === K.fontFamily, M = K.fontFamily, R = `${K.fontWeight}`;
|
|
942
|
+
return le !== N.e && s(Z, "aria-checked", N.e = le), ee !== N.t && s(Z, "aria-label", N.t = ee), ke !== N.a && s(Z, "title", N.a = ke), a !== N.o && Z.classList.toggle("is-active", N.o = a), M !== N.i && xe($, "font-family", N.i = M), R !== N.n && xe($, "font-weight", N.n = R), N;
|
|
943
|
+
}, {
|
|
944
|
+
e: void 0,
|
|
945
|
+
t: void 0,
|
|
946
|
+
a: void 0,
|
|
947
|
+
o: void 0,
|
|
948
|
+
i: void 0,
|
|
949
|
+
n: void 0
|
|
950
|
+
}), Z;
|
|
951
|
+
})()
|
|
952
|
+
})), P(() => s(f, "aria-label", t("boldFont"))), f;
|
|
953
|
+
}
|
|
954
|
+
}), null), P((f) => {
|
|
955
|
+
var K = t("chooseFont"), Z = l(), $ = t("chooseFont"), ie = n().fontFamily, N = `${n().fontWeight}`;
|
|
956
|
+
return K !== f.e && s(b, "aria-label", f.e = K), Z !== f.t && s(b, "aria-expanded", f.t = Z), $ !== f.a && s(b, "title", f.a = $), ie !== f.o && xe(y, "font-family", f.o = ie), N !== f.i && xe(y, "font-weight", f.i = N), f;
|
|
878
957
|
}, {
|
|
879
958
|
e: void 0,
|
|
880
|
-
t: void 0
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
959
|
+
t: void 0,
|
|
960
|
+
a: void 0,
|
|
961
|
+
o: void 0,
|
|
962
|
+
i: void 0
|
|
963
|
+
}), m;
|
|
964
|
+
})(), (() => {
|
|
965
|
+
var m = jt(), b = m.firstChild, y = b.nextSibling, W = y.nextSibling;
|
|
966
|
+
m.$$click = Oe, m.$$pointerdown = je, b.$$click = (f) => {
|
|
967
|
+
$e(f), ne(i().font_size - 1);
|
|
968
|
+
}, b.$$pointerdown = Q, k(b, g(wt, {
|
|
969
|
+
class: "w-3 h-3"
|
|
970
|
+
})), y.$$keydown = (f) => {
|
|
971
|
+
f.key === "Enter" && (f.preventDefault(), ae(), f.currentTarget.blur());
|
|
972
|
+
}, y.addEventListener("blur", ae), y.$$input = (f) => h(f.currentTarget.value), y.$$click = Oe, y.$$pointerdown = je;
|
|
973
|
+
var H = G;
|
|
974
|
+
return typeof H == "function" ? se(H, y) : G = y, W.$$click = (f) => {
|
|
975
|
+
$e(f), ne(i().font_size + 1);
|
|
976
|
+
}, W.$$pointerdown = Q, k(W, g(gt, {
|
|
977
|
+
class: "w-3 h-3"
|
|
978
|
+
})), P((f) => {
|
|
979
|
+
var K = t("textSize"), Z = t("decreaseSize"), $ = t("decreaseSize"), ie = t("sizeValue"), N = t("increaseSize"), le = t("increaseSize");
|
|
980
|
+
return K !== f.e && s(m, "aria-label", f.e = K), Z !== f.t && s(b, "aria-label", f.t = Z), $ !== f.a && s(b, "title", f.a = $), ie !== f.o && s(y, "aria-label", f.o = ie), N !== f.i && s(W, "aria-label", f.i = N), le !== f.n && s(W, "title", f.n = le), f;
|
|
981
|
+
}, {
|
|
982
|
+
e: void 0,
|
|
983
|
+
t: void 0,
|
|
984
|
+
a: void 0,
|
|
985
|
+
o: void 0,
|
|
986
|
+
i: void 0,
|
|
987
|
+
n: void 0
|
|
988
|
+
}), P(() => y.value = T()), m;
|
|
989
|
+
})(), g(de, {
|
|
990
|
+
each: kt,
|
|
991
|
+
children: (m) => (() => {
|
|
992
|
+
var b = Dt();
|
|
993
|
+
return b.$$click = (y) => {
|
|
994
|
+
$e(y), I()(i().id, {
|
|
995
|
+
color: m
|
|
996
|
+
});
|
|
997
|
+
}, b.$$pointerdown = Q, xe(b, "background", m), P((y) => {
|
|
998
|
+
var W = t("textColor", m), H = i().color === m;
|
|
999
|
+
return W !== y.e && s(b, "aria-label", y.e = W), H !== y.t && b.classList.toggle("is-active", y.t = H), y;
|
|
1000
|
+
}, {
|
|
1001
|
+
e: void 0,
|
|
1002
|
+
t: void 0
|
|
1003
|
+
}), b;
|
|
1004
|
+
})()
|
|
1005
|
+
}), (() => {
|
|
1006
|
+
var m = ge();
|
|
1007
|
+
return m.$$click = () => I()(i().id, {
|
|
1008
|
+
align: te()
|
|
1009
|
+
}), m.$$pointerdown = Q, k(m, () => t(i().align)), m;
|
|
1010
|
+
})()],
|
|
1011
|
+
get actions() {
|
|
1012
|
+
return [g(oe, {
|
|
1013
|
+
when: r,
|
|
1014
|
+
get children() {
|
|
1015
|
+
var m = ge();
|
|
1016
|
+
return m.$$click = () => r?.duplicate({
|
|
1017
|
+
kind: "annotation",
|
|
1018
|
+
id: i().id
|
|
1019
|
+
}), m.$$pointerdown = Q, k(m, g(ue, {
|
|
1020
|
+
name: "copy"
|
|
1021
|
+
})), P((b) => {
|
|
1022
|
+
var y = t("duplicate"), W = t("duplicate");
|
|
1023
|
+
return y !== b.e && s(m, "aria-label", b.e = y), W !== b.t && s(m, "title", b.t = W), b;
|
|
1024
|
+
}, {
|
|
1025
|
+
e: void 0,
|
|
1026
|
+
t: void 0
|
|
1027
|
+
}), m;
|
|
1028
|
+
}
|
|
1029
|
+
}), (() => {
|
|
1030
|
+
var m = He();
|
|
1031
|
+
return m.$$click = () => C()(i().id), m.$$pointerdown = Q, k(m, g(ue, {
|
|
1032
|
+
name: "trash"
|
|
1033
|
+
})), P(() => s(m, "aria-label", t("deleteText"))), m;
|
|
1034
|
+
})()];
|
|
890
1035
|
},
|
|
891
1036
|
get children() {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
1037
|
+
return [(() => {
|
|
1038
|
+
var m = Tt(), b = m.firstChild;
|
|
1039
|
+
return m.addEventListener("change", (y) => {
|
|
1040
|
+
if (y.currentTarget.value === "more") {
|
|
1041
|
+
d(!w());
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
const W = {
|
|
1045
|
+
title: 48,
|
|
1046
|
+
heading: 30,
|
|
1047
|
+
body: 18,
|
|
1048
|
+
caption: 14
|
|
1049
|
+
}, H = y.currentTarget.value;
|
|
1050
|
+
I()(i().id, {
|
|
1051
|
+
font_size: W[H],
|
|
1052
|
+
font_weight: H === "title" || H === "heading" ? 560 : 400
|
|
1053
|
+
});
|
|
1054
|
+
}), k(m, g(de, {
|
|
1055
|
+
each: ["title", "heading", "body", "caption"],
|
|
1056
|
+
children: (y) => (() => {
|
|
1057
|
+
var W = Ft();
|
|
1058
|
+
return W.value = y, k(W, () => t(y)), W;
|
|
1059
|
+
})()
|
|
1060
|
+
}), b), k(b, () => t("more")), P(() => s(m, "aria-label", t("typography"))), P(() => m.value = i().font_size >= 40 ? "title" : i().font_size >= 24 ? "heading" : i().font_size >= 16 ? "body" : "caption"), m;
|
|
1061
|
+
})(), g(de, {
|
|
1062
|
+
each: ["left", "center"],
|
|
1063
|
+
children: (m) => (() => {
|
|
1064
|
+
var b = ge();
|
|
1065
|
+
return b.$$click = () => I()(i().id, {
|
|
1066
|
+
align: m
|
|
1067
|
+
}), b.$$pointerdown = Q, k(b, g(ue, {
|
|
1068
|
+
name: m
|
|
1069
|
+
})), P((y) => {
|
|
1070
|
+
var W = t(m), H = i().align === m;
|
|
1071
|
+
return W !== y.e && s(b, "aria-label", y.e = W), H !== y.t && s(b, "aria-pressed", y.t = H), y;
|
|
902
1072
|
}, {
|
|
903
1073
|
e: void 0,
|
|
904
1074
|
t: void 0
|
|
905
|
-
}),
|
|
1075
|
+
}), b;
|
|
906
1076
|
})()
|
|
907
|
-
})
|
|
1077
|
+
}), g(mt, {})];
|
|
908
1078
|
}
|
|
909
|
-
})
|
|
910
|
-
Q(o), _()(t().id, {
|
|
911
|
-
align: D()
|
|
912
|
-
});
|
|
913
|
-
}, se.$$pointerdown = K, C(se, () => t().align), ae.$$click = (o) => {
|
|
914
|
-
Q(o), H()(t().id);
|
|
915
|
-
}, ae.$$pointerdown = K, C(ae, b(Be, {
|
|
916
|
-
class: "w-3.5 h-3.5"
|
|
917
|
-
})), F((o) => {
|
|
918
|
-
var g = n("moveText"), R = n("moveText"), W = n("chooseFont"), ce = v(), Y = n("chooseFont"), Ce = s().fontFamily, Se = `${s().fontWeight}`, _e = n("textSize"), Ee = n("decreaseSize"), ze = n("decreaseSize"), Re = n("sizeValue"), Ve = n("increaseSize"), Je = n("increaseSize"), qe = n("insertEmoji"), Qe = a(), Ze = n("insertEmoji"), et = n("deleteText");
|
|
919
|
-
return g !== o.e && c(ne, "aria-label", o.e = g), R !== o.t && c(ne, "title", o.t = R), W !== o.a && c(ie, "aria-label", o.a = W), ce !== o.o && c(ie, "aria-expanded", o.o = ce), Y !== o.i && c(ie, "title", o.i = Y), Ce !== o.n && Pe(I, "font-family", o.n = Ce), Se !== o.s && Pe(I, "font-weight", o.s = Se), _e !== o.h && c(he, "aria-label", o.h = _e), Ee !== o.r && c(we, "aria-label", o.r = Ee), ze !== o.d && c(we, "title", o.d = ze), Re !== o.l && c(oe, "aria-label", o.l = Re), Ve !== o.u && c($, "aria-label", o.u = Ve), Je !== o.c && c($, "title", o.c = Je), qe !== o.w && c(re, "aria-label", o.w = qe), Qe !== o.m && c(re, "aria-expanded", o.m = Qe), Ze !== o.f && c(re, "title", o.f = Ze), et !== o.y && c(ae, "aria-label", o.y = et), o;
|
|
920
|
-
}, {
|
|
921
|
-
e: void 0,
|
|
922
|
-
t: void 0,
|
|
923
|
-
a: void 0,
|
|
924
|
-
o: void 0,
|
|
925
|
-
i: void 0,
|
|
926
|
-
n: void 0,
|
|
927
|
-
s: void 0,
|
|
928
|
-
h: void 0,
|
|
929
|
-
r: void 0,
|
|
930
|
-
d: void 0,
|
|
931
|
-
l: void 0,
|
|
932
|
-
u: void 0,
|
|
933
|
-
c: void 0,
|
|
934
|
-
w: void 0,
|
|
935
|
-
m: void 0,
|
|
936
|
-
f: void 0,
|
|
937
|
-
y: void 0
|
|
938
|
-
}), F(() => oe.value = m()), B;
|
|
1079
|
+
});
|
|
939
1080
|
}
|
|
940
|
-
}),
|
|
941
|
-
var
|
|
942
|
-
return
|
|
1081
|
+
}), ve), U(ve, "pointerdown", X.beginResize, !0), P((m) => {
|
|
1082
|
+
var b = i().id, y = S(), W = t("moveText"), H = t("resizeText");
|
|
1083
|
+
return b !== m.e && s(_, "data-wb-object-id", m.e = b), m.t = he(_, y, m.t), W !== m.a && s(ce, "aria-label", m.a = W), H !== m.o && s(ve, "aria-label", m.o = H), m;
|
|
943
1084
|
}, {
|
|
944
1085
|
e: void 0,
|
|
945
1086
|
t: void 0,
|
|
946
|
-
a: void 0
|
|
947
|
-
|
|
1087
|
+
a: void 0,
|
|
1088
|
+
o: void 0
|
|
1089
|
+
}), _;
|
|
948
1090
|
})();
|
|
949
1091
|
}
|
|
950
|
-
function
|
|
951
|
-
const
|
|
1092
|
+
function sn(e) {
|
|
1093
|
+
const t = _e(), r = Ne(We), [v, o] = re(), i = c(() => e.item), x = () => e.textEditorRegistry?.get(i().id), z = () => x()?.isFocused() ?? !1, D = c(() => e.viewportScale), B = c(() => e.viewport ?? {
|
|
952
1094
|
x: 0,
|
|
953
1095
|
y: 0,
|
|
954
1096
|
scale: 1
|
|
955
|
-
}),
|
|
956
|
-
viewportScale:
|
|
1097
|
+
}), F = c(() => e.projection), p = c(() => e.preview), Y = c(() => e.onPreviewGeometry), E = c(() => e.onCommitResize), I = c(() => e.onUpdate), C = c(() => e.onDelete), G = Ye({
|
|
1098
|
+
viewportScale: D,
|
|
957
1099
|
readSize: () => ({
|
|
958
|
-
width:
|
|
959
|
-
height:
|
|
1100
|
+
width: i().width,
|
|
1101
|
+
height: i().height
|
|
960
1102
|
}),
|
|
961
|
-
minWidth:
|
|
962
|
-
minHeight:
|
|
963
|
-
onCommitResize: (
|
|
964
|
-
onPreviewResize: (
|
|
1103
|
+
minWidth: Jt,
|
|
1104
|
+
minHeight: Qt,
|
|
1105
|
+
onCommitResize: (d) => E()(i().id, d),
|
|
1106
|
+
onPreviewResize: (d) => Y()?.({
|
|
965
1107
|
kind: "background_layer",
|
|
966
|
-
id:
|
|
967
|
-
x:
|
|
968
|
-
y:
|
|
969
|
-
width:
|
|
970
|
-
height:
|
|
1108
|
+
id: i().id,
|
|
1109
|
+
x: i().x,
|
|
1110
|
+
y: i().y,
|
|
1111
|
+
width: d.width,
|
|
1112
|
+
height: d.height
|
|
971
1113
|
}),
|
|
972
|
-
onPreviewEnd: () =>
|
|
973
|
-
}),
|
|
974
|
-
const
|
|
975
|
-
return
|
|
976
|
-
geometry:
|
|
977
|
-
preview:
|
|
1114
|
+
onPreviewEnd: () => Y()?.(null)
|
|
1115
|
+
}), q = O(() => {
|
|
1116
|
+
const d = i(), T = Se(p(), "background_layer", d.id);
|
|
1117
|
+
return ze({
|
|
1118
|
+
geometry: Ee({
|
|
1119
|
+
preview: T,
|
|
978
1120
|
position: {
|
|
979
|
-
x:
|
|
980
|
-
y:
|
|
1121
|
+
x: d.x,
|
|
1122
|
+
y: d.y
|
|
981
1123
|
},
|
|
982
|
-
width:
|
|
983
|
-
height:
|
|
1124
|
+
width: G.size().width,
|
|
1125
|
+
height: G.size().height
|
|
984
1126
|
}),
|
|
985
|
-
viewport:
|
|
986
|
-
projection:
|
|
1127
|
+
viewport: B(),
|
|
1128
|
+
projection: F()
|
|
987
1129
|
});
|
|
988
|
-
}),
|
|
989
|
-
...pe(
|
|
990
|
-
"z-index": `${
|
|
991
|
-
"--workbench-layer-control-inverse-scale": `${1 / Math.max(
|
|
992
|
-
...
|
|
1130
|
+
}), w = O(() => ({
|
|
1131
|
+
...pe(q()),
|
|
1132
|
+
"z-index": `${i().z_index}`,
|
|
1133
|
+
"--workbench-layer-control-inverse-scale": `${1 / Math.max(q().scale, 1e-3)}`,
|
|
1134
|
+
...Ce(i())
|
|
993
1135
|
}));
|
|
994
1136
|
return (() => {
|
|
995
|
-
var
|
|
996
|
-
return
|
|
1137
|
+
var d = At(), T = d.firstChild, h = T.nextSibling;
|
|
1138
|
+
return se(o, d), k(d, g(Ae, {
|
|
1139
|
+
reservedSpace: {
|
|
1140
|
+
top: 64,
|
|
1141
|
+
narrowTop: 106,
|
|
1142
|
+
bottom: 86
|
|
1143
|
+
},
|
|
997
1144
|
get anchor() {
|
|
998
|
-
return
|
|
1145
|
+
return v();
|
|
999
1146
|
},
|
|
1000
1147
|
get revision() {
|
|
1001
|
-
return
|
|
1148
|
+
return w();
|
|
1149
|
+
},
|
|
1150
|
+
get topOffset() {
|
|
1151
|
+
return be(() => !!(i().name.trim() || z()))() ? 34 * B().scale : 0;
|
|
1002
1152
|
},
|
|
1003
1153
|
class: "workbench-object-tools",
|
|
1004
1154
|
get children() {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1155
|
+
return g(Fe, {
|
|
1156
|
+
kind: "region",
|
|
1157
|
+
onInsertEmoji: (l) => x()?.insertTextAtSelection(l),
|
|
1158
|
+
materials: yt,
|
|
1159
|
+
get material() {
|
|
1160
|
+
return i().material;
|
|
1161
|
+
},
|
|
1162
|
+
materialLabel: (l) => t("useRegionMaterial", t(l)),
|
|
1163
|
+
preview: (l) => (() => {
|
|
1164
|
+
var u = Nt(), n = u.firstChild;
|
|
1165
|
+
return De(n, `workbench-region-material__sample is-material-${l}`), P((L) => he(n, Ce(i()), L)), u;
|
|
1166
|
+
})(),
|
|
1167
|
+
onMaterial: (l) => I()(i().id, {
|
|
1168
|
+
material: l
|
|
1169
|
+
}),
|
|
1170
|
+
get palette() {
|
|
1171
|
+
return (() => {
|
|
1172
|
+
var l = lt();
|
|
1173
|
+
return k(l, g(de, {
|
|
1174
|
+
each: ct,
|
|
1175
|
+
children: (u) => (() => {
|
|
1176
|
+
var n = Gt(), L = n.firstChild, X = L.firstChild;
|
|
1177
|
+
return n.$$click = () => I()(i().id, {
|
|
1178
|
+
fill: u.fill
|
|
1179
|
+
}), n.$$pointerdown = Q, k(n, g(ot, {}), null), P((j) => {
|
|
1180
|
+
var S = t("regionColor", t(u.color)), te = i().fill === u.fill, ne = `workbench-region-material__sample is-material-${i().material}`, ae = Ce({
|
|
1181
|
+
...i(),
|
|
1182
|
+
fill: u.fill
|
|
1183
|
+
});
|
|
1184
|
+
return S !== j.e && s(n, "aria-label", j.e = S), te !== j.t && s(n, "aria-pressed", j.t = te), ne !== j.a && De(X, j.a = ne), j.o = he(X, ae, j.o), j;
|
|
1185
|
+
}, {
|
|
1186
|
+
e: void 0,
|
|
1187
|
+
t: void 0,
|
|
1188
|
+
a: void 0,
|
|
1189
|
+
o: void 0
|
|
1190
|
+
}), n;
|
|
1191
|
+
})()
|
|
1192
|
+
})), l;
|
|
1193
|
+
})();
|
|
1194
|
+
},
|
|
1195
|
+
more: (l) => [(() => {
|
|
1196
|
+
var u = Ht(), n = u.firstChild;
|
|
1197
|
+
return k(u, () => t("opacity"), n), n.$$input = (L) => I()(i().id, {
|
|
1198
|
+
opacity: Number(L.currentTarget.value) / 100
|
|
1199
|
+
}), P(() => s(n, "aria-label", t("opacity"))), P(() => n.value = Math.round(i().opacity * 100)), u;
|
|
1200
|
+
})(), (() => {
|
|
1201
|
+
var u = ge();
|
|
1202
|
+
return u.$$click = () => {
|
|
1203
|
+
l(), I()(i().id, {
|
|
1204
|
+
name: ""
|
|
1205
|
+
});
|
|
1206
|
+
}, u.$$pointerdown = Q, k(u, () => t("clearName")), P(() => u.disabled = !i().name.trim()), u;
|
|
1207
|
+
})()],
|
|
1208
|
+
get actions() {
|
|
1209
|
+
return [g(oe, {
|
|
1210
|
+
when: r,
|
|
1211
|
+
get children() {
|
|
1212
|
+
var l = ge();
|
|
1213
|
+
return l.$$click = () => r?.duplicate({
|
|
1214
|
+
kind: "background_layer",
|
|
1215
|
+
id: i().id
|
|
1216
|
+
}), l.$$pointerdown = Q, k(l, g(ue, {
|
|
1217
|
+
name: "copy"
|
|
1218
|
+
})), P((u) => {
|
|
1219
|
+
var n = t("duplicate"), L = t("duplicate");
|
|
1220
|
+
return n !== u.e && s(l, "aria-label", u.e = n), L !== u.t && s(l, "title", u.t = L), u;
|
|
1221
|
+
}, {
|
|
1222
|
+
e: void 0,
|
|
1223
|
+
t: void 0
|
|
1224
|
+
}), l;
|
|
1225
|
+
}
|
|
1226
|
+
}), (() => {
|
|
1227
|
+
var l = He();
|
|
1228
|
+
return l.$$click = () => C()(i().id), l.$$pointerdown = Q, k(l, g(ue, {
|
|
1229
|
+
name: "trash"
|
|
1230
|
+
})), P(() => s(l, "aria-label", t("deleteRegion"))), l;
|
|
1231
|
+
})()];
|
|
1009
1232
|
},
|
|
1010
1233
|
get children() {
|
|
1011
|
-
var
|
|
1012
|
-
return
|
|
1013
|
-
name: ""
|
|
1014
|
-
}),
|
|
1234
|
+
var l = Wt(), u = l.firstChild;
|
|
1235
|
+
return l.$$click = () => x()?.focus(), l.$$pointerdown = Q, k(l, g(ue, {
|
|
1236
|
+
name: "text"
|
|
1237
|
+
}), u), k(u, () => t(i().name.trim() ? "regionName" : "addName")), l;
|
|
1015
1238
|
}
|
|
1016
|
-
})
|
|
1017
|
-
each: gt,
|
|
1018
|
-
children: (h) => (() => {
|
|
1019
|
-
var f = Nt();
|
|
1020
|
-
return f.$$click = (w) => {
|
|
1021
|
-
Q(w), p()(t().id, {
|
|
1022
|
-
fill: h
|
|
1023
|
-
});
|
|
1024
|
-
}, f.$$pointerdown = K, F((w) => {
|
|
1025
|
-
var k = n("regionColor", h), D = `workbench-layer-swatch workbench-layer-swatch--region is-material-${t().material}`, q = t().fill === h, ee = t().fill === h, x = Me({
|
|
1026
|
-
...t(),
|
|
1027
|
-
fill: h
|
|
1028
|
-
});
|
|
1029
|
-
return k !== w.e && c(f, "aria-label", w.e = k), D !== w.t && tt(f, w.t = D), q !== w.a && f.classList.toggle("is-active", w.a = q), ee !== w.o && c(f, "aria-pressed", w.o = ee), w.i = ye(f, x, w.i), w;
|
|
1030
|
-
}, {
|
|
1031
|
-
e: void 0,
|
|
1032
|
-
t: void 0,
|
|
1033
|
-
a: void 0,
|
|
1034
|
-
o: void 0,
|
|
1035
|
-
i: void 0
|
|
1036
|
-
}), f;
|
|
1037
|
-
})()
|
|
1038
|
-
}), d), d.$$click = ke, d.$$pointerdown = fe, C(d, b(me, {
|
|
1039
|
-
each: bt,
|
|
1040
|
-
children: (h) => (() => {
|
|
1041
|
-
var f = Ft(), w = f.firstChild, k = w.nextSibling;
|
|
1042
|
-
return f.$$click = (D) => {
|
|
1043
|
-
Q(D), p()(t().id, {
|
|
1044
|
-
material: h
|
|
1045
|
-
});
|
|
1046
|
-
}, f.$$pointerdown = K, tt(w, `workbench-region-material__sample is-material-${h}`), C(k, () => n(h)), F((D) => {
|
|
1047
|
-
var q = n("useRegionMaterial", n(h)), ee = n(h), x = t().material === h, V = {
|
|
1048
|
-
"is-active": t().material === h,
|
|
1049
|
-
[`is-${h}`]: !0
|
|
1050
|
-
}, te = Me(t());
|
|
1051
|
-
return q !== D.e && c(f, "aria-label", D.e = q), ee !== D.t && c(f, "title", D.t = ee), x !== D.a && c(f, "aria-pressed", D.a = x), D.o = He(f, V, D.o), D.i = ye(w, te, D.i), D;
|
|
1052
|
-
}, {
|
|
1053
|
-
e: void 0,
|
|
1054
|
-
t: void 0,
|
|
1055
|
-
a: void 0,
|
|
1056
|
-
o: void 0,
|
|
1057
|
-
i: void 0
|
|
1058
|
-
}), f;
|
|
1059
|
-
})()
|
|
1060
|
-
})), a.$$click = (h) => {
|
|
1061
|
-
Q(h), p()(t().id, {
|
|
1062
|
-
opacity: t().opacity >= 0.88 ? 0.42 : t().opacity + 0.18
|
|
1063
|
-
});
|
|
1064
|
-
}, a.$$pointerdown = K, C(a, () => Math.round(t().opacity * 100), M), s.$$click = (h) => {
|
|
1065
|
-
Q(h), J()(t().id);
|
|
1066
|
-
}, s.$$pointerdown = K, C(s, b(Be, {
|
|
1067
|
-
class: "w-3.5 h-3.5"
|
|
1068
|
-
})), F((h) => {
|
|
1069
|
-
var f = n("regionMaterial"), w = n("deleteRegion");
|
|
1070
|
-
return f !== h.e && c(d, "aria-label", h.e = f), w !== h.t && c(s, "aria-label", h.t = w), h;
|
|
1071
|
-
}, {
|
|
1072
|
-
e: void 0,
|
|
1073
|
-
t: void 0
|
|
1074
|
-
}), l;
|
|
1239
|
+
});
|
|
1075
1240
|
}
|
|
1076
|
-
}),
|
|
1077
|
-
var
|
|
1078
|
-
return
|
|
1241
|
+
}), h), U(h, "pointerdown", G.beginResize, !0), P((l) => {
|
|
1242
|
+
var u = i().id, n = w(), L = t("resizeRegion");
|
|
1243
|
+
return u !== l.e && s(d, "data-wb-object-id", l.e = u), l.t = he(d, n, l.t), L !== l.a && s(h, "aria-label", l.a = L), l;
|
|
1079
1244
|
}, {
|
|
1080
1245
|
e: void 0,
|
|
1081
1246
|
t: void 0,
|
|
1082
1247
|
a: void 0
|
|
1083
|
-
}),
|
|
1248
|
+
}), d;
|
|
1084
1249
|
})();
|
|
1085
1250
|
}
|
|
1086
|
-
function
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1090
|
-
geometry:
|
|
1091
|
-
preview:
|
|
1251
|
+
function un(e) {
|
|
1252
|
+
const t = c(() => e.item), r = c(() => e.viewport), v = c(() => e.projection), o = c(() => e.preview), i = O(() => {
|
|
1253
|
+
const z = t(), D = Se(o(), "background_layer", z.id);
|
|
1254
|
+
return ze({
|
|
1255
|
+
geometry: Ee({
|
|
1256
|
+
preview: D,
|
|
1092
1257
|
position: {
|
|
1093
|
-
x:
|
|
1094
|
-
y:
|
|
1258
|
+
x: z.x,
|
|
1259
|
+
y: z.y
|
|
1095
1260
|
},
|
|
1096
|
-
width:
|
|
1097
|
-
height:
|
|
1261
|
+
width: z.width,
|
|
1262
|
+
height: z.height
|
|
1098
1263
|
}),
|
|
1099
1264
|
viewport: r(),
|
|
1100
|
-
projection:
|
|
1265
|
+
projection: v()
|
|
1101
1266
|
});
|
|
1102
|
-
}),
|
|
1103
|
-
...pe(
|
|
1104
|
-
"--workbench-
|
|
1105
|
-
...
|
|
1267
|
+
}), x = O(() => ({
|
|
1268
|
+
...pe(i()),
|
|
1269
|
+
"--workbench-layer-control-inverse-scale": `${1 / Math.max(i().scale, 1e-3)}`,
|
|
1270
|
+
...Ce(t())
|
|
1106
1271
|
}));
|
|
1107
1272
|
return (() => {
|
|
1108
|
-
var
|
|
1109
|
-
return
|
|
1110
|
-
var
|
|
1111
|
-
return
|
|
1273
|
+
var z = Bt();
|
|
1274
|
+
return P((D) => {
|
|
1275
|
+
var B = `workbench-region-visibility-outline is-material-${t().material}`, F = !!e.selected, p = t().id, Y = x();
|
|
1276
|
+
return B !== D.e && De(z, D.e = B), F !== D.t && z.classList.toggle("is-selected-region", D.t = F), p !== D.a && s(z, "data-wb-object-id", D.a = p), D.o = he(z, Y, D.o), D;
|
|
1112
1277
|
}, {
|
|
1113
1278
|
e: void 0,
|
|
1114
1279
|
t: void 0,
|
|
1115
|
-
a: void 0
|
|
1116
|
-
|
|
1280
|
+
a: void 0,
|
|
1281
|
+
o: void 0
|
|
1282
|
+
}), z;
|
|
1117
1283
|
})();
|
|
1118
1284
|
}
|
|
1119
|
-
function
|
|
1120
|
-
const
|
|
1285
|
+
function vn(e) {
|
|
1286
|
+
const t = O(() => Xe(e.items)), r = O(() => Be(e.items).map((v) => v.id));
|
|
1121
1287
|
return (() => {
|
|
1122
|
-
var
|
|
1123
|
-
return
|
|
1288
|
+
var v = Xt();
|
|
1289
|
+
return k(v, g(de, {
|
|
1124
1290
|
get each() {
|
|
1125
1291
|
return r();
|
|
1126
1292
|
},
|
|
1127
|
-
children: (
|
|
1128
|
-
const
|
|
1129
|
-
return
|
|
1293
|
+
children: (o) => {
|
|
1294
|
+
const i = O(() => t().get(o) ?? null);
|
|
1295
|
+
return g(oe, {
|
|
1130
1296
|
get when() {
|
|
1131
|
-
return
|
|
1297
|
+
return i();
|
|
1132
1298
|
},
|
|
1133
|
-
children: (
|
|
1299
|
+
children: (x) => g(un, {
|
|
1134
1300
|
get item() {
|
|
1135
|
-
return
|
|
1301
|
+
return x();
|
|
1136
1302
|
},
|
|
1137
1303
|
get selected() {
|
|
1138
|
-
return
|
|
1304
|
+
return be(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === o;
|
|
1139
1305
|
},
|
|
1140
1306
|
get viewport() {
|
|
1141
1307
|
return e.viewport;
|
|
@@ -1149,29 +1315,29 @@ function sn(e) {
|
|
|
1149
1315
|
})
|
|
1150
1316
|
});
|
|
1151
1317
|
}
|
|
1152
|
-
})),
|
|
1318
|
+
})), v;
|
|
1153
1319
|
})();
|
|
1154
1320
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const
|
|
1321
|
+
function pn(e) {
|
|
1322
|
+
const t = O(() => Xe(e.items)), r = O(() => Be(e.items).map((v) => v.id));
|
|
1157
1323
|
return (() => {
|
|
1158
|
-
var
|
|
1159
|
-
return
|
|
1324
|
+
var v = Yt();
|
|
1325
|
+
return k(v, g(de, {
|
|
1160
1326
|
get each() {
|
|
1161
1327
|
return r();
|
|
1162
1328
|
},
|
|
1163
|
-
children: (
|
|
1164
|
-
const
|
|
1165
|
-
return
|
|
1329
|
+
children: (o) => {
|
|
1330
|
+
const i = O(() => t().get(o) ?? null);
|
|
1331
|
+
return g(oe, {
|
|
1166
1332
|
get when() {
|
|
1167
|
-
return
|
|
1333
|
+
return i();
|
|
1168
1334
|
},
|
|
1169
|
-
children: (
|
|
1335
|
+
children: (x) => g(ln, {
|
|
1170
1336
|
get item() {
|
|
1171
|
-
return
|
|
1337
|
+
return x();
|
|
1172
1338
|
},
|
|
1173
1339
|
get selected() {
|
|
1174
|
-
return
|
|
1340
|
+
return be(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === o;
|
|
1175
1341
|
},
|
|
1176
1342
|
get editable() {
|
|
1177
1343
|
return e.editable;
|
|
@@ -1209,35 +1375,35 @@ function Cn(e) {
|
|
|
1209
1375
|
})
|
|
1210
1376
|
});
|
|
1211
1377
|
}
|
|
1212
|
-
})),
|
|
1213
|
-
var
|
|
1214
|
-
return
|
|
1378
|
+
})), P((o) => {
|
|
1379
|
+
var i = !!e.editable, x = !!e.filtered;
|
|
1380
|
+
return i !== o.e && v.classList.toggle("is-editable", o.e = i), x !== o.t && v.classList.toggle("is-filtered-out", o.t = x), o;
|
|
1215
1381
|
}, {
|
|
1216
1382
|
e: void 0,
|
|
1217
1383
|
t: void 0
|
|
1218
|
-
}),
|
|
1384
|
+
}), v;
|
|
1219
1385
|
})();
|
|
1220
1386
|
}
|
|
1221
|
-
function
|
|
1222
|
-
const
|
|
1387
|
+
function En(e) {
|
|
1388
|
+
const t = O(() => Xe(e.items)), r = O(() => Be(e.items).map((v) => v.id));
|
|
1223
1389
|
return (() => {
|
|
1224
|
-
var
|
|
1225
|
-
return
|
|
1390
|
+
var v = Ut();
|
|
1391
|
+
return k(v, g(de, {
|
|
1226
1392
|
get each() {
|
|
1227
1393
|
return r();
|
|
1228
1394
|
},
|
|
1229
|
-
children: (
|
|
1230
|
-
const
|
|
1231
|
-
return
|
|
1395
|
+
children: (o) => {
|
|
1396
|
+
const i = O(() => t().get(o) ?? null);
|
|
1397
|
+
return g(oe, {
|
|
1232
1398
|
get when() {
|
|
1233
|
-
return
|
|
1399
|
+
return i();
|
|
1234
1400
|
},
|
|
1235
|
-
children: (
|
|
1401
|
+
children: (x) => g(cn, {
|
|
1236
1402
|
get item() {
|
|
1237
|
-
return
|
|
1403
|
+
return x();
|
|
1238
1404
|
},
|
|
1239
1405
|
get selected() {
|
|
1240
|
-
return
|
|
1406
|
+
return be(() => e.selectedObject?.kind === "annotation")() && e.selectedObject.id === o;
|
|
1241
1407
|
},
|
|
1242
1408
|
get editable() {
|
|
1243
1409
|
return e.editable;
|
|
@@ -1275,25 +1441,25 @@ function Sn(e) {
|
|
|
1275
1441
|
})
|
|
1276
1442
|
});
|
|
1277
1443
|
}
|
|
1278
|
-
})),
|
|
1279
|
-
var
|
|
1280
|
-
return
|
|
1444
|
+
})), P((o) => {
|
|
1445
|
+
var i = !!e.editable, x = !!e.filtered;
|
|
1446
|
+
return i !== o.e && v.classList.toggle("is-editable", o.e = i), x !== o.t && v.classList.toggle("is-filtered-out", o.t = x), o;
|
|
1281
1447
|
}, {
|
|
1282
1448
|
e: void 0,
|
|
1283
1449
|
t: void 0
|
|
1284
|
-
}),
|
|
1450
|
+
}), v;
|
|
1285
1451
|
})();
|
|
1286
1452
|
}
|
|
1287
|
-
function
|
|
1288
|
-
const
|
|
1453
|
+
function Rn(e) {
|
|
1454
|
+
const t = O(() => e.selectedObject?.kind === "annotation" ? e.annotations.find((v) => v.id === e.selectedObject?.id && v.kind === "text") ?? null : null), r = O(() => e.selectedObject?.kind === "background_layer" ? e.backgroundLayers.find((v) => v.id === e.selectedObject?.id) ?? null : null);
|
|
1289
1455
|
return (() => {
|
|
1290
|
-
var
|
|
1291
|
-
return
|
|
1456
|
+
var v = Kt();
|
|
1457
|
+
return k(v, g(oe, {
|
|
1292
1458
|
get when() {
|
|
1293
1459
|
return e.showRegionOutlines;
|
|
1294
1460
|
},
|
|
1295
1461
|
get children() {
|
|
1296
|
-
return
|
|
1462
|
+
return g(vn, {
|
|
1297
1463
|
get items() {
|
|
1298
1464
|
return e.backgroundLayers;
|
|
1299
1465
|
},
|
|
@@ -1311,16 +1477,16 @@ function _n(e) {
|
|
|
1311
1477
|
}
|
|
1312
1478
|
});
|
|
1313
1479
|
}
|
|
1314
|
-
}), null),
|
|
1480
|
+
}), null), k(v, g(oe, {
|
|
1315
1481
|
get when() {
|
|
1316
|
-
return
|
|
1482
|
+
return be(() => !!e.editable)() && r();
|
|
1317
1483
|
},
|
|
1318
|
-
children: (
|
|
1484
|
+
children: (o) => g(sn, {
|
|
1319
1485
|
get textEditorRegistry() {
|
|
1320
1486
|
return e.textEditorRegistry;
|
|
1321
1487
|
},
|
|
1322
1488
|
get item() {
|
|
1323
|
-
return
|
|
1489
|
+
return o();
|
|
1324
1490
|
},
|
|
1325
1491
|
get viewportScale() {
|
|
1326
1492
|
return e.viewport.scale;
|
|
@@ -1347,13 +1513,13 @@ function _n(e) {
|
|
|
1347
1513
|
return e.onDeleteBackgroundLayer;
|
|
1348
1514
|
}
|
|
1349
1515
|
})
|
|
1350
|
-
}), null),
|
|
1516
|
+
}), null), k(v, g(oe, {
|
|
1351
1517
|
get when() {
|
|
1352
|
-
return
|
|
1518
|
+
return be(() => !!e.editable)() && t();
|
|
1353
1519
|
},
|
|
1354
|
-
children: (
|
|
1520
|
+
children: (o) => g(dn, {
|
|
1355
1521
|
get item() {
|
|
1356
|
-
return
|
|
1522
|
+
return o();
|
|
1357
1523
|
},
|
|
1358
1524
|
get viewportScale() {
|
|
1359
1525
|
return e.viewport.scale;
|
|
@@ -1386,16 +1552,16 @@ function _n(e) {
|
|
|
1386
1552
|
return e.onDeleteAnnotation;
|
|
1387
1553
|
}
|
|
1388
1554
|
})
|
|
1389
|
-
}), null),
|
|
1555
|
+
}), null), P(() => v.classList.toggle("is-editable", !!e.editable)), v;
|
|
1390
1556
|
})();
|
|
1391
1557
|
}
|
|
1392
|
-
|
|
1558
|
+
ut(["pointerdown", "contextmenu", "keydown", "click", "input"]);
|
|
1393
1559
|
export {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1560
|
+
En as WorkbenchAnnotationLayerView,
|
|
1561
|
+
pn as WorkbenchBackgroundLayerView,
|
|
1562
|
+
ln as WorkbenchBackgroundRegion,
|
|
1563
|
+
Rn as WorkbenchLayerControlOverlayView,
|
|
1564
|
+
zn as WorkbenchStickyNote,
|
|
1565
|
+
cn as WorkbenchTextAnnotation,
|
|
1566
|
+
Sn as createWorkbenchTextEditorRegistry
|
|
1401
1567
|
};
|