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