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