@floegence/floe-webapp-core 0.96.0 → 0.97.1
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/notes/useNotesOverlayModel.d.ts +3 -1
- package/dist/components/notes/useNotesOverlayModel.js +63 -63
- package/dist/components/ui/ContextMenuActions.d.ts +5 -0
- package/dist/components/ui/ContextMenuActions.js +140 -136
- package/dist/components/ui/SurfaceAnchoredLayer.d.ts +2 -0
- package/dist/components/ui/SurfaceAnchoredLayer.js +61 -61
- package/dist/components/ui/contextSource.d.ts +7 -1
- package/dist/components/ui/contextSource.js +54 -31
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/workbench/WorkbenchSurface.js +48 -45
- package/dist/full.js +572 -571
- package/dist/styles.css +1 -1
- package/dist/ui.css +11 -1
- package/dist/ui.js +178 -177
- package/package.json +1 -1
|
@@ -1,59 +1,82 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
const
|
|
5
|
-
const t =
|
|
1
|
+
function g(i) {
|
|
2
|
+
const r = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
let o, a = "";
|
|
4
|
+
const u = (e) => e.enabled?.() !== !1 && e.element.isConnected && !e.element.closest('[hidden], [inert], [aria-hidden="true"]'), f = (e) => {
|
|
5
|
+
const t = i.activeElement;
|
|
6
6
|
if (t && e.element.contains(t) && (t instanceof HTMLTextAreaElement || t instanceof HTMLInputElement))
|
|
7
7
|
return t instanceof HTMLInputElement && t.type === "password" ? "" : t.value.slice(t.selectionStart ?? 0, t.selectionEnd ?? 0);
|
|
8
|
-
const n =
|
|
8
|
+
const n = i.getSelection();
|
|
9
9
|
return n?.anchorNode && n.focusNode && e.element.contains(n.anchorNode) && e.element.contains(n.focusNode) ? n.toString() : "";
|
|
10
|
-
},
|
|
10
|
+
}, c = (e) => {
|
|
11
11
|
if (!(e instanceof Node)) return;
|
|
12
|
-
let t;
|
|
13
|
-
for (
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
let t = e;
|
|
13
|
+
for (; t; ) {
|
|
14
|
+
const n = l.get(t);
|
|
15
|
+
if (n) return n;
|
|
16
|
+
t = t.parentNode ?? (t instanceof ShadowRoot ? t.host : null);
|
|
17
|
+
}
|
|
16
18
|
}, v = (e) => {
|
|
17
|
-
!e || !
|
|
18
|
-
},
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
(
|
|
19
|
+
!e || !u(e) || (e !== o && (a = ""), o = e, a = f(e));
|
|
20
|
+
}, m = (e) => {
|
|
21
|
+
if (o) {
|
|
22
|
+
const n = f(o);
|
|
23
|
+
(n || o.element.contains(i.activeElement)) && (a = n);
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const t = c(e.composedPath()[0] ?? e.target);
|
|
26
|
+
t?.activateOnInteraction !== !1 && v(t);
|
|
27
|
+
}, h = () => {
|
|
28
|
+
if (!o) return;
|
|
29
|
+
const e = f(o);
|
|
30
|
+
(e || o.element.contains(i.activeElement) || i.activeElement === i.body) && (a = e);
|
|
28
31
|
};
|
|
29
|
-
return
|
|
32
|
+
return i.addEventListener("pointerdown", m, !0), i.addEventListener("focusin", m, !0), i.addEventListener("selectionchange", h), {
|
|
30
33
|
register(e) {
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
const t = r.get(e.id);
|
|
35
|
+
return t && l.get(t.element) === t && l.delete(t.element), r.set(e.id, e), l.set(e.element, e), () => {
|
|
36
|
+
r.get(e.id) === e && r.delete(e.id), l.get(e.element) === e && l.delete(e.element), o === e && (o = void 0, a = "");
|
|
33
37
|
};
|
|
34
38
|
},
|
|
35
39
|
/** Hosts may forward activation from their authenticated embedded channel. */
|
|
36
40
|
activate(e) {
|
|
37
|
-
v(
|
|
41
|
+
v(r.get(e));
|
|
38
42
|
},
|
|
39
43
|
capture(e) {
|
|
40
|
-
const t = e ?
|
|
41
|
-
if (!t || !
|
|
44
|
+
const t = e ? c(e) : o;
|
|
45
|
+
if (!t || !u(t) || r.get(t.id) !== t) return;
|
|
42
46
|
const n = t.element.getBoundingClientRect();
|
|
43
47
|
if (!(n.width <= 0 || n.height <= 0))
|
|
44
48
|
return {
|
|
45
49
|
id: t.id,
|
|
46
50
|
element: t.element,
|
|
47
|
-
value: t.read(),
|
|
48
|
-
selection:
|
|
51
|
+
value: t.read(e),
|
|
52
|
+
selection: f(t) || (t === o ? a : ""),
|
|
49
53
|
rect: { x: n.x, y: n.y, width: n.width, height: n.height }
|
|
50
54
|
};
|
|
51
55
|
},
|
|
56
|
+
/** Explicit-target capture never inherits an unrelated or cached selection. */
|
|
57
|
+
captureTarget(e, t = "") {
|
|
58
|
+
const n = c(e);
|
|
59
|
+
if (!n || !u(n) || r.get(n.id) !== n) return;
|
|
60
|
+
const s = n.element.getBoundingClientRect();
|
|
61
|
+
if (!(s.width <= 0 || s.height <= 0))
|
|
62
|
+
return {
|
|
63
|
+
id: n.id,
|
|
64
|
+
element: n.element,
|
|
65
|
+
value: n.read(e),
|
|
66
|
+
selection: (() => {
|
|
67
|
+
const d = i.getSelection();
|
|
68
|
+
return t && d?.toString() === t && d.anchorNode && d.focusNode && (c(d.anchorNode) !== n || c(d.focusNode) !== n) ? "" : t;
|
|
69
|
+
})(),
|
|
70
|
+
rect: { x: s.x, y: s.y, width: s.width, height: s.height }
|
|
71
|
+
};
|
|
72
|
+
},
|
|
52
73
|
dispose() {
|
|
53
|
-
|
|
74
|
+
i.removeEventListener("pointerdown", m, !0), i.removeEventListener("focusin", m, !0), i.removeEventListener("selectionchange", h);
|
|
75
|
+
for (const e of r.values()) l.delete(e.element);
|
|
76
|
+
r.clear(), o = void 0, a = "";
|
|
54
77
|
}
|
|
55
78
|
};
|
|
56
79
|
}
|
|
57
80
|
export {
|
|
58
|
-
|
|
81
|
+
g as createContextSourceRegistry
|
|
59
82
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ContextMenuActions, ContextMenuActionItems, useContextMenuActions, type ContextMenuEditingLabels, type ContextMenuActionRequest, type ContextMenuAction, type ContextMenuRequest, } from './ContextMenuActions';
|
|
1
|
+
export { ContextMenuActions, ContextMenuActionItems, ContextMenuActionIcon, useContextMenuActions, type ContextMenuEditingLabels, type ContextMenuActionRequest, type ContextMenuAction, type ContextMenuRequest, } from './ContextMenuActions';
|
|
2
2
|
export { createContextSourceRegistry, type ContextSource, type ContextSourceSnapshot, } from './contextSource';
|
|
3
3
|
export { PromptCard, capturePromptCardAnchor, type PromptCardProps } from './PromptCard';
|
|
4
4
|
export { FeedbackIndicator, type FeedbackIndicatorProps, type FeedbackIndicatorEntry, } from './FeedbackIndicator';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { createComponent as l, use as ut, spread as lt, mergeProps as gt, insert as C, Portal as ft, addEventListener as wt, template as P, delegateEvents as mt } from "solid-js/web";
|
|
2
|
-
import { useContextMenuActions as kt } from "../ui/ContextMenuActions.js";
|
|
3
|
-
import { WorkbenchCompositionActionsContext as
|
|
4
|
-
import { createMemo as g, createSignal as I, untrack as b, createEffect as h, onCleanup as W, Show as
|
|
2
|
+
import { useContextMenuActions as kt, ContextMenuActionIcon as vt } from "../ui/ContextMenuActions.js";
|
|
3
|
+
import { WorkbenchCompositionActionsContext as yt, WorkbenchCompositionMessagesContext as At } from "./workbenchCompositionMessages.js";
|
|
4
|
+
import { createMemo as g, createSignal as I, untrack as b, createEffect as h, onCleanup as W, Show as Ct } from "solid-js";
|
|
5
5
|
import { clientToCanvasWorld as E } from "../ui/canvasGeometry.js";
|
|
6
|
-
import { createUIFirstSelection as
|
|
7
|
-
import { WorkbenchCanvas as
|
|
8
|
-
import { WorkbenchContextMenu as
|
|
9
|
-
import { WorkbenchDock as
|
|
10
|
-
import { WorkbenchHud as
|
|
11
|
-
import { WorkbenchLockButton as
|
|
12
|
-
import { installWorkbenchContextMenuDismissListeners as
|
|
13
|
-
import { createContextMenuPosition as
|
|
14
|
-
import { resolveWorkbenchWidgetPlacementPreview as
|
|
15
|
-
import { useWorkbenchModel as
|
|
16
|
-
import { sortWorkbenchDockFocusCandidates as
|
|
17
|
-
import { resolveWorkbenchInteractionAdapter as
|
|
18
|
-
import { SURFACE_PORTAL_LAYER_ATTR as
|
|
19
|
-
var
|
|
20
|
-
const
|
|
6
|
+
import { createUIFirstSelection as bt } from "../../utils/uiFirstSelection.js";
|
|
7
|
+
import { WorkbenchCanvas as ht } from "./WorkbenchCanvas.js";
|
|
8
|
+
import { WorkbenchContextMenu as Wt } from "./WorkbenchContextMenu.js";
|
|
9
|
+
import { WorkbenchDock as pt } from "./WorkbenchFilterBar.js";
|
|
10
|
+
import { WorkbenchHud as St } from "./WorkbenchHud.js";
|
|
11
|
+
import { WorkbenchLockButton as xt } from "./WorkbenchLockButton.js";
|
|
12
|
+
import { installWorkbenchContextMenuDismissListeners as It } from "./workbenchContextMenuDismiss.js";
|
|
13
|
+
import { createContextMenuPosition as Mt, WORKBENCH_CONTEXT_MENU_WIDTH_PX as Dt, estimateContextMenuHeight as Lt } from "./workbenchHelpers.js";
|
|
14
|
+
import { resolveWorkbenchWidgetPlacementPreview as Ft, resolveWorkbenchToolPlacementPreview as Tt } from "./workbenchPlacement.js";
|
|
15
|
+
import { useWorkbenchModel as Bt } from "./useWorkbenchModel.js";
|
|
16
|
+
import { sortWorkbenchDockFocusCandidates as _t, workbenchDockFocusCandidateKey as R, resolveWorkbenchDockFocusCycle as Ot } from "./workbenchDockFocusCycle.js";
|
|
17
|
+
import { resolveWorkbenchInteractionAdapter as Et } from "./workbenchInteractionAdapter.js";
|
|
18
|
+
import { SURFACE_PORTAL_LAYER_ATTR as Rt, DIALOG_SURFACE_HOST_ATTR as Nt } from "../ui/dialogSurfaceScope.js";
|
|
19
|
+
var Pt = /* @__PURE__ */ P("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), Xt = /* @__PURE__ */ P("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
|
|
20
|
+
const qt = "F1";
|
|
21
21
|
function N(c) {
|
|
22
22
|
if (c)
|
|
23
23
|
try {
|
|
@@ -28,8 +28,8 @@ function N(c) {
|
|
|
28
28
|
c.focus();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const X = g(() => c.compositionMessages), e =
|
|
31
|
+
function ae(c) {
|
|
32
|
+
const X = g(() => c.compositionMessages), e = Bt({
|
|
33
33
|
state: () => c.state(),
|
|
34
34
|
setState: (t) => c.setState(t),
|
|
35
35
|
widgetDefinitions: () => c.widgetDefinitions,
|
|
@@ -37,7 +37,7 @@ function ce(c) {
|
|
|
37
37
|
backgroundLayerDefaults: () => c.backgroundLayerDefaults,
|
|
38
38
|
onClose: () => {
|
|
39
39
|
}
|
|
40
|
-
}), u =
|
|
40
|
+
}), u = bt({
|
|
41
41
|
committed: e.selectedWidgetId,
|
|
42
42
|
commitEqualRequests: !0,
|
|
43
43
|
commit: (t, n) => {
|
|
@@ -74,7 +74,7 @@ function ce(c) {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
e.canvas.selectWidget(t), e.canvas.commitFront(t);
|
|
77
|
-
}, [f, z] = I(null), [V, H] = I(null), d = g(() =>
|
|
77
|
+
}, [f, z] = I(null), [V, H] = I(null), d = g(() => Et(c.interactionAdapter)), [D, m] = I(b(() => d().createInitialInputOwner())), L = g(() => {
|
|
78
78
|
const t = c.launcherWidgetTypes;
|
|
79
79
|
return !t || t.length <= 0 ? null : new Set(t);
|
|
80
80
|
}), U = g(() => {
|
|
@@ -84,7 +84,10 @@ function ce(c) {
|
|
|
84
84
|
id: t.id,
|
|
85
85
|
kind: "action",
|
|
86
86
|
label: t.label,
|
|
87
|
-
icon: () =>
|
|
87
|
+
icon: (n) => vt({
|
|
88
|
+
icon: t.icon,
|
|
89
|
+
class: n.class
|
|
90
|
+
}),
|
|
88
91
|
disabled: t.disabled,
|
|
89
92
|
onSelect: () => {
|
|
90
93
|
e.contextMenu.close(), t.onSelect();
|
|
@@ -110,11 +113,11 @@ function ce(c) {
|
|
|
110
113
|
const t = e.contextMenu.state();
|
|
111
114
|
if (!t) return;
|
|
112
115
|
const n = F(), o = n.filter((i) => i.kind === "action").length, r = n.filter((i) => i.kind === "separator").length;
|
|
113
|
-
return
|
|
116
|
+
return Mt({
|
|
114
117
|
clientX: t.clientX,
|
|
115
118
|
clientY: t.clientY,
|
|
116
|
-
menuWidth:
|
|
117
|
-
menuHeight:
|
|
119
|
+
menuWidth: Dt,
|
|
120
|
+
menuHeight: Lt(o, r)
|
|
118
121
|
});
|
|
119
122
|
}), B = (t, n, o) => {
|
|
120
123
|
const r = d(), i = r.findWidgetRoot(t), a = r.readWidgetId(i);
|
|
@@ -220,7 +223,7 @@ function ce(c) {
|
|
|
220
223
|
id: i.id
|
|
221
224
|
};
|
|
222
225
|
}
|
|
223
|
-
const r =
|
|
226
|
+
const r = Ot({
|
|
224
227
|
dockItemKey: G(t),
|
|
225
228
|
candidates: n,
|
|
226
229
|
selectedObject: o,
|
|
@@ -228,7 +231,7 @@ function ce(c) {
|
|
|
228
231
|
});
|
|
229
232
|
y = r.session, r.target && Q(r.target);
|
|
230
233
|
}, nt = (t) => {
|
|
231
|
-
const n =
|
|
234
|
+
const n = _t(S(t)), o = p(), r = o ? R(o) : null, i = r ? n.findIndex((a) => R(a) === r) : -1;
|
|
232
235
|
return {
|
|
233
236
|
count: n.length,
|
|
234
237
|
currentIndex: i >= 0 ? i : null,
|
|
@@ -300,10 +303,10 @@ function ce(c) {
|
|
|
300
303
|
c.onApiReady?.(null);
|
|
301
304
|
});
|
|
302
305
|
});
|
|
303
|
-
const O = () => c.lockShortcut === void 0 ?
|
|
306
|
+
const O = () => c.lockShortcut === void 0 ? qt : c.lockShortcut;
|
|
304
307
|
h(() => {
|
|
305
308
|
if (typeof window > "u" || !e.contextMenu.state()) return;
|
|
306
|
-
const t =
|
|
309
|
+
const t = It({
|
|
307
310
|
ownerWindow: window,
|
|
308
311
|
onDismiss: e.contextMenu.close
|
|
309
312
|
});
|
|
@@ -396,13 +399,13 @@ function ce(c) {
|
|
|
396
399
|
const t = V();
|
|
397
400
|
if (!t) return null;
|
|
398
401
|
const n = x(t.clientX, t.clientY, t);
|
|
399
|
-
return n ? t.kind === "widget" ?
|
|
402
|
+
return n ? t.kind === "widget" ? Ft({
|
|
400
403
|
type: t.id,
|
|
401
404
|
widgetDefinitions: e.widgetDefinitions(),
|
|
402
405
|
worldX: n.worldX,
|
|
403
406
|
worldY: n.worldY,
|
|
404
407
|
dropAllowed: t.dropAllowed
|
|
405
|
-
}) :
|
|
408
|
+
}) : Tt({
|
|
406
409
|
tool: t.id,
|
|
407
410
|
label: t.label,
|
|
408
411
|
worldX: n.worldX,
|
|
@@ -412,7 +415,7 @@ function ce(c) {
|
|
|
412
415
|
backgroundDefaults: c.backgroundLayerDefaults
|
|
413
416
|
}) : null;
|
|
414
417
|
});
|
|
415
|
-
return l(
|
|
418
|
+
return l(yt.Provider, {
|
|
416
419
|
value: {
|
|
417
420
|
duplicate: (t) => {
|
|
418
421
|
if (t.kind === "sticky_note") {
|
|
@@ -430,10 +433,10 @@ function ce(c) {
|
|
|
430
433
|
}
|
|
431
434
|
},
|
|
432
435
|
get children() {
|
|
433
|
-
return l(
|
|
436
|
+
return l(At.Provider, {
|
|
434
437
|
value: X,
|
|
435
438
|
get children() {
|
|
436
|
-
var t =
|
|
439
|
+
var t = Xt(), n = t.firstChild;
|
|
437
440
|
return ut(z, t), lt(t, gt({
|
|
438
441
|
get class() {
|
|
439
442
|
return `workbench-surface${c.class ? ` ${c.class}` : ""}`;
|
|
@@ -441,8 +444,8 @@ function ce(c) {
|
|
|
441
444
|
}, () => ({
|
|
442
445
|
[d().surfaceRootAttr]: "true",
|
|
443
446
|
[d().dialogSurfaceHostAttr]: "true",
|
|
444
|
-
[
|
|
445
|
-
[
|
|
447
|
+
[Nt]: "true",
|
|
448
|
+
[Rt]: "true"
|
|
446
449
|
}), {
|
|
447
450
|
get "data-workbench-theme"() {
|
|
448
451
|
return e.theme();
|
|
@@ -451,7 +454,7 @@ function ce(c) {
|
|
|
451
454
|
return e.mode();
|
|
452
455
|
},
|
|
453
456
|
tabIndex: -1
|
|
454
|
-
}), !1, !0), C(n, l(
|
|
457
|
+
}), !1, !0), C(n, l(ht, {
|
|
455
458
|
get widgetDefinitions() {
|
|
456
459
|
return e.widgetDefinitions();
|
|
457
460
|
},
|
|
@@ -598,7 +601,7 @@ function ce(c) {
|
|
|
598
601
|
get onLayoutInteractionEnd() {
|
|
599
602
|
return c.onLayoutInteractionEnd;
|
|
600
603
|
}
|
|
601
|
-
})), C(t, l(
|
|
604
|
+
})), C(t, l(xt, {
|
|
602
605
|
get locked() {
|
|
603
606
|
return e.locked();
|
|
604
607
|
},
|
|
@@ -608,7 +611,7 @@ function ce(c) {
|
|
|
608
611
|
get shortcutLabel() {
|
|
609
612
|
return O() ?? void 0;
|
|
610
613
|
}
|
|
611
|
-
}), null), C(t, l(
|
|
614
|
+
}), null), C(t, l(pt, {
|
|
612
615
|
get widgetDefinitions() {
|
|
613
616
|
return U();
|
|
614
617
|
},
|
|
@@ -661,7 +664,7 @@ function ce(c) {
|
|
|
661
664
|
return c.registerExternalDockDragController;
|
|
662
665
|
},
|
|
663
666
|
onDragPreviewChange: H
|
|
664
|
-
}), null), C(t, l(
|
|
667
|
+
}), null), C(t, l(St, {
|
|
665
668
|
get scaleLabel() {
|
|
666
669
|
return e.scaleLabel();
|
|
667
670
|
},
|
|
@@ -675,7 +678,7 @@ function ce(c) {
|
|
|
675
678
|
return e.theme();
|
|
676
679
|
},
|
|
677
680
|
onSelectTheme: (o) => e.appearance.setTheme(o)
|
|
678
|
-
}), null), C(t, l(
|
|
681
|
+
}), null), C(t, l(Ct, {
|
|
679
682
|
get when() {
|
|
680
683
|
return e.contextMenu.state();
|
|
681
684
|
},
|
|
@@ -683,9 +686,9 @@ function ce(c) {
|
|
|
683
686
|
return l(ft, {
|
|
684
687
|
get children() {
|
|
685
688
|
return [(() => {
|
|
686
|
-
var o =
|
|
689
|
+
var o = Pt();
|
|
687
690
|
return wt(o, "contextmenu", e.contextMenu.retarget, !0), o;
|
|
688
|
-
})(), l(
|
|
691
|
+
})(), l(Wt, {
|
|
689
692
|
get x() {
|
|
690
693
|
return T()?.left ?? 0;
|
|
691
694
|
},
|
|
@@ -707,5 +710,5 @@ function ce(c) {
|
|
|
707
710
|
}
|
|
708
711
|
mt(["contextmenu"]);
|
|
709
712
|
export {
|
|
710
|
-
|
|
713
|
+
ae as WorkbenchSurface
|
|
711
714
|
};
|