@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,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 +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 +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,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AAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,YAAY,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CACrC"}
|
|
@@ -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 +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 +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"}
|
package/build/esm/hast/index.js
DELETED
|
@@ -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"}
|