@intlayer/design-system 9.4.2 → 9.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (718) hide show
  1. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  2. package/dist/esm/components/IDE/CodeBlockHighlight.mjs +1 -1
  3. package/dist/esm/components/IDE/CodeBlockHighlight.mjs.map +1 -1
  4. package/dist/esm/components/IDE/CodeBlockServer.mjs +1 -1
  5. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  6. package/dist/esm/components/IDE/CodeBlockShiki.mjs +6 -48
  7. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  8. package/dist/esm/components/IDE/MarkDownRender.mjs +1 -1
  9. package/dist/esm/components/IDE/shikiBundle.mjs +61 -0
  10. package/dist/esm/components/IDE/shikiBundle.mjs.map +1 -0
  11. package/dist/esm/components/IDE/shikiLanguages.mjs +2 -39
  12. package/dist/esm/components/IDE/shikiLanguages.mjs.map +1 -1
  13. package/dist/esm/components/IDE/shikiThemes.mjs.map +1 -1
  14. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  15. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs +7 -2
  16. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs.map +1 -1
  17. package/dist/esm/components/MarkdownEditor/extensions.mjs +1 -1
  18. package/dist/esm/components/MarkdownEditor/extensions.mjs.map +1 -1
  19. package/dist/esm/components/MarkdownEditor/novel/extensions/code-block-shiki.mjs +197 -0
  20. package/dist/esm/components/MarkdownEditor/novel/extensions/code-block-shiki.mjs.map +1 -0
  21. package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs +2 -1
  22. package/dist/esm/components/MarkdownEditor/novel/extensions/index.mjs.map +1 -1
  23. package/dist/esm/components/MarkdownEditor/novel/index.mjs +2 -1
  24. package/dist/esm/components/Modal/Modal.mjs +2 -2
  25. package/dist/esm/components/Navbar/MobileNavbar.mjs +15 -4
  26. package/dist/esm/components/Navbar/MobileNavbar.mjs.map +1 -1
  27. package/dist/esm/components/Navbar/index.mjs +22 -15
  28. package/dist/esm/components/Navbar/index.mjs.map +1 -1
  29. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  30. package/dist/esm/components/Pattern/GridDistortionPattern.mjs +1 -1
  31. package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
  32. package/dist/esm/components/Status/index.mjs +1 -1
  33. package/dist/esm/components/Tab/Tab.mjs +1 -1
  34. package/dist/esm/components/TechLogo/logos/HTMX.mjs +2 -2
  35. package/dist/esm/components/TechLogo/logos/HTMX.mjs.map +1 -1
  36. package/dist/esm/hooks/index.mjs +7 -7
  37. package/dist/esm/hooks/useDevice.mjs +105 -37
  38. package/dist/esm/hooks/useDevice.mjs.map +1 -1
  39. package/dist/esm/routes.mjs +22 -6
  40. package/dist/esm/routes.mjs.map +1 -1
  41. package/dist/types/api/hooks/ai.d.ts +10 -11
  42. package/dist/types/api/hooks/ai.d.ts.map +1 -1
  43. package/dist/types/api/hooks/analytics.d.ts +3 -4
  44. package/dist/types/api/hooks/analytics.d.ts.map +1 -1
  45. package/dist/types/api/hooks/asset.d.ts +5 -6
  46. package/dist/types/api/hooks/asset.d.ts.map +1 -1
  47. package/dist/types/api/hooks/audit.d.ts +3 -4
  48. package/dist/types/api/hooks/audit.d.ts.map +1 -1
  49. package/dist/types/api/hooks/auth.d.ts +25 -26
  50. package/dist/types/api/hooks/auth.d.ts.map +1 -1
  51. package/dist/types/api/hooks/bitbucket.d.ts +4 -5
  52. package/dist/types/api/hooks/bitbucket.d.ts.map +1 -1
  53. package/dist/types/api/hooks/dictionary.d.ts +8 -9
  54. package/dist/types/api/hooks/dictionary.d.ts.map +1 -1
  55. package/dist/types/api/hooks/discussions.d.ts +2 -3
  56. package/dist/types/api/hooks/discussions.d.ts.map +1 -1
  57. package/dist/types/api/hooks/editor.d.ts +2 -3
  58. package/dist/types/api/hooks/editor.d.ts.map +1 -1
  59. package/dist/types/api/hooks/environment.d.ts +6 -7
  60. package/dist/types/api/hooks/environment.d.ts.map +1 -1
  61. package/dist/types/api/hooks/github.d.ts +6 -7
  62. package/dist/types/api/hooks/github.d.ts.map +1 -1
  63. package/dist/types/api/hooks/gitlab.d.ts +4 -5
  64. package/dist/types/api/hooks/gitlab.d.ts.map +1 -1
  65. package/dist/types/api/hooks/newsletter.d.ts +3 -4
  66. package/dist/types/api/hooks/newsletter.d.ts.map +1 -1
  67. package/dist/types/api/hooks/organization.d.ts +11 -12
  68. package/dist/types/api/hooks/organization.d.ts.map +1 -1
  69. package/dist/types/api/hooks/project.d.ts +18 -19
  70. package/dist/types/api/hooks/project.d.ts.map +1 -1
  71. package/dist/types/api/hooks/reviewer.d.ts +21 -22
  72. package/dist/types/api/hooks/reviewer.d.ts.map +1 -1
  73. package/dist/types/api/hooks/search.d.ts +1 -2
  74. package/dist/types/api/hooks/search.d.ts.map +1 -1
  75. package/dist/types/api/hooks/showcaseProject.d.ts +8 -9
  76. package/dist/types/api/hooks/showcaseProject.d.ts.map +1 -1
  77. package/dist/types/api/hooks/stripe.d.ts +24 -25
  78. package/dist/types/api/hooks/stripe.d.ts.map +1 -1
  79. package/dist/types/api/hooks/tag.d.ts +4 -5
  80. package/dist/types/api/hooks/tag.d.ts.map +1 -1
  81. package/dist/types/api/hooks/translate.d.ts +4 -5
  82. package/dist/types/api/hooks/translate.d.ts.map +1 -1
  83. package/dist/types/api/hooks/user.d.ts +6 -7
  84. package/dist/types/api/hooks/user.d.ts.map +1 -1
  85. package/dist/types/api/hooks/utils.d.ts +2 -3
  86. package/dist/types/api/hooks/utils.d.ts.map +1 -1
  87. package/dist/types/api/useAuth/useAuth.d.ts +1 -2
  88. package/dist/types/api/useAuth/useAuth.d.ts.map +1 -1
  89. package/dist/types/api/useAuth/useOAuth2.d.ts +2 -3
  90. package/dist/types/api/useAuth/useOAuth2.d.ts.map +1 -1
  91. package/dist/types/api/useAuth/useSession.d.ts +2 -3
  92. package/dist/types/api/useAuth/useSession.d.ts.map +1 -1
  93. package/dist/types/api/useIntlayerAPI.d.ts +25 -26
  94. package/dist/types/api/useIntlayerAPI.d.ts.map +1 -1
  95. package/dist/types/api/useUser/index.d.ts +1 -2
  96. package/dist/types/api/useUser/index.d.ts.map +1 -1
  97. package/dist/types/components/Accordion/Accordion.d.ts +2 -3
  98. package/dist/types/components/Accordion/Accordion.d.ts.map +1 -1
  99. package/dist/types/components/Avatar/image.d.ts +2 -3
  100. package/dist/types/components/Avatar/image.d.ts.map +1 -1
  101. package/dist/types/components/Avatar/index.d.ts +3 -4
  102. package/dist/types/components/Avatar/index.d.ts.map +1 -1
  103. package/dist/types/components/Badge/index.d.ts +7 -8
  104. package/dist/types/components/Badge/index.d.ts.map +1 -1
  105. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +2 -2
  106. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
  107. package/dist/types/components/Breadcrumb/index.d.ts +3 -4
  108. package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
  109. package/dist/types/components/Browser/Browser.content.d.ts +2 -2
  110. package/dist/types/components/Browser/Browser.content.d.ts.map +1 -1
  111. package/dist/types/components/Browser/Browser.d.ts +2 -3
  112. package/dist/types/components/Browser/Browser.d.ts.map +1 -1
  113. package/dist/types/components/Browser/extractUrlFromSitemap.d.ts +1 -2
  114. package/dist/types/components/Browser/extractUrlFromSitemap.d.ts.map +1 -1
  115. package/dist/types/components/Button/Button.d.ts +7 -8
  116. package/dist/types/components/Button/Button.d.ts.map +1 -1
  117. package/dist/types/components/Carousel/index.d.ts +1 -2
  118. package/dist/types/components/Carousel/index.d.ts.map +1 -1
  119. package/dist/types/components/ClickOutsideDiv/index.d.ts +2 -3
  120. package/dist/types/components/ClickOutsideDiv/index.d.ts.map +1 -1
  121. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +2 -3
  122. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts.map +1 -1
  123. package/dist/types/components/Command/index.d.ts +2 -3
  124. package/dist/types/components/Command/index.d.ts.map +1 -1
  125. package/dist/types/components/Container/index.d.ts +10 -11
  126. package/dist/types/components/Container/index.d.ts.map +1 -1
  127. package/dist/types/components/ContentEditor/ContentEditor.d.ts +2 -3
  128. package/dist/types/components/ContentEditor/ContentEditor.d.ts.map +1 -1
  129. package/dist/types/components/ContentEditor/ContentEditorInput.d.ts +2 -3
  130. package/dist/types/components/ContentEditor/ContentEditorInput.d.ts.map +1 -1
  131. package/dist/types/components/ContentEditor/ContentEditorTextArea.d.ts +2 -3
  132. package/dist/types/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  133. package/dist/types/components/ContentSelector/ContentSelector.d.ts +1 -2
  134. package/dist/types/components/ContentSelector/ContentSelector.d.ts.map +1 -1
  135. package/dist/types/components/CopyButton/CopyButton.content.d.ts +2 -2
  136. package/dist/types/components/CopyButton/CopyButton.content.d.ts.map +1 -1
  137. package/dist/types/components/CopyButton/index.d.ts +1 -2
  138. package/dist/types/components/CopyButton/index.d.ts.map +1 -1
  139. package/dist/types/components/CopyToClipboard/index.d.ts +3 -4
  140. package/dist/types/components/CopyToClipboard/index.d.ts.map +1 -1
  141. package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts +1 -2
  142. package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
  143. package/dist/types/components/DictionaryEditor/ItemLayout.d.ts +1 -2
  144. package/dist/types/components/DictionaryEditor/ItemLayout.d.ts.map +1 -1
  145. package/dist/types/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts +1 -2
  146. package/dist/types/components/DictionaryEditor/NodeWrapper/ArrayWrapper.d.ts.map +1 -1
  147. package/dist/types/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts +2 -3
  148. package/dist/types/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts.map +1 -1
  149. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts +1 -2
  150. package/dist/types/components/DictionaryEditor/NodeWrapper/ConditionWrapper.d.ts.map +1 -1
  151. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts +1 -2
  152. package/dist/types/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.d.ts.map +1 -1
  153. package/dist/types/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts +1 -2
  154. package/dist/types/components/DictionaryEditor/NodeWrapper/FileWrapper.d.ts.map +1 -1
  155. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts +1 -2
  156. package/dist/types/components/DictionaryEditor/NodeWrapper/HtmlWrapper.d.ts.map +1 -1
  157. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts +1 -2
  158. package/dist/types/components/DictionaryEditor/NodeWrapper/InsertionWrapper.d.ts.map +1 -1
  159. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts +1 -2
  160. package/dist/types/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.d.ts.map +1 -1
  161. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts +1 -2
  162. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
  163. package/dist/types/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts +2 -3
  164. package/dist/types/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts.map +1 -1
  165. package/dist/types/components/DictionaryEditor/NodeWrapper/PluralWrapper.d.ts +1 -2
  166. package/dist/types/components/DictionaryEditor/NodeWrapper/PluralWrapper.d.ts.map +1 -1
  167. package/dist/types/components/DictionaryEditor/NodeWrapper/SelectWrapper.d.ts +1 -2
  168. package/dist/types/components/DictionaryEditor/NodeWrapper/SelectWrapper.d.ts.map +1 -1
  169. package/dist/types/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts +2 -3
  170. package/dist/types/components/DictionaryEditor/NodeWrapper/StringWrapper.d.ts.map +1 -1
  171. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts +1 -2
  172. package/dist/types/components/DictionaryEditor/NodeWrapper/TranslationWrapper.d.ts.map +1 -1
  173. package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts +3 -4
  174. package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
  175. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts +1 -2
  176. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/SafeHtmlRenderer.d.ts.map +1 -1
  177. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts +4 -5
  178. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  179. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/object.d.ts +2 -3
  180. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/object.d.ts.map +1 -1
  181. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts +1 -2
  182. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
  183. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +2 -2
  184. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
  185. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +2 -2
  186. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
  187. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts +4 -5
  188. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.d.ts.map +1 -1
  189. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts +1 -2
  190. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
  191. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +2 -2
  192. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
  193. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +2 -3
  194. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts.map +1 -1
  195. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -2
  196. package/dist/types/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  197. package/dist/types/components/DictionaryFieldEditor/EnumKeyInput.d.ts +1 -2
  198. package/dist/types/components/DictionaryFieldEditor/EnumKeyInput.d.ts.map +1 -1
  199. package/dist/types/components/DictionaryFieldEditor/JSONEditor.d.ts +1 -2
  200. package/dist/types/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
  201. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts +1 -2
  202. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
  203. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts +3 -4
  204. package/dist/types/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.d.ts.map +1 -1
  205. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +2 -2
  206. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
  207. package/dist/types/components/DictionaryFieldEditor/NodeEditor.d.ts +2 -3
  208. package/dist/types/components/DictionaryFieldEditor/NodeEditor.d.ts.map +1 -1
  209. package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts +1 -2
  210. package/dist/types/components/DictionaryFieldEditor/NodeTypeSelector.d.ts.map +1 -1
  211. package/dist/types/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +1 -2
  212. package/dist/types/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  213. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +2 -2
  214. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
  215. package/dist/types/components/DictionaryFieldEditor/StructureEditor.d.ts +1 -2
  216. package/dist/types/components/DictionaryFieldEditor/StructureEditor.d.ts.map +1 -1
  217. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts +3 -4
  218. package/dist/types/components/DictionaryFieldEditor/StructureView/StructureView.d.ts.map +1 -1
  219. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +2 -2
  220. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
  221. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts +2 -3
  222. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.d.ts.map +1 -1
  223. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +2 -3
  224. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
  225. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +2 -2
  226. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
  227. package/dist/types/components/DictionaryFieldEditor/getIsEditableSection.d.ts +1 -2
  228. package/dist/types/components/DictionaryFieldEditor/getIsEditableSection.d.ts.map +1 -1
  229. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +2 -2
  230. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  231. package/dist/types/components/DropDown/index.d.ts +7 -8
  232. package/dist/types/components/DropDown/index.d.ts.map +1 -1
  233. package/dist/types/components/EditableField/EditableFieldInput.d.ts +1 -2
  234. package/dist/types/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  235. package/dist/types/components/EditableField/EditableFieldLayout.d.ts +1 -2
  236. package/dist/types/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  237. package/dist/types/components/EditableField/EditableFieldTextArea.d.ts +1 -2
  238. package/dist/types/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  239. package/dist/types/components/ExpandCollapse/ExpandCollapse.d.ts +2 -3
  240. package/dist/types/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  241. package/dist/types/components/Flags/Flag.d.ts +1 -2
  242. package/dist/types/components/Flags/Flag.d.ts.map +1 -1
  243. package/dist/types/components/Flags/flags.d.ts +305 -305
  244. package/dist/types/components/Flags/flags.d.ts.map +1 -1
  245. package/dist/types/components/Footer/index.d.ts +3 -4
  246. package/dist/types/components/Footer/index.d.ts.map +1 -1
  247. package/dist/types/components/Form/Form.d.ts +1 -2
  248. package/dist/types/components/Form/Form.d.ts.map +1 -1
  249. package/dist/types/components/Form/FormBase.d.ts +2 -3
  250. package/dist/types/components/Form/FormBase.d.ts.map +1 -1
  251. package/dist/types/components/Form/FormControl.d.ts +1 -2
  252. package/dist/types/components/Form/FormControl.d.ts.map +1 -1
  253. package/dist/types/components/Form/FormDescription.d.ts +1 -2
  254. package/dist/types/components/Form/FormDescription.d.ts.map +1 -1
  255. package/dist/types/components/Form/FormField.d.ts +2 -3
  256. package/dist/types/components/Form/FormField.d.ts.map +1 -1
  257. package/dist/types/components/Form/FormItem.d.ts +2 -3
  258. package/dist/types/components/Form/FormItem.d.ts.map +1 -1
  259. package/dist/types/components/Form/FormLabel.d.ts +1 -2
  260. package/dist/types/components/Form/FormLabel.d.ts.map +1 -1
  261. package/dist/types/components/Form/FormMessage.d.ts +1 -2
  262. package/dist/types/components/Form/FormMessage.d.ts.map +1 -1
  263. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts +1 -2
  264. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts.map +1 -1
  265. package/dist/types/components/Form/elements/CheckboxElement.d.ts +1 -2
  266. package/dist/types/components/Form/elements/CheckboxElement.d.ts.map +1 -1
  267. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +1 -2
  268. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  269. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts +1 -2
  270. package/dist/types/components/Form/elements/EditableFieldTextAreaElement.d.ts.map +1 -1
  271. package/dist/types/components/Form/elements/FormElement.d.ts +2 -3
  272. package/dist/types/components/Form/elements/FormElement.d.ts.map +1 -1
  273. package/dist/types/components/Form/elements/FormElementWrapper.d.ts +1 -2
  274. package/dist/types/components/Form/elements/FormElementWrapper.d.ts.map +1 -1
  275. package/dist/types/components/Form/elements/InputElement.d.ts +1 -2
  276. package/dist/types/components/Form/elements/InputElement.d.ts.map +1 -1
  277. package/dist/types/components/Form/elements/InputPasswordElement.d.ts +1 -2
  278. package/dist/types/components/Form/elements/InputPasswordElement.d.ts.map +1 -1
  279. package/dist/types/components/Form/elements/MultiselectElement.d.ts +1 -2
  280. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  281. package/dist/types/components/Form/elements/OTPElement.d.ts +1 -2
  282. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -1
  283. package/dist/types/components/Form/elements/SearchInputElement.d.ts +1 -2
  284. package/dist/types/components/Form/elements/SearchInputElement.d.ts.map +1 -1
  285. package/dist/types/components/Form/elements/SelectElement.d.ts +1 -2
  286. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  287. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +1 -2
  288. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  289. package/dist/types/components/Form/elements/TextAreaElement.d.ts +1 -2
  290. package/dist/types/components/Form/elements/TextAreaElement.d.ts.map +1 -1
  291. package/dist/types/components/Form/layout/FormItemLayout.d.ts +2 -3
  292. package/dist/types/components/Form/layout/FormItemLayout.d.ts.map +1 -1
  293. package/dist/types/components/Form/layout/FormLabelLayout.d.ts +2 -3
  294. package/dist/types/components/Form/layout/FormLabelLayout.d.ts.map +1 -1
  295. package/dist/types/components/Form/layout/RequiredStar.d.ts +1 -2
  296. package/dist/types/components/Form/layout/RequiredStar.d.ts.map +1 -1
  297. package/dist/types/components/HTMLRender/HTMLRender.d.ts +2 -3
  298. package/dist/types/components/HTMLRender/HTMLRender.d.ts.map +1 -1
  299. package/dist/types/components/Headers/index.d.ts +7 -8
  300. package/dist/types/components/Headers/index.d.ts.map +1 -1
  301. package/dist/types/components/HeightResizer/index.d.ts +1 -2
  302. package/dist/types/components/HeightResizer/index.d.ts.map +1 -1
  303. package/dist/types/components/HideShow/index.d.ts +2 -3
  304. package/dist/types/components/HideShow/index.d.ts.map +1 -1
  305. package/dist/types/components/IDE/Code.d.ts +2 -3
  306. package/dist/types/components/IDE/Code.d.ts.map +1 -1
  307. package/dist/types/components/IDE/CodeBlockClient.d.ts +6 -6
  308. package/dist/types/components/IDE/CodeBlockClient.d.ts.map +1 -1
  309. package/dist/types/components/IDE/CodeBlockHighlight.d.ts +1 -2
  310. package/dist/types/components/IDE/CodeBlockHighlight.d.ts.map +1 -1
  311. package/dist/types/components/IDE/CodeBlockServer.d.ts +4 -5
  312. package/dist/types/components/IDE/CodeBlockServer.d.ts.map +1 -1
  313. package/dist/types/components/IDE/CodeBlockShiki.d.ts +2 -3
  314. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  315. package/dist/types/components/IDE/CodeConditionalRenderer.d.ts +1 -2
  316. package/dist/types/components/IDE/CodeConditionalRenderer.d.ts.map +1 -1
  317. package/dist/types/components/IDE/CodeContext.d.ts +6 -7
  318. package/dist/types/components/IDE/CodeContext.d.ts.map +1 -1
  319. package/dist/types/components/IDE/CodeFormatSelector.d.ts +1 -2
  320. package/dist/types/components/IDE/CodeFormatSelector.d.ts.map +1 -1
  321. package/dist/types/components/IDE/ContentDeclarationFormatSelector.d.ts +1 -2
  322. package/dist/types/components/IDE/ContentDeclarationFormatSelector.d.ts.map +1 -1
  323. package/dist/types/components/IDE/CopyCode.d.ts +1 -2
  324. package/dist/types/components/IDE/CopyCode.d.ts.map +1 -1
  325. package/dist/types/components/IDE/FileList.d.ts +2 -3
  326. package/dist/types/components/IDE/FileList.d.ts.map +1 -1
  327. package/dist/types/components/IDE/FileTree.d.ts +1 -2
  328. package/dist/types/components/IDE/FileTree.d.ts.map +1 -1
  329. package/dist/types/components/IDE/IDE.d.ts +2 -3
  330. package/dist/types/components/IDE/IDE.d.ts.map +1 -1
  331. package/dist/types/components/IDE/MarkDownRender.d.ts +1 -2
  332. package/dist/types/components/IDE/MarkDownRender.d.ts.map +1 -1
  333. package/dist/types/components/IDE/MonacoCode.d.ts +1 -2
  334. package/dist/types/components/IDE/MonacoCode.d.ts.map +1 -1
  335. package/dist/types/components/IDE/PackageManagerSelector.d.ts +1 -2
  336. package/dist/types/components/IDE/PackageManagerSelector.d.ts.map +1 -1
  337. package/dist/types/components/IDE/codeTransformer.d.ts +4 -5
  338. package/dist/types/components/IDE/codeTransformer.d.ts.map +1 -1
  339. package/dist/types/components/IDE/createFileTree.d.ts +2 -3
  340. package/dist/types/components/IDE/createFileTree.d.ts.map +1 -1
  341. package/dist/types/components/IDE/shikiBundle.d.ts +73 -0
  342. package/dist/types/components/IDE/shikiBundle.d.ts.map +1 -0
  343. package/dist/types/components/IDE/shikiLanguages.d.ts +12 -50
  344. package/dist/types/components/IDE/shikiLanguages.d.ts.map +1 -1
  345. package/dist/types/components/IDE/shikiThemes.d.ts +4 -3
  346. package/dist/types/components/IDE/shikiThemes.d.ts.map +1 -1
  347. package/dist/types/components/InformationTag/index.d.ts +1 -2
  348. package/dist/types/components/InformationTag/index.d.ts.map +1 -1
  349. package/dist/types/components/Input/Checkbox.d.ts +5 -6
  350. package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
  351. package/dist/types/components/Input/Input.d.ts +5 -6
  352. package/dist/types/components/Input/Input.d.ts.map +1 -1
  353. package/dist/types/components/Input/InputPassword.d.ts +1 -2
  354. package/dist/types/components/Input/InputPassword.d.ts.map +1 -1
  355. package/dist/types/components/Input/OTPInput.d.ts +13 -14
  356. package/dist/types/components/Input/OTPInput.d.ts.map +1 -1
  357. package/dist/types/components/Input/Radio.d.ts +5 -6
  358. package/dist/types/components/Input/Radio.d.ts.map +1 -1
  359. package/dist/types/components/Input/SearchInput.d.ts +1 -2
  360. package/dist/types/components/Input/SearchInput.d.ts.map +1 -1
  361. package/dist/types/components/KeyboardScreenAdapter/index.d.ts +1 -2
  362. package/dist/types/components/KeyboardScreenAdapter/index.d.ts.map +1 -1
  363. package/dist/types/components/KeyboardShortcut/KeyboardShortcut.d.ts +4 -5
  364. package/dist/types/components/KeyboardShortcut/KeyboardShortcut.d.ts.map +1 -1
  365. package/dist/types/components/Label/index.d.ts +2 -3
  366. package/dist/types/components/Label/index.d.ts.map +1 -1
  367. package/dist/types/components/LanguageBackground/LanguageBackground.d.ts +1 -2
  368. package/dist/types/components/LanguageBackground/LanguageBackground.d.ts.map +1 -1
  369. package/dist/types/components/LanguageBackground/LanguageSection.d.ts +2 -3
  370. package/dist/types/components/LanguageBackground/LanguageSection.d.ts.map +1 -1
  371. package/dist/types/components/Link/Link.d.ts +10 -11
  372. package/dist/types/components/Link/Link.d.ts.map +1 -1
  373. package/dist/types/components/Loader/index.content.d.ts +2 -2
  374. package/dist/types/components/Loader/index.content.d.ts.map +1 -1
  375. package/dist/types/components/Loader/index.d.ts +2 -3
  376. package/dist/types/components/Loader/index.d.ts.map +1 -1
  377. package/dist/types/components/Loader/spinner.d.ts +1 -2
  378. package/dist/types/components/Loader/spinner.d.ts.map +1 -1
  379. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts +2 -3
  380. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.d.ts.map +1 -1
  381. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts +2 -3
  382. package/dist/types/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.d.ts.map +1 -1
  383. package/dist/types/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts +2 -3
  384. package/dist/types/components/LocaleSwitcherDropDown/LocaleSwitcher.d.ts.map +1 -1
  385. package/dist/types/components/Logo/Logo.d.ts +2 -3
  386. package/dist/types/components/Logo/Logo.d.ts.map +1 -1
  387. package/dist/types/components/Logo/LogoTextOnly.d.ts +1 -2
  388. package/dist/types/components/Logo/LogoTextOnly.d.ts.map +1 -1
  389. package/dist/types/components/Logo/LogoWithText.d.ts +1 -2
  390. package/dist/types/components/Logo/LogoWithText.d.ts.map +1 -1
  391. package/dist/types/components/Logo/LogoWithTextBelow.d.ts +2 -3
  392. package/dist/types/components/Logo/LogoWithTextBelow.d.ts.map +1 -1
  393. package/dist/types/components/MarkDownRender/MarkDownIframe.d.ts +1 -2
  394. package/dist/types/components/MarkDownRender/MarkDownIframe.d.ts.map +1 -1
  395. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +4 -4
  396. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  397. package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts +2 -3
  398. package/dist/types/components/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  399. package/dist/types/components/MarkdownEditor/extensions.d.ts +1 -2
  400. package/dist/types/components/MarkdownEditor/extensions.d.ts.map +1 -1
  401. package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts +2 -3
  402. package/dist/types/components/MarkdownEditor/generative/AICompletionCommands.d.ts.map +1 -1
  403. package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts +2 -3
  404. package/dist/types/components/MarkdownEditor/generative/AISelector.d.ts.map +1 -1
  405. package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts +2 -3
  406. package/dist/types/components/MarkdownEditor/generative/AISelectorCommands.d.ts.map +1 -1
  407. package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts +2 -3
  408. package/dist/types/components/MarkdownEditor/generative/GenerativeMenuSwitch.d.ts.map +1 -1
  409. package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts +3 -4
  410. package/dist/types/components/MarkdownEditor/generative/useAICompletion.d.ts.map +1 -1
  411. package/dist/types/components/MarkdownEditor/imageUpload.d.ts +3 -4
  412. package/dist/types/components/MarkdownEditor/imageUpload.d.ts.map +1 -1
  413. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts +2 -2
  414. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble-item.d.ts.map +1 -1
  415. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts +3 -3
  416. package/dist/types/components/MarkdownEditor/novel/components/editor-bubble.d.ts.map +1 -1
  417. package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts +3 -3
  418. package/dist/types/components/MarkdownEditor/novel/components/editor-command-item.d.ts.map +1 -1
  419. package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts +4 -5
  420. package/dist/types/components/MarkdownEditor/novel/components/editor-command.d.ts.map +1 -1
  421. package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts +4 -5
  422. package/dist/types/components/MarkdownEditor/novel/components/editor.d.ts.map +1 -1
  423. package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts +6 -7
  424. package/dist/types/components/MarkdownEditor/novel/extensions/ai-highlight.d.ts.map +1 -1
  425. package/dist/types/components/MarkdownEditor/novel/extensions/code-block-shiki.d.ts +14 -0
  426. package/dist/types/components/MarkdownEditor/novel/extensions/code-block-shiki.d.ts.map +1 -0
  427. package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts +1 -2
  428. package/dist/types/components/MarkdownEditor/novel/extensions/image-resizer.d.ts.map +1 -1
  429. package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts +2 -1
  430. package/dist/types/components/MarkdownEditor/novel/extensions/index.d.ts.map +1 -1
  431. package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts +4 -4
  432. package/dist/types/components/MarkdownEditor/novel/extensions/slash-command.d.ts.map +1 -1
  433. package/dist/types/components/MarkdownEditor/novel/index.d.ts +2 -1
  434. package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts +6 -7
  435. package/dist/types/components/MarkdownEditor/novel/plugins/upload-images.d.ts.map +1 -1
  436. package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts +4 -5
  437. package/dist/types/components/MarkdownEditor/novel/utils/atoms.d.ts.map +1 -1
  438. package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts +4 -5
  439. package/dist/types/components/MarkdownEditor/novel/utils/index.d.ts.map +1 -1
  440. package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts +2 -3
  441. package/dist/types/components/MarkdownEditor/selectors/ColorSelector.d.ts.map +1 -1
  442. package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts +1 -2
  443. package/dist/types/components/MarkdownEditor/selectors/LinkSelector.d.ts.map +1 -1
  444. package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts +2 -3
  445. package/dist/types/components/MarkdownEditor/selectors/NodeSelector.d.ts.map +1 -1
  446. package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts +1 -2
  447. package/dist/types/components/MarkdownEditor/selectors/TextButtons.d.ts.map +1 -1
  448. package/dist/types/components/MarkdownEditor/slashCommand.d.ts +2 -3
  449. package/dist/types/components/MarkdownEditor/slashCommand.d.ts.map +1 -1
  450. package/dist/types/components/MaxHeightSmoother/index.d.ts +1 -2
  451. package/dist/types/components/MaxHeightSmoother/index.d.ts.map +1 -1
  452. package/dist/types/components/MaxWidthSmoother/index.d.ts +1 -2
  453. package/dist/types/components/MaxWidthSmoother/index.d.ts.map +1 -1
  454. package/dist/types/components/Modal/Modal.d.ts +2 -3
  455. package/dist/types/components/Modal/Modal.d.ts.map +1 -1
  456. package/dist/types/components/Navbar/Burger.d.ts +1 -2
  457. package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
  458. package/dist/types/components/Navbar/DesktopNavbar.d.ts +1 -2
  459. package/dist/types/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  460. package/dist/types/components/Navbar/MobileNavbar.d.ts +8 -2
  461. package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
  462. package/dist/types/components/Navbar/index.d.ts +2 -2
  463. package/dist/types/components/Navbar/index.d.ts.map +1 -1
  464. package/dist/types/components/Navbar/useNavigation.d.ts +1 -2
  465. package/dist/types/components/Navbar/useNavigation.d.ts.map +1 -1
  466. package/dist/types/components/Pagination/NumberItemsSelector.d.ts +2 -3
  467. package/dist/types/components/Pagination/NumberItemsSelector.d.ts.map +1 -1
  468. package/dist/types/components/Pagination/Pagination.d.ts +5 -6
  469. package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
  470. package/dist/types/components/Pagination/ShowingResultsNumberItems.d.ts +2 -3
  471. package/dist/types/components/Pagination/ShowingResultsNumberItems.d.ts.map +1 -1
  472. package/dist/types/components/Pattern/DotPattern.d.ts +1 -2
  473. package/dist/types/components/Pattern/DotPattern.d.ts.map +1 -1
  474. package/dist/types/components/Pattern/GridDistortionPattern.d.ts +1 -2
  475. package/dist/types/components/Pattern/GridDistortionPattern.d.ts.map +1 -1
  476. package/dist/types/components/Pattern/GridPattern.d.ts +1 -2
  477. package/dist/types/components/Pattern/GridPattern.d.ts.map +1 -1
  478. package/dist/types/components/Pattern/SpotLight.d.ts +1 -2
  479. package/dist/types/components/Pattern/SpotLight.d.ts.map +1 -1
  480. package/dist/types/components/Popover/dynamic.d.ts +1 -2
  481. package/dist/types/components/Popover/dynamic.d.ts.map +1 -1
  482. package/dist/types/components/Popover/static.d.ts +8 -8
  483. package/dist/types/components/Popover/static.d.ts.map +1 -1
  484. package/dist/types/components/PressableSpan/PressableSpan.d.ts +1 -2
  485. package/dist/types/components/PressableSpan/PressableSpan.d.ts.map +1 -1
  486. package/dist/types/components/RightDrawer/RightDrawer.d.ts +1 -2
  487. package/dist/types/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  488. package/dist/types/components/RightDrawer/isElementAtTopAndNotCovered.d.ts +1 -2
  489. package/dist/types/components/RightDrawer/isElementAtTopAndNotCovered.d.ts.map +1 -1
  490. package/dist/types/components/RightDrawer/useRightDrawer.d.ts +4 -5
  491. package/dist/types/components/RightDrawer/useRightDrawer.d.ts.map +1 -1
  492. package/dist/types/components/Select/Multiselect.d.ts +1 -2
  493. package/dist/types/components/Select/Multiselect.d.ts.map +1 -1
  494. package/dist/types/components/Select/Select.d.ts +5 -6
  495. package/dist/types/components/Select/Select.d.ts.map +1 -1
  496. package/dist/types/components/SocialNetworks/DiscordLogo.d.ts +1 -2
  497. package/dist/types/components/SocialNetworks/DiscordLogo.d.ts.map +1 -1
  498. package/dist/types/components/SocialNetworks/FacebookLogo.d.ts +1 -2
  499. package/dist/types/components/SocialNetworks/FacebookLogo.d.ts.map +1 -1
  500. package/dist/types/components/SocialNetworks/InstagramLogo.d.ts +1 -2
  501. package/dist/types/components/SocialNetworks/InstagramLogo.d.ts.map +1 -1
  502. package/dist/types/components/SocialNetworks/ProductHuntLogo.d.ts +1 -2
  503. package/dist/types/components/SocialNetworks/ProductHuntLogo.d.ts.map +1 -1
  504. package/dist/types/components/SocialNetworks/TiktokLogo.d.ts +1 -2
  505. package/dist/types/components/SocialNetworks/TiktokLogo.d.ts.map +1 -1
  506. package/dist/types/components/SocialNetworks/XLogo.d.ts +1 -2
  507. package/dist/types/components/SocialNetworks/XLogo.d.ts.map +1 -1
  508. package/dist/types/components/SocialNetworks/YoutubeLogo.d.ts +1 -2
  509. package/dist/types/components/SocialNetworks/YoutubeLogo.d.ts.map +1 -1
  510. package/dist/types/components/SocialNetworks/index.d.ts +2 -2
  511. package/dist/types/components/SocialNetworks/index.d.ts.map +1 -1
  512. package/dist/types/components/Status/index.d.ts +1 -2
  513. package/dist/types/components/Status/index.d.ts.map +1 -1
  514. package/dist/types/components/Steps/index.d.ts +2 -3
  515. package/dist/types/components/Steps/index.d.ts.map +1 -1
  516. package/dist/types/components/Steps/steps.content.d.ts +2 -2
  517. package/dist/types/components/Steps/steps.content.d.ts.map +1 -1
  518. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts +11 -12
  519. package/dist/types/components/SwitchSelector/SwitchSelector.d.ts.map +1 -1
  520. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts +2 -3
  521. package/dist/types/components/SwitchSelector/VerticalSwitchSelector.d.ts.map +1 -1
  522. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts +1 -2
  523. package/dist/types/components/SwitchSelector/useSwitchSelector.d.ts.map +1 -1
  524. package/dist/types/components/Tab/Tab.d.ts +3 -4
  525. package/dist/types/components/Tab/Tab.d.ts.map +1 -1
  526. package/dist/types/components/Tab/TabContext.d.ts +3 -4
  527. package/dist/types/components/Tab/TabContext.d.ts.map +1 -1
  528. package/dist/types/components/TabSelector/TabSelector.d.ts +4 -5
  529. package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
  530. package/dist/types/components/Table/ExpandButton.d.ts +1 -2
  531. package/dist/types/components/Table/ExpandButton.d.ts.map +1 -1
  532. package/dist/types/components/Table/SmartTable.d.ts +1 -2
  533. package/dist/types/components/Table/SmartTable.d.ts.map +1 -1
  534. package/dist/types/components/Table/Table.d.ts +2 -3
  535. package/dist/types/components/Table/Table.d.ts.map +1 -1
  536. package/dist/types/components/Table/TableElements.d.ts +4 -5
  537. package/dist/types/components/Table/TableElements.d.ts.map +1 -1
  538. package/dist/types/components/Table/useTableWidths.d.ts +1 -2
  539. package/dist/types/components/Table/useTableWidths.d.ts.map +1 -1
  540. package/dist/types/components/Tag/index.d.ts +6 -7
  541. package/dist/types/components/Tag/index.d.ts.map +1 -1
  542. package/dist/types/components/TechLogo/TechLogo.d.ts +2 -3
  543. package/dist/types/components/TechLogo/TechLogo.d.ts.map +1 -1
  544. package/dist/types/components/TechLogo/logos/Adonis.d.ts +1 -2
  545. package/dist/types/components/TechLogo/logos/Adonis.d.ts.map +1 -1
  546. package/dist/types/components/TechLogo/logos/Angular.d.ts +1 -2
  547. package/dist/types/components/TechLogo/logos/Angular.d.ts.map +1 -1
  548. package/dist/types/components/TechLogo/logos/Anthropic.d.ts +1 -2
  549. package/dist/types/components/TechLogo/logos/Anthropic.d.ts.map +1 -1
  550. package/dist/types/components/TechLogo/logos/Astro.d.ts +1 -2
  551. package/dist/types/components/TechLogo/logos/Astro.d.ts.map +1 -1
  552. package/dist/types/components/TechLogo/logos/Atlassian.d.ts +1 -2
  553. package/dist/types/components/TechLogo/logos/Atlassian.d.ts.map +1 -1
  554. package/dist/types/components/TechLogo/logos/Bitbucket.d.ts +1 -2
  555. package/dist/types/components/TechLogo/logos/Bitbucket.d.ts.map +1 -1
  556. package/dist/types/components/TechLogo/logos/ChatGPT.d.ts +1 -2
  557. package/dist/types/components/TechLogo/logos/ChatGPT.d.ts.map +1 -1
  558. package/dist/types/components/TechLogo/logos/Claude.d.ts +1 -2
  559. package/dist/types/components/TechLogo/logos/Claude.d.ts.map +1 -1
  560. package/dist/types/components/TechLogo/logos/DeepSeek.d.ts +1 -2
  561. package/dist/types/components/TechLogo/logos/DeepSeek.d.ts.map +1 -1
  562. package/dist/types/components/TechLogo/logos/Elysia.d.ts +1 -2
  563. package/dist/types/components/TechLogo/logos/Elysia.d.ts.map +1 -1
  564. package/dist/types/components/TechLogo/logos/Express.d.ts +1 -2
  565. package/dist/types/components/TechLogo/logos/Express.d.ts.map +1 -1
  566. package/dist/types/components/TechLogo/logos/Fastify.d.ts +1 -2
  567. package/dist/types/components/TechLogo/logos/Fastify.d.ts.map +1 -1
  568. package/dist/types/components/TechLogo/logos/Gemini.d.ts +1 -2
  569. package/dist/types/components/TechLogo/logos/Gemini.d.ts.map +1 -1
  570. package/dist/types/components/TechLogo/logos/GitHub.d.ts +1 -2
  571. package/dist/types/components/TechLogo/logos/GitHub.d.ts.map +1 -1
  572. package/dist/types/components/TechLogo/logos/GitLab.d.ts +1 -2
  573. package/dist/types/components/TechLogo/logos/GitLab.d.ts.map +1 -1
  574. package/dist/types/components/TechLogo/logos/Google.d.ts +1 -2
  575. package/dist/types/components/TechLogo/logos/Google.d.ts.map +1 -1
  576. package/dist/types/components/TechLogo/logos/GoogleAI.d.ts +1 -2
  577. package/dist/types/components/TechLogo/logos/GoogleAI.d.ts.map +1 -1
  578. package/dist/types/components/TechLogo/logos/Grok.d.ts +1 -2
  579. package/dist/types/components/TechLogo/logos/Grok.d.ts.map +1 -1
  580. package/dist/types/components/TechLogo/logos/HTMX.d.ts +1 -2
  581. package/dist/types/components/TechLogo/logos/HTMX.d.ts.map +1 -1
  582. package/dist/types/components/TechLogo/logos/Hono.d.ts +1 -2
  583. package/dist/types/components/TechLogo/logos/Hono.d.ts.map +1 -1
  584. package/dist/types/components/TechLogo/logos/LinkedIn.d.ts +1 -2
  585. package/dist/types/components/TechLogo/logos/LinkedIn.d.ts.map +1 -1
  586. package/dist/types/components/TechLogo/logos/Lit.d.ts +1 -2
  587. package/dist/types/components/TechLogo/logos/Lit.d.ts.map +1 -1
  588. package/dist/types/components/TechLogo/logos/Lynx.d.ts +1 -2
  589. package/dist/types/components/TechLogo/logos/Lynx.d.ts.map +1 -1
  590. package/dist/types/components/TechLogo/logos/Microsoft.d.ts +1 -2
  591. package/dist/types/components/TechLogo/logos/Microsoft.d.ts.map +1 -1
  592. package/dist/types/components/TechLogo/logos/Mistral.d.ts +1 -2
  593. package/dist/types/components/TechLogo/logos/Mistral.d.ts.map +1 -1
  594. package/dist/types/components/TechLogo/logos/NestJS.d.ts +1 -2
  595. package/dist/types/components/TechLogo/logos/NestJS.d.ts.map +1 -1
  596. package/dist/types/components/TechLogo/logos/Nextjs.d.ts +1 -2
  597. package/dist/types/components/TechLogo/logos/Nextjs.d.ts.map +1 -1
  598. package/dist/types/components/TechLogo/logos/Node.d.ts +1 -2
  599. package/dist/types/components/TechLogo/logos/Node.d.ts.map +1 -1
  600. package/dist/types/components/TechLogo/logos/Nuxt.d.ts +1 -2
  601. package/dist/types/components/TechLogo/logos/Nuxt.d.ts.map +1 -1
  602. package/dist/types/components/TechLogo/logos/Ollama.d.ts +1 -2
  603. package/dist/types/components/TechLogo/logos/Ollama.d.ts.map +1 -1
  604. package/dist/types/components/TechLogo/logos/OpenAI.d.ts +1 -2
  605. package/dist/types/components/TechLogo/logos/OpenAI.d.ts.map +1 -1
  606. package/dist/types/components/TechLogo/logos/Perplexity.d.ts +1 -2
  607. package/dist/types/components/TechLogo/logos/Perplexity.d.ts.map +1 -1
  608. package/dist/types/components/TechLogo/logos/Preact.d.ts +1 -2
  609. package/dist/types/components/TechLogo/logos/Preact.d.ts.map +1 -1
  610. package/dist/types/components/TechLogo/logos/Reactjs.d.ts +1 -2
  611. package/dist/types/components/TechLogo/logos/Reactjs.d.ts.map +1 -1
  612. package/dist/types/components/TechLogo/logos/Remix.d.ts +1 -2
  613. package/dist/types/components/TechLogo/logos/Remix.d.ts.map +1 -1
  614. package/dist/types/components/TechLogo/logos/Solid.d.ts +1 -2
  615. package/dist/types/components/TechLogo/logos/Solid.d.ts.map +1 -1
  616. package/dist/types/components/TechLogo/logos/Svelte.d.ts +1 -2
  617. package/dist/types/components/TechLogo/logos/Svelte.d.ts.map +1 -1
  618. package/dist/types/components/TechLogo/logos/Tanstack.d.ts +1 -2
  619. package/dist/types/components/TechLogo/logos/Tanstack.d.ts.map +1 -1
  620. package/dist/types/components/TechLogo/logos/Vanilla.d.ts +1 -2
  621. package/dist/types/components/TechLogo/logos/Vanilla.d.ts.map +1 -1
  622. package/dist/types/components/TechLogo/logos/Vitejs.d.ts +1 -2
  623. package/dist/types/components/TechLogo/logos/Vitejs.d.ts.map +1 -1
  624. package/dist/types/components/TechLogo/logos/Vuejs.d.ts +1 -2
  625. package/dist/types/components/TechLogo/logos/Vuejs.d.ts.map +1 -1
  626. package/dist/types/components/TechLogo/types.d.ts +1 -2
  627. package/dist/types/components/TechLogo/types.d.ts.map +1 -1
  628. package/dist/types/components/Terminal/Terminal.d.ts +2 -3
  629. package/dist/types/components/Terminal/Terminal.d.ts.map +1 -1
  630. package/dist/types/components/TextArea/AutoSizeTextArea.d.ts +2 -3
  631. package/dist/types/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  632. package/dist/types/components/TextArea/AutocompleteTextArea.d.ts +2 -3
  633. package/dist/types/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  634. package/dist/types/components/TextArea/ContentEditableTextArea.d.ts +4 -5
  635. package/dist/types/components/TextArea/ContentEditableTextArea.d.ts.map +1 -1
  636. package/dist/types/components/TextArea/TextArea.d.ts +2 -3
  637. package/dist/types/components/TextArea/TextArea.d.ts.map +1 -1
  638. package/dist/types/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.d.ts +1 -2
  639. package/dist/types/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.d.ts.map +1 -1
  640. package/dist/types/components/ThemeSwitcherDropDown/MobileThemeSwitcher.d.ts +1 -2
  641. package/dist/types/components/ThemeSwitcherDropDown/MobileThemeSwitcher.d.ts.map +1 -1
  642. package/dist/types/components/ThemeSwitcherDropDown/types.d.ts +1 -2
  643. package/dist/types/components/ThemeSwitcherDropDown/types.d.ts.map +1 -1
  644. package/dist/types/components/Toaster/Toast.d.ts +10 -11
  645. package/dist/types/components/Toaster/Toast.d.ts.map +1 -1
  646. package/dist/types/components/Toaster/Toaster.d.ts +1 -2
  647. package/dist/types/components/Toaster/Toaster.d.ts.map +1 -1
  648. package/dist/types/components/Toaster/useToast.d.ts +2 -2
  649. package/dist/types/components/Toaster/useToast.d.ts.map +1 -1
  650. package/dist/types/components/WithResizer/index.d.ts +1 -2
  651. package/dist/types/components/WithResizer/index.d.ts.map +1 -1
  652. package/dist/types/hooks/index.d.ts +2 -2
  653. package/dist/types/hooks/useDevice.d.ts +27 -17
  654. package/dist/types/hooks/useDevice.d.ts.map +1 -1
  655. package/dist/types/hooks/useGetElementById.d.ts +1 -2
  656. package/dist/types/hooks/useGetElementById.d.ts.map +1 -1
  657. package/dist/types/hooks/useGetElementOrWindow.d.ts +1 -2
  658. package/dist/types/hooks/useGetElementOrWindow.d.ts.map +1 -1
  659. package/dist/types/hooks/useHorizontalSwipe.d.ts +3 -4
  660. package/dist/types/hooks/useHorizontalSwipe.d.ts.map +1 -1
  661. package/dist/types/hooks/useIsMounted.d.ts +1 -2
  662. package/dist/types/hooks/useIsMounted.d.ts.map +1 -1
  663. package/dist/types/hooks/useItemSelector.d.ts +2 -3
  664. package/dist/types/hooks/useItemSelector.d.ts.map +1 -1
  665. package/dist/types/hooks/useKeyboardDetector.d.ts +1 -2
  666. package/dist/types/hooks/useKeyboardDetector.d.ts.map +1 -1
  667. package/dist/types/hooks/usePersistedStore.d.ts +1 -2
  668. package/dist/types/hooks/usePersistedStore.d.ts.map +1 -1
  669. package/dist/types/hooks/useScreenWidth.d.ts +1 -2
  670. package/dist/types/hooks/useScreenWidth.d.ts.map +1 -1
  671. package/dist/types/hooks/useScrollBlockage/index.d.ts +1 -2
  672. package/dist/types/hooks/useScrollBlockage/index.d.ts.map +1 -1
  673. package/dist/types/hooks/useScrollBlockage/useScrollBlockageStore.d.ts +2 -3
  674. package/dist/types/hooks/useScrollBlockage/useScrollBlockageStore.d.ts.map +1 -1
  675. package/dist/types/hooks/useScrollDetection.d.ts +1 -2
  676. package/dist/types/hooks/useScrollDetection.d.ts.map +1 -1
  677. package/dist/types/hooks/useScrollY.d.ts +1 -2
  678. package/dist/types/hooks/useScrollY.d.ts.map +1 -1
  679. package/dist/types/hooks/useSearch.d.ts +1 -2
  680. package/dist/types/hooks/useSearch.d.ts.map +1 -1
  681. package/dist/types/hooks/useStickToBottom.d.ts +2 -3
  682. package/dist/types/hooks/useStickToBottom.d.ts.map +1 -1
  683. package/dist/types/libs/auth.d.ts +2 -3
  684. package/dist/types/libs/auth.d.ts.map +1 -1
  685. package/dist/types/providers/DeferredAuthProvider.d.ts +2 -3
  686. package/dist/types/providers/DeferredAuthProvider.d.ts.map +1 -1
  687. package/dist/types/providers/ReactQueryProvider.d.ts +2 -3
  688. package/dist/types/providers/ReactQueryProvider.d.ts.map +1 -1
  689. package/dist/types/providers/ThemeProvider.d.ts +5 -6
  690. package/dist/types/providers/ThemeProvider.d.ts.map +1 -1
  691. package/dist/types/routes.d.ts +319 -304
  692. package/dist/types/routes.d.ts.map +1 -1
  693. package/dist/types/structured-data/buildAuthorJsonLd.d.ts +2 -3
  694. package/dist/types/structured-data/buildAuthorJsonLd.d.ts.map +1 -1
  695. package/dist/types/structured-data/buildBreadcrumbsJsonLd.d.ts +3 -4
  696. package/dist/types/structured-data/buildBreadcrumbsJsonLd.d.ts.map +1 -1
  697. package/dist/types/structured-data/buildCreativeWorkJsonLd.d.ts +4 -5
  698. package/dist/types/structured-data/buildCreativeWorkJsonLd.d.ts.map +1 -1
  699. package/dist/types/structured-data/buildFAQPageJsonLd.d.ts +3 -4
  700. package/dist/types/structured-data/buildFAQPageJsonLd.d.ts.map +1 -1
  701. package/dist/types/structured-data/buildItemListJsonLd.d.ts +3 -4
  702. package/dist/types/structured-data/buildItemListJsonLd.d.ts.map +1 -1
  703. package/dist/types/structured-data/buildOrganizationJsonLd.d.ts +2 -3
  704. package/dist/types/structured-data/buildOrganizationJsonLd.d.ts.map +1 -1
  705. package/dist/types/structured-data/buildProductJsonLd.d.ts +3 -4
  706. package/dist/types/structured-data/buildProductJsonLd.d.ts.map +1 -1
  707. package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts +2 -3
  708. package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts.map +1 -1
  709. package/dist/types/structured-data/buildWebsiteJsonLd.d.ts +2 -3
  710. package/dist/types/structured-data/buildWebsiteJsonLd.d.ts.map +1 -1
  711. package/dist/types/structured-data/normalizeJsonLdUrl.d.ts +2 -3
  712. package/dist/types/structured-data/normalizeJsonLdUrl.d.ts.map +1 -1
  713. package/dist/types/utils/observeScrollExtent.d.ts +1 -2
  714. package/dist/types/utils/observeScrollExtent.d.ts.map +1 -1
  715. package/dist/types/utils/scheduleFrameTask.d.ts +1 -2
  716. package/dist/types/utils/scheduleFrameTask.d.ts.map +1 -1
  717. package/package.json +45 -36
  718. package/src/components/MarkdownEditor/markdown-editor.css +1 -1
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
4
3
  import { InputIndicator, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../../Input/OTPInput.mjs";
4
+ import { useItemSelector } from "../../../hooks/useItemSelector.mjs";
5
5
  import { FormField, useFormField } from "../FormField.mjs";
6
6
  import { FormItemLayout } from "../layout/FormItemLayout.mjs";
7
7
  import { useEffect, useRef } from "react";
@@ -35,7 +35,7 @@ const CodeBlockHighlight = ({ children, originalLang, targetFormat, initialHtml
35
35
  code = transformCode(String(children), targetFormat);
36
36
  shikiLang = resolveCodeLanguage(deriveLanguage(originalLang, targetFormat)).id;
37
37
  }
38
- const { codeToHtml } = await import("shiki/bundle/web");
38
+ const { codeToHtml } = await import("./shikiBundle.mjs");
39
39
  if (cancelled) return;
40
40
  const out = await codeToHtml(String(code), {
41
41
  lang: shikiLang,
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockHighlight.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockHighlight.tsx"],"sourcesContent":["'use client';\n\n/**\n * Client-side Shiki highlighter that also handles TypeScript→ESM/CJS transformation.\n *\n * Everything runs inside a single useEffect so that:\n * - Nothing is imported at all while the canonical TypeScript source is shown\n * and its markup was already highlighted ahead of time.\n * - The transformer is only dynamically imported when a non-TypeScript format is selected.\n * - The previous highlighted HTML stays visible while the new one loads (no white-text flash).\n */\n\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\nimport type { CodeFormat } from './CodeContext';\nimport { type CodeLanguage, resolveCodeLanguage } from './shikiLanguages';\nimport { SHIKI_THEMES } from './shikiThemes';\n\ntype Props = {\n /** Raw TypeScript source code (the canonical \"source of truth\"). */\n children: ReactNode;\n /** Language of the source (e.g. 'tsx', 'typescript'). */\n originalLang: CodeLanguage;\n /** Currently selected format: 'typescript' | 'esm' | 'commonjs'. */\n targetFormat: Exclude<CodeFormat, 'json'>;\n /** Markup for the TypeScript source, highlighted ahead of time. */\n initialHtml?: string;\n};\n\nexport const CodeBlockHighlight = ({\n children,\n originalLang,\n targetFormat,\n initialHtml,\n}: Props) => {\n const [html, setHtml] = useState<string | null>(initialHtml ?? null);\n const prevHtml = useRef<string | null>(initialHtml ?? null);\n\n useEffect(() => {\n // The pre-highlighted markup already is the TypeScript rendering — no need\n // to pull Shiki into the browser until another format is picked.\n if (initialHtml && targetFormat === 'typescript') {\n prevHtml.current = initialHtml;\n setHtml(initialHtml);\n return;\n }\n\n let cancelled = false;\n\n (async () => {\n try {\n let code = children;\n let shikiLang = resolveCodeLanguage(originalLang).id;\n\n // Only import the transformer when we actually need it.\n if (targetFormat !== 'typescript') {\n const { transformCode, deriveLanguage } = await import(\n './codeTransformer'\n );\n if (cancelled) return;\n code = transformCode(String(children), targetFormat);\n shikiLang = resolveCodeLanguage(\n deriveLanguage(originalLang, targetFormat)\n ).id;\n }\n\n const { codeToHtml } = await import('shiki/bundle/web');\n if (cancelled) return;\n\n const out = await codeToHtml(String(code), {\n lang: shikiLang,\n themes: SHIKI_THEMES,\n defaultColor: false,\n });\n\n if (!cancelled) {\n prevHtml.current = out;\n setHtml(out);\n }\n } catch {\n // Shiki failed (unknown language, etc.) — fall through to plain-text.\n if (!cancelled) setHtml('');\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [children, originalLang, targetFormat, initialHtml]);\n\n // Keep the previous highlighted output visible while the new one is loading.\n // This prevents the white-text flash on format switches.\n const display = html ?? prevHtml.current;\n\n if (!display) {\n return (\n <pre className=\"min-w-0 max-w-full overflow-x-auto\">\n <code>{children}</code>\n </pre>\n );\n }\n\n return (\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n dangerouslySetInnerHTML={{ __html: display }}\n style={{ backgroundColor: 'transparent' }}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAa,sBAAsB,EACjC,UACA,cACA,cACA,kBACW;CACX,MAAM,CAAC,MAAM,WAAW,SAAwB,eAAe,IAAI;CACnE,MAAM,WAAW,OAAsB,eAAe,IAAI;CAE1D,gBAAgB;EAGd,IAAI,eAAe,iBAAiB,cAAc;GAChD,SAAS,UAAU;GACnB,QAAQ,WAAW;GACnB;EACF;EAEA,IAAI,YAAY;EAEhB,CAAC,YAAY;GACX,IAAI;IACF,IAAI,OAAO;IACX,IAAI,YAAY,oBAAoB,YAAY,CAAC,CAAC;IAGlD,IAAI,iBAAiB,cAAc;KACjC,MAAM,EAAE,eAAe,mBAAmB,MAAM,OAC9C;KAEF,IAAI,WAAW;KACf,OAAO,cAAc,OAAO,QAAQ,GAAG,YAAY;KACnD,YAAY,oBACV,eAAe,cAAc,YAAY,CAC3C,CAAC,CAAC;IACJ;IAEA,MAAM,EAAE,eAAe,MAAM,OAAO;IACpC,IAAI,WAAW;IAEf,MAAM,MAAM,MAAM,WAAW,OAAO,IAAI,GAAG;KACzC,MAAM;KACN,QAAQ;KACR,cAAc;IAChB,CAAC;IAED,IAAI,CAAC,WAAW;KACd,SAAS,UAAU;KACnB,QAAQ,GAAG;IACb;GACF,QAAQ;IAEN,IAAI,CAAC,WAAW,QAAQ,EAAE;GAC5B;EACF,EAAC,CAAE;EAEH,aAAa;GACX,YAAY;EACd;CACF,GAAG;EAAC;EAAU;EAAc;EAAc;CAAW,CAAC;CAItD,MAAM,UAAU,QAAQ,SAAS;CAEjC,IAAI,CAAC,SACH,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,QAAD,EAAO,SAAe;CACnB;CAIT,OACE,oBAAC,OAAD;EAEE,yBAAyB,EAAE,QAAQ,QAAQ;EAC3C,OAAO,EAAE,iBAAiB,cAAc;CACzC;AAEL"}
1
+ {"version":3,"file":"CodeBlockHighlight.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockHighlight.tsx"],"sourcesContent":["'use client';\n\n/**\n * Client-side Shiki highlighter that also handles TypeScript→ESM/CJS transformation.\n *\n * Everything runs inside a single useEffect so that:\n * - Nothing is imported at all while the canonical TypeScript source is shown\n * and its markup was already highlighted ahead of time.\n * - The transformer is only dynamically imported when a non-TypeScript format is selected.\n * - The previous highlighted HTML stays visible while the new one loads (no white-text flash).\n */\n\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\nimport type { CodeFormat } from './CodeContext';\nimport { type CodeLanguage, resolveCodeLanguage } from './shikiLanguages';\nimport { SHIKI_THEMES } from './shikiThemes';\n\ntype Props = {\n /** Raw TypeScript source code (the canonical \"source of truth\"). */\n children: ReactNode;\n /** Language of the source (e.g. 'tsx', 'typescript'). */\n originalLang: CodeLanguage;\n /** Currently selected format: 'typescript' | 'esm' | 'commonjs'. */\n targetFormat: Exclude<CodeFormat, 'json'>;\n /** Markup for the TypeScript source, highlighted ahead of time. */\n initialHtml?: string;\n};\n\nexport const CodeBlockHighlight = ({\n children,\n originalLang,\n targetFormat,\n initialHtml,\n}: Props) => {\n const [html, setHtml] = useState<string | null>(initialHtml ?? null);\n const prevHtml = useRef<string | null>(initialHtml ?? null);\n\n useEffect(() => {\n // The pre-highlighted markup already is the TypeScript rendering — no need\n // to pull Shiki into the browser until another format is picked.\n if (initialHtml && targetFormat === 'typescript') {\n prevHtml.current = initialHtml;\n setHtml(initialHtml);\n return;\n }\n\n let cancelled = false;\n\n (async () => {\n try {\n let code = children;\n let shikiLang = resolveCodeLanguage(originalLang).id;\n\n // Only import the transformer when we actually need it.\n if (targetFormat !== 'typescript') {\n const { transformCode, deriveLanguage } = await import(\n './codeTransformer'\n );\n if (cancelled) return;\n code = transformCode(String(children), targetFormat);\n shikiLang = resolveCodeLanguage(\n deriveLanguage(originalLang, targetFormat)\n ).id;\n }\n\n const { codeToHtml } = await import('./shikiBundle');\n if (cancelled) return;\n\n const out = await codeToHtml(String(code), {\n lang: shikiLang,\n themes: SHIKI_THEMES,\n defaultColor: false,\n });\n\n if (!cancelled) {\n prevHtml.current = out;\n setHtml(out);\n }\n } catch {\n // Shiki failed (unknown language, etc.) — fall through to plain-text.\n if (!cancelled) setHtml('');\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [children, originalLang, targetFormat, initialHtml]);\n\n // Keep the previous highlighted output visible while the new one is loading.\n // This prevents the white-text flash on format switches.\n const display = html ?? prevHtml.current;\n\n if (!display) {\n return (\n <pre className=\"min-w-0 max-w-full overflow-x-auto\">\n <code>{children}</code>\n </pre>\n );\n }\n\n return (\n <div\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n dangerouslySetInnerHTML={{ __html: display }}\n style={{ backgroundColor: 'transparent' }}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAa,sBAAsB,EACjC,UACA,cACA,cACA,kBACW;CACX,MAAM,CAAC,MAAM,WAAW,SAAwB,eAAe,IAAI;CACnE,MAAM,WAAW,OAAsB,eAAe,IAAI;CAE1D,gBAAgB;EAGd,IAAI,eAAe,iBAAiB,cAAc;GAChD,SAAS,UAAU;GACnB,QAAQ,WAAW;GACnB;EACF;EAEA,IAAI,YAAY;EAEhB,CAAC,YAAY;GACX,IAAI;IACF,IAAI,OAAO;IACX,IAAI,YAAY,oBAAoB,YAAY,CAAC,CAAC;IAGlD,IAAI,iBAAiB,cAAc;KACjC,MAAM,EAAE,eAAe,mBAAmB,MAAM,OAC9C;KAEF,IAAI,WAAW;KACf,OAAO,cAAc,OAAO,QAAQ,GAAG,YAAY;KACnD,YAAY,oBACV,eAAe,cAAc,YAAY,CAC3C,CAAC,CAAC;IACJ;IAEA,MAAM,EAAE,eAAe,MAAM,OAAO;IACpC,IAAI,WAAW;IAEf,MAAM,MAAM,MAAM,WAAW,OAAO,IAAI,GAAG;KACzC,MAAM;KACN,QAAQ;KACR,cAAc;IAChB,CAAC;IAED,IAAI,CAAC,WAAW;KACd,SAAS,UAAU;KACnB,QAAQ,GAAG;IACb;GACF,QAAQ;IAEN,IAAI,CAAC,WAAW,QAAQ,EAAE;GAC5B;EACF,EAAC,CAAE;EAEH,aAAa;GACX,YAAY;EACd;CACF,GAAG;EAAC;EAAU;EAAc;EAAc;CAAW,CAAC;CAItD,MAAM,UAAU,QAAQ,SAAS;CAEjC,IAAI,CAAC,SACH,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,QAAD,EAAO,SAAe;CACnB;CAIT,OACE,oBAAC,OAAD;EAEE,yBAAyB,EAAE,QAAQ,QAAQ;EAC3C,OAAO,EAAE,iBAAiB,cAAc;CACzC;AAEL"}
@@ -1,9 +1,9 @@
1
1
  import { cn } from "../../utils/cn.mjs";
2
2
  import { SHIKI_THEMES } from "./shikiThemes.mjs";
3
+ import { codeToHtml } from "./shikiBundle.mjs";
3
4
  import { Suspense } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  import { transformerMetaHighlight, transformerMetaWordHighlight, transformerNotationDiff, transformerNotationErrorLevel, transformerNotationHighlight, transformerNotationWordHighlight } from "@shikijs/transformers";
6
- import { codeToHtml } from "shiki/bundle/web";
7
7
 
8
8
  //#region src/components/IDE/CodeBlockServer.tsx
9
9
  const CodeBlockShiki = (async ({ children, lang, onChange, ...props }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockServer.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockServer.tsx"],"sourcesContent":["import {\n transformerMetaHighlight,\n transformerMetaWordHighlight,\n transformerNotationDiff,\n transformerNotationErrorLevel,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n} from '@shikijs/transformers';\nimport { cn } from '@utils/cn';\nimport { type FC, type HTMLAttributes, Suspense } from 'react';\nimport {\n type BundledLanguage,\n type BundledTheme,\n type CodeToHastOptions,\n codeToHtml,\n} from 'shiki/bundle/web';\nimport { SHIKI_THEMES } from './shikiThemes';\n\nexport const CodeBlockShiki = (async ({\n children,\n lang,\n onChange,\n ...props\n}: CodeBlockProps) => {\n const shikiOptions: CodeToHastOptions<BundledLanguage, BundledTheme> = {\n lang,\n themes: SHIKI_THEMES,\n // Both palettes ship as CSS variables, so one markup serves both themes.\n defaultColor: false,\n transformers: [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationErrorLevel(),\n transformerMetaHighlight(),\n transformerMetaWordHighlight(),\n ],\n };\n\n const out = await codeToHtml(children, shikiOptions);\n\n return (\n <div\n dangerouslySetInnerHTML={{ __html: out }}\n {...props}\n style={{ backgroundColor: 'transparent' }}\n />\n );\n}) as unknown as FC<CodeBlockProps>;\n\nconst CodeDefault: FC<CodeBlockProps> = ({\n children,\n isEditable,\n onChange,\n ...props\n}) => (\n <div contentEditable={isEditable} {...props}>\n <pre>\n <code>\n {typeof children === 'string'\n ? children.split('\\n').map((line, index) => (\n <span className=\"line block w-full\" key={index}>\n {line}\n </span>\n ))\n : children}\n </code>\n </pre>\n </div>\n);\n\nexport type CodeBlockProps = {\n children: string;\n lang: BundledLanguage;\n isEditable?: boolean;\n onChange?: (content: string) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;\n\nexport const CodeBlock: FC<CodeBlockProps> = ({\n className,\n onChange,\n isEditable,\n ...props\n}) => (\n <Suspense fallback={<CodeDefault {...props} />}>\n <CodeBlockShiki\n className={cn('flex w-full', className)}\n contentEditable={isEditable}\n onInput={(e) => onChange?.(e.currentTarget.textContent ?? '')}\n {...props}\n />\n </Suspense>\n);\n"],"mappings":";;;;;;;;AAkBA,MAAa,kBAAkB,OAAO,EACpC,UACA,MACA,UACA,GAAG,YACiB;CACpB,MAAM,eAAiE;EACrE;EACA,QAAQ;EAER,cAAc;EACd,cAAc;GACZ,wBAAwB;GACxB,6BAA6B;GAC7B,iCAAiC;GACjC,8BAA8B;GAC9B,yBAAyB;GACzB,6BAA6B;EAC/B;CACF;CAEA,MAAM,MAAM,MAAM,WAAW,UAAU,YAAY;CAEnD,OACE,oBAAC,OAAD;EACE,yBAAyB,EAAE,QAAQ,IAAI;EACvC,GAAI;EACJ,OAAO,EAAE,iBAAiB,cAAc;CACzC;AAEL;AAEA,MAAM,eAAmC,EACvC,UACA,YACA,UACA,GAAG,YAEH,oBAAC,OAAD;CAAK,iBAAiB;CAAY,GAAI;WACpC,oBAAC,OAAD,YACE,oBAAC,QAAD,YACG,OAAO,aAAa,WACjB,SAAS,MAAM,IAAI,CAAC,CAAC,KAAK,MAAM,UAC9B,oBAAC,QAAD;EAAM,WAAU;YACb;CACG,GAFmC,KAEnC,CACP,IACD,SACA,GACH;AACF;AAUP,MAAa,aAAiC,EAC5C,WACA,UACA,YACA,GAAG,YAEH,oBAAC,UAAD;CAAU,UAAU,oBAAC,aAAD,EAAa,GAAI,MAAQ;WAC3C,oBAAC,gBAAD;EACE,WAAW,GAAG,eAAe,SAAS;EACtC,iBAAiB;EACjB,UAAU,MAAM,WAAW,EAAE,cAAc,eAAe,EAAE;EAC5D,GAAI;CACL;AACO"}
1
+ {"version":3,"file":"CodeBlockServer.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockServer.tsx"],"sourcesContent":["import {\n transformerMetaHighlight,\n transformerMetaWordHighlight,\n transformerNotationDiff,\n transformerNotationErrorLevel,\n transformerNotationHighlight,\n transformerNotationWordHighlight,\n} from '@shikijs/transformers';\nimport { cn } from '@utils/cn';\nimport { type FC, type HTMLAttributes, Suspense } from 'react';\nimport { type BundledLanguage, codeToHtml } from './shikiBundle';\nimport { SHIKI_THEMES } from './shikiThemes';\n\nexport const CodeBlockShiki = (async ({\n children,\n lang,\n onChange,\n ...props\n}: CodeBlockProps) => {\n const shikiOptions: Parameters<typeof codeToHtml>[1] = {\n lang,\n themes: SHIKI_THEMES,\n // Both palettes ship as CSS variables, so one markup serves both themes.\n defaultColor: false,\n transformers: [\n transformerNotationDiff(),\n transformerNotationHighlight(),\n transformerNotationWordHighlight(),\n transformerNotationErrorLevel(),\n transformerMetaHighlight(),\n transformerMetaWordHighlight(),\n ],\n };\n\n const out = await codeToHtml(children, shikiOptions);\n\n return (\n <div\n dangerouslySetInnerHTML={{ __html: out }}\n {...props}\n style={{ backgroundColor: 'transparent' }}\n />\n );\n}) as unknown as FC<CodeBlockProps>;\n\nconst CodeDefault: FC<CodeBlockProps> = ({\n children,\n isEditable,\n onChange,\n ...props\n}) => (\n <div contentEditable={isEditable} {...props}>\n <pre>\n <code>\n {typeof children === 'string'\n ? children.split('\\n').map((line, index) => (\n <span className=\"line block w-full\" key={index}>\n {line}\n </span>\n ))\n : children}\n </code>\n </pre>\n </div>\n);\n\nexport type CodeBlockProps = {\n children: string;\n lang: BundledLanguage;\n isEditable?: boolean;\n onChange?: (content: string) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;\n\nexport const CodeBlock: FC<CodeBlockProps> = ({\n className,\n onChange,\n isEditable,\n ...props\n}) => (\n <Suspense fallback={<CodeDefault {...props} />}>\n <CodeBlockShiki\n className={cn('flex w-full', className)}\n contentEditable={isEditable}\n onInput={(e) => onChange?.(e.currentTarget.textContent ?? '')}\n {...props}\n />\n </Suspense>\n);\n"],"mappings":";;;;;;;;AAaA,MAAa,kBAAkB,OAAO,EACpC,UACA,MACA,UACA,GAAG,YACiB;CACpB,MAAM,eAAiD;EACrD;EACA,QAAQ;EAER,cAAc;EACd,cAAc;GACZ,wBAAwB;GACxB,6BAA6B;GAC7B,iCAAiC;GACjC,8BAA8B;GAC9B,yBAAyB;GACzB,6BAA6B;EAC/B;CACF;CAEA,MAAM,MAAM,MAAM,WAAW,UAAU,YAAY;CAEnD,OACE,oBAAC,OAAD;EACE,yBAAyB,EAAE,QAAQ,IAAI;EACvC,GAAI;EACJ,OAAO,EAAE,iBAAiB,cAAc;CACzC;AAEL;AAEA,MAAM,eAAmC,EACvC,UACA,YACA,UACA,GAAG,YAEH,oBAAC,OAAD;CAAK,iBAAiB;CAAY,GAAI;WACpC,oBAAC,OAAD,YACE,oBAAC,QAAD,YACG,OAAO,aAAa,WACjB,SAAS,MAAM,IAAI,CAAC,CAAC,KAAK,MAAM,UAC9B,oBAAC,QAAD;EAAM,WAAU;YACb;CACG,GAFmC,KAEnC,CACP,IACD,SACA,GACH;AACF;AAUP,MAAa,aAAiC,EAC5C,WACA,UACA,YACA,GAAG,YAEH,oBAAC,UAAD;CAAU,UAAU,oBAAC,aAAD,EAAa,GAAI,MAAQ;WAC3C,oBAAC,gBAAD;EACE,WAAW,GAAG,eAAe,SAAS;EACtC,iBAAiB;EACjB,UAAU,MAAM,WAAW,EAAE,cAAc,eAAe,EAAE;EAC5D,GAAI;CACL;AACO"}
@@ -7,60 +7,18 @@ import { useEffect, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/IDE/CodeBlockShiki.tsx
10
- const languageCache = /* @__PURE__ */ new Map();
11
- const themeCache = /* @__PURE__ */ new Map();
12
- /**
13
- * Lazy load the grammar of an already resolved language.
14
- *
15
- * @returns The grammar registrations, or `null` for languages Shiki renders
16
- * without a grammar (plain text).
17
- */
18
- const loadLanguage = async ({ id, loadGrammar }) => {
19
- if (!loadGrammar) return null;
20
- const cachedLanguage = languageCache.get(id);
21
- if (cachedLanguage) return cachedLanguage;
22
- const languagePromise = loadGrammar().then((module) => module.default);
23
- languageCache.set(id, languagePromise);
24
- return languagePromise;
25
- };
26
- /**
27
- * Lazy load a theme module.
28
- */
29
- const loadTheme = async (themeName) => {
30
- const cachedTheme = themeCache.get(themeName);
31
- if (cachedTheme) return cachedTheme;
32
- const themePromise = (themeName === SHIKI_THEMES.dark ? import("shiki/themes/github-dark.mjs") : import("shiki/themes/github-light.mjs")).then((module) => module.default);
33
- themeCache.set(themeName, themePromise);
34
- return themePromise;
35
- };
36
- let highlighterPromise = null;
37
- const getHighlighterInstance = async () => {
38
- if (!highlighterPromise) highlighterPromise = import("shiki/bundle/web").then(({ createHighlighter }) => createHighlighter({
39
- langs: [],
40
- themes: []
41
- }));
42
- return highlighterPromise;
43
- };
44
10
  /**
45
11
  * Highlight a snippet, lazily loading only the grammar and themes it needs.
46
12
  *
47
13
  * The language is resolved to a canonical Shiki id first, so that the id passed
48
- * to `codeToHtml` always matches the grammar that was loaded.
14
+ * to `codeToHtml` always matches a grammar the bundle can load. Shiki itself is
15
+ * imported from `./shikiBundle` — the fine-grained bundle — and only once a
16
+ * snippet actually has to be highlighted in the browser.
49
17
  */
50
18
  const highlightCode = async (code, lang) => {
51
- const resolvedLanguage = resolveCodeLanguage(lang);
52
- const [highlighter, languageModule, lightTheme, darkTheme] = await Promise.all([
53
- getHighlighterInstance(),
54
- loadLanguage(resolvedLanguage),
55
- loadTheme(SHIKI_THEMES.light),
56
- loadTheme(SHIKI_THEMES.dark)
57
- ]);
58
- if (languageModule && !highlighter.getLoadedLanguages().includes(resolvedLanguage.id)) await highlighter.loadLanguage(languageModule);
59
- const loadedThemes = highlighter.getLoadedThemes();
60
- if (!loadedThemes.includes(SHIKI_THEMES.light)) await highlighter.loadTheme(lightTheme);
61
- if (!loadedThemes.includes(SHIKI_THEMES.dark)) await highlighter.loadTheme(darkTheme);
62
- return highlighter.codeToHtml(String(code), {
63
- lang: resolvedLanguage.id,
19
+ const { codeToHtml } = await import("./shikiBundle.mjs");
20
+ return codeToHtml(String(code), {
21
+ lang: resolveCodeLanguage(lang).id,
64
22
  themes: SHIKI_THEMES,
65
23
  defaultColor: false
66
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockShiki.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useEffect, useState } from 'react';\nimport { CodeDefault, shikiWrapperClassName } from './CodeBlockClient';\nimport {\n type CodeLanguage,\n type LanguageGrammar,\n type ResolvedCodeLanguage,\n resolveCodeLanguage,\n} from './shikiLanguages';\nimport { SHIKI_THEMES } from './shikiThemes';\n\n/** Theme registration, as default-exported by the `shiki/themes/*` modules. */\ntype ThemeRegistration =\n typeof import('shiki/themes/github-dark.mjs')['default'];\n\n/** Minimal Shiki highlighter surface used here, with unrestricted language ids. */\ntype CodeHighlighter = {\n getLoadedLanguages(): string[];\n getLoadedThemes(): string[];\n loadLanguage(grammar: LanguageGrammar): Promise<void>;\n loadTheme(theme: ThemeRegistration): Promise<void>;\n codeToHtml(\n code: string,\n options: {\n lang: string;\n themes: { light: string; dark: string };\n defaultColor: false;\n }\n ): string;\n};\n\n// Map of in-flight/loaded modules to avoid re-importing\nconst languageCache = new Map<string, Promise<LanguageGrammar>>();\nconst themeCache = new Map<string, Promise<ThemeRegistration>>();\n\n/**\n * Lazy load the grammar of an already resolved language.\n *\n * @returns The grammar registrations, or `null` for languages Shiki renders\n * without a grammar (plain text).\n */\nconst loadLanguage = async ({\n id,\n loadGrammar,\n}: ResolvedCodeLanguage): Promise<LanguageGrammar | null> => {\n if (!loadGrammar) return null;\n\n const cachedLanguage = languageCache.get(id);\n if (cachedLanguage) return cachedLanguage;\n\n const languagePromise = loadGrammar().then((module) => module.default);\n languageCache.set(id, languagePromise);\n\n return languagePromise;\n};\n\n/**\n * Lazy load a theme module.\n */\nconst loadTheme = async (themeName: string): Promise<ThemeRegistration> => {\n const cachedTheme = themeCache.get(themeName);\n if (cachedTheme) return cachedTheme;\n\n const themePromise = (\n themeName === SHIKI_THEMES.dark\n ? import('shiki/themes/github-dark.mjs')\n : import('shiki/themes/github-light.mjs')\n ).then((module) => module.default);\n\n themeCache.set(themeName, themePromise);\n\n return themePromise;\n};\n\n// Singleton Highlighter Instance\nlet highlighterPromise: Promise<CodeHighlighter> | null = null;\n\nconst getHighlighterInstance = async () => {\n if (!highlighterPromise) {\n highlighterPromise = import('shiki/bundle/web').then(\n ({ createHighlighter }) =>\n createHighlighter({\n langs: [],\n themes: [],\n })\n );\n }\n return highlighterPromise;\n};\n\n/**\n * Highlight a snippet, lazily loading only the grammar and themes it needs.\n *\n * The language is resolved to a canonical Shiki id first, so that the id passed\n * to `codeToHtml` always matches the grammar that was loaded.\n */\nconst highlightCode = async (\n code: ReactNode,\n lang: CodeLanguage\n): Promise<string> => {\n const resolvedLanguage = resolveCodeLanguage(lang);\n\n // Load highlighter, language, and themes in parallel\n const [highlighter, languageModule, lightTheme, darkTheme] =\n await Promise.all([\n getHighlighterInstance(),\n loadLanguage(resolvedLanguage),\n loadTheme(SHIKI_THEMES.light),\n loadTheme(SHIKI_THEMES.dark),\n ]);\n\n // Load into the singleton instance if not already loaded\n if (\n languageModule &&\n !highlighter.getLoadedLanguages().includes(resolvedLanguage.id)\n ) {\n await highlighter.loadLanguage(languageModule);\n }\n\n const loadedThemes = highlighter.getLoadedThemes();\n if (!loadedThemes.includes(SHIKI_THEMES.light)) {\n await highlighter.loadTheme(lightTheme);\n }\n if (!loadedThemes.includes(SHIKI_THEMES.dark)) {\n await highlighter.loadTheme(darkTheme);\n }\n\n return highlighter.codeToHtml(String(code), {\n lang: resolvedLanguage.id,\n themes: SHIKI_THEMES,\n defaultColor: false,\n });\n};\n\nexport type CodeBlockShikiProps = {\n children: ReactNode;\n lang: CodeLanguage;\n};\n\nexport const CodeBlockShiki: FC<CodeBlockShikiProps> = ({ children, lang }) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n highlightCode(children, lang)\n .then((result) => {\n if (!isCancelled) setHtml(result);\n })\n .catch((error) => {\n console.error('Failed to highlight code:', error);\n if (!isCancelled) setHtml('');\n });\n\n return () => {\n isCancelled = true;\n };\n }, [children, lang]);\n\n return (\n <div className={shikiWrapperClassName}>\n {html ? (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n <div dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <CodeDefault>{children}</CodeDefault>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAiCA,MAAM,gCAAgB,IAAI,IAAsC;AAChE,MAAM,6BAAa,IAAI,IAAwC;;;;;;;AAQ/D,MAAM,eAAe,OAAO,EAC1B,IACA,kBAC2D;CAC3D,IAAI,CAAC,aAAa,OAAO;CAEzB,MAAM,iBAAiB,cAAc,IAAI,EAAE;CAC3C,IAAI,gBAAgB,OAAO;CAE3B,MAAM,kBAAkB,YAAY,CAAC,CAAC,MAAM,WAAW,OAAO,OAAO;CACrE,cAAc,IAAI,IAAI,eAAe;CAErC,OAAO;AACT;;;;AAKA,MAAM,YAAY,OAAO,cAAkD;CACzE,MAAM,cAAc,WAAW,IAAI,SAAS;CAC5C,IAAI,aAAa,OAAO;CAExB,MAAM,gBACJ,cAAc,aAAa,OACvB,OAAO,kCACP,OAAO,iCAAgC,CAC3C,MAAM,WAAW,OAAO,OAAO;CAEjC,WAAW,IAAI,WAAW,YAAY;CAEtC,OAAO;AACT;AAGA,IAAI,qBAAsD;AAE1D,MAAM,yBAAyB,YAAY;CACzC,IAAI,CAAC,oBACH,qBAAqB,OAAO,mBAAmB,CAAC,MAC7C,EAAE,wBACD,kBAAkB;EAChB,OAAO,CAAC;EACR,QAAQ,CAAC;CACX,CAAC,CACL;CAEF,OAAO;AACT;;;;;;;AAQA,MAAM,gBAAgB,OACpB,MACA,SACoB;CACpB,MAAM,mBAAmB,oBAAoB,IAAI;CAGjD,MAAM,CAAC,aAAa,gBAAgB,YAAY,aAC9C,MAAM,QAAQ,IAAI;EAChB,uBAAuB;EACvB,aAAa,gBAAgB;EAC7B,UAAU,aAAa,KAAK;EAC5B,UAAU,aAAa,IAAI;CAC7B,CAAC;CAGH,IACE,kBACA,CAAC,YAAY,mBAAmB,CAAC,CAAC,SAAS,iBAAiB,EAAE,GAE9D,MAAM,YAAY,aAAa,cAAc;CAG/C,MAAM,eAAe,YAAY,gBAAgB;CACjD,IAAI,CAAC,aAAa,SAAS,aAAa,KAAK,GAC3C,MAAM,YAAY,UAAU,UAAU;CAExC,IAAI,CAAC,aAAa,SAAS,aAAa,IAAI,GAC1C,MAAM,YAAY,UAAU,SAAS;CAGvC,OAAO,YAAY,WAAW,OAAO,IAAI,GAAG;EAC1C,MAAM,iBAAiB;EACvB,QAAQ;EACR,cAAc;CAChB,CAAC;AACH;AAOA,MAAa,kBAA2C,EAAE,UAAU,WAAW;CAC7E,MAAM,CAAC,MAAM,WAAW,SAAwB,IAAI;CAEpD,gBAAgB;EACd,IAAI,cAAc;EAElB,cAAc,UAAU,IAAI,CAAC,CAC1B,MAAM,WAAW;GAChB,IAAI,CAAC,aAAa,QAAQ,MAAM;EAClC,CAAC,CAAC,CACD,OAAO,UAAU;GAChB,QAAQ,MAAM,6BAA6B,KAAK;GAChD,IAAI,CAAC,aAAa,QAAQ,EAAE;EAC9B,CAAC;EAEH,aAAa;GACX,cAAc;EAChB;CACF,GAAG,CAAC,UAAU,IAAI,CAAC;CAEnB,OACE,oBAAC,OAAD;EAAK,WAAW;YACb,OAEC,oBAAC,OAAD,EAAK,yBAAyB,EAAE,QAAQ,KAAK,EAAI,KAEjD,oBAAC,aAAD,EAAc,SAAsB;CAEnC;AAET"}
1
+ {"version":3,"file":"CodeBlockShiki.mjs","names":[],"sources":["../../../../src/components/IDE/CodeBlockShiki.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, type ReactNode, useEffect, useState } from 'react';\nimport { CodeDefault, shikiWrapperClassName } from './CodeBlockClient';\nimport { type CodeLanguage, resolveCodeLanguage } from './shikiLanguages';\nimport { SHIKI_THEMES } from './shikiThemes';\n\n/**\n * Highlight a snippet, lazily loading only the grammar and themes it needs.\n *\n * The language is resolved to a canonical Shiki id first, so that the id passed\n * to `codeToHtml` always matches a grammar the bundle can load. Shiki itself is\n * imported from `./shikiBundle` — the fine-grained bundle — and only once a\n * snippet actually has to be highlighted in the browser.\n */\nconst highlightCode = async (\n code: ReactNode,\n lang: CodeLanguage\n): Promise<string> => {\n const { codeToHtml } = await import('./shikiBundle');\n\n return codeToHtml(String(code), {\n lang: resolveCodeLanguage(lang).id,\n themes: SHIKI_THEMES,\n defaultColor: false,\n });\n};\n\nexport type CodeBlockShikiProps = {\n children: ReactNode;\n lang: CodeLanguage;\n};\n\nexport const CodeBlockShiki: FC<CodeBlockShikiProps> = ({ children, lang }) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n let isCancelled = false;\n\n highlightCode(children, lang)\n .then((result) => {\n if (!isCancelled) setHtml(result);\n })\n .catch((error) => {\n console.error('Failed to highlight code:', error);\n if (!isCancelled) setHtml('');\n });\n\n return () => {\n isCancelled = true;\n };\n }, [children, lang]);\n\n return (\n <div className={shikiWrapperClassName}>\n {html ? (\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Shiki generates safe HTML for code highlighting\n <div dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <CodeDefault>{children}</CodeDefault>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAM,gBAAgB,OACpB,MACA,SACoB;CACpB,MAAM,EAAE,eAAe,MAAM,OAAO;CAEpC,OAAO,WAAW,OAAO,IAAI,GAAG;EAC9B,MAAM,oBAAoB,IAAI,CAAC,CAAC;EAChC,QAAQ;EACR,cAAc;CAChB,CAAC;AACH;AAOA,MAAa,kBAA2C,EAAE,UAAU,WAAW;CAC7E,MAAM,CAAC,MAAM,WAAW,SAAwB,IAAI;CAEpD,gBAAgB;EACd,IAAI,cAAc;EAElB,cAAc,UAAU,IAAI,CAAC,CAC1B,MAAM,WAAW;GAChB,IAAI,CAAC,aAAa,QAAQ,MAAM;EAClC,CAAC,CAAC,CACD,OAAO,UAAU;GAChB,QAAQ,MAAM,6BAA6B,KAAK;GAChD,IAAI,CAAC,aAAa,QAAQ,EAAE;EAC9B,CAAC;EAEH,aAAa;GACX,cAAc;EAChB;CACF,GAAG,CAAC,UAAU,IAAI,CAAC;CAEnB,OACE,oBAAC,OAAD;EAAK,WAAW;YACb,OAEC,oBAAC,OAAD,EAAK,yBAAyB,EAAE,QAAQ,KAAK,EAAI,KAEjD,oBAAC,aAAD,EAAc,SAAsB;CAEnC;AAET"}
@@ -1,6 +1,6 @@
1
1
  import { Code } from "./Code.mjs";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import cn from "cnfast";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  import { MarkdownRenderer as MarkdownRenderer$1 } from "react-intlayer/markdown";
5
5
 
6
6
  //#region src/components/IDE/MarkDownRender.tsx
@@ -0,0 +1,61 @@
1
+ import { grammarAliases, grammarLoaders } from "./shikiLanguages.mjs";
2
+ import { createBundledHighlighter, createSingletonShorthands, guessEmbeddedLanguages } from "@shikijs/core";
3
+ import { createOnigurumaEngine } from "@shikijs/engine-oniguruma";
4
+
5
+ //#region src/components/IDE/shikiBundle.ts
6
+ /**
7
+ * Fine-grained Shiki bundle — a drop-in replacement for `shiki` and
8
+ * `shiki/bundle/web`.
9
+ *
10
+ * Both of those entry points statically pull `@shikijs/themes` (~70 themes) in
11
+ * full, and reference every grammar of their bundle (~220 and ~100
12
+ * respectively). Bundlers that group a package into a single chunk — Nitro does
13
+ * exactly that for `node_modules` — therefore emit ~10 MB of grammars and
14
+ * themes even though only two themes and the languages of
15
+ * {@link grammarLoaders} are ever asked for.
16
+ *
17
+ * This module rebuilds the same public surface on top of `@shikijs/core`, so
18
+ * the module graph only ever contains what is actually reachable. Everything is
19
+ * loaded on demand, exactly like the upstream bundles.
20
+ *
21
+ * @see https://shiki.style/guide/bundles#fine-grained-bundle
22
+ */
23
+ /**
24
+ * Alias ids pointed at the loader of the grammar that owns them, so that an
25
+ * alias is enough to pull its grammar in — the way it is with the upstream
26
+ * bundles, whose maps carry the same alias entries.
27
+ */
28
+ const aliasLoaders = Object.fromEntries(Object.entries(grammarAliases).map(([alias, canonicalId]) => [alias, grammarLoaders[canonicalId]]));
29
+ /** Every language id this bundle can highlight, aliases included. */
30
+ const bundledLanguages = {
31
+ ...grammarLoaders,
32
+ ...aliasLoaders
33
+ };
34
+ /** The two themes every code block is highlighted with. */
35
+ const bundledThemes = {
36
+ "github-light": () => import("shiki/themes/github-light.mjs"),
37
+ "github-dark": () => import("shiki/themes/github-dark.mjs")
38
+ };
39
+ /**
40
+ * Creates a highlighter that resolves language and theme ids against this
41
+ * bundle, loading each one the first time it is asked for.
42
+ *
43
+ * Ids still have to be the ones a grammar answers to — pass every fence name
44
+ * through {@link resolveCodeLanguage} first, exactly as with `shiki`'s own
45
+ * bundles.
46
+ */
47
+ const createHighlighter = createBundledHighlighter({
48
+ langs: bundledLanguages,
49
+ themes: bundledThemes,
50
+ engine: () => createOnigurumaEngine(import("shiki/wasm"))
51
+ });
52
+ /**
53
+ * Shorthands backed by a lazily created singleton highlighter — the same
54
+ * `codeToHtml` / `codeToHast` / … functions `shiki` exports, restricted to this
55
+ * bundle.
56
+ */
57
+ const { codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getLastGrammarState, getSingletonHighlighter } = createSingletonShorthands(createHighlighter, { guessEmbeddedLanguages });
58
+
59
+ //#endregion
60
+ export { bundledLanguages, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, createHighlighter, getLastGrammarState, getSingletonHighlighter };
61
+ //# sourceMappingURL=shikiBundle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shikiBundle.mjs","names":[],"sources":["../../../../src/components/IDE/shikiBundle.ts"],"sourcesContent":["/**\n * Fine-grained Shiki bundle — a drop-in replacement for `shiki` and\n * `shiki/bundle/web`.\n *\n * Both of those entry points statically pull `@shikijs/themes` (~70 themes) in\n * full, and reference every grammar of their bundle (~220 and ~100\n * respectively). Bundlers that group a package into a single chunk — Nitro does\n * exactly that for `node_modules` — therefore emit ~10 MB of grammars and\n * themes even though only two themes and the languages of\n * {@link grammarLoaders} are ever asked for.\n *\n * This module rebuilds the same public surface on top of `@shikijs/core`, so\n * the module graph only ever contains what is actually reachable. Everything is\n * loaded on demand, exactly like the upstream bundles.\n *\n * @see https://shiki.style/guide/bundles#fine-grained-bundle\n */\n\nimport {\n createBundledHighlighter,\n createSingletonShorthands,\n guessEmbeddedLanguages,\n} from '@shikijs/core';\nimport { createOnigurumaEngine } from '@shikijs/engine-oniguruma';\nimport {\n type GrammarLoader,\n grammarAliases,\n grammarLoaders,\n type ShikiLanguageAlias,\n type ShikiLanguageId,\n} from './shikiLanguages';\nimport type { ShikiThemeId } from './shikiThemes';\n\n/** Theme registrations, as default-exported by the `shiki/themes/*` modules. */\nexport type ThemeRegistration =\n typeof import('shiki/themes/github-dark.mjs')['default'];\n\n/** Loads a single Shiki theme. */\nexport type ThemeLoader = () => Promise<{ default: ThemeRegistration }>;\n\n/**\n * Alias ids pointed at the loader of the grammar that owns them, so that an\n * alias is enough to pull its grammar in — the way it is with the upstream\n * bundles, whose maps carry the same alias entries.\n */\nconst aliasLoaders = Object.fromEntries(\n Object.entries(grammarAliases).map(([alias, canonicalId]) => [\n alias,\n grammarLoaders[canonicalId as ShikiLanguageId],\n ])\n) as Record<ShikiLanguageAlias, GrammarLoader>;\n\n/** Every language id this bundle can highlight, aliases included. */\nexport const bundledLanguages = {\n ...grammarLoaders,\n ...aliasLoaders,\n};\n\n/** The two themes every code block is highlighted with. */\nexport const bundledThemes = {\n 'github-light': () => import('shiki/themes/github-light.mjs'),\n 'github-dark': () => import('shiki/themes/github-dark.mjs'),\n} satisfies Record<ShikiThemeId, ThemeLoader>;\n\n/** Language ids accepted by this bundle's highlighter. */\nexport type BundledLanguage = keyof typeof bundledLanguages;\n\n/** Theme ids accepted by this bundle's highlighter. */\nexport type BundledTheme = keyof typeof bundledThemes;\n\n/**\n * Creates a highlighter that resolves language and theme ids against this\n * bundle, loading each one the first time it is asked for.\n *\n * Ids still have to be the ones a grammar answers to — pass every fence name\n * through {@link resolveCodeLanguage} first, exactly as with `shiki`'s own\n * bundles.\n */\nexport const createHighlighter = createBundledHighlighter<\n BundledLanguage,\n BundledTheme\n>({\n langs: bundledLanguages,\n themes: bundledThemes,\n engine: () => createOnigurumaEngine(import('shiki/wasm')),\n});\n\n/** Highlighter instance produced by {@link createHighlighter}. */\nexport type Highlighter = Awaited<ReturnType<typeof createHighlighter>>;\n\n/**\n * Shorthands backed by a lazily created singleton highlighter — the same\n * `codeToHtml` / `codeToHast` / … functions `shiki` exports, restricted to this\n * bundle.\n */\nexport const {\n codeToHast,\n codeToHtml,\n codeToTokens,\n codeToTokensBase,\n codeToTokensWithThemes,\n getLastGrammarState,\n getSingletonHighlighter,\n} = createSingletonShorthands<BundledLanguage, BundledTheme>(\n createHighlighter,\n {\n guessEmbeddedLanguages,\n }\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,eAAe,OAAO,YAC1B,OAAO,QAAQ,cAAc,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAC3D,OACA,eAAe,YACjB,CAAC,CACH;;AAGA,MAAa,mBAAmB;CAC9B,GAAG;CACH,GAAG;AACL;;AAGA,MAAa,gBAAgB;CAC3B,sBAAsB,OAAO;CAC7B,qBAAqB,OAAO;AAC9B;;;;;;;;;AAgBA,MAAa,oBAAoB,yBAG/B;CACA,OAAO;CACP,QAAQ;CACR,cAAc,sBAAsB,OAAO,aAAa;AAC1D,CAAC;;;;;;AAUD,MAAa,EACX,YACA,YACA,cACA,kBACA,wBACA,qBACA,4BACE,0BACF,mBACA,EACE,uBACF,CACF"}
@@ -7,43 +7,16 @@
7
7
  * grammar instead of bundling every language up front.
8
8
  */
9
9
  const grammarLoaders = {
10
- "angular-html": () => import("shiki/langs/angular-html.mjs"),
11
- "angular-ts": () => import("shiki/langs/angular-ts.mjs"),
12
10
  astro: () => import("shiki/langs/astro.mjs"),
13
11
  bash: () => import("shiki/langs/bash.mjs"),
14
- c: () => import("shiki/langs/c.mjs"),
15
- cpp: () => import("shiki/langs/cpp.mjs"),
16
- csharp: () => import("shiki/langs/csharp.mjs"),
17
12
  css: () => import("shiki/langs/css.mjs"),
18
- csv: () => import("shiki/langs/csv.mjs"),
19
- dart: () => import("shiki/langs/dart.mjs"),
20
- diff: () => import("shiki/langs/diff.mjs"),
21
- docker: () => import("shiki/langs/docker.mjs"),
22
- go: () => import("shiki/langs/go.mjs"),
23
- graphql: () => import("shiki/langs/graphql.mjs"),
24
13
  html: () => import("shiki/langs/html.mjs"),
25
- http: () => import("shiki/langs/http.mjs"),
26
- ini: () => import("shiki/langs/ini.mjs"),
27
- java: () => import("shiki/langs/java.mjs"),
28
14
  javascript: () => import("shiki/langs/javascript.mjs"),
29
15
  json: () => import("shiki/langs/json.mjs"),
30
16
  json5: () => import("shiki/langs/json5.mjs"),
31
- kotlin: () => import("shiki/langs/kotlin.mjs"),
32
- less: () => import("shiki/langs/less.mjs"),
33
- lua: () => import("shiki/langs/lua.mjs"),
17
+ jsonc: () => import("shiki/langs/jsonc.mjs"),
34
18
  markdown: () => import("shiki/langs/markdown.mjs"),
35
- nginx: () => import("shiki/langs/nginx.mjs"),
36
- php: () => import("shiki/langs/php.mjs"),
37
- powershell: () => import("shiki/langs/powershell.mjs"),
38
- prisma: () => import("shiki/langs/prisma.mjs"),
39
- python: () => import("shiki/langs/python.mjs"),
40
- ruby: () => import("shiki/langs/ruby.mjs"),
41
- rust: () => import("shiki/langs/rust.mjs"),
42
- scss: () => import("shiki/langs/scss.mjs"),
43
- sql: () => import("shiki/langs/sql.mjs"),
44
19
  svelte: () => import("shiki/langs/svelte.mjs"),
45
- swift: () => import("shiki/langs/swift.mjs"),
46
- toml: () => import("shiki/langs/toml.mjs"),
47
20
  tsx: () => import("shiki/langs/tsx.mjs"),
48
21
  typescript: () => import("shiki/langs/typescript.mjs"),
49
22
  vue: () => import("shiki/langs/vue.mjs"),
@@ -57,30 +30,20 @@ const shikiLanguageIds = Object.keys(grammarLoaders);
57
30
  * canonical id that actually owns the grammar.
58
31
  */
59
32
  const grammarAliases = {
60
- "c#": "csharp",
61
- "c++": "cpp",
62
33
  cjs: "javascript",
63
34
  console: "bash",
64
- cs: "csharp",
65
35
  cts: "typescript",
66
36
  dockerfile: "docker",
67
- golang: "go",
68
37
  gql: "graphql",
69
38
  htm: "html",
70
39
  js: "javascript",
71
40
  jsonc: "json5",
72
41
  jsx: "tsx",
73
- kt: "kotlin",
74
42
  md: "markdown",
75
43
  mdx: "markdown",
76
44
  mjs: "javascript",
77
45
  mts: "typescript",
78
46
  postcss: "css",
79
- ps1: "powershell",
80
- pwsh: "powershell",
81
- py: "python",
82
- rb: "ruby",
83
- rs: "rust",
84
47
  sh: "bash",
85
48
  shell: "bash",
86
49
  shellscript: "bash",
@@ -118,5 +81,5 @@ const resolveCodeLanguage = (language) => {
118
81
  };
119
82
 
120
83
  //#endregion
121
- export { resolveCodeLanguage, shikiLanguageIds };
84
+ export { grammarAliases, grammarLoaders, resolveCodeLanguage, shikiLanguageIds };
122
85
  //# sourceMappingURL=shikiLanguages.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"shikiLanguages.mjs","names":[],"sources":["../../../../src/components/IDE/shikiLanguages.ts"],"sourcesContent":["/**\n * Grammar registrations, as default-exported by the `shiki/langs/*` modules.\n */\nexport type LanguageGrammar =\n typeof import('shiki/langs/typescript.mjs')['default'];\n\n/**\n * Loads a single Shiki grammar (and its embedded dependencies).\n */\nexport type GrammarLoader = () => Promise<{ default: LanguageGrammar }>;\n\n/**\n * Shiki grammar loaders, keyed by the canonical Shiki language id.\n *\n * Import specifiers are written as literals (never template strings) so that\n * bundlers can statically analyse them and emit one lazily fetched chunk per\n * grammar instead of bundling every language up front.\n */\nconst grammarLoaders = {\n 'angular-html': () => import('shiki/langs/angular-html.mjs'),\n 'angular-ts': () => import('shiki/langs/angular-ts.mjs'),\n astro: () => import('shiki/langs/astro.mjs'),\n bash: () => import('shiki/langs/bash.mjs'),\n c: () => import('shiki/langs/c.mjs'),\n cpp: () => import('shiki/langs/cpp.mjs'),\n csharp: () => import('shiki/langs/csharp.mjs'),\n css: () => import('shiki/langs/css.mjs'),\n csv: () => import('shiki/langs/csv.mjs'),\n dart: () => import('shiki/langs/dart.mjs'),\n diff: () => import('shiki/langs/diff.mjs'),\n docker: () => import('shiki/langs/docker.mjs'),\n go: () => import('shiki/langs/go.mjs'),\n graphql: () => import('shiki/langs/graphql.mjs'),\n html: () => import('shiki/langs/html.mjs'),\n http: () => import('shiki/langs/http.mjs'),\n ini: () => import('shiki/langs/ini.mjs'),\n java: () => import('shiki/langs/java.mjs'),\n javascript: () => import('shiki/langs/javascript.mjs'),\n json: () => import('shiki/langs/json.mjs'),\n json5: () => import('shiki/langs/json5.mjs'),\n kotlin: () => import('shiki/langs/kotlin.mjs'),\n less: () => import('shiki/langs/less.mjs'),\n lua: () => import('shiki/langs/lua.mjs'),\n markdown: () => import('shiki/langs/markdown.mjs'),\n nginx: () => import('shiki/langs/nginx.mjs'),\n php: () => import('shiki/langs/php.mjs'),\n powershell: () => import('shiki/langs/powershell.mjs'),\n prisma: () => import('shiki/langs/prisma.mjs'),\n python: () => import('shiki/langs/python.mjs'),\n ruby: () => import('shiki/langs/ruby.mjs'),\n rust: () => import('shiki/langs/rust.mjs'),\n scss: () => import('shiki/langs/scss.mjs'),\n sql: () => import('shiki/langs/sql.mjs'),\n svelte: () => import('shiki/langs/svelte.mjs'),\n swift: () => import('shiki/langs/swift.mjs'),\n toml: () => import('shiki/langs/toml.mjs'),\n tsx: () => import('shiki/langs/tsx.mjs'),\n typescript: () => import('shiki/langs/typescript.mjs'),\n vue: () => import('shiki/langs/vue.mjs'),\n xml: () => import('shiki/langs/xml.mjs'),\n yaml: () => import('shiki/langs/yaml.mjs'),\n} satisfies Record<string, GrammarLoader>;\n\n/** Canonical Shiki language ids this package can highlight. */\nexport type ShikiLanguageId = keyof typeof grammarLoaders;\n\n/** Every canonical language id that ships with a grammar loader. */\nexport const shikiLanguageIds = Object.keys(\n grammarLoaders\n) as ShikiLanguageId[];\n\n/**\n * Code fence names that are rendered by another grammar, mapped to the\n * canonical id that actually owns the grammar.\n */\nconst grammarAliases = {\n 'c#': 'csharp',\n 'c++': 'cpp',\n cjs: 'javascript',\n console: 'bash',\n cs: 'csharp',\n cts: 'typescript',\n dockerfile: 'docker',\n golang: 'go',\n gql: 'graphql',\n htm: 'html',\n js: 'javascript',\n jsonc: 'json5',\n jsx: 'tsx',\n kt: 'kotlin',\n md: 'markdown',\n mdx: 'markdown',\n mjs: 'javascript',\n mts: 'typescript',\n postcss: 'css',\n ps1: 'powershell',\n pwsh: 'powershell',\n py: 'python',\n rb: 'ruby',\n rs: 'rust',\n sh: 'bash',\n shell: 'bash',\n shellscript: 'bash',\n ts: 'typescript',\n yml: 'yaml',\n zsh: 'bash',\n} satisfies Record<string, ShikiLanguageId>;\n\n/** Code fence names accepted as aliases of a canonical language id. */\nexport type ShikiLanguageAlias = keyof typeof grammarAliases;\n\n/**\n * Languages Shiki renders without any grammar. They are also used as the\n * fallback for languages this package does not ship a grammar for.\n */\nexport type PlainTextLanguage = 'plaintext' | 'text' | 'txt';\n\nconst PLAIN_TEXT_LANGUAGE = 'plaintext' satisfies PlainTextLanguage;\n\n/** Every language name accepted by the code block components. */\nexport type CodeLanguage =\n | ShikiLanguageId\n | ShikiLanguageAlias\n | PlainTextLanguage;\n\n/**\n * A language name resolved to what Shiki actually needs to highlight it.\n */\nexport type ResolvedCodeLanguage = {\n /** Canonical language id to pass to `codeToHtml` / `codeToHast`. */\n id: ShikiLanguageId | PlainTextLanguage;\n /** Grammar loader, or `null` when the language needs no grammar. */\n loadGrammar: GrammarLoader | null;\n};\n\n/**\n * Resolve a code fence language name to a canonical Shiki id and its grammar\n * loader.\n *\n * Unknown names resolve to plain text rather than to an arbitrary grammar, so\n * that `codeToHtml` never receives a language it has not loaded.\n *\n * @param language - Language name coming from a code fence or a `lang` prop.\n *\n * @example\n * resolveCodeLanguage('ts'); // { id: 'typescript', loadGrammar: fn }\n * resolveCodeLanguage('toml'); // { id: 'toml', loadGrammar: fn }\n * resolveCodeLanguage('brainfuck'); // { id: 'plaintext', loadGrammar: null }\n */\nexport const resolveCodeLanguage = (\n language: CodeLanguage | string | undefined | null\n): ResolvedCodeLanguage => {\n const normalizedLanguage = (language ?? '').trim().toLowerCase();\n\n const canonicalId =\n grammarAliases[normalizedLanguage as ShikiLanguageAlias] ??\n (normalizedLanguage as ShikiLanguageId);\n\n const loadGrammar = grammarLoaders[canonicalId] as GrammarLoader | undefined;\n\n if (!loadGrammar) {\n return { id: PLAIN_TEXT_LANGUAGE, loadGrammar: null };\n }\n\n return { id: canonicalId, loadGrammar };\n};\n"],"mappings":";;;;;;;;AAkBA,MAAM,iBAAiB;CACrB,sBAAsB,OAAO;CAC7B,oBAAoB,OAAO;CAC3B,aAAa,OAAO;CACpB,YAAY,OAAO;CACnB,SAAS,OAAO;CAChB,WAAW,OAAO;CAClB,cAAc,OAAO;CACrB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,cAAc,OAAO;CACrB,UAAU,OAAO;CACjB,eAAe,OAAO;CACtB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,YAAY,OAAO;CACnB,kBAAkB,OAAO;CACzB,YAAY,OAAO;CACnB,aAAa,OAAO;CACpB,cAAc,OAAO;CACrB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,gBAAgB,OAAO;CACvB,aAAa,OAAO;CACpB,WAAW,OAAO;CAClB,kBAAkB,OAAO;CACzB,cAAc,OAAO;CACrB,cAAc,OAAO;CACrB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,cAAc,OAAO;CACrB,aAAa,OAAO;CACpB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,kBAAkB,OAAO;CACzB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,YAAY,OAAO;AACrB;;AAMA,MAAa,mBAAmB,OAAO,KACrC,cACF;;;;;AAMA,MAAM,iBAAiB;CACrB,MAAM;CACN,OAAO;CACP,KAAK;CACL,SAAS;CACT,IAAI;CACJ,KAAK;CACL,YAAY;CACZ,QAAQ;CACR,KAAK;CACL,KAAK;CACL,IAAI;CACJ,OAAO;CACP,KAAK;CACL,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,SAAS;CACT,KAAK;CACL,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,aAAa;CACb,IAAI;CACJ,KAAK;CACL,KAAK;AACP;AAWA,MAAM,sBAAsB;;;;;;;;;;;;;;;AAgC5B,MAAa,uBACX,aACyB;CACzB,MAAM,sBAAsB,YAAY,GAAE,CAAE,KAAK,CAAC,CAAC,YAAY;CAE/D,MAAM,cACJ,eAAe,uBACd;CAEH,MAAM,cAAc,eAAe;CAEnC,IAAI,CAAC,aACH,OAAO;EAAE,IAAI;EAAqB,aAAa;CAAK;CAGtD,OAAO;EAAE,IAAI;EAAa;CAAY;AACxC"}
1
+ {"version":3,"file":"shikiLanguages.mjs","names":[],"sources":["../../../../src/components/IDE/shikiLanguages.ts"],"sourcesContent":["/**\n * Grammar registrations, as default-exported by the `shiki/langs/*` modules.\n */\nexport type LanguageGrammar =\n typeof import('shiki/langs/typescript.mjs')['default'];\n\n/**\n * Loads a single Shiki grammar (and its embedded dependencies).\n */\nexport type GrammarLoader = () => Promise<{ default: LanguageGrammar }>;\n\n/**\n * Shiki grammar loaders, keyed by the canonical Shiki language id.\n *\n * Import specifiers are written as literals (never template strings) so that\n * bundlers can statically analyse them and emit one lazily fetched chunk per\n * grammar instead of bundling every language up front.\n */\nexport const grammarLoaders = {\n astro: () => import('shiki/langs/astro.mjs'),\n bash: () => import('shiki/langs/bash.mjs'),\n css: () => import('shiki/langs/css.mjs'),\n html: () => import('shiki/langs/html.mjs'),\n javascript: () => import('shiki/langs/javascript.mjs'),\n json: () => import('shiki/langs/json.mjs'),\n json5: () => import('shiki/langs/json5.mjs'),\n jsonc: () => import('shiki/langs/jsonc.mjs'),\n markdown: () => import('shiki/langs/markdown.mjs'),\n svelte: () => import('shiki/langs/svelte.mjs'),\n tsx: () => import('shiki/langs/tsx.mjs'),\n typescript: () => import('shiki/langs/typescript.mjs'),\n vue: () => import('shiki/langs/vue.mjs'),\n xml: () => import('shiki/langs/xml.mjs'),\n yaml: () => import('shiki/langs/yaml.mjs'),\n // 'angular-html': () => import('shiki/langs/angular-html.mjs'),\n // 'angular-ts': () => import('shiki/langs/angular-ts.mjs'),\n // c: () => import('shiki/langs/c.mjs'),\n // cpp: () => import('shiki/langs/cpp.mjs'),\n // csharp: () => import('shiki/langs/csharp.mjs'),\n // csv: () => import('shiki/langs/csv.mjs'),\n // dart: () => import('shiki/langs/dart.mjs'),\n // diff: () => import('shiki/langs/diff.mjs'),\n // docker: () => import('shiki/langs/docker.mjs'),\n // go: () => import('shiki/langs/go.mjs'),\n // graphql: () => import('shiki/langs/graphql.mjs'),\n // http: () => import('shiki/langs/http.mjs'),\n // ini: () => import('shiki/langs/ini.mjs'),\n // java: () => import('shiki/langs/java.mjs'),\n // kotlin: () => import('shiki/langs/kotlin.mjs'),\n // less: () => import('shiki/langs/less.mjs'),\n // lua: () => import('shiki/langs/lua.mjs'),\n // nginx: () => import('shiki/langs/nginx.mjs'),\n // php: () => import('shiki/langs/php.mjs'),\n // powershell: () => import('shiki/langs/powershell.mjs'),\n // prisma: () => import('shiki/langs/prisma.mjs'),\n // python: () => import('shiki/langs/python.mjs'),\n // ruby: () => import('shiki/langs/ruby.mjs'),\n // rust: () => import('shiki/langs/rust.mjs'),\n // scss: () => import('shiki/langs/scss.mjs'),\n // sql: () => import('shiki/langs/sql.mjs'), // swift: () => import('shiki/langs/swift.mjs'),\n // toml: () => import('shiki/langs/toml.mjs'),\n} satisfies Record<string, GrammarLoader>;\n\n/** Canonical Shiki language ids this package can highlight. */\nexport type ShikiLanguageId = keyof typeof grammarLoaders;\n\n/** Every canonical language id that ships with a grammar loader. */\nexport const shikiLanguageIds = Object.keys(\n grammarLoaders\n) as ShikiLanguageId[];\n\n/**\n * Code fence names that are rendered by another grammar, mapped to the\n * canonical id that actually owns the grammar.\n */\nexport const grammarAliases = {\n cjs: 'javascript',\n console: 'bash',\n cts: 'typescript',\n dockerfile: 'docker',\n gql: 'graphql',\n htm: 'html',\n js: 'javascript',\n jsonc: 'json5',\n jsx: 'tsx',\n md: 'markdown',\n mdx: 'markdown',\n mjs: 'javascript',\n mts: 'typescript',\n postcss: 'css',\n sh: 'bash',\n shell: 'bash',\n shellscript: 'bash',\n ts: 'typescript',\n yml: 'yaml',\n zsh: 'bash',\n} satisfies Record<string, ShikiLanguageId>;\n\n/** Code fence names accepted as aliases of a canonical language id. */\nexport type ShikiLanguageAlias = keyof typeof grammarAliases;\n\n/**\n * Languages Shiki renders without any grammar. They are also used as the\n * fallback for languages this package does not ship a grammar for.\n */\nexport type PlainTextLanguage = 'plaintext' | 'text' | 'txt';\n\nconst PLAIN_TEXT_LANGUAGE = 'plaintext' satisfies PlainTextLanguage;\n\n/** Every language name accepted by the code block components. */\nexport type CodeLanguage =\n | ShikiLanguageId\n | ShikiLanguageAlias\n | PlainTextLanguage;\n\n/**\n * A language name resolved to what Shiki actually needs to highlight it.\n */\nexport type ResolvedCodeLanguage = {\n /** Canonical language id to pass to `codeToHtml` / `codeToHast`. */\n id: ShikiLanguageId | PlainTextLanguage;\n /** Grammar loader, or `null` when the language needs no grammar. */\n loadGrammar: GrammarLoader | null;\n};\n\n/**\n * Resolve a code fence language name to a canonical Shiki id and its grammar\n * loader.\n *\n * Unknown names resolve to plain text rather than to an arbitrary grammar, so\n * that `codeToHtml` never receives a language it has not loaded.\n *\n * @param language - Language name coming from a code fence or a `lang` prop.\n *\n * @example\n * resolveCodeLanguage('ts'); // { id: 'typescript', loadGrammar: fn }\n * resolveCodeLanguage('toml'); // { id: 'toml', loadGrammar: fn }\n * resolveCodeLanguage('brainfuck'); // { id: 'plaintext', loadGrammar: null }\n */\nexport const resolveCodeLanguage = (\n language: CodeLanguage | string | undefined | null\n): ResolvedCodeLanguage => {\n const normalizedLanguage = (language ?? '').trim().toLowerCase();\n\n const canonicalId =\n grammarAliases[normalizedLanguage as ShikiLanguageAlias] ??\n (normalizedLanguage as ShikiLanguageId);\n\n const loadGrammar = grammarLoaders[canonicalId] as GrammarLoader | undefined;\n\n if (!loadGrammar) {\n return { id: PLAIN_TEXT_LANGUAGE, loadGrammar: null };\n }\n\n return { id: canonicalId, loadGrammar };\n};\n"],"mappings":";;;;;;;;AAkBA,MAAa,iBAAiB;CAC5B,aAAa,OAAO;CACpB,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,YAAY,OAAO;CACnB,kBAAkB,OAAO;CACzB,YAAY,OAAO;CACnB,aAAa,OAAO;CACpB,aAAa,OAAO;CACpB,gBAAgB,OAAO;CACvB,cAAc,OAAO;CACrB,WAAW,OAAO;CAClB,kBAAkB,OAAO;CACzB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,YAAY,OAAO;AA4BrB;;AAMA,MAAa,mBAAmB,OAAO,KACrC,cACF;;;;;AAMA,MAAa,iBAAiB;CAC5B,KAAK;CACL,SAAS;CACT,KAAK;CACL,YAAY;CACZ,KAAK;CACL,KAAK;CACL,IAAI;CACJ,OAAO;CACP,KAAK;CACL,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,SAAS;CACT,IAAI;CACJ,OAAO;CACP,aAAa;CACb,IAAI;CACJ,KAAK;CACL,KAAK;AACP;AAWA,MAAM,sBAAsB;;;;;;;;;;;;;;;AAgC5B,MAAa,uBACX,aACyB;CACzB,MAAM,sBAAsB,YAAY,GAAE,CAAE,KAAK,CAAC,CAAC,YAAY;CAE/D,MAAM,cACJ,eAAe,uBACd;CAEH,MAAM,cAAc,eAAe;CAEnC,IAAI,CAAC,aACH,OAAO;EAAE,IAAI;EAAqB,aAAa;CAAK;CAGtD,OAAO;EAAE,IAAI;EAAa;CAAY;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"shikiThemes.mjs","names":[],"sources":["../../../../src/components/IDE/shikiThemes.ts"],"sourcesContent":["/**\n * Themes every code block is highlighted with.\n *\n * Shiki is always asked for both, with `defaultColor: false`, so each token\n * carries its light and dark colour as the `--shiki-light` / `--shiki-dark`\n * custom properties rather than a resolved `color`. The markup is therefore\n * theme-agnostic: it can be produced once — at build time — and never has to be\n * recomputed in the browser when the resolved theme changes.\n */\nexport const SHIKI_THEMES = {\n light: 'github-light',\n dark: 'github-dark',\n} as const;\n\nexport type ShikiThemes = typeof SHIKI_THEMES;\n"],"mappings":";;;;;;;;;;AASA,MAAa,eAAe;CAC1B,OAAO;CACP,MAAM;AACR"}
1
+ {"version":3,"file":"shikiThemes.mjs","names":[],"sources":["../../../../src/components/IDE/shikiThemes.ts"],"sourcesContent":["/**\n * Themes every code block is highlighted with.\n *\n * Shiki is always asked for both, with `defaultColor: false`, so each token\n * carries its light and dark colour as the `--shiki-light` / `--shiki-dark`\n * custom properties rather than a resolved `color`. The markup is therefore\n * theme-agnostic: it can be produced once — at build time — and never has to be\n * recomputed in the browser when the resolved theme changes.\n */\nexport const SHIKI_THEMES = {\n light: 'github-light',\n dark: 'github-dark',\n} as const;\n\nexport type ShikiThemes = typeof SHIKI_THEMES;\n\n/** Every theme id the fine-grained Shiki bundle can resolve. */\nexport type ShikiThemeId = ShikiThemes[keyof ShikiThemes];\n"],"mappings":";;;;;;;;;;AASA,MAAa,eAAe;CAC1B,OAAO;CACP,MAAM;AACR"}
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
 
3
- import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
4
3
  import { Button } from "../Button/Button.mjs";
5
4
  import { Container } from "../Container/index.mjs";
6
5
  import { DropDown } from "../DropDown/index.mjs";
7
6
  import { Input } from "../Input/Input.mjs";
8
7
  import { SwitchSelector } from "../SwitchSelector/SwitchSelector.mjs";
8
+ import { usePersistedStore } from "../../hooks/usePersistedStore.mjs";
9
9
  import { useLocaleSwitcherContent } from "./LocaleSwitcherContentContext.mjs";
10
10
  import { useMemo, useRef, useState } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -100,13 +100,18 @@ const EmbeddedFrame = ({ src, title, className, frameProps }) => {
100
100
  "aria-label": title ?? "Play video",
101
101
  onClick: () => setIsPlayRequested(true),
102
102
  className: cn("group relative block cursor-pointer border-0 bg-card p-0", className),
103
- children: [/* @__PURE__ */ jsx("img", {
103
+ children: [/* @__PURE__ */ jsxs("picture", { children: [/* @__PURE__ */ jsx("source", {
104
+ srcSet: `https://i.ytimg.com/vi_webp/${youtubeVideoId}/hqdefault.webp`,
105
+ type: "image/webp"
106
+ }), /* @__PURE__ */ jsx("img", {
104
107
  src: `https://i.ytimg.com/vi/${youtubeVideoId}/hqdefault.jpg`,
105
108
  alt: "",
109
+ width: 480,
110
+ height: 360,
106
111
  fetchPriority: "high",
107
112
  decoding: "async",
108
113
  className: "size-full object-cover"
109
- }), /* @__PURE__ */ jsx("span", {
114
+ })] }), /* @__PURE__ */ jsx("span", {
110
115
  className: "absolute inset-0 flex items-center justify-center",
111
116
  children: /* @__PURE__ */ jsx("span", {
112
117
  className: "flex size-14 items-center justify-center rounded-full bg-text/70 text-text-opposite transition-transform group-hover:scale-110",
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownIframe.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownIframe.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '@components/Button';\nimport { Container } from '@components/Container';\nimport { Link } from '@components/Link';\nimport { Modal } from '@components/Modal';\nimport { cn } from '@utils/cn';\nimport { MoveDiagonal, Play } from 'lucide-react';\nimport {\n type ComponentProps,\n type FC,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nfunction embedLinkMeta(src: string | undefined): {\n href: string;\n label: string;\n} {\n if (!src) return { href: '', label: '' };\n if (/^https?:\\/\\//i.test(src)) {\n try {\n const url = new URL(src);\n return { href: url.href, label: url.host };\n } catch {\n return { href: src, label: src };\n }\n }\n return { href: src, label: src };\n}\n\n/**\n * Reads the video id out of a YouTube embed address.\n *\n * @returns The video id, or `null` when the address is not a YouTube embed.\n */\nconst getYoutubeVideoId = (src: string | undefined): string | null => {\n if (!src || !/^https?:\\/\\//i.test(src)) return null;\n\n try {\n const url = new URL(src);\n if (!/(^|\\.)youtube(-nocookie)?\\.com$/.test(url.hostname)) return null;\n\n const videoId = url.pathname.replace(/^\\/embed\\//, '').split('/')[0];\n\n return videoId || null;\n } catch {\n return null;\n }\n};\n\n/**\n * Tracks whether an element has come close enough to the viewport to be worth\n * loading.\n *\n * `loading=\"lazy\"` is not enough for embeds inside tabs or carousels: the\n * browser only defers frames that are far down the page, so a frame parked\n * off-screen by a transform — an inactive tab panel — still loads immediately.\n * A live-app embed costs upwards of a megabyte and seconds of main thread,\n * which is the whole page's performance budget spent on something nobody is\n * looking at.\n *\n * @returns A ref to attach to the placeholder, and whether it became visible.\n */\nconst useHasBecomeVisible = <ElementType extends HTMLElement>() => {\n const elementRef = useRef<ElementType>(null);\n const [hasBecomeVisible, setHasBecomeVisible] = useState(false);\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element || hasBecomeVisible) return;\n\n if (typeof IntersectionObserver === 'undefined') {\n setHasBecomeVisible(true);\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n setHasBecomeVisible(true);\n observer.disconnect();\n }\n },\n { rootMargin: '200px' }\n );\n\n observer.observe(element);\n\n return () => observer.disconnect();\n }, [hasBecomeVisible]);\n\n return { elementRef, hasBecomeVisible };\n};\n\ntype EmbeddedFrameProps = {\n src: string | undefined;\n title: string | undefined;\n className: string;\n frameProps: Omit<ComponentProps<'iframe'>, 'src' | 'title' | 'className'>;\n};\n\n/**\n * The embed itself: a poster for YouTube, deferred loading for anything else.\n *\n * A YouTube player pulls well over a megabyte of script before it can show a\n * single frame. Standing in for it with its own thumbnail until the reader\n * presses play keeps that cost on the readers who actually watch the video.\n */\nconst EmbeddedFrame: FC<EmbeddedFrameProps> = ({\n src,\n title,\n className,\n frameProps,\n}) => {\n const [isPlayRequested, setIsPlayRequested] = useState(false);\n const { elementRef, hasBecomeVisible } =\n useHasBecomeVisible<HTMLDivElement>();\n const youtubeVideoId = getYoutubeVideoId(src);\n\n if (youtubeVideoId && !isPlayRequested) {\n return (\n <button\n type=\"button\"\n aria-label={title ?? 'Play video'}\n onClick={() => setIsPlayRequested(true)}\n className={cn(\n 'group relative block cursor-pointer border-0 bg-card p-0',\n className\n )}\n >\n {/*\n * The poster stands in for the player, so on a page that opens with a\n * video it is the largest element painted — deferring it would defer\n * the page's LCP. It is the one image here worth fetching eagerly.\n */}\n <img\n src={`https://i.ytimg.com/vi/${youtubeVideoId}/hqdefault.jpg`}\n alt=\"\"\n fetchPriority=\"high\"\n decoding=\"async\"\n className=\"size-full object-cover\"\n />\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"flex size-14 items-center justify-center rounded-full bg-text/70 text-text-opposite transition-transform group-hover:scale-110\">\n <Play className=\"size-6 translate-x-0.5 fill-current\" />\n </span>\n </span>\n </button>\n );\n }\n\n if (!hasBecomeVisible && !isPlayRequested) {\n // Same box as the frame it stands in for, so nothing shifts once it loads.\n return <div ref={elementRef} aria-hidden className={className} />;\n }\n\n const frameSrc = (() => {\n if (!isPlayRequested || !youtubeVideoId || !src) return src;\n\n const playbackSrc = new URL(src);\n playbackSrc.searchParams.set('autoplay', '1');\n\n return playbackSrc.href;\n })();\n\n return (\n <iframe\n {...frameProps}\n src={frameSrc}\n title={title}\n loading=\"lazy\"\n className={className}\n />\n );\n};\n\nexport const MarkDownIframe: FC<ComponentProps<'iframe'>> = (props) => {\n const { src, className, title, ...rest } = props;\n const [isModalOpen, setIsModalOpen] = useState(false);\n const { href, label } = embedLinkMeta(src);\n\n return (\n <Container\n roundedSize=\"2xl\"\n border\n borderColor=\"neutral\"\n className=\"overflow-hidden p-0\"\n gap=\"none\"\n >\n <EmbeddedFrame\n src={src}\n title={title}\n frameProps={rest}\n className={cn(\n 'block max-h-[80vh] min-h-[12rem] w-full border-0',\n className\n )}\n />\n <div className=\"flex items-center justify-between gap-3 px-3 py-1\">\n {href ? (\n <Link\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n label=\"\"\n color=\"neutral\"\n className=\"inline-flex min-w-0 max-w-[calc(100%-3rem)] items-center gap-2 text-muted-foreground text-xs underline-offset-2 hover:text-foreground hover:underline\"\n >\n {label}\n </Link>\n ) : (\n <span className=\"text-neutral text-sm\">Embedded frame</span>\n )}\n <Button\n variant=\"hoverable\"\n size=\"icon-md\"\n onClick={() => setIsModalOpen(true)}\n label=\"Open embedded page in fullscreen\"\n Icon={MoveDiagonal}\n />\n </div>\n\n <Modal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n size=\"unset\"\n hasCloseButton\n isScrollable\n padding=\"sm\"\n >\n {isModalOpen && src ? (\n <Container\n roundedSize=\"2xl\"\n border\n borderColor=\"neutral\"\n className=\"overflow-hidden p-0\"\n gap=\"none\"\n >\n <iframe\n {...rest}\n src={src}\n title={title ?? 'Embedded content'}\n allowFullScreen\n className=\"block min-h-[82vh] w-full border-0\"\n />\n </Container>\n ) : null}\n </Modal>\n </Container>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,cAAc,KAGrB;CACA,IAAI,CAAC,KAAK,OAAO;EAAE,MAAM;EAAI,OAAO;CAAG;CACvC,IAAI,gBAAgB,KAAK,GAAG,GAC1B,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,GAAG;EACvB,OAAO;GAAE,MAAM,IAAI;GAAM,OAAO,IAAI;EAAK;CAC3C,QAAQ;EACN,OAAO;GAAE,MAAM;GAAK,OAAO;EAAI;CACjC;CAEF,OAAO;EAAE,MAAM;EAAK,OAAO;CAAI;AACjC;;;;;;AAOA,MAAM,qBAAqB,QAA2C;CACpE,IAAI,CAAC,OAAO,CAAC,gBAAgB,KAAK,GAAG,GAAG,OAAO;CAE/C,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,GAAG;EACvB,IAAI,CAAC,kCAAkC,KAAK,IAAI,QAAQ,GAAG,OAAO;EAIlE,OAFgB,IAAI,SAAS,QAAQ,cAAc,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAEhD;CACpB,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;;;;;;AAeA,MAAM,4BAA6D;CACjE,MAAM,aAAa,OAAoB,IAAI;CAC3C,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,KAAK;CAE9D,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,WAAW,kBAAkB;EAElC,IAAI,OAAO,yBAAyB,aAAa;GAC/C,oBAAoB,IAAI;GACxB;EACF;EAEA,MAAM,WAAW,IAAI,sBAClB,YAAY;GACX,IAAI,QAAQ,MAAM,UAAU,MAAM,cAAc,GAAG;IACjD,oBAAoB,IAAI;IACxB,SAAS,WAAW;GACtB;EACF,GACA,EAAE,YAAY,QAAQ,CACxB;EAEA,SAAS,QAAQ,OAAO;EAExB,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,gBAAgB,CAAC;CAErB,OAAO;EAAE;EAAY;CAAiB;AACxC;;;;;;;;AAgBA,MAAM,iBAAyC,EAC7C,KACA,OACA,WACA,iBACI;CACJ,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,KAAK;CAC5D,MAAM,EAAE,YAAY,qBAClB,oBAAoC;CACtC,MAAM,iBAAiB,kBAAkB,GAAG;CAE5C,IAAI,kBAAkB,CAAC,iBACrB,OACE,qBAAC,UAAD;EACE,MAAK;EACL,cAAY,SAAS;EACrB,eAAe,mBAAmB,IAAI;EACtC,WAAW,GACT,4DACA,SACF;YAPF,CAcE,oBAAC,OAAD;GACE,KAAK,0BAA0B,eAAe;GAC9C,KAAI;GACJ,eAAc;GACd,UAAS;GACT,WAAU;EACX,IACD,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,QAAD;IAAM,WAAU;cACd,oBAAC,MAAD,EAAM,WAAU,sCAAuC;GACnD;EACF,EACA;;CAIZ,IAAI,CAAC,oBAAoB,CAAC,iBAExB,OAAO,oBAAC,OAAD;EAAK,KAAK;EAAY;EAAuB;CAAY;CAGlE,MAAM,kBAAkB;EACtB,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,OAAO;EAExD,MAAM,cAAc,IAAI,IAAI,GAAG;EAC/B,YAAY,aAAa,IAAI,YAAY,GAAG;EAE5C,OAAO,YAAY;CACrB,EAAC,CAAE;CAEH,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,KAAK;EACE;EACP,SAAQ;EACG;CACZ;AAEL;AAEA,MAAa,kBAAgD,UAAU;CACrE,MAAM,EAAE,KAAK,WAAW,OAAO,GAAG,SAAS;CAC3C,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,MAAM,UAAU,cAAc,GAAG;CAEzC,OACE,qBAAC,WAAD;EACE,aAAY;EACZ;EACA,aAAY;EACZ,WAAU;EACV,KAAI;YALN;GAOE,oBAAC,eAAD;IACO;IACE;IACP,YAAY;IACZ,WAAW,GACT,oDACA,SACF;GACD;GACD,qBAAC,OAAD;IAAK,WAAU;cAAf,CACG,OACC,oBAAC,MAAD;KACQ;KACN,QAAO;KACP,KAAI;KACJ,OAAM;KACN,OAAM;KACN,WAAU;eAET;IACG,KAEN,oBAAC,QAAD;KAAM,WAAU;eAAuB;IAAoB,IAE7D,oBAAC,QAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,eAAe,IAAI;KAClC,OAAM;KACN,MAAM;IACP,EACE;;GAEL,oBAAC,OAAD;IACE,QAAQ;IACR,eAAe,eAAe,KAAK;IACnC,MAAK;IACL;IACA;IACA,SAAQ;cAEP,eAAe,MACd,oBAAC,WAAD;KACE,aAAY;KACZ;KACA,aAAY;KACZ,WAAU;KACV,KAAI;eAEJ,oBAAC,UAAD;MACE,GAAI;MACC;MACL,OAAO,SAAS;MAChB;MACA,WAAU;KACX;IACQ,KACT;GACC;EACE;;AAEf"}
1
+ {"version":3,"file":"MarkDownIframe.mjs","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownIframe.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '@components/Button';\nimport { Container } from '@components/Container';\nimport { Link } from '@components/Link';\nimport { Modal } from '@components/Modal';\nimport { cn } from '@utils/cn';\nimport { MoveDiagonal, Play } from 'lucide-react';\nimport {\n type ComponentProps,\n type FC,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nfunction embedLinkMeta(src: string | undefined): {\n href: string;\n label: string;\n} {\n if (!src) return { href: '', label: '' };\n if (/^https?:\\/\\//i.test(src)) {\n try {\n const url = new URL(src);\n return { href: url.href, label: url.host };\n } catch {\n return { href: src, label: src };\n }\n }\n return { href: src, label: src };\n}\n\n/**\n * Reads the video id out of a YouTube embed address.\n *\n * @returns The video id, or `null` when the address is not a YouTube embed.\n */\nconst getYoutubeVideoId = (src: string | undefined): string | null => {\n if (!src || !/^https?:\\/\\//i.test(src)) return null;\n\n try {\n const url = new URL(src);\n if (!/(^|\\.)youtube(-nocookie)?\\.com$/.test(url.hostname)) return null;\n\n const videoId = url.pathname.replace(/^\\/embed\\//, '').split('/')[0];\n\n return videoId || null;\n } catch {\n return null;\n }\n};\n\n/**\n * Tracks whether an element has come close enough to the viewport to be worth\n * loading.\n *\n * `loading=\"lazy\"` is not enough for embeds inside tabs or carousels: the\n * browser only defers frames that are far down the page, so a frame parked\n * off-screen by a transform — an inactive tab panel — still loads immediately.\n * A live-app embed costs upwards of a megabyte and seconds of main thread,\n * which is the whole page's performance budget spent on something nobody is\n * looking at.\n *\n * @returns A ref to attach to the placeholder, and whether it became visible.\n */\nconst useHasBecomeVisible = <ElementType extends HTMLElement>() => {\n const elementRef = useRef<ElementType>(null);\n const [hasBecomeVisible, setHasBecomeVisible] = useState(false);\n\n useEffect(() => {\n const element = elementRef.current;\n if (!element || hasBecomeVisible) return;\n\n if (typeof IntersectionObserver === 'undefined') {\n setHasBecomeVisible(true);\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n setHasBecomeVisible(true);\n observer.disconnect();\n }\n },\n { rootMargin: '200px' }\n );\n\n observer.observe(element);\n\n return () => observer.disconnect();\n }, [hasBecomeVisible]);\n\n return { elementRef, hasBecomeVisible };\n};\n\ntype EmbeddedFrameProps = {\n src: string | undefined;\n title: string | undefined;\n className: string;\n frameProps: Omit<ComponentProps<'iframe'>, 'src' | 'title' | 'className'>;\n};\n\n/**\n * The embed itself: a poster for YouTube, deferred loading for anything else.\n *\n * A YouTube player pulls well over a megabyte of script before it can show a\n * single frame. Standing in for it with its own thumbnail until the reader\n * presses play keeps that cost on the readers who actually watch the video.\n */\nconst EmbeddedFrame: FC<EmbeddedFrameProps> = ({\n src,\n title,\n className,\n frameProps,\n}) => {\n const [isPlayRequested, setIsPlayRequested] = useState(false);\n const { elementRef, hasBecomeVisible } =\n useHasBecomeVisible<HTMLDivElement>();\n const youtubeVideoId = getYoutubeVideoId(src);\n\n if (youtubeVideoId && !isPlayRequested) {\n return (\n <button\n type=\"button\"\n aria-label={title ?? 'Play video'}\n onClick={() => setIsPlayRequested(true)}\n className={cn(\n 'group relative block cursor-pointer border-0 bg-card p-0',\n className\n )}\n >\n {/*\n * The poster stands in for the player, so on a page that opens with a\n * video it is the largest element painted — deferring it would defer\n * the page's LCP. It is the one image here worth fetching eagerly.\n */}\n <picture>\n {/*\n * YouTube serves the same poster as WebP under `vi_webp`, at roughly\n * a third of the JPEG's weight. The `img` below stays as the\n * fallback for the browsers that cannot decode it.\n */}\n <source\n srcSet={`https://i.ytimg.com/vi_webp/${youtubeVideoId}/hqdefault.webp`}\n type=\"image/webp\"\n />\n <img\n src={`https://i.ytimg.com/vi/${youtubeVideoId}/hqdefault.jpg`}\n alt=\"\"\n width={480}\n height={360}\n fetchPriority=\"high\"\n decoding=\"async\"\n className=\"size-full object-cover\"\n />\n </picture>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"flex size-14 items-center justify-center rounded-full bg-text/70 text-text-opposite transition-transform group-hover:scale-110\">\n <Play className=\"size-6 translate-x-0.5 fill-current\" />\n </span>\n </span>\n </button>\n );\n }\n\n if (!hasBecomeVisible && !isPlayRequested) {\n // Same box as the frame it stands in for, so nothing shifts once it loads.\n return <div ref={elementRef} aria-hidden className={className} />;\n }\n\n const frameSrc = (() => {\n if (!isPlayRequested || !youtubeVideoId || !src) return src;\n\n const playbackSrc = new URL(src);\n playbackSrc.searchParams.set('autoplay', '1');\n\n return playbackSrc.href;\n })();\n\n return (\n <iframe\n {...frameProps}\n src={frameSrc}\n title={title}\n loading=\"lazy\"\n className={className}\n />\n );\n};\n\nexport const MarkDownIframe: FC<ComponentProps<'iframe'>> = (props) => {\n const { src, className, title, ...rest } = props;\n const [isModalOpen, setIsModalOpen] = useState(false);\n const { href, label } = embedLinkMeta(src);\n\n return (\n <Container\n roundedSize=\"2xl\"\n border\n borderColor=\"neutral\"\n className=\"overflow-hidden p-0\"\n gap=\"none\"\n >\n <EmbeddedFrame\n src={src}\n title={title}\n frameProps={rest}\n className={cn(\n 'block max-h-[80vh] min-h-[12rem] w-full border-0',\n className\n )}\n />\n <div className=\"flex items-center justify-between gap-3 px-3 py-1\">\n {href ? (\n <Link\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n label=\"\"\n color=\"neutral\"\n className=\"inline-flex min-w-0 max-w-[calc(100%-3rem)] items-center gap-2 text-muted-foreground text-xs underline-offset-2 hover:text-foreground hover:underline\"\n >\n {label}\n </Link>\n ) : (\n <span className=\"text-neutral text-sm\">Embedded frame</span>\n )}\n <Button\n variant=\"hoverable\"\n size=\"icon-md\"\n onClick={() => setIsModalOpen(true)}\n label=\"Open embedded page in fullscreen\"\n Icon={MoveDiagonal}\n />\n </div>\n\n <Modal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n size=\"unset\"\n hasCloseButton\n isScrollable\n padding=\"sm\"\n >\n {isModalOpen && src ? (\n <Container\n roundedSize=\"2xl\"\n border\n borderColor=\"neutral\"\n className=\"overflow-hidden p-0\"\n gap=\"none\"\n >\n <iframe\n {...rest}\n src={src}\n title={title ?? 'Embedded content'}\n allowFullScreen\n className=\"block min-h-[82vh] w-full border-0\"\n />\n </Container>\n ) : null}\n </Modal>\n </Container>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,cAAc,KAGrB;CACA,IAAI,CAAC,KAAK,OAAO;EAAE,MAAM;EAAI,OAAO;CAAG;CACvC,IAAI,gBAAgB,KAAK,GAAG,GAC1B,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,GAAG;EACvB,OAAO;GAAE,MAAM,IAAI;GAAM,OAAO,IAAI;EAAK;CAC3C,QAAQ;EACN,OAAO;GAAE,MAAM;GAAK,OAAO;EAAI;CACjC;CAEF,OAAO;EAAE,MAAM;EAAK,OAAO;CAAI;AACjC;;;;;;AAOA,MAAM,qBAAqB,QAA2C;CACpE,IAAI,CAAC,OAAO,CAAC,gBAAgB,KAAK,GAAG,GAAG,OAAO;CAE/C,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,GAAG;EACvB,IAAI,CAAC,kCAAkC,KAAK,IAAI,QAAQ,GAAG,OAAO;EAIlE,OAFgB,IAAI,SAAS,QAAQ,cAAc,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAEhD;CACpB,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;;;;;;AAeA,MAAM,4BAA6D;CACjE,MAAM,aAAa,OAAoB,IAAI;CAC3C,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,KAAK;CAE9D,gBAAgB;EACd,MAAM,UAAU,WAAW;EAC3B,IAAI,CAAC,WAAW,kBAAkB;EAElC,IAAI,OAAO,yBAAyB,aAAa;GAC/C,oBAAoB,IAAI;GACxB;EACF;EAEA,MAAM,WAAW,IAAI,sBAClB,YAAY;GACX,IAAI,QAAQ,MAAM,UAAU,MAAM,cAAc,GAAG;IACjD,oBAAoB,IAAI;IACxB,SAAS,WAAW;GACtB;EACF,GACA,EAAE,YAAY,QAAQ,CACxB;EAEA,SAAS,QAAQ,OAAO;EAExB,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,gBAAgB,CAAC;CAErB,OAAO;EAAE;EAAY;CAAiB;AACxC;;;;;;;;AAgBA,MAAM,iBAAyC,EAC7C,KACA,OACA,WACA,iBACI;CACJ,MAAM,CAAC,iBAAiB,sBAAsB,SAAS,KAAK;CAC5D,MAAM,EAAE,YAAY,qBAClB,oBAAoC;CACtC,MAAM,iBAAiB,kBAAkB,GAAG;CAE5C,IAAI,kBAAkB,CAAC,iBACrB,OACE,qBAAC,UAAD;EACE,MAAK;EACL,cAAY,SAAS;EACrB,eAAe,mBAAmB,IAAI;EACtC,WAAW,GACT,4DACA,SACF;YAPF,CAcE,qBAAC,WAAD,aAME,oBAAC,UAAD;GACE,QAAQ,+BAA+B,eAAe;GACtD,MAAK;EACN,IACD,oBAAC,OAAD;GACE,KAAK,0BAA0B,eAAe;GAC9C,KAAI;GACJ,OAAO;GACP,QAAQ;GACR,eAAc;GACd,UAAS;GACT,WAAU;EACX,EACM,MACT,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,QAAD;IAAM,WAAU;cACd,oBAAC,MAAD,EAAM,WAAU,sCAAuC;GACnD;EACF,EACA;;CAIZ,IAAI,CAAC,oBAAoB,CAAC,iBAExB,OAAO,oBAAC,OAAD;EAAK,KAAK;EAAY;EAAuB;CAAY;CAGlE,MAAM,kBAAkB;EACtB,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,OAAO;EAExD,MAAM,cAAc,IAAI,IAAI,GAAG;EAC/B,YAAY,aAAa,IAAI,YAAY,GAAG;EAE5C,OAAO,YAAY;CACrB,EAAC,CAAE;CAEH,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,KAAK;EACE;EACP,SAAQ;EACG;CACZ;AAEL;AAEA,MAAa,kBAAgD,UAAU;CACrE,MAAM,EAAE,KAAK,WAAW,OAAO,GAAG,SAAS;CAC3C,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,EAAE,MAAM,UAAU,cAAc,GAAG;CAEzC,OACE,qBAAC,WAAD;EACE,aAAY;EACZ;EACA,aAAY;EACZ,WAAU;EACV,KAAI;YALN;GAOE,oBAAC,eAAD;IACO;IACE;IACP,YAAY;IACZ,WAAW,GACT,oDACA,SACF;GACD;GACD,qBAAC,OAAD;IAAK,WAAU;cAAf,CACG,OACC,oBAAC,MAAD;KACQ;KACN,QAAO;KACP,KAAI;KACJ,OAAM;KACN,OAAM;KACN,WAAU;eAET;IACG,KAEN,oBAAC,QAAD;KAAM,WAAU;eAAuB;IAAoB,IAE7D,oBAAC,QAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,eAAe,IAAI;KAClC,OAAM;KACN,MAAM;IACP,EACE;;GAEL,oBAAC,OAAD;IACE,QAAQ;IACR,eAAe,eAAe,KAAK;IACnC,MAAK;IACL;IACA;IACA,SAAQ;cAEP,eAAe,MACd,oBAAC,WAAD;KACE,aAAY;KACZ;KACA,aAAY;KACZ,WAAU;KACV,KAAI;eAEJ,oBAAC,UAAD;MACE,GAAI;MACC;MACL,OAAO,SAAS;MAChB;MACA,WAAU;KACX;IACQ,KACT;GACC;EACE;;AAEf"}
@@ -1,10 +1,10 @@
1
1
  import CustomKeymap from "./novel/extensions/custom-keymap.mjs";
2
2
  import UpdatedImage from "./novel/extensions/updated-image.mjs";
3
3
  import { AIHighlight } from "./novel/extensions/ai-highlight.mjs";
4
+ import { CodeBlockShiki } from "./novel/extensions/code-block-shiki.mjs";
4
5
  import { CharacterCount, Color, GlobalDragHandle, HighlightExtension, HorizontalRule as Horizontal, MarkdownExtension, Placeholder as PlaceholderExtension, StarterKit, TaskItem, TaskList, TextStyle, TiptapImage, TiptapLink, TiptapUnderline, Youtube } from "./novel/extensions/index.mjs";
5
6
  import { UploadImagesPlugin } from "./novel/plugins/upload-images.mjs";
6
7
  import { cx } from "class-variance-authority";
7
- import { CodeBlockShiki } from "tiptap-extension-code-block-shiki";
8
8
 
9
9
  //#region src/components/MarkdownEditor/extensions.ts
10
10
  const aiHighlight = AIHighlight;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.mjs","names":["HorizontalRule","Placeholder"],"sources":["../../../../src/components/MarkdownEditor/extensions.ts"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport { CodeBlockShiki } from 'tiptap-extension-code-block-shiki';\nimport {\n AIHighlight,\n CharacterCount,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n MarkdownExtension,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n UpdatedImage,\n UploadImagesPlugin,\n Youtube,\n} from './novel';\n\nconst aiHighlight = AIHighlight;\n\nconst tiptapLink = TiptapLink.configure({\n HTMLAttributes: {\n class: cx(\n 'text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer'\n ),\n },\n});\n\nconst tiptapImage = TiptapImage.extend({\n addProseMirrorPlugins() {\n return [\n UploadImagesPlugin({\n imageClass: cx('opacity-40 rounded-lg border border-stone-200'),\n }),\n ];\n },\n}).configure({\n allowBase64: true,\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n});\n\nconst updatedImage = UpdatedImage.configure({\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n});\n\nconst taskList = TaskList.configure({\n HTMLAttributes: {\n class: cx('not-prose pl-2'),\n },\n});\n\nconst taskItem = TaskItem.configure({\n HTMLAttributes: {\n class: cx('flex gap-2 items-start my-4'),\n },\n nested: true,\n});\n\nconst horizontalRule = HorizontalRule.configure({\n HTMLAttributes: {\n class: cx('mt-4 mb-6 border-t border-muted-foreground'),\n },\n});\n\nconst starterKit = StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n class: cx('list-disc list-outside leading-3 -mt-2'),\n },\n },\n orderedList: {\n HTMLAttributes: {\n class: cx('list-decimal list-outside leading-3 -mt-2'),\n },\n },\n listItem: {\n HTMLAttributes: {\n class: cx('leading-normal -mb-2'),\n },\n },\n blockquote: {\n HTMLAttributes: {\n class: cx('border-l-4 border-primary'),\n },\n },\n // Disabled in favor of the shiki-powered `codeBlock` extension below.\n codeBlock: false,\n code: {\n HTMLAttributes: {\n class: cx('rounded-md bg-muted px-1.5 py-1 font-mono font-medium'),\n spellcheck: 'false',\n },\n },\n horizontalRule: false,\n dropcursor: {\n color: '#DBEAFE',\n width: 4,\n },\n gapcursor: false,\n});\n\n/**\n * Code block with syntax highlighting powered by shiki (the same highlighter\n * the rest of the design-system uses in `IDE/CodeBlockShiki` and\n * `MarkDownRender`). Languages are lazy-loaded on demand and the dual\n * `github-light` / `github-dark` themes emit `--shiki-dark` CSS variables that\n * `markdown-editor.css` toggles under `[data-theme=\"dark\"]`.\n */\nconst codeBlock = CodeBlockShiki.configure({\n defaultLanguage: null,\n defaultTheme: 'github-light',\n themes: {\n light: 'github-light',\n dark: 'github-dark',\n },\n HTMLAttributes: {\n class: cx(\n 'rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium'\n ),\n },\n});\n\nconst youtube = Youtube.configure({\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n inline: false,\n});\n\nconst characterCount = CharacterCount.configure();\n\nconst markdownExtension = MarkdownExtension.configure({\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\n});\n\n/**\n * Default Tiptap/Novel extensions powering the MarkdownEditor.\n *\n * The slash-command extension is intentionally not included here because it\n * needs a runtime image-upload handler; it is appended by the editor itself.\n */\nexport const defaultExtensions = [\n starterKit,\n Placeholder,\n tiptapLink,\n tiptapImage,\n updatedImage,\n taskList,\n taskItem,\n horizontalRule,\n aiHighlight,\n codeBlock,\n youtube,\n characterCount,\n TiptapUnderline,\n markdownExtension,\n HighlightExtension,\n TextStyle,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n];\n"],"mappings":";;;;;;;;;AAwBA,MAAM,cAAc;AAEpB,MAAM,aAAa,WAAW,UAAU,EACtC,gBAAgB,EACd,OAAO,GACL,4GACF,EACF,EACF,CAAC;AAED,MAAM,cAAc,YAAY,OAAO,EACrC,wBAAwB;CACtB,OAAO,CACL,mBAAmB,EACjB,YAAY,GAAG,+CAA+C,EAChE,CAAC,CACH;AACF,EACF,CAAC,CAAC,CAAC,UAAU;CACX,aAAa;CACb,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C;AACF,CAAC;AAED,MAAM,eAAe,aAAa,UAAU,EAC1C,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C,EACF,CAAC;AAED,MAAM,WAAW,SAAS,UAAU,EAClC,gBAAgB,EACd,OAAO,GAAG,gBAAgB,EAC5B,EACF,CAAC;AAED,MAAM,WAAW,SAAS,UAAU;CAClC,gBAAgB,EACd,OAAO,GAAG,6BAA6B,EACzC;CACA,QAAQ;AACV,CAAC;AAED,MAAM,iBAAiBA,WAAe,UAAU,EAC9C,gBAAgB,EACd,OAAO,GAAG,4CAA4C,EACxD,EACF,CAAC;AAED,MAAM,aAAa,WAAW,UAAU;CACtC,YAAY,EACV,gBAAgB,EACd,OAAO,GAAG,wCAAwC,EACpD,EACF;CACA,aAAa,EACX,gBAAgB,EACd,OAAO,GAAG,2CAA2C,EACvD,EACF;CACA,UAAU,EACR,gBAAgB,EACd,OAAO,GAAG,sBAAsB,EAClC,EACF;CACA,YAAY,EACV,gBAAgB,EACd,OAAO,GAAG,2BAA2B,EACvC,EACF;CAEA,WAAW;CACX,MAAM,EACJ,gBAAgB;EACd,OAAO,GAAG,uDAAuD;EACjE,YAAY;CACd,EACF;CACA,gBAAgB;CAChB,YAAY;EACV,OAAO;EACP,OAAO;CACT;CACA,WAAW;AACb,CAAC;;;;;;;;AASD,MAAM,YAAY,eAAe,UAAU;CACzC,iBAAiB;CACjB,cAAc;CACd,QAAQ;EACN,OAAO;EACP,MAAM;CACR;CACA,gBAAgB,EACd,OAAO,GACL,4EACF,EACF;AACF,CAAC;AAED,MAAM,UAAU,QAAQ,UAAU;CAChC,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C;CACA,QAAQ;AACV,CAAC;AAED,MAAM,iBAAiB,eAAe,UAAU;AAEhD,MAAM,oBAAoB,kBAAkB,UAAU;CACpD,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;CAClB,SAAS;CACT,QAAQ;CACR,qBAAqB;CACrB,qBAAqB;AACvB,CAAC;;;;;;;AAQD,MAAa,oBAAoB;CAC/B;CACAC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"extensions.mjs","names":["HorizontalRule","Placeholder"],"sources":["../../../../src/components/MarkdownEditor/extensions.ts"],"sourcesContent":["import { cx } from 'class-variance-authority';\nimport {\n AIHighlight,\n CharacterCount,\n CodeBlockShiki,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n MarkdownExtension,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n UpdatedImage,\n UploadImagesPlugin,\n Youtube,\n} from './novel';\n\nconst aiHighlight = AIHighlight;\n\nconst tiptapLink = TiptapLink.configure({\n HTMLAttributes: {\n class: cx(\n 'text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer'\n ),\n },\n});\n\nconst tiptapImage = TiptapImage.extend({\n addProseMirrorPlugins() {\n return [\n UploadImagesPlugin({\n imageClass: cx('opacity-40 rounded-lg border border-stone-200'),\n }),\n ];\n },\n}).configure({\n allowBase64: true,\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n});\n\nconst updatedImage = UpdatedImage.configure({\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n});\n\nconst taskList = TaskList.configure({\n HTMLAttributes: {\n class: cx('not-prose pl-2'),\n },\n});\n\nconst taskItem = TaskItem.configure({\n HTMLAttributes: {\n class: cx('flex gap-2 items-start my-4'),\n },\n nested: true,\n});\n\nconst horizontalRule = HorizontalRule.configure({\n HTMLAttributes: {\n class: cx('mt-4 mb-6 border-t border-muted-foreground'),\n },\n});\n\nconst starterKit = StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n class: cx('list-disc list-outside leading-3 -mt-2'),\n },\n },\n orderedList: {\n HTMLAttributes: {\n class: cx('list-decimal list-outside leading-3 -mt-2'),\n },\n },\n listItem: {\n HTMLAttributes: {\n class: cx('leading-normal -mb-2'),\n },\n },\n blockquote: {\n HTMLAttributes: {\n class: cx('border-l-4 border-primary'),\n },\n },\n // Disabled in favor of the shiki-powered `codeBlock` extension below.\n codeBlock: false,\n code: {\n HTMLAttributes: {\n class: cx('rounded-md bg-muted px-1.5 py-1 font-mono font-medium'),\n spellcheck: 'false',\n },\n },\n horizontalRule: false,\n dropcursor: {\n color: '#DBEAFE',\n width: 4,\n },\n gapcursor: false,\n});\n\n/**\n * Code block with syntax highlighting powered by shiki (the same highlighter\n * the rest of the design-system uses in `IDE/CodeBlockShiki` and\n * `MarkDownRender`). Languages are lazy-loaded on demand and the dual\n * `github-light` / `github-dark` themes emit `--shiki-dark` CSS variables that\n * `markdown-editor.css` toggles under `[data-theme=\"dark\"]`.\n */\nconst codeBlock = CodeBlockShiki.configure({\n defaultLanguage: null,\n defaultTheme: 'github-light',\n themes: {\n light: 'github-light',\n dark: 'github-dark',\n },\n HTMLAttributes: {\n class: cx(\n 'rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium'\n ),\n },\n});\n\nconst youtube = Youtube.configure({\n HTMLAttributes: {\n class: cx('rounded-lg border border-muted'),\n },\n inline: false,\n});\n\nconst characterCount = CharacterCount.configure();\n\nconst markdownExtension = MarkdownExtension.configure({\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\n});\n\n/**\n * Default Tiptap/Novel extensions powering the MarkdownEditor.\n *\n * The slash-command extension is intentionally not included here because it\n * needs a runtime image-upload handler; it is appended by the editor itself.\n */\nexport const defaultExtensions = [\n starterKit,\n Placeholder,\n tiptapLink,\n tiptapImage,\n updatedImage,\n taskList,\n taskItem,\n horizontalRule,\n aiHighlight,\n codeBlock,\n youtube,\n characterCount,\n TiptapUnderline,\n markdownExtension,\n HighlightExtension,\n TextStyle,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n];\n"],"mappings":";;;;;;;;;AAwBA,MAAM,cAAc;AAEpB,MAAM,aAAa,WAAW,UAAU,EACtC,gBAAgB,EACd,OAAO,GACL,4GACF,EACF,EACF,CAAC;AAED,MAAM,cAAc,YAAY,OAAO,EACrC,wBAAwB;CACtB,OAAO,CACL,mBAAmB,EACjB,YAAY,GAAG,+CAA+C,EAChE,CAAC,CACH;AACF,EACF,CAAC,CAAC,CAAC,UAAU;CACX,aAAa;CACb,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C;AACF,CAAC;AAED,MAAM,eAAe,aAAa,UAAU,EAC1C,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C,EACF,CAAC;AAED,MAAM,WAAW,SAAS,UAAU,EAClC,gBAAgB,EACd,OAAO,GAAG,gBAAgB,EAC5B,EACF,CAAC;AAED,MAAM,WAAW,SAAS,UAAU;CAClC,gBAAgB,EACd,OAAO,GAAG,6BAA6B,EACzC;CACA,QAAQ;AACV,CAAC;AAED,MAAM,iBAAiBA,WAAe,UAAU,EAC9C,gBAAgB,EACd,OAAO,GAAG,4CAA4C,EACxD,EACF,CAAC;AAED,MAAM,aAAa,WAAW,UAAU;CACtC,YAAY,EACV,gBAAgB,EACd,OAAO,GAAG,wCAAwC,EACpD,EACF;CACA,aAAa,EACX,gBAAgB,EACd,OAAO,GAAG,2CAA2C,EACvD,EACF;CACA,UAAU,EACR,gBAAgB,EACd,OAAO,GAAG,sBAAsB,EAClC,EACF;CACA,YAAY,EACV,gBAAgB,EACd,OAAO,GAAG,2BAA2B,EACvC,EACF;CAEA,WAAW;CACX,MAAM,EACJ,gBAAgB;EACd,OAAO,GAAG,uDAAuD;EACjE,YAAY;CACd,EACF;CACA,gBAAgB;CAChB,YAAY;EACV,OAAO;EACP,OAAO;CACT;CACA,WAAW;AACb,CAAC;;;;;;;;AASD,MAAM,YAAY,eAAe,UAAU;CACzC,iBAAiB;CACjB,cAAc;CACd,QAAQ;EACN,OAAO;EACP,MAAM;CACR;CACA,gBAAgB,EACd,OAAO,GACL,4EACF,EACF;AACF,CAAC;AAED,MAAM,UAAU,QAAQ,UAAU;CAChC,gBAAgB,EACd,OAAO,GAAG,gCAAgC,EAC5C;CACA,QAAQ;AACV,CAAC;AAED,MAAM,iBAAiB,eAAe,UAAU;AAEhD,MAAM,oBAAoB,kBAAkB,UAAU;CACpD,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,kBAAkB;CAClB,SAAS;CACT,QAAQ;CACR,qBAAqB;CACrB,qBAAqB;AACvB,CAAC;;;;;;;AAQD,MAAa,oBAAoB;CAC/B;CACAC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}