@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.
- package/dist/index.js +1342 -37064
- package/esm/_virtual/_commonjsHelpers.js +1 -3
- package/esm/core/ActionList/ActionListItem.js +18 -20
- package/esm/core/ActionList/ActionListSectionDivider.js +2 -2
- package/esm/core/ActionList/ActionListSectionHeader.js +3 -3
- package/esm/core/ActionList/index.js +3 -3
- package/esm/core/AnimatePresence/index.js +2 -5
- package/esm/core/Avatar/index.js +3 -3
- package/esm/core/AvatarGroup/AvatarGroupItem.js +4 -4
- package/esm/core/AvatarGroup/index.js +13 -13
- package/esm/core/BadgeAttacher/index.js +2 -2
- package/esm/core/Breadcrumbs/BreadcrumbsItem.js +4 -4
- package/esm/core/Breadcrumbs/index.js +5 -5
- package/esm/core/Button/index.js +7 -7
- package/esm/core/Card/index.js +1 -1
- package/esm/core/Checkbox/index.js +3 -3
- package/esm/core/Chip/index.js +4 -4
- package/esm/core/ClickArea/index.js +2 -2
- package/esm/core/CounterBadge/index.js +3 -3
- package/esm/core/Datagrid/DatagridBody.js +3 -3
- package/esm/core/Datagrid/DatagridCell.js +2 -2
- package/esm/core/Datagrid/DatagridHeader.js +7 -7
- package/esm/core/Datagrid/DatagridRow.js +3 -3
- package/esm/core/Datagrid/DatagridSubheader.js +3 -3
- package/esm/core/Datagrid/index.js +4 -4
- package/esm/core/DescriptionList/index.js +11 -11
- package/esm/core/Dialog/DialogBody.js +2 -2
- package/esm/core/Dialog/DialogFooter.js +2 -2
- package/esm/core/Dialog/DialogHeader.js +2 -2
- package/esm/core/Dialog/DialogHeaderSubtitle.js +2 -2
- package/esm/core/Dialog/DialogHeaderTitle.js +2 -2
- package/esm/core/Dialog/index.js +8 -8
- package/esm/core/Drawer/DrawerBody.js +2 -2
- package/esm/core/Drawer/DrawerFooter.js +2 -2
- package/esm/core/Drawer/DrawerHeader.js +2 -2
- package/esm/core/Drawer/DrawerHeaderIconButton.js +2 -2
- package/esm/core/Drawer/index.js +12 -13
- package/esm/core/EmptyState/index.js +8 -9
- package/esm/core/Flash/index.js +12 -15
- package/esm/core/FormControl/FormControlCaption.js +2 -2
- package/esm/core/FormControl/FormControlErrorMessage.js +2 -2
- package/esm/core/FormControl/FormControlLabel.js +5 -5
- package/esm/core/FormControl/FormControlSuccessMessage.js +2 -2
- package/esm/core/FormControl/FormControlTooltipIcon.js +5 -6
- package/esm/core/FormControl/index.js +8 -8
- package/esm/core/Grid/index.js +4 -6
- package/esm/core/HorizontalDivider/index.js +2 -2
- package/esm/core/IconButton/index.js +3 -3
- package/esm/core/IconToggleButton/index.js +3 -3
- package/esm/core/ItemList/index.js +2 -2
- package/esm/core/MotionView/index.js +1 -1
- package/esm/core/Overlay/index.js +4 -4
- package/esm/core/OverlayPopper/index.js +4 -6
- package/esm/core/Pagination/index.js +15 -17
- package/esm/core/Pill/index.js +11 -12
- package/esm/core/Radio/index.js +3 -3
- package/esm/core/SearchSelectInput/index.js +22 -28
- package/esm/core/Select/SelectOption.js +3 -3
- package/esm/core/Select/index.js +11 -13
- package/esm/core/Spinner/index.js +2 -3
- package/esm/core/Stack/index.js +4 -4
- package/esm/core/StyledIcon/index.js +3 -3
- package/esm/core/Switch/index.js +3 -3
- package/esm/core/Tab/TabItem.js +5 -5
- package/esm/core/Tab/index.js +18 -19
- package/esm/core/TextInput/TextInputTrailingAction.js +4 -4
- package/esm/core/TextInput/index.js +9 -11
- package/esm/core/Textarea/index.js +6 -8
- package/esm/core/ThemeProvider/index.js +2 -2
- package/esm/core/Toast/index.js +6 -8
- package/esm/core/Tooltip/BaseTooltip.js +8 -8
- package/esm/core/Tooltip/index.js +4 -4
- package/esm/core/Tooltip/useTooltip.js +1 -3
- package/esm/enigma/EnigmaUI/index.js +3 -4
- package/esm/enigma/Layout/SingleColumnLayout/index.js +4 -4
- package/esm/enigma/View/ChipGroupView/index.js +6 -6
- package/esm/enigma/View/GridView/index.js +5 -5
- package/esm/enigma/View/HorizontalDividerView/index.js +2 -2
- package/esm/enigma/View/IconView/index.js +4 -4
- package/esm/enigma/View/ImageView/index.js +2 -2
- package/esm/enigma/View/TextView/index.js +2 -2
- package/esm/hook/useFocusTrap.js +5 -5
- package/esm/hook/useFocusZone.js +2 -2
- package/esm/hook/useResize.js +1 -1
- package/esm/index.js +1 -1
- package/esm/theme/index.js +1 -13
- package/package.json +2 -2
- package/esm/_virtual/index.js +0 -3
- package/esm/_virtual/index2.js +0 -3
- package/esm/_virtual/index3.js +0 -3
- package/esm/_virtual/jsx-runtime.js +0 -3
- package/esm/_virtual/react-dom.development.js +0 -3
- package/esm/_virtual/react-dom.production.min.js +0 -3
- package/esm/_virtual/react-is.development.js +0 -3
- package/esm/_virtual/react-is.production.min.js +0 -3
- package/esm/_virtual/react-jsx-runtime.development.js +0 -3
- package/esm/_virtual/react-jsx-runtime.production.min.js +0 -3
- package/esm/_virtual/scheduler.development.js +0 -3
- package/esm/_virtual/scheduler.production.min.js +0 -3
- package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -593
- package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -731
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +0 -1621
- package/esm/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +0 -233
- package/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -321
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
- package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -136
- package/esm/node_modules/@primer/behaviors/dist/esm/focus-trap.js +0 -105
- package/esm/node_modules/@primer/behaviors/dist/esm/focus-zone.js +0 -436
- package/esm/node_modules/@primer/behaviors/dist/esm/polyfills/event-listener-signal.js +0 -38
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/iterate-focusable-elements.js +0 -65
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/unique-id.js +0 -6
- package/esm/node_modules/@primer/behaviors/dist/esm/utils/user-agent.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/animation/animators/instant.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/animation/animators/js/driver-frameloop.js +0 -16
- package/esm/node_modules/framer-motion/dist/es/animation/animators/js/index.js +0 -303
- package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.js +0 -199
- package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/easing.js +0 -31
- package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/index.js +0 -23
- package/esm/node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/animation/generators/inertia.js +0 -87
- package/esm/node_modules/framer-motion/dist/es/animation/generators/keyframes.js +0 -51
- package/esm/node_modules/framer-motion/dist/es/animation/generators/spring/find.js +0 -89
- package/esm/node_modules/framer-motion/dist/es/animation/generators/spring/index.js +0 -129
- package/esm/node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/animation/generators/utils/velocity.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/animation/interfaces/motion-value.js +0 -101
- package/esm/node_modules/framer-motion/dist/es/animation/interfaces/single-value.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.js +0 -71
- package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.js +0 -63
- package/esm/node_modules/framer-motion/dist/es/animation/interfaces/visual-element.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/animation/utils/default-transitions.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/animation/utils/is-animatable.js +0 -30
- package/esm/node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/animation/utils/is-none.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/animation/utils/keyframes.js +0 -45
- package/esm/node_modules/framer-motion/dist/es/animation/utils/transitions.js +0 -13
- package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -71
- package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -56
- package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -158
- package/esm/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
- package/esm/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/debug/record.js +0 -7
- package/esm/node_modules/framer-motion/dist/es/easing/anticipate.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/easing/back.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/easing/circ.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/easing/cubic-bezier.js +0 -51
- package/esm/node_modules/framer-motion/dist/es/easing/ease.js +0 -7
- package/esm/node_modules/framer-motion/dist/es/easing/modifiers/mirror.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/easing/modifiers/reverse.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/easing/utils/is-easing-array.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/easing/utils/map.js +0 -37
- package/esm/node_modules/framer-motion/dist/es/events/add-dom-event.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/events/event-info.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/frameloop/batcher.js +0 -60
- package/esm/node_modules/framer-motion/dist/es/frameloop/frame.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/frameloop/render-step.js +0 -104
- package/esm/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -457
- package/esm/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -27
- package/esm/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -125
- package/esm/node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js +0 -53
- package/esm/node_modules/framer-motion/dist/es/gestures/focus.js +0 -41
- package/esm/node_modules/framer-motion/dist/es/gestures/hover.js +0 -32
- package/esm/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -148
- package/esm/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -46
- package/esm/node_modules/framer-motion/dist/es/gestures/press.js +0 -120
- package/esm/node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js +0 -20
- package/esm/node_modules/framer-motion/dist/es/motion/features/Feature.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -31
- package/esm/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -38
- package/esm/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
- package/esm/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -28
- package/esm/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
- package/esm/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -131
- package/esm/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -72
- package/esm/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -49
- package/esm/node_modules/framer-motion/dist/es/motion/index.js +0 -79
- package/esm/node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -33
- package/esm/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -75
- package/esm/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -81
- package/esm/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -59
- package/esm/node_modules/framer-motion/dist/es/projection/animation/mix-values.js +0 -93
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/conversion.js +0 -33
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/copy.js +0 -20
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-apply.js +0 -122
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-calc.js +0 -41
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/delta-remove.js +0 -54
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/models.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/projection/geometry/utils.js +0 -25
- package/esm/node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.js +0 -13
- package/esm/node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.js +0 -27
- package/esm/node_modules/framer-motion/dist/es/projection/node/create-projection-node.js +0 -1494
- package/esm/node_modules/framer-motion/dist/es/projection/node/state.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/projection/shared/stack.js +0 -112
- package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.js +0 -41
- package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.js +0 -35
- package/esm/node_modules/framer-motion/dist/es/projection/styles/scale-correction.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/projection/styles/transform.js +0 -42
- package/esm/node_modules/framer-motion/dist/es/projection/utils/each-axis.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/projection/utils/has-transform.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/projection/utils/measure.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/render/VisualElement.js +0 -507
- package/esm/node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.js +0 -48
- package/esm/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/render/dom/motion-proxy.js +0 -47
- package/esm/node_modules/framer-motion/dist/es/render/dom/motion.js +0 -23
- package/esm/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -35
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/create-config.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js +0 -89
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -57
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -30
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js +0 -230
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js +0 -30
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/find.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js +0 -10
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/number.js +0 -72
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/test.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.js +0 -55
- package/esm/node_modules/framer-motion/dist/es/render/html/config-motion.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -57
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/build-styles.js +0 -74
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/build-transform.js +0 -45
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/render.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/render/html/utils/transform.js +0 -28
- package/esm/node_modules/framer-motion/dist/es/render/store.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.js +0 -46
- package/esm/node_modules/framer-motion/dist/es/render/svg/config-motion.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -33
- package/esm/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js +0 -52
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js +0 -30
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/path.js +0 -32
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/render.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/render/utils/animation-state.js +0 -319
- package/esm/node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/render/utils/flat-tree.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.js +0 -13
- package/esm/node_modules/framer-motion/dist/es/render/utils/is-variant-label.js +0 -8
- package/esm/node_modules/framer-motion/dist/es/render/utils/motion-values.js +0 -63
- package/esm/node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/render/utils/resolve-variants.js +0 -26
- package/esm/node_modules/framer-motion/dist/es/render/utils/setters.js +0 -101
- package/esm/node_modules/framer-motion/dist/es/render/utils/variant-props.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/utils/array.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/utils/clamp.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/utils/delay.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/utils/errors.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/utils/hsla-to-rgba.js +0 -42
- package/esm/node_modules/framer-motion/dist/es/utils/interpolate.js +0 -92
- package/esm/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/utils/is-numerical-string.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/utils/is-zero-value-string.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/utils/memo.js +0 -10
- package/esm/node_modules/framer-motion/dist/es/utils/mix-color.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/utils/mix-complex.js +0 -64
- package/esm/node_modules/framer-motion/dist/es/utils/mix.js +0 -24
- package/esm/node_modules/framer-motion/dist/es/utils/noop.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/utils/offsets/default.js +0 -9
- package/esm/node_modules/framer-motion/dist/es/utils/offsets/fill.js +0 -12
- package/esm/node_modules/framer-motion/dist/es/utils/offsets/time.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/utils/pipe.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/utils/progress.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/utils/reduced-motion/index.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/utils/reduced-motion/state.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/utils/resolve-value.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/utils/shallow-compare.js +0 -14
- package/esm/node_modules/framer-motion/dist/es/utils/subscription-manager.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/utils/time-conversion.js +0 -10
- package/esm/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -18
- package/esm/node_modules/framer-motion/dist/es/utils/use-force-update.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/utils/use-instant-transition-state.js +0 -5
- package/esm/node_modules/framer-motion/dist/es/utils/use-is-mounted.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
- package/esm/node_modules/framer-motion/dist/es/utils/use-unmount-effect.js +0 -7
- package/esm/node_modules/framer-motion/dist/es/utils/velocity-per-second.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/utils/warn-once.js +0 -11
- package/esm/node_modules/framer-motion/dist/es/value/index.js +0 -331
- package/esm/node_modules/framer-motion/dist/es/value/types/color/hex.js +0 -40
- package/esm/node_modules/framer-motion/dist/es/value/types/color/hsla.js +0 -22
- package/esm/node_modules/framer-motion/dist/es/value/types/color/index.js +0 -28
- package/esm/node_modules/framer-motion/dist/es/value/types/color/rgba.js +0 -25
- package/esm/node_modules/framer-motion/dist/es/value/types/color/utils.js +0 -23
- package/esm/node_modules/framer-motion/dist/es/value/types/complex/filter.js +0 -30
- package/esm/node_modules/framer-motion/dist/es/value/types/complex/index.js +0 -92
- package/esm/node_modules/framer-motion/dist/es/value/types/numbers/index.js +0 -17
- package/esm/node_modules/framer-motion/dist/es/value/types/numbers/units.js +0 -19
- package/esm/node_modules/framer-motion/dist/es/value/types/utils.js +0 -15
- package/esm/node_modules/framer-motion/dist/es/value/use-will-change/is.js +0 -7
- package/esm/node_modules/framer-motion/dist/es/value/utils/is-motion-value.js +0 -3
- package/esm/node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js +0 -16
- package/esm/node_modules/lodash.debounce/index.js +0 -363
- package/esm/node_modules/lodash.throttle/index.js +0 -424
- package/esm/node_modules/lodash.toarray/index.js +0 -849
- package/esm/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1140
- package/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -53
- package/esm/node_modules/react/jsx-runtime.js +0 -12
- package/esm/node_modules/react-dom/cjs/react-dom.development.js +0 -4940
- package/esm/node_modules/react-dom/cjs/react-dom.production.min.js +0 -7140
- package/esm/node_modules/react-dom/index.js +0 -39
- package/esm/node_modules/react-is/cjs/react-is.development.js +0 -211
- package/esm/node_modules/react-is/cjs/react-is.production.min.js +0 -123
- package/esm/node_modules/react-is/index.js +0 -12
- package/esm/node_modules/scheduler/cjs/scheduler.development.js +0 -528
- package/esm/node_modules/scheduler/cjs/scheduler.production.min.js +0 -267
- package/esm/node_modules/scheduler/index.js +0 -17
- package/esm/node_modules/tabbable/dist/index.esm.js +0 -560
- package/esm/packages/icons/esm/AHorizontalLine.js +0 -15
- package/esm/packages/icons/esm/AInCircleFilled.js +0 -21
- package/esm/packages/icons/esm/AVertialLine.js +0 -15
- package/esm/packages/icons/esm/Ai.js +0 -23
- package/esm/packages/icons/esm/AiColor.js +0 -23
- package/esm/packages/icons/esm/AiSad.js +0 -24
- package/esm/packages/icons/esm/Alarm.js +0 -17
- package/esm/packages/icons/esm/AppleColor.js +0 -18
- package/esm/packages/icons/esm/ArrowBelow.js +0 -17
- package/esm/packages/icons/esm/ArrowDiagonal.js +0 -15
- package/esm/packages/icons/esm/ArrowDown.js +0 -17
- package/esm/packages/icons/esm/ArrowLeft.js +0 -17
- package/esm/packages/icons/esm/ArrowLeftCircle.js +0 -15
- package/esm/packages/icons/esm/ArrowLeftLimit.js +0 -17
- package/esm/packages/icons/esm/ArrowLeftRight.js +0 -17
- package/esm/packages/icons/esm/ArrowRight.js +0 -17
- package/esm/packages/icons/esm/ArrowRightCircle.js +0 -15
- package/esm/packages/icons/esm/ArrowRightLimit.js +0 -17
- package/esm/packages/icons/esm/ArrowUp.js +0 -17
- package/esm/packages/icons/esm/ArrowUpDown.js +0 -17
- package/esm/packages/icons/esm/ArrowUpLimit.js +0 -17
- package/esm/packages/icons/esm/Barchart.js +0 -15
- package/esm/packages/icons/esm/Book.js +0 -17
- package/esm/packages/icons/esm/BookColor.js +0 -28
- package/esm/packages/icons/esm/Bookmark.js +0 -17
- package/esm/packages/icons/esm/BookmarkAnimation.js +0 -17
- package/esm/packages/icons/esm/Box.js +0 -24
- package/esm/packages/icons/esm/BoxPlus.js +0 -15
- package/esm/packages/icons/esm/BusColor.js +0 -36
- package/esm/packages/icons/esm/Calendar.js +0 -22
- package/esm/packages/icons/esm/CalendarCheck.js +0 -17
- package/esm/packages/icons/esm/CalendarCheckColor.js +0 -20
- package/esm/packages/icons/esm/CalendarColor.js +0 -36
- package/esm/packages/icons/esm/Camera.js +0 -22
- package/esm/packages/icons/esm/CameraColor.js +0 -30
- package/esm/packages/icons/esm/Card.js +0 -17
- package/esm/packages/icons/esm/CardsPercent.js +0 -19
- package/esm/packages/icons/esm/CardsPercentColor.js +0 -23
- package/esm/packages/icons/esm/CaretDown.js +0 -15
- package/esm/packages/icons/esm/CaretLeft.js +0 -15
- package/esm/packages/icons/esm/CaretRight.js +0 -15
- package/esm/packages/icons/esm/CaretUp.js +0 -15
- package/esm/packages/icons/esm/Cart.js +0 -17
- package/esm/packages/icons/esm/ChatBubble.js +0 -17
- package/esm/packages/icons/esm/ChatBubbleBadgeColor.js +0 -32
- package/esm/packages/icons/esm/ChatBubbleCorrect.js +0 -24
- package/esm/packages/icons/esm/ChatBubbleCorrectColor.js +0 -22
- package/esm/packages/icons/esm/ChatBubbleDots.js +0 -17
- package/esm/packages/icons/esm/ChatBubbleQuestion.js +0 -17
- package/esm/packages/icons/esm/ChatBubbleQuestionAnimation.js +0 -16
- package/esm/packages/icons/esm/ChatBubbleQuestionColor.js +0 -20
- package/esm/packages/icons/esm/Check.js +0 -15
- package/esm/packages/icons/esm/CheckInCircle.js +0 -17
- package/esm/packages/icons/esm/CheckInCircleColor.js +0 -20
- package/esm/packages/icons/esm/CheckInCircleLine.js +0 -20
- package/esm/packages/icons/esm/ChevronDown.js +0 -17
- package/esm/packages/icons/esm/ChevronDownTwo.js +0 -23
- package/esm/packages/icons/esm/ChevronLeft.js +0 -17
- package/esm/packages/icons/esm/ChevronRight.js +0 -17
- package/esm/packages/icons/esm/ChevronRightTwo.js +0 -23
- package/esm/packages/icons/esm/ChevronUp.js +0 -17
- package/esm/packages/icons/esm/ChevronUpTwo.js +0 -23
- package/esm/packages/icons/esm/Circles.js +0 -17
- package/esm/packages/icons/esm/Clip.js +0 -15
- package/esm/packages/icons/esm/Close.js +0 -17
- package/esm/packages/icons/esm/CloseInCircle.js +0 -17
- package/esm/packages/icons/esm/Coin.js +0 -17
- package/esm/packages/icons/esm/Contact.js +0 -17
- package/esm/packages/icons/esm/Copy.js +0 -22
- package/esm/packages/icons/esm/Correct.js +0 -16
- package/esm/packages/icons/esm/Coupon.js +0 -17
- package/esm/packages/icons/esm/Crop.js +0 -24
- package/esm/packages/icons/esm/Crown.js +0 -17
- package/esm/packages/icons/esm/Curriculum.js +0 -31
- package/esm/packages/icons/esm/CurriculumColor.js +0 -38
- package/esm/packages/icons/esm/Cursor.js +0 -22
- package/esm/packages/icons/esm/Delete.js +0 -17
- package/esm/packages/icons/esm/Document.js +0 -22
- package/esm/packages/icons/esm/Dots.js +0 -17
- package/esm/packages/icons/esm/Download.js +0 -18
- package/esm/packages/icons/esm/Emoji.js +0 -17
- package/esm/packages/icons/esm/EmojiPlus.js +0 -22
- package/esm/packages/icons/esm/EmojiPlusDash.js +0 -17
- package/esm/packages/icons/esm/Eng.js +0 -20
- package/esm/packages/icons/esm/Enter.js +0 -17
- package/esm/packages/icons/esm/Equal.js +0 -17
- package/esm/packages/icons/esm/Eraser.js +0 -17
- package/esm/packages/icons/esm/ExclamationPointInCircle.js +0 -17
- package/esm/packages/icons/esm/ExternalLink.js +0 -27
- package/esm/packages/icons/esm/EyeOff.js +0 -15
- package/esm/packages/icons/esm/EyeOn.js +0 -22
- package/esm/packages/icons/esm/EyesTwo.js +0 -15
- package/esm/packages/icons/esm/FaceHappy.js +0 -17
- package/esm/packages/icons/esm/FaceSad.js +0 -17
- package/esm/packages/icons/esm/Facebook.js +0 -15
- package/esm/packages/icons/esm/FacebookColor.js +0 -20
- package/esm/packages/icons/esm/Filter.js +0 -17
- package/esm/packages/icons/esm/Find.js +0 -17
- package/esm/packages/icons/esm/Fire.js +0 -15
- package/esm/packages/icons/esm/FireColor.js +0 -27
- package/esm/packages/icons/esm/Flag.js +0 -15
- package/esm/packages/icons/esm/Folder.js +0 -17
- package/esm/packages/icons/esm/Frame.js +0 -17
- package/esm/packages/icons/esm/Glasses.js +0 -17
- package/esm/packages/icons/esm/Global.js +0 -17
- package/esm/packages/icons/esm/GoogleColor.js +0 -35
- package/esm/packages/icons/esm/Graph.js +0 -17
- package/esm/packages/icons/esm/Hair.js +0 -17
- package/esm/packages/icons/esm/Headphone.js +0 -17
- package/esm/packages/icons/esm/Heart.js +0 -17
- package/esm/packages/icons/esm/Home.js +0 -17
- package/esm/packages/icons/esm/Infinite.js +0 -15
- package/esm/packages/icons/esm/InfoInCircle.js +0 -17
- package/esm/packages/icons/esm/Instagram.js +0 -17
- package/esm/packages/icons/esm/KakaoColor.js +0 -20
- package/esm/packages/icons/esm/Kor.js +0 -20
- package/esm/packages/icons/esm/LandscapeArrow.js +0 -20
- package/esm/packages/icons/esm/League.js +0 -17
- package/esm/packages/icons/esm/Letter.js +0 -17
- package/esm/packages/icons/esm/LetterCrownColor.js +0 -26
- package/esm/packages/icons/esm/LetterCrownOpenColor.js +0 -35
- package/esm/packages/icons/esm/LetterHeartColor.js +0 -26
- package/esm/packages/icons/esm/LetterHeartOpenColor.js +0 -35
- package/esm/packages/icons/esm/LineThree.js +0 -17
- package/esm/packages/icons/esm/Link.js +0 -22
- package/esm/packages/icons/esm/Lock.js +0 -17
- package/esm/packages/icons/esm/LogoApple.js +0 -17
- package/esm/packages/icons/esm/LogoColor.js +0 -22
- package/esm/packages/icons/esm/LogoFacebook.js +0 -17
- package/esm/packages/icons/esm/LogoKakao.js +0 -17
- package/esm/packages/icons/esm/LogoNaver.js +0 -15
- package/esm/packages/icons/esm/MagicWand.js +0 -22
- package/esm/packages/icons/esm/Maxsize.js +0 -15
- package/esm/packages/icons/esm/Minsize.js +0 -17
- package/esm/packages/icons/esm/Minus.js +0 -17
- package/esm/packages/icons/esm/MinusInCircle.js +0 -17
- package/esm/packages/icons/esm/Moneybag.js +0 -17
- package/esm/packages/icons/esm/MoneybagColor.js +0 -20
- package/esm/packages/icons/esm/Moon.js +0 -15
- package/esm/packages/icons/esm/More.js +0 -17
- package/esm/packages/icons/esm/MyBubble.js +0 -17
- package/esm/packages/icons/esm/NaverColor.js +0 -18
- package/esm/packages/icons/esm/New.js +0 -22
- package/esm/packages/icons/esm/Note.js +0 -17
- package/esm/packages/icons/esm/NoteColor.js +0 -18
- package/esm/packages/icons/esm/NotePenColor.js +0 -46
- package/esm/packages/icons/esm/NumberFiveFilled.js +0 -17
- package/esm/packages/icons/esm/NumberFiveOutlined.js +0 -20
- package/esm/packages/icons/esm/NumberFourFilled.js +0 -17
- package/esm/packages/icons/esm/NumberFourOutlined.js +0 -20
- package/esm/packages/icons/esm/NumberOneFilled.js +0 -17
- package/esm/packages/icons/esm/NumberOneOutlined.js +0 -20
- package/esm/packages/icons/esm/NumberThreeFilled.js +0 -17
- package/esm/packages/icons/esm/NumberThreeOutlined.js +0 -20
- package/esm/packages/icons/esm/NumberTwoFilled.js +0 -17
- package/esm/packages/icons/esm/NumberTwoOutlined.js +0 -20
- package/esm/packages/icons/esm/Out.js +0 -17
- package/esm/packages/icons/esm/PalmTreeColor.js +0 -41
- package/esm/packages/icons/esm/PaperCheck.js +0 -36
- package/esm/packages/icons/esm/PaperPen.js +0 -31
- package/esm/packages/icons/esm/PaperPenColor.js +0 -20
- package/esm/packages/icons/esm/PaperTwo.js +0 -18
- package/esm/packages/icons/esm/Pause.js +0 -17
- package/esm/packages/icons/esm/Pen.js +0 -17
- package/esm/packages/icons/esm/PercentInCircle.js +0 -22
- package/esm/packages/icons/esm/Picture.js +0 -17
- package/esm/packages/icons/esm/Pill.js +0 -25
- package/esm/packages/icons/esm/PillColor.js +0 -18
- package/esm/packages/icons/esm/Pin.js +0 -17
- package/esm/packages/icons/esm/PinColorRed.js +0 -26
- package/esm/packages/icons/esm/Play.js +0 -15
- package/esm/packages/icons/esm/Plus.js +0 -17
- package/esm/packages/icons/esm/PlusInCircle.js +0 -17
- package/esm/packages/icons/esm/PointInCircle.js +0 -22
- package/esm/packages/icons/esm/PointInCircleColor.js +0 -27
- package/esm/packages/icons/esm/PortraitArrow.js +0 -20
- package/esm/packages/icons/esm/Present.js +0 -21
- package/esm/packages/icons/esm/PresentColor.js +0 -20
- package/esm/packages/icons/esm/Print.js +0 -20
- package/esm/packages/icons/esm/Problem.js +0 -15
- package/esm/packages/icons/esm/Profile.js +0 -17
- package/esm/packages/icons/esm/ProgressGradient.js +0 -41
- package/esm/packages/icons/esm/QuestionMarkInCircle.js +0 -17
- package/esm/packages/icons/esm/QuestionMarkInCircleOutlined.js +0 -20
- package/esm/packages/icons/esm/QuizColor.js +0 -28
- package/esm/packages/icons/esm/RaffleColor.js +0 -113
- package/esm/packages/icons/esm/Receipt.js +0 -17
- package/esm/packages/icons/esm/Refresh.js +0 -17
- package/esm/packages/icons/esm/Repeat.js +0 -15
- package/esm/packages/icons/esm/ReportColor.js +0 -30
- package/esm/packages/icons/esm/School.js +0 -20
- package/esm/packages/icons/esm/SchoolColor.js +0 -27
- package/esm/packages/icons/esm/Scroll.js +0 -22
- package/esm/packages/icons/esm/Search.js +0 -15
- package/esm/packages/icons/esm/Set.js +0 -20
- package/esm/packages/icons/esm/Setting.js +0 -17
- package/esm/packages/icons/esm/Share.js +0 -22
- package/esm/packages/icons/esm/ShieldCheck.js +0 -15
- package/esm/packages/icons/esm/Sidebar.js +0 -17
- package/esm/packages/icons/esm/Siren.js +0 -17
- package/esm/packages/icons/esm/Skipback.js +0 -17
- package/esm/packages/icons/esm/Skipforward.js +0 -17
- package/esm/packages/icons/esm/SoundOff.js +0 -15
- package/esm/packages/icons/esm/SoundOn.js +0 -25
- package/esm/packages/icons/esm/SoundPaper.js +0 -20
- package/esm/packages/icons/esm/Speaker.js +0 -17
- package/esm/packages/icons/esm/Stackup.js +0 -27
- package/esm/packages/icons/esm/Star.js +0 -17
- package/esm/packages/icons/esm/StarColor.js +0 -21
- package/esm/packages/icons/esm/Store.js +0 -15
- package/esm/packages/icons/esm/Sun.js +0 -15
- package/esm/packages/icons/esm/Sync.js +0 -17
- package/esm/packages/icons/esm/TestUploadColor.js +0 -26
- package/esm/packages/icons/esm/Thumbdown.js +0 -17
- package/esm/packages/icons/esm/Thumbup.js +0 -17
- package/esm/packages/icons/esm/Thunder.js +0 -17
- package/esm/packages/icons/esm/Ticket.js +0 -17
- package/esm/packages/icons/esm/TicketColor.js +0 -29
- package/esm/packages/icons/esm/Time.js +0 -17
- package/esm/packages/icons/esm/Timer.js +0 -17
- package/esm/packages/icons/esm/Top.js +0 -17
- package/esm/packages/icons/esm/Touch.js +0 -26
- package/esm/packages/icons/esm/Trash.js +0 -17
- package/esm/packages/icons/esm/Treasurebox.js +0 -22
- package/esm/packages/icons/esm/Trophy.js +0 -17
- package/esm/packages/icons/esm/Twinkle.js +0 -15
- package/esm/packages/icons/esm/TwinkleColor.js +0 -48
- package/esm/packages/icons/esm/Undo.js +0 -17
- package/esm/packages/icons/esm/University.js +0 -26
- package/esm/packages/icons/esm/UserBlocked.js +0 -17
- package/esm/packages/icons/esm/UserCheck.js +0 -17
- package/esm/packages/icons/esm/UserPlus.js +0 -17
- package/esm/packages/icons/esm/UserTwo.js +0 -23
- package/esm/packages/icons/esm/Video.js +0 -17
- package/esm/packages/icons/esm/VideoColor.js +0 -18
- package/esm/packages/icons/esm/VoteColor.js +0 -24
- package/esm/packages/icons/esm/Warning.js +0 -17
- package/esm/packages/icons/esm/Wifi.js +0 -27
- package/esm/packages/icons/esm/Workbook.js +0 -28
- package/esm/packages/icons/esm/WorkbookColor.js +0 -29
- package/esm/packages/icons/esm/Wrong.js +0 -20
- package/esm/packages/icons/esm/Youtube.js +0 -17
- package/esm/packages/icons/esm/_virtual/_rollupPluginBabelHelpers.js +0 -16
- package/esm/packages/icons/esm/index.js +0 -242
- package/esm/packages/token-studio/esm/foundation/breakpoint/device.js +0 -7
- package/esm/packages/token-studio/esm/foundation/gradient/colorStopList/index.js +0 -9
- package/esm/packages/token-studio/esm/foundation/gradient/direction/index.js +0 -9
- package/esm/packages/token-studio/esm/foundation/opacity/index.js +0 -5
- package/esm/packages/token-studio/esm/foundation/palette/index.js +0 -169
- package/esm/packages/token-studio/esm/foundation/rounding/index.js +0 -13
- package/esm/packages/token-studio/esm/foundation/shadow/index.js +0 -5
- package/esm/packages/token-studio/esm/foundation/spacing/index.js +0 -56
- package/esm/packages/token-studio/esm/foundation/typography/fontSize/index.js +0 -18
- package/esm/packages/token-studio/esm/foundation/typography/fontWeight/index.js +0 -13
- package/esm/packages/token-studio/esm/foundation/typography/lineHeight/index.js +0 -6
- package/esm/packages/token-studio/esm/token/breakpoints/index.js +0 -6
- package/esm/packages/token-studio/esm/token/color/gpai/dark.js +0 -223
- package/esm/packages/token-studio/esm/token/color/gpai/light.js +0 -223
- package/esm/packages/token-studio/esm/token/color/index.js +0 -223
- package/esm/packages/token-studio/esm/token/elevation/index.js +0 -7
- package/esm/packages/token-studio/esm/token/gradient/index.js +0 -41
- package/esm/packages/token-studio/esm/token/opacity/index.js +0 -7
- package/esm/packages/token-studio/esm/token/radii/index.js +0 -15
- package/esm/packages/token-studio/esm/token/space/index.js +0 -55
- package/esm/packages/token-studio/esm/token/typography/fontSizes.js +0 -17
- package/esm/packages/token-studio/esm/token/typography/fontWeights.js +0 -9
- package/esm/packages/token-studio/esm/token/typography/index.js +0 -133
- package/esm/packages/token-studio/esm/token/typography/lineHeights.js +0 -8
- package/esm/packages/utils/esm/commaizeNumber.js +0 -10
- package/esm/packages/utils/esm/forcePixelValue.js +0 -8
- package/esm/packages/utils/esm/isArray.js +0 -3
- package/esm/packages/utils/esm/isFunction.js +0 -3
- package/esm/packages/utils/esm/isNullable.js +0 -3
- package/esm/packages/utils/esm/noop.js +0 -6
- package/esm/packages/utils/esm/scrollIntoView.js +0 -46
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { isAnimationControls } from '../../animation/utils/is-animation-controls.js';
|
|
2
|
-
import { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.js';
|
|
3
|
-
import { shallowCompare } from '../../utils/shallow-compare.js';
|
|
4
|
-
import { isVariantLabel } from './is-variant-label.js';
|
|
5
|
-
import { resolveVariant } from './resolve-dynamic-variants.js';
|
|
6
|
-
import { variantPriorityOrder } from './variant-props.js';
|
|
7
|
-
import { animateVisualElement } from '../../animation/interfaces/visual-element.js';
|
|
8
|
-
|
|
9
|
-
const reversePriorityOrder = [...variantPriorityOrder].reverse();
|
|
10
|
-
const numAnimationTypes = variantPriorityOrder.length;
|
|
11
|
-
function animateList(visualElement) {
|
|
12
|
-
return (animations) => Promise.all(animations.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
|
|
13
|
-
}
|
|
14
|
-
function createAnimationState(visualElement) {
|
|
15
|
-
let animate = animateList(visualElement);
|
|
16
|
-
const state = createState();
|
|
17
|
-
let isInitialRender = true;
|
|
18
|
-
/**
|
|
19
|
-
* This function will be used to reduce the animation definitions for
|
|
20
|
-
* each active animation type into an object of resolved values for it.
|
|
21
|
-
*/
|
|
22
|
-
const buildResolvedTypeValues = (acc, definition) => {
|
|
23
|
-
const resolved = resolveVariant(visualElement, definition);
|
|
24
|
-
if (resolved) {
|
|
25
|
-
const { transition, transitionEnd, ...target } = resolved;
|
|
26
|
-
acc = { ...acc, ...target, ...transitionEnd };
|
|
27
|
-
}
|
|
28
|
-
return acc;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* This just allows us to inject mocked animation functions
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
function setAnimateFunction(makeAnimator) {
|
|
35
|
-
animate = makeAnimator(visualElement);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* When we receive new props, we need to:
|
|
39
|
-
* 1. Create a list of protected keys for each type. This is a directory of
|
|
40
|
-
* value keys that are currently being "handled" by types of a higher priority
|
|
41
|
-
* so that whenever an animation is played of a given type, these values are
|
|
42
|
-
* protected from being animated.
|
|
43
|
-
* 2. Determine if an animation type needs animating.
|
|
44
|
-
* 3. Determine if any values have been removed from a type and figure out
|
|
45
|
-
* what to animate those to.
|
|
46
|
-
*/
|
|
47
|
-
function animateChanges(options, changedActiveType) {
|
|
48
|
-
const props = visualElement.getProps();
|
|
49
|
-
const context = visualElement.getVariantContext(true) || {};
|
|
50
|
-
/**
|
|
51
|
-
* A list of animations that we'll build into as we iterate through the animation
|
|
52
|
-
* types. This will get executed at the end of the function.
|
|
53
|
-
*/
|
|
54
|
-
const animations = [];
|
|
55
|
-
/**
|
|
56
|
-
* Keep track of which values have been removed. Then, as we hit lower priority
|
|
57
|
-
* animation types, we can check if they contain removed values and animate to that.
|
|
58
|
-
*/
|
|
59
|
-
const removedKeys = new Set();
|
|
60
|
-
/**
|
|
61
|
-
* A dictionary of all encountered keys. This is an object to let us build into and
|
|
62
|
-
* copy it without iteration. Each time we hit an animation type we set its protected
|
|
63
|
-
* keys - the keys its not allowed to animate - to the latest version of this object.
|
|
64
|
-
*/
|
|
65
|
-
let encounteredKeys = {};
|
|
66
|
-
/**
|
|
67
|
-
* If a variant has been removed at a given index, and this component is controlling
|
|
68
|
-
* variant animations, we want to ensure lower-priority variants are forced to animate.
|
|
69
|
-
*/
|
|
70
|
-
let removedVariantIndex = Infinity;
|
|
71
|
-
/**
|
|
72
|
-
* Iterate through all animation types in reverse priority order. For each, we want to
|
|
73
|
-
* detect which values it's handling and whether or not they've changed (and therefore
|
|
74
|
-
* need to be animated). If any values have been removed, we want to detect those in
|
|
75
|
-
* lower priority props and flag for animation.
|
|
76
|
-
*/
|
|
77
|
-
for (let i = 0; i < numAnimationTypes; i++) {
|
|
78
|
-
const type = reversePriorityOrder[i];
|
|
79
|
-
const typeState = state[type];
|
|
80
|
-
const prop = props[type] !== undefined ? props[type] : context[type];
|
|
81
|
-
const propIsVariant = isVariantLabel(prop);
|
|
82
|
-
/**
|
|
83
|
-
* If this type has *just* changed isActive status, set activeDelta
|
|
84
|
-
* to that status. Otherwise set to null.
|
|
85
|
-
*/
|
|
86
|
-
const activeDelta = type === changedActiveType ? typeState.isActive : null;
|
|
87
|
-
if (activeDelta === false)
|
|
88
|
-
removedVariantIndex = i;
|
|
89
|
-
/**
|
|
90
|
-
* If this prop is an inherited variant, rather than been set directly on the
|
|
91
|
-
* component itself, we want to make sure we allow the parent to trigger animations.
|
|
92
|
-
*
|
|
93
|
-
* TODO: Can probably change this to a !isControllingVariants check
|
|
94
|
-
*/
|
|
95
|
-
let isInherited = prop === context[type] && prop !== props[type] && propIsVariant;
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
if (isInherited &&
|
|
100
|
-
isInitialRender &&
|
|
101
|
-
visualElement.manuallyAnimateOnMount) {
|
|
102
|
-
isInherited = false;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Set all encountered keys so far as the protected keys for this type. This will
|
|
106
|
-
* be any key that has been animated or otherwise handled by active, higher-priortiy types.
|
|
107
|
-
*/
|
|
108
|
-
typeState.protectedKeys = { ...encounteredKeys };
|
|
109
|
-
// Check if we can skip analysing this prop early
|
|
110
|
-
if (
|
|
111
|
-
// If it isn't active and hasn't *just* been set as inactive
|
|
112
|
-
(!typeState.isActive && activeDelta === null) ||
|
|
113
|
-
// If we didn't and don't have any defined prop for this animation type
|
|
114
|
-
(!prop && !typeState.prevProp) ||
|
|
115
|
-
// Or if the prop doesn't define an animation
|
|
116
|
-
isAnimationControls(prop) ||
|
|
117
|
-
typeof prop === "boolean") {
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* As we go look through the values defined on this type, if we detect
|
|
122
|
-
* a changed value or a value that was removed in a higher priority, we set
|
|
123
|
-
* this to true and add this prop to the animation list.
|
|
124
|
-
*/
|
|
125
|
-
const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
|
|
126
|
-
let shouldAnimateType = variantDidChange ||
|
|
127
|
-
// If we're making this variant active, we want to always make it active
|
|
128
|
-
(type === changedActiveType &&
|
|
129
|
-
typeState.isActive &&
|
|
130
|
-
!isInherited &&
|
|
131
|
-
propIsVariant) ||
|
|
132
|
-
// If we removed a higher-priority variant (i is in reverse order)
|
|
133
|
-
(i > removedVariantIndex && propIsVariant);
|
|
134
|
-
/**
|
|
135
|
-
* As animations can be set as variant lists, variants or target objects, we
|
|
136
|
-
* coerce everything to an array if it isn't one already
|
|
137
|
-
*/
|
|
138
|
-
const definitionList = Array.isArray(prop) ? prop : [prop];
|
|
139
|
-
/**
|
|
140
|
-
* Build an object of all the resolved values. We'll use this in the subsequent
|
|
141
|
-
* animateChanges calls to determine whether a value has changed.
|
|
142
|
-
*/
|
|
143
|
-
let resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});
|
|
144
|
-
if (activeDelta === false)
|
|
145
|
-
resolvedValues = {};
|
|
146
|
-
/**
|
|
147
|
-
* Now we need to loop through all the keys in the prev prop and this prop,
|
|
148
|
-
* and decide:
|
|
149
|
-
* 1. If the value has changed, and needs animating
|
|
150
|
-
* 2. If it has been removed, and needs adding to the removedKeys set
|
|
151
|
-
* 3. If it has been removed in a higher priority type and needs animating
|
|
152
|
-
* 4. If it hasn't been removed in a higher priority but hasn't changed, and
|
|
153
|
-
* needs adding to the type's protectedKeys list.
|
|
154
|
-
*/
|
|
155
|
-
const { prevResolvedValues = {} } = typeState;
|
|
156
|
-
const allKeys = {
|
|
157
|
-
...prevResolvedValues,
|
|
158
|
-
...resolvedValues,
|
|
159
|
-
};
|
|
160
|
-
const markToAnimate = (key) => {
|
|
161
|
-
shouldAnimateType = true;
|
|
162
|
-
removedKeys.delete(key);
|
|
163
|
-
typeState.needsAnimating[key] = true;
|
|
164
|
-
};
|
|
165
|
-
for (const key in allKeys) {
|
|
166
|
-
const next = resolvedValues[key];
|
|
167
|
-
const prev = prevResolvedValues[key];
|
|
168
|
-
// If we've already handled this we can just skip ahead
|
|
169
|
-
if (encounteredKeys.hasOwnProperty(key))
|
|
170
|
-
continue;
|
|
171
|
-
/**
|
|
172
|
-
* If the value has changed, we probably want to animate it.
|
|
173
|
-
*/
|
|
174
|
-
if (next !== prev) {
|
|
175
|
-
/**
|
|
176
|
-
* If both values are keyframes, we need to shallow compare them to
|
|
177
|
-
* detect whether any value has changed. If it has, we animate it.
|
|
178
|
-
*/
|
|
179
|
-
if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
|
|
180
|
-
if (!shallowCompare(next, prev) || variantDidChange) {
|
|
181
|
-
markToAnimate(key);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
/**
|
|
185
|
-
* If it hasn't changed, we want to ensure it doesn't animate by
|
|
186
|
-
* adding it to the list of protected keys.
|
|
187
|
-
*/
|
|
188
|
-
typeState.protectedKeys[key] = true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
else if (next !== undefined) {
|
|
192
|
-
// If next is defined and doesn't equal prev, it needs animating
|
|
193
|
-
markToAnimate(key);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
// If it's undefined, it's been removed.
|
|
197
|
-
removedKeys.add(key);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
else if (next !== undefined && removedKeys.has(key)) {
|
|
201
|
-
/**
|
|
202
|
-
* If next hasn't changed and it isn't undefined, we want to check if it's
|
|
203
|
-
* been removed by a higher priority
|
|
204
|
-
*/
|
|
205
|
-
markToAnimate(key);
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
/**
|
|
209
|
-
* If it hasn't changed, we add it to the list of protected values
|
|
210
|
-
* to ensure it doesn't get animated.
|
|
211
|
-
*/
|
|
212
|
-
typeState.protectedKeys[key] = true;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Update the typeState so next time animateChanges is called we can compare the
|
|
217
|
-
* latest prop and resolvedValues to these.
|
|
218
|
-
*/
|
|
219
|
-
typeState.prevProp = prop;
|
|
220
|
-
typeState.prevResolvedValues = resolvedValues;
|
|
221
|
-
/**
|
|
222
|
-
*
|
|
223
|
-
*/
|
|
224
|
-
if (typeState.isActive) {
|
|
225
|
-
encounteredKeys = { ...encounteredKeys, ...resolvedValues };
|
|
226
|
-
}
|
|
227
|
-
if (isInitialRender && visualElement.blockInitialAnimation) {
|
|
228
|
-
shouldAnimateType = false;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* If this is an inherited prop we want to hard-block animations
|
|
232
|
-
* TODO: Test as this should probably still handle animations triggered
|
|
233
|
-
* by removed values?
|
|
234
|
-
*/
|
|
235
|
-
if (shouldAnimateType && !isInherited) {
|
|
236
|
-
animations.push(...definitionList.map((animation) => ({
|
|
237
|
-
animation: animation,
|
|
238
|
-
options: { type, ...options },
|
|
239
|
-
})));
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* If there are some removed value that haven't been dealt with,
|
|
244
|
-
* we need to create a new animation that falls back either to the value
|
|
245
|
-
* defined in the style prop, or the last read value.
|
|
246
|
-
*/
|
|
247
|
-
if (removedKeys.size) {
|
|
248
|
-
const fallbackAnimation = {};
|
|
249
|
-
removedKeys.forEach((key) => {
|
|
250
|
-
const fallbackTarget = visualElement.getBaseTarget(key);
|
|
251
|
-
if (fallbackTarget !== undefined) {
|
|
252
|
-
fallbackAnimation[key] = fallbackTarget;
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
animations.push({ animation: fallbackAnimation });
|
|
256
|
-
}
|
|
257
|
-
let shouldAnimate = Boolean(animations.length);
|
|
258
|
-
if (isInitialRender &&
|
|
259
|
-
props.initial === false &&
|
|
260
|
-
!visualElement.manuallyAnimateOnMount) {
|
|
261
|
-
shouldAnimate = false;
|
|
262
|
-
}
|
|
263
|
-
isInitialRender = false;
|
|
264
|
-
return shouldAnimate ? animate(animations) : Promise.resolve();
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Change whether a certain animation type is active.
|
|
268
|
-
*/
|
|
269
|
-
function setActive(type, isActive, options) {
|
|
270
|
-
var _a;
|
|
271
|
-
// If the active state hasn't changed, we can safely do nothing here
|
|
272
|
-
if (state[type].isActive === isActive)
|
|
273
|
-
return Promise.resolve();
|
|
274
|
-
// Propagate active change to children
|
|
275
|
-
(_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
|
|
276
|
-
state[type].isActive = isActive;
|
|
277
|
-
const animations = animateChanges(options, type);
|
|
278
|
-
for (const key in state) {
|
|
279
|
-
state[key].protectedKeys = {};
|
|
280
|
-
}
|
|
281
|
-
return animations;
|
|
282
|
-
}
|
|
283
|
-
return {
|
|
284
|
-
animateChanges,
|
|
285
|
-
setActive,
|
|
286
|
-
setAnimateFunction,
|
|
287
|
-
getState: () => state,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
function checkVariantsDidChange(prev, next) {
|
|
291
|
-
if (typeof next === "string") {
|
|
292
|
-
return next !== prev;
|
|
293
|
-
}
|
|
294
|
-
else if (Array.isArray(next)) {
|
|
295
|
-
return !shallowCompare(next, prev);
|
|
296
|
-
}
|
|
297
|
-
return false;
|
|
298
|
-
}
|
|
299
|
-
function createTypeState(isActive = false) {
|
|
300
|
-
return {
|
|
301
|
-
isActive,
|
|
302
|
-
protectedKeys: {},
|
|
303
|
-
needsAnimating: {},
|
|
304
|
-
prevResolvedValues: {},
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function createState() {
|
|
308
|
-
return {
|
|
309
|
-
animate: createTypeState(true),
|
|
310
|
-
whileInView: createTypeState(),
|
|
311
|
-
whileHover: createTypeState(),
|
|
312
|
-
whileTap: createTypeState(),
|
|
313
|
-
whileDrag: createTypeState(),
|
|
314
|
-
whileFocus: createTypeState(),
|
|
315
|
-
exit: createTypeState(),
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export { checkVariantsDidChange, createAnimationState };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { addUniqueItem, removeItem } from '../../utils/array.js';
|
|
2
|
-
import { compareByDepth } from './compare-by-depth.js';
|
|
3
|
-
|
|
4
|
-
class FlatTree {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.children = [];
|
|
7
|
-
this.isDirty = false;
|
|
8
|
-
}
|
|
9
|
-
add(child) {
|
|
10
|
-
addUniqueItem(this.children, child);
|
|
11
|
-
this.isDirty = true;
|
|
12
|
-
}
|
|
13
|
-
remove(child) {
|
|
14
|
-
removeItem(this.children, child);
|
|
15
|
-
this.isDirty = true;
|
|
16
|
-
}
|
|
17
|
-
forEach(callback) {
|
|
18
|
-
this.isDirty && this.children.sort(compareByDepth);
|
|
19
|
-
this.isDirty = false;
|
|
20
|
-
this.children.forEach(callback);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { FlatTree };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isAnimationControls } from '../../animation/utils/is-animation-controls.js';
|
|
2
|
-
import { isVariantLabel } from './is-variant-label.js';
|
|
3
|
-
import { variantProps } from './variant-props.js';
|
|
4
|
-
|
|
5
|
-
function isControllingVariants(props) {
|
|
6
|
-
return (isAnimationControls(props.animate) ||
|
|
7
|
-
variantProps.some((name) => isVariantLabel(props[name])));
|
|
8
|
-
}
|
|
9
|
-
function isVariantNode(props) {
|
|
10
|
-
return Boolean(isControllingVariants(props) || props.variants);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { isControllingVariants, isVariantNode };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { isWillChangeMotionValue } from '../../value/use-will-change/is.js';
|
|
2
|
-
import { warnOnce } from '../../utils/warn-once.js';
|
|
3
|
-
import { motionValue } from '../../value/index.js';
|
|
4
|
-
import { isMotionValue } from '../../value/utils/is-motion-value.js';
|
|
5
|
-
|
|
6
|
-
function updateMotionValuesFromProps(element, next, prev) {
|
|
7
|
-
const { willChange } = next;
|
|
8
|
-
for (const key in next) {
|
|
9
|
-
const nextValue = next[key];
|
|
10
|
-
const prevValue = prev[key];
|
|
11
|
-
if (isMotionValue(nextValue)) {
|
|
12
|
-
/**
|
|
13
|
-
* If this is a motion value found in props or style, we want to add it
|
|
14
|
-
* to our visual element's motion value map.
|
|
15
|
-
*/
|
|
16
|
-
element.addValue(key, nextValue);
|
|
17
|
-
if (isWillChangeMotionValue(willChange)) {
|
|
18
|
-
willChange.add(key);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Check the version of the incoming motion value with this version
|
|
22
|
-
* and warn against mismatches.
|
|
23
|
-
*/
|
|
24
|
-
if (process.env.NODE_ENV === "development") {
|
|
25
|
-
warnOnce(nextValue.version === "10.16.4", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.16.4 may not work as expected.`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else if (isMotionValue(prevValue)) {
|
|
29
|
-
/**
|
|
30
|
-
* If we're swapping from a motion value to a static value,
|
|
31
|
-
* create a new motion value from that
|
|
32
|
-
*/
|
|
33
|
-
element.addValue(key, motionValue(nextValue, { owner: element }));
|
|
34
|
-
if (isWillChangeMotionValue(willChange)) {
|
|
35
|
-
willChange.remove(key);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (prevValue !== nextValue) {
|
|
39
|
-
/**
|
|
40
|
-
* If this is a flat value that has changed, update the motion value
|
|
41
|
-
* or create one if it doesn't exist. We only want to do this if we're
|
|
42
|
-
* not handling the value with our animation state.
|
|
43
|
-
*/
|
|
44
|
-
if (element.hasValue(key)) {
|
|
45
|
-
const existingValue = element.getValue(key);
|
|
46
|
-
// TODO: Only update values that aren't being animated or even looked at
|
|
47
|
-
!existingValue.hasAnimated && existingValue.set(nextValue);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
const latestValue = element.getStaticValue(key);
|
|
51
|
-
element.addValue(key, motionValue(latestValue !== undefined ? latestValue : nextValue, { owner: element }));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Handle removed values
|
|
56
|
-
for (const key in prev) {
|
|
57
|
-
if (next[key] === undefined)
|
|
58
|
-
element.removeValue(key);
|
|
59
|
-
}
|
|
60
|
-
return next;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { updateMotionValuesFromProps };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { resolveVariantFromProps } from './resolve-variants.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Creates an object containing the latest state of every MotionValue on a VisualElement
|
|
5
|
-
*/
|
|
6
|
-
function getCurrent(visualElement) {
|
|
7
|
-
const current = {};
|
|
8
|
-
visualElement.values.forEach((value, key) => (current[key] = value.get()));
|
|
9
|
-
return current;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Creates an object containing the latest velocity of every MotionValue on a VisualElement
|
|
13
|
-
*/
|
|
14
|
-
function getVelocity(visualElement) {
|
|
15
|
-
const velocity = {};
|
|
16
|
-
visualElement.values.forEach((value, key) => (velocity[key] = value.getVelocity()));
|
|
17
|
-
return velocity;
|
|
18
|
-
}
|
|
19
|
-
function resolveVariant(visualElement, definition, custom) {
|
|
20
|
-
const props = visualElement.getProps();
|
|
21
|
-
return resolveVariantFromProps(props, definition, custom !== undefined ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { resolveVariant };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
function resolveVariantFromProps(props, definition, custom, currentValues = {}, currentVelocity = {}) {
|
|
2
|
-
/**
|
|
3
|
-
* If the variant definition is a function, resolve.
|
|
4
|
-
*/
|
|
5
|
-
if (typeof definition === "function") {
|
|
6
|
-
definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* If the variant definition is a variant label, or
|
|
10
|
-
* the function returned a variant label, resolve.
|
|
11
|
-
*/
|
|
12
|
-
if (typeof definition === "string") {
|
|
13
|
-
definition = props.variants && props.variants[definition];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* At this point we've resolved both functions and variant labels,
|
|
17
|
-
* but the resolved variant label might itself have been a function.
|
|
18
|
-
* If so, resolve. This can only have returned a valid target object.
|
|
19
|
-
*/
|
|
20
|
-
if (typeof definition === "function") {
|
|
21
|
-
definition = definition(custom !== undefined ? custom : props.custom, currentValues, currentVelocity);
|
|
22
|
-
}
|
|
23
|
-
return definition;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { resolveVariantFromProps };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { isNumericalString } from '../../utils/is-numerical-string.js';
|
|
2
|
-
import { isZeroValueString } from '../../utils/is-zero-value-string.js';
|
|
3
|
-
import { resolveFinalValueInKeyframes } from '../../utils/resolve-value.js';
|
|
4
|
-
import { motionValue } from '../../value/index.js';
|
|
5
|
-
import { complex } from '../../value/types/complex/index.js';
|
|
6
|
-
import { getAnimatableNone } from '../dom/value-types/animatable-none.js';
|
|
7
|
-
import { findValueType } from '../dom/value-types/find.js';
|
|
8
|
-
import { resolveVariant } from './resolve-dynamic-variants.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Set VisualElement's MotionValue, creating a new MotionValue for it if
|
|
12
|
-
* it doesn't exist.
|
|
13
|
-
*/
|
|
14
|
-
function setMotionValue(visualElement, key, value) {
|
|
15
|
-
if (visualElement.hasValue(key)) {
|
|
16
|
-
visualElement.getValue(key).set(value);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
visualElement.addValue(key, motionValue(value));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function setTarget(visualElement, definition) {
|
|
23
|
-
const resolved = resolveVariant(visualElement, definition);
|
|
24
|
-
let { transitionEnd = {}, transition = {}, ...target } = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {};
|
|
25
|
-
target = { ...target, ...transitionEnd };
|
|
26
|
-
for (const key in target) {
|
|
27
|
-
const value = resolveFinalValueInKeyframes(target[key]);
|
|
28
|
-
setMotionValue(visualElement, key, value);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function checkTargetForNewValues(visualElement, target, origin) {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
const newValueKeys = Object.keys(target).filter((key) => !visualElement.hasValue(key));
|
|
34
|
-
const numNewValues = newValueKeys.length;
|
|
35
|
-
if (!numNewValues)
|
|
36
|
-
return;
|
|
37
|
-
for (let i = 0; i < numNewValues; i++) {
|
|
38
|
-
const key = newValueKeys[i];
|
|
39
|
-
const targetValue = target[key];
|
|
40
|
-
let value = null;
|
|
41
|
-
/**
|
|
42
|
-
* If the target is a series of keyframes, we can use the first value
|
|
43
|
-
* in the array. If this first value is null, we'll still need to read from the DOM.
|
|
44
|
-
*/
|
|
45
|
-
if (Array.isArray(targetValue)) {
|
|
46
|
-
value = targetValue[0];
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* If the target isn't keyframes, or the first keyframe was null, we need to
|
|
50
|
-
* first check if an origin value was explicitly defined in the transition as "from",
|
|
51
|
-
* if not read the value from the DOM. As an absolute fallback, take the defined target value.
|
|
52
|
-
*/
|
|
53
|
-
if (value === null) {
|
|
54
|
-
value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* If value is still undefined or null, ignore it. Preferably this would throw,
|
|
58
|
-
* but this was causing issues in Framer.
|
|
59
|
-
*/
|
|
60
|
-
if (value === undefined || value === null)
|
|
61
|
-
continue;
|
|
62
|
-
if (typeof value === "string" &&
|
|
63
|
-
(isNumericalString(value) || isZeroValueString(value))) {
|
|
64
|
-
// If this is a number read as a string, ie "0" or "200", convert it to a number
|
|
65
|
-
value = parseFloat(value);
|
|
66
|
-
}
|
|
67
|
-
else if (!findValueType(value) && complex.test(targetValue)) {
|
|
68
|
-
value = getAnimatableNone(key, targetValue);
|
|
69
|
-
}
|
|
70
|
-
visualElement.addValue(key, motionValue(value, { owner: visualElement }));
|
|
71
|
-
if (origin[key] === undefined) {
|
|
72
|
-
origin[key] = value;
|
|
73
|
-
}
|
|
74
|
-
if (value !== null)
|
|
75
|
-
visualElement.setBaseTarget(key, value);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function getOriginFromTransition(key, transition) {
|
|
79
|
-
if (!transition)
|
|
80
|
-
return;
|
|
81
|
-
const valueTransition = transition[key] || transition["default"] || transition;
|
|
82
|
-
return valueTransition.from;
|
|
83
|
-
}
|
|
84
|
-
function getOrigin(target, transition, visualElement) {
|
|
85
|
-
const origin = {};
|
|
86
|
-
for (const key in target) {
|
|
87
|
-
const transitionOrigin = getOriginFromTransition(key, transition);
|
|
88
|
-
if (transitionOrigin !== undefined) {
|
|
89
|
-
origin[key] = transitionOrigin;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
const value = visualElement.getValue(key);
|
|
93
|
-
if (value) {
|
|
94
|
-
origin[key] = value.get();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return origin;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { checkTargetForNewValues, getOrigin, getOriginFromTransition, setTarget };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { frame, cancelFrame } from '../frameloop/frame.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Timeout defined in ms
|
|
5
|
-
*/
|
|
6
|
-
function delay(callback, timeout) {
|
|
7
|
-
const start = performance.now();
|
|
8
|
-
const checkElapsed = ({ timestamp }) => {
|
|
9
|
-
const elapsed = timestamp - start;
|
|
10
|
-
if (elapsed >= timeout) {
|
|
11
|
-
cancelFrame(checkElapsed);
|
|
12
|
-
callback(elapsed - timeout);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
frame.read(checkElapsed, true);
|
|
16
|
-
return () => cancelFrame(checkElapsed);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { delay };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { noop } from './noop.js';
|
|
2
|
-
|
|
3
|
-
let warning = noop;
|
|
4
|
-
let invariant = noop;
|
|
5
|
-
if (process.env.NODE_ENV !== "production") {
|
|
6
|
-
warning = (check, message) => {
|
|
7
|
-
if (!check && typeof console !== "undefined") {
|
|
8
|
-
console.warn(message);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
invariant = (check, message) => {
|
|
12
|
-
if (!check) {
|
|
13
|
-
throw new Error(message);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { invariant, warning };
|