@code0-tech/pictor 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +3 -12
- package/dist/assets/Button.style.css +1 -1
- package/dist/assets/ContextMenu.style.css +1 -1
- package/dist/assets/DateInput.style.css +1 -1
- package/dist/assets/Editor.styles.css +1 -1
- package/dist/assets/Input.style.css +1 -1
- package/dist/assets/InputWrapper.style.css +1 -1
- package/dist/assets/Menu.style.css +1 -1
- package/dist/assets/SegmentedControl.style.css +1 -1
- package/dist/assets/SelectInput.style.css +1 -1
- package/dist/components/alert/Alert.js +19 -20
- package/dist/components/aurora/Aurora.js +15 -16
- package/dist/components/avatar/Avatar.js +44 -44
- package/dist/components/badge/Badge.js +36 -37
- package/dist/components/button/Button.js +16 -16
- package/dist/components/button-group/ButtonGroup.js +15 -16
- package/dist/components/card/Card.js +21 -22
- package/dist/components/card/CardSection.js +15 -15
- package/dist/components/chart/Chart.js +82 -82
- package/dist/components/chart/LineChart.js +50 -51
- package/dist/components/col/Col.js +9 -10
- package/dist/components/command/Command.js +32 -33
- package/dist/components/container/Container.js +9 -10
- package/dist/components/context-menu/ContextMenu.js +76 -77
- package/dist/components/data-table/DataTableColumn.js +9 -10
- package/dist/components/data-table/DataTableFilterInput.js +83 -83
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +26 -27
- package/dist/components/data-table/DataTableHeader.js +20 -21
- package/dist/components/data-table/DataTablePagination.js +27 -28
- package/dist/components/dialog/Dialog.js +61 -62
- package/dist/components/file-tabs/FileTabs.js +51 -52
- package/dist/components/flex/Flex.js +9 -10
- package/dist/components/form/CheckboxInput.js +50 -51
- package/dist/components/form/ColorInput.js +242 -242
- package/dist/components/form/DateInput.js +55 -55
- package/dist/components/form/EditorInput.d.ts +7 -0
- package/dist/components/form/EditorInput.js +278 -273
- package/dist/components/form/FileInput.js +67 -68
- package/dist/components/form/InputDescription.js +3 -4
- package/dist/components/form/InputLabel.js +9 -10
- package/dist/components/form/InputMessage.js +6 -7
- package/dist/components/form/InputWrapper.js +37 -38
- package/dist/components/form/PasswordInput.js +2 -2
- package/dist/components/form/PinInput.js +30 -31
- package/dist/components/form/RadioGroup.js +22 -23
- package/dist/components/form/RadioInput.js +19 -20
- package/dist/components/form/SelectInput.js +55 -56
- package/dist/components/form/TagInput.js +46 -45
- package/dist/components/fullscreen/FullScreen.js +14 -15
- package/dist/components/gantt/Gantt.js +63 -64
- package/dist/components/gantt/GanttGroup.js +2 -2
- package/dist/components/gantt/GanttHeader.js +40 -41
- package/dist/components/gantt/GanttItem.js +11 -12
- package/dist/components/icon/Icon.js +22 -22
- package/dist/components/json-view/JsonView.js +37 -38
- package/dist/components/layout/Layout.js +64 -65
- package/dist/components/menu/Menu.js +91 -92
- package/dist/components/quote/Quote.js +29 -30
- package/dist/components/resizable/Resizable.js +22 -23
- package/dist/components/row/Row.js +9 -10
- package/dist/components/scroll-area/ScrollArea.js +46 -47
- package/dist/components/segmented-control/SegmentedControl.js +35 -35
- package/dist/components/spacing/Spacing.js +8 -9
- package/dist/components/tab/Tab.js +53 -53
- package/dist/components/text/Text.js +9 -10
- package/dist/components/toast/Toast.js +47 -47
- package/dist/components/tooltip/Tooltip.js +35 -36
- package/dist/node_modules/@lezer/common/dist/index.js +4 -4
- package/dist/utils/contextStore.js +31 -32
- package/dist/utils/motion.js +39 -40
- package/package.json +8 -8
- package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -51
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -58
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -256
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -20
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -57
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -25
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -136
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -37
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -49
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -68
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -56
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -48
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -5
- package/dist/node_modules/motion/dist/es/react.js +0 -196
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -105
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -127
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -82
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +0 -164
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -43
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -54
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -24
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -59
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -65
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -33
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -41
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -580
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -49
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -201
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -54
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -133
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +0 -35
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -50
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -90
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -50
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -62
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/array.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -16
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -29
- package/dist/node_modules/motion-utils/dist/es/errors.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/memo.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/noop.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/progress.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -24
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -6
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +0 -21
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +0 -18
- package/dist/node_modules/react/compiler-runtime.js +0 -8
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { invariant } from "../../../../../motion-utils/dist/es/errors.js";
|
|
2
|
-
import { frame } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
3
|
-
import { percent } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
|
|
4
|
-
import { mixNumber } from "../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
5
|
-
import { animateMotionValue } from "../../../../../motion-dom/dist/es/animation/interfaces/motion-value.js";
|
|
6
|
-
import { addValueToWillChange } from "../../../../../motion-dom/dist/es/value/will-change/add-will-change.js";
|
|
7
|
-
import { setDragLock } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
|
|
8
|
-
import { isElementTextInput } from "../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js";
|
|
9
|
-
import { resize } from "../../../../../motion-dom/dist/es/resize/index.js";
|
|
10
|
-
import { createBox } from "../../../../../motion-dom/dist/es/projection/geometry/models.js";
|
|
11
|
-
import { convertBoundingBoxToBox, convertBoxToBoundingBox } from "../../../../../motion-dom/dist/es/projection/geometry/conversion.js";
|
|
12
|
-
import { measurePageBox } from "../../../../../motion-dom/dist/es/projection/utils/measure.js";
|
|
13
|
-
import { calcLength } from "../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
14
|
-
import { eachAxis } from "../../../../../motion-dom/dist/es/projection/utils/each-axis.js";
|
|
15
|
-
import { addDomEvent } from "../../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
16
|
-
import { isRefObject } from "../../utils/is-ref-object.js";
|
|
17
|
-
import { extractEventInfo } from "../../events/event-info.js";
|
|
18
|
-
import { addPointerEvent } from "../../events/add-pointer-event.js";
|
|
19
|
-
import { getContextWindow } from "../../utils/get-context-window.js";
|
|
20
|
-
import { PanSession } from "../pan/PanSession.js";
|
|
21
|
-
import { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic } from "./utils/constraints.js";
|
|
22
|
-
var elementDragControls = /* @__PURE__ */ new WeakMap(), VisualElementDragControls = class {
|
|
23
|
-
constructor(i) {
|
|
24
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = {
|
|
25
|
-
x: 0,
|
|
26
|
-
y: 0
|
|
27
|
-
}, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = createBox(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = i;
|
|
28
|
-
}
|
|
29
|
-
start(i, { snapToCursor: C = !1, distanceThreshold: w } = {}) {
|
|
30
|
-
let { presenceContext: D } = this.visualElement;
|
|
31
|
-
if (D && D.isPresent === !1) return;
|
|
32
|
-
let O = (i) => {
|
|
33
|
-
C && this.snapToCursor(extractEventInfo(i).point), this.stopAnimation();
|
|
34
|
-
}, k = (i, C) => {
|
|
35
|
-
let { drag: w, dragPropagation: D, onDragStart: O } = this.getProps();
|
|
36
|
-
if (w && !D && (this.openDragLock && this.openDragLock(), this.openDragLock = setDragLock(w), !this.openDragLock)) return;
|
|
37
|
-
this.latestPointerEvent = i, this.latestPanInfo = C, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), eachAxis((i) => {
|
|
38
|
-
let x = this.getAxisMotionValue(i).get() || 0;
|
|
39
|
-
if (percent.test(x)) {
|
|
40
|
-
let { projection: S } = this.visualElement;
|
|
41
|
-
if (S && S.layout) {
|
|
42
|
-
let C = S.layout.layoutBox[i];
|
|
43
|
-
C && (x = calcLength(C) * (parseFloat(x) / 100));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
this.originPoint[i] = x;
|
|
47
|
-
}), O && frame.update(() => O(i, C), !1, !0), addValueToWillChange(this.visualElement, "transform");
|
|
48
|
-
let { animationState: k } = this.visualElement;
|
|
49
|
-
k && k.setActive("whileDrag", !0);
|
|
50
|
-
}, A = (i, S) => {
|
|
51
|
-
this.latestPointerEvent = i, this.latestPanInfo = S;
|
|
52
|
-
let { dragPropagation: C, dragDirectionLock: w, onDirectionLock: T, onDrag: E } = this.getProps();
|
|
53
|
-
if (!C && !this.openDragLock) return;
|
|
54
|
-
let { offset: D } = S;
|
|
55
|
-
if (w && this.currentDirection === null) {
|
|
56
|
-
this.currentDirection = getCurrentDirection(D), this.currentDirection !== null && T && T(this.currentDirection);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
this.updateAxis("x", S.point, D), this.updateAxis("y", S.point, D), this.visualElement.render(), E && frame.update(() => E(i, S), !1, !0);
|
|
60
|
-
}, j = (i, x) => {
|
|
61
|
-
this.latestPointerEvent = i, this.latestPanInfo = x, this.stop(i, x), this.latestPointerEvent = null, this.latestPanInfo = null;
|
|
62
|
-
}, M = () => {
|
|
63
|
-
let { dragSnapToOrigin: i } = this.getProps();
|
|
64
|
-
(i || this.constraints) && this.startAnimation({
|
|
65
|
-
x: 0,
|
|
66
|
-
y: 0
|
|
67
|
-
});
|
|
68
|
-
}, { dragSnapToOrigin: N } = this.getProps();
|
|
69
|
-
this.panSession = new PanSession(i, {
|
|
70
|
-
onSessionStart: O,
|
|
71
|
-
onStart: k,
|
|
72
|
-
onMove: A,
|
|
73
|
-
onSessionEnd: j,
|
|
74
|
-
resumeAnimation: M
|
|
75
|
-
}, {
|
|
76
|
-
transformPagePoint: this.visualElement.getTransformPagePoint(),
|
|
77
|
-
dragSnapToOrigin: N,
|
|
78
|
-
distanceThreshold: w,
|
|
79
|
-
contextWindow: getContextWindow(this.visualElement),
|
|
80
|
-
element: this.visualElement.current
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
stop(i, S) {
|
|
84
|
-
let C = i || this.latestPointerEvent, w = S || this.latestPanInfo, T = this.isDragging;
|
|
85
|
-
if (this.cancel(), !T || !w || !C) return;
|
|
86
|
-
let { velocity: E } = w;
|
|
87
|
-
this.startAnimation(E);
|
|
88
|
-
let { onDragEnd: D } = this.getProps();
|
|
89
|
-
D && frame.postRender(() => D(C, w));
|
|
90
|
-
}
|
|
91
|
-
cancel() {
|
|
92
|
-
this.isDragging = !1;
|
|
93
|
-
let { projection: i, animationState: x } = this.visualElement;
|
|
94
|
-
i && (i.isAnimationBlocked = !1), this.endPanSession();
|
|
95
|
-
let { dragPropagation: S } = this.getProps();
|
|
96
|
-
!S && this.openDragLock && (this.openDragLock(), this.openDragLock = null), x && x.setActive("whileDrag", !1);
|
|
97
|
-
}
|
|
98
|
-
endPanSession() {
|
|
99
|
-
this.panSession && this.panSession.end(), this.panSession = void 0;
|
|
100
|
-
}
|
|
101
|
-
updateAxis(i, x, S) {
|
|
102
|
-
let { drag: C } = this.getProps();
|
|
103
|
-
if (!S || !shouldDrag(i, C, this.currentDirection)) return;
|
|
104
|
-
let w = this.getAxisMotionValue(i), T = this.originPoint[i] + S[i];
|
|
105
|
-
this.constraints && this.constraints[i] && (T = applyConstraints(T, this.constraints[i], this.elastic[i])), w.set(T);
|
|
106
|
-
}
|
|
107
|
-
resolveConstraints() {
|
|
108
|
-
let { dragConstraints: i, dragElastic: x } = this.getProps(), S = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : this.visualElement.projection?.layout, C = this.constraints;
|
|
109
|
-
i && isRefObject(i) ? this.constraints ||= this.resolveRefConstraints() : i && S ? this.constraints = calcRelativeConstraints(S.layoutBox, i) : this.constraints = !1, this.elastic = resolveDragElastic(x), C !== this.constraints && !isRefObject(i) && S && this.constraints && !this.hasMutatedConstraints && eachAxis((i) => {
|
|
110
|
-
this.constraints !== !1 && this.getAxisMotionValue(i) && (this.constraints[i] = rebaseAxisConstraints(S.layoutBox[i], this.constraints[i]));
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
resolveRefConstraints() {
|
|
114
|
-
let { dragConstraints: x, onMeasureDragConstraints: S } = this.getProps();
|
|
115
|
-
if (!x || !isRefObject(x)) return !1;
|
|
116
|
-
let C = x.current;
|
|
117
|
-
invariant(C !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
|
|
118
|
-
let { projection: w } = this.visualElement;
|
|
119
|
-
if (!w || !w.layout) return !1;
|
|
120
|
-
w.root && (w.root.scroll = void 0, w.root.updateScroll());
|
|
121
|
-
let T = measurePageBox(C, w.root, this.visualElement.getTransformPagePoint()), E = calcViewportConstraints(w.layout.layoutBox, T);
|
|
122
|
-
if (S) {
|
|
123
|
-
let i = S(convertBoxToBoundingBox(E));
|
|
124
|
-
this.hasMutatedConstraints = !!i, i && (E = convertBoundingBoxToBox(i));
|
|
125
|
-
}
|
|
126
|
-
return E;
|
|
127
|
-
}
|
|
128
|
-
startAnimation(i) {
|
|
129
|
-
let { drag: x, dragMomentum: S, dragElastic: C, dragTransition: w, dragSnapToOrigin: T, onDragTransitionEnd: E } = this.getProps(), D = this.constraints || {}, O = eachAxis((E) => {
|
|
130
|
-
if (!shouldDrag(E, x, this.currentDirection)) return;
|
|
131
|
-
let O = D && D[E] || {};
|
|
132
|
-
(T === !0 || T === E) && (O = {
|
|
133
|
-
min: 0,
|
|
134
|
-
max: 0
|
|
135
|
-
});
|
|
136
|
-
let k = C ? 200 : 1e6, A = C ? 40 : 1e7, j = {
|
|
137
|
-
type: "inertia",
|
|
138
|
-
velocity: S ? i[E] : 0,
|
|
139
|
-
bounceStiffness: k,
|
|
140
|
-
bounceDamping: A,
|
|
141
|
-
timeConstant: 750,
|
|
142
|
-
restDelta: 1,
|
|
143
|
-
restSpeed: 10,
|
|
144
|
-
...w,
|
|
145
|
-
...O
|
|
146
|
-
};
|
|
147
|
-
return this.startAxisValueAnimation(E, j);
|
|
148
|
-
});
|
|
149
|
-
return Promise.all(O).then(E);
|
|
150
|
-
}
|
|
151
|
-
startAxisValueAnimation(i, x) {
|
|
152
|
-
let S = this.getAxisMotionValue(i);
|
|
153
|
-
return addValueToWillChange(this.visualElement, i), S.start(animateMotionValue(i, S, 0, x, this.visualElement, !1));
|
|
154
|
-
}
|
|
155
|
-
stopAnimation() {
|
|
156
|
-
eachAxis((i) => this.getAxisMotionValue(i).stop());
|
|
157
|
-
}
|
|
158
|
-
getAxisMotionValue(i) {
|
|
159
|
-
let x = `_drag${i.toUpperCase()}`;
|
|
160
|
-
return this.visualElement.getProps()[x] || this.visualElement.getValue(i, this.visualElement.latestValues[i] ?? 0);
|
|
161
|
-
}
|
|
162
|
-
snapToCursor(i) {
|
|
163
|
-
eachAxis((x) => {
|
|
164
|
-
let { drag: S } = this.getProps();
|
|
165
|
-
if (!shouldDrag(x, S, this.currentDirection)) return;
|
|
166
|
-
let { projection: w } = this.visualElement, T = this.getAxisMotionValue(x);
|
|
167
|
-
if (w && w.layout) {
|
|
168
|
-
let { min: S, max: E } = w.layout.layoutBox[x], D = T.get() || 0;
|
|
169
|
-
T.set(i[x] - mixNumber(S, E, .5) + D);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
scalePositionWithinConstraints() {
|
|
174
|
-
if (!this.visualElement.current) return;
|
|
175
|
-
let { drag: i, dragConstraints: x } = this.getProps(), { projection: S } = this.visualElement;
|
|
176
|
-
if (!isRefObject(x) || !S || !this.constraints) return;
|
|
177
|
-
this.stopAnimation();
|
|
178
|
-
let w = {
|
|
179
|
-
x: 0,
|
|
180
|
-
y: 0
|
|
181
|
-
};
|
|
182
|
-
eachAxis((i) => {
|
|
183
|
-
let x = this.getAxisMotionValue(i);
|
|
184
|
-
if (x && this.constraints !== !1) {
|
|
185
|
-
let S = x.get();
|
|
186
|
-
w[i] = calcOrigin({
|
|
187
|
-
min: S,
|
|
188
|
-
max: S
|
|
189
|
-
}, this.constraints[i]);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
let { transformTemplate: T } = this.visualElement.getProps();
|
|
193
|
-
this.visualElement.current.style.transform = T ? T({}, "") : "none", S.root && S.root.updateScroll(), S.updateLayout(), this.constraints = !1, this.resolveConstraints(), eachAxis((x) => {
|
|
194
|
-
if (!shouldDrag(x, i, null)) return;
|
|
195
|
-
let S = this.getAxisMotionValue(x), { min: T, max: E } = this.constraints[x];
|
|
196
|
-
S.set(mixNumber(T, E, w[x]));
|
|
197
|
-
}), this.visualElement.render();
|
|
198
|
-
}
|
|
199
|
-
addListeners() {
|
|
200
|
-
if (!this.visualElement.current) return;
|
|
201
|
-
elementDragControls.set(this.visualElement, this);
|
|
202
|
-
let i = this.visualElement.current, S = addPointerEvent(i, "pointerdown", (x) => {
|
|
203
|
-
let { drag: S, dragListener: C = !0 } = this.getProps(), w = x.target, T = w !== i && isElementTextInput(w);
|
|
204
|
-
S && C && !T && this.start(x);
|
|
205
|
-
}), C, w = () => {
|
|
206
|
-
let { dragConstraints: x } = this.getProps();
|
|
207
|
-
isRefObject(x) && x.current && (this.constraints = this.resolveRefConstraints(), C ||= startResizeObservers(i, x.current, () => this.scalePositionWithinConstraints()));
|
|
208
|
-
}, { projection: T } = this.visualElement, E = T.addEventListener("measure", w);
|
|
209
|
-
T && !T.layout && (T.root && T.root.updateScroll(), T.updateLayout()), frame.read(w);
|
|
210
|
-
let O = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()), k = T.addEventListener("didUpdate", (({ delta: i, hasLayoutChanged: x }) => {
|
|
211
|
-
this.isDragging && x && (eachAxis((x) => {
|
|
212
|
-
let S = this.getAxisMotionValue(x);
|
|
213
|
-
S && (this.originPoint[x] += i[x].translate, S.set(S.get() + i[x].translate));
|
|
214
|
-
}), this.visualElement.render());
|
|
215
|
-
}));
|
|
216
|
-
return () => {
|
|
217
|
-
O(), S(), E(), k && k(), C && C();
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
getProps() {
|
|
221
|
-
let i = this.visualElement.getProps(), { drag: x = !1, dragDirectionLock: S = !1, dragPropagation: C = !1, dragConstraints: w = !1, dragElastic: T = defaultElastic, dragMomentum: E = !0 } = i;
|
|
222
|
-
return {
|
|
223
|
-
...i,
|
|
224
|
-
drag: x,
|
|
225
|
-
dragDirectionLock: S,
|
|
226
|
-
dragPropagation: C,
|
|
227
|
-
dragConstraints: w,
|
|
228
|
-
dragElastic: T,
|
|
229
|
-
dragMomentum: E
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
function skipFirstCall(i) {
|
|
234
|
-
let x = !0;
|
|
235
|
-
return () => {
|
|
236
|
-
if (x) {
|
|
237
|
-
x = !1;
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
i();
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
function startResizeObservers(i, x, S) {
|
|
244
|
-
let C = resize(i, skipFirstCall(S)), w = resize(x, skipFirstCall(S));
|
|
245
|
-
return () => {
|
|
246
|
-
C(), w();
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
function shouldDrag(i, x, S) {
|
|
250
|
-
return (x === !0 || x === i) && (S === null || S === i);
|
|
251
|
-
}
|
|
252
|
-
function getCurrentDirection(i, x = 10) {
|
|
253
|
-
let S = null;
|
|
254
|
-
return Math.abs(i.y) > x ? S = "y" : Math.abs(i.x) > x && (S = "x"), S;
|
|
255
|
-
}
|
|
256
|
-
export { VisualElementDragControls };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { noop } from "../../../../../motion-utils/dist/es/noop.js";
|
|
2
|
-
import { Feature } from "../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
-
import { VisualElementDragControls } from "./VisualElementDragControls.js";
|
|
4
|
-
var DragGesture = class extends Feature {
|
|
5
|
-
constructor(r) {
|
|
6
|
-
super(r), this.removeGroupControls = noop, this.removeListeners = noop, this.controls = new VisualElementDragControls(r);
|
|
7
|
-
}
|
|
8
|
-
mount() {
|
|
9
|
-
let { dragControls: r } = this.node.getProps();
|
|
10
|
-
r && (this.removeGroupControls = r.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || noop;
|
|
11
|
-
}
|
|
12
|
-
update() {
|
|
13
|
-
let { dragControls: e } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
|
|
14
|
-
e !== r && (this.removeGroupControls(), e && (this.removeGroupControls = e.subscribe(this.controls)));
|
|
15
|
-
}
|
|
16
|
-
unmount() {
|
|
17
|
-
this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export { DragGesture };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { clamp } from "../../../../../../motion-utils/dist/es/clamp.js";
|
|
2
|
-
import { progress } from "../../../../../../motion-utils/dist/es/progress.js";
|
|
3
|
-
import { mixNumber } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
|
|
4
|
-
import { calcLength } from "../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
|
|
5
|
-
function applyConstraints(e, { min: c, max: u }, d) {
|
|
6
|
-
return c !== void 0 && e < c ? e = d ? mixNumber(c, e, d.min) : Math.max(e, c) : u !== void 0 && e > u && (e = d ? mixNumber(u, e, d.max) : Math.min(e, u)), e;
|
|
7
|
-
}
|
|
8
|
-
function calcRelativeAxisConstraints(e, c, l) {
|
|
9
|
-
return {
|
|
10
|
-
min: c === void 0 ? void 0 : e.min + c,
|
|
11
|
-
max: l === void 0 ? void 0 : e.max + l - (e.max - e.min)
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function calcRelativeConstraints(e, { top: c, left: l, bottom: u, right: d }) {
|
|
15
|
-
return {
|
|
16
|
-
x: calcRelativeAxisConstraints(e.x, l, d),
|
|
17
|
-
y: calcRelativeAxisConstraints(e.y, c, u)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function calcViewportAxisConstraints(e, c) {
|
|
21
|
-
let l = c.min - e.min, u = c.max - e.max;
|
|
22
|
-
return c.max - c.min < e.max - e.min && ([l, u] = [u, l]), {
|
|
23
|
-
min: l,
|
|
24
|
-
max: u
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function calcViewportConstraints(e, c) {
|
|
28
|
-
return {
|
|
29
|
-
x: calcViewportAxisConstraints(e.x, c.x),
|
|
30
|
-
y: calcViewportAxisConstraints(e.y, c.y)
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function calcOrigin(l, d) {
|
|
34
|
-
let f = .5, p = calcLength(l), m = calcLength(d);
|
|
35
|
-
return m > p ? f = progress(d.min, d.max - p, l.min) : p > m && (f = progress(l.min, l.max - m, d.min)), clamp(0, 1, f);
|
|
36
|
-
}
|
|
37
|
-
function rebaseAxisConstraints(e, c) {
|
|
38
|
-
let l = {};
|
|
39
|
-
return c.min !== void 0 && (l.min = c.min - e.min), c.max !== void 0 && (l.max = c.max - e.min), l;
|
|
40
|
-
}
|
|
41
|
-
var defaultElastic = .35;
|
|
42
|
-
function resolveDragElastic(e = defaultElastic) {
|
|
43
|
-
return e === !1 ? e = 0 : e === !0 && (e = defaultElastic), {
|
|
44
|
-
x: resolveAxisElastic(e, "left", "right"),
|
|
45
|
-
y: resolveAxisElastic(e, "top", "bottom")
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function resolveAxisElastic(e, c, l) {
|
|
49
|
-
return {
|
|
50
|
-
min: resolvePointElastic(e, c),
|
|
51
|
-
max: resolvePointElastic(e, l)
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function resolvePointElastic(e, c) {
|
|
55
|
-
return typeof e == "number" ? e : e[c] || 0;
|
|
56
|
-
}
|
|
57
|
-
export { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { pipe } from "../../../../motion-utils/dist/es/pipe.js";
|
|
2
|
-
import { Feature } from "../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
-
import { addDomEvent } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
|
|
4
|
-
var FocusGesture = class extends Feature {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments), this.isActive = !1;
|
|
7
|
-
}
|
|
8
|
-
onFocus() {
|
|
9
|
-
let e = !1;
|
|
10
|
-
try {
|
|
11
|
-
e = this.node.current.matches(":focus-visible");
|
|
12
|
-
} catch {
|
|
13
|
-
e = !0;
|
|
14
|
-
}
|
|
15
|
-
!e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
|
|
16
|
-
}
|
|
17
|
-
onBlur() {
|
|
18
|
-
!this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
|
|
19
|
-
}
|
|
20
|
-
mount() {
|
|
21
|
-
this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur()));
|
|
22
|
-
}
|
|
23
|
-
unmount() {}
|
|
24
|
-
};
|
|
25
|
-
export { FocusGesture };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { frame } from "../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
2
|
-
import { hover } from "../../../../motion-dom/dist/es/gestures/hover.js";
|
|
3
|
-
import { Feature } from "../../../../motion-dom/dist/es/render/Feature.js";
|
|
4
|
-
import { extractEventInfo } from "../events/event-info.js";
|
|
5
|
-
function handleHoverEvent(n, r, i) {
|
|
6
|
-
let { props: a } = n;
|
|
7
|
-
n.animationState && a.whileHover && n.animationState.setActive("whileHover", i === "Start");
|
|
8
|
-
let o = a["onHover" + i];
|
|
9
|
-
o && frame.postRender(() => o(r, extractEventInfo(r)));
|
|
10
|
-
}
|
|
11
|
-
var HoverGesture = class extends Feature {
|
|
12
|
-
mount() {
|
|
13
|
-
let { current: e } = this.node;
|
|
14
|
-
e && (this.unmount = hover(e, (e, n) => (handleHoverEvent(this.node, n, "Start"), (e) => handleHoverEvent(this.node, e, "End"))));
|
|
15
|
-
}
|
|
16
|
-
unmount() {}
|
|
17
|
-
};
|
|
18
|
-
export { HoverGesture };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { pipe } from "../../../../../motion-utils/dist/es/pipe.js";
|
|
2
|
-
import { millisecondsToSeconds, secondsToMilliseconds } from "../../../../../motion-utils/dist/es/time-conversion.js";
|
|
3
|
-
import { cancelFrame, frame, frameData } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
4
|
-
import { isPrimaryPointer } from "../../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
|
|
5
|
-
import { extractEventInfo } from "../../events/event-info.js";
|
|
6
|
-
import { addPointerEvent } from "../../events/add-pointer-event.js";
|
|
7
|
-
import { distance2D } from "../../utils/distance.js";
|
|
8
|
-
var overflowStyles = /* @__PURE__ */ new Set(["auto", "scroll"]), PanSession = class {
|
|
9
|
-
constructor(i, a, { transformPagePoint: o, contextWindow: f = window, dragSnapToOrigin: p = !1, distanceThreshold: m = 3, element: h } = {}) {
|
|
10
|
-
if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.lastRawMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.scrollPositions = /* @__PURE__ */ new Map(), this.removeScrollListeners = null, this.onElementScroll = (e) => {
|
|
11
|
-
this.handleScroll(e.target);
|
|
12
|
-
}, this.onWindowScroll = () => {
|
|
13
|
-
this.handleScroll(window);
|
|
14
|
-
}, this.updatePoint = () => {
|
|
15
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return;
|
|
16
|
-
this.lastRawMoveEventInfo && (this.lastMoveEventInfo = transformPoint(this.lastRawMoveEventInfo, this.transformPagePoint));
|
|
17
|
-
let e = getPanInfo(this.lastMoveEventInfo, this.history), i = this.startEvent !== null, a = distance2D(e.offset, {
|
|
18
|
-
x: 0,
|
|
19
|
-
y: 0
|
|
20
|
-
}) >= this.distanceThreshold;
|
|
21
|
-
if (!i && !a) return;
|
|
22
|
-
let { point: o } = e, { timestamp: s } = frameData;
|
|
23
|
-
this.history.push({
|
|
24
|
-
...o,
|
|
25
|
-
timestamp: s
|
|
26
|
-
});
|
|
27
|
-
let { onStart: l, onMove: u } = this.handlers;
|
|
28
|
-
i || (l && l(this.lastMoveEvent, e), this.startEvent = this.lastMoveEvent), u && u(this.lastMoveEvent, e);
|
|
29
|
-
}, this.handlePointerMove = (e, i) => {
|
|
30
|
-
this.lastMoveEvent = e, this.lastRawMoveEventInfo = i, this.lastMoveEventInfo = transformPoint(i, this.transformPagePoint), frame.update(this.updatePoint, !0);
|
|
31
|
-
}, this.handlePointerUp = (e, i) => {
|
|
32
|
-
this.end();
|
|
33
|
-
let { onEnd: a, onSessionEnd: o, resumeAnimation: s } = this.handlers;
|
|
34
|
-
if ((this.dragSnapToOrigin || !this.startEvent) && s && s(), !(this.lastMoveEvent && this.lastMoveEventInfo)) return;
|
|
35
|
-
let c = getPanInfo(e.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(i, this.transformPagePoint), this.history);
|
|
36
|
-
this.startEvent && a && a(e, c), o && o(e, c);
|
|
37
|
-
}, !isPrimaryPointer(i)) return;
|
|
38
|
-
this.dragSnapToOrigin = p, this.handlers = a, this.transformPagePoint = o, this.distanceThreshold = m, this.contextWindow = f || window;
|
|
39
|
-
let g = transformPoint(extractEventInfo(i), this.transformPagePoint), { point: _ } = g, { timestamp: v } = frameData;
|
|
40
|
-
this.history = [{
|
|
41
|
-
..._,
|
|
42
|
-
timestamp: v
|
|
43
|
-
}];
|
|
44
|
-
let { onSessionStart: y } = a;
|
|
45
|
-
y && y(i, getPanInfo(g, this.history));
|
|
46
|
-
let b = {
|
|
47
|
-
passive: !0,
|
|
48
|
-
capture: !0
|
|
49
|
-
};
|
|
50
|
-
this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove, b), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp, b), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp, b)), h && this.startScrollTracking(h);
|
|
51
|
-
}
|
|
52
|
-
startScrollTracking(e) {
|
|
53
|
-
let i = e.parentElement;
|
|
54
|
-
for (; i;) {
|
|
55
|
-
let e = getComputedStyle(i);
|
|
56
|
-
(overflowStyles.has(e.overflowX) || overflowStyles.has(e.overflowY)) && this.scrollPositions.set(i, {
|
|
57
|
-
x: i.scrollLeft,
|
|
58
|
-
y: i.scrollTop
|
|
59
|
-
}), i = i.parentElement;
|
|
60
|
-
}
|
|
61
|
-
this.scrollPositions.set(window, {
|
|
62
|
-
x: window.scrollX,
|
|
63
|
-
y: window.scrollY
|
|
64
|
-
}), window.addEventListener("scroll", this.onElementScroll, { capture: !0 }), window.addEventListener("scroll", this.onWindowScroll), this.removeScrollListeners = () => {
|
|
65
|
-
window.removeEventListener("scroll", this.onElementScroll, { capture: !0 }), window.removeEventListener("scroll", this.onWindowScroll);
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
handleScroll(e) {
|
|
69
|
-
let i = this.scrollPositions.get(e);
|
|
70
|
-
if (!i) return;
|
|
71
|
-
let a = e === window, o = a ? {
|
|
72
|
-
x: window.scrollX,
|
|
73
|
-
y: window.scrollY
|
|
74
|
-
} : {
|
|
75
|
-
x: e.scrollLeft,
|
|
76
|
-
y: e.scrollTop
|
|
77
|
-
}, c = {
|
|
78
|
-
x: o.x - i.x,
|
|
79
|
-
y: o.y - i.y
|
|
80
|
-
};
|
|
81
|
-
c.x === 0 && c.y === 0 || (a ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += c.x, this.lastMoveEventInfo.point.y += c.y) : this.history.length > 0 && (this.history[0].x -= c.x, this.history[0].y -= c.y), this.scrollPositions.set(e, o), frame.update(this.updatePoint, !0));
|
|
82
|
-
}
|
|
83
|
-
updateHandlers(e) {
|
|
84
|
-
this.handlers = e;
|
|
85
|
-
}
|
|
86
|
-
end() {
|
|
87
|
-
this.removeListeners && this.removeListeners(), this.removeScrollListeners && this.removeScrollListeners(), this.scrollPositions.clear(), cancelFrame(this.updatePoint);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
function transformPoint(e, i) {
|
|
91
|
-
return i ? { point: i(e.point) } : e;
|
|
92
|
-
}
|
|
93
|
-
function subtractPoint(e, i) {
|
|
94
|
-
return {
|
|
95
|
-
x: e.x - i.x,
|
|
96
|
-
y: e.y - i.y
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function getPanInfo({ point: e }, i) {
|
|
100
|
-
return {
|
|
101
|
-
point: e,
|
|
102
|
-
delta: subtractPoint(e, lastDevicePoint(i)),
|
|
103
|
-
offset: subtractPoint(e, startDevicePoint(i)),
|
|
104
|
-
velocity: getVelocity(i, .1)
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function startDevicePoint(e) {
|
|
108
|
-
return e[0];
|
|
109
|
-
}
|
|
110
|
-
function lastDevicePoint(e) {
|
|
111
|
-
return e[e.length - 1];
|
|
112
|
-
}
|
|
113
|
-
function getVelocity(e, o) {
|
|
114
|
-
if (e.length < 2) return {
|
|
115
|
-
x: 0,
|
|
116
|
-
y: 0
|
|
117
|
-
};
|
|
118
|
-
let s = e.length - 1, c = null, l = lastDevicePoint(e);
|
|
119
|
-
for (; s >= 0 && (c = e[s], !(l.timestamp - c.timestamp > secondsToMilliseconds(o)));) s--;
|
|
120
|
-
if (!c) return {
|
|
121
|
-
x: 0,
|
|
122
|
-
y: 0
|
|
123
|
-
};
|
|
124
|
-
c === e[0] && e.length > 2 && l.timestamp - c.timestamp > secondsToMilliseconds(o) * 2 && (c = e[1]);
|
|
125
|
-
let u = millisecondsToSeconds(l.timestamp - c.timestamp);
|
|
126
|
-
if (u === 0) return {
|
|
127
|
-
x: 0,
|
|
128
|
-
y: 0
|
|
129
|
-
};
|
|
130
|
-
let d = {
|
|
131
|
-
x: (l.x - c.x) / u,
|
|
132
|
-
y: (l.y - c.y) / u
|
|
133
|
-
};
|
|
134
|
-
return d.x === Infinity && (d.x = 0), d.y === Infinity && (d.y = 0), d;
|
|
135
|
-
}
|
|
136
|
-
export { PanSession };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { noop } from "../../../../../motion-utils/dist/es/noop.js";
|
|
2
|
-
import { frame } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
3
|
-
import { Feature } from "../../../../../motion-dom/dist/es/render/Feature.js";
|
|
4
|
-
import { addPointerEvent } from "../../events/add-pointer-event.js";
|
|
5
|
-
import { getContextWindow } from "../../utils/get-context-window.js";
|
|
6
|
-
import { PanSession } from "./PanSession.js";
|
|
7
|
-
var asyncHandler = (e) => (a, o) => {
|
|
8
|
-
e && frame.update(() => e(a, o), !1, !0);
|
|
9
|
-
}, PanGesture = class extends Feature {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments), this.removePointerDownListener = noop;
|
|
12
|
-
}
|
|
13
|
-
onPointerDown(e) {
|
|
14
|
-
this.session = new PanSession(e, this.createPanHandlers(), {
|
|
15
|
-
transformPagePoint: this.node.getTransformPagePoint(),
|
|
16
|
-
contextWindow: getContextWindow(this.node)
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
createPanHandlers() {
|
|
20
|
-
let { onPanSessionStart: e, onPanStart: a, onPan: o, onPanEnd: s } = this.node.getProps();
|
|
21
|
-
return {
|
|
22
|
-
onSessionStart: asyncHandler(e),
|
|
23
|
-
onStart: asyncHandler(a),
|
|
24
|
-
onMove: asyncHandler(o),
|
|
25
|
-
onEnd: (e, a) => {
|
|
26
|
-
delete this.session, s && frame.postRender(() => s(e, a));
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
mount() {
|
|
31
|
-
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (e) => this.onPointerDown(e));
|
|
32
|
-
}
|
|
33
|
-
update() {
|
|
34
|
-
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
35
|
-
}
|
|
36
|
-
unmount() {
|
|
37
|
-
this.removePointerDownListener(), this.session && this.session.end();
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export { PanGesture };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { frame } from "../../../../motion-dom/dist/es/frameloop/frame.js";
|
|
2
|
-
import { press } from "../../../../motion-dom/dist/es/gestures/press/index.js";
|
|
3
|
-
import { Feature } from "../../../../motion-dom/dist/es/render/Feature.js";
|
|
4
|
-
import { extractEventInfo } from "../events/event-info.js";
|
|
5
|
-
function handlePressEvent(t, n, i) {
|
|
6
|
-
let { props: a } = t;
|
|
7
|
-
if (t.current instanceof HTMLButtonElement && t.current.disabled) return;
|
|
8
|
-
t.animationState && a.whileTap && t.animationState.setActive("whileTap", i === "Start");
|
|
9
|
-
let o = a["onTap" + (i === "End" ? "" : i)];
|
|
10
|
-
o && frame.postRender(() => o(n, extractEventInfo(n)));
|
|
11
|
-
}
|
|
12
|
-
var PressGesture = class extends Feature {
|
|
13
|
-
mount() {
|
|
14
|
-
let { current: e } = this.node;
|
|
15
|
-
if (!e) return;
|
|
16
|
-
let { globalTapTarget: n, propagate: r } = this.node.props;
|
|
17
|
-
this.unmount = press(e, (e, t) => (handlePressEvent(this.node, t, "Start"), (e, { success: t }) => handlePressEvent(this.node, e, t ? "End" : "Cancel")), {
|
|
18
|
-
useGlobalTarget: n,
|
|
19
|
-
stopPropagation: r?.tap === !1
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
unmount() {}
|
|
23
|
-
};
|
|
24
|
-
export { PressGesture };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { resolveVariant } from "../../../../../../motion-dom/dist/es/render/utils/resolve-dynamic-variants.js";
|
|
2
|
-
import { Feature } from "../../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
-
var id = 0, ExitAnimationFeature = class extends Feature {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments), this.id = id++, this.isExitComplete = !1;
|
|
6
|
-
}
|
|
7
|
-
update() {
|
|
8
|
-
if (!this.node.presenceContext) return;
|
|
9
|
-
let { isPresent: t, onExitComplete: n } = this.node.presenceContext, { isPresent: r } = this.node.prevPresenceContext || {};
|
|
10
|
-
if (!this.node.animationState || t === r) return;
|
|
11
|
-
if (t && r === !1) {
|
|
12
|
-
if (this.isExitComplete) {
|
|
13
|
-
let { initial: t, custom: n } = this.node.getProps();
|
|
14
|
-
if (typeof t == "string" || typeof t == "object" && t && !Array.isArray(t)) {
|
|
15
|
-
let r = resolveVariant(this.node, t, n);
|
|
16
|
-
if (r) {
|
|
17
|
-
let { transition: e, transitionEnd: t, ...n } = r;
|
|
18
|
-
for (let e in n) this.node.getValue(e)?.jump(n[e]);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
this.node.animationState.reset(), this.node.animationState.animateChanges();
|
|
22
|
-
} else this.node.animationState.setActive("exit", !1);
|
|
23
|
-
this.isExitComplete = !1;
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
let i = this.node.animationState.setActive("exit", !t);
|
|
27
|
-
n && !t && i.then(() => {
|
|
28
|
-
this.isExitComplete = !0, n(this.id);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
mount() {
|
|
32
|
-
let { register: e, onExitComplete: t } = this.node.presenceContext || {};
|
|
33
|
-
t && t(this.id), e && (this.unmount = e(this.id));
|
|
34
|
-
}
|
|
35
|
-
unmount() {}
|
|
36
|
-
};
|
|
37
|
-
export { ExitAnimationFeature };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { isAnimationControls } from "../../../../../../motion-dom/dist/es/render/utils/is-animation-controls.js";
|
|
2
|
-
import { Feature } from "../../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
-
import { createAnimationState } from "../../../../../../motion-dom/dist/es/render/utils/animation-state.js";
|
|
4
|
-
var AnimationFeature = class extends Feature {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
super(e), e.animationState ||= createAnimationState(e);
|
|
7
|
-
}
|
|
8
|
-
updateAnimationControlsSubscription() {
|
|
9
|
-
let { animate: r } = this.node.getProps();
|
|
10
|
-
isAnimationControls(r) && (this.unmountControls = r.subscribe(this.node));
|
|
11
|
-
}
|
|
12
|
-
mount() {
|
|
13
|
-
this.updateAnimationControlsSubscription();
|
|
14
|
-
}
|
|
15
|
-
update() {
|
|
16
|
-
let { animate: e } = this.node.getProps(), { animate: r } = this.node.prevProps || {};
|
|
17
|
-
e !== r && this.updateAnimationControlsSubscription();
|
|
18
|
-
}
|
|
19
|
-
unmount() {
|
|
20
|
-
this.node.animationState.reset(), this.unmountControls?.();
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export { AnimationFeature };
|