@floegence/floe-webapp-core 0.55.1 → 0.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 w, 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 j, 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 gt, Plus as wt } 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 l } 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>"), we = /* @__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(u, o) {
26
+ return e.set(u, o), r((i) => i + 1), () => {
27
+ e.get(u) === o && (e.delete(u), r((i) => i + 1));
27
28
  };
28
29
  },
29
- get(n) {
30
- return e.get(n);
30
+ get(u) {
31
+ return t(), e.get(u);
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((u) => u === 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 u = (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", u, !0), document.addEventListener("keydown", o), ye(() => {
55
+ document.removeEventListener("pointerdown", u, !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(), [u, o] = re(!1), [i, x] = re(!1);
66
+ let z;
67
+ const O = () => t()?.textContent ?? "", B = (g) => r(g), D = (g) => {
68
+ const d = e.singleLine ? (g.textContent ?? "").trim() : g.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 g = t();
73
+ if (!g || u() || i()) return;
74
+ const d = e.value();
75
+ (g.innerHTML ?? "") !== d && (e.singleLine ? g.textContent = d : g.innerHTML = d);
76
+ }), fe(() => {
77
+ const g = t();
78
+ if (!g || !i()) return;
79
+ const d = (m) => {
80
+ m.composedPath().includes(g) || g.blur();
81
+ }, T = g.ownerDocument;
82
+ T.addEventListener("pointerdown", d, !0), ye(() => T.removeEventListener("pointerdown", d, !0));
83
+ });
84
+ const p = () => {
85
+ x(!0);
86
+ }, Y = (g) => {
87
+ const d = document.getSelection();
88
+ tt(d, g.currentTarget) && (z = d.getRangeAt(0).cloneRange()), u() || D(g.currentTarget), x(!1);
89
+ }, E = (g) => {
90
+ if (g.stopPropagation(), u() || g.isComposing || g.keyCode === 229) return;
91
+ const d = g.ctrlKey || g.metaKey;
92
+ g.key === "Escape" || g.key === "Enter" && (d || e.singleLine) ? (g.preventDefault(), g.currentTarget.blur()) : d && g.key === "b" ? (g.preventDefault(), document.execCommand("bold", !1)) : d && g.key === "i" && (g.preventDefault(), document.execCommand("italic", !1));
93
+ }, L = () => {
94
+ o(!0);
95
+ }, C = (g) => {
96
+ document.activeElement !== g.currentTarget && D(g.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: O,
107
+ focus: G,
108
+ insertTextAtSelection: (g) => {
109
+ const d = t();
110
+ if (!d) return;
111
+ const T = document.getSelection(), m = tt(T, d) ? T.getRangeAt(0).cloneRange() : void 0, c = z && d.contains(z.commonAncestorContainer) ? z : void 0, h = m ?? c?.cloneRange() ?? document.createRange();
112
+ if (G(), !m && !c && (h.selectNodeContents(d), h.collapse(!1)), T?.removeAllRanges(), T?.addRange(h), document.execCommand?.("insertText", !1, g)) return;
113
+ h.deleteContents();
114
+ const n = document.createTextNode(g);
115
+ h.insertNode(n), h.setStartAfter(n), h.collapse(!0), T?.removeAllRanges(), T?.addRange(h);
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: L,
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 = l(() => e.readPosition()), r = l(() => 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
+ }), u = l(() => e.viewportScale()), o = l(() => e.onCommitMove), i = l(() => e.onPreviewMove), x = l(() => e.onPreviewEnd), z = l(() => e.onInteractionStart), O = l(() => e.onInteractionEnd), B = l(() => e.onCommitStart), [D, 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(D)?.stopInteraction();
185
206
  }), {
186
- position: O(() => {
187
- const E = T();
188
- return E ? {
189
- x: E.worldX,
190
- y: E.worldY
191
- } : n();
207
+ position: j(() => {
208
+ const C = D();
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: () => D() !== 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(u(), 1e-3), g = 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, g(), O()?.());
229
+ }, m = r(), c = i(), h = x(), n = B(), F = 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 I = 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 I = {
254
+ x: S.startWorldX + (X.clientX - S.startClientX) / S.scale,
255
+ y: S.startWorldY + (X.clientY - S.startClientY) / S.scale,
256
+ width: m.width,
257
+ height: m.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
+ }), I && c?.(I);
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 I = Pe(D);
271
+ Te(() => {
272
+ if (I && X) {
273
+ const S = {
274
+ x: I.worldX,
275
+ y: I.worldY
255
276
  };
256
- s?.(k), w.moved && h(k);
277
+ n?.(S), I.moved && F(S);
257
278
  }
258
- w?.stopInteraction(), p(null), J = void 0, M?.();
279
+ I?.stopInteraction(), p(null), Y = void 0, h?.();
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 = l(() => e.readSize()), r = l(() => e.viewportScale()), u = l(() => e.onCommitResize), o = l(() => e.onPreviewResize), i = l(() => e.onPreviewEnd), x = l(() => e.onInteractionStart), z = l(() => e.onInteractionEnd), [O, B] = re(null);
288
+ let D;
289
+ return ye(() => {
290
+ D?.stop({
270
291
  reason: "manual_stop",
271
292
  commit: !1
272
- }), T = void 0, We(L)?.stopInteraction();
293
+ }), D = void 0, Pe(O)?.stopInteraction();
273
294
  }), {
274
- size: O(() => {
275
- const _ = L();
276
- return _ ? {
277
- width: _.width,
278
- height: _.height
279
- } : n();
295
+ size: j(() => {
296
+ const E = O();
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: () => O() !== null,
303
+ beginResize: (E) => {
304
+ if (E.button !== 0) return;
305
+ E.preventDefault(), E.stopPropagation(), D?.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 L = 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 g = () => {
316
+ q || (q = !0, G(), z()?.());
317
+ }, d = o(), T = i(), m = u();
318
+ B({
319
+ pointerId: E.pointerId,
320
+ startClientX: E.clientX,
321
+ startClientY: E.clientY,
322
+ startWidth: L.width,
323
+ startHeight: L.height,
324
+ width: L.width,
325
+ height: L.height,
326
+ scale: C,
327
+ stopInteraction: g
328
+ }), D = at({
329
+ pointerEvent: E,
330
+ captureEl: E.currentTarget,
331
+ onMove: (c) => {
332
+ let h = null;
333
+ Te(() => {
334
+ B((n) => !n || n.pointerId !== c.pointerId ? n : (h = {
335
+ width: Math.max(e.minWidth, n.startWidth + (c.clientX - n.startClientX) / n.scale),
336
+ height: Math.max(e.minHeight, n.startHeight + (c.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: h.width,
340
+ height: h.height
341
+ })), h && d?.(h);
321
342
  });
322
343
  },
323
344
  onEnd: ({
324
- commit: a
345
+ commit: c
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 h = Pe(O);
348
+ Te(() => {
349
+ h && c && m({
350
+ width: h.width,
351
+ height: h.height
352
+ }), h?.stopInteraction(), B(null), D = 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 u = e.color, o = e.material;
364
+ return u !== r.e && s(t, "data-note-color", r.e = u), 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, u] = re(), o = l(() => e.item), i = l(() => e.selected), x = l(() => e.viewportScale), z = l(() => e.projectedViewport), O = l(() => e.surfaceReady ?? !0), B = l(() => e.renderLayer), D = l(() => e.topRenderLayer), p = l(() => e.locked), Y = l(() => e.filtered), E = l(() => e.visualFront ?? !1), L = l(() => e.onSelect), C = l(() => e.onContextMenu), G = l(() => e.onClaimVisualFrontOwner), q = l(() => e.onCommitFront), g = l(() => e.onCommitMove), d = l(() => e.onCommitResize), T = l(() => e.onUpdate), m = l(() => e.onDelete), c = l(() => e.onLayoutInteractionStart), h = l(() => e.onLayoutInteractionEnd), n = Me({
373
+ value: () => o().body,
374
+ onCommit: ($) => T()(o().id, {
375
+ body: $
376
+ })
377
+ }), F = Me({
378
+ value: () => o().title ?? "",
379
+ onCommit: ($) => T()(o().id, {
380
+ title: $
343
381
  })
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);
382
+ });
383
+ fe(() => {
384
+ p() && (F.blur(), n.blur());
385
+ });
386
+ const [X, I] = re("body"), S = Ne(We), te = () => F.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
+ }, v = ($) => {
399
+ if ($.button !== 0) return;
400
+ const ie = o();
401
+ L()(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: ($) => g()(o().id, $),
409
+ onCommitStart: () => q()?.(o().id),
410
+ onInteractionStart: () => c()?.(),
411
+ onInteractionEnd: () => h()?.()
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: () => c()?.(),
422
+ onInteractionEnd: () => h()?.()
423
+ }), W = j(() => b.position()), H = j(() => y.size()), f = j(() => {
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: O()
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 = j(() => f()?.rect.viewportScale ?? Math.max(x(), 1e-3)), Z = j(() => ({
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() ? D() + 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", () => L()(o().id)), $.$$pointerdown = v, se(u, $), N.$$pointerdown = (a) => {
448
+ if (p()) return;
449
+ const M = o();
450
+ L()(M.id), G()?.(M.id), b.beginDrag(a);
451
+ }, k(N, w(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, w(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", F.handleCompositionEnd), U(a, "compositionstart", F.handleCompositionStart), U(a, "keydown", F.handleKeyDown, !0), U(a, "blur", F.handleBlur), a.addEventListener("focus", (R) => {
462
+ I("title"), F.handleFocus(R);
463
+ }), a.$$pointerdown = (R) => {
464
+ R.stopPropagation(), L()(o().id);
465
+ };
466
+ var M = F.bind;
467
+ return typeof M == "function" ? se(M, a) : F.bind = a, s(a, "spellcheck", !1), P((R) => {
468
+ var V = !p(), me = t("stickyTitle"), ge = t("textPlaceholder");
469
+ return V !== R.e && s(a, "contenteditable", R.e = V), me !== R.t && s(a, "aria-label", R.t = me), ge !== R.a && s(a, "data-placeholder", R.a = ge), 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
+ I("body"), n.handleFocus(a);
478
+ }), ee.$$pointerdown = (a) => {
479
+ a.stopPropagation(), L()(o().id);
480
+ };
481
+ var ke = n.bind;
482
+ return typeof ke == "function" ? se(ke, ee) : n.bind = ee, s(ee, "spellcheck", !1), k($, w(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 w(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 w(Fe, {
502
+ kind: "sticky",
503
+ onInsertEmoji: (a) => (X() === "title" && o().title !== void 0 ? F : 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) => w(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, w(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, w(nt, {
528
+ color: M,
529
+ get material() {
530
+ return o().material ?? "tint";
531
+ }
532
+ }), null), k(R, w(ot, {}), null), P((V) => {
533
+ var me = t("stickyColor", t(M)), ge = o().color === M;
534
+ return me !== V.e && s(R, "aria-label", V.e = me), ge !== V.t && s(R, "aria-pressed", V.t = ge), 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 [w(oe, {
545
+ when: S,
546
+ get fallback() {
547
+ return (() => {
548
+ var a = we();
549
+ return a.$$click = ve, a.$$pointerdown = Q, k(a, w(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 = we();
562
+ return a.$$click = () => S?.duplicate({
563
+ kind: "sticky_note",
564
+ id: o().id
565
+ }), a.$$pointerdown = Q, k(a, w(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 = () => m()(o().id), a.$$pointerdown = Q, k(a, w(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($, w(oe, {
593
+ get when() {
594
+ return i();
595
+ },
596
+ get children() {
597
+ return St();
598
+ }
599
+ }), null), k($, w(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, ge = 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($, ge, 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 = l(() => e.item), u = l(() => e.selected), o = l(() => e.editable), i = l(() => e.viewportScale), x = l(() => 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 = l(() => e.projection), O = l(() => e.preview), B = l(() => e.textEditorRegistry), D = l(() => e.onPreviewGeometry), p = l(() => e.onSelect), Y = l(() => e.onContextMenu), E = l(() => e.onCommitMove), L = l(() => e.onUpdate), C = Me({
567
642
  value: () => r().text,
568
- onCommit: (d) => H()(r().id, {
569
- text: d
643
+ onCommit: (m) => L()(r().id, {
644
+ text: m
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 m = B();
649
+ if (!m) return;
650
+ const c = m.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(c);
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: (m) => E()(r().id, m),
670
+ onPreviewMove: (m) => D()?.({
594
671
  kind: "annotation",
595
672
  id: r().id,
596
- ...d
673
+ ...m
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: () => D()?.(null)
676
+ }), q = j(() => {
677
+ const m = r(), c = Se(O(), "annotation", m.id);
678
+ return ze({
679
+ geometry: Ee({
680
+ preview: c,
681
+ position: G.position(),
682
+ width: m.width,
683
+ height: m.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
+ }), g = j(() => z() === "screen" ? Math.max(x().scale, 1e-3) : 1), d = j(() => ({
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": `${g()}`,
702
+ "--workbench-text-content-inverse-scale": `${1 / g()}`
703
+ })), T = (m) => {
704
+ !o() || m.button !== 0 || m.target instanceof Element && m.target.closest(".workbench-text-annotation__content") || (m.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 m = Rt(), c = m.firstChild;
708
+ m.$$contextmenu = (n) => {
709
+ o() && (n.preventDefault(), n.stopPropagation(), p()(r().id), Y()?.(n, r()));
710
+ }, m.$$pointerdown = T, U(c, "compositionend", C.handleCompositionEnd), U(c, "compositionstart", C.handleCompositionStart), U(c, "blur", C.handleBlur), U(c, "keydown", C.handleKeyDown, !0), c.addEventListener("focus", (n) => {
711
+ C.handleFocus(n), o() && p()(r().id);
712
+ }), c.$$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 h = C.bind;
716
+ return typeof h == "function" ? se(h, c) : C.bind = c, s(c, "spellcheck", !1), P((n) => {
717
+ var F = !!u(), X = !!o(), I = 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 F !== n.e && m.classList.toggle("is-selected", n.e = F), X !== n.t && m.classList.toggle("is-editable", n.t = X), I !== n.a && s(m, "data-floe-canvas-interactive", n.a = I), S !== n.o && s(m, "data-wb-object-id", n.o = S), n.i = he(m, te, n.i), ne !== n.n && s(c, "contenteditable", n.n = ne), ae !== n.s && s(c, "tabindex", n.s = ae), _ !== n.h && s(c, "role", n.h = _), J !== n.r && s(c, "aria-label", n.r = J), ce !== n.d && s(c, "aria-multiline", n.d = ce), ve !== n.l && s(c, "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
+ }), m;
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 = l(() => e.item), u = l(() => e.selected), o = l(() => e.editable), i = l(() => e.viewportScale), x = l(() => 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 = l(() => e.projection), O = l(() => e.preview), B = l(() => e.onPreviewGeometry), D = l(() => e.onSelect), p = l(() => e.onContextMenu), Y = l(() => 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 L = 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 = j(() => {
768
+ const d = r(), T = Se(O(), "background_layer", d.id);
769
+ return ze({
770
+ geometry: Ee({
771
+ preview: T,
772
+ position: L.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 = j(() => z() === "screen" ? Math.max(x().scale, 1e-3) : 1), q = j(() => ({
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
+ })), g = (d) => {
787
+ !o() || d.button !== 0 || d.target instanceof Element && d.target.closest(".workbench-background-region__label, .workbench-background-region__toolbar, .workbench-layer-resize") || (D()(r().id), L.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, m = T.firstChild, c = T.nextSibling;
791
+ d.$$contextmenu = (n) => {
792
+ o() && (n.preventDefault(), n.stopPropagation(), D()(r().id), p()?.(n, r()));
793
+ }, d.addEventListener("focus", () => o() && D()(r().id)), d.$$pointerdown = g, U(m, "compositionend", E.handleCompositionEnd), U(m, "compositionstart", E.handleCompositionStart), U(m, "keydown", E.handleKeyDown, !0), U(m, "blur", E.handleBlur), U(m, "focus", E.handleFocus), m.$$pointerdown = (n) => {
794
+ n.stopPropagation(), D()(r().id);
710
795
  };
711
- var d = _.bind;
712
- return typeof d == "function" ? ge(d, v) : _.bind = v, F((a) => {
713
- var M = {
796
+ var h = E.bind;
797
+ return typeof h == "function" ? se(h, m) : E.bind = m, c.$$pointerdown = g, k(c, w(Ge, {})), P((n) => {
798
+ var F = {
714
799
  "is-selected": u(),
715
- "is-editable": t(),
716
- "is-transforming": H.isDragging(),
800
+ "is-editing": E.isFocused(),
801
+ "is-editable": o(),
802
+ "is-transforming": L.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, I = 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, F, n.e), X !== n.t && s(d, "data-floe-canvas-interactive", n.t = X), I !== n.a && s(d, "data-wb-object-id", n.a = I), 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(m, "contenteditable", n.s = ae), _ !== n.h && s(m, "aria-label", n.h = _), J !== n.r && s(m, "data-placeholder", n.r = J), ce !== n.d && s(c, "aria-label", n.d = ce), n;
720
806
  }, {
721
807
  e: void 0,
722
808
  t: void 0,
@@ -725,417 +811,499 @@ 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), [u, o] = re(), i = l(() => e.item), x = () => e.textEditorRegistry?.get(i().id), z = l(() => e.viewportScale), O = l(() => 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 = l(() => e.projection), D = l(() => e.preview), p = l(() => e.onPreviewGeometry), Y = l(() => e.onCommitMove), E = l(() => e.onCommitResize), L = l(() => e.onUpdate), C = l(() => e.onDelete);
826
+ let G, q;
827
+ const [g, d] = re(!1), [T, m] = re(""), [c, h] = re(!1), n = j(() => Ie.find((_) => _.fontFamily === i().font_family) ?? Ie[0]), F = 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
+ }), I = j(() => {
863
+ const _ = i(), J = Se(D(), "annotation", _.id);
864
+ return ze({
865
+ geometry: Ee({
866
+ preview: J,
867
+ position: F.position(),
868
+ width: X.size().width,
869
+ height: X.size().height
782
870
  }),
783
- viewport: S(),
784
- projection: j()
871
+ viewport: O(),
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 = j(() => ({
875
+ ...pe(I()),
876
+ "z-index": `${i().z_index}`,
877
+ "--workbench-layer-control-inverse-scale": `${1 / Math.max(I().scale, 1e-3)}`
878
+ })), te = () => nn(["left", "center", "right"], i().align), ne = (_) => {
879
+ if (!Number.isFinite(_)) return;
880
+ const J = rn(_);
881
+ m(String(J)), L()(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
+ m(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 || m(String(i().font_size));
894
+ }), on(c, () => q, () => h(!1)), (() => {
895
+ var _ = Mt(), J = _.firstChild, ce = J.nextSibling, ve = ce.nextSibling;
896
+ return se(o, _), U(ce, "pointerdown", F.beginDrag, !0), k(ce, w(Ge, {})), k(_, w(Ae, {
897
+ reservedSpace: {
898
+ top: 64,
899
+ narrowTop: 106,
900
+ bottom: 86
901
+ },
809
902
  get anchor() {
810
- return r();
903
+ return u();
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 w(Fe, {
911
+ kind: "text",
912
+ onInsertEmoji: (v) => x()?.insertTextAtSelection(v),
913
+ get moreOpen() {
914
+ return g();
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;
916
+ onMoreClose: () => d(!1),
917
+ get more() {
918
+ return [(() => {
919
+ var v = It(), b = v.firstChild, y = b.firstChild, W = y.nextSibling;
920
+ v.$$click = Oe, v.$$pointerdown = je;
921
+ var H = q;
922
+ return typeof H == "function" ? se(H, v) : q = v, b.$$click = (f) => {
923
+ $e(f), h((K) => !K);
924
+ }, b.$$pointerdown = Q, k(W, () => t(n().id)), k(b, w(ht, {
925
+ class: "workbench-text-font-trigger__icon"
926
+ }), null), k(v, w(oe, {
927
+ get when() {
928
+ return c();
929
+ },
930
+ get children() {
931
+ var f = Lt();
932
+ return k(f, w(de, {
933
+ each: Ie,
934
+ children: (K) => (() => {
935
+ var Z = Ot(), $ = Z.firstChild, ie = $.nextSibling;
936
+ return Z.$$click = (N) => {
937
+ $e(N), L()(i().id, {
938
+ font_family: K.fontFamily,
939
+ font_weight: K.fontWeight
940
+ }), h(!1);
941
+ }, Z.$$pointerdown = Q, k(ie, () => t(K.id)), P((N) => {
942
+ 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}`;
943
+ 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;
944
+ }, {
945
+ e: void 0,
946
+ t: void 0,
947
+ a: void 0,
948
+ o: void 0,
949
+ i: void 0,
950
+ n: void 0
951
+ }), Z;
952
+ })()
953
+ })), P(() => s(f, "aria-label", t("boldFont"))), f;
954
+ }
955
+ }), null), P((f) => {
956
+ var K = t("chooseFont"), Z = c(), $ = t("chooseFont"), ie = n().fontFamily, N = `${n().fontWeight}`;
957
+ 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;
958
+ }, {
959
+ e: void 0,
960
+ t: void 0,
961
+ a: void 0,
962
+ o: void 0,
963
+ i: void 0
964
+ }), v;
965
+ })(), (() => {
966
+ var v = jt(), b = v.firstChild, y = b.nextSibling, W = y.nextSibling;
967
+ v.$$click = Oe, v.$$pointerdown = je, b.$$click = (f) => {
968
+ $e(f), ne(i().font_size - 1);
969
+ }, b.$$pointerdown = Q, k(b, w(gt, {
970
+ class: "w-3 h-3"
971
+ })), y.$$keydown = (f) => {
972
+ f.key === "Enter" && (f.preventDefault(), ae(), f.currentTarget.blur());
973
+ }, y.addEventListener("blur", ae), y.$$input = (f) => m(f.currentTarget.value), y.$$click = Oe, y.$$pointerdown = je;
974
+ var H = G;
975
+ return typeof H == "function" ? se(H, y) : G = y, W.$$click = (f) => {
976
+ $e(f), ne(i().font_size + 1);
977
+ }, W.$$pointerdown = Q, k(W, w(wt, {
978
+ class: "w-3 h-3"
979
+ })), P((f) => {
980
+ var K = t("textSize"), Z = t("decreaseSize"), $ = t("decreaseSize"), ie = t("sizeValue"), N = t("increaseSize"), le = t("increaseSize");
981
+ return K !== f.e && s(v, "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;
982
+ }, {
983
+ e: void 0,
984
+ t: void 0,
985
+ a: void 0,
986
+ o: void 0,
987
+ i: void 0,
988
+ n: void 0
989
+ }), P(() => y.value = T()), v;
990
+ })(), w(de, {
991
+ each: kt,
992
+ children: (v) => (() => {
993
+ var b = Dt();
994
+ return b.$$click = (y) => {
995
+ $e(y), L()(i().id, {
996
+ color: v
997
+ });
998
+ }, b.$$pointerdown = Q, xe(b, "background", v), P((y) => {
999
+ var W = t("textColor", v), H = i().color === v;
1000
+ return W !== y.e && s(b, "aria-label", y.e = W), H !== y.t && b.classList.toggle("is-active", y.t = H), y;
844
1001
  }, {
845
1002
  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;
1003
+ t: void 0
1004
+ }), b;
852
1005
  })()
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;
878
- }, {
879
- 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();
1006
+ }), (() => {
1007
+ var v = we();
1008
+ return v.$$click = () => L()(i().id, {
1009
+ align: te()
1010
+ }), v.$$pointerdown = Q, k(v, () => t(i().align)), v;
1011
+ })()];
1012
+ },
1013
+ get actions() {
1014
+ return [w(oe, {
1015
+ when: r,
1016
+ get children() {
1017
+ var v = we();
1018
+ return v.$$click = () => r?.duplicate({
1019
+ kind: "annotation",
1020
+ id: i().id
1021
+ }), v.$$pointerdown = Q, k(v, w(ue, {
1022
+ name: "copy"
1023
+ })), P((b) => {
1024
+ var y = t("duplicate"), W = t("duplicate");
1025
+ return y !== b.e && s(v, "aria-label", b.e = y), W !== b.t && s(v, "title", b.t = W), b;
1026
+ }, {
1027
+ e: void 0,
1028
+ t: void 0
1029
+ }), v;
1030
+ }
1031
+ }), (() => {
1032
+ var v = He();
1033
+ return v.$$click = () => C()(i().id), v.$$pointerdown = Q, k(v, w(ue, {
1034
+ name: "trash"
1035
+ })), P(() => s(v, "aria-label", t("deleteText"))), v;
1036
+ })()];
890
1037
  },
891
1038
  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;
1039
+ return [(() => {
1040
+ var v = Tt(), b = v.firstChild;
1041
+ return v.addEventListener("change", (y) => {
1042
+ if (y.currentTarget.value === "more") {
1043
+ d(!g());
1044
+ return;
1045
+ }
1046
+ const W = {
1047
+ title: 48,
1048
+ heading: 30,
1049
+ body: 18,
1050
+ caption: 14
1051
+ }, H = y.currentTarget.value;
1052
+ L()(i().id, {
1053
+ font_size: W[H],
1054
+ font_weight: H === "title" || H === "heading" ? 560 : 400
1055
+ });
1056
+ }), k(v, w(de, {
1057
+ each: ["title", "heading", "body", "caption"],
1058
+ children: (y) => (() => {
1059
+ var W = Ft();
1060
+ return W.value = y, k(W, () => t(y)), W;
1061
+ })()
1062
+ }), b), k(b, () => t("more")), P(() => s(v, "aria-label", t("typography"))), P(() => v.value = i().font_size >= 40 ? "title" : i().font_size >= 24 ? "heading" : i().font_size >= 16 ? "body" : "caption"), v;
1063
+ })(), w(de, {
1064
+ each: ["left", "center"],
1065
+ children: (v) => (() => {
1066
+ var b = we();
1067
+ return b.$$click = () => L()(i().id, {
1068
+ align: v
1069
+ }), b.$$pointerdown = Q, k(b, w(ue, {
1070
+ name: v
1071
+ })), P((y) => {
1072
+ var W = t(v), H = i().align === v;
1073
+ return W !== y.e && s(b, "aria-label", y.e = W), H !== y.t && s(b, "aria-pressed", y.t = H), y;
902
1074
  }, {
903
1075
  e: void 0,
904
1076
  t: void 0
905
- }), R;
1077
+ }), b;
906
1078
  })()
907
- })), F(() => c(o, "aria-label", n("emoji"))), o;
1079
+ }), w(mt, {})];
908
1080
  }
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;
1081
+ });
939
1082
  }
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;
1083
+ }), ve), U(ve, "pointerdown", X.beginResize, !0), P((v) => {
1084
+ var b = i().id, y = S(), W = t("moveText"), H = t("resizeText");
1085
+ return b !== v.e && s(_, "data-wb-object-id", v.e = b), v.t = he(_, y, v.t), W !== v.a && s(ce, "aria-label", v.a = W), H !== v.o && s(ve, "aria-label", v.o = H), v;
943
1086
  }, {
944
1087
  e: void 0,
945
1088
  t: void 0,
946
- a: void 0
947
- }), x;
1089
+ a: void 0,
1090
+ o: void 0
1091
+ }), _;
948
1092
  })();
949
1093
  }
950
- function cn(e) {
951
- const n = Te(), [r, u] = de(), t = i(() => e.item), y = i(() => e.viewportScale), S = i(() => e.viewport ?? {
1094
+ function sn(e) {
1095
+ const t = _e(), r = Ne(We), [u, o] = re(), i = l(() => e.item), x = () => e.textEditorRegistry?.get(i().id), z = () => x()?.isFocused() ?? !1, O = l(() => e.viewportScale), B = l(() => e.viewport ?? {
952
1096
  x: 0,
953
1097
  y: 0,
954
1098
  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,
1099
+ }), D = l(() => e.projection), p = l(() => e.preview), Y = l(() => e.onPreviewGeometry), E = l(() => e.onCommitResize), L = l(() => e.onUpdate), C = l(() => e.onDelete), G = Ye({
1100
+ viewportScale: O,
957
1101
  readSize: () => ({
958
- width: t().width,
959
- height: t().height
1102
+ width: i().width,
1103
+ height: i().height
960
1104
  }),
961
- minWidth: Ut,
962
- minHeight: Vt,
963
- onCommitResize: (P) => T()(t().id, P),
964
- onPreviewResize: (P) => G()?.({
1105
+ minWidth: Jt,
1106
+ minHeight: Qt,
1107
+ onCommitResize: (d) => E()(i().id, d),
1108
+ onPreviewResize: (d) => Y()?.({
965
1109
  kind: "background_layer",
966
- id: t().id,
967
- x: t().x,
968
- y: t().y,
969
- width: P.width,
970
- height: P.height
1110
+ id: i().id,
1111
+ x: i().x,
1112
+ y: i().y,
1113
+ width: d.width,
1114
+ height: d.height
971
1115
  }),
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,
1116
+ onPreviewEnd: () => Y()?.(null)
1117
+ }), q = j(() => {
1118
+ const d = i(), T = Se(p(), "background_layer", d.id);
1119
+ return ze({
1120
+ geometry: Ee({
1121
+ preview: T,
978
1122
  position: {
979
- x: P.x,
980
- y: P.y
1123
+ x: d.x,
1124
+ y: d.y
981
1125
  },
982
- width: _.size().width,
983
- height: _.size().height
1126
+ width: G.size().width,
1127
+ height: G.size().height
984
1128
  }),
985
- viewport: S(),
986
- projection: j()
1129
+ viewport: B(),
1130
+ projection: D()
987
1131
  });
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())
1132
+ }), g = j(() => ({
1133
+ ...pe(q()),
1134
+ "z-index": `${i().z_index}`,
1135
+ "--workbench-layer-control-inverse-scale": `${1 / Math.max(q().scale, 1e-3)}`,
1136
+ ...Ce(i())
993
1137
  }));
994
1138
  return (() => {
995
- var P = Wt(), U = P.firstChild, m = U.nextSibling;
996
- return ge(u, P), C(P, b(Ae, {
1139
+ var d = At(), T = d.firstChild, m = T.nextSibling;
1140
+ return se(o, d), k(d, w(Ae, {
1141
+ reservedSpace: {
1142
+ top: 64,
1143
+ narrowTop: 106,
1144
+ bottom: 86
1145
+ },
997
1146
  get anchor() {
998
- return r();
1147
+ return u();
999
1148
  },
1000
1149
  get revision() {
1001
- return E();
1150
+ return g();
1151
+ },
1152
+ get topOffset() {
1153
+ return be(() => !!(i().name.trim() || z()))() ? 34 * B().scale : 0;
1002
1154
  },
1003
1155
  class: "workbench-object-tools",
1004
1156
  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();
1157
+ return w(Fe, {
1158
+ kind: "region",
1159
+ onInsertEmoji: (c) => x()?.insertTextAtSelection(c),
1160
+ materials: yt,
1161
+ get material() {
1162
+ return i().material;
1163
+ },
1164
+ materialLabel: (c) => t("useRegionMaterial", t(c)),
1165
+ preview: (c) => (() => {
1166
+ var h = Nt(), n = h.firstChild;
1167
+ return De(n, `workbench-region-material__sample is-material-${c}`), P((F) => he(n, Ce(i()), F)), h;
1168
+ })(),
1169
+ onMaterial: (c) => L()(i().id, {
1170
+ material: c
1171
+ }),
1172
+ get palette() {
1173
+ return (() => {
1174
+ var c = lt();
1175
+ return k(c, w(de, {
1176
+ each: ct,
1177
+ children: (h) => (() => {
1178
+ var n = Gt(), F = n.firstChild, X = F.firstChild;
1179
+ return n.$$click = () => L()(i().id, {
1180
+ fill: h.fill
1181
+ }), n.$$pointerdown = Q, k(n, w(ot, {}), null), P((I) => {
1182
+ var S = t("regionColor", t(h.color)), te = i().fill === h.fill, ne = `workbench-region-material__sample is-material-${i().material}`, ae = Ce({
1183
+ ...i(),
1184
+ fill: h.fill
1185
+ });
1186
+ return S !== I.e && s(n, "aria-label", I.e = S), te !== I.t && s(n, "aria-pressed", I.t = te), ne !== I.a && De(X, I.a = ne), I.o = he(X, ae, I.o), I;
1187
+ }, {
1188
+ e: void 0,
1189
+ t: void 0,
1190
+ a: void 0,
1191
+ o: void 0
1192
+ }), n;
1193
+ })()
1194
+ })), c;
1195
+ })();
1196
+ },
1197
+ get more() {
1198
+ return [(() => {
1199
+ var c = Ht(), h = c.firstChild;
1200
+ return k(c, () => t("opacity"), h), h.$$input = (n) => L()(i().id, {
1201
+ opacity: Number(n.currentTarget.value) / 100
1202
+ }), P(() => s(h, "aria-label", t("opacity"))), P(() => h.value = Math.round(i().opacity * 100)), c;
1203
+ })(), (() => {
1204
+ var c = we();
1205
+ return c.$$click = () => L()(i().id, {
1206
+ name: ""
1207
+ }), c.$$pointerdown = Q, k(c, () => t("clearName")), P(() => c.disabled = !i().name.trim()), c;
1208
+ })()];
1209
+ },
1210
+ get actions() {
1211
+ return [w(oe, {
1212
+ when: r,
1213
+ get children() {
1214
+ var c = we();
1215
+ return c.$$click = () => r?.duplicate({
1216
+ kind: "background_layer",
1217
+ id: i().id
1218
+ }), c.$$pointerdown = Q, k(c, w(ue, {
1219
+ name: "copy"
1220
+ })), P((h) => {
1221
+ var n = t("duplicate"), F = t("duplicate");
1222
+ return n !== h.e && s(c, "aria-label", h.e = n), F !== h.t && s(c, "title", h.t = F), h;
1223
+ }, {
1224
+ e: void 0,
1225
+ t: void 0
1226
+ }), c;
1227
+ }
1228
+ }), (() => {
1229
+ var c = He();
1230
+ return c.$$click = () => C()(i().id), c.$$pointerdown = Q, k(c, w(ue, {
1231
+ name: "trash"
1232
+ })), P(() => s(c, "aria-label", t("deleteRegion"))), c;
1233
+ })()];
1009
1234
  },
1010
1235
  get children() {
1011
- var h = Dt();
1012
- return h.$$click = () => p()(t().id, {
1013
- name: ""
1014
- }), h.$$pointerdown = K, C(h, () => n("clearName")), h;
1236
+ var c = Wt(), h = c.firstChild;
1237
+ return c.$$click = () => x()?.focus(), c.$$pointerdown = Q, k(c, w(ue, {
1238
+ name: "text"
1239
+ }), h), k(h, () => t(i().name.trim() ? "regionName" : "addName")), c;
1015
1240
  }
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;
1241
+ });
1075
1242
  }
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;
1243
+ }), m), U(m, "pointerdown", G.beginResize, !0), P((c) => {
1244
+ var h = i().id, n = g(), F = t("resizeRegion");
1245
+ return h !== c.e && s(d, "data-wb-object-id", c.e = h), c.t = he(d, n, c.t), F !== c.a && s(m, "aria-label", c.a = F), c;
1079
1246
  }, {
1080
1247
  e: void 0,
1081
1248
  t: void 0,
1082
1249
  a: void 0
1083
- }), P;
1250
+ }), d;
1084
1251
  })();
1085
1252
  }
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,
1253
+ function un(e) {
1254
+ const t = l(() => e.item), r = l(() => e.viewport), u = l(() => e.projection), o = l(() => e.preview), i = j(() => {
1255
+ const z = t(), O = Se(o(), "background_layer", z.id);
1256
+ return ze({
1257
+ geometry: Ee({
1258
+ preview: O,
1092
1259
  position: {
1093
- x: j.x,
1094
- y: j.y
1260
+ x: z.x,
1261
+ y: z.y
1095
1262
  },
1096
- width: j.width,
1097
- height: j.height
1263
+ width: z.width,
1264
+ height: z.height
1098
1265
  }),
1099
1266
  viewport: r(),
1100
1267
  projection: u()
1101
1268
  });
1102
- }), S = O(() => ({
1103
- ...pe(y()),
1104
- "--workbench-region-outline-scale": `${1 / Math.max(y().scale, 1e-3)}`,
1105
- ...Me(n())
1269
+ }), x = j(() => ({
1270
+ ...pe(i()),
1271
+ "--workbench-layer-control-inverse-scale": `${1 / Math.max(i().scale, 1e-3)}`,
1272
+ ...Ce(t())
1106
1273
  }));
1107
1274
  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;
1275
+ var z = Bt();
1276
+ return P((O) => {
1277
+ var B = `workbench-region-visibility-outline is-material-${t().material}`, D = !!e.selected, p = t().id, Y = x();
1278
+ return B !== O.e && De(z, O.e = B), D !== O.t && z.classList.toggle("is-selected-region", O.t = D), p !== O.a && s(z, "data-wb-object-id", O.a = p), O.o = he(z, Y, O.o), O;
1112
1279
  }, {
1113
1280
  e: void 0,
1114
1281
  t: void 0,
1115
- a: void 0
1116
- }), j;
1282
+ a: void 0,
1283
+ o: void 0
1284
+ }), z;
1117
1285
  })();
1118
1286
  }
1119
- function sn(e) {
1120
- const n = O(() => Ye(e.items)), r = O(() => Xe(e.items).map((u) => u.id));
1287
+ function vn(e) {
1288
+ const t = j(() => Xe(e.items)), r = j(() => Be(e.items).map((u) => u.id));
1121
1289
  return (() => {
1122
- var u = Ht();
1123
- return C(u, b(me, {
1290
+ var u = Xt();
1291
+ return k(u, w(de, {
1124
1292
  get each() {
1125
1293
  return r();
1126
1294
  },
1127
- children: (t) => {
1128
- const y = O(() => n().get(t) ?? null);
1129
- return b(ue, {
1295
+ children: (o) => {
1296
+ const i = j(() => t().get(o) ?? null);
1297
+ return w(oe, {
1130
1298
  get when() {
1131
- return y();
1299
+ return i();
1132
1300
  },
1133
- children: (S) => b(ln, {
1301
+ children: (x) => w(un, {
1134
1302
  get item() {
1135
- return S();
1303
+ return x();
1136
1304
  },
1137
1305
  get selected() {
1138
- return xe(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === t;
1306
+ return be(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === o;
1139
1307
  },
1140
1308
  get viewport() {
1141
1309
  return e.viewport;
@@ -1152,26 +1320,26 @@ function sn(e) {
1152
1320
  })), u;
1153
1321
  })();
1154
1322
  }
1155
- function Cn(e) {
1156
- const n = O(() => Ye(e.items)), r = O(() => Xe(e.items).map((u) => u.id));
1323
+ function pn(e) {
1324
+ const t = j(() => Xe(e.items)), r = j(() => Be(e.items).map((u) => u.id));
1157
1325
  return (() => {
1158
- var u = At();
1159
- return C(u, b(me, {
1326
+ var u = Yt();
1327
+ return k(u, w(de, {
1160
1328
  get each() {
1161
1329
  return r();
1162
1330
  },
1163
- children: (t) => {
1164
- const y = O(() => n().get(t) ?? null);
1165
- return b(ue, {
1331
+ children: (o) => {
1332
+ const i = j(() => t().get(o) ?? null);
1333
+ return w(oe, {
1166
1334
  get when() {
1167
- return y();
1335
+ return i();
1168
1336
  },
1169
- children: (S) => b(rn, {
1337
+ children: (x) => w(ln, {
1170
1338
  get item() {
1171
- return S();
1339
+ return x();
1172
1340
  },
1173
1341
  get selected() {
1174
- return xe(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === t;
1342
+ return be(() => e.selectedObject?.kind === "background_layer")() && e.selectedObject.id === o;
1175
1343
  },
1176
1344
  get editable() {
1177
1345
  return e.editable;
@@ -1209,35 +1377,35 @@ function Cn(e) {
1209
1377
  })
1210
1378
  });
1211
1379
  }
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;
1380
+ })), P((o) => {
1381
+ var i = !!e.editable, x = !!e.filtered;
1382
+ return i !== o.e && u.classList.toggle("is-editable", o.e = i), x !== o.t && u.classList.toggle("is-filtered-out", o.t = x), o;
1215
1383
  }, {
1216
1384
  e: void 0,
1217
1385
  t: void 0
1218
1386
  }), u;
1219
1387
  })();
1220
1388
  }
1221
- function Sn(e) {
1222
- const n = O(() => Ye(e.items)), r = O(() => Xe(e.items).map((u) => u.id));
1389
+ function En(e) {
1390
+ const t = j(() => Xe(e.items)), r = j(() => Be(e.items).map((u) => u.id));
1223
1391
  return (() => {
1224
- var u = Bt();
1225
- return C(u, b(me, {
1392
+ var u = Ut();
1393
+ return k(u, w(de, {
1226
1394
  get each() {
1227
1395
  return r();
1228
1396
  },
1229
- children: (t) => {
1230
- const y = O(() => n().get(t) ?? null);
1231
- return b(ue, {
1397
+ children: (o) => {
1398
+ const i = j(() => t().get(o) ?? null);
1399
+ return w(oe, {
1232
1400
  get when() {
1233
- return y();
1401
+ return i();
1234
1402
  },
1235
- children: (S) => b(on, {
1403
+ children: (x) => w(cn, {
1236
1404
  get item() {
1237
- return S();
1405
+ return x();
1238
1406
  },
1239
1407
  get selected() {
1240
- return xe(() => e.selectedObject?.kind === "annotation")() && e.selectedObject.id === t;
1408
+ return be(() => e.selectedObject?.kind === "annotation")() && e.selectedObject.id === o;
1241
1409
  },
1242
1410
  get editable() {
1243
1411
  return e.editable;
@@ -1275,25 +1443,25 @@ function Sn(e) {
1275
1443
  })
1276
1444
  });
1277
1445
  }
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;
1446
+ })), P((o) => {
1447
+ var i = !!e.editable, x = !!e.filtered;
1448
+ return i !== o.e && u.classList.toggle("is-editable", o.e = i), x !== o.t && u.classList.toggle("is-filtered-out", o.t = x), o;
1281
1449
  }, {
1282
1450
  e: void 0,
1283
1451
  t: void 0
1284
1452
  }), u;
1285
1453
  })();
1286
1454
  }
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);
1455
+ function Rn(e) {
1456
+ const t = j(() => e.selectedObject?.kind === "annotation" ? e.annotations.find((u) => u.id === e.selectedObject?.id && u.kind === "text") ?? null : null), r = j(() => e.selectedObject?.kind === "background_layer" ? e.backgroundLayers.find((u) => u.id === e.selectedObject?.id) ?? null : null);
1289
1457
  return (() => {
1290
- var u = Xt();
1291
- return C(u, b(ue, {
1458
+ var u = Kt();
1459
+ return k(u, w(oe, {
1292
1460
  get when() {
1293
1461
  return e.showRegionOutlines;
1294
1462
  },
1295
1463
  get children() {
1296
- return b(sn, {
1464
+ return w(vn, {
1297
1465
  get items() {
1298
1466
  return e.backgroundLayers;
1299
1467
  },
@@ -1311,16 +1479,16 @@ function _n(e) {
1311
1479
  }
1312
1480
  });
1313
1481
  }
1314
- }), null), C(u, b(ue, {
1482
+ }), null), k(u, w(oe, {
1315
1483
  get when() {
1316
- return xe(() => !!e.editable)() && r();
1484
+ return be(() => !!e.editable)() && r();
1317
1485
  },
1318
- children: (t) => b(cn, {
1486
+ children: (o) => w(sn, {
1319
1487
  get textEditorRegistry() {
1320
1488
  return e.textEditorRegistry;
1321
1489
  },
1322
1490
  get item() {
1323
- return t();
1491
+ return o();
1324
1492
  },
1325
1493
  get viewportScale() {
1326
1494
  return e.viewport.scale;
@@ -1347,13 +1515,13 @@ function _n(e) {
1347
1515
  return e.onDeleteBackgroundLayer;
1348
1516
  }
1349
1517
  })
1350
- }), null), C(u, b(ue, {
1518
+ }), null), k(u, w(oe, {
1351
1519
  get when() {
1352
- return xe(() => !!e.editable)() && n();
1520
+ return be(() => !!e.editable)() && t();
1353
1521
  },
1354
- children: (t) => b(an, {
1522
+ children: (o) => w(dn, {
1355
1523
  get item() {
1356
- return t();
1524
+ return o();
1357
1525
  },
1358
1526
  get viewportScale() {
1359
1527
  return e.viewport.scale;
@@ -1386,16 +1554,16 @@ function _n(e) {
1386
1554
  return e.onDeleteAnnotation;
1387
1555
  }
1388
1556
  })
1389
- }), null), F(() => u.classList.toggle("is-editable", !!e.editable)), u;
1557
+ }), null), P(() => u.classList.toggle("is-editable", !!e.editable)), u;
1390
1558
  })();
1391
1559
  }
1392
- lt(["pointerdown", "contextmenu", "click", "keydown", "input"]);
1560
+ ut(["pointerdown", "contextmenu", "keydown", "click", "input"]);
1393
1561
  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
1562
+ En as WorkbenchAnnotationLayerView,
1563
+ pn as WorkbenchBackgroundLayerView,
1564
+ ln as WorkbenchBackgroundRegion,
1565
+ Rn as WorkbenchLayerControlOverlayView,
1566
+ zn as WorkbenchStickyNote,
1567
+ cn as WorkbenchTextAnnotation,
1568
+ Sn as createWorkbenchTextEditorRegistry
1401
1569
  };