@mui/internal-docs-infra 0.9.1-canary.0 → 0.10.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CodeHighlighter/types.d.mts +2 -0
- package/abstractCreateDemo/abstractCreateDemo.d.mts +2 -1
- package/abstractCreateDemo/abstractCreateDemo.mjs +1 -0
- package/cli/index.mjs +1 -1
- package/package.json +12 -2
- package/pipeline/enhanceCodeEmphasis/enhanceCodeEmphasis.d.mts +17 -0
- package/pipeline/enhanceCodeEmphasis/enhanceCodeEmphasis.mjs +611 -135
- package/pipeline/lintJavascriptDemoFocus/index.d.mts +1 -0
- package/pipeline/lintJavascriptDemoFocus/index.mjs +1 -0
- package/pipeline/lintJavascriptDemoFocus/lintJavascriptDemoFocus.d.mts +40 -0
- package/pipeline/lintJavascriptDemoFocus/lintJavascriptDemoFocus.mjs +395 -0
- package/pipeline/loadCodeVariant/loadCodeVariant.mjs +16 -15
- package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.mts +6 -0
- package/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.mjs +4 -4
- package/pipeline/loadPrecomputedTypes/loadPrecomputedTypes.d.mts +3 -0
- package/pipeline/loadPrecomputedTypes/loadPrecomputedTypes.mjs +1 -0
- package/pipeline/loadServerTypes/highlightTypes.d.mts +2 -1
- package/pipeline/loadServerTypes/highlightTypes.mjs +2 -2
- package/pipeline/loadServerTypes/highlightTypesMeta.d.mts +3 -0
- package/pipeline/loadServerTypes/highlightTypesMeta.mjs +12 -11
- package/pipeline/loadServerTypes/loadServerTypes.d.mts +3 -0
- package/pipeline/loadServerTypes/loadServerTypes.mjs +11 -7
- package/pipeline/loaderUtils/extractNameAndSlugFromUrl.mjs +22 -1
- package/pipeline/loaderUtils/parseImportsAndComments.mjs +7 -0
- package/pipeline/parseSource/addLineGutters.mjs +4 -0
- package/pipeline/parseSource/calculateFrameRanges.d.mts +35 -7
- package/pipeline/parseSource/calculateFrameRanges.mjs +236 -27
- package/pipeline/parseSource/createFrame.d.mts +1 -1
- package/pipeline/parseSource/createFrame.mjs +6 -3
- package/pipeline/parseSource/parseSource.mjs +7 -3
- package/pipeline/parseSource/restructureFrames.mjs +4 -13
- package/pipeline/transformHtmlCodeBlock/transformHtmlCodeBlock.d.mts +17 -1
- package/pipeline/transformHtmlCodeBlock/transformHtmlCodeBlock.mjs +10 -5
- package/useCode/Pre.mjs +34 -4
- package/useCode/useCode.mjs +1 -0
- package/useCode/useFileNavigation.d.mts +2 -0
- package/useCode/useFileNavigation.mjs +17 -7
- package/withDocsInfra/withDocsInfra.d.mts +17 -0
- package/withDocsInfra/withDocsInfra.mjs +14 -2
|
@@ -24,6 +24,8 @@ export type Externals = Record<string, ExternalImportItem[]>;
|
|
|
24
24
|
export interface HastRoot extends Root {
|
|
25
25
|
data?: RootData & {
|
|
26
26
|
totalLines?: number;
|
|
27
|
+
collapsible?: boolean;
|
|
28
|
+
frameSize?: number;
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
export type VariantSource = string | HastRoot | {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Code, CodeHighlighterProps, ContentLoadingProps, ContentProps, LoadCodeMeta, LoadSource, LoadVariantMeta, ParseSource } from "../CodeHighlighter/types.mjs";
|
|
2
|
+
import type { Code, CodeHighlighterProps, ContentLoadingProps, ContentProps, LoadCodeMeta, LoadSource, LoadVariantMeta, ParseSource, SourceEnhancers } from "../CodeHighlighter/types.mjs";
|
|
3
3
|
import { DemoGlobalData } from "../createDemoData/types.mjs";
|
|
4
4
|
type CreateDemoMeta = {
|
|
5
5
|
name?: string;
|
|
@@ -32,6 +32,7 @@ type AbstractCreateDemoOptions<T extends {}> = {
|
|
|
32
32
|
loadVariantMeta?: LoadVariantMeta;
|
|
33
33
|
loadSource?: LoadSource;
|
|
34
34
|
sourceParser?: Promise<ParseSource>;
|
|
35
|
+
sourceEnhancers?: SourceEnhancers;
|
|
35
36
|
};
|
|
36
37
|
export declare function abstractCreateDemo<T extends {}>(options: AbstractCreateDemoOptions<T>, url: string, variants: {
|
|
37
38
|
[key: string]: React.ComponentType;
|
|
@@ -31,6 +31,7 @@ export function abstractCreateDemo(options, url, variants, meta) {
|
|
|
31
31
|
loadVariantMeta: options.loadVariantMeta,
|
|
32
32
|
loadSource: options.loadSource,
|
|
33
33
|
sourceParser: options.sourceParser,
|
|
34
|
+
sourceEnhancers: options.sourceEnhancers,
|
|
34
35
|
highlightAfter: meta?.highlightAfter || options.highlightAfter,
|
|
35
36
|
enhanceAfter: meta?.enhanceAfter || options.enhanceAfter,
|
|
36
37
|
controlled: options.controlled,
|
package/cli/index.mjs
CHANGED
|
@@ -7,4 +7,4 @@ function getVersion() {
|
|
|
7
7
|
}
|
|
8
8
|
yargs().scriptName('docs-infra').usage('$0 <command> [args]').command(runValidate).demandCommand(1, 'You need at least one command before moving on').strict().help()
|
|
9
9
|
// MUI_VERSION is set through the code-infra build command.
|
|
10
|
-
.version("0.
|
|
10
|
+
.version("0.10.0" || getVersion()).parse(hideBin(process.argv));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-docs-infra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1-canary.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI Infra - internal documentation creation tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -429,6 +429,16 @@
|
|
|
429
429
|
"default": "./pipeline/hastUtils/index.mjs"
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
|
+
"./pipeline/lintJavascriptDemoFocus": {
|
|
433
|
+
"import": {
|
|
434
|
+
"types": "./pipeline/lintJavascriptDemoFocus/index.d.mts",
|
|
435
|
+
"default": "./pipeline/lintJavascriptDemoFocus/index.mjs"
|
|
436
|
+
},
|
|
437
|
+
"default": {
|
|
438
|
+
"types": "./pipeline/lintJavascriptDemoFocus/index.d.mts",
|
|
439
|
+
"default": "./pipeline/lintJavascriptDemoFocus/index.mjs"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
432
442
|
"./pipeline/loadCodeVariant": {
|
|
433
443
|
"import": {
|
|
434
444
|
"types": "./pipeline/loadCodeVariant/index.d.mts",
|
|
@@ -633,5 +643,5 @@
|
|
|
633
643
|
"bin": {
|
|
634
644
|
"docs-infra": "./cli/index.mjs"
|
|
635
645
|
},
|
|
636
|
-
"gitSha": "
|
|
646
|
+
"gitSha": "baded479f6a2157c4f06962340f64e0712889483"
|
|
637
647
|
}
|
|
@@ -6,6 +6,23 @@ export type { EmphasisMeta, EnhanceCodeEmphasisOptions, FrameRange } from "../pa
|
|
|
6
6
|
* Comments starting with this prefix will be processed for emphasis.
|
|
7
7
|
*/
|
|
8
8
|
export declare const EMPHASIS_COMMENT_PREFIX = "@highlight";
|
|
9
|
+
/**
|
|
10
|
+
* The prefix used to identify focus-only comments in source code.
|
|
11
|
+
* Comments starting with this prefix will mark the region as focused without highlighting.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FOCUS_COMMENT_PREFIX = "@focus";
|
|
14
|
+
/**
|
|
15
|
+
* Modifier token used inside `@highlight` / `@focus` comments
|
|
16
|
+
* to override padding for that directive.
|
|
17
|
+
* Example: @highlight @padding 2.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PADDING_COMMENT_PREFIX = "@padding";
|
|
20
|
+
/**
|
|
21
|
+
* Modifier token used inside `@highlight` / `@focus` comments
|
|
22
|
+
* to override focus max size for that directive.
|
|
23
|
+
* Example: @highlight @min 6.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MIN_COMMENT_PREFIX = "@min";
|
|
9
26
|
/**
|
|
10
27
|
* Creates a source enhancer that adds emphasis to code lines based on `@highlight` comments
|
|
11
28
|
* and restructures frames around highlighted regions.
|