@lukso/up-connector 0.4.0-dev.a8c9315
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/LICENSE +201 -0
- package/README.md +280 -0
- package/dist/account-modal.cjs +9 -0
- package/dist/account-modal.cjs.map +1 -0
- package/dist/account-modal.d.cts +16 -0
- package/dist/account-modal.d.ts +16 -0
- package/dist/account-modal.js +9 -0
- package/dist/account-modal.js.map +1 -0
- package/dist/auto-setup.cjs +17 -0
- package/dist/auto-setup.cjs.map +1 -0
- package/dist/auto-setup.d.cts +123 -0
- package/dist/auto-setup.d.ts +123 -0
- package/dist/auto-setup.js +17 -0
- package/dist/auto-setup.js.map +1 -0
- package/dist/avatar-CmUCtW_w.d.cts +205 -0
- package/dist/avatar-CmUCtW_w.d.ts +205 -0
- package/dist/avatar.cjs +12 -0
- package/dist/avatar.cjs.map +1 -0
- package/dist/avatar.d.cts +1 -0
- package/dist/avatar.d.ts +1 -0
- package/dist/avatar.js +12 -0
- package/dist/avatar.js.map +1 -0
- package/dist/backup-modal.cjs +9 -0
- package/dist/backup-modal.cjs.map +1 -0
- package/dist/backup-modal.d.cts +41 -0
- package/dist/backup-modal.d.ts +41 -0
- package/dist/backup-modal.js +9 -0
- package/dist/backup-modal.js.map +1 -0
- package/dist/chunk-3SGSPHOZ.js +595 -0
- package/dist/chunk-3SGSPHOZ.js.map +1 -0
- package/dist/chunk-6AYZOIFY.js +181 -0
- package/dist/chunk-6AYZOIFY.js.map +1 -0
- package/dist/chunk-6N35TCFT.js +852 -0
- package/dist/chunk-6N35TCFT.js.map +1 -0
- package/dist/chunk-7ETKG6KR.cjs +387 -0
- package/dist/chunk-7ETKG6KR.cjs.map +1 -0
- package/dist/chunk-EUXUH3YW.js +15 -0
- package/dist/chunk-EUXUH3YW.js.map +1 -0
- package/dist/chunk-GFVUWAG4.cjs +158 -0
- package/dist/chunk-GFVUWAG4.cjs.map +1 -0
- package/dist/chunk-IAKQFHFD.cjs +595 -0
- package/dist/chunk-IAKQFHFD.cjs.map +1 -0
- package/dist/chunk-MH7MP7XK.cjs +181 -0
- package/dist/chunk-MH7MP7XK.cjs.map +1 -0
- package/dist/chunk-NWCNJSG3.js +387 -0
- package/dist/chunk-NWCNJSG3.js.map +1 -0
- package/dist/chunk-NXU2DQAV.js +1128 -0
- package/dist/chunk-NXU2DQAV.js.map +1 -0
- package/dist/chunk-ORJK2YGG.cjs +852 -0
- package/dist/chunk-ORJK2YGG.cjs.map +1 -0
- package/dist/chunk-RFA6SEIS.cjs +1128 -0
- package/dist/chunk-RFA6SEIS.cjs.map +1 -0
- package/dist/chunk-XGIT7YUY.js +31 -0
- package/dist/chunk-XGIT7YUY.js.map +1 -0
- package/dist/chunk-XOKG3KIL.cjs +31 -0
- package/dist/chunk-XOKG3KIL.cjs.map +1 -0
- package/dist/chunk-YIWSPI4I.js +158 -0
- package/dist/chunk-YIWSPI4I.js.map +1 -0
- package/dist/chunk-ZBDE64SD.cjs +15 -0
- package/dist/chunk-ZBDE64SD.cjs.map +1 -0
- package/dist/connect-modal/index.cjs +20 -0
- package/dist/connect-modal/index.cjs.map +1 -0
- package/dist/connect-modal/index.d.cts +9 -0
- package/dist/connect-modal/index.d.ts +9 -0
- package/dist/connect-modal/index.js +20 -0
- package/dist/connect-modal/index.js.map +1 -0
- package/dist/index-D2orHGFi.d.cts +8 -0
- package/dist/index-D2orHGFi.d.ts +8 -0
- package/dist/index.cjs +793 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +189 -0
- package/dist/index.d.ts +189 -0
- package/dist/index.js +793 -0
- package/dist/index.js.map +1 -0
- package/dist/restore-modal.cjs +9 -0
- package/dist/restore-modal.cjs.map +1 -0
- package/dist/restore-modal.d.cts +68 -0
- package/dist/restore-modal.d.ts +68 -0
- package/dist/restore-modal.js +9 -0
- package/dist/restore-modal.js.map +1 -0
- package/dist/wagmi-CVuDs_0h.d.cts +386 -0
- package/dist/wagmi-CVuDs_0h.d.ts +386 -0
- package/package.json +158 -0
- package/src/account-modal.ts +142 -0
- package/src/auto-setup.ts +362 -0
- package/src/avatar.ts +1135 -0
- package/src/backup-modal.ts +439 -0
- package/src/connect-modal/components/connection-view.ts +398 -0
- package/src/connect-modal/components/eoa-connection-view.ts +408 -0
- package/src/connect-modal/components/qr-code-view.ts +71 -0
- package/src/connect-modal/connect-modal.base.ts +18 -0
- package/src/connect-modal/connect-modal.config.ts +27 -0
- package/src/connect-modal/connect-modal.templates.ts +21 -0
- package/src/connect-modal/connect-modal.ts +270 -0
- package/src/connect-modal/connect-modal.types.ts +104 -0
- package/src/connect-modal/images/up-cube-glass.png +0 -0
- package/src/connect-modal/index.ts +23 -0
- package/src/connect-modal/services/wagmi.ts +266 -0
- package/src/connect-modal/styles/styles.css +1 -0
- package/src/connect-modal/utils/walletConnectDeepLinkUrl.ts +43 -0
- package/src/connector.ts +544 -0
- package/src/index.ts +62 -0
- package/src/popup-instance.ts +537 -0
- package/src/restore-modal.ts +702 -0
- package/src/styles/index.ts +28 -0
- package/src/styles/styles.css +1 -0
- package/src/types/css-raw.d.ts +4 -0
- package/src/types/images.d.ts +4 -0
- package/src/types.ts +168 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Config } from '@wagmi/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Auto-setup utilities for LUKSO products
|
|
5
|
+
*
|
|
6
|
+
* Provides zero-config setup for:
|
|
7
|
+
* - Embedded Wallet (passkey-based)
|
|
8
|
+
* - UP Extension (browser extension)
|
|
9
|
+
* - UP Mobile (WalletConnect)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Embedded wallet constants
|
|
14
|
+
*/
|
|
15
|
+
declare const EMBEDDED_WALLET_ID = "dev.lukso.auth";
|
|
16
|
+
declare const EMBEDDED_WALLET_URL_DEV = "http://localhost:9100";
|
|
17
|
+
declare const EMBEDDED_WALLET_URL_PROD = "https://auth-simple.pages.dev";
|
|
18
|
+
/**
|
|
19
|
+
* UP Extension ID
|
|
20
|
+
*/
|
|
21
|
+
declare const UP_EXTENSION_ID = "cloud.universalprofile";
|
|
22
|
+
interface LuksoConnectorConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Embedded wallet configuration
|
|
25
|
+
*/
|
|
26
|
+
embeddedWallet?: {
|
|
27
|
+
/**
|
|
28
|
+
* Enable embedded wallet option (default: true)
|
|
29
|
+
*/
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* URL to the wallet service
|
|
33
|
+
* @default 'http://localhost:9100'
|
|
34
|
+
*/
|
|
35
|
+
url?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Storage key for UP Provider state
|
|
38
|
+
* @default 'up-provider'
|
|
39
|
+
*/
|
|
40
|
+
storageKey?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Display name for the wallet
|
|
43
|
+
* @default 'Create Passkey Wallet'
|
|
44
|
+
*/
|
|
45
|
+
name?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* WalletConnect configuration for mobile app
|
|
49
|
+
*/
|
|
50
|
+
walletConnect?: {
|
|
51
|
+
/**
|
|
52
|
+
* Enable WalletConnect (default: true)
|
|
53
|
+
*/
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* WalletConnect Project ID
|
|
57
|
+
* @default LUKSO's default project ID
|
|
58
|
+
*/
|
|
59
|
+
projectId?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Show QR code modal on mobile devices (default: false)
|
|
62
|
+
*/
|
|
63
|
+
showQrModal?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Chain configuration
|
|
67
|
+
*/
|
|
68
|
+
chains?: {
|
|
69
|
+
/**
|
|
70
|
+
* Default chain ID
|
|
71
|
+
* @default 42 (LUKSO mainnet)
|
|
72
|
+
*/
|
|
73
|
+
defaultChainId?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Enable testnet (default: true)
|
|
76
|
+
*/
|
|
77
|
+
enableTestnet?: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Storage configuration
|
|
81
|
+
*/
|
|
82
|
+
storage?: {
|
|
83
|
+
/**
|
|
84
|
+
* Storage key prefix for wagmi state
|
|
85
|
+
* @default 'up-wagmi'
|
|
86
|
+
*/
|
|
87
|
+
key?: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Pass an existing wagmi config instead of auto-creating one
|
|
91
|
+
*/
|
|
92
|
+
wagmiConfig?: any;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Auto-setup LUKSO connector with sensible defaults
|
|
96
|
+
*
|
|
97
|
+
* This function creates a wagmi config and sets up the connect modal
|
|
98
|
+
* with support for:
|
|
99
|
+
* - Embedded Wallet (passkey-based)
|
|
100
|
+
* - UP Extension (auto-detected via EIP-6963)
|
|
101
|
+
* - UP Mobile (WalletConnect)
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* // Zero config - uses all defaults
|
|
106
|
+
* setupLuksoConnector()
|
|
107
|
+
*
|
|
108
|
+
* // Custom configuration
|
|
109
|
+
* setupLuksoConnector({
|
|
110
|
+
* embeddedWallet: {
|
|
111
|
+
* url: 'https://wallet.example.com'
|
|
112
|
+
* },
|
|
113
|
+
* chains: {
|
|
114
|
+
* defaultChainId: 4201 // LUKSO Testnet
|
|
115
|
+
* }
|
|
116
|
+
* })
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function setupLuksoConnector(config?: LuksoConnectorConfig): Promise<{
|
|
120
|
+
wagmiConfig: Config;
|
|
121
|
+
}>;
|
|
122
|
+
|
|
123
|
+
export { EMBEDDED_WALLET_ID, EMBEDDED_WALLET_URL_DEV, EMBEDDED_WALLET_URL_PROD, type LuksoConnectorConfig, UP_EXTENSION_ID, setupLuksoConnector };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMBEDDED_WALLET_ID,
|
|
3
|
+
EMBEDDED_WALLET_URL_DEV,
|
|
4
|
+
EMBEDDED_WALLET_URL_PROD,
|
|
5
|
+
UP_EXTENSION_ID,
|
|
6
|
+
setupLuksoConnector
|
|
7
|
+
} from "./chunk-6AYZOIFY.js";
|
|
8
|
+
import "./chunk-NXU2DQAV.js";
|
|
9
|
+
import "./chunk-EUXUH3YW.js";
|
|
10
|
+
export {
|
|
11
|
+
EMBEDDED_WALLET_ID,
|
|
12
|
+
EMBEDDED_WALLET_URL_DEV,
|
|
13
|
+
EMBEDDED_WALLET_URL_PROD,
|
|
14
|
+
UP_EXTENSION_ID,
|
|
15
|
+
setupLuksoConnector
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=auto-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for UP Connector
|
|
3
|
+
*/
|
|
4
|
+
type AddressData = {
|
|
5
|
+
address: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
lsp4TokenName?: string;
|
|
8
|
+
lsp4TokenSymbol?: string;
|
|
9
|
+
baseAsset?: {
|
|
10
|
+
lsp4TokenName?: string;
|
|
11
|
+
lsp4TokenSymbol?: string;
|
|
12
|
+
};
|
|
13
|
+
profileImages?: any[];
|
|
14
|
+
avatar?: any[];
|
|
15
|
+
icon?: any[];
|
|
16
|
+
images?: any[];
|
|
17
|
+
__gqltype?: string;
|
|
18
|
+
__identity?: string;
|
|
19
|
+
identity?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Avatar configuration options
|
|
23
|
+
*/
|
|
24
|
+
interface AvatarOptions {
|
|
25
|
+
address?: string;
|
|
26
|
+
resolved?: AddressData;
|
|
27
|
+
size?: 'x-small' | 'small' | 'medium' | 'large' | 'auto';
|
|
28
|
+
label?: string;
|
|
29
|
+
chainId?: number;
|
|
30
|
+
forceUnresolved?: boolean;
|
|
31
|
+
fallbackColor?: string;
|
|
32
|
+
fallbackText?: string;
|
|
33
|
+
fallbackImage?: string;
|
|
34
|
+
avatarSize?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | '2x-large';
|
|
35
|
+
initialPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
36
|
+
hideThreshold?: number;
|
|
37
|
+
hideOffset?: number;
|
|
38
|
+
transitionDuration?: string;
|
|
39
|
+
transitionEasing?: string;
|
|
40
|
+
container?: HTMLElement;
|
|
41
|
+
componentLoader?: () => Promise<boolean>;
|
|
42
|
+
onPositionChange?: (position: string) => void;
|
|
43
|
+
onHide?: () => void;
|
|
44
|
+
onShow?: () => void;
|
|
45
|
+
onClick?: (event: MouseEvent, data: {
|
|
46
|
+
address?: string;
|
|
47
|
+
resolved?: AddressData;
|
|
48
|
+
}) => void;
|
|
49
|
+
onAddressClick?: (event: CustomEvent) => void;
|
|
50
|
+
onTransactionStart?: () => void;
|
|
51
|
+
onTransactionComplete?: () => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Connection state
|
|
55
|
+
*/
|
|
56
|
+
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
57
|
+
/**
|
|
58
|
+
* Wallet provider information
|
|
59
|
+
*/
|
|
60
|
+
interface WalletProvider {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
isInstalled: boolean;
|
|
66
|
+
isRecommended?: boolean;
|
|
67
|
+
downloadUrl?: string;
|
|
68
|
+
connect: () => Promise<{
|
|
69
|
+
address: string;
|
|
70
|
+
provider: any;
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Connection modal options
|
|
75
|
+
* @deprecated Legacy modal options - no longer used by ConnectModal (Lit component)
|
|
76
|
+
* The Lit-based ConnectModal is configured globally via setupConnectModal()
|
|
77
|
+
* and controlled via the `open` property. These options are kept for
|
|
78
|
+
* backwards compatibility but have no effect.
|
|
79
|
+
*/
|
|
80
|
+
interface ModalOptions {
|
|
81
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
82
|
+
borderRadius?: number;
|
|
83
|
+
closeOnBackdrop?: boolean;
|
|
84
|
+
closeOnEscape?: boolean;
|
|
85
|
+
showCloseButton?: boolean;
|
|
86
|
+
animationDuration?: number;
|
|
87
|
+
animationEasing?: string;
|
|
88
|
+
animateFrom?: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
};
|
|
94
|
+
providers?: string[];
|
|
95
|
+
hideProviders?: string[];
|
|
96
|
+
onConnect?: (result: {
|
|
97
|
+
address: string;
|
|
98
|
+
provider: any;
|
|
99
|
+
}) => void;
|
|
100
|
+
onDisconnect?: () => void;
|
|
101
|
+
onClose?: () => void;
|
|
102
|
+
onProviderClick?: (provider: WalletProvider) => void;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* UP Connector configuration
|
|
106
|
+
*/
|
|
107
|
+
interface ConnectorConfig {
|
|
108
|
+
avatar?: AvatarOptions;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Legacy modal configuration - no longer used
|
|
111
|
+
* Use setupConnectModal() globally to configure the Lit-based ConnectModal
|
|
112
|
+
* @see setupConnectModal
|
|
113
|
+
*/
|
|
114
|
+
modal?: ModalOptions;
|
|
115
|
+
autoConnect?: boolean;
|
|
116
|
+
persistConnection?: boolean;
|
|
117
|
+
storageKey?: string;
|
|
118
|
+
chainId?: number;
|
|
119
|
+
rpcUrl?: string;
|
|
120
|
+
onConnectionChange?: (state: ConnectionState, data?: any) => void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Draggable Avatar Component for UP Connector
|
|
125
|
+
* Integrates with @lukso/transaction-view-core IconView
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
declare class DraggableAvatar {
|
|
129
|
+
private options;
|
|
130
|
+
private overlay;
|
|
131
|
+
private element;
|
|
132
|
+
private iconViewElement?;
|
|
133
|
+
private snapPreviews;
|
|
134
|
+
private isDragging;
|
|
135
|
+
private hasDragged;
|
|
136
|
+
private startX;
|
|
137
|
+
private startY;
|
|
138
|
+
private initialX;
|
|
139
|
+
private initialY;
|
|
140
|
+
private dragThreshold;
|
|
141
|
+
/**
|
|
142
|
+
* Convert size name to pixel value
|
|
143
|
+
* Based on Tailwind classes: x-small=24px, small=40px, medium=56px, large=80px, x-large=96px, 2x-large=120px
|
|
144
|
+
*/
|
|
145
|
+
private getPixelSize;
|
|
146
|
+
/**
|
|
147
|
+
* Get identicon overhang for a given profile size
|
|
148
|
+
* The identicon hangs off the bottom-right corner by half its size
|
|
149
|
+
*/
|
|
150
|
+
private getIdenticonOverhang;
|
|
151
|
+
private currentPosition?;
|
|
152
|
+
private isHidden;
|
|
153
|
+
private iconViewAvailable;
|
|
154
|
+
private isThrobbing;
|
|
155
|
+
private throbAnimation?;
|
|
156
|
+
constructor(options?: AvatarOptions);
|
|
157
|
+
private init;
|
|
158
|
+
/**
|
|
159
|
+
* Safely check for and load IconView component
|
|
160
|
+
*/
|
|
161
|
+
private checkIconViewAvailability;
|
|
162
|
+
private createStyles;
|
|
163
|
+
private createElement;
|
|
164
|
+
private createContent;
|
|
165
|
+
private createFallbackContent;
|
|
166
|
+
private attachEventListeners;
|
|
167
|
+
private getSnapPositions;
|
|
168
|
+
private findClosestSnapPosition;
|
|
169
|
+
private setInitialPosition;
|
|
170
|
+
private snapToPosition;
|
|
171
|
+
private showAllSnapPreviews;
|
|
172
|
+
private updateActiveSnapPreview;
|
|
173
|
+
private hideAllSnapPreviews;
|
|
174
|
+
private handleMouseDown;
|
|
175
|
+
private handleMouseMove;
|
|
176
|
+
private handleMouseUp;
|
|
177
|
+
private handleTouchStart;
|
|
178
|
+
private handleTouchMove;
|
|
179
|
+
private handleTouchEnd;
|
|
180
|
+
private handleClick;
|
|
181
|
+
private handleResize;
|
|
182
|
+
setPosition(positionName: string): void;
|
|
183
|
+
hide(): void;
|
|
184
|
+
show(): void;
|
|
185
|
+
setConnected(connected: boolean): void;
|
|
186
|
+
updateAddress(address: string, resolved?: AddressData, chainId?: number): void;
|
|
187
|
+
updateResolved(resolved: AddressData): void;
|
|
188
|
+
updateSize(newSize: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | '2x-large'): void;
|
|
189
|
+
getElement(): HTMLElement | null;
|
|
190
|
+
getPosition(): {
|
|
191
|
+
x: number;
|
|
192
|
+
y: number;
|
|
193
|
+
name: string;
|
|
194
|
+
} | null;
|
|
195
|
+
startThrob(): void;
|
|
196
|
+
stopThrob(): void;
|
|
197
|
+
getAvatarRect(): DOMRect | null;
|
|
198
|
+
destroy(): void;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Factory function for creating draggable avatars
|
|
202
|
+
*/
|
|
203
|
+
declare function createAvatar(options?: AvatarOptions): Promise<DraggableAvatar>;
|
|
204
|
+
|
|
205
|
+
export { type AddressData as A, type ConnectorConfig as C, DraggableAvatar as D, type WalletProvider as W, type ConnectionState as a, type AvatarOptions as b, createAvatar as c };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for UP Connector
|
|
3
|
+
*/
|
|
4
|
+
type AddressData = {
|
|
5
|
+
address: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
lsp4TokenName?: string;
|
|
8
|
+
lsp4TokenSymbol?: string;
|
|
9
|
+
baseAsset?: {
|
|
10
|
+
lsp4TokenName?: string;
|
|
11
|
+
lsp4TokenSymbol?: string;
|
|
12
|
+
};
|
|
13
|
+
profileImages?: any[];
|
|
14
|
+
avatar?: any[];
|
|
15
|
+
icon?: any[];
|
|
16
|
+
images?: any[];
|
|
17
|
+
__gqltype?: string;
|
|
18
|
+
__identity?: string;
|
|
19
|
+
identity?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Avatar configuration options
|
|
23
|
+
*/
|
|
24
|
+
interface AvatarOptions {
|
|
25
|
+
address?: string;
|
|
26
|
+
resolved?: AddressData;
|
|
27
|
+
size?: 'x-small' | 'small' | 'medium' | 'large' | 'auto';
|
|
28
|
+
label?: string;
|
|
29
|
+
chainId?: number;
|
|
30
|
+
forceUnresolved?: boolean;
|
|
31
|
+
fallbackColor?: string;
|
|
32
|
+
fallbackText?: string;
|
|
33
|
+
fallbackImage?: string;
|
|
34
|
+
avatarSize?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | '2x-large';
|
|
35
|
+
initialPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
36
|
+
hideThreshold?: number;
|
|
37
|
+
hideOffset?: number;
|
|
38
|
+
transitionDuration?: string;
|
|
39
|
+
transitionEasing?: string;
|
|
40
|
+
container?: HTMLElement;
|
|
41
|
+
componentLoader?: () => Promise<boolean>;
|
|
42
|
+
onPositionChange?: (position: string) => void;
|
|
43
|
+
onHide?: () => void;
|
|
44
|
+
onShow?: () => void;
|
|
45
|
+
onClick?: (event: MouseEvent, data: {
|
|
46
|
+
address?: string;
|
|
47
|
+
resolved?: AddressData;
|
|
48
|
+
}) => void;
|
|
49
|
+
onAddressClick?: (event: CustomEvent) => void;
|
|
50
|
+
onTransactionStart?: () => void;
|
|
51
|
+
onTransactionComplete?: () => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Connection state
|
|
55
|
+
*/
|
|
56
|
+
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
57
|
+
/**
|
|
58
|
+
* Wallet provider information
|
|
59
|
+
*/
|
|
60
|
+
interface WalletProvider {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
isInstalled: boolean;
|
|
66
|
+
isRecommended?: boolean;
|
|
67
|
+
downloadUrl?: string;
|
|
68
|
+
connect: () => Promise<{
|
|
69
|
+
address: string;
|
|
70
|
+
provider: any;
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Connection modal options
|
|
75
|
+
* @deprecated Legacy modal options - no longer used by ConnectModal (Lit component)
|
|
76
|
+
* The Lit-based ConnectModal is configured globally via setupConnectModal()
|
|
77
|
+
* and controlled via the `open` property. These options are kept for
|
|
78
|
+
* backwards compatibility but have no effect.
|
|
79
|
+
*/
|
|
80
|
+
interface ModalOptions {
|
|
81
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
82
|
+
borderRadius?: number;
|
|
83
|
+
closeOnBackdrop?: boolean;
|
|
84
|
+
closeOnEscape?: boolean;
|
|
85
|
+
showCloseButton?: boolean;
|
|
86
|
+
animationDuration?: number;
|
|
87
|
+
animationEasing?: string;
|
|
88
|
+
animateFrom?: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
};
|
|
94
|
+
providers?: string[];
|
|
95
|
+
hideProviders?: string[];
|
|
96
|
+
onConnect?: (result: {
|
|
97
|
+
address: string;
|
|
98
|
+
provider: any;
|
|
99
|
+
}) => void;
|
|
100
|
+
onDisconnect?: () => void;
|
|
101
|
+
onClose?: () => void;
|
|
102
|
+
onProviderClick?: (provider: WalletProvider) => void;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* UP Connector configuration
|
|
106
|
+
*/
|
|
107
|
+
interface ConnectorConfig {
|
|
108
|
+
avatar?: AvatarOptions;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Legacy modal configuration - no longer used
|
|
111
|
+
* Use setupConnectModal() globally to configure the Lit-based ConnectModal
|
|
112
|
+
* @see setupConnectModal
|
|
113
|
+
*/
|
|
114
|
+
modal?: ModalOptions;
|
|
115
|
+
autoConnect?: boolean;
|
|
116
|
+
persistConnection?: boolean;
|
|
117
|
+
storageKey?: string;
|
|
118
|
+
chainId?: number;
|
|
119
|
+
rpcUrl?: string;
|
|
120
|
+
onConnectionChange?: (state: ConnectionState, data?: any) => void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Draggable Avatar Component for UP Connector
|
|
125
|
+
* Integrates with @lukso/transaction-view-core IconView
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
declare class DraggableAvatar {
|
|
129
|
+
private options;
|
|
130
|
+
private overlay;
|
|
131
|
+
private element;
|
|
132
|
+
private iconViewElement?;
|
|
133
|
+
private snapPreviews;
|
|
134
|
+
private isDragging;
|
|
135
|
+
private hasDragged;
|
|
136
|
+
private startX;
|
|
137
|
+
private startY;
|
|
138
|
+
private initialX;
|
|
139
|
+
private initialY;
|
|
140
|
+
private dragThreshold;
|
|
141
|
+
/**
|
|
142
|
+
* Convert size name to pixel value
|
|
143
|
+
* Based on Tailwind classes: x-small=24px, small=40px, medium=56px, large=80px, x-large=96px, 2x-large=120px
|
|
144
|
+
*/
|
|
145
|
+
private getPixelSize;
|
|
146
|
+
/**
|
|
147
|
+
* Get identicon overhang for a given profile size
|
|
148
|
+
* The identicon hangs off the bottom-right corner by half its size
|
|
149
|
+
*/
|
|
150
|
+
private getIdenticonOverhang;
|
|
151
|
+
private currentPosition?;
|
|
152
|
+
private isHidden;
|
|
153
|
+
private iconViewAvailable;
|
|
154
|
+
private isThrobbing;
|
|
155
|
+
private throbAnimation?;
|
|
156
|
+
constructor(options?: AvatarOptions);
|
|
157
|
+
private init;
|
|
158
|
+
/**
|
|
159
|
+
* Safely check for and load IconView component
|
|
160
|
+
*/
|
|
161
|
+
private checkIconViewAvailability;
|
|
162
|
+
private createStyles;
|
|
163
|
+
private createElement;
|
|
164
|
+
private createContent;
|
|
165
|
+
private createFallbackContent;
|
|
166
|
+
private attachEventListeners;
|
|
167
|
+
private getSnapPositions;
|
|
168
|
+
private findClosestSnapPosition;
|
|
169
|
+
private setInitialPosition;
|
|
170
|
+
private snapToPosition;
|
|
171
|
+
private showAllSnapPreviews;
|
|
172
|
+
private updateActiveSnapPreview;
|
|
173
|
+
private hideAllSnapPreviews;
|
|
174
|
+
private handleMouseDown;
|
|
175
|
+
private handleMouseMove;
|
|
176
|
+
private handleMouseUp;
|
|
177
|
+
private handleTouchStart;
|
|
178
|
+
private handleTouchMove;
|
|
179
|
+
private handleTouchEnd;
|
|
180
|
+
private handleClick;
|
|
181
|
+
private handleResize;
|
|
182
|
+
setPosition(positionName: string): void;
|
|
183
|
+
hide(): void;
|
|
184
|
+
show(): void;
|
|
185
|
+
setConnected(connected: boolean): void;
|
|
186
|
+
updateAddress(address: string, resolved?: AddressData, chainId?: number): void;
|
|
187
|
+
updateResolved(resolved: AddressData): void;
|
|
188
|
+
updateSize(newSize: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | '2x-large'): void;
|
|
189
|
+
getElement(): HTMLElement | null;
|
|
190
|
+
getPosition(): {
|
|
191
|
+
x: number;
|
|
192
|
+
y: number;
|
|
193
|
+
name: string;
|
|
194
|
+
} | null;
|
|
195
|
+
startThrob(): void;
|
|
196
|
+
stopThrob(): void;
|
|
197
|
+
getAvatarRect(): DOMRect | null;
|
|
198
|
+
destroy(): void;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Factory function for creating draggable avatars
|
|
202
|
+
*/
|
|
203
|
+
declare function createAvatar(options?: AvatarOptions): Promise<DraggableAvatar>;
|
|
204
|
+
|
|
205
|
+
export { type AddressData as A, type ConnectorConfig as C, DraggableAvatar as D, type WalletProvider as W, type ConnectionState as a, type AvatarOptions as b, createAvatar as c };
|
package/dist/avatar.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkORJK2YGGcjs = require('./chunk-ORJK2YGG.cjs');
|
|
6
|
+
require('./chunk-ZBDE64SD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.DraggableAvatar = _chunkORJK2YGGcjs.DraggableAvatar; exports.createAvatar = _chunkORJK2YGGcjs.createAvatar; exports.default = _chunkORJK2YGGcjs.avatar_default;
|
|
12
|
+
//# sourceMappingURL=avatar.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/service-auth-simple/service-auth-simple/packages/up-connector/dist/avatar.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,uKAAC","file":"/home/runner/work/service-auth-simple/service-auth-simple/packages/up-connector/dist/avatar.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { D as DraggableAvatar, c as createAvatar, D as default } from './avatar-CmUCtW_w.cjs';
|
package/dist/avatar.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { D as DraggableAvatar, c as createAvatar, D as default } from './avatar-CmUCtW_w.js';
|
package/dist/avatar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk7ETKG6KRcjs = require('./chunk-7ETKG6KR.cjs');
|
|
4
|
+
require('./chunk-XOKG3KIL.cjs');
|
|
5
|
+
require('./chunk-ZBDE64SD.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.BackupModal = _chunk7ETKG6KRcjs.BackupModal;
|
|
9
|
+
//# sourceMappingURL=backup-modal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/service-auth-simple/service-auth-simple/packages/up-connector/dist/backup-modal.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,oDAAC","file":"/home/runner/work/service-auth-simple/service-auth-simple/packages/up-connector/dist/backup-modal.cjs"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { BackupFile } from '@lukso/passkey-auth';
|
|
3
|
+
import { C as CoreLitElement } from './index-D2orHGFi.cjs';
|
|
4
|
+
|
|
5
|
+
declare class BackupModal extends CoreLitElement {
|
|
6
|
+
open: boolean;
|
|
7
|
+
theme: 'light' | 'dark' | 'auto';
|
|
8
|
+
private currentStep;
|
|
9
|
+
private useEncryption;
|
|
10
|
+
private password;
|
|
11
|
+
private passwordConfirm;
|
|
12
|
+
private passwordErrors;
|
|
13
|
+
private isCreatingBackup;
|
|
14
|
+
private generatedBackup;
|
|
15
|
+
/**
|
|
16
|
+
* Public method for parent to set backup result
|
|
17
|
+
* Called after parent handles the 'create' event
|
|
18
|
+
*/
|
|
19
|
+
setBackupResult(backupFile: BackupFile | null, options?: {
|
|
20
|
+
error?: string;
|
|
21
|
+
}): void;
|
|
22
|
+
render(): lit.TemplateResult<1>;
|
|
23
|
+
private renderStep;
|
|
24
|
+
private renderChoiceStep;
|
|
25
|
+
private renderPasswordStep;
|
|
26
|
+
private renderDownloadStep;
|
|
27
|
+
private getStepTitle;
|
|
28
|
+
private selectBackupType;
|
|
29
|
+
private createBackup;
|
|
30
|
+
private handleDownload;
|
|
31
|
+
private goBack;
|
|
32
|
+
private close;
|
|
33
|
+
private calculatePasswordStrength;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'backup-modal': BackupModal;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { BackupModal };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { BackupFile } from '@lukso/passkey-auth';
|
|
3
|
+
import { C as CoreLitElement } from './index-D2orHGFi.js';
|
|
4
|
+
|
|
5
|
+
declare class BackupModal extends CoreLitElement {
|
|
6
|
+
open: boolean;
|
|
7
|
+
theme: 'light' | 'dark' | 'auto';
|
|
8
|
+
private currentStep;
|
|
9
|
+
private useEncryption;
|
|
10
|
+
private password;
|
|
11
|
+
private passwordConfirm;
|
|
12
|
+
private passwordErrors;
|
|
13
|
+
private isCreatingBackup;
|
|
14
|
+
private generatedBackup;
|
|
15
|
+
/**
|
|
16
|
+
* Public method for parent to set backup result
|
|
17
|
+
* Called after parent handles the 'create' event
|
|
18
|
+
*/
|
|
19
|
+
setBackupResult(backupFile: BackupFile | null, options?: {
|
|
20
|
+
error?: string;
|
|
21
|
+
}): void;
|
|
22
|
+
render(): lit.TemplateResult<1>;
|
|
23
|
+
private renderStep;
|
|
24
|
+
private renderChoiceStep;
|
|
25
|
+
private renderPasswordStep;
|
|
26
|
+
private renderDownloadStep;
|
|
27
|
+
private getStepTitle;
|
|
28
|
+
private selectBackupType;
|
|
29
|
+
private createBackup;
|
|
30
|
+
private handleDownload;
|
|
31
|
+
private goBack;
|
|
32
|
+
private close;
|
|
33
|
+
private calculatePasswordStrength;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'backup-modal': BackupModal;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { BackupModal };
|