@kotao/storefront 0.2.1 → 0.2.3
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/chunk-4OQYNUGM.js +29 -0
- package/dist/chunk-4OQYNUGM.js.map +1 -0
- package/dist/{chunk-U5677AEA.js → chunk-4TEFGD42.js} +343 -40
- package/dist/chunk-4TEFGD42.js.map +1 -0
- package/dist/chunk-7MTCGXIG.js +144 -0
- package/dist/chunk-7MTCGXIG.js.map +1 -0
- package/dist/{chunk-GCQI6OKH.js → chunk-H3D7BAOL.js} +3 -26
- package/dist/chunk-H3D7BAOL.js.map +1 -0
- package/dist/chunk-IIOHENCG.js +239 -0
- package/dist/chunk-IIOHENCG.js.map +1 -0
- package/dist/chunk-M7BPQ54D.js +26 -0
- package/dist/chunk-M7BPQ54D.js.map +1 -0
- package/dist/{chunk-ISAFEOR2.js → chunk-PXVDVUFX.js} +3 -2
- package/dist/chunk-PXVDVUFX.js.map +1 -0
- package/dist/chunk-VV653S52.js +246 -0
- package/dist/chunk-VV653S52.js.map +1 -0
- package/dist/chunk-WG7HYVHJ.js +38 -0
- package/dist/chunk-WG7HYVHJ.js.map +1 -0
- package/dist/{client-D9YYA2w6.d.ts → client-D51WdvYR.d.ts} +55 -8
- package/dist/client-bsiNPHBi.d.ts +159 -0
- package/dist/createCartHandler-C4RrPwSG.d.ts +58 -0
- package/dist/editor.d.ts +1 -1
- package/dist/events-react.d.ts +68 -0
- package/dist/events-react.js +557 -0
- package/dist/events-react.js.map +1 -0
- package/dist/events.d.ts +18 -0
- package/dist/events.js +5 -0
- package/dist/events.js.map +1 -0
- package/dist/fetch-M3Y-fQrW.d.ts +47 -0
- package/dist/forms.d.ts +58 -0
- package/dist/forms.js +3 -0
- package/dist/forms.js.map +1 -0
- package/dist/http-types-CGh8WGHB.d.ts +11 -0
- package/dist/index.d.ts +75 -12
- package/dist/index.js +55 -8
- package/dist/index.js.map +1 -1
- package/dist/offer-token-C-nk_nj8.d.ts +16 -0
- package/dist/{pagination-CPgH3fAa.d.ts → pagination-DCrQk02Q.d.ts} +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/react-router.d.ts +12 -6
- package/dist/react-router.js +4 -2
- package/dist/react-router.js.map +1 -1
- package/dist/react.d.ts +30 -7
- package/dist/react.js +275 -156
- package/dist/react.js.map +1 -1
- package/dist/{routing-BfUp49o8.d.ts → routing-sEonP93J.d.ts} +26 -59
- package/dist/seo.d.ts +4 -1
- package/dist/seo.js +1 -1
- package/dist/settings.d.ts +6 -39
- package/dist/settings.js +2 -1
- package/dist/{shop-DkQmro-Y.d.ts → shop-BJSvtmnV.d.ts} +2 -2
- package/dist/{store-DQK1nhob.d.ts → store-CtCWHI8H.d.ts} +1 -1
- package/dist/types-CSNXbGFW.d.ts +108 -0
- package/dist/{types-Df3bGbKU.d.ts → types-bcbQzx87.d.ts} +1 -1
- package/package.json +13 -1
- package/dist/chunk-GCQI6OKH.js.map +0 -1
- package/dist/chunk-ISAFEOR2.js.map +0 -1
- package/dist/chunk-U5677AEA.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/events/react.tsx"],"names":["maximum"],"mappings":";;;;;;;AAsCO,SAAS,qBAAqB,KAAA,EAOnC;AACA,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAiC,MAAM,CAAA;AACjE,EAAA,MAAM,UAAA,GAAa,OAAO,CAAC,CAAA;AAC3B,EAAA,MAAM,cAAA,GAAiB,OAAsB,IAAI,CAAA;AACjD,EAAA,MAAM,cAAA,GAAiB,OAAsB,IAAI,CAAA;AACjD,EAAA,MAAM,YAAA,GAAe,MAAA,CAAO,KAAA,CAAM,MAAM,CAAA;AACxC,EAAA,MAAM,cAAA,GAAiB,MAAA,CAAO,KAAA,CAAM,iBAAiB,CAAA;AAErD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IACE,aAAa,OAAA,KAAY,KAAA,CAAM,UAC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QAAA,EAAA,MAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ","file":"events-react.js","sourcesContent":["import {\n type FormEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport { StorefrontFormFields } from '../react/form'\nimport type { FormAnswers, PublicForm } from '../forms'\nimport {\n consumeOfferTokenFragment,\n offerTokenHrefMarker,\n type OfferTokenHistory,\n type OfferTokenLocation,\n} from './offer-token'\nimport { StorefrontEventsRequestError, type EventsClient } from './client'\nimport type {\n EventApprovalOfferResolution,\n EventCheckoutSession,\n EventRegistrationSubmission,\n PublicEvent,\n PublicEventForm,\n PublicEventTicketType,\n} from './types'\n\nexport type EventRegistrationState =\n | 'idle'\n | 'submitting'\n | 'awaiting_approval'\n | 'waitlisted'\n | 'checkout_ready'\n | 'request_error'\n\nexport function useEventRegistration(input: {\n readonly client: EventsClient\n readonly onCheckoutSession?: (session: EventCheckoutSession) => void\n}): {\n readonly state: EventRegistrationState\n readonly submit: (submission: EventRegistrationSubmission) => Promise<void>\n readonly reset: () => void\n} {\n const [state, setState] = useState<EventRegistrationState>('idle')\n const generation = useRef(0)\n const logicalPayload = useRef<string | null>(null)\n const idempotencyKey = useRef<string | null>(null)\n const activeClient = useRef(input.client)\n const activeCallback = useRef(input.onCheckoutSession)\n\n useEffect(() => {\n if (\n activeClient.current !== input.client ||\n activeCallback.current !== input.onCheckoutSession\n ) {\n activeClient.current = input.client\n activeCallback.current = input.onCheckoutSession\n generation.current += 1\n setState('idle')\n }\n }, [input.client, input.onCheckoutSession])\n\n useEffect(\n () => () => {\n generation.current += 1\n },\n [],\n )\n\n const reset = useCallback(() => {\n generation.current += 1\n setState('idle')\n }, [])\n\n async function submit(submission: EventRegistrationSubmission): Promise<void> {\n const attempt = ++generation.current\n const prepared = registrationSubmission(submission, logicalPayload, idempotencyKey)\n setState('submitting')\n try {\n const result = await input.client.submitRegistration(prepared)\n if (attempt !== generation.current) return\n if (result.kind === 'checkout') {\n input.onCheckoutSession?.(result.checkoutSession)\n setState('checkout_ready')\n } else if (result.kind === 'approval') {\n setState('awaiting_approval')\n } else {\n setState('waitlisted')\n }\n } catch {\n if (attempt !== generation.current) return\n setState('request_error')\n }\n }\n\n return { state, submit, reset }\n}\n\nfunction registrationKey(mode: PublicEvent['registrationMode']): string {\n const kind = mode === 'approval_then_payment' ? 'application' : 'checkout'\n return `events-${kind}-${Date.now()}-${Math.random().toString(36).slice(2)}`\n}\n\nfunction stablePayload(value: unknown): string {\n return JSON.stringify(value, (_key, item: unknown) => {\n if (item === null || typeof item !== 'object' || Array.isArray(item)) return item\n return Object.fromEntries(\n Object.entries(item as Record<string, unknown>).sort(([left], [right]) =>\n left.localeCompare(right),\n ),\n )\n })\n}\n\nfunction registrationSubmission(\n submission: EventRegistrationSubmission,\n previousPayload: { current: string | null },\n previousKey: { current: string | null },\n): EventRegistrationSubmission {\n if (submission.registrationMode === 'waitlist_only') return submission\n if (submission.idempotencyKey.trim() !== '') return submission\n const payload = {\n registrationMode: submission.registrationMode,\n handle: submission.handle,\n input: submission.input,\n }\n const identity = stablePayload(payload)\n if (identity !== previousPayload.current || previousKey.current === null) {\n previousPayload.current = identity\n previousKey.current = registrationKey(submission.registrationMode)\n }\n return { ...submission, idempotencyKey: previousKey.current }\n}\n\n/** Adapts an event-owned form without claiming that it is a published standalone Forms version. */\nfunction eventFormForRenderer(form: PublicEventForm): PublicForm {\n return {\n definition: {\n id: form.definitionId,\n handle: form.definitionId,\n title: form.title,\n },\n version: {\n id: form.versionId,\n definitionId: form.definitionId,\n schema: form.schema,\n },\n } as PublicForm\n}\n\nconst REGISTRATION_COPY = {\n en: {\n submit: 'Register',\n submitting: 'Submitting…',\n awaiting_approval: 'Application received. Awaiting approval.',\n waitlisted: 'You joined the waitlist.',\n checkout_ready: 'Registration ready for checkout.',\n request_error: 'Something went wrong. Please try again.',\n email: 'Email',\n quantity: 'Quantity',\n ticket: 'Ticket',\n },\n de: {\n submit: 'Anmelden',\n submitting: 'Wird gesendet…',\n awaiting_approval: 'Anmeldung erhalten. Sie wartet auf Freigabe.',\n waitlisted: 'Du stehst auf der Warteliste.',\n checkout_ready: 'Die Anmeldung kann bezahlt werden.',\n request_error: 'Etwas ist schiefgelaufen. Bitte versuche es erneut.',\n email: 'E-Mail',\n quantity: 'Anzahl',\n ticket: 'Ticket',\n },\n} as const\n\nexport interface EventRegistrationLabels {\n readonly submit: string\n readonly submitting: string\n readonly awaiting_approval: string\n readonly waitlisted: string\n readonly checkout_ready: string\n readonly request_error: string\n readonly email: string\n readonly quantity: string\n readonly ticket: string\n}\n\nfunction registrationCopy(locale: string): EventRegistrationLabels {\n return locale.toLowerCase().startsWith('de') ? REGISTRATION_COPY.de : REGISTRATION_COPY.en\n}\n\nfunction selectable(ticket: PublicEventTicketType): boolean {\n return (\n ticket.salesState === 'on_sale' &&\n ticket.maxPerOrder >= ticket.minPerOrder &&\n (ticket.available === null || ticket.available >= ticket.minPerOrder)\n )\n}\n\nexport interface EventRegistrationFormProps {\n readonly event: PublicEvent\n readonly locale: string\n readonly client: EventsClient\n readonly cartToken?: string\n readonly fallbackLocale?: string\n readonly onCheckoutSession?: (session: EventCheckoutSession) => void\n readonly labels?: Partial<EventRegistrationLabels>\n readonly className?: string\n}\n\nexport function EventRegistrationForm({\n event,\n locale,\n client,\n cartToken,\n fallbackLocale,\n onCheckoutSession,\n labels,\n className,\n}: EventRegistrationFormProps) {\n const tickets = event.occurrences.flatMap((occurrence) => occurrence.ticketTypes)\n const firstTicket = tickets.find(selectable)\n const [ticketTypeId, setTicketTypeId] = useState(firstTicket?.id ?? '')\n const ticket = tickets.find((candidate) => candidate.id === ticketTypeId)\n const initialQuantity = ticket?.minPerOrder ?? 1\n const [quantity, setQuantity] = useState(initialQuantity)\n const [email, setEmail] = useState('')\n const [preflightError, setPreflightError] = useState(false)\n const [buyerAnswers, setBuyerAnswers] = useState<FormAnswers>({})\n const [participantAnswers, setParticipantAnswers] = useState<FormAnswers[]>(() =>\n Array.from({ length: initialQuantity }, () => ({})),\n )\n const generatedId = useId()\n const instanceId = `event-registration-${generatedId.replaceAll(':', '')}`\n const selectedProjectionIdentity = stablePayload({\n buyerForm: ticket?.buyerForm ?? null,\n participantForm: ticket?.participantForm ?? null,\n })\n const previousProjection = useRef(selectedProjectionIdentity)\n const [projectionGeneration, setProjectionGeneration] = useState(0)\n const registration = useEventRegistration({\n client,\n ...(onCheckoutSession ? { onCheckoutSession } : {}),\n })\n const copy = { ...registrationCopy(locale), ...labels }\n const previousEvent = useRef(`${event.id}:${event.handle}:${event.registrationMode}:${locale}`)\n const previousCartToken = useRef(cartToken)\n\n useEffect(() => {\n const eventIdentity = `${event.id}:${event.handle}:${event.registrationMode}:${locale}`\n if (previousEvent.current !== eventIdentity) {\n previousEvent.current = eventIdentity\n const nextTicket = tickets.find(selectable)\n setTicketTypeId(nextTicket?.id ?? '')\n setQuantity(nextTicket?.minPerOrder ?? 1)\n setEmail('')\n setBuyerAnswers({})\n setParticipantAnswers(Array.from({ length: nextTicket?.minPerOrder ?? 1 }, () => ({})))\n previousProjection.current = selectedProjectionIdentity\n setProjectionGeneration((current) => current + 1)\n setPreflightError(false)\n registration.reset()\n } else if (previousProjection.current !== selectedProjectionIdentity) {\n previousProjection.current = selectedProjectionIdentity\n setBuyerAnswers({})\n setParticipantAnswers(Array.from({ length: quantity }, () => ({})))\n setProjectionGeneration((current) => current + 1)\n setPreflightError(false)\n registration.reset()\n }\n if (previousCartToken.current !== cartToken) {\n previousCartToken.current = cartToken\n setPreflightError(false)\n registration.reset()\n }\n }, [\n cartToken,\n event.handle,\n event.id,\n event.registrationMode,\n locale,\n quantity,\n selectedProjectionIdentity,\n ])\n\n function selectTicket(nextId: string): void {\n const next = tickets.find((candidate) => candidate.id === nextId)\n if (!next || !selectable(next)) return\n setTicketTypeId(nextId)\n setQuantity(next.minPerOrder)\n setBuyerAnswers({})\n setParticipantAnswers(Array.from({ length: next.minPerOrder }, () => ({})))\n registration.reset()\n setPreflightError(false)\n }\n\n function updateQuantity(next: number): void {\n if (!ticket) return\n const maximum = Math.min(ticket.maxPerOrder, ticket.available ?? ticket.maxPerOrder)\n const normalized = Number.isFinite(next) ? Math.trunc(next) : ticket.minPerOrder\n const bounded = Math.max(ticket.minPerOrder, Math.min(maximum, normalized))\n setQuantity(bounded)\n setParticipantAnswers((current) =>\n Array.from({ length: bounded }, (_, index) => current[index] ?? {}),\n )\n registration.reset()\n setPreflightError(false)\n }\n\n async function handleSubmit(submitEvent: FormEvent<HTMLFormElement>): Promise<void> {\n submitEvent.preventDefault()\n if (!ticket || !selectable(ticket)) {\n setPreflightError(true)\n return\n }\n setPreflightError(false)\n const buyer = ticket.buyerForm\n ? { versionId: ticket.buyerForm.versionId, answers: buyerAnswers }\n : undefined\n const participants = ticket.participantForm\n ? participantAnswers.map((answers) => ({\n versionId: ticket.participantForm!.versionId,\n answers,\n }))\n : undefined\n\n let submission: EventRegistrationSubmission\n if (event.registrationMode === 'instant') {\n if (!cartToken) {\n setPreflightError(true)\n return\n }\n submission = {\n registrationMode: 'instant',\n handle: event.handle,\n idempotencyKey: '',\n input: {\n ticketTypeId: ticket.id,\n quantity,\n cartToken,\n locale,\n ...(buyer ? { buyer } : {}),\n ...(participants ? { participants } : {}),\n },\n }\n } else if (event.registrationMode === 'approval_then_payment') {\n submission = {\n registrationMode: 'approval_then_payment',\n handle: event.handle,\n idempotencyKey: '',\n input: {\n ticketTypeId: ticket.id,\n quantity,\n contactEmail: email,\n locale,\n ...(buyer ? { buyer } : {}),\n ...(participants ? { participants } : {}),\n },\n }\n } else {\n submission = {\n registrationMode: 'waitlist_only',\n handle: event.handle,\n input: { ticketTypeId: ticket.id, quantity, email },\n }\n }\n await registration.submit(submission)\n }\n\n const maximum = ticket\n ? Math.min(ticket.maxPerOrder, ticket.available ?? ticket.maxPerOrder)\n : undefined\n const renderedState = preflightError ? 'request_error' : registration.state\n const status = renderedState === 'idle' ? '' : copy[renderedState]\n\n return (\n <form className={className} data-kotao-event-registration onSubmit={handleSubmit}>\n <label>\n <span>{copy.ticket}</span>\n <select\n data-kotao-event-ticket\n value={ticketTypeId}\n onChange={(changeEvent) => selectTicket(changeEvent.currentTarget.value)}\n >\n {tickets.map((candidate) => (\n <option key={candidate.id} value={candidate.id} disabled={!selectable(candidate)}>\n {candidate.title}\n </option>\n ))}\n </select>\n </label>\n <label>\n <span>{copy.quantity}</span>\n <input\n name=\"quantity\"\n type=\"number\"\n value={quantity}\n min={ticket?.minPerOrder}\n max={maximum}\n required\n step={1}\n onChange={(changeEvent) => updateQuantity(changeEvent.currentTarget.valueAsNumber)}\n />\n </label>\n {event.registrationMode !== 'instant' ? (\n <label>\n <span>{copy.email}</span>\n <input\n type=\"email\"\n required\n value={email}\n onChange={(changeEvent) => {\n setEmail(changeEvent.currentTarget.value)\n setPreflightError(false)\n registration.reset()\n }}\n />\n </label>\n ) : null}\n {ticket?.buyerForm ? (\n <div data-kotao-event-buyer-form>\n <StorefrontFormFields\n key={`${projectionGeneration}:${ticket.id}:${ticket.buyerForm.versionId}`}\n form={eventFormForRenderer(ticket.buyerForm)}\n locale={locale}\n {...(fallbackLocale === undefined ? {} : { fallbackLocale })}\n answers={buyerAnswers}\n idPrefix={`${instanceId}-event-${event.id}-ticket-${ticket.id}-buyer`}\n onAnswersChange={(next) => {\n setBuyerAnswers(next)\n setPreflightError(false)\n registration.reset()\n }}\n />\n </div>\n ) : null}\n {ticket?.participantForm\n ? participantAnswers.map((answers, index) => (\n <div\n key={`${projectionGeneration}:${ticket.id}:${ticket.participantForm!.versionId}:${index}`}\n data-kotao-event-participant-form\n >\n <StorefrontFormFields\n form={eventFormForRenderer(ticket.participantForm!)}\n locale={locale}\n {...(fallbackLocale === undefined ? {} : { fallbackLocale })}\n answers={answers}\n idPrefix={`${instanceId}-event-${event.id}-ticket-${ticket.id}-participant-${index}`}\n onAnswersChange={(next) => {\n setParticipantAnswers((current) =>\n current.map((value, participantIndex) =>\n participantIndex === index ? next : value,\n ),\n )\n setPreflightError(false)\n registration.reset()\n }}\n />\n </div>\n ))\n : null}\n <button type=\"submit\" disabled={registration.state === 'submitting'}>\n {copy.submit}\n </button>\n <p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-kotao-event-state={renderedState}>\n {status}\n </p>\n </form>\n )\n}\n\nexport type EventOfferState =\n | 'resolving'\n | 'active'\n | 'claiming'\n | 'claimed'\n | 'expired'\n | 'unavailable'\n | 'request_error'\n\nexport interface EventApprovalOfferLabels {\n readonly resolving: ReactNode\n readonly claim: ReactNode\n readonly resume: ReactNode\n readonly claiming: ReactNode\n readonly claimed: ReactNode\n readonly expired: ReactNode\n readonly unavailable: ReactNode\n readonly requestError: ReactNode\n readonly retry?: ReactNode\n readonly expires: ReactNode\n}\n\nconst OFFER_LABELS: EventApprovalOfferLabels = {\n resolving: 'Loading offer…',\n claim: 'Claim offer',\n resume: 'Continue to checkout',\n claiming: 'Starting checkout…',\n claimed: 'Offer claimed. Continue to checkout.',\n expired: 'This offer has expired.',\n unavailable: 'This offer is not available.',\n requestError: 'Something went wrong. Please try again.',\n retry: 'Try again',\n expires: 'Offer expires at',\n}\n\nexport interface EventApprovalOfferProps {\n readonly client: EventsClient\n readonly offerId: string\n readonly cartToken: string\n readonly locale: string\n readonly idempotencyKey?: string\n readonly location?: OfferTokenLocation\n readonly history?: OfferTokenHistory\n readonly labels?: Partial<EventApprovalOfferLabels>\n readonly onCheckoutSession?: (session: EventCheckoutSession) => void\n readonly initialResolution?: EventApprovalOfferResolution\n readonly initialState?: Exclude<EventOfferState, 'resolving' | 'active' | 'claiming'>\n readonly className?: string\n}\n\nfunction browserLocation(): OfferTokenLocation | undefined {\n return typeof window === 'undefined' ? undefined : window.location\n}\n\nfunction browserHistory(): OfferTokenHistory | undefined {\n return typeof window === 'undefined' ? undefined : window.history\n}\n\nexport function EventApprovalOffer({\n client,\n offerId,\n cartToken,\n locale,\n idempotencyKey,\n location,\n history,\n labels,\n onCheckoutSession,\n initialResolution,\n initialState,\n className,\n}: EventApprovalOfferProps) {\n const copy = { ...OFFER_LABELS, ...labels }\n const token = useRef<string | null>(null)\n const consumedHrefMarkers = useRef(new Set<string>())\n const offerGeneration = useRef(0)\n const resolvedGeneration = useRef<number | null>(initialResolution ? 0 : null)\n const mounted = useRef(false)\n const strictCleanupGeneration = useRef<number | null>(null)\n const activeDependencies = useRef({ client, cartToken, locale, onCheckoutSession })\n const claimIdempotencyKey = useMemo(\n () => idempotencyKey ?? `events-claim-${Date.now()}-${Math.random().toString(36).slice(2)}`,\n [idempotencyKey, offerId],\n )\n const resolveIdempotencyKey = useMemo(\n () => `events-resolve-${Date.now()}-${Math.random().toString(36).slice(2)}`,\n [offerId],\n )\n const [canClaim, setCanClaim] = useState(initialResolution?.state === 'active')\n const [resolution, setResolution] = useState<EventApprovalOfferResolution | null>(\n initialResolution ?? null,\n )\n const [state, setState] = useState<EventOfferState>(\n initialResolution\n ? initialResolution.state === 'claimed'\n ? 'claimed'\n : 'active'\n : (initialState ?? 'resolving'),\n )\n\n async function resolveCapability(generation: number, claimToken: string): Promise<void> {\n try {\n const offer = await client.resolveOffer(offerId, claimToken, resolveIdempotencyKey)\n if (!mounted.current || generation !== offerGeneration.current) return\n resolvedGeneration.current = generation\n setResolution(offer)\n if (offer.state === 'claimed') setState('claimed')\n else if (new Date(offer.expiresAt).getTime() <= Date.now()) setState('expired')\n else setState('active')\n } catch (error) {\n if (!mounted.current || generation !== offerGeneration.current) return\n setState(\n error instanceof StorefrontEventsRequestError && error.status === 409\n ? 'unavailable'\n : 'request_error',\n )\n }\n }\n\n useLayoutEffect(() => {\n if (\n strictCleanupGeneration.current !== null &&\n offerGeneration.current === strictCleanupGeneration.current + 1\n ) {\n // React Strict Mode immediately remounts effects; restore the still-live attempt without\n // issuing a second capability-bearing request.\n offerGeneration.current = strictCleanupGeneration.current\n }\n strictCleanupGeneration.current = null\n mounted.current = true\n return () => {\n mounted.current = false\n strictCleanupGeneration.current = offerGeneration.current\n offerGeneration.current += 1\n }\n }, [])\n\n useLayoutEffect(() => {\n const previous = activeDependencies.current\n if (\n previous.client === client &&\n previous.cartToken === cartToken &&\n previous.locale === locale &&\n previous.onCheckoutSession === onCheckoutSession\n ) {\n return\n }\n activeDependencies.current = { client, cartToken, locale, onCheckoutSession }\n offerGeneration.current += 1\n resolvedGeneration.current = null\n token.current = null\n setCanClaim(false)\n setResolution(null)\n setState('unavailable')\n }, [cartToken, client, locale, onCheckoutSession])\n\n useLayoutEffect(() => {\n if (initialState !== undefined) return\n const currentLocation = location ?? browserLocation()\n const currentHistory = history ?? browserHistory()\n if (currentLocation === undefined || currentHistory === undefined) {\n if (initialResolution === undefined) setState('unavailable')\n return\n }\n const hrefMarker = offerTokenHrefMarker(currentLocation.href)\n if (consumedHrefMarkers.current.has(hrefMarker)) return\n consumedHrefMarkers.current.add(hrefMarker)\n offerGeneration.current += 1\n const generation = offerGeneration.current\n resolvedGeneration.current = null\n token.current = null\n setCanClaim(false)\n setResolution(null)\n setState('resolving')\n const claimToken = consumeOfferTokenFragment(currentLocation, currentHistory)\n consumedHrefMarkers.current.add(offerTokenHrefMarker(currentLocation.href))\n token.current = claimToken\n setCanClaim(claimToken !== null)\n if (claimToken === null) {\n if (initialResolution === undefined) setState('unavailable')\n return\n }\n void resolveCapability(generation, claimToken)\n })\n\n function retryResolve(): void {\n const claimToken = token.current\n if (claimToken === null) {\n setState('unavailable')\n return\n }\n const generation = offerGeneration.current\n setState('resolving')\n void resolveCapability(generation, claimToken)\n }\n\n async function claim(): Promise<void> {\n const claimToken = token.current\n const generation = offerGeneration.current\n if (\n claimToken === null ||\n resolvedGeneration.current !== generation ||\n resolution?.offerId !== offerId\n ) {\n setState('unavailable')\n return\n }\n setState('claiming')\n try {\n const session = await client.claimOffer(\n offerId,\n { claimToken, cartToken, locale },\n claimIdempotencyKey,\n )\n if (!mounted.current || generation !== offerGeneration.current) return\n token.current = null\n setCanClaim(false)\n setState('claimed')\n onCheckoutSession?.(session)\n } catch (error) {\n if (!mounted.current || generation !== offerGeneration.current) return\n setState(\n error instanceof StorefrontEventsRequestError && error.status === 409\n ? 'unavailable'\n : 'request_error',\n )\n }\n }\n\n const status =\n state === 'resolving'\n ? copy.resolving\n : state === 'claiming'\n ? copy.claiming\n : state === 'claimed'\n ? copy.claimed\n : state === 'expired'\n ? copy.expired\n : state === 'unavailable'\n ? copy.unavailable\n : state === 'request_error'\n ? copy.requestError\n : null\n\n return (\n <section className={className} data-kotao-event-approval-offer>\n {resolution ? (\n <header>\n <h1>{resolution.eventTitle}</h1>\n <p>\n {resolution.ticketTypeTitle} · {resolution.quantity}\n </p>\n <time dateTime={resolution.occurrenceStartsAt}>{resolution.occurrenceStartsAt}</time>\n </header>\n ) : null}\n {(state === 'active' ||\n (state === 'claimed' && canClaim) ||\n (state === 'request_error' && canClaim)) &&\n resolution ? (\n <>\n <p>\n {copy.expires}: <time dateTime={resolution.expiresAt}>{resolution.expiresAt}</time>\n </p>\n <button type=\"button\" onClick={claim}>\n {state === 'claimed' ? copy.resume : copy.claim}\n </button>\n </>\n ) : null}\n {state === 'request_error' && canClaim && resolution === null ? (\n <button type=\"button\" onClick={retryResolve}>\n {copy.retry}\n </button>\n ) : null}\n <p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {status}\n </p>\n </section>\n )\n}\n"]}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { C as CartHandler } from './createCartHandler-C4RrPwSG.js';
|
|
2
|
+
export { C as ClaimEventApprovalOffer, d as CreateEventApprovalRequest, e as CreateEventCheckoutSession, f as CreateEventWaitlistEntry, b as EventApprovalOfferResolution, g as EventApprovalRequestReceipt, a as EventCheckoutSession, h as EventFormAnswer, i as EventFormSubmissionInput, j as EventRegistrationMode, k as EventRegistrationResult, c as EventRegistrationSubmission, l as EventWaitlistReceipt, E as EventsClient, P as PublicEvent, m as PublicEventForm, n as PublicEventOccurrence, o as PublicEventTicketType, p as PublicEventVenue, S as StorefrontEventsRequestError, q as createEventsClient } from './client-bsiNPHBi.js';
|
|
3
|
+
export { a as OfferTokenHistory, O as OfferTokenLocation, c as consumeOfferTokenFragment, o as offerTokenHrefMarker } from './offer-token-C-nk_nj8.js';
|
|
4
|
+
import './client-D51WdvYR.js';
|
|
5
|
+
import './http-types-CGh8WGHB.js';
|
|
6
|
+
import './types-bcbQzx87.js';
|
|
7
|
+
import './types-CSNXbGFW.js';
|
|
8
|
+
|
|
9
|
+
declare class EventCartPreparationError extends Error {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
declare function eventCartToken(cartId: string): string;
|
|
13
|
+
declare function prepareEventCart(cart: CartHandler): Promise<{
|
|
14
|
+
cartToken: string;
|
|
15
|
+
headers: Headers;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export { EventCartPreparationError, eventCartToken, prepareEventCart };
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EventCartPreparationError, eventCartToken, prepareEventCart } from './chunk-4OQYNUGM.js';
|
|
2
|
+
export { consumeOfferTokenFragment, offerTokenHrefMarker } from './chunk-WG7HYVHJ.js';
|
|
3
|
+
export { StorefrontEventsRequestError, createEventsClient } from './chunk-7MTCGXIG.js';
|
|
4
|
+
//# sourceMappingURL=events.js.map
|
|
5
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"events.js"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SectionInstance, ValuesDocument } from '@kotao/storefront-contracts/theme';
|
|
2
|
+
import { a as StorefrontAuthHeader } from './client-D51WdvYR.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The stored settings a theme hydrates from (#93): the layout document's ordered section instances +
|
|
6
|
+
* the global theme tokens. Pass to {@link resolveThemeSettings} together with the theme's bundled
|
|
7
|
+
* section schemas + presets to produce the merged {@link ThemeSettingsSnapshot}.
|
|
8
|
+
*/
|
|
9
|
+
interface StoredThemeSettings {
|
|
10
|
+
readonly shopId: string;
|
|
11
|
+
readonly sections: readonly SectionInstance[];
|
|
12
|
+
readonly global: Record<string, unknown>;
|
|
13
|
+
readonly templates?: Readonly<Partial<Record<string, ValuesDocument>>>;
|
|
14
|
+
readonly sectionGroups?: Readonly<Partial<Record<string, ValuesDocument>>>;
|
|
15
|
+
}
|
|
16
|
+
interface FetchThemeSettingsOptions {
|
|
17
|
+
/** Injectable for tests; defaults to the global `fetch`. */
|
|
18
|
+
readonly fetch?: typeof fetch;
|
|
19
|
+
/** Same-origin settings endpoint (default `/api/storefront/settings`). */
|
|
20
|
+
readonly endpoint?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Explicit local-preview escape hatch for server-side theme workers that call the Kotao API directly.
|
|
23
|
+
* Production themes should keep the default same-origin path.
|
|
24
|
+
*/
|
|
25
|
+
readonly allowCrossOrigin?: boolean;
|
|
26
|
+
/** Optional server-side auth headers for local previews. Never pass browser-visible tokens here. */
|
|
27
|
+
readonly auth?: {
|
|
28
|
+
readonly token: string;
|
|
29
|
+
readonly tokenHeader?: StorefrontAuthHeader;
|
|
30
|
+
readonly siteId?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Gateway-signed shop-context headers (`x-kotao-shop` + `x-kotao-shop-signature`) to forward to the
|
|
34
|
+
* upstream, mirroring the storefront GraphQL client. Required for the SSR worker path: a Worker
|
|
35
|
+
* subrequest to its own zone bypasses the Gateway, so the shop context has to be re-attached
|
|
36
|
+
* explicitly and the request sent cross-origin to the API. `context.loadThemeSettings()` wires this
|
|
37
|
+
* automatically from the inbound request; pass it by hand only when calling `fetchThemeSettings` raw.
|
|
38
|
+
*/
|
|
39
|
+
readonly shopContextHeaders?: Readonly<Record<string, string>>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Fetch the shop's stored settings document via the same-origin `/api/storefront/settings` carve-out.
|
|
43
|
+
* The shop is resolved server-side from the Gateway-signed context — the theme sends no id and no token.
|
|
44
|
+
*/
|
|
45
|
+
declare function fetchThemeSettings(options?: FetchThemeSettingsOptions): Promise<StoredThemeSettings>;
|
|
46
|
+
|
|
47
|
+
export { type FetchThemeSettingsOptions as F, type StoredThemeSettings as S, fetchThemeSettings as f };
|
package/dist/forms.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { i as FormVisibilityRule, a as FormAnswers, F as FormVersionSchema, e as FormField, f as FormLocalizedText, g as FormRenderState, P as PublicForm, b as FormFieldErrors, h as FormSubmission } from './types-CSNXbGFW.js';
|
|
2
|
+
export { c as FormAnswer, d as FormBlock, j as PublicFormDefinition, k as PublicFormVersion } from './types-CSNXbGFW.js';
|
|
3
|
+
|
|
4
|
+
declare const FORM_ANSWER_PREFIX = "answers";
|
|
5
|
+
declare const ADDRESS_PROPERTIES: readonly ["line1", "line2", "city", "postalCode", "countryCode", "provinceCode"];
|
|
6
|
+
declare function formAnswerName(fieldKey: string, property?: string): string;
|
|
7
|
+
declare function resolveFormText(value: FormLocalizedText | undefined, locale: string, fallbackLocale?: string): string;
|
|
8
|
+
declare function evaluateFormRule(rule: FormVisibilityRule, answers: FormAnswers): boolean;
|
|
9
|
+
declare function isFormFieldVisible(field: FormField, answers: FormAnswers): boolean;
|
|
10
|
+
declare function formFields(schema: FormVersionSchema): FormField[];
|
|
11
|
+
declare function parseFormAnswers(schema: FormVersionSchema, data: FormData): FormAnswers;
|
|
12
|
+
|
|
13
|
+
interface RenderFormHtmlOptions extends FormRenderState {
|
|
14
|
+
locale: string;
|
|
15
|
+
action?: string;
|
|
16
|
+
formClass?: string;
|
|
17
|
+
fallbackLocale?: string;
|
|
18
|
+
idempotencyKey?: string;
|
|
19
|
+
honeypotName?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function renderFormHtml(form: PublicForm, options: RenderFormHtmlOptions): string;
|
|
22
|
+
|
|
23
|
+
interface FormFetchOptions {
|
|
24
|
+
fetch?: typeof fetch;
|
|
25
|
+
apiBaseUrl?: string;
|
|
26
|
+
headers?: ConstructorParameters<typeof Headers>[0];
|
|
27
|
+
signal?: AbortSignal;
|
|
28
|
+
}
|
|
29
|
+
interface SubmitFormInput extends FormFetchOptions {
|
|
30
|
+
versionId: string;
|
|
31
|
+
locale: string;
|
|
32
|
+
answers: FormAnswers;
|
|
33
|
+
idempotencyKey?: string;
|
|
34
|
+
}
|
|
35
|
+
declare class StorefrontFormRequestError extends Error {
|
|
36
|
+
readonly status: number;
|
|
37
|
+
readonly fieldErrors: FormFieldErrors;
|
|
38
|
+
constructor(status: number, message: string, fieldErrors?: FormFieldErrors);
|
|
39
|
+
}
|
|
40
|
+
declare function loadPublishedForm(handle: string, options?: FormFetchOptions): Promise<PublicForm>;
|
|
41
|
+
declare function submitPublishedForm(handle: string, input: SubmitFormInput): Promise<FormSubmission>;
|
|
42
|
+
|
|
43
|
+
interface ShopifyContactInput {
|
|
44
|
+
readonly name?: string | null;
|
|
45
|
+
readonly email: string;
|
|
46
|
+
readonly body: string;
|
|
47
|
+
readonly phone?: string | null;
|
|
48
|
+
}
|
|
49
|
+
type ShopifyContactCompatibility = {
|
|
50
|
+
readonly compatible: true;
|
|
51
|
+
readonly answers: FormAnswers;
|
|
52
|
+
} | {
|
|
53
|
+
readonly compatible: false;
|
|
54
|
+
readonly reason: 'not-contact-purpose' | 'unsupported-required-field' | 'incompatible-standard-field';
|
|
55
|
+
};
|
|
56
|
+
declare function adaptShopifyContactForm(form: PublicForm, input: ShopifyContactInput): ShopifyContactCompatibility;
|
|
57
|
+
|
|
58
|
+
export { ADDRESS_PROPERTIES, FORM_ANSWER_PREFIX, FormAnswers, type FormFetchOptions, FormField, FormFieldErrors, FormLocalizedText, FormRenderState, FormSubmission, FormVersionSchema, FormVisibilityRule, PublicForm, type RenderFormHtmlOptions, type ShopifyContactCompatibility, type ShopifyContactInput, StorefrontFormRequestError, type SubmitFormInput, adaptShopifyContactForm, evaluateFormRule, formAnswerName, formFields, isFormFieldVisible, loadPublishedForm, parseFormAnswers, renderFormHtml, resolveFormText, submitPublishedForm };
|
package/dist/forms.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ADDRESS_PROPERTIES, FORM_ANSWER_PREFIX, StorefrontFormRequestError, adaptShopifyContactForm, evaluateFormRule, formAnswerName, formFields, isFormFieldVisible, loadPublishedForm, parseFormAnswers, renderFormHtml, resolveFormText, submitPublishedForm } from './chunk-IIOHENCG.js';
|
|
2
|
+
//# sourceMappingURL=forms.js.map
|
|
3
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"forms.js"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Structural Headers-compatible value without depending on an ambient `HeadersInit` alias. */
|
|
2
|
+
interface StorefrontHeadersLike {
|
|
3
|
+
forEach(callback: (value: string, key: string) => void): void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Header input accepted by storefront clients. This preserves the iterable and record shapes
|
|
7
|
+
* accepted by the Web Headers constructor while remaining portable to Node-only declarations.
|
|
8
|
+
*/
|
|
9
|
+
type StorefrontHeadersInit = StorefrontHeadersLike | Iterable<Iterable<string>> | Record<string, string>;
|
|
10
|
+
|
|
11
|
+
export type { StorefrontHeadersInit as S };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import {
|
|
3
|
-
export { k as CART_FORM_ACTIONS,
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import {
|
|
7
|
-
export {
|
|
8
|
-
import {
|
|
9
|
-
export {
|
|
1
|
+
export { c as CacheCustom, d as CacheLong, e as CacheNone, f as CacheShort, C as CacheStrategy, H as HydrogenStorefrontClientOptions, K as KotaoCache, g as StaleIfErrorFallback, h as Storefront, a as StorefrontAuthHeader, i as StorefrontCache, b as StorefrontCacheInput, j as StorefrontCacheQueryOptions, k as StorefrontCacheRequest, S as StorefrontClient, l as StorefrontClientOptions, m as StorefrontClientResult, n as StorefrontDefaultCache, o as StorefrontQueryOptions, p as StorefrontQueryTimeoutError, q as StorefrontUpstreamError, r as createCache, s as createStorefrontClient, t as generateCacheControlHeader } from './client-D51WdvYR.js';
|
|
2
|
+
import { C as Cart } from './types-bcbQzx87.js';
|
|
3
|
+
export { k as CART_FORM_ACTIONS, b as CartAttribute, l as CartBuyerIdentity, c as CartBuyerIdentityInput, h as CartDeliveryAddress, j as CartFormAction, m as CartLine, a as CartLineInput, e as CartLineUpdateInput, f as CartMetafield, g as CartMetafieldIdentifier, d as CartMutationResult, i as CartSelectedDeliveryOption, n as CartUserError, o as HydrogenCart, p as HydrogenCartCreateInput, q as HydrogenCartMutationResult, H as HydrogenSession, r as HydrogenSessionData } from './types-bcbQzx87.js';
|
|
4
|
+
import { c as ConsentBucket, C as ConsentState, B as BoundNonceProvider } from './shop-BJSvtmnV.js';
|
|
5
|
+
export { d as ANALYTICS_EVENTS, b as AnalyticsBus, e as AnalyticsBusOptions, A as AnalyticsContext, a as AnalyticsEmitter, f as AnalyticsEventMap, h as AnalyticsEventName, i as AnalyticsGeo, j as CONSENT_BUCKETS, k as CONSENT_COOKIE, l as CartForm, m as CartFormProps, n as CartViewedPayload, o as CollectionViewedPayload, D as DENIED_CONSENT, E as EventHandler, G as GRANTED_CONSENT, p as GetShopAnalyticsOptions, P as PageViewedPayload, q as PixelEvent, r as PixelSend, s as PixelTransport, t as PixelTransportOptions, v as ProductAddedToCartPayload, w as ProductViewedPayload, x as SearchViewedPayload, S as ShopAnalytics, y as buildConsentCookie, z as createAnalyticsBus, F as createAnalyticsEmitter, H as createPixelTransport, I as getShopAnalytics, J as isGranted, K as mergeConsent, L as parseConsent, M as readConsentCookie, N as serializeConsent } from './shop-BJSvtmnV.js';
|
|
6
|
+
import { a as CartDispatchAction } from './createCartHandler-C4RrPwSG.js';
|
|
7
|
+
export { b as CartGetId, C as CartHandler, c as CartSetId, d as CreateCartHandlerOptions, H as HydrogenCartHandlerOptions, R as RequestCartHandlerOptions, e as cartGetIdDefault, f as cartSetIdDefault, g as createCartHandler } from './createCartHandler-C4RrPwSG.js';
|
|
8
|
+
import { a as ThemeSettingsSnapshot, R as ResolvedSettings } from './store-CtCWHI8H.js';
|
|
9
|
+
export { b as ResolvedBlock, c as ResolvedSection, T as ThemeSettingsStore, d as createThemeSettingsStore } from './store-CtCWHI8H.js';
|
|
10
|
+
import { C as CustomerAccountClient } from './routing-sEonP93J.js';
|
|
11
|
+
export { A as Address, c as AddressConnection, d as CustomerAccount, e as CustomerAccountError, f as CustomerAccountErrorCode, G as GEO_HEADER, g as GEO_SIGNATURE_HEADER, h as Geo, a as KotaoContext, K as KotaoEnv, b as KotaoSession, L as LocalizePathOptions, M as Money, O as Order, i as OrderConnection, j as OrderPageInfo, k as OrdersOptions, R as ROUTING_LOCALE_HEADER, l as ROUTING_ORIGINAL_PATHNAME_HEADER, m as RequestLoginCodeInput, n as RequestLoginCodeResult, S as StorefrontExecutionContext, o as StrippedLocalePath, V as VerifyLoginCodeInput, W as WithCache, p as createKotaoContext, q as createWithCache, r as isLocalePathSegment, t as localeFromAcceptLanguage, u as localeFromPathname, v as localeFromRequest, w as localizePath, x as originalPathnameFromRequest, y as signGeo, z as stripLocalePrefixFromPathname, s as stripLocalePrefixFromRequest, B as trustedShopOriginFromHeaders, D as verifyGeo } from './routing-sEonP93J.js';
|
|
10
12
|
export { ImageAttrs, ImageAttrsOptions, ImageCrop, ImageData, ImageFit, ImageFormat, ImageSrcSetOptions, ImageUrlOptions, buildImageAttrs, imageSrcSet, imageUrl } from './image.js';
|
|
11
|
-
export { C as Connection, a as ConnectionEdge, F as FlattenableConnection,
|
|
13
|
+
export { C as Connection, a as ConnectionEdge, F as FlattenableConnection, b as PageInfo, P as PaginationInfo, c as PaginationOptions, d as PaginationVariables, f as flattenConnection, g as getPaginationInfo, e as getPaginationVariables } from './pagination-DCrQk02Q.js';
|
|
12
14
|
export { MappedProductOptions, ProductLike, ProductOptionDef, ProductOptionState, ProductOptionValueState, SelectedOption, SelectedOptionsMap, VariantLike, VariantSelectionLike, getAdjacentAndFirstAvailableVariants, getProductOptions, getSelectedProductOptions, getSelectedVariant, mapSelectedProductOptionToObject, useOptimisticVariant, useSelectedOptionInUrlParam } from './product.js';
|
|
13
|
-
export {
|
|
15
|
+
export { ResolveThemeSettingsArgs, mergeSection, mergeSettings, resolveThemeSettings } from './settings.js';
|
|
16
|
+
export { F as FetchThemeSettingsOptions, S as StoredThemeSettings, f as fetchThemeSettings } from './fetch-M3Y-fQrW.js';
|
|
14
17
|
export { AddressInput, BreadcrumbItem, ChangeFreq, GeoInput, LocalBusinessInput, OfferInput, OrganizationInput, ProductJsonLdInput, RedirectLookup, RedirectOptions, RobotsOptions, SitemapEntry, SitemapIndexEntry, StorefrontRedirectOptions, URL_REDIRECT_QUERY, WebSiteInput, breadcrumbListJsonLd, buildRobotsTxt, buildSitemapIndexXml, buildSitemapXml, getSeoMeta, localBusinessJsonLd, organizationJsonLd, productJsonLd, resolveRedirect, resolveStorefrontRedirect, restaurantJsonLd, robotsResponse, serializeJsonLd, sitemapIndexResponse, sitemapResponse, storefrontRedirect, websiteJsonLd } from './seo.js';
|
|
15
18
|
export { A as Alternate, J as JsonLd, O as OpenGraph, a as OpenGraphImage, S as SeoConfig, b as SeoDescriptor, T as TwitterCard } from './types-BDhHWZsP.js';
|
|
19
|
+
export { c as FormAnswer, a as FormAnswers, d as FormBlock, e as FormField, b as FormFieldErrors, f as FormLocalizedText, g as FormRenderState, h as FormSubmission, F as FormVersionSchema, i as FormVisibilityRule, P as PublicForm, j as PublicFormDefinition, k as PublicFormVersion } from './types-CSNXbGFW.js';
|
|
20
|
+
export { ADDRESS_PROPERTIES, FORM_ANSWER_PREFIX, FormFetchOptions, RenderFormHtmlOptions, ShopifyContactCompatibility, ShopifyContactInput, StorefrontFormRequestError, SubmitFormInput, adaptShopifyContactForm, evaluateFormRule, formAnswerName, formFields, isFormFieldVisible, loadPublishedForm, parseFormAnswers, renderFormHtml, resolveFormText, submitPublishedForm } from './forms.js';
|
|
21
|
+
export { EventCartPreparationError, eventCartToken, prepareEventCart } from './events.js';
|
|
22
|
+
export { C as ClaimEventApprovalOffer, d as CreateEventApprovalRequest, e as CreateEventCheckoutSession, f as CreateEventWaitlistEntry, b as EventApprovalOfferResolution, g as EventApprovalRequestReceipt, a as EventCheckoutSession, h as EventFormAnswer, i as EventFormSubmissionInput, j as EventRegistrationMode, k as EventRegistrationResult, c as EventRegistrationSubmission, l as EventWaitlistReceipt, E as EventsClient, P as PublicEvent, m as PublicEventForm, n as PublicEventOccurrence, o as PublicEventTicketType, p as PublicEventVenue, S as StorefrontEventsRequestError, q as createEventsClient } from './client-bsiNPHBi.js';
|
|
23
|
+
export { a as OfferTokenHistory, O as OfferTokenLocation, c as consumeOfferTokenFragment, o as offerTokenHrefMarker } from './offer-token-C-nk_nj8.js';
|
|
16
24
|
export { CreateStorefrontEditorBridgeArgs, CreateStorefrontEditorHostBridgeArgs, StorefrontEditorBlockSchema, StorefrontEditorBridge, StorefrontEditorHostBridge, StorefrontEditorMessageEvent, StorefrontEditorMessageSource, StorefrontEditorMessageTarget, StorefrontEditorReady, StorefrontEditorSectionPreset, StorefrontEditorSectionPresetBlock, StorefrontEditorSectionSchema, StorefrontEditorSelection, StorefrontEditorSettingInput, StorefrontEditorSettingOption, createStorefrontEditorBridge, createStorefrontEditorHostBridge } from './editor.js';
|
|
25
|
+
import './http-types-CGh8WGHB.js';
|
|
17
26
|
import 'react';
|
|
18
27
|
import './storefront-api-types.js';
|
|
19
28
|
import '@kotao/storefront-contracts/theme';
|
|
@@ -143,6 +152,10 @@ interface CustomerAccountClientOptions {
|
|
|
143
152
|
readonly customerAccountId?: string | undefined;
|
|
144
153
|
/** Hydrogen server compatibility: accepted for original server.ts call sites; Kotao proxies do not need it. */
|
|
145
154
|
readonly shopId?: string | undefined;
|
|
155
|
+
/** Stage/configuration-pinned HTTPS shop origin used for account mutations. */
|
|
156
|
+
readonly shopOrigin?: string | undefined;
|
|
157
|
+
/** Bounded rollout fallback; opaque hosted sessions always win. Defaults true during migration. */
|
|
158
|
+
readonly allowLegacySessionForwarding?: boolean | undefined;
|
|
146
159
|
}
|
|
147
160
|
/**
|
|
148
161
|
* Theme-facing customer-account client (#91), mirroring Hydrogen's `createCustomerAccount`. Kotao
|
|
@@ -160,6 +173,12 @@ declare function createCustomerAccountClient(opts: CustomerAccountClientOptions)
|
|
|
160
173
|
*/
|
|
161
174
|
declare const CUSTOMER_SESSION_COOKIE = "kotao_customer_session";
|
|
162
175
|
declare const DEFAULT_SESSION_MAX_AGE: number;
|
|
176
|
+
declare const HOSTED_CUSTOMER_SESSION_COOKIE = "__Host-kotao_customer_session";
|
|
177
|
+
declare const HOSTED_CUSTOMER_CSRF_COOKIE = "__Host-kotao_customer_csrf";
|
|
178
|
+
declare const HOSTED_CUSTOMER_CSRF_HEADER = "x-kotao-csrf-token";
|
|
179
|
+
declare const MAX_HOSTED_SESSION_MAX_AGE: number;
|
|
180
|
+
declare const DEFAULT_HOSTED_SESSION_MAX_AGE: number;
|
|
181
|
+
declare const MAX_LEGACY_CUSTOMER_SESSION_TOKEN_LENGTH = 4096;
|
|
163
182
|
interface SessionCookieAttrs {
|
|
164
183
|
/**
|
|
165
184
|
* The shop's custom hostname. `Domain` is pinned to it host-scoped (no leading dot), so the cookie
|
|
@@ -168,6 +187,13 @@ interface SessionCookieAttrs {
|
|
|
168
187
|
readonly hostname: string;
|
|
169
188
|
readonly maxAgeSeconds?: number;
|
|
170
189
|
}
|
|
190
|
+
interface HostedSessionCookieAttrs {
|
|
191
|
+
readonly maxAgeSeconds?: number;
|
|
192
|
+
}
|
|
193
|
+
interface LegacySessionReadOptions {
|
|
194
|
+
/** The caller must opt in only while the one-time legacy exchange is enabled. */
|
|
195
|
+
readonly allowLegacy: boolean;
|
|
196
|
+
}
|
|
171
197
|
/** The shop custom host of the current request — the session isolation boundary. */
|
|
172
198
|
declare function shopHostname(request: Request): string;
|
|
173
199
|
/**
|
|
@@ -179,5 +205,42 @@ declare function buildCustomerSessionCookie(token: string, attrs: SessionCookieA
|
|
|
179
205
|
declare function clearCustomerSessionCookie(attrs: SessionCookieAttrs): string;
|
|
180
206
|
/** Read the session token out of a server-side `Cookie` header; null if absent or empty. */
|
|
181
207
|
declare function readCustomerSessionToken(cookieHeader: string | null | undefined): string | null;
|
|
208
|
+
/** Build the opaque hosted-session cookie required by the `__Host-` browser contract. */
|
|
209
|
+
declare function buildHostedCustomerSessionCookie(token: string, attrs?: HostedSessionCookieAttrs): string;
|
|
210
|
+
/** Clear the host-only opaque session without ever adding a Domain attribute. */
|
|
211
|
+
declare function clearHostedCustomerSessionCookie(): string;
|
|
212
|
+
/** Read only the new host-only opaque session cookie. */
|
|
213
|
+
declare function readHostedCustomerSessionToken(cookieHeader: string | null | undefined): string | null;
|
|
214
|
+
declare function readHostedCustomerCsrfToken(cookieHeader: string | null | undefined): string | null;
|
|
215
|
+
/**
|
|
216
|
+
* Read the old stateless cookie only during an explicitly enabled migration window. Oversized
|
|
217
|
+
* values are rejected before decoding so the compatibility path remains bounded.
|
|
218
|
+
*/
|
|
219
|
+
declare function readLegacyCustomerSessionToken(cookieHeader: string | null | undefined, options: LegacySessionReadOptions): string | null;
|
|
220
|
+
/** Explicitly clear the old Domain-scoped cookie after a migration attempt. */
|
|
221
|
+
declare function clearLegacyCustomerSessionCookie(attrs: SessionCookieAttrs): string;
|
|
222
|
+
|
|
223
|
+
/** Resolve the token contract shared by trusted checkout and customer-account surfaces. */
|
|
224
|
+
declare function resolveHostedBranding(global: ResolvedSettings): CheckoutDesignTokens;
|
|
225
|
+
/** Escape merchant-controlled text for an HTML text node or double-quoted attribute. */
|
|
226
|
+
declare function escapeHostedHtml(value: string): string;
|
|
227
|
+
/**
|
|
228
|
+
* Strip characters that can terminate an inline CSS declaration, block, quote, or style element.
|
|
229
|
+
* Trusted renderers must apply this at the CSS-value sink; the resolved token values themselves
|
|
230
|
+
* remain byte-for-byte compatible with checkout's existing contract.
|
|
231
|
+
*/
|
|
232
|
+
declare function sanitizeHostedCssValue(value: string): string;
|
|
233
|
+
|
|
234
|
+
interface HostedLocaleInput {
|
|
235
|
+
readonly configuredLocales: readonly string[];
|
|
236
|
+
readonly localizationCookie: string | null;
|
|
237
|
+
readonly customerLocale: string | null;
|
|
238
|
+
readonly primaryLocale: string;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Resolve display language within the verified shop's configured locale allowlist. Payment
|
|
242
|
+
* jurisdiction and legal-copy decisions deliberately stay outside this display-only resolver.
|
|
243
|
+
*/
|
|
244
|
+
declare function resolveHostedLocale(input: HostedLocaleInput): string;
|
|
182
245
|
|
|
183
|
-
export { CART_ID_COOKIE, CHECKOUT_CONSENT_CATEGORIES, CHECKOUT_CONSENT_PARAM_PREFIX, CHECKOUT_DESIGN_TOKEN_INPUTS, CUSTOMER_SESSION_COOKIE, Cart, CartDispatchAction, type CheckoutDesignTokens, ConsentBucket, ConsentState, type ContentSecurityPolicyResult, type ContentSecurityPolicyShop, type CreateContentSecurityPolicyOptions, CustomerAccountClient, type CustomerAccountClientOptions, DEFAULT_SESSION_MAX_AGE, LOCALIZATION_COOKIE, type ResolveCheckoutUrlOptions, type SessionCookieAttrs, ThemeSettingsSnapshot, appendConsentToCheckoutUrl, applyOptimisticCartAction, buildCartIdCookie, buildCustomerSessionCookie, buildLocalizationCookie, clearCustomerSessionCookie, createContentSecurityPolicy, createCustomerAccountClient, decodeCheckoutConsent, decodeConsent, encodeCheckoutConsent, encodeConsent, extractCheckoutDesignTokens, handleLocalizationPost, readCartIdCookie, readCustomerSessionToken, readLocalizationCookie, resolveCheckoutUrl, shopHostname, useOptimisticCart };
|
|
246
|
+
export { CART_ID_COOKIE, CHECKOUT_CONSENT_CATEGORIES, CHECKOUT_CONSENT_PARAM_PREFIX, CHECKOUT_DESIGN_TOKEN_INPUTS, CUSTOMER_SESSION_COOKIE, Cart, CartDispatchAction, type CheckoutDesignTokens, ConsentBucket, ConsentState, type ContentSecurityPolicyResult, type ContentSecurityPolicyShop, type CreateContentSecurityPolicyOptions, CustomerAccountClient, type CustomerAccountClientOptions, DEFAULT_HOSTED_SESSION_MAX_AGE, DEFAULT_SESSION_MAX_AGE, HOSTED_CUSTOMER_CSRF_COOKIE, HOSTED_CUSTOMER_CSRF_HEADER, HOSTED_CUSTOMER_SESSION_COOKIE, type HostedLocaleInput, type HostedSessionCookieAttrs, LOCALIZATION_COOKIE, type LegacySessionReadOptions, MAX_HOSTED_SESSION_MAX_AGE, MAX_LEGACY_CUSTOMER_SESSION_TOKEN_LENGTH, type ResolveCheckoutUrlOptions, ResolvedSettings, type SessionCookieAttrs, ThemeSettingsSnapshot, appendConsentToCheckoutUrl, applyOptimisticCartAction, buildCartIdCookie, buildCustomerSessionCookie, buildHostedCustomerSessionCookie, buildLocalizationCookie, clearCustomerSessionCookie, clearHostedCustomerSessionCookie, clearLegacyCustomerSessionCookie, createContentSecurityPolicy, createCustomerAccountClient, decodeCheckoutConsent, decodeConsent, encodeCheckoutConsent, encodeConsent, escapeHostedHtml, extractCheckoutDesignTokens, handleLocalizationPost, readCartIdCookie, readCustomerSessionToken, readHostedCustomerCsrfToken, readHostedCustomerSessionToken, readLegacyCustomerSessionToken, readLocalizationCookie, resolveCheckoutUrl, resolveHostedBranding, resolveHostedLocale, sanitizeHostedCssValue, shopHostname, useOptimisticCart };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
export { URL_REDIRECT_QUERY, breadcrumbListJsonLd, buildRobotsTxt, buildSitemapIndexXml, buildSitemapXml, localBusinessJsonLd, organizationJsonLd, productJsonLd, resolveRedirect, resolveStorefrontRedirect, restaurantJsonLd, robotsResponse, sitemapIndexResponse, sitemapResponse, storefrontRedirect, websiteJsonLd } from './chunk-ISAFEOR2.js';
|
|
2
|
-
export { createThemeSettingsStore, fetchThemeSettings, mergeSection, mergeSettings, resolveThemeSettings } from './chunk-GCQI6OKH.js';
|
|
3
|
-
export { createStorefrontEditorBridge, createStorefrontEditorHostBridge } from './chunk-PXZ737N3.js';
|
|
4
1
|
export { getAdjacentAndFirstAvailableVariants, getProductOptions, getSelectedProductOptions, getSelectedVariant, mapSelectedProductOptionToObject, useOptimisticVariant, useSelectedOptionInUrlParam } from './chunk-QOEEUTHQ.js';
|
|
5
2
|
import { createNonceProvider } from './chunk-XMTWFJCZ.js';
|
|
6
3
|
export { CartForm, createAnalyticsBus, createAnalyticsEmitter, createPixelTransport } from './chunk-XMTWFJCZ.js';
|
|
7
|
-
export { getSeoMeta, serializeJsonLd } from './chunk-MYDKIJRH.js';
|
|
8
|
-
export { buildImageAttrs, imageSrcSet, imageUrl } from './chunk-3YQXJNR7.js';
|
|
9
4
|
export { flattenConnection, getPaginationInfo, getPaginationVariables } from './chunk-5QOFKGKD.js';
|
|
10
|
-
import { localizePath, buildLocalizationCookie } from './chunk-
|
|
11
|
-
export { CART_ID_COOKIE, CHECKOUT_CONSENT_CATEGORIES, CHECKOUT_CONSENT_PARAM_PREFIX, CHECKOUT_DESIGN_TOKEN_INPUTS, CUSTOMER_SESSION_COOKIE, CacheCustom, CacheLong, CacheNone, CacheShort, CustomerAccountError, DEFAULT_SESSION_MAX_AGE, GEO_HEADER, GEO_SIGNATURE_HEADER, LOCALIZATION_COOKIE, ROUTING_LOCALE_HEADER, ROUTING_ORIGINAL_PATHNAME_HEADER, StorefrontDefaultCache, buildCartIdCookie, buildCustomerSessionCookie, buildLocalizationCookie, cartGetIdDefault, cartSetIdDefault, clearCustomerSessionCookie, createCache, createCartHandler, createCustomerAccountClient, createKotaoContext, createStorefrontClient, createWithCache, decodeCheckoutConsent, encodeCheckoutConsent, extractCheckoutDesignTokens, generateCacheControlHeader, isLocalePathSegment, localeFromAcceptLanguage, localeFromPathname, localeFromRequest, localizePath, originalPathnameFromRequest, readCartIdCookie, readCustomerSessionToken, readLocalizationCookie, resolveCheckoutUrl, shopHostname, signGeo, stripLocalePrefixFromPathname, stripLocalePrefixFromRequest, verifyGeo } from './chunk-
|
|
5
|
+
import { CHECKOUT_DESIGN_TOKEN_INPUTS, localizePath, buildLocalizationCookie, extractCheckoutDesignTokens, readLocalizationCookie } from './chunk-4TEFGD42.js';
|
|
6
|
+
export { CART_ID_COOKIE, CHECKOUT_CONSENT_CATEGORIES, CHECKOUT_CONSENT_PARAM_PREFIX, CHECKOUT_DESIGN_TOKEN_INPUTS, CUSTOMER_SESSION_COOKIE, CacheCustom, CacheLong, CacheNone, CacheShort, CustomerAccountError, DEFAULT_HOSTED_SESSION_MAX_AGE, DEFAULT_SESSION_MAX_AGE, GEO_HEADER, GEO_SIGNATURE_HEADER, HOSTED_CUSTOMER_CSRF_COOKIE, HOSTED_CUSTOMER_CSRF_HEADER, HOSTED_CUSTOMER_SESSION_COOKIE, LOCALIZATION_COOKIE, MAX_HOSTED_SESSION_MAX_AGE, MAX_LEGACY_CUSTOMER_SESSION_TOKEN_LENGTH, ROUTING_LOCALE_HEADER, ROUTING_ORIGINAL_PATHNAME_HEADER, StorefrontDefaultCache, StorefrontQueryTimeoutError, StorefrontUpstreamError, buildCartIdCookie, buildCustomerSessionCookie, buildHostedCustomerSessionCookie, buildLocalizationCookie, cartGetIdDefault, cartSetIdDefault, clearCustomerSessionCookie, clearHostedCustomerSessionCookie, clearLegacyCustomerSessionCookie, createCache, createCartHandler, createCustomerAccountClient, createKotaoContext, createStorefrontClient, createWithCache, decodeCheckoutConsent, encodeCheckoutConsent, extractCheckoutDesignTokens, generateCacheControlHeader, isLocalePathSegment, localeFromAcceptLanguage, localeFromPathname, localeFromRequest, localizePath, originalPathnameFromRequest, readCartIdCookie, readCustomerSessionToken, readHostedCustomerCsrfToken, readHostedCustomerSessionToken, readLegacyCustomerSessionToken, readLocalizationCookie, resolveCheckoutUrl, shopHostname, signGeo, stripLocalePrefixFromPathname, stripLocalePrefixFromRequest, trustedShopOriginFromHeaders, verifyGeo } from './chunk-4TEFGD42.js';
|
|
12
7
|
import { CART_FORM_ACTIONS, CONSENT_BUCKETS } from './chunk-OGWYTYYS.js';
|
|
13
8
|
export { CART_FORM_ACTIONS, CONSENT_BUCKETS, CONSENT_COOKIE, DENIED_CONSENT, GRANTED_CONSENT, buildConsentCookie, isGranted, mergeConsent, parseConsent, readConsentCookie, serializeConsent } from './chunk-OGWYTYYS.js';
|
|
9
|
+
export { URL_REDIRECT_QUERY, breadcrumbListJsonLd, buildRobotsTxt, buildSitemapIndexXml, buildSitemapXml, localBusinessJsonLd, organizationJsonLd, productJsonLd, resolveRedirect, resolveStorefrontRedirect, restaurantJsonLd, robotsResponse, sitemapIndexResponse, sitemapResponse, storefrontRedirect, websiteJsonLd } from './chunk-PXVDVUFX.js';
|
|
10
|
+
export { getSeoMeta, serializeJsonLd } from './chunk-MYDKIJRH.js';
|
|
11
|
+
export { createThemeSettingsStore, mergeSection, mergeSettings, resolveThemeSettings } from './chunk-H3D7BAOL.js';
|
|
12
|
+
export { fetchThemeSettings } from './chunk-M7BPQ54D.js';
|
|
13
|
+
export { createStorefrontEditorBridge, createStorefrontEditorHostBridge } from './chunk-PXZ737N3.js';
|
|
14
|
+
export { EventCartPreparationError, eventCartToken, prepareEventCart } from './chunk-4OQYNUGM.js';
|
|
15
|
+
export { consumeOfferTokenFragment, offerTokenHrefMarker } from './chunk-WG7HYVHJ.js';
|
|
16
|
+
export { StorefrontEventsRequestError, createEventsClient } from './chunk-7MTCGXIG.js';
|
|
17
|
+
export { ADDRESS_PROPERTIES, FORM_ANSWER_PREFIX, StorefrontFormRequestError, adaptShopifyContactForm, evaluateFormRule, formAnswerName, formFields, isFormFieldVisible, loadPublishedForm, parseFormAnswers, renderFormHtml, resolveFormText, submitPublishedForm } from './chunk-IIOHENCG.js';
|
|
18
|
+
export { buildImageAttrs, imageSrcSet, imageUrl } from './chunk-3YQXJNR7.js';
|
|
14
19
|
|
|
15
20
|
// src/cart/useOptimisticCart.ts
|
|
16
21
|
var recalculate = (cart, lines) => ({
|
|
@@ -203,6 +208,48 @@ function appendConsentToCheckoutUrl(checkoutUrl, state) {
|
|
|
203
208
|
return `${url.pathname}${url.search}${url.hash}`;
|
|
204
209
|
}
|
|
205
210
|
|
|
206
|
-
|
|
211
|
+
// src/hosted-surface/branding.ts
|
|
212
|
+
var CHECKOUT_TOKEN_DEFAULTS = Object.fromEntries(
|
|
213
|
+
CHECKOUT_DESIGN_TOKEN_INPUTS.flatMap(
|
|
214
|
+
(input) => "defaultValue" in input && typeof input.defaultValue === "string" && input.defaultValue !== "" ? [[input.name, input.defaultValue]] : []
|
|
215
|
+
)
|
|
216
|
+
);
|
|
217
|
+
function resolveHostedBranding(global) {
|
|
218
|
+
return extractCheckoutDesignTokens({ global: { ...CHECKOUT_TOKEN_DEFAULTS, ...global } });
|
|
219
|
+
}
|
|
220
|
+
function escapeHostedHtml(value) {
|
|
221
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
222
|
+
}
|
|
223
|
+
function sanitizeHostedCssValue(value) {
|
|
224
|
+
return value.replace(/[<>"'`;{}\\]/g, "").replace(/[\r\n\t]+/g, " ").trim();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/hosted-surface/localization.ts
|
|
228
|
+
function resolveHostedLocale(input) {
|
|
229
|
+
const configured = input.configuredLocales.map((locale) => locale.trim()).filter(Boolean);
|
|
230
|
+
if (configured.length === 0) throw new Error("hosted surfaces require a configured locale");
|
|
231
|
+
const configuredByKey = new Map(configured.map((locale) => [localeKey(locale), locale]));
|
|
232
|
+
const cookieLocale = safelyReadCookieLocale(input.localizationCookie);
|
|
233
|
+
for (const candidate of [cookieLocale, input.customerLocale, input.primaryLocale]) {
|
|
234
|
+
if (candidate === null || candidate.trim() === "") continue;
|
|
235
|
+
const match = configuredByKey.get(localeKey(candidate));
|
|
236
|
+
if (match !== void 0) return match;
|
|
237
|
+
}
|
|
238
|
+
return configured[0];
|
|
239
|
+
}
|
|
240
|
+
function localeKey(locale) {
|
|
241
|
+
return locale.trim().replace(/_/g, "-").toLowerCase();
|
|
242
|
+
}
|
|
243
|
+
function safelyReadCookieLocale(cookieHeader) {
|
|
244
|
+
if (cookieHeader === null) return null;
|
|
245
|
+
if (!cookieHeader.includes("=")) return cookieHeader.trim() || null;
|
|
246
|
+
try {
|
|
247
|
+
return readLocalizationCookie(cookieHeader).locale;
|
|
248
|
+
} catch {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export { ANALYTICS_EVENTS, appendConsentToCheckoutUrl, applyOptimisticCartAction, createContentSecurityPolicy, decodeConsent, encodeConsent, escapeHostedHtml, getShopAnalytics, handleLocalizationPost, resolveHostedBranding, resolveHostedLocale, sanitizeHostedCssValue, useOptimisticCart };
|
|
207
254
|
//# sourceMappingURL=index.js.map
|
|
208
255
|
//# sourceMappingURL=index.js.map
|