@mui/internal-docs-infra 0.10.1-canary.2 → 0.10.1-canary.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-docs-infra",
|
|
3
|
-
"version": "0.10.1-canary.
|
|
3
|
+
"version": "0.10.1-canary.3",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI Infra - internal documentation creation tools.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -643,5 +643,5 @@
|
|
|
643
643
|
"bin": {
|
|
644
644
|
"docs-infra": "./cli/index.mjs"
|
|
645
645
|
},
|
|
646
|
-
"gitSha": "
|
|
646
|
+
"gitSha": "cad4d117211040086fea5435a525d50f80a8cf34"
|
|
647
647
|
}
|
|
@@ -587,7 +587,11 @@ function calculateEmphasizedLines(directives, lineElements) {
|
|
|
587
587
|
lineHighlight: directive.lineHighlight,
|
|
588
588
|
focus: directive.focus,
|
|
589
589
|
paddingFrameMaxSize: directive.paddingFrameMaxSize,
|
|
590
|
-
focusFramesMaxSize: directive.focusFramesMaxSize
|
|
590
|
+
focusFramesMaxSize: directive.focusFramesMaxSize,
|
|
591
|
+
// Treat a single `@highlight` as a containing highlight range of depth 1
|
|
592
|
+
// so that an outer multiline range wrapping this line is detected as
|
|
593
|
+
// nesting and promoted to `strong`.
|
|
594
|
+
containingRangeDepth: directive.lineHighlight ? 1 : undefined
|
|
591
595
|
});
|
|
592
596
|
} else if (directive.type === 'text') {
|
|
593
597
|
// Text highlight - emphasize specific text(s) within the line.
|
|
@@ -640,7 +644,12 @@ function calculateEmphasizedLines(directives, lineElements) {
|
|
|
640
644
|
|
|
641
645
|
// Determine position for this line in the current range
|
|
642
646
|
let position;
|
|
643
|
-
if (line === startLine && line
|
|
647
|
+
if (line === startLine && line === endLine) {
|
|
648
|
+
// A multiline range that resolves to a single content line (e.g.
|
|
649
|
+
// when comment-only lines are stripped) should be treated as a
|
|
650
|
+
// standalone single-line highlight.
|
|
651
|
+
position = 'single';
|
|
652
|
+
} else if (line === startLine && line !== endLine) {
|
|
644
653
|
position = 'start';
|
|
645
654
|
} else if (line === endLine && line !== startLine) {
|
|
646
655
|
position = 'end';
|
|
@@ -651,13 +660,20 @@ function calculateEmphasizedLines(directives, lineElements) {
|
|
|
651
660
|
// A focus range overlapping with a highlight is not nesting — it just
|
|
652
661
|
// merges focus into the existing entry.
|
|
653
662
|
const meta = existing ? {
|
|
654
|
-
// Nested highlight ranges are strong; focus+highlight overlap is not
|
|
655
|
-
|
|
663
|
+
// Nested highlight ranges are strong; focus+highlight overlap is not.
|
|
664
|
+
// Detect true nesting via `containingRangeDepth` rather than
|
|
665
|
+
// `existing.lineHighlight`. This works when the existing entry
|
|
666
|
+
// came from a `@highlight-text` directive on a line that's also
|
|
667
|
+
// wrapped in a highlight range — `existing.lineHighlight` is true
|
|
668
|
+
// after the first range merge, so a second wrapping range needs to
|
|
669
|
+
// see the depth to know nesting occurred.
|
|
670
|
+
strong: (existing.containingRangeDepth ?? 0) >= 1 && startDirective.lineHighlight || existing.strong || strong,
|
|
656
671
|
description: existing.description ?? (line === startLine ? description : undefined),
|
|
657
672
|
// Inner range position takes precedence, but 'single' from a standalone
|
|
658
673
|
// @highlight-text should be replaced by the multiline range's position.
|
|
659
|
-
// Keep 'single' from
|
|
660
|
-
|
|
674
|
+
// Keep 'single' from a real @highlight (lineHighlight is set), even when
|
|
675
|
+
// the line also carries @highlight-text.
|
|
676
|
+
position: existing.position && !(existing.position === 'single' && existing.highlightTexts && !existing.lineHighlight) ? existing.position : position,
|
|
661
677
|
highlightTexts: existing.highlightTexts,
|
|
662
678
|
// Preserve text highlights from @highlight-text
|
|
663
679
|
lineHighlight: existing.lineHighlight || startDirective.lineHighlight,
|
|
@@ -682,7 +698,10 @@ function calculateEmphasizedLines(directives, lineElements) {
|
|
|
682
698
|
focus: startDirective.focus,
|
|
683
699
|
paddingFrameMaxSize: startDirective.paddingFrameMaxSize,
|
|
684
700
|
focusFramesMaxSize: startDirective.focusFramesMaxSize,
|
|
685
|
-
propagatedOverride: true
|
|
701
|
+
propagatedOverride: true,
|
|
702
|
+
// Track depth so a wrapping outer range can detect nesting
|
|
703
|
+
// (used by the `strong` calculation above).
|
|
704
|
+
containingRangeDepth: startDirective.lineHighlight ? 1 : undefined
|
|
686
705
|
};
|
|
687
706
|
emphasizedLines.set(line, meta);
|
|
688
707
|
}
|