@dropins/storefront-cart 1.6.0-alpha2 → 1.6.0-alpha4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/api/fragments.d.ts +0 -1
  2. package/api.js +1 -1
  3. package/api.js.map +1 -1
  4. package/chunks/CartSummaryGrid.js +1 -1
  5. package/chunks/CartSummaryGrid.js.map +1 -1
  6. package/chunks/CartSummaryList.js +1 -1
  7. package/chunks/CartSummaryList.js.map +1 -1
  8. package/chunks/CartSummaryTable2.js +1 -1
  9. package/chunks/CartSummaryTable2.js.map +1 -1
  10. package/chunks/EmptyCart.js +1 -1
  11. package/chunks/EmptyCart.js.map +1 -1
  12. package/chunks/EmptyCart2.js +1 -1
  13. package/chunks/EmptyCart2.js.map +1 -1
  14. package/chunks/OrderSummary.js +1 -1
  15. package/chunks/OrderSummary.js.map +1 -1
  16. package/chunks/OrderSummaryLine.js +1 -1
  17. package/chunks/OrderSummaryLine.js.map +1 -1
  18. package/chunks/acdl.js +1 -1
  19. package/chunks/applyCouponsToCart.js +2 -2
  20. package/chunks/applyCouponsToCart.js.map +1 -1
  21. package/chunks/createGuestCart.js +2 -2
  22. package/chunks/createGuestCart.js.map +1 -1
  23. package/chunks/getEstimateShipping.js +2 -2
  24. package/chunks/getEstimateShipping.js.map +1 -1
  25. package/chunks/getEstimatedTotals.js +2 -2
  26. package/chunks/getEstimatedTotals.js.map +1 -1
  27. package/chunks/persisted-data.js +1 -1
  28. package/chunks/refreshCart.js +7 -7
  29. package/chunks/refreshCart.js.map +1 -1
  30. package/chunks/removeGiftCardFromCart.js +3 -3
  31. package/chunks/removeGiftCardFromCart.js.map +1 -1
  32. package/chunks/resetCart.js +1 -1
  33. package/chunks/resetCart.js.map +1 -1
  34. package/chunks/setGiftOptionsOnCart.js +2 -2
  35. package/chunks/setGiftOptionsOnCart.js.map +1 -1
  36. package/chunks/updateProductsFromCart.js +2 -2
  37. package/chunks/updateProductsFromCart.js.map +1 -1
  38. package/components/index.d.ts +0 -1
  39. package/containers/CartSummaryGrid.js +1 -1
  40. package/containers/CartSummaryList.js +1 -1
  41. package/containers/CartSummaryTable.js +1 -1
  42. package/containers/Coupons.js +1 -1
  43. package/containers/Coupons.js.map +1 -1
  44. package/containers/EmptyCart.js +1 -1
  45. package/containers/EstimateShipping.js +1 -1
  46. package/containers/EstimateShipping.js.map +1 -1
  47. package/containers/GiftCards.js +1 -1
  48. package/containers/GiftCards.js.map +1 -1
  49. package/containers/GiftOptions.js +1 -1
  50. package/containers/GiftOptions.js.map +1 -1
  51. package/containers/MiniCart.js +1 -1
  52. package/containers/MiniCart.js.map +1 -1
  53. package/containers/OrderSummary.js +1 -1
  54. package/containers/OrderSummaryLine.js +1 -1
  55. package/containers/index.d.ts +0 -1
  56. package/data/models/cart-model.d.ts +16 -3
  57. package/data/models/shipping-models.d.ts +2 -5
  58. package/fragments.js +7 -30
  59. package/fragments.js.map +1 -1
  60. package/i18n/en_US.json.d.ts +0 -5
  61. package/package.json +1 -1
  62. package/render.js +3 -4
  63. package/render.js.map +1 -1
  64. package/api/graphql/ShippingMethodFragment.d.ts +0 -18
  65. package/chunks/OrderSummaryLine2.js +0 -4
  66. package/chunks/OrderSummaryLine2.js.map +0 -1
  67. package/chunks/ShippingOrderSummaryLine.js +0 -4
  68. package/chunks/ShippingOrderSummaryLine.js.map +0 -1
  69. package/chunks/state.js +0 -4
  70. package/chunks/state.js.map +0 -1
  71. package/components/ShippingOrderSummaryLine/ShippingOrderSummaryLine.d.ts +0 -13
  72. package/components/ShippingOrderSummaryLine/index.d.ts +0 -18
  73. package/containers/ShippingOrderSummaryLine/ShippingOrderSummaryLine.d.ts +0 -7
  74. package/containers/ShippingOrderSummaryLine/index.d.ts +0 -19
  75. package/containers/ShippingOrderSummaryLine.d.ts +0 -3
  76. package/containers/ShippingOrderSummaryLine.js +0 -4
  77. package/containers/ShippingOrderSummaryLine.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sources":["/@dropins/storefront-cart/src/lib/cookies.ts","/@dropins/storefront-cart/src/lib/state.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 function getCookie(cookieName: string) {\n // Split the cookie string into an array of individual cookies\n const cookies = document.cookie.split(';');\n\n // Loop through the cookies to find the one with the specified name\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim(); // Remove leading and trailing spaces\n\n // Check if this cookie starts with the name you're looking for\n if (cookie.indexOf(`${cookieName}=`) === 0) {\n // Extract and return the cookie's value\n return cookie.substring(cookieName.length + 1);\n }\n }\n\n // If the cookie is not found, return null\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 { getCookie } from '@/cart/lib/cookies';\nimport { StoreConfigModel } from '@/cart/data/models/store-models';\nimport { getAuthenticatedCart, setAuthenticatedCart } from './persisted-data';\n\ntype State = {\n state: {\n displayMiniCart: boolean;\n miniCartMaxItemsDisplay: number;\n cartExpiresInDays: number;\n cartSummaryDisplayTotal: number;\n defaultCountry: string;\n categoryFixedProductTaxDisplaySetting: string;\n productFixedProductTaxDisplaySetting: string;\n salesFixedProductTaxDisplaySetting: string;\n useConfigurableParentThumbnail: boolean;\n shoppingCartDisplaySetting: {\n zeroTax: boolean;\n subtotal: string;\n price: string;\n shipping: string;\n fullSummary: boolean;\n grandTotal: boolean;\n taxGiftWrapping: string;\n };\n };\n cartId: string | null;\n authenticated: boolean;\n initializing?: boolean;\n locale?: string;\n config?: StoreConfigModel | null;\n};\n\nconst _state: State = (() => {\n const isAuthenticated = getAuthenticatedCart();\n return {\n cartId: null,\n authenticated: isAuthenticated,\n };\n})();\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n // @ts-ignore\n target[key] = value;\n\n if (key === 'cartId') {\n // only update cookie if value has changed\n if (value === state.cartId) return true;\n\n if (value === null) {\n // remove cookie\n document.cookie = `DROPIN__CART__CART-ID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`;\n return true;\n }\n\n // get expiration days from config\n const expiresInDays = state.config?.cartExpiresInDays;\n\n if (!expiresInDays) {\n console.warn(\n 'Missing \"expiresInDays\" config. Cookie expiration will default to 30 days.'\n );\n }\n\n // set expiration date\n const expires = new Date();\n expires.setDate(expires.getDate() + (expiresInDays ?? 30));\n\n // set cookie\n document.cookie = `DROPIN__CART__CART-ID=${value}; expires=${expires.toUTCString()}; path=/`;\n }\n\n if (key === 'authenticated') {\n setAuthenticatedCart(value);\n }\n\n return true;\n },\n get(target, key) {\n if (key === 'cartId') {\n // get value from cookie\n return getCookie('DROPIN__CART__CART-ID');\n }\n\n return target[key as keyof State];\n },\n});\n"],"names":["getCookie","cookieName","cookies","i","cookie","_state","getAuthenticatedCart","state","target","key","value","expiresInDays","_a","expires","setAuthenticatedCart"],"mappings":"0CAiBO,SAASA,EAAUC,EAAoB,CAE5C,MAAMC,EAAU,SAAS,OAAO,MAAM,GAAG,EAGzC,QAASC,EAAI,EAAGA,EAAID,EAAQ,OAAQC,IAAK,CACvC,MAAMC,EAASF,EAAQC,CAAC,EAAE,KAAK,EAG/B,GAAIC,EAAO,QAAQ,GAAGH,CAAU,GAAG,IAAM,EAEvC,OAAOG,EAAO,UAAUH,EAAW,OAAS,CAAC,CAC/C,CAIK,OAAA,IACT,CCeA,MAAMI,EAEG,CACL,OAAQ,KACR,cAHsBC,EAAqB,CAI7C,EAIWC,EAAQ,IAAI,MAAMF,EAAQ,CACrC,IAAIG,EAAQC,EAAKC,EAAO,OAItB,GAFAF,EAAOC,CAAG,EAAIC,EAEVD,IAAQ,SAAU,CAEhB,GAAAC,IAAUH,EAAM,OAAe,MAAA,GAEnC,GAAIG,IAAU,KAEZ,gBAAS,OAAS,wEACX,GAIH,MAAAC,GAAgBC,EAAAL,EAAM,SAAN,YAAAK,EAAc,kBAE/BD,GACK,QAAA,KACN,4EACF,EAII,MAAAE,MAAc,KACpBA,EAAQ,QAAQA,EAAQ,QAAQ,GAAKF,GAAiB,GAAG,EAGzD,SAAS,OAAS,yBAAyBD,CAAK,aAAaG,EAAQ,YAAa,CAAA,UAAA,CAGpF,OAAIJ,IAAQ,iBACVK,EAAqBJ,CAAK,EAGrB,EACT,EACA,IAAIF,EAAQC,EAAK,CACf,OAAIA,IAAQ,SAEHT,EAAU,uBAAuB,EAGnCQ,EAAOC,CAAkB,CAAA,CAEpC,CAAC"}
@@ -1,13 +0,0 @@
1
- import { FunctionComponent, VNode } from 'preact';
2
- import { HTMLAttributes } from 'preact/compat';
3
-
4
- export interface ShippingOrderSummaryLineProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
5
- loading: boolean;
6
- price: VNode<HTMLAttributes<HTMLSpanElement>>;
7
- priceExcludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
8
- priceIncludingTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
9
- taxExcluded?: boolean;
10
- taxIncluded?: boolean;
11
- }
12
- export declare const ShippingOrderSummaryLine: FunctionComponent<ShippingOrderSummaryLineProps>;
13
- //# sourceMappingURL=ShippingOrderSummaryLine.d.ts.map
@@ -1,18 +0,0 @@
1
- /********************************************************************
2
- * ADOBE CONFIDENTIAL
3
- * __________________
4
- *
5
- * Copyright 2025 Adobe
6
- * All Rights Reserved.
7
- *
8
- * NOTICE: All information contained herein is, and remains
9
- * the property of Adobe and its suppliers, if any. The intellectual
10
- * and technical concepts contained herein are proprietary to Adobe
11
- * and its suppliers and are protected by all applicable intellectual
12
- * property laws, including trade secret and copyright laws.
13
- * Dissemination of this information or reproduction of this material
14
- * is strictly forbidden unless prior written permission is obtained
15
- * from Adobe.
16
- *******************************************************************/
17
- export * from './ShippingOrderSummaryLine';
18
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +0,0 @@
1
- import { Container } from '@dropins/tools/types/elsie/src/lib';
2
- import { HTMLAttributes } from 'preact/compat';
3
-
4
- export interface ShippingOrderSummaryLineProps extends HTMLAttributes<HTMLDivElement> {
5
- }
6
- export declare const ShippingOrderSummaryLine: Container<ShippingOrderSummaryLineProps>;
7
- //# sourceMappingURL=ShippingOrderSummaryLine.d.ts.map
@@ -1,19 +0,0 @@
1
- /********************************************************************
2
- * ADOBE CONFIDENTIAL
3
- * __________________
4
- *
5
- * Copyright 2025 Adobe
6
- * All Rights Reserved.
7
- *
8
- * NOTICE: All information contained herein is, and remains
9
- * the property of Adobe and its suppliers, if any. The intellectual
10
- * and technical concepts contained herein are proprietary to Adobe
11
- * and its suppliers and are protected by all applicable intellectual
12
- * property laws, including trade secret and copyright laws.
13
- * Dissemination of this information or reproduction of this material
14
- * is strictly forbidden unless prior written permission is obtained
15
- * from Adobe.
16
- *******************************************************************/
17
- export * from './ShippingOrderSummaryLine';
18
- export { ShippingOrderSummaryLine as default } from './ShippingOrderSummaryLine';
19
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from './ShippingOrderSummaryLine/index'
2
- import _default from './ShippingOrderSummaryLine/index'
3
- export default _default
@@ -1,4 +0,0 @@
1
- /*! Copyright 2025 Adobe
2
- All Rights Reserved. */
3
- import{S as u,S as g}from"../chunks/ShippingOrderSummaryLine.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"../chunks/OrderSummaryLine.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";import"../chunks/state.js";import"../chunks/persisted-data.js";import"@dropins/tools/event-bus.js";export{u as ShippingOrderSummaryLine,g as default};
4
- //# sourceMappingURL=ShippingOrderSummaryLine.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShippingOrderSummaryLine.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}