@arcblock/ux 3.0.9 → 3.0.11
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/lib/Address/did-address.js +47 -49
- package/lib/Address/responsive-did-address.js +53 -57
- package/lib/Avatar/index.js +16 -16
- package/lib/BlockletV2/blocklet.js +64 -64
- package/lib/BlockletV2/components/tooltip-icon.js +26 -27
- package/lib/CardSelector/index.js +1 -2
- package/lib/ClickToCopy/hook.js +10 -11
- package/lib/ClickToCopy/index.js +16 -16
- package/lib/Config/theme-mode-toggle.js +7 -8
- package/lib/DID/index.js +131 -133
- package/lib/DIDConnect/app-info-item.js +18 -18
- package/lib/DIDConnect/auth-apps/index.js +83 -84
- package/lib/DIDConnect/did-connect-container.js +89 -90
- package/lib/DIDConnect/did-connect-footer.js +25 -25
- package/lib/DIDConnect/landing-page.js +17 -17
- package/lib/DIDConnect/powered-by.js +11 -11
- package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
- package/lib/DIDConnect/with-container.js +66 -68
- package/lib/Dialog/use-confirm.js +40 -43
- package/lib/Earth/index.js +21 -22
- package/lib/Footer/index.js +15 -16
- package/lib/Header/responsive-header.js +23 -24
- package/lib/Layout/dashboard/index.js +63 -72
- package/lib/Layout/dashboard/sidebar.js +20 -21
- package/lib/Layout/dashboard-legacy/index.js +52 -52
- package/lib/Locale/context.js +36 -37
- package/lib/Locale/selector.js +40 -42
- package/lib/NFTDisplay/index.js +114 -118
- package/lib/NFTDisplay/render-svg.js +12 -12
- package/lib/NavMenu/nav-menu.js +159 -161
- package/lib/NavMenu/sub-container.js +25 -26
- package/lib/PageScroller/index.js +28 -32
- package/lib/Passport/passport.js +11 -11
- package/lib/PhoneInput/country-select.js +38 -38
- package/lib/PhoneInput/index.js +65 -66
- package/lib/Screenshot/index.js +26 -27
- package/lib/SessionBlocklet/index.js +87 -93
- package/lib/SessionPermission/index.js +5 -9
- package/lib/SessionUser/components/did-space.js +24 -25
- package/lib/SessionUser/components/logged-in.js +122 -127
- package/lib/SessionUser/components/quick-login-item.js +41 -42
- package/lib/SessionUser/components/session-user-item.js +35 -36
- package/lib/SessionUser/components/session-user-switch.js +81 -85
- package/lib/SessionUser/components/un-login.js +41 -41
- package/lib/SessionUser/components/user-info.js +43 -47
- package/lib/SessionUser/index.js +1 -1
- package/lib/SessionUser/libs/utils.js +24 -30
- package/lib/SharedBridge/index.js +35 -35
- package/lib/Theme/index.js +16 -16
- package/lib/Theme/theme.js +42 -43
- package/lib/Toast/index.js +24 -25
- package/lib/Typography/index.js +42 -42
- package/lib/UserCard/Content/basic.js +91 -93
- package/lib/UserCard/Content/shorten-label.js +9 -9
- package/lib/UserCard/components.js +15 -15
- package/lib/Util/deprecate.js +1 -1
- package/lib/Util/federated.js +28 -32
- package/lib/Util/iframe.js +9 -10
- package/lib/Util/index.js +134 -135
- package/lib/Util/security.js +9 -10
- package/lib/Util/wallet.js +6 -9
- package/lib/VerificationCode/index.js +26 -28
- package/lib/hooks/use-blocklet-logo.js +11 -14
- package/lib/ux.css +1 -1
- package/lib/withTracker/index.js +13 -14
- package/package.json +10 -11
@@ -1,18 +1,18 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
3
|
-
import { Backdrop as
|
4
|
-
import { useDebounce as
|
5
|
-
import { useBrowser as
|
6
|
-
import
|
1
|
+
import { jsx as e, jsxs as N } from "react/jsx-runtime";
|
2
|
+
import { memo as F, createElement as E, useState as H, useRef as I } from "react";
|
3
|
+
import { Backdrop as K, useMediaQuery as Q, useTheme as U, Box as c, Drawer as V, SwipeableDrawer as q, Dialog as J, DialogContent as X } from "@mui/material";
|
4
|
+
import { useDebounce as Y, useMemoizedFn as v } from "ahooks";
|
5
|
+
import { useBrowser as Z } from "@arcblock/react-hooks";
|
6
|
+
import oo from "color-convert";
|
7
7
|
import "../Theme/theme.js";
|
8
8
|
import "../Theme/theme-provider.js";
|
9
|
-
import { mergeSx as
|
9
|
+
import { mergeSx as eo } from "../Util/style.js";
|
10
10
|
import { hexToRgba as d } from "../Util/index.js";
|
11
|
-
const
|
12
|
-
|
11
|
+
const P = F(({ ref: i, ...m }) => /* @__PURE__ */ E(
|
12
|
+
K,
|
13
13
|
{
|
14
14
|
open: !0,
|
15
|
-
ref:
|
15
|
+
ref: i,
|
16
16
|
style: {
|
17
17
|
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
18
18
|
backdropFilter: "blur(3px)",
|
@@ -22,34 +22,33 @@ const L = H(({ ref: l, ...m }) => /* @__PURE__ */ I(
|
|
22
22
|
key: "background"
|
23
23
|
}
|
24
24
|
));
|
25
|
-
function
|
25
|
+
function xo(i) {
|
26
26
|
function m({
|
27
|
-
popup:
|
28
|
-
open:
|
27
|
+
popup: y = !1,
|
28
|
+
open: D = !1,
|
29
29
|
hideCloseButton: h = !1,
|
30
|
-
...
|
30
|
+
...s
|
31
31
|
}) {
|
32
|
-
|
33
|
-
const [a, x] = K("#fff"), w = Q(null), z = eo(), M = V("(max-width:640px)");
|
32
|
+
const [t, x] = H("#fff"), b = I(null), L = Z(), B = Q("(max-width:640px)");
|
34
33
|
let r = "page";
|
35
|
-
|
36
|
-
const
|
37
|
-
wait:
|
38
|
-
}),
|
34
|
+
y && (r = "dialog", B && L.mobile.any && (r = "drawer"));
|
35
|
+
const _ = U(), p = D, z = _?.transitions?.duration?.leavingScreen || 500, M = Y(p, {
|
36
|
+
wait: z
|
37
|
+
}), w = v(() => {
|
39
38
|
const o = new URLSearchParams(window.location.search);
|
40
39
|
o.get("magicToken") && o.delete("magicToken"), o.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${o.toString()}`);
|
41
|
-
}),
|
42
|
-
["backdropClick", "escapeKeyDown"].includes(
|
43
|
-
},
|
44
|
-
let
|
45
|
-
(
|
46
|
-
const
|
47
|
-
let
|
48
|
-
return
|
49
|
-
}).join(", ")})`,
|
50
|
-
let
|
51
|
-
return
|
52
|
-
}).join(", ")})`,
|
40
|
+
}), k = (o, n) => {
|
41
|
+
["backdropClick", "escapeKeyDown"].includes(n) || (w(), s?.onClose());
|
42
|
+
}, C = M || p, T = h ? V : q, A = oo.hex.hsl(t), [$, R, a] = A, u = [0, 30, 60, 30, 0, 30, 60, 30], j = Math.max(...u), O = Math.min(...u);
|
43
|
+
let g = !1;
|
44
|
+
(a * (100 + j) / 100 > 100 || a * (100 + O) / 100 < 0) && (g = !0);
|
45
|
+
const W = `linear-gradient(45deg, ${u.map((o) => {
|
46
|
+
let n = a * (100 + o) / 100, l = 0.6;
|
47
|
+
return g ? l = 0.5 * (100 + o) / 100 : n = a * (100 + o) / 100, `hsla(${$}, ${R}%, ${n}%, ${l})`;
|
48
|
+
}).join(", ")})`, G = `linear-gradient(45deg, ${u.map((o) => {
|
49
|
+
let n = a * (100 + o) / 100, l = 0.2;
|
50
|
+
return g ? l = 0.3 * (100 + o) / 100 : n = a * (100 + o) / 100, `hsla(${$}, ${R}%, ${n}%, ${l})`;
|
51
|
+
}).join(", ")})`, S = {
|
53
52
|
overflow: "visible",
|
54
53
|
"&::before, &::after": {
|
55
54
|
content: '""',
|
@@ -58,7 +57,7 @@ function fo(l) {
|
|
58
57
|
right: "-3px",
|
59
58
|
bottom: "-3px",
|
60
59
|
left: "-3px",
|
61
|
-
background:
|
60
|
+
background: W,
|
62
61
|
backgroundSize: "300% 300%",
|
63
62
|
backgroundRepeat: "no-repeat",
|
64
63
|
animation: "glowRotate 10s linear infinite",
|
@@ -66,7 +65,7 @@ function fo(l) {
|
|
66
65
|
zIndex: 0
|
67
66
|
},
|
68
67
|
"&::after": {
|
69
|
-
background:
|
68
|
+
background: G,
|
70
69
|
filter: "blur(15px)"
|
71
70
|
},
|
72
71
|
"@keyframes glowRotate": {
|
@@ -80,45 +79,44 @@ function fo(l) {
|
|
80
79
|
backgroundPosition: "0 0"
|
81
80
|
}
|
82
81
|
}
|
83
|
-
},
|
84
|
-
|
85
|
-
k(), (o = e == null ? void 0 : e.onClose) == null || o.call(e);
|
82
|
+
}, f = v(() => {
|
83
|
+
w(), s?.onClose?.();
|
86
84
|
});
|
87
|
-
return r === "page" ? /* @__PURE__ */
|
85
|
+
return r === "page" ? /* @__PURE__ */ e(
|
88
86
|
c,
|
89
87
|
{
|
90
88
|
className: "did-connect__container-page",
|
91
|
-
sx:
|
89
|
+
sx: eo(S, {
|
92
90
|
borderRadius: 1,
|
93
91
|
position: "relative",
|
94
92
|
zIndex: 1
|
95
93
|
}),
|
96
|
-
children: /* @__PURE__ */
|
94
|
+
children: /* @__PURE__ */ e(
|
97
95
|
c,
|
98
96
|
{
|
99
97
|
sx: {
|
100
|
-
border: `1px solid ${d(
|
98
|
+
border: `1px solid ${d(t, 0.1)}`,
|
101
99
|
m: "-1px",
|
102
100
|
position: "relative",
|
103
101
|
borderRadius: "12px",
|
104
102
|
zIndex: 2,
|
105
103
|
overflow: "hidden"
|
106
104
|
},
|
107
|
-
children: /* @__PURE__ */
|
105
|
+
children: /* @__PURE__ */ e(i, { ...s, onClose: f, setColor: x, hideCloseButton: !0, mode: r })
|
108
106
|
}
|
109
107
|
)
|
110
108
|
}
|
111
|
-
) : r === "drawer" ? /* @__PURE__ */
|
112
|
-
|
109
|
+
) : r === "drawer" ? /* @__PURE__ */ N(
|
110
|
+
T,
|
113
111
|
{
|
114
112
|
className: "did-connect__container-drawer",
|
115
113
|
disableSwipeToOpen: !0,
|
116
114
|
open: p,
|
117
115
|
anchor: "bottom",
|
118
|
-
drawerDragger:
|
119
|
-
onClose:
|
116
|
+
drawerDragger: b.current,
|
117
|
+
onClose: k,
|
120
118
|
slots: {
|
121
|
-
backdrop:
|
119
|
+
backdrop: P
|
122
120
|
},
|
123
121
|
PaperProps: {
|
124
122
|
sx: {
|
@@ -135,22 +133,22 @@ function fo(l) {
|
|
135
133
|
"@keyframes glowBreathe": {
|
136
134
|
"0%, 100%": {
|
137
135
|
boxShadow: `
|
138
|
-
inset 0 0 7px ${d(
|
139
|
-
inset 0 0 12px ${d(
|
136
|
+
inset 0 0 7px ${d(t, 0.3)},
|
137
|
+
inset 0 0 12px ${d(t, 0.3)}`
|
140
138
|
},
|
141
139
|
"50%": {
|
142
140
|
boxShadow: `
|
143
|
-
inset 0 0 18px ${d(
|
144
|
-
inset 0 0 24px ${d(
|
141
|
+
inset 0 0 18px ${d(t, 0.7)},
|
142
|
+
inset 0 0 24px ${d(t, 0.5)}`
|
145
143
|
}
|
146
144
|
}
|
147
145
|
}
|
148
146
|
},
|
149
147
|
children: [
|
150
|
-
h ? null : /* @__PURE__ */
|
148
|
+
h ? null : /* @__PURE__ */ e(
|
151
149
|
c,
|
152
150
|
{
|
153
|
-
ref:
|
151
|
+
ref: b,
|
154
152
|
sx: {
|
155
153
|
px: 1,
|
156
154
|
pt: 2,
|
@@ -159,7 +157,7 @@ function fo(l) {
|
|
159
157
|
mb: -2,
|
160
158
|
zIndex: 2
|
161
159
|
},
|
162
|
-
children: /* @__PURE__ */
|
160
|
+
children: /* @__PURE__ */ e(
|
163
161
|
c,
|
164
162
|
{
|
165
163
|
sx: {
|
@@ -172,7 +170,7 @@ function fo(l) {
|
|
172
170
|
)
|
173
171
|
}
|
174
172
|
),
|
175
|
-
/* @__PURE__ */
|
173
|
+
/* @__PURE__ */ e(
|
176
174
|
c,
|
177
175
|
{
|
178
176
|
sx: {
|
@@ -181,20 +179,20 @@ function fo(l) {
|
|
181
179
|
width: 500,
|
182
180
|
height: "auto"
|
183
181
|
},
|
184
|
-
children:
|
182
|
+
children: C ? /* @__PURE__ */ e(i, { ...s, onClose: f, setColor: x, hideCloseButton: !0, mode: r }) : null
|
185
183
|
}
|
186
184
|
)
|
187
185
|
]
|
188
186
|
}
|
189
|
-
) : /* @__PURE__ */
|
190
|
-
|
187
|
+
) : /* @__PURE__ */ e(
|
188
|
+
J,
|
191
189
|
{
|
192
190
|
open: p,
|
193
191
|
slots: {
|
194
|
-
backdrop:
|
192
|
+
backdrop: P
|
195
193
|
},
|
196
194
|
className: "did-connect__container-dialog",
|
197
|
-
onClose:
|
195
|
+
onClose: k,
|
198
196
|
PaperProps: {
|
199
197
|
sx: {
|
200
198
|
// 避免样式被 server 中的定义覆盖
|
@@ -202,11 +200,11 @@ function fo(l) {
|
|
202
200
|
borderRadius: "12px !important"
|
203
201
|
},
|
204
202
|
position: "relative",
|
205
|
-
...
|
203
|
+
...S
|
206
204
|
}
|
207
205
|
},
|
208
|
-
children: /* @__PURE__ */
|
209
|
-
|
206
|
+
children: /* @__PURE__ */ e(
|
207
|
+
X,
|
210
208
|
{
|
211
209
|
sx: {
|
212
210
|
maxWidth: "calc(100vw - 18px)",
|
@@ -217,11 +215,11 @@ function fo(l) {
|
|
217
215
|
borderRadius: "12px !important",
|
218
216
|
zIndex: 1
|
219
217
|
},
|
220
|
-
children:
|
221
|
-
|
218
|
+
children: C ? /* @__PURE__ */ e(
|
219
|
+
i,
|
222
220
|
{
|
223
|
-
...
|
224
|
-
onClose:
|
221
|
+
...s,
|
222
|
+
onClose: f,
|
225
223
|
setColor: x,
|
226
224
|
hideCloseButton: h,
|
227
225
|
mode: r
|
@@ -235,5 +233,5 @@ function fo(l) {
|
|
235
233
|
return m;
|
236
234
|
}
|
237
235
|
export {
|
238
|
-
|
236
|
+
xo as default
|
239
237
|
};
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
2
|
-
import { useRef as g, useState as w, isValidElement as
|
3
|
-
import { useMemoizedFn as
|
4
|
-
import
|
2
|
+
import { useRef as g, useState as w, isValidElement as r, useImperativeHandle as y } from "react";
|
3
|
+
import { useMemoizedFn as n, useReactive as v } from "ahooks";
|
4
|
+
import l from "lodash/noop";
|
5
5
|
import H from "./confirm.js";
|
6
|
-
function R({ ref:
|
7
|
-
const [
|
6
|
+
function R({ ref: f, ...i }) {
|
7
|
+
const [s, e] = w(""), [B, c] = w(""), t = v({
|
8
8
|
show: !1,
|
9
9
|
title: "",
|
10
10
|
content: "",
|
11
|
-
onConfirm:
|
12
|
-
onCancel:
|
11
|
+
onConfirm: l,
|
12
|
+
onCancel: l,
|
13
13
|
// 其他属性
|
14
14
|
loading: !1,
|
15
15
|
showCancelButton: !0,
|
@@ -19,39 +19,39 @@ function R({ ref: s, ...l }) {
|
|
19
19
|
confirmButtonProps: {},
|
20
20
|
cancelButtonText: "Cancel",
|
21
21
|
cancelButtonProps: {}
|
22
|
-
}),
|
23
|
-
|
24
|
-
}), x =
|
25
|
-
|
26
|
-
}),
|
22
|
+
}), m = n((o = {}) => {
|
23
|
+
r(o.title) ? (e(o.title), t.title = "") : (e(""), t.title = o.title), r(o.content) ? (c(o.content), t.content = "") : (c(""), t.content = o.content), t.onConfirm = o.onConfirm || l, t.onCancel = o.onCancel || l, t.showCloseButton = o.showCloseButton ?? !0, t.showCancelButton = o.showCancelButton ?? !0, t.showConfirmButton = o.showConfirmButton ?? !0, o.confirmButtonText && (t.confirmButtonText = o.confirmButtonText), o.confirmButtonProps && (t.confirmButtonProps = o.confirmButtonProps), o.cancelButtonText && (t.cancelButtonText = o.cancelButtonText), o.cancelButtonProps && (t.cancelButtonProps = o.cancelButtonProps), t.loading = !1, t.show = !0;
|
24
|
+
}), x = n(() => {
|
25
|
+
e(""), c(""), t.title = "", t.content = "", t.onConfirm = l, t.onCancel = l, t.confirmButtonText = "Confirm", t.confirmButtonProps = {}, t.cancelButtonText = "Cancel", t.cancelButtonProps = {}, t.showConfirmButton = !0, t.showCancelButton = !0, t.showCloseButton = !0;
|
26
|
+
}), u = n(() => {
|
27
27
|
t.show = !1, setTimeout(() => {
|
28
28
|
x();
|
29
29
|
}, 300);
|
30
|
-
}), h =
|
31
|
-
o.title && (
|
32
|
-
}), T =
|
33
|
-
|
34
|
-
}, []),
|
30
|
+
}), h = n((o) => {
|
31
|
+
o.title && (r(o.title) ? (e(o.title), t.title = "") : (e(""), t.title = o.title)), o.content && (r(o.content) ? (c(o.content), t.content = "") : (c(""), t.content = o.content));
|
32
|
+
}), T = n((o, p) => {
|
33
|
+
u(), t?.onCancel(o, p);
|
34
|
+
}, []), a = n(async (o) => {
|
35
35
|
t.loading = !0;
|
36
36
|
try {
|
37
|
-
await
|
37
|
+
await t?.onConfirm(u, o);
|
38
38
|
} finally {
|
39
39
|
t.loading = !1;
|
40
40
|
}
|
41
41
|
}, []);
|
42
|
-
y(
|
43
|
-
open:
|
44
|
-
close:
|
42
|
+
y(f, () => ({
|
43
|
+
open: m,
|
44
|
+
close: u,
|
45
45
|
update: h
|
46
|
-
}), [
|
47
|
-
const
|
46
|
+
}), [m, u, h]);
|
47
|
+
const P = s || t.title, C = B || t.content;
|
48
48
|
return /* @__PURE__ */ d(
|
49
49
|
H,
|
50
50
|
{
|
51
|
-
...
|
51
|
+
...i,
|
52
52
|
open: t.show,
|
53
|
-
title:
|
54
|
-
onConfirm:
|
53
|
+
title: P,
|
54
|
+
onConfirm: a,
|
55
55
|
onCancel: T,
|
56
56
|
confirmButton: {
|
57
57
|
text: t.confirmButtonText,
|
@@ -73,28 +73,25 @@ function R({ ref: s, ...l }) {
|
|
73
73
|
...t.cancelButtonProps
|
74
74
|
}
|
75
75
|
},
|
76
|
-
children:
|
76
|
+
children: C instanceof Function ? C() : C
|
77
77
|
}
|
78
78
|
);
|
79
79
|
}
|
80
|
-
function I(
|
81
|
-
const
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
}),
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
open: B,
|
92
|
-
close: c,
|
93
|
-
update: C
|
80
|
+
function I(f = {}) {
|
81
|
+
const i = g(null), s = n((...t) => {
|
82
|
+
i.current?.open(...t);
|
83
|
+
}), e = n((...t) => {
|
84
|
+
i.current?.close(...t);
|
85
|
+
}), B = n((...t) => {
|
86
|
+
i.current?.update(...t);
|
87
|
+
}), c = {
|
88
|
+
open: s,
|
89
|
+
close: e,
|
90
|
+
update: B
|
94
91
|
};
|
95
92
|
return {
|
96
|
-
confirmHolder: /* @__PURE__ */ d(R, { ...
|
97
|
-
confirmApi:
|
93
|
+
confirmHolder: /* @__PURE__ */ d(R, { ...f, ref: i }),
|
94
|
+
confirmApi: c
|
98
95
|
};
|
99
96
|
}
|
100
97
|
export {
|
package/lib/Earth/index.js
CHANGED
@@ -52,7 +52,7 @@ function W({
|
|
52
52
|
height: g = 600,
|
53
53
|
enableRotation: I = !1,
|
54
54
|
rotationSpeed: M = 5,
|
55
|
-
activeMarkerId:
|
55
|
+
activeMarkerId: i = void 0,
|
56
56
|
markers: y = [],
|
57
57
|
colors: L = {}
|
58
58
|
}) {
|
@@ -70,29 +70,29 @@ function W({
|
|
70
70
|
step: 0,
|
71
71
|
markerId: null,
|
72
72
|
iv: null
|
73
|
-
}), C = J(r.animateDuration, 170, 26), S =
|
73
|
+
}), C = J(r.animateDuration, 170, 26), S = i && k.current.markerId !== i && y.some((t) => t.id === i), p = N.geoOrthographic().fitExtent(
|
74
74
|
[
|
75
75
|
[30, 30],
|
76
76
|
[s - 30, g - 30]
|
77
77
|
],
|
78
78
|
F
|
79
79
|
).rotate(
|
80
|
-
C <= 1 || r.isDragging || !
|
80
|
+
C <= 1 || r.isDragging || !i ? r.rotation : k.current.iv(C / r.animateDuration)
|
81
81
|
), P = N.geoPath().projection(p).pointRadius(2);
|
82
82
|
H(() => {
|
83
83
|
if (S) {
|
84
|
-
let { p1: t, p2: o, r1:
|
85
|
-
if (c !==
|
86
|
-
const l = y.find((v) => v.id ===
|
87
|
-
t = o, o = [l.longitude, l.latitude],
|
88
|
-
const h = X.interpolateAngles(
|
84
|
+
let { p1: t, p2: o, r1: a, r2: u, markerId: c } = k.current;
|
85
|
+
if (c !== i && !r.isDragging) {
|
86
|
+
const l = y.find((v) => v.id === i);
|
87
|
+
t = o, o = [l.longitude, l.latitude], a = u, u = [-o[0], 20 - o[1], p.rotate()[2]];
|
88
|
+
const h = X.interpolateAngles(a, u);
|
89
89
|
Object.assign(k.current, {
|
90
90
|
p1: t,
|
91
91
|
p2: o,
|
92
|
-
r1:
|
92
|
+
r1: a,
|
93
93
|
r2: u,
|
94
94
|
iv: h,
|
95
|
-
markerId:
|
95
|
+
markerId: i
|
96
96
|
});
|
97
97
|
const f = r.animateDuration * 2;
|
98
98
|
d({
|
@@ -113,15 +113,15 @@ function W({
|
|
113
113
|
}
|
114
114
|
});
|
115
115
|
const b = (t) => {
|
116
|
-
const o = E.current,
|
117
|
-
return [t.clientX -
|
116
|
+
const o = E.current, a = o?.getBoundingClientRect();
|
117
|
+
return [t.clientX - a.left - o.clientLeft, t.clientY - a.top - o.clientTop];
|
118
118
|
}, T = (t) => {
|
119
119
|
const o = b(t);
|
120
120
|
o[0] && (x.current.v0 = D.cartesian(p.invert(o)), x.current.r0 = p.rotate(), x.current.q0 = D(x.current.r0), d({ type: "dragStart", payload: { mousePosition: o } }));
|
121
121
|
}, z = (t) => {
|
122
122
|
if (r.isDragging === !1)
|
123
123
|
return;
|
124
|
-
const o = b(t), { r0:
|
124
|
+
const o = b(t), { r0: a, v0: u, q0: c } = x.current, l = D.cartesian(p.rotate(a).invert(o)), h = D.multiply(c, D.delta(u, l)), f = D.rotation(h);
|
125
125
|
d({ type: "rotate", payload: { rotation: f, mousePosition: o } });
|
126
126
|
}, j = () => {
|
127
127
|
setTimeout(() => {
|
@@ -131,7 +131,7 @@ function W({
|
|
131
131
|
type: "tooltip",
|
132
132
|
payload: { tooltipIndex: o, mousePosition: b(t) }
|
133
133
|
}), O = () => d({ type: "tooltip", payload: { tooltipIndex: -1, mousePosition: null } }), G = () => y.map((t, o) => {
|
134
|
-
const
|
134
|
+
const a = [t.longitude, t.latitude], u = N.geoDistance(a, p.invert([s / 2, g / 2])), c = p(a), l = i === t.id, h = u > 1.57 ? "none" : l ? $.activeMarker : $.marker, f = l ? 9 : 6;
|
135
135
|
return /* @__PURE__ */ m(
|
136
136
|
"g",
|
137
137
|
{
|
@@ -174,22 +174,21 @@ function W({
|
|
174
174
|
t.id
|
175
175
|
);
|
176
176
|
}), q = () => {
|
177
|
-
var t, o;
|
178
177
|
if (r.tooltipIndex >= 0) {
|
179
|
-
const
|
180
|
-
return /* @__PURE__ */ m(oo, { style: { left:
|
181
|
-
/* @__PURE__ */ n("p", { className: "title", children:
|
182
|
-
/* @__PURE__ */ n("p", { className: "description", children:
|
178
|
+
const t = y[r.tooltipIndex];
|
179
|
+
return /* @__PURE__ */ m(oo, { style: { left: r.mousePosition?.[0] ?? 0, top: r.mousePosition?.[1] ?? 0 }, children: [
|
180
|
+
/* @__PURE__ */ n("p", { className: "title", children: t.title }),
|
181
|
+
/* @__PURE__ */ n("p", { className: "description", children: t.description }),
|
183
182
|
/* @__PURE__ */ m("p", { className: "description", children: [
|
184
183
|
"ID: ",
|
185
|
-
|
184
|
+
t.id
|
186
185
|
] })
|
187
186
|
] });
|
188
187
|
}
|
189
188
|
};
|
190
189
|
let _ = null;
|
191
|
-
if (
|
192
|
-
const t = y.find((o) => o.id ===
|
190
|
+
if (i && y.some((t) => t.id === i)) {
|
191
|
+
const t = y.find((o) => o.id === i);
|
193
192
|
_ = F.features.findIndex(
|
194
193
|
(o) => o.properties && o.properties.name && o.properties.name === t.country
|
195
194
|
);
|
package/lib/Footer/index.js
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
2
|
-
import { Container as
|
3
|
-
import { mergeProps as
|
4
|
-
import
|
5
|
-
import { styled as
|
6
|
-
function
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
/* @__PURE__ */ t(h, { maxWidth: !1, children: /* @__PURE__ */ o(r, { component: "div", className: "footer", children: [
|
2
|
+
import { Container as f, Typography as r, Box as h } from "@mui/material";
|
3
|
+
import { mergeProps as g } from "../Util/index.js";
|
4
|
+
import w from "../Logo/index.js";
|
5
|
+
import { styled as y } from "../Theme/index.js";
|
6
|
+
function u({ ...e }) {
|
7
|
+
const s = g(e, u, ["dark", "style"]), { className: p = "", copyStart: d = "2017", style: m = {}, brand: c = "ArcBlock", dark: n = !1, addon: a = null } = s, i = `${(/* @__PURE__ */ new Date()).getFullYear()}`, l = `${d}`, x = i === l ? i : `${l}-${i}`;
|
8
|
+
return /* @__PURE__ */ o(b, { className: p, style: m, dark: n, children: [
|
9
|
+
/* @__PURE__ */ t(f, { maxWidth: !1, children: /* @__PURE__ */ o(r, { component: "div", className: "footer", children: [
|
11
10
|
/* @__PURE__ */ o(r, { component: "p", className: "footer-item", children: [
|
12
11
|
/* @__PURE__ */ o("span", { className: "footer-copy", children: [
|
13
12
|
"Copyright © ",
|
14
|
-
|
13
|
+
x,
|
15
14
|
" "
|
16
15
|
] }),
|
17
|
-
/* @__PURE__ */ t("span", { className: "footer-brand", children:
|
16
|
+
/* @__PURE__ */ t("span", { className: "footer-brand", children: c })
|
18
17
|
] }),
|
19
18
|
a && /* @__PURE__ */ t(
|
20
19
|
r,
|
@@ -27,11 +26,11 @@ function b({ ...e }) {
|
|
27
26
|
),
|
28
27
|
/* @__PURE__ */ o(r, { component: "p", className: "footer-item", style: { justifyContent: "flex-end", flexShrink: 0 }, children: [
|
29
28
|
"Powered by",
|
30
|
-
/* @__PURE__ */ t(
|
29
|
+
/* @__PURE__ */ t(w, { mode: n ? "light" : "dark", layout: "horizontal", className: "logo-container" })
|
31
30
|
] })
|
32
31
|
] }) }),
|
33
32
|
/* @__PURE__ */ t(
|
34
|
-
|
33
|
+
h,
|
35
34
|
{
|
36
35
|
sx: {
|
37
36
|
position: "absolute",
|
@@ -41,12 +40,12 @@ function b({ ...e }) {
|
|
41
40
|
color: "transparent",
|
42
41
|
"::selection": { background: "#000", color: "#fff" }
|
43
42
|
},
|
44
|
-
children:
|
43
|
+
children: window?.blocklet?.version
|
45
44
|
}
|
46
45
|
)
|
47
46
|
] });
|
48
47
|
}
|
49
|
-
const
|
48
|
+
const b = y("div", {
|
50
49
|
shouldForwardProp: (e) => e !== "dark"
|
51
50
|
})`
|
52
51
|
position: relative;
|
@@ -110,5 +109,5 @@ const k = u("div", {
|
|
110
109
|
}
|
111
110
|
`;
|
112
111
|
export {
|
113
|
-
|
112
|
+
u as default
|
114
113
|
};
|