@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.
Files changed (109) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +280 -0
  3. package/dist/account-modal.cjs +9 -0
  4. package/dist/account-modal.cjs.map +1 -0
  5. package/dist/account-modal.d.cts +16 -0
  6. package/dist/account-modal.d.ts +16 -0
  7. package/dist/account-modal.js +9 -0
  8. package/dist/account-modal.js.map +1 -0
  9. package/dist/auto-setup.cjs +17 -0
  10. package/dist/auto-setup.cjs.map +1 -0
  11. package/dist/auto-setup.d.cts +123 -0
  12. package/dist/auto-setup.d.ts +123 -0
  13. package/dist/auto-setup.js +17 -0
  14. package/dist/auto-setup.js.map +1 -0
  15. package/dist/avatar-CmUCtW_w.d.cts +205 -0
  16. package/dist/avatar-CmUCtW_w.d.ts +205 -0
  17. package/dist/avatar.cjs +12 -0
  18. package/dist/avatar.cjs.map +1 -0
  19. package/dist/avatar.d.cts +1 -0
  20. package/dist/avatar.d.ts +1 -0
  21. package/dist/avatar.js +12 -0
  22. package/dist/avatar.js.map +1 -0
  23. package/dist/backup-modal.cjs +9 -0
  24. package/dist/backup-modal.cjs.map +1 -0
  25. package/dist/backup-modal.d.cts +41 -0
  26. package/dist/backup-modal.d.ts +41 -0
  27. package/dist/backup-modal.js +9 -0
  28. package/dist/backup-modal.js.map +1 -0
  29. package/dist/chunk-3SGSPHOZ.js +595 -0
  30. package/dist/chunk-3SGSPHOZ.js.map +1 -0
  31. package/dist/chunk-6AYZOIFY.js +181 -0
  32. package/dist/chunk-6AYZOIFY.js.map +1 -0
  33. package/dist/chunk-6N35TCFT.js +852 -0
  34. package/dist/chunk-6N35TCFT.js.map +1 -0
  35. package/dist/chunk-7ETKG6KR.cjs +387 -0
  36. package/dist/chunk-7ETKG6KR.cjs.map +1 -0
  37. package/dist/chunk-EUXUH3YW.js +15 -0
  38. package/dist/chunk-EUXUH3YW.js.map +1 -0
  39. package/dist/chunk-GFVUWAG4.cjs +158 -0
  40. package/dist/chunk-GFVUWAG4.cjs.map +1 -0
  41. package/dist/chunk-IAKQFHFD.cjs +595 -0
  42. package/dist/chunk-IAKQFHFD.cjs.map +1 -0
  43. package/dist/chunk-MH7MP7XK.cjs +181 -0
  44. package/dist/chunk-MH7MP7XK.cjs.map +1 -0
  45. package/dist/chunk-NWCNJSG3.js +387 -0
  46. package/dist/chunk-NWCNJSG3.js.map +1 -0
  47. package/dist/chunk-NXU2DQAV.js +1128 -0
  48. package/dist/chunk-NXU2DQAV.js.map +1 -0
  49. package/dist/chunk-ORJK2YGG.cjs +852 -0
  50. package/dist/chunk-ORJK2YGG.cjs.map +1 -0
  51. package/dist/chunk-RFA6SEIS.cjs +1128 -0
  52. package/dist/chunk-RFA6SEIS.cjs.map +1 -0
  53. package/dist/chunk-XGIT7YUY.js +31 -0
  54. package/dist/chunk-XGIT7YUY.js.map +1 -0
  55. package/dist/chunk-XOKG3KIL.cjs +31 -0
  56. package/dist/chunk-XOKG3KIL.cjs.map +1 -0
  57. package/dist/chunk-YIWSPI4I.js +158 -0
  58. package/dist/chunk-YIWSPI4I.js.map +1 -0
  59. package/dist/chunk-ZBDE64SD.cjs +15 -0
  60. package/dist/chunk-ZBDE64SD.cjs.map +1 -0
  61. package/dist/connect-modal/index.cjs +20 -0
  62. package/dist/connect-modal/index.cjs.map +1 -0
  63. package/dist/connect-modal/index.d.cts +9 -0
  64. package/dist/connect-modal/index.d.ts +9 -0
  65. package/dist/connect-modal/index.js +20 -0
  66. package/dist/connect-modal/index.js.map +1 -0
  67. package/dist/index-D2orHGFi.d.cts +8 -0
  68. package/dist/index-D2orHGFi.d.ts +8 -0
  69. package/dist/index.cjs +793 -0
  70. package/dist/index.cjs.map +1 -0
  71. package/dist/index.d.cts +189 -0
  72. package/dist/index.d.ts +189 -0
  73. package/dist/index.js +793 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/restore-modal.cjs +9 -0
  76. package/dist/restore-modal.cjs.map +1 -0
  77. package/dist/restore-modal.d.cts +68 -0
  78. package/dist/restore-modal.d.ts +68 -0
  79. package/dist/restore-modal.js +9 -0
  80. package/dist/restore-modal.js.map +1 -0
  81. package/dist/wagmi-CVuDs_0h.d.cts +386 -0
  82. package/dist/wagmi-CVuDs_0h.d.ts +386 -0
  83. package/package.json +158 -0
  84. package/src/account-modal.ts +142 -0
  85. package/src/auto-setup.ts +362 -0
  86. package/src/avatar.ts +1135 -0
  87. package/src/backup-modal.ts +439 -0
  88. package/src/connect-modal/components/connection-view.ts +398 -0
  89. package/src/connect-modal/components/eoa-connection-view.ts +408 -0
  90. package/src/connect-modal/components/qr-code-view.ts +71 -0
  91. package/src/connect-modal/connect-modal.base.ts +18 -0
  92. package/src/connect-modal/connect-modal.config.ts +27 -0
  93. package/src/connect-modal/connect-modal.templates.ts +21 -0
  94. package/src/connect-modal/connect-modal.ts +270 -0
  95. package/src/connect-modal/connect-modal.types.ts +104 -0
  96. package/src/connect-modal/images/up-cube-glass.png +0 -0
  97. package/src/connect-modal/index.ts +23 -0
  98. package/src/connect-modal/services/wagmi.ts +266 -0
  99. package/src/connect-modal/styles/styles.css +1 -0
  100. package/src/connect-modal/utils/walletConnectDeepLinkUrl.ts +43 -0
  101. package/src/connector.ts +544 -0
  102. package/src/index.ts +62 -0
  103. package/src/popup-instance.ts +537 -0
  104. package/src/restore-modal.ts +702 -0
  105. package/src/styles/index.ts +28 -0
  106. package/src/styles/styles.css +1 -0
  107. package/src/types/css-raw.d.ts +4 -0
  108. package/src/types/images.d.ts +4 -0
  109. package/src/types.ts +168 -0
@@ -0,0 +1,28 @@
1
+ // Export the built CSS as a string for components that need to inject styles
2
+ // Tailwind + web-components CSS is compiled into this file by our PostCSS pipeline
3
+ // esbuild-raw-plugin ensures importing CSS returns its raw contents as a string
4
+
5
+ import { css, LitElement, unsafeCSS } from 'lit'
6
+
7
+ import output from './styles.css?raw'
8
+
9
+ const style = css`
10
+ ${unsafeCSS(output)}
11
+
12
+ :host([is-inline]) {
13
+ display: inline-flex;
14
+ align-items: center;
15
+ }
16
+
17
+ :host([is-full-width]) {
18
+ width: 100%;
19
+ flex: 1;
20
+ display: flex;
21
+ }
22
+ `
23
+
24
+ export class CoreLitElement extends LitElement {
25
+ static styles = [style]
26
+ }
27
+
28
+ export default style
@@ -0,0 +1 @@
1
+ @import "@lukso/web-components/dist/styles/main.css";
@@ -0,0 +1,4 @@
1
+ declare module '*.css?raw' {
2
+ const content: string
3
+ export default content
4
+ }
@@ -0,0 +1,4 @@
1
+ declare module '*.png' {
2
+ const content: string
3
+ export default content
4
+ }
package/src/types.ts ADDED
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Core types for UP Connector
3
+ */
4
+
5
+ // Re-export AddressData from transaction-view-core if available
6
+ export type AddressData = {
7
+ address: string
8
+ name?: string
9
+ lsp4TokenName?: string
10
+ lsp4TokenSymbol?: string
11
+ baseAsset?: {
12
+ lsp4TokenName?: string
13
+ lsp4TokenSymbol?: string
14
+ }
15
+ profileImages?: any[]
16
+ avatar?: any[]
17
+ icon?: any[]
18
+ images?: any[]
19
+ __gqltype?: string
20
+ __identity?: string
21
+ identity?: string
22
+ }
23
+
24
+ /**
25
+ * Avatar configuration options
26
+ */
27
+ export interface AvatarOptions {
28
+ // IconView integration options
29
+ address?: string
30
+ resolved?: AddressData
31
+ size?: 'x-small' | 'small' | 'medium' | 'large' | 'auto'
32
+ label?: string
33
+ chainId?: number // Network to resolve address on (42 = mainnet, 4201 = testnet)
34
+ forceUnresolved?: boolean
35
+
36
+ // Fallback options (when not using IconView)
37
+ fallbackColor?: string
38
+ fallbackText?: string
39
+ fallbackImage?: string
40
+
41
+ // Avatar container options - aligned with IconView sizes
42
+ avatarSize?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | '2x-large'
43
+
44
+ // Behavior options
45
+ initialPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
46
+ hideThreshold?: number
47
+ hideOffset?: number
48
+
49
+ // Animation options
50
+ transitionDuration?: string
51
+ transitionEasing?: string
52
+
53
+ // Container
54
+ container?: HTMLElement
55
+
56
+ // Component loading
57
+ componentLoader?: () => Promise<boolean>
58
+
59
+ // Callbacks
60
+ onPositionChange?: (position: string) => void
61
+ onHide?: () => void
62
+ onShow?: () => void
63
+ onClick?: (
64
+ event: MouseEvent,
65
+ data: { address?: string; resolved?: AddressData }
66
+ ) => void
67
+ onAddressClick?: (event: CustomEvent) => void
68
+ onTransactionStart?: () => void
69
+ onTransactionComplete?: () => void
70
+ }
71
+
72
+ /**
73
+ * Connection state
74
+ */
75
+ export type ConnectionState =
76
+ | 'disconnected'
77
+ | 'connecting'
78
+ | 'connected'
79
+ | 'error'
80
+
81
+ /**
82
+ * Wallet provider information
83
+ */
84
+ export interface WalletProvider {
85
+ id: string
86
+ name: string
87
+ icon: string
88
+ description?: string
89
+ isInstalled: boolean
90
+ isRecommended?: boolean
91
+ downloadUrl?: string
92
+ connect: () => Promise<{ address: string; provider: any }>
93
+ }
94
+
95
+ /**
96
+ * Connection modal options
97
+ * @deprecated Legacy modal options - no longer used by ConnectModal (Lit component)
98
+ * The Lit-based ConnectModal is configured globally via setupConnectModal()
99
+ * and controlled via the `open` property. These options are kept for
100
+ * backwards compatibility but have no effect.
101
+ */
102
+ export interface ModalOptions {
103
+ // Appearance
104
+ theme?: 'light' | 'dark' | 'auto'
105
+ borderRadius?: number
106
+
107
+ // Behavior
108
+ closeOnBackdrop?: boolean
109
+ closeOnEscape?: boolean
110
+ showCloseButton?: boolean
111
+
112
+ // Animation
113
+ animationDuration?: number
114
+ animationEasing?: string
115
+
116
+ // Modal positioning (for animation from avatar)
117
+ animateFrom?: {
118
+ x: number
119
+ y: number
120
+ width: number
121
+ height: number
122
+ }
123
+
124
+ // Wallet provider filtering
125
+ providers?: string[] // Provider IDs to show
126
+ hideProviders?: string[] // Provider IDs to hide
127
+
128
+ // Callbacks
129
+ onConnect?: (result: { address: string; provider: any }) => void
130
+ onDisconnect?: () => void
131
+ onClose?: () => void
132
+ onProviderClick?: (provider: WalletProvider) => void
133
+ }
134
+
135
+ /**
136
+ * UP Connector configuration
137
+ */
138
+ export interface ConnectorConfig {
139
+ // Avatar configuration
140
+ avatar?: AvatarOptions
141
+
142
+ // Modal configuration
143
+ /**
144
+ * @deprecated Legacy modal configuration - no longer used
145
+ * Use setupConnectModal() globally to configure the Lit-based ConnectModal
146
+ * @see setupConnectModal
147
+ */
148
+ modal?: ModalOptions
149
+
150
+ // Global settings
151
+ autoConnect?: boolean
152
+ persistConnection?: boolean
153
+ storageKey?: string
154
+
155
+ // Network settings
156
+ chainId?: number
157
+ rpcUrl?: string
158
+
159
+ // Callbacks
160
+ onConnectionChange?: (state: ConnectionState, data?: any) => void
161
+ }
162
+
163
+ // Re-export popup interfaces for convenience
164
+ export type {
165
+ PopupInstance,
166
+ PopupRequest,
167
+ UIDelegate,
168
+ } from './popup-instance.js'