@code0-tech/pictor 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/island/Island.style.css +1 -0
- package/dist/assets/components/resizable/Resizable.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +7 -7
- package/dist/components/button/Button.js +11 -11
- package/dist/components/data-table/DataTable.js +15 -15
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
- package/dist/components/editor/Editor.js +13 -13
- package/dist/components/form/CheckboxInput.js +4 -4
- package/dist/components/form/EmailInput.js +9 -9
- package/dist/components/form/InputContentEditable.hook.js +11 -11
- package/dist/components/form/InputWrapper.js +15 -15
- package/dist/components/form/NumberInput.js +9 -9
- package/dist/components/form/PasswordInput.js +4 -4
- package/dist/components/form/SwitchInput.js +7 -7
- package/dist/components/form/TextAreaInput.js +6 -6
- package/dist/components/form/TextInput.js +6 -6
- package/dist/components/form/useForm.js +2 -2
- package/dist/components/fullscreen/FullScreen.js +2 -2
- package/dist/components/gantt/GanttGroup.js +15 -15
- package/dist/components/island/Island.d.ts +6 -0
- package/dist/components/island/Island.hook.d.ts +19 -0
- package/dist/components/island/Island.hook.js +58 -0
- package/dist/components/island/Island.js +71 -0
- package/dist/components/progress/Progress.js +18 -18
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +285 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +22 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +67 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +28 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +43 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +29 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +45 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +33 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +39 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +60 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +14 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +45 -0
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +62 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +65 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +52 -0
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +18 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +16 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +21 -0
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +24 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +27 -0
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +22 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +9 -0
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +112 -0
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +144 -0
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +106 -0
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +30 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +178 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +46 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +59 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +68 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +74 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +33 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +43 -0
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +34 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +53 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +18 -0
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +618 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +53 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +19 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +10 -0
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +263 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +28 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +65 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +38 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/store.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +143 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +25 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +20 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +21 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +13 -0
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +39 -0
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +42 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +29 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +51 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/value/index.js +212 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +19 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +22 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +15 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +16 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +18 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +24 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +51 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +9 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +27 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +17 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +12 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +14 -0
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +11 -0
- package/dist/node_modules/motion-utils/dist/es/clamp.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +9 -0
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +8 -0
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +19 -0
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +32 -0
- package/dist/node_modules/motion-utils/dist/es/errors.js +14 -0
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
- package/dist/node_modules/motion-utils/dist/es/global-config.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/is-object.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/memo.js +8 -0
- package/dist/node_modules/motion-utils/dist/es/noop.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/pipe.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/progress.js +7 -0
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +29 -0
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +8 -0
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
- package/dist/utils/reactiveArrayService.js +4 -4
- package/package.json +9 -6
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +0 -81
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +0 -32
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +0 -58
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { makeUseVisualState as e } from "../../motion/utils/use-visual-state.js";
|
|
2
|
+
import { createHtmlRenderState as t } from "./utils/create-render-state.js";
|
|
3
|
+
import { scrapeMotionValuesFromProps as r } from "../../../../../motion-dom/dist/es/render/html/utils/scrape-motion-values.js";
|
|
4
|
+
const m = /* @__PURE__ */ e({
|
|
5
|
+
scrapeMotionValuesFromProps: r,
|
|
6
|
+
createRenderState: t
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
m as useHTMLVisualState
|
|
10
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useMemo as i } from "react";
|
|
2
|
+
import { createHtmlRenderState as a } from "./utils/create-render-state.js";
|
|
3
|
+
import { isMotionValue as r } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
|
|
4
|
+
import { isForcedMotionValue as l } from "../../../../../motion-dom/dist/es/render/utils/is-forced-motion-value.js";
|
|
5
|
+
import { buildHTMLStyles as s } from "../../../../../motion-dom/dist/es/render/html/utils/build-styles.js";
|
|
6
|
+
function u(t, o, n) {
|
|
7
|
+
for (const e in o)
|
|
8
|
+
!r(o[e]) && !l(e, n) && (t[e] = o[e]);
|
|
9
|
+
}
|
|
10
|
+
function c({ transformTemplate: t }, o) {
|
|
11
|
+
return i(() => {
|
|
12
|
+
const n = a();
|
|
13
|
+
return s(n, o, t), Object.assign({}, n.vars, n.style);
|
|
14
|
+
}, [o]);
|
|
15
|
+
}
|
|
16
|
+
function f(t, o) {
|
|
17
|
+
const n = t.style || {}, e = {};
|
|
18
|
+
return u(e, n, t), Object.assign(e, c(t, o)), e;
|
|
19
|
+
}
|
|
20
|
+
function M(t, o) {
|
|
21
|
+
const n = {}, e = f(t, o);
|
|
22
|
+
return t.drag && t.dragListener !== !1 && (n.draggable = !1, e.userSelect = e.WebkitUserSelect = e.WebkitTouchCallout = "none", e.touchAction = t.drag === !0 ? "none" : `pan-${t.drag === "x" ? "y" : "x"}`), t.tabIndex === void 0 && (t.onTap || t.onTapStart || t.whileTap) && (n.tabIndex = 0), n.style = e, n;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
u as copyRawValuesOnly,
|
|
26
|
+
M as useHTMLProps
|
|
27
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
"animate",
|
|
3
|
+
"circle",
|
|
4
|
+
"defs",
|
|
5
|
+
"desc",
|
|
6
|
+
"ellipse",
|
|
7
|
+
"g",
|
|
8
|
+
"image",
|
|
9
|
+
"line",
|
|
10
|
+
"filter",
|
|
11
|
+
"marker",
|
|
12
|
+
"mask",
|
|
13
|
+
"metadata",
|
|
14
|
+
"path",
|
|
15
|
+
"pattern",
|
|
16
|
+
"polygon",
|
|
17
|
+
"polyline",
|
|
18
|
+
"rect",
|
|
19
|
+
"stop",
|
|
20
|
+
"switch",
|
|
21
|
+
"symbol",
|
|
22
|
+
"svg",
|
|
23
|
+
"text",
|
|
24
|
+
"tspan",
|
|
25
|
+
"use",
|
|
26
|
+
"view"
|
|
27
|
+
];
|
|
28
|
+
export {
|
|
29
|
+
e as lowercaseSVGElements
|
|
30
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMemo as m } from "react";
|
|
2
|
+
import { copyRawValuesOnly as l } from "../html/use-props.js";
|
|
3
|
+
import { createSvgRenderState as i } from "./utils/create-render-state.js";
|
|
4
|
+
import { buildSVGAttrs as a } from "../../../../../motion-dom/dist/es/render/svg/utils/build-attrs.js";
|
|
5
|
+
import { isSVGTag as n } from "../../../../../motion-dom/dist/es/render/svg/utils/is-svg-tag.js";
|
|
6
|
+
function G(e, s, y, o) {
|
|
7
|
+
const r = m(() => {
|
|
8
|
+
const t = i();
|
|
9
|
+
return a(t, s, n(o), e.transformTemplate, e.style), {
|
|
10
|
+
...t.attrs,
|
|
11
|
+
style: { ...t.style }
|
|
12
|
+
};
|
|
13
|
+
}, [s]);
|
|
14
|
+
if (e.style) {
|
|
15
|
+
const t = {};
|
|
16
|
+
l(t, e.style, e), r.style = { ...t, ...r.style };
|
|
17
|
+
}
|
|
18
|
+
return r;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
G as useSVGProps
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { makeUseVisualState as e } from "../../motion/utils/use-visual-state.js";
|
|
2
|
+
import { createSvgRenderState as r } from "./utils/create-render-state.js";
|
|
3
|
+
import { scrapeMotionValuesFromProps as t } from "../../../../../motion-dom/dist/es/render/svg/utils/scrape-motion-values.js";
|
|
4
|
+
const m = /* @__PURE__ */ e({
|
|
5
|
+
scrapeMotionValuesFromProps: t,
|
|
6
|
+
createRenderState: r
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
m as useSVGVisualState
|
|
10
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { time as v } from "../frameloop/sync-time.js";
|
|
2
|
+
import { JSAnimation as A } from "./JSAnimation.js";
|
|
3
|
+
import { getFinalKeyframe as y } from "./keyframes/get-final.js";
|
|
4
|
+
import { KeyframeResolver as g, flushKeyframeResolvers as R } from "./keyframes/KeyframesResolver.js";
|
|
5
|
+
import { NativeAnimationExtended as T } from "./NativeAnimationExtended.js";
|
|
6
|
+
import { canAnimate as _ } from "./utils/can-animate.js";
|
|
7
|
+
import { makeAnimationInstant as w } from "./utils/make-animation-instant.js";
|
|
8
|
+
import { WithPromise as K } from "./utils/WithPromise.js";
|
|
9
|
+
import { supportsBrowserAnimation as D } from "./waapi/supports/waapi.js";
|
|
10
|
+
import { MotionGlobalConfig as E } from "../../../../motion-utils/dist/es/global-config.js";
|
|
11
|
+
import { noop as k } from "../../../../motion-utils/dist/es/noop.js";
|
|
12
|
+
const x = 40;
|
|
13
|
+
class H extends K {
|
|
14
|
+
constructor({ autoplay: t = !0, delay: s = 0, type: e = "keyframes", repeat: h = 0, repeatDelay: l = 0, repeatType: f = "loop", keyframes: d, name: o, motionValue: r, element: a, ...m }) {
|
|
15
|
+
super(), this.stop = () => {
|
|
16
|
+
this._animation && (this._animation.stop(), this.stopTimeline?.()), this.keyframeResolver?.cancel();
|
|
17
|
+
}, this.createdAt = v.now();
|
|
18
|
+
const u = {
|
|
19
|
+
autoplay: t,
|
|
20
|
+
delay: s,
|
|
21
|
+
type: e,
|
|
22
|
+
repeat: h,
|
|
23
|
+
repeatDelay: l,
|
|
24
|
+
repeatType: f,
|
|
25
|
+
name: o,
|
|
26
|
+
motionValue: r,
|
|
27
|
+
element: a,
|
|
28
|
+
...m
|
|
29
|
+
}, n = a?.KeyframeResolver || g;
|
|
30
|
+
this.keyframeResolver = new n(d, (c, p, i) => this.onKeyframesResolved(c, p, u, !i), o, r, a), this.keyframeResolver?.scheduleResolve();
|
|
31
|
+
}
|
|
32
|
+
onKeyframesResolved(t, s, e, h) {
|
|
33
|
+
this.keyframeResolver = void 0;
|
|
34
|
+
const { name: l, type: f, velocity: d, delay: o, isHandoff: r, onUpdate: a } = e;
|
|
35
|
+
this.resolvedAt = v.now();
|
|
36
|
+
let m = !0;
|
|
37
|
+
_(t, l, f, d) || (m = !1, (E.instantAnimations || !o) && a?.(y(t, e, s)), t[0] = t[t.length - 1], w(e), e.repeat = 0);
|
|
38
|
+
const n = {
|
|
39
|
+
startTime: h ? this.resolvedAt ? this.resolvedAt - this.createdAt > x ? this.resolvedAt : this.createdAt : this.createdAt : void 0,
|
|
40
|
+
finalKeyframe: s,
|
|
41
|
+
...e,
|
|
42
|
+
keyframes: t
|
|
43
|
+
}, c = m && !r && D(n), p = n.motionValue?.owner?.current;
|
|
44
|
+
let i;
|
|
45
|
+
if (c)
|
|
46
|
+
try {
|
|
47
|
+
i = new T({
|
|
48
|
+
...n,
|
|
49
|
+
element: p
|
|
50
|
+
});
|
|
51
|
+
} catch {
|
|
52
|
+
i = new A(n);
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
i = new A(n);
|
|
56
|
+
i.finished.then(() => {
|
|
57
|
+
this.notifyFinished();
|
|
58
|
+
}).catch(k), this.pendingTimeline && (this.stopTimeline = i.attachTimeline(this.pendingTimeline), this.pendingTimeline = void 0), this._animation = i;
|
|
59
|
+
}
|
|
60
|
+
get finished() {
|
|
61
|
+
return this._animation ? this.animation.finished : this._finished;
|
|
62
|
+
}
|
|
63
|
+
then(t, s) {
|
|
64
|
+
return this.finished.finally(t).then(() => {
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
get animation() {
|
|
68
|
+
return this._animation || (this.keyframeResolver?.resume(), R()), this._animation;
|
|
69
|
+
}
|
|
70
|
+
get duration() {
|
|
71
|
+
return this.animation.duration;
|
|
72
|
+
}
|
|
73
|
+
get iterationDuration() {
|
|
74
|
+
return this.animation.iterationDuration;
|
|
75
|
+
}
|
|
76
|
+
get time() {
|
|
77
|
+
return this.animation.time;
|
|
78
|
+
}
|
|
79
|
+
set time(t) {
|
|
80
|
+
this.animation.time = t;
|
|
81
|
+
}
|
|
82
|
+
get speed() {
|
|
83
|
+
return this.animation.speed;
|
|
84
|
+
}
|
|
85
|
+
get state() {
|
|
86
|
+
return this.animation.state;
|
|
87
|
+
}
|
|
88
|
+
set speed(t) {
|
|
89
|
+
this.animation.speed = t;
|
|
90
|
+
}
|
|
91
|
+
get startTime() {
|
|
92
|
+
return this.animation.startTime;
|
|
93
|
+
}
|
|
94
|
+
attachTimeline(t) {
|
|
95
|
+
return this._animation ? this.stopTimeline = this.animation.attachTimeline(t) : this.pendingTimeline = t, () => this.stop();
|
|
96
|
+
}
|
|
97
|
+
play() {
|
|
98
|
+
this.animation.play();
|
|
99
|
+
}
|
|
100
|
+
pause() {
|
|
101
|
+
this.animation.pause();
|
|
102
|
+
}
|
|
103
|
+
complete() {
|
|
104
|
+
this.animation.complete();
|
|
105
|
+
}
|
|
106
|
+
cancel() {
|
|
107
|
+
this._animation && this.animation.cancel(), this.keyframeResolver?.cancel();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
H as AsyncMotionValueAnimation
|
|
112
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { time as p } from "../frameloop/sync-time.js";
|
|
2
|
+
import { mix as P } from "../utils/mix/index.js";
|
|
3
|
+
import { frameloopDriver as I } from "./drivers/frame.js";
|
|
4
|
+
import { inertia as K } from "./generators/inertia.js";
|
|
5
|
+
import { keyframes as u } from "./generators/keyframes.js";
|
|
6
|
+
import { calcGeneratorDuration as O } from "./generators/utils/calc-duration.js";
|
|
7
|
+
import { getGeneratorVelocity as V } from "./generators/utils/velocity.js";
|
|
8
|
+
import { getFinalKeyframe as C } from "./keyframes/get-final.js";
|
|
9
|
+
import { replaceTransitionType as E } from "./utils/replace-transition-type.js";
|
|
10
|
+
import { WithPromise as N } from "./utils/WithPromise.js";
|
|
11
|
+
import { invariant as W } from "../../../../motion-utils/dist/es/errors.js";
|
|
12
|
+
import { pipe as $ } from "../../../../motion-utils/dist/es/pipe.js";
|
|
13
|
+
import { millisecondsToSeconds as c, secondsToMilliseconds as B } from "../../../../motion-utils/dist/es/time-conversion.js";
|
|
14
|
+
import { clamp as J } from "../../../../motion-utils/dist/es/clamp.js";
|
|
15
|
+
const U = (g) => g / 100;
|
|
16
|
+
class rt extends N {
|
|
17
|
+
constructor(t) {
|
|
18
|
+
super(), this.state = "idle", this.startTime = null, this.isStopped = !1, this.currentTime = 0, this.holdTime = null, this.playbackSpeed = 1, this.delayState = {
|
|
19
|
+
done: !1,
|
|
20
|
+
value: void 0
|
|
21
|
+
}, this.stop = () => {
|
|
22
|
+
const { motionValue: i } = this.options;
|
|
23
|
+
i && i.updatedAt !== p.now() && this.tick(p.now()), this.isStopped = !0, this.state !== "idle" && (this.teardown(), this.options.onStop?.());
|
|
24
|
+
}, this.options = t, this.initAnimation(), this.play(), t.autoplay === !1 && this.pause();
|
|
25
|
+
}
|
|
26
|
+
initAnimation() {
|
|
27
|
+
const { options: t } = this;
|
|
28
|
+
E(t);
|
|
29
|
+
const { type: i = u, repeat: s = 0, repeatDelay: r = 0, repeatType: m, velocity: f = 0 } = t;
|
|
30
|
+
let { keyframes: e } = t;
|
|
31
|
+
const h = i || u;
|
|
32
|
+
process.env.NODE_ENV !== "production" && h !== u && W(e.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`, "spring-two-frames"), h !== u && typeof e[0] != "number" && (this.mixKeyframes = $(U, P(e[0], e[1])), e = [0, 100]);
|
|
33
|
+
const n = h({ ...t, keyframes: e });
|
|
34
|
+
m === "mirror" && (this.mirroredGenerator = h({
|
|
35
|
+
...t,
|
|
36
|
+
keyframes: [...e].reverse(),
|
|
37
|
+
velocity: -f
|
|
38
|
+
})), n.calculatedDuration === null && (n.calculatedDuration = O(n));
|
|
39
|
+
const { calculatedDuration: l } = n;
|
|
40
|
+
this.calculatedDuration = l, this.resolvedDuration = l + r, this.totalDuration = this.resolvedDuration * (s + 1) - r, this.generator = n;
|
|
41
|
+
}
|
|
42
|
+
updateTime(t) {
|
|
43
|
+
const i = Math.round(t - this.startTime) * this.playbackSpeed;
|
|
44
|
+
this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = i;
|
|
45
|
+
}
|
|
46
|
+
tick(t, i = !1) {
|
|
47
|
+
const { generator: s, totalDuration: r, mixKeyframes: m, mirroredGenerator: f, resolvedDuration: e, calculatedDuration: h } = this;
|
|
48
|
+
if (this.startTime === null)
|
|
49
|
+
return s.next(0);
|
|
50
|
+
const { delay: n = 0, keyframes: l, repeat: k, repeatType: D, repeatDelay: S, type: F, onUpdate: b, finalKeyframe: G } = this.options;
|
|
51
|
+
this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - r / this.speed, this.startTime)), i ? this.currentTime = t : this.updateTime(t);
|
|
52
|
+
const T = this.currentTime - n * (this.playbackSpeed >= 0 ? 1 : -1), y = this.playbackSpeed >= 0 ? T < 0 : T > r;
|
|
53
|
+
this.currentTime = Math.max(T, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = r);
|
|
54
|
+
let x = this.currentTime, w = s;
|
|
55
|
+
if (k) {
|
|
56
|
+
const v = Math.min(this.currentTime, r) / e;
|
|
57
|
+
let d = Math.floor(v), o = v % 1;
|
|
58
|
+
!o && v >= 1 && (o = 1), o === 1 && d--, d = Math.min(d, k + 1), d % 2 && (D === "reverse" ? (o = 1 - o, S && (o -= S / e)) : D === "mirror" && (w = f)), x = J(0, 1, o) * e;
|
|
59
|
+
}
|
|
60
|
+
let a;
|
|
61
|
+
y ? (this.delayState.value = l[0], a = this.delayState) : a = w.next(x), m && !y && (a.value = m(a.value));
|
|
62
|
+
let { done: M } = a;
|
|
63
|
+
!y && h !== null && (M = this.playbackSpeed >= 0 ? this.currentTime >= r : this.currentTime <= 0);
|
|
64
|
+
const A = this.holdTime === null && (this.state === "finished" || this.state === "running" && M);
|
|
65
|
+
return A && F !== K && (a.value = C(l, this.options, G, this.speed)), b && b(a.value), A && this.finish(), a;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Allows the returned animation to be awaited or promise-chained. Currently
|
|
69
|
+
* resolves when the animation finishes at all but in a future update could/should
|
|
70
|
+
* reject if its cancels.
|
|
71
|
+
*/
|
|
72
|
+
then(t, i) {
|
|
73
|
+
return this.finished.then(t, i);
|
|
74
|
+
}
|
|
75
|
+
get duration() {
|
|
76
|
+
return c(this.calculatedDuration);
|
|
77
|
+
}
|
|
78
|
+
get iterationDuration() {
|
|
79
|
+
const { delay: t = 0 } = this.options || {};
|
|
80
|
+
return this.duration + c(t);
|
|
81
|
+
}
|
|
82
|
+
get time() {
|
|
83
|
+
return c(this.currentTime);
|
|
84
|
+
}
|
|
85
|
+
set time(t) {
|
|
86
|
+
t = B(t), this.currentTime = t, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = t : this.driver && (this.startTime = this.driver.now() - t / this.playbackSpeed), this.driver ? this.driver.start(!1) : (this.startTime = 0, this.state = "paused", this.holdTime = t, this.tick(t));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Returns the generator's velocity at the current time in units/second.
|
|
90
|
+
* Uses the analytical derivative when available (springs), avoiding
|
|
91
|
+
* the MotionValue's frame-dependent velocity estimation.
|
|
92
|
+
*/
|
|
93
|
+
getGeneratorVelocity() {
|
|
94
|
+
const t = this.currentTime;
|
|
95
|
+
if (t <= 0)
|
|
96
|
+
return this.options.velocity || 0;
|
|
97
|
+
if (this.generator.velocity)
|
|
98
|
+
return this.generator.velocity(t);
|
|
99
|
+
const i = this.generator.next(t).value;
|
|
100
|
+
return V((s) => this.generator.next(s).value, t, i);
|
|
101
|
+
}
|
|
102
|
+
get speed() {
|
|
103
|
+
return this.playbackSpeed;
|
|
104
|
+
}
|
|
105
|
+
set speed(t) {
|
|
106
|
+
const i = this.playbackSpeed !== t;
|
|
107
|
+
i && this.driver && this.updateTime(p.now()), this.playbackSpeed = t, i && this.driver && (this.time = c(this.currentTime));
|
|
108
|
+
}
|
|
109
|
+
play() {
|
|
110
|
+
if (this.isStopped)
|
|
111
|
+
return;
|
|
112
|
+
const { driver: t = I, startTime: i } = this.options;
|
|
113
|
+
this.driver || (this.driver = t((r) => this.tick(r))), this.options.onPlay?.();
|
|
114
|
+
const s = this.driver.now();
|
|
115
|
+
this.state === "finished" ? (this.updateFinished(), this.startTime = s) : this.holdTime !== null ? this.startTime = s - this.holdTime : this.startTime || (this.startTime = i ?? s), this.state === "finished" && this.speed < 0 && (this.startTime += this.calculatedDuration), this.holdTime = null, this.state = "running", this.driver.start();
|
|
116
|
+
}
|
|
117
|
+
pause() {
|
|
118
|
+
this.state = "paused", this.updateTime(p.now()), this.holdTime = this.currentTime;
|
|
119
|
+
}
|
|
120
|
+
complete() {
|
|
121
|
+
this.state !== "running" && this.play(), this.state = "finished", this.holdTime = null;
|
|
122
|
+
}
|
|
123
|
+
finish() {
|
|
124
|
+
this.notifyFinished(), this.teardown(), this.state = "finished", this.options.onComplete?.();
|
|
125
|
+
}
|
|
126
|
+
cancel() {
|
|
127
|
+
this.holdTime = null, this.startTime = 0, this.tick(0), this.teardown(), this.options.onCancel?.();
|
|
128
|
+
}
|
|
129
|
+
teardown() {
|
|
130
|
+
this.state = "idle", this.stopDriver(), this.startTime = this.holdTime = null;
|
|
131
|
+
}
|
|
132
|
+
stopDriver() {
|
|
133
|
+
this.driver && (this.driver.stop(), this.driver = void 0);
|
|
134
|
+
}
|
|
135
|
+
sample(t) {
|
|
136
|
+
return this.startTime = 0, this.tick(t, !0);
|
|
137
|
+
}
|
|
138
|
+
attachTimeline(t) {
|
|
139
|
+
return this.options.allowFlatten && (this.options.type = "keyframes", this.options.ease = "linear", this.initAnimation()), this.driver?.stop(), t.observe(this);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
rt as JSAnimation
|
|
144
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { setStyle as u } from "../render/dom/style-set.js";
|
|
2
|
+
import { supportsScrollTimeline as p } from "../utils/supports/scroll-timeline.js";
|
|
3
|
+
import { getFinalKeyframe as f } from "./keyframes/get-final.js";
|
|
4
|
+
import { WithPromise as d } from "./utils/WithPromise.js";
|
|
5
|
+
import { startWaapiAnimation as c } from "./waapi/start-waapi-animation.js";
|
|
6
|
+
import { applyGeneratorOptions as T } from "./waapi/utils/apply-generator.js";
|
|
7
|
+
import { invariant as y } from "../../../../motion-utils/dist/es/errors.js";
|
|
8
|
+
import { millisecondsToSeconds as a, secondsToMilliseconds as S } from "../../../../motion-utils/dist/es/time-conversion.js";
|
|
9
|
+
import { noop as g } from "../../../../motion-utils/dist/es/noop.js";
|
|
10
|
+
class v extends d {
|
|
11
|
+
constructor(i) {
|
|
12
|
+
if (super(), this.finishedTime = null, this.isStopped = !1, this.manualStartTime = null, !i)
|
|
13
|
+
return;
|
|
14
|
+
const { element: t, name: e, keyframes: n, pseudoElement: s, allowFlatten: r = !1, finalKeyframe: l, onComplete: h } = i;
|
|
15
|
+
this.isPseudoElement = !!s, this.allowFlatten = r, this.options = i, y(typeof i.type != "string", `Mini animate() doesn't support "type" as a string.`, "mini-spring");
|
|
16
|
+
const o = T(i);
|
|
17
|
+
this.animation = c(t, e, n, o, s), o.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
|
|
18
|
+
if (this.finishedTime = this.time, !s) {
|
|
19
|
+
const m = f(n, this.options, l, this.speed);
|
|
20
|
+
this.updateMotionValue && this.updateMotionValue(m), u(t, e, m), this.animation.cancel();
|
|
21
|
+
}
|
|
22
|
+
h?.(), this.notifyFinished();
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
play() {
|
|
26
|
+
this.isStopped || (this.manualStartTime = null, this.animation.play(), this.state === "finished" && this.updateFinished());
|
|
27
|
+
}
|
|
28
|
+
pause() {
|
|
29
|
+
this.animation.pause();
|
|
30
|
+
}
|
|
31
|
+
complete() {
|
|
32
|
+
this.animation.finish?.();
|
|
33
|
+
}
|
|
34
|
+
cancel() {
|
|
35
|
+
try {
|
|
36
|
+
this.animation.cancel();
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
stop() {
|
|
41
|
+
if (this.isStopped)
|
|
42
|
+
return;
|
|
43
|
+
this.isStopped = !0;
|
|
44
|
+
const { state: i } = this;
|
|
45
|
+
i === "idle" || i === "finished" || (this.updateMotionValue ? this.updateMotionValue() : this.commitStyles(), this.isPseudoElement || this.cancel());
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
49
|
+
*
|
|
50
|
+
* In this method, we commit styles back to the DOM before cancelling
|
|
51
|
+
* the animation.
|
|
52
|
+
*
|
|
53
|
+
* This is designed to be overridden by NativeAnimationExtended, which
|
|
54
|
+
* will create a renderless JS animation and sample it twice to calculate
|
|
55
|
+
* its current value, "previous" value, and therefore allow
|
|
56
|
+
* Motion to also correctly calculate velocity for any subsequent animation
|
|
57
|
+
* while deferring the commit until the next animation frame.
|
|
58
|
+
*/
|
|
59
|
+
commitStyles() {
|
|
60
|
+
const i = this.options?.element;
|
|
61
|
+
!this.isPseudoElement && i?.isConnected && this.animation.commitStyles?.();
|
|
62
|
+
}
|
|
63
|
+
get duration() {
|
|
64
|
+
const i = this.animation.effect?.getComputedTiming?.().duration || 0;
|
|
65
|
+
return a(Number(i));
|
|
66
|
+
}
|
|
67
|
+
get iterationDuration() {
|
|
68
|
+
const { delay: i = 0 } = this.options || {};
|
|
69
|
+
return this.duration + a(i);
|
|
70
|
+
}
|
|
71
|
+
get time() {
|
|
72
|
+
return a(Number(this.animation.currentTime) || 0);
|
|
73
|
+
}
|
|
74
|
+
set time(i) {
|
|
75
|
+
const t = this.finishedTime !== null;
|
|
76
|
+
this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = S(i), t && this.animation.pause();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The playback speed of the animation.
|
|
80
|
+
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
81
|
+
*/
|
|
82
|
+
get speed() {
|
|
83
|
+
return this.animation.playbackRate;
|
|
84
|
+
}
|
|
85
|
+
set speed(i) {
|
|
86
|
+
i < 0 && (this.finishedTime = null), this.animation.playbackRate = i;
|
|
87
|
+
}
|
|
88
|
+
get state() {
|
|
89
|
+
return this.finishedTime !== null ? "finished" : this.animation.playState;
|
|
90
|
+
}
|
|
91
|
+
get startTime() {
|
|
92
|
+
return this.manualStartTime ?? Number(this.animation.startTime);
|
|
93
|
+
}
|
|
94
|
+
set startTime(i) {
|
|
95
|
+
this.manualStartTime = this.animation.startTime = i;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Attaches a timeline to the animation, for instance the `ScrollTimeline`.
|
|
99
|
+
*/
|
|
100
|
+
attachTimeline({ timeline: i, rangeStart: t, rangeEnd: e, observe: n }) {
|
|
101
|
+
return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, i && p() ? (this.animation.timeline = i, t && (this.animation.rangeStart = t), e && (this.animation.rangeEnd = e), g) : n(this);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
v as NativeAnimation
|
|
106
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { time as p } from "../frameloop/sync-time.js";
|
|
2
|
+
import { setStyle as c } from "../render/dom/style-set.js";
|
|
3
|
+
import { JSAnimation as f } from "./JSAnimation.js";
|
|
4
|
+
import { NativeAnimation as u } from "./NativeAnimation.js";
|
|
5
|
+
import { replaceTransitionType as d } from "./utils/replace-transition-type.js";
|
|
6
|
+
import { replaceStringEasing as h } from "./waapi/utils/unsupported-easing.js";
|
|
7
|
+
import { clamp as T } from "../../../../motion-utils/dist/es/clamp.js";
|
|
8
|
+
const o = 10;
|
|
9
|
+
class N extends u {
|
|
10
|
+
constructor(t) {
|
|
11
|
+
h(t), d(t), super(t), t.startTime !== void 0 && t.autoplay !== !1 && (this.startTime = t.startTime), this.options = t;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* WAAPI doesn't natively have any interruption capabilities.
|
|
15
|
+
*
|
|
16
|
+
* Rather than read committed styles back out of the DOM, we can
|
|
17
|
+
* create a renderless JS animation and sample it twice to calculate
|
|
18
|
+
* its current value, "previous" value, and therefore allow
|
|
19
|
+
* Motion to calculate velocity for any subsequent animation.
|
|
20
|
+
*/
|
|
21
|
+
updateMotionValue(t) {
|
|
22
|
+
const { motionValue: e, onUpdate: y, onComplete: A, element: m, ...l } = this.options;
|
|
23
|
+
if (!e)
|
|
24
|
+
return;
|
|
25
|
+
if (t !== void 0) {
|
|
26
|
+
e.set(t);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const i = new f({
|
|
30
|
+
...l,
|
|
31
|
+
autoplay: !1
|
|
32
|
+
}), a = Math.max(o, p.now() - this.startTime), n = T(0, o, a - o), r = i.sample(a).value, { name: s } = this.options;
|
|
33
|
+
m && s && c(m, s, r), e.setWithVelocity(i.sample(Math.max(0, a - n)).value, r, n), i.stop();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
N as NativeAnimationExtended
|
|
38
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { animateMotionValue as m } from "../interfaces/motion-value.js";
|
|
2
|
+
import { motionValue as a } from "../../value/index.js";
|
|
3
|
+
import { isMotionValue as r } from "../../value/utils/is-motion-value.js";
|
|
4
|
+
function f(o, i, n) {
|
|
5
|
+
const t = r(o) ? o : a(o);
|
|
6
|
+
return t.start(m("", t, i, n)), t.animation;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as animateSingleValue
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { time as o } from "../../frameloop/sync-time.js";
|
|
2
|
+
import { frameData as e, cancelFrame as a, frame as s } from "../../frameloop/frame.js";
|
|
3
|
+
const n = (m) => {
|
|
4
|
+
const t = ({ timestamp: r }) => m(r);
|
|
5
|
+
return {
|
|
6
|
+
start: (r = !0) => s.update(t, r),
|
|
7
|
+
stop: () => a(t),
|
|
8
|
+
/**
|
|
9
|
+
* If we're processing this frame we can use the
|
|
10
|
+
* framelocked timestamp to keep things in sync.
|
|
11
|
+
*/
|
|
12
|
+
now: () => e.isProcessing ? e.timestamp : o.now()
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
n as frameloopDriver
|
|
17
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { spring as L } from "./spring.js";
|
|
2
|
+
import { getGeneratorVelocity as R } from "./utils/velocity.js";
|
|
3
|
+
function $({ keyframes: v, velocity: B = 0, power: M = 0.8, timeConstant: b = 325, bounceDamping: k = 10, bounceStiffness: F = 500, modifyTarget: l, min: t, max: a, restDelta: f = 0.5, restSpeed: O }) {
|
|
4
|
+
const s = v[0], n = {
|
|
5
|
+
done: !1,
|
|
6
|
+
value: s
|
|
7
|
+
}, C = (e) => t !== void 0 && e < t || a !== void 0 && e > a, D = (e) => t === void 0 ? a : a === void 0 || Math.abs(t - e) < Math.abs(a - e) ? t : a;
|
|
8
|
+
let d = M * B;
|
|
9
|
+
const i = s + d, u = l === void 0 ? i : l(i);
|
|
10
|
+
u !== i && (d = u - s);
|
|
11
|
+
const p = (e) => -d * Math.exp(-e / b), h = (e) => u + p(e), y = (e) => {
|
|
12
|
+
const o = p(e), G = h(e);
|
|
13
|
+
n.done = Math.abs(o) <= f, n.value = n.done ? u : G;
|
|
14
|
+
};
|
|
15
|
+
let r, c;
|
|
16
|
+
const g = (e) => {
|
|
17
|
+
C(n.value) && (r = e, c = L({
|
|
18
|
+
keyframes: [n.value, D(n.value)],
|
|
19
|
+
velocity: R(h, e, n.value),
|
|
20
|
+
// TODO: This should be passing * 1000
|
|
21
|
+
damping: k,
|
|
22
|
+
stiffness: F,
|
|
23
|
+
restDelta: f,
|
|
24
|
+
restSpeed: O
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
return g(0), {
|
|
28
|
+
calculatedDuration: null,
|
|
29
|
+
next: (e) => {
|
|
30
|
+
let o = !1;
|
|
31
|
+
return !c && r === void 0 && (o = !0, y(e), g(e)), r !== void 0 && e >= r ? c.next(e - r) : (!o && y(e), n);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
$ as inertia
|
|
37
|
+
};
|