@pisell/private-materials 6.12.372 → 6.12.373
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/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/ProductList/index.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +1 -0
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- 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/pisellReservation/index.js +17 -0
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/index.js +54 -0
- 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/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/compensatedPisellContainer/floatingLayer/index.js +74 -59
- package/es/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +65 -0
- package/es/pro/skuDetailModal/index.js +53 -65
- package/lib/pro/compensatedPisellContainer/floatingLayer/index.js +73 -58
- package/lib/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +65 -0
- package/lib/pro/skuDetailModal/index.js +53 -65
- package/package.json +4 -4
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
+
import "../../../../plus/salesSdk/index.js";
|
|
3
4
|
import dayjs from "dayjs";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -18,6 +18,7 @@ import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAdd
|
|
|
18
18
|
import { mergeBookingsForDisplay } from "../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js";
|
|
19
19
|
import useSalesSdkGlobalScanHandler from "../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
|
|
20
20
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
21
|
+
import "../../../../plus/salesSdk/index.js";
|
|
21
22
|
import { buildBigSaleProductListPreferencesKey, readBigSaleProductListPreferences, readStoredBigSaleProductListPreferences, removeBigSaleProductListPreferences, resolveBigSaleAutoProductListPreferences, writeBigSaleProductListPreferences } from "../../utils/productListPreferences.js";
|
|
22
23
|
import { resolveBigSaleProductDisplayConfig, useBigSaleProductListConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
23
24
|
import { showSalesGuardErrorToast } from "../../../../plus/salesSdk/utils/salesGuard.js";
|
|
@@ -5,6 +5,7 @@ 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";
|
|
8
9
|
import locales_default from "../../locales/index.js";
|
|
9
10
|
import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
|
|
10
11
|
import dayjs from "dayjs";
|
|
@@ -6,6 +6,7 @@ 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";
|
|
9
10
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
10
11
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
11
12
|
import BigSale from "./index.js";
|
|
@@ -4,6 +4,7 @@ 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";
|
|
7
8
|
import { useMemo } from "react";
|
|
8
9
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
9
10
|
/**
|
|
@@ -3,6 +3,7 @@ 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";
|
|
6
7
|
import { isPersistedBigSaleOrderId } from "../utils/orderIdentity.js";
|
|
7
8
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
8
9
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
@@ -8,6 +8,7 @@ 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";
|
|
11
12
|
import { resolveKioskPlatformSource, resolveKioskPresentation } from "../kioskSale/resolveKioskPresentation.js";
|
|
12
13
|
import { resolveCustomerDetailAppearance } from "../../pro/skuDetailModal/customerDetailPolicy.js";
|
|
13
14
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
@@ -13,6 +13,7 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
|
|
|
13
13
|
import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
|
|
14
14
|
import { isFulfillmentTimingBooking } from "../../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
|
|
15
15
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
16
|
+
import "../../../../plus/salesSdk/index.js";
|
|
16
17
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
17
18
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
18
19
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,6 +2,7 @@ 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 { TEMP_ORDER_SYNC_REQUEST_MESSAGE_TYPE, getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
+
import "../../plus/salesSdk/index.js";
|
|
5
6
|
import { useEffect, useRef, useState } from "react";
|
|
6
7
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
|
7
8
|
function createRequestId() {
|
package/es/index.js
CHANGED
|
@@ -90,6 +90,7 @@ 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";
|
|
93
94
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
94
95
|
import ResponsiveWrapper from "./components/list/ResponsiveWrapper.js";
|
|
95
96
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
@@ -151,6 +152,7 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
151
152
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
152
153
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
153
154
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
155
|
+
import "./plus/pisellReservation/index.js";
|
|
154
156
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
155
157
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
156
158
|
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, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
283
|
+
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, findFirstVirtualCurrencyAsset, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getReservedVirtualSettlementAmount, 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, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, 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, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, 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, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./serve/formResourcePage.js";
|
|
2
|
+
import "./floorRoomCard/mapRowToFloorRoomCardData.js";
|
|
3
|
+
import "./floorRoomCard/ReservationFloorRoomCard.js";
|
|
4
|
+
import "./floorMap/reservationMock.js";
|
|
5
|
+
import "./floorMap/floorPlanApi.js";
|
|
6
|
+
import "./reservationConstants.js";
|
|
7
|
+
import "./data/bookingToReservationTables.js";
|
|
8
|
+
import "./data/formResourceToReservationTables.js";
|
|
9
|
+
import "./data/salesEmbeddedResourceToTableRows.js";
|
|
10
|
+
import "./floorMap/reservationCards.js";
|
|
11
|
+
import "./PisellReservation.js";
|
|
12
|
+
import "./PisellReservationBookingPage.js";
|
|
13
|
+
import "./PisellVenueControlPage.js";
|
|
14
|
+
import "./PisellVenueWallPage.js";
|
|
15
|
+
import "./PisellReservationTablePage.js";
|
|
16
|
+
import "./components/SelectFloorMapResourceDialog.js";
|
|
17
|
+
export {};
|
|
@@ -13,6 +13,7 @@ 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";
|
|
16
17
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
17
18
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
18
19
|
import { SaleDetailTemplateRenderer } from "./tmpl/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import { useMemoizedFn } from "ahooks";
|
|
6
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -4,6 +4,7 @@ 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";
|
|
7
8
|
import { invokeLocalReceiptPrint, resolveLocalReceiptPrintModule, resolveSaleDetailOrderIdFromSales } from "./utils.js";
|
|
8
9
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
9
10
|
import { EBizPrintType } from "./types.js";
|
|
@@ -10,6 +10,7 @@ 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";
|
|
13
14
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
14
15
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
15
16
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -5,6 +5,7 @@ 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";
|
|
8
9
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
9
10
|
import React, { memo, useMemo } from "react";
|
|
10
11
|
import { formatAmount, locales } from "@pisell/utils";
|
|
@@ -5,6 +5,7 @@ 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";
|
|
8
9
|
import Base_default from "./Base.js";
|
|
9
10
|
import { resolveSaleDetailOsProps } from "./osProps.js";
|
|
10
11
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
5
6
|
import { DishGroupView } from "./DishGroupView.js";
|
|
6
7
|
import dayjs from "dayjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
5
6
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
6
7
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "../multiCurrencySettlement/index.js";
|
|
9
|
+
import "./utils/customerAuthGate.js";
|
|
10
|
+
import "./context/SalesSdkBusinessAvailabilityContext.js";
|
|
11
|
+
import "./utils/appendPromotionTags.js";
|
|
12
|
+
import "./utils/productSkuOptions.js";
|
|
13
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
14
|
+
import "./utils/runAddProductFlow.js";
|
|
15
|
+
import "./components/showAddToCartToast.js";
|
|
16
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
17
|
+
import "./utils/identity.js";
|
|
18
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
19
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
20
|
+
import "./utils/bookingDate.js";
|
|
21
|
+
import "./utils/holderSubmitValidation.js";
|
|
22
|
+
import "./utils/removeOrderProducts.js";
|
|
23
|
+
import "./selectors.js";
|
|
24
|
+
import "./utils/enrich.js";
|
|
25
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
26
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
27
|
+
import "./hooks/useSalesSdk.js";
|
|
28
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
29
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
30
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
31
|
+
import "./hooks/useSalesSdkCart.js";
|
|
32
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
33
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
34
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
35
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
36
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
37
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
38
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
39
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
40
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
41
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
42
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
43
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
44
|
+
import "./allergy/AllergySelectionModal.js";
|
|
45
|
+
import "./context/SalesSdkProvider.js";
|
|
46
|
+
import "./context/SalesSdkDishContext.js";
|
|
47
|
+
import "./context/SalesSdkBookingContext.js";
|
|
48
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
49
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
50
|
+
import "./demo/index.js";
|
|
51
|
+
import "./hooks/useSalesSdkDish.js";
|
|
52
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
53
|
+
import "./hooks/useSyncOsModule.js";
|
|
54
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
|
|
105
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethodType, VerificationMethod } from "./shared/types.js";
|
|
1
|
+
import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, 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
|
|
4
|
+
import { AuthModal } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useScrollActivity from "../../../hooks/useScrollActivity.js";
|
|
3
|
-
import
|
|
3
|
+
import { observeTransitions } from "./observeTransitions.js";
|
|
4
|
+
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { Button } from "antd";
|
|
5
6
|
import classNames from "classnames";
|
|
6
7
|
import { createPortal } from "react-dom";
|
|
@@ -8,7 +9,6 @@ import "./index.less";
|
|
|
8
9
|
//#region src/pro/compensatedPisellContainer/floatingLayer/index.tsx
|
|
9
10
|
const prefixCls = "pisell-lowcode-floating-layer";
|
|
10
11
|
const legacyDrawerPrefixCls = "pisell-lowcode-drawer";
|
|
11
|
-
const motionDuration = 300;
|
|
12
12
|
const ModalButton = Button;
|
|
13
13
|
const overlayBaseZIndex = 600;
|
|
14
14
|
const overlayZIndexStep = 10;
|
|
@@ -72,35 +72,28 @@ const getFloatingLayoutState = (isLayoutChanging = false) => {
|
|
|
72
72
|
viewportSize: getViewportSize()
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
const
|
|
76
|
-
return Math.abs(prevLayout.bodyScale.x - nextLayout.bodyScale.x) < .001 && Math.abs(prevLayout.bodyScale.y - nextLayout.bodyScale.y) < .001 && prevLayout.viewportSize.width === nextLayout.viewportSize.width && prevLayout.viewportSize.height === nextLayout.viewportSize.height
|
|
75
|
+
const isSameFloatingGeometry = (prevLayout, nextLayout) => {
|
|
76
|
+
return Math.abs(prevLayout.bodyScale.x - nextLayout.bodyScale.x) < .001 && Math.abs(prevLayout.bodyScale.y - nextLayout.bodyScale.y) < .001 && prevLayout.viewportSize.width === nextLayout.viewportSize.width && prevLayout.viewportSize.height === nextLayout.viewportSize.height;
|
|
77
77
|
};
|
|
78
78
|
const useBodyScaleViewport = () => {
|
|
79
79
|
const [layoutState, setLayoutState] = useState(() => getFloatingLayoutState(false));
|
|
80
80
|
const updateFrameRef = useRef();
|
|
81
|
-
const
|
|
81
|
+
const settleFrameRef = useRef();
|
|
82
82
|
useEffect(() => {
|
|
83
83
|
var _window$visualViewpor;
|
|
84
84
|
if (typeof window === "undefined" || typeof document === "undefined") return;
|
|
85
|
-
const
|
|
86
|
-
const nextLayout = getFloatingLayoutState(
|
|
87
|
-
setLayoutState((prevLayout) =>
|
|
88
|
-
};
|
|
89
|
-
const markLayoutSettled = () => {
|
|
90
|
-
if (settleTimerRef.current) window.clearTimeout(settleTimerRef.current);
|
|
91
|
-
settleTimerRef.current = window.setTimeout(() => {
|
|
92
|
-
setNextLayout(false);
|
|
93
|
-
}, motionDuration);
|
|
85
|
+
const updateGeometry = () => {
|
|
86
|
+
const nextLayout = getFloatingLayoutState(true);
|
|
87
|
+
setLayoutState((prevLayout) => isSameFloatingGeometry(prevLayout, nextLayout) ? prevLayout : nextLayout);
|
|
94
88
|
};
|
|
95
89
|
const scheduleScaleViewportUpdate = () => {
|
|
96
90
|
if (updateFrameRef.current) window.cancelAnimationFrame(updateFrameRef.current);
|
|
97
91
|
updateFrameRef.current = window.requestAnimationFrame(() => {
|
|
98
92
|
updateFrameRef.current = void 0;
|
|
99
|
-
|
|
100
|
-
markLayoutSettled();
|
|
93
|
+
updateGeometry();
|
|
101
94
|
});
|
|
102
95
|
};
|
|
103
|
-
|
|
96
|
+
updateGeometry();
|
|
104
97
|
window.addEventListener("resize", scheduleScaleViewportUpdate);
|
|
105
98
|
(_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", scheduleScaleViewportUpdate);
|
|
106
99
|
const bodyObserver = new MutationObserver(scheduleScaleViewportUpdate);
|
|
@@ -111,12 +104,21 @@ const useBodyScaleViewport = () => {
|
|
|
111
104
|
return () => {
|
|
112
105
|
var _window$visualViewpor2;
|
|
113
106
|
if (updateFrameRef.current) window.cancelAnimationFrame(updateFrameRef.current);
|
|
114
|
-
if (settleTimerRef.current) window.clearTimeout(settleTimerRef.current);
|
|
115
107
|
window.removeEventListener("resize", scheduleScaleViewportUpdate);
|
|
116
108
|
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", scheduleScaleViewportUpdate);
|
|
117
109
|
bodyObserver.disconnect();
|
|
118
110
|
};
|
|
119
111
|
}, []);
|
|
112
|
+
useLayoutEffect(() => {
|
|
113
|
+
if (!layoutState.isLayoutChanging) return;
|
|
114
|
+
document.body.getBoundingClientRect();
|
|
115
|
+
settleFrameRef.current = requestAnimationFrame(() => {
|
|
116
|
+
setLayoutState((current) => _objectSpread2(_objectSpread2({}, current), {}, { isLayoutChanging: false }));
|
|
117
|
+
});
|
|
118
|
+
return () => {
|
|
119
|
+
if (settleFrameRef.current !== void 0) cancelAnimationFrame(settleFrameRef.current);
|
|
120
|
+
};
|
|
121
|
+
}, [layoutState]);
|
|
120
122
|
return layoutState;
|
|
121
123
|
};
|
|
122
124
|
const getDefaultDrawerSize = (size) => {
|
|
@@ -233,7 +235,13 @@ const TransformFloatingLayer = (props) => {
|
|
|
233
235
|
shouldAutoHideHeaderFooter
|
|
234
236
|
]);
|
|
235
237
|
const [rendered, setRendered] = useState(mergedOpen);
|
|
236
|
-
const [
|
|
238
|
+
const [motion, setMotion] = useState({
|
|
239
|
+
open: false,
|
|
240
|
+
id: 0
|
|
241
|
+
});
|
|
242
|
+
const motionOpen = motion.open;
|
|
243
|
+
const wrapperRef = useRef(null);
|
|
244
|
+
const maskRef = useRef(null);
|
|
237
245
|
const shouldRenderLayer = rendered || mergedOpen;
|
|
238
246
|
const skipCurrentEnterMotion = skipEnterMotion && mergedOpen;
|
|
239
247
|
const effectiveMotionOpen = skipCurrentEnterMotion ? true : motionOpen;
|
|
@@ -241,10 +249,16 @@ const TransformFloatingLayer = (props) => {
|
|
|
241
249
|
const overlayIdRef = useRef();
|
|
242
250
|
const autoZIndexRef = useRef();
|
|
243
251
|
const autoZIndexActiveRef = useRef(false);
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
|
|
252
|
+
const hasOpenedRef = useRef(false);
|
|
253
|
+
const motionRunRef = useRef(0);
|
|
254
|
+
const motionOptionsRef = useRef({
|
|
255
|
+
afterOpenChange,
|
|
256
|
+
shouldDestroyOnClose
|
|
257
|
+
});
|
|
258
|
+
motionOptionsRef.current = {
|
|
259
|
+
afterOpenChange,
|
|
260
|
+
shouldDestroyOnClose
|
|
261
|
+
};
|
|
248
262
|
if (overlayIdRef.current === void 0) overlayIdRef.current = getNextOverlayId();
|
|
249
263
|
const overlayId = overlayIdRef.current;
|
|
250
264
|
const releaseAutoZIndex = () => {
|
|
@@ -260,50 +274,49 @@ const TransformFloatingLayer = (props) => {
|
|
|
260
274
|
autoZIndexActiveRef.current = true;
|
|
261
275
|
}
|
|
262
276
|
const mergedZIndex = (_ref = zIndex !== null && zIndex !== void 0 ? zIndex : autoZIndexRef.current) !== null && _ref !== void 0 ? _ref : overlayBaseZIndex;
|
|
263
|
-
const updateRendered = (nextRendered) => {
|
|
264
|
-
renderedRef.current = nextRendered;
|
|
265
|
-
setRendered(nextRendered);
|
|
266
|
-
};
|
|
267
277
|
const handleClose = (event) => {
|
|
268
278
|
const closeHandler = mode === "modal" ? onCancel || onClose : onClose || onCancel;
|
|
269
279
|
closeHandler === null || closeHandler === void 0 || closeHandler(event);
|
|
270
280
|
};
|
|
271
|
-
useEffect(() =>
|
|
281
|
+
useEffect(() => () => releaseAutoZIndex(), []);
|
|
282
|
+
useLayoutEffect(() => {
|
|
283
|
+
const id = ++motionRunRef.current;
|
|
284
|
+
let frame;
|
|
285
|
+
if (mergedOpen) {
|
|
286
|
+
hasOpenedRef.current = true;
|
|
287
|
+
setRendered(true);
|
|
288
|
+
}
|
|
289
|
+
if (mergedOpen && !skipEnterMotion && !motionOpen) {
|
|
290
|
+
var _wrapperRef$current, _maskRef$current;
|
|
291
|
+
(_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 || _wrapperRef$current.getBoundingClientRect();
|
|
292
|
+
(_maskRef$current = maskRef.current) === null || _maskRef$current === void 0 || _maskRef$current.getBoundingClientRect();
|
|
293
|
+
frame = requestAnimationFrame(() => {
|
|
294
|
+
frame = requestAnimationFrame(() => setMotion({
|
|
295
|
+
open: true,
|
|
296
|
+
id
|
|
297
|
+
}));
|
|
298
|
+
});
|
|
299
|
+
} else setMotion({
|
|
300
|
+
open: mergedOpen,
|
|
301
|
+
id
|
|
302
|
+
});
|
|
272
303
|
return () => {
|
|
273
|
-
|
|
274
|
-
if (
|
|
275
|
-
releaseAutoZIndex();
|
|
304
|
+
++motionRunRef.current;
|
|
305
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
276
306
|
};
|
|
277
|
-
}, []);
|
|
278
|
-
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
updateRendered(true);
|
|
285
|
-
setMotionOpen(false);
|
|
286
|
-
motionFrameRef.current = window.requestAnimationFrame(() => {
|
|
287
|
-
setMotionOpen(true);
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
else setMotionOpen(false);
|
|
291
|
-
if (!mountedRef.current) {
|
|
292
|
-
mountedRef.current = true;
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
motionTimerRef.current = window.setTimeout(() => {
|
|
296
|
-
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(mergedOpen);
|
|
297
|
-
if (!mergedOpen) {
|
|
307
|
+
}, [mergedOpen, skipEnterMotion]);
|
|
308
|
+
useLayoutEffect(() => {
|
|
309
|
+
if (!hasOpenedRef.current || motion.id !== motionRunRef.current || motion.open !== mergedOpen) return;
|
|
310
|
+
return observeTransitions([wrapperRef.current, maskRef.current].filter((element) => element !== null), () => {
|
|
311
|
+
var _motionOptionsRef$cur, _motionOptionsRef$cur2;
|
|
312
|
+
if (motion.id !== motionRunRef.current) return;
|
|
313
|
+
if (!motion.open) {
|
|
298
314
|
releaseAutoZIndex();
|
|
299
|
-
if (shouldDestroyOnClose)
|
|
315
|
+
if (motionOptionsRef.current.shouldDestroyOnClose) setRendered(false);
|
|
300
316
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
mergedOpen,
|
|
305
|
-
shouldDestroyOnClose
|
|
306
|
-
]);
|
|
317
|
+
(_motionOptionsRef$cur = (_motionOptionsRef$cur2 = motionOptionsRef.current).afterOpenChange) === null || _motionOptionsRef$cur === void 0 || _motionOptionsRef$cur.call(_motionOptionsRef$cur2, motion.open);
|
|
318
|
+
});
|
|
319
|
+
}, [motion, mergedOpen]);
|
|
307
320
|
useEffect(() => {
|
|
308
321
|
if (!mergedOpen || keyboard === false || typeof window === "undefined") return;
|
|
309
322
|
const handleKeyDown = (event) => {
|
|
@@ -410,12 +423,14 @@ const TransformFloatingLayer = (props) => {
|
|
|
410
423
|
className: classNames(`${prefixCls}-root`, `${prefixCls}-mode-${mode}`, `${prefixCls}-${centered && mode === "modal" ? "center" : placement}`, getLegacyDrawerRootClasses(mode, placement), rootClassName, wrapClassName, layerClassNames === null || layerClassNames === void 0 ? void 0 : layerClassNames.root),
|
|
411
424
|
style: _objectSpread2(_objectSpread2(_objectSpread2({ zIndex: mergedZIndex }, rootScaleStyle), rootStyle), styles === null || styles === void 0 ? void 0 : styles.root)
|
|
412
425
|
}, mask ? /* @__PURE__ */ React.createElement("div", {
|
|
426
|
+
ref: maskRef,
|
|
413
427
|
className: classNames(`${prefixCls}-mask`, getLegacyDrawerClass(mode, "mask"), layerClassNames === null || layerClassNames === void 0 ? void 0 : layerClassNames.mask),
|
|
414
428
|
style: maskStyle,
|
|
415
429
|
onClick: (event) => {
|
|
416
430
|
if (event.target === event.currentTarget && maskClosable) handleClose(event);
|
|
417
431
|
}
|
|
418
432
|
}) : null, /* @__PURE__ */ React.createElement("div", {
|
|
433
|
+
ref: wrapperRef,
|
|
419
434
|
className: classNames(`${prefixCls}-content-wrapper`, getLegacyDrawerWrapperClasses(mode), className, layerClassNames === null || layerClassNames === void 0 ? void 0 : layerClassNames.wrapper),
|
|
420
435
|
style: wrapperStyle
|
|
421
436
|
}, modalRender ? modalRender(contentNode) : contentNode)) : null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region src/pro/compensatedPisellContainer/floatingLayer/observeTransitions.ts
|
|
2
|
+
/** Observe only the shell's own transitions, never animations inside its content. */
|
|
3
|
+
const observeTransitions = (elements, onSettled) => {
|
|
4
|
+
let disposed = false;
|
|
5
|
+
let frame;
|
|
6
|
+
const pendingEvents = /* @__PURE__ */ new Map();
|
|
7
|
+
const supportsAnimations = elements.every((element) => typeof element.getAnimations === "function");
|
|
8
|
+
const isMotionProperty = (property) => property === "opacity" || property === "transform";
|
|
9
|
+
const check = () => {
|
|
10
|
+
if (disposed) return;
|
|
11
|
+
if (supportsAnimations) {
|
|
12
|
+
const transitions = [];
|
|
13
|
+
elements.forEach((element) => {
|
|
14
|
+
transitions.push(...element.getAnimations().filter((animation) => isMotionProperty(animation.transitionProperty) && animation.playState !== "finished" && animation.playState !== "idle"));
|
|
15
|
+
});
|
|
16
|
+
if (transitions.length) {
|
|
17
|
+
Promise.all(transitions.map((animation) => animation.finished.catch(() => void 0))).then(check);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
} else if ([...pendingEvents.values()].some((properties) => properties.size)) return;
|
|
21
|
+
disposed = true;
|
|
22
|
+
removeListeners();
|
|
23
|
+
onSettled();
|
|
24
|
+
};
|
|
25
|
+
const scheduleCheck = () => {
|
|
26
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
27
|
+
frame = requestAnimationFrame(check);
|
|
28
|
+
};
|
|
29
|
+
const handleTransition = (event) => {
|
|
30
|
+
const transition = event;
|
|
31
|
+
if (event.target !== event.currentTarget || !isMotionProperty(transition.propertyName)) return;
|
|
32
|
+
const element = event.currentTarget;
|
|
33
|
+
const properties = pendingEvents.get(element);
|
|
34
|
+
if (event.type === "transitionrun") properties.add(transition.propertyName);
|
|
35
|
+
else {
|
|
36
|
+
properties.delete(transition.propertyName);
|
|
37
|
+
scheduleCheck();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const removeListeners = () => {
|
|
41
|
+
elements.forEach((element) => {
|
|
42
|
+
element.removeEventListener("transitionrun", handleTransition);
|
|
43
|
+
element.removeEventListener("transitionend", handleTransition);
|
|
44
|
+
element.removeEventListener("transitioncancel", handleTransition);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
elements.forEach((element) => {
|
|
48
|
+
pendingEvents.set(element, /* @__PURE__ */ new Set());
|
|
49
|
+
if (!supportsAnimations) {
|
|
50
|
+
element.addEventListener("transitionrun", handleTransition);
|
|
51
|
+
element.addEventListener("transitionend", handleTransition);
|
|
52
|
+
element.addEventListener("transitioncancel", handleTransition);
|
|
53
|
+
}
|
|
54
|
+
element.getBoundingClientRect();
|
|
55
|
+
});
|
|
56
|
+
if (supportsAnimations) Promise.resolve().then(check);
|
|
57
|
+
else frame = requestAnimationFrame(scheduleCheck);
|
|
58
|
+
return () => {
|
|
59
|
+
disposed = true;
|
|
60
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
61
|
+
removeListeners();
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { observeTransitions };
|