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