@keboola/design 13.1.3 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/AGENTS.md +63 -5
  2. package/CHANGELOG.md +35 -0
  3. package/COMPONENT-API.md +8 -8
  4. package/dist/{AIKit-BVCWP9Ks.js → AIKit-C5FbKjwa.js} +22 -22
  5. package/dist/AIKit-C5FbKjwa.js.map +1 -0
  6. package/dist/{Alert-UI-CIs-1.js → Alert-DuAGeYyM.js} +7 -7
  7. package/dist/{Alert-UI-CIs-1.js.map → Alert-DuAGeYyM.js.map} +1 -1
  8. package/dist/{AlertModal-mbSnuuka.js → AlertModal-BDle9ZVQ.js} +6 -6
  9. package/dist/AlertModal-BDle9ZVQ.js.map +1 -0
  10. package/dist/{AppShell-WSQabK8r.js → AppShell-B03fj1j7.js} +2 -2
  11. package/dist/{AppShell-WSQabK8r.js.map → AppShell-B03fj1j7.js.map} +1 -1
  12. package/dist/{AutoSaveTextarea-C5iIr2Ts.js → AutoSaveTextarea-jiqNeeE4.js} +3 -3
  13. package/dist/{AutoSaveTextarea-C5iIr2Ts.js.map → AutoSaveTextarea-jiqNeeE4.js.map} +1 -1
  14. package/dist/{Badge-Dz0cj6rj.js → Badge-Ba3epgcI.js} +2 -2
  15. package/dist/{Badge-Dz0cj6rj.js.map → Badge-Ba3epgcI.js.map} +1 -1
  16. package/dist/{BrandEditor-P8OZX2hi.js → BrandEditor-Dq168RJc.js} +154 -16
  17. package/dist/BrandEditor-Dq168RJc.js.map +1 -0
  18. package/dist/{BrandLogo-CKpVSZb6.js → BrandLogo-BfITD0im.js} +2 -2
  19. package/dist/{BrandLogo-CKpVSZb6.js.map → BrandLogo-BfITD0im.js.map} +1 -1
  20. package/dist/{Breadcrumb-BUoAZyhO.js → Breadcrumb-CUyYu5Bi.js} +10 -10
  21. package/dist/Breadcrumb-CUyYu5Bi.js.map +1 -0
  22. package/dist/{Button-B21oVcPU.js → Button-D2JqBAq7.js} +199 -7
  23. package/dist/Button-D2JqBAq7.js.map +1 -0
  24. package/dist/{Calendar-DFtmZzbF.js → Calendar-BnKi1kPu.js} +4 -4
  25. package/dist/{Calendar-DFtmZzbF.js.map → Calendar-BnKi1kPu.js.map} +1 -1
  26. package/dist/{Card-BQmBWHXl.js → Card-Bpc_ZlL4.js} +3 -3
  27. package/dist/Card-Bpc_ZlL4.js.map +1 -0
  28. package/dist/{Checkbox-8yIIgY7g.js → Checkbox-D9rafoKh.js} +6 -6
  29. package/dist/Checkbox-D9rafoKh.js.map +1 -0
  30. package/dist/{Clipboard-_xf6hMDD.js → Clipboard-BHWUodAx.js} +3 -3
  31. package/dist/{Clipboard-_xf6hMDD.js.map → Clipboard-BHWUodAx.js.map} +1 -1
  32. package/dist/{ClipboardButton-srUgWgwH.js → ClipboardButton-Urg-kZbh.js} +4 -4
  33. package/dist/{ClipboardButton-srUgWgwH.js.map → ClipboardButton-Urg-kZbh.js.map} +1 -1
  34. package/dist/{CodeEditor-Df7VVx08.js → CodeEditor-Y0iE-SwV.js} +5 -5
  35. package/dist/{CodeEditor-Df7VVx08.js.map → CodeEditor-Y0iE-SwV.js.map} +1 -1
  36. package/dist/{Collapsible-BQXWEOBC.js → Collapsible-DD4xTL75.js} +2 -2
  37. package/dist/{Collapsible-BQXWEOBC.js.map → Collapsible-DD4xTL75.js.map} +1 -1
  38. package/dist/{ColorInput-B3gBZ8Ya.js → ColorInput-D1nC0X6i.js} +5 -5
  39. package/dist/{ColorInput-B3gBZ8Ya.js.map → ColorInput-D1nC0X6i.js.map} +1 -1
  40. package/dist/{ColorModeSwitch-D8Cki137.js → ColorModeSwitch-Cxee8jnB.js} +4 -4
  41. package/dist/{ColorModeSwitch-D8Cki137.js.map → ColorModeSwitch-Cxee8jnB.js.map} +1 -1
  42. package/dist/{Combobox-BNhW0TDB.js → Combobox-B1Kjoy5J.js} +9 -9
  43. package/dist/Combobox-B1Kjoy5J.js.map +1 -0
  44. package/dist/{Command-BQPiZCNz.js → Command-BuOA3V18.js} +5 -5
  45. package/dist/Command-BuOA3V18.js.map +1 -0
  46. package/dist/{CopyField-Ba7h8MqZ.js → CopyField-DsOVtV2Q.js} +4 -4
  47. package/dist/{CopyField-Ba7h8MqZ.js.map → CopyField-DsOVtV2Q.js.map} +1 -1
  48. package/dist/{DateInput-D0nWUasV.js → DateInput-BlKkequE.js} +5 -5
  49. package/dist/{DateInput-D0nWUasV.js.map → DateInput-BlKkequE.js.map} +1 -1
  50. package/dist/{DatePicker-CtSa9b3V.js → DatePicker-CgHAu9KX.js} +3 -3
  51. package/dist/{DatePicker-CtSa9b3V.js.map → DatePicker-CgHAu9KX.js.map} +1 -1
  52. package/dist/{DateRangeInput-i6wE45-V.js → DateRangeInput-DOxJHw8V.js} +5 -5
  53. package/dist/{DateRangeInput-i6wE45-V.js.map → DateRangeInput-DOxJHw8V.js.map} +1 -1
  54. package/dist/{DateRangePicker-BAnuz6vO.js → DateRangePicker-CXpXPMoh.js} +8 -8
  55. package/dist/{DateRangePicker-BAnuz6vO.js.map → DateRangePicker-CXpXPMoh.js.map} +1 -1
  56. package/dist/{DiagramSource-C5_d8Gdj.js → DiagramSource-jTwmmi9g.js} +2 -2
  57. package/dist/{DiagramSource-C5_d8Gdj.js.map → DiagramSource-jTwmmi9g.js.map} +1 -1
  58. package/dist/{DiffView-ppTIzh2h.js → DiffView-Dy4z-n-1.js} +3 -3
  59. package/dist/{DiffView-ppTIzh2h.js.map → DiffView-Dy4z-n-1.js.map} +1 -1
  60. package/dist/{DropdownMenu-BJGLjpVc.js → DropdownMenu-DtRYcKEx.js} +8 -8
  61. package/dist/DropdownMenu-DtRYcKEx.js.map +1 -0
  62. package/dist/{FieldBox-D7DYtX_m.js → FieldBox-BrxLkY9C.js} +8 -6
  63. package/dist/FieldBox-BrxLkY9C.js.map +1 -0
  64. package/dist/{FieldItem-BHViBJS3.js → FieldItem-Cf1E3rfQ.js} +4 -4
  65. package/dist/{FieldItem-BHViBJS3.js.map → FieldItem-Cf1E3rfQ.js.map} +1 -1
  66. package/dist/{FileUpload-Ch2hrIWq.js → FileUpload-D6vPG3WB.js} +9 -9
  67. package/dist/FileUpload-D6vPG3WB.js.map +1 -0
  68. package/dist/{Form-VkzfVPyT.js → Form-CuaAn-lR.js} +10 -10
  69. package/dist/{Form-VkzfVPyT.js.map → Form-CuaAn-lR.js.map} +1 -1
  70. package/dist/{FormGroup-CmCppxOn.js → FormGroup-D4O96YPm.js} +4 -4
  71. package/dist/{FormGroup-CmCppxOn.js.map → FormGroup-D4O96YPm.js.map} +1 -1
  72. package/dist/{FullScreenModal-Cwnm8WdM.js → FullScreenModal-CUuAakh3.js} +20 -6
  73. package/dist/{FullScreenModal-Cwnm8WdM.js.map → FullScreenModal-CUuAakh3.js.map} +1 -1
  74. package/dist/HoverCard-Cy6nhg4u.js +31 -0
  75. package/dist/HoverCard-Cy6nhg4u.js.map +1 -0
  76. package/dist/InlineEdit-DSMIEUUa.js +370 -0
  77. package/dist/InlineEdit-DSMIEUUa.js.map +1 -0
  78. package/dist/{InputGroup-CrlMRz4X.js → InputGroup-Dm014ruw.js} +4 -4
  79. package/dist/{InputGroup-CrlMRz4X.js.map → InputGroup-Dm014ruw.js.map} +1 -1
  80. package/dist/{Kbd-J4n1J6i4.js → Kbd-Du93F3o4.js} +3 -3
  81. package/dist/{Kbd-J4n1J6i4.js.map → Kbd-Du93F3o4.js.map} +1 -1
  82. package/dist/{MermaidDiagram-B30x2yV7.js → MermaidDiagram-D2ThT8Q-.js} +3 -3
  83. package/dist/{MermaidDiagram-B30x2yV7.js.map → MermaidDiagram-D2ThT8Q-.js.map} +1 -1
  84. package/dist/{Modal-BkSuS9Yz.js → Modal-DQIauzar.js} +6 -6
  85. package/dist/Modal-DQIauzar.js.map +1 -0
  86. package/dist/{ModalTitle-BxopkIoQ.js → ModalTitle-CTECVgL8.js} +3 -3
  87. package/dist/ModalTitle-CTECVgL8.js.map +1 -0
  88. package/dist/{MultiActionButtonGroup-AWLj1Tg7.js → MultiActionButtonGroup-xKqiucAN.js} +5 -5
  89. package/dist/{MultiActionButtonGroup-AWLj1Tg7.js.map → MultiActionButtonGroup-xKqiucAN.js.map} +1 -1
  90. package/dist/{Navbar-B_DNpv5s.js → Navbar-CtVYcRFn.js} +18 -14
  91. package/dist/Navbar-CtVYcRFn.js.map +1 -0
  92. package/dist/{OtpInput-I8B8Vjdl.js → OtpInput-CY8yCaJk.js} +4 -4
  93. package/dist/{OtpInput-I8B8Vjdl.js.map → OtpInput-CY8yCaJk.js.map} +1 -1
  94. package/dist/{PageHeader-CgfyXpf1.js → PageHeader-CL1A6jFM.js} +21 -14
  95. package/dist/PageHeader-CL1A6jFM.js.map +1 -0
  96. package/dist/{PageLayout-DiAAILuS.js → PageLayout-C9aXTpqV.js} +2 -2
  97. package/dist/{PageLayout-DiAAILuS.js.map → PageLayout-C9aXTpqV.js.map} +1 -1
  98. package/dist/{PageToolbar-C06RKIif.js → PageToolbar-B_e7HGva.js} +6 -6
  99. package/dist/{PageToolbar-C06RKIif.js.map → PageToolbar-B_e7HGva.js.map} +1 -1
  100. package/dist/{Pagination-DH3f6LN0.js → Pagination-DDp6PRqf.js} +5 -5
  101. package/dist/Pagination-DDp6PRqf.js.map +1 -0
  102. package/dist/{Popconfirm-Dhzn7sy6.js → Popconfirm-BgV6a0sl.js} +5 -5
  103. package/dist/{Popconfirm-Dhzn7sy6.js.map → Popconfirm-BgV6a0sl.js.map} +1 -1
  104. package/dist/{Popover-CEk915I1.js → Popover-BU7nGOv-.js} +3 -3
  105. package/dist/Popover-BU7nGOv-.js.map +1 -0
  106. package/dist/{RadioGroup-CYEp8Wnx.js → RadioGroup-C2vk5acr.js} +6 -6
  107. package/dist/{RadioGroup-CYEp8Wnx.js.map → RadioGroup-C2vk5acr.js.map} +1 -1
  108. package/dist/{Resizable-D3vYToZH.js → Resizable-D8zs0kcq.js} +2 -2
  109. package/dist/{Resizable-D3vYToZH.js.map → Resizable-D8zs0kcq.js.map} +1 -1
  110. package/dist/{Search-DmkQo716.js → Search-CVrv3hqf.js} +4 -4
  111. package/dist/{Search-DmkQo716.js.map → Search-CVrv3hqf.js.map} +1 -1
  112. package/dist/{SearchInput-D3qMkHaW.js → SearchInput-BnU6YHgT.js} +4 -4
  113. package/dist/{SearchInput-D3qMkHaW.js.map → SearchInput-BnU6YHgT.js.map} +1 -1
  114. package/dist/{SectionNav-I2p2uXTd.js → SectionNav-XlhvXXdF.js} +11 -11
  115. package/dist/{SectionNav-I2p2uXTd.js.map → SectionNav-XlhvXXdF.js.map} +1 -1
  116. package/dist/{Select-B4uK0QVm.js → Select-CjQgU_6K.js} +6 -6
  117. package/dist/Select-CjQgU_6K.js.map +1 -0
  118. package/dist/{Sheet-D0fAE14T.js → Sheet-utw4_rUa.js} +9 -9
  119. package/dist/Sheet-utw4_rUa.js.map +1 -0
  120. package/dist/{Sidebar-D9ytIs8V.js → Sidebar-CKaxOPwY.js} +21 -18
  121. package/dist/Sidebar-CKaxOPwY.js.map +1 -0
  122. package/dist/{Slider-B0ou9r0B.js → Slider-Rcc2qVct.js} +5 -5
  123. package/dist/{Slider-B0ou9r0B.js.map → Slider-Rcc2qVct.js.map} +1 -1
  124. package/dist/{Stepper-BLkLhfnd.js → Stepper-BBPembeK.js} +3 -3
  125. package/dist/{Stepper-BLkLhfnd.js.map → Stepper-BBPembeK.js.map} +1 -1
  126. package/dist/{Switch-DZvNePOm.js → Switch-Dw4tvQls.js} +3 -3
  127. package/dist/Switch-Dw4tvQls.js.map +1 -0
  128. package/dist/{Table-BaVT5Tkn.js → Table-CgSC-fSo.js} +4 -4
  129. package/dist/{Table-BaVT5Tkn.js.map → Table-CgSC-fSo.js.map} +1 -1
  130. package/dist/{Tabs-CTDmye1N.js → Tabs-C0uvkPHc.js} +5 -5
  131. package/dist/Tabs-C0uvkPHc.js.map +1 -0
  132. package/dist/{TextInput-BWYXbfs4.js → TextInput-B5TDDOty.js} +5 -5
  133. package/dist/{TextInput-BWYXbfs4.js.map → TextInput-B5TDDOty.js.map} +1 -1
  134. package/dist/{ThemeProvider-VF38VfUa.js → ThemeProvider-Dt9b67sW.js} +22 -5
  135. package/dist/ThemeProvider-Dt9b67sW.js.map +1 -0
  136. package/dist/{TimePicker-CDGYrRxi.js → TimePicker-DyyV3nw8.js} +2 -2
  137. package/dist/{TimePicker-CDGYrRxi.js.map → TimePicker-DyyV3nw8.js.map} +1 -1
  138. package/dist/{Timeline-B-I6sb0M.js → Timeline-DUXgByUE.js} +3 -3
  139. package/dist/{Timeline-B-I6sb0M.js.map → Timeline-DUXgByUE.js.map} +1 -1
  140. package/dist/{Toast-NrOdDDru.js → Toast-BGnUL4jV.js} +2 -2
  141. package/dist/{Toast-NrOdDDru.js.map → Toast-BGnUL4jV.js.map} +1 -1
  142. package/dist/{ToggleGroup-Cy_10Mvu.js → ToggleGroup-BOz1yyz6.js} +3 -3
  143. package/dist/ToggleGroup-BOz1yyz6.js.map +1 -0
  144. package/dist/{Workbench-DmZzpkj7.js → Workbench-CxgNCs3I.js} +4 -4
  145. package/dist/{Workbench-DmZzpkj7.js.map → Workbench-CxgNCs3I.js.map} +1 -1
  146. package/dist/{ZoomableSvg-C65nta_r.js → ZoomableSvg-D8sXKpoV.js} +6 -6
  147. package/dist/{ZoomableSvg-C65nta_r.js.map → ZoomableSvg-D8sXKpoV.js.map} +1 -1
  148. package/dist/charts.js +1 -1
  149. package/dist/classNames-DcGnTh2N.js +21 -0
  150. package/dist/classNames-DcGnTh2N.js.map +1 -0
  151. package/dist/editors.js +5 -5
  152. package/dist/flint.js +2 -2
  153. package/dist/{icons-wcA70iQx.js → icons-ZIeZXXS7.js} +37 -4
  154. package/dist/icons-ZIeZXXS7.js.map +1 -0
  155. package/dist/icons.d.ts +2 -2
  156. package/dist/icons.js +2 -2
  157. package/dist/{index-B7k-09i1.d.ts → index-D-itZ3VP.d.ts} +14 -3
  158. package/dist/index.d.ts +388 -316
  159. package/dist/index.js +72 -70
  160. package/dist/internal/blocks/AIKit.js +1 -1
  161. package/dist/internal/blocks/AppShell.js +1 -1
  162. package/dist/internal/blocks/AuthLayout.js +2 -2
  163. package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
  164. package/dist/internal/blocks/BrandEditor.js +1 -1
  165. package/dist/internal/blocks/ChartPanel.js +2 -2
  166. package/dist/internal/blocks/ChipEditor.js +4 -4
  167. package/dist/internal/blocks/ClipboardButton.js +1 -1
  168. package/dist/internal/blocks/ColorInput.js +1 -1
  169. package/dist/internal/blocks/ColorModeSwitch.js +1 -1
  170. package/dist/internal/blocks/Command.js +1 -1
  171. package/dist/internal/blocks/CopyField.js +1 -1
  172. package/dist/internal/blocks/DashboardHero.js +2 -2
  173. package/dist/internal/blocks/DashboardHero.js.map +1 -1
  174. package/dist/internal/blocks/DateInput.js +1 -1
  175. package/dist/internal/blocks/DateRangeInput.js +1 -1
  176. package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
  177. package/dist/internal/blocks/ExportMenu.js +4 -4
  178. package/dist/internal/blocks/FacebookButton.js +66 -0
  179. package/dist/internal/blocks/FacebookButton.js.map +1 -0
  180. package/dist/internal/blocks/Form/connectors/ComboboxField.js +2 -2
  181. package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
  182. package/dist/internal/blocks/Form.js +1 -1
  183. package/dist/internal/blocks/FormGroup.js +1 -1
  184. package/dist/internal/blocks/GoogleButton.js +2 -2
  185. package/dist/internal/blocks/InlineEdit.js +2 -0
  186. package/dist/internal/blocks/MicrosoftButton.js +2 -2
  187. package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
  188. package/dist/internal/blocks/MultiCombobox.js +2 -2
  189. package/dist/internal/blocks/NumberInput.js +1 -1
  190. package/dist/internal/blocks/OtpInput.js +1 -1
  191. package/dist/internal/blocks/PageHeader.js +1 -1
  192. package/dist/internal/blocks/PageLayout.js +1 -1
  193. package/dist/internal/blocks/PageToolbar.js +1 -1
  194. package/dist/internal/blocks/PasswordInput.js +3 -3
  195. package/dist/internal/blocks/SearchInput.js +1 -1
  196. package/dist/internal/blocks/SearchInputWithNavigation.js +5 -5
  197. package/dist/internal/blocks/SectionNav.js +1 -1
  198. package/dist/internal/blocks/SplitButton.js +6 -5
  199. package/dist/internal/blocks/SplitButton.js.map +1 -1
  200. package/dist/internal/blocks/StatCard.js +2 -2
  201. package/dist/internal/blocks/TextInput.js +1 -1
  202. package/dist/internal/blocks/Textarea.js +1 -1
  203. package/dist/internal/blocks/TimeInput.js +4 -4
  204. package/dist/internal/components/Alert.js +1 -1
  205. package/dist/internal/components/AlertModal.js +1 -1
  206. package/dist/internal/components/Avatar.js +2 -2
  207. package/dist/internal/components/Badge.js +1 -1
  208. package/dist/internal/components/BrandLogo.js +1 -1
  209. package/dist/internal/components/Breadcrumb.js +1 -1
  210. package/dist/internal/components/Button.js +1 -1
  211. package/dist/internal/components/ButtonGroup.js +1 -1
  212. package/dist/internal/components/Calendar.js +1 -1
  213. package/dist/internal/components/Card.js +1 -1
  214. package/dist/internal/components/Checkbox.js +1 -1
  215. package/dist/internal/components/Clipboard.js +1 -1
  216. package/dist/internal/components/Collapsible.js +1 -1
  217. package/dist/internal/components/CollapsiblePanel.js +5 -5
  218. package/dist/internal/components/CollapsiblePanel.js.map +1 -1
  219. package/dist/internal/components/Combobox.js +1 -1
  220. package/dist/internal/components/DatePicker.js +1 -1
  221. package/dist/internal/components/DateRangePicker.js +1 -1
  222. package/dist/internal/components/DiffView.js +1 -1
  223. package/dist/internal/components/DotsLoader.js +1 -1
  224. package/dist/internal/components/DropdownMenu.js +1 -1
  225. package/dist/internal/components/FileUpload.js +1 -1
  226. package/dist/internal/components/FullScreenModal.js +1 -1
  227. package/dist/internal/components/HoverCard.js +1 -1
  228. package/dist/internal/components/InputGroup.js +1 -1
  229. package/dist/internal/components/Kbd.js +1 -1
  230. package/dist/internal/components/Label.js +2 -2
  231. package/dist/internal/components/Label.js.map +1 -1
  232. package/dist/internal/components/Link.js +1 -1
  233. package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +2 -2
  234. package/dist/internal/components/Modal.js +1 -1
  235. package/dist/internal/components/Navbar.js +1 -1
  236. package/dist/internal/components/Pagination.js +1 -1
  237. package/dist/internal/components/PanelWithDetails.js +3 -3
  238. package/dist/internal/components/Popconfirm.js +1 -1
  239. package/dist/internal/components/Popover.js +1 -1
  240. package/dist/internal/components/Progress.js +1 -1
  241. package/dist/internal/components/RadioGroup.js +1 -1
  242. package/dist/internal/components/Resizable.js +1 -1
  243. package/dist/internal/components/ScrollArea.js +1 -1
  244. package/dist/internal/components/Search.js +1 -1
  245. package/dist/internal/components/Select.js +1 -1
  246. package/dist/internal/components/Separator.js +1 -1
  247. package/dist/internal/components/Sheet.js +1 -1
  248. package/dist/internal/components/Sidebar.js +1 -1
  249. package/dist/internal/components/Skeleton/Skeleton.js +1 -1
  250. package/dist/internal/components/Skeleton/SkeletonList.js +1 -1
  251. package/dist/internal/components/Slider.js +1 -1
  252. package/dist/internal/components/SpotlightBackdrop.js +1 -1
  253. package/dist/internal/components/Stepper.js +1 -1
  254. package/dist/internal/components/Switch.js +1 -1
  255. package/dist/internal/components/Table.js +1 -1
  256. package/dist/internal/components/Tabs.js +1 -1
  257. package/dist/internal/components/ThemeProvider.js +1 -1
  258. package/dist/internal/components/TimePicker.js +1 -1
  259. package/dist/internal/components/Timeline.js +1 -1
  260. package/dist/internal/components/Toast.js +2 -2
  261. package/dist/internal/components/Toggle.js +5 -5
  262. package/dist/internal/components/Toggle.js.map +1 -1
  263. package/dist/internal/components/ToggleGroup.js +1 -1
  264. package/dist/internal/components/Tooltip.js +1 -1
  265. package/dist/internal/components/Truncated.js +2 -2
  266. package/dist/internal/components/Workbench.js +1 -1
  267. package/dist/internal/components/ZoomableSvg.js +1 -1
  268. package/dist/internal/utils.js +2 -2
  269. package/dist/markdown-editor.js +14 -14
  270. package/dist/markdown-editor.js.map +1 -1
  271. package/dist/mermaid.js +1 -1
  272. package/dist/rjsf.js +12 -12
  273. package/dist/{styles-DBGXH5-_.js → styles-BDA5rQz3.js} +6 -6
  274. package/dist/styles-BDA5rQz3.js.map +1 -0
  275. package/dist/{styles-gzcjOyKv.js → styles-YQdM7G8c.js} +3 -3
  276. package/dist/{styles-gzcjOyKv.js.map → styles-YQdM7G8c.js.map} +1 -1
  277. package/dist/styles.css +1 -1
  278. package/dist/testing.js +1 -1
  279. package/dist/{toast-CyXEdaCZ.js → toast-D6Z6MOB5.js} +5 -5
  280. package/dist/toast-D6Z6MOB5.js.map +1 -0
  281. package/dist/{utils-Bd28bWgm.js → utils-p6tjltbX.js} +4 -4
  282. package/dist/utils-p6tjltbX.js.map +1 -0
  283. package/package.json +2 -1
  284. package/src/styles.css +179 -0
  285. package/src/theme.css +47 -3
  286. package/dist/AIKit-BVCWP9Ks.js.map +0 -1
  287. package/dist/AlertModal-mbSnuuka.js.map +0 -1
  288. package/dist/BrandEditor-P8OZX2hi.js.map +0 -1
  289. package/dist/Breadcrumb-BUoAZyhO.js.map +0 -1
  290. package/dist/Button-B21oVcPU.js.map +0 -1
  291. package/dist/Card-BQmBWHXl.js.map +0 -1
  292. package/dist/Checkbox-8yIIgY7g.js.map +0 -1
  293. package/dist/Combobox-BNhW0TDB.js.map +0 -1
  294. package/dist/Command-BQPiZCNz.js.map +0 -1
  295. package/dist/DropdownMenu-BJGLjpVc.js.map +0 -1
  296. package/dist/FieldBox-D7DYtX_m.js.map +0 -1
  297. package/dist/FileUpload-Ch2hrIWq.js.map +0 -1
  298. package/dist/HoverCard-B8OKu9XZ.js +0 -31
  299. package/dist/HoverCard-B8OKu9XZ.js.map +0 -1
  300. package/dist/Modal-BkSuS9Yz.js.map +0 -1
  301. package/dist/ModalTitle-BxopkIoQ.js.map +0 -1
  302. package/dist/Navbar-B_DNpv5s.js.map +0 -1
  303. package/dist/PageHeader-CgfyXpf1.js.map +0 -1
  304. package/dist/Pagination-DH3f6LN0.js.map +0 -1
  305. package/dist/Popover-CEk915I1.js.map +0 -1
  306. package/dist/Select-B4uK0QVm.js.map +0 -1
  307. package/dist/Sheet-D0fAE14T.js.map +0 -1
  308. package/dist/Sidebar-D9ytIs8V.js.map +0 -1
  309. package/dist/Switch-DZvNePOm.js.map +0 -1
  310. package/dist/Tabs-CTDmye1N.js.map +0 -1
  311. package/dist/ThemeProvider-VF38VfUa.js.map +0 -1
  312. package/dist/ToggleGroup-Cy_10Mvu.js.map +0 -1
  313. package/dist/classNames-BzrkDnOD.js +0 -9
  314. package/dist/classNames-BzrkDnOD.js.map +0 -1
  315. package/dist/icons-wcA70iQx.js.map +0 -1
  316. package/dist/styles-DBGXH5-_.js.map +0 -1
  317. package/dist/toast-CyXEdaCZ.js.map +0 -1
  318. package/dist/utils-Bd28bWgm.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
2
  import { useArgoDesign } from "./context-U293r3v-.js";
3
3
  import { Root } from "@radix-ui/react-slot";
4
4
  import { cva } from "class-variance-authority";
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  const cardClassnames = cva([
8
8
  "tw:flex",
9
9
  "tw:flex-col",
10
- "tw:rounded-lg",
10
+ "tw:rounded-[var(--radius-card,var(--radius-lg,0.5rem))]",
11
11
  "tw:bg-card",
12
12
  "tw:text-card-foreground",
13
13
  "tw:interactive:cursor-pointer",
@@ -130,4 +130,4 @@ Card.Description = CardDescription;
130
130
  //#endregion
131
131
  export { Card };
132
132
 
133
- //# sourceMappingURL=Card-BQmBWHXl.js.map
133
+ //# sourceMappingURL=Card-Bpc_ZlL4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card-Bpc_ZlL4.js","names":[],"sources":["../src/components/Card/styles.ts","../src/components/Card/CardContent.tsx","../src/components/Card/CardDescription.tsx","../src/components/Card/CardHeader.tsx","../src/components/Card/CardTitle.tsx","../src/components/Card/Card.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nexport const cardClassnames = cva(\n [\n 'tw:flex',\n 'tw:flex-col',\n // `--radius-card` when a theme sets it; unset, the control radius `--radius-lg`.\n 'tw:rounded-[var(--radius-card,var(--radius-lg,0.5rem))]',\n 'tw:bg-card',\n 'tw:text-card-foreground',\n\n // interactive — see the `interactive` variant in theme.css\n 'tw:interactive:cursor-pointer',\n 'tw:interactive:no-underline',\n 'tw:interactive:hover:no-underline',\n 'tw:interactive:hover:text-card-foreground',\n 'tw:interactive:focus:text-card-foreground',\n 'tw:interactive:motion-safe:transition-[translate,box-shadow,border-color]',\n 'tw:interactive:hover:border-input',\n 'tw:interactive:hover:shadow-md',\n 'tw:interactive:motion-safe:hover:-translate-y-0.5',\n 'tw:interactive:active:translate-y-0',\n 'tw:interactive:focus-visible:outline',\n 'tw:interactive:focus-visible:outline-1',\n 'tw:interactive:focus-visible:-outline-offset-1',\n 'tw:interactive:focus-visible:outline-ring',\n 'tw:interactive:focus-visible:ring-4',\n 'tw:interactive:focus-visible:ring-ring/30',\n ],\n {\n defaultVariants: {\n padding: 'small',\n },\n variants: {\n bordered: {\n true: 'tw:border tw:border-solid tw:border-border',\n false: 'tw:shadow-raised tw:data-[argo=true]:shadow-sm',\n },\n // `none` drops the gap too: slots own their padding, so a gap would\n // double-space a `Card.Header divider`.\n padding: {\n none: 'tw:p-0',\n small: 'tw:gap-4 tw:px-6 tw:py-4',\n medium: 'tw:gap-4 tw:p-7',\n large: 'tw:gap-4 tw:p-8',\n },\n },\n },\n);\n\nexport const cardHeaderClassnames = cva('tw:flex', {\n defaultVariants: {\n divider: false,\n layout: 'row',\n },\n variants: {\n // No `border-solid`: it would give the other sides a 3px `medium` border.\n // `min-h-16` holds one height with or without a button; keep padding under it.\n divider: {\n true: 'tw:min-h-16 tw:border-b tw:border-border tw:px-6 tw:py-2',\n false: '',\n },\n layout: {\n row: 'tw:items-center tw:justify-between tw:gap-4',\n inline: 'tw:items-center tw:gap-3',\n stack: 'tw:flex-col tw:gap-1.5',\n },\n },\n});\n\nexport const cardContentClassnames = cva('', {\n defaultVariants: {\n padded: false,\n },\n variants: {\n padded: {\n true: 'tw:px-6 tw:py-5',\n false: '',\n },\n },\n});\n\nexport const cardTitleClassnames = cn(\n 'tw:m-0',\n 'tw:leading-6',\n 'tw:font-medium',\n 'tw:text-base',\n 'tw:text-card-foreground',\n);\n\nexport const cardDescriptionClassnames = cn('tw:m-0', 'tw:text-sm', 'tw:text-muted-foreground');\n","import type { HTMLAttributes } from 'react';\n\nimport { cardContentClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Applies the standard body padding. Use with `Card padding=\"none\"`, where the\n * root adds none — otherwise the padding is doubled. */\n padded?: boolean;\n};\n\nexport const CardContent = ({ children, className, padded = false, ...rest }: Props) => (\n // `|| undefined` so an unpadded, unstyled content slot stays attribute-free\n // rather than rendering `class=\"\"`.\n <div {...rest} className={cardContentClassnames({ className, padded }) || undefined}>\n {children}\n </div>\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { cardDescriptionClassnames } from './styles';\n\n/** Muted secondary line under `Card.Title`; pair with `Card.Header layout=\"stack\"`. */\nexport const CardDescription = ({\n children,\n className,\n ...rest\n}: HTMLAttributes<HTMLParagraphElement>) => (\n <p className={cn(cardDescriptionClassnames, className)} {...rest}>\n {children}\n </p>\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { cardHeaderClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Bottom rule plus own padding and a 64px min height. Full-bleed only with `Card padding=\"none\"`. */\n divider?: boolean;\n /** `row`: title left, actions right. `inline`: together, e.g. title + badge.\n * `stack`: description under the title. */\n layout?: 'row' | 'inline' | 'stack';\n};\n\nexport const CardHeader = ({\n children,\n className,\n divider = false,\n layout = 'row',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n data-argo={renderArgo}\n className={cardHeaderClassnames({ className, divider, layout })}\n >\n {children}\n </div>\n );\n};\n","import type { HTMLAttributes } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { cardTitleClassnames } from './styles';\n\ntype HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\ntype Props = HTMLAttributes<HTMLHeadingElement> & {\n /** Heading tag to render. Defaults to `h3`; set explicitly to avoid a heading-order skip\n * (e.g. `as=\"h2\"` when the Card sits directly under a page's `h1`). */\n as?: HeadingLevel;\n};\n\nexport const CardTitle = ({ children, className, as: Tag = 'h3', ...rest }: Props) => (\n <Tag className={cn(cardTitleClassnames, className)} {...rest}>\n {children}\n </Tag>\n);\n","import type { HTMLAttributes } from 'react';\nimport { Root } from '@radix-ui/react-slot';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { CardContent } from './CardContent';\nimport { CardDescription } from './CardDescription';\nimport { CardHeader } from './CardHeader';\nimport { CardTitle } from './CardTitle';\nimport { cardClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof cardClassnames> & {\n /** Render as a Radix `Slot`: the child (`<a href>`, a router `<Link>`) becomes the card.\n * The card is then one link — nest no buttons or links inside it. */\n asChild?: boolean;\n /** Hover lift, focus ring and pointer cursor. Defaults to on when the card renders an\n * `<a href>`; `false` opts that out, `true` opts any other element in. */\n interactive?: boolean;\n };\n\nexport const Card = ({\n children,\n className,\n bordered = false,\n padding = 'small',\n asChild = false,\n interactive,\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n const Comp = asChild ? Root : 'div';\n return (\n <Comp\n {...rest}\n data-argo={renderArgo}\n data-interactive={interactive}\n className={cardClassnames({ className, bordered, padding })}\n >\n {children}\n </Comp>\n );\n};\n\nCard.Header = CardHeader;\nCard.Content = CardContent;\nCard.Title = CardTitle;\nCard.Description = CardDescription;\n"],"mappings":";;;;;;AAIA,MAA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E,UAAU,WAAW,IAAI,MAAM,MAAM,GAAG,WAClE,oBAAC,KAAD;CAAK,WAAW,GAAG,qBAAqB,SAAS;CAAG,GAAI;CACrD;AACE,CAAA;;;ACKP,MAAa,QAAQ,EACnB,UACA,WACA,WAAW,OACX,UAAU,SACV,UAAU,OACV,aACA,GAAG,WACQ;CACX,MAAM,aAAa,cAAc;CAEjC,OACE,oBAFW,UAAU,OAAO,OAE5B;EACE,GAAI;EACJ,aAAW;EACX,oBAAkB;EAClB,WAAW,eAAe;GAAE;GAAW;GAAU;EAAQ,CAAC;EAEzD;CACG,CAAA;AAEV;AAEA,KAAK,SAAS;AACd,KAAK,UAAU;AACf,KAAK,QAAQ;AACb,KAAK,cAAc"}
@@ -1,8 +1,8 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
2
- import { Tooltip } from "./utils-Bd28bWgm.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
+ import { Tooltip } from "./utils-p6tjltbX.js";
3
3
  import { useArgoDesign } from "./context-U293r3v-.js";
4
- import { Check, Minus } from "./icons-wcA70iQx.js";
5
- import { FieldBox } from "./FieldBox-D7DYtX_m.js";
4
+ import { Check, Minus } from "./icons-ZIeZXXS7.js";
5
+ import { FieldBox } from "./FieldBox-BrxLkY9C.js";
6
6
  import { useId } from "react";
7
7
  import { cva } from "class-variance-authority";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -19,7 +19,7 @@ const rootVariants = cva([
19
19
  "tw:cursor-pointer",
20
20
  "tw:border",
21
21
  "tw:border-solid",
22
- "tw:disabled:opacity-50",
22
+ "tw:disabled:opacity-disabled",
23
23
  "tw:disabled:cursor-not-allowed"
24
24
  ], {
25
25
  defaultVariants: { variant: "default" },
@@ -94,4 +94,4 @@ function Checkbox({ className, id: idProp, children, description, variant, posit
94
94
  //#endregion
95
95
  export { Checkbox };
96
96
 
97
- //# sourceMappingURL=Checkbox-8yIIgY7g.js.map
97
+ //# sourceMappingURL=Checkbox-D9rafoKh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox-D9rafoKh.js","names":[],"sources":["../src/components/Checkbox/styles.ts","../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const rootVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // position\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n\n 'tw:peer',\n 'tw:size-4',\n 'tw:shrink-0',\n 'tw:cursor-pointer',\n\n // border\n 'tw:border',\n 'tw:border-solid',\n\n // disabled\n 'tw:disabled:opacity-disabled',\n 'tw:disabled:cursor-not-allowed',\n ],\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:rounded',\n 'tw:border-neutral-200',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-white',\n 'tw:data-[state=indeterminate]:border-neutral-200',\n ],\n argo: [\n 'tw:rounded',\n 'tw:border-input',\n 'tw:transition-colors',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-primary',\n 'tw:data-[state=indeterminate]:border-primary',\n\n // focus\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:border-primary',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-ring/50',\n ],\n },\n },\n },\n);\n\nexport const indicatorVariants = cva(['tw:group', 'tw:flex', 'tw:items-center'], {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:data-[state=checked]:text-primary-foreground',\n 'tw:data-[state=indeterminate]:text-neutral-200',\n ],\n argo: ['tw:text-primary-foreground'],\n },\n },\n});\n","import { useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { CheckedState } from '@radix-ui/react-checkbox';\nimport { Indicator, Root } from '@radix-ui/react-checkbox';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Check, Minus } from '../../icons';\nimport { cn } from '../../utils';\nimport { FieldBox } from '../FieldBox';\nimport type { fieldBoxVariants } from '../FieldBox/styles';\nimport { useArgoDesign } from '../ThemeProvider/context';\nimport type { Props as TooltipProps } from '../Tooltip';\nimport { Tooltip } from '../Tooltip';\n\nimport { indicatorVariants, rootVariants } from './styles';\n\ntype Props = {\n id?: string | number;\n description?: ReactNode;\n variant?: VariantProps<typeof fieldBoxVariants>['variant'];\n position?: 'start' | 'end';\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n} & Omit<ComponentProps<typeof Root>, 'id'>;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n },\n): ReactNode;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: CheckedState;\n onCheckedChange?: (checked: CheckedState) => void;\n },\n): ReactNode;\n\nexport function Checkbox({\n className,\n id: idProp,\n children,\n description,\n variant,\n position,\n tooltip,\n tooltipPlacement = 'top',\n ...rest\n}: Props) {\n const fallbackId = useId();\n const id = idProp?.toString() ?? fallbackId;\n const styleVariant = useArgoDesign() ? 'argo' : 'default';\n\n const checkboxElement = (\n <Root id={id} {...rest} className={cn(rootVariants({ variant: styleVariant, className }))}>\n <Indicator className={cn(indicatorVariants({ variant: styleVariant }))}>\n <Check className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=checked]:block\" />\n <Minus className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=indeterminate]:block\" />\n </Indicator>\n </Root>\n );\n\n const rendered = !children ? (\n checkboxElement\n ) : (\n <FieldBox htmlFor={id} variant={variant} position={position} control={checkboxElement}>\n <FieldBox.Title>{children}</FieldBox.Title>\n {description && <FieldBox.Description>{description}</FieldBox.Description>}\n </FieldBox>\n );\n\n if (!tooltip) return rendered;\n\n // `asChild` only onto the labelled FieldBox: on the bare Radix `Root` the tooltip's\n // `data-state` overwrites the checkbox's and it stops toggling.\n return (\n <Tooltip tooltip={tooltip} placement={tooltipPlacement} triggerAsChild={!!children}>\n {rendered}\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,eAAe,IAC1B;CAEE;CAGA;CACA;CACA;CAEA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS;GACP;GACA;GAEA;GACA;GAEA;GACA;EACF;EACA,MAAM;GACJ;GACA;GACA;GAEA;GACA;GAEA;GACA;GAGA;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CACF;AAEA,MAAa,oBAAoB,IAAI;CAAC;CAAY;CAAW;AAAiB,GAAG;CAC/E,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS,CACP,mDACA,gDACF;EACA,MAAM,CAAC,4BAA4B;CACrC,EACF;AACF,CAAC;;;ACrCD,SAAgB,SAAS,EACvB,WACA,IAAI,QACJ,UACA,aACA,SACA,UACA,SACA,mBAAmB,OACnB,GAAG,QACK;CACR,MAAM,aAAa,MAAM;CACzB,MAAM,KAAK,QAAQ,SAAS,KAAK;CACjC,MAAM,eAAe,cAAc,IAAI,SAAS;CAEhD,MAAM,kBACJ,oBAAC,MAAD;EAAU;EAAI,GAAI;EAAM,WAAW,GAAG,aAAa;GAAE,SAAS;GAAc;EAAU,CAAC,CAAC;EACtF,UAAA,qBAAC,WAAD;GAAW,WAAW,GAAG,kBAAkB,EAAE,SAAS,aAAa,CAAC,CAAC;GAArE,UAAA,CACE,oBAAC,OAAD,EAAO,WAAU,0EAA2E,CAAA,GAC5F,oBAAC,OAAD,EAAO,WAAU,gFAAiF,CAAA,CACzF;;CACP,CAAA;CAGR,MAAM,WAAW,CAAC,WAChB,kBAEA,qBAAC,UAAD;EAAU,SAAS;EAAa;EAAmB;EAAU,SAAS;EAAtE,UAAA,CACE,oBAAC,SAAS,OAAV,EAAiB,SAAyB,CAAA,GACzC,eAAe,oBAAC,SAAS,aAAV,EAAA,UAAuB,YAAkC,CAAA,CACjE;;CAGZ,IAAI,CAAC,SAAS,OAAO;CAIrB,OACE,oBAAC,SAAD;EAAkB;EAAS,WAAW;EAAkB,gBAAgB,CAAC,CAAC;EACvE,UAAA;CACM,CAAA;AAEb"}
@@ -1,5 +1,5 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
2
- import { Tooltip, copyToClipboard } from "./utils-Bd28bWgm.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
+ import { Tooltip, copyToClipboard } from "./utils-p6tjltbX.js";
3
3
  import { useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/components/Clipboard/Clipboard.tsx
@@ -55,4 +55,4 @@ const Clipboard = ({ ref, text: textProp, children, tooltip = "Copy to Clipboard
55
55
  //#endregion
56
56
  export { Clipboard };
57
57
 
58
- //# sourceMappingURL=Clipboard-_xf6hMDD.js.map
58
+ //# sourceMappingURL=Clipboard-BHWUodAx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Clipboard-_xf6hMDD.js","names":[],"sources":["../src/components/Clipboard/Clipboard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { ComponentProps, MouseEventHandler } from 'react';\n\nimport { cn, copyToClipboard } from '../../utils';\nimport { type Props as TooltipProps, Tooltip } from '../Tooltip';\n\ntype Props = {\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n tooltipVariant?: TooltipProps['variant'];\n asChild?: TooltipProps['triggerAsChild'];\n text?: string | (() => string);\n} & ComponentProps<'button'>;\n\nexport const Clipboard = ({\n ref,\n text: textProp,\n children,\n tooltip = 'Copy to Clipboard',\n tooltipPlacement = 'top',\n tooltipVariant: tooltipVariantProp = 'action',\n asChild = false,\n onClick,\n className,\n ...restButtonProps\n}: Props) => {\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const [state, setState] = useState<'ready' | 'copied' | 'error'>('ready');\n const text = typeof textProp === 'function' ? textProp() : textProp;\n\n const copy = async (text: string) => {\n try {\n // For the clipboard feature to work reliably, the window must be in focus for security reasons.\n // However, the button can be clicked without the window being focused.\n if (!document.hasFocus()) window.focus();\n\n await copyToClipboard(text);\n setState('copied');\n } catch {\n setState('error');\n }\n };\n\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n // Open on click rather than waiting for hover. Radix opens on pointer-enter via a\n // `delayDuration` timer (300ms here), so clicking faster than that left the outcome invisible\n // until the timer caught up — the message was already rendered, just inside a closed tooltip.\n setIsTooltipOpen(true);\n if (text && state === 'ready') void copy(text);\n onClick?.(event);\n };\n\n const handleOnOpenChange: ComponentProps<typeof Tooltip.Root>['onOpenChange'] = (open) => {\n // Reset when the tooltip closes, allowing the user to leave the copy button.\n if (!open && state !== 'ready') setState('ready');\n setIsTooltipOpen(open);\n };\n\n const tooltipContent = (() => {\n if (!text) return 'Nothing to copy';\n if (state === 'error') return 'Failed to copy';\n if (state === 'copied') return 'Copied to Clipboard';\n return tooltip;\n })();\n\n const tooltipVariant: TooltipProps['variant'] =\n state === 'ready' && !!text ? tooltipVariantProp : 'action';\n\n // `tooltip={null}` leaves nothing to say until there is an outcome. Not rendering `Content` at all\n // is what makes that work: hovering still opens the tooltip, there is simply nothing in it, and\n // the copied / failed message appears in place the moment `state` changes. It also keeps Radix\n // from pointing the trigger's `aria-describedby` at content that has no text.\n const hasTooltipContent = tooltipContent !== null && tooltipContent !== undefined;\n\n return (\n <Tooltip.Root open={isTooltipOpen} onOpenChange={handleOnOpenChange}>\n <Tooltip.Trigger\n {...restButtonProps}\n asChild={asChild}\n keepOpenOnClick\n onClick={handleOnClick}\n className={cn('tw:cursor-pointer', className)}\n ref={ref}\n >\n {children ?? text}\n </Tooltip.Trigger>\n\n {hasTooltipContent && (\n <Tooltip.Content\n keepOpenOnPointerDownOutside\n placement={tooltipPlacement}\n variant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;GACE,8BAAA;GACA,WAAW;GACX,SAAS;GAER,UAAA;EACc,CAAA,CAEP;;AAElB"}
1
+ {"version":3,"file":"Clipboard-BHWUodAx.js","names":[],"sources":["../src/components/Clipboard/Clipboard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { ComponentProps, MouseEventHandler } from 'react';\n\nimport { cn, copyToClipboard } from '../../utils';\nimport { type Props as TooltipProps, Tooltip } from '../Tooltip';\n\ntype Props = {\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n tooltipVariant?: TooltipProps['variant'];\n asChild?: TooltipProps['triggerAsChild'];\n text?: string | (() => string);\n} & ComponentProps<'button'>;\n\nexport const Clipboard = ({\n ref,\n text: textProp,\n children,\n tooltip = 'Copy to Clipboard',\n tooltipPlacement = 'top',\n tooltipVariant: tooltipVariantProp = 'action',\n asChild = false,\n onClick,\n className,\n ...restButtonProps\n}: Props) => {\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const [state, setState] = useState<'ready' | 'copied' | 'error'>('ready');\n const text = typeof textProp === 'function' ? textProp() : textProp;\n\n const copy = async (text: string) => {\n try {\n // For the clipboard feature to work reliably, the window must be in focus for security reasons.\n // However, the button can be clicked without the window being focused.\n if (!document.hasFocus()) window.focus();\n\n await copyToClipboard(text);\n setState('copied');\n } catch {\n setState('error');\n }\n };\n\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n // Open on click rather than waiting for hover. Radix opens on pointer-enter via a\n // `delayDuration` timer (300ms here), so clicking faster than that left the outcome invisible\n // until the timer caught up — the message was already rendered, just inside a closed tooltip.\n setIsTooltipOpen(true);\n if (text && state === 'ready') void copy(text);\n onClick?.(event);\n };\n\n const handleOnOpenChange: ComponentProps<typeof Tooltip.Root>['onOpenChange'] = (open) => {\n // Reset when the tooltip closes, allowing the user to leave the copy button.\n if (!open && state !== 'ready') setState('ready');\n setIsTooltipOpen(open);\n };\n\n const tooltipContent = (() => {\n if (!text) return 'Nothing to copy';\n if (state === 'error') return 'Failed to copy';\n if (state === 'copied') return 'Copied to Clipboard';\n return tooltip;\n })();\n\n const tooltipVariant: TooltipProps['variant'] =\n state === 'ready' && !!text ? tooltipVariantProp : 'action';\n\n // `tooltip={null}` leaves nothing to say until there is an outcome. Not rendering `Content` at all\n // is what makes that work: hovering still opens the tooltip, there is simply nothing in it, and\n // the copied / failed message appears in place the moment `state` changes. It also keeps Radix\n // from pointing the trigger's `aria-describedby` at content that has no text.\n const hasTooltipContent = tooltipContent !== null && tooltipContent !== undefined;\n\n return (\n <Tooltip.Root open={isTooltipOpen} onOpenChange={handleOnOpenChange}>\n <Tooltip.Trigger\n {...restButtonProps}\n asChild={asChild}\n keepOpenOnClick\n onClick={handleOnClick}\n className={cn('tw:cursor-pointer', className)}\n ref={ref}\n >\n {children ?? text}\n </Tooltip.Trigger>\n\n {hasTooltipContent && (\n <Tooltip.Content\n keepOpenOnPointerDownOutside\n placement={tooltipPlacement}\n variant={tooltipVariant}\n >\n {tooltipContent}\n </Tooltip.Content>\n )}\n </Tooltip.Root>\n );\n};\n"],"mappings":";;;;;AAcA,MAAa,aAAa,EACxB,KACA,MAAM,UACN,UACA,UAAU,qBACV,mBAAmB,OACnB,gBAAgB,qBAAqB,UACrC,UAAU,OACV,SACA,WACA,GAAG,sBACQ;CACX,MAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;CACxD,MAAM,CAAC,OAAO,YAAY,SAAuC,OAAO;CACxE,MAAM,OAAO,OAAO,aAAa,aAAa,SAAS,IAAI;CAE3D,MAAM,OAAO,OAAO,SAAiB;EACnC,IAAI;GAGF,IAAI,CAAC,SAAS,SAAS,GAAG,OAAO,MAAM;GAEvC,MAAM,gBAAgB,IAAI;GAC1B,SAAS,QAAQ;EACnB,QAAQ;GACN,SAAS,OAAO;EAClB;CACF;CAEA,MAAM,iBAAuD,UAAU;EAIrE,iBAAiB,IAAI;EACrB,IAAI,QAAQ,UAAU,SAAS,KAAU,IAAI;EAC7C,UAAU,KAAK;CACjB;CAEA,MAAM,sBAA2E,SAAS;EAExF,IAAI,CAAC,QAAQ,UAAU,SAAS,SAAS,OAAO;EAChD,iBAAiB,IAAI;CACvB;CAEA,MAAM,wBAAwB;EAC5B,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,UAAU,SAAS,OAAO;EAC9B,IAAI,UAAU,UAAU,OAAO;EAC/B,OAAO;CACT,EAAA,CAAG;CAEH,MAAM,iBACJ,UAAU,WAAW,CAAC,CAAC,OAAO,qBAAqB;CAMrD,MAAM,oBAAoB,mBAAmB,QAAQ,mBAAmB,KAAA;CAExE,OACE,qBAAC,QAAQ,MAAT;EAAc,MAAM;EAAe,cAAc;EAAjD,UAAA,CACE,oBAAC,QAAQ,SAAT;GACE,GAAI;GACK;GACT,iBAAA;GACA,SAAS;GACT,WAAW,GAAG,qBAAqB,SAAS;GACvC;GAEJ,UAAA,YAAY;EACE,CAAA,GAEhB,qBACC,oBAAC,QAAQ,SAAT;GACE,8BAAA;GACA,WAAW;GACX,SAAS;GAER,UAAA;EACc,CAAA,CAEP;;AAElB"}
@@ -1,6 +1,6 @@
1
- import { Copy } from "./icons-wcA70iQx.js";
2
- import { Button, ButtonInline } from "./Button-B21oVcPU.js";
3
- import { Clipboard } from "./Clipboard-_xf6hMDD.js";
1
+ import { Copy } from "./icons-ZIeZXXS7.js";
2
+ import { Button, ButtonInline } from "./Button-D2JqBAq7.js";
3
+ import { Clipboard } from "./Clipboard-BHWUodAx.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/blocks/ClipboardButton/ClipboardButton.tsx
6
6
  const DEFAULT_ICON = /* @__PURE__ */ jsx(Copy, {});
@@ -40,4 +40,4 @@ const ClipboardInline = ({ text, tooltip, tooltipPlacement, tooltipVariant, chil
40
40
  //#endregion
41
41
  export { ClipboardButton, ClipboardInline };
42
42
 
43
- //# sourceMappingURL=ClipboardButton-srUgWgwH.js.map
43
+ //# sourceMappingURL=ClipboardButton-Urg-kZbh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClipboardButton-srUgWgwH.js","names":[],"sources":["../src/blocks/ClipboardButton/ClipboardButton.tsx","../src/blocks/ClipboardButton/ClipboardInline.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof Button>, 'disabled' | 'icon'>;\n\ntype Props = ClipboardProps & ButtonProps & { icon?: ReactNode };\n\nconst DEFAULT_ICON: ReactNode = <Copy />;\nconst DEFAULT_ARIA_LABEL = 'Copy';\n\nexport const ClipboardButton = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n icon = DEFAULT_ICON,\n variant = 'outline',\n children,\n ...rest\n}: Props) => {\n // Icon-only (no text children): the `tooltip` is visual only, not an accessible\n // name, so fall back to it (when it's a string) or a sensible default. A\n // consumer-supplied `aria-label` in `rest` still wins.\n // A non-empty string tooltip names the action; an empty/absent tooltip still\n // needs a name, so fall back to the default rather than an empty aria-label.\n const defaultAriaLabel =\n typeof tooltip === 'string' && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;\n const ariaLabel = rest['aria-label'] ?? (children == null ? defaultAriaLabel : undefined);\n\n return (\n <Clipboard\n asChild\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n text={text}\n >\n <Button {...rest} aria-label={ariaLabel} variant={variant} disabled={!text}>\n {icon}\n {children}\n </Button>\n </Clipboard>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { ButtonInline } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof ButtonInline>, 'disabled'>;\n\ntype Props = { hideIcon?: boolean } & ClipboardProps & ButtonProps;\n\nexport const ClipboardInline = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n children = 'Copy To Clipboard',\n hideIcon = false,\n ...rest\n}: Props) => (\n <Clipboard\n asChild\n text={text}\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n >\n <ButtonInline {...rest} disabled={!text}>\n {!hideIcon && <Copy className=\"tw:size-4\" />}\n {children}\n </ButtonInline>\n </Clipboard>\n);\n"],"mappings":";;;;;AAeA,MAAM,eAA0B,oBAAC,MAAD,CAAO,CAAA;AACvC,MAAM,qBAAqB;AAE3B,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,OAAO,cACP,UAAU,WACV,UACA,GAAG,WACQ;CAMX,MAAM,mBACJ,OAAO,YAAY,YAAY,QAAQ,KAAK,IAAI,UAAU;CAC5D,MAAM,YAAY,KAAK,kBAAkB,YAAY,OAAO,mBAAmB,KAAA;CAE/E,OACE,oBAAC,WAAD;EACE,SAAA;EACS;EACS;EACF;EACV;EAEN,UAAA,qBAAC,QAAD;GAAQ,GAAI;GAAM,cAAY;GAAoB;GAAS,UAAU,CAAC;GAAtE,UAAA,CACG,MACA,QACK;;CACC,CAAA;AAEf;;;ACvCA,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,WAAW,qBACX,WAAW,OACX,GAAG,WAEH,oBAAC,WAAD;CACE,SAAA;CACM;CACG;CACS;CACF;CAEhB,UAAA,qBAAC,cAAD;EAAc,GAAI;EAAM,UAAU,CAAC;EAAnC,UAAA,CACG,CAAC,YAAY,oBAAC,MAAD,EAAM,WAAU,YAAa,CAAA,GAC1C,QACW;;AACL,CAAA"}
1
+ {"version":3,"file":"ClipboardButton-Urg-kZbh.js","names":[],"sources":["../src/blocks/ClipboardButton/ClipboardButton.tsx","../src/blocks/ClipboardButton/ClipboardInline.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof Button>, 'disabled' | 'icon'>;\n\ntype Props = ClipboardProps & ButtonProps & { icon?: ReactNode };\n\nconst DEFAULT_ICON: ReactNode = <Copy />;\nconst DEFAULT_ARIA_LABEL = 'Copy';\n\nexport const ClipboardButton = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n icon = DEFAULT_ICON,\n variant = 'outline',\n children,\n ...rest\n}: Props) => {\n // Icon-only (no text children): the `tooltip` is visual only, not an accessible\n // name, so fall back to it (when it's a string) or a sensible default. A\n // consumer-supplied `aria-label` in `rest` still wins.\n // A non-empty string tooltip names the action; an empty/absent tooltip still\n // needs a name, so fall back to the default rather than an empty aria-label.\n const defaultAriaLabel =\n typeof tooltip === 'string' && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;\n const ariaLabel = rest['aria-label'] ?? (children == null ? defaultAriaLabel : undefined);\n\n return (\n <Clipboard\n asChild\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n text={text}\n >\n <Button {...rest} aria-label={ariaLabel} variant={variant} disabled={!text}>\n {icon}\n {children}\n </Button>\n </Clipboard>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { ButtonInline } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof ButtonInline>, 'disabled'>;\n\ntype Props = { hideIcon?: boolean } & ClipboardProps & ButtonProps;\n\nexport const ClipboardInline = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n children = 'Copy To Clipboard',\n hideIcon = false,\n ...rest\n}: Props) => (\n <Clipboard\n asChild\n text={text}\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n >\n <ButtonInline {...rest} disabled={!text}>\n {!hideIcon && <Copy className=\"tw:size-4\" />}\n {children}\n </ButtonInline>\n </Clipboard>\n);\n"],"mappings":";;;;;AAeA,MAAM,eAA0B,oBAAC,MAAD,CAAO,CAAA;AACvC,MAAM,qBAAqB;AAE3B,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,OAAO,cACP,UAAU,WACV,UACA,GAAG,WACQ;CAMX,MAAM,mBACJ,OAAO,YAAY,YAAY,QAAQ,KAAK,IAAI,UAAU;CAC5D,MAAM,YAAY,KAAK,kBAAkB,YAAY,OAAO,mBAAmB,KAAA;CAE/E,OACE,oBAAC,WAAD;EACE,SAAA;EACS;EACS;EACF;EACV;EAEN,UAAA,qBAAC,QAAD;GAAQ,GAAI;GAAM,cAAY;GAAoB;GAAS,UAAU,CAAC;GAAtE,UAAA,CACG,MACA,QACK;;CACC,CAAA;AAEf;;;ACvCA,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,WAAW,qBACX,WAAW,OACX,GAAG,WAEH,oBAAC,WAAD;CACE,SAAA;CACM;CACG;CACS;CACF;CAEhB,UAAA,qBAAC,cAAD;EAAc,GAAI;EAAM,UAAU,CAAC;EAAnC,UAAA,CACG,CAAC,YAAY,oBAAC,MAAD,EAAM,WAAU,YAAa,CAAA,GAC1C,QACW;;AACL,CAAA"}
@@ -1,11 +1,11 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
2
- import { isMac, keyCodes } from "./utils-Bd28bWgm.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
+ import { isMac, keyCodes } from "./utils-p6tjltbX.js";
3
3
  import { useArgoDesign } from "./context-U293r3v-.js";
4
4
  import { findLiteralMatches } from "./findLiteralMatches-DgGLzyG0.js";
5
- import { ClipboardButton } from "./ClipboardButton-srUgWgwH.js";
5
+ import { ClipboardButton } from "./ClipboardButton-Urg-kZbh.js";
6
6
  import { useStableCallback } from "./internal/hooks/useStableCallback.js";
7
7
  import { HelpBlock } from "./internal/components/HelpBlock.js";
8
- import { Kbd } from "./Kbd-J4n1J6i4.js";
8
+ import { Kbd } from "./Kbd-Du93F3o4.js";
9
9
  import { useThemeAttributes } from "./useThemeAttributes-B199Regy.js";
10
10
  import { resolveToken } from "./themeTokens-7DEab0kp.js";
11
11
  import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
@@ -1018,4 +1018,4 @@ const CodeEditor = ({ value, previousValue, onChange, variant = "plain", mode =
1018
1018
  //#endregion
1019
1019
  export { CodeEditor, LANGUAGE_MODES, buildBaseThemeStyles, buildBasicSetup, buildCanvasChrome, buildChromeStyles, buildCustomTheme, buildDiffWash, isLanguageMode, searchExtension, updateSearch, useThemedExtension, useTooltipsExtension, useVariableCompletion };
1020
1020
 
1021
- //# sourceMappingURL=CodeEditor-Df7VVx08.js.map
1021
+ //# sourceMappingURL=CodeEditor-Y0iE-SwV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor-Df7VVx08.js","names":["cmPlaceholder","placeholder"],"sources":["../src/components/CodeEditor/ButtonToolbar.tsx","../src/components/CodeEditor/modes/dbt.ts","../src/components/CodeEditor/modes/jsonnet.ts","../src/components/CodeEditor/diffWash.ts","../src/components/CodeEditor/syntaxPalette.ts","../src/components/CodeEditor/helpers.ts","../src/components/CodeEditor/editorChrome.ts","../src/components/CodeEditor/search.ts","../src/components/CodeEditor/ToggleComponentHelp.tsx","../src/components/CodeEditor/tokenTheme.ts","../src/components/CodeEditor/tooltips.ts","../src/components/CodeEditor/variableCompletion.ts","../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { ClipboardButton } from '../../blocks/ClipboardButton';\n\n// Floats over the top-right corner of the editor it is rendered into — private to\n// `CodeEditor`, which is the `relative` ancestor it positions against. `right-3`\n// leaves room for the scrollbar track, whose width the browser owns and no token\n// here describes.\nexport const ButtonToolbar = ({ value, children }: { value?: string; children?: ReactNode }) => {\n if (!value && !children) return null;\n\n return (\n <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\">\n {!!value && <ClipboardButton size=\"icon-xs\" variant=\"invisible\" text={value} />}\n {children}\n </div>\n );\n};\n","import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport { simpleMode } from '@codemirror/legacy-modes/mode/simple-mode';\n\n// A dbt step is `dbt <command> [<subcommand>] [arguments, flags and selectors]`,\n// and the vocabulary below is grouped by the slot it belongs to — both to colour\n// it and to decide what is worth offering where.\nconst COMMANDS = [\n 'run-operation',\n 'run',\n 'test',\n 'seed',\n 'snapshot',\n 'list',\n 'ls',\n 'compile',\n 'build',\n 'deps',\n 'docs',\n 'source',\n];\nconst SUBCOMMANDS: Record<string, string[]> = { docs: ['generate'], source: ['freshness'] };\nconst ARGUMENTS = ['--select', '--exclude', '--selector', '--defer', '--resource-type', '-s'];\n// The arguments whose value is a graph selector, and so the only ones a selector\n// method has anything to attach to.\nconst SELECTORS = ['--select', '--exclude', '-s'];\nconst METHODS = [\n 'path:',\n 'source:',\n 'tag:',\n 'package:',\n 'config:',\n 'test_type:',\n 'test_name:',\n 'state:',\n 'exposure:',\n 'metric:',\n 'result:',\n 'source_status:',\n 'column_name:',\n];\nconst FLAGS = [\n '--fail-fast',\n '--warn-error',\n '--favor-state',\n '--vars',\n '--models',\n '--threads',\n '--profiles-dir',\n '--profile',\n '--full-refresh',\n];\n\n// A subcommand only ever highlights together with its command, so `dbt docs` stays\n// unpainted until `generate` follows it.\nconst COMMAND_PHRASES = COMMANDS.flatMap((command) => {\n const subcommands = SUBCOMMANDS[command];\n\n return subcommands ? subcommands.map((subcommand) => `${command} ${subcommand}`) : [command];\n});\n\n// Alternation is first-match, so a word that prefixes another has to come first\n// (`run-operation` before `run`, `--profiles-dir` before `--profile`). Sorting by\n// length keeps that true however the lists above are written.\nconst alternation = (list: string[]) => [...list].sort((a, b) => b.length - a.length).join('|');\n\n// Every keyword follows whitespace, so the leading run is part of the match.\n// Commands and arguments end on a word boundary; methods and flags carry their\n// own terminator (`:`) or need none.\nconst word = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})\\\\b`, 'i');\nconst prefix = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})`, 'i');\n\n// The word being completed: letters, digits, `_`, `-` and the `:` a selector\n// method ends with. Whitespace stays out of it, so a two-word label like `docs\n// generate` cannot stretch the match back across the words before the cursor.\nconst WORD = /[\\w:-]*$/;\n\nconst asOptions = (list: string[], type: string): Completion[] =>\n list.map((label) => ({ label, type }));\n\n// `type` drives the popup icon, so each group carries the one that matches the\n// colour the mode paints it in.\nconst DBT: Completion[] = [{ label: 'dbt', type: 'keyword' }];\nconst COMMAND_OPTIONS = asOptions(COMMANDS, 'keyword');\nconst SUBCOMMAND_OPTIONS: Record<string, Completion[]> = Object.fromEntries(\n Object.entries(SUBCOMMANDS).map(([command, subcommands]) => [\n command,\n asOptions(subcommands, 'keyword'),\n ]),\n);\nconst ARGUMENT_OPTIONS = asOptions(ARGUMENTS, 'variable');\nconst FLAG_OPTIONS = asOptions(FLAGS, 'constant');\nconst METHOD_OPTIONS = asOptions(METHODS, 'property');\n\n// Which slice of the vocabulary the cursor's slot can hold, given the words\n// already finished ahead of it. Offering the whole vocabulary everywhere proposes\n// `dbt` mid-command and a selector method with no selector to attach to.\nconst optionsAfter = (words: string[]): Completion[] => {\n const [step, command, ...rest] = words;\n\n if (step === undefined) return DBT;\n if (step.toLowerCase() !== 'dbt') return [];\n if (command === undefined) return COMMAND_OPTIONS;\n\n const subcommands = SUBCOMMAND_OPTIONS[command.toLowerCase()];\n if (subcommands && rest.length === 0) return subcommands;\n\n // A selector argument takes any number of space-separated values, so what\n // decides the slot is the last argument, not whether a selector appeared at all:\n // `--select tag:a tag:b` keeps offering methods, `--select a --profile p` stops.\n const lastArgument = rest.filter((it) => it.startsWith('-')).at(-1);\n const selecting = lastArgument !== undefined && SELECTORS.includes(lastArgument.toLowerCase());\n\n return selecting\n ? [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS, ...METHOD_OPTIONS]\n : [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS];\n};\n\nconst complete = (context: CompletionContext): CompletionResult | null => {\n const typed = context.matchBefore(WORD);\n\n // `WORD` also matches the empty string, so without this the popup would open on\n // every space. Asking for completions explicitly still opens it there.\n if (!typed?.text && !context.explicit) return null;\n\n const from = typed?.from ?? context.pos;\n const line = context.state.doc.lineAt(from);\n const options = optionsAfter(\n line.text\n .slice(0, from - line.from)\n .split(/\\s+/)\n .filter(Boolean),\n );\n\n return options.length > 0 ? { from, options, validFor: WORD } : null;\n};\n\nexport const dbt = simpleMode({\n languageData: {\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n commentTokens: { line: '--', block: { open: '/*', close: '*/' } },\n autocomplete: complete,\n },\n start: [\n { regex: /\"(?:[^\\\\]|\\\\.)*?(?:\"|$)/, token: 'string' },\n // Word-bounded, so `dbtX` is not a dbt step whose first word happens to\n // colour — the same thing the completion source asks of it.\n { regex: /dbt\\b/, token: 'keyword', sol: true },\n { regex: word(COMMAND_PHRASES), token: 'keyword' },\n { regex: word(ARGUMENTS), token: 'variableName' },\n { regex: prefix(METHODS), token: 'propertyName' },\n { regex: prefix(FLAGS), token: 'attributeName' },\n { regex: /(?:@|\\*|,|\\+\\d+|\\d+\\+|\\+)/, token: 'operator' },\n { regex: /'.*'/, token: 'string' },\n { regex: /true|false/, token: 'atom' },\n ],\n});\n","import type { StreamParser } from '@codemirror/language';\n\n/**\n * Port of google/codemirror-mode-jsonnet (Apache-2.0) to CodeMirror 6 tags.\n *\n * - Patterns are anchored with `^`: unanchored, `StringStream.match` scans the whole rest of the line.\n */\n\nconst COMMENT_END = /^\\*\\//;\nconst COMMENT_START = /^\\/\\/|^#/;\nconst C_COMMENT_START = /^\\/\\*/;\nconst TEXT_BLOCK = /^\\|\\|\\|/;\nconst TEXT_BLOCK_END = /^\\s*\\|\\|\\|/;\nconst RAW_DOUBLE = /^\"\"/;\nconst RAW_SINGLE = /^''/;\nconst CLOSE_DOUBLE = /^\"/;\nconst CLOSE_SINGLE = /^'/;\nconst ESCAPE = /^\\\\[\\\\\"'/bfnrt0]/;\nconst UNICODE_ESCAPE = /^\\\\u[0-9a-fA-F]{4}/;\nconst BACKSLASH = /^\\\\/;\nconst IMPORT = /^import(?:str)?\\s*(@?)([\"'])/;\nconst QUOTE = /^(@?)([\"'])/;\nconst ROOT = /^\\$/;\nconst NUMBER = /^(?:\\.\\d+|\\d+\\.?\\d*)(?:e[-+]?\\d+)?/i;\nconst OPERATOR = /^[-+/*=<>!&~^|$%]+/;\nconst IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]*/;\n\nconst KEYWORDS: Record<string, 'keyword' | 'atom'> = {\n local: 'keyword',\n self: 'keyword',\n super: 'keyword',\n assert: 'keyword',\n function: 'keyword',\n if: 'keyword',\n then: 'keyword',\n else: 'keyword',\n for: 'keyword',\n in: 'keyword',\n tailstrict: 'keyword',\n error: 'keyword',\n true: 'atom',\n false: 'atom',\n null: 'atom',\n};\n\ntype State = {\n cComment: boolean;\n textBlock: boolean;\n textBlockIndent: number | null;\n string: boolean;\n importString: boolean;\n stringSingle: boolean;\n stringRaw: boolean;\n};\n\nexport const jsonnet: StreamParser<State> = {\n name: 'jsonnet',\n\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n languageData: { commentTokens: { line: '//', block: { open: '/*', close: '*/' } } },\n\n startState: () => ({\n cComment: false,\n textBlock: false,\n textBlockIndent: null,\n string: false,\n importString: false,\n stringSingle: false,\n stringRaw: false,\n }),\n\n token: (stream, state) => {\n if (state.cComment) {\n if (stream.match(COMMENT_END)) {\n state.cComment = false;\n return 'comment';\n }\n stream.next();\n return 'comment';\n }\n\n // Match the closing `|||` before measuring indent, or a block closed at column 0 never ends.\n if (state.textBlock) {\n if (state.textBlockIndent == null) {\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n state.textBlockIndent = stream.indentation();\n }\n if (stream.indentation() >= state.textBlockIndent) {\n stream.skipToEnd();\n return 'string';\n }\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n stream.next();\n return 'invalid';\n }\n\n if (state.string || state.importString) {\n const style = state.string ? 'string' : 'meta';\n\n if (state.stringRaw) {\n if (stream.match(state.stringSingle ? RAW_SINGLE : RAW_DOUBLE)) return 'escape';\n } else {\n if (stream.match(ESCAPE)) return 'escape';\n if (stream.match(UNICODE_ESCAPE)) return 'escape';\n if (stream.match(BACKSLASH)) return 'invalid';\n }\n\n if (stream.match(state.stringSingle ? CLOSE_SINGLE : CLOSE_DOUBLE)) {\n state.string = false;\n state.importString = false;\n return style;\n }\n\n stream.next();\n return style;\n }\n\n if (stream.match(COMMENT_START)) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.match(C_COMMENT_START)) {\n state.cComment = true;\n return 'comment';\n }\n\n const imported = stream.match(IMPORT);\n if (Array.isArray(imported)) {\n state.importString = true;\n state.stringRaw = imported[1] === '@';\n state.stringSingle = imported[2] === \"'\";\n return 'meta';\n }\n\n const quoted = stream.match(QUOTE);\n if (Array.isArray(quoted)) {\n state.string = true;\n state.stringRaw = quoted[1] === '@';\n state.stringSingle = quoted[2] === \"'\";\n return 'string';\n }\n\n if (stream.match(TEXT_BLOCK)) {\n state.textBlock = true;\n state.textBlockIndent = null;\n return 'string';\n }\n\n if (stream.match(ROOT)) return 'keyword';\n if (stream.match(NUMBER)) return 'number';\n if (stream.match(OPERATOR)) return 'operator';\n\n // Consumed whole so that a keyword's prefix (`locally`) is not styled.\n const identifier = stream.match(IDENTIFIER);\n if (Array.isArray(identifier)) return KEYWORDS[identifier[0]] ?? null;\n\n stream.next();\n return null;\n },\n};\n","import type { ResolvedColorScheme } from '../ThemeProvider/types';\n\n/**\n * Alpha suffixes for the dark-scheme diff and state tints.\n *\n * - Line fill stays subtle for text to read; the gutter sits a step stronger.\n * - `DARK_LINE_ALPHA` is also appended by the static washes in `highlighting.ts` and `search.ts`.\n */\nexport const DARK_LINE_ALPHA = '29'; /* 16% */\nconst DARK_GUTTER_ALPHA = '47'; /* 28% */\n\n/**\n * The two diff fills per scheme: light uses the opaque pastel, dark the `500` hue at low alpha.\n *\n * - Imports nothing, so `MergeEditor` shares it without pulling in CodeMirror via `helpers.ts`.\n * - Shared by `helpers.ts` and `MergeEditor/decorations.ts`, so their alphas cannot drift.\n */\nexport const buildDiffWash = (scheme: ResolvedColorScheme) => {\n const dark = scheme === 'dark';\n\n return {\n line: (hue: string, pastel: string) => (dark ? `${hue}${DARK_LINE_ALPHA}` : pastel),\n gutter: (hue: string, pastel: string) => (dark ? `${hue}${DARK_GUTTER_ALPHA}` : pastel),\n };\n};\n","import { tags } from '@lezer/highlight';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\n\n/**\n * The tag colours layered over the stock github palette, per colour scheme.\n *\n * - Imports only tags and ramps, so `scripts/contrast-audit.ts` can measure it.\n * - These override stock rules for the same tag.\n * - Colours are chosen against `background` and `muted` (`variant=\"field\"`); ratios quote both.\n */\nexport const buildSyntaxPalette = (scheme: ResolvedColorScheme, foreground: string) => {\n const dark = scheme === 'dark';\n\n return [\n // Identifiers and brackets carry no colour, as on github.com.\n { tag: [tags.name, tags.special(tags.string), tags.bracket], color: foreground },\n // Functions — light `600` 6.13 / 5.84, dark `300` 9.62 / 7.80.\n { tag: tags.standard(tags.name), color: dark ? colors.purple[300] : colors.purple[600] },\n // Special vars — light `800` 7.26 / 6.92, dark `300` 13.49 / 10.94.\n { tag: tags.special(tags.name), color: dark ? colors.cyan[300] : colors.cyan[800] },\n // Strings — light `800` 7.23 / 6.89, dark `300` 13.53 / 10.97.\n { tag: tags.string, color: dark ? colors.warning[300] : colors.warning[800] },\n // Light-only fixes for stock colours below AA; `CONTRAST-AUDIT.md` has all surfaces.\n ...(dark\n ? []\n : [\n // Keywords — 5.96 / 5.69.\n { tag: [tags.keyword, tags.typeName, tags.typeOperator], color: colors.error[550] },\n // Comments — 6.44 / 6.15.\n { tag: tags.comment, color: colors.neutral[500] },\n // Markdown quotes — 7.15 / 6.82.\n { tag: tags.quote, color: colors.green[900] },\n // Lex errors — 7.81 / 7.45; stock red fails the read-only wash.\n { tag: tags.invalid, color: colors.error[700] },\n ]),\n // Dark only: `githubDarkStyle` has no `escape` rule, so escapes would blend into strings.\n ...(dark ? [{ tag: [tags.escape, tags.url, tags.link], color: colors.blue[300] }] : []),\n ];\n};\n","import { javascript } from '@codemirror/lang-javascript';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { python } from '@codemirror/lang-python';\nimport { MSSQL, MySQL, PLSQL, PostgreSQL, StandardSQL } from '@codemirror/lang-sql';\nimport { StreamLanguage } from '@codemirror/language';\nimport { r } from '@codemirror/legacy-modes/mode/r';\nimport { shell } from '@codemirror/legacy-modes/mode/shell';\nimport { toml } from '@codemirror/legacy-modes/mode/toml';\nimport type { LintSource } from '@codemirror/lint';\nimport { linter } from '@codemirror/lint';\nimport { githubDarkInit, githubLightInit } from '@uiw/codemirror-theme-github';\nimport type { BasicSetupOptions } from '@uiw/react-codemirror';\n\nimport { getSqlLanguageSupport } from '@keboola/codemirror-lang-sql';\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { resolveToken } from '../../utils/themeTokens';\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\n\nimport { dbt } from './modes/dbt';\nimport { jsonnet } from './modes/jsonnet';\nimport { buildDiffWash } from './diffWash';\nimport { buildSyntaxPalette } from './syntaxPalette';\n\n// One list for both the runtime whitelist and the type — a separate `LANGUAGE_MODE[]` copy drifts.\nexport const LANGUAGE_MODES = [\n 'application/json',\n 'text/plain',\n 'text/x-python',\n 'text/x-sql',\n 'text/x-mysql',\n 'text/x-pgsql',\n 'text/x-mssql',\n // Snowflake; the strings are a published prop contract.\n 'text/x-sfsql',\n 'text/x-bqsql',\n 'text/x-plsql',\n 'text/x-rsrc',\n 'text/x-sh',\n 'text/x-toml',\n 'text/jsonnet',\n 'text/x-dbt',\n 'text/javascript',\n 'text/typescript',\n] as const;\n\nexport type LANGUAGE_MODE = (typeof LANGUAGE_MODES)[number];\n\nexport const isLanguageMode = (mode: string): mode is LANGUAGE_MODE =>\n (LANGUAGE_MODES as readonly string[]).includes(mode);\n\n// - `readOnly` is only addressable through `contenteditable`.\n// - `fieldChrome` overrides the read-only wash by re-declaring this key; strings must match exactly.\nexport const READ_ONLY_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"false\"])';\nexport const EDITABLE_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"true\"])';\n\n/**\n * Editor chrome and the unified merge (diff) wash.\n *\n * - Chrome resolves from live `--*` tokens; fallbacks mirror light-mode values for SSR.\n * - Diff colours are fixed across brands; light/dark pairs from `buildDiffWash`, shared with\n * `MergeEditor/decorations.ts`.\n * - Only `CodeEditor`'s unified merge view uses this; `MergePane` has its own theme.\n */\nexport const buildBaseThemeStyles = (scheme: ResolvedColorScheme) => {\n const { line, gutter } = buildDiffWash(scheme);\n const dark = scheme === 'dark';\n\n return {\n '*': { lineHeight: '20px' },\n '*::selection': {\n backgroundColor: resolveToken('primary', '31 143 255'),\n color: `${resolveToken('primary-foreground', '255 255 255')} !important`,\n },\n // Dark uses `muted`: `secondary` is lighter there and drops `comment` to 4.27:1.\n // `--code-editor-surface` on an ancestor overrides body and gutters.\n [READ_ONLY_EDITOR]: {\n backgroundColor: `var(--code-editor-surface, ${\n dark ? resolveToken('muted', '38 38 45') : resolveToken('secondary', '226 232 240')\n })`,\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: {\n backgroundColor: `var(--code-editor-surface, ${resolveToken('border', '229 231 235')})`,\n },\n '&.cm-editor .cm-scroller': { overflowAnchor: 'none' },\n '&.cm-editor, &.cm-editor .cm-scroller': {\n minHeight: '100%',\n flexGrow: 1,\n alignItems: 'stretch !important',\n outline: 'none',\n },\n '.cm-gutter.cm-foldGutter': { display: 'none !important' },\n '.cm-gutter.cm-lineNumbers': { paddingLeft: '20px', paddingRight: '6px' },\n '.cm-gutters': { height: 'auto' },\n\n // merge (diff) view\n '&[class*=\"cm-merge-\"] .cm-deletedLine': {\n backgroundColor: line(colors.error[500], colors.error[100]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedLine': {\n backgroundColor: line(colors.green[500], colors.green[100]),\n },\n '&[class*=\"cm-merge-\"] .cm-deletedLineGutter': {\n backgroundColor: gutter(colors.error[500], colors.error[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedLineGutter': {\n backgroundColor: gutter(colors.green[500], colors.green[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-deletedText': {\n background: gutter(colors.error[500], colors.error[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedText': {\n background: gutter(colors.green[500], colors.green[200]),\n },\n // Follows the page, not the diff — fixed white would be a light slab under dark.\n '&[class*=\"cm-merge-\"]': {\n backgroundColor: `${resolveToken('background', '249 250 251')} !important`,\n },\n '&[class*=\"cm-merge-\"] .cm-gutters': {\n backgroundColor: `${resolveToken('muted', '241 245 249')} !important`,\n },\n '.cm-changeGutter': { position: 'absolute', zIndex: -1, width: '100%', paddingLeft: 0 },\n '&[class*=\"cm-merge-\"] .cm-changedLine,&[class*=\"cm-merge-\"] .cm-line, &[class*=\"cm-merge-\"] .cm-deletedChunk':\n { paddingLeft: 0 },\n };\n};\n\n// - Fold gutter and active line are hidden by the themes anyway.\n// - `autocompletion`: `CodeEditor` and `SqlEditor` install their own; a second instance competes.\nconst ALWAYS_OFF = {\n autocompletion: false,\n drawSelection: false,\n foldGutter: false,\n foldKeymap: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n} as const;\n\n// - `basicSetup` enables everything not skipped; a viewer drops editing commands.\n// - Search stays — Mod-f is useful on a viewer.\n// - `history` stays: flipping `readOnly` reconfigures the view, which would drop the undo stack.\nexport const buildBasicSetup = (readOnly: boolean): BasicSetupOptions => ({\n ...ALWAYS_OFF,\n ...(readOnly\n ? {\n closeBrackets: false,\n closeBracketsKeymap: false,\n lintKeymap: false,\n indentOnInput: false,\n rectangularSelection: false,\n dropCursor: false,\n highlightSelectionMatches: false,\n }\n : null),\n});\n\n/**\n * The syntax theme, per colour scheme.\n *\n * - Light github palette fails AA on dark surfaces, so the palette is picked by scheme.\n * - `githubDarkInit` sets the `EditorView.darkTheme` facet that every `&dark` rule keys off.\n * - `caret` and `selectionMatch` are pinned: the initialisers disagree on them.\n */\nexport const buildCustomTheme = (scheme: ResolvedColorScheme) => {\n const foreground = resolveToken('foreground', '30 41 59');\n const init = scheme === 'dark' ? githubDarkInit : githubLightInit;\n\n return init({\n settings: {\n fontFamily: `'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New'`,\n background: resolveToken('background', '249 250 251'),\n foreground,\n caret: foreground,\n gutterBackground: resolveToken('muted', '241 245 249'),\n gutterForeground: resolveToken('muted-foreground', '100 116 139'),\n gutterBorder: 'transparent',\n lineHighlight: 'transparent',\n selection: resolveToken('primary', '31 143 255'),\n selectionMatch: resolveToken('primary', '31 143 255', 0.1),\n },\n styles: buildSyntaxPalette(scheme, foreground),\n });\n};\n\nexport const getLanguageMode = (mode?: LANGUAGE_MODE) => {\n switch (mode) {\n case undefined:\n case 'application/json':\n return json();\n case 'text/x-python':\n return python();\n case 'text/x-sql':\n return getSqlLanguageSupport(StandardSQL);\n case 'text/x-mysql':\n return getSqlLanguageSupport(MySQL);\n case 'text/x-pgsql':\n return getSqlLanguageSupport(PostgreSQL);\n case 'text/x-mssql':\n return getSqlLanguageSupport(MSSQL);\n case 'text/x-sfsql':\n return getSqlLanguageSupport('snowflake');\n case 'text/x-bqsql':\n return getSqlLanguageSupport('bigquery');\n case 'text/x-plsql':\n return getSqlLanguageSupport(PLSQL);\n case 'text/x-rsrc':\n return StreamLanguage.define(r);\n case 'text/x-sh':\n return StreamLanguage.define(shell);\n case 'text/x-toml':\n return StreamLanguage.define(toml);\n case 'text/jsonnet':\n return StreamLanguage.define(jsonnet);\n case 'text/x-dbt':\n return StreamLanguage.define(dbt);\n case 'text/javascript':\n return javascript({ jsx: true });\n case 'text/typescript':\n return javascript({ jsx: true, typescript: true });\n // `text/plain` and any unmapped mode: unstyled, not coloured as JSON.\n default:\n return [];\n }\n};\n\n// A read-only editor can't act on lint errors; its underlines are noise.\nexport const shouldLintJson = (mode: LANGUAGE_MODE | undefined, readOnly: boolean): boolean =>\n mode === 'application/json' && !readOnly;\n\n/**\n * Wraps a lint source so a blank document produces no diagnostics.\n *\n * - For optional fields, where empty is valid but `jsonParseLinter` reports an error.\n */\nexport const skipBlankDocument =\n (source: LintSource): LintSource =>\n (view) =>\n view.state.doc.toString().trim() === '' ? [] : source(view);\n\n/**\n * The JSON linter, optionally blind to a blank document.\n *\n * - Opt-in: some callers rely on the marker alone to explain why empty disables their button.\n * - Not derivable from `variant` — whether blank is valid is the field's contract.\n */\nexport const buildJsonLinter = (allowBlankDocument: boolean) => {\n const source = jsonParseLinter();\n\n return linter(allowBlankDocument ? skipBlankDocument(source) : source);\n};\n","import { resolveToken } from '../../utils/themeTokens';\n\nimport { EDITABLE_EDITOR, READ_ONLY_EDITOR } from './helpers';\n\n/** Per-preset parts of an editor's outer chrome, mapped to selectors by `buildChromeStyles`. */\nexport type EditorChrome = {\n surface: string;\n borderColor: string;\n readOnlySurface: string;\n readOnlyBorderColor: string;\n /** `null`: no hover affordance (form inputs). */\n hoverBorderColor: string | null;\n focusBorderColor: string;\n focusRing: string;\n radius: string;\n paddingY: string;\n /** `null` leaves CodeMirror's own 6px/2px line inset alone. */\n paddingX: { left: string; right: string } | null;\n};\n\n/**\n * Mirrors `InputGroup` at each design language's `TextInput` sizing, so it reads as a form field.\n *\n * - Same colour-scheme tokens as `InputGroup`, so it follows light/dark.\n * - argo: `muted`/`input`, the editable argo field's pair.\n * - legacy: `secondary` as `variant=\"secondary\"`; readonly `muted`/`input` as base `InputGroup`.\n */\nexport const buildInputChrome = (isArgo: boolean): EditorChrome => {\n return {\n surface: isArgo\n ? resolveToken('muted', '241 245 249')\n : resolveToken('secondary', '226 232 240'),\n borderColor: isArgo\n ? resolveToken('input', '203 213 225')\n : resolveToken('secondary', '226 232 240'),\n readOnlySurface: resolveToken('muted', '241 245 249'),\n readOnlyBorderColor: resolveToken('input', '203 213 225'),\n hoverBorderColor: null,\n focusBorderColor: isArgo\n ? resolveToken('primary', '37 99 235')\n : resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', isArgo ? 0.5 : 0.3)}`,\n radius: isArgo ? 'var(--radius-lg, 0.25rem)' : '0.25rem',\n // 2px border + 2×this + `.cm-content`'s 4px + 20px line = a one-line `TextInput`:\n // argo `medium` (36px), legacy `default` (40px).\n paddingY: isArgo ? '3px' : '5px',\n // Tops `.cm-line`'s 6px/2px up to an input's 16px text inset.\n paddingX: { left: '10px', right: '14px' },\n };\n};\n\n/** The SQL workspace's notebook cell: a white canvas, not a form control. */\nexport const buildCanvasChrome = (): EditorChrome => ({\n surface: resolveToken('card', '255 255 255'),\n borderColor: 'transparent',\n readOnlySurface: resolveToken('muted', '241 245 249'),\n readOnlyBorderColor: 'transparent',\n hoverBorderColor: resolveToken('ring', '31 143 255'),\n focusBorderColor: resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', 0.3)}`,\n radius: '8px',\n paddingY: '8px',\n paddingX: null,\n});\n\n/** Spread over `buildBaseThemeStyles()`; read-only keys match the base's to replace its wash. */\nexport const buildChromeStyles = (chrome: EditorChrome) => ({\n '&.cm-editor': {\n border: `solid 1px ${chrome.borderColor}`,\n borderRadius: chrome.radius,\n backgroundColor: chrome.surface,\n paddingTop: chrome.paddingY,\n paddingBottom: chrome.paddingY,\n },\n '&.cm-editor :is(.cm-gutters,.cm-scroller)': { backgroundColor: chrome.surface },\n\n ...(chrome.paddingX\n ? {\n // Gutterless only: text aligns with a neighbouring `TextInput`'s; a gutter owns the edge.\n '&.cm-editor:not(:has(.cm-gutters)) .cm-content': {\n paddingLeft: chrome.paddingX.left,\n paddingRight: chrome.paddingX.right,\n },\n }\n : null),\n\n ...(chrome.hoverBorderColor\n ? { [`${EDITABLE_EDITOR}:hover`]: { borderColor: chrome.hoverBorderColor } }\n : null),\n [`${EDITABLE_EDITOR}:focus-within`]: {\n borderColor: chrome.focusBorderColor,\n boxShadow: chrome.focusRing,\n },\n\n [READ_ONLY_EDITOR]: {\n backgroundColor: chrome.readOnlySurface,\n borderColor: chrome.readOnlyBorderColor,\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: { backgroundColor: chrome.readOnlySurface },\n [`${READ_ONLY_EDITOR} .cm-scroller`]: { backgroundColor: chrome.readOnlySurface },\n});\n","import { StateEffect, StateField, type Text } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n ViewPlugin,\n type ViewUpdate,\n} from '@codemirror/view';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { findLiteralMatches } from '../../utils/findLiteralMatches';\n\nimport { DARK_LINE_ALPHA } from './diffWash';\n\ntype SearchMatch = {\n from: number;\n to: number;\n localIndex: number;\n};\n\nconst setSearchEffect = StateEffect.define<{\n query: string;\n selectedMatchIndex?: number;\n}>();\n\ntype SearchState = {\n query: string;\n selectedMatchIndex?: number;\n matches: SearchMatch[];\n decorations: DecorationSet;\n};\n\nfunction findMatches(doc: Text, query: string): SearchMatch[] {\n // Before `doc.toString()`, which joins the whole rope.\n if (!query || query.length > doc.length) return [];\n\n return findLiteralMatches(doc.toString(), query).map((from, index) => ({\n from,\n to: from + query.length,\n localIndex: index,\n }));\n}\n\nfunction createDecorations(matches: SearchMatch[], selectedLocalIndex?: number): DecorationSet {\n const decorations = matches.map((match) => {\n const isSelected = match.localIndex === selectedLocalIndex;\n\n const decoration = Decoration.mark({\n class: isSelected ? 'cm-searchMatch-selected' : 'cm-searchMatch',\n });\n\n return decoration.range(match.from, match.to);\n });\n\n return Decoration.set(decorations, true);\n}\n\nconst searchField = StateField.define<SearchState>({\n create() {\n return {\n query: '',\n selectedMatchIndex: undefined,\n matches: [],\n decorations: Decoration.none,\n };\n },\n\n update(state, tr) {\n let newState = state;\n\n for (const effect of tr.effects) {\n if (!effect.is(setSearchEffect)) {\n continue;\n }\n\n const { query, selectedMatchIndex } = effect.value;\n\n const matches = findMatches(tr.state.doc, query);\n\n const decorations = createDecorations(matches, selectedMatchIndex);\n\n newState = {\n query,\n selectedMatchIndex,\n matches,\n decorations,\n };\n }\n\n if (tr.docChanged && newState.query) {\n const matches = findMatches(tr.state.doc, newState.query);\n const decorations = createDecorations(matches, newState.selectedMatchIndex);\n\n newState = {\n ...newState,\n matches,\n decorations,\n };\n }\n\n return newState;\n },\n\n provide: (field) => EditorView.decorations.from(field, (state) => state.decorations),\n});\n\nconst searchViewPlugin = ViewPlugin.fromClass(\n class {\n private lastSelectedIndex?: number;\n\n update(update: ViewUpdate) {\n const state = update.state.field(searchField);\n\n if (\n state.selectedMatchIndex !== undefined &&\n state.selectedMatchIndex !== this.lastSelectedIndex\n ) {\n const match = state.matches[state.selectedMatchIndex];\n\n if (match) {\n requestAnimationFrame(() => {\n update.view.dispatch({\n effects: EditorView.scrollIntoView(match.from, { y: 'center' }),\n });\n });\n }\n\n this.lastSelectedIndex = state.selectedMatchIndex;\n }\n\n if (state.selectedMatchIndex === undefined) {\n this.lastSelectedIndex = undefined;\n }\n }\n },\n);\n\n/**\n * Match and current-match fills, per colour scheme.\n *\n * - `&dark` keeps this a static base theme; it applies when the `EditorView.darkTheme` facet is set.\n * - Dark current match uses `neutral[900]` text: white on `blue[500]` is 2.55:1.\n */\nconst searchTheme = EditorView.baseTheme({\n '.cm-searchMatch': {\n backgroundColor: colors.blue[100],\n },\n '.cm-searchMatch > span': {\n color: `${colors.blue[700]} !important`,\n },\n '.cm-searchMatch-selected': {\n backgroundColor: colors.blue[700],\n },\n '.cm-searchMatch-selected > span': {\n color: `${colors.white} !important`,\n },\n\n '&dark .cm-searchMatch': {\n backgroundColor: `${colors.blue[500]}${DARK_LINE_ALPHA}`,\n },\n '&dark .cm-searchMatch > span': {\n color: `${colors.blue[200]} !important`,\n },\n '&dark .cm-searchMatch-selected': {\n backgroundColor: colors.blue[500],\n },\n '&dark .cm-searchMatch-selected > span': {\n color: `${colors.neutral[900]} !important`,\n },\n});\n\nexport function searchExtension() {\n return [searchField, searchViewPlugin, searchTheme];\n}\n\nexport function updateSearch(view: EditorView, query: string, selectedMatchIndex?: number) {\n view.dispatch({ effects: setSearchEffect.of({ query, selectedMatchIndex }) });\n}\n","import { isMac } from '../../utils';\nimport { Kbd } from '../Kbd';\n\nexport const ToggleComponentHelp = () => (\n <div>\n Use <Kbd>{isMac ? 'Command+/' : 'Ctrl+/'}</Kbd> to toggle comments.\n </div>\n);\n","import { type Extension } from '@codemirror/state';\n\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\nimport { useThemeAttributes } from '../ThemeProvider/useThemeAttributes';\n\n// Shared across instances: each theme's StyleModule appends rules to a document-level\n// stylesheet, so one module per theme keeps it constant-size however many editors mount.\nconst themeCache = new Map<string, Extension>();\n\n/**\n * A CodeMirror extension shared per `cacheKey`, rebuilt when the brand or light/dark mode changes.\n *\n * - `build` reads live `--*` values off `<html>`, a dependency no deps array can see.\n * - `scheme` comes from the same read as the key, for values that are a light/dark pair.\n * - `cacheKey` must include everything `build` closes over, or different inputs share a theme.\n */\nexport const useThemedExtension = (\n cacheKey: string,\n build: (scheme: ResolvedColorScheme) => Extension,\n): Extension => {\n const { scheme, cacheKey: themeKey } = useThemeAttributes();\n const key = `${themeKey} ${cacheKey}`;\n\n // Filling the module cache during render is idempotent.\n let cached = themeCache.get(key);\n if (!cached) {\n cached = build(scheme);\n themeCache.set(key, cached);\n }\n\n return cached;\n};\n","import { useMemo } from 'react';\nimport { Compartment, type Extension } from '@codemirror/state';\nimport { tooltips, ViewPlugin } from '@codemirror/view';\n\n// Whether this element becomes the containing block of a `position: fixed` descendant.\n// - Encodes the full CSS rule; `contain` and `will-change` are value lists, matched loosely.\n// - `content-visibility` is left to `crops`, the stronger of the two for our purposes.\nconst establishesFixedContainingBlock = (style: CSSStyleDeclaration) =>\n style.transform !== 'none' ||\n style.translate !== 'none' ||\n style.rotate !== 'none' ||\n style.scale !== 'none' ||\n style.perspective !== 'none' ||\n style.filter !== 'none' ||\n style.backdropFilter !== 'none' ||\n /\\b(paint|layout|strict|content)\\b/.test(style.contain) ||\n /\\b(transform|perspective|filter|contain)\\b/.test(style.willChange);\n\n// Crops even a fixed-position descendant; `content-visibility: auto` implies paint\n// containment without showing it in computed `contain`.\nconst crops = (style: CSSStyleDeclaration) =>\n style.overflowX !== 'visible' ||\n style.overflowY !== 'visible' ||\n style.maskImage !== 'none' ||\n style.contentVisibility !== 'visible' ||\n /\\b(paint|strict|content)\\b/.test(style.contain);\n\n/**\n * Where a tooltip can hang uncropped, or `null` for CodeMirror's default.\n *\n * - Hosts above the outermost cropper.\n * - Stops at the fixed containing block; nothing higher can crop.\n * - `<body>` and `<html>` never count as croppers.\n */\nconst findTooltipHost = (from: HTMLElement) => {\n let outermostCropper: HTMLElement | null = null;\n\n for (let node = from.parentElement; node && node !== document.body; node = node.parentElement) {\n const style = getComputedStyle(node);\n\n if (crops(style)) {\n outermostCropper = node;\n } else if (establishesFixedContainingBlock(style)) {\n return outermostCropper?.parentElement ?? node;\n }\n }\n\n return outermostCropper?.parentElement ?? null;\n};\n\n/**\n * `tooltips()`, re-hosted so the completion popup is never cropped.\n *\n * - Must survive a masked, scrolling `Modal` and kbc-ui's `content-visibility: auto` blocks.\n * - Not `document.body`: the popup would sit behind the modal, which disables pointer events there.\n * - The only tooltip host in either editor: CodeMirror takes the first parent configured.\n */\nconst tooltipsExtension = (): Extension => {\n // A compartment, because a prop-driven full reconfigure drops appended config but keeps compartments.\n const layer = new Compartment();\n\n return [\n layer.of(tooltips()),\n ViewPlugin.define((view) => {\n // Deferred: a plugin cannot dispatch while its view is being built, and reading styles\n // here would force a layout flush mid-commit. One-shot; later ancestor changes are missed.\n const scheduled = setTimeout(() => {\n if (!view.dom.isConnected) return;\n\n const parent = findTooltipHost(view.dom);\n if (parent) view.dispatch({ effects: layer.reconfigure(tooltips({ parent })) });\n });\n\n return { destroy: () => clearTimeout(scheduled) };\n }),\n ];\n};\n\n/**\n * The tooltips extension, built once per editor; a rebuild would drop the resolved host.\n */\nexport const useTooltipsExtension = () => useMemo(tooltipsExtension, []);\n","import type { Completion, CompletionContext, CompletionSource } from '@codemirror/autocomplete';\n\nimport { useStableCallback } from '../../hooks/useStableCallback';\n\nexport type EditorVariable = { name: string; value?: string };\n\n// Ranks variables above the language's many same-prefix keywords.\nconst BOOST = 2000;\n\n// - One brace or two: `closeBrackets` turns a typed `{` into `{}`.\n// - One name charset throughout; a narrower second one would start the range mid-name and never match.\nconst NAME = String.raw`[\\w-]*`;\nconst AT_CARET = new RegExp(String.raw`(?:\\{{1,2} ?)?${NAME}$`);\nconst NAME_AT_END = new RegExp(`${NAME}$`);\nconst OPENING = /\\{{1,2} ?$/;\nconst CLOSING = /^ ?\\}{1,2}/;\n\n/**\n * Completes a mustache-style `{{name}}` placeholder.\n */\nexport const completeVariables = (variables: EditorVariable[] = []): CompletionSource => {\n if (variables.length === 0) return () => null;\n\n const options: Completion[] = variables.map(({ name, value }) => ({\n // Bare name: the only spelling both editors' filters match, braces typed or not.\n label: name,\n displayLabel: `{{${name}}}`,\n detail: value,\n type: 'variable',\n boost: BOOST,\n apply: (view, completion, from, to) => {\n const { doc } = view.state;\n const line = doc.lineAt(from);\n const insert = `{{${completion.label}}}`;\n\n // Braces are found, not assumed: `closeBrackets` may have added a closing one.\n const opening = OPENING.exec(doc.sliceString(line.from, from));\n const closing = CLOSING.exec(doc.sliceString(to, line.to));\n const start = opening ? from - opening[0].length : from;\n const end = closing ? to + closing[0].length : to;\n\n view.dispatch({\n changes: { from: start, to: end, insert },\n selection: { anchor: start + insert.length },\n });\n },\n }));\n\n return (context: CompletionContext) => {\n const match = context.matchBefore(AT_CARET);\n\n if (!match?.text) return null;\n\n const [name = ''] = NAME_AT_END.exec(match.text) ?? [];\n\n return { from: match.to - name.length, options };\n };\n};\n\n/**\n * The completion source both editors install, with a stable identity.\n *\n * - It keys their extension memo, while callers pass a fresh array on every store push.\n * - CodeMirror asks per request, so it still sees the latest variables.\n */\nexport const useVariableCompletion = (variables: EditorVariable[] = []): CompletionSource =>\n useStableCallback(completeVariables(variables));\n","import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { CompletionSource } from '@codemirror/autocomplete';\nimport { autocompletion, completeAnyWord } from '@codemirror/autocomplete';\nimport { unifiedMergeView } from '@codemirror/merge';\nimport { EditorView, keymap, placeholder as cmPlaceholder } from '@codemirror/view';\nimport CodeMirror, {\n EditorState,\n type Extension,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\n\nimport { keyCodes } from '../../constants/keyCodes';\nimport { useStableCallback } from '../../hooks/useStableCallback';\nimport { cn } from '../../utils';\nimport { HelpBlock } from '../HelpBlock';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { ButtonToolbar } from './ButtonToolbar';\nimport { buildChromeStyles, buildInputChrome } from './editorChrome';\nimport type { LANGUAGE_MODE } from './helpers';\nimport {\n buildBaseThemeStyles,\n buildBasicSetup,\n buildCustomTheme,\n buildJsonLinter,\n getLanguageMode,\n shouldLintJson,\n} from './helpers';\nimport { searchExtension, updateSearch } from './search';\nimport { ToggleComponentHelp } from './ToggleComponentHelp';\nimport { useThemedExtension } from './tokenTheme';\nimport { useTooltipsExtension } from './tooltips';\nimport { type EditorVariable, useVariableCompletion } from './variableCompletion';\n\ntype Props = {\n value: string;\n previousValue?: string;\n /** `'field'`: `InputGroup` chrome, sized to content (don't pin height). `'plain'`: full-bleed panel. */\n variant?: 'plain' | 'field';\n mode?: LANGUAGE_MODE;\n placeholder?: string;\n /** Screen-reader name: the editor has no visible label of its own. */\n ariaLabel?: string;\n /** Prefer over `ariaLabel` inside a form. */\n ariaLabelledBy?: string;\n ariaDescribedBy?: string;\n /** Visual error styling is the caller's (`variant=\"field\"`). */\n ariaInvalid?: boolean;\n ariaRequired?: boolean;\n /** JSON modes: a blank document is not a parse error. Off by default: the mark explains a disabled Save. */\n allowBlankDocument?: boolean;\n /** Bound on CodeMirror's content node (the wrapper is not what gets focused). */\n onBlur?: () => void;\n /** Highlights matches; the find UI is the caller's. Omit both props to skip the search extension. */\n searchQuery?: string;\n searchMatchIndex?: number;\n readOnly?: boolean;\n /** Refuses edits without changing the look, e.g. during a save; `readOnly` makes a greyed viewer. */\n inputLocked?: boolean;\n /** One word per label (a space breaks matching; phrases go in `completionSource`). Pass a stable array. */\n autocompletions?: string[];\n /** Cursor-dependent completions; wins over `autocompletions` / `completeAny`. Memoize it. */\n completionSource?: CompletionSource;\n /** Completed into `{{name}}`, alongside `completionSource`. */\n variables?: EditorVariable[];\n /** `false` silences every source, the language's own included (e.g. shell mode used only for colours). */\n withCompletions?: boolean;\n extraKeys?: Record<string, () => void>;\n withToggleCommentHint?: boolean;\n withAutofocus?: boolean;\n withLineNumbers?: boolean;\n withLineWrapping?: boolean;\n withCollapseUnchanged?: boolean;\n withCopyButton?: boolean;\n completeAny?: boolean;\n help?: ReactNode;\n helpPostfix?: ReactNode;\n /** Toolbar actions beside the copy button; pass `size=\"icon-xs\"` buttons to fit the 28px chip. */\n renderAdditionalButtons?: (value?: string) => ReactNode;\n className?: string;\n} & (\n | { readOnly: true; onChange?: never }\n // `boolean`, not `false`: a permission-locked field still needs its handler when editable.\n | { readOnly?: boolean; onChange: (value: string) => void }\n);\n\nconst emptyObject = {};\n\nexport const CodeEditor = ({\n value,\n previousValue,\n onChange,\n variant = 'plain',\n mode = 'application/json',\n placeholder = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaInvalid,\n ariaRequired,\n allowBlankDocument = false,\n onBlur,\n searchQuery,\n searchMatchIndex,\n readOnly = false,\n inputLocked = false,\n autocompletions,\n completionSource,\n variables,\n withCompletions = true,\n extraKeys = emptyObject,\n withToggleCommentHint = false,\n withAutofocus = false,\n withLineNumbers = true,\n withLineWrapping = true,\n withCollapseUnchanged = false,\n withCopyButton = false,\n completeAny = false,\n help = null,\n helpPostfix = null,\n renderAdditionalButtons,\n className,\n}: Props) => {\n // A new handler identity rebuilds CodeMirror's extension tree; callers pass inline arrows.\n const handleChange = useStableCallback((next: string) => onChange?.(next));\n const handleBlur = useStableCallback(() => onBlur?.());\n\n // Presence, not truthiness, keeps the extension set stable while the query changes.\n const withSearch = searchQuery !== undefined;\n const withBlur = onBlur !== undefined;\n const editorRef = useRef<ReactCodeMirrorRef>(null);\n\n // `null` when empty, so the extension is left out.\n const contentAria = useMemo(() => {\n const attributes: Record<string, string> = {};\n if (ariaLabel !== undefined) attributes['aria-label'] = ariaLabel;\n if (ariaLabelledBy !== undefined) attributes['aria-labelledby'] = ariaLabelledBy;\n if (ariaDescribedBy !== undefined) attributes['aria-describedby'] = ariaDescribedBy;\n // Stringified: `contentAttributes` would drop a boolean `false`.\n if (ariaInvalid !== undefined) attributes['aria-invalid'] = String(ariaInvalid);\n if (ariaRequired !== undefined) attributes['aria-required'] = String(ariaRequired);\n return Object.keys(attributes).length > 0 ? attributes : null;\n }, [ariaLabel, ariaLabelledBy, ariaDescribedBy, ariaInvalid, ariaRequired]);\n\n useEffect(() => {\n const view = editorRef.current?.view;\n if (view && withSearch) updateSearch(view, searchQuery, searchMatchIndex);\n }, [withSearch, searchQuery, searchMatchIndex]);\n\n // A view created with a query already set (remount, tab switch) needs it applied on build.\n const handleCreateEditor = useStableCallback((view: EditorView) => {\n if (searchQuery) updateSearch(view, searchQuery, searchMatchIndex);\n });\n\n // Callers pass this inline; only the key set rebuilds the keymap, handlers are read on press.\n const extraKeysRef = useRef(extraKeys);\n useLayoutEffect(() => {\n extraKeysRef.current = extraKeys;\n });\n\n const boundKeysSignature = Object.keys(extraKeys).join('\\n');\n const boundKeys = useMemo(\n () => boundKeysSignature.split('\\n').filter(Boolean),\n [boundKeysSignature],\n );\n\n const tooltipLayer = useTooltipsExtension();\n\n // Built here, not inside `languageData.of`, which runs per completion request.\n const variableCompletion = useVariableCompletion(variables);\n\n // Key has no component prefix: shared with `SqlEditor`.\n const customTheme = useThemedExtension('editor:syntax', buildCustomTheme);\n\n // The brand is in the cache key: `useThemedExtension` caches per key and tracks only `<html>`.\n const isArgo = useArgoDesign();\n const isField = variant === 'field';\n const baseTheme = useThemedExtension(\n isField ? `code-editor:field:${isArgo ? 'argo' : 'legacy'}` : 'code-editor:chrome',\n (scheme) =>\n // `dark` activates every `&dark` rule (ours and CodeMirror's); set here so swapping the\n // github palette in `buildCustomTheme` cannot turn them off.\n EditorView.theme(\n {\n ...buildBaseThemeStyles(scheme),\n ...(isField ? buildChromeStyles(buildInputChrome(isArgo)) : null),\n },\n { dark: scheme === 'dark' },\n ),\n );\n\n const commonExtensions: Extension[] = useMemo(() => {\n const callerCompletions =\n completionSource ??\n (completeAny ? completeAnyWord : autocompletions?.length ? autocompletions : null);\n\n // An empty list is left out, or CodeMirror runs a never-matching source on every keystroke.\n const completionEntries = [\n ...(callerCompletions ? [{ autocomplete: callerCompletions }] : []),\n { autocomplete: variableCompletion },\n ];\n\n return [\n getLanguageMode(mode),\n shouldLintJson(mode, readOnly) ? buildJsonLinter(allowBlankDocument) : [],\n withLineWrapping ? EditorView.lineWrapping : [],\n EditorState.languageData.of(() => completionEntries),\n keymap.of(\n boundKeys.map((key) => ({\n key,\n run: () => {\n extraKeysRef.current[key]?.();\n return true;\n },\n })),\n ),\n readOnly || !withCompletions\n ? []\n : [\n // The only `autocompletion()` (`buildBasicSetup` disables basicSetup's). Not gated on\n // the completion props, so the language's own vocabulary still completes.\n autocompletion(),\n ],\n // On the focused content node (`div[role=\"textbox\"]`), not the wrapper.\n contentAria ? EditorView.contentAttributes.of(contentAria) : [],\n withBlur ? EditorView.domEventHandlers({ blur: handleBlur }) : [],\n withSearch ? searchExtension() : [],\n tooltipLayer,\n baseTheme,\n ];\n }, [\n autocompletions,\n completionSource,\n variableCompletion,\n completeAny,\n withCompletions,\n boundKeys,\n mode,\n readOnly,\n allowBlankDocument,\n withLineWrapping,\n baseTheme,\n contentAria,\n withBlur,\n handleBlur,\n withSearch,\n tooltipLayer,\n ]);\n\n const extensions = useMemo(() => {\n return [\n ...commonExtensions,\n cmPlaceholder(placeholder),\n EditorView.editable.of(!readOnly),\n // The lock is only this facet: `contenteditable` drives the read-only wash and `basicSetup`\n // holds the undo history, so neither is reconfigured.\n EditorState.readOnly.of(readOnly || inputLocked),\n previousValue\n ? unifiedMergeView({\n original: previousValue,\n mergeControls: false,\n highlightChanges: false,\n collapseUnchanged: withCollapseUnchanged ? {} : undefined,\n })\n : [],\n ];\n }, [commonExtensions, placeholder, readOnly, inputLocked, previousValue, withCollapseUnchanged]);\n\n const config = useMemo(() => {\n return {\n ...buildBasicSetup(readOnly),\n lineNumbers: withLineNumbers,\n // Mod-f would open CodeMirror's own search panel beside the caller's.\n ...(withSearch ? { searchKeymap: false } : null),\n };\n }, [withLineNumbers, readOnly, withSearch]);\n\n return (\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-variant={variant}\n className={cn(\n // Scoped to CodeMirror's box so the toolbar needn't undo it with `!important`.\n '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',\n // Field: transparent so square corners don't show; visible so the focus ring isn't cropped.\n isField\n ? 'tw:[&_>.cm-theme]:overflow-visible tw:[&_>.cm-theme]:bg-transparent'\n : 'tw:[&_>.cm-theme]:overflow-auto tw:[&_>.cm-theme]:bg-background',\n className,\n )}\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === keyCodes.ESCAPE) {\n event.stopPropagation();\n }\n }}\n >\n <ButtonToolbar value={withCopyButton ? value : undefined}>\n {renderAdditionalButtons?.(value)}\n </ButtonToolbar>\n <CodeMirror\n ref={editorRef}\n onCreateEditor={handleCreateEditor}\n theme={customTheme}\n value={value}\n onChange={handleChange}\n extensions={extensions}\n autoFocus={withAutofocus}\n basicSetup={config}\n />\n {!readOnly && (withToggleCommentHint || help || helpPostfix) && (\n <HelpBlock className=\"tw:mt-2 tw:flex tw:flex-wrap tw:gap-1\">\n {help}\n {withToggleCommentHint ? <ToggleComponentHelp /> : null}\n {helpPostfix}\n </HelpBlock>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,iBAAiB,EAAE,OAAO,eAAyD;CAC9F,IAAI,CAAC,SAAS,CAAC,UAAU,OAAO;CAEhC,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,CAAC,CAAC,SAAS,oBAAC,iBAAD;GAAiB,MAAK;GAAU,SAAQ;GAAY,MAAM;EAAQ,CAAA,GAC7E,QACE;;AAET;;;ACXA,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,cAAwC;CAAE,MAAM,CAAC,UAAU;CAAG,QAAQ,CAAC,WAAW;AAAE;AAC1F,MAAM,YAAY;CAAC;CAAY;CAAa;CAAc;CAAW;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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,aAAa,cAAc;EAC/B,OAAO;GACL,GAAG;GACHA,YAAcC,aAAW;GACzB,WAAW,SAAS,GAAG,CAAC,QAAQ;GAGhC,YAAY,SAAS,GAAG,YAAY,WAAW;GAC/C,gBACI,iBAAiB;IACf,UAAU;IACV,eAAe;IACf,kBAAkB;IAClB,mBAAmB,wBAAwB,CAAC,IAAI,KAAA;GAClD,CAAC,IACD,CAAC;EACP;CACF,GAAG;EAAC;EAAkBA;EAAa;EAAU;EAAa;EAAe;CAAqB,CAAC;CAE/F,MAAM,SAAS,cAAc;EAC3B,OAAO;GACL,GAAG,gBAAgB,QAAQ;GAC3B,aAAa;GAEb,GAAI,aAAa,EAAE,cAAc,MAAM,IAAI;EAC7C;CACF,GAAG;EAAC;EAAiB;EAAU;CAAU,CAAC;CAE1C,OAEE,qBAAC,OAAD;EACE,gBAAc;EACd,WAAW,GAET,kLAEA,UACI,wEACA,mEACJ,SACF;EACA,YAAY,UAAyB;GACnC,IAAI,MAAM,QAAQ,SAAS,QACzB,MAAM,gBAAgB;EAE1B;EAfF,UAAA;GAiBE,oBAAC,eAAD;IAAe,OAAO,iBAAiB,QAAQ,KAAA;IAC5C,UAAA,0BAA0B,KAAK;GACnB,CAAA;GACf,oBAAC,YAAD;IACE,KAAK;IACL,gBAAgB;IAChB,OAAO;IACA;IACP,UAAU;IACE;IACZ,WAAW;IACX,YAAY;GACb,CAAA;GACA,CAAC,aAAa,yBAAyB,QAAQ,gBAC9C,qBAAC,WAAD;IAAW,WAAU;IAArB,UAAA;KACG;KACA,wBAAwB,oBAAC,qBAAD,CAAsB,CAAA,IAAI;KAClD;IACQ;;EAEV;;AAET"}
1
+ {"version":3,"file":"CodeEditor-Y0iE-SwV.js","names":["cmPlaceholder","placeholder"],"sources":["../src/components/CodeEditor/ButtonToolbar.tsx","../src/components/CodeEditor/modes/dbt.ts","../src/components/CodeEditor/modes/jsonnet.ts","../src/components/CodeEditor/diffWash.ts","../src/components/CodeEditor/syntaxPalette.ts","../src/components/CodeEditor/helpers.ts","../src/components/CodeEditor/editorChrome.ts","../src/components/CodeEditor/search.ts","../src/components/CodeEditor/ToggleComponentHelp.tsx","../src/components/CodeEditor/tokenTheme.ts","../src/components/CodeEditor/tooltips.ts","../src/components/CodeEditor/variableCompletion.ts","../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { ClipboardButton } from '../../blocks/ClipboardButton';\n\n// Floats over the top-right corner of the editor it is rendered into — private to\n// `CodeEditor`, which is the `relative` ancestor it positions against. `right-3`\n// leaves room for the scrollbar track, whose width the browser owns and no token\n// here describes.\nexport const ButtonToolbar = ({ value, children }: { value?: string; children?: ReactNode }) => {\n if (!value && !children) return null;\n\n return (\n <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\">\n {!!value && <ClipboardButton size=\"icon-xs\" variant=\"invisible\" text={value} />}\n {children}\n </div>\n );\n};\n","import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';\nimport { simpleMode } from '@codemirror/legacy-modes/mode/simple-mode';\n\n// A dbt step is `dbt <command> [<subcommand>] [arguments, flags and selectors]`,\n// and the vocabulary below is grouped by the slot it belongs to — both to colour\n// it and to decide what is worth offering where.\nconst COMMANDS = [\n 'run-operation',\n 'run',\n 'test',\n 'seed',\n 'snapshot',\n 'list',\n 'ls',\n 'compile',\n 'build',\n 'deps',\n 'docs',\n 'source',\n];\nconst SUBCOMMANDS: Record<string, string[]> = { docs: ['generate'], source: ['freshness'] };\nconst ARGUMENTS = ['--select', '--exclude', '--selector', '--defer', '--resource-type', '-s'];\n// The arguments whose value is a graph selector, and so the only ones a selector\n// method has anything to attach to.\nconst SELECTORS = ['--select', '--exclude', '-s'];\nconst METHODS = [\n 'path:',\n 'source:',\n 'tag:',\n 'package:',\n 'config:',\n 'test_type:',\n 'test_name:',\n 'state:',\n 'exposure:',\n 'metric:',\n 'result:',\n 'source_status:',\n 'column_name:',\n];\nconst FLAGS = [\n '--fail-fast',\n '--warn-error',\n '--favor-state',\n '--vars',\n '--models',\n '--threads',\n '--profiles-dir',\n '--profile',\n '--full-refresh',\n];\n\n// A subcommand only ever highlights together with its command, so `dbt docs` stays\n// unpainted until `generate` follows it.\nconst COMMAND_PHRASES = COMMANDS.flatMap((command) => {\n const subcommands = SUBCOMMANDS[command];\n\n return subcommands ? subcommands.map((subcommand) => `${command} ${subcommand}`) : [command];\n});\n\n// Alternation is first-match, so a word that prefixes another has to come first\n// (`run-operation` before `run`, `--profiles-dir` before `--profile`). Sorting by\n// length keeps that true however the lists above are written.\nconst alternation = (list: string[]) => [...list].sort((a, b) => b.length - a.length).join('|');\n\n// Every keyword follows whitespace, so the leading run is part of the match.\n// Commands and arguments end on a word boundary; methods and flags carry their\n// own terminator (`:`) or need none.\nconst word = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})\\\\b`, 'i');\nconst prefix = (list: string[]) => new RegExp(`^\\\\s+(?:${alternation(list)})`, 'i');\n\n// The word being completed: letters, digits, `_`, `-` and the `:` a selector\n// method ends with. Whitespace stays out of it, so a two-word label like `docs\n// generate` cannot stretch the match back across the words before the cursor.\nconst WORD = /[\\w:-]*$/;\n\nconst asOptions = (list: string[], type: string): Completion[] =>\n list.map((label) => ({ label, type }));\n\n// `type` drives the popup icon, so each group carries the one that matches the\n// colour the mode paints it in.\nconst DBT: Completion[] = [{ label: 'dbt', type: 'keyword' }];\nconst COMMAND_OPTIONS = asOptions(COMMANDS, 'keyword');\nconst SUBCOMMAND_OPTIONS: Record<string, Completion[]> = Object.fromEntries(\n Object.entries(SUBCOMMANDS).map(([command, subcommands]) => [\n command,\n asOptions(subcommands, 'keyword'),\n ]),\n);\nconst ARGUMENT_OPTIONS = asOptions(ARGUMENTS, 'variable');\nconst FLAG_OPTIONS = asOptions(FLAGS, 'constant');\nconst METHOD_OPTIONS = asOptions(METHODS, 'property');\n\n// Which slice of the vocabulary the cursor's slot can hold, given the words\n// already finished ahead of it. Offering the whole vocabulary everywhere proposes\n// `dbt` mid-command and a selector method with no selector to attach to.\nconst optionsAfter = (words: string[]): Completion[] => {\n const [step, command, ...rest] = words;\n\n if (step === undefined) return DBT;\n if (step.toLowerCase() !== 'dbt') return [];\n if (command === undefined) return COMMAND_OPTIONS;\n\n const subcommands = SUBCOMMAND_OPTIONS[command.toLowerCase()];\n if (subcommands && rest.length === 0) return subcommands;\n\n // A selector argument takes any number of space-separated values, so what\n // decides the slot is the last argument, not whether a selector appeared at all:\n // `--select tag:a tag:b` keeps offering methods, `--select a --profile p` stops.\n const lastArgument = rest.filter((it) => it.startsWith('-')).at(-1);\n const selecting = lastArgument !== undefined && SELECTORS.includes(lastArgument.toLowerCase());\n\n return selecting\n ? [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS, ...METHOD_OPTIONS]\n : [...ARGUMENT_OPTIONS, ...FLAG_OPTIONS];\n};\n\nconst complete = (context: CompletionContext): CompletionResult | null => {\n const typed = context.matchBefore(WORD);\n\n // `WORD` also matches the empty string, so without this the popup would open on\n // every space. Asking for completions explicitly still opens it there.\n if (!typed?.text && !context.explicit) return null;\n\n const from = typed?.from ?? context.pos;\n const line = context.state.doc.lineAt(from);\n const options = optionsAfter(\n line.text\n .slice(0, from - line.from)\n .split(/\\s+/)\n .filter(Boolean),\n );\n\n return options.length > 0 ? { from, options, validFor: WORD } : null;\n};\n\nexport const dbt = simpleMode({\n languageData: {\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n commentTokens: { line: '--', block: { open: '/*', close: '*/' } },\n autocomplete: complete,\n },\n start: [\n { regex: /\"(?:[^\\\\]|\\\\.)*?(?:\"|$)/, token: 'string' },\n // Word-bounded, so `dbtX` is not a dbt step whose first word happens to\n // colour — the same thing the completion source asks of it.\n { regex: /dbt\\b/, token: 'keyword', sol: true },\n { regex: word(COMMAND_PHRASES), token: 'keyword' },\n { regex: word(ARGUMENTS), token: 'variableName' },\n { regex: prefix(METHODS), token: 'propertyName' },\n { regex: prefix(FLAGS), token: 'attributeName' },\n { regex: /(?:@|\\*|,|\\+\\d+|\\d+\\+|\\+)/, token: 'operator' },\n { regex: /'.*'/, token: 'string' },\n { regex: /true|false/, token: 'atom' },\n ],\n});\n","import type { StreamParser } from '@codemirror/language';\n\n/**\n * Port of google/codemirror-mode-jsonnet (Apache-2.0) to CodeMirror 6 tags.\n *\n * - Patterns are anchored with `^`: unanchored, `StringStream.match` scans the whole rest of the line.\n */\n\nconst COMMENT_END = /^\\*\\//;\nconst COMMENT_START = /^\\/\\/|^#/;\nconst C_COMMENT_START = /^\\/\\*/;\nconst TEXT_BLOCK = /^\\|\\|\\|/;\nconst TEXT_BLOCK_END = /^\\s*\\|\\|\\|/;\nconst RAW_DOUBLE = /^\"\"/;\nconst RAW_SINGLE = /^''/;\nconst CLOSE_DOUBLE = /^\"/;\nconst CLOSE_SINGLE = /^'/;\nconst ESCAPE = /^\\\\[\\\\\"'/bfnrt0]/;\nconst UNICODE_ESCAPE = /^\\\\u[0-9a-fA-F]{4}/;\nconst BACKSLASH = /^\\\\/;\nconst IMPORT = /^import(?:str)?\\s*(@?)([\"'])/;\nconst QUOTE = /^(@?)([\"'])/;\nconst ROOT = /^\\$/;\nconst NUMBER = /^(?:\\.\\d+|\\d+\\.?\\d*)(?:e[-+]?\\d+)?/i;\nconst OPERATOR = /^[-+/*=<>!&~^|$%]+/;\nconst IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]*/;\n\nconst KEYWORDS: Record<string, 'keyword' | 'atom'> = {\n local: 'keyword',\n self: 'keyword',\n super: 'keyword',\n assert: 'keyword',\n function: 'keyword',\n if: 'keyword',\n then: 'keyword',\n else: 'keyword',\n for: 'keyword',\n in: 'keyword',\n tailstrict: 'keyword',\n error: 'keyword',\n true: 'atom',\n false: 'atom',\n null: 'atom',\n};\n\ntype State = {\n cComment: boolean;\n textBlock: boolean;\n textBlockIndent: number | null;\n string: boolean;\n importString: boolean;\n stringSingle: boolean;\n stringRaw: boolean;\n};\n\nexport const jsonnet: StreamParser<State> = {\n name: 'jsonnet',\n\n // `toggleComment` is a no-op without these, so Mod-/ silently does nothing.\n languageData: { commentTokens: { line: '//', block: { open: '/*', close: '*/' } } },\n\n startState: () => ({\n cComment: false,\n textBlock: false,\n textBlockIndent: null,\n string: false,\n importString: false,\n stringSingle: false,\n stringRaw: false,\n }),\n\n token: (stream, state) => {\n if (state.cComment) {\n if (stream.match(COMMENT_END)) {\n state.cComment = false;\n return 'comment';\n }\n stream.next();\n return 'comment';\n }\n\n // Match the closing `|||` before measuring indent, or a block closed at column 0 never ends.\n if (state.textBlock) {\n if (state.textBlockIndent == null) {\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n state.textBlockIndent = stream.indentation();\n }\n if (stream.indentation() >= state.textBlockIndent) {\n stream.skipToEnd();\n return 'string';\n }\n if (stream.match(TEXT_BLOCK_END)) {\n state.textBlock = false;\n return 'string';\n }\n stream.next();\n return 'invalid';\n }\n\n if (state.string || state.importString) {\n const style = state.string ? 'string' : 'meta';\n\n if (state.stringRaw) {\n if (stream.match(state.stringSingle ? RAW_SINGLE : RAW_DOUBLE)) return 'escape';\n } else {\n if (stream.match(ESCAPE)) return 'escape';\n if (stream.match(UNICODE_ESCAPE)) return 'escape';\n if (stream.match(BACKSLASH)) return 'invalid';\n }\n\n if (stream.match(state.stringSingle ? CLOSE_SINGLE : CLOSE_DOUBLE)) {\n state.string = false;\n state.importString = false;\n return style;\n }\n\n stream.next();\n return style;\n }\n\n if (stream.match(COMMENT_START)) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.match(C_COMMENT_START)) {\n state.cComment = true;\n return 'comment';\n }\n\n const imported = stream.match(IMPORT);\n if (Array.isArray(imported)) {\n state.importString = true;\n state.stringRaw = imported[1] === '@';\n state.stringSingle = imported[2] === \"'\";\n return 'meta';\n }\n\n const quoted = stream.match(QUOTE);\n if (Array.isArray(quoted)) {\n state.string = true;\n state.stringRaw = quoted[1] === '@';\n state.stringSingle = quoted[2] === \"'\";\n return 'string';\n }\n\n if (stream.match(TEXT_BLOCK)) {\n state.textBlock = true;\n state.textBlockIndent = null;\n return 'string';\n }\n\n if (stream.match(ROOT)) return 'keyword';\n if (stream.match(NUMBER)) return 'number';\n if (stream.match(OPERATOR)) return 'operator';\n\n // Consumed whole so that a keyword's prefix (`locally`) is not styled.\n const identifier = stream.match(IDENTIFIER);\n if (Array.isArray(identifier)) return KEYWORDS[identifier[0]] ?? null;\n\n stream.next();\n return null;\n },\n};\n","import type { ResolvedColorScheme } from '../ThemeProvider/types';\n\n/**\n * Alpha suffixes for the dark-scheme diff and state tints.\n *\n * - Line fill stays subtle for text to read; the gutter sits a step stronger.\n * - `DARK_LINE_ALPHA` is also appended by the static washes in `highlighting.ts` and `search.ts`.\n */\nexport const DARK_LINE_ALPHA = '29'; /* 16% */\nconst DARK_GUTTER_ALPHA = '47'; /* 28% */\n\n/**\n * The two diff fills per scheme: light uses the opaque pastel, dark the `500` hue at low alpha.\n *\n * - Imports nothing, so `MergeEditor` shares it without pulling in CodeMirror via `helpers.ts`.\n * - Shared by `helpers.ts` and `MergeEditor/decorations.ts`, so their alphas cannot drift.\n */\nexport const buildDiffWash = (scheme: ResolvedColorScheme) => {\n const dark = scheme === 'dark';\n\n return {\n line: (hue: string, pastel: string) => (dark ? `${hue}${DARK_LINE_ALPHA}` : pastel),\n gutter: (hue: string, pastel: string) => (dark ? `${hue}${DARK_GUTTER_ALPHA}` : pastel),\n };\n};\n","import { tags } from '@lezer/highlight';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\n\n/**\n * The tag colours layered over the stock github palette, per colour scheme.\n *\n * - Imports only tags and ramps, so `scripts/contrast-audit.ts` can measure it.\n * - These override stock rules for the same tag.\n * - Colours are chosen against `background` and `muted` (`variant=\"field\"`); ratios quote both.\n */\nexport const buildSyntaxPalette = (scheme: ResolvedColorScheme, foreground: string) => {\n const dark = scheme === 'dark';\n\n return [\n // Identifiers and brackets carry no colour, as on github.com.\n { tag: [tags.name, tags.special(tags.string), tags.bracket], color: foreground },\n // Functions — light `600` 6.13 / 5.84, dark `300` 9.62 / 7.80.\n { tag: tags.standard(tags.name), color: dark ? colors.purple[300] : colors.purple[600] },\n // Special vars — light `800` 7.26 / 6.92, dark `300` 13.49 / 10.94.\n { tag: tags.special(tags.name), color: dark ? colors.cyan[300] : colors.cyan[800] },\n // Strings — light `800` 7.23 / 6.89, dark `300` 13.53 / 10.97.\n { tag: tags.string, color: dark ? colors.warning[300] : colors.warning[800] },\n // Light-only fixes for stock colours below AA; `CONTRAST-AUDIT.md` has all surfaces.\n ...(dark\n ? []\n : [\n // Keywords — 5.96 / 5.69.\n { tag: [tags.keyword, tags.typeName, tags.typeOperator], color: colors.error[550] },\n // Comments — 6.44 / 6.15.\n { tag: tags.comment, color: colors.neutral[500] },\n // Markdown quotes — 7.15 / 6.82.\n { tag: tags.quote, color: colors.green[900] },\n // Lex errors — 7.81 / 7.45; stock red fails the read-only wash.\n { tag: tags.invalid, color: colors.error[700] },\n ]),\n // Dark only: `githubDarkStyle` has no `escape` rule, so escapes would blend into strings.\n ...(dark ? [{ tag: [tags.escape, tags.url, tags.link], color: colors.blue[300] }] : []),\n ];\n};\n","import { javascript } from '@codemirror/lang-javascript';\nimport { json, jsonParseLinter } from '@codemirror/lang-json';\nimport { python } from '@codemirror/lang-python';\nimport { MSSQL, MySQL, PLSQL, PostgreSQL, StandardSQL } from '@codemirror/lang-sql';\nimport { StreamLanguage } from '@codemirror/language';\nimport { r } from '@codemirror/legacy-modes/mode/r';\nimport { shell } from '@codemirror/legacy-modes/mode/shell';\nimport { toml } from '@codemirror/legacy-modes/mode/toml';\nimport type { LintSource } from '@codemirror/lint';\nimport { linter } from '@codemirror/lint';\nimport { githubDarkInit, githubLightInit } from '@uiw/codemirror-theme-github';\nimport type { BasicSetupOptions } from '@uiw/react-codemirror';\n\nimport { getSqlLanguageSupport } from '@keboola/codemirror-lang-sql';\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { resolveToken } from '../../utils/themeTokens';\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\n\nimport { dbt } from './modes/dbt';\nimport { jsonnet } from './modes/jsonnet';\nimport { buildDiffWash } from './diffWash';\nimport { buildSyntaxPalette } from './syntaxPalette';\n\n// One list for both the runtime whitelist and the type — a separate `LANGUAGE_MODE[]` copy drifts.\nexport const LANGUAGE_MODES = [\n 'application/json',\n 'text/plain',\n 'text/x-python',\n 'text/x-sql',\n 'text/x-mysql',\n 'text/x-pgsql',\n 'text/x-mssql',\n // Snowflake; the strings are a published prop contract.\n 'text/x-sfsql',\n 'text/x-bqsql',\n 'text/x-plsql',\n 'text/x-rsrc',\n 'text/x-sh',\n 'text/x-toml',\n 'text/jsonnet',\n 'text/x-dbt',\n 'text/javascript',\n 'text/typescript',\n] as const;\n\nexport type LANGUAGE_MODE = (typeof LANGUAGE_MODES)[number];\n\nexport const isLanguageMode = (mode: string): mode is LANGUAGE_MODE =>\n (LANGUAGE_MODES as readonly string[]).includes(mode);\n\n// - `readOnly` is only addressable through `contenteditable`.\n// - `fieldChrome` overrides the read-only wash by re-declaring this key; strings must match exactly.\nexport const READ_ONLY_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"false\"])';\nexport const EDITABLE_EDITOR = '&.cm-editor:has(.cm-content[contenteditable=\"true\"])';\n\n/**\n * Editor chrome and the unified merge (diff) wash.\n *\n * - Chrome resolves from live `--*` tokens; fallbacks mirror light-mode values for SSR.\n * - Diff colours are fixed across brands; light/dark pairs from `buildDiffWash`, shared with\n * `MergeEditor/decorations.ts`.\n * - Only `CodeEditor`'s unified merge view uses this; `MergePane` has its own theme.\n */\nexport const buildBaseThemeStyles = (scheme: ResolvedColorScheme) => {\n const { line, gutter } = buildDiffWash(scheme);\n const dark = scheme === 'dark';\n\n return {\n '*': { lineHeight: '20px' },\n '*::selection': {\n backgroundColor: resolveToken('primary', '31 143 255'),\n color: `${resolveToken('primary-foreground', '255 255 255')} !important`,\n },\n // Dark uses `muted`: `secondary` is lighter there and drops `comment` to 4.27:1.\n // `--code-editor-surface` on an ancestor overrides body and gutters.\n [READ_ONLY_EDITOR]: {\n backgroundColor: `var(--code-editor-surface, ${\n dark ? resolveToken('muted', '38 38 45') : resolveToken('secondary', '226 232 240')\n })`,\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: {\n backgroundColor: `var(--code-editor-surface, ${resolveToken('border', '229 231 235')})`,\n },\n '&.cm-editor .cm-scroller': { overflowAnchor: 'none' },\n '&.cm-editor, &.cm-editor .cm-scroller': {\n minHeight: '100%',\n flexGrow: 1,\n alignItems: 'stretch !important',\n outline: 'none',\n },\n '.cm-gutter.cm-foldGutter': { display: 'none !important' },\n '.cm-gutter.cm-lineNumbers': { paddingLeft: '20px', paddingRight: '6px' },\n '.cm-gutters': { height: 'auto' },\n\n // merge (diff) view\n '&[class*=\"cm-merge-\"] .cm-deletedLine': {\n backgroundColor: line(colors.error[500], colors.error[100]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedLine': {\n backgroundColor: line(colors.green[500], colors.green[100]),\n },\n '&[class*=\"cm-merge-\"] .cm-deletedLineGutter': {\n backgroundColor: gutter(colors.error[500], colors.error[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedLineGutter': {\n backgroundColor: gutter(colors.green[500], colors.green[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-deletedText': {\n background: gutter(colors.error[500], colors.error[200]),\n },\n '&[class*=\"cm-merge-\"] .cm-changedText': {\n background: gutter(colors.green[500], colors.green[200]),\n },\n // Follows the page, not the diff — fixed white would be a light slab under dark.\n '&[class*=\"cm-merge-\"]': {\n backgroundColor: `${resolveToken('background', '249 250 251')} !important`,\n },\n '&[class*=\"cm-merge-\"] .cm-gutters': {\n backgroundColor: `${resolveToken('muted', '241 245 249')} !important`,\n },\n '.cm-changeGutter': { position: 'absolute', zIndex: -1, width: '100%', paddingLeft: 0 },\n '&[class*=\"cm-merge-\"] .cm-changedLine,&[class*=\"cm-merge-\"] .cm-line, &[class*=\"cm-merge-\"] .cm-deletedChunk':\n { paddingLeft: 0 },\n };\n};\n\n// - Fold gutter and active line are hidden by the themes anyway.\n// - `autocompletion`: `CodeEditor` and `SqlEditor` install their own; a second instance competes.\nconst ALWAYS_OFF = {\n autocompletion: false,\n drawSelection: false,\n foldGutter: false,\n foldKeymap: false,\n highlightActiveLine: false,\n highlightActiveLineGutter: false,\n} as const;\n\n// - `basicSetup` enables everything not skipped; a viewer drops editing commands.\n// - Search stays — Mod-f is useful on a viewer.\n// - `history` stays: flipping `readOnly` reconfigures the view, which would drop the undo stack.\nexport const buildBasicSetup = (readOnly: boolean): BasicSetupOptions => ({\n ...ALWAYS_OFF,\n ...(readOnly\n ? {\n closeBrackets: false,\n closeBracketsKeymap: false,\n lintKeymap: false,\n indentOnInput: false,\n rectangularSelection: false,\n dropCursor: false,\n highlightSelectionMatches: false,\n }\n : null),\n});\n\n/**\n * The syntax theme, per colour scheme.\n *\n * - Light github palette fails AA on dark surfaces, so the palette is picked by scheme.\n * - `githubDarkInit` sets the `EditorView.darkTheme` facet that every `&dark` rule keys off.\n * - `caret` and `selectionMatch` are pinned: the initialisers disagree on them.\n */\nexport const buildCustomTheme = (scheme: ResolvedColorScheme) => {\n const foreground = resolveToken('foreground', '30 41 59');\n const init = scheme === 'dark' ? githubDarkInit : githubLightInit;\n\n return init({\n settings: {\n fontFamily: `'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New'`,\n background: resolveToken('background', '249 250 251'),\n foreground,\n caret: foreground,\n gutterBackground: resolveToken('muted', '241 245 249'),\n gutterForeground: resolveToken('muted-foreground', '100 116 139'),\n gutterBorder: 'transparent',\n lineHighlight: 'transparent',\n selection: resolveToken('primary', '31 143 255'),\n selectionMatch: resolveToken('primary', '31 143 255', 0.1),\n },\n styles: buildSyntaxPalette(scheme, foreground),\n });\n};\n\nexport const getLanguageMode = (mode?: LANGUAGE_MODE) => {\n switch (mode) {\n case undefined:\n case 'application/json':\n return json();\n case 'text/x-python':\n return python();\n case 'text/x-sql':\n return getSqlLanguageSupport(StandardSQL);\n case 'text/x-mysql':\n return getSqlLanguageSupport(MySQL);\n case 'text/x-pgsql':\n return getSqlLanguageSupport(PostgreSQL);\n case 'text/x-mssql':\n return getSqlLanguageSupport(MSSQL);\n case 'text/x-sfsql':\n return getSqlLanguageSupport('snowflake');\n case 'text/x-bqsql':\n return getSqlLanguageSupport('bigquery');\n case 'text/x-plsql':\n return getSqlLanguageSupport(PLSQL);\n case 'text/x-rsrc':\n return StreamLanguage.define(r);\n case 'text/x-sh':\n return StreamLanguage.define(shell);\n case 'text/x-toml':\n return StreamLanguage.define(toml);\n case 'text/jsonnet':\n return StreamLanguage.define(jsonnet);\n case 'text/x-dbt':\n return StreamLanguage.define(dbt);\n case 'text/javascript':\n return javascript({ jsx: true });\n case 'text/typescript':\n return javascript({ jsx: true, typescript: true });\n // `text/plain` and any unmapped mode: unstyled, not coloured as JSON.\n default:\n return [];\n }\n};\n\n// A read-only editor can't act on lint errors; its underlines are noise.\nexport const shouldLintJson = (mode: LANGUAGE_MODE | undefined, readOnly: boolean): boolean =>\n mode === 'application/json' && !readOnly;\n\n/**\n * Wraps a lint source so a blank document produces no diagnostics.\n *\n * - For optional fields, where empty is valid but `jsonParseLinter` reports an error.\n */\nexport const skipBlankDocument =\n (source: LintSource): LintSource =>\n (view) =>\n view.state.doc.toString().trim() === '' ? [] : source(view);\n\n/**\n * The JSON linter, optionally blind to a blank document.\n *\n * - Opt-in: some callers rely on the marker alone to explain why empty disables their button.\n * - Not derivable from `variant` — whether blank is valid is the field's contract.\n */\nexport const buildJsonLinter = (allowBlankDocument: boolean) => {\n const source = jsonParseLinter();\n\n return linter(allowBlankDocument ? skipBlankDocument(source) : source);\n};\n","import { resolveToken } from '../../utils/themeTokens';\n\nimport { EDITABLE_EDITOR, READ_ONLY_EDITOR } from './helpers';\n\n/** Per-preset parts of an editor's outer chrome, mapped to selectors by `buildChromeStyles`. */\nexport type EditorChrome = {\n surface: string;\n borderColor: string;\n readOnlySurface: string;\n readOnlyBorderColor: string;\n /** `null`: no hover affordance (form inputs). */\n hoverBorderColor: string | null;\n focusBorderColor: string;\n focusRing: string;\n radius: string;\n paddingY: string;\n /** `null` leaves CodeMirror's own 6px/2px line inset alone. */\n paddingX: { left: string; right: string } | null;\n};\n\n/**\n * Mirrors `InputGroup` at each design language's `TextInput` sizing, so it reads as a form field.\n *\n * - Same colour-scheme tokens as `InputGroup`, so it follows light/dark.\n * - argo: `muted`/`input`, the editable argo field's pair.\n * - legacy: `secondary` as `variant=\"secondary\"`; readonly `muted`/`input` as base `InputGroup`.\n */\nexport const buildInputChrome = (isArgo: boolean): EditorChrome => {\n return {\n surface: isArgo\n ? resolveToken('muted', '241 245 249')\n : resolveToken('secondary', '226 232 240'),\n borderColor: isArgo\n ? resolveToken('input', '203 213 225')\n : resolveToken('secondary', '226 232 240'),\n readOnlySurface: resolveToken('muted', '241 245 249'),\n readOnlyBorderColor: resolveToken('input', '203 213 225'),\n hoverBorderColor: null,\n focusBorderColor: isArgo\n ? resolveToken('primary', '37 99 235')\n : resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', isArgo ? 0.5 : 0.3)}`,\n radius: isArgo ? 'var(--radius-lg, 0.25rem)' : '0.25rem',\n // 2px border + 2×this + `.cm-content`'s 4px + 20px line = a one-line `TextInput`:\n // argo `medium` (36px), legacy `default` (40px).\n paddingY: isArgo ? '3px' : '5px',\n // Tops `.cm-line`'s 6px/2px up to an input's 16px text inset.\n paddingX: { left: '10px', right: '14px' },\n };\n};\n\n/** The SQL workspace's notebook cell: a white canvas, not a form control. */\nexport const buildCanvasChrome = (): EditorChrome => ({\n surface: resolveToken('card', '255 255 255'),\n borderColor: 'transparent',\n readOnlySurface: resolveToken('muted', '241 245 249'),\n readOnlyBorderColor: 'transparent',\n hoverBorderColor: resolveToken('ring', '31 143 255'),\n focusBorderColor: resolveToken('ring', '31 143 255'),\n focusRing: `0 0 0 4px ${resolveToken('ring', '31 143 255', 0.3)}`,\n radius: '8px',\n paddingY: '8px',\n paddingX: null,\n});\n\n/** Spread over `buildBaseThemeStyles()`; read-only keys match the base's to replace its wash. */\nexport const buildChromeStyles = (chrome: EditorChrome) => ({\n '&.cm-editor': {\n border: `solid 1px ${chrome.borderColor}`,\n borderRadius: chrome.radius,\n backgroundColor: chrome.surface,\n paddingTop: chrome.paddingY,\n paddingBottom: chrome.paddingY,\n },\n '&.cm-editor :is(.cm-gutters,.cm-scroller)': { backgroundColor: chrome.surface },\n\n ...(chrome.paddingX\n ? {\n // Gutterless only: text aligns with a neighbouring `TextInput`'s; a gutter owns the edge.\n '&.cm-editor:not(:has(.cm-gutters)) .cm-content': {\n paddingLeft: chrome.paddingX.left,\n paddingRight: chrome.paddingX.right,\n },\n }\n : null),\n\n ...(chrome.hoverBorderColor\n ? { [`${EDITABLE_EDITOR}:hover`]: { borderColor: chrome.hoverBorderColor } }\n : null),\n [`${EDITABLE_EDITOR}:focus-within`]: {\n borderColor: chrome.focusBorderColor,\n boxShadow: chrome.focusRing,\n },\n\n [READ_ONLY_EDITOR]: {\n backgroundColor: chrome.readOnlySurface,\n borderColor: chrome.readOnlyBorderColor,\n },\n [`${READ_ONLY_EDITOR} .cm-gutters`]: { backgroundColor: chrome.readOnlySurface },\n [`${READ_ONLY_EDITOR} .cm-scroller`]: { backgroundColor: chrome.readOnlySurface },\n});\n","import { StateEffect, StateField, type Text } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n ViewPlugin,\n type ViewUpdate,\n} from '@codemirror/view';\n\nimport colors from '@keboola/tailwind-config/colors';\n\nimport { findLiteralMatches } from '../../utils/findLiteralMatches';\n\nimport { DARK_LINE_ALPHA } from './diffWash';\n\ntype SearchMatch = {\n from: number;\n to: number;\n localIndex: number;\n};\n\nconst setSearchEffect = StateEffect.define<{\n query: string;\n selectedMatchIndex?: number;\n}>();\n\ntype SearchState = {\n query: string;\n selectedMatchIndex?: number;\n matches: SearchMatch[];\n decorations: DecorationSet;\n};\n\nfunction findMatches(doc: Text, query: string): SearchMatch[] {\n // Before `doc.toString()`, which joins the whole rope.\n if (!query || query.length > doc.length) return [];\n\n return findLiteralMatches(doc.toString(), query).map((from, index) => ({\n from,\n to: from + query.length,\n localIndex: index,\n }));\n}\n\nfunction createDecorations(matches: SearchMatch[], selectedLocalIndex?: number): DecorationSet {\n const decorations = matches.map((match) => {\n const isSelected = match.localIndex === selectedLocalIndex;\n\n const decoration = Decoration.mark({\n class: isSelected ? 'cm-searchMatch-selected' : 'cm-searchMatch',\n });\n\n return decoration.range(match.from, match.to);\n });\n\n return Decoration.set(decorations, true);\n}\n\nconst searchField = StateField.define<SearchState>({\n create() {\n return {\n query: '',\n selectedMatchIndex: undefined,\n matches: [],\n decorations: Decoration.none,\n };\n },\n\n update(state, tr) {\n let newState = state;\n\n for (const effect of tr.effects) {\n if (!effect.is(setSearchEffect)) {\n continue;\n }\n\n const { query, selectedMatchIndex } = effect.value;\n\n const matches = findMatches(tr.state.doc, query);\n\n const decorations = createDecorations(matches, selectedMatchIndex);\n\n newState = {\n query,\n selectedMatchIndex,\n matches,\n decorations,\n };\n }\n\n if (tr.docChanged && newState.query) {\n const matches = findMatches(tr.state.doc, newState.query);\n const decorations = createDecorations(matches, newState.selectedMatchIndex);\n\n newState = {\n ...newState,\n matches,\n decorations,\n };\n }\n\n return newState;\n },\n\n provide: (field) => EditorView.decorations.from(field, (state) => state.decorations),\n});\n\nconst searchViewPlugin = ViewPlugin.fromClass(\n class {\n private lastSelectedIndex?: number;\n\n update(update: ViewUpdate) {\n const state = update.state.field(searchField);\n\n if (\n state.selectedMatchIndex !== undefined &&\n state.selectedMatchIndex !== this.lastSelectedIndex\n ) {\n const match = state.matches[state.selectedMatchIndex];\n\n if (match) {\n requestAnimationFrame(() => {\n update.view.dispatch({\n effects: EditorView.scrollIntoView(match.from, { y: 'center' }),\n });\n });\n }\n\n this.lastSelectedIndex = state.selectedMatchIndex;\n }\n\n if (state.selectedMatchIndex === undefined) {\n this.lastSelectedIndex = undefined;\n }\n }\n },\n);\n\n/**\n * Match and current-match fills, per colour scheme.\n *\n * - `&dark` keeps this a static base theme; it applies when the `EditorView.darkTheme` facet is set.\n * - Dark current match uses `neutral[900]` text: white on `blue[500]` is 2.55:1.\n */\nconst searchTheme = EditorView.baseTheme({\n '.cm-searchMatch': {\n backgroundColor: colors.blue[100],\n },\n '.cm-searchMatch > span': {\n color: `${colors.blue[700]} !important`,\n },\n '.cm-searchMatch-selected': {\n backgroundColor: colors.blue[700],\n },\n '.cm-searchMatch-selected > span': {\n color: `${colors.white} !important`,\n },\n\n '&dark .cm-searchMatch': {\n backgroundColor: `${colors.blue[500]}${DARK_LINE_ALPHA}`,\n },\n '&dark .cm-searchMatch > span': {\n color: `${colors.blue[200]} !important`,\n },\n '&dark .cm-searchMatch-selected': {\n backgroundColor: colors.blue[500],\n },\n '&dark .cm-searchMatch-selected > span': {\n color: `${colors.neutral[900]} !important`,\n },\n});\n\nexport function searchExtension() {\n return [searchField, searchViewPlugin, searchTheme];\n}\n\nexport function updateSearch(view: EditorView, query: string, selectedMatchIndex?: number) {\n view.dispatch({ effects: setSearchEffect.of({ query, selectedMatchIndex }) });\n}\n","import { isMac } from '../../utils';\nimport { Kbd } from '../Kbd';\n\nexport const ToggleComponentHelp = () => (\n <div>\n Use <Kbd>{isMac ? 'Command+/' : 'Ctrl+/'}</Kbd> to toggle comments.\n </div>\n);\n","import { type Extension } from '@codemirror/state';\n\nimport type { ResolvedColorScheme } from '../ThemeProvider/types';\nimport { useThemeAttributes } from '../ThemeProvider/useThemeAttributes';\n\n// Shared across instances: each theme's StyleModule appends rules to a document-level\n// stylesheet, so one module per theme keeps it constant-size however many editors mount.\nconst themeCache = new Map<string, Extension>();\n\n/**\n * A CodeMirror extension shared per `cacheKey`, rebuilt when the brand or light/dark mode changes.\n *\n * - `build` reads live `--*` values off `<html>`, a dependency no deps array can see.\n * - `scheme` comes from the same read as the key, for values that are a light/dark pair.\n * - `cacheKey` must include everything `build` closes over, or different inputs share a theme.\n */\nexport const useThemedExtension = (\n cacheKey: string,\n build: (scheme: ResolvedColorScheme) => Extension,\n): Extension => {\n const { scheme, cacheKey: themeKey } = useThemeAttributes();\n const key = `${themeKey} ${cacheKey}`;\n\n // Filling the module cache during render is idempotent.\n let cached = themeCache.get(key);\n if (!cached) {\n cached = build(scheme);\n themeCache.set(key, cached);\n }\n\n return cached;\n};\n","import { useMemo } from 'react';\nimport { Compartment, type Extension } from '@codemirror/state';\nimport { tooltips, ViewPlugin } from '@codemirror/view';\n\n// Whether this element becomes the containing block of a `position: fixed` descendant.\n// - Encodes the full CSS rule; `contain` and `will-change` are value lists, matched loosely.\n// - `content-visibility` is left to `crops`, the stronger of the two for our purposes.\nconst establishesFixedContainingBlock = (style: CSSStyleDeclaration) =>\n style.transform !== 'none' ||\n style.translate !== 'none' ||\n style.rotate !== 'none' ||\n style.scale !== 'none' ||\n style.perspective !== 'none' ||\n style.filter !== 'none' ||\n style.backdropFilter !== 'none' ||\n /\\b(paint|layout|strict|content)\\b/.test(style.contain) ||\n /\\b(transform|perspective|filter|contain)\\b/.test(style.willChange);\n\n// Crops even a fixed-position descendant; `content-visibility: auto` implies paint\n// containment without showing it in computed `contain`.\nconst crops = (style: CSSStyleDeclaration) =>\n style.overflowX !== 'visible' ||\n style.overflowY !== 'visible' ||\n style.maskImage !== 'none' ||\n style.contentVisibility !== 'visible' ||\n /\\b(paint|strict|content)\\b/.test(style.contain);\n\n/**\n * Where a tooltip can hang uncropped, or `null` for CodeMirror's default.\n *\n * - Hosts above the outermost cropper.\n * - Stops at the fixed containing block; nothing higher can crop.\n * - `<body>` and `<html>` never count as croppers.\n */\nconst findTooltipHost = (from: HTMLElement) => {\n let outermostCropper: HTMLElement | null = null;\n\n for (let node = from.parentElement; node && node !== document.body; node = node.parentElement) {\n const style = getComputedStyle(node);\n\n if (crops(style)) {\n outermostCropper = node;\n } else if (establishesFixedContainingBlock(style)) {\n return outermostCropper?.parentElement ?? node;\n }\n }\n\n return outermostCropper?.parentElement ?? null;\n};\n\n/**\n * `tooltips()`, re-hosted so the completion popup is never cropped.\n *\n * - Must survive a masked, scrolling `Modal` and kbc-ui's `content-visibility: auto` blocks.\n * - Not `document.body`: the popup would sit behind the modal, which disables pointer events there.\n * - The only tooltip host in either editor: CodeMirror takes the first parent configured.\n */\nconst tooltipsExtension = (): Extension => {\n // A compartment, because a prop-driven full reconfigure drops appended config but keeps compartments.\n const layer = new Compartment();\n\n return [\n layer.of(tooltips()),\n ViewPlugin.define((view) => {\n // Deferred: a plugin cannot dispatch while its view is being built, and reading styles\n // here would force a layout flush mid-commit. One-shot; later ancestor changes are missed.\n const scheduled = setTimeout(() => {\n if (!view.dom.isConnected) return;\n\n const parent = findTooltipHost(view.dom);\n if (parent) view.dispatch({ effects: layer.reconfigure(tooltips({ parent })) });\n });\n\n return { destroy: () => clearTimeout(scheduled) };\n }),\n ];\n};\n\n/**\n * The tooltips extension, built once per editor; a rebuild would drop the resolved host.\n */\nexport const useTooltipsExtension = () => useMemo(tooltipsExtension, []);\n","import type { Completion, CompletionContext, CompletionSource } from '@codemirror/autocomplete';\n\nimport { useStableCallback } from '../../hooks/useStableCallback';\n\nexport type EditorVariable = { name: string; value?: string };\n\n// Ranks variables above the language's many same-prefix keywords.\nconst BOOST = 2000;\n\n// - One brace or two: `closeBrackets` turns a typed `{` into `{}`.\n// - One name charset throughout; a narrower second one would start the range mid-name and never match.\nconst NAME = String.raw`[\\w-]*`;\nconst AT_CARET = new RegExp(String.raw`(?:\\{{1,2} ?)?${NAME}$`);\nconst NAME_AT_END = new RegExp(`${NAME}$`);\nconst OPENING = /\\{{1,2} ?$/;\nconst CLOSING = /^ ?\\}{1,2}/;\n\n/**\n * Completes a mustache-style `{{name}}` placeholder.\n */\nexport const completeVariables = (variables: EditorVariable[] = []): CompletionSource => {\n if (variables.length === 0) return () => null;\n\n const options: Completion[] = variables.map(({ name, value }) => ({\n // Bare name: the only spelling both editors' filters match, braces typed or not.\n label: name,\n displayLabel: `{{${name}}}`,\n detail: value,\n type: 'variable',\n boost: BOOST,\n apply: (view, completion, from, to) => {\n const { doc } = view.state;\n const line = doc.lineAt(from);\n const insert = `{{${completion.label}}}`;\n\n // Braces are found, not assumed: `closeBrackets` may have added a closing one.\n const opening = OPENING.exec(doc.sliceString(line.from, from));\n const closing = CLOSING.exec(doc.sliceString(to, line.to));\n const start = opening ? from - opening[0].length : from;\n const end = closing ? to + closing[0].length : to;\n\n view.dispatch({\n changes: { from: start, to: end, insert },\n selection: { anchor: start + insert.length },\n });\n },\n }));\n\n return (context: CompletionContext) => {\n const match = context.matchBefore(AT_CARET);\n\n if (!match?.text) return null;\n\n const [name = ''] = NAME_AT_END.exec(match.text) ?? [];\n\n return { from: match.to - name.length, options };\n };\n};\n\n/**\n * The completion source both editors install, with a stable identity.\n *\n * - It keys their extension memo, while callers pass a fresh array on every store push.\n * - CodeMirror asks per request, so it still sees the latest variables.\n */\nexport const useVariableCompletion = (variables: EditorVariable[] = []): CompletionSource =>\n useStableCallback(completeVariables(variables));\n","import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport type { CompletionSource } from '@codemirror/autocomplete';\nimport { autocompletion, completeAnyWord } from '@codemirror/autocomplete';\nimport { unifiedMergeView } from '@codemirror/merge';\nimport { EditorView, keymap, placeholder as cmPlaceholder } from '@codemirror/view';\nimport CodeMirror, {\n EditorState,\n type Extension,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\n\nimport { keyCodes } from '../../constants/keyCodes';\nimport { useStableCallback } from '../../hooks/useStableCallback';\nimport { cn } from '../../utils';\nimport { HelpBlock } from '../HelpBlock';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { ButtonToolbar } from './ButtonToolbar';\nimport { buildChromeStyles, buildInputChrome } from './editorChrome';\nimport type { LANGUAGE_MODE } from './helpers';\nimport {\n buildBaseThemeStyles,\n buildBasicSetup,\n buildCustomTheme,\n buildJsonLinter,\n getLanguageMode,\n shouldLintJson,\n} from './helpers';\nimport { searchExtension, updateSearch } from './search';\nimport { ToggleComponentHelp } from './ToggleComponentHelp';\nimport { useThemedExtension } from './tokenTheme';\nimport { useTooltipsExtension } from './tooltips';\nimport { type EditorVariable, useVariableCompletion } from './variableCompletion';\n\ntype Props = {\n value: string;\n previousValue?: string;\n /** `'field'`: `InputGroup` chrome, sized to content (don't pin height). `'plain'`: full-bleed panel. */\n variant?: 'plain' | 'field';\n mode?: LANGUAGE_MODE;\n placeholder?: string;\n /** Screen-reader name: the editor has no visible label of its own. */\n ariaLabel?: string;\n /** Prefer over `ariaLabel` inside a form. */\n ariaLabelledBy?: string;\n ariaDescribedBy?: string;\n /** Visual error styling is the caller's (`variant=\"field\"`). */\n ariaInvalid?: boolean;\n ariaRequired?: boolean;\n /** JSON modes: a blank document is not a parse error. Off by default: the mark explains a disabled Save. */\n allowBlankDocument?: boolean;\n /** Bound on CodeMirror's content node (the wrapper is not what gets focused). */\n onBlur?: () => void;\n /** Highlights matches; the find UI is the caller's. Omit both props to skip the search extension. */\n searchQuery?: string;\n searchMatchIndex?: number;\n readOnly?: boolean;\n /** Refuses edits without changing the look, e.g. during a save; `readOnly` makes a greyed viewer. */\n inputLocked?: boolean;\n /** One word per label (a space breaks matching; phrases go in `completionSource`). Pass a stable array. */\n autocompletions?: string[];\n /** Cursor-dependent completions; wins over `autocompletions` / `completeAny`. Memoize it. */\n completionSource?: CompletionSource;\n /** Completed into `{{name}}`, alongside `completionSource`. */\n variables?: EditorVariable[];\n /** `false` silences every source, the language's own included (e.g. shell mode used only for colours). */\n withCompletions?: boolean;\n extraKeys?: Record<string, () => void>;\n withToggleCommentHint?: boolean;\n withAutofocus?: boolean;\n withLineNumbers?: boolean;\n withLineWrapping?: boolean;\n withCollapseUnchanged?: boolean;\n withCopyButton?: boolean;\n completeAny?: boolean;\n help?: ReactNode;\n helpPostfix?: ReactNode;\n /** Toolbar actions beside the copy button; pass `size=\"icon-xs\"` buttons to fit the 28px chip. */\n renderAdditionalButtons?: (value?: string) => ReactNode;\n className?: string;\n} & (\n | { readOnly: true; onChange?: never }\n // `boolean`, not `false`: a permission-locked field still needs its handler when editable.\n | { readOnly?: boolean; onChange: (value: string) => void }\n);\n\nconst emptyObject = {};\n\nexport const CodeEditor = ({\n value,\n previousValue,\n onChange,\n variant = 'plain',\n mode = 'application/json',\n placeholder = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ariaInvalid,\n ariaRequired,\n allowBlankDocument = false,\n onBlur,\n searchQuery,\n searchMatchIndex,\n readOnly = false,\n inputLocked = false,\n autocompletions,\n completionSource,\n variables,\n withCompletions = true,\n extraKeys = emptyObject,\n withToggleCommentHint = false,\n withAutofocus = false,\n withLineNumbers = true,\n withLineWrapping = true,\n withCollapseUnchanged = false,\n withCopyButton = false,\n completeAny = false,\n help = null,\n helpPostfix = null,\n renderAdditionalButtons,\n className,\n}: Props) => {\n // A new handler identity rebuilds CodeMirror's extension tree; callers pass inline arrows.\n const handleChange = useStableCallback((next: string) => onChange?.(next));\n const handleBlur = useStableCallback(() => onBlur?.());\n\n // Presence, not truthiness, keeps the extension set stable while the query changes.\n const withSearch = searchQuery !== undefined;\n const withBlur = onBlur !== undefined;\n const editorRef = useRef<ReactCodeMirrorRef>(null);\n\n // `null` when empty, so the extension is left out.\n const contentAria = useMemo(() => {\n const attributes: Record<string, string> = {};\n if (ariaLabel !== undefined) attributes['aria-label'] = ariaLabel;\n if (ariaLabelledBy !== undefined) attributes['aria-labelledby'] = ariaLabelledBy;\n if (ariaDescribedBy !== undefined) attributes['aria-describedby'] = ariaDescribedBy;\n // Stringified: `contentAttributes` would drop a boolean `false`.\n if (ariaInvalid !== undefined) attributes['aria-invalid'] = String(ariaInvalid);\n if (ariaRequired !== undefined) attributes['aria-required'] = String(ariaRequired);\n return Object.keys(attributes).length > 0 ? attributes : null;\n }, [ariaLabel, ariaLabelledBy, ariaDescribedBy, ariaInvalid, ariaRequired]);\n\n useEffect(() => {\n const view = editorRef.current?.view;\n if (view && withSearch) updateSearch(view, searchQuery, searchMatchIndex);\n }, [withSearch, searchQuery, searchMatchIndex]);\n\n // A view created with a query already set (remount, tab switch) needs it applied on build.\n const handleCreateEditor = useStableCallback((view: EditorView) => {\n if (searchQuery) updateSearch(view, searchQuery, searchMatchIndex);\n });\n\n // Callers pass this inline; only the key set rebuilds the keymap, handlers are read on press.\n const extraKeysRef = useRef(extraKeys);\n useLayoutEffect(() => {\n extraKeysRef.current = extraKeys;\n });\n\n const boundKeysSignature = Object.keys(extraKeys).join('\\n');\n const boundKeys = useMemo(\n () => boundKeysSignature.split('\\n').filter(Boolean),\n [boundKeysSignature],\n );\n\n const tooltipLayer = useTooltipsExtension();\n\n // Built here, not inside `languageData.of`, which runs per completion request.\n const variableCompletion = useVariableCompletion(variables);\n\n // Key has no component prefix: shared with `SqlEditor`.\n const customTheme = useThemedExtension('editor:syntax', buildCustomTheme);\n\n // The brand is in the cache key: `useThemedExtension` caches per key and tracks only `<html>`.\n const isArgo = useArgoDesign();\n const isField = variant === 'field';\n const baseTheme = useThemedExtension(\n isField ? `code-editor:field:${isArgo ? 'argo' : 'legacy'}` : 'code-editor:chrome',\n (scheme) =>\n // `dark` activates every `&dark` rule (ours and CodeMirror's); set here so swapping the\n // github palette in `buildCustomTheme` cannot turn them off.\n EditorView.theme(\n {\n ...buildBaseThemeStyles(scheme),\n ...(isField ? buildChromeStyles(buildInputChrome(isArgo)) : null),\n },\n { dark: scheme === 'dark' },\n ),\n );\n\n const commonExtensions: Extension[] = useMemo(() => {\n const callerCompletions =\n completionSource ??\n (completeAny ? completeAnyWord : autocompletions?.length ? autocompletions : null);\n\n // An empty list is left out, or CodeMirror runs a never-matching source on every keystroke.\n const completionEntries = [\n ...(callerCompletions ? [{ autocomplete: callerCompletions }] : []),\n { autocomplete: variableCompletion },\n ];\n\n return [\n getLanguageMode(mode),\n shouldLintJson(mode, readOnly) ? buildJsonLinter(allowBlankDocument) : [],\n withLineWrapping ? EditorView.lineWrapping : [],\n EditorState.languageData.of(() => completionEntries),\n keymap.of(\n boundKeys.map((key) => ({\n key,\n run: () => {\n extraKeysRef.current[key]?.();\n return true;\n },\n })),\n ),\n readOnly || !withCompletions\n ? []\n : [\n // The only `autocompletion()` (`buildBasicSetup` disables basicSetup's). Not gated on\n // the completion props, so the language's own vocabulary still completes.\n autocompletion(),\n ],\n // On the focused content node (`div[role=\"textbox\"]`), not the wrapper.\n contentAria ? EditorView.contentAttributes.of(contentAria) : [],\n withBlur ? EditorView.domEventHandlers({ blur: handleBlur }) : [],\n withSearch ? searchExtension() : [],\n tooltipLayer,\n baseTheme,\n ];\n }, [\n autocompletions,\n completionSource,\n variableCompletion,\n completeAny,\n withCompletions,\n boundKeys,\n mode,\n readOnly,\n allowBlankDocument,\n withLineWrapping,\n baseTheme,\n contentAria,\n withBlur,\n handleBlur,\n withSearch,\n tooltipLayer,\n ]);\n\n const extensions = useMemo(() => {\n return [\n ...commonExtensions,\n cmPlaceholder(placeholder),\n EditorView.editable.of(!readOnly),\n // The lock is only this facet: `contenteditable` drives the read-only wash and `basicSetup`\n // holds the undo history, so neither is reconfigured.\n EditorState.readOnly.of(readOnly || inputLocked),\n previousValue\n ? unifiedMergeView({\n original: previousValue,\n mergeControls: false,\n highlightChanges: false,\n collapseUnchanged: withCollapseUnchanged ? {} : undefined,\n })\n : [],\n ];\n }, [commonExtensions, placeholder, readOnly, inputLocked, previousValue, withCollapseUnchanged]);\n\n const config = useMemo(() => {\n return {\n ...buildBasicSetup(readOnly),\n lineNumbers: withLineNumbers,\n // Mod-f would open CodeMirror's own search panel beside the caller's.\n ...(withSearch ? { searchKeymap: false } : null),\n };\n }, [withLineNumbers, readOnly, withSearch]);\n\n return (\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-variant={variant}\n className={cn(\n // Scoped to CodeMirror's box so the toolbar needn't undo it with `!important`.\n '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',\n // Field: transparent so square corners don't show; visible so the focus ring isn't cropped.\n isField\n ? 'tw:[&_>.cm-theme]:overflow-visible tw:[&_>.cm-theme]:bg-transparent'\n : 'tw:[&_>.cm-theme]:overflow-auto tw:[&_>.cm-theme]:bg-background',\n className,\n )}\n onKeyDown={(event: KeyboardEvent) => {\n if (event.key === keyCodes.ESCAPE) {\n event.stopPropagation();\n }\n }}\n >\n <ButtonToolbar value={withCopyButton ? value : undefined}>\n {renderAdditionalButtons?.(value)}\n </ButtonToolbar>\n <CodeMirror\n ref={editorRef}\n onCreateEditor={handleCreateEditor}\n theme={customTheme}\n value={value}\n onChange={handleChange}\n extensions={extensions}\n autoFocus={withAutofocus}\n basicSetup={config}\n />\n {!readOnly && (withToggleCommentHint || help || helpPostfix) && (\n <HelpBlock className=\"tw:mt-2 tw:flex tw:flex-wrap tw:gap-1\">\n {help}\n {withToggleCommentHint ? <ToggleComponentHelp /> : null}\n {helpPostfix}\n </HelpBlock>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,iBAAiB,EAAE,OAAO,eAAyD;CAC9F,IAAI,CAAC,SAAS,CAAC,UAAU,OAAO;CAEhC,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,CAAC,CAAC,SAAS,oBAAC,iBAAD;GAAiB,MAAK;GAAU,SAAQ;GAAY,MAAM;EAAQ,CAAA,GAC7E,QACE;;AAET;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BAAC,qBAAD,CAAsB,CAAA,IAAI;KAClD;IACQ;;EAEV;;AAET"}
@@ -1,4 +1,4 @@
1
- import { cn } from "./classNames-BzrkDnOD.js";
1
+ import { cn } from "./classNames-DcGnTh2N.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { CollapsibleTrigger, Content, Root } from "@radix-ui/react-collapsible";
4
4
  //#region src/components/Collapsible/CollapsibleContent.tsx
@@ -31,4 +31,4 @@ Collapsible.Content = CollapsibleContent;
31
31
  //#endregion
32
32
  export { Collapsible };
33
33
 
34
- //# sourceMappingURL=Collapsible-BQXWEOBC.js.map
34
+ //# sourceMappingURL=Collapsible-DD4xTL75.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible-BQXWEOBC.js","names":["CollapsibleTrigger","Trigger","CollapsibleTrigger"],"sources":["../src/components/Collapsible/CollapsibleContent.tsx","../src/components/Collapsible/CollapsibleTrigger.tsx","../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Content } from '@radix-ui/react-collapsible';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Content>;\n\nexport const CollapsibleContent = ({ ref, className, children, ...props }: Props) => (\n <Content\n ref={ref}\n // Duration and easing are baked into the tokens in `theme.css`.\n className={cn(\n 'tw:data-[state=closed]:animate-collapsible-close',\n 'tw:data-[state=open]:animate-collapsible-open',\n className,\n )}\n {...props}\n >\n {children}\n </Content>\n);\n","import type { ComponentProps } from 'react';\nimport { CollapsibleTrigger as Trigger } from '@radix-ui/react-collapsible';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Trigger>;\n\n/**\n * A `Collapsible` toggle.\n *\n * - Carries `tailwindcss-preflight`: the trigger renders a bare `<button>` and the package's\n * reset is opt-in, so without it a host app without a global reset gets UA button chrome.\n * - Under `asChild` the class lands on a design component that already declares it — harmless.\n */\nexport const CollapsibleTrigger = ({ ref, className, children, ...props }: Props) => (\n <Trigger ref={ref} className={cn('tailwindcss-preflight', className)} {...props}>\n {children}\n </Trigger>\n);\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-collapsible';\n\nimport { CollapsibleContent } from './CollapsibleContent';\nimport { CollapsibleTrigger } from './CollapsibleTrigger';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Collapsible = (props: Props) => <Root {...props} />;\n\nCollapsible.Trigger = CollapsibleTrigger;\nCollapsible.Content = CollapsibleContent;\n"],"mappings":";;;;AAOA,MAAa,sBAAsB,EAAE,KAAK,WAAW,UAAU,GAAG,YAChE,oBAAC,SAAD;CACO;CAEL,WAAW,GACT,oDACA,iDACA,SACF;CACA,GAAI;CAEH;AACM,CAAA;;;;;;;;;;ACLX,MAAaA,wBAAsB,EAAE,KAAK,WAAW,UAAU,GAAG,YAChE,oBAACC,oBAAD;CAAc;CAAK,WAAW,GAAG,yBAAyB,SAAS;CAAG,GAAI;CACvE;AACM,CAAA;;;ACTX,MAAa,eAAe,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAE/D,YAAY,UAAUC;AACtB,YAAY,UAAU"}
1
+ {"version":3,"file":"Collapsible-DD4xTL75.js","names":["CollapsibleTrigger","Trigger","CollapsibleTrigger"],"sources":["../src/components/Collapsible/CollapsibleContent.tsx","../src/components/Collapsible/CollapsibleTrigger.tsx","../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Content } from '@radix-ui/react-collapsible';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Content>;\n\nexport const CollapsibleContent = ({ ref, className, children, ...props }: Props) => (\n <Content\n ref={ref}\n // Duration and easing are baked into the tokens in `theme.css`.\n className={cn(\n 'tw:data-[state=closed]:animate-collapsible-close',\n 'tw:data-[state=open]:animate-collapsible-open',\n className,\n )}\n {...props}\n >\n {children}\n </Content>\n);\n","import type { ComponentProps } from 'react';\nimport { CollapsibleTrigger as Trigger } from '@radix-ui/react-collapsible';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Trigger>;\n\n/**\n * A `Collapsible` toggle.\n *\n * - Carries `tailwindcss-preflight`: the trigger renders a bare `<button>` and the package's\n * reset is opt-in, so without it a host app without a global reset gets UA button chrome.\n * - Under `asChild` the class lands on a design component that already declares it — harmless.\n */\nexport const CollapsibleTrigger = ({ ref, className, children, ...props }: Props) => (\n <Trigger ref={ref} className={cn('tailwindcss-preflight', className)} {...props}>\n {children}\n </Trigger>\n);\n","import type { ComponentProps } from 'react';\nimport { Root } from '@radix-ui/react-collapsible';\n\nimport { CollapsibleContent } from './CollapsibleContent';\nimport { CollapsibleTrigger } from './CollapsibleTrigger';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Collapsible = (props: Props) => <Root {...props} />;\n\nCollapsible.Trigger = CollapsibleTrigger;\nCollapsible.Content = CollapsibleContent;\n"],"mappings":";;;;AAOA,MAAa,sBAAsB,EAAE,KAAK,WAAW,UAAU,GAAG,YAChE,oBAAC,SAAD;CACO;CAEL,WAAW,GACT,oDACA,iDACA,SACF;CACA,GAAI;CAEH;AACM,CAAA;;;;;;;;;;ACLX,MAAaA,wBAAsB,EAAE,KAAK,WAAW,UAAU,GAAG,YAChE,oBAACC,oBAAD;CAAc;CAAK,WAAW,GAAG,yBAAyB,SAAS;CAAG,GAAI;CACvE;AACM,CAAA;;;ACTX,MAAa,eAAe,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAE/D,YAAY,UAAUC;AACtB,YAAY,UAAU"}