@arcblock/ux 3.0.8 → 3.0.10

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.
Files changed (66) hide show
  1. package/lib/Address/did-address.js +47 -49
  2. package/lib/Address/responsive-did-address.js +53 -57
  3. package/lib/Avatar/index.js +16 -16
  4. package/lib/BlockletV2/blocklet.js +64 -64
  5. package/lib/BlockletV2/components/tooltip-icon.js +26 -27
  6. package/lib/CardSelector/index.js +1 -2
  7. package/lib/ClickToCopy/hook.js +10 -11
  8. package/lib/ClickToCopy/index.js +16 -16
  9. package/lib/Config/theme-mode-toggle.js +7 -8
  10. package/lib/DID/index.js +131 -133
  11. package/lib/DIDConnect/app-info-item.js +18 -18
  12. package/lib/DIDConnect/auth-apps/index.js +83 -84
  13. package/lib/DIDConnect/did-connect-container.js +89 -90
  14. package/lib/DIDConnect/did-connect-footer.js +25 -25
  15. package/lib/DIDConnect/landing-page.js +17 -17
  16. package/lib/DIDConnect/powered-by.js +11 -11
  17. package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
  18. package/lib/DIDConnect/with-container.js +66 -68
  19. package/lib/Dialog/use-confirm.js +40 -43
  20. package/lib/Earth/index.js +21 -22
  21. package/lib/Footer/index.js +15 -16
  22. package/lib/Header/responsive-header.js +23 -24
  23. package/lib/Layout/dashboard/index.js +63 -72
  24. package/lib/Layout/dashboard/sidebar.js +20 -21
  25. package/lib/Layout/dashboard-legacy/index.js +52 -52
  26. package/lib/Locale/context.js +36 -37
  27. package/lib/Locale/selector.js +40 -42
  28. package/lib/NFTDisplay/index.js +114 -118
  29. package/lib/NFTDisplay/render-svg.js +12 -12
  30. package/lib/NavMenu/nav-menu.js +159 -161
  31. package/lib/NavMenu/sub-container.js +25 -26
  32. package/lib/PageScroller/index.js +28 -32
  33. package/lib/Passport/passport.js +11 -11
  34. package/lib/PhoneInput/country-select.js +38 -38
  35. package/lib/PhoneInput/index.js +65 -66
  36. package/lib/Screenshot/index.js +26 -27
  37. package/lib/SessionBlocklet/index.js +87 -93
  38. package/lib/SessionPermission/index.js +5 -9
  39. package/lib/SessionUser/components/did-space.js +24 -25
  40. package/lib/SessionUser/components/logged-in.js +122 -127
  41. package/lib/SessionUser/components/quick-login-item.js +41 -42
  42. package/lib/SessionUser/components/session-user-item.js +35 -36
  43. package/lib/SessionUser/components/session-user-switch.js +81 -85
  44. package/lib/SessionUser/components/un-login.js +41 -41
  45. package/lib/SessionUser/components/user-info.js +43 -47
  46. package/lib/SessionUser/index.js +1 -1
  47. package/lib/SessionUser/libs/utils.js +24 -30
  48. package/lib/SharedBridge/index.js +35 -35
  49. package/lib/Theme/index.js +16 -16
  50. package/lib/Theme/theme.js +42 -43
  51. package/lib/Toast/index.js +24 -25
  52. package/lib/Typography/index.js +42 -42
  53. package/lib/UserCard/Content/basic.js +91 -93
  54. package/lib/UserCard/Content/shorten-label.js +9 -9
  55. package/lib/UserCard/components.js +15 -15
  56. package/lib/Util/deprecate.js +1 -1
  57. package/lib/Util/federated.js +28 -32
  58. package/lib/Util/iframe.js +9 -10
  59. package/lib/Util/index.js +134 -135
  60. package/lib/Util/security.js +9 -10
  61. package/lib/Util/wallet.js +6 -9
  62. package/lib/VerificationCode/index.js +26 -28
  63. package/lib/hooks/use-blocklet-logo.js +11 -14
  64. package/lib/ux.css +1 -1
  65. package/lib/withTracker/index.js +13 -14
  66. package/package.json +9 -10
@@ -1,117 +1,115 @@
1
- import { jsx as o, jsxs as M } from "react/jsx-runtime";
2
- import { useRef as T, useLayoutEffect as ne, useEffect as j, Children as V, isValidElement as te, cloneElement as re } from "react";
3
- import { useTheme as oe, ClickAwayListener as ae } from "@mui/material";
4
- import F from "clsx";
5
- import { Menu as ie, MoreHoriz as le, ArrowForward as se, ExpandMore as ue } from "@mui/icons-material";
6
- import { useCreation as L, useReactive as ce, useMemoizedFn as A, useSize as de, useThrottleFn as me } from "ahooks";
7
- import fe from "lodash/noop";
8
- import { NavMenuProvider as ve, useNavMenuContext as B } from "./nav-menu-context.js";
9
- import { NavMenuStyled as pe, NavMenuRoot as he, NavMenuItem as Ce, NavMenuSub as Ne, NavMenuSubList as _e } from "./style.js";
10
- import { SubContainer as be } from "./sub-container.js";
1
+ import { jsx as o, jsxs as x } from "react/jsx-runtime";
2
+ import { useRef as $, useLayoutEffect as ee, useEffect as P, Children as U, isValidElement as ne, cloneElement as te } from "react";
3
+ import { useTheme as oe, ClickAwayListener as re } from "@mui/material";
4
+ import E from "clsx";
5
+ import { Menu as ie, MoreHoriz as ae, ArrowForward as le, ExpandMore as se } from "@mui/icons-material";
6
+ import { useCreation as S, useReactive as ce, useMemoizedFn as z, useSize as ue, useThrottleFn as de } from "ahooks";
7
+ import me from "lodash/noop";
8
+ import { NavMenuProvider as fe, useNavMenuContext as V } from "./nav-menu-context.js";
9
+ import { NavMenuStyled as ve, NavMenuRoot as pe, NavMenuItem as he, NavMenuSub as Ce, NavMenuSubList as Ne } from "./style.js";
10
+ import { SubContainer as Ie } from "./sub-container.js";
11
11
  import "../Theme/theme.js";
12
12
  import "../Theme/theme-provider.js";
13
- function D(n) {
14
- return n ? V.toArray(n).filter((a) => te(a) ? a.type === k || a.type === E : !1) : null;
13
+ function B(i) {
14
+ return i ? U.toArray(i).filter((r) => ne(r) ? r.type === W || r.type === L : !1) : null;
15
15
  }
16
- function G(n) {
17
- return T(n || `navmenu-item-id-${Math.random().toString(36).slice(2)}`).current;
16
+ function D(i) {
17
+ return $(i || `navmenu-item-id-${Math.random().toString(36).slice(2)}`).current;
18
18
  }
19
- function J({
20
- items: n = [],
21
- mode: a = "horizontal",
22
- children: C = null,
23
- activeId: m = null,
19
+ function G({
20
+ items: i = [],
21
+ mode: r = "horizontal",
22
+ children: p = null,
23
+ activeId: s = null,
24
24
  // eslint-disable-next-line react/require-default-props
25
- textColor: y,
25
+ textColor: _,
26
26
  // eslint-disable-next-line react/require-default-props
27
- activeTextColor: g,
27
+ activeTextColor: M,
28
28
  // eslint-disable-next-line react/require-default-props
29
- bgColor: I,
30
- onSelected: s = void 0,
31
- ...f
29
+ bgColor: b,
30
+ onSelected: u = void 0,
31
+ ...d
32
32
  }) {
33
- var O;
34
- const r = oe(), u = L(() => r.palette.text.secondary, [r]), v = L(() => r.palette.text.primary, [r]), i = L(() => r.palette.background.default, [r]), c = D(C);
35
- if (!(n != null && n.length) && !(c != null && c.length))
33
+ const t = oe(), m = S(() => t.palette.text.secondary, [t]), y = S(() => t.palette.text.primary, [t]), c = S(() => t.palette.background.default, [t]), h = B(p);
34
+ if (!i?.length && !h?.length)
36
35
  throw new Error("One of 'items' or 'children' is required by NavMenu component.");
37
- const t = ce({
38
- activeId: m,
36
+ const n = ce({
37
+ activeId: s,
39
38
  openedIds: [],
40
39
  hiddenItemCount: 0
41
- }), N = A((e) => {
42
- t.activeId = e, s == null || s(e);
43
- }), _ = A((e) => {
44
- t.openedIds.push(e);
45
- }), W = A((e) => {
46
- t.openedIds = t.openedIds.filter((l) => l !== e);
47
- }), z = L(() => ({
48
- ...t,
49
- mode: a,
50
- textColor: u,
51
- activeTextColor: v,
52
- bgColor: i,
53
- activate: N,
54
- open: _,
55
- close: W
40
+ }), C = z((e) => {
41
+ n.activeId = e, u?.(e);
42
+ }), N = z((e) => {
43
+ n.openedIds.push(e);
44
+ }), T = z((e) => {
45
+ n.openedIds = n.openedIds.filter((a) => a !== e);
46
+ }), R = S(() => ({
47
+ ...n,
48
+ mode: r,
49
+ textColor: m,
50
+ activeTextColor: y,
51
+ bgColor: c,
52
+ activate: C,
53
+ open: N,
54
+ close: T
56
55
  }), [
57
- t.activeId,
58
- t.hiddenItemCount,
59
- t.openedIds,
60
- a,
61
- u,
62
- v,
63
- i,
56
+ n.activeId,
57
+ n.hiddenItemCount,
58
+ n.openedIds,
59
+ r,
60
+ m,
61
+ y,
62
+ c,
63
+ C,
64
64
  N,
65
- _,
66
- W
67
- ]), $ = T(null), p = T([]), w = T(null), q = T(0), S = t.hiddenItemCount === ((O = p.current) == null ? void 0 : O.length), K = S ? { marginLeft: "0px" } : void 0, Q = L(() => S ? /* @__PURE__ */ o(ie, {}) : /* @__PURE__ */ o(le, {}), [S]), X = (e) => V.map(e, (l, h) => re(l, {
68
- ref: (b) => {
69
- p.current[h] = b;
65
+ T
66
+ ]), g = $(null), f = $([]), w = $(null), j = $(0), A = n.hiddenItemCount === f.current?.length, J = A ? { marginLeft: "0px" } : void 0, K = S(() => A ? /* @__PURE__ */ o(ie, {}) : /* @__PURE__ */ o(ae, {}), [A]), Q = (e) => U.map(e, (a, v) => te(a, {
67
+ ref: (I) => {
68
+ f.current[v] = I;
70
69
  }
71
- })), x = de($.current), { run: R } = me(
72
- A(() => {
73
- let e = 0, l = 0, h = !1;
74
- const b = w.current ? w.current.offsetWidth + parseFloat(window.getComputedStyle(w.current).marginLeft) : 0;
75
- p.current.forEach((d, P) => {
76
- if (d) {
77
- d.style.display = "flex";
78
- const ee = P > 0 ? parseFloat(window.getComputedStyle(d).marginLeft) : 0, U = d.offsetWidth + ee;
79
- q.current - b >= e + U && !h ? e += U : (d.style.display = "none", h = !0, l++);
70
+ })), q = ue(g.current), { run: k } = de(
71
+ z(() => {
72
+ let e = 0, a = 0, v = !1;
73
+ const I = w.current ? w.current.offsetWidth + parseFloat(window.getComputedStyle(w.current).marginLeft) : 0;
74
+ f.current.forEach((l, H) => {
75
+ if (l) {
76
+ l.style.display = "flex";
77
+ const Z = H > 0 ? parseFloat(window.getComputedStyle(l).marginLeft) : 0, O = l.offsetWidth + Z;
78
+ j.current - I >= e + O && !v ? e += O : (l.style.display = "none", v = !0, a++);
80
79
  }
81
- }), l !== t.hiddenItemCount && (t.hiddenItemCount = l);
80
+ }), a !== n.hiddenItemCount && (n.hiddenItemCount = a);
82
81
  }),
83
82
  { wait: 100 }
84
83
  );
85
- ne(() => {
86
- var e;
87
- q.current = (x == null ? void 0 : x.width) || ((e = $.current) == null ? void 0 : e.clientWidth) || 0, a === "horizontal" && R();
88
- }, [x == null ? void 0 : x.width, a]), j(() => {
89
- if (a === "horizontal")
90
- return R(), window.addEventListener("resize", R), () => {
91
- window.removeEventListener("resize", R);
84
+ ee(() => {
85
+ j.current = q?.width || g.current?.clientWidth || 0, r === "horizontal" && k();
86
+ }, [q?.width, r]), P(() => {
87
+ if (r === "horizontal")
88
+ return k(), window.addEventListener("resize", k), () => {
89
+ window.removeEventListener("resize", k);
92
90
  };
93
- }, [a, n]), j(() => {
94
- m != null && (t.activeId = m);
95
- }, [m]);
96
- const Y = F("navmenu", `navmenu--${a}`, f.className), H = (e, l, h = 0) => {
97
- const b = h === 0;
98
- return e != null && e.children ? h > 0 ? null : /* @__PURE__ */ o(
99
- E,
91
+ }, [r, i]), P(() => {
92
+ s != null && (n.activeId = s);
93
+ }, [s]);
94
+ const X = E("navmenu", `navmenu--${r}`, d.className), F = (e, a, v = 0) => {
95
+ const I = v === 0;
96
+ return e?.children ? v > 0 ? null : /* @__PURE__ */ o(
97
+ L,
100
98
  {
101
99
  id: e.id,
102
100
  icon: e.icon,
103
101
  label: e.label,
104
- variant: b ? "default" : "panel",
105
- ref: b ? (d) => {
106
- p.current[l] = d;
102
+ variant: I ? "default" : "panel",
103
+ ref: I ? (l) => {
104
+ f.current[a] = l;
107
105
  } : void 0,
108
106
  children: typeof e.children == "function" ? e.children : e.children.map(
109
- (d, P) => H({ ...d, variant: "panel" }, P, h + 1)
107
+ (l, H) => F({ ...l, variant: "panel" }, H, v + 1)
110
108
  )
111
109
  },
112
110
  e.id
113
111
  ) : /* @__PURE__ */ o(
114
- k,
112
+ W,
115
113
  {
116
114
  id: e.id,
117
115
  icon: e.icon,
@@ -119,118 +117,118 @@ function J({
119
117
  description: e.description,
120
118
  active: e.active,
121
119
  variant: e.variant,
122
- ref: b ? (d) => {
123
- p.current[l] = d;
120
+ ref: I ? (l) => {
121
+ f.current[a] = l;
124
122
  } : void 0
125
123
  },
126
124
  e.id
127
125
  );
128
- }, Z = n ? n == null ? void 0 : n.slice(-t.hiddenItemCount).map((e, l) => H(e, l, 1)) : c == null ? void 0 : c.slice(-t.hiddenItemCount);
129
- return /* @__PURE__ */ o(ve, { value: z, children: /* @__PURE__ */ o(pe, { ...f, className: Y, $textColor: u, $bgColor: i, children: /* @__PURE__ */ M(he, { className: F("navmenu-root", `navmenu-root--${a}`), ref: $, children: [
130
- n ? n.map((e, l) => H(e, l)) : X(c || []),
131
- t.hiddenItemCount > 0 && /* @__PURE__ */ o(E, { expandIcon: !1, icon: Q, label: "", ref: w, style: K, children: Z })
126
+ }, Y = i ? i?.slice(-n.hiddenItemCount).map((e, a) => F(e, a, 1)) : h?.slice(-n.hiddenItemCount);
127
+ return /* @__PURE__ */ o(fe, { value: R, children: /* @__PURE__ */ o(ve, { ...d, className: X, $textColor: m, $bgColor: c, children: /* @__PURE__ */ x(pe, { className: E("navmenu-root", `navmenu-root--${r}`), ref: g, children: [
128
+ i ? i.map((e, a) => F(e, a)) : Q(h || []),
129
+ n.hiddenItemCount > 0 && /* @__PURE__ */ o(L, { expandIcon: !1, icon: K, label: "", ref: w, style: J, children: Y })
132
130
  ] }) }) });
133
131
  }
134
- function k({
135
- ref: n = void 0,
136
- id: a = "",
137
- icon: C = null,
138
- label: m = "",
139
- description: y = void 0,
140
- active: g = !1,
141
- variant: I = "default",
142
- onClick: s = fe,
143
- ...f
132
+ function W({
133
+ ref: i = void 0,
134
+ id: r = "",
135
+ icon: p = null,
136
+ label: s = "",
137
+ description: _ = void 0,
138
+ active: M = !1,
139
+ variant: b = "default",
140
+ onClick: u = me,
141
+ ...d
144
142
  }) {
145
- const r = G(a), { mode: u, activeId: v, activate: i, activeTextColor: c } = B(), t = F(
143
+ const t = D(r), { mode: m, activeId: y, activate: c, activeTextColor: h } = V(), n = E(
146
144
  "navmenu-item",
147
- { "navmenu-item--active": v === r },
148
- `navmenu-item--${u}`,
149
- `navmenu-item--${I}`,
150
- f.className
145
+ { "navmenu-item--active": y === t },
146
+ `navmenu-item--${m}`,
147
+ `navmenu-item--${b}`,
148
+ d.className
151
149
  );
152
- return j(() => {
153
- g && (i == null || i(r));
154
- }, [g]), // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
155
- /* @__PURE__ */ M(
156
- Ce,
150
+ return P(() => {
151
+ M && c?.(t);
152
+ }, [M]), // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
153
+ /* @__PURE__ */ x(
154
+ he,
157
155
  {
158
- ...f,
159
- className: t,
160
- ref: n,
161
- $activeTextColor: c,
156
+ ...d,
157
+ className: n,
158
+ ref: i,
159
+ $activeTextColor: h,
162
160
  onClick: () => {
163
- s == null || s(), i == null || i(r);
161
+ u?.(), c?.(t);
164
162
  },
165
163
  children: [
166
- C && /* @__PURE__ */ o("span", { className: "navmenu-item__icon", children: C }),
167
- /* @__PURE__ */ M("div", { className: "navmenu-item__content", children: [
168
- /* @__PURE__ */ M("span", { className: "navmenu-item__label", children: [
169
- m,
164
+ p && /* @__PURE__ */ o("span", { className: "navmenu-item__icon", children: p }),
165
+ /* @__PURE__ */ x("div", { className: "navmenu-item__content", children: [
166
+ /* @__PURE__ */ x("span", { className: "navmenu-item__label", children: [
167
+ s,
170
168
  " ",
171
- /* @__PURE__ */ o(se, { className: "navmenu-item__label-arrow" })
169
+ /* @__PURE__ */ o(le, { className: "navmenu-item__label-arrow" })
172
170
  ] }),
173
- y && /* @__PURE__ */ o("span", { className: "navmenu-item__desc", children: y })
171
+ _ && /* @__PURE__ */ o("span", { className: "navmenu-item__desc", children: _ })
174
172
  ] })
175
173
  ]
176
174
  }
177
175
  );
178
176
  }
179
- k.displayName = "NavMenu.Item";
180
- function E({
181
- ref: n = void 0,
182
- id: a = "",
183
- icon: C = null,
184
- label: m = null,
185
- description: y,
186
- variant: g = "default",
187
- children: I = void 0,
188
- expandIcon: s = ({ isOpen: r }) => /* @__PURE__ */ o(
189
- ue,
177
+ W.displayName = "NavMenu.Item";
178
+ function L({
179
+ ref: i = void 0,
180
+ id: r = "",
181
+ icon: p = null,
182
+ label: s = null,
183
+ description: _,
184
+ variant: M = "default",
185
+ children: b = void 0,
186
+ expandIcon: u = ({ isOpen: t }) => /* @__PURE__ */ o(
187
+ se,
190
188
  {
191
189
  style: {
192
- transform: `rotate(${r ? 180 : 0}deg)`
190
+ transform: `rotate(${t ? 180 : 0}deg)`
193
191
  }
194
192
  }
195
193
  ),
196
- ...f
194
+ ...d
197
195
  }) {
198
- const r = G(a), { openedIds: u, open: v, close: i, mode: c, activeTextColor: t } = B(), N = (u == null ? void 0 : u.includes(r)) ?? !1, _ = c === "inline", W = F(
196
+ const t = D(r), { openedIds: m, open: y, close: c, mode: h, activeTextColor: n } = V(), C = m?.includes(t) ?? !1, N = h === "inline", T = E(
199
197
  "navmenu-sub",
200
198
  "navmenu-item",
201
- { "navmenu-item--panel": g === "panel" },
202
- { "navmenu-sub--opened": N, "navmenu-item--inline": _ },
203
- f.className
204
- ), z = {
199
+ { "navmenu-item--panel": M === "panel" },
200
+ { "navmenu-sub--opened": C, "navmenu-item--inline": N },
201
+ d.className
202
+ ), R = {
205
203
  onClick: () => {
206
- u != null && u.includes(r) ? i == null || i(r) : v == null || v(r);
204
+ m?.includes(t) ? c?.(t) : y?.(t);
207
205
  }
208
- }, $ = _ ? { onClick: (w) => w.stopPropagation() } : {}, p = /* @__PURE__ */ M(
209
- Ne,
206
+ }, g = N ? { onClick: (w) => w.stopPropagation() } : {}, f = /* @__PURE__ */ x(
207
+ Ce,
210
208
  {
211
- ...f,
212
- className: W,
213
- ...z,
214
- ref: n,
215
- $activeTextColor: t,
209
+ ...d,
210
+ className: T,
211
+ ...R,
212
+ ref: i,
213
+ $activeTextColor: n,
216
214
  children: [
217
- C && /* @__PURE__ */ o("span", { className: "navmenu-item__icon", children: C }),
218
- /* @__PURE__ */ M("div", { className: "navmenu-item__content", children: [
219
- /* @__PURE__ */ o("span", { className: "navmenu-item__label", children: m }),
220
- y && /* @__PURE__ */ o("span", { className: "navmenu-item__desc", children: y })
215
+ p && /* @__PURE__ */ o("span", { className: "navmenu-item__icon", children: p }),
216
+ /* @__PURE__ */ x("div", { className: "navmenu-item__content", children: [
217
+ /* @__PURE__ */ o("span", { className: "navmenu-item__label", children: s }),
218
+ _ && /* @__PURE__ */ o("span", { className: "navmenu-item__desc", children: _ })
221
219
  ] }),
222
- s && /* @__PURE__ */ o("span", { className: "navmenu-sub__expand-icon", children: typeof s == "function" ? s({ isOpen: N }) : s }),
223
- /* @__PURE__ */ o(be, { inline: _, ...$, children: typeof I == "function" ? I({ isOpen: N }) : /* @__PURE__ */ o(_e, { className: "navmenu-sub__list", children: D(I) }) })
220
+ u && /* @__PURE__ */ o("span", { className: "navmenu-sub__expand-icon", children: typeof u == "function" ? u({ isOpen: C }) : u }),
221
+ /* @__PURE__ */ o(Ie, { inline: N, ...g, children: typeof b == "function" ? b({ isOpen: C }) : /* @__PURE__ */ o(Ne, { className: "navmenu-sub__list", children: B(b) }) })
224
222
  ]
225
223
  }
226
224
  );
227
- return _ ? p : /* @__PURE__ */ o(ae, { onClickAway: () => i == null ? void 0 : i(r), children: p });
225
+ return N ? f : /* @__PURE__ */ o(re, { onClickAway: () => c?.(t), children: f });
228
226
  }
229
- E.displayName = "NavMenu.Sub";
230
- J.Item = k;
231
- J.Sub = E;
227
+ L.displayName = "NavMenu.Sub";
228
+ G.Item = W;
229
+ G.Sub = L;
232
230
  export {
233
- k as Item,
234
- E as Sub,
235
- J as default
231
+ W as Item,
232
+ L as Sub,
233
+ G as default
236
234
  };
@@ -1,21 +1,21 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
2
  import { useThrottleFn as x } from "ahooks";
3
- import { useRef as b, useState as m, useEffect as a } from "react";
3
+ import { useRef as b, useState as v, useEffect as a } from "react";
4
4
  const z = 8;
5
- function L({ children: v, inline: s = !1, ...R }) {
6
- const o = b(null), c = b(null), [d, l] = m(!1), [g, f] = m(0), { run: u } = x(
5
+ function C({ children: m, inline: i = !1, ...R }) {
6
+ const n = b(null), s = b(null), [c, l] = v(!1), [g, f] = v(0), { run: d } = x(
7
7
  () => {
8
- if (s) {
9
- f(0), d || l(!0);
8
+ if (i) {
9
+ f(0), c || l(!0);
10
10
  return;
11
11
  }
12
- if (!o.current || !c.current) return;
13
- const e = o.current.parentElement;
12
+ if (!n.current || !s.current) return;
13
+ const e = n.current.parentElement;
14
14
  if (!e) return;
15
- const t = e.getBoundingClientRect(), n = c.current.getBoundingClientRect(), p = window.innerWidth, w = 32;
16
- let r = (t.width - n.width) / 2;
17
- const i = t.left + r;
18
- i < 0 ? r = r - i + w : i + n.width > p && (r -= i + n.width - p + w), f(r), d || l(!0);
15
+ const t = e.getBoundingClientRect(), u = s.current.getBoundingClientRect(), p = window.innerWidth, w = 32;
16
+ let r = (t.width - u.width) / 2;
17
+ const o = t.left + r;
18
+ o < 0 ? r = r - o + w : o + u.width > p && (r -= o + u.width - p + w), f(r), c || l(!0);
19
19
  },
20
20
  {
21
21
  wait: 100
@@ -23,48 +23,47 @@ function L({ children: v, inline: s = !1, ...R }) {
23
23
  );
24
24
  return a(() => {
25
25
  const e = new ResizeObserver(() => {
26
- u();
26
+ d();
27
27
  });
28
- return e.observe(o.current), () => e.disconnect();
28
+ return e.observe(n.current), () => e.disconnect();
29
29
  }, []), a(() => {
30
- var n;
31
- const e = (n = o.current) == null ? void 0 : n.parentElement;
30
+ const e = n.current?.parentElement;
32
31
  let t = null;
33
32
  return e && (t = new ResizeObserver(() => {
34
- u();
35
- }), t.observe(e)), () => t == null ? void 0 : t.disconnect();
33
+ d();
34
+ }), t.observe(e)), () => t?.disconnect();
36
35
  }, []), a(() => {
37
36
  const e = () => {
38
- u();
37
+ d();
39
38
  };
40
39
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
41
40
  }, []), /* @__PURE__ */ h(
42
41
  "div",
43
42
  {
44
- ref: o,
43
+ ref: n,
45
44
  className: "navmenu-sub__container",
46
45
  style: {
47
46
  width: "100%",
48
47
  paddingTop: `${z}px`,
49
48
  transform: `translateX(${g}px)`,
50
- overflow: d ? "visible" : "hidden"
49
+ overflow: c ? "visible" : "hidden"
51
50
  },
52
51
  ...R,
53
52
  children: /* @__PURE__ */ h(
54
53
  "div",
55
54
  {
56
55
  style: {
57
- display: s ? "block" : "inline-block",
58
- boxShadow: s ? "none" : "0px 40px 60px rgba(0, 0, 0, 0.08)"
56
+ display: i ? "block" : "inline-block",
57
+ boxShadow: i ? "none" : "0px 40px 60px rgba(0, 0, 0, 0.08)"
59
58
  },
60
- ref: c,
61
- children: v
59
+ ref: s,
60
+ children: m
62
61
  }
63
62
  )
64
63
  }
65
64
  );
66
65
  }
67
66
  export {
68
- L as SubContainer,
69
- L as default
67
+ C as SubContainer,
68
+ C as default
70
69
  };
@@ -1,37 +1,37 @@
1
1
  import { jsx as W } from "react/jsx-runtime";
2
- import { useState as U, useRef as Q, Children as K, useCallback as l, cloneElement as Z, useEffect as p } from "react";
2
+ import { useState as S, useRef as J, Children as U, useCallback as l, cloneElement as Q, useEffect as p } from "react";
3
3
  import A from "lodash/isEqual";
4
4
  import r from "lodash/isNil";
5
- import g from "lodash/isNull";
6
- import P from "./usePrevValue.js";
7
- import { withDeprecated as b } from "../Util/deprecate.js";
5
+ import Z from "lodash/isNull";
6
+ import g from "./usePrevValue.js";
7
+ import { withDeprecated as P } from "../Util/deprecate.js";
8
8
  const I = {
9
9
  TOUCHMOVE: "touchmove",
10
10
  KEYDOWN: "keydown"
11
- }, ee = 500, te = "ease-in-out", ne = "100vh", se = "100vw", k = 0, B = 0, D = 100, oe = 38, re = 40, y = "rps-scroll--disabled";
11
+ }, b = 500, ee = "ease-in-out", te = "100vh", ne = "100vw", K = 0, k = 0, D = 100, se = 38, oe = 40, y = "rps-scroll--disabled";
12
12
  let M = null, d = !1, a = !1, w = !0, Y = !1;
13
13
  const T = [];
14
- function ie({
15
- animationTimer: f = ee,
14
+ function re({
15
+ animationTimer: f = b,
16
16
  blockScrollDown: F = !1,
17
17
  blockScrollUp: H = !1,
18
- children: V = void 0,
19
- height: G = ne,
20
- width: j = se,
18
+ children: B = void 0,
19
+ height: V = te,
20
+ width: G = ne,
21
21
  customPageNumber: s = void 0,
22
22
  onScrollUnavailable: E = void 0,
23
23
  onChange: R = void 0,
24
24
  renderAllPagesOnFirstRender: $ = !1,
25
- transitionTimingFunction: q = te
25
+ transitionTimingFunction: j = ee
26
26
  }) {
27
- const [n, v] = U(k), [c, C] = U(B), m = P(n), i = Q(null), o = K.toArray(V), L = l(
27
+ const [n, v] = S(K), [c, C] = S(k), m = g(n), i = J(null), o = U.toArray(B), L = l(
28
28
  (e) => {
29
29
  let t = 0;
30
30
  r(e) || (t = e), t = Math.max(t, c), t <= n + 1 && (r(o[n + 1]) || t++), C(t);
31
31
  },
32
32
  [o, n, c]
33
- ), X = l(() => {
34
- $ ? C(K.count(o)) : r(o[k + 1]) || L(B + 1);
33
+ ), q = l(() => {
34
+ $ ? C(U.count(o)) : r(o[K + 1]) || L(k + 1);
35
35
  }, [L, o, $]), O = l(() => {
36
36
  w && (w = !1, window.scrollTo({
37
37
  left: 0,
@@ -40,12 +40,12 @@ function ie({
40
40
  }), document.body.classList.add(y), document.documentElement.classList.add(y));
41
41
  }, []), _ = l(() => {
42
42
  w || (w = !0, document.body.classList.remove(y), document.documentElement.classList.remove(y));
43
- }, []), z = l(() => {
43
+ }, []), X = l(() => {
44
44
  const e = [];
45
45
  let t = 0;
46
46
  for (; t < c && !r(o[t]); )
47
47
  T[t] = !0, e.push(
48
- /* @__PURE__ */ W("div", { style: { height: "100%", width: "100%" }, children: Z(o[t], { ...o[t].props }) }, t)
48
+ /* @__PURE__ */ W("div", { style: { height: "100%", width: "100%" }, children: Q(o[t], { ...o[t].props }) }, t)
49
49
  ), t++;
50
50
  return e;
51
51
  }, [o, c]), h = l(() => {
@@ -58,27 +58,23 @@ function ie({
58
58
  }, f + D)));
59
59
  }, [f, H, n, O, _, E]), N = l(
60
60
  (e) => {
61
- g(M) ? M = e.touches[0].clientY : e.touches[0].clientY > M ? u() : h();
61
+ Z(M) ? M = e.touches[0].clientY : e.touches[0].clientY > M ? u() : h();
62
62
  },
63
63
  [h, u]
64
- ), J = l(
64
+ ), z = l(
65
65
  (e) => {
66
66
  e.deltaY < 0 ? u() : h();
67
67
  },
68
68
  [h, u]
69
69
  ), x = l(
70
70
  (e) => {
71
- A(e.keyCode, oe) && u(), A(e.keyCode, re) && h();
71
+ A(e.keyCode, se) && u(), A(e.keyCode, oe) && h();
72
72
  },
73
73
  [h, u]
74
74
  );
75
- return p(() => {
76
- var e, t;
77
- return (e = i.current) == null || e.addEventListener(I.TOUCHMOVE, N), (t = i.current) == null || t.addEventListener(I.KEYDOWN, x), () => {
78
- var S;
79
- (S = i.current) != null && S.removeEventListener && (i.current.removeEventListener(I.TOUCHMOVE, N), i.current.removeEventListener(I.KEYDOWN, x));
80
- };
81
- }, [N, x]), p(() => (a = !0, X(), () => {
75
+ return p(() => (i.current?.addEventListener(I.TOUCHMOVE, N), i.current?.addEventListener(I.KEYDOWN, x), () => {
76
+ i.current?.removeEventListener && (i.current.removeEventListener(I.TOUCHMOVE, N), i.current.removeEventListener(I.KEYDOWN, x));
77
+ }), [N, x]), p(() => (a = !0, q(), () => {
82
78
  a = !1;
83
79
  }), []), p(() => {
84
80
  d = !1, M = null, m !== void 0 && n > m && L();
@@ -103,23 +99,23 @@ function ie({
103
99
  Y && (Y = !1, i.current.style.transform = `translate3d(0, ${s * -100}%, 0)`, setTimeout(() => {
104
100
  v(s);
105
101
  }, f + D));
106
- }, [f, c, s]), /* @__PURE__ */ W("div", { style: { height: G, width: j, overflow: "hidden" }, children: /* @__PURE__ */ W(
102
+ }, [f, c, s]), /* @__PURE__ */ W("div", { style: { height: V, width: G, overflow: "hidden" }, children: /* @__PURE__ */ W(
107
103
  "div",
108
104
  {
109
105
  ref: i,
110
- onWheel: J,
106
+ onWheel: z,
111
107
  style: {
112
108
  height: "100%",
113
109
  width: "100%",
114
- transition: `transform ${f}ms ${q}`,
110
+ transition: `transform ${f}ms ${j}`,
115
111
  outline: "none"
116
112
  },
117
113
  tabIndex: 0,
118
- children: z()
114
+ children: X()
119
115
  }
120
116
  ) });
121
117
  }
122
- const pe = b(ie, { name: "PageScroller" });
118
+ const ue = P(re, { name: "PageScroller" });
123
119
  export {
124
- pe as default
120
+ ue as default
125
121
  };