@floegence/floe-webapp-core 0.36.61 → 0.36.63

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