@floegence/floe-webapp-core 0.9.0 → 0.10.0
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/ui/ProcessingIndicator.d.ts +12 -11
- package/dist/index120.js +42 -41
- package/dist/index22.js +8 -8
- package/dist/index23.js +35 -35
- package/dist/index33.js +253 -305
- package/dist/index34.js +483 -421
- package/dist/styles.css +1 -1
- package/dist/ui.css +0 -40
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
-
export type ProcessingIndicatorVariant = '
|
|
2
|
+
export type ProcessingIndicatorVariant = 'minimal' | 'pill' | 'card' | 'elegant' | 'aurora' | 'neural' | 'orbit' | 'quantum' | 'pulse' | 'atom';
|
|
3
3
|
export type ProcessingIndicatorStatus = 'thinking' | 'working' | 'processing' | 'loading' | 'analyzing';
|
|
4
4
|
export interface ProcessingIndicatorProps {
|
|
5
5
|
/** Display status text */
|
|
@@ -22,16 +22,17 @@ export interface ProcessingIndicatorProps {
|
|
|
22
22
|
/**
|
|
23
23
|
* ProcessingIndicator - A premium status indicator with sophisticated animations.
|
|
24
24
|
*
|
|
25
|
-
* Features multiple
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
* -
|
|
31
|
-
* -
|
|
32
|
-
* -
|
|
33
|
-
*
|
|
34
|
-
*
|
|
25
|
+
* Features multiple visual variants:
|
|
26
|
+
* - Minimal: Sleek inline bars
|
|
27
|
+
* - Pill: Gradient border chip
|
|
28
|
+
* - Card: Glassmorphism container
|
|
29
|
+
* - Elegant: Layered orb
|
|
30
|
+
* - Aurora: Flowing arc segments
|
|
31
|
+
* - Neural: AI network visualization
|
|
32
|
+
* - Orbit: Multi-layer orbital system
|
|
33
|
+
* - Quantum: Dot grid wave
|
|
34
|
+
* - Pulse: Expanding rings
|
|
35
|
+
* - Atom: 3D electron orbits
|
|
35
36
|
*/
|
|
36
37
|
export declare function ProcessingIndicator(props: ProcessingIndicatorProps): JSX.Element;
|
|
37
38
|
export default ProcessingIndicator;
|
package/dist/index120.js
CHANGED
|
@@ -4,8 +4,8 @@ import { cn as _ } from "./index106.js";
|
|
|
4
4
|
import { deferAfterPaint as re } from "./index107.js";
|
|
5
5
|
import { Button as N } from "./index20.js";
|
|
6
6
|
import { Input as H } from "./index21.js";
|
|
7
|
-
import { ChevronRight as M, Check as le, X as oe, Plus as
|
|
8
|
-
import { FolderOpenIcon as W, FolderIcon as
|
|
7
|
+
import { ChevronRight as M, Check as le, X as oe, Plus as ae } from "./index38.js";
|
|
8
|
+
import { FolderOpenIcon as W, FolderIcon as ie } from "./index52.js";
|
|
9
9
|
var O = /* @__PURE__ */ w('<div class="flex items-center gap-1.5"><div class=flex-1>'), ce = /* @__PURE__ */ w('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), se = /* @__PURE__ */ w("<button type=button><span>New Folder"), ue = /* @__PURE__ */ w('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), V = /* @__PURE__ */ w("<button type=button>"), de = /* @__PURE__ */ w('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), he = /* @__PURE__ */ w("<div><button type=button><span>"), fe = /* @__PURE__ */ w("<div class=overflow-hidden>"), ge = /* @__PURE__ */ w('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), me = /* @__PURE__ */ w('<span class="flex-shrink-0 w-4 h-4">');
|
|
10
10
|
function k(e) {
|
|
11
11
|
const o = (e ?? "").trim();
|
|
@@ -34,61 +34,61 @@ function _e(e) {
|
|
|
34
34
|
const t = typeof e.homePath == "function" ? e.homePath() : e.homePath;
|
|
35
35
|
return t ? k(t) : void 0;
|
|
36
36
|
}, r = (t) => {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
37
|
+
const i = c();
|
|
38
|
+
if (!i) return t;
|
|
39
39
|
const d = k(t);
|
|
40
|
-
return d === "/" ?
|
|
40
|
+
return d === "/" ? i : i === "/" ? d : i + d;
|
|
41
41
|
}, u = (t) => {
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
42
|
+
const i = c();
|
|
43
|
+
if (!i) return k(t);
|
|
44
44
|
const d = k(t);
|
|
45
|
-
return d ===
|
|
46
|
-
}, [b, m] = S(o), [f, v] = S(/* @__PURE__ */ new Set(["/"])), [P, l] = S(r(o)), [x,
|
|
45
|
+
return d === i ? "/" : i !== "/" && d.startsWith(i + "/") ? d.slice(i.length) || "/" : k(t);
|
|
46
|
+
}, [b, m] = S(o), [f, v] = S(/* @__PURE__ */ new Set(["/"])), [P, l] = S(r(o)), [x, a] = S(""), g = ve(e.files), y = E(() => e.files().filter((t) => t.type === "folder"));
|
|
47
47
|
A(G(e.open, (t) => {
|
|
48
48
|
if (t) {
|
|
49
|
-
const
|
|
50
|
-
m(
|
|
51
|
-
const d = j(
|
|
52
|
-
v(/* @__PURE__ */ new Set(["/", ...d])), e.onReset?.(
|
|
49
|
+
const i = e.initialPath ?? "/";
|
|
50
|
+
m(i), l(r(i)), a("");
|
|
51
|
+
const d = j(i);
|
|
52
|
+
v(/* @__PURE__ */ new Set(["/", ...d])), e.onReset?.(i);
|
|
53
53
|
}
|
|
54
54
|
})), A(G(b, (t) => {
|
|
55
|
-
l(r(t)),
|
|
55
|
+
l(r(t)), a("");
|
|
56
56
|
}));
|
|
57
57
|
const $ = (t) => {
|
|
58
|
-
const
|
|
59
|
-
return
|
|
58
|
+
const i = k(t);
|
|
59
|
+
return i === "/" || g().has(i);
|
|
60
60
|
}, F = (t) => e.filter ? e.filter(t) : !0, L = (t) => {
|
|
61
|
-
const
|
|
61
|
+
const i = j(t);
|
|
62
62
|
v((d) => {
|
|
63
63
|
const p = new Set(d);
|
|
64
|
-
for (const D of
|
|
64
|
+
for (const D of i) p.add(D);
|
|
65
65
|
return p.add(t), p;
|
|
66
66
|
});
|
|
67
67
|
}, q = (t) => {
|
|
68
|
-
v((
|
|
69
|
-
const d = new Set(
|
|
68
|
+
v((i) => {
|
|
69
|
+
const d = new Set(i);
|
|
70
70
|
return d.has(t) ? d.delete(t) : d.add(t), d;
|
|
71
71
|
});
|
|
72
72
|
}, J = (t) => {
|
|
73
|
-
F(t) && (m(t.path), v((
|
|
74
|
-
const d = new Set(
|
|
73
|
+
F(t) && (m(t.path), v((i) => {
|
|
74
|
+
const d = new Set(i);
|
|
75
75
|
return d.add(t.path), d;
|
|
76
76
|
}));
|
|
77
77
|
}, Q = () => {
|
|
78
78
|
m("/");
|
|
79
79
|
}, R = () => {
|
|
80
80
|
const t = u(P().trim());
|
|
81
|
-
$(t) ? (m(t),
|
|
81
|
+
$(t) ? (m(t), a(""), L(t)) : a("Path not found");
|
|
82
82
|
}, U = (t) => {
|
|
83
83
|
t.key === "Enter" && (t.preventDefault(), R());
|
|
84
84
|
}, Y = E(() => {
|
|
85
|
-
const t = b(),
|
|
85
|
+
const t = b(), i = n();
|
|
86
86
|
if (t === "/" || t === "") return [{
|
|
87
|
-
name:
|
|
87
|
+
name: i,
|
|
88
88
|
path: "/"
|
|
89
89
|
}];
|
|
90
90
|
const d = t.split("/").filter(Boolean), p = [{
|
|
91
|
-
name:
|
|
91
|
+
name: i,
|
|
92
92
|
path: "/"
|
|
93
93
|
}];
|
|
94
94
|
let D = "";
|
|
@@ -107,7 +107,7 @@ function _e(e) {
|
|
|
107
107
|
pathInput: P,
|
|
108
108
|
setPathInput: l,
|
|
109
109
|
pathInputError: x,
|
|
110
|
-
setPathInputError:
|
|
110
|
+
setPathInputError: a,
|
|
111
111
|
folderIndex: g,
|
|
112
112
|
rootFolders: y,
|
|
113
113
|
isValidPath: $,
|
|
@@ -134,9 +134,9 @@ function pe(e) {
|
|
|
134
134
|
const l = c().trim();
|
|
135
135
|
if (!l || u()) return;
|
|
136
136
|
b(!0);
|
|
137
|
-
const x = e.parentPath(),
|
|
137
|
+
const x = e.parentPath(), a = l, g = e.onCreateFolder;
|
|
138
138
|
re(() => {
|
|
139
|
-
g(x,
|
|
139
|
+
g(x, a).then(() => {
|
|
140
140
|
n(!1), r("");
|
|
141
141
|
}).catch((y) => {
|
|
142
142
|
console.error("Failed to create folder:", y);
|
|
@@ -154,7 +154,7 @@ function pe(e) {
|
|
|
154
154
|
get fallback() {
|
|
155
155
|
return (() => {
|
|
156
156
|
var l = se(), x = l.firstChild;
|
|
157
|
-
return l.$$click = m, h(l, s(
|
|
157
|
+
return l.$$click = m, h(l, s(ae, {
|
|
158
158
|
class: "w-3.5 h-3.5"
|
|
159
159
|
}), x), T(() => C(l, _("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), l;
|
|
160
160
|
})();
|
|
@@ -167,7 +167,7 @@ function pe(e) {
|
|
|
167
167
|
get value() {
|
|
168
168
|
return c();
|
|
169
169
|
},
|
|
170
|
-
onInput: (
|
|
170
|
+
onInput: (a) => r(a.currentTarget.value),
|
|
171
171
|
onKeyDown: P,
|
|
172
172
|
placeholder: "Folder name",
|
|
173
173
|
get disabled() {
|
|
@@ -192,6 +192,7 @@ function pe(e) {
|
|
|
192
192
|
}), null), h(l, s(N, {
|
|
193
193
|
variant: "ghost",
|
|
194
194
|
size: "sm",
|
|
195
|
+
class: "bg-transparent text-muted-foreground hover:bg-red-500 hover:text-white",
|
|
195
196
|
onClick: f,
|
|
196
197
|
get disabled() {
|
|
197
198
|
return u();
|
|
@@ -326,23 +327,23 @@ function X(e) {
|
|
|
326
327
|
return me();
|
|
327
328
|
},
|
|
328
329
|
get children() {
|
|
329
|
-
var
|
|
330
|
-
return
|
|
330
|
+
var a = V();
|
|
331
|
+
return a.$$click = b, h(a, s(M, {
|
|
331
332
|
class: "w-3 h-3 opacity-60"
|
|
332
333
|
})), T((g) => {
|
|
333
334
|
var y = _("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", o() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), $ = o() ? "Collapse folder" : "Expand folder";
|
|
334
|
-
return y !== g.e && C(
|
|
335
|
+
return y !== g.e && C(a, g.e = y), $ !== g.t && te(a, "aria-label", g.t = $), g;
|
|
335
336
|
}, {
|
|
336
337
|
e: void 0,
|
|
337
338
|
t: void 0
|
|
338
|
-
}),
|
|
339
|
+
}), a;
|
|
339
340
|
}
|
|
340
341
|
}), P), P.$$click = m, h(l, s(I, {
|
|
341
342
|
get when() {
|
|
342
343
|
return B(() => !!u())() && o();
|
|
343
344
|
},
|
|
344
345
|
get fallback() {
|
|
345
|
-
return s(
|
|
346
|
+
return s(ie, {
|
|
346
347
|
class: "w-4 h-4"
|
|
347
348
|
});
|
|
348
349
|
},
|
|
@@ -356,8 +357,8 @@ function X(e) {
|
|
|
356
357
|
return B(() => !!o())() && u();
|
|
357
358
|
},
|
|
358
359
|
get children() {
|
|
359
|
-
var
|
|
360
|
-
return h(
|
|
360
|
+
var a = fe();
|
|
361
|
+
return h(a, s(z, {
|
|
361
362
|
get each() {
|
|
362
363
|
return r();
|
|
363
364
|
},
|
|
@@ -382,11 +383,11 @@ function X(e) {
|
|
|
382
383
|
return e.isSelectable;
|
|
383
384
|
}
|
|
384
385
|
})
|
|
385
|
-
})),
|
|
386
|
+
})), a;
|
|
386
387
|
}
|
|
387
|
-
}), null), T((
|
|
388
|
+
}), null), T((a) => {
|
|
388
389
|
var g = _("group flex items-center w-full text-xs", "transition-colors duration-100", c() ? "hover:bg-accent/60" : "opacity-50", n() && c() && "bg-accent text-accent-foreground font-medium"), y = `${4 + e.depth * 14}px`, $ = !c(), F = _("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", c() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
|
|
389
|
-
return g !==
|
|
390
|
+
return g !== a.e && C(v, a.e = g), y !== a.t && ne(v, "padding-left", a.t = y), $ !== a.a && (P.disabled = a.a = $), F !== a.o && C(P, a.o = F), a;
|
|
390
391
|
}, {
|
|
391
392
|
e: void 0,
|
|
392
393
|
t: void 0,
|
package/dist/index22.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { delegateEvents as E, createComponent as o, Portal as _, insert as l, effect as b, setAttribute as v, className as D, template as c, use as T } from "solid-js/web";
|
|
2
2
|
import { createUniqueId as O, createEffect as $, onCleanup as x, Show as s } from "solid-js";
|
|
3
3
|
import { cn as L } from "./index106.js";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as w } from "./index20.js";
|
|
5
5
|
import { X as z } from "./index38.js";
|
|
6
6
|
import { lockBodyStyle as A } from "./index109.js";
|
|
7
7
|
import { useResolvedFloeConfig as F } from "./index90.js";
|
|
@@ -11,7 +11,7 @@ function k(e) {
|
|
|
11
11
|
return Array.from(e.querySelectorAll(a)).filter((f) => f instanceof HTMLElement);
|
|
12
12
|
}
|
|
13
13
|
function K(e) {
|
|
14
|
-
const a = O(), f = () => `dialog-${a}-title`,
|
|
14
|
+
const a = O(), f = () => `dialog-${a}-title`, y = () => `dialog-${a}-description`;
|
|
15
15
|
let m;
|
|
16
16
|
return $(() => {
|
|
17
17
|
if (!e.open || typeof document > "u") return;
|
|
@@ -76,12 +76,12 @@ function K(e) {
|
|
|
76
76
|
},
|
|
77
77
|
get children() {
|
|
78
78
|
var r = H();
|
|
79
|
-
return l(r, () => e.description), b(() => v(r, "id",
|
|
79
|
+
return l(r, () => e.description), b(() => v(r, "id", y())), r;
|
|
80
80
|
}
|
|
81
|
-
}), null), l(t, o(
|
|
81
|
+
}), null), l(t, o(w, {
|
|
82
82
|
variant: "ghost",
|
|
83
83
|
size: "icon",
|
|
84
|
-
class: "h-6 w-6 -mr-1",
|
|
84
|
+
class: "h-6 w-6 -mr-1 bg-transparent text-muted-foreground hover:bg-red-500 hover:text-white",
|
|
85
85
|
onClick: () => e.onOpenChange(!1),
|
|
86
86
|
"aria-label": "Close",
|
|
87
87
|
get children() {
|
|
@@ -100,7 +100,7 @@ function K(e) {
|
|
|
100
100
|
return l(t, () => e.footer), t;
|
|
101
101
|
}
|
|
102
102
|
}), null), b((t) => {
|
|
103
|
-
var i = L("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class), r = e.title ? f() : void 0, u = e.description ?
|
|
103
|
+
var i = L("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "animate-in fade-in zoom-in-95", "flex flex-col", e.class), r = e.title ? f() : void 0, u = e.description ? y() : void 0;
|
|
104
104
|
return i !== t.e && D(n, t.e = i), r !== t.t && v(n, "aria-labelledby", t.t = r), u !== t.a && v(n, "aria-describedby", t.a = u), t;
|
|
105
105
|
}, {
|
|
106
106
|
e: void 0,
|
|
@@ -129,7 +129,7 @@ function Q(e) {
|
|
|
129
129
|
return e.description;
|
|
130
130
|
},
|
|
131
131
|
get footer() {
|
|
132
|
-
return [o(
|
|
132
|
+
return [o(w, {
|
|
133
133
|
variant: "ghost",
|
|
134
134
|
onClick: () => e.onOpenChange(!1),
|
|
135
135
|
get disabled() {
|
|
@@ -138,7 +138,7 @@ function Q(e) {
|
|
|
138
138
|
get children() {
|
|
139
139
|
return e.cancelText ?? a.config.strings.confirmDialog.cancel;
|
|
140
140
|
}
|
|
141
|
-
}), o(
|
|
141
|
+
}), o(w, {
|
|
142
142
|
get variant() {
|
|
143
143
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
144
144
|
},
|
package/dist/index23.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { delegateEvents as
|
|
1
|
+
import { delegateEvents as Me, createComponent as o, Portal as Se, insert as z, effect as h, setAttribute as de, addEventListener as b, className as u, memo as $e, setStyleProperty as A, template as q, use as Ie } from "solid-js/web";
|
|
2
2
|
import { createUniqueId as Pe, createSignal as P, onMount as Ce, onCleanup as he, createEffect as j, Show as C, untrack as _e } from "solid-js";
|
|
3
3
|
import { cn as G } from "./index106.js";
|
|
4
4
|
import { useLayout as Ee } from "./index92.js";
|
|
@@ -7,19 +7,19 @@ import { Restore as We, Maximize as ke, X as He } from "./index38.js";
|
|
|
7
7
|
import { lockBodyStyle as Re } from "./index109.js";
|
|
8
8
|
var Xe = /* @__PURE__ */ q('<h2 class="text-sm font-medium truncate select-none">'), Ae = /* @__PURE__ */ q('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), y = /* @__PURE__ */ q("<div style=touch-action:none>"), De = /* @__PURE__ */ q('<div role=dialog aria-modal=true><div style=touch-action:none><div class="flex-1 min-w-0"></div><div class="flex items-center gap-0.5 -mr-1"></div></div><div class="flex-1 overflow-auto p-3">');
|
|
9
9
|
function Te(i) {
|
|
10
|
-
const Z = () => i.resizable ?? !0, J = () => i.draggable ?? !0,
|
|
10
|
+
const Z = () => i.resizable ?? !0, J = () => i.draggable ?? !0, g = () => i.minSize ?? {
|
|
11
11
|
width: 200,
|
|
12
12
|
height: 150
|
|
13
|
-
},
|
|
13
|
+
}, m = () => i.maxSize ?? {
|
|
14
14
|
width: 1 / 0,
|
|
15
15
|
height: 1 / 0
|
|
16
|
-
}, ce = () => i.zIndex ?? 100, we = Pe(),
|
|
16
|
+
}, ce = () => i.zIndex ?? 100, we = Pe(), ge = Ee(), _ = () => ge.isMobile(), B = 16, K = () => `floating-window-${we}-title`, [E, M] = P(i.defaultPosition ?? {
|
|
17
17
|
x: 0,
|
|
18
18
|
y: 0
|
|
19
19
|
}), [S, W] = P(i.defaultSize ?? {
|
|
20
20
|
width: 400,
|
|
21
21
|
height: 300
|
|
22
|
-
}), [l, Q] = P(!1), [
|
|
22
|
+
}), [l, Q] = P(!1), [me, V] = P(!1), [fe, ee] = P(!1), [xe, ve] = P(null);
|
|
23
23
|
let O = {
|
|
24
24
|
x: 0,
|
|
25
25
|
y: 0
|
|
@@ -29,13 +29,13 @@ function Te(i) {
|
|
|
29
29
|
}, T = {
|
|
30
30
|
x: 0,
|
|
31
31
|
y: 0
|
|
32
|
-
},
|
|
32
|
+
}, p = {
|
|
33
33
|
width: 0,
|
|
34
34
|
height: 0
|
|
35
35
|
}, k = {
|
|
36
36
|
x: 0,
|
|
37
37
|
y: 0
|
|
38
|
-
}, H = "se", R, c = null,
|
|
38
|
+
}, H = "se", R, c = null, f = null, X = {
|
|
39
39
|
x: 0,
|
|
40
40
|
y: 0
|
|
41
41
|
}, $ = null, D = null;
|
|
@@ -63,26 +63,26 @@ function Te(i) {
|
|
|
63
63
|
R?.releasePointerCapture(t);
|
|
64
64
|
} catch {
|
|
65
65
|
}
|
|
66
|
-
c = null,
|
|
66
|
+
c = null, f = null, V(!1), ee(!1), U(!1, "");
|
|
67
67
|
}, L = () => {
|
|
68
68
|
if (typeof window > "u" || i.defaultPosition || l()) return;
|
|
69
69
|
const t = window.innerWidth, n = window.innerHeight, a = _(), s = _e(() => S());
|
|
70
70
|
if (a) {
|
|
71
|
-
const e = t - B * 2, r = Math.max(
|
|
71
|
+
const e = t - B * 2, r = Math.max(g().width, Math.min(e, m().width)), I = Math.max(g().height, Math.min(s.height, m().height));
|
|
72
72
|
W({
|
|
73
73
|
width: r,
|
|
74
74
|
height: I
|
|
75
|
-
}),
|
|
75
|
+
}), M({
|
|
76
76
|
x: B,
|
|
77
77
|
y: Math.max(0, (n - I) / 2)
|
|
78
78
|
});
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const w = Math.max(
|
|
81
|
+
const w = Math.max(g().width, Math.min(s.width, m().width)), d = Math.max(g().height, Math.min(s.height, m().height));
|
|
82
82
|
W({
|
|
83
83
|
width: w,
|
|
84
84
|
height: d
|
|
85
|
-
}),
|
|
85
|
+
}), M({
|
|
86
86
|
x: Math.max(0, (t - w) / 2),
|
|
87
87
|
y: Math.max(0, (n - d) / 2)
|
|
88
88
|
});
|
|
@@ -109,7 +109,7 @@ function Te(i) {
|
|
|
109
109
|
i.open || te(c ?? void 0);
|
|
110
110
|
});
|
|
111
111
|
const be = (t) => {
|
|
112
|
-
!J() || l() || t.pointerType === "mouse" && t.button !== 0 || t.target?.closest('button, input, select, textarea, a, [role="button"]') || (t.preventDefault(), c = t.pointerId,
|
|
112
|
+
!J() || l() || t.pointerType === "mouse" && t.button !== 0 || t.target?.closest('button, input, select, textarea, a, [role="button"]') || (t.preventDefault(), c = t.pointerId, f = "drag", V(!0), O = {
|
|
113
113
|
x: t.clientX,
|
|
114
114
|
y: t.clientY
|
|
115
115
|
}, N = {
|
|
@@ -119,10 +119,10 @@ function Te(i) {
|
|
|
119
119
|
y: t.clientY
|
|
120
120
|
}, U(!0, "grabbing"), R?.setPointerCapture(t.pointerId));
|
|
121
121
|
}, x = (t) => (n) => {
|
|
122
|
-
!Z() || l() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), c = n.pointerId,
|
|
122
|
+
!Z() || l() || n.pointerType === "mouse" && n.button !== 0 || (n.preventDefault(), n.stopPropagation(), c = n.pointerId, f = "resize", ee(!0), H = t, T = {
|
|
123
123
|
x: n.clientX,
|
|
124
124
|
y: n.clientY
|
|
125
|
-
},
|
|
125
|
+
}, p = {
|
|
126
126
|
...S()
|
|
127
127
|
}, k = {
|
|
128
128
|
...E()
|
|
@@ -131,35 +131,35 @@ function Te(i) {
|
|
|
131
131
|
y: n.clientY
|
|
132
132
|
}, U(!0, ze[t]), R?.setPointerCapture(n.pointerId));
|
|
133
133
|
}, ne = () => {
|
|
134
|
-
if ($ = null, !i.open || c === null ||
|
|
135
|
-
const t = X.x - (
|
|
136
|
-
if (
|
|
134
|
+
if ($ = null, !i.open || c === null || f === null) return;
|
|
135
|
+
const t = X.x - (f === "drag" ? O.x : T.x), n = X.y - (f === "drag" ? O.y : T.y);
|
|
136
|
+
if (f === "drag") {
|
|
137
137
|
const r = S(), Y = _() ? B : Math.max(0, Math.min(window.innerWidth - r.width, N.x + t)), F = Math.max(0, Math.min(window.innerHeight - r.height, N.y + n));
|
|
138
|
-
|
|
138
|
+
M({
|
|
139
139
|
x: Y,
|
|
140
140
|
y: F
|
|
141
141
|
});
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
let a =
|
|
144
|
+
let a = p.width, s = p.height, w = k.x, d = k.y;
|
|
145
145
|
const e = _();
|
|
146
|
-
if (!e && H.includes("e") && (a = Math.max(
|
|
147
|
-
const r =
|
|
148
|
-
r >=
|
|
146
|
+
if (!e && H.includes("e") && (a = Math.max(g().width, Math.min(m().width, p.width + t))), !e && H.includes("w")) {
|
|
147
|
+
const r = p.width - t;
|
|
148
|
+
r >= g().width && r <= m().width && (a = r, w = k.x + t);
|
|
149
149
|
}
|
|
150
|
-
if (H.includes("s") && (s = Math.max(
|
|
151
|
-
const r =
|
|
152
|
-
r >=
|
|
150
|
+
if (H.includes("s") && (s = Math.max(g().height, Math.min(m().height, p.height + n))), H.includes("n")) {
|
|
151
|
+
const r = p.height - n;
|
|
152
|
+
r >= g().height && r <= m().height && (s = r, d = k.y + n);
|
|
153
153
|
}
|
|
154
154
|
w = Math.max(0, Math.min(window.innerWidth - a, w)), d = Math.max(0, Math.min(window.innerHeight - s, d)), W({
|
|
155
155
|
width: a,
|
|
156
156
|
height: s
|
|
157
|
-
}),
|
|
157
|
+
}), M({
|
|
158
158
|
x: w,
|
|
159
159
|
y: d
|
|
160
160
|
});
|
|
161
161
|
}, ye = (t) => {
|
|
162
|
-
if (!(c === null || t.pointerId !== c) &&
|
|
162
|
+
if (!(c === null || t.pointerId !== c) && f !== null && (X = {
|
|
163
163
|
x: t.clientX,
|
|
164
164
|
y: t.clientY
|
|
165
165
|
}, $ === null)) {
|
|
@@ -174,19 +174,19 @@ function Te(i) {
|
|
|
174
174
|
}, re = () => {
|
|
175
175
|
if (l()) {
|
|
176
176
|
const t = xe();
|
|
177
|
-
t && (
|
|
177
|
+
t && (M(t.position), W(t.size)), Q(!1);
|
|
178
178
|
} else
|
|
179
179
|
ve({
|
|
180
180
|
position: E(),
|
|
181
181
|
size: S()
|
|
182
|
-
}),
|
|
182
|
+
}), M({
|
|
183
183
|
x: 0,
|
|
184
184
|
y: 0
|
|
185
185
|
}), W({
|
|
186
186
|
width: window.innerWidth,
|
|
187
187
|
height: window.innerHeight
|
|
188
188
|
}), Q(!0);
|
|
189
|
-
},
|
|
189
|
+
}, pe = () => {
|
|
190
190
|
re();
|
|
191
191
|
}, v = (t) => G("absolute z-10", {
|
|
192
192
|
n: "cursor-ns-resize top-0 left-2 right-2 h-1",
|
|
@@ -208,7 +208,7 @@ function Te(i) {
|
|
|
208
208
|
var t = De(), n = t.firstChild, a = n.firstChild, s = a.nextSibling, w = n.nextSibling;
|
|
209
209
|
t.addEventListener("pointercancel", ie), t.$$pointerup = ie, t.$$pointermove = ye;
|
|
210
210
|
var d = R;
|
|
211
|
-
return typeof d == "function" ? Ie(d, t) : R = t, n.$$dblclick =
|
|
211
|
+
return typeof d == "function" ? Ie(d, t) : R = t, n.$$dblclick = pe, n.$$pointerdown = be, z(a, o(C, {
|
|
212
212
|
get when() {
|
|
213
213
|
return i.title;
|
|
214
214
|
},
|
|
@@ -246,7 +246,7 @@ function Te(i) {
|
|
|
246
246
|
}), null), z(s, o(ue, {
|
|
247
247
|
variant: "ghost",
|
|
248
248
|
size: "icon",
|
|
249
|
-
class: "h-6 w-6 hover:bg-
|
|
249
|
+
class: "h-6 w-6 bg-transparent text-muted-foreground hover:bg-red-500 hover:text-white",
|
|
250
250
|
onClick: (e) => {
|
|
251
251
|
e.stopPropagation(), i.onOpenChange(!1);
|
|
252
252
|
},
|
|
@@ -303,7 +303,7 @@ function Te(i) {
|
|
|
303
303
|
})];
|
|
304
304
|
}
|
|
305
305
|
}), null), h((e) => {
|
|
306
|
-
var r = G("fixed bg-card text-card-foreground rounded-md shadow-xl", "border border-border", "flex flex-col", "animate-in fade-in zoom-in-95", l() && "rounded-none", (
|
|
306
|
+
var r = G("fixed bg-card text-card-foreground rounded-md shadow-xl", "border border-border", "flex flex-col", "animate-in fade-in zoom-in-95", l() && "rounded-none", (me() || fe()) && "select-none", i.class), I = `${E().x}px`, Y = `${E().y}px`, F = `${S().width}px`, oe = `${S().height}px`, se = ce(), le = i.title ? K() : void 0, ae = G("flex items-center justify-between h-9 px-3", "border-b border-border", "bg-muted/50", l() ? "rounded-none" : "rounded-t-md", J() && !l() && "cursor-move");
|
|
307
307
|
return r !== e.e && u(t, e.e = r), I !== e.t && A(t, "left", e.t = I), Y !== e.a && A(t, "top", e.a = Y), F !== e.o && A(t, "width", e.o = F), oe !== e.i && A(t, "height", e.i = oe), se !== e.n && A(t, "z-index", e.n = se), le !== e.s && de(t, "aria-labelledby", e.s = le), ae !== e.h && u(n, e.h = ae), e;
|
|
308
308
|
}, {
|
|
309
309
|
e: void 0,
|
|
@@ -320,7 +320,7 @@ function Te(i) {
|
|
|
320
320
|
}
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
Me(["pointermove", "pointerup", "pointerdown", "dblclick"]);
|
|
324
324
|
export {
|
|
325
325
|
Te as FloatingWindow
|
|
326
326
|
};
|