@teamturing/react-kit 2.51.2 → 2.51.4

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 (613) hide show
  1. package/dist/index.js +1342 -37064
  2. package/esm/_virtual/_commonjsHelpers.js +1 -3
  3. package/esm/core/ActionList/ActionListItem.js +18 -20
  4. package/esm/core/ActionList/ActionListSectionDivider.js +2 -2
  5. package/esm/core/ActionList/ActionListSectionHeader.js +3 -3
  6. package/esm/core/ActionList/index.js +3 -3
  7. package/esm/core/AnimatePresence/index.js +2 -5
  8. package/esm/core/Avatar/index.js +3 -3
  9. package/esm/core/AvatarGroup/AvatarGroupItem.js +4 -4
  10. package/esm/core/AvatarGroup/index.js +13 -13
  11. package/esm/core/BadgeAttacher/index.js +2 -2
  12. package/esm/core/Breadcrumbs/BreadcrumbsItem.js +4 -4
  13. package/esm/core/Breadcrumbs/index.js +5 -5
  14. package/esm/core/Button/index.js +7 -7
  15. package/esm/core/Card/index.js +1 -1
  16. package/esm/core/Checkbox/index.js +3 -3
  17. package/esm/core/Chip/index.js +4 -4
  18. package/esm/core/ClickArea/index.js +2 -2
  19. package/esm/core/CounterBadge/index.js +3 -3
  20. package/esm/core/Datagrid/DatagridBody.js +3 -3
  21. package/esm/core/Datagrid/DatagridCell.js +2 -2
  22. package/esm/core/Datagrid/DatagridHeader.js +7 -7
  23. package/esm/core/Datagrid/DatagridRow.js +3 -3
  24. package/esm/core/Datagrid/DatagridSubheader.js +3 -3
  25. package/esm/core/Datagrid/index.js +4 -4
  26. package/esm/core/DescriptionList/index.js +11 -11
  27. package/esm/core/Dialog/DialogBody.js +2 -2
  28. package/esm/core/Dialog/DialogFooter.js +2 -2
  29. package/esm/core/Dialog/DialogHeader.js +2 -2
  30. package/esm/core/Dialog/DialogHeaderSubtitle.js +2 -2
  31. package/esm/core/Dialog/DialogHeaderTitle.js +2 -2
  32. package/esm/core/Dialog/index.js +8 -8
  33. package/esm/core/Drawer/DrawerBody.js +2 -2
  34. package/esm/core/Drawer/DrawerFooter.js +2 -2
  35. package/esm/core/Drawer/DrawerHeader.js +2 -2
  36. package/esm/core/Drawer/DrawerHeaderIconButton.js +2 -2
  37. package/esm/core/Drawer/index.js +12 -13
  38. package/esm/core/EmptyState/index.js +8 -9
  39. package/esm/core/Flash/index.js +12 -15
  40. package/esm/core/FormControl/FormControlCaption.js +2 -2
  41. package/esm/core/FormControl/FormControlErrorMessage.js +2 -2
  42. package/esm/core/FormControl/FormControlLabel.js +5 -5
  43. package/esm/core/FormControl/FormControlSuccessMessage.js +2 -2
  44. package/esm/core/FormControl/FormControlTooltipIcon.js +5 -6
  45. package/esm/core/FormControl/index.js +8 -8
  46. package/esm/core/Grid/index.js +4 -6
  47. package/esm/core/HorizontalDivider/index.js +2 -2
  48. package/esm/core/IconButton/index.js +3 -3
  49. package/esm/core/IconToggleButton/index.js +3 -3
  50. package/esm/core/ItemList/index.js +2 -2
  51. package/esm/core/MotionView/index.js +1 -1
  52. package/esm/core/Overlay/index.js +4 -4
  53. package/esm/core/OverlayPopper/index.js +4 -6
  54. package/esm/core/Pagination/index.js +15 -17
  55. package/esm/core/Pill/index.js +11 -12
  56. package/esm/core/Radio/index.js +3 -3
  57. package/esm/core/SearchSelectInput/index.js +22 -28
  58. package/esm/core/Select/SelectOption.js +3 -3
  59. package/esm/core/Select/index.js +11 -13
  60. package/esm/core/Spinner/index.js +2 -3
  61. package/esm/core/Stack/index.js +4 -4
  62. package/esm/core/StyledIcon/index.js +3 -3
  63. package/esm/core/Switch/index.js +3 -3
  64. package/esm/core/Tab/TabItem.js +5 -5
  65. package/esm/core/Tab/index.js +18 -19
  66. package/esm/core/TextInput/TextInputTrailingAction.js +4 -4
  67. package/esm/core/TextInput/index.js +9 -11
  68. package/esm/core/Textarea/index.js +6 -8
  69. package/esm/core/ThemeProvider/index.js +2 -2
  70. package/esm/core/Toast/index.js +6 -8
  71. package/esm/core/Tooltip/BaseTooltip.js +8 -8
  72. package/esm/core/Tooltip/index.js +4 -4
  73. package/esm/core/Tooltip/useTooltip.js +1 -3
  74. package/esm/enigma/EnigmaUI/index.js +3 -4
  75. package/esm/enigma/Layout/SingleColumnLayout/index.js +4 -4
  76. package/esm/enigma/View/ChipGroupView/index.js +6 -6
  77. package/esm/enigma/View/GridView/index.js +5 -5
  78. package/esm/enigma/View/HorizontalDividerView/index.js +2 -2
  79. package/esm/enigma/View/IconView/index.js +4 -4
  80. package/esm/enigma/View/ImageView/index.js +2 -2
  81. package/esm/enigma/View/TextView/index.js +2 -2
  82. package/esm/hook/useFocusTrap.js +5 -5
  83. package/esm/hook/useFocusZone.js +2 -2
  84. package/esm/hook/useResize.js +1 -1
  85. package/esm/index.js +1 -1
  86. package/esm/theme/index.js +1 -13
  87. package/package.json +2 -2
  88. package/esm/_virtual/index.js +0 -3
  89. package/esm/_virtual/index2.js +0 -3
  90. package/esm/_virtual/index3.js +0 -3
  91. package/esm/_virtual/jsx-runtime.js +0 -3
  92. package/esm/_virtual/react-dom.development.js +0 -3
  93. package/esm/_virtual/react-dom.production.min.js +0 -3
  94. package/esm/_virtual/react-is.development.js +0 -3
  95. package/esm/_virtual/react-is.production.min.js +0 -3
  96. package/esm/_virtual/react-jsx-runtime.development.js +0 -3
  97. package/esm/_virtual/react-jsx-runtime.production.min.js +0 -3
  98. package/esm/_virtual/scheduler.development.js +0 -3
  99. package/esm/_virtual/scheduler.production.min.js +0 -3
  100. package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -593
  101. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -731
  102. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -1621
  103. package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -233
  104. package/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -321
  105. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
  106. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -136
  107. package/esm/node_modules/@primer/behaviors/dist/esm/focus-trap.js +0 -105
  108. package/esm/node_modules/@primer/behaviors/dist/esm/focus-zone.js +0 -436
  109. package/esm/node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js +0 -38
  110. package/esm/node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js +0 -65
  111. package/esm/node_modules/@primer/behaviors/dist/esm/utils/unique-id.js +0 -6
  112. package/esm/node_modules/@primer/behaviors/dist/esm/utils/user-agent.js +0 -9
  113. package/esm/node_modules/framer-motion/dist/es/animation/animators/instant.js +0 -40
  114. package/esm/node_modules/framer-motion/dist/es/animation/animators/js/driver-frameloop.js +0 -16
  115. package/esm/node_modules/framer-motion/dist/es/animation/animators/js/index.js +0 -303
  116. package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.js +0 -199
  117. package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/easing.js +0 -31
  118. package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/index.js +0 -23
  119. package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.js +0 -8
  120. package/esm/node_modules/framer-motion/dist/es/animation/generators/inertia.js +0 -87
  121. package/esm/node_modules/framer-motion/dist/es/animation/generators/keyframes.js +0 -51
  122. package/esm/node_modules/framer-motion/dist/es/animation/generators/spring/find.js +0 -89
  123. package/esm/node_modules/framer-motion/dist/es/animation/generators/spring/index.js +0 -129
  124. package/esm/node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.js +0 -17
  125. package/esm/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.js +0 -9
  126. package/esm/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js +0 -101
  127. package/esm/node_modules/framer-motion/dist/es/animation/interfaces/single-value.js +0 -11
  128. package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js +0 -71
  129. package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js +0 -63
  130. package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js +0 -24
  131. package/esm/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.js +0 -6
  132. package/esm/node_modules/framer-motion/dist/es/animation/utils/default-transitions.js +0 -40
  133. package/esm/node_modules/framer-motion/dist/es/animation/utils/is-animatable.js +0 -30
  134. package/esm/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js +0 -5
  135. package/esm/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js +0 -5
  136. package/esm/node_modules/framer-motion/dist/es/animation/utils/is-none.js +0 -12
  137. package/esm/node_modules/framer-motion/dist/es/animation/utils/keyframes.js +0 -45
  138. package/esm/node_modules/framer-motion/dist/es/animation/utils/transitions.js +0 -13
  139. package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -71
  140. package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -56
  141. package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -158
  142. package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -40
  143. package/esm/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
  144. package/esm/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
  145. package/esm/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -12
  146. package/esm/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
  147. package/esm/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
  148. package/esm/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -17
  149. package/esm/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -8
  150. package/esm/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -8
  151. package/esm/node_modules/framer-motion/dist/es/debug/record.js +0 -7
  152. package/esm/node_modules/framer-motion/dist/es/easing/anticipate.js +0 -5
  153. package/esm/node_modules/framer-motion/dist/es/easing/back.js +0 -9
  154. package/esm/node_modules/framer-motion/dist/es/easing/circ.js +0 -8
  155. package/esm/node_modules/framer-motion/dist/es/easing/cubic-bezier.js +0 -51
  156. package/esm/node_modules/framer-motion/dist/es/easing/ease.js +0 -7
  157. package/esm/node_modules/framer-motion/dist/es/easing/modifiers/mirror.js +0 -5
  158. package/esm/node_modules/framer-motion/dist/es/easing/modifiers/reverse.js +0 -5
  159. package/esm/node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.js +0 -3
  160. package/esm/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.js +0 -5
  161. package/esm/node_modules/framer-motion/dist/es/easing/utils/map.js +0 -37
  162. package/esm/node_modules/framer-motion/dist/es/events/add-dom-event.js +0 -6
  163. package/esm/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
  164. package/esm/node_modules/framer-motion/dist/es/events/event-info.js +0 -15
  165. package/esm/node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.js +0 -18
  166. package/esm/node_modules/framer-motion/dist/es/frameloop/batcher.js +0 -60
  167. package/esm/node_modules/framer-motion/dist/es/frameloop/frame.js +0 -6
  168. package/esm/node_modules/framer-motion/dist/es/frameloop/render-step.js +0 -104
  169. package/esm/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -457
  170. package/esm/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -27
  171. package/esm/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -125
  172. package/esm/node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js +0 -53
  173. package/esm/node_modules/framer-motion/dist/es/gestures/focus.js +0 -41
  174. package/esm/node_modules/framer-motion/dist/es/gestures/hover.js +0 -32
  175. package/esm/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -148
  176. package/esm/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -46
  177. package/esm/node_modules/framer-motion/dist/es/gestures/press.js +0 -120
  178. package/esm/node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js +0 -20
  179. package/esm/node_modules/framer-motion/dist/es/motion/features/Feature.js +0 -9
  180. package/esm/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -31
  181. package/esm/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -38
  182. package/esm/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
  183. package/esm/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -28
  184. package/esm/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
  185. package/esm/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
  186. package/esm/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -131
  187. package/esm/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
  188. package/esm/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -12
  189. package/esm/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -72
  190. package/esm/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -49
  191. package/esm/node_modules/framer-motion/dist/es/motion/index.js +0 -79
  192. package/esm/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -11
  193. package/esm/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -3
  194. package/esm/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -33
  195. package/esm/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -75
  196. package/esm/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -81
  197. package/esm/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -59
  198. package/esm/node_modules/framer-motion/dist/es/projection/animation/mix-values.js +0 -93
  199. package/esm/node_modules/framer-motion/dist/es/projection/geometry/conversion.js +0 -33
  200. package/esm/node_modules/framer-motion/dist/es/projection/geometry/copy.js +0 -20
  201. package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js +0 -122
  202. package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.js +0 -41
  203. package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.js +0 -54
  204. package/esm/node_modules/framer-motion/dist/es/projection/geometry/models.js +0 -17
  205. package/esm/node_modules/framer-motion/dist/es/projection/geometry/utils.js +0 -25
  206. package/esm/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.js +0 -13
  207. package/esm/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js +0 -27
  208. package/esm/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js +0 -1494
  209. package/esm/node_modules/framer-motion/dist/es/projection/node/state.js +0 -19
  210. package/esm/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -112
  211. package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js +0 -41
  212. package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js +0 -35
  213. package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -6
  214. package/esm/node_modules/framer-motion/dist/es/projection/styles/transform.js +0 -42
  215. package/esm/node_modules/framer-motion/dist/es/projection/utils/each-axis.js +0 -5
  216. package/esm/node_modules/framer-motion/dist/es/projection/utils/has-transform.js +0 -24
  217. package/esm/node_modules/framer-motion/dist/es/projection/utils/measure.js +0 -17
  218. package/esm/node_modules/framer-motion/dist/es/render/VisualElement.js +0 -507
  219. package/esm/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js +0 -48
  220. package/esm/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -11
  221. package/esm/node_modules/framer-motion/dist/es/render/dom/motion-proxy.js +0 -47
  222. package/esm/node_modules/framer-motion/dist/es/render/dom/motion.js +0 -23
  223. package/esm/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -35
  224. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -6
  225. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/create-config.js +0 -19
  226. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js +0 -89
  227. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -57
  228. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js +0 -6
  229. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -30
  230. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.js +0 -5
  231. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js +0 -15
  232. package/esm/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js +0 -230
  233. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js +0 -15
  234. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js +0 -30
  235. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js +0 -15
  236. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/find.js +0 -15
  237. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js +0 -10
  238. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/number.js +0 -72
  239. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/test.js +0 -6
  240. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js +0 -9
  241. package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js +0 -8
  242. package/esm/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -55
  243. package/esm/node_modules/framer-motion/dist/es/render/html/config-motion.js +0 -12
  244. package/esm/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -57
  245. package/esm/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -74
  246. package/esm/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -45
  247. package/esm/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -8
  248. package/esm/node_modules/framer-motion/dist/es/render/html/utils/render.js +0 -9
  249. package/esm/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -17
  250. package/esm/node_modules/framer-motion/dist/es/render/html/utils/transform.js +0 -28
  251. package/esm/node_modules/framer-motion/dist/es/render/store.js +0 -3
  252. package/esm/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -46
  253. package/esm/node_modules/framer-motion/dist/es/render/svg/config-motion.js +0 -40
  254. package/esm/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -33
  255. package/esm/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
  256. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -52
  257. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js +0 -30
  258. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
  259. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.js +0 -3
  260. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -32
  261. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/render.js +0 -12
  262. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -18
  263. package/esm/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js +0 -18
  264. package/esm/node_modules/framer-motion/dist/es/render/utils/animation-state.js +0 -319
  265. package/esm/node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js +0 -3
  266. package/esm/node_modules/framer-motion/dist/es/render/utils/flat-tree.js +0 -24
  267. package/esm/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.js +0 -13
  268. package/esm/node_modules/framer-motion/dist/es/render/utils/is-variant-label.js +0 -8
  269. package/esm/node_modules/framer-motion/dist/es/render/utils/motion-values.js +0 -63
  270. package/esm/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.js +0 -24
  271. package/esm/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js +0 -26
  272. package/esm/node_modules/framer-motion/dist/es/render/utils/setters.js +0 -101
  273. package/esm/node_modules/framer-motion/dist/es/render/utils/variant-props.js +0 -12
  274. package/esm/node_modules/framer-motion/dist/es/utils/array.js +0 -11
  275. package/esm/node_modules/framer-motion/dist/es/utils/clamp.js +0 -3
  276. package/esm/node_modules/framer-motion/dist/es/utils/delay.js +0 -19
  277. package/esm/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
  278. package/esm/node_modules/framer-motion/dist/es/utils/errors.js +0 -18
  279. package/esm/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.js +0 -42
  280. package/esm/node_modules/framer-motion/dist/es/utils/interpolate.js +0 -92
  281. package/esm/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -3
  282. package/esm/node_modules/framer-motion/dist/es/utils/is-numerical-string.js +0 -6
  283. package/esm/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
  284. package/esm/node_modules/framer-motion/dist/es/utils/is-zero-value-string.js +0 -6
  285. package/esm/node_modules/framer-motion/dist/es/utils/memo.js +0 -10
  286. package/esm/node_modules/framer-motion/dist/es/utils/mix-color.js +0 -40
  287. package/esm/node_modules/framer-motion/dist/es/utils/mix-complex.js +0 -64
  288. package/esm/node_modules/framer-motion/dist/es/utils/mix.js +0 -24
  289. package/esm/node_modules/framer-motion/dist/es/utils/noop.js +0 -3
  290. package/esm/node_modules/framer-motion/dist/es/utils/offsets/default.js +0 -9
  291. package/esm/node_modules/framer-motion/dist/es/utils/offsets/fill.js +0 -12
  292. package/esm/node_modules/framer-motion/dist/es/utils/offsets/time.js +0 -5
  293. package/esm/node_modules/framer-motion/dist/es/utils/pipe.js +0 -11
  294. package/esm/node_modules/framer-motion/dist/es/utils/progress.js +0 -18
  295. package/esm/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -19
  296. package/esm/node_modules/framer-motion/dist/es/utils/reduced-motion/state.js +0 -5
  297. package/esm/node_modules/framer-motion/dist/es/utils/resolve-value.js +0 -11
  298. package/esm/node_modules/framer-motion/dist/es/utils/shallow-compare.js +0 -14
  299. package/esm/node_modules/framer-motion/dist/es/utils/subscription-manager.js +0 -40
  300. package/esm/node_modules/framer-motion/dist/es/utils/time-conversion.js +0 -10
  301. package/esm/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -18
  302. package/esm/node_modules/framer-motion/dist/es/utils/use-force-update.js +0 -19
  303. package/esm/node_modules/framer-motion/dist/es/utils/use-instant-transition-state.js +0 -5
  304. package/esm/node_modules/framer-motion/dist/es/utils/use-is-mounted.js +0 -15
  305. package/esm/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
  306. package/esm/node_modules/framer-motion/dist/es/utils/use-unmount-effect.js +0 -7
  307. package/esm/node_modules/framer-motion/dist/es/utils/velocity-per-second.js +0 -11
  308. package/esm/node_modules/framer-motion/dist/es/utils/warn-once.js +0 -11
  309. package/esm/node_modules/framer-motion/dist/es/value/index.js +0 -331
  310. package/esm/node_modules/framer-motion/dist/es/value/types/color/hex.js +0 -40
  311. package/esm/node_modules/framer-motion/dist/es/value/types/color/hsla.js +0 -22
  312. package/esm/node_modules/framer-motion/dist/es/value/types/color/index.js +0 -28
  313. package/esm/node_modules/framer-motion/dist/es/value/types/color/rgba.js +0 -25
  314. package/esm/node_modules/framer-motion/dist/es/value/types/color/utils.js +0 -23
  315. package/esm/node_modules/framer-motion/dist/es/value/types/complex/filter.js +0 -30
  316. package/esm/node_modules/framer-motion/dist/es/value/types/complex/index.js +0 -92
  317. package/esm/node_modules/framer-motion/dist/es/value/types/numbers/index.js +0 -17
  318. package/esm/node_modules/framer-motion/dist/es/value/types/numbers/units.js +0 -19
  319. package/esm/node_modules/framer-motion/dist/es/value/types/utils.js +0 -15
  320. package/esm/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
  321. package/esm/node_modules/framer-motion/dist/es/value/utils/is-motion-value.js +0 -3
  322. package/esm/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -16
  323. package/esm/node_modules/lodash.debounce/index.js +0 -363
  324. package/esm/node_modules/lodash.throttle/index.js +0 -424
  325. package/esm/node_modules/lodash.toarray/index.js +0 -849
  326. package/esm/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1140
  327. package/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -53
  328. package/esm/node_modules/react/jsx-runtime.js +0 -12
  329. package/esm/node_modules/react-dom/cjs/react-dom.development.js +0 -4940
  330. package/esm/node_modules/react-dom/cjs/react-dom.production.min.js +0 -7140
  331. package/esm/node_modules/react-dom/index.js +0 -39
  332. package/esm/node_modules/react-is/cjs/react-is.development.js +0 -211
  333. package/esm/node_modules/react-is/cjs/react-is.production.min.js +0 -123
  334. package/esm/node_modules/react-is/index.js +0 -12
  335. package/esm/node_modules/scheduler/cjs/scheduler.development.js +0 -528
  336. package/esm/node_modules/scheduler/cjs/scheduler.production.min.js +0 -267
  337. package/esm/node_modules/scheduler/index.js +0 -17
  338. package/esm/node_modules/tabbable/dist/index.esm.js +0 -560
  339. package/esm/packages/icons/esm/AHorizontalLine.js +0 -15
  340. package/esm/packages/icons/esm/AInCircleFilled.js +0 -21
  341. package/esm/packages/icons/esm/AVertialLine.js +0 -15
  342. package/esm/packages/icons/esm/Ai.js +0 -23
  343. package/esm/packages/icons/esm/AiColor.js +0 -23
  344. package/esm/packages/icons/esm/AiSad.js +0 -24
  345. package/esm/packages/icons/esm/Alarm.js +0 -17
  346. package/esm/packages/icons/esm/AppleColor.js +0 -18
  347. package/esm/packages/icons/esm/ArrowBelow.js +0 -17
  348. package/esm/packages/icons/esm/ArrowDiagonal.js +0 -15
  349. package/esm/packages/icons/esm/ArrowDown.js +0 -17
  350. package/esm/packages/icons/esm/ArrowLeft.js +0 -17
  351. package/esm/packages/icons/esm/ArrowLeftCircle.js +0 -15
  352. package/esm/packages/icons/esm/ArrowLeftLimit.js +0 -17
  353. package/esm/packages/icons/esm/ArrowLeftRight.js +0 -17
  354. package/esm/packages/icons/esm/ArrowRight.js +0 -17
  355. package/esm/packages/icons/esm/ArrowRightCircle.js +0 -15
  356. package/esm/packages/icons/esm/ArrowRightLimit.js +0 -17
  357. package/esm/packages/icons/esm/ArrowUp.js +0 -17
  358. package/esm/packages/icons/esm/ArrowUpDown.js +0 -17
  359. package/esm/packages/icons/esm/ArrowUpLimit.js +0 -17
  360. package/esm/packages/icons/esm/Barchart.js +0 -15
  361. package/esm/packages/icons/esm/Book.js +0 -17
  362. package/esm/packages/icons/esm/BookColor.js +0 -28
  363. package/esm/packages/icons/esm/Bookmark.js +0 -17
  364. package/esm/packages/icons/esm/BookmarkAnimation.js +0 -17
  365. package/esm/packages/icons/esm/Box.js +0 -24
  366. package/esm/packages/icons/esm/BoxPlus.js +0 -15
  367. package/esm/packages/icons/esm/BusColor.js +0 -36
  368. package/esm/packages/icons/esm/Calendar.js +0 -22
  369. package/esm/packages/icons/esm/CalendarCheck.js +0 -17
  370. package/esm/packages/icons/esm/CalendarCheckColor.js +0 -20
  371. package/esm/packages/icons/esm/CalendarColor.js +0 -36
  372. package/esm/packages/icons/esm/Camera.js +0 -22
  373. package/esm/packages/icons/esm/CameraColor.js +0 -30
  374. package/esm/packages/icons/esm/Card.js +0 -17
  375. package/esm/packages/icons/esm/CardsPercent.js +0 -19
  376. package/esm/packages/icons/esm/CardsPercentColor.js +0 -23
  377. package/esm/packages/icons/esm/CaretDown.js +0 -15
  378. package/esm/packages/icons/esm/CaretLeft.js +0 -15
  379. package/esm/packages/icons/esm/CaretRight.js +0 -15
  380. package/esm/packages/icons/esm/CaretUp.js +0 -15
  381. package/esm/packages/icons/esm/Cart.js +0 -17
  382. package/esm/packages/icons/esm/ChatBubble.js +0 -17
  383. package/esm/packages/icons/esm/ChatBubbleBadgeColor.js +0 -32
  384. package/esm/packages/icons/esm/ChatBubbleCorrect.js +0 -24
  385. package/esm/packages/icons/esm/ChatBubbleCorrectColor.js +0 -22
  386. package/esm/packages/icons/esm/ChatBubbleDots.js +0 -17
  387. package/esm/packages/icons/esm/ChatBubbleQuestion.js +0 -17
  388. package/esm/packages/icons/esm/ChatBubbleQuestionAnimation.js +0 -16
  389. package/esm/packages/icons/esm/ChatBubbleQuestionColor.js +0 -20
  390. package/esm/packages/icons/esm/Check.js +0 -15
  391. package/esm/packages/icons/esm/CheckInCircle.js +0 -17
  392. package/esm/packages/icons/esm/CheckInCircleColor.js +0 -20
  393. package/esm/packages/icons/esm/CheckInCircleLine.js +0 -20
  394. package/esm/packages/icons/esm/ChevronDown.js +0 -17
  395. package/esm/packages/icons/esm/ChevronDownTwo.js +0 -23
  396. package/esm/packages/icons/esm/ChevronLeft.js +0 -17
  397. package/esm/packages/icons/esm/ChevronRight.js +0 -17
  398. package/esm/packages/icons/esm/ChevronRightTwo.js +0 -23
  399. package/esm/packages/icons/esm/ChevronUp.js +0 -17
  400. package/esm/packages/icons/esm/ChevronUpTwo.js +0 -23
  401. package/esm/packages/icons/esm/Circles.js +0 -17
  402. package/esm/packages/icons/esm/Clip.js +0 -15
  403. package/esm/packages/icons/esm/Close.js +0 -17
  404. package/esm/packages/icons/esm/CloseInCircle.js +0 -17
  405. package/esm/packages/icons/esm/Coin.js +0 -17
  406. package/esm/packages/icons/esm/Contact.js +0 -17
  407. package/esm/packages/icons/esm/Copy.js +0 -22
  408. package/esm/packages/icons/esm/Correct.js +0 -16
  409. package/esm/packages/icons/esm/Coupon.js +0 -17
  410. package/esm/packages/icons/esm/Crop.js +0 -24
  411. package/esm/packages/icons/esm/Crown.js +0 -17
  412. package/esm/packages/icons/esm/Curriculum.js +0 -31
  413. package/esm/packages/icons/esm/CurriculumColor.js +0 -38
  414. package/esm/packages/icons/esm/Cursor.js +0 -22
  415. package/esm/packages/icons/esm/Delete.js +0 -17
  416. package/esm/packages/icons/esm/Document.js +0 -22
  417. package/esm/packages/icons/esm/Dots.js +0 -17
  418. package/esm/packages/icons/esm/Download.js +0 -18
  419. package/esm/packages/icons/esm/Emoji.js +0 -17
  420. package/esm/packages/icons/esm/EmojiPlus.js +0 -22
  421. package/esm/packages/icons/esm/EmojiPlusDash.js +0 -17
  422. package/esm/packages/icons/esm/Eng.js +0 -20
  423. package/esm/packages/icons/esm/Enter.js +0 -17
  424. package/esm/packages/icons/esm/Equal.js +0 -17
  425. package/esm/packages/icons/esm/Eraser.js +0 -17
  426. package/esm/packages/icons/esm/ExclamationPointInCircle.js +0 -17
  427. package/esm/packages/icons/esm/ExternalLink.js +0 -27
  428. package/esm/packages/icons/esm/EyeOff.js +0 -15
  429. package/esm/packages/icons/esm/EyeOn.js +0 -22
  430. package/esm/packages/icons/esm/EyesTwo.js +0 -15
  431. package/esm/packages/icons/esm/FaceHappy.js +0 -17
  432. package/esm/packages/icons/esm/FaceSad.js +0 -17
  433. package/esm/packages/icons/esm/Facebook.js +0 -15
  434. package/esm/packages/icons/esm/FacebookColor.js +0 -20
  435. package/esm/packages/icons/esm/Filter.js +0 -17
  436. package/esm/packages/icons/esm/Find.js +0 -17
  437. package/esm/packages/icons/esm/Fire.js +0 -15
  438. package/esm/packages/icons/esm/FireColor.js +0 -27
  439. package/esm/packages/icons/esm/Flag.js +0 -15
  440. package/esm/packages/icons/esm/Folder.js +0 -17
  441. package/esm/packages/icons/esm/Frame.js +0 -17
  442. package/esm/packages/icons/esm/Glasses.js +0 -17
  443. package/esm/packages/icons/esm/Global.js +0 -17
  444. package/esm/packages/icons/esm/GoogleColor.js +0 -35
  445. package/esm/packages/icons/esm/Graph.js +0 -17
  446. package/esm/packages/icons/esm/Hair.js +0 -17
  447. package/esm/packages/icons/esm/Headphone.js +0 -17
  448. package/esm/packages/icons/esm/Heart.js +0 -17
  449. package/esm/packages/icons/esm/Home.js +0 -17
  450. package/esm/packages/icons/esm/Infinite.js +0 -15
  451. package/esm/packages/icons/esm/InfoInCircle.js +0 -17
  452. package/esm/packages/icons/esm/Instagram.js +0 -17
  453. package/esm/packages/icons/esm/KakaoColor.js +0 -20
  454. package/esm/packages/icons/esm/Kor.js +0 -20
  455. package/esm/packages/icons/esm/LandscapeArrow.js +0 -20
  456. package/esm/packages/icons/esm/League.js +0 -17
  457. package/esm/packages/icons/esm/Letter.js +0 -17
  458. package/esm/packages/icons/esm/LetterCrownColor.js +0 -26
  459. package/esm/packages/icons/esm/LetterCrownOpenColor.js +0 -35
  460. package/esm/packages/icons/esm/LetterHeartColor.js +0 -26
  461. package/esm/packages/icons/esm/LetterHeartOpenColor.js +0 -35
  462. package/esm/packages/icons/esm/LineThree.js +0 -17
  463. package/esm/packages/icons/esm/Link.js +0 -22
  464. package/esm/packages/icons/esm/Lock.js +0 -17
  465. package/esm/packages/icons/esm/LogoApple.js +0 -17
  466. package/esm/packages/icons/esm/LogoColor.js +0 -22
  467. package/esm/packages/icons/esm/LogoFacebook.js +0 -17
  468. package/esm/packages/icons/esm/LogoKakao.js +0 -17
  469. package/esm/packages/icons/esm/LogoNaver.js +0 -15
  470. package/esm/packages/icons/esm/MagicWand.js +0 -22
  471. package/esm/packages/icons/esm/Maxsize.js +0 -15
  472. package/esm/packages/icons/esm/Minsize.js +0 -17
  473. package/esm/packages/icons/esm/Minus.js +0 -17
  474. package/esm/packages/icons/esm/MinusInCircle.js +0 -17
  475. package/esm/packages/icons/esm/Moneybag.js +0 -17
  476. package/esm/packages/icons/esm/MoneybagColor.js +0 -20
  477. package/esm/packages/icons/esm/Moon.js +0 -15
  478. package/esm/packages/icons/esm/More.js +0 -17
  479. package/esm/packages/icons/esm/MyBubble.js +0 -17
  480. package/esm/packages/icons/esm/NaverColor.js +0 -18
  481. package/esm/packages/icons/esm/New.js +0 -22
  482. package/esm/packages/icons/esm/Note.js +0 -17
  483. package/esm/packages/icons/esm/NoteColor.js +0 -18
  484. package/esm/packages/icons/esm/NotePenColor.js +0 -46
  485. package/esm/packages/icons/esm/NumberFiveFilled.js +0 -17
  486. package/esm/packages/icons/esm/NumberFiveOutlined.js +0 -20
  487. package/esm/packages/icons/esm/NumberFourFilled.js +0 -17
  488. package/esm/packages/icons/esm/NumberFourOutlined.js +0 -20
  489. package/esm/packages/icons/esm/NumberOneFilled.js +0 -17
  490. package/esm/packages/icons/esm/NumberOneOutlined.js +0 -20
  491. package/esm/packages/icons/esm/NumberThreeFilled.js +0 -17
  492. package/esm/packages/icons/esm/NumberThreeOutlined.js +0 -20
  493. package/esm/packages/icons/esm/NumberTwoFilled.js +0 -17
  494. package/esm/packages/icons/esm/NumberTwoOutlined.js +0 -20
  495. package/esm/packages/icons/esm/Out.js +0 -17
  496. package/esm/packages/icons/esm/PalmTreeColor.js +0 -41
  497. package/esm/packages/icons/esm/PaperCheck.js +0 -36
  498. package/esm/packages/icons/esm/PaperPen.js +0 -31
  499. package/esm/packages/icons/esm/PaperPenColor.js +0 -20
  500. package/esm/packages/icons/esm/PaperTwo.js +0 -18
  501. package/esm/packages/icons/esm/Pause.js +0 -17
  502. package/esm/packages/icons/esm/Pen.js +0 -17
  503. package/esm/packages/icons/esm/PercentInCircle.js +0 -22
  504. package/esm/packages/icons/esm/Picture.js +0 -17
  505. package/esm/packages/icons/esm/Pill.js +0 -25
  506. package/esm/packages/icons/esm/PillColor.js +0 -18
  507. package/esm/packages/icons/esm/Pin.js +0 -17
  508. package/esm/packages/icons/esm/PinColorRed.js +0 -26
  509. package/esm/packages/icons/esm/Play.js +0 -15
  510. package/esm/packages/icons/esm/Plus.js +0 -17
  511. package/esm/packages/icons/esm/PlusInCircle.js +0 -17
  512. package/esm/packages/icons/esm/PointInCircle.js +0 -22
  513. package/esm/packages/icons/esm/PointInCircleColor.js +0 -27
  514. package/esm/packages/icons/esm/PortraitArrow.js +0 -20
  515. package/esm/packages/icons/esm/Present.js +0 -21
  516. package/esm/packages/icons/esm/PresentColor.js +0 -20
  517. package/esm/packages/icons/esm/Print.js +0 -20
  518. package/esm/packages/icons/esm/Problem.js +0 -15
  519. package/esm/packages/icons/esm/Profile.js +0 -17
  520. package/esm/packages/icons/esm/ProgressGradient.js +0 -41
  521. package/esm/packages/icons/esm/QuestionMarkInCircle.js +0 -17
  522. package/esm/packages/icons/esm/QuestionMarkInCircleOutlined.js +0 -20
  523. package/esm/packages/icons/esm/QuizColor.js +0 -28
  524. package/esm/packages/icons/esm/RaffleColor.js +0 -113
  525. package/esm/packages/icons/esm/Receipt.js +0 -17
  526. package/esm/packages/icons/esm/Refresh.js +0 -17
  527. package/esm/packages/icons/esm/Repeat.js +0 -15
  528. package/esm/packages/icons/esm/ReportColor.js +0 -30
  529. package/esm/packages/icons/esm/School.js +0 -20
  530. package/esm/packages/icons/esm/SchoolColor.js +0 -27
  531. package/esm/packages/icons/esm/Scroll.js +0 -22
  532. package/esm/packages/icons/esm/Search.js +0 -15
  533. package/esm/packages/icons/esm/Set.js +0 -20
  534. package/esm/packages/icons/esm/Setting.js +0 -17
  535. package/esm/packages/icons/esm/Share.js +0 -22
  536. package/esm/packages/icons/esm/ShieldCheck.js +0 -15
  537. package/esm/packages/icons/esm/Sidebar.js +0 -17
  538. package/esm/packages/icons/esm/Siren.js +0 -17
  539. package/esm/packages/icons/esm/Skipback.js +0 -17
  540. package/esm/packages/icons/esm/Skipforward.js +0 -17
  541. package/esm/packages/icons/esm/SoundOff.js +0 -15
  542. package/esm/packages/icons/esm/SoundOn.js +0 -25
  543. package/esm/packages/icons/esm/SoundPaper.js +0 -20
  544. package/esm/packages/icons/esm/Speaker.js +0 -17
  545. package/esm/packages/icons/esm/Stackup.js +0 -27
  546. package/esm/packages/icons/esm/Star.js +0 -17
  547. package/esm/packages/icons/esm/StarColor.js +0 -21
  548. package/esm/packages/icons/esm/Store.js +0 -15
  549. package/esm/packages/icons/esm/Sun.js +0 -15
  550. package/esm/packages/icons/esm/Sync.js +0 -17
  551. package/esm/packages/icons/esm/TestUploadColor.js +0 -26
  552. package/esm/packages/icons/esm/Thumbdown.js +0 -17
  553. package/esm/packages/icons/esm/Thumbup.js +0 -17
  554. package/esm/packages/icons/esm/Thunder.js +0 -17
  555. package/esm/packages/icons/esm/Ticket.js +0 -17
  556. package/esm/packages/icons/esm/TicketColor.js +0 -29
  557. package/esm/packages/icons/esm/Time.js +0 -17
  558. package/esm/packages/icons/esm/Timer.js +0 -17
  559. package/esm/packages/icons/esm/Top.js +0 -17
  560. package/esm/packages/icons/esm/Touch.js +0 -26
  561. package/esm/packages/icons/esm/Trash.js +0 -17
  562. package/esm/packages/icons/esm/Treasurebox.js +0 -22
  563. package/esm/packages/icons/esm/Trophy.js +0 -17
  564. package/esm/packages/icons/esm/Twinkle.js +0 -15
  565. package/esm/packages/icons/esm/TwinkleColor.js +0 -48
  566. package/esm/packages/icons/esm/Undo.js +0 -17
  567. package/esm/packages/icons/esm/University.js +0 -26
  568. package/esm/packages/icons/esm/UserBlocked.js +0 -17
  569. package/esm/packages/icons/esm/UserCheck.js +0 -17
  570. package/esm/packages/icons/esm/UserPlus.js +0 -17
  571. package/esm/packages/icons/esm/UserTwo.js +0 -23
  572. package/esm/packages/icons/esm/Video.js +0 -17
  573. package/esm/packages/icons/esm/VideoColor.js +0 -18
  574. package/esm/packages/icons/esm/VoteColor.js +0 -24
  575. package/esm/packages/icons/esm/Warning.js +0 -17
  576. package/esm/packages/icons/esm/Wifi.js +0 -27
  577. package/esm/packages/icons/esm/Workbook.js +0 -28
  578. package/esm/packages/icons/esm/WorkbookColor.js +0 -29
  579. package/esm/packages/icons/esm/Wrong.js +0 -20
  580. package/esm/packages/icons/esm/Youtube.js +0 -17
  581. package/esm/packages/icons/esm/_virtual/_rollupPluginBabelHelpers.js +0 -16
  582. package/esm/packages/icons/esm/index.js +0 -242
  583. package/esm/packages/token-studio/esm/foundation/breakpoint/device.js +0 -7
  584. package/esm/packages/token-studio/esm/foundation/gradient/colorStopList/index.js +0 -9
  585. package/esm/packages/token-studio/esm/foundation/gradient/direction/index.js +0 -9
  586. package/esm/packages/token-studio/esm/foundation/opacity/index.js +0 -5
  587. package/esm/packages/token-studio/esm/foundation/palette/index.js +0 -169
  588. package/esm/packages/token-studio/esm/foundation/rounding/index.js +0 -13
  589. package/esm/packages/token-studio/esm/foundation/shadow/index.js +0 -5
  590. package/esm/packages/token-studio/esm/foundation/spacing/index.js +0 -56
  591. package/esm/packages/token-studio/esm/foundation/typography/fontSize/index.js +0 -18
  592. package/esm/packages/token-studio/esm/foundation/typography/fontWeight/index.js +0 -13
  593. package/esm/packages/token-studio/esm/foundation/typography/lineHeight/index.js +0 -6
  594. package/esm/packages/token-studio/esm/token/breakpoints/index.js +0 -6
  595. package/esm/packages/token-studio/esm/token/color/gpai/dark.js +0 -223
  596. package/esm/packages/token-studio/esm/token/color/gpai/light.js +0 -223
  597. package/esm/packages/token-studio/esm/token/color/index.js +0 -223
  598. package/esm/packages/token-studio/esm/token/elevation/index.js +0 -7
  599. package/esm/packages/token-studio/esm/token/gradient/index.js +0 -41
  600. package/esm/packages/token-studio/esm/token/opacity/index.js +0 -7
  601. package/esm/packages/token-studio/esm/token/radii/index.js +0 -15
  602. package/esm/packages/token-studio/esm/token/space/index.js +0 -55
  603. package/esm/packages/token-studio/esm/token/typography/fontSizes.js +0 -17
  604. package/esm/packages/token-studio/esm/token/typography/fontWeights.js +0 -9
  605. package/esm/packages/token-studio/esm/token/typography/index.js +0 -133
  606. package/esm/packages/token-studio/esm/token/typography/lineHeights.js +0 -8
  607. package/esm/packages/utils/esm/commaizeNumber.js +0 -10
  608. package/esm/packages/utils/esm/forcePixelValue.js +0 -8
  609. package/esm/packages/utils/esm/isArray.js +0 -3
  610. package/esm/packages/utils/esm/isFunction.js +0 -3
  611. package/esm/packages/utils/esm/isNullable.js +0 -3
  612. package/esm/packages/utils/esm/noop.js +0 -6
  613. package/esm/packages/utils/esm/scrollIntoView.js +0 -46
@@ -1,1494 +0,0 @@
1
- import { SubscriptionManager } from '../../utils/subscription-manager.js';
2
- import { mixValues } from '../animation/mix-values.js';
3
- import { copyBoxInto } from '../geometry/copy.js';
4
- import { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.js';
5
- import { calcRelativePosition, calcRelativeBox, calcBoxDelta, calcLength, isNear } from '../geometry/delta-calc.js';
6
- import { removeBoxTransforms } from '../geometry/delta-remove.js';
7
- import { createBox, createDelta } from '../geometry/models.js';
8
- import { getValueTransition } from '../../animation/utils/transitions.js';
9
- import { boxEqualsRounded, isDeltaZero, aspectRatio, boxEquals } from '../geometry/utils.js';
10
- import { NodeStack } from '../shared/stack.js';
11
- import { scaleCorrectors } from '../styles/scale-correction.js';
12
- import { buildProjectionTransform } from '../styles/transform.js';
13
- import { eachAxis } from '../utils/each-axis.js';
14
- import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.js';
15
- import { FlatTree } from '../../render/utils/flat-tree.js';
16
- import { resolveMotionValue } from '../../value/utils/resolve-motion-value.js';
17
- import { globalProjectionState } from './state.js';
18
- import { delay } from '../../utils/delay.js';
19
- import { mix } from '../../utils/mix.js';
20
- import { record } from '../../debug/record.js';
21
- import { isSVGElement } from '../../render/dom/utils/is-svg-element.js';
22
- import { animateSingleValue } from '../../animation/interfaces/single-value.js';
23
- import { clamp } from '../../utils/clamp.js';
24
- import { cancelFrame, frameData, steps, frame } from '../../frameloop/frame.js';
25
- import { noop } from '../../utils/noop.js';
26
-
27
- const transformAxes = ["", "X", "Y", "Z"];
28
- /**
29
- * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1
30
- * which has a noticeable difference in spring animations
31
- */
32
- const animationTarget = 1000;
33
- let id = 0;
34
- /**
35
- * Use a mutable data object for debug data so as to not create a new
36
- * object every frame.
37
- */
38
- const projectionFrameData = {
39
- type: "projectionFrame",
40
- totalNodes: 0,
41
- resolvedTargetDeltas: 0,
42
- recalculatedProjection: 0,
43
- };
44
- function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
45
- return class ProjectionNode {
46
- constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
47
- /**
48
- * A unique ID generated for every projection node.
49
- */
50
- this.id = id++;
51
- /**
52
- * An id that represents a unique session instigated by startUpdate.
53
- */
54
- this.animationId = 0;
55
- /**
56
- * A Set containing all this component's children. This is used to iterate
57
- * through the children.
58
- *
59
- * TODO: This could be faster to iterate as a flat array stored on the root node.
60
- */
61
- this.children = new Set();
62
- /**
63
- * Options for the node. We use this to configure what kind of layout animations
64
- * we should perform (if any).
65
- */
66
- this.options = {};
67
- /**
68
- * We use this to detect when its safe to shut down part of a projection tree.
69
- * We have to keep projecting children for scale correction and relative projection
70
- * until all their parents stop performing layout animations.
71
- */
72
- this.isTreeAnimating = false;
73
- this.isAnimationBlocked = false;
74
- /**
75
- * Flag to true if we think this layout has been changed. We can't always know this,
76
- * currently we set it to true every time a component renders, or if it has a layoutDependency
77
- * if that has changed between renders. Additionally, components can be grouped by LayoutGroup
78
- * and if one node is dirtied, they all are.
79
- */
80
- this.isLayoutDirty = false;
81
- /**
82
- * Flag to true if we think the projection calculations for this node needs
83
- * recalculating as a result of an updated transform or layout animation.
84
- */
85
- this.isProjectionDirty = false;
86
- /**
87
- * Flag to true if the layout *or* transform has changed. This then gets propagated
88
- * throughout the projection tree, forcing any element below to recalculate on the next frame.
89
- */
90
- this.isSharedProjectionDirty = false;
91
- /**
92
- * Flag transform dirty. This gets propagated throughout the whole tree but is only
93
- * respected by shared nodes.
94
- */
95
- this.isTransformDirty = false;
96
- /**
97
- * Block layout updates for instant layout transitions throughout the tree.
98
- */
99
- this.updateManuallyBlocked = false;
100
- this.updateBlockedByResize = false;
101
- /**
102
- * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`
103
- * call.
104
- */
105
- this.isUpdating = false;
106
- /**
107
- * If this is an SVG element we currently disable projection transforms
108
- */
109
- this.isSVG = false;
110
- /**
111
- * Flag to true (during promotion) if a node doing an instant layout transition needs to reset
112
- * its projection styles.
113
- */
114
- this.needsReset = false;
115
- /**
116
- * Flags whether this node should have its transform reset prior to measuring.
117
- */
118
- this.shouldResetTransform = false;
119
- /**
120
- * An object representing the calculated contextual/accumulated/tree scale.
121
- * This will be used to scale calculcated projection transforms, as these are
122
- * calculated in screen-space but need to be scaled for elements to layoutly
123
- * make it to their calculated destinations.
124
- *
125
- * TODO: Lazy-init
126
- */
127
- this.treeScale = { x: 1, y: 1 };
128
- /**
129
- *
130
- */
131
- this.eventHandlers = new Map();
132
- this.hasTreeAnimated = false;
133
- // Note: Currently only running on root node
134
- this.updateScheduled = false;
135
- this.checkUpdateFailed = () => {
136
- if (this.isUpdating) {
137
- this.isUpdating = false;
138
- this.clearAllSnapshots();
139
- }
140
- };
141
- /**
142
- * This is a multi-step process as shared nodes might be of different depths. Nodes
143
- * are sorted by depth order, so we need to resolve the entire tree before moving to
144
- * the next step.
145
- */
146
- this.updateProjection = () => {
147
- /**
148
- * Reset debug counts. Manually resetting rather than creating a new
149
- * object each frame.
150
- */
151
- projectionFrameData.totalNodes =
152
- projectionFrameData.resolvedTargetDeltas =
153
- projectionFrameData.recalculatedProjection =
154
- 0;
155
- this.nodes.forEach(propagateDirtyNodes);
156
- this.nodes.forEach(resolveTargetDelta);
157
- this.nodes.forEach(calcProjection);
158
- this.nodes.forEach(cleanDirtyNodes);
159
- record(projectionFrameData);
160
- };
161
- this.hasProjected = false;
162
- this.isVisible = true;
163
- this.animationProgress = 0;
164
- /**
165
- * Shared layout
166
- */
167
- // TODO Only running on root node
168
- this.sharedNodes = new Map();
169
- this.latestValues = latestValues;
170
- this.root = parent ? parent.root || parent : this;
171
- this.path = parent ? [...parent.path, parent] : [];
172
- this.parent = parent;
173
- this.depth = parent ? parent.depth + 1 : 0;
174
- for (let i = 0; i < this.path.length; i++) {
175
- this.path[i].shouldResetTransform = true;
176
- }
177
- if (this.root === this)
178
- this.nodes = new FlatTree();
179
- }
180
- addEventListener(name, handler) {
181
- if (!this.eventHandlers.has(name)) {
182
- this.eventHandlers.set(name, new SubscriptionManager());
183
- }
184
- return this.eventHandlers.get(name).add(handler);
185
- }
186
- notifyListeners(name, ...args) {
187
- const subscriptionManager = this.eventHandlers.get(name);
188
- subscriptionManager && subscriptionManager.notify(...args);
189
- }
190
- hasListeners(name) {
191
- return this.eventHandlers.has(name);
192
- }
193
- /**
194
- * Lifecycles
195
- */
196
- mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {
197
- if (this.instance)
198
- return;
199
- this.isSVG = isSVGElement(instance);
200
- this.instance = instance;
201
- const { layoutId, layout, visualElement } = this.options;
202
- if (visualElement && !visualElement.current) {
203
- visualElement.mount(instance);
204
- }
205
- this.root.nodes.add(this);
206
- this.parent && this.parent.children.add(this);
207
- if (isLayoutDirty && (layout || layoutId)) {
208
- this.isLayoutDirty = true;
209
- }
210
- if (attachResizeListener) {
211
- let cancelDelay;
212
- const resizeUnblockUpdate = () => (this.root.updateBlockedByResize = false);
213
- attachResizeListener(instance, () => {
214
- this.root.updateBlockedByResize = true;
215
- cancelDelay && cancelDelay();
216
- cancelDelay = delay(resizeUnblockUpdate, 250);
217
- if (globalProjectionState.hasAnimatedSinceResize) {
218
- globalProjectionState.hasAnimatedSinceResize = false;
219
- this.nodes.forEach(finishAnimation);
220
- }
221
- });
222
- }
223
- if (layoutId) {
224
- this.root.registerSharedNode(layoutId, this);
225
- }
226
- // Only register the handler if it requires layout animation
227
- if (this.options.animate !== false &&
228
- visualElement &&
229
- (layoutId || layout)) {
230
- this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout, }) => {
231
- if (this.isTreeAnimationBlocked()) {
232
- this.target = undefined;
233
- this.relativeTarget = undefined;
234
- return;
235
- }
236
- // TODO: Check here if an animation exists
237
- const layoutTransition = this.options.transition ||
238
- visualElement.getDefaultTransition() ||
239
- defaultLayoutTransition;
240
- const { onLayoutAnimationStart, onLayoutAnimationComplete, } = visualElement.getProps();
241
- /**
242
- * The target layout of the element might stay the same,
243
- * but its position relative to its parent has changed.
244
- */
245
- const targetChanged = !this.targetLayout ||
246
- !boxEqualsRounded(this.targetLayout, newLayout) ||
247
- hasRelativeTargetChanged;
248
- /**
249
- * If the layout hasn't seemed to have changed, it might be that the
250
- * element is visually in the same place in the document but its position
251
- * relative to its parent has indeed changed. So here we check for that.
252
- */
253
- const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;
254
- if (this.options.layoutRoot ||
255
- (this.resumeFrom && this.resumeFrom.instance) ||
256
- hasOnlyRelativeTargetChanged ||
257
- (hasLayoutChanged &&
258
- (targetChanged || !this.currentAnimation))) {
259
- if (this.resumeFrom) {
260
- this.resumingFrom = this.resumeFrom;
261
- this.resumingFrom.resumingFrom = undefined;
262
- }
263
- this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
264
- const animationOptions = {
265
- ...getValueTransition(layoutTransition, "layout"),
266
- onPlay: onLayoutAnimationStart,
267
- onComplete: onLayoutAnimationComplete,
268
- };
269
- if (visualElement.shouldReduceMotion ||
270
- this.options.layoutRoot) {
271
- animationOptions.delay = 0;
272
- animationOptions.type = false;
273
- }
274
- this.startAnimation(animationOptions);
275
- }
276
- else {
277
- /**
278
- * If the layout hasn't changed and we have an animation that hasn't started yet,
279
- * finish it immediately. Otherwise it will be animating from a location
280
- * that was probably never commited to screen and look like a jumpy box.
281
- */
282
- if (!hasLayoutChanged) {
283
- finishAnimation(this);
284
- }
285
- if (this.isLead() && this.options.onExitComplete) {
286
- this.options.onExitComplete();
287
- }
288
- }
289
- this.targetLayout = newLayout;
290
- });
291
- }
292
- }
293
- unmount() {
294
- this.options.layoutId && this.willUpdate();
295
- this.root.nodes.remove(this);
296
- const stack = this.getStack();
297
- stack && stack.remove(this);
298
- this.parent && this.parent.children.delete(this);
299
- this.instance = undefined;
300
- cancelFrame(this.updateProjection);
301
- }
302
- // only on the root
303
- blockUpdate() {
304
- this.updateManuallyBlocked = true;
305
- }
306
- unblockUpdate() {
307
- this.updateManuallyBlocked = false;
308
- }
309
- isUpdateBlocked() {
310
- return this.updateManuallyBlocked || this.updateBlockedByResize;
311
- }
312
- isTreeAnimationBlocked() {
313
- return (this.isAnimationBlocked ||
314
- (this.parent && this.parent.isTreeAnimationBlocked()) ||
315
- false);
316
- }
317
- // Note: currently only running on root node
318
- startUpdate() {
319
- if (this.isUpdateBlocked())
320
- return;
321
- this.isUpdating = true;
322
- this.nodes && this.nodes.forEach(resetRotation);
323
- this.animationId++;
324
- }
325
- getTransformTemplate() {
326
- const { visualElement } = this.options;
327
- return visualElement && visualElement.getProps().transformTemplate;
328
- }
329
- willUpdate(shouldNotifyListeners = true) {
330
- this.root.hasTreeAnimated = true;
331
- if (this.root.isUpdateBlocked()) {
332
- this.options.onExitComplete && this.options.onExitComplete();
333
- return;
334
- }
335
- !this.root.isUpdating && this.root.startUpdate();
336
- if (this.isLayoutDirty)
337
- return;
338
- this.isLayoutDirty = true;
339
- for (let i = 0; i < this.path.length; i++) {
340
- const node = this.path[i];
341
- node.shouldResetTransform = true;
342
- node.updateScroll("snapshot");
343
- if (node.options.layoutRoot) {
344
- node.willUpdate(false);
345
- }
346
- }
347
- const { layoutId, layout } = this.options;
348
- if (layoutId === undefined && !layout)
349
- return;
350
- const transformTemplate = this.getTransformTemplate();
351
- this.prevTransformTemplateValue = transformTemplate
352
- ? transformTemplate(this.latestValues, "")
353
- : undefined;
354
- this.updateSnapshot();
355
- shouldNotifyListeners && this.notifyListeners("willUpdate");
356
- }
357
- update() {
358
- this.updateScheduled = false;
359
- const updateWasBlocked = this.isUpdateBlocked();
360
- // When doing an instant transition, we skip the layout update,
361
- // but should still clean up the measurements so that the next
362
- // snapshot could be taken correctly.
363
- if (updateWasBlocked) {
364
- this.unblockUpdate();
365
- this.clearAllSnapshots();
366
- this.nodes.forEach(clearMeasurements);
367
- return;
368
- }
369
- if (!this.isUpdating) {
370
- this.nodes.forEach(clearIsLayoutDirty);
371
- }
372
- this.isUpdating = false;
373
- /**
374
- * Write
375
- */
376
- this.nodes.forEach(resetTransformStyle);
377
- /**
378
- * Read ==================
379
- */
380
- // Update layout measurements of updated children
381
- this.nodes.forEach(updateLayout);
382
- /**
383
- * Write
384
- */
385
- // Notify listeners that the layout is updated
386
- this.nodes.forEach(notifyLayoutUpdate);
387
- this.clearAllSnapshots();
388
- /**
389
- * Manually flush any pending updates. Ideally
390
- * we could leave this to the following requestAnimationFrame but this seems
391
- * to leave a flash of incorrectly styled content.
392
- */
393
- const now = performance.now();
394
- frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp);
395
- frameData.timestamp = now;
396
- frameData.isProcessing = true;
397
- steps.update.process(frameData);
398
- steps.preRender.process(frameData);
399
- steps.render.process(frameData);
400
- frameData.isProcessing = false;
401
- }
402
- didUpdate() {
403
- if (!this.updateScheduled) {
404
- this.updateScheduled = true;
405
- queueMicrotask(() => this.update());
406
- }
407
- }
408
- clearAllSnapshots() {
409
- this.nodes.forEach(clearSnapshot);
410
- this.sharedNodes.forEach(removeLeadSnapshots);
411
- }
412
- scheduleUpdateProjection() {
413
- frame.preRender(this.updateProjection, false, true);
414
- }
415
- scheduleCheckAfterUnmount() {
416
- /**
417
- * If the unmounting node is in a layoutGroup and did trigger a willUpdate,
418
- * we manually call didUpdate to give a chance to the siblings to animate.
419
- * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.
420
- */
421
- frame.postRender(() => {
422
- if (this.isLayoutDirty) {
423
- this.root.didUpdate();
424
- }
425
- else {
426
- this.root.checkUpdateFailed();
427
- }
428
- });
429
- }
430
- /**
431
- * Update measurements
432
- */
433
- updateSnapshot() {
434
- if (this.snapshot || !this.instance)
435
- return;
436
- this.snapshot = this.measure();
437
- }
438
- updateLayout() {
439
- if (!this.instance)
440
- return;
441
- // TODO: Incorporate into a forwarded scroll offset
442
- this.updateScroll();
443
- if (!(this.options.alwaysMeasureLayout && this.isLead()) &&
444
- !this.isLayoutDirty) {
445
- return;
446
- }
447
- /**
448
- * When a node is mounted, it simply resumes from the prevLead's
449
- * snapshot instead of taking a new one, but the ancestors scroll
450
- * might have updated while the prevLead is unmounted. We need to
451
- * update the scroll again to make sure the layout we measure is
452
- * up to date.
453
- */
454
- if (this.resumeFrom && !this.resumeFrom.instance) {
455
- for (let i = 0; i < this.path.length; i++) {
456
- const node = this.path[i];
457
- node.updateScroll();
458
- }
459
- }
460
- const prevLayout = this.layout;
461
- this.layout = this.measure(false);
462
- this.layoutCorrected = createBox();
463
- this.isLayoutDirty = false;
464
- this.projectionDelta = undefined;
465
- this.notifyListeners("measure", this.layout.layoutBox);
466
- const { visualElement } = this.options;
467
- visualElement &&
468
- visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);
469
- }
470
- updateScroll(phase = "measure") {
471
- let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
472
- if (this.scroll &&
473
- this.scroll.animationId === this.root.animationId &&
474
- this.scroll.phase === phase) {
475
- needsMeasurement = false;
476
- }
477
- if (needsMeasurement) {
478
- this.scroll = {
479
- animationId: this.root.animationId,
480
- phase,
481
- isRoot: checkIsScrollRoot(this.instance),
482
- offset: measureScroll(this.instance),
483
- };
484
- }
485
- }
486
- resetTransform() {
487
- if (!resetTransform)
488
- return;
489
- const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;
490
- const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
491
- const transformTemplate = this.getTransformTemplate();
492
- const transformTemplateValue = transformTemplate
493
- ? transformTemplate(this.latestValues, "")
494
- : undefined;
495
- const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
496
- if (isResetRequested &&
497
- (hasProjection ||
498
- hasTransform(this.latestValues) ||
499
- transformTemplateHasChanged)) {
500
- resetTransform(this.instance, transformTemplateValue);
501
- this.shouldResetTransform = false;
502
- this.scheduleRender();
503
- }
504
- }
505
- measure(removeTransform = true) {
506
- const pageBox = this.measurePageBox();
507
- let layoutBox = this.removeElementScroll(pageBox);
508
- /**
509
- * Measurements taken during the pre-render stage
510
- * still have transforms applied so we remove them
511
- * via calculation.
512
- */
513
- if (removeTransform) {
514
- layoutBox = this.removeTransform(layoutBox);
515
- }
516
- roundBox(layoutBox);
517
- return {
518
- animationId: this.root.animationId,
519
- measuredBox: pageBox,
520
- layoutBox,
521
- latestValues: {},
522
- source: this.id,
523
- };
524
- }
525
- measurePageBox() {
526
- const { visualElement } = this.options;
527
- if (!visualElement)
528
- return createBox();
529
- const box = visualElement.measureViewportBox();
530
- // Remove viewport scroll to give page-relative coordinates
531
- const { scroll } = this.root;
532
- if (scroll) {
533
- translateAxis(box.x, scroll.offset.x);
534
- translateAxis(box.y, scroll.offset.y);
535
- }
536
- return box;
537
- }
538
- removeElementScroll(box) {
539
- const boxWithoutScroll = createBox();
540
- copyBoxInto(boxWithoutScroll, box);
541
- /**
542
- * Performance TODO: Keep a cumulative scroll offset down the tree
543
- * rather than loop back up the path.
544
- */
545
- for (let i = 0; i < this.path.length; i++) {
546
- const node = this.path[i];
547
- const { scroll, options } = node;
548
- if (node !== this.root && scroll && options.layoutScroll) {
549
- /**
550
- * If this is a new scroll root, we want to remove all previous scrolls
551
- * from the viewport box.
552
- */
553
- if (scroll.isRoot) {
554
- copyBoxInto(boxWithoutScroll, box);
555
- const { scroll: rootScroll } = this.root;
556
- /**
557
- * Undo the application of page scroll that was originally added
558
- * to the measured bounding box.
559
- */
560
- if (rootScroll) {
561
- translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);
562
- translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);
563
- }
564
- }
565
- translateAxis(boxWithoutScroll.x, scroll.offset.x);
566
- translateAxis(boxWithoutScroll.y, scroll.offset.y);
567
- }
568
- }
569
- return boxWithoutScroll;
570
- }
571
- applyTransform(box, transformOnly = false) {
572
- const withTransforms = createBox();
573
- copyBoxInto(withTransforms, box);
574
- for (let i = 0; i < this.path.length; i++) {
575
- const node = this.path[i];
576
- if (!transformOnly &&
577
- node.options.layoutScroll &&
578
- node.scroll &&
579
- node !== node.root) {
580
- transformBox(withTransforms, {
581
- x: -node.scroll.offset.x,
582
- y: -node.scroll.offset.y,
583
- });
584
- }
585
- if (!hasTransform(node.latestValues))
586
- continue;
587
- transformBox(withTransforms, node.latestValues);
588
- }
589
- if (hasTransform(this.latestValues)) {
590
- transformBox(withTransforms, this.latestValues);
591
- }
592
- return withTransforms;
593
- }
594
- removeTransform(box) {
595
- const boxWithoutTransform = createBox();
596
- copyBoxInto(boxWithoutTransform, box);
597
- for (let i = 0; i < this.path.length; i++) {
598
- const node = this.path[i];
599
- if (!node.instance)
600
- continue;
601
- if (!hasTransform(node.latestValues))
602
- continue;
603
- hasScale(node.latestValues) && node.updateSnapshot();
604
- const sourceBox = createBox();
605
- const nodeBox = node.measurePageBox();
606
- copyBoxInto(sourceBox, nodeBox);
607
- removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);
608
- }
609
- if (hasTransform(this.latestValues)) {
610
- removeBoxTransforms(boxWithoutTransform, this.latestValues);
611
- }
612
- return boxWithoutTransform;
613
- }
614
- setTargetDelta(delta) {
615
- this.targetDelta = delta;
616
- this.root.scheduleUpdateProjection();
617
- this.isProjectionDirty = true;
618
- }
619
- setOptions(options) {
620
- this.options = {
621
- ...this.options,
622
- ...options,
623
- crossfade: options.crossfade !== undefined ? options.crossfade : true,
624
- };
625
- }
626
- clearMeasurements() {
627
- this.scroll = undefined;
628
- this.layout = undefined;
629
- this.snapshot = undefined;
630
- this.prevTransformTemplateValue = undefined;
631
- this.targetDelta = undefined;
632
- this.target = undefined;
633
- this.isLayoutDirty = false;
634
- }
635
- forceRelativeParentToResolveTarget() {
636
- if (!this.relativeParent)
637
- return;
638
- /**
639
- * If the parent target isn't up-to-date, force it to update.
640
- * This is an unfortunate de-optimisation as it means any updating relative
641
- * projection will cause all the relative parents to recalculate back
642
- * up the tree.
643
- */
644
- if (this.relativeParent.resolvedRelativeTargetAt !==
645
- frameData.timestamp) {
646
- this.relativeParent.resolveTargetDelta(true);
647
- }
648
- }
649
- resolveTargetDelta(forceRecalculation = false) {
650
- var _a;
651
- /**
652
- * Once the dirty status of nodes has been spread through the tree, we also
653
- * need to check if we have a shared node of a different depth that has itself
654
- * been dirtied.
655
- */
656
- const lead = this.getLead();
657
- this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
658
- this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
659
- this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
660
- const isShared = Boolean(this.resumingFrom) || this !== lead;
661
- /**
662
- * We don't use transform for this step of processing so we don't
663
- * need to check whether any nodes have changed transform.
664
- */
665
- const canSkip = !(forceRecalculation ||
666
- (isShared && this.isSharedProjectionDirty) ||
667
- this.isProjectionDirty ||
668
- ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||
669
- this.attemptToResolveRelativeTarget);
670
- if (canSkip)
671
- return;
672
- const { layout, layoutId } = this.options;
673
- /**
674
- * If we have no layout, we can't perform projection, so early return
675
- */
676
- if (!this.layout || !(layout || layoutId))
677
- return;
678
- this.resolvedRelativeTargetAt = frameData.timestamp;
679
- /**
680
- * If we don't have a targetDelta but do have a layout, we can attempt to resolve
681
- * a relativeParent. This will allow a component to perform scale correction
682
- * even if no animation has started.
683
- */
684
- // TODO If this is unsuccessful this currently happens every frame
685
- if (!this.targetDelta && !this.relativeTarget) {
686
- // TODO: This is a semi-repetition of further down this function, make DRY
687
- const relativeParent = this.getClosestProjectingParent();
688
- if (relativeParent &&
689
- relativeParent.layout &&
690
- this.animationProgress !== 1) {
691
- this.relativeParent = relativeParent;
692
- this.forceRelativeParentToResolveTarget();
693
- this.relativeTarget = createBox();
694
- this.relativeTargetOrigin = createBox();
695
- calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
696
- copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
697
- }
698
- else {
699
- this.relativeParent = this.relativeTarget = undefined;
700
- }
701
- }
702
- /**
703
- * If we have no relative target or no target delta our target isn't valid
704
- * for this frame.
705
- */
706
- if (!this.relativeTarget && !this.targetDelta)
707
- return;
708
- /**
709
- * Lazy-init target data structure
710
- */
711
- if (!this.target) {
712
- this.target = createBox();
713
- this.targetWithTransforms = createBox();
714
- }
715
- /**
716
- * If we've got a relative box for this component, resolve it into a target relative to the parent.
717
- */
718
- if (this.relativeTarget &&
719
- this.relativeTargetOrigin &&
720
- this.relativeParent &&
721
- this.relativeParent.target) {
722
- this.forceRelativeParentToResolveTarget();
723
- calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);
724
- /**
725
- * If we've only got a targetDelta, resolve it into a target
726
- */
727
- }
728
- else if (this.targetDelta) {
729
- if (Boolean(this.resumingFrom)) {
730
- // TODO: This is creating a new object every frame
731
- this.target = this.applyTransform(this.layout.layoutBox);
732
- }
733
- else {
734
- copyBoxInto(this.target, this.layout.layoutBox);
735
- }
736
- applyBoxDelta(this.target, this.targetDelta);
737
- }
738
- else {
739
- /**
740
- * If no target, use own layout as target
741
- */
742
- copyBoxInto(this.target, this.layout.layoutBox);
743
- }
744
- /**
745
- * If we've been told to attempt to resolve a relative target, do so.
746
- */
747
- if (this.attemptToResolveRelativeTarget) {
748
- this.attemptToResolveRelativeTarget = false;
749
- const relativeParent = this.getClosestProjectingParent();
750
- if (relativeParent &&
751
- Boolean(relativeParent.resumingFrom) ===
752
- Boolean(this.resumingFrom) &&
753
- !relativeParent.options.layoutScroll &&
754
- relativeParent.target &&
755
- this.animationProgress !== 1) {
756
- this.relativeParent = relativeParent;
757
- this.forceRelativeParentToResolveTarget();
758
- this.relativeTarget = createBox();
759
- this.relativeTargetOrigin = createBox();
760
- calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
761
- copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
762
- }
763
- else {
764
- this.relativeParent = this.relativeTarget = undefined;
765
- }
766
- }
767
- /**
768
- * Increase debug counter for resolved target deltas
769
- */
770
- projectionFrameData.resolvedTargetDeltas++;
771
- }
772
- getClosestProjectingParent() {
773
- if (!this.parent ||
774
- hasScale(this.parent.latestValues) ||
775
- has2DTranslate(this.parent.latestValues)) {
776
- return undefined;
777
- }
778
- if (this.parent.isProjecting()) {
779
- return this.parent;
780
- }
781
- else {
782
- return this.parent.getClosestProjectingParent();
783
- }
784
- }
785
- isProjecting() {
786
- return Boolean((this.relativeTarget ||
787
- this.targetDelta ||
788
- this.options.layoutRoot) &&
789
- this.layout);
790
- }
791
- calcProjection() {
792
- var _a;
793
- const lead = this.getLead();
794
- const isShared = Boolean(this.resumingFrom) || this !== lead;
795
- let canSkip = true;
796
- /**
797
- * If this is a normal layout animation and neither this node nor its nearest projecting
798
- * is dirty then we can't skip.
799
- */
800
- if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {
801
- canSkip = false;
802
- }
803
- /**
804
- * If this is a shared layout animation and this node's shared projection is dirty then
805
- * we can't skip.
806
- */
807
- if (isShared &&
808
- (this.isSharedProjectionDirty || this.isTransformDirty)) {
809
- canSkip = false;
810
- }
811
- /**
812
- * If we have resolved the target this frame we must recalculate the
813
- * projection to ensure it visually represents the internal calculations.
814
- */
815
- if (this.resolvedRelativeTargetAt === frameData.timestamp) {
816
- canSkip = false;
817
- }
818
- if (canSkip)
819
- return;
820
- const { layout, layoutId } = this.options;
821
- /**
822
- * If this section of the tree isn't animating we can
823
- * delete our target sources for the following frame.
824
- */
825
- this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||
826
- this.currentAnimation ||
827
- this.pendingAnimation);
828
- if (!this.isTreeAnimating) {
829
- this.targetDelta = this.relativeTarget = undefined;
830
- }
831
- if (!this.layout || !(layout || layoutId))
832
- return;
833
- /**
834
- * Reset the corrected box with the latest values from box, as we're then going
835
- * to perform mutative operations on it.
836
- */
837
- copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
838
- /**
839
- * Record previous tree scales before updating.
840
- */
841
- const prevTreeScaleX = this.treeScale.x;
842
- const prevTreeScaleY = this.treeScale.y;
843
- /**
844
- * Apply all the parent deltas to this box to produce the corrected box. This
845
- * is the layout box, as it will appear on screen as a result of the transforms of its parents.
846
- */
847
- applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
848
- /**
849
- * If this layer needs to perform scale correction but doesn't have a target,
850
- * use the layout as the target.
851
- */
852
- if (lead.layout &&
853
- !lead.target &&
854
- (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
855
- lead.target = lead.layout.layoutBox;
856
- }
857
- const { target } = lead;
858
- if (!target) {
859
- /**
860
- * If we don't have a target to project into, but we were previously
861
- * projecting, we want to remove the stored transform and schedule
862
- * a render to ensure the elements reflect the removed transform.
863
- */
864
- if (this.projectionTransform) {
865
- this.projectionDelta = createDelta();
866
- this.projectionTransform = "none";
867
- this.scheduleRender();
868
- }
869
- return;
870
- }
871
- if (!this.projectionDelta) {
872
- this.projectionDelta = createDelta();
873
- this.projectionDeltaWithTransform = createDelta();
874
- }
875
- const prevProjectionTransform = this.projectionTransform;
876
- /**
877
- * Update the delta between the corrected box and the target box before user-set transforms were applied.
878
- * This will allow us to calculate the corrected borderRadius and boxShadow to compensate
879
- * for our layout reprojection, but still allow them to be scaled correctly by the user.
880
- * It might be that to simplify this we may want to accept that user-set scale is also corrected
881
- * and we wouldn't have to keep and calc both deltas, OR we could support a user setting
882
- * to allow people to choose whether these styles are corrected based on just the
883
- * layout reprojection or the final bounding box.
884
- */
885
- calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);
886
- this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);
887
- if (this.projectionTransform !== prevProjectionTransform ||
888
- this.treeScale.x !== prevTreeScaleX ||
889
- this.treeScale.y !== prevTreeScaleY) {
890
- this.hasProjected = true;
891
- this.scheduleRender();
892
- this.notifyListeners("projectionUpdate", target);
893
- }
894
- /**
895
- * Increase debug counter for recalculated projections
896
- */
897
- projectionFrameData.recalculatedProjection++;
898
- }
899
- hide() {
900
- this.isVisible = false;
901
- // TODO: Schedule render
902
- }
903
- show() {
904
- this.isVisible = true;
905
- // TODO: Schedule render
906
- }
907
- scheduleRender(notifyAll = true) {
908
- this.options.scheduleRender && this.options.scheduleRender();
909
- if (notifyAll) {
910
- const stack = this.getStack();
911
- stack && stack.scheduleRender();
912
- }
913
- if (this.resumingFrom && !this.resumingFrom.instance) {
914
- this.resumingFrom = undefined;
915
- }
916
- }
917
- setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
918
- const snapshot = this.snapshot;
919
- const snapshotLatestValues = snapshot
920
- ? snapshot.latestValues
921
- : {};
922
- const mixedValues = { ...this.latestValues };
923
- const targetDelta = createDelta();
924
- if (!this.relativeParent ||
925
- !this.relativeParent.options.layoutRoot) {
926
- this.relativeTarget = this.relativeTargetOrigin = undefined;
927
- }
928
- this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
929
- const relativeLayout = createBox();
930
- const snapshotSource = snapshot ? snapshot.source : undefined;
931
- const layoutSource = this.layout ? this.layout.source : undefined;
932
- const isSharedLayoutAnimation = snapshotSource !== layoutSource;
933
- const stack = this.getStack();
934
- const isOnlyMember = !stack || stack.members.length <= 1;
935
- const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&
936
- !isOnlyMember &&
937
- this.options.crossfade === true &&
938
- !this.path.some(hasOpacityCrossfade));
939
- this.animationProgress = 0;
940
- let prevRelativeTarget;
941
- this.mixTargetDelta = (latest) => {
942
- const progress = latest / 1000;
943
- mixAxisDelta(targetDelta.x, delta.x, progress);
944
- mixAxisDelta(targetDelta.y, delta.y, progress);
945
- this.setTargetDelta(targetDelta);
946
- if (this.relativeTarget &&
947
- this.relativeTargetOrigin &&
948
- this.layout &&
949
- this.relativeParent &&
950
- this.relativeParent.layout) {
951
- calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
952
- mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);
953
- /**
954
- * If this is an unchanged relative target we can consider the
955
- * projection not dirty.
956
- */
957
- if (prevRelativeTarget &&
958
- boxEquals(this.relativeTarget, prevRelativeTarget)) {
959
- this.isProjectionDirty = false;
960
- }
961
- if (!prevRelativeTarget)
962
- prevRelativeTarget = createBox();
963
- copyBoxInto(prevRelativeTarget, this.relativeTarget);
964
- }
965
- if (isSharedLayoutAnimation) {
966
- this.animationValues = mixedValues;
967
- mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember);
968
- }
969
- this.root.scheduleUpdateProjection();
970
- this.scheduleRender();
971
- this.animationProgress = progress;
972
- };
973
- this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0);
974
- }
975
- startAnimation(options) {
976
- this.notifyListeners("animationStart");
977
- this.currentAnimation && this.currentAnimation.stop();
978
- if (this.resumingFrom && this.resumingFrom.currentAnimation) {
979
- this.resumingFrom.currentAnimation.stop();
980
- }
981
- if (this.pendingAnimation) {
982
- cancelFrame(this.pendingAnimation);
983
- this.pendingAnimation = undefined;
984
- }
985
- /**
986
- * Start the animation in the next frame to have a frame with progress 0,
987
- * where the target is the same as when the animation started, so we can
988
- * calculate the relative positions correctly for instant transitions.
989
- */
990
- this.pendingAnimation = frame.update(() => {
991
- globalProjectionState.hasAnimatedSinceResize = true;
992
- this.currentAnimation = animateSingleValue(0, animationTarget, {
993
- ...options,
994
- onUpdate: (latest) => {
995
- this.mixTargetDelta(latest);
996
- options.onUpdate && options.onUpdate(latest);
997
- },
998
- onComplete: () => {
999
- options.onComplete && options.onComplete();
1000
- this.completeAnimation();
1001
- },
1002
- });
1003
- if (this.resumingFrom) {
1004
- this.resumingFrom.currentAnimation = this.currentAnimation;
1005
- }
1006
- this.pendingAnimation = undefined;
1007
- });
1008
- }
1009
- completeAnimation() {
1010
- if (this.resumingFrom) {
1011
- this.resumingFrom.currentAnimation = undefined;
1012
- this.resumingFrom.preserveOpacity = undefined;
1013
- }
1014
- const stack = this.getStack();
1015
- stack && stack.exitAnimationComplete();
1016
- this.resumingFrom =
1017
- this.currentAnimation =
1018
- this.animationValues =
1019
- undefined;
1020
- this.notifyListeners("animationComplete");
1021
- }
1022
- finishAnimation() {
1023
- if (this.currentAnimation) {
1024
- this.mixTargetDelta && this.mixTargetDelta(animationTarget);
1025
- this.currentAnimation.stop();
1026
- }
1027
- this.completeAnimation();
1028
- }
1029
- applyTransformsToTarget() {
1030
- const lead = this.getLead();
1031
- let { targetWithTransforms, target, layout, latestValues } = lead;
1032
- if (!targetWithTransforms || !target || !layout)
1033
- return;
1034
- /**
1035
- * If we're only animating position, and this element isn't the lead element,
1036
- * then instead of projecting into the lead box we instead want to calculate
1037
- * a new target that aligns the two boxes but maintains the layout shape.
1038
- */
1039
- if (this !== lead &&
1040
- this.layout &&
1041
- layout &&
1042
- shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {
1043
- target = this.target || createBox();
1044
- const xLength = calcLength(this.layout.layoutBox.x);
1045
- target.x.min = lead.target.x.min;
1046
- target.x.max = target.x.min + xLength;
1047
- const yLength = calcLength(this.layout.layoutBox.y);
1048
- target.y.min = lead.target.y.min;
1049
- target.y.max = target.y.min + yLength;
1050
- }
1051
- copyBoxInto(targetWithTransforms, target);
1052
- /**
1053
- * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.
1054
- * This is the final box that we will then project into by calculating a transform delta and
1055
- * applying it to the corrected box.
1056
- */
1057
- transformBox(targetWithTransforms, latestValues);
1058
- /**
1059
- * Update the delta between the corrected box and the final target box, after
1060
- * user-set transforms are applied to it. This will be used by the renderer to
1061
- * create a transform style that will reproject the element from its layout layout
1062
- * into the desired bounding box.
1063
- */
1064
- calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);
1065
- }
1066
- registerSharedNode(layoutId, node) {
1067
- if (!this.sharedNodes.has(layoutId)) {
1068
- this.sharedNodes.set(layoutId, new NodeStack());
1069
- }
1070
- const stack = this.sharedNodes.get(layoutId);
1071
- stack.add(node);
1072
- const config = node.options.initialPromotionConfig;
1073
- node.promote({
1074
- transition: config ? config.transition : undefined,
1075
- preserveFollowOpacity: config && config.shouldPreserveFollowOpacity
1076
- ? config.shouldPreserveFollowOpacity(node)
1077
- : undefined,
1078
- });
1079
- }
1080
- isLead() {
1081
- const stack = this.getStack();
1082
- return stack ? stack.lead === this : true;
1083
- }
1084
- getLead() {
1085
- var _a;
1086
- const { layoutId } = this.options;
1087
- return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this;
1088
- }
1089
- getPrevLead() {
1090
- var _a;
1091
- const { layoutId } = this.options;
1092
- return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined;
1093
- }
1094
- getStack() {
1095
- const { layoutId } = this.options;
1096
- if (layoutId)
1097
- return this.root.sharedNodes.get(layoutId);
1098
- }
1099
- promote({ needsReset, transition, preserveFollowOpacity, } = {}) {
1100
- const stack = this.getStack();
1101
- if (stack)
1102
- stack.promote(this, preserveFollowOpacity);
1103
- if (needsReset) {
1104
- this.projectionDelta = undefined;
1105
- this.needsReset = true;
1106
- }
1107
- if (transition)
1108
- this.setOptions({ transition });
1109
- }
1110
- relegate() {
1111
- const stack = this.getStack();
1112
- if (stack) {
1113
- return stack.relegate(this);
1114
- }
1115
- else {
1116
- return false;
1117
- }
1118
- }
1119
- resetRotation() {
1120
- const { visualElement } = this.options;
1121
- if (!visualElement)
1122
- return;
1123
- // If there's no detected rotation values, we can early return without a forced render.
1124
- let hasRotate = false;
1125
- /**
1126
- * An unrolled check for rotation values. Most elements don't have any rotation and
1127
- * skipping the nested loop and new object creation is 50% faster.
1128
- */
1129
- const { latestValues } = visualElement;
1130
- if (latestValues.rotate ||
1131
- latestValues.rotateX ||
1132
- latestValues.rotateY ||
1133
- latestValues.rotateZ) {
1134
- hasRotate = true;
1135
- }
1136
- // If there's no rotation values, we don't need to do any more.
1137
- if (!hasRotate)
1138
- return;
1139
- const resetValues = {};
1140
- // Check the rotate value of all axes and reset to 0
1141
- for (let i = 0; i < transformAxes.length; i++) {
1142
- const key = "rotate" + transformAxes[i];
1143
- // Record the rotation and then temporarily set it to 0
1144
- if (latestValues[key]) {
1145
- resetValues[key] = latestValues[key];
1146
- visualElement.setStaticValue(key, 0);
1147
- }
1148
- }
1149
- // Force a render of this element to apply the transform with all rotations
1150
- // set to 0.
1151
- visualElement.render();
1152
- // Put back all the values we reset
1153
- for (const key in resetValues) {
1154
- visualElement.setStaticValue(key, resetValues[key]);
1155
- }
1156
- // Schedule a render for the next frame. This ensures we won't visually
1157
- // see the element with the reset rotate value applied.
1158
- visualElement.scheduleRender();
1159
- }
1160
- getProjectionStyles(styleProp = {}) {
1161
- var _a, _b;
1162
- // TODO: Return lifecycle-persistent object
1163
- const styles = {};
1164
- if (!this.instance || this.isSVG)
1165
- return styles;
1166
- if (!this.isVisible) {
1167
- return { visibility: "hidden" };
1168
- }
1169
- else {
1170
- styles.visibility = "";
1171
- }
1172
- const transformTemplate = this.getTransformTemplate();
1173
- if (this.needsReset) {
1174
- this.needsReset = false;
1175
- styles.opacity = "";
1176
- styles.pointerEvents =
1177
- resolveMotionValue(styleProp.pointerEvents) || "";
1178
- styles.transform = transformTemplate
1179
- ? transformTemplate(this.latestValues, "")
1180
- : "none";
1181
- return styles;
1182
- }
1183
- const lead = this.getLead();
1184
- if (!this.projectionDelta || !this.layout || !lead.target) {
1185
- const emptyStyles = {};
1186
- if (this.options.layoutId) {
1187
- emptyStyles.opacity =
1188
- this.latestValues.opacity !== undefined
1189
- ? this.latestValues.opacity
1190
- : 1;
1191
- emptyStyles.pointerEvents =
1192
- resolveMotionValue(styleProp.pointerEvents) || "";
1193
- }
1194
- if (this.hasProjected && !hasTransform(this.latestValues)) {
1195
- emptyStyles.transform = transformTemplate
1196
- ? transformTemplate({}, "")
1197
- : "none";
1198
- this.hasProjected = false;
1199
- }
1200
- return emptyStyles;
1201
- }
1202
- const valuesToRender = lead.animationValues || lead.latestValues;
1203
- this.applyTransformsToTarget();
1204
- styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
1205
- if (transformTemplate) {
1206
- styles.transform = transformTemplate(valuesToRender, styles.transform);
1207
- }
1208
- const { x, y } = this.projectionDelta;
1209
- styles.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
1210
- if (lead.animationValues) {
1211
- /**
1212
- * If the lead component is animating, assign this either the entering/leaving
1213
- * opacity
1214
- */
1215
- styles.opacity =
1216
- lead === this
1217
- ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1
1218
- : this.preserveOpacity
1219
- ? this.latestValues.opacity
1220
- : valuesToRender.opacityExit;
1221
- }
1222
- else {
1223
- /**
1224
- * Or we're not animating at all, set the lead component to its layout
1225
- * opacity and other components to hidden.
1226
- */
1227
- styles.opacity =
1228
- lead === this
1229
- ? valuesToRender.opacity !== undefined
1230
- ? valuesToRender.opacity
1231
- : ""
1232
- : valuesToRender.opacityExit !== undefined
1233
- ? valuesToRender.opacityExit
1234
- : 0;
1235
- }
1236
- /**
1237
- * Apply scale correction
1238
- */
1239
- for (const key in scaleCorrectors) {
1240
- if (valuesToRender[key] === undefined)
1241
- continue;
1242
- const { correct, applyTo } = scaleCorrectors[key];
1243
- /**
1244
- * Only apply scale correction to the value if we have an
1245
- * active projection transform. Otherwise these values become
1246
- * vulnerable to distortion if the element changes size without
1247
- * a corresponding layout animation.
1248
- */
1249
- const corrected = styles.transform === "none"
1250
- ? valuesToRender[key]
1251
- : correct(valuesToRender[key], lead);
1252
- if (applyTo) {
1253
- const num = applyTo.length;
1254
- for (let i = 0; i < num; i++) {
1255
- styles[applyTo[i]] = corrected;
1256
- }
1257
- }
1258
- else {
1259
- styles[key] = corrected;
1260
- }
1261
- }
1262
- /**
1263
- * Disable pointer events on follow components. This is to ensure
1264
- * that if a follow component covers a lead component it doesn't block
1265
- * pointer events on the lead.
1266
- */
1267
- if (this.options.layoutId) {
1268
- styles.pointerEvents =
1269
- lead === this
1270
- ? resolveMotionValue(styleProp.pointerEvents) || ""
1271
- : "none";
1272
- }
1273
- return styles;
1274
- }
1275
- clearSnapshot() {
1276
- this.resumeFrom = this.snapshot = undefined;
1277
- }
1278
- // Only run on root
1279
- resetTree() {
1280
- this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });
1281
- this.root.nodes.forEach(clearMeasurements);
1282
- this.root.sharedNodes.clear();
1283
- }
1284
- };
1285
- }
1286
- function updateLayout(node) {
1287
- node.updateLayout();
1288
- }
1289
- function notifyLayoutUpdate(node) {
1290
- var _a;
1291
- const snapshot = ((_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node.snapshot;
1292
- if (node.isLead() &&
1293
- node.layout &&
1294
- snapshot &&
1295
- node.hasListeners("didUpdate")) {
1296
- const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
1297
- const { animationType } = node.options;
1298
- const isShared = snapshot.source !== node.layout.source;
1299
- // TODO Maybe we want to also resize the layout snapshot so we don't trigger
1300
- // animations for instance if layout="size" and an element has only changed position
1301
- if (animationType === "size") {
1302
- eachAxis((axis) => {
1303
- const axisSnapshot = isShared
1304
- ? snapshot.measuredBox[axis]
1305
- : snapshot.layoutBox[axis];
1306
- const length = calcLength(axisSnapshot);
1307
- axisSnapshot.min = layout[axis].min;
1308
- axisSnapshot.max = axisSnapshot.min + length;
1309
- });
1310
- }
1311
- else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {
1312
- eachAxis((axis) => {
1313
- const axisSnapshot = isShared
1314
- ? snapshot.measuredBox[axis]
1315
- : snapshot.layoutBox[axis];
1316
- const length = calcLength(layout[axis]);
1317
- axisSnapshot.max = axisSnapshot.min + length;
1318
- /**
1319
- * Ensure relative target gets resized and rerendererd
1320
- */
1321
- if (node.relativeTarget && !node.currentAnimation) {
1322
- node.isProjectionDirty = true;
1323
- node.relativeTarget[axis].max =
1324
- node.relativeTarget[axis].min + length;
1325
- }
1326
- });
1327
- }
1328
- const layoutDelta = createDelta();
1329
- calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);
1330
- const visualDelta = createDelta();
1331
- if (isShared) {
1332
- calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);
1333
- }
1334
- else {
1335
- calcBoxDelta(visualDelta, layout, snapshot.layoutBox);
1336
- }
1337
- const hasLayoutChanged = !isDeltaZero(layoutDelta);
1338
- let hasRelativeTargetChanged = false;
1339
- if (!node.resumeFrom) {
1340
- const relativeParent = node.getClosestProjectingParent();
1341
- /**
1342
- * If the relativeParent is itself resuming from a different element then
1343
- * the relative snapshot is not relavent
1344
- */
1345
- if (relativeParent && !relativeParent.resumeFrom) {
1346
- const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
1347
- if (parentSnapshot && parentLayout) {
1348
- const relativeSnapshot = createBox();
1349
- calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
1350
- const relativeLayout = createBox();
1351
- calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
1352
- if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
1353
- hasRelativeTargetChanged = true;
1354
- }
1355
- if (relativeParent.options.layoutRoot) {
1356
- node.relativeTarget = relativeLayout;
1357
- node.relativeTargetOrigin = relativeSnapshot;
1358
- node.relativeParent = relativeParent;
1359
- }
1360
- }
1361
- }
1362
- }
1363
- node.notifyListeners("didUpdate", {
1364
- layout,
1365
- snapshot,
1366
- delta: visualDelta,
1367
- layoutDelta,
1368
- hasLayoutChanged,
1369
- hasRelativeTargetChanged,
1370
- });
1371
- }
1372
- else if (node.isLead()) {
1373
- const { onExitComplete } = node.options;
1374
- onExitComplete && onExitComplete();
1375
- }
1376
- /**
1377
- * Clearing transition
1378
- * TODO: Investigate why this transition is being passed in as {type: false } from Framer
1379
- * and why we need it at all
1380
- */
1381
- node.options.transition = undefined;
1382
- }
1383
- function propagateDirtyNodes(node) {
1384
- /**
1385
- * Increase debug counter for nodes encountered this frame
1386
- */
1387
- projectionFrameData.totalNodes++;
1388
- if (!node.parent)
1389
- return;
1390
- /**
1391
- * If this node isn't projecting, propagate isProjectionDirty. It will have
1392
- * no performance impact but it will allow the next child that *is* projecting
1393
- * but *isn't* dirty to just check its parent to see if *any* ancestor needs
1394
- * correcting.
1395
- */
1396
- if (!node.isProjecting()) {
1397
- node.isProjectionDirty = node.parent.isProjectionDirty;
1398
- }
1399
- /**
1400
- * Propagate isSharedProjectionDirty and isTransformDirty
1401
- * throughout the whole tree. A future revision can take another look at
1402
- * this but for safety we still recalcualte shared nodes.
1403
- */
1404
- node.isSharedProjectionDirty || (node.isSharedProjectionDirty = Boolean(node.isProjectionDirty ||
1405
- node.parent.isProjectionDirty ||
1406
- node.parent.isSharedProjectionDirty));
1407
- node.isTransformDirty || (node.isTransformDirty = node.parent.isTransformDirty);
1408
- }
1409
- function cleanDirtyNodes(node) {
1410
- node.isProjectionDirty =
1411
- node.isSharedProjectionDirty =
1412
- node.isTransformDirty =
1413
- false;
1414
- }
1415
- function clearSnapshot(node) {
1416
- node.clearSnapshot();
1417
- }
1418
- function clearMeasurements(node) {
1419
- node.clearMeasurements();
1420
- }
1421
- function clearIsLayoutDirty(node) {
1422
- node.isLayoutDirty = false;
1423
- }
1424
- function resetTransformStyle(node) {
1425
- const { visualElement } = node.options;
1426
- if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {
1427
- visualElement.notify("BeforeLayoutMeasure");
1428
- }
1429
- node.resetTransform();
1430
- }
1431
- function finishAnimation(node) {
1432
- node.finishAnimation();
1433
- node.targetDelta = node.relativeTarget = node.target = undefined;
1434
- node.isProjectionDirty = true;
1435
- }
1436
- function resolveTargetDelta(node) {
1437
- node.resolveTargetDelta();
1438
- }
1439
- function calcProjection(node) {
1440
- node.calcProjection();
1441
- }
1442
- function resetRotation(node) {
1443
- node.resetRotation();
1444
- }
1445
- function removeLeadSnapshots(stack) {
1446
- stack.removeLeadSnapshot();
1447
- }
1448
- function mixAxisDelta(output, delta, p) {
1449
- output.translate = mix(delta.translate, 0, p);
1450
- output.scale = mix(delta.scale, 1, p);
1451
- output.origin = delta.origin;
1452
- output.originPoint = delta.originPoint;
1453
- }
1454
- function mixAxis(output, from, to, p) {
1455
- output.min = mix(from.min, to.min, p);
1456
- output.max = mix(from.max, to.max, p);
1457
- }
1458
- function mixBox(output, from, to, p) {
1459
- mixAxis(output.x, from.x, to.x, p);
1460
- mixAxis(output.y, from.y, to.y, p);
1461
- }
1462
- function hasOpacityCrossfade(node) {
1463
- return (node.animationValues && node.animationValues.opacityExit !== undefined);
1464
- }
1465
- const defaultLayoutTransition = {
1466
- duration: 0.45,
1467
- ease: [0.4, 0, 0.1, 1],
1468
- };
1469
- const userAgentContains = (string) => typeof navigator !== "undefined" &&
1470
- navigator.userAgent.toLowerCase().includes(string);
1471
- /**
1472
- * Measured bounding boxes must be rounded in Safari and
1473
- * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements
1474
- * can appear to jump.
1475
- */
1476
- const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/")
1477
- ? Math.round
1478
- : noop;
1479
- function roundAxis(axis) {
1480
- // Round to the nearest .5 pixels to support subpixel layouts
1481
- axis.min = roundPoint(axis.min);
1482
- axis.max = roundPoint(axis.max);
1483
- }
1484
- function roundBox(box) {
1485
- roundAxis(box.x);
1486
- roundAxis(box.y);
1487
- }
1488
- function shouldAnimatePositionOnly(animationType, snapshot, layout) {
1489
- return (animationType === "position" ||
1490
- (animationType === "preserve-aspect" &&
1491
- !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2)));
1492
- }
1493
-
1494
- export { cleanDirtyNodes, createProjectionNode, mixAxis, mixAxisDelta, mixBox, propagateDirtyNodes };