@payloadcms/plugin-ecommerce 4.0.0-internal.688c4d0 → 4.0.0-internal.77191e5

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 (114) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +6 -0
  3. package/dist/collections/addresses/hooks/beforeChange.d.ts.map +1 -1
  4. package/dist/collections/addresses/hooks/beforeChange.js +3 -2
  5. package/dist/collections/addresses/hooks/beforeChange.js.map +1 -1
  6. package/dist/collections/carts/endpoints/addItem.d.ts.map +1 -1
  7. package/dist/collections/carts/endpoints/clearCart.d.ts.map +1 -1
  8. package/dist/collections/carts/endpoints/mergeCart.d.ts.map +1 -1
  9. package/dist/collections/carts/endpoints/removeItem.d.ts.map +1 -1
  10. package/dist/collections/carts/endpoints/updateItem.d.ts.map +1 -1
  11. package/dist/collections/carts/hasCartSecretAccess.d.ts.map +1 -1
  12. package/dist/collections/carts/operations/addItem.d.ts.map +1 -1
  13. package/dist/collections/carts/operations/clearCart.d.ts.map +1 -1
  14. package/dist/collections/carts/operations/createRequestWithSecret.d.ts.map +1 -1
  15. package/dist/collections/carts/operations/mergeCart.d.ts.map +1 -1
  16. package/dist/collections/carts/operations/removeItem.d.ts.map +1 -1
  17. package/dist/collections/carts/operations/updateItem.d.ts.map +1 -1
  18. package/dist/endpoints/confirmOrder.d.ts.map +1 -1
  19. package/dist/endpoints/confirmOrder.js +299 -44
  20. package/dist/endpoints/confirmOrder.js.map +1 -1
  21. package/dist/endpoints/initiatePayment.d.ts.map +1 -1
  22. package/dist/endpoints/initiatePayment.js.map +1 -1
  23. package/dist/exports/types.d.ts +1 -1
  24. package/dist/exports/types.d.ts.map +1 -1
  25. package/dist/exports/types.js.map +1 -1
  26. package/dist/fields/pricesField.d.ts.map +1 -1
  27. package/dist/fields/pricesField.js +39 -39
  28. package/dist/fields/pricesField.js.map +1 -1
  29. package/dist/fields/statusField.d.ts.map +1 -1
  30. package/dist/fields/statusField.js +5 -0
  31. package/dist/fields/statusField.js.map +1 -1
  32. package/dist/index.d.ts +1 -2
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +7 -2
  35. package/dist/index.js.map +1 -1
  36. package/dist/payments/adapters/stripe/confirmOrder.d.ts.map +1 -1
  37. package/dist/payments/adapters/stripe/confirmOrder.js +107 -75
  38. package/dist/payments/adapters/stripe/confirmOrder.js.map +1 -1
  39. package/dist/payments/adapters/stripe/validateSettlement.d.ts +37 -0
  40. package/dist/payments/adapters/stripe/validateSettlement.d.ts.map +1 -0
  41. package/dist/payments/adapters/stripe/validateSettlement.js +157 -0
  42. package/dist/payments/adapters/stripe/validateSettlement.js.map +1 -0
  43. package/dist/react/provider/index.d.ts.map +1 -1
  44. package/dist/react/provider/index.js +75 -34
  45. package/dist/react/provider/index.js.map +1 -1
  46. package/dist/react/provider/utilities.d.ts.map +1 -1
  47. package/dist/translations/languages/ar.d.ts.map +1 -1
  48. package/dist/translations/languages/az.d.ts.map +1 -1
  49. package/dist/translations/languages/bg.d.ts.map +1 -1
  50. package/dist/translations/languages/ca.d.ts.map +1 -1
  51. package/dist/translations/languages/cs.d.ts.map +1 -1
  52. package/dist/translations/languages/da.d.ts.map +1 -1
  53. package/dist/translations/languages/de.d.ts.map +1 -1
  54. package/dist/translations/languages/en.d.ts.map +1 -1
  55. package/dist/translations/languages/es.d.ts.map +1 -1
  56. package/dist/translations/languages/et.d.ts.map +1 -1
  57. package/dist/translations/languages/fa.d.ts.map +1 -1
  58. package/dist/translations/languages/fr.d.ts.map +1 -1
  59. package/dist/translations/languages/he.d.ts.map +1 -1
  60. package/dist/translations/languages/hr.d.ts.map +1 -1
  61. package/dist/translations/languages/hu.d.ts.map +1 -1
  62. package/dist/translations/languages/hy.d.ts.map +1 -1
  63. package/dist/translations/languages/is.d.ts.map +1 -1
  64. package/dist/translations/languages/it.d.ts.map +1 -1
  65. package/dist/translations/languages/ja.d.ts.map +1 -1
  66. package/dist/translations/languages/ko.d.ts.map +1 -1
  67. package/dist/translations/languages/lt.d.ts.map +1 -1
  68. package/dist/translations/languages/my.d.ts.map +1 -1
  69. package/dist/translations/languages/nb.d.ts.map +1 -1
  70. package/dist/translations/languages/nl.d.ts.map +1 -1
  71. package/dist/translations/languages/pl.d.ts.map +1 -1
  72. package/dist/translations/languages/pt.d.ts.map +1 -1
  73. package/dist/translations/languages/ro.d.ts.map +1 -1
  74. package/dist/translations/languages/rs.d.ts.map +1 -1
  75. package/dist/translations/languages/rsLatin.d.ts.map +1 -1
  76. package/dist/translations/languages/ru.d.ts.map +1 -1
  77. package/dist/translations/languages/sk.d.ts.map +1 -1
  78. package/dist/translations/languages/sl.d.ts.map +1 -1
  79. package/dist/translations/languages/sv.d.ts.map +1 -1
  80. package/dist/translations/languages/ta.d.ts.map +1 -1
  81. package/dist/translations/languages/th.d.ts.map +1 -1
  82. package/dist/translations/languages/tr.d.ts.map +1 -1
  83. package/dist/translations/languages/uk.d.ts.map +1 -1
  84. package/dist/translations/languages/vi.d.ts.map +1 -1
  85. package/dist/translations/languages/zh.d.ts.map +1 -1
  86. package/dist/translations/languages/zhTw.d.ts.map +1 -1
  87. package/dist/types/index.d.ts +33 -7
  88. package/dist/types/index.d.ts.map +1 -1
  89. package/dist/types/index.js.map +1 -1
  90. package/dist/ui/PriceInput/FormattedInput.js +2 -2
  91. package/dist/ui/PriceInput/FormattedInput.js.map +1 -1
  92. package/dist/ui/PriceInput/index.css +19 -31
  93. package/dist/ui/PriceRowLabel/index.css +2 -2
  94. package/dist/ui/VariantOptionsSelector/index.css +8 -10
  95. package/dist/ui/utilities.d.ts.map +1 -1
  96. package/dist/utilities/accessComposition.d.ts.map +1 -1
  97. package/dist/utilities/getCollectionSlugMap.d.ts.map +1 -1
  98. package/dist/utilities/pushTypeScriptProperties.d.ts.map +1 -1
  99. package/dist/utilities/sanitizePluginConfig.d.ts.map +1 -1
  100. package/package.json +8 -8
  101. package/dist/@types/assets.d.js +0 -2
  102. package/dist/@types/assets.d.js.map +0 -1
  103. package/dist/collections/carts/operations/defaultCartItemMatcher.spec.js +0 -358
  104. package/dist/collections/carts/operations/defaultCartItemMatcher.spec.js.map +0 -1
  105. package/dist/payments/adapters/stripe/confirmOrder.spec.js +0 -166
  106. package/dist/payments/adapters/stripe/confirmOrder.spec.js.map +0 -1
  107. package/dist/utilities/accessComposition.spec.js +0 -765
  108. package/dist/utilities/accessComposition.spec.js.map +0 -1
  109. package/dist/utilities/defaultProductsValidation.spec.js +0 -384
  110. package/dist/utilities/defaultProductsValidation.spec.js.map +0 -1
  111. package/dist/utilities/getCollectionSlugMap.spec.js +0 -254
  112. package/dist/utilities/getCollectionSlugMap.spec.js.map +0 -1
  113. package/dist/utilities/sanitizePluginConfig.spec.js +0 -516
  114. package/dist/utilities/sanitizePluginConfig.spec.js.map +0 -1
@@ -114,7 +114,7 @@ export const FormattedInput = ({ id: idFromProps, currency: currencyFromProps, d
114
114
  required: required
115
115
  }),
116
116
  /*#__PURE__*/ _jsxs("div", {
117
- className: `${baseClass}Container`,
117
+ className: `${baseClass}Container form-input-group`,
118
118
  children: [
119
119
  /*#__PURE__*/ _jsx("div", {
120
120
  className: `${baseClass}CurrencySymbol`,
@@ -123,7 +123,7 @@ export const FormattedInput = ({ id: idFromProps, currency: currencyFromProps, d
123
123
  })
124
124
  }),
125
125
  /*#__PURE__*/ _jsx("input", {
126
- className: `${baseClass}Input`,
126
+ className: `${baseClass}Input form-input`,
127
127
  disabled: disabled || readOnly,
128
128
  id: id,
129
129
  onBlur: handleInputBlur,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/ui/PriceInput/FormattedInput.tsx"],"sourcesContent":["'use client'\n\nimport type { StaticDescription, StaticLabel } from 'payload'\n\nimport { FieldDescription, FieldLabel, useField, useFormFields } from '@payloadcms/ui'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { Currency } from '../../types/index.js'\n\nimport { USD } from '../../currencies/index.js'\nimport { convertFromBaseValue, convertToBaseValue } from '../utilities.js'\n\ninterface Props {\n currency?: Currency\n description?: StaticDescription\n disabled?: boolean\n error?: string\n id?: string\n label?: StaticLabel\n path: string\n placeholder?: string\n readOnly?: boolean\n required?: boolean\n supportedCurrencies: Currency[]\n}\n\nconst baseClass = 'formattedPrice'\n\nexport const FormattedInput: React.FC<Props> = ({\n id: idFromProps,\n currency: currencyFromProps,\n description,\n disabled = false,\n label,\n path,\n placeholder = '0.00',\n readOnly,\n required,\n supportedCurrencies,\n}) => {\n const { setValue, value } = useField<number>({ path })\n const [displayValue, setDisplayValue] = useState<string>('')\n\n const inputRef = useRef<HTMLInputElement>(null)\n const isFirstRender = useRef(true)\n const debounceTimer = useRef<NodeJS.Timeout | null>(null)\n\n const parentPath = path.split('.').slice(0, -1).join('.')\n const currencyPath = parentPath ? `${parentPath}.currency` : 'currency'\n\n const currencyFromSelectField = useFormFields(([fields, _]) => fields[currencyPath])\n\n const currencyCode = currencyFromProps?.code ?? (currencyFromSelectField?.value as string)\n const id = idFromProps || path\n\n const currency = useMemo<Currency>(() => {\n if (currencyCode && supportedCurrencies) {\n const foundCurrency = supportedCurrencies.find(\n (supportedCurrency) => supportedCurrency.code === currencyCode,\n )\n\n return foundCurrency ?? supportedCurrencies[0] ?? USD\n }\n\n return supportedCurrencies[0] ?? USD\n }, [currencyCode, supportedCurrencies])\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n\n if (value === undefined || value === null) {\n setDisplayValue('')\n } else {\n setDisplayValue(convertFromBaseValue({ baseValue: value, currency }))\n }\n }\n }, [currency, value, currencyFromProps])\n\n const updateValue = useCallback(\n (inputValue: string) => {\n if (inputValue === '') {\n setValue(null)\n\n return\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue: inputValue })\n\n setValue(baseValue)\n },\n [currency, setValue],\n )\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value\n\n if (!/^\\d*(?:\\.\\d*)?$/.test(inputValue) && inputValue !== '') {\n return\n }\n\n setDisplayValue(inputValue)\n\n // Clear any existing timer\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n }\n\n // Only update the base value after a delay to avoid formatting while typing\n debounceTimer.current = setTimeout(() => {\n updateValue(inputValue)\n }, 500)\n },\n [updateValue, setDisplayValue],\n )\n\n const handleInputBlur = useCallback(() => {\n if (displayValue === '') {\n return\n }\n\n // Clear any pending debounce\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n debounceTimer.current = null\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue })\n const formattedValue = convertFromBaseValue({ baseValue, currency })\n\n if (value != baseValue) {\n setValue(baseValue)\n }\n\n setDisplayValue(formattedValue)\n }, [currency, displayValue, setValue, value])\n\n return (\n <div className={`field-type number ${baseClass}`}>\n {label && <FieldLabel as=\"label\" htmlFor={id} label={label} required={required} />}\n\n <div className={`${baseClass}Container`}>\n <div className={`${baseClass}CurrencySymbol`}>\n <span>{currency.symbol}</span>\n </div>\n\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n className={`${baseClass}Input`}\n disabled={disabled || readOnly}\n id={id}\n onBlur={handleInputBlur}\n onChange={handleInputChange}\n placeholder={placeholder}\n ref={inputRef}\n type=\"text\"\n value={displayValue}\n />\n </div>\n <FieldDescription\n className={`${baseClass}Description`}\n description={description}\n path={path}\n />\n </div>\n )\n}\n"],"names":["FieldDescription","FieldLabel","useField","useFormFields","useCallback","useEffect","useMemo","useRef","useState","USD","convertFromBaseValue","convertToBaseValue","baseClass","FormattedInput","id","idFromProps","currency","currencyFromProps","description","disabled","label","path","placeholder","readOnly","required","supportedCurrencies","setValue","value","displayValue","setDisplayValue","inputRef","isFirstRender","debounceTimer","parentPath","split","slice","join","currencyPath","currencyFromSelectField","fields","_","currencyCode","code","foundCurrency","find","supportedCurrency","current","undefined","baseValue","updateValue","inputValue","handleInputChange","e","target","test","clearTimeout","setTimeout","handleInputBlur","formattedValue","div","className","as","htmlFor","span","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BtB,SAASsB;QACX;QAEAnB,gBAAgB6B;IAClB,GAAG;QAAC1C;QAAUY;QAAcF;QAAUC;KAAM;IAE5C,qBACE,MAACgC;QAAIC,WAAW,CAAC,kBAAkB,EAAEhD,WAAW;;YAC7CQ,uBAAS,KAACnB;gBAAW4D,IAAG;gBAAQC,SAAShD;gBAAIM,OAAOA;gBAAOI,UAAUA;;0BAEtE,MAACmC;gBAAIC,WAAW,GAAGhD,UAAU,SAAS,CAAC;;kCACrC,KAAC+C;wBAAIC,WAAW,GAAGhD,UAAU,cAAc,CAAC;kCAC1C,cAAA,KAACmD;sCAAM/C,SAASgD,MAAM;;;kCAIxB,KAACC;wBACCL,WAAW,GAAGhD,UAAU,KAAK,CAAC;wBAC9BO,UAAUA,YAAYI;wBACtBT,IAAIA;wBACJoD,QAAQT;wBACRU,UAAUhB;wBACV7B,aAAaA;wBACb8C,KAAKtC;wBACLuC,MAAK;wBACL1C,OAAOC;;;;0BAGX,KAAC5B;gBACC4D,WAAW,GAAGhD,UAAU,WAAW,CAAC;gBACpCM,aAAaA;gBACbG,MAAMA;;;;AAId,EAAC"}
1
+ {"version":3,"sources":["../../../src/ui/PriceInput/FormattedInput.tsx"],"sourcesContent":["'use client'\n\nimport type { StaticDescription, StaticLabel } from 'payload'\n\nimport { FieldDescription, FieldLabel, useField, useFormFields } from '@payloadcms/ui'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\n\nimport type { Currency } from '../../types/index.js'\n\nimport { USD } from '../../currencies/index.js'\nimport { convertFromBaseValue, convertToBaseValue } from '../utilities.js'\n\ninterface Props {\n currency?: Currency\n description?: StaticDescription\n disabled?: boolean\n error?: string\n id?: string\n label?: StaticLabel\n path: string\n placeholder?: string\n readOnly?: boolean\n required?: boolean\n supportedCurrencies: Currency[]\n}\n\nconst baseClass = 'formattedPrice'\n\nexport const FormattedInput: React.FC<Props> = ({\n id: idFromProps,\n currency: currencyFromProps,\n description,\n disabled = false,\n label,\n path,\n placeholder = '0.00',\n readOnly,\n required,\n supportedCurrencies,\n}) => {\n const { setValue, value } = useField<number>({ path })\n const [displayValue, setDisplayValue] = useState<string>('')\n\n const inputRef = useRef<HTMLInputElement>(null)\n const isFirstRender = useRef(true)\n const debounceTimer = useRef<NodeJS.Timeout | null>(null)\n\n const parentPath = path.split('.').slice(0, -1).join('.')\n const currencyPath = parentPath ? `${parentPath}.currency` : 'currency'\n\n const currencyFromSelectField = useFormFields(([fields, _]) => fields[currencyPath])\n\n const currencyCode = currencyFromProps?.code ?? (currencyFromSelectField?.value as string)\n const id = idFromProps || path\n\n const currency = useMemo<Currency>(() => {\n if (currencyCode && supportedCurrencies) {\n const foundCurrency = supportedCurrencies.find(\n (supportedCurrency) => supportedCurrency.code === currencyCode,\n )\n\n return foundCurrency ?? supportedCurrencies[0] ?? USD\n }\n\n return supportedCurrencies[0] ?? USD\n }, [currencyCode, supportedCurrencies])\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false\n\n if (value === undefined || value === null) {\n setDisplayValue('')\n } else {\n setDisplayValue(convertFromBaseValue({ baseValue: value, currency }))\n }\n }\n }, [currency, value, currencyFromProps])\n\n const updateValue = useCallback(\n (inputValue: string) => {\n if (inputValue === '') {\n setValue(null)\n\n return\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue: inputValue })\n\n setValue(baseValue)\n },\n [currency, setValue],\n )\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value\n\n if (!/^\\d*(?:\\.\\d*)?$/.test(inputValue) && inputValue !== '') {\n return\n }\n\n setDisplayValue(inputValue)\n\n // Clear any existing timer\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n }\n\n // Only update the base value after a delay to avoid formatting while typing\n debounceTimer.current = setTimeout(() => {\n updateValue(inputValue)\n }, 500)\n },\n [updateValue, setDisplayValue],\n )\n\n const handleInputBlur = useCallback(() => {\n if (displayValue === '') {\n return\n }\n\n // Clear any pending debounce\n if (debounceTimer.current) {\n clearTimeout(debounceTimer.current)\n debounceTimer.current = null\n }\n\n const baseValue = convertToBaseValue({ currency, displayValue })\n const formattedValue = convertFromBaseValue({ baseValue, currency })\n\n if (value != baseValue) {\n setValue(baseValue)\n }\n\n setDisplayValue(formattedValue)\n }, [currency, displayValue, setValue, value])\n\n return (\n <div className={`field-type number ${baseClass}`}>\n {label && <FieldLabel as=\"label\" htmlFor={id} label={label} required={required} />}\n\n <div className={`${baseClass}Container form-input-group`}>\n <div className={`${baseClass}CurrencySymbol`}>\n <span>{currency.symbol}</span>\n </div>\n\n {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}\n <input\n className={`${baseClass}Input form-input`}\n disabled={disabled || readOnly}\n id={id}\n onBlur={handleInputBlur}\n onChange={handleInputChange}\n placeholder={placeholder}\n ref={inputRef}\n type=\"text\"\n value={displayValue}\n />\n </div>\n <FieldDescription\n className={`${baseClass}Description`}\n description={description}\n path={path}\n />\n </div>\n )\n}\n"],"names":["FieldDescription","FieldLabel","useField","useFormFields","useCallback","useEffect","useMemo","useRef","useState","USD","convertFromBaseValue","convertToBaseValue","baseClass","FormattedInput","id","idFromProps","currency","currencyFromProps","description","disabled","label","path","placeholder","readOnly","required","supportedCurrencies","setValue","value","displayValue","setDisplayValue","inputRef","isFirstRender","debounceTimer","parentPath","split","slice","join","currencyPath","currencyFromSelectField","fields","_","currencyCode","code","foundCurrency","find","supportedCurrency","current","undefined","baseValue","updateValue","inputValue","handleInputChange","e","target","test","clearTimeout","setTimeout","handleInputBlur","formattedValue","div","className","as","htmlFor","span","symbol","input","onBlur","onChange","ref","type"],"mappings":"AAAA;;AAIA,SAASA,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,iBAAgB;AACtF,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAIzE,SAASC,GAAG,QAAQ,4BAA2B;AAC/C,SAASC,oBAAoB,EA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AAW,GAAGhD,UAAU,0BAA0B,CAAC;;kCACtD,KAAC+C;wBAAIC,WAAW,GAAGhD,UAAU,cAAc,CAAC;kCAC1C,cAAA,KAACmD;sCAAM/C,SAASgD,MAAM;;;kCAIxB,KAACC;wBACCL,WAAW,GAAGhD,UAAU,gBAAgB,CAAC;wBACzCO,UAAUA,YAAYI;wBACtBT,IAAIA;wBACJoD,QAAQT;wBACRU,UAAUhB;wBACV7B,aAAaA;wBACb8C,KAAKtC;wBACLuC,MAAK;wBACL1C,OAAOC;;;;0BAGX,KAAC5B;gBACC4D,WAAW,GAAGhD,UAAU,WAAW,CAAC;gBACpCM,aAAaA;gBACbG,MAAMA;;;;AAId,EAAC"}
@@ -1,35 +1,23 @@
1
- .formattedPrice {
2
- .formattedPriceLabel {
3
- display: block;
4
- margin-bottom: 0.5rem;
5
- font-size: 0.875rem;
6
- font-weight: 500;
7
- color: #333;
8
- }
9
-
10
- .formattedPriceContainer {
11
- display: flex;
12
- position: relative;
13
- }
1
+ @layer payload-default {
2
+ .formattedPrice {
3
+ .formattedPriceCurrencySymbol {
4
+ position: absolute;
5
+ inset-inline-start: var(--field-padding-inline);
6
+ top: 50%;
7
+ transform: translateY(-50%);
8
+ color: var(--color-text-secondary);
9
+ user-select: none;
10
+ pointer-events: none;
11
+ z-index: 1;
12
+ }
14
13
 
15
- .formattedPriceCurrencySymbol {
16
- position: absolute;
17
- left: 10px;
18
- top: 50%;
19
- transform: translateY(calc(-50%));
20
- color: var(--theme-elevation-500);
21
- user-select: none;
22
- pointer-events: none;
23
- }
24
-
25
- .formattedPriceInput {
26
- padding: 0.5rem 0.5rem 0.5rem 1.75rem;
27
- min-width: 2rem;
28
- width: fit-content;
29
- max-width: 10rem;
30
- }
14
+ .formattedPriceInput {
15
+ /* Reserve space for the absolutely-positioned currency symbol prefix */
16
+ padding-inline-start: var(--spacer-4);
17
+ }
31
18
 
32
- .formattedPriceDescription {
33
- max-width: 46rem;
19
+ .formattedPriceDescription {
20
+ max-width: 75ch;
21
+ }
34
22
  }
35
23
  }
@@ -2,12 +2,12 @@
2
2
  .priceRowLabel {
3
3
  display: flex;
4
4
  align-items: center;
5
- gap: calc(var(--base) * 1);
5
+ gap: var(--spacer-3);
6
6
  }
7
7
 
8
8
  .priceValue {
9
9
  display: flex;
10
10
  align-items: center;
11
- gap: calc(var(--base) * 0.25);
11
+ gap: var(--spacer-1);
12
12
  }
13
13
  }
@@ -1,26 +1,24 @@
1
1
  @layer payload-default {
2
2
  .variantOptionsSelector {
3
- margin-top: calc(var(--spacing-field) * 2);
4
- margin-bottom: calc(var(--spacing-field) * 2);
3
+ margin-block: var(--spacer-2);
5
4
  }
6
5
 
7
6
  .variantOptionsSelectorHeading {
8
- font-size: calc(var(--base) * 1);
9
- font-weight: 500;
7
+ font-size: var(--text-body-large-font-size);
10
8
  color: var(--color-text);
11
- margin-bottom: calc(var(--base) * 0.5);
9
+ margin-block-end: var(--spacer-2);
12
10
  }
13
11
 
14
12
  .variantOptionsSelectorItem {
15
13
  display: flex;
16
14
  flex-direction: column;
17
- gap: 0;
15
+ gap: var(--spacer-2);
18
16
  }
19
17
 
20
18
  .variantOptionsSelectorList {
21
19
  display: flex;
22
20
  flex-direction: column;
23
- gap: calc(var(--base) * 0.75);
21
+ gap: var(--spacer-3);
24
22
  }
25
23
 
26
24
  .variantOptionsSelectorError {
@@ -29,9 +27,9 @@
29
27
 
30
28
  .variantOptionsSelectorErrorWrapper {
31
29
  &.showError {
32
- border-radius: 2px;
33
- outline: 1px solid var(--theme-error-400);
34
- outline-offset: 2px;
30
+ border-radius: var(--radius-small);
31
+ outline: var(--stroke-width-small) solid var(--field-color-border-error);
32
+ outline-offset: var(--stroke-width-medium);
35
33
  }
36
34
  }
37
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/ui/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,6BAGhC;IACD,QAAQ,EAAE,QAAQ,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;CACrB,KAAG,MAaH,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,0BAGlC;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;CACnB,KAAG,MAUH,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,kCAIzB;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,KAAG,MAQH,CAAA"}
1
+ {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/ui/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,kBAAkB,gCAG5B;IACD,QAAQ,EAAE,QAAQ,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;CACrB,KAAG,MAaH,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,6BAG9B;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;CACnB,KAAG,MAUH,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,qCAIrB;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,QAAQ,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,KAAG,MAQH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"accessComposition.d.ts","sourceRoot":"","sources":["../../src/utilities/accessComposition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,SAAS,CAAA;AAI5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,iBAAiB,MAAM,EAAE,KAAG,MA0BvD,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,iBAAiB,MAAM,EAAE,KAAG,MA0BxD,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GACtB,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,OAAO,EAC7C,gBAAgB,MAAM,EACtB,WAAU,MAAoB,KAC7B,MAQF,CAAA"}
1
+ {"version":3,"file":"accessComposition.d.ts","sourceRoot":"","sources":["../../src/utilities/accessComposition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,SAAS,CAAA;AAI5C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,uBAAwB,MAAM,EAAE,KAAG,MA0BvD,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,uBAAwB,MAAM,EAAE,KAAG,MA0BxD,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,cACX,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,OAAO,kBAC7B,MAAM,aACZ,MAAM,KACf,MAQF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getCollectionSlugMap.d.ts","sourceRoot":"","sources":["../../src/utilities/getCollectionSlugMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAE1F,KAAK,KAAK,GAAG;IACX,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qBAAqB,EAAE,8BAA8B,CAAA;CACtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,4CAGlC,KAAK,KAAG,iBAiCV,CAAA"}
1
+ {"version":3,"file":"getCollectionSlugMap.d.ts","sourceRoot":"","sources":["../../src/utilities/getCollectionSlugMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAE1F,KAAK,KAAK,GAAG;IACX,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,qBAAqB,EAAE,8BAA8B,CAAA;CACtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,+CAG9B,KAAK,KAAG,iBAiCV,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pushTypeScriptProperties.d.ts","sourceRoot":"","sources":["../../src/utilities/pushTypeScriptProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAE1F,eAAO,MAAM,wBAAwB,GAAI,oCAGtC;IACD,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,EAAE,WAAW,CAAA;IACvB,qBAAqB,EAAE,8BAA8B,CAAA;CACtD,KAAG,WAoCH,CAAA"}
1
+ {"version":3,"file":"pushTypeScriptProperties.d.ts","sourceRoot":"","sources":["../../src/utilities/pushTypeScriptProperties.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAE1F,eAAO,MAAM,wBAAwB,uCAGlC;IACD,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,EAAE,WAAW,CAAA;IACvB,qBAAqB,EAAE,8BAA8B,CAAA;CACtD,KAAG,WAoCH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitizePluginConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePluginConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAK9F,KAAK,KAAK,GAAG;IACX,YAAY,EAAE,qBAAqB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,kBAAkB,KAAK,KAAG,8BA6F9D,CAAA"}
1
+ {"version":3,"file":"sanitizePluginConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePluginConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA;AAK9F,KAAK,KAAK,GAAG;IACX,YAAY,EAAE,qBAAqB,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,oBAAoB,qBAAsB,KAAK,KAAG,8BA6F9D,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-ecommerce",
3
- "version": "4.0.0-internal.688c4d0",
3
+ "version": "4.0.0-internal.77191e5",
4
4
  "description": "Ecommerce plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -74,8 +74,8 @@
74
74
  ],
75
75
  "dependencies": {
76
76
  "qs-esm": "8.0.1",
77
- "@payloadcms/translations": "4.0.0-internal.688c4d0",
78
- "@payloadcms/ui": "4.0.0-internal.688c4d0"
77
+ "@payloadcms/translations": "4.0.0-internal.77191e5",
78
+ "@payloadcms/ui": "4.0.0-internal.77191e5"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@types/json-schema": "7.0.15",
@@ -83,14 +83,14 @@
83
83
  "@types/react-dom": "19.2.3",
84
84
  "stripe": "18.3.0",
85
85
  "@payloadcms/eslint-config": "3.28.0",
86
- "@payloadcms/next": "4.0.0-internal.688c4d0",
87
- "@payloadcms/translations": "4.0.0-internal.688c4d0",
88
- "payload": "4.0.0-internal.688c4d0"
86
+ "@payloadcms/next": "4.0.0-internal.77191e5",
87
+ "@payloadcms/translations": "4.0.0-internal.77191e5",
88
+ "payload": "4.0.0-internal.77191e5"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
92
92
  "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
93
- "payload": "4.0.0-internal.688c4d0"
93
+ "payload": "4.0.0-internal.77191e5"
94
94
  },
95
95
  "publishConfig": {
96
96
  "registry": "https://registry.npmjs.org/"
@@ -102,7 +102,7 @@
102
102
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
103
103
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
104
104
  "clean": "rimraf -g {dist,*.tsbuildinfo}",
105
- "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
105
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
106
106
  "lint": "eslint .",
107
107
  "lint:fix": "eslint . --fix"
108
108
  }
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=assets.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/@types/assets.d.ts"],"names":[],"mappings":""}
@@ -1,358 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { defaultCartItemMatcher } from './defaultCartItemMatcher.js';
3
- describe('defaultCartItemMatcher', ()=>{
4
- describe('product matching', ()=>{
5
- it('should match when product IDs are equal (both strings)', ()=>{
6
- const existingItem = {
7
- id: 'item-1',
8
- product: 'product-123',
9
- quantity: 1
10
- };
11
- const newItem = {
12
- product: 'product-123'
13
- };
14
- expect(defaultCartItemMatcher({
15
- existingItem,
16
- newItem
17
- })).toBe(true);
18
- });
19
- it('should not match when product IDs are different', ()=>{
20
- const existingItem = {
21
- id: 'item-1',
22
- product: 'product-123',
23
- quantity: 1
24
- };
25
- const newItem = {
26
- product: 'product-456'
27
- };
28
- expect(defaultCartItemMatcher({
29
- existingItem,
30
- newItem
31
- })).toBe(false);
32
- });
33
- it('should match when existing product is populated object', ()=>{
34
- const existingItem = {
35
- id: 'item-1',
36
- product: {
37
- id: 'product-123',
38
- name: 'Test Product'
39
- },
40
- quantity: 1
41
- };
42
- const newItem = {
43
- product: 'product-123'
44
- };
45
- expect(defaultCartItemMatcher({
46
- existingItem,
47
- newItem
48
- })).toBe(true);
49
- });
50
- it('should not match when product IDs differ (existing is object)', ()=>{
51
- const existingItem = {
52
- id: 'item-1',
53
- product: {
54
- id: 'product-123',
55
- name: 'Test Product'
56
- },
57
- quantity: 1
58
- };
59
- const newItem = {
60
- product: 'product-456'
61
- };
62
- expect(defaultCartItemMatcher({
63
- existingItem,
64
- newItem
65
- })).toBe(false);
66
- });
67
- });
68
- describe('variant matching', ()=>{
69
- it('should match when both have same variant ID', ()=>{
70
- const existingItem = {
71
- id: 'item-1',
72
- product: 'product-123',
73
- variant: 'variant-abc',
74
- quantity: 1
75
- };
76
- const newItem = {
77
- product: 'product-123',
78
- variant: 'variant-abc'
79
- };
80
- expect(defaultCartItemMatcher({
81
- existingItem,
82
- newItem
83
- })).toBe(true);
84
- });
85
- it('should not match when variants are different', ()=>{
86
- const existingItem = {
87
- id: 'item-1',
88
- product: 'product-123',
89
- variant: 'variant-abc',
90
- quantity: 1
91
- };
92
- const newItem = {
93
- product: 'product-123',
94
- variant: 'variant-xyz'
95
- };
96
- expect(defaultCartItemMatcher({
97
- existingItem,
98
- newItem
99
- })).toBe(false);
100
- });
101
- it('should match when both have no variant', ()=>{
102
- const existingItem = {
103
- id: 'item-1',
104
- product: 'product-123',
105
- quantity: 1
106
- };
107
- const newItem = {
108
- product: 'product-123'
109
- };
110
- expect(defaultCartItemMatcher({
111
- existingItem,
112
- newItem
113
- })).toBe(true);
114
- });
115
- it('should not match when existing has variant but new does not', ()=>{
116
- const existingItem = {
117
- id: 'item-1',
118
- product: 'product-123',
119
- variant: 'variant-abc',
120
- quantity: 1
121
- };
122
- const newItem = {
123
- product: 'product-123'
124
- };
125
- expect(defaultCartItemMatcher({
126
- existingItem,
127
- newItem
128
- })).toBe(false);
129
- });
130
- it('should not match when new has variant but existing does not', ()=>{
131
- const existingItem = {
132
- id: 'item-1',
133
- product: 'product-123',
134
- quantity: 1
135
- };
136
- const newItem = {
137
- product: 'product-123',
138
- variant: 'variant-abc'
139
- };
140
- expect(defaultCartItemMatcher({
141
- existingItem,
142
- newItem
143
- })).toBe(false);
144
- });
145
- it('should match when existing variant is populated object', ()=>{
146
- const existingItem = {
147
- id: 'item-1',
148
- product: 'product-123',
149
- variant: {
150
- id: 'variant-abc',
151
- name: 'Large'
152
- },
153
- quantity: 1
154
- };
155
- const newItem = {
156
- product: 'product-123',
157
- variant: 'variant-abc'
158
- };
159
- expect(defaultCartItemMatcher({
160
- existingItem,
161
- newItem
162
- })).toBe(true);
163
- });
164
- it('should not match when variant IDs differ (existing is object)', ()=>{
165
- const existingItem = {
166
- id: 'item-1',
167
- product: 'product-123',
168
- variant: {
169
- id: 'variant-abc',
170
- name: 'Large'
171
- },
172
- quantity: 1
173
- };
174
- const newItem = {
175
- product: 'product-123',
176
- variant: 'variant-xyz'
177
- };
178
- expect(defaultCartItemMatcher({
179
- existingItem,
180
- newItem
181
- })).toBe(false);
182
- });
183
- });
184
- describe('combined product and variant matching', ()=>{
185
- it('should match when both product and variant match', ()=>{
186
- const existingItem = {
187
- id: 'item-1',
188
- product: 'product-123',
189
- variant: 'variant-abc',
190
- quantity: 1
191
- };
192
- const newItem = {
193
- product: 'product-123',
194
- variant: 'variant-abc'
195
- };
196
- expect(defaultCartItemMatcher({
197
- existingItem,
198
- newItem
199
- })).toBe(true);
200
- });
201
- it('should not match when product matches but variant does not', ()=>{
202
- const existingItem = {
203
- id: 'item-1',
204
- product: 'product-123',
205
- variant: 'variant-abc',
206
- quantity: 1
207
- };
208
- const newItem = {
209
- product: 'product-123',
210
- variant: 'variant-xyz'
211
- };
212
- expect(defaultCartItemMatcher({
213
- existingItem,
214
- newItem
215
- })).toBe(false);
216
- });
217
- it('should not match when variant matches but product does not', ()=>{
218
- const existingItem = {
219
- id: 'item-1',
220
- product: 'product-123',
221
- variant: 'variant-abc',
222
- quantity: 1
223
- };
224
- const newItem = {
225
- product: 'product-456',
226
- variant: 'variant-abc'
227
- };
228
- expect(defaultCartItemMatcher({
229
- existingItem,
230
- newItem
231
- })).toBe(false);
232
- });
233
- it('should not match when neither product nor variant match', ()=>{
234
- const existingItem = {
235
- id: 'item-1',
236
- product: 'product-123',
237
- variant: 'variant-abc',
238
- quantity: 1
239
- };
240
- const newItem = {
241
- product: 'product-456',
242
- variant: 'variant-xyz'
243
- };
244
- expect(defaultCartItemMatcher({
245
- existingItem,
246
- newItem
247
- })).toBe(false);
248
- });
249
- });
250
- describe('edge cases', ()=>{
251
- it('should handle undefined variant in existing item', ()=>{
252
- const existingItem = {
253
- id: 'item-1',
254
- product: 'product-123',
255
- variant: undefined,
256
- quantity: 1
257
- };
258
- const newItem = {
259
- product: 'product-123'
260
- };
261
- expect(defaultCartItemMatcher({
262
- existingItem,
263
- newItem
264
- })).toBe(true);
265
- });
266
- it('should handle undefined variant in new item', ()=>{
267
- const existingItem = {
268
- id: 'item-1',
269
- product: 'product-123',
270
- quantity: 1
271
- };
272
- const newItem = {
273
- product: 'product-123',
274
- variant: undefined
275
- };
276
- expect(defaultCartItemMatcher({
277
- existingItem,
278
- newItem
279
- })).toBe(true);
280
- });
281
- it('should handle numeric product IDs', ()=>{
282
- const existingItem = {
283
- id: 'item-1',
284
- product: 123,
285
- quantity: 1
286
- };
287
- const newItem = {
288
- product: 123
289
- };
290
- expect(defaultCartItemMatcher({
291
- existingItem,
292
- newItem
293
- })).toBe(true);
294
- });
295
- it('should handle deeply nested product object', ()=>{
296
- const existingItem = {
297
- id: 'item-1',
298
- product: {
299
- id: 'product-123',
300
- name: 'Product',
301
- category: {
302
- id: 'cat-1',
303
- name: 'Category'
304
- }
305
- },
306
- quantity: 1
307
- };
308
- const newItem = {
309
- product: 'product-123'
310
- };
311
- expect(defaultCartItemMatcher({
312
- existingItem,
313
- newItem
314
- })).toBe(true);
315
- });
316
- it('should handle both product and variant as populated objects', ()=>{
317
- const existingItem = {
318
- id: 'item-1',
319
- product: {
320
- id: 'product-123',
321
- name: 'Product'
322
- },
323
- variant: {
324
- id: 'variant-abc',
325
- name: 'Large'
326
- },
327
- quantity: 1
328
- };
329
- const newItem = {
330
- product: 'product-123',
331
- variant: 'variant-abc'
332
- };
333
- expect(defaultCartItemMatcher({
334
- existingItem,
335
- newItem
336
- })).toBe(true);
337
- });
338
- it('should ignore other item properties', ()=>{
339
- const existingItem = {
340
- id: 'item-1',
341
- product: 'product-123',
342
- quantity: 5,
343
- customProp: 'value-a'
344
- };
345
- const newItem = {
346
- product: 'product-123',
347
- customProp: 'value-b'
348
- };
349
- // Should match because only product/variant are checked
350
- expect(defaultCartItemMatcher({
351
- existingItem,
352
- newItem
353
- })).toBe(true);
354
- });
355
- });
356
- });
357
-
358
- //# sourceMappingURL=defaultCartItemMatcher.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/collections/carts/operations/defaultCartItemMatcher.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport type { CartItemData, NewCartItem } from './types.js'\n\nimport { defaultCartItemMatcher } from './defaultCartItemMatcher.js'\n\ndescribe('defaultCartItemMatcher', () => {\n describe('product matching', () => {\n it('should match when product IDs are equal (both strings)', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when product IDs are different', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-456',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should match when existing product is populated object', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: { id: 'product-123', name: 'Test Product' } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when product IDs differ (existing is object)', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: { id: 'product-123', name: 'Test Product' } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-456',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n })\n\n describe('variant matching', () => {\n it('should match when both have same variant ID', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when variants are different', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-xyz',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should match when both have no variant', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when existing has variant but new does not', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should not match when new has variant but existing does not', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should match when existing variant is populated object', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: { id: 'variant-abc', name: 'Large' } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when variant IDs differ (existing is object)', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: { id: 'variant-abc', name: 'Large' } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-xyz',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n })\n\n describe('combined product and variant matching', () => {\n it('should match when both product and variant match', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should not match when product matches but variant does not', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-xyz',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should not match when variant matches but product does not', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-456',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n\n it('should not match when neither product nor variant match', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: 'variant-abc',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-456',\n variant: 'variant-xyz',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(false)\n })\n })\n\n describe('edge cases', () => {\n it('should handle undefined variant in existing item', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n variant: undefined,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should handle undefined variant in new item', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: undefined,\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should handle numeric product IDs', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 123 as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 123 as any,\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should handle deeply nested product object', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: {\n id: 'product-123',\n name: 'Product',\n category: { id: 'cat-1', name: 'Category' },\n } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should handle both product and variant as populated objects', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: { id: 'product-123', name: 'Product' } as any,\n variant: { id: 'variant-abc', name: 'Large' } as any,\n quantity: 1,\n }\n const newItem: NewCartItem = {\n product: 'product-123',\n variant: 'variant-abc',\n }\n\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n\n it('should ignore other item properties', () => {\n const existingItem: CartItemData = {\n id: 'item-1',\n product: 'product-123',\n quantity: 5,\n customProp: 'value-a',\n } as CartItemData\n const newItem: NewCartItem = {\n product: 'product-123',\n customProp: 'value-b',\n } as NewCartItem\n\n // Should match because only product/variant are checked\n expect(defaultCartItemMatcher({ existingItem, newItem })).toBe(true)\n })\n })\n})\n"],"names":["describe","expect","it","defaultCartItemMatcher","existingItem","id","product","quantity","newItem","toBe","name","variant","undefined","category","customProp"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAI7C,SAASC,sBAAsB,QAAQ,8BAA6B;AAEpEH,SAAS,0BAA0B;IACjCA,SAAS,oBAAoB;QAC3BE,GAAG,0DAA0D;YAC3D,MAAME,eAA6B;gBACjCC,IAAI;gBACJC,SAAS;gBACTC,UAAU;YACZ;YACA,MAAMC,UAAuB;gBAC3BF,SAAS;YACX;YAEAL,OAAOE,uBAAuB;gBAAEC;gBAAcI;YAAQ,IAAIC,IAAI,CAAC;QACjE;QAEAP,GAAG,mDAAmD;YACpD,MAAME,eAA6B;gBACjCC,IAAI;gBACJC,SAAS;gBACTC,UAAU;YACZ;YACA,MAAMC,UAAuB;gBAC3BF,SAAS;YACX;YAEAL,OAAOE,uBAAuB;gBAAEC;gBAAcI;YAAQ,IAAIC,IAAI,CAAC;QACjE;QAEAP,GAAG,0DAA0D;YAC3D,MAAME,eAA6B;gBACjCC,IAAI;gBACJC,SAAS;oBAAED,IAAI;oBAAeK,MAAM;gBAAe;gBACnDH,UAAU;YACZ;YACA,MAAMC,UAAuB;gBAC3BF,SAAS;YACX;YAEAL,OAAOE,uBAAuB;gBAAEC;gBAAcI;YAAQ,IAAIC,IAAI,CAAC;QACjE;QAEAP,GAAG,iEAAiE;YAClE,MAAME,eAA6B;gBACjCC,IAAI;gBACJC,SAAS;oBAAED,IAAI;oBAAeK,MAAM;gBAAe;gBACnDH,UAAU;YACZ;YACA,MAAMC,UAAuB;gBAC3BF,SAAS;YACX;YAEAL,OAAOE,uBAAuB;gBAAEC;gBAAcI;YAAQ,IAAIC,IAAI,CAAC;QACjE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