@floegence/floe-webapp-core 0.60.0 → 0.60.2
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/app/ActivityAppsMain.d.ts +2 -0
- package/dist/app/ActivityAppsMain.js +15 -12
- package/dist/components/file-browser/Breadcrumb.js +6 -6
- package/dist/components/file-browser/FileGridView.js +29 -27
- package/dist/components/file-browser/FileListView.js +15 -13
- package/dist/components/layout/KeepAliveStack.d.ts +2 -0
- package/dist/components/layout/KeepAliveStack.js +118 -101
- package/dist/components/ui/DirectoryPicker.d.ts +1 -1
- package/dist/components/ui/DirectoryPicker.js +36 -52
- package/dist/components/ui/picker/PickerBase.d.ts +6 -0
- package/dist/components/ui/picker/PickerBase.js +345 -232
- package/dist/context/ViewActivationContext.d.ts +4 -1
- package/dist/context/ViewActivationContext.js +14 -11
- package/dist/hooks/useResizeObserver.d.ts +5 -1
- package/dist/hooks/useResizeObserver.js +13 -14
- package/dist/hooks/useVirtualWindow.js +13 -13
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Accessor, type JSX } from 'solid-js';
|
|
2
2
|
export interface ViewActivationContextValue {
|
|
3
3
|
id: string;
|
|
4
|
+
/** Immediate presentation visibility. Custom providers default to their active accessor. */
|
|
5
|
+
visible?: Accessor<boolean>;
|
|
6
|
+
/** Activation effects may wait until after the visible content paints. */
|
|
4
7
|
active: Accessor<boolean>;
|
|
5
8
|
activationSeq: Accessor<number>;
|
|
6
9
|
}
|
|
@@ -9,4 +12,4 @@ export interface ViewActivationProviderProps {
|
|
|
9
12
|
children: JSX.Element;
|
|
10
13
|
}
|
|
11
14
|
export declare function ViewActivationProvider(props: ViewActivationProviderProps): JSX.Element;
|
|
12
|
-
export declare function useViewActivation(): ViewActivationContextValue
|
|
15
|
+
export declare function useViewActivation(): Required<ViewActivationContextValue>;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const o =
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { createComponent as a } from "solid-js/web";
|
|
2
|
+
import { useContext as o, untrack as v, createContext as u } from "solid-js";
|
|
3
|
+
const i = u();
|
|
4
|
+
function w(t) {
|
|
5
|
+
const n = o(i), e = v(() => t.value), r = e.visible ?? e.active, c = {
|
|
6
|
+
...e,
|
|
7
|
+
visible: () => (n?.visible() ?? !0) && r()
|
|
8
|
+
};
|
|
9
|
+
return a(i.Provider, {
|
|
10
|
+
value: c,
|
|
8
11
|
get children() {
|
|
9
12
|
return t.children;
|
|
10
13
|
}
|
|
11
14
|
});
|
|
12
15
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
16
|
+
function d() {
|
|
17
|
+
const t = o(i);
|
|
15
18
|
if (!t)
|
|
16
19
|
throw new Error("ViewActivationContext not found. Wrap your view with <ViewActivationProvider />.");
|
|
17
20
|
return t;
|
|
18
21
|
}
|
|
19
22
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
w as ViewActivationProvider,
|
|
24
|
+
d as useViewActivation
|
|
22
25
|
};
|
|
@@ -6,5 +6,9 @@ export interface Size {
|
|
|
6
6
|
/**
|
|
7
7
|
* Track the usable content box in local CSS pixels, excluding padding and
|
|
8
8
|
* scrollbars. CSS transforms on the element or its ancestors do not affect it.
|
|
9
|
+
* With preserveWhenHidden, retain the last measurement while there is no rendered
|
|
10
|
+
* box. Real zero-sized boxes still report zero; replacing the element resets it.
|
|
9
11
|
*/
|
|
10
|
-
export declare function useResizeObserver(element: Accessor<HTMLElement | null | undefined
|
|
12
|
+
export declare function useResizeObserver(element: Accessor<HTMLElement | null | undefined>, options?: {
|
|
13
|
+
preserveWhenHidden?: boolean;
|
|
14
|
+
}): Accessor<Size | null>;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
function
|
|
3
|
-
const [
|
|
1
|
+
import { createSignal as l, createEffect as u, onCleanup as d } from "solid-js";
|
|
2
|
+
function g(o, a = {}) {
|
|
3
|
+
const [c, r] = l(null, {
|
|
4
4
|
equals: (e, t) => e?.width === t?.width && e?.height === t?.height
|
|
5
5
|
});
|
|
6
|
-
return
|
|
7
|
-
const e =
|
|
8
|
-
if (!e)
|
|
9
|
-
r(null);
|
|
6
|
+
return u(() => {
|
|
7
|
+
const e = o();
|
|
8
|
+
if (r(null), !e)
|
|
10
9
|
return;
|
|
11
|
-
}
|
|
12
10
|
const t = () => {
|
|
13
|
-
|
|
11
|
+
if (a.preserveWhenHidden && e.getClientRects().length === 0) return;
|
|
12
|
+
const n = e.ownerDocument.defaultView.getComputedStyle(e), i = (h) => Number.parseFloat(h) || 0;
|
|
14
13
|
r({
|
|
15
14
|
width: Math.max(0, e.clientWidth - i(n.paddingLeft) - i(n.paddingRight)),
|
|
16
15
|
height: Math.max(0, e.clientHeight - i(n.paddingTop) - i(n.paddingBottom))
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
18
|
if (t(), typeof ResizeObserver > "u") {
|
|
20
|
-
typeof window < "u" && (window.addEventListener("resize", t),
|
|
19
|
+
typeof window < "u" && (window.addEventListener("resize", t), d(() => window.removeEventListener("resize", t)));
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
}),
|
|
22
|
+
const s = new ResizeObserver(t);
|
|
23
|
+
s.observe(e), d(() => s.disconnect());
|
|
24
|
+
}), c;
|
|
26
25
|
}
|
|
27
26
|
export {
|
|
28
|
-
|
|
27
|
+
g as useResizeObserver
|
|
29
28
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createSignal as f, createMemo as i, onCleanup as F } from "solid-js";
|
|
2
|
-
function
|
|
3
|
-
const a =
|
|
4
|
-
let
|
|
2
|
+
function T(t) {
|
|
3
|
+
const a = t.overscan ?? 8;
|
|
4
|
+
let e = null, o = null, r = null;
|
|
5
5
|
const [m, d] = f(0), [z, S] = f(0), c = () => {
|
|
6
|
-
|
|
6
|
+
!e || e.getClientRects().length === 0 || (d(e.scrollTop), S(e.clientHeight));
|
|
7
7
|
}, p = () => {
|
|
8
|
-
if (
|
|
8
|
+
if (e && r === null) {
|
|
9
9
|
if (typeof requestAnimationFrame > "u") {
|
|
10
10
|
c();
|
|
11
11
|
return;
|
|
@@ -15,20 +15,20 @@ function x(e) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
}, l = i(() => {
|
|
18
|
-
const n =
|
|
18
|
+
const n = t.count(), s = t.itemSize(), u = m(), w = z();
|
|
19
19
|
if (n <= 0 || s <= 0) return { start: 0, end: 0 };
|
|
20
20
|
const b = Math.max(0, Math.floor(u / s) - a), A = Math.min(n, Math.ceil((u + w) / s) + a);
|
|
21
21
|
return { start: b, end: A };
|
|
22
|
-
}), v = i(() => l().start *
|
|
23
|
-
const n =
|
|
24
|
-
return Math.max(0, n - l().end) *
|
|
25
|
-
}),
|
|
26
|
-
|
|
22
|
+
}), v = i(() => l().start * t.itemSize()), g = i(() => {
|
|
23
|
+
const n = t.count();
|
|
24
|
+
return Math.max(0, n - l().end) * t.itemSize();
|
|
25
|
+
}), h = i(() => t.count() * t.itemSize()), M = (n) => {
|
|
26
|
+
e !== n && (o?.disconnect(), o = null, e = n, e && (c(), !(typeof ResizeObserver > "u") && (o = new ResizeObserver(() => c()), o.observe(e))));
|
|
27
27
|
};
|
|
28
28
|
return F(() => {
|
|
29
29
|
o?.disconnect(), r !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(r), r = null);
|
|
30
|
-
}), { scrollRef:
|
|
30
|
+
}), { scrollRef: M, onScroll: p, range: l, paddingTop: v, paddingBottom: g, totalSize: h };
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
T as useVirtualWindow
|
|
34
34
|
};
|