@floegence/floe-webapp-core 0.101.28 → 0.101.30
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/assets/layout-worker-CsLsdMKZ.js +1956 -0
- package/dist/components/graph/engine.js +14 -14
- package/dist/components/graph/routing.d.ts +1 -1
- package/dist/components/graph/types.d.ts +3 -1
- package/dist/components/layout/ActivityBar.d.ts +4 -0
- package/dist/components/layout/ActivityBar.js +125 -69
- 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 +114 -0
- package/dist/components/workbench/WorkbenchFilterBar.d.ts +26 -1
- package/dist/components/workbench/WorkbenchFilterBar.js +454 -517
- 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/package.json +1 -1
- package/dist/assets/layout-worker-CFMp3t5w.js +0 -1952
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
function w() {
|
|
2
|
-
const
|
|
2
|
+
const t = new Worker(new URL("../../assets/layout-worker-CsLsdMKZ.js", import.meta.url), { type: "module" });
|
|
3
3
|
let a, d = 0;
|
|
4
|
-
const
|
|
5
|
-
a = e,
|
|
6
|
-
for (const r of
|
|
4
|
+
const o = /* @__PURE__ */ new Map(), n = (e) => {
|
|
5
|
+
a = e, t.terminate();
|
|
6
|
+
for (const r of o.values())
|
|
7
7
|
r.cleanup(), r.reject(e);
|
|
8
|
-
|
|
8
|
+
o.clear();
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
t.addEventListener(
|
|
11
11
|
"error",
|
|
12
12
|
(e) => n(new Error(e.message || "Graph layout worker failed"))
|
|
13
|
-
),
|
|
13
|
+
), t.addEventListener(
|
|
14
14
|
"messageerror",
|
|
15
15
|
() => n(new Error("Invalid graph layout worker response"))
|
|
16
|
-
),
|
|
16
|
+
), t.addEventListener("message", ({ data: e }) => {
|
|
17
17
|
if (!e || !Number.isInteger(e.id)) {
|
|
18
18
|
n(new Error("Invalid graph layout worker response"));
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
const r =
|
|
21
|
+
const r = o.get(e.id);
|
|
22
22
|
if (r) {
|
|
23
23
|
if (!e.error && (r.kind === "layout" ? !e.layout : !Array.isArray(e.edges))) {
|
|
24
24
|
n(new Error("Invalid graph layout worker response"));
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
o.delete(e.id), r.cleanup(), e.error ? r.reject(new Error(e.error)) : r.resolve(r.kind === "layout" ? e.layout : e.edges);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
const p = (e, r) => a ? Promise.reject(a) : r?.aborted ? Promise.reject(new DOMException("Graph routing canceled", "AbortError")) : new Promise((l, s) => {
|
|
31
31
|
const i = ++d, u = () => {
|
|
32
|
-
|
|
32
|
+
o.delete(i) && (r?.removeEventListener("abort", u), t.postMessage({ id: i, cancel: !0 }), s(new DOMException("Graph routing canceled", "AbortError")));
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
o.set(i, {
|
|
35
35
|
kind: e.kind,
|
|
36
36
|
resolve: (c) => l(c),
|
|
37
37
|
reject: s,
|
|
38
38
|
cleanup: () => r?.removeEventListener("abort", u)
|
|
39
39
|
}), r?.addEventListener("abort", u, { once: !0 });
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
t.postMessage({ id: i, ...e });
|
|
42
42
|
} catch (c) {
|
|
43
|
-
|
|
43
|
+
o.delete(i), r?.removeEventListener("abort", u), s(c);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
return {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GraphLayout, GraphLayoutOptions } from './types';
|
|
2
2
|
/** Joint orthogonal routing through the final rectangular geometry. */
|
|
3
|
-
export declare function routeGraphGeometry(layout: GraphLayout, options?: Pick<GraphLayoutOptions, 'edgeClearance' | 'routing'>): Promise<GraphLayout>;
|
|
3
|
+
export declare function routeGraphGeometry(layout: GraphLayout, options?: Pick<GraphLayoutOptions, 'edgeClearance' | 'edgeAnchorInset' | 'routing'>): Promise<GraphLayout>;
|
|
@@ -52,6 +52,8 @@ export interface GraphLayoutOptions {
|
|
|
52
52
|
groupLayouts?: Readonly<Record<string, GraphGroupLayout>>;
|
|
53
53
|
/** Clearance around routing obstacles in world units. Defaults to 4; never changes node geometry. */
|
|
54
54
|
edgeClearance?: number;
|
|
55
|
+
/** Automatic border-anchor distance from corners. Defaults to 8, capped at one quarter of the side. Named ports stay exact. */
|
|
56
|
+
edgeAnchorInset?: number;
|
|
55
57
|
/** Desired width/height when packing disconnected objects, including group members. */
|
|
56
58
|
aspectRatio?: number;
|
|
57
59
|
/** Absolute world positions. Descendants move with their group. Invalid positions always fail. */
|
|
@@ -76,7 +78,7 @@ export interface GraphLayoutOptions {
|
|
|
76
78
|
position: GraphPoint;
|
|
77
79
|
};
|
|
78
80
|
}
|
|
79
|
-
export type GraphRoutingOptions = Pick<GraphLayoutOptions, 'edgeClearance'>;
|
|
81
|
+
export type GraphRoutingOptions = Pick<GraphLayoutOptions, 'edgeClearance' | 'edgeAnchorInset'>;
|
|
80
82
|
export interface GraphGroupLayout {
|
|
81
83
|
/** Row fills left to right; column fills top to bottom. Omitted rules retain automatic layout. */
|
|
82
84
|
flow: 'row' | 'column';
|
|
@@ -8,6 +8,8 @@ export interface ActivityBarItem {
|
|
|
8
8
|
active?: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
label: string;
|
|
11
|
+
/** Fixed disclosures may opt out of user ordering. */
|
|
12
|
+
reorderable?: boolean;
|
|
11
13
|
badge?: number | string | (() => number | string | undefined);
|
|
12
14
|
onClick?: () => void;
|
|
13
15
|
/** Requests a product-owned context menu for this concrete Activity Bar button. */
|
|
@@ -31,6 +33,8 @@ export interface ActivityBarItem {
|
|
|
31
33
|
export interface ActivityBarProps {
|
|
32
34
|
items: ActivityBarItem[];
|
|
33
35
|
bottomItems?: ActivityBarItem[];
|
|
36
|
+
/** Commits the visible reorderable IDs; persistence belongs to the host. */
|
|
37
|
+
onReorder?: (ids: string[]) => void;
|
|
34
38
|
activeId: string;
|
|
35
39
|
onActiveChange: (id: string, opts?: {
|
|
36
40
|
openSidebar?: boolean;
|
|
@@ -1,116 +1,168 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as b, For as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { insert as s, createComponent as c, memo as I, effect as k, className as A, setAttribute as v, template as y, use as L, Dynamic as T, setStyleProperty as w, delegateEvents as N } from "solid-js/web";
|
|
2
|
+
import { createMemo as b, For as j, Show as M, onMount as X, onCleanup as Y } from "solid-js";
|
|
3
|
+
import { cn as h } from "../../utils/cn.js";
|
|
4
|
+
import { deferNonBlocking as F } from "../../utils/defer.js";
|
|
5
|
+
import { Tooltip as H } from "../ui/Tooltip.js";
|
|
6
|
+
import { createBarReorder as U, createBarLayoutMotion as V } from "./barReorder.js";
|
|
7
|
+
import { resolveActivityBarClick as z } from "./activityBarBehavior.js";
|
|
8
|
+
import { isBarItemContextMenuKey as G, keyboardBarItemContextMenuRequest as J } from "./barItemContextMenu.js";
|
|
9
|
+
var O = /* @__PURE__ */ y('<div class="flex flex-col">'), Q = /* @__PURE__ */ y('<nav data-floe-shell-slot=activity-bar style=border-right-color:var(--activity-bar-border)><div class="flex flex-col min-h-0 overflow-y-auto overflow-x-hidden">'), W = /* @__PURE__ */ y("<span aria-hidden=true style=position:absolute;left:6px;right:6px;height:2px;background:var(--ring);border-radius:2px>"), Z = /* @__PURE__ */ y("<span>"), _ = /* @__PURE__ */ y("<button type=button data-floe-interactive=press><span aria-hidden=true>");
|
|
10
|
+
function le(t) {
|
|
11
|
+
let u;
|
|
12
|
+
const d = /* @__PURE__ */ new Map(), g = b(() => new Map(t.items.map((i) => [i.id, i]))), l = U({
|
|
13
|
+
keys: () => t.items.filter((i) => i.reorderable !== !1).map((i) => i.id),
|
|
14
|
+
elements: d,
|
|
15
|
+
container: () => u,
|
|
16
|
+
onReorder: () => t.onReorder
|
|
17
|
+
});
|
|
18
|
+
V({
|
|
19
|
+
keys: () => t.items.map((i) => i.id),
|
|
20
|
+
elements: d,
|
|
21
|
+
preview: () => l.position()?.order,
|
|
22
|
+
axis: "y"
|
|
23
|
+
});
|
|
24
|
+
const f = b(() => t.activeId), B = b(() => t.collapsed ?? !1), x = b(() => t.onActiveChange), r = b(() => t.onCollapsedChange), C = (i) => {
|
|
25
|
+
if (i.onClick) {
|
|
26
|
+
F(() => i.onClick());
|
|
13
27
|
return;
|
|
14
28
|
}
|
|
15
|
-
const e =
|
|
16
|
-
clickedId:
|
|
17
|
-
activeId:
|
|
18
|
-
collapsed:
|
|
19
|
-
behavior:
|
|
29
|
+
const e = z({
|
|
30
|
+
clickedId: i.id,
|
|
31
|
+
activeId: f(),
|
|
32
|
+
collapsed: B(),
|
|
33
|
+
behavior: i.collapseBehavior
|
|
20
34
|
});
|
|
21
|
-
e.nextActiveId !==
|
|
35
|
+
e.nextActiveId !== f() && (typeof e.openSidebar == "boolean" ? x()(e.nextActiveId, {
|
|
22
36
|
openSidebar: e.openSidebar
|
|
23
|
-
}) :
|
|
37
|
+
}) : x()(e.nextActiveId)), typeof e.nextCollapsed == "boolean" && r()?.(e.nextCollapsed);
|
|
24
38
|
};
|
|
25
39
|
return (() => {
|
|
26
|
-
var
|
|
27
|
-
return
|
|
40
|
+
var i = Q(), e = i.firstChild, a = u;
|
|
41
|
+
return typeof a == "function" ? L(a, e) : u = e, s(e, c(j, {
|
|
28
42
|
get each() {
|
|
29
|
-
return t.items;
|
|
43
|
+
return t.items.map((n) => n.id);
|
|
30
44
|
},
|
|
31
|
-
children: (n) =>
|
|
32
|
-
item
|
|
45
|
+
children: (n) => c(q, {
|
|
46
|
+
get item() {
|
|
47
|
+
return g().get(n);
|
|
48
|
+
},
|
|
33
49
|
get isActive() {
|
|
34
|
-
return
|
|
50
|
+
return f() === n;
|
|
51
|
+
},
|
|
52
|
+
onClick: () => {
|
|
53
|
+
l.consumeClick() || C(g().get(n));
|
|
54
|
+
},
|
|
55
|
+
elementRef: (o) => {
|
|
56
|
+
o ? d.set(n, o) : d.delete(n);
|
|
57
|
+
},
|
|
58
|
+
onPointerDown: (o) => l.begin(n, o),
|
|
59
|
+
onReorderKey: (o) => l.keyDown(n, o),
|
|
60
|
+
get reorderable() {
|
|
61
|
+
return I(() => !!t.onReorder)() && g().get(n)?.reorderable !== !1;
|
|
35
62
|
},
|
|
36
|
-
|
|
63
|
+
get dragging() {
|
|
64
|
+
return l.dragging() === n;
|
|
65
|
+
},
|
|
66
|
+
get dropEdge() {
|
|
67
|
+
return I(() => l.position()?.key === n)() ? l.position()?.edge : void 0;
|
|
68
|
+
}
|
|
37
69
|
})
|
|
38
|
-
})),
|
|
70
|
+
})), s(i, c(M, {
|
|
39
71
|
get when() {
|
|
40
72
|
return t.bottomItems?.length;
|
|
41
73
|
},
|
|
42
74
|
get children() {
|
|
43
|
-
var n =
|
|
44
|
-
return
|
|
75
|
+
var n = O();
|
|
76
|
+
return s(n, c(j, {
|
|
45
77
|
get each() {
|
|
46
78
|
return t.bottomItems;
|
|
47
79
|
},
|
|
48
|
-
children: (
|
|
49
|
-
item:
|
|
80
|
+
children: (o) => c(q, {
|
|
81
|
+
item: o,
|
|
50
82
|
get isActive() {
|
|
51
|
-
return
|
|
83
|
+
return f() === o.id;
|
|
52
84
|
},
|
|
53
|
-
onClick: () =>
|
|
85
|
+
onClick: () => C(o)
|
|
54
86
|
})
|
|
55
87
|
})), n;
|
|
56
88
|
}
|
|
57
|
-
}), null),
|
|
58
|
-
var
|
|
59
|
-
return
|
|
89
|
+
}), null), k((n) => {
|
|
90
|
+
var o = h("w-10 md:w-12 flex flex-col justify-between shrink-0 min-h-0", "bg-activity-bar border-r border-[var(--floe-line-quiet)]", t.class), m = t.ariaLabel;
|
|
91
|
+
return o !== n.e && A(i, n.e = o), m !== n.t && v(i, "aria-label", n.t = m), n;
|
|
60
92
|
}, {
|
|
61
93
|
e: void 0,
|
|
62
94
|
t: void 0
|
|
63
|
-
}),
|
|
95
|
+
}), i;
|
|
64
96
|
})();
|
|
65
97
|
}
|
|
66
|
-
function
|
|
67
|
-
let
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
function q(t) {
|
|
99
|
+
let u;
|
|
100
|
+
const d = () => typeof t.item.badge == "function" ? t.item.badge() : t.item.badge, g = () => typeof t.item.ariaExpanded == "function" ? t.item.ariaExpanded() : t.item.ariaExpanded, l = () => t.isActive || g() === !0;
|
|
101
|
+
let f;
|
|
102
|
+
X(() => {
|
|
103
|
+
const r = t.item.buttonRef;
|
|
104
|
+
r?.(u ?? null), t.elementRef?.(u ?? null), f = () => {
|
|
105
|
+
r?.(null), t.elementRef?.(null);
|
|
106
|
+
};
|
|
107
|
+
}), Y(() => f?.());
|
|
108
|
+
const B = (r) => {
|
|
109
|
+
t.item.onContextMenu && (r.preventDefault(), r.stopPropagation(), t.item.onContextMenu({
|
|
110
|
+
trigger: r.currentTarget,
|
|
111
|
+
clientX: r.clientX,
|
|
112
|
+
clientY: r.clientY,
|
|
75
113
|
source: "pointer"
|
|
76
114
|
}));
|
|
77
|
-
},
|
|
78
|
-
!t.item.onContextMenu || !
|
|
115
|
+
}, x = (r) => {
|
|
116
|
+
t.onReorderKey?.(r), !(r.defaultPrevented || !t.item.onContextMenu || !G(r)) && (r.preventDefault(), r.stopPropagation(), t.item.onContextMenu(J(r.currentTarget)));
|
|
79
117
|
};
|
|
80
|
-
return
|
|
118
|
+
return c(H, {
|
|
81
119
|
get content() {
|
|
82
120
|
return t.item.label;
|
|
83
121
|
},
|
|
84
122
|
placement: "right",
|
|
85
123
|
delay: 0,
|
|
86
124
|
get children() {
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
var
|
|
90
|
-
return typeof
|
|
125
|
+
var r = _(), C = r.firstChild;
|
|
126
|
+
r.$$keydown = x, r.$$contextmenu = B, r.$$click = () => t.onClick(), r.addEventListener("dragstart", (e) => e.preventDefault()), r.$$pointerdown = (e) => t.onPointerDown?.(e);
|
|
127
|
+
var i = u;
|
|
128
|
+
return typeof i == "function" ? L(i, r) : u = r, s(r, c(T, {
|
|
91
129
|
get component() {
|
|
92
130
|
return t.item.icon;
|
|
93
131
|
},
|
|
94
132
|
get active() {
|
|
95
|
-
return
|
|
133
|
+
return l();
|
|
96
134
|
},
|
|
97
135
|
get class() {
|
|
98
|
-
return
|
|
136
|
+
return h("relative w-5 h-5 transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", l() ? "text-activity-bar-foreground-active" : "group-hover/activity-item:text-activity-bar-foreground-active");
|
|
137
|
+
}
|
|
138
|
+
}), null), s(r, c(M, {
|
|
139
|
+
get when() {
|
|
140
|
+
return t.dropEdge;
|
|
141
|
+
},
|
|
142
|
+
get children() {
|
|
143
|
+
var e = W();
|
|
144
|
+
return k((a) => {
|
|
145
|
+
var n = t.dropEdge === "before" ? "0" : void 0, o = t.dropEdge === "after" ? "0" : void 0;
|
|
146
|
+
return n !== a.e && w(e, "top", a.e = n), o !== a.t && w(e, "bottom", a.t = o), a;
|
|
147
|
+
}, {
|
|
148
|
+
e: void 0,
|
|
149
|
+
t: void 0
|
|
150
|
+
}), e;
|
|
99
151
|
}
|
|
100
|
-
}), null),
|
|
152
|
+
}), null), s(r, c(M, {
|
|
101
153
|
get when() {
|
|
102
|
-
return
|
|
154
|
+
return d();
|
|
103
155
|
},
|
|
104
156
|
get children() {
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
var
|
|
108
|
-
return () =>
|
|
109
|
-
})()),
|
|
157
|
+
var e = Z();
|
|
158
|
+
return s(e, (() => {
|
|
159
|
+
var a = I(() => typeof d() == "number" && d() > 99);
|
|
160
|
+
return () => a() ? "99+" : d();
|
|
161
|
+
})()), k(() => A(e, h("absolute top-0.5 right-0.5 min-w-3.5 h-3.5 px-1", "flex items-center justify-center", "text-[length:var(--floe-type-caption)] font-medium rounded-full", "bg-activity-bar-badge text-activity-bar-badge-foreground"))), e;
|
|
110
162
|
}
|
|
111
|
-
}), null),
|
|
112
|
-
var
|
|
113
|
-
return
|
|
163
|
+
}), null), k((e) => {
|
|
164
|
+
var a = t.item.id, n = t.reorderable ? "Alt+Shift+ArrowUp Alt+Shift+ArrowDown" : void 0, o = t.reorderable ? "none" : void 0, m = t.dragging ? 0.5 : void 0, R = h("group/activity-item relative w-full shrink-0 aspect-square flex items-center justify-center cursor-pointer", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset", "text-activity-bar-foreground", l() && "text-activity-bar-foreground-active"), D = t.item.label, E = t.isActive, $ = g(), P = t.item.ariaControls, S = t.item.ariaHasPopup ?? (t.item.onContextMenu ? "menu" : void 0), K = h("absolute inset-1 rounded-md", "transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", l() ? "bg-[var(--floe-state-selected)]" : "bg-transparent group-hover/activity-item:bg-[var(--floe-state-hover)]");
|
|
165
|
+
return a !== e.e && v(r, "data-floe-bar-key", e.e = a), n !== e.t && v(r, "aria-keyshortcuts", e.t = n), o !== e.a && w(r, "touch-action", e.a = o), m !== e.o && w(r, "opacity", e.o = m), R !== e.i && A(r, e.i = R), D !== e.n && v(r, "aria-label", e.n = D), E !== e.s && v(r, "aria-pressed", e.s = E), $ !== e.h && v(r, "aria-expanded", e.h = $), P !== e.r && v(r, "aria-controls", e.r = P), S !== e.d && v(r, "aria-haspopup", e.d = S), K !== e.l && A(C, e.l = K), e;
|
|
114
166
|
}, {
|
|
115
167
|
e: void 0,
|
|
116
168
|
t: void 0,
|
|
@@ -118,12 +170,16 @@ function B(t) {
|
|
|
118
170
|
o: void 0,
|
|
119
171
|
i: void 0,
|
|
120
172
|
n: void 0,
|
|
121
|
-
s: void 0
|
|
122
|
-
|
|
173
|
+
s: void 0,
|
|
174
|
+
h: void 0,
|
|
175
|
+
r: void 0,
|
|
176
|
+
d: void 0,
|
|
177
|
+
l: void 0
|
|
178
|
+
}), r;
|
|
123
179
|
}
|
|
124
180
|
});
|
|
125
181
|
}
|
|
126
|
-
|
|
182
|
+
N(["pointerdown", "click", "contextmenu", "keydown"]);
|
|
127
183
|
export {
|
|
128
|
-
|
|
184
|
+
le as ActivityBar
|
|
129
185
|
};
|
|
@@ -37,6 +37,7 @@ export interface ShellProps {
|
|
|
37
37
|
fillParent?: boolean;
|
|
38
38
|
logo?: JSX.Element;
|
|
39
39
|
activityItems?: ActivityBarItem[];
|
|
40
|
+
onActivityReorder?: (ids: string[]) => void;
|
|
40
41
|
activityBottomItems?: ActivityBarItem[];
|
|
41
42
|
/**
|
|
42
43
|
* Where to render `activityBottomItems` on mobile.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent as n, Dynamic as oe, insert as d, use as U, effect as I, setStyleProperty as j, memo as P, className as k, setAttribute as C, mergeProps as
|
|
1
|
+
import { createComponent as n, Dynamic as oe, insert as d, use as U, effect as I, setStyleProperty as j, memo as P, className as k, setAttribute as C, mergeProps as Le, template as M, delegateEvents as pe } from "solid-js/web";
|
|
2
2
|
import { createSignal as w, onMount as ze, onCleanup as $e, createEffect as A, createMemo as T, For as Fe, Show as m, batch as Ee } from "solid-js";
|
|
3
3
|
import { observeViewport as He } from "../../viewport.js";
|
|
4
4
|
import { useLayout as Ve } from "../../context/LayoutContext.js";
|
|
@@ -29,15 +29,15 @@ function Dt(i) {
|
|
|
29
29
|
ze(() => {
|
|
30
30
|
$e(He(window, (e) => de(e.keyboardOpen)));
|
|
31
31
|
});
|
|
32
|
-
const r = Ve(), ce = De(), l = r.isMobile, [be, ue] = w(), [fe, ve] = w(), me = Ke(fe), W = /* @__PURE__ */ new Map(), [V,
|
|
32
|
+
const r = Ve(), ce = De(), l = r.isMobile, [be, ue] = w(), [fe, ve] = w(), me = Ke(fe), W = /* @__PURE__ */ new Map(), [V, L] = w(!1), [ge, he] = w(!1), Se = qe({
|
|
33
33
|
container: be,
|
|
34
34
|
sidebarWidth: () => (D() ?? r.sidebarWidth()) + (me()?.width ?? 0),
|
|
35
35
|
minContentWidth: () => i.sidebarMinContentWidth ?? 0
|
|
36
36
|
}), h = () => !l() && !!i.sidebarMinContentWidth && !c() && Se() === "overlay";
|
|
37
37
|
A(() => {
|
|
38
|
-
(!h() || N()) &&
|
|
38
|
+
(!h() || N()) && L(!1);
|
|
39
39
|
});
|
|
40
|
-
const [
|
|
40
|
+
const [p, S] = w(!1), [z, ye] = w(!1);
|
|
41
41
|
let G;
|
|
42
42
|
const Ce = () => l() && !!i.mobileNavigationPanel?.open;
|
|
43
43
|
A(() => {
|
|
@@ -69,7 +69,7 @@ function Dt(i) {
|
|
|
69
69
|
}), r.setSidebarActiveTab(e, {
|
|
70
70
|
openSidebar: !1,
|
|
71
71
|
visibilityMotion: g
|
|
72
|
-
}),
|
|
72
|
+
}), L(!s)) : r.setSidebarActiveTab(e, {
|
|
73
73
|
openSidebar: o,
|
|
74
74
|
visibilityMotion: g
|
|
75
75
|
});
|
|
@@ -117,7 +117,7 @@ function Dt(i) {
|
|
|
117
117
|
}))), ke = (e) => {
|
|
118
118
|
h() ? (e || W.get(r.sidebarActiveTab())?.focus({
|
|
119
119
|
preventScroll: !0
|
|
120
|
-
}),
|
|
120
|
+
}), L(!e)) : r.setSidebarCollapsed(e);
|
|
121
121
|
}, Ae = T(() => c() ? [] : i.sidebarContent ? [] : b ? b.sidebarItems().filter((e) => !(l() && e.sidebar?.hiddenOnMobile)).filter((e) => e.sidebar?.fullScreen !== !0 && e.sidebar?.renderIn !== "main").map((e) => ({
|
|
122
122
|
id: e.id,
|
|
123
123
|
render: () => n(oe, {
|
|
@@ -160,7 +160,7 @@ function Dt(i) {
|
|
|
160
160
|
} = at({
|
|
161
161
|
clickedId: e,
|
|
162
162
|
activeId: r.sidebarActiveTab(),
|
|
163
|
-
mobileSidebarOpen:
|
|
163
|
+
mobileSidebarOpen: p(),
|
|
164
164
|
clickedIsFullScreen: a
|
|
165
165
|
});
|
|
166
166
|
if (r.sidebarActiveTab() !== s) {
|
|
@@ -210,7 +210,7 @@ function Dt(i) {
|
|
|
210
210
|
e !== null && (r.setSidebarWidth(e), _(null));
|
|
211
211
|
};
|
|
212
212
|
Ge({
|
|
213
|
-
open: () => l() &&
|
|
213
|
+
open: () => l() && p() && !c(),
|
|
214
214
|
root: () => q,
|
|
215
215
|
onClose: () => S(!1),
|
|
216
216
|
lockBodyScroll: !0,
|
|
@@ -271,6 +271,9 @@ function Dt(i) {
|
|
|
271
271
|
get items() {
|
|
272
272
|
return Me();
|
|
273
273
|
},
|
|
274
|
+
get onReorder() {
|
|
275
|
+
return i.onActivityReorder;
|
|
276
|
+
},
|
|
274
277
|
get bottomItems() {
|
|
275
278
|
return i.activityBottomItems;
|
|
276
279
|
},
|
|
@@ -339,7 +342,7 @@ function Dt(i) {
|
|
|
339
342
|
get open() {
|
|
340
343
|
return P(() => !!(h() && V()))() && !N();
|
|
341
344
|
},
|
|
342
|
-
onOpenChange:
|
|
345
|
+
onOpenChange: L,
|
|
343
346
|
onPresenceChange: he,
|
|
344
347
|
presentation: "side-drawer",
|
|
345
348
|
drawerSide: "left",
|
|
@@ -362,7 +365,7 @@ function Dt(i) {
|
|
|
362
365
|
}
|
|
363
366
|
}), g), d(o, n(m, {
|
|
364
367
|
get when() {
|
|
365
|
-
return P(() => !!(l() &&
|
|
368
|
+
return P(() => !!(l() && p()))() && !c();
|
|
366
369
|
},
|
|
367
370
|
get children() {
|
|
368
371
|
return [(() => {
|
|
@@ -409,7 +412,7 @@ function Dt(i) {
|
|
|
409
412
|
return P(() => !!l())() && i.mobileNavigationPanel;
|
|
410
413
|
},
|
|
411
414
|
get children() {
|
|
412
|
-
return n(it,
|
|
415
|
+
return n(it, Le(() => i.mobileNavigationPanel, {
|
|
413
416
|
navigation: () => G,
|
|
414
417
|
onPresenceChange: (t) => {
|
|
415
418
|
ye(t), i.mobileNavigationPanel?.onPresenceChange?.(t);
|
|
@@ -437,7 +440,7 @@ function Dt(i) {
|
|
|
437
440
|
get activeId() {
|
|
438
441
|
return nt({
|
|
439
442
|
activeId: E(),
|
|
440
|
-
mobileSidebarOpen: F.pending() ? !0 :
|
|
443
|
+
mobileSidebarOpen: F.pending() ? !0 : p(),
|
|
441
444
|
activeIsFullScreen: b?.getComponent(E())?.sidebar?.fullScreen ?? N(),
|
|
442
445
|
activeIsPage: (() => {
|
|
443
446
|
const t = b?.getComponent(E())?.sidebar;
|
|
@@ -484,7 +487,7 @@ function Dt(i) {
|
|
|
484
487
|
}), e;
|
|
485
488
|
})();
|
|
486
489
|
}
|
|
487
|
-
|
|
490
|
+
pe(["click"]);
|
|
488
491
|
export {
|
|
489
492
|
Dt as Shell
|
|
490
493
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type BarDropPosition = Readonly<{
|
|
2
|
+
key: string;
|
|
3
|
+
edge: 'before' | 'after';
|
|
4
|
+
order: string[];
|
|
5
|
+
}>;
|
|
6
|
+
/** A placement proposal only; owners commit order after a completed gesture. */
|
|
7
|
+
export declare function barDropPosition(keys: readonly string[], source: string, elements: ReadonlyMap<string, HTMLElement>, axis: 'x' | 'y', coordinate: number): BarDropPosition | undefined;
|
|
8
|
+
export declare function keyboardBarOrder(keys: readonly string[], source: string, event: KeyboardEvent, axis: 'x' | 'y'): string[] | undefined;
|
|
9
|
+
/** Activity rails own their pointer session; Dock shares the proposal with its canvas gesture. */
|
|
10
|
+
export declare function createBarReorder(options: {
|
|
11
|
+
keys: () => readonly string[];
|
|
12
|
+
elements: Map<string, HTMLElement>;
|
|
13
|
+
onReorder: () => ((keys: string[]) => void) | undefined;
|
|
14
|
+
container: () => HTMLElement | undefined;
|
|
15
|
+
}): {
|
|
16
|
+
dragging: import("solid-js").Accessor<string | undefined>;
|
|
17
|
+
position: import("solid-js").Accessor<Readonly<{
|
|
18
|
+
key: string;
|
|
19
|
+
edge: "before" | "after";
|
|
20
|
+
order: string[];
|
|
21
|
+
}> | undefined>;
|
|
22
|
+
keyDown(key: string, event: KeyboardEvent): void;
|
|
23
|
+
consumeClick(): boolean;
|
|
24
|
+
begin(key: string, event: PointerEvent): void;
|
|
25
|
+
};
|
|
26
|
+
/** Keyed layout motion survives pin/unpin, reorder and interrupted previews. */
|
|
27
|
+
export declare function createBarLayoutMotion(options: {
|
|
28
|
+
keys: () => readonly string[];
|
|
29
|
+
elements: Map<string, HTMLElement>;
|
|
30
|
+
preview: () => readonly string[] | undefined;
|
|
31
|
+
axis: 'x' | 'y';
|
|
32
|
+
}): void;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { createSignal as w, createEffect as b, onCleanup as D } from "solid-js";
|
|
2
|
+
import { startPointerSession as k } from "../ui/pointerSession.js";
|
|
3
|
+
function C(n, d, o, p, l) {
|
|
4
|
+
const r = n.filter((e) => e !== d && o.has(e));
|
|
5
|
+
if (!n.includes(d) || !r.length) return;
|
|
6
|
+
let s = r.findIndex((e) => {
|
|
7
|
+
const f = o.get(e), t = f.getBoundingClientRect(), i = getComputedStyle(f).transform, c = typeof DOMMatrix == "function" ? new DOMMatrix(i === "none" ? void 0 : i) : void 0;
|
|
8
|
+
return l < (p === "x" ? t.left - (c?.m41 ?? 0) + t.width / 2 : t.top - (c?.m42 ?? 0) + t.height / 2);
|
|
9
|
+
});
|
|
10
|
+
s < 0 && (s = r.length);
|
|
11
|
+
const a = [...r];
|
|
12
|
+
return a.splice(s, 0, d), { key: r[Math.min(s, r.length - 1)], edge: s === r.length ? "after" : "before", order: a };
|
|
13
|
+
}
|
|
14
|
+
function R(n, d, o, p) {
|
|
15
|
+
if (!o.altKey || !o.shiftKey || o.ctrlKey || o.metaKey || o.isComposing) return;
|
|
16
|
+
const l = o.key === (p === "x" ? "ArrowLeft" : "ArrowUp") ? -1 : o.key === (p === "x" ? "ArrowRight" : "ArrowDown") ? 1 : 0, r = n.indexOf(d);
|
|
17
|
+
if (!l || r < 0) return;
|
|
18
|
+
o.preventDefault(), o.stopPropagation();
|
|
19
|
+
const s = Math.max(0, Math.min(n.length - 1, r + l));
|
|
20
|
+
if (r === s) return;
|
|
21
|
+
const a = [...n];
|
|
22
|
+
return a.splice(r, 1), a.splice(s, 0, d), a;
|
|
23
|
+
}
|
|
24
|
+
function O(n) {
|
|
25
|
+
const [d, o] = w(), [p, l] = w();
|
|
26
|
+
let r, s = !1, a;
|
|
27
|
+
const e = (t) => {
|
|
28
|
+
t.key !== "Escape" || !r || (t.preventDefault(), t.stopPropagation(), r.stop({ commit: !1 }));
|
|
29
|
+
};
|
|
30
|
+
b(() => {
|
|
31
|
+
n.keys(), n.onReorder(), r?.stop({ commit: !1 });
|
|
32
|
+
}), D(() => {
|
|
33
|
+
r?.stop({ commit: !1 }), a && clearTimeout(a);
|
|
34
|
+
});
|
|
35
|
+
const f = (t, i) => {
|
|
36
|
+
n.onReorder()?.(i), n.elements.get(t)?.focus({ preventScroll: !0 });
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
dragging: d,
|
|
40
|
+
position: p,
|
|
41
|
+
keyDown(t, i) {
|
|
42
|
+
if (!n.onReorder()) return;
|
|
43
|
+
const c = R(n.keys(), t, i, "y");
|
|
44
|
+
c && f(t, c);
|
|
45
|
+
},
|
|
46
|
+
consumeClick() {
|
|
47
|
+
return s ? (s = !1, !0) : !1;
|
|
48
|
+
},
|
|
49
|
+
begin(t, i) {
|
|
50
|
+
if (i.button !== 0 || !n.onReorder() || !n.keys().includes(t)) return;
|
|
51
|
+
r?.stop({ commit: !1 });
|
|
52
|
+
const c = i.currentTarget, M = i.clientY, x = i.clientX;
|
|
53
|
+
let g = !1;
|
|
54
|
+
const h = (m, u) => {
|
|
55
|
+
if (g ||= Math.hypot(m - x, u - M) >= 5, !g) return;
|
|
56
|
+
o(t);
|
|
57
|
+
const y = n.container()?.getBoundingClientRect();
|
|
58
|
+
l(y && m >= y.left - 24 && m <= y.right + 24 && u >= y.top && u <= y.bottom ? C(n.keys(), t, n.elements, "y", u) : void 0);
|
|
59
|
+
};
|
|
60
|
+
c.ownerDocument.addEventListener("keydown", e, !0), r = k({
|
|
61
|
+
pointerEvent: i,
|
|
62
|
+
captureEl: c,
|
|
63
|
+
onMove: (m) => h(m.clientX, m.clientY),
|
|
64
|
+
onEnd: ({ commit: m, snapshot: u }) => {
|
|
65
|
+
h(u.latestClientX, u.latestClientY);
|
|
66
|
+
const y = p();
|
|
67
|
+
r = void 0, c.ownerDocument.removeEventListener("keydown", e, !0), o(void 0), l(void 0), g && (s = !0, a && clearTimeout(a), a = setTimeout(() => {
|
|
68
|
+
s = !1;
|
|
69
|
+
}, 0)), m && g && y && f(t, y.order);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function B(n) {
|
|
76
|
+
const d = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
77
|
+
let p = !1;
|
|
78
|
+
b(() => {
|
|
79
|
+
const l = [...n.keys()], r = n.preview(), s = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, a = new Map(l.flatMap((e) => {
|
|
80
|
+
const f = n.elements.get(e);
|
|
81
|
+
if (!f) return [];
|
|
82
|
+
const t = f.getBoundingClientRect(), i = getComputedStyle(f).transform, c = typeof DOMMatrix == "function" ? new DOMMatrix(i === "none" ? void 0 : i) : void 0;
|
|
83
|
+
return [[e, { left: t.left - (c?.m41 ?? 0), top: t.top - (c?.m42 ?? 0), dx: c?.m41 ?? 0, dy: c?.m42 ?? 0 }]];
|
|
84
|
+
}));
|
|
85
|
+
for (const e of l) {
|
|
86
|
+
const f = n.elements.get(e), t = a.get(e);
|
|
87
|
+
if (!f || !t) continue;
|
|
88
|
+
const i = d.get(e), c = r ? l[r.indexOf(e)] : e, M = a.get(c) ?? t, x = n.axis === "x" ? M.left - t.left : 0, g = n.axis === "y" ? M.top - t.top : 0;
|
|
89
|
+
if (o.get(e)?.cancel(), o.delete(e), f.style.transform = x || g ? `translate3d(${x}px, ${g}px, 0)` : "", !s && p && typeof f.animate == "function") {
|
|
90
|
+
const h = i ? i.left - t.left + t.dx : x, m = i ? i.top - t.top + t.dy : g;
|
|
91
|
+
if (!i || Math.abs(h - x) + Math.abs(m - g) > 0.5) {
|
|
92
|
+
const u = f.animate([
|
|
93
|
+
{ transform: `translate3d(${h}px, ${m}px, 0)`, opacity: i ? 1 : 0 },
|
|
94
|
+
{ transform: `translate3d(${x}px, ${g}px, 0)`, opacity: 1 }
|
|
95
|
+
], { duration: 180, easing: "cubic-bezier(0.33, 1, 0.68, 1)" });
|
|
96
|
+
o.set(e, u), u.onfinish = () => {
|
|
97
|
+
o.get(e) === u && o.delete(e);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
d.set(e, { left: t.left, top: t.top });
|
|
102
|
+
}
|
|
103
|
+
for (const e of d.keys()) l.includes(e) || (d.delete(e), o.get(e)?.cancel(), o.delete(e));
|
|
104
|
+
p = !0;
|
|
105
|
+
}), D(() => {
|
|
106
|
+
for (const l of o.values()) l.cancel();
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
C as barDropPosition,
|
|
111
|
+
B as createBarLayoutMotion,
|
|
112
|
+
O as createBarReorder,
|
|
113
|
+
R as keyboardBarOrder
|
|
114
|
+
};
|