@floegence/floe-webapp-core 0.36.52 → 0.36.53

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,44 +1,42 @@
1
- import { createSignal as et, createMemo as u, onCleanup as Oe } from "solid-js";
2
- import { clientToCanvasWorld as Ce } from "../ui/canvasGeometry.js";
3
- import { ArrowUp as xt, Copy as M, Trash as j, MessageSquare as bt, Region as St, TextTool as Te } from "../icons/index.js";
4
- import { WORKBENCH_STICKY_FILTER_ID as Ne } from "./types.js";
5
- import { WORKBENCH_DEFAULT_STICKY_NOTE_COLOR as Ae, WORKBENCH_DEFAULT_TEXT_COLOR as Ie, WORKBENCH_DEFAULT_TEXT_FONT as Wt, WORKBENCH_BACKGROUND_MATERIALS as It, WORKBENCH_REGION_FILL_OPTIONS as Le, WORKBENCH_STICKY_NOTE_COLORS as De, WORKBENCH_DEFAULT_BACKGROUND_MATERIAL as pe, WORKBENCH_DEFAULT_REGION_FILL as Me } from "./workbenchOptions.js";
6
- import { resolveWorkbenchModeStrategy as Ot, createContextMenuPosition as je, createWorkbenchWidgetFrame as Fe, createWorkbenchId as S, createWorkbenchViewportCenteredOnWidget as Ct, findNearestWidget as Re, sanitizeFilters as ze, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Be, estimateContextMenuHeight as Xe, clampScale as Ee, WORKBENCH_MAX_SCALE as Ye, WORKBENCH_CANVAS_ZOOM_STEP as Tt, normalizeWorkbenchInteractionMode as He, createWorkbenchViewportAtScale as Ke, WORKBENCH_WORK_MIN_SCALE as Ve, createWorkbenchViewportFitForWidget as Ue } from "./workbenchHelpers.js";
7
- import { resolveWorkbenchWidgetDefinitions as Pe, getWidgetEntry as qe } from "./widgets/widgetRegistry.js";
8
- function Lt(o, d) {
9
- const s = o.findIndex((a) => a === d);
10
- return o[(s + 1) % o.length] ?? o[0];
1
+ import { createSignal as tt, createMemo as u, onCleanup as We } from "solid-js";
2
+ import { clientToCanvasWorld as Oe } from "../ui/canvasGeometry.js";
3
+ import { ArrowUp as ht, Copy as M, Trash as j, MessageSquare as xt, Region as bt, TextTool as Ce } from "../icons/index.js";
4
+ import { WORKBENCH_STICKY_FILTER_ID as Te } from "./types.js";
5
+ import { WORKBENCH_DEFAULT_STICKY_NOTE_COLOR as Ne, WORKBENCH_DEFAULT_TEXT_COLOR as Ae, WORKBENCH_DEFAULT_TEXT_FONT as St, WORKBENCH_BACKGROUND_MATERIALS as At, WORKBENCH_REGION_FILL_OPTIONS as Ie, WORKBENCH_STICKY_NOTE_COLORS as Le, WORKBENCH_DEFAULT_BACKGROUND_MATERIAL as De, WORKBENCH_DEFAULT_REGION_FILL as pe } from "./workbenchOptions.js";
6
+ import { resolveWorkbenchModeStrategy as Wt, createContextMenuPosition as Me, createWorkbenchWidgetFrame as je, createWorkbenchId as S, createWorkbenchViewportCenteredOnWidget as Ot, findNearestWidget as ze, sanitizeFilters as Fe, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Re, estimateContextMenuHeight as Be, clampScale as Xe, WORKBENCH_MAX_SCALE as Ee, WORKBENCH_CANVAS_ZOOM_STEP as Ct, normalizeWorkbenchInteractionMode as Ye, createWorkbenchViewportAtScale as He, WORKBENCH_WORK_MIN_SCALE as Ke, createWorkbenchViewportFitForWidget as Ve } from "./workbenchHelpers.js";
7
+ import { resolveWorkbenchWidgetDefinitions as Ue, getWidgetEntry as ve } from "./widgets/widgetRegistry.js";
8
+ import { resolveTextAnnotationDefaultSize as Pe, resolveBackgroundLayerDefaultSize as qe, resolveStickyNoteDefaultSize as Ge } from "./workbenchPlacement.js";
9
+ function It(o, d) {
10
+ const a = o.findIndex((s) => s === d);
11
+ return o[(a + 1) % o.length] ?? o[0];
11
12
  }
12
- function F(o, d) {
13
- return Number.isFinite(o) && o > 0 ? o : d;
13
+ function Tt(o, d, a) {
14
+ const s = String(d ?? "").trim();
15
+ return o.includes(s) ? s : a;
14
16
  }
15
- function Nt(o, d, s) {
16
- const a = String(d ?? "").trim();
17
- return o.includes(a) ? a : s;
17
+ function $e(o, d) {
18
+ const a = Number(o);
19
+ return Number.isFinite(a) ? Math.max(0.08, Math.min(1, a)) : d;
18
20
  }
19
- function Ge(o, d) {
20
- const s = Number(o);
21
- return Number.isFinite(s) ? Math.max(0.08, Math.min(1, s)) : d;
21
+ function Ze(o) {
22
+ return It(Le, o);
22
23
  }
23
- function $e(o) {
24
- return Lt(De, o);
24
+ function Je(o) {
25
+ return It(At, o);
25
26
  }
26
- function ve(o) {
27
- return Lt(It, o);
28
- }
29
- function At(o) {
27
+ function Nt(o) {
30
28
  return !("kind" in o);
31
29
  }
32
- function Ze(o, d) {
30
+ function Qe(o, d) {
33
31
  return o.z_index !== d.z_index ? o.z_index - d.z_index : o.created_at_unix_ms !== d.created_at_unix_ms ? o.created_at_unix_ms - d.created_at_unix_ms : o.id.localeCompare(d.id);
34
32
  }
35
- function nt(o) {
36
- return o.reduce((d, s) => Math.max(d, s.z_index), 1);
33
+ function et(o) {
34
+ return o.reduce((d, a) => Math.max(d, a.z_index), 1);
37
35
  }
38
- function Je(o, d) {
39
- return nt([...o, ...d]);
36
+ function tn(o, d) {
37
+ return et([...o, ...d]);
40
38
  }
41
- function Qe(o) {
39
+ function en(o) {
42
40
  return {
43
41
  id: o.id,
44
42
  type: "sticky_note",
@@ -51,43 +49,43 @@ function Qe(o) {
51
49
  created_at_unix_ms: o.created_at_unix_ms
52
50
  };
53
51
  }
54
- function tn(o, d, s) {
55
- const a = Date.now();
52
+ function nn(o, d, a) {
53
+ const s = Date.now(), { width: _, height: y } = Ge();
56
54
  return {
57
55
  id: S(),
58
56
  kind: "sticky_note",
59
57
  body: "Capture the thought, decision, or next step here.",
60
- color: Ae,
61
- x: o - 130,
62
- y: d - 92,
63
- width: 260,
64
- height: 184,
65
- z_index: s,
66
- created_at_unix_ms: a,
67
- updated_at_unix_ms: a
58
+ color: Ne,
59
+ x: o - _ / 2,
60
+ y: d - y / 2,
61
+ width: _,
62
+ height: y,
63
+ z_index: a,
64
+ created_at_unix_ms: s,
65
+ updated_at_unix_ms: s
68
66
  };
69
67
  }
70
- function en(o, d, s, a) {
71
- const _ = Date.now(), y = F(a?.width, 360), h = F(a?.height, 96);
68
+ function on(o, d, a, s) {
69
+ const _ = Date.now(), { width: y, height: h } = Pe(s);
72
70
  return {
73
71
  id: S(),
74
72
  kind: "text",
75
73
  text: "Label this area",
76
- font_family: a?.font_family ?? Wt.fontFamily,
77
- font_size: a?.font_size ?? 30,
78
- font_weight: a?.font_weight ?? Wt.fontWeight,
79
- color: a?.color ?? Ie,
80
- align: a?.align ?? "left",
74
+ font_family: s?.font_family ?? St.fontFamily,
75
+ font_size: s?.font_size ?? 30,
76
+ font_weight: s?.font_weight ?? St.fontWeight,
77
+ color: s?.color ?? Ae,
78
+ align: s?.align ?? "left",
81
79
  x: o - y / 2,
82
80
  y: d - h / 2,
83
81
  width: y,
84
82
  height: h,
85
- z_index: s,
83
+ z_index: a,
86
84
  created_at_unix_ms: _,
87
85
  updated_at_unix_ms: _
88
86
  };
89
87
  }
90
- function nn(o) {
88
+ function cn(o) {
91
89
  const d = Date.now();
92
90
  return {
93
91
  ...o,
@@ -99,24 +97,32 @@ function nn(o) {
99
97
  updated_at_unix_ms: d
100
98
  };
101
99
  }
102
- function on(o, d, s, a) {
103
- const _ = Date.now(), y = F(a?.width, 560), h = F(a?.height, 360), f = String(a?.name ?? "").trim() || "Focus area";
100
+ function dn(o, d, a, s) {
101
+ const _ = Date.now(), { width: y, height: h } = qe(s), f = String(s?.name ?? "").trim() || "Focus area";
104
102
  return {
105
103
  id: S(),
106
104
  name: f,
107
- fill: Nt(Le, a?.fill, Me),
108
- opacity: Ge(a?.opacity, 0.72),
109
- material: Nt(It, a?.material, pe),
105
+ fill: Tt(
106
+ Ie,
107
+ s?.fill,
108
+ pe
109
+ ),
110
+ opacity: $e(s?.opacity, 0.72),
111
+ material: Tt(
112
+ At,
113
+ s?.material,
114
+ De
115
+ ),
110
116
  x: o - y / 2,
111
117
  y: d - h / 2,
112
118
  width: y,
113
119
  height: h,
114
- z_index: s,
120
+ z_index: a,
115
121
  created_at_unix_ms: _,
116
122
  updated_at_unix_ms: _
117
123
  };
118
124
  }
119
- function cn(o) {
125
+ function an(o) {
120
126
  const d = Date.now();
121
127
  return {
122
128
  ...o,
@@ -129,42 +135,44 @@ function cn(o) {
129
135
  updated_at_unix_ms: d
130
136
  };
131
137
  }
132
- function xn(o) {
133
- const [d, s] = et(null), [a, _] = et(null), [y, h] = et({ width: 0, height: 0 });
138
+ function Wn(o) {
139
+ const [d, a] = tt(null), [s, _] = tt(null), [y, h] = tt({ width: 0, height: 0 });
134
140
  let f = null, C = null;
135
- const r = o.state, x = u(() => r().widgets), R = u(() => r().stickyNotes ?? []), it = u(() => r().annotations ?? []), ot = u(() => r().backgroundLayers ?? []), m = u(() => r().viewport), Dt = u(() => r().locked), z = u(() => r().filters), pt = u(() => r().selectedWidgetId), B = u(() => r().selectedObject ?? (r().selectedWidgetId ? { kind: "widget", id: r().selectedWidgetId } : null)), T = u(() => r().mode ?? "work"), Mt = u(() => Ot(T())), ct = u(() => r().activeTool ?? "select"), jt = u(() => r().theme), W = u(() => Je(x(), R())), Ft = u(() => `${Math.round(m().scale * 100)}%`), Rt = () => typeof o.widgetDefinitions == "function" ? o.widgetDefinitions() : o.widgetDefinitions, zt = () => typeof o.textAnnotationDefaults == "function" ? o.textAnnotationDefaults() : o.textAnnotationDefaults, Bt = () => typeof o.backgroundLayerDefaults == "function" ? o.backgroundLayerDefaults() : o.backgroundLayerDefaults, N = u(
136
- () => Pe(Rt())
137
- ), X = (e, t) => {
141
+ const r = o.state, x = u(() => r().widgets), z = u(() => r().stickyNotes ?? []), nt = u(() => r().annotations ?? []), it = u(() => r().backgroundLayers ?? []), m = u(() => r().viewport), Lt = u(() => r().locked), F = u(() => r().filters), Dt = u(() => r().selectedWidgetId), R = u(
142
+ () => r().selectedObject ?? (r().selectedWidgetId ? { kind: "widget", id: r().selectedWidgetId } : null)
143
+ ), T = u(() => r().mode ?? "work"), pt = u(() => Wt(T())), ot = u(() => r().activeTool ?? "select"), Mt = u(() => r().theme), W = u(() => tn(x(), z())), jt = u(() => `${Math.round(m().scale * 100)}%`), zt = () => typeof o.widgetDefinitions == "function" ? o.widgetDefinitions() : o.widgetDefinitions, Ft = () => typeof o.textAnnotationDefaults == "function" ? o.textAnnotationDefaults() : o.textAnnotationDefaults, Rt = () => typeof o.backgroundLayerDefaults == "function" ? o.backgroundLayerDefaults() : o.backgroundLayerDefaults, N = u(
144
+ () => Ue(zt())
145
+ ), B = (e, t) => {
138
146
  const n = Number.isFinite(e) && e > 0 ? e : 0, i = Number.isFinite(t) && t > 0 ? t : 0, c = { width: n, height: i }, g = y();
139
147
  return g.width === n && g.height === i ? g : (h(c), c);
140
- }, dt = () => {
148
+ }, ct = () => {
141
149
  C?.disconnect(), C = null;
142
- }, w = () => f ? X(f.clientWidth, f.clientHeight) : X(0, 0), Xt = (e) => {
150
+ }, w = () => f ? B(f.clientWidth, f.clientHeight) : B(0, 0), Bt = (e) => {
143
151
  if (f === (e ?? null)) {
144
152
  w();
145
153
  return;
146
154
  }
147
- dt(), f = e ?? null, w(), !(!f || typeof ResizeObserver > "u") && (C = new ResizeObserver((t) => {
155
+ ct(), f = e ?? null, w(), !(!f || typeof ResizeObserver > "u") && (C = new ResizeObserver((t) => {
148
156
  const n = t[0];
149
- X(
157
+ B(
150
158
  n?.contentRect.width ?? f?.clientWidth ?? 0,
151
159
  n?.contentRect.height ?? f?.clientHeight ?? 0
152
160
  );
153
161
  }), C.observe(f));
154
162
  };
155
- Oe(() => {
156
- dt(), f = null;
163
+ We(() => {
164
+ ct(), f = null;
157
165
  });
158
- const Et = (e) => {
159
- s({
166
+ const Xt = (e) => {
167
+ a({
160
168
  clientX: e.clientX,
161
169
  clientY: e.clientY,
162
170
  worldX: e.worldX,
163
171
  worldY: e.worldY,
164
172
  target: { kind: "canvas", mode: T() }
165
173
  });
166
- }, Yt = (e, t) => {
167
- b(t.id), s({
174
+ }, Et = (e, t) => {
175
+ b(t.id), a({
168
176
  clientX: e.clientX,
169
177
  clientY: e.clientY,
170
178
  worldX: t.x,
@@ -172,8 +180,8 @@ function xn(o) {
172
180
  target: { kind: "widget", id: t.id },
173
181
  widgetId: t.id
174
182
  });
175
- }, Ht = (e, t) => {
176
- L(t.id), s({
183
+ }, Yt = (e, t) => {
184
+ L(t.id), a({
177
185
  clientX: e.clientX,
178
186
  clientY: e.clientY,
179
187
  worldX: t.x,
@@ -181,25 +189,25 @@ function xn(o) {
181
189
  target: { kind: "sticky_note", id: t.id },
182
190
  widgetId: t.id
183
191
  });
184
- }, Kt = (e, t) => {
185
- s({
192
+ }, Ht = (e, t) => {
193
+ a({
186
194
  clientX: e.clientX,
187
195
  clientY: e.clientY,
188
196
  worldX: t.x,
189
197
  worldY: t.y,
190
198
  target: { kind: "annotation", id: t.id }
191
199
  });
192
- }, Vt = (e, t) => {
193
- s({
200
+ }, Kt = (e, t) => {
201
+ a({
194
202
  clientX: e.clientX,
195
203
  clientY: e.clientY,
196
204
  worldX: t.x,
197
205
  worldY: t.y,
198
206
  target: { kind: "background_layer", id: t.id }
199
207
  });
200
- }, l = () => s(null), Ut = (e) => r().widgets.find((t) => t.id === e) ?? null, A = (e) => r().widgets.find((t) => t.type === e) ?? null, E = (e) => r().stickyNotes?.find((t) => t.id === e) ?? null, at = (e) => r().annotations?.find((t) => t.id === e) ?? null, st = (e) => r().backgroundLayers?.find((t) => t.id === e) ?? null, Pt = (e) => e.target ? e.target : e.widgetId ? E(e.widgetId) ? { kind: "sticky_note", id: e.widgetId } : { kind: "widget", id: e.widgetId } : { kind: "canvas", mode: T() }, I = (e, t) => {
208
+ }, l = () => a(null), Vt = (e) => r().widgets.find((t) => t.id === e) ?? null, A = (e) => r().widgets.find((t) => t.type === e) ?? null, X = (e) => r().stickyNotes?.find((t) => t.id === e) ?? null, dt = (e) => r().annotations?.find((t) => t.id === e) ?? null, at = (e) => r().backgroundLayers?.find((t) => t.id === e) ?? null, Ut = (e) => e.target ? e.target : e.widgetId ? X(e.widgetId) ? { kind: "sticky_note", id: e.widgetId } : { kind: "widget", id: e.widgetId } : { kind: "canvas", mode: T() }, I = (e, t) => {
201
209
  if (t?.source === "pointer") {
202
- const n = f?.getBoundingClientRect(), i = n ? Ce(n, m(), {
210
+ const n = f?.getBoundingClientRect(), i = n ? Oe(n, m(), {
203
211
  clientX: t.clientX,
204
212
  clientY: t.clientY
205
213
  }) : null;
@@ -210,7 +218,7 @@ function xn(o) {
210
218
  worldX: e.worldX,
211
219
  worldY: e.worldY
212
220
  };
213
- }, qt = (e, t) => {
221
+ }, vt = (e, t) => {
214
222
  const n = e.singleton ? A(e.type) : null;
215
223
  return n ? {
216
224
  id: `goto-${e.type}`,
@@ -232,20 +240,20 @@ function xn(o) {
232
240
  icon: e.icon,
233
241
  onSelect: (i) => {
234
242
  const c = I(t, i);
235
- H(e.type, c.worldX, c.worldY), l();
243
+ Y(e.type, c.worldX, c.worldY), l();
236
244
  }
237
245
  };
238
- }, rt = u(() => {
246
+ }, st = u(() => {
239
247
  const e = d();
240
248
  if (!e) return [];
241
- const t = Pt(e);
249
+ const t = Ut(e);
242
250
  if (t.kind === "widget") {
243
251
  const n = x().find((c) => c.id === t.id), i = [];
244
252
  return n && (i.push({
245
253
  id: "bring-to-front",
246
254
  kind: "action",
247
255
  label: "Bring to Front",
248
- icon: xt,
256
+ icon: ht,
249
257
  onSelect: () => {
250
258
  b(n.id), l();
251
259
  }
@@ -255,7 +263,7 @@ function xn(o) {
255
263
  label: "Duplicate",
256
264
  icon: M,
257
265
  onSelect: () => {
258
- lt(n.type, n.x + 32, n.y + 32), l();
266
+ rt(n.type, n.x + 32, n.y + 32), l();
259
267
  }
260
268
  })), i.push({ id: "separator-delete", kind: "separator" }), i.push({
261
269
  id: "delete",
@@ -264,17 +272,17 @@ function xn(o) {
264
272
  icon: j,
265
273
  destructive: !0,
266
274
  onSelect: () => {
267
- K(t.id), l();
275
+ H(t.id), l();
268
276
  }
269
277
  }), i;
270
278
  }
271
279
  if (t.kind === "sticky_note") {
272
- const n = E(t.id), i = [];
280
+ const n = X(t.id), i = [];
273
281
  return n && (i.push({
274
282
  id: "bring-to-front",
275
283
  kind: "action",
276
284
  label: "Bring to Front",
277
- icon: xt,
285
+ icon: ht,
278
286
  onSelect: () => {
279
287
  L(n.id), l();
280
288
  }
@@ -290,9 +298,9 @@ function xn(o) {
290
298
  id: "change-color",
291
299
  kind: "action",
292
300
  label: "Change Color",
293
- icon: bt,
301
+ icon: xt,
294
302
  onSelect: () => {
295
- kt(n.id, { color: $e(n.color) }), l();
303
+ gt(n.id, { color: Ze(n.color) }), l();
296
304
  }
297
305
  })), i.push({ id: "separator-delete", kind: "separator" }), i.push({
298
306
  id: "delete",
@@ -301,19 +309,19 @@ function xn(o) {
301
309
  icon: j,
302
310
  destructive: !0,
303
311
  onSelect: () => {
304
- q(t.id), l();
312
+ v(t.id), l();
305
313
  }
306
314
  }), i;
307
315
  }
308
316
  if (t.kind === "annotation") {
309
- const n = at(t.id), i = [];
317
+ const n = dt(t.id), i = [];
310
318
  return n?.kind === "text" && i.push({
311
319
  id: "duplicate",
312
320
  kind: "action",
313
321
  label: "Duplicate Text",
314
322
  icon: M,
315
323
  onSelect: () => {
316
- ut(n), l();
324
+ lt(n), l();
317
325
  }
318
326
  }), i.push({ id: "separator-delete", kind: "separator" }), i.push({
319
327
  id: "delete",
@@ -322,27 +330,27 @@ function xn(o) {
322
330
  icon: j,
323
331
  destructive: !0,
324
332
  onSelect: () => {
325
- G(t.id), l();
333
+ P(t.id), l();
326
334
  }
327
335
  }), i;
328
336
  }
329
337
  if (t.kind === "background_layer") {
330
- const n = st(t.id), i = [];
338
+ const n = at(t.id), i = [];
331
339
  return n && (i.push({
332
340
  id: "duplicate",
333
341
  kind: "action",
334
342
  label: "Duplicate Region",
335
343
  icon: M,
336
344
  onSelect: () => {
337
- gt(n), l();
345
+ ut(n), l();
338
346
  }
339
347
  }), i.push({
340
348
  id: "change-material",
341
349
  kind: "action",
342
350
  label: "Change Material",
343
- icon: St,
351
+ icon: bt,
344
352
  onSelect: () => {
345
- ft(n.id, { material: ve(n.material) }), l();
353
+ kt(n.id, { material: Je(n.material) }), l();
346
354
  }
347
355
  })), i.push({ id: "separator-delete", kind: "separator" }), i.push({
348
356
  id: "delete",
@@ -351,7 +359,7 @@ function xn(o) {
351
359
  icon: j,
352
360
  destructive: !0,
353
361
  onSelect: () => {
354
- $(t.id), l();
362
+ q(t.id), l();
355
363
  }
356
364
  }), i;
357
365
  }
@@ -360,20 +368,20 @@ function xn(o) {
360
368
  id: "create-background-region",
361
369
  kind: "action",
362
370
  label: "Add Region",
363
- icon: St,
371
+ icon: bt,
364
372
  onSelect: (n) => {
365
373
  const i = I(e, n);
366
- P(i.worldX, i.worldY), l();
374
+ U(i.worldX, i.worldY), l();
367
375
  }
368
376
  },
369
377
  {
370
378
  id: "create-text",
371
379
  kind: "action",
372
380
  label: "Add Text",
373
- icon: Te,
381
+ icon: Ce,
374
382
  onSelect: (n) => {
375
383
  const i = I(e, n);
376
- U(i.worldX, i.worldY), l();
384
+ V(i.worldX, i.worldY), l();
377
385
  }
378
386
  }
379
387
  ] : [
@@ -381,29 +389,29 @@ function xn(o) {
381
389
  id: "create-sticky-note",
382
390
  kind: "action",
383
391
  label: "Add Sticky",
384
- icon: bt,
392
+ icon: xt,
385
393
  onSelect: (n) => {
386
394
  const i = I(e, n);
387
- V(i.worldX, i.worldY), l();
395
+ K(i.worldX, i.worldY), l();
388
396
  }
389
397
  },
390
- ...N().map((n) => qt(n, e))
398
+ ...N().map((n) => vt(n, e))
391
399
  ];
392
- }), Gt = u(() => {
400
+ }), Pt = u(() => {
393
401
  const e = d();
394
402
  if (!e) return;
395
- const t = rt(), n = t.filter((c) => c.kind === "action").length, i = t.filter((c) => c.kind === "separator").length;
396
- return je({
403
+ const t = st(), n = t.filter((c) => c.kind === "action").length, i = t.filter((c) => c.kind === "separator").length;
404
+ return Me({
397
405
  clientX: e.clientX,
398
406
  clientY: e.clientY,
399
- menuWidth: Be,
400
- menuHeight: Xe(n, i)
407
+ menuWidth: Re,
408
+ menuHeight: Be(n, i)
401
409
  });
402
- }), Y = (e, t) => {
403
- const n = qe(e, N()), i = n.singleton ? A(e) : null;
410
+ }), E = (e, t) => {
411
+ const n = ve(e, N()), i = n.singleton ? A(e) : null;
404
412
  if (i)
405
413
  return O(i, { centerViewport: !0 });
406
- const c = Fe(n, t), g = {
414
+ const c = je(n, t), g = {
407
415
  id: S(),
408
416
  type: e,
409
417
  title: n.defaultTitle,
@@ -422,27 +430,27 @@ function xn(o) {
422
430
  mode: "work",
423
431
  activeTool: "select"
424
432
  })), g;
425
- }, $t = (e, t, n) => Y(e, {
433
+ }, qt = (e, t, n) => E(e, {
426
434
  anchor: "top_left",
427
435
  worldX: t,
428
436
  worldY: n
429
- }), lt = (e, t, n) => Y(e, {
437
+ }), rt = (e, t, n) => E(e, {
430
438
  anchor: "top_left",
431
439
  worldX: t,
432
440
  worldY: n
433
- }), H = (e, t, n) => Y(e, {
441
+ }), Y = (e, t, n) => E(e, {
434
442
  anchor: "center",
435
443
  worldX: t,
436
444
  worldY: n
437
- }), K = (e) => {
445
+ }), H = (e) => {
438
446
  o.setState((t) => ({
439
447
  ...t,
440
448
  widgets: t.widgets.filter((n) => n.id !== e),
441
449
  selectedWidgetId: t.selectedWidgetId === e ? null : t.selectedWidgetId,
442
450
  selectedObject: t.selectedObject?.kind === "widget" && t.selectedObject.id === e ? null : t.selectedObject ?? null
443
451
  }));
444
- }, V = (e, t) => {
445
- const n = tn(e, t, W() + 1);
452
+ }, K = (e, t) => {
453
+ const n = nn(e, t, W() + 1);
446
454
  return o.setState((i) => ({
447
455
  ...i,
448
456
  stickyNotes: [...i.stickyNotes ?? [], n],
@@ -451,12 +459,12 @@ function xn(o) {
451
459
  mode: "work",
452
460
  activeTool: "select"
453
461
  })), n;
454
- }, U = (e, t) => {
455
- const n = en(
462
+ }, V = (e, t) => {
463
+ const n = on(
456
464
  e,
457
465
  t,
458
- nt(it()) + 1,
459
- zt()
466
+ et(nt()) + 1,
467
+ Ft()
460
468
  );
461
469
  return o.setState((i) => ({
462
470
  ...i,
@@ -466,8 +474,8 @@ function xn(o) {
466
474
  mode: "background",
467
475
  activeTool: "select"
468
476
  })), n;
469
- }, ut = (e) => {
470
- const t = nn(e);
477
+ }, lt = (e) => {
478
+ const t = cn(e);
471
479
  return o.setState((n) => ({
472
480
  ...n,
473
481
  annotations: [...n.annotations ?? [], t],
@@ -476,12 +484,12 @@ function xn(o) {
476
484
  mode: "background",
477
485
  activeTool: "select"
478
486
  })), t;
479
- }, P = (e, t) => {
480
- const n = on(
487
+ }, U = (e, t) => {
488
+ const n = dn(
481
489
  e,
482
490
  t,
483
- nt(ot()) + 1,
484
- Bt()
491
+ et(it()) + 1,
492
+ Rt()
485
493
  );
486
494
  return o.setState((i) => ({
487
495
  ...i,
@@ -491,8 +499,8 @@ function xn(o) {
491
499
  mode: "background",
492
500
  activeTool: "select"
493
501
  })), n;
494
- }, gt = (e) => {
495
- const t = cn(e);
502
+ }, ut = (e) => {
503
+ const t = an(e);
496
504
  return o.setState((n) => ({
497
505
  ...n,
498
506
  backgroundLayers: [...n.backgroundLayers ?? [], t],
@@ -501,16 +509,14 @@ function xn(o) {
501
509
  mode: "background",
502
510
  activeTool: "select"
503
511
  })), t;
504
- }, vt = (e) => {
512
+ }, Gt = (e) => {
505
513
  _(e);
506
514
  }, b = (e) => {
507
515
  _(e);
508
516
  const t = W(), n = x().find((i) => i.id === e);
509
517
  n && n.z_index < t && o.setState((i) => ({
510
518
  ...i,
511
- widgets: i.widgets.map(
512
- (c) => c.id === e ? { ...c, z_index: t + 1 } : c
513
- )
519
+ widgets: i.widgets.map((c) => c.id === e ? { ...c, z_index: t + 1 } : c)
514
520
  }));
515
521
  }, L = (e) => {
516
522
  _(e);
@@ -521,35 +527,35 @@ function xn(o) {
521
527
  (i) => i.id === e && i.z_index < t ? { ...i, z_index: t + 1, updated_at_unix_ms: Date.now() } : i
522
528
  )
523
529
  }));
524
- }, Zt = (e, t) => {
530
+ }, $t = (e, t) => {
525
531
  o.setState((n) => ({
526
532
  ...n,
527
533
  widgets: n.widgets.map(
528
534
  (i) => i.id === e ? { ...i, x: t.x, y: t.y } : i
529
535
  )
530
536
  }));
531
- }, Jt = (e, t) => {
537
+ }, Zt = (e, t) => {
532
538
  o.setState((n) => ({
533
539
  ...n,
534
540
  widgets: n.widgets.map(
535
541
  (i) => i.id === e ? { ...i, width: t.width, height: t.height } : i
536
542
  )
537
543
  }));
538
- }, Qt = (e, t) => {
544
+ }, Jt = (e, t) => {
539
545
  o.setState((n) => ({
540
546
  ...n,
541
547
  stickyNotes: (n.stickyNotes ?? []).map(
542
548
  (i) => i.id === e ? { ...i, x: t.x, y: t.y, updated_at_unix_ms: Date.now() } : i
543
549
  )
544
550
  }));
545
- }, te = (e, t) => {
551
+ }, Qt = (e, t) => {
546
552
  o.setState((n) => ({
547
553
  ...n,
548
554
  stickyNotes: (n.stickyNotes ?? []).map(
549
555
  (i) => i.id === e ? { ...i, width: t.width, height: t.height, updated_at_unix_ms: Date.now() } : i
550
556
  )
551
557
  }));
552
- }, kt = (e, t) => {
558
+ }, gt = (e, t) => {
553
559
  o.setState((n) => ({
554
560
  ...n,
555
561
  stickyNotes: (n.stickyNotes ?? []).map(
@@ -561,27 +567,27 @@ function xn(o) {
561
567
  } : i
562
568
  )
563
569
  }));
564
- }, q = (e) => {
570
+ }, v = (e) => {
565
571
  o.setState((t) => ({
566
572
  ...t,
567
573
  stickyNotes: (t.stickyNotes ?? []).filter((n) => n.id !== e),
568
574
  selectedObject: t.selectedObject?.kind === "sticky_note" && t.selectedObject.id === e ? null : t.selectedObject ?? null
569
575
  }));
570
- }, ee = (e, t) => {
576
+ }, te = (e, t) => {
571
577
  o.setState((n) => ({
572
578
  ...n,
573
579
  annotations: (n.annotations ?? []).map(
574
580
  (i) => i.id === e ? { ...i, x: t.x, y: t.y, updated_at_unix_ms: Date.now() } : i
575
581
  )
576
582
  }));
577
- }, ne = (e, t) => {
583
+ }, ee = (e, t) => {
578
584
  o.setState((n) => ({
579
585
  ...n,
580
586
  annotations: (n.annotations ?? []).map(
581
587
  (i) => i.id === e ? { ...i, width: t.width, height: t.height, updated_at_unix_ms: Date.now() } : i
582
588
  )
583
589
  }));
584
- }, ie = (e, t) => {
590
+ }, ne = (e, t) => {
585
591
  o.setState((n) => ({
586
592
  ...n,
587
593
  annotations: (n.annotations ?? []).map(
@@ -597,27 +603,27 @@ function xn(o) {
597
603
  } : i
598
604
  )
599
605
  }));
600
- }, G = (e) => {
606
+ }, P = (e) => {
601
607
  o.setState((t) => ({
602
608
  ...t,
603
609
  annotations: (t.annotations ?? []).filter((n) => n.id !== e),
604
610
  selectedObject: t.selectedObject?.kind === "annotation" && t.selectedObject.id === e ? null : t.selectedObject ?? null
605
611
  }));
606
- }, oe = (e, t) => {
612
+ }, ie = (e, t) => {
607
613
  o.setState((n) => ({
608
614
  ...n,
609
615
  backgroundLayers: (n.backgroundLayers ?? []).map(
610
616
  (i) => i.id === e ? { ...i, x: t.x, y: t.y, updated_at_unix_ms: Date.now() } : i
611
617
  )
612
618
  }));
613
- }, ce = (e, t) => {
619
+ }, oe = (e, t) => {
614
620
  o.setState((n) => ({
615
621
  ...n,
616
622
  backgroundLayers: (n.backgroundLayers ?? []).map(
617
623
  (i) => i.id === e ? { ...i, width: t.width, height: t.height, updated_at_unix_ms: Date.now() } : i
618
624
  )
619
625
  }));
620
- }, ft = (e, t) => {
626
+ }, kt = (e, t) => {
621
627
  o.setState((n) => ({
622
628
  ...n,
623
629
  backgroundLayers: (n.backgroundLayers ?? []).map(
@@ -631,72 +637,72 @@ function xn(o) {
631
637
  } : i
632
638
  )
633
639
  }));
634
- }, $ = (e) => {
640
+ }, q = (e) => {
635
641
  o.setState((t) => ({
636
642
  ...t,
637
643
  backgroundLayers: (t.backgroundLayers ?? []).filter((n) => n.id !== e),
638
644
  selectedObject: t.selectedObject?.kind === "background_layer" && t.selectedObject.id === e ? null : t.selectedObject ?? null
639
645
  }));
640
646
  };
641
- let v = 0;
642
- const Z = (e) => {
647
+ let G = 0;
648
+ const $ = (e) => {
643
649
  o.setState((t) => ({ ...t, viewport: e }));
644
- }, de = () => {
645
- v += 1;
650
+ }, ce = () => {
651
+ G += 1;
646
652
  }, D = (e) => {
647
- const t = m(), n = t.x, i = t.y, c = t.scale, g = performance.now(), k = 360, be = ++v, Se = (Q) => 1 - Math.pow(1 - Q, 3), wt = (Q) => {
648
- if (be !== v) return;
649
- const We = Q - g, ht = Math.min(Math.max(We / k, 0), 1), tt = Se(ht);
650
- Z({
651
- x: n + (e.x - n) * tt,
652
- y: i + (e.y - i) * tt,
653
- scale: c + (e.scale - c) * tt
654
- }), ht < 1 && requestAnimationFrame(wt);
653
+ const t = m(), n = t.x, i = t.y, c = t.scale, g = performance.now(), k = 360, xe = ++G, be = (J) => 1 - Math.pow(1 - J, 3), mt = (J) => {
654
+ if (xe !== G) return;
655
+ const Se = J - g, wt = Math.min(Math.max(Se / k, 0), 1), Q = be(wt);
656
+ $({
657
+ x: n + (e.x - n) * Q,
658
+ y: i + (e.y - i) * Q,
659
+ scale: c + (e.scale - c) * Q
660
+ }), wt < 1 && requestAnimationFrame(mt);
655
661
  };
656
- requestAnimationFrame(wt);
657
- }, ae = (e) => {
658
- const t = Ot(e), n = m();
662
+ requestAnimationFrame(mt);
663
+ }, de = (e) => {
664
+ const t = Wt(e), n = m();
659
665
  if (n.scale >= t.minScale) return;
660
666
  const i = w();
661
- D(Ke({
662
- viewport: n,
663
- scale: t.minScale,
664
- minScale: t.minScale,
665
- frameWidth: i.width,
666
- frameHeight: i.height
667
- }));
668
- }, _t = (e) => {
669
- const t = m(), n = w(), i = (n.width / 2 - t.x) / t.scale, c = (n.height / 2 - t.y) / t.scale, g = Ee(
670
- e === "in" ? t.scale * Tt : t.scale / Tt,
671
- Mt().minScale,
672
- Ye
667
+ D(
668
+ He({
669
+ viewport: n,
670
+ scale: t.minScale,
671
+ minScale: t.minScale,
672
+ frameWidth: i.width,
673
+ frameHeight: i.height
674
+ })
675
+ );
676
+ }, ft = (e) => {
677
+ const t = m(), n = w(), i = (n.width / 2 - t.x) / t.scale, c = (n.height / 2 - t.y) / t.scale, g = Xe(
678
+ e === "in" ? t.scale * Ct : t.scale / Ct,
679
+ pt().minScale,
680
+ Ee
673
681
  ), k = {
674
682
  x: n.width / 2 - i * g,
675
683
  y: n.height / 2 - c * g,
676
684
  scale: g
677
685
  };
678
- Z(k);
679
- }, se = () => {
686
+ $(k);
687
+ }, ae = () => {
680
688
  o.setState((e) => ({ ...e, locked: !e.locked }));
681
- }, re = (e) => {
689
+ }, se = (e) => {
682
690
  o.setState((t) => ({
683
691
  ...t,
684
692
  filters: { ...t.filters, [e]: !t.filters[e] }
685
693
  }));
686
- }, le = (e, t) => {
694
+ }, re = (e, t) => {
687
695
  o.setState((n) => {
688
- const i = { ...n.filters }, c = [...new Set(t.map((k) => String(k)).filter(Boolean))], g = c.length > 1 && c.every(
689
- (k) => i[k] !== !1 == (k === e)
690
- );
696
+ const i = { ...n.filters }, c = [...new Set(t.map((k) => String(k)).filter(Boolean))], g = c.length > 1 && c.every((k) => i[k] !== !1 == (k === e));
691
697
  for (const k of c)
692
698
  i[k] = g ? !0 : k === e;
693
699
  return { ...n, filters: i };
694
700
  });
695
- }, ue = () => {
701
+ }, le = () => {
696
702
  const e = N();
697
703
  o.setState((t) => ({
698
704
  ...t,
699
- filters: ze(void 0, e)
705
+ filters: Fe(void 0, e)
700
706
  }));
701
707
  }, p = (e) => {
702
708
  o.setState((t) => ({
@@ -706,18 +712,18 @@ function xn(o) {
706
712
  mode: t.mode === "background" ? "work" : t.mode,
707
713
  activeTool: "select"
708
714
  }));
709
- }, yt = () => {
715
+ }, _t = () => {
710
716
  o.setState(
711
717
  (e) => e.selectedWidgetId === null && !e.selectedObject ? e : { ...e, selectedWidgetId: null, selectedObject: null }
712
718
  );
713
- }, ge = (e) => {
719
+ }, ue = (e) => {
714
720
  o.setState((t) => ({
715
721
  ...t,
716
722
  selectedObject: e,
717
723
  selectedWidgetId: e?.kind === "widget" ? e.id : null,
718
724
  activeTool: "select"
719
725
  }));
720
- }, mt = (e) => {
726
+ }, yt = (e) => {
721
727
  o.setState((t) => ({
722
728
  ...t,
723
729
  selectedWidgetId: null,
@@ -725,7 +731,7 @@ function xn(o) {
725
731
  mode: "work",
726
732
  activeTool: "select"
727
733
  })), L(e);
728
- }, ke = (e) => {
734
+ }, ge = (e) => {
729
735
  o.setState((t) => ({
730
736
  ...t,
731
737
  selectedWidgetId: null,
@@ -733,7 +739,7 @@ function xn(o) {
733
739
  mode: "background",
734
740
  activeTool: "select"
735
741
  }));
736
- }, fe = (e) => {
742
+ }, ke = (e) => {
737
743
  o.setState((t) => ({
738
744
  ...t,
739
745
  selectedWidgetId: null,
@@ -741,80 +747,86 @@ function xn(o) {
741
747
  mode: "background",
742
748
  activeTool: "select"
743
749
  }));
744
- }, _e = (e) => {
745
- const t = He(e);
750
+ }, fe = (e) => {
751
+ const t = Ye(e);
746
752
  o.setState((n) => ({
747
753
  ...n,
748
754
  mode: t,
749
755
  activeTool: "select",
750
756
  selectedWidgetId: t === "work" ? n.selectedObject?.kind === "widget" ? n.selectedObject.id : n.selectedWidgetId : null,
751
757
  selectedObject: t === "work" ? n.selectedObject?.kind === "widget" || n.selectedObject?.kind === "sticky_note" ? n.selectedObject : n.selectedWidgetId ? { kind: "widget", id: n.selectedWidgetId } : null : n.selectedObject?.kind === "background_layer" || n.selectedObject?.kind === "annotation" ? n.selectedObject : null
752
- })), ae(t);
753
- }, ye = (e) => {
758
+ })), de(t);
759
+ }, _e = (e) => {
754
760
  o.setState((t) => ({
755
761
  ...t,
756
762
  activeTool: e,
757
763
  mode: e === "text" || e === "background-region" ? "background" : e === "sticky-note" ? "work" : t.mode ?? "work"
758
764
  }));
759
- }, me = (e, t) => {
760
- const n = ct();
761
- return n === "sticky-note" ? V(e, t) : n === "text" ? U(e, t) : n === "background-region" ? P(e, t) : null;
762
- }, we = () => {
765
+ }, ye = (e, t) => {
766
+ const n = ot();
767
+ return n === "sticky-note" ? K(e, t) : n === "text" ? V(e, t) : n === "background-region" ? U(e, t) : null;
768
+ }, me = () => {
763
769
  const e = w(), t = m();
764
770
  return {
765
771
  worldX: e.width > 0 ? (e.width / 2 - t.x) / t.scale : 240,
766
772
  worldY: e.height > 0 ? (e.height / 2 - t.y) / t.scale : 180
767
773
  };
768
- }, J = (e) => {
774
+ }, Z = (e) => {
769
775
  const t = w();
770
- t.width === 0 || t.height === 0 || D(Ct({
771
- widget: e,
772
- scale: m().scale,
773
- frameWidth: t.width,
774
- frameHeight: t.height
775
- }));
776
- }, he = (e) => {
776
+ t.width === 0 || t.height === 0 || D(
777
+ Ot({
778
+ widget: e,
779
+ scale: m().scale,
780
+ frameWidth: t.width,
781
+ frameHeight: t.height
782
+ })
783
+ );
784
+ }, we = (e) => {
777
785
  const t = w();
778
- t.width === 0 || t.height === 0 || D(Ue({
779
- widget: e,
780
- frameWidth: t.width,
781
- frameHeight: t.height
782
- }));
783
- }, xe = (e) => {
786
+ t.width === 0 || t.height === 0 || D(
787
+ Ve({
788
+ widget: e,
789
+ frameWidth: t.width,
790
+ frameHeight: t.height
791
+ })
792
+ );
793
+ }, he = (e) => {
784
794
  const t = w();
785
- t.width === 0 || t.height === 0 || D(Ct({
786
- widget: e,
787
- scale: Ve,
788
- frameWidth: t.width,
789
- frameHeight: t.height
790
- }));
791
- }, O = (e, t = {}) => (p(e.id), b(e.id), t.centerViewport !== !1 && J(e), e);
795
+ t.width === 0 || t.height === 0 || D(
796
+ Ot({
797
+ widget: e,
798
+ scale: Ke,
799
+ frameWidth: t.width,
800
+ frameHeight: t.height
801
+ })
802
+ );
803
+ }, O = (e, t = {}) => (p(e.id), b(e.id), t.centerViewport !== !1 && Z(e), e);
792
804
  return {
793
805
  widgets: x,
794
- stickyNotes: R,
795
- annotations: it,
796
- backgroundLayers: ot,
806
+ stickyNotes: z,
807
+ annotations: nt,
808
+ backgroundLayers: it,
797
809
  viewport: m,
798
810
  canvasFrameSize: y,
799
- locked: Dt,
800
- filters: z,
801
- selectedWidgetId: pt,
802
- selectedObject: B,
811
+ locked: Lt,
812
+ filters: F,
813
+ selectedWidgetId: Dt,
814
+ selectedObject: R,
803
815
  mode: T,
804
- activeTool: ct,
805
- theme: jt,
816
+ activeTool: ot,
817
+ theme: Mt,
806
818
  topZIndex: W,
807
- scaleLabel: Ft,
808
- optimisticFrontWidgetId: a,
819
+ scaleLabel: jt,
820
+ optimisticFrontWidgetId: s,
809
821
  widgetDefinitions: N,
810
- setCanvasFrameRef: Xt,
822
+ setCanvasFrameRef: Bt,
811
823
  contextMenu: {
812
824
  state: d,
813
- items: rt,
814
- position: Gt,
825
+ items: st,
826
+ position: Pt,
815
827
  close: l,
816
828
  retarget: (e) => {
817
- e.preventDefault(), e.stopPropagation(), s({
829
+ e.preventDefault(), e.stopPropagation(), a({
818
830
  clientX: e.clientX,
819
831
  clientY: e.clientY,
820
832
  worldX: 0,
@@ -823,108 +835,108 @@ function xn(o) {
823
835
  }
824
836
  },
825
837
  canvas: {
826
- openCanvasContextMenu: Et,
827
- openWidgetContextMenu: Yt,
828
- openStickyNoteContextMenu: Ht,
829
- openAnnotationContextMenu: Kt,
830
- openBackgroundLayerContextMenu: Vt,
838
+ openCanvasContextMenu: Xt,
839
+ openWidgetContextMenu: Et,
840
+ openStickyNoteContextMenu: Yt,
841
+ openAnnotationContextMenu: Ht,
842
+ openBackgroundLayerContextMenu: Kt,
831
843
  selectWidget: p,
832
- selectObject: ge,
833
- selectStickyNote: mt,
834
- selectAnnotation: ke,
835
- selectBackgroundLayer: fe,
836
- clearSelection: yt,
837
- startOptimisticFront: vt,
844
+ selectObject: ue,
845
+ selectStickyNote: yt,
846
+ selectAnnotation: ge,
847
+ selectBackgroundLayer: ke,
848
+ clearSelection: _t,
849
+ startOptimisticFront: Gt,
838
850
  commitFront: b,
839
- commitMove: Zt,
840
- commitResize: Jt,
851
+ commitMove: $t,
852
+ commitResize: Zt,
841
853
  commitStickyFront: L,
842
- commitStickyMove: Qt,
843
- commitStickyResize: te,
844
- commitAnnotationMove: ee,
845
- commitAnnotationResize: ne,
846
- commitBackgroundMove: oe,
847
- commitBackgroundResize: ce,
848
- commitViewport: Z,
849
- cancelViewportNavigation: de
854
+ commitStickyMove: Jt,
855
+ commitStickyResize: Qt,
856
+ commitAnnotationMove: te,
857
+ commitAnnotationResize: ee,
858
+ commitBackgroundMove: ie,
859
+ commitBackgroundResize: oe,
860
+ commitViewport: $,
861
+ cancelViewportNavigation: ce
850
862
  },
851
863
  hud: {
852
- zoomIn: () => _t("in"),
853
- zoomOut: () => _t("out")
864
+ zoomIn: () => ft("in"),
865
+ zoomOut: () => ft("out")
854
866
  },
855
867
  lock: {
856
- toggle: se
868
+ toggle: ae
857
869
  },
858
870
  filter: {
859
- toggle: re,
860
- solo: le,
861
- showAll: ue
871
+ toggle: se,
872
+ solo: re,
873
+ showAll: le
862
874
  },
863
875
  navigation: {
864
876
  handleArrowNavigation: (e) => {
865
- const t = B(), n = [
877
+ const t = R(), n = [
866
878
  ...x(),
867
- ...R().map((c) => Qe(c))
868
- ].sort(Ze), i = Re(
879
+ ...z().map((c) => en(c))
880
+ ].sort(Qe), i = ze(
869
881
  n,
870
882
  t?.kind === "widget" || t?.kind === "sticky_note" ? t.id : null,
871
883
  e,
872
884
  Object.fromEntries(
873
885
  n.map((c) => [
874
- At(c) ? c.type : "sticky_note",
875
- At(c) ? z()[c.type] !== !1 : z()[Ne] !== !1
886
+ Nt(c) ? c.type : "sticky_note",
887
+ Nt(c) ? F()[c.type] !== !1 : F()[Te] !== !1
876
888
  ])
877
889
  )
878
890
  );
879
- i && (x().some((c) => c.id === i.id) ? O(i) : mt(i.id));
891
+ i && (x().some((c) => c.id === i.id) ? O(i) : yt(i.id));
880
892
  },
881
- centerOnWidget: J,
893
+ centerOnWidget: Z,
882
894
  focusWidget: O,
883
- fitWidget: (e) => (p(e.id), b(e.id), he(e), e),
884
- overviewWidget: (e) => (p(e.id), b(e.id), xe(e), e)
895
+ fitWidget: (e) => (p(e.id), b(e.id), we(e), e),
896
+ overviewWidget: (e) => (p(e.id), b(e.id), he(e), e)
885
897
  },
886
898
  selection: {
887
- clear: yt
899
+ clear: _t
888
900
  },
889
901
  widgetActions: {
890
902
  deleteSelected: () => {
891
- const e = B();
892
- e && (e.kind === "widget" && K(e.id), e.kind === "sticky_note" && q(e.id), e.kind === "annotation" && G(e.id), e.kind === "background_layer" && $(e.id));
903
+ const e = R();
904
+ e && (e.kind === "widget" && H(e.id), e.kind === "sticky_note" && v(e.id), e.kind === "annotation" && P(e.id), e.kind === "background_layer" && q(e.id));
893
905
  },
894
- deleteWidget: K,
895
- deleteStickyNote: q,
896
- deleteAnnotation: G,
897
- deleteBackgroundLayer: $,
898
- addWidget: $t,
899
- addWidgetAtWorldTopLeft: lt,
900
- addWidgetAtWorldCenter: H,
901
- addStickyNoteAtCursor: V,
902
- addTextAnnotationAtCursor: U,
903
- duplicateTextAnnotationFrom: ut,
904
- addBackgroundLayerAtCursor: P,
905
- duplicateBackgroundLayerFrom: gt,
906
- createActiveToolAt: me,
906
+ deleteWidget: H,
907
+ deleteStickyNote: v,
908
+ deleteAnnotation: P,
909
+ deleteBackgroundLayer: q,
910
+ addWidget: qt,
911
+ addWidgetAtWorldTopLeft: rt,
912
+ addWidgetAtWorldCenter: Y,
913
+ addStickyNoteAtCursor: K,
914
+ addTextAnnotationAtCursor: V,
915
+ duplicateTextAnnotationFrom: lt,
916
+ addBackgroundLayerAtCursor: U,
917
+ duplicateBackgroundLayerFrom: ut,
918
+ createActiveToolAt: ye,
907
919
  ensureWidget: (e, t) => {
908
920
  const n = A(e);
909
921
  if (n)
910
922
  return O(n, { centerViewport: t?.centerViewport ?? !0 });
911
- const i = we(), c = H(
923
+ const i = me(), c = Y(
912
924
  e,
913
925
  t?.worldX ?? i.worldX,
914
926
  t?.worldY ?? i.worldY
915
927
  );
916
- return (t?.centerViewport ?? !0) && c && J(c), c;
928
+ return (t?.centerViewport ?? !0) && c && Z(c), c;
917
929
  },
918
- updateStickyNote: kt,
919
- updateTextAnnotation: ie,
920
- updateBackgroundLayer: ft
930
+ updateStickyNote: gt,
931
+ updateTextAnnotation: ne,
932
+ updateBackgroundLayer: kt
921
933
  },
922
934
  queries: {
923
935
  findWidgetByType: A,
924
- findWidgetById: Ut,
925
- findStickyNoteById: E,
926
- findAnnotationById: at,
927
- findBackgroundLayerById: st
936
+ findWidgetById: Vt,
937
+ findStickyNoteById: X,
938
+ findAnnotationById: dt,
939
+ findBackgroundLayerById: at
928
940
  },
929
941
  appearance: {
930
942
  setTheme: (e) => {
@@ -932,8 +944,8 @@ function xn(o) {
932
944
  }
933
945
  },
934
946
  modes: {
935
- setMode: _e,
936
- setActiveTool: ye
947
+ setMode: fe,
948
+ setActiveTool: _e
937
949
  },
938
950
  handleCloseRequest: () => {
939
951
  if (d()) {
@@ -945,5 +957,5 @@ function xn(o) {
945
957
  };
946
958
  }
947
959
  export {
948
- xn as useWorkbenchModel
960
+ Wn as useWorkbenchModel
949
961
  };