@floegence/floe-webapp-core 0.36.44 → 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 +820 -612
- 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 +136 -15
- 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,393 +21,451 @@ const st = 190, ut = 132, mt = 180, ht = 120, bt = 96, wt = 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) {
|
|
109
110
|
return Math.max(0.08, Math.min(1, e));
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
return `${Math.round(
|
|
112
|
+
function Xe(e) {
|
|
113
|
+
return `${Math.round(qe(e) * 1e3) / 10}%`;
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
const
|
|
115
|
+
function Oe(e) {
|
|
116
|
+
const t = qe(e.opacity), c = `color-mix(in srgb, ${e.fill} ${Math.round(t * 100)}%, transparent)`;
|
|
116
117
|
return {
|
|
117
118
|
"--workbench-region-fill": e.fill,
|
|
118
|
-
"--workbench-region-surface":
|
|
119
|
-
"--workbench-region-ink": `color-mix(in srgb, color-mix(in srgb, ${e.fill} 48%, var(--foreground, #111) 52%) ${
|
|
120
|
-
"--workbench-region-highlight": `color-mix(in srgb, white ${
|
|
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)`
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function he(e) {
|
|
124
125
|
e.stopPropagation();
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function we(e) {
|
|
127
128
|
e.stopPropagation();
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
+
function X(e) {
|
|
130
131
|
e.preventDefault(), e.stopPropagation();
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function A(e) {
|
|
133
134
|
e.stopPropagation();
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
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
|
+
};
|
|
137
170
|
}
|
|
138
|
-
function
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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({
|
|
143
179
|
reason: "manual_stop",
|
|
144
180
|
commit: !1
|
|
145
|
-
}),
|
|
181
|
+
}), L = void 0, ze(k)?.stopInteraction();
|
|
146
182
|
}), {
|
|
147
|
-
position:
|
|
148
|
-
const
|
|
149
|
-
return
|
|
150
|
-
x:
|
|
151
|
-
y:
|
|
152
|
-
} :
|
|
183
|
+
position: _(() => {
|
|
184
|
+
const $ = k();
|
|
185
|
+
return $ ? {
|
|
186
|
+
x: $.worldX,
|
|
187
|
+
y: $.worldY
|
|
188
|
+
} : t();
|
|
153
189
|
}),
|
|
154
|
-
isDragging: () =>
|
|
155
|
-
beginDrag: (
|
|
156
|
-
if (
|
|
157
|
-
|
|
190
|
+
isDragging: () => k() !== null,
|
|
191
|
+
beginDrag: ($) => {
|
|
192
|
+
if ($.button !== 0) return;
|
|
193
|
+
$.preventDefault(), $.stopPropagation(), L?.stop({
|
|
158
194
|
reason: "manual_stop",
|
|
159
195
|
commit: !1
|
|
160
196
|
});
|
|
161
|
-
const
|
|
197
|
+
const d = t(), a = Math.max(i(), 1e-3), R = Ue({
|
|
162
198
|
kind: "drag",
|
|
163
199
|
cursor: "grabbing"
|
|
164
200
|
});
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
pointerId:
|
|
172
|
-
startClientX:
|
|
173
|
-
startClientY:
|
|
174
|
-
startWorldX:
|
|
175
|
-
startWorldY:
|
|
176
|
-
worldX:
|
|
177
|
-
worldY:
|
|
178
|
-
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,
|
|
179
215
|
moved: !1,
|
|
180
|
-
stopInteraction:
|
|
181
|
-
}),
|
|
182
|
-
pointerEvent:
|
|
183
|
-
captureEl:
|
|
184
|
-
onMove: (
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
+
});
|
|
195
242
|
},
|
|
196
243
|
onEnd: ({
|
|
197
|
-
commit:
|
|
244
|
+
commit: F
|
|
198
245
|
}) => {
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
+
});
|
|
208
257
|
}
|
|
209
258
|
});
|
|
210
259
|
}
|
|
211
260
|
};
|
|
212
261
|
}
|
|
213
|
-
function
|
|
214
|
-
const
|
|
215
|
-
let
|
|
216
|
-
return
|
|
217
|
-
|
|
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({
|
|
218
267
|
reason: "manual_stop",
|
|
219
268
|
commit: !1
|
|
220
|
-
}),
|
|
269
|
+
}), k = void 0, ze(b)?.stopInteraction();
|
|
221
270
|
}), {
|
|
222
|
-
size:
|
|
223
|
-
const
|
|
224
|
-
return
|
|
225
|
-
width:
|
|
226
|
-
height:
|
|
227
|
-
} :
|
|
271
|
+
size: _(() => {
|
|
272
|
+
const w = b();
|
|
273
|
+
return w ? {
|
|
274
|
+
width: w.width,
|
|
275
|
+
height: w.height
|
|
276
|
+
} : t();
|
|
228
277
|
}),
|
|
229
|
-
isResizing: () =>
|
|
230
|
-
beginResize: (
|
|
231
|
-
if (
|
|
232
|
-
|
|
278
|
+
isResizing: () => b() !== null,
|
|
279
|
+
beginResize: (w) => {
|
|
280
|
+
if (w.button !== 0) return;
|
|
281
|
+
w.preventDefault(), w.stopPropagation(), k?.stop({
|
|
233
282
|
reason: "manual_stop",
|
|
234
283
|
commit: !1
|
|
235
284
|
});
|
|
236
|
-
const
|
|
285
|
+
const S = t(), $ = Math.max(c(), 1e-3), d = Ue({
|
|
237
286
|
kind: "resize",
|
|
238
287
|
cursor: "nwse-resize"
|
|
239
288
|
});
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
pointerId:
|
|
247
|
-
startClientX:
|
|
248
|
-
startClientY:
|
|
249
|
-
startWidth:
|
|
250
|
-
startHeight:
|
|
251
|
-
width:
|
|
252
|
-
height:
|
|
253
|
-
scale:
|
|
254
|
-
stopInteraction:
|
|
255
|
-
}),
|
|
256
|
-
pointerEvent:
|
|
257
|
-
captureEl:
|
|
258
|
-
onMove: (
|
|
259
|
-
let
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
+
});
|
|
268
319
|
},
|
|
269
320
|
onEnd: ({
|
|
270
|
-
commit:
|
|
321
|
+
commit: h
|
|
271
322
|
}) => {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
+
});
|
|
277
330
|
}
|
|
278
331
|
});
|
|
279
332
|
}
|
|
280
333
|
};
|
|
281
334
|
}
|
|
282
|
-
function
|
|
283
|
-
const i =
|
|
284
|
-
value: () =>
|
|
285
|
-
onCommit: (
|
|
286
|
-
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
|
|
287
340
|
})
|
|
288
|
-
}), [
|
|
289
|
-
let
|
|
290
|
-
const
|
|
291
|
-
typeof window > "u" ||
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
|
|
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);
|
|
295
348
|
}, 720));
|
|
296
349
|
};
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
typeof navigator > "u" || !navigator.clipboard?.writeText || (await navigator.clipboard.writeText(
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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,
|
|
304
359
|
readPosition: () => ({
|
|
305
|
-
x:
|
|
306
|
-
y:
|
|
360
|
+
x: t().x,
|
|
361
|
+
y: t().y
|
|
307
362
|
}),
|
|
308
|
-
onCommitMove: (
|
|
309
|
-
onCommitStart: () =>
|
|
310
|
-
onInteractionStart: () =>
|
|
311
|
-
onInteractionEnd: () =>
|
|
312
|
-
}),
|
|
313
|
-
viewportScale:
|
|
363
|
+
onCommitMove: (E) => $()(t().id, E),
|
|
364
|
+
onCommitStart: () => S()?.(t().id),
|
|
365
|
+
onInteractionStart: () => T()?.(),
|
|
366
|
+
onInteractionEnd: () => s()?.()
|
|
367
|
+
}), N = De({
|
|
368
|
+
viewportScale: i,
|
|
314
369
|
readSize: () => ({
|
|
315
|
-
width:
|
|
316
|
-
height:
|
|
370
|
+
width: t().width,
|
|
371
|
+
height: t().height
|
|
317
372
|
}),
|
|
318
|
-
minWidth:
|
|
319
|
-
minHeight:
|
|
320
|
-
onCommitResize: (
|
|
321
|
-
onInteractionStart: () =>
|
|
322
|
-
onInteractionEnd: () =>
|
|
323
|
-
}),
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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()
|
|
333
389
|
});
|
|
334
|
-
}),
|
|
335
|
-
width: `${
|
|
336
|
-
height: `${
|
|
337
|
-
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)`,
|
|
338
394
|
"transform-origin": "0 0",
|
|
339
|
-
"z-index": `${
|
|
395
|
+
"z-index": `${c() || k() || m.isDragging() || N.isResizing() ? C() + 1 : g()}`
|
|
340
396
|
}));
|
|
341
397
|
return (() => {
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
|
|
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, {
|
|
348
405
|
class: "w-3.5 h-3.5"
|
|
349
|
-
})),
|
|
350
|
-
|
|
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);
|
|
351
408
|
};
|
|
352
|
-
var
|
|
353
|
-
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, {
|
|
354
411
|
get when() {
|
|
355
|
-
return
|
|
412
|
+
return ve(() => !!c())() && !b();
|
|
356
413
|
},
|
|
357
414
|
get children() {
|
|
358
|
-
var
|
|
359
|
-
return
|
|
360
|
-
|
|
361
|
-
},
|
|
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, {
|
|
362
419
|
get when() {
|
|
363
|
-
return
|
|
420
|
+
return h();
|
|
364
421
|
},
|
|
365
422
|
get fallback() {
|
|
366
|
-
return
|
|
423
|
+
return y(et, {
|
|
367
424
|
class: "w-3.5 h-3.5"
|
|
368
425
|
});
|
|
369
426
|
},
|
|
370
427
|
get children() {
|
|
371
|
-
return
|
|
428
|
+
return y(Ze, {
|
|
372
429
|
class: "w-3.5 h-3.5"
|
|
373
430
|
});
|
|
374
431
|
}
|
|
375
|
-
})),
|
|
376
|
-
|
|
377
|
-
|
|
432
|
+
})), ne.$$click = (H) => {
|
|
433
|
+
A(H);
|
|
434
|
+
const ie = t();
|
|
435
|
+
a()(ie.id, {
|
|
436
|
+
color: Ke(ot, ie.color)
|
|
378
437
|
});
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
},
|
|
438
|
+
}, ne.$$pointerdown = X, ae.$$click = (H) => {
|
|
439
|
+
A(H), R()(t().id);
|
|
440
|
+
}, ae.$$pointerdown = X, z(ae, y(Te, {
|
|
382
441
|
class: "w-3.5 h-3.5"
|
|
383
|
-
})),
|
|
384
|
-
var
|
|
385
|
-
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;
|
|
386
445
|
}, {
|
|
387
446
|
e: void 0,
|
|
388
447
|
t: void 0
|
|
389
|
-
}),
|
|
448
|
+
}), f;
|
|
390
449
|
}
|
|
391
|
-
}), null),
|
|
450
|
+
}), null), z(E, y(te, {
|
|
392
451
|
get when() {
|
|
393
|
-
return !
|
|
452
|
+
return !b();
|
|
394
453
|
},
|
|
395
454
|
get children() {
|
|
396
|
-
var
|
|
397
|
-
return
|
|
455
|
+
var f = ut();
|
|
456
|
+
return J(f, "pointerdown", N.beginResize, !0), f;
|
|
398
457
|
}
|
|
399
|
-
}), null),
|
|
400
|
-
var
|
|
401
|
-
"is-selected":
|
|
402
|
-
"is-locked":
|
|
403
|
-
"is-filtered-out":
|
|
404
|
-
"is-dragging":
|
|
405
|
-
"is-resizing":
|
|
406
|
-
"is-copied":
|
|
407
|
-
[
|
|
408
|
-
},
|
|
409
|
-
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;
|
|
410
469
|
}, {
|
|
411
470
|
e: void 0,
|
|
412
471
|
t: void 0,
|
|
@@ -415,76 +474,85 @@ function Rt(e) {
|
|
|
415
474
|
i: void 0,
|
|
416
475
|
n: void 0,
|
|
417
476
|
s: void 0
|
|
418
|
-
}),
|
|
477
|
+
}), E;
|
|
419
478
|
})();
|
|
420
479
|
}
|
|
421
|
-
function
|
|
422
|
-
const i =
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
|
426
489
|
})
|
|
427
490
|
});
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
if (!
|
|
431
|
-
const
|
|
432
|
-
focus:
|
|
433
|
-
insertTextAtSelection:
|
|
434
|
-
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
|
|
435
498
|
});
|
|
436
|
-
|
|
499
|
+
ke(o);
|
|
437
500
|
});
|
|
438
|
-
const
|
|
439
|
-
viewportScale:
|
|
501
|
+
const $ = Re({
|
|
502
|
+
viewportScale: l,
|
|
440
503
|
readPosition: () => ({
|
|
441
|
-
x:
|
|
442
|
-
y:
|
|
504
|
+
x: t().x,
|
|
505
|
+
y: t().y
|
|
506
|
+
}),
|
|
507
|
+
readGeometry: () => ({
|
|
508
|
+
width: t().width,
|
|
509
|
+
height: t().height
|
|
443
510
|
}),
|
|
444
|
-
onCommitMove: (
|
|
445
|
-
onPreviewMove: (
|
|
511
|
+
onCommitMove: (s) => L()(t().id, s),
|
|
512
|
+
onPreviewMove: (s) => I()?.({
|
|
446
513
|
kind: "annotation",
|
|
447
|
-
id:
|
|
448
|
-
|
|
449
|
-
y: t.y,
|
|
450
|
-
width: e.item.width,
|
|
451
|
-
height: e.item.height
|
|
514
|
+
id: t().id,
|
|
515
|
+
...s
|
|
452
516
|
}),
|
|
453
|
-
onPreviewEnd: () =>
|
|
454
|
-
}),
|
|
455
|
-
const t =
|
|
456
|
-
return {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
"
|
|
469
|
-
"--workbench-text-
|
|
470
|
-
"--workbench-text-
|
|
471
|
-
"--workbench-text-
|
|
472
|
-
|
|
473
|
-
|
|
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));
|
|
474
542
|
};
|
|
475
543
|
return (() => {
|
|
476
|
-
var
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
}),
|
|
482
|
-
!
|
|
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);
|
|
483
551
|
};
|
|
484
|
-
var
|
|
485
|
-
return typeof
|
|
486
|
-
var
|
|
487
|
-
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;
|
|
488
556
|
}, {
|
|
489
557
|
e: void 0,
|
|
490
558
|
t: void 0,
|
|
@@ -496,158 +564,173 @@ function yt(e) {
|
|
|
496
564
|
h: void 0,
|
|
497
565
|
r: void 0,
|
|
498
566
|
d: void 0
|
|
499
|
-
}),
|
|
567
|
+
}), s;
|
|
500
568
|
})();
|
|
501
569
|
}
|
|
502
|
-
function
|
|
503
|
-
const i =
|
|
504
|
-
|
|
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,
|
|
505
577
|
readPosition: () => ({
|
|
506
|
-
x:
|
|
507
|
-
y:
|
|
578
|
+
x: t().x,
|
|
579
|
+
y: t().y
|
|
580
|
+
}),
|
|
581
|
+
readGeometry: () => ({
|
|
582
|
+
width: t().width,
|
|
583
|
+
height: t().height
|
|
508
584
|
}),
|
|
509
|
-
onCommitMove: (
|
|
510
|
-
onPreviewMove: (
|
|
585
|
+
onCommitMove: (d) => j()(t().id, d),
|
|
586
|
+
onPreviewMove: (d) => b()?.({
|
|
511
587
|
kind: "background_layer",
|
|
512
|
-
id:
|
|
513
|
-
|
|
514
|
-
y: r.y,
|
|
515
|
-
width: e.item.width,
|
|
516
|
-
height: e.item.height
|
|
588
|
+
id: t().id,
|
|
589
|
+
...d
|
|
517
590
|
}),
|
|
518
|
-
onPreviewEnd: () =>
|
|
519
|
-
}),
|
|
520
|
-
const
|
|
521
|
-
return {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
...
|
|
533
|
-
|
|
534
|
-
|
|
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));
|
|
535
610
|
};
|
|
536
611
|
return (() => {
|
|
537
|
-
var
|
|
538
|
-
return
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
var
|
|
542
|
-
"is-selected":
|
|
543
|
-
"is-editable":
|
|
544
|
-
"is-transforming":
|
|
545
|
-
[`is-material-${
|
|
546
|
-
},
|
|
547
|
-
return
|
|
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;
|
|
548
623
|
}, {
|
|
549
624
|
e: void 0,
|
|
550
625
|
t: void 0,
|
|
551
626
|
a: void 0,
|
|
552
627
|
o: void 0,
|
|
553
628
|
i: void 0
|
|
554
|
-
}),
|
|
629
|
+
}), d;
|
|
555
630
|
})();
|
|
556
631
|
}
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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,
|
|
561
641
|
readPosition: () => ({
|
|
562
|
-
x:
|
|
563
|
-
y:
|
|
642
|
+
x: t().x,
|
|
643
|
+
y: t().y
|
|
644
|
+
}),
|
|
645
|
+
readGeometry: () => ({
|
|
646
|
+
width: t().width,
|
|
647
|
+
height: t().height
|
|
564
648
|
}),
|
|
565
|
-
onCommitMove: (
|
|
566
|
-
onPreviewMove: (
|
|
649
|
+
onCommitMove: (m) => b()(t().id, m),
|
|
650
|
+
onPreviewMove: (m) => C()?.({
|
|
567
651
|
kind: "annotation",
|
|
568
|
-
id:
|
|
569
|
-
|
|
570
|
-
y: u.y,
|
|
571
|
-
width: e.item.width,
|
|
572
|
-
height: e.item.height
|
|
652
|
+
id: t().id,
|
|
653
|
+
...m
|
|
573
654
|
}),
|
|
574
|
-
onPreviewEnd: () =>
|
|
575
|
-
}),
|
|
576
|
-
viewportScale:
|
|
655
|
+
onPreviewEnd: () => C()?.(null)
|
|
656
|
+
}), r = De({
|
|
657
|
+
viewportScale: c,
|
|
577
658
|
readSize: () => ({
|
|
578
|
-
width:
|
|
579
|
-
height:
|
|
659
|
+
width: t().width,
|
|
660
|
+
height: t().height
|
|
580
661
|
}),
|
|
581
|
-
minWidth:
|
|
582
|
-
minHeight:
|
|
583
|
-
onCommitResize: (
|
|
584
|
-
onPreviewResize: (
|
|
662
|
+
minWidth: Tt,
|
|
663
|
+
minHeight: jt,
|
|
664
|
+
onCommitResize: (m) => I()(t().id, m),
|
|
665
|
+
onPreviewResize: (m) => C()?.({
|
|
585
666
|
kind: "annotation",
|
|
586
|
-
id:
|
|
587
|
-
x:
|
|
588
|
-
y:
|
|
589
|
-
width:
|
|
590
|
-
height:
|
|
667
|
+
id: t().id,
|
|
668
|
+
x: t().x,
|
|
669
|
+
y: t().y,
|
|
670
|
+
width: m.width,
|
|
671
|
+
height: m.height
|
|
591
672
|
}),
|
|
592
|
-
onPreviewEnd: () =>
|
|
593
|
-
}),
|
|
594
|
-
const
|
|
595
|
-
return {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
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
|
|
612
695
|
});
|
|
613
|
-
},
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
616
|
-
|
|
696
|
+
}, p = () => {
|
|
697
|
+
const m = $().trim(), N = Number(m);
|
|
698
|
+
if (m.length > 0 && Number.isFinite(N)) {
|
|
699
|
+
G(N);
|
|
617
700
|
return;
|
|
618
701
|
}
|
|
619
|
-
|
|
702
|
+
d(String(t().font_size));
|
|
620
703
|
};
|
|
621
|
-
return
|
|
622
|
-
typeof document < "u" && document.activeElement ===
|
|
623
|
-
}),
|
|
624
|
-
var
|
|
625
|
-
|
|
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, {
|
|
626
709
|
class: "w-3.5 h-3.5"
|
|
627
|
-
})),
|
|
628
|
-
var
|
|
629
|
-
typeof
|
|
630
|
-
|
|
631
|
-
},
|
|
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, {
|
|
632
715
|
class: "workbench-text-font-trigger__icon"
|
|
633
|
-
}), null),
|
|
716
|
+
}), null), z(V, y(te, {
|
|
634
717
|
get when() {
|
|
635
|
-
return
|
|
718
|
+
return a();
|
|
636
719
|
},
|
|
637
720
|
get children() {
|
|
638
|
-
var
|
|
639
|
-
return
|
|
640
|
-
each:
|
|
641
|
-
children: (
|
|
642
|
-
var
|
|
643
|
-
return
|
|
644
|
-
|
|
645
|
-
font_family:
|
|
646
|
-
font_weight:
|
|
647
|
-
}),
|
|
648
|
-
},
|
|
649
|
-
var
|
|
650
|
-
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;
|
|
651
734
|
}, {
|
|
652
735
|
e: void 0,
|
|
653
736
|
t: void 0,
|
|
@@ -655,63 +738,63 @@ function kt(e) {
|
|
|
655
738
|
o: void 0,
|
|
656
739
|
i: void 0,
|
|
657
740
|
n: void 0
|
|
658
|
-
}),
|
|
741
|
+
}), O;
|
|
659
742
|
})()
|
|
660
|
-
})),
|
|
743
|
+
})), u;
|
|
661
744
|
}
|
|
662
|
-
}), null),
|
|
663
|
-
|
|
664
|
-
},
|
|
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, {
|
|
665
748
|
class: "w-3 h-3"
|
|
666
|
-
})),
|
|
667
|
-
|
|
668
|
-
},
|
|
669
|
-
var
|
|
670
|
-
typeof
|
|
671
|
-
|
|
672
|
-
},
|
|
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, {
|
|
673
756
|
class: "w-3 h-3"
|
|
674
|
-
})),
|
|
675
|
-
each:
|
|
676
|
-
children: (
|
|
677
|
-
var
|
|
678
|
-
return
|
|
679
|
-
|
|
680
|
-
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
|
|
681
764
|
});
|
|
682
|
-
},
|
|
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;
|
|
683
766
|
})()
|
|
684
|
-
}),
|
|
685
|
-
var
|
|
686
|
-
return typeof
|
|
687
|
-
|
|
688
|
-
},
|
|
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, {
|
|
689
772
|
get when() {
|
|
690
|
-
return
|
|
773
|
+
return T();
|
|
691
774
|
},
|
|
692
775
|
get children() {
|
|
693
|
-
var
|
|
694
|
-
return
|
|
695
|
-
each:
|
|
696
|
-
children: (
|
|
697
|
-
var
|
|
698
|
-
return
|
|
699
|
-
|
|
700
|
-
},
|
|
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;
|
|
701
784
|
})()
|
|
702
|
-
})),
|
|
785
|
+
})), u;
|
|
703
786
|
}
|
|
704
|
-
}), null),
|
|
705
|
-
|
|
706
|
-
align:
|
|
787
|
+
}), null), B.$$click = (u) => {
|
|
788
|
+
A(u), k()(t().id, {
|
|
789
|
+
align: F()
|
|
707
790
|
});
|
|
708
|
-
},
|
|
709
|
-
|
|
710
|
-
},
|
|
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, {
|
|
711
794
|
class: "w-3.5 h-3.5"
|
|
712
|
-
})),
|
|
713
|
-
var
|
|
714
|
-
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;
|
|
715
798
|
}, {
|
|
716
799
|
e: void 0,
|
|
717
800
|
t: void 0,
|
|
@@ -719,113 +802,191 @@ function kt(e) {
|
|
|
719
802
|
o: void 0,
|
|
720
803
|
i: void 0,
|
|
721
804
|
n: void 0
|
|
722
|
-
}),
|
|
805
|
+
}), U(() => Z.value = $()), m;
|
|
723
806
|
})();
|
|
724
807
|
}
|
|
725
|
-
function
|
|
726
|
-
const i =
|
|
727
|
-
|
|
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,
|
|
728
815
|
readSize: () => ({
|
|
729
|
-
width:
|
|
730
|
-
height:
|
|
816
|
+
width: t().width,
|
|
817
|
+
height: t().height
|
|
731
818
|
}),
|
|
732
|
-
minWidth:
|
|
733
|
-
minHeight:
|
|
734
|
-
onCommitResize: (
|
|
735
|
-
onPreviewResize: (
|
|
819
|
+
minWidth: Mt,
|
|
820
|
+
minHeight: It,
|
|
821
|
+
onCommitResize: (w) => C()(t().id, w),
|
|
822
|
+
onPreviewResize: (w) => g()?.({
|
|
736
823
|
kind: "background_layer",
|
|
737
|
-
id:
|
|
738
|
-
x:
|
|
739
|
-
y:
|
|
740
|
-
width:
|
|
741
|
-
height:
|
|
824
|
+
id: t().id,
|
|
825
|
+
x: t().x,
|
|
826
|
+
y: t().y,
|
|
827
|
+
width: w.width,
|
|
828
|
+
height: w.height
|
|
742
829
|
}),
|
|
743
|
-
onPreviewEnd: () =>
|
|
744
|
-
}),
|
|
745
|
-
const
|
|
746
|
-
return {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
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())
|
|
759
851
|
}));
|
|
760
852
|
return (() => {
|
|
761
|
-
var
|
|
762
|
-
return
|
|
763
|
-
each:
|
|
764
|
-
children: (
|
|
765
|
-
var
|
|
766
|
-
return
|
|
767
|
-
|
|
768
|
-
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
|
|
769
861
|
});
|
|
770
|
-
},
|
|
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;
|
|
771
863
|
})()
|
|
772
|
-
}),
|
|
773
|
-
each:
|
|
774
|
-
children: (
|
|
775
|
-
var
|
|
776
|
-
return
|
|
777
|
-
|
|
778
|
-
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
|
|
779
871
|
});
|
|
780
|
-
},
|
|
781
|
-
var
|
|
782
|
-
"is-active":
|
|
783
|
-
[`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
|
|
784
876
|
};
|
|
785
|
-
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;
|
|
786
878
|
}, {
|
|
787
879
|
e: void 0,
|
|
788
880
|
t: void 0,
|
|
789
881
|
a: void 0
|
|
790
|
-
}),
|
|
882
|
+
}), h;
|
|
791
883
|
})()
|
|
792
|
-
})),
|
|
793
|
-
|
|
794
|
-
opacity:
|
|
884
|
+
})), a.$$click = (o) => {
|
|
885
|
+
A(o), b()(t().id, {
|
|
886
|
+
opacity: t().opacity >= 0.88 ? 0.42 : t().opacity + 0.18
|
|
795
887
|
});
|
|
796
|
-
},
|
|
797
|
-
|
|
798
|
-
},
|
|
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, {
|
|
799
891
|
class: "w-3.5 h-3.5"
|
|
800
|
-
})),
|
|
801
|
-
var
|
|
802
|
-
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;
|
|
803
895
|
}, {
|
|
804
896
|
e: void 0,
|
|
805
897
|
t: void 0
|
|
806
|
-
}),
|
|
898
|
+
}), w;
|
|
899
|
+
})();
|
|
900
|
+
}
|
|
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
|
+
}));
|
|
922
|
+
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;
|
|
807
932
|
})();
|
|
808
933
|
}
|
|
809
|
-
function
|
|
810
|
-
const
|
|
934
|
+
function Ft(e) {
|
|
935
|
+
const t = _(() => Le(e.items)), c = _(() => je(e.items).map((i) => i.id));
|
|
811
936
|
return (() => {
|
|
812
|
-
var
|
|
813
|
-
return
|
|
937
|
+
var i = St();
|
|
938
|
+
return z(i, y(se, {
|
|
814
939
|
get each() {
|
|
815
|
-
return
|
|
940
|
+
return c();
|
|
816
941
|
},
|
|
817
|
-
children: (
|
|
818
|
-
const
|
|
819
|
-
return
|
|
942
|
+
children: (l) => {
|
|
943
|
+
const v = _(() => t().get(l) ?? null);
|
|
944
|
+
return y(te, {
|
|
820
945
|
get when() {
|
|
821
|
-
return
|
|
946
|
+
return v();
|
|
822
947
|
},
|
|
823
|
-
children: (
|
|
948
|
+
children: (g) => y(At, {
|
|
824
949
|
get item() {
|
|
825
|
-
return
|
|
950
|
+
return g();
|
|
826
951
|
},
|
|
827
952
|
get selected() {
|
|
828
|
-
return
|
|
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, {
|
|
975
|
+
get each() {
|
|
976
|
+
return c();
|
|
977
|
+
},
|
|
978
|
+
children: (l) => {
|
|
979
|
+
const v = _(() => t().get(l) ?? null);
|
|
980
|
+
return y(te, {
|
|
981
|
+
get when() {
|
|
982
|
+
return v();
|
|
983
|
+
},
|
|
984
|
+
children: (g) => y(Wt, {
|
|
985
|
+
get item() {
|
|
986
|
+
return g();
|
|
987
|
+
},
|
|
988
|
+
get selected() {
|
|
989
|
+
return ve(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === l;
|
|
829
990
|
},
|
|
830
991
|
get editable() {
|
|
831
992
|
return e.editable;
|
|
@@ -833,6 +994,12 @@ function Tt(e) {
|
|
|
833
994
|
get viewportScale() {
|
|
834
995
|
return e.viewport.scale;
|
|
835
996
|
},
|
|
997
|
+
get viewport() {
|
|
998
|
+
return e.viewport;
|
|
999
|
+
},
|
|
1000
|
+
get projection() {
|
|
1001
|
+
return e.projection;
|
|
1002
|
+
},
|
|
836
1003
|
get preview() {
|
|
837
1004
|
return e.preview;
|
|
838
1005
|
},
|
|
@@ -851,35 +1018,35 @@ function Tt(e) {
|
|
|
851
1018
|
})
|
|
852
1019
|
});
|
|
853
1020
|
}
|
|
854
|
-
})),
|
|
855
|
-
var
|
|
856
|
-
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;
|
|
857
1024
|
}, {
|
|
858
1025
|
e: void 0,
|
|
859
1026
|
t: void 0
|
|
860
|
-
}),
|
|
1027
|
+
}), i;
|
|
861
1028
|
})();
|
|
862
1029
|
}
|
|
863
|
-
function
|
|
864
|
-
const
|
|
1030
|
+
function tn(e) {
|
|
1031
|
+
const t = _(() => Le(e.items)), c = _(() => je(e.items).map((i) => i.id));
|
|
865
1032
|
return (() => {
|
|
866
|
-
var
|
|
867
|
-
return
|
|
1033
|
+
var i = zt();
|
|
1034
|
+
return z(i, y(se, {
|
|
868
1035
|
get each() {
|
|
869
|
-
return
|
|
1036
|
+
return c();
|
|
870
1037
|
},
|
|
871
|
-
children: (
|
|
872
|
-
const
|
|
873
|
-
return
|
|
1038
|
+
children: (l) => {
|
|
1039
|
+
const v = _(() => t().get(l) ?? null);
|
|
1040
|
+
return y(te, {
|
|
874
1041
|
get when() {
|
|
875
|
-
return
|
|
1042
|
+
return v();
|
|
876
1043
|
},
|
|
877
|
-
children: (
|
|
1044
|
+
children: (g) => y(Gt, {
|
|
878
1045
|
get item() {
|
|
879
|
-
return
|
|
1046
|
+
return g();
|
|
880
1047
|
},
|
|
881
1048
|
get selected() {
|
|
882
|
-
return
|
|
1049
|
+
return ve(() => e.selectedObject?.kind === "annotation")() && e.selectedObject.id === l;
|
|
883
1050
|
},
|
|
884
1051
|
get editable() {
|
|
885
1052
|
return e.editable;
|
|
@@ -887,6 +1054,12 @@ function Lt(e) {
|
|
|
887
1054
|
get viewportScale() {
|
|
888
1055
|
return e.viewport.scale;
|
|
889
1056
|
},
|
|
1057
|
+
get viewport() {
|
|
1058
|
+
return e.viewport;
|
|
1059
|
+
},
|
|
1060
|
+
get projection() {
|
|
1061
|
+
return e.projection;
|
|
1062
|
+
},
|
|
890
1063
|
get preview() {
|
|
891
1064
|
return e.preview;
|
|
892
1065
|
},
|
|
@@ -911,30 +1084,59 @@ function Lt(e) {
|
|
|
911
1084
|
})
|
|
912
1085
|
});
|
|
913
1086
|
}
|
|
914
|
-
})),
|
|
915
|
-
var
|
|
916
|
-
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;
|
|
917
1090
|
}, {
|
|
918
1091
|
e: void 0,
|
|
919
1092
|
t: void 0
|
|
920
|
-
}),
|
|
1093
|
+
}), i;
|
|
921
1094
|
})();
|
|
922
1095
|
}
|
|
923
|
-
function
|
|
924
|
-
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);
|
|
925
1098
|
return (() => {
|
|
926
|
-
var
|
|
927
|
-
return
|
|
1099
|
+
var i = Et();
|
|
1100
|
+
return z(i, y(te, {
|
|
928
1101
|
get when() {
|
|
929
|
-
return
|
|
1102
|
+
return e.showRegionOutlines;
|
|
930
1103
|
},
|
|
931
|
-
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, {
|
|
932
1128
|
get item() {
|
|
933
|
-
return
|
|
1129
|
+
return l();
|
|
934
1130
|
},
|
|
935
1131
|
get viewportScale() {
|
|
936
1132
|
return e.viewport.scale;
|
|
937
1133
|
},
|
|
1134
|
+
get viewport() {
|
|
1135
|
+
return e.viewport;
|
|
1136
|
+
},
|
|
1137
|
+
get projection() {
|
|
1138
|
+
return e.projection;
|
|
1139
|
+
},
|
|
938
1140
|
get preview() {
|
|
939
1141
|
return e.preview;
|
|
940
1142
|
},
|
|
@@ -951,17 +1153,23 @@ function Dt(e) {
|
|
|
951
1153
|
return e.onDeleteBackgroundLayer;
|
|
952
1154
|
}
|
|
953
1155
|
})
|
|
954
|
-
}), null),
|
|
1156
|
+
}), null), z(i, y(te, {
|
|
955
1157
|
get when() {
|
|
956
|
-
return
|
|
1158
|
+
return ve(() => !!e.editable)() && t();
|
|
957
1159
|
},
|
|
958
|
-
children: (
|
|
1160
|
+
children: (l) => y(Nt, {
|
|
959
1161
|
get item() {
|
|
960
|
-
return
|
|
1162
|
+
return l();
|
|
961
1163
|
},
|
|
962
1164
|
get viewportScale() {
|
|
963
1165
|
return e.viewport.scale;
|
|
964
1166
|
},
|
|
1167
|
+
get viewport() {
|
|
1168
|
+
return e.viewport;
|
|
1169
|
+
},
|
|
1170
|
+
get projection() {
|
|
1171
|
+
return e.projection;
|
|
1172
|
+
},
|
|
965
1173
|
get preview() {
|
|
966
1174
|
return e.preview;
|
|
967
1175
|
},
|
|
@@ -984,16 +1192,16 @@ function Dt(e) {
|
|
|
984
1192
|
return e.onDeleteAnnotation;
|
|
985
1193
|
}
|
|
986
1194
|
})
|
|
987
|
-
}), null),
|
|
1195
|
+
}), null), U(() => i.classList.toggle("is-editable", !!e.editable)), i;
|
|
988
1196
|
})();
|
|
989
1197
|
}
|
|
990
|
-
|
|
1198
|
+
Qe(["pointerdown", "contextmenu", "input", "click", "keydown"]);
|
|
991
1199
|
export {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
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
|
|
999
1207
|
};
|