@floegence/floe-webapp-core 0.101.30 → 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.js +82 -77
- package/dist/components/layout/barReorder.js +109 -91
- 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.js +135 -135
- 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,32 +1,32 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createMemo as
|
|
1
|
+
import { insert as g, createComponent as u, memo as I, effect as k, className as A, setAttribute as s, template as y, use as L, Dynamic as T, setStyleProperty as w, delegateEvents as N } from "solid-js/web";
|
|
2
|
+
import { createMemo as m, For as j, untrack as X, Show as M, onMount as Y, onCleanup as F } from "solid-js";
|
|
3
3
|
import { cn as h } from "../../utils/cn.js";
|
|
4
|
-
import { deferNonBlocking as
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import { createBarReorder as
|
|
7
|
-
import { resolveActivityBarClick as
|
|
8
|
-
import { isBarItemContextMenuKey as
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
const
|
|
4
|
+
import { deferNonBlocking as H } from "../../utils/defer.js";
|
|
5
|
+
import { Tooltip as U } from "../ui/Tooltip.js";
|
|
6
|
+
import { createBarReorder as V, createBarLayoutMotion as z } from "./barReorder.js";
|
|
7
|
+
import { resolveActivityBarClick as G } from "./activityBarBehavior.js";
|
|
8
|
+
import { isBarItemContextMenuKey as J, keyboardBarItemContextMenuRequest as O } from "./barItemContextMenu.js";
|
|
9
|
+
var Q = /* @__PURE__ */ y('<div class="flex flex-col">'), W = /* @__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">'), Z = /* @__PURE__ */ y("<span aria-hidden=true style=position:absolute;left:6px;right:6px;height:2px;background:var(--ring);border-radius:2px>"), _ = /* @__PURE__ */ y("<span>"), p = /* @__PURE__ */ y("<button type=button data-floe-interactive=press><span aria-hidden=true>");
|
|
10
|
+
function de(t) {
|
|
11
|
+
let v;
|
|
12
|
+
const c = /* @__PURE__ */ new Map(), b = m(() => new Map(t.items.map((i) => [i.id, i]))), d = V({
|
|
13
13
|
keys: () => t.items.filter((i) => i.reorderable !== !1).map((i) => i.id),
|
|
14
|
-
elements:
|
|
15
|
-
container: () =>
|
|
14
|
+
elements: c,
|
|
15
|
+
container: () => v,
|
|
16
16
|
onReorder: () => t.onReorder
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
z({
|
|
19
19
|
keys: () => t.items.map((i) => i.id),
|
|
20
|
-
elements:
|
|
21
|
-
preview: () =>
|
|
20
|
+
elements: c,
|
|
21
|
+
preview: () => d.position()?.order,
|
|
22
22
|
axis: "y"
|
|
23
23
|
});
|
|
24
|
-
const f =
|
|
24
|
+
const f = m(() => t.activeId), B = m(() => t.collapsed ?? !1), x = m(() => t.onActiveChange), r = m(() => t.onCollapsedChange), C = (i) => {
|
|
25
25
|
if (i.onClick) {
|
|
26
|
-
|
|
26
|
+
H(() => i.onClick());
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
const e =
|
|
29
|
+
const e = G({
|
|
30
30
|
clickedId: i.id,
|
|
31
31
|
activeId: f(),
|
|
32
32
|
collapsed: B(),
|
|
@@ -37,47 +37,50 @@ function le(t) {
|
|
|
37
37
|
}) : x()(e.nextActiveId)), typeof e.nextCollapsed == "boolean" && r()?.(e.nextCollapsed);
|
|
38
38
|
};
|
|
39
39
|
return (() => {
|
|
40
|
-
var i =
|
|
41
|
-
return typeof
|
|
40
|
+
var i = W(), e = i.firstChild, l = v;
|
|
41
|
+
return typeof l == "function" ? L(l, e) : v = e, g(e, u(j, {
|
|
42
42
|
get each() {
|
|
43
43
|
return t.items.map((n) => n.id);
|
|
44
44
|
},
|
|
45
|
-
children: (n) =>
|
|
46
|
-
get
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
45
|
+
children: (n) => {
|
|
46
|
+
const o = m((a) => b().get(n) ?? a, X(() => b().get(n)));
|
|
47
|
+
return u(q, {
|
|
48
|
+
get item() {
|
|
49
|
+
return o();
|
|
50
|
+
},
|
|
51
|
+
get isActive() {
|
|
52
|
+
return f() === n;
|
|
53
|
+
},
|
|
54
|
+
onClick: () => {
|
|
55
|
+
d.consumeClick() || C(o());
|
|
56
|
+
},
|
|
57
|
+
elementRef: (a) => {
|
|
58
|
+
a ? c.set(n, a) : c.delete(n);
|
|
59
|
+
},
|
|
60
|
+
onPointerDown: (a) => d.begin(n, a),
|
|
61
|
+
onReorderKey: (a) => d.keyDown(n, a),
|
|
62
|
+
get reorderable() {
|
|
63
|
+
return I(() => !!t.onReorder)() && o().reorderable !== !1;
|
|
64
|
+
},
|
|
65
|
+
get dragging() {
|
|
66
|
+
return d.dragging() === n;
|
|
67
|
+
},
|
|
68
|
+
get dropEdge() {
|
|
69
|
+
return I(() => d.position()?.key === n)() ? d.position()?.edge : void 0;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
})), g(i, u(M, {
|
|
71
74
|
get when() {
|
|
72
75
|
return t.bottomItems?.length;
|
|
73
76
|
},
|
|
74
77
|
get children() {
|
|
75
|
-
var n =
|
|
76
|
-
return
|
|
78
|
+
var n = Q();
|
|
79
|
+
return g(n, u(j, {
|
|
77
80
|
get each() {
|
|
78
81
|
return t.bottomItems;
|
|
79
82
|
},
|
|
80
|
-
children: (o) =>
|
|
83
|
+
children: (o) => u(q, {
|
|
81
84
|
item: o,
|
|
82
85
|
get isActive() {
|
|
83
86
|
return f() === o.id;
|
|
@@ -87,8 +90,8 @@ function le(t) {
|
|
|
87
90
|
})), n;
|
|
88
91
|
}
|
|
89
92
|
}), 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),
|
|
91
|
-
return o !== n.e && A(i, n.e = o),
|
|
93
|
+
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), a = t.ariaLabel;
|
|
94
|
+
return o !== n.e && A(i, n.e = o), a !== n.t && s(i, "aria-label", n.t = a), n;
|
|
92
95
|
}, {
|
|
93
96
|
e: void 0,
|
|
94
97
|
t: void 0
|
|
@@ -96,15 +99,15 @@ function le(t) {
|
|
|
96
99
|
})();
|
|
97
100
|
}
|
|
98
101
|
function q(t) {
|
|
99
|
-
let
|
|
100
|
-
const
|
|
102
|
+
let v;
|
|
103
|
+
const c = () => typeof t.item.badge == "function" ? t.item.badge() : t.item.badge, b = () => typeof t.item.ariaExpanded == "function" ? t.item.ariaExpanded() : t.item.ariaExpanded, d = () => t.isActive || b() === !0;
|
|
101
104
|
let f;
|
|
102
|
-
|
|
105
|
+
Y(() => {
|
|
103
106
|
const r = t.item.buttonRef;
|
|
104
|
-
r?.(
|
|
107
|
+
r?.(v ?? null), t.elementRef?.(v ?? null), f = () => {
|
|
105
108
|
r?.(null), t.elementRef?.(null);
|
|
106
109
|
};
|
|
107
|
-
}),
|
|
110
|
+
}), F(() => f?.());
|
|
108
111
|
const B = (r) => {
|
|
109
112
|
t.item.onContextMenu && (r.preventDefault(), r.stopPropagation(), t.item.onContextMenu({
|
|
110
113
|
trigger: r.currentTarget,
|
|
@@ -113,56 +116,58 @@ function q(t) {
|
|
|
113
116
|
source: "pointer"
|
|
114
117
|
}));
|
|
115
118
|
}, x = (r) => {
|
|
116
|
-
t.onReorderKey?.(r), !(r.defaultPrevented || !t.item.onContextMenu || !
|
|
119
|
+
t.onReorderKey?.(r), !(r.defaultPrevented || !t.item.onContextMenu || !J(r)) && (r.preventDefault(), r.stopPropagation(), t.item.onContextMenu(O(r.currentTarget)));
|
|
117
120
|
};
|
|
118
|
-
return
|
|
121
|
+
return u(U, {
|
|
119
122
|
get content() {
|
|
120
123
|
return t.item.label;
|
|
121
124
|
},
|
|
122
125
|
placement: "right",
|
|
123
126
|
delay: 0,
|
|
127
|
+
triggerClass: "shrink-0",
|
|
128
|
+
portalScope: "viewport",
|
|
124
129
|
get children() {
|
|
125
|
-
var r =
|
|
130
|
+
var r = p(), C = r.firstChild;
|
|
126
131
|
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 =
|
|
128
|
-
return typeof i == "function" ? L(i, r) :
|
|
132
|
+
var i = v;
|
|
133
|
+
return typeof i == "function" ? L(i, r) : v = r, g(r, u(T, {
|
|
129
134
|
get component() {
|
|
130
135
|
return t.item.icon;
|
|
131
136
|
},
|
|
132
137
|
get active() {
|
|
133
|
-
return
|
|
138
|
+
return d();
|
|
134
139
|
},
|
|
135
140
|
get class() {
|
|
136
|
-
return h("relative w-5 h-5 transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]",
|
|
141
|
+
return h("relative w-5 h-5 transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", d() ? "text-activity-bar-foreground-active" : "group-hover/activity-item:text-activity-bar-foreground-active");
|
|
137
142
|
}
|
|
138
|
-
}), null),
|
|
143
|
+
}), null), g(r, u(M, {
|
|
139
144
|
get when() {
|
|
140
145
|
return t.dropEdge;
|
|
141
146
|
},
|
|
142
147
|
get children() {
|
|
143
|
-
var e =
|
|
144
|
-
return k((
|
|
148
|
+
var e = Z();
|
|
149
|
+
return k((l) => {
|
|
145
150
|
var n = t.dropEdge === "before" ? "0" : void 0, o = t.dropEdge === "after" ? "0" : void 0;
|
|
146
|
-
return n !==
|
|
151
|
+
return n !== l.e && w(e, "top", l.e = n), o !== l.t && w(e, "bottom", l.t = o), l;
|
|
147
152
|
}, {
|
|
148
153
|
e: void 0,
|
|
149
154
|
t: void 0
|
|
150
155
|
}), e;
|
|
151
156
|
}
|
|
152
|
-
}), null),
|
|
157
|
+
}), null), g(r, u(M, {
|
|
153
158
|
get when() {
|
|
154
|
-
return
|
|
159
|
+
return c();
|
|
155
160
|
},
|
|
156
161
|
get children() {
|
|
157
|
-
var e =
|
|
158
|
-
return
|
|
159
|
-
var
|
|
160
|
-
return () =>
|
|
162
|
+
var e = _();
|
|
163
|
+
return g(e, (() => {
|
|
164
|
+
var l = I(() => typeof c() == "number" && c() > 99);
|
|
165
|
+
return () => l() ? "99+" : c();
|
|
161
166
|
})()), 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;
|
|
162
167
|
}
|
|
163
168
|
}), null), k((e) => {
|
|
164
|
-
var
|
|
165
|
-
return
|
|
169
|
+
var l = t.item.id, n = t.reorderable ? "Alt+Shift+ArrowUp Alt+Shift+ArrowDown" : void 0, o = t.reorderable ? "none" : void 0, a = 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", d() && "text-activity-bar-foreground-active"), D = t.item.label, E = t.isActive, S = b(), $ = t.item.ariaControls, P = 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)]", d() ? "bg-[var(--floe-state-selected)]" : "bg-transparent group-hover/activity-item:bg-[var(--floe-state-hover)]");
|
|
170
|
+
return l !== e.e && s(r, "data-floe-bar-key", e.e = l), n !== e.t && s(r, "aria-keyshortcuts", e.t = n), o !== e.a && w(r, "touch-action", e.a = o), a !== e.o && w(r, "opacity", e.o = a), R !== e.i && A(r, e.i = R), D !== e.n && s(r, "aria-label", e.n = D), E !== e.s && s(r, "aria-pressed", e.s = E), S !== e.h && s(r, "aria-expanded", e.h = S), $ !== e.r && s(r, "aria-controls", e.r = $), P !== e.d && s(r, "aria-haspopup", e.d = P), K !== e.l && A(C, e.l = K), e;
|
|
166
171
|
}, {
|
|
167
172
|
e: void 0,
|
|
168
173
|
t: void 0,
|
|
@@ -181,5 +186,5 @@ function q(t) {
|
|
|
181
186
|
}
|
|
182
187
|
N(["pointerdown", "click", "contextmenu", "keydown"]);
|
|
183
188
|
export {
|
|
184
|
-
|
|
189
|
+
de as ActivityBar
|
|
185
190
|
};
|
|
@@ -1,114 +1,132 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { startPointerSession as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
if (!n.includes(
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
return
|
|
1
|
+
import { createSignal as D, createEffect as R, onCleanup as v } from "solid-js";
|
|
2
|
+
import { startPointerSession as T } from "../ui/pointerSession.js";
|
|
3
|
+
function A(n, m, i, y, h) {
|
|
4
|
+
const t = n.filter((p) => p !== m && i.has(p));
|
|
5
|
+
if (!n.includes(m) || !t.length) return;
|
|
6
|
+
let a = t.findIndex((p) => {
|
|
7
|
+
const x = i.get(p), e = x.getBoundingClientRect(), o = getComputedStyle(x).transform, r = typeof DOMMatrix == "function" ? new DOMMatrix(o === "none" ? void 0 : o) : void 0;
|
|
8
|
+
return h < (y === "x" ? e.left - (r?.m41 ?? 0) + e.width / 2 : e.top - (r?.m42 ?? 0) + e.height / 2);
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
return
|
|
10
|
+
a < 0 && (a = t.length);
|
|
11
|
+
const u = [...t];
|
|
12
|
+
return u.splice(a, 0, m), { key: t[Math.min(a, t.length - 1)], edge: a === t.length ? "after" : "before", order: u };
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
const
|
|
22
|
-
return
|
|
14
|
+
function B(n, m, i, y) {
|
|
15
|
+
if (!i.altKey || !i.shiftKey || i.ctrlKey || i.metaKey || i.isComposing) return;
|
|
16
|
+
const h = i.key === (y === "x" ? "ArrowLeft" : "ArrowUp") ? -1 : i.key === (y === "x" ? "ArrowRight" : "ArrowDown") ? 1 : 0, t = n.indexOf(m);
|
|
17
|
+
if (!h || t < 0) return;
|
|
18
|
+
i.preventDefault(), i.stopPropagation();
|
|
19
|
+
const a = Math.max(0, Math.min(n.length - 1, t + h));
|
|
20
|
+
if (t === a) return;
|
|
21
|
+
const u = [...n];
|
|
22
|
+
return u.splice(t, 1), u.splice(a, 0, m), u;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const [
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
|
|
24
|
+
function Y(n) {
|
|
25
|
+
const [m, i] = D(), [y, h] = D();
|
|
26
|
+
let t, a = !1, u = 0, p;
|
|
27
|
+
const x = (o) => {
|
|
28
|
+
o.key !== "Escape" || !t || (o.preventDefault(), o.stopPropagation(), t.stop({ commit: !1 }));
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
n.keys(), n.onReorder(),
|
|
32
|
-
}),
|
|
33
|
-
|
|
30
|
+
R(() => {
|
|
31
|
+
n.keys(), n.onReorder(), t?.stop({ commit: !1 });
|
|
32
|
+
}), v(() => {
|
|
33
|
+
t?.stop({ commit: !1 }), p && clearTimeout(p);
|
|
34
34
|
});
|
|
35
|
-
const
|
|
36
|
-
n.onReorder()?.(
|
|
35
|
+
const e = (o, r) => {
|
|
36
|
+
n.onReorder()?.(r), n.elements.get(o)?.focus({ preventScroll: !0 });
|
|
37
37
|
};
|
|
38
38
|
return {
|
|
39
|
-
dragging:
|
|
40
|
-
position:
|
|
41
|
-
keyDown(
|
|
39
|
+
dragging: m,
|
|
40
|
+
position: y,
|
|
41
|
+
keyDown(o, r) {
|
|
42
42
|
if (!n.onReorder()) return;
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const l = B(n.keys(), o, r, "y");
|
|
44
|
+
l && e(o, l);
|
|
45
45
|
},
|
|
46
46
|
consumeClick() {
|
|
47
|
-
return
|
|
47
|
+
return a ? (a = !1, !0) : !1;
|
|
48
48
|
},
|
|
49
|
-
begin(
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
o
|
|
57
|
-
const
|
|
58
|
-
|
|
49
|
+
begin(o, r) {
|
|
50
|
+
if (r.button !== 0 || !n.onReorder() || !n.keys().includes(o)) return;
|
|
51
|
+
t?.stop({ commit: !1 });
|
|
52
|
+
const l = r.currentTarget, M = r.clientY, w = r.clientX;
|
|
53
|
+
let d = w, c = M, b = !1;
|
|
54
|
+
const k = (f, s) => {
|
|
55
|
+
if (d = f, c = s, b ||= Math.hypot(f - w, s - M) >= 5, !b) return;
|
|
56
|
+
i(o);
|
|
57
|
+
const g = n.container()?.getBoundingClientRect();
|
|
58
|
+
h(g && f >= g.left - 24 && f <= g.right + 24 && s >= g.top && s <= g.bottom ? A(n.keys(), o, n.elements, "y", s) : void 0);
|
|
59
|
+
}, C = () => {
|
|
60
|
+
const f = n.container();
|
|
61
|
+
if (b && f) {
|
|
62
|
+
const s = f.getBoundingClientRect(), g = c < s.top + 28 ? c - s.top - 28 : c > s.bottom - 28 ? c - s.bottom + 28 : 0;
|
|
63
|
+
if (d >= s.left - 24 && d <= s.right + 24 && c >= s.top - 24 && c <= s.bottom + 24 && g) {
|
|
64
|
+
const E = f.scrollTop;
|
|
65
|
+
f.scrollTop += Math.sign(g) * Math.min(10, Math.abs(g) / 3), f.scrollTop !== E && k(d, c);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
u = requestAnimationFrame(C);
|
|
59
69
|
};
|
|
60
|
-
|
|
61
|
-
pointerEvent:
|
|
62
|
-
captureEl:
|
|
63
|
-
onMove: (
|
|
64
|
-
onEnd: ({ commit:
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, 0)),
|
|
70
|
+
u = requestAnimationFrame(C), l.ownerDocument.addEventListener("keydown", x, !0), t = T({
|
|
71
|
+
pointerEvent: r,
|
|
72
|
+
captureEl: l,
|
|
73
|
+
onMove: (f) => k(f.clientX, f.clientY),
|
|
74
|
+
onEnd: ({ commit: f, snapshot: s }) => {
|
|
75
|
+
k(s.latestClientX, s.latestClientY);
|
|
76
|
+
const g = y();
|
|
77
|
+
cancelAnimationFrame(u), t = void 0, l.ownerDocument.removeEventListener("keydown", x, !0), i(void 0), h(void 0), b && (a = !0, p && clearTimeout(p), p = setTimeout(() => {
|
|
78
|
+
a = !1;
|
|
79
|
+
}, 0)), f && b && g && e(o, g.order);
|
|
70
80
|
}
|
|
71
81
|
});
|
|
72
82
|
}
|
|
73
83
|
};
|
|
74
84
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
function $(n) {
|
|
86
|
+
const m = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
87
|
+
let y = !1, h = 0;
|
|
88
|
+
R(() => {
|
|
89
|
+
const t = [...n.keys()], a = n.preview(), u = ++h;
|
|
90
|
+
queueMicrotask(() => {
|
|
91
|
+
if (h !== u) return;
|
|
92
|
+
const p = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, x = new Map(t.flatMap((e) => {
|
|
93
|
+
const o = n.elements.get(e);
|
|
94
|
+
if (!o) return [];
|
|
95
|
+
const r = o.getBoundingClientRect(), l = getComputedStyle(o).transform, M = typeof DOMMatrix == "function" ? new DOMMatrix(l === "none" ? void 0 : l) : void 0;
|
|
96
|
+
let w = 0, d = 0;
|
|
97
|
+
for (let c = o.parentElement; c; c = c.parentElement)
|
|
98
|
+
w += c.scrollLeft, d += c.scrollTop;
|
|
99
|
+
return [[e, { left: r.left + w - (M?.m41 ?? 0), top: r.top + d - (M?.m42 ?? 0), dx: M?.m41 ?? 0, dy: M?.m42 ?? 0 }]];
|
|
100
|
+
}));
|
|
101
|
+
for (const e of t) {
|
|
102
|
+
const o = n.elements.get(e), r = x.get(e);
|
|
103
|
+
if (!o || !r) continue;
|
|
104
|
+
const l = m.get(e), M = a ? t[a.indexOf(e)] : e, w = x.get(M) ?? r, d = n.axis === "x" ? w.left - r.left : 0, c = n.axis === "y" ? w.top - r.top : 0;
|
|
105
|
+
if (i.get(e)?.cancel(), i.delete(e), o.style.transform = d || c ? `translate3d(${d}px, ${c}px, 0)` : "", !p && y && typeof o.animate == "function") {
|
|
106
|
+
const b = l ? l.left - r.left + r.dx : d, k = l ? l.top - r.top + r.dy : c;
|
|
107
|
+
if (!l || Math.abs(b - d) + Math.abs(k - c) > 0.5) {
|
|
108
|
+
const C = o.animate([
|
|
109
|
+
{ transform: `translate3d(${b}px, ${k}px, 0)`, opacity: l ? 1 : 0 },
|
|
110
|
+
{ transform: `translate3d(${d}px, ${c}px, 0)`, opacity: 1 }
|
|
111
|
+
], { duration: 180, easing: "cubic-bezier(0.33, 1, 0.68, 1)" });
|
|
112
|
+
i.set(e, C), C.onfinish = () => {
|
|
113
|
+
i.get(e) === C && i.delete(e);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
99
116
|
}
|
|
117
|
+
m.set(e, { left: r.left, top: r.top });
|
|
100
118
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
for (const
|
|
119
|
+
for (const e of m.keys()) t.includes(e) || (m.delete(e), i.get(e)?.cancel(), i.delete(e));
|
|
120
|
+
y = !0;
|
|
121
|
+
});
|
|
122
|
+
}), v(() => {
|
|
123
|
+
h += 1;
|
|
124
|
+
for (const t of i.values()) t.cancel();
|
|
107
125
|
});
|
|
108
126
|
}
|
|
109
127
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
A as barDropPosition,
|
|
129
|
+
$ as createBarLayoutMotion,
|
|
130
|
+
Y as createBarReorder,
|
|
131
|
+
B as keyboardBarOrder
|
|
114
132
|
};
|