@arcblock/ux 3.1.2 → 3.1.3
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/DIDLogo/index.js +19 -19
- package/package.json +7 -7
- package/src/DIDLogo/index.tsx +2 -1
package/lib/DIDLogo/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsxs as l, jsx as C, Fragment as f } from "react/jsx-runtime";
|
2
|
-
import { useRef as
|
3
|
-
const
|
2
|
+
import { useRef as w, useState as d, useEffect as P } from "react";
|
3
|
+
const m = {
|
4
4
|
default: {
|
5
5
|
color: "#4598FA",
|
6
6
|
text: void 0
|
@@ -23,26 +23,26 @@ const w = {
|
|
23
23
|
}
|
24
24
|
};
|
25
25
|
function H({
|
26
|
-
style:
|
27
|
-
className:
|
28
|
-
size:
|
29
|
-
color:
|
30
|
-
text:
|
26
|
+
style: B = {},
|
27
|
+
className: p = "",
|
28
|
+
size: v = "1em",
|
29
|
+
color: W = void 0,
|
30
|
+
text: h = void 0,
|
31
31
|
textColor: S = void 0,
|
32
|
-
fontSize:
|
33
|
-
gap:
|
32
|
+
fontSize: x = void 0,
|
33
|
+
gap: M = 10,
|
34
34
|
variant: T = "default",
|
35
35
|
name: y = void 0,
|
36
36
|
dark: A = !1
|
37
37
|
}) {
|
38
|
-
const c = T === "contained",
|
39
|
-
let e = 1, t = 80, n =
|
40
|
-
!c && o && (t = 64, e = 1.25, i =
|
41
|
-
const
|
38
|
+
const c = T === "contained", Z = m[y] || m.default, o = h === void 0 ? Z?.text : h, F = W || Z?.color, R = S || (A ? "white" : "#121212");
|
39
|
+
let e = 1, t = 80, n = x, i = M + 5;
|
40
|
+
!c && o && (t = 64, e = 1.25, i = M, x || (n = 32)), n = n || 40;
|
41
|
+
const u = w(null), L = w(null), [z, D] = d(), [j, $] = d(t), [b, I] = d(t), N = c ? t / 2 + 5 : t / 2 + 3, r = t / 5;
|
42
42
|
P(() => {
|
43
43
|
if (L.current) {
|
44
|
-
const E =
|
45
|
-
I(
|
44
|
+
const E = u.current?.getBBox(), G = L.current.getBoundingClientRect(), a = E?.width || 0, O = G.height / t, g = t * e + a + (a ? i : 0);
|
45
|
+
I(g), $(t * e + (a ? i : 0)), D(g * O);
|
46
46
|
}
|
47
47
|
}, [o, i, e, t]);
|
48
48
|
const V = /* @__PURE__ */ l(f, { children: [
|
@@ -79,17 +79,17 @@ function H({
|
|
79
79
|
{
|
80
80
|
xmlns: "http://www.w3.org/2000/svg",
|
81
81
|
width: z,
|
82
|
-
height:
|
82
|
+
height: v,
|
83
83
|
viewBox: `0 0 ${b} ${t}`,
|
84
84
|
fill: "currentColor",
|
85
|
-
className: `${
|
86
|
-
style: Object.assign({ color: F },
|
85
|
+
className: `${p}`.trim(),
|
86
|
+
style: Object.assign({ color: F }, B),
|
87
87
|
children: [
|
88
88
|
s,
|
89
89
|
o && /* @__PURE__ */ C(
|
90
90
|
"text",
|
91
91
|
{
|
92
|
-
ref:
|
92
|
+
ref: u,
|
93
93
|
x: j,
|
94
94
|
y: N,
|
95
95
|
fontSize: n,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.3",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -60,16 +60,16 @@
|
|
60
60
|
"react": "^19.0.0",
|
61
61
|
"react-router-dom": "^6.22.3"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "be7c396a4fbbf7869c12cf2fd90e0c5c8f3ed46e",
|
64
64
|
"dependencies": {
|
65
|
-
"@arcblock/bridge": "3.1.
|
65
|
+
"@arcblock/bridge": "3.1.3",
|
66
66
|
"@arcblock/did": "^1.21.2",
|
67
67
|
"@arcblock/did-motif": "^1.1.14",
|
68
|
-
"@arcblock/icons": "3.1.
|
69
|
-
"@arcblock/nft-display": "3.1.
|
70
|
-
"@arcblock/react-hooks": "3.1.
|
68
|
+
"@arcblock/icons": "3.1.3",
|
69
|
+
"@arcblock/nft-display": "3.1.3",
|
70
|
+
"@arcblock/react-hooks": "3.1.3",
|
71
71
|
"@blocklet/js-sdk": "^1.16.46",
|
72
|
-
"@blocklet/theme": "3.1.
|
72
|
+
"@blocklet/theme": "3.1.3",
|
73
73
|
"@fontsource/roboto": "~5.1.1",
|
74
74
|
"@fontsource/ubuntu-mono": "^5.2.6",
|
75
75
|
"@iconify-icons/logos": "^1.2.36",
|
package/src/DIDLogo/index.tsx
CHANGED
@@ -52,7 +52,8 @@ export default function DIDLogo({
|
|
52
52
|
}: DIDLogoProps) {
|
53
53
|
const isContained = variant === 'contained';
|
54
54
|
const currentPreset = presetMap[name as keyof typeof presetMap] || presetMap.default;
|
55
|
-
|
55
|
+
// 可通过传入 text = null,强制隐藏文字
|
56
|
+
const finalText = text === undefined ? currentPreset?.text : text;
|
56
57
|
const finalColor = color || currentPreset?.color;
|
57
58
|
const finalTextColor = textColor || (dark ? 'white' : '#121212');
|
58
59
|
|