@code0-tech/pictor 1.0.0 → 1.1.1
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 +9 -0
- package/dist/assets/Alert.style.css +1 -0
- package/dist/assets/Aurora.style.css +1 -0
- package/dist/assets/Avatar.style.css +1 -0
- package/dist/assets/Badge.style.css +1 -0
- package/dist/assets/Breadcrumb.style.css +1 -0
- package/dist/assets/Button.style.css +1 -0
- package/dist/assets/ButtonGroup.style.css +1 -0
- package/dist/assets/Card.style.css +1 -0
- package/dist/assets/Chart.style.css +1 -0
- package/dist/assets/Col.style.css +1 -0
- package/dist/assets/ColorInput.style.css +1 -0
- package/dist/assets/Command.style.css +1 -0
- package/dist/assets/Container.style.css +1 -0
- package/dist/assets/ContextMenu.style.css +1 -0
- package/dist/assets/DataTable.style.css +1 -0
- package/dist/assets/DateInput.style.css +1 -0
- package/dist/assets/Dialog.style.css +1 -0
- package/dist/assets/Editor.styles.css +1 -0
- package/dist/assets/EditorInput.style.css +1 -0
- package/dist/assets/FileInput.style.css +1 -0
- package/dist/assets/FileTabs.style.css +1 -0
- package/dist/assets/FullScreen.style.css +1 -0
- package/dist/assets/Gantt.style.css +1 -0
- package/dist/assets/Icon.style.css +1 -0
- package/dist/assets/Input.style.css +1 -0
- package/dist/assets/InputWrapper.style.css +1 -0
- package/dist/assets/JsonView.style.css +1 -0
- package/dist/assets/Layout.style.css +1 -0
- package/dist/assets/Menu.style.css +1 -0
- package/dist/assets/Progress.style.css +1 -0
- package/dist/assets/Quote.style.css +1 -0
- package/dist/assets/Resizable.style.css +1 -0
- package/dist/assets/Row.style.css +1 -0
- package/dist/assets/ScrollArea.style.css +1 -0
- package/dist/assets/SegmentedControl.style.css +1 -0
- package/dist/assets/SelectInput.style.css +1 -0
- package/dist/assets/Tab.style.css +1 -0
- package/dist/assets/Text.style.css +1 -0
- package/dist/assets/Toast.style.css +1 -0
- package/dist/assets/Tooltip.style.css +1 -0
- package/dist/components/alert/Alert.js +33 -41
- package/dist/components/aurora/Aurora.js +26 -22
- package/dist/components/avatar/Avatar.js +57 -55
- package/dist/components/badge/Badge.js +57 -64
- package/dist/components/breadcrumb/Breadcrumb.js +16 -21
- package/dist/components/button/Button.js +23 -31
- package/dist/components/button-group/ButtonGroup.js +28 -31
- package/dist/components/card/Card.js +28 -43
- package/dist/components/card/CardSection.js +21 -29
- package/dist/components/chart/Chart.js +138 -153
- package/dist/components/chart/LineChart.js +74 -74
- package/dist/components/chart/index.js +3 -8
- package/dist/components/col/Col.js +18 -29
- package/dist/components/command/Command.js +100 -134
- package/dist/components/container/Container.js +18 -23
- package/dist/components/context-menu/ContextMenu.js +118 -112
- package/dist/components/data-table/DataTable.js +53 -64
- package/dist/components/data-table/DataTableColumn.js +17 -22
- package/dist/components/data-table/DataTableFilterInput.js +208 -205
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +58 -48
- package/dist/components/data-table/DataTableHeader.js +33 -38
- package/dist/components/data-table/DataTablePagination.js +61 -74
- package/dist/components/data-table/index.js +7 -22
- package/dist/components/dialog/Dialog.js +106 -97
- package/dist/components/editor/Editor.js +352 -323
- package/dist/components/file-tabs/FileTabs.js +77 -73
- package/dist/components/file-tabs/FileTabs.service.js +85 -87
- package/dist/components/file-tabs/FileTabs.view.js +0 -1
- package/dist/components/file-tabs/index.js +3 -9
- package/dist/components/flex/Flex.js +18 -23
- package/dist/components/form/CheckboxInput.js +72 -76
- package/dist/components/form/ColorInput.js +378 -353
- package/dist/components/form/DateInput.js +315 -265
- package/dist/components/form/EditorInput.js +597 -579
- package/dist/components/form/EmailInput.js +30 -23
- package/dist/components/form/FileInput.js +92 -123
- package/dist/components/form/Input.js +64 -58
- package/dist/components/form/Input.utils.js +25 -37
- package/dist/components/form/InputDescription.js +10 -11
- package/dist/components/form/InputLabel.js +17 -22
- package/dist/components/form/InputMessage.js +16 -17
- package/dist/components/form/InputWrapper.js +55 -65
- package/dist/components/form/NumberInput.js +41 -20
- package/dist/components/form/PasswordInput.js +71 -54
- package/dist/components/form/PinInput.js +49 -65
- package/dist/components/form/RadioGroup.js +41 -50
- package/dist/components/form/RadioInput.js +30 -29
- package/dist/components/form/SelectInput.js +68 -92
- package/dist/components/form/SwitchInput.js +17 -18
- package/dist/components/form/TagInput.js +108 -122
- package/dist/components/form/TextAreaInput.js +24 -21
- package/dist/components/form/TextInput.js +30 -22
- package/dist/components/form/index.js +22 -87
- package/dist/components/form/useForm.js +87 -88
- package/dist/components/fullscreen/FullScreen.js +27 -27
- package/dist/components/gantt/Gantt.js +99 -98
- package/dist/components/gantt/GanttGroup.js +210 -195
- package/dist/components/gantt/GanttHeader.js +78 -81
- package/dist/components/gantt/GanttItem.js +18 -22
- package/dist/components/icon/Icon.d.ts +6 -4
- package/dist/components/icon/Icon.js +53 -42
- package/dist/components/icon/codezero/codezero.js +10 -0
- package/dist/components/icon/codezero/gls.js +9 -0
- package/dist/components/icon/codezero/index.js +17 -13
- package/dist/components/json-view/JsonView.js +119 -109
- package/dist/components/layout/Layout.js +100 -78
- package/dist/components/menu/Menu.js +134 -128
- package/dist/components/progress/ProgressCircle.js +60 -49
- package/dist/components/progress/ProgressLinear.js +39 -43
- package/dist/components/quote/Quote.js +51 -43
- package/dist/components/resizable/Resizable.js +35 -33
- package/dist/components/row/Row.js +18 -23
- package/dist/components/scroll-area/ScrollArea.js +65 -76
- package/dist/components/segmented-control/SegmentedControl.js +46 -50
- package/dist/components/spacing/Spacing.js +15 -23
- package/dist/components/tab/Tab.js +73 -66
- package/dist/components/text/Text.js +18 -25
- package/dist/components/toast/Toast.js +104 -82
- package/dist/components/tooltip/Tooltip.js +65 -55
- package/dist/index.js +76 -272
- package/dist/node_modules/@lezer/common/dist/index.js +778 -143
- package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
- package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
- package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
- package/dist/node_modules/prettier/standalone.js +3444 -2415
- package/dist/utils/arrayService.js +0 -1
- package/dist/utils/color.js +46 -41
- package/dist/utils/component.js +60 -129
- package/dist/utils/contextStore.js +47 -58
- package/dist/utils/index.js +7 -29
- package/dist/utils/motion.js +84 -113
- package/dist/utils/reactiveArrayService.js +80 -76
- package/dist/utils/size.js +14 -26
- package/dist/utils/utils.js +0 -1
- package/dist/utils/view.js +27 -24
- package/dist/vite-env.d.js +0 -1
- package/package.json +28 -23
- package/dist/_virtual/compiler-runtime.js +0 -5
- package/dist/_virtual/compiler-runtime2.js +0 -4
- package/dist/_virtual/react-compiler-runtime.development.js +0 -4
- package/dist/_virtual/react-compiler-runtime.production.js +0 -4
- package/dist/assets/components/alert/Alert.style.css +0 -1
- package/dist/assets/components/aurora/Aurora.style.css +0 -1
- package/dist/assets/components/avatar/Avatar.style.css +0 -1
- package/dist/assets/components/badge/Badge.style.css +0 -1
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
- package/dist/assets/components/button/Button.style.css +0 -1
- package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
- package/dist/assets/components/card/Card.style.css +0 -1
- package/dist/assets/components/chart/Chart.style.css +0 -1
- package/dist/assets/components/col/Col.style.css +0 -1
- package/dist/assets/components/command/Command.style.css +0 -1
- package/dist/assets/components/container/Container.style.css +0 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
- package/dist/assets/components/data-table/DataTable.style.css +0 -1
- package/dist/assets/components/dialog/Dialog.style.css +0 -1
- package/dist/assets/components/editor/Editor.styles.css +0 -1
- package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
- package/dist/assets/components/form/ColorInput.style.css +0 -1
- package/dist/assets/components/form/DateInput.style.css +0 -1
- package/dist/assets/components/form/EditorInput.style.css +0 -1
- package/dist/assets/components/form/FileInput.style.css +0 -1
- package/dist/assets/components/form/Input.style.css +0 -1
- package/dist/assets/components/form/InputWrapper.style.css +0 -1
- package/dist/assets/components/form/SelectInput.style.css +0 -1
- package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
- package/dist/assets/components/gantt/Gantt.style.css +0 -1
- package/dist/assets/components/icon/Icon.style.css +0 -1
- package/dist/assets/components/json-view/JsonView.style.css +0 -1
- package/dist/assets/components/layout/Layout.style.css +0 -1
- package/dist/assets/components/menu/Menu.style.css +0 -1
- package/dist/assets/components/progress/Progress.style.css +0 -1
- package/dist/assets/components/quote/Quote.style.css +0 -1
- package/dist/assets/components/resizable/Resizable.style.css +0 -1
- package/dist/assets/components/row/Row.style.css +0 -1
- package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
- package/dist/assets/components/tab/Tab.style.css +0 -1
- package/dist/assets/components/text/Text.style.css +0 -1
- package/dist/assets/components/toast/Toast.style.css +0 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
- package/dist/components/icon/codezero/codezero.svg.js +0 -5
- package/dist/components/icon/codezero/gls.svg.js +0 -5
- 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 -34
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -47
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -285
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -67
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -130
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -43
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -29
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -39
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -60
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -62
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -65
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -52
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -39
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -16
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -27
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -30
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -112
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -144
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -106
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +0 -178
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -46
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -59
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -68
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -74
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -7
- 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 -37
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -33
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -43
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -38
- 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 -18
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -32
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -53
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -618
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -53
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -263
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -65
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -6
- 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 -29
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -40
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -32
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -143
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +0 -39
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -42
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -51
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -212
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -18
- 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 -51
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -70
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/array.js +0 -11
- package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -9
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -19
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -32
- package/dist/node_modules/motion-utils/dist/es/errors.js +0 -14
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/memo.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/progress.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -29
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -8
- 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 -14
- package/dist/node_modules/react/compiler-runtime.js +0 -10
- /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
- /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
|
@@ -1,587 +1,605 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "
|
|
9
|
-
import {
|
|
10
|
-
import "
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
o.push(g), i = l.end;
|
|
47
|
-
}), i < r.length && o.push({
|
|
48
|
-
text: r.slice(i)
|
|
49
|
-
}), (!o.length || re(o[0])) && o.unshift({
|
|
50
|
-
text: ""
|
|
51
|
-
}), re(o[o.length - 1]) && o.push({
|
|
52
|
-
text: ""
|
|
53
|
-
}), o;
|
|
54
|
-
}, _e = (r, e) => (r || "").split(`
|
|
55
|
-
`).map((c) => ({
|
|
56
|
-
type: "paragraph",
|
|
57
|
-
children: nt(c, e)
|
|
58
|
-
})), Fe = (r) => be.isText(r) ? r.text : re(r) ? r.token : r.children.map(Fe).join(""), Ae = (r) => r.map(Fe).join(`
|
|
59
|
-
`), Le = oe.createContext(null), Ce = oe.createContext(null), fe = () => {
|
|
60
|
-
const r = oe.useContext(Le);
|
|
61
|
-
if (!r)
|
|
62
|
-
throw new Error("EditorInput.* components must be used inside <EditorInput>");
|
|
63
|
-
return r;
|
|
64
|
-
}, Tt = (r) => {
|
|
65
|
-
const {
|
|
66
|
-
title: e,
|
|
67
|
-
right: c,
|
|
68
|
-
left: o,
|
|
69
|
-
rightType: i,
|
|
70
|
-
leftType: l,
|
|
71
|
-
description: g,
|
|
72
|
-
wrapperComponent: p,
|
|
73
|
-
tokenRules: a = [],
|
|
74
|
-
onSelect: f,
|
|
75
|
-
search: k,
|
|
76
|
-
formValidation: D,
|
|
77
|
-
onChange: w,
|
|
78
|
-
disabled: T = !1,
|
|
79
|
-
readonly: s = !1,
|
|
80
|
-
singleLine: E = !1,
|
|
81
|
-
placeholder: m,
|
|
82
|
-
value: M,
|
|
83
|
-
initialValue: O,
|
|
84
|
-
defaultValue: G,
|
|
85
|
-
children: _
|
|
86
|
-
} = r, F = String(M ?? O ?? G ?? ""), v = E ? F.replace(/\n/g, " ") : F, d = Ie(() => {
|
|
87
|
-
const t = Ge(Ke(je())), {
|
|
88
|
-
isInline: n,
|
|
89
|
-
isVoid: x
|
|
90
|
-
} = t;
|
|
91
|
-
return t.isInline = (h) => re(h) || n(h), t.isVoid = (h) => re(h) || x(h), t;
|
|
92
|
-
}, []), y = Ie(() => _e(v, a), []), L = q(v), [B, W] = ae(v);
|
|
93
|
-
te(() => {
|
|
94
|
-
if (v === L.current || (L.current = v, W(v), Ae(d.children) === v)) return;
|
|
95
|
-
const t = _e(v, a);
|
|
96
|
-
ye.withoutNormalizing(d, () => {
|
|
97
|
-
le.deselect(d);
|
|
98
|
-
const n = d.children.length;
|
|
99
|
-
le.insertNodes(d, t, {
|
|
100
|
-
at: [0]
|
|
101
|
-
});
|
|
102
|
-
for (let x = 0; x < n; x++) le.removeNodes(d, {
|
|
103
|
-
at: [t.length]
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
try {
|
|
107
|
-
le.select(d, ye.end(d, []));
|
|
108
|
-
} catch {
|
|
109
|
-
}
|
|
110
|
-
}, [v, d, a]);
|
|
111
|
-
const [b, A] = ae(!1), [K, $] = ae("shortcut"), J = q(K);
|
|
112
|
-
J.current = K;
|
|
113
|
-
const se = q(null), Z = q(null), U = q(void 0), H = I(() => {
|
|
114
|
-
const t = Z.current, n = se.current, x = n?.parentElement;
|
|
115
|
-
if (!t || !n || !x) return;
|
|
116
|
-
let h = null;
|
|
117
|
-
try {
|
|
118
|
-
d.selection && (h = ne.toDOMRange(d, d.selection).getBoundingClientRect());
|
|
119
|
-
} catch {
|
|
120
|
-
h = null;
|
|
121
|
-
}
|
|
122
|
-
(!h || !h.width && !h.height && !h.left && !h.top) && (h = n.getBoundingClientRect());
|
|
123
|
-
const me = x.getBoundingClientRect();
|
|
124
|
-
t.style.left = `${h.left - me.left}px`, t.style.top = `${h.top - me.top}px`, t.style.width = "0px", t.style.height = `${h.height || parseFloat(getComputedStyle(n).lineHeight) || 16}px`;
|
|
125
|
-
}, [d]), ee = D?.setValue, u = I((t) => {
|
|
126
|
-
b && H();
|
|
127
|
-
const n = Ae(t);
|
|
128
|
-
n !== L.current && (L.current = n, W(n), ee?.(n), w?.(n));
|
|
129
|
-
}, [b, H, ee, w]), j = I(() => {
|
|
130
|
-
Z.current && (U.current && clearTimeout(U.current), H(), A(!0));
|
|
131
|
-
}, [H]);
|
|
132
|
-
te(() => {
|
|
133
|
-
b && H();
|
|
134
|
-
}, [b, H]);
|
|
135
|
-
const N = I(() => {
|
|
136
|
-
U.current && clearTimeout(U.current), U.current = setTimeout(() => A(!1), 150);
|
|
137
|
-
}, []), P = I(() => {
|
|
138
|
-
U.current && clearTimeout(U.current);
|
|
139
|
-
}, []), C = q(/* @__PURE__ */ new Map()), [V, xe] = ae(null), Q = q(null), R = I((t) => {
|
|
140
|
-
Q.current = t, xe(t);
|
|
141
|
-
}, []), [Se, $e] = ae([]), X = q([]), ce = I((t) => {
|
|
142
|
-
X.current = t, $e(t);
|
|
143
|
-
}, []), Te = I((t, n) => (C.current.set(t, n), () => {
|
|
144
|
-
C.current.delete(t), Q.current === t && R(null);
|
|
145
|
-
}), [R]), ie = I(() => Array.from(C.current.entries()).filter(([, t]) => t.el.current && t.parentId === (X.current[X.current.length - 1] ?? null)).sort((t, n) => t[1].el.current.compareDocumentPosition(n[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([t]) => t), []), Y = I((t) => {
|
|
146
|
-
R(t), t && C.current.get(t)?.el.current?.scrollIntoView({
|
|
147
|
-
block: "nearest"
|
|
148
|
-
});
|
|
149
|
-
}, [R]), De = I(() => {
|
|
150
|
-
const t = ie();
|
|
151
|
-
if (!t.length) return;
|
|
152
|
-
const n = Q.current, x = n === null ? -1 : t.indexOf(n);
|
|
153
|
-
Y(t[Math.min(x + 1, t.length - 1)] ?? t[0]);
|
|
154
|
-
}, [ie, Y]), we = I(() => {
|
|
155
|
-
const t = ie();
|
|
156
|
-
if (!t.length) return;
|
|
157
|
-
const n = Q.current, x = n === null ? t.length : t.indexOf(n);
|
|
158
|
-
Y(t[Math.max(x - 1, 0)] ?? t[t.length - 1]);
|
|
159
|
-
}, [ie, Y]), Oe = I(() => {
|
|
160
|
-
const t = ie();
|
|
161
|
-
t.length && Y(t[0]);
|
|
162
|
-
}, [ie, Y]), pe = I((t, n) => {
|
|
163
|
-
f?.(t, n), J.current !== "focus" && A(!1);
|
|
164
|
-
}, [f]), ke = I(() => {
|
|
165
|
-
const t = Q.current;
|
|
166
|
-
if (!t) return !1;
|
|
167
|
-
const n = C.current.get(t);
|
|
168
|
-
return n ? n.onActivate ? (n.onActivate(), !0) : (setTimeout(() => pe(n.getValue(), n.getData()), 0), !0) : !1;
|
|
169
|
-
}, [pe]), de = q(void 0), z = I(() => {
|
|
170
|
-
de.current && clearTimeout(de.current), de.current = void 0;
|
|
171
|
-
}, []), he = I((t) => {
|
|
172
|
-
if (t === null) return 0;
|
|
173
|
-
const n = X.current.indexOf(t);
|
|
174
|
-
return n < 0 ? -1 : n + 1;
|
|
175
|
-
}, []), ge = I((t, n) => {
|
|
176
|
-
const x = X.current;
|
|
177
|
-
return x.length === n + 1 && x[n] === t;
|
|
178
|
-
}, []), ue = I((t) => {
|
|
179
|
-
z();
|
|
180
|
-
const n = he(C.current.get(t)?.parentId ?? null);
|
|
181
|
-
n < 0 || ge(t, n) || (ce([...X.current.slice(0, n), t]), setTimeout(() => {
|
|
182
|
-
const x = Array.from(C.current.entries()).filter(([, h]) => h.el.current && h.parentId === t).sort((h, me) => h[1].el.current.compareDocumentPosition(me[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([h]) => h);
|
|
183
|
-
x.length && Y(x[0]);
|
|
184
|
-
}, 20));
|
|
185
|
-
}, [z, he, ge, ce, Y]), Me = I((t) => {
|
|
186
|
-
z();
|
|
187
|
-
const n = he(C.current.get(t)?.parentId ?? null);
|
|
188
|
-
if (!(n < 0 || ge(t, n))) {
|
|
189
|
-
if (X.current.length <= n) {
|
|
190
|
-
ue(t);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
de.current = setTimeout(() => ue(t), 60);
|
|
194
|
-
}
|
|
195
|
-
}, [z, he, ge, ue]), Re = I((t) => {
|
|
196
|
-
const n = X.current, x = t === void 0 ? n.length - 1 : n.indexOf(t);
|
|
197
|
-
x < 0 || (ce(n.slice(0, x)), R(n[x]));
|
|
198
|
-
}, [ce, R]), Ee = I(() => {
|
|
199
|
-
const t = Q.current;
|
|
200
|
-
if (!t) return !1;
|
|
201
|
-
const n = C.current.get(t);
|
|
202
|
-
return n?.onActivate ? (n.onActivate(), !0) : !1;
|
|
203
|
-
}, []);
|
|
204
|
-
te(() => {
|
|
205
|
-
b || (z(), R(null), ce([]));
|
|
206
|
-
}, [b, z, R, ce]), te(() => z, [z]);
|
|
207
|
-
const He = Ie(() => ({
|
|
208
|
-
editor: d,
|
|
209
|
-
tokenRules: a,
|
|
210
|
-
singleLine: E,
|
|
211
|
-
disabled: T,
|
|
212
|
-
readonly: s,
|
|
213
|
-
placeholder: m,
|
|
214
|
-
search: k,
|
|
215
|
-
documentText: B,
|
|
216
|
-
open: b,
|
|
217
|
-
setOpen: A,
|
|
218
|
-
openMenu: j,
|
|
219
|
-
menuOpenMode: K,
|
|
220
|
-
setMenuOpenMode: $,
|
|
221
|
-
editorContainerRef: se,
|
|
222
|
-
triggerRef: Z,
|
|
223
|
-
updateTriggerPosition: H,
|
|
224
|
-
scheduleClose: N,
|
|
225
|
-
cancelClose: P,
|
|
226
|
-
registerItem: Te,
|
|
227
|
-
activeId: V,
|
|
228
|
-
setActiveId: R,
|
|
229
|
-
highlightNext: De,
|
|
230
|
-
highlightPrevious: we,
|
|
231
|
-
focusFirst: Oe,
|
|
232
|
-
selectActive: ke,
|
|
233
|
-
select: pe,
|
|
234
|
-
openSubPath: Se,
|
|
235
|
-
enterSub: ue,
|
|
236
|
-
exitSub: Re,
|
|
237
|
-
hoverSub: Me,
|
|
238
|
-
cancelHoverSub: z,
|
|
239
|
-
openActiveSub: Ee
|
|
240
|
-
}), [d, a, E, T, s, m, k, B, b, j, K, H, N, P, Te, V, R, De, we, Oe, ke, pe, Se, ue, Re, Me, z, Ee]);
|
|
241
|
-
return /* @__PURE__ */ S(Ue, { editor: d, initialValue: y, onChange: u, children: /* @__PURE__ */ S(Le.Provider, { value: He, children: /* @__PURE__ */ S(ze, { open: b, modal: !1, onOpenChange: (t) => !t && A(!1), children: /* @__PURE__ */ S(qe, { title: e, description: g, right: c, left: o, rightType: i, leftType: l, formValidation: D, ...p ?? {}, style: {
|
|
242
|
-
position: "relative",
|
|
243
|
-
...p?.style
|
|
244
|
-
}, children: _ }) }) }) });
|
|
245
|
-
}, Dt = (r) => {
|
|
246
|
-
const e = ve.c(44), {
|
|
247
|
-
editor: c,
|
|
248
|
-
tokenRules: o,
|
|
249
|
-
singleLine: i,
|
|
250
|
-
disabled: l,
|
|
251
|
-
readonly: g,
|
|
252
|
-
placeholder: p,
|
|
253
|
-
open: a,
|
|
254
|
-
openMenu: f,
|
|
255
|
-
setOpen: k,
|
|
256
|
-
menuOpenMode: D,
|
|
257
|
-
editorContainerRef: w,
|
|
258
|
-
scheduleClose: T,
|
|
259
|
-
cancelClose: s,
|
|
260
|
-
highlightNext: E,
|
|
261
|
-
highlightPrevious: m,
|
|
262
|
-
focusFirst: M,
|
|
263
|
-
selectActive: O,
|
|
264
|
-
openSubPath: G,
|
|
265
|
-
exitSub: _,
|
|
266
|
-
openActiveSub: F
|
|
267
|
-
} = fe();
|
|
268
|
-
let v;
|
|
269
|
-
e[0] !== s || e[1] !== D || e[2] !== f ? (v = () => {
|
|
270
|
-
s(), D === "focus" && f();
|
|
271
|
-
}, e[0] = s, e[1] = D, e[2] = f, e[3] = v) : v = e[3];
|
|
272
|
-
const d = v;
|
|
273
|
-
let y;
|
|
274
|
-
e[4] !== o ? (y = (u) => {
|
|
275
|
-
const [j, N] = u, P = [];
|
|
276
|
-
if (!be.isText(j) || !o.length)
|
|
277
|
-
return P;
|
|
278
|
-
const {
|
|
279
|
-
text: C
|
|
280
|
-
} = j;
|
|
281
|
-
return o.forEach((V, xe) => {
|
|
282
|
-
if (V.void)
|
|
283
|
-
return;
|
|
284
|
-
const Q = new RegExp(V.pattern.source, V.pattern.flags.includes("g") ? V.pattern.flags : V.pattern.flags + "g");
|
|
285
|
-
let R;
|
|
286
|
-
for (; (R = Q.exec(C)) !== null && R[0].length; )
|
|
287
|
-
P.push({
|
|
288
|
-
anchor: {
|
|
289
|
-
path: N,
|
|
290
|
-
offset: R.index
|
|
291
|
-
},
|
|
292
|
-
focus: {
|
|
293
|
-
path: N,
|
|
294
|
-
offset: R.index + R[0].length
|
|
295
|
-
},
|
|
296
|
-
tokenRuleIndex: xe,
|
|
297
|
-
tokenText: R[0],
|
|
298
|
-
tokenMatch: R
|
|
299
|
-
});
|
|
300
|
-
}), P;
|
|
301
|
-
}, e[4] = o, e[5] = y) : y = e[5];
|
|
302
|
-
const L = y;
|
|
303
|
-
let B;
|
|
304
|
-
e[6] !== o ? (B = (u) => {
|
|
305
|
-
const {
|
|
306
|
-
attributes: j,
|
|
307
|
-
children: N,
|
|
308
|
-
leaf: P
|
|
309
|
-
} = u, C = P;
|
|
310
|
-
if (C.tokenRuleIndex !== void 0) {
|
|
311
|
-
const V = o[C.tokenRuleIndex];
|
|
312
|
-
if (V)
|
|
313
|
-
return V.wrap ? /* @__PURE__ */ S("span", { ...j, children: V.wrap(C.tokenText ?? "", N, C.tokenMatch ?? []) }) : /* @__PURE__ */ S("span", { ...j, children: /* @__PURE__ */ S("span", { style: V.style, className: V.className, children: N }) });
|
|
314
|
-
}
|
|
315
|
-
return /* @__PURE__ */ S("span", { ...j, children: N });
|
|
316
|
-
}, e[6] = o, e[7] = B) : B = e[7];
|
|
317
|
-
const W = B;
|
|
318
|
-
let b;
|
|
319
|
-
e[8] !== o ? (b = (u) => {
|
|
320
|
-
const {
|
|
321
|
-
attributes: j,
|
|
322
|
-
children: N,
|
|
323
|
-
element: P
|
|
324
|
-
} = u;
|
|
325
|
-
if (re(P)) {
|
|
326
|
-
const C = o[P.ruleIndex], V = C?.wrap ? C.wrap(P.token, null, P.match ?? []) : /* @__PURE__ */ S("span", { style: C?.style, className: C?.className, children: P.token });
|
|
327
|
-
return /* @__PURE__ */ Ne("span", { ...j, children: [
|
|
328
|
-
/* @__PURE__ */ S("span", { contentEditable: !1, className: "editor-input__token", style: {
|
|
329
|
-
userSelect: "none"
|
|
330
|
-
}, children: V }),
|
|
331
|
-
N
|
|
332
|
-
] });
|
|
333
|
-
}
|
|
334
|
-
return /* @__PURE__ */ S("div", { ...j, style: {
|
|
335
|
-
position: "relative"
|
|
336
|
-
}, children: N });
|
|
337
|
-
}, e[8] = o, e[9] = b) : b = e[9];
|
|
338
|
-
const A = b;
|
|
339
|
-
let K;
|
|
340
|
-
e[10] !== c || e[11] !== _ || e[12] !== M || e[13] !== E || e[14] !== m || e[15] !== a || e[16] !== F || e[17] !== f || e[18] !== G || e[19] !== O || e[20] !== k || e[21] !== i || e[22] !== o ? (K = (u) => {
|
|
341
|
-
if (i && u.key === "Enter" && u.preventDefault(), u.ctrlKey && u.code === "Space") {
|
|
342
|
-
u.preventDefault(), a ? M() : f();
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (a) {
|
|
346
|
-
if (u.key === "ArrowDown") {
|
|
347
|
-
u.preventDefault(), E();
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
if (u.key === "ArrowUp") {
|
|
351
|
-
u.preventDefault(), m();
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
if (u.key === "ArrowRight" && F()) {
|
|
355
|
-
u.preventDefault();
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
if (u.key === "ArrowLeft" && G.length > 0) {
|
|
359
|
-
u.preventDefault(), _();
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
if (u.key === "Enter") {
|
|
363
|
-
O() && u.preventDefault();
|
|
364
|
-
return;
|
|
365
|
-
}
|
|
366
|
-
if (u.key === "Escape") {
|
|
367
|
-
u.preventDefault(), G.length > 0 ? _() : k(!1);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if ((u.key === "ArrowLeft" || u.key === "ArrowRight") && !u.shiftKey && o.some(rt) && c.selection && Pe.isCollapsed(c.selection)) {
|
|
372
|
-
u.preventDefault();
|
|
373
|
-
const j = u.key === "ArrowLeft";
|
|
374
|
-
le.move(c, {
|
|
375
|
-
unit: "offset",
|
|
376
|
-
reverse: j
|
|
377
|
-
});
|
|
378
|
-
const N = c.selection;
|
|
379
|
-
if (N && Pe.isCollapsed(N)) {
|
|
380
|
-
const P = Be.parent(c, N.anchor.path);
|
|
381
|
-
!be.isText(P) && ye.isVoid(c, P) && le.move(c, {
|
|
382
|
-
unit: "offset",
|
|
383
|
-
reverse: j
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}, e[10] = c, e[11] = _, e[12] = M, e[13] = E, e[14] = m, e[15] = a, e[16] = F, e[17] = f, e[18] = G, e[19] = O, e[20] = k, e[21] = i, e[22] = o, e[23] = K) : K = e[23];
|
|
388
|
-
const $ = K;
|
|
389
|
-
let J;
|
|
390
|
-
e[24] !== r ? (J = Ve("editor-input", r), e[24] = r, e[25] = J) : J = e[25];
|
|
391
|
-
const se = i ? "input-wrapper__control input-wrapper__control--single-line" : "input-wrapper__control", Z = l || g;
|
|
392
|
-
let U;
|
|
393
|
-
e[26] !== c || e[27] !== i ? (U = i ? (u) => {
|
|
394
|
-
u.preventDefault(), c.insertText(u.clipboardData.getData("text/plain").replace(/\r?\n/g, " "));
|
|
395
|
-
} : void 0, e[26] = c, e[27] = i, e[28] = U) : U = e[28];
|
|
396
|
-
let H;
|
|
397
|
-
e[29] !== L || e[30] !== d || e[31] !== $ || e[32] !== p || e[33] !== A || e[34] !== W || e[35] !== T || e[36] !== se || e[37] !== Z || e[38] !== U ? (H = /* @__PURE__ */ S(We, { className: se, decorate: L, renderLeaf: W, renderElement: A, readOnly: Z, spellCheck: !1, placeholder: p, onBlur: T, onFocus: d, onKeyDown: $, onPaste: U }), e[29] = L, e[30] = d, e[31] = $, e[32] = p, e[33] = A, e[34] = W, e[35] = T, e[36] = se, e[37] = Z, e[38] = U, e[39] = H) : H = e[39];
|
|
398
|
-
let ee;
|
|
399
|
-
return e[40] !== w || e[41] !== J || e[42] !== H ? (ee = /* @__PURE__ */ S("div", { ...J, ref: w, children: H }), e[40] = w, e[41] = J, e[42] = H, e[43] = ee) : ee = e[43], ee;
|
|
400
|
-
}, wt = (r) => {
|
|
401
|
-
const e = ve.c(5), {
|
|
402
|
-
triggerRef: c
|
|
403
|
-
} = fe();
|
|
404
|
-
let o;
|
|
405
|
-
e[0] !== r ? (o = Ve("editor-input__menu-anchor", r), e[0] = r, e[1] = o) : o = e[1];
|
|
406
|
-
let i;
|
|
407
|
-
return e[2] !== o || e[3] !== c ? (i = /* @__PURE__ */ S(Ze, { asChild: !0, children: /* @__PURE__ */ S("button", { ref: c, type: "button", tabIndex: -1, "aria-hidden": !0, onMouseDown: ot, ...o }) }), e[2] = o, e[3] = c, e[4] = i) : i = e[4], i;
|
|
408
|
-
}, Ot = (r) => {
|
|
409
|
-
const e = ve.c(21), {
|
|
410
|
-
editor: c,
|
|
411
|
-
editorContainerRef: o,
|
|
412
|
-
setMenuOpenMode: i
|
|
413
|
-
} = fe();
|
|
414
|
-
let l, g, p;
|
|
415
|
-
e[0] !== r ? ({
|
|
416
|
-
children: l,
|
|
417
|
-
openOn: p,
|
|
418
|
-
...g
|
|
419
|
-
} = r, e[0] = r, e[1] = l, e[2] = g, e[3] = p) : (l = e[1], g = e[2], p = e[3]);
|
|
420
|
-
const a = p === void 0 ? "shortcut" : p;
|
|
421
|
-
let f, k;
|
|
422
|
-
e[4] !== a || e[5] !== i ? (f = () => i(a), k = [a, i], e[4] = a, e[5] = i, e[6] = f, e[7] = k) : (f = e[6], k = e[7]), te(f, k);
|
|
423
|
-
let D, w;
|
|
424
|
-
e[8] !== c ? (D = (M) => {
|
|
425
|
-
M.preventDefault(), ne.focus(c);
|
|
426
|
-
}, w = () => ne.focus(c), e[8] = c, e[9] = D, e[10] = w) : (D = e[9], w = e[10]);
|
|
427
|
-
let T;
|
|
428
|
-
e[11] !== o ? (T = (M) => {
|
|
429
|
-
const O = M.target;
|
|
430
|
-
O && o.current?.contains(O) && M.preventDefault();
|
|
431
|
-
}, e[11] = o, e[12] = T) : T = e[12];
|
|
432
|
-
let s;
|
|
433
|
-
e[13] !== g || e[14] !== D || e[15] !== w || e[16] !== T ? (s = {
|
|
434
|
-
color: "primary",
|
|
435
|
-
align: "start",
|
|
436
|
-
sideOffset: 8,
|
|
437
|
-
onContextMenuCapture: st,
|
|
438
|
-
onCloseAutoFocus: ct,
|
|
439
|
-
onOpenAutoFocus: D,
|
|
440
|
-
onFocusCapture: w,
|
|
441
|
-
onInteractOutside: T,
|
|
442
|
-
...g
|
|
443
|
-
}, e[13] = g, e[14] = D, e[15] = w, e[16] = T, e[17] = s) : s = e[17];
|
|
444
|
-
const E = s;
|
|
445
|
-
let m;
|
|
446
|
-
return e[18] !== l || e[19] !== E ? (m = /* @__PURE__ */ S(Je, { children: /* @__PURE__ */ S(Qe, { ...E, children: l }) }), e[18] = l, e[19] = E, e[20] = m) : m = e[20], m;
|
|
447
|
-
}, kt = (r) => {
|
|
448
|
-
const {
|
|
449
|
-
value: e,
|
|
450
|
-
data: c,
|
|
451
|
-
children: o,
|
|
452
|
-
onlyOnce: i,
|
|
453
|
-
aliases: l,
|
|
454
|
-
...g
|
|
455
|
-
} = r, {
|
|
456
|
-
editor: p,
|
|
457
|
-
registerItem: a,
|
|
458
|
-
activeId: f,
|
|
459
|
-
setActiveId: k,
|
|
460
|
-
select: D,
|
|
461
|
-
search: w,
|
|
462
|
-
documentText: T,
|
|
463
|
-
cancelHoverSub: s
|
|
464
|
-
} = fe(), E = oe.useContext(Ce), m = oe.useId(), M = q(null), O = q({
|
|
465
|
-
value: e,
|
|
466
|
-
data: c
|
|
467
|
-
});
|
|
468
|
-
O.current = {
|
|
469
|
-
value: e,
|
|
470
|
-
data: c
|
|
471
|
-
};
|
|
472
|
-
const G = !!i && T.includes(String(e)), _ = w?.trim().toLowerCase() ?? "", F = !_ || [typeof o == "string" ? o : String(e), ...l ?? []].some((y) => y.toLowerCase().includes(_)), v = G || !F;
|
|
473
|
-
return te(() => {
|
|
474
|
-
if (!v)
|
|
475
|
-
return a(m, {
|
|
476
|
-
getValue: () => O.current.value,
|
|
477
|
-
getData: () => O.current.data,
|
|
478
|
-
el: M,
|
|
479
|
-
parentId: E
|
|
480
|
-
});
|
|
481
|
-
}, [m, a, E, v]), v ? null : /* @__PURE__ */ S(Xe, { ...g, ref: (y) => {
|
|
482
|
-
M.current = y;
|
|
483
|
-
}, textValue: "", "data-focus": f === m || void 0, onPointerDown: (y) => {
|
|
484
|
-
y.preventDefault(), k(m), ne.focus(p);
|
|
485
|
-
}, onPointerMove: (y) => {
|
|
486
|
-
y.preventDefault(), s(), f !== m && k(m);
|
|
487
|
-
}, onSelect: () => setTimeout(() => D(O.current.value, O.current.data), 0), children: o });
|
|
488
|
-
}, Mt = (r) => {
|
|
489
|
-
const e = ve.c(47), {
|
|
490
|
-
label: c,
|
|
491
|
-
children: o
|
|
492
|
-
} = r, {
|
|
493
|
-
editor: i,
|
|
494
|
-
registerItem: l,
|
|
495
|
-
activeId: g,
|
|
496
|
-
setActiveId: p,
|
|
497
|
-
openSubPath: a,
|
|
498
|
-
enterSub: f,
|
|
499
|
-
exitSub: k,
|
|
500
|
-
hoverSub: D,
|
|
501
|
-
cancelHoverSub: w
|
|
502
|
-
} = fe(), T = oe.useContext(Ce), s = oe.useId(), E = q(null);
|
|
503
|
-
let m, M;
|
|
504
|
-
e[0] !== f || e[1] !== s || e[2] !== T || e[3] !== l ? (m = () => l(s, {
|
|
505
|
-
getValue: it,
|
|
506
|
-
getData: lt,
|
|
507
|
-
el: E,
|
|
508
|
-
parentId: T,
|
|
509
|
-
onActivate: () => f(s)
|
|
510
|
-
}), M = [s, l, T, f], e[0] = f, e[1] = s, e[2] = T, e[3] = l, e[4] = m, e[5] = M) : (m = e[4], M = e[5]), te(m, M);
|
|
511
|
-
let O;
|
|
512
|
-
e[6] !== i ? (O = {
|
|
513
|
-
onOpenAutoFocus: ($) => {
|
|
514
|
-
$.preventDefault(), ne.focus(i);
|
|
515
|
-
},
|
|
516
|
-
onFocusCapture: () => ne.focus(i),
|
|
517
|
-
onCloseAutoFocus: ut,
|
|
518
|
-
onFocusOutside: at,
|
|
519
|
-
onInteractOutside: ft
|
|
520
|
-
}, e[6] = i, e[7] = O) : O = e[7];
|
|
521
|
-
const G = O;
|
|
522
|
-
let _;
|
|
523
|
-
e[8] !== s || e[9] !== a ? (_ = a.includes(s), e[8] = s, e[9] = a, e[10] = _) : _ = e[10];
|
|
524
|
-
let F;
|
|
525
|
-
e[11] !== f || e[12] !== k || e[13] !== s ? (F = ($) => $ ? f(s) : k(s), e[11] = f, e[12] = k, e[13] = s, e[14] = F) : F = e[14];
|
|
526
|
-
let v;
|
|
527
|
-
e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = ($) => {
|
|
528
|
-
E.current = $;
|
|
529
|
-
}, e[15] = v) : v = e[15];
|
|
530
|
-
const d = g === s || void 0;
|
|
531
|
-
let y;
|
|
532
|
-
e[16] !== i || e[17] !== f || e[18] !== s || e[19] !== p ? (y = ($) => {
|
|
533
|
-
$.preventDefault(), p(s), f(s), ne.focus(i);
|
|
534
|
-
}, e[16] = i, e[17] = f, e[18] = s, e[19] = p, e[20] = y) : y = e[20];
|
|
535
|
-
let L;
|
|
536
|
-
e[21] !== D || e[22] !== s || e[23] !== p ? (L = () => {
|
|
537
|
-
p(s), D(s);
|
|
538
|
-
}, e[21] = D, e[22] = s, e[23] = p, e[24] = L) : L = e[24];
|
|
539
|
-
let B;
|
|
540
|
-
e[25] !== g || e[26] !== s || e[27] !== p ? (B = ($) => {
|
|
541
|
-
$.preventDefault(), g !== s && p(s);
|
|
542
|
-
}, e[25] = g, e[26] = s, e[27] = p, e[28] = B) : B = e[28];
|
|
543
|
-
let W;
|
|
544
|
-
e[29] !== w || e[30] !== c || e[31] !== B || e[32] !== d || e[33] !== y || e[34] !== L ? (W = /* @__PURE__ */ S(et, { ref: v, "data-focus": d, onPointerDown: y, onPointerEnter: L, onPointerMove: B, onPointerLeave: w, children: c }), e[29] = w, e[30] = c, e[31] = B, e[32] = d, e[33] = y, e[34] = L, e[35] = W) : W = e[35];
|
|
545
|
-
let b;
|
|
546
|
-
e[36] !== o || e[37] !== s ? (b = /* @__PURE__ */ S(Ce.Provider, { value: s, children: o }), e[36] = o, e[37] = s, e[38] = b) : b = e[38];
|
|
547
|
-
let A;
|
|
548
|
-
e[39] !== G || e[40] !== b ? (A = /* @__PURE__ */ S(Ye, { color: "primary", ...G, children: b }), e[39] = G, e[40] = b, e[41] = A) : A = e[41];
|
|
549
|
-
let K;
|
|
550
|
-
return e[42] !== W || e[43] !== A || e[44] !== _ || e[45] !== F ? (K = /* @__PURE__ */ Ne(tt, { open: _, onOpenChange: F, children: [
|
|
551
|
-
W,
|
|
552
|
-
A
|
|
553
|
-
] }), e[42] = W, e[43] = A, e[44] = _, e[45] = F, e[46] = K) : K = e[46], K;
|
|
1
|
+
import { mergeComponentProps } from "../../utils/component.js";
|
|
2
|
+
import "../../utils/index.js";
|
|
3
|
+
import { InputWrapper } from "./InputWrapper.js";
|
|
4
|
+
import { Menu, MenuContent, MenuItem, MenuPortal, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger } from "../menu/Menu.js";
|
|
5
|
+
import '../../assets/EditorInput.style.css';/* empty css */
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Editor, Node as Node$1, Range, Text, Transforms, createEditor } from "slate";
|
|
10
|
+
import { Editable, ReactEditor, Slate, withReact } from "slate-react";
|
|
11
|
+
import { withHistory } from "slate-history";
|
|
12
|
+
var isTokenElement = (e) => e?.type === "token", lineToChildren = (e, t) => {
|
|
13
|
+
let n = [];
|
|
14
|
+
t.forEach((t, r) => {
|
|
15
|
+
if (!t.void) return;
|
|
16
|
+
let i = new RegExp(t.pattern.source, t.pattern.flags.includes("g") ? t.pattern.flags : t.pattern.flags + "g"), a;
|
|
17
|
+
for (; (a = i.exec(e)) !== null && a[0].length;) n.push({
|
|
18
|
+
start: a.index,
|
|
19
|
+
end: a.index + a[0].length,
|
|
20
|
+
ruleIndex: r,
|
|
21
|
+
token: a[0],
|
|
22
|
+
match: a
|
|
23
|
+
});
|
|
24
|
+
}), n.sort((e, t) => e.start - t.start);
|
|
25
|
+
let r = [], i = 0;
|
|
26
|
+
return n.forEach((t) => {
|
|
27
|
+
if (t.start < i) return;
|
|
28
|
+
t.start > i ? r.push({ text: e.slice(i, t.start) }) : r.length && isTokenElement(r[r.length - 1]) && r.push({ text: "" });
|
|
29
|
+
let n = {
|
|
30
|
+
type: "token",
|
|
31
|
+
ruleIndex: t.ruleIndex,
|
|
32
|
+
token: t.token,
|
|
33
|
+
match: t.match,
|
|
34
|
+
children: [{ text: "" }]
|
|
35
|
+
};
|
|
36
|
+
r.push(n), i = t.end;
|
|
37
|
+
}), i < e.length && r.push({ text: e.slice(i) }), (!r.length || isTokenElement(r[0])) && r.unshift({ text: "" }), isTokenElement(r[r.length - 1]) && r.push({ text: "" }), r;
|
|
38
|
+
}, textToSlate = (e, t) => (e || "").split("\n").map((e) => ({
|
|
39
|
+
type: "paragraph",
|
|
40
|
+
children: lineToChildren(e, t)
|
|
41
|
+
})), nodeToString = (e) => Text.isText(e) ? e.text : isTokenElement(e) ? e.token : e.children.map(nodeToString).join(""), slateToText = (e) => e.map(nodeToString).join("\n"), EditorInputContext = React.createContext(null), SubMenuIdContext = React.createContext(null), useEditorInputContext = () => {
|
|
42
|
+
let e = React.useContext(EditorInputContext);
|
|
43
|
+
if (!e) throw Error("EditorInput.* components must be used inside <EditorInput>");
|
|
44
|
+
return e;
|
|
554
45
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
46
|
+
const EditorInput = (e) => {
|
|
47
|
+
let { title: r, right: i, left: a, rightType: o, leftType: s, description: l, wrapperComponent: u, tokenRules: d = [], onSelect: f, search: _, formValidation: y, onChange: b, disabled: x = !1, readonly: w = !1, singleLine: k = !1, placeholder: j, value: re, initialValue: ie, defaultValue: P, children: F } = e, I = String(re ?? ie ?? P ?? ""), L = k ? I.replace(/\n/g, " ") : I, R = useMemo(() => {
|
|
48
|
+
let e = withHistory(withReact(createEditor())), { isInline: t, isVoid: n } = e;
|
|
49
|
+
return e.isInline = (e) => isTokenElement(e) || t(e), e.isVoid = (e) => isTokenElement(e) || n(e), e;
|
|
50
|
+
}, []), ae = useMemo(() => textToSlate(L, d), []), oe = useRef(L), [z, se] = useState(L);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (L === oe.current || (oe.current = L, se(L), slateToText(R.children) === L)) return;
|
|
53
|
+
let e = textToSlate(L, d);
|
|
54
|
+
Editor.withoutNormalizing(R, () => {
|
|
55
|
+
Transforms.deselect(R);
|
|
56
|
+
let t = R.children.length;
|
|
57
|
+
Transforms.insertNodes(R, e, { at: [0] });
|
|
58
|
+
for (let n = 0; n < t; n++) Transforms.removeNodes(R, { at: [e.length] });
|
|
59
|
+
});
|
|
60
|
+
try {
|
|
61
|
+
Transforms.select(R, Editor.end(R, []));
|
|
62
|
+
} catch {}
|
|
63
|
+
}, [
|
|
64
|
+
L,
|
|
65
|
+
R,
|
|
66
|
+
d
|
|
67
|
+
]);
|
|
68
|
+
let [B, V] = useState(!1), [H, ce] = useState("shortcut"), le = useRef(H);
|
|
69
|
+
le.current = H;
|
|
70
|
+
let ue = useRef(null), de = useRef(null), U = useRef(void 0), W = useCallback(() => {
|
|
71
|
+
let e = de.current, t = ue.current, n = t?.parentElement;
|
|
72
|
+
if (!e || !t || !n) return;
|
|
73
|
+
let r = null;
|
|
74
|
+
try {
|
|
75
|
+
R.selection && (r = ReactEditor.toDOMRange(R, R.selection).getBoundingClientRect());
|
|
76
|
+
} catch {
|
|
77
|
+
r = null;
|
|
78
|
+
}
|
|
79
|
+
(!r || !r.width && !r.height && !r.left && !r.top) && (r = t.getBoundingClientRect());
|
|
80
|
+
let i = n.getBoundingClientRect();
|
|
81
|
+
e.style.left = `${r.left - i.left}px`, e.style.top = `${r.top - i.top}px`, e.style.width = "0px", e.style.height = `${r.height || parseFloat(getComputedStyle(t).lineHeight) || 16}px`;
|
|
82
|
+
}, [R]), fe = y?.setValue, pe = useCallback((e) => {
|
|
83
|
+
B && W();
|
|
84
|
+
let t = slateToText(e);
|
|
85
|
+
t !== oe.current && (oe.current = t, se(t), fe?.(t), b?.(t));
|
|
86
|
+
}, [
|
|
87
|
+
B,
|
|
88
|
+
W,
|
|
89
|
+
fe,
|
|
90
|
+
b
|
|
91
|
+
]), me = useCallback(() => {
|
|
92
|
+
de.current && (U.current && clearTimeout(U.current), W(), V(!0));
|
|
93
|
+
}, [W]);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
B && W();
|
|
96
|
+
}, [B, W]);
|
|
97
|
+
let he = useCallback(() => {
|
|
98
|
+
U.current && clearTimeout(U.current), U.current = setTimeout(() => V(!1), 150);
|
|
99
|
+
}, []), ge = useCallback(() => {
|
|
100
|
+
U.current && clearTimeout(U.current);
|
|
101
|
+
}, []), G = useRef(/* @__PURE__ */ new Map()), [_e, ve] = useState(null), K = useRef(null), q = useCallback((e) => {
|
|
102
|
+
K.current = e, ve(e);
|
|
103
|
+
}, []), [ye, be] = useState([]), J = useRef([]), Y = useCallback((e) => {
|
|
104
|
+
J.current = e, be(e);
|
|
105
|
+
}, []), xe = useCallback((e, t) => (G.current.set(e, t), () => {
|
|
106
|
+
G.current.delete(e), K.current === e && q(null);
|
|
107
|
+
}), [q]), X = useCallback(() => Array.from(G.current.entries()).filter(([, e]) => e.el.current && e.parentId === (J.current[J.current.length - 1] ?? null)).sort((e, t) => e[1].el.current.compareDocumentPosition(t[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([e]) => e), []), Z = useCallback((e) => {
|
|
108
|
+
q(e), e && G.current.get(e)?.el.current?.scrollIntoView({ block: "nearest" });
|
|
109
|
+
}, [q]), Se = useCallback(() => {
|
|
110
|
+
let e = X();
|
|
111
|
+
if (!e.length) return;
|
|
112
|
+
let t = K.current, n = t === null ? -1 : e.indexOf(t);
|
|
113
|
+
Z(e[Math.min(n + 1, e.length - 1)] ?? e[0]);
|
|
114
|
+
}, [X, Z]), Ce = useCallback(() => {
|
|
115
|
+
let e = X();
|
|
116
|
+
if (!e.length) return;
|
|
117
|
+
let t = K.current, n = t === null ? e.length : e.indexOf(t);
|
|
118
|
+
Z(e[Math.max(n - 1, 0)] ?? e[e.length - 1]);
|
|
119
|
+
}, [X, Z]), we = useCallback(() => {
|
|
120
|
+
let e = X();
|
|
121
|
+
e.length && Z(e[0]);
|
|
122
|
+
}, [X, Z]), Te = useCallback((e, t) => {
|
|
123
|
+
f?.(e, t), le.current !== "focus" && V(!1);
|
|
124
|
+
}, [f]), Ee = useCallback(() => {
|
|
125
|
+
let e = K.current;
|
|
126
|
+
if (!e) return !1;
|
|
127
|
+
let t = G.current.get(e);
|
|
128
|
+
return t ? t.onActivate ? (t.onActivate(), !0) : (setTimeout(() => Te(t.getValue(), t.getData()), 0), !0) : !1;
|
|
129
|
+
}, [Te]), De = useRef(void 0), Q = useCallback(() => {
|
|
130
|
+
De.current && clearTimeout(De.current), De.current = void 0;
|
|
131
|
+
}, []), Oe = useCallback((e) => {
|
|
132
|
+
if (e === null) return 0;
|
|
133
|
+
let t = J.current.indexOf(e);
|
|
134
|
+
return t < 0 ? -1 : t + 1;
|
|
135
|
+
}, []), ke = useCallback((e, t) => {
|
|
136
|
+
let n = J.current;
|
|
137
|
+
return n.length === t + 1 && n[t] === e;
|
|
138
|
+
}, []), $ = useCallback((e) => {
|
|
139
|
+
Q();
|
|
140
|
+
let t = Oe(G.current.get(e)?.parentId ?? null);
|
|
141
|
+
t < 0 || ke(e, t) || (Y([...J.current.slice(0, t), e]), setTimeout(() => {
|
|
142
|
+
let t = Array.from(G.current.entries()).filter(([, t]) => t.el.current && t.parentId === e).sort((e, t) => e[1].el.current.compareDocumentPosition(t[1].el.current) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1).map(([e]) => e);
|
|
143
|
+
t.length && Z(t[0]);
|
|
144
|
+
}, 20));
|
|
145
|
+
}, [
|
|
146
|
+
Q,
|
|
147
|
+
Oe,
|
|
148
|
+
ke,
|
|
149
|
+
Y,
|
|
150
|
+
Z
|
|
151
|
+
]), Ae = useCallback((e) => {
|
|
152
|
+
Q();
|
|
153
|
+
let t = Oe(G.current.get(e)?.parentId ?? null);
|
|
154
|
+
if (!(t < 0 || ke(e, t))) {
|
|
155
|
+
if (J.current.length <= t) {
|
|
156
|
+
$(e);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
De.current = setTimeout(() => $(e), 60);
|
|
160
|
+
}
|
|
161
|
+
}, [
|
|
162
|
+
Q,
|
|
163
|
+
Oe,
|
|
164
|
+
ke,
|
|
165
|
+
$
|
|
166
|
+
]), je = useCallback((e) => {
|
|
167
|
+
let t = J.current, n = e === void 0 ? t.length - 1 : t.indexOf(e);
|
|
168
|
+
n < 0 || (Y(t.slice(0, n)), q(t[n]));
|
|
169
|
+
}, [Y, q]), Me = useCallback(() => {
|
|
170
|
+
let e = K.current;
|
|
171
|
+
if (!e) return !1;
|
|
172
|
+
let t = G.current.get(e);
|
|
173
|
+
return t?.onActivate ? (t.onActivate(), !0) : !1;
|
|
174
|
+
}, []);
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
B || (Q(), q(null), Y([]));
|
|
177
|
+
}, [
|
|
178
|
+
B,
|
|
179
|
+
Q,
|
|
180
|
+
q,
|
|
181
|
+
Y
|
|
182
|
+
]), useEffect(() => Q, [Q]);
|
|
183
|
+
let Ne = useMemo(() => ({
|
|
184
|
+
editor: R,
|
|
185
|
+
tokenRules: d,
|
|
186
|
+
singleLine: k,
|
|
187
|
+
disabled: x,
|
|
188
|
+
readonly: w,
|
|
189
|
+
placeholder: j,
|
|
190
|
+
search: _,
|
|
191
|
+
documentText: z,
|
|
192
|
+
open: B,
|
|
193
|
+
setOpen: V,
|
|
194
|
+
openMenu: me,
|
|
195
|
+
menuOpenMode: H,
|
|
196
|
+
setMenuOpenMode: ce,
|
|
197
|
+
editorContainerRef: ue,
|
|
198
|
+
triggerRef: de,
|
|
199
|
+
updateTriggerPosition: W,
|
|
200
|
+
scheduleClose: he,
|
|
201
|
+
cancelClose: ge,
|
|
202
|
+
registerItem: xe,
|
|
203
|
+
activeId: _e,
|
|
204
|
+
setActiveId: q,
|
|
205
|
+
highlightNext: Se,
|
|
206
|
+
highlightPrevious: Ce,
|
|
207
|
+
focusFirst: we,
|
|
208
|
+
selectActive: Ee,
|
|
209
|
+
select: Te,
|
|
210
|
+
openSubPath: ye,
|
|
211
|
+
enterSub: $,
|
|
212
|
+
exitSub: je,
|
|
213
|
+
hoverSub: Ae,
|
|
214
|
+
cancelHoverSub: Q,
|
|
215
|
+
openActiveSub: Me
|
|
216
|
+
}), [
|
|
217
|
+
R,
|
|
218
|
+
d,
|
|
219
|
+
k,
|
|
220
|
+
x,
|
|
221
|
+
w,
|
|
222
|
+
j,
|
|
223
|
+
_,
|
|
224
|
+
z,
|
|
225
|
+
B,
|
|
226
|
+
me,
|
|
227
|
+
H,
|
|
228
|
+
W,
|
|
229
|
+
he,
|
|
230
|
+
ge,
|
|
231
|
+
xe,
|
|
232
|
+
_e,
|
|
233
|
+
q,
|
|
234
|
+
Se,
|
|
235
|
+
Ce,
|
|
236
|
+
we,
|
|
237
|
+
Ee,
|
|
238
|
+
Te,
|
|
239
|
+
ye,
|
|
240
|
+
$,
|
|
241
|
+
je,
|
|
242
|
+
Ae,
|
|
243
|
+
Q,
|
|
244
|
+
Me
|
|
245
|
+
]);
|
|
246
|
+
return /* @__PURE__ */ jsx(Slate, {
|
|
247
|
+
editor: R,
|
|
248
|
+
initialValue: ae,
|
|
249
|
+
onChange: pe,
|
|
250
|
+
children: /* @__PURE__ */ jsx(EditorInputContext.Provider, {
|
|
251
|
+
value: Ne,
|
|
252
|
+
children: /* @__PURE__ */ jsx(Menu, {
|
|
253
|
+
open: B,
|
|
254
|
+
modal: !1,
|
|
255
|
+
onOpenChange: (e) => !e && V(!1),
|
|
256
|
+
children: /* @__PURE__ */ jsx(InputWrapper, {
|
|
257
|
+
title: r,
|
|
258
|
+
description: l,
|
|
259
|
+
right: i,
|
|
260
|
+
left: a,
|
|
261
|
+
rightType: o,
|
|
262
|
+
leftType: s,
|
|
263
|
+
formValidation: y,
|
|
264
|
+
...u ?? {},
|
|
265
|
+
style: {
|
|
266
|
+
position: "relative",
|
|
267
|
+
...u?.style
|
|
268
|
+
},
|
|
269
|
+
children: F
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
});
|
|
274
|
+
}, EditorInputValue = (t) => {
|
|
275
|
+
let n = c(44), { editor: r, tokenRules: i, singleLine: a, disabled: o, readonly: s, placeholder: l, open: u, openMenu: f, setOpen: p, menuOpenMode: te, editorContainerRef: m, scheduleClose: h, cancelClose: g, highlightNext: C, highlightPrevious: ne, focusFirst: T, selectActive: E, openSubPath: D, exitSub: k, openActiveSub: A } = useEditorInputContext(), j;
|
|
276
|
+
n[0] !== g || n[1] !== te || n[2] !== f ? (j = () => {
|
|
277
|
+
g(), te === "focus" && f();
|
|
278
|
+
}, n[0] = g, n[1] = te, n[2] = f, n[3] = j) : j = n[3];
|
|
279
|
+
let M = j, N;
|
|
280
|
+
n[4] === i ? N = n[5] : (N = (e) => {
|
|
281
|
+
let [t, n] = e, r = [];
|
|
282
|
+
if (!Text.isText(t) || !i.length) return r;
|
|
283
|
+
let { text: a } = t;
|
|
284
|
+
return i.forEach((e, t) => {
|
|
285
|
+
if (e.void) return;
|
|
286
|
+
let i = new RegExp(e.pattern.source, e.pattern.flags.includes("g") ? e.pattern.flags : e.pattern.flags + "g"), o;
|
|
287
|
+
for (; (o = i.exec(a)) !== null && o[0].length;) r.push({
|
|
288
|
+
anchor: {
|
|
289
|
+
path: n,
|
|
290
|
+
offset: o.index
|
|
291
|
+
},
|
|
292
|
+
focus: {
|
|
293
|
+
path: n,
|
|
294
|
+
offset: o.index + o[0].length
|
|
295
|
+
},
|
|
296
|
+
tokenRuleIndex: t,
|
|
297
|
+
tokenText: o[0],
|
|
298
|
+
tokenMatch: o
|
|
299
|
+
});
|
|
300
|
+
}), r;
|
|
301
|
+
}, n[4] = i, n[5] = N);
|
|
302
|
+
let re = N, P;
|
|
303
|
+
n[6] === i ? P = n[7] : (P = (e) => {
|
|
304
|
+
let { attributes: t, children: n, leaf: r } = e, a = r;
|
|
305
|
+
if (a.tokenRuleIndex !== void 0) {
|
|
306
|
+
let e = i[a.tokenRuleIndex];
|
|
307
|
+
if (e) return e.wrap ? /* @__PURE__ */ jsx("span", {
|
|
308
|
+
...t,
|
|
309
|
+
children: e.wrap(a.tokenText ?? "", n, a.tokenMatch ?? [])
|
|
310
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
311
|
+
...t,
|
|
312
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
313
|
+
style: e.style,
|
|
314
|
+
className: e.className,
|
|
315
|
+
children: n
|
|
316
|
+
})
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
return /* @__PURE__ */ jsx("span", {
|
|
320
|
+
...t,
|
|
321
|
+
children: n
|
|
322
|
+
});
|
|
323
|
+
}, n[6] = i, n[7] = P);
|
|
324
|
+
let F = P, I;
|
|
325
|
+
n[8] === i ? I = n[9] : (I = (e) => {
|
|
326
|
+
let { attributes: t, children: n, element: r } = e;
|
|
327
|
+
if (isTokenElement(r)) {
|
|
328
|
+
let e = i[r.ruleIndex], a = e?.wrap ? e.wrap(r.token, null, r.match ?? []) : /* @__PURE__ */ jsx("span", {
|
|
329
|
+
style: e?.style,
|
|
330
|
+
className: e?.className,
|
|
331
|
+
children: r.token
|
|
332
|
+
});
|
|
333
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
334
|
+
...t,
|
|
335
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
336
|
+
contentEditable: !1,
|
|
337
|
+
className: "editor-input__token",
|
|
338
|
+
style: { userSelect: "none" },
|
|
339
|
+
children: a
|
|
340
|
+
}), n]
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ jsx("div", {
|
|
344
|
+
...t,
|
|
345
|
+
style: { position: "relative" },
|
|
346
|
+
children: n
|
|
347
|
+
});
|
|
348
|
+
}, n[8] = i, n[9] = I);
|
|
349
|
+
let L = I, R;
|
|
350
|
+
n[10] !== r || n[11] !== k || n[12] !== T || n[13] !== C || n[14] !== ne || n[15] !== u || n[16] !== A || n[17] !== f || n[18] !== D || n[19] !== E || n[20] !== p || n[21] !== a || n[22] !== i ? (R = (e) => {
|
|
351
|
+
if (a && e.key === "Enter" && e.preventDefault(), e.ctrlKey && e.code === "Space") {
|
|
352
|
+
e.preventDefault(), u ? T() : f();
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
if (u) {
|
|
356
|
+
if (e.key === "ArrowDown") {
|
|
357
|
+
e.preventDefault(), C();
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (e.key === "ArrowUp") {
|
|
361
|
+
e.preventDefault(), ne();
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
if (e.key === "ArrowRight" && A()) {
|
|
365
|
+
e.preventDefault();
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
if (e.key === "ArrowLeft" && D.length > 0) {
|
|
369
|
+
e.preventDefault(), k();
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (e.key === "Enter") {
|
|
373
|
+
E() && e.preventDefault();
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (e.key === "Escape") {
|
|
377
|
+
e.preventDefault(), D.length > 0 ? k() : p(!1);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if ((e.key === "ArrowLeft" || e.key === "ArrowRight") && !e.shiftKey && i.some(_temp) && r.selection && Range.isCollapsed(r.selection)) {
|
|
382
|
+
e.preventDefault();
|
|
383
|
+
let t = e.key === "ArrowLeft";
|
|
384
|
+
Transforms.move(r, {
|
|
385
|
+
unit: "offset",
|
|
386
|
+
reverse: t
|
|
387
|
+
});
|
|
388
|
+
let n = r.selection;
|
|
389
|
+
if (n && Range.isCollapsed(n)) {
|
|
390
|
+
let e = Node$1.parent(r, n.anchor.path);
|
|
391
|
+
!Text.isText(e) && Editor.isVoid(r, e) && Transforms.move(r, {
|
|
392
|
+
unit: "offset",
|
|
393
|
+
reverse: t
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}, n[10] = r, n[11] = k, n[12] = T, n[13] = C, n[14] = ne, n[15] = u, n[16] = A, n[17] = f, n[18] = D, n[19] = E, n[20] = p, n[21] = a, n[22] = i, n[23] = R) : R = n[23];
|
|
398
|
+
let ae = R, z;
|
|
399
|
+
n[24] === t ? z = n[25] : (z = mergeComponentProps("editor-input", t), n[24] = t, n[25] = z);
|
|
400
|
+
let se = a ? "input-wrapper__control input-wrapper__control--single-line" : "input-wrapper__control", B = o || s, V;
|
|
401
|
+
n[26] !== r || n[27] !== a ? (V = a ? (e) => {
|
|
402
|
+
e.preventDefault(), r.insertText(e.clipboardData.getData("text/plain").replace(/\r?\n/g, " "));
|
|
403
|
+
} : void 0, n[26] = r, n[27] = a, n[28] = V) : V = n[28];
|
|
404
|
+
let H;
|
|
405
|
+
n[29] !== re || n[30] !== M || n[31] !== ae || n[32] !== l || n[33] !== L || n[34] !== F || n[35] !== h || n[36] !== se || n[37] !== B || n[38] !== V ? (H = /* @__PURE__ */ jsx(Editable, {
|
|
406
|
+
className: se,
|
|
407
|
+
decorate: re,
|
|
408
|
+
renderLeaf: F,
|
|
409
|
+
renderElement: L,
|
|
410
|
+
readOnly: B,
|
|
411
|
+
spellCheck: !1,
|
|
412
|
+
placeholder: l,
|
|
413
|
+
onBlur: h,
|
|
414
|
+
onFocus: M,
|
|
415
|
+
onKeyDown: ae,
|
|
416
|
+
onPaste: V
|
|
417
|
+
}), n[29] = re, n[30] = M, n[31] = ae, n[32] = l, n[33] = L, n[34] = F, n[35] = h, n[36] = se, n[37] = B, n[38] = V, n[39] = H) : H = n[39];
|
|
418
|
+
let ce;
|
|
419
|
+
return n[40] !== m || n[41] !== z || n[42] !== H ? (ce = /* @__PURE__ */ jsx("div", {
|
|
420
|
+
...z,
|
|
421
|
+
ref: m,
|
|
422
|
+
children: H
|
|
423
|
+
}), n[40] = m, n[41] = z, n[42] = H, n[43] = ce) : ce = n[43], ce;
|
|
424
|
+
}, EditorInputTrigger = (t) => {
|
|
425
|
+
let n = c(5), { triggerRef: r } = useEditorInputContext(), i;
|
|
426
|
+
n[0] === t ? i = n[1] : (i = mergeComponentProps("editor-input__menu-anchor", t), n[0] = t, n[1] = i);
|
|
427
|
+
let a;
|
|
428
|
+
return n[2] !== i || n[3] !== r ? (a = /* @__PURE__ */ jsx(MenuTrigger, {
|
|
429
|
+
asChild: !0,
|
|
430
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
431
|
+
ref: r,
|
|
432
|
+
type: "button",
|
|
433
|
+
tabIndex: -1,
|
|
434
|
+
"aria-hidden": !0,
|
|
435
|
+
onMouseDown: _temp2,
|
|
436
|
+
...i
|
|
437
|
+
})
|
|
438
|
+
}), n[2] = i, n[3] = r, n[4] = a) : a = n[4], a;
|
|
439
|
+
}, EditorInputMenu = (e) => {
|
|
440
|
+
let t = c(21), { editor: n, editorContainerRef: i, setMenuOpenMode: o } = useEditorInputContext(), s, l, u;
|
|
441
|
+
t[0] === e ? (s = t[1], l = t[2], u = t[3]) : ({children: s, openOn: u, ...l} = e, t[0] = e, t[1] = s, t[2] = l, t[3] = u);
|
|
442
|
+
let f = u === void 0 ? "shortcut" : u, p, m;
|
|
443
|
+
t[4] !== f || t[5] !== o ? (p = () => o(f), m = [f, o], t[4] = f, t[5] = o, t[6] = p, t[7] = m) : (p = t[6], m = t[7]), useEffect(p, m);
|
|
444
|
+
let h, g;
|
|
445
|
+
t[8] === n ? (h = t[9], g = t[10]) : (h = (e) => {
|
|
446
|
+
e.preventDefault(), ReactEditor.focus(n);
|
|
447
|
+
}, g = () => ReactEditor.focus(n), t[8] = n, t[9] = h, t[10] = g);
|
|
448
|
+
let _;
|
|
449
|
+
t[11] === i ? _ = t[12] : (_ = (e) => {
|
|
450
|
+
let t = e.target;
|
|
451
|
+
t && i.current?.contains(t) && e.preventDefault();
|
|
452
|
+
}, t[11] = i, t[12] = _);
|
|
453
|
+
let v;
|
|
454
|
+
t[13] !== l || t[14] !== h || t[15] !== g || t[16] !== _ ? (v = {
|
|
455
|
+
color: "primary",
|
|
456
|
+
align: "start",
|
|
457
|
+
sideOffset: 8,
|
|
458
|
+
onContextMenuCapture: _temp3,
|
|
459
|
+
onCloseAutoFocus: _temp4,
|
|
460
|
+
onOpenAutoFocus: h,
|
|
461
|
+
onFocusCapture: g,
|
|
462
|
+
onInteractOutside: _,
|
|
463
|
+
...l
|
|
464
|
+
}, t[13] = l, t[14] = h, t[15] = g, t[16] = _, t[17] = v) : v = t[17];
|
|
465
|
+
let y = v, b;
|
|
466
|
+
return t[18] !== s || t[19] !== y ? (b = /* @__PURE__ */ jsx(MenuPortal, { children: /* @__PURE__ */ jsx(MenuContent, {
|
|
467
|
+
...y,
|
|
468
|
+
children: s
|
|
469
|
+
}) }), t[18] = s, t[19] = y, t[20] = b) : b = t[20], b;
|
|
470
|
+
}, EditorInputMenuItem = (e) => {
|
|
471
|
+
let { value: t, data: n, children: r, onlyOnce: a, aliases: o, ...s } = e, { editor: l, registerItem: u, activeId: d, setActiveId: p, select: m, search: g, documentText: _, cancelHoverSub: v } = useEditorInputContext(), y = React.useContext(SubMenuIdContext), b = React.useId(), x = useRef(null), S = useRef({
|
|
472
|
+
value: t,
|
|
473
|
+
data: n
|
|
474
|
+
});
|
|
475
|
+
S.current = {
|
|
476
|
+
value: t,
|
|
477
|
+
data: n
|
|
478
|
+
};
|
|
479
|
+
let C = !!a && _.includes(String(t)), w = g?.trim().toLowerCase() ?? "", T = !w || [typeof r == "string" ? r : String(t), ...o ?? []].some((e) => e.toLowerCase().includes(w)), E = C || !T;
|
|
480
|
+
if (useEffect(() => {
|
|
481
|
+
if (!E) return u(b, {
|
|
482
|
+
getValue: () => S.current.value,
|
|
483
|
+
getData: () => S.current.data,
|
|
484
|
+
el: x,
|
|
485
|
+
parentId: y
|
|
486
|
+
});
|
|
487
|
+
}, [
|
|
488
|
+
b,
|
|
489
|
+
u,
|
|
490
|
+
y,
|
|
491
|
+
E
|
|
492
|
+
]), E) return null;
|
|
493
|
+
let D = d === b;
|
|
494
|
+
return /* @__PURE__ */ jsx(MenuItem, {
|
|
495
|
+
...s,
|
|
496
|
+
ref: (e) => {
|
|
497
|
+
x.current = e;
|
|
498
|
+
},
|
|
499
|
+
textValue: "",
|
|
500
|
+
"data-focus": D || void 0,
|
|
501
|
+
onPointerDown: (e) => {
|
|
502
|
+
e.preventDefault(), p(b), ReactEditor.focus(l);
|
|
503
|
+
},
|
|
504
|
+
onPointerMove: (e) => {
|
|
505
|
+
e.preventDefault(), v(), d !== b && p(b);
|
|
506
|
+
},
|
|
507
|
+
onSelect: () => setTimeout(() => m(S.current.value, S.current.data), 0),
|
|
508
|
+
children: r
|
|
509
|
+
});
|
|
510
|
+
}, EditorInputSubMenu = (e) => {
|
|
511
|
+
let t = c(47), { label: n, children: r } = e, { editor: i, registerItem: a, activeId: u, setActiveId: p, openSubPath: m, enterSub: g, exitSub: v, hoverSub: y, cancelHoverSub: b } = useEditorInputContext(), x = React.useContext(SubMenuIdContext), S = React.useId(), C = useRef(null), w, T;
|
|
512
|
+
t[0] !== g || t[1] !== S || t[2] !== x || t[3] !== a ? (w = () => a(S, {
|
|
513
|
+
getValue: _temp5,
|
|
514
|
+
getData: _temp6,
|
|
515
|
+
el: C,
|
|
516
|
+
parentId: x,
|
|
517
|
+
onActivate: () => g(S)
|
|
518
|
+
}), T = [
|
|
519
|
+
S,
|
|
520
|
+
a,
|
|
521
|
+
x,
|
|
522
|
+
g
|
|
523
|
+
], t[0] = g, t[1] = S, t[2] = x, t[3] = a, t[4] = w, t[5] = T) : (w = t[4], T = t[5]), useEffect(w, T);
|
|
524
|
+
let E;
|
|
525
|
+
t[6] === i ? E = t[7] : (E = {
|
|
526
|
+
onOpenAutoFocus: (e) => {
|
|
527
|
+
e.preventDefault(), ReactEditor.focus(i);
|
|
528
|
+
},
|
|
529
|
+
onFocusCapture: () => ReactEditor.focus(i),
|
|
530
|
+
onCloseAutoFocus: _temp7,
|
|
531
|
+
onFocusOutside: _temp8,
|
|
532
|
+
onInteractOutside: _temp9
|
|
533
|
+
}, t[6] = i, t[7] = E);
|
|
534
|
+
let D = E, O;
|
|
535
|
+
t[8] !== S || t[9] !== m ? (O = m.includes(S), t[8] = S, t[9] = m, t[10] = O) : O = t[10];
|
|
536
|
+
let k;
|
|
537
|
+
t[11] !== g || t[12] !== v || t[13] !== S ? (k = (e) => e ? g(S) : v(S), t[11] = g, t[12] = v, t[13] = S, t[14] = k) : k = t[14];
|
|
538
|
+
let A;
|
|
539
|
+
t[15] === Symbol.for("react.memo_cache_sentinel") ? (A = (e) => {
|
|
540
|
+
C.current = e;
|
|
541
|
+
}, t[15] = A) : A = t[15];
|
|
542
|
+
let j = u === S || void 0, M;
|
|
543
|
+
t[16] !== i || t[17] !== g || t[18] !== S || t[19] !== p ? (M = (e) => {
|
|
544
|
+
e.preventDefault(), p(S), g(S), ReactEditor.focus(i);
|
|
545
|
+
}, t[16] = i, t[17] = g, t[18] = S, t[19] = p, t[20] = M) : M = t[20];
|
|
546
|
+
let N;
|
|
547
|
+
t[21] !== y || t[22] !== S || t[23] !== p ? (N = () => {
|
|
548
|
+
p(S), y(S);
|
|
549
|
+
}, t[21] = y, t[22] = S, t[23] = p, t[24] = N) : N = t[24];
|
|
550
|
+
let P;
|
|
551
|
+
t[25] !== u || t[26] !== S || t[27] !== p ? (P = (e) => {
|
|
552
|
+
e.preventDefault(), u !== S && p(S);
|
|
553
|
+
}, t[25] = u, t[26] = S, t[27] = p, t[28] = P) : P = t[28];
|
|
554
|
+
let F;
|
|
555
|
+
t[29] !== b || t[30] !== n || t[31] !== P || t[32] !== j || t[33] !== M || t[34] !== N ? (F = /* @__PURE__ */ jsx(MenuSubTrigger, {
|
|
556
|
+
ref: A,
|
|
557
|
+
"data-focus": j,
|
|
558
|
+
onPointerDown: M,
|
|
559
|
+
onPointerEnter: N,
|
|
560
|
+
onPointerMove: P,
|
|
561
|
+
onPointerLeave: b,
|
|
562
|
+
children: n
|
|
563
|
+
}), t[29] = b, t[30] = n, t[31] = P, t[32] = j, t[33] = M, t[34] = N, t[35] = F) : F = t[35];
|
|
564
|
+
let I;
|
|
565
|
+
t[36] !== r || t[37] !== S ? (I = /* @__PURE__ */ jsx(SubMenuIdContext.Provider, {
|
|
566
|
+
value: S,
|
|
567
|
+
children: r
|
|
568
|
+
}), t[36] = r, t[37] = S, t[38] = I) : I = t[38];
|
|
569
|
+
let L;
|
|
570
|
+
t[39] !== D || t[40] !== I ? (L = /* @__PURE__ */ jsx(MenuSubContent, {
|
|
571
|
+
color: "primary",
|
|
572
|
+
...D,
|
|
573
|
+
children: I
|
|
574
|
+
}), t[39] = D, t[40] = I, t[41] = L) : L = t[41];
|
|
575
|
+
let R;
|
|
576
|
+
return t[42] !== F || t[43] !== L || t[44] !== O || t[45] !== k ? (R = /* @__PURE__ */ jsxs(MenuSub, {
|
|
577
|
+
open: O,
|
|
578
|
+
onOpenChange: k,
|
|
579
|
+
children: [F, L]
|
|
580
|
+
}), t[42] = F, t[43] = L, t[44] = O, t[45] = k, t[46] = R) : R = t[46], R;
|
|
581
|
+
};
|
|
582
|
+
function _temp(e) {
|
|
583
|
+
return e.void;
|
|
563
584
|
}
|
|
564
|
-
function
|
|
565
|
-
|
|
585
|
+
function _temp2(e) {
|
|
586
|
+
return e.preventDefault();
|
|
566
587
|
}
|
|
567
|
-
function
|
|
588
|
+
function _temp3(e) {
|
|
589
|
+
return e.stopPropagation();
|
|
568
590
|
}
|
|
569
|
-
function
|
|
591
|
+
function _temp4(e) {
|
|
592
|
+
return e.preventDefault();
|
|
570
593
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
594
|
+
function _temp5() {}
|
|
595
|
+
function _temp6() {}
|
|
596
|
+
function _temp7(e) {
|
|
597
|
+
return e.preventDefault();
|
|
573
598
|
}
|
|
574
|
-
function
|
|
575
|
-
|
|
599
|
+
function _temp8(e) {
|
|
600
|
+
return e.preventDefault();
|
|
576
601
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
602
|
+
function _temp9(e) {
|
|
603
|
+
return e.preventDefault();
|
|
579
604
|
}
|
|
580
|
-
export {
|
|
581
|
-
Tt as EditorInput,
|
|
582
|
-
Ot as EditorInputMenu,
|
|
583
|
-
kt as EditorInputMenuItem,
|
|
584
|
-
Mt as EditorInputSubMenu,
|
|
585
|
-
wt as EditorInputTrigger,
|
|
586
|
-
Dt as EditorInputValue
|
|
587
|
-
};
|
|
605
|
+
export { EditorInput, EditorInputMenu, EditorInputMenuItem, EditorInputSubMenu, EditorInputTrigger, EditorInputValue };
|