@teamturing/react-kit 2.51.3 → 2.51.5
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/core/Tooltip/index.d.ts +2 -2
- package/dist/index.js +1342 -24149
- 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/jsx-runtime.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/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-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/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,27 +0,0 @@
|
|
|
1
|
-
import { Feature } from '../../motion/features/Feature.js';
|
|
2
|
-
import { noop } from '../../utils/noop.js';
|
|
3
|
-
import { VisualElementDragControls } from './VisualElementDragControls.js';
|
|
4
|
-
|
|
5
|
-
class DragGesture extends Feature {
|
|
6
|
-
constructor(node) {
|
|
7
|
-
super(node);
|
|
8
|
-
this.removeGroupControls = noop;
|
|
9
|
-
this.removeListeners = noop;
|
|
10
|
-
this.controls = new VisualElementDragControls(node);
|
|
11
|
-
}
|
|
12
|
-
mount() {
|
|
13
|
-
// If we've been provided a DragControls for manual control over the drag gesture,
|
|
14
|
-
// subscribe this component to it on mount.
|
|
15
|
-
const { dragControls } = this.node.getProps();
|
|
16
|
-
if (dragControls) {
|
|
17
|
-
this.removeGroupControls = dragControls.subscribe(this.controls);
|
|
18
|
-
}
|
|
19
|
-
this.removeListeners = this.controls.addListeners() || noop;
|
|
20
|
-
}
|
|
21
|
-
unmount() {
|
|
22
|
-
this.removeGroupControls();
|
|
23
|
-
this.removeListeners();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { DragGesture };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { progress } from '../../../utils/progress.js';
|
|
2
|
-
import { calcLength } from '../../../projection/geometry/delta-calc.js';
|
|
3
|
-
import { clamp } from '../../../utils/clamp.js';
|
|
4
|
-
import { mix } from '../../../utils/mix.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Apply constraints to a point. These constraints are both physical along an
|
|
8
|
-
* axis, and an elastic factor that determines how much to constrain the point
|
|
9
|
-
* by if it does lie outside the defined parameters.
|
|
10
|
-
*/
|
|
11
|
-
function applyConstraints(point, { min, max }, elastic) {
|
|
12
|
-
if (min !== undefined && point < min) {
|
|
13
|
-
// If we have a min point defined, and this is outside of that, constrain
|
|
14
|
-
point = elastic ? mix(min, point, elastic.min) : Math.max(point, min);
|
|
15
|
-
}
|
|
16
|
-
else if (max !== undefined && point > max) {
|
|
17
|
-
// If we have a max point defined, and this is outside of that, constrain
|
|
18
|
-
point = elastic ? mix(max, point, elastic.max) : Math.min(point, max);
|
|
19
|
-
}
|
|
20
|
-
return point;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Calculate constraints in terms of the viewport when defined relatively to the
|
|
24
|
-
* measured axis. This is measured from the nearest edge, so a max constraint of 200
|
|
25
|
-
* on an axis with a max value of 300 would return a constraint of 500 - axis length
|
|
26
|
-
*/
|
|
27
|
-
function calcRelativeAxisConstraints(axis, min, max) {
|
|
28
|
-
return {
|
|
29
|
-
min: min !== undefined ? axis.min + min : undefined,
|
|
30
|
-
max: max !== undefined
|
|
31
|
-
? axis.max + max - (axis.max - axis.min)
|
|
32
|
-
: undefined,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Calculate constraints in terms of the viewport when
|
|
37
|
-
* defined relatively to the measured bounding box.
|
|
38
|
-
*/
|
|
39
|
-
function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) {
|
|
40
|
-
return {
|
|
41
|
-
x: calcRelativeAxisConstraints(layoutBox.x, left, right),
|
|
42
|
-
y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Calculate viewport constraints when defined as another viewport-relative axis
|
|
47
|
-
*/
|
|
48
|
-
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
|
|
49
|
-
let min = constraintsAxis.min - layoutAxis.min;
|
|
50
|
-
let max = constraintsAxis.max - layoutAxis.max;
|
|
51
|
-
// If the constraints axis is actually smaller than the layout axis then we can
|
|
52
|
-
// flip the constraints
|
|
53
|
-
if (constraintsAxis.max - constraintsAxis.min <
|
|
54
|
-
layoutAxis.max - layoutAxis.min) {
|
|
55
|
-
[min, max] = [max, min];
|
|
56
|
-
}
|
|
57
|
-
return { min, max };
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Calculate viewport constraints when defined as another viewport-relative box
|
|
61
|
-
*/
|
|
62
|
-
function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
63
|
-
return {
|
|
64
|
-
x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
|
|
65
|
-
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Calculate a transform origin relative to the source axis, between 0-1, that results
|
|
70
|
-
* in an asthetically pleasing scale/transform needed to project from source to target.
|
|
71
|
-
*/
|
|
72
|
-
function calcOrigin(source, target) {
|
|
73
|
-
let origin = 0.5;
|
|
74
|
-
const sourceLength = calcLength(source);
|
|
75
|
-
const targetLength = calcLength(target);
|
|
76
|
-
if (targetLength > sourceLength) {
|
|
77
|
-
origin = progress(target.min, target.max - sourceLength, source.min);
|
|
78
|
-
}
|
|
79
|
-
else if (sourceLength > targetLength) {
|
|
80
|
-
origin = progress(source.min, source.max - targetLength, target.min);
|
|
81
|
-
}
|
|
82
|
-
return clamp(0, 1, origin);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Rebase the calculated viewport constraints relative to the layout.min point.
|
|
86
|
-
*/
|
|
87
|
-
function rebaseAxisConstraints(layout, constraints) {
|
|
88
|
-
const relativeConstraints = {};
|
|
89
|
-
if (constraints.min !== undefined) {
|
|
90
|
-
relativeConstraints.min = constraints.min - layout.min;
|
|
91
|
-
}
|
|
92
|
-
if (constraints.max !== undefined) {
|
|
93
|
-
relativeConstraints.max = constraints.max - layout.min;
|
|
94
|
-
}
|
|
95
|
-
return relativeConstraints;
|
|
96
|
-
}
|
|
97
|
-
const defaultElastic = 0.35;
|
|
98
|
-
/**
|
|
99
|
-
* Accepts a dragElastic prop and returns resolved elastic values for each axis.
|
|
100
|
-
*/
|
|
101
|
-
function resolveDragElastic(dragElastic = defaultElastic) {
|
|
102
|
-
if (dragElastic === false) {
|
|
103
|
-
dragElastic = 0;
|
|
104
|
-
}
|
|
105
|
-
else if (dragElastic === true) {
|
|
106
|
-
dragElastic = defaultElastic;
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
x: resolveAxisElastic(dragElastic, "left", "right"),
|
|
110
|
-
y: resolveAxisElastic(dragElastic, "top", "bottom"),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
|
|
114
|
-
return {
|
|
115
|
-
min: resolvePointElastic(dragElastic, minLabel),
|
|
116
|
-
max: resolvePointElastic(dragElastic, maxLabel),
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function resolvePointElastic(dragElastic, label) {
|
|
120
|
-
return typeof dragElastic === "number"
|
|
121
|
-
? dragElastic
|
|
122
|
-
: dragElastic[label] || 0;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export { applyConstraints, calcOrigin, calcRelativeAxisConstraints, calcRelativeConstraints, calcViewportAxisConstraints, calcViewportConstraints, defaultElastic, rebaseAxisConstraints, resolveAxisElastic, resolveDragElastic, resolvePointElastic };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
function createLock(name) {
|
|
2
|
-
let lock = null;
|
|
3
|
-
return () => {
|
|
4
|
-
const openLock = () => {
|
|
5
|
-
lock = null;
|
|
6
|
-
};
|
|
7
|
-
if (lock === null) {
|
|
8
|
-
lock = name;
|
|
9
|
-
return openLock;
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const globalHorizontalLock = createLock("dragHorizontal");
|
|
15
|
-
const globalVerticalLock = createLock("dragVertical");
|
|
16
|
-
function getGlobalLock(drag) {
|
|
17
|
-
let lock = false;
|
|
18
|
-
if (drag === "y") {
|
|
19
|
-
lock = globalVerticalLock();
|
|
20
|
-
}
|
|
21
|
-
else if (drag === "x") {
|
|
22
|
-
lock = globalHorizontalLock();
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
const openHorizontal = globalHorizontalLock();
|
|
26
|
-
const openVertical = globalVerticalLock();
|
|
27
|
-
if (openHorizontal && openVertical) {
|
|
28
|
-
lock = () => {
|
|
29
|
-
openHorizontal();
|
|
30
|
-
openVertical();
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
// Release the locks because we don't use them
|
|
35
|
-
if (openHorizontal)
|
|
36
|
-
openHorizontal();
|
|
37
|
-
if (openVertical)
|
|
38
|
-
openVertical();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return lock;
|
|
42
|
-
}
|
|
43
|
-
function isDragActive() {
|
|
44
|
-
// Check the gesture lock - if we get it, it means no drag gesture is active
|
|
45
|
-
// and we can safely fire the tap gesture.
|
|
46
|
-
const openGestureLock = getGlobalLock(true);
|
|
47
|
-
if (!openGestureLock)
|
|
48
|
-
return true;
|
|
49
|
-
openGestureLock();
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { createLock, getGlobalLock, isDragActive };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { addDomEvent } from '../events/add-dom-event.js';
|
|
2
|
-
import { Feature } from '../motion/features/Feature.js';
|
|
3
|
-
import { pipe } from '../utils/pipe.js';
|
|
4
|
-
|
|
5
|
-
class FocusGesture extends Feature {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.isActive = false;
|
|
9
|
-
}
|
|
10
|
-
onFocus() {
|
|
11
|
-
let isFocusVisible = false;
|
|
12
|
-
/**
|
|
13
|
-
* If this element doesn't match focus-visible then don't
|
|
14
|
-
* apply whileHover. But, if matches throws that focus-visible
|
|
15
|
-
* is not a valid selector then in that browser outline styles will be applied
|
|
16
|
-
* to the element by default and we want to match that behaviour with whileFocus.
|
|
17
|
-
*/
|
|
18
|
-
try {
|
|
19
|
-
isFocusVisible = this.node.current.matches(":focus-visible");
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
isFocusVisible = true;
|
|
23
|
-
}
|
|
24
|
-
if (!isFocusVisible || !this.node.animationState)
|
|
25
|
-
return;
|
|
26
|
-
this.node.animationState.setActive("whileFocus", true);
|
|
27
|
-
this.isActive = true;
|
|
28
|
-
}
|
|
29
|
-
onBlur() {
|
|
30
|
-
if (!this.isActive || !this.node.animationState)
|
|
31
|
-
return;
|
|
32
|
-
this.node.animationState.setActive("whileFocus", false);
|
|
33
|
-
this.isActive = false;
|
|
34
|
-
}
|
|
35
|
-
mount() {
|
|
36
|
-
this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur()));
|
|
37
|
-
}
|
|
38
|
-
unmount() { }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { FocusGesture };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { addPointerEvent } from '../events/add-pointer-event.js';
|
|
2
|
-
import { pipe } from '../utils/pipe.js';
|
|
3
|
-
import { isDragActive } from './drag/utils/lock.js';
|
|
4
|
-
import { Feature } from '../motion/features/Feature.js';
|
|
5
|
-
import { frame } from '../frameloop/frame.js';
|
|
6
|
-
|
|
7
|
-
function addHoverEvent(node, isActive) {
|
|
8
|
-
const eventName = "pointer" + (isActive ? "enter" : "leave");
|
|
9
|
-
const callbackName = "onHover" + (isActive ? "Start" : "End");
|
|
10
|
-
const handleEvent = (event, info) => {
|
|
11
|
-
if (event.type === "touch" || isDragActive())
|
|
12
|
-
return;
|
|
13
|
-
const props = node.getProps();
|
|
14
|
-
if (node.animationState && props.whileHover) {
|
|
15
|
-
node.animationState.setActive("whileHover", isActive);
|
|
16
|
-
}
|
|
17
|
-
if (props[callbackName]) {
|
|
18
|
-
frame.update(() => props[callbackName](event, info));
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return addPointerEvent(node.current, eventName, handleEvent, {
|
|
22
|
-
passive: !node.getProps()[callbackName],
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
class HoverGesture extends Feature {
|
|
26
|
-
mount() {
|
|
27
|
-
this.unmount = pipe(addHoverEvent(this.node, true), addHoverEvent(this.node, false));
|
|
28
|
-
}
|
|
29
|
-
unmount() { }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { HoverGesture };
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { extractEventInfo } from '../../events/event-info.js';
|
|
2
|
-
import { secondsToMilliseconds, millisecondsToSeconds } from '../../utils/time-conversion.js';
|
|
3
|
-
import { addPointerEvent } from '../../events/add-pointer-event.js';
|
|
4
|
-
import { pipe } from '../../utils/pipe.js';
|
|
5
|
-
import { distance2D } from '../../utils/distance.js';
|
|
6
|
-
import { isPrimaryPointer } from '../../events/utils/is-primary-pointer.js';
|
|
7
|
-
import { frame, cancelFrame, frameData } from '../../frameloop/frame.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
class PanSession {
|
|
13
|
-
constructor(event, handlers, { transformPagePoint } = {}) {
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
this.startEvent = null;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
this.lastMoveEvent = null;
|
|
22
|
-
/**
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
this.lastMoveEventInfo = null;
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
this.handlers = {};
|
|
30
|
-
this.updatePoint = () => {
|
|
31
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
32
|
-
return;
|
|
33
|
-
const info = getPanInfo(this.lastMoveEventInfo, this.history);
|
|
34
|
-
const isPanStarted = this.startEvent !== null;
|
|
35
|
-
// Only start panning if the offset is larger than 3 pixels. If we make it
|
|
36
|
-
// any larger than this we'll want to reset the pointer history
|
|
37
|
-
// on the first update to avoid visual snapping to the cursoe.
|
|
38
|
-
const isDistancePastThreshold = distance2D(info.offset, { x: 0, y: 0 }) >= 3;
|
|
39
|
-
if (!isPanStarted && !isDistancePastThreshold)
|
|
40
|
-
return;
|
|
41
|
-
const { point } = info;
|
|
42
|
-
const { timestamp } = frameData;
|
|
43
|
-
this.history.push({ ...point, timestamp });
|
|
44
|
-
const { onStart, onMove } = this.handlers;
|
|
45
|
-
if (!isPanStarted) {
|
|
46
|
-
onStart && onStart(this.lastMoveEvent, info);
|
|
47
|
-
this.startEvent = this.lastMoveEvent;
|
|
48
|
-
}
|
|
49
|
-
onMove && onMove(this.lastMoveEvent, info);
|
|
50
|
-
};
|
|
51
|
-
this.handlePointerMove = (event, info) => {
|
|
52
|
-
this.lastMoveEvent = event;
|
|
53
|
-
this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint);
|
|
54
|
-
// Throttle mouse move event to once per frame
|
|
55
|
-
frame.update(this.updatePoint, true);
|
|
56
|
-
};
|
|
57
|
-
this.handlePointerUp = (event, info) => {
|
|
58
|
-
this.end();
|
|
59
|
-
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
|
|
60
|
-
return;
|
|
61
|
-
const { onEnd, onSessionEnd } = this.handlers;
|
|
62
|
-
const panInfo = getPanInfo(event.type === "pointercancel"
|
|
63
|
-
? this.lastMoveEventInfo
|
|
64
|
-
: transformPoint(info, this.transformPagePoint), this.history);
|
|
65
|
-
if (this.startEvent && onEnd) {
|
|
66
|
-
onEnd(event, panInfo);
|
|
67
|
-
}
|
|
68
|
-
onSessionEnd && onSessionEnd(event, panInfo);
|
|
69
|
-
};
|
|
70
|
-
// If we have more than one touch, don't start detecting this gesture
|
|
71
|
-
if (!isPrimaryPointer(event))
|
|
72
|
-
return;
|
|
73
|
-
this.handlers = handlers;
|
|
74
|
-
this.transformPagePoint = transformPagePoint;
|
|
75
|
-
const info = extractEventInfo(event);
|
|
76
|
-
const initialInfo = transformPoint(info, this.transformPagePoint);
|
|
77
|
-
const { point } = initialInfo;
|
|
78
|
-
const { timestamp } = frameData;
|
|
79
|
-
this.history = [{ ...point, timestamp }];
|
|
80
|
-
const { onSessionStart } = handlers;
|
|
81
|
-
onSessionStart &&
|
|
82
|
-
onSessionStart(event, getPanInfo(initialInfo, this.history));
|
|
83
|
-
this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
|
|
84
|
-
}
|
|
85
|
-
updateHandlers(handlers) {
|
|
86
|
-
this.handlers = handlers;
|
|
87
|
-
}
|
|
88
|
-
end() {
|
|
89
|
-
this.removeListeners && this.removeListeners();
|
|
90
|
-
cancelFrame(this.updatePoint);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function transformPoint(info, transformPagePoint) {
|
|
94
|
-
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
|
|
95
|
-
}
|
|
96
|
-
function subtractPoint(a, b) {
|
|
97
|
-
return { x: a.x - b.x, y: a.y - b.y };
|
|
98
|
-
}
|
|
99
|
-
function getPanInfo({ point }, history) {
|
|
100
|
-
return {
|
|
101
|
-
point,
|
|
102
|
-
delta: subtractPoint(point, lastDevicePoint(history)),
|
|
103
|
-
offset: subtractPoint(point, startDevicePoint(history)),
|
|
104
|
-
velocity: getVelocity(history, 0.1),
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function startDevicePoint(history) {
|
|
108
|
-
return history[0];
|
|
109
|
-
}
|
|
110
|
-
function lastDevicePoint(history) {
|
|
111
|
-
return history[history.length - 1];
|
|
112
|
-
}
|
|
113
|
-
function getVelocity(history, timeDelta) {
|
|
114
|
-
if (history.length < 2) {
|
|
115
|
-
return { x: 0, y: 0 };
|
|
116
|
-
}
|
|
117
|
-
let i = history.length - 1;
|
|
118
|
-
let timestampedPoint = null;
|
|
119
|
-
const lastPoint = lastDevicePoint(history);
|
|
120
|
-
while (i >= 0) {
|
|
121
|
-
timestampedPoint = history[i];
|
|
122
|
-
if (lastPoint.timestamp - timestampedPoint.timestamp >
|
|
123
|
-
secondsToMilliseconds(timeDelta)) {
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
i--;
|
|
127
|
-
}
|
|
128
|
-
if (!timestampedPoint) {
|
|
129
|
-
return { x: 0, y: 0 };
|
|
130
|
-
}
|
|
131
|
-
const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
132
|
-
if (time === 0) {
|
|
133
|
-
return { x: 0, y: 0 };
|
|
134
|
-
}
|
|
135
|
-
const currentVelocity = {
|
|
136
|
-
x: (lastPoint.x - timestampedPoint.x) / time,
|
|
137
|
-
y: (lastPoint.y - timestampedPoint.y) / time,
|
|
138
|
-
};
|
|
139
|
-
if (currentVelocity.x === Infinity) {
|
|
140
|
-
currentVelocity.x = 0;
|
|
141
|
-
}
|
|
142
|
-
if (currentVelocity.y === Infinity) {
|
|
143
|
-
currentVelocity.y = 0;
|
|
144
|
-
}
|
|
145
|
-
return currentVelocity;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export { PanSession };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { PanSession } from './PanSession.js';
|
|
2
|
-
import { addPointerEvent } from '../../events/add-pointer-event.js';
|
|
3
|
-
import { Feature } from '../../motion/features/Feature.js';
|
|
4
|
-
import { noop } from '../../utils/noop.js';
|
|
5
|
-
import { frame } from '../../frameloop/frame.js';
|
|
6
|
-
|
|
7
|
-
const asyncHandler = (handler) => (event, info) => {
|
|
8
|
-
if (handler) {
|
|
9
|
-
frame.update(() => handler(event, info));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
class PanGesture extends Feature {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.removePointerDownListener = noop;
|
|
16
|
-
}
|
|
17
|
-
onPointerDown(pointerDownEvent) {
|
|
18
|
-
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { transformPagePoint: this.node.getTransformPagePoint() });
|
|
19
|
-
}
|
|
20
|
-
createPanHandlers() {
|
|
21
|
-
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
|
|
22
|
-
return {
|
|
23
|
-
onSessionStart: asyncHandler(onPanSessionStart),
|
|
24
|
-
onStart: asyncHandler(onPanStart),
|
|
25
|
-
onMove: onPan,
|
|
26
|
-
onEnd: (event, info) => {
|
|
27
|
-
delete this.session;
|
|
28
|
-
if (onPanEnd) {
|
|
29
|
-
frame.update(() => onPanEnd(event, info));
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
mount() {
|
|
35
|
-
this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
|
|
36
|
-
}
|
|
37
|
-
update() {
|
|
38
|
-
this.session && this.session.updateHandlers(this.createPanHandlers());
|
|
39
|
-
}
|
|
40
|
-
unmount() {
|
|
41
|
-
this.removePointerDownListener();
|
|
42
|
-
this.session && this.session.end();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { PanGesture };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { extractEventInfo } from '../events/event-info.js';
|
|
2
|
-
import { addDomEvent } from '../events/add-dom-event.js';
|
|
3
|
-
import { addPointerEvent } from '../events/add-pointer-event.js';
|
|
4
|
-
import { Feature } from '../motion/features/Feature.js';
|
|
5
|
-
import { pipe } from '../utils/pipe.js';
|
|
6
|
-
import { isDragActive } from './drag/utils/lock.js';
|
|
7
|
-
import { isNodeOrChild } from './utils/is-node-or-child.js';
|
|
8
|
-
import { noop } from '../utils/noop.js';
|
|
9
|
-
import { frame } from '../frameloop/frame.js';
|
|
10
|
-
|
|
11
|
-
function fireSyntheticPointerEvent(name, handler) {
|
|
12
|
-
if (!handler)
|
|
13
|
-
return;
|
|
14
|
-
const syntheticPointerEvent = new PointerEvent("pointer" + name);
|
|
15
|
-
handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent));
|
|
16
|
-
}
|
|
17
|
-
class PressGesture extends Feature {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.removeStartListeners = noop;
|
|
21
|
-
this.removeEndListeners = noop;
|
|
22
|
-
this.removeAccessibleListeners = noop;
|
|
23
|
-
this.startPointerPress = (startEvent, startInfo) => {
|
|
24
|
-
this.removeEndListeners();
|
|
25
|
-
if (this.isPressing)
|
|
26
|
-
return;
|
|
27
|
-
const props = this.node.getProps();
|
|
28
|
-
const endPointerPress = (endEvent, endInfo) => {
|
|
29
|
-
if (!this.checkPressEnd())
|
|
30
|
-
return;
|
|
31
|
-
const { onTap, onTapCancel } = this.node.getProps();
|
|
32
|
-
frame.update(() => {
|
|
33
|
-
/**
|
|
34
|
-
* We only count this as a tap gesture if the event.target is the same
|
|
35
|
-
* as, or a child of, this component's element
|
|
36
|
-
*/
|
|
37
|
-
!isNodeOrChild(this.node.current, endEvent.target)
|
|
38
|
-
? onTapCancel && onTapCancel(endEvent, endInfo)
|
|
39
|
-
: onTap && onTap(endEvent, endInfo);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const removePointerUpListener = addPointerEvent(window, "pointerup", endPointerPress, { passive: !(props.onTap || props["onPointerUp"]) });
|
|
43
|
-
const removePointerCancelListener = addPointerEvent(window, "pointercancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), { passive: !(props.onTapCancel || props["onPointerCancel"]) });
|
|
44
|
-
this.removeEndListeners = pipe(removePointerUpListener, removePointerCancelListener);
|
|
45
|
-
this.startPress(startEvent, startInfo);
|
|
46
|
-
};
|
|
47
|
-
this.startAccessiblePress = () => {
|
|
48
|
-
const handleKeydown = (keydownEvent) => {
|
|
49
|
-
if (keydownEvent.key !== "Enter" || this.isPressing)
|
|
50
|
-
return;
|
|
51
|
-
const handleKeyup = (keyupEvent) => {
|
|
52
|
-
if (keyupEvent.key !== "Enter" || !this.checkPressEnd())
|
|
53
|
-
return;
|
|
54
|
-
fireSyntheticPointerEvent("up", (event, info) => {
|
|
55
|
-
const { onTap } = this.node.getProps();
|
|
56
|
-
if (onTap) {
|
|
57
|
-
frame.update(() => onTap(event, info));
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
this.removeEndListeners();
|
|
62
|
-
this.removeEndListeners = addDomEvent(this.node.current, "keyup", handleKeyup);
|
|
63
|
-
fireSyntheticPointerEvent("down", (event, info) => {
|
|
64
|
-
this.startPress(event, info);
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const removeKeydownListener = addDomEvent(this.node.current, "keydown", handleKeydown);
|
|
68
|
-
const handleBlur = () => {
|
|
69
|
-
if (!this.isPressing)
|
|
70
|
-
return;
|
|
71
|
-
fireSyntheticPointerEvent("cancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo));
|
|
72
|
-
};
|
|
73
|
-
const removeBlurListener = addDomEvent(this.node.current, "blur", handleBlur);
|
|
74
|
-
this.removeAccessibleListeners = pipe(removeKeydownListener, removeBlurListener);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
startPress(event, info) {
|
|
78
|
-
this.isPressing = true;
|
|
79
|
-
const { onTapStart, whileTap } = this.node.getProps();
|
|
80
|
-
/**
|
|
81
|
-
* Ensure we trigger animations before firing event callback
|
|
82
|
-
*/
|
|
83
|
-
if (whileTap && this.node.animationState) {
|
|
84
|
-
this.node.animationState.setActive("whileTap", true);
|
|
85
|
-
}
|
|
86
|
-
if (onTapStart) {
|
|
87
|
-
frame.update(() => onTapStart(event, info));
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
checkPressEnd() {
|
|
91
|
-
this.removeEndListeners();
|
|
92
|
-
this.isPressing = false;
|
|
93
|
-
const props = this.node.getProps();
|
|
94
|
-
if (props.whileTap && this.node.animationState) {
|
|
95
|
-
this.node.animationState.setActive("whileTap", false);
|
|
96
|
-
}
|
|
97
|
-
return !isDragActive();
|
|
98
|
-
}
|
|
99
|
-
cancelPress(event, info) {
|
|
100
|
-
if (!this.checkPressEnd())
|
|
101
|
-
return;
|
|
102
|
-
const { onTapCancel } = this.node.getProps();
|
|
103
|
-
if (onTapCancel) {
|
|
104
|
-
frame.update(() => onTapCancel(event, info));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
mount() {
|
|
108
|
-
const props = this.node.getProps();
|
|
109
|
-
const removePointerListener = addPointerEvent(this.node.current, "pointerdown", this.startPointerPress, { passive: !(props.onTapStart || props["onPointerStart"]) });
|
|
110
|
-
const removeFocusListener = addDomEvent(this.node.current, "focus", this.startAccessiblePress);
|
|
111
|
-
this.removeStartListeners = pipe(removePointerListener, removeFocusListener);
|
|
112
|
-
}
|
|
113
|
-
unmount() {
|
|
114
|
-
this.removeStartListeners();
|
|
115
|
-
this.removeEndListeners();
|
|
116
|
-
this.removeAccessibleListeners();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { PressGesture };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively traverse up the tree to check whether the provided child node
|
|
3
|
-
* is the parent or a descendant of it.
|
|
4
|
-
*
|
|
5
|
-
* @param parent - Element to find
|
|
6
|
-
* @param child - Element to test against parent
|
|
7
|
-
*/
|
|
8
|
-
const isNodeOrChild = (parent, child) => {
|
|
9
|
-
if (!child) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
else if (parent === child) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return isNodeOrChild(parent, child.parentElement);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { isNodeOrChild };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Feature } from '../Feature.js';
|
|
2
|
-
|
|
3
|
-
let id = 0;
|
|
4
|
-
class ExitAnimationFeature extends Feature {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.id = id++;
|
|
8
|
-
}
|
|
9
|
-
update() {
|
|
10
|
-
if (!this.node.presenceContext)
|
|
11
|
-
return;
|
|
12
|
-
const { isPresent, onExitComplete, custom } = this.node.presenceContext;
|
|
13
|
-
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
|
|
14
|
-
if (!this.node.animationState || isPresent === prevIsPresent) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const exitAnimation = this.node.animationState.setActive("exit", !isPresent, { custom: custom !== null && custom !== void 0 ? custom : this.node.getProps().custom });
|
|
18
|
-
if (onExitComplete && !isPresent) {
|
|
19
|
-
exitAnimation.then(() => onExitComplete(this.id));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
mount() {
|
|
23
|
-
const { register } = this.node.presenceContext || {};
|
|
24
|
-
if (register) {
|
|
25
|
-
this.unmount = register(this.id);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
unmount() { }
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { ExitAnimationFeature };
|