@talex-touch/tuffex 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -221
- package/dist/es/agents/index.js +1 -1
- package/dist/es/alert/index.d.ts +104 -1
- package/dist/es/alert/index.js +6 -0
- package/dist/es/alert/src/TxAlert.vue.d.ts +1 -0
- package/dist/es/alert/src/TxAlert.vue.js +2 -2
- package/dist/es/alert/src/TxAlert.vue2.js +6 -2
- package/dist/es/auto-sizer/index.js +1 -1
- package/dist/es/auto-sizer/src/TxAutoSizer.vue.js +2 -2
- package/dist/es/avatar/index.js +1 -1
- package/dist/es/avatar/src/TxAvatar.vue.js +1 -1
- package/dist/es/avatar/src/TxAvatar.vue2.js +47 -6
- package/dist/es/avatar/src/TxAvatarGroup.vue.js +1 -1
- package/dist/es/avatar/src/TxAvatarGroup.vue2.js +1 -1
- package/dist/es/avatar/src/types.d.ts +2 -1
- package/dist/es/badge/index.d.ts +78 -1
- package/dist/es/badge/index.js +6 -0
- package/dist/es/badge/src/TxBadge.vue.js +2 -2
- package/dist/es/base-anchor/index.d.ts +464 -0
- package/dist/es/base-anchor/index.js +6 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue.d.ts +124 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue.js +7 -0
- package/dist/es/base-anchor/src/TxBaseAnchor.vue2.js +798 -0
- package/dist/es/base-anchor/src/types.d.ts +36 -0
- package/dist/es/base-surface/index.d.ts +561 -0
- package/dist/es/base-surface/index.js +7 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue.d.ts +123 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue.js +1012 -0
- package/dist/es/base-surface/src/TxBaseSurface.vue2.js +6 -0
- package/dist/es/base-surface/src/style/index.css +105 -0
- package/dist/es/base-surface/src/types.d.ts +87 -0
- package/dist/es/blank-slate/index.d.ts +9 -9
- package/dist/es/blank-slate/index.js +1 -1
- package/dist/es/button/index.d.ts +45 -15
- package/dist/es/button/index.js +2 -1
- package/dist/es/button/src/button.vue.d.ts +7 -1
- package/dist/es/button/src/button.vue.js +50 -20
- package/dist/es/button/src/split-button.vue.js +31 -5
- package/dist/es/button/src/style/index.css +72 -15
- package/dist/es/button/src/types.d.ts +4 -0
- package/dist/es/card/index.d.ts +236 -56
- package/dist/es/card/index.js +1 -1
- package/dist/es/card/src/TxCard.vue.d.ts +40 -4
- package/dist/es/card/src/TxCard.vue.js +1 -1
- package/dist/es/card/src/TxCard.vue2.js +288 -57
- package/dist/es/card/src/types.d.ts +14 -1
- package/dist/es/card-item/index.d.ts +7 -7
- package/dist/es/card-item/index.js +1 -1
- package/dist/es/cascader/index.d.ts +15 -15
- package/dist/es/cascader/index.js +1 -1
- package/dist/es/cascader/src/TxCascader.vue.d.ts +1 -1
- package/dist/es/cascader/src/TxCascader.vue.js +1 -1
- package/dist/es/cascader/src/TxCascader.vue2.js +1 -3
- package/dist/es/chat/index.d.ts +18 -18
- package/dist/es/chat/index.js +1 -1
- package/dist/es/chat/src/TxChatComposer.vue.js +1 -1
- package/dist/es/chat/src/TxChatComposer.vue2.js +1 -0
- package/dist/es/chat/src/TxTypingIndicator.vue.d.ts +1 -1
- package/dist/es/code-editor/index.d.ts +387 -0
- package/dist/es/code-editor/index.js +8 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue.d.ts +117 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue.js +7 -0
- package/dist/es/code-editor/src/TxCodeEditor.vue2.js +658 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue.d.ts +40 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue.js +7 -0
- package/dist/es/code-editor/src/TxCodeEditorToolbar.vue2.js +89 -0
- package/dist/es/code-editor/src/types.d.ts +47 -0
- package/dist/es/command-palette/index.js +1 -1
- package/dist/es/command-palette/src/TxCommandPalette.vue.js +1 -1
- package/dist/es/command-palette/src/TxCommandPalette.vue2.js +128 -21
- package/dist/es/components.css +4253 -3117
- package/dist/es/components.d.ts +15 -2
- package/dist/es/components.js +44 -7
- package/dist/es/container/src/TxCol.vue.d.ts +1 -1
- package/dist/es/container/src/TxCol.vue2.js +1 -1
- package/dist/es/container/src/TxContainer.vue.d.ts +1 -1
- package/dist/es/container/src/TxRow.vue.d.ts +2 -2
- package/dist/es/container/src/TxRow.vue2.js +1 -1
- package/dist/es/context-menu/index.js +1 -1
- package/dist/es/context-menu/src/TxContextMenu.vue.js +1 -1
- package/dist/es/context-menu/src/TxContextMenu.vue2.js +4 -1
- package/dist/es/corner-overlay/index.js +1 -1
- package/dist/es/data-table/index.d.ts +15 -15
- package/dist/es/data-table/index.js +1 -1
- package/dist/es/data-table/src/TxDataTable.vue.d.ts +1 -1
- package/dist/es/date-picker/index.js +1 -1
- package/dist/es/dialog/index.js +1 -1
- package/dist/es/dialog/src/TxBlowDialog.vue.js +6 -2
- package/dist/es/dialog/src/TxBottomDialog.vue.js +1 -1
- package/dist/es/dialog/src/TxBottomDialog.vue2.js +6 -2
- package/dist/es/dialog/src/TxPopperDialog.vue.js +6 -2
- package/dist/es/dialog/src/TxTouchTip.vue.js +1 -1
- package/dist/es/dialog/src/TxTouchTip.vue2.js +25 -22
- package/dist/es/dialog/src/types.d.ts +1 -1
- package/dist/es/drawer/index.d.ts +24 -30
- package/dist/es/drawer/index.js +1 -1
- package/dist/es/drawer/src/TxDrawer.vue.d.ts +1 -4
- package/dist/es/drawer/src/TxDrawer.vue.js +8 -2
- package/dist/es/dropdown-menu/index.d.ts +81 -18
- package/dist/es/dropdown-menu/index.js +1 -1
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue.d.ts +11 -2
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue.js +1 -1
- package/dist/es/dropdown-menu/src/TxDropdownMenu.vue2.js +13 -3
- package/dist/es/dropdown-menu/src/types.d.ts +8 -1
- package/dist/es/edge-fade-mask/index.d.ts +120 -0
- package/dist/es/edge-fade-mask/index.js +6 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue.d.ts +51 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue.js +7 -0
- package/dist/es/edge-fade-mask/src/TxEdgeFadeMask.vue2.js +154 -0
- package/dist/es/edge-fade-mask/src/types.d.ts +9 -0
- package/dist/es/empty/index.js +1 -1
- package/dist/es/empty-state/index.d.ts +9 -9
- package/dist/es/empty-state/index.js +1 -1
- package/dist/es/empty-state/src/TxEmptyState.vue.js +1 -1
- package/dist/es/empty-state/src/TxEmptyState.vue2.js +25 -17
- package/dist/es/error-state/index.d.ts +131 -0
- package/dist/es/error-state/index.js +6 -0
- package/dist/es/error-state/src/TxErrorState.vue.d.ts +13 -0
- package/dist/es/error-state/src/TxErrorState.vue.js +35 -0
- package/dist/es/error-state/src/TxErrorState.vue2.js +5 -0
- package/dist/es/error-state/src/types.d.ts +3 -0
- package/dist/es/file-uploader/index.js +1 -1
- package/dist/es/flat-radio/index.d.ts +201 -0
- package/dist/es/flat-radio/index.js +8 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue.d.ts +51 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue.js +7 -0
- package/dist/es/flat-radio/src/TxFlatRadio.vue2.js +237 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue.d.ts +43 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue.js +7 -0
- package/dist/es/flat-radio/src/TxFlatRadioItem.vue2.js +87 -0
- package/dist/es/flat-radio/src/types.d.ts +28 -0
- package/dist/es/flat-radio/src/types.js +3 -0
- package/dist/es/flat-select/index.d.ts +159 -0
- package/dist/es/flat-select/index.js +8 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue.d.ts +56 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue.js +7 -0
- package/dist/es/flat-select/src/TxFlatSelect.vue2.js +208 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue.d.ts +47 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue.js +7 -0
- package/dist/es/flat-select/src/TxFlatSelectItem.vue2.js +71 -0
- package/dist/es/flat-select/src/types.d.ts +21 -0
- package/dist/es/flat-select/src/types.js +3 -0
- package/dist/es/flex/index.d.ts +33 -33
- package/dist/es/flex/index.js +1 -1
- package/dist/es/flex/src/TxFlex.vue.d.ts +3 -3
- package/dist/es/flip-overlay/index.d.ts +579 -0
- package/dist/es/flip-overlay/index.js +7 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue.d.ts +175 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue.js +982 -0
- package/dist/es/flip-overlay/src/TxFlipOverlay.vue3.js +6 -0
- package/dist/es/flip-overlay/src/types.d.ts +53 -0
- package/dist/es/floating/index.d.ts +145 -0
- package/dist/es/floating/index.js +8 -0
- package/dist/es/floating/src/TxFloating.vue.d.ts +45 -0
- package/dist/es/floating/src/TxFloating.vue.js +7 -0
- package/dist/es/floating/src/TxFloating.vue2.js +118 -0
- package/dist/es/floating/src/TxFloatingElement.vue.d.ts +39 -0
- package/dist/es/floating/src/TxFloatingElement.vue.js +7 -0
- package/dist/es/floating/src/TxFloatingElement.vue2.js +43 -0
- package/dist/es/floating/src/context.d.ts +7 -0
- package/dist/es/floating/src/context.js +3 -0
- package/dist/es/floating/src/types.d.ts +10 -0
- package/dist/es/form/index.d.ts +9 -9
- package/dist/es/form/index.js +1 -1
- package/dist/es/fusion/index.d.ts +15 -15
- package/dist/es/fusion/index.js +1 -1
- package/dist/es/fusion/src/TxFusion.vue.d.ts +1 -1
- package/dist/es/glass-surface/index.d.ts +30 -30
- package/dist/es/glass-surface/index.js +1 -1
- package/dist/es/glass-surface/src/TxGlassSurface.vue.d.ts +2 -2
- package/dist/es/glass-surface/src/TxGlassSurface.vue.js +16 -38
- package/dist/es/glow-text/index.d.ts +24 -6
- package/dist/es/glow-text/index.js +1 -1
- package/dist/es/glow-text/src/TxGlowText.vue.d.ts +3 -3
- package/dist/es/glow-text/src/TxGlowText.vue.js +1 -1
- package/dist/es/glow-text/src/TxGlowText.vue2.js +93 -10
- package/dist/es/glow-text/src/types.d.ts +2 -0
- package/dist/es/gradient-border/index.js +1 -1
- package/dist/es/gradual-blur/index.d.ts +42 -42
- package/dist/es/gradual-blur/index.js +1 -1
- package/dist/es/gradual-blur/src/TxGradualBlur.vue.d.ts +3 -3
- package/dist/es/gradual-blur/src/TxGradualBlur.vue.js +1 -1
- package/dist/es/grid/src/TxGrid.vue.d.ts +2 -2
- package/dist/es/grid/src/TxGrid.vue2.js +1 -1
- package/dist/es/grid-layout/index.js +1 -1
- package/dist/es/group-block/index.d.ts +321 -4
- package/dist/es/group-block/index.js +8 -2
- package/dist/es/group-block/src/TxBlockInput.vue.d.ts +90 -0
- package/dist/es/group-block/src/TxBlockInput.vue.js +94 -0
- package/dist/es/group-block/src/TxBlockInput.vue3.js +6 -0
- package/dist/es/group-block/src/TxBlockSelect.vue.d.ts +73 -0
- package/dist/es/group-block/src/TxBlockSelect.vue.js +76 -0
- package/dist/es/group-block/src/TxBlockSelect.vue3.js +6 -0
- package/dist/es/group-block/src/TxGroupBlock.vue.js +1 -1
- package/dist/es/group-block/src/types.d.ts +138 -0
- package/dist/es/guide-state/index.d.ts +131 -0
- package/dist/es/guide-state/index.js +6 -0
- package/dist/es/guide-state/src/TxGuideState.vue.d.ts +13 -0
- package/dist/es/guide-state/src/TxGuideState.vue.js +35 -0
- package/dist/es/guide-state/src/TxGuideState.vue2.js +5 -0
- package/dist/es/guide-state/src/types.d.ts +3 -0
- package/dist/es/icon/index.js +1 -1
- package/dist/es/icon/src/TxIcon.vue.js +1 -1
- package/dist/es/icon/src/TxIcon.vue2.js +10 -4
- package/dist/es/image-gallery/index.js +1 -1
- package/dist/es/image-uploader/index.js +1 -1
- package/dist/es/index.js +53 -13
- package/dist/es/input/index.d.ts +211 -1
- package/dist/es/input/index.js +2 -1
- package/dist/es/input/src/TxInput.vue.d.ts +21 -11
- package/dist/es/input/src/TxInput.vue.js +1 -1
- package/dist/es/input/src/TxInput.vue2.js +80 -23
- package/dist/es/keyframe-stroke-text/index.d.ts +146 -0
- package/dist/es/keyframe-stroke-text/index.js +6 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.d.ts +48 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.js +7 -0
- package/dist/es/keyframe-stroke-text/src/TxKeyframeStrokeText.vue2.js +102 -0
- package/dist/es/keyframe-stroke-text/src/types.d.ts +10 -0
- package/dist/es/layout-skeleton/index.js +1 -1
- package/dist/es/loading-overlay/index.d.ts +15 -15
- package/dist/es/loading-overlay/index.js +1 -1
- package/dist/es/loading-overlay/src/TxLoadingOverlay.vue.d.ts +1 -1
- package/dist/es/loading-overlay/src/TxLoadingOverlay.vue.js +12 -2
- package/dist/es/loading-state/index.d.ts +9 -9
- package/dist/es/loading-state/index.js +1 -1
- package/dist/es/markdown-view/index.d.ts +3 -3
- package/dist/es/markdown-view/index.js +1 -1
- package/dist/es/markdown-view/src/TxMarkdownView.vue.js +3 -2
- package/dist/es/modal/index.js +1 -1
- package/dist/es/modal/src/TxModal.vue.js +1 -1
- package/dist/es/modal/src/TxModal.vue2.js +26 -4
- package/dist/es/nav-bar/index.js +1 -1
- package/dist/es/no-data/index.d.ts +9 -9
- package/dist/es/no-data/index.js +1 -1
- package/dist/es/no-selection/index.d.ts +9 -9
- package/dist/es/no-selection/index.js +1 -1
- package/dist/es/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/properties.js +62 -0
- package/dist/es/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/toml.js +76 -0
- package/dist/es/node_modules/.pnpm/@lezer_common@1.5.0/node_modules/@lezer/common/dist/index.js +252 -0
- package/dist/es/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +682 -0
- package/dist/es/offline-state/index.d.ts +9 -9
- package/dist/es/offline-state/index.js +1 -1
- package/dist/es/outline-border/index.d.ts +18 -18
- package/dist/es/outline-border/index.js +1 -1
- package/dist/es/outline-border/src/TxOutlineBorder.vue.d.ts +1 -1
- package/dist/es/{utils → packages/tuffex/packages/utils}/toast.js +4 -1
- package/dist/es/packages/tuffex/packages/utils/z-index-manager.js +114 -0
- package/dist/es/packages/utils/env/index.js +8 -0
- package/dist/es/permission-state/index.d.ts +9 -9
- package/dist/es/permission-state/index.js +1 -1
- package/dist/es/picker/index.js +1 -1
- package/dist/es/picker/src/TxPicker.vue.js +1 -1
- package/dist/es/picker/src/TxPicker.vue2.js +6 -1
- package/dist/es/popover/index.d.ts +195 -82
- package/dist/es/popover/index.js +1 -1
- package/dist/es/popover/src/TxPopover.vue.d.ts +33 -16
- package/dist/es/popover/src/TxPopover.vue.js +1 -1
- package/dist/es/popover/src/TxPopover.vue2.js +147 -317
- package/dist/es/popover/src/types.d.ts +14 -3
- package/dist/es/progress-bar/index.d.ts +21 -21
- package/dist/es/progress-bar/index.js +1 -1
- package/dist/es/progress-bar/src/TxProgressBar.vue.d.ts +1 -1
- package/dist/es/radio/index.js +1 -1
- package/dist/es/radio/src/TxRadioGroup.vue2.js +1 -1
- package/dist/es/scroll/index.d.ts +42 -12
- package/dist/es/scroll/index.js +1 -1
- package/dist/es/scroll/src/TxScroll.vue.d.ts +11 -1
- package/dist/es/scroll/src/TxScroll.vue.js +1 -1
- package/dist/es/scroll/src/TxScroll.vue2.js +25 -13
- package/dist/es/scroll/src/runtime-capabilities.d.ts +2 -0
- package/dist/es/scroll/src/runtime-capabilities.js +67 -0
- package/dist/es/search-empty/index.d.ts +9 -9
- package/dist/es/search-empty/index.js +1 -1
- package/dist/es/search-input/index.js +1 -1
- package/dist/es/search-select/index.d.ts +9 -9
- package/dist/es/search-select/index.js +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue.d.ts +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue.js +1 -1
- package/dist/es/search-select/src/TxSearchSelect.vue2.js +105 -178
- package/dist/es/search-select/src/types.d.ts +1 -1
- package/dist/es/segmented-slider/index.js +1 -1
- package/dist/es/segmented-slider/src/TxSegmentedSlider.vue.js +1 -0
- package/dist/es/select/index.d.ts +366 -4
- package/dist/es/select/index.js +6 -9
- package/dist/es/select/src/TxSelect.vue.d.ts +23 -23
- package/dist/es/select/src/TxSelect.vue.js +2 -2
- package/dist/es/select/src/TxSelect.vue2.js +203 -152
- package/dist/es/select/src/TxSelectItem.vue.js +2 -2
- package/dist/es/select/src/TxSelectItem.vue2.js +44 -7
- package/dist/es/select/src/types.d.ts +34 -0
- package/dist/es/select/src/types.js +3 -0
- package/dist/es/skeleton/index.d.ts +7 -7
- package/dist/es/skeleton/index.js +1 -1
- package/dist/es/slider/index.d.ts +4 -4
- package/dist/es/slider/index.js +1 -1
- package/dist/es/sortable-list/index.js +1 -1
- package/dist/es/sortable-list/src/TxSortableList.vue.js +1 -1
- package/dist/es/sortable-list/src/TxSortableList.vue2.js +1 -1
- package/dist/es/spinner/index.d.ts +1 -1
- package/dist/es/spinner/index.js +1 -1
- package/dist/es/splitter/index.d.ts +15 -15
- package/dist/es/splitter/index.js +1 -1
- package/dist/es/splitter/src/TxSplitter.vue.d.ts +1 -1
- package/dist/es/stack/index.d.ts +33 -33
- package/dist/es/stack/index.js +1 -1
- package/dist/es/stack/src/TxStack.vue.d.ts +3 -3
- package/dist/es/stagger/index.d.ts +15 -15
- package/dist/es/stagger/index.js +1 -1
- package/dist/es/stagger/src/TxStagger.vue.d.ts +1 -1
- package/dist/es/stat-card/index.d.ts +46 -3
- package/dist/es/stat-card/index.js +1 -1
- package/dist/es/stat-card/src/TxStatCard.vue.d.ts +5 -1
- package/dist/es/stat-card/src/TxStatCard.vue.js +1 -1
- package/dist/es/stat-card/src/TxStatCard.vue2.js +247 -19
- package/dist/es/stat-card/src/types.d.ts +15 -0
- package/dist/es/status-badge/index.js +1 -1
- package/dist/es/switch/index.js +1 -0
- package/dist/es/tab-bar/index.d.ts +15 -15
- package/dist/es/tab-bar/index.js +1 -1
- package/dist/es/tab-bar/src/TxTabBar.vue.d.ts +1 -1
- package/dist/es/tabs/index.d.ts +18 -3
- package/dist/es/tabs/index.js +1 -1
- package/dist/es/tabs/src/TxTabs.vue.d.ts +10 -1
- package/dist/es/tabs/src/TxTabs.vue.js +1 -1
- package/dist/es/tabs/src/TxTabs.vue2.js +3 -1
- package/dist/es/tabs/src/types.d.ts +1 -0
- package/dist/es/tag/index.js +1 -1
- package/dist/es/tag-input/index.js +1 -1
- package/dist/es/text-transformer/index.d.ts +1 -1
- package/dist/es/text-transformer/index.js +1 -1
- package/dist/es/toast/index.js +1 -1
- package/dist/es/toast/src/TxToastHost.vue.js +18 -17
- package/dist/es/tooltip/index.d.ts +75 -178
- package/dist/es/tooltip/index.js +1 -1
- package/dist/es/tooltip/src/TxTooltip.vue.d.ts +21 -40
- package/dist/es/tooltip/src/TxTooltip.vue.js +1 -1
- package/dist/es/tooltip/src/TxTooltip.vue2.js +102 -350
- package/dist/es/tooltip/src/types.d.ts +8 -13
- package/dist/es/transfer/index.d.ts +131 -0
- package/dist/es/transfer/index.js +6 -0
- package/dist/es/transfer/src/TxTransfer.vue.d.ts +48 -0
- package/dist/es/transfer/src/TxTransfer.vue.js +7 -0
- package/dist/es/transfer/src/TxTransfer.vue2.js +217 -0
- package/dist/es/transfer/src/types.d.ts +17 -0
- package/dist/es/transition/index.d.ts +30 -30
- package/dist/es/transition/index.js +1 -1
- package/dist/es/transition/src/TxTransition.vue.d.ts +1 -1
- package/dist/es/transition/src/TxTransitionSmoothSize.vue.d.ts +1 -1
- package/dist/es/tree/index.d.ts +15 -15
- package/dist/es/tree/index.js +1 -1
- package/dist/es/tree/src/TxTree.vue.d.ts +1 -1
- package/dist/es/tree/src/TxTree.vue.js +1 -1
- package/dist/es/tree/src/TxTree.vue2.js +3 -2
- package/dist/es/tree/src/types.d.ts +1 -0
- package/dist/es/tree-select/index.d.ts +9 -9
- package/dist/es/tree-select/index.js +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue.d.ts +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue.js +1 -1
- package/dist/es/tree-select/src/TxTreeSelect.vue2.js +0 -2
- package/dist/es/tuff-logo-stroke/index.d.ts +146 -0
- package/dist/es/tuff-logo-stroke/index.js +6 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue.d.ts +48 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue.js +7 -0
- package/dist/es/tuff-logo-stroke/src/TxTuffLogoStroke.vue2.js +147 -0
- package/dist/es/tuff-logo-stroke/src/types.d.ts +10 -0
- package/dist/es/virtual-list/index.js +1 -1
- package/dist/lib/agents/index.js +1 -1
- package/dist/lib/alert/index.js +11 -0
- package/dist/lib/alert/src/TxAlert.vue.js +2 -2
- package/dist/lib/alert/src/TxAlert.vue2.js +5 -1
- package/dist/lib/auto-sizer/index.js +1 -1
- package/dist/lib/auto-sizer/src/TxAutoSizer.vue.js +2 -2
- package/dist/lib/avatar/index.js +1 -1
- package/dist/lib/avatar/src/TxAvatar.vue.js +1 -1
- package/dist/lib/avatar/src/TxAvatar.vue2.js +47 -6
- package/dist/lib/avatar/src/TxAvatarGroup.vue.js +1 -1
- package/dist/lib/avatar/src/TxAvatarGroup.vue2.js +1 -1
- package/dist/lib/badge/index.js +11 -0
- package/dist/lib/badge/src/TxBadge.vue.js +2 -2
- package/dist/lib/base-anchor/index.js +12 -0
- package/dist/lib/base-anchor/src/TxBaseAnchor.vue.js +11 -0
- package/dist/lib/base-anchor/src/TxBaseAnchor.vue2.js +802 -0
- package/dist/lib/base-surface/index.js +13 -0
- package/dist/lib/base-surface/src/TxBaseSurface.vue.js +1016 -0
- package/dist/lib/base-surface/src/TxBaseSurface.vue2.js +10 -0
- package/dist/lib/base-surface/src/style/index.css +105 -0
- package/dist/lib/blank-slate/index.js +1 -1
- package/dist/lib/button/index.js +2 -1
- package/dist/lib/button/src/button.vue.js +49 -19
- package/dist/lib/button/src/split-button.vue.js +30 -4
- package/dist/lib/button/src/style/index.css +72 -15
- package/dist/lib/card/index.js +1 -1
- package/dist/lib/card/src/TxCard.vue.js +1 -1
- package/dist/lib/card/src/TxCard.vue2.js +285 -54
- package/dist/lib/card-item/index.js +1 -1
- package/dist/lib/cascader/index.js +1 -1
- package/dist/lib/cascader/src/TxCascader.vue.js +1 -1
- package/dist/lib/cascader/src/TxCascader.vue2.js +1 -3
- package/dist/lib/chat/index.js +1 -1
- package/dist/lib/chat/src/TxChatComposer.vue.js +1 -1
- package/dist/lib/chat/src/TxChatComposer.vue2.js +1 -0
- package/dist/lib/code-editor/index.js +16 -0
- package/dist/lib/code-editor/src/TxCodeEditor.vue.js +11 -0
- package/dist/lib/code-editor/src/TxCodeEditor.vue2.js +662 -0
- package/dist/lib/code-editor/src/TxCodeEditorToolbar.vue.js +11 -0
- package/dist/lib/code-editor/src/TxCodeEditorToolbar.vue2.js +93 -0
- package/dist/lib/command-palette/index.js +1 -1
- package/dist/lib/command-palette/src/TxCommandPalette.vue.js +1 -1
- package/dist/lib/command-palette/src/TxCommandPalette.vue2.js +127 -20
- package/dist/lib/components.css +4253 -3117
- package/dist/lib/components.js +255 -178
- package/dist/lib/container/src/TxCol.vue2.js +1 -1
- package/dist/lib/container/src/TxRow.vue2.js +1 -1
- package/dist/lib/context-menu/index.js +1 -1
- package/dist/lib/context-menu/src/TxContextMenu.vue.js +1 -1
- package/dist/lib/context-menu/src/TxContextMenu.vue2.js +4 -1
- package/dist/lib/corner-overlay/index.js +1 -1
- package/dist/lib/data-table/index.js +1 -1
- package/dist/lib/date-picker/index.js +1 -1
- package/dist/lib/dialog/index.js +1 -1
- package/dist/lib/dialog/src/TxBlowDialog.vue.js +5 -1
- package/dist/lib/dialog/src/TxBottomDialog.vue.js +1 -1
- package/dist/lib/dialog/src/TxBottomDialog.vue2.js +5 -1
- package/dist/lib/dialog/src/TxPopperDialog.vue.js +5 -1
- package/dist/lib/dialog/src/TxTouchTip.vue.js +1 -1
- package/dist/lib/dialog/src/TxTouchTip.vue2.js +24 -21
- package/dist/lib/drawer/index.js +1 -1
- package/dist/lib/drawer/src/TxDrawer.vue.js +8 -2
- package/dist/lib/dropdown-menu/index.js +1 -1
- package/dist/lib/dropdown-menu/src/TxDropdownMenu.vue.js +1 -1
- package/dist/lib/dropdown-menu/src/TxDropdownMenu.vue2.js +13 -3
- package/dist/lib/edge-fade-mask/index.js +12 -0
- package/dist/lib/edge-fade-mask/src/TxEdgeFadeMask.vue.js +11 -0
- package/dist/lib/edge-fade-mask/src/TxEdgeFadeMask.vue2.js +158 -0
- package/dist/lib/empty/index.js +1 -1
- package/dist/lib/empty-state/index.js +1 -1
- package/dist/lib/empty-state/src/TxEmptyState.vue.js +1 -1
- package/dist/lib/empty-state/src/TxEmptyState.vue2.js +25 -17
- package/dist/lib/error-state/index.js +11 -0
- package/dist/lib/error-state/src/TxErrorState.vue.js +39 -0
- package/dist/lib/error-state/src/TxErrorState.vue2.js +9 -0
- package/dist/lib/file-uploader/index.js +1 -1
- package/dist/lib/flat-radio/index.js +16 -0
- package/dist/lib/flat-radio/src/TxFlatRadio.vue.js +11 -0
- package/dist/lib/flat-radio/src/TxFlatRadio.vue2.js +241 -0
- package/dist/lib/flat-radio/src/TxFlatRadioItem.vue.js +11 -0
- package/dist/lib/flat-radio/src/TxFlatRadioItem.vue2.js +91 -0
- package/dist/lib/flat-radio/src/types.js +7 -0
- package/dist/lib/flat-select/index.js +16 -0
- package/dist/lib/flat-select/src/TxFlatSelect.vue.js +11 -0
- package/dist/lib/flat-select/src/TxFlatSelect.vue2.js +212 -0
- package/dist/lib/flat-select/src/TxFlatSelectItem.vue.js +11 -0
- package/dist/lib/flat-select/src/TxFlatSelectItem.vue2.js +75 -0
- package/dist/lib/flat-select/src/types.js +7 -0
- package/dist/lib/flex/index.js +1 -1
- package/dist/lib/flip-overlay/index.js +13 -0
- package/dist/lib/flip-overlay/src/TxFlipOverlay.vue.js +986 -0
- package/dist/lib/flip-overlay/src/TxFlipOverlay.vue3.js +10 -0
- package/dist/lib/floating/index.js +16 -0
- package/dist/lib/floating/src/TxFloating.vue.js +11 -0
- package/dist/lib/floating/src/TxFloating.vue2.js +122 -0
- package/dist/lib/floating/src/TxFloatingElement.vue.js +11 -0
- package/dist/lib/floating/src/TxFloatingElement.vue2.js +47 -0
- package/dist/lib/floating/src/context.js +7 -0
- package/dist/lib/form/index.js +1 -1
- package/dist/lib/fusion/index.js +1 -1
- package/dist/lib/glass-surface/index.js +1 -1
- package/dist/lib/glass-surface/src/TxGlassSurface.vue.js +15 -37
- package/dist/lib/glow-text/index.js +1 -1
- package/dist/lib/glow-text/src/TxGlowText.vue.js +1 -1
- package/dist/lib/glow-text/src/TxGlowText.vue2.js +92 -9
- package/dist/lib/gradient-border/index.js +1 -1
- package/dist/lib/gradual-blur/index.js +1 -1
- package/dist/lib/gradual-blur/src/TxGradualBlur.vue.js +1 -1
- package/dist/lib/grid/src/TxGrid.vue2.js +1 -1
- package/dist/lib/grid-layout/index.js +1 -1
- package/dist/lib/group-block/index.js +11 -1
- package/dist/lib/group-block/src/TxBlockInput.vue.js +98 -0
- package/dist/lib/group-block/src/TxBlockInput.vue3.js +10 -0
- package/dist/lib/group-block/src/TxBlockSelect.vue.js +80 -0
- package/dist/lib/group-block/src/TxBlockSelect.vue3.js +10 -0
- package/dist/lib/group-block/src/TxGroupBlock.vue.js +1 -1
- package/dist/lib/guide-state/index.js +11 -0
- package/dist/lib/guide-state/src/TxGuideState.vue.js +39 -0
- package/dist/lib/guide-state/src/TxGuideState.vue2.js +9 -0
- package/dist/lib/icon/index.js +1 -1
- package/dist/lib/icon/src/TxIcon.vue.js +1 -1
- package/dist/lib/icon/src/TxIcon.vue2.js +9 -3
- package/dist/lib/image-gallery/index.js +1 -1
- package/dist/lib/image-uploader/index.js +1 -1
- package/dist/lib/index.js +269 -182
- package/dist/lib/input/index.js +7 -5
- package/dist/lib/input/src/TxInput.vue.js +1 -1
- package/dist/lib/input/src/TxInput.vue2.js +79 -22
- package/dist/lib/keyframe-stroke-text/index.js +12 -0
- package/dist/lib/keyframe-stroke-text/src/TxKeyframeStrokeText.vue.js +11 -0
- package/dist/lib/keyframe-stroke-text/src/TxKeyframeStrokeText.vue2.js +106 -0
- package/dist/lib/layout-skeleton/index.js +1 -1
- package/dist/lib/loading-overlay/index.js +1 -1
- package/dist/lib/loading-overlay/src/TxLoadingOverlay.vue.js +11 -1
- package/dist/lib/loading-state/index.js +1 -1
- package/dist/lib/markdown-view/index.js +1 -1
- package/dist/lib/markdown-view/src/TxMarkdownView.vue.js +3 -2
- package/dist/lib/modal/index.js +1 -1
- package/dist/lib/modal/src/TxModal.vue.js +1 -1
- package/dist/lib/modal/src/TxModal.vue2.js +25 -3
- package/dist/lib/nav-bar/index.js +1 -1
- package/dist/lib/no-data/index.js +1 -1
- package/dist/lib/no-selection/index.js +1 -1
- package/dist/lib/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/properties.js +66 -0
- package/dist/lib/node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/toml.js +80 -0
- package/dist/lib/node_modules/.pnpm/@lezer_common@1.5.0/node_modules/@lezer/common/dist/index.js +257 -0
- package/dist/lib/node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js +688 -0
- package/dist/lib/offline-state/index.js +1 -1
- package/dist/lib/outline-border/index.js +1 -1
- package/dist/lib/{utils → packages/tuffex/packages/utils}/toast.js +4 -1
- package/dist/lib/packages/tuffex/packages/utils/z-index-manager.js +124 -0
- package/dist/lib/packages/utils/env/index.js +13 -0
- package/dist/lib/permission-state/index.js +1 -1
- package/dist/lib/picker/index.js +1 -1
- package/dist/lib/picker/src/TxPicker.vue.js +1 -1
- package/dist/lib/picker/src/TxPicker.vue2.js +6 -1
- package/dist/lib/popover/index.js +1 -1
- package/dist/lib/popover/src/TxPopover.vue.js +1 -1
- package/dist/lib/popover/src/TxPopover.vue2.js +146 -316
- package/dist/lib/progress-bar/index.js +1 -1
- package/dist/lib/radio/index.js +1 -1
- package/dist/lib/radio/src/TxRadioGroup.vue2.js +1 -1
- package/dist/lib/scroll/index.js +1 -1
- package/dist/lib/scroll/src/TxScroll.vue.js +1 -1
- package/dist/lib/scroll/src/TxScroll.vue2.js +25 -13
- package/dist/lib/scroll/src/runtime-capabilities.js +72 -0
- package/dist/lib/search-empty/index.js +1 -1
- package/dist/lib/search-input/index.js +1 -1
- package/dist/lib/search-select/index.js +1 -1
- package/dist/lib/search-select/src/TxSearchSelect.vue.js +1 -1
- package/dist/lib/search-select/src/TxSearchSelect.vue2.js +104 -177
- package/dist/lib/segmented-slider/index.js +1 -1
- package/dist/lib/segmented-slider/src/TxSegmentedSlider.vue.js +1 -0
- package/dist/lib/select/index.js +6 -9
- package/dist/lib/select/src/TxSelect.vue.js +2 -2
- package/dist/lib/select/src/TxSelect.vue2.js +202 -151
- package/dist/lib/select/src/TxSelectItem.vue.js +2 -2
- package/dist/lib/select/src/TxSelectItem.vue2.js +43 -6
- package/dist/lib/select/src/types.js +7 -0
- package/dist/lib/skeleton/index.js +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/sortable-list/index.js +1 -1
- package/dist/lib/sortable-list/src/TxSortableList.vue.js +1 -1
- package/dist/lib/sortable-list/src/TxSortableList.vue2.js +1 -1
- package/dist/lib/spinner/index.js +1 -1
- package/dist/lib/splitter/index.js +1 -1
- package/dist/lib/stack/index.js +1 -1
- package/dist/lib/stagger/index.js +1 -1
- package/dist/lib/stat-card/index.js +1 -1
- package/dist/lib/stat-card/src/TxStatCard.vue.js +1 -1
- package/dist/lib/stat-card/src/TxStatCard.vue2.js +246 -18
- package/dist/lib/status-badge/index.js +1 -1
- package/dist/lib/switch/index.js +1 -0
- package/dist/lib/tab-bar/index.js +1 -1
- package/dist/lib/tabs/index.js +1 -1
- package/dist/lib/tabs/src/TxTabs.vue.js +1 -1
- package/dist/lib/tabs/src/TxTabs.vue2.js +3 -1
- package/dist/lib/tag/index.js +1 -1
- package/dist/lib/tag-input/index.js +1 -1
- package/dist/lib/text-transformer/index.js +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/src/TxToastHost.vue.js +17 -16
- package/dist/lib/tooltip/index.js +1 -1
- package/dist/lib/tooltip/src/TxTooltip.vue.js +1 -1
- package/dist/lib/tooltip/src/TxTooltip.vue2.js +101 -349
- package/dist/lib/transfer/index.js +12 -0
- package/dist/lib/transfer/src/TxTransfer.vue.js +11 -0
- package/dist/lib/transfer/src/TxTransfer.vue2.js +221 -0
- package/dist/lib/transition/index.js +1 -1
- package/dist/lib/tree/index.js +1 -1
- package/dist/lib/tree/src/TxTree.vue.js +1 -1
- package/dist/lib/tree/src/TxTree.vue2.js +3 -2
- package/dist/lib/tree-select/index.js +1 -1
- package/dist/lib/tree-select/src/TxTreeSelect.vue.js +1 -1
- package/dist/lib/tree-select/src/TxTreeSelect.vue2.js +0 -2
- package/dist/lib/tuff-logo-stroke/index.js +12 -0
- package/dist/lib/tuff-logo-stroke/src/TxTuffLogoStroke.vue.js +11 -0
- package/dist/lib/tuff-logo-stroke/src/TxTuffLogoStroke.vue2.js +151 -0
- package/dist/lib/virtual-list/index.js +1 -1
- package/package.json +37 -25
- package/dist/es/button/__tests__/button.test.d.ts +0 -1
- package/dist/es/button/__tests__/split-button.test.d.ts +0 -1
- package/dist/es/cascader/__tests__/cascader.test.d.ts +0 -1
- package/dist/es/command-palette/__tests__/command-palette.test.d.ts +0 -1
- package/dist/es/data-table/__tests__/data-table.test.d.ts +0 -1
- package/dist/es/file-uploader/__tests__/file-uploader.test.d.ts +0 -1
- package/dist/es/form/__tests__/form.test.d.ts +0 -1
- package/dist/es/search-select/__tests__/search-select.test.d.ts +0 -1
- package/dist/es/tag-input/__tests__/tag-input.test.d.ts +0 -1
- package/dist/es/tree/__tests__/tree.test.d.ts +0 -1
- package/dist/es/tree-select/__tests__/tree-select.test.d.ts +0 -1
- package/dist/es/virtual-list/__tests__/virtual-list.test.d.ts +0 -1
- /package/dist/es/{utils → packages/tuffex/packages/utils}/animation/auto-resize.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/animation/flip.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/dialog-manager.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/env.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/vibrate.js +0 -0
- /package/dist/es/{utils → packages/tuffex/packages/utils}/withInstall.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/animation/auto-resize.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/animation/flip.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/dialog-manager.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/env.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/vibrate.js +0 -0
- /package/dist/lib/{utils → packages/tuffex/packages/utils}/withInstall.js +0 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, createElementVNode, renderSlot } from 'vue';
|
|
2
|
+
import { EditorState, StateEffect } from '@codemirror/state';
|
|
3
|
+
import { EditorView, drawSelection, highlightActiveLine, keymap, lineNumbers, highlightActiveLineGutter, placeholder } from '@codemirror/view';
|
|
4
|
+
import { foldAll, unfoldAll, syntaxHighlighting, indentUnit, bracketMatching, foldGutter, foldKeymap, StreamLanguage, HighlightStyle } from '@codemirror/language';
|
|
5
|
+
import { tags } from '../../node_modules/.pnpm/@lezer_highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js';
|
|
6
|
+
import { completionKeymap, closeBracketsKeymap, autocompletion, closeBrackets } from '@codemirror/autocomplete';
|
|
7
|
+
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands';
|
|
8
|
+
import { openSearchPanel, searchKeymap, search } from '@codemirror/search';
|
|
9
|
+
import { lintKeymap, lintGutter, linter } from '@codemirror/lint';
|
|
10
|
+
import { json, jsonParseLinter } from '@codemirror/lang-json';
|
|
11
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
12
|
+
import { yaml } from '@codemirror/lang-yaml';
|
|
13
|
+
import { properties } from '../../node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/properties.js';
|
|
14
|
+
import { toml } from '../../node_modules/.pnpm/@codemirror_legacy-modes@6.5.2/node_modules/@codemirror/legacy-modes/mode/toml.js';
|
|
15
|
+
import { parse, stringify, parseDocument } from 'yaml';
|
|
16
|
+
import { hasDocument, hasNavigator } from '../../packages/utils/env/index.js';
|
|
17
|
+
|
|
18
|
+
const _hoisted_1 = ["data-theme"];
|
|
19
|
+
const _hoisted_2 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "tx-code-editor__toolbar"
|
|
22
|
+
};
|
|
23
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
|
+
...{
|
|
25
|
+
name: "TxCodeEditor"
|
|
26
|
+
},
|
|
27
|
+
__name: "TxCodeEditor",
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: { default: "" },
|
|
30
|
+
language: { default: "json" },
|
|
31
|
+
theme: { default: "auto" },
|
|
32
|
+
readOnly: { type: Boolean, default: false },
|
|
33
|
+
lineNumbers: { type: Boolean, default: true },
|
|
34
|
+
lineWrapping: { type: Boolean, default: false },
|
|
35
|
+
placeholder: { default: "" },
|
|
36
|
+
tabSize: { default: 2 },
|
|
37
|
+
formatOnBlur: { type: Boolean, default: false },
|
|
38
|
+
formatOnInit: { type: Boolean, default: false },
|
|
39
|
+
lint: { type: Boolean, default: true },
|
|
40
|
+
search: { type: Boolean, default: true },
|
|
41
|
+
completion: { type: Boolean, default: true },
|
|
42
|
+
extensions: { default: () => [] }
|
|
43
|
+
},
|
|
44
|
+
emits: ["update:modelValue", "change", "focus", "blur", "format"],
|
|
45
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
46
|
+
const props = __props;
|
|
47
|
+
const emit = __emit;
|
|
48
|
+
const containerRef = ref(null);
|
|
49
|
+
const viewRef = ref(null);
|
|
50
|
+
const isFocused = ref(false);
|
|
51
|
+
const autoTheme = ref("light");
|
|
52
|
+
let themeObserver = null;
|
|
53
|
+
let suppressEmit = false;
|
|
54
|
+
let allowEmit = false;
|
|
55
|
+
const baseTheme = EditorView.theme({
|
|
56
|
+
"&": {
|
|
57
|
+
fontSize: "13px",
|
|
58
|
+
fontFamily: "var(--tx-font-family-mono, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace)",
|
|
59
|
+
backgroundColor: "transparent"
|
|
60
|
+
},
|
|
61
|
+
".cm-content": {
|
|
62
|
+
padding: "12px"
|
|
63
|
+
},
|
|
64
|
+
".cm-scroller": {
|
|
65
|
+
fontFamily: "inherit"
|
|
66
|
+
},
|
|
67
|
+
".cm-gutters": {
|
|
68
|
+
border: "none"
|
|
69
|
+
},
|
|
70
|
+
"&.cm-focused": {
|
|
71
|
+
outline: "none"
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const themePalettes = {
|
|
75
|
+
light: {
|
|
76
|
+
dark: false,
|
|
77
|
+
background: "var(--tx-fill-color-blank, #ffffff)",
|
|
78
|
+
text: "var(--tx-text-color-primary, #303133)",
|
|
79
|
+
gutter: "var(--tx-fill-color-lighter, #fafafa)",
|
|
80
|
+
gutterText: "var(--tx-text-color-secondary, #909399)",
|
|
81
|
+
border: "var(--tx-border-color, #dcdfe6)",
|
|
82
|
+
selection: "color-mix(in srgb, var(--tx-color-primary, #409eff) 20%, transparent)",
|
|
83
|
+
activeLine: "var(--tx-fill-color-lighter, #fafafa)",
|
|
84
|
+
cursor: "var(--tx-color-primary, #409eff)",
|
|
85
|
+
toolbarBg: "color-mix(in srgb, var(--tx-fill-color-blank, #ffffff) 88%, transparent)"
|
|
86
|
+
},
|
|
87
|
+
dark: {
|
|
88
|
+
dark: true,
|
|
89
|
+
background: "#0d1117",
|
|
90
|
+
text: "#e6edf3",
|
|
91
|
+
gutter: "#0d1117",
|
|
92
|
+
gutterText: "#7d8590",
|
|
93
|
+
border: "#30363d",
|
|
94
|
+
selection: "rgba(56, 139, 253, 0.3)",
|
|
95
|
+
activeLine: "#161b22",
|
|
96
|
+
cursor: "#58a6ff",
|
|
97
|
+
toolbarBg: "rgba(22, 27, 34, 0.9)"
|
|
98
|
+
},
|
|
99
|
+
github: {
|
|
100
|
+
dark: false,
|
|
101
|
+
background: "#ffffff",
|
|
102
|
+
text: "#24292f",
|
|
103
|
+
gutter: "#f6f8fa",
|
|
104
|
+
gutterText: "#57606a",
|
|
105
|
+
border: "#d0d7de",
|
|
106
|
+
selection: "#b6d6fd",
|
|
107
|
+
activeLine: "#f6f8fa",
|
|
108
|
+
cursor: "#0969da",
|
|
109
|
+
toolbarBg: "#f6f8fa"
|
|
110
|
+
},
|
|
111
|
+
dracula: {
|
|
112
|
+
dark: true,
|
|
113
|
+
background: "#282a36",
|
|
114
|
+
text: "#f8f8f2",
|
|
115
|
+
gutter: "#282a36",
|
|
116
|
+
gutterText: "#6272a4",
|
|
117
|
+
border: "#44475a",
|
|
118
|
+
selection: "#44475a",
|
|
119
|
+
activeLine: "#343746",
|
|
120
|
+
cursor: "#ff79c6",
|
|
121
|
+
toolbarBg: "#2b2d3a"
|
|
122
|
+
},
|
|
123
|
+
monokai: {
|
|
124
|
+
dark: true,
|
|
125
|
+
background: "#272822",
|
|
126
|
+
text: "#f8f8f2",
|
|
127
|
+
gutter: "#272822",
|
|
128
|
+
gutterText: "#75715e",
|
|
129
|
+
border: "#3e3d32",
|
|
130
|
+
selection: "#49483e",
|
|
131
|
+
activeLine: "#3e3d32",
|
|
132
|
+
cursor: "#f8f8f2",
|
|
133
|
+
toolbarBg: "#2f2f2a"
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const highlightPalettes = {
|
|
137
|
+
light: {
|
|
138
|
+
keyword: "#cf222e",
|
|
139
|
+
atom: "#0550ae",
|
|
140
|
+
number: "#0550ae",
|
|
141
|
+
string: "#0a3069",
|
|
142
|
+
comment: "#6e7781",
|
|
143
|
+
variable: "#24292f",
|
|
144
|
+
type: "#8250df",
|
|
145
|
+
property: "#0550ae",
|
|
146
|
+
punctuation: "#24292f",
|
|
147
|
+
operator: "#cf222e",
|
|
148
|
+
emphasis: "#1f6feb"
|
|
149
|
+
},
|
|
150
|
+
dark: {
|
|
151
|
+
keyword: "#ff7b72",
|
|
152
|
+
atom: "#79c0ff",
|
|
153
|
+
number: "#79c0ff",
|
|
154
|
+
string: "#a5d6ff",
|
|
155
|
+
comment: "#8b949e",
|
|
156
|
+
variable: "#e6edf3",
|
|
157
|
+
type: "#d2a8ff",
|
|
158
|
+
property: "#79c0ff",
|
|
159
|
+
punctuation: "#e6edf3",
|
|
160
|
+
operator: "#ff7b72",
|
|
161
|
+
emphasis: "#58a6ff"
|
|
162
|
+
},
|
|
163
|
+
github: {
|
|
164
|
+
keyword: "#cf222e",
|
|
165
|
+
atom: "#0550ae",
|
|
166
|
+
number: "#0550ae",
|
|
167
|
+
string: "#0a3069",
|
|
168
|
+
comment: "#6e7781",
|
|
169
|
+
variable: "#24292f",
|
|
170
|
+
type: "#8250df",
|
|
171
|
+
property: "#0550ae",
|
|
172
|
+
punctuation: "#24292f",
|
|
173
|
+
operator: "#cf222e",
|
|
174
|
+
emphasis: "#1f6feb"
|
|
175
|
+
},
|
|
176
|
+
dracula: {
|
|
177
|
+
keyword: "#ff79c6",
|
|
178
|
+
atom: "#bd93f9",
|
|
179
|
+
number: "#bd93f9",
|
|
180
|
+
string: "#f1fa8c",
|
|
181
|
+
comment: "#6272a4",
|
|
182
|
+
variable: "#f8f8f2",
|
|
183
|
+
type: "#8be9fd",
|
|
184
|
+
property: "#50fa7b",
|
|
185
|
+
punctuation: "#f8f8f2",
|
|
186
|
+
operator: "#ff79c6",
|
|
187
|
+
emphasis: "#8be9fd"
|
|
188
|
+
},
|
|
189
|
+
monokai: {
|
|
190
|
+
keyword: "#f92672",
|
|
191
|
+
atom: "#ae81ff",
|
|
192
|
+
number: "#ae81ff",
|
|
193
|
+
string: "#e6db74",
|
|
194
|
+
comment: "#75715e",
|
|
195
|
+
variable: "#f8f8f2",
|
|
196
|
+
type: "#66d9ef",
|
|
197
|
+
property: "#a6e22e",
|
|
198
|
+
punctuation: "#f8f8f2",
|
|
199
|
+
operator: "#f92672",
|
|
200
|
+
emphasis: "#66d9ef"
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
function resolveAutoTheme() {
|
|
204
|
+
if (!hasDocument())
|
|
205
|
+
return "light";
|
|
206
|
+
const root = document.documentElement;
|
|
207
|
+
const body = document.body;
|
|
208
|
+
const dataTheme = root.getAttribute("data-theme") || body?.getAttribute("data-theme");
|
|
209
|
+
if (dataTheme === "dark")
|
|
210
|
+
return "dark";
|
|
211
|
+
if (dataTheme === "light")
|
|
212
|
+
return "light";
|
|
213
|
+
if (root.classList.contains("dark") || body?.classList.contains("dark"))
|
|
214
|
+
return "dark";
|
|
215
|
+
if (root.classList.contains("light") || body?.classList.contains("light"))
|
|
216
|
+
return "light";
|
|
217
|
+
return "light";
|
|
218
|
+
}
|
|
219
|
+
function syncAutoTheme() {
|
|
220
|
+
autoTheme.value = resolveAutoTheme();
|
|
221
|
+
}
|
|
222
|
+
function setupThemeObserver() {
|
|
223
|
+
if (!hasDocument() || typeof MutationObserver === "undefined")
|
|
224
|
+
return;
|
|
225
|
+
const root = document.documentElement;
|
|
226
|
+
themeObserver?.disconnect();
|
|
227
|
+
themeObserver = new MutationObserver(() => {
|
|
228
|
+
syncAutoTheme();
|
|
229
|
+
});
|
|
230
|
+
themeObserver.observe(root, {
|
|
231
|
+
attributes: true,
|
|
232
|
+
attributeFilter: ["class", "data-theme"]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
const resolvedTheme = computed(() => {
|
|
236
|
+
const theme = props.theme ?? "auto";
|
|
237
|
+
if (theme === "auto")
|
|
238
|
+
return autoTheme.value;
|
|
239
|
+
return theme;
|
|
240
|
+
});
|
|
241
|
+
const themeStyles = computed(() => themePalettes[resolvedTheme.value]);
|
|
242
|
+
const rootStyle = computed(() => ({
|
|
243
|
+
"--tx-code-editor-bg": themeStyles.value.background,
|
|
244
|
+
"--tx-code-editor-border": themeStyles.value.border,
|
|
245
|
+
"--tx-code-editor-toolbar-bg": themeStyles.value.toolbarBg,
|
|
246
|
+
"--tx-code-editor-text": themeStyles.value.text,
|
|
247
|
+
"--tx-code-editor-focus": themeStyles.value.cursor
|
|
248
|
+
}));
|
|
249
|
+
function normalizeTabSize(value) {
|
|
250
|
+
if (!value || Number.isNaN(value) || value < 1)
|
|
251
|
+
return 2;
|
|
252
|
+
return Math.round(value);
|
|
253
|
+
}
|
|
254
|
+
function createHighlightStyle(theme) {
|
|
255
|
+
const palette = highlightPalettes[theme];
|
|
256
|
+
return HighlightStyle.define([
|
|
257
|
+
{ tag: tags.keyword, color: palette.keyword },
|
|
258
|
+
{ tag: [tags.atom, tags.bool, tags.null], color: palette.atom },
|
|
259
|
+
{ tag: [tags.number, tags.integer, tags.float], color: palette.number },
|
|
260
|
+
{ tag: [tags.string, tags.special(tags.string)], color: palette.string },
|
|
261
|
+
{ tag: [tags.comment, tags.lineComment, tags.blockComment], color: palette.comment, fontStyle: "italic" },
|
|
262
|
+
{ tag: [tags.variableName, tags.definition(tags.variableName)], color: palette.variable },
|
|
263
|
+
{ tag: [tags.typeName, tags.className], color: palette.type },
|
|
264
|
+
{ tag: [tags.propertyName, tags.attributeName], color: palette.property },
|
|
265
|
+
{ tag: tags.operator, color: palette.operator },
|
|
266
|
+
{ tag: tags.punctuation, color: palette.punctuation },
|
|
267
|
+
{ tag: tags.emphasis, color: palette.emphasis, fontStyle: "italic" },
|
|
268
|
+
{ tag: tags.strong, fontWeight: "700" },
|
|
269
|
+
{ tag: tags.link, color: palette.emphasis, textDecoration: "underline" }
|
|
270
|
+
]);
|
|
271
|
+
}
|
|
272
|
+
function createEditorTheme(theme) {
|
|
273
|
+
const palette = themePalettes[theme];
|
|
274
|
+
return EditorView.theme(
|
|
275
|
+
{
|
|
276
|
+
"&": {
|
|
277
|
+
color: palette.text,
|
|
278
|
+
backgroundColor: palette.background
|
|
279
|
+
},
|
|
280
|
+
".cm-content": {
|
|
281
|
+
caretColor: palette.cursor
|
|
282
|
+
},
|
|
283
|
+
".cm-gutters": {
|
|
284
|
+
backgroundColor: palette.gutter,
|
|
285
|
+
color: palette.gutterText,
|
|
286
|
+
borderRight: `1px solid ${palette.border}`
|
|
287
|
+
},
|
|
288
|
+
".cm-activeLine": {
|
|
289
|
+
backgroundColor: palette.activeLine
|
|
290
|
+
},
|
|
291
|
+
".cm-activeLineGutter": {
|
|
292
|
+
backgroundColor: palette.activeLine
|
|
293
|
+
},
|
|
294
|
+
".cm-selectionBackground": {
|
|
295
|
+
backgroundColor: palette.selection
|
|
296
|
+
},
|
|
297
|
+
"&.cm-focused .cm-selectionBackground": {
|
|
298
|
+
backgroundColor: palette.selection
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
{ dark: palette.dark }
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
function normalizeLanguage(language) {
|
|
305
|
+
if (language === "js")
|
|
306
|
+
return "javascript";
|
|
307
|
+
return language;
|
|
308
|
+
}
|
|
309
|
+
function getLanguageExtension(language) {
|
|
310
|
+
if (language === "yaml")
|
|
311
|
+
return yaml();
|
|
312
|
+
if (language === "toml")
|
|
313
|
+
return StreamLanguage.define(toml);
|
|
314
|
+
if (language === "ini")
|
|
315
|
+
return StreamLanguage.define(properties);
|
|
316
|
+
if (language === "javascript")
|
|
317
|
+
return javascript();
|
|
318
|
+
return json();
|
|
319
|
+
}
|
|
320
|
+
function resolveDiagnosticsRange(pos, docLength) {
|
|
321
|
+
const from = Math.max(0, Math.min(docLength, pos?.[0] ?? 0));
|
|
322
|
+
const rawTo = pos?.[1] ?? from + 1;
|
|
323
|
+
let to = Math.max(from, Math.min(docLength, rawTo));
|
|
324
|
+
if (to === from && docLength > from)
|
|
325
|
+
to = from + 1;
|
|
326
|
+
return { from, to };
|
|
327
|
+
}
|
|
328
|
+
function createYamlDiagnostics(view) {
|
|
329
|
+
const text = view.state.doc.toString();
|
|
330
|
+
if (!text.trim())
|
|
331
|
+
return [];
|
|
332
|
+
try {
|
|
333
|
+
const doc = parseDocument(text);
|
|
334
|
+
const diagnostics = [];
|
|
335
|
+
const errors = doc.errors ?? [];
|
|
336
|
+
const warnings = doc.warnings ?? [];
|
|
337
|
+
for (const error of errors) {
|
|
338
|
+
const range = resolveDiagnosticsRange(error.pos, view.state.doc.length);
|
|
339
|
+
diagnostics.push({
|
|
340
|
+
...range,
|
|
341
|
+
severity: "error",
|
|
342
|
+
message: error.message || "YAML parse error"
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
for (const warning of warnings) {
|
|
346
|
+
const range = resolveDiagnosticsRange(warning.pos, view.state.doc.length);
|
|
347
|
+
diagnostics.push({
|
|
348
|
+
...range,
|
|
349
|
+
severity: "warning",
|
|
350
|
+
message: warning.message || "YAML warning"
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
return diagnostics;
|
|
354
|
+
} catch (error) {
|
|
355
|
+
const range = resolveDiagnosticsRange(void 0, view.state.doc.length);
|
|
356
|
+
return [
|
|
357
|
+
{
|
|
358
|
+
...range,
|
|
359
|
+
severity: "error",
|
|
360
|
+
message: error instanceof Error ? error.message : "YAML parse error"
|
|
361
|
+
}
|
|
362
|
+
];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function createLintExtension(language) {
|
|
366
|
+
if (language === "yaml")
|
|
367
|
+
return linter((view) => createYamlDiagnostics(view));
|
|
368
|
+
if (language === "json")
|
|
369
|
+
return linter(jsonParseLinter());
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
function formatValue(value, language) {
|
|
373
|
+
if (!value.trim())
|
|
374
|
+
return value;
|
|
375
|
+
const tabSize = normalizeTabSize(props.tabSize);
|
|
376
|
+
try {
|
|
377
|
+
if (language === "yaml") {
|
|
378
|
+
const parsed2 = parse(value);
|
|
379
|
+
return stringify(parsed2, { indent: tabSize });
|
|
380
|
+
}
|
|
381
|
+
if (language !== "json")
|
|
382
|
+
return null;
|
|
383
|
+
const parsed = JSON.parse(value);
|
|
384
|
+
return JSON.stringify(parsed, null, tabSize);
|
|
385
|
+
} catch {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function applyValue(next, emitChange) {
|
|
390
|
+
const view = viewRef.value;
|
|
391
|
+
if (!view)
|
|
392
|
+
return;
|
|
393
|
+
const current = view.state.doc.toString();
|
|
394
|
+
if (next === current)
|
|
395
|
+
return;
|
|
396
|
+
suppressEmit = true;
|
|
397
|
+
allowEmit = emitChange;
|
|
398
|
+
view.dispatch({
|
|
399
|
+
changes: { from: 0, to: current.length, insert: next }
|
|
400
|
+
});
|
|
401
|
+
suppressEmit = false;
|
|
402
|
+
allowEmit = false;
|
|
403
|
+
}
|
|
404
|
+
const updateListener = EditorView.updateListener.of((update) => {
|
|
405
|
+
if (!update.docChanged)
|
|
406
|
+
return;
|
|
407
|
+
const value = update.state.doc.toString();
|
|
408
|
+
if (suppressEmit && !allowEmit)
|
|
409
|
+
return;
|
|
410
|
+
emit("update:modelValue", value);
|
|
411
|
+
emit("change", value);
|
|
412
|
+
});
|
|
413
|
+
function format() {
|
|
414
|
+
const view = viewRef.value;
|
|
415
|
+
if (!view || props.readOnly)
|
|
416
|
+
return false;
|
|
417
|
+
const language = normalizeLanguage(props.language);
|
|
418
|
+
const current = view.state.doc.toString();
|
|
419
|
+
const formatted = formatValue(current, language);
|
|
420
|
+
if (formatted === null || formatted === current)
|
|
421
|
+
return false;
|
|
422
|
+
applyValue(formatted, true);
|
|
423
|
+
emit("format", { value: formatted, language });
|
|
424
|
+
return true;
|
|
425
|
+
}
|
|
426
|
+
function openSearch() {
|
|
427
|
+
const view = viewRef.value;
|
|
428
|
+
if (!view || !props.search)
|
|
429
|
+
return false;
|
|
430
|
+
openSearchPanel(view);
|
|
431
|
+
view.focus();
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
function foldAllLines() {
|
|
435
|
+
const view = viewRef.value;
|
|
436
|
+
if (!view)
|
|
437
|
+
return false;
|
|
438
|
+
return foldAll(view);
|
|
439
|
+
}
|
|
440
|
+
function unfoldAllLines() {
|
|
441
|
+
const view = viewRef.value;
|
|
442
|
+
if (!view)
|
|
443
|
+
return false;
|
|
444
|
+
return unfoldAll(view);
|
|
445
|
+
}
|
|
446
|
+
async function copyToClipboard() {
|
|
447
|
+
const view = viewRef.value;
|
|
448
|
+
if (!view)
|
|
449
|
+
return false;
|
|
450
|
+
const value = view.state.doc.toString();
|
|
451
|
+
if (!hasNavigator() || !navigator.clipboard)
|
|
452
|
+
return false;
|
|
453
|
+
try {
|
|
454
|
+
await navigator.clipboard.writeText(value);
|
|
455
|
+
return true;
|
|
456
|
+
} catch {
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
function getValue() {
|
|
461
|
+
const view = viewRef.value;
|
|
462
|
+
return view ? view.state.doc.toString() : "";
|
|
463
|
+
}
|
|
464
|
+
function buildExtensions() {
|
|
465
|
+
const language = normalizeLanguage(props.language);
|
|
466
|
+
const tabSize = normalizeTabSize(props.tabSize);
|
|
467
|
+
const theme = resolvedTheme.value;
|
|
468
|
+
const extensions = [
|
|
469
|
+
baseTheme,
|
|
470
|
+
createEditorTheme(theme),
|
|
471
|
+
syntaxHighlighting(createHighlightStyle(theme), { fallback: true }),
|
|
472
|
+
indentUnit.of(" ".repeat(tabSize)),
|
|
473
|
+
EditorState.tabSize.of(tabSize),
|
|
474
|
+
EditorView.editable.of(!props.readOnly),
|
|
475
|
+
updateListener,
|
|
476
|
+
drawSelection(),
|
|
477
|
+
highlightActiveLine(),
|
|
478
|
+
bracketMatching(),
|
|
479
|
+
history(),
|
|
480
|
+
foldGutter(),
|
|
481
|
+
getLanguageExtension(language),
|
|
482
|
+
keymap.of([
|
|
483
|
+
...defaultKeymap,
|
|
484
|
+
...historyKeymap,
|
|
485
|
+
...foldKeymap,
|
|
486
|
+
...props.search ? searchKeymap : [],
|
|
487
|
+
...props.completion ? completionKeymap : [],
|
|
488
|
+
...props.completion ? closeBracketsKeymap : [],
|
|
489
|
+
...props.lint ? lintKeymap : [],
|
|
490
|
+
{
|
|
491
|
+
key: "Mod-Shift-f",
|
|
492
|
+
run: () => {
|
|
493
|
+
format();
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
])
|
|
498
|
+
];
|
|
499
|
+
if (props.lineNumbers) {
|
|
500
|
+
extensions.push(lineNumbers());
|
|
501
|
+
extensions.push(highlightActiveLineGutter());
|
|
502
|
+
}
|
|
503
|
+
if (props.lineWrapping)
|
|
504
|
+
extensions.push(EditorView.lineWrapping);
|
|
505
|
+
if (props.placeholder)
|
|
506
|
+
extensions.push(placeholder(props.placeholder));
|
|
507
|
+
if (props.search)
|
|
508
|
+
extensions.push(search());
|
|
509
|
+
if (props.completion) {
|
|
510
|
+
extensions.push(autocompletion());
|
|
511
|
+
extensions.push(closeBrackets());
|
|
512
|
+
}
|
|
513
|
+
if (props.lint) {
|
|
514
|
+
const lintExtension = createLintExtension(language);
|
|
515
|
+
if (lintExtension) {
|
|
516
|
+
extensions.push(lintExtension);
|
|
517
|
+
extensions.push(lintGutter());
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (props.extensions?.length)
|
|
521
|
+
extensions.push(...props.extensions);
|
|
522
|
+
return extensions;
|
|
523
|
+
}
|
|
524
|
+
function reconfigure() {
|
|
525
|
+
const view = viewRef.value;
|
|
526
|
+
if (!view)
|
|
527
|
+
return;
|
|
528
|
+
view.dispatch({ effects: StateEffect.reconfigure.of(buildExtensions()) });
|
|
529
|
+
}
|
|
530
|
+
function handleFocus() {
|
|
531
|
+
if (!isFocused.value) {
|
|
532
|
+
isFocused.value = true;
|
|
533
|
+
emit("focus");
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function handleBlur() {
|
|
537
|
+
if (isFocused.value) {
|
|
538
|
+
isFocused.value = false;
|
|
539
|
+
emit("blur");
|
|
540
|
+
}
|
|
541
|
+
if (props.formatOnBlur)
|
|
542
|
+
format();
|
|
543
|
+
}
|
|
544
|
+
onMounted(() => {
|
|
545
|
+
if (!containerRef.value)
|
|
546
|
+
return;
|
|
547
|
+
if (props.theme === "auto") {
|
|
548
|
+
syncAutoTheme();
|
|
549
|
+
setupThemeObserver();
|
|
550
|
+
}
|
|
551
|
+
const state = EditorState.create({
|
|
552
|
+
doc: props.modelValue ?? "",
|
|
553
|
+
extensions: buildExtensions()
|
|
554
|
+
});
|
|
555
|
+
const view = new EditorView({
|
|
556
|
+
state,
|
|
557
|
+
parent: containerRef.value
|
|
558
|
+
});
|
|
559
|
+
viewRef.value = view;
|
|
560
|
+
view.dom.addEventListener("focus", handleFocus, true);
|
|
561
|
+
view.dom.addEventListener("blur", handleBlur, true);
|
|
562
|
+
if (props.formatOnInit)
|
|
563
|
+
format();
|
|
564
|
+
});
|
|
565
|
+
onBeforeUnmount(() => {
|
|
566
|
+
themeObserver?.disconnect();
|
|
567
|
+
themeObserver = null;
|
|
568
|
+
const view = viewRef.value;
|
|
569
|
+
if (!view)
|
|
570
|
+
return;
|
|
571
|
+
view.dom.removeEventListener("focus", handleFocus, true);
|
|
572
|
+
view.dom.removeEventListener("blur", handleBlur, true);
|
|
573
|
+
view.destroy();
|
|
574
|
+
viewRef.value = null;
|
|
575
|
+
});
|
|
576
|
+
watch(
|
|
577
|
+
() => props.theme,
|
|
578
|
+
(next) => {
|
|
579
|
+
if (next === "auto") {
|
|
580
|
+
syncAutoTheme();
|
|
581
|
+
setupThemeObserver();
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
themeObserver?.disconnect();
|
|
585
|
+
themeObserver = null;
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
watch(
|
|
589
|
+
() => props.modelValue,
|
|
590
|
+
(next) => {
|
|
591
|
+
applyValue(next ?? "", false);
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
watch(
|
|
595
|
+
() => [
|
|
596
|
+
props.language,
|
|
597
|
+
props.readOnly,
|
|
598
|
+
props.lineNumbers,
|
|
599
|
+
props.lineWrapping,
|
|
600
|
+
props.placeholder,
|
|
601
|
+
props.tabSize,
|
|
602
|
+
props.lint,
|
|
603
|
+
props.search,
|
|
604
|
+
props.completion,
|
|
605
|
+
props.extensions
|
|
606
|
+
],
|
|
607
|
+
() => {
|
|
608
|
+
reconfigure();
|
|
609
|
+
},
|
|
610
|
+
{ deep: true }
|
|
611
|
+
);
|
|
612
|
+
watch(
|
|
613
|
+
() => resolvedTheme.value,
|
|
614
|
+
() => {
|
|
615
|
+
reconfigure();
|
|
616
|
+
}
|
|
617
|
+
);
|
|
618
|
+
__expose({
|
|
619
|
+
focus: () => viewRef.value?.focus(),
|
|
620
|
+
blur: () => viewRef.value?.contentDOM?.blur(),
|
|
621
|
+
format: () => format(),
|
|
622
|
+
openSearch: () => openSearch(),
|
|
623
|
+
foldAll: () => foldAllLines(),
|
|
624
|
+
unfoldAll: () => unfoldAllLines(),
|
|
625
|
+
copy: () => copyToClipboard(),
|
|
626
|
+
getValue: () => getValue(),
|
|
627
|
+
getView: () => viewRef.value
|
|
628
|
+
});
|
|
629
|
+
return (_ctx, _cache) => {
|
|
630
|
+
return openBlock(), createElementBlock("div", {
|
|
631
|
+
class: normalizeClass(["tx-code-editor", {
|
|
632
|
+
"is-focused": isFocused.value,
|
|
633
|
+
"is-readonly": __props.readOnly
|
|
634
|
+
}]),
|
|
635
|
+
"data-theme": resolvedTheme.value,
|
|
636
|
+
style: normalizeStyle(rootStyle.value)
|
|
637
|
+
}, [
|
|
638
|
+
_ctx.$slots.toolbar ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
639
|
+
renderSlot(_ctx.$slots, "toolbar", {
|
|
640
|
+
format,
|
|
641
|
+
openSearch,
|
|
642
|
+
foldAll: foldAllLines,
|
|
643
|
+
unfoldAll: unfoldAllLines,
|
|
644
|
+
copy: copyToClipboard,
|
|
645
|
+
getValue
|
|
646
|
+
}, void 0, true)
|
|
647
|
+
])) : createCommentVNode("", true),
|
|
648
|
+
createElementVNode("div", {
|
|
649
|
+
ref_key: "containerRef",
|
|
650
|
+
ref: containerRef,
|
|
651
|
+
class: "tx-code-editor__view"
|
|
652
|
+
}, null, 512)
|
|
653
|
+
], 14, _hoisted_1);
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CodeEditorToolbarAction } from './types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
leading?(_: {}): any;
|
|
6
|
+
trailing?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
9
|
+
actions: {
|
|
10
|
+
type: PropType<CodeEditorToolbarAction[]>;
|
|
11
|
+
default: () => never[];
|
|
12
|
+
};
|
|
13
|
+
compact: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
action: (...args: any[]) => void;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
actions: {
|
|
21
|
+
type: PropType<CodeEditorToolbarAction[]>;
|
|
22
|
+
default: () => never[];
|
|
23
|
+
};
|
|
24
|
+
compact: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
}>> & Readonly<{
|
|
29
|
+
onAction?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
compact: boolean;
|
|
32
|
+
actions: CodeEditorToolbarAction[];
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from './TxCodeEditorToolbar.vue2.js';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
|
|
4
|
+
|
|
5
|
+
const TxCodeEditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-38eb2702"]]);
|
|
6
|
+
|
|
7
|
+
export { TxCodeEditorToolbar as default };
|