@bwalletx/connect 0.5.4 → 0.5.6
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 +28 -0
- package/README.md +76 -8
- package/dist/bwalletx-connect.global.js +92 -25
- package/dist/bwalletx-connect.global.js.map +1 -1
- package/dist/{wallets-CbzMtxrf.d.ts → choice-DCh-tgpT.d.cts} +112 -4
- package/dist/{wallets-CbzMtxrf.d.cts → choice-DCh-tgpT.d.ts} +112 -4
- package/dist/chunk-34DKBQNN.js +222 -0
- package/dist/chunk-34DKBQNN.js.map +1 -0
- package/dist/{chunk-QRXFL66W.js → chunk-A2WLGS25.js} +6 -4
- package/dist/chunk-A2WLGS25.js.map +1 -0
- package/dist/chunk-IFGOAROM.js +255 -0
- package/dist/chunk-IFGOAROM.js.map +1 -0
- package/dist/chunk-LS6AYEBO.js +1886 -0
- package/dist/chunk-LS6AYEBO.js.map +1 -0
- package/dist/element-D9Zl-x12.d.cts +46 -0
- package/dist/element-D9Zl-x12.d.ts +46 -0
- package/dist/element.cjs +1147 -61
- package/dist/element.cjs.map +1 -1
- package/dist/element.d.cts +23 -28
- package/dist/element.d.ts +23 -28
- package/dist/element.js +29 -2
- package/dist/element.js.map +1 -1
- package/dist/index.cjs +1469 -453
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +163 -14
- package/dist/index.d.ts +163 -14
- package/dist/index.js +100 -12
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +5 -3
- package/dist/next.cjs.map +1 -1
- package/dist/next.js +1 -1
- package/dist/react.cjs +994 -183
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +75 -8
- package/dist/react.d.ts +75 -8
- package/dist/react.js +121 -40
- package/dist/react.js.map +1 -1
- package/dist/server.cjs +5 -3
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +8 -3
- package/dist/server.d.ts +8 -3
- package/dist/server.js +1 -1
- package/package.json +10 -9
- package/dist/chunk-EXRQJTXF.js +0 -910
- package/dist/chunk-EXRQJTXF.js.map +0 -1
- package/dist/chunk-QRXFL66W.js.map +0 -1
- package/dist/chunk-RIOHG5JH.js +0 -459
- package/dist/chunk-RIOHG5JH.js.map +0 -1
package/dist/element.d.cts
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
declare const GET_URL = "https://bwalletx.com/get";
|
|
3
|
-
declare const WEB_WALLET_URL = "https://web.bwalletx.com";
|
|
4
|
-
type SigninSize = 'lg' | 'md' | 'sm' | 'icon';
|
|
5
|
-
type SigninTheme = 'gold' | 'dark' | 'light';
|
|
6
|
-
type SigninLabel = 'signin' | 'continue' | 'connect';
|
|
7
|
-
type SigninBrand = 'bWalletX' | 'bWallet';
|
|
8
|
-
/** The visible label for a label/brand pair, e.g. "Sign in with bWalletX". */
|
|
9
|
-
declare function signinText(label?: SigninLabel, brand?: SigninBrand): string;
|
|
10
|
-
/** The gold "b" (bwalletx-site/logo.svg). Ids are unique per copy so several marks can share a page. */
|
|
11
|
-
declare function markSvg(px?: number): string;
|
|
12
|
-
declare const SIGNIN_CSS = "\n:host{display:inline-block;vertical-align:middle;font-family:Inter,ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif}\n:host([full-width]){display:block;width:100%}\n:host([hidden]){display:none}\nbutton{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:12px;width:100%;cursor:pointer;\n padding:16px 20px;border-radius:12px;font-size:16px;font-weight:700;line-height:1.2;text-align:left;\n background:linear-gradient(180deg,#fcd34d,#f59e0b);color:#000;\n box-shadow:0 10px 15px -3px rgba(245,158,11,.2),0 4px 6px -4px rgba(245,158,11,.2);\n transition:background .15s,transform .1s,box-shadow .15s,border-color .15s;-webkit-tap-highlight-color:transparent}\nbutton:hover{background:linear-gradient(180deg,#fde68a,#fbbf24)}\nbutton:active{transform:translateY(1px);background:linear-gradient(180deg,#fbbf24,#d97706)}\nbutton:focus-visible{outline:2px solid #b45309;outline-offset:3px}\nbutton:disabled{opacity:.6;cursor:not-allowed;transform:none}\nbutton[aria-busy=true]{cursor:wait}\n.mark{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border-radius:50%;background:#000}\n.txt{display:flex;flex-direction:column;align-items:flex-start;min-width:0}\n.txt b{font-weight:700;white-space:nowrap}\n.txt small{font-size:11px;font-weight:500;color:rgba(0,0,0,.65);white-space:nowrap}\n.spin{width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,210,77,.35);border-top-color:#ffd24d;animation:r .8s linear infinite}\n@keyframes r{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){button{transition:none}button:active{transform:none}.spin{animation:none;border-color:#ffd24d;border-right-color:transparent}}\n/* sizes */\n:host([size=md]) button{padding:10px 16px;border-radius:10px;font-size:15px;gap:10px}\n:host([size=md]) .mark{width:24px;height:24px}\n:host([size=md]) .txt small{font-size:10.5px}\n:host([size=sm]) button{padding:6px 12px 6px 6px;border-radius:8px;font-size:13px;gap:8px;min-height:36px}\n:host([size=sm]) .mark{width:22px;height:22px}\n:host([size=icon]) button{width:48px;height:48px;padding:0;border-radius:50%;gap:0}\n:host([size=icon]) .mark{width:34px;height:34px}\n/* themes */\n:host([theme=dark]) button{background:#0a0a0a;color:#fafafa;border:1px solid #3f3f46;box-shadow:none}\n:host([theme=dark]) button:hover{background:#18181b;border-color:rgba(251,191,36,.6)}\n:host([theme=dark]) button:active{background:#000}\n:host([theme=dark]) button:focus-visible{outline-color:#fcd34d}\n:host([theme=dark]) .mark{box-shadow:inset 0 0 0 1px #3f3f46}\n:host([theme=dark]) .txt small{color:rgba(255,255,255,.65)}\n:host([theme=light]) button{background:#fff;color:#09090b;border:1px solid #d4d4d8;box-shadow:0 1px 2px rgba(0,0,0,.06)}\n:host([theme=light]) button:hover{background:#fafafa;border-color:#f59e0b}\n:host([theme=light]) button:active{background:#f4f4f5}\n:host([theme=light]) .txt small{color:#52525b}\n/* not found */\n.nf{margin-top:8px;font-size:12px;line-height:1.4;color:#71717a;text-align:center}\n.nf a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px}\n.nf a:focus-visible{outline:2px solid #b45309;outline-offset:2px;border-radius:2px}\n:host([theme=dark]) .nf,:host-context(.dark) .nf{color:#a1a1aa}\n.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n";
|
|
13
|
-
/** Optional OAuth parameters for authorize-url mode. auth.bwalletx.com is planned, not live. */
|
|
14
|
-
interface AuthorizeParams {
|
|
15
|
-
authorizeUrl: string;
|
|
16
|
-
clientId?: string | null;
|
|
17
|
-
redirectUri?: string | null;
|
|
18
|
-
scope?: string | null;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build an OAuth 2.1 authorization-code + S256 PKCE redirect URL, and keep the verifier, state and
|
|
22
|
-
* nonce in sessionStorage under "bwalletx:oauth" for your callback page. Matches the plan in
|
|
23
|
-
* bit-sign docs/SIGN-IN-WITH-BWALLETX.md. The provider is not live yet.
|
|
24
|
-
*/
|
|
25
|
-
declare function buildAuthorizeUrl(p: AuthorizeParams): Promise<string>;
|
|
26
|
-
/** Register <bwalletx-signin> (once). Safe to call on a server: it does nothing there. */
|
|
27
|
-
declare function defineBwalletxSignin(tag?: string): CustomElementConstructor | undefined;
|
|
1
|
+
export { A as AuthorizeParams, G as GET_URL, M as MENU_CSS, P as PENDING_LABEL, e as PENDING_LABEL_OTHER, f as PENDING_NOTE, g as SIGNIN_CSS, h as SIGNIN_TAG, i as SigninAccount, c as SigninBrand, b as SigninLabel, j as SigninMode, S as SigninSize, d as SigninState, a as SigninTheme, W as WEB_WALLET_URL, k as buildAuthorizeUrl, l as defineBwalletxSignin, m as markSvg, s as signinText } from './element-D9Zl-x12.cjs';
|
|
28
2
|
|
|
29
|
-
|
|
3
|
+
declare const BUTTON_TAG = "bwalletx-button";
|
|
4
|
+
/** Legacy (0.5.5) localStorage key that held the identity key. Deleted on load since 0.5.6; never written. */
|
|
5
|
+
declare const CONNECTED_KEY = "bwx:connected";
|
|
6
|
+
/** Delete the 0.5.5 `bwx:connected` entry (it held the identity key). True when one was there. */
|
|
7
|
+
declare function dropLegacyConnectedKey(): boolean;
|
|
8
|
+
type ButtonState = 'checking' | 'none' | 'available' | 'connecting' | 'connected';
|
|
9
|
+
/** Where "Get bWalletX" goes for this user agent. */
|
|
10
|
+
declare function getUrlFor(ua: string, touchMac?: boolean): string;
|
|
11
|
+
/** What a signed-out button should say before/after discovery. */
|
|
12
|
+
declare function stateFor(o: {
|
|
13
|
+
connected: boolean;
|
|
14
|
+
found: boolean | null;
|
|
15
|
+
phone: boolean;
|
|
16
|
+
}): ButtonState;
|
|
17
|
+
/** $alice for alice@bwalletx.com, other paymails in full, else a short key. */
|
|
18
|
+
declare function handleLabel(key: string, paymail: string | null): string;
|
|
19
|
+
/** Register <bwalletx-button> (idempotent; no-op on a server). */
|
|
20
|
+
declare function defineBwalletxButton(tag?: string): void;
|
|
21
|
+
/** Test hook: forget which button owns the page. */
|
|
22
|
+
declare function _resetBwalletxButtons(): void;
|
|
23
|
+
|
|
24
|
+
export { BUTTON_TAG, type ButtonState, CONNECTED_KEY, _resetBwalletxButtons, defineBwalletxButton, dropLegacyConnectedKey, getUrlFor, handleLabel, stateFor };
|
package/dist/element.d.ts
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
declare const GET_URL = "https://bwalletx.com/get";
|
|
3
|
-
declare const WEB_WALLET_URL = "https://web.bwalletx.com";
|
|
4
|
-
type SigninSize = 'lg' | 'md' | 'sm' | 'icon';
|
|
5
|
-
type SigninTheme = 'gold' | 'dark' | 'light';
|
|
6
|
-
type SigninLabel = 'signin' | 'continue' | 'connect';
|
|
7
|
-
type SigninBrand = 'bWalletX' | 'bWallet';
|
|
8
|
-
/** The visible label for a label/brand pair, e.g. "Sign in with bWalletX". */
|
|
9
|
-
declare function signinText(label?: SigninLabel, brand?: SigninBrand): string;
|
|
10
|
-
/** The gold "b" (bwalletx-site/logo.svg). Ids are unique per copy so several marks can share a page. */
|
|
11
|
-
declare function markSvg(px?: number): string;
|
|
12
|
-
declare const SIGNIN_CSS = "\n:host{display:inline-block;vertical-align:middle;font-family:Inter,ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif}\n:host([full-width]){display:block;width:100%}\n:host([hidden]){display:none}\nbutton{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:12px;width:100%;cursor:pointer;\n padding:16px 20px;border-radius:12px;font-size:16px;font-weight:700;line-height:1.2;text-align:left;\n background:linear-gradient(180deg,#fcd34d,#f59e0b);color:#000;\n box-shadow:0 10px 15px -3px rgba(245,158,11,.2),0 4px 6px -4px rgba(245,158,11,.2);\n transition:background .15s,transform .1s,box-shadow .15s,border-color .15s;-webkit-tap-highlight-color:transparent}\nbutton:hover{background:linear-gradient(180deg,#fde68a,#fbbf24)}\nbutton:active{transform:translateY(1px);background:linear-gradient(180deg,#fbbf24,#d97706)}\nbutton:focus-visible{outline:2px solid #b45309;outline-offset:3px}\nbutton:disabled{opacity:.6;cursor:not-allowed;transform:none}\nbutton[aria-busy=true]{cursor:wait}\n.mark{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border-radius:50%;background:#000}\n.txt{display:flex;flex-direction:column;align-items:flex-start;min-width:0}\n.txt b{font-weight:700;white-space:nowrap}\n.txt small{font-size:11px;font-weight:500;color:rgba(0,0,0,.65);white-space:nowrap}\n.spin{width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,210,77,.35);border-top-color:#ffd24d;animation:r .8s linear infinite}\n@keyframes r{to{transform:rotate(360deg)}}\n@media (prefers-reduced-motion:reduce){button{transition:none}button:active{transform:none}.spin{animation:none;border-color:#ffd24d;border-right-color:transparent}}\n/* sizes */\n:host([size=md]) button{padding:10px 16px;border-radius:10px;font-size:15px;gap:10px}\n:host([size=md]) .mark{width:24px;height:24px}\n:host([size=md]) .txt small{font-size:10.5px}\n:host([size=sm]) button{padding:6px 12px 6px 6px;border-radius:8px;font-size:13px;gap:8px;min-height:36px}\n:host([size=sm]) .mark{width:22px;height:22px}\n:host([size=icon]) button{width:48px;height:48px;padding:0;border-radius:50%;gap:0}\n:host([size=icon]) .mark{width:34px;height:34px}\n/* themes */\n:host([theme=dark]) button{background:#0a0a0a;color:#fafafa;border:1px solid #3f3f46;box-shadow:none}\n:host([theme=dark]) button:hover{background:#18181b;border-color:rgba(251,191,36,.6)}\n:host([theme=dark]) button:active{background:#000}\n:host([theme=dark]) button:focus-visible{outline-color:#fcd34d}\n:host([theme=dark]) .mark{box-shadow:inset 0 0 0 1px #3f3f46}\n:host([theme=dark]) .txt small{color:rgba(255,255,255,.65)}\n:host([theme=light]) button{background:#fff;color:#09090b;border:1px solid #d4d4d8;box-shadow:0 1px 2px rgba(0,0,0,.06)}\n:host([theme=light]) button:hover{background:#fafafa;border-color:#f59e0b}\n:host([theme=light]) button:active{background:#f4f4f5}\n:host([theme=light]) .txt small{color:#52525b}\n/* not found */\n.nf{margin-top:8px;font-size:12px;line-height:1.4;color:#71717a;text-align:center}\n.nf a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px}\n.nf a:focus-visible{outline:2px solid #b45309;outline-offset:2px;border-radius:2px}\n:host([theme=dark]) .nf,:host-context(.dark) .nf{color:#a1a1aa}\n.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n";
|
|
13
|
-
/** Optional OAuth parameters for authorize-url mode. auth.bwalletx.com is planned, not live. */
|
|
14
|
-
interface AuthorizeParams {
|
|
15
|
-
authorizeUrl: string;
|
|
16
|
-
clientId?: string | null;
|
|
17
|
-
redirectUri?: string | null;
|
|
18
|
-
scope?: string | null;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build an OAuth 2.1 authorization-code + S256 PKCE redirect URL, and keep the verifier, state and
|
|
22
|
-
* nonce in sessionStorage under "bwalletx:oauth" for your callback page. Matches the plan in
|
|
23
|
-
* bit-sign docs/SIGN-IN-WITH-BWALLETX.md. The provider is not live yet.
|
|
24
|
-
*/
|
|
25
|
-
declare function buildAuthorizeUrl(p: AuthorizeParams): Promise<string>;
|
|
26
|
-
/** Register <bwalletx-signin> (once). Safe to call on a server: it does nothing there. */
|
|
27
|
-
declare function defineBwalletxSignin(tag?: string): CustomElementConstructor | undefined;
|
|
1
|
+
export { A as AuthorizeParams, G as GET_URL, M as MENU_CSS, P as PENDING_LABEL, e as PENDING_LABEL_OTHER, f as PENDING_NOTE, g as SIGNIN_CSS, h as SIGNIN_TAG, i as SigninAccount, c as SigninBrand, b as SigninLabel, j as SigninMode, S as SigninSize, d as SigninState, a as SigninTheme, W as WEB_WALLET_URL, k as buildAuthorizeUrl, l as defineBwalletxSignin, m as markSvg, s as signinText } from './element-D9Zl-x12.js';
|
|
28
2
|
|
|
29
|
-
|
|
3
|
+
declare const BUTTON_TAG = "bwalletx-button";
|
|
4
|
+
/** Legacy (0.5.5) localStorage key that held the identity key. Deleted on load since 0.5.6; never written. */
|
|
5
|
+
declare const CONNECTED_KEY = "bwx:connected";
|
|
6
|
+
/** Delete the 0.5.5 `bwx:connected` entry (it held the identity key). True when one was there. */
|
|
7
|
+
declare function dropLegacyConnectedKey(): boolean;
|
|
8
|
+
type ButtonState = 'checking' | 'none' | 'available' | 'connecting' | 'connected';
|
|
9
|
+
/** Where "Get bWalletX" goes for this user agent. */
|
|
10
|
+
declare function getUrlFor(ua: string, touchMac?: boolean): string;
|
|
11
|
+
/** What a signed-out button should say before/after discovery. */
|
|
12
|
+
declare function stateFor(o: {
|
|
13
|
+
connected: boolean;
|
|
14
|
+
found: boolean | null;
|
|
15
|
+
phone: boolean;
|
|
16
|
+
}): ButtonState;
|
|
17
|
+
/** $alice for alice@bwalletx.com, other paymails in full, else a short key. */
|
|
18
|
+
declare function handleLabel(key: string, paymail: string | null): string;
|
|
19
|
+
/** Register <bwalletx-button> (idempotent; no-op on a server). */
|
|
20
|
+
declare function defineBwalletxButton(tag?: string): void;
|
|
21
|
+
/** Test hook: forget which button owns the page. */
|
|
22
|
+
declare function _resetBwalletxButtons(): void;
|
|
23
|
+
|
|
24
|
+
export { BUTTON_TAG, type ButtonState, CONNECTED_KEY, _resetBwalletxButtons, defineBwalletxButton, dropLegacyConnectedKey, getUrlFor, handleLabel, stateFor };
|
package/dist/element.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUTTON_TAG,
|
|
3
|
+
CONNECTED_KEY,
|
|
4
|
+
_resetBwalletxButtons,
|
|
5
|
+
defineBwalletxButton,
|
|
6
|
+
dropLegacyConnectedKey,
|
|
7
|
+
getUrlFor,
|
|
8
|
+
handleLabel,
|
|
9
|
+
stateFor
|
|
10
|
+
} from "./chunk-34DKBQNN.js";
|
|
1
11
|
import {
|
|
2
12
|
GET_URL,
|
|
13
|
+
MENU_CSS,
|
|
14
|
+
PENDING_LABEL,
|
|
15
|
+
PENDING_LABEL_OTHER,
|
|
16
|
+
PENDING_NOTE,
|
|
3
17
|
SIGNIN_CSS,
|
|
4
18
|
SIGNIN_TAG,
|
|
5
19
|
WEB_WALLET_URL,
|
|
@@ -7,19 +21,32 @@ import {
|
|
|
7
21
|
defineBwalletxSignin,
|
|
8
22
|
markSvg,
|
|
9
23
|
signinText
|
|
10
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LS6AYEBO.js";
|
|
11
25
|
import "./chunk-MWD4BCO5.js";
|
|
12
26
|
|
|
13
27
|
// src/define.ts
|
|
14
28
|
defineBwalletxSignin();
|
|
29
|
+
defineBwalletxButton();
|
|
15
30
|
export {
|
|
31
|
+
BUTTON_TAG,
|
|
32
|
+
CONNECTED_KEY,
|
|
16
33
|
GET_URL,
|
|
34
|
+
MENU_CSS,
|
|
35
|
+
PENDING_LABEL,
|
|
36
|
+
PENDING_LABEL_OTHER,
|
|
37
|
+
PENDING_NOTE,
|
|
17
38
|
SIGNIN_CSS,
|
|
18
39
|
SIGNIN_TAG,
|
|
19
40
|
WEB_WALLET_URL,
|
|
41
|
+
_resetBwalletxButtons,
|
|
20
42
|
buildAuthorizeUrl,
|
|
43
|
+
defineBwalletxButton,
|
|
21
44
|
defineBwalletxSignin,
|
|
45
|
+
dropLegacyConnectedKey,
|
|
46
|
+
getUrlFor,
|
|
47
|
+
handleLabel,
|
|
22
48
|
markSvg,
|
|
23
|
-
signinText
|
|
49
|
+
signinText,
|
|
50
|
+
stateFor
|
|
24
51
|
};
|
|
25
52
|
//# sourceMappingURL=element.js.map
|
package/dist/element.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/define.ts"],"sourcesContent":["// `import '@bwalletx/connect/element'` registers <bwalletx-signin> as a side effect.\nimport { defineBwalletxSignin } from './element.js';\n\nexport * from './element.js';\ndefineBwalletxSignin();\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/define.ts"],"sourcesContent":["// `import '@bwalletx/connect/element'` registers <bwalletx-signin> and <bwalletx-button> as a side effect.\nimport { defineBwalletxSignin } from './element.js';\nimport { defineBwalletxButton } from './wallet-button.js';\n\nexport * from './element.js';\nexport * from './wallet-button.js';\ndefineBwalletxSignin();\ndefineBwalletxButton();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,qBAAqB;AACrB,qBAAqB;","names":[]}
|