@code0-tech/pictor 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +6 -0
- package/dist/_virtual/rolldown_runtime.js +18 -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 +34 -41
- package/dist/components/aurora/Aurora.js +27 -22
- package/dist/components/avatar/Avatar.js +57 -55
- package/dist/components/badge/Badge.js +58 -64
- package/dist/components/breadcrumb/Breadcrumb.js +16 -21
- package/dist/components/button/Button.js +24 -31
- package/dist/components/button-group/ButtonGroup.js +29 -31
- package/dist/components/card/Card.js +30 -44
- package/dist/components/card/CardSection.js +21 -29
- package/dist/components/chart/Chart.js +138 -153
- package/dist/components/chart/LineChart.js +75 -74
- package/dist/components/chart/index.js +3 -8
- package/dist/components/col/Col.js +19 -29
- package/dist/components/command/Command.js +101 -134
- package/dist/components/container/Container.js +19 -23
- package/dist/components/context-menu/ContextMenu.js +119 -112
- package/dist/components/data-table/DataTable.js +53 -64
- package/dist/components/data-table/DataTableColumn.js +18 -22
- package/dist/components/data-table/DataTableFilterInput.js +208 -205
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +59 -48
- package/dist/components/data-table/DataTableHeader.js +34 -38
- package/dist/components/data-table/DataTablePagination.js +62 -74
- package/dist/components/data-table/index.js +7 -22
- package/dist/components/dialog/Dialog.js +107 -97
- package/dist/components/editor/Editor.js +352 -323
- package/dist/components/file-tabs/FileTabs.js +78 -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 +19 -23
- package/dist/components/form/CheckboxInput.js +73 -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 +93 -123
- package/dist/components/form/Input.js +64 -58
- package/dist/components/form/Input.utils.js +25 -37
- package/dist/components/form/InputDescription.js +11 -11
- package/dist/components/form/InputLabel.js +18 -22
- package/dist/components/form/InputMessage.js +17 -17
- package/dist/components/form/InputWrapper.js +56 -65
- package/dist/components/form/NumberInput.js +41 -20
- package/dist/components/form/PasswordInput.js +71 -54
- package/dist/components/form/PinInput.js +50 -65
- package/dist/components/form/RadioGroup.js +42 -50
- package/dist/components/form/RadioInput.js +31 -29
- package/dist/components/form/SelectInput.js +69 -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 +28 -27
- package/dist/components/gantt/Gantt.js +100 -98
- package/dist/components/gantt/GanttGroup.js +210 -195
- package/dist/components/gantt/GanttHeader.js +79 -81
- package/dist/components/gantt/GanttItem.js +19 -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 +120 -109
- package/dist/components/layout/Layout.js +101 -78
- package/dist/components/menu/Menu.js +135 -128
- package/dist/components/progress/ProgressCircle.js +60 -49
- package/dist/components/progress/ProgressLinear.js +39 -43
- package/dist/components/quote/Quote.js +52 -43
- package/dist/components/resizable/Resizable.js +36 -33
- package/dist/components/row/Row.js +19 -23
- package/dist/components/scroll-area/ScrollArea.js +66 -76
- package/dist/components/segmented-control/SegmentedControl.js +46 -50
- package/dist/components/spacing/Spacing.js +16 -23
- package/dist/components/tab/Tab.js +73 -66
- package/dist/components/text/Text.js +19 -25
- package/dist/components/toast/Toast.js +104 -82
- package/dist/components/tooltip/Tooltip.js +66 -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/framer-motion/dist/es/components/AnimatePresence/PopChild.js +55 -55
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -32
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +57 -46
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -16
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +8 -11
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +4 -5
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +4 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +7 -8
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -11
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +4 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +12 -14
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +4 -5
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +4 -5
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +5 -7
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +8 -13
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +252 -281
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +19 -21
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +57 -67
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +24 -27
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +16 -19
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -124
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +39 -42
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +22 -27
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +36 -44
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +22 -32
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +6 -12
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +47 -37
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +12 -16
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +10 -20
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +58 -59
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +7 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +42 -43
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +19 -18
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +64 -58
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +2 -4
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -20
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +53 -62
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +45 -49
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +4 -38
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +7 -17
- package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +3 -0
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +10 -12
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +5 -7
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -10
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +18 -15
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +14 -18
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +4 -23
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +8 -9
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +20 -23
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +6 -8
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +27 -29
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +23 -21
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +8 -9
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +5 -7
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +5 -8
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +2 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +2 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +3 -5
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +10 -11
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +20 -25
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +6 -7
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +5 -6
- package/dist/node_modules/motion/dist/es/react.js +196 -0
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +104 -111
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +126 -143
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +81 -105
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +25 -37
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +7 -9
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +10 -16
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +29 -36
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +18 -28
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +156 -170
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +6 -12
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -12
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +6 -8
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +42 -45
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +52 -57
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +22 -27
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +18 -21
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +58 -67
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +61 -70
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +9 -11
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +3 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +15 -15
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +32 -35
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +3 -6
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +19 -26
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +14 -21
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +21 -29
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +25 -22
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +3 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +4 -8
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +15 -19
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +12 -14
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -9
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +8 -11
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +32 -14
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +16 -20
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +21 -32
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +7 -11
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +5 -9
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +5 -9
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +12 -14
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -26
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +4 -9
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +10 -20
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +29 -42
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +11 -13
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +6 -9
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +8 -10
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +32 -36
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +32 -32
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +16 -15
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +23 -24
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +13 -11
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +20 -29
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +34 -22
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +7 -11
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +41 -53
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +28 -38
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +23 -21
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +15 -17
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +18 -26
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +10 -12
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +19 -24
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +554 -592
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +4 -14
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +48 -52
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +10 -20
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +11 -16
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +14 -20
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +9 -12
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +16 -18
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +11 -15
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +8 -11
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +6 -9
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +198 -260
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +25 -27
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +49 -60
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +35 -35
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +25 -28
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +33 -37
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +5 -11
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +8 -12
- package/dist/node_modules/motion-dom/dist/es/render/store.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +37 -39
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +18 -30
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +25 -27
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +11 -13
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +6 -10
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +11 -14
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +128 -138
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +16 -19
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +8 -11
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +5 -8
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +10 -12
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +20 -23
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +18 -24
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +8 -14
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +2 -5
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +16 -18
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +14 -18
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +7 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +10 -13
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +31 -35
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +18 -21
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +5 -0
- package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +7 -0
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +9 -11
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +29 -40
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +26 -27
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +44 -45
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +4 -7
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +11 -14
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +9 -11
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +6 -8
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/value/index.js +89 -211
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +15 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +17 -20
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +9 -11
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +12 -14
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +12 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +13 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +22 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +43 -44
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -10
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +14 -9
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +5 -7
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +22 -27
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +61 -69
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +29 -36
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +12 -16
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +10 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +9 -11
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +10 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +3 -5
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +2 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +4 -6
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +10 -13
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +4 -6
- package/dist/node_modules/motion-utils/dist/es/array.js +6 -9
- package/dist/node_modules/motion-utils/dist/es/clamp.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +3 -5
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +5 -9
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +4 -8
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +14 -17
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +3 -7
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +28 -31
- package/dist/node_modules/motion-utils/dist/es/errors.js +7 -13
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +3 -5
- package/dist/node_modules/motion-utils/dist/es/global-config.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/is-object.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/memo.js +5 -7
- package/dist/node_modules/motion-utils/dist/es/noop.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/pipe.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/progress.js +4 -6
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +23 -28
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +2 -5
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +2 -4
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +5 -7
- 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/node_modules/react/cjs/react-compiler-runtime.development.js +21 -21
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +18 -14
- package/dist/node_modules/react/compiler-runtime.js +8 -10
- 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 +48 -58
- package/dist/utils/index.js +7 -29
- package/dist/utils/motion.js +85 -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 +25 -20
- 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/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,146 +1,781 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
var DefaultBufferLength = 1024, nextPropID = 0, NodeProp = class {
|
|
2
|
+
constructor(e = {}) {
|
|
3
|
+
this.id = nextPropID++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
|
|
4
|
+
throw Error("This node type doesn't define a deserialize function");
|
|
5
|
+
}), this.combine = e.combine || null;
|
|
6
|
+
}
|
|
7
|
+
add(e) {
|
|
8
|
+
if (this.perNode) throw RangeError("Can't add per-node props to node types");
|
|
9
|
+
return typeof e != "function" && (e = NodeType.match(e)), (n) => {
|
|
10
|
+
let r = e(n);
|
|
11
|
+
return r === void 0 ? null : [this, r];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
NodeProp.closedBy = new NodeProp({ deserialize: (e) => e.split(" ") }), NodeProp.openedBy = new NodeProp({ deserialize: (e) => e.split(" ") }), NodeProp.group = new NodeProp({ deserialize: (e) => e.split(" ") }), NodeProp.isolate = new NodeProp({ deserialize: (e) => {
|
|
16
|
+
if (e && e != "rtl" && e != "ltr" && e != "auto") throw RangeError("Invalid value for isolate: " + e);
|
|
17
|
+
return e || "auto";
|
|
18
|
+
} }), NodeProp.contextHash = new NodeProp({ perNode: !0 }), NodeProp.lookAhead = new NodeProp({ perNode: !0 }), NodeProp.mounted = new NodeProp({ perNode: !0 });
|
|
19
|
+
var MountedTree = class {
|
|
20
|
+
constructor(e, n, r, i = !1) {
|
|
21
|
+
this.tree = e, this.overlay = n, this.parser = r, this.bracketed = i;
|
|
22
|
+
}
|
|
23
|
+
static get(e) {
|
|
24
|
+
return e && e.props && e.props[NodeProp.mounted.id];
|
|
25
|
+
}
|
|
26
|
+
}, noProps = Object.create(null), NodeType = class e {
|
|
27
|
+
constructor(e, n, r, i = 0) {
|
|
28
|
+
this.name = e, this.props = n, this.id = r, this.flags = i;
|
|
29
|
+
}
|
|
30
|
+
static define(n) {
|
|
31
|
+
let r = n.props && n.props.length ? Object.create(null) : noProps, i = (n.top ? 1 : 0) | (n.skipped ? 2 : 0) | (n.error ? 4 : 0) | (n.name == null ? 8 : 0), o = new e(n.name || "", r, n.id, i);
|
|
32
|
+
if (n.props) {
|
|
33
|
+
for (let e of n.props) if (Array.isArray(e) || (e = e(o)), e) {
|
|
34
|
+
if (e[0].perNode) throw RangeError("Can't store a per-node prop on a node type");
|
|
35
|
+
r[e[0].id] = e[1];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return o;
|
|
39
|
+
}
|
|
40
|
+
prop(e) {
|
|
41
|
+
return this.props[e.id];
|
|
42
|
+
}
|
|
43
|
+
get isTop() {
|
|
44
|
+
return (this.flags & 1) > 0;
|
|
45
|
+
}
|
|
46
|
+
get isSkipped() {
|
|
47
|
+
return (this.flags & 2) > 0;
|
|
48
|
+
}
|
|
49
|
+
get isError() {
|
|
50
|
+
return (this.flags & 4) > 0;
|
|
51
|
+
}
|
|
52
|
+
get isAnonymous() {
|
|
53
|
+
return (this.flags & 8) > 0;
|
|
54
|
+
}
|
|
55
|
+
is(e) {
|
|
56
|
+
if (typeof e == "string") {
|
|
57
|
+
if (this.name == e) return !0;
|
|
58
|
+
let n = this.prop(NodeProp.group);
|
|
59
|
+
return n ? n.indexOf(e) > -1 : !1;
|
|
60
|
+
}
|
|
61
|
+
return this.id == e;
|
|
62
|
+
}
|
|
63
|
+
static match(e) {
|
|
64
|
+
let n = Object.create(null);
|
|
65
|
+
for (let r in e) for (let i of r.split(" ")) n[i] = e[r];
|
|
66
|
+
return (e) => {
|
|
67
|
+
for (let i = e.prop(NodeProp.group), a = -1; a < (i ? i.length : 0); a++) {
|
|
68
|
+
let r = n[a < 0 ? e.name : i[a]];
|
|
69
|
+
if (r) return r;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
NodeType.none = new NodeType("", Object.create(null), 0, 8);
|
|
75
|
+
var CachedNode = /* @__PURE__ */ new WeakMap(), CachedInnerNode = /* @__PURE__ */ new WeakMap(), IterMode;
|
|
76
|
+
(function(e) {
|
|
77
|
+
e[e.ExcludeBuffers = 1] = "ExcludeBuffers", e[e.IncludeAnonymous = 2] = "IncludeAnonymous", e[e.IgnoreMounts = 4] = "IgnoreMounts", e[e.IgnoreOverlays = 8] = "IgnoreOverlays", e[e.EnterBracketed = 16] = "EnterBracketed";
|
|
78
|
+
})(IterMode ||= {});
|
|
79
|
+
var Tree = class e {
|
|
80
|
+
constructor(e, n, r, i, a) {
|
|
81
|
+
if (this.type = e, this.children = n, this.positions = r, this.length = i, this.props = null, a && a.length) {
|
|
82
|
+
this.props = Object.create(null);
|
|
83
|
+
for (let [e, n] of a) this.props[typeof e == "number" ? e : e.id] = n;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
toString() {
|
|
87
|
+
let e = MountedTree.get(this);
|
|
88
|
+
if (e && !e.overlay) return e.tree.toString();
|
|
89
|
+
let n = "";
|
|
90
|
+
for (let e of this.children) {
|
|
91
|
+
let r = e.toString();
|
|
92
|
+
r && (n && (n += ","), n += r);
|
|
93
|
+
}
|
|
94
|
+
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (n.length ? "(" + n + ")" : "") : n;
|
|
95
|
+
}
|
|
96
|
+
cursor(e = 0) {
|
|
97
|
+
return new TreeCursor(this.topNode, e);
|
|
98
|
+
}
|
|
99
|
+
cursorAt(e, n = 0, r = 0) {
|
|
100
|
+
let i = new TreeCursor(CachedNode.get(this) || this.topNode);
|
|
101
|
+
return i.moveTo(e, n), CachedNode.set(this, i._tree), i;
|
|
102
|
+
}
|
|
103
|
+
get topNode() {
|
|
104
|
+
return new TreeNode(this, 0, 0, null);
|
|
105
|
+
}
|
|
106
|
+
resolve(e, n = 0) {
|
|
107
|
+
let r = resolveNode(CachedNode.get(this) || this.topNode, e, n, !1);
|
|
108
|
+
return CachedNode.set(this, r), r;
|
|
109
|
+
}
|
|
110
|
+
resolveInner(e, n = 0) {
|
|
111
|
+
let r = resolveNode(CachedInnerNode.get(this) || this.topNode, e, n, !0);
|
|
112
|
+
return CachedInnerNode.set(this, r), r;
|
|
113
|
+
}
|
|
114
|
+
resolveStack(e, n = 0) {
|
|
115
|
+
return stackIterator(this, e, n);
|
|
116
|
+
}
|
|
117
|
+
iterate(e) {
|
|
118
|
+
let { enter: n, leave: r, from: i = 0, to: a = this.length } = e, o = e.mode || 0, s = (o & IterMode.IncludeAnonymous) > 0;
|
|
119
|
+
for (let e = this.cursor(o | IterMode.IncludeAnonymous);;) {
|
|
120
|
+
let o = !1;
|
|
121
|
+
if (e.from <= a && e.to >= i && (!s && e.type.isAnonymous || n(e) !== !1)) {
|
|
122
|
+
if (e.firstChild()) continue;
|
|
123
|
+
o = !0;
|
|
124
|
+
}
|
|
125
|
+
for (; o && r && (s || !e.type.isAnonymous) && r(e), !e.nextSibling();) {
|
|
126
|
+
if (!e.parent()) return;
|
|
127
|
+
o = !0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
prop(e) {
|
|
132
|
+
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
133
|
+
}
|
|
134
|
+
get propValues() {
|
|
135
|
+
let e = [];
|
|
136
|
+
if (this.props) for (let n in this.props) e.push([+n, this.props[n]]);
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
balance(n = {}) {
|
|
140
|
+
return this.children.length <= 8 ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (n, r, i) => new e(this.type, n, r, i, this.propValues), n.makeTree || ((n, r, i) => new e(NodeType.none, n, r, i)));
|
|
141
|
+
}
|
|
142
|
+
static build(e) {
|
|
143
|
+
return buildTree(e);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
Tree.empty = new Tree(NodeType.none, [], [], 0);
|
|
147
|
+
var FlatBufferCursor = class e {
|
|
148
|
+
constructor(e, n) {
|
|
149
|
+
this.buffer = e, this.index = n;
|
|
150
|
+
}
|
|
151
|
+
get id() {
|
|
152
|
+
return this.buffer[this.index - 4];
|
|
153
|
+
}
|
|
154
|
+
get start() {
|
|
155
|
+
return this.buffer[this.index - 3];
|
|
156
|
+
}
|
|
157
|
+
get end() {
|
|
158
|
+
return this.buffer[this.index - 2];
|
|
159
|
+
}
|
|
160
|
+
get size() {
|
|
161
|
+
return this.buffer[this.index - 1];
|
|
162
|
+
}
|
|
163
|
+
get pos() {
|
|
164
|
+
return this.index;
|
|
165
|
+
}
|
|
166
|
+
next() {
|
|
167
|
+
this.index -= 4;
|
|
168
|
+
}
|
|
169
|
+
fork() {
|
|
170
|
+
return new e(this.buffer, this.index);
|
|
171
|
+
}
|
|
172
|
+
}, TreeBuffer = class e {
|
|
173
|
+
constructor(e, n, r) {
|
|
174
|
+
this.buffer = e, this.length = n, this.set = r;
|
|
175
|
+
}
|
|
176
|
+
get type() {
|
|
177
|
+
return NodeType.none;
|
|
178
|
+
}
|
|
179
|
+
toString() {
|
|
180
|
+
let e = [];
|
|
181
|
+
for (let n = 0; n < this.buffer.length;) e.push(this.childString(n)), n = this.buffer[n + 3];
|
|
182
|
+
return e.join(",");
|
|
183
|
+
}
|
|
184
|
+
childString(e) {
|
|
185
|
+
let n = this.buffer[e], r = this.buffer[e + 3], i = this.set.types[n], a = i.name;
|
|
186
|
+
if (/\W/.test(a) && !i.isError && (a = JSON.stringify(a)), e += 4, r == e) return a;
|
|
187
|
+
let o = [];
|
|
188
|
+
for (; e < r;) o.push(this.childString(e)), e = this.buffer[e + 3];
|
|
189
|
+
return a + "(" + o.join(",") + ")";
|
|
190
|
+
}
|
|
191
|
+
findChild(e, n, r, i, a) {
|
|
192
|
+
let { buffer: o } = this, s = -1;
|
|
193
|
+
for (let c = e; c != n && !(checkSide(a, i, o[c + 1], o[c + 2]) && (s = c, r > 0)); c = o[c + 3]);
|
|
194
|
+
return s;
|
|
195
|
+
}
|
|
196
|
+
slice(n, r, i) {
|
|
197
|
+
let a = this.buffer, o = new Uint16Array(r - n), s = 0;
|
|
198
|
+
for (let e = n, c = 0; e < r;) {
|
|
199
|
+
o[c++] = a[e++], o[c++] = a[e++] - i;
|
|
200
|
+
let r = o[c++] = a[e++] - i;
|
|
201
|
+
o[c++] = a[e++] - n, s = Math.max(s, r);
|
|
202
|
+
}
|
|
203
|
+
return new e(o, s, this.set);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
function checkSide(e, n, r, i) {
|
|
207
|
+
switch (e) {
|
|
208
|
+
case -2: return r < n;
|
|
209
|
+
case -1: return i >= n && r < n;
|
|
210
|
+
case 0: return r < n && i > n;
|
|
211
|
+
case 1: return r <= n && i > n;
|
|
212
|
+
case 2: return i > n;
|
|
213
|
+
case 4: return !0;
|
|
214
|
+
}
|
|
28
215
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
@internal
|
|
44
|
-
*/
|
|
45
|
-
constructor(e, n, o, s = 0) {
|
|
46
|
-
this.name = e, this.props = n, this.id = o, this.flags = s;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
Define a node type.
|
|
50
|
-
*/
|
|
51
|
-
static define(e) {
|
|
52
|
-
let n = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : d, o = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), s = new l(e.name || "", n, e.id, o);
|
|
53
|
-
if (e.props) {
|
|
54
|
-
for (let i of e.props)
|
|
55
|
-
if (Array.isArray(i) || (i = i(s)), i) {
|
|
56
|
-
if (i[0].perNode)
|
|
57
|
-
throw new RangeError("Can't store a per-node prop on a node type");
|
|
58
|
-
n[i[0].id] = i[1];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return s;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
Retrieves a node prop for this type. Will return `undefined` if
|
|
65
|
-
the prop isn't present on this node.
|
|
66
|
-
*/
|
|
67
|
-
prop(e) {
|
|
68
|
-
return this.props[e.id];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
True when this is the top node of a grammar.
|
|
72
|
-
*/
|
|
73
|
-
get isTop() {
|
|
74
|
-
return (this.flags & 1) > 0;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
True when this node is produced by a skip rule.
|
|
78
|
-
*/
|
|
79
|
-
get isSkipped() {
|
|
80
|
-
return (this.flags & 2) > 0;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
Indicates whether this is an error node.
|
|
84
|
-
*/
|
|
85
|
-
get isError() {
|
|
86
|
-
return (this.flags & 4) > 0;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
When true, this node type doesn't correspond to a user-declared
|
|
90
|
-
named node, for example because it is used to cache repetition.
|
|
91
|
-
*/
|
|
92
|
-
get isAnonymous() {
|
|
93
|
-
return (this.flags & 8) > 0;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
Returns true when this node's name or one of its
|
|
97
|
-
[groups](#common.NodeProp^group) matches the given string.
|
|
98
|
-
*/
|
|
99
|
-
is(e) {
|
|
100
|
-
if (typeof e == "string") {
|
|
101
|
-
if (this.name == e)
|
|
102
|
-
return !0;
|
|
103
|
-
let n = this.prop(t.group);
|
|
104
|
-
return n ? n.indexOf(e) > -1 : !1;
|
|
105
|
-
}
|
|
106
|
-
return this.id == e;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
Create a function from node types to arbitrary values by
|
|
110
|
-
specifying an object whose property names are node or
|
|
111
|
-
[group](#common.NodeProp^group) names. Often useful with
|
|
112
|
-
[`NodeProp.add`](#common.NodeProp.add). You can put multiple
|
|
113
|
-
names, separated by spaces, in a single property name to map
|
|
114
|
-
multiple node names to a single value.
|
|
115
|
-
*/
|
|
116
|
-
static match(e) {
|
|
117
|
-
let n = /* @__PURE__ */ Object.create(null);
|
|
118
|
-
for (let o in e)
|
|
119
|
-
for (let s of o.split(" "))
|
|
120
|
-
n[s] = e[o];
|
|
121
|
-
return (o) => {
|
|
122
|
-
for (let s = o.prop(t.group), i = -1; i < (s ? s.length : 0); i++) {
|
|
123
|
-
let p = n[i < 0 ? o.name : s[i]];
|
|
124
|
-
if (p)
|
|
125
|
-
return p;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
216
|
+
function resolveNode(e, n, r, i) {
|
|
217
|
+
for (; e.from == e.to || (r < 1 ? e.from >= n : e.from > n) || (r > -1 ? e.to <= n : e.to < n);) {
|
|
218
|
+
let n = !i && e instanceof TreeNode && e.index < 0 ? null : e.parent;
|
|
219
|
+
if (!n) return e;
|
|
220
|
+
e = n;
|
|
221
|
+
}
|
|
222
|
+
let a = i ? 0 : IterMode.IgnoreOverlays;
|
|
223
|
+
if (i) for (let i = e, o = i.parent; o; i = o, o = i.parent) i instanceof TreeNode && i.index < 0 && o.enter(n, r, a)?.from != i.from && (e = o);
|
|
224
|
+
for (;;) {
|
|
225
|
+
let i = e.enter(n, r, a);
|
|
226
|
+
if (!i) return e;
|
|
227
|
+
e = i;
|
|
228
|
+
}
|
|
129
229
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
(
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
230
|
+
var BaseNode = class {
|
|
231
|
+
cursor(e = 0) {
|
|
232
|
+
return new TreeCursor(this, e);
|
|
233
|
+
}
|
|
234
|
+
getChild(e, n = null, r = null) {
|
|
235
|
+
let i = getChildren(this, e, n, r);
|
|
236
|
+
return i.length ? i[0] : null;
|
|
237
|
+
}
|
|
238
|
+
getChildren(e, n = null, r = null) {
|
|
239
|
+
return getChildren(this, e, n, r);
|
|
240
|
+
}
|
|
241
|
+
resolve(e, n = 0) {
|
|
242
|
+
return resolveNode(this, e, n, !1);
|
|
243
|
+
}
|
|
244
|
+
resolveInner(e, n = 0) {
|
|
245
|
+
return resolveNode(this, e, n, !0);
|
|
246
|
+
}
|
|
247
|
+
matchContext(e) {
|
|
248
|
+
return matchNodeContext(this.parent, e);
|
|
249
|
+
}
|
|
250
|
+
enterUnfinishedNodesBefore(e) {
|
|
251
|
+
let n = this.childBefore(e), r = this;
|
|
252
|
+
for (; n;) {
|
|
253
|
+
let e = n.lastChild;
|
|
254
|
+
if (!e || e.to != n.to) break;
|
|
255
|
+
e.type.isError && e.from == e.to ? (r = n, n = e.prevSibling) : n = e;
|
|
256
|
+
}
|
|
257
|
+
return r;
|
|
258
|
+
}
|
|
259
|
+
get node() {
|
|
260
|
+
return this;
|
|
261
|
+
}
|
|
262
|
+
get next() {
|
|
263
|
+
return this.parent;
|
|
264
|
+
}
|
|
265
|
+
}, TreeNode = class e extends BaseNode {
|
|
266
|
+
constructor(e, n, r, i) {
|
|
267
|
+
super(), this._tree = e, this.from = n, this.index = r, this._parent = i;
|
|
268
|
+
}
|
|
269
|
+
get type() {
|
|
270
|
+
return this._tree.type;
|
|
271
|
+
}
|
|
272
|
+
get name() {
|
|
273
|
+
return this._tree.type.name;
|
|
274
|
+
}
|
|
275
|
+
get to() {
|
|
276
|
+
return this.from + this._tree.length;
|
|
277
|
+
}
|
|
278
|
+
nextChild(n, r, a, o, s = 0) {
|
|
279
|
+
for (let c = this;;) {
|
|
280
|
+
for (let { children: d, positions: m } = c._tree, h = r > 0 ? d.length : -1; n != h; n += r) {
|
|
281
|
+
let h = d[n], g = m[n] + c.from, _;
|
|
282
|
+
if (!(!(s & IterMode.EnterBracketed && h instanceof Tree && (_ = MountedTree.get(h)) && !_.overlay && _.bracketed && a >= g && a <= g + h.length) && !checkSide(o, a, g, g + h.length))) {
|
|
283
|
+
if (h instanceof TreeBuffer) {
|
|
284
|
+
if (s & IterMode.ExcludeBuffers) continue;
|
|
285
|
+
let e = h.findChild(0, h.buffer.length, r, a - g, o);
|
|
286
|
+
if (e > -1) return new BufferNode(new BufferContext(c, h, n, g), null, e);
|
|
287
|
+
} else if (s & IterMode.IncludeAnonymous || !h.type.isAnonymous || hasChild(h)) {
|
|
288
|
+
let u;
|
|
289
|
+
if (!(s & IterMode.IgnoreMounts) && (u = MountedTree.get(h)) && !u.overlay) return new e(u.tree, g, n, c);
|
|
290
|
+
let d = new e(h, g, n, c);
|
|
291
|
+
return s & IterMode.IncludeAnonymous || !d.type.isAnonymous ? d : d.nextChild(r < 0 ? h.children.length - 1 : 0, r, a, o, s);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (s & IterMode.IncludeAnonymous || !c.type.isAnonymous || (n = c.index >= 0 ? c.index + r : r < 0 ? -1 : c._parent._tree.children.length, c = c._parent, !c)) return null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
get firstChild() {
|
|
299
|
+
return this.nextChild(0, 1, 0, 4);
|
|
300
|
+
}
|
|
301
|
+
get lastChild() {
|
|
302
|
+
return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
|
|
303
|
+
}
|
|
304
|
+
childAfter(e) {
|
|
305
|
+
return this.nextChild(0, 1, e, 2);
|
|
306
|
+
}
|
|
307
|
+
childBefore(e) {
|
|
308
|
+
return this.nextChild(this._tree.children.length - 1, -1, e, -2);
|
|
309
|
+
}
|
|
310
|
+
prop(e) {
|
|
311
|
+
return this._tree.prop(e);
|
|
312
|
+
}
|
|
313
|
+
enter(n, r, a = 0) {
|
|
314
|
+
let o;
|
|
315
|
+
if (!(a & IterMode.IgnoreOverlays) && (o = MountedTree.get(this._tree)) && o.overlay) {
|
|
316
|
+
let i = n - this.from, s = a & IterMode.EnterBracketed && o.bracketed;
|
|
317
|
+
for (let { from: n, to: a } of o.overlay) if ((r > 0 || s ? n <= i : n < i) && (r < 0 || s ? a >= i : a > i)) return new e(o.tree, o.overlay[0].from + this.from, -1, this);
|
|
318
|
+
}
|
|
319
|
+
return this.nextChild(0, 1, n, r, a);
|
|
320
|
+
}
|
|
321
|
+
nextSignificantParent() {
|
|
322
|
+
let e = this;
|
|
323
|
+
for (; e.type.isAnonymous && e._parent;) e = e._parent;
|
|
324
|
+
return e;
|
|
325
|
+
}
|
|
326
|
+
get parent() {
|
|
327
|
+
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
328
|
+
}
|
|
329
|
+
get nextSibling() {
|
|
330
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
|
|
331
|
+
}
|
|
332
|
+
get prevSibling() {
|
|
333
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
|
|
334
|
+
}
|
|
335
|
+
get tree() {
|
|
336
|
+
return this._tree;
|
|
337
|
+
}
|
|
338
|
+
toTree() {
|
|
339
|
+
return this._tree;
|
|
340
|
+
}
|
|
341
|
+
toString() {
|
|
342
|
+
return this._tree.toString();
|
|
343
|
+
}
|
|
146
344
|
};
|
|
345
|
+
function getChildren(e, n, r, i) {
|
|
346
|
+
let a = e.cursor(), o = [];
|
|
347
|
+
if (!a.firstChild()) return o;
|
|
348
|
+
if (r != null) {
|
|
349
|
+
for (let e = !1; !e;) if (e = a.type.is(r), !a.nextSibling()) return o;
|
|
350
|
+
}
|
|
351
|
+
for (;;) {
|
|
352
|
+
if (i != null && a.type.is(i)) return o;
|
|
353
|
+
if (a.type.is(n) && o.push(a.node), !a.nextSibling()) return i == null ? o : [];
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function matchNodeContext(e, n, r = n.length - 1) {
|
|
357
|
+
for (let i = e; r >= 0; i = i.parent) {
|
|
358
|
+
if (!i) return !1;
|
|
359
|
+
if (!i.type.isAnonymous) {
|
|
360
|
+
if (n[r] && n[r] != i.name) return !1;
|
|
361
|
+
r--;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return !0;
|
|
365
|
+
}
|
|
366
|
+
var BufferContext = class {
|
|
367
|
+
constructor(e, n, r, i) {
|
|
368
|
+
this.parent = e, this.buffer = n, this.index = r, this.start = i;
|
|
369
|
+
}
|
|
370
|
+
}, BufferNode = class e extends BaseNode {
|
|
371
|
+
get name() {
|
|
372
|
+
return this.type.name;
|
|
373
|
+
}
|
|
374
|
+
get from() {
|
|
375
|
+
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
376
|
+
}
|
|
377
|
+
get to() {
|
|
378
|
+
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
379
|
+
}
|
|
380
|
+
constructor(e, n, r) {
|
|
381
|
+
super(), this.context = e, this._parent = n, this.index = r, this.type = e.buffer.set.types[e.buffer.buffer[r]];
|
|
382
|
+
}
|
|
383
|
+
child(n, r, i) {
|
|
384
|
+
let { buffer: a } = this.context, o = a.findChild(this.index + 4, a.buffer[this.index + 3], n, r - this.context.start, i);
|
|
385
|
+
return o < 0 ? null : new e(this.context, this, o);
|
|
386
|
+
}
|
|
387
|
+
get firstChild() {
|
|
388
|
+
return this.child(1, 0, 4);
|
|
389
|
+
}
|
|
390
|
+
get lastChild() {
|
|
391
|
+
return this.child(-1, 0, 4);
|
|
392
|
+
}
|
|
393
|
+
childAfter(e) {
|
|
394
|
+
return this.child(1, e, 2);
|
|
395
|
+
}
|
|
396
|
+
childBefore(e) {
|
|
397
|
+
return this.child(-1, e, -2);
|
|
398
|
+
}
|
|
399
|
+
prop(e) {
|
|
400
|
+
return this.type.prop(e);
|
|
401
|
+
}
|
|
402
|
+
enter(n, r, i = 0) {
|
|
403
|
+
if (i & IterMode.ExcludeBuffers) return null;
|
|
404
|
+
let { buffer: a } = this.context, o = a.findChild(this.index + 4, a.buffer[this.index + 3], r > 0 ? 1 : -1, n - this.context.start, r);
|
|
405
|
+
return o < 0 ? null : new e(this.context, this, o);
|
|
406
|
+
}
|
|
407
|
+
get parent() {
|
|
408
|
+
return this._parent || this.context.parent.nextSignificantParent();
|
|
409
|
+
}
|
|
410
|
+
externalSibling(e) {
|
|
411
|
+
return this._parent ? null : this.context.parent.nextChild(this.context.index + e, e, 0, 4);
|
|
412
|
+
}
|
|
413
|
+
get nextSibling() {
|
|
414
|
+
let { buffer: n } = this.context, r = n.buffer[this.index + 3];
|
|
415
|
+
return r < (this._parent ? n.buffer[this._parent.index + 3] : n.buffer.length) ? new e(this.context, this._parent, r) : this.externalSibling(1);
|
|
416
|
+
}
|
|
417
|
+
get prevSibling() {
|
|
418
|
+
let { buffer: n } = this.context, r = this._parent ? this._parent.index + 4 : 0;
|
|
419
|
+
return this.index == r ? this.externalSibling(-1) : new e(this.context, this._parent, n.findChild(r, this.index, -1, 0, 4));
|
|
420
|
+
}
|
|
421
|
+
get tree() {
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
toTree() {
|
|
425
|
+
let e = [], n = [], { buffer: r } = this.context, i = this.index + 4, a = r.buffer[this.index + 3];
|
|
426
|
+
if (a > i) {
|
|
427
|
+
let o = r.buffer[this.index + 1];
|
|
428
|
+
e.push(r.slice(i, a, o)), n.push(0);
|
|
429
|
+
}
|
|
430
|
+
return new Tree(this.type, e, n, this.to - this.from);
|
|
431
|
+
}
|
|
432
|
+
toString() {
|
|
433
|
+
return this.context.buffer.childString(this.index);
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
function iterStack(e) {
|
|
437
|
+
if (!e.length) return null;
|
|
438
|
+
let n = 0, r = e[0];
|
|
439
|
+
for (let i = 1; i < e.length; i++) {
|
|
440
|
+
let a = e[i];
|
|
441
|
+
(a.from > r.from || a.to < r.to) && (r = a, n = i);
|
|
442
|
+
}
|
|
443
|
+
let i = r instanceof TreeNode && r.index < 0 ? null : r.parent, a = e.slice();
|
|
444
|
+
return i ? a[n] = i : a.splice(n, 1), new StackIterator(a, r);
|
|
445
|
+
}
|
|
446
|
+
var StackIterator = class {
|
|
447
|
+
constructor(e, n) {
|
|
448
|
+
this.heads = e, this.node = n;
|
|
449
|
+
}
|
|
450
|
+
get next() {
|
|
451
|
+
return iterStack(this.heads);
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
function stackIterator(e, n, r) {
|
|
455
|
+
let a = e.resolveInner(n, r), o = null;
|
|
456
|
+
for (let e = a instanceof TreeNode ? a : a.context.parent; e; e = e.parent) if (e.index < 0) {
|
|
457
|
+
let i = e.parent;
|
|
458
|
+
(o ||= [a]).push(i.resolve(n, r)), e = i;
|
|
459
|
+
} else {
|
|
460
|
+
let s = MountedTree.get(e.tree);
|
|
461
|
+
if (s && s.overlay && s.overlay[0].from <= n && s.overlay[s.overlay.length - 1].to >= n) {
|
|
462
|
+
let i = new TreeNode(s.tree, s.overlay[0].from + e.from, -1, e);
|
|
463
|
+
(o ||= [a]).push(resolveNode(i, n, r, !1));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return o ? iterStack(o) : a;
|
|
467
|
+
}
|
|
468
|
+
var TreeCursor = class {
|
|
469
|
+
get name() {
|
|
470
|
+
return this.type.name;
|
|
471
|
+
}
|
|
472
|
+
constructor(e, n = 0) {
|
|
473
|
+
if (this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, this.mode = n & ~IterMode.EnterBracketed, e instanceof TreeNode) this.yieldNode(e);
|
|
474
|
+
else {
|
|
475
|
+
this._tree = e.context.parent, this.buffer = e.context;
|
|
476
|
+
for (let n = e._parent; n; n = n._parent) this.stack.unshift(n.index);
|
|
477
|
+
this.bufferNode = e, this.yieldBuf(e.index);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
yieldNode(e) {
|
|
481
|
+
return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
|
|
482
|
+
}
|
|
483
|
+
yieldBuf(e, n) {
|
|
484
|
+
this.index = e;
|
|
485
|
+
let { start: r, buffer: i } = this.buffer;
|
|
486
|
+
return this.type = n || i.set.types[i.buffer[e]], this.from = r + i.buffer[e + 1], this.to = r + i.buffer[e + 2], !0;
|
|
487
|
+
}
|
|
488
|
+
yield(e) {
|
|
489
|
+
return e ? e instanceof TreeNode ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
490
|
+
}
|
|
491
|
+
toString() {
|
|
492
|
+
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
493
|
+
}
|
|
494
|
+
enterChild(e, n, r) {
|
|
495
|
+
if (!this.buffer) return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, n, r, this.mode));
|
|
496
|
+
let { buffer: i } = this.buffer, a = i.findChild(this.index + 4, i.buffer[this.index + 3], e, n - this.buffer.start, r);
|
|
497
|
+
return a < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(a));
|
|
498
|
+
}
|
|
499
|
+
firstChild() {
|
|
500
|
+
return this.enterChild(1, 0, 4);
|
|
501
|
+
}
|
|
502
|
+
lastChild() {
|
|
503
|
+
return this.enterChild(-1, 0, 4);
|
|
504
|
+
}
|
|
505
|
+
childAfter(e) {
|
|
506
|
+
return this.enterChild(1, e, 2);
|
|
507
|
+
}
|
|
508
|
+
childBefore(e) {
|
|
509
|
+
return this.enterChild(-1, e, -2);
|
|
510
|
+
}
|
|
511
|
+
enter(e, n, r = this.mode) {
|
|
512
|
+
return this.buffer ? r & IterMode.ExcludeBuffers ? !1 : this.enterChild(1, e, n) : this.yield(this._tree.enter(e, n, r));
|
|
513
|
+
}
|
|
514
|
+
parent() {
|
|
515
|
+
if (!this.buffer) return this.yieldNode(this.mode & IterMode.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
516
|
+
if (this.stack.length) return this.yieldBuf(this.stack.pop());
|
|
517
|
+
let e = this.mode & IterMode.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
518
|
+
return this.buffer = null, this.yieldNode(e);
|
|
519
|
+
}
|
|
520
|
+
sibling(e) {
|
|
521
|
+
if (!this.buffer) return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
|
|
522
|
+
let { buffer: n } = this.buffer, r = this.stack.length - 1;
|
|
523
|
+
if (e < 0) {
|
|
524
|
+
let e = r < 0 ? 0 : this.stack[r] + 4;
|
|
525
|
+
if (this.index != e) return this.yieldBuf(n.findChild(e, this.index, -1, 0, 4));
|
|
526
|
+
} else {
|
|
527
|
+
let e = n.buffer[this.index + 3];
|
|
528
|
+
if (e < (r < 0 ? n.buffer.length : n.buffer[this.stack[r] + 3])) return this.yieldBuf(e);
|
|
529
|
+
}
|
|
530
|
+
return r < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
|
|
531
|
+
}
|
|
532
|
+
nextSibling() {
|
|
533
|
+
return this.sibling(1);
|
|
534
|
+
}
|
|
535
|
+
prevSibling() {
|
|
536
|
+
return this.sibling(-1);
|
|
537
|
+
}
|
|
538
|
+
atLastNode(e) {
|
|
539
|
+
let n, r, { buffer: i } = this;
|
|
540
|
+
if (i) {
|
|
541
|
+
if (e > 0) {
|
|
542
|
+
if (this.index < i.buffer.buffer.length) return !1;
|
|
543
|
+
} else for (let e = 0; e < this.index; e++) if (i.buffer.buffer[e + 3] < this.index) return !1;
|
|
544
|
+
({index: n, parent: r} = i);
|
|
545
|
+
} else ({index: n, _parent: r} = this._tree);
|
|
546
|
+
for (; r; {index: n, _parent: r} = r) if (n > -1) for (let i = n + e, a = e < 0 ? -1 : r._tree.children.length; i != a; i += e) {
|
|
547
|
+
let e = r._tree.children[i];
|
|
548
|
+
if (this.mode & IterMode.IncludeAnonymous || e instanceof TreeBuffer || !e.type.isAnonymous || hasChild(e)) return !1;
|
|
549
|
+
}
|
|
550
|
+
return !0;
|
|
551
|
+
}
|
|
552
|
+
move(e, n) {
|
|
553
|
+
if (n && this.enterChild(e, 0, 4)) return !0;
|
|
554
|
+
for (;;) {
|
|
555
|
+
if (this.sibling(e)) return !0;
|
|
556
|
+
if (this.atLastNode(e) || !this.parent()) return !1;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
next(e = !0) {
|
|
560
|
+
return this.move(1, e);
|
|
561
|
+
}
|
|
562
|
+
prev(e = !0) {
|
|
563
|
+
return this.move(-1, e);
|
|
564
|
+
}
|
|
565
|
+
moveTo(e, n = 0) {
|
|
566
|
+
for (; (this.from == this.to || (n < 1 ? this.from >= e : this.from > e) || (n > -1 ? this.to <= e : this.to < e)) && this.parent(););
|
|
567
|
+
for (; this.enterChild(1, e, n););
|
|
568
|
+
return this;
|
|
569
|
+
}
|
|
570
|
+
get node() {
|
|
571
|
+
if (!this.buffer) return this._tree;
|
|
572
|
+
let e = this.bufferNode, n = null, r = 0;
|
|
573
|
+
if (e && e.context == this.buffer) scan: for (let i = this.index, a = this.stack.length; a >= 0;) {
|
|
574
|
+
for (let o = e; o; o = o._parent) if (o.index == i) {
|
|
575
|
+
if (i == this.index) return o;
|
|
576
|
+
n = o, r = a + 1;
|
|
577
|
+
break scan;
|
|
578
|
+
}
|
|
579
|
+
i = this.stack[--a];
|
|
580
|
+
}
|
|
581
|
+
for (let e = r; e < this.stack.length; e++) n = new BufferNode(this.buffer, n, this.stack[e]);
|
|
582
|
+
return this.bufferNode = new BufferNode(this.buffer, n, this.index);
|
|
583
|
+
}
|
|
584
|
+
get tree() {
|
|
585
|
+
return this.buffer ? null : this._tree._tree;
|
|
586
|
+
}
|
|
587
|
+
iterate(e, n) {
|
|
588
|
+
for (let r = 0;;) {
|
|
589
|
+
let i = !1;
|
|
590
|
+
if (this.type.isAnonymous || e(this) !== !1) {
|
|
591
|
+
if (this.firstChild()) {
|
|
592
|
+
r++;
|
|
593
|
+
continue;
|
|
594
|
+
}
|
|
595
|
+
this.type.isAnonymous || (i = !0);
|
|
596
|
+
}
|
|
597
|
+
for (;;) {
|
|
598
|
+
if (i && n && n(this), i = this.type.isAnonymous, !r) return;
|
|
599
|
+
if (this.nextSibling()) break;
|
|
600
|
+
this.parent(), r--, i = !0;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
matchContext(e) {
|
|
605
|
+
if (!this.buffer) return matchNodeContext(this.node.parent, e);
|
|
606
|
+
let { buffer: n } = this.buffer, { types: r } = n.set;
|
|
607
|
+
for (let i = e.length - 1, a = this.stack.length - 1; i >= 0; a--) {
|
|
608
|
+
if (a < 0) return matchNodeContext(this._tree, e, i);
|
|
609
|
+
let o = r[n.buffer[this.stack[a]]];
|
|
610
|
+
if (!o.isAnonymous) {
|
|
611
|
+
if (e[i] && e[i] != o.name) return !1;
|
|
612
|
+
i--;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return !0;
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
function hasChild(e) {
|
|
619
|
+
return e.children.some((e) => e instanceof TreeBuffer || !e.type.isAnonymous || hasChild(e));
|
|
620
|
+
}
|
|
621
|
+
function buildTree(n) {
|
|
622
|
+
let { buffer: i, nodeSet: a, maxBufferLength: o = DefaultBufferLength, reused: s = [], minRepeatType: c = a.types.length } = n, l = Array.isArray(i) ? new FlatBufferCursor(i, i.length) : i, p = a.types, m = 0, h = 0;
|
|
623
|
+
function g(e, n, r, i, u, d) {
|
|
624
|
+
let { id: C, start: w, end: T, size: E } = l, D = h, O = m;
|
|
625
|
+
if (E < 0) if (l.next(), E == -1) {
|
|
626
|
+
let n = s[C];
|
|
627
|
+
r.push(n), i.push(w - e);
|
|
628
|
+
return;
|
|
629
|
+
} else if (E == -3) {
|
|
630
|
+
m = C;
|
|
631
|
+
return;
|
|
632
|
+
} else if (E == -4) {
|
|
633
|
+
h = C;
|
|
634
|
+
return;
|
|
635
|
+
} else throw RangeError(`Unrecognized record size: ${E}`);
|
|
636
|
+
let k = p[C], A, j, M = w - e;
|
|
637
|
+
if (T - w <= o && (j = x(l.pos - n, u))) {
|
|
638
|
+
let n = new Uint16Array(j.size - j.skip), r = l.pos - j.size, i = n.length;
|
|
639
|
+
for (; l.pos > r;) i = S(j.start, n, i);
|
|
640
|
+
A = new TreeBuffer(n, T - j.start, a), M = j.start - e;
|
|
641
|
+
} else {
|
|
642
|
+
let e = l.pos - E;
|
|
643
|
+
l.next();
|
|
644
|
+
let n = [], r = [], i = C >= c ? C : -1, a = 0, s = T;
|
|
645
|
+
for (; l.pos > e;) i >= 0 && l.id == i && l.size >= 0 ? (l.end <= s - o && (y(n, r, w, a, l.end, s, i, D, O), a = n.length, s = l.end), l.next()) : d > 2500 ? _(w, e, n, r) : g(w, e, n, r, i, d + 1);
|
|
646
|
+
if (i >= 0 && a > 0 && a < n.length && y(n, r, w, a, w, s, i, D, O), n.reverse(), r.reverse(), i > -1 && a > 0) {
|
|
647
|
+
let e = v(k, O);
|
|
648
|
+
A = balanceRange(k, n, r, 0, n.length, 0, T - w, e, e);
|
|
649
|
+
} else A = b(k, n, r, T - w, D - T, O);
|
|
650
|
+
}
|
|
651
|
+
r.push(A), i.push(M);
|
|
652
|
+
}
|
|
653
|
+
function _(e, n, r, i) {
|
|
654
|
+
let s = [], c = 0, u = -1;
|
|
655
|
+
for (; l.pos > n;) {
|
|
656
|
+
let { id: e, start: n, end: r, size: i } = l;
|
|
657
|
+
if (i > 4) l.next();
|
|
658
|
+
else if (u > -1 && n < u) break;
|
|
659
|
+
else u < 0 && (u = r - o), s.push(e, n, r), c++, l.next();
|
|
660
|
+
}
|
|
661
|
+
if (c) {
|
|
662
|
+
let n = new Uint16Array(c * 4), o = s[s.length - 2];
|
|
663
|
+
for (let e = s.length - 3, r = 0; e >= 0; e -= 3) n[r++] = s[e], n[r++] = s[e + 1] - o, n[r++] = s[e + 2] - o, n[r++] = r;
|
|
664
|
+
r.push(new TreeBuffer(n, s[2] - o, a)), i.push(o - e);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function v(e, n) {
|
|
668
|
+
return (i, a, o) => {
|
|
669
|
+
let s = 0, c = i.length - 1, l, d;
|
|
670
|
+
if (c >= 0 && (l = i[c]) instanceof Tree) {
|
|
671
|
+
if (!c && l.type == e && l.length == o) return l;
|
|
672
|
+
(d = l.prop(NodeProp.lookAhead)) && (s = a[c] + l.length + d);
|
|
673
|
+
}
|
|
674
|
+
return b(e, i, a, o, s, n);
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function y(e, n, r, i, o, s, c, l, u) {
|
|
678
|
+
let d = [], f = [];
|
|
679
|
+
for (; e.length > i;) d.push(e.pop()), f.push(n.pop() + r - o);
|
|
680
|
+
e.push(b(a.types[c], d, f, s - o, l - s, u)), n.push(o - r);
|
|
681
|
+
}
|
|
682
|
+
function b(e, n, i, a, o, s, c) {
|
|
683
|
+
if (s) {
|
|
684
|
+
let e = [NodeProp.contextHash, s];
|
|
685
|
+
c = c ? [e].concat(c) : [e];
|
|
686
|
+
}
|
|
687
|
+
if (o > 25) {
|
|
688
|
+
let e = [NodeProp.lookAhead, o];
|
|
689
|
+
c = c ? [e].concat(c) : [e];
|
|
690
|
+
}
|
|
691
|
+
return new Tree(e, n, i, a, c);
|
|
692
|
+
}
|
|
693
|
+
function x(e, n) {
|
|
694
|
+
let r = l.fork(), i = 0, a = 0, s = 0, u = r.end - o, d = {
|
|
695
|
+
size: 0,
|
|
696
|
+
start: 0,
|
|
697
|
+
skip: 0
|
|
698
|
+
};
|
|
699
|
+
scan: for (let o = r.pos - e; r.pos > o;) {
|
|
700
|
+
let e = r.size;
|
|
701
|
+
if (r.id == n && e >= 0) {
|
|
702
|
+
d.size = i, d.start = a, d.skip = s, s += 4, i += 4, r.next();
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
let l = r.pos - e;
|
|
706
|
+
if (e < 0 || l < o || r.start < u) break;
|
|
707
|
+
let f = r.id >= c ? 4 : 0, p = r.start;
|
|
708
|
+
for (r.next(); r.pos > l;) {
|
|
709
|
+
if (r.size < 0) if (r.size == -3 || r.size == -4) f += 4;
|
|
710
|
+
else break scan;
|
|
711
|
+
else r.id >= c && (f += 4);
|
|
712
|
+
r.next();
|
|
713
|
+
}
|
|
714
|
+
a = p, i += e, s += f;
|
|
715
|
+
}
|
|
716
|
+
return (n < 0 || i == e) && (d.size = i, d.start = a, d.skip = s), d.size > 4 ? d : void 0;
|
|
717
|
+
}
|
|
718
|
+
function S(e, n, r) {
|
|
719
|
+
let { id: i, start: a, end: o, size: s } = l;
|
|
720
|
+
if (l.next(), s >= 0 && i < c) {
|
|
721
|
+
let c = r;
|
|
722
|
+
if (s > 4) {
|
|
723
|
+
let i = l.pos - (s - 4);
|
|
724
|
+
for (; l.pos > i;) r = S(e, n, r);
|
|
725
|
+
}
|
|
726
|
+
n[--r] = c, n[--r] = o - e, n[--r] = a - e, n[--r] = i;
|
|
727
|
+
} else s == -3 ? m = i : s == -4 && (h = i);
|
|
728
|
+
return r;
|
|
729
|
+
}
|
|
730
|
+
let C = [], w = [];
|
|
731
|
+
for (; l.pos > 0;) g(n.start || 0, n.bufferStart || 0, C, w, -1, 0);
|
|
732
|
+
let T = n.length ?? (C.length ? w[0] + C[0].length : 0);
|
|
733
|
+
return new Tree(p[n.topID], C.reverse(), w.reverse(), T);
|
|
734
|
+
}
|
|
735
|
+
var nodeSizeCache = /* @__PURE__ */ new WeakMap();
|
|
736
|
+
function nodeSize(e, n) {
|
|
737
|
+
if (!e.isAnonymous || n instanceof TreeBuffer || n.type != e) return 1;
|
|
738
|
+
let r = nodeSizeCache.get(n);
|
|
739
|
+
if (r == null) {
|
|
740
|
+
r = 1;
|
|
741
|
+
for (let i of n.children) {
|
|
742
|
+
if (i.type != e || !(i instanceof Tree)) {
|
|
743
|
+
r = 1;
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
r += nodeSize(e, i);
|
|
747
|
+
}
|
|
748
|
+
nodeSizeCache.set(n, r);
|
|
749
|
+
}
|
|
750
|
+
return r;
|
|
751
|
+
}
|
|
752
|
+
function balanceRange(e, n, r, i, a, o, s, c, l) {
|
|
753
|
+
let u = 0;
|
|
754
|
+
for (let r = i; r < a; r++) u += nodeSize(e, n[r]);
|
|
755
|
+
let d = Math.ceil(u * 1.5 / 8), f = [], p = [];
|
|
756
|
+
function m(n, r, i, a, s) {
|
|
757
|
+
for (let c = i; c < a;) {
|
|
758
|
+
let i = c, u = r[c], h = nodeSize(e, n[c]);
|
|
759
|
+
for (c++; c < a; c++) {
|
|
760
|
+
let r = nodeSize(e, n[c]);
|
|
761
|
+
if (h + r >= d) break;
|
|
762
|
+
h += r;
|
|
763
|
+
}
|
|
764
|
+
if (c == i + 1) {
|
|
765
|
+
if (h > d) {
|
|
766
|
+
let e = n[i];
|
|
767
|
+
m(e.children, e.positions, 0, e.children.length, r[i] + s);
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
f.push(n[i]);
|
|
771
|
+
} else {
|
|
772
|
+
let a = r[c - 1] + n[c - 1].length - u;
|
|
773
|
+
f.push(balanceRange(e, n, r, i, c, u, a, null, l));
|
|
774
|
+
}
|
|
775
|
+
p.push(u + s - o);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return m(n, r, i, a, 0), (c || l)(f, p, s);
|
|
779
|
+
}
|
|
780
|
+
new NodeProp({ perNode: !0 });
|
|
781
|
+
export { NodeProp };
|