@floegence/floe-webapp-core 0.36.50 → 0.36.52

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