@code0-tech/pictor 1.1.0 → 1.1.2
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/_virtual/rolldown_runtime.js +3 -12
- package/dist/assets/Button.style.css +1 -1
- package/dist/assets/ContextMenu.style.css +1 -1
- package/dist/assets/DateInput.style.css +1 -1
- package/dist/assets/Editor.styles.css +1 -1
- package/dist/assets/Input.style.css +1 -1
- package/dist/assets/InputWrapper.style.css +1 -1
- package/dist/assets/Menu.style.css +1 -1
- package/dist/assets/SegmentedControl.style.css +1 -1
- package/dist/assets/SelectInput.style.css +1 -1
- package/dist/components/alert/Alert.js +19 -20
- package/dist/components/aurora/Aurora.js +15 -16
- package/dist/components/avatar/Avatar.js +44 -44
- package/dist/components/badge/Badge.js +36 -37
- package/dist/components/button/Button.js +16 -16
- package/dist/components/button-group/ButtonGroup.js +15 -16
- package/dist/components/card/Card.js +21 -22
- package/dist/components/card/CardSection.js +15 -15
- package/dist/components/chart/Chart.js +82 -82
- package/dist/components/chart/LineChart.js +50 -51
- package/dist/components/col/Col.js +9 -10
- package/dist/components/command/Command.js +32 -33
- package/dist/components/container/Container.js +9 -10
- package/dist/components/context-menu/ContextMenu.js +76 -77
- package/dist/components/data-table/DataTableColumn.js +9 -10
- package/dist/components/data-table/DataTableFilterInput.js +83 -83
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +26 -27
- package/dist/components/data-table/DataTableHeader.js +20 -21
- package/dist/components/data-table/DataTablePagination.js +27 -28
- package/dist/components/dialog/Dialog.js +61 -62
- package/dist/components/file-tabs/FileTabs.js +51 -52
- package/dist/components/flex/Flex.js +9 -10
- package/dist/components/form/CheckboxInput.js +50 -51
- package/dist/components/form/ColorInput.js +242 -242
- package/dist/components/form/DateInput.js +55 -55
- package/dist/components/form/EditorInput.d.ts +7 -0
- package/dist/components/form/EditorInput.js +278 -273
- package/dist/components/form/FileInput.js +67 -68
- package/dist/components/form/InputDescription.js +3 -4
- package/dist/components/form/InputLabel.js +9 -10
- package/dist/components/form/InputMessage.js +6 -7
- package/dist/components/form/InputWrapper.js +37 -38
- package/dist/components/form/PasswordInput.js +2 -2
- package/dist/components/form/PinInput.js +30 -31
- package/dist/components/form/RadioGroup.js +22 -23
- package/dist/components/form/RadioInput.js +19 -20
- package/dist/components/form/SelectInput.js +55 -56
- package/dist/components/form/TagInput.js +46 -45
- package/dist/components/fullscreen/FullScreen.js +14 -15
- package/dist/components/gantt/Gantt.js +63 -64
- package/dist/components/gantt/GanttGroup.js +2 -2
- package/dist/components/gantt/GanttHeader.js +40 -41
- package/dist/components/gantt/GanttItem.js +11 -12
- package/dist/components/icon/Icon.js +22 -22
- package/dist/components/json-view/JsonView.js +37 -38
- package/dist/components/layout/Layout.js +64 -65
- package/dist/components/menu/Menu.js +91 -92
- package/dist/components/quote/Quote.js +29 -30
- package/dist/components/resizable/Resizable.js +22 -23
- package/dist/components/row/Row.js +9 -10
- package/dist/components/scroll-area/ScrollArea.js +46 -47
- package/dist/components/segmented-control/SegmentedControl.js +35 -35
- package/dist/components/spacing/Spacing.js +8 -9
- package/dist/components/tab/Tab.js +53 -53
- package/dist/components/text/Text.js +9 -10
- package/dist/components/toast/Toast.js +47 -47
- package/dist/components/tooltip/Tooltip.js +35 -36
- package/dist/node_modules/@lezer/common/dist/index.js +4 -4
- package/dist/utils/contextStore.js +31 -32
- package/dist/utils/motion.js +39 -40
- package/package.json +8 -8
- package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -51
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -58
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -256
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -20
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -57
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -25
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -136
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -40
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -37
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -49
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -44
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -68
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -56
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -48
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +0 -3
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -19
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -2
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -23
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -5
- package/dist/node_modules/motion/dist/es/react.js +0 -196
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -105
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -127
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -82
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +0 -164
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -43
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -54
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -24
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -59
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -65
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -33
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -41
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -580
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -49
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -201
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -54
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -26
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -133
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +0 -35
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -50
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -3
- package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -90
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -50
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -62
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -2
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/array.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -16
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -3
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -29
- package/dist/node_modules/motion-utils/dist/es/errors.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/memo.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/noop.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/progress.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -24
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -2
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -6
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +0 -21
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +0 -18
- package/dist/node_modules/react/compiler-runtime.js +0 -8
package/dist/utils/motion.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useReducedMotion } from "../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js";
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
3
2
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
const spring = (e,
|
|
3
|
+
import { useReducedMotion } from "motion/react";
|
|
4
|
+
const spring = (e, i) => ({
|
|
6
5
|
type: "spring",
|
|
7
6
|
bounce: Math.max(0, 1 - e),
|
|
8
|
-
duration:
|
|
7
|
+
duration: i
|
|
9
8
|
}), springs = {
|
|
10
9
|
ui: spring(1, .3),
|
|
11
10
|
surface: spring(1, .4),
|
|
@@ -15,11 +14,11 @@ const spring = (e, o) => ({
|
|
|
15
14
|
duration: .15,
|
|
16
15
|
ease: "easeOut"
|
|
17
16
|
}, useReducedMotionSafe = () => useReducedMotion() ?? !1;
|
|
18
|
-
var materialize = (e,
|
|
17
|
+
var materialize = (e, i, a) => ({
|
|
19
18
|
initial: {
|
|
20
19
|
opacity: 0,
|
|
21
20
|
scale: e,
|
|
22
|
-
filter: `blur(${
|
|
21
|
+
filter: `blur(${i}px)`
|
|
23
22
|
},
|
|
24
23
|
animate: {
|
|
25
24
|
opacity: 1,
|
|
@@ -29,9 +28,9 @@ var materialize = (e, o, s) => ({
|
|
|
29
28
|
exit: {
|
|
30
29
|
opacity: 0,
|
|
31
30
|
scale: e,
|
|
32
|
-
filter: `blur(${
|
|
31
|
+
filter: `blur(${i}px)`
|
|
33
32
|
},
|
|
34
|
-
transition:
|
|
33
|
+
transition: a
|
|
35
34
|
}), fade = {
|
|
36
35
|
initial: { opacity: 0 },
|
|
37
36
|
animate: { opacity: 1 },
|
|
@@ -39,49 +38,49 @@ var materialize = (e, o, s) => ({
|
|
|
39
38
|
transition: crossFade
|
|
40
39
|
};
|
|
41
40
|
const usePopperMotion = () => {
|
|
42
|
-
let
|
|
43
|
-
return
|
|
41
|
+
let i = c(2), a = useReducedMotionSafe(), o;
|
|
42
|
+
return i[0] === a ? o = i[1] : (o = a ? fade : materialize(.96, 4, springs.ui), i[0] = a, i[1] = o), o;
|
|
44
43
|
}, useSurfaceMotion = () => {
|
|
45
|
-
let
|
|
46
|
-
return
|
|
47
|
-
}, useScrimMotion = (
|
|
48
|
-
let
|
|
44
|
+
let i = c(2), a = useReducedMotionSafe(), o;
|
|
45
|
+
return i[0] === a ? o = i[1] : (o = a ? fade : materialize(.97, 6, springs.surface), i[0] = a, i[1] = o), o;
|
|
46
|
+
}, useScrimMotion = (i) => {
|
|
47
|
+
let a = c(6), o = i === void 0 ? 6 : i;
|
|
49
48
|
if (useReducedMotionSafe()) return fade;
|
|
50
|
-
let
|
|
51
|
-
|
|
49
|
+
let l;
|
|
50
|
+
a[0] === Symbol.for("react.memo_cache_sentinel") ? (l = {
|
|
52
51
|
opacity: 0,
|
|
53
52
|
backdropFilter: "blur(0px)"
|
|
54
|
-
},
|
|
55
|
-
let
|
|
56
|
-
|
|
53
|
+
}, a[0] = l) : l = a[0];
|
|
54
|
+
let d = `blur(${o}px)`, p;
|
|
55
|
+
a[1] === d ? p = a[2] : (p = {
|
|
57
56
|
opacity: 1,
|
|
58
|
-
backdropFilter:
|
|
59
|
-
},
|
|
57
|
+
backdropFilter: d
|
|
58
|
+
}, a[1] = d, a[2] = p);
|
|
60
59
|
let m;
|
|
61
|
-
|
|
60
|
+
a[3] === Symbol.for("react.memo_cache_sentinel") ? (m = {
|
|
62
61
|
opacity: 0,
|
|
63
62
|
backdropFilter: "blur(0px)"
|
|
64
|
-
},
|
|
63
|
+
}, a[3] = m) : m = a[3];
|
|
65
64
|
let h;
|
|
66
|
-
return
|
|
67
|
-
initial:
|
|
68
|
-
animate:
|
|
65
|
+
return a[4] === p ? h = a[5] : (h = {
|
|
66
|
+
initial: l,
|
|
67
|
+
animate: p,
|
|
69
68
|
exit: m,
|
|
70
69
|
transition: springs.surface
|
|
71
|
-
},
|
|
72
|
-
}, popperTransformOrigin = (e) => ({ transformOrigin: `var(--radix-${e}-content-transform-origin, center)` }), useObservedOpen = (
|
|
73
|
-
let l =
|
|
74
|
-
l[0] ===
|
|
75
|
-
d(e),
|
|
76
|
-
}, l[0] =
|
|
77
|
-
let p = f, m =
|
|
70
|
+
}, a[4] = p, a[5] = h), h;
|
|
71
|
+
}, popperTransformOrigin = (e) => ({ transformOrigin: `var(--radix-${e}-content-transform-origin, center)` }), useObservedOpen = (a, o, s) => {
|
|
72
|
+
let l = c(5), [u, d] = React.useState(a ?? o ?? !1), f;
|
|
73
|
+
l[0] === s ? f = l[1] : (f = (e) => {
|
|
74
|
+
d(e), s?.(e);
|
|
75
|
+
}, l[0] = s, l[1] = f);
|
|
76
|
+
let p = f, m = a ?? u, h;
|
|
78
77
|
return l[2] !== p || l[3] !== m ? (h = [m, p], l[2] = p, l[3] = m, l[4] = h) : h = l[4], h;
|
|
79
|
-
}, useObservedValue = (
|
|
80
|
-
let l =
|
|
81
|
-
l[0] ===
|
|
82
|
-
d(e),
|
|
83
|
-
}, l[0] =
|
|
84
|
-
let p = f, m =
|
|
78
|
+
}, useObservedValue = (a, o, s) => {
|
|
79
|
+
let l = c(5), [u, d] = React.useState(a ?? o), f;
|
|
80
|
+
l[0] === s ? f = l[1] : (f = (e) => {
|
|
81
|
+
d(e), s?.(e);
|
|
82
|
+
}, l[0] = s, l[1] = f);
|
|
83
|
+
let p = f, m = a ?? u, h;
|
|
85
84
|
return l[2] !== p || l[3] !== m ? (h = [m, p], l[2] = p, l[3] = m, l[4] = h) : h = l[4], h;
|
|
86
85
|
};
|
|
87
86
|
export { crossFade, popperTransformOrigin, spring, springs, useObservedOpen, useObservedValue, usePopperMotion, useReducedMotionSafe, useScrimMotion, useSurfaceMotion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@codemirror/state": "^6.7.6",
|
|
28
28
|
"@codemirror/view": "^6.43.15",
|
|
29
29
|
"@dagrejs/dagre": "^3.0.0",
|
|
30
|
-
"@icons-pack/react-simple-icons": "^13.
|
|
30
|
+
"@icons-pack/react-simple-icons": "^13.15.1",
|
|
31
31
|
"@internationalized/date": "^3.12.4",
|
|
32
|
-
"@lezer/common": "^1.5.
|
|
32
|
+
"@lezer/common": "^1.5.5",
|
|
33
33
|
"@mdx-js/react": "^3.1.1",
|
|
34
34
|
"@radix-ui/react-checkbox": "^1.3.11",
|
|
35
35
|
"@radix-ui/react-context-menu": "^2.3.7",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
47
47
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
48
48
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
49
|
-
"@rollup/plugin-terser": "^1.0.
|
|
49
|
+
"@rollup/plugin-terser": "^1.0.2",
|
|
50
50
|
"@rollup/plugin-typescript": "^12.3.1",
|
|
51
51
|
"@storybook/addon-a11y": "^10.6.0",
|
|
52
52
|
"@storybook/addon-docs": "^10.6.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@uidotdev/usehooks": "^2.4.1",
|
|
66
66
|
"@uiw/codemirror-themes": "^4.25.12",
|
|
67
67
|
"@uiw/react-codemirror": "^4.25.10",
|
|
68
|
-
"@uiw/react-json-view": "^2.0.0-alpha.
|
|
68
|
+
"@uiw/react-json-view": "^2.0.0-alpha.44",
|
|
69
69
|
"@vitejs/plugin-react": "^5.2.0",
|
|
70
|
-
"@vitest/browser-playwright": "^4.1.
|
|
71
|
-
"@vitest/coverage-v8": "^4.1.
|
|
70
|
+
"@vitest/browser-playwright": "^4.1.12",
|
|
71
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
72
72
|
"avvvatars-react": "^0.4.2",
|
|
73
73
|
"axe-playwright": "^2.2.2",
|
|
74
74
|
"babel-loader": "^10.1.1",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"vite-plugin-dts": "^4.5.4",
|
|
105
105
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
106
106
|
"vite-plugin-svgr": "^5.2.0",
|
|
107
|
-
"vitest": "^4.1.
|
|
107
|
+
"vitest": "^4.1.12",
|
|
108
108
|
"zustand": "^5.0.16",
|
|
109
109
|
"recharts": "^3.10.1"
|
|
110
110
|
},
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { __esmMin, __export } from "../rolldown_runtime.js";
|
|
2
|
-
var is_prop_valid_framer_motion_exports = /* @__PURE__ */ __export({ default: () => is_prop_valid_framer_motion_default }, 1), is_prop_valid_framer_motion_default, init_is_prop_valid_framer_motion = __esmMin((() => {
|
|
3
|
-
throw is_prop_valid_framer_motion_default = {}, Error("Could not resolve \"@emotion/is-prop-valid\" imported by \"framer-motion\". Is it installed?");
|
|
4
|
-
}));
|
|
5
|
-
init_is_prop_valid_framer_motion();
|
|
6
|
-
export { init_is_prop_valid_framer_motion, is_prop_valid_framer_motion_exports };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { isHTMLElement } from "../../../../../motion-dom/dist/es/utils/is-html-element.js";
|
|
3
|
-
import { MotionConfigContext } from "../../context/MotionConfigContext.js";
|
|
4
|
-
import { useComposedRefs } from "../../utils/use-composed-ref.js";
|
|
5
|
-
import * as React$1 from "react";
|
|
6
|
-
import { useContext, useId, useInsertionEffect, useRef } from "react";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var PopChildMeasure = class extends React$1.Component {
|
|
9
|
-
getSnapshotBeforeUpdate(t) {
|
|
10
|
-
let n = this.props.childRef.current;
|
|
11
|
-
if (isHTMLElement(n) && t.isPresent && !this.props.isPresent && this.props.pop !== !1) {
|
|
12
|
-
let t = n.offsetParent, r = isHTMLElement(t) && t.offsetWidth || 0, i = isHTMLElement(t) && t.offsetHeight || 0, a = getComputedStyle(n), o = this.props.sizeRef.current;
|
|
13
|
-
o.height = parseFloat(a.height), o.width = parseFloat(a.width), o.top = n.offsetTop, o.left = n.offsetLeft, o.right = r - o.width - o.left, o.bottom = i - o.height - o.top, o.direction = a.direction;
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
componentDidUpdate() {}
|
|
18
|
-
render() {
|
|
19
|
-
return this.props.children;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
function PopChild({ children: e, isPresent: u, anchorX: d, anchorY: f, root: p, pop: m }) {
|
|
23
|
-
let h = useId(), g = useRef(null), _ = useRef({
|
|
24
|
-
width: 0,
|
|
25
|
-
height: 0,
|
|
26
|
-
top: 0,
|
|
27
|
-
left: 0,
|
|
28
|
-
right: 0,
|
|
29
|
-
bottom: 0,
|
|
30
|
-
direction: "ltr"
|
|
31
|
-
}), { nonce: v } = useContext(MotionConfigContext), y = useComposedRefs(g, m === !1 ? void 0 : e.props?.ref ?? e?.ref);
|
|
32
|
-
return useInsertionEffect(() => {
|
|
33
|
-
let { width: e, height: t, top: n, left: r, right: i, bottom: a, direction: o } = _.current;
|
|
34
|
-
if (u || m === !1 || !g.current || !e || !t) return;
|
|
35
|
-
let s = o === "rtl", c = d === "left" ? s ? `right: ${i}` : `left: ${r}` : s ? `left: ${r}` : `right: ${i}`, l = f === "bottom" ? `bottom: ${a}` : `top: ${n}`;
|
|
36
|
-
g.current.dataset.motionPopId = h;
|
|
37
|
-
let y = document.createElement("style");
|
|
38
|
-
v && (y.nonce = v);
|
|
39
|
-
let b = p ?? document.head;
|
|
40
|
-
return b.appendChild(y), y.sheet && y.sheet.insertRule(`
|
|
41
|
-
[data-motion-pop-id="${h}"] {
|
|
42
|
-
position: absolute !important;
|
|
43
|
-
width: ${e}px !important;
|
|
44
|
-
height: ${t}px !important;
|
|
45
|
-
${c}px !important;
|
|
46
|
-
${l}px !important;
|
|
47
|
-
}
|
|
48
|
-
`), () => {
|
|
49
|
-
g.current?.removeAttribute("data-motion-pop-id"), b.contains(y) && b.removeChild(y);
|
|
50
|
-
};
|
|
51
|
-
}, [u]), jsx(PopChildMeasure, {
|
|
52
|
-
isPresent: u,
|
|
53
|
-
childRef: g,
|
|
54
|
-
sizeRef: _,
|
|
55
|
-
pop: m,
|
|
56
|
-
children: m === !1 ? e : React$1.cloneElement(e, { ref: y })
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
export { PopChild };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useConstant } from "../../utils/use-constant.js";
|
|
3
|
-
import { useIsomorphicLayoutEffect } from "../../utils/use-isomorphic-effect.js";
|
|
4
|
-
import { PresenceContext } from "../../context/PresenceContext.js";
|
|
5
|
-
import { PopChild } from "./PopChild.js";
|
|
6
|
-
import * as React$1 from "react";
|
|
7
|
-
import { useId, useMemo, useRef } from "react";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var PresenceChild = ({ children: u, initial: d, isPresent: f, onExitComplete: p, custom: m, presenceAffectsLayout: h, mode: g, anchorX: _, anchorY: v, root: y }) => {
|
|
10
|
-
let b = useConstant(newChildrenMap), x = useId(), S = useRef(f), C = useRef(p);
|
|
11
|
-
useIsomorphicLayoutEffect(() => {
|
|
12
|
-
S.current = f, C.current = p;
|
|
13
|
-
});
|
|
14
|
-
let w = !0, T = useMemo(() => (w = !1, {
|
|
15
|
-
id: x,
|
|
16
|
-
initial: d,
|
|
17
|
-
isPresent: f,
|
|
18
|
-
custom: m,
|
|
19
|
-
onExitComplete: (e) => {
|
|
20
|
-
b.set(e, !0);
|
|
21
|
-
for (let e of b.values()) if (!e) return;
|
|
22
|
-
p && p();
|
|
23
|
-
},
|
|
24
|
-
register: (e) => (b.set(e, !1), () => {
|
|
25
|
-
b.delete(e), !S.current && !b.size && C.current?.();
|
|
26
|
-
})
|
|
27
|
-
}), [
|
|
28
|
-
f,
|
|
29
|
-
b,
|
|
30
|
-
p
|
|
31
|
-
]);
|
|
32
|
-
return h && w && (T = { ...T }), useMemo(() => {
|
|
33
|
-
b.forEach((e, l) => b.set(l, !1));
|
|
34
|
-
}, [f]), React$1.useEffect(() => {
|
|
35
|
-
!f && !b.size && p && p();
|
|
36
|
-
}, [f]), u = jsx(PopChild, {
|
|
37
|
-
pop: g === "popLayout",
|
|
38
|
-
isPresent: f,
|
|
39
|
-
anchorX: _,
|
|
40
|
-
anchorY: v,
|
|
41
|
-
root: y,
|
|
42
|
-
children: u
|
|
43
|
-
}), jsx(PresenceContext.Provider, {
|
|
44
|
-
value: T,
|
|
45
|
-
children: u
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
function newChildrenMap() {
|
|
49
|
-
return /* @__PURE__ */ new Map();
|
|
50
|
-
}
|
|
51
|
-
export { PresenceChild };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { LayoutGroupContext } from "../../context/LayoutGroupContext.js";
|
|
3
|
-
import { useConstant } from "../../utils/use-constant.js";
|
|
4
|
-
import { useIsomorphicLayoutEffect } from "../../utils/use-isomorphic-effect.js";
|
|
5
|
-
import { PresenceChild } from "./PresenceChild.js";
|
|
6
|
-
import { usePresence } from "./use-presence.js";
|
|
7
|
-
import { getChildKey, onlyElements } from "./utils.js";
|
|
8
|
-
import { useContext, useMemo, useRef, useState } from "react";
|
|
9
|
-
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
10
|
-
var AnimatePresence = ({ children: p, custom: m, initial: h = !0, onExitComplete: g, presenceAffectsLayout: _ = !0, mode: v = "sync", propagate: y = !1, anchorX: b = "left", anchorY: x = "top", root: S }) => {
|
|
11
|
-
let [C, w] = usePresence(y), T = useMemo(() => onlyElements(p), [p]), E = y && !C ? [] : T.map(getChildKey), D = useRef(!0), O = useRef(T), k = useConstant(() => /* @__PURE__ */ new Map()), A = useRef(/* @__PURE__ */ new Set()), [j, M] = useState(T), [N, P] = useState(T);
|
|
12
|
-
useIsomorphicLayoutEffect(() => {
|
|
13
|
-
D.current = !1, O.current = T;
|
|
14
|
-
for (let e = 0; e < N.length; e++) {
|
|
15
|
-
let u = getChildKey(N[e]);
|
|
16
|
-
E.includes(u) ? (k.delete(u), A.current.delete(u)) : k.get(u) !== !0 && k.set(u, !1);
|
|
17
|
-
}
|
|
18
|
-
}, [
|
|
19
|
-
N,
|
|
20
|
-
E.length,
|
|
21
|
-
E.join("-")
|
|
22
|
-
]);
|
|
23
|
-
let F = [];
|
|
24
|
-
if (T !== j) {
|
|
25
|
-
let e = [...T];
|
|
26
|
-
for (let u = 0; u < N.length; u++) {
|
|
27
|
-
let d = N[u], f = getChildKey(d);
|
|
28
|
-
E.includes(f) || (e.splice(u, 0, d), F.push(d));
|
|
29
|
-
}
|
|
30
|
-
return v === "wait" && F.length && (e = F), P(onlyElements(e)), M(T), null;
|
|
31
|
-
}
|
|
32
|
-
process.env.NODE_ENV !== "production" && v === "wait" && N.length > 1 && console.warn("You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.");
|
|
33
|
-
let { forceRender: I } = useContext(LayoutGroupContext);
|
|
34
|
-
return jsx(Fragment$1, { children: N.map((e) => {
|
|
35
|
-
let u = getChildKey(e), d = y && !C ? !1 : T === N || E.includes(u);
|
|
36
|
-
return jsx(PresenceChild, {
|
|
37
|
-
isPresent: d,
|
|
38
|
-
initial: !D.current || h ? void 0 : !1,
|
|
39
|
-
custom: m,
|
|
40
|
-
presenceAffectsLayout: _,
|
|
41
|
-
mode: v,
|
|
42
|
-
root: S,
|
|
43
|
-
onExitComplete: d ? void 0 : () => {
|
|
44
|
-
if (A.current.has(u)) return;
|
|
45
|
-
if (k.has(u)) A.current.add(u), k.set(u, !0);
|
|
46
|
-
else return;
|
|
47
|
-
let e = !0;
|
|
48
|
-
k.forEach((u) => {
|
|
49
|
-
u || (e = !1);
|
|
50
|
-
}), e && (I?.(), P(O.current), y && w?.(), g && g());
|
|
51
|
-
},
|
|
52
|
-
anchorX: b,
|
|
53
|
-
anchorY: x,
|
|
54
|
-
children: e
|
|
55
|
-
}, u);
|
|
56
|
-
}) });
|
|
57
|
-
};
|
|
58
|
-
export { AnimatePresence };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { PresenceContext } from "../../context/PresenceContext.js";
|
|
3
|
-
import { useCallback, useContext, useEffect, useId } from "react";
|
|
4
|
-
function usePresence(a = !0) {
|
|
5
|
-
let o = useContext(PresenceContext);
|
|
6
|
-
if (o === null) return [!0, null];
|
|
7
|
-
let { isPresent: s, onExitComplete: c, register: l } = o, u = useId();
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (a) return l(u);
|
|
10
|
-
}, [a]);
|
|
11
|
-
let d = useCallback(() => a && c && c(u), [
|
|
12
|
-
u,
|
|
13
|
-
c,
|
|
14
|
-
a
|
|
15
|
-
]);
|
|
16
|
-
return !s && c ? [!1, d] : [!0];
|
|
17
|
-
}
|
|
18
|
-
export { usePresence };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { MotionContext } from "./index.js";
|
|
3
|
-
import { getCurrentTreeVariants } from "./utils.js";
|
|
4
|
-
import { useContext, useMemo } from "react";
|
|
5
|
-
function useCreateMotionContext(a) {
|
|
6
|
-
let { initial: o, animate: s } = getCurrentTreeVariants(a, useContext(MotionContext));
|
|
7
|
-
return useMemo(() => ({
|
|
8
|
-
initial: o,
|
|
9
|
-
animate: s
|
|
10
|
-
}), [variantLabelsAsDependency(o), variantLabelsAsDependency(s)]);
|
|
11
|
-
}
|
|
12
|
-
function variantLabelsAsDependency(e) {
|
|
13
|
-
return Array.isArray(e) ? e.join(" ") : e;
|
|
14
|
-
}
|
|
15
|
-
export { useCreateMotionContext };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isVariantLabel } from "../../../../../motion-dom/dist/es/render/utils/is-variant-label.js";
|
|
2
|
-
import { isControllingVariants } from "../../../../../motion-dom/dist/es/render/utils/is-controlling-variants.js";
|
|
3
|
-
function getCurrentTreeVariants(n, r) {
|
|
4
|
-
if (isControllingVariants(n)) {
|
|
5
|
-
let { initial: t, animate: r } = n;
|
|
6
|
-
return {
|
|
7
|
-
initial: t === !1 || isVariantLabel(t) ? t : void 0,
|
|
8
|
-
animate: isVariantLabel(r) ? r : void 0
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
return n.inherit === !1 ? {} : r;
|
|
12
|
-
}
|
|
13
|
-
export { getCurrentTreeVariants };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { isPrimaryPointer } from "../../../../motion-dom/dist/es/gestures/utils/is-primary-pointer.js";
|
|
2
|
-
function extractEventInfo(e) {
|
|
3
|
-
return { point: {
|
|
4
|
-
x: e.pageX,
|
|
5
|
-
y: e.pageY
|
|
6
|
-
} };
|
|
7
|
-
}
|
|
8
|
-
var addPointerInfo = (n) => (r) => isPrimaryPointer(r) && n(r, extractEventInfo(r));
|
|
9
|
-
export { addPointerInfo, extractEventInfo };
|