@floegence/floe-webapp-core 0.36.45 → 0.36.48

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