@mui/internal-docs-infra 0.1.1-alpha.0 → 0.1.1-alpha.2
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/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.d.ts.map +1 -1
- package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.js +2 -1
- package/loaderUtils/resolveModulePath.d.ts.map +1 -0
- package/{build/esm/loaderUtils → loaderUtils}/resolveModulePath.js +185 -150
- package/package.json +13 -72
- package/build/CodeControllerContext/CodeControllerContext.js +0 -21
- package/build/CodeControllerContext/index.js +0 -16
- 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.js +0 -474
- 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.js +0 -231
- package/build/CodeHighlighter/transformParsedSource.js +0 -73
- package/build/CodeHighlighter/transformSource.js +0 -114
- 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.js +0 -27
- package/build/README.md +0 -19
- package/build/esm/CodeControllerContext/CodeControllerContext.d.ts +0 -22
- package/build/esm/CodeControllerContext/index.d.ts +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighter.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts +0 -14
- package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts +0 -7
- package/build/esm/CodeHighlighter/applyTransform.d.ts +0 -19
- package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts +0 -2
- package/build/esm/CodeHighlighter/errors.d.ts +0 -0
- package/build/esm/CodeHighlighter/hasAllVariants.d.ts +0 -2
- package/build/esm/CodeHighlighter/index.d.ts +0 -4
- package/build/esm/CodeHighlighter/loadFallbackCode.d.ts +0 -9
- package/build/esm/CodeHighlighter/loadVariant.d.ts +0 -11
- package/build/esm/CodeHighlighter/maybeInitialData.d.ts +0 -10
- package/build/esm/CodeHighlighter/parseCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/parseControlledCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/transformCode.d.ts +0 -20
- package/build/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
- package/build/esm/CodeHighlighter/transformSource.d.ts +0 -2
- package/build/esm/CodeHighlighter/types.d.ts +0 -138
- package/build/esm/CodeProvider/CodeContext.d.ts +0 -12
- package/build/esm/CodeProvider/CodeProvider.d.ts +0 -13
- package/build/esm/CodeProvider/index.d.ts +0 -2
- package/build/esm/loaderUtils/resolveModulePath.d.ts.map +0 -1
- package/build/esm/package.json +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.d.ts +0 -25
- 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.d.ts +0 -37
- 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/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts.map +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.js +0 -0
- /package/{build/CodeControllerContext → CodeControllerContext}/index.d.ts +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.d.ts.map +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighter.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighter.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighter.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/errors.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.d.ts.map +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.d.ts.map +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.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/index.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/loadVariant.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadVariant.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadVariant.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts.map +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.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformSource.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/types.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/types.d.ts.map +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.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeContext.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/CodeProvider.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/index.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/index.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/index.js +0 -0
- /package/{build/LICENSE → LICENSE} +0 -0
- /package/{build/esm/hast → hast}/hast.d.ts +0 -0
- /package/{build/esm/hast → hast}/hast.d.ts.map +0 -0
- /package/{build/esm/hast → hast}/hast.js +0 -0
- /package/{build/esm/hast → hast}/index.d.ts +0 -0
- /package/{build/esm/hast → hast}/index.d.ts.map +0 -0
- /package/{build/esm/hast → hast}/index.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.js +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.d.ts +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.d.ts.map +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.js +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.d.ts +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.d.ts.map +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.js +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.d.ts +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.d.ts.map +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.js +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.d.ts +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.d.ts.map +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePath.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.js +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.js +0 -0
- /package/{build/esm/parseSource → parseSource}/index.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/index.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/index.js +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.js +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.d.ts +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.d.ts.map +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.js +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.d.ts +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.d.ts.map +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.js +0 -0
- /package/{build/esm/useCode → useCode}/index.d.ts +0 -0
- /package/{build/esm/useCode → useCode}/index.d.ts.map +0 -0
- /package/{build/esm/useCode → useCode}/index.js +0 -0
- /package/{build/esm/useCode → useCode}/useCode.d.ts +0 -0
- /package/{build/esm/useCode → useCode}/useCode.d.ts.map +0 -0
- /package/{build/esm/useCode → useCode}/useCode.js +0 -0
- /package/{build/esm/useCopier → useCopier}/index.d.ts +0 -0
- /package/{build/esm/useCopier → useCopier}/index.d.ts.map +0 -0
- /package/{build/esm/useCopier → useCopier}/index.js +0 -0
- /package/{build/esm/useDemo → useDemo}/index.d.ts +0 -0
- /package/{build/esm/useDemo → useDemo}/index.d.ts.map +0 -0
- /package/{build/esm/useDemo → useDemo}/index.js +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts.map +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.d.ts.map +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.d.ts.map +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.d.ts.map +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.js +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.transformSource = transformSource;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _jsondiffpatch = require("jsondiffpatch");
|
|
12
|
-
var _hastUtilToText = require("hast-util-to-text");
|
|
13
|
-
var differ = (0, _jsondiffpatch.create)({
|
|
14
|
-
omitRemovedValues: true,
|
|
15
|
-
cloneDiffValues: true
|
|
16
|
-
});
|
|
17
|
-
function transformSource(_x, _x2, _x3) {
|
|
18
|
-
return _transformSource.apply(this, arguments);
|
|
19
|
-
}
|
|
20
|
-
function _transformSource() {
|
|
21
|
-
_transformSource = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2(source, fileName, sourceTransformers) {
|
|
22
|
-
var transforms;
|
|
23
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
24
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
25
|
-
case 0:
|
|
26
|
-
_context2.next = 2;
|
|
27
|
-
return Promise.all(sourceTransformers.map(/*#__PURE__*/function () {
|
|
28
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(_ref) {
|
|
29
|
-
var extensions, transformer, sourceString, transformed, splitSource;
|
|
30
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
31
|
-
while (1) switch (_context.prev = _context.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
extensions = _ref.extensions, transformer = _ref.transformer;
|
|
34
|
-
if (extensions.some(function (ext) {
|
|
35
|
-
return fileName.endsWith(".".concat(ext));
|
|
36
|
-
})) {
|
|
37
|
-
_context.next = 3;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
return _context.abrupt("return", undefined);
|
|
41
|
-
case 3:
|
|
42
|
-
_context.prev = 3;
|
|
43
|
-
if (typeof source === 'string') {
|
|
44
|
-
sourceString = source;
|
|
45
|
-
} else if ('hastJson' in source) {
|
|
46
|
-
sourceString = (0, _hastUtilToText.toText)(JSON.parse(source.hastJson));
|
|
47
|
-
} else {
|
|
48
|
-
sourceString = (0, _hastUtilToText.toText)(source);
|
|
49
|
-
}
|
|
50
|
-
_context.next = 7;
|
|
51
|
-
return transformer(sourceString, fileName);
|
|
52
|
-
case 7:
|
|
53
|
-
transformed = _context.sent;
|
|
54
|
-
if (!transformed) {
|
|
55
|
-
_context.next = 11;
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
splitSource = sourceString.split('\n');
|
|
59
|
-
return _context.abrupt("return", Object.keys(transformed).reduce(function (acc, key) {
|
|
60
|
-
var delta = differ.diff(splitSource, transformed[key].source.split('\n'));
|
|
61
|
-
acc[key] = {
|
|
62
|
-
delta: delta,
|
|
63
|
-
fileName: transformed[key].fileName
|
|
64
|
-
};
|
|
65
|
-
return acc;
|
|
66
|
-
}, {}));
|
|
67
|
-
case 11:
|
|
68
|
-
return _context.abrupt("return", undefined);
|
|
69
|
-
case 14:
|
|
70
|
-
_context.prev = 14;
|
|
71
|
-
_context.t0 = _context["catch"](3);
|
|
72
|
-
throw new Error("Failed to transform source code (file: ".concat(fileName, "): ").concat(_context.t0 instanceof Error && _context.t0.message));
|
|
73
|
-
case 17:
|
|
74
|
-
case "end":
|
|
75
|
-
return _context.stop();
|
|
76
|
-
}
|
|
77
|
-
}, _callee, null, [[3, 14]]);
|
|
78
|
-
}));
|
|
79
|
-
return function (_x4) {
|
|
80
|
-
return _ref2.apply(this, arguments);
|
|
81
|
-
};
|
|
82
|
-
}()));
|
|
83
|
-
case 2:
|
|
84
|
-
transforms = _context2.sent;
|
|
85
|
-
if (!(transforms.length === 0 || transforms.every(function (t) {
|
|
86
|
-
return t === undefined;
|
|
87
|
-
}))) {
|
|
88
|
-
_context2.next = 5;
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
return _context2.abrupt("return", undefined);
|
|
92
|
-
case 5:
|
|
93
|
-
return _context2.abrupt("return", transforms.reduce(function (acc, transform) {
|
|
94
|
-
if (transform) {
|
|
95
|
-
Object.entries(transform).forEach(function (_ref3) {
|
|
96
|
-
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
97
|
-
key = _ref4[0],
|
|
98
|
-
value = _ref4[1];
|
|
99
|
-
if (acc[key]) {
|
|
100
|
-
throw new Error("Duplicate key found in source transformations: ".concat(key));
|
|
101
|
-
}
|
|
102
|
-
acc[key] = value;
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return acc;
|
|
106
|
-
}, {}));
|
|
107
|
-
case 6:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context2.stop();
|
|
110
|
-
}
|
|
111
|
-
}, _callee2);
|
|
112
|
-
}));
|
|
113
|
-
return _transformSource.apply(this, arguments);
|
|
114
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.useCodeContext = exports.CodeContext = void 0;
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var CodeContext = exports.CodeContext = /*#__PURE__*/React.createContext({});
|
|
11
|
-
var useCodeContext = exports.useCodeContext = function useCodeContext() {
|
|
12
|
-
var context = React.useContext(CodeContext);
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
exports.CodeProvider = CodeProvider;
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _starryNight = require("@wooorm/starry-night");
|
|
13
|
-
var _CodeContext = require("./CodeContext");
|
|
14
|
-
var _grammars = require("../parseSource/grammars");
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function CodeProvider(_ref) {
|
|
17
|
-
var children = _ref.children,
|
|
18
|
-
loadCodeMeta = _ref.loadCodeMeta,
|
|
19
|
-
loadVariantMeta = _ref.loadVariantMeta,
|
|
20
|
-
loadSource = _ref.loadSource;
|
|
21
|
-
var _React$useState = React.useState(undefined),
|
|
22
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
23
|
-
parseSource = _React$useState2[0],
|
|
24
|
-
setParseSource = _React$useState2[1];
|
|
25
|
-
var sourceParser = React.useMemo(function () {
|
|
26
|
-
// Only initialize Starry Night in the browser, not during SSR
|
|
27
|
-
if (typeof window === 'undefined') {
|
|
28
|
-
return Promise.resolve(function () {
|
|
29
|
-
throw new Error('parseSource not available during SSR');
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return (0, _starryNight.createStarryNight)(_grammars.grammars).then(function (starryNight) {
|
|
33
|
-
var parseSourceFn = function parseSourceFn(source, fileName) {
|
|
34
|
-
var fileType = fileName.slice(fileName.lastIndexOf('.')) || 'plaintext';
|
|
35
|
-
return starryNight.highlight(source, _grammars.extensionMap[fileType] || 'plaintext');
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Update the sync version when available
|
|
39
|
-
setParseSource(parseSourceFn);
|
|
40
|
-
return parseSourceFn;
|
|
41
|
-
});
|
|
42
|
-
}, []);
|
|
43
|
-
var context = React.useMemo(function () {
|
|
44
|
-
return {
|
|
45
|
-
sourceParser: sourceParser,
|
|
46
|
-
parseSource: parseSource,
|
|
47
|
-
// Sync version when available
|
|
48
|
-
loadSource: loadSource,
|
|
49
|
-
loadVariantMeta: loadVariantMeta,
|
|
50
|
-
loadCodeMeta: loadCodeMeta
|
|
51
|
-
};
|
|
52
|
-
}, [sourceParser, parseSource, loadSource, loadVariantMeta, loadCodeMeta]);
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CodeContext.CodeContext.Provider, {
|
|
54
|
-
value: context,
|
|
55
|
-
children: children
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _CodeProvider = require("./CodeProvider");
|
|
7
|
-
Object.keys(_CodeProvider).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _CodeProvider[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _CodeProvider[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _CodeContext = require("./CodeContext");
|
|
18
|
-
Object.keys(_CodeContext).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _CodeContext[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _CodeContext[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
package/build/README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# @mui/internal-docs-infra
|
|
2
|
-
|
|
3
|
-
This package hosts the tools that help create the documentation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Install the package in your project directory with:
|
|
8
|
-
|
|
9
|
-
<!-- #npm-tag-reference -->
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @mui/internal-docs-infra
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Documentation
|
|
16
|
-
|
|
17
|
-
This is stored in the `docs` directory.
|
|
18
|
-
|
|
19
|
-
[Read More](./docs/README.md)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ControlledCode } from "../CodeHighlighter/types.js";
|
|
3
|
-
export type Selection = {
|
|
4
|
-
variant: string;
|
|
5
|
-
fileName?: string;
|
|
6
|
-
transformKey?: string;
|
|
7
|
-
};
|
|
8
|
-
export interface CodeControllerContext {
|
|
9
|
-
code?: ControlledCode;
|
|
10
|
-
selection?: Selection;
|
|
11
|
-
setCode?: React.Dispatch<React.SetStateAction<ControlledCode | undefined>>;
|
|
12
|
-
setSelection?: React.Dispatch<React.SetStateAction<Selection>>;
|
|
13
|
-
components?: Record<string, React.ReactNode> | undefined;
|
|
14
|
-
}
|
|
15
|
-
export declare const CodeControllerContext: React.Context<CodeControllerContext | undefined>;
|
|
16
|
-
export declare function useControlledCode(): {
|
|
17
|
-
controlledCode: ControlledCode | undefined;
|
|
18
|
-
controlledSelection: Selection | undefined;
|
|
19
|
-
controlledSetCode: React.Dispatch<React.SetStateAction<ControlledCode | undefined>> | undefined;
|
|
20
|
-
controlledSetSelection: React.Dispatch<React.SetStateAction<Selection>> | undefined;
|
|
21
|
-
controlledComponents: Record<string, React.ReactNode> | undefined;
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./CodeControllerContext.js";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Code, ControlledCode } from "./types.js";
|
|
3
|
-
import { Selection } from "../CodeControllerContext/index.js";
|
|
4
|
-
export interface CodeHighlighterContextType {
|
|
5
|
-
code?: Code;
|
|
6
|
-
setCode?: React.Dispatch<React.SetStateAction<ControlledCode | undefined>>;
|
|
7
|
-
selection?: Selection;
|
|
8
|
-
setSelection?: React.Dispatch<React.SetStateAction<Selection>>;
|
|
9
|
-
components?: Record<string, React.ReactNode>;
|
|
10
|
-
availableTransforms?: string[];
|
|
11
|
-
}
|
|
12
|
-
export declare const CodeHighlighterContext: React.Context<CodeHighlighterContextType | undefined>;
|
|
13
|
-
export declare function useCodeHighlighterContext(): CodeHighlighterContextType;
|
|
14
|
-
export declare function useCodeHighlighterContextOptional(): CodeHighlighterContextType | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ContentLoadingVariant } from "./types.js";
|
|
3
|
-
export interface CodeHighlighterFallbackContext extends ContentLoadingVariant {
|
|
4
|
-
extraVariants?: Record<string, ContentLoadingVariant>;
|
|
5
|
-
}
|
|
6
|
-
export declare const CodeHighlighterFallbackContext: React.Context<CodeHighlighterFallbackContext | undefined>;
|
|
7
|
-
export declare function useCodeHighlighterFallbackContext(): CodeHighlighterFallbackContext;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { VariantSource, Transforms } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Applies a specific transform to a variant source and returns the transformed source
|
|
4
|
-
* @param source - The original variant source (string, HastNodes, or hastJson object)
|
|
5
|
-
* @param transforms - Object containing all available transforms
|
|
6
|
-
* @param transformKey - The key of the specific transform to apply
|
|
7
|
-
* @returns The transformed variant source in the same format as the input
|
|
8
|
-
* @throws Error if the transform key doesn't exist or patching fails
|
|
9
|
-
*/
|
|
10
|
-
export declare function applyTransform(source: VariantSource, transforms: Transforms, transformKey: string): VariantSource;
|
|
11
|
-
/**
|
|
12
|
-
* Applies multiple transforms to a variant source in sequence
|
|
13
|
-
* @param source - The original variant source
|
|
14
|
-
* @param transforms - Object containing all available transforms
|
|
15
|
-
* @param transformKeys - Array of transform keys to apply in order
|
|
16
|
-
* @returns The transformed variant source in the same format as the input
|
|
17
|
-
* @throws Error if any transform key doesn't exist or patching fails
|
|
18
|
-
*/
|
|
19
|
-
export declare function applyTransforms(source: VariantSource, transforms: Transforms, transformKeys: string[]): VariantSource;
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Code, VariantExtraFiles, ParseSource, LoadSource, LoadVariantMeta, VariantSource, LoadCodeMeta } from "./types.js";
|
|
2
|
-
export type FallbackVariants = {
|
|
3
|
-
code: Code;
|
|
4
|
-
initialFilename: string;
|
|
5
|
-
initialSource: VariantSource;
|
|
6
|
-
initialExtraFiles?: VariantExtraFiles;
|
|
7
|
-
allFileNames: string[];
|
|
8
|
-
};
|
|
9
|
-
export declare function loadFallbackCode(url: string, initialVariant: string, loaded: Code | undefined, shouldHighlight?: boolean, fallbackUsesExtraFiles?: boolean, fallbackUsesAllVariants?: boolean, sourceParser?: Promise<ParseSource>, loadSource?: LoadSource, loadVariantMeta?: LoadVariantMeta, loadCodeMeta?: LoadCodeMeta, initialFilename?: string, variants?: string[]): Promise<FallbackVariants>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { VariantCode, ParseSource, LoadSource, LoadVariantMeta, SourceTransformers, LoadFileOptions } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Loads a variant with support for recursive extra file loading.
|
|
4
|
-
* The loadSource function can now return extraFiles that will be loaded recursively.
|
|
5
|
-
* Supports both relative and absolute paths for extra files.
|
|
6
|
-
* Uses Promise.all for efficient parallel loading of extra files.
|
|
7
|
-
*/
|
|
8
|
-
export declare function loadVariant(url: string, variantName: string, variant: VariantCode | string | undefined, sourceParser?: Promise<ParseSource>, loadSource?: LoadSource, loadVariantMeta?: LoadVariantMeta, sourceTransformers?: SourceTransformers, options?: LoadFileOptions): Promise<{
|
|
9
|
-
code: VariantCode;
|
|
10
|
-
dependencies: string[];
|
|
11
|
-
}>;
|
|
@@ -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,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,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,20 +0,0 @@
|
|
|
1
|
-
import type { Code, ParseSource } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Pure function to identify which variants need transformation.
|
|
4
|
-
* Returns entries of variants that have transforms requiring processing.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getVariantsToTransform(parsedCode: Code): Array<[string, any]>;
|
|
7
|
-
/**
|
|
8
|
-
* Pure function to get available transforms from a specific variant.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getAvailableTransforms(parsedCode: Code | undefined, variantName: string): string[];
|
|
11
|
-
/**
|
|
12
|
-
* Pure async function to transform a single variant's code and extraFiles.
|
|
13
|
-
* Returns the transformed variant or the original if transformation fails.
|
|
14
|
-
*/
|
|
15
|
-
export declare function transformVariant(variant: string, variantCode: any, parseSource: ParseSource): Promise<any>;
|
|
16
|
-
/**
|
|
17
|
-
* Pure async function to apply transformations to all variants that need them.
|
|
18
|
-
* Returns the enhanced code with computed transforms.
|
|
19
|
-
*/
|
|
20
|
-
export declare function applyTransforms(parsedCode: Code, parseSource: ParseSource): Promise<Code>;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import type { Nodes as HastNodes } from 'hast';
|
|
2
|
-
import type { Delta } from 'jsondiffpatch';
|
|
3
|
-
export type Components = {
|
|
4
|
-
[key: string]: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
type CodeMeta = {
|
|
7
|
-
fileName: string;
|
|
8
|
-
};
|
|
9
|
-
export type Transforms = Record<string, {
|
|
10
|
-
delta: Delta;
|
|
11
|
-
fileName?: string;
|
|
12
|
-
}>;
|
|
13
|
-
export type VariantSource = string | HastNodes | {
|
|
14
|
-
hastJson: string;
|
|
15
|
-
};
|
|
16
|
-
export type VariantExtraFiles = {
|
|
17
|
-
[fileName: string]: string | {
|
|
18
|
-
source?: VariantSource;
|
|
19
|
-
transforms?: Transforms;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export type VariantCode = CodeMeta & {
|
|
23
|
-
url: string;
|
|
24
|
-
source?: VariantSource;
|
|
25
|
-
extraFiles?: VariantExtraFiles;
|
|
26
|
-
filesOrder?: string[];
|
|
27
|
-
transforms?: Transforms;
|
|
28
|
-
allFilesListed?: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type Code = {
|
|
31
|
-
[key: string]: undefined | string | VariantCode;
|
|
32
|
-
};
|
|
33
|
-
export type ControlledVariantExtraFiles = {
|
|
34
|
-
[fileName: string]: {
|
|
35
|
-
source: string | null;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export type ControlledVariantCode = CodeMeta & {
|
|
39
|
-
url: string;
|
|
40
|
-
source?: string | null;
|
|
41
|
-
extraFiles?: ControlledVariantExtraFiles;
|
|
42
|
-
filesOrder?: string[];
|
|
43
|
-
};
|
|
44
|
-
export type ControlledCode = {
|
|
45
|
-
[key: string]: undefined | null | ControlledVariantCode;
|
|
46
|
-
};
|
|
47
|
-
type Options = {
|
|
48
|
-
name?: string;
|
|
49
|
-
slug?: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
};
|
|
52
|
-
export type ContentProps = {
|
|
53
|
-
code?: Code;
|
|
54
|
-
components?: Components;
|
|
55
|
-
} & Options;
|
|
56
|
-
export type ContentLoadingVariant = {
|
|
57
|
-
fileNames?: string[];
|
|
58
|
-
source?: React.ReactNode;
|
|
59
|
-
extraSource?: {
|
|
60
|
-
[fileName: string]: React.ReactNode;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export type ContentLoadingProps = ContentLoadingVariant & {
|
|
64
|
-
extraVariants?: Record<string, ContentLoadingVariant>;
|
|
65
|
-
} & Options;
|
|
66
|
-
type ErrorHandler = React.ComponentType<{
|
|
67
|
-
error: Error;
|
|
68
|
-
}>;
|
|
69
|
-
interface CodeHighlighterBaseProps extends Options {
|
|
70
|
-
code?: Code;
|
|
71
|
-
components?: Components;
|
|
72
|
-
variants?: string[];
|
|
73
|
-
variant?: string;
|
|
74
|
-
fileName?: string;
|
|
75
|
-
initialVariant?: string;
|
|
76
|
-
defaultVariant?: string;
|
|
77
|
-
precompute?: boolean | Code;
|
|
78
|
-
fallbackUsesExtraFiles?: boolean;
|
|
79
|
-
fallbackUsesAllVariants?: boolean;
|
|
80
|
-
url: string;
|
|
81
|
-
controlled?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface CodeHighlighterClientProps extends CodeHighlighterBaseProps {
|
|
84
|
-
children: React.ReactNode;
|
|
85
|
-
errorHandler?: React.ReactNode;
|
|
86
|
-
fallback?: React.ReactNode;
|
|
87
|
-
skipFallback?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* @default 'hydration'
|
|
90
|
-
*/
|
|
91
|
-
highlightAt?: 'init' | 'hydration' | 'idle';
|
|
92
|
-
}
|
|
93
|
-
export type LoadCodeMeta = (url: string) => Promise<Code>;
|
|
94
|
-
export type LoadVariantMeta = (variantName: string, url: string) => Promise<VariantCode>;
|
|
95
|
-
export type LoadSource = (url: string) => Promise<{
|
|
96
|
-
source: string;
|
|
97
|
-
extraFiles?: VariantExtraFiles;
|
|
98
|
-
extraDependencies?: string[];
|
|
99
|
-
}>;
|
|
100
|
-
export type TransformSource = (source: string, fileName: string) => Promise<Record<string, {
|
|
101
|
-
source: string;
|
|
102
|
-
fileName?: string;
|
|
103
|
-
}> | undefined>;
|
|
104
|
-
export type ParseSource = (source: string, fileName: string) => HastNodes;
|
|
105
|
-
export type SourceTransformer = {
|
|
106
|
-
extensions: string[];
|
|
107
|
-
transformer: TransformSource;
|
|
108
|
-
};
|
|
109
|
-
export type SourceTransformers = Array<SourceTransformer>;
|
|
110
|
-
/**
|
|
111
|
-
* Options for controlling file loading behavior
|
|
112
|
-
*/
|
|
113
|
-
export interface LoadFileOptions {
|
|
114
|
-
/** Disable applying source transformers */
|
|
115
|
-
disableTransforms?: boolean;
|
|
116
|
-
/** Disable parsing source strings to AST */
|
|
117
|
-
disableParsing?: boolean;
|
|
118
|
-
/** Maximum recursion depth for loading nested extra files */
|
|
119
|
-
maxDepth?: number;
|
|
120
|
-
/** Set of already loaded file URLs to prevent circular dependencies */
|
|
121
|
-
loadedFiles?: Set<string>;
|
|
122
|
-
}
|
|
123
|
-
export interface CodeHighlighterProps extends CodeHighlighterBaseProps {
|
|
124
|
-
Content: React.ComponentType<ContentProps>;
|
|
125
|
-
ErrorHandler?: ErrorHandler;
|
|
126
|
-
ContentLoading?: React.ComponentType<ContentLoadingProps>;
|
|
127
|
-
/**
|
|
128
|
-
* @default 'stream'
|
|
129
|
-
*/
|
|
130
|
-
highlightAt?: 'init' | 'stream' | 'hydration' | 'idle';
|
|
131
|
-
forceClient?: boolean;
|
|
132
|
-
loadCodeMeta?: LoadCodeMeta;
|
|
133
|
-
loadVariantMeta?: LoadVariantMeta;
|
|
134
|
-
loadSource?: LoadSource;
|
|
135
|
-
sourceTransformers?: SourceTransformers;
|
|
136
|
-
sourceParser?: Promise<ParseSource>;
|
|
137
|
-
}
|
|
138
|
-
export {};
|
|
@@ -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,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":"resolveModulePath.d.ts","sourceRoot":"","sources":["../../../src/loaderUtils/resolveModulePath.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,4BAA4B,yCAA0C,CAAC;AAEpF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOxD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AAE1E,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,eAAe,EAC9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAyFjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EAAE,EACrB,aAAa,EAAE,eAAe,EAC9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+I9B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EAC/D,aAAa,EAAE,eAAe,EAC9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAmC9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,aAAa,EAAE,eAAe,EAC9B,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgB9B"}
|
package/build/esm/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module"}
|
package/build/hast/hast.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Nodes as HastNodes } from 'hast';
|
|
2
|
-
export declare function hastToJsx(hast: HastNodes): React.ReactNode;
|
|
3
|
-
export declare function hastOrJsonToJsx(hastOrJson: HastNodes | {
|
|
4
|
-
hastJson: string;
|
|
5
|
-
}): React.ReactNode;
|
|
6
|
-
export declare function stringOrHastToString(source: string | HastNodes | {
|
|
7
|
-
hastJson: string;
|
|
8
|
-
}): string;
|
|
9
|
-
export declare function stringOrHastToJsx(source: string | HastNodes | {
|
|
10
|
-
hastJson: string;
|
|
11
|
-
}, highlighted?: boolean): React.ReactNode;
|