@floegence/floe-webapp-core 0.55.2 → 0.56.2

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