@keboola/design 11.0.0 → 11.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AIKit-Dre37SJr.js +1320 -0
- package/dist/AIKit-Dre37SJr.js.map +1 -0
- package/dist/Alert-DfZq9kGe.js +133 -0
- package/dist/Alert-DfZq9kGe.js.map +1 -0
- package/dist/AlertModal-BUC4Es8o.js +222 -0
- package/dist/AlertModal-BUC4Es8o.js.map +1 -0
- package/dist/AppShell-B5GQN6Zs.js +143 -0
- package/dist/AppShell-B5GQN6Zs.js.map +1 -0
- package/dist/AutoSaveTextarea-BeuWuszr.js +58 -0
- package/dist/{chunk-UGT6DKWM.js.map → AutoSaveTextarea-BeuWuszr.js.map} +1 -1
- package/dist/Badge-Ch26CXoP.js +195 -0
- package/dist/Badge-Ch26CXoP.js.map +1 -0
- package/dist/BrandEditor-B8o9zdZO.js +903 -0
- package/dist/BrandEditor-B8o9zdZO.js.map +1 -0
- package/dist/BrandLogo-CJkRd0F8.js +46 -0
- package/dist/BrandLogo-CJkRd0F8.js.map +1 -0
- package/dist/Breadcrumb-DJp7WwSv.js +330 -0
- package/dist/Breadcrumb-DJp7WwSv.js.map +1 -0
- package/dist/Button-nzmDNS2q.js +391 -0
- package/dist/Button-nzmDNS2q.js.map +1 -0
- package/dist/Calendar-cG5NIJ4O.js +6768 -0
- package/dist/Calendar-cG5NIJ4O.js.map +1 -0
- package/dist/Card-BAoZ35CV.js +105 -0
- package/dist/Card-BAoZ35CV.js.map +1 -0
- package/dist/Checkbox-GJ8-srt4.js +97 -0
- package/dist/Checkbox-GJ8-srt4.js.map +1 -0
- package/dist/Clipboard-CBJZiviP.js +58 -0
- package/dist/Clipboard-CBJZiviP.js.map +1 -0
- package/dist/ClipboardButton-ez5V3fkk.js +43 -0
- package/dist/ClipboardButton-ez5V3fkk.js.map +1 -0
- package/dist/CodeEditor-BfQJfbhL.js +952 -0
- package/dist/CodeEditor-BfQJfbhL.js.map +1 -0
- package/dist/Collapsible-BQXWEOBC.js +34 -0
- package/dist/Collapsible-BQXWEOBC.js.map +1 -0
- package/dist/ColorInput-Dx8Dsv7Y.js +180 -0
- package/dist/ColorInput-Dx8Dsv7Y.js.map +1 -0
- package/dist/ColorModeSwitch-CCqj7tjE.js +77 -0
- package/dist/ColorModeSwitch-CCqj7tjE.js.map +1 -0
- package/dist/Combobox-c_xBjf0P.js +439 -0
- package/dist/Combobox-c_xBjf0P.js.map +1 -0
- package/dist/Command-CQ_bQsJp.js +102 -0
- package/dist/Command-CQ_bQsJp.js.map +1 -0
- package/dist/CopyField-BJ96zvXs.js +322 -0
- package/dist/CopyField-BJ96zvXs.js.map +1 -0
- package/dist/DateInput-CMD3dY-T.js +141 -0
- package/dist/DateInput-CMD3dY-T.js.map +1 -0
- package/dist/DatePicker-BbFbmsGl.js +24 -0
- package/dist/DatePicker-BbFbmsGl.js.map +1 -0
- package/dist/DateRangeInput-D3BhiKyk.js +139 -0
- package/dist/DateRangeInput-D3BhiKyk.js.map +1 -0
- package/dist/DateRangePicker-BiUgtt_M.js +159 -0
- package/dist/DateRangePicker-BiUgtt_M.js.map +1 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js +11 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js.map +1 -0
- package/dist/DiffView-ppTIzh2h.js +429 -0
- package/dist/DiffView-ppTIzh2h.js.map +1 -0
- package/dist/DropdownMenu-B6ZbYvaM.js +327 -0
- package/dist/DropdownMenu-B6ZbYvaM.js.map +1 -0
- package/dist/FieldBox-D7DYtX_m.js +70 -0
- package/dist/FieldBox-D7DYtX_m.js.map +1 -0
- package/dist/FileUpload-sXRv7JiY.js +2527 -0
- package/dist/FileUpload-sXRv7JiY.js.map +1 -0
- package/dist/Form-BDCef6O9.js +371 -0
- package/dist/Form-BDCef6O9.js.map +1 -0
- package/dist/FormGroup-S9mPNHKH.js +124 -0
- package/dist/FormGroup-S9mPNHKH.js.map +1 -0
- package/dist/FullScreenModal-CJa2VkJ2.js +96 -0
- package/dist/FullScreenModal-CJa2VkJ2.js.map +1 -0
- package/dist/HoverCard-WfDkLK1s.js +31 -0
- package/dist/HoverCard-WfDkLK1s.js.map +1 -0
- package/dist/InputGroup-BJWsI35s.js +292 -0
- package/dist/InputGroup-BJWsI35s.js.map +1 -0
- package/dist/Kbd-CxHAo1oo.js +111 -0
- package/dist/Kbd-CxHAo1oo.js.map +1 -0
- package/dist/MarkedText-Ckbft5mw.js +44 -0
- package/dist/MarkedText-Ckbft5mw.js.map +1 -0
- package/dist/MermaidDiagram-BB06gymm.js +399 -0
- package/dist/MermaidDiagram-BB06gymm.js.map +1 -0
- package/dist/Modal-BA5Wc3sx.js +185 -0
- package/dist/Modal-BA5Wc3sx.js.map +1 -0
- package/dist/ModalTitle-C76ke2eo.js +28 -0
- package/dist/ModalTitle-C76ke2eo.js.map +1 -0
- package/dist/MultiActionButtonGroup-CiBHxsSk.js +33 -0
- package/dist/MultiActionButtonGroup-CiBHxsSk.js.map +1 -0
- package/dist/Navbar-t16usFZQ.js +322 -0
- package/dist/Navbar-t16usFZQ.js.map +1 -0
- package/dist/OtpInput-CbbymqYs.js +93 -0
- package/dist/OtpInput-CbbymqYs.js.map +1 -0
- package/dist/PageHeader-Q3IpCnQd.js +177 -0
- package/dist/PageHeader-Q3IpCnQd.js.map +1 -0
- package/dist/PageLayout-DSVM-ASz.js +176 -0
- package/dist/PageLayout-DSVM-ASz.js.map +1 -0
- package/dist/PageToolbar-0_1OBzaZ.js +153 -0
- package/dist/PageToolbar-0_1OBzaZ.js.map +1 -0
- package/dist/Pagination-CM_Rszz-.js +70 -0
- package/dist/Pagination-CM_Rszz-.js.map +1 -0
- package/dist/Popconfirm-BGe1jLov.js +170 -0
- package/dist/Popconfirm-BGe1jLov.js.map +1 -0
- package/dist/Popover-Ca0V6AD1.js +92 -0
- package/dist/Popover-Ca0V6AD1.js.map +1 -0
- package/dist/RadioGroup-sIveSsNa.js +233 -0
- package/dist/RadioGroup-sIveSsNa.js.map +1 -0
- package/dist/Resizable-D3vYToZH.js +52 -0
- package/dist/Resizable-D3vYToZH.js.map +1 -0
- package/dist/Search-3UiqNZRj.js +184 -0
- package/dist/Search-3UiqNZRj.js.map +1 -0
- package/dist/SearchInput-D2fcOv7E.js +102 -0
- package/dist/SearchInput-D2fcOv7E.js.map +1 -0
- package/dist/SectionNav--7bw2b6u.js +276 -0
- package/dist/SectionNav--7bw2b6u.js.map +1 -0
- package/dist/Select-4YX38G5h.js +181 -0
- package/dist/Select-4YX38G5h.js.map +1 -0
- package/dist/Sheet-BQrX8-h5.js +169 -0
- package/dist/Sheet-BQrX8-h5.js.map +1 -0
- package/dist/Sidebar-ROaR_AqC.js +799 -0
- package/dist/Sidebar-ROaR_AqC.js.map +1 -0
- package/dist/Slider-Da_3mS5v.js +127 -0
- package/dist/Slider-Da_3mS5v.js.map +1 -0
- package/dist/Stepper-C8sm9ZFM.js +325 -0
- package/dist/Stepper-C8sm9ZFM.js.map +1 -0
- package/dist/Switch-CX2A0v50.js +201 -0
- package/dist/Switch-CX2A0v50.js.map +1 -0
- package/dist/Table-CvYuTuNU.js +104 -0
- package/dist/Table-CvYuTuNU.js.map +1 -0
- package/dist/Tabs-EAihyqCt.js +74 -0
- package/dist/Tabs-EAihyqCt.js.map +1 -0
- package/dist/TextInput-BGed-V13.js +110 -0
- package/dist/TextInput-BGed-V13.js.map +1 -0
- package/dist/ThemeProvider-QncUrfJn.js +203 -0
- package/dist/ThemeProvider-QncUrfJn.js.map +1 -0
- package/dist/TimePicker-B_NegL-7.js +98 -0
- package/dist/TimePicker-B_NegL-7.js.map +1 -0
- package/dist/Timeline-6btyJl4D.js +154 -0
- package/dist/Timeline-6btyJl4D.js.map +1 -0
- package/dist/Toast-DQSbs3oA.js +49 -0
- package/dist/Toast-DQSbs3oA.js.map +1 -0
- package/dist/ToggleGroup-Cy_10Mvu.js +47 -0
- package/dist/ToggleGroup-Cy_10Mvu.js.map +1 -0
- package/dist/Workbench-BzE-Vvd9.js +293 -0
- package/dist/Workbench-BzE-Vvd9.js.map +1 -0
- package/dist/ZoomableSvg-DG9PnAm8.js +248 -0
- package/dist/ZoomableSvg-DG9PnAm8.js.map +1 -0
- package/dist/charts.d.ts +110 -103
- package/dist/charts.js +303 -254
- package/dist/charts.js.map +1 -1
- package/dist/classNames-BzrkDnOD.js +9 -0
- package/dist/classNames-BzrkDnOD.js.map +1 -0
- package/dist/constants-D6JcsD4_.d.ts +41 -0
- package/dist/context-KxxeMHbR.js +62 -0
- package/dist/context-KxxeMHbR.js.map +1 -0
- package/dist/editors.d.ts +180 -173
- package/dist/editors.js +747 -428
- package/dist/editors.js.map +1 -1
- package/dist/escapeStringRegexp-8MxP2knR.js +6 -0
- package/dist/escapeStringRegexp-8MxP2knR.js.map +1 -0
- package/dist/icons-Cek151jC.js +640 -0
- package/dist/icons-Cek151jC.js.map +1 -0
- package/dist/icons.d.ts +2 -41
- package/dist/icons.js +2 -9
- package/dist/index-m-kQEWiY.d.ts +54 -0
- package/dist/index.d.ts +6183 -9885
- package/dist/index.js +112 -124
- package/dist/internal/blocks/AIKit.js +2 -30
- package/dist/internal/blocks/AppShell.js +2 -11
- package/dist/internal/blocks/AutoSaveTextarea.js +2 -14
- package/dist/internal/blocks/BrandEditor.js +2 -23
- package/dist/internal/blocks/ChartPanel.js +45 -9
- package/dist/internal/blocks/ChartPanel.js.map +1 -1
- package/dist/internal/blocks/ClipboardButton.js +2 -12
- package/dist/internal/blocks/ColorInput.js +2 -13
- package/dist/internal/blocks/ColorModeSwitch.js +2 -13
- package/dist/internal/blocks/Command.js +2 -15
- package/dist/internal/blocks/CopyField.js +2 -11
- package/dist/internal/blocks/DashboardHero.js +58 -8
- package/dist/internal/blocks/DashboardHero.js.map +1 -1
- package/dist/internal/blocks/DateInput.js +2 -16
- package/dist/internal/blocks/DateRangeInput.js +2 -16
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +15 -9
- package/dist/internal/blocks/EmptyConfigurationActionCard.js.map +1 -1
- package/dist/internal/blocks/EmptyState.js +141 -3
- package/dist/internal/blocks/EmptyState.js.map +1 -1
- package/dist/internal/blocks/ErrorState.js +178 -4
- package/dist/internal/blocks/ErrorState.js.map +1 -1
- package/dist/internal/blocks/ExportMenu.js +40 -12
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form.js +2 -29
- package/dist/internal/blocks/FormGroup.js +2 -18
- package/dist/internal/blocks/GoogleButton.js +94 -9
- package/dist/internal/blocks/GoogleButton.js.map +1 -1
- package/dist/internal/blocks/MicrosoftButton.js +63 -9
- package/dist/internal/blocks/MicrosoftButton.js.map +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +2 -12
- package/dist/internal/blocks/MultiCombobox.js +187 -13
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +43 -11
- package/dist/internal/blocks/NumberInput.js.map +1 -1
- package/dist/internal/blocks/OtpInput.js +2 -10
- package/dist/internal/blocks/PageHeader.js +2 -9
- package/dist/internal/blocks/PageLayout.js +2 -9
- package/dist/internal/blocks/PageToolbar.js +2 -13
- package/dist/internal/blocks/PasswordInput.js +96 -12
- package/dist/internal/blocks/PasswordInput.js.map +1 -1
- package/dist/internal/blocks/SearchInput.js +2 -12
- package/dist/internal/blocks/SearchInputWithNavigation.js +64 -15
- package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -1
- package/dist/internal/blocks/SectionNav.js +2 -15
- package/dist/internal/blocks/SplitButton.js +45 -13
- package/dist/internal/blocks/SplitButton.js.map +1 -1
- package/dist/internal/blocks/StatCard.js +96 -9
- package/dist/internal/blocks/StatCard.js.map +1 -1
- package/dist/internal/blocks/TextInput.js +2 -13
- package/dist/internal/blocks/Textarea.js +31 -12
- package/dist/internal/blocks/Textarea.js.map +1 -1
- package/dist/internal/blocks/TimeInput.js +76 -16
- package/dist/internal/blocks/TimeInput.js.map +1 -1
- package/dist/internal/components/Alert.js +2 -11
- package/dist/internal/components/AlertModal.js +2 -11
- package/dist/internal/components/Avatar.js +52 -8
- package/dist/internal/components/Avatar.js.map +1 -1
- package/dist/internal/components/Badge.js +2 -9
- package/dist/internal/components/BrandLogo.js +2 -11
- package/dist/internal/components/Breadcrumb.js +2 -14
- package/dist/internal/components/Button.js +2 -10
- package/dist/internal/components/ButtonGroup.js +65 -8
- package/dist/internal/components/ButtonGroup.js.map +1 -1
- package/dist/internal/components/Calendar.js +2 -9
- package/dist/internal/components/Card.js +2 -9
- package/dist/internal/components/Checkbox.js +2 -11
- package/dist/internal/components/Clipboard.js +2 -9
- package/dist/internal/components/Collapsible.js +2 -9
- package/dist/internal/components/CollapsiblePanel.js +86 -10
- package/dist/internal/components/CollapsiblePanel.js.map +1 -1
- package/dist/internal/components/Combobox.js +2 -13
- package/dist/internal/components/DatePicker.js +2 -11
- package/dist/internal/components/DateRangePicker.js +2 -17
- package/dist/internal/components/DiffView.js +2 -9
- package/dist/internal/components/DotsLoader.js +17 -4
- package/dist/internal/components/DotsLoader.js.map +1 -1
- package/dist/internal/components/DropdownMenu.js +2 -11
- package/dist/internal/components/EmptySearchContent.js +11 -3
- package/dist/internal/components/EmptySearchContent.js.map +1 -1
- package/dist/internal/components/FileUpload.js +2 -11
- package/dist/internal/components/FullScreenModal.js +2 -12
- package/dist/internal/components/HelpBlock.js +24 -3
- package/dist/internal/components/HelpBlock.js.map +1 -1
- package/dist/internal/components/HoverCard.js +2 -9
- package/dist/internal/components/InputGroup.js +2 -11
- package/dist/internal/components/Kbd.js +2 -9
- package/dist/internal/components/Label.js +38 -8
- package/dist/internal/components/Label.js.map +1 -1
- package/dist/internal/components/Link.js +21 -8
- package/dist/internal/components/Link.js.map +1 -1
- package/dist/internal/components/MarkedText.js +2 -5
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +19 -9
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js.map +1 -1
- package/dist/internal/components/MergeEditor/PaneHeader.js +12 -3
- package/dist/internal/components/MergeEditor/PaneHeader.js.map +1 -1
- package/dist/internal/components/MergeEditor/constants.js +17 -3
- package/dist/internal/components/MergeEditor/constants.js.map +1 -1
- package/dist/internal/components/MergeEditor/useMergeDiff.js +2 -5
- package/dist/internal/components/Modal.js +2 -13
- package/dist/internal/components/Navbar.js +2 -14
- package/dist/internal/components/Pagination.js +2 -11
- package/dist/internal/components/PanelWithDetails.js +30 -10
- package/dist/internal/components/PanelWithDetails.js.map +1 -1
- package/dist/internal/components/Popconfirm.js +2 -12
- package/dist/internal/components/Popover.js +2 -9
- package/dist/internal/components/Progress.js +46 -8
- package/dist/internal/components/Progress.js.map +1 -1
- package/dist/internal/components/RadioGroup.js +2 -12
- package/dist/internal/components/Resizable.js +2 -9
- package/dist/internal/components/ScrollArea.js +41 -8
- package/dist/internal/components/ScrollArea.js.map +1 -1
- package/dist/internal/components/Search.js +2 -10
- package/dist/internal/components/Select.js +2 -12
- package/dist/internal/components/Separator.js +83 -8
- package/dist/internal/components/Separator.js.map +1 -1
- package/dist/internal/components/Sheet.js +2 -12
- package/dist/internal/components/Sidebar.js +2 -20
- package/dist/internal/components/Skeleton/Skeleton.js +38 -8
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/internal/components/Skeleton/SkeletonList.js +40 -9
- package/dist/internal/components/Skeleton/SkeletonList.js.map +1 -1
- package/dist/internal/components/Slider.js +2 -11
- package/dist/internal/components/SpotlightBackdrop.js +131 -8
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
- package/dist/internal/components/Stepper.js +2 -10
- package/dist/internal/components/Switch.js +2 -10
- package/dist/internal/components/Table.js +2 -10
- package/dist/internal/components/Tabs.js +2 -12
- package/dist/internal/components/ThemeProvider.js +3 -10
- package/dist/internal/components/TimePicker.js +2 -12
- package/dist/internal/components/Timeline.js +2 -10
- package/dist/internal/components/Toast.js +3 -11
- package/dist/internal/components/Toggle.js +168 -8
- package/dist/internal/components/Toggle.js.map +1 -1
- package/dist/internal/components/ToggleGroup.js +2 -9
- package/dist/internal/components/Tooltip.js +2 -8
- package/dist/internal/components/Truncated.js +44 -8
- package/dist/internal/components/Truncated.js.map +1 -1
- package/dist/internal/components/Workbench.js +2 -11
- package/dist/internal/components/ZoomableSvg.js +2 -13
- package/dist/internal/hooks/useAutosizeInput.js +76 -3
- package/dist/internal/hooks/useAutosizeInput.js.map +1 -1
- package/dist/internal/hooks/useScrollbarPosition.js +44 -4
- package/dist/internal/hooks/useScrollbarPosition.js.map +1 -1
- package/dist/internal/hooks/useStableCallback.js +28 -3
- package/dist/internal/hooks/useStableCallback.js.map +1 -1
- package/dist/internal/utils/mergeRefs.js +19 -3
- package/dist/internal/utils/mergeRefs.js.map +1 -1
- package/dist/internal/utils.js +5 -8
- package/dist/markdown-editor.d.ts +72 -72
- package/dist/markdown-editor.js +1122 -1207
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +12 -12
- package/dist/mermaid.js +2 -18
- package/dist/rjsf.d.ts +33 -34
- package/dist/rjsf.js +1541 -1671
- package/dist/rjsf.js.map +1 -1
- package/dist/rolldown-runtime-Bdc48AWt.js +33 -0
- package/dist/styles-DSUP_-9Z.js +158 -0
- package/dist/styles-DSUP_-9Z.js.map +1 -0
- package/dist/testing.d.ts +8 -7
- package/dist/testing.js +36 -21
- package/dist/testing.js.map +1 -1
- package/dist/themeTokens-BNg98Mu9.js +85 -0
- package/dist/themeTokens-BNg98Mu9.js.map +1 -0
- package/dist/toast-CjkURw0M.js +184 -0
- package/dist/toast-CjkURw0M.js.map +1 -0
- package/dist/useColorSchemeState-CYqcUfSH.js +61 -0
- package/dist/useColorSchemeState-CYqcUfSH.js.map +1 -0
- package/dist/useControllableState-M6494mCT.js +31 -0
- package/dist/useControllableState-M6494mCT.js.map +1 -0
- package/dist/useElement-DkF6esWL.js +15 -0
- package/dist/useElement-DkF6esWL.js.map +1 -0
- package/dist/useMergeDiff-CvowEXJ1.js +465 -0
- package/dist/useMergeDiff-CvowEXJ1.js.map +1 -0
- package/dist/utils-D0c5VAyF.js +308 -0
- package/dist/utils-D0c5VAyF.js.map +1 -0
- package/package.json +8 -8
- package/dist/MermaidDiagram-ZU5KAVRT.js +0 -18
- package/dist/MermaidDiagram-ZU5KAVRT.js.map +0 -1
- package/dist/chunk-2YYJDKSP.js +0 -51
- package/dist/chunk-2YYJDKSP.js.map +0 -1
- package/dist/chunk-3P5UUCFI.js +0 -385
- package/dist/chunk-3P5UUCFI.js.map +0 -1
- package/dist/chunk-3QDFDDWZ.js +0 -99
- package/dist/chunk-3QDFDDWZ.js.map +0 -1
- package/dist/chunk-3W27OLK5.js +0 -15
- package/dist/chunk-3W27OLK5.js.map +0 -1
- package/dist/chunk-4FIZZONW.js +0 -40
- package/dist/chunk-4FIZZONW.js.map +0 -1
- package/dist/chunk-4GIAXOJG.js +0 -133
- package/dist/chunk-4GIAXOJG.js.map +0 -1
- package/dist/chunk-52NDNMK7.js +0 -99
- package/dist/chunk-52NDNMK7.js.map +0 -1
- package/dist/chunk-576G5OES.js +0 -201
- package/dist/chunk-576G5OES.js.map +0 -1
- package/dist/chunk-5AIE6SET.js +0 -659
- package/dist/chunk-5AIE6SET.js.map +0 -1
- package/dist/chunk-5FTNAZRW.js +0 -327
- package/dist/chunk-5FTNAZRW.js.map +0 -1
- package/dist/chunk-5IG2S7ZY.js +0 -70
- package/dist/chunk-5IG2S7ZY.js.map +0 -1
- package/dist/chunk-5QCXHNCW.js +0 -404
- package/dist/chunk-5QCXHNCW.js.map +0 -1
- package/dist/chunk-6DUMGC7Y.js +0 -105
- package/dist/chunk-6DUMGC7Y.js.map +0 -1
- package/dist/chunk-6J25CVST.js +0 -174
- package/dist/chunk-6J25CVST.js.map +0 -1
- package/dist/chunk-6NN35XOP.js +0 -120
- package/dist/chunk-6NN35XOP.js.map +0 -1
- package/dist/chunk-6NZBVA4T.js +0 -24
- package/dist/chunk-6NZBVA4T.js.map +0 -1
- package/dist/chunk-6W5BHRCL.js +0 -295
- package/dist/chunk-6W5BHRCL.js.map +0 -1
- package/dist/chunk-72BKRCEG.js +0 -409
- package/dist/chunk-72BKRCEG.js.map +0 -1
- package/dist/chunk-7GTI3PPI.js +0 -95
- package/dist/chunk-7GTI3PPI.js.map +0 -1
- package/dist/chunk-7P6PLZ4B.js +0 -74
- package/dist/chunk-7P6PLZ4B.js.map +0 -1
- package/dist/chunk-7WZWY5IA.js +0 -46
- package/dist/chunk-7WZWY5IA.js.map +0 -1
- package/dist/chunk-AIYO2632.js +0 -489
- package/dist/chunk-AIYO2632.js.map +0 -1
- package/dist/chunk-ANFZWPNE.js +0 -112
- package/dist/chunk-ANFZWPNE.js.map +0 -1
- package/dist/chunk-ANZTVAJU.js +0 -73
- package/dist/chunk-ANZTVAJU.js.map +0 -1
- package/dist/chunk-BD5BTJKX.js +0 -166
- package/dist/chunk-BD5BTJKX.js.map +0 -1
- package/dist/chunk-BHGIDSRJ.js +0 -140
- package/dist/chunk-BHGIDSRJ.js.map +0 -1
- package/dist/chunk-BSQWZITZ.js +0 -507
- package/dist/chunk-BSQWZITZ.js.map +0 -1
- package/dist/chunk-D3LAIK62.js +0 -23
- package/dist/chunk-D3LAIK62.js.map +0 -1
- package/dist/chunk-DODCR43C.js +0 -155
- package/dist/chunk-DODCR43C.js.map +0 -1
- package/dist/chunk-EEK5NGZF.js +0 -40
- package/dist/chunk-EEK5NGZF.js.map +0 -1
- package/dist/chunk-ENRG7TXA.js +0 -11
- package/dist/chunk-ENRG7TXA.js.map +0 -1
- package/dist/chunk-EQRMGIGY.js +0 -239
- package/dist/chunk-EQRMGIGY.js.map +0 -1
- package/dist/chunk-ERAHK5YQ.js +0 -495
- package/dist/chunk-ERAHK5YQ.js.map +0 -1
- package/dist/chunk-F3FOFY2P.js +0 -124
- package/dist/chunk-F3FOFY2P.js.map +0 -1
- package/dist/chunk-F6BTWFOC.js +0 -507
- package/dist/chunk-F6BTWFOC.js.map +0 -1
- package/dist/chunk-F6J6NNAL.js +0 -34
- package/dist/chunk-F6J6NNAL.js.map +0 -1
- package/dist/chunk-FCHJ7D5O.js +0 -59
- package/dist/chunk-FCHJ7D5O.js.map +0 -1
- package/dist/chunk-FFJTEQCC.js +0 -80
- package/dist/chunk-FFJTEQCC.js.map +0 -1
- package/dist/chunk-FUFMVW7O.js +0 -64
- package/dist/chunk-FUFMVW7O.js.map +0 -1
- package/dist/chunk-FVPGQ6UE.js +0 -25
- package/dist/chunk-FVPGQ6UE.js.map +0 -1
- package/dist/chunk-G3PMV62Z.js +0 -33
- package/dist/chunk-G3PMV62Z.js.map +0 -1
- package/dist/chunk-GACFOW3E.js +0 -51
- package/dist/chunk-GACFOW3E.js.map +0 -1
- package/dist/chunk-GDT6HQMK.js +0 -42
- package/dist/chunk-GDT6HQMK.js.map +0 -1
- package/dist/chunk-HLGU22C6.js +0 -2589
- package/dist/chunk-HLGU22C6.js.map +0 -1
- package/dist/chunk-HPMYYGP7.js +0 -134
- package/dist/chunk-HPMYYGP7.js.map +0 -1
- package/dist/chunk-I2UCOD45.js +0 -197
- package/dist/chunk-I2UCOD45.js.map +0 -1
- package/dist/chunk-IEGDZUVM.js +0 -75
- package/dist/chunk-IEGDZUVM.js.map +0 -1
- package/dist/chunk-IIS7INHF.js +0 -47
- package/dist/chunk-IIS7INHF.js.map +0 -1
- package/dist/chunk-ITELSEFU.js +0 -256
- package/dist/chunk-ITELSEFU.js.map +0 -1
- package/dist/chunk-IXAYNBOY.js +0 -407
- package/dist/chunk-IXAYNBOY.js.map +0 -1
- package/dist/chunk-JUW2ETEI.js +0 -191
- package/dist/chunk-JUW2ETEI.js.map +0 -1
- package/dist/chunk-K65C7CVE.js +0 -127
- package/dist/chunk-K65C7CVE.js.map +0 -1
- package/dist/chunk-KDI64MCY.js +0 -189
- package/dist/chunk-KDI64MCY.js.map +0 -1
- package/dist/chunk-KN4ASMH5.js +0 -160
- package/dist/chunk-KN4ASMH5.js.map +0 -1
- package/dist/chunk-KQW7QNTU.js +0 -1549
- package/dist/chunk-KQW7QNTU.js.map +0 -1
- package/dist/chunk-KR7NXXHC.js +0 -66
- package/dist/chunk-KR7NXXHC.js.map +0 -1
- package/dist/chunk-KRZKIVMA.js +0 -142
- package/dist/chunk-KRZKIVMA.js.map +0 -1
- package/dist/chunk-KTTLLKGQ.js +0 -185
- package/dist/chunk-KTTLLKGQ.js.map +0 -1
- package/dist/chunk-KWKSHPDP.js +0 -234
- package/dist/chunk-KWKSHPDP.js.map +0 -1
- package/dist/chunk-KZVC7OYG.js +0 -57
- package/dist/chunk-KZVC7OYG.js.map +0 -1
- package/dist/chunk-L5DHUN2V.js +0 -204
- package/dist/chunk-L5DHUN2V.js.map +0 -1
- package/dist/chunk-LCTGEH57.js +0 -1376
- package/dist/chunk-LCTGEH57.js.map +0 -1
- package/dist/chunk-LXLIQ2D6.js +0 -12
- package/dist/chunk-LXLIQ2D6.js.map +0 -1
- package/dist/chunk-M4CTURKX.js +0 -84
- package/dist/chunk-M4CTURKX.js.map +0 -1
- package/dist/chunk-M6LTUPVP.js +0 -301
- package/dist/chunk-M6LTUPVP.js.map +0 -1
- package/dist/chunk-MA6RRHDT.js +0 -291
- package/dist/chunk-MA6RRHDT.js.map +0 -1
- package/dist/chunk-MODE4QIA.js +0 -6
- package/dist/chunk-MODE4QIA.js.map +0 -1
- package/dist/chunk-MVILMVGG.js +0 -118
- package/dist/chunk-MVILMVGG.js.map +0 -1
- package/dist/chunk-MWS4VCLV.js +0 -17
- package/dist/chunk-MWS4VCLV.js.map +0 -1
- package/dist/chunk-NEUX74SO.js +0 -315
- package/dist/chunk-NEUX74SO.js.map +0 -1
- package/dist/chunk-NFHKYBRD.js +0 -156
- package/dist/chunk-NFHKYBRD.js.map +0 -1
- package/dist/chunk-NHJNNXD3.js +0 -89
- package/dist/chunk-NHJNNXD3.js.map +0 -1
- package/dist/chunk-O2BF3HZL.js +0 -33
- package/dist/chunk-O2BF3HZL.js.map +0 -1
- package/dist/chunk-OANXCZYD.js +0 -212
- package/dist/chunk-OANXCZYD.js.map +0 -1
- package/dist/chunk-ODJF7YIP.js +0 -230
- package/dist/chunk-ODJF7YIP.js.map +0 -1
- package/dist/chunk-ON4BJTHI.js +0 -101
- package/dist/chunk-ON4BJTHI.js.map +0 -1
- package/dist/chunk-OTL5WXIJ.js +0 -16
- package/dist/chunk-OTL5WXIJ.js.map +0 -1
- package/dist/chunk-PACNBKJV.js +0 -47
- package/dist/chunk-PACNBKJV.js.map +0 -1
- package/dist/chunk-PROCA7K7.js +0 -23
- package/dist/chunk-PROCA7K7.js.map +0 -1
- package/dist/chunk-QGMIPA67.js +0 -85
- package/dist/chunk-QGMIPA67.js.map +0 -1
- package/dist/chunk-QQA37LFB.js +0 -190
- package/dist/chunk-QQA37LFB.js.map +0 -1
- package/dist/chunk-QZAWRSEB.js +0 -61
- package/dist/chunk-QZAWRSEB.js.map +0 -1
- package/dist/chunk-R74KGWNS.js +0 -699
- package/dist/chunk-R74KGWNS.js.map +0 -1
- package/dist/chunk-RFDLHMKL.js +0 -110
- package/dist/chunk-RFDLHMKL.js.map +0 -1
- package/dist/chunk-RL64HN7S.js +0 -40
- package/dist/chunk-RL64HN7S.js.map +0 -1
- package/dist/chunk-RMRQKPL7.js +0 -115
- package/dist/chunk-RMRQKPL7.js.map +0 -1
- package/dist/chunk-RQVK4IYC.js +0 -606
- package/dist/chunk-RQVK4IYC.js.map +0 -1
- package/dist/chunk-RTW56PWZ.js +0 -59
- package/dist/chunk-RTW56PWZ.js.map +0 -1
- package/dist/chunk-RUTPQNLR.js +0 -266
- package/dist/chunk-RUTPQNLR.js.map +0 -1
- package/dist/chunk-S6TAF63G.js +0 -25
- package/dist/chunk-S6TAF63G.js.map +0 -1
- package/dist/chunk-SBGAUGXY.js +0 -224
- package/dist/chunk-SBGAUGXY.js.map +0 -1
- package/dist/chunk-SC275NHZ.js +0 -407
- package/dist/chunk-SC275NHZ.js.map +0 -1
- package/dist/chunk-SCQPU4UE.js +0 -97
- package/dist/chunk-SCQPU4UE.js.map +0 -1
- package/dist/chunk-SFFF2WQP.js +0 -8
- package/dist/chunk-SFFF2WQP.js.map +0 -1
- package/dist/chunk-SJYMHZKA.js +0 -36
- package/dist/chunk-SJYMHZKA.js.map +0 -1
- package/dist/chunk-SLCCUJVN.js +0 -125
- package/dist/chunk-SLCCUJVN.js.map +0 -1
- package/dist/chunk-SVBSNSD4.js +0 -259
- package/dist/chunk-SVBSNSD4.js.map +0 -1
- package/dist/chunk-SVPLTL35.js +0 -62
- package/dist/chunk-SVPLTL35.js.map +0 -1
- package/dist/chunk-SWQFYNYG.js +0 -338
- package/dist/chunk-SWQFYNYG.js.map +0 -1
- package/dist/chunk-THHB4EWS.js +0 -72
- package/dist/chunk-THHB4EWS.js.map +0 -1
- package/dist/chunk-TUCDD33E.js +0 -246
- package/dist/chunk-TUCDD33E.js.map +0 -1
- package/dist/chunk-TV4WAP2R.js +0 -14
- package/dist/chunk-TV4WAP2R.js.map +0 -1
- package/dist/chunk-U3A6YBTZ.js +0 -134
- package/dist/chunk-U3A6YBTZ.js.map +0 -1
- package/dist/chunk-UGT6DKWM.js +0 -95
- package/dist/chunk-VSERHUWD.js +0 -212
- package/dist/chunk-VSERHUWD.js.map +0 -1
- package/dist/chunk-VYG7BDXC.js +0 -49
- package/dist/chunk-VYG7BDXC.js.map +0 -1
- package/dist/chunk-WETKNYZX.js +0 -52
- package/dist/chunk-WETKNYZX.js.map +0 -1
- package/dist/chunk-WGG4AML3.js +0 -216
- package/dist/chunk-WGG4AML3.js.map +0 -1
- package/dist/chunk-WKAUEL6I.js +0 -30
- package/dist/chunk-WKAUEL6I.js.map +0 -1
- package/dist/chunk-WPOLA5CG.js +0 -81
- package/dist/chunk-WPOLA5CG.js.map +0 -1
- package/dist/chunk-WPVETCGJ.js +0 -254
- package/dist/chunk-WPVETCGJ.js.map +0 -1
- package/dist/chunk-WTSM3A7E.js +0 -13
- package/dist/chunk-WTSM3A7E.js.map +0 -1
- package/dist/chunk-WU3F2K3T.js +0 -148
- package/dist/chunk-WU3F2K3T.js.map +0 -1
- package/dist/chunk-WZZK2DTZ.js +0 -39
- package/dist/chunk-WZZK2DTZ.js.map +0 -1
- package/dist/chunk-X4IHLKRD.js +0 -42
- package/dist/chunk-X4IHLKRD.js.map +0 -1
- package/dist/chunk-XAHEXZJC.js +0 -80
- package/dist/chunk-XAHEXZJC.js.map +0 -1
- package/dist/chunk-XCYGJDUX.js +0 -31
- package/dist/chunk-XCYGJDUX.js.map +0 -1
- package/dist/chunk-Y4W3JORC.js +0 -104
- package/dist/chunk-Y4W3JORC.js.map +0 -1
- package/dist/chunk-YFZJ3ZLG.js +0 -1297
- package/dist/chunk-YFZJ3ZLG.js.map +0 -1
- package/dist/chunk-YI3WLXEN.js +0 -4387
- package/dist/chunk-YI3WLXEN.js.map +0 -1
- package/dist/chunk-ZBKFSPD3.js +0 -29
- package/dist/chunk-ZBKFSPD3.js.map +0 -1
- package/dist/chunk-ZOERRQ6A.js +0 -79
- package/dist/chunk-ZOERRQ6A.js.map +0 -1
- package/dist/chunk-ZSTGUKHU.js +0 -10
- package/dist/chunk-ZSTGUKHU.js.map +0 -1
- package/dist/chunk-ZUEHDL27.js +0 -65
- package/dist/chunk-ZUEHDL27.js.map +0 -1
- package/dist/constants-D3gaMY-W.d.ts +0 -39
- package/dist/icons.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/blocks/AIKit.js.map +0 -1
- package/dist/internal/blocks/AppShell.js.map +0 -1
- package/dist/internal/blocks/AutoSaveTextarea.js.map +0 -1
- package/dist/internal/blocks/BrandEditor.js.map +0 -1
- package/dist/internal/blocks/ClipboardButton.js.map +0 -1
- package/dist/internal/blocks/ColorInput.js.map +0 -1
- package/dist/internal/blocks/ColorModeSwitch.js.map +0 -1
- package/dist/internal/blocks/Command.js.map +0 -1
- package/dist/internal/blocks/CopyField.js.map +0 -1
- package/dist/internal/blocks/DateInput.js.map +0 -1
- package/dist/internal/blocks/DateRangeInput.js.map +0 -1
- package/dist/internal/blocks/Form.js.map +0 -1
- package/dist/internal/blocks/FormGroup.js.map +0 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js.map +0 -1
- package/dist/internal/blocks/OtpInput.js.map +0 -1
- package/dist/internal/blocks/PageHeader.js.map +0 -1
- package/dist/internal/blocks/PageLayout.js.map +0 -1
- package/dist/internal/blocks/PageToolbar.js.map +0 -1
- package/dist/internal/blocks/SearchInput.js.map +0 -1
- package/dist/internal/blocks/SectionNav.js.map +0 -1
- package/dist/internal/blocks/TextInput.js.map +0 -1
- package/dist/internal/components/Alert.js.map +0 -1
- package/dist/internal/components/AlertModal.js.map +0 -1
- package/dist/internal/components/Badge.js.map +0 -1
- package/dist/internal/components/BrandLogo.js.map +0 -1
- package/dist/internal/components/Breadcrumb.js.map +0 -1
- package/dist/internal/components/Button.js.map +0 -1
- package/dist/internal/components/Calendar.js.map +0 -1
- package/dist/internal/components/Card.js.map +0 -1
- package/dist/internal/components/Checkbox.js.map +0 -1
- package/dist/internal/components/Clipboard.js.map +0 -1
- package/dist/internal/components/Collapsible.js.map +0 -1
- package/dist/internal/components/Combobox.js.map +0 -1
- package/dist/internal/components/DatePicker.js.map +0 -1
- package/dist/internal/components/DateRangePicker.js.map +0 -1
- package/dist/internal/components/DiffView.js.map +0 -1
- package/dist/internal/components/DropdownMenu.js.map +0 -1
- package/dist/internal/components/FileUpload.js.map +0 -1
- package/dist/internal/components/FullScreenModal.js.map +0 -1
- package/dist/internal/components/HoverCard.js.map +0 -1
- package/dist/internal/components/InputGroup.js.map +0 -1
- package/dist/internal/components/Kbd.js.map +0 -1
- package/dist/internal/components/MarkedText.js.map +0 -1
- package/dist/internal/components/MergeEditor/useMergeDiff.js.map +0 -1
- package/dist/internal/components/Modal.js.map +0 -1
- package/dist/internal/components/Navbar.js.map +0 -1
- package/dist/internal/components/Pagination.js.map +0 -1
- package/dist/internal/components/Popconfirm.js.map +0 -1
- package/dist/internal/components/Popover.js.map +0 -1
- package/dist/internal/components/RadioGroup.js.map +0 -1
- package/dist/internal/components/Resizable.js.map +0 -1
- package/dist/internal/components/Search.js.map +0 -1
- package/dist/internal/components/Select.js.map +0 -1
- package/dist/internal/components/Sheet.js.map +0 -1
- package/dist/internal/components/Sidebar.js.map +0 -1
- package/dist/internal/components/Slider.js.map +0 -1
- package/dist/internal/components/Stepper.js.map +0 -1
- package/dist/internal/components/Switch.js.map +0 -1
- package/dist/internal/components/Table.js.map +0 -1
- package/dist/internal/components/Tabs.js.map +0 -1
- package/dist/internal/components/ThemeProvider.js.map +0 -1
- package/dist/internal/components/TimePicker.js.map +0 -1
- package/dist/internal/components/Timeline.js.map +0 -1
- package/dist/internal/components/Toast.js.map +0 -1
- package/dist/internal/components/ToggleGroup.js.map +0 -1
- package/dist/internal/components/Tooltip.js.map +0 -1
- package/dist/internal/components/Workbench.js.map +0 -1
- package/dist/internal/components/ZoomableSvg.js.map +0 -1
- package/dist/internal/utils.js.map +0 -1
- package/dist/mermaid.js.map +0 -1
package/dist/chunk-YFZJ3ZLG.js
DELETED
|
@@ -1,1297 +0,0 @@
|
|
|
1
|
-
import { useStableCallback } from './chunk-TV4WAP2R.js';
|
|
2
|
-
import { Kbd } from './chunk-7GTI3PPI.js';
|
|
3
|
-
import { useThemeAttributes, resolveToken } from './chunk-IIS7INHF.js';
|
|
4
|
-
import { ClipboardButton } from './chunk-FUFMVW7O.js';
|
|
5
|
-
import { HelpBlock } from './chunk-PROCA7K7.js';
|
|
6
|
-
import { keyCodes, isMac } from './chunk-SWQFYNYG.js';
|
|
7
|
-
import { escapeStringRegexp } from './chunk-MODE4QIA.js';
|
|
8
|
-
import { useArgoDesign } from './chunk-WETKNYZX.js';
|
|
9
|
-
import { cn } from './chunk-LXLIQ2D6.js';
|
|
10
|
-
import { javascript } from '@codemirror/lang-javascript';
|
|
11
|
-
import { jsonParseLinter, json } from '@codemirror/lang-json';
|
|
12
|
-
import { python } from '@codemirror/lang-python';
|
|
13
|
-
import { PLSQL, MSSQL, PostgreSQL, MySQL, StandardSQL } from '@codemirror/lang-sql';
|
|
14
|
-
import { StreamLanguage } from '@codemirror/language';
|
|
15
|
-
import { r } from '@codemirror/legacy-modes/mode/r';
|
|
16
|
-
import { shell } from '@codemirror/legacy-modes/mode/shell';
|
|
17
|
-
import { toml } from '@codemirror/legacy-modes/mode/toml';
|
|
18
|
-
import { tags } from '@lezer/highlight';
|
|
19
|
-
import { githubLightInit } from '@uiw/codemirror-theme-github';
|
|
20
|
-
import { installExtensions, getSqlLanguageSupport } from '@keboola/codemirror-lang-sql';
|
|
21
|
-
import colors from '@keboola/tailwind-config/colors';
|
|
22
|
-
import { simpleMode } from '@codemirror/legacy-modes/mode/simple-mode';
|
|
23
|
-
import { useRef, useEffect, useLayoutEffect, useMemo } from 'react';
|
|
24
|
-
import { completeAnyWord, autocompletion } from '@codemirror/autocomplete';
|
|
25
|
-
import { linter } from '@codemirror/lint';
|
|
26
|
-
import { unifiedMergeView } from '@codemirror/merge';
|
|
27
|
-
import { EditorView, Decoration, ViewPlugin, gutter, GutterMarker, keymap as keymap$1, placeholder, tooltips } from '@codemirror/view';
|
|
28
|
-
import CodeMirror, { keymap, EditorState, EditorView as EditorView$1 } from '@uiw/react-codemirror';
|
|
29
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
30
|
-
import { StateEffect, StateField, RangeSet, Compartment } from '@codemirror/state';
|
|
31
|
-
import { defaultKeymap } from '@codemirror/commands';
|
|
32
|
-
|
|
33
|
-
var COMMANDS = [
|
|
34
|
-
"run-operation",
|
|
35
|
-
"run",
|
|
36
|
-
"test",
|
|
37
|
-
"seed",
|
|
38
|
-
"snapshot",
|
|
39
|
-
"list",
|
|
40
|
-
"ls",
|
|
41
|
-
"compile",
|
|
42
|
-
"build",
|
|
43
|
-
"deps",
|
|
44
|
-
"docs",
|
|
45
|
-
"source"
|
|
46
|
-
];
|
|
47
|
-
var SUBCOMMANDS = { docs: ["generate"], source: ["freshness"] };
|
|
48
|
-
var ARGUMENTS = ["--select", "--exclude", "--selector", "--defer", "--resource-type", "-s"];
|
|
49
|
-
var SELECTORS = ["--select", "--exclude", "-s"];
|
|
50
|
-
var METHODS = [
|
|
51
|
-
"path:",
|
|
52
|
-
"source:",
|
|
53
|
-
"tag:",
|
|
54
|
-
"package:",
|
|
55
|
-
"config:",
|
|
56
|
-
"test_type:",
|
|
57
|
-
"test_name:",
|
|
58
|
-
"state:",
|
|
59
|
-
"exposure:",
|
|
60
|
-
"metric:",
|
|
61
|
-
"result:",
|
|
62
|
-
"source_status:",
|
|
63
|
-
"column_name:"
|
|
64
|
-
];
|
|
65
|
-
var FLAGS = [
|
|
66
|
-
"--fail-fast",
|
|
67
|
-
"--warn-error",
|
|
68
|
-
"--favor-state",
|
|
69
|
-
"--vars",
|
|
70
|
-
"--models",
|
|
71
|
-
"--threads",
|
|
72
|
-
"--profiles-dir",
|
|
73
|
-
"--profile",
|
|
74
|
-
"--full-refresh"
|
|
75
|
-
];
|
|
76
|
-
var COMMAND_PHRASES = COMMANDS.flatMap((command) => {
|
|
77
|
-
const subcommands = SUBCOMMANDS[command];
|
|
78
|
-
return subcommands ? subcommands.map((subcommand) => `${command} ${subcommand}`) : [command];
|
|
79
|
-
});
|
|
80
|
-
var alternation = (list) => [...list].sort((a, b) => b.length - a.length).join("|");
|
|
81
|
-
var word = (list) => new RegExp(`^\\s+(?:${alternation(list)})\\b`, "i");
|
|
82
|
-
var prefix = (list) => new RegExp(`^\\s+(?:${alternation(list)})`, "i");
|
|
83
|
-
var WORD = /[\w:-]*$/;
|
|
84
|
-
var asOptions = (list, type) => list.map((label) => ({ label, type }));
|
|
85
|
-
var DBT = [{ label: "dbt", type: "keyword" }];
|
|
86
|
-
var COMMAND_OPTIONS = asOptions(COMMANDS, "keyword");
|
|
87
|
-
var SUBCOMMAND_OPTIONS = Object.fromEntries(
|
|
88
|
-
Object.entries(SUBCOMMANDS).map(([command, subcommands]) => [
|
|
89
|
-
command,
|
|
90
|
-
asOptions(subcommands, "keyword")
|
|
91
|
-
])
|
|
92
|
-
);
|
|
93
|
-
var ARGUMENT_OPTIONS = asOptions(ARGUMENTS, "variable");
|
|
94
|
-
var FLAG_OPTIONS = asOptions(FLAGS, "constant");
|
|
95
|
-
var METHOD_OPTIONS = asOptions(METHODS, "property");
|
|
96
|
-
var optionsAfter = (words) => {
|
|
97
|
-
const [step, command, ...rest] = words;
|
|
98
|
-
if (step === void 0) return DBT;
|
|
99
|
-
if (step.toLowerCase() !== "dbt") return [];
|
|
100
|
-
if (command === void 0) return COMMAND_OPTIONS;
|
|
101
|
-
const subcommands = SUBCOMMAND_OPTIONS[command.toLowerCase()];
|
|
102
|
-
if (subcommands && rest.length === 0) return subcommands;
|
|
103
|
-
const lastArgument = rest.filter((it) => it.startsWith("-")).at(-1);
|
|
104
|
-
const selecting = lastArgument !== void 0 && SELECTORS.includes(lastArgument.toLowerCase());
|
|
105
|
-
return selecting ? [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS, ...METHOD_OPTIONS] : [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS];
|
|
106
|
-
};
|
|
107
|
-
var complete = (context) => {
|
|
108
|
-
const typed = context.matchBefore(WORD);
|
|
109
|
-
if (!typed?.text && !context.explicit) return null;
|
|
110
|
-
const from = typed?.from ?? context.pos;
|
|
111
|
-
const line = context.state.doc.lineAt(from);
|
|
112
|
-
const options = optionsAfter(
|
|
113
|
-
line.text.slice(0, from - line.from).split(/\s+/).filter(Boolean)
|
|
114
|
-
);
|
|
115
|
-
return options.length > 0 ? { from, options, validFor: WORD } : null;
|
|
116
|
-
};
|
|
117
|
-
var dbt = simpleMode({
|
|
118
|
-
languageData: {
|
|
119
|
-
// `toggleComment` is a no-op without these, so Mod-/ silently does nothing.
|
|
120
|
-
commentTokens: { line: "--", block: { open: "/*", close: "*/" } },
|
|
121
|
-
autocomplete: complete
|
|
122
|
-
},
|
|
123
|
-
start: [
|
|
124
|
-
{ regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: "string" },
|
|
125
|
-
// Word-bounded, so `dbtX` is not a dbt step whose first word happens to
|
|
126
|
-
// colour — the same thing the completion source asks of it.
|
|
127
|
-
{ regex: /dbt\b/, token: "keyword", sol: true },
|
|
128
|
-
{ regex: word(COMMAND_PHRASES), token: "keyword" },
|
|
129
|
-
{ regex: word(ARGUMENTS), token: "variableName" },
|
|
130
|
-
{ regex: prefix(METHODS), token: "propertyName" },
|
|
131
|
-
{ regex: prefix(FLAGS), token: "attributeName" },
|
|
132
|
-
{ regex: /(?:@|\*|,|\+\d+|\d+\+|\+)/, token: "operator" },
|
|
133
|
-
{ regex: /'.*'/, token: "string" },
|
|
134
|
-
{ regex: /true|false/, token: "atom" }
|
|
135
|
-
]
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// src/components/CodeEditor/modes/jsonnet.ts
|
|
139
|
-
var COMMENT_END = /^\*\//;
|
|
140
|
-
var COMMENT_START = /^\/\/|^#/;
|
|
141
|
-
var C_COMMENT_START = /^\/\*/;
|
|
142
|
-
var TEXT_BLOCK = /^\|\|\|/;
|
|
143
|
-
var TEXT_BLOCK_END = /^\s*\|\|\|/;
|
|
144
|
-
var RAW_DOUBLE = /^""/;
|
|
145
|
-
var RAW_SINGLE = /^''/;
|
|
146
|
-
var CLOSE_DOUBLE = /^"/;
|
|
147
|
-
var CLOSE_SINGLE = /^'/;
|
|
148
|
-
var ESCAPE = /^\\[\\"'/bfnrt0]/;
|
|
149
|
-
var UNICODE_ESCAPE = /^\\u[0-9a-fA-F]{4}/;
|
|
150
|
-
var BACKSLASH = /^\\/;
|
|
151
|
-
var IMPORT = /^import(?:str)?\s*(@?)(["'])/;
|
|
152
|
-
var QUOTE = /^(@?)(["'])/;
|
|
153
|
-
var ROOT = /^\$/;
|
|
154
|
-
var NUMBER = /^(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i;
|
|
155
|
-
var OPERATOR = /^[-+/*=<>!&~^|$%]+/;
|
|
156
|
-
var IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]*/;
|
|
157
|
-
var KEYWORDS = {
|
|
158
|
-
local: "keyword",
|
|
159
|
-
self: "keyword",
|
|
160
|
-
super: "keyword",
|
|
161
|
-
assert: "keyword",
|
|
162
|
-
function: "keyword",
|
|
163
|
-
if: "keyword",
|
|
164
|
-
then: "keyword",
|
|
165
|
-
else: "keyword",
|
|
166
|
-
for: "keyword",
|
|
167
|
-
in: "keyword",
|
|
168
|
-
tailstrict: "keyword",
|
|
169
|
-
error: "keyword",
|
|
170
|
-
true: "atom",
|
|
171
|
-
false: "atom",
|
|
172
|
-
null: "atom"
|
|
173
|
-
};
|
|
174
|
-
var jsonnet = {
|
|
175
|
-
name: "jsonnet",
|
|
176
|
-
// `toggleComment` is a no-op without these, so Mod-/ silently does nothing.
|
|
177
|
-
languageData: { commentTokens: { line: "//", block: { open: "/*", close: "*/" } } },
|
|
178
|
-
startState: () => ({
|
|
179
|
-
cComment: false,
|
|
180
|
-
textBlock: false,
|
|
181
|
-
textBlockIndent: null,
|
|
182
|
-
string: false,
|
|
183
|
-
importString: false,
|
|
184
|
-
stringSingle: false,
|
|
185
|
-
stringRaw: false
|
|
186
|
-
}),
|
|
187
|
-
token: (stream, state) => {
|
|
188
|
-
if (state.cComment) {
|
|
189
|
-
if (stream.match(COMMENT_END)) {
|
|
190
|
-
state.cComment = false;
|
|
191
|
-
return "comment";
|
|
192
|
-
}
|
|
193
|
-
stream.next();
|
|
194
|
-
return "comment";
|
|
195
|
-
}
|
|
196
|
-
if (state.textBlock) {
|
|
197
|
-
if (state.textBlockIndent == null) {
|
|
198
|
-
if (stream.match(TEXT_BLOCK_END)) {
|
|
199
|
-
state.textBlock = false;
|
|
200
|
-
return "string";
|
|
201
|
-
}
|
|
202
|
-
state.textBlockIndent = stream.indentation();
|
|
203
|
-
}
|
|
204
|
-
if (stream.indentation() >= state.textBlockIndent) {
|
|
205
|
-
stream.skipToEnd();
|
|
206
|
-
return "string";
|
|
207
|
-
}
|
|
208
|
-
if (stream.match(TEXT_BLOCK_END)) {
|
|
209
|
-
state.textBlock = false;
|
|
210
|
-
return "string";
|
|
211
|
-
}
|
|
212
|
-
stream.next();
|
|
213
|
-
return "invalid";
|
|
214
|
-
}
|
|
215
|
-
if (state.string || state.importString) {
|
|
216
|
-
const style = state.string ? "string" : "meta";
|
|
217
|
-
if (state.stringRaw) {
|
|
218
|
-
if (stream.match(state.stringSingle ? RAW_SINGLE : RAW_DOUBLE)) return "escape";
|
|
219
|
-
} else {
|
|
220
|
-
if (stream.match(ESCAPE)) return "escape";
|
|
221
|
-
if (stream.match(UNICODE_ESCAPE)) return "escape";
|
|
222
|
-
if (stream.match(BACKSLASH)) return "invalid";
|
|
223
|
-
}
|
|
224
|
-
if (stream.match(state.stringSingle ? CLOSE_SINGLE : CLOSE_DOUBLE)) {
|
|
225
|
-
state.string = false;
|
|
226
|
-
state.importString = false;
|
|
227
|
-
return style;
|
|
228
|
-
}
|
|
229
|
-
stream.next();
|
|
230
|
-
return style;
|
|
231
|
-
}
|
|
232
|
-
if (stream.match(COMMENT_START)) {
|
|
233
|
-
stream.skipToEnd();
|
|
234
|
-
return "comment";
|
|
235
|
-
}
|
|
236
|
-
if (stream.match(C_COMMENT_START)) {
|
|
237
|
-
state.cComment = true;
|
|
238
|
-
return "comment";
|
|
239
|
-
}
|
|
240
|
-
const imported = stream.match(IMPORT);
|
|
241
|
-
if (Array.isArray(imported)) {
|
|
242
|
-
state.importString = true;
|
|
243
|
-
state.stringRaw = imported[1] === "@";
|
|
244
|
-
state.stringSingle = imported[2] === "'";
|
|
245
|
-
return "meta";
|
|
246
|
-
}
|
|
247
|
-
const quoted = stream.match(QUOTE);
|
|
248
|
-
if (Array.isArray(quoted)) {
|
|
249
|
-
state.string = true;
|
|
250
|
-
state.stringRaw = quoted[1] === "@";
|
|
251
|
-
state.stringSingle = quoted[2] === "'";
|
|
252
|
-
return "string";
|
|
253
|
-
}
|
|
254
|
-
if (stream.match(TEXT_BLOCK)) {
|
|
255
|
-
state.textBlock = true;
|
|
256
|
-
state.textBlockIndent = null;
|
|
257
|
-
return "string";
|
|
258
|
-
}
|
|
259
|
-
if (stream.match(ROOT)) return "keyword";
|
|
260
|
-
if (stream.match(NUMBER)) return "number";
|
|
261
|
-
if (stream.match(OPERATOR)) return "operator";
|
|
262
|
-
const identifier = stream.match(IDENTIFIER);
|
|
263
|
-
if (Array.isArray(identifier)) return KEYWORDS[identifier[0]] ?? null;
|
|
264
|
-
stream.next();
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
// src/components/CodeEditor/helpers.ts
|
|
270
|
-
var LANGUAGE_MODES = [
|
|
271
|
-
"application/json",
|
|
272
|
-
"text/plain",
|
|
273
|
-
"text/x-python",
|
|
274
|
-
"text/x-sql",
|
|
275
|
-
"text/x-mysql",
|
|
276
|
-
"text/x-pgsql",
|
|
277
|
-
"text/x-mssql",
|
|
278
|
-
// Snowflake, under a historical name — these strings are a published prop contract.
|
|
279
|
-
"text/x-sfsql",
|
|
280
|
-
"text/x-bqsql",
|
|
281
|
-
"text/x-plsql",
|
|
282
|
-
"text/x-rsrc",
|
|
283
|
-
"text/x-sh",
|
|
284
|
-
"text/x-toml",
|
|
285
|
-
"text/jsonnet",
|
|
286
|
-
"text/x-dbt",
|
|
287
|
-
"text/javascript",
|
|
288
|
-
"text/typescript"
|
|
289
|
-
];
|
|
290
|
-
var isLanguageMode = (mode) => LANGUAGE_MODES.includes(mode);
|
|
291
|
-
var READ_ONLY_EDITOR = '&.cm-editor:has(.cm-content[contenteditable="false"])';
|
|
292
|
-
var EDITABLE_EDITOR = '&.cm-editor:has(.cm-content[contenteditable="true"])';
|
|
293
|
-
var buildBaseThemeStyles = () => ({
|
|
294
|
-
"*": { lineHeight: "20px" },
|
|
295
|
-
"*::selection": {
|
|
296
|
-
backgroundColor: resolveToken("primary", "31 143 255"),
|
|
297
|
-
color: `${resolveToken("primary-foreground", "255 255 255")} !important`
|
|
298
|
-
},
|
|
299
|
-
[READ_ONLY_EDITOR]: {
|
|
300
|
-
backgroundColor: resolveToken("secondary", "226 232 240")
|
|
301
|
-
},
|
|
302
|
-
[`${READ_ONLY_EDITOR} .cm-gutters`]: {
|
|
303
|
-
backgroundColor: resolveToken("border", "229 231 235")
|
|
304
|
-
},
|
|
305
|
-
"&.cm-editor .cm-scroller": { overflowAnchor: "none" },
|
|
306
|
-
"&.cm-editor, &.cm-editor .cm-scroller": {
|
|
307
|
-
minHeight: "100%",
|
|
308
|
-
flexGrow: 1,
|
|
309
|
-
alignItems: "stretch !important",
|
|
310
|
-
outline: "none"
|
|
311
|
-
},
|
|
312
|
-
".cm-gutter.cm-foldGutter": { display: "none !important" },
|
|
313
|
-
".cm-gutter.cm-lineNumbers": { paddingLeft: "20px", paddingRight: "6px" },
|
|
314
|
-
".cm-gutters": { height: "auto" },
|
|
315
|
-
// merge (diff) view
|
|
316
|
-
'&[class*="cm-merge-"] .cm-deletedLine': { backgroundColor: colors.error[100] },
|
|
317
|
-
'&[class*="cm-merge-"] .cm-changedLine': { backgroundColor: colors.green[100] },
|
|
318
|
-
'&[class*="cm-merge-"] .cm-deletedLineGutter': { backgroundColor: colors.error[200] },
|
|
319
|
-
'&[class*="cm-merge-"] .cm-changedLineGutter': { backgroundColor: colors.green[200] },
|
|
320
|
-
'&[class*="cm-merge-"] .cm-deletedText': { background: colors.error[200] },
|
|
321
|
-
'&[class*="cm-merge-"] .cm-changedText': { background: colors.green[200] },
|
|
322
|
-
'&[class*="cm-merge-"]': {
|
|
323
|
-
backgroundColor: `${colors.white} !important`
|
|
324
|
-
},
|
|
325
|
-
'&[class*="cm-merge-"] .cm-gutters': {
|
|
326
|
-
backgroundColor: `${colors.white} !important`
|
|
327
|
-
},
|
|
328
|
-
".cm-changeGutter": { position: "absolute", zIndex: -1, width: "100%", paddingLeft: 0 },
|
|
329
|
-
'&[class*="cm-merge-"] .cm-changedLine,&[class*="cm-merge-"] .cm-line, &[class*="cm-merge-"] .cm-deletedChunk': { paddingLeft: 0 }
|
|
330
|
-
});
|
|
331
|
-
var ALWAYS_OFF = {
|
|
332
|
-
drawSelection: false,
|
|
333
|
-
foldGutter: false,
|
|
334
|
-
foldKeymap: false,
|
|
335
|
-
highlightActiveLine: false,
|
|
336
|
-
highlightActiveLineGutter: false
|
|
337
|
-
};
|
|
338
|
-
var buildBasicSetup = (readOnly) => ({
|
|
339
|
-
...ALWAYS_OFF,
|
|
340
|
-
...readOnly ? {
|
|
341
|
-
closeBrackets: false,
|
|
342
|
-
closeBracketsKeymap: false,
|
|
343
|
-
lintKeymap: false,
|
|
344
|
-
indentOnInput: false,
|
|
345
|
-
rectangularSelection: false,
|
|
346
|
-
dropCursor: false,
|
|
347
|
-
highlightSelectionMatches: false
|
|
348
|
-
} : null
|
|
349
|
-
});
|
|
350
|
-
var buildCustomTheme = () => {
|
|
351
|
-
const foreground = resolveToken("foreground", "30 41 59");
|
|
352
|
-
return githubLightInit({
|
|
353
|
-
settings: {
|
|
354
|
-
fontFamily: `'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New'`,
|
|
355
|
-
background: resolveToken("background", "249 250 251"),
|
|
356
|
-
foreground,
|
|
357
|
-
gutterBackground: resolveToken("muted", "241 245 249"),
|
|
358
|
-
gutterForeground: resolveToken("muted-foreground", "100 116 139"),
|
|
359
|
-
gutterBorder: "transparent",
|
|
360
|
-
lineHighlight: "transparent",
|
|
361
|
-
selection: resolveToken("primary", "31 143 255")
|
|
362
|
-
},
|
|
363
|
-
styles: [
|
|
364
|
-
{ tag: [tags.name, tags.special(tags.string), tags.bracket], color: foreground },
|
|
365
|
-
{ tag: tags.standard(tags.name), color: colors.purple[600] },
|
|
366
|
-
{ tag: tags.special(tags.name), color: colors.cyan[700] },
|
|
367
|
-
{ tag: tags.string, color: colors.warning[700] }
|
|
368
|
-
]
|
|
369
|
-
});
|
|
370
|
-
};
|
|
371
|
-
var getLanguageMode = (mode) => {
|
|
372
|
-
switch (mode) {
|
|
373
|
-
case void 0:
|
|
374
|
-
case "application/json":
|
|
375
|
-
return json();
|
|
376
|
-
case "text/x-python":
|
|
377
|
-
return python();
|
|
378
|
-
case "text/x-sql":
|
|
379
|
-
return getSqlLanguageSupport(StandardSQL);
|
|
380
|
-
case "text/x-mysql":
|
|
381
|
-
return getSqlLanguageSupport(MySQL);
|
|
382
|
-
case "text/x-pgsql":
|
|
383
|
-
return getSqlLanguageSupport(PostgreSQL);
|
|
384
|
-
case "text/x-mssql":
|
|
385
|
-
return getSqlLanguageSupport(MSSQL);
|
|
386
|
-
case "text/x-sfsql":
|
|
387
|
-
return getSqlLanguageSupport("snowflake");
|
|
388
|
-
case "text/x-bqsql":
|
|
389
|
-
return getSqlLanguageSupport("bigquery");
|
|
390
|
-
case "text/x-plsql":
|
|
391
|
-
return getSqlLanguageSupport(PLSQL);
|
|
392
|
-
case "text/x-rsrc":
|
|
393
|
-
return StreamLanguage.define(r);
|
|
394
|
-
case "text/x-sh":
|
|
395
|
-
return StreamLanguage.define(shell);
|
|
396
|
-
case "text/x-toml":
|
|
397
|
-
return StreamLanguage.define(toml);
|
|
398
|
-
case "text/jsonnet":
|
|
399
|
-
return StreamLanguage.define(jsonnet);
|
|
400
|
-
case "text/x-dbt":
|
|
401
|
-
return StreamLanguage.define(dbt);
|
|
402
|
-
case "text/javascript":
|
|
403
|
-
return javascript({ jsx: true });
|
|
404
|
-
case "text/typescript":
|
|
405
|
-
return javascript({ jsx: true, typescript: true });
|
|
406
|
-
// No language — `text/plain` lands here, and so does any mode added to
|
|
407
|
-
// LANGUAGE_MODES without an arm above. Unstyled text is the safe degradation;
|
|
408
|
-
// a `json()` default would colour unrelated content as if it were JSON.
|
|
409
|
-
default:
|
|
410
|
-
return [];
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
var shouldLintJson = (mode, readOnly) => mode === "application/json" && !readOnly;
|
|
414
|
-
var ButtonToolbar = ({ value, children }) => {
|
|
415
|
-
if (!value && !children) return null;
|
|
416
|
-
return /* @__PURE__ */ jsxs("div", { className: "tw:absolute tw:right-3 tw:top-1 tw:z-10 tw:flex tw:gap-0.5 tw:overflow-visible tw:rounded tw:border tw:border-solid tw:border-border tw:!bg-background tw:p-px tw:shadow-sm", children: [
|
|
417
|
-
!!value && /* @__PURE__ */ jsx(ClipboardButton, { size: "icon-xs", variant: "invisible", text: value }),
|
|
418
|
-
children
|
|
419
|
-
] });
|
|
420
|
-
};
|
|
421
|
-
var buildInputChrome = (isArgo) => ({
|
|
422
|
-
surface: isArgo ? resolveToken("muted", "241 245 249") : colors.neutral[100],
|
|
423
|
-
borderColor: isArgo ? resolveToken("input", "203 213 225") : colors.neutral[100],
|
|
424
|
-
readOnlySurface: isArgo ? resolveToken("muted", "241 245 249") : colors.neutral[150],
|
|
425
|
-
readOnlyBorderColor: isArgo ? resolveToken("input", "203 213 225") : colors.neutral[150],
|
|
426
|
-
hoverBorderColor: null,
|
|
427
|
-
focusBorderColor: isArgo ? resolveToken("primary", "37 99 235") : resolveToken("ring", "31 143 255"),
|
|
428
|
-
focusRing: `0 0 0 4px ${resolveToken("ring", "31 143 255", isArgo ? 0.5 : 0.3)}`,
|
|
429
|
-
radius: isArgo ? "var(--radius-lg, 0.25rem)" : "0.25rem",
|
|
430
|
-
// 2px border + 2×this + `.cm-content`'s own 4px + a 20px line, against the
|
|
431
|
-
// height a one-line `TextInput` has: argo forces `sizing: 'medium'` (36px),
|
|
432
|
-
// legacy leaves it at `default` (40px).
|
|
433
|
-
paddingY: isArgo ? "3px" : "5px",
|
|
434
|
-
// Tops `.cm-line`'s 6px/2px up to the 16px an input's text is inset by.
|
|
435
|
-
paddingX: { left: "10px", right: "14px" }
|
|
436
|
-
});
|
|
437
|
-
var buildCanvasChrome = () => ({
|
|
438
|
-
surface: resolveToken("card", "255 255 255"),
|
|
439
|
-
borderColor: "transparent",
|
|
440
|
-
readOnlySurface: resolveToken("muted", "241 245 249"),
|
|
441
|
-
readOnlyBorderColor: "transparent",
|
|
442
|
-
hoverBorderColor: resolveToken("ring", "31 143 255"),
|
|
443
|
-
focusBorderColor: resolveToken("ring", "31 143 255"),
|
|
444
|
-
focusRing: `0 0 0 4px ${resolveToken("ring", "31 143 255", 0.3)}`,
|
|
445
|
-
radius: "8px",
|
|
446
|
-
paddingY: "8px",
|
|
447
|
-
paddingX: null
|
|
448
|
-
});
|
|
449
|
-
var buildChromeStyles = (chrome) => ({
|
|
450
|
-
"&.cm-editor": {
|
|
451
|
-
border: `solid 1px ${chrome.borderColor}`,
|
|
452
|
-
borderRadius: chrome.radius,
|
|
453
|
-
backgroundColor: chrome.surface,
|
|
454
|
-
paddingTop: chrome.paddingY,
|
|
455
|
-
paddingBottom: chrome.paddingY
|
|
456
|
-
},
|
|
457
|
-
"&.cm-editor :is(.cm-gutters,.cm-scroller)": { backgroundColor: chrome.surface },
|
|
458
|
-
...chrome.paddingX ? {
|
|
459
|
-
// Only without a gutter: there the editor reads as a one-line input and
|
|
460
|
-
// its text should start where a neighbouring `TextInput`'s does. With a
|
|
461
|
-
// gutter, the gutter owns the left edge.
|
|
462
|
-
"&.cm-editor:not(:has(.cm-gutters)) .cm-content": {
|
|
463
|
-
paddingLeft: chrome.paddingX.left,
|
|
464
|
-
paddingRight: chrome.paddingX.right
|
|
465
|
-
}
|
|
466
|
-
} : null,
|
|
467
|
-
...chrome.hoverBorderColor ? { [`${EDITABLE_EDITOR}:hover`]: { borderColor: chrome.hoverBorderColor } } : null,
|
|
468
|
-
[`${EDITABLE_EDITOR}:focus-within`]: {
|
|
469
|
-
borderColor: chrome.focusBorderColor,
|
|
470
|
-
boxShadow: chrome.focusRing
|
|
471
|
-
},
|
|
472
|
-
[READ_ONLY_EDITOR]: {
|
|
473
|
-
backgroundColor: chrome.readOnlySurface,
|
|
474
|
-
borderColor: chrome.readOnlyBorderColor
|
|
475
|
-
},
|
|
476
|
-
[`${READ_ONLY_EDITOR} .cm-gutters`]: { backgroundColor: chrome.readOnlySurface },
|
|
477
|
-
[`${READ_ONLY_EDITOR} .cm-scroller`]: { backgroundColor: chrome.readOnlySurface }
|
|
478
|
-
});
|
|
479
|
-
var setSearchEffect = StateEffect.define();
|
|
480
|
-
function findMatches(doc, query) {
|
|
481
|
-
if (!query) return [];
|
|
482
|
-
const text = doc.toString();
|
|
483
|
-
try {
|
|
484
|
-
const regex = new RegExp(escapeStringRegexp(query), "gi");
|
|
485
|
-
return Array.from(text.matchAll(regex)).map((match, index) => {
|
|
486
|
-
const from = match.index;
|
|
487
|
-
const to = from + match[0].length;
|
|
488
|
-
return { from, to, text: match[0], localIndex: index };
|
|
489
|
-
});
|
|
490
|
-
} catch (e) {
|
|
491
|
-
console.warn("Invalid search regex:", e);
|
|
492
|
-
return [];
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
function createDecorations(matches, selectedLocalIndex) {
|
|
496
|
-
const decorations = matches.map((match) => {
|
|
497
|
-
const isSelected = match.localIndex === selectedLocalIndex;
|
|
498
|
-
const decoration = Decoration.mark({
|
|
499
|
-
class: isSelected ? "cm-searchMatch-selected" : "cm-searchMatch"
|
|
500
|
-
});
|
|
501
|
-
return decoration.range(match.from, match.to);
|
|
502
|
-
});
|
|
503
|
-
return Decoration.set(decorations, true);
|
|
504
|
-
}
|
|
505
|
-
var searchField = StateField.define({
|
|
506
|
-
create() {
|
|
507
|
-
return {
|
|
508
|
-
query: "",
|
|
509
|
-
selectedMatchIndex: void 0,
|
|
510
|
-
matches: [],
|
|
511
|
-
decorations: Decoration.none
|
|
512
|
-
};
|
|
513
|
-
},
|
|
514
|
-
update(state, tr) {
|
|
515
|
-
let newState = state;
|
|
516
|
-
for (const effect of tr.effects) {
|
|
517
|
-
if (!effect.is(setSearchEffect)) {
|
|
518
|
-
continue;
|
|
519
|
-
}
|
|
520
|
-
const { query, selectedMatchIndex } = effect.value;
|
|
521
|
-
const matches = findMatches(tr.state.doc, query);
|
|
522
|
-
const decorations = createDecorations(matches, selectedMatchIndex);
|
|
523
|
-
newState = {
|
|
524
|
-
query,
|
|
525
|
-
selectedMatchIndex,
|
|
526
|
-
matches,
|
|
527
|
-
decorations
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
if (tr.docChanged && newState.query) {
|
|
531
|
-
const matches = findMatches(tr.state.doc, newState.query);
|
|
532
|
-
const decorations = createDecorations(matches, newState.selectedMatchIndex);
|
|
533
|
-
newState = {
|
|
534
|
-
...newState,
|
|
535
|
-
matches,
|
|
536
|
-
decorations
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
return newState;
|
|
540
|
-
},
|
|
541
|
-
provide: (field) => EditorView.decorations.from(field, (state) => state.decorations)
|
|
542
|
-
});
|
|
543
|
-
var searchViewPlugin = ViewPlugin.fromClass(
|
|
544
|
-
class {
|
|
545
|
-
lastSelectedIndex;
|
|
546
|
-
update(update) {
|
|
547
|
-
const state = update.state.field(searchField);
|
|
548
|
-
if (state.selectedMatchIndex !== void 0 && state.selectedMatchIndex !== this.lastSelectedIndex) {
|
|
549
|
-
const match = state.matches[state.selectedMatchIndex];
|
|
550
|
-
if (match) {
|
|
551
|
-
requestAnimationFrame(() => {
|
|
552
|
-
update.view.dispatch({
|
|
553
|
-
effects: EditorView.scrollIntoView(match.from, { y: "center" })
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
this.lastSelectedIndex = state.selectedMatchIndex;
|
|
558
|
-
}
|
|
559
|
-
if (state.selectedMatchIndex === void 0) {
|
|
560
|
-
this.lastSelectedIndex = void 0;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
);
|
|
565
|
-
var searchTheme = EditorView.baseTheme({
|
|
566
|
-
".cm-searchMatch": {
|
|
567
|
-
backgroundColor: colors.blue[100]
|
|
568
|
-
},
|
|
569
|
-
".cm-searchMatch > span": {
|
|
570
|
-
color: `${colors.blue[600]} !important`
|
|
571
|
-
},
|
|
572
|
-
".cm-searchMatch-selected": {
|
|
573
|
-
backgroundColor: colors.blue[600]
|
|
574
|
-
},
|
|
575
|
-
".cm-searchMatch-selected > span": {
|
|
576
|
-
color: `${colors.white} !important`
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
function searchExtension() {
|
|
580
|
-
return [searchField, searchViewPlugin, searchTheme];
|
|
581
|
-
}
|
|
582
|
-
function updateSearch(view, query, selectedMatchIndex) {
|
|
583
|
-
view.dispatch({ effects: setSearchEffect.of({ query, selectedMatchIndex }) });
|
|
584
|
-
}
|
|
585
|
-
var ToggleComponentHelp = () => /* @__PURE__ */ jsxs("div", { children: [
|
|
586
|
-
"Use ",
|
|
587
|
-
/* @__PURE__ */ jsx(Kbd, { children: isMac ? "Command+/" : "Ctrl+/" }),
|
|
588
|
-
" to toggle comments."
|
|
589
|
-
] });
|
|
590
|
-
|
|
591
|
-
// src/components/CodeEditor/tokenTheme.ts
|
|
592
|
-
var themeCache = /* @__PURE__ */ new Map();
|
|
593
|
-
var useThemedExtension = (cacheKey, build) => {
|
|
594
|
-
const { scheme, cacheKey: themeKey } = useThemeAttributes();
|
|
595
|
-
const key = `${themeKey} ${cacheKey}`;
|
|
596
|
-
let cached = themeCache.get(key);
|
|
597
|
-
if (!cached) {
|
|
598
|
-
cached = build(scheme);
|
|
599
|
-
themeCache.set(key, cached);
|
|
600
|
-
}
|
|
601
|
-
return cached;
|
|
602
|
-
};
|
|
603
|
-
var establishesFixedContainingBlock = (style) => style.transform !== "none" || style.translate !== "none" || style.rotate !== "none" || style.scale !== "none" || style.perspective !== "none" || style.filter !== "none" || style.backdropFilter !== "none" || /\b(paint|layout|strict|content)\b/.test(style.contain) || /\b(transform|perspective|filter|contain)\b/.test(style.willChange);
|
|
604
|
-
var crops = (style) => style.overflowX !== "visible" || style.overflowY !== "visible" || style.maskImage !== "none" || style.contentVisibility !== "visible" || /\b(paint|strict|content)\b/.test(style.contain);
|
|
605
|
-
var findTooltipHost = (from) => {
|
|
606
|
-
let outermostCropper = null;
|
|
607
|
-
for (let node = from.parentElement; node && node !== document.body; node = node.parentElement) {
|
|
608
|
-
const style = getComputedStyle(node);
|
|
609
|
-
if (crops(style)) {
|
|
610
|
-
outermostCropper = node;
|
|
611
|
-
} else if (establishesFixedContainingBlock(style)) {
|
|
612
|
-
return outermostCropper?.parentElement ?? node;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
return outermostCropper?.parentElement ?? null;
|
|
616
|
-
};
|
|
617
|
-
var tooltipsExtension = () => {
|
|
618
|
-
const layer = new Compartment();
|
|
619
|
-
return [
|
|
620
|
-
layer.of(tooltips()),
|
|
621
|
-
ViewPlugin.define((view) => {
|
|
622
|
-
const scheduled = setTimeout(() => {
|
|
623
|
-
if (!view.dom.isConnected) return;
|
|
624
|
-
const parent = findTooltipHost(view.dom);
|
|
625
|
-
if (parent) view.dispatch({ effects: layer.reconfigure(tooltips({ parent })) });
|
|
626
|
-
});
|
|
627
|
-
return { destroy: () => clearTimeout(scheduled) };
|
|
628
|
-
})
|
|
629
|
-
];
|
|
630
|
-
};
|
|
631
|
-
var useTooltipsExtension = () => useMemo(tooltipsExtension, []);
|
|
632
|
-
|
|
633
|
-
// src/components/CodeEditor/variableCompletion.ts
|
|
634
|
-
var BOOST = 2e3;
|
|
635
|
-
var NAME = String.raw`[\w-]*`;
|
|
636
|
-
var AT_CARET = new RegExp(String.raw`(?:\{{1,2} ?)?${NAME}$`);
|
|
637
|
-
var NAME_AT_END = new RegExp(`${NAME}$`);
|
|
638
|
-
var OPENING = /\{{1,2} ?$/;
|
|
639
|
-
var CLOSING = /^ ?\}{1,2}/;
|
|
640
|
-
var completeVariables = (variables = []) => {
|
|
641
|
-
if (variables.length === 0) return () => null;
|
|
642
|
-
const options = variables.map(({ name, value }) => ({
|
|
643
|
-
// The bare name: `SqlEditor` filters prefix-only while `CodeEditor` filters
|
|
644
|
-
// fuzzily, and this is the only spelling both accept whether or not the caret
|
|
645
|
-
// has typed the braces. The braces are `displayLabel`, which is what renders.
|
|
646
|
-
label: name,
|
|
647
|
-
displayLabel: `{{${name}}}`,
|
|
648
|
-
detail: value,
|
|
649
|
-
type: "variable",
|
|
650
|
-
boost: BOOST,
|
|
651
|
-
apply: (view, completion, from, to) => {
|
|
652
|
-
const { doc } = view.state;
|
|
653
|
-
const line = doc.lineAt(from);
|
|
654
|
-
const insert = `{{${completion.label}}}`;
|
|
655
|
-
const opening = OPENING.exec(doc.sliceString(line.from, from));
|
|
656
|
-
const closing = CLOSING.exec(doc.sliceString(to, line.to));
|
|
657
|
-
const start = opening ? from - opening[0].length : from;
|
|
658
|
-
const end = closing ? to + closing[0].length : to;
|
|
659
|
-
view.dispatch({
|
|
660
|
-
changes: { from: start, to: end, insert },
|
|
661
|
-
selection: { anchor: start + insert.length }
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
}));
|
|
665
|
-
return (context) => {
|
|
666
|
-
const match = context.matchBefore(AT_CARET);
|
|
667
|
-
if (!match?.text) return null;
|
|
668
|
-
const [name = ""] = NAME_AT_END.exec(match.text) ?? [];
|
|
669
|
-
return { from: match.to - name.length, options };
|
|
670
|
-
};
|
|
671
|
-
};
|
|
672
|
-
var useVariableCompletion = (variables = []) => useStableCallback(completeVariables(variables));
|
|
673
|
-
var emptyObject = {};
|
|
674
|
-
var CodeEditor = ({
|
|
675
|
-
value,
|
|
676
|
-
previousValue,
|
|
677
|
-
onChange,
|
|
678
|
-
variant = "plain",
|
|
679
|
-
mode = "application/json",
|
|
680
|
-
placeholder: placeholder$1 = "",
|
|
681
|
-
ariaLabel,
|
|
682
|
-
searchQuery,
|
|
683
|
-
searchMatchIndex,
|
|
684
|
-
readOnly = false,
|
|
685
|
-
inputLocked = false,
|
|
686
|
-
autocompletions,
|
|
687
|
-
completionSource,
|
|
688
|
-
variables,
|
|
689
|
-
extraKeys = emptyObject,
|
|
690
|
-
withToggleCommentHint = false,
|
|
691
|
-
withAutofocus = false,
|
|
692
|
-
withLineNumbers = true,
|
|
693
|
-
withLineWrapping = true,
|
|
694
|
-
withCollapseUnchanged = false,
|
|
695
|
-
withCopyButton = false,
|
|
696
|
-
completeAny = false,
|
|
697
|
-
help = null,
|
|
698
|
-
helpPostfix = null,
|
|
699
|
-
renderAdditionalButtons,
|
|
700
|
-
className
|
|
701
|
-
}) => {
|
|
702
|
-
const handleChange = useStableCallback((next) => onChange?.(next));
|
|
703
|
-
const withSearch = searchQuery !== void 0;
|
|
704
|
-
const editorRef = useRef(null);
|
|
705
|
-
useEffect(() => {
|
|
706
|
-
const view = editorRef.current?.view;
|
|
707
|
-
if (view && withSearch) updateSearch(view, searchQuery, searchMatchIndex);
|
|
708
|
-
}, [withSearch, searchQuery, searchMatchIndex]);
|
|
709
|
-
const handleCreateEditor = useStableCallback((view) => {
|
|
710
|
-
if (searchQuery) updateSearch(view, searchQuery, searchMatchIndex);
|
|
711
|
-
});
|
|
712
|
-
const extraKeysRef = useRef(extraKeys);
|
|
713
|
-
useLayoutEffect(() => {
|
|
714
|
-
extraKeysRef.current = extraKeys;
|
|
715
|
-
});
|
|
716
|
-
const boundKeysSignature = Object.keys(extraKeys).join("\n");
|
|
717
|
-
const boundKeys = useMemo(
|
|
718
|
-
() => boundKeysSignature.split("\n").filter(Boolean),
|
|
719
|
-
[boundKeysSignature]
|
|
720
|
-
);
|
|
721
|
-
const tooltipLayer = useTooltipsExtension();
|
|
722
|
-
const variableCompletion = useVariableCompletion(variables);
|
|
723
|
-
const customTheme = useThemedExtension("editor:syntax", buildCustomTheme);
|
|
724
|
-
const isArgo = useArgoDesign();
|
|
725
|
-
const isField = variant === "field";
|
|
726
|
-
const baseTheme = useThemedExtension(
|
|
727
|
-
isField ? `code-editor:field:${isArgo ? "argo" : "legacy"}` : "code-editor:chrome",
|
|
728
|
-
() => EditorView.theme({
|
|
729
|
-
...buildBaseThemeStyles(),
|
|
730
|
-
...isField ? buildChromeStyles(buildInputChrome(isArgo)) : null
|
|
731
|
-
})
|
|
732
|
-
);
|
|
733
|
-
const commonExtensions = useMemo(() => {
|
|
734
|
-
const callerCompletions = completionSource ?? (completeAny ? completeAnyWord : autocompletions?.length ? autocompletions : null);
|
|
735
|
-
const completionEntries = [
|
|
736
|
-
...callerCompletions ? [{ autocomplete: callerCompletions }] : [],
|
|
737
|
-
{ autocomplete: variableCompletion }
|
|
738
|
-
];
|
|
739
|
-
return [
|
|
740
|
-
getLanguageMode(mode),
|
|
741
|
-
shouldLintJson(mode, readOnly) ? linter(jsonParseLinter()) : [],
|
|
742
|
-
withLineWrapping ? EditorView.lineWrapping : [],
|
|
743
|
-
EditorState.languageData.of(() => completionEntries),
|
|
744
|
-
keymap$1.of(
|
|
745
|
-
boundKeys.map((key) => ({
|
|
746
|
-
key,
|
|
747
|
-
run: () => {
|
|
748
|
-
extraKeysRef.current[key]?.();
|
|
749
|
-
return true;
|
|
750
|
-
}
|
|
751
|
-
}))
|
|
752
|
-
),
|
|
753
|
-
readOnly ? [] : [
|
|
754
|
-
// CodeMirror's own default. Gating it on the props hid completions the
|
|
755
|
-
// *language* supplies — dbt's vocabulary, Snowflake's keywords — behind
|
|
756
|
-
// a shortcut, and macOS leaves no usable one. With nothing to offer, no
|
|
757
|
-
// popup opens anyway.
|
|
758
|
-
autocompletion()
|
|
759
|
-
],
|
|
760
|
-
ariaLabel ? EditorView.contentAttributes.of({ "aria-label": ariaLabel }) : [],
|
|
761
|
-
withSearch ? searchExtension() : [],
|
|
762
|
-
tooltipLayer,
|
|
763
|
-
baseTheme
|
|
764
|
-
];
|
|
765
|
-
}, [
|
|
766
|
-
autocompletions,
|
|
767
|
-
completionSource,
|
|
768
|
-
variableCompletion,
|
|
769
|
-
completeAny,
|
|
770
|
-
boundKeys,
|
|
771
|
-
mode,
|
|
772
|
-
readOnly,
|
|
773
|
-
withLineWrapping,
|
|
774
|
-
baseTheme,
|
|
775
|
-
ariaLabel,
|
|
776
|
-
withSearch,
|
|
777
|
-
tooltipLayer
|
|
778
|
-
]);
|
|
779
|
-
const extensions = useMemo(() => {
|
|
780
|
-
return [
|
|
781
|
-
...commonExtensions,
|
|
782
|
-
placeholder(placeholder$1),
|
|
783
|
-
EditorView.editable.of(!readOnly),
|
|
784
|
-
// The lock is this facet and nothing else. `contenteditable` is what the
|
|
785
|
-
// read-only wash keys off, and `basicSetup` is what holds the undo history,
|
|
786
|
-
// so leaving both alone is what makes the lock invisible.
|
|
787
|
-
EditorState.readOnly.of(readOnly || inputLocked),
|
|
788
|
-
previousValue ? unifiedMergeView({
|
|
789
|
-
original: previousValue,
|
|
790
|
-
mergeControls: false,
|
|
791
|
-
highlightChanges: false,
|
|
792
|
-
collapseUnchanged: withCollapseUnchanged ? {} : void 0
|
|
793
|
-
}) : []
|
|
794
|
-
];
|
|
795
|
-
}, [commonExtensions, placeholder$1, readOnly, inputLocked, previousValue, withCollapseUnchanged]);
|
|
796
|
-
const config = useMemo(() => {
|
|
797
|
-
return {
|
|
798
|
-
...buildBasicSetup(readOnly),
|
|
799
|
-
lineNumbers: withLineNumbers,
|
|
800
|
-
// Mod-f opens CodeMirror's own panel, which would run a second query and a
|
|
801
|
-
// second match count over the same document beside the caller's input.
|
|
802
|
-
...withSearch ? { searchKeymap: false } : null
|
|
803
|
-
};
|
|
804
|
-
}, [withLineNumbers, readOnly, withSearch]);
|
|
805
|
-
return (
|
|
806
|
-
// oxlint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
807
|
-
/* @__PURE__ */ jsxs(
|
|
808
|
-
"div",
|
|
809
|
-
{
|
|
810
|
-
"data-variant": variant,
|
|
811
|
-
className: cn(
|
|
812
|
-
// Scoped to the box CodeMirror renders into rather than to every child, so
|
|
813
|
-
// the toolbar below does not have to undo all three in `!important`.
|
|
814
|
-
"tw:relative tw:flex tw:min-h-0 tw:flex-col tw:[&_.cm-mergeViewEditor]:overflow-visible tw:[&_.cm-mergeViewEditors]:h-full tw:[&_.cm-mergeView]:h-full tw:[&_>.cm-theme]:h-full",
|
|
815
|
-
// A field's `.cm-editor` is rounded, so the square box behind it would show
|
|
816
|
-
// at the corners, and `overflow-auto` would crop the focus ring — a shadow
|
|
817
|
-
// painted outside the editor's own box.
|
|
818
|
-
isField ? "tw:[&_>.cm-theme]:overflow-visible tw:[&_>.cm-theme]:bg-transparent" : "tw:[&_>.cm-theme]:overflow-auto tw:[&_>.cm-theme]:bg-background",
|
|
819
|
-
className
|
|
820
|
-
),
|
|
821
|
-
onKeyDown: (event) => {
|
|
822
|
-
if (event.key === keyCodes.ESCAPE) {
|
|
823
|
-
event.stopPropagation();
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
children: [
|
|
827
|
-
/* @__PURE__ */ jsx(ButtonToolbar, { value: withCopyButton ? value : void 0, children: renderAdditionalButtons?.(value) }),
|
|
828
|
-
/* @__PURE__ */ jsx(
|
|
829
|
-
CodeMirror,
|
|
830
|
-
{
|
|
831
|
-
ref: editorRef,
|
|
832
|
-
onCreateEditor: handleCreateEditor,
|
|
833
|
-
theme: customTheme,
|
|
834
|
-
value,
|
|
835
|
-
onChange: handleChange,
|
|
836
|
-
extensions,
|
|
837
|
-
autoFocus: withAutofocus,
|
|
838
|
-
basicSetup: config
|
|
839
|
-
}
|
|
840
|
-
),
|
|
841
|
-
!readOnly && (withToggleCommentHint || help || helpPostfix) && /* @__PURE__ */ jsxs(HelpBlock, { className: "tw:mt-2 tw:flex tw:flex-wrap tw:gap-1", children: [
|
|
842
|
-
help,
|
|
843
|
-
withToggleCommentHint ? /* @__PURE__ */ jsx(ToggleComponentHelp, {}) : null,
|
|
844
|
-
helpPostfix
|
|
845
|
-
] })
|
|
846
|
-
]
|
|
847
|
-
}
|
|
848
|
-
)
|
|
849
|
-
);
|
|
850
|
-
};
|
|
851
|
-
var activeQueryFirstLine = Decoration.line({ class: "cm-active-query cm-active-query-first" });
|
|
852
|
-
var activeQueryMiddleLine = Decoration.line({ class: "cm-active-query" });
|
|
853
|
-
var activeQueryLastLine = Decoration.line({ class: "cm-active-query cm-active-query-last" });
|
|
854
|
-
var activeQuerySingleLine = Decoration.line({
|
|
855
|
-
class: "cm-active-query cm-active-query-first cm-active-query-last"
|
|
856
|
-
});
|
|
857
|
-
var findActiveQueryRange = (doc, cursorPos, boundaries) => {
|
|
858
|
-
if (boundaries.length === 0) return null;
|
|
859
|
-
let match = boundaries[boundaries.length - 1];
|
|
860
|
-
for (const boundary of boundaries) {
|
|
861
|
-
if (cursorPos <= boundary.to) {
|
|
862
|
-
match = boundary;
|
|
863
|
-
break;
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
if (!match) return null;
|
|
867
|
-
const queryText = doc.slice(match.from, match.to);
|
|
868
|
-
const leadingWhitespace = queryText.length - queryText.trimStart().length;
|
|
869
|
-
const trailingWhitespace = queryText.length - queryText.trimEnd().length;
|
|
870
|
-
const trimmedStart = match.from + leadingWhitespace;
|
|
871
|
-
const trimmedEnd = match.to - trailingWhitespace;
|
|
872
|
-
if (trimmedStart >= trimmedEnd) return null;
|
|
873
|
-
return { from: trimmedStart, to: trimmedEnd };
|
|
874
|
-
};
|
|
875
|
-
var computeBoundaries = (queries) => {
|
|
876
|
-
const boundaries = [];
|
|
877
|
-
let offset = 0;
|
|
878
|
-
for (const query of queries) {
|
|
879
|
-
boundaries.push({ from: offset, to: offset + query.length });
|
|
880
|
-
offset += query.length;
|
|
881
|
-
}
|
|
882
|
-
return boundaries;
|
|
883
|
-
};
|
|
884
|
-
var mapBoundariesThroughChanges = (boundaries, changes) => {
|
|
885
|
-
const prevLen = changes.length;
|
|
886
|
-
const mapped = [];
|
|
887
|
-
for (const b of boundaries) {
|
|
888
|
-
const from = changes.mapPos(Math.max(0, Math.min(b.from, prevLen)), -1);
|
|
889
|
-
const to = changes.mapPos(Math.max(0, Math.min(b.to, prevLen)), 1);
|
|
890
|
-
if (from < to) mapped.push({ from, to });
|
|
891
|
-
}
|
|
892
|
-
return mapped;
|
|
893
|
-
};
|
|
894
|
-
var buildDecorations = (view, range) => {
|
|
895
|
-
const startLine = view.state.doc.lineAt(range.from).number;
|
|
896
|
-
const endLine = view.state.doc.lineAt(range.to).number;
|
|
897
|
-
const decorations = [];
|
|
898
|
-
for (let lineNum = startLine; lineNum <= endLine; lineNum++) {
|
|
899
|
-
const lineStart = view.state.doc.line(lineNum).from;
|
|
900
|
-
if (startLine === endLine) {
|
|
901
|
-
decorations.push(activeQuerySingleLine.range(lineStart));
|
|
902
|
-
} else if (lineNum === startLine) {
|
|
903
|
-
decorations.push(activeQueryFirstLine.range(lineStart));
|
|
904
|
-
} else if (lineNum === endLine) {
|
|
905
|
-
decorations.push(activeQueryLastLine.range(lineStart));
|
|
906
|
-
} else {
|
|
907
|
-
decorations.push(activeQueryMiddleLine.range(lineStart));
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
return Decoration.set(decorations);
|
|
911
|
-
};
|
|
912
|
-
var activeQueryHighlight = (splitQueries) => {
|
|
913
|
-
return [
|
|
914
|
-
ViewPlugin.fromClass(
|
|
915
|
-
class {
|
|
916
|
-
decorations = Decoration.none;
|
|
917
|
-
debounceTimer = null;
|
|
918
|
-
seq = 0;
|
|
919
|
-
cachedDoc = "";
|
|
920
|
-
cachedBoundaries = [];
|
|
921
|
-
destroyed = false;
|
|
922
|
-
constructor(view) {
|
|
923
|
-
this.scheduleDocParse(view);
|
|
924
|
-
}
|
|
925
|
-
update(update) {
|
|
926
|
-
if (update.focusChanged && !update.view.hasFocus) {
|
|
927
|
-
this.decorations = Decoration.none;
|
|
928
|
-
return;
|
|
929
|
-
}
|
|
930
|
-
if (update.docChanged) {
|
|
931
|
-
if (this.cachedBoundaries.length > 0) {
|
|
932
|
-
this.cachedBoundaries = mapBoundariesThroughChanges(
|
|
933
|
-
this.cachedBoundaries,
|
|
934
|
-
update.changes
|
|
935
|
-
);
|
|
936
|
-
this.cachedDoc = update.state.doc.toString();
|
|
937
|
-
this.updateFromCache(update.view);
|
|
938
|
-
}
|
|
939
|
-
this.scheduleDocParse(update.view);
|
|
940
|
-
} else if (update.selectionSet || update.focusChanged && update.view.hasFocus) {
|
|
941
|
-
this.updateFromCache(update.view);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
destroy() {
|
|
945
|
-
this.destroyed = true;
|
|
946
|
-
if (this.debounceTimer) clearTimeout(this.debounceTimer);
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Update decorations using cached query boundaries.
|
|
950
|
-
* Only mutates this.decorations — does NOT call view.dispatch().
|
|
951
|
-
* When called from update() (sync), CodeMirror picks up the new
|
|
952
|
-
* decorations via the accessor. When called from the async
|
|
953
|
-
* scheduleDocParse callback, the caller must dispatch separately.
|
|
954
|
-
*/
|
|
955
|
-
updateFromCache(view) {
|
|
956
|
-
if (!view.hasFocus) {
|
|
957
|
-
this.decorations = Decoration.none;
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
const { main } = view.state.selection;
|
|
961
|
-
if (main.from !== main.to) {
|
|
962
|
-
this.decorations = Decoration.none;
|
|
963
|
-
return;
|
|
964
|
-
}
|
|
965
|
-
const doc = view.state.doc.toString();
|
|
966
|
-
if (doc !== this.cachedDoc) return;
|
|
967
|
-
if (this.cachedBoundaries.length === 0) {
|
|
968
|
-
this.decorations = Decoration.none;
|
|
969
|
-
return;
|
|
970
|
-
}
|
|
971
|
-
const range = findActiveQueryRange(doc, main.head, this.cachedBoundaries);
|
|
972
|
-
this.decorations = range ? buildDecorations(view, range) : Decoration.none;
|
|
973
|
-
}
|
|
974
|
-
/** Parse queries async (debounced) and update decorations. */
|
|
975
|
-
scheduleDocParse(view) {
|
|
976
|
-
if (this.debounceTimer) clearTimeout(this.debounceTimer);
|
|
977
|
-
this.debounceTimer = setTimeout(async () => {
|
|
978
|
-
const seq = ++this.seq;
|
|
979
|
-
const doc = view.state.doc.toString();
|
|
980
|
-
if (!doc.trim()) {
|
|
981
|
-
this.cachedDoc = doc;
|
|
982
|
-
this.cachedBoundaries = [];
|
|
983
|
-
if (this.decorations !== Decoration.none) {
|
|
984
|
-
this.decorations = Decoration.none;
|
|
985
|
-
if (!this.destroyed) view.dispatch();
|
|
986
|
-
}
|
|
987
|
-
return;
|
|
988
|
-
}
|
|
989
|
-
let queries;
|
|
990
|
-
try {
|
|
991
|
-
queries = await splitQueries(doc);
|
|
992
|
-
} catch {
|
|
993
|
-
return;
|
|
994
|
-
}
|
|
995
|
-
if (this.destroyed || seq !== this.seq) return;
|
|
996
|
-
this.cachedDoc = doc;
|
|
997
|
-
this.cachedBoundaries = computeBoundaries(queries);
|
|
998
|
-
this.updateFromCache(view);
|
|
999
|
-
if (!this.destroyed) view.dispatch();
|
|
1000
|
-
}, 100);
|
|
1001
|
-
}
|
|
1002
|
-
},
|
|
1003
|
-
{ decorations: (v) => v.decorations }
|
|
1004
|
-
),
|
|
1005
|
-
EditorView.baseTheme({
|
|
1006
|
-
".cm-active-query": {
|
|
1007
|
-
boxShadow: `inset -1px 0 0 0 ${colors.blue[300]}, inset 1px 0 0 0 ${colors.blue[300]}`,
|
|
1008
|
-
marginRight: "8px"
|
|
1009
|
-
},
|
|
1010
|
-
".cm-active-query-first": {
|
|
1011
|
-
boxShadow: `inset -1px 0 0 0 ${colors.blue[300]}, inset 1px 0 0 0 ${colors.blue[300]}, inset 0 1px 0 0 ${colors.blue[300]}`,
|
|
1012
|
-
borderRadius: "4px 4px 0 0"
|
|
1013
|
-
},
|
|
1014
|
-
".cm-active-query-last": {
|
|
1015
|
-
boxShadow: `inset -1px 0 0 0 ${colors.blue[300]}, inset 1px 0 0 0 ${colors.blue[300]}, inset 0 -1px 0 0 ${colors.blue[300]}`,
|
|
1016
|
-
borderRadius: "0 0 4px 4px"
|
|
1017
|
-
},
|
|
1018
|
-
".cm-active-query-first.cm-active-query-last": {
|
|
1019
|
-
boxShadow: `inset 0 0 0 1px ${colors.blue[300]}`,
|
|
1020
|
-
borderRadius: "4px"
|
|
1021
|
-
}
|
|
1022
|
-
})
|
|
1023
|
-
];
|
|
1024
|
-
};
|
|
1025
|
-
var HighlightMarker = class extends GutterMarker {
|
|
1026
|
-
toDOM() {
|
|
1027
|
-
const marker = document.createElement("div");
|
|
1028
|
-
marker.className = "cm-highlight-marker";
|
|
1029
|
-
return marker;
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
var highlightMarker = new HighlightMarker();
|
|
1033
|
-
var forEachLineInRange = (doc, from, to, callback) => {
|
|
1034
|
-
const results = [];
|
|
1035
|
-
const fromLine = Math.max(1, from + 1);
|
|
1036
|
-
const toLine = Math.min(doc.lines, to + 1);
|
|
1037
|
-
for (let i = fromLine; i <= toLine; i++) {
|
|
1038
|
-
const line = doc.line(i);
|
|
1039
|
-
results.push(callback(line.from));
|
|
1040
|
-
}
|
|
1041
|
-
return results;
|
|
1042
|
-
};
|
|
1043
|
-
var setHighlightedLinesEffect = StateEffect.define();
|
|
1044
|
-
var highlightedLinesField = StateField.define({
|
|
1045
|
-
create() {
|
|
1046
|
-
return null;
|
|
1047
|
-
},
|
|
1048
|
-
update(value, transaction) {
|
|
1049
|
-
for (const effect of transaction.effects) {
|
|
1050
|
-
if (effect.is(setHighlightedLinesEffect)) {
|
|
1051
|
-
return effect.value;
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
return value;
|
|
1055
|
-
}
|
|
1056
|
-
});
|
|
1057
|
-
var highlightGutter = gutter({
|
|
1058
|
-
class: "cm-highlight-gutter",
|
|
1059
|
-
markers: (view) => {
|
|
1060
|
-
const highlightInfo = view.state.field(highlightedLinesField, false);
|
|
1061
|
-
if (!highlightInfo) {
|
|
1062
|
-
return RangeSet.empty;
|
|
1063
|
-
}
|
|
1064
|
-
const markers = forEachLineInRange(
|
|
1065
|
-
view.state.doc,
|
|
1066
|
-
highlightInfo.from,
|
|
1067
|
-
highlightInfo.to,
|
|
1068
|
-
(lineFrom) => highlightMarker.range(lineFrom)
|
|
1069
|
-
);
|
|
1070
|
-
return RangeSet.of(markers);
|
|
1071
|
-
}
|
|
1072
|
-
});
|
|
1073
|
-
var errorLineDecorations = StateField.define({
|
|
1074
|
-
create() {
|
|
1075
|
-
return Decoration.none;
|
|
1076
|
-
},
|
|
1077
|
-
update(decorations, transaction) {
|
|
1078
|
-
decorations = decorations.map(transaction.changes);
|
|
1079
|
-
for (const effect of transaction.effects) {
|
|
1080
|
-
if (!effect.is(setHighlightedLinesEffect)) {
|
|
1081
|
-
continue;
|
|
1082
|
-
}
|
|
1083
|
-
if (!effect.value || !effect.value.error) {
|
|
1084
|
-
return Decoration.none;
|
|
1085
|
-
}
|
|
1086
|
-
const decorationArray = forEachLineInRange(
|
|
1087
|
-
transaction.state.doc,
|
|
1088
|
-
effect.value.error.from,
|
|
1089
|
-
effect.value.error.to,
|
|
1090
|
-
(lineFrom) => Decoration.line({ class: "cm-error-line" }).range(lineFrom)
|
|
1091
|
-
);
|
|
1092
|
-
return Decoration.set(decorationArray);
|
|
1093
|
-
}
|
|
1094
|
-
return decorations;
|
|
1095
|
-
},
|
|
1096
|
-
provide: (f) => EditorView.decorations.from(f)
|
|
1097
|
-
});
|
|
1098
|
-
var processingLineDecorations = StateField.define({
|
|
1099
|
-
create() {
|
|
1100
|
-
return Decoration.none;
|
|
1101
|
-
},
|
|
1102
|
-
update(decorations, transaction) {
|
|
1103
|
-
decorations = decorations.map(transaction.changes);
|
|
1104
|
-
for (const effect of transaction.effects) {
|
|
1105
|
-
if (!effect.is(setHighlightedLinesEffect)) {
|
|
1106
|
-
continue;
|
|
1107
|
-
}
|
|
1108
|
-
if (!effect.value || !effect.value.processing) {
|
|
1109
|
-
return Decoration.none;
|
|
1110
|
-
}
|
|
1111
|
-
const decorationArray = forEachLineInRange(
|
|
1112
|
-
transaction.state.doc,
|
|
1113
|
-
effect.value.processing.from,
|
|
1114
|
-
effect.value.processing.to,
|
|
1115
|
-
(lineFrom) => Decoration.line({ class: "cm-processing-line" }).range(lineFrom)
|
|
1116
|
-
);
|
|
1117
|
-
return Decoration.set(decorationArray);
|
|
1118
|
-
}
|
|
1119
|
-
return decorations;
|
|
1120
|
-
},
|
|
1121
|
-
provide: (f) => EditorView.decorations.from(f)
|
|
1122
|
-
});
|
|
1123
|
-
var highlightedLinesTheme = EditorView.baseTheme({
|
|
1124
|
-
".cm-highlight-gutter": {
|
|
1125
|
-
width: "2px",
|
|
1126
|
-
marginRight: "2px"
|
|
1127
|
-
},
|
|
1128
|
-
".cm-highlight-marker": {
|
|
1129
|
-
width: "2px",
|
|
1130
|
-
height: "100%",
|
|
1131
|
-
backgroundColor: colors.blue[500]
|
|
1132
|
-
},
|
|
1133
|
-
".cm-error-line": {
|
|
1134
|
-
backgroundColor: `${colors.error[100]} !important`
|
|
1135
|
-
},
|
|
1136
|
-
".cm-processing-line": {
|
|
1137
|
-
backgroundColor: `${colors.blue[100]} !important`
|
|
1138
|
-
}
|
|
1139
|
-
});
|
|
1140
|
-
function highlightingExtension() {
|
|
1141
|
-
return [
|
|
1142
|
-
highlightedLinesField,
|
|
1143
|
-
highlightGutter,
|
|
1144
|
-
errorLineDecorations,
|
|
1145
|
-
processingLineDecorations,
|
|
1146
|
-
highlightedLinesTheme
|
|
1147
|
-
];
|
|
1148
|
-
}
|
|
1149
|
-
function updateHighlighting(view, lines) {
|
|
1150
|
-
view.dispatch({ effects: setHighlightedLinesEffect.of(lines ?? null) });
|
|
1151
|
-
}
|
|
1152
|
-
var OWN_KEYMAPS = {
|
|
1153
|
-
defaultKeymap: false,
|
|
1154
|
-
completionKeymap: false,
|
|
1155
|
-
searchKeymap: false
|
|
1156
|
-
};
|
|
1157
|
-
var CUSTOM_KEYMAP = [
|
|
1158
|
-
{
|
|
1159
|
-
key: "Escape",
|
|
1160
|
-
stopPropagation: true,
|
|
1161
|
-
run: (view) => {
|
|
1162
|
-
view.contentDOM.blur();
|
|
1163
|
-
return true;
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
];
|
|
1167
|
-
var OWN_KEYMAP_EXTENSION = keymap.of([...defaultKeymap, ...CUSTOM_KEYMAP]);
|
|
1168
|
-
var buildTheme = () => ({
|
|
1169
|
-
...buildBaseThemeStyles(),
|
|
1170
|
-
...buildChromeStyles(buildCanvasChrome())
|
|
1171
|
-
});
|
|
1172
|
-
var SqlEditor = ({
|
|
1173
|
-
value,
|
|
1174
|
-
onChange,
|
|
1175
|
-
onSelectionChange,
|
|
1176
|
-
onCreateEditor,
|
|
1177
|
-
onDestroyEditor,
|
|
1178
|
-
onBlurEditor,
|
|
1179
|
-
onFocusEditor,
|
|
1180
|
-
placeholder = "",
|
|
1181
|
-
searchQuery = "",
|
|
1182
|
-
searchMatchIndex,
|
|
1183
|
-
readOnly = false,
|
|
1184
|
-
queryParser,
|
|
1185
|
-
autoFocus = false,
|
|
1186
|
-
lineNumbers = true,
|
|
1187
|
-
className,
|
|
1188
|
-
schema,
|
|
1189
|
-
completionSource,
|
|
1190
|
-
variables,
|
|
1191
|
-
defaultDatabase,
|
|
1192
|
-
defaultSchema,
|
|
1193
|
-
highlightLines,
|
|
1194
|
-
dialect
|
|
1195
|
-
}) => {
|
|
1196
|
-
const editorRef = useRef(null);
|
|
1197
|
-
const handleChange = useStableCallback((next) => onChange?.(next));
|
|
1198
|
-
const parseQueries = useStableCallback(async (sql) => await queryParser?.(sql) ?? []);
|
|
1199
|
-
const handleBlur = useStableCallback((view) => onBlurEditor?.(view));
|
|
1200
|
-
const handleFocus = useStableCallback((view) => onFocusEditor?.(view));
|
|
1201
|
-
const handleUpdate = useStableCallback((update) => {
|
|
1202
|
-
if (update.selectionSet) {
|
|
1203
|
-
const { main } = update.state.selection;
|
|
1204
|
-
onSelectionChange?.(update.state.sliceDoc(main.from, main.to));
|
|
1205
|
-
}
|
|
1206
|
-
});
|
|
1207
|
-
const variableCompletion = useVariableCompletion(variables);
|
|
1208
|
-
const withQueryParser = queryParser !== void 0;
|
|
1209
|
-
const tooltipLayer = useTooltipsExtension();
|
|
1210
|
-
const customTheme = useThemedExtension("editor:syntax", buildCustomTheme);
|
|
1211
|
-
const themeExtension = useThemedExtension(
|
|
1212
|
-
"sql-editor:chrome",
|
|
1213
|
-
() => EditorView$1.theme(buildTheme())
|
|
1214
|
-
);
|
|
1215
|
-
const extensions = useMemo(() => {
|
|
1216
|
-
return [
|
|
1217
|
-
EditorView$1.lineWrapping,
|
|
1218
|
-
OWN_KEYMAP_EXTENSION,
|
|
1219
|
-
...installExtensions({
|
|
1220
|
-
schema,
|
|
1221
|
-
defaultDatabase,
|
|
1222
|
-
defaultSchema,
|
|
1223
|
-
variableCompletion,
|
|
1224
|
-
completionSource,
|
|
1225
|
-
dialect
|
|
1226
|
-
}),
|
|
1227
|
-
searchExtension(),
|
|
1228
|
-
highlightingExtension(),
|
|
1229
|
-
withQueryParser ? activeQueryHighlight(parseQueries) : [],
|
|
1230
|
-
tooltipLayer,
|
|
1231
|
-
themeExtension,
|
|
1232
|
-
EditorView$1.domEventHandlers({
|
|
1233
|
-
blur: (_, view) => handleBlur(view),
|
|
1234
|
-
focus: (_, view) => handleFocus(view)
|
|
1235
|
-
})
|
|
1236
|
-
];
|
|
1237
|
-
}, [
|
|
1238
|
-
withQueryParser,
|
|
1239
|
-
parseQueries,
|
|
1240
|
-
schema,
|
|
1241
|
-
completionSource,
|
|
1242
|
-
defaultDatabase,
|
|
1243
|
-
defaultSchema,
|
|
1244
|
-
variableCompletion,
|
|
1245
|
-
dialect,
|
|
1246
|
-
handleBlur,
|
|
1247
|
-
handleFocus,
|
|
1248
|
-
themeExtension,
|
|
1249
|
-
tooltipLayer
|
|
1250
|
-
]);
|
|
1251
|
-
const defaultSetup = useMemo(() => {
|
|
1252
|
-
return { ...buildBasicSetup(readOnly), ...OWN_KEYMAPS, lineNumbers };
|
|
1253
|
-
}, [readOnly, lineNumbers]);
|
|
1254
|
-
useEffect(() => {
|
|
1255
|
-
if (editorRef.current?.view) {
|
|
1256
|
-
updateHighlighting(editorRef.current.view, highlightLines);
|
|
1257
|
-
}
|
|
1258
|
-
}, [highlightLines]);
|
|
1259
|
-
useEffect(() => {
|
|
1260
|
-
if (editorRef.current?.view) {
|
|
1261
|
-
updateSearch(editorRef.current.view, searchQuery, searchMatchIndex);
|
|
1262
|
-
}
|
|
1263
|
-
}, [searchQuery, searchMatchIndex]);
|
|
1264
|
-
const handleDestroy = useStableCallback(() => onDestroyEditor?.());
|
|
1265
|
-
useEffect(() => handleDestroy, [handleDestroy]);
|
|
1266
|
-
const handleCreate = useStableCallback((view, state) => {
|
|
1267
|
-
onCreateEditor?.(view, state);
|
|
1268
|
-
if (highlightLines) {
|
|
1269
|
-
updateHighlighting(view, highlightLines);
|
|
1270
|
-
}
|
|
1271
|
-
if (searchQuery) {
|
|
1272
|
-
updateSearch(view, searchQuery, searchMatchIndex);
|
|
1273
|
-
}
|
|
1274
|
-
});
|
|
1275
|
-
return /* @__PURE__ */ jsx(
|
|
1276
|
-
CodeMirror,
|
|
1277
|
-
{
|
|
1278
|
-
ref: editorRef,
|
|
1279
|
-
theme: customTheme,
|
|
1280
|
-
extensions,
|
|
1281
|
-
value,
|
|
1282
|
-
onChange: handleChange,
|
|
1283
|
-
onUpdate: handleUpdate,
|
|
1284
|
-
onCreateEditor: handleCreate,
|
|
1285
|
-
autoFocus,
|
|
1286
|
-
placeholder,
|
|
1287
|
-
className,
|
|
1288
|
-
readOnly,
|
|
1289
|
-
editable: !readOnly,
|
|
1290
|
-
basicSetup: defaultSetup
|
|
1291
|
-
}
|
|
1292
|
-
);
|
|
1293
|
-
};
|
|
1294
|
-
|
|
1295
|
-
export { CodeEditor, LANGUAGE_MODES, SqlEditor, buildBasicSetup, isLanguageMode, useThemedExtension };
|
|
1296
|
-
//# sourceMappingURL=chunk-YFZJ3ZLG.js.map
|
|
1297
|
-
//# sourceMappingURL=chunk-YFZJ3ZLG.js.map
|