@adyen/adyen-platform-experience-web 1.0.0-beta → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ModalContent-88fdb6f4.js +2 -0
- package/dist/ModalContent-88fdb6f4.js.map +1 -0
- package/dist/cjs/index.js +1 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/components/external/BaseElement.js +48 -88
- package/dist/es/components/external/EventEmitter.js +17 -28
- package/dist/es/components/external/TransactionDetails/TransactionDetails.js +15 -20
- package/dist/es/components/external/TransactionDetails/components/TransactionData.js +41 -42
- package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +13 -13
- package/dist/es/components/external/TransactionDetails/components/TransactionDetails.js +28 -39
- package/dist/es/components/external/TransactionDetails/components/TransactionDetails.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/TransactionsOverviewElement.js +25 -31
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.js +7 -10
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/AmountSkeleton/constants.js +4 -6
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/BalanceAccountSelector.js +21 -22
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/BalanceAccountSelector.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/useBalanceAccountSelection.js +13 -21
- package/dist/es/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.js +22 -25
- package/dist/es/components/external/TransactionsOverview/components/Balances/Balances.js +36 -47
- package/dist/es/components/external/TransactionsOverview/components/Balances/constants.js +2 -2
- package/dist/es/components/external/TransactionsOverview/components/Category/Category.js +8 -9
- package/dist/es/components/external/TransactionsOverview/components/ModalContent.js +9 -9
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.js +23 -25
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.js +13 -16
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/useMultiSelectionFilter.js +16 -26
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.js +7 -9
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.js +42 -50
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.js +18 -19
- package/dist/es/components/external/TransactionsOverview/components/SummaryItem/constants.js +8 -14
- package/dist/es/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.js +16 -16
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.js +37 -42
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.js +36 -39
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.js +48 -60
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionTotals/constants.js +3 -4
- package/dist/es/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.js +62 -73
- package/dist/es/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsDisplay/constants.js +3 -4
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.js +133 -152
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverview/constants.js +4 -6
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.js +32 -40
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/TransactionsOverviewContainer.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewContainer/constants.js +3 -4
- package/dist/es/components/external/TransactionsOverview/components/TransactionsOverviewDateFilter.js +49 -53
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/TransactionTable.scss.js +4 -0
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.js +75 -84
- package/dist/es/components/external/TransactionsOverview/components/TransactionsTable/constants.js +6 -10
- package/dist/es/components/external/TransactionsOverview/components/utils.js +6 -12
- package/dist/es/components/external/TransactionsOverview/hooks/useDefaultTransactionsOverviewFilterParams.js +21 -39
- package/dist/es/components/external/TransactionsOverview/hooks/useMaxWidths.js +9 -10
- package/dist/es/components/external/TransactionsOverview/hooks/useMediaQuery.js +23 -28
- package/dist/es/components/external/TransactionsOverview/hooks/useTransactionsOverviewMultiSelectionFilters.js +24 -28
- package/dist/es/components/external/TransactionsOverview/types.js +4 -0
- package/dist/es/components/external/UIElement.js +38 -51
- package/dist/es/components/internal/BaseButton/BaseButton.js +18 -21
- package/dist/es/components/internal/BaseButton/BaseButton.scss.js +4 -0
- package/dist/es/components/internal/BaseButton/constants.js +2 -2
- package/dist/es/components/internal/BaseList/BaseList.js +5 -8
- package/dist/es/components/internal/BaseList/BaseList.scss.js +4 -0
- package/dist/es/components/internal/BaseList/constants.js +2 -2
- package/dist/es/components/internal/Button/Button.js +39 -41
- package/dist/es/components/internal/Button/Button.scss.js +4 -0
- package/dist/es/components/internal/Button/ButtonActions/ButtonActions.js +27 -8
- package/dist/es/components/internal/Button/ButtonActions/ButtonActions.scss.js +4 -0
- package/dist/es/components/internal/Button/ButtonActions/types.js +7 -0
- package/dist/es/components/internal/Button/constants.js +9 -16
- package/dist/es/components/internal/Button/hooks/useButton.js +13 -17
- package/dist/es/components/internal/Button/types.js +4 -0
- package/dist/es/components/internal/Calendar/Calendar.js +20 -21
- package/dist/es/components/internal/Calendar/Calendar.scss.js +4 -0
- package/dist/es/components/internal/Calendar/calendar/constants.js +35 -70
- package/dist/es/components/internal/Calendar/calendar/facade/Calendar.js +322 -552
- package/dist/es/components/internal/Calendar/calendar/facade/index.js +37 -46
- package/dist/es/components/internal/Calendar/calendar/shared/indexed/index.js +34 -46
- package/dist/es/components/internal/Calendar/calendar/timeframe/common/flags.js +31 -5
- package/dist/es/components/internal/Calendar/calendar/timeframe/common/utils.js +14 -16
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/MonthFrame.js +122 -221
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.js +238 -418
- package/dist/es/components/internal/Calendar/calendar/timerange/factory.js +40 -63
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastMonth.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.js +16 -27
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastWeek.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetMonth.js +14 -23
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/shared/offsetWeek.js +21 -29
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisMonth.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisWeek.js +3 -3
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.js +9 -13
- package/dist/es/components/internal/Calendar/calendar/timerange/utils.js +49 -83
- package/dist/es/components/internal/Calendar/calendar/timeslice/TimeSlice.js +38 -61
- package/dist/es/components/internal/Calendar/calendar/timeslice/index.js +17 -21
- package/dist/es/components/internal/Calendar/calendar/types.js +15 -0
- package/dist/es/components/internal/Calendar/calendar/utils.js +15 -22
- package/dist/es/components/internal/Calendar/clock/clock.js +23 -41
- package/dist/es/components/internal/Calendar/clock/today.js +37 -57
- package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +7 -12
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGrid.js +26 -28
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDate.js +33 -58
- package/dist/es/components/internal/Calendar/components/CalendarGrid/CalendarGridDayOfWeek.js +30 -40
- package/dist/es/components/internal/Calendar/components/CalendarGrid/utils.js +44 -49
- package/dist/es/components/internal/Calendar/hooks/useCalendar.js +84 -115
- package/dist/es/components/internal/Calendar/hooks/useCalendarControlsRendering.js +35 -40
- package/dist/es/components/internal/Calendar/hooks/useTimezone.js +24 -46
- package/dist/es/components/internal/Calendar/types.js +4 -0
- package/dist/es/components/internal/CopyText/CopyText.js +26 -31
- package/dist/es/components/internal/CopyText/CopyText.scss.js +4 -0
- package/dist/es/components/internal/DataGrid/DataGrid.js +93 -10
- package/dist/es/components/internal/DataGrid/DataGrid.scss.js +4 -0
- package/dist/es/components/internal/DataGrid/DataGridCell.js +4 -4
- package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +38 -8
- package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +15 -17
- package/dist/es/components/internal/DataGrid/components/TableBody.js +19 -19
- package/dist/es/components/internal/DataGrid/components/TableCells.js +19 -25
- package/dist/es/components/internal/DataGrid/hooks/useInteractiveDataGrid.js +76 -5
- package/dist/es/components/internal/DataGrid/types.js +4 -0
- package/dist/es/components/internal/DatePicker/DatePicker.js +45 -62
- package/dist/es/components/internal/DatePicker/DatePicker.scss.js +4 -0
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/TimeRangeSelector.js +26 -43
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.js +56 -85
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +45 -53
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.scss.js +4 -0
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +56 -75
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.scss.js +4 -0
- package/dist/es/components/internal/ExpandableCard/constants.js +11 -20
- package/dist/es/components/internal/FilterBar/FilterBar.js +32 -35
- package/dist/es/components/internal/FilterBar/FilterBar.scss.js +4 -0
- package/dist/es/components/internal/FilterBar/components/FilterButton/FilterButton.js +15 -17
- package/dist/es/components/internal/FilterBar/components/FilterButton/FilterButton.scss.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.js +41 -63
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/AmountFilter.scss.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/RangeSelection.js +53 -68
- package/dist/es/components/internal/FilterBar/filters/AmountFilter/constants.js +2 -2
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +104 -153
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilter.js +118 -10
- package/dist/es/components/internal/FilterBar/filters/DateFilter/DateFilter.scss.js +4 -0
- package/dist/es/components/internal/FilterBar/filters/DateFilter/types.js +4 -0
- package/dist/es/components/internal/FormFields/FormFields.scss.js +4 -0
- package/dist/es/components/internal/FormFields/InputBase.js +53 -66
- package/dist/es/components/internal/FormFields/InputText.js +6 -6
- package/dist/es/components/internal/FormFields/Select/Select.js +187 -246
- package/dist/es/components/internal/FormFields/Select/Select.scss.js +4 -0
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +68 -72
- package/dist/es/components/internal/FormFields/Select/components/SelectList.js +62 -71
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +37 -41
- package/dist/es/components/internal/FormFields/Select/constants.js +27 -49
- package/dist/es/components/internal/FormFields/Select/hooks/useSelect.js +27 -35
- package/dist/es/components/internal/Image/Image.js +10 -10
- package/dist/es/components/internal/Img/Img.js +18 -32
- package/dist/es/components/internal/Img/Img.scss.js +4 -0
- package/dist/es/components/internal/Modal/Modal.js +58 -77
- package/dist/es/components/internal/Modal/Modal.scss.js +4 -0
- package/dist/es/components/internal/Pagination/Pagination.js +52 -58
- package/dist/es/components/internal/Pagination/Pagination.scss.js +4 -0
- package/dist/es/components/internal/Pagination/constants.js +4 -6
- package/dist/es/components/internal/Pagination/hooks/useCursorPaginatedRecords.js +7 -8
- package/dist/es/components/internal/Pagination/hooks/useCursorPagination.js +18 -30
- package/dist/es/components/internal/Pagination/hooks/useOffsetPagination.js +14 -21
- package/dist/es/components/internal/Pagination/hooks/usePageLimit.js +52 -60
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecords.js +80 -11
- package/dist/es/components/internal/Pagination/hooks/usePaginatedRecordsFilters.js +12 -13
- package/dist/es/components/internal/Pagination/hooks/usePagination.js +43 -87
- package/dist/es/components/internal/Pagination/types.js +5 -0
- package/dist/es/components/internal/Pagination/utils.js +5 -5
- package/dist/es/components/internal/Popover/Popover.js +106 -139
- package/dist/es/components/internal/Popover/Popover.scss.js +4 -0
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +18 -22
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.scss.js +4 -0
- package/dist/es/components/internal/Popover/PopoverTitle/PopoverTitle.js +8 -10
- package/dist/es/components/internal/Popover/constants.js +9 -16
- package/dist/es/components/internal/Popover/types.js +6 -0
- package/dist/es/components/internal/Popover/utils/popoverUtil.js +27 -45
- package/dist/es/components/internal/Popover/utils/utils.js +23 -29
- package/dist/es/components/internal/SVGIcons/CheckedBox.js +6 -6
- package/dist/es/components/internal/SVGIcons/Checkmark.js +7 -7
- package/dist/es/components/internal/SVGIcons/ChevronDown.js +6 -6
- package/dist/es/components/internal/SVGIcons/ChevronLeft.js +8 -8
- package/dist/es/components/internal/SVGIcons/ChevronRight.js +8 -8
- package/dist/es/components/internal/SVGIcons/ChevronUp.js +7 -7
- package/dist/es/components/internal/SVGIcons/Close.js +4 -4
- package/dist/es/components/internal/SVGIcons/Copy.js +3 -3
- package/dist/es/components/internal/SVGIcons/Filter.js +4 -4
- package/dist/es/components/internal/SVGIcons/UncheckedBox.js +6 -6
- package/dist/es/components/internal/Spinner/Spinner.js +4 -5
- package/dist/es/components/internal/Spinner/Spinner.scss.js +4 -0
- package/dist/es/components/internal/Tag/Tag.js +19 -5
- package/dist/es/components/internal/Tag/Tag.scss.js +4 -0
- package/dist/es/components/internal/Tag/types.js +4 -0
- package/dist/es/components/internal/Tooltip/Tooltip.js +31 -38
- package/dist/es/components/internal/Tooltip/Tooltip.scss.js +4 -0
- package/dist/es/components/internal/Tooltip/useTooltipListeners.js +17 -20
- package/dist/es/components/internal/Typography/Typography.js +33 -7
- package/dist/es/components/internal/Typography/Typography.scss.js +4 -0
- package/dist/es/components/internal/Typography/constants.js +2 -2
- package/dist/es/components/internal/Typography/types.js +6 -0
- package/dist/es/components/shared.scss.js +4 -0
- package/dist/es/components/types.js +4 -0
- package/dist/es/components/utils/transactionResourceErrorCodes.js +14 -15
- package/dist/es/constants.js +2 -2
- package/dist/es/core/Auth/AuthContext.js +7 -7
- package/dist/es/core/Auth/AuthProvider.js +15 -23
- package/dist/es/core/Auth/useAuthContext.js +4 -4
- package/dist/es/core/Context/CoreContext.js +5 -5
- package/dist/es/core/Context/CoreProvider.js +17 -23
- package/dist/es/core/Context/useCoreContext.js +4 -4
- package/dist/es/core/Errors/AdyenPlatformExperienceError.js +12 -17
- package/dist/es/core/Errors/constants.js +2 -4
- package/dist/es/core/Localization/Localization.js +155 -12
- package/dist/es/core/Localization/amount/amount-util.js +19 -42
- package/dist/es/core/Localization/constants/currency-codes.js +3 -3
- package/dist/es/core/Localization/constants/currency-decimals.js +3 -3
- package/dist/es/core/Localization/constants/locale.js +5 -7
- package/dist/es/core/Localization/constants/localization.js +6 -9
- package/dist/es/core/Localization/datetime/restamper/constants.js +20 -29
- package/dist/es/core/Localization/datetime/restamper/restamper.js +32 -44
- package/dist/es/core/Localization/datetime/restamper/utils.js +26 -44
- package/dist/es/core/Localization/localization-utils.js +31 -7
- package/dist/es/core/Localization/translations/ar.json.js +4 -0
- package/dist/es/core/Localization/translations/cs-CZ.json.js +4 -0
- package/dist/es/core/Localization/translations/da-DK.json.js +4 -0
- package/dist/es/core/Localization/translations/de-DE.json.js +4 -0
- package/dist/es/core/Localization/translations/el-GR.json.js +4 -0
- package/dist/es/core/Localization/translations/en-US.json.js +371 -0
- package/dist/es/core/Localization/translations/es-ES.json.js +255 -0
- package/dist/es/core/Localization/translations/fi-FI.json.js +4 -0
- package/dist/es/core/Localization/translations/fr-FR.json.js +4 -0
- package/dist/es/core/Localization/translations/hr-HR.json.js +4 -0
- package/dist/es/core/Localization/translations/hu-HU.json.js +4 -0
- package/dist/es/core/Localization/translations/index.js +79 -356
- package/dist/es/core/Localization/translations/it-IT.json.js +4 -0
- package/dist/es/core/Localization/translations/ja-JP.json.js +4 -0
- package/dist/es/core/Localization/translations/ko-KR.json.js +4 -0
- package/dist/es/core/Localization/translations/nl-NL.json.js +4 -0
- package/dist/es/core/Localization/translations/no-NO.json.js +4 -0
- package/dist/es/core/Localization/translations/pl-PL.json.js +4 -0
- package/dist/es/core/Localization/translations/pt-BR.json.js +4 -0
- package/dist/es/core/Localization/translations/pt-PT.json.js +4 -0
- package/dist/es/core/Localization/translations/ro-RO.json.js +4 -0
- package/dist/es/core/Localization/translations/ru-RU.json.js +4 -0
- package/dist/es/core/Localization/translations/sk-SK.json.js +4 -0
- package/dist/es/core/Localization/translations/sl-SI.json.js +4 -0
- package/dist/es/core/Localization/translations/sv-SE.json.js +4 -0
- package/dist/es/core/Localization/translations/zh-CN.json.js +4 -0
- package/dist/es/core/Localization/translations/zh-TW.json.js +4 -0
- package/dist/es/core/Localization/utils.js +44 -72
- package/dist/es/core/Services/requests/http.js +31 -49
- package/dist/es/core/Services/requests/utils.js +34 -49
- package/dist/es/core/Services/sessions/constants.js +2 -2
- package/dist/es/core/Services/sessions/setup-session.js +9 -9
- package/dist/es/core/Session/Session.js +23 -38
- package/dist/es/core/Session/utils.js +5 -5
- package/dist/es/core/config.js +2 -6
- package/dist/es/core/core.js +44 -85
- package/dist/es/core/utils.js +8 -10
- package/dist/es/external/preact/compat/dist/compat.module.js +253 -0
- package/dist/es/external/preact/dist/preact.module.js +316 -0
- package/dist/es/external/preact/hooks/dist/hooks.module.js +161 -0
- package/dist/es/external/preact/jsx-runtime/dist/jsxRuntime.module.js +19 -0
- package/dist/es/hooks/element/useClickOutside.js +32 -73
- package/dist/es/hooks/element/useDetachedRender.js +15 -17
- package/dist/es/hooks/element/useFocusCursor.js +14 -19
- package/dist/es/hooks/element/useFocusTrap.js +48 -91
- package/dist/es/hooks/element/usePopoverPositioner.js +105 -5
- package/dist/es/hooks/element/useUniqueIdentifier.js +13 -17
- package/dist/es/hooks/useBooleanState/useBooleanState.js +6 -8
- package/dist/es/hooks/useCommitAction/types.js +4 -0
- package/dist/es/hooks/useCommitAction/useCommitAction.js +27 -38
- package/dist/es/hooks/useFetch/useFetch.js +27 -37
- package/dist/es/hooks/useImageUrl/useImageUrl.js +22 -26
- package/dist/es/hooks/useModalDetails/types.js +6 -0
- package/dist/es/hooks/useModalDetails/useModalDetails.js +28 -37
- package/dist/es/hooks/useMounted/useMounted.js +8 -14
- package/dist/es/hooks/useReactiveState/useReactiveState.js +27 -53
- package/dist/es/hooks/useReflex/constants.js +2 -2
- package/dist/es/hooks/useReflex/core/reflex.js +47 -66
- package/dist/es/hooks/useReflex/core/registry.js +46 -68
- package/dist/es/hooks/useReflex/core/utils.js +16 -18
- package/dist/es/hooks/useReflex/errors.js +6 -6
- package/dist/es/hooks/useReflex/hooks/useReflex.js +7 -12
- package/dist/es/hooks/useSessionAwareRequest/useSessionAwareRequest.js +22 -36
- package/dist/es/hooks/useSetupEndpoint/useSetupEndpoint.js +20 -26
- package/dist/es/images/no-data-female.svg.js +4 -0
- package/dist/es/images/no-results.svg.js +4 -0
- package/dist/es/index.js +41 -45
- package/dist/es/style/index.scss.js +4 -0
- package/dist/es/utils/Storage.js +17 -21
- package/dist/es/utils/class-name-utils.js +5 -11
- package/dist/es/utils/common/constants.js +6 -10
- package/dist/es/utils/common/index.js +32 -59
- package/dist/es/utils/fixedForwardRef.js +3 -3
- package/dist/es/utils/get-image.js +11 -12
- package/dist/es/utils/idGenerator.js +3 -6
- package/dist/es/utils/memoComparator/memoComparator.js +17 -26
- package/dist/es/utils/tabbable.js +71 -110
- package/dist/es/utils/uuid.js +5 -5
- package/dist/es/utils/validator-utils.js +3 -44
- package/dist/es/utils/watchable/constants.js +2 -2
- package/dist/es/utils/watchable/core/Watchable.js +45 -83
- package/dist/es/utils/watchable/core/helpers.js +19 -26
- package/dist/es/utils/watchable/core/syncEffect.js +15 -19
- package/dist/es/utils/watchable/index.js +16 -17
- package/dist/index-7e2df524.js +12 -0
- package/dist/index-7e2df524.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/components/external/TransactionDetails/TransactionDetails.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/TransactionDetails.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/components/TransactionData.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/components/TransactionData.d.ts.map +1 -1
- package/dist/types/components/external/TransactionDetails/types.d.ts +3 -3
- package/dist/types/components/external/TransactionDetails/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/AmountSkeleton/AmountSkeleton.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceAccountSelector/useBalanceAccountSelection.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/BalanceAccountSelector/useBalanceAccountSelection.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/BalanceItem.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/types.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/BalanceItem/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/Balances/Balances.d.ts +3 -3
- package/dist/types/components/external/TransactionsOverview/components/Balances/Balances.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/Category/Category.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/Category/Category.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/Category/types.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/Category/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/ModalContent.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/ModalContent.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/MultiSelectionFilter.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/constants.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/types.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/utils.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/SummaryItemLabel.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/types.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/SummaryItem/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionListError/TransactionListError.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/TransactionTotalItem.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/types.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotalItem/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TotalsCard.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.d.ts +3 -3
- package/dist/types/components/external/TransactionsOverview/components/TransactionTotals/TransactionTotals.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/TransactionsDisplay.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/types.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsDisplay/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.d.ts +2 -2
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverview/TransactionsOverview.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewDateFilter.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsOverviewDateFilter.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/TransactionsTable.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts +4 -4
- package/dist/types/components/external/TransactionsOverview/components/TransactionsTable/types.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useDefaultTransactionsOverviewFilterParams.d.ts +1 -0
- package/dist/types/components/external/TransactionsOverview/hooks/useDefaultTransactionsOverviewFilterParams.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useMediaQuery.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useTransactionsOverviewMultiSelectionFilters.d.ts +1 -1
- package/dist/types/components/external/TransactionsOverview/hooks/useTransactionsOverviewMultiSelectionFilters.d.ts.map +1 -1
- package/dist/types/components/external/TransactionsOverview/types.d.ts +2 -1
- package/dist/types/components/external/TransactionsOverview/types.d.ts.map +1 -1
- package/dist/types/components/external/UIElement.d.ts +1 -1
- package/dist/types/components/external/UIElement.d.ts.map +1 -1
- package/dist/types/components/internal/BaseList/BaseList.d.ts +1 -1
- package/dist/types/components/internal/BaseList/BaseList.d.ts.map +1 -1
- package/dist/types/components/internal/Button/ButtonActions/ButtonActions.d.ts +1 -1
- package/dist/types/components/internal/Button/ButtonActions/ButtonActions.d.ts.map +1 -1
- package/dist/types/components/internal/Button/ButtonActions/types.d.ts +1 -1
- package/dist/types/components/internal/Button/ButtonActions/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/shared/indexed/index.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timeframe/frames/TimeFrame.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/types.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/timerange/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts +1 -1
- package/dist/types/components/internal/Calendar/calendar/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/clock/today.d.ts +1 -1
- package/dist/types/components/internal/Calendar/clock/today.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/clock/types.d.ts +2 -2
- package/dist/types/components/internal/Calendar/clock/types.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/components/CalendarGrid/utils.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts +1 -1
- package/dist/types/components/internal/Calendar/hooks/useCalendar.d.ts.map +1 -1
- package/dist/types/components/internal/Calendar/hooks/useTimezone.d.ts +1 -1
- package/dist/types/components/internal/Calendar/hooks/useTimezone.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/InteractiveBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/InteractiveBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/components/TableBody.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts +2 -2
- package/dist/types/components/internal/DataGrid/components/TableCells.d.ts.map +1 -1
- package/dist/types/components/internal/DataGrid/hooks/useInteractiveDataGrid.d.ts +1 -1
- package/dist/types/components/internal/DataGrid/types.d.ts +2 -2
- package/dist/types/components/internal/DataGrid/types.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/internal/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.d.ts +3 -3
- package/dist/types/components/internal/DatePicker/components/TimeRangeSelector/useTimeRangeSelection.d.ts.map +1 -1
- package/dist/types/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.d.ts +1 -1
- package/dist/types/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/types.d.ts +2 -2
- package/dist/types/components/internal/FilterBar/filters/AmountFilter/types.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/BaseFilter/types.d.ts +2 -2
- package/dist/types/components/internal/FilterBar/filters/BaseFilter/types.d.ts.map +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/types.d.ts +1 -1
- package/dist/types/components/internal/FilterBar/filters/DateFilter/types.d.ts.map +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/types.d.ts +1 -1
- package/dist/types/components/internal/Pagination/hooks/types.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecordsFilters.d.ts +1 -1
- package/dist/types/components/internal/Pagination/hooks/usePaginatedRecordsFilters.d.ts.map +1 -1
- package/dist/types/components/internal/Pagination/types.d.ts +1 -1
- package/dist/types/components/internal/Pagination/types.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/Popover.d.ts +1 -1
- package/dist/types/components/internal/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/internal/Popover/types.d.ts +1 -1
- package/dist/types/components/internal/Popover/types.d.ts.map +1 -1
- package/dist/types/components/internal/Tooltip/types.d.ts +2 -2
- package/dist/types/components/internal/Tooltip/types.d.ts.map +1 -1
- package/dist/types/components/utils/transactionResourceErrorCodes.d.ts +2 -2
- package/dist/types/components/utils/transactionResourceErrorCodes.d.ts.map +1 -1
- package/dist/types/core/Auth/AuthContext.d.ts +1 -1
- package/dist/types/core/Auth/AuthContext.d.ts.map +1 -1
- package/dist/types/core/Auth/AuthProvider.d.ts +1 -1
- package/dist/types/core/Auth/AuthProvider.d.ts.map +1 -1
- package/dist/types/core/Auth/types.d.ts +1 -1
- package/dist/types/core/Auth/types.d.ts.map +1 -1
- package/dist/types/core/Context/CoreContext.d.ts +1 -1
- package/dist/types/core/Context/CoreContext.d.ts.map +1 -1
- package/dist/types/core/Context/types.d.ts +1 -1
- package/dist/types/core/Context/types.d.ts.map +1 -1
- package/dist/types/core/Errors/AdyenPlatformExperienceError.d.ts +1 -1
- package/dist/types/core/Errors/AdyenPlatformExperienceError.d.ts.map +1 -1
- package/dist/types/core/Localization/localization-utils.d.ts.map +1 -1
- package/dist/types/core/Localization/types.d.ts +3 -3
- package/dist/types/core/Localization/types.d.ts.map +1 -1
- package/dist/types/core/Session/types.d.ts +1 -1
- package/dist/types/core/Session/types.d.ts.map +1 -1
- package/dist/types/hooks/element/useClickOutside.d.ts +2 -2
- package/dist/types/hooks/element/useClickOutside.d.ts.map +1 -1
- package/dist/types/hooks/element/usePopoverPositioner.d.ts +1 -1
- package/dist/types/hooks/element/usePopoverPositioner.d.ts.map +1 -1
- package/dist/types/hooks/useCommitAction/types.d.ts +1 -1
- package/dist/types/hooks/useCommitAction/types.d.ts.map +1 -1
- package/dist/types/hooks/useFetch/useFetch.d.ts +1 -1
- package/dist/types/hooks/useFetch/useFetch.d.ts.map +1 -1
- package/dist/types/hooks/useModalDetails/types.d.ts +2 -2
- package/dist/types/hooks/useModalDetails/types.d.ts.map +1 -1
- package/dist/types/hooks/useSessionAwareRequest/useSessionAwareRequest.d.ts +1 -1
- package/dist/types/hooks/useSessionAwareRequest/useSessionAwareRequest.d.ts.map +1 -1
- package/dist/types/hooks/useSetupEndpoint/useSetupEndpoint.d.ts +2 -2
- package/dist/types/hooks/useSetupEndpoint/useSetupEndpoint.d.ts.map +1 -1
- package/dist/types/utils/Validator/types.d.ts +1 -1
- package/dist/types/utils/Validator/types.d.ts.map +1 -1
- package/dist/types/utils/useForm/types.d.ts +1 -1
- package/dist/types/utils/useForm/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/AmountSkeleton.css +0 -23
- package/dist/BalanceAccountSelector.css +0 -4
- package/dist/BaseButton.css +0 -14
- package/dist/BaseList.css +0 -5
- package/dist/Button.css +0 -114
- package/dist/ButtonActions-eb064f69.mjs +0 -46
- package/dist/ButtonActions.css +0 -28
- package/dist/CalendarGrid.css +0 -113
- package/dist/CopyText.css +0 -18
- package/dist/DatePicker.css +0 -64
- package/dist/ErrorMessageDisplay.css +0 -20
- package/dist/ErrorPanel.css +0 -15
- package/dist/ExpandableCard.css +0 -71
- package/dist/FilterBar.css +0 -40
- package/dist/FilterButton.css +0 -48
- package/dist/Img.css +0 -7
- package/dist/InputBase.css +0 -175
- package/dist/Modal.css +0 -110
- package/dist/Pagination.css +0 -25
- package/dist/Popover.css +0 -127
- package/dist/PopoverDismissButton.css +0 -12
- package/dist/RangeSelection.css +0 -26
- package/dist/Select.css +0 -149
- package/dist/SkeletonBody.css +0 -154
- package/dist/Spinner.css +0 -50
- package/dist/SummaryItem.css +0 -37
- package/dist/Tag-6d02fd64.mjs +0 -32
- package/dist/Tag.css +0 -34
- package/dist/Tooltip.css +0 -7
- package/dist/TotalsCard.css +0 -14
- package/dist/TransactionDetails.css +0 -74
- package/dist/TransactionsDisplay.css +0 -4
- package/dist/TransactionsOverview.css +0 -29
- package/dist/TransactionsOverviewContainer.css +0 -3
- package/dist/TransactionsTable.css +0 -18
- package/dist/Typography-11b95870.mjs +0 -68
- package/dist/Typography.css +0 -57
- package/dist/cjs/ModalContent-f4990141.js +0 -10
- package/dist/cjs/ModalContent-f4990141.js.map +0 -1
- package/dist/cjs/index-8c098f20.js +0 -10401
- package/dist/cjs/index-8c098f20.js.map +0 -1
- package/dist/cjs/index.css +0 -1709
- package/dist/compat.module-a4d537ff.mjs +0 -237
- package/dist/en-US-1daadfc1.mjs +0 -371
- package/dist/es/components/external/FormElement.js +0 -78
- package/dist/es/components/external/TransactionDetails/index.js +0 -4
- package/dist/es/components/external/TransactionsOverview/components/BalanceAccountSelector/index.js +0 -6
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/index.js +0 -15
- package/dist/es/components/external/TransactionsOverview/components/MultiSelectionFilter/useMultiSelectionFilter/index.js +0 -13
- package/dist/es/components/external/TransactionsOverview/index.js +0 -6
- package/dist/es/components/external/index.js +0 -8
- package/dist/es/components/index.js +0 -11
- package/dist/es/components/internal/BaseButton/index.js +0 -4
- package/dist/es/components/internal/Button/index.js +0 -4
- package/dist/es/components/internal/Calendar/calendar/index.js +0 -4
- package/dist/es/components/internal/Calendar/calendar/timeframe/frames/YearFrame.js +0 -197
- package/dist/es/components/internal/Calendar/calendar/timeframe/index.js +0 -8
- package/dist/es/components/internal/Calendar/calendar/timerange/factory.test.js +0 -139
- package/dist/es/components/internal/Calendar/calendar/timerange/index.js +0 -4
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/index.js +0 -14
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastMonth.test.js +0 -69
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastNDays.test.js +0 -69
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/lastWeek.test.js +0 -108
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/testing/fixtures.js +0 -15
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/testing/helpers.js +0 -19
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisMonth.test.js +0 -46
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/thisWeek.test.js +0 -85
- package/dist/es/components/internal/Calendar/calendar/timerange/presets/yearToDate.test.js +0 -49
- package/dist/es/components/internal/Calendar/clock/clock.test.js +0 -43
- package/dist/es/components/internal/Calendar/clock/index.js +0 -7
- package/dist/es/components/internal/Calendar/clock/testing/fixtures.js +0 -60
- package/dist/es/components/internal/Calendar/clock/today.test.js +0 -98
- package/dist/es/components/internal/Calendar/components/CalendarControls/index.js +0 -4
- package/dist/es/components/internal/Calendar/components/CalendarGrid/index.js +0 -4
- package/dist/es/components/internal/Calendar/index.js +0 -4
- package/dist/es/components/internal/DataGrid/index.js +0 -4
- package/dist/es/components/internal/DataGrid/tests/DataGrid.test.js +0 -190
- package/dist/es/components/internal/DatePicker/components/TimeRangeSelector/index.js +0 -7
- package/dist/es/components/internal/DatePicker/index.js +0 -4
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.test.js +0 -45
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/index.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/DateFilter/index.js +0 -4
- package/dist/es/components/internal/FilterBar/filters/TextFilter/TextFilter.js +0 -8
- package/dist/es/components/internal/FilterBar/filters/TextFilter/index.js +0 -4
- package/dist/es/components/internal/FilterBar/index.js +0 -4
- package/dist/es/components/internal/FormFields/Select/index.js +0 -4
- package/dist/es/components/internal/FormFields/index.js +0 -18
- package/dist/es/components/internal/FormFields/utils.js +0 -4
- package/dist/es/components/internal/Img/index.js +0 -4
- package/dist/es/components/internal/Modal/index.js +0 -4
- package/dist/es/components/internal/Pagination/components/LimitSelect.js +0 -1
- package/dist/es/components/internal/Pagination/hooks/index.js +0 -6
- package/dist/es/components/internal/Pagination/hooks/useOffsetPaginatedRecords.js +0 -10
- package/dist/es/components/internal/Pagination/index.js +0 -4
- package/dist/es/components/internal/Popover/Popover.test.js +0 -119
- package/dist/es/components/internal/Spinner/index.js +0 -4
- package/dist/es/components/utils/utils.js +0 -34
- package/dist/es/core/Analytics/Analytics.js +0 -63
- package/dist/es/core/Analytics/EventsQueue.js +0 -22
- package/dist/es/core/Analytics/index.js +0 -4
- package/dist/es/core/Errors/ErrorPanel.js +0 -19
- package/dist/es/core/Localization/Localization.test.js +0 -70
- package/dist/es/core/Localization/amount/amount-util.test.js +0 -54
- package/dist/es/core/Localization/datetime/restamper/index.js +0 -9
- package/dist/es/core/Localization/datetime/restamper/restamper.test.js +0 -179
- package/dist/es/core/Localization/datetime/restamper/testing/fixtures.js +0 -21
- package/dist/es/core/Localization/datetime/restamper/testing/helpers.js +0 -27
- package/dist/es/core/Localization/index.js +0 -32
- package/dist/es/core/Localization/utils.test.js +0 -215
- package/dist/es/core/ProcessResponse/index.js +0 -4
- package/dist/es/core/ProcessResponse/process-response.js +0 -40
- package/dist/es/core/Services/analytics/collect-id.js +0 -37
- package/dist/es/core/Services/analytics/log-event.js +0 -14
- package/dist/es/core/Services/analytics/post-telemetry.js +0 -22
- package/dist/es/core/Services/data-set.js +0 -1
- package/dist/es/core/Services/get-dataset.js +0 -13
- package/dist/es/core/Services/requests/endpoints.js +0 -9
- package/dist/es/core/Session/index.js +0 -4
- package/dist/es/core/index.js +0 -36
- package/dist/es/hooks/element/useIdentifierString.js +0 -61
- package/dist/es/hooks/useBooleanState/index.js +0 -4
- package/dist/es/hooks/useCommitAction/index.js +0 -6
- package/dist/es/hooks/useDefinedValue/index.js +0 -4
- package/dist/es/hooks/useDefinedValue/useDefinedValue.js +0 -16
- package/dist/es/hooks/useMounted/index.js +0 -4
- package/dist/es/hooks/useReactiveState/index.js +0 -4
- package/dist/es/hooks/useReflex/core/reflex.test.js +0 -170
- package/dist/es/hooks/useReflex/core/registry.test.js +0 -114
- package/dist/es/hooks/useReflex/core/utils.test.js +0 -59
- package/dist/es/hooks/useReflex/index.js +0 -8
- package/dist/es/utils/Validator/ValidationRuleResult.js +0 -28
- package/dist/es/utils/Validator/Validator.js +0 -67
- package/dist/es/utils/Validator/Validator.test.js +0 -27
- package/dist/es/utils/Validator/defaultRules.js +0 -12
- package/dist/es/utils/Validator/index.js +0 -4
- package/dist/es/utils/get-image.test.js +0 -38
- package/dist/es/utils/memoComparator/index.js +0 -4
- package/dist/es/utils/regex.js +0 -6
- package/dist/es/utils/useForm/index.js +0 -4
- package/dist/es/utils/useForm/reducer.js +0 -153
- package/dist/es/utils/useForm/useForm.js +0 -85
- package/dist/es/utils/useForm/useForm.test.js +0 -107
- package/dist/es/utils/uuid.test.js +0 -13
- package/dist/es/utils/watchable/core/Watchable.test.js +0 -103
- package/dist/es/utils/watchable/core/helpers.test.js +0 -106
- package/dist/es/utils/watchable/core/syncEffect.test.js +0 -103
- package/dist/flags-41c36e13.mjs +0 -83
- package/dist/hooks.module-8565d716.mjs +0 -161
- package/dist/index-2c0f6175.mjs +0 -12069
- package/dist/index-6e47f755.mjs +0 -231
- package/dist/index-944be685.mjs +0 -6609
- package/dist/index-c88cd37e.mjs +0 -243
- package/dist/index-f5bc0382.mjs +0 -155
- package/dist/index.css +0 -65
- package/dist/index2.css +0 -4
- package/dist/jsxRuntime.module-69493d81.mjs +0 -15
- package/dist/magic-string.es-219c273f.mjs +0 -1146
- package/dist/preact.module-38e5a571.mjs +0 -323
- package/dist/types-0027b7c2.mjs +0 -9
- package/dist/types-0aaff3aa.mjs +0 -19
- package/dist/types-7ad6576a.mjs +0 -10
- package/dist/types-e4bbd37f.mjs +0 -13
- package/dist/types-e6a6a3ff.mjs +0 -9
- package/dist/usePaginatedRecords-63a69bf1.mjs +0 -131
- package/dist/usePopoverPositioner-882fea89.mjs +0 -182
- package/dist/vendor-vi.a3ff54b1-5e924357.mjs +0 -22389
|
@@ -1,1146 +0,0 @@
|
|
|
1
|
-
import { f as commonjsGlobal } from "./vendor-vi.a3ff54b1-5e924357.mjs";
|
|
2
|
-
var sourcemapCodec_umd = { exports: {} };
|
|
3
|
-
(function(module, exports) {
|
|
4
|
-
(function(global, factory) {
|
|
5
|
-
factory(exports);
|
|
6
|
-
})(commonjsGlobal, function(exports2) {
|
|
7
|
-
const comma = ",".charCodeAt(0);
|
|
8
|
-
const semicolon = ";".charCodeAt(0);
|
|
9
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
10
|
-
const intToChar = new Uint8Array(64);
|
|
11
|
-
const charToInt = new Uint8Array(128);
|
|
12
|
-
for (let i = 0; i < chars.length; i++) {
|
|
13
|
-
const c = chars.charCodeAt(i);
|
|
14
|
-
intToChar[i] = c;
|
|
15
|
-
charToInt[c] = i;
|
|
16
|
-
}
|
|
17
|
-
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
18
|
-
decode(buf) {
|
|
19
|
-
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
20
|
-
return out.toString();
|
|
21
|
-
}
|
|
22
|
-
} : {
|
|
23
|
-
decode(buf) {
|
|
24
|
-
let out = "";
|
|
25
|
-
for (let i = 0; i < buf.length; i++) {
|
|
26
|
-
out += String.fromCharCode(buf[i]);
|
|
27
|
-
}
|
|
28
|
-
return out;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
function decode(mappings) {
|
|
32
|
-
const state = new Int32Array(5);
|
|
33
|
-
const decoded = [];
|
|
34
|
-
let index = 0;
|
|
35
|
-
do {
|
|
36
|
-
const semi = indexOf(mappings, index);
|
|
37
|
-
const line = [];
|
|
38
|
-
let sorted = true;
|
|
39
|
-
let lastCol = 0;
|
|
40
|
-
state[0] = 0;
|
|
41
|
-
for (let i = index; i < semi; i++) {
|
|
42
|
-
let seg;
|
|
43
|
-
i = decodeInteger(mappings, i, state, 0);
|
|
44
|
-
const col = state[0];
|
|
45
|
-
if (col < lastCol)
|
|
46
|
-
sorted = false;
|
|
47
|
-
lastCol = col;
|
|
48
|
-
if (hasMoreVlq(mappings, i, semi)) {
|
|
49
|
-
i = decodeInteger(mappings, i, state, 1);
|
|
50
|
-
i = decodeInteger(mappings, i, state, 2);
|
|
51
|
-
i = decodeInteger(mappings, i, state, 3);
|
|
52
|
-
if (hasMoreVlq(mappings, i, semi)) {
|
|
53
|
-
i = decodeInteger(mappings, i, state, 4);
|
|
54
|
-
seg = [col, state[1], state[2], state[3], state[4]];
|
|
55
|
-
} else {
|
|
56
|
-
seg = [col, state[1], state[2], state[3]];
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
seg = [col];
|
|
60
|
-
}
|
|
61
|
-
line.push(seg);
|
|
62
|
-
}
|
|
63
|
-
if (!sorted)
|
|
64
|
-
sort(line);
|
|
65
|
-
decoded.push(line);
|
|
66
|
-
index = semi + 1;
|
|
67
|
-
} while (index <= mappings.length);
|
|
68
|
-
return decoded;
|
|
69
|
-
}
|
|
70
|
-
function indexOf(mappings, index) {
|
|
71
|
-
const idx = mappings.indexOf(";", index);
|
|
72
|
-
return idx === -1 ? mappings.length : idx;
|
|
73
|
-
}
|
|
74
|
-
function decodeInteger(mappings, pos, state, j) {
|
|
75
|
-
let value = 0;
|
|
76
|
-
let shift = 0;
|
|
77
|
-
let integer = 0;
|
|
78
|
-
do {
|
|
79
|
-
const c = mappings.charCodeAt(pos++);
|
|
80
|
-
integer = charToInt[c];
|
|
81
|
-
value |= (integer & 31) << shift;
|
|
82
|
-
shift += 5;
|
|
83
|
-
} while (integer & 32);
|
|
84
|
-
const shouldNegate = value & 1;
|
|
85
|
-
value >>>= 1;
|
|
86
|
-
if (shouldNegate) {
|
|
87
|
-
value = -2147483648 | -value;
|
|
88
|
-
}
|
|
89
|
-
state[j] += value;
|
|
90
|
-
return pos;
|
|
91
|
-
}
|
|
92
|
-
function hasMoreVlq(mappings, i, length) {
|
|
93
|
-
if (i >= length)
|
|
94
|
-
return false;
|
|
95
|
-
return mappings.charCodeAt(i) !== comma;
|
|
96
|
-
}
|
|
97
|
-
function sort(line) {
|
|
98
|
-
line.sort(sortComparator);
|
|
99
|
-
}
|
|
100
|
-
function sortComparator(a, b) {
|
|
101
|
-
return a[0] - b[0];
|
|
102
|
-
}
|
|
103
|
-
function encode(decoded) {
|
|
104
|
-
const state = new Int32Array(5);
|
|
105
|
-
const bufLength = 1024 * 16;
|
|
106
|
-
const subLength = bufLength - 36;
|
|
107
|
-
const buf = new Uint8Array(bufLength);
|
|
108
|
-
const sub = buf.subarray(0, subLength);
|
|
109
|
-
let pos = 0;
|
|
110
|
-
let out = "";
|
|
111
|
-
for (let i = 0; i < decoded.length; i++) {
|
|
112
|
-
const line = decoded[i];
|
|
113
|
-
if (i > 0) {
|
|
114
|
-
if (pos === bufLength) {
|
|
115
|
-
out += td.decode(buf);
|
|
116
|
-
pos = 0;
|
|
117
|
-
}
|
|
118
|
-
buf[pos++] = semicolon;
|
|
119
|
-
}
|
|
120
|
-
if (line.length === 0)
|
|
121
|
-
continue;
|
|
122
|
-
state[0] = 0;
|
|
123
|
-
for (let j = 0; j < line.length; j++) {
|
|
124
|
-
const segment = line[j];
|
|
125
|
-
if (pos > subLength) {
|
|
126
|
-
out += td.decode(sub);
|
|
127
|
-
buf.copyWithin(0, subLength, pos);
|
|
128
|
-
pos -= subLength;
|
|
129
|
-
}
|
|
130
|
-
if (j > 0)
|
|
131
|
-
buf[pos++] = comma;
|
|
132
|
-
pos = encodeInteger(buf, pos, state, segment, 0);
|
|
133
|
-
if (segment.length === 1)
|
|
134
|
-
continue;
|
|
135
|
-
pos = encodeInteger(buf, pos, state, segment, 1);
|
|
136
|
-
pos = encodeInteger(buf, pos, state, segment, 2);
|
|
137
|
-
pos = encodeInteger(buf, pos, state, segment, 3);
|
|
138
|
-
if (segment.length === 4)
|
|
139
|
-
continue;
|
|
140
|
-
pos = encodeInteger(buf, pos, state, segment, 4);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return out + td.decode(buf.subarray(0, pos));
|
|
144
|
-
}
|
|
145
|
-
function encodeInteger(buf, pos, state, segment, j) {
|
|
146
|
-
const next = segment[j];
|
|
147
|
-
let num = next - state[j];
|
|
148
|
-
state[j] = next;
|
|
149
|
-
num = num < 0 ? -num << 1 | 1 : num << 1;
|
|
150
|
-
do {
|
|
151
|
-
let clamped = num & 31;
|
|
152
|
-
num >>>= 5;
|
|
153
|
-
if (num > 0)
|
|
154
|
-
clamped |= 32;
|
|
155
|
-
buf[pos++] = intToChar[clamped];
|
|
156
|
-
} while (num > 0);
|
|
157
|
-
return pos;
|
|
158
|
-
}
|
|
159
|
-
exports2.decode = decode;
|
|
160
|
-
exports2.encode = encode;
|
|
161
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
162
|
-
});
|
|
163
|
-
})(sourcemapCodec_umd, sourcemapCodec_umd.exports);
|
|
164
|
-
var sourcemapCodec_umdExports = sourcemapCodec_umd.exports;
|
|
165
|
-
class BitSet {
|
|
166
|
-
constructor(arg) {
|
|
167
|
-
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
168
|
-
}
|
|
169
|
-
add(n2) {
|
|
170
|
-
this.bits[n2 >> 5] |= 1 << (n2 & 31);
|
|
171
|
-
}
|
|
172
|
-
has(n2) {
|
|
173
|
-
return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
class Chunk {
|
|
177
|
-
constructor(start, end, content) {
|
|
178
|
-
this.start = start;
|
|
179
|
-
this.end = end;
|
|
180
|
-
this.original = content;
|
|
181
|
-
this.intro = "";
|
|
182
|
-
this.outro = "";
|
|
183
|
-
this.content = content;
|
|
184
|
-
this.storeName = false;
|
|
185
|
-
this.edited = false;
|
|
186
|
-
{
|
|
187
|
-
this.previous = null;
|
|
188
|
-
this.next = null;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
appendLeft(content) {
|
|
192
|
-
this.outro += content;
|
|
193
|
-
}
|
|
194
|
-
appendRight(content) {
|
|
195
|
-
this.intro = this.intro + content;
|
|
196
|
-
}
|
|
197
|
-
clone() {
|
|
198
|
-
const chunk = new Chunk(this.start, this.end, this.original);
|
|
199
|
-
chunk.intro = this.intro;
|
|
200
|
-
chunk.outro = this.outro;
|
|
201
|
-
chunk.content = this.content;
|
|
202
|
-
chunk.storeName = this.storeName;
|
|
203
|
-
chunk.edited = this.edited;
|
|
204
|
-
return chunk;
|
|
205
|
-
}
|
|
206
|
-
contains(index) {
|
|
207
|
-
return this.start < index && index < this.end;
|
|
208
|
-
}
|
|
209
|
-
eachNext(fn) {
|
|
210
|
-
let chunk = this;
|
|
211
|
-
while (chunk) {
|
|
212
|
-
fn(chunk);
|
|
213
|
-
chunk = chunk.next;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
eachPrevious(fn) {
|
|
217
|
-
let chunk = this;
|
|
218
|
-
while (chunk) {
|
|
219
|
-
fn(chunk);
|
|
220
|
-
chunk = chunk.previous;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
edit(content, storeName, contentOnly) {
|
|
224
|
-
this.content = content;
|
|
225
|
-
if (!contentOnly) {
|
|
226
|
-
this.intro = "";
|
|
227
|
-
this.outro = "";
|
|
228
|
-
}
|
|
229
|
-
this.storeName = storeName;
|
|
230
|
-
this.edited = true;
|
|
231
|
-
return this;
|
|
232
|
-
}
|
|
233
|
-
prependLeft(content) {
|
|
234
|
-
this.outro = content + this.outro;
|
|
235
|
-
}
|
|
236
|
-
prependRight(content) {
|
|
237
|
-
this.intro = content + this.intro;
|
|
238
|
-
}
|
|
239
|
-
split(index) {
|
|
240
|
-
const sliceIndex = index - this.start;
|
|
241
|
-
const originalBefore = this.original.slice(0, sliceIndex);
|
|
242
|
-
const originalAfter = this.original.slice(sliceIndex);
|
|
243
|
-
this.original = originalBefore;
|
|
244
|
-
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
245
|
-
newChunk.outro = this.outro;
|
|
246
|
-
this.outro = "";
|
|
247
|
-
this.end = index;
|
|
248
|
-
if (this.edited) {
|
|
249
|
-
newChunk.edit("", false);
|
|
250
|
-
this.content = "";
|
|
251
|
-
} else {
|
|
252
|
-
this.content = originalBefore;
|
|
253
|
-
}
|
|
254
|
-
newChunk.next = this.next;
|
|
255
|
-
if (newChunk.next)
|
|
256
|
-
newChunk.next.previous = newChunk;
|
|
257
|
-
newChunk.previous = this;
|
|
258
|
-
this.next = newChunk;
|
|
259
|
-
return newChunk;
|
|
260
|
-
}
|
|
261
|
-
toString() {
|
|
262
|
-
return this.intro + this.content + this.outro;
|
|
263
|
-
}
|
|
264
|
-
trimEnd(rx) {
|
|
265
|
-
this.outro = this.outro.replace(rx, "");
|
|
266
|
-
if (this.outro.length)
|
|
267
|
-
return true;
|
|
268
|
-
const trimmed = this.content.replace(rx, "");
|
|
269
|
-
if (trimmed.length) {
|
|
270
|
-
if (trimmed !== this.content) {
|
|
271
|
-
this.split(this.start + trimmed.length).edit("", void 0, true);
|
|
272
|
-
if (this.edited) {
|
|
273
|
-
this.edit(trimmed, this.storeName, true);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return true;
|
|
277
|
-
} else {
|
|
278
|
-
this.edit("", void 0, true);
|
|
279
|
-
this.intro = this.intro.replace(rx, "");
|
|
280
|
-
if (this.intro.length)
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
trimStart(rx) {
|
|
285
|
-
this.intro = this.intro.replace(rx, "");
|
|
286
|
-
if (this.intro.length)
|
|
287
|
-
return true;
|
|
288
|
-
const trimmed = this.content.replace(rx, "");
|
|
289
|
-
if (trimmed.length) {
|
|
290
|
-
if (trimmed !== this.content) {
|
|
291
|
-
const newChunk = this.split(this.end - trimmed.length);
|
|
292
|
-
if (this.edited) {
|
|
293
|
-
newChunk.edit(trimmed, this.storeName, true);
|
|
294
|
-
}
|
|
295
|
-
this.edit("", void 0, true);
|
|
296
|
-
}
|
|
297
|
-
return true;
|
|
298
|
-
} else {
|
|
299
|
-
this.edit("", void 0, true);
|
|
300
|
-
this.outro = this.outro.replace(rx, "");
|
|
301
|
-
if (this.outro.length)
|
|
302
|
-
return true;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function getBtoa() {
|
|
307
|
-
if (typeof window !== "undefined" && typeof window.btoa === "function") {
|
|
308
|
-
return (str) => window.btoa(unescape(encodeURIComponent(str)));
|
|
309
|
-
} else if (typeof Buffer === "function") {
|
|
310
|
-
return (str) => Buffer.from(str, "utf-8").toString("base64");
|
|
311
|
-
} else {
|
|
312
|
-
return () => {
|
|
313
|
-
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
const btoa = /* @__PURE__ */ getBtoa();
|
|
318
|
-
class SourceMap {
|
|
319
|
-
constructor(properties) {
|
|
320
|
-
this.version = 3;
|
|
321
|
-
this.file = properties.file;
|
|
322
|
-
this.sources = properties.sources;
|
|
323
|
-
this.sourcesContent = properties.sourcesContent;
|
|
324
|
-
this.names = properties.names;
|
|
325
|
-
this.mappings = sourcemapCodec_umdExports.encode(properties.mappings);
|
|
326
|
-
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
327
|
-
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
toString() {
|
|
331
|
-
return JSON.stringify(this);
|
|
332
|
-
}
|
|
333
|
-
toUrl() {
|
|
334
|
-
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
function guessIndent(code) {
|
|
338
|
-
const lines = code.split("\n");
|
|
339
|
-
const tabbed = lines.filter((line) => /^\t+/.test(line));
|
|
340
|
-
const spaced = lines.filter((line) => /^ {2,}/.test(line));
|
|
341
|
-
if (tabbed.length === 0 && spaced.length === 0) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
if (tabbed.length >= spaced.length) {
|
|
345
|
-
return " ";
|
|
346
|
-
}
|
|
347
|
-
const min = spaced.reduce((previous, current) => {
|
|
348
|
-
const numSpaces = /^ +/.exec(current)[0].length;
|
|
349
|
-
return Math.min(numSpaces, previous);
|
|
350
|
-
}, Infinity);
|
|
351
|
-
return new Array(min + 1).join(" ");
|
|
352
|
-
}
|
|
353
|
-
function getRelativePath(from, to) {
|
|
354
|
-
const fromParts = from.split(/[/\\]/);
|
|
355
|
-
const toParts = to.split(/[/\\]/);
|
|
356
|
-
fromParts.pop();
|
|
357
|
-
while (fromParts[0] === toParts[0]) {
|
|
358
|
-
fromParts.shift();
|
|
359
|
-
toParts.shift();
|
|
360
|
-
}
|
|
361
|
-
if (fromParts.length) {
|
|
362
|
-
let i = fromParts.length;
|
|
363
|
-
while (i--)
|
|
364
|
-
fromParts[i] = "..";
|
|
365
|
-
}
|
|
366
|
-
return fromParts.concat(toParts).join("/");
|
|
367
|
-
}
|
|
368
|
-
const toString = Object.prototype.toString;
|
|
369
|
-
function isObject(thing) {
|
|
370
|
-
return toString.call(thing) === "[object Object]";
|
|
371
|
-
}
|
|
372
|
-
function getLocator(source) {
|
|
373
|
-
const originalLines = source.split("\n");
|
|
374
|
-
const lineOffsets = [];
|
|
375
|
-
for (let i = 0, pos = 0; i < originalLines.length; i++) {
|
|
376
|
-
lineOffsets.push(pos);
|
|
377
|
-
pos += originalLines[i].length + 1;
|
|
378
|
-
}
|
|
379
|
-
return function locate(index) {
|
|
380
|
-
let i = 0;
|
|
381
|
-
let j = lineOffsets.length;
|
|
382
|
-
while (i < j) {
|
|
383
|
-
const m = i + j >> 1;
|
|
384
|
-
if (index < lineOffsets[m]) {
|
|
385
|
-
j = m;
|
|
386
|
-
} else {
|
|
387
|
-
i = m + 1;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
const line = i - 1;
|
|
391
|
-
const column = index - lineOffsets[line];
|
|
392
|
-
return { line, column };
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
const wordRegex = /\w/;
|
|
396
|
-
class Mappings {
|
|
397
|
-
constructor(hires) {
|
|
398
|
-
this.hires = hires;
|
|
399
|
-
this.generatedCodeLine = 0;
|
|
400
|
-
this.generatedCodeColumn = 0;
|
|
401
|
-
this.raw = [];
|
|
402
|
-
this.rawSegments = this.raw[this.generatedCodeLine] = [];
|
|
403
|
-
this.pending = null;
|
|
404
|
-
}
|
|
405
|
-
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
406
|
-
if (content.length) {
|
|
407
|
-
let contentLineEnd = content.indexOf("\n", 0);
|
|
408
|
-
let previousContentLineEnd = -1;
|
|
409
|
-
while (contentLineEnd >= 0) {
|
|
410
|
-
const segment2 = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
411
|
-
if (nameIndex >= 0) {
|
|
412
|
-
segment2.push(nameIndex);
|
|
413
|
-
}
|
|
414
|
-
this.rawSegments.push(segment2);
|
|
415
|
-
this.generatedCodeLine += 1;
|
|
416
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
417
|
-
this.generatedCodeColumn = 0;
|
|
418
|
-
previousContentLineEnd = contentLineEnd;
|
|
419
|
-
contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
420
|
-
}
|
|
421
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
422
|
-
if (nameIndex >= 0) {
|
|
423
|
-
segment.push(nameIndex);
|
|
424
|
-
}
|
|
425
|
-
this.rawSegments.push(segment);
|
|
426
|
-
this.advance(content.slice(previousContentLineEnd + 1));
|
|
427
|
-
} else if (this.pending) {
|
|
428
|
-
this.rawSegments.push(this.pending);
|
|
429
|
-
this.advance(content);
|
|
430
|
-
}
|
|
431
|
-
this.pending = null;
|
|
432
|
-
}
|
|
433
|
-
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
434
|
-
let originalCharIndex = chunk.start;
|
|
435
|
-
let first = true;
|
|
436
|
-
let charInHiresBoundary = false;
|
|
437
|
-
while (originalCharIndex < chunk.end) {
|
|
438
|
-
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
439
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
440
|
-
if (this.hires === "boundary") {
|
|
441
|
-
if (wordRegex.test(original[originalCharIndex])) {
|
|
442
|
-
if (!charInHiresBoundary) {
|
|
443
|
-
this.rawSegments.push(segment);
|
|
444
|
-
charInHiresBoundary = true;
|
|
445
|
-
}
|
|
446
|
-
} else {
|
|
447
|
-
this.rawSegments.push(segment);
|
|
448
|
-
charInHiresBoundary = false;
|
|
449
|
-
}
|
|
450
|
-
} else {
|
|
451
|
-
this.rawSegments.push(segment);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
if (original[originalCharIndex] === "\n") {
|
|
455
|
-
loc.line += 1;
|
|
456
|
-
loc.column = 0;
|
|
457
|
-
this.generatedCodeLine += 1;
|
|
458
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
459
|
-
this.generatedCodeColumn = 0;
|
|
460
|
-
first = true;
|
|
461
|
-
} else {
|
|
462
|
-
loc.column += 1;
|
|
463
|
-
this.generatedCodeColumn += 1;
|
|
464
|
-
first = false;
|
|
465
|
-
}
|
|
466
|
-
originalCharIndex += 1;
|
|
467
|
-
}
|
|
468
|
-
this.pending = null;
|
|
469
|
-
}
|
|
470
|
-
advance(str) {
|
|
471
|
-
if (!str)
|
|
472
|
-
return;
|
|
473
|
-
const lines = str.split("\n");
|
|
474
|
-
if (lines.length > 1) {
|
|
475
|
-
for (let i = 0; i < lines.length - 1; i++) {
|
|
476
|
-
this.generatedCodeLine++;
|
|
477
|
-
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
478
|
-
}
|
|
479
|
-
this.generatedCodeColumn = 0;
|
|
480
|
-
}
|
|
481
|
-
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
const n = "\n";
|
|
485
|
-
const warned = {
|
|
486
|
-
insertLeft: false,
|
|
487
|
-
insertRight: false,
|
|
488
|
-
storeName: false
|
|
489
|
-
};
|
|
490
|
-
class MagicString {
|
|
491
|
-
constructor(string, options = {}) {
|
|
492
|
-
const chunk = new Chunk(0, string.length, string);
|
|
493
|
-
Object.defineProperties(this, {
|
|
494
|
-
original: { writable: true, value: string },
|
|
495
|
-
outro: { writable: true, value: "" },
|
|
496
|
-
intro: { writable: true, value: "" },
|
|
497
|
-
firstChunk: { writable: true, value: chunk },
|
|
498
|
-
lastChunk: { writable: true, value: chunk },
|
|
499
|
-
lastSearchedChunk: { writable: true, value: chunk },
|
|
500
|
-
byStart: { writable: true, value: {} },
|
|
501
|
-
byEnd: { writable: true, value: {} },
|
|
502
|
-
filename: { writable: true, value: options.filename },
|
|
503
|
-
indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
|
|
504
|
-
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
505
|
-
storedNames: { writable: true, value: {} },
|
|
506
|
-
indentStr: { writable: true, value: void 0 },
|
|
507
|
-
ignoreList: { writable: true, value: options.ignoreList }
|
|
508
|
-
});
|
|
509
|
-
this.byStart[0] = chunk;
|
|
510
|
-
this.byEnd[string.length] = chunk;
|
|
511
|
-
}
|
|
512
|
-
addSourcemapLocation(char) {
|
|
513
|
-
this.sourcemapLocations.add(char);
|
|
514
|
-
}
|
|
515
|
-
append(content) {
|
|
516
|
-
if (typeof content !== "string")
|
|
517
|
-
throw new TypeError("outro content must be a string");
|
|
518
|
-
this.outro += content;
|
|
519
|
-
return this;
|
|
520
|
-
}
|
|
521
|
-
appendLeft(index, content) {
|
|
522
|
-
if (typeof content !== "string")
|
|
523
|
-
throw new TypeError("inserted content must be a string");
|
|
524
|
-
this._split(index);
|
|
525
|
-
const chunk = this.byEnd[index];
|
|
526
|
-
if (chunk) {
|
|
527
|
-
chunk.appendLeft(content);
|
|
528
|
-
} else {
|
|
529
|
-
this.intro += content;
|
|
530
|
-
}
|
|
531
|
-
return this;
|
|
532
|
-
}
|
|
533
|
-
appendRight(index, content) {
|
|
534
|
-
if (typeof content !== "string")
|
|
535
|
-
throw new TypeError("inserted content must be a string");
|
|
536
|
-
this._split(index);
|
|
537
|
-
const chunk = this.byStart[index];
|
|
538
|
-
if (chunk) {
|
|
539
|
-
chunk.appendRight(content);
|
|
540
|
-
} else {
|
|
541
|
-
this.outro += content;
|
|
542
|
-
}
|
|
543
|
-
return this;
|
|
544
|
-
}
|
|
545
|
-
clone() {
|
|
546
|
-
const cloned = new MagicString(this.original, { filename: this.filename });
|
|
547
|
-
let originalChunk = this.firstChunk;
|
|
548
|
-
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
549
|
-
while (originalChunk) {
|
|
550
|
-
cloned.byStart[clonedChunk.start] = clonedChunk;
|
|
551
|
-
cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
552
|
-
const nextOriginalChunk = originalChunk.next;
|
|
553
|
-
const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
554
|
-
if (nextClonedChunk) {
|
|
555
|
-
clonedChunk.next = nextClonedChunk;
|
|
556
|
-
nextClonedChunk.previous = clonedChunk;
|
|
557
|
-
clonedChunk = nextClonedChunk;
|
|
558
|
-
}
|
|
559
|
-
originalChunk = nextOriginalChunk;
|
|
560
|
-
}
|
|
561
|
-
cloned.lastChunk = clonedChunk;
|
|
562
|
-
if (this.indentExclusionRanges) {
|
|
563
|
-
cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
|
|
564
|
-
}
|
|
565
|
-
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
|
|
566
|
-
cloned.intro = this.intro;
|
|
567
|
-
cloned.outro = this.outro;
|
|
568
|
-
return cloned;
|
|
569
|
-
}
|
|
570
|
-
generateDecodedMap(options) {
|
|
571
|
-
options = options || {};
|
|
572
|
-
const sourceIndex = 0;
|
|
573
|
-
const names = Object.keys(this.storedNames);
|
|
574
|
-
const mappings = new Mappings(options.hires);
|
|
575
|
-
const locate = getLocator(this.original);
|
|
576
|
-
if (this.intro) {
|
|
577
|
-
mappings.advance(this.intro);
|
|
578
|
-
}
|
|
579
|
-
this.firstChunk.eachNext((chunk) => {
|
|
580
|
-
const loc = locate(chunk.start);
|
|
581
|
-
if (chunk.intro.length)
|
|
582
|
-
mappings.advance(chunk.intro);
|
|
583
|
-
if (chunk.edited) {
|
|
584
|
-
mappings.addEdit(
|
|
585
|
-
sourceIndex,
|
|
586
|
-
chunk.content,
|
|
587
|
-
loc,
|
|
588
|
-
chunk.storeName ? names.indexOf(chunk.original) : -1
|
|
589
|
-
);
|
|
590
|
-
} else {
|
|
591
|
-
mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
|
|
592
|
-
}
|
|
593
|
-
if (chunk.outro.length)
|
|
594
|
-
mappings.advance(chunk.outro);
|
|
595
|
-
});
|
|
596
|
-
return {
|
|
597
|
-
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
598
|
-
sources: [
|
|
599
|
-
options.source ? getRelativePath(options.file || "", options.source) : options.file || ""
|
|
600
|
-
],
|
|
601
|
-
sourcesContent: options.includeContent ? [this.original] : void 0,
|
|
602
|
-
names,
|
|
603
|
-
mappings: mappings.raw,
|
|
604
|
-
x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
generateMap(options) {
|
|
608
|
-
return new SourceMap(this.generateDecodedMap(options));
|
|
609
|
-
}
|
|
610
|
-
_ensureindentStr() {
|
|
611
|
-
if (this.indentStr === void 0) {
|
|
612
|
-
this.indentStr = guessIndent(this.original);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
_getRawIndentString() {
|
|
616
|
-
this._ensureindentStr();
|
|
617
|
-
return this.indentStr;
|
|
618
|
-
}
|
|
619
|
-
getIndentString() {
|
|
620
|
-
this._ensureindentStr();
|
|
621
|
-
return this.indentStr === null ? " " : this.indentStr;
|
|
622
|
-
}
|
|
623
|
-
indent(indentStr, options) {
|
|
624
|
-
const pattern = /^[^\r\n]/gm;
|
|
625
|
-
if (isObject(indentStr)) {
|
|
626
|
-
options = indentStr;
|
|
627
|
-
indentStr = void 0;
|
|
628
|
-
}
|
|
629
|
-
if (indentStr === void 0) {
|
|
630
|
-
this._ensureindentStr();
|
|
631
|
-
indentStr = this.indentStr || " ";
|
|
632
|
-
}
|
|
633
|
-
if (indentStr === "")
|
|
634
|
-
return this;
|
|
635
|
-
options = options || {};
|
|
636
|
-
const isExcluded = {};
|
|
637
|
-
if (options.exclude) {
|
|
638
|
-
const exclusions = typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude;
|
|
639
|
-
exclusions.forEach((exclusion) => {
|
|
640
|
-
for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
|
|
641
|
-
isExcluded[i] = true;
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
let shouldIndentNextCharacter = options.indentStart !== false;
|
|
646
|
-
const replacer = (match) => {
|
|
647
|
-
if (shouldIndentNextCharacter)
|
|
648
|
-
return `${indentStr}${match}`;
|
|
649
|
-
shouldIndentNextCharacter = true;
|
|
650
|
-
return match;
|
|
651
|
-
};
|
|
652
|
-
this.intro = this.intro.replace(pattern, replacer);
|
|
653
|
-
let charIndex = 0;
|
|
654
|
-
let chunk = this.firstChunk;
|
|
655
|
-
while (chunk) {
|
|
656
|
-
const end = chunk.end;
|
|
657
|
-
if (chunk.edited) {
|
|
658
|
-
if (!isExcluded[charIndex]) {
|
|
659
|
-
chunk.content = chunk.content.replace(pattern, replacer);
|
|
660
|
-
if (chunk.content.length) {
|
|
661
|
-
shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
} else {
|
|
665
|
-
charIndex = chunk.start;
|
|
666
|
-
while (charIndex < end) {
|
|
667
|
-
if (!isExcluded[charIndex]) {
|
|
668
|
-
const char = this.original[charIndex];
|
|
669
|
-
if (char === "\n") {
|
|
670
|
-
shouldIndentNextCharacter = true;
|
|
671
|
-
} else if (char !== "\r" && shouldIndentNextCharacter) {
|
|
672
|
-
shouldIndentNextCharacter = false;
|
|
673
|
-
if (charIndex === chunk.start) {
|
|
674
|
-
chunk.prependRight(indentStr);
|
|
675
|
-
} else {
|
|
676
|
-
this._splitChunk(chunk, charIndex);
|
|
677
|
-
chunk = chunk.next;
|
|
678
|
-
chunk.prependRight(indentStr);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
charIndex += 1;
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
charIndex = chunk.end;
|
|
686
|
-
chunk = chunk.next;
|
|
687
|
-
}
|
|
688
|
-
this.outro = this.outro.replace(pattern, replacer);
|
|
689
|
-
return this;
|
|
690
|
-
}
|
|
691
|
-
insert() {
|
|
692
|
-
throw new Error(
|
|
693
|
-
"magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
|
|
694
|
-
);
|
|
695
|
-
}
|
|
696
|
-
insertLeft(index, content) {
|
|
697
|
-
if (!warned.insertLeft) {
|
|
698
|
-
console.warn(
|
|
699
|
-
"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
|
|
700
|
-
);
|
|
701
|
-
warned.insertLeft = true;
|
|
702
|
-
}
|
|
703
|
-
return this.appendLeft(index, content);
|
|
704
|
-
}
|
|
705
|
-
insertRight(index, content) {
|
|
706
|
-
if (!warned.insertRight) {
|
|
707
|
-
console.warn(
|
|
708
|
-
"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
|
|
709
|
-
);
|
|
710
|
-
warned.insertRight = true;
|
|
711
|
-
}
|
|
712
|
-
return this.prependRight(index, content);
|
|
713
|
-
}
|
|
714
|
-
move(start, end, index) {
|
|
715
|
-
if (index >= start && index <= end)
|
|
716
|
-
throw new Error("Cannot move a selection inside itself");
|
|
717
|
-
this._split(start);
|
|
718
|
-
this._split(end);
|
|
719
|
-
this._split(index);
|
|
720
|
-
const first = this.byStart[start];
|
|
721
|
-
const last = this.byEnd[end];
|
|
722
|
-
const oldLeft = first.previous;
|
|
723
|
-
const oldRight = last.next;
|
|
724
|
-
const newRight = this.byStart[index];
|
|
725
|
-
if (!newRight && last === this.lastChunk)
|
|
726
|
-
return this;
|
|
727
|
-
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
728
|
-
if (oldLeft)
|
|
729
|
-
oldLeft.next = oldRight;
|
|
730
|
-
if (oldRight)
|
|
731
|
-
oldRight.previous = oldLeft;
|
|
732
|
-
if (newLeft)
|
|
733
|
-
newLeft.next = first;
|
|
734
|
-
if (newRight)
|
|
735
|
-
newRight.previous = last;
|
|
736
|
-
if (!first.previous)
|
|
737
|
-
this.firstChunk = last.next;
|
|
738
|
-
if (!last.next) {
|
|
739
|
-
this.lastChunk = first.previous;
|
|
740
|
-
this.lastChunk.next = null;
|
|
741
|
-
}
|
|
742
|
-
first.previous = newLeft;
|
|
743
|
-
last.next = newRight || null;
|
|
744
|
-
if (!newLeft)
|
|
745
|
-
this.firstChunk = first;
|
|
746
|
-
if (!newRight)
|
|
747
|
-
this.lastChunk = last;
|
|
748
|
-
return this;
|
|
749
|
-
}
|
|
750
|
-
overwrite(start, end, content, options) {
|
|
751
|
-
options = options || {};
|
|
752
|
-
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
|
|
753
|
-
}
|
|
754
|
-
update(start, end, content, options) {
|
|
755
|
-
if (typeof content !== "string")
|
|
756
|
-
throw new TypeError("replacement content must be a string");
|
|
757
|
-
while (start < 0)
|
|
758
|
-
start += this.original.length;
|
|
759
|
-
while (end < 0)
|
|
760
|
-
end += this.original.length;
|
|
761
|
-
if (end > this.original.length)
|
|
762
|
-
throw new Error("end is out of bounds");
|
|
763
|
-
if (start === end)
|
|
764
|
-
throw new Error(
|
|
765
|
-
"Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
|
|
766
|
-
);
|
|
767
|
-
this._split(start);
|
|
768
|
-
this._split(end);
|
|
769
|
-
if (options === true) {
|
|
770
|
-
if (!warned.storeName) {
|
|
771
|
-
console.warn(
|
|
772
|
-
"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
|
|
773
|
-
);
|
|
774
|
-
warned.storeName = true;
|
|
775
|
-
}
|
|
776
|
-
options = { storeName: true };
|
|
777
|
-
}
|
|
778
|
-
const storeName = options !== void 0 ? options.storeName : false;
|
|
779
|
-
const overwrite = options !== void 0 ? options.overwrite : false;
|
|
780
|
-
if (storeName) {
|
|
781
|
-
const original = this.original.slice(start, end);
|
|
782
|
-
Object.defineProperty(this.storedNames, original, {
|
|
783
|
-
writable: true,
|
|
784
|
-
value: true,
|
|
785
|
-
enumerable: true
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
const first = this.byStart[start];
|
|
789
|
-
const last = this.byEnd[end];
|
|
790
|
-
if (first) {
|
|
791
|
-
let chunk = first;
|
|
792
|
-
while (chunk !== last) {
|
|
793
|
-
if (chunk.next !== this.byStart[chunk.end]) {
|
|
794
|
-
throw new Error("Cannot overwrite across a split point");
|
|
795
|
-
}
|
|
796
|
-
chunk = chunk.next;
|
|
797
|
-
chunk.edit("", false);
|
|
798
|
-
}
|
|
799
|
-
first.edit(content, storeName, !overwrite);
|
|
800
|
-
} else {
|
|
801
|
-
const newChunk = new Chunk(start, end, "").edit(content, storeName);
|
|
802
|
-
last.next = newChunk;
|
|
803
|
-
newChunk.previous = last;
|
|
804
|
-
}
|
|
805
|
-
return this;
|
|
806
|
-
}
|
|
807
|
-
prepend(content) {
|
|
808
|
-
if (typeof content !== "string")
|
|
809
|
-
throw new TypeError("outro content must be a string");
|
|
810
|
-
this.intro = content + this.intro;
|
|
811
|
-
return this;
|
|
812
|
-
}
|
|
813
|
-
prependLeft(index, content) {
|
|
814
|
-
if (typeof content !== "string")
|
|
815
|
-
throw new TypeError("inserted content must be a string");
|
|
816
|
-
this._split(index);
|
|
817
|
-
const chunk = this.byEnd[index];
|
|
818
|
-
if (chunk) {
|
|
819
|
-
chunk.prependLeft(content);
|
|
820
|
-
} else {
|
|
821
|
-
this.intro = content + this.intro;
|
|
822
|
-
}
|
|
823
|
-
return this;
|
|
824
|
-
}
|
|
825
|
-
prependRight(index, content) {
|
|
826
|
-
if (typeof content !== "string")
|
|
827
|
-
throw new TypeError("inserted content must be a string");
|
|
828
|
-
this._split(index);
|
|
829
|
-
const chunk = this.byStart[index];
|
|
830
|
-
if (chunk) {
|
|
831
|
-
chunk.prependRight(content);
|
|
832
|
-
} else {
|
|
833
|
-
this.outro = content + this.outro;
|
|
834
|
-
}
|
|
835
|
-
return this;
|
|
836
|
-
}
|
|
837
|
-
remove(start, end) {
|
|
838
|
-
while (start < 0)
|
|
839
|
-
start += this.original.length;
|
|
840
|
-
while (end < 0)
|
|
841
|
-
end += this.original.length;
|
|
842
|
-
if (start === end)
|
|
843
|
-
return this;
|
|
844
|
-
if (start < 0 || end > this.original.length)
|
|
845
|
-
throw new Error("Character is out of bounds");
|
|
846
|
-
if (start > end)
|
|
847
|
-
throw new Error("end must be greater than start");
|
|
848
|
-
this._split(start);
|
|
849
|
-
this._split(end);
|
|
850
|
-
let chunk = this.byStart[start];
|
|
851
|
-
while (chunk) {
|
|
852
|
-
chunk.intro = "";
|
|
853
|
-
chunk.outro = "";
|
|
854
|
-
chunk.edit("");
|
|
855
|
-
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
856
|
-
}
|
|
857
|
-
return this;
|
|
858
|
-
}
|
|
859
|
-
lastChar() {
|
|
860
|
-
if (this.outro.length)
|
|
861
|
-
return this.outro[this.outro.length - 1];
|
|
862
|
-
let chunk = this.lastChunk;
|
|
863
|
-
do {
|
|
864
|
-
if (chunk.outro.length)
|
|
865
|
-
return chunk.outro[chunk.outro.length - 1];
|
|
866
|
-
if (chunk.content.length)
|
|
867
|
-
return chunk.content[chunk.content.length - 1];
|
|
868
|
-
if (chunk.intro.length)
|
|
869
|
-
return chunk.intro[chunk.intro.length - 1];
|
|
870
|
-
} while (chunk = chunk.previous);
|
|
871
|
-
if (this.intro.length)
|
|
872
|
-
return this.intro[this.intro.length - 1];
|
|
873
|
-
return "";
|
|
874
|
-
}
|
|
875
|
-
lastLine() {
|
|
876
|
-
let lineIndex = this.outro.lastIndexOf(n);
|
|
877
|
-
if (lineIndex !== -1)
|
|
878
|
-
return this.outro.substr(lineIndex + 1);
|
|
879
|
-
let lineStr = this.outro;
|
|
880
|
-
let chunk = this.lastChunk;
|
|
881
|
-
do {
|
|
882
|
-
if (chunk.outro.length > 0) {
|
|
883
|
-
lineIndex = chunk.outro.lastIndexOf(n);
|
|
884
|
-
if (lineIndex !== -1)
|
|
885
|
-
return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
886
|
-
lineStr = chunk.outro + lineStr;
|
|
887
|
-
}
|
|
888
|
-
if (chunk.content.length > 0) {
|
|
889
|
-
lineIndex = chunk.content.lastIndexOf(n);
|
|
890
|
-
if (lineIndex !== -1)
|
|
891
|
-
return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
892
|
-
lineStr = chunk.content + lineStr;
|
|
893
|
-
}
|
|
894
|
-
if (chunk.intro.length > 0) {
|
|
895
|
-
lineIndex = chunk.intro.lastIndexOf(n);
|
|
896
|
-
if (lineIndex !== -1)
|
|
897
|
-
return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
898
|
-
lineStr = chunk.intro + lineStr;
|
|
899
|
-
}
|
|
900
|
-
} while (chunk = chunk.previous);
|
|
901
|
-
lineIndex = this.intro.lastIndexOf(n);
|
|
902
|
-
if (lineIndex !== -1)
|
|
903
|
-
return this.intro.substr(lineIndex + 1) + lineStr;
|
|
904
|
-
return this.intro + lineStr;
|
|
905
|
-
}
|
|
906
|
-
slice(start = 0, end = this.original.length) {
|
|
907
|
-
while (start < 0)
|
|
908
|
-
start += this.original.length;
|
|
909
|
-
while (end < 0)
|
|
910
|
-
end += this.original.length;
|
|
911
|
-
let result = "";
|
|
912
|
-
let chunk = this.firstChunk;
|
|
913
|
-
while (chunk && (chunk.start > start || chunk.end <= start)) {
|
|
914
|
-
if (chunk.start < end && chunk.end >= end) {
|
|
915
|
-
return result;
|
|
916
|
-
}
|
|
917
|
-
chunk = chunk.next;
|
|
918
|
-
}
|
|
919
|
-
if (chunk && chunk.edited && chunk.start !== start)
|
|
920
|
-
throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
921
|
-
const startChunk = chunk;
|
|
922
|
-
while (chunk) {
|
|
923
|
-
if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
|
|
924
|
-
result += chunk.intro;
|
|
925
|
-
}
|
|
926
|
-
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
927
|
-
if (containsEnd && chunk.edited && chunk.end !== end)
|
|
928
|
-
throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
929
|
-
const sliceStart = startChunk === chunk ? start - chunk.start : 0;
|
|
930
|
-
const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
931
|
-
result += chunk.content.slice(sliceStart, sliceEnd);
|
|
932
|
-
if (chunk.outro && (!containsEnd || chunk.end === end)) {
|
|
933
|
-
result += chunk.outro;
|
|
934
|
-
}
|
|
935
|
-
if (containsEnd) {
|
|
936
|
-
break;
|
|
937
|
-
}
|
|
938
|
-
chunk = chunk.next;
|
|
939
|
-
}
|
|
940
|
-
return result;
|
|
941
|
-
}
|
|
942
|
-
// TODO deprecate this? not really very useful
|
|
943
|
-
snip(start, end) {
|
|
944
|
-
const clone = this.clone();
|
|
945
|
-
clone.remove(0, start);
|
|
946
|
-
clone.remove(end, clone.original.length);
|
|
947
|
-
return clone;
|
|
948
|
-
}
|
|
949
|
-
_split(index) {
|
|
950
|
-
if (this.byStart[index] || this.byEnd[index])
|
|
951
|
-
return;
|
|
952
|
-
let chunk = this.lastSearchedChunk;
|
|
953
|
-
const searchForward = index > chunk.end;
|
|
954
|
-
while (chunk) {
|
|
955
|
-
if (chunk.contains(index))
|
|
956
|
-
return this._splitChunk(chunk, index);
|
|
957
|
-
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
_splitChunk(chunk, index) {
|
|
961
|
-
if (chunk.edited && chunk.content.length) {
|
|
962
|
-
const loc = getLocator(this.original)(index);
|
|
963
|
-
throw new Error(
|
|
964
|
-
`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`
|
|
965
|
-
);
|
|
966
|
-
}
|
|
967
|
-
const newChunk = chunk.split(index);
|
|
968
|
-
this.byEnd[index] = chunk;
|
|
969
|
-
this.byStart[index] = newChunk;
|
|
970
|
-
this.byEnd[newChunk.end] = newChunk;
|
|
971
|
-
if (chunk === this.lastChunk)
|
|
972
|
-
this.lastChunk = newChunk;
|
|
973
|
-
this.lastSearchedChunk = chunk;
|
|
974
|
-
return true;
|
|
975
|
-
}
|
|
976
|
-
toString() {
|
|
977
|
-
let str = this.intro;
|
|
978
|
-
let chunk = this.firstChunk;
|
|
979
|
-
while (chunk) {
|
|
980
|
-
str += chunk.toString();
|
|
981
|
-
chunk = chunk.next;
|
|
982
|
-
}
|
|
983
|
-
return str + this.outro;
|
|
984
|
-
}
|
|
985
|
-
isEmpty() {
|
|
986
|
-
let chunk = this.firstChunk;
|
|
987
|
-
do {
|
|
988
|
-
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim())
|
|
989
|
-
return false;
|
|
990
|
-
} while (chunk = chunk.next);
|
|
991
|
-
return true;
|
|
992
|
-
}
|
|
993
|
-
length() {
|
|
994
|
-
let chunk = this.firstChunk;
|
|
995
|
-
let length = 0;
|
|
996
|
-
do {
|
|
997
|
-
length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
998
|
-
} while (chunk = chunk.next);
|
|
999
|
-
return length;
|
|
1000
|
-
}
|
|
1001
|
-
trimLines() {
|
|
1002
|
-
return this.trim("[\\r\\n]");
|
|
1003
|
-
}
|
|
1004
|
-
trim(charType) {
|
|
1005
|
-
return this.trimStart(charType).trimEnd(charType);
|
|
1006
|
-
}
|
|
1007
|
-
trimEndAborted(charType) {
|
|
1008
|
-
const rx = new RegExp((charType || "\\s") + "+$");
|
|
1009
|
-
this.outro = this.outro.replace(rx, "");
|
|
1010
|
-
if (this.outro.length)
|
|
1011
|
-
return true;
|
|
1012
|
-
let chunk = this.lastChunk;
|
|
1013
|
-
do {
|
|
1014
|
-
const end = chunk.end;
|
|
1015
|
-
const aborted = chunk.trimEnd(rx);
|
|
1016
|
-
if (chunk.end !== end) {
|
|
1017
|
-
if (this.lastChunk === chunk) {
|
|
1018
|
-
this.lastChunk = chunk.next;
|
|
1019
|
-
}
|
|
1020
|
-
this.byEnd[chunk.end] = chunk;
|
|
1021
|
-
this.byStart[chunk.next.start] = chunk.next;
|
|
1022
|
-
this.byEnd[chunk.next.end] = chunk.next;
|
|
1023
|
-
}
|
|
1024
|
-
if (aborted)
|
|
1025
|
-
return true;
|
|
1026
|
-
chunk = chunk.previous;
|
|
1027
|
-
} while (chunk);
|
|
1028
|
-
return false;
|
|
1029
|
-
}
|
|
1030
|
-
trimEnd(charType) {
|
|
1031
|
-
this.trimEndAborted(charType);
|
|
1032
|
-
return this;
|
|
1033
|
-
}
|
|
1034
|
-
trimStartAborted(charType) {
|
|
1035
|
-
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
1036
|
-
this.intro = this.intro.replace(rx, "");
|
|
1037
|
-
if (this.intro.length)
|
|
1038
|
-
return true;
|
|
1039
|
-
let chunk = this.firstChunk;
|
|
1040
|
-
do {
|
|
1041
|
-
const end = chunk.end;
|
|
1042
|
-
const aborted = chunk.trimStart(rx);
|
|
1043
|
-
if (chunk.end !== end) {
|
|
1044
|
-
if (chunk === this.lastChunk)
|
|
1045
|
-
this.lastChunk = chunk.next;
|
|
1046
|
-
this.byEnd[chunk.end] = chunk;
|
|
1047
|
-
this.byStart[chunk.next.start] = chunk.next;
|
|
1048
|
-
this.byEnd[chunk.next.end] = chunk.next;
|
|
1049
|
-
}
|
|
1050
|
-
if (aborted)
|
|
1051
|
-
return true;
|
|
1052
|
-
chunk = chunk.next;
|
|
1053
|
-
} while (chunk);
|
|
1054
|
-
return false;
|
|
1055
|
-
}
|
|
1056
|
-
trimStart(charType) {
|
|
1057
|
-
this.trimStartAborted(charType);
|
|
1058
|
-
return this;
|
|
1059
|
-
}
|
|
1060
|
-
hasChanged() {
|
|
1061
|
-
return this.original !== this.toString();
|
|
1062
|
-
}
|
|
1063
|
-
_replaceRegexp(searchValue, replacement) {
|
|
1064
|
-
function getReplacement(match, str) {
|
|
1065
|
-
if (typeof replacement === "string") {
|
|
1066
|
-
return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
|
|
1067
|
-
if (i === "$")
|
|
1068
|
-
return "$";
|
|
1069
|
-
if (i === "&")
|
|
1070
|
-
return match[0];
|
|
1071
|
-
const num = +i;
|
|
1072
|
-
if (num < match.length)
|
|
1073
|
-
return match[+i];
|
|
1074
|
-
return `$${i}`;
|
|
1075
|
-
});
|
|
1076
|
-
} else {
|
|
1077
|
-
return replacement(...match, match.index, str, match.groups);
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
function matchAll(re, str) {
|
|
1081
|
-
let match;
|
|
1082
|
-
const matches = [];
|
|
1083
|
-
while (match = re.exec(str)) {
|
|
1084
|
-
matches.push(match);
|
|
1085
|
-
}
|
|
1086
|
-
return matches;
|
|
1087
|
-
}
|
|
1088
|
-
if (searchValue.global) {
|
|
1089
|
-
const matches = matchAll(searchValue, this.original);
|
|
1090
|
-
matches.forEach((match) => {
|
|
1091
|
-
if (match.index != null)
|
|
1092
|
-
this.overwrite(
|
|
1093
|
-
match.index,
|
|
1094
|
-
match.index + match[0].length,
|
|
1095
|
-
getReplacement(match, this.original)
|
|
1096
|
-
);
|
|
1097
|
-
});
|
|
1098
|
-
} else {
|
|
1099
|
-
const match = this.original.match(searchValue);
|
|
1100
|
-
if (match && match.index != null)
|
|
1101
|
-
this.overwrite(
|
|
1102
|
-
match.index,
|
|
1103
|
-
match.index + match[0].length,
|
|
1104
|
-
getReplacement(match, this.original)
|
|
1105
|
-
);
|
|
1106
|
-
}
|
|
1107
|
-
return this;
|
|
1108
|
-
}
|
|
1109
|
-
_replaceString(string, replacement) {
|
|
1110
|
-
const { original } = this;
|
|
1111
|
-
const index = original.indexOf(string);
|
|
1112
|
-
if (index !== -1) {
|
|
1113
|
-
this.overwrite(index, index + string.length, replacement);
|
|
1114
|
-
}
|
|
1115
|
-
return this;
|
|
1116
|
-
}
|
|
1117
|
-
replace(searchValue, replacement) {
|
|
1118
|
-
if (typeof searchValue === "string") {
|
|
1119
|
-
return this._replaceString(searchValue, replacement);
|
|
1120
|
-
}
|
|
1121
|
-
return this._replaceRegexp(searchValue, replacement);
|
|
1122
|
-
}
|
|
1123
|
-
_replaceAllString(string, replacement) {
|
|
1124
|
-
const { original } = this;
|
|
1125
|
-
const stringLength = string.length;
|
|
1126
|
-
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
1127
|
-
this.overwrite(index, index + stringLength, replacement);
|
|
1128
|
-
}
|
|
1129
|
-
return this;
|
|
1130
|
-
}
|
|
1131
|
-
replaceAll(searchValue, replacement) {
|
|
1132
|
-
if (typeof searchValue === "string") {
|
|
1133
|
-
return this._replaceAllString(searchValue, replacement);
|
|
1134
|
-
}
|
|
1135
|
-
if (!searchValue.global) {
|
|
1136
|
-
throw new TypeError(
|
|
1137
|
-
"MagicString.prototype.replaceAll called with a non-global RegExp argument"
|
|
1138
|
-
);
|
|
1139
|
-
}
|
|
1140
|
-
return this._replaceRegexp(searchValue, replacement);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
export {
|
|
1144
|
-
SourceMap,
|
|
1145
|
-
MagicString as default
|
|
1146
|
-
};
|