@memobit/libs 3.29.0 → 3.31.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/PageShell/AppFrame.js +21 -16
- package/dist/components/PageShell/AppNav.js +55 -0
- package/dist/components/PageShell/PageParts.js +186 -127
- package/dist/components/PageShell/PageShell.css +1 -1
- package/dist/components/PageShell/WorkbenchPhone.js +74 -71
- package/dist/components/PageShell/WorkbenchShell.js +71 -65
- package/dist/components/PageShell/menuItems.js +11 -3
- package/dist/components/RouterAppFrame/RouterAppFrame.js +37 -0
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
- package/dist/components/ThemeSettings/ThemeContext.js +35 -35
- package/dist/contexts/LanguageContext/libMessages.js +2 -0
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +42 -1
- package/dist/router.d.ts +68 -0
- package/dist/router.js +4 -2
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +2 -2
|
@@ -1,139 +1,142 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import { libMessages as
|
|
3
|
-
import { useMessages as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { InputSearch as
|
|
6
|
-
import { useAppFrame as
|
|
7
|
-
import { countActiveFilters as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { Icon as v } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as j } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as N } from "../Button/Button2.js";
|
|
5
|
+
import { InputSearch as P } from "../InputSearch/InputSearch2.js";
|
|
6
|
+
import { useAppFrame as T } from "./useAppFrame.js";
|
|
7
|
+
import { countActiveFilters as z } from "./filterRules.js";
|
|
8
|
+
import { getHeadingText as O, getResultLabel as W } from "./shellText.js";
|
|
9
|
+
import { AppMark as D, PageMenu as V, PagePager as H, SortSheetBody as R } from "./PageParts.js";
|
|
10
|
+
import { TabBar as $ } from "./AppNav.js";
|
|
11
|
+
import { AppliedFilters as q, FilterSections as E } from "./FilterSections.js";
|
|
12
|
+
import { getMenuItems as G, navToMenuItems as J } from "./menuItems.js";
|
|
13
|
+
import { BottomSheet as w } from "./BottomSheet.js";
|
|
14
|
+
import { useCallback as K, useState as Q } from "react";
|
|
15
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
16
|
+
var pe = (h) => {
|
|
17
|
+
const { title: S, counts: p, primaryAction: l, actions: A = [], search: n, sort: a, view: m, filters: s = [], values: d = {}, onFilterChange: C = () => {
|
|
18
|
+
}, onClearFilters: u, pagination: g, children: y } = h, t = L(j), r = T(), [k, f] = Q(null), i = K(() => f(null), []), b = z(s, d), B = W(h, t), F = a?.fields.find((x) => x.value === a.value.field)?.label, I = [O(h, t), F].filter(Boolean).join(" · "), c = r?.nav ?? [], _ = c.length > 1 && c.length <= 5, M = [..._ ? [] : J(c), ...G(A, r?.menuItems ?? [], !0)];
|
|
19
|
+
return /* @__PURE__ */ o("div", {
|
|
19
20
|
className: [
|
|
20
21
|
"page-shell",
|
|
21
22
|
"page-shell--workbench",
|
|
22
23
|
"page-shell--phone",
|
|
23
|
-
|
|
24
|
+
_ ? "page-shell--with-tabs" : "",
|
|
25
|
+
l?.variant ? `page-shell--fab-${l.variant}` : ""
|
|
24
26
|
].filter(Boolean).join(" "),
|
|
25
27
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ o("header", {
|
|
27
29
|
className: "page-shell__topbar",
|
|
28
30
|
children: [
|
|
29
|
-
|
|
30
|
-
app:
|
|
31
|
+
r && /* @__PURE__ */ e(D, {
|
|
32
|
+
app: r.app,
|
|
31
33
|
logoOnly: !0
|
|
32
34
|
}),
|
|
33
35
|
/* @__PURE__ */ e("h1", {
|
|
34
36
|
className: "page-shell__title",
|
|
35
|
-
children:
|
|
37
|
+
children: S
|
|
36
38
|
}),
|
|
37
39
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
38
|
-
s.length > 0 && /* @__PURE__ */
|
|
40
|
+
s.length > 0 && /* @__PURE__ */ o("button", {
|
|
39
41
|
type: "button",
|
|
40
42
|
className: "page-shell__icon-button",
|
|
41
|
-
onClick: () =>
|
|
42
|
-
children: [/* @__PURE__ */ e(
|
|
43
|
+
onClick: () => f("filters"),
|
|
44
|
+
children: [/* @__PURE__ */ e(v, {
|
|
43
45
|
name: "tune",
|
|
44
46
|
size: "md"
|
|
45
|
-
}),
|
|
47
|
+
}), b > 0 && /* @__PURE__ */ e("span", {
|
|
46
48
|
className: "page-shell__badge page-shell__badge--corner",
|
|
47
|
-
children:
|
|
49
|
+
children: b
|
|
48
50
|
})]
|
|
49
51
|
}),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
52
|
+
/* @__PURE__ */ e(V, { items: M })
|
|
51
53
|
]
|
|
52
54
|
}),
|
|
53
55
|
n && /* @__PURE__ */ e("div", {
|
|
54
56
|
className: "page-shell__search-row",
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
57
|
+
children: /* @__PURE__ */ e(P, {
|
|
56
58
|
value: n.value,
|
|
57
|
-
placeholder: n.placeholder ??
|
|
59
|
+
placeholder: n.placeholder ?? t.search,
|
|
58
60
|
onChange: n.onChange
|
|
59
61
|
})
|
|
60
62
|
}),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
63
|
+
/* @__PURE__ */ e(q, {
|
|
62
64
|
filters: s,
|
|
63
|
-
values:
|
|
64
|
-
onFilterChange:
|
|
65
|
-
onClearFilters:
|
|
65
|
+
values: d,
|
|
66
|
+
onFilterChange: C,
|
|
67
|
+
onClearFilters: u,
|
|
66
68
|
scroll: !0
|
|
67
69
|
}),
|
|
68
|
-
(
|
|
70
|
+
(a || m || g && g.pageCount > 1) && /* @__PURE__ */ o("div", {
|
|
69
71
|
className: "page-shell__result-row",
|
|
70
|
-
children: [(
|
|
72
|
+
children: [(a || m) && /* @__PURE__ */ o("button", {
|
|
71
73
|
type: "button",
|
|
72
74
|
className: "page-shell__result-line",
|
|
73
|
-
onClick: () =>
|
|
74
|
-
children: [/* @__PURE__ */ e("span", { children:
|
|
75
|
+
onClick: () => f("sort"),
|
|
76
|
+
children: [/* @__PURE__ */ e("span", { children: I || t.pageSortAndView }), /* @__PURE__ */ e(v, {
|
|
75
77
|
name: "caret-down",
|
|
76
78
|
size: "sm"
|
|
77
79
|
})]
|
|
78
|
-
}), /* @__PURE__ */ e(
|
|
80
|
+
}), /* @__PURE__ */ e(H, { pagination: g })]
|
|
79
81
|
}),
|
|
80
82
|
/* @__PURE__ */ e("div", {
|
|
81
83
|
className: "page-shell__content",
|
|
82
|
-
children:
|
|
84
|
+
children: y
|
|
83
85
|
}),
|
|
84
|
-
|
|
86
|
+
l && /* @__PURE__ */ e("button", {
|
|
85
87
|
type: "button",
|
|
86
88
|
className: "page-shell__fab",
|
|
87
|
-
disabled:
|
|
88
|
-
onClick:
|
|
89
|
-
children: /* @__PURE__ */ e(
|
|
90
|
-
name:
|
|
89
|
+
disabled: l.disabled,
|
|
90
|
+
onClick: l.onClick,
|
|
91
|
+
children: /* @__PURE__ */ e(v, {
|
|
92
|
+
name: l.icon ?? "plus",
|
|
91
93
|
size: "lg"
|
|
92
94
|
})
|
|
93
95
|
}),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
|
|
96
|
+
_ && /* @__PURE__ */ e($, { nav: c }),
|
|
97
|
+
/* @__PURE__ */ e(w, {
|
|
98
|
+
isOpen: k === "filters",
|
|
96
99
|
tall: !0,
|
|
97
|
-
title:
|
|
98
|
-
onClose:
|
|
99
|
-
end:
|
|
100
|
+
title: t.filters,
|
|
101
|
+
onClose: i,
|
|
102
|
+
end: b > 0 && u ? /* @__PURE__ */ e("button", {
|
|
100
103
|
type: "button",
|
|
101
104
|
className: "page-shell__link",
|
|
102
|
-
onClick:
|
|
103
|
-
children:
|
|
105
|
+
onClick: u,
|
|
106
|
+
children: t.pageClearAll
|
|
104
107
|
}) : void 0,
|
|
105
|
-
footer: /* @__PURE__ */ e(
|
|
108
|
+
footer: /* @__PURE__ */ e(N, {
|
|
106
109
|
variant: "info",
|
|
107
110
|
fullWidth: !0,
|
|
108
|
-
disabled:
|
|
109
|
-
onClick:
|
|
110
|
-
children:
|
|
111
|
+
disabled: p?.shown === 0,
|
|
112
|
+
onClick: i,
|
|
113
|
+
children: p ? B(p.shown) : t.pageDone
|
|
111
114
|
}),
|
|
112
|
-
children: /* @__PURE__ */ e(
|
|
115
|
+
children: /* @__PURE__ */ e(E, {
|
|
113
116
|
filters: s,
|
|
114
|
-
values:
|
|
117
|
+
values: d,
|
|
115
118
|
context: "sheet",
|
|
116
|
-
onFilterChange:
|
|
119
|
+
onFilterChange: C
|
|
117
120
|
})
|
|
118
121
|
}),
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
isOpen:
|
|
121
|
-
title:
|
|
122
|
-
onClose:
|
|
123
|
-
footer: /* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(w, {
|
|
123
|
+
isOpen: k === "sort",
|
|
124
|
+
title: t.pageSortAndView,
|
|
125
|
+
onClose: i,
|
|
126
|
+
footer: /* @__PURE__ */ e(N, {
|
|
124
127
|
variant: "info",
|
|
125
128
|
fullWidth: !0,
|
|
126
|
-
onClick:
|
|
127
|
-
children:
|
|
129
|
+
onClick: i,
|
|
130
|
+
children: t.pageDone
|
|
128
131
|
}),
|
|
129
|
-
children: /* @__PURE__ */ e(
|
|
130
|
-
sort:
|
|
131
|
-
view:
|
|
132
|
+
children: /* @__PURE__ */ e(R, {
|
|
133
|
+
sort: a,
|
|
134
|
+
view: m
|
|
132
135
|
})
|
|
133
136
|
})
|
|
134
137
|
]
|
|
135
138
|
});
|
|
136
139
|
};
|
|
137
140
|
export {
|
|
138
|
-
|
|
141
|
+
pe as WorkbenchPhone
|
|
139
142
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { libMessages as
|
|
2
|
-
import { useMessages as
|
|
1
|
+
import { libMessages as V } from "../../contexts/LanguageContext/libMessages.js";
|
|
2
|
+
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
3
3
|
import { Button as _ } from "../Button/Button2.js";
|
|
4
|
-
import { InputSearch as
|
|
5
|
-
import { useBreakpoint as
|
|
6
|
-
import { Drawer as
|
|
7
|
-
import { useAppFrame as
|
|
8
|
-
import { countActiveFilters as
|
|
9
|
-
import { AppliedFilters as q, FilterSections as z } from "./FilterSections.js";
|
|
10
|
-
import { toMenuItems as E } from "./menuItems.js";
|
|
4
|
+
import { InputSearch as R } from "../InputSearch/InputSearch2.js";
|
|
5
|
+
import { useBreakpoint as E } from "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { Drawer as H } from "../Drawer/Drawer2.js";
|
|
7
|
+
import { useAppFrame as q } from "./useAppFrame.js";
|
|
8
|
+
import { countActiveFilters as z } from "./filterRules.js";
|
|
11
9
|
import { getHeadingText as G, getResultLabel as J } from "./shellText.js";
|
|
12
|
-
import { ActionButton as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { ActionButton as v, AppMark as B, PageMenu as M, PagePager as K, SortDropdown as Q, ViewOptions as S, ViewToggle as U } from "./PageParts.js";
|
|
11
|
+
import { NavRail as X, SideNav as Y } from "./AppNav.js";
|
|
12
|
+
import { AppliedFilters as Z, FilterSections as $ } from "./FilterSections.js";
|
|
13
|
+
import { getButtonActions as ee, getMenuItems as y } from "./menuItems.js";
|
|
14
|
+
import { WorkbenchPhone as le } from "./WorkbenchPhone.js";
|
|
15
|
+
import { useState as ae } from "react";
|
|
15
16
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
16
|
-
var
|
|
17
|
-
const { isMobile:
|
|
18
|
-
if (
|
|
19
|
-
const { title:
|
|
20
|
-
}, onClearFilters: i, pagination:
|
|
21
|
-
filters:
|
|
22
|
-
values:
|
|
17
|
+
var Ne = (n) => {
|
|
18
|
+
const { isMobile: I, isTablet: l } = E(), t = L(V), r = q(), [O, g] = ae(!1);
|
|
19
|
+
if (I) return /* @__PURE__ */ e(le, { ...n });
|
|
20
|
+
const { title: D, counts: N, primaryAction: c, actions: d = [], search: p, sort: b, view: s, filters: h = [], values: u = {}, onFilterChange: w = () => {
|
|
21
|
+
}, onClearFilters: i, pagination: P, children: T } = n, k = G(n, t), W = J(n, t), m = z(h, u), f = h.length > 0, C = r?.menuItems ?? [], o = r?.nav ?? [], j = !!(s && (s.columns || s.groupBy || s.toggles?.length)), A = /* @__PURE__ */ e($, {
|
|
22
|
+
filters: h,
|
|
23
|
+
values: u,
|
|
23
24
|
context: "panel",
|
|
24
|
-
onFilterChange:
|
|
25
|
-
}),
|
|
25
|
+
onFilterChange: w
|
|
26
|
+
}), F = m > 0 && /* @__PURE__ */ e("span", {
|
|
26
27
|
className: "page-shell__badge",
|
|
27
|
-
children:
|
|
28
|
+
children: m
|
|
28
29
|
});
|
|
29
30
|
return /* @__PURE__ */ a("div", {
|
|
30
31
|
className: [
|
|
@@ -36,47 +37,52 @@ var de = (o) => {
|
|
|
36
37
|
!l && /* @__PURE__ */ a("aside", {
|
|
37
38
|
className: "page-shell__side",
|
|
38
39
|
children: [
|
|
39
|
-
r && /* @__PURE__ */ e(
|
|
40
|
-
|
|
41
|
-
action:
|
|
40
|
+
r && /* @__PURE__ */ e(B, { app: r.app }),
|
|
41
|
+
c && /* @__PURE__ */ e(v, {
|
|
42
|
+
action: c,
|
|
42
43
|
fullWidth: !0
|
|
43
44
|
}),
|
|
44
|
-
|
|
45
|
+
o.length > 1 && /* @__PURE__ */ e(Y, { nav: o }),
|
|
46
|
+
f && /* @__PURE__ */ a("div", {
|
|
45
47
|
className: "page-shell__side-group",
|
|
46
48
|
children: [/* @__PURE__ */ a("div", {
|
|
47
49
|
className: "page-shell__side-head",
|
|
48
50
|
children: [
|
|
49
51
|
/* @__PURE__ */ e("span", {
|
|
50
52
|
className: "page-shell__group-title",
|
|
51
|
-
children:
|
|
53
|
+
children: t.filters
|
|
52
54
|
}),
|
|
53
|
-
|
|
55
|
+
F,
|
|
54
56
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
55
|
-
|
|
57
|
+
m > 0 && i && /* @__PURE__ */ e("button", {
|
|
56
58
|
type: "button",
|
|
57
59
|
className: "page-shell__link",
|
|
58
60
|
onClick: i,
|
|
59
|
-
children:
|
|
61
|
+
children: t.pageClearAll
|
|
60
62
|
})
|
|
61
63
|
]
|
|
62
|
-
}),
|
|
64
|
+
}), A]
|
|
63
65
|
}),
|
|
64
|
-
|
|
66
|
+
s && /* @__PURE__ */ e(S, { view: s })
|
|
65
67
|
]
|
|
66
68
|
}),
|
|
69
|
+
l && o.length > 1 && /* @__PURE__ */ e(X, {
|
|
70
|
+
app: r?.app,
|
|
71
|
+
nav: o
|
|
72
|
+
}),
|
|
67
73
|
/* @__PURE__ */ a("div", {
|
|
68
74
|
className: "page-shell__main",
|
|
69
75
|
children: [
|
|
70
76
|
/* @__PURE__ */ a("header", {
|
|
71
77
|
className: "page-shell__toolbar",
|
|
72
78
|
children: [
|
|
73
|
-
l &&
|
|
79
|
+
l && f && /* @__PURE__ */ a(_, {
|
|
74
80
|
icon: "tune",
|
|
75
81
|
variant: "default",
|
|
76
|
-
onClick: () =>
|
|
77
|
-
children: [
|
|
82
|
+
onClick: () => g(!0),
|
|
83
|
+
children: [t.filters, F]
|
|
78
84
|
}),
|
|
79
|
-
l && r && /* @__PURE__ */ e(
|
|
85
|
+
l && r && o.length <= 1 && /* @__PURE__ */ e(B, {
|
|
80
86
|
app: r.app,
|
|
81
87
|
logoOnly: !0
|
|
82
88
|
}),
|
|
@@ -84,64 +90,64 @@ var de = (o) => {
|
|
|
84
90
|
className: "page-shell__titles",
|
|
85
91
|
children: [/* @__PURE__ */ e("h1", {
|
|
86
92
|
className: "page-shell__title",
|
|
87
|
-
children:
|
|
93
|
+
children: D
|
|
88
94
|
}), k && /* @__PURE__ */ e("p", {
|
|
89
95
|
className: "page-shell__heading",
|
|
90
96
|
children: k
|
|
91
97
|
})]
|
|
92
98
|
}),
|
|
93
|
-
l &&
|
|
94
|
-
l && /* @__PURE__ */ e(
|
|
99
|
+
l && c && /* @__PURE__ */ e(v, { action: c }),
|
|
100
|
+
l && /* @__PURE__ */ e(M, { items: y(d, C, !0) }),
|
|
95
101
|
l && /* @__PURE__ */ e("span", { className: "page-shell__break" }),
|
|
96
|
-
|
|
102
|
+
p && /* @__PURE__ */ e(R, {
|
|
97
103
|
className: "page-shell__search",
|
|
98
|
-
value:
|
|
99
|
-
placeholder:
|
|
100
|
-
onChange:
|
|
104
|
+
value: p.value,
|
|
105
|
+
placeholder: p.placeholder ?? t.search,
|
|
106
|
+
onChange: p.onChange
|
|
101
107
|
}),
|
|
102
|
-
|
|
103
|
-
l &&
|
|
104
|
-
!l &&
|
|
105
|
-
!l && /* @__PURE__ */ e(
|
|
108
|
+
b && /* @__PURE__ */ e(Q, { sort: b }),
|
|
109
|
+
l && s && /* @__PURE__ */ e(U, { view: s }),
|
|
110
|
+
!l && ee(d).map((x) => /* @__PURE__ */ e(v, { action: x }, x.id)),
|
|
111
|
+
!l && /* @__PURE__ */ e(M, { items: y(d, C, !1) })
|
|
106
112
|
]
|
|
107
113
|
}),
|
|
108
114
|
/* @__PURE__ */ a("div", {
|
|
109
115
|
className: "page-shell__status",
|
|
110
|
-
children: [/* @__PURE__ */ e(
|
|
111
|
-
filters:
|
|
112
|
-
values:
|
|
113
|
-
onFilterChange:
|
|
116
|
+
children: [/* @__PURE__ */ e(Z, {
|
|
117
|
+
filters: h,
|
|
118
|
+
values: u,
|
|
119
|
+
onFilterChange: w,
|
|
114
120
|
onClearFilters: i
|
|
115
|
-
}), /* @__PURE__ */ e(K, { pagination:
|
|
121
|
+
}), /* @__PURE__ */ e(K, { pagination: P })]
|
|
116
122
|
}),
|
|
117
123
|
/* @__PURE__ */ e("div", {
|
|
118
124
|
className: "page-shell__content",
|
|
119
|
-
children:
|
|
125
|
+
children: T
|
|
120
126
|
})
|
|
121
127
|
]
|
|
122
128
|
}),
|
|
123
|
-
l &&
|
|
124
|
-
isOpen:
|
|
125
|
-
onClose: () =>
|
|
129
|
+
l && f && /* @__PURE__ */ e(H, {
|
|
130
|
+
isOpen: O,
|
|
131
|
+
onClose: () => g(!1),
|
|
126
132
|
position: "left",
|
|
127
|
-
title:
|
|
133
|
+
title: t.filters,
|
|
128
134
|
footer: /* @__PURE__ */ a("div", {
|
|
129
135
|
className: "page-shell__drawer-footer",
|
|
130
|
-
children: [
|
|
136
|
+
children: [m > 0 && i && /* @__PURE__ */ e(_, {
|
|
131
137
|
variant: "default",
|
|
132
138
|
onClick: i,
|
|
133
|
-
children:
|
|
134
|
-
}),
|
|
139
|
+
children: t.pageClearAll
|
|
140
|
+
}), N && /* @__PURE__ */ e(_, {
|
|
135
141
|
variant: "info",
|
|
136
142
|
fullWidth: !0,
|
|
137
|
-
onClick: () =>
|
|
138
|
-
children:
|
|
143
|
+
onClick: () => g(!1),
|
|
144
|
+
children: W(N.shown)
|
|
139
145
|
})]
|
|
140
146
|
}),
|
|
141
147
|
children: /* @__PURE__ */ a("div", {
|
|
142
148
|
className: "page-shell__drawer-body",
|
|
143
|
-
children: [
|
|
144
|
-
view:
|
|
149
|
+
children: [A, s && j && /* @__PURE__ */ e(S, {
|
|
150
|
+
view: s,
|
|
145
151
|
showToggle: !1
|
|
146
152
|
})]
|
|
147
153
|
})
|
|
@@ -150,5 +156,5 @@ var de = (o) => {
|
|
|
150
156
|
});
|
|
151
157
|
};
|
|
152
158
|
export {
|
|
153
|
-
|
|
159
|
+
Ne as WorkbenchShell
|
|
154
160
|
};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o = (l) => l.map((e) => ({
|
|
2
2
|
label: e.label,
|
|
3
3
|
icon: e.icon,
|
|
4
4
|
onClick: e.onClick,
|
|
5
|
-
isActive: !1
|
|
5
|
+
isActive: !1,
|
|
6
|
+
separator: e.separator
|
|
7
|
+
})), r = (l) => l.filter((e) => !e.menu), t = (l, e, a) => [...o(a ? l : l.filter((n) => n.menu)), ...e], i = (l) => l.map((e) => ({
|
|
8
|
+
label: e.label,
|
|
9
|
+
icon: e.icon,
|
|
10
|
+
onClick: e.onSelect,
|
|
11
|
+
isActive: e.isActive
|
|
6
12
|
}));
|
|
7
13
|
export {
|
|
8
|
-
|
|
14
|
+
r as getButtonActions,
|
|
15
|
+
t as getMenuItems,
|
|
16
|
+
i as navToMenuItems
|
|
9
17
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AppFrame as m } from "../PageShell/AppFrame.js";
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { matchPath as l, useLocation as u, useNavigate as d } from "react-router";
|
|
5
|
+
var g = ({ nav: n, app: e, ...r }) => {
|
|
6
|
+
const { pathname: t } = u(), a = d(), h = p(() => n.map((o) => ({
|
|
7
|
+
id: o.path,
|
|
8
|
+
label: o.label,
|
|
9
|
+
icon: o.icon,
|
|
10
|
+
count: o.count,
|
|
11
|
+
isActive: l({
|
|
12
|
+
path: o.path,
|
|
13
|
+
end: o.end ?? o.path === "/"
|
|
14
|
+
}, t) !== null,
|
|
15
|
+
onSelect: () => a(o.path)
|
|
16
|
+
})), [
|
|
17
|
+
n,
|
|
18
|
+
t,
|
|
19
|
+
a
|
|
20
|
+
]), c = n[0]?.path ?? "/", i = p(() => ({
|
|
21
|
+
...e,
|
|
22
|
+
onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
|
|
23
|
+
}), [
|
|
24
|
+
e,
|
|
25
|
+
t,
|
|
26
|
+
c,
|
|
27
|
+
a
|
|
28
|
+
]);
|
|
29
|
+
return /* @__PURE__ */ s(m, {
|
|
30
|
+
...r,
|
|
31
|
+
app: i,
|
|
32
|
+
nav: h
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
g as RouterAppFrame
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;width:var(--spacing-48);height:var(--spacing-48);border-radius:var(--radius-full);background-color:var(--card-background-color);color:var(--body-accent-color);border:var(--spacing-1) solid var(--card-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);transition:transform var(--transition-fast);animation:scrollToTopFadeIn var(--transition-moderate);justify-content:center;align-items:center;display:flex;position:fixed}.scroll-to-top:hover{transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}body:has(.float-button-container) .scroll-to-top{right:calc(var(--spacing-24) + var(--spacing-4));bottom:calc(var(--spacing-24) + 66px)}body:has(.page-shell__fab) .scroll-to-top{right:calc(var(--spacing-16) + var(--spacing-6));bottom:calc(var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(var(--spacing-12))}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}
|
|
1
|
+
.scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;width:var(--spacing-48);height:var(--spacing-48);border-radius:var(--radius-full);background-color:var(--card-background-color);color:var(--body-accent-color);border:var(--spacing-1) solid var(--card-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);transition:transform var(--transition-fast);animation:scrollToTopFadeIn var(--transition-moderate);justify-content:center;align-items:center;display:flex;position:fixed}.scroll-to-top:hover{transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}body:has(.float-button-container) .scroll-to-top{right:calc(var(--spacing-24) + var(--spacing-4));bottom:calc(var(--spacing-24) + 66px)}body:has(.page-shell__fab) .scroll-to-top{right:calc(var(--spacing-16) + var(--spacing-6));bottom:calc(var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(var(--spacing-12))}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}body:has(.page-shell--with-tabs) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + env(safe-area-inset-bottom,0px))}body:has(.page-shell--with-tabs .page-shell__fab) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ThemeContext as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import { THEME_CONFIGS as c, getThemeConfig as
|
|
4
|
-
import { useCallback as m, useEffect as
|
|
1
|
+
import { ThemeContext as A } from "./ThemeContextValue.js";
|
|
2
|
+
import { Tooltip as F } from "../Tooltip/Tooltip2.js";
|
|
3
|
+
import { THEME_CONFIGS as c, getThemeConfig as k } from "./themeConfig.js";
|
|
4
|
+
import { useCallback as m, useEffect as I, useState as v } from "react";
|
|
5
5
|
import { jsx as f, jsxs as E } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
const [d, l] = v(null), [
|
|
8
|
-
|
|
6
|
+
var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display", C = "theme-font-link-mono", q = ({ children: M, theme: y, effects: N, onSave: g, allowedThemes: s, fallbackTheme: P = "luna" }) => {
|
|
7
|
+
const [d, l] = v(null), [S, a] = v(null), [D, T] = v(!1), O = k(y) === void 0 ? P : y, o = d ?? O, p = S ?? N;
|
|
8
|
+
I(() => {
|
|
9
9
|
document.documentElement.setAttribute("data-theme", o);
|
|
10
10
|
const i = (typeof __MEMOBIT_THEME_URLS__ > "u" ? void 0 : __MEMOBIT_THEME_URLS__)?.[o];
|
|
11
11
|
if (i !== void 0) {
|
|
12
|
-
let e = document.getElementById(
|
|
13
|
-
e || (e = document.createElement("link"), e.id =
|
|
12
|
+
let e = document.getElementById(b);
|
|
13
|
+
e || (e = document.createElement("link"), e.id = b, e.rel = "stylesheet", document.head.appendChild(e));
|
|
14
14
|
const t = new URL(i, import.meta.url).href;
|
|
15
15
|
e.href !== t && (e.href = t);
|
|
16
16
|
}
|
|
17
|
-
const r =
|
|
17
|
+
const r = k(o);
|
|
18
18
|
if (r) {
|
|
19
|
-
let e = document.getElementById(
|
|
20
|
-
e || (e = document.createElement("link"), e.id =
|
|
21
|
-
let t = document.getElementById(
|
|
22
|
-
r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id =
|
|
23
|
-
let n = document.getElementById(
|
|
24
|
-
r.fontUrlMono ? (n || (n = document.createElement("link"), n.id =
|
|
19
|
+
let e = document.getElementById(w);
|
|
20
|
+
e || (e = document.createElement("link"), e.id = w, e.rel = "stylesheet", document.head.appendChild(e)), e.href = r.fontUrl;
|
|
21
|
+
let t = document.getElementById(L);
|
|
22
|
+
r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id = L, t.rel = "stylesheet", document.head.appendChild(t)), t.href = r.fontUrlDisplay) : t?.remove();
|
|
23
|
+
let n = document.getElementById(C);
|
|
24
|
+
r.fontUrlMono ? (n || (n = document.createElement("link"), n.id = C, n.rel = "stylesheet", document.head.appendChild(n)), n.href = r.fontUrlMono) : n?.remove();
|
|
25
25
|
}
|
|
26
26
|
}, [o]);
|
|
27
|
-
const
|
|
27
|
+
const U = m((i) => {
|
|
28
28
|
l(i);
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), K = m((i) => {
|
|
30
30
|
a(i);
|
|
31
|
-
}, []),
|
|
31
|
+
}, []), B = m(() => {
|
|
32
32
|
l(null), a(null);
|
|
33
33
|
}, []);
|
|
34
|
-
|
|
34
|
+
I(() => {
|
|
35
35
|
const i = (e) => {
|
|
36
36
|
if (!(e instanceof HTMLElement)) return !1;
|
|
37
37
|
const t = e.tagName;
|
|
@@ -42,8 +42,8 @@ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
|
|
|
42
42
|
e.preventDefault();
|
|
43
43
|
const t = c.map((u) => u.value), n = s && s.length > 0 ? t.filter((u) => s.includes(u)) : t;
|
|
44
44
|
if (n.length === 0) return;
|
|
45
|
-
const
|
|
46
|
-
l(n[
|
|
45
|
+
const _ = n.indexOf(o), R = ((_ === -1 ? 0 : _) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
|
|
46
|
+
l(n[R]);
|
|
47
47
|
} else e.key === "Escape" && d && (e.preventDefault(), l(null), a(null));
|
|
48
48
|
};
|
|
49
49
|
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
@@ -52,26 +52,26 @@ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
|
|
|
52
52
|
d,
|
|
53
53
|
s
|
|
54
54
|
]);
|
|
55
|
-
const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o,
|
|
56
|
-
|
|
55
|
+
const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o, H = m(() => {
|
|
56
|
+
g?.({
|
|
57
57
|
theme: o,
|
|
58
58
|
effects: p
|
|
59
59
|
}), l(null), a(null);
|
|
60
60
|
}, [
|
|
61
61
|
o,
|
|
62
62
|
p,
|
|
63
|
-
|
|
63
|
+
g
|
|
64
64
|
]);
|
|
65
|
-
return /* @__PURE__ */ E(
|
|
65
|
+
return /* @__PURE__ */ E(A.Provider, {
|
|
66
66
|
value: {
|
|
67
67
|
theme: o,
|
|
68
68
|
effects: p,
|
|
69
|
-
setPreviewTheme:
|
|
70
|
-
setPreviewEffects:
|
|
71
|
-
commitPreview:
|
|
72
|
-
clearPreview:
|
|
69
|
+
setPreviewTheme: U,
|
|
70
|
+
setPreviewEffects: K,
|
|
71
|
+
commitPreview: H,
|
|
72
|
+
clearPreview: B
|
|
73
73
|
},
|
|
74
|
-
children: [
|
|
74
|
+
children: [M, d && /* @__PURE__ */ E("div", {
|
|
75
75
|
style: {
|
|
76
76
|
position: "fixed",
|
|
77
77
|
bottom: 16,
|
|
@@ -85,11 +85,11 @@ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
|
|
|
85
85
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.3)"
|
|
86
86
|
},
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ f(
|
|
88
|
+
/* @__PURE__ */ f(F, {
|
|
89
89
|
title: "Copy theme name",
|
|
90
90
|
children: /* @__PURE__ */ f("span", {
|
|
91
91
|
onClick: () => {
|
|
92
|
-
navigator.clipboard.writeText(x),
|
|
92
|
+
navigator.clipboard.writeText(x), T(!0), window.setTimeout(() => T(!1), 1500);
|
|
93
93
|
},
|
|
94
94
|
style: { cursor: "pointer" },
|
|
95
95
|
children: x
|
|
@@ -116,7 +116,7 @@ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
|
|
|
116
116
|
},
|
|
117
117
|
children: "[ prev · ] next · Esc revert"
|
|
118
118
|
}),
|
|
119
|
-
|
|
119
|
+
D && /* @__PURE__ */ f("div", {
|
|
120
120
|
style: {
|
|
121
121
|
position: "absolute",
|
|
122
122
|
bottom: "calc(100% + 6px)",
|
|
@@ -136,5 +136,5 @@ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
|
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
export {
|
|
139
|
-
|
|
139
|
+
q as ThemeProvider
|
|
140
140
|
};
|