@thenamespace/ens-components 0.37.0 → 0.38.0-alpha
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/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +83 -9
- package/dist/index.js +90405 -66374
- package/dist/index.js.map +1 -1
- package/dist/styles.js.map +1 -1
- package/dist/types/components/atoms/icon/Icon.d.ts +1 -1
- package/dist/types/components/ens-name-registration/ENSNameRegistrationForm.d.ts +5 -0
- package/dist/types/components/ens-name-registration/RegistrationSummary.d.ts +5 -0
- package/dist/types/components/ens-records-form/EnsRecordsForm.d.ts +2 -1
- package/dist/types/components/ens-records-form/EnsUpdateRecordsForm.d.ts +3 -1
- package/dist/types/components/molecules/modal/Modal.d.ts +9 -0
- package/dist/types/components/offchain-subname-form/OffchainSubnameForm.d.ts +2 -1
- package/dist/types/components/select-records-form/SelectRecordsForm.d.ts +7 -1
- package/dist/types/components/select-records-form/avatar-upload/AvatarUploadModal.d.ts +12 -0
- package/dist/types/components/select-records-form/avatar-upload/cropImage.d.ts +2 -0
- package/dist/types/components/select-records-form/header-upload/HeaderUploadModal.d.ts +12 -0
- package/dist/types/components/select-records-form/image-records/ImageRecords.d.ts +5 -1
- package/dist/types/components/select-records-form/image-upload/ImageUploadModal.d.ts +16 -0
- package/dist/types/components/select-records-form/text-records/TextRecords.d.ts +3 -1
- package/dist/types/components/subname-mint-form/SetSubnameRecords.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useAvatarClient.d.ts +19 -0
- package/dist/types/web3/index.d.ts +0 -1
- package/package.json +3 -21
- package/README.md +0 -1
- package/dist/types/web3/wallet-connect.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Address, Hash, ContractFunctionExecutionError, TransactionReceipt } from 'viem';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ReactNode
|
|
4
|
+
import React__default, { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
interface EnsRecords$1 {
|
|
7
7
|
addresses: EnsAddressRecord$1[];
|
|
@@ -61,12 +61,18 @@ declare enum ListingNetwork {
|
|
|
61
61
|
}
|
|
62
62
|
declare const getChainIdForListingNetwork: (network: ListingNetwork) => number;
|
|
63
63
|
|
|
64
|
+
interface AvatarUploadContext {
|
|
65
|
+
ensName: string;
|
|
66
|
+
isTestnet?: boolean;
|
|
67
|
+
siweDomain?: string;
|
|
68
|
+
}
|
|
64
69
|
interface SelectRecordsFormProps {
|
|
65
70
|
records: EnsRecords$1;
|
|
66
71
|
onRecordsUpdated: (records: EnsRecords$1) => void;
|
|
67
72
|
actionButtons?: React.ReactNode;
|
|
73
|
+
avatarUpload?: AvatarUploadContext;
|
|
68
74
|
}
|
|
69
|
-
declare const SelectRecordsForm: ({ records, onRecordsUpdated, actionButtons, }: SelectRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
75
|
+
declare const SelectRecordsForm: ({ records, onRecordsUpdated, actionButtons, avatarUpload, }: SelectRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
70
76
|
|
|
71
77
|
interface EnsNameRegistrationFormProps {
|
|
72
78
|
name?: string;
|
|
@@ -74,6 +80,11 @@ interface EnsNameRegistrationFormProps {
|
|
|
74
80
|
referrer?: Address;
|
|
75
81
|
noBorder?: boolean;
|
|
76
82
|
className?: string;
|
|
83
|
+
title?: string;
|
|
84
|
+
subtitle?: string;
|
|
85
|
+
bannerImage?: string;
|
|
86
|
+
hideBanner?: boolean;
|
|
87
|
+
bannerWidth?: number;
|
|
77
88
|
onRegistrationSuccess?: (result: RegistrationSuccessData) => void;
|
|
78
89
|
onClose?: (isSuccess: boolean) => void;
|
|
79
90
|
onRegistrationStart?: (name: string) => void;
|
|
@@ -145,13 +156,14 @@ interface EnsRecordsFormProps {
|
|
|
145
156
|
existingRecords: EnsRecords$1;
|
|
146
157
|
noBorder?: boolean;
|
|
147
158
|
className?: string;
|
|
159
|
+
avatarUploadDomain?: string;
|
|
148
160
|
onCancel?: () => void;
|
|
149
161
|
onRecordsUpdated?: (newRecords: EnsRecordsDiff) => void;
|
|
150
162
|
onGreat?: () => void;
|
|
151
163
|
onTransactionSent?: (hash: Hash) => void;
|
|
152
164
|
txConfirmations?: number;
|
|
153
165
|
}
|
|
154
|
-
declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, onCancel, onGreat, onRecordsUpdated, onTransactionSent, txConfirmations }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
166
|
+
declare const EnsRecordsForm: ({ name, existingRecords, resolverChainId, isTestnet, resolverAddress, noBorder, className, avatarUploadDomain, onCancel, onGreat, onRecordsUpdated, onTransactionSent, txConfirmations }: EnsRecordsFormProps) => react_jsx_runtime.JSX.Element;
|
|
155
167
|
|
|
156
168
|
interface MintSuccessData {
|
|
157
169
|
fullName: string;
|
|
@@ -198,9 +210,10 @@ interface OffchainSubnameFormProps {
|
|
|
198
210
|
hideTitle?: boolean;
|
|
199
211
|
onCancel?: () => void;
|
|
200
212
|
isTestnet?: boolean;
|
|
213
|
+
avatarUploadDomain?: string;
|
|
201
214
|
onSuccess?: (data: OffchainSubnameCreatedData) => void;
|
|
202
215
|
}
|
|
203
|
-
declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
|
|
216
|
+
declare const OffchainSubnameForm: ({ apiKeyOrToken, name, label: propLabel, hideTitle, isTestnet, avatarUploadDomain, onCancel, onSuccess, }: OffchainSubnameFormProps) => react_jsx_runtime.JSX.Element;
|
|
204
217
|
|
|
205
218
|
type ButtonVariant = "solid" | "outline" | "ghost" | "destructive";
|
|
206
219
|
type ButtonSize = "sm" | "md" | "lg";
|
|
@@ -251,7 +264,7 @@ interface TextProps extends React__default.HTMLAttributes<HTMLSpanElement> {
|
|
|
251
264
|
}
|
|
252
265
|
declare const Text: React__default.FC<TextProps>;
|
|
253
266
|
|
|
254
|
-
type IconName = "person" | "x" | "search" | "square-user" | "globe" | "pin" | "box" | "book" | "map-pin" | "mail" | "discord" | "github" | "telegram" | "youtube" | "image" | "circle-person" | "twitter" | "circle-alert" | "check-circle" | "check" | "alert-triangle" | "info" | "x-circle" | "rotate-circle" | "logout" | "edit" | "copy" | "clock" | "image" | "xSocial" | "chevron-up" | "chevron-down" | "chevron-left";
|
|
267
|
+
type IconName = "person" | "x" | "search" | "square-user" | "globe" | "pin" | "box" | "book" | "map-pin" | "mail" | "discord" | "github" | "telegram" | "youtube" | "image" | "circle-person" | "twitter" | "circle-alert" | "check-circle" | "check" | "alert-triangle" | "info" | "x-circle" | "rotate-circle" | "logout" | "edit" | "copy" | "clock" | "plus" | "image" | "xSocial" | "chevron-up" | "chevron-down" | "chevron-left";
|
|
255
268
|
interface IconProps {
|
|
256
269
|
name: IconName;
|
|
257
270
|
color?: string;
|
|
@@ -324,6 +337,11 @@ interface AlertProps {
|
|
|
324
337
|
declare const Alert: React__default.FC<AlertProps>;
|
|
325
338
|
|
|
326
339
|
type ModalSize = "sm" | "md" | "lg";
|
|
340
|
+
type ModalPresentation = "dialog" | "drawer";
|
|
341
|
+
interface ModalResponsivePresentation {
|
|
342
|
+
mobile?: ModalPresentation;
|
|
343
|
+
breakpointPx?: number;
|
|
344
|
+
}
|
|
327
345
|
interface ModalProps {
|
|
328
346
|
isOpen: boolean;
|
|
329
347
|
onClose: () => void;
|
|
@@ -341,6 +359,10 @@ interface ModalProps {
|
|
|
341
359
|
className?: string;
|
|
342
360
|
/** Optional styles for the dialog container */
|
|
343
361
|
style?: React__default.CSSProperties;
|
|
362
|
+
/** Visual presentation mode */
|
|
363
|
+
presentation?: ModalPresentation;
|
|
364
|
+
/** Optional responsive presentation overrides */
|
|
365
|
+
responsivePresentation?: ModalResponsivePresentation;
|
|
344
366
|
}
|
|
345
367
|
declare const Modal: React__default.FC<ModalProps>;
|
|
346
368
|
|
|
@@ -528,8 +550,6 @@ declare const ENS_RESOLVER_ABI: readonly [{
|
|
|
528
550
|
readonly outputs: readonly [];
|
|
529
551
|
}];
|
|
530
552
|
|
|
531
|
-
declare const WalletConnectProvider: ({ children }: PropsWithChildren) => react_jsx_runtime.JSX.Element;
|
|
532
|
-
|
|
533
553
|
type ThemeName = "light" | "dark";
|
|
534
554
|
interface ThemeContextValue {
|
|
535
555
|
theme: ThemeName;
|
|
@@ -1090,6 +1110,24 @@ interface OffchainClient {
|
|
|
1090
1110
|
* ```
|
|
1091
1111
|
*/
|
|
1092
1112
|
setDefaultApiKey(apiKey: string): void;
|
|
1113
|
+
/**
|
|
1114
|
+
* Set custom HTTP headers to be sent with each request.
|
|
1115
|
+
* Useful for tracing, multi-tenant routing, or additional auth metadata.
|
|
1116
|
+
*
|
|
1117
|
+
* WARNING: The API key is sent using the "x-auth-token" header by default.
|
|
1118
|
+
* If you pass a header with the same name here, it will overwrite the
|
|
1119
|
+
* API key value used for authentication.
|
|
1120
|
+
*
|
|
1121
|
+
* @param headers - A record of header keys and values
|
|
1122
|
+
* @example
|
|
1123
|
+
* ```typescript
|
|
1124
|
+
* client.setCustomHeaders({
|
|
1125
|
+
* 'x-trace-id': '123',
|
|
1126
|
+
* 'x-tenant-id': 'my-tenant',
|
|
1127
|
+
* });
|
|
1128
|
+
* ```
|
|
1129
|
+
*/
|
|
1130
|
+
setCustomHeaders(headers: Record<string, any>): void;
|
|
1093
1131
|
/**
|
|
1094
1132
|
* Create a new ENS subname with optional records.
|
|
1095
1133
|
* @param request - Subname creation parameters
|
|
@@ -1290,5 +1328,41 @@ interface OffchainClient {
|
|
|
1290
1328
|
|
|
1291
1329
|
declare const useOffchainManager: (name: string, apiKeyOrToken: string, isTestnet?: boolean) => OffchainClient;
|
|
1292
1330
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1331
|
+
/**
|
|
1332
|
+
* Upload result
|
|
1333
|
+
*/
|
|
1334
|
+
interface UploadResult {
|
|
1335
|
+
/** URL of the uploaded image */
|
|
1336
|
+
url: string;
|
|
1337
|
+
/** Upload timestamp */
|
|
1338
|
+
uploadedAt: string;
|
|
1339
|
+
/** File size in bytes */
|
|
1340
|
+
fileSize: number;
|
|
1341
|
+
/** Whether this was an update to existing image */
|
|
1342
|
+
isUpdate: boolean;
|
|
1343
|
+
/** Whether the upload is pending (for unregistered names) */
|
|
1344
|
+
pending?: boolean;
|
|
1345
|
+
/** Optional message from the server */
|
|
1346
|
+
message?: string;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
interface UseAvatarClientParams {
|
|
1350
|
+
isTestnet?: boolean;
|
|
1351
|
+
domain?: string;
|
|
1352
|
+
}
|
|
1353
|
+
interface UploadAvatarParams {
|
|
1354
|
+
ensName: string;
|
|
1355
|
+
file: File;
|
|
1356
|
+
onProgress?: (progress: number) => void;
|
|
1357
|
+
}
|
|
1358
|
+
type UploadImageType = "avatar" | "header";
|
|
1359
|
+
declare const getAvatarUploadErrorMessage: (err: unknown) => string;
|
|
1360
|
+
declare const getImageUploadErrorMessage: (err: unknown, imageType?: UploadImageType) => string;
|
|
1361
|
+
declare const useAvatarClient: ({ isTestnet, domain }: UseAvatarClientParams) => {
|
|
1362
|
+
uploadAvatar: (params: UploadAvatarParams) => Promise<UploadResult>;
|
|
1363
|
+
uploadHeader: (params: UploadAvatarParams) => Promise<UploadResult>;
|
|
1364
|
+
getErrorMessage: (err: unknown, imageType?: UploadImageType) => string;
|
|
1365
|
+
};
|
|
1366
|
+
|
|
1367
|
+
export { Accordion, Alert, Button, Card, ChainIcon, ConnectAndSetChain, ContenthashIcon, ContenthashProtocol, ContractErrorLabel, Dropdown, ENS_RESOLVER_ABI, EnsNameRegistrationForm, EnsRecordsForm, Icon, Input, ListingNetwork, ListingType, MULTICALL, Modal, OffchainSubnameForm, PricingDisplay, ProfileHeader, ProgressBar, SET_ADDRESS_FUNC, SET_CONTENTHASH_FUNC, SET_TEXT_FUNC, SelectRecordsForm, ShurikenSpinner, SubnameMintForm, Text, TextRecordCategory, Textarea, ThemeProvider, Tooltip, TxProgress, capitalize, convertEVMChainIdToCoinType, convertToMulticallResolverData, convertToResolverData, createEnsReferer, debounce, deepCopy, diffToEnsRecords, ensureFloatInput, equalsIgnoreCase, formatFloat, getAvatarUploadErrorMessage, getBlockExplorer, getBlockExplorerAddressUrl, getBlockExplorerName, getBlockExplorerTransactionUrl, getChainIdForListingNetwork, getEnsAppUrl, getEnsRecordsDiff, getImageUploadErrorMessage, getSupportedAddressByChainId, getSupportedAddressByCoin, getSupportedAddressByName, getSupportedAddressMap, getSupportedChashByProtocol, getSupportedText, isCommitmentToNewErr, isContenthashValid, isUserDeniedError, supportedAddresses, supportedContenthashRecords, supportedTexts, useAvatarClient, useENSResolver, useMintManager, useMintSubname, useOffchainManager, useRegisterENS, useTheme, useWaitTransaction, validateEnsRecords, wait };
|
|
1368
|
+
export type { AccordionProps, AlertPosition, AlertProps, AlertVariant, ButtonProps, ButtonSize, ButtonVariant, ChainName$2 as ChainName, ConnectAndSetChainProps, ContractErrorLabelProps, DropdownProps, EnsAddressRecord$1 as EnsAddressRecord, EnsContenthashRecord, EnsRecords$1 as EnsRecords, EnsRecordsDiff, EnsTextRecord$1 as EnsTextRecord, EstimatedFees, IconName, IconProps, InputProps, InputSize, InputType, ModalPresentation, ModalProps, ModalResponsivePresentation, ModalSize, NameListing, PricingDisplayProps, ProfileHeaderProps, RecordValidationError, RegistrationRequest, ShurikenSpinnerProps, SupportedContenthashRecord, SupportedEnsAddress, SupportedText, SupportedTextRecord, TextCategory, TextColor, TextProps, TextSize, TextWeight, TextareaProps, TextareaSize, ThemeContextValue, ThemeName, ThemeProviderProps, TooltipPosition, TooltipProps, UploadAvatarParams, UploadImageType };
|