@doswiftly/storefront-sdk 22.3.0 → 22.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../../src/core/operations/cart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAwbH,eAAO,MAAM,UAAU,QAOrB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,QAehD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,QAO1C,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAO/B,CAAC;AAMH,eAAO,MAAM,WAAW,QAYtB,CAAC;AAEH,eAAO,MAAM,cAAc,QAWzB,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAW5B,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAW5B,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAWrC,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAW3B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAWjC,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAWrC,CAAC;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAWrB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,QAWnC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAY/B,CAAC;AAMH,eAAO,MAAM,yBAAyB,QAWpC,CAAC;AAEH,eAAO,MAAM,wBAAwB,QAWnC,CAAC;AAEH,eAAO,MAAM,2BAA2B,QAWtC,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAWrC,CAAC;AAEH,eAAO,MAAM,oBAAoB,QAW/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAWhC,CAAC;AAEH,eAAO,MAAM,+BAA+B,QAW1C,CAAC;AAEH;;;;;;;;GAQG;A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QAWhC,CAAC;AAEH,eAAO,MAAM,+BAA+B,QAW1C,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,QAWxB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAWzB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,QAWvC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,QAoBtC,CAAC"}
@@ -382,6 +382,16 @@ const PAYMENT_METHOD_FRAGMENT = `
382
382
  instruments {
383
383
  ...PaymentInstrument
384
384
  }
385
+ acknowledgements {
386
+ code
387
+ enforcement
388
+ statement
389
+ documents {
390
+ token
391
+ kind
392
+ url
393
+ }
394
+ }
385
395
  }
386
396
  ${PAYMENT_INSTRUMENT_FRAGMENT}
387
397
  ${IMAGE_THUMBNAIL_FRAGMENT}
@@ -3,12 +3,16 @@
3
3
  * price + strikethrough compare-at). Composes `<Money>` so locale + currency
4
4
  * formatting stays consistent with the rest of the SDK.
5
5
  *
6
+ * Like `<Money>`, `locale` is optional — pass it for deterministic output, or
7
+ * omit it to fall back to the runtime default. It is forwarded to both the
8
+ * current and the compare-at price so they format consistently.
9
+ *
6
10
  * @example
7
11
  * ```tsx
8
- * <PriceDisplay price={9990} currency="PLN" />
12
+ * <PriceDisplay price={9990} currency="PLN" locale="pl-PL" />
9
13
  * // → "99,90 zł"
10
14
  *
11
- * <PriceDisplay price={7990} compareAtPrice={9990} currency="PLN" />
15
+ * <PriceDisplay price={7990} compareAtPrice={9990} currency="PLN" locale="pl-PL" />
12
16
  * // → "79,90 zł <s>99,90 zł</s>"
13
17
  * ```
14
18
  */
@@ -23,6 +27,11 @@ export interface PriceDisplayProps {
23
27
  compareAtPrice?: number;
24
28
  /** ISO 4217 currency code. */
25
29
  currency: string;
30
+ /**
31
+ * BCP 47 locale tag (`'pl-PL'`, `'en-US'`, …) forwarded to both prices. When
32
+ * omitted, the runtime default is used — pass it for deterministic output.
33
+ */
34
+ locale?: string;
26
35
  /** Wrapping element class. */
27
36
  className?: string;
28
37
  /** Class for the *current* price portion. */
@@ -30,5 +39,5 @@ export interface PriceDisplayProps {
30
39
  /** Class for the strikethrough compare-at portion. */
31
40
  compareAtClassName?: string;
32
41
  }
33
- export declare function PriceDisplay({ price, compareAtPrice, currency, className, priceClassName, compareAtClassName, }: PriceDisplayProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function PriceDisplay({ price, compareAtPrice, currency, locale, className, priceClassName, compareAtClassName, }: PriceDisplayProps): import("react/jsx-runtime").JSX.Element;
34
43
  //# sourceMappingURL=PriceDisplay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PriceDisplay.d.ts","sourceRoot":"","sources":["../../../src/react/components/PriceDisplay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,cAAc,EACd,kBAAkB,GACnB,EAAE,iBAAiB,2CAgBnB"}
1
+ {"version":3,"file":"PriceDisplay.d.ts","sourceRoot":"","sources":["../../../src/react/components/PriceDisplay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,cAAc,EACd,QAAQ,EACR,MAAM,EACN,SAAS,EACT,cAAc,EACd,kBAAkB,GACnB,EAAE,iBAAiB,2CAgBnB"}
@@ -3,19 +3,23 @@
3
3
  * price + strikethrough compare-at). Composes `<Money>` so locale + currency
4
4
  * formatting stays consistent with the rest of the SDK.
5
5
  *
6
+ * Like `<Money>`, `locale` is optional — pass it for deterministic output, or
7
+ * omit it to fall back to the runtime default. It is forwarded to both the
8
+ * current and the compare-at price so they format consistently.
9
+ *
6
10
  * @example
7
11
  * ```tsx
8
- * <PriceDisplay price={9990} currency="PLN" />
12
+ * <PriceDisplay price={9990} currency="PLN" locale="pl-PL" />
9
13
  * // → "99,90 zł"
10
14
  *
11
- * <PriceDisplay price={7990} compareAtPrice={9990} currency="PLN" />
15
+ * <PriceDisplay price={7990} compareAtPrice={9990} currency="PLN" locale="pl-PL" />
12
16
  * // → "79,90 zł <s>99,90 zł</s>"
13
17
  * ```
14
18
  */
15
19
  'use client';
16
20
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
21
  import { Money } from './Money';
18
- export function PriceDisplay({ price, compareAtPrice, currency, className, priceClassName, compareAtClassName, }) {
22
+ export function PriceDisplay({ price, compareAtPrice, currency, locale, className, priceClassName, compareAtClassName, }) {
19
23
  const isOnSale = compareAtPrice !== undefined && compareAtPrice > price;
20
- return (_jsxs("span", { className: className, children: [_jsx(Money, { amount: price, currency: currency, className: priceClassName }), isOnSale && (_jsxs(_Fragment, { children: [' ', _jsx("s", { className: compareAtClassName, children: _jsx(Money, { amount: compareAtPrice, currency: currency }) })] }))] }));
24
+ return (_jsxs("span", { className: className, children: [_jsx(Money, { amount: price, currency: currency, locale: locale, className: priceClassName }), isOnSale && (_jsxs(_Fragment, { children: [' ', _jsx("s", { className: compareAtClassName, children: _jsx(Money, { amount: compareAtPrice, currency: currency, locale: locale }) })] }))] }));
21
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-sdk",
3
- "version": "22.3.0",
3
+ "version": "22.4.0",
4
4
  "description": "Storefront runtime SDK for DoSwiftly Commerce — layered transport, middleware pipeline, React providers, Zustand stores, cache strategies. 0 runtime dependencies in core.",
5
5
  "type": "module",
6
6
  "sideEffects": false,