@code0-tech/pictor 0.9.3 → 0.10.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.
Files changed (291) hide show
  1. package/dist/assets/components/island/Island.style.css +1 -0
  2. package/dist/components/breadcrumb/Breadcrumb.js +7 -7
  3. package/dist/components/button/Button.js +11 -11
  4. package/dist/components/data-table/DataTable.js +15 -15
  5. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
  6. package/dist/components/editor/Editor.js +13 -13
  7. package/dist/components/form/CheckboxInput.js +4 -4
  8. package/dist/components/form/EmailInput.js +9 -9
  9. package/dist/components/form/InputContentEditable.hook.js +11 -11
  10. package/dist/components/form/InputWrapper.js +15 -15
  11. package/dist/components/form/NumberInput.js +9 -9
  12. package/dist/components/form/PasswordInput.js +4 -4
  13. package/dist/components/form/SwitchInput.js +7 -7
  14. package/dist/components/form/TextAreaInput.js +6 -6
  15. package/dist/components/form/TextInput.js +6 -6
  16. package/dist/components/form/useForm.js +2 -2
  17. package/dist/components/fullscreen/FullScreen.js +2 -2
  18. package/dist/components/gantt/GanttGroup.js +15 -15
  19. package/dist/components/island/Island.d.ts +6 -0
  20. package/dist/components/island/Island.hook.d.ts +19 -0
  21. package/dist/components/island/Island.hook.js +58 -0
  22. package/dist/components/island/Island.js +71 -0
  23. package/dist/components/progress/Progress.js +18 -18
  24. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -0
  25. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
  26. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
  27. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
  28. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
  29. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
  30. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
  31. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
  32. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
  33. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
  34. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
  35. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +285 -0
  36. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +22 -0
  37. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +67 -0
  38. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +28 -0
  39. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +21 -0
  40. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -0
  41. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +43 -0
  42. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +29 -0
  43. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +45 -0
  44. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +33 -0
  45. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
  46. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +39 -0
  47. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
  48. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
  49. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +60 -0
  50. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
  51. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +14 -0
  52. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +45 -0
  53. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +21 -0
  54. package/dist/node_modules/framer-motion/dist/es/motion/index.js +62 -0
  55. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
  56. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +21 -0
  57. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +65 -0
  58. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +52 -0
  59. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
  60. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +18 -0
  61. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
  62. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
  63. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +10 -0
  64. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +16 -0
  65. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +21 -0
  66. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +24 -0
  67. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
  68. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +27 -0
  69. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
  70. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
  71. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +22 -0
  72. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
  73. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
  74. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +9 -0
  75. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +4 -0
  76. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
  77. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
  78. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +8 -0
  79. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
  80. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +112 -0
  81. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +144 -0
  82. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +106 -0
  83. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +38 -0
  84. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +10 -0
  85. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
  86. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +37 -0
  87. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +30 -0
  88. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +178 -0
  89. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +13 -0
  90. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -0
  91. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
  92. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
  93. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +46 -0
  94. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +59 -0
  95. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +29 -0
  96. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
  97. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +68 -0
  98. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +74 -0
  99. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +8 -0
  100. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +8 -0
  101. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
  102. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
  103. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +7 -0
  104. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +7 -0
  105. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +16 -0
  106. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +37 -0
  107. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +6 -0
  108. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
  109. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
  110. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +7 -0
  111. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +23 -0
  112. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
  113. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +22 -0
  114. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +8 -0
  115. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +7 -0
  116. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +9 -0
  117. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +21 -0
  118. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +6 -0
  119. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +16 -0
  120. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
  121. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
  122. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +12 -0
  123. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
  124. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +21 -0
  125. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +33 -0
  126. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
  127. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +8 -0
  128. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +10 -0
  129. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +10 -0
  130. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +17 -0
  131. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +6 -0
  132. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -0
  133. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
  134. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
  135. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
  136. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +43 -0
  137. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +15 -0
  138. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
  139. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +11 -0
  140. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +38 -0
  141. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +34 -0
  142. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
  143. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +27 -0
  144. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
  145. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +4 -0
  146. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +4 -0
  147. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +12 -0
  148. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +32 -0
  149. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +25 -0
  150. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +14 -0
  151. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +53 -0
  152. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +38 -0
  153. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +25 -0
  154. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +18 -0
  155. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
  156. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
  157. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +25 -0
  158. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +618 -0
  159. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
  160. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +53 -0
  161. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +21 -0
  162. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +16 -0
  163. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
  164. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +13 -0
  165. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
  166. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
  167. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +19 -0
  168. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
  169. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +13 -0
  170. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +10 -0
  171. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +263 -0
  172. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +28 -0
  173. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
  174. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +65 -0
  175. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
  176. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
  177. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +37 -0
  178. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +29 -0
  179. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +38 -0
  180. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +12 -0
  181. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +13 -0
  182. package/dist/node_modules/motion-dom/dist/es/render/store.js +4 -0
  183. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +40 -0
  184. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +32 -0
  185. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
  186. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
  187. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +15 -0
  188. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +11 -0
  189. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +15 -0
  190. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +143 -0
  191. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +20 -0
  192. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
  193. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
  194. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
  195. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +4 -0
  196. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
  197. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
  198. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +23 -0
  199. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +25 -0
  200. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +15 -0
  201. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +5 -0
  202. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
  203. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +20 -0
  204. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +21 -0
  205. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +14 -0
  206. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +13 -0
  207. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +39 -0
  208. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +23 -0
  209. package/dist/node_modules/motion-dom/dist/es/resize/index.js +8 -0
  210. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +12 -0
  211. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +42 -0
  212. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
  213. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
  214. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
  215. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +29 -0
  216. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +51 -0
  217. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
  218. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +8 -0
  219. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +4 -0
  220. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +8 -0
  221. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +15 -0
  222. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
  223. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
  224. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
  225. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
  226. package/dist/node_modules/motion-dom/dist/es/value/index.js +212 -0
  227. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
  228. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +19 -0
  229. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +22 -0
  230. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +12 -0
  231. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +15 -0
  232. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +16 -0
  233. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +18 -0
  234. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +24 -0
  235. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +51 -0
  236. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -0
  237. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +9 -0
  238. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
  239. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +27 -0
  240. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
  241. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
  242. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +17 -0
  243. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +17 -0
  244. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
  245. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +12 -0
  246. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
  247. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +8 -0
  248. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
  249. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +4 -0
  250. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
  251. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
  252. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
  253. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
  254. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
  255. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +14 -0
  256. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
  257. package/dist/node_modules/motion-utils/dist/es/array.js +11 -0
  258. package/dist/node_modules/motion-utils/dist/es/clamp.js +4 -0
  259. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
  260. package/dist/node_modules/motion-utils/dist/es/easing/back.js +9 -0
  261. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +8 -0
  262. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +19 -0
  263. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +7 -0
  264. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
  265. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
  266. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
  267. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +4 -0
  268. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +32 -0
  269. package/dist/node_modules/motion-utils/dist/es/errors.js +14 -0
  270. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
  271. package/dist/node_modules/motion-utils/dist/es/global-config.js +4 -0
  272. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
  273. package/dist/node_modules/motion-utils/dist/es/is-object.js +4 -0
  274. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
  275. package/dist/node_modules/motion-utils/dist/es/memo.js +8 -0
  276. package/dist/node_modules/motion-utils/dist/es/noop.js +4 -0
  277. package/dist/node_modules/motion-utils/dist/es/pipe.js +4 -0
  278. package/dist/node_modules/motion-utils/dist/es/progress.js +7 -0
  279. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +29 -0
  280. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +5 -0
  281. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
  282. package/dist/node_modules/motion-utils/dist/es/warn-once.js +8 -0
  283. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
  284. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
  285. package/dist/utils/reactiveArrayService.js +4 -4
  286. package/package.json +9 -6
  287. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -25
  288. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +0 -81
  289. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +0 -55
  290. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +0 -32
  291. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +0 -58
@@ -0,0 +1,285 @@
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
+ };
@@ -0,0 +1,22 @@
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
+ };
@@ -0,0 +1,67 @@
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
+ };
@@ -0,0 +1,28 @@
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
+ };
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,130 @@
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
+ };
@@ -0,0 +1,43 @@
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
+ };
@@ -0,0 +1,29 @@
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
+ };
@@ -0,0 +1,45 @@
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
+ };