@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,8 +0,0 @@
|
|
|
1
|
-
import { addDomEvent } from './add-dom-event.js';
|
|
2
|
-
import { addPointerInfo } from './event-info.js';
|
|
3
|
-
|
|
4
|
-
function addPointerEvent(target, eventName, handler, options) {
|
|
5
|
-
return addDomEvent(target, eventName, addPointerInfo(handler), options);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { addPointerEvent };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isPrimaryPointer } from './utils/is-primary-pointer.js';
|
|
2
|
-
|
|
3
|
-
function extractEventInfo(event, pointType = "page") {
|
|
4
|
-
return {
|
|
5
|
-
point: {
|
|
6
|
-
x: event[pointType + "X"],
|
|
7
|
-
y: event[pointType + "Y"],
|
|
8
|
-
},
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
const addPointerInfo = (handler) => {
|
|
12
|
-
return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { addPointerInfo, extractEventInfo };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const isPrimaryPointer = (event) => {
|
|
2
|
-
if (event.pointerType === "mouse") {
|
|
3
|
-
return typeof event.button !== "number" || event.button <= 0;
|
|
4
|
-
}
|
|
5
|
-
else {
|
|
6
|
-
/**
|
|
7
|
-
* isPrimary is true for all mice buttons, whereas every touch point
|
|
8
|
-
* is regarded as its own input. So subsequent concurrent touch points
|
|
9
|
-
* will be false.
|
|
10
|
-
*
|
|
11
|
-
* Specifically match against false here as incomplete versions of
|
|
12
|
-
* PointerEvents in very old browser might have it set as undefined.
|
|
13
|
-
*/
|
|
14
|
-
return event.isPrimary !== false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { isPrimaryPointer };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { createRenderStep } from './render-step.js';
|
|
2
|
-
|
|
3
|
-
const stepsOrder = [
|
|
4
|
-
"prepare",
|
|
5
|
-
"read",
|
|
6
|
-
"update",
|
|
7
|
-
"preRender",
|
|
8
|
-
"render",
|
|
9
|
-
"postRender",
|
|
10
|
-
];
|
|
11
|
-
const maxElapsed = 40;
|
|
12
|
-
function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
|
|
13
|
-
let runNextFrame = false;
|
|
14
|
-
let useDefaultElapsed = true;
|
|
15
|
-
const state = {
|
|
16
|
-
delta: 0,
|
|
17
|
-
timestamp: 0,
|
|
18
|
-
isProcessing: false,
|
|
19
|
-
};
|
|
20
|
-
const steps = stepsOrder.reduce((acc, key) => {
|
|
21
|
-
acc[key] = createRenderStep(() => (runNextFrame = true));
|
|
22
|
-
return acc;
|
|
23
|
-
}, {});
|
|
24
|
-
const processStep = (stepId) => steps[stepId].process(state);
|
|
25
|
-
const processBatch = () => {
|
|
26
|
-
const timestamp = performance.now();
|
|
27
|
-
runNextFrame = false;
|
|
28
|
-
state.delta = useDefaultElapsed
|
|
29
|
-
? 1000 / 60
|
|
30
|
-
: Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1);
|
|
31
|
-
state.timestamp = timestamp;
|
|
32
|
-
state.isProcessing = true;
|
|
33
|
-
stepsOrder.forEach(processStep);
|
|
34
|
-
state.isProcessing = false;
|
|
35
|
-
if (runNextFrame && allowKeepAlive) {
|
|
36
|
-
useDefaultElapsed = false;
|
|
37
|
-
scheduleNextBatch(processBatch);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const wake = () => {
|
|
41
|
-
runNextFrame = true;
|
|
42
|
-
useDefaultElapsed = true;
|
|
43
|
-
if (!state.isProcessing) {
|
|
44
|
-
scheduleNextBatch(processBatch);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const schedule = stepsOrder.reduce((acc, key) => {
|
|
48
|
-
const step = steps[key];
|
|
49
|
-
acc[key] = (process, keepAlive = false, immediate = false) => {
|
|
50
|
-
if (!runNextFrame)
|
|
51
|
-
wake();
|
|
52
|
-
return step.schedule(process, keepAlive, immediate);
|
|
53
|
-
};
|
|
54
|
-
return acc;
|
|
55
|
-
}, {});
|
|
56
|
-
const cancel = (process) => stepsOrder.forEach((key) => steps[key].cancel(process));
|
|
57
|
-
return { schedule, cancel, state, steps };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { createRenderBatcher, stepsOrder };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { noop } from '../utils/noop.js';
|
|
2
|
-
import { createRenderBatcher } from './batcher.js';
|
|
3
|
-
|
|
4
|
-
const { schedule: frame, cancel: cancelFrame, state: frameData, steps, } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop, true);
|
|
5
|
-
|
|
6
|
-
export { cancelFrame, frame, frameData, steps };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
class Queue {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.order = [];
|
|
4
|
-
this.scheduled = new Set();
|
|
5
|
-
}
|
|
6
|
-
add(process) {
|
|
7
|
-
if (!this.scheduled.has(process)) {
|
|
8
|
-
this.scheduled.add(process);
|
|
9
|
-
this.order.push(process);
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
remove(process) {
|
|
14
|
-
const index = this.order.indexOf(process);
|
|
15
|
-
if (index !== -1) {
|
|
16
|
-
this.order.splice(index, 1);
|
|
17
|
-
this.scheduled.delete(process);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
clear() {
|
|
21
|
-
this.order.length = 0;
|
|
22
|
-
this.scheduled.clear();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function createRenderStep(runNextFrame) {
|
|
26
|
-
/**
|
|
27
|
-
* We create and reuse two queues, one to queue jobs for the current frame
|
|
28
|
-
* and one for the next. We reuse to avoid triggering GC after x frames.
|
|
29
|
-
*/
|
|
30
|
-
let thisFrame = new Queue();
|
|
31
|
-
let nextFrame = new Queue();
|
|
32
|
-
let numToRun = 0;
|
|
33
|
-
/**
|
|
34
|
-
* Track whether we're currently processing jobs in this step. This way
|
|
35
|
-
* we can decide whether to schedule new jobs for this frame or next.
|
|
36
|
-
*/
|
|
37
|
-
let isProcessing = false;
|
|
38
|
-
let flushNextFrame = false;
|
|
39
|
-
/**
|
|
40
|
-
* A set of processes which were marked keepAlive when scheduled.
|
|
41
|
-
*/
|
|
42
|
-
const toKeepAlive = new WeakSet();
|
|
43
|
-
const step = {
|
|
44
|
-
/**
|
|
45
|
-
* Schedule a process to run on the next frame.
|
|
46
|
-
*/
|
|
47
|
-
schedule: (callback, keepAlive = false, immediate = false) => {
|
|
48
|
-
const addToCurrentFrame = immediate && isProcessing;
|
|
49
|
-
const queue = addToCurrentFrame ? thisFrame : nextFrame;
|
|
50
|
-
if (keepAlive)
|
|
51
|
-
toKeepAlive.add(callback);
|
|
52
|
-
if (queue.add(callback) && addToCurrentFrame && isProcessing) {
|
|
53
|
-
// If we're adding it to the currently running queue, update its measured size
|
|
54
|
-
numToRun = thisFrame.order.length;
|
|
55
|
-
}
|
|
56
|
-
return callback;
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* Cancel the provided callback from running on the next frame.
|
|
60
|
-
*/
|
|
61
|
-
cancel: (callback) => {
|
|
62
|
-
nextFrame.remove(callback);
|
|
63
|
-
toKeepAlive.delete(callback);
|
|
64
|
-
},
|
|
65
|
-
/**
|
|
66
|
-
* Execute all schedule callbacks.
|
|
67
|
-
*/
|
|
68
|
-
process: (frameData) => {
|
|
69
|
-
/**
|
|
70
|
-
* If we're already processing we've probably been triggered by a flushSync
|
|
71
|
-
* inside an existing process. Instead of executing, mark flushNextFrame
|
|
72
|
-
* as true and ensure we flush the following frame at the end of this one.
|
|
73
|
-
*/
|
|
74
|
-
if (isProcessing) {
|
|
75
|
-
flushNextFrame = true;
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
isProcessing = true;
|
|
79
|
-
[thisFrame, nextFrame] = [nextFrame, thisFrame];
|
|
80
|
-
// Clear the next frame queue
|
|
81
|
-
nextFrame.clear();
|
|
82
|
-
// Execute this frame
|
|
83
|
-
numToRun = thisFrame.order.length;
|
|
84
|
-
if (numToRun) {
|
|
85
|
-
for (let i = 0; i < numToRun; i++) {
|
|
86
|
-
const callback = thisFrame.order[i];
|
|
87
|
-
callback(frameData);
|
|
88
|
-
if (toKeepAlive.has(callback)) {
|
|
89
|
-
step.schedule(callback);
|
|
90
|
-
runNextFrame();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
isProcessing = false;
|
|
95
|
-
if (flushNextFrame) {
|
|
96
|
-
flushNextFrame = false;
|
|
97
|
-
step.process(frameData);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
return step;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { createRenderStep };
|
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
import { invariant } from '../../utils/errors.js';
|
|
2
|
-
import { PanSession } from '../pan/PanSession.js';
|
|
3
|
-
import { getGlobalLock } from './utils/lock.js';
|
|
4
|
-
import { isRefObject } from '../../utils/is-ref-object.js';
|
|
5
|
-
import { addPointerEvent } from '../../events/add-pointer-event.js';
|
|
6
|
-
import { applyConstraints, calcRelativeConstraints, resolveDragElastic, calcViewportConstraints, rebaseAxisConstraints, calcOrigin, defaultElastic } from './utils/constraints.js';
|
|
7
|
-
import { createBox } from '../../projection/geometry/models.js';
|
|
8
|
-
import { eachAxis } from '../../projection/utils/each-axis.js';
|
|
9
|
-
import { measurePageBox } from '../../projection/utils/measure.js';
|
|
10
|
-
import { extractEventInfo } from '../../events/event-info.js';
|
|
11
|
-
import { convertBoxToBoundingBox, convertBoundingBoxToBox } from '../../projection/geometry/conversion.js';
|
|
12
|
-
import { addDomEvent } from '../../events/add-dom-event.js';
|
|
13
|
-
import { calcLength } from '../../projection/geometry/delta-calc.js';
|
|
14
|
-
import { mix } from '../../utils/mix.js';
|
|
15
|
-
import { percent } from '../../value/types/numbers/units.js';
|
|
16
|
-
import { animateMotionValue } from '../../animation/interfaces/motion-value.js';
|
|
17
|
-
import { frame } from '../../frameloop/frame.js';
|
|
18
|
-
|
|
19
|
-
const elementDragControls = new WeakMap();
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
// let latestPointerEvent: PointerEvent
|
|
24
|
-
class VisualElementDragControls {
|
|
25
|
-
constructor(visualElement) {
|
|
26
|
-
// This is a reference to the global drag gesture lock, ensuring only one component
|
|
27
|
-
// can "capture" the drag of one or both axes.
|
|
28
|
-
// TODO: Look into moving this into pansession?
|
|
29
|
-
this.openGlobalLock = null;
|
|
30
|
-
this.isDragging = false;
|
|
31
|
-
this.currentDirection = null;
|
|
32
|
-
this.originPoint = { x: 0, y: 0 };
|
|
33
|
-
/**
|
|
34
|
-
* The permitted boundaries of travel, in pixels.
|
|
35
|
-
*/
|
|
36
|
-
this.constraints = false;
|
|
37
|
-
this.hasMutatedConstraints = false;
|
|
38
|
-
/**
|
|
39
|
-
* The per-axis resolved elastic values.
|
|
40
|
-
*/
|
|
41
|
-
this.elastic = createBox();
|
|
42
|
-
this.visualElement = visualElement;
|
|
43
|
-
}
|
|
44
|
-
start(originEvent, { snapToCursor = false } = {}) {
|
|
45
|
-
/**
|
|
46
|
-
* Don't start dragging if this component is exiting
|
|
47
|
-
*/
|
|
48
|
-
const { presenceContext } = this.visualElement;
|
|
49
|
-
if (presenceContext && presenceContext.isPresent === false)
|
|
50
|
-
return;
|
|
51
|
-
const onSessionStart = (event) => {
|
|
52
|
-
// Stop any animations on both axis values immediately. This allows the user to throw and catch
|
|
53
|
-
// the component.
|
|
54
|
-
this.stopAnimation();
|
|
55
|
-
if (snapToCursor) {
|
|
56
|
-
this.snapToCursor(extractEventInfo(event, "page").point);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const onStart = (event, info) => {
|
|
60
|
-
// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
|
|
61
|
-
const { drag, dragPropagation, onDragStart } = this.getProps();
|
|
62
|
-
if (drag && !dragPropagation) {
|
|
63
|
-
if (this.openGlobalLock)
|
|
64
|
-
this.openGlobalLock();
|
|
65
|
-
this.openGlobalLock = getGlobalLock(drag);
|
|
66
|
-
// If we don 't have the lock, don't start dragging
|
|
67
|
-
if (!this.openGlobalLock)
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
this.isDragging = true;
|
|
71
|
-
this.currentDirection = null;
|
|
72
|
-
this.resolveConstraints();
|
|
73
|
-
if (this.visualElement.projection) {
|
|
74
|
-
this.visualElement.projection.isAnimationBlocked = true;
|
|
75
|
-
this.visualElement.projection.target = undefined;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Record gesture origin
|
|
79
|
-
*/
|
|
80
|
-
eachAxis((axis) => {
|
|
81
|
-
let current = this.getAxisMotionValue(axis).get() || 0;
|
|
82
|
-
/**
|
|
83
|
-
* If the MotionValue is a percentage value convert to px
|
|
84
|
-
*/
|
|
85
|
-
if (percent.test(current)) {
|
|
86
|
-
const { projection } = this.visualElement;
|
|
87
|
-
if (projection && projection.layout) {
|
|
88
|
-
const measuredAxis = projection.layout.layoutBox[axis];
|
|
89
|
-
if (measuredAxis) {
|
|
90
|
-
const length = calcLength(measuredAxis);
|
|
91
|
-
current = length * (parseFloat(current) / 100);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
this.originPoint[axis] = current;
|
|
96
|
-
});
|
|
97
|
-
// Fire onDragStart event
|
|
98
|
-
if (onDragStart) {
|
|
99
|
-
frame.update(() => onDragStart(event, info), false, true);
|
|
100
|
-
}
|
|
101
|
-
const { animationState } = this.visualElement;
|
|
102
|
-
animationState && animationState.setActive("whileDrag", true);
|
|
103
|
-
};
|
|
104
|
-
const onMove = (event, info) => {
|
|
105
|
-
// latestPointerEvent = event
|
|
106
|
-
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag, } = this.getProps();
|
|
107
|
-
// If we didn't successfully receive the gesture lock, early return.
|
|
108
|
-
if (!dragPropagation && !this.openGlobalLock)
|
|
109
|
-
return;
|
|
110
|
-
const { offset } = info;
|
|
111
|
-
// Attempt to detect drag direction if directionLock is true
|
|
112
|
-
if (dragDirectionLock && this.currentDirection === null) {
|
|
113
|
-
this.currentDirection = getCurrentDirection(offset);
|
|
114
|
-
// If we've successfully set a direction, notify listener
|
|
115
|
-
if (this.currentDirection !== null) {
|
|
116
|
-
onDirectionLock && onDirectionLock(this.currentDirection);
|
|
117
|
-
}
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
// Update each point with the latest position
|
|
121
|
-
this.updateAxis("x", info.point, offset);
|
|
122
|
-
this.updateAxis("y", info.point, offset);
|
|
123
|
-
/**
|
|
124
|
-
* Ideally we would leave the renderer to fire naturally at the end of
|
|
125
|
-
* this frame but if the element is about to change layout as the result
|
|
126
|
-
* of a re-render we want to ensure the browser can read the latest
|
|
127
|
-
* bounding box to ensure the pointer and element don't fall out of sync.
|
|
128
|
-
*/
|
|
129
|
-
this.visualElement.render();
|
|
130
|
-
/**
|
|
131
|
-
* This must fire after the render call as it might trigger a state
|
|
132
|
-
* change which itself might trigger a layout update.
|
|
133
|
-
*/
|
|
134
|
-
onDrag && onDrag(event, info);
|
|
135
|
-
};
|
|
136
|
-
const onSessionEnd = (event, info) => this.stop(event, info);
|
|
137
|
-
this.panSession = new PanSession(originEvent, {
|
|
138
|
-
onSessionStart,
|
|
139
|
-
onStart,
|
|
140
|
-
onMove,
|
|
141
|
-
onSessionEnd,
|
|
142
|
-
}, { transformPagePoint: this.visualElement.getTransformPagePoint() });
|
|
143
|
-
}
|
|
144
|
-
stop(event, info) {
|
|
145
|
-
const isDragging = this.isDragging;
|
|
146
|
-
this.cancel();
|
|
147
|
-
if (!isDragging)
|
|
148
|
-
return;
|
|
149
|
-
const { velocity } = info;
|
|
150
|
-
this.startAnimation(velocity);
|
|
151
|
-
const { onDragEnd } = this.getProps();
|
|
152
|
-
if (onDragEnd) {
|
|
153
|
-
frame.update(() => onDragEnd(event, info));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
cancel() {
|
|
157
|
-
this.isDragging = false;
|
|
158
|
-
const { projection, animationState } = this.visualElement;
|
|
159
|
-
if (projection) {
|
|
160
|
-
projection.isAnimationBlocked = false;
|
|
161
|
-
}
|
|
162
|
-
this.panSession && this.panSession.end();
|
|
163
|
-
this.panSession = undefined;
|
|
164
|
-
const { dragPropagation } = this.getProps();
|
|
165
|
-
if (!dragPropagation && this.openGlobalLock) {
|
|
166
|
-
this.openGlobalLock();
|
|
167
|
-
this.openGlobalLock = null;
|
|
168
|
-
}
|
|
169
|
-
animationState && animationState.setActive("whileDrag", false);
|
|
170
|
-
}
|
|
171
|
-
updateAxis(axis, _point, offset) {
|
|
172
|
-
const { drag } = this.getProps();
|
|
173
|
-
// If we're not dragging this axis, do an early return.
|
|
174
|
-
if (!offset || !shouldDrag(axis, drag, this.currentDirection))
|
|
175
|
-
return;
|
|
176
|
-
const axisValue = this.getAxisMotionValue(axis);
|
|
177
|
-
let next = this.originPoint[axis] + offset[axis];
|
|
178
|
-
// Apply constraints
|
|
179
|
-
if (this.constraints && this.constraints[axis]) {
|
|
180
|
-
next = applyConstraints(next, this.constraints[axis], this.elastic[axis]);
|
|
181
|
-
}
|
|
182
|
-
axisValue.set(next);
|
|
183
|
-
}
|
|
184
|
-
resolveConstraints() {
|
|
185
|
-
const { dragConstraints, dragElastic } = this.getProps();
|
|
186
|
-
const { layout } = this.visualElement.projection || {};
|
|
187
|
-
const prevConstraints = this.constraints;
|
|
188
|
-
if (dragConstraints && isRefObject(dragConstraints)) {
|
|
189
|
-
if (!this.constraints) {
|
|
190
|
-
this.constraints = this.resolveRefConstraints();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
if (dragConstraints && layout) {
|
|
195
|
-
this.constraints = calcRelativeConstraints(layout.layoutBox, dragConstraints);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
this.constraints = false;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
this.elastic = resolveDragElastic(dragElastic);
|
|
202
|
-
/**
|
|
203
|
-
* If we're outputting to external MotionValues, we want to rebase the measured constraints
|
|
204
|
-
* from viewport-relative to component-relative.
|
|
205
|
-
*/
|
|
206
|
-
if (prevConstraints !== this.constraints &&
|
|
207
|
-
layout &&
|
|
208
|
-
this.constraints &&
|
|
209
|
-
!this.hasMutatedConstraints) {
|
|
210
|
-
eachAxis((axis) => {
|
|
211
|
-
if (this.getAxisMotionValue(axis)) {
|
|
212
|
-
this.constraints[axis] = rebaseAxisConstraints(layout.layoutBox[axis], this.constraints[axis]);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
resolveRefConstraints() {
|
|
218
|
-
const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
|
|
219
|
-
if (!constraints || !isRefObject(constraints))
|
|
220
|
-
return false;
|
|
221
|
-
const constraintsElement = constraints.current;
|
|
222
|
-
invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
223
|
-
const { projection } = this.visualElement;
|
|
224
|
-
// TODO
|
|
225
|
-
if (!projection || !projection.layout)
|
|
226
|
-
return false;
|
|
227
|
-
const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
|
|
228
|
-
let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
|
|
229
|
-
/**
|
|
230
|
-
* If there's an onMeasureDragConstraints listener we call it and
|
|
231
|
-
* if different constraints are returned, set constraints to that
|
|
232
|
-
*/
|
|
233
|
-
if (onMeasureDragConstraints) {
|
|
234
|
-
const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));
|
|
235
|
-
this.hasMutatedConstraints = !!userConstraints;
|
|
236
|
-
if (userConstraints) {
|
|
237
|
-
measuredConstraints = convertBoundingBoxToBox(userConstraints);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return measuredConstraints;
|
|
241
|
-
}
|
|
242
|
-
startAnimation(velocity) {
|
|
243
|
-
const { drag, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd, } = this.getProps();
|
|
244
|
-
const constraints = this.constraints || {};
|
|
245
|
-
const momentumAnimations = eachAxis((axis) => {
|
|
246
|
-
if (!shouldDrag(axis, drag, this.currentDirection)) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
let transition = (constraints && constraints[axis]) || {};
|
|
250
|
-
if (dragSnapToOrigin)
|
|
251
|
-
transition = { min: 0, max: 0 };
|
|
252
|
-
/**
|
|
253
|
-
* Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
|
|
254
|
-
* of spring animations so we should look into adding a disable spring option to `inertia`.
|
|
255
|
-
* We could do something here where we affect the `bounceStiffness` and `bounceDamping`
|
|
256
|
-
* using the value of `dragElastic`.
|
|
257
|
-
*/
|
|
258
|
-
const bounceStiffness = dragElastic ? 200 : 1000000;
|
|
259
|
-
const bounceDamping = dragElastic ? 40 : 10000000;
|
|
260
|
-
const inertia = {
|
|
261
|
-
type: "inertia",
|
|
262
|
-
velocity: dragMomentum ? velocity[axis] : 0,
|
|
263
|
-
bounceStiffness,
|
|
264
|
-
bounceDamping,
|
|
265
|
-
timeConstant: 750,
|
|
266
|
-
restDelta: 1,
|
|
267
|
-
restSpeed: 10,
|
|
268
|
-
...dragTransition,
|
|
269
|
-
...transition,
|
|
270
|
-
};
|
|
271
|
-
// If we're not animating on an externally-provided `MotionValue` we can use the
|
|
272
|
-
// component's animation controls which will handle interactions with whileHover (etc),
|
|
273
|
-
// otherwise we just have to animate the `MotionValue` itself.
|
|
274
|
-
return this.startAxisValueAnimation(axis, inertia);
|
|
275
|
-
});
|
|
276
|
-
// Run all animations and then resolve the new drag constraints.
|
|
277
|
-
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
|
|
278
|
-
}
|
|
279
|
-
startAxisValueAnimation(axis, transition) {
|
|
280
|
-
const axisValue = this.getAxisMotionValue(axis);
|
|
281
|
-
return axisValue.start(animateMotionValue(axis, axisValue, 0, transition));
|
|
282
|
-
}
|
|
283
|
-
stopAnimation() {
|
|
284
|
-
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Drag works differently depending on which props are provided.
|
|
288
|
-
*
|
|
289
|
-
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
290
|
-
* - Otherwise, we apply the delta to the x/y motion values.
|
|
291
|
-
*/
|
|
292
|
-
getAxisMotionValue(axis) {
|
|
293
|
-
const dragKey = "_drag" + axis.toUpperCase();
|
|
294
|
-
const props = this.visualElement.getProps();
|
|
295
|
-
const externalMotionValue = props[dragKey];
|
|
296
|
-
return externalMotionValue
|
|
297
|
-
? externalMotionValue
|
|
298
|
-
: this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : undefined) || 0);
|
|
299
|
-
}
|
|
300
|
-
snapToCursor(point) {
|
|
301
|
-
eachAxis((axis) => {
|
|
302
|
-
const { drag } = this.getProps();
|
|
303
|
-
// If we're not dragging this axis, do an early return.
|
|
304
|
-
if (!shouldDrag(axis, drag, this.currentDirection))
|
|
305
|
-
return;
|
|
306
|
-
const { projection } = this.visualElement;
|
|
307
|
-
const axisValue = this.getAxisMotionValue(axis);
|
|
308
|
-
if (projection && projection.layout) {
|
|
309
|
-
const { min, max } = projection.layout.layoutBox[axis];
|
|
310
|
-
axisValue.set(point[axis] - mix(min, max, 0.5));
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* When the viewport resizes we want to check if the measured constraints
|
|
316
|
-
* have changed and, if so, reposition the element within those new constraints
|
|
317
|
-
* relative to where it was before the resize.
|
|
318
|
-
*/
|
|
319
|
-
scalePositionWithinConstraints() {
|
|
320
|
-
if (!this.visualElement.current)
|
|
321
|
-
return;
|
|
322
|
-
const { drag, dragConstraints } = this.getProps();
|
|
323
|
-
const { projection } = this.visualElement;
|
|
324
|
-
if (!isRefObject(dragConstraints) || !projection || !this.constraints)
|
|
325
|
-
return;
|
|
326
|
-
/**
|
|
327
|
-
* Stop current animations as there can be visual glitching if we try to do
|
|
328
|
-
* this mid-animation
|
|
329
|
-
*/
|
|
330
|
-
this.stopAnimation();
|
|
331
|
-
/**
|
|
332
|
-
* Record the relative position of the dragged element relative to the
|
|
333
|
-
* constraints box and save as a progress value.
|
|
334
|
-
*/
|
|
335
|
-
const boxProgress = { x: 0, y: 0 };
|
|
336
|
-
eachAxis((axis) => {
|
|
337
|
-
const axisValue = this.getAxisMotionValue(axis);
|
|
338
|
-
if (axisValue) {
|
|
339
|
-
const latest = axisValue.get();
|
|
340
|
-
boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
/**
|
|
344
|
-
* Update the layout of this element and resolve the latest drag constraints
|
|
345
|
-
*/
|
|
346
|
-
const { transformTemplate } = this.visualElement.getProps();
|
|
347
|
-
this.visualElement.current.style.transform = transformTemplate
|
|
348
|
-
? transformTemplate({}, "")
|
|
349
|
-
: "none";
|
|
350
|
-
projection.root && projection.root.updateScroll();
|
|
351
|
-
projection.updateLayout();
|
|
352
|
-
this.resolveConstraints();
|
|
353
|
-
/**
|
|
354
|
-
* For each axis, calculate the current progress of the layout axis
|
|
355
|
-
* within the new constraints.
|
|
356
|
-
*/
|
|
357
|
-
eachAxis((axis) => {
|
|
358
|
-
if (!shouldDrag(axis, drag, null))
|
|
359
|
-
return;
|
|
360
|
-
/**
|
|
361
|
-
* Calculate a new transform based on the previous box progress
|
|
362
|
-
*/
|
|
363
|
-
const axisValue = this.getAxisMotionValue(axis);
|
|
364
|
-
const { min, max } = this.constraints[axis];
|
|
365
|
-
axisValue.set(mix(min, max, boxProgress[axis]));
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
addListeners() {
|
|
369
|
-
if (!this.visualElement.current)
|
|
370
|
-
return;
|
|
371
|
-
elementDragControls.set(this.visualElement, this);
|
|
372
|
-
const element = this.visualElement.current;
|
|
373
|
-
/**
|
|
374
|
-
* Attach a pointerdown event listener on this DOM element to initiate drag tracking.
|
|
375
|
-
*/
|
|
376
|
-
const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => {
|
|
377
|
-
const { drag, dragListener = true } = this.getProps();
|
|
378
|
-
drag && dragListener && this.start(event);
|
|
379
|
-
});
|
|
380
|
-
const measureDragConstraints = () => {
|
|
381
|
-
const { dragConstraints } = this.getProps();
|
|
382
|
-
if (isRefObject(dragConstraints)) {
|
|
383
|
-
this.constraints = this.resolveRefConstraints();
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
const { projection } = this.visualElement;
|
|
387
|
-
const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
|
|
388
|
-
if (projection && !projection.layout) {
|
|
389
|
-
projection.root && projection.root.updateScroll();
|
|
390
|
-
projection.updateLayout();
|
|
391
|
-
}
|
|
392
|
-
measureDragConstraints();
|
|
393
|
-
/**
|
|
394
|
-
* Attach a window resize listener to scale the draggable target within its defined
|
|
395
|
-
* constraints as the window resizes.
|
|
396
|
-
*/
|
|
397
|
-
const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints());
|
|
398
|
-
/**
|
|
399
|
-
* If the element's layout changes, calculate the delta and apply that to
|
|
400
|
-
* the drag gesture's origin point.
|
|
401
|
-
*/
|
|
402
|
-
const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => {
|
|
403
|
-
if (this.isDragging && hasLayoutChanged) {
|
|
404
|
-
eachAxis((axis) => {
|
|
405
|
-
const motionValue = this.getAxisMotionValue(axis);
|
|
406
|
-
if (!motionValue)
|
|
407
|
-
return;
|
|
408
|
-
this.originPoint[axis] += delta[axis].translate;
|
|
409
|
-
motionValue.set(motionValue.get() + delta[axis].translate);
|
|
410
|
-
});
|
|
411
|
-
this.visualElement.render();
|
|
412
|
-
}
|
|
413
|
-
}));
|
|
414
|
-
return () => {
|
|
415
|
-
stopResizeListener();
|
|
416
|
-
stopPointerListener();
|
|
417
|
-
stopMeasureLayoutListener();
|
|
418
|
-
stopLayoutUpdateListener && stopLayoutUpdateListener();
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
getProps() {
|
|
422
|
-
const props = this.visualElement.getProps();
|
|
423
|
-
const { drag = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true, } = props;
|
|
424
|
-
return {
|
|
425
|
-
...props,
|
|
426
|
-
drag,
|
|
427
|
-
dragDirectionLock,
|
|
428
|
-
dragPropagation,
|
|
429
|
-
dragConstraints,
|
|
430
|
-
dragElastic,
|
|
431
|
-
dragMomentum,
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
function shouldDrag(direction, drag, currentDirection) {
|
|
436
|
-
return ((drag === true || drag === direction) &&
|
|
437
|
-
(currentDirection === null || currentDirection === direction));
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
|
|
441
|
-
* than the provided threshold, return `null`.
|
|
442
|
-
*
|
|
443
|
-
* @param offset - The x/y offset from origin.
|
|
444
|
-
* @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
|
|
445
|
-
*/
|
|
446
|
-
function getCurrentDirection(offset, lockThreshold = 10) {
|
|
447
|
-
let direction = null;
|
|
448
|
-
if (Math.abs(offset.y) > lockThreshold) {
|
|
449
|
-
direction = "y";
|
|
450
|
-
}
|
|
451
|
-
else if (Math.abs(offset.x) > lockThreshold) {
|
|
452
|
-
direction = "x";
|
|
453
|
-
}
|
|
454
|
-
return direction;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
export { VisualElementDragControls, elementDragControls };
|