@ckb-ccc/connector-react 0.0.14-alpha.0 → 0.0.14-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ckb-ccc/connector-react
2
2
 
3
+ ## 0.0.14-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#53](https://github.com/ckb-ecofund/ccc/pull/53) [`32bffff`](https://github.com/ckb-ecofund/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): select client
8
+
9
+ - Updated dependencies [[`32bffff`](https://github.com/ckb-ecofund/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452)]:
10
+ - @ckb-ccc/connector@0.0.14-alpha.2
11
+
12
+ ## 0.0.14-alpha.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [#48](https://github.com/ckb-ecofund/ccc/pull/48) [`4fb114b`](https://github.com/ckb-ecofund/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(okx): make okx wallet happy
17
+
18
+ - Updated dependencies [[`4fb114b`](https://github.com/ckb-ecofund/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6)]:
19
+ - @ckb-ccc/connector@0.0.14-alpha.1
20
+
3
21
  ## 0.0.14-alpha.0
4
22
 
5
23
  ### Patch Changes
package/README.md CHANGED
@@ -15,6 +15,9 @@
15
15
  <img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-ecofund/ccc" />
16
16
  <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-ecofund/ccc/master" />
17
17
  <img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/ckb-ecofund/ccc/master" />
18
+ <a href="https://live.ckbccc.com/"><img
19
+ alt="Playground" src="https://img.shields.io/website?url=https%3A%2F%2Flive.ckbccc.com%2F&label=Playground"
20
+ /></a>
18
21
  <a href="https://app.ckbccc.com/"><img
19
22
  alt="App" src="https://img.shields.io/website?url=https%3A%2F%2Fapp.ckbccc.com%2F&label=App"
20
23
  /></a>
@@ -33,15 +36,25 @@
33
36
  Fully enabling CKB's Turing completeness and cryptographic freedom power.
34
37
  </p>
35
38
 
36
- ## Preview
39
+ ## Playground
40
+
41
+ <p align="center">
42
+ <a href="https://live.ckbccc.com/">
43
+ <img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/preview.png" width="90%" />
44
+ </a>
45
+ </p>
46
+
47
+ This project is still under active development, and we are looking forward to your feedback. You can [experiment instantly in the playground](https://live.ckbccc.com/). If you are new to the CKB, we recommend checking [Nervos CKB Docs](https://docs.nervos.org/) for basic knowledge.
48
+
49
+ ## App
37
50
 
38
51
  <p align="center">
39
52
  <a href="https://app.ckbccc.com/">
40
- <img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/preview.png" width="30%" />
53
+ <img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/appPreview.png" width="50%" />
41
54
  </a>
42
55
  </p>
43
56
 
44
- This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
57
+ For non-developers, you can also [try CCC's app now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
45
58
 
46
59
  ## Use the Connector UI
47
60
 
@@ -1,6 +1,6 @@
1
1
  import { ccc } from "@ckb-ccc/connector";
2
2
  import React, { HTMLAttributes, ReactNode } from "react";
3
- export declare function Provider({ children, connectorProps, name, icon, signerFilter, signersController, defaultClient, preferredNetworks, }: {
3
+ export declare function Provider({ children, connectorProps, name, icon, signerFilter, signersController, defaultClient, clientOptions, preferredNetworks, }: {
4
4
  children: ReactNode;
5
5
  connectorProps?: HTMLAttributes<{}>;
6
6
  name?: string;
@@ -8,6 +8,11 @@ export declare function Provider({ children, connectorProps, name, icon, signerF
8
8
  signerFilter?: (signerInfo: ccc.SignerInfo, wallet: ccc.Wallet) => Promise<boolean>;
9
9
  signersController?: ccc.SignersController;
10
10
  defaultClient?: ccc.Client;
11
+ clientOptions?: {
12
+ icon?: string;
13
+ client: ccc.Client;
14
+ name: string;
15
+ }[];
11
16
  preferredNetworks?: ccc.NetworkPreference[];
12
17
  }): React.JSX.Element;
13
18
  export declare function useCcc(): {
@@ -1 +1 @@
1
- {"version":3,"file":"useCcc.d.ts","sourceRoot":"","sources":["../../src/hooks/useCcc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,SAAS,EAQV,MAAM,OAAO,CAAC;AA0Cf,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC;IAC1C,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;CAC7C,qBAoFA;AAED,wBAAgB,MAAM;;;;;;;EAQrB"}
1
+ {"version":3,"file":"useCcc.d.ts","sourceRoot":"","sources":["../../src/hooks/useCcc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,SAAS,EAQV,MAAM,OAAO,CAAC;AA0Cf,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC;IAC1C,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtE,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;CAC7C,qBAuFA;AAED,wBAAgB,MAAM;;;;;;;EAQrB"}
@@ -15,7 +15,7 @@ class SignersControllerWithFilter extends ccc.SignersController {
15
15
  return super.addSigner(walletName, icon, signerInfo, context);
16
16
  }
17
17
  }
18
- export function Provider({ children, connectorProps, name, icon, signerFilter, signersController, defaultClient, preferredNetworks, }) {
18
+ export function Provider({ children, connectorProps, name, icon, signerFilter, signersController, defaultClient, clientOptions, preferredNetworks, }) {
19
19
  const [ref, setRef] = useState(null);
20
20
  const [isOpen, setIsOpen] = useState(false);
21
21
  const [_, setFlag] = useState(0);
@@ -48,7 +48,7 @@ export function Provider({ children, connectorProps, name, icon, signerFilter, s
48
48
  wallet: ref?.wallet,
49
49
  signerInfo: ref?.signer,
50
50
  } },
51
- React.createElement(Connector, { name: name, icon: icon, signersController: signersController ?? defautlSignersController.current, ref: setRef, onWillUpdate: () => setFlag((f) => f + 1), onClose: () => setIsOpen(false), preferredNetworks: preferredNetworks, ...connectorProps,
51
+ React.createElement(Connector, { name: name, icon: icon, signersController: signersController ?? defautlSignersController.current, ref: setRef, onWillUpdate: () => setFlag((f) => f + 1), onClose: () => setIsOpen(false), preferredNetworks: preferredNetworks, clientOptions: clientOptions, ...connectorProps,
52
52
  style: {
53
53
  zIndex: 999,
54
54
  ...(isOpen ? {} : { display: "none" }),
@@ -59,6 +59,8 @@ export function Provider({ children, connectorProps, name, icon, signerFilter, s
59
59
  "--btn-primary-hover": "#efeeee",
60
60
  "--btn-secondary": "#ddd",
61
61
  "--btn-secondary-hover": "#ccc",
62
+ "--icon-primary": "#1E1E1E",
63
+ "--icon-secondary": "#666666",
62
64
  color: "#1e1e1e",
63
65
  "--tip-color": "#666",
64
66
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/connector-react",
3
- "version": "0.0.14-alpha.0",
3
+ "version": "0.0.14-alpha.2",
4
4
  "description": "CCC - CKBer's Codebase. Common Chains Connector UI Component for React",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@lit/react": "^1.0.5",
38
- "@ckb-ccc/connector": "0.0.14-alpha.0"
38
+ "@ckb-ccc/connector": "0.0.14-alpha.2"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=16"
@@ -60,6 +60,7 @@ export function Provider({
60
60
  signerFilter,
61
61
  signersController,
62
62
  defaultClient,
63
+ clientOptions,
63
64
  preferredNetworks,
64
65
  }: {
65
66
  children: ReactNode;
@@ -72,6 +73,7 @@ export function Provider({
72
73
  ) => Promise<boolean>;
73
74
  signersController?: ccc.SignersController;
74
75
  defaultClient?: ccc.Client;
76
+ clientOptions?: { icon?: string; client: ccc.Client; name: string }[];
75
77
  preferredNetworks?: ccc.NetworkPreference[];
76
78
  }) {
77
79
  const [ref, setRef] = useState<ccc.WebComponentConnector | null>(null);
@@ -135,6 +137,7 @@ export function Provider({
135
137
  onWillUpdate={() => setFlag((f) => f + 1)}
136
138
  onClose={() => setIsOpen(false)}
137
139
  preferredNetworks={preferredNetworks}
140
+ clientOptions={clientOptions}
138
141
  {...{
139
142
  ...connectorProps,
140
143
  style: {
@@ -147,6 +150,8 @@ export function Provider({
147
150
  "--btn-primary-hover": "#efeeee",
148
151
  "--btn-secondary": "#ddd",
149
152
  "--btn-secondary-hover": "#ccc",
153
+ "--icon-primary": "#1E1E1E",
154
+ "--icon-secondary": "#666666",
150
155
  color: "#1e1e1e",
151
156
  "--tip-color": "#666",
152
157
  } as CSSProperties),