@scbt-ecom/ui 0.93.0 → 0.95.0
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/README.md +1 -1
- package/dist/lib/configs/tailwindConfigBase.js.map +1 -1
- package/dist/lib/configs/tailwindPresets/resetPreset.js.map +1 -1
- package/dist/lib/next/utils/hasWidget.js.map +1 -1
- package/dist/lib/next/utils/hideWidgetsWithQueryParams.js.map +1 -1
- package/dist/lib/next/utils/orderWidgetWithQueryParams.js.map +1 -1
- package/dist/lib/shared/api/apiInstance.js.map +1 -1
- package/dist/lib/shared/hooks/useClickOutside.js.map +1 -1
- package/dist/lib/shared/hooks/useDebounce.js.map +1 -1
- package/dist/lib/shared/hooks/useDevice.js.map +1 -1
- package/dist/lib/shared/hooks/useFieldsProgress.js.map +1 -1
- package/dist/lib/shared/hooks/useFloating.js.map +1 -1
- package/dist/lib/shared/hooks/useObserverWidgets.js.map +1 -1
- package/dist/lib/shared/hooks/useOverflow.js.map +1 -1
- package/dist/lib/shared/ui/accordion/Accordion.js.map +1 -1
- package/dist/lib/shared/ui/calendar/Calendar.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/MonthCaption.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/Navigation.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/SelectDate.js.map +1 -1
- package/dist/lib/shared/ui/calendar/ui/selectDate/ui/SelectList.js.map +1 -1
- package/dist/lib/shared/ui/carousel/CarouselNative.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useArrowNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useCarousel.js.map +1 -1
- package/dist/lib/shared/ui/carousel/model/hooks/useDotsNavigation.js.map +1 -1
- package/dist/lib/shared/ui/carousel/ui/CarouselContent.js.map +1 -1
- package/dist/lib/shared/ui/dialog/Dialog.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/DropdownList.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/hooks/useKeyboardNavigation.js.map +1 -1
- package/dist/lib/shared/ui/dropdownList/ui/dropdownItem/DropdownItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/combobox/ComboboxControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/address/DadataAddress.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/address/DadataAddress.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/address/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/auto/DadataAuto.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/auto/DadataAuto.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/auto/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/country/DadataCountry.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/country/DadataCountry.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/country/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/fio/DadataFio.js +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/fio/DadataFio.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/fio/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/party/DadataOrganization.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dadata/party/query.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/model/utils.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/range.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/dayPickerControl/single.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/model/config.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/Editor.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/inputCurrency/InputCurrencyControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/inputCurrency/model/useInputCurrency.js.map +1 -1
- package/dist/lib/shared/ui/formElements/controlled/select/SelectControl.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/autocomplete/Autocomplete.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/autocomplete/types.js +2 -0
- package/dist/lib/shared/ui/formElements/uncontrolled/autocomplete/types.js.map +1 -0
- package/dist/lib/shared/ui/formElements/uncontrolled/checkbox/Checkbox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/combobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/combobox/hooks/useCombobox.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/dayPicker/DayPicker.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/index.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/input/Input.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/inputOtp/InputOtpBase.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/RadioGroup.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/radio/ui/RadioItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/Select.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/hooks/useSelectController.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/ui/Chip.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/select/ui/SelectItem.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/model/useLogarithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/Slider.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/SliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderAlgorithmic/hooks/useSliderAlgorithmic.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/SliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderMarks/hooks/useSliderMarks.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/SliderStep.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/slider/ui/sliderStep/hooks/useSliderStep.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/switch/Switch.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/textarea/Textarea.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/UploaderBase.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/model/hooks/useUploader.js.map +1 -1
- package/dist/lib/shared/ui/formElements/uncontrolled/uploader/ui/UploaderInput.js.map +1 -1
- package/dist/lib/shared/ui/modal/Modal.js.map +1 -1
- package/dist/lib/shared/ui/modal/ui/IframeModalContent.js.map +1 -1
- package/dist/lib/shared/ui/pagination/Pagination.js.map +1 -1
- package/dist/lib/shared/ui/providers/NotificationProvider.js.map +1 -1
- package/dist/lib/shared/ui/slot/Slot.js.map +1 -1
- package/dist/lib/shared/ui/slot/model/mergeProps.js.map +1 -1
- package/dist/lib/shared/ui/slot/ui/SlotClone.js.map +1 -1
- package/dist/lib/shared/ui/tabSwitcher/ui/TabContent.js.map +1 -1
- package/dist/lib/shared/ui/table/Mobile.js.map +1 -1
- package/dist/lib/shared/ui/table/model/TableUtils.js.map +1 -1
- package/dist/lib/shared/ui/table/ui/editableCell/EditableCell.js.map +1 -1
- package/dist/lib/shared/utils/localStorageActions.js.map +1 -1
- package/dist/lib/shared/utils/mergeRefs.js.map +1 -1
- package/dist/lib/shared/utils/scrollToElement.js.map +1 -1
- package/dist/lib/shared/utils/sessionStorage.js.map +1 -1
- package/dist/lib/shared/utils/typeGuards.js.map +1 -1
- package/dist/lib/shared/validation/base/base.constants.js.map +1 -1
- package/dist/lib/shared/validation/base/date.validators.js.map +1 -1
- package/dist/lib/shared/validation/base/phone.validators.js.map +1 -1
- package/dist/lib/shared/validation/base/select.validators.js.map +1 -1
- package/dist/lib/shared/validation/dadata/fio.validators.js.map +1 -1
- package/dist/lib/shared/validation/utils/zodUtils.js.map +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumb.js +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumb.js.map +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/lib/widgets/buttonWithHandlers/model/useButtonHandler.js.map +1 -1
- package/dist/lib/widgets/calculator/CalculatorView.js.map +1 -1
- package/dist/lib/widgets/calculator/ui/calculatorFields/hooks/useAdditionalSlider.js.map +1 -1
- package/dist/lib/widgets/dynamicForm/DynamicForm.js.map +1 -1
- package/dist/lib/widgets/dynamicFormDialog/DynamicFormDialog.js.map +1 -1
- package/dist/lib/widgets/fieldMapper/FieldMapper.js.map +1 -1
- package/dist/lib/widgets/footer/ui/Ligal.js.map +1 -1
- package/dist/lib/widgets/htmlParser/baseHtmlParser.js.map +1 -1
- package/dist/lib/widgets/htmlParser/htmlParser.js.map +1 -1
- package/dist/lib/widgets/htmlParser/reactHtmlParser.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoryTabs.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/Menu.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/MenuItem.js.map +1 -1
- package/dist/lib/widgets/userFeedback/model/hooks/useRating.js.map +1 -1
- package/dist/lib/widgets/userFeedback/ui/FeedbackTrigger.js.map +1 -1
- package/dist/lib/widgets/userFeedback/ui/UserReview.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectSpread2.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/date/index.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/date/mini.js.map +1 -1
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -1
- package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/hooks/use-transition.js.map +1 -1
- package/dist/node_modules/@headlessui/react/dist/internal/floating.js.map +1 -1
- package/dist/node_modules/@headlessui/react/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -1
- package/dist/node_modules/@headlessui/react/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js.map +1 -1
- package/dist/node_modules/@react-aria/interactions/dist/utils.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useEffectEvent.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js.map +1 -1
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js.map +1 -1
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js.map +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-character-count/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-color/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-history/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -1
- package/dist/node_modules/classnames/index.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/formatters.js.map +1 -1
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -1
- package/dist/node_modules/date-fns/format.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -1
- package/dist/node_modules/date-fns/locale/ru/_lib/formatRelative.js.map +1 -1
- package/dist/node_modules/date-fns/max.js.map +1 -1
- package/dist/node_modules/date-fns/min.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/Setter.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +1 -1
- package/dist/node_modules/date-fns/parse/_lib/utils.js.map +1 -1
- package/dist/node_modules/date-fns/parse.js.map +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -1
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -1
- package/dist/node_modules/file-selector/dist/es2015/file-selector.js.map +1 -1
- package/dist/node_modules/file-selector/dist/es2015/file.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/inertia.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/spring/find.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/generators/spring/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/easing/utils/map.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/batcher.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/render-step.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/frameloop/sync-time.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/Feature.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/animation/mix-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/shared/stack.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/projection/styles/transform.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/VisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/components/create-factory.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMKeyframesResolver.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/make-none-animatable.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/config-motion.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/KeyframesResolver.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/animation-state.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/flat-tree.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/get-variant-context.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/motion-values.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/render/utils/setters.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/delay.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/interpolate.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/mix/complex.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/offsets/fill.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/utils/subscription-manager.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/index.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/types/complex/filter.js.map +1 -1
- package/dist/node_modules/framer-motion/dist/es/value/types/complex/index.js.map +1 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/controls/BaseGroup.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/animation/controls/Group.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js.map +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js.map +1 -1
- package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Handles/Handle.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Handles/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Marks/Mark.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Marks/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Slider.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Steps/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Tracks/Track.js.map +1 -1
- package/dist/node_modules/rc-slider/es/Tracks/index.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useDrag.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useOffset.js.map +1 -1
- package/dist/node_modules/rc-slider/es/hooks/useRange.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useEvent.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useLayoutEffect.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useMergedState.js.map +1 -1
- package/dist/node_modules/rc-util/es/hooks/useState.js.map +1 -1
- package/dist/node_modules/rc-util/es/isEqual.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
- package/dist/node_modules/react-dropzone/dist/es/index.js.map +1 -1
- package/dist/node_modules/react-dropzone/dist/es/utils/index.js.map +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js +1 -1
- package/dist/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/dist/node_modules/react-number-format/dist/react-number-format.es.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
- package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
- package/dist/node_modules/tailwindcss/lib/public/create-plugin.js.map +1 -1
- package/dist/node_modules/tailwindcss/lib/util/createPlugin.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/zod/v3/ZodError.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +1 -1
- package/dist/node_modules/zod/v3/helpers/util.js.map +1 -1
- package/dist/node_modules/zod/v3/types.js.map +1 -1
- package/dist/src/shared/utils/getDynamicSchema.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/lib/shared/ui/formElements/controlled/dadata/address/DadataAddress.d.ts +2 -2
- package/dist/types/lib/shared/ui/formElements/controlled/dadata/auto/DadataAuto.d.ts +2 -2
- package/dist/types/lib/shared/ui/formElements/controlled/dadata/country/DadataCountry.d.ts +2 -2
- package/dist/types/lib/shared/ui/formElements/controlled/dadata/fio/DadataFio.d.ts +2 -2
- package/dist/types/lib/shared/ui/formElements/controlled/dadata/party/DadataOrganization.d.ts +2 -2
- package/dist/types/lib/shared/ui/formElements/uncontrolled/autocomplete/Autocomplete.d.ts +3 -2
- package/dist/types/lib/shared/ui/formElements/uncontrolled/autocomplete/index.d.ts +1 -0
- package/dist/types/lib/shared/ui/formElements/uncontrolled/autocomplete/types.d.ts +4 -0
- package/dist/types/lib/shared/ui/formElements/uncontrolled/index.d.ts +1 -1
- package/dist/types/lib/widgets/breadcrumbs/Breadcrumb.d.ts +3 -2
- package/package.json +1 -1
package/dist/node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcceleratedAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs"],"sourcesContent":["import { supportsLinearEasing, attachTimeline, isGenerator, isWaapiSupportedEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { anticipate } from '../../easing/anticipate.mjs';\nimport { backInOut } from '../../easing/back.mjs';\nimport { circInOut } from '../../easing/circ.mjs';\nimport { DOMKeyframesResolver } from '../../render/dom/DOMKeyframesResolver.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { MainThreadAnimation } from './MainThreadAnimation.mjs';\nimport { acceleratedValues } from './utils/accelerated-values.mjs';\nimport { startWaapiAnimation } from './waapi/index.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\nimport { supportsWaapi } from './waapi/utils/supports-waapi.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxDuration = 20000;\n/**\n * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.\n * WAAPI doesn't support spring or function easings so we run these as JS animation before\n * handing off.\n */\nfunction requiresPregeneratedKeyframes(options) {\n return (isGenerator(options.type) ||\n options.type === \"spring\" ||\n !isWaapiSupportedEasing(options.ease));\n}\nfunction pregenerateKeyframes(keyframes, options) {\n /**\n * Create a main-thread animation to pregenerate keyframes.\n * We sample this at regular intervals to generate keyframes that we then\n * linearly interpolate between.\n */\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n repeat: 0,\n delay: 0,\n isGenerator: true,\n });\n let state = { done: false, value: keyframes[0] };\n const pregeneratedKeyframes = [];\n /**\n * Bail after 20 seconds of pre-generated keyframes as it's likely\n * we're heading for an infinite loop.\n */\n let t = 0;\n while (!state.done && t < maxDuration) {\n state = sampleAnimation.sample(t);\n pregeneratedKeyframes.push(state.value);\n t += sampleDelta;\n }\n return {\n times: undefined,\n keyframes: pregeneratedKeyframes,\n duration: t - sampleDelta,\n ease: \"linear\",\n };\n}\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nclass AcceleratedAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n const { name, motionValue, element, keyframes } = this.options;\n this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n initPlayback(keyframes, finalKeyframe) {\n let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options;\n /**\n * If element has since been unmounted, return false to indicate\n * the animation failed to initialised.\n */\n if (!motionValue.owner || !motionValue.owner.current) {\n return false;\n }\n /**\n * If the user has provided an easing function name that isn't supported\n * by WAAPI (like \"anticipate\"), we need to provide the corressponding\n * function. This will later get converted to a linear() easing function.\n */\n if (typeof ease === \"string\" &&\n supportsLinearEasing() &&\n isUnsupportedEase(ease)) {\n ease = unsupportedEasingFunctions[ease];\n }\n /**\n * If this animation needs pre-generated keyframes then generate.\n */\n if (requiresPregeneratedKeyframes(this.options)) {\n const { onComplete, onUpdate, motionValue, element, ...options } = this.options;\n const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);\n keyframes = pregeneratedAnimation.keyframes;\n // If this is a very short animation, ensure we have\n // at least two keyframes to animate between as older browsers\n // can't animate between a single keyframe.\n if (keyframes.length === 1) {\n keyframes[1] = keyframes[0];\n }\n duration = pregeneratedAnimation.duration;\n times = pregeneratedAnimation.times;\n ease = pregeneratedAnimation.ease;\n type = \"keyframes\";\n }\n const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });\n // Override the browser calculated startTime with one synchronised to other JS\n // and WAAPI animations starting this event loop.\n animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n if (this.pendingTimeline) {\n attachTimeline(animation, this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n else {\n /**\n * Prefer the `onfinish` prop as it's more widely supported than\n * the `finished` promise.\n *\n * Here, we synchronously set the provided MotionValue to the end\n * keyframe. If we didn't, when the WAAPI animation is finished it would\n * be removed from the element which would then revert to its old styles.\n */\n animation.onfinish = () => {\n const { onComplete } = this.options;\n motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.cancel();\n this.resolveFinishedPromise();\n };\n }\n return {\n animation,\n duration,\n times,\n type,\n ease,\n keyframes: keyframes,\n };\n }\n get duration() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { duration } = resolved;\n return millisecondsToSeconds(duration);\n }\n get time() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { animation } = resolved;\n return millisecondsToSeconds(animation.currentTime || 0);\n }\n set time(newTime) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.currentTime = secondsToMilliseconds(newTime);\n }\n get speed() {\n const { resolved } = this;\n if (!resolved)\n return 1;\n const { animation } = resolved;\n return animation.playbackRate;\n }\n set speed(newSpeed) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.playbackRate = newSpeed;\n }\n get state() {\n const { resolved } = this;\n if (!resolved)\n return \"idle\";\n const { animation } = resolved;\n return animation.playState;\n }\n get startTime() {\n const { resolved } = this;\n if (!resolved)\n return null;\n const { animation } = resolved;\n // Coerce to number as TypeScript incorrectly types this\n // as CSSNumberish\n return animation.startTime;\n }\n /**\n * Replace the default DocumentTimeline with another AnimationTimeline.\n * Currently used for scroll animations.\n */\n attachTimeline(timeline) {\n if (!this._resolved) {\n this.pendingTimeline = timeline;\n }\n else {\n const { resolved } = this;\n if (!resolved)\n return noop;\n const { animation } = resolved;\n attachTimeline(animation, timeline);\n }\n return noop;\n }\n play() {\n if (this.isStopped)\n return;\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n if (animation.playState === \"finished\") {\n this.updateFinishedPromise();\n }\n animation.play();\n }\n pause() {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.pause();\n }\n stop() {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation, keyframes, duration, type, ease, times } = resolved;\n if (animation.playState === \"idle\" ||\n animation.playState === \"finished\") {\n return;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n if (this.time) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n duration,\n type,\n ease,\n times,\n isGenerator: true,\n });\n const sampleTime = secondsToMilliseconds(this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n }\n const { onStop } = this.options;\n onStop && onStop();\n this.cancel();\n }\n complete() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.finish();\n }\n cancel() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.cancel();\n }\n static supports(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n if (!motionValue ||\n !motionValue.owner ||\n !(motionValue.owner.current instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !transformTemplate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n }\n}\n\nexport { AcceleratedAnimation };\n"],"names":["sampleDelta","maxDuration","requiresPregeneratedKeyframes","options","isGenerator","isWaapiSupportedEasing","pregenerateKeyframes","keyframes","sampleAnimation","MainThreadAnimation","state","pregeneratedKeyframes","t","unsupportedEasingFunctions","anticipate","backInOut","circInOut","isUnsupportedEase","key","AcceleratedAnimation","BaseAnimation","name","motionValue","element","DOMKeyframesResolver","resolvedKeyframes","finalKeyframe","duration","times","ease","type","startTime","supportsLinearEasing","onComplete","onUpdate","pregeneratedAnimation","animation","startWaapiAnimation","attachTimeline","getFinalKeyframe","resolved","millisecondsToSeconds","newTime","secondsToMilliseconds","newSpeed","timeline","noop","sampleTime","onStop","repeatDelay","repeatType","damping","transformTemplate","supportsWaapi","acceleratedValues"],"mappings":"osCAkBA,MAAMA,EAAc,GAKdC,EAAc,IAMpB,SAASC,EAA8BC,EAAS,CAC5C,OAAQC,EAAYD,EAAQ,IAAI,GAC5BA,EAAQ,OAAS,UACjB,CAACE,EAAuBF,EAAQ,IAAI,CAC5C,CACA,SAASG,EAAqBC,EAAWJ,EAAS,CAM9C,MAAMK,EAAkB,IAAIC,EAAoB,CAC5C,GAAGN,EACH,UAAAI,EACA,OAAQ,EACR,MAAO,EACP,YAAa,EACrB,CAAK,EACD,IAAIG,EAAQ,CAAE,KAAM,GAAO,MAAOH,EAAU,CAAC,CAAC,EAC9C,MAAMI,EAAwB,CAAA,EAK9B,IAAIC,EAAI,EACR,KAAO,CAACF,EAAM,MAAQE,EAAIX,GACtBS,EAAQF,EAAgB,OAAOI,CAAC,EAChCD,EAAsB,KAAKD,EAAM,KAAK,EACtCE,GAAKZ,EAET,MAAO,CACH,MAAO,OACP,UAAWW,EACX,SAAUC,EAAIZ,EACd,KAAM,QACd,CACA,CACA,MAAMa,EAA6B,CAC/B,WAAAC,EACA,UAAAC,EACA,UAAAC,CACJ,EACA,SAASC,EAAkBC,EAAK,CAC5B,OAAOA,KAAOL,CAClB,CACA,MAAMM,WAA6BC,CAAc,CAC7C,YAAYjB,EAAS,CACjB,MAAMA,CAAO,EACb,KAAM,CAAE,KAAAkB,EAAM,YAAAC,EAAa,QAAAC,EAAS,UAAAhB,CAAS,EAAK,KAAK,QACvD,KAAK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OQ,EAAgB,OAAOuC,CAAU,EAAE,MAAO/C,CAAW,CACrJ,CACQ,KAAM,CAAE,OAAAgD,GAAW,KAAK,QACxBA,GAAUA,EAAM,EAChB,KAAK,OAAM,CACnB,CACI,UAAW,CACP,KAAM,CAAE,SAAAR,CAAQ,EAAK,KAChBA,GAELA,EAAS,UAAU,OAAM,CACjC,CACI,QAAS,CACL,KAAM,CAAE,SAAAA,CAAQ,EAAK,KAChBA,GAELA,EAAS,UAAU,OAAM,CACjC,CACI,OAAO,SAASrC,EAAS,CACrB,KAAM,CAAE,YAAAmB,EAAa,KAAAD,EAAM,YAAA4B,EAAa,WAAAC,EAAY,QAAAC,EAAS,KAAArB,CAAI,EAAK3B,EACtE,GAAI,CAACmB,GACD,CAACA,EAAY,OACb,EAAEA,EAAY,MAAM,mBAAmB,aACvC,MAAO,GAEX,KAAM,CAAE,SAAAY,EAAU,kBAAAkB,CAAiB,EAAK9B,EAAY,MAAM,SAAQ,EAClE,OAAQ+B,EAAa,GACjBhC,GACAiC,EAAkB,IAAIjC,CAAI,GAK1B,CAACa,GACD,CAACkB,GACD,CAACH,GACDC,IAAe,UACfC,IAAY,GACZrB,IAAS,SACrB,CACA","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"AcceleratedAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/AcceleratedAnimation.mjs"],"sourcesContent":["import { supportsLinearEasing, attachTimeline, isGenerator, isWaapiSupportedEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';\nimport { anticipate } from '../../easing/anticipate.mjs';\nimport { backInOut } from '../../easing/back.mjs';\nimport { circInOut } from '../../easing/circ.mjs';\nimport { DOMKeyframesResolver } from '../../render/dom/DOMKeyframesResolver.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { MainThreadAnimation } from './MainThreadAnimation.mjs';\nimport { acceleratedValues } from './utils/accelerated-values.mjs';\nimport { startWaapiAnimation } from './waapi/index.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\nimport { supportsWaapi } from './waapi/utils/supports-waapi.mjs';\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10; //ms\n/**\n * Implement a practical max duration for keyframe generation\n * to prevent infinite loops\n */\nconst maxDuration = 20000;\n/**\n * Check if an animation can run natively via WAAPI or requires pregenerated keyframes.\n * WAAPI doesn't support spring or function easings so we run these as JS animation before\n * handing off.\n */\nfunction requiresPregeneratedKeyframes(options) {\n return (isGenerator(options.type) ||\n options.type === \"spring\" ||\n !isWaapiSupportedEasing(options.ease));\n}\nfunction pregenerateKeyframes(keyframes, options) {\n /**\n * Create a main-thread animation to pregenerate keyframes.\n * We sample this at regular intervals to generate keyframes that we then\n * linearly interpolate between.\n */\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n repeat: 0,\n delay: 0,\n isGenerator: true,\n });\n let state = { done: false, value: keyframes[0] };\n const pregeneratedKeyframes = [];\n /**\n * Bail after 20 seconds of pre-generated keyframes as it's likely\n * we're heading for an infinite loop.\n */\n let t = 0;\n while (!state.done && t < maxDuration) {\n state = sampleAnimation.sample(t);\n pregeneratedKeyframes.push(state.value);\n t += sampleDelta;\n }\n return {\n times: undefined,\n keyframes: pregeneratedKeyframes,\n duration: t - sampleDelta,\n ease: \"linear\",\n };\n}\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n};\nfunction isUnsupportedEase(key) {\n return key in unsupportedEasingFunctions;\n}\nclass AcceleratedAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n const { name, motionValue, element, keyframes } = this.options;\n this.resolver = new DOMKeyframesResolver(keyframes, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n initPlayback(keyframes, finalKeyframe) {\n let { duration = 300, times, ease, type, motionValue, name, startTime, } = this.options;\n /**\n * If element has since been unmounted, return false to indicate\n * the animation failed to initialised.\n */\n if (!motionValue.owner || !motionValue.owner.current) {\n return false;\n }\n /**\n * If the user has provided an easing function name that isn't supported\n * by WAAPI (like \"anticipate\"), we need to provide the corressponding\n * function. This will later get converted to a linear() easing function.\n */\n if (typeof ease === \"string\" &&\n supportsLinearEasing() &&\n isUnsupportedEase(ease)) {\n ease = unsupportedEasingFunctions[ease];\n }\n /**\n * If this animation needs pre-generated keyframes then generate.\n */\n if (requiresPregeneratedKeyframes(this.options)) {\n const { onComplete, onUpdate, motionValue, element, ...options } = this.options;\n const pregeneratedAnimation = pregenerateKeyframes(keyframes, options);\n keyframes = pregeneratedAnimation.keyframes;\n // If this is a very short animation, ensure we have\n // at least two keyframes to animate between as older browsers\n // can't animate between a single keyframe.\n if (keyframes.length === 1) {\n keyframes[1] = keyframes[0];\n }\n duration = pregeneratedAnimation.duration;\n times = pregeneratedAnimation.times;\n ease = pregeneratedAnimation.ease;\n type = \"keyframes\";\n }\n const animation = startWaapiAnimation(motionValue.owner.current, name, keyframes, { ...this.options, duration, times, ease });\n // Override the browser calculated startTime with one synchronised to other JS\n // and WAAPI animations starting this event loop.\n animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n if (this.pendingTimeline) {\n attachTimeline(animation, this.pendingTimeline);\n this.pendingTimeline = undefined;\n }\n else {\n /**\n * Prefer the `onfinish` prop as it's more widely supported than\n * the `finished` promise.\n *\n * Here, we synchronously set the provided MotionValue to the end\n * keyframe. If we didn't, when the WAAPI animation is finished it would\n * be removed from the element which would then revert to its old styles.\n */\n animation.onfinish = () => {\n const { onComplete } = this.options;\n motionValue.set(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.cancel();\n this.resolveFinishedPromise();\n };\n }\n return {\n animation,\n duration,\n times,\n type,\n ease,\n keyframes: keyframes,\n };\n }\n get duration() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { duration } = resolved;\n return millisecondsToSeconds(duration);\n }\n get time() {\n const { resolved } = this;\n if (!resolved)\n return 0;\n const { animation } = resolved;\n return millisecondsToSeconds(animation.currentTime || 0);\n }\n set time(newTime) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.currentTime = secondsToMilliseconds(newTime);\n }\n get speed() {\n const { resolved } = this;\n if (!resolved)\n return 1;\n const { animation } = resolved;\n return animation.playbackRate;\n }\n set speed(newSpeed) {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.playbackRate = newSpeed;\n }\n get state() {\n const { resolved } = this;\n if (!resolved)\n return \"idle\";\n const { animation } = resolved;\n return animation.playState;\n }\n get startTime() {\n const { resolved } = this;\n if (!resolved)\n return null;\n const { animation } = resolved;\n // Coerce to number as TypeScript incorrectly types this\n // as CSSNumberish\n return animation.startTime;\n }\n /**\n * Replace the default DocumentTimeline with another AnimationTimeline.\n * Currently used for scroll animations.\n */\n attachTimeline(timeline) {\n if (!this._resolved) {\n this.pendingTimeline = timeline;\n }\n else {\n const { resolved } = this;\n if (!resolved)\n return noop;\n const { animation } = resolved;\n attachTimeline(animation, timeline);\n }\n return noop;\n }\n play() {\n if (this.isStopped)\n return;\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n if (animation.playState === \"finished\") {\n this.updateFinishedPromise();\n }\n animation.play();\n }\n pause() {\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation } = resolved;\n animation.pause();\n }\n stop() {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n const { resolved } = this;\n if (!resolved)\n return;\n const { animation, keyframes, duration, type, ease, times } = resolved;\n if (animation.playState === \"idle\" ||\n animation.playState === \"finished\") {\n return;\n }\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read commited styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n if (this.time) {\n const { motionValue, onUpdate, onComplete, element, ...options } = this.options;\n const sampleAnimation = new MainThreadAnimation({\n ...options,\n keyframes,\n duration,\n type,\n ease,\n times,\n isGenerator: true,\n });\n const sampleTime = secondsToMilliseconds(this.time);\n motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);\n }\n const { onStop } = this.options;\n onStop && onStop();\n this.cancel();\n }\n complete() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.finish();\n }\n cancel() {\n const { resolved } = this;\n if (!resolved)\n return;\n resolved.animation.cancel();\n }\n static supports(options) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } = options;\n if (!motionValue ||\n !motionValue.owner ||\n !(motionValue.owner.current instanceof HTMLElement)) {\n return false;\n }\n const { onUpdate, transformTemplate } = motionValue.owner.getProps();\n return (supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !transformTemplate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\");\n }\n}\n\nexport { AcceleratedAnimation };\n"],"names":["sampleDelta","maxDuration","requiresPregeneratedKeyframes","options","isGenerator","isWaapiSupportedEasing","pregenerateKeyframes","keyframes","sampleAnimation","MainThreadAnimation","state","pregeneratedKeyframes","t","unsupportedEasingFunctions","anticipate","backInOut","circInOut","isUnsupportedEase","key","AcceleratedAnimation","BaseAnimation","name","motionValue","element","DOMKeyframesResolver","resolvedKeyframes","finalKeyframe","duration","times","ease","type","startTime","supportsLinearEasing","onComplete","onUpdate","pregeneratedAnimation","animation","startWaapiAnimation","attachTimeline","getFinalKeyframe","resolved","millisecondsToSeconds","newTime","secondsToMilliseconds","newSpeed","timeline","noop","sampleTime","onStop","repeatD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CAC7B,CACA,OAAO,SAASrC,EAAS,CACrB,KAAM,CAAE,YAAAmB,EAAa,KAAAD,EAAM,YAAA4B,EAAa,WAAAC,EAAY,QAAAC,EAAS,KAAArB,CAAI,EAAK3B,EACtE,GAAI,CAACmB,GACD,CAACA,EAAY,OACb,EAAEA,EAAY,MAAM,mBAAmB,aACvC,MAAO,GAEX,KAAM,CAAE,SAAAY,EAAU,kBAAAkB,CAAiB,EAAK9B,EAAY,MAAM,SAAQ,EAClE,OAAQ+B,EAAa,GACjBhC,GACAiC,EAAkB,IAAIjC,CAAI,GAK1B,CAACa,GACD,CAACkB,GACD,CAACH,GACDC,IAAe,UACfC,IAAY,GACZrB,IAAS,SACjB,CACJ","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { flushKeyframeResolvers } from '../../render/utils/KeyframesResolver.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass BaseAnimation {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", ...options }) {\n // Track whether the animation has been stopped. Stopped animations won't restart.\n this.isStopped = false;\n this.hasAttemptedResolve = false;\n this.createdAt = time.now();\n this.options = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n ...options,\n };\n this.updateFinishedPromise();\n }\n /**\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first commited frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n calcStartTime() {\n if (!this.resolvedAt)\n return this.createdAt;\n return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt;\n }\n /**\n * A getter for resolved data. If keyframes are not yet resolved, accessing\n * this.resolved will synchronously flush all pending keyframe resolvers.\n * This is a deoptimisation, but at its worst still batches read/writes.\n */\n get resolved() {\n if (!this._resolved && !this.hasAttemptedResolve) {\n flushKeyframeResolvers();\n }\n return this._resolved;\n }\n /**\n * A method to be called when the keyframes resolver completes. This method\n * will check if its possible to run the animation and, if not, skip it.\n * Otherwise, it will call initPlayback on the implementing class.\n */\n onKeyframesResolved(keyframes, finalKeyframe) {\n this.resolvedAt = time.now();\n this.hasAttemptedResolve = true;\n const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {\n // Finish immediately\n if (instantAnimationState.current || !delay) {\n onUpdate &&\n onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.resolveFinishedPromise();\n return;\n }\n // Finish after a delay\n else {\n this.options.duration = 0;\n }\n }\n const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);\n if (resolvedAnimation === false)\n return;\n this._resolved = {\n keyframes,\n finalKeyframe,\n ...resolvedAnimation,\n };\n this.onPostResolved();\n }\n onPostResolved() { }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.currentFinishedPromise.then(resolve, reject);\n }\n flatten() {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n }\n updateFinishedPromise() {\n this.currentFinishedPromise = new Promise((resolve) => {\n this.resolveFinishedPromise = resolve;\n });\n }\n}\n\nexport { BaseAnimation };\n"],"names":["MAX_RESOLVE_DELAY","BaseAnimation","autoplay","delay","type","repeat","repeatDelay","repeatType","options","time","flushKeyframeResolvers","keyframes","finalKeyframe","name","velocity","onComplete","onUpdate","isGenerator","canAnimate","getFinalKeyframe","resolvedAnimation","resolve","reject"],"mappings":"gQAcA,MAAMA,EAAoB,GAC1B,MAAMC,CAAc,CAChB,YAAY,CAAE,SAAAC,EAAW,GAAM,MAAAC,EAAQ,EAAG,KAAAC,EAAO,YAAa,OAAAC,EAAS,EAAG,YAAAC,EAAc,EAAG,WAAAC,EAAa,OAAQ,GAAGC,GAAW,CAE1H,KAAK,UAAY,GACjB,KAAK,oBAAsB,GAC3B,KAAK,UAAYC,EAAK,IAAG,EACzB,KAAK,QAAU,CACX,SAAAP,EACA,MAAAC,EACA,KAAAC,EACA,OAAAC,EACA,YAAAC,EACA,WAAAC,EACA,GAAGC,CACf,EACQ,KAAK,sBAAqB,
|
|
1
|
+
{"version":3,"file":"BaseAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/BaseAnimation.mjs"],"sourcesContent":["import { time } from '../../frameloop/sync-time.mjs';\nimport { flushKeyframeResolvers } from '../../render/utils/KeyframesResolver.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { canAnimate } from './utils/can-animate.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40;\nclass BaseAnimation {\n constructor({ autoplay = true, delay = 0, type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType = \"loop\", ...options }) {\n // Track whether the animation has been stopped. Stopped animations won't restart.\n this.isStopped = false;\n this.hasAttemptedResolve = false;\n this.createdAt = time.now();\n this.options = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n ...options,\n };\n this.updateFinishedPromise();\n }\n /**\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first commited frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n calcStartTime() {\n if (!this.resolvedAt)\n return this.createdAt;\n return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt;\n }\n /**\n * A getter for resolved data. If keyframes are not yet resolved, accessing\n * this.resolved will synchronously flush all pending keyframe resolvers.\n * This is a deoptimisation, but at its worst still batches read/writes.\n */\n get resolved() {\n if (!this._resolved && !this.hasAttemptedResolve) {\n flushKeyframeResolvers();\n }\n return this._resolved;\n }\n /**\n * A method to be called when the keyframes resolver completes. This method\n * will check if its possible to run the animation and, if not, skip it.\n * Otherwise, it will call initPlayback on the implementing class.\n */\n onKeyframesResolved(keyframes, finalKeyframe) {\n this.resolvedAt = time.now();\n this.hasAttemptedResolve = true;\n const { name, type, velocity, delay, onComplete, onUpdate, isGenerator, } = this.options;\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!isGenerator && !canAnimate(keyframes, name, type, velocity)) {\n // Finish immediately\n if (instantAnimationState.current || !delay) {\n onUpdate &&\n onUpdate(getFinalKeyframe(keyframes, this.options, finalKeyframe));\n onComplete && onComplete();\n this.resolveFinishedPromise();\n return;\n }\n // Finish after a delay\n else {\n this.options.duration = 0;\n }\n }\n const resolvedAnimation = this.initPlayback(keyframes, finalKeyframe);\n if (resolvedAnimation === false)\n return;\n this._resolved = {\n keyframes,\n finalKeyframe,\n ...resolvedAnimation,\n };\n this.onPostResolved();\n }\n onPostResolved() { }\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve, reject) {\n return this.currentFinishedPromise.then(resolve, reject);\n }\n flatten() {\n this.options.type = \"keyframes\";\n this.options.ease = \"linear\";\n }\n updateFinishedPromise() {\n this.currentFinishedPromise = new Promise((resolve) => {\n this.resolveFinishedPromise = resolve;\n });\n }\n}\n\nexport { BaseAnimation };\n"],"names":["MAX_RESOLVE_DELAY","BaseAnimation","autoplay","delay","type","repeat","repeatDelay","repeatType","options","time","flushKeyframeResolvers","keyframes","finalKeyframe","name","velocity","onComplete","onUpdate","isGenerator","canAnimate","getFinalKeyframe","resolvedAnimation","resolve","reject"],"mappings":"gQAcA,MAAMA,EAAoB,GAC1B,MAAMC,CAAc,CAChB,YAAY,CAAE,SAAAC,EAAW,GAAM,MAAAC,EAAQ,EAAG,KAAAC,EAAO,YAAa,OAAAC,EAAS,EAAG,YAAAC,EAAc,EAAG,WAAAC,EAAa,OAAQ,GAAGC,GAAW,CAE1H,KAAK,UAAY,GACjB,KAAK,oBAAsB,GAC3B,KAAK,UAAYC,EAAK,IAAG,EACzB,KAAK,QAAU,CACX,SAAAP,EACA,MAAAC,EACA,KAAAC,EACA,OAAAC,EACA,YAAAC,EACA,WAAAC,EACA,GAAGC,CACf,EACQ,KAAK,sBAAqB,CAC9B,CAWA,eAAgB,CACZ,OAAK,KAAK,WAEH,KAAK,WAAa,KAAK,UAAYR,EACpC,KAAK,WACL,KAAK,UAHA,KAAK,SAIpB,CAMA,IAAI,UAAW,CACX,MAAI,CAAC,KAAK,WAAa,CAAC,KAAK,qBACzBU,EAAsB,EAEnB,KAAK,SAChB,CAMA,oBAAoBC,EAAWC,EAAe,CAC1C,KAAK,WAAaH,EAAK,IAAG,EAC1B,KAAK,oBAAsB,GAC3B,KAAM,CAAE,KAAAI,EAAM,KAAAT,EAAM,SAAAU,EAAU,MAAAX,EAAO,WAAAY,EAAY,SAAAC,EAAU,YAAAC,GAAiB,KAAK,QAKjF,GAAI,CAACA,GAAe,CAACC,EAAWP,EAAWE,EAAMT,EAAMU,CAAQ,EAE3D,GAAsCX,EASlC,KAAK,QAAQ,SAAW,MATiB,CACzCa,GACIA,EAASG,EAAiBR,EAAW,KAAK,QAASC,CAAa,CAAC,EACrEG,GAAcA,EAAU,EACxB,KAAK,uBAAsB,EAC3B,MACJ,CAMJ,MAAMK,EAAoB,KAAK,aAAaT,EAAWC,CAAa,EAChEQ,IAAsB,KAE1B,KAAK,UAAY,CACb,UAAAT,EACA,cAAAC,EACA,GAAGQ,CACf,EACQ,KAAK,eAAc,EACvB,CACA,gBAAiB,CAAE,CAMnB,KAAKC,EAASC,EAAQ,CAClB,OAAO,KAAK,uBAAuB,KAAKD,EAASC,CAAM,CAC3D,CACA,SAAU,CACN,KAAK,QAAQ,KAAO,YACpB,KAAK,QAAQ,KAAO,QACxB,CACA,uBAAwB,CACpB,KAAK,uBAAyB,IAAI,QAASD,GAAY,CACnD,KAAK,uBAAyBA,CAClC,CAAC,CACL,CACJ","x_google_ignoreList":[0]}
|
package/dist/node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainThreadAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs"],"sourcesContent":["import { isGenerator, calcGeneratorDuration } from 'motion-dom';\nimport { invariant, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { KeyframeResolver } from '../../render/utils/KeyframesResolver.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { frameloopDriver } from './drivers/driver-frameloop.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nconst generators = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nconst percentToProgress = (percent) => percent / 100;\n/**\n * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of\n * features we expose publically. Mostly the compatibility is to ensure visual identity\n * between both WAAPI and main thread animations.\n */\nclass MainThreadAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * The time at which the animation was cancelled.\n */\n this.cancelTime = null;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * The state of the animation to apply when the animation is resolved. This\n * allows calls to the public API to control the animation before it is resolved,\n * without us having to resolve it first.\n */\n this.pendingPlayState = \"running\";\n /**\n * The time at which the animation was started.\n */\n this.startTime = null;\n this.state = \"idle\";\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n const { onStop } = this.options;\n onStop && onStop();\n };\n const { name, motionValue, element, keyframes } = this.options;\n const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver;\n const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);\n this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n flatten() {\n super.flatten();\n // If we've already resolved the animation, re-initialise it\n if (this._resolved) {\n Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));\n }\n }\n initPlayback(keyframes$1) {\n const { type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;\n const generatorFactory = isGenerator(type)\n ? type\n : generators[type] || keyframes;\n /**\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n let mapPercentToKeyframes;\n let mirroredGenerator;\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\n }\n mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n mirroredGenerator = generatorFactory({\n ...this.options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n const resolvedDuration = calculatedDuration + repeatDelay;\n const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\n return {\n generator,\n mirroredGenerator,\n mapPercentToKeyframes,\n calculatedDuration,\n resolvedDuration,\n totalDuration,\n };\n }\n onPostResolved() {\n const { autoplay = true } = this.options;\n this.play();\n if (this.pendingPlayState === \"paused\" || !autoplay) {\n this.pause();\n }\n else {\n this.state = this.pendingPlayState;\n }\n }\n tick(timestamp, sample = false) {\n const { resolved } = this;\n // If the animations has failed to resolve, return the final keyframe.\n if (!resolved) {\n const { keyframes } = this.options;\n return { done: true, value: keyframes[keyframes.length - 1] };\n }\n const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;\n if (this.startTime === null)\n return generator.next(0);\n const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n // Update currentTime\n if (sample) {\n this.currentTime = timestamp;\n }\n else if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime =\n Math.round(timestamp - this.startTime) * this.speed;\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);\n const isInDelayPhase = this.speed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mapPercentToKeyframes) {\n state.value = mapPercentToKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.speed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n if (isAnimationFinished && finalKeyframe !== undefined) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n get duration() {\n const { resolved } = this;\n return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.holdTime !== null || this.speed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.speed;\n }\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (!this.resolver.isScheduled) {\n this.resolver.resume();\n }\n if (!this._resolved) {\n this.pendingPlayState = \"running\";\n return;\n }\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, onPlay, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n onPlay && onPlay();\n const now = this.driver.now();\n if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n }\n else if (this.state === \"finished\") {\n this.startTime = now;\n }\n if (this.state === \"finished\") {\n this.updateFinishedPromise();\n }\n this.cancelTime = this.startTime;\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n var _a;\n if (!this._resolved) {\n this.pendingPlayState = \"paused\";\n return;\n }\n this.state = \"paused\";\n this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.pendingPlayState = this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.teardown();\n this.state = \"finished\";\n const { onComplete } = this.options;\n onComplete && onComplete();\n }\n cancel() {\n if (this.cancelTime !== null) {\n this.tick(this.cancelTime);\n }\n this.teardown();\n this.updateFinishedPromise();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n this.startTime = this.cancelTime = null;\n this.resolver.cancel();\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(time) {\n this.startTime = 0;\n return this.tick(time, true);\n }\n}\n// Legacy interface\nfunction animateValue(options) {\n return new MainThreadAnimation(options);\n}\n\nexport { MainThreadAnimation, animateValue };\n"],"names":["generators","inertia","keyframes","spring","percentToProgress","percent","MainThreadAnimation","BaseAnimation","options","onStop","name","motionValue","element","KeyframeResolver$1","KeyframeResolver","onResolved","resolvedKeyframes","finalKeyframe","keyframes$1","type","repeat","repeatDelay","repeatType","velocity","generatorFactory","isGenerator","mapPercentToKeyframes","mirroredGenerator","pipe","mix","generator","calcGeneratorDuration","calculatedDuration","resolvedDuration","totalDuration","autoplay","timestamp","sample","resolved","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","progress","currentIteration","iterationProgress","clamp","state","done","isAnimationFinished","getFinalKeyframe","millisecondsToSeconds","newTime","secondsToMilliseconds","newSpeed","hasChanged","driver","frameloopDriver","onPlay","startTime","now","_a","onComplete","time"],"mappings":"w4BAaA,MAAMA,EAAa,CACf,MAAOC,EACP,QAAAA,EACA,MAAOC,EACP,UAAAA,EACA,OAAAC,CACJ,EACMC,EAAqBC,GAAYA,EAAU,IAMjD,MAAMC,WAA4BC,CAAc,CAC5C,YAAYC,EAAS,CACjB,MAAMA,CAAO,EAIb,KAAK,SAAW,KAIhB,KAAK,WAAa,KAIlB,KAAK,YAAc,EAInB,KAAK,cAAgB,EAMrB,KAAK,iBAAmB,UAIxB,KAAK,UAAY,KACjB,KAAK,MAAQ,OAKb,KAAK,KAAO,IAAM,CAGd,GAFA,KAAK,SAAS,OAAA,EACd,KAAK,UAAY,GACb,KAAK,QAAU,OACf,OACJ,KAAK,SAAA,EACL,KAAM,CAAE,OAAAC,GAAW,KAAK,QACxBA,GAAUA,EAAA,CAAO,EAErB,KAAM,CAAE,KAAAC,EAAM,YAAAC,EAAa,QAAAC,EAAS,UAAAV,CAAAA,EAAc,KAAK,QACjDW,GAAsBD,GAAY,KAA6B,OAASA,EAAQ,mBAAqBE,EACrGC,EAAa,CAACC,EAAmBC,IAAkB,KAAK,oBAAoBD,EAAmBC,CAAa,EAClH,KAAK,SAAW,IAAIJ,EAAmBX,EAAWa,EAAYL,EAAMC,EAAaC,CAAO,EACxF,KAAK,SAAS,gBAAA,CAAgB,CAElC,SAAU,CACN,MAAM,QAAA,EAEF,KAAK,WACL,OAAO,OAAO,KAAK,UAAW,KAAK,aAAa,KAAK,UAAU,SAAS,CAAC,CAC7E,CAEJ,aAAaM,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AAI,CAAA,CAEnC","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"MainThreadAnimation.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/animators/MainThreadAnimation.mjs"],"sourcesContent":["import { isGenerator, calcGeneratorDuration } from 'motion-dom';\nimport { invariant, millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { KeyframeResolver } from '../../render/utils/KeyframesResolver.mjs';\nimport { clamp } from '../../utils/clamp.mjs';\nimport { mix } from '../../utils/mix/index.mjs';\nimport { pipe } from '../../utils/pipe.mjs';\nimport { inertia } from '../generators/inertia.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { spring } from '../generators/spring/index.mjs';\nimport { BaseAnimation } from './BaseAnimation.mjs';\nimport { frameloopDriver } from './drivers/driver-frameloop.mjs';\nimport { getFinalKeyframe } from './waapi/utils/get-final-keyframe.mjs';\n\nconst generators = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n};\nconst percentToProgress = (percent) => percent / 100;\n/**\n * Animation that runs on the main thread. Designed to be WAAPI-spec in the subset of\n * features we expose publically. Mostly the compatibility is to ensure visual identity\n * between both WAAPI and main thread animations.\n */\nclass MainThreadAnimation extends BaseAnimation {\n constructor(options) {\n super(options);\n /**\n * The time at which the animation was paused.\n */\n this.holdTime = null;\n /**\n * The time at which the animation was cancelled.\n */\n this.cancelTime = null;\n /**\n * The current time of the animation.\n */\n this.currentTime = 0;\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n this.playbackSpeed = 1;\n /**\n * The state of the animation to apply when the animation is resolved. This\n * allows calls to the public API to control the animation before it is resolved,\n * without us having to resolve it first.\n */\n this.pendingPlayState = \"running\";\n /**\n * The time at which the animation was started.\n */\n this.startTime = null;\n this.state = \"idle\";\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n this.stop = () => {\n this.resolver.cancel();\n this.isStopped = true;\n if (this.state === \"idle\")\n return;\n this.teardown();\n const { onStop } = this.options;\n onStop && onStop();\n };\n const { name, motionValue, element, keyframes } = this.options;\n const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver;\n const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);\n this.resolver = new KeyframeResolver$1(keyframes, onResolved, name, motionValue, element);\n this.resolver.scheduleResolve();\n }\n flatten() {\n super.flatten();\n // If we've already resolved the animation, re-initialise it\n if (this._resolved) {\n Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));\n }\n }\n initPlayback(keyframes$1) {\n const { type = \"keyframes\", repeat = 0, repeatDelay = 0, repeatType, velocity = 0, } = this.options;\n const generatorFactory = isGenerator(type)\n ? type\n : generators[type] || keyframes;\n /**\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n let mapPercentToKeyframes;\n let mirroredGenerator;\n if (generatorFactory !== keyframes &&\n typeof keyframes$1[0] !== \"number\") {\n if (process.env.NODE_ENV !== \"production\") {\n invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);\n }\n mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1]));\n keyframes$1 = [0, 100];\n }\n const generator = generatorFactory({ ...this.options, keyframes: keyframes$1 });\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n mirroredGenerator = generatorFactory({\n ...this.options,\n keyframes: [...keyframes$1].reverse(),\n velocity: -velocity,\n });\n }\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator);\n }\n const { calculatedDuration } = generator;\n const resolvedDuration = calculatedDuration + repeatDelay;\n const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;\n return {\n generator,\n mirroredGenerator,\n mapPercentToKeyframes,\n calculatedDuration,\n resolvedDuration,\n totalDuration,\n };\n }\n onPostResolved() {\n const { autoplay = true } = this.options;\n this.play();\n if (this.pendingPlayState === \"paused\" || !autoplay) {\n this.pause();\n }\n else {\n this.state = this.pendingPlayState;\n }\n }\n tick(timestamp, sample = false) {\n const { resolved } = this;\n // If the animations has failed to resolve, return the final keyframe.\n if (!resolved) {\n const { keyframes } = this.options;\n return { done: true, value: keyframes[keyframes.length - 1] };\n }\n const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes, calculatedDuration, totalDuration, resolvedDuration, } = resolved;\n if (this.startTime === null)\n return generator.next(0);\n const { delay, repeat, repeatType, repeatDelay, onUpdate } = this.options;\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp);\n }\n else if (this.speed < 0) {\n this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime);\n }\n // Update currentTime\n if (sample) {\n this.currentTime = timestamp;\n }\n else if (this.holdTime !== null) {\n this.currentTime = this.holdTime;\n }\n else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime =\n Math.round(timestamp - this.startTime) * this.speed;\n }\n // Rebase on delay\n const timeWithoutDelay = this.currentTime - delay * (this.speed >= 0 ? 1 : -1);\n const isInDelayPhase = this.speed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration;\n this.currentTime = Math.max(timeWithoutDelay, 0);\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration;\n }\n let elapsed = this.currentTime;\n let frameGenerator = generator;\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress = Math.min(this.currentTime, totalDuration) / resolvedDuration;\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress);\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0;\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1;\n }\n iterationProgress === 1 && currentIteration--;\n currentIteration = Math.min(currentIteration, repeat + 1);\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n const isOddIteration = Boolean(currentIteration % 2);\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress;\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration;\n }\n }\n else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator;\n }\n }\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;\n }\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed);\n if (mapPercentToKeyframes) {\n state.value = mapPercentToKeyframes(state.value);\n }\n let { done } = state;\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.speed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0;\n }\n const isAnimationFinished = this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done));\n if (isAnimationFinished && finalKeyframe !== undefined) {\n state.value = getFinalKeyframe(keyframes, this.options, finalKeyframe);\n }\n if (onUpdate) {\n onUpdate(state.value);\n }\n if (isAnimationFinished) {\n this.finish();\n }\n return state;\n }\n get duration() {\n const { resolved } = this;\n return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;\n }\n get time() {\n return millisecondsToSeconds(this.currentTime);\n }\n set time(newTime) {\n newTime = secondsToMilliseconds(newTime);\n this.currentTime = newTime;\n if (this.holdTime !== null || this.speed === 0) {\n this.holdTime = newTime;\n }\n else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.speed;\n }\n }\n get speed() {\n return this.playbackSpeed;\n }\n set speed(newSpeed) {\n const hasChanged = this.playbackSpeed !== newSpeed;\n this.playbackSpeed = newSpeed;\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime);\n }\n }\n play() {\n if (!this.resolver.isScheduled) {\n this.resolver.resume();\n }\n if (!this._resolved) {\n this.pendingPlayState = \"running\";\n return;\n }\n if (this.isStopped)\n return;\n const { driver = frameloopDriver, onPlay, startTime } = this.options;\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp));\n }\n onPlay && onPlay();\n const now = this.driver.now();\n if (this.holdTime !== null) {\n this.startTime = now - this.holdTime;\n }\n else if (!this.startTime) {\n this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime();\n }\n else if (this.state === \"finished\") {\n this.startTime = now;\n }\n if (this.state === \"finished\") {\n this.updateFinishedPromise();\n }\n this.cancelTime = this.startTime;\n this.holdTime = null;\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\";\n this.driver.start();\n }\n pause() {\n var _a;\n if (!this._resolved) {\n this.pendingPlayState = \"paused\";\n return;\n }\n this.state = \"paused\";\n this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0;\n }\n complete() {\n if (this.state !== \"running\") {\n this.play();\n }\n this.pendingPlayState = this.state = \"finished\";\n this.holdTime = null;\n }\n finish() {\n this.teardown();\n this.state = \"finished\";\n const { onComplete } = this.options;\n onComplete && onComplete();\n }\n cancel() {\n if (this.cancelTime !== null) {\n this.tick(this.cancelTime);\n }\n this.teardown();\n this.updateFinishedPromise();\n }\n teardown() {\n this.state = \"idle\";\n this.stopDriver();\n this.resolveFinishedPromise();\n this.updateFinishedPromise();\n this.startTime = this.cancelTime = null;\n this.resolver.cancel();\n }\n stopDriver() {\n if (!this.driver)\n return;\n this.driver.stop();\n this.driver = undefined;\n }\n sample(time) {\n this.startTime = 0;\n return this.tick(time, true);\n }\n}\n// Legacy interface\nfunction animateValue(options) {\n return new MainThreadAnimation(options);\n}\n\nexport { MainThreadAnimation, animateValue };\n"],"names":["generators","inertia","keyframes","spring","percentToProgress","percent","MainThreadAnimation","BaseAnimation","options","onStop","name","motionValue","element","KeyframeResolver$1","KeyframeResolver","onResolved","resolvedKeyframes","finalKeyframe","keyframes$1","type","repeat","repeatDelay","repeatType","velocity","generatorFactory","isGenerator","mapPercentToKeyframes","mirroredGenerator","pipe","mix","generator","calcGeneratorDuration","calculatedDuration","resolvedDuration","totalDuration","autoplay","timestamp","sample","resolved","delay","onUpdate","timeWithoutDelay","isInDelayPhase","elapsed","frameGenerator","progress","currentIteration","iterationProgress","clamp","state","done","isAnimationFinished","getFinalKeyframe","millisecondsToSeconds","newTime","secondsToMilliseconds","newSpeed","hasChanged","driver","frameloopDriver","onPlay","startTime","now","_a","onComplete","time"],"mappings":"w4BAaA,MAAMA,EAAa,CACf,MAAOC,EACP,QAAAA,EACA,MAAOC,EACP,UAAAA,EACA,OAAAC,CACJ,EACMC,EAAqBC,GAAYA,EAAU,IAMjD,MAAMC,WAA4BC,CAAc,CAC5C,YAAYC,EAAS,CACjB,MAAMA,CAAO,EAIb,KAAK,SAAW,KAIhB,KAAK,WAAa,KAIlB,KAAK,YAAc,EAInB,KAAK,cAAgB,EAMrB,KAAK,iBAAmB,UAIxB,KAAK,UAAY,KACjB,KAAK,MAAQ,OAKb,KAAK,KAAO,IAAM,CAGd,GAFA,KAAK,SAAS,OAAA,EACd,KAAK,UAAY,GACb,KAAK,QAAU,OACf,OACJ,KAAK,SA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L,KAAK,MAAQ,WACb,KAAM,CAAE,WAAAC,GAAe,KAAK,QAC5BA,GAAcA,EAAA,CAClB,CACA,QAAS,CACD,KAAK,aAAe,MACpB,KAAK,KAAK,KAAK,UAAU,EAE7B,KAAK,SAAA,EACL,KAAK,sBAAA,CACT,CACA,UAAW,CACP,KAAK,MAAQ,OACb,KAAK,WAAA,EACL,KAAK,uBAAA,EACL,KAAK,sBAAA,EACL,KAAK,UAAY,KAAK,WAAa,KACnC,KAAK,SAAS,OAAA,CAClB,CACA,YAAa,CACJ,KAAK,SAEV,KAAK,OAAO,KAAA,EACZ,KAAK,OAAS,OAClB,CACA,OAAOC,EAAM,CACT,YAAK,UAAY,EACV,KAAK,KAAKA,EAAM,EAAI,CAC/B,CACJ","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inertia.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n"],"names":["inertia","keyframes","velocity","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","min","max","restDelta","restSpeed","origin","state","isOutOfBounds","v","nearestBoundary","amplitude","ideal","target","calcDelta","t","calcLatest","applyFriction","delta","latest","timeReachedBoundary","spring$1","checkCatchBoundary","spring","calcGeneratorVelocity","hasUpdatedFrame"],"mappings":"uGAGA,SAASA,EAAQ,CAAE,UAAAC,EAAW,SAAAC,EAAW,EAAK,MAAAC,EAAQ,GAAK,aAAAC,EAAe,IAAK,cAAAC,EAAgB,GAAI,gBAAAC,EAAkB,IAAK,aAAAC,EAAc,IAAAC,EAAK,IAAAC,EAAK,UAAAC,EAAY,GAAK,UAAAC,GAAc,CAC7K,MAAMC,EAASX,EAAU,CAAC,EACpBY,EAAQ,CACV,KAAM,GACN,MAAOD,CACf,EACUE,EAAiBC,GAAOP,IAAQ,QAAaO,EAAIP,GAASC,IAAQ,QAAaM,EAAIN,EACnFO,EAAmBD,GACjBP,IAAQ,OACDC,EACPA,IAAQ,QAEL,KAAK,IAAID,EAAMO,CAAC,EAAI,KAAK,IAAIN,EAAMM,CAAC,EADhCP,EAC0CC,EAEzD,IAAIQ,EAAYd,EAAQD,EACxB,MAAMgB,EAAQN,EAASK,EACjBE,EAASZ,IAAiB,OAAYW,EAAQX,EAAaW,CAAK,EAKlEC,IAAWD,IACXD,EAAYE,EAASP,GACzB,MAAMQ,EAAaC,GAAM,CAACJ,EAAY,KAAK,IAAI,CAACI,EAAIjB,CAAY,EAC1DkB,EAAcD,GAAMF,EAASC,EAAUC,CAAC,EACxCE,EAAiBF,GAAM,CACzB,MAAMG,EAAQJ,EAAUC,CAAC,EACnBI,EAASH,EAAWD,CAAC,EAC3BR,EAAM,KAAO,KAAK,IAAIW,CAAK,GAAKd,EAChCG,EAAM,MAAQA,EAAM,KAAOM,EAASM,
|
|
1
|
+
{"version":3,"file":"inertia.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs"],"sourcesContent":["import { spring } from './spring/index.mjs';\nimport { calcGeneratorVelocity } from './utils/velocity.mjs';\n\nfunction inertia({ keyframes, velocity = 0.0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min, max, restDelta = 0.5, restSpeed, }) {\n const origin = keyframes[0];\n const state = {\n done: false,\n value: origin,\n };\n const isOutOfBounds = (v) => (min !== undefined && v < min) || (max !== undefined && v > max);\n const nearestBoundary = (v) => {\n if (min === undefined)\n return max;\n if (max === undefined)\n return min;\n return Math.abs(min - v) < Math.abs(max - v) ? min : max;\n };\n let amplitude = power * velocity;\n const ideal = origin + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal)\n amplitude = target - origin;\n const calcDelta = (t) => -amplitude * Math.exp(-t / timeConstant);\n const calcLatest = (t) => target + calcDelta(t);\n const applyFriction = (t) => {\n const delta = calcDelta(t);\n const latest = calcLatest(t);\n state.done = Math.abs(delta) <= restDelta;\n state.value = state.done ? target : latest;\n };\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary;\n let spring$1;\n const checkCatchBoundary = (t) => {\n if (!isOutOfBounds(state.value))\n return;\n timeReachedBoundary = t;\n spring$1 = spring({\n keyframes: [state.value, nearestBoundary(state.value)],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n });\n };\n checkCatchBoundary(0);\n return {\n calculatedDuration: null,\n next: (t) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false;\n if (!spring$1 && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true;\n applyFriction(t);\n checkCatchBoundary(t);\n }\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring$1.next(t - timeReachedBoundary);\n }\n else {\n !hasUpdatedFrame && applyFriction(t);\n return state;\n }\n },\n };\n}\n\nexport { inertia };\n"],"names":["inertia","keyframes","velocity","power","timeConstant","bounceDamping","bounceStiffness","modifyTarget","min","max","restDelta","restSpeed","origin","state","isOutOfBounds","v","nearestBoundary","amplitude","ideal","target","calcDelta","t","calcLatest","applyFriction","delta","latest","timeReachedBoundary","spring$1","checkCatchB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C,CACZ,CAAS,EACL,EACA,OAAAiB,EAAmB,CAAC,EACb,CACH,mBAAoB,KACpB,KAAOP,GAAM,CAOT,IAAIU,EAAkB,GAUtB,MATI,CAACJ,GAAYD,IAAwB,SACrCK,EAAkB,GAClBR,EAAcF,CAAC,EACfO,EAAmBP,CAAC,GAMpBK,IAAwB,QAAaL,GAAKK,EACnCC,EAAS,KAAKN,EAAIK,CAAmB,GAG5C,CAACK,GAAmBR,EAAcF,CAAC,EAC5BR,EAEf,CACR,CACA","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs"],"sourcesContent":["import { warning, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n"],"names":["safeMin","findSpring","duration","springDefaults","bounce","velocity","mass","envelope","derivative","dampingRatio","clamp","millisecondsToSeconds","undampedFreq","exponentialDecay","delta","a","b","calcAngularFreq","c","d","e","f","g","initialGuess","approximateRoot","secondsToMilliseconds","stiffness","rootIterations","result"],"mappings":"4NAIA,MAAMA,EAAU,KAChB,SAASC,EAAW,CAAE,SAAAC,EAAWC,EAAe,SAAU,OAAAC,EAASD,EAAe,OAAQ,SAAAE,EAAWF,EAAe,SAAU,KAAAG,EAAOH,EAAe,IAAI,EAAK,CACzJ,IAAII,EACAC,EAEAC,EAAe,EAAIL,EAIvBK,EAAeC,EAAMP,EAAe,WAAYA,EAAe,WAAYM,CAAY,EACvFP,EAAWQ,EAAMP,EAAe,YAAaA,EAAe,YAAaQ,EAAsBT,CAAQ,CAAC,EACpGO,EAAe,GAIfF,EAAYK,GAAiB,CACzB,MAAMC,EAAmBD,EAAeH,EAClCK,EAAQD,EAAmBX,EAC3Ba,EAAIF,EAAmBR,EACvBW,EAAIC,EAAgBL,EAAcH,CAAY,EAC9CS,EAAI,KAAK,IAAI,CAACJ,CAAK,EACzB,OAAOd,EAAWe,EAAIC,EAAKE,
|
|
1
|
+
{"version":3,"file":"find.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs"],"sourcesContent":["import { warning, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { springDefaults } from './defaults.mjs';\n\nconst safeMin = 0.001;\nfunction findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {\n let envelope;\n let derivative;\n warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), \"Spring duration must be 10 seconds or less\");\n let dampingRatio = 1 - bounce;\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);\n duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = secondsToMilliseconds(duration);\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring };\n"],"names":["safeMin","findSpring","duration","springDefaults","bounce","velocity","mass","envelope","derivative","dampingRatio","clamp","millisecondsToSeconds","undampedFreq","exponentialDecay","delta","a","b","calcAngularFreq","c","d","e","f","g","initialGuess","approximateRoot","secondsToMilliseconds","stiffness","rootIterations","result"],"mappings":"4NAIA,MAAMA,EAAU,KAChB,SAASC,EAAW,CAAE,SAAAC,EAAWC,EAAe,SAAU,OAAAC,EAASD,EAAe,OAAQ,SAAAE,EAAWF,EAAe,SAAU,KAAAG,EAAOH,EAAe,IAAI,EAAK,CACzJ,IAAII,EACAC,EAEAC,EAAe,EAAIL,EAIvBK,EAAeC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EAAIN,EAC9C,MAAO,CACH,UAAAoB,EACA,QAASjB,EAAe,EAAI,KAAK,KAAKH,EAAOoB,CAAS,EACtD,SAAAxB,CACZ,CACI,CACJ,CACA,MAAMyB,EAAiB,GACvB,SAASH,EAAgBjB,EAAUC,EAAYe,EAAc,CACzD,IAAIK,EAASL,EACb,QAAS,EAAI,EAAG,EAAII,EAAgB,IAChCC,EAASA,EAASrB,EAASqB,CAAM,EAAIpB,EAAWoB,CAAM,EAE1D,OAAOA,CACX,CACA,SAASX,EAAgBL,EAAcH,EAAc,CACjD,OAAOG,EAAe,KAAK,KAAK,EAAIH,EAAeA,CAAY,CACnE","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs"],"sourcesContent":["import { calcGeneratorDuration, maxGeneratorDuration, generateLinearEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n };\n return generator;\n}\n\nexport { spring };\n"],"names":["durationKeys","physicsKeys","isSpringType","options","keys","key","getSpringOptions","springOptions","springDefaults","visualDuration","root","stiffness","damping","clamp","derived","findSpring","spring","optionsOrVisualDuration","bounce","restSpeed","restDelta","origin","target","state","mass","duration","velocity","isResolvedFromDuration","millisecondsToSeconds","initialVelocity","dampingRatio","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","calcAngularFreq","t","envelope","dampedAngularFreq","freqForT","generator","current","currentVelocity","secondsToMilliseconds","calcGeneratorVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","calculatedDuration","calcGeneratorDuration","maxGeneratorDuration","easing","generateLinearEasing","progress"],"mappings":"olBAOA,MAAMA,EAAe,CAAC,WAAY,QAAQ,EACpCC,EAAc,CAAC,YAAa,UAAW,MAAM,EACnD,SAASC,EAAaC,EAASC,EAAM,CACjC,OAAOA,EAAK,KAAMC,GAAQF,EAAQE,CAAG,IAAM,MAAS,CACxD,CACA,SAASC,EAAiBH,EAAS,CAC/B,IAAII,EAAgB,CAChB,SAAUC,EAAe,SACzB,UAAWA,EAAe,UAC1B,QAASA,EAAe,QACxB,KAAMA,EAAe,KACrB,uBAAwB,GACxB,GAAGL,CACX,EAEI,GAAI,CAACD,EAAaC,EAASF,CAAW,GAClCC,EAAaC,EAASH,CAAY,EAClC,GAAIG,EAAQ,eAAgB,CACxB,MAAMM,EAAiBN,EAAQ,eACzBO,EAAQ,EAAI,KAAK,IAAOD,EAAiB,KACzCE,EAAYD,EAAOA,EACnBE,EAAU,EACZC,EAAM,IAAM,EAAG,GAAKV,EAAQ,QAAU,EAAE,EACxC,KAAK,KAAKQ,CAAS,EACvBJ,EAAgB,CACZ,GAAGA,EACH,KAAMC,EAAe,KACrB,UAAAG,EACA,QAAAC,CAChB,CACA,KACa,CACD,MAAME,EAAUC,EAAWZ,CAAO,EAClCI,EAAgB,CACZ,GAAGA,EACH,GAAGO,EACH,KAAMN,EAAe,IACrC,EACYD,EAAc,uBAAyB,EACnD,CAEI,OAAOA,CACX,CACA,SAASS,EAAOC,EAA0BT,EAAe,eAAgBU,EAASV,EAAe,OAAQ,CACrG,MAAML,EAAU,OAAOc,GAA4B,SAC7C,CAC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F,EAAeA,EAAe,CAAC,EACzFI,EAAiBG,GAAM,CACnB,MAAMC,EAAW,KAAK,IAAI,CAACR,EAAeE,EAAsBK,CAAC,EAE3DG,EAAW,KAAK,IAAID,EAAoBF,EAAG,GAAG,EACpD,OAAQf,EACHgB,IACKT,EACEC,EAAeE,EAAsBD,GACrC,KAAK,KAAKS,CAAQ,EAClBD,EACIR,EACA,KAAK,KAAKS,CAAQ,GAC1BD,CACpB,CACA,CACI,MAAME,EAAY,CACd,mBAAoBd,GAAyBF,GAAY,KACzD,KAAOY,GAAM,CACT,MAAMK,EAAUR,EAAcG,CAAC,EAC/B,GAAKV,EAmBDJ,EAAM,KAAOc,GAAKZ,MAnBO,CACzB,IAAIkB,EAAkB,EAMlBb,EAAe,IACfa,EACIN,IAAM,EACAO,EAAsBf,CAAe,EACrCgB,EAAsBX,EAAeG,EAAGK,CAAO,GAE7D,MAAMI,EAA2B,KAAK,IAAIH,CAAe,GAAKxB,EACxD4B,EAA+B,KAAK,IAAIzB,EAASoB,CAAO,GAAKtB,EACnEG,EAAM,KACFuB,GAA4BC,CAChD,CAIY,OAAAxB,EAAM,MAAQA,EAAM,KAAOD,EAASoB,EAC7BnB,CACnB,EACQ,SAAU,IAAM,CACZ,MAAMyB,EAAqB,KAAK,IAAIC,EAAsBR,CAAS,EAAGS,CAAoB,EACpFC,EAASC,EAAsBC,GAAaZ,EAAU,KAAKO,EAAqBK,CAAQ,EAAE,MAAOL,EAAoB,EAAE,EAC7H,OAAOA,EAAqB,MAAQG,CAChD,CACA,EACI,OAAOV,CACX","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs"],"sourcesContent":["import { calcGeneratorDuration, maxGeneratorDuration, generateLinearEasing } from 'motion-dom';\nimport { millisecondsToSeconds, secondsToMilliseconds } from 'motion-utils';\nimport { clamp } from '../../../utils/clamp.mjs';\nimport { calcGeneratorVelocity } from '../utils/velocity.mjs';\nimport { springDefaults } from './defaults.mjs';\nimport { findSpring, calcAngularFreq } from './find.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n };\n // stiffness/damping/mass overrides duration/bounce\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration;\n const root = (2 * Math.PI) / (visualDuration * 1.2);\n const stiffness = root * root;\n const damping = 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness);\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n };\n }\n else {\n const derived = findSpring(options);\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n };\n springOptions.isResolvedFromDuration = true;\n }\n }\n return springOptions;\n}\nfunction spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {\n const options = typeof optionsOrVisualDuration !== \"object\"\n ? {\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n }\n : optionsOrVisualDuration;\n let { restSpeed, restDelta } = options;\n const origin = options.keyframes[0];\n const target = options.keyframes[options.keyframes.length - 1];\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state = { done: false, value: origin };\n const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n });\n const initialVelocity = velocity || 0.0;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const initialDelta = target - origin;\n const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5;\n restSpeed || (restSpeed = isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default);\n restDelta || (restDelta = isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default);\n let resolveSpring;\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n // Underdamped spring\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t) => target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t);\n }\n else {\n // Overdamped spring\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n let currentVelocity = 0.0;\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current);\n }\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? target : current;\n return state;\n },\n toString: () => {\n const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);\n const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);\n return calculatedDuration + \"ms \" + easing;\n },\n };\n return generator;\n}\n\nexport { spring };\n"],"names":["durationKeys","physicsKeys","isSpringType","options","keys","key","getSpringOptions","springOptions","springDefaults","visualDuration","root","stiffness","damping","clamp","derived","findSpring","spring","optionsOrVisualDuration","bounce","restSpeed","restDelta","origin","target","state","mass","duration","velocity","isResolvedFromDuration","millisecondsToSeconds","initialVelocity","dampingRatio","initialDelta","undampedAngularFreq","isGranularScale","resolveSpring","angularFreq","calcAngularFreq","t","envelope","dampedAngularFreq","freqForT","generator","current","currentVelocity","secondsToMilliseconds","calcGeneratorVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","calculatedDuration","calcGeneratorDuration","maxGeneratorDuration","easing","generateLinearEasing","progress"],"mappings":"olBAOA,MAAMA,EAAe,CAAC,WAAY,QAAQ,EACpCC,EAAc,CAAC,YAAa,UAAW,MAAM,EACnD,SAASC,EAAaC,EAASC,EAAM,CACjC,OAAOA,EAAK,KAAMC,GAAQF,EAAQE,CAAG,IAAM,MAAS,CACxD,CACA,SAASC,EAAiBH,EAAS,CAC/B,IAAII,EAAgB,CAChB,SAAUC,EAAe,SACzB,UAAWA,EAAe,UAC1B,QAASA,EAAe,QACxB,KAAMA,EAAe,KACrB,uBAAwB,GACxB,GAAGL,CACX,EAEI,GAAI,CAACD,EAAaC,EAASF,CAAW,GAClCC,EAAaC,EAASH,C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IA,OAAAxB,EAAM,MAAQA,EAAM,KAAOD,EAASoB,EAC7BnB,CACX,EACA,SAAU,IAAM,CACZ,MAAMyB,EAAqB,KAAK,IAAIC,EAAsBR,CAAS,EAAGS,CAAoB,EACpFC,EAASC,EAAsBC,GAAaZ,EAAU,KAAKO,EAAqBK,CAAQ,EAAE,MAAOL,EAAoB,EAAE,EAC7H,OAAOA,EAAqB,MAAQG,CACxC,CACR,EACI,OAAOV,CACX","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion-value.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { getValueTransition, GroupPlaybackControls } from 'motion-dom';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame } from '../../frameloop/frame.mjs';\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { AcceleratedAnimation } from '../animators/AcceleratedAnimation.mjs';\nimport { MainThreadAnimation } from '../animators/MainThreadAnimation.mjs';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n let options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unqiue transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n options = {\n ...options,\n ...getDefaultTransition(name, options),\n };\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n if (options.duration) {\n options.duration = secondsToMilliseconds(options.duration);\n }\n if (options.repeatDelay) {\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\n }\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (instantAnimationState.current ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n // We still want to return some animation controls here rather\n // than returning undefined\n return new GroupPlaybackControls([]);\n }\n }\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n if (!isHandoff && AcceleratedAnimation.supports(options)) {\n return new AcceleratedAnimation(options);\n }\n else {\n return new MainThreadAnimation(options);\n }\n};\n\nexport { animateMotionValue };\n"],"names":["animateMotionValue","name","value","target","transition","element","isHandoff","onComplete","valueTransition","getValueTransition","delay","elapsed","secondsToMilliseconds","options","v","isTransitionDefined","getDefaultTransition","shouldSkip","finalKeyframe","getFinalKeyframe","frame","GroupPlaybackControls","AcceleratedAnimation","MainThreadAnimation"],"mappings":"4tBAWK,MAACA,EAAqB,CAACC,EAAMC,EAAOC,EAAQC,EAAa,CAAA,EAAIC,EAASC,IAAeC,GAAe,CACrG,MAAMC,EAAkBC,EAAmBL,EAAYH,CAAI,GAAK,CAAA,EAM1DS,EAAQF,EAAgB,OAASJ,EAAW,OAAS,EAK3D,GAAI,CAAE,QAAAO,EAAU,CAAC,EAAKP,EACtBO,EAAUA,EAAUC,EAAsBF,CAAK,EAC/C,IAAIG,EAAU,CACV,UAAW,MAAM,QAAQV,CAAM,EAAIA,EAAS,CAAC,KAAMA,CAAM,EACzD,KAAM,UACN,SAAUD,EAAM,YAAW,EAC3B,GAAGM,EACH,MAAO,CAACG,EACR,SAAWG,GAAM,CACbZ,EAAM,IAAIY,CAAC,EACXN,EAAgB,UAAYA,EAAgB,SAASM,CAAC,
|
|
1
|
+
{"version":3,"file":"motion-value.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs"],"sourcesContent":["import { getValueTransition, GroupPlaybackControls } from 'motion-dom';\nimport { secondsToMilliseconds } from 'motion-utils';\nimport { frame } from '../../frameloop/frame.mjs';\nimport { MotionGlobalConfig } from '../../utils/GlobalConfig.mjs';\nimport { instantAnimationState } from '../../utils/use-instant-transition-state.mjs';\nimport { AcceleratedAnimation } from '../animators/AcceleratedAnimation.mjs';\nimport { MainThreadAnimation } from '../animators/MainThreadAnimation.mjs';\nimport { getFinalKeyframe } from '../animators/waapi/utils/get-final-keyframe.mjs';\nimport { getDefaultTransition } from '../utils/default-transitions.mjs';\nimport { isTransitionDefined } from '../utils/is-transition-defined.mjs';\n\nconst animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {};\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0;\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition;\n elapsed = elapsed - secondsToMilliseconds(delay);\n let options = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v);\n valueTransition.onUpdate && valueTransition.onUpdate(v);\n },\n onComplete: () => {\n onComplete();\n valueTransition.onComplete && valueTransition.onComplete();\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n };\n /**\n * If there's no transition defined for this value, we can generate\n * unqiue transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n options = {\n ...options,\n ...getDefaultTransition(name, options),\n };\n }\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n if (options.duration) {\n options.duration = secondsToMilliseconds(options.duration);\n }\n if (options.repeatDelay) {\n options.repeatDelay = secondsToMilliseconds(options.repeatDelay);\n }\n if (options.from !== undefined) {\n options.keyframes[0] = options.from;\n }\n let shouldSkip = false;\n if (options.type === false ||\n (options.duration === 0 && !options.repeatDelay)) {\n options.duration = 0;\n if (options.delay === 0) {\n shouldSkip = true;\n }\n }\n if (instantAnimationState.current ||\n MotionGlobalConfig.skipAnimations) {\n shouldSkip = true;\n options.duration = 0;\n options.delay = 0;\n }\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate(finalKeyframe);\n options.onComplete();\n });\n // We still want to return some animation controls here rather\n // than returning undefined\n return new GroupPlaybackControls([]);\n }\n }\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n if (!isHandoff && AcceleratedAnimation.supports(options)) {\n return new AcceleratedAnimation(options);\n }\n else {\n return new MainThreadAnimation(options);\n }\n};\n\nexport { animateMotionValue };\n"],"names":["animateMotionValue","name","value","target","transition","element","isHandoff","onComplete","valueTransition","getValueTransition","delay","elapsed","secondsToMilliseconds","options","v","isTransitionDefined","getDefaultTransition","shouldSkip","finalKeyframe","getFinalKeyframe","frame","GroupPlaybackControls","AcceleratedAnimation","MainThreadAnimation"],"mappings":"4tBAWK,MAACA,EAAqB,CAACC,EAAMC,EAAOC,EAAQC,EAAa,CAAA,EAAIC,EAASC,IAAeC,GAAe,CACrG,MAAMC,EAAkBC,EAAmBL,EAAYH,CAAI,GAAK,CAAA,EAM1DS,EAAQF,EAAgB,OAASJ,EAAW,OAAS,EAK3D,GAAI,CAAE,QAAAO,EAAU,CAAC,EAAKP,EACtBO,EAAUA,EAAUC,EAAsBF,CAAK,EAC/C,IAAIG,EAAU,CACV,UAAW,MAAM,QAAQV,CAAM,EAAIA,EAAS,CAAC,KAAMA,CAAM,EACzD,KAAM,UACN,SAAUD,EAAM,YAAW,EAC3B,GAAGM,EACH,MAAO,CAACG,EACR,SAAWG,GAAM,CACbZ,EAAM,IAAIY,CAAC,EACXN,EAAgB,UAAYA,EAAgB,SAASM,CAAC,CAC1D,EACA,WAAY,IAAM,CACdP,EAAU,EACVC,EAAgB,YAAcA,EAAgB,WAAU,CAC5D,EACA,KAAAP,EACA,YAAaC,EACb,QAASI,EAAY,OAAYD,CACzC,EAKSU,EAAoBP,CAAe,IACpCK,EAAU,CACN,GAAGA,EACH,GAAGG,EAAqBf,EAAMY,CAAO,CACjD,GAOQA,EAAQ,WACRA,EAAQ,SAAWD,EAAsBC,EAAQ,QAAQ,GAEzDA,EAAQ,cACRA,EAAQ,YAAcD,EAAsBC,EAAQ,WAAW,GAE/DA,EAAQ,OAAS,SACjBA,EAAQ,UAAU,CAAC,EAAIA,EAAQ,MAEnC,IAAII,EAAa,GAmBjB,IAlBIJ,EAAQ,OAAS,IAChBA,EAAQ,WAAa,GAAK,CAACA,EAAQ,eACpCA,EAAQ,SAAW,EACfA,EAAQ,QAAU,IAClBI,EAAa,KAcjBA,GAAc,CAACX,GAAaJ,EAAM,IAAG,IAAO,OAAW,CACvD,MAAMgB,EAAgBC,EAAiBN,EAAQ,UAAWL,CAAe,EACzE,GAAIU,IAAkB,OAClB,OAAAE,EAAM,OAAO,IAAM,CACfP,EAAQ,SAASK,CAAa,EAC9BL,EAAQ,WAAU,CACtB,CAAC,EAGM,IAAIQ,EAAsB,EAAE,CAE3C,CAMA,MAAI,CAACf,GAAagB,EAAqB,SAAST,CAAO,EAC5C,IAAIS,EAAqBT,CAAO,EAGhC,IAAIU,EAAoBV,CAAO,CAE9C","x_google_ignoreList":[0]}
|
package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-element-target.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition } from 'motion-dom';\nimport { positionalKeys } from '../../render/html/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n var _a;\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n"],"names":["shouldBlockAnimation","protectedKeys","needsAnimating","key","shouldBlock","animateTarget","visualElement","targetAndTransition","delay","transitionOverride","type","_a","transition","transitionEnd","target","animations","animationTypeState","value","valueTarget","valueTransition","getValueTransition","isHandoff","appearId","getOptimisedAppearId","startTime","frame","addValueToWillChange","animateMotionValue","positionalKeys","animation","setTarget"],"mappings":"6fAcA,SAASA,EAAqB,CAAE,cAAAC,EAAe,eAAAC,CAAc,EAAIC,EAAK,CAClE,MAAMC,EAAcH,EAAc,eAAeE,CAAG,GAAKD,EAAeC,CAAG,IAAM,GACjF,OAAAD,EAAeC,CAAG,EAAI,GACfC,CACX,CACA,SAASC,EAAcC,EAAeC,EAAqB,CAAE,MAAAC,EAAQ,EAAG,mBAAAC,EAAoB,KAAAC,CAAI,EAAK,GAAI,CACrG,IAAIC,EACJ,GAAI,CAAE,WAAAC,EAAaN,EAAc,qBAAoB,EAAI,cAAAO,EAAe,GAAGC,CAAM,EAAKP,EAClFE,IACAG,EAAaH,GACjB,MAAMM,EAAa,CAAA,EACbC,EAAqBN,GACvBJ,EAAc,gBACdA,EAAc,eAAe,SAAQ,EAAGI,CAAI,EAChD,UAAWP,KAAOW,EAAQ,CACtB,MAAMG,EAAQX,EAAc,SAASH,GAAMQ,EAAKL,EAAc,aAAaH,CAAG,KAAO,MAAQQ,IAAO,OAASA,EAAK,IAAI,EAChHO,EAAcJ,EAAOX,CAAG,EAC9B,GAAIe,IAAgB,QACfF,GACGhB,EAAqBgB,EAAoBb,CAAG,EAChD,SAEJ,MAAMgB,EAAkB,CACpB,MAAAX,EACA,GAAGY,EAAmBR,GAAc,CAAA,EAAIT,CAAG,CACvD,EAKQ,IAAIkB,EAAY,GAChB,GAAI,OAAO,uBAAwB,CAC/B,MAAMC,EAAWC,EAAqBjB,CAAa,EACnD,GAAIgB,EAAU,CACV,MAAME,EAAY,OAAO,uBAAuBF,EAAUnB,EAAKsB,CAAK,EAChED,IAAc,OACdL,EAAgB,UAAYK,EAC5BH,EAAY,
|
|
1
|
+
{"version":3,"file":"visual-element-target.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs"],"sourcesContent":["import { getValueTransition } from 'motion-dom';\nimport { positionalKeys } from '../../render/html/utils/keys-position.mjs';\nimport { setTarget } from '../../render/utils/setters.mjs';\nimport { addValueToWillChange } from '../../value/use-will-change/add-will-change.mjs';\nimport { getOptimisedAppearId } from '../optimized-appear/get-appear-id.mjs';\nimport { animateMotionValue } from './motion-value.mjs';\nimport { frame } from '../../frameloop/frame.mjs';\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {\n const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;\n needsAnimating[key] = false;\n return shouldBlock;\n}\nfunction animateTarget(visualElement, targetAndTransition, { delay = 0, transitionOverride, type } = {}) {\n var _a;\n let { transition = visualElement.getDefaultTransition(), transitionEnd, ...target } = targetAndTransition;\n if (transitionOverride)\n transition = transitionOverride;\n const animations = [];\n const animationTypeState = type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type];\n for (const key in target) {\n const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null);\n const valueTarget = target[key];\n if (valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))) {\n continue;\n }\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n };\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false;\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement);\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(appearId, key, frame);\n if (startTime !== null) {\n valueTransition.startTime = startTime;\n isHandoff = true;\n }\n }\n }\n addValueToWillChange(visualElement, key);\n value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition, visualElement, isHandoff));\n const animation = value.animation;\n if (animation) {\n animations.push(animation);\n }\n }\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd);\n });\n });\n }\n return animations;\n}\n\nexport { animateTarget };\n"],"names":["shouldBlockAnimation","protectedKeys","needsAnimating","key","shouldBlock","animateTarget","visualElement","targetAndTransition","delay","transitionOverride","type","_a","transition","transitionEnd","target","animations","animationTypeState","value","valueTarget","valueTransition","getValueTransition","isHandoff","appearId","getOptimisedAppearId","startTime","frame","addValueToWillChange","animateMotionValue","positionalKeys","animation","setTarget"],"mappings":"6fAcA,SAASA,EAAqB,CAAE,cAAAC,EAAe,eAAAC,CAAc,EAAIC,EAAK,CAClE,MAAMC,EAAcH,EAAc,eAAeE,CAAG,GAAKD,EAAeC,CAAG,IAAM,GACjF,OAAAD,EAAeC,CAAG,EAAI,GACfC,CACX,CACA,SAASC,EAAcC,EAAeC,EAAqB,CAAE,MAAAC,EAAQ,EAAG,mBAAAC,EAAoB,KAAAC,CAAI,EAAK,GAAI,CACrG,IAAIC,EACJ,GAAI,CAAE,WAAAC,EAAaN,EAAc,qBAAoB,EAAI,cAAAO,EAAe,GAAGC,CAAM,EAAKP,EAClFE,IACAG,EAAaH,GACjB,MAAMM,EAAa,CAAA,EACbC,EAAqBN,GACvBJ,EAAc,gBACdA,EAAc,eAAe,SAAQ,EAAGI,CAAI,EAChD,UAAWP,KAAOW,EAAQ,CACtB,MAAMG,EAAQX,EAAc,SAASH,GAAMQ,EAAKL,EAAc,aAAaH,CAAG,KAAO,MAAQQ,IAAO,OAASA,EAAK,IAAI,EAChHO,EAAcJ,EAAOX,CAAG,EAC9B,GAAIe,IAAgB,QACfF,GACGhB,EAAqBgB,EAAoBb,CAAG,EAChD,SAEJ,MAAMgB,EAAkB,CACpB,MAAAX,EACA,GAAGY,EAAmBR,GAAc,CAAA,EAAIT,CAAG,CACvD,EAKQ,IAAIkB,EAAY,GAChB,GAAI,OAAO,uBAAwB,CAC/B,MAAMC,EAAWC,EAAqBjB,CAAa,EACnD,GAAIgB,EAAU,CACV,MAAME,EAAY,OAAO,uBAAuBF,EAAUnB,EAAKsB,CAAK,EAChED,IAAc,OACdL,EAAgB,UAAYK,EAC5BH,EAAY,GAEpB,CACJ,CACAK,EAAqBpB,EAAeH,CAAG,EACvCc,EAAM,MAAMU,EAAmBxB,EAAKc,EAAOC,EAAaZ,EAAc,oBAAsBsB,EAAe,IAAIzB,CAAG,EAC5G,CAAE,KAAM,EAAK,EACbgB,EAAiBb,EAAee,CAAS,CAAC,EAChD,MAAMQ,EAAYZ,EAAM,UACpBY,GACAd,EAAW,KAAKc,CAAS,CAEjC,CACA,OAAIhB,GACA,QAAQ,IAAIE,CAAU,EAAE,KAAK,IAAM,CAC/BU,EAAM,OAAO,IAAM,CACfZ,GAAiBiB,EAAUxB,EAAeO,CAAa,CAC3D,CAAC,CACL,CAAC,EAEEE,CACX","x_google_ignoreList":[0]}
|
package/dist/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-element-variant.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n var _a;\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n"],"names":["animateVariant","visualElement","variant","options","_a","resolved","resolveVariant","transition","getAnimation","animateTarget","getChildAnimations","forwardDelay","delayChildren","staggerChildren","staggerDirection","animateChildren","when","first","last","animations","maxStaggerDuration","generateStaggerDuration","i","sortByTreeOrder","child","a","b"],"mappings":"2IAGA,SAASA,EAAeC,EAAeC,EAASC,EAAU,CAAA,EAAI,CAC1D,IAAIC,EACJ,MAAMC,EAAWC,EAAeL,EAAeC,EAASC,EAAQ,OAAS,QAClEC,EAAKH,EAAc,mBAAqB,MAAQG,IAAO,OAAS,OAASA,EAAG,OAC7E,MAAS,EACf,GAAI,CAAE,WAAAG,EAAaN,EAAc,qBAAoB,GAAM,CAAA,CAAE,EAAKI,GAAY,CAAA,EAC1EF,EAAQ,qBACRI,EAAaJ,EAAQ,oBAMzB,MAAMK,EAAeH,EACf,IAAM,QAAQ,IAAII,EAAcR,EAAeI,EAAUF,CAAO,CAAC,EACjE,IAAM,QAAQ,QAAO,EAKrBO,EAAqBT,EAAc,iBAAmBA,EAAc,gBAAgB,KACpF,CAACU,EAAe,IAAM,CACpB,KAAM,CAAE,cAAAC,EAAgB,EAAG,gBAAAC,EAAiB,iBAAAC,CAAgB,EAAMP,EAClE,OAAOQ,EAAgBd,EAAeC,EAASU,EAAgBD,EAAcE,EAAiBC,EAAkBX,CAAO,
|
|
1
|
+
{"version":3,"file":"visual-element-variant.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\n\nfunction animateVariant(visualElement, variant, options = {}) {\n var _a;\n const resolved = resolveVariant(visualElement, variant, options.type === \"exit\"\n ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom\n : undefined);\n let { transition = visualElement.getDefaultTransition() || {} } = resolved || {};\n if (options.transitionOverride) {\n transition = options.transitionOverride;\n }\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve();\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const { delayChildren = 0, staggerChildren, staggerDirection, } = transition;\n return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);\n }\n : () => Promise.resolve();\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition;\n if (when) {\n const [first, last] = when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation];\n return first().then(() => last());\n }\n else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)]);\n }\n}\nfunction animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {\n const animations = [];\n const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;\n const generateStaggerDuration = staggerDirection === 1\n ? (i = 0) => i * staggerChildren\n : (i = 0) => maxStaggerDuration - i * staggerChildren;\n Array.from(visualElement.variantChildren)\n .sort(sortByTreeOrder)\n .forEach((child, i) => {\n child.notify(\"AnimationStart\", variant);\n animations.push(animateVariant(child, variant, {\n ...options,\n delay: delayChildren + generateStaggerDuration(i),\n }).then(() => child.notify(\"AnimationComplete\", variant)));\n });\n return Promise.all(animations);\n}\nfunction sortByTreeOrder(a, b) {\n return a.sortNodePosition(b);\n}\n\nexport { animateVariant, sortByTreeOrder };\n"],"names":["animateVariant","visualElement","variant","options","_a","resolved","resolveVariant","transition","getAnimation","animateTarget","getChildAnimations","forwardDelay","delayChildren","staggerChildren","staggerDirection","animateChildren","when","first","last","animations","maxStaggerDuration","generateStaggerDuration","i","sortByTreeOrder","child","a","b"],"mappings":"2IAGA,SAASA,EAAeC,EAAeC,EAASC,EAAU,CAAA,EAAI,CAC1D,IAAIC,EACJ,MAAMC,EAAWC,EAAeL,EAAeC,EAASC,EAAQ,OAAS,QAClEC,EAAKH,EAAc,mBAAqB,MAAQG,IAAO,OAAS,OAASA,EAAG,OAC7E,MAAS,EACf,GAAI,CAAE,WAAAG,EAAaN,EAAc,qBAAoB,GAAM,CAAA,CAAE,EAAKI,GAAY,CAAA,EAC1EF,EAAQ,qBACRI,EAAaJ,EAAQ,oBAMzB,MAAMK,EAAeH,EACf,IAAM,QAAQ,IAAII,EAAcR,EAAeI,EAAUF,CAAO,CAAC,EACjE,IAAM,QAAQ,QAAO,EAKrBO,EAAqBT,EAAc,iBAAmBA,EAAc,gBAAgB,KACpF,CAACU,EAAe,IAAM,CACpB,KAAM,CAAE,cAAAC,EAAgB,EAAG,gBAAAC,EAAiB,iBAAAC,CAAgB,EAAMP,EAClE,OAAOQ,EAAgBd,EAAeC,EAASU,EAAgBD,EAAcE,EAAiBC,EAAkBX,CAAO,CAC3H,EACE,IAAM,QAAQ,QAAO,EAKrB,CAAE,KAAAa,CAAI,EAAKT,EACjB,GAAIS,EAAM,CACN,KAAM,CAACC,EAAOC,CAAI,EAAIF,IAAS,iBACzB,CAACR,EAAcE,CAAkB,EACjC,CAACA,EAAoBF,CAAY,EACvC,OAAOS,EAAK,EAAG,KAAK,IAAMC,EAAI,CAAE,CACpC,KAEI,QAAO,QAAQ,IAAI,CAACV,EAAY,EAAIE,EAAmBP,EAAQ,KAAK,CAAC,CAAC,CAE9E,CACA,SAASY,EAAgBd,EAAeC,EAASU,EAAgB,EAAGC,EAAkB,EAAGC,EAAmB,EAAGX,EAAS,CACpH,MAAMgB,EAAa,CAAA,EACbC,GAAsBnB,EAAc,gBAAgB,KAAO,GAAKY,EAChEQ,EAA0BP,IAAqB,EAC/C,CAACQ,EAAI,IAAMA,EAAIT,EACf,CAACS,EAAI,IAAMF,EAAqBE,EAAIT,EAC1C,aAAM,KAAKZ,EAAc,eAAe,EACnC,KAAKsB,CAAe,EACpB,QAAQ,CAACC,EAAOF,IAAM,CACvBE,EAAM,OAAO,iBAAkBtB,CAAO,EACtCiB,EAAW,KAAKnB,EAAewB,EAAOtB,EAAS,CAC3C,GAAGC,EACH,MAAOS,EAAgBS,EAAwBC,CAAC,CAC5D,CAAS,EAAE,KAAK,IAAME,EAAM,OAAO,oBAAqBtB,CAAO,CAAC,CAAC,CAC7D,CAAC,EACM,QAAQ,IAAIiB,CAAU,CACjC,CACA,SAASI,EAAgBE,EAAGC,EAAG,CAC3B,OAAOD,EAAE,iBAAiBC,CAAC,CAC/B","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-element.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n"],"names":["animateVisualElement","visualElement","definition","options","animation","animations","variant","animateVariant","resolvedDefinition","resolveVariant","animateTarget"],"mappings":"wMAIA,SAASA,EAAqBC,EAAeC,EAAYC,EAAU,CAAA,EAAI,CACnEF,EAAc,OAAO,iBAAkBC,CAAU,EACjD,IAAIE,EACJ,GAAI,MAAM,QAAQF,CAAU,EAAG,CAC3B,MAAMG,EAAaH,EAAW,IAAKI,GAAYC,EAAeN,EAAeK,EAASH,CAAO,CAAC,EAC9FC,EAAY,QAAQ,IAAIC,CAAU,
|
|
1
|
+
{"version":3,"file":"visual-element.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs"],"sourcesContent":["import { resolveVariant } from '../../render/utils/resolve-dynamic-variants.mjs';\nimport { animateTarget } from './visual-element-target.mjs';\nimport { animateVariant } from './visual-element-variant.mjs';\n\nfunction animateVisualElement(visualElement, definition, options = {}) {\n visualElement.notify(\"AnimationStart\", definition);\n let animation;\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) => animateVariant(visualElement, variant, options));\n animation = Promise.all(animations);\n }\n else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options);\n }\n else {\n const resolvedDefinition = typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition;\n animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));\n }\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition);\n });\n}\n\nexport { animateVisualElement };\n"],"names":["animateVisualElement","visualElement","definition","options","animation","animations","variant","animateVariant","resolvedDefinition","resolveVariant","animateTarget"],"mappings":"wMAIA,SAASA,EAAqBC,EAAeC,EAAYC,EAAU,CAAA,EAAI,CACnEF,EAAc,OAAO,iBAAkBC,CAAU,EACjD,IAAIE,EACJ,GAAI,MAAM,QAAQF,CAAU,EAAG,CAC3B,MAAMG,EAAaH,EAAW,IAAKI,GAAYC,EAAeN,EAAeK,EAASH,CAAO,CAAC,EAC9FC,EAAY,QAAQ,IAAIC,CAAU,CACtC,SACS,OAAOH,GAAe,SAC3BE,EAAYG,EAAeN,EAAeC,EAAYC,CAAO,MAE5D,CACD,MAAMK,EAAqB,OAAON,GAAe,WAC3CO,EAAeR,EAAeC,EAAYC,EAAQ,MAAM,EACxDD,EACNE,EAAY,QAAQ,IAAIM,EAAcT,EAAeO,EAAoBL,CAAO,CAAC,CACrF,CACA,OAAOC,EAAU,KAAK,IAAM,CACxBH,EAAc,OAAO,oBAAqBC,CAAU,CACxD,CAAC,CACL","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopChild.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n"],"names":["PopChildMeasure","React","prevProps","element","size","PopChild","children","isPresent","id","useId","ref","useRef","nonce","useContext","MotionConfigContext","useInsertionEffect","width","height","top","left","style","jsx"],"mappings":"6NAUA,MAAMA,UAAwBC,EAAM,SAAU,CAC1C,wBAAwBC,EAAW,CAC/B,MAAMC,EAAU,KAAK,MAAM,SAAS,QACpC,GAAIA,GAAWD,EAAU,WAAa,CAAC,KAAK,MAAM,UAAW,CACzD,MAAME,EAAO,KAAK,MAAM,QAAQ,QAChCA,EAAK,OAASD,EAAQ,cAAgB,EACtCC,EAAK,MAAQD,EAAQ,aAAe,EACpCC,EAAK,IAAMD,EAAQ,UACnBC,EAAK,KAAOD,EAAQ,
|
|
1
|
+
{"version":3,"file":"PopChild.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n"],"names":["PopChildMeasure","React","prevProps","element","size","PopChild","children","isPresent","id","useId","ref","useRef","nonce","useContext","MotionConfigContext","useInsertionEffect","width","height","top","left","style","jsx"],"mappings":"6NAUA,MAAMA,UAAwBC,EAAM,SAAU,CAC1C,wBAAwBC,EAAW,CAC/B,MAAMC,EAAU,KAAK,MAAM,SAAS,QACpC,GAAIA,GAAWD,EAAU,WAAa,CAAC,KAAK,MAAM,UAAW,CACzD,MAAME,EAAO,KAAK,MAAM,QAAQ,QAChCA,EAAK,OAASD,EAAQ,cAAgB,EACtCC,EAAK,MAAQD,EAAQ,aAAe,EACpCC,EAAK,IAAMD,EAAQ,UACnBC,EAAK,KAAOD,EAAQ,UACxB,CACA,OAAO,IACX,CAIA,oBAAqB,CAAE,CACvB,QAAS,CACL,OAAO,KAAK,MAAM,QACtB,CACJ,CACA,SAASE,EAAS,CAAE,SAAAC,EAAU,UAAAC,GAAa,CACvC,MAAMC,EAAKC,EAAK,EACVC,EAAMC,EAAO,IAAI,EACjBP,EAAOO,EAAO,CAChB,MAAO,EACP,OAAQ,EACR,IAAK,EACL,KAAM,CACd,CAAK,EACK,CAAE,MAAAC,CAAK,EAAKC,EAAWC,CAAmB,EAUhD,OAAAC,EAAmB,IAAM,CACrB,KAAM,CAAE,MAAAC,EAAO,OAAAC,EAAQ,IAAAC,EAAK,KAAAC,CAAI,EAAKf,EAAK,QAC1C,GAAIG,GAAa,CAACG,EAAI,SAAW,CAACM,GAAS,CAACC,EACxC,OACJP,EAAI,QAAQ,QAAQ,YAAcF,EAClC,MAAMY,EAAQ,SAAS,cAAc,OAAO,EAC5C,OAAIR,IACAQ,EAAM,MAAQR,GAClB,SAAS,KAAK,YAAYQ,CAAK,EAC3BA,EAAM,OACNA,EAAM,MAAM,WAAW;AAAA,iCACFZ,CAAE;AAAA;AAAA,qBAEdQ,CAAK;AAAA,sBACJC,CAAM;AAAA,mBACTC,CAAG;AAAA,oBACFC,CAAI;AAAA;AAAA,SAEf,EAEM,IAAM,CACT,SAAS,KAAK,YAAYC,CAAK,CACnC,CACJ,EAAG,CAACb,CAAS,CAAC,EACNc,EAAIrB,EAAiB,CAAE,UAAWO,EAAW,SAAUG,EAAK,QAASN,EAAM,SAAUH,EAAM,aAAaK,EAAU,CAAE,IAAAI,CAAG,CAAE,EAAG,CACxI","x_google_ignoreList":[0]}
|
package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceChild.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useCallback, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const memoizedOnExitComplete = useCallback((childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n }, [presenceChildren, onExitComplete]);\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: memoizedOnExitComplete,\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout\n ? [Math.random(), memoizedOnExitComplete]\n : [isPresent, memoizedOnExitComplete]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = jsx(PopChild, { isPresent: isPresent, children: children });\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n"],"names":["PresenceChild","children","initial","isPresent","onExitComplete","custom","presenceAffectsLayout","mode","presenceChildren","useConstant","newChildrenMap","id","useId","memoizedOnExitComplete","useCallback","childId","isComplete","context","useMemo","_","key","React","jsx","PopChild","PresenceContext"],"mappings":"kSAQK,MAACA,EAAgB,CAAC,CAAE,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,eAAAC,EAAgB,OAAAC,EAAQ,sBAAAC,EAAuB,KAAAC,KAAY,CAC9G,MAAMC,EAAmBC,EAAYC,CAAc,EAC7CC,EAAKC,EAAK,EACVC,EAAyBC,EAAaC,GAAY,CACpDP,EAAiB,IAAIO,EAAS,EAAI,EAClC,UAAWC,KAAcR,EAAiB,SACtC,GAAI,CAACQ,EACD,OAERZ,GAAkBA,EAAc,
|
|
1
|
+
{"version":3,"file":"PresenceChild.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs"],"sourcesContent":["\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useCallback, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const memoizedOnExitComplete = useCallback((childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n }, [presenceChildren, onExitComplete]);\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: memoizedOnExitComplete,\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout\n ? [Math.random(), memoizedOnExitComplete]\n : [isPresent, memoizedOnExitComplete]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = jsx(PopChild, { isPresent: isPresent, children: children });\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n"],"names":["PresenceChild","children","initial","isPresent","onExitComplete","custom","presenceAffectsLayout","mode","presenceChildren","useConstant","newChildrenMap","id","useId","memoizedOnExitComplete","useCallback","childId","isComplete","context","useMemo","_","key","React","jsx","PopChild","PresenceContext"],"mappings":"kSAQK,MAACA,EAAgB,CAAC,CAAE,SAAAC,EAAU,QAAAC,EAAS,UAAAC,EAAW,eAAAC,EAAgB,OAAAC,EAAQ,sBAAAC,EAAuB,KAAAC,KAAY,CAC9G,MAAMC,EAAmBC,EAAYC,CAAc,EAC7CC,EAAKC,EAAK,EACVC,EAAyBC,EAAaC,GAAY,CACpDP,EAAiB,IAAIO,EAAS,EAAI,EAClC,UAAWC,KAAcR,EAAiB,SACtC,GAAI,CAACQ,EACD,OAERZ,GAAkBA,EAAc,CACpC,EAAG,CAACI,EAAkBJ,CAAc,CAAC,EAC/Ba,EAAUC,EAAQ,KAAO,CAC3B,GAAAP,EACA,QAAAT,EACA,UAAAC,EACA,OAAAE,EACA,eAAgBQ,EAChB,SAAWE,IACPP,EAAiB,IAAIO,EAAS,EAAK,EAC5B,IAAMP,EAAiB,OAAOO,CAAO,EAExD,GAMIT,EACM,CAAC,KAAK,OAAM,EAAIO,CAAsB,EACtC,CAACV,EAAWU,CAAsB,CAAC,EACzC,OAAAK,EAAQ,IAAM,CACVV,EAAiB,QAAQ,CAACW,EAAGC,IAAQZ,EAAiB,IAAIY,EAAK,EAAK,CAAC,CACzE,EAAG,CAACjB,CAAS,CAAC,EAKdkB,EAAM,UAAU,IAAM,CAClB,CAAClB,GACG,CAACK,EAAiB,MAClBJ,GACAA,EAAc,CACtB,EAAG,CAACD,CAAS,CAAC,EACVI,IAAS,cACTN,EAAWqB,EAAIC,EAAU,CAAE,UAAWpB,EAAW,SAAUF,EAAU,GAEjEqB,EAAIE,EAAgB,SAAU,CAAE,MAAOP,EAAS,SAAUhB,EAAU,CAChF,EACA,SAASS,GAAiB,CACtB,OAAO,IAAI,GACf","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender === null || forceRender === void 0 ? void 0 : forceRender();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n"],"names":["AnimatePresence","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","isParentPresent","safeToRemove","usePresence","presentChildren","useMemo","onlyElements","presentKeys","getChildKey","isInitialRender","useRef","pendingPresentChildren","exitComplete","useConstant","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","useIsomorphicLayoutEffect","i","key","exitingChildren","nextChildren","child","forceRender","useContext","LayoutGroupContext","jsx","Fragment","isPresent","onExit","isEveryExitComplete","isExitComplete","PresenceChild"],"mappings":"kfA2CA,MAAMA,EAAkB,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAQ,QAAAC,EAAU,GAAM,eAAAC,EAAgB,sBAAAC,EAAwB,GAAM,KAAAC,EAAO,OAAQ,UAAAC,EAAY,MAAa,CAC/I,KAAM,CAACC,EAAiBC,CAAY,EAAIC,EAAYH,CAAS,EAKvDI,EAAkBC,EAAQ,IAAMC,EAAaZ,CAAQ,EAAG,CAACA,CAAQ,CAAC,EAKlEa,EAAcP,GAAa,CAACC,EAAkB,CAAA,EAAKG,EAAgB,IAAII,CAAW,EAIlFC,EAAkBC,EAAO,EAAI,EAM7BC,EAAyBD,EAAON,CAAe,EAI/CQ,EAAeC,EAAY,IAAM,IAAI,GAAK,EAK1C,CAACC,EAAgBC,CAAiB,EAAIC,EAASZ,CAAe,EAC9D,CAACa,EAAkBC,CAAmB,EAAIF,EAASZ,CAAe,EACxEe,EAA0B,IAAM,CAC5BV,EAAgB,QAAU,GAC1BE,EAAuB,QAAUP,EAIjC,QAASgB,EAAI,EAAGA,EAAIH,EAAiB,OAAQG,IAAK,CAC9C,MAAMC,EAAMb,EAAYS,EAAiBG,CAAC,CAAC,EACtCb,EAAY,SAASc,CAAG,EAMzBT,EAAa,OAAOS,CAAG,EALnBT,EAAa,IAAIS,CAAG,IAAM,IAC1BT,EAAa,IAAIS,EAAK,EAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs"],"sourcesContent":["\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender === null || forceRender === void 0 ? void 0 : forceRender();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n"],"names":["AnimatePresence","children","custom","initial","onExitComplete","presenceAffectsLayout","mode","propagate","isParentPresent","safeToRemove","usePresence","presentChildren","useMemo","onlyElements","presentKeys","getChildKey","isInitialRender","useRef","pendingPresentChildren","exitComplete","useConstant","diffedChildren","setDiffedChildren","useState","renderedChildren","setRenderedChildren","useIsomorphicLayoutEffect","i","key","exitingChildren","nextChildren","child","forceRender","useContext","LayoutGroupContext","jsx","Fragment","isPresent","onExit","isEveryExitComplete","isExitComplete","PresenceChild"],"mappings":"kfA2CA,MAAMA,EAAkB,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAQ,QAAAC,EAAU,GAAM,eAAAC,EAAgB,sBAAAC,EAAwB,GAAM,KAAAC,EAAO,OAAQ,UAAAC,EAAY,MAAa,CAC/I,KAAM,CAACC,EAAiBC,CAAY,EAAIC,EAAYH,CAAS,EAKvDI,EAAkBC,EAAQ,IAAMC,EAAaZ,CAAQ,EAAG,CAACA,CAAQ,CAAC,EAKlEa,EAAcP,GAAa,CAACC,EAAkB,CAAA,EAA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