@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.
- package/{build/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts +1 -1
- package/CodeControllerContext/CodeControllerContext.d.ts.map +1 -0
- package/CodeControllerContext/index.d.ts.map +1 -0
- package/CodeExternalsContext/CodeExternalsContext.d.ts +8 -0
- package/CodeExternalsContext/CodeExternalsContext.d.ts.map +1 -0
- package/CodeExternalsContext/CodeExternalsContext.js +7 -0
- package/CodeExternalsContext/index.d.ts +1 -0
- package/CodeExternalsContext/index.d.ts.map +1 -0
- package/CodeExternalsContext/index.js +1 -0
- package/CodeHighlighter/CodeHighlighter.d.ts +2 -0
- package/CodeHighlighter/CodeHighlighter.d.ts.map +1 -0
- package/CodeHighlighter/CodeHighlighter.js +470 -0
- package/CodeHighlighter/CodeHighlighterClient.d.ts.map +1 -0
- package/CodeHighlighter/CodeHighlighterClient.js +837 -0
- package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts +2 -0
- package/CodeHighlighter/CodeHighlighterContext.d.ts.map +1 -0
- package/CodeHighlighter/CodeHighlighterFallbackContext.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.js +3 -1
- package/CodeHighlighter/applyTransform.d.ts.map +1 -0
- package/{build/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts +2 -2
- package/CodeHighlighter/codeToFallbackProps.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.js +8 -5
- package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.d.ts.map +1 -1
- package/CodeHighlighter/hasAllVariants.d.ts.map +1 -0
- package/CodeHighlighter/index.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts +3 -2
- package/CodeHighlighter/loadFallbackCode.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.js +325 -161
- package/CodeHighlighter/loadVariant.d.ts +12 -0
- package/CodeHighlighter/loadVariant.d.ts.map +1 -0
- package/CodeHighlighter/loadVariant.js +1083 -0
- package/{build/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts +1 -1
- package/CodeHighlighter/maybeInitialData.d.ts.map +1 -0
- package/CodeHighlighter/parseCode.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.js +14 -2
- package/CodeHighlighter/parseControlledCode.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.js +12 -1
- package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.d.ts +1 -0
- package/CodeHighlighter/transformCode.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.js +43 -3
- package/CodeHighlighter/transformParsedSource.d.ts.map +1 -0
- package/CodeHighlighter/transformSource.d.ts.map +1 -0
- package/{build/esm/CodeHighlighter → CodeHighlighter}/types.d.ts +39 -17
- package/CodeHighlighter/types.d.ts.map +1 -0
- package/CodeProvider/CodeContext.d.ts.map +1 -0
- package/CodeProvider/CodeProvider.d.ts.map +1 -0
- package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.js +21 -6
- package/CodeProvider/index.d.ts +1 -0
- package/CodeProvider/index.d.ts.map +1 -0
- package/CodeProvider/index.js +1 -0
- package/abstractCreateDemo/abstractCreateDemo.d.ts +35 -0
- package/abstractCreateDemo/abstractCreateDemo.d.ts.map +1 -0
- package/abstractCreateDemo/abstractCreateDemo.js +91 -0
- package/abstractCreateDemo/index.d.ts +1 -0
- package/abstractCreateDemo/index.d.ts.map +1 -0
- package/abstractCreateDemo/index.js +1 -0
- package/createDemoData/createDemoData.d.ts +44 -0
- package/createDemoData/createDemoData.d.ts.map +1 -0
- package/createDemoData/createDemoData.js +75 -0
- package/createDemoData/index.d.ts +1 -0
- package/createDemoData/index.d.ts.map +1 -0
- package/createDemoData/index.js +1 -0
- package/createDemoData/types.d.ts +28 -0
- package/createDemoData/types.d.ts.map +1 -0
- package/createDemoData/types.js +1 -0
- package/package.json +20 -73
- package/pipeline/hastUtils/hastUtils.d.ts.map +1 -0
- package/{build/esm/hast/hast.js → pipeline/hastUtils/hastUtils.js} +2 -1
- package/pipeline/hastUtils/index.d.ts +1 -0
- package/pipeline/hastUtils/index.d.ts.map +1 -0
- package/pipeline/hastUtils/index.js +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.d.ts +54 -0
- package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.d.ts.map +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/emitExternalsProvider.js +465 -0
- package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.d.ts +15 -0
- package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.d.ts.map +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/generateExternalsProvider.js +253 -0
- package/pipeline/loadPrecomputedCodeHighlighter/index.d.ts.map +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +20 -0
- package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts.map +1 -0
- package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +105 -75
- package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts +12 -1
- package/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts.map +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +433 -0
- package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts +5 -1
- package/pipeline/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts.map +1 -0
- package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/parseFunctionParameters.js +1 -1
- package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +25 -0
- package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts.map +1 -0
- package/pipeline/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +73 -0
- package/pipeline/loadServerCodeMeta/index.d.ts +1 -0
- package/pipeline/loadServerCodeMeta/index.d.ts.map +1 -0
- package/pipeline/loadServerCodeMeta/index.js +1 -0
- package/{build/esm/loadServerCodeMeta/serverLoadCodeMeta.d.ts → pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts} +4 -4
- package/pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts.map +1 -0
- package/{build/esm/loadServerCodeMeta/serverLoadCodeMeta.js → pipeline/loadServerCodeMeta/loadServerCodeMeta.js} +18 -3
- package/pipeline/loadServerSource/index.d.ts +1 -0
- package/pipeline/loadServerSource/index.d.ts.map +1 -0
- package/pipeline/loadServerSource/index.js +1 -0
- package/{build/loadServerSource/serverLoadSource.d.ts → pipeline/loadServerSource/loadServerSource.d.ts} +5 -5
- package/pipeline/loadServerSource/loadServerSource.d.ts.map +1 -0
- package/pipeline/loadServerSource/loadServerSource.js +135 -0
- package/pipeline/loaderUtils/externalsToPackages.d.ts +1 -0
- package/pipeline/loaderUtils/externalsToPackages.d.ts.map +1 -0
- package/pipeline/loaderUtils/externalsToPackages.js +46 -0
- package/pipeline/loaderUtils/extractNameAndSlugFromUrl.d.ts +34 -0
- package/pipeline/loaderUtils/extractNameAndSlugFromUrl.d.ts.map +1 -0
- package/pipeline/loaderUtils/extractNameAndSlugFromUrl.js +161 -0
- package/pipeline/loaderUtils/getFileNameFromUrl.d.ts.map +1 -0
- package/pipeline/loaderUtils/index.d.ts +7 -0
- package/pipeline/loaderUtils/index.d.ts.map +1 -0
- package/pipeline/loaderUtils/index.js +7 -0
- package/pipeline/loaderUtils/mergeExternals.d.ts +32 -0
- package/pipeline/loaderUtils/mergeExternals.d.ts.map +1 -0
- package/pipeline/loaderUtils/mergeExternals.js +72 -0
- package/pipeline/loaderUtils/parseImports.d.ts +20 -0
- package/pipeline/loaderUtils/parseImports.d.ts.map +1 -0
- package/pipeline/loaderUtils/parseImports.js +307 -0
- package/{build/esm/loaderUtils/processImports.d.ts → pipeline/loaderUtils/processRelativeImports.d.ts} +2 -2
- package/pipeline/loaderUtils/processRelativeImports.d.ts.map +1 -0
- package/pipeline/loaderUtils/processRelativeImports.js +329 -0
- package/{build/esm → pipeline}/loaderUtils/resolveModulePath.d.ts +19 -6
- package/pipeline/loaderUtils/resolveModulePath.d.ts.map +1 -0
- package/pipeline/loaderUtils/resolveModulePath.js +1449 -0
- package/{build/esm → pipeline}/loaderUtils/resolveModulePathWithFs.d.ts +6 -3
- package/pipeline/loaderUtils/resolveModulePathWithFs.d.ts.map +1 -0
- package/{build/esm → pipeline}/loaderUtils/resolveModulePathWithFs.js +8 -4
- package/pipeline/loaderUtils/rewriteImports.d.ts +9 -0
- package/pipeline/loaderUtils/rewriteImports.d.ts.map +1 -0
- package/pipeline/loaderUtils/rewriteImports.js +35 -0
- package/pipeline/parseSource/grammars.d.ts.map +1 -0
- package/pipeline/parseSource/index.d.ts.map +1 -0
- package/pipeline/parseSource/parseSource.d.ts +3 -0
- package/pipeline/parseSource/parseSource.d.ts.map +1 -0
- package/{build/esm → pipeline}/parseSource/parseSource.js +15 -5
- package/pipeline/transformHtmlCode/index.d.ts +2 -0
- package/pipeline/transformHtmlCode/index.d.ts.map +1 -0
- package/pipeline/transformHtmlCode/index.js +4 -0
- package/pipeline/transformHtmlCode/transformHtmlCode.d.ts +13 -0
- package/pipeline/transformHtmlCode/transformHtmlCode.d.ts.map +1 -0
- package/pipeline/transformHtmlCode/transformHtmlCode.js +303 -0
- package/pipeline/transformMarkdownCode/index.d.ts +2 -0
- package/pipeline/transformMarkdownCode/index.d.ts.map +1 -0
- package/pipeline/transformMarkdownCode/index.js +4 -0
- package/pipeline/transformMarkdownCode/transformMarkdownCode.d.ts +2 -0
- package/pipeline/transformMarkdownCode/transformMarkdownCode.d.ts.map +1 -0
- package/pipeline/transformMarkdownCode/transformMarkdownCode.js +514 -0
- package/pipeline/transformTypescriptToJavascript/index.d.ts +1 -0
- package/pipeline/transformTypescriptToJavascript/index.d.ts.map +1 -0
- package/pipeline/transformTypescriptToJavascript/index.js +1 -0
- package/pipeline/transformTypescriptToJavascript/removeTypes.d.ts.map +1 -0
- package/pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.d.ts +3 -0
- package/pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.d.ts.map +1 -0
- package/{build/esm/transformTsToJs/transformTsToJs.js → pipeline/transformTypescriptToJavascript/transformTypescriptToJavascript.js} +4 -4
- package/useCode/index.d.ts.map +1 -0
- package/{build/useCode → useCode}/useCode.d.ts +13 -11
- package/useCode/useCode.d.ts.map +1 -0
- package/useCode/useCode.js +122 -0
- package/useCode/useCodeUtils.d.ts +45 -0
- package/useCode/useCodeUtils.d.ts.map +1 -0
- package/useCode/useCodeUtils.js +240 -0
- package/useCode/useCopyFunctionality.d.ts +17 -0
- package/useCode/useCopyFunctionality.d.ts.map +1 -0
- package/useCode/useCopyFunctionality.js +28 -0
- package/useCode/useFileNavigation.d.ts +48 -0
- package/useCode/useFileNavigation.d.ts.map +1 -0
- package/useCode/useFileNavigation.js +370 -0
- package/useCode/useSourceEditing.d.ts +19 -0
- package/useCode/useSourceEditing.d.ts.map +1 -0
- package/useCode/useSourceEditing.js +32 -0
- package/useCode/useTransformManagement.d.ts +28 -0
- package/useCode/useTransformManagement.d.ts.map +1 -0
- package/useCode/useTransformManagement.js +82 -0
- package/useCode/useUIState.d.ts +16 -0
- package/useCode/useUIState.d.ts.map +1 -0
- package/useCode/useUIState.js +21 -0
- package/useCode/useVariantSelection.d.ts +21 -0
- package/useCode/useVariantSelection.d.ts.map +1 -0
- package/useCode/useVariantSelection.js +84 -0
- package/{build/esm/useCopier → useCopier}/index.d.ts +1 -1
- package/useCopier/index.d.ts.map +1 -0
- package/{build/esm/useCopier → useCopier}/index.js +5 -5
- package/useDemo/createCodeSandbox.d.ts +18 -0
- package/useDemo/createCodeSandbox.d.ts.map +1 -0
- package/useDemo/createCodeSandbox.js +48 -0
- package/useDemo/createStackBlitz.d.ts +22 -0
- package/useDemo/createStackBlitz.d.ts.map +1 -0
- package/useDemo/createStackBlitz.js +38 -0
- package/useDemo/examineVariant.d.ts +25 -0
- package/useDemo/examineVariant.d.ts.map +1 -0
- package/useDemo/examineVariant.js +134 -0
- package/useDemo/exportVariant.d.ts +110 -0
- package/useDemo/exportVariant.d.ts.map +1 -0
- package/useDemo/exportVariant.js +320 -0
- package/useDemo/exportVariantAsCra.d.ts +15 -0
- package/useDemo/exportVariantAsCra.d.ts.map +1 -0
- package/useDemo/exportVariantAsCra.js +56 -0
- package/useDemo/flattenVariant.d.ts +17 -0
- package/useDemo/flattenVariant.d.ts.map +1 -0
- package/useDemo/flattenVariant.js +206 -0
- package/useDemo/index.d.ts +6 -0
- package/useDemo/index.d.ts.map +1 -0
- package/useDemo/index.js +6 -0
- package/useDemo/useDemo.d.ts +78 -0
- package/useDemo/useDemo.d.ts.map +1 -0
- package/useDemo/useDemo.js +174 -0
- package/useLocalStorageState/index.d.ts +2 -0
- package/useLocalStorageState/index.d.ts.map +1 -0
- package/useLocalStorageState/index.js +2 -0
- package/useLocalStorageState/useLocalStorageState.d.ts +14 -0
- package/useLocalStorageState/useLocalStorageState.d.ts.map +1 -0
- package/useLocalStorageState/useLocalStorageState.js +128 -0
- package/useOnHydrate/index.d.ts.map +1 -0
- package/useOnHydrate/useOnHydrate.d.ts.map +1 -0
- package/useOnIdle/index.d.ts.map +1 -0
- package/useOnIdle/useOnIdle.d.ts.map +1 -0
- package/useUrlHashState/index.d.ts +1 -0
- package/useUrlHashState/index.d.ts.map +1 -0
- package/useUrlHashState/index.js +1 -0
- package/useUrlHashState/useUrlHashState.d.ts +50 -0
- package/useUrlHashState/useUrlHashState.d.ts.map +1 -0
- package/useUrlHashState/useUrlHashState.js +113 -0
- package/build/CodeControllerContext/CodeControllerContext.js +0 -21
- package/build/CodeControllerContext/index.js +0 -16
- package/build/CodeHighlighter/CodeHighlighter.d.ts +0 -2
- package/build/CodeHighlighter/CodeHighlighter.js +0 -329
- package/build/CodeHighlighter/CodeHighlighterClient.js +0 -406
- package/build/CodeHighlighter/CodeHighlighterContext.js +0 -22
- package/build/CodeHighlighter/CodeHighlighterFallbackContext.js +0 -18
- package/build/CodeHighlighter/applyTransform.js +0 -83
- package/build/CodeHighlighter/codeToFallbackProps.js +0 -77
- package/build/CodeHighlighter/errors.js +0 -2
- package/build/CodeHighlighter/hasAllVariants.js +0 -37
- package/build/CodeHighlighter/index.js +0 -49
- package/build/CodeHighlighter/loadFallbackCode.d.ts +0 -9
- package/build/CodeHighlighter/loadFallbackCode.js +0 -474
- package/build/CodeHighlighter/loadVariant.d.ts +0 -11
- package/build/CodeHighlighter/loadVariant.js +0 -715
- package/build/CodeHighlighter/maybeInitialData.js +0 -101
- package/build/CodeHighlighter/parseCode.js +0 -129
- package/build/CodeHighlighter/parseControlledCode.js +0 -83
- package/build/CodeHighlighter/transformCode.d.ts +0 -20
- package/build/CodeHighlighter/transformCode.js +0 -231
- package/build/CodeHighlighter/transformParsedSource.js +0 -73
- package/build/CodeHighlighter/transformSource.js +0 -114
- package/build/CodeHighlighter/types.d.ts +0 -138
- package/build/CodeHighlighter/types.js +0 -5
- package/build/CodeProvider/CodeContext.js +0 -14
- package/build/CodeProvider/CodeProvider.js +0 -57
- package/build/CodeProvider/index.d.ts +0 -2
- package/build/CodeProvider/index.js +0 -27
- package/build/README.md +0 -19
- package/build/esm/CodeControllerContext/CodeControllerContext.d.ts +0 -22
- package/build/esm/CodeControllerContext/CodeControllerContext.d.ts.map +0 -1
- package/build/esm/CodeControllerContext/index.d.ts +0 -1
- package/build/esm/CodeControllerContext/index.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighter.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighter.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighter.js +0 -321
- package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighterClient.js +0 -399
- package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts +0 -14
- package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts +0 -7
- package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/applyTransform.d.ts +0 -19
- package/build/esm/CodeHighlighter/applyTransform.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts +0 -2
- package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/errors.d.ts +0 -0
- package/build/esm/CodeHighlighter/hasAllVariants.d.ts +0 -2
- package/build/esm/CodeHighlighter/hasAllVariants.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/index.d.ts +0 -4
- package/build/esm/CodeHighlighter/index.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/loadFallbackCode.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/loadVariant.d.ts +0 -11
- package/build/esm/CodeHighlighter/loadVariant.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/loadVariant.js +0 -708
- package/build/esm/CodeHighlighter/maybeInitialData.d.ts +0 -10
- package/build/esm/CodeHighlighter/maybeInitialData.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/parseCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/parseCode.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/parseControlledCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/parseControlledCode.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/transformCode.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
- package/build/esm/CodeHighlighter/transformParsedSource.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/transformSource.d.ts +0 -2
- package/build/esm/CodeHighlighter/transformSource.d.ts.map +0 -1
- package/build/esm/CodeHighlighter/types.d.ts.map +0 -1
- package/build/esm/CodeProvider/CodeContext.d.ts +0 -12
- package/build/esm/CodeProvider/CodeContext.d.ts.map +0 -1
- package/build/esm/CodeProvider/CodeProvider.d.ts +0 -13
- package/build/esm/CodeProvider/CodeProvider.d.ts.map +0 -1
- package/build/esm/CodeProvider/index.d.ts +0 -2
- package/build/esm/CodeProvider/index.d.ts.map +0 -1
- package/build/esm/CodeProvider/index.js +0 -2
- package/build/esm/hast/hast.d.ts.map +0 -1
- package/build/esm/hast/index.d.ts +0 -1
- package/build/esm/hast/index.d.ts.map +0 -1
- package/build/esm/hast/index.js +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/index.d.ts.map +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +0 -57
- package/build/esm/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts.map +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts.map +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +0 -243
- package/build/esm/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts.map +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +0 -27
- package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts.map +0 -1
- package/build/esm/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +0 -37
- package/build/esm/loadServerCodeMeta/index.d.ts +0 -1
- package/build/esm/loadServerCodeMeta/index.d.ts.map +0 -1
- package/build/esm/loadServerCodeMeta/index.js +0 -1
- package/build/esm/loadServerCodeMeta/serverLoadCodeMeta.d.ts.map +0 -1
- package/build/esm/loadServerSource/index.d.ts +0 -1
- package/build/esm/loadServerSource/index.d.ts.map +0 -1
- package/build/esm/loadServerSource/index.js +0 -1
- package/build/esm/loadServerSource/serverLoadSource.d.ts +0 -25
- package/build/esm/loadServerSource/serverLoadSource.d.ts.map +0 -1
- package/build/esm/loadServerSource/serverLoadSource.js +0 -100
- package/build/esm/loaderUtils/getFileNameFromUrl.d.ts.map +0 -1
- package/build/esm/loaderUtils/index.d.ts +0 -5
- package/build/esm/loaderUtils/index.d.ts.map +0 -1
- package/build/esm/loaderUtils/index.js +0 -5
- package/build/esm/loaderUtils/processImports.d.ts.map +0 -1
- package/build/esm/loaderUtils/processImports.js +0 -82
- package/build/esm/loaderUtils/resolveImports.d.ts +0 -4
- package/build/esm/loaderUtils/resolveImports.d.ts.map +0 -1
- package/build/esm/loaderUtils/resolveImports.js +0 -71
- package/build/esm/loaderUtils/resolveModulePath.d.ts.map +0 -1
- package/build/esm/loaderUtils/resolveModulePath.js +0 -827
- package/build/esm/loaderUtils/resolveModulePathWithFs.d.ts.map +0 -1
- package/build/esm/loaderUtils/rewriteImports.d.ts +0 -9
- package/build/esm/loaderUtils/rewriteImports.d.ts.map +0 -1
- package/build/esm/loaderUtils/rewriteImports.js +0 -57
- package/build/esm/package.json +0 -1
- package/build/esm/parseSource/grammars.d.ts.map +0 -1
- package/build/esm/parseSource/index.d.ts.map +0 -1
- package/build/esm/parseSource/parseSource.d.ts +0 -3
- package/build/esm/parseSource/parseSource.d.ts.map +0 -1
- package/build/esm/transformRelativeMarkdownPaths/index.d.ts +0 -2
- package/build/esm/transformRelativeMarkdownPaths/index.d.ts.map +0 -1
- package/build/esm/transformRelativeMarkdownPaths/index.js +0 -4
- package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts +0 -12
- package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts.map +0 -1
- package/build/esm/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.js +0 -30
- package/build/esm/transformTsToJs/index.d.ts +0 -1
- package/build/esm/transformTsToJs/index.d.ts.map +0 -1
- package/build/esm/transformTsToJs/index.js +0 -1
- package/build/esm/transformTsToJs/removeTypes.d.ts.map +0 -1
- package/build/esm/transformTsToJs/transformTsToJs.d.ts +0 -3
- package/build/esm/transformTsToJs/transformTsToJs.d.ts.map +0 -1
- package/build/esm/useCode/index.d.ts.map +0 -1
- package/build/esm/useCode/useCode.d.ts +0 -37
- package/build/esm/useCode/useCode.d.ts.map +0 -1
- package/build/esm/useCode/useCode.js +0 -393
- package/build/esm/useCopier/index.d.ts.map +0 -1
- package/build/esm/useDemo/index.d.ts +0 -39
- package/build/esm/useDemo/index.d.ts.map +0 -1
- package/build/esm/useDemo/index.js +0 -17
- package/build/esm/useOnHydrate/index.d.ts.map +0 -1
- package/build/esm/useOnHydrate/useOnHydrate.d.ts.map +0 -1
- package/build/esm/useOnIdle/index.d.ts.map +0 -1
- package/build/esm/useOnIdle/useOnIdle.d.ts.map +0 -1
- package/build/hast/hast.d.ts +0 -11
- package/build/hast/hast.js +0 -75
- package/build/hast/index.d.ts +0 -1
- package/build/hast/index.js +0 -16
- package/build/loadPrecomputedCodeHighlighter/index.d.ts +0 -2
- package/build/loadPrecomputedCodeHighlighter/index.js +0 -9
- package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +0 -57
- package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +0 -201
- package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts +0 -20
- package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +0 -248
- package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts +0 -15
- package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.js +0 -174
- package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +0 -27
- package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +0 -43
- package/build/loadServerCodeMeta/index.d.ts +0 -1
- package/build/loadServerCodeMeta/index.js +0 -16
- package/build/loadServerCodeMeta/serverLoadCodeMeta.d.ts +0 -24
- package/build/loadServerCodeMeta/serverLoadCodeMeta.js +0 -85
- package/build/loadServerSource/index.d.ts +0 -1
- package/build/loadServerSource/index.js +0 -16
- package/build/loadServerSource/serverLoadSource.js +0 -108
- package/build/loaderUtils/getFileNameFromUrl.d.ts +0 -11
- package/build/loaderUtils/getFileNameFromUrl.js +0 -38
- package/build/loaderUtils/index.d.ts +0 -5
- package/build/loaderUtils/index.js +0 -60
- package/build/loaderUtils/processImports.d.ts +0 -19
- package/build/loaderUtils/processImports.js +0 -89
- package/build/loaderUtils/resolveImports.d.ts +0 -4
- package/build/loaderUtils/resolveImports.js +0 -78
- package/build/loaderUtils/resolveModulePath.d.ts +0 -74
- package/build/loaderUtils/resolveModulePath.js +0 -835
- package/build/loaderUtils/resolveModulePathWithFs.d.ts +0 -44
- package/build/loaderUtils/resolveModulePathWithFs.js +0 -163
- package/build/loaderUtils/rewriteImports.d.ts +0 -9
- package/build/loaderUtils/rewriteImports.js +0 -62
- package/build/package.json +0 -101
- package/build/parseSource/grammars.d.ts +0 -2
- package/build/parseSource/grammars.js +0 -34
- package/build/parseSource/index.d.ts +0 -1
- package/build/parseSource/index.js +0 -16
- package/build/parseSource/parseSource.d.ts +0 -3
- package/build/parseSource/parseSource.js +0 -44
- package/build/transformRelativeMarkdownPaths/index.d.ts +0 -2
- package/build/transformRelativeMarkdownPaths/index.js +0 -9
- package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts +0 -12
- package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.js +0 -36
- package/build/transformTsToJs/index.d.ts +0 -1
- package/build/transformTsToJs/index.js +0 -16
- package/build/transformTsToJs/removeTypes.d.ts +0 -13
- package/build/transformTsToJs/removeTypes.js +0 -141
- package/build/transformTsToJs/transformTsToJs.d.ts +0 -3
- package/build/transformTsToJs/transformTsToJs.js +0 -41
- package/build/useCode/index.d.ts +0 -1
- package/build/useCode/index.js +0 -16
- package/build/useCode/useCode.js +0 -401
- package/build/useCopier/index.d.ts +0 -15
- package/build/useCopier/index.js +0 -70
- package/build/useDemo/index.d.ts +0 -39
- package/build/useDemo/index.js +0 -25
- package/build/useOnHydrate/index.d.ts +0 -1
- package/build/useOnHydrate/index.js +0 -16
- package/build/useOnHydrate/useOnHydrate.d.ts +0 -1
- package/build/useOnHydrate/useOnHydrate.js +0 -26
- package/build/useOnIdle/index.d.ts +0 -1
- package/build/useOnIdle/index.js +0 -16
- package/build/useOnIdle/useOnIdle.d.ts +0 -1
- package/build/useOnIdle/useOnIdle.js +0 -47
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.js +0 -0
- /package/{build/CodeControllerContext → CodeControllerContext}/index.d.ts +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/errors.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/hasAllVariants.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/hasAllVariants.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/index.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/index.js +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseCode.d.ts +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformParsedSource.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformSource.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformSource.js +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/types.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/CodeContext.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeContext.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/CodeProvider.d.ts +0 -0
- /package/{build/LICENSE → LICENSE} +0 -0
- /package/{build/esm/hast/hast.d.ts → pipeline/hastUtils/hastUtils.d.ts} +0 -0
- /package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/index.d.ts +0 -0
- /package/{build/esm → pipeline}/loadPrecomputedCodeHighlighter/index.js +0 -0
- /package/{build/esm → pipeline}/loaderUtils/getFileNameFromUrl.d.ts +0 -0
- /package/{build/esm → pipeline}/loaderUtils/getFileNameFromUrl.js +0 -0
- /package/{build/esm → pipeline}/parseSource/grammars.d.ts +0 -0
- /package/{build/esm → pipeline}/parseSource/grammars.js +0 -0
- /package/{build/esm → pipeline}/parseSource/index.d.ts +0 -0
- /package/{build/esm → pipeline}/parseSource/index.js +0 -0
- /package/{build/esm/transformTsToJs → pipeline/transformTypescriptToJavascript}/removeTypes.d.ts +0 -0
- /package/{build/esm/transformTsToJs → pipeline/transformTypescriptToJavascript}/removeTypes.js +0 -0
- /package/{build/esm/useCode → useCode}/index.d.ts +0 -0
- /package/{build/esm/useCode → useCode}/index.js +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.js +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.d.ts +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.js +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/index.d.ts +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/index.js +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.d.ts +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.js +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { type DirectoryEntry, type DirectoryReader, type ResolveModulePathOptions } from "./resolveModulePath.js";
|
|
1
|
+
import { type DirectoryEntry, type DirectoryReader, type ResolveModulePathOptions, type TypeAwareResolveResult } from "./resolveModulePath.js";
|
|
2
2
|
/**
|
|
3
3
|
* Resolves a module path using Node.js filesystem APIs.
|
|
4
4
|
* This is a convenience wrapper around the generic resolveModulePath function.
|
|
5
5
|
*
|
|
6
6
|
* @param modulePath - The module path to resolve (without file extension)
|
|
7
7
|
* @param options - Configuration options
|
|
8
|
-
* @
|
|
8
|
+
* @param includeTypeDefs - If true, returns both import and typeImport paths with different extension priorities
|
|
9
|
+
* @returns Promise<string | TypeAwareResolveResult> - The resolved file path(s), or throws if not found
|
|
9
10
|
*/
|
|
10
11
|
export declare function resolveModulePathWithFs(modulePath: string, options?: ResolveModulePathOptions): Promise<string>;
|
|
12
|
+
export declare function resolveModulePathWithFs(modulePath: string, options: ResolveModulePathOptions, includeTypeDefs: true): Promise<TypeAwareResolveResult>;
|
|
11
13
|
/**
|
|
12
14
|
* Resolves multiple module paths using Node.js filesystem APIs.
|
|
13
15
|
* This is a convenience wrapper around the generic resolveModulePaths function.
|
|
@@ -23,13 +25,14 @@ export declare function resolveModulePathsWithFs(modulePaths: string[], options?
|
|
|
23
25
|
* This is a convenience wrapper around the generic resolveImportResult function
|
|
24
26
|
* that uses Node.js filesystem APIs.
|
|
25
27
|
*
|
|
26
|
-
* @param importResult - The result from
|
|
28
|
+
* @param importResult - The result from parseImports containing all imports
|
|
27
29
|
* @param options - Configuration options for module resolution
|
|
28
30
|
* @returns Promise<Map<string, string>> - Map from import path to resolved file path
|
|
29
31
|
*/
|
|
30
32
|
export declare function resolveImportResultWithFs(importResult: Record<string, {
|
|
31
33
|
path: string;
|
|
32
34
|
names: string[];
|
|
35
|
+
includeTypeDefs?: true;
|
|
33
36
|
}>, options?: ResolveModulePathOptions): Promise<Map<string, string>>;
|
|
34
37
|
/**
|
|
35
38
|
* Resolves variant paths from a variants object mapping variant names to their file paths.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveModulePathWithFs.d.ts","sourceRoot":"","sources":["../../../src/pipeline/loaderUtils/resolveModulePathWithFs.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAC;AAe7B;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,MAAM,CAAC,CAAC;AACnB,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,wBAAwB,EACjC,eAAe,EAAE,IAAI,GACpB,OAAO,CAAC,sBAAsB,CAAC,CAAC;AASnC;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EAAE,EACrB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAE9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,EACvF,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAE9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAE9B;AAGD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -43,8 +43,10 @@ var nodeDirectoryReader = /*#__PURE__*/function () {
|
|
|
43
43
|
*
|
|
44
44
|
* @param modulePath - The module path to resolve (without file extension)
|
|
45
45
|
* @param options - Configuration options
|
|
46
|
-
* @
|
|
46
|
+
* @param includeTypeDefs - If true, returns both import and typeImport paths with different extension priorities
|
|
47
|
+
* @returns Promise<string | TypeAwareResolveResult> - The resolved file path(s), or throws if not found
|
|
47
48
|
*/
|
|
49
|
+
|
|
48
50
|
export function resolveModulePathWithFs(_x2) {
|
|
49
51
|
return _resolveModulePathWithFs.apply(this, arguments);
|
|
50
52
|
}
|
|
@@ -60,13 +62,15 @@ export function resolveModulePathWithFs(_x2) {
|
|
|
60
62
|
function _resolveModulePathWithFs() {
|
|
61
63
|
_resolveModulePathWithFs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(modulePath) {
|
|
62
64
|
var options,
|
|
65
|
+
includeTypeDefs,
|
|
63
66
|
_args2 = arguments;
|
|
64
67
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
65
68
|
while (1) switch (_context2.prev = _context2.next) {
|
|
66
69
|
case 0:
|
|
67
70
|
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
includeTypeDefs = _args2.length > 2 ? _args2[2] : undefined;
|
|
72
|
+
return _context2.abrupt("return", resolveModulePath(modulePath, nodeDirectoryReader, options, includeTypeDefs));
|
|
73
|
+
case 3:
|
|
70
74
|
case "end":
|
|
71
75
|
return _context2.stop();
|
|
72
76
|
}
|
|
@@ -84,7 +88,7 @@ export function resolveModulePathsWithFs(_x3) {
|
|
|
84
88
|
* This is a convenience wrapper around the generic resolveImportResult function
|
|
85
89
|
* that uses Node.js filesystem APIs.
|
|
86
90
|
*
|
|
87
|
-
* @param importResult - The result from
|
|
91
|
+
* @param importResult - The result from parseImports containing all imports
|
|
88
92
|
* @param options - Configuration options for module resolution
|
|
89
93
|
* @returns Promise<Map<string, string>> - Map from import path to resolved file path
|
|
90
94
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rewrites relative imports in source code based on a provided mapping.
|
|
3
|
+
* Converts imports like '../utils/helper' or './components/Button' to their mapped equivalents
|
|
4
|
+
*
|
|
5
|
+
* @param source - The source code to process
|
|
6
|
+
* @param importPathMapping - Map from original import paths to new import paths (without extensions)
|
|
7
|
+
* @returns The source code with rewritten imports
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteImportsToSameDirectory(source: string, importPathMapping: Map<string, string>): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewriteImports.d.ts","sourceRoot":"","sources":["../../../src/pipeline/loaderUtils/rewriteImports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,MAAM,CA+BR"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rewrites relative imports in source code based on a provided mapping.
|
|
3
|
+
* Converts imports like '../utils/helper' or './components/Button' to their mapped equivalents
|
|
4
|
+
*
|
|
5
|
+
* @param source - The source code to process
|
|
6
|
+
* @param importPathMapping - Map from original import paths to new import paths (without extensions)
|
|
7
|
+
* @returns The source code with rewritten imports
|
|
8
|
+
*/
|
|
9
|
+
export function rewriteImportsToSameDirectory(source, importPathMapping) {
|
|
10
|
+
// Handle both types of imports:
|
|
11
|
+
// 1. import [something] from 'path' (including import type)
|
|
12
|
+
// 2. import 'path' (side-effect imports like CSS)
|
|
13
|
+
|
|
14
|
+
return source.replace(/import\s+((?:type\s+)?(?:\w+|\*\s+as\s+\w+|{[^}]+})\s+from\s+)['"]([^'"]+)['"]/g, function (match, importPart, modulePath) {
|
|
15
|
+
// Only process relative imports
|
|
16
|
+
if (modulePath.startsWith('.')) {
|
|
17
|
+
// Check if we have a mapping for this import path
|
|
18
|
+
if (importPathMapping.has(modulePath)) {
|
|
19
|
+
var newPath = importPathMapping.get(modulePath);
|
|
20
|
+
return "import ".concat(importPart, "'").concat(newPath, "'");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return match;
|
|
24
|
+
}).replace(/import\s+['"]([^'"]+)['"]/g, function (match, modulePath) {
|
|
25
|
+
// Only process relative imports
|
|
26
|
+
if (modulePath.startsWith('.')) {
|
|
27
|
+
// Check if we have a mapping for this import path
|
|
28
|
+
if (importPathMapping.has(modulePath)) {
|
|
29
|
+
var newPath = importPathMapping.get(modulePath);
|
|
30
|
+
return "import '".concat(newPath, "'");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return match;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../../src/pipeline/parseSource/grammars.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,QAAQ,0CAWpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pipeline/parseSource/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseSource.d.ts","sourceRoot":"","sources":["../../../src/pipeline/parseSource/parseSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAOpD,eAAO,MAAM,WAAW,EAAE,WAsBzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,WAAW,CAM7D,CAAC"}
|
|
@@ -5,12 +5,22 @@ import { grammars, extensionMap } from "./grammars.js";
|
|
|
5
5
|
var starryNight = null;
|
|
6
6
|
export var parseSource = function parseSource(source, fileName) {
|
|
7
7
|
if (!starryNight) {
|
|
8
|
-
throw new Error('Starry Night not initialized. Use
|
|
8
|
+
throw new Error('Starry Night not initialized. Use createParseSource to create an initialized parseSource function.');
|
|
9
9
|
}
|
|
10
|
-
var fileType = fileName.slice(fileName.lastIndexOf('.'))
|
|
11
|
-
|
|
10
|
+
var fileType = fileName.slice(fileName.lastIndexOf('.'));
|
|
11
|
+
if (!extensionMap[fileType]) {
|
|
12
|
+
// Return a basic HAST root node with the source text for unsupported file types
|
|
13
|
+
return {
|
|
14
|
+
type: 'root',
|
|
15
|
+
children: [{
|
|
16
|
+
type: 'text',
|
|
17
|
+
value: source
|
|
18
|
+
}]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return starryNight.highlight(source, extensionMap[fileType]);
|
|
12
22
|
};
|
|
13
|
-
export var
|
|
23
|
+
export var createParseSource = /*#__PURE__*/function () {
|
|
14
24
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
15
25
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16
26
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -31,7 +41,7 @@ export var parseSourceFactory = /*#__PURE__*/function () {
|
|
|
31
41
|
}
|
|
32
42
|
}, _callee);
|
|
33
43
|
}));
|
|
34
|
-
return function
|
|
44
|
+
return function createParseSource() {
|
|
35
45
|
return _ref.apply(this, arguments);
|
|
36
46
|
};
|
|
37
47
|
}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pipeline/transformHtmlCode/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Plugin } from 'unified';
|
|
2
|
+
/**
|
|
3
|
+
* Rehype plugin that transforms pre > code elements to use loadVariant
|
|
4
|
+
*
|
|
5
|
+
* This plugin:
|
|
6
|
+
* 1. Finds pre elements in the HTML AST
|
|
7
|
+
* 2. Collects all code children within each pre element
|
|
8
|
+
* 3. Creates variants from multiple code elements or single Default variant
|
|
9
|
+
* 4. Uses loadVariant to process each variant
|
|
10
|
+
* 5. Stores the combined precompute data on the pre element
|
|
11
|
+
* 6. Clears all code element contents
|
|
12
|
+
*/
|
|
13
|
+
export declare const transformHtmlCode: Plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformHtmlCode.d.ts","sourceRoot":"","sources":["../../../src/pipeline/transformHtmlCode/transformHtmlCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA4KtC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAoF/B,CAAC"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
|
+
import { visit } from 'unist-util-visit';
|
|
7
|
+
import { loadVariant } from "../../CodeHighlighter/loadVariant.js";
|
|
8
|
+
import { createParseSource } from "../parseSource/index.js";
|
|
9
|
+
import { TypescriptToJavascriptTransformer } from "../transformTypescriptToJavascript/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Maps common language class names to file extensions
|
|
12
|
+
* Only includes languages that have corresponding grammars in parseSource/grammars.ts
|
|
13
|
+
*/
|
|
14
|
+
var LANGUAGE_TO_EXTENSION = {
|
|
15
|
+
// JavaScript
|
|
16
|
+
javascript: 'js',
|
|
17
|
+
js: 'js',
|
|
18
|
+
// TypeScript
|
|
19
|
+
typescript: 'ts',
|
|
20
|
+
ts: 'ts',
|
|
21
|
+
// TSX/JSX
|
|
22
|
+
tsx: 'tsx',
|
|
23
|
+
jsx: 'jsx',
|
|
24
|
+
// Maps to .jsx but uses tsx grammar
|
|
25
|
+
|
|
26
|
+
// JSON
|
|
27
|
+
json: 'json',
|
|
28
|
+
// Markdown
|
|
29
|
+
markdown: 'md',
|
|
30
|
+
md: 'md',
|
|
31
|
+
// MDX
|
|
32
|
+
mdx: 'mdx',
|
|
33
|
+
// HTML
|
|
34
|
+
html: 'html',
|
|
35
|
+
// CSS
|
|
36
|
+
css: 'css',
|
|
37
|
+
// Shell
|
|
38
|
+
shell: 'sh',
|
|
39
|
+
bash: 'sh',
|
|
40
|
+
sh: 'sh',
|
|
41
|
+
// YAML
|
|
42
|
+
yaml: 'yaml',
|
|
43
|
+
yml: 'yaml'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Extracts the language from className attribute
|
|
48
|
+
*/
|
|
49
|
+
function extractLanguageFromClassName(className) {
|
|
50
|
+
if (!className) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Handle array of class names (HAST format)
|
|
55
|
+
var classString = Array.isArray(className) ? className.join(' ') : className;
|
|
56
|
+
var match = classString.match(/(?:^|\s)language-(\w+)(?:\s|$)/);
|
|
57
|
+
return match ? match[1] : null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Gets the filename from data-filename attribute or derives it from language
|
|
62
|
+
* Returns undefined if no explicit filename and no recognizable language
|
|
63
|
+
*/
|
|
64
|
+
function getFileName(codeElement) {
|
|
65
|
+
var _codeElement$properti, _codeElement$properti2;
|
|
66
|
+
// Check for explicit data-filename attribute
|
|
67
|
+
var dataFilename = (_codeElement$properti = codeElement.properties) == null ? void 0 : _codeElement$properti.dataFilename;
|
|
68
|
+
if (dataFilename && typeof dataFilename === 'string') {
|
|
69
|
+
return dataFilename;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Extract language from className
|
|
73
|
+
var className = (_codeElement$properti2 = codeElement.properties) == null ? void 0 : _codeElement$properti2.className;
|
|
74
|
+
var language = extractLanguageFromClassName(className);
|
|
75
|
+
if (language && LANGUAGE_TO_EXTENSION[language]) {
|
|
76
|
+
return "index.".concat(LANGUAGE_TO_EXTENSION[language]);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Return undefined instead of a fallback - let the system handle gracefully
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Extracts text content from HAST nodes
|
|
85
|
+
*/
|
|
86
|
+
function extractTextContent(node) {
|
|
87
|
+
if (node.type === 'text') {
|
|
88
|
+
return node.value;
|
|
89
|
+
}
|
|
90
|
+
if (node.type === 'element' && node.children) {
|
|
91
|
+
return node.children.map(function (child) {
|
|
92
|
+
return extractTextContent(child);
|
|
93
|
+
}).join('');
|
|
94
|
+
}
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Creates variants from multiple code elements within a pre element
|
|
100
|
+
*/
|
|
101
|
+
function createVariantsFromCodeElements(codeElements) {
|
|
102
|
+
var variants = {};
|
|
103
|
+
if (codeElements.length === 1) {
|
|
104
|
+
var _codeElement$properti3;
|
|
105
|
+
// Single code element - use "Default" as variant name
|
|
106
|
+
var codeElement = codeElements[0];
|
|
107
|
+
var sourceCode = extractTextContent(codeElement);
|
|
108
|
+
var fileName = getFileName(codeElement);
|
|
109
|
+
var variant = {
|
|
110
|
+
source: sourceCode,
|
|
111
|
+
skipTransforms: !((_codeElement$properti3 = codeElement.properties) != null && _codeElement$properti3.dataTransform)
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// Only add fileName if we have one
|
|
115
|
+
if (fileName) {
|
|
116
|
+
variant.fileName = fileName;
|
|
117
|
+
}
|
|
118
|
+
variants.Default = variant;
|
|
119
|
+
} else {
|
|
120
|
+
// Multiple code elements - create appropriate variant names
|
|
121
|
+
var languages = codeElements.map(function (element) {
|
|
122
|
+
var _element$properties;
|
|
123
|
+
var className = (_element$properties = element.properties) == null ? void 0 : _element$properties.className;
|
|
124
|
+
return extractLanguageFromClassName(className);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Check if all languages are the same (or all null)
|
|
128
|
+
var uniqueLanguages = Array.from(new Set(languages.filter(Boolean)));
|
|
129
|
+
var shouldUseLanguageNames = uniqueLanguages.length > 1;
|
|
130
|
+
codeElements.forEach(function (codeElement, index) {
|
|
131
|
+
var _codeElement$properti4, _codeElement$properti5;
|
|
132
|
+
var sourceCode = extractTextContent(codeElement);
|
|
133
|
+
var fileName = getFileName(codeElement);
|
|
134
|
+
|
|
135
|
+
// Check for explicit variant name
|
|
136
|
+
var dataVariant = (_codeElement$properti4 = codeElement.properties) == null ? void 0 : _codeElement$properti4.dataVariant;
|
|
137
|
+
var variantName;
|
|
138
|
+
if (dataVariant && typeof dataVariant === 'string') {
|
|
139
|
+
variantName = dataVariant;
|
|
140
|
+
} else if (shouldUseLanguageNames && languages[index]) {
|
|
141
|
+
// Use language name if languages differ
|
|
142
|
+
variantName = languages[index].charAt(0).toUpperCase() + languages[index].slice(1);
|
|
143
|
+
} else {
|
|
144
|
+
// Use numbered variants if languages are the same or unknown
|
|
145
|
+
variantName = "Variant ".concat(index + 1);
|
|
146
|
+
}
|
|
147
|
+
var variant = {
|
|
148
|
+
source: sourceCode,
|
|
149
|
+
skipTransforms: !((_codeElement$properti5 = codeElement.properties) != null && _codeElement$properti5.dataTransform)
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// Only add fileName if we have one
|
|
153
|
+
if (fileName) {
|
|
154
|
+
variant.fileName = fileName;
|
|
155
|
+
}
|
|
156
|
+
variants[variantName] = variant;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return variants;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Rehype plugin that transforms pre > code elements to use loadVariant
|
|
164
|
+
*
|
|
165
|
+
* This plugin:
|
|
166
|
+
* 1. Finds pre elements in the HTML AST
|
|
167
|
+
* 2. Collects all code children within each pre element
|
|
168
|
+
* 3. Creates variants from multiple code elements or single Default variant
|
|
169
|
+
* 4. Uses loadVariant to process each variant
|
|
170
|
+
* 5. Stores the combined precompute data on the pre element
|
|
171
|
+
* 6. Clears all code element contents
|
|
172
|
+
*/
|
|
173
|
+
export var transformHtmlCode = function transformHtmlCode() {
|
|
174
|
+
return /*#__PURE__*/function () {
|
|
175
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tree) {
|
|
176
|
+
var transformPromises, sourceParser, sourceTransformers;
|
|
177
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
178
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
179
|
+
case 0:
|
|
180
|
+
transformPromises = []; // Get the source parser and transformers
|
|
181
|
+
sourceParser = createParseSource();
|
|
182
|
+
sourceTransformers = [TypescriptToJavascriptTransformer];
|
|
183
|
+
visit(tree, 'element', function (node) {
|
|
184
|
+
// Look for pre elements
|
|
185
|
+
if (node.tagName === 'pre' && node.children && node.children.length > 0) {
|
|
186
|
+
// Find all code elements within this pre
|
|
187
|
+
var codeElements = node.children.filter(function (child) {
|
|
188
|
+
return child.type === 'element' && child.tagName === 'code';
|
|
189
|
+
});
|
|
190
|
+
if (codeElements.length > 0) {
|
|
191
|
+
var transformPromise = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
192
|
+
var variants, processedCode, variantPromises, variantResults, _iterator, _step, result;
|
|
193
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
194
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
195
|
+
case 0:
|
|
196
|
+
_context2.prev = 0;
|
|
197
|
+
// Create variants from all code elements
|
|
198
|
+
variants = createVariantsFromCodeElements(codeElements); // Process each variant with loadVariant
|
|
199
|
+
processedCode = {};
|
|
200
|
+
variantPromises = Object.entries(variants).map(/*#__PURE__*/function () {
|
|
201
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
|
202
|
+
var _ref5, variantName, variantData, result;
|
|
203
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
204
|
+
while (1) switch (_context.prev = _context.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
_ref5 = _slicedToArray(_ref3, 2), variantName = _ref5[0], variantData = _ref5[1];
|
|
207
|
+
if (!(variantData && _typeof(variantData) === 'object')) {
|
|
208
|
+
_context.next = 6;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
_context.next = 4;
|
|
212
|
+
return loadVariant(undefined,
|
|
213
|
+
// url - not needed for inline code
|
|
214
|
+
variantName, variantData, sourceParser, undefined,
|
|
215
|
+
// loadSource - not needed since we have the data
|
|
216
|
+
undefined,
|
|
217
|
+
// loadVariantMeta - not needed since we have the data
|
|
218
|
+
sourceTransformers, {
|
|
219
|
+
disableTransforms: variantData.skipTransforms || false
|
|
220
|
+
});
|
|
221
|
+
case 4:
|
|
222
|
+
result = _context.sent;
|
|
223
|
+
return _context.abrupt("return", {
|
|
224
|
+
variantName: variantName,
|
|
225
|
+
processedVariant: result.code
|
|
226
|
+
});
|
|
227
|
+
case 6:
|
|
228
|
+
return _context.abrupt("return", null);
|
|
229
|
+
case 7:
|
|
230
|
+
case "end":
|
|
231
|
+
return _context.stop();
|
|
232
|
+
}
|
|
233
|
+
}, _callee);
|
|
234
|
+
}));
|
|
235
|
+
return function (_x2) {
|
|
236
|
+
return _ref4.apply(this, arguments);
|
|
237
|
+
};
|
|
238
|
+
}());
|
|
239
|
+
_context2.next = 6;
|
|
240
|
+
return Promise.all(variantPromises);
|
|
241
|
+
case 6:
|
|
242
|
+
variantResults = _context2.sent;
|
|
243
|
+
_iterator = _createForOfIteratorHelper(variantResults);
|
|
244
|
+
try {
|
|
245
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
246
|
+
result = _step.value;
|
|
247
|
+
if (result) {
|
|
248
|
+
processedCode[result.variantName] = result.processedVariant;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Clear all code element contents and replace with error message
|
|
253
|
+
} catch (err) {
|
|
254
|
+
_iterator.e(err);
|
|
255
|
+
} finally {
|
|
256
|
+
_iterator.f();
|
|
257
|
+
}
|
|
258
|
+
codeElements.forEach(function (codeElement) {
|
|
259
|
+
codeElement.children = [];
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// Replace pre element children with error message for CodeHighlighter
|
|
263
|
+
node.children = [{
|
|
264
|
+
type: 'text',
|
|
265
|
+
value: 'Error: expected pre tag to be handled by CodeHighlighter'
|
|
266
|
+
}];
|
|
267
|
+
|
|
268
|
+
// Set the precompute data on the pre element directly on properties for immediate HTML serialization
|
|
269
|
+
if (!node.properties) {
|
|
270
|
+
node.properties = {};
|
|
271
|
+
}
|
|
272
|
+
node.properties.dataPrecompute = JSON.stringify(processedCode);
|
|
273
|
+
_context2.next = 18;
|
|
274
|
+
break;
|
|
275
|
+
case 15:
|
|
276
|
+
_context2.prev = 15;
|
|
277
|
+
_context2.t0 = _context2["catch"](0);
|
|
278
|
+
console.warn('Failed to transform code block:', _context2.t0);
|
|
279
|
+
case 18:
|
|
280
|
+
case "end":
|
|
281
|
+
return _context2.stop();
|
|
282
|
+
}
|
|
283
|
+
}, _callee2, null, [[0, 15]]);
|
|
284
|
+
}))();
|
|
285
|
+
transformPromises.push(transformPromise);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
// Wait for all transformations to complete
|
|
291
|
+
_context3.next = 6;
|
|
292
|
+
return Promise.all(transformPromises);
|
|
293
|
+
case 6:
|
|
294
|
+
case "end":
|
|
295
|
+
return _context3.stop();
|
|
296
|
+
}
|
|
297
|
+
}, _callee3);
|
|
298
|
+
}));
|
|
299
|
+
return function (_x) {
|
|
300
|
+
return _ref.apply(this, arguments);
|
|
301
|
+
};
|
|
302
|
+
}();
|
|
303
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pipeline/transformMarkdownCode/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformMarkdownCode.d.ts","sourceRoot":"","sources":["../../../src/pipeline/transformMarkdownCode/transformMarkdownCode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAiHtC,eAAO,MAAM,qBAAqB,EAAE,MA8anC,CAAC"}
|