@floegence/floe-webapp-core 0.52.3 → 0.52.4
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/file-browser/FileContextMenu.d.ts +12 -2
- package/dist/components/file-browser/FileContextMenu.js +394 -268
- package/dist/components/file-browser/index.d.ts +1 -0
- package/dist/components/file-browser/longPressContextMenu.js +58 -45
- package/dist/components/ui/SurfaceFloatingLayer.d.ts +2 -0
- package/dist/components/ui/SurfaceFloatingLayer.js +29 -24
- package/dist/components/ui/dialogSurfaceScope.d.ts +5 -0
- package/dist/components/ui/dialogSurfaceScope.js +81 -70
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/surfaceFloatingBoundary.d.ts +12 -0
- package/dist/components/ui/surfaceFloatingBoundary.js +53 -0
- package/dist/components/ui/surfacePortalScope.d.ts +1 -1
- package/dist/file-browser.js +26 -24
- package/dist/full.js +204 -200
- package/dist/styles.css +1 -1
- package/dist/ui.js +15 -13
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { createLongPressContextMenuHandlers } from './longPressContextMenu';
|
|
1
2
|
export { FileBrowser, type FileBrowserProps } from './FileBrowser';
|
|
2
3
|
export { FileBrowserProvider, useFileBrowser, type FileBrowserProviderProps, } from './FileBrowserContext';
|
|
3
4
|
export { DirectoryTree, type DirectoryTreeProps } from './DirectoryTree';
|
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
import { onCleanup as
|
|
2
|
-
import { createItemContextMenuEvent as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { onCleanup as D } from "solid-js";
|
|
2
|
+
import { createItemContextMenuEvent as w } from "./contextMenuEvent.js";
|
|
3
|
+
function S(c, l, a) {
|
|
4
|
+
const C = a?.delayMs ?? 500, g = a?.moveTolerancePx ?? 10, x = a?.selectOnOpen ?? !0, f = a?.source ?? "list";
|
|
5
|
+
let t = null, s = null, u = !1, d = null, p = null;
|
|
6
|
+
const n = () => {
|
|
7
|
+
t !== null && typeof window < "u" && (window.clearTimeout(t), t = null), s = null, d?.removeEventListener("pointerdown", m, !0), d = null, p = null;
|
|
8
|
+
}, m = (e) => {
|
|
9
|
+
p !== null && e.pointerId !== p && (n(), u = !0);
|
|
10
|
+
}, i = () => {
|
|
11
|
+
u = !0;
|
|
12
|
+
}, y = (e, o) => {
|
|
13
|
+
if (!x) {
|
|
14
|
+
c.showContextMenu(
|
|
15
|
+
w({
|
|
16
|
+
x: e,
|
|
17
|
+
y: o,
|
|
18
|
+
triggerItem: l,
|
|
19
|
+
items: [l],
|
|
20
|
+
source: f
|
|
21
|
+
})
|
|
22
|
+
), i();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
c.ensureContextMenuSelection(l.id);
|
|
26
|
+
const r = c.getSelectedItemsList(), h = r.length > 0 ? r : [l];
|
|
27
|
+
c.showContextMenu(
|
|
28
|
+
w({
|
|
13
29
|
x: e,
|
|
14
|
-
y:
|
|
15
|
-
triggerItem:
|
|
16
|
-
items:
|
|
30
|
+
y: o,
|
|
31
|
+
triggerItem: l,
|
|
32
|
+
items: h,
|
|
17
33
|
source: f
|
|
18
|
-
})
|
|
34
|
+
})
|
|
35
|
+
), i();
|
|
36
|
+
}, M = (e) => {
|
|
37
|
+
if (u = !1, e.pointerType === "mouse") return;
|
|
38
|
+
if (e.isPrimary === !1) {
|
|
39
|
+
n(), i();
|
|
19
40
|
return;
|
|
20
41
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
y
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, d);
|
|
37
|
-
}, M = (e) => {
|
|
38
|
-
if (n === null || !s) return;
|
|
39
|
-
const t = e.clientX - s.x, o = e.clientY - s.y;
|
|
40
|
-
Math.hypot(t, o) > m && (l(), a());
|
|
41
|
-
}, y = () => l(), g = () => l(), P = (e) => i ? (i = !1, e.preventDefault(), e.stopPropagation(), !0) : !1;
|
|
42
|
-
return v(() => {
|
|
43
|
-
l();
|
|
42
|
+
if (typeof window > "u") return;
|
|
43
|
+
n(), p = e.pointerId, d = e.currentTarget instanceof Node ? e.currentTarget.ownerDocument : document, d?.addEventListener("pointerdown", m, !0), s = { x: e.clientX, y: e.clientY };
|
|
44
|
+
const o = e.clientX, r = e.clientY;
|
|
45
|
+
t = window.setTimeout(() => {
|
|
46
|
+
t = null, y(o, r);
|
|
47
|
+
}, C);
|
|
48
|
+
}, P = (e) => {
|
|
49
|
+
if (t === null || !s) return;
|
|
50
|
+
const o = e.clientX - s.x, r = e.clientY - s.y;
|
|
51
|
+
Math.hypot(o, r) > g && (n(), i());
|
|
52
|
+
}, v = () => n(), I = () => {
|
|
53
|
+
n(), i();
|
|
54
|
+
}, T = (e) => u ? (u = !1, e.preventDefault(), e.stopPropagation(), !0) : !1;
|
|
55
|
+
return D(() => {
|
|
56
|
+
n();
|
|
44
57
|
}), {
|
|
45
|
-
onPointerDown:
|
|
46
|
-
onPointerMove:
|
|
47
|
-
onPointerUp:
|
|
48
|
-
onPointerCancel:
|
|
49
|
-
consumeClickSuppression:
|
|
58
|
+
onPointerDown: M,
|
|
59
|
+
onPointerMove: P,
|
|
60
|
+
onPointerUp: v,
|
|
61
|
+
onPointerCancel: I,
|
|
62
|
+
consumeClickSuppression: T
|
|
50
63
|
};
|
|
51
64
|
}
|
|
52
65
|
export {
|
|
53
|
-
|
|
66
|
+
S as createLongPressContextMenuHandlers
|
|
54
67
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
+
import { type SurfaceFloatingBoundary } from './surfaceFloatingBoundary';
|
|
2
3
|
export type SurfaceFloatingLayerPosition = Readonly<{
|
|
3
4
|
x: number;
|
|
4
5
|
y: number;
|
|
@@ -11,6 +12,7 @@ export interface SurfaceFloatingLayerProps extends Omit<JSX.HTMLAttributes<HTMLD
|
|
|
11
12
|
position: SurfaceFloatingLayerPosition;
|
|
12
13
|
/** Stable trigger or anchor used to resolve the owning projected surface. */
|
|
13
14
|
owner?: Element | null;
|
|
15
|
+
boundary?: SurfaceFloatingBoundary;
|
|
14
16
|
estimatedSize?: SurfaceFloatingLayerSize;
|
|
15
17
|
clamp?: boolean;
|
|
16
18
|
class?: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { createComponent as m, Portal as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { LOCAL_INTERACTION_SURFACE_ATTR as
|
|
5
|
-
import { clampMenuPosition as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { createComponent as m, Portal as y, use as S, spread as v, mergeProps as h, insert as P, template as R } from "solid-js/web";
|
|
2
|
+
import { splitProps as g, createMemo as n } from "solid-js";
|
|
3
|
+
import { cn as A } from "../../utils/cn.js";
|
|
4
|
+
import { LOCAL_INTERACTION_SURFACE_ATTR as _ } from "./localInteractionSurface.js";
|
|
5
|
+
import { clampMenuPosition as b } from "./menuUtils.js";
|
|
6
|
+
import { readSurfaceSafeArea as T, resolveFloatingBoundary as z } from "./surfaceFloatingBoundary.js";
|
|
7
|
+
import { resolveSurfacePortalHost as C, SURFACE_FLOATING_LAYER_ATTR as w, resolveSurfacePortalMount as x, resolveSurfacePortalBoundaryRect as F, isSurfacePortalMode as L, projectSurfacePortalPosition as M } from "./dialogSurfaceScope.js";
|
|
8
|
+
var $ = /* @__PURE__ */ R("<div>");
|
|
9
|
+
function B() {
|
|
9
10
|
return {
|
|
10
11
|
left: 0,
|
|
11
12
|
top: 0,
|
|
@@ -15,38 +16,42 @@ function w() {
|
|
|
15
16
|
height: 0
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const [e,
|
|
19
|
+
function G(l) {
|
|
20
|
+
const [e, c] = g(l, ["position", "owner", "boundary", "estimatedSize", "clamp", "class", "style", "children", "layerRef"]), o = n(() => C({
|
|
20
21
|
owner: e.owner ?? null
|
|
21
|
-
})),
|
|
22
|
+
})), i = () => L(o()), u = n(() => (e.position, T())), r = () => e.boundary === void 0 ? F(o()) : z(o(), e.boundary, u()) ?? B(), d = () => e.clamp !== !1 && !!e.estimatedSize, f = n(() => {
|
|
22
23
|
const t = e.position;
|
|
23
|
-
return !
|
|
24
|
-
}),
|
|
24
|
+
return !d() || !e.estimatedSize ? t : b(t, e.estimatedSize, r());
|
|
25
|
+
}), a = () => M(f(), o()), p = () => ({
|
|
25
26
|
...e.style ?? {},
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
...e.boundary !== void 0 && (r().width <= 16 || r().height <= 16) ? {
|
|
28
|
+
visibility: "hidden",
|
|
29
|
+
"pointer-events": "none"
|
|
30
|
+
} : {},
|
|
31
|
+
left: `${a().x}px`,
|
|
32
|
+
top: `${a().y}px`
|
|
28
33
|
});
|
|
29
|
-
return m(
|
|
34
|
+
return m(y, {
|
|
30
35
|
get mount() {
|
|
31
|
-
return
|
|
36
|
+
return x(o());
|
|
32
37
|
},
|
|
33
38
|
get children() {
|
|
34
39
|
var t = $(), s = e.layerRef;
|
|
35
|
-
return typeof s == "function" ?
|
|
40
|
+
return typeof s == "function" ? S(s, t) : e.layerRef = t, v(t, h(c, {
|
|
36
41
|
get class() {
|
|
37
|
-
return
|
|
42
|
+
return A(i() ? "absolute z-20" : "fixed z-50", e.class);
|
|
38
43
|
},
|
|
39
44
|
get style() {
|
|
40
|
-
return
|
|
45
|
+
return p();
|
|
41
46
|
}
|
|
42
47
|
}, {
|
|
43
|
-
[
|
|
48
|
+
[w]: "true"
|
|
44
49
|
}, () => ({
|
|
45
|
-
[
|
|
46
|
-
})), !1, !0),
|
|
50
|
+
[_]: i() ? "true" : void 0
|
|
51
|
+
})), !1, !0), P(t, () => e.children), t;
|
|
47
52
|
}
|
|
48
53
|
});
|
|
49
54
|
}
|
|
50
55
|
export {
|
|
51
|
-
|
|
56
|
+
G as SurfaceFloatingLayer
|
|
52
57
|
};
|
|
@@ -25,12 +25,17 @@ export type SurfacePortalHostResolutionOptions = Readonly<{
|
|
|
25
25
|
}>;
|
|
26
26
|
export declare function ensureDialogSurfaceInteractionTracking(): void;
|
|
27
27
|
export declare function ensureSurfacePortalInteractionTracking(): void;
|
|
28
|
+
export declare function readFreshInteractionSnapshot(): DialogSurfaceInteractionSnapshot | null;
|
|
28
29
|
export declare function resolveDialogSurfaceHost(options?: SurfacePortalHostResolutionOptions): ResolvedDialogSurfaceHost;
|
|
29
30
|
export declare function resolveSurfacePortalHost(options?: SurfacePortalHostResolutionOptions): ResolvedSurfacePortalHost;
|
|
30
31
|
export declare function isSurfacePortalMode(surfaceHost: ResolvedSurfacePortalHost): boolean;
|
|
31
32
|
export declare function resolveSurfacePortalMount(surfaceHost: ResolvedSurfacePortalHost): HTMLElement | undefined;
|
|
32
33
|
export declare function resolveSurfacePortalBoundaryRect(surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
|
|
33
34
|
export declare function resolveSurfacePortalMountRect(surfaceHost: ResolvedSurfacePortalHost): SurfacePortalBoundaryRect;
|
|
35
|
+
export declare function resolveSurfacePortalScale(surfaceHost: ResolvedSurfacePortalHost): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
34
39
|
export declare function projectSurfacePortalPosition(position: Readonly<{
|
|
35
40
|
x: number;
|
|
36
41
|
y: number;
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
function
|
|
1
|
+
const g = "data-floe-dialog-surface-host", b = g, E = "data-floe-surface-portal-layer", P = "data-floe-surface-floating-layer", x = "data-floe-dialog-surface-boundary", T = 1600;
|
|
2
|
+
let u = null, r = null;
|
|
3
|
+
function w(t) {
|
|
4
4
|
return typeof Element < "u" && t instanceof Element ? t : typeof Node < "u" && t instanceof Node ? t.parentElement : null;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function R(t) {
|
|
7
7
|
const e = t?.activeElement;
|
|
8
8
|
return e instanceof Element ? e : null;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function c(t) {
|
|
11
11
|
const e = typeof document < "u" ? document : null;
|
|
12
|
-
|
|
13
|
-
target:
|
|
14
|
-
activeElement:
|
|
12
|
+
u = {
|
|
13
|
+
target: w(t),
|
|
14
|
+
activeElement: R(e),
|
|
15
15
|
recordedAt: Date.now()
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
18
|
+
function a(t) {
|
|
19
|
+
c(t.target);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function s(t) {
|
|
22
|
+
c(t.target);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
24
|
+
function h(t) {
|
|
25
|
+
c(t.target);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
27
|
+
function p() {
|
|
28
|
+
S();
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
typeof document > "u" ||
|
|
30
|
+
function S() {
|
|
31
|
+
typeof document > "u" || r !== document && (r && (r.removeEventListener("pointerdown", a, !0), r.removeEventListener("focusin", s, !0), r.removeEventListener("contextmenu", h, !0)), document.addEventListener("pointerdown", a, !0), document.addEventListener("focusin", s, !0), document.addEventListener("contextmenu", h, !0), r = document);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return !
|
|
33
|
+
function A() {
|
|
34
|
+
return !u || Date.now() - u.recordedAt > T ? null : u;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const e = t?.closest(`[${
|
|
36
|
+
function l(t) {
|
|
37
|
+
const e = t?.closest(`[${g}="true"]`);
|
|
38
38
|
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function v(t) {
|
|
41
41
|
if (!t) return null;
|
|
42
|
-
const e = t.closest(`[${
|
|
42
|
+
const e = t.closest(`[${E}="true"]`);
|
|
43
43
|
return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
const e =
|
|
45
|
+
function C(t = {}) {
|
|
46
|
+
p();
|
|
47
|
+
const e = A(), n = l(t.owner ?? null) ?? l(e?.target ?? null) ?? l(e?.activeElement ?? null);
|
|
48
48
|
return n ? {
|
|
49
49
|
host: n,
|
|
50
50
|
boundaryHost: n,
|
|
51
|
-
mountHost:
|
|
51
|
+
mountHost: v(n) ?? n,
|
|
52
52
|
mode: "surface"
|
|
53
53
|
} : { host: null, boundaryHost: null, mountHost: null, mode: "global" };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function i(t) {
|
|
56
56
|
return t.mode === "surface" && !!t.boundaryHost?.isConnected;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
58
|
+
function f(t) {
|
|
59
|
+
if (i(t))
|
|
60
60
|
return t.mountHost ?? t.boundaryHost ?? void 0;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function y() {
|
|
63
63
|
return typeof window > "u" ? {
|
|
64
64
|
left: 0,
|
|
65
65
|
top: 0,
|
|
@@ -76,9 +76,9 @@ function m() {
|
|
|
76
76
|
height: window.innerHeight
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
if (!
|
|
81
|
-
return
|
|
79
|
+
function F(t) {
|
|
80
|
+
if (!i(t) || !t.boundaryHost)
|
|
81
|
+
return y();
|
|
82
82
|
const e = t.boundaryHost.getBoundingClientRect();
|
|
83
83
|
return {
|
|
84
84
|
left: e.left,
|
|
@@ -89,10 +89,10 @@ function b(t) {
|
|
|
89
89
|
height: e.height
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
const e =
|
|
92
|
+
function L(t) {
|
|
93
|
+
const e = f(t);
|
|
94
94
|
if (!e)
|
|
95
|
-
return
|
|
95
|
+
return y();
|
|
96
96
|
const n = e.getBoundingClientRect();
|
|
97
97
|
return {
|
|
98
98
|
left: n.left,
|
|
@@ -103,46 +103,57 @@ function h(t) {
|
|
|
103
103
|
height: n.height
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
106
|
+
function _(t) {
|
|
107
|
+
const e = f(t);
|
|
108
|
+
if (!e) return { x: 1, y: 1 };
|
|
109
|
+
const n = e.getBoundingClientRect();
|
|
110
|
+
return {
|
|
111
|
+
x: e.offsetWidth > 0 && n.width > 0 ? n.width / e.offsetWidth : 1,
|
|
112
|
+
y: e.offsetHeight > 0 && n.height > 0 ? n.height / e.offsetHeight : 1
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function m(t, e) {
|
|
116
|
+
if (!i(e))
|
|
108
117
|
return t;
|
|
109
|
-
const n =
|
|
118
|
+
const n = f(e), o = L(e), d = _(e);
|
|
110
119
|
return {
|
|
111
|
-
x: t.x - n.
|
|
112
|
-
y: t.y - n.
|
|
120
|
+
x: (t.x - o.left) / d.x - n.clientLeft + n.scrollLeft,
|
|
121
|
+
y: (t.y - o.top) / d.y - n.clientTop + n.scrollTop
|
|
113
122
|
};
|
|
114
123
|
}
|
|
115
|
-
function
|
|
116
|
-
if (!
|
|
124
|
+
function H(t, e) {
|
|
125
|
+
if (!i(e))
|
|
117
126
|
return t;
|
|
118
|
-
const n =
|
|
127
|
+
const n = m({ x: t.left, y: t.top }, e), o = m({ x: t.right, y: t.bottom }, e);
|
|
119
128
|
return {
|
|
120
|
-
left:
|
|
121
|
-
top:
|
|
122
|
-
right:
|
|
123
|
-
bottom:
|
|
124
|
-
width:
|
|
125
|
-
height:
|
|
129
|
+
left: n.x,
|
|
130
|
+
top: n.y,
|
|
131
|
+
right: o.x,
|
|
132
|
+
bottom: o.y,
|
|
133
|
+
width: o.x - n.x,
|
|
134
|
+
height: o.y - n.y
|
|
126
135
|
};
|
|
127
136
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
137
|
+
function I() {
|
|
138
|
+
u = null;
|
|
130
139
|
}
|
|
131
|
-
typeof document < "u" &&
|
|
140
|
+
typeof document < "u" && p();
|
|
132
141
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
x as DIALOG_SURFACE_BOUNDARY_ATTR,
|
|
143
|
+
g as DIALOG_SURFACE_HOST_ATTR,
|
|
144
|
+
P as SURFACE_FLOATING_LAYER_ATTR,
|
|
145
|
+
b as SURFACE_PORTAL_HOST_ATTR,
|
|
146
|
+
E as SURFACE_PORTAL_LAYER_ATTR,
|
|
147
|
+
I as __resetSurfacePortalScopeForTests,
|
|
148
|
+
p as ensureDialogSurfaceInteractionTracking,
|
|
149
|
+
S as ensureSurfacePortalInteractionTracking,
|
|
150
|
+
i as isSurfacePortalMode,
|
|
151
|
+
m as projectSurfacePortalPosition,
|
|
152
|
+
H as projectSurfacePortalRect,
|
|
153
|
+
A as readFreshInteractionSnapshot,
|
|
154
|
+
F as resolveSurfacePortalBoundaryRect,
|
|
155
|
+
C as resolveSurfacePortalHost,
|
|
156
|
+
f as resolveSurfacePortalMount,
|
|
157
|
+
L as resolveSurfacePortalMountRect,
|
|
158
|
+
_ as resolveSurfacePortalScale
|
|
148
159
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './Button';
|
|
2
|
+
export { intersectSurfaceRects, type SurfaceFloatingBoundary } from './surfaceFloatingBoundary';
|
|
2
3
|
export { Tag, type TagProps, type TagVariant, type TagSize } from './Tag';
|
|
3
4
|
export { Input, Textarea, NumberInput, AffixInput, type InputProps, type InputSize, type TextareaProps, type NumberInputProps, type AffixInputProps, type AffixOption, } from './Input';
|
|
4
5
|
export { Dialog, ConfirmDialog, type DialogProps, type ConfirmDialogProps } from './Dialog';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ResolvedSurfacePortalHost, type SurfacePortalRect } from './surfacePortalScope';
|
|
2
|
+
/** A collision boundary in client coordinates; null means explicitly unavailable. */
|
|
3
|
+
export type SurfaceFloatingBoundary = HTMLElement | SurfacePortalRect | null;
|
|
4
|
+
export declare function intersectSurfaceRects(...rects: readonly SurfacePortalRect[]): SurfacePortalRect;
|
|
5
|
+
export type SurfaceSafeArea = Readonly<{
|
|
6
|
+
top: number;
|
|
7
|
+
right: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
left: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function readSurfaceSafeArea(): SurfaceSafeArea;
|
|
12
|
+
export declare function resolveFloatingBoundary(host: ResolvedSurfacePortalHost, boundary?: SurfaceFloatingBoundary, safeArea?: SurfaceSafeArea): SurfacePortalRect | null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { resolveMobileKeyboardViewportMetrics as l } from "./mobileKeyboardViewport.js";
|
|
2
|
+
import { isSurfacePortalMode as d, resolveSurfacePortalBoundaryRect as p } from "./dialogSurfaceScope.js";
|
|
3
|
+
function m(...e) {
|
|
4
|
+
const t = Math.max(...e.map((r) => r.left)), i = Math.max(...e.map((r) => r.top)), o = Math.max(t, Math.min(...e.map((r) => r.right))), a = Math.max(i, Math.min(...e.map((r) => r.bottom)));
|
|
5
|
+
return { left: t, top: i, right: o, bottom: a, width: o - t, height: a - i };
|
|
6
|
+
}
|
|
7
|
+
function s() {
|
|
8
|
+
if (typeof document > "u") return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
9
|
+
const e = document.createElement("div");
|
|
10
|
+
e.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px)", document.documentElement.append(e);
|
|
11
|
+
const t = getComputedStyle(e), i = (a) => Math.max(0, Number.parseFloat(a) || 0), o = {
|
|
12
|
+
top: i(t.paddingTop),
|
|
13
|
+
right: i(t.paddingRight),
|
|
14
|
+
bottom: i(t.paddingBottom),
|
|
15
|
+
left: i(t.paddingLeft)
|
|
16
|
+
};
|
|
17
|
+
return e.remove(), o;
|
|
18
|
+
}
|
|
19
|
+
function c(e, t, i = { top: 0, right: 0, bottom: 0, left: 0 }) {
|
|
20
|
+
if (t === null || typeof window > "u" || e.mode === "surface" && !d(e)) return null;
|
|
21
|
+
const o = l(window), a = window.innerHeight - o.bottomPx - o.heightPx, r = {
|
|
22
|
+
left: o.leftPx + i.left,
|
|
23
|
+
top: a + i.top,
|
|
24
|
+
right: o.leftPx + o.widthPx - i.right,
|
|
25
|
+
bottom: a + o.heightPx - i.bottom,
|
|
26
|
+
width: o.widthPx,
|
|
27
|
+
height: o.heightPx
|
|
28
|
+
};
|
|
29
|
+
let n;
|
|
30
|
+
if (t instanceof HTMLElement) {
|
|
31
|
+
if (!t.isConnected || t.closest('[inert], [hidden], [aria-hidden="true"]'))
|
|
32
|
+
return null;
|
|
33
|
+
n = t.getBoundingClientRect();
|
|
34
|
+
} else
|
|
35
|
+
n = t;
|
|
36
|
+
return n && ![
|
|
37
|
+
n.left,
|
|
38
|
+
n.top,
|
|
39
|
+
n.right,
|
|
40
|
+
n.bottom,
|
|
41
|
+
n.width,
|
|
42
|
+
n.height
|
|
43
|
+
].every(Number.isFinite) ? null : m(
|
|
44
|
+
r,
|
|
45
|
+
p(e),
|
|
46
|
+
...n ? [n] : []
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
m as intersectSurfaceRects,
|
|
51
|
+
s as readSurfaceSafeArea,
|
|
52
|
+
c as resolveFloatingBoundary
|
|
53
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, SURFACE_FLOATING_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, resolveSurfacePortalHost, isSurfacePortalMode, resolveSurfacePortalMount, resolveSurfacePortalBoundaryRect, resolveSurfacePortalMountRect, projectSurfacePortalPosition, projectSurfacePortalRect, __resetSurfacePortalScopeForTests, type SurfacePortalInteractionSnapshot, type SurfacePortalHostResolutionOptions, type SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalRect, } from './dialogSurfaceScope';
|
|
1
|
+
export { DIALOG_SURFACE_HOST_ATTR, SURFACE_PORTAL_HOST_ATTR, SURFACE_PORTAL_LAYER_ATTR, SURFACE_FLOATING_LAYER_ATTR, DIALOG_SURFACE_BOUNDARY_ATTR, ensureSurfacePortalInteractionTracking, resolveSurfacePortalHost, isSurfacePortalMode, resolveSurfacePortalMount, resolveSurfacePortalBoundaryRect, resolveSurfacePortalMountRect, resolveSurfacePortalScale, projectSurfacePortalPosition, projectSurfacePortalRect, __resetSurfacePortalScopeForTests, type SurfacePortalInteractionSnapshot, type SurfacePortalHostResolutionOptions, type SurfacePortalMode, type ResolvedSurfacePortalHost, type SurfacePortalBoundaryRect, type SurfacePortalRect, } from './dialogSurfaceScope';
|
package/dist/file-browser.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { ArchiveFileIcon as r, AudioFileIcon as i, BrokenSymlinkIcon as l, CodeFileIcon as n, ConfigFileIcon as c, DocumentFileIcon as
|
|
2
|
-
import { Breadcrumb as
|
|
3
|
-
import { DirectoryTree as
|
|
1
|
+
import { ArchiveFileIcon as r, AudioFileIcon as i, BrokenSymlinkIcon as l, CodeFileIcon as n, ConfigFileIcon as c, DocumentFileIcon as t, FileIcon as F, FileItemIcon as I, FolderIcon as m, FolderOpenIcon as p, ImageFileIcon as f, JavaScriptFileIcon as s, ShellScriptFileIcon as x, StyleFileIcon as a, SymlinkFileIcon as d, SymlinkFolderIcon as S, SymlinkFolderOpenIcon as w, TypeScriptFileIcon as B, VideoFileIcon as y, getFileIcon as u, resolveFileItemIcon as v } from "./components/file-browser/FileIcons.js";
|
|
2
|
+
import { Breadcrumb as k } from "./components/file-browser/Breadcrumb.js";
|
|
3
|
+
import { DirectoryTree as h } from "./components/file-browser/DirectoryTree.js";
|
|
4
4
|
import { FileBrowser as D } from "./components/file-browser/FileBrowser.js";
|
|
5
|
-
import { FileBrowserDragPreview as
|
|
6
|
-
import { FileBrowserProvider as
|
|
7
|
-
import { FileBrowserStatusBar as
|
|
8
|
-
import { FileBrowserToolbar as
|
|
9
|
-
import { FileContextMenu as
|
|
10
|
-
import { FileGridView as
|
|
11
|
-
import { FileListView as
|
|
5
|
+
import { FileBrowserDragPreview as T } from "./components/file-browser/DragPreview.js";
|
|
6
|
+
import { FileBrowserProvider as b, useFileBrowser as L } from "./components/file-browser/FileBrowserContext.js";
|
|
7
|
+
import { FileBrowserStatusBar as O } from "./components/file-browser/FileBrowserStatusBar.js";
|
|
8
|
+
import { FileBrowserToolbar as H } from "./components/file-browser/FileBrowserToolbar.js";
|
|
9
|
+
import { FileContextMenu as N } from "./components/file-browser/FileContextMenu.js";
|
|
10
|
+
import { FileGridView as q } from "./components/file-browser/FileGridView.js";
|
|
11
|
+
import { FileListView as E } from "./components/file-browser/FileListView.js";
|
|
12
12
|
import { classifyArchiveFileName as Q } from "./components/file-browser/archiveFiles.js";
|
|
13
|
+
import { createLongPressContextMenuHandlers as U } from "./components/file-browser/longPressContextMenu.js";
|
|
13
14
|
export {
|
|
14
15
|
r as ArchiveFileIcon,
|
|
15
16
|
i as AudioFileIcon,
|
|
16
|
-
|
|
17
|
+
k as Breadcrumb,
|
|
17
18
|
l as BrokenSymlinkIcon,
|
|
18
19
|
n as CodeFileIcon,
|
|
19
20
|
c as ConfigFileIcon,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
h as DirectoryTree,
|
|
22
|
+
t as DocumentFileIcon,
|
|
22
23
|
D as FileBrowser,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
T as FileBrowserDragPreview,
|
|
25
|
+
b as FileBrowserProvider,
|
|
26
|
+
O as FileBrowserStatusBar,
|
|
27
|
+
H as FileBrowserToolbar,
|
|
28
|
+
N as FileContextMenu,
|
|
29
|
+
q as FileGridView,
|
|
30
|
+
F as FileIcon,
|
|
30
31
|
I as FileItemIcon,
|
|
31
|
-
|
|
32
|
+
E as FileListView,
|
|
32
33
|
m as FolderIcon,
|
|
33
34
|
p as FolderOpenIcon,
|
|
34
35
|
f as ImageFileIcon,
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
s as JavaScriptFileIcon,
|
|
37
|
+
x as ShellScriptFileIcon,
|
|
37
38
|
a as StyleFileIcon,
|
|
38
39
|
d as SymlinkFileIcon,
|
|
39
40
|
S as SymlinkFolderIcon,
|
|
@@ -41,7 +42,8 @@ export {
|
|
|
41
42
|
B as TypeScriptFileIcon,
|
|
42
43
|
y as VideoFileIcon,
|
|
43
44
|
Q as classifyArchiveFileName,
|
|
45
|
+
U as createLongPressContextMenuHandlers,
|
|
44
46
|
u as getFileIcon,
|
|
45
47
|
v as resolveFileItemIcon,
|
|
46
|
-
|
|
48
|
+
L as useFileBrowser
|
|
47
49
|
};
|