@blocklet/did-domain-react 0.3.40 → 0.3.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # DID Domain React Components
2
2
 
3
- ## Component <Buy>
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
- ## Component <Domain />
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
- Component.defaultProps = {
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
- Component.defaultProps = {
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.40",
3
+ "version": "0.3.42",
4
4
  "description": "Reusable react components for DID Domain",
5
5
  "keywords": [
6
6
  "react",
@@ -54,13 +54,6 @@
54
54
  }
55
55
  },
56
56
  "dependencies": {
57
- "@arcblock/did-connect": "^2.10.69",
58
- "@arcblock/ux": "^2.10.68",
59
- "@blocklet/js-sdk": "^1.16.33",
60
- "@mui/icons-material": "^5.16.7",
61
- "@mui/lab": "^5.0.0-alpha.173",
62
- "@mui/material": "^5.16.7",
63
- "@mui/system": "^5.16.7",
64
57
  "ahooks": "^3.8.1",
65
58
  "axios": "^1.7.8",
66
59
  "flat": "^5.0.2",
@@ -70,6 +63,13 @@
70
63
  "ufo": "^1.5.4"
71
64
  },
72
65
  "peerDependencies": {
66
+ "@arcblock/did-connect": "^2.10.0",
67
+ "@arcblock/ux": "^2.10.0",
68
+ "@blocklet/js-sdk": "^1.16.0",
69
+ "@mui/icons-material": "^5.16.7",
70
+ "@mui/lab": "^5.0.0-alpha.173",
71
+ "@mui/material": "^5.16.7",
72
+ "@mui/system": "^5.16.7",
73
73
  "react": ">=18.1.0"
74
74
  },
75
75
  "publishConfig": {
@@ -102,5 +102,5 @@
102
102
  "vite-plugin-babel": "^1.2.0",
103
103
  "vite-plugin-node-polyfills": "^0.21.0"
104
104
  },
105
- "gitHead": "5fad4c4e679d51aba09e366e109c3c3d462186a3"
105
+ "gitHead": "6e524f6d0924f929b62f9128b8c20f4e58f49e40"
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
- Component.defaultProps = {
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;