@pisell/private-materials 6.12.397 → 6.12.398

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +2 -2
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +2 -2
  9. package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
  10. package/es/components/bigSale/components/ProductList/index.js +1 -0
  11. package/es/components/bigSale/components/TimeBar/index.js +1 -0
  12. package/es/components/bigSale/dialog.js +1 -0
  13. package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
  14. package/es/components/bigSale/hooks/useBigSaleProductListConfig.js +0 -1
  15. package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
  16. package/es/components/bigSale/index.js +1 -0
  17. package/es/components/bigSale/templates/Kiosk/index.js +1 -0
  18. package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
  19. package/es/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
  20. package/es/components/venueBookingSales/catalogPresentation.js +0 -1
  21. package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +1 -0
  22. package/es/index.js +2 -0
  23. package/es/plus/multiCurrencySettlement/index.js +1 -1
  24. package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
  25. package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
  26. package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
  27. package/es/plus/pisellReservation/index.js +17 -0
  28. package/es/plus/saleDetail/Base.js +1 -0
  29. package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
  30. package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
  31. package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
  32. package/es/plus/saleDetail/components/DetailActions/index.less +3 -0
  33. package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
  34. package/es/plus/saleDetail/index.js +1 -0
  35. package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
  36. package/es/plus/saleDetail/tmpl/B/index.js +1 -0
  37. package/es/plus/salesSdk/context/SalesSdkCartContext.js +8 -10
  38. package/es/plus/salesSdk/index.js +54 -0
  39. package/es/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +3 -3
  40. package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
  41. package/es/plus/salesSdk/utils/bookingDate.js +1 -1
  42. package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
  43. package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +18 -11
  44. package/es/pro/Login2.0/AuthModal.d.ts +1 -1
  45. package/es/pro/Login2.0/index.d.ts +2 -2
  46. package/es/pro/Login2.0/shared/types.d.ts +1 -1
  47. package/es/pro/compensatedPisellContainer/floatingLayer/index.js +11 -2
  48. package/es/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +25 -1
  49. package/es/pro/skuDetailModal/flow/SkuDetailSelectionFlowView.js +3 -2
  50. package/es/pro/skuDetailModal/flow/registry.d.ts +1 -1
  51. package/es/pro/skuDetailModal/index.js +8 -5
  52. package/lib/plus/saleDetail/components/DetailActions/index.less +3 -0
  53. package/lib/plus/salesSdk/context/SalesSdkCartContext.js +8 -10
  54. package/lib/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +3 -3
  55. package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +17 -10
  56. package/lib/pro/compensatedPisellContainer/floatingLayer/index.js +11 -2
  57. package/lib/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +25 -1
  58. package/lib/pro/skuDetailModal/flow/SkuDetailSelectionFlowView.js +3 -2
  59. package/lib/pro/skuDetailModal/flow/registry.d.ts +1 -1
  60. package/lib/pro/skuDetailModal/index.js +8 -5
  61. package/package.json +1 -1
  62. package/es/components/ticketBooking/components/ProductDisplayAdapter/index.js +0 -3
  63. package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
@@ -18,9 +18,10 @@ const SkuDetailSelectionFlowView = ({ controller, className, showSteps = true, s
18
18
  role: "alert"
19
19
  }, configurationError.issues.map((issue, index) => /* @__PURE__ */ React.createElement("div", { key: `${issue.code}-${index}` }, renderConfigurationIssue(issue))));
20
20
  if (!currentStep) return null;
21
- const visibleSteps = getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []).filter((step) => !isStepSkippable(step.index));
21
+ const renderedSteps = getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []);
22
+ const visibleSteps = renderedSteps.filter((step) => !isStepSkippable(step.index));
22
23
  const presentationIndex = getPresentationStepIndex(visibleSteps, currentStepIndex);
23
- const displayStep = visibleSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
24
+ const displayStep = renderedSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
24
25
  const isLastStep = visibleSteps.length === 0 || presentationIndex === visibleSteps.length - 1;
25
26
  return /* @__PURE__ */ React.createElement("div", {
26
27
  className: classNames("selection-flow", moduleSections && "selection-flow--sectioned", className),
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
19
19
  readonly Component: _$react.FC<FlowModuleProps<string>>;
20
20
  readonly initializeWhileInactive: true;
21
21
  readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
22
- readonly refreshOn: ("quantity" | "productData" | "skuValue" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
22
+ readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
23
23
  readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
24
24
  readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
25
25
  readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
@@ -191,8 +191,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
191
191
  const inventory = useContext(SalesInventoryContext);
192
192
  const [baseProductData, setProductData] = useState(null);
193
193
  const [detailLoading, setDetailLoading] = useState(false);
194
- const [modalEntered, setModalEntered] = useState(false);
195
- const detailContentLoading = detailLoading || !modalEntered;
194
+ const [modalEnterStarted, setModalEnterStarted] = useState(false);
195
+ const detailContentLoading = detailLoading || !modalEnterStarted;
196
196
  const [appearanceConfirmPending, setAppearanceConfirmPending] = useState(false);
197
197
  const appearanceConfirmTaskRef = useRef(null);
198
198
  const [note, setNote] = useState("");
@@ -1056,7 +1056,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1056
1056
  setInventorySelectorSnapshot(null);
1057
1057
  flowDateHydrationVersionRef.current += 1;
1058
1058
  const isCurrentOpenTask = () => openTaskIdRef.current === currentTaskId;
1059
- if (!open) setModalEntered(false);
1059
+ if (!open) setModalEnterStarted(false);
1060
1060
  const showModalShellBeforeHydration = () => {
1061
1061
  setProductData(null);
1062
1062
  setDetailLoading(true);
@@ -1636,7 +1636,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1636
1636
  const resetModalStateAfterClose = useCallback(() => {
1637
1637
  var _noteDiagnosticsRef$c4;
1638
1638
  (_noteDiagnosticsRef$c4 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c4 === void 0 || _noteDiagnosticsRef$c4.stop();
1639
- setModalEntered(false);
1639
+ setModalEnterStarted(false);
1640
1640
  setProductData(null);
1641
1641
  setDetailLoading(false);
1642
1642
  setNote("");
@@ -1677,8 +1677,10 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1677
1677
  setNoteModalOpen(false);
1678
1678
  setShowPriceAdjustModal(false);
1679
1679
  };
1680
+ const handleModalEnterStart = useCallback(() => {
1681
+ setModalEnterStarted(true);
1682
+ }, []);
1680
1683
  const handleModalOpenChange = useCallback((nextOpen) => {
1681
- if (nextOpen) setModalEntered(true);
1682
1684
  if (nextOpen && shownLogRef.current) {
1683
1685
  const _shownLogRef$current = shownLogRef.current, { startedAt } = _shownLogRef$current, metadata = _objectWithoutProperties(_shownLogRef$current, _excluded);
1684
1686
  shownLogRef.current = null;
@@ -2518,6 +2520,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
2518
2520
  rootStyle: suspended ? { display: "none" } : void 0,
2519
2521
  keyboard: !suspended,
2520
2522
  onCancel: handleCancel,
2523
+ afterEnterStart: handleModalEnterStart,
2521
2524
  afterOpenChange: handleModalOpenChange,
2522
2525
  header: variant === "phone" ? drawerHeader : null,
2523
2526
  headerDivider: false,
@@ -1,4 +1,7 @@
1
1
  .pisell-sale-detail-print-menu {
2
+ // iframe 页面会禁用宿主 body 的点击;挂载到 body 的打印弹层需显式恢复。
3
+ pointer-events: auto;
4
+
2
5
  .pisell-lowcode-dropdown-menu {
3
6
  min-width: 180px;
4
7
  }
@@ -1125,24 +1125,22 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, resourceIdF
1125
1125
  const preparedSelection = (_options$calendarSele = options === null || options === void 0 ? void 0 : options.calendarSelection) !== null && _options$calendarSele !== void 0 ? _options$calendarSele : options === null || options === void 0 ? void 0 : options.rememberedSelection;
1126
1126
  options === null || options === void 0 || (_options$memoryCommit = options.memoryCommitLifecycle) === null || _options$memoryCommit === void 0 || _options$memoryCommit.beforeCommit();
1127
1127
  if (preparedSelection) {
1128
- var _options$rememberedTi, _sales$salesModule, _options$rememberedSe, _options$salesNotes2, _committed$validation, _options$memoryCommit2, _committed$tempOrder, _bookingTicket$getTem11;
1128
+ var _options$rememberedTi, _sales$salesModule, _options$salesNotes2, _committed$validation, _options$memoryCommit2, _committed$tempOrder, _bookingTicket$getTem11;
1129
1129
  options === null || options === void 0 || (_options$rememberedTi = options.rememberedTimeGuard) === null || _options$rememberedTi === void 0 || _options$rememberedTi.call(options);
1130
1130
  if (!(sales === null || sales === void 0 || (_sales$salesModule = sales.salesModule) === null || _sales$salesModule === void 0 ? void 0 : _sales$salesModule.commitAvailabilitySelection)) throw new Error("The current sales module cannot validate the booking.");
1131
- const committed = yield sales.salesModule.commitAvailabilitySelection(preparedSelection.contextId, require_objectSpread2._objectSpread2({
1131
+ const committed = yield sales.salesModule.commitAvailabilitySelection(preparedSelection.contextId, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
1132
1132
  mode: "add",
1133
1133
  orderProduct: require_resolveBookingCommitCount.normalizeAvailabilityOrderProductForCommit(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, cacheItemForTransform), orderLine), {}, { _extend: cacheItemForTransform._extend })),
1134
1134
  candidate: preparedSelection.candidate,
1135
1135
  requirementSelections: preparedSelection.requirementSelections,
1136
1136
  partySize: preparedSelection.partySize,
1137
1137
  bookingCount: preparedSelection.bookingCount,
1138
- selectionIntent: (options === null || options === void 0 ? void 0 : options.calendarSelection) ? "manual" : "remembered",
1139
- orderSessionId: options === null || options === void 0 || (_options$rememberedSe = options.rememberedSelection) === null || _options$rememberedSe === void 0 ? void 0 : _options$rememberedSe.orderSessionId,
1140
- availabilityCommitGuard: () => {
1141
- var _options$rememberedTi2;
1142
- assertBookingCurrent();
1143
- options === null || options === void 0 || (_options$rememberedTi2 = options.rememberedTimeGuard) === null || _options$rememberedTi2 === void 0 || _options$rememberedTi2.call(options);
1144
- }
1145
- }, (options === null || options === void 0 || (_options$salesNotes2 = options.salesNotes) === null || _options$salesNotes2 === void 0 ? void 0 : _options$salesNotes2.length) ? { salesNotes: options.salesNotes } : {}));
1138
+ selectionIntent: (options === null || options === void 0 ? void 0 : options.calendarSelection) ? "manual" : "remembered"
1139
+ }, !(options === null || options === void 0 ? void 0 : options.calendarSelection) && (options === null || options === void 0 ? void 0 : options.rememberedSelection) ? { orderSessionId: options.rememberedSelection.orderSessionId } : {}), {}, { availabilityCommitGuard: () => {
1140
+ var _options$rememberedTi2;
1141
+ assertBookingCurrent();
1142
+ options === null || options === void 0 || (_options$rememberedTi2 = options.rememberedTimeGuard) === null || _options$rememberedTi2 === void 0 || _options$rememberedTi2.call(options);
1143
+ } }, (options === null || options === void 0 || (_options$salesNotes2 = options.salesNotes) === null || _options$salesNotes2 === void 0 ? void 0 : _options$salesNotes2.length) ? { salesNotes: options.salesNotes } : {}));
1146
1144
  if (((_committed$validation = committed.validation) === null || _committed$validation === void 0 ? void 0 : _committed$validation.ok) === false) throw Object.assign(/* @__PURE__ */ new Error((options === null || options === void 0 ? void 0 : options.calendarSelection) ? "The calendar booking could not be saved." : "The remembered time is no longer available."), { code: "REVALIDATION_FAILED" });
1147
1145
  options === null || options === void 0 || (_options$memoryCommit2 = options.memoryCommitLifecycle) === null || _options$memoryCommit2 === void 0 || _options$memoryCommit2.onCommitted();
1148
1146
  const products = ((_committed$tempOrder = committed.tempOrder) === null || _committed$tempOrder === void 0 ? void 0 : _committed$tempOrder.products) || ((_bookingTicket$getTem11 = bookingTicket.getTempOrder) === null || _bookingTicket$getTem11 === void 0 || (_bookingTicket$getTem11 = _bookingTicket$getTem11.call(bookingTicket)) === null || _bookingTicket$getTem11 === void 0 ? void 0 : _bookingTicket$getTem11.products) || [];
@@ -428,14 +428,14 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig, resourceIdFro
428
428
  };
429
429
  const bookingPriceContextKey = JSON.stringify({
430
430
  channel: productLoadChannel || "",
431
- platform: salesSettingsPlatform || "",
431
+ platform: pricingRuntimePlatform,
432
432
  businessCode: businessCode || ""
433
433
  });
434
434
  const attachBookingPriceService = (options) => {
435
435
  if (!usesUnifiedBookingSales) return;
436
436
  selectionFlowServices = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectionFlowServices), {}, { bookingPrice: require_bookingSelectionPrice.createBookingSelectionPriceService({
437
437
  contextKey: bookingPriceContextKey,
438
- runtimePlatform: salesSettingsPlatform,
438
+ runtimePlatform: pricingRuntimePlatform,
439
439
  channel: productLoadChannel,
440
440
  initialSnapshot: options === null || options === void 0 ? void 0 : options.initialSnapshot,
441
441
  pricingDuration: options === null || options === void 0 ? void 0 : options.pricingDuration,
@@ -857,7 +857,7 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig, resourceIdFro
857
857
  booking: bookingPayload.booking || {},
858
858
  customerId,
859
859
  contextKey: bookingPriceContextKey,
860
- runtimePlatform: salesSettingsPlatform,
860
+ runtimePlatform: pricingRuntimePlatform,
861
861
  quantity: Number(initialCacheItem === null || initialCacheItem === void 0 || (_initialCacheItem$_ex3 = initialCacheItem._extend) === null || _initialCacheItem$_ex3 === void 0 ? void 0 : _initialCacheItem$_ex3.quantity) || 1,
862
862
  pricingDuration
863
863
  }) : void 0
@@ -8,7 +8,8 @@ decimal_js = require_runtime.__toESM(decimal_js);
8
8
  /** 接口详情与订单行可能分别返回 number/string,SKU 回填按业务 ID 比较。 */
9
9
  const isSameId = (left, right) => left !== void 0 && left !== null && right !== void 0 && right !== null && String(left) === String(right);
10
10
  /**
11
- * 为唯一、可售且无内层配置的必选套餐项补齐默认业务值。
11
+ * 为唯一必选项或必须全选的固定套餐组补齐默认业务值。
12
+ * 仅初始化尚未选择的分组,所有默认项都必须可售且无内层配置。
12
13
  * 同时返回本次补齐的分组 ID,供受控组件精确触发这些分组的校验。
13
14
  */
14
15
  const resolveRequiredSoleBundleDefaults = (value, dataSource, options = {}) => {
@@ -21,23 +22,29 @@ const resolveRequiredSoleBundleDefaults = (value, dataSource, options = {}) => {
21
22
  const defaults = [];
22
23
  const defaultedGroupIds = [];
23
24
  ((dataSource === null || dataSource === void 0 ? void 0 : dataSource.bundle_group) || []).forEach((group) => {
24
- var _item$option_group;
25
25
  const minimum = require_normalizers.normalizeNonNegativeInteger(group === null || group === void 0 ? void 0 : group.min_quantity, 0);
26
26
  const items = Array.isArray(group === null || group === void 0 ? void 0 : group.bundle_item) ? group.bundle_item : [];
27
- if (minimum <= 0 || items.length !== 1 || !require_skuSemantics.isSkuRecordEnabled(group) || currentBundle.some((item) => {
27
+ if (minimum <= 0 || items.length === 0 || !require_skuSemantics.isSkuRecordEnabled(group) || currentBundle.some((item) => {
28
28
  var _item$group_id;
29
29
  return isSameId((_item$group_id = item === null || item === void 0 ? void 0 : item.group_id) !== null && _item$group_id !== void 0 ? _item$group_id : item === null || item === void 0 ? void 0 : item.bundle_group_id, group === null || group === void 0 ? void 0 : group.id);
30
30
  })) return;
31
- const [item] = items;
32
- const maximums = [require_normalizers.normalizeNonNegativeInteger(group === null || group === void 0 ? void 0 : group.max_quantity, 0), require_normalizers.normalizeNonNegativeInteger(item === null || item === void 0 ? void 0 : item.max_quantity, 0)].filter((maximum) => maximum > 0);
33
- if (minimum > (maximums.length ? Math.min(...maximums) : Infinity) || (item === null || item === void 0 || (_item$option_group = item.option_group) === null || _item$option_group === void 0 ? void 0 : _item$option_group.length) || !require_skuSemantics.isSkuRecordSellable(item, { overSold: options.overSold })) return;
34
- defaults.push(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item || {}), {}, {
31
+ if (items.length === 1) {
32
+ var _item$option_group;
33
+ const [item] = items;
34
+ const maximums = [require_normalizers.normalizeNonNegativeInteger(group === null || group === void 0 ? void 0 : group.max_quantity, 0), require_normalizers.normalizeNonNegativeInteger(item === null || item === void 0 ? void 0 : item.max_quantity, 0)].filter((maximum) => maximum > 0);
35
+ if (minimum > (maximums.length ? Math.min(...maximums) : Infinity) || (item === null || item === void 0 || (_item$option_group = item.option_group) === null || _item$option_group === void 0 ? void 0 : _item$option_group.length) || !require_skuSemantics.isSkuRecordSellable(item, { overSold: options.overSold })) return;
36
+ } else if (items.length !== minimum || !require_skuSemantics.isWithinSkuBounds(minimum, group === null || group === void 0 ? void 0 : group.min_quantity, group === null || group === void 0 ? void 0 : group.max_quantity) || items.some((item) => {
37
+ var _item$option_group2;
38
+ return require_skuSemantics.parseSkuNumber(item === null || item === void 0 ? void 0 : item.max_quantity) !== 1 || !require_skuSemantics.isWithinSkuBounds(1, item === null || item === void 0 ? void 0 : item.min_quantity, item === null || item === void 0 ? void 0 : item.max_quantity) || (item === null || item === void 0 || (_item$option_group2 = item.option_group) === null || _item$option_group2 === void 0 ? void 0 : _item$option_group2.length) || !require_skuSemantics.isSkuRecordSellable(item, { overSold: options.overSold });
39
+ })) return;
40
+ const quantity = items.length === 1 ? minimum : 1;
41
+ defaults.push(...items.map((item) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item || {}), {}, {
35
42
  id: item === null || item === void 0 ? void 0 : item.id,
36
43
  group_id: group === null || group === void 0 ? void 0 : group.id,
37
44
  bundle_group_id: group === null || group === void 0 ? void 0 : group.id,
38
- quantity: minimum,
39
- num: minimum
40
- }));
45
+ quantity,
46
+ num: quantity
47
+ })));
41
48
  defaultedGroupIds.push(group === null || group === void 0 ? void 0 : group.id);
42
49
  });
43
50
  if (!defaults.length) return {
@@ -212,7 +212,7 @@ const getLegacyModalClass = (mode, suffix) => {
212
212
  };
213
213
  const TransformFloatingLayer = (props) => {
214
214
  var _ref;
215
- const { afterOpenChange, autoHideHeaderFooterOnScroll = false, bodyStyle, cancelButtonProps, cancelText = "Cancel", centered, children, className, classNames: layerClassNames, closeIcon, closable = true, confirmLoading, contentWrapperStyle, destroyOnClose, extra, footer, footerStyle, getContainer: customGetContainer, headerStyle, height, keyboard = true, mask = true, maskClosable = true, mode = "drawer", modalRender, okButtonProps, okText = "OK", onCancel, onClose, onOk, open, placement: rawPlacement, rootClassName, rootStyle, skipEnterMotion = false, size, style, styles, title, visible, width, wrapClassName, zIndex } = props;
215
+ const { afterEnterStart, afterOpenChange, autoHideHeaderFooterOnScroll = false, bodyStyle, cancelButtonProps, cancelText = "Cancel", centered, children, className, classNames: layerClassNames, closeIcon, closable = true, confirmLoading, contentWrapperStyle, destroyOnClose, extra, footer, footerStyle, getContainer: customGetContainer, headerStyle, height, keyboard = true, mask = true, maskClosable = true, mode = "drawer", modalRender, okButtonProps, okText = "OK", onCancel, onClose, onOk, open, placement: rawPlacement, rootClassName, rootStyle, skipEnterMotion = false, size, style, styles, title, visible, width, wrapClassName, zIndex } = props;
216
216
  const placement = rawPlacement || (mode === "modal" ? "bottom" : "right");
217
217
  const mergedOpen = Boolean(open !== null && open !== void 0 ? open : visible);
218
218
  const showCloseButton = closable && closeIcon !== false;
@@ -256,10 +256,12 @@ const TransformFloatingLayer = (props) => {
256
256
  const hasSettledHiddenRef = (0, react.useRef)(false);
257
257
  const motionRunRef = (0, react.useRef)(0);
258
258
  const motionOptionsRef = (0, react.useRef)({
259
+ afterEnterStart,
259
260
  afterOpenChange,
260
261
  shouldDestroyOnClose
261
262
  });
262
263
  motionOptionsRef.current = {
264
+ afterEnterStart,
263
265
  afterOpenChange,
264
266
  shouldDestroyOnClose
265
267
  };
@@ -318,7 +320,14 @@ const TransformFloatingLayer = (props) => {
318
320
  if (motionOptionsRef.current.shouldDestroyOnClose) setRendered(false);
319
321
  }
320
322
  (_motionOptionsRef$cur = (_motionOptionsRef$cur2 = motionOptionsRef.current).afterOpenChange) === null || _motionOptionsRef$cur === void 0 || _motionOptionsRef$cur.call(_motionOptionsRef$cur2, motion.open);
321
- });
323
+ }, motion.open && wrapperRef.current ? {
324
+ element: wrapperRef.current,
325
+ onStarted: () => {
326
+ var _motionOptionsRef$cur3, _motionOptionsRef$cur4;
327
+ if (motion.id !== motionRunRef.current) return;
328
+ (_motionOptionsRef$cur3 = (_motionOptionsRef$cur4 = motionOptionsRef.current).afterEnterStart) === null || _motionOptionsRef$cur3 === void 0 || _motionOptionsRef$cur3.call(_motionOptionsRef$cur4);
329
+ }
330
+ } : void 0);
322
331
  }, [motion, mergedOpen]);
323
332
  (0, react.useEffect)(() => {
324
333
  if (!mergedOpen || keyboard === false || typeof window === "undefined") return;
@@ -1,11 +1,30 @@
1
1
  //#region src/pro/compensatedPisellContainer/floatingLayer/observeTransitions.ts
2
2
  /** Observe only the shell's own transitions, never animations inside its content. */
3
- const observeTransitions = (elements, onSettled) => {
3
+ const observeTransitions = (elements, onSettled, start) => {
4
4
  let disposed = false;
5
5
  let frame;
6
+ let startFrame;
7
+ let started = false;
6
8
  const pendingEvents = /* @__PURE__ */ new Map();
7
9
  const supportsAnimations = elements.every((element) => typeof element.getAnimations === "function");
8
10
  const isMotionProperty = (property) => property === "opacity" || property === "transform";
11
+ const reportStart = () => {
12
+ if (disposed || started) return;
13
+ started = true;
14
+ if (startFrame !== void 0) cancelAnimationFrame(startFrame);
15
+ startFrame = void 0;
16
+ start === null || start === void 0 || start.onStarted();
17
+ };
18
+ const handleStart = (event) => {
19
+ const transition = event;
20
+ if (disposed || started || startFrame !== void 0 || event.target !== (start === null || start === void 0 ? void 0 : start.element) || !isMotionProperty(transition.propertyName)) return;
21
+ startFrame = requestAnimationFrame(() => {
22
+ startFrame = requestAnimationFrame(() => {
23
+ startFrame = void 0;
24
+ reportStart();
25
+ });
26
+ });
27
+ };
9
28
  const check = () => {
10
29
  if (disposed) return;
11
30
  if (supportsAnimations) {
@@ -18,6 +37,8 @@ const observeTransitions = (elements, onSettled) => {
18
37
  return;
19
38
  }
20
39
  } else if ([...pendingEvents.values()].some((properties) => properties.size)) return;
40
+ reportStart();
41
+ if (disposed) return;
21
42
  disposed = true;
22
43
  removeListeners();
23
44
  onSettled();
@@ -38,12 +59,14 @@ const observeTransitions = (elements, onSettled) => {
38
59
  }
39
60
  };
40
61
  const removeListeners = () => {
62
+ start === null || start === void 0 || start.element.removeEventListener("transitionstart", handleStart);
41
63
  elements.forEach((element) => {
42
64
  element.removeEventListener("transitionrun", handleTransition);
43
65
  element.removeEventListener("transitionend", handleTransition);
44
66
  element.removeEventListener("transitioncancel", handleTransition);
45
67
  });
46
68
  };
69
+ start === null || start === void 0 || start.element.addEventListener("transitionstart", handleStart);
47
70
  elements.forEach((element) => {
48
71
  pendingEvents.set(element, /* @__PURE__ */ new Set());
49
72
  if (!supportsAnimations) {
@@ -58,6 +81,7 @@ const observeTransitions = (elements, onSettled) => {
58
81
  return () => {
59
82
  disposed = true;
60
83
  if (frame !== void 0) cancelAnimationFrame(frame);
84
+ if (startFrame !== void 0) cancelAnimationFrame(startFrame);
61
85
  removeListeners();
62
86
  };
63
87
  };
@@ -21,9 +21,10 @@ const SkuDetailSelectionFlowView = ({ controller, className, showSteps = true, s
21
21
  role: "alert"
22
22
  }, configurationError.issues.map((issue, index) => /* @__PURE__ */ react.default.createElement("div", { key: `${issue.code}-${index}` }, renderConfigurationIssue(issue))));
23
23
  if (!currentStep) return null;
24
- const visibleSteps = require_presentation.getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []).filter((step) => !isStepSkippable(step.index));
24
+ const renderedSteps = require_presentation.getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []);
25
+ const visibleSteps = renderedSteps.filter((step) => !isStepSkippable(step.index));
25
26
  const presentationIndex = require_presentation.getPresentationStepIndex(visibleSteps, currentStepIndex);
26
- const displayStep = visibleSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
27
+ const displayStep = renderedSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
27
28
  const isLastStep = visibleSteps.length === 0 || presentationIndex === visibleSteps.length - 1;
28
29
  return /* @__PURE__ */ react.default.createElement("div", {
29
30
  className: (0, classnames.default)("selection-flow", moduleSections && "selection-flow--sectioned", className),
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
19
19
  readonly Component: _$react.FC<FlowModuleProps<string>>;
20
20
  readonly initializeWhileInactive: true;
21
21
  readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
22
- readonly refreshOn: ("quantity" | "productData" | "skuValue" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
22
+ readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
23
23
  readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
24
24
  readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
25
25
  readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
@@ -197,8 +197,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
197
197
  const inventory = (0, react.useContext)(require_context.SalesInventoryContext);
198
198
  const [baseProductData, setProductData] = (0, react.useState)(null);
199
199
  const [detailLoading, setDetailLoading] = (0, react.useState)(false);
200
- const [modalEntered, setModalEntered] = (0, react.useState)(false);
201
- const detailContentLoading = detailLoading || !modalEntered;
200
+ const [modalEnterStarted, setModalEnterStarted] = (0, react.useState)(false);
201
+ const detailContentLoading = detailLoading || !modalEnterStarted;
202
202
  const [appearanceConfirmPending, setAppearanceConfirmPending] = (0, react.useState)(false);
203
203
  const appearanceConfirmTaskRef = (0, react.useRef)(null);
204
204
  const [note, setNote] = (0, react.useState)("");
@@ -1062,7 +1062,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1062
1062
  setInventorySelectorSnapshot(null);
1063
1063
  flowDateHydrationVersionRef.current += 1;
1064
1064
  const isCurrentOpenTask = () => openTaskIdRef.current === currentTaskId;
1065
- if (!open) setModalEntered(false);
1065
+ if (!open) setModalEnterStarted(false);
1066
1066
  const showModalShellBeforeHydration = () => {
1067
1067
  setProductData(null);
1068
1068
  setDetailLoading(true);
@@ -1642,7 +1642,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1642
1642
  const resetModalStateAfterClose = (0, react.useCallback)(() => {
1643
1643
  var _noteDiagnosticsRef$c4;
1644
1644
  (_noteDiagnosticsRef$c4 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c4 === void 0 || _noteDiagnosticsRef$c4.stop();
1645
- setModalEntered(false);
1645
+ setModalEnterStarted(false);
1646
1646
  setProductData(null);
1647
1647
  setDetailLoading(false);
1648
1648
  setNote("");
@@ -1683,8 +1683,10 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
1683
1683
  setNoteModalOpen(false);
1684
1684
  setShowPriceAdjustModal(false);
1685
1685
  };
1686
+ const handleModalEnterStart = (0, react.useCallback)(() => {
1687
+ setModalEnterStarted(true);
1688
+ }, []);
1686
1689
  const handleModalOpenChange = (0, react.useCallback)((nextOpen) => {
1687
- if (nextOpen) setModalEntered(true);
1688
1690
  if (nextOpen && shownLogRef.current) {
1689
1691
  const _shownLogRef$current = shownLogRef.current, { startedAt } = _shownLogRef$current, metadata = require_objectWithoutProperties._objectWithoutProperties(_shownLogRef$current, _excluded);
1690
1692
  shownLogRef.current = null;
@@ -2524,6 +2526,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
2524
2526
  rootStyle: suspended ? { display: "none" } : void 0,
2525
2527
  keyboard: !suspended,
2526
2528
  onCancel: handleCancel,
2529
+ afterEnterStart: handleModalEnterStart,
2527
2530
  afterOpenChange: handleModalOpenChange,
2528
2531
  header: variant === "phone" ? drawerHeader : null,
2529
2532
  headerDivider: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.397",
3
+ "version": "6.12.398",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,3 +0,0 @@
1
- import "./ProductDisplayAdapter.js";
2
- import "./types.js";
3
- export {};
@@ -1 +0,0 @@
1
- export { };