@dropins/storefront-cart 1.3.1-alpha2 → 1.4.0-alpha2
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/api/fetch-graphql/fetch-graphql.d.ts +2 -2
- package/api/initialize/initialize.d.ts +3 -3
- package/api.js +1 -0
- package/api.js.map +1 -0
- package/chunks/CartSummaryGrid.js +2 -1
- package/chunks/CartSummaryGrid.js.map +1 -0
- package/chunks/CartSummaryList.js +2 -1
- package/chunks/CartSummaryList.js.map +1 -0
- package/chunks/CartSummaryTable2.js +4 -0
- package/chunks/CartSummaryTable2.js.map +1 -0
- package/chunks/ChevronDown.js +1 -0
- package/chunks/ChevronDown.js.map +1 -0
- package/chunks/ChevronUp.js +1 -0
- package/chunks/ChevronUp.js.map +1 -0
- package/chunks/Coupon.js +1 -0
- package/chunks/Coupon.js.map +1 -0
- package/chunks/Coupons.js +2 -1
- package/chunks/Coupons.js.map +1 -0
- package/chunks/EmptyCart.js +2 -1
- package/chunks/EmptyCart.js.map +1 -0
- package/chunks/GiftCard.js +1 -0
- package/chunks/GiftCard.js.map +1 -0
- package/chunks/OrderSummary.js +2 -1
- package/chunks/OrderSummary.js.map +1 -0
- package/chunks/OrderSummaryLine.js +2 -1
- package/chunks/OrderSummaryLine.js.map +1 -0
- package/chunks/WarningWithCircle.js +4 -0
- package/chunks/WarningWithCircle.js.map +1 -0
- package/chunks/acdl.js +2 -1
- package/chunks/acdl.js.map +1 -0
- package/chunks/applyCouponsToCart.js +1 -0
- package/chunks/applyCouponsToCart.js.map +1 -0
- package/chunks/getEstimateShipping.js +1 -0
- package/chunks/getEstimateShipping.js.map +1 -0
- package/chunks/getEstimatedTotals.js +1 -0
- package/chunks/getEstimatedTotals.js.map +1 -0
- package/chunks/persisted-data.js +1 -0
- package/chunks/persisted-data.js.map +1 -0
- package/chunks/refreshCart.js +1 -0
- package/chunks/refreshCart.js.map +1 -0
- package/chunks/removeGiftCardFromCart.js +1 -0
- package/chunks/removeGiftCardFromCart.js.map +1 -0
- package/chunks/resetCart.js +1 -0
- package/chunks/resetCart.js.map +1 -0
- package/chunks/setGiftOptionsOnCart.js +1 -0
- package/chunks/setGiftOptionsOnCart.js.map +1 -0
- package/chunks/updateProductsFromCart.js +8 -7
- package/chunks/updateProductsFromCart.js.map +1 -0
- package/components/CartSummaryTable/CartSummaryTable.d.ts +42 -0
- package/components/CartSummaryTable/Elements/Item/Item.d.ts +13 -0
- package/components/CartSummaryTable/Elements/Item/index.d.ts +11 -0
- package/components/CartSummaryTable/Elements/index.d.ts +2 -0
- package/components/CartSummaryTable/index.d.ts +11 -0
- package/components/GiftOptions/Elements/GiftOptionModal.d.ts +1 -1
- package/components/GiftOptions/GiftOptions.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/containers/CartSummaryGrid/CartSummaryGrid.d.ts +2 -2
- package/containers/CartSummaryGrid.js +2 -1
- package/containers/CartSummaryGrid.js.map +1 -0
- package/containers/CartSummaryList/CartSummaryList.d.ts +2 -2
- package/containers/CartSummaryList.js +2 -1
- package/containers/CartSummaryList.js.map +1 -0
- package/containers/CartSummaryTable/CartSummaryTable.d.ts +86 -0
- package/containers/CartSummaryTable/index.d.ts +11 -0
- package/containers/CartSummaryTable.d.ts +3 -0
- package/containers/CartSummaryTable.js +4 -0
- package/containers/CartSummaryTable.js.map +1 -0
- package/containers/Coupons/Coupons.d.ts +1 -1
- package/containers/Coupons.js +2 -1
- package/containers/Coupons.js.map +1 -0
- package/containers/EmptyCart/EmptyCart.d.ts +1 -1
- package/containers/EmptyCart.js +2 -1
- package/containers/EmptyCart.js.map +1 -0
- package/containers/EstimateShipping/EstimateShipping.d.ts +1 -1
- package/containers/EstimateShipping.js +2 -1
- package/containers/EstimateShipping.js.map +1 -0
- package/containers/GiftCards/GiftCards.d.ts +1 -1
- package/containers/GiftCards.js +2 -1
- package/containers/GiftCards.js.map +1 -0
- package/containers/GiftOptions/GiftOptions.d.ts +2 -2
- package/containers/GiftOptions.js +2 -1
- package/containers/GiftOptions.js.map +1 -0
- package/containers/MiniCart/MiniCart.d.ts +2 -2
- package/containers/MiniCart.js +2 -1
- package/containers/MiniCart.js.map +1 -0
- package/containers/OrderSummary/OrderSummary.d.ts +1 -1
- package/containers/OrderSummary.js +2 -1
- package/containers/OrderSummary.js.map +1 -0
- package/containers/OrderSummaryLine/OrderSummaryLine.d.ts +1 -1
- package/containers/OrderSummaryLine.js +2 -1
- package/containers/OrderSummaryLine.js.map +1 -0
- package/containers/index.d.ts +1 -0
- package/data/models/acdl-models.d.ts +18 -0
- package/fragments.js +1 -0
- package/fragments.js.map +1 -0
- package/hooks/useCartItems.d.ts +85 -0
- package/hooks/useGiftOptions.d.ts +1 -2
- package/i18n/en_US.json.d.ts +16 -5
- package/package.json +1 -1
- package/render/render.d.ts +1 -1
- package/render.js +4 -2
- package/render.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiftOptions.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/CheckWithCircle.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Gift.svg","/@dropins/storefront-cart/src/hooks/useFocusTrap.tsx","/@dropins/storefront-cart/src/components/GiftOptions/Elements/GiftOptionModal.tsx","/@dropins/storefront-cart/src/components/GiftOptions/Elements/GiftLoader.tsx","/@dropins/storefront-cart/src/components/GiftOptions/Elements/CheckboxGroup.tsx","/@dropins/storefront-cart/src/components/GiftOptions/Elements/FormFields.tsx","/@dropins/storefront-cart/src/components/GiftOptions/Elements/ReadOnlyFormView.tsx","/@dropins/storefront-cart/src/components/GiftOptions/GiftOptions.tsx","/@dropins/storefront-cart/src/lib/giftOptionsHelper.ts","/@dropins/storefront-cart/src/hooks/useGiftOptions.tsx","/@dropins/storefront-cart/src/containers/GiftOptions/GiftOptions.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgCheckWithCircle = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z\", stroke: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M6.75 12.762L10.2385 15.75L17.25 9\", stroke: \"currentColor\" }));\nexport default SvgCheckWithCircle;\n","import * as React from \"react\";\nconst SvgGift = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 20, height: 23, viewBox: \"0 0 20 23\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M10 6L10 21.5M10 6H12.25C13.4926 6 14.5 4.99264 14.5 3.75C14.5 2.50736 13.4926 1.5 12.25 1.5C11.0074 1.5 10 2.50736 10 3.75M10 6V3.75M10 6H7.75C6.50736 6 5.5 4.99264 5.5 3.75C5.5 2.50736 6.50736 1.5 7.75 1.5C8.99264 1.5 10 2.50736 10 3.75M3.25 10.75H16.75C17.9926 10.75 19 9.74264 19 8.5C19 7.25736 17.9926 6.25 16.75 6.25H3.25C2.00736 6.25 1 7.25736 1 8.5C1 9.74264 2.00736 10.75 3.25 10.75ZM4.75 21.5H15.25C16.4926 21.5 17.5 20.4926 17.5 19.25V13.25C17.5 12.0074 16.4926 11 15.25 11H4.75C3.50736 11 2.5 12.0074 2.5 13.25V19.25C2.5 20.4926 3.50736 21.5 4.75 21.5Z\", stroke: \"currentColor\", strokeWidth: 1.5 }));\nexport default SvgGift;\n","import { useEffect, useRef } from 'preact/hooks';\n\nexport function useFocusTrap(showModal: boolean) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (!showModal || !containerRef.current) return;\n\n const container = containerRef.current;\n\n const focusableElements = container.querySelectorAll<HTMLElement>(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements[focusableElements.length - 1];\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Tab') {\n if (event.shiftKey && document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n } else if (!event.shiftKey && document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n\n container.addEventListener('keydown', handleKeyDown);\n\n return () => {\n container.removeEventListener('keydown', handleKeyDown);\n };\n }, [showModal]);\n\n return containerRef;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, JSX, VNode } from 'preact';\nimport {\n Modal,\n Button,\n ImageSwatch,\n Price,\n ContentGrid,\n ImageNodeRenderProps,\n} from '@adobe-commerce/elsie/components';\nimport { useState, useEffect } from 'preact/hooks';\nimport { GiftWrappingConfigProps, GiftOptionsViewProps } from '@/cart/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { useFocusTrap } from '@/cart/hooks/useFocusTrap';\n\ninterface GiftOptionModalProps {\n giftWrappingConfig: GiftWrappingConfigProps[];\n showModal: boolean;\n productName: string;\n view: GiftOptionsViewProps;\n imageSwatchImageNode?: VNode | ((props: ImageNodeRenderProps) => JSX.Element);\n setShowModal: () => void;\n updateGiftOptions: (\n name: string,\n value?: string | boolean | number,\n extraGiftOptions?: Record<string, string | boolean | number>\n ) => void;\n}\n\nexport const GiftOptionModal: FunctionComponent<GiftOptionModalProps> = ({\n view,\n showModal,\n productName,\n giftWrappingConfig,\n imageSwatchImageNode,\n setShowModal,\n updateGiftOptions,\n}) => {\n const containerRef = useFocusTrap(showModal);\n\n const dictionary = useText({\n modalTitle: 'Cart.GiftOptions.modal.title',\n defaultTitle: 'Cart.GiftOptions.modal.defaultTitle',\n modalWrappingText: 'Cart.GiftOptions.modal.wrappingText',\n modalWrappingSubText: 'Cart.GiftOptions.modal.wrappingSubText',\n modalConfirmButton: 'Cart.GiftOptions.modal.modalConfirmButton',\n modalCancelButton: 'Cart.GiftOptions.modal.modalCancelButton',\n ariaLabelModal: 'Cart.GiftOptions.modal.ariaLabelModal',\n ariaLabelModalOpen: 'Cart.GiftOptions.modal.ariaLabelModalOpen',\n ariaLabelModalClose: 'Cart.GiftOptions.modal.ariaLabelModalClose',\n ariaLabelWrapping: 'Cart.GiftOptions.modal.ariaLabelWrapping',\n });\n\n const [giftWrappingItem, setGiftWrappingItem] =\n useState<GiftWrappingConfigProps>();\n\n useEffect(() => {\n const selectedGiftWrapping =\n giftWrappingConfig.find((item) => item.selected) ?? giftWrappingConfig[0];\n\n setGiftWrappingItem(selectedGiftWrapping);\n }, [giftWrappingConfig]);\n\n useEffect(() => {\n const focusElement = document?.querySelector(\n '.cart-gift-options-view__modal-wrapper'\n ) as HTMLElement;\n\n if (focusElement) focusElement?.focus();\n }, []);\n\n if (!showModal || !giftWrappingConfig.length) return null;\n\n const renderTitle = productName\n ? `${dictionary.modalTitle} ${productName}`\n : dictionary.defaultTitle;\n\n return (\n <div\n ref={containerRef}\n className=\"cart-gift-options-view__modal-wrapper\"\n tabIndex={0}\n aria-label={`${dictionary.ariaLabelModal} ${\n showModal\n ? dictionary.ariaLabelModalOpen\n : dictionary.ariaLabelModalClose\n } ${productName}`}\n >\n <Modal\n data-testid={`gift-option-modal-${view}`}\n className={'cart-gift-options-view__modal'}\n size={'medium'}\n title={\n <>\n <span>{renderTitle}</span>\n {giftWrappingItem && giftWrappingItem?.price?.value > 0 ? (\n <Price\n amount={giftWrappingItem.price.value}\n currency={giftWrappingItem.price.currency}\n weight=\"normal\"\n />\n ) : null}\n </>\n }\n centered={true}\n onClose={setShowModal}\n >\n <div className=\"cart-gift-options-view__modal-content\">\n <span className=\"cart-gift-options-view__modal-text\">\n {dictionary.modalWrappingText}\n </span>\n <ContentGrid\n emptyGridContent={<></>}\n maxColumns={6}\n columnWidth=\"100px\"\n className=\"cart-gift-options-view__modal-grid\"\n >\n {giftWrappingConfig.map((wrapItem) => (\n <ImageSwatch\n groupAriaLabel={dictionary.ariaLabelWrapping}\n selected={giftWrappingItem?.uid === wrapItem?.uid}\n onValue={() => {\n setGiftWrappingItem(wrapItem);\n }}\n imageNode={imageSwatchImageNode}\n name={'giftWrappingId'}\n value={wrapItem.uid}\n src={wrapItem.image.url}\n alt={wrapItem.design}\n label={wrapItem.design}\n key={wrapItem.uid}\n data-testid={`gift-option-modal-image-${wrapItem.uid}`}\n className={'cart-gift-options-view__modal-grid-item'}\n />\n ))}\n </ContentGrid>\n <span className=\"cart-gift-options-view__modal-sub-text\">\n {giftWrappingItem?.design}\n </span>\n </div>\n\n <Button\n data-testid=\"gift-option-modal-confirm-button\"\n type=\"button\"\n onClick={() => {\n updateGiftOptions('giftWrappingId', giftWrappingItem?.uid, {\n isGiftWrappingSelected: true,\n });\n setShowModal();\n }}\n >\n {dictionary.modalConfirmButton}\n </Button>\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={setShowModal}\n data-testid=\"gift-option-modal-cancel-button\"\n >\n {dictionary.modalCancelButton}\n </Button>\n </Modal>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { Skeleton, SkeletonRow } from '@adobe-commerce/elsie/components';\n\nexport const GiftLoader: FunctionComponent = () => {\n return (\n <Skeleton>\n <SkeletonRow\n variant=\"row\"\n size=\"small\"\n fullWidth={true}\n lines={1}\n multilineGap=\"small\"\n />\n </Skeleton>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Checkbox, Field, Button, Price } from '@adobe-commerce/elsie/components';\nimport {\n GiftOptionsViewProps,\n GiftWrappingConfigProps,\n GiftFormDataType,\n ProductGiftOptionsConfig,\n} from '@/cart/types';\nimport { CartModel, Item, Price as PriceType } from '@/cart/data/models';\nimport { state } from '@/cart/lib/state';\nimport { StateUpdater, Dispatch, useId } from 'preact/hooks';\n\ninterface CheckboxGroupProps {\n className: string;\n view: GiftOptionsViewProps;\n item: Item | ProductGiftOptionsConfig;\n giftOptions: GiftFormDataType;\n disabled: boolean;\n cartData: CartModel | null;\n giftWrappingConfig: GiftWrappingConfigProps[] | [];\n areGiftOptionsVisible: Record<string, boolean>;\n setShowModal: Dispatch<StateUpdater<boolean>>;\n onInputChange: (event: Event) => void;\n}\n\nexport const CheckboxGroup: FunctionComponent<CheckboxGroupProps> = ({\n className,\n view,\n item,\n giftOptions,\n disabled,\n cartData,\n giftWrappingConfig,\n setShowModal,\n onInputChange,\n areGiftOptionsVisible,\n}) => {\n const id = useId();\n const dictionary = useText({\n customize: `Cart.GiftOptions.${view}.customize`,\n giftReceiptIncludedTitle: `Cart.GiftOptions.${view}.giftReceiptIncluded.title`,\n giftReceiptIncludedText: `Cart.GiftOptions.${view}.giftReceiptIncluded.subtitle`,\n printedCardIncludedTitle: `Cart.GiftOptions.${view}.printedCardIncluded.title`,\n printedCardIncludedText: `Cart.GiftOptions.${view}.printedCardIncluded.subtitle`,\n giftOptionsWrapTitle: `Cart.GiftOptions.${view}.giftOptionsWrap.title`,\n giftOptionsWrapText: `Cart.GiftOptions.${view}.giftOptionsWrap.subtitle`,\n requiredFieldError: 'Cart.GiftOptions.formText.requiredFieldError',\n });\n\n const productGiftWrappingOptions = item?.productGiftWrapping;\n const orderGiftWrappingOptions = cartData?.cartGiftWrapping;\n const giftWrappingOptions =\n view === 'product' ? productGiftWrappingOptions : orderGiftWrappingOptions;\n\n const selectedGiftWrapping = giftWrappingOptions?.find(\n (el: GiftWrappingConfigProps) => el.uid === giftOptions.giftWrappingId\n );\n const selectedGiftWrappingLabel = selectedGiftWrapping?.design ?? '';\n\n // Product level configurations\n const productGiftWrappingPrice = item?.giftWrappingPrice;\n const renderSelectedGiftWrappingLabel = selectedGiftWrappingLabel\n ? `${dictionary.giftOptionsWrapText} ${selectedGiftWrappingLabel}`\n : '';\n\n const printedCardPrice =\n +(state.config?.printedCardPrice?.value ?? 0) > 0\n ? state.config?.printedCardPrice\n : null;\n\n let productWrappingPrice = null;\n\n // Product level configurations have higher priority\n if (productGiftWrappingPrice?.value) {\n productWrappingPrice = productGiftWrappingPrice;\n } else if (selectedGiftWrapping?.price?.value) {\n productWrappingPrice = selectedGiftWrapping.price;\n }\n\n const renderPrice = (price?: PriceType | null) => {\n if (!price) return null;\n\n return (\n <span>\n (+\n <Price amount={price.value} currency={price.currency} weight=\"normal\" />\n )\n </span>\n );\n };\n\n return (\n <div\n className={classes([\n className,\n [`${className}--hidden`, !areGiftOptionsVisible.isGiftOptionsVisible],\n ])}\n >\n {areGiftOptionsVisible.isGiftReceiptVisible ? (\n <Field\n disabled={disabled}\n className={'cart-gift-options-view__field-gift-receipt'}\n >\n <Checkbox\n id={`giftReceiptIncluded-${id}`}\n disabled={disabled}\n name={'giftReceiptIncluded'}\n checked={giftOptions.giftReceiptIncluded}\n placeholder={dictionary.giftReceiptIncludedTitle}\n label={dictionary.giftReceiptIncludedTitle}\n description={dictionary.giftReceiptIncludedText}\n onChange={onInputChange}\n />\n </Field>\n ) : null}\n {areGiftOptionsVisible.isPrintedCartVisible ? (\n <Field\n disabled={disabled}\n className={'cart-gift-options-view__field-printed-card'}\n >\n <Checkbox\n id={`printedCardIncluded-${id}`}\n disabled={disabled}\n name={'printedCardIncluded'}\n checked={giftOptions.printedCardIncluded}\n placeholder={dictionary.printedCardIncludedTitle}\n label={\n <>\n {dictionary.printedCardIncludedTitle}\n {renderPrice(printedCardPrice)}\n </>\n }\n description={dictionary.printedCardIncludedText}\n onChange={onInputChange}\n />\n </Field>\n ) : null}\n {areGiftOptionsVisible.isGiftWrappingVisible ? (\n <>\n <Field\n disabled={disabled}\n className={'cart-gift-options-view__field-gift-wrap'}\n >\n <Checkbox\n id={`giftOptionsWrap-${id}`}\n disabled={disabled}\n name={'isGiftWrappingSelected'}\n checked={giftOptions.isGiftWrappingSelected}\n placeholder={dictionary.giftOptionsWrapTitle}\n label={\n <>\n {dictionary.giftOptionsWrapTitle}\n {renderPrice(productWrappingPrice)}\n </>\n }\n description={renderSelectedGiftWrappingLabel}\n onChange={onInputChange}\n />\n </Field>\n\n <Button\n disabled={disabled || !giftWrappingConfig.length}\n type=\"button\"\n data-testid={`gift-option-customize-${view}`}\n variant=\"tertiary\"\n onClick={() => setShowModal(true)}\n >\n {dictionary.customize}\n </Button>\n </>\n ) : null}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Field, Input, TextArea } from '@adobe-commerce/elsie/components';\nimport { GiftOptionsViewProps, GiftFormDataType } from '@/cart/types';\nimport { useId } from 'preact/hooks';\n\ninterface FormFieldsProps {\n view: GiftOptionsViewProps;\n giftOptions: GiftFormDataType;\n disabled: boolean;\n errorMessage: Record<string, string>;\n onInputChange: (value: Event) => void;\n onBlur: (event: Event) => void;\n isGiftMessageVisible: boolean;\n}\n\nexport const FormFields: FunctionComponent<FormFieldsProps> = ({\n view,\n giftOptions,\n disabled,\n errorMessage,\n onInputChange,\n onBlur,\n isGiftMessageVisible,\n}) => {\n const id = useId();\n const dictionary = useText({\n formTitle: `Cart.GiftOptions.${view}.formContent.formTitle`,\n formTo: `Cart.GiftOptions.${view}.formContent.formTo`,\n formFrom: `Cart.GiftOptions.${view}.formContent.formFrom`,\n giftMessageTitle: `Cart.GiftOptions.${view}.formContent.giftMessageTitle`,\n formToPlaceholder: `Cart.GiftOptions.${view}.formContent.formToPlaceholder`,\n formFromPlaceholder: `Cart.GiftOptions.${view}.formContent.formFromPlaceholder`,\n formMessagePlaceholder: `Cart.GiftOptions.${view}.formContent.formMessagePlaceholder`,\n });\n\n if (!isGiftMessageVisible) return null;\n\n return (\n <>\n <span>{dictionary.formTitle}</span>\n <div>\n <span>{dictionary.formTo}</span>\n <Field disabled={disabled} error={errorMessage.recipientName}>\n <Input\n id={`recipientName-${id}`}\n disabled={disabled}\n type=\"text\"\n name={'recipientName'}\n value={giftOptions.recipientName}\n placeholder={dictionary.formToPlaceholder}\n onChange={onInputChange}\n onBlur={onBlur}\n />\n </Field>\n </div>\n <div>\n <span>{dictionary.formFrom}</span>\n <Field disabled={disabled} error={errorMessage.senderName}>\n <Input\n id={`senderName-${id}`}\n disabled={disabled}\n type=\"text\"\n name={'senderName'}\n value={giftOptions.senderName}\n placeholder={dictionary.formFromPlaceholder}\n onChange={onInputChange}\n onBlur={onBlur}\n />\n </Field>\n </div>\n <div>\n <span>{dictionary.giftMessageTitle}</span>\n <Field disabled={disabled}>\n <TextArea\n id={`message-${id}`}\n errorMessage={errorMessage.message}\n disabled={disabled}\n name={'message'}\n value={giftOptions.message}\n label={dictionary.formMessagePlaceholder}\n onChange={onInputChange}\n onBlur={onBlur}\n />\n </Field>\n </div>\n </>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport {\n Price,\n Icon,\n Card,\n Accordion,\n AccordionSection,\n} from '@adobe-commerce/elsie/components';\nimport {\n ChevronDown,\n ChevronUp,\n Gift,\n CheckWithCircle,\n} from '@adobe-commerce/elsie/icons';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport {\n GiftFormDataType,\n GiftWrappingConfigProps,\n GiftOptionsReadOnlyViewProps,\n GiftOptionsViewProps,\n} from '@/cart/types';\n\nexport interface ReadOnlyFormViewProps {\n view: GiftOptionsViewProps;\n giftOptions: GiftFormDataType;\n readOnlyFormOrderView: GiftOptionsReadOnlyViewProps;\n giftWrappingConfig: GiftWrappingConfigProps[] | [];\n}\n\nexport const ReadOnlyFormView: FunctionComponent<ReadOnlyFormViewProps> = ({\n view,\n giftOptions,\n giftWrappingConfig,\n readOnlyFormOrderView,\n}) => {\n const dictionary = useText({\n readOnlyProductTitle: 'Cart.GiftOptions.product.readOnlyFormView.title',\n wrapping: 'Cart.GiftOptions.product.readOnlyFormView.wrapping',\n recipient: 'Cart.GiftOptions.product.readOnlyFormView.recipient',\n sender: 'Cart.GiftOptions.product.readOnlyFormView.sender',\n message: 'Cart.GiftOptions.product.readOnlyFormView.message',\n\n readOnlyOrderTitle: 'Cart.GiftOptions.order.readOnlyFormView.title',\n readOnlyOrderGiftReceiptTitle:\n 'Cart.GiftOptions.order.readOnlyFormView.giftReceipt',\n readOnlyOrderGiftReceiptText:\n 'Cart.GiftOptions.order.readOnlyFormView.giftReceiptText',\n readOnlyOrderGiftPrintCardTitle:\n 'Cart.GiftOptions.order.readOnlyFormView.printCard',\n readOnlyOrderGiftPrintCardText:\n 'Cart.GiftOptions.order.readOnlyFormView.printCardText',\n readOnlyOrderGiftWrapTitle:\n 'Cart.GiftOptions.order.readOnlyFormView.giftWrap',\n readOnlyOrderGiftWrapOptionsText:\n 'Cart.GiftOptions.order.readOnlyFormView.giftWrapOptions',\n\n readOnlyOrderFormTitle: 'Cart.GiftOptions.order.readOnlyFormView.formTitle',\n readOnlyOrderFormTo: 'Cart.GiftOptions.order.readOnlyFormView.formTo',\n readOnlyOrderFormFrom: 'Cart.GiftOptions.order.readOnlyFormView.formFrom',\n readOnlyOrderFormMessageTitle:\n 'Cart.GiftOptions.order.readOnlyFormView.formMessageTitle',\n });\n\n const {\n recipientName,\n senderName,\n message,\n giftReceiptIncluded,\n printedCardIncluded,\n isGiftWrappingSelected,\n } = giftOptions;\n\n const giftWrapCart = giftWrappingConfig?.find(\n ({ uid }) => uid === giftOptions?.giftWrappingId\n );\n const isGiftMessageProvided = !!recipientName || !!senderName || !!message;\n const giftWrapProductSelectLabel = giftWrapCart?.design;\n const shouldRenderGiftOptions =\n giftReceiptIncluded || printedCardIncluded || giftWrapCart?.selected;\n\n const productGiftOptionsConfig = [\n {\n id: 1,\n title: dictionary.wrapping,\n message: isGiftWrappingSelected ? giftWrapProductSelectLabel : '',\n },\n {\n id: 2,\n title: dictionary.recipient,\n message: recipientName,\n },\n {\n id: 3,\n title: dictionary.sender,\n message: senderName,\n },\n {\n id: 4,\n title: dictionary.message,\n message,\n },\n ];\n\n const noProductGiftOptionsApplied = productGiftOptionsConfig.every(\n ({ message }) => !message\n );\n\n if (view === 'product' && !noProductGiftOptionsApplied) {\n return (\n <Accordion\n data-testid=\"gift-options-product\"\n iconClose={ChevronUp}\n iconOpen={ChevronDown}\n actionIconPosition=\"right\"\n >\n <AccordionSection\n title={dictionary.readOnlyProductTitle}\n showIconLeft={true}\n iconLeft={Gift}\n defaultOpen={false}\n renderContentWhenClosed={false}\n >\n <div>\n {productGiftOptionsConfig\n .filter((element) => element.message)\n .map((config) => {\n return (\n <p key={config.id}>\n {config.title} {config.message}\n </p>\n );\n })}\n </div>\n </AccordionSection>\n </Accordion>\n );\n }\n\n if (view === 'order' && (isGiftMessageProvided || shouldRenderGiftOptions)) {\n const renderHeader = (\n <div className=\"cart-gift-options-readonly__header\">\n <Icon source={Gift} size=\"24\" />\n <span>{dictionary.readOnlyOrderTitle}</span>\n </div>\n );\n\n const selectedGiftOptions = (\n <>\n {giftReceiptIncluded ? (\n <div className=\"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--gift-receipt\">\n <Icon source={CheckWithCircle} size=\"16\" />\n <p>{dictionary.readOnlyOrderGiftReceiptTitle}</p>\n <p>{dictionary.readOnlyOrderGiftReceiptText}</p>\n </div>\n ) : null}\n {printedCardIncluded ? (\n <div className=\"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--print-card\">\n <Icon source={CheckWithCircle} size=\"16\" />\n <p>{dictionary.readOnlyOrderGiftPrintCardTitle}</p>\n <p>{dictionary.readOnlyOrderGiftPrintCardText}</p>\n </div>\n ) : null}\n {giftWrapCart?.selected ? (\n <div className=\"cart-gift-options-readonly__checkboxes cart-gift-options-readonly__checkboxes--gift-wrap\">\n <Icon source={CheckWithCircle} size=\"16\" />\n <p>\n {dictionary.readOnlyOrderGiftWrapTitle} (+\n <Price\n amount={giftWrapCart.price.value}\n currency={giftWrapCart.price.currency}\n weight=\"normal\"\n />\n )\n </p>\n <p>{`${dictionary.readOnlyOrderGiftWrapOptionsText} ${giftWrapCart?.design}`}</p>\n </div>\n ) : null}\n </>\n );\n\n const enteredGiftMessage = isGiftMessageProvided ? (\n <div className=\"cart-gift-options-readonly__form\">\n <div>{dictionary.readOnlyOrderFormTitle}</div>\n <div>\n <p>\n <span>{dictionary.readOnlyOrderFormTo}</span>\n <span>{recipientName}</span>\n </p>\n <p>\n <span>{dictionary.readOnlyOrderFormFrom}</span>\n <span>{senderName}</span>\n </p>\n </div>\n <div>\n <p>{dictionary.readOnlyOrderFormMessageTitle}</p>\n <p>{message}</p>\n </div>\n </div>\n ) : null;\n\n return (\n <Card variant={readOnlyFormOrderView}>\n {renderHeader}\n {selectedGiftOptions}\n {enteredGiftMessage}\n </Card>\n );\n }\n\n return null;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, StateUpdater, Dispatch } from 'preact/hooks';\nimport { FunctionComponent, JSX, VNode } from 'preact';\nimport { GiftOptionModal } from './Elements/GiftOptionModal';\nimport { GiftLoader } from './Elements/GiftLoader';\nimport { CheckboxGroup } from './Elements/CheckboxGroup';\nimport { FormFields } from './Elements/FormFields';\nimport { ReadOnlyFormView } from './Elements/ReadOnlyFormView';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n Accordion,\n AccordionSection,\n Card,\n Icon,\n ImageNodeRenderProps,\n ProgressSpinner,\n} from '@adobe-commerce/elsie/components';\nimport {\n ChevronDown,\n ChevronUp,\n CheckWithCircle,\n Gift,\n} from '@adobe-commerce/elsie/icons';\nimport {\n GiftWrappingConfigProps,\n GiftOptionsViewProps,\n GiftFormDataType,\n GiftOptionsReadOnlyViewProps,\n ProductGiftOptionsConfig,\n} from '@/cart/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { CartModel, Item } from '@/cart/data/models';\nimport '@/cart/components/GiftOptions/GiftOptions.css';\n\nexport interface GiftOptionsProps {\n readOnlyFormOrderView: GiftOptionsReadOnlyViewProps;\n cartData: CartModel | null;\n errorsField: Record<string, string>;\n isGiftMessageVisible: boolean;\n fieldsDisabled: boolean;\n loading: boolean;\n showModal: boolean;\n isEditable: boolean;\n isGiftOptionsApplied: boolean;\n updateLoading: boolean;\n areGiftOptionsVisible: Record<string, boolean>;\n view: GiftOptionsViewProps;\n giftOptions: GiftFormDataType;\n imageSwatchImageNode?: VNode | ((props: ImageNodeRenderProps) => JSX.Element);\n item: Item | ProductGiftOptionsConfig;\n giftWrappingConfig: GiftWrappingConfigProps[] | [];\n updateGiftOptions: (\n name: string,\n value?: string | boolean | number,\n extraGiftOptions?: Record<string, string | boolean | number>\n ) => void;\n setShowModal: Dispatch<StateUpdater<boolean>>;\n handleFormMouseLeave: () => void;\n onInputChange: (event: Event) => void;\n onBlur: (event: Event) => void;\n}\n\nexport const GiftOptions: FunctionComponent<GiftOptionsProps> = ({\n item,\n view,\n loading,\n giftOptions,\n showModal,\n isEditable,\n errorsField,\n updateLoading,\n cartData,\n fieldsDisabled,\n isGiftOptionsApplied,\n giftWrappingConfig,\n readOnlyFormOrderView,\n isGiftMessageVisible,\n areGiftOptionsVisible,\n imageSwatchImageNode,\n onBlur,\n setShowModal,\n updateGiftOptions,\n onInputChange,\n handleFormMouseLeave,\n}) => {\n const dictionary = useText({\n accordionHeading: `Cart.GiftOptions.${view}.accordionHeading`,\n });\n\n const renderAccordion = useCallback(\n (defaultOpen: boolean) => {\n return (\n <Accordion\n data-testid=\"gift-options-product\"\n iconClose={ChevronUp}\n iconOpen={ChevronDown}\n actionIconPosition=\"right\"\n >\n <AccordionSection\n title={\n <div className=\"cart-gift-options-view__icon--success\">\n <span>{dictionary.accordionHeading}</span>\n {isGiftOptionsApplied ? (\n <Icon source={CheckWithCircle} size=\"16\" />\n ) : null}\n </div>\n }\n ariaLabelTitle={dictionary.accordionHeading}\n showIconLeft={true}\n iconLeft={Gift}\n defaultOpen={isGiftOptionsApplied || defaultOpen}\n renderContentWhenClosed={false}\n >\n <>\n <CheckboxGroup\n className={'cart-gift-options-view__top'}\n view={view}\n item={item}\n giftOptions={giftOptions}\n disabled={fieldsDisabled}\n onInputChange={onInputChange}\n cartData={cartData}\n giftWrappingConfig={giftWrappingConfig}\n setShowModal={setShowModal}\n areGiftOptionsVisible={areGiftOptionsVisible}\n />\n <form\n className=\"cart-gift-options-view__footer\"\n onMouseLeave={handleFormMouseLeave}\n >\n <FormFields\n view={view}\n giftOptions={giftOptions}\n disabled={fieldsDisabled}\n errorMessage={errorsField}\n onInputChange={onInputChange}\n onBlur={onBlur}\n isGiftMessageVisible={isGiftMessageVisible}\n />\n </form>\n </>\n </AccordionSection>\n </Accordion>\n );\n },\n [\n view,\n item,\n cartData,\n dictionary,\n errorsField,\n giftOptions,\n fieldsDisabled,\n giftWrappingConfig,\n areGiftOptionsVisible,\n isGiftOptionsApplied,\n isGiftMessageVisible,\n onBlur,\n setShowModal,\n onInputChange,\n handleFormMouseLeave,\n ]\n );\n\n if (!areGiftOptionsVisible.isGiftOptionsVisible && !isGiftMessageVisible) {\n return null;\n }\n\n return (\n <div\n id=\"cart-gift-options-view\"\n className={classes([\n 'cart-gift-options-view',\n `cart-gift-options-view--${view}`,\n ['cart-gift-options-view--loading', updateLoading],\n ])}\n >\n {updateLoading ? (\n <ProgressSpinner className=\"cart-gift-options-view__spinner\" />\n ) : null}\n {!loading ? (\n <>\n {!isEditable ? (\n <div className={'cart-gift-options-view--readonly'}>\n <ReadOnlyFormView\n view={view}\n giftOptions={giftOptions}\n giftWrappingConfig={giftWrappingConfig}\n readOnlyFormOrderView={readOnlyFormOrderView}\n />\n </div>\n ) : null}\n {showModal ? (\n <GiftOptionModal\n view={view}\n productName={item && 'name' in item ? item?.name : ''}\n showModal={showModal}\n giftWrappingConfig={giftWrappingConfig}\n setShowModal={() => setShowModal(false)}\n updateGiftOptions={updateGiftOptions}\n imageSwatchImageNode={imageSwatchImageNode}\n />\n ) : null}\n {view === 'product' && isEditable ? renderAccordion(false) : null}\n {view === 'order' && isEditable ? (\n <Card variant={'secondary'}>{renderAccordion(true)}</Card>\n ) : null}\n </>\n ) : (\n <GiftLoader />\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CartModel, Item } from '@/cart/data/models';\nimport { state } from '@/cart/lib/state';\nimport {\n GiftWrappingConfigProps,\n GiftOptionsViewProps,\n ProductGiftOptionsConfig,\n} from '@/cart/types';\n\n// This helper is specifically designed for small functions needed in useGiftOptions for formSections configuration manipulation.\nexport const DEFAULT_FORM_STATE = {\n recipientName: '',\n senderName: '',\n message: '',\n};\n\nexport const DEFAULT_CHECKBOXES_STATE = {\n giftReceiptIncluded: false,\n printedCardIncluded: false,\n isGiftWrappingSelected: false,\n};\n\nexport const shouldShowGiftMessage = (\n item: CartModel['items'][0] | ProductGiftOptionsConfig,\n isProductView: boolean\n) => {\n if (!isProductView) return !!state.config?.allowGiftMessageOnOrder;\n\n const allowGiftMessageOnOrderItems =\n state.config?.allowGiftMessageOnOrderItems ?? false;\n\n return typeof item?.giftMessageAvailable === 'boolean'\n ? item?.giftMessageAvailable\n : allowGiftMessageOnOrderItems;\n};\n\nexport const getSelectedGiftWrapping = (\n giftWrappingOptions: GiftWrappingConfigProps[] | []\n): GiftWrappingConfigProps | undefined => {\n const fallbackGiftWrappingData = {\n uid: '',\n design: '',\n selected: false,\n image: {\n url: '',\n design: '',\n },\n price: {\n currency: 'USD',\n value: 0,\n },\n };\n\n if (!giftWrappingOptions || giftWrappingOptions.length === 0) {\n return fallbackGiftWrappingData;\n }\n\n const isNotSelected = giftWrappingOptions?.every((wrap) => !wrap.selected);\n\n if (isNotSelected) {\n return giftWrappingOptions[0];\n }\n\n return giftWrappingOptions.find((wrap) => wrap.selected);\n};\n\nexport const areGiftOptionsDisabled = (\n view: GiftOptionsViewProps,\n item: Item | ProductGiftOptionsConfig\n) => {\n const {\n allowGiftWrappingOnOrder,\n allowGiftWrappingOnOrderItems,\n allowGiftMessageOnOrder,\n allowGiftMessageOnOrderItems,\n allowGiftReceipt,\n allowPrintedCard,\n } = state.config || {};\n\n const isGiftOptionsOnProductDisabled =\n !allowGiftMessageOnOrderItems &&\n !allowGiftWrappingOnOrderItems &&\n !shouldShowGiftMessage(item, true);\n\n const isGiftOptionsOnOrderDisabled =\n !allowGiftWrappingOnOrder &&\n !allowGiftMessageOnOrder &&\n !allowGiftReceipt &&\n !allowPrintedCard;\n\n if (view === 'product' && isGiftOptionsOnProductDisabled) {\n return true;\n }\n\n if (view === 'order' && isGiftOptionsOnOrderDisabled) {\n return true;\n }\n\n return false;\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { useCallback, useEffect, useState, useMemo } from 'preact/hooks';\nimport { events } from '@adobe-commerce/event-bus';\nimport { CartModel, Item } from '@/cart/data/models';\nimport { setGiftOptionsOnCart, updateProductsFromCart } from '@/cart/api';\nimport {\n DEFAULT_FORM_STATE,\n DEFAULT_CHECKBOXES_STATE,\n shouldShowGiftMessage,\n areGiftOptionsDisabled,\n} from '@/cart/lib/giftOptionsHelper';\nimport {\n GiftOptionsDataSourcesProps,\n GiftOptionsViewProps,\n GiftWrappingConfigProps,\n GiftFormDataType,\n ProductGiftOptionsConfig,\n} from '@/cart/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { state } from '@/cart/lib/state';\n\nexport interface UseGiftOptionsProps {\n item: Item | ProductGiftOptionsConfig;\n view: GiftOptionsViewProps;\n dataSource: GiftOptionsDataSourcesProps;\n initialLoading: boolean;\n handleItemsLoading?: (uid: string, state: boolean) => void;\n handleItemsError?: (uid: string, message?: string) => void;\n onItemUpdate?: ({ item }: { item: Item }) => void;\n onGiftOptionsChange?: (data: GiftFormDataType) => void;\n}\n\nexport const useGiftOptions = ({\n item,\n view,\n dataSource,\n initialLoading,\n handleItemsLoading,\n handleItemsError,\n onItemUpdate,\n onGiftOptionsChange,\n}: UseGiftOptionsProps) => {\n const isProductView = view === 'product';\n\n const dictionary = useText({\n requiredFieldError: 'Cart.GiftOptions.formText.requiredFieldError',\n });\n\n const [loading, setLoading] = useState(() => initialLoading);\n const [areGiftOptionsVisible, setAreGiftOptionsVisible] = useState({\n isGiftReceiptVisible: true,\n isPrintedCartVisible: true,\n isGiftWrappingVisible: true,\n isGiftOptionsVisible: true,\n });\n const [isGiftMessageVisible, setIsGiftMessageVisible] = useState(true);\n const [updateLoading, setUpdateLoading] = useState(false);\n const [fieldsDisabled, setFieldsDisabled] = useState(false);\n const [isDataChanged, setIsDataChanged] = useState(false);\n const [isFormTouched, setIsFormTouched] = useState(false);\n const [showModal, setShowModal] = useState<boolean>(false);\n const [giftWrappingConfig, setGiftWrappingConfig] = useState<\n GiftWrappingConfigProps[] | []\n >([]);\n const [cartData, setCartData] = useState<CartModel | null>(null);\n const [errorsField, setErrorsField] =\n useState<typeof DEFAULT_FORM_STATE>(DEFAULT_FORM_STATE);\n const [giftOptions, setGiftOptions] = useState<GiftFormDataType>(() => ({\n giftWrappingId: '',\n ...DEFAULT_FORM_STATE,\n ...DEFAULT_CHECKBOXES_STATE,\n }));\n\n const isFormFilled =\n giftOptions.recipientName?.trim() &&\n giftOptions.senderName?.trim() &&\n giftOptions.message?.trim();\n\n const isFormEmpty =\n !giftOptions.recipientName?.trim() &&\n !giftOptions.senderName?.trim() &&\n !giftOptions.message?.trim();\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const applyGiftOptionsToCart = useCallback(\n async (updatedGiftOptions: GiftFormDataType) => {\n // Update loading state used to render loading indicator required only in order view\n setUpdateLoading(view === 'order');\n setFieldsDisabled(true);\n\n switch (view) {\n case 'product':\n {\n if ('uid' in item) {\n handleItemsLoading?.(item.uid, true);\n handleItemsError?.(item.uid);\n }\n\n const {\n recipientName,\n senderName,\n message,\n giftWrappingId,\n isGiftWrappingSelected,\n } = updatedGiftOptions;\n\n const giftOptions = {\n gift_message: {\n to: recipientName ?? '',\n from: senderName ?? '',\n message: message ?? '',\n },\n gift_wrapping_id: isGiftWrappingSelected ? giftWrappingId : null,\n };\n\n if ('uid' in item && 'quantity' in item) {\n await updateProductsFromCart([\n {\n uid: item.uid,\n quantity: item.quantity,\n giftOptions,\n },\n ])\n .then(() => {\n onItemUpdate?.({ item });\n })\n .finally(() => {\n handleItemsLoading?.(item.uid, false);\n setFieldsDisabled(false);\n setIsDataChanged(false);\n setUpdateLoading(false);\n })\n .catch((error: any) => {\n console.warn(error);\n });\n }\n }\n break;\n case 'order':\n await setGiftOptionsOnCart(updatedGiftOptions).finally(() => {\n setFieldsDisabled(false);\n setIsDataChanged(false);\n setUpdateLoading(false);\n });\n break;\n default:\n console.error(\n 'Incorrect \"view\" prop value provided for GiftOptions container (storefront-cart)'\n );\n break;\n }\n },\n [handleItemsError, handleItemsLoading, item, onItemUpdate, view]\n );\n\n const updateGiftOptions = useCallback(\n (\n name: string,\n value: string | boolean | number | undefined,\n extraGiftOptions: Record<string, string | boolean | number> = {}\n ) => {\n setGiftOptions((prevGiftOptions: GiftFormDataType) => {\n const isValidGiftFormKey = (\n key: string\n ): key is keyof GiftFormDataType => key in prevGiftOptions;\n\n const getPrevValue = (key: string) =>\n isValidGiftFormKey(key) ? prevGiftOptions[key] : undefined;\n\n const hasChanged =\n getPrevValue(name) !== value ||\n Object.keys(extraGiftOptions).some(\n (key) => getPrevValue(key) !== extraGiftOptions[key]\n );\n\n if (!hasChanged) {\n onGiftOptionsChange?.(prevGiftOptions);\n return prevGiftOptions;\n }\n\n const updatedGiftOptions = {\n ...prevGiftOptions,\n [name]: value,\n ...extraGiftOptions,\n };\n\n if (\n !updatedGiftOptions.recipientName &&\n !updatedGiftOptions.senderName &&\n !updatedGiftOptions.message\n ) {\n setIsFormTouched(true);\n }\n\n if (\n typeof value === 'boolean' ||\n [\n 'giftWrappingId',\n 'giftReceiptIncluded',\n 'printedCardIncluded',\n ].includes(name)\n ) {\n setIsFormTouched(false);\n typeof onGiftOptionsChange === 'function'\n ? onGiftOptionsChange(updatedGiftOptions)\n : applyGiftOptionsToCart(updatedGiftOptions);\n }\n\n setIsDataChanged(true);\n\n onGiftOptionsChange?.(updatedGiftOptions);\n return updatedGiftOptions;\n });\n },\n [applyGiftOptionsToCart, onGiftOptionsChange]\n );\n\n const handleFormMouseLeave = useCallback(\n async () => {\n // Fields disabled if other event handler already triggered\n if (fieldsDisabled) return;\n if (typeof onGiftOptionsChange === 'function') return;\n\n // Case when user removed all form fields - reset to initial state\n if (isFormEmpty && isFormTouched) {\n setErrorsField(DEFAULT_FORM_STATE);\n setIsFormTouched(false);\n await applyGiftOptionsToCart(giftOptions);\n }\n\n // Case when user edited one of form fields\n if (isDataChanged && isFormFilled) {\n setIsFormTouched(true);\n await applyGiftOptionsToCart(giftOptions);\n }\n },\n [\n applyGiftOptionsToCart,\n giftOptions,\n isDataChanged,\n isFormEmpty,\n isFormTouched,\n fieldsDisabled,\n onGiftOptionsChange,\n isFormFilled\n ]\n );\n\n const handleBlur = useCallback(\n async (event: Event) => {\n // Fields disabled if other event handler already triggered\n if (fieldsDisabled) return;\n if (typeof onGiftOptionsChange === 'function') return;\n\n const { name, value } = event.target as HTMLInputElement;\n\n setErrorsField((prevErrors: typeof DEFAULT_FORM_STATE) => ({\n ...prevErrors,\n [name]: value.trim() ? '' : dictionary.requiredFieldError,\n }));\n\n // Case when user removed all form fields - reset to initial state\n if (isFormEmpty && isFormTouched) {\n setErrorsField(DEFAULT_FORM_STATE);\n setIsFormTouched(false);\n await applyGiftOptionsToCart(giftOptions);\n }\n\n if (isDataChanged && isFormFilled) {\n await applyGiftOptionsToCart(giftOptions);\n }\n },\n [\n fieldsDisabled,\n isFormEmpty,\n isFormTouched,\n isDataChanged,\n isFormFilled,\n dictionary,\n applyGiftOptionsToCart,\n giftOptions,\n onGiftOptionsChange,\n ]\n );\n\n const onInputChange = useCallback(\n (event: Event) => {\n const target = event.target as HTMLInputElement;\n const name = target.name;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n\n updateGiftOptions(name, value);\n },\n [updateGiftOptions]\n );\n\n useEffect(() => {\n if (isProductView) return;\n\n const dataEvent = events.on(\n // @ts-ignore\n dataSource === 'cart' ? 'cart/data' : 'order/data',\n (payload: CartModel) => {\n setCartData(payload);\n // Gift wrapping is allowed for the cart if at least one item has gift wrapping available\n const isCartGiftWrappingAllowed = payload?.items?.some(\n ({ giftWrappingAvailable }: { giftWrappingAvailable: boolean }) =>\n giftWrappingAvailable\n );\n const isCartGiftWrappingApplied = payload?.cartGiftWrapping?.some(\n (wrap: GiftWrappingConfigProps) => wrap.selected\n );\n\n // If gift wrapping is not allowed and it is applied, remove it\n if (!isCartGiftWrappingAllowed && isCartGiftWrappingApplied) {\n applyGiftOptionsToCart({\n ...giftOptions,\n giftWrappingId: '',\n isGiftWrappingSelected: false,\n });\n }\n },\n { eager: true }\n );\n return () => {\n dataEvent?.off();\n };\n }, [setCartData, applyGiftOptionsToCart, dataSource, giftOptions, isProductView]);\n\n const giftOptionsState: GiftFormDataType | null = useMemo(() => {\n if (!cartData && !item) return null;\n\n const giftWrappingOptions: GiftWrappingConfigProps[] = isProductView\n ? item?.productGiftWrapping?.map(\n (wrap: GiftWrappingConfigProps): GiftWrappingConfigProps => ({\n ...wrap,\n price:\n item?.giftWrappingPrice && item?.giftWrappingPrice?.value > 0\n ? item.giftWrappingPrice\n : wrap.price,\n })\n )\n : cartData?.cartGiftWrapping || [];\n\n const selectedWrap = giftWrappingOptions?.find((wrap) => wrap.selected);\n const selectedGiftWrappingId =\n selectedWrap?.uid ?? giftWrappingOptions?.[0]?.uid;\n\n const isGiftWrappingSelected = !!selectedWrap;\n\n const giftMessageConfig = isProductView\n ? item.giftMessage\n : cartData?.giftMessage;\n const printedCardIncluded = cartData?.printedCardIncluded;\n const giftReceiptIncluded = cartData?.giftReceiptIncluded;\n\n const giftMessageAvailable = shouldShowGiftMessage(item, isProductView);\n\n const allowGiftWrappingOnOrder = state.config?.allowGiftWrappingOnOrder;\n const allowGiftReceipt = state.config?.allowGiftReceipt;\n const allowPrintedCard = state.config?.allowPrintedCard;\n const isGiftWrappingAvailableForSome = cartData?.items?.some(\n (item: { giftWrappingAvailable: boolean }) => item.giftWrappingAvailable\n );\n const allowGiftWrappingOnProduct = item?.giftWrappingAvailable;\n const isGiftReceiptVisible = isProductView ? false : !!allowGiftReceipt;\n const isPrintedCartVisible = isProductView ? false : !!allowPrintedCard;\n const isGiftWrappingVisible = isProductView\n ? !!allowGiftWrappingOnProduct && !!giftWrappingOptions.length\n : !!allowGiftWrappingOnOrder &&\n !!giftWrappingOptions.length &&\n !!isGiftWrappingAvailableForSome;\n const checkBoxesIsHidden =\n !isGiftReceiptVisible && !isPrintedCartVisible && !isGiftWrappingVisible;\n\n setAreGiftOptionsVisible({\n isGiftReceiptVisible,\n isPrintedCartVisible,\n isGiftWrappingVisible,\n isGiftOptionsVisible: !checkBoxesIsHidden,\n });\n setIsGiftMessageVisible(giftMessageAvailable);\n\n return {\n ...(item && 'uid' in item ? { itemId: item.uid } : {}),\n ...(!isProductView\n ? {\n printedCardIncluded,\n giftReceiptIncluded,\n }\n : {}),\n ...giftMessageConfig,\n giftWrappingId: selectedGiftWrappingId,\n isGiftWrappingSelected,\n giftWrappingOptions,\n };\n }, [cartData, item, isProductView]);\n\n useEffect(() => {\n if (!giftOptionsState) return;\n\n const { giftWrappingOptions, ...giftOptionsFetchData } = giftOptionsState;\n\n setGiftOptions(giftOptionsFetchData);\n\n if (giftWrappingOptions?.length) {\n setGiftWrappingConfig(giftWrappingOptions);\n }\n\n setLoading(false);\n }, [giftOptionsState]);\n\n const isGiftOptionsApplied = useMemo(() => {\n return Object.entries(giftOptions)\n .filter(([key]) => key !== 'itemId' && key !== 'giftWrappingId')\n .some(([, value]) => Boolean(value));\n }, [giftOptions]);\n\n const isGiftOptionsHidden = useMemo(() => {\n return !loading && !!state?.config && areGiftOptionsDisabled(view, item);\n }, [item, loading, view]);\n\n return {\n loading,\n giftOptions,\n showModal,\n errorsField,\n updateLoading,\n cartData,\n fieldsDisabled,\n isGiftOptionsApplied,\n giftWrappingConfig,\n setFieldsDisabled,\n handleFormMouseLeave,\n onInputChange,\n updateGiftOptions,\n setShowModal,\n handleBlur,\n isGiftMessageVisible,\n areGiftOptionsVisible,\n isGiftOptionsHidden,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { GiftOptions as GiftOptionsComponent } from '@/cart/components';\nimport { Item } from '@/cart/data/models';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { useGiftOptions } from '@/cart/hooks/useGiftOptions';\nimport {\n GiftOptionsViewProps,\n GiftOptionsDataSourcesProps,\n GiftFormDataType,\n ProductGiftOptionsConfig,\n GiftOptionsReadOnlyViewProps,\n} from '@/cart/types';\nimport { ImageNodeRenderProps, ImageProps } from '@adobe-commerce/elsie/components';\n\nexport interface GiftOptionsProps {\n item: Item | ProductGiftOptionsConfig;\n view?: GiftOptionsViewProps;\n readOnlyFormOrderView: GiftOptionsReadOnlyViewProps;\n dataSource?: GiftOptionsDataSourcesProps;\n isEditable?: boolean;\n initialLoading?: boolean;\n handleItemsLoading?: (uid: string, state: boolean) => void;\n handleItemsError?: (uid: string, message?: string) => void;\n onItemUpdate?: ({ item }: { item: Item }) => void;\n onGiftOptionsChange?: (data: GiftFormDataType) => void;\n slots?: {\n SwatchImage?: SlotProps<{ \n item: Item | ProductGiftOptionsConfig\n imageSwatchContext: ImageNodeRenderProps['imageSwatchContext']\n defaultImageProps: ImageProps\n }>;\n };\n}\n\nexport const GiftOptions: Container<GiftOptionsProps> = ({\n item,\n view = 'order',\n readOnlyFormOrderView = 'primary',\n dataSource = 'cart',\n isEditable = true,\n initialLoading = true,\n slots,\n handleItemsLoading,\n handleItemsError,\n onItemUpdate,\n onGiftOptionsChange,\n}: GiftOptionsProps) => {\n const {\n isGiftMessageVisible,\n areGiftOptionsVisible,\n loading,\n giftOptions,\n showModal,\n errorsField,\n updateLoading,\n cartData,\n isGiftOptionsApplied,\n fieldsDisabled,\n giftWrappingConfig,\n handleFormMouseLeave,\n updateGiftOptions,\n setShowModal,\n onInputChange,\n handleBlur,\n isGiftOptionsHidden,\n } = useGiftOptions({\n item,\n view,\n dataSource,\n initialLoading,\n handleItemsLoading,\n handleItemsError,\n onItemUpdate,\n onGiftOptionsChange,\n });\n\n if (isGiftOptionsHidden) {\n return null;\n }\n\n return (\n <GiftOptionsComponent\n item={item}\n view={view}\n loading={loading}\n onBlur={handleBlur}\n giftOptions={giftOptions}\n showModal={showModal}\n isEditable={isEditable}\n errorsField={errorsField}\n setShowModal={setShowModal}\n updateLoading={updateLoading}\n updateGiftOptions={updateGiftOptions}\n cartData={cartData}\n isGiftOptionsApplied={isGiftOptionsApplied}\n fieldsDisabled={fieldsDisabled}\n giftWrappingConfig={giftWrappingConfig}\n handleFormMouseLeave={handleFormMouseLeave}\n readOnlyFormOrderView={readOnlyFormOrderView}\n onInputChange={onInputChange}\n isGiftMessageVisible={isGiftMessageVisible}\n areGiftOptionsVisible={areGiftOptionsVisible}\n imageSwatchImageNode={\n slots?.SwatchImage ? ({ imageSwatchContext, ...defaultImageProps }) => (\n // No need to provide default content, as the slot will only be rendered if it's actually provided.\n <Slot \n name=\"SwatchImage\"\n slotTag='span'\n contentTag='span'\n slot={slots.SwatchImage} \n context={{ item, imageSwatchContext, defaultImageProps }} \n />\n ) : undefined\n }\n />\n );\n};\n"],"names":["SvgCheckWithCircle","props","React","SvgGift","useFocusTrap","showModal","containerRef","useRef","useEffect","container","focusableElements","firstElement","lastElement","handleKeyDown","event","GiftOptionModal","view","productName","giftWrappingConfig","imageSwatchImageNode","setShowModal","updateGiftOptions","dictionary","useText","giftWrappingItem","setGiftWrappingItem","useState","selectedGiftWrapping","item","focusElement","renderTitle","jsx","jsxs","Modal","Fragment","_a","Price","ContentGrid","wrapItem","ImageSwatch","Button","GiftLoader","Skeleton","SkeletonRow","CheckboxGroup","className","giftOptions","disabled","cartData","onInputChange","areGiftOptionsVisible","id","useId","productGiftWrappingOptions","orderGiftWrappingOptions","giftWrappingOptions","el","selectedGiftWrappingLabel","productGiftWrappingPrice","renderSelectedGiftWrappingLabel","printedCardPrice","_b","state","_c","productWrappingPrice","_d","renderPrice","price","classes","Field","Checkbox","FormFields","errorMessage","onBlur","isGiftMessageVisible","Input","TextArea","ReadOnlyFormView","readOnlyFormOrderView","recipientName","senderName","message","giftReceiptIncluded","printedCardIncluded","isGiftWrappingSelected","giftWrapCart","uid","isGiftMessageProvided","giftWrapProductSelectLabel","shouldRenderGiftOptions","productGiftOptionsConfig","noProductGiftOptionsApplied","Accordion","ChevronUp","ChevronDown","AccordionSection","Gift","element","config","renderHeader","Icon","selectedGiftOptions","CheckWithCircle","enteredGiftMessage","Card","GiftOptions","loading","isEditable","errorsField","updateLoading","fieldsDisabled","isGiftOptionsApplied","handleFormMouseLeave","renderAccordion","useCallback","defaultOpen","ProgressSpinner","DEFAULT_FORM_STATE","DEFAULT_CHECKBOXES_STATE","shouldShowGiftMessage","isProductView","allowGiftMessageOnOrderItems","areGiftOptionsDisabled","allowGiftWrappingOnOrder","allowGiftWrappingOnOrderItems","allowGiftMessageOnOrder","allowGiftReceipt","allowPrintedCard","isGiftOptionsOnProductDisabled","isGiftOptionsOnOrderDisabled","useGiftOptions","dataSource","initialLoading","handleItemsLoading","handleItemsError","onItemUpdate","onGiftOptionsChange","setLoading","setAreGiftOptionsVisible","setIsGiftMessageVisible","setUpdateLoading","setFieldsDisabled","isDataChanged","setIsDataChanged","isFormTouched","setIsFormTouched","setGiftWrappingConfig","setCartData","setErrorsField","setGiftOptions","isFormFilled","isFormEmpty","_e","_f","applyGiftOptionsToCart","updatedGiftOptions","giftWrappingId","updateProductsFromCart","error","setGiftOptionsOnCart","name","value","extraGiftOptions","prevGiftOptions","isValidGiftFormKey","key","getPrevValue","handleBlur","prevErrors","target","dataEvent","events","payload","isCartGiftWrappingAllowed","giftWrappingAvailable","isCartGiftWrappingApplied","wrap","giftOptionsState","useMemo","selectedWrap","selectedGiftWrappingId","giftMessageConfig","giftMessageAvailable","isGiftWrappingAvailableForSome","allowGiftWrappingOnProduct","isGiftReceiptVisible","isPrintedCartVisible","isGiftWrappingVisible","giftOptionsFetchData","isGiftOptionsHidden","slots","GiftOptionsComponent","imageSwatch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AO,QACP,sBAAA8D,EAAwB,UACxB,WAAAqD,EAAa,OACb,WAAAxB,EAAa,GACb,eAAAyB,EAAiB,GACjB,MAAA0D,EACA,mBAAAzD,EACA,iBAAAC,EACA,aAAAC,EACA,oBAAAC,CACF,IAAwB,CAChB,KAAA,CACJ,qBAAA9D,EACA,sBAAAxB,EACA,QAAAwD,EACA,YAAA5D,EACA,UAAAzC,EACA,YAAAuG,EACA,cAAAC,EACA,SAAA7D,EACA,qBAAA+D,EACA,eAAAD,EACA,mBAAA5F,EACA,qBAAA8F,EACA,kBAAA3F,EACA,aAAAD,EACA,cAAA6B,EACA,WAAAsH,EACA,oBAAAsB,IACE3D,GAAe,CACjB,KAAAtG,EACA,KAAAZ,EACA,WAAAmH,EACA,eAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,oBAAAC,CAAA,CACD,EAED,OAAIqD,GACK,KAIP9J,EAACgK,GAAA,CACC,KAAAnK,EACA,KAAAZ,EACA,QAAA0F,EACA,OAAQ6D,EACR,YAAAzH,EACA,UAAAzC,EACA,WAAAsG,EACA,YAAAC,EACA,aAAAxF,EACA,cAAAyF,EACA,kBAAAxF,EACA,SAAA2B,EACA,qBAAA+D,EACA,eAAAD,EACA,mBAAA5F,EACA,qBAAA8F,EACA,sBAAAlC,EACA,cAAA7B,EACA,qBAAAyB,EACA,sBAAAxB,EACA,qBACE4I,GAAA,MAAAA,EAAO,YAAc,CAAC,CAAE,mBAAAE,EAAoB,GAAGC,CAAkB,IAE/DlK,EAACmK,GAAA,CACC,KAAK,cACL,QAAQ,OACR,WAAW,OACX,KAAMJ,EAAM,YACZ,QAAS,CAAE,KAAAlK,EAAM,mBAAAoK,EAAoB,kBAAAC,CAAkB,CAAA,CAAA,EAEvD,MAAA,CAER,CAEJ","x_google_ignoreList":[0,1]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container, SlotProps } from '
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
import { CartModel } from '../../data/models';
|
|
4
|
-
import { ImageProps } from '
|
|
4
|
+
import { ImageProps } from '@dropins/tools/types/elsie/src/components';
|
|
5
5
|
|
|
6
6
|
export interface MiniCartProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
routeProduct?: (item: CartModel['items'][0]) => string;
|
package/containers/MiniCart.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as i,jsxs as
|
|
3
|
+
import{jsx as i,jsxs as m,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import{useState as j,useEffect as w,useCallback as O}from"@dropins/tools/preact-compat.js";import{classes as h,VComponent as u,Slot as y}from"@dropins/tools/lib.js";import{g as B}from"../chunks/persisted-data.js";import{events as V}from"@dropins/tools/event-bus.js";import{Button as L,Price as N}from"@dropins/tools/components.js";/* empty css */import{useText as D}from"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import{s as b}from"../chunks/resetCart.js";import{p as $}from"../chunks/acdl.js";import{u as q}from"../chunks/updateProductsFromCart.js";import"../chunks/CartSummaryGrid.js";import{C as z}from"../chunks/CartSummaryList.js";import"../chunks/OrderSummary.js";import"../chunks/CartSummaryTable2.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/EmptyCart.js";import"../chunks/WarningWithCircle.js";import"../chunks/ChevronDown.js";import"../chunks/getEstimatedTotals.js";import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronUp.js";import"../chunks/Coupon.js";import"../chunks/GiftCard.js";const J=({className:_,products:s,productListFooter:l,subtotal:e,subtotalExcludingTaxes:d,preCheckoutSection:n,ctas:o,...x})=>{const p=D({subtotal:"Cart.MiniCart.subtotal",subtotalExcludingTaxes:"Cart.MiniCart.subtotalExcludingTaxes"});return i("div",{...x,className:h(["cart-mini-cart",_]),children:s&&m(R,{children:[i("div",{className:"cart-mini-cart__products","data-testid":"mini-cart-products-wrapper",children:s}),l&&i("div",{className:h(["cart-mini-cart__productListFooter"]),"data-testid":"mini-cart-product-list-footer",children:i(u,{node:l})}),m("div",{className:"cart-mini-cart__footer","data-testid":"mini-cart-subtotals",children:[e&&m("div",{className:"cart-mini-cart__footer__estimated-total","data-testid":"mini-cart-subtotal",children:[p.subtotal,i(u,{node:e})]}),d&&m("div",{className:"cart-mini-cart__footer__estimated-total-excluding-taxes","data-testid":"mini-cart-subtotal-excluding-taxes",children:[p.subtotalExcludingTaxes,i(u,{node:d,className:h(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),n&&i("div",{className:h(["cart-mini-cart__preCheckoutSection"]),"data-testid":"mini-cart-pre-checkout-section",children:i(u,{node:n})}),o&&i(u,{node:o,className:"cart-mini-cart__footer__ctas"})]})]})})},K=({children:_,initialData:s=null,hideFooter:l=!0,slots:e,routeProduct:d,routeCart:n,routeCheckout:o,routeEmptyCartCTA:x,showDiscount:p,showSavings:P,enableItemRemoval:S=!0,enableQuantityUpdate:T=!1,hideHeading:M=!1,...Q})=>{var v,k,I;const[t,U]=j(s),a=(v=b.config)==null?void 0:v.shoppingCartDisplaySetting;w(()=>{const r=V.on("cart/data",f=>{U(f)},{eager:!0});return()=>{r==null||r.off()}},[]);const g=D({cartLink:"Cart.MiniCart.cartLink",checkoutLink:"Cart.MiniCart.checkoutLink"}),C=(r,f)=>q([{uid:r,quantity:f}]),E=r=>C(r,0),c=t==null?void 0:t.hasOutOfStockItems,F=O(()=>{t&&!c&&$(t,b.locale)},[t,c]),G=i(y,{name:"ProductList",slot:e==null?void 0:e.ProductList,context:{itemQuantityUpdateHandler:C,itemRemoveHandler:E,totalQuantity:t==null?void 0:t.totalQuantity},children:i(z,{"data-testid":"default-cart-summary-list",routeProduct:d,routeEmptyCartCTA:x,initialData:t,maxItems:(k=b.config)==null?void 0:k.miniCartMaxItemsDisplay,showMaxItems:!!((I=b.config)!=null&&I.miniCartMaxItemsDisplay),hideHeading:M||!(t!=null&&t.totalQuantity),hideFooter:l,enableRemoveItem:S,enableUpdateItemQuantity:T,showDiscount:p,showSavings:P,slots:{Thumbnail:e==null?void 0:e.Thumbnail}})}),X=r=>i(y,{name:"ProductListFooter",slot:e==null?void 0:e.ProductListFooter,context:{data:r}}),A=r=>i(y,{name:"PreCheckoutSection",slot:e==null?void 0:e.PreCheckoutSection,context:{data:r}}),H=()=>(a==null?void 0:a.subtotal)==="INCLUDING_TAX"||(a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX"?{amount:t==null?void 0:t.subtotal.includingTax.value,currency:t==null?void 0:t.subtotal.includingTax.currency,"data-testid":"subtotal-including-tax",style:{font:"inherit"}}:{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-excluding-tax",style:{font:"inherit"}};return i(J,{...Q,productListFooter:X(t),subtotal:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&i(N,{...H()}):void 0,subtotalExcludingTaxes:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&((a==null?void 0:a.subtotal)==="INCLUDING_EXCLUDING_TAX"?i(N,{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-including-excluding-tax",style:{font:"inherit"}}):void 0):void 0,preCheckoutSection:A(t),ctas:t!=null&&t.totalQuantity?m("div",{children:[o&&i(L,{"data-testid":"route-checkout-button",variant:"primary",href:c?void 0:o(),disabled:c,"aria-disabled":c,onClick:F,children:g.checkoutLink}),n&&i(L,{"data-testid":"route-cart-button",variant:"tertiary",href:n(),children:g.cartLink})]}):void 0,products:G})};K.getInitialData=async function(){return B()};export{K as MiniCart,K as default};
|
|
4
|
+
//# sourceMappingURL=MiniCart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniCart.js","sources":["/@dropins/storefront-cart/src/components/MiniCart/MiniCart.tsx","/@dropins/storefront-cart/src/containers/MiniCart/MiniCart.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { VComponent, classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/cart/components/MiniCart/MiniCart.css';\n\nexport interface MiniCartProps extends HTMLAttributes<HTMLDivElement> {\n products?: VNode;\n productListFooter?: VNode;\n subtotal?: VNode;\n subtotalExcludingTaxes?: VNode;\n preCheckoutSection?: VNode;\n ctas?: VNode;\n}\n\nexport const MiniCart: FunctionComponent<MiniCartProps> = ({\n className,\n products,\n productListFooter,\n subtotal,\n subtotalExcludingTaxes,\n preCheckoutSection,\n ctas,\n ...props\n}) => {\n const dictionary = useText({\n subtotal: 'Cart.MiniCart.subtotal',\n subtotalExcludingTaxes: 'Cart.MiniCart.subtotalExcludingTaxes',\n });\n\n return (\n <div {...props} className={classes(['cart-mini-cart', className])}>\n {/* Content */}\n {products && (\n <>\n <div\n className=\"cart-mini-cart__products\"\n data-testid=\"mini-cart-products-wrapper\"\n >\n {products}\n </div>\n\n {/* Product List Footer */}\n {productListFooter && (\n <div\n className={classes(['cart-mini-cart__productListFooter'])}\n data-testid=\"mini-cart-product-list-footer\"\n >\n <VComponent node={productListFooter} />\n </div>\n )}\n\n <div\n className=\"cart-mini-cart__footer\"\n data-testid=\"mini-cart-subtotals\"\n >\n {/* Subtotal */}\n {subtotal && (\n <div\n className=\"cart-mini-cart__footer__estimated-total\"\n data-testid=\"mini-cart-subtotal\"\n >\n {dictionary.subtotal}\n <VComponent node={subtotal} />\n </div>\n )}\n {/* Subtotal Excluding Taxes */}\n {subtotalExcludingTaxes && (\n <div\n className=\"cart-mini-cart__footer__estimated-total-excluding-taxes\"\n data-testid=\"mini-cart-subtotal-excluding-taxes\"\n >\n {dictionary.subtotalExcludingTaxes}\n <VComponent\n node={subtotalExcludingTaxes}\n className={classes([\n 'dropin-price-summary__price',\n 'dropin-price-summary__price--muted',\n ])}\n />\n </div>\n )}\n\n {/* Pre-checkout section */}\n {preCheckoutSection && (\n <div\n className={classes(['cart-mini-cart__preCheckoutSection'])}\n data-testid=\"mini-cart-pre-checkout-section\"\n >\n <VComponent node={preCheckoutSection} />\n </div>\n )}\n\n {ctas && (\n <VComponent\n node={ctas}\n className=\"cart-mini-cart__footer__ctas\"\n />\n )}\n </div>\n </>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { CartModel } from '@/cart/data/models';\nimport { getPersistedCartData } from '@/cart/lib/persisted-data';\nimport { events } from '@adobe-commerce/event-bus';\nimport { MiniCart as MiniCartComponent } from '@/cart/components';\nimport { CartSummaryList } from '@/cart/containers';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Button, ImageProps, Price } from '@adobe-commerce/elsie/components';\nimport { updateProductsFromCart } from '@/cart/api';\nimport { publishInitiateCheckoutEvent } from '@/cart/lib/acdl';\nimport { state } from '@/cart/lib/state';\n\nexport interface MiniCartProps extends HTMLAttributes<HTMLDivElement> {\n routeProduct?: (item: CartModel['items'][0]) => string;\n routeCart?: () => string;\n routeCheckout?: () => string;\n routeEmptyCartCTA?: () => string;\n slots?: {\n ProductList?: SlotProps;\n ProductListFooter?: SlotProps;\n PreCheckoutSection?: SlotProps;\n Thumbnail?: SlotProps<{ \n item: CartModel['items'][number], \n defaultImageProps: ImageProps \n }>;\n };\n hideFooter?: boolean;\n displayAllItems?: boolean;\n showDiscount?: boolean;\n showSavings?: boolean;\n enableItemRemoval?: boolean;\n enableQuantityUpdate?: boolean;\n hideHeading?: boolean;\n}\n\nexport const MiniCart: Container<MiniCartProps, CartModel | null> = ({\n children,\n initialData = null,\n hideFooter = true, // Default to true for MiniCart\n slots,\n routeProduct,\n routeCart,\n routeCheckout,\n routeEmptyCartCTA,\n showDiscount,\n showSavings,\n enableItemRemoval = true, // Default to true for MiniCart\n enableQuantityUpdate = false, // Default to false for MiniCart\n hideHeading = false, // Default to false for MiniCart\n ...props\n}) => {\n const [data, setData] = useState<CartModel | null>(initialData);\n const cartTaxesConfig = state.config?.shoppingCartDisplaySetting;\n\n useEffect(() => {\n const event = events.on(\n 'cart/data',\n (payload) => {\n setData(payload as CartModel);\n },\n { eager: true }\n );\n\n return () => {\n event?.off();\n };\n }, []);\n\n const dictionary = useText({\n cartLink: 'Cart.MiniCart.cartLink',\n checkoutLink: 'Cart.MiniCart.checkoutLink',\n });\n\n const handleItemQuantityUpdate = (uid: string, quantity: number) => {\n return updateProductsFromCart([{ uid, quantity }]);\n };\n\n const handleItemRemove = (uid: string) => handleItemQuantityUpdate(uid, 0);\n\n const checkoutLinkDisabled = data?.hasOutOfStockItems;\n\n const handleInitiateCheckout = useCallback(() => {\n if (data && !checkoutLinkDisabled) {\n publishInitiateCheckoutEvent(data, state.locale);\n }\n }, [data, checkoutLinkDisabled]);\n\n const productList = (\n <Slot\n name=\"ProductList\"\n slot={slots?.ProductList}\n context={{\n itemQuantityUpdateHandler: handleItemQuantityUpdate,\n itemRemoveHandler: handleItemRemove,\n totalQuantity: data?.totalQuantity,\n }}\n >\n <CartSummaryList\n data-testid=\"default-cart-summary-list\"\n routeProduct={routeProduct}\n routeEmptyCartCTA={routeEmptyCartCTA}\n initialData={data}\n maxItems={state.config?.miniCartMaxItemsDisplay}\n showMaxItems={!!state.config?.miniCartMaxItemsDisplay}\n hideHeading={hideHeading || !data?.totalQuantity}\n hideFooter={hideFooter}\n enableRemoveItem={enableItemRemoval}\n enableUpdateItemQuantity={enableQuantityUpdate}\n showDiscount={showDiscount}\n showSavings={showSavings}\n slots={{\n Thumbnail: slots?.Thumbnail,\n }}\n />\n </Slot>\n );\n\n const getProductListFooter = (data: CartModel | null) => {\n return (\n <Slot\n name=\"ProductListFooter\"\n slot={slots?.ProductListFooter}\n context={{\n data,\n }}\n />\n );\n };\n\n const getPreCheckoutSection = (data: CartModel | null) => {\n return (\n <Slot\n name=\"PreCheckoutSection\"\n slot={slots?.PreCheckoutSection}\n context={{\n data,\n }}\n />\n );\n };\n\n const getSubtotalPriceProps = () =>\n cartTaxesConfig?.subtotal === 'INCLUDING_TAX' ||\n cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX'\n ? {\n amount: data?.subtotal.includingTax.value,\n currency: data?.subtotal.includingTax.currency,\n 'data-testid': 'subtotal-including-tax',\n style: { font: 'inherit' },\n }\n : {\n amount: data?.subtotal.excludingTax.value,\n currency: data?.subtotal.excludingTax.currency,\n 'data-testid': 'subtotal-excluding-tax',\n style: { font: 'inherit' },\n };\n\n return (\n <MiniCartComponent\n {...props}\n productListFooter={getProductListFooter(data)}\n subtotal={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal && <Price {...getSubtotalPriceProps()} />\n }\n subtotalExcludingTaxes={\n !data?.totalQuantity\n ? undefined\n : data?.subtotal &&\n (cartTaxesConfig?.subtotal === 'INCLUDING_EXCLUDING_TAX' ? (\n <Price\n amount={data?.subtotal.excludingTax.value}\n currency={data?.subtotal.excludingTax.currency}\n data-testid=\"subtotal-including-excluding-tax\"\n style={{ font: 'inherit' }}\n />\n ) : undefined)\n }\n preCheckoutSection={getPreCheckoutSection(data)}\n ctas={\n !data?.totalQuantity ? undefined : (\n <div>\n {routeCheckout && (\n <Button\n data-testid=\"route-checkout-button\"\n variant=\"primary\"\n href={checkoutLinkDisabled ? undefined : routeCheckout()}\n disabled={checkoutLinkDisabled}\n aria-disabled={checkoutLinkDisabled}\n onClick={handleInitiateCheckout}\n >\n {dictionary.checkoutLink}\n </Button>\n )}\n {routeCart && (\n <Button\n data-testid=\"route-cart-button\"\n variant=\"tertiary\"\n href={routeCart()}\n >\n {dictionary.cartLink}\n </Button>\n )}\n </div>\n )\n }\n products={productList}\n />\n );\n};\n\nMiniCart.getInitialData = async function () {\n return getPersistedCartData();\n};\n"],"names":["MiniCart","className","products","productListFooter","subtotal","subtotalExcludingTaxes","preCheckoutSection","ctas","props","dictionary","useText","jsx","classes","jsxs","Fragment","VComponent","children","initialData","hideFooter","slots","routeProduct","routeCart","routeCheckout","routeEmptyCartCTA","showDiscount","showSavings","enableItemRemoval","enableQuantityUpdate","hideHeading","data","setData","useState","cartTaxesConfig","_a","state","useEffect","event","events","payload","handleItemQuantityUpdate","uid","quantity","updateProductsFromCart","handleItemRemove","checkoutLinkDisabled","handleInitiateCheckout","useCallback","publishInitiateCheckoutEvent","productList","Slot","CartSummaryList","_b","_c","getProductListFooter","getPreCheckoutSection","getSubtotalPriceProps","MiniCartComponent","Price","Button","getPersistedCartData"],"mappings":"mrCAiCO,MAAMA,EAA6C,CAAC,CACzD,UAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,uBAAAC,EACA,mBAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,SAAU,yBACV,uBAAwB,sCAAA,CAC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B,EACV,gBAAeA,EACf,QAASC,EAER,SAAWpC,EAAA,YAAA,CACd,EAEDY,GACCV,EAAC+C,EAAA,CACC,cAAY,oBACZ,QAAQ,WACR,KAAMrC,EAAU,EAEf,SAAWZ,EAAA,QAAA,CAAA,CACd,EAEJ,EAvBqB,OA0BzB,SAAUuC,CAAA,CACZ,CAEJ,EAEAhD,EAAS,eAAiB,gBAAkB,CAC1C,OAAO2D,EAAqB,CAC9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container, SlotProps } from '
|
|
2
|
+
import { Container, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
import { CartModel } from '../../data/models';
|
|
4
4
|
import { OrderSummaryLineItem } from '../../components';
|
|
5
5
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{O as k,O as n}from"../chunks/OrderSummary.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getEstimatedTotals.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{O as k,O as n}from"../chunks/OrderSummary.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getEstimatedTotals.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";/* empty css */import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronUp.js";import"../chunks/ChevronDown.js";import"@dropins/tools/i18n.js";import"../chunks/Coupon.js";import"../chunks/GiftCard.js";export{k as OrderSummary,n as default};
|
|
4
|
+
//# sourceMappingURL=OrderSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
import { VNode } from 'preact';
|
|
4
4
|
|
|
5
5
|
export interface OrderSummaryLineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'label'> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{O,O as d}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css
|
|
3
|
+
import{O,O as d}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact-hooks.js";export{O as OrderSummaryLine,d as default};
|
|
4
|
+
//# sourceMappingURL=OrderSummaryLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderSummaryLine.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/containers/index.d.ts
CHANGED
|
@@ -75,10 +75,16 @@ export type ShoppingCartItem = {
|
|
|
75
75
|
id: string;
|
|
76
76
|
prices: {
|
|
77
77
|
price: Price;
|
|
78
|
+
discount?: Price;
|
|
78
79
|
};
|
|
79
80
|
product: Product;
|
|
80
81
|
configurableOptions?: Array<ConfigurableOption>;
|
|
82
|
+
bundleOptions?: Array<BundleOption>;
|
|
83
|
+
customizableOptions?: Array<CustomizableOption>;
|
|
81
84
|
quantity: number;
|
|
85
|
+
selectedOptions?: {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
};
|
|
82
88
|
};
|
|
83
89
|
export type ConfigurableOption = {
|
|
84
90
|
id: number;
|
|
@@ -86,4 +92,16 @@ export type ConfigurableOption = {
|
|
|
86
92
|
valueId: number;
|
|
87
93
|
valueLabel: string;
|
|
88
94
|
};
|
|
95
|
+
export type BundleOption = {
|
|
96
|
+
id: string;
|
|
97
|
+
optionLabel: string;
|
|
98
|
+
valueId: number;
|
|
99
|
+
valueLabel: string;
|
|
100
|
+
};
|
|
101
|
+
export type CustomizableOption = {
|
|
102
|
+
id: string;
|
|
103
|
+
optionLabel: string;
|
|
104
|
+
valueId: number;
|
|
105
|
+
valueLabel: string;
|
|
106
|
+
};
|
|
89
107
|
//# sourceMappingURL=acdl-models.d.ts.map
|
package/fragments.js
CHANGED
|
@@ -401,3 +401,4 @@ const e=`
|
|
|
401
401
|
${l}
|
|
402
402
|
${t}
|
|
403
403
|
`;export{t as APPLIED_GIFT_CARDS_FRAGMENT,n as AVAILABLE_GIFT_WRAPPING_FRAGMENT,u as CART_FRAGMENT,l as CART_ITEM_FRAGMENT,a as DOWNLOADABLE_CART_ITEMS_FRAGMENT,r as GIFT_MESSAGE_FRAGMENT,i as GIFT_WRAPPING_FRAGMENT};
|
|
404
|
+
//# sourceMappingURL=fragments.js.map
|
package/fragments.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fragments.js","sources":["/@dropins/storefront-cart/src/api/graphql/PriceRangeFragment.ts","/@dropins/storefront-cart/src/api/graphql/CustomizableOptionsFragment.ts","/@dropins/storefront-cart/src/api/graphql/DownloadableCartItemsFragment.ts","/@dropins/storefront-cart/src/api/graphql/GiftFragment.ts","/@dropins/storefront-cart/src/api/graphql/CartItemFragment.ts","/@dropins/storefront-cart/src/api/graphql/CartFragment.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PRICE_RANGE_FRAGMENT = /* GraphQL */ `\n fragment PRICE_RANGE_FRAGMENT on PriceRange {\n minimum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n discount {\n percent_off\n amount_off\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMIZABLE_OPTIONS_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMIZABLE_OPTIONS_FRAGMENT on SelectedCustomizableOption {\n type\n customizable_option_uid\n label\n is_required\n values {\n label\n value\n price {\n type\n units\n value\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const DOWNLOADABLE_CART_ITEMS_FRAGMENT = /* GraphQL */ `\n fragment DOWNLOADABLE_CART_ITEMS_FRAGMENT on DownloadableCartItem {\n links {\n sort_order\n title\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n`;\n","export const APPLIED_GIFT_CARDS_FRAGMENT = `\n fragment APPLIED_GIFT_CARDS_FRAGMENT on AppliedGiftCard {\n __typename\n code\n applied_balance {\n value\n currency\n }\n current_balance {\n value\n currency\n }\n expiration_date\n }\n`;\n\nexport const GIFT_MESSAGE_FRAGMENT = `\n fragment GIFT_MESSAGE_FRAGMENT on GiftMessage {\n __typename\n from\n to\n message\n }\n`;\n\nexport const GIFT_WRAPPING_FRAGMENT = `\n fragment GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n }\n price {\n value\n currency\n }\n }\n`;\n\nexport const AVAILABLE_GIFT_WRAPPING_FRAGMENT = `\n fragment AVAILABLE_GIFT_WRAPPING_FRAGMENT on GiftWrapping {\n __typename\n uid\n design\n image {\n url\n label\n }\n price {\n currency\n value\n }\n }\n`;\n\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PRICE_RANGE_FRAGMENT } from './PriceRangeFragment';\nimport { CUSTOMIZABLE_OPTIONS_FRAGMENT } from './CustomizableOptionsFragment';\nimport { DOWNLOADABLE_CART_ITEMS_FRAGMENT } from './DownloadableCartItemsFragment';\nimport {\n GIFT_MESSAGE_FRAGMENT,\n GIFT_WRAPPING_FRAGMENT,\n AVAILABLE_GIFT_WRAPPING_FRAGMENT,\n} from './GiftFragment';\n\nexport const CART_ITEM_FRAGMENT = /* GraphQL */ `\n fragment CART_ITEM_FRAGMENT on CartItemInterface {\n __typename\n uid\n quantity\n is_available\n not_available_message\n errors {\n code\n message\n }\n\n prices {\n price {\n value\n currency\n }\n discounts {\n amount {\n value\n currency\n }\n label\n }\n total_item_discount {\n value\n currency\n }\n row_total {\n value\n currency\n }\n row_total_including_tax {\n value\n currency\n }\n price_including_tax {\n value\n currency\n }\n fixed_product_taxes {\n amount {\n value\n currency\n }\n label\n }\n original_item_price {\n value\n currency\n }\n original_row_total {\n value\n currency\n }\n }\n\n product {\n name\n sku\n quantity\n gift_message_available\n gift_wrapping_available\n gift_wrapping_price {\n currency\n value\n }\n thumbnail {\n url\n label\n }\n url_key\n canonical_url\n categories {\n url_path\n url_key\n name\n }\n custom_attributesV2(filters: { is_visible_on_front: true }) {\n items {\n code\n ... on AttributeValue {\n value\n }\n ... on AttributeSelectedOptions {\n selected_options {\n value\n label\n }\n }\n }\n }\n only_x_left_in_stock\n stock_status\n price_range {\n ...PRICE_RANGE_FRAGMENT\n }\n }\n ... on SimpleCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n ... on ConfigurableCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n configurable_options {\n configurable_product_option_uid\n option_label\n value_label\n configurable_product_option_value_uid\n }\n configured_variant {\n uid\n sku\n only_x_left_in_stock\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n ...PRICE_RANGE_FRAGMENT\n }\n }\n customizable_options {\n ...CUSTOMIZABLE_OPTIONS_FRAGMENT\n }\n }\n ...DOWNLOADABLE_CART_ITEMS_FRAGMENT\n ... on BundleCartItem {\n available_gift_wrapping {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n bundle_options {\n uid\n label\n values {\n uid\n label\n }\n }\n }\n ... on GiftCardCartItem {\n message\n recipient_email\n recipient_name\n sender_email\n sender_name\n amount {\n currency\n value\n }\n is_available\n }\n }\n\n ${PRICE_RANGE_FRAGMENT}\n ${CUSTOMIZABLE_OPTIONS_FRAGMENT}\n ${DOWNLOADABLE_CART_ITEMS_FRAGMENT}\n ${GIFT_WRAPPING_FRAGMENT}\n ${GIFT_MESSAGE_FRAGMENT}\n ${AVAILABLE_GIFT_WRAPPING_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CART_ITEM_FRAGMENT } from './CartItemFragment';\nimport { APPLIED_GIFT_CARDS_FRAGMENT } from '../fragments';\n\nexport const CART_FRAGMENT = /* GraphQL */ `\n fragment CART_FRAGMENT on Cart {\n id\n total_quantity\n is_virtual\n applied_gift_cards {\n ...APPLIED_GIFT_CARDS_FRAGMENT\n }\n gift_receipt_included\n printed_card_included\n gift_message {\n ...GIFT_MESSAGE_FRAGMENT\n }\n gift_wrapping {\n ...GIFT_WRAPPING_FRAGMENT\n }\n available_gift_wrappings {\n ...AVAILABLE_GIFT_WRAPPING_FRAGMENT\n }\n prices {\n gift_options {\n gift_wrapping_for_items {\n currency\n value\n }\n gift_wrapping_for_items_incl_tax {\n currency\n value\n }\n gift_wrapping_for_order {\n currency\n value\n }\n gift_wrapping_for_order_incl_tax {\n currency\n value\n }\n printed_card {\n currency\n value\n }\n printed_card_incl_tax {\n currency\n value\n }\n }\n subtotal_with_discount_excluding_tax {\n currency\n value\n }\n subtotal_including_tax {\n currency\n value\n }\n subtotal_excluding_tax {\n currency\n value\n }\n grand_total {\n currency\n value\n }\n grand_total_excluding_tax {\n currency\n value\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n amount {\n value\n currency\n }\n label\n coupon {\n code\n }\n applied_to\n }\n }\n applied_coupons {\n code\n }\n itemsV2(\n pageSize: $pageSize\n currentPage: $currentPage\n sort: $itemsSortInput\n ) {\n items {\n ...CART_ITEM_FRAGMENT\n }\n }\n shipping_addresses {\n country {\n code\n }\n region {\n code\n }\n postcode\n }\n }\n\n ${CART_ITEM_FRAGMENT}\n ${APPLIED_GIFT_CARDS_FRAGMENT}\n`;\n"],"names":["PRICE_RANGE_FRAGMENT","CUSTOMIZABLE_OPTIONS_FRAGMENT","DOWNLOADABLE_CART_ITEMS_FRAGMENT","APPLIED_GIFT_CARDS_FRAGMENT","GIFT_MESSAGE_FRAGMENT","GIFT_WRAPPING_FRAGMENT","AVAILABLE_GIFT_WRAPPING_FRAGMENT","CART_ITEM_FRAGMENT","CART_FRAGMENT"],"mappings":"AAiBa,MAAAA,EAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECArCC,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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|
|
3
|
+
import { PriceProps } from '@dropins/tools/types/elsie/src/components/Price';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Params for the useCartItems hook
|
|
7
|
+
*
|
|
8
|
+
* @param {
|
|
9
|
+
* dictionary: ReturnType<typeof useText>;
|
|
10
|
+
* onQuantityUpdate?: (item: CartModel['items'][number], quantity: number) => void;
|
|
11
|
+
* onItemRemove?: (item: CartModel['items'][number]) => void;
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* dictionary - The dictionary
|
|
15
|
+
* onQuantityUpdate - The function to call when the quantity is updated
|
|
16
|
+
* onItemRemove - The function to call when the item is removed
|
|
17
|
+
*/
|
|
18
|
+
export interface useCartItemsProps {
|
|
19
|
+
dictionary: ReturnType<typeof useText>;
|
|
20
|
+
onQuantityUpdate?: (item: CartModel['items'][number], quantity: number) => void;
|
|
21
|
+
onItemRemove?: (item: CartModel['items'][number]) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Params for the getConfiguration function
|
|
25
|
+
*/
|
|
26
|
+
interface GetConfigurationParams {
|
|
27
|
+
item: CartModel['items'][number];
|
|
28
|
+
}
|
|
29
|
+
interface ItemUpdateState {
|
|
30
|
+
isUpdating: boolean;
|
|
31
|
+
updatedValue: any;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Type for the API returned by useCartItems
|
|
35
|
+
*
|
|
36
|
+
* This interface ensures that the returned object from the hook is well-typed and clear for consumers.
|
|
37
|
+
*/
|
|
38
|
+
export interface UseCartItemsApi {
|
|
39
|
+
showIncludedTaxPrice: boolean;
|
|
40
|
+
showExcludingTaxPrice: boolean;
|
|
41
|
+
itemsUpdating: Map<string, ItemUpdateState>;
|
|
42
|
+
itemUpdateErrors: Map<string, string>;
|
|
43
|
+
getConfiguration: (params: GetConfigurationParams) => object | undefined;
|
|
44
|
+
getPriceProps: (item: CartModel['items'][number]) => PriceProps;
|
|
45
|
+
getSubtotalProps: (item: CartModel['items'][number]) => {
|
|
46
|
+
subtotalProps: PriceProps;
|
|
47
|
+
subtotalDiscountProps: PriceProps | null;
|
|
48
|
+
};
|
|
49
|
+
processQuantityChange: (item: CartModel['items'][number], value: number) => Promise<void>;
|
|
50
|
+
debouncedQuantityChange: (item: CartModel['items'][number], value: number) => void;
|
|
51
|
+
setItemsUpdating: (itemsUpdating: Map<string, ItemUpdateState>) => void;
|
|
52
|
+
getWarningMessage: (item: CartModel['items'][number]) => string | undefined;
|
|
53
|
+
setItemUpdateError: (uid: string, error: string) => void;
|
|
54
|
+
handleRemoveItem: (item: CartModel['items'][number]) => Promise<CartModel | null>;
|
|
55
|
+
setItemUpdating: (uid: string, state: boolean) => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* useCartItems hook
|
|
59
|
+
*
|
|
60
|
+
* Provides an API for managing and retrieving calculated cart items data, including price, subtotal, configuration, quantity updates, and error handling.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} params
|
|
63
|
+
* @param {ReturnType<typeof useText>} params.dictionary - The i18n dictionary
|
|
64
|
+
* @param {(item: CartModel['items'][number], quantity: number) => void} [params.onQuantityUpdate] - Callback when item quantity is updated
|
|
65
|
+
* @param {(item: CartModel['items'][number]) => void} [params.onItemRemove] - Callback when item is removed
|
|
66
|
+
*
|
|
67
|
+
* @returns {Object} API for cart item management:
|
|
68
|
+
* - showIncludedTaxPrice: boolean
|
|
69
|
+
* - showExcludingTaxPrice: boolean
|
|
70
|
+
* - itemsUpdating: Map<string, ItemUpdateState>
|
|
71
|
+
* - itemUpdateErrors: Map<string, string>
|
|
72
|
+
* - getConfiguration(item): object | undefined
|
|
73
|
+
* - getPriceProps(item): PriceProps
|
|
74
|
+
* - getSubtotalProps(item): { subtotalProps: PriceProps, subtotalDiscountProps: PriceProps | null }
|
|
75
|
+
* - processQuantityChange(item, value): Promise<void>
|
|
76
|
+
* - debouncedQuantityChange(item, value): void
|
|
77
|
+
* - setItemsUpdating(map): void
|
|
78
|
+
* - getWarningMessage(item): string | undefined
|
|
79
|
+
* - setItemUpdateError(uid, error): void
|
|
80
|
+
* - handleRemoveItem(item): Promise<CartModel>
|
|
81
|
+
* - setItemUpdating(uid, state): void
|
|
82
|
+
*/
|
|
83
|
+
export declare const useCartItems: ({ dictionary, onQuantityUpdate, onItemRemove }: useCartItemsProps) => UseCartItemsApi;
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=useCartItems.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CartModel, Item } from '../data/models';
|
|
2
2
|
import { GiftOptionsDataSourcesProps, GiftOptionsViewProps, GiftWrappingConfigProps, GiftFormDataType, ProductGiftOptionsConfig } from '../types';
|
|
3
3
|
|
|
4
|
-
interface UseGiftOptionsProps {
|
|
4
|
+
export interface UseGiftOptionsProps {
|
|
5
5
|
item: Item | ProductGiftOptionsConfig;
|
|
6
6
|
view: GiftOptionsViewProps;
|
|
7
7
|
dataSource: GiftOptionsDataSourcesProps;
|
|
@@ -42,5 +42,4 @@ export declare const useGiftOptions: ({ item, view, dataSource, initialLoading,
|
|
|
42
42
|
};
|
|
43
43
|
isGiftOptionsHidden: boolean;
|
|
44
44
|
};
|
|
45
|
-
export {};
|
|
46
45
|
//# sourceMappingURL=useGiftOptions.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ declare const _default: {
|
|
|
6
6
|
"viewAll": "View all in cart",
|
|
7
7
|
"viewMore": "View more"
|
|
8
8
|
},
|
|
9
|
+
"CartSummaryTable": {
|
|
10
|
+
"item": "Item",
|
|
11
|
+
"price": "Price",
|
|
12
|
+
"qty": "Qty",
|
|
13
|
+
"subtotal": "Subtotal",
|
|
14
|
+
"mobilePrice": "Price",
|
|
15
|
+
"mobileQty": "Qty",
|
|
16
|
+
"mobileSubtotal": "Subtotal"
|
|
17
|
+
},
|
|
9
18
|
"MiniCart": {
|
|
10
19
|
"heading": "Shopping Cart ({count})",
|
|
11
20
|
"subtotal": "Subtotal",
|
|
@@ -123,7 +132,9 @@ declare const _default: {
|
|
|
123
132
|
"insufficientQuantityGeneral": "Not enough items for sale",
|
|
124
133
|
"notAvailableMessage": "Requested qty. not available",
|
|
125
134
|
"discountPercentage": "{discount}% off",
|
|
126
|
-
"savingsAmount": "Savings"
|
|
135
|
+
"savingsAmount": "Savings",
|
|
136
|
+
"includingTax": "Incl. tax",
|
|
137
|
+
"excludingTax": "Excl. tax"
|
|
127
138
|
},
|
|
128
139
|
"EstimateShipping": {
|
|
129
140
|
"label": "Shipping",
|
|
@@ -181,8 +192,8 @@ declare const _default: {
|
|
|
181
192
|
"formTo": "To",
|
|
182
193
|
"formFrom": "From",
|
|
183
194
|
"giftMessageTitle": "Gift message",
|
|
184
|
-
"formToPlaceholder": "Recipient
|
|
185
|
-
"formFromPlaceholder": "Sender
|
|
195
|
+
"formToPlaceholder": "Recipient's name",
|
|
196
|
+
"formFromPlaceholder": "Sender's name",
|
|
186
197
|
"formMessagePlaceholder": "Gift message"
|
|
187
198
|
},
|
|
188
199
|
"readOnlyFormView": {
|
|
@@ -219,8 +230,8 @@ declare const _default: {
|
|
|
219
230
|
"formTo": "To",
|
|
220
231
|
"formFrom": "From",
|
|
221
232
|
"giftMessageTitle": "Gift message",
|
|
222
|
-
"formToPlaceholder": "Recipient
|
|
223
|
-
"formFromPlaceholder": "Sender
|
|
233
|
+
"formToPlaceholder": "Recipient's name",
|
|
234
|
+
"formFromPlaceholder": "Sender's name",
|
|
224
235
|
"formMessagePlaceholder": "Gift message"
|
|
225
236
|
},
|
|
226
237
|
"readOnlyFormView": {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-cart", "version": "1.
|
|
1
|
+
{"name": "@dropins/storefront-cart", "version": "1.4.0-alpha2", "@dropins/tools": "1.3.0-beta3", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render/render.d.ts
CHANGED