@vtex/faststore 0.0.4 → 0.0.5
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 +22 -0
- package/dist/catalog.json +67 -1
- package/dist/components.d.ts +4 -1
- package/dist/components.js +5 -2
- package/dist/content-types.json +73 -0
- package/dist/docs/account-access-gate.md +153 -0
- package/dist/docs/account-entry-point.md +1 -2
- package/dist/docs/account-menu.md +164 -0
- package/dist/docs/buy-button.md +1 -1
- package/dist/docs/cart.md +1 -1
- package/dist/docs/session.md +1 -1
- package/dist/docs/sign-in-redirect.md +1 -1
- package/dist/matter/account-access-gate/account-access-gate.d.ts +86 -0
- package/dist/matter/account-access-gate/account-access-gate.js +283 -0
- package/dist/matter/account-access-gate/account-access-gate.js.map +1 -0
- package/dist/matter/account-access-gate/sign-out-intent.d.ts +17 -0
- package/dist/matter/account-access-gate/sign-out-intent.js +62 -0
- package/dist/matter/account-access-gate/sign-out-intent.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.js +2 -2
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +88 -0
- package/dist/matter/account-menu/account-menu.js +246 -0
- package/dist/matter/account-menu/account-menu.js.map +1 -0
- package/dist/matter/cart/cart.d.ts +1 -1
- package/dist/matter/cart/cart.js +2 -2
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.js +1 -1
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js +1 -1
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/sdk/actions/cart-action-provider.d.ts +1 -1
- package/dist/sdk/actions/cart-action-provider.js +1 -1
- package/dist/sdk/actions/cart-action-provider.js.map +1 -1
- package/dist/sdk/actions/session-action-provider.d.ts +1 -1
- package/dist/sdk/actions/session-action-provider.js +1 -1
- package/dist/sdk/actions/session-action-provider.js.map +1 -1
- package/dist/sdk/actions/shipping-action-provider.d.ts +1 -1
- package/dist/sdk/actions/shipping-action-provider.js +1 -1
- package/dist/sdk/actions/shipping-action-provider.js.map +1 -1
- package/dist/sdk/cache/storefront-cache.js +1 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +4 -4
- package/dist/sdk/cart/operations.js +1 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.js +1 -1
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +1 -1
- package/dist/sdk/cart/use-cart-actions.js +3 -3
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js +1 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -1
- package/dist/sdk/cart/write-gate.js +1 -1
- package/dist/sdk/cart/write-gate.js.map +1 -1
- package/dist/sdk/data/page-reactive-data-root.d.ts +2 -2
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
- package/dist/sdk/data/reactive-data-provider.d.ts +1 -1
- package/dist/sdk/data/reactive-data-provider.js +1 -1
- package/dist/sdk/data/reactive-data-provider.js.map +1 -1
- package/dist/sdk/data/reactive-list-item-data-provider.d.ts +1 -1
- package/dist/sdk/data/reactive-list-item-data-provider.js +1 -1
- package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -1
- package/dist/sdk/data/use-reactive-entity.js +1 -1
- package/dist/sdk/data/use-reactive-entity.js.map +1 -1
- package/dist/sdk/generated/gql.js +2 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.js +85 -1
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/identity/operations.js.map +1 -1
- package/dist/sdk/identity/use-identity-actions.d.ts +1 -1
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/session/auth-operations.d.ts +1 -1
- package/dist/sdk/session/auth-operations.js.map +1 -1
- package/dist/sdk/session/use-session-actions.d.ts +1 -1
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/session/use-session-revalidation.js +65 -0
- package/dist/sdk/session/use-session-revalidation.js.map +1 -0
- package/dist/sdk/shipping/option-select-operations.d.ts +1 -1
- package/dist/sdk/shipping/option-select-operations.js.map +1 -1
- package/dist/sdk/shipping/request-timeout.js +1 -1
- package/dist/sdk/shipping/request-timeout.js.map +1 -1
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.d.ts +2 -2
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +3 -4
- package/dist/sdk/state/cart.js +6 -7
- package/dist/sdk/state/cart.js.map +1 -1
- package/dist/utils/safe-href.js +3 -3
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-account-profile.js","names":[],"sources":["../../../src/matter/my-account-profile/my-account-profile.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n type SyntheticEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DocumentField,\n isSupportedDocumentType,\n isValidDocument,\n maskDocumentValue,\n} from '../../particles/document-field/document-field.js';\nimport { Field } from '../../particles/field/field.js';\nimport { Input } from '../../particles/input/input.js';\nimport {\n applyPhoneMask,\n type PhoneCountry,\n PhoneField,\n toE164,\n validatePhoneNumber,\n} from '../../particles/phone-field/phone-field.js';\nimport { Select } from '../../particles/select/select.js';\nimport { useToast } from '../../particles/toast/toast.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport type { CustomerProfileUserError } from '../../sdk/identity/operations.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The `my-account-profile` compound (specs/sfs-3287-my-account-profile-root.md) — the data root\n * plus form mechanics for the shopper's persistent account profile. `Root` owns the saved profile,\n * the draft, the view↔edit toggle, and the single batched Save; it publishes a context whose\n * registration API is the seam every field Control attaches to.\n *\n * Unlike `ClientProfileFormRoot`, the Root does not enumerate the field set: a Control registers\n * its key plus an optional validator and normalizer, and the Root derives which fields to validate,\n * which to send, and which to focus from the live registry only. A field absent from the\n * composition is absent from the payload by construction (Decision 1).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragment — raw literal, outside codegen (Decision 8)\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment MyAccountProfileData on Query {\n customerProfile {\n __typename\n id\n firstName\n lastName\n email\n homePhone\n mobilePhone\n document\n documentType\n birthDate\n gender\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded by the reactive runtime — the `customerProfile` entity itself, not the\n * `Query` shape the fragment above is authored against. The compiler derives an entity fragment `on\n * CustomerProfile` from the root-field selection for the reactive path (rfc-data-layer.md §\"Entity\n * fragments and schema introspection\"), and `ReactiveDataProvider` publishes that entity data\n * directly — the same convention `SessionRoot` reads `$data.loggedIn` under, not `$data.session`.\n */\nexport type MyAccountProfileData = {\n id?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n homePhone?: string | null;\n mobilePhone?: string | null;\n document?: string | null;\n documentType?: string | null;\n birthDate?: string | null;\n gender?: string | null;\n} | null;\n\n/**\n * The shopper-editable keys. `email` is absent (login identifier) and `documentType` is absent\n * (read for the tax-ID control's active type; not writable in V0).\n */\nexport type MyAccountProfileFieldKey =\n | 'firstName'\n | 'lastName'\n | 'homePhone'\n | 'mobilePhone'\n | 'document'\n | 'birthDate'\n | 'gender';\n\nconst FIELD_KEYS: readonly MyAccountProfileFieldKey[] = [\n 'firstName',\n 'lastName',\n 'homePhone',\n 'mobilePhone',\n 'document',\n 'birthDate',\n 'gender',\n];\n\nexport type MyAccountProfileMode = 'view' | 'edit';\n\n/** Every editable key, always a string — a `null` upstream value is seeded as `''`. */\nexport type MyAccountProfileValues = Readonly<Record<MyAccountProfileFieldKey, string>>;\n\n/**\n * What a Control hands the Root. `validate` returns a message when the value is unacceptable and\n * `null` when it is fine — requiredness is expressed as a validator that rejects `''`. `normalize`\n * is applied on Save, to dirty values only.\n */\nexport type MyAccountProfileFieldRegistration = Readonly<{\n key: MyAccountProfileFieldKey;\n validate?: (value: string) => string | null;\n normalize?: (value: string) => string;\n}>;\n\nexport type MyAccountProfileFieldErrors = Readonly<Partial<Record<MyAccountProfileFieldKey, string>>>;\n\nexport type MyAccountProfileContextValue = Readonly<{\n mode: MyAccountProfileMode;\n savedValues: MyAccountProfileValues;\n draft: MyAccountProfileValues;\n fieldErrors: MyAccountProfileFieldErrors;\n email: string;\n activeDocumentType: string | undefined;\n pending: boolean;\n registerField: (registration: MyAccountProfileFieldRegistration) => () => void;\n setField: (key: MyAccountProfileFieldKey, value: string) => void;\n edit: () => void;\n cancel: () => void;\n}>;\n\nexport type MyAccountProfileRootProps = Readonly<{\n /** Store-configured tax-ID type fallback, used when the saved `documentType` is not registered. */\n documentType?: string;\n saveFailedMessage?: string;\n savedMessage?: string;\n className?: string;\n children?: ReactNode;\n $data?: MyAccountProfileData;\n /** Compiler-injected action surface; carries `identity.customerProfileUpdate`. */\n $actions?: ComponentActions;\n}>;\n\nexport type MyAccountProfileEditButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileSaveButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileCancelButtonProps = Readonly<{\n label?: string;\n className?: string;\n children?: ReactNode;\n}>;\nexport type MyAccountProfileEmailProps = Readonly<{ className?: string }>;\n\nconst DEFAULT_SAVE_FAILED_MESSAGE = 'Unable to save your profile. Please try again.';\nconst DEFAULT_SAVED_MESSAGE = 'Your profile has been saved.';\n\nfunction buildSavedValues($data: MyAccountProfileData | undefined): MyAccountProfileValues {\n return {\n firstName: $data?.firstName ?? '',\n lastName: $data?.lastName ?? '',\n homePhone: $data?.homePhone ?? '',\n mobilePhone: $data?.mobilePhone ?? '',\n document: $data?.document ?? '',\n birthDate: $data?.birthDate ?? '',\n gender: $data?.gender ?? '',\n };\n}\n\n/**\n * Native `<input type=\"date\">` values and the profile's stored `birthDate` are both `yyyy-mm-dd`.\n * `toNativeDate` stays defensive against a `yyyy-mm-ddTHH:mm:ss...` upstream value slipping through\n * unnormalized — the resolver already strips the time component, this is a second line of defense —\n * since the native input rejects anything but the date-only form outright.\n */\nfunction toNativeDate(stored: string): string {\n const [datePart] = stored.split('T');\n return datePart ?? '';\n}\nfunction toStoredDate(native: string): string {\n return native;\n}\n\nconst DEFAULT_GENDER_OPTIONS: readonly MyAccountProfileGenderOption[] = [\n { value: 'female', label: 'Female' },\n { value: 'male', label: 'Male' },\n { value: 'other', label: 'Other' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n];\n\n// ---------------------------------------------------------------------------\n// Context — Root publishes the draft + registration API to its Controls\n// ---------------------------------------------------------------------------\n\nconst MY_ACCOUNT_PROFILE_UNSET = Symbol('MyAccountProfileContextUnset');\n\nconst MyAccountProfileContext = createContext<MyAccountProfileContextValue | typeof MY_ACCOUNT_PROFILE_UNSET>(\n MY_ACCOUNT_PROFILE_UNSET,\n);\n\n/** Throws when used outside `MyAccountProfileRoot`, per ADR-0009. */\nexport function useMyAccountProfile(): MyAccountProfileContextValue {\n const ctx = useContext(MyAccountProfileContext);\n if (ctx === MY_ACCOUNT_PROFILE_UNSET) {\n throw new Error('MyAccountProfile components must be used inside MyAccountProfileRoot.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileRootDefinition = defineComponent<MyAccountProfileRootProps>({\n name: 'MyAccountProfileRoot',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'my-account-profile',\n actions: { identity: ['customerProfileUpdate'] },\n skeleton: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Root', category: 'identity' },\n schema: {\n documentType: { type: 'string', label: 'Default document type (e.g. CPF)' },\n saveFailedMessage: {\n type: 'string',\n default: DEFAULT_SAVE_FAILED_MESSAGE,\n label: 'Save failure message',\n },\n savedMessage: {\n type: 'string',\n default: DEFAULT_SAVED_MESSAGE,\n label: 'Save success message',\n },\n },\n guideline:\n 'Data root + form mechanics for the persistent My Account profile: owns the saved profile, the draft, the view/edit toggle, and the single batched Save (dispatches only dirty, registered fields; an empty string erases, an omitted field is untouched). Self-gates on the authenticated (loggedIn) session; requires a SessionRoot ancestor and a mounted ToastProvider ancestor — Save success/failure surface as a toast, not an inline part. Field Controls register their key plus an optional validator and normalizer through useMyAccountProfile() — the field set is a merchant composition decision, never enumerated here. Compose EditButton (view state), SaveButton/CancelButton (edit state), and Email as children in any order. See my-account-profile.md.',\n});\n\nexport function MyAccountProfileRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n documentType: documentTypeProp,\n saveFailedMessage = DEFAULT_SAVE_FAILED_MESSAGE,\n savedMessage = DEFAULT_SAVED_MESSAGE,\n className,\n children,\n}: MyAccountProfileRootProps) {\n // Enforces the SessionRoot ancestor: useSession() throws when rendered outside one.\n const { state } = useSession();\n // Enforces the ToastProvider ancestor: useToast() throws when rendered outside one (Decision 10).\n const toast = useToast();\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const resolved = $data != null;\n\n const savedValues = useMemo(() => buildSavedValues($data), [$data]);\n const savedEmail = $data?.email ?? '';\n const savedDocumentType = $data?.documentType?.toUpperCase();\n const activeDocumentType =\n savedDocumentType && isSupportedDocumentType(savedDocumentType) ? savedDocumentType : documentTypeProp;\n\n const [mode, setMode] = useState<MyAccountProfileMode>('view');\n const [draft, setDraft] = useState<MyAccountProfileValues>(savedValues);\n const [fieldErrors, setFieldErrors] = useState<MyAccountProfileFieldErrors>({});\n const [pending, setPending] = useState(false);\n const [registry, setRegistry] = useState<ReadonlyMap<MyAccountProfileFieldKey, MyAccountProfileFieldRegistration>>(\n () => new Map(),\n );\n\n const formRef = useRef<HTMLFormElement>(null);\n\n // Re-seed pristine fields when the saved profile changes underneath an open edit; a field the\n // shopper has touched (draft no longer equals the previous saved value) is never clobbered. Runs\n // during render (previous-saved in state, not a ref) so the re-seed lands in the same commit.\n const [prevSaved, setPrevSaved] = useState(savedValues);\n const changedKeys = FIELD_KEYS.filter((key) => prevSaved[key] !== savedValues[key]);\n if (changedKeys.length > 0) {\n setPrevSaved(savedValues);\n setDraft((prevDraft) => {\n let next = prevDraft;\n for (const key of changedKeys) {\n if (prevDraft[key] !== prevSaved[key]) continue;\n if (next === prevDraft) next = { ...prevDraft };\n (next as Record<MyAccountProfileFieldKey, string>)[key] = savedValues[key];\n }\n return next;\n });\n }\n\n const registerField = useCallback((registration: MyAccountProfileFieldRegistration) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(registration.key, registration);\n return next;\n });\n return () => {\n setRegistry((prev) => {\n if (!prev.has(registration.key)) return prev;\n const next = new Map(prev);\n next.delete(registration.key);\n return next;\n });\n };\n }, []);\n\n const setField = useCallback((key: MyAccountProfileFieldKey, value: string) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n setFieldErrors((prev) => {\n if (!prev[key]) return prev;\n const next = { ...prev };\n delete next[key];\n return next;\n });\n }, []);\n\n // Opening an edit always starts from the latest truth, so a value the server normalized (e.g. a\n // reformatted phone) on a previous save is what the shopper sees, not their own stale keystrokes.\n const edit = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('edit');\n }, [savedValues]);\n\n const cancel = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('view');\n }, [savedValues]);\n\n function focusFirstInvalid(errors: MyAccountProfileFieldErrors) {\n const wrappers = formRef.current?.querySelectorAll<HTMLElement>('[data-fs-my-account-profile-field]');\n if (!wrappers) return;\n for (const wrapper of wrappers) {\n const key = wrapper.dataset.fsMyAccountProfileField as MyAccountProfileFieldKey | undefined;\n if (key && errors[key]) {\n const target = wrapper.querySelector<HTMLElement>('input, select, textarea') ?? wrapper;\n target.focus();\n return;\n }\n }\n }\n\n async function handleSubmit(event: SyntheticEvent<HTMLFormElement>) {\n event.preventDefault();\n if (pending) return;\n\n const dirtyKeys = Array.from(registry.keys()).filter((key) => draft[key] !== savedValues[key]);\n if (dirtyKeys.length === 0) {\n setFieldErrors({});\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n return;\n }\n\n // Validate only the fields the shopper actually changed (Decision 9, product-confirmed): a\n // stale invalid value the shopper never touched must not block an unrelated field's save.\n const errors: Record<string, string> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const message = registration?.validate?.(draft[key]);\n if (message) errors[key] = message;\n }\n if (Object.keys(errors).length > 0) {\n setFieldErrors(errors as MyAccountProfileFieldErrors);\n focusFirstInvalid(errors as MyAccountProfileFieldErrors);\n return;\n }\n setFieldErrors({});\n\n const identity = $actions?.identity;\n if (!identity?.customerProfileUpdate) {\n // A composition/platform gap (the provider chain never delivered customerProfileUpdate) is\n // otherwise indistinguishable from a dead button — surface it the same way a rejected write\n // would, rather than returning silently.\n toast.add({ title: saveFailedMessage, type: 'error' });\n return;\n }\n\n const payload: Partial<Record<MyAccountProfileFieldKey, string>> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const rawValue = draft[key];\n payload[key] = registration?.normalize ? registration.normalize(rawValue) : rawValue;\n }\n\n setPending(true);\n try {\n const userErrors: readonly CustomerProfileUserError[] = await identity.customerProfileUpdate(payload);\n if (userErrors.length > 0) {\n toast.add({ title: userErrors[0]?.message ?? saveFailedMessage, type: 'error' });\n return;\n }\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error(\n '[MyAccountProfileRoot] customerProfileUpdate failed',\n error instanceof Error ? error.name : 'UnknownError',\n );\n toast.add({ title: saveFailedMessage, type: 'error' });\n } finally {\n setPending(false);\n }\n }\n\n const contextValue = useMemo<MyAccountProfileContextValue>(\n () => ({\n mode,\n savedValues,\n draft,\n fieldErrors,\n email: savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n }),\n [\n mode,\n savedValues,\n draft,\n fieldErrors,\n savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n ],\n );\n\n // Self-gate: an anonymous or identified-but-not-authenticated session never reaches the DOM,\n // even if the topology's SessionGuard is missing (US-5).\n if (state !== 'loggedIn') return null;\n\n // Empty is a post-resolution state — the skeleton renders while $data is unresolved, never an\n // empty summary.\n if (!resolved) return <MyAccountProfileSkeleton className={className} />;\n\n return (\n <MyAccountProfileContext value={contextValue}>\n <form\n ref={formRef}\n onSubmit={handleSubmit}\n className={className}\n data-fs-my-account-profile=\"\"\n data-fs-my-account-profile-mode={mode}\n {...(pending ? { 'data-fs-my-account-profile-pending': '' } : {})}\n >\n {children}\n </form>\n </MyAccountProfileContext>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Frame parts\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileEditButtonDefinition = defineComponent<MyAccountProfileEditButtonProps>({\n name: 'MyAccountProfileEditButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEditButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Edit Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Edit', label: 'Button label' },\n },\n guideline:\n 'Switches MyAccountProfileRoot from the view state to the edit state. Renders only in the view state. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileEditButton({ label = 'Edit', className, children }: MyAccountProfileEditButtonProps) {\n const { mode, edit } = useMyAccountProfile();\n if (mode !== 'view') return null;\n return (\n <button type=\"button\" onClick={edit} className={className} data-fs-my-account-profile-edit=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileSaveButtonDefinition = defineComponent<MyAccountProfileSaveButtonProps>({\n name: 'MyAccountProfileSaveButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSaveButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Save Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Save', label: 'Button label' },\n },\n guideline:\n \"Submits MyAccountProfileRoot's batched Save. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileSaveButton({ label = 'Save', className, children }: MyAccountProfileSaveButtonProps) {\n const { mode, pending } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button type=\"submit\" disabled={pending} className={className} data-fs-my-account-profile-save=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileCancelButtonDefinition = defineComponent<MyAccountProfileCancelButtonProps>({\n name: 'MyAccountProfileCancelButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileCancelButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Cancel Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Cancel', label: 'Button label' },\n },\n guideline:\n 'Reverts every field to its last saved value and returns MyAccountProfileRoot to the view state, without persisting. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileCancelButton({\n label = 'Cancel',\n className,\n children,\n}: MyAccountProfileCancelButtonProps) {\n const { mode, pending, cancel } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button\n type=\"button\"\n disabled={pending}\n onClick={cancel}\n className={className}\n data-fs-my-account-profile-cancel=\"\"\n >\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileEmailDefinition = defineComponent<MyAccountProfileEmailProps>({\n name: 'MyAccountProfileEmail',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEmail,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Email', category: 'identity' },\n schema: {},\n guideline:\n \"The shopper's read-only login identifier, or nothing when absent. Never editable — no edit-state rendering exists for it. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileEmail({ className }: MyAccountProfileEmailProps) {\n const { email } = useMyAccountProfile();\n if (!email) return null;\n return (\n <p className={className} data-fs-my-account-profile-email=\"\">\n {email}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — no context: it is rendered directly by the Root before any Provider exists\n// (mirrors ProductShelfSkeleton / PricingSkeleton; see spec deviation note).\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileSkeletonDefinition = defineComponent<ComponentPropsWithRef<'div'>>({\n name: 'MyAccountProfileSkeleton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Skeleton', category: 'identity' },\n schema: {},\n guideline:\n 'Loading placeholder rendered by MyAccountProfileRoot while $data is unresolved. Declares no context requirement — it renders before the Root has anything to provide.',\n});\n\nexport function MyAccountProfileSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-my-account-profile-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n </div>\n );\n}\n\nMyAccountProfileRoot.Skeleton = MyAccountProfileSkeleton;\n\n// ---------------------------------------------------------------------------\n// Field Controls\n//\n// Each Control is a thin binding over an existing presentational particle: it registers with the\n// Root's registration seam in an effect, reads its value off `mode` (savedValues in view, draft in\n// edit), writes through `setField`, and wraps its input in an element carrying\n// `data-fs-my-account-profile-field` — the Root's DOM-order focus seam. None persists on its own.\n// ---------------------------------------------------------------------------\n\nexport type MyAccountProfileFirstNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileFirstNameControlDefinition = defineComponent<MyAccountProfileFirstNameControlProps>({\n name: 'MyAccountProfileFirstNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileFirstNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile First Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'First name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'First name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required first-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileFirstNameControl({\n label = 'First name',\n requiredMessage = 'First name is required.',\n className,\n}: MyAccountProfileFirstNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'firstName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.firstName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-first-name=\"\" data-fs-my-account-profile-field=\"firstName\">\n {savedValues.firstName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-first-name=\"\"\n data-fs-my-account-profile-field=\"firstName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.firstName}\n onChange={(event) => setField('firstName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileLastNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileLastNameControlDefinition = defineComponent<MyAccountProfileLastNameControlProps>({\n name: 'MyAccountProfileLastNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileLastNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Last Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Last name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'Last name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required last-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileLastNameControl({\n label = 'Last name',\n requiredMessage = 'Last name is required.',\n className,\n}: MyAccountProfileLastNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'lastName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.lastName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-last-name=\"\" data-fs-my-account-profile-field=\"lastName\">\n {savedValues.lastName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-last-name=\"\"\n data-fs-my-account-profile-field=\"lastName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.lastName}\n onChange={(event) => setField('lastName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfilePhoneControlProps = Readonly<{\n label?: string;\n /** Which draft key this instance binds. Compose the Control twice to expose both numbers. */\n field?: 'homePhone' | 'mobilePhone';\n country?: PhoneCountry;\n invalidMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfilePhoneControlDefinition = defineComponent<MyAccountProfilePhoneControlProps>({\n name: 'MyAccountProfilePhoneControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfilePhoneControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Phone Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Phone', label: 'Label' },\n field: { type: ['homePhone', 'mobilePhone'] as const, default: 'mobilePhone', label: 'Bound field' },\n country: { type: ['US', 'BR'] as const, default: 'US', label: 'Country' },\n invalidMessage: { type: 'string', default: 'Invalid phone number', label: 'Invalid message' },\n },\n guideline:\n \"Draft-bound, optional phone field bound to either homePhone or mobilePhone via the field prop (Decision 1) — compose it twice to expose both numbers. Normalizes to E.164 on the Root's Save. Absent from the composition means absent from the payload. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfilePhoneControl({\n label = 'Phone',\n field = 'mobilePhone',\n country = 'US',\n invalidMessage = 'Invalid phone number',\n className,\n}: MyAccountProfilePhoneControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({\n key: field,\n validate: (value) => (value.trim() && !validatePhoneNumber(value, country) ? invalidMessage : null),\n normalize: (value) => (value.trim() ? toE164(value, country) : value),\n });\n }, [field, country, invalidMessage, registerField]);\n\n const error = fieldErrors[field];\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-phone={field} data-fs-my-account-profile-field={field}>\n {savedValues[field] ? applyPhoneMask(savedValues[field], country) : ''}\n </p>\n );\n }\n\n return (\n <div data-fs-my-account-profile-field={field}>\n <PhoneField\n className={className}\n label={label}\n country={country}\n requirement=\"optional\"\n value={draft[field]}\n onValueChange={(value) => setField(field, value)}\n invalid={!!error}\n error={error ?? undefined}\n errorInvalid={invalidMessage}\n isDisabled={pending}\n data-fs-my-account-profile-phone={field}\n />\n </div>\n );\n}\n\nexport type MyAccountProfileTaxIdControlProps = Readonly<{\n label?: string;\n invalidMessage?: string;\n /** Inline reason shown beside the locked saved CPF. */\n lockedReason?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileTaxIdControlDefinition = defineComponent<MyAccountProfileTaxIdControlProps>({\n name: 'MyAccountProfileTaxIdControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileTaxIdControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Tax ID Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'National tax ID', label: 'Label' },\n invalidMessage: { type: 'string', default: 'Invalid document number.', label: 'Invalid message' },\n lockedReason: { type: 'string', default: \"Your document ID can't be edited.\", label: 'Locked reason' },\n },\n guideline:\n \"Draft-bound, optional national tax-ID field (CPF in V0). Self-gates on the Root's active document type. A saved value renders as a disabled, locked input in the edit state rather than disappearing (Decision 4); an unsaved value renders as an editable field. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileTaxIdControl({\n label = 'National tax ID',\n invalidMessage = 'Invalid document number.',\n lockedReason = \"Your document ID can't be edited.\",\n className,\n}: MyAccountProfileTaxIdControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, activeDocumentType, registerField, setField } =\n useMyAccountProfile();\n const documentType =\n activeDocumentType && isSupportedDocumentType(activeDocumentType) ? activeDocumentType : undefined;\n const hasSavedDocument = savedValues.document.trim() !== '';\n\n useEffect(() => {\n if (!documentType || hasSavedDocument) return;\n return registerField({\n key: 'document',\n validate: (value) => (value.trim() && !isValidDocument(value, documentType) ? invalidMessage : null),\n // DocumentField reports back the masked value (e.g. `111.444.777-35`); strip the punctuation\n // before it reaches the API, matching the checkout form's `stripNonDigits`.\n normalize: (value) => value.replaceAll(/\\D/g, ''),\n });\n }, [documentType, hasSavedDocument, invalidMessage, registerField]);\n\n if (!documentType) return null;\n\n const error = fieldErrors.document;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-tax-id=\"\" data-fs-my-account-profile-field=\"document\">\n {savedValues.document ? maskDocumentValue(savedValues.document, documentType) : ''}\n </p>\n );\n }\n\n if (hasSavedDocument) {\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n readOnly\n aria-disabled=\"true\"\n title={lockedReason}\n value={maskDocumentValue(savedValues.document, documentType)}\n data-fs-my-account-profile-tax-id-readonly=\"\"\n />\n <Field.Description>{lockedReason}</Field.Description>\n </Field.Root>\n );\n }\n\n return (\n <DocumentField\n className={className}\n label={label}\n documentType={documentType}\n value={draft.document}\n onValueChange={(value) => setField('document', value)}\n invalid={!!error}\n errorMessage={error}\n disabled={pending}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n />\n );\n}\n\nexport type MyAccountProfileBirthDateControlProps = Readonly<{ label?: string; className?: string }>;\n\nexport const MyAccountProfileBirthDateControlDefinition = defineComponent<MyAccountProfileBirthDateControlProps>({\n name: 'MyAccountProfileBirthDateControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileBirthDateControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Birth Date Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Birth date', label: 'Label' },\n },\n guideline:\n 'Draft-bound, optional birth-date field over a native date input. Maps the native yyyy-mm-dd value to the stored profile format on read and write. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileBirthDateControl({\n label = 'Birth date',\n className,\n}: MyAccountProfileBirthDateControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'birthDate', normalize: (value) => toStoredDate(value) });\n }, [registerField]);\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-birth-date=\"\" data-fs-my-account-profile-field=\"birthDate\">\n {savedValues.birthDate}\n </p>\n );\n }\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n setField('birthDate', toStoredDate(event.target.value));\n }\n\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-birth-date=\"\"\n data-fs-my-account-profile-field=\"birthDate\"\n >\n <Field.Label>{label}</Field.Label>\n <Input type=\"date\" value={toNativeDate(draft.birthDate)} onChange={handleChange} disabled={pending} />\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileGenderOption = Readonly<{ value: string; label: string }>;\n\nexport type MyAccountProfileGenderControlProps = Readonly<{\n label?: string;\n placeholder?: string;\n clearLabel?: string;\n options?: readonly MyAccountProfileGenderOption[];\n className?: string;\n}>;\n\nexport const MyAccountProfileGenderControlDefinition = defineComponent<MyAccountProfileGenderControlProps>({\n name: 'MyAccountProfileGenderControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileGenderControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Gender Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Gender', label: 'Label' },\n placeholder: { type: 'string', default: 'Select', label: 'Placeholder' },\n clearLabel: { type: 'string', default: 'Clear', label: 'Clear button label' },\n },\n guideline:\n 'Draft-bound, optional gender field over a store-configurable set of options (the options prop). Free-string storage — no server-side enum. A Clear button erases a selected value back to empty, since the Select itself offers no such option. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileGenderControl({\n label = 'Gender',\n placeholder = 'Select',\n clearLabel = 'Clear',\n options = DEFAULT_GENDER_OPTIONS,\n className,\n}: MyAccountProfileGenderControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'gender' });\n }, [registerField]);\n\n if (mode === 'view') {\n const selected = options.find((option) => option.value === savedValues.gender);\n return (\n <p className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n {selected?.label ?? savedValues.gender}\n </p>\n );\n }\n\n return (\n <div className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n <Select.Root value={draft.gender} onValueChange={(value) => setField('gender', value ?? '')} disabled={pending}>\n <Select.Label>{label}</Select.Label>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n <Select.Icon />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n <Select.List>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n {draft.gender ? (\n <button\n type=\"button\"\n onClick={() => setField('gender', '')}\n disabled={pending}\n data-fs-my-account-profile-gender-clear=\"\"\n >\n {clearLabel}\n </button>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfile = {\n Root: MyAccountProfileRoot,\n RootDefinition: MyAccountProfileRootDefinition,\n EditButton: MyAccountProfileEditButton,\n EditButtonDefinition: MyAccountProfileEditButtonDefinition,\n SaveButton: MyAccountProfileSaveButton,\n SaveButtonDefinition: MyAccountProfileSaveButtonDefinition,\n CancelButton: MyAccountProfileCancelButton,\n CancelButtonDefinition: MyAccountProfileCancelButtonDefinition,\n Email: MyAccountProfileEmail,\n EmailDefinition: MyAccountProfileEmailDefinition,\n Skeleton: MyAccountProfileSkeleton,\n SkeletonDefinition: MyAccountProfileSkeletonDefinition,\n FirstNameControl: MyAccountProfileFirstNameControl,\n FirstNameControlDefinition: MyAccountProfileFirstNameControlDefinition,\n LastNameControl: MyAccountProfileLastNameControl,\n LastNameControlDefinition: MyAccountProfileLastNameControlDefinition,\n PhoneControl: MyAccountProfilePhoneControl,\n PhoneControlDefinition: MyAccountProfilePhoneControlDefinition,\n TaxIdControl: MyAccountProfileTaxIdControl,\n TaxIdControlDefinition: MyAccountProfileTaxIdControlDefinition,\n BirthDateControl: MyAccountProfileBirthDateControl,\n BirthDateControlDefinition: MyAccountProfileBirthDateControlDefinition,\n GenderControl: MyAccountProfileGenderControl,\n GenderControlDefinition: MyAccountProfileGenderControlDefinition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,WAAyB;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;CACN,gBAAgB;CAChB,YAAY;CACZ,sBAAsB;CACtB,YAAY;CACZ,sBAAsB;CACtB,cAAc;CACd,wBAAwB;CACxB,OAAO;CACP,iBAAiB;CACjB,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,4BAA4B;CAC5B,iBAAiB;CACjB,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,cAAc;CACd,wBAAwB;CACxB,kBAAkB;CAClB,4BAA4B;CAC5B,eAAe;CACf,yBAAyB;AAC3B"}
|
|
1
|
+
{"version":3,"file":"my-account-profile.js","names":[],"sources":["../../../src/matter/my-account-profile/my-account-profile.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n type SyntheticEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DocumentField,\n isSupportedDocumentType,\n isValidDocument,\n maskDocumentValue,\n} from '../../particles/document-field/document-field.js';\nimport { Field } from '../../particles/field/field.js';\nimport { Input } from '../../particles/input/input.js';\nimport {\n applyPhoneMask,\n type PhoneCountry,\n PhoneField,\n toE164,\n validatePhoneNumber,\n} from '../../particles/phone-field/phone-field.js';\nimport { Select } from '../../particles/select/select.js';\nimport { useToast } from '../../particles/toast/toast.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport type { CustomerProfileUserError } from '../../sdk/identity/operations.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The `my-account-profile` compound (see my-account-profile.md; spec archived at the specs-archive tag) — the data root\n * plus form mechanics for the shopper's persistent account profile. `Root` owns the saved profile,\n * the draft, the view↔edit toggle, and the single batched Save; it publishes a context whose\n * registration API is the seam every field Control attaches to.\n *\n * Unlike `ClientProfileFormRoot`, the Root does not enumerate the field set: a Control registers\n * its key plus an optional validator and normalizer, and the Root derives which fields to validate,\n * which to send, and which to focus from the live registry only. A field absent from the\n * composition is absent from the payload by construction (Decision 1).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragment — raw literal, outside codegen (Decision 8)\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment MyAccountProfileData on Query {\n customerProfile {\n __typename\n id\n firstName\n lastName\n email\n homePhone\n mobilePhone\n document\n documentType\n birthDate\n gender\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded by the reactive runtime — the `customerProfile` entity itself, not the\n * `Query` shape the fragment above is authored against. The compiler derives an entity fragment `on\n * CustomerProfile` from the root-field selection for the reactive path (rfc-data-layer.md §\"Entity\n * fragments and schema introspection\"), and `ReactiveDataProvider` publishes that entity data\n * directly — the same convention `SessionRoot` reads `$data.loggedIn` under, not `$data.session`.\n */\nexport type MyAccountProfileData = {\n id?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n homePhone?: string | null;\n mobilePhone?: string | null;\n document?: string | null;\n documentType?: string | null;\n birthDate?: string | null;\n gender?: string | null;\n} | null;\n\n/**\n * The shopper-editable keys. `email` is absent (login identifier) and `documentType` is absent\n * (read for the tax-ID control's active type; not writable in V0).\n */\nexport type MyAccountProfileFieldKey =\n | 'firstName'\n | 'lastName'\n | 'homePhone'\n | 'mobilePhone'\n | 'document'\n | 'birthDate'\n | 'gender';\n\nconst FIELD_KEYS: readonly MyAccountProfileFieldKey[] = [\n 'firstName',\n 'lastName',\n 'homePhone',\n 'mobilePhone',\n 'document',\n 'birthDate',\n 'gender',\n];\n\nexport type MyAccountProfileMode = 'view' | 'edit';\n\n/** Every editable key, always a string — a `null` upstream value is seeded as `''`. */\nexport type MyAccountProfileValues = Readonly<Record<MyAccountProfileFieldKey, string>>;\n\n/**\n * What a Control hands the Root. `validate` returns a message when the value is unacceptable and\n * `null` when it is fine — requiredness is expressed as a validator that rejects `''`. `normalize`\n * is applied on Save, to dirty values only.\n */\nexport type MyAccountProfileFieldRegistration = Readonly<{\n key: MyAccountProfileFieldKey;\n validate?: (value: string) => string | null;\n normalize?: (value: string) => string;\n}>;\n\nexport type MyAccountProfileFieldErrors = Readonly<Partial<Record<MyAccountProfileFieldKey, string>>>;\n\nexport type MyAccountProfileContextValue = Readonly<{\n mode: MyAccountProfileMode;\n savedValues: MyAccountProfileValues;\n draft: MyAccountProfileValues;\n fieldErrors: MyAccountProfileFieldErrors;\n email: string;\n activeDocumentType: string | undefined;\n pending: boolean;\n registerField: (registration: MyAccountProfileFieldRegistration) => () => void;\n setField: (key: MyAccountProfileFieldKey, value: string) => void;\n edit: () => void;\n cancel: () => void;\n}>;\n\nexport type MyAccountProfileRootProps = Readonly<{\n /** Store-configured tax-ID type fallback, used when the saved `documentType` is not registered. */\n documentType?: string;\n saveFailedMessage?: string;\n savedMessage?: string;\n className?: string;\n children?: ReactNode;\n $data?: MyAccountProfileData;\n /** Compiler-injected action surface; carries `identity.customerProfileUpdate`. */\n $actions?: ComponentActions;\n}>;\n\nexport type MyAccountProfileEditButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileSaveButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileCancelButtonProps = Readonly<{\n label?: string;\n className?: string;\n children?: ReactNode;\n}>;\nexport type MyAccountProfileEmailProps = Readonly<{ className?: string }>;\n\nconst DEFAULT_SAVE_FAILED_MESSAGE = 'Unable to save your profile. Please try again.';\nconst DEFAULT_SAVED_MESSAGE = 'Your profile has been saved.';\n\nfunction buildSavedValues($data: MyAccountProfileData | undefined): MyAccountProfileValues {\n return {\n firstName: $data?.firstName ?? '',\n lastName: $data?.lastName ?? '',\n homePhone: $data?.homePhone ?? '',\n mobilePhone: $data?.mobilePhone ?? '',\n document: $data?.document ?? '',\n birthDate: $data?.birthDate ?? '',\n gender: $data?.gender ?? '',\n };\n}\n\n/**\n * Native `<input type=\"date\">` values and the profile's stored `birthDate` are both `yyyy-mm-dd`.\n * `toNativeDate` stays defensive against a `yyyy-mm-ddTHH:mm:ss...` upstream value slipping through\n * unnormalized — the resolver already strips the time component, this is a second line of defense —\n * since the native input rejects anything but the date-only form outright.\n */\nfunction toNativeDate(stored: string): string {\n const [datePart] = stored.split('T');\n return datePart ?? '';\n}\nfunction toStoredDate(native: string): string {\n return native;\n}\n\nconst DEFAULT_GENDER_OPTIONS: readonly MyAccountProfileGenderOption[] = [\n { value: 'female', label: 'Female' },\n { value: 'male', label: 'Male' },\n { value: 'other', label: 'Other' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n];\n\n// ---------------------------------------------------------------------------\n// Context — Root publishes the draft + registration API to its Controls\n// ---------------------------------------------------------------------------\n\nconst MY_ACCOUNT_PROFILE_UNSET = Symbol('MyAccountProfileContextUnset');\n\nconst MyAccountProfileContext = createContext<MyAccountProfileContextValue | typeof MY_ACCOUNT_PROFILE_UNSET>(\n MY_ACCOUNT_PROFILE_UNSET,\n);\n\n/** Throws when used outside `MyAccountProfileRoot`, per ADR-0009. */\nexport function useMyAccountProfile(): MyAccountProfileContextValue {\n const ctx = useContext(MyAccountProfileContext);\n if (ctx === MY_ACCOUNT_PROFILE_UNSET) {\n throw new Error('MyAccountProfile components must be used inside MyAccountProfileRoot.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileRootDefinition = defineComponent<MyAccountProfileRootProps>({\n name: 'MyAccountProfileRoot',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'my-account-profile',\n actions: { identity: ['customerProfileUpdate'] },\n skeleton: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Root', category: 'identity' },\n schema: {\n documentType: { type: 'string', label: 'Default document type (e.g. CPF)' },\n saveFailedMessage: {\n type: 'string',\n default: DEFAULT_SAVE_FAILED_MESSAGE,\n label: 'Save failure message',\n },\n savedMessage: {\n type: 'string',\n default: DEFAULT_SAVED_MESSAGE,\n label: 'Save success message',\n },\n },\n guideline:\n 'Data root + form mechanics for the persistent My Account profile: owns the saved profile, the draft, the view/edit toggle, and the single batched Save (dispatches only dirty, registered fields; an empty string erases, an omitted field is untouched). Self-gates on the authenticated (loggedIn) session; requires a SessionRoot ancestor and a mounted ToastProvider ancestor — Save success/failure surface as a toast, not an inline part. Field Controls register their key plus an optional validator and normalizer through useMyAccountProfile() — the field set is a merchant composition decision, never enumerated here. Compose EditButton (view state), SaveButton/CancelButton (edit state), and Email as children in any order. See my-account-profile.md.',\n});\n\nexport function MyAccountProfileRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n documentType: documentTypeProp,\n saveFailedMessage = DEFAULT_SAVE_FAILED_MESSAGE,\n savedMessage = DEFAULT_SAVED_MESSAGE,\n className,\n children,\n}: MyAccountProfileRootProps) {\n // Enforces the SessionRoot ancestor: useSession() throws when rendered outside one.\n const { state } = useSession();\n // Enforces the ToastProvider ancestor: useToast() throws when rendered outside one (Decision 10).\n const toast = useToast();\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const resolved = $data != null;\n\n const savedValues = useMemo(() => buildSavedValues($data), [$data]);\n const savedEmail = $data?.email ?? '';\n const savedDocumentType = $data?.documentType?.toUpperCase();\n const activeDocumentType =\n savedDocumentType && isSupportedDocumentType(savedDocumentType) ? savedDocumentType : documentTypeProp;\n\n const [mode, setMode] = useState<MyAccountProfileMode>('view');\n const [draft, setDraft] = useState<MyAccountProfileValues>(savedValues);\n const [fieldErrors, setFieldErrors] = useState<MyAccountProfileFieldErrors>({});\n const [pending, setPending] = useState(false);\n const [registry, setRegistry] = useState<ReadonlyMap<MyAccountProfileFieldKey, MyAccountProfileFieldRegistration>>(\n () => new Map(),\n );\n\n const formRef = useRef<HTMLFormElement>(null);\n\n // Re-seed pristine fields when the saved profile changes underneath an open edit; a field the\n // shopper has touched (draft no longer equals the previous saved value) is never clobbered. Runs\n // during render (previous-saved in state, not a ref) so the re-seed lands in the same commit.\n const [prevSaved, setPrevSaved] = useState(savedValues);\n const changedKeys = FIELD_KEYS.filter((key) => prevSaved[key] !== savedValues[key]);\n if (changedKeys.length > 0) {\n setPrevSaved(savedValues);\n setDraft((prevDraft) => {\n let next = prevDraft;\n for (const key of changedKeys) {\n if (prevDraft[key] !== prevSaved[key]) continue;\n if (next === prevDraft) next = { ...prevDraft };\n (next as Record<MyAccountProfileFieldKey, string>)[key] = savedValues[key];\n }\n return next;\n });\n }\n\n const registerField = useCallback((registration: MyAccountProfileFieldRegistration) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(registration.key, registration);\n return next;\n });\n return () => {\n setRegistry((prev) => {\n if (!prev.has(registration.key)) return prev;\n const next = new Map(prev);\n next.delete(registration.key);\n return next;\n });\n };\n }, []);\n\n const setField = useCallback((key: MyAccountProfileFieldKey, value: string) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n setFieldErrors((prev) => {\n if (!prev[key]) return prev;\n const next = { ...prev };\n delete next[key];\n return next;\n });\n }, []);\n\n // Opening an edit always starts from the latest truth, so a value the server normalized (e.g. a\n // reformatted phone) on a previous save is what the shopper sees, not their own stale keystrokes.\n const edit = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('edit');\n }, [savedValues]);\n\n const cancel = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('view');\n }, [savedValues]);\n\n function focusFirstInvalid(errors: MyAccountProfileFieldErrors) {\n const wrappers = formRef.current?.querySelectorAll<HTMLElement>('[data-fs-my-account-profile-field]');\n if (!wrappers) return;\n for (const wrapper of wrappers) {\n const key = wrapper.dataset.fsMyAccountProfileField as MyAccountProfileFieldKey | undefined;\n if (key && errors[key]) {\n const target = wrapper.querySelector<HTMLElement>('input, select, textarea') ?? wrapper;\n target.focus();\n return;\n }\n }\n }\n\n async function handleSubmit(event: SyntheticEvent<HTMLFormElement>) {\n event.preventDefault();\n if (pending) return;\n\n const dirtyKeys = Array.from(registry.keys()).filter((key) => draft[key] !== savedValues[key]);\n if (dirtyKeys.length === 0) {\n setFieldErrors({});\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n return;\n }\n\n // Validate only the fields the shopper actually changed (Decision 9, product-confirmed): a\n // stale invalid value the shopper never touched must not block an unrelated field's save.\n const errors: Record<string, string> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const message = registration?.validate?.(draft[key]);\n if (message) errors[key] = message;\n }\n if (Object.keys(errors).length > 0) {\n setFieldErrors(errors as MyAccountProfileFieldErrors);\n focusFirstInvalid(errors as MyAccountProfileFieldErrors);\n return;\n }\n setFieldErrors({});\n\n const identity = $actions?.identity;\n if (!identity?.customerProfileUpdate) {\n // A composition/platform gap (the provider chain never delivered customerProfileUpdate) is\n // otherwise indistinguishable from a dead button — surface it the same way a rejected write\n // would, rather than returning silently.\n toast.add({ title: saveFailedMessage, type: 'error' });\n return;\n }\n\n const payload: Partial<Record<MyAccountProfileFieldKey, string>> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const rawValue = draft[key];\n payload[key] = registration?.normalize ? registration.normalize(rawValue) : rawValue;\n }\n\n setPending(true);\n try {\n const userErrors: readonly CustomerProfileUserError[] = await identity.customerProfileUpdate(payload);\n if (userErrors.length > 0) {\n toast.add({ title: userErrors[0]?.message ?? saveFailedMessage, type: 'error' });\n return;\n }\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error(\n '[MyAccountProfileRoot] customerProfileUpdate failed',\n error instanceof Error ? error.name : 'UnknownError',\n );\n toast.add({ title: saveFailedMessage, type: 'error' });\n } finally {\n setPending(false);\n }\n }\n\n const contextValue = useMemo<MyAccountProfileContextValue>(\n () => ({\n mode,\n savedValues,\n draft,\n fieldErrors,\n email: savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n }),\n [\n mode,\n savedValues,\n draft,\n fieldErrors,\n savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n ],\n );\n\n // Self-gate: an anonymous or identified-but-not-authenticated session never reaches the DOM,\n // even if the topology's SessionGuard is missing (US-5).\n if (state !== 'loggedIn') return null;\n\n // Empty is a post-resolution state — the skeleton renders while $data is unresolved, never an\n // empty summary.\n if (!resolved) return <MyAccountProfileSkeleton className={className} />;\n\n return (\n <MyAccountProfileContext value={contextValue}>\n <form\n ref={formRef}\n onSubmit={handleSubmit}\n className={className}\n data-fs-my-account-profile=\"\"\n data-fs-my-account-profile-mode={mode}\n {...(pending ? { 'data-fs-my-account-profile-pending': '' } : {})}\n >\n {children}\n </form>\n </MyAccountProfileContext>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Frame parts\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileEditButtonDefinition = defineComponent<MyAccountProfileEditButtonProps>({\n name: 'MyAccountProfileEditButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEditButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Edit Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Edit', label: 'Button label' },\n },\n guideline:\n 'Switches MyAccountProfileRoot from the view state to the edit state. Renders only in the view state. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileEditButton({ label = 'Edit', className, children }: MyAccountProfileEditButtonProps) {\n const { mode, edit } = useMyAccountProfile();\n if (mode !== 'view') return null;\n return (\n <button type=\"button\" onClick={edit} className={className} data-fs-my-account-profile-edit=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileSaveButtonDefinition = defineComponent<MyAccountProfileSaveButtonProps>({\n name: 'MyAccountProfileSaveButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSaveButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Save Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Save', label: 'Button label' },\n },\n guideline:\n \"Submits MyAccountProfileRoot's batched Save. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileSaveButton({ label = 'Save', className, children }: MyAccountProfileSaveButtonProps) {\n const { mode, pending } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button type=\"submit\" disabled={pending} className={className} data-fs-my-account-profile-save=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileCancelButtonDefinition = defineComponent<MyAccountProfileCancelButtonProps>({\n name: 'MyAccountProfileCancelButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileCancelButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Cancel Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Cancel', label: 'Button label' },\n },\n guideline:\n 'Reverts every field to its last saved value and returns MyAccountProfileRoot to the view state, without persisting. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileCancelButton({\n label = 'Cancel',\n className,\n children,\n}: MyAccountProfileCancelButtonProps) {\n const { mode, pending, cancel } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button\n type=\"button\"\n disabled={pending}\n onClick={cancel}\n className={className}\n data-fs-my-account-profile-cancel=\"\"\n >\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileEmailDefinition = defineComponent<MyAccountProfileEmailProps>({\n name: 'MyAccountProfileEmail',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEmail,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Email', category: 'identity' },\n schema: {},\n guideline:\n \"The shopper's read-only login identifier, or nothing when absent. Never editable — no edit-state rendering exists for it. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileEmail({ className }: MyAccountProfileEmailProps) {\n const { email } = useMyAccountProfile();\n if (!email) return null;\n return (\n <p className={className} data-fs-my-account-profile-email=\"\">\n {email}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — no context: it is rendered directly by the Root before any Provider exists\n// (mirrors ProductShelfSkeleton / PricingSkeleton; see spec deviation note).\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileSkeletonDefinition = defineComponent<ComponentPropsWithRef<'div'>>({\n name: 'MyAccountProfileSkeleton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Skeleton', category: 'identity' },\n schema: {},\n guideline:\n 'Loading placeholder rendered by MyAccountProfileRoot while $data is unresolved. Declares no context requirement — it renders before the Root has anything to provide.',\n});\n\nexport function MyAccountProfileSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-my-account-profile-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n </div>\n );\n}\n\nMyAccountProfileRoot.Skeleton = MyAccountProfileSkeleton;\n\n// ---------------------------------------------------------------------------\n// Field Controls\n//\n// Each Control is a thin binding over an existing presentational particle: it registers with the\n// Root's registration seam in an effect, reads its value off `mode` (savedValues in view, draft in\n// edit), writes through `setField`, and wraps its input in an element carrying\n// `data-fs-my-account-profile-field` — the Root's DOM-order focus seam. None persists on its own.\n// ---------------------------------------------------------------------------\n\nexport type MyAccountProfileFirstNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileFirstNameControlDefinition = defineComponent<MyAccountProfileFirstNameControlProps>({\n name: 'MyAccountProfileFirstNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileFirstNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile First Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'First name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'First name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required first-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileFirstNameControl({\n label = 'First name',\n requiredMessage = 'First name is required.',\n className,\n}: MyAccountProfileFirstNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'firstName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.firstName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-first-name=\"\" data-fs-my-account-profile-field=\"firstName\">\n {savedValues.firstName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-first-name=\"\"\n data-fs-my-account-profile-field=\"firstName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.firstName}\n onChange={(event) => setField('firstName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileLastNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileLastNameControlDefinition = defineComponent<MyAccountProfileLastNameControlProps>({\n name: 'MyAccountProfileLastNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileLastNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Last Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Last name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'Last name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required last-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileLastNameControl({\n label = 'Last name',\n requiredMessage = 'Last name is required.',\n className,\n}: MyAccountProfileLastNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'lastName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.lastName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-last-name=\"\" data-fs-my-account-profile-field=\"lastName\">\n {savedValues.lastName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-last-name=\"\"\n data-fs-my-account-profile-field=\"lastName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.lastName}\n onChange={(event) => setField('lastName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfilePhoneControlProps = Readonly<{\n label?: string;\n /** Which draft key this instance binds. Compose the Control twice to expose both numbers. */\n field?: 'homePhone' | 'mobilePhone';\n country?: PhoneCountry;\n invalidMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfilePhoneControlDefinition = defineComponent<MyAccountProfilePhoneControlProps>({\n name: 'MyAccountProfilePhoneControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfilePhoneControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Phone Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Phone', label: 'Label' },\n field: { type: ['homePhone', 'mobilePhone'] as const, default: 'mobilePhone', label: 'Bound field' },\n country: { type: ['US', 'BR'] as const, default: 'US', label: 'Country' },\n invalidMessage: { type: 'string', default: 'Invalid phone number', label: 'Invalid message' },\n },\n guideline:\n \"Draft-bound, optional phone field bound to either homePhone or mobilePhone via the field prop (Decision 1) — compose it twice to expose both numbers. Normalizes to E.164 on the Root's Save. Absent from the composition means absent from the payload. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfilePhoneControl({\n label = 'Phone',\n field = 'mobilePhone',\n country = 'US',\n invalidMessage = 'Invalid phone number',\n className,\n}: MyAccountProfilePhoneControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({\n key: field,\n validate: (value) => (value.trim() && !validatePhoneNumber(value, country) ? invalidMessage : null),\n normalize: (value) => (value.trim() ? toE164(value, country) : value),\n });\n }, [field, country, invalidMessage, registerField]);\n\n const error = fieldErrors[field];\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-phone={field} data-fs-my-account-profile-field={field}>\n {savedValues[field] ? applyPhoneMask(savedValues[field], country) : ''}\n </p>\n );\n }\n\n return (\n <div data-fs-my-account-profile-field={field}>\n <PhoneField\n className={className}\n label={label}\n country={country}\n requirement=\"optional\"\n value={draft[field]}\n onValueChange={(value) => setField(field, value)}\n invalid={!!error}\n error={error ?? undefined}\n errorInvalid={invalidMessage}\n isDisabled={pending}\n data-fs-my-account-profile-phone={field}\n />\n </div>\n );\n}\n\nexport type MyAccountProfileTaxIdControlProps = Readonly<{\n label?: string;\n invalidMessage?: string;\n /** Inline reason shown beside the locked saved CPF. */\n lockedReason?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileTaxIdControlDefinition = defineComponent<MyAccountProfileTaxIdControlProps>({\n name: 'MyAccountProfileTaxIdControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileTaxIdControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Tax ID Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'National tax ID', label: 'Label' },\n invalidMessage: { type: 'string', default: 'Invalid document number.', label: 'Invalid message' },\n lockedReason: { type: 'string', default: \"Your document ID can't be edited.\", label: 'Locked reason' },\n },\n guideline:\n \"Draft-bound, optional national tax-ID field (CPF in V0). Self-gates on the Root's active document type. A saved value renders as a disabled, locked input in the edit state rather than disappearing (Decision 4); an unsaved value renders as an editable field. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileTaxIdControl({\n label = 'National tax ID',\n invalidMessage = 'Invalid document number.',\n lockedReason = \"Your document ID can't be edited.\",\n className,\n}: MyAccountProfileTaxIdControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, activeDocumentType, registerField, setField } =\n useMyAccountProfile();\n const documentType =\n activeDocumentType && isSupportedDocumentType(activeDocumentType) ? activeDocumentType : undefined;\n const hasSavedDocument = savedValues.document.trim() !== '';\n\n useEffect(() => {\n if (!documentType || hasSavedDocument) return;\n return registerField({\n key: 'document',\n validate: (value) => (value.trim() && !isValidDocument(value, documentType) ? invalidMessage : null),\n // DocumentField reports back the masked value (e.g. `111.444.777-35`); strip the punctuation\n // before it reaches the API, matching the checkout form's `stripNonDigits`.\n normalize: (value) => value.replaceAll(/\\D/g, ''),\n });\n }, [documentType, hasSavedDocument, invalidMessage, registerField]);\n\n if (!documentType) return null;\n\n const error = fieldErrors.document;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-tax-id=\"\" data-fs-my-account-profile-field=\"document\">\n {savedValues.document ? maskDocumentValue(savedValues.document, documentType) : ''}\n </p>\n );\n }\n\n if (hasSavedDocument) {\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n readOnly\n aria-disabled=\"true\"\n title={lockedReason}\n value={maskDocumentValue(savedValues.document, documentType)}\n data-fs-my-account-profile-tax-id-readonly=\"\"\n />\n <Field.Description>{lockedReason}</Field.Description>\n </Field.Root>\n );\n }\n\n return (\n <DocumentField\n className={className}\n label={label}\n documentType={documentType}\n value={draft.document}\n onValueChange={(value) => setField('document', value)}\n invalid={!!error}\n errorMessage={error}\n disabled={pending}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n />\n );\n}\n\nexport type MyAccountProfileBirthDateControlProps = Readonly<{ label?: string; className?: string }>;\n\nexport const MyAccountProfileBirthDateControlDefinition = defineComponent<MyAccountProfileBirthDateControlProps>({\n name: 'MyAccountProfileBirthDateControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileBirthDateControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Birth Date Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Birth date', label: 'Label' },\n },\n guideline:\n 'Draft-bound, optional birth-date field over a native date input. Maps the native yyyy-mm-dd value to the stored profile format on read and write. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileBirthDateControl({\n label = 'Birth date',\n className,\n}: MyAccountProfileBirthDateControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'birthDate', normalize: (value) => toStoredDate(value) });\n }, [registerField]);\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-birth-date=\"\" data-fs-my-account-profile-field=\"birthDate\">\n {savedValues.birthDate}\n </p>\n );\n }\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n setField('birthDate', toStoredDate(event.target.value));\n }\n\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-birth-date=\"\"\n data-fs-my-account-profile-field=\"birthDate\"\n >\n <Field.Label>{label}</Field.Label>\n <Input type=\"date\" value={toNativeDate(draft.birthDate)} onChange={handleChange} disabled={pending} />\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileGenderOption = Readonly<{ value: string; label: string }>;\n\nexport type MyAccountProfileGenderControlProps = Readonly<{\n label?: string;\n placeholder?: string;\n clearLabel?: string;\n options?: readonly MyAccountProfileGenderOption[];\n className?: string;\n}>;\n\nexport const MyAccountProfileGenderControlDefinition = defineComponent<MyAccountProfileGenderControlProps>({\n name: 'MyAccountProfileGenderControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileGenderControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Gender Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Gender', label: 'Label' },\n placeholder: { type: 'string', default: 'Select', label: 'Placeholder' },\n clearLabel: { type: 'string', default: 'Clear', label: 'Clear button label' },\n },\n guideline:\n 'Draft-bound, optional gender field over a store-configurable set of options (the options prop). Free-string storage — no server-side enum. A Clear button erases a selected value back to empty, since the Select itself offers no such option. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileGenderControl({\n label = 'Gender',\n placeholder = 'Select',\n clearLabel = 'Clear',\n options = DEFAULT_GENDER_OPTIONS,\n className,\n}: MyAccountProfileGenderControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'gender' });\n }, [registerField]);\n\n if (mode === 'view') {\n const selected = options.find((option) => option.value === savedValues.gender);\n return (\n <p className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n {selected?.label ?? savedValues.gender}\n </p>\n );\n }\n\n return (\n <div className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n <Select.Root value={draft.gender} onValueChange={(value) => setField('gender', value ?? '')} disabled={pending}>\n <Select.Label>{label}</Select.Label>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n <Select.Icon />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n <Select.List>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n {draft.gender ? (\n <button\n type=\"button\"\n onClick={() => setField('gender', '')}\n disabled={pending}\n data-fs-my-account-profile-gender-clear=\"\"\n >\n {clearLabel}\n </button>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfile = {\n Root: MyAccountProfileRoot,\n RootDefinition: MyAccountProfileRootDefinition,\n EditButton: MyAccountProfileEditButton,\n EditButtonDefinition: MyAccountProfileEditButtonDefinition,\n SaveButton: MyAccountProfileSaveButton,\n SaveButtonDefinition: MyAccountProfileSaveButtonDefinition,\n CancelButton: MyAccountProfileCancelButton,\n CancelButtonDefinition: MyAccountProfileCancelButtonDefinition,\n Email: MyAccountProfileEmail,\n EmailDefinition: MyAccountProfileEmailDefinition,\n Skeleton: MyAccountProfileSkeleton,\n SkeletonDefinition: MyAccountProfileSkeletonDefinition,\n FirstNameControl: MyAccountProfileFirstNameControl,\n FirstNameControlDefinition: MyAccountProfileFirstNameControlDefinition,\n LastNameControl: MyAccountProfileLastNameControl,\n LastNameControlDefinition: MyAccountProfileLastNameControlDefinition,\n PhoneControl: MyAccountProfilePhoneControl,\n PhoneControlDefinition: MyAccountProfilePhoneControlDefinition,\n TaxIdControl: MyAccountProfileTaxIdControl,\n TaxIdControlDefinition: MyAccountProfileTaxIdControlDefinition,\n BirthDateControl: MyAccountProfileBirthDateControl,\n BirthDateControlDefinition: MyAccountProfileBirthDateControlDefinition,\n GenderControl: MyAccountProfileGenderControl,\n GenderControlDefinition: MyAccountProfileGenderControlDefinition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,WAAyB;;;;;;;;;;;;;;;;;AAuD/B,MAAM,aAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAuDA,MAAM,8BAA8B;AACpC,MAAM,wBAAwB;AAE9B,SAAS,iBAAiB,OAAiE;CACzF,OAAO;EACL,WAAW,OAAO,aAAa;EAC/B,UAAU,OAAO,YAAY;EAC7B,WAAW,OAAO,aAAa;EAC/B,aAAa,OAAO,eAAe;EACnC,UAAU,OAAO,YAAY;EAC7B,WAAW,OAAO,aAAa;EAC/B,QAAQ,OAAO,UAAU;CAC3B;AACF;;;;;;;AAQA,SAAS,aAAa,QAAwB;CAC5C,MAAM,CAAC,YAAY,OAAO,MAAM,GAAG;CACnC,OA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AAC,OAAO,MAAR;GAAa,OAAO,MAAM;GAAQ,gBAAgB,UAAU,SAAS,UAAU,SAAS,EAAE;GAAG,UAAU;GAAvG,UAAA;IACE,oBAAC,OAAO,OAAR,EAAA,UAAe,MAAoB,CAAA;IACnC,qBAAC,OAAO,SAAR,EAAA,UAAA,CACE,oBAAC,OAAO,OAAR,EAA2B,YAAc,CAAA,GACzC,oBAAC,OAAO,MAAR,CAAc,CAAA,CACA,EAAA,CAAA;IAChB,oBAAC,OAAO,QAAR,EAAA,UACE,oBAAC,OAAO,YAAR,EAAA,UACE,oBAAC,OAAO,OAAR,EAAA,UACE,oBAAC,OAAO,MAAR,EAAA,UACG,QAAQ,KAAK,WACZ,oBAAC,OAAO,MAAR;KAAgC,OAAO,OAAO;KAC5C,UAAA,oBAAC,OAAO,UAAR,EAAA,UAAkB,OAAO,MAAuB,CAAA;IACrC,GAFK,OAAO,KAEZ,CACd,EACU,CAAA,EACD,CAAA,EACG,CAAA,EACN,CAAA;GACJ;EACZ,CAAA,GAAA,MAAM,SACL,oBAAC,UAAD;GACE,MAAK;GACL,eAAe,SAAS,UAAU,EAAE;GACpC,UAAU;GACV,2CAAwC;GAEvC,UAAA;EACK,CAAA,IACN,IACD;;AAET;AAMA,MAAa,mBAAmB;CAC9B,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,sBAAsB;CACtB,YAAY;CACZ,sBAAsB;CACtB,cAAc;CACd,wBAAwB;CACxB,OAAO;CACP,iBAAiB;CACjB,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,4BAA4B;CAC5B,iBAAiB;CACjB,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,cAAc;CACd,wBAAwB;CACxB,kBAAkB;CAClB,4BAA4B;CAC5B,eAAe;CACf,yBAAyB;AAC3B"}
|
|
@@ -14,7 +14,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
/**
|
|
15
15
|
* Shipping address step (T2 — Enter and save the delivery address).
|
|
16
16
|
* Single-file matter per ADR-0001; batches form state and writes once via shipping.setAddress.
|
|
17
|
-
* Controls are thin context-bound components that read/write draft state (
|
|
17
|
+
* Controls are thin context-bound components that read/write draft state (docs/storefront-core/reference-cart.md § Delivery).
|
|
18
18
|
*/
|
|
19
19
|
const fragment = `
|
|
20
20
|
fragment ShippingAddressData on Query {
|