@floegence/floe-webapp-core 0.101.29 → 0.101.33
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/layout/ActivityBar.d.ts +4 -0
- package/dist/components/layout/ActivityBar.js +132 -71
- package/dist/components/layout/Shell.d.ts +1 -0
- package/dist/components/layout/Shell.js +16 -13
- package/dist/components/layout/barReorder.d.ts +32 -0
- package/dist/components/layout/barReorder.js +132 -0
- package/dist/components/ui/Dialog.js +84 -83
- package/dist/components/ui/Dropdown.js +103 -103
- package/dist/components/ui/Tooltip.d.ts +3 -0
- package/dist/components/ui/Tooltip.js +77 -38
- package/dist/components/ui/dialogSurfaceScope.js +68 -67
- package/dist/components/workbench/WorkbenchFilterBar.d.ts +26 -1
- package/dist/components/workbench/WorkbenchFilterBar.js +445 -508
- package/dist/components/workbench/WorkbenchSurface.d.ts +2 -1
- package/dist/components/workbench/WorkbenchSurface.js +3 -0
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/hooks/useOverlayMask.js +81 -80
- package/dist/utils/domScope.d.ts +6 -0
- package/dist/utils/domScope.js +30 -0
- package/package.json +1 -1
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
import { composedEventTarget as a, composedClosest as R, deepActiveElement as A } from "../../utils/domScope.js";
|
|
2
|
+
const S = "data-floe-dialog-surface-host", M = S, L = "data-floe-surface-portal-layer", D = "data-floe-surface-floating-layer", N = "data-floe-dialog-surface-boundary", _ = 1600;
|
|
2
3
|
let l = null, i = null;
|
|
3
|
-
function
|
|
4
|
+
function x(t) {
|
|
4
5
|
return typeof Element < "u" && t instanceof Element ? t : typeof Node < "u" && t instanceof Node ? t.parentElement : null;
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
const e = t
|
|
7
|
+
function C(t) {
|
|
8
|
+
const e = t ? A(t) : null;
|
|
8
9
|
return e instanceof Element ? e : null;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function s(t) {
|
|
11
12
|
const e = typeof document < "u" ? document : null;
|
|
12
13
|
l = {
|
|
13
|
-
target:
|
|
14
|
-
activeElement:
|
|
14
|
+
target: x(t),
|
|
15
|
+
activeElement: C(e),
|
|
15
16
|
recordedAt: Date.now()
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
function p(t) {
|
|
19
|
-
a(t.target);
|
|
20
|
-
}
|
|
21
19
|
function y(t) {
|
|
22
|
-
a(t
|
|
20
|
+
s(a(t));
|
|
23
21
|
}
|
|
24
22
|
function T(t) {
|
|
25
|
-
a(t
|
|
23
|
+
s(a(t));
|
|
26
24
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
25
|
+
function w(t) {
|
|
26
|
+
s(a(t));
|
|
29
27
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
28
|
+
function b() {
|
|
29
|
+
P();
|
|
32
30
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
31
|
+
function P() {
|
|
32
|
+
typeof document > "u" || i !== document && (i && (i.removeEventListener("pointerdown", y, !0), i.removeEventListener("focusin", T, !0), i.removeEventListener("contextmenu", w, !0)), document.addEventListener("pointerdown", y, !0), document.addEventListener("focusin", T, !0), document.addEventListener("contextmenu", w, !0), i = document);
|
|
33
|
+
}
|
|
34
|
+
function F() {
|
|
35
|
+
return !l || Date.now() - l.recordedAt > _ ? null : l;
|
|
35
36
|
}
|
|
36
37
|
function f(t) {
|
|
37
|
-
const e = t
|
|
38
|
+
const e = R(t, `[${S}="true"]`);
|
|
38
39
|
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function H(t) {
|
|
41
42
|
if (!t) return null;
|
|
42
|
-
const e = t
|
|
43
|
+
const e = R(t, `[${L}="true"]`);
|
|
43
44
|
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
const e =
|
|
46
|
+
function U(t = {}) {
|
|
47
|
+
b();
|
|
48
|
+
const e = F(), n = t.owner ? f(t.owner) : f(e?.target ?? null) ?? f(e?.activeElement ?? null);
|
|
48
49
|
return n ? {
|
|
49
50
|
host: n,
|
|
50
51
|
boundaryHost: n,
|
|
51
|
-
mountHost:
|
|
52
|
+
mountHost: H(n) ?? n,
|
|
52
53
|
mode: "surface"
|
|
53
54
|
} : { host: null, boundaryHost: null, mountHost: null, mode: "global" };
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function d(t) {
|
|
56
57
|
return t.mode === "surface" && !!t.boundaryHost?.isConnected;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
59
|
+
function h(t) {
|
|
60
|
+
if (d(t))
|
|
60
61
|
return t.mountHost ?? t.boundaryHost ?? void 0;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function v() {
|
|
63
64
|
return typeof window > "u" ? {
|
|
64
65
|
left: 0,
|
|
65
66
|
top: 0,
|
|
@@ -76,9 +77,9 @@ function S() {
|
|
|
76
77
|
height: window.innerHeight
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
-
if (!
|
|
81
|
-
return
|
|
80
|
+
function W(t) {
|
|
81
|
+
if (!d(t) || !t.boundaryHost)
|
|
82
|
+
return v();
|
|
82
83
|
const e = t.boundaryHost.getBoundingClientRect();
|
|
83
84
|
return {
|
|
84
85
|
left: e.left,
|
|
@@ -89,10 +90,10 @@ function M(t) {
|
|
|
89
90
|
height: e.height
|
|
90
91
|
};
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
const e =
|
|
93
|
+
function I(t) {
|
|
94
|
+
const e = h(t);
|
|
94
95
|
if (!e)
|
|
95
|
-
return
|
|
96
|
+
return v();
|
|
96
97
|
const n = e.getBoundingClientRect();
|
|
97
98
|
return {
|
|
98
99
|
left: n.left,
|
|
@@ -103,31 +104,31 @@ function P(t) {
|
|
|
103
104
|
height: n.height
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
const e =
|
|
107
|
+
function B(t) {
|
|
108
|
+
const e = h(t);
|
|
108
109
|
if (!e) return { x: 1, y: 1 };
|
|
109
|
-
const n = e.getBoundingClientRect(), o = getComputedStyle(e), r = (u) => Number.parseFloat(u) || 0,
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
},
|
|
110
|
+
const n = e.getBoundingClientRect(), o = getComputedStyle(e), r = (u) => Number.parseFloat(u) || 0, m = (u) => {
|
|
111
|
+
const c = r(o[u]);
|
|
112
|
+
return c ? o.boxSizing === "border-box" ? c : c + (u === "width" ? r(o.paddingLeft) + r(o.paddingRight) + r(o.borderLeftWidth) + r(o.borderRightWidth) : r(o.paddingTop) + r(o.paddingBottom) + r(o.borderTopWidth) + r(o.borderBottomWidth)) : u === "width" ? e.offsetWidth : e.offsetHeight;
|
|
113
|
+
}, p = m("width"), g = m("height");
|
|
113
114
|
return {
|
|
114
|
-
x:
|
|
115
|
+
x: p > 0 && n.width > 0 ? n.width / p : 1,
|
|
115
116
|
y: g > 0 && n.height > 0 ? n.height / g : 1
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!
|
|
119
|
+
function E(t, e) {
|
|
120
|
+
if (!d(e))
|
|
120
121
|
return t;
|
|
121
|
-
const n =
|
|
122
|
+
const n = h(e), o = I(e), r = B(e);
|
|
122
123
|
return {
|
|
123
124
|
x: (t.x - o.left) / r.x - n.clientLeft + n.scrollLeft,
|
|
124
125
|
y: (t.y - o.top) / r.y - n.clientTop + n.scrollTop
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
if (!
|
|
128
|
+
function k(t, e) {
|
|
129
|
+
if (!d(e))
|
|
129
130
|
return t;
|
|
130
|
-
const n =
|
|
131
|
+
const n = E({ x: t.left, y: t.top }, e), o = E({ x: t.right, y: t.bottom }, e);
|
|
131
132
|
return {
|
|
132
133
|
left: n.x,
|
|
133
134
|
top: n.y,
|
|
@@ -137,26 +138,26 @@ function D(t, e) {
|
|
|
137
138
|
height: o.y - n.y
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
+
function G() {
|
|
141
142
|
l = null;
|
|
142
143
|
}
|
|
143
|
-
typeof document < "u" &&
|
|
144
|
+
typeof document < "u" && b();
|
|
144
145
|
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
146
|
+
N as DIALOG_SURFACE_BOUNDARY_ATTR,
|
|
147
|
+
S as DIALOG_SURFACE_HOST_ATTR,
|
|
148
|
+
D as SURFACE_FLOATING_LAYER_ATTR,
|
|
149
|
+
M as SURFACE_PORTAL_HOST_ATTR,
|
|
150
|
+
L as SURFACE_PORTAL_LAYER_ATTR,
|
|
151
|
+
G as __resetSurfacePortalScopeForTests,
|
|
152
|
+
b as ensureDialogSurfaceInteractionTracking,
|
|
153
|
+
P as ensureSurfacePortalInteractionTracking,
|
|
154
|
+
d as isSurfacePortalMode,
|
|
155
|
+
E as projectSurfacePortalPosition,
|
|
156
|
+
k as projectSurfacePortalRect,
|
|
157
|
+
F as readFreshInteractionSnapshot,
|
|
158
|
+
W as resolveSurfacePortalBoundaryRect,
|
|
159
|
+
U as resolveSurfacePortalHost,
|
|
160
|
+
h as resolveSurfacePortalMount,
|
|
161
|
+
I as resolveSurfacePortalMountRect,
|
|
162
|
+
B as resolveSurfacePortalScale
|
|
162
163
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, type JSX } from 'solid-js';
|
|
2
|
-
import { type BarItemContextMenuHandler } from '../layout/barItemContextMenu';
|
|
2
|
+
import { type BarItemContextMenuHandler, type BarItemContextMenuRequest } from '../layout/barItemContextMenu';
|
|
3
3
|
import { type WorkbenchWidgetFrame } from './workbenchHelpers';
|
|
4
4
|
import { type WorkbenchEdgeAutoPanFrame } from './workbenchEdgeAutoPan';
|
|
5
5
|
import type { WorkbenchDockToolId, WorkbenchInteractionMode, WorkbenchViewport, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
@@ -14,6 +14,7 @@ export interface WorkbenchFilterBarProps {
|
|
|
14
14
|
activationMode?: WorkbenchDockItemActivationMode;
|
|
15
15
|
/** Orders work-mode widgets and tools by id; unlisted entries retain their relative order at the end. */
|
|
16
16
|
componentOrder?: readonly (WorkbenchWidgetType | WorkbenchDockToolId)[];
|
|
17
|
+
customization?: WorkbenchDockCustomization;
|
|
17
18
|
/** Solo a single dock component in the supplied mode scope; soloing it again shows the full scope. */
|
|
18
19
|
onSoloFilter: (id: string, scope: readonly string[]) => void;
|
|
19
20
|
onSelectMode?: (mode: WorkbenchInteractionMode) => void;
|
|
@@ -42,6 +43,29 @@ export interface WorkbenchFilterBarProps {
|
|
|
42
43
|
onViewportCommit?: (viewport: WorkbenchViewport) => void;
|
|
43
44
|
onViewportInteractionStart?: (kind: 'pan') => void;
|
|
44
45
|
}
|
|
46
|
+
/** Keys distinguish built-in components, host actions and host instances. */
|
|
47
|
+
export type WorkbenchDockEntry = Readonly<{
|
|
48
|
+
key: string;
|
|
49
|
+
kind: 'widget' | 'tool' | 'action' | 'host';
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
icon: Component<{
|
|
53
|
+
class?: string;
|
|
54
|
+
}>;
|
|
55
|
+
activate: (trigger: HTMLButtonElement) => void;
|
|
56
|
+
/** Focuses this entry after the host restores its visibility. */
|
|
57
|
+
focus: () => void;
|
|
58
|
+
}>;
|
|
59
|
+
export type WorkbenchDockCustomization = Readonly<{
|
|
60
|
+
order?: readonly string[];
|
|
61
|
+
hidden?: readonly string[];
|
|
62
|
+
onOrderChange?: (keys: string[]) => void;
|
|
63
|
+
onContextMenu?: (entry: WorkbenchDockEntry, request: BarItemContextMenuRequest) => void;
|
|
64
|
+
/** Host renders its localized overflow trigger/panel; hidden entries remain activatable. */
|
|
65
|
+
overflow?: Component<{
|
|
66
|
+
entries: readonly WorkbenchDockEntry[];
|
|
67
|
+
}>;
|
|
68
|
+
}>;
|
|
45
69
|
export type WorkbenchDockItemActivationMode = 'solo-filter' | 'focus-cycle';
|
|
46
70
|
export type WorkbenchDockItemPresentation = Readonly<{
|
|
47
71
|
count: number;
|
|
@@ -63,6 +87,7 @@ export type WorkbenchDockAction = Readonly<{
|
|
|
63
87
|
onActivate: (trigger: HTMLButtonElement) => void;
|
|
64
88
|
/** Receives the concrete action button on mount and null on disposal. */
|
|
65
89
|
buttonRef?: (button: HTMLButtonElement | null) => void;
|
|
90
|
+
onContextMenu?: BarItemContextMenuHandler;
|
|
66
91
|
}>;
|
|
67
92
|
export type WorkbenchHostDockItem = Readonly<{
|
|
68
93
|
id: string;
|