@floegence/floe-webapp-core 0.53.3 → 0.54.0

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