@commercetools-frontend-extensions/change-history 9.3.0 → 9.3.2

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.
@@ -35,6 +35,7 @@ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
35
35
  var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
36
36
  var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
37
37
  var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
38
+ var experimentalComponents = require('@commercetools-frontend/experimental-components');
38
39
  var groupBy = require('lodash/groupBy');
39
40
  require('common-tags/lib/oneLine');
40
41
  var moment = require('moment-timezone');
@@ -134,7 +135,7 @@ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
134
135
  var RadioInput__default = /*#__PURE__*/_interopDefault(RadioInput);
135
136
 
136
137
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
137
- var version = "9.3.0";
138
+ var version = "9.3.2";
138
139
 
139
140
  var fetchFeatureStatusQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchFeatureStatusQuery" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 84, source: { body: "query FetchFeatureStatusQuery {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
140
141
  /**
@@ -1552,8 +1553,8 @@ const AddOrRemoveAssetPresenter = props => {
1552
1553
  };
1553
1554
  AddOrRemoveAssetPresenter.displayName = 'AddOrRemoveAssetPresenter';
1554
1555
 
1555
- function ownKeys$21(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1556
- function _objectSpread$21(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$21(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$21(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1556
+ function ownKeys$20(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1557
+ function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$20(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$20(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1557
1558
  /**
1558
1559
  * Maps custom type fields object property into an array
1559
1560
  *
@@ -1578,13 +1579,13 @@ function transformCustomTypeValue(value) {
1578
1579
  }
1579
1580
  const mapCustomTypeFieldsToArray = value => {
1580
1581
  var _context;
1581
- return _objectSpread$21(_objectSpread$21({}, value), {}, {
1582
+ return _objectSpread$20(_objectSpread$20({}, value), {}, {
1582
1583
  fields: value?.fields ? _mapInstanceProperty__default["default"](_context = _Object$entries__default["default"](value.fields)).call(_context, _ref => {
1583
1584
  let _ref2 = _slicedToArray(_ref, 2),
1584
1585
  key = _ref2[0],
1585
1586
  entry = _ref2[1];
1586
1587
  const entryValue = entry.value !== undefined ? entry.value : entry;
1587
- return _objectSpread$21(_objectSpread$21({}, entry), {}, {
1588
+ return _objectSpread$20(_objectSpread$20({}, entry), {}, {
1588
1589
  name: key,
1589
1590
  value: transformCustomTypeValue(entryValue)
1590
1591
  });
@@ -1662,30 +1663,6 @@ const ComposedChange = props => jsxRuntime.jsx("div", {
1662
1663
  });
1663
1664
  ComposedChange.displayName = 'ComposedChange';
1664
1665
 
1665
- const PRECISION_TYPES = {
1666
- highPrecision: 'highPrecision',
1667
- centPrecision: 'centPrecision'
1668
- };
1669
-
1670
- function ownKeys$20(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1671
- function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$20(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$20(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1672
- function getFractionedAmount(moneyValue) {
1673
- const _moneyValue$fractionD = moneyValue.fractionDigits,
1674
- fractionDigits = _moneyValue$fractionD === void 0 ? 2 : _moneyValue$fractionD;
1675
-
1676
- // the amount should be available on preciseAmount for highPrecision
1677
- const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
1678
- return amount / 10 ** fractionDigits;
1679
- }
1680
- function formatMoney(moneyValue, intl, options) {
1681
- if (moneyValue === null) return;
1682
- return intl.formatNumber(getFractionedAmount(moneyValue), _objectSpread$20({
1683
- style: 'currency',
1684
- currency: moneyValue.currencyCode,
1685
- minimumFractionDigits: moneyValue.fractionDigits
1686
- }, options));
1687
- }
1688
-
1689
1666
  /**
1690
1667
  * Maps a RESOURCE_TYPE_ID (kebab-case) to the corresponding RESOURCE_TYPE (PascalCase).
1691
1668
  * Returns `undefined` when the mapping does not exist.
@@ -1792,7 +1769,7 @@ const ChangeItemValueByType = props => {
1792
1769
  const intl = reactIntl.useIntl();
1793
1770
  if (props.value === null || props.value === undefined) return jsxRuntime.jsx(NoValueLabel, {});
1794
1771
  if (props.value.currencyCode) {
1795
- return formatMoney(props.value, intl);
1772
+ return experimentalComponents.formatMoney(props.value, intl);
1796
1773
  }
1797
1774
  if (typeof props.value === 'boolean') return _JSON$stringify__default["default"](props.value);
1798
1775
  if (props.value.key) {
@@ -3247,7 +3224,7 @@ const OrderItemDetailsPresenter = props => {
3247
3224
  value: item.quantity
3248
3225
  }), jsxRuntime.jsx(DetailRow$2, {
3249
3226
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1P({}, orderMessages.totalPriceColumnLabel)),
3250
- value: formatMoney(item.totalPrice, intl)
3227
+ value: experimentalComponents.formatMoney(item.totalPrice, intl)
3251
3228
  })]
3252
3229
  });
3253
3230
  };
@@ -3404,7 +3381,7 @@ const OrderLineItemDiscountedPricePerQuantityPresenter = props => {
3404
3381
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3405
3382
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1M(_objectSpread$1M({}, orderMessages.discountedPriceLabel), {}, {
3406
3383
  values: {
3407
- discountedPrice: formatMoney(props.change.nextValue.discountedPrice.value, intl)
3384
+ discountedPrice: experimentalComponents.formatMoney(props.change.nextValue.discountedPrice.value, intl)
3408
3385
  }
3409
3386
  }))
3410
3387
  })]
@@ -3420,7 +3397,7 @@ const OrderLineItemDiscountedPricePerQuantityPresenter = props => {
3420
3397
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3421
3398
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1M(_objectSpread$1M({}, orderMessages.discountedPriceLabel), {}, {
3422
3399
  values: {
3423
- discountedPrice: formatMoney(props.change.previousValue.discountedPrice.value, intl)
3400
+ discountedPrice: experimentalComponents.formatMoney(props.change.previousValue.discountedPrice.value, intl)
3424
3401
  }
3425
3402
  }))
3426
3403
  })]
@@ -3442,15 +3419,15 @@ const OrderLineItemPricePresenter = props => {
3442
3419
  const label = isCustomLineItem ? getCustomLineItemLabel(props.change, applicationContext.language, applicationContext.languages || []) : getLineItemLabel(props.change, applicationContext.language, applicationContext.languages || []);
3443
3420
  const getNextValue = () => {
3444
3421
  if (hasNestedValue) {
3445
- return props.change.nextValue?.value ? formatMoney(props.change.nextValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3422
+ return props.change.nextValue?.value ? experimentalComponents.formatMoney(props.change.nextValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3446
3423
  }
3447
- return props.change.nextValue ? formatMoney(props.change.nextValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3424
+ return props.change.nextValue ? experimentalComponents.formatMoney(props.change.nextValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3448
3425
  };
3449
3426
  const getPreviousValue = () => {
3450
3427
  if (hasNestedValue) {
3451
- return props.change.previousValue?.value ? formatMoney(props.change.previousValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3428
+ return props.change.previousValue?.value ? experimentalComponents.formatMoney(props.change.previousValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3452
3429
  }
3453
- return props.change.previousValue ? formatMoney(props.change.previousValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3430
+ return props.change.previousValue ? experimentalComponents.formatMoney(props.change.previousValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3454
3431
  };
3455
3432
  return jsxRuntime.jsx(ComposedChange, {
3456
3433
  label: label,
@@ -3580,13 +3557,13 @@ const TaxedPriceChange = props => {
3580
3557
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
3581
3558
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.totalNetLabel), {}, {
3582
3559
  values: {
3583
- totalNet: formatMoney(props.value.totalNet, intl)
3560
+ totalNet: experimentalComponents.formatMoney(props.value.totalNet, intl)
3584
3561
  }
3585
3562
  }))
3586
3563
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3587
3564
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.totalGrossLabel), {}, {
3588
3565
  values: {
3589
- totalGross: formatMoney(props.value.totalGross, intl)
3566
+ totalGross: experimentalComponents.formatMoney(props.value.totalGross, intl)
3590
3567
  }
3591
3568
  }))
3592
3569
  }), props.value.taxPortions && jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -3606,7 +3583,7 @@ const TaxedPriceChange = props => {
3606
3583
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3607
3584
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.taxPortionItemLabel), {}, {
3608
3585
  values: {
3609
- amount: formatMoney(taxPortion.amount, intl),
3586
+ amount: experimentalComponents.formatMoney(taxPortion.amount, intl),
3610
3587
  rate: taxPortion.rate
3611
3588
  }
3612
3589
  }))
@@ -3779,7 +3756,7 @@ const OrderPaymentPresenter = props => {
3779
3756
  previousValue: jsxRuntime.jsx(uiKit.Spacings.Stack, {
3780
3757
  scale: "xs",
3781
3758
  children: props.change.previousValue?.payments.length > 0 ? props.change.previousValue?.payments.map(payment => {
3782
- const paymentLabel = payment.amountPlanned ? formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3759
+ const paymentLabel = payment.amountPlanned ? experimentalComponents.formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3783
3760
  return jsxRuntime.jsx("div", {
3784
3761
  children: paymentLabel
3785
3762
  }, `prev-${payment.id}`);
@@ -3788,7 +3765,7 @@ const OrderPaymentPresenter = props => {
3788
3765
  nextValue: jsxRuntime.jsx(uiKit.Spacings.Stack, {
3789
3766
  scale: "xs",
3790
3767
  children: props.change.nextValue?.payments.length > 0 ? props.change.nextValue?.payments.map(payment => {
3791
- const paymentLabel = payment.amountPlanned ? formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3768
+ const paymentLabel = payment.amountPlanned ? experimentalComponents.formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3792
3769
  return jsxRuntime.jsx("div", {
3793
3770
  children: paymentLabel
3794
3771
  }, `next-${payment.id}`);
@@ -3920,7 +3897,7 @@ const OrderDirectDiscountsPresenter = props => {
3920
3897
  })), discount.value.type === 'absolute' && 'money' in discount.value && jsxRuntime.jsx(uiKit.Spacings.Stack, {
3921
3898
  scale: "xs",
3922
3899
  children: _mapInstanceProperty__default["default"](_context = discount.value.money).call(_context, (moneyValue, idx) => jsxRuntime.jsx("div", {
3923
- children: formatMoney(moneyValue, intl)
3900
+ children: experimentalComponents.formatMoney(moneyValue, intl)
3924
3901
  }, `money-${idx}`))
3925
3902
  })]
3926
3903
  })]
@@ -3968,7 +3945,7 @@ const renderDiscountedPrice$1 = (discountedPrice, intl) => {
3968
3945
  }), jsxRuntime.jsx("div", {
3969
3946
  css: changeValueContainerStyles,
3970
3947
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
3971
- children: formatMoney(discountedPrice.value, intl)
3948
+ children: experimentalComponents.formatMoney(discountedPrice.value, intl)
3972
3949
  })
3973
3950
  })]
3974
3951
  }), discountedPrice.includedDiscounts && discountedPrice.includedDiscounts.length > 0 && jsxRuntime.jsxs("div", {
@@ -3987,7 +3964,7 @@ const renderDiscountedPrice$1 = (discountedPrice, intl) => {
3987
3964
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3988
3965
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1C(_objectSpread$1C({}, orderMessages.discountedPriceLabel), {}, {
3989
3966
  values: {
3990
- discountedPrice: formatMoney(discount.discountedAmount, intl)
3967
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
3991
3968
  }
3992
3969
  }))
3993
3970
  })]
@@ -4090,7 +4067,7 @@ const OrderShippingPresenter = _ref2 => {
4090
4067
  value: shipping.shippingInfo?.shippingMethodName || jsxRuntime.jsx(NoValueLabel, {})
4091
4068
  }), jsxRuntime.jsx(DetailRow$1, {
4092
4069
  label: intl.formatMessage(orderMessages.orderShippingShippingPriceLabel),
4093
- value: shipping.shippingInfo?.price ? formatMoney(shipping.shippingInfo.price, intl) : jsxRuntime.jsx(NoValueLabel, {})
4070
+ value: shipping.shippingInfo?.price ? experimentalComponents.formatMoney(shipping.shippingInfo.price, intl) : jsxRuntime.jsx(NoValueLabel, {})
4094
4071
  }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
4095
4072
  scale: "xs",
4096
4073
  children: [jsxRuntime.jsxs(uiKit.Text.Detail, {
@@ -4199,13 +4176,13 @@ const OrderSetDiscountOnTotalPricePresenter = props => {
4199
4176
  scale: "xs",
4200
4177
  children: [jsxRuntime.jsx(DetailRow, {
4201
4178
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedAmountLabel)),
4202
- value: discountOnTotalPrice.discountedAmount && formatMoney(discountOnTotalPrice.discountedAmount, intl)
4179
+ value: discountOnTotalPrice.discountedAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedAmount, intl)
4203
4180
  }), jsxRuntime.jsx(DetailRow, {
4204
4181
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedNetAmountLabel)),
4205
- value: discountOnTotalPrice.discountedNetAmount && formatMoney(discountOnTotalPrice.discountedNetAmount, intl)
4182
+ value: discountOnTotalPrice.discountedNetAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedNetAmount, intl)
4206
4183
  }), jsxRuntime.jsx(DetailRow, {
4207
4184
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedGrossAmountLabel)),
4208
- value: discountOnTotalPrice.discountedGrossAmount && formatMoney(discountOnTotalPrice.discountedGrossAmount, intl)
4185
+ value: discountOnTotalPrice.discountedGrossAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedGrossAmount, intl)
4209
4186
  }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
4210
4187
  scale: "xs",
4211
4188
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
@@ -4222,7 +4199,7 @@ const OrderSetDiscountOnTotalPricePresenter = props => {
4222
4199
  typeId: 'cart-discount'
4223
4200
  }) : jsxRuntime.jsx(NoValueLabel, {})
4224
4201
  }), jsxRuntime.jsxs(uiKit.Text.Detail, {
4225
- children: [jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.includedDiscountedAmountLabel)), ":", ' ', includedDiscount.discountedAmount ? formatMoney(includedDiscount.discountedAmount, intl) : jsxRuntime.jsx(NoValueLabel, {})]
4202
+ children: [jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.includedDiscountedAmountLabel)), ":", ' ', includedDiscount.discountedAmount ? experimentalComponents.formatMoney(includedDiscount.discountedAmount, intl) : jsxRuntime.jsx(NoValueLabel, {})]
4226
4203
  })]
4227
4204
  })
4228
4205
  }, `${discountReference?.id || 'discount'}-${index}`);
@@ -4282,7 +4259,7 @@ const renderDiscountedPrice = (discountedPrice, intl) => {
4282
4259
  }), jsxRuntime.jsx("div", {
4283
4260
  css: changeValueContainerStyles,
4284
4261
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
4285
- children: formatMoney(discountedPrice.value, intl)
4262
+ children: experimentalComponents.formatMoney(discountedPrice.value, intl)
4286
4263
  })
4287
4264
  })]
4288
4265
  }), discountedPrice.includedDiscounts && discountedPrice.includedDiscounts.length > 0 && jsxRuntime.jsxs("div", {
@@ -4301,7 +4278,7 @@ const renderDiscountedPrice = (discountedPrice, intl) => {
4301
4278
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
4302
4279
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1y(_objectSpread$1y({}, orderMessages.discountedPriceLabel), {}, {
4303
4280
  values: {
4304
- discountedPrice: formatMoney(discount.discountedAmount, intl)
4281
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
4305
4282
  }
4306
4283
  }))
4307
4284
  })]
@@ -4358,7 +4335,7 @@ const renderDiscountedPriceForQuantity = (priceForQuantity, intl) => {
4358
4335
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
4359
4336
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1x(_objectSpread$1x({}, orderMessages.discountedPriceLabel), {}, {
4360
4337
  values: {
4361
- discountedPrice: formatMoney(priceForQuantity.discountedPrice.value, intl)
4338
+ discountedPrice: experimentalComponents.formatMoney(priceForQuantity.discountedPrice.value, intl)
4362
4339
  }
4363
4340
  }))
4364
4341
  })
@@ -4379,7 +4356,7 @@ const renderDiscountedPriceForQuantity = (priceForQuantity, intl) => {
4379
4356
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
4380
4357
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1x(_objectSpread$1x({}, orderMessages.discountedPriceLabel), {}, {
4381
4358
  values: {
4382
- discountedPrice: formatMoney(discount.discountedAmount, intl)
4359
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
4383
4360
  }
4384
4361
  }))
4385
4362
  })]
@@ -4575,14 +4552,15 @@ LocalizedChangePresenter.displayName = 'LocalizedChangePresenter';
4575
4552
  */
4576
4553
  const MoneyPresenter = props => {
4577
4554
  const value = props.value;
4578
- if (!value || !value.currencyCode || value.centAmount === undefined) {
4555
+ const intl = reactIntl.useIntl();
4556
+ if (!value || !value.currencyCode) {
4579
4557
  return null;
4580
4558
  }
4581
- const amount = value.centAmount / Math.pow(10, value.fractionDigits || 2);
4582
- return jsxRuntime.jsx(reactIntl.FormattedNumber, {
4583
- value: amount,
4584
- style: "currency",
4585
- currency: value.currencyCode
4559
+ const isHighPrecision = value.type === experimentalComponents.PRECISION_TYPES.highPrecision;
4560
+ const isMissingRequiredAmount = isHighPrecision ? value.preciseAmount === undefined : value.centAmount === undefined;
4561
+ if (isMissingRequiredAmount) return null;
4562
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
4563
+ children: experimentalComponents.formatMoney(value, intl)
4586
4564
  });
4587
4565
  };
4588
4566
  MoneyPresenter.displayName = 'MoneyPresenter';
@@ -4598,7 +4576,7 @@ function formatTiers(tiers, intl) {
4598
4576
  children: _mapInstanceProperty__default["default"](tiers).call(tiers, (tier, index) => jsxRuntime.jsx("div", {
4599
4577
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1v(_objectSpread$1v({}, messages$13.priceTierLabel), {}, {
4600
4578
  values: {
4601
- price: formatMoney(tier.value, intl),
4579
+ price: experimentalComponents.formatMoney(tier.value, intl),
4602
4580
  quantity: tier.minimumQuantity
4603
4581
  }
4604
4582
  }))
@@ -5294,11 +5272,11 @@ function renderAttributeByType(attributeName, value, intl) {
5294
5272
  var _context;
5295
5273
  switch (attributeName) {
5296
5274
  case 'value':
5297
- return formatMoney(value.value, intl);
5275
+ return experimentalComponents.formatMoney(value.value, intl);
5298
5276
  case 'customerGroup':
5299
5277
  return value.customerGroup?.id || jsxRuntime.jsx(NoValueLabel, {});
5300
5278
  case 'discounted':
5301
- return value.discounted ? formatMoney(value.discounted?.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
5279
+ return value.discounted ? experimentalComponents.formatMoney(value.discounted?.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
5302
5280
  case 'validFrom':
5303
5281
  return value.validFrom ? jsxRuntime.jsx(FormattedDateTime, {
5304
5282
  type: "datetime",
@@ -5331,7 +5309,7 @@ function renderAttributeByType(attributeName, value, intl) {
5331
5309
  children: _mapInstanceProperty__default["default"](_context = value.tiers).call(_context, tier => jsxRuntime.jsx("div", {
5332
5310
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1p(_objectSpread$1p({}, messages$13.priceTierLabel), {}, {
5333
5311
  values: {
5334
- price: formatMoney(tier.value, intl),
5312
+ price: experimentalComponents.formatMoney(tier.value, intl),
5335
5313
  quantity: tier.minimumQuantity
5336
5314
  }
5337
5315
  }))
@@ -5421,10 +5399,7 @@ function ProductAddRemovePricePresenter(props) {
5421
5399
  })), jsxRuntime.jsx("div", {
5422
5400
  css: changeValueContainerStyles,
5423
5401
  children: _mapInstanceProperty__default["default"](priceValue).call(priceValue, v => jsxRuntime.jsx("div", {
5424
- children: v.value ? intl.formatNumber(v.value.centAmount / 100, {
5425
- style: 'currency',
5426
- currency: v.value.currencyCode
5427
- }) : jsxRuntime.jsx(NoValueLabel, {})
5402
+ children: v.value ? experimentalComponents.formatMoney(v.value, intl) : jsxRuntime.jsx(NoValueLabel, {})
5428
5403
  }, `${v.id}`))
5429
5404
  })]
5430
5405
  });
@@ -5913,7 +5888,7 @@ function ProductDiscountedPricePresenter(props) {
5913
5888
  children: value ? jsxRuntime.jsxs("div", {
5914
5889
  css: changeValueContainerStyles,
5915
5890
  children: [jsxRuntime.jsx("span", {
5916
- children: formatMoney(value.value, intl)
5891
+ children: experimentalComponents.formatMoney(value.value, intl)
5917
5892
  }), jsxRuntime.jsx("span", {
5918
5893
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1i(_objectSpread$1i({}, messages$V.productDiscountLabel), {}, {
5919
5894
  values: {
@@ -7252,7 +7227,7 @@ const DiscountValuePresenter = _ref => {
7252
7227
  children: [jsxRuntime.jsx("div", {
7253
7228
  children: value?.type
7254
7229
  }), value?.money?.map(val => jsxRuntime.jsx("div", {
7255
- children: formatMoney(val, intl)
7230
+ children: experimentalComponents.formatMoney(val, intl)
7256
7231
  }, `${val.currencyCode}-${val.centAmount}`))]
7257
7232
  });
7258
7233
  };
@@ -7408,6 +7383,7 @@ function ShippingRatePresenter(props) {
7408
7383
  var _context;
7409
7384
  const change = props.change,
7410
7385
  value = props.value;
7386
+ const intl = reactIntl.useIntl();
7411
7387
  const shippingMethodChange = change;
7412
7388
  const rateValue = value;
7413
7389
  if (!rateValue) {
@@ -7431,21 +7407,13 @@ function ShippingRatePresenter(props) {
7431
7407
  children: [rateValue.price && jsxRuntime.jsx("div", {
7432
7408
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRatePriceLabel), {}, {
7433
7409
  values: {
7434
- price: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7435
- value: rateValue.price.centAmount / Math.pow(10, rateValue.price.fractionDigits || 2),
7436
- style: "currency",
7437
- currency: rateValue.price.currencyCode
7438
- }, "price")
7410
+ price: experimentalComponents.formatMoney(rateValue.price, intl)
7439
7411
  }
7440
7412
  }))
7441
7413
  }), rateValue.freeAbove && jsxRuntime.jsx("div", {
7442
7414
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRateFreeAboveLabel), {}, {
7443
7415
  values: {
7444
- freeAbove: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7445
- value: rateValue.freeAbove.centAmount / Math.pow(10, rateValue.freeAbove.fractionDigits || 2),
7446
- style: "currency",
7447
- currency: rateValue.freeAbove.currencyCode
7448
- }, "freeAbove")
7416
+ freeAbove: experimentalComponents.formatMoney(rateValue.freeAbove, intl)
7449
7417
  }
7450
7418
  }))
7451
7419
  }), rateValue.tiers && rateValue.tiers.length > 0 && jsxRuntime.jsxs("div", {
@@ -7455,11 +7423,10 @@ function ShippingRatePresenter(props) {
7455
7423
  css: changeValueContainerStyles,
7456
7424
  children: [isCartValueTier(tier) && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartValueShippingRateTierLabel), {}, {
7457
7425
  values: {
7458
- minimumCentAmount: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7459
- value: tier.minimumCentAmount / 100,
7460
- style: "currency",
7461
- currency: rateValue.price.currencyCode
7462
- }, "minimumCentAmount")
7426
+ minimumCentAmount: experimentalComponents.formatMoney({
7427
+ currencyCode: rateValue.price.currencyCode,
7428
+ centAmount: tier.minimumCentAmount
7429
+ }, intl)
7463
7430
  }
7464
7431
  })), isCartClassificationTier(tier) && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartClassificationShippingRateTierLabel), {}, {
7465
7432
  values: {
@@ -7511,7 +7478,7 @@ const TransactionPresenter = props => {
7511
7478
  const intl = reactIntl.useIntl();
7512
7479
  return jsxRuntime.jsx("div", {
7513
7480
  css: changeValueContainerStyles,
7514
- children: typeof props.value === 'string' ? props.value : `${props.value.type} ${formatMoney(props.value.amount, intl)} (${props.value.state})`
7481
+ children: typeof props.value === 'string' ? props.value : `${props.value.type} ${experimentalComponents.formatMoney(props.value.amount, intl)} (${props.value.state})`
7515
7482
  });
7516
7483
  };
7517
7484
  TransactionPresenter.displayName = 'TransactionPresenter';
@@ -9565,13 +9532,13 @@ const ShippingRateChange = props => {
9565
9532
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
9566
9533
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRatePriceLabel), {}, {
9567
9534
  values: {
9568
- price: formatMoney(props.value.price, intl)
9535
+ price: experimentalComponents.formatMoney(props.value.price, intl)
9569
9536
  }
9570
9537
  }))
9571
9538
  }), props.value.freeAbove && jsxRuntime.jsx(uiKit.Text.Detail, {
9572
9539
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRateFreeAboveLabel), {}, {
9573
9540
  values: {
9574
- freeAbove: formatMoney(props.value.freeAbove, intl)
9541
+ freeAbove: experimentalComponents.formatMoney(props.value.freeAbove, intl)
9575
9542
  }
9576
9543
  }))
9577
9544
  }), props.value.tiers.length > 0 && jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -9590,7 +9557,7 @@ const ShippingRateChange = props => {
9590
9557
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
9591
9558
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRatePriceLabel), {}, {
9592
9559
  values: {
9593
- price: formatMoney(tier.price, intl)
9560
+ price: experimentalComponents.formatMoney(tier.price, intl)
9594
9561
  }
9595
9562
  }))
9596
9563
  }), jsxRuntime.jsx(uiKit.Spacings.Inline, {
@@ -9598,7 +9565,7 @@ const ShippingRateChange = props => {
9598
9565
  children: jsxRuntime.jsxs(uiKit.Text.Detail, {
9599
9566
  children: [tier.minimumCentAmount && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.cartValueShippingRateTierLabel), {}, {
9600
9567
  values: {
9601
- minimumCentAmount: formatMoney(_objectSpread$O(_objectSpread$O({}, tier.price), {}, {
9568
+ minimumCentAmount: experimentalComponents.formatMoney(_objectSpread$O(_objectSpread$O({}, tier.price), {}, {
9602
9569
  centAmount: tier.minimumCentAmount
9603
9570
  }), intl)
9604
9571
  }
@@ -10808,7 +10775,7 @@ const getPaymentLabel = _ref => {
10808
10775
  intl = _ref.intl;
10809
10776
  const amountPlanned = 'amountPlanned' in messageLabel ? messageLabel.amountPlanned : undefined;
10810
10777
  const key = 'key' in messageLabel ? messageLabel.key : undefined;
10811
- const paymentAmount = amountPlanned ? formatMoney(amountPlanned, intl) : undefined;
10778
+ const paymentAmount = amountPlanned ? experimentalComponents.formatMoney(amountPlanned, intl) : undefined;
10812
10779
  return intl.formatMessage(messages$B.paymentResource, {
10813
10780
  paymentValue: key || paymentAmount || jsxRuntime.jsx(NoValueFallback, {})
10814
10781
  });
@@ -10818,7 +10785,7 @@ const mapLabel$1 = _ref => {
10818
10785
  let data = _ref.data,
10819
10786
  intl = _ref.intl;
10820
10787
  return intl.formatMessage(messages$B.paymentResource, {
10821
- paymentValue: data.key || formatMoney(data.amountPlanned, intl)
10788
+ paymentValue: data.key || experimentalComponents.formatMoney(data.amountPlanned, intl)
10822
10789
  });
10823
10790
  };
10824
10791
 
@@ -10984,7 +10951,7 @@ const mapPaymentToPreview = _ref => {
10984
10951
  fieldValue: resource.interfaceId
10985
10952
  }, {
10986
10953
  fieldName: intl.formatMessage(messages$A.amountPlannedLabel),
10987
- fieldValue: formatMoney(resource.amountPlanned, intl)
10954
+ fieldValue: experimentalComponents.formatMoney(resource.amountPlanned, intl)
10988
10955
  }, {
10989
10956
  fieldName: intl.formatMessage(messages$A.paymentMethodInfoMethodLabel),
10990
10957
  fieldValue: resource.paymentMethodInfo?.method
@@ -11006,7 +10973,7 @@ const mapPaymentToPreview = _ref => {
11006
10973
  }, {
11007
10974
  fieldName: 'transactions',
11008
10975
  fieldValue: _mapInstanceProperty__default["default"](_context = resource.transactions).call(_context, transaction => _objectSpread$K(_objectSpread$K({}, transaction), {}, {
11009
- amount: transaction.amount && formatMoney(transaction.amount, intl),
10976
+ amount: transaction.amount && experimentalComponents.formatMoney(transaction.amount, intl),
11010
10977
  timestamp: formatDateTime('datetime', transaction.timestamp)
11011
10978
  }))
11012
10979
  }];
@@ -35,6 +35,7 @@ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
35
35
  var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
36
36
  var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
37
37
  var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
38
+ var experimentalComponents = require('@commercetools-frontend/experimental-components');
38
39
  var groupBy = require('lodash/groupBy');
39
40
  require('common-tags/lib/oneLine');
40
41
  var moment = require('moment-timezone');
@@ -134,7 +135,7 @@ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
134
135
  var RadioInput__default = /*#__PURE__*/_interopDefault(RadioInput);
135
136
 
136
137
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
137
- var version = "9.3.0";
138
+ var version = "9.3.2";
138
139
 
139
140
  var fetchFeatureStatusQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchFeatureStatusQuery" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 84, source: { body: "query FetchFeatureStatusQuery {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
140
141
  /**
@@ -1535,8 +1536,8 @@ const AddOrRemoveAssetPresenter = props => {
1535
1536
  };
1536
1537
  AddOrRemoveAssetPresenter.displayName = 'AddOrRemoveAssetPresenter';
1537
1538
 
1538
- function ownKeys$21(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1539
- function _objectSpread$21(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$21(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$21(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1539
+ function ownKeys$20(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1540
+ function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$20(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$20(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1540
1541
  /**
1541
1542
  * Maps custom type fields object property into an array
1542
1543
  *
@@ -1561,13 +1562,13 @@ function transformCustomTypeValue(value) {
1561
1562
  }
1562
1563
  const mapCustomTypeFieldsToArray = value => {
1563
1564
  var _context;
1564
- return _objectSpread$21(_objectSpread$21({}, value), {}, {
1565
+ return _objectSpread$20(_objectSpread$20({}, value), {}, {
1565
1566
  fields: value?.fields ? _mapInstanceProperty__default["default"](_context = _Object$entries__default["default"](value.fields)).call(_context, _ref => {
1566
1567
  let _ref2 = _slicedToArray(_ref, 2),
1567
1568
  key = _ref2[0],
1568
1569
  entry = _ref2[1];
1569
1570
  const entryValue = entry.value !== undefined ? entry.value : entry;
1570
- return _objectSpread$21(_objectSpread$21({}, entry), {}, {
1571
+ return _objectSpread$20(_objectSpread$20({}, entry), {}, {
1571
1572
  name: key,
1572
1573
  value: transformCustomTypeValue(entryValue)
1573
1574
  });
@@ -1645,30 +1646,6 @@ const ComposedChange = props => jsxRuntime.jsx("div", {
1645
1646
  });
1646
1647
  ComposedChange.displayName = 'ComposedChange';
1647
1648
 
1648
- const PRECISION_TYPES = {
1649
- highPrecision: 'highPrecision',
1650
- centPrecision: 'centPrecision'
1651
- };
1652
-
1653
- function ownKeys$20(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
1654
- function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$20(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$20(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
1655
- function getFractionedAmount(moneyValue) {
1656
- const _moneyValue$fractionD = moneyValue.fractionDigits,
1657
- fractionDigits = _moneyValue$fractionD === void 0 ? 2 : _moneyValue$fractionD;
1658
-
1659
- // the amount should be available on preciseAmount for highPrecision
1660
- const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
1661
- return amount / 10 ** fractionDigits;
1662
- }
1663
- function formatMoney(moneyValue, intl, options) {
1664
- if (moneyValue === null) return;
1665
- return intl.formatNumber(getFractionedAmount(moneyValue), _objectSpread$20({
1666
- style: 'currency',
1667
- currency: moneyValue.currencyCode,
1668
- minimumFractionDigits: moneyValue.fractionDigits
1669
- }, options));
1670
- }
1671
-
1672
1649
  /**
1673
1650
  * Maps a RESOURCE_TYPE_ID (kebab-case) to the corresponding RESOURCE_TYPE (PascalCase).
1674
1651
  * Returns `undefined` when the mapping does not exist.
@@ -1775,7 +1752,7 @@ const ChangeItemValueByType = props => {
1775
1752
  const intl = reactIntl.useIntl();
1776
1753
  if (props.value === null || props.value === undefined) return jsxRuntime.jsx(NoValueLabel, {});
1777
1754
  if (props.value.currencyCode) {
1778
- return formatMoney(props.value, intl);
1755
+ return experimentalComponents.formatMoney(props.value, intl);
1779
1756
  }
1780
1757
  if (typeof props.value === 'boolean') return _JSON$stringify__default["default"](props.value);
1781
1758
  if (props.value.key) {
@@ -3230,7 +3207,7 @@ const OrderItemDetailsPresenter = props => {
3230
3207
  value: item.quantity
3231
3208
  }), jsxRuntime.jsx(DetailRow$2, {
3232
3209
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1P({}, orderMessages.totalPriceColumnLabel)),
3233
- value: formatMoney(item.totalPrice, intl)
3210
+ value: experimentalComponents.formatMoney(item.totalPrice, intl)
3234
3211
  })]
3235
3212
  });
3236
3213
  };
@@ -3387,7 +3364,7 @@ const OrderLineItemDiscountedPricePerQuantityPresenter = props => {
3387
3364
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3388
3365
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1M(_objectSpread$1M({}, orderMessages.discountedPriceLabel), {}, {
3389
3366
  values: {
3390
- discountedPrice: formatMoney(props.change.nextValue.discountedPrice.value, intl)
3367
+ discountedPrice: experimentalComponents.formatMoney(props.change.nextValue.discountedPrice.value, intl)
3391
3368
  }
3392
3369
  }))
3393
3370
  })]
@@ -3403,7 +3380,7 @@ const OrderLineItemDiscountedPricePerQuantityPresenter = props => {
3403
3380
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3404
3381
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1M(_objectSpread$1M({}, orderMessages.discountedPriceLabel), {}, {
3405
3382
  values: {
3406
- discountedPrice: formatMoney(props.change.previousValue.discountedPrice.value, intl)
3383
+ discountedPrice: experimentalComponents.formatMoney(props.change.previousValue.discountedPrice.value, intl)
3407
3384
  }
3408
3385
  }))
3409
3386
  })]
@@ -3425,15 +3402,15 @@ const OrderLineItemPricePresenter = props => {
3425
3402
  const label = isCustomLineItem ? getCustomLineItemLabel(props.change, applicationContext.language, applicationContext.languages || []) : getLineItemLabel(props.change, applicationContext.language, applicationContext.languages || []);
3426
3403
  const getNextValue = () => {
3427
3404
  if (hasNestedValue) {
3428
- return props.change.nextValue?.value ? formatMoney(props.change.nextValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3405
+ return props.change.nextValue?.value ? experimentalComponents.formatMoney(props.change.nextValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3429
3406
  }
3430
- return props.change.nextValue ? formatMoney(props.change.nextValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3407
+ return props.change.nextValue ? experimentalComponents.formatMoney(props.change.nextValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3431
3408
  };
3432
3409
  const getPreviousValue = () => {
3433
3410
  if (hasNestedValue) {
3434
- return props.change.previousValue?.value ? formatMoney(props.change.previousValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3411
+ return props.change.previousValue?.value ? experimentalComponents.formatMoney(props.change.previousValue.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
3435
3412
  }
3436
- return props.change.previousValue ? formatMoney(props.change.previousValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3413
+ return props.change.previousValue ? experimentalComponents.formatMoney(props.change.previousValue, intl) : jsxRuntime.jsx(NoValueLabel, {});
3437
3414
  };
3438
3415
  return jsxRuntime.jsx(ComposedChange, {
3439
3416
  label: label,
@@ -3563,13 +3540,13 @@ const TaxedPriceChange = props => {
3563
3540
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
3564
3541
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.totalNetLabel), {}, {
3565
3542
  values: {
3566
- totalNet: formatMoney(props.value.totalNet, intl)
3543
+ totalNet: experimentalComponents.formatMoney(props.value.totalNet, intl)
3567
3544
  }
3568
3545
  }))
3569
3546
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3570
3547
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.totalGrossLabel), {}, {
3571
3548
  values: {
3572
- totalGross: formatMoney(props.value.totalGross, intl)
3549
+ totalGross: experimentalComponents.formatMoney(props.value.totalGross, intl)
3573
3550
  }
3574
3551
  }))
3575
3552
  }), props.value.taxPortions && jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -3589,7 +3566,7 @@ const TaxedPriceChange = props => {
3589
3566
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3590
3567
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1I(_objectSpread$1I({}, messages$13.taxPortionItemLabel), {}, {
3591
3568
  values: {
3592
- amount: formatMoney(taxPortion.amount, intl),
3569
+ amount: experimentalComponents.formatMoney(taxPortion.amount, intl),
3593
3570
  rate: taxPortion.rate
3594
3571
  }
3595
3572
  }))
@@ -3762,7 +3739,7 @@ const OrderPaymentPresenter = props => {
3762
3739
  previousValue: jsxRuntime.jsx(uiKit.Spacings.Stack, {
3763
3740
  scale: "xs",
3764
3741
  children: props.change.previousValue?.payments.length > 0 ? props.change.previousValue?.payments.map(payment => {
3765
- const paymentLabel = payment.amountPlanned ? formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3742
+ const paymentLabel = payment.amountPlanned ? experimentalComponents.formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3766
3743
  return jsxRuntime.jsx("div", {
3767
3744
  children: paymentLabel
3768
3745
  }, `prev-${payment.id}`);
@@ -3771,7 +3748,7 @@ const OrderPaymentPresenter = props => {
3771
3748
  nextValue: jsxRuntime.jsx(uiKit.Spacings.Stack, {
3772
3749
  scale: "xs",
3773
3750
  children: props.change.nextValue?.payments.length > 0 ? props.change.nextValue?.payments.map(payment => {
3774
- const paymentLabel = payment.amountPlanned ? formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3751
+ const paymentLabel = payment.amountPlanned ? experimentalComponents.formatMoney(payment.amountPlanned, intl) : `Payment ${payment.id}`;
3775
3752
  return jsxRuntime.jsx("div", {
3776
3753
  children: paymentLabel
3777
3754
  }, `next-${payment.id}`);
@@ -3903,7 +3880,7 @@ const OrderDirectDiscountsPresenter = props => {
3903
3880
  })), discount.value.type === 'absolute' && 'money' in discount.value && jsxRuntime.jsx(uiKit.Spacings.Stack, {
3904
3881
  scale: "xs",
3905
3882
  children: _mapInstanceProperty__default["default"](_context = discount.value.money).call(_context, (moneyValue, idx) => jsxRuntime.jsx("div", {
3906
- children: formatMoney(moneyValue, intl)
3883
+ children: experimentalComponents.formatMoney(moneyValue, intl)
3907
3884
  }, `money-${idx}`))
3908
3885
  })]
3909
3886
  })]
@@ -3951,7 +3928,7 @@ const renderDiscountedPrice$1 = (discountedPrice, intl) => {
3951
3928
  }), jsxRuntime.jsx("div", {
3952
3929
  css: changeValueContainerStyles,
3953
3930
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
3954
- children: formatMoney(discountedPrice.value, intl)
3931
+ children: experimentalComponents.formatMoney(discountedPrice.value, intl)
3955
3932
  })
3956
3933
  })]
3957
3934
  }), discountedPrice.includedDiscounts && discountedPrice.includedDiscounts.length > 0 && jsxRuntime.jsxs("div", {
@@ -3970,7 +3947,7 @@ const renderDiscountedPrice$1 = (discountedPrice, intl) => {
3970
3947
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
3971
3948
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1C(_objectSpread$1C({}, orderMessages.discountedPriceLabel), {}, {
3972
3949
  values: {
3973
- discountedPrice: formatMoney(discount.discountedAmount, intl)
3950
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
3974
3951
  }
3975
3952
  }))
3976
3953
  })]
@@ -4073,7 +4050,7 @@ const OrderShippingPresenter = _ref2 => {
4073
4050
  value: shipping.shippingInfo?.shippingMethodName || jsxRuntime.jsx(NoValueLabel, {})
4074
4051
  }), jsxRuntime.jsx(DetailRow$1, {
4075
4052
  label: intl.formatMessage(orderMessages.orderShippingShippingPriceLabel),
4076
- value: shipping.shippingInfo?.price ? formatMoney(shipping.shippingInfo.price, intl) : jsxRuntime.jsx(NoValueLabel, {})
4053
+ value: shipping.shippingInfo?.price ? experimentalComponents.formatMoney(shipping.shippingInfo.price, intl) : jsxRuntime.jsx(NoValueLabel, {})
4077
4054
  }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
4078
4055
  scale: "xs",
4079
4056
  children: [jsxRuntime.jsxs(uiKit.Text.Detail, {
@@ -4182,13 +4159,13 @@ const OrderSetDiscountOnTotalPricePresenter = props => {
4182
4159
  scale: "xs",
4183
4160
  children: [jsxRuntime.jsx(DetailRow, {
4184
4161
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedAmountLabel)),
4185
- value: discountOnTotalPrice.discountedAmount && formatMoney(discountOnTotalPrice.discountedAmount, intl)
4162
+ value: discountOnTotalPrice.discountedAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedAmount, intl)
4186
4163
  }), jsxRuntime.jsx(DetailRow, {
4187
4164
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedNetAmountLabel)),
4188
- value: discountOnTotalPrice.discountedNetAmount && formatMoney(discountOnTotalPrice.discountedNetAmount, intl)
4165
+ value: discountOnTotalPrice.discountedNetAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedNetAmount, intl)
4189
4166
  }), jsxRuntime.jsx(DetailRow, {
4190
4167
  label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.discountedGrossAmountLabel)),
4191
- value: discountOnTotalPrice.discountedGrossAmount && formatMoney(discountOnTotalPrice.discountedGrossAmount, intl)
4168
+ value: discountOnTotalPrice.discountedGrossAmount && experimentalComponents.formatMoney(discountOnTotalPrice.discountedGrossAmount, intl)
4192
4169
  }), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
4193
4170
  scale: "xs",
4194
4171
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
@@ -4205,7 +4182,7 @@ const OrderSetDiscountOnTotalPricePresenter = props => {
4205
4182
  typeId: 'cart-discount'
4206
4183
  }) : jsxRuntime.jsx(NoValueLabel, {})
4207
4184
  }), jsxRuntime.jsxs(uiKit.Text.Detail, {
4208
- children: [jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.includedDiscountedAmountLabel)), ":", ' ', includedDiscount.discountedAmount ? formatMoney(includedDiscount.discountedAmount, intl) : jsxRuntime.jsx(NoValueLabel, {})]
4185
+ children: [jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1A({}, messages$Y.includedDiscountedAmountLabel)), ":", ' ', includedDiscount.discountedAmount ? experimentalComponents.formatMoney(includedDiscount.discountedAmount, intl) : jsxRuntime.jsx(NoValueLabel, {})]
4209
4186
  })]
4210
4187
  })
4211
4188
  }, `${discountReference?.id || 'discount'}-${index}`);
@@ -4265,7 +4242,7 @@ const renderDiscountedPrice = (discountedPrice, intl) => {
4265
4242
  }), jsxRuntime.jsx("div", {
4266
4243
  css: changeValueContainerStyles,
4267
4244
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
4268
- children: formatMoney(discountedPrice.value, intl)
4245
+ children: experimentalComponents.formatMoney(discountedPrice.value, intl)
4269
4246
  })
4270
4247
  })]
4271
4248
  }), discountedPrice.includedDiscounts && discountedPrice.includedDiscounts.length > 0 && jsxRuntime.jsxs("div", {
@@ -4284,7 +4261,7 @@ const renderDiscountedPrice = (discountedPrice, intl) => {
4284
4261
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
4285
4262
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1y(_objectSpread$1y({}, orderMessages.discountedPriceLabel), {}, {
4286
4263
  values: {
4287
- discountedPrice: formatMoney(discount.discountedAmount, intl)
4264
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
4288
4265
  }
4289
4266
  }))
4290
4267
  })]
@@ -4341,7 +4318,7 @@ const renderDiscountedPriceForQuantity = (priceForQuantity, intl) => {
4341
4318
  children: jsxRuntime.jsx(uiKit.Text.Detail, {
4342
4319
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1x(_objectSpread$1x({}, orderMessages.discountedPriceLabel), {}, {
4343
4320
  values: {
4344
- discountedPrice: formatMoney(priceForQuantity.discountedPrice.value, intl)
4321
+ discountedPrice: experimentalComponents.formatMoney(priceForQuantity.discountedPrice.value, intl)
4345
4322
  }
4346
4323
  }))
4347
4324
  })
@@ -4362,7 +4339,7 @@ const renderDiscountedPriceForQuantity = (priceForQuantity, intl) => {
4362
4339
  }), jsxRuntime.jsx(uiKit.Text.Detail, {
4363
4340
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1x(_objectSpread$1x({}, orderMessages.discountedPriceLabel), {}, {
4364
4341
  values: {
4365
- discountedPrice: formatMoney(discount.discountedAmount, intl)
4342
+ discountedPrice: experimentalComponents.formatMoney(discount.discountedAmount, intl)
4366
4343
  }
4367
4344
  }))
4368
4345
  })]
@@ -4553,14 +4530,15 @@ LocalizedChangePresenter.displayName = 'LocalizedChangePresenter';
4553
4530
  */
4554
4531
  const MoneyPresenter = props => {
4555
4532
  const value = props.value;
4556
- if (!value || !value.currencyCode || value.centAmount === undefined) {
4533
+ const intl = reactIntl.useIntl();
4534
+ if (!value || !value.currencyCode) {
4557
4535
  return null;
4558
4536
  }
4559
- const amount = value.centAmount / Math.pow(10, value.fractionDigits || 2);
4560
- return jsxRuntime.jsx(reactIntl.FormattedNumber, {
4561
- value: amount,
4562
- style: "currency",
4563
- currency: value.currencyCode
4537
+ const isHighPrecision = value.type === experimentalComponents.PRECISION_TYPES.highPrecision;
4538
+ const isMissingRequiredAmount = isHighPrecision ? value.preciseAmount === undefined : value.centAmount === undefined;
4539
+ if (isMissingRequiredAmount) return null;
4540
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
4541
+ children: experimentalComponents.formatMoney(value, intl)
4564
4542
  });
4565
4543
  };
4566
4544
  MoneyPresenter.displayName = 'MoneyPresenter';
@@ -4576,7 +4554,7 @@ function formatTiers(tiers, intl) {
4576
4554
  children: _mapInstanceProperty__default["default"](tiers).call(tiers, (tier, index) => jsxRuntime.jsx("div", {
4577
4555
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1v(_objectSpread$1v({}, messages$13.priceTierLabel), {}, {
4578
4556
  values: {
4579
- price: formatMoney(tier.value, intl),
4557
+ price: experimentalComponents.formatMoney(tier.value, intl),
4580
4558
  quantity: tier.minimumQuantity
4581
4559
  }
4582
4560
  }))
@@ -5272,11 +5250,11 @@ function renderAttributeByType(attributeName, value, intl) {
5272
5250
  var _context;
5273
5251
  switch (attributeName) {
5274
5252
  case 'value':
5275
- return formatMoney(value.value, intl);
5253
+ return experimentalComponents.formatMoney(value.value, intl);
5276
5254
  case 'customerGroup':
5277
5255
  return value.customerGroup?.id || jsxRuntime.jsx(NoValueLabel, {});
5278
5256
  case 'discounted':
5279
- return value.discounted ? formatMoney(value.discounted?.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
5257
+ return value.discounted ? experimentalComponents.formatMoney(value.discounted?.value, intl) : jsxRuntime.jsx(NoValueLabel, {});
5280
5258
  case 'validFrom':
5281
5259
  return value.validFrom ? jsxRuntime.jsx(FormattedDateTime, {
5282
5260
  type: "datetime",
@@ -5309,7 +5287,7 @@ function renderAttributeByType(attributeName, value, intl) {
5309
5287
  children: _mapInstanceProperty__default["default"](_context = value.tiers).call(_context, tier => jsxRuntime.jsx("div", {
5310
5288
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1p(_objectSpread$1p({}, messages$13.priceTierLabel), {}, {
5311
5289
  values: {
5312
- price: formatMoney(tier.value, intl),
5290
+ price: experimentalComponents.formatMoney(tier.value, intl),
5313
5291
  quantity: tier.minimumQuantity
5314
5292
  }
5315
5293
  }))
@@ -5399,10 +5377,7 @@ function ProductAddRemovePricePresenter(props) {
5399
5377
  })), jsxRuntime.jsx("div", {
5400
5378
  css: changeValueContainerStyles,
5401
5379
  children: _mapInstanceProperty__default["default"](priceValue).call(priceValue, v => jsxRuntime.jsx("div", {
5402
- children: v.value ? intl.formatNumber(v.value.centAmount / 100, {
5403
- style: 'currency',
5404
- currency: v.value.currencyCode
5405
- }) : jsxRuntime.jsx(NoValueLabel, {})
5380
+ children: v.value ? experimentalComponents.formatMoney(v.value, intl) : jsxRuntime.jsx(NoValueLabel, {})
5406
5381
  }, `${v.id}`))
5407
5382
  })]
5408
5383
  });
@@ -5873,7 +5848,7 @@ function ProductDiscountedPricePresenter(props) {
5873
5848
  children: value ? jsxRuntime.jsxs("div", {
5874
5849
  css: changeValueContainerStyles,
5875
5850
  children: [jsxRuntime.jsx("span", {
5876
- children: formatMoney(value.value, intl)
5851
+ children: experimentalComponents.formatMoney(value.value, intl)
5877
5852
  }), jsxRuntime.jsx("span", {
5878
5853
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1i(_objectSpread$1i({}, messages$V.productDiscountLabel), {}, {
5879
5854
  values: {
@@ -7194,7 +7169,7 @@ const DiscountValuePresenter = _ref => {
7194
7169
  children: [jsxRuntime.jsx("div", {
7195
7170
  children: value?.type
7196
7171
  }), value?.money?.map(val => jsxRuntime.jsx("div", {
7197
- children: formatMoney(val, intl)
7172
+ children: experimentalComponents.formatMoney(val, intl)
7198
7173
  }, `${val.currencyCode}-${val.centAmount}`))]
7199
7174
  });
7200
7175
  };
@@ -7350,6 +7325,7 @@ function ShippingRatePresenter(props) {
7350
7325
  var _context;
7351
7326
  const change = props.change,
7352
7327
  value = props.value;
7328
+ const intl = reactIntl.useIntl();
7353
7329
  const shippingMethodChange = change;
7354
7330
  const rateValue = value;
7355
7331
  if (!rateValue) {
@@ -7373,21 +7349,13 @@ function ShippingRatePresenter(props) {
7373
7349
  children: [rateValue.price && jsxRuntime.jsx("div", {
7374
7350
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRatePriceLabel), {}, {
7375
7351
  values: {
7376
- price: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7377
- value: rateValue.price.centAmount / Math.pow(10, rateValue.price.fractionDigits || 2),
7378
- style: "currency",
7379
- currency: rateValue.price.currencyCode
7380
- }, "price")
7352
+ price: experimentalComponents.formatMoney(rateValue.price, intl)
7381
7353
  }
7382
7354
  }))
7383
7355
  }), rateValue.freeAbove && jsxRuntime.jsx("div", {
7384
7356
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRateFreeAboveLabel), {}, {
7385
7357
  values: {
7386
- freeAbove: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7387
- value: rateValue.freeAbove.centAmount / Math.pow(10, rateValue.freeAbove.fractionDigits || 2),
7388
- style: "currency",
7389
- currency: rateValue.freeAbove.currencyCode
7390
- }, "freeAbove")
7358
+ freeAbove: experimentalComponents.formatMoney(rateValue.freeAbove, intl)
7391
7359
  }
7392
7360
  }))
7393
7361
  }), rateValue.tiers && rateValue.tiers.length > 0 && jsxRuntime.jsxs("div", {
@@ -7397,11 +7365,10 @@ function ShippingRatePresenter(props) {
7397
7365
  css: changeValueContainerStyles,
7398
7366
  children: [isCartValueTier(tier) && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartValueShippingRateTierLabel), {}, {
7399
7367
  values: {
7400
- minimumCentAmount: jsxRuntime.jsx(reactIntl.FormattedNumber, {
7401
- value: tier.minimumCentAmount / 100,
7402
- style: "currency",
7403
- currency: rateValue.price.currencyCode
7404
- }, "minimumCentAmount")
7368
+ minimumCentAmount: experimentalComponents.formatMoney({
7369
+ currencyCode: rateValue.price.currencyCode,
7370
+ centAmount: tier.minimumCentAmount
7371
+ }, intl)
7405
7372
  }
7406
7373
  })), isCartClassificationTier(tier) && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartClassificationShippingRateTierLabel), {}, {
7407
7374
  values: {
@@ -7453,7 +7420,7 @@ const TransactionPresenter = props => {
7453
7420
  const intl = reactIntl.useIntl();
7454
7421
  return jsxRuntime.jsx("div", {
7455
7422
  css: changeValueContainerStyles,
7456
- children: typeof props.value === 'string' ? props.value : `${props.value.type} ${formatMoney(props.value.amount, intl)} (${props.value.state})`
7423
+ children: typeof props.value === 'string' ? props.value : `${props.value.type} ${experimentalComponents.formatMoney(props.value.amount, intl)} (${props.value.state})`
7457
7424
  });
7458
7425
  };
7459
7426
  TransactionPresenter.displayName = 'TransactionPresenter';
@@ -9507,13 +9474,13 @@ const ShippingRateChange = props => {
9507
9474
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
9508
9475
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRatePriceLabel), {}, {
9509
9476
  values: {
9510
- price: formatMoney(props.value.price, intl)
9477
+ price: experimentalComponents.formatMoney(props.value.price, intl)
9511
9478
  }
9512
9479
  }))
9513
9480
  }), props.value.freeAbove && jsxRuntime.jsx(uiKit.Text.Detail, {
9514
9481
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRateFreeAboveLabel), {}, {
9515
9482
  values: {
9516
- freeAbove: formatMoney(props.value.freeAbove, intl)
9483
+ freeAbove: experimentalComponents.formatMoney(props.value.freeAbove, intl)
9517
9484
  }
9518
9485
  }))
9519
9486
  }), props.value.tiers.length > 0 && jsxRuntime.jsxs(uiKit.Spacings.Stack, {
@@ -9532,7 +9499,7 @@ const ShippingRateChange = props => {
9532
9499
  children: [jsxRuntime.jsx(uiKit.Text.Detail, {
9533
9500
  children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.shippingRatePriceLabel), {}, {
9534
9501
  values: {
9535
- price: formatMoney(tier.price, intl)
9502
+ price: experimentalComponents.formatMoney(tier.price, intl)
9536
9503
  }
9537
9504
  }))
9538
9505
  }), jsxRuntime.jsx(uiKit.Spacings.Inline, {
@@ -9540,7 +9507,7 @@ const ShippingRateChange = props => {
9540
9507
  children: jsxRuntime.jsxs(uiKit.Text.Detail, {
9541
9508
  children: [tier.minimumCentAmount && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$O(_objectSpread$O({}, messages$13.cartValueShippingRateTierLabel), {}, {
9542
9509
  values: {
9543
- minimumCentAmount: formatMoney(_objectSpread$O(_objectSpread$O({}, tier.price), {}, {
9510
+ minimumCentAmount: experimentalComponents.formatMoney(_objectSpread$O(_objectSpread$O({}, tier.price), {}, {
9544
9511
  centAmount: tier.minimumCentAmount
9545
9512
  }), intl)
9546
9513
  }
@@ -10750,7 +10717,7 @@ const getPaymentLabel = _ref => {
10750
10717
  intl = _ref.intl;
10751
10718
  const amountPlanned = 'amountPlanned' in messageLabel ? messageLabel.amountPlanned : undefined;
10752
10719
  const key = 'key' in messageLabel ? messageLabel.key : undefined;
10753
- const paymentAmount = amountPlanned ? formatMoney(amountPlanned, intl) : undefined;
10720
+ const paymentAmount = amountPlanned ? experimentalComponents.formatMoney(amountPlanned, intl) : undefined;
10754
10721
  return intl.formatMessage(messages$B.paymentResource, {
10755
10722
  paymentValue: key || paymentAmount || jsxRuntime.jsx(NoValueFallback, {})
10756
10723
  });
@@ -10760,7 +10727,7 @@ const mapLabel$1 = _ref => {
10760
10727
  let data = _ref.data,
10761
10728
  intl = _ref.intl;
10762
10729
  return intl.formatMessage(messages$B.paymentResource, {
10763
- paymentValue: data.key || formatMoney(data.amountPlanned, intl)
10730
+ paymentValue: data.key || experimentalComponents.formatMoney(data.amountPlanned, intl)
10764
10731
  });
10765
10732
  };
10766
10733
 
@@ -10926,7 +10893,7 @@ const mapPaymentToPreview = _ref => {
10926
10893
  fieldValue: resource.interfaceId
10927
10894
  }, {
10928
10895
  fieldName: intl.formatMessage(messages$A.amountPlannedLabel),
10929
- fieldValue: formatMoney(resource.amountPlanned, intl)
10896
+ fieldValue: experimentalComponents.formatMoney(resource.amountPlanned, intl)
10930
10897
  }, {
10931
10898
  fieldName: intl.formatMessage(messages$A.paymentMethodInfoMethodLabel),
10932
10899
  fieldValue: resource.paymentMethodInfo?.method
@@ -10948,7 +10915,7 @@ const mapPaymentToPreview = _ref => {
10948
10915
  }, {
10949
10916
  fieldName: 'transactions',
10950
10917
  fieldValue: _mapInstanceProperty__default["default"](_context = resource.transactions).call(_context, transaction => _objectSpread$K(_objectSpread$K({}, transaction), {}, {
10951
- amount: transaction.amount && formatMoney(transaction.amount, intl),
10918
+ amount: transaction.amount && experimentalComponents.formatMoney(transaction.amount, intl),
10952
10919
  timestamp: formatDateTime('datetime', transaction.timestamp)
10953
10920
  }))
10954
10921
  }];
@@ -18,7 +18,7 @@ import camelCase from 'lodash/camelCase';
18
18
  import get from 'lodash/get';
19
19
  import { useQuery } from '@apollo/client/react/hooks';
20
20
  import _URLSearchParams from '@babel/runtime-corejs3/core-js-stable/url-search-params';
21
- import { defineMessages, useIntl, FormattedMessage, FormattedNumber, IntlProvider } from 'react-intl';
21
+ import { defineMessages, useIntl, FormattedMessage, IntlProvider } from 'react-intl';
22
22
  import { useCountries, applyTransformedLocalizedFields, formatLocalizedString } from '@commercetools-frontend/l10n';
23
23
  import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
24
24
  import { Text, Link, designTokens, Spacings, FlatButton, Tooltip, LoadingSpinner, IconButton, CollapsiblePanel, Grid, FieldLabel, EyeIcon, DataTable, Stamp, Avatar, CodeViewIcon, UserLinearIcon, SwitcherIcon, ExternalLinkIcon, FilterIcon, ContentNotification, Card, DiamondIcon, SelectInput, DateRangeInput, PrimaryButton, AsyncSelectInput, utils, SearchSelectInput, selectUtils, InformationIcon, TextInput, DataTableManager, DataTableManagerProvider, SecondaryButton, Pagination, UserFilledIcon, UsersIcon, ImportIcon, LeadingIcon, customProperties, CheckActiveIcon, CheckInactiveIcon, Constraints, VerifiedIcon, ListWithSearchIcon, DotIcon } from '@commercetools-frontend/ui-kit';
@@ -31,6 +31,7 @@ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
31
31
  import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
32
32
  import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
33
33
  import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
34
+ import { formatMoney, PRECISION_TYPES } from '@commercetools-frontend/experimental-components';
34
35
  import groupBy from 'lodash/groupBy';
35
36
  import 'common-tags/lib/oneLine';
36
37
  import moment from 'moment-timezone';
@@ -79,7 +80,7 @@ import { oneLineTrim } from 'common-tags';
79
80
  import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
80
81
 
81
82
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
82
- var version = "9.3.0";
83
+ var version = "9.3.2";
83
84
 
84
85
  var fetchFeatureStatusQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchFeatureStatusQuery" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allFeatures" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 84, source: { body: "query FetchFeatureStatusQuery {\n allFeatures {\n name\n value\n reason\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
85
86
  /**
@@ -1497,8 +1498,8 @@ const AddOrRemoveAssetPresenter = props => {
1497
1498
  };
1498
1499
  AddOrRemoveAssetPresenter.displayName = 'AddOrRemoveAssetPresenter';
1499
1500
 
1500
- function ownKeys$21(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1501
- function _objectSpread$21(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$21(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$21(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1501
+ function ownKeys$20(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1502
+ function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$20(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$20(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1502
1503
  /**
1503
1504
  * Maps custom type fields object property into an array
1504
1505
  *
@@ -1523,13 +1524,13 @@ function transformCustomTypeValue(value) {
1523
1524
  }
1524
1525
  const mapCustomTypeFieldsToArray = value => {
1525
1526
  var _context;
1526
- return _objectSpread$21(_objectSpread$21({}, value), {}, {
1527
+ return _objectSpread$20(_objectSpread$20({}, value), {}, {
1527
1528
  fields: value?.fields ? _mapInstanceProperty(_context = _Object$entries(value.fields)).call(_context, _ref => {
1528
1529
  let _ref2 = _slicedToArray(_ref, 2),
1529
1530
  key = _ref2[0],
1530
1531
  entry = _ref2[1];
1531
1532
  const entryValue = entry.value !== undefined ? entry.value : entry;
1532
- return _objectSpread$21(_objectSpread$21({}, entry), {}, {
1533
+ return _objectSpread$20(_objectSpread$20({}, entry), {}, {
1533
1534
  name: key,
1534
1535
  value: transformCustomTypeValue(entryValue)
1535
1536
  });
@@ -1607,30 +1608,6 @@ const ComposedChange = props => jsx("div", {
1607
1608
  });
1608
1609
  ComposedChange.displayName = 'ComposedChange';
1609
1610
 
1610
- const PRECISION_TYPES = {
1611
- highPrecision: 'highPrecision',
1612
- centPrecision: 'centPrecision'
1613
- };
1614
-
1615
- function ownKeys$20(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1616
- function _objectSpread$20(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$20(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$20(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1617
- function getFractionedAmount(moneyValue) {
1618
- const _moneyValue$fractionD = moneyValue.fractionDigits,
1619
- fractionDigits = _moneyValue$fractionD === void 0 ? 2 : _moneyValue$fractionD;
1620
-
1621
- // the amount should be available on preciseAmount for highPrecision
1622
- const amount = moneyValue.type === PRECISION_TYPES.highPrecision ? moneyValue.preciseAmount : moneyValue.centAmount;
1623
- return amount / 10 ** fractionDigits;
1624
- }
1625
- function formatMoney(moneyValue, intl, options) {
1626
- if (moneyValue === null) return;
1627
- return intl.formatNumber(getFractionedAmount(moneyValue), _objectSpread$20({
1628
- style: 'currency',
1629
- currency: moneyValue.currencyCode,
1630
- minimumFractionDigits: moneyValue.fractionDigits
1631
- }, options));
1632
- }
1633
-
1634
1611
  /**
1635
1612
  * Maps a RESOURCE_TYPE_ID (kebab-case) to the corresponding RESOURCE_TYPE (PascalCase).
1636
1613
  * Returns `undefined` when the mapping does not exist.
@@ -4520,14 +4497,15 @@ LocalizedChangePresenter.displayName = 'LocalizedChangePresenter';
4520
4497
  */
4521
4498
  const MoneyPresenter = props => {
4522
4499
  const value = props.value;
4523
- if (!value || !value.currencyCode || value.centAmount === undefined) {
4500
+ const intl = useIntl();
4501
+ if (!value || !value.currencyCode) {
4524
4502
  return null;
4525
4503
  }
4526
- const amount = value.centAmount / Math.pow(10, value.fractionDigits || 2);
4527
- return jsx(FormattedNumber, {
4528
- value: amount,
4529
- style: "currency",
4530
- currency: value.currencyCode
4504
+ const isHighPrecision = value.type === PRECISION_TYPES.highPrecision;
4505
+ const isMissingRequiredAmount = isHighPrecision ? value.preciseAmount === undefined : value.centAmount === undefined;
4506
+ if (isMissingRequiredAmount) return null;
4507
+ return jsx(Fragment, {
4508
+ children: formatMoney(value, intl)
4531
4509
  });
4532
4510
  };
4533
4511
  MoneyPresenter.displayName = 'MoneyPresenter';
@@ -5366,10 +5344,7 @@ function ProductAddRemovePricePresenter(props) {
5366
5344
  })), jsx("div", {
5367
5345
  css: changeValueContainerStyles,
5368
5346
  children: _mapInstanceProperty(priceValue).call(priceValue, v => jsx("div", {
5369
- children: v.value ? intl.formatNumber(v.value.centAmount / 100, {
5370
- style: 'currency',
5371
- currency: v.value.currencyCode
5372
- }) : jsx(NoValueLabel, {})
5347
+ children: v.value ? formatMoney(v.value, intl) : jsx(NoValueLabel, {})
5373
5348
  }, `${v.id}`))
5374
5349
  })]
5375
5350
  });
@@ -7353,6 +7328,7 @@ function ShippingRatePresenter(props) {
7353
7328
  var _context;
7354
7329
  const change = props.change,
7355
7330
  value = props.value;
7331
+ const intl = useIntl();
7356
7332
  const shippingMethodChange = change;
7357
7333
  const rateValue = value;
7358
7334
  if (!rateValue) {
@@ -7376,21 +7352,13 @@ function ShippingRatePresenter(props) {
7376
7352
  children: [rateValue.price && jsx("div", {
7377
7353
  children: jsx(FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRatePriceLabel), {}, {
7378
7354
  values: {
7379
- price: jsx(FormattedNumber, {
7380
- value: rateValue.price.centAmount / Math.pow(10, rateValue.price.fractionDigits || 2),
7381
- style: "currency",
7382
- currency: rateValue.price.currencyCode
7383
- }, "price")
7355
+ price: formatMoney(rateValue.price, intl)
7384
7356
  }
7385
7357
  }))
7386
7358
  }), rateValue.freeAbove && jsx("div", {
7387
7359
  children: jsx(FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.shippingRateFreeAboveLabel), {}, {
7388
7360
  values: {
7389
- freeAbove: jsx(FormattedNumber, {
7390
- value: rateValue.freeAbove.centAmount / Math.pow(10, rateValue.freeAbove.fractionDigits || 2),
7391
- style: "currency",
7392
- currency: rateValue.freeAbove.currencyCode
7393
- }, "freeAbove")
7361
+ freeAbove: formatMoney(rateValue.freeAbove, intl)
7394
7362
  }
7395
7363
  }))
7396
7364
  }), rateValue.tiers && rateValue.tiers.length > 0 && jsxs("div", {
@@ -7400,11 +7368,10 @@ function ShippingRatePresenter(props) {
7400
7368
  css: changeValueContainerStyles,
7401
7369
  children: [isCartValueTier(tier) && jsx(FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartValueShippingRateTierLabel), {}, {
7402
7370
  values: {
7403
- minimumCentAmount: jsx(FormattedNumber, {
7404
- value: tier.minimumCentAmount / 100,
7405
- style: "currency",
7406
- currency: rateValue.price.currencyCode
7407
- }, "minimumCentAmount")
7371
+ minimumCentAmount: formatMoney({
7372
+ currencyCode: rateValue.price.currencyCode,
7373
+ centAmount: tier.minimumCentAmount
7374
+ }, intl)
7408
7375
  }
7409
7376
  })), isCartClassificationTier(tier) && jsx(FormattedMessage, _objectSpread$$(_objectSpread$$({}, messages$13.cartClassificationShippingRateTierLabel), {}, {
7410
7377
  values: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/change-history",
3
3
  "description": "Change history shared components and utilities",
4
- "version": "9.3.0",
4
+ "version": "9.3.2",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -25,7 +25,7 @@
25
25
  "deep-diff": "1.0.2",
26
26
  "fast-equals": "4.0.3",
27
27
  "formik": "2.4.6",
28
- "lodash": "4.17.21",
28
+ "lodash": "4.18.1",
29
29
  "memoize-one": "6.0.0",
30
30
  "moment": "2.30.1",
31
31
  "moment-timezone": "0.5.45",
@@ -36,17 +36,18 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/plugin-transform-runtime": "7.24.7",
39
- "@commercetools-frontend/application-components": "25.1.0",
40
- "@commercetools-frontend/application-shell": "25.1.0",
41
- "@commercetools-frontend/application-shell-connectors": "25.1.0",
42
- "@commercetools-frontend/assets": "25.1.0",
43
- "@commercetools-frontend/constants": "25.1.0",
44
- "@commercetools-frontend/i18n": "25.1.0",
45
- "@commercetools-frontend/l10n": "25.1.0",
46
- "@commercetools-frontend/mc-scripts": "25.1.0",
47
- "@commercetools-frontend/permissions": "25.1.0",
48
- "@commercetools-frontend/sdk": "25.1.0",
49
- "@commercetools-frontend/sentry": "25.1.0",
39
+ "@commercetools-frontend/application-components": "27.0.0",
40
+ "@commercetools-frontend/application-shell": "27.0.0",
41
+ "@commercetools-frontend/application-shell-connectors": "27.0.0",
42
+ "@commercetools-frontend/assets": "27.0.0",
43
+ "@commercetools-frontend/constants": "27.0.0",
44
+ "@commercetools-frontend/experimental-components": "8.2.0",
45
+ "@commercetools-frontend/i18n": "27.0.0",
46
+ "@commercetools-frontend/l10n": "27.0.0",
47
+ "@commercetools-frontend/mc-scripts": "27.0.0",
48
+ "@commercetools-frontend/permissions": "27.0.0",
49
+ "@commercetools-frontend/sdk": "27.0.0",
50
+ "@commercetools-frontend/sentry": "27.0.0",
50
51
  "@commercetools-frontend/ui-kit": "20.0.0",
51
52
  "@commercetools-uikit/design-system": "20.0.0",
52
53
  "@commercetools-uikit/filters": "20.0.0",
@@ -73,16 +74,17 @@
73
74
  "rimraf": "5.0.7"
74
75
  },
75
76
  "peerDependencies": {
76
- "@commercetools-frontend/application-components": "24.x || 25.x",
77
- "@commercetools-frontend/application-shell": "24.x || 25.x",
78
- "@commercetools-frontend/application-shell-connectors": "24.x || 25.x",
79
- "@commercetools-frontend/assets": "24.x || 25.x",
80
- "@commercetools-frontend/constants": "24.x || 25.x",
81
- "@commercetools-frontend/i18n": "24.x || 25.x",
82
- "@commercetools-frontend/l10n": "24.x || 25.x",
83
- "@commercetools-frontend/permissions": "24.x || 25.x",
84
- "@commercetools-frontend/sdk": "24.x || 25.x",
85
- "@commercetools-frontend/sentry": "24.x || 25.x",
77
+ "@commercetools-frontend/application-components": "24.x || 25.x || 27.x",
78
+ "@commercetools-frontend/application-shell": "24.x || 25.x || 27.x",
79
+ "@commercetools-frontend/application-shell-connectors": "24.x || 25.x || 27.x",
80
+ "@commercetools-frontend/assets": "24.x || 25.x || 27.x",
81
+ "@commercetools-frontend/constants": "24.x || 25.x || 27.x",
82
+ "@commercetools-frontend/experimental-components": "8.x",
83
+ "@commercetools-frontend/i18n": "24.x || 25.x || 27.x",
84
+ "@commercetools-frontend/l10n": "24.x || 25.x || 27.x",
85
+ "@commercetools-frontend/permissions": "24.x || 25.x || 27.x",
86
+ "@commercetools-frontend/sdk": "24.x || 25.x || 27.x",
87
+ "@commercetools-frontend/sentry": "24.x || 25.x || 27.x",
86
88
  "@commercetools-frontend/ui-kit": "^19.22.6 || 20.x",
87
89
  "@commercetools-uikit/design-system": "^19.22.6 || 20.x",
88
90
  "@commercetools-uikit/filters": "^19.22.6 || 20.x",