fiboui 2.6.3 → 2.7.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/README.md +16 -6
- package/dist/cli/bin.js +3 -4
- package/dist/cli/commands/generate/component.js +21 -33
- package/dist/cli/commands/generate/index.js +3 -3
- package/dist/cli/commands/generate/module.js +21 -24
- package/dist/cli/commands/generate/plugin.js +18 -34
- package/dist/cli/commands/init.js +5 -25
- package/dist/cli/config.js +118 -0
- package/dist/cli/names.js +35 -0
- package/dist/cli/templates.js +76 -0
- package/dist/client-CGjHCx8F.js +17621 -0
- package/dist/content.d.ts +1 -0
- package/dist/content.js +14 -14
- package/dist/core.d.ts +2 -0
- package/dist/core.js +65 -59
- package/dist/effects-BxvduC-G.js +14 -0
- package/dist/icons-GEqYd2M9.js +383 -0
- package/dist/index-7bieEGAP.js +944 -0
- package/dist/index-C4qvvr03.js +1474 -0
- package/dist/index-D-ljLuf8.js +839 -0
- package/dist/index-DVApKYWt.js +217 -0
- package/dist/index-Db8lVjta.js +150 -0
- package/dist/index.d.ts +73156 -505
- package/dist/index.js +4419 -2237
- package/dist/interactive.d.ts +2 -0
- package/dist/interactive.js +22 -9
- package/dist/layout.d.ts +1 -0
- package/dist/layout.js +14 -13
- package/dist/metadata-3YYH1uiS.js +147 -0
- package/dist/navigation.d.ts +1 -0
- package/dist/navigation.js +15 -9
- package/dist/page-CYqQOLXe.js +266 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +5001 -1777
- package/dist/structure.d.ts +1 -0
- package/dist/structure.js +13 -9
- package/dist/style.css +1 -1
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +8 -8
- package/package.json +9 -2
- package/dist/Link-l2KUUUg4.js +0 -50
- package/dist/PluginManager-BRjgOLVa.js +0 -110
- package/dist/client-BtHxgLa_.js +0 -10602
- package/dist/effects-D16XdB_d.js +0 -10
- package/dist/index-Bhq7-OrE.js +0 -602
- package/dist/index-CZJqskaC.js +0 -1028
- package/dist/index-D50CTdE9.js +0 -455
- package/dist/index-D5Ru-8kF.js +0 -608
- package/dist/index-DjwLjHe1.js +0 -119
- package/dist/mount-yYCj33dL.js +0 -135
package/dist/interactive.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import { B as e
|
|
2
|
-
import {
|
|
1
|
+
import { B as e } from "./index-DVApKYWt.js";
|
|
2
|
+
import { ap as r, at as t, ab as m, aq as i, as as l, ao as n, aa as x, ar as u, ag as h, an as p, ac as b, am as c, aj as d, af as f, ai as g, ae as T, ah as q, ad as k, ak as B, al as C } from "./client-CGjHCx8F.js";
|
|
3
3
|
export {
|
|
4
4
|
e as Button,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
i as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
r as Checkbox,
|
|
6
|
+
t as Combobox,
|
|
7
|
+
m as Form,
|
|
8
|
+
i as RadioGroup,
|
|
9
|
+
l as Select,
|
|
10
|
+
n as Switch,
|
|
11
|
+
x as TextField,
|
|
12
|
+
u as Textarea,
|
|
13
|
+
h as email,
|
|
14
|
+
p as equalTo,
|
|
15
|
+
b as formDataToValues,
|
|
16
|
+
c as integer,
|
|
17
|
+
d as max,
|
|
18
|
+
f as maxLength,
|
|
19
|
+
g as min,
|
|
20
|
+
T as minLength,
|
|
21
|
+
q as pattern,
|
|
22
|
+
k as required,
|
|
23
|
+
B as rule,
|
|
24
|
+
C as url
|
|
12
25
|
};
|
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Center, Column, Container, Row, Spacer, Scaffold, Header, Sidebar, DashboardLayout, ZStack, Line, ScrollView, ScrollController, VirtualColumn } from './index.js';
|
package/dist/layout.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { C as r, a as s,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { C as r, a as s, H as e, L as l, b as t, S, Z as n } from "./index-D-ljLuf8.js";
|
|
2
|
+
import { C as c, S as f } from "./index-Db8lVjta.js";
|
|
3
|
+
import { a6 as m, a3 as d, a4 as p, a5 as u, a7 as b } from "./client-CGjHCx8F.js";
|
|
4
4
|
export {
|
|
5
5
|
r as Center,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
c as Column,
|
|
7
|
+
s as Container,
|
|
8
|
+
m as DashboardLayout,
|
|
9
|
+
e as Header,
|
|
10
10
|
l as Line,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
d as Row,
|
|
12
|
+
p as Scaffold,
|
|
13
|
+
t as ScrollController,
|
|
13
14
|
S as ScrollView,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
u as Sidebar,
|
|
16
|
+
f as Spacer,
|
|
17
|
+
b as VirtualColumn,
|
|
18
|
+
n as ZStack
|
|
18
19
|
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { a$ as y, a_ as x, b0 as E, b1 as $, b2 as R, b3 as k, b4 as D, b5 as g, b6 as O, b7 as P, b8 as z, aD as A, aE as K } from "./client-CGjHCx8F.js";
|
|
3
|
+
import { useState as M, useMemo as N, lazy as S, Suspense as B } from "react";
|
|
4
|
+
function v(e) {
|
|
5
|
+
const t = (typeof e == "string" ? e.trim() : "").split(/[?#]/, 1)[0];
|
|
6
|
+
return !t || t === "/" ? "/" : t.startsWith("/") ? t : `/${t}`;
|
|
7
|
+
}
|
|
8
|
+
function H(e) {
|
|
9
|
+
let t = typeof e == "string" ? e.trim() : "", r = "";
|
|
10
|
+
const a = t.indexOf("#");
|
|
11
|
+
a >= 0 && (r = t.slice(a), t = t.slice(0, a));
|
|
12
|
+
const s = t.indexOf("?");
|
|
13
|
+
return { search: s >= 0 ? t.slice(s) : "", hash: r };
|
|
14
|
+
}
|
|
15
|
+
function I(e, n) {
|
|
16
|
+
const { search: t, hash: r } = H(n), a = R(v(n), e);
|
|
17
|
+
return `${k(e, a)}${t}${r}`;
|
|
18
|
+
}
|
|
19
|
+
function _(e, n, t, r = "") {
|
|
20
|
+
const a = R(v(n), r), s = v(e);
|
|
21
|
+
return a === "/" ? s === "/" : D(s, a, t).match;
|
|
22
|
+
}
|
|
23
|
+
const j = ({
|
|
24
|
+
to: e,
|
|
25
|
+
children: n,
|
|
26
|
+
replace: t = !1,
|
|
27
|
+
state: r,
|
|
28
|
+
className: a,
|
|
29
|
+
style: s,
|
|
30
|
+
onClick: f,
|
|
31
|
+
target: i,
|
|
32
|
+
download: o,
|
|
33
|
+
rel: h,
|
|
34
|
+
...p
|
|
35
|
+
}) => {
|
|
36
|
+
const l = y(), m = x(e), b = !m && E(e), C = m ? void 0 : b ? e.trim() : I((l == null ? void 0 : l.basename) ?? "", e), w = i && String(i).toLowerCase() === "_blank" ? $(h, "noopener noreferrer") : h;
|
|
37
|
+
return /* @__PURE__ */ c(
|
|
38
|
+
"a",
|
|
39
|
+
{
|
|
40
|
+
...p,
|
|
41
|
+
href: C,
|
|
42
|
+
onClick: (u) => {
|
|
43
|
+
if (f == null || f(u), !u.defaultPrevented) {
|
|
44
|
+
if (m) {
|
|
45
|
+
u.preventDefault();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
u.button === 0 && (u.metaKey || u.ctrlKey || u.shiftKey || u.altKey || i && i !== "_self" || o != null && o !== !1 || b || l && (u.preventDefault(), l.navigate(e, { replace: t, state: r })));
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
className: a,
|
|
52
|
+
style: s,
|
|
53
|
+
target: i,
|
|
54
|
+
download: o,
|
|
55
|
+
rel: w,
|
|
56
|
+
children: n
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}, G = ({
|
|
60
|
+
to: e,
|
|
61
|
+
children: n,
|
|
62
|
+
className: t = "",
|
|
63
|
+
style: r = {},
|
|
64
|
+
activeClassName: a = "active",
|
|
65
|
+
activeStyle: s = {},
|
|
66
|
+
exact: f = !1,
|
|
67
|
+
...i
|
|
68
|
+
}) => {
|
|
69
|
+
const o = y(), h = !!o && _(
|
|
70
|
+
o.currentPath,
|
|
71
|
+
e,
|
|
72
|
+
f,
|
|
73
|
+
o.basename
|
|
74
|
+
), p = h ? `${t} ${a}`.trim() : t, l = h ? { ...r, ...s } : r;
|
|
75
|
+
return /* @__PURE__ */ c(
|
|
76
|
+
j,
|
|
77
|
+
{
|
|
78
|
+
to: e,
|
|
79
|
+
className: p,
|
|
80
|
+
style: l,
|
|
81
|
+
...i,
|
|
82
|
+
"aria-current": h ? "page" : void 0,
|
|
83
|
+
children: n
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}, J = () => {
|
|
87
|
+
const e = y(), n = g();
|
|
88
|
+
if (!e || !n || !n.children || n.children.length === 0)
|
|
89
|
+
return null;
|
|
90
|
+
const { route: t } = O(n.children, e.currentPath);
|
|
91
|
+
if (!t)
|
|
92
|
+
return null;
|
|
93
|
+
const r = t.component;
|
|
94
|
+
return /* @__PURE__ */ c(P.Provider, { value: t, children: /* @__PURE__ */ c(r, {}) });
|
|
95
|
+
}, d = /* @__PURE__ */ new WeakMap();
|
|
96
|
+
function W(e) {
|
|
97
|
+
return e instanceof Error ? e : typeof e == "string" && e.trim() ? new Error(e) : new Error("Failed to load route");
|
|
98
|
+
}
|
|
99
|
+
function L(e) {
|
|
100
|
+
let n = d.get(e);
|
|
101
|
+
return n || (n = e().then(
|
|
102
|
+
(t) => t,
|
|
103
|
+
(t) => {
|
|
104
|
+
throw d.delete(e), W(t);
|
|
105
|
+
}
|
|
106
|
+
), d.set(e, n)), n;
|
|
107
|
+
}
|
|
108
|
+
function Q(e, n) {
|
|
109
|
+
function t(r) {
|
|
110
|
+
const [a, s] = M(0), f = N(
|
|
111
|
+
() => S(() => L(e)),
|
|
112
|
+
[a]
|
|
113
|
+
);
|
|
114
|
+
return /* @__PURE__ */ c(
|
|
115
|
+
z,
|
|
116
|
+
{
|
|
117
|
+
fallback: (i) => /* @__PURE__ */ c(
|
|
118
|
+
K,
|
|
119
|
+
{
|
|
120
|
+
error: i,
|
|
121
|
+
onReset: () => {
|
|
122
|
+
d.delete(e), s((o) => o + 1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
children: /* @__PURE__ */ c(B, { fallback: (n == null ? void 0 : n.loading) ?? /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(f, { ...r }) })
|
|
127
|
+
},
|
|
128
|
+
a
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return t;
|
|
132
|
+
}
|
|
133
|
+
function T(e) {
|
|
134
|
+
L(e);
|
|
135
|
+
}
|
|
136
|
+
function X() {
|
|
137
|
+
const e = g();
|
|
138
|
+
return e == null ? void 0 : e.meta;
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
j as L,
|
|
142
|
+
G as N,
|
|
143
|
+
J as O,
|
|
144
|
+
Q as l,
|
|
145
|
+
T as p,
|
|
146
|
+
X as u
|
|
147
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Router, Link, NavLink, useRouter, useNavigate, useParams, useLocation, useQuery, Outlet, lazyRoute, preloadRoute, useRouteMeta, DefaultLoader, DefaultErrorPage } from './index.js';
|
package/dist/navigation.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { L as
|
|
1
|
+
import { aE as s, aD as u, ax as o, aB as t, az as r, aA as l, aC as L, ay as R } from "./client-CGjHCx8F.js";
|
|
2
|
+
import { L as i, N as p, O as m, l as n, p as x, u as y } from "./metadata-3YYH1uiS.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
s as DefaultErrorPage,
|
|
5
|
+
u as DefaultLoader,
|
|
6
|
+
i as Link,
|
|
7
|
+
p as NavLink,
|
|
8
|
+
m as Outlet,
|
|
9
|
+
o as Router,
|
|
10
|
+
n as lazyRoute,
|
|
11
|
+
x as preloadRoute,
|
|
12
|
+
t as useLocation,
|
|
8
13
|
r as useNavigate,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
l as useParams,
|
|
15
|
+
L as useQuery,
|
|
16
|
+
y as useRouteMeta,
|
|
17
|
+
R as useRouter
|
|
12
18
|
};
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var k = (e, t, r) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var h = (e, t, r) => k(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { S as v, c as E, i as $, H as L, aZ as A, U as I } from "./client-CGjHCx8F.js";
|
|
5
|
+
import c from "react";
|
|
6
|
+
function U() {
|
|
7
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `lst_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
8
|
+
}
|
|
9
|
+
function N(e) {
|
|
10
|
+
return typeof e._id == "string" && e._id.length > 0;
|
|
11
|
+
}
|
|
12
|
+
function f(e) {
|
|
13
|
+
return N(e) ? e : { ...e, _id: U() };
|
|
14
|
+
}
|
|
15
|
+
function y(e, t, r) {
|
|
16
|
+
if (typeof r == "function")
|
|
17
|
+
return r(e, t);
|
|
18
|
+
if (e != null && typeof e == "object") {
|
|
19
|
+
const n = e;
|
|
20
|
+
return n._id != null && n._id === r || n.id != null && n.id === r;
|
|
21
|
+
}
|
|
22
|
+
return e === r;
|
|
23
|
+
}
|
|
24
|
+
function D(e, t) {
|
|
25
|
+
if (typeof t == "function")
|
|
26
|
+
return f({ ...t(e), _id: e._id });
|
|
27
|
+
const { _id: r, ...n } = t;
|
|
28
|
+
return { ...e, ...n, _id: e._id };
|
|
29
|
+
}
|
|
30
|
+
function P(e, t, r) {
|
|
31
|
+
const n = e;
|
|
32
|
+
return (r && r.length > 0 ? r.map((s) => n[s]) : Object.entries(n).filter(([s]) => s !== "_id").map(([, s]) => s)).some((s) => s == null ? !1 : typeof s == "string" || typeof s == "number" || typeof s == "boolean" ? String(s).toLowerCase().includes(t) : !1);
|
|
33
|
+
}
|
|
34
|
+
class T extends v {
|
|
35
|
+
constructor(r = []) {
|
|
36
|
+
const n = (Array.isArray(r) ? r : []).map((i) => f(i));
|
|
37
|
+
super(n);
|
|
38
|
+
h(this, "_$length");
|
|
39
|
+
/** Full list. `.value` is this array, or a filtered slice while a view/filter is set. */
|
|
40
|
+
h(this, "_source");
|
|
41
|
+
h(this, "_query", "");
|
|
42
|
+
h(this, "_keys");
|
|
43
|
+
h(this, "_predicate");
|
|
44
|
+
this._source = n, this.publish();
|
|
45
|
+
}
|
|
46
|
+
get value() {
|
|
47
|
+
return super.value;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Replaces the full list, then reapplies the current view.
|
|
51
|
+
* In-place mutation of this array (`push` / `splice`) does not notify
|
|
52
|
+
* and does not write the stored list — assign a new array or use
|
|
53
|
+
* `add` / `update` / `remove`.
|
|
54
|
+
*/
|
|
55
|
+
set value(r) {
|
|
56
|
+
this._source = r.map((n) => f(n)), this.publish();
|
|
57
|
+
}
|
|
58
|
+
/** Push the visible rows. Always a copy so `.value.splice` cannot write `_source`. */
|
|
59
|
+
publish() {
|
|
60
|
+
const n = !!this._query || !!this._predicate ? this._source.filter((i, s) => !(this._query && !P(i, this._query, this._keys) || this._predicate && !this._predicate(i, s))) : this._source.slice();
|
|
61
|
+
super.value = n;
|
|
62
|
+
}
|
|
63
|
+
get length() {
|
|
64
|
+
return this.value.length;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Reactive length for plain templates:
|
|
68
|
+
* `Text(\`Total todos: ${todos.$length}\`)`
|
|
69
|
+
*
|
|
70
|
+
* Embeds a marker via `interp()`; `Text` resolves it on each update.
|
|
71
|
+
* (`todos.length` is a plain number and still freezes — use `$length`.)
|
|
72
|
+
*/
|
|
73
|
+
get $length() {
|
|
74
|
+
return this._$length || (this._$length = E(() => this.value.length)), $(this._$length);
|
|
75
|
+
}
|
|
76
|
+
/** Replace the whole array (missing `_id`s are generated). */
|
|
77
|
+
set(r) {
|
|
78
|
+
return this.value = r.map((n) => f(n)), this;
|
|
79
|
+
}
|
|
80
|
+
clear() {
|
|
81
|
+
return this.value = [], this;
|
|
82
|
+
}
|
|
83
|
+
/** Append items — each gets `_id` if not already set. Writes the full list. */
|
|
84
|
+
add(...r) {
|
|
85
|
+
return r.length === 0 ? this : (this.value = [...this._source, ...r.map((n) => f(n))], this);
|
|
86
|
+
}
|
|
87
|
+
/** Insert at index (clamped) in the full list. */
|
|
88
|
+
insert(r, n) {
|
|
89
|
+
const i = [...this._source], s = Math.max(0, Math.min(r, i.length));
|
|
90
|
+
return i.splice(s, 0, f(n)), this.value = i, this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Patch by `_id` / `id` / predicate.
|
|
94
|
+
* `patch` can be a partial object or a mapper.
|
|
95
|
+
*/
|
|
96
|
+
update(r, n) {
|
|
97
|
+
let i = !1;
|
|
98
|
+
const s = this._source.map((u, l) => y(u, l, r) ? (i = !0, D(u, n)) : u);
|
|
99
|
+
return i && (this.value = s), this;
|
|
100
|
+
}
|
|
101
|
+
/** Replace the first match (keeps original `_id` unless `item` already has one). */
|
|
102
|
+
replace(r, n) {
|
|
103
|
+
const i = this._source.findIndex((l, m) => y(l, m, r));
|
|
104
|
+
if (i < 0) return this;
|
|
105
|
+
const s = this._source[i], u = [...this._source];
|
|
106
|
+
return u[i] = N(n) ? n : { ...n, _id: s._id }, this.value = u, this;
|
|
107
|
+
}
|
|
108
|
+
/** Remove by `_id` / `id` / predicate. Alias: `delete`. */
|
|
109
|
+
remove(r) {
|
|
110
|
+
const n = this._source.filter((i, s) => !y(i, s, r));
|
|
111
|
+
return n.length !== this._source.length && (this.value = n), this;
|
|
112
|
+
}
|
|
113
|
+
delete(r) {
|
|
114
|
+
return this.remove(r);
|
|
115
|
+
}
|
|
116
|
+
find(r) {
|
|
117
|
+
return this._source.find((n, i) => y(n, i, r));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Show only rows that match `query`. The full list stays stored.
|
|
121
|
+
* `view('')` or `view()` shows every item again (does not clear `viewWhere`).
|
|
122
|
+
* `keys` limits the match to those fields (`['text']`).
|
|
123
|
+
*/
|
|
124
|
+
view(r = "", n) {
|
|
125
|
+
return this._query = r.trim().toLowerCase(), this._keys = n, this.publish(), this;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Live predicate on `publish()` (AND with `view`/`search` query).
|
|
129
|
+
* `viewWhere()` with no fn (or `null`) clears it.
|
|
130
|
+
*/
|
|
131
|
+
viewWhere(r) {
|
|
132
|
+
return this._predicate = typeof r == "function" ? r : void 0, this.publish(), this;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Same live view as `view()`, plus a copy of the visible rows.
|
|
136
|
+
* Bound List/Table update; `const hits = todos.search('x')` still works.
|
|
137
|
+
*/
|
|
138
|
+
search(r, n) {
|
|
139
|
+
return this.view(r, n), [...this.value];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* One-shot snapshot of `_source` (Array.filter). Does not change `.value`.
|
|
143
|
+
* Safe inside `computed(() => todos.filter(fn))`.
|
|
144
|
+
* `todos.set(todos.filter(fn))` replaces the full list (clearDone).
|
|
145
|
+
*/
|
|
146
|
+
filter(r) {
|
|
147
|
+
return this._source.filter(r);
|
|
148
|
+
}
|
|
149
|
+
map(r) {
|
|
150
|
+
return this._source.map(r);
|
|
151
|
+
}
|
|
152
|
+
move(r, n) {
|
|
153
|
+
const i = [...this._source];
|
|
154
|
+
if (r < 0 || r >= i.length) return this;
|
|
155
|
+
const s = Math.max(0, Math.min(n, i.length - 1));
|
|
156
|
+
if (r === s) return this;
|
|
157
|
+
const [u] = i.splice(r, 1);
|
|
158
|
+
return i.splice(s, 0, u), this.value = i, this;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function j(e = []) {
|
|
162
|
+
return new T(e);
|
|
163
|
+
}
|
|
164
|
+
const J = j, q = {
|
|
165
|
+
linear: (e) => e,
|
|
166
|
+
easeIn: (e) => e * e,
|
|
167
|
+
easeOut: (e) => e * (2 - e),
|
|
168
|
+
easeInOut: (e) => e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e
|
|
169
|
+
};
|
|
170
|
+
function B(e, t, r) {
|
|
171
|
+
return e + (t - e) * r;
|
|
172
|
+
}
|
|
173
|
+
const a = /* @__PURE__ */ new WeakMap();
|
|
174
|
+
function R() {
|
|
175
|
+
return typeof requestAnimationFrame == "function";
|
|
176
|
+
}
|
|
177
|
+
function V() {
|
|
178
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
179
|
+
}
|
|
180
|
+
function W(e) {
|
|
181
|
+
const t = a.get(e);
|
|
182
|
+
t != null && typeof cancelAnimationFrame == "function" && cancelAnimationFrame(t), a.delete(e);
|
|
183
|
+
}
|
|
184
|
+
v.prototype.spring = function(e, t = {}) {
|
|
185
|
+
this.animate(e, { ...t, curve: "spring", damping: t.damping ?? 26, stiffness: t.stiffness ?? 170 });
|
|
186
|
+
};
|
|
187
|
+
v.prototype.animate = function(e, t = {}) {
|
|
188
|
+
var b, F;
|
|
189
|
+
const r = this.value, n = e;
|
|
190
|
+
if (W(this), !R() || V()) {
|
|
191
|
+
this.value = n, (b = t.onComplete) == null || b.call(t);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (t.curve === "spring") {
|
|
195
|
+
const g = typeof t.stiffness == "number" && Number.isFinite(t.stiffness) && t.stiffness > 0 ? t.stiffness : 170, p = typeof t.damping == "number" && Number.isFinite(t.damping) && t.damping >= 0 ? t.damping : 26, _ = typeof t.mass == "number" && Number.isFinite(t.mass) && t.mass > 0 ? t.mass : 1;
|
|
196
|
+
let o = r, d = typeof t.velocity == "number" && Number.isFinite(t.velocity) ? t.velocity : 0;
|
|
197
|
+
const w = 1 / 60, M = () => {
|
|
198
|
+
var x, C;
|
|
199
|
+
const S = -g * (o - n) - p * d;
|
|
200
|
+
if (d += S / _ * w, o += d * w, !Number.isFinite(o) || !Number.isFinite(d)) {
|
|
201
|
+
this.value = n, a.delete(this), (x = t.onComplete) == null || x.call(t);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.value = o, Math.abs(o - n) > 0.01 || Math.abs(d) > 0.01 ? a.set(this, requestAnimationFrame(M)) : (this.value = n, a.delete(this), (C = t.onComplete) == null || C.call(t));
|
|
205
|
+
};
|
|
206
|
+
a.set(this, requestAnimationFrame(M));
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const i = t.duration, s = typeof i == "number" && Number.isFinite(i) && i > 0 ? i : i === void 0 ? 300 : 0;
|
|
210
|
+
if (s === 0) {
|
|
211
|
+
this.value = n, (F = t.onComplete) == null || F.call(t);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const u = q[t.curve || "easeOut"] ?? q.easeOut;
|
|
215
|
+
let l = null;
|
|
216
|
+
const m = (g) => {
|
|
217
|
+
var _;
|
|
218
|
+
l || (l = g);
|
|
219
|
+
const p = Math.min((g - l) / s, 1);
|
|
220
|
+
this.value = B(r, n, u(p)), p < 1 ? a.set(this, requestAnimationFrame(m)) : (a.delete(this), (_ = t.onComplete) == null || _.call(t));
|
|
221
|
+
};
|
|
222
|
+
a.set(this, requestAnimationFrame(m));
|
|
223
|
+
};
|
|
224
|
+
v.prototype.snapTo = function(e, t = {}) {
|
|
225
|
+
this.animate(e, { duration: 300, curve: "easeOut", ...t });
|
|
226
|
+
};
|
|
227
|
+
function K(e = {}) {
|
|
228
|
+
return L(e.curve ?? "easeOut", {
|
|
229
|
+
stiffness: e.stiffness,
|
|
230
|
+
damping: e.damping,
|
|
231
|
+
mass: e.mass
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function H(e, t = {}) {
|
|
235
|
+
const { styles: r = !0, meta: n } = t;
|
|
236
|
+
function i() {
|
|
237
|
+
const s = A(e()), u = [];
|
|
238
|
+
return typeof (n == null ? void 0 : n.title) == "string" && n.title.length > 0 && u.push(c.createElement("title", { key: "fibo-title" }, n.title)), typeof (n == null ? void 0 : n.description) == "string" && n.description.length > 0 && u.push(
|
|
239
|
+
c.createElement("meta", {
|
|
240
|
+
key: "fibo-description",
|
|
241
|
+
name: "description",
|
|
242
|
+
content: n.description
|
|
243
|
+
})
|
|
244
|
+
), u.push(s), r && u.push(c.createElement(I)), c.createElement(c.Fragment, null, ...u);
|
|
245
|
+
}
|
|
246
|
+
return i.displayName = "FiboPage", n && (i.meta = n), i;
|
|
247
|
+
}
|
|
248
|
+
const Q = H;
|
|
249
|
+
function X(e) {
|
|
250
|
+
return c.createElement(
|
|
251
|
+
c.Fragment,
|
|
252
|
+
null,
|
|
253
|
+
A(e),
|
|
254
|
+
c.createElement(I)
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
export {
|
|
258
|
+
T as L,
|
|
259
|
+
K as a,
|
|
260
|
+
Q as b,
|
|
261
|
+
J as c,
|
|
262
|
+
f as e,
|
|
263
|
+
j as l,
|
|
264
|
+
H as p,
|
|
265
|
+
X as w
|
|
266
|
+
};
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { page, withFiboStyles, createPage, FiboStyles, MotionStyles, getCss, getStyleTag, endSsrRequest, Center, Column, Container, Row, Spacer, Header, Scaffold, Box, Card, Grid, GridItem, Text, Button, Presence } from './index.js';
|
|
2
|
+
export type { FiboPageBuild, FiboPageOptions } from './index.js';
|