@floegence/floe-webapp-core 0.36.75 → 0.36.76
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/WorkbenchCanvas.d.ts +1 -0
- package/dist/components/workbench/WorkbenchCanvas.js +34 -25
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +1 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +18 -12
- package/dist/components/workbench/WorkbenchSurface.d.ts +6 -0
- package/dist/components/workbench/WorkbenchSurface.js +198 -161
- package/dist/components/workbench/WorkbenchWidget.d.ts +1 -0
- package/dist/components/workbench/WorkbenchWidget.js +183 -176
- package/dist/utils/uiFirstSelection.d.ts +2 -0
- package/dist/utils/uiFirstSelection.js +49 -45
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export interface WorkbenchCanvasProps {
|
|
|
28
28
|
onCanvasContextMenu: (event: InfiniteCanvasContextMenuEvent) => void;
|
|
29
29
|
onCanvasPointerDown?: (event: PointerEvent) => void;
|
|
30
30
|
onSelectWidget: (widgetId: string) => void;
|
|
31
|
+
onActivateWidget?: (widgetId: string) => void;
|
|
31
32
|
onWidgetContextMenu: (event: MouseEvent, item: WorkbenchWidgetItem) => void;
|
|
32
33
|
onClaimVisualFrontOwner: (widgetId: string) => void;
|
|
33
34
|
onCommitFront: (widgetId: string) => void;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { use as E, insert as w, createComponent as g, memo as y, effect as
|
|
2
|
-
import { createMemo as u, createSignal as _, Show as
|
|
1
|
+
import { use as E, insert as w, createComponent as g, memo as y, effect as F, template as x } from "solid-js/web";
|
|
2
|
+
import { createMemo as u, createSignal as _, Show as O, For as j } from "solid-js";
|
|
3
3
|
import { resolveWorkbenchInteractionAdapter as z } from "./workbenchInteractionAdapter.js";
|
|
4
4
|
import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as P, WORKBENCH_TEXT_FILTER_ID as q, WORKBENCH_STICKY_FILTER_ID as T } from "./types.js";
|
|
5
5
|
import { WorkbenchCanvasField as U } from "./WorkbenchCanvasField.js";
|
|
6
6
|
import { WorkbenchPlacementPreview as G } from "./WorkbenchPlacementPreview.js";
|
|
7
7
|
import { WorkbenchBackgroundLayerView as $, WorkbenchAnnotationLayerView as K, WorkbenchLayerControlOverlayView as H, createWorkbenchTextEditorRegistry as Z, WorkbenchStickyNote as X } from "./WorkbenchLayerObjects.js";
|
|
8
8
|
import { WorkbenchWidget as Y } from "./WorkbenchWidget.js";
|
|
9
|
-
import { createWorkbenchRenderLayerMap as J, resolveWorkbenchModeStrategy as Q, resolveWorkbenchWidgetRenderMode as
|
|
9
|
+
import { createWorkbenchRenderLayerMap as J, resolveWorkbenchModeStrategy as Q, resolveWorkbenchWidgetRenderMode as A } from "./workbenchHelpers.js";
|
|
10
10
|
import { createWorkbenchWidgetEnterMotionTracker as p } from "./workbenchMotion.js";
|
|
11
11
|
import { getWidgetEntry as R } from "./widgets/widgetRegistry.js";
|
|
12
12
|
import { InfiniteCanvas as ee } from "../ui/InfiniteCanvas.js";
|
|
13
|
-
var te = /* @__PURE__ */
|
|
13
|
+
var te = /* @__PURE__ */ x("<div class=workbench-canvas><div class=workbench-canvas__atmosphere aria-hidden=true>"), ne = /* @__PURE__ */ x("<div class=workbench-canvas__projected-layer><div class=workbench-canvas__projected-work-layer>");
|
|
14
14
|
function re(e) {
|
|
15
15
|
const a = u((c) => {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
16
|
+
const C = e.widgetById().get(e.widgetId);
|
|
17
|
+
if (C) return C;
|
|
18
18
|
if (c) return c;
|
|
19
19
|
throw new Error(`Workbench widget ${e.widgetId} is missing from the projected render map.`);
|
|
20
20
|
}), r = u(() => R(a().type, e.widgetDefinitions));
|
|
@@ -84,6 +84,9 @@ function re(e) {
|
|
|
84
84
|
get onSelect() {
|
|
85
85
|
return e.onSelectWidget;
|
|
86
86
|
},
|
|
87
|
+
get onActivate() {
|
|
88
|
+
return e.onActivateWidget;
|
|
89
|
+
},
|
|
87
90
|
get onContextMenu() {
|
|
88
91
|
return e.onWidgetContextMenu;
|
|
89
92
|
},
|
|
@@ -176,7 +179,7 @@ function oe(e) {
|
|
|
176
179
|
}
|
|
177
180
|
});
|
|
178
181
|
}
|
|
179
|
-
function
|
|
182
|
+
function Ce(e) {
|
|
180
183
|
const a = u(() => z(e.interactionAdapter)), r = p(() => e.widgets.map((n) => n.id)), c = u(() => {
|
|
181
184
|
const n = e.widgetMotionById;
|
|
182
185
|
if (!n)
|
|
@@ -187,13 +190,13 @@ function ve(e) {
|
|
|
187
190
|
for (const [o, d] of Object.entries(n))
|
|
188
191
|
d !== void 0 && (l[o] = d);
|
|
189
192
|
return l;
|
|
190
|
-
}),
|
|
193
|
+
}), C = u(() => new Map(e.widgets.map((n) => [n.id, n]))), B = u(() => (e.stickyNotes ?? []).map((n) => n.id)), N = u(() => new Map((e.stickyNotes ?? []).map((n) => [n.id, n]))), b = u(() => J([...e.widgets, ...e.stickyNotes ?? []])), I = Z(), [S, f] = _(null), s = u(() => Q(e.mode)), v = u(() => s().workLayerLocked), m = u(() => s().layerEditingEnabled), D = u(() => e.widgets.filter((n) => {
|
|
191
194
|
const l = R(n.type, e.widgetDefinitions);
|
|
192
|
-
return
|
|
195
|
+
return A(l) === "canvas_scaled";
|
|
193
196
|
})), h = u(() => e.widgets.filter((n) => {
|
|
194
197
|
const l = R(n.type, e.widgetDefinitions);
|
|
195
|
-
return
|
|
196
|
-
}).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []),
|
|
198
|
+
return A(l) === "projected_surface";
|
|
199
|
+
}).map((n) => n.id)), M = u(() => h().length > 0), V = u(() => M() ? [] : e.stickyNotes ?? []), W = () => e.canvasFrameSize.width > 0 && e.canvasFrameSize.height > 0, L = M;
|
|
197
200
|
return (() => {
|
|
198
201
|
var n = te();
|
|
199
202
|
n.firstChild;
|
|
@@ -233,7 +236,7 @@ function ve(e) {
|
|
|
233
236
|
get disablePanZoom() {
|
|
234
237
|
return e.locked;
|
|
235
238
|
},
|
|
236
|
-
overlay: (o) => [g(
|
|
239
|
+
overlay: (o) => [g(O, {
|
|
237
240
|
get when() {
|
|
238
241
|
return L();
|
|
239
242
|
},
|
|
@@ -301,7 +304,7 @@ function ve(e) {
|
|
|
301
304
|
get canvasFrameSize() {
|
|
302
305
|
return e.canvasFrameSize;
|
|
303
306
|
},
|
|
304
|
-
widgetById:
|
|
307
|
+
widgetById: C,
|
|
305
308
|
renderLayers: b,
|
|
306
309
|
get widgetMotionById() {
|
|
307
310
|
return c();
|
|
@@ -313,7 +316,7 @@ function ve(e) {
|
|
|
313
316
|
return e.visualFrontOwnerId;
|
|
314
317
|
},
|
|
315
318
|
get locked() {
|
|
316
|
-
return e.locked ||
|
|
319
|
+
return e.locked || v();
|
|
317
320
|
},
|
|
318
321
|
get filters() {
|
|
319
322
|
return e.filters;
|
|
@@ -333,6 +336,9 @@ function ve(e) {
|
|
|
333
336
|
get onSelectWidget() {
|
|
334
337
|
return e.onSelectWidget;
|
|
335
338
|
},
|
|
339
|
+
get onActivateWidget() {
|
|
340
|
+
return e.onActivateWidget;
|
|
341
|
+
},
|
|
336
342
|
get onWidgetContextMenu() {
|
|
337
343
|
return e.onWidgetContextMenu;
|
|
338
344
|
},
|
|
@@ -365,16 +371,16 @@ function ve(e) {
|
|
|
365
371
|
},
|
|
366
372
|
projectedViewport: o,
|
|
367
373
|
get surfaceReady() {
|
|
368
|
-
return
|
|
374
|
+
return W();
|
|
369
375
|
}
|
|
370
376
|
})
|
|
371
377
|
}), null), w(k, g(j, {
|
|
372
378
|
get each() {
|
|
373
|
-
return
|
|
379
|
+
return B();
|
|
374
380
|
},
|
|
375
381
|
children: (t) => g(oe, {
|
|
376
382
|
noteId: t,
|
|
377
|
-
stickyNoteById:
|
|
383
|
+
stickyNoteById: N,
|
|
378
384
|
get selectedObject() {
|
|
379
385
|
return e.selectedObject;
|
|
380
386
|
},
|
|
@@ -384,10 +390,10 @@ function ve(e) {
|
|
|
384
390
|
return e.visualFrontOwnerId;
|
|
385
391
|
},
|
|
386
392
|
get locked() {
|
|
387
|
-
return e.locked ||
|
|
393
|
+
return e.locked || v();
|
|
388
394
|
},
|
|
389
395
|
get filtered() {
|
|
390
|
-
return y(() => !
|
|
396
|
+
return y(() => !v())() && e.filters[T] === !1;
|
|
391
397
|
},
|
|
392
398
|
get onSelectStickyNote() {
|
|
393
399
|
return e.onSelectStickyNote;
|
|
@@ -420,7 +426,7 @@ function ve(e) {
|
|
|
420
426
|
return e.onLayoutInteractionEnd;
|
|
421
427
|
},
|
|
422
428
|
get surfaceReady() {
|
|
423
|
-
return
|
|
429
|
+
return W();
|
|
424
430
|
}
|
|
425
431
|
})
|
|
426
432
|
}), null), w(d, g(H, {
|
|
@@ -455,9 +461,9 @@ function ve(e) {
|
|
|
455
461
|
onCommitBackgroundResize: (t, i) => e.onCommitBackgroundResize?.(t, i),
|
|
456
462
|
onUpdateBackgroundLayer: (t, i) => e.onUpdateBackgroundLayer?.(t, i),
|
|
457
463
|
onDeleteBackgroundLayer: (t) => e.onDeleteBackgroundLayer?.(t)
|
|
458
|
-
}), null),
|
|
464
|
+
}), null), F(() => d.classList.toggle("is-work-layer-locked", !!v())), d;
|
|
459
465
|
}
|
|
460
|
-
}), g(
|
|
466
|
+
}), g(O, {
|
|
461
467
|
get when() {
|
|
462
468
|
return y(() => !!L())() ? e.placementPreview : null;
|
|
463
469
|
},
|
|
@@ -504,7 +510,7 @@ function ve(e) {
|
|
|
504
510
|
return e.visualFrontOwnerId;
|
|
505
511
|
},
|
|
506
512
|
get workLayerLocked() {
|
|
507
|
-
return
|
|
513
|
+
return v();
|
|
508
514
|
},
|
|
509
515
|
get annotationLayerEditable() {
|
|
510
516
|
return m();
|
|
@@ -536,6 +542,9 @@ function ve(e) {
|
|
|
536
542
|
get onSelectWidget() {
|
|
537
543
|
return e.onSelectWidget;
|
|
538
544
|
},
|
|
545
|
+
get onActivateWidget() {
|
|
546
|
+
return e.onActivateWidget;
|
|
547
|
+
},
|
|
539
548
|
get onWidgetContextMenu() {
|
|
540
549
|
return e.onWidgetContextMenu;
|
|
541
550
|
},
|
|
@@ -639,7 +648,7 @@ function ve(e) {
|
|
|
639
648
|
textEditorRegistry: I
|
|
640
649
|
});
|
|
641
650
|
}
|
|
642
|
-
}), null),
|
|
651
|
+
}), null), F((o) => {
|
|
643
652
|
var d = !!e.locked, k = !!m();
|
|
644
653
|
return d !== o.e && n.classList.toggle("is-locked", o.e = d), k !== o.t && n.classList.toggle("is-composition-mode", o.t = k), o;
|
|
645
654
|
}, {
|
|
@@ -649,5 +658,5 @@ function ve(e) {
|
|
|
649
658
|
})();
|
|
650
659
|
}
|
|
651
660
|
export {
|
|
652
|
-
|
|
661
|
+
Ce as WorkbenchCanvas
|
|
653
662
|
};
|
|
@@ -24,6 +24,7 @@ export interface WorkbenchCanvasFieldProps {
|
|
|
24
24
|
widgetMotionById?: Record<string, WorkbenchWidgetMotionIntent | null | undefined>;
|
|
25
25
|
interactionAdapter?: WorkbenchInteractionAdapter | ResolvedWorkbenchInteractionAdapter;
|
|
26
26
|
onSelectWidget: (widgetId: string) => void;
|
|
27
|
+
onActivateWidget?: (widgetId: string) => void;
|
|
27
28
|
onWidgetContextMenu: (event: MouseEvent, item: WorkbenchWidgetItem) => void;
|
|
28
29
|
onClaimVisualFrontOwner: (widgetId: string) => void;
|
|
29
30
|
onCommitFront: (widgetId: string) => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { insert as l, memo as u, createComponent as c, effect as
|
|
1
|
+
import { insert as l, memo as u, createComponent as c, effect as W, template as M } from "solid-js/web";
|
|
2
2
|
import { createMemo as a, createSignal as E, For as I } from "solid-js";
|
|
3
3
|
import { resolveWorkbenchInteractionAdapter as B } from "./workbenchInteractionAdapter.js";
|
|
4
|
-
import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as x, WORKBENCH_TEXT_FILTER_ID as N, WORKBENCH_STICKY_FILTER_ID as
|
|
5
|
-
import { createWorkbenchRenderLayerMap as
|
|
4
|
+
import { WORKBENCH_BACKGROUND_REGION_FILTER_ID as x, WORKBENCH_TEXT_FILTER_ID as N, WORKBENCH_STICKY_FILTER_ID as A } from "./types.js";
|
|
5
|
+
import { createWorkbenchRenderLayerMap as _ } from "./workbenchHelpers.js";
|
|
6
6
|
import { getWidgetEntry as D } from "./widgets/widgetRegistry.js";
|
|
7
7
|
import { WorkbenchWidget as V } from "./WorkbenchWidget.js";
|
|
8
|
-
import { WorkbenchPlacementPreview as
|
|
9
|
-
import { WorkbenchBackgroundLayerView as
|
|
10
|
-
var z = /* @__PURE__ */
|
|
8
|
+
import { WorkbenchPlacementPreview as P } from "./WorkbenchPlacementPreview.js";
|
|
9
|
+
import { WorkbenchBackgroundLayerView as j, WorkbenchAnnotationLayerView as s, WorkbenchLayerControlOverlayView as G, createWorkbenchTextEditorRegistry as T, WorkbenchStickyNote as q } from "./WorkbenchLayerObjects.js";
|
|
10
|
+
var z = /* @__PURE__ */ M("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true></div><div class=workbench-work-layer>");
|
|
11
11
|
function U(e) {
|
|
12
12
|
const d = a((i) => {
|
|
13
13
|
const m = e.widgetById().get(e.widgetId);
|
|
@@ -74,6 +74,9 @@ function U(e) {
|
|
|
74
74
|
get onSelect() {
|
|
75
75
|
return e.onSelectWidget;
|
|
76
76
|
},
|
|
77
|
+
get onActivate() {
|
|
78
|
+
return e.onActivateWidget;
|
|
79
|
+
},
|
|
77
80
|
get onContextMenu() {
|
|
78
81
|
return e.onWidgetContextMenu;
|
|
79
82
|
},
|
|
@@ -161,7 +164,7 @@ function $(e) {
|
|
|
161
164
|
});
|
|
162
165
|
}
|
|
163
166
|
function te(e) {
|
|
164
|
-
const d = a(() => B(e.interactionAdapter)), n = a(() => e.widgets.map((r) => r.id)), i = a(() => new Map(e.widgets.map((r) => [r.id, r]))), m = a(() => (e.stickyNotes ?? []).map((r) => r.id)), f = a(() => new Map((e.stickyNotes ?? []).map((r) => [r.id, r]))), R = T(), v = a(() => e.textEditorRegistry ?? R), C = a(() =>
|
|
167
|
+
const d = a(() => B(e.interactionAdapter)), n = a(() => e.widgets.map((r) => r.id)), i = a(() => new Map(e.widgets.map((r) => [r.id, r]))), m = a(() => (e.stickyNotes ?? []).map((r) => r.id)), f = a(() => new Map((e.stickyNotes ?? []).map((r) => [r.id, r]))), R = T(), v = a(() => e.textEditorRegistry ?? R), C = a(() => _([...e.widgets, ...e.stickyNotes ?? []])), b = a(() => e.selectedObject?.kind === "widget" ? e.selectedObject.id : e.selectedWidgetId), L = a(() => e.locked || !!e.workLayerLocked), [O, h] = E(null), y = a(() => e.layerGeometryPreview === void 0 ? O() : e.layerGeometryPreview), w = (r) => {
|
|
165
168
|
if (e.onLayerGeometryPreview) {
|
|
166
169
|
e.onLayerGeometryPreview(r);
|
|
167
170
|
return;
|
|
@@ -172,7 +175,7 @@ function te(e) {
|
|
|
172
175
|
var r = z(), F = r.firstChild, k = F.nextSibling;
|
|
173
176
|
return l(r, (() => {
|
|
174
177
|
var g = u(() => !!S());
|
|
175
|
-
return () => g() ? [c(
|
|
178
|
+
return () => g() ? [c(j, {
|
|
176
179
|
get items() {
|
|
177
180
|
return e.backgroundLayers ?? [];
|
|
178
181
|
},
|
|
@@ -195,7 +198,7 @@ function te(e) {
|
|
|
195
198
|
onSelect: (t) => e.onSelectBackgroundLayer?.(t),
|
|
196
199
|
onContextMenu: (t, o) => e.onBackgroundLayerContextMenu?.(t, o),
|
|
197
200
|
onCommitMove: (t, o) => e.onCommitBackgroundMove?.(t, o)
|
|
198
|
-
}), c(
|
|
201
|
+
}), c(s, {
|
|
199
202
|
get items() {
|
|
200
203
|
return e.annotations ?? [];
|
|
201
204
|
},
|
|
@@ -264,6 +267,9 @@ function te(e) {
|
|
|
264
267
|
get onSelectWidget() {
|
|
265
268
|
return e.onSelectWidget;
|
|
266
269
|
},
|
|
270
|
+
get onActivateWidget() {
|
|
271
|
+
return e.onActivateWidget;
|
|
272
|
+
},
|
|
267
273
|
get onWidgetContextMenu() {
|
|
268
274
|
return e.onWidgetContextMenu;
|
|
269
275
|
},
|
|
@@ -321,7 +327,7 @@ function te(e) {
|
|
|
321
327
|
return L();
|
|
322
328
|
},
|
|
323
329
|
get filtered() {
|
|
324
|
-
return u(() => !e.workLayerLocked)() && e.filters[
|
|
330
|
+
return u(() => !e.workLayerLocked)() && e.filters[A] === !1;
|
|
325
331
|
},
|
|
326
332
|
get onSelectStickyNote() {
|
|
327
333
|
return e.onSelectStickyNote;
|
|
@@ -391,7 +397,7 @@ function te(e) {
|
|
|
391
397
|
onUpdateBackgroundLayer: (t, o) => e.onUpdateBackgroundLayer?.(t, o),
|
|
392
398
|
onDeleteBackgroundLayer: (t) => e.onDeleteBackgroundLayer?.(t)
|
|
393
399
|
}) : null;
|
|
394
|
-
})(), null), l(r, c(
|
|
400
|
+
})(), null), l(r, c(P, {
|
|
395
401
|
get preview() {
|
|
396
402
|
return e.placementPreview;
|
|
397
403
|
},
|
|
@@ -399,7 +405,7 @@ function te(e) {
|
|
|
399
405
|
get viewport() {
|
|
400
406
|
return e.viewport;
|
|
401
407
|
}
|
|
402
|
-
}), null),
|
|
408
|
+
}), null), W(() => r.classList.toggle("is-work-layer-muted", !!e.workLayerLocked)), r;
|
|
403
409
|
})();
|
|
404
410
|
}
|
|
405
411
|
export {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type UIFirstSelectionEvent } from '../../utils/uiFirstSelection';
|
|
1
2
|
import { type WorkbenchContextMenuItem } from './WorkbenchContextMenu';
|
|
2
3
|
import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerDefaults, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
3
4
|
export interface WorkbenchCreateAtOptions {
|
|
@@ -67,5 +68,10 @@ export interface WorkbenchSurfaceProps {
|
|
|
67
68
|
onRequestDelete?: (widgetId: string) => void;
|
|
68
69
|
onLayoutInteractionStart?: () => void;
|
|
69
70
|
onLayoutInteractionEnd?: () => void;
|
|
71
|
+
/** Defer pointer/focus widget activation until the visual selection has painted. */
|
|
72
|
+
widgetActivationMode?: 'sync' | 'after-paint';
|
|
73
|
+
onWidgetActivationEvent?: (event: UIFirstSelectionEvent<string | null, {
|
|
74
|
+
bringToFront: boolean;
|
|
75
|
+
}>) => void;
|
|
70
76
|
}
|
|
71
77
|
export declare function WorkbenchSurface(props: WorkbenchSurfaceProps): import("solid-js").JSX.Element;
|