@quan-erp/shared-ui 1.0.0
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/README.md +90 -0
- package/dist/common/common.d.ts +2 -0
- package/dist/components/blocks/editor-00/editor.d.ts +8 -0
- package/dist/components/blocks/editor-00/nodes.d.ts +3 -0
- package/dist/components/blocks/editor-00/plugins.d.ts +2 -0
- package/dist/components/custom/confirm-dialog.d.ts +15 -0
- package/dist/components/custom/dashboard.d.ts +22 -0
- package/dist/components/custom/data-table/cursor-based-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-action-menu.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-export.d.ts +8 -0
- package/dist/components/custom/data-table/data-table-column-header.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-grid.d.ts +21 -0
- package/dist/components/custom/data-table/data-table-group-by.types.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-helper.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-list-view.d.ts +13 -0
- package/dist/components/custom/data-table/data-table-page-size.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-toolbar.d.ts +26 -0
- package/dist/components/custom/data-table/data-table-util.d.ts +7 -0
- package/dist/components/custom/data-table/data-table-view-fallback.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-view-options.d.ts +17 -0
- package/dist/components/custom/data-table/data-table-view-preferences.d.ts +22 -0
- package/dist/components/custom/data-table/data-table-view-preferences.storage.d.ts +15 -0
- package/dist/components/custom/data-table/data-table-wrapper.d.ts +51 -0
- package/dist/components/custom/data-table/data-table.d.ts +47 -0
- package/dist/components/custom/data-table/export.d.ts +22 -0
- package/dist/components/custom/data-table/group-table-rows.d.ts +3 -0
- package/dist/components/custom/data-table/types.d.ts +17 -0
- package/dist/components/custom/data-table/use-data-table-page-size.d.ts +41 -0
- package/dist/components/custom/document-title.d.ts +4 -0
- package/dist/components/custom/empty-screen.d.ts +8 -0
- package/dist/components/custom/error-screen.d.ts +9 -0
- package/dist/components/custom/floating-action-btn.d.ts +39 -0
- package/dist/components/custom/index.d.ts +20 -0
- package/dist/components/custom/loading-screen.d.ts +7 -0
- package/dist/components/custom/menu-tab.d.ts +17 -0
- package/dist/components/custom/page.d.ts +35 -0
- package/dist/components/custom/plugin-theme.d.ts +8 -0
- package/dist/components/custom/portal.d.ts +4 -0
- package/dist/components/custom/protected-page.d.ts +26 -0
- package/dist/components/custom/pull-to-refresh.d.ts +16 -0
- package/dist/components/custom/render-in-view.d.ts +12 -0
- package/dist/components/custom/responsive-dialog.d.ts +47 -0
- package/dist/components/custom/safearea.d.ts +5 -0
- package/dist/components/custom/scrollable.d.ts +17 -0
- package/dist/components/custom/search-and-filter-suite.d.ts +16 -0
- package/dist/components/custom/setting.d.ts +30 -0
- package/dist/components/custom/submenu-hub.d.ts +17 -0
- package/dist/components/editor/editor-ui/content-editable.d.ts +9 -0
- package/dist/components/editor/themes/editor-theme.d.ts +3 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/form.d.ts +26 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/index.d.ts +54 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input.d.ts +10 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sidebar.d.ts +71 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/slider.d.ts +12 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/spinner.d.ts +9 -0
- package/dist/components/ui/switch.d.ts +11 -0
- package/dist/components/ui/table.d.ts +14 -0
- package/dist/components/ui/tabs.d.ts +16 -0
- package/dist/components/ui/textarea.d.ts +10 -0
- package/dist/components/ui/time-picker.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/es/common/common.js +4 -0
- package/dist/es/components/blocks/editor-00/editor.js +49 -0
- package/dist/es/components/blocks/editor-00/nodes.js +6 -0
- package/dist/es/components/blocks/editor-00/plugins.js +23 -0
- package/dist/es/components/custom/confirm-dialog.js +34 -0
- package/dist/es/components/custom/dashboard.js +86 -0
- package/dist/es/components/custom/data-table/cursor-based-pagination.js +123 -0
- package/dist/es/components/custom/data-table/data-table-bulk-action-menu.js +112 -0
- package/dist/es/components/custom/data-table/data-table-bulk-export.js +76 -0
- package/dist/es/components/custom/data-table/data-table-column-header.js +102 -0
- package/dist/es/components/custom/data-table/data-table-grid.js +234 -0
- package/dist/es/components/custom/data-table/data-table-helper.js +8 -0
- package/dist/es/components/custom/data-table/data-table-list-view.js +121 -0
- package/dist/es/components/custom/data-table/data-table-page-size.js +49 -0
- package/dist/es/components/custom/data-table/data-table-pagination.js +156 -0
- package/dist/es/components/custom/data-table/data-table-toolbar.js +149 -0
- package/dist/es/components/custom/data-table/data-table-util.js +31 -0
- package/dist/es/components/custom/data-table/data-table-view-fallback.js +7 -0
- package/dist/es/components/custom/data-table/data-table-view-options.js +311 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.js +71 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.storage.js +115 -0
- package/dist/es/components/custom/data-table/data-table.js +425 -0
- package/dist/es/components/custom/data-table/group-table-rows.js +16 -0
- package/dist/es/components/custom/data-table/use-data-table-page-size.js +155 -0
- package/dist/es/components/custom/empty-screen.js +28 -0
- package/dist/es/components/custom/error-screen.js +84 -0
- package/dist/es/components/custom/floating-action-btn.js +200 -0
- package/dist/es/components/custom/loading-screen.js +26 -0
- package/dist/es/components/custom/menu-tab.js +45 -0
- package/dist/es/components/custom/page.js +105 -0
- package/dist/es/components/custom/plugin-theme.js +13 -0
- package/dist/es/components/custom/portal.js +13 -0
- package/dist/es/components/custom/protected-page.js +74 -0
- package/dist/es/components/custom/pull-to-refresh.js +378 -0
- package/dist/es/components/custom/render-in-view.js +35 -0
- package/dist/es/components/custom/responsive-dialog.js +163 -0
- package/dist/es/components/custom/safearea.js +8 -0
- package/dist/es/components/custom/scrollable.js +96 -0
- package/dist/es/components/custom/setting.js +39 -0
- package/dist/es/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/es/components/editor/themes/editor-theme.js +119 -0
- package/dist/es/components/ui/accordion.js +47 -0
- package/dist/es/components/ui/alert-dialog.js +178 -0
- package/dist/es/components/ui/alert.js +51 -0
- package/dist/es/components/ui/avatar.js +42 -0
- package/dist/es/components/ui/badge.js +27 -0
- package/dist/es/components/ui/breadcrumb.js +93 -0
- package/dist/es/components/ui/button-group.js +76 -0
- package/dist/es/components/ui/button.js +57 -0
- package/dist/es/components/ui/calendar.js +402 -0
- package/dist/es/components/ui/card.js +91 -0
- package/dist/es/components/ui/carousel.js +194 -0
- package/dist/es/components/ui/chart.js +239 -0
- package/dist/es/components/ui/checkbox.js +27 -0
- package/dist/es/components/ui/collapsible.js +9 -0
- package/dist/es/components/ui/command.js +115 -0
- package/dist/es/components/ui/context-menu.js +153 -0
- package/dist/es/components/ui/dialog.js +137 -0
- package/dist/es/components/ui/drawer.js +107 -0
- package/dist/es/components/ui/dropdown-menu.js +152 -0
- package/dist/es/components/ui/field.js +226 -0
- package/dist/es/components/ui/form.js +109 -0
- package/dist/es/components/ui/hover-card.js +25 -0
- package/dist/es/components/ui/input-group.js +155 -0
- package/dist/es/components/ui/input-otp.js +49 -0
- package/dist/es/components/ui/input.js +37 -0
- package/dist/es/components/ui/item.js +188 -0
- package/dist/es/components/ui/kbd.js +31 -0
- package/dist/es/components/ui/label.js +23 -0
- package/dist/es/components/ui/menubar.js +202 -0
- package/dist/es/components/ui/navigation-menu.js +107 -0
- package/dist/es/components/ui/pagination.js +101 -0
- package/dist/es/components/ui/popover.js +27 -0
- package/dist/es/components/ui/progress.js +26 -0
- package/dist/es/components/ui/radio-group.js +35 -0
- package/dist/es/components/ui/resizable.js +38 -0
- package/dist/es/components/ui/scroll-area.js +38 -0
- package/dist/es/components/ui/select.js +124 -0
- package/dist/es/components/ui/separator.js +27 -0
- package/dist/es/components/ui/sheet.js +129 -0
- package/dist/es/components/ui/sidebar.js +604 -0
- package/dist/es/components/ui/skeleton.js +17 -0
- package/dist/es/components/ui/slider.js +62 -0
- package/dist/es/components/ui/sonner.js +26 -0
- package/dist/es/components/ui/spinner.js +34 -0
- package/dist/es/components/ui/switch.js +54 -0
- package/dist/es/components/ui/table.js +90 -0
- package/dist/es/components/ui/tabs.js +84 -0
- package/dist/es/components/ui/textarea.js +32 -0
- package/dist/es/components/ui/time-picker.js +199 -0
- package/dist/es/components/ui/toggle-group.js +43 -0
- package/dist/es/components/ui/toggle.js +44 -0
- package/dist/es/components/ui/tooltip.js +56 -0
- package/dist/es/hooks/use-debounce-value.js +16 -0
- package/dist/es/hooks/use-is-inview.js +25 -0
- package/dist/es/hooks/use-mobile-back-dialog.js +34 -0
- package/dist/es/hooks/use-mobile.js +43 -0
- package/dist/es/hooks/use-mounted.js +14 -0
- package/dist/es/hooks/use-scroll-direction.js +26 -0
- package/dist/es/hooks/use-user-hand-behavior.js +20 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +487 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/es/locale/locale.js +87 -0
- package/dist/es/node_modules/@tanstack/react-table/build/lib/index.js +93 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +2737 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +85 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +86 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +19 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +432 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/index.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +93 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/focus.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/hover.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +215 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/index.js +50 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/press.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +60 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/index.js +40 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/definitions.js +42 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +111 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/load-features.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +64 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +33 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/index.js +69 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +106 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +66 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/create-proxy.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/use-render.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +29 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-props.js +44 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-props.js +24 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/distance.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/get-context-window.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-constant.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +153 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/JSAnimation.js +294 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +160 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +51 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/animate/single-value.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/inertia.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/spring.js +246 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +69 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +78 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +107 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +131 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +43 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/events/add-dom-event.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/batcher.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/render-step.js +64 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/sync-time.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/hover.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/index.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/setup.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +60 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/copy.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +86 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +57 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/models.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1124 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/shared/stack.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/transform.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/measure.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/Feature.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/VisualElement.js +426 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +42 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/render.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/store.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +45 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +59 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/path.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/render.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/animation-state.js +223 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/motion-values.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/setters.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/variant-props.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-element.js +61 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-window.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/index.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/delay.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/interpolate.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/color.js +44 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/complex.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/index.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/number.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/visibility.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/resolve-elements.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/index.js +286 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hex.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +39 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/index.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/rgba.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/utils.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/filter.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/index.js +91 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/mask.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/dimensions.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/index.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/units.js +23 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/find.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/array.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/clamp.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/back.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/circ.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +29 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/ease.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/map.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/errors.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/global-config.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-object.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/memo.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/noop.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/pipe.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/progress.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/subscription-manager.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/time-conversion.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/warn-once.js +11 -0
- package/dist/es/shared-ui.css +95 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/use-debounce-value.d.ts +2 -0
- package/dist/hooks/use-inview.d.ts +7 -0
- package/dist/hooks/use-is-inview.d.ts +7 -0
- package/dist/hooks/use-mobile-back-dialog.d.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +9 -0
- package/dist/hooks/use-mounted.d.ts +2 -0
- package/dist/hooks/use-scroll-direction.d.ts +3 -0
- package/dist/hooks/use-user-hand-behavior.d.ts +7 -0
- package/dist/index.d.ts +13 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/locale/index.d.ts +2 -0
- package/dist/locale/locale.d.ts +26 -0
- package/package.json +118 -0
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { observeIntersection } from "./observers.js";
|
|
2
|
+
import { Feature } from "../../../../../../motion-dom/dist/es/render/Feature.js";
|
|
3
|
+
const thresholdNames = {
|
|
4
|
+
some: 0,
|
|
5
|
+
all: 1
|
|
6
|
+
};
|
|
7
|
+
class InViewFeature extends Feature {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.hasEnteredView = false;
|
|
11
|
+
this.isInView = false;
|
|
12
|
+
}
|
|
13
|
+
startObserver() {
|
|
14
|
+
this.stopObserver?.();
|
|
15
|
+
const { viewport = {} } = this.node.getProps();
|
|
16
|
+
const { root, margin: rootMargin, amount = "some", once } = viewport;
|
|
17
|
+
const options = {
|
|
18
|
+
root: root ? root.current : void 0,
|
|
19
|
+
rootMargin,
|
|
20
|
+
threshold: typeof amount === "number" ? amount : thresholdNames[amount]
|
|
21
|
+
};
|
|
22
|
+
const onIntersectionUpdate = (entry) => {
|
|
23
|
+
const { isIntersecting } = entry;
|
|
24
|
+
if (this.isInView === isIntersecting)
|
|
25
|
+
return;
|
|
26
|
+
this.isInView = isIntersecting;
|
|
27
|
+
if (once && !isIntersecting && this.hasEnteredView) {
|
|
28
|
+
return;
|
|
29
|
+
} else if (isIntersecting) {
|
|
30
|
+
this.hasEnteredView = true;
|
|
31
|
+
}
|
|
32
|
+
if (this.node.animationState) {
|
|
33
|
+
this.node.animationState.setActive("whileInView", isIntersecting);
|
|
34
|
+
}
|
|
35
|
+
const { onViewportEnter, onViewportLeave } = this.node.getProps();
|
|
36
|
+
const callback = isIntersecting ? onViewportEnter : onViewportLeave;
|
|
37
|
+
callback && callback(entry);
|
|
38
|
+
};
|
|
39
|
+
this.stopObserver = observeIntersection(this.node.current, options, onIntersectionUpdate);
|
|
40
|
+
}
|
|
41
|
+
mount() {
|
|
42
|
+
this.startObserver();
|
|
43
|
+
}
|
|
44
|
+
update() {
|
|
45
|
+
if (typeof IntersectionObserver === "undefined")
|
|
46
|
+
return;
|
|
47
|
+
const { props, prevProps } = this.node;
|
|
48
|
+
const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
|
|
49
|
+
if (hasOptionsChanged) {
|
|
50
|
+
this.startObserver();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
unmount() {
|
|
54
|
+
this.stopObserver?.();
|
|
55
|
+
this.hasEnteredView = false;
|
|
56
|
+
this.isInView = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) {
|
|
60
|
+
return (name) => viewport[name] !== prevViewport[name];
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
InViewFeature
|
|
64
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const observerCallbacks = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const observers = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
const fireObserverCallback = (entry) => {
|
|
4
|
+
const callback = observerCallbacks.get(entry.target);
|
|
5
|
+
callback && callback(entry);
|
|
6
|
+
};
|
|
7
|
+
const fireAllObserverCallbacks = (entries) => {
|
|
8
|
+
entries.forEach(fireObserverCallback);
|
|
9
|
+
};
|
|
10
|
+
function initIntersectionObserver({ root, ...options }) {
|
|
11
|
+
const lookupRoot = root || document;
|
|
12
|
+
if (!observers.has(lookupRoot)) {
|
|
13
|
+
observers.set(lookupRoot, {});
|
|
14
|
+
}
|
|
15
|
+
const rootObservers = observers.get(lookupRoot);
|
|
16
|
+
const key = JSON.stringify(options);
|
|
17
|
+
if (!rootObservers[key]) {
|
|
18
|
+
rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });
|
|
19
|
+
}
|
|
20
|
+
return rootObservers[key];
|
|
21
|
+
}
|
|
22
|
+
function observeIntersection(element, options, callback) {
|
|
23
|
+
const rootInteresectionObserver = initIntersectionObserver(options);
|
|
24
|
+
observerCallbacks.set(element, callback);
|
|
25
|
+
rootInteresectionObserver.observe(element);
|
|
26
|
+
return () => {
|
|
27
|
+
observerCallbacks.delete(element);
|
|
28
|
+
rootInteresectionObserver.unobserve(element);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
observeIntersection
|
|
33
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useContext } from "react";
|
|
3
|
+
import { LayoutGroupContext } from "../context/LayoutGroupContext.js";
|
|
4
|
+
import { LazyContext } from "../context/LazyContext.js";
|
|
5
|
+
import { MotionConfigContext } from "../context/MotionConfigContext.js";
|
|
6
|
+
import { MotionContext } from "../context/MotionContext/index.js";
|
|
7
|
+
import { useCreateMotionContext } from "../context/MotionContext/create.js";
|
|
8
|
+
import { useRender } from "../render/dom/use-render.js";
|
|
9
|
+
import { isSVGComponent } from "../render/dom/utils/is-svg-component.js";
|
|
10
|
+
import { useHTMLVisualState } from "../render/html/use-html-visual-state.js";
|
|
11
|
+
import { useSVGVisualState } from "../render/svg/use-svg-visual-state.js";
|
|
12
|
+
import { getInitializedFeatureDefinitions } from "./features/definitions.js";
|
|
13
|
+
import { loadFeatures } from "./features/load-features.js";
|
|
14
|
+
import { motionComponentSymbol } from "./utils/symbol.js";
|
|
15
|
+
import { useMotionRef } from "./utils/use-motion-ref.js";
|
|
16
|
+
import { useVisualElement } from "./utils/use-visual-element.js";
|
|
17
|
+
import { warning, invariant } from "../../../../motion-utils/dist/es/errors.js";
|
|
18
|
+
function createMotionComponent(Component, { forwardMotionProps = false, type } = {}, preloadedFeatures, createVisualElement) {
|
|
19
|
+
preloadedFeatures && loadFeatures(preloadedFeatures);
|
|
20
|
+
const isSVG = type ? type === "svg" : isSVGComponent(Component);
|
|
21
|
+
const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState;
|
|
22
|
+
function MotionDOMComponent(props, externalRef) {
|
|
23
|
+
let MeasureLayout;
|
|
24
|
+
const configAndProps = {
|
|
25
|
+
...useContext(MotionConfigContext),
|
|
26
|
+
...props,
|
|
27
|
+
layoutId: useLayoutId(props)
|
|
28
|
+
};
|
|
29
|
+
const { isStatic } = configAndProps;
|
|
30
|
+
const context = useCreateMotionContext(props);
|
|
31
|
+
const visualState = useVisualState(props, isStatic);
|
|
32
|
+
if (!isStatic && typeof window !== "undefined") {
|
|
33
|
+
useStrictMode(configAndProps, preloadedFeatures);
|
|
34
|
+
const layoutProjection = getProjectionFunctionality(configAndProps);
|
|
35
|
+
MeasureLayout = layoutProjection.MeasureLayout;
|
|
36
|
+
context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode, isSVG);
|
|
37
|
+
}
|
|
38
|
+
return jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout && context.visualElement ? jsx(MeasureLayout, { visualElement: context.visualElement, ...configAndProps }) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, forwardMotionProps, isSVG)] });
|
|
39
|
+
}
|
|
40
|
+
MotionDOMComponent.displayName = `motion.${typeof Component === "string" ? Component : `create(${Component.displayName ?? Component.name ?? ""})`}`;
|
|
41
|
+
const ForwardRefMotionComponent = forwardRef(MotionDOMComponent);
|
|
42
|
+
ForwardRefMotionComponent[motionComponentSymbol] = Component;
|
|
43
|
+
return ForwardRefMotionComponent;
|
|
44
|
+
}
|
|
45
|
+
function useLayoutId({ layoutId }) {
|
|
46
|
+
const layoutGroupId = useContext(LayoutGroupContext).id;
|
|
47
|
+
return layoutGroupId && layoutId !== void 0 ? layoutGroupId + "-" + layoutId : layoutId;
|
|
48
|
+
}
|
|
49
|
+
function useStrictMode(configAndProps, preloadedFeatures) {
|
|
50
|
+
const isStrict = useContext(LazyContext).strict;
|
|
51
|
+
if (process.env.NODE_ENV !== "production" && preloadedFeatures && isStrict) {
|
|
52
|
+
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
53
|
+
configAndProps.ignoreStrict ? warning(false, strictMessage, "lazy-strict-mode") : invariant(false, strictMessage, "lazy-strict-mode");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function getProjectionFunctionality(props) {
|
|
57
|
+
const featureDefinitions = getInitializedFeatureDefinitions();
|
|
58
|
+
const { drag, layout } = featureDefinitions;
|
|
59
|
+
if (!drag && !layout)
|
|
60
|
+
return {};
|
|
61
|
+
const combined = { ...drag, ...layout };
|
|
62
|
+
return {
|
|
63
|
+
MeasureLayout: drag?.isEnabled(props) || layout?.isEnabled(props) ? combined.MeasureLayout : void 0,
|
|
64
|
+
ProjectionNode: combined.ProjectionNode
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
createMotionComponent
|
|
69
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useRef, useInsertionEffect, useCallback } from "react";
|
|
2
|
+
function useMotionRef(visualState, visualElement, externalRef) {
|
|
3
|
+
const externalRefContainer = useRef(externalRef);
|
|
4
|
+
useInsertionEffect(() => {
|
|
5
|
+
externalRefContainer.current = externalRef;
|
|
6
|
+
});
|
|
7
|
+
const refCleanup = useRef(null);
|
|
8
|
+
return useCallback((instance) => {
|
|
9
|
+
if (instance) {
|
|
10
|
+
visualState.onMount?.(instance);
|
|
11
|
+
}
|
|
12
|
+
if (visualElement) {
|
|
13
|
+
instance ? visualElement.mount(instance) : visualElement.unmount();
|
|
14
|
+
}
|
|
15
|
+
const ref = externalRefContainer.current;
|
|
16
|
+
if (typeof ref === "function") {
|
|
17
|
+
if (instance) {
|
|
18
|
+
const cleanup = ref(instance);
|
|
19
|
+
if (typeof cleanup === "function") {
|
|
20
|
+
refCleanup.current = cleanup;
|
|
21
|
+
}
|
|
22
|
+
} else if (refCleanup.current) {
|
|
23
|
+
refCleanup.current();
|
|
24
|
+
refCleanup.current = null;
|
|
25
|
+
} else {
|
|
26
|
+
ref(instance);
|
|
27
|
+
}
|
|
28
|
+
} else if (ref) {
|
|
29
|
+
ref.current = instance;
|
|
30
|
+
}
|
|
31
|
+
}, [visualElement]);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
useMotionRef
|
|
35
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { useContext, useRef, useInsertionEffect, useEffect } from "react";
|
|
2
|
+
import { LazyContext } from "../../context/LazyContext.js";
|
|
3
|
+
import { MotionConfigContext } from "../../context/MotionConfigContext.js";
|
|
4
|
+
import { MotionContext } from "../../context/MotionContext/index.js";
|
|
5
|
+
import { PresenceContext } from "../../context/PresenceContext.js";
|
|
6
|
+
import { SwitchLayoutGroupContext } from "../../context/SwitchLayoutGroupContext.js";
|
|
7
|
+
import { isRefObject } from "../../utils/is-ref-object.js";
|
|
8
|
+
import { useIsomorphicLayoutEffect } from "../../utils/use-isomorphic-effect.js";
|
|
9
|
+
import { optimizedAppearDataAttribute } from "../../../../../motion-dom/dist/es/animation/optimized-appear/data-id.js";
|
|
10
|
+
function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor, isSVG) {
|
|
11
|
+
const { visualElement: parent } = useContext(MotionContext);
|
|
12
|
+
const lazyContext = useContext(LazyContext);
|
|
13
|
+
const presenceContext = useContext(PresenceContext);
|
|
14
|
+
const motionConfig = useContext(MotionConfigContext);
|
|
15
|
+
const reducedMotionConfig = motionConfig.reducedMotion;
|
|
16
|
+
const skipAnimations = motionConfig.skipAnimations;
|
|
17
|
+
const visualElementRef = useRef(null);
|
|
18
|
+
const hasMountedOnce = useRef(false);
|
|
19
|
+
createVisualElement = createVisualElement || lazyContext.renderer;
|
|
20
|
+
if (!visualElementRef.current && createVisualElement) {
|
|
21
|
+
visualElementRef.current = createVisualElement(Component, {
|
|
22
|
+
visualState,
|
|
23
|
+
parent,
|
|
24
|
+
props,
|
|
25
|
+
presenceContext,
|
|
26
|
+
blockInitialAnimation: presenceContext ? presenceContext.initial === false : false,
|
|
27
|
+
reducedMotionConfig,
|
|
28
|
+
skipAnimations,
|
|
29
|
+
isSVG
|
|
30
|
+
});
|
|
31
|
+
if (hasMountedOnce.current && visualElementRef.current) {
|
|
32
|
+
visualElementRef.current.manuallyAnimateOnMount = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const visualElement = visualElementRef.current;
|
|
36
|
+
const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext);
|
|
37
|
+
if (visualElement && !visualElement.projection && ProjectionNodeConstructor && (visualElement.type === "html" || visualElement.type === "svg")) {
|
|
38
|
+
createProjectionNode(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
|
|
39
|
+
}
|
|
40
|
+
const isMounted = useRef(false);
|
|
41
|
+
useInsertionEffect(() => {
|
|
42
|
+
if (visualElement && isMounted.current) {
|
|
43
|
+
visualElement.update(props, presenceContext);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const optimisedAppearId = props[optimizedAppearDataAttribute];
|
|
47
|
+
const wantsHandoff = useRef(Boolean(optimisedAppearId) && typeof window !== "undefined" && !window.MotionHandoffIsComplete?.(optimisedAppearId) && window.MotionHasOptimisedAnimation?.(optimisedAppearId));
|
|
48
|
+
useIsomorphicLayoutEffect(() => {
|
|
49
|
+
hasMountedOnce.current = true;
|
|
50
|
+
if (!visualElement)
|
|
51
|
+
return;
|
|
52
|
+
isMounted.current = true;
|
|
53
|
+
window.MotionIsMounted = true;
|
|
54
|
+
visualElement.updateFeatures();
|
|
55
|
+
visualElement.scheduleRenderMicrotask();
|
|
56
|
+
if (wantsHandoff.current && visualElement.animationState) {
|
|
57
|
+
visualElement.animationState.animateChanges();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!visualElement)
|
|
62
|
+
return;
|
|
63
|
+
if (!wantsHandoff.current && visualElement.animationState) {
|
|
64
|
+
visualElement.animationState.animateChanges();
|
|
65
|
+
}
|
|
66
|
+
if (wantsHandoff.current) {
|
|
67
|
+
queueMicrotask(() => {
|
|
68
|
+
window.MotionHandoffMarkAsComplete?.(optimisedAppearId);
|
|
69
|
+
});
|
|
70
|
+
wantsHandoff.current = false;
|
|
71
|
+
}
|
|
72
|
+
visualElement.enteringChildren = void 0;
|
|
73
|
+
});
|
|
74
|
+
return visualElement;
|
|
75
|
+
}
|
|
76
|
+
function createProjectionNode(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
|
|
77
|
+
const { layoutId, layout, drag, dragConstraints, layoutScroll, layoutRoot, layoutAnchor, layoutCrossfade } = props;
|
|
78
|
+
visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(visualElement.parent));
|
|
79
|
+
visualElement.projection.setOptions({
|
|
80
|
+
layoutId,
|
|
81
|
+
layout,
|
|
82
|
+
alwaysMeasureLayout: Boolean(drag) || dragConstraints && isRefObject(dragConstraints),
|
|
83
|
+
visualElement,
|
|
84
|
+
/**
|
|
85
|
+
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
86
|
+
* to update by the time layout animations run.
|
|
87
|
+
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
|
|
88
|
+
* ensuring it gets called if there's no potential layout animations.
|
|
89
|
+
*
|
|
90
|
+
*/
|
|
91
|
+
animationType: typeof layout === "string" ? layout : "both",
|
|
92
|
+
initialPromotionConfig,
|
|
93
|
+
crossfade: layoutCrossfade,
|
|
94
|
+
layoutScroll,
|
|
95
|
+
layoutRoot,
|
|
96
|
+
layoutAnchor
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function getClosestProjectingNode(visualElement) {
|
|
100
|
+
if (!visualElement)
|
|
101
|
+
return void 0;
|
|
102
|
+
return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
useVisualElement
|
|
106
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { MotionContext } from "../../context/MotionContext/index.js";
|
|
3
|
+
import { PresenceContext } from "../../context/PresenceContext.js";
|
|
4
|
+
import { useConstant } from "../../utils/use-constant.js";
|
|
5
|
+
import { resolveMotionValue } from "../../../../../motion-dom/dist/es/value/utils/resolve-motion-value.js";
|
|
6
|
+
import { isControllingVariants, isVariantNode } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
|
|
7
|
+
import { isAnimationControls } from "../../../../../motion-dom/dist/es/render/utils/is-animation-controls.js";
|
|
8
|
+
import { resolveVariantFromProps } from "../../../../../motion-dom/dist/es/render/utils/resolve-variants.js";
|
|
9
|
+
function makeState({ scrapeMotionValuesFromProps, createRenderState }, props, context, presenceContext) {
|
|
10
|
+
const state = {
|
|
11
|
+
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
|
|
12
|
+
renderState: createRenderState()
|
|
13
|
+
};
|
|
14
|
+
return state;
|
|
15
|
+
}
|
|
16
|
+
function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
17
|
+
const values = {};
|
|
18
|
+
const motionValues = scrapeMotionValues(props, {});
|
|
19
|
+
for (const key in motionValues) {
|
|
20
|
+
values[key] = resolveMotionValue(motionValues[key]);
|
|
21
|
+
}
|
|
22
|
+
let { initial, animate } = props;
|
|
23
|
+
const isControllingVariants$1 = isControllingVariants(props);
|
|
24
|
+
const isVariantNode$1 = isVariantNode(props);
|
|
25
|
+
if (context && isVariantNode$1 && !isControllingVariants$1 && props.inherit !== false) {
|
|
26
|
+
if (initial === void 0)
|
|
27
|
+
initial = context.initial;
|
|
28
|
+
if (animate === void 0)
|
|
29
|
+
animate = context.animate;
|
|
30
|
+
}
|
|
31
|
+
let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === false : false;
|
|
32
|
+
isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
|
|
33
|
+
const variantToSet = isInitialAnimationBlocked ? animate : initial;
|
|
34
|
+
if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) {
|
|
35
|
+
const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
|
|
36
|
+
for (let i = 0; i < list.length; i++) {
|
|
37
|
+
const resolved = resolveVariantFromProps(props, list[i]);
|
|
38
|
+
if (resolved) {
|
|
39
|
+
const { transitionEnd, transition, ...target } = resolved;
|
|
40
|
+
for (const key in target) {
|
|
41
|
+
let valueTarget = target[key];
|
|
42
|
+
if (Array.isArray(valueTarget)) {
|
|
43
|
+
const index = isInitialAnimationBlocked ? valueTarget.length - 1 : 0;
|
|
44
|
+
valueTarget = valueTarget[index];
|
|
45
|
+
}
|
|
46
|
+
if (valueTarget !== null) {
|
|
47
|
+
values[key] = valueTarget;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (const key in transitionEnd) {
|
|
51
|
+
values[key] = transitionEnd[key];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return values;
|
|
57
|
+
}
|
|
58
|
+
const makeUseVisualState = (config) => (props, isStatic) => {
|
|
59
|
+
const context = useContext(MotionContext);
|
|
60
|
+
const presenceContext = useContext(PresenceContext);
|
|
61
|
+
const make = () => makeState(config, props, context, presenceContext);
|
|
62
|
+
return isStatic ? make() : useConstant(make);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
makeUseVisualState
|
|
66
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const validMotionProps = /* @__PURE__ */ new Set([
|
|
2
|
+
"animate",
|
|
3
|
+
"exit",
|
|
4
|
+
"variants",
|
|
5
|
+
"initial",
|
|
6
|
+
"style",
|
|
7
|
+
"values",
|
|
8
|
+
"variants",
|
|
9
|
+
"transition",
|
|
10
|
+
"transformTemplate",
|
|
11
|
+
"custom",
|
|
12
|
+
"inherit",
|
|
13
|
+
"onBeforeLayoutMeasure",
|
|
14
|
+
"onAnimationStart",
|
|
15
|
+
"onAnimationComplete",
|
|
16
|
+
"onUpdate",
|
|
17
|
+
"onDragStart",
|
|
18
|
+
"onDrag",
|
|
19
|
+
"onDragEnd",
|
|
20
|
+
"onMeasureDragConstraints",
|
|
21
|
+
"onDirectionLock",
|
|
22
|
+
"onDragTransitionEnd",
|
|
23
|
+
"_dragX",
|
|
24
|
+
"_dragY",
|
|
25
|
+
"onHoverStart",
|
|
26
|
+
"onHoverEnd",
|
|
27
|
+
"onViewportEnter",
|
|
28
|
+
"onViewportLeave",
|
|
29
|
+
"globalTapTarget",
|
|
30
|
+
"propagate",
|
|
31
|
+
"ignoreStrict",
|
|
32
|
+
"viewport"
|
|
33
|
+
]);
|
|
34
|
+
function isValidMotionProp(key) {
|
|
35
|
+
return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
isValidMotionProp
|
|
39
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/create-proxy.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createMotionComponent } from "../../motion/index.js";
|
|
2
|
+
import { warnOnce } from "../../../../../motion-utils/dist/es/warn-once.js";
|
|
3
|
+
function createMotionProxy(preloadedFeatures, createVisualElement) {
|
|
4
|
+
if (typeof Proxy === "undefined") {
|
|
5
|
+
return createMotionComponent;
|
|
6
|
+
}
|
|
7
|
+
const componentCache = /* @__PURE__ */ new Map();
|
|
8
|
+
const factory = (Component, options) => {
|
|
9
|
+
return createMotionComponent(Component, options, preloadedFeatures, createVisualElement);
|
|
10
|
+
};
|
|
11
|
+
const deprecatedFactoryFunction = (Component, options) => {
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
warnOnce(false, "motion() is deprecated. Use motion.create() instead.");
|
|
14
|
+
}
|
|
15
|
+
return factory(Component, options);
|
|
16
|
+
};
|
|
17
|
+
return new Proxy(deprecatedFactoryFunction, {
|
|
18
|
+
/**
|
|
19
|
+
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
|
|
20
|
+
* The prop name is passed through as `key` and we can use that to generate a `motion`
|
|
21
|
+
* DOM component with that name.
|
|
22
|
+
*/
|
|
23
|
+
get: (_target, key) => {
|
|
24
|
+
if (key === "create")
|
|
25
|
+
return factory;
|
|
26
|
+
if (!componentCache.has(key)) {
|
|
27
|
+
componentCache.set(key, createMotionComponent(key, void 0, preloadedFeatures, createVisualElement));
|
|
28
|
+
}
|
|
29
|
+
return componentCache.get(key);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
createMotionProxy
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { animations } from "../../../motion/features/animations.js";
|
|
2
|
+
import { drag } from "../../../motion/features/drag.js";
|
|
3
|
+
import { gestureAnimations } from "../../../motion/features/gestures.js";
|
|
4
|
+
import { layout } from "../../../motion/features/layout.js";
|
|
5
|
+
const featureBundle = {
|
|
6
|
+
...animations,
|
|
7
|
+
...gestureAnimations,
|
|
8
|
+
...drag,
|
|
9
|
+
...layout
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
featureBundle
|
|
13
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/proxy.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createDomVisualElement } from "../../dom/create-visual-element.js";
|
|
2
|
+
import { createMotionProxy } from "../create-proxy.js";
|
|
3
|
+
import { featureBundle } from "./feature-bundle.js";
|
|
4
|
+
const motion = /* @__PURE__ */ createMotionProxy(featureBundle, createDomVisualElement);
|
|
5
|
+
export {
|
|
6
|
+
motion
|
|
7
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Fragment } from "react";
|
|
2
|
+
import { isSVGComponent } from "./utils/is-svg-component.js";
|
|
3
|
+
import { SVGVisualElement } from "../../../../../motion-dom/dist/es/render/svg/SVGVisualElement.js";
|
|
4
|
+
import { HTMLVisualElement } from "../../../../../motion-dom/dist/es/render/html/HTMLVisualElement.js";
|
|
5
|
+
const createDomVisualElement = (Component, options) => {
|
|
6
|
+
const isSVG = options.isSVG ?? isSVGComponent(Component);
|
|
7
|
+
return isSVG ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
|
|
8
|
+
allowProjection: Component !== Fragment
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
createDomVisualElement
|
|
13
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Fragment, useMemo, createElement } from "react";
|
|
2
|
+
import { useHTMLProps } from "../html/use-props.js";
|
|
3
|
+
import { useSVGProps } from "../svg/use-props.js";
|
|
4
|
+
import { filterProps } from "./utils/filter-props.js";
|
|
5
|
+
import { isSVGComponent } from "./utils/is-svg-component.js";
|
|
6
|
+
import { isMotionValue } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
|
|
7
|
+
function useRender(Component, props, ref, { latestValues }, isStatic, forwardMotionProps = false, isSVG) {
|
|
8
|
+
const useVisualProps = isSVG ?? isSVGComponent(Component) ? useSVGProps : useHTMLProps;
|
|
9
|
+
const visualProps = useVisualProps(props, latestValues, isStatic, Component);
|
|
10
|
+
const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
|
|
11
|
+
const elementProps = Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {};
|
|
12
|
+
const { children } = props;
|
|
13
|
+
const renderedChildren = useMemo(() => isMotionValue(children) ? children.get() : children, [children]);
|
|
14
|
+
return createElement(Component, {
|
|
15
|
+
...elementProps,
|
|
16
|
+
children: renderedChildren
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
useRender
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isValidMotionProp } from "../../../motion/utils/valid-prop.js";
|
|
2
|
+
import { isMotionValue } from "../../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
|
|
3
|
+
let shouldForward = (key) => !isValidMotionProp(key);
|
|
4
|
+
function loadExternalIsValidProp(isValidProp) {
|
|
5
|
+
if (typeof isValidProp !== "function")
|
|
6
|
+
return;
|
|
7
|
+
shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const emotionPkg = "@emotion/is-prop-valid";
|
|
11
|
+
loadExternalIsValidProp(require(emotionPkg).default);
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
function filterProps(props, isDom, forwardMotionProps) {
|
|
15
|
+
const filteredProps = {};
|
|
16
|
+
for (const key in props) {
|
|
17
|
+
if (key === "values" && typeof props.values === "object")
|
|
18
|
+
continue;
|
|
19
|
+
if (isMotionValue(props[key]))
|
|
20
|
+
continue;
|
|
21
|
+
if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
|
|
22
|
+
props["draggable"] && key.startsWith("onDrag")) {
|
|
23
|
+
filteredProps[key] = props[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return filteredProps;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
filterProps,
|
|
30
|
+
loadExternalIsValidProp
|
|
31
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { lowercaseSVGElements } from "../../svg/lowercase-elements.js";
|
|
2
|
+
function isSVGComponent(Component) {
|
|
3
|
+
if (
|
|
4
|
+
/**
|
|
5
|
+
* If it's not a string, it's a custom React component. Currently we only support
|
|
6
|
+
* HTML custom React components.
|
|
7
|
+
*/
|
|
8
|
+
typeof Component !== "string" || /**
|
|
9
|
+
* If it contains a dash, the element is a custom HTML webcomponent.
|
|
10
|
+
*/
|
|
11
|
+
Component.includes("-")
|
|
12
|
+
) {
|
|
13
|
+
return false;
|
|
14
|
+
} else if (
|
|
15
|
+
/**
|
|
16
|
+
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
17
|
+
*/
|
|
18
|
+
lowercaseSVGElements.indexOf(Component) > -1 || /**
|
|
19
|
+
* If it contains a capital letter, it's an SVG component
|
|
20
|
+
*/
|
|
21
|
+
/[A-Z]/u.test(Component)
|
|
22
|
+
) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
isSVGComponent
|
|
29
|
+
};
|
package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { makeUseVisualState } from "../../motion/utils/use-visual-state.js";
|
|
2
|
+
import { createHtmlRenderState } from "./utils/create-render-state.js";
|
|
3
|
+
import { scrapeMotionValuesFromProps } from "../../../../../motion-dom/dist/es/render/html/utils/scrape-motion-values.js";
|
|
4
|
+
const useHTMLVisualState = /* @__PURE__ */ makeUseVisualState({
|
|
5
|
+
scrapeMotionValuesFromProps,
|
|
6
|
+
createRenderState: createHtmlRenderState
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
useHTMLVisualState
|
|
10
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { createHtmlRenderState } from "./utils/create-render-state.js";
|
|
3
|
+
import { isMotionValue } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
|
|
4
|
+
import { isForcedMotionValue } from "../../../../../motion-dom/dist/es/render/utils/is-forced-motion-value.js";
|
|
5
|
+
import { buildHTMLStyles } from "../../../../../motion-dom/dist/es/render/html/utils/build-styles.js";
|
|
6
|
+
function copyRawValuesOnly(target, source, props) {
|
|
7
|
+
for (const key in source) {
|
|
8
|
+
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
|
|
9
|
+
target[key] = source[key];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function useInitialMotionValues({ transformTemplate }, visualState) {
|
|
14
|
+
return useMemo(() => {
|
|
15
|
+
const state = createHtmlRenderState();
|
|
16
|
+
buildHTMLStyles(state, visualState, transformTemplate);
|
|
17
|
+
return Object.assign({}, state.vars, state.style);
|
|
18
|
+
}, [visualState]);
|
|
19
|
+
}
|
|
20
|
+
function useStyle(props, visualState) {
|
|
21
|
+
const styleProp = props.style || {};
|
|
22
|
+
const style = {};
|
|
23
|
+
copyRawValuesOnly(style, styleProp, props);
|
|
24
|
+
Object.assign(style, useInitialMotionValues(props, visualState));
|
|
25
|
+
return style;
|
|
26
|
+
}
|
|
27
|
+
function useHTMLProps(props, visualState) {
|
|
28
|
+
const htmlProps = {};
|
|
29
|
+
const style = useStyle(props, visualState);
|
|
30
|
+
if (props.drag && props.dragListener !== false) {
|
|
31
|
+
htmlProps.draggable = false;
|
|
32
|
+
style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none";
|
|
33
|
+
style.touchAction = props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`;
|
|
34
|
+
}
|
|
35
|
+
if (props.tabIndex === void 0 && (props.onTap || props.onTapStart || props.whileTap)) {
|
|
36
|
+
htmlProps.tabIndex = 0;
|
|
37
|
+
}
|
|
38
|
+
htmlProps.style = style;
|
|
39
|
+
return htmlProps;
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
copyRawValuesOnly,
|
|
43
|
+
useHTMLProps
|
|
44
|
+
};
|