@pisell/private-materials 6.12.358 → 6.12.360
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
- package/es/components/bigSale/components/ProductList/index.js +0 -1
- package/es/components/bigSale/components/TimeBar/index.js +0 -1
- package/es/components/bigSale/dialog.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +2 -2
- package/es/components/bigSale/templates/Kiosk/index.js +0 -1
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/index.js +0 -2
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellSalesProductCard/index.js +8 -3
- package/es/plus/saleDetail/Base.js +0 -1
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
- package/es/plus/saleDetail/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/index.js +0 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/skuDetailModal/index.js +33 -5
- package/es/pro/skuDetailModal/noteDiagnostics.js +110 -0
- package/lib/components/bigSale/index.js +2 -1
- package/lib/plus/pisellSalesProductCard/index.js +8 -3
- package/lib/pro/skuDetailModal/index.js +33 -5
- package/lib/pro/skuDetailModal/noteDiagnostics.js +110 -0
- package/package.json +2 -2
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -54
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
-
import "../../../../plus/salesSdk/index.js";
|
|
4
3
|
import dayjs from "dayjs";
|
|
5
4
|
import { useCallback, useEffect, useState } from "react";
|
|
6
5
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -15,7 +15,6 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
|
|
|
15
15
|
import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAddToCartToast.js";
|
|
16
16
|
import { mergeBookingsForDisplay } from "../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js";
|
|
17
17
|
import useSalesSdkGlobalScanHandler from "../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
|
|
18
|
-
import "../../../../plus/salesSdk/index.js";
|
|
19
18
|
import { buildBigSaleProductListPreferencesKey, readBigSaleProductListPreferences, readStoredBigSaleProductListPreferences, removeBigSaleProductListPreferences, resolveBigSaleAutoProductListPreferences, writeBigSaleProductListPreferences } from "../../utils/productListPreferences.js";
|
|
20
19
|
import { resolveBigSaleProductDisplayConfig, useBigSaleProductListConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
21
20
|
import locales_default from "../../locales/index.js";
|
|
@@ -5,7 +5,6 @@ import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { setBookingTimeSelectionIntent } from "../../../../plus/salesSdk/utils/bookingTimeSelection.js";
|
|
7
7
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
8
|
-
import "../../../../plus/salesSdk/index.js";
|
|
9
8
|
import locales_default from "../../locales/index.js";
|
|
10
9
|
import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
|
|
11
10
|
import dayjs from "dayjs";
|
|
@@ -6,7 +6,6 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
6
6
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
7
7
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
8
8
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
9
|
-
import "../../plus/salesSdk/index.js";
|
|
10
9
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
11
10
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
12
11
|
import BigSale from "./index.js";
|
|
@@ -4,7 +4,6 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
-
import "../../../plus/salesSdk/index.js";
|
|
8
7
|
import { useMemo } from "react";
|
|
9
8
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
10
9
|
/**
|
|
@@ -3,7 +3,6 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
-
import "../../../plus/salesSdk/index.js";
|
|
7
6
|
import { isPersistedBigSaleOrderId } from "../utils/orderIdentity.js";
|
|
8
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
9
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
@@ -8,7 +8,6 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
-
import "../../plus/salesSdk/index.js";
|
|
12
11
|
import { resolveCustomerDetailAppearance } from "../../pro/skuDetailModal/customerDetailPolicy.js";
|
|
13
12
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
14
13
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
@@ -125,7 +124,8 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
125
124
|
variant
|
|
126
125
|
]);
|
|
127
126
|
const isPosProductSelectionFlow = resolvedTemplate !== "kiosk" && isProductSelectionFlow;
|
|
128
|
-
const
|
|
127
|
+
const resolvedSalesPlatform = resolveKioskPlatformSource(otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform, platform);
|
|
128
|
+
const salesRuntimePlatform = String(resolvedSalesPlatform !== null && resolvedSalesPlatform !== void 0 ? resolvedSalesPlatform : "").trim().toLowerCase() === "webpos" ? "pos" : resolvedSalesPlatform;
|
|
129
129
|
const fulfillmentOtherParams = useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({ enforceSingleBookingStartDate: false }, otherParams), salesRuntimePlatform ? { platform: salesRuntimePlatform } : {}), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [
|
|
130
130
|
otherParams,
|
|
131
131
|
salesRuntimePlatform,
|
|
@@ -12,7 +12,6 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
|
|
|
12
12
|
import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
|
|
13
13
|
import { isFulfillmentTimingBooking } from "../../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
|
|
14
14
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
15
|
-
import "../../../../plus/salesSdk/index.js";
|
|
16
15
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
17
16
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
18
17
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,7 +2,6 @@ import useEngineContext from "../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
-
import "../../plus/salesSdk/index.js";
|
|
6
5
|
import { useEffect, useRef } from "react";
|
|
7
6
|
import { useMemoizedFn } from "ahooks";
|
|
8
7
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -90,7 +90,6 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
90
90
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
91
91
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
92
92
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
93
|
-
import "./plus/salesSdk/index.js";
|
|
94
93
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
95
94
|
import ResponsiveWrapper from "./components/list/ResponsiveWrapper.js";
|
|
96
95
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
@@ -145,7 +144,6 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
145
144
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
146
145
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
147
146
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
148
|
-
import "./plus/pisellReservation/index.js";
|
|
149
147
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
150
148
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
151
149
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -280,4 +280,4 @@ function attachSelectedSettlement(item, selectedSettlement) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
|
-
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct,
|
|
283
|
+
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds,
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE,
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels,
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -2,6 +2,7 @@ import useEngineContext from "../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import NumericStepper from "../../pro/NumericStepper/index.js";
|
|
4
4
|
import index from "../productSelect/components/pisellPriceText/index.js";
|
|
5
|
+
import { resolveProductPricePresentation } from "../productSelect/pricing/pricePresentation.js";
|
|
5
6
|
import SettlementPriceList from "../multiCurrencySettlement/SettlementPriceList.js";
|
|
6
7
|
import locales_default from "./locales.js";
|
|
7
8
|
import { cubicBezier } from "./utils.js";
|
|
@@ -58,7 +59,7 @@ function isNormalProduct(product) {
|
|
|
58
59
|
return !(hasOption || hasBundle || hasVariant || requiresDetail);
|
|
59
60
|
}
|
|
60
61
|
const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction = false, value, selectedQuantity: selectedQuantityProp, disabled = false, soldOut = false, purchaseDisabled = false, stepperProps, optionsText, skuCardConfig, cartElementId, style, className, settlementPriceRows, onChange, onClick }) => {
|
|
61
|
-
var _context$appHelper$ut, _product$
|
|
62
|
+
var _context$appHelper$ut, _product$price, _product$metadata2, _pricePresentation$am, _value$num, _stepperProps$min3, _stepperProps$step;
|
|
62
63
|
const context = useEngineContext();
|
|
63
64
|
locales.init(locales_default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
64
65
|
const normalProduct = useMemo(() => !requiresOptions && isNormalProduct(product), [product, requiresOptions]);
|
|
@@ -69,6 +70,7 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction =
|
|
|
69
70
|
const soldOutIcon = String(locales.locale || "").toLowerCase().startsWith("zh") ? SOLD_OUT_ICON_URLS.cn : SOLD_OUT_ICON_URLS.en;
|
|
70
71
|
const title = resolveText((product === null || product === void 0 ? void 0 : product.title) || (product === null || product === void 0 ? void 0 : product.name));
|
|
71
72
|
const textCover = getTextCover(title);
|
|
73
|
+
const pricePresentation = (settlementPriceRows === null || settlementPriceRows === void 0 ? void 0 : settlementPriceRows.length) ? void 0 : resolveProductPricePresentation(product, { price: (_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : 0 });
|
|
72
74
|
const promotionTags = useMemo(() => {
|
|
73
75
|
var _product$metadata;
|
|
74
76
|
const rawPromotionTags = (product === null || product === void 0 ? void 0 : product._promotionTags) || (product === null || product === void 0 || (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata._promotionTags) || [];
|
|
@@ -167,8 +169,11 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction =
|
|
|
167
169
|
src: soldOutIcon,
|
|
168
170
|
alt: ""
|
|
169
171
|
})) : null), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__content` }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__title` }, title), (settlementPriceRows === null || settlementPriceRows === void 0 ? void 0 : settlementPriceRows.length) ? /* @__PURE__ */ React.createElement(SettlementPriceList, { rows: settlementPriceRows }) : /* @__PURE__ */ React.createElement(index, {
|
|
170
|
-
value: (
|
|
171
|
-
isMini:
|
|
172
|
+
value: (_pricePresentation$am = pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.amount) !== null && _pricePresentation$am !== void 0 ? _pricePresentation$am : 0,
|
|
173
|
+
isMini: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.qualifier) === "from",
|
|
174
|
+
precision: pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.precision,
|
|
175
|
+
hideDecimalForWholeNumbers: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.precision) ? false : void 0,
|
|
176
|
+
suffix: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.unit) ? /* @__PURE__ */ React.createElement("span", null, "/", pricePresentation.unit) : void 0
|
|
172
177
|
}), promotionTags.length ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__promotions` }, promotionTags.map((promotionTag, index) => /* @__PURE__ */ React.createElement("span", {
|
|
173
178
|
key: `${promotionTag}-${index}`,
|
|
174
179
|
className: `${PREFIX}__promotion-tag`
|
|
@@ -13,7 +13,6 @@ import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
|
13
13
|
import locales_default from "./locales.js";
|
|
14
14
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
15
15
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
16
|
-
import "../salesSdk/index.js";
|
|
17
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
18
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
19
18
|
import { SaleDetailTemplateRenderer } from "./tmpl/index.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
-
import "../../../../salesSdk/index.js";
|
|
5
4
|
import { useMemo } from "react";
|
|
6
5
|
import { useMemoizedFn } from "ahooks";
|
|
7
6
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -4,7 +4,6 @@ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.
|
|
|
4
4
|
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
|
|
5
5
|
import useLogger from "../../../../hooks/useLogger.js";
|
|
6
6
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
7
|
-
import "../../../salesSdk/index.js";
|
|
8
7
|
import { invokeLocalReceiptPrint, resolveLocalReceiptPrintModule, resolveSaleDetailOrderIdFromSales } from "./utils.js";
|
|
9
8
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
10
9
|
import { EBizPrintType } from "./types.js";
|
|
@@ -10,7 +10,6 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
10
10
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
11
11
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
12
12
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
13
|
-
import "../../../salesSdk/index.js";
|
|
14
13
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
15
14
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
16
15
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -5,7 +5,6 @@ import { isAppliedPaymentRecord } from "../../../salesSdk/utils/paymentStatus.js
|
|
|
5
5
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
8
|
-
import "../../../salesSdk/index.js";
|
|
9
8
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
10
9
|
import React, { memo, useMemo } from "react";
|
|
11
10
|
import { formatAmount, locales } from "@pisell/utils";
|
|
@@ -5,7 +5,6 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
5
5
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
6
6
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
7
7
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
8
|
-
import "../salesSdk/index.js";
|
|
9
8
|
import Base_default from "./Base.js";
|
|
10
9
|
import { resolveSaleDetailOsProps } from "./osProps.js";
|
|
11
10
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../../../salesSdk/index.js";
|
|
5
4
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
6
5
|
import { DishGroupView } from "./DishGroupView.js";
|
|
7
6
|
import dayjs from "dayjs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../salesSdk/index.js";
|
|
5
4
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
6
5
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
7
6
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay,
|
|
105
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethodType,
|
|
1
|
+
import { AuthMethodType, VerificationMethod } from "./shared/types.js";
|
|
2
2
|
import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
|
|
3
3
|
import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
|
|
4
|
-
import { AuthModal } from "./AuthModal.js";
|
|
4
|
+
import { AuthModal, AuthModalProps } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig,
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -25,6 +25,7 @@ import locales_default$1 from "./flow/locales.js";
|
|
|
25
25
|
import { isRememberTimeProduct, isRememberedTimeIntent, requiresManualTimeSelection } from "./flow/rememberTime.js";
|
|
26
26
|
import { resolveDetailAppearance } from "./appearances/index.js";
|
|
27
27
|
import useToast$1 from "../../hooks/useToast.js";
|
|
28
|
+
import { createSkuNoteDiagnostics } from "./noteDiagnostics.js";
|
|
28
29
|
import SkuDetailLoadingPanel from "./LoadingPanel.js";
|
|
29
30
|
import SkuDetailCollapsibleSection from "./components/CollapsibleSection/index.js";
|
|
30
31
|
import { getProductSkuFromWeighingValue, getWeighedUnitPrice, getWeighingValueFromProductSku, hasPositiveNetWeight, isWeighingProduct, resolveActiveSkuValue } from "./components/weighing/utils.js";
|
|
@@ -240,6 +241,13 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
240
241
|
const selectionFlowCanScrollDownRef = useRef(false);
|
|
241
242
|
const Toast = useToast$1();
|
|
242
243
|
const logger = useLogger();
|
|
244
|
+
const loggerRef = useRef(logger);
|
|
245
|
+
loggerRef.current = logger;
|
|
246
|
+
const noteDiagnosticsRef = useRef(null);
|
|
247
|
+
useEffect(() => () => {
|
|
248
|
+
var _noteDiagnosticsRef$c;
|
|
249
|
+
return (_noteDiagnosticsRef$c = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c === void 0 ? void 0 : _noteDiagnosticsRef$c.stop();
|
|
250
|
+
}, []);
|
|
243
251
|
/**
|
|
244
252
|
* @description SKUOptionsSelection ref,用于触发内部校验与读取最终值
|
|
245
253
|
*/
|
|
@@ -923,7 +931,9 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
923
931
|
},
|
|
924
932
|
open: function() {
|
|
925
933
|
var _ref17 = _asyncToGenerator(function* (data) {
|
|
926
|
-
var _skuDetailConfig$enab, _skuDetailConfig$isSh, _skuDetailConfig$isSh2, _skuDetailConfig$isSh3, _skuDetailConfig$isSh4, _skuDetailConfig$isSh5, _skuDetailConfig$hide, _skuDetailConfig$isSh6, _skuDetailConfig$isSh7, _skuDetailConfig$isSh8, _skuDetailConfig$exte, _skuDetailConfig$useC, _skuDetailConfig$cust, _skuDetailConfig$isCa, _skuDetailConfig, _skuDetailConfig2, _data$bundle_group, _data$_extend, _data$_extend2, _data$discount_list, _ref15, _data$_extend3, _data$_extend4, _data$_extend5, _data$discount_list$f, _data$discount_list2, _ref16, _data$_extend$priceOv, _data$_extend7;
|
|
934
|
+
var _noteDiagnosticsRef$c2, _product_id, _skuDetailConfig$enab, _skuDetailConfig$isSh, _skuDetailConfig$isSh2, _skuDetailConfig$isSh3, _skuDetailConfig$isSh4, _skuDetailConfig$isSh5, _skuDetailConfig$hide, _skuDetailConfig$isSh6, _skuDetailConfig$isSh7, _skuDetailConfig$isSh8, _skuDetailConfig$exte, _skuDetailConfig$useC, _skuDetailConfig$cust, _skuDetailConfig$isCa, _skuDetailConfig, _skuDetailConfig2, _data$bundle_group, _data$_extend, _data$_extend2, _data$discount_list, _ref15, _data$_extend3, _data$_extend4, _data$_extend5, _data$discount_list$f, _data$discount_list2, _ref16, _data$_extend$priceOv, _data$_extend7;
|
|
935
|
+
(_noteDiagnosticsRef$c2 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c2 === void 0 || _noteDiagnosticsRef$c2.stop();
|
|
936
|
+
noteDiagnosticsRef.current = createSkuNoteDiagnostics(() => loggerRef.current, (_product_id = data.product_id) !== null && _product_id !== void 0 ? _product_id : data.id, "date" in data && !("_extend" in data) ? "create" : "edit");
|
|
927
937
|
selectionFlowOpenedAtRef.current = dayjs().toISOString();
|
|
928
938
|
const currentTaskId = openTaskIdRef.current + 1;
|
|
929
939
|
openTaskIdRef.current = currentTaskId;
|
|
@@ -1250,6 +1260,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1250
1260
|
};
|
|
1251
1261
|
}(),
|
|
1252
1262
|
close: () => {
|
|
1263
|
+
var _noteDiagnosticsRef$c3;
|
|
1264
|
+
(_noteDiagnosticsRef$c3 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c3 === void 0 || _noteDiagnosticsRef$c3.stop();
|
|
1253
1265
|
openTaskIdRef.current += 1;
|
|
1254
1266
|
setOpen(false);
|
|
1255
1267
|
setDetailLoading(false);
|
|
@@ -1483,6 +1495,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1483
1495
|
* @description 关闭动画结束后再清空详情态,避免退出动画期间因 productData 为空闪回骨架屏。
|
|
1484
1496
|
*/
|
|
1485
1497
|
const resetModalStateAfterClose = useCallback(() => {
|
|
1498
|
+
var _noteDiagnosticsRef$c4;
|
|
1499
|
+
(_noteDiagnosticsRef$c4 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c4 === void 0 || _noteDiagnosticsRef$c4.stop();
|
|
1486
1500
|
setProductData(null);
|
|
1487
1501
|
setDetailLoading(false);
|
|
1488
1502
|
setNote("");
|
|
@@ -1506,6 +1520,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1506
1520
|
lateQuantityRevalidationTaskRef.current = null;
|
|
1507
1521
|
}, []);
|
|
1508
1522
|
const modalCloseAction = () => {
|
|
1523
|
+
var _noteDiagnosticsRef$c5;
|
|
1524
|
+
(_noteDiagnosticsRef$c5 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c5 === void 0 || _noteDiagnosticsRef$c5.stop();
|
|
1509
1525
|
openTaskIdRef.current += 1;
|
|
1510
1526
|
flowDateHydrationVersionRef.current += 1;
|
|
1511
1527
|
lateQuantityReviewStepIndexRef.current = null;
|
|
@@ -1528,7 +1544,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1528
1544
|
};
|
|
1529
1545
|
const handleConfirm = function() {
|
|
1530
1546
|
var _ref18 = _asyncToGenerator(function* (flowDraft) {
|
|
1531
|
-
var _bookingState$booking3, _selectionFlowRef$cur8, _selectionFlowService3;
|
|
1547
|
+
var _noteDiagnosticsRef$c6, _bookingState$booking3, _selectionFlowRef$cur8, _selectionFlowService3;
|
|
1548
|
+
(_noteDiagnosticsRef$c6 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c6 === void 0 || _noteDiagnosticsRef$c6.skuConfirm(note.length);
|
|
1532
1549
|
if (confirmDisabledRef.current) return false;
|
|
1533
1550
|
if (flowDraft && requiresManualTimeSelection(flowDraft)) return false;
|
|
1534
1551
|
if (isCustomSelectionFlow && !flowDraft) {
|
|
@@ -1850,17 +1867,28 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1850
1867
|
productData === null || productData === void 0 ? void 0 : productData._id,
|
|
1851
1868
|
productData === null || productData === void 0 ? void 0 : productData.id
|
|
1852
1869
|
]);
|
|
1870
|
+
const onOpenNote = () => {
|
|
1871
|
+
var _noteDiagnosticsRef$c7;
|
|
1872
|
+
(_noteDiagnosticsRef$c7 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c7 === void 0 || _noteDiagnosticsRef$c7.open(note.length);
|
|
1873
|
+
setNoteModalOpen(true);
|
|
1874
|
+
};
|
|
1853
1875
|
const onNoteConfirm = (note) => {
|
|
1876
|
+
var _noteDiagnosticsRef$c8;
|
|
1877
|
+
(_noteDiagnosticsRef$c8 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c8 === void 0 || _noteDiagnosticsRef$c8.confirm(note.length);
|
|
1854
1878
|
setNote(note);
|
|
1855
1879
|
updateCustomFlowDraft({ note }, ["note"]);
|
|
1856
1880
|
setNoteModalOpen(false);
|
|
1857
1881
|
};
|
|
1858
1882
|
const onNoteDelete = () => {
|
|
1883
|
+
var _noteDiagnosticsRef$c9;
|
|
1884
|
+
(_noteDiagnosticsRef$c9 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c9 === void 0 || _noteDiagnosticsRef$c9.stop();
|
|
1859
1885
|
setNote("");
|
|
1860
1886
|
updateCustomFlowDraft({ note: "" }, ["note"]);
|
|
1861
1887
|
setNoteModalOpen(false);
|
|
1862
1888
|
};
|
|
1863
1889
|
const onNoteCancel = () => {
|
|
1890
|
+
var _noteDiagnosticsRef$c10;
|
|
1891
|
+
(_noteDiagnosticsRef$c10 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c10 === void 0 || _noteDiagnosticsRef$c10.stop();
|
|
1864
1892
|
setNoteModalOpen(false);
|
|
1865
1893
|
};
|
|
1866
1894
|
const handleManualPriceChange = () => {
|
|
@@ -1996,7 +2024,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
1996
2024
|
max: 99999
|
|
1997
2025
|
})), note && /* @__PURE__ */ React.createElement("div", { className: "note-section note-section-right" }, /* @__PURE__ */ React.createElement("div", { className: "note-label" }, locales.getText("pisell2.text.sku.detail.modal.note")), /* @__PURE__ */ React.createElement("div", {
|
|
1998
2026
|
className: "note-text",
|
|
1999
|
-
onClick:
|
|
2027
|
+
onClick: onOpenNote
|
|
2000
2028
|
}, note))), /* @__PURE__ */ React.createElement("div", { className: "price-summary-section" }, !isVirtualOnlySettlement ? /* @__PURE__ */ React.createElement("div", { className: "price-item" }, /* @__PURE__ */ React.createElement("div", null, locales.getText("pisell2.text.sku.detail.modal.subtotal")), /* @__PURE__ */ React.createElement("div", null, subtotalText)) : null, !isVirtualOnlySettlement ? /* @__PURE__ */ React.createElement("div", { className: "price-item" }, /* @__PURE__ */ React.createElement("div", null, locales.getText("pisell2.text.sku.detail.modal.discount"), discountsCount > 0 && /* @__PURE__ */ React.createElement("span", { className: "price-item-danger" }, "\xA0(", discountsCount, ")")), /* @__PURE__ */ React.createElement("div", { className: "price-item-danger" }, discountsCount > 0 ? "-" : "", symbol, totalDiscounts)) : null, !isVirtualOnlySettlement && priceOverride !== null && typeof priceOverride !== "undefined" && /* @__PURE__ */ React.createElement("div", { className: "price-item" }, /* @__PURE__ */ React.createElement("div", { onClick: handleManualPriceChange }, locales.getText("pisell2.text.sku.detail.modal.manual.price.change"), /* @__PURE__ */ React.createElement("span", { className: "price-item-override" }, priceOverrideText)), /* @__PURE__ */ React.createElement("div", { className: "price-item-danger" }, priceChangeText)), /* @__PURE__ */ React.createElement("div", { className: "price-item-total" }, /* @__PURE__ */ React.createElement("div", { className: "price-item-total-label" }, locales.getText("pisell2.text.sku.detail.modal.total"), !isVirtualOnlySettlement ? /* @__PURE__ */ React.createElement("span", { className: "price-item-total-gst" }, "(", (productData === null || productData === void 0 ? void 0 : productData.is_charge_tax) ? locales.getText("pisell2.text.sku.detail.modal.gst.incl") : locales.getText("pisell2.text.sku.detail.modal.gst.excl"), ")") : null), /* @__PURE__ */ React.createElement("div", { className: "price-item-total-values" }, !isVirtualOnlySettlement ? /* @__PURE__ */ React.createElement("div", { className: "price-item-total-value" }, totalText) : null, virtualSettlementTotals.map(({ option, text }) => /* @__PURE__ */ React.createElement("div", {
|
|
2001
2029
|
key: `virtual:${String(option.currency_product_id || option.data_variant_id)}`,
|
|
2002
2030
|
className: `price-item-total-settlement-value${option.available === false ? " is-disabled" : ""}`,
|
|
@@ -2014,7 +2042,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
2014
2042
|
onCancel: handleCancel,
|
|
2015
2043
|
onRemove: handleRemove,
|
|
2016
2044
|
onManualPriceChange: handleManualPriceChange,
|
|
2017
|
-
onOpenNote
|
|
2045
|
+
onOpenNote,
|
|
2018
2046
|
onConfirm: () => {
|
|
2019
2047
|
handleConfirm();
|
|
2020
2048
|
}
|
|
@@ -2271,7 +2299,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant, confirmDisabled
|
|
|
2271
2299
|
type: "button",
|
|
2272
2300
|
className: "sku-detail-appearance__note",
|
|
2273
2301
|
disabled: appearanceConfirmPending,
|
|
2274
|
-
onClick:
|
|
2302
|
+
onClick: onOpenNote
|
|
2275
2303
|
}, note || locales.getText("pisell2.text.sku.detail.modal.btn.add.note")),
|
|
2276
2304
|
removeControl: !isCreateMode && skuDetailConfig.isShowRemove !== false && onRemove && /* @__PURE__ */ React.createElement("button", {
|
|
2277
2305
|
type: "button",
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region src/pro/skuDetailModal/noteDiagnostics.ts
|
|
2
|
+
const VIEWPORT_INTERVAL_MS = 250;
|
|
3
|
+
const MAX_VIEWPORT_EVENTS = 10;
|
|
4
|
+
/** SKU 内默认启用;不修改 NoteModal 接口或商品数据。 */
|
|
5
|
+
function createSkuNoteDiagnostics(getLogger, productId, mode) {
|
|
6
|
+
const startedAtMs = Date.now();
|
|
7
|
+
const traceId = `sku-note-${startedAtMs}-${Math.random().toString(36).slice(2)}`;
|
|
8
|
+
let seq = 0;
|
|
9
|
+
let noteLength = 0;
|
|
10
|
+
let opened = false;
|
|
11
|
+
let active = false;
|
|
12
|
+
let noteAttempt = 0;
|
|
13
|
+
let skuConfirmLogged = false;
|
|
14
|
+
let cleanup = () => {};
|
|
15
|
+
const seen = /* @__PURE__ */ new Set();
|
|
16
|
+
const log = (event, source) => {
|
|
17
|
+
try {
|
|
18
|
+
var _getLogger, _document$body;
|
|
19
|
+
const capturedAtMs = Date.now();
|
|
20
|
+
const viewport = window.visualViewport;
|
|
21
|
+
(_getLogger = getLogger()) === null || _getLogger === void 0 || _getLogger.addLog({
|
|
22
|
+
type: "info",
|
|
23
|
+
title: event,
|
|
24
|
+
metadata: {
|
|
25
|
+
module: "SkuNoteDiagnostics",
|
|
26
|
+
category: "performance",
|
|
27
|
+
traceId,
|
|
28
|
+
seq: ++seq,
|
|
29
|
+
capturedAtMs,
|
|
30
|
+
elapsedMs: Math.max(0, capturedAtMs - startedAtMs),
|
|
31
|
+
productId,
|
|
32
|
+
mode,
|
|
33
|
+
noteAttempt,
|
|
34
|
+
noteLength,
|
|
35
|
+
source,
|
|
36
|
+
viewport: {
|
|
37
|
+
innerWidth: window.innerWidth,
|
|
38
|
+
innerHeight: window.innerHeight,
|
|
39
|
+
visualViewport: viewport ? {
|
|
40
|
+
width: viewport.width,
|
|
41
|
+
height: viewport.height,
|
|
42
|
+
offsetTop: viewport.offsetTop,
|
|
43
|
+
scale: viewport.scale
|
|
44
|
+
} : null,
|
|
45
|
+
bodyTransform: ((_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.style.transform) || ""
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
} catch (_unused) {}
|
|
50
|
+
};
|
|
51
|
+
const stop = () => {
|
|
52
|
+
active = false;
|
|
53
|
+
cleanup();
|
|
54
|
+
cleanup = () => {};
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
open(length) {
|
|
58
|
+
stop();
|
|
59
|
+
opened = active = true;
|
|
60
|
+
noteLength = length;
|
|
61
|
+
noteAttempt += 1;
|
|
62
|
+
seen.clear();
|
|
63
|
+
let count = 0;
|
|
64
|
+
let lastAt = -Infinity;
|
|
65
|
+
const onResize = (event) => {
|
|
66
|
+
const now = Date.now();
|
|
67
|
+
if (!active || count >= MAX_VIEWPORT_EVENTS || now - lastAt < VIEWPORT_INTERVAL_MS) return;
|
|
68
|
+
lastAt = now;
|
|
69
|
+
count += 1;
|
|
70
|
+
log("note_viewport_change", event.currentTarget === window ? "window" : "visualViewport");
|
|
71
|
+
};
|
|
72
|
+
const onNoteEvent = (event) => {
|
|
73
|
+
const target = event.target;
|
|
74
|
+
if (!active || !(target instanceof HTMLTextAreaElement) || !target.closest(".note-modal-content .note-input")) return;
|
|
75
|
+
noteLength = target.value.length;
|
|
76
|
+
const title = event.type === "focusin" ? "note_focus" : "note_first_input";
|
|
77
|
+
if (seen.has(title)) return;
|
|
78
|
+
seen.add(title);
|
|
79
|
+
log(title);
|
|
80
|
+
};
|
|
81
|
+
const visualViewport = window.visualViewport;
|
|
82
|
+
window.addEventListener("resize", onResize);
|
|
83
|
+
visualViewport === null || visualViewport === void 0 || visualViewport.addEventListener("resize", onResize);
|
|
84
|
+
document.addEventListener("focusin", onNoteEvent, true);
|
|
85
|
+
document.addEventListener("input", onNoteEvent, true);
|
|
86
|
+
cleanup = () => {
|
|
87
|
+
window.removeEventListener("resize", onResize);
|
|
88
|
+
visualViewport === null || visualViewport === void 0 || visualViewport.removeEventListener("resize", onResize);
|
|
89
|
+
document.removeEventListener("focusin", onNoteEvent, true);
|
|
90
|
+
document.removeEventListener("input", onNoteEvent, true);
|
|
91
|
+
};
|
|
92
|
+
log("note_open");
|
|
93
|
+
},
|
|
94
|
+
confirm(length) {
|
|
95
|
+
if (!active) return;
|
|
96
|
+
noteLength = length;
|
|
97
|
+
log("note_confirm");
|
|
98
|
+
stop();
|
|
99
|
+
},
|
|
100
|
+
stop,
|
|
101
|
+
skuConfirm(length) {
|
|
102
|
+
if (!opened || skuConfirmLogged) return;
|
|
103
|
+
skuConfirmLogged = true;
|
|
104
|
+
noteLength = length;
|
|
105
|
+
log("sku_confirm");
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { createSkuNoteDiagnostics };
|
|
@@ -127,7 +127,8 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
127
127
|
variant
|
|
128
128
|
]);
|
|
129
129
|
const isPosProductSelectionFlow = resolvedTemplate !== "kiosk" && isProductSelectionFlow;
|
|
130
|
-
const
|
|
130
|
+
const resolvedSalesPlatform = require_resolveKioskPresentation.resolveKioskPlatformSource(otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform, platform);
|
|
131
|
+
const salesRuntimePlatform = String(resolvedSalesPlatform !== null && resolvedSalesPlatform !== void 0 ? resolvedSalesPlatform : "").trim().toLowerCase() === "webpos" ? "pos" : resolvedSalesPlatform;
|
|
131
132
|
const fulfillmentOtherParams = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ enforceSingleBookingStartDate: false }, otherParams), salesRuntimePlatform ? { platform: salesRuntimePlatform } : {}), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [
|
|
132
133
|
otherParams,
|
|
133
134
|
salesRuntimePlatform,
|
|
@@ -3,6 +3,7 @@ const require_useEngineContext = require("../../hooks/useEngineContext.js");
|
|
|
3
3
|
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
4
4
|
const require_index = require("../../pro/NumericStepper/index.js");
|
|
5
5
|
const require_index$1 = require("../productSelect/components/pisellPriceText/index.js");
|
|
6
|
+
const require_pricePresentation = require("../productSelect/pricing/pricePresentation.js");
|
|
6
7
|
const require_SettlementPriceList = require("../multiCurrencySettlement/SettlementPriceList.js");
|
|
7
8
|
const require_locales = require("./locales.js");
|
|
8
9
|
const require_utils = require("./utils.js");
|
|
@@ -63,7 +64,7 @@ function isNormalProduct(product) {
|
|
|
63
64
|
return !(hasOption || hasBundle || hasVariant || requiresDetail);
|
|
64
65
|
}
|
|
65
66
|
const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction = false, value, selectedQuantity: selectedQuantityProp, disabled = false, soldOut = false, purchaseDisabled = false, stepperProps, optionsText, skuCardConfig, cartElementId, style, className, settlementPriceRows, onChange, onClick }) => {
|
|
66
|
-
var _context$appHelper$ut, _product$
|
|
67
|
+
var _context$appHelper$ut, _product$price, _product$metadata2, _pricePresentation$am, _value$num, _stepperProps$min3, _stepperProps$step;
|
|
67
68
|
const context = require_useEngineContext.default();
|
|
68
69
|
_pisell_utils.locales.init(require_locales.default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
69
70
|
const normalProduct = (0, react.useMemo)(() => !requiresOptions && isNormalProduct(product), [product, requiresOptions]);
|
|
@@ -74,6 +75,7 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction =
|
|
|
74
75
|
const soldOutIcon = String(_pisell_utils.locales.locale || "").toLowerCase().startsWith("zh") ? SOLD_OUT_ICON_URLS.cn : SOLD_OUT_ICON_URLS.en;
|
|
75
76
|
const title = resolveText((product === null || product === void 0 ? void 0 : product.title) || (product === null || product === void 0 ? void 0 : product.name));
|
|
76
77
|
const textCover = getTextCover(title);
|
|
78
|
+
const pricePresentation = (settlementPriceRows === null || settlementPriceRows === void 0 ? void 0 : settlementPriceRows.length) ? void 0 : require_pricePresentation.resolveProductPricePresentation(product, { price: (_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : 0 });
|
|
77
79
|
const promotionTags = (0, react.useMemo)(() => {
|
|
78
80
|
var _product$metadata;
|
|
79
81
|
const rawPromotionTags = (product === null || product === void 0 ? void 0 : product._promotionTags) || (product === null || product === void 0 || (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata._promotionTags) || [];
|
|
@@ -172,8 +174,11 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction =
|
|
|
172
174
|
src: soldOutIcon,
|
|
173
175
|
alt: ""
|
|
174
176
|
})) : null), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__content` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__title` }, title), (settlementPriceRows === null || settlementPriceRows === void 0 ? void 0 : settlementPriceRows.length) ? /* @__PURE__ */ react.default.createElement(require_SettlementPriceList.default, { rows: settlementPriceRows }) : /* @__PURE__ */ react.default.createElement(require_index$1.default, {
|
|
175
|
-
value: (
|
|
176
|
-
isMini:
|
|
177
|
+
value: (_pricePresentation$am = pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.amount) !== null && _pricePresentation$am !== void 0 ? _pricePresentation$am : 0,
|
|
178
|
+
isMini: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.qualifier) === "from",
|
|
179
|
+
precision: pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.precision,
|
|
180
|
+
hideDecimalForWholeNumbers: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.precision) ? false : void 0,
|
|
181
|
+
suffix: (pricePresentation === null || pricePresentation === void 0 ? void 0 : pricePresentation.unit) ? /* @__PURE__ */ react.default.createElement("span", null, "/", pricePresentation.unit) : void 0
|
|
177
182
|
}), promotionTags.length ? /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__promotions` }, promotionTags.map((promotionTag, index) => /* @__PURE__ */ react.default.createElement("span", {
|
|
178
183
|
key: `${promotionTag}-${index}`,
|
|
179
184
|
className: `${PREFIX}__promotion-tag`
|