@svadmin/ai-elements 0.5.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +18 -53
  2. package/THIRD_PARTY_NOTICES.md +67 -6
  3. package/dist/ai.css +149 -2740
  4. package/dist/ai.theme.css +1 -2771
  5. package/dist/class-properties.generated.d.ts +1 -0
  6. package/dist/class-properties.generated.js +2 -0
  7. package/dist/classnames.d.ts +8 -0
  8. package/dist/classnames.js +26 -0
  9. package/dist/components/AICommandBar.svelte +6 -4
  10. package/dist/components/ChatDialog.svelte +102 -125
  11. package/dist/components/ChatDialog.svelte.d.ts +3 -9
  12. package/dist/components/Conversation.svelte +34 -10
  13. package/dist/components/ConversationContent.svelte +1 -1
  14. package/dist/components/ConversationScrollButton.svelte +0 -1
  15. package/dist/components/CopilotPanel.svelte +8 -6
  16. package/dist/components/Message.svelte +1 -1
  17. package/dist/components/MessageActions.svelte +1 -1
  18. package/dist/components/MessageContent.svelte +1 -1
  19. package/dist/components/MessageToolbar.svelte +1 -1
  20. package/dist/components/Response.svelte +32 -12
  21. package/dist/components/Response.svelte.d.ts +3 -3
  22. package/dist/components/Tool.svelte +13 -13
  23. package/dist/components/Tool.svelte.d.ts +1 -1
  24. package/dist/components/action/Action.svelte +3 -1
  25. package/dist/components/artifact/ArtifactAction.svelte +3 -1
  26. package/dist/components/attachments/Attachment.svelte +4 -2
  27. package/dist/components/attachments/Attachments.svelte +3 -1
  28. package/dist/components/attachments/types.js +3 -2
  29. package/dist/components/audio-player/AudioPlayer.svelte.d.ts +1 -1
  30. package/dist/components/canvas/Canvas.svelte +1 -1
  31. package/dist/components/checkpoint/index.d.ts +2 -2
  32. package/dist/components/code/index.d.ts +9 -1
  33. package/dist/components/code/index.js +8 -1
  34. package/dist/components/code-block/CodeBlockLanguageSelector.svelte.d.ts +1 -1
  35. package/dist/components/code-block/highlight.js +11 -10
  36. package/dist/components/commit/Commit.svelte +23 -2
  37. package/dist/components/commit/CommitActions.svelte +2 -11
  38. package/dist/components/commit/CommitCopyButton.svelte +1 -1
  39. package/dist/components/commit/CommitHeader.svelte +12 -2
  40. package/dist/components/commit/context.svelte.d.ts +6 -0
  41. package/dist/components/commit/context.svelte.js +14 -0
  42. package/dist/components/context/Context.svelte +6 -4
  43. package/dist/components/context/TokensWithCost.svelte +2 -1
  44. package/dist/components/edge/Animated.svelte +6 -6
  45. package/dist/components/edge/Temporary.svelte +6 -5
  46. package/dist/components/file-tree/FileTree.svelte +7 -5
  47. package/dist/components/jsx-preview/parser.js +10 -10
  48. package/dist/components/message/MessageAction.svelte +3 -1
  49. package/dist/components/mic-selector/MicSelector.svelte.d.ts +1 -1
  50. package/dist/components/model-selector/ModelSelectorDialog.svelte +3 -1
  51. package/dist/components/open-in-chat/OpenInChatGPT.svelte +3 -1
  52. package/dist/components/open-in-chat/OpenInClaude.svelte +3 -1
  53. package/dist/components/open-in-chat/OpenInCursor.svelte +3 -1
  54. package/dist/components/open-in-chat/OpenInGitHub.svelte +3 -1
  55. package/dist/components/open-in-chat/OpenInScira.svelte +3 -1
  56. package/dist/components/open-in-chat/OpenInT3.svelte +3 -1
  57. package/dist/components/open-in-chat/OpenInv0.svelte +3 -1
  58. package/dist/components/package-info/PackageInfo.svelte +3 -1
  59. package/dist/components/prompt-input/PromptInput.svelte +8 -18
  60. package/dist/components/prompt-input/PromptInputCommand.svelte +2 -1
  61. package/dist/components/prompt-input/PromptInputSelect.svelte.d.ts +1 -1
  62. package/dist/components/prompt-input/PromptInputSubmit.svelte +5 -18
  63. package/dist/components/prompt-input/PromptInputTextarea.svelte +6 -11
  64. package/dist/components/prompt-input/context.svelte.d.ts +1 -8
  65. package/dist/components/prompt-input/files.js +3 -2
  66. package/dist/components/question/Question.svelte +3 -1
  67. package/dist/components/schema-display/SchemaDisplay.svelte +4 -2
  68. package/dist/components/schema-display/SchemaDisplayParameter.svelte +14 -1
  69. package/dist/components/schema-display/SchemaDisplayProperty.svelte +16 -1
  70. package/dist/components/snippet/index.d.ts +3 -3
  71. package/dist/components/stack-trace/StackTrace.svelte +7 -5
  72. package/dist/components/suggestion/index.d.ts +1 -1
  73. package/dist/components/terminal/Terminal.svelte +4 -2
  74. package/dist/components/terminal/ansi.js +9 -6
  75. package/dist/components/test-results/Test.svelte +1 -1
  76. package/dist/components/test-results/TestResults.svelte +1 -1
  77. package/dist/components/test-results/context.svelte.d.ts +1 -1
  78. package/dist/components/tool/ToolContent.svelte +1 -1
  79. package/dist/components/tool/ToolHeader.svelte +5 -5
  80. package/dist/components/tool/ToolInput.svelte +2 -4
  81. package/dist/components/tool/ToolOutput.svelte +2 -4
  82. package/dist/components/tool/ToolStatusBadge.svelte +2 -3
  83. package/dist/components/voice-selector/VoiceSelector.svelte +2 -1
  84. package/dist/components/voice-selector/VoiceSelector.svelte.d.ts +2 -2
  85. package/dist/components/voice-selector/context.svelte.d.ts +2 -1
  86. package/dist/components/web-preview/WebPreview.svelte +4 -3
  87. package/dist/contracts.d.ts +2 -2
  88. package/dist/generated-components.d.ts +15 -1
  89. package/dist/generated-components.js +20 -1
  90. package/dist/internal/Tooltip.svelte +2 -1
  91. package/dist/parity-manifest.d.ts +0 -1
  92. package/dist/parity-manifest.js +0 -97
  93. package/dist/utilities.css +3172 -0
  94. package/dist/utils.d.ts +1 -1
  95. package/dist/utils.js +1 -1
  96. package/package.json +37 -22
  97. package/vendor/streamdown/AnimatedText.svelte +93 -0
  98. package/vendor/streamdown/AnimatedText.svelte.d.ts +6 -0
  99. package/vendor/streamdown/Block.svelte +96 -0
  100. package/vendor/streamdown/Block.svelte.d.ts +11 -0
  101. package/vendor/streamdown/Elements/Alert.svelte +69 -0
  102. package/vendor/streamdown/Elements/Alert.svelte.d.ts +10 -0
  103. package/vendor/streamdown/Elements/Citation.svelte +260 -0
  104. package/vendor/streamdown/Elements/Citation.svelte.d.ts +7 -0
  105. package/vendor/streamdown/Elements/Code.svelte +226 -0
  106. package/vendor/streamdown/Elements/Code.svelte.d.ts +9 -0
  107. package/vendor/streamdown/Elements/Element.svelte +574 -0
  108. package/vendor/streamdown/Elements/Element.svelte.d.ts +10 -0
  109. package/vendor/streamdown/Elements/FootnoteRef.svelte +30 -0
  110. package/vendor/streamdown/Elements/FootnoteRef.svelte.d.ts +7 -0
  111. package/vendor/streamdown/Elements/Footnotes.svelte +54 -0
  112. package/vendor/streamdown/Elements/Footnotes.svelte.d.ts +7 -0
  113. package/vendor/streamdown/Elements/Image.svelte +200 -0
  114. package/vendor/streamdown/Elements/Image.svelte.d.ts +10 -0
  115. package/vendor/streamdown/Elements/Link.svelte +220 -0
  116. package/vendor/streamdown/Elements/Link.svelte.d.ts +10 -0
  117. package/vendor/streamdown/Elements/LinkSafetyModal.svelte +121 -0
  118. package/vendor/streamdown/Elements/LinkSafetyModal.svelte.d.ts +4 -0
  119. package/vendor/streamdown/Elements/Math.svelte +100 -0
  120. package/vendor/streamdown/Elements/Math.svelte.d.ts +9 -0
  121. package/vendor/streamdown/Elements/Mermaid.svelte +455 -0
  122. package/vendor/streamdown/Elements/Mermaid.svelte.d.ts +9 -0
  123. package/vendor/streamdown/Elements/MermaidDownload.svelte +145 -0
  124. package/vendor/streamdown/Elements/MermaidDownload.svelte.d.ts +8 -0
  125. package/vendor/streamdown/Elements/Slot.svelte +23 -0
  126. package/vendor/streamdown/Elements/Slot.svelte.d.ts +10 -0
  127. package/vendor/streamdown/Elements/Table.svelte +195 -0
  128. package/vendor/streamdown/Elements/Table.svelte.d.ts +9 -0
  129. package/vendor/streamdown/Elements/TableDownload.svelte +221 -0
  130. package/vendor/streamdown/Elements/TableDownload.svelte.d.ts +8 -0
  131. package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte +41 -0
  132. package/vendor/streamdown/Elements/fallbacks/CodeFallback.svelte.d.ts +9 -0
  133. package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte +35 -0
  134. package/vendor/streamdown/Elements/fallbacks/MathFallback.svelte.d.ts +8 -0
  135. package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte +36 -0
  136. package/vendor/streamdown/Elements/fallbacks/MermaidFallback.svelte.d.ts +9 -0
  137. package/vendor/streamdown/Elements/fallbacks/index.d.ts +3 -0
  138. package/vendor/streamdown/Elements/fallbacks/index.js +3 -0
  139. package/vendor/streamdown/Elements/icons.d.ts +31 -0
  140. package/vendor/streamdown/Elements/icons.js +200 -0
  141. package/vendor/streamdown/Elements/index.d.ts +8 -0
  142. package/vendor/streamdown/Elements/index.js +8 -0
  143. package/vendor/streamdown/Elements/popover.svelte.d.ts +8 -0
  144. package/vendor/streamdown/Elements/popover.svelte.js +45 -0
  145. package/vendor/streamdown/Elements/stepperState.svelte.d.ts +36 -0
  146. package/vendor/streamdown/Elements/stepperState.svelte.js +92 -0
  147. package/vendor/streamdown/IconProvider.svelte +11 -0
  148. package/vendor/streamdown/IconProvider.svelte.d.ts +30 -0
  149. package/vendor/streamdown/LICENSE +202 -0
  150. package/vendor/streamdown/PluginProvider.svelte +11 -0
  151. package/vendor/streamdown/PluginProvider.svelte.d.ts +30 -0
  152. package/vendor/streamdown/README.svadmin.md +5 -0
  153. package/vendor/streamdown/Streamdown.svelte +447 -0
  154. package/vendor/streamdown/Streamdown.svelte.d.ts +25 -0
  155. package/vendor/streamdown/block/BlockTokens.svelte +45 -0
  156. package/vendor/streamdown/block/BlockTokens.svelte.d.ts +9 -0
  157. package/vendor/streamdown/block/html.d.ts +14 -0
  158. package/vendor/streamdown/block/html.js +27 -0
  159. package/vendor/streamdown/block/text.d.ts +10 -0
  160. package/vendor/streamdown/block/text.js +31 -0
  161. package/vendor/streamdown/context-key.d.ts +1 -0
  162. package/vendor/streamdown/context-key.js +1 -0
  163. package/vendor/streamdown/context.svelte.d.ts +24 -0
  164. package/vendor/streamdown/context.svelte.js +75 -0
  165. package/vendor/streamdown/contracts/plugins.d.ts +26 -0
  166. package/vendor/streamdown/contracts/plugins.js +1 -0
  167. package/vendor/streamdown/contracts/streamdown.d.ts +374 -0
  168. package/vendor/streamdown/contracts/streamdown.js +29 -0
  169. package/vendor/streamdown/detect-direction.d.ts +1 -0
  170. package/vendor/streamdown/detect-direction.js +1 -0
  171. package/vendor/streamdown/icon-context.d.ts +36 -0
  172. package/vendor/streamdown/icon-context.js +52 -0
  173. package/vendor/streamdown/incomplete-code.d.ts +6 -0
  174. package/vendor/streamdown/incomplete-code.js +23 -0
  175. package/vendor/streamdown/index.d.ts +22 -0
  176. package/vendor/streamdown/index.js +20 -0
  177. package/vendor/streamdown/markdown-parse-cache.d.ts +37 -0
  178. package/vendor/streamdown/markdown-parse-cache.js +109 -0
  179. package/vendor/streamdown/markdown.d.ts +21 -0
  180. package/vendor/streamdown/markdown.js +214 -0
  181. package/vendor/streamdown/marked/index.d.ts +44 -0
  182. package/vendor/streamdown/marked/index.js +228 -0
  183. package/vendor/streamdown/marked/marked-alert.d.ts +13 -0
  184. package/vendor/streamdown/marked/marked-alert.js +47 -0
  185. package/vendor/streamdown/marked/marked-align.d.ts +10 -0
  186. package/vendor/streamdown/marked/marked-align.js +45 -0
  187. package/vendor/streamdown/marked/marked-br.d.ts +6 -0
  188. package/vendor/streamdown/marked/marked-br.js +15 -0
  189. package/vendor/streamdown/marked/marked-citations.d.ts +8 -0
  190. package/vendor/streamdown/marked/marked-citations.js +53 -0
  191. package/vendor/streamdown/marked/marked-cjk.d.ts +2 -0
  192. package/vendor/streamdown/marked/marked-cjk.js +165 -0
  193. package/vendor/streamdown/marked/marked-dl.d.ts +23 -0
  194. package/vendor/streamdown/marked/marked-dl.js +44 -0
  195. package/vendor/streamdown/marked/marked-footnotes.d.ts +26 -0
  196. package/vendor/streamdown/marked/marked-footnotes.js +101 -0
  197. package/vendor/streamdown/marked/marked-hr.d.ts +6 -0
  198. package/vendor/streamdown/marked/marked-hr.js +18 -0
  199. package/vendor/streamdown/marked/marked-list.d.ts +31 -0
  200. package/vendor/streamdown/marked/marked-list.js +330 -0
  201. package/vendor/streamdown/marked/marked-math.d.ts +13 -0
  202. package/vendor/streamdown/marked/marked-math.js +129 -0
  203. package/vendor/streamdown/marked/marked-mdx.d.ts +12 -0
  204. package/vendor/streamdown/marked/marked-mdx.js +124 -0
  205. package/vendor/streamdown/marked/marked-subsup.d.ts +22 -0
  206. package/vendor/streamdown/marked/marked-subsup.js +40 -0
  207. package/vendor/streamdown/marked/marked-table.d.ts +80 -0
  208. package/vendor/streamdown/marked/marked-table.js +527 -0
  209. package/vendor/streamdown/plugin-context.d.ts +19 -0
  210. package/vendor/streamdown/plugin-context.js +40 -0
  211. package/vendor/streamdown/plugins/cjk-shared.d.ts +1 -0
  212. package/vendor/streamdown/plugins/cjk-shared.js +1 -0
  213. package/vendor/streamdown/plugins.d.ts +19 -0
  214. package/vendor/streamdown/plugins.js +107 -0
  215. package/vendor/streamdown/provenance.json +229 -0
  216. package/vendor/streamdown/remend.d.ts +2 -0
  217. package/vendor/streamdown/remend.js +1 -0
  218. package/vendor/streamdown/security/html.d.ts +19 -0
  219. package/vendor/streamdown/security/html.js +329 -0
  220. package/vendor/streamdown/security/preprocess-custom-tags.d.ts +1 -0
  221. package/vendor/streamdown/security/preprocess-custom-tags.js +20 -0
  222. package/vendor/streamdown/security/preprocess-literal-tag-content.d.ts +1 -0
  223. package/vendor/streamdown/security/preprocess-literal-tag-content.js +16 -0
  224. package/vendor/streamdown/security/types.d.ts +1 -0
  225. package/vendor/streamdown/security/types.js +1 -0
  226. package/vendor/streamdown/site/SiteHeader.svelte +94 -0
  227. package/vendor/streamdown/site/SiteHeader.svelte.d.ts +6 -0
  228. package/vendor/streamdown/site/home/HomeDemo.svelte +122 -0
  229. package/vendor/streamdown/site/home/HomeDemo.svelte.d.ts +3 -0
  230. package/vendor/streamdown/site/home/HomePage.svelte +293 -0
  231. package/vendor/streamdown/site/home/HomePage.svelte.d.ts +3 -0
  232. package/vendor/streamdown/site/home/content.d.ts +69 -0
  233. package/vendor/streamdown/site/home/content.js +144 -0
  234. package/vendor/streamdown/site/metadata.d.ts +4 -0
  235. package/vendor/streamdown/site/metadata.js +4 -0
  236. package/vendor/streamdown/site/navigation.d.ts +6 -0
  237. package/vendor/streamdown/site/navigation.js +22 -0
  238. package/vendor/streamdown/streamdown/config.d.ts +41 -0
  239. package/vendor/streamdown/streamdown/config.js +125 -0
  240. package/vendor/streamdown/streamdown/context.d.ts +12 -0
  241. package/vendor/streamdown/streamdown/context.js +2 -0
  242. package/vendor/streamdown/streamdown/incomplete-markdown.d.ts +5 -0
  243. package/vendor/streamdown/streamdown/incomplete-markdown.js +79 -0
  244. package/vendor/streamdown/streamdown/pipeline.d.ts +95 -0
  245. package/vendor/streamdown/streamdown/pipeline.js +138 -0
  246. package/vendor/streamdown/streamdown/runtime.d.ts +59 -0
  247. package/vendor/streamdown/streamdown/runtime.js +112 -0
  248. package/vendor/streamdown/streaming.d.ts +5 -0
  249. package/vendor/streamdown/streaming.js +5 -0
  250. package/vendor/streamdown/theme.d.ts +486 -0
  251. package/vendor/streamdown/theme.js +370 -0
  252. package/vendor/streamdown/translations.d.ts +43 -0
  253. package/vendor/streamdown/translations.js +54 -0
  254. package/vendor/streamdown/url-policy.d.ts +1 -0
  255. package/vendor/streamdown/url-policy.js +1 -0
  256. package/vendor/streamdown/utils/bind.d.ts +8 -0
  257. package/vendor/streamdown/utils/bind.js +26 -0
  258. package/vendor/streamdown/utils/bundledLanguages.d.ts +1 -0
  259. package/vendor/streamdown/utils/bundledLanguages.js +1 -0
  260. package/vendor/streamdown/utils/code-block.d.ts +8 -0
  261. package/vendor/streamdown/utils/code-block.js +38 -0
  262. package/vendor/streamdown/utils/copy.svelte.d.ts +7 -0
  263. package/vendor/streamdown/utils/copy.svelte.js +38 -0
  264. package/vendor/streamdown/utils/darkMode.svelte.d.ts +3 -0
  265. package/vendor/streamdown/utils/darkMode.svelte.js +49 -0
  266. package/vendor/streamdown/utils/detectDirection.d.ts +1 -0
  267. package/vendor/streamdown/utils/detectDirection.js +19 -0
  268. package/vendor/streamdown/utils/get.d.ts +1 -0
  269. package/vendor/streamdown/utils/get.js +25 -0
  270. package/vendor/streamdown/utils/hightlighter.svelte.d.ts +30 -0
  271. package/vendor/streamdown/utils/hightlighter.svelte.js +524 -0
  272. package/vendor/streamdown/utils/index.d.ts +3 -0
  273. package/vendor/streamdown/utils/index.js +3 -0
  274. package/vendor/streamdown/utils/mermaid.d.ts +13 -0
  275. package/vendor/streamdown/utils/mermaid.js +49 -0
  276. package/vendor/streamdown/utils/panzoom.svelte.d.ts +35 -0
  277. package/vendor/streamdown/utils/panzoom.svelte.js +556 -0
  278. package/vendor/streamdown/utils/parse-incomplete-markdown.d.ts +2 -0
  279. package/vendor/streamdown/utils/parse-incomplete-markdown.js +2 -0
  280. package/vendor/streamdown/utils/runtime-env.d.ts +1 -0
  281. package/vendor/streamdown/utils/runtime-env.js +13 -0
  282. package/vendor/streamdown/utils/save.d.ts +1 -0
  283. package/vendor/streamdown/utils/save.js +14 -0
  284. package/vendor/streamdown/utils/scroll-lock.d.ts +2 -0
  285. package/vendor/streamdown/utils/scroll-lock.js +35 -0
  286. package/vendor/streamdown/utils/table.d.ts +8 -0
  287. package/vendor/streamdown/utils/table.js +176 -0
  288. package/vendor/streamdown/utils/url.d.ts +22 -0
  289. package/vendor/streamdown/utils/url.js +98 -0
  290. package/vendor/streamdown/utils/useClickOutside.svelte.d.ts +8 -0
  291. package/vendor/streamdown/utils/useClickOutside.svelte.js +41 -0
  292. package/vendor/streamdown/utils/useKeyDown.svelte.d.ts +5 -0
  293. package/vendor/streamdown/utils/useKeyDown.svelte.js +23 -0
  294. package/UPSTREAM_PARITY.md +0 -69
  295. package/dist/ai-theme.css +0 -28
  296. package/dist/components/code/code-variants.d.ts +0 -25
  297. package/dist/components/code/code-variants.js +0 -20
  298. package/dist/components/conversation/scroll.d.ts +0 -4
  299. package/dist/components/conversation/scroll.js +0 -85
  300. package/dist/components/message/content-polish-html.d.ts +0 -5
  301. package/dist/components/message/content-polish-html.js +0 -75
  302. package/dist/components/tool/content-polish-scroll-region.d.ts +0 -3
  303. package/dist/components/tool/content-polish-scroll-region.js +0 -22
@@ -1,75 +0,0 @@
1
- export function createResponseHtmlPreparer() {
2
- const noExtensions = [];
3
- let cached;
4
- return function prepareResponseHtml(markdown, extensions = noExtensions) {
5
- // Use collision-free character references so literal entities in code are not
6
- // confused with the tag brackets escaped by this response.
7
- let zeros = '';
8
- while (markdown.includes(`&#${zeros}60;`) || markdown.includes(`&#${zeros}62;`))
9
- zeros += '0';
10
- const lessThan = `&#${zeros}60;`;
11
- const greaterThan = `&#${zeros}62;`;
12
- const content = markdown.replace(/<\/?[A-Za-z][A-Za-z0-9:-]*(?:\s[^<>]*?)?\/?\s*>|<[A-Za-z/][^>]*$/g, tag => tag.replaceAll('<', lessThan).replaceAll('>', greaterThan));
13
- if (content === markdown)
14
- return { content, extensions };
15
- // Streamdown scopes its parse cache by extension-array identity.
16
- if (cached?.source === extensions && cached.lessThan === lessThan) {
17
- return { content, extensions: cached.extensions };
18
- }
19
- const restore = (value) => value.replaceAll(lessThan, '<').replaceAll(greaterThan, '>');
20
- function restoreCode(token) {
21
- const result = { ...token };
22
- if ((token.type === 'code' || token.type === 'codespan') &&
23
- (token.raw.includes(lessThan) || token.raw.includes(greaterThan))) {
24
- if (token.text !== undefined)
25
- result.text = restore(token.text);
26
- if (token.lang !== undefined)
27
- result.lang = restore(token.lang);
28
- }
29
- if (token.tokens)
30
- result.tokens = token.tokens.map(restoreCode);
31
- return result;
32
- }
33
- const blockCode = {
34
- name: 'svadmin-response-literal-block-code',
35
- level: 'block',
36
- tokenizer(source, tokens) {
37
- const tokenizer = this.lexer.options.tokenizer;
38
- const fenced = tokenizer?.fences(source);
39
- if (fenced)
40
- return restoreCode(fenced);
41
- // Indented continuation belongs to the preceding paragraph, not code.
42
- const previous = tokens.at(-1);
43
- if (previous?.type === 'paragraph' || previous?.type === 'text')
44
- return undefined;
45
- const indented = tokenizer?.code(source);
46
- return indented ? restoreCode(indented) : undefined;
47
- },
48
- };
49
- const inlineCode = {
50
- name: 'svadmin-response-literal-inline-code',
51
- level: 'inline',
52
- tokenizer(source) {
53
- const token = this.lexer.options.tokenizer?.codespan(source);
54
- return token ? restoreCode(token) : undefined;
55
- },
56
- };
57
- cached = {
58
- source: extensions,
59
- lessThan,
60
- extensions: [
61
- // Preserve caller precedence and restore code produced by custom parsers.
62
- ...extensions.map(extension => ({
63
- ...extension,
64
- tokenizer: function (...args) {
65
- const token = extension.tokenizer.apply(this, args);
66
- return token ? restoreCode(token) : undefined;
67
- },
68
- })),
69
- blockCode,
70
- inlineCode,
71
- ],
72
- };
73
- return { content, extensions: cached.extensions };
74
- };
75
- }
@@ -1,3 +0,0 @@
1
- export declare function focusScrollableContent(node: HTMLElement): {
2
- destroy(): void;
3
- };
@@ -1,22 +0,0 @@
1
- export function focusScrollableContent(node) {
2
- const update = () => {
3
- // Only add a keyboard stop when the region has content to scroll.
4
- if (node.scrollHeight > node.clientHeight || node.scrollWidth > node.clientWidth) {
5
- node.tabIndex = 0;
6
- }
7
- else {
8
- node.removeAttribute('tabindex');
9
- }
10
- };
11
- const resize = new ResizeObserver(update);
12
- const mutations = new MutationObserver(update);
13
- resize.observe(node);
14
- mutations.observe(node, { childList: true, characterData: true, subtree: true });
15
- update();
16
- return {
17
- destroy() {
18
- resize.disconnect();
19
- mutations.disconnect();
20
- },
21
- };
22
- }