@code0-tech/pictor 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -12
  2. package/dist/components/alert/Alert.js +19 -20
  3. package/dist/components/aurora/Aurora.js +15 -16
  4. package/dist/components/avatar/Avatar.js +44 -44
  5. package/dist/components/badge/Badge.js +36 -37
  6. package/dist/components/button/Button.js +16 -17
  7. package/dist/components/button-group/ButtonGroup.js +15 -16
  8. package/dist/components/card/Card.js +21 -22
  9. package/dist/components/card/CardSection.js +15 -15
  10. package/dist/components/chart/Chart.js +82 -82
  11. package/dist/components/chart/LineChart.js +50 -51
  12. package/dist/components/col/Col.js +9 -10
  13. package/dist/components/command/Command.js +32 -33
  14. package/dist/components/container/Container.js +9 -10
  15. package/dist/components/context-menu/ContextMenu.js +76 -77
  16. package/dist/components/data-table/DataTableColumn.js +9 -10
  17. package/dist/components/data-table/DataTableFilterInput.js +83 -83
  18. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +26 -27
  19. package/dist/components/data-table/DataTableHeader.js +20 -21
  20. package/dist/components/data-table/DataTablePagination.js +27 -28
  21. package/dist/components/dialog/Dialog.js +61 -62
  22. package/dist/components/file-tabs/FileTabs.js +51 -52
  23. package/dist/components/flex/Flex.js +9 -10
  24. package/dist/components/form/CheckboxInput.js +50 -51
  25. package/dist/components/form/ColorInput.js +242 -242
  26. package/dist/components/form/DateInput.js +55 -55
  27. package/dist/components/form/EditorInput.js +300 -300
  28. package/dist/components/form/FileInput.js +67 -68
  29. package/dist/components/form/InputDescription.js +3 -4
  30. package/dist/components/form/InputLabel.js +9 -10
  31. package/dist/components/form/InputMessage.js +6 -7
  32. package/dist/components/form/InputWrapper.js +37 -38
  33. package/dist/components/form/PasswordInput.js +2 -2
  34. package/dist/components/form/PinInput.js +30 -31
  35. package/dist/components/form/RadioGroup.js +22 -23
  36. package/dist/components/form/RadioInput.js +19 -20
  37. package/dist/components/form/SelectInput.js +55 -56
  38. package/dist/components/form/TagInput.js +44 -44
  39. package/dist/components/fullscreen/FullScreen.js +14 -15
  40. package/dist/components/gantt/Gantt.js +63 -64
  41. package/dist/components/gantt/GanttGroup.js +2 -2
  42. package/dist/components/gantt/GanttHeader.js +40 -41
  43. package/dist/components/gantt/GanttItem.js +11 -12
  44. package/dist/components/icon/Icon.js +22 -22
  45. package/dist/components/json-view/JsonView.js +37 -38
  46. package/dist/components/layout/Layout.js +64 -65
  47. package/dist/components/menu/Menu.js +91 -92
  48. package/dist/components/quote/Quote.js +29 -30
  49. package/dist/components/resizable/Resizable.js +22 -23
  50. package/dist/components/row/Row.js +9 -10
  51. package/dist/components/scroll-area/ScrollArea.js +46 -47
  52. package/dist/components/segmented-control/SegmentedControl.js +35 -35
  53. package/dist/components/spacing/Spacing.js +8 -9
  54. package/dist/components/tab/Tab.js +53 -53
  55. package/dist/components/text/Text.js +9 -10
  56. package/dist/components/toast/Toast.js +47 -47
  57. package/dist/components/tooltip/Tooltip.js +35 -36
  58. package/dist/utils/contextStore.js +31 -32
  59. package/dist/utils/motion.js +39 -40
  60. package/package.json +4 -4
  61. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +0 -6
  62. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
  63. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -51
  64. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -58
  65. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -18
  66. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -9
  67. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -4
  68. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -4
  69. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -8
  70. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -15
  71. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -4
  72. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -13
  73. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -4
  74. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -4
  75. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -6
  76. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -9
  77. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -256
  78. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -20
  79. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -57
  80. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -25
  81. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -18
  82. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -136
  83. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -40
  84. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -24
  85. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -37
  86. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -23
  87. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -7
  88. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -49
  89. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -13
  90. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -11
  91. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -59
  92. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -7
  93. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -11
  94. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
  95. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -22
  96. package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -68
  97. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -2
  98. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -19
  99. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -56
  100. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -48
  101. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -5
  102. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -8
  103. package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +0 -3
  104. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -11
  105. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -5
  106. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -6
  107. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -19
  108. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -17
  109. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -5
  110. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -9
  111. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -24
  112. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -7
  113. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -28
  114. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
  115. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -9
  116. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -6
  117. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -6
  118. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -2
  119. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -2
  120. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -4
  121. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -11
  122. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -23
  123. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -7
  124. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -5
  125. package/dist/node_modules/motion/dist/es/react.js +0 -196
  126. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -105
  127. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -127
  128. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -82
  129. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -26
  130. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -8
  131. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -11
  132. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -30
  133. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -20
  134. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +0 -164
  135. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -7
  136. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -14
  137. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -4
  138. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -7
  139. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -43
  140. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -54
  141. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -24
  142. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -19
  143. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -59
  144. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -65
  145. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -6
  146. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -6
  147. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -10
  148. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -4
  149. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -4
  150. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -5
  151. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
  152. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -34
  153. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -3
  154. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -5
  155. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -20
  156. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -5
  157. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -16
  158. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -23
  159. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -25
  160. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
  161. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -3
  162. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -5
  163. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -17
  164. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -4
  165. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -14
  166. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +0 -11
  167. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -2
  168. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -9
  169. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -33
  170. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -17
  171. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -22
  172. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +0 -8
  173. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -6
  174. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +0 -6
  175. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -6
  176. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -15
  177. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -4
  178. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -28
  179. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -4
  180. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -3
  181. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -11
  182. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -30
  183. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -13
  184. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -8
  185. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -9
  186. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -34
  187. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -34
  188. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -19
  189. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -26
  190. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -2
  191. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -2
  192. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -2
  193. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -14
  194. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -23
  195. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -37
  196. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -10
  197. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -41
  198. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -28
  199. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -27
  200. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -16
  201. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -26
  202. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -11
  203. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -20
  204. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -580
  205. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -5
  206. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -49
  207. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -11
  208. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -11
  209. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -15
  210. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -10
  211. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -2
  212. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -4
  213. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -17
  214. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -16
  215. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -10
  216. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -7
  217. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -201
  218. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -26
  219. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -2
  220. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -54
  221. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -5
  222. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -4
  223. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -37
  224. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -26
  225. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -34
  226. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -6
  227. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -9
  228. package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -2
  229. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -38
  230. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -20
  231. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -26
  232. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -2
  233. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -13
  234. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -7
  235. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -12
  236. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -133
  237. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -17
  238. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -4
  239. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -10
  240. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -6
  241. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -2
  242. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -4
  243. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -11
  244. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -20
  245. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -19
  246. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -9
  247. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -2
  248. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -6
  249. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -18
  250. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -17
  251. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -8
  252. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -10
  253. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +0 -35
  254. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +0 -20
  255. package/dist/node_modules/motion-dom/dist/es/resize/index.js +0 -6
  256. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +0 -5
  257. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +0 -7
  258. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -10
  259. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -31
  260. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -5
  261. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -5
  262. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -5
  263. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -28
  264. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -50
  265. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -4
  266. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -6
  267. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -2
  268. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -5
  269. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -12
  270. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -2
  271. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -10
  272. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -7
  273. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -3
  274. package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -90
  275. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -5
  276. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -17
  277. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -19
  278. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -10
  279. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -13
  280. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -13
  281. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -14
  282. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
  283. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -50
  284. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +0 -12
  285. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -14
  286. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -6
  287. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -22
  288. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -62
  289. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -30
  290. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -13
  291. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -10
  292. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -2
  293. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -10
  294. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -2
  295. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -10
  296. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -2
  297. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -2
  298. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -4
  299. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -2
  300. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -2
  301. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -2
  302. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -5
  303. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -11
  304. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -5
  305. package/dist/node_modules/motion-utils/dist/es/array.js +0 -8
  306. package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -2
  307. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -3
  308. package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -5
  309. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -4
  310. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -16
  311. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -3
  312. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -2
  313. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -2
  314. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -2
  315. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -2
  316. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -29
  317. package/dist/node_modules/motion-utils/dist/es/errors.js +0 -8
  318. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -4
  319. package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -2
  320. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -2
  321. package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -2
  322. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -2
  323. package/dist/node_modules/motion-utils/dist/es/memo.js +0 -6
  324. package/dist/node_modules/motion-utils/dist/es/noop.js +0 -2
  325. package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -2
  326. package/dist/node_modules/motion-utils/dist/es/progress.js +0 -5
  327. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -24
  328. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -2
  329. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -2
  330. package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -6
  331. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +0 -21
  332. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +0 -18
  333. package/dist/node_modules/react/compiler-runtime.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -67,8 +67,8 @@
67
67
  "@uiw/react-codemirror": "^4.25.10",
68
68
  "@uiw/react-json-view": "^2.0.0-alpha.43",
69
69
  "@vitejs/plugin-react": "^5.2.0",
70
- "@vitest/browser-playwright": "^4.1.11",
71
- "@vitest/coverage-v8": "^4.1.11",
70
+ "@vitest/browser-playwright": "^4.1.12",
71
+ "@vitest/coverage-v8": "^4.1.12",
72
72
  "avvvatars-react": "^0.4.2",
73
73
  "axe-playwright": "^2.2.2",
74
74
  "babel-loader": "^10.1.1",
@@ -104,7 +104,7 @@
104
104
  "vite-plugin-dts": "^4.5.4",
105
105
  "vite-plugin-lib-inject-css": "^2.2.2",
106
106
  "vite-plugin-svgr": "^5.2.0",
107
- "vitest": "^4.1.11",
107
+ "vitest": "^4.1.12",
108
108
  "zustand": "^5.0.16",
109
109
  "recharts": "^3.10.1"
110
110
  },
@@ -1,6 +0,0 @@
1
- import { __esmMin, __export } from "../rolldown_runtime.js";
2
- var is_prop_valid_framer_motion_exports = /* @__PURE__ */ __export({ default: () => is_prop_valid_framer_motion_default }, 1), is_prop_valid_framer_motion_default, init_is_prop_valid_framer_motion = __esmMin((() => {
3
- throw is_prop_valid_framer_motion_default = {}, Error("Could not resolve \"@emotion/is-prop-valid\" imported by \"framer-motion\". Is it installed?");
4
- }));
5
- init_is_prop_valid_framer_motion();
6
- export { init_is_prop_valid_framer_motion, is_prop_valid_framer_motion_exports };
@@ -1,59 +0,0 @@
1
- "use client";
2
- import { isHTMLElement } from "../../../../../motion-dom/dist/es/utils/is-html-element.js";
3
- import { MotionConfigContext } from "../../context/MotionConfigContext.js";
4
- import { useComposedRefs } from "../../utils/use-composed-ref.js";
5
- import * as React$1 from "react";
6
- import { useContext, useId, useInsertionEffect, useRef } from "react";
7
- import { jsx } from "react/jsx-runtime";
8
- var PopChildMeasure = class extends React$1.Component {
9
- getSnapshotBeforeUpdate(t) {
10
- let n = this.props.childRef.current;
11
- if (isHTMLElement(n) && t.isPresent && !this.props.isPresent && this.props.pop !== !1) {
12
- let t = n.offsetParent, r = isHTMLElement(t) && t.offsetWidth || 0, i = isHTMLElement(t) && t.offsetHeight || 0, a = getComputedStyle(n), o = this.props.sizeRef.current;
13
- o.height = parseFloat(a.height), o.width = parseFloat(a.width), o.top = n.offsetTop, o.left = n.offsetLeft, o.right = r - o.width - o.left, o.bottom = i - o.height - o.top, o.direction = a.direction;
14
- }
15
- return null;
16
- }
17
- componentDidUpdate() {}
18
- render() {
19
- return this.props.children;
20
- }
21
- };
22
- function PopChild({ children: e, isPresent: u, anchorX: d, anchorY: f, root: p, pop: m }) {
23
- let h = useId(), g = useRef(null), _ = useRef({
24
- width: 0,
25
- height: 0,
26
- top: 0,
27
- left: 0,
28
- right: 0,
29
- bottom: 0,
30
- direction: "ltr"
31
- }), { nonce: v } = useContext(MotionConfigContext), y = useComposedRefs(g, m === !1 ? void 0 : e.props?.ref ?? e?.ref);
32
- return useInsertionEffect(() => {
33
- let { width: e, height: t, top: n, left: r, right: i, bottom: a, direction: o } = _.current;
34
- if (u || m === !1 || !g.current || !e || !t) return;
35
- let s = o === "rtl", c = d === "left" ? s ? `right: ${i}` : `left: ${r}` : s ? `left: ${r}` : `right: ${i}`, l = f === "bottom" ? `bottom: ${a}` : `top: ${n}`;
36
- g.current.dataset.motionPopId = h;
37
- let y = document.createElement("style");
38
- v && (y.nonce = v);
39
- let b = p ?? document.head;
40
- return b.appendChild(y), y.sheet && y.sheet.insertRule(`
41
- [data-motion-pop-id="${h}"] {
42
- position: absolute !important;
43
- width: ${e}px !important;
44
- height: ${t}px !important;
45
- ${c}px !important;
46
- ${l}px !important;
47
- }
48
- `), () => {
49
- g.current?.removeAttribute("data-motion-pop-id"), b.contains(y) && b.removeChild(y);
50
- };
51
- }, [u]), jsx(PopChildMeasure, {
52
- isPresent: u,
53
- childRef: g,
54
- sizeRef: _,
55
- pop: m,
56
- children: m === !1 ? e : React$1.cloneElement(e, { ref: y })
57
- });
58
- }
59
- export { PopChild };
@@ -1,51 +0,0 @@
1
- "use client";
2
- import { useConstant } from "../../utils/use-constant.js";
3
- import { useIsomorphicLayoutEffect } from "../../utils/use-isomorphic-effect.js";
4
- import { PresenceContext } from "../../context/PresenceContext.js";
5
- import { PopChild } from "./PopChild.js";
6
- import * as React$1 from "react";
7
- import { useId, useMemo, useRef } from "react";
8
- import { jsx } from "react/jsx-runtime";
9
- var PresenceChild = ({ children: u, initial: d, isPresent: f, onExitComplete: p, custom: m, presenceAffectsLayout: h, mode: g, anchorX: _, anchorY: v, root: y }) => {
10
- let b = useConstant(newChildrenMap), x = useId(), S = useRef(f), C = useRef(p);
11
- useIsomorphicLayoutEffect(() => {
12
- S.current = f, C.current = p;
13
- });
14
- let w = !0, T = useMemo(() => (w = !1, {
15
- id: x,
16
- initial: d,
17
- isPresent: f,
18
- custom: m,
19
- onExitComplete: (e) => {
20
- b.set(e, !0);
21
- for (let e of b.values()) if (!e) return;
22
- p && p();
23
- },
24
- register: (e) => (b.set(e, !1), () => {
25
- b.delete(e), !S.current && !b.size && C.current?.();
26
- })
27
- }), [
28
- f,
29
- b,
30
- p
31
- ]);
32
- return h && w && (T = { ...T }), useMemo(() => {
33
- b.forEach((e, l) => b.set(l, !1));
34
- }, [f]), React$1.useEffect(() => {
35
- !f && !b.size && p && p();
36
- }, [f]), u = jsx(PopChild, {
37
- pop: g === "popLayout",
38
- isPresent: f,
39
- anchorX: _,
40
- anchorY: v,
41
- root: y,
42
- children: u
43
- }), jsx(PresenceContext.Provider, {
44
- value: T,
45
- children: u
46
- });
47
- };
48
- function newChildrenMap() {
49
- return /* @__PURE__ */ new Map();
50
- }
51
- export { PresenceChild };
@@ -1,58 +0,0 @@
1
- "use client";
2
- import { LayoutGroupContext } from "../../context/LayoutGroupContext.js";
3
- import { useConstant } from "../../utils/use-constant.js";
4
- import { useIsomorphicLayoutEffect } from "../../utils/use-isomorphic-effect.js";
5
- import { PresenceChild } from "./PresenceChild.js";
6
- import { usePresence } from "./use-presence.js";
7
- import { getChildKey, onlyElements } from "./utils.js";
8
- import { useContext, useMemo, useRef, useState } from "react";
9
- import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
10
- var AnimatePresence = ({ children: p, custom: m, initial: h = !0, onExitComplete: g, presenceAffectsLayout: _ = !0, mode: v = "sync", propagate: y = !1, anchorX: b = "left", anchorY: x = "top", root: S }) => {
11
- let [C, w] = usePresence(y), T = useMemo(() => onlyElements(p), [p]), E = y && !C ? [] : T.map(getChildKey), D = useRef(!0), O = useRef(T), k = useConstant(() => /* @__PURE__ */ new Map()), A = useRef(/* @__PURE__ */ new Set()), [j, M] = useState(T), [N, P] = useState(T);
12
- useIsomorphicLayoutEffect(() => {
13
- D.current = !1, O.current = T;
14
- for (let e = 0; e < N.length; e++) {
15
- let u = getChildKey(N[e]);
16
- E.includes(u) ? (k.delete(u), A.current.delete(u)) : k.get(u) !== !0 && k.set(u, !1);
17
- }
18
- }, [
19
- N,
20
- E.length,
21
- E.join("-")
22
- ]);
23
- let F = [];
24
- if (T !== j) {
25
- let e = [...T];
26
- for (let u = 0; u < N.length; u++) {
27
- let d = N[u], f = getChildKey(d);
28
- E.includes(f) || (e.splice(u, 0, d), F.push(d));
29
- }
30
- return v === "wait" && F.length && (e = F), P(onlyElements(e)), M(T), null;
31
- }
32
- process.env.NODE_ENV !== "production" && v === "wait" && N.length > 1 && console.warn("You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.");
33
- let { forceRender: I } = useContext(LayoutGroupContext);
34
- return jsx(Fragment$1, { children: N.map((e) => {
35
- let u = getChildKey(e), d = y && !C ? !1 : T === N || E.includes(u);
36
- return jsx(PresenceChild, {
37
- isPresent: d,
38
- initial: !D.current || h ? void 0 : !1,
39
- custom: m,
40
- presenceAffectsLayout: _,
41
- mode: v,
42
- root: S,
43
- onExitComplete: d ? void 0 : () => {
44
- if (A.current.has(u)) return;
45
- if (k.has(u)) A.current.add(u), k.set(u, !0);
46
- else return;
47
- let e = !0;
48
- k.forEach((u) => {
49
- u || (e = !1);
50
- }), e && (I?.(), P(O.current), y && w?.(), g && g());
51
- },
52
- anchorX: b,
53
- anchorY: x,
54
- children: e
55
- }, u);
56
- }) });
57
- };
58
- export { AnimatePresence };
@@ -1,18 +0,0 @@
1
- "use client";
2
- import { PresenceContext } from "../../context/PresenceContext.js";
3
- import { useCallback, useContext, useEffect, useId } from "react";
4
- function usePresence(a = !0) {
5
- let o = useContext(PresenceContext);
6
- if (o === null) return [!0, null];
7
- let { isPresent: s, onExitComplete: c, register: l } = o, u = useId();
8
- useEffect(() => {
9
- if (a) return l(u);
10
- }, [a]);
11
- let d = useCallback(() => a && c && c(u), [
12
- u,
13
- c,
14
- a
15
- ]);
16
- return !s && c ? [!1, d] : [!0];
17
- }
18
- export { usePresence };
@@ -1,9 +0,0 @@
1
- import { Children, isValidElement } from "react";
2
- var getChildKey = (e) => e.key || "";
3
- function onlyElements(n) {
4
- let r = [];
5
- return Children.forEach(n, (e) => {
6
- isValidElement(e) && r.push(e);
7
- }), r;
8
- }
9
- export { getChildKey, onlyElements };
@@ -1,4 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var LayoutGroupContext = createContext({});
4
- export { LayoutGroupContext };
@@ -1,4 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var LazyContext = createContext({ strict: !1 });
4
- export { LazyContext };
@@ -1,8 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var MotionConfigContext = createContext({
4
- transformPagePoint: (e) => e,
5
- isStatic: !1,
6
- reducedMotion: "never"
7
- });
8
- export { MotionConfigContext };
@@ -1,15 +0,0 @@
1
- "use client";
2
- import { MotionContext } from "./index.js";
3
- import { getCurrentTreeVariants } from "./utils.js";
4
- import { useContext, useMemo } from "react";
5
- function useCreateMotionContext(a) {
6
- let { initial: o, animate: s } = getCurrentTreeVariants(a, useContext(MotionContext));
7
- return useMemo(() => ({
8
- initial: o,
9
- animate: s
10
- }), [variantLabelsAsDependency(o), variantLabelsAsDependency(s)]);
11
- }
12
- function variantLabelsAsDependency(e) {
13
- return Array.isArray(e) ? e.join(" ") : e;
14
- }
15
- export { useCreateMotionContext };
@@ -1,4 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var MotionContext = /* @__PURE__ */ createContext({});
4
- export { MotionContext };
@@ -1,13 +0,0 @@
1
- import { isVariantLabel } from "../../../../../motion-dom/dist/es/render/utils/is-variant-label.js";
2
- import { isControllingVariants } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
3
- function getCurrentTreeVariants(n, r) {
4
- if (isControllingVariants(n)) {
5
- let { initial: t, animate: r } = n;
6
- return {
7
- initial: t === !1 || isVariantLabel(t) ? t : void 0,
8
- animate: isVariantLabel(r) ? r : void 0
9
- };
10
- }
11
- return n.inherit === !1 ? {} : r;
12
- }
13
- export { getCurrentTreeVariants };
@@ -1,4 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var PresenceContext = /* @__PURE__ */ createContext(null);
4
- export { PresenceContext };
@@ -1,4 +0,0 @@
1
- "use client";
2
- import { createContext } from "react";
3
- var SwitchLayoutGroupContext = createContext({});
4
- export { SwitchLayoutGroupContext };
@@ -1,6 +0,0 @@
1
- import { addDomEvent } from "../../../../motion-dom/dist/es/events/add-dom-event.js";
2
- import { addPointerInfo } from "./event-info.js";
3
- function addPointerEvent(n, r, i, a) {
4
- return addDomEvent(n, r, addPointerInfo(i), a);
5
- }
6
- export { addPointerEvent };
@@ -1,9 +0,0 @@
1
- import { isPrimaryPointer } from "../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
2
- function extractEventInfo(e) {
3
- return { point: {
4
- x: e.pageX,
5
- y: e.pageY
6
- } };
7
- }
8
- var addPointerInfo = (n) => (r) => isPrimaryPointer(r) && n(r, extractEventInfo(r));
9
- export { addPointerInfo, extractEventInfo };
@@ -1,256 +0,0 @@
1
- import { invariant } from "../../../../../motion-utils/dist/es/errors.js";
2
- import { frame } from "../../../../../motion-dom/dist/es/frameloop/frame.js";
3
- import { percent } from "../../../../../motion-dom/dist/es/value/types/numbers/units.js";
4
- import { mixNumber } from "../../../../../motion-dom/dist/es/utils/mix/number.js";
5
- import { animateMotionValue } from "../../../../../motion-dom/dist/es/animation/interfaces/motion-value.js";
6
- import { addValueToWillChange } from "../../../../../motion-dom/dist/es/value/will-change/add-will-change.js";
7
- import { setDragLock } from "../../../../../motion-dom/dist/es/gestures/drag/state/set-active.js";
8
- import { isElementTextInput } from "../../../../../motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js";
9
- import { resize } from "../../../../../motion-dom/dist/es/resize/index.js";
10
- import { createBox } from "../../../../../motion-dom/dist/es/projection/geometry/models.js";
11
- import { convertBoundingBoxToBox, convertBoxToBoundingBox } from "../../../../../motion-dom/dist/es/projection/geometry/conversion.js";
12
- import { measurePageBox } from "../../../../../motion-dom/dist/es/projection/utils/measure.js";
13
- import { calcLength } from "../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
14
- import { eachAxis } from "../../../../../motion-dom/dist/es/projection/utils/each-axis.js";
15
- import { addDomEvent } from "../../../../../motion-dom/dist/es/events/add-dom-event.js";
16
- import { isRefObject } from "../../utils/is-ref-object.js";
17
- import { extractEventInfo } from "../../events/event-info.js";
18
- import { addPointerEvent } from "../../events/add-pointer-event.js";
19
- import { getContextWindow } from "../../utils/get-context-window.js";
20
- import { PanSession } from "../pan/PanSession.js";
21
- import { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic } from "./utils/constraints.js";
22
- var elementDragControls = /* @__PURE__ */ new WeakMap(), VisualElementDragControls = class {
23
- constructor(i) {
24
- this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = {
25
- x: 0,
26
- y: 0
27
- }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = createBox(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = i;
28
- }
29
- start(i, { snapToCursor: C = !1, distanceThreshold: w } = {}) {
30
- let { presenceContext: D } = this.visualElement;
31
- if (D && D.isPresent === !1) return;
32
- let O = (i) => {
33
- C && this.snapToCursor(extractEventInfo(i).point), this.stopAnimation();
34
- }, k = (i, C) => {
35
- let { drag: w, dragPropagation: D, onDragStart: O } = this.getProps();
36
- if (w && !D && (this.openDragLock && this.openDragLock(), this.openDragLock = setDragLock(w), !this.openDragLock)) return;
37
- this.latestPointerEvent = i, this.latestPanInfo = C, this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), eachAxis((i) => {
38
- let x = this.getAxisMotionValue(i).get() || 0;
39
- if (percent.test(x)) {
40
- let { projection: S } = this.visualElement;
41
- if (S && S.layout) {
42
- let C = S.layout.layoutBox[i];
43
- C && (x = calcLength(C) * (parseFloat(x) / 100));
44
- }
45
- }
46
- this.originPoint[i] = x;
47
- }), O && frame.update(() => O(i, C), !1, !0), addValueToWillChange(this.visualElement, "transform");
48
- let { animationState: k } = this.visualElement;
49
- k && k.setActive("whileDrag", !0);
50
- }, A = (i, S) => {
51
- this.latestPointerEvent = i, this.latestPanInfo = S;
52
- let { dragPropagation: C, dragDirectionLock: w, onDirectionLock: T, onDrag: E } = this.getProps();
53
- if (!C && !this.openDragLock) return;
54
- let { offset: D } = S;
55
- if (w && this.currentDirection === null) {
56
- this.currentDirection = getCurrentDirection(D), this.currentDirection !== null && T && T(this.currentDirection);
57
- return;
58
- }
59
- this.updateAxis("x", S.point, D), this.updateAxis("y", S.point, D), this.visualElement.render(), E && frame.update(() => E(i, S), !1, !0);
60
- }, j = (i, x) => {
61
- this.latestPointerEvent = i, this.latestPanInfo = x, this.stop(i, x), this.latestPointerEvent = null, this.latestPanInfo = null;
62
- }, M = () => {
63
- let { dragSnapToOrigin: i } = this.getProps();
64
- (i || this.constraints) && this.startAnimation({
65
- x: 0,
66
- y: 0
67
- });
68
- }, { dragSnapToOrigin: N } = this.getProps();
69
- this.panSession = new PanSession(i, {
70
- onSessionStart: O,
71
- onStart: k,
72
- onMove: A,
73
- onSessionEnd: j,
74
- resumeAnimation: M
75
- }, {
76
- transformPagePoint: this.visualElement.getTransformPagePoint(),
77
- dragSnapToOrigin: N,
78
- distanceThreshold: w,
79
- contextWindow: getContextWindow(this.visualElement),
80
- element: this.visualElement.current
81
- });
82
- }
83
- stop(i, S) {
84
- let C = i || this.latestPointerEvent, w = S || this.latestPanInfo, T = this.isDragging;
85
- if (this.cancel(), !T || !w || !C) return;
86
- let { velocity: E } = w;
87
- this.startAnimation(E);
88
- let { onDragEnd: D } = this.getProps();
89
- D && frame.postRender(() => D(C, w));
90
- }
91
- cancel() {
92
- this.isDragging = !1;
93
- let { projection: i, animationState: x } = this.visualElement;
94
- i && (i.isAnimationBlocked = !1), this.endPanSession();
95
- let { dragPropagation: S } = this.getProps();
96
- !S && this.openDragLock && (this.openDragLock(), this.openDragLock = null), x && x.setActive("whileDrag", !1);
97
- }
98
- endPanSession() {
99
- this.panSession && this.panSession.end(), this.panSession = void 0;
100
- }
101
- updateAxis(i, x, S) {
102
- let { drag: C } = this.getProps();
103
- if (!S || !shouldDrag(i, C, this.currentDirection)) return;
104
- let w = this.getAxisMotionValue(i), T = this.originPoint[i] + S[i];
105
- this.constraints && this.constraints[i] && (T = applyConstraints(T, this.constraints[i], this.elastic[i])), w.set(T);
106
- }
107
- resolveConstraints() {
108
- let { dragConstraints: i, dragElastic: x } = this.getProps(), S = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : this.visualElement.projection?.layout, C = this.constraints;
109
- i && isRefObject(i) ? this.constraints ||= this.resolveRefConstraints() : i && S ? this.constraints = calcRelativeConstraints(S.layoutBox, i) : this.constraints = !1, this.elastic = resolveDragElastic(x), C !== this.constraints && !isRefObject(i) && S && this.constraints && !this.hasMutatedConstraints && eachAxis((i) => {
110
- this.constraints !== !1 && this.getAxisMotionValue(i) && (this.constraints[i] = rebaseAxisConstraints(S.layoutBox[i], this.constraints[i]));
111
- });
112
- }
113
- resolveRefConstraints() {
114
- let { dragConstraints: x, onMeasureDragConstraints: S } = this.getProps();
115
- if (!x || !isRefObject(x)) return !1;
116
- let C = x.current;
117
- invariant(C !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
118
- let { projection: w } = this.visualElement;
119
- if (!w || !w.layout) return !1;
120
- w.root && (w.root.scroll = void 0, w.root.updateScroll());
121
- let T = measurePageBox(C, w.root, this.visualElement.getTransformPagePoint()), E = calcViewportConstraints(w.layout.layoutBox, T);
122
- if (S) {
123
- let i = S(convertBoxToBoundingBox(E));
124
- this.hasMutatedConstraints = !!i, i && (E = convertBoundingBoxToBox(i));
125
- }
126
- return E;
127
- }
128
- startAnimation(i) {
129
- let { drag: x, dragMomentum: S, dragElastic: C, dragTransition: w, dragSnapToOrigin: T, onDragTransitionEnd: E } = this.getProps(), D = this.constraints || {}, O = eachAxis((E) => {
130
- if (!shouldDrag(E, x, this.currentDirection)) return;
131
- let O = D && D[E] || {};
132
- (T === !0 || T === E) && (O = {
133
- min: 0,
134
- max: 0
135
- });
136
- let k = C ? 200 : 1e6, A = C ? 40 : 1e7, j = {
137
- type: "inertia",
138
- velocity: S ? i[E] : 0,
139
- bounceStiffness: k,
140
- bounceDamping: A,
141
- timeConstant: 750,
142
- restDelta: 1,
143
- restSpeed: 10,
144
- ...w,
145
- ...O
146
- };
147
- return this.startAxisValueAnimation(E, j);
148
- });
149
- return Promise.all(O).then(E);
150
- }
151
- startAxisValueAnimation(i, x) {
152
- let S = this.getAxisMotionValue(i);
153
- return addValueToWillChange(this.visualElement, i), S.start(animateMotionValue(i, S, 0, x, this.visualElement, !1));
154
- }
155
- stopAnimation() {
156
- eachAxis((i) => this.getAxisMotionValue(i).stop());
157
- }
158
- getAxisMotionValue(i) {
159
- let x = `_drag${i.toUpperCase()}`;
160
- return this.visualElement.getProps()[x] || this.visualElement.getValue(i, this.visualElement.latestValues[i] ?? 0);
161
- }
162
- snapToCursor(i) {
163
- eachAxis((x) => {
164
- let { drag: S } = this.getProps();
165
- if (!shouldDrag(x, S, this.currentDirection)) return;
166
- let { projection: w } = this.visualElement, T = this.getAxisMotionValue(x);
167
- if (w && w.layout) {
168
- let { min: S, max: E } = w.layout.layoutBox[x], D = T.get() || 0;
169
- T.set(i[x] - mixNumber(S, E, .5) + D);
170
- }
171
- });
172
- }
173
- scalePositionWithinConstraints() {
174
- if (!this.visualElement.current) return;
175
- let { drag: i, dragConstraints: x } = this.getProps(), { projection: S } = this.visualElement;
176
- if (!isRefObject(x) || !S || !this.constraints) return;
177
- this.stopAnimation();
178
- let w = {
179
- x: 0,
180
- y: 0
181
- };
182
- eachAxis((i) => {
183
- let x = this.getAxisMotionValue(i);
184
- if (x && this.constraints !== !1) {
185
- let S = x.get();
186
- w[i] = calcOrigin({
187
- min: S,
188
- max: S
189
- }, this.constraints[i]);
190
- }
191
- });
192
- let { transformTemplate: T } = this.visualElement.getProps();
193
- this.visualElement.current.style.transform = T ? T({}, "") : "none", S.root && S.root.updateScroll(), S.updateLayout(), this.constraints = !1, this.resolveConstraints(), eachAxis((x) => {
194
- if (!shouldDrag(x, i, null)) return;
195
- let S = this.getAxisMotionValue(x), { min: T, max: E } = this.constraints[x];
196
- S.set(mixNumber(T, E, w[x]));
197
- }), this.visualElement.render();
198
- }
199
- addListeners() {
200
- if (!this.visualElement.current) return;
201
- elementDragControls.set(this.visualElement, this);
202
- let i = this.visualElement.current, S = addPointerEvent(i, "pointerdown", (x) => {
203
- let { drag: S, dragListener: C = !0 } = this.getProps(), w = x.target, T = w !== i && isElementTextInput(w);
204
- S && C && !T && this.start(x);
205
- }), C, w = () => {
206
- let { dragConstraints: x } = this.getProps();
207
- isRefObject(x) && x.current && (this.constraints = this.resolveRefConstraints(), C ||= startResizeObservers(i, x.current, () => this.scalePositionWithinConstraints()));
208
- }, { projection: T } = this.visualElement, E = T.addEventListener("measure", w);
209
- T && !T.layout && (T.root && T.root.updateScroll(), T.updateLayout()), frame.read(w);
210
- let O = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()), k = T.addEventListener("didUpdate", (({ delta: i, hasLayoutChanged: x }) => {
211
- this.isDragging && x && (eachAxis((x) => {
212
- let S = this.getAxisMotionValue(x);
213
- S && (this.originPoint[x] += i[x].translate, S.set(S.get() + i[x].translate));
214
- }), this.visualElement.render());
215
- }));
216
- return () => {
217
- O(), S(), E(), k && k(), C && C();
218
- };
219
- }
220
- getProps() {
221
- let i = this.visualElement.getProps(), { drag: x = !1, dragDirectionLock: S = !1, dragPropagation: C = !1, dragConstraints: w = !1, dragElastic: T = defaultElastic, dragMomentum: E = !0 } = i;
222
- return {
223
- ...i,
224
- drag: x,
225
- dragDirectionLock: S,
226
- dragPropagation: C,
227
- dragConstraints: w,
228
- dragElastic: T,
229
- dragMomentum: E
230
- };
231
- }
232
- };
233
- function skipFirstCall(i) {
234
- let x = !0;
235
- return () => {
236
- if (x) {
237
- x = !1;
238
- return;
239
- }
240
- i();
241
- };
242
- }
243
- function startResizeObservers(i, x, S) {
244
- let C = resize(i, skipFirstCall(S)), w = resize(x, skipFirstCall(S));
245
- return () => {
246
- C(), w();
247
- };
248
- }
249
- function shouldDrag(i, x, S) {
250
- return (x === !0 || x === i) && (S === null || S === i);
251
- }
252
- function getCurrentDirection(i, x = 10) {
253
- let S = null;
254
- return Math.abs(i.y) > x ? S = "y" : Math.abs(i.x) > x && (S = "x"), S;
255
- }
256
- export { VisualElementDragControls };
@@ -1,20 +0,0 @@
1
- import { noop } from "../../../../../motion-utils/dist/es/noop.js";
2
- import { Feature } from "../../../../../motion-dom/dist/es/render/Feature.js";
3
- import { VisualElementDragControls } from "./VisualElementDragControls.js";
4
- var DragGesture = class extends Feature {
5
- constructor(r) {
6
- super(r), this.removeGroupControls = noop, this.removeListeners = noop, this.controls = new VisualElementDragControls(r);
7
- }
8
- mount() {
9
- let { dragControls: r } = this.node.getProps();
10
- r && (this.removeGroupControls = r.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || noop;
11
- }
12
- update() {
13
- let { dragControls: e } = this.node.getProps(), { dragControls: r } = this.node.prevProps || {};
14
- e !== r && (this.removeGroupControls(), e && (this.removeGroupControls = e.subscribe(this.controls)));
15
- }
16
- unmount() {
17
- this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
18
- }
19
- };
20
- export { DragGesture };
@@ -1,57 +0,0 @@
1
- import { clamp } from "../../../../../../motion-utils/dist/es/clamp.js";
2
- import { progress } from "../../../../../../motion-utils/dist/es/progress.js";
3
- import { mixNumber } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
4
- import { calcLength } from "../../../../../../motion-dom/dist/es/projection/geometry/delta-calc.js";
5
- function applyConstraints(e, { min: c, max: u }, d) {
6
- return c !== void 0 && e < c ? e = d ? mixNumber(c, e, d.min) : Math.max(e, c) : u !== void 0 && e > u && (e = d ? mixNumber(u, e, d.max) : Math.min(e, u)), e;
7
- }
8
- function calcRelativeAxisConstraints(e, c, l) {
9
- return {
10
- min: c === void 0 ? void 0 : e.min + c,
11
- max: l === void 0 ? void 0 : e.max + l - (e.max - e.min)
12
- };
13
- }
14
- function calcRelativeConstraints(e, { top: c, left: l, bottom: u, right: d }) {
15
- return {
16
- x: calcRelativeAxisConstraints(e.x, l, d),
17
- y: calcRelativeAxisConstraints(e.y, c, u)
18
- };
19
- }
20
- function calcViewportAxisConstraints(e, c) {
21
- let l = c.min - e.min, u = c.max - e.max;
22
- return c.max - c.min < e.max - e.min && ([l, u] = [u, l]), {
23
- min: l,
24
- max: u
25
- };
26
- }
27
- function calcViewportConstraints(e, c) {
28
- return {
29
- x: calcViewportAxisConstraints(e.x, c.x),
30
- y: calcViewportAxisConstraints(e.y, c.y)
31
- };
32
- }
33
- function calcOrigin(l, d) {
34
- let f = .5, p = calcLength(l), m = calcLength(d);
35
- return m > p ? f = progress(d.min, d.max - p, l.min) : p > m && (f = progress(l.min, l.max - m, d.min)), clamp(0, 1, f);
36
- }
37
- function rebaseAxisConstraints(e, c) {
38
- let l = {};
39
- return c.min !== void 0 && (l.min = c.min - e.min), c.max !== void 0 && (l.max = c.max - e.min), l;
40
- }
41
- var defaultElastic = .35;
42
- function resolveDragElastic(e = defaultElastic) {
43
- return e === !1 ? e = 0 : e === !0 && (e = defaultElastic), {
44
- x: resolveAxisElastic(e, "left", "right"),
45
- y: resolveAxisElastic(e, "top", "bottom")
46
- };
47
- }
48
- function resolveAxisElastic(e, c, l) {
49
- return {
50
- min: resolvePointElastic(e, c),
51
- max: resolvePointElastic(e, l)
52
- };
53
- }
54
- function resolvePointElastic(e, c) {
55
- return typeof e == "number" ? e : e[c] || 0;
56
- }
57
- export { applyConstraints, calcOrigin, calcRelativeConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveDragElastic };