@blocklet/did-domain-react 0.3.41 → 0.3.43
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 +2 -2
- package/es/buy.d.ts +2 -0
- package/es/buy.js +7 -8
- package/lib/buy.d.ts +2 -0
- package/lib/buy.js +7 -6
- package/package.json +9 -9
- package/src/buy.tsx +8 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DID Domain React Components
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Buy
|
|
4
4
|
|
|
5
5
|
Buy and Bind Domain automatically.
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ function App() {
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Domain Information
|
|
30
30
|
|
|
31
31
|
Display the domain information of the domain NFT.
|
|
32
32
|
|
package/es/buy.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface Props {
|
|
|
4
4
|
delegateePk: string;
|
|
5
5
|
didDomainURL: string;
|
|
6
6
|
locale: Locale;
|
|
7
|
+
title?: string;
|
|
7
8
|
onSuccess?: (data: {
|
|
8
9
|
nftDid: string;
|
|
9
10
|
domain: string;
|
|
@@ -14,6 +15,7 @@ declare function Buy(props: Props): import("react").JSX.Element;
|
|
|
14
15
|
declare namespace Buy {
|
|
15
16
|
var defaultProps: {
|
|
16
17
|
onSuccess: () => void;
|
|
18
|
+
title: string;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export default Buy;
|
package/es/buy.js
CHANGED
|
@@ -20,7 +20,7 @@ var BuyState = /* @__PURE__ */ ((BuyState2) => {
|
|
|
20
20
|
BuyState2[BuyState2["Completed"] = 8] = "Completed";
|
|
21
21
|
return BuyState2;
|
|
22
22
|
})(BuyState || {});
|
|
23
|
-
function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ...props }) {
|
|
23
|
+
function Component({ delegatee, delegateePk, didDomainURL, locale, title, onSuccess, ...props }) {
|
|
24
24
|
const { t } = useLocaleContext();
|
|
25
25
|
const [state, setState] = useSetState({
|
|
26
26
|
currentState: 1 /* Prepare */
|
|
@@ -93,7 +93,7 @@ function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ..
|
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
96
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleOpenDialog, variant: "contained", startIcon: /* @__PURE__ */ jsx(ShoppingCart, {}), ...props, children: t("buy.button.title") }),
|
|
96
|
+
/* @__PURE__ */ jsx(Button, { onClick: handleOpenDialog, variant: "contained", startIcon: /* @__PURE__ */ jsx(ShoppingCart, {}), ...props, children: title || t("buy.button.title") }),
|
|
97
97
|
/* @__PURE__ */ jsxs(
|
|
98
98
|
Dialog,
|
|
99
99
|
{
|
|
@@ -114,14 +114,13 @@ function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ..
|
|
|
114
114
|
)
|
|
115
115
|
] });
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
const defaultProps = {
|
|
118
118
|
onSuccess: () => {
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
|
+
title: ""
|
|
120
121
|
};
|
|
122
|
+
Component.defaultProps = defaultProps;
|
|
121
123
|
export default function Buy(props) {
|
|
122
124
|
return /* @__PURE__ */ jsx(LocaleProvider, { locale: props.locale, translations, children: /* @__PURE__ */ jsx(Component, { ...props }) });
|
|
123
125
|
}
|
|
124
|
-
Buy.defaultProps =
|
|
125
|
-
onSuccess: () => {
|
|
126
|
-
}
|
|
127
|
-
};
|
|
126
|
+
Buy.defaultProps = defaultProps;
|
package/lib/buy.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface Props {
|
|
|
4
4
|
delegateePk: string;
|
|
5
5
|
didDomainURL: string;
|
|
6
6
|
locale: Locale;
|
|
7
|
+
title?: string;
|
|
7
8
|
onSuccess?: (data: {
|
|
8
9
|
nftDid: string;
|
|
9
10
|
domain: string;
|
|
@@ -14,6 +15,7 @@ declare function Buy(props: Props): import("react").JSX.Element;
|
|
|
14
15
|
declare namespace Buy {
|
|
15
16
|
var defaultProps: {
|
|
16
17
|
onSuccess: () => void;
|
|
18
|
+
title: string;
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export default Buy;
|
package/lib/buy.js
CHANGED
|
@@ -32,6 +32,7 @@ function Component({
|
|
|
32
32
|
delegateePk,
|
|
33
33
|
didDomainURL,
|
|
34
34
|
locale,
|
|
35
|
+
title,
|
|
35
36
|
onSuccess,
|
|
36
37
|
...props
|
|
37
38
|
}) {
|
|
@@ -133,7 +134,7 @@ function Component({
|
|
|
133
134
|
variant: "contained",
|
|
134
135
|
startIcon: /* @__PURE__ */(0, _jsxRuntime.jsx)(_ShoppingCart.default, {}),
|
|
135
136
|
...props,
|
|
136
|
-
children: t("buy.button.title")
|
|
137
|
+
children: title || t("buy.button.title")
|
|
137
138
|
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_Dialog.default, {
|
|
138
139
|
fullWidth: true,
|
|
139
140
|
maxWidth: "xs",
|
|
@@ -165,9 +166,11 @@ function Component({
|
|
|
165
166
|
})]
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
-
onSuccess: () => {}
|
|
169
|
+
const defaultProps = {
|
|
170
|
+
onSuccess: () => {},
|
|
171
|
+
title: ""
|
|
170
172
|
};
|
|
173
|
+
Component.defaultProps = defaultProps;
|
|
171
174
|
function Buy(props) {
|
|
172
175
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_context.LocaleProvider, {
|
|
173
176
|
locale: props.locale,
|
|
@@ -177,6 +180,4 @@ function Buy(props) {
|
|
|
177
180
|
})
|
|
178
181
|
});
|
|
179
182
|
}
|
|
180
|
-
Buy.defaultProps =
|
|
181
|
-
onSuccess: () => {}
|
|
182
|
-
};
|
|
183
|
+
Buy.defaultProps = defaultProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/did-domain-react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.43",
|
|
4
4
|
"description": "Reusable react components for DID Domain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"ahooks": "^3.8.
|
|
58
|
-
"axios": "^1.7.
|
|
57
|
+
"ahooks": "^3.8.2",
|
|
58
|
+
"axios": "^1.7.9",
|
|
59
59
|
"flat": "^5.0.2",
|
|
60
60
|
"lodash": "^4.17.21",
|
|
61
61
|
"react-error-boundary": "^4.1.2",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@babel/cli": "^7.25.9",
|
|
81
81
|
"@babel/core": "^7.26.0",
|
|
82
82
|
"@babel/preset-env": "^7.26.0",
|
|
83
|
-
"@babel/preset-react": "^7.
|
|
84
|
-
"@types/react": "^18.3.
|
|
83
|
+
"@babel/preset-react": "^7.26.3",
|
|
84
|
+
"@types/react": "^18.3.13",
|
|
85
85
|
"@types/react-dom": "^18.3.1",
|
|
86
86
|
"@vitejs/plugin-legacy": "^5.4.3",
|
|
87
87
|
"copyfiles": "^2.4.1",
|
|
@@ -89,18 +89,18 @@
|
|
|
89
89
|
"glob": "^10.4.5",
|
|
90
90
|
"import-sort-style-module": "^6.0.0",
|
|
91
91
|
"jest": "^29.7.0",
|
|
92
|
-
"prettier": "^3.
|
|
92
|
+
"prettier": "^3.4.2",
|
|
93
93
|
"prettier-plugin-import-sort": "^0.0.7",
|
|
94
94
|
"react": "18.2.0",
|
|
95
95
|
"react-dom": "18.2.0",
|
|
96
96
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
97
97
|
"storybook": "^7.6.20",
|
|
98
98
|
"ts-jest": "^29.2.5",
|
|
99
|
-
"type-fest": "^4.
|
|
99
|
+
"type-fest": "^4.30.0",
|
|
100
100
|
"typescript": "^4.9.5",
|
|
101
101
|
"unbuild": "^2.0.0",
|
|
102
|
-
"vite-plugin-babel": "^1.
|
|
102
|
+
"vite-plugin-babel": "^1.3.0",
|
|
103
103
|
"vite-plugin-node-polyfills": "^0.21.0"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "568f812b89680f7abfae8efcae7242a13dc4b031"
|
|
106
106
|
}
|
package/src/buy.tsx
CHANGED
|
@@ -28,10 +28,11 @@ interface Props {
|
|
|
28
28
|
delegateePk: string;
|
|
29
29
|
didDomainURL: string;
|
|
30
30
|
locale: Locale;
|
|
31
|
+
title?: string;
|
|
31
32
|
onSuccess?: (data: { nftDid: string; domain: string; chainHost: string }) => void;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ...props }: Props & ButtonProps) {
|
|
35
|
+
function Component({ delegatee, delegateePk, didDomainURL, locale, title, onSuccess, ...props }: Props & ButtonProps) {
|
|
35
36
|
const { t } = useLocaleContext();
|
|
36
37
|
const [state, setState] = useSetState<{ currentState: BuyState }>({
|
|
37
38
|
currentState: BuyState.Prepare,
|
|
@@ -120,7 +121,7 @@ function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ..
|
|
|
120
121
|
return (
|
|
121
122
|
<>
|
|
122
123
|
<Button onClick={handleOpenDialog} variant="contained" startIcon={<ShoppingCart />} {...props}>
|
|
123
|
-
{t('buy.button.title')}
|
|
124
|
+
{title || t('buy.button.title')}
|
|
124
125
|
</Button>
|
|
125
126
|
<Dialog
|
|
126
127
|
fullWidth
|
|
@@ -143,10 +144,13 @@ function Component({ delegatee, delegateePk, didDomainURL, locale, onSuccess, ..
|
|
|
143
144
|
);
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
|
|
147
|
+
const defaultProps = {
|
|
147
148
|
onSuccess: () => {},
|
|
149
|
+
title: '',
|
|
148
150
|
};
|
|
149
151
|
|
|
152
|
+
Component.defaultProps = defaultProps;
|
|
153
|
+
|
|
150
154
|
export default function Buy(props: Props) {
|
|
151
155
|
return (
|
|
152
156
|
<LocaleProvider locale={props.locale} translations={translations}>
|
|
@@ -155,6 +159,4 @@ export default function Buy(props: Props) {
|
|
|
155
159
|
);
|
|
156
160
|
}
|
|
157
161
|
|
|
158
|
-
Buy.defaultProps =
|
|
159
|
-
onSuccess: () => {},
|
|
160
|
-
};
|
|
162
|
+
Buy.defaultProps = defaultProps;
|