@pisell/private-materials 6.12.142 → 6.12.143

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.
@@ -10,21 +10,27 @@ function resolveBookingCommitCount(data) {
10
10
  /**
11
11
  * 将 SkuDetailModal 的组件确认协议补齐为 OS 商品转换协议。
12
12
  *
13
- * SkuDetailModal 为了兼容旧详情页,把本次 SKU 选择保存在
14
- * `_extend.skuValue / _extend.other`;而 UnifiedBookingSales 最终调用的
15
- * `transformBaseProductToOrderProduct` 只读取顶层的 variant / option / bundle。
13
+ * SkuDetailModal 为了兼容旧详情页,把本次 SKU 选择和备注保存在
14
+ * `_extend.skuValue / _extend.other / _extend.note`;而 UnifiedBookingSales
15
+ * 最终调用的 `transformBaseProductToOrderProduct` 只读取对应的顶层字段。
16
16
  * 这里是两个协议的边界,因此只在提交预约前展开一次,避免让 Flow 组件
17
- * 直接依赖购物车的 `product_sku / product_bundle` 持久化结构。
17
+ * 直接依赖购物车的持久化结构。
18
18
  */
19
19
  function normalizeAvailabilityOrderProductSku(orderProduct) {
20
20
  const extend = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct._extend;
21
+ const normalized = _objectSpread2({}, orderProduct);
22
+ const hasTopLevelNote = Object.prototype.hasOwnProperty.call(orderProduct, "note");
23
+ const hasExtendNote = Object.prototype.hasOwnProperty.call(extend || {}, "note");
24
+ if (hasTopLevelNote || hasExtendNote) {
25
+ var _ref3, _orderProduct$note;
26
+ normalized.note = String((_ref3 = (_orderProduct$note = orderProduct.note) !== null && _orderProduct$note !== void 0 ? _orderProduct$note : extend === null || extend === void 0 ? void 0 : extend.note) !== null && _ref3 !== void 0 ? _ref3 : "");
27
+ }
21
28
  const skuValue = resolveSkuValueCandidates([
22
29
  extend === null || extend === void 0 ? void 0 : extend.skuValue,
23
30
  extend === null || extend === void 0 ? void 0 : extend._skuValue,
24
31
  extend === null || extend === void 0 ? void 0 : extend.other
25
32
  ]);
26
- if (!skuValue || typeof skuValue !== "object") return orderProduct;
27
- const normalized = _objectSpread2({}, orderProduct);
33
+ if (!skuValue || typeof skuValue !== "object") return normalized;
28
34
  if (Object.prototype.hasOwnProperty.call(skuValue, "product_variant_id")) {
29
35
  var _skuValue$product_var;
30
36
  normalized.product_variant_id = (_skuValue$product_var = skuValue.product_variant_id) !== null && _skuValue$product_var !== void 0 ? _skuValue$product_var : 0;
@@ -10,21 +10,27 @@ function resolveBookingCommitCount(data) {
10
10
  /**
11
11
  * 将 SkuDetailModal 的组件确认协议补齐为 OS 商品转换协议。
12
12
  *
13
- * SkuDetailModal 为了兼容旧详情页,把本次 SKU 选择保存在
14
- * `_extend.skuValue / _extend.other`;而 UnifiedBookingSales 最终调用的
15
- * `transformBaseProductToOrderProduct` 只读取顶层的 variant / option / bundle。
13
+ * SkuDetailModal 为了兼容旧详情页,把本次 SKU 选择和备注保存在
14
+ * `_extend.skuValue / _extend.other / _extend.note`;而 UnifiedBookingSales
15
+ * 最终调用的 `transformBaseProductToOrderProduct` 只读取对应的顶层字段。
16
16
  * 这里是两个协议的边界,因此只在提交预约前展开一次,避免让 Flow 组件
17
- * 直接依赖购物车的 `product_sku / product_bundle` 持久化结构。
17
+ * 直接依赖购物车的持久化结构。
18
18
  */
19
19
  function normalizeAvailabilityOrderProductSku(orderProduct) {
20
20
  const extend = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct._extend;
21
+ const normalized = require_objectSpread2._objectSpread2({}, orderProduct);
22
+ const hasTopLevelNote = Object.prototype.hasOwnProperty.call(orderProduct, "note");
23
+ const hasExtendNote = Object.prototype.hasOwnProperty.call(extend || {}, "note");
24
+ if (hasTopLevelNote || hasExtendNote) {
25
+ var _ref3, _orderProduct$note;
26
+ normalized.note = String((_ref3 = (_orderProduct$note = orderProduct.note) !== null && _orderProduct$note !== void 0 ? _orderProduct$note : extend === null || extend === void 0 ? void 0 : extend.note) !== null && _ref3 !== void 0 ? _ref3 : "");
27
+ }
21
28
  const skuValue = require_resolveSkuValue.resolveSkuValueCandidates([
22
29
  extend === null || extend === void 0 ? void 0 : extend.skuValue,
23
30
  extend === null || extend === void 0 ? void 0 : extend._skuValue,
24
31
  extend === null || extend === void 0 ? void 0 : extend.other
25
32
  ]);
26
- if (!skuValue || typeof skuValue !== "object") return orderProduct;
27
- const normalized = require_objectSpread2._objectSpread2({}, orderProduct);
33
+ if (!skuValue || typeof skuValue !== "object") return normalized;
28
34
  if (Object.prototype.hasOwnProperty.call(skuValue, "product_variant_id")) {
29
35
  var _skuValue$product_var;
30
36
  normalized.product_variant_id = (_skuValue$product_var = skuValue.product_variant_id) !== null && _skuValue$product_var !== void 0 ? _skuValue$product_var : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.142",
3
+ "version": "6.12.143",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -69,10 +69,10 @@
69
69
  "react-zoom-pan-pinch": "^3.7.0",
70
70
  "styled-components": "^6.0.0-rc.3",
71
71
  "use-sync-external-store": "^1.6.0",
72
- "@pisell/materials": "6.12.38",
73
72
  "@pisell/utils": "3.0.4",
74
- "@pisell/date-picker": "3.0.10",
75
- "@pisell/icon": "0.0.11"
73
+ "@pisell/icon": "0.0.11",
74
+ "@pisell/materials": "6.12.38",
75
+ "@pisell/date-picker": "3.0.10"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": "^18.0.0",