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