@mui/internal-docs-infra 0.1.1-alpha.0 → 0.1.1-alpha.10

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 (479) hide show
  1. package/{build/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts +1 -1
  2. package/CodeControllerContext/CodeControllerContext.d.ts.map +1 -0
  3. package/CodeControllerContext/index.d.ts.map +1 -0
  4. package/CodeExternalsContext/CodeExternalsContext.d.ts +8 -0
  5. package/CodeExternalsContext/CodeExternalsContext.d.ts.map +1 -0
  6. package/CodeExternalsContext/CodeExternalsContext.js +7 -0
  7. package/CodeExternalsContext/index.d.ts +1 -0
  8. package/CodeExternalsContext/index.d.ts.map +1 -0
  9. package/CodeExternalsContext/index.js +1 -0
  10. package/CodeHighlighter/CodeHighlighter.d.ts +2 -0
  11. package/CodeHighlighter/CodeHighlighter.d.ts.map +1 -0
  12. package/CodeHighlighter/CodeHighlighter.js +470 -0
  13. package/CodeHighlighter/CodeHighlighterClient.d.ts.map +1 -0
  14. package/CodeHighlighter/CodeHighlighterClient.js +837 -0
  15. package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts +2 -0
  16. package/CodeHighlighter/CodeHighlighterContext.d.ts.map +1 -0
  17. package/CodeHighlighter/CodeHighlighterFallbackContext.d.ts.map +1 -0
  18. package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.js +3 -1
  19. package/CodeHighlighter/applyTransform.d.ts.map +1 -0
  20. package/{build/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts +2 -2
  21. package/CodeHighlighter/codeToFallbackProps.d.ts.map +1 -0
  22. package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.js +8 -5
  23. package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.d.ts.map +1 -1
  24. package/CodeHighlighter/hasAllVariants.d.ts.map +1 -0
  25. package/CodeHighlighter/index.d.ts.map +1 -0
  26. package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts +3 -2
  27. package/CodeHighlighter/loadFallbackCode.d.ts.map +1 -0
  28. package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.js +325 -161
  29. package/CodeHighlighter/loadVariant.d.ts +12 -0
  30. package/CodeHighlighter/loadVariant.d.ts.map +1 -0
  31. package/CodeHighlighter/loadVariant.js +1083 -0
  32. package/{build/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts +1 -1
  33. package/CodeHighlighter/maybeInitialData.d.ts.map +1 -0
  34. package/CodeHighlighter/parseCode.d.ts.map +1 -0
  35. package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.js +14 -2
  36. package/CodeHighlighter/parseControlledCode.d.ts.map +1 -0
  37. package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.js +12 -1
  38. package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.d.ts +1 -0
  39. package/CodeHighlighter/transformCode.d.ts.map +1 -0
  40. package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.js +43 -3
  41. package/CodeHighlighter/transformParsedSource.d.ts.map +1 -0
  42. package/CodeHighlighter/transformSource.d.ts.map +1 -0
  43. package/{build/esm/CodeHighlighter → CodeHighlighter}/types.d.ts +39 -17
  44. package/CodeHighlighter/types.d.ts.map +1 -0
  45. package/CodeProvider/CodeContext.d.ts.map +1 -0
  46. package/CodeProvider/CodeProvider.d.ts.map +1 -0
  47. package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.js +21 -6
  48. package/CodeProvider/index.d.ts +1 -0
  49. package/CodeProvider/index.d.ts.map +1 -0
  50. package/CodeProvider/index.js +1 -0
  51. package/abstractCreateDemo/abstractCreateDemo.d.ts +35 -0
  52. package/abstractCreateDemo/abstractCreateDemo.d.ts.map +1 -0
  53. package/abstractCreateDemo/abstractCreateDemo.js +91 -0
  54. package/abstractCreateDemo/index.d.ts +1 -0
  55. package/abstractCreateDemo/index.d.ts.map +1 -0
  56. package/abstractCreateDemo/index.js +1 -0
  57. package/createDemoData/createDemoData.d.ts +44 -0
  58. package/createDemoData/createDemoData.d.ts.map +1 -0
  59. package/createDemoData/createDemoData.js +75 -0
  60. package/createDemoData/index.d.ts +1 -0
  61. package/createDemoData/index.d.ts.map +1 -0
  62. package/createDemoData/index.js +1 -0
  63. package/createDemoData/types.d.ts +28 -0
  64. package/createDemoData/types.d.ts.map +1 -0
  65. package/createDemoData/types.js +1 -0
  66. package/package.json +20 -73
  67. package/pipeline/hastUtils/hastUtils.d.ts.map +1 -0
  68. package/{build/esm/hast/hast.js → pipeline/hastUtils/hastUtils.js} +2 -1
  69. package/pipeline/hastUtils/index.d.ts +1 -0
  70. package/pipeline/hastUtils/index.d.ts.map +1 -0
  71. package/pipeline/hastUtils/index.js +1 -0
  72. package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.d.ts +54 -0
  73. package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.d.ts.map +1 -0
  74. package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.js +465 -0
  75. package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.d.ts +15 -0
  76. package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.d.ts.map +1 -0
  77. package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.js +253 -0
  78. package/pipeline/loadPrecomputedCodeHighlighter/index.d.ts.map +1 -0
  79. package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +20 -0
  80. package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts.map +1 -0
  81. package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +105 -75
  82. package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts +12 -1
  83. package/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts.map +1 -0
  84. package/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +433 -0
  85. package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts +5 -1
  86. package/pipeline/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts.map +1 -0
  87. package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseFunctionParameters.js +1 -1
  88. package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +25 -0
  89. package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts.map +1 -0
  90. package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +73 -0
  91. package/pipeline/loadServerCodeMeta/index.d.ts +1 -0
  92. package/pipeline/loadServerCodeMeta/index.d.ts.map +1 -0
  93. package/pipeline/loadServerCodeMeta/index.js +1 -0
  94. package/{build/esm/loadServerCodeMeta/serverLoadCodeMeta.d.ts → pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts} +4 -4
  95. package/pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts.map +1 -0
  96. package/{build/esm/loadServerCodeMeta/serverLoadCodeMeta.js → pipeline/loadServerCodeMeta/loadServerCodeMeta.js} +18 -3
  97. package/pipeline/loadServerSource/index.d.ts +1 -0
  98. package/pipeline/loadServerSource/index.d.ts.map +1 -0
  99. package/pipeline/loadServerSource/index.js +1 -0
  100. package/{build/loadServerSource/serverLoadSource.d.ts → pipeline/loadServerSource/loadServerSource.d.ts} +5 -5
  101. package/pipeline/loadServerSource/loadServerSource.d.ts.map +1 -0
  102. package/pipeline/loadServerSource/loadServerSource.js +135 -0
  103. package/pipeline/loaderUtils/externalsToPackages.d.ts +1 -0
  104. package/pipeline/loaderUtils/externalsToPackages.d.ts.map +1 -0
  105. package/pipeline/loaderUtils/externalsToPackages.js +46 -0
  106. package/pipeline/loaderUtils/extractNameAndSlugFromUrl.d.ts +34 -0
  107. package/pipeline/loaderUtils/extractNameAndSlugFromUrl.d.ts.map +1 -0
  108. package/pipeline/loaderUtils/extractNameAndSlugFromUrl.js +161 -0
  109. package/pipeline/loaderUtils/getFileNameFromUrl.d.ts.map +1 -0
  110. package/pipeline/loaderUtils/index.d.ts +7 -0
  111. package/pipeline/loaderUtils/index.d.ts.map +1 -0
  112. package/pipeline/loaderUtils/index.js +7 -0
  113. package/pipeline/loaderUtils/mergeExternals.d.ts +32 -0
  114. package/pipeline/loaderUtils/mergeExternals.d.ts.map +1 -0
  115. package/pipeline/loaderUtils/mergeExternals.js +72 -0
  116. package/pipeline/loaderUtils/parseImports.d.ts +20 -0
  117. package/pipeline/loaderUtils/parseImports.d.ts.map +1 -0
  118. package/pipeline/loaderUtils/parseImports.js +307 -0
  119. package/{build/esm/loaderUtils/processImports.d.ts → pipeline/loaderUtils/processRelativeImports.d.ts} +2 -2
  120. package/pipeline/loaderUtils/processRelativeImports.d.ts.map +1 -0
  121. package/pipeline/loaderUtils/processRelativeImports.js +329 -0
  122. package/{build/esm → pipeline}/loaderUtils/resolveModulePath.d.ts +19 -6
  123. package/pipeline/loaderUtils/resolveModulePath.d.ts.map +1 -0
  124. package/pipeline/loaderUtils/resolveModulePath.js +1449 -0
  125. package/{build/esm → pipeline}/loaderUtils/resolveModulePathWithFs.d.ts +6 -3
  126. package/pipeline/loaderUtils/resolveModulePathWithFs.d.ts.map +1 -0
  127. package/{build/esm → pipeline}/loaderUtils/resolveModulePathWithFs.js +8 -4
  128. package/pipeline/loaderUtils/rewriteImports.d.ts +9 -0
  129. package/pipeline/loaderUtils/rewriteImports.d.ts.map +1 -0
  130. package/pipeline/loaderUtils/rewriteImports.js +35 -0
  131. package/pipeline/parseSource/grammars.d.ts.map +1 -0
  132. package/pipeline/parseSource/index.d.ts.map +1 -0
  133. package/pipeline/parseSource/parseSource.d.ts +3 -0
  134. package/pipeline/parseSource/parseSource.d.ts.map +1 -0
  135. package/{build/esm → pipeline}/parseSource/parseSource.js +15 -5
  136. package/pipeline/transformHtmlCode/index.d.ts +2 -0
  137. package/pipeline/transformHtmlCode/index.d.ts.map +1 -0
  138. package/pipeline/transformHtmlCode/index.js +4 -0
  139. package/pipeline/transformHtmlCode/transformHtmlCode.d.ts +13 -0
  140. package/pipeline/transformHtmlCode/transformHtmlCode.d.ts.map +1 -0
  141. package/pipeline/transformHtmlCode/transformHtmlCode.js +303 -0
  142. package/pipeline/transformMarkdownCode/index.d.ts +2 -0
  143. package/pipeline/transformMarkdownCode/index.d.ts.map +1 -0
  144. package/pipeline/transformMarkdownCode/index.js +4 -0
  145. package/pipeline/transformMarkdownCode/transformMarkdownCode.d.ts +2 -0
  146. package/pipeline/transformMarkdownCode/transformMarkdownCode.d.ts.map +1 -0
  147. package/pipeline/transformMarkdownCode/transformMarkdownCode.js +514 -0
  148. package/pipeline/transformTypescriptToJavascript/index.d.ts +1 -0
  149. package/pipeline/transformTypescriptToJavascript/index.d.ts.map +1 -0
  150. package/pipeline/transformTypescriptToJavascript/index.js +1 -0
  151. package/pipeline/transformTypescriptToJavascript/removeTypes.d.ts.map +1 -0
  152. package/pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.d.ts +3 -0
  153. package/pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.d.ts.map +1 -0
  154. package/{build/esm/transformTsToJs/transformTsToJs.js → pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.js} +4 -4
  155. package/useCode/index.d.ts.map +1 -0
  156. package/{build/useCode → useCode}/useCode.d.ts +13 -11
  157. package/useCode/useCode.d.ts.map +1 -0
  158. package/useCode/useCode.js +122 -0
  159. package/useCode/useCodeUtils.d.ts +45 -0
  160. package/useCode/useCodeUtils.d.ts.map +1 -0
  161. package/useCode/useCodeUtils.js +240 -0
  162. package/useCode/useCopyFunctionality.d.ts +17 -0
  163. package/useCode/useCopyFunctionality.d.ts.map +1 -0
  164. package/useCode/useCopyFunctionality.js +28 -0
  165. package/useCode/useFileNavigation.d.ts +48 -0
  166. package/useCode/useFileNavigation.d.ts.map +1 -0
  167. package/useCode/useFileNavigation.js +370 -0
  168. package/useCode/useSourceEditing.d.ts +19 -0
  169. package/useCode/useSourceEditing.d.ts.map +1 -0
  170. package/useCode/useSourceEditing.js +32 -0
  171. package/useCode/useTransformManagement.d.ts +28 -0
  172. package/useCode/useTransformManagement.d.ts.map +1 -0
  173. package/useCode/useTransformManagement.js +82 -0
  174. package/useCode/useUIState.d.ts +16 -0
  175. package/useCode/useUIState.d.ts.map +1 -0
  176. package/useCode/useUIState.js +21 -0
  177. package/useCode/useVariantSelection.d.ts +21 -0
  178. package/useCode/useVariantSelection.d.ts.map +1 -0
  179. package/useCode/useVariantSelection.js +84 -0
  180. package/{build/esm/useCopier → useCopier}/index.d.ts +1 -1
  181. package/useCopier/index.d.ts.map +1 -0
  182. package/{build/esm/useCopier → useCopier}/index.js +5 -5
  183. package/useDemo/createCodeSandbox.d.ts +18 -0
  184. package/useDemo/createCodeSandbox.d.ts.map +1 -0
  185. package/useDemo/createCodeSandbox.js +48 -0
  186. package/useDemo/createStackBlitz.d.ts +22 -0
  187. package/useDemo/createStackBlitz.d.ts.map +1 -0
  188. package/useDemo/createStackBlitz.js +38 -0
  189. package/useDemo/examineVariant.d.ts +25 -0
  190. package/useDemo/examineVariant.d.ts.map +1 -0
  191. package/useDemo/examineVariant.js +134 -0
  192. package/useDemo/exportVariant.d.ts +110 -0
  193. package/useDemo/exportVariant.d.ts.map +1 -0
  194. package/useDemo/exportVariant.js +320 -0
  195. package/useDemo/exportVariantAsCra.d.ts +15 -0
  196. package/useDemo/exportVariantAsCra.d.ts.map +1 -0
  197. package/useDemo/exportVariantAsCra.js +56 -0
  198. package/useDemo/flattenVariant.d.ts +17 -0
  199. package/useDemo/flattenVariant.d.ts.map +1 -0
  200. package/useDemo/flattenVariant.js +206 -0
  201. package/useDemo/index.d.ts +6 -0
  202. package/useDemo/index.d.ts.map +1 -0
  203. package/useDemo/index.js +6 -0
  204. package/useDemo/useDemo.d.ts +78 -0
  205. package/useDemo/useDemo.d.ts.map +1 -0
  206. package/useDemo/useDemo.js +174 -0
  207. package/useLocalStorageState/index.d.ts +2 -0
  208. package/useLocalStorageState/index.d.ts.map +1 -0
  209. package/useLocalStorageState/index.js +2 -0
  210. package/useLocalStorageState/useLocalStorageState.d.ts +14 -0
  211. package/useLocalStorageState/useLocalStorageState.d.ts.map +1 -0
  212. package/useLocalStorageState/useLocalStorageState.js +128 -0
  213. package/useOnHydrate/index.d.ts.map +1 -0
  214. package/useOnHydrate/useOnHydrate.d.ts.map +1 -0
  215. package/useOnIdle/index.d.ts.map +1 -0
  216. package/useOnIdle/useOnIdle.d.ts.map +1 -0
  217. package/useUrlHashState/index.d.ts +1 -0
  218. package/useUrlHashState/index.d.ts.map +1 -0
  219. package/useUrlHashState/index.js +1 -0
  220. package/useUrlHashState/useUrlHashState.d.ts +50 -0
  221. package/useUrlHashState/useUrlHashState.d.ts.map +1 -0
  222. package/useUrlHashState/useUrlHashState.js +113 -0
  223. package/build/CodeControllerContext/CodeControllerContext.js +0 -21
  224. package/build/CodeControllerContext/index.js +0 -16
  225. package/build/CodeHighlighter/CodeHighlighter.d.ts +0 -2
  226. package/build/CodeHighlighter/CodeHighlighter.js +0 -329
  227. package/build/CodeHighlighter/CodeHighlighterClient.js +0 -406
  228. package/build/CodeHighlighter/CodeHighlighterContext.js +0 -22
  229. package/build/CodeHighlighter/CodeHighlighterFallbackContext.js +0 -18
  230. package/build/CodeHighlighter/applyTransform.js +0 -83
  231. package/build/CodeHighlighter/codeToFallbackProps.js +0 -77
  232. package/build/CodeHighlighter/errors.js +0 -2
  233. package/build/CodeHighlighter/hasAllVariants.js +0 -37
  234. package/build/CodeHighlighter/index.js +0 -49
  235. package/build/CodeHighlighter/loadFallbackCode.d.ts +0 -9
  236. package/build/CodeHighlighter/loadFallbackCode.js +0 -474
  237. package/build/CodeHighlighter/loadVariant.d.ts +0 -11
  238. package/build/CodeHighlighter/loadVariant.js +0 -715
  239. package/build/CodeHighlighter/maybeInitialData.js +0 -101
  240. package/build/CodeHighlighter/parseCode.js +0 -129
  241. package/build/CodeHighlighter/parseControlledCode.js +0 -83
  242. package/build/CodeHighlighter/transformCode.d.ts +0 -20
  243. package/build/CodeHighlighter/transformCode.js +0 -231
  244. package/build/CodeHighlighter/transformParsedSource.js +0 -73
  245. package/build/CodeHighlighter/transformSource.js +0 -114
  246. package/build/CodeHighlighter/types.d.ts +0 -138
  247. package/build/CodeHighlighter/types.js +0 -5
  248. package/build/CodeProvider/CodeContext.js +0 -14
  249. package/build/CodeProvider/CodeProvider.js +0 -57
  250. package/build/CodeProvider/index.d.ts +0 -2
  251. package/build/CodeProvider/index.js +0 -27
  252. package/build/README.md +0 -19
  253. package/build/esm/CodeControllerContext/CodeControllerContext.d.ts +0 -22
  254. package/build/esm/CodeControllerContext/CodeControllerContext.d.ts.map +0 -1
  255. package/build/esm/CodeControllerContext/index.d.ts +0 -1
  256. package/build/esm/CodeControllerContext/index.d.ts.map +0 -1
  257. package/build/esm/CodeHighlighter/CodeHighlighter.d.ts +0 -2
  258. package/build/esm/CodeHighlighter/CodeHighlighter.d.ts.map +0 -1
  259. package/build/esm/CodeHighlighter/CodeHighlighter.js +0 -321
  260. package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts +0 -2
  261. package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts.map +0 -1
  262. package/build/esm/CodeHighlighter/CodeHighlighterClient.js +0 -399
  263. package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts +0 -14
  264. package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts.map +0 -1
  265. package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts +0 -7
  266. package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts.map +0 -1
  267. package/build/esm/CodeHighlighter/applyTransform.d.ts +0 -19
  268. package/build/esm/CodeHighlighter/applyTransform.d.ts.map +0 -1
  269. package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts +0 -2
  270. package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts.map +0 -1
  271. package/build/esm/CodeHighlighter/errors.d.ts +0 -0
  272. package/build/esm/CodeHighlighter/hasAllVariants.d.ts +0 -2
  273. package/build/esm/CodeHighlighter/hasAllVariants.d.ts.map +0 -1
  274. package/build/esm/CodeHighlighter/index.d.ts +0 -4
  275. package/build/esm/CodeHighlighter/index.d.ts.map +0 -1
  276. package/build/esm/CodeHighlighter/loadFallbackCode.d.ts.map +0 -1
  277. package/build/esm/CodeHighlighter/loadVariant.d.ts +0 -11
  278. package/build/esm/CodeHighlighter/loadVariant.d.ts.map +0 -1
  279. package/build/esm/CodeHighlighter/loadVariant.js +0 -708
  280. package/build/esm/CodeHighlighter/maybeInitialData.d.ts +0 -10
  281. package/build/esm/CodeHighlighter/maybeInitialData.d.ts.map +0 -1
  282. package/build/esm/CodeHighlighter/parseCode.d.ts +0 -6
  283. package/build/esm/CodeHighlighter/parseCode.d.ts.map +0 -1
  284. package/build/esm/CodeHighlighter/parseControlledCode.d.ts +0 -6
  285. package/build/esm/CodeHighlighter/parseControlledCode.d.ts.map +0 -1
  286. package/build/esm/CodeHighlighter/transformCode.d.ts.map +0 -1
  287. package/build/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
  288. package/build/esm/CodeHighlighter/transformParsedSource.d.ts.map +0 -1
  289. package/build/esm/CodeHighlighter/transformSource.d.ts +0 -2
  290. package/build/esm/CodeHighlighter/transformSource.d.ts.map +0 -1
  291. package/build/esm/CodeHighlighter/types.d.ts.map +0 -1
  292. package/build/esm/CodeProvider/CodeContext.d.ts +0 -12
  293. package/build/esm/CodeProvider/CodeContext.d.ts.map +0 -1
  294. package/build/esm/CodeProvider/CodeProvider.d.ts +0 -13
  295. package/build/esm/CodeProvider/CodeProvider.d.ts.map +0 -1
  296. package/build/esm/CodeProvider/index.d.ts +0 -2
  297. package/build/esm/CodeProvider/index.d.ts.map +0 -1
  298. package/build/esm/CodeProvider/index.js +0 -2
  299. package/build/esm/hast/hast.d.ts.map +0 -1
  300. package/build/esm/hast/index.d.ts +0 -1
  301. package/build/esm/hast/index.d.ts.map +0 -1
  302. package/build/esm/hast/index.js +0 -1
  303. package/build/esm/loadPrecomputedCodeHighlighter/index.d.ts.map +0 -1
  304. package/build/esm/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +0 -57
  305. package/build/esm/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts.map +0 -1
  306. package/build/esm/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts.map +0 -1
  307. package/build/esm/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +0 -243
  308. package/build/esm/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts.map +0 -1
  309. package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +0 -27
  310. package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts.map +0 -1
  311. package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +0 -37
  312. package/build/esm/loadServerCodeMeta/index.d.ts +0 -1
  313. package/build/esm/loadServerCodeMeta/index.d.ts.map +0 -1
  314. package/build/esm/loadServerCodeMeta/index.js +0 -1
  315. package/build/esm/loadServerCodeMeta/serverLoadCodeMeta.d.ts.map +0 -1
  316. package/build/esm/loadServerSource/index.d.ts +0 -1
  317. package/build/esm/loadServerSource/index.d.ts.map +0 -1
  318. package/build/esm/loadServerSource/index.js +0 -1
  319. package/build/esm/loadServerSource/serverLoadSource.d.ts +0 -25
  320. package/build/esm/loadServerSource/serverLoadSource.d.ts.map +0 -1
  321. package/build/esm/loadServerSource/serverLoadSource.js +0 -100
  322. package/build/esm/loaderUtils/getFileNameFromUrl.d.ts.map +0 -1
  323. package/build/esm/loaderUtils/index.d.ts +0 -5
  324. package/build/esm/loaderUtils/index.d.ts.map +0 -1
  325. package/build/esm/loaderUtils/index.js +0 -5
  326. package/build/esm/loaderUtils/processImports.d.ts.map +0 -1
  327. package/build/esm/loaderUtils/processImports.js +0 -82
  328. package/build/esm/loaderUtils/resolveImports.d.ts +0 -4
  329. package/build/esm/loaderUtils/resolveImports.d.ts.map +0 -1
  330. package/build/esm/loaderUtils/resolveImports.js +0 -71
  331. package/build/esm/loaderUtils/resolveModulePath.d.ts.map +0 -1
  332. package/build/esm/loaderUtils/resolveModulePath.js +0 -827
  333. package/build/esm/loaderUtils/resolveModulePathWithFs.d.ts.map +0 -1
  334. package/build/esm/loaderUtils/rewriteImports.d.ts +0 -9
  335. package/build/esm/loaderUtils/rewriteImports.d.ts.map +0 -1
  336. package/build/esm/loaderUtils/rewriteImports.js +0 -57
  337. package/build/esm/package.json +0 -1
  338. package/build/esm/parseSource/grammars.d.ts.map +0 -1
  339. package/build/esm/parseSource/index.d.ts.map +0 -1
  340. package/build/esm/parseSource/parseSource.d.ts +0 -3
  341. package/build/esm/parseSource/parseSource.d.ts.map +0 -1
  342. package/build/esm/transformRelativeMarkdownPaths/index.d.ts +0 -2
  343. package/build/esm/transformRelativeMarkdownPaths/index.d.ts.map +0 -1
  344. package/build/esm/transformRelativeMarkdownPaths/index.js +0 -4
  345. package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts +0 -12
  346. package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts.map +0 -1
  347. package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.js +0 -30
  348. package/build/esm/transformTsToJs/index.d.ts +0 -1
  349. package/build/esm/transformTsToJs/index.d.ts.map +0 -1
  350. package/build/esm/transformTsToJs/index.js +0 -1
  351. package/build/esm/transformTsToJs/removeTypes.d.ts.map +0 -1
  352. package/build/esm/transformTsToJs/transformTsToJs.d.ts +0 -3
  353. package/build/esm/transformTsToJs/transformTsToJs.d.ts.map +0 -1
  354. package/build/esm/useCode/index.d.ts.map +0 -1
  355. package/build/esm/useCode/useCode.d.ts +0 -37
  356. package/build/esm/useCode/useCode.d.ts.map +0 -1
  357. package/build/esm/useCode/useCode.js +0 -393
  358. package/build/esm/useCopier/index.d.ts.map +0 -1
  359. package/build/esm/useDemo/index.d.ts +0 -39
  360. package/build/esm/useDemo/index.d.ts.map +0 -1
  361. package/build/esm/useDemo/index.js +0 -17
  362. package/build/esm/useOnHydrate/index.d.ts.map +0 -1
  363. package/build/esm/useOnHydrate/useOnHydrate.d.ts.map +0 -1
  364. package/build/esm/useOnIdle/index.d.ts.map +0 -1
  365. package/build/esm/useOnIdle/useOnIdle.d.ts.map +0 -1
  366. package/build/hast/hast.d.ts +0 -11
  367. package/build/hast/hast.js +0 -75
  368. package/build/hast/index.d.ts +0 -1
  369. package/build/hast/index.js +0 -16
  370. package/build/loadPrecomputedCodeHighlighter/index.d.ts +0 -2
  371. package/build/loadPrecomputedCodeHighlighter/index.js +0 -9
  372. package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +0 -57
  373. package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +0 -201
  374. package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts +0 -20
  375. package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +0 -248
  376. package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts +0 -15
  377. package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.js +0 -174
  378. package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +0 -27
  379. package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +0 -43
  380. package/build/loadServerCodeMeta/index.d.ts +0 -1
  381. package/build/loadServerCodeMeta/index.js +0 -16
  382. package/build/loadServerCodeMeta/serverLoadCodeMeta.d.ts +0 -24
  383. package/build/loadServerCodeMeta/serverLoadCodeMeta.js +0 -85
  384. package/build/loadServerSource/index.d.ts +0 -1
  385. package/build/loadServerSource/index.js +0 -16
  386. package/build/loadServerSource/serverLoadSource.js +0 -108
  387. package/build/loaderUtils/getFileNameFromUrl.d.ts +0 -11
  388. package/build/loaderUtils/getFileNameFromUrl.js +0 -38
  389. package/build/loaderUtils/index.d.ts +0 -5
  390. package/build/loaderUtils/index.js +0 -60
  391. package/build/loaderUtils/processImports.d.ts +0 -19
  392. package/build/loaderUtils/processImports.js +0 -89
  393. package/build/loaderUtils/resolveImports.d.ts +0 -4
  394. package/build/loaderUtils/resolveImports.js +0 -78
  395. package/build/loaderUtils/resolveModulePath.d.ts +0 -74
  396. package/build/loaderUtils/resolveModulePath.js +0 -835
  397. package/build/loaderUtils/resolveModulePathWithFs.d.ts +0 -44
  398. package/build/loaderUtils/resolveModulePathWithFs.js +0 -163
  399. package/build/loaderUtils/rewriteImports.d.ts +0 -9
  400. package/build/loaderUtils/rewriteImports.js +0 -62
  401. package/build/package.json +0 -101
  402. package/build/parseSource/grammars.d.ts +0 -2
  403. package/build/parseSource/grammars.js +0 -34
  404. package/build/parseSource/index.d.ts +0 -1
  405. package/build/parseSource/index.js +0 -16
  406. package/build/parseSource/parseSource.d.ts +0 -3
  407. package/build/parseSource/parseSource.js +0 -44
  408. package/build/transformRelativeMarkdownPaths/index.d.ts +0 -2
  409. package/build/transformRelativeMarkdownPaths/index.js +0 -9
  410. package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts +0 -12
  411. package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.js +0 -36
  412. package/build/transformTsToJs/index.d.ts +0 -1
  413. package/build/transformTsToJs/index.js +0 -16
  414. package/build/transformTsToJs/removeTypes.d.ts +0 -13
  415. package/build/transformTsToJs/removeTypes.js +0 -141
  416. package/build/transformTsToJs/transformTsToJs.d.ts +0 -3
  417. package/build/transformTsToJs/transformTsToJs.js +0 -41
  418. package/build/useCode/index.d.ts +0 -1
  419. package/build/useCode/index.js +0 -16
  420. package/build/useCode/useCode.js +0 -401
  421. package/build/useCopier/index.d.ts +0 -15
  422. package/build/useCopier/index.js +0 -70
  423. package/build/useDemo/index.d.ts +0 -39
  424. package/build/useDemo/index.js +0 -25
  425. package/build/useOnHydrate/index.d.ts +0 -1
  426. package/build/useOnHydrate/index.js +0 -16
  427. package/build/useOnHydrate/useOnHydrate.d.ts +0 -1
  428. package/build/useOnHydrate/useOnHydrate.js +0 -26
  429. package/build/useOnIdle/index.d.ts +0 -1
  430. package/build/useOnIdle/index.js +0 -16
  431. package/build/useOnIdle/useOnIdle.d.ts +0 -1
  432. package/build/useOnIdle/useOnIdle.js +0 -47
  433. /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.js +0 -0
  434. /package/{build/CodeControllerContext → CodeControllerContext}/index.d.ts +0 -0
  435. /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.js +0 -0
  436. /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts +0 -0
  437. /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.js +0 -0
  438. /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts +0 -0
  439. /package/{build/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts +0 -0
  440. /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.js +0 -0
  441. /package/{build/CodeHighlighter → CodeHighlighter}/errors.d.ts +0 -0
  442. /package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.js +0 -0
  443. /package/{build/CodeHighlighter → CodeHighlighter}/hasAllVariants.d.ts +0 -0
  444. /package/{build/esm/CodeHighlighter → CodeHighlighter}/hasAllVariants.js +0 -0
  445. /package/{build/CodeHighlighter → CodeHighlighter}/index.d.ts +0 -0
  446. /package/{build/esm/CodeHighlighter → CodeHighlighter}/index.js +0 -0
  447. /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.js +0 -0
  448. /package/{build/CodeHighlighter → CodeHighlighter}/parseCode.d.ts +0 -0
  449. /package/{build/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts +0 -0
  450. /package/{build/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts +0 -0
  451. /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformParsedSource.js +0 -0
  452. /package/{build/CodeHighlighter → CodeHighlighter}/transformSource.d.ts +0 -0
  453. /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformSource.js +0 -0
  454. /package/{build/esm/CodeHighlighter → CodeHighlighter}/types.js +0 -0
  455. /package/{build/CodeProvider → CodeProvider}/CodeContext.d.ts +0 -0
  456. /package/{build/esm/CodeProvider → CodeProvider}/CodeContext.js +0 -0
  457. /package/{build/CodeProvider → CodeProvider}/CodeProvider.d.ts +0 -0
  458. /package/{build/LICENSE → LICENSE} +0 -0
  459. /package/{build/esm/hast/hast.d.ts → pipeline/hastUtils/hastUtils.d.ts} +0 -0
  460. /package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/index.d.ts +0 -0
  461. /package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/index.js +0 -0
  462. /package/{build/esm → pipeline}/loaderUtils/getFileNameFromUrl.d.ts +0 -0
  463. /package/{build/esm → pipeline}/loaderUtils/getFileNameFromUrl.js +0 -0
  464. /package/{build/esm → pipeline}/parseSource/grammars.d.ts +0 -0
  465. /package/{build/esm → pipeline}/parseSource/grammars.js +0 -0
  466. /package/{build/esm → pipeline}/parseSource/index.d.ts +0 -0
  467. /package/{build/esm → pipeline}/parseSource/index.js +0 -0
  468. /package/{build/esm/transformTsToJs → pipeline/transformTypescriptToJavascript}/removeTypes.d.ts +0 -0
  469. /package/{build/esm/transformTsToJs → pipeline/transformTypescriptToJavascript}/removeTypes.js +0 -0
  470. /package/{build/esm/useCode → useCode}/index.d.ts +0 -0
  471. /package/{build/esm/useCode → useCode}/index.js +0 -0
  472. /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts +0 -0
  473. /package/{build/esm/useOnHydrate → useOnHydrate}/index.js +0 -0
  474. /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.d.ts +0 -0
  475. /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.js +0 -0
  476. /package/{build/esm/useOnIdle → useOnIdle}/index.d.ts +0 -0
  477. /package/{build/esm/useOnIdle → useOnIdle}/index.js +0 -0
  478. /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.d.ts +0 -0
  479. /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.js +0 -0
@@ -1,10 +0,0 @@
1
- import { Code, VariantExtraFiles, VariantSource } from "./types.js";
2
- export declare function maybeInitialData(variants: string[], variant: string, code?: Code, fileName?: string, needsHighlight?: boolean, needsAllFiles?: boolean, needsAllVariants?: boolean): {
3
- initialData: false | {
4
- code: Code;
5
- initialFilename: string;
6
- initialSource: VariantSource;
7
- initialExtraFiles?: VariantExtraFiles;
8
- };
9
- reason?: string;
10
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"maybeInitialData.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/maybeInitialData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEjE,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,IAAI,EACX,QAAQ,CAAC,EAAE,MAAM,EACjB,cAAc,UAAQ,EACtB,aAAa,UAAQ,EACrB,gBAAgB,UAAQ,GACvB;IACD,WAAW,EACP,KAAK,GACL;QACE,IAAI,EAAE,IAAI,CAAC;QACX,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,aAAa,CAAC;QAC7B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;KACvC,CAAC;IACN,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAoGA"}
@@ -1,6 +0,0 @@
1
- import type { Code, ParseSource } from "./types.js";
2
- /**
3
- * Pure function to parse code variants and their extraFiles.
4
- * Converts string sources to HAST nodes and handles hastJson parsing.
5
- */
6
- export declare function parseCode(code: Code, parseSource: ParseSource): Code;
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseCode.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/parseCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAwHpE"}
@@ -1,6 +0,0 @@
1
- import type { Code, ControlledCode, ParseSource } from "./types.js";
2
- /**
3
- * Pure function to parse controlled code and convert it to regular Code format.
4
- * Handles the conversion from ControlledCode (string|null sources) to Code (HAST nodes).
5
- */
6
- export declare function parseControlledCode(controlledCode: ControlledCode, parseSource: ParseSource): Code;
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseControlledCode.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/parseControlledCode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,GACvB,IAAI,CAiEN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformCode.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/transformCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGjD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CA4B7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,IAAI,GAAG,SAAS,EAC5B,WAAW,EAAE,MAAM,GAClB,MAAM,EAAE,CAQV;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,GAAG,EAChB,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,GAAG,CAAC,CA6Ed;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B/F"}
@@ -1,3 +0,0 @@
1
- import type { Nodes } from 'hast';
2
- import { ParseSource, Transforms } from "./types.js";
3
- export declare function transformParsedSource(source: string, parsedSource: Nodes, filename: string, transforms: Transforms, parseSource: ParseSource): Promise<Record<string, any>>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformParsedSource.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/transformParsedSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIlD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,KAAK,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAwB9B"}
@@ -1,2 +0,0 @@
1
- import type { VariantSource, SourceTransformers, Transforms } from "./types.js";
2
- export declare function transformSource(source: VariantSource, fileName: string, sourceTransformers: SourceTransformers): Promise<Transforms | undefined>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformSource.d.ts","sourceRoot":"","sources":["../../../src/CodeHighlighter/transformSource.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI7E,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAu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rC"}
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import type { LoadCodeMeta, LoadSource, LoadVariantMeta, ParseSource, SourceTransformers } from "../CodeHighlighter/index.js";
3
- export interface CodeContext {
4
- sourceParser?: Promise<ParseSource>;
5
- parseSource?: ParseSource;
6
- sourceTransformers?: SourceTransformers;
7
- loadSource?: LoadSource;
8
- loadVariantMeta?: LoadVariantMeta;
9
- loadCodeMeta?: LoadCodeMeta;
10
- }
11
- export declare const CodeContext: React.Context<CodeContext>;
12
- export declare const useCodeContext: () => CodeContext;
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeContext.d.ts","sourceRoot":"","sources":["../../../src/CodeProvider/CodeContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,eAAe,EACf,WAAW,EACX,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAuC,CAAC;AAEhE,eAAO,MAAM,cAAc,mBAI1B,CAAC"}
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- import { LoadCodeMeta, LoadSource, LoadVariantMeta } from "../CodeHighlighter/index.js";
3
- export declare function CodeProvider({
4
- children,
5
- loadCodeMeta,
6
- loadVariantMeta,
7
- loadSource
8
- }: {
9
- children: React.ReactNode;
10
- loadCodeMeta?: LoadCodeMeta;
11
- loadVariantMeta?: LoadVariantMeta;
12
- loadSource?: LoadSource;
13
- }): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"CodeProvider.d.ts","sourceRoot":"","sources":["../../../src/CodeProvider/CodeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAG5F,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,2CAoCA"}
@@ -1,2 +0,0 @@
1
- export * from "./CodeProvider.js";
2
- export * from "./CodeContext.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CodeProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./CodeProvider.js";
2
- export * from "./CodeContext.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"hast.d.ts","sourceRoot":"","sources":["../../../src/hast/hast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAM/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,CAE1D;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAa7F;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAiB9F;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjD,WAAW,CAAC,EAAE,OAAO,GACpB,KAAK,CAAC,SAAS,CAqBjB"}
@@ -1 +0,0 @@
1
- export * from "./hast.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hast/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./hast.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadPrecomputedCodeHighlighter/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,eAAe,8BAA8B,CAAC"}
@@ -1,57 +0,0 @@
1
- interface LoaderContext {
2
- resourcePath: string;
3
- addDependency(dependency: string): void;
4
- async(): (err?: Error | null, content?: string) => void;
5
- cacheable(): void;
6
- }
7
- /**
8
- * Webpack loader that processes demo files and precomputes variant data.
9
- *
10
- * This loader:
11
- * 1. Parses demo files to find a single createDemo call with precompute: true
12
- * 2. Resolves all variant entry point paths using resolveModulePathsWithFs
13
- * 3. Uses loadVariant to handle all loading, parsing, and transformation:
14
- * - loadSource: Loads individual files and extracts dependencies
15
- * - loadVariantMeta: Creates basic variant structure
16
- * - parseSource: Applies syntax highlighting using Starry Night
17
- * - sourceTransformers: Handles TypeScript to JavaScript conversion
18
- * 4. loadVariant handles recursive dependency loading automatically
19
- * 5. Adds all dependencies to webpack's watch list
20
- * 6. Replaces precompute: true with the actual precomputed data using replacePrecomputeValue
21
- *
22
- * Note: Only supports one createDemo call per file. Will throw an error if multiple calls are found.
23
- *
24
- * Features:
25
- * - Proper variant entry point resolution using resolveModulePathsWithFs
26
- * - Complete dependency tree loading handled by loadVariant
27
- * - Syntax highlighting using Starry Night (via parseSource)
28
- * - TypeScript to JavaScript transformation (via transformTsToJs)
29
- * - Webpack dependency tracking for hot reloading
30
- * - Precise precompute value replacement (via replacePrecomputeValue)
31
- *
32
- * Example input:
33
- * ```typescript
34
- * import { createDemo } from '@/functions/createDemo';
35
- * import CssModules from './CssModules';
36
- * import Tailwind from './Tailwind';
37
- *
38
- * export const CodeDemo = createDemo(
39
- * import.meta.url,
40
- * { CssModules, Tailwind },
41
- * {
42
- * name: 'Basic Code Block',
43
- * slug: 'code',
44
- * precompute: true,
45
- * },
46
- * );
47
- * ```
48
- *
49
- * Example output (precompute: true replaced with processed data):
50
- * The precompute property is replaced with an object containing:
51
- * - fileName: The main file name
52
- * - source: HAST nodes with syntax highlighting applied
53
- * - extraFiles: Object containing additional dependency files
54
- * - transforms: Object with language variants (e.g., JavaScript version from TypeScript)
55
- */
56
- export declare function loadPrecomputedCodeHighlighter(this: LoaderContext, source: string): Promise<void>;
57
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadPrecomputedCodeHighlighter.d.ts","sourceRoot":"","sources":["../../../src/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.ts"],"names":[],"mappings":"AASA,UAAU,aAAa;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,SAAS,IAAI,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CA4Ff"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseCreateFactoryCall.d.ts","sourceRoot":"","sources":["../../../src/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAgFD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAiErC"}
@@ -1,243 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
- import { resolveImports } from "../loaderUtils/index.js";
5
- import { parseFunctionParameters } from "./parseFunctionParameters.js";
6
-
7
- /**
8
- * Helper function to convert the new resolveImports format to a Map
9
- * that maps import names to their resolved paths
10
- */
11
- function buildImportMap(importResult) {
12
- var importMap = new Map();
13
- Object.values(importResult).forEach(function (_ref) {
14
- var path = _ref.path,
15
- names = _ref.names;
16
- names.forEach(function (name) {
17
- importMap.set(name, path);
18
- });
19
- });
20
- return importMap;
21
- }
22
- /**
23
- * Parses a variants object string and maps variant names to their import paths
24
- */
25
- function parseVariantsObject(variantsObjectStr, importMap) {
26
- var demoImports = {};
27
-
28
- // Parse the demo object to extract key-value pairs
29
- // Handle both { Default: BasicCode } and { Default } syntax
30
- var objectContentRegex = /(\w+)(?:\s*:\s*(\w+))?/g;
31
- var objectMatch = objectContentRegex.exec(variantsObjectStr);
32
- while (objectMatch !== null) {
33
- var _objectMatch = objectMatch,
34
- _objectMatch2 = _slicedToArray(_objectMatch, 3),
35
- key = _objectMatch2[1],
36
- value = _objectMatch2[2];
37
- var importName = value || key; // Use value if provided, otherwise use key (shorthand syntax)
38
-
39
- if (importMap.has(importName)) {
40
- demoImports[key] = importMap.get(importName);
41
- }
42
- objectMatch = objectContentRegex.exec(variantsObjectStr);
43
- }
44
- return demoImports;
45
- }
46
-
47
- /**
48
- * Validates that a URL parameter follows the expected convention
49
- */
50
- function validateUrlParameter(url, functionName, filePath) {
51
- var trimmedUrl = url.trim();
52
-
53
- // Check for import.meta.url
54
- if (trimmedUrl === 'import.meta.url') {
55
- return;
56
- }
57
-
58
- // Check for CJS equivalent: require('url').pathToFileURL(__filename).toString()
59
- // https://github.com/javiertury/babel-plugin-transform-import-meta#importmetaurl
60
- var cjsPattern = /require\s*\(\s*['"`]url['"`]\s*\)\s*\.\s*pathToFileURL\s*\(\s*__filename\s*\)\s*\.\s*toString\s*\(\s*\)/;
61
- if (cjsPattern.test(trimmedUrl)) {
62
- return;
63
- }
64
- throw new Error("Invalid URL parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected 'import.meta.url' or 'require('url').pathToFileURL(__filename).toString()' but got: ".concat(trimmedUrl));
65
- }
66
-
67
- /**
68
- * Validates that a variants parameter is an object mapping to imports
69
- */
70
- function validateVariantsParameter(variantsObjectStr, functionName, filePath) {
71
- if (!variantsObjectStr || variantsObjectStr.trim() === '') {
72
- throw new Error("Invalid variants parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected an object mapping variant names to imports.");
73
- }
74
-
75
- // Basic validation that it looks like an object
76
- var trimmed = variantsObjectStr.trim();
77
- if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
78
- throw new Error("Invalid variants parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected an object but got: ".concat(trimmed));
79
- }
80
- }
81
-
82
- /**
83
- * Parses a file to extract a single create* factory call and its variants and options
84
- * Only supports one create* call per file - will throw an error if multiple are found
85
- * Returns null if no create* call is found
86
- */
87
- export function parseCreateFactoryCall(_x, _x2) {
88
- return _parseCreateFactoryCall.apply(this, arguments);
89
- }
90
-
91
- /**
92
- * Finds create* factory calls in code, handling multiline cases
93
- */
94
- function _parseCreateFactoryCall() {
95
- _parseCreateFactoryCall = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, filePath) {
96
- var importResult, importMap, createFactoryMatches, match, functionName, fullMatch, urlParam, variantsObjectStr, optionsObjectStr, url, variants, options, nameMatch, slugMatch, precomputeMatch;
97
- return _regeneratorRuntime().wrap(function _callee$(_context) {
98
- while (1) switch (_context.prev = _context.next) {
99
- case 0:
100
- _context.next = 2;
101
- return resolveImports(code, filePath);
102
- case 2:
103
- importResult = _context.sent;
104
- importMap = buildImportMap(importResult); // Find all create* calls in the code
105
- createFactoryMatches = findCreateFactoryCalls(code, filePath); // Enforce single create* call per file
106
- if (!(createFactoryMatches.length > 1)) {
107
- _context.next = 7;
108
- break;
109
- }
110
- throw new Error("Multiple create* factory calls found in ".concat(filePath, ". Only one create* call per file is supported. Found ").concat(createFactoryMatches.length, " calls."));
111
- case 7:
112
- if (!(createFactoryMatches.length === 0)) {
113
- _context.next = 9;
114
- break;
115
- }
116
- return _context.abrupt("return", null);
117
- case 9:
118
- match = createFactoryMatches[0];
119
- functionName = match.functionName, fullMatch = match.fullMatch, urlParam = match.urlParam, variantsObjectStr = match.variantsObjectStr, optionsObjectStr = match.optionsObjectStr; // Validate URL parameter
120
- validateUrlParameter(urlParam, functionName, filePath);
121
-
122
- // Validate variants parameter
123
- validateVariantsParameter(variantsObjectStr, functionName, filePath);
124
-
125
- // Extract URL (typically import.meta.url)
126
- url = urlParam.trim(); // Resolve variants for this specific create* call
127
- variants = parseVariantsObject(variantsObjectStr, importMap); // Parse options object
128
- options = {}; // Extract name
129
- nameMatch = optionsObjectStr.match(/name\s*:\s*['"`]([^'"`]+)['"`]/);
130
- if (nameMatch) {
131
- options.name = nameMatch[1];
132
- }
133
-
134
- // Extract slug
135
- slugMatch = optionsObjectStr.match(/slug\s*:\s*['"`]([^'"`]+)['"`]/);
136
- if (slugMatch) {
137
- options.slug = slugMatch[1];
138
- }
139
-
140
- // Extract precompute
141
- precomputeMatch = optionsObjectStr.match(/precompute\s*:\s*(true|false)/);
142
- if (precomputeMatch) {
143
- options.precompute = precomputeMatch[1] === 'true';
144
- }
145
- return _context.abrupt("return", {
146
- functionName: functionName,
147
- url: url,
148
- variants: variants,
149
- options: options,
150
- fullMatch: fullMatch,
151
- variantsObjectStr: variantsObjectStr,
152
- optionsObjectStr: optionsObjectStr
153
- });
154
- case 23:
155
- case "end":
156
- return _context.stop();
157
- }
158
- }, _callee);
159
- }));
160
- return _parseCreateFactoryCall.apply(this, arguments);
161
- }
162
- function findCreateFactoryCalls(code, filePath) {
163
- var results = [];
164
-
165
- // Find all create* function calls
166
- var createFactoryRegex = /\b(create\w*)\s*\(/g;
167
- var match = createFactoryRegex.exec(code);
168
- while (match !== null) {
169
- var functionName = match[1];
170
- var startIndex = match.index;
171
- var parenIndex = match.index + match[0].length - 1; // Position of opening parenthesis
172
-
173
- // Find the matching closing parenthesis
174
- var parenCount = 0;
175
- var endIndex = -1;
176
- for (var i = parenIndex; i < code.length; i += 1) {
177
- if (code[i] === '(') {
178
- parenCount += 1;
179
- } else if (code[i] === ')') {
180
- parenCount -= 1;
181
- if (parenCount === 0) {
182
- endIndex = i;
183
- break;
184
- }
185
- }
186
- }
187
- if (endIndex === -1) {
188
- match = createFactoryRegex.exec(code);
189
- continue;
190
- }
191
- var fullMatch = code.substring(startIndex, endIndex + 1);
192
- var content = code.substring(parenIndex + 1, endIndex);
193
-
194
- // Split by commas at the top level, handling nested structures and comments
195
- var _parseFunctionParamet = parseFunctionParameters(content),
196
- parts = _parseFunctionParamet.parts,
197
- objects = _parseFunctionParamet.objects;
198
-
199
- // Validate the function follows the convention
200
- if (parts.length < 2 || parts.length > 3) {
201
- throw new Error("Invalid ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected 2-3 parameters (url, variants, options?) but got ".concat(parts.length, " parameters. ") + "Functions starting with 'create' must follow the convention: create*(url, variants, options?)");
202
- }
203
- if (parts.length === 2) {
204
- var _parts = _slicedToArray(parts, 1),
205
- urlParam = _parts[0];
206
-
207
- // Extract the actual object string for variants
208
- var variantsObjectStr = objects[1];
209
- if (!variantsObjectStr) {
210
- throw new Error("Invalid variants parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected an object but could not parse: ".concat(parts[1].trim()));
211
- }
212
- results.push({
213
- functionName: functionName,
214
- fullMatch: fullMatch,
215
- urlParam: urlParam.trim(),
216
- variantsObjectStr: variantsObjectStr,
217
- optionsObjectStr: '{}' // Default empty options
218
- });
219
- } else if (parts.length === 3) {
220
- var _parts2 = _slicedToArray(parts, 1),
221
- _urlParam = _parts2[0];
222
-
223
- // Extract the actual object strings
224
- var _variantsObjectStr = objects[1];
225
- var optionsObjectStr = objects[2];
226
- if (!_variantsObjectStr) {
227
- throw new Error("Invalid variants parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected an object but could not parse: ".concat(parts[1].trim()));
228
- }
229
- if (!optionsObjectStr) {
230
- throw new Error("Invalid options parameter in ".concat(functionName, " call in ").concat(filePath, ". ") + "Expected an object but could not parse: ".concat(parts[2].trim()));
231
- }
232
- results.push({
233
- functionName: functionName,
234
- fullMatch: fullMatch,
235
- urlParam: _urlParam.trim(),
236
- variantsObjectStr: _variantsObjectStr,
237
- optionsObjectStr: optionsObjectStr
238
- });
239
- }
240
- match = createFactoryRegex.exec(code);
241
- }
242
- return results;
243
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseFunctionParameters.d.ts","sourceRoot":"","sources":["../../../src/loadPrecomputedCodeHighlighter/parseFunctionParameters.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8EAA8E;IAC9E,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CA8FrE"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Replaces 'precompute: true' with the actual precomputed data in source code.
3
- *
4
- * This function performs a precise replacement of the boolean true value in
5
- * 'precompute: true' expressions with the provided data object, keeping the
6
- * rest of the source code unchanged.
7
- *
8
- * @param source - The source code string containing 'precompute: true'
9
- * @param precomputeData - The data object to replace the true value with
10
- * @returns The modified source code with precompute data injected
11
- *
12
- * @example
13
- * ```typescript
14
- * const source = `
15
- * export const demo = createDemo(
16
- * import.meta.url,
17
- * { Component },
18
- * { precompute: true }
19
- * );
20
- * `;
21
- *
22
- * const data = { variants: { default: { code: "..." } } };
23
- * const result = replacePrecomputeValue(source, data);
24
- * // Result will have 'precompute: true' replaced with 'precompute: { variants: { default: { code: "..." } } }'
25
- * ```
26
- */
27
- export declare function replacePrecomputeValue(source: string, precomputeData: Record<string, any>): string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"replacePrecomputeValue.d.ts","sourceRoot":"","sources":["../../../src/loadPrecomputedCodeHighlighter/replacePrecomputeValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAClC,MAAM,CAUR"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Replaces 'precompute: true' with the actual precomputed data in source code.
3
- *
4
- * This function performs a precise replacement of the boolean true value in
5
- * 'precompute: true' expressions with the provided data object, keeping the
6
- * rest of the source code unchanged.
7
- *
8
- * @param source - The source code string containing 'precompute: true'
9
- * @param precomputeData - The data object to replace the true value with
10
- * @returns The modified source code with precompute data injected
11
- *
12
- * @example
13
- * ```typescript
14
- * const source = `
15
- * export const demo = createDemo(
16
- * import.meta.url,
17
- * { Component },
18
- * { precompute: true }
19
- * );
20
- * `;
21
- *
22
- * const data = { variants: { default: { code: "..." } } };
23
- * const result = replacePrecomputeValue(source, data);
24
- * // Result will have 'precompute: true' replaced with 'precompute: { variants: { default: { code: "..." } } }'
25
- * ```
26
- */
27
- export function replacePrecomputeValue(source, precomputeData) {
28
- // Regex to match 'precompute: true' with optional whitespace
29
- var precomputeRegex = /precompute\s*:\s*true/g;
30
-
31
- // Convert the data to a properly formatted JSON string
32
- var precomputeDataString = JSON.stringify(precomputeData, null, 2);
33
-
34
- // Replace 'precompute: true' with 'precompute: {data}'
35
- // The regex will match the exact pattern and we replace just that part
36
- return source.replace(precomputeRegex, "precompute: ".concat(precomputeDataString));
37
- }
@@ -1 +0,0 @@
1
- export * from "./serverLoadCodeMeta.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadServerCodeMeta/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./serverLoadCodeMeta.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"serverLoadCodeMeta.d.ts","sourceRoot":"","sources":["../../../src/loadServerCodeMeta/serverLoadCodeMeta.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AAInE,MAAM,WAAW,yBAAyB;CAEzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,cAA6B,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,GAAE,yBAA8B,GAAG,YAAY,CA4B/F"}
@@ -1 +0,0 @@
1
- export * from "./serverLoadSource.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadServerSource/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./serverLoadSource.js";
@@ -1,25 +0,0 @@
1
- import type { LoadSource } from "../CodeHighlighter/types.js";
2
- import { type StoreAtMode } from "../loaderUtils/processImports.js";
3
- interface LoadSourceOptions {
4
- maxDepth?: number;
5
- maxFiles?: number;
6
- includeDependencies?: boolean;
7
- storeAt?: StoreAtMode;
8
- }
9
- /**
10
- * Default serverLoadSource function that reads a file and extracts its dependencies.
11
- * This function is used to load source files for demos, resolving their imports and dependencies.
12
- * It reads the source file, resolves its imports, and returns the processed source along with any
13
- * additional files and dependencies that were found.
14
- */
15
- export declare const serverLoadSource: LoadSource;
16
- /**
17
- * Creates a loadSource function that reads a file and extracts its dependencies.
18
- *
19
- * @param options.storeAt - Controls how imports are stored in extraFiles:
20
- * - 'canonical': Full resolved path (e.g., '../Component/index.js')
21
- * - 'import': Import path with file extension (e.g., '../Component.js')
22
- * - 'flat': Flattened to current directory with rewritten imports (e.g., './Component.js')
23
- */
24
- export declare function createServerLoadSource(options?: LoadSourceOptions): LoadSource;
25
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"serverLoadSource.d.ts","sourceRoot":"","sources":["../../../src/loadServerSource/serverLoadSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5F,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAA2B,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAmDlF"}