@mui/internal-docs-infra 0.2.3-canary.10 → 0.2.3-canary.12
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/esm/CodeHighlighter/CodeHighlighter.js +16 -16
- package/esm/CodeHighlighter/CodeHighlighterClient.js +33 -33
- package/esm/CodeHighlighter/errors.js +3 -3
- package/esm/CodeHighlighter/types.d.ts +1 -1
- package/esm/CodeProvider/CodeContext.d.ts +4 -4
- package/esm/CodeProvider/CodeProvider.js +7 -7
- package/esm/{CodeHighlighter/addPathsToVariant.d.ts → pipeline/loadCodeVariant/addCodeVariantPaths.d.ts} +1 -1
- package/esm/{CodeHighlighter/applyTransform.d.ts → pipeline/loadCodeVariant/applyCodeTransform.d.ts} +3 -3
- package/esm/{CodeHighlighter/applyTransform.js → pipeline/loadCodeVariant/applyCodeTransform.js} +4 -4
- package/esm/{CodeHighlighter/transformCode.d.ts → pipeline/loadCodeVariant/computeHastDeltas.d.ts} +9 -5
- package/esm/{CodeHighlighter/transformCode.js → pipeline/loadCodeVariant/computeHastDeltas.js} +20 -16
- package/esm/pipeline/loadCodeVariant/diffHast.d.ts +3 -0
- package/esm/{CodeHighlighter/transformParsedSource.js → pipeline/loadCodeVariant/diffHast.js} +5 -5
- package/esm/{CodeHighlighter/examineVariant.d.ts → pipeline/loadCodeVariant/examineCodeVariant.d.ts} +2 -2
- package/esm/{CodeHighlighter/examineVariant.js → pipeline/loadCodeVariant/examineCodeVariant.js} +1 -1
- package/esm/{useDemo/flattenVariant.d.ts → pipeline/loadCodeVariant/flattenCodeVariant.d.ts} +2 -2
- package/esm/{useDemo/flattenVariant.js → pipeline/loadCodeVariant/flattenCodeVariant.js} +3 -3
- package/esm/{CodeHighlighter/hasAllVariants.d.ts → pipeline/loadCodeVariant/hasAllCodeVariants.d.ts} +1 -1
- package/esm/pipeline/loadCodeVariant/index.d.ts +10 -0
- package/esm/pipeline/loadCodeVariant/index.js +17 -0
- package/esm/{CodeHighlighter/loadFallbackCode.d.ts → pipeline/loadCodeVariant/loadCodeFallback.d.ts} +2 -2
- package/esm/{CodeHighlighter/loadFallbackCode.js → pipeline/loadCodeVariant/loadCodeFallback.js} +16 -16
- package/esm/{CodeHighlighter/loadVariant.d.ts → pipeline/loadCodeVariant/loadCodeVariant.d.ts} +2 -2
- package/esm/{CodeHighlighter/loadVariant.js → pipeline/loadCodeVariant/loadCodeVariant.js} +11 -11
- package/esm/{CodeHighlighter/maybeInitialData.d.ts → pipeline/loadCodeVariant/maybeCodeInitialData.d.ts} +6 -6
- package/esm/{CodeHighlighter/maybeInitialData.js → pipeline/loadCodeVariant/maybeCodeInitialData.js} +6 -6
- package/esm/{CodeHighlighter/mergeMetadata.d.ts → pipeline/loadCodeVariant/mergeCodeMetadata.d.ts} +3 -3
- package/esm/{CodeHighlighter/mergeMetadata.js → pipeline/loadCodeVariant/mergeCodeMetadata.js} +3 -3
- package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/parseCode.d.ts +1 -1
- package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/transformSource.d.ts +1 -1
- package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +7 -7
- package/esm/pipeline/loadPrecomputedCodeHighlighterClient/loadPrecomputedCodeHighlighterClient.js +7 -7
- package/esm/pipeline/loadServerCodeMeta/index.d.ts +2 -1
- package/esm/pipeline/loadServerCodeMeta/index.js +2 -1
- package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.d.ts +1 -1
- package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.js +2 -2
- package/esm/pipeline/{loaderUtils → loadServerCodeMeta}/resolveModulePathWithFs.d.ts +1 -1
- package/esm/pipeline/{loaderUtils → loadServerCodeMeta}/resolveModulePathWithFs.js +1 -1
- package/esm/pipeline/loadServerSource/loadServerSource.js +1 -1
- package/esm/pipeline/transformHtmlCodePrecomputed/transformHtmlCodePrecomputed.d.ts +2 -2
- package/esm/pipeline/transformHtmlCodePrecomputed/transformHtmlCodePrecomputed.js +5 -5
- package/esm/useCode/useCodeUtils.js +3 -3
- package/esm/useDemo/createCodeSandbox.d.ts +1 -1
- package/esm/useDemo/createStackBlitz.d.ts +1 -1
- package/esm/useDemo/exportVariant.js +13 -11
- package/esm/useDemo/index.d.ts +1 -1
- package/esm/useDemo/index.js +1 -1
- package/esm/useDemo/useDemo.d.ts +3 -3
- package/esm/useDemo/useDemo.js +6 -6
- package/esm/withDocsInfra/withDeploymentConfig.js +2 -1
- package/package.json +8 -2
- package/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
- /package/esm/{CodeHighlighter/addPathsToVariant.js → pipeline/loadCodeVariant/addCodeVariantPaths.js} +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/calculateMainFilePath.d.ts +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/calculateMainFilePath.js +0 -0
- /package/esm/{CodeHighlighter/hasAllVariants.js → pipeline/loadCodeVariant/hasAllCodeVariants.js} +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/parseCode.js +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/pathUtils.d.ts +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/pathUtils.js +0 -0
- /package/esm/{CodeHighlighter → pipeline/loadCodeVariant}/transformSource.js +0 -0
|
@@ -5,11 +5,11 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
6
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { loadCodeVariant } from "../pipeline/loadCodeVariant/loadCodeVariant.js";
|
|
9
|
+
import { loadCodeFallback } from "../pipeline/loadCodeVariant/loadCodeFallback.js";
|
|
10
10
|
import { CodeHighlighterClient } from "./CodeHighlighterClient.js";
|
|
11
|
-
import {
|
|
12
|
-
import { hasAllVariants } from "
|
|
11
|
+
import { maybeCodeInitialData } from "../pipeline/loadCodeVariant/maybeCodeInitialData.js";
|
|
12
|
+
import { hasAllVariants } from "../pipeline/loadCodeVariant/hasAllCodeVariants.js";
|
|
13
13
|
import { getFileNameFromUrl } from "../pipeline/loaderUtils/getFileNameFromUrl.js";
|
|
14
14
|
import { codeToFallbackProps } from "./codeToFallbackProps.js";
|
|
15
15
|
import * as Errors from "./errors.js";
|
|
@@ -176,7 +176,7 @@ function _CodeSourceLoader() {
|
|
|
176
176
|
} else if (props.deferParsing === 'none') {
|
|
177
177
|
output = 'hast';
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return loadCodeVariant(variantUrl, variantName, variantCode, {
|
|
180
180
|
sourceParser: props.sourceParser,
|
|
181
181
|
loadSource: props.loadSource,
|
|
182
182
|
loadVariantMeta: props.loadVariantMeta,
|
|
@@ -313,7 +313,7 @@ function CodeInitialSourceLoader(_x3) {
|
|
|
313
313
|
}
|
|
314
314
|
function _CodeInitialSourceLoader() {
|
|
315
315
|
_CodeInitialSourceLoader = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(props) {
|
|
316
|
-
var url, initialVariant, highlightAfter, fallbackUsesExtraFiles, fallbackUsesAllVariants, sourceParser, loadSource, loadVariantMeta, loadCodeMeta, fileName, variants, globalsCode, ContentLoading, output, _yield$
|
|
316
|
+
var url, initialVariant, highlightAfter, fallbackUsesExtraFiles, fallbackUsesAllVariants, sourceParser, loadSource, loadVariantMeta, loadCodeMeta, fileName, variants, globalsCode, ContentLoading, output, _yield$loadCodeFallba, code, initialFilename, initialSource, initialExtraFiles, processedGlobalsCode;
|
|
317
317
|
return _regenerator().w(function (_context4) {
|
|
318
318
|
while (1) switch (_context4.n) {
|
|
319
319
|
case 0:
|
|
@@ -331,7 +331,7 @@ function _CodeInitialSourceLoader() {
|
|
|
331
331
|
output = 'hast';
|
|
332
332
|
}
|
|
333
333
|
_context4.n = 2;
|
|
334
|
-
return
|
|
334
|
+
return loadCodeFallback(url, initialVariant, props.code, {
|
|
335
335
|
shouldHighlight: highlightAfter === 'init',
|
|
336
336
|
fallbackUsesExtraFiles: fallbackUsesExtraFiles,
|
|
337
337
|
fallbackUsesAllVariants: fallbackUsesAllVariants,
|
|
@@ -345,12 +345,12 @@ function _CodeInitialSourceLoader() {
|
|
|
345
345
|
output: output
|
|
346
346
|
});
|
|
347
347
|
case 2:
|
|
348
|
-
_yield$
|
|
349
|
-
code = _yield$
|
|
350
|
-
initialFilename = _yield$
|
|
351
|
-
initialSource = _yield$
|
|
352
|
-
initialExtraFiles = _yield$
|
|
353
|
-
processedGlobalsCode = _yield$
|
|
348
|
+
_yield$loadCodeFallba = _context4.v;
|
|
349
|
+
code = _yield$loadCodeFallba.code;
|
|
350
|
+
initialFilename = _yield$loadCodeFallba.initialFilename;
|
|
351
|
+
initialSource = _yield$loadCodeFallba.initialSource;
|
|
352
|
+
initialExtraFiles = _yield$loadCodeFallba.initialExtraFiles;
|
|
353
|
+
processedGlobalsCode = _yield$loadCodeFallba.processedGlobalsCode;
|
|
354
354
|
return _context4.a(2, renderWithInitialSource(_extends(_extends({}, props), {}, {
|
|
355
355
|
ContentLoading: ContentLoading,
|
|
356
356
|
code: code,
|
|
@@ -417,11 +417,11 @@ export function CodeHighlighter(props) {
|
|
|
417
417
|
|
|
418
418
|
// TODO: use initial.filesOrder to determing which source to use
|
|
419
419
|
|
|
420
|
-
var
|
|
420
|
+
var _maybeCodeInitialData = maybeCodeInitialData(variants, initialKey, code || props.precompute, undefined,
|
|
421
421
|
// TODO: use initial.filesOrder if provided?
|
|
422
422
|
props.highlightAfter === 'init', props.fallbackUsesExtraFiles, props.fallbackUsesAllVariants),
|
|
423
|
-
initialData =
|
|
424
|
-
reason =
|
|
423
|
+
initialData = _maybeCodeInitialData.initialData,
|
|
424
|
+
reason = _maybeCodeInitialData.reason;
|
|
425
425
|
if (!initialData) {
|
|
426
426
|
if (DEBUG) {
|
|
427
427
|
// eslint-disable-next-line no-console
|
|
@@ -9,12 +9,12 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { useCodeContext } from "../CodeProvider/CodeContext.js";
|
|
11
11
|
import { CodeHighlighterContext } from "./CodeHighlighterContext.js";
|
|
12
|
-
import {
|
|
13
|
-
import { hasAllVariants } from "
|
|
12
|
+
import { maybeCodeInitialData } from "../pipeline/loadCodeVariant/maybeCodeInitialData.js";
|
|
13
|
+
import { hasAllVariants } from "../pipeline/loadCodeVariant/hasAllCodeVariants.js";
|
|
14
14
|
import { CodeHighlighterFallbackContext } from "./CodeHighlighterFallbackContext.js";
|
|
15
15
|
import { useControlledCode } from "../CodeControllerContext/index.js";
|
|
16
16
|
import { codeToFallbackProps } from "./codeToFallbackProps.js";
|
|
17
|
-
import {
|
|
17
|
+
import { mergeCodeMetadata } from "../pipeline/loadCodeVariant/mergeCodeMetadata.js";
|
|
18
18
|
import * as Errors from "./errors.js";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
var DEBUG = false; // Set to true for debugging purposes
|
|
@@ -37,9 +37,9 @@ function useInitialData(_ref) {
|
|
|
37
37
|
loadCodeMeta = _useCodeContext.loadCodeMeta,
|
|
38
38
|
loadVariantMeta = _useCodeContext.loadVariantMeta,
|
|
39
39
|
loadSource = _useCodeContext.loadSource,
|
|
40
|
-
|
|
40
|
+
loadCodeFallback = _useCodeContext.loadCodeFallback;
|
|
41
41
|
var _React$useMemo = React.useMemo(function () {
|
|
42
|
-
return
|
|
42
|
+
return maybeCodeInitialData(variants, variantName, code, fileName, highlightAfter === 'init', fallbackUsesExtraFiles, fallbackUsesAllVariants);
|
|
43
43
|
}, [variants, variantName, code, fileName, highlightAfter, fallbackUsesExtraFiles, fallbackUsesAllVariants]),
|
|
44
44
|
initialData = _React$useMemo.initialData,
|
|
45
45
|
reason = _React$useMemo.reason;
|
|
@@ -49,7 +49,7 @@ function useInitialData(_ref) {
|
|
|
49
49
|
// URL is required for loading fallback data
|
|
50
50
|
throw new Errors.ErrorCodeHighlighterClientMissingUrlForFallback();
|
|
51
51
|
}
|
|
52
|
-
if (!
|
|
52
|
+
if (!loadCodeFallback) {
|
|
53
53
|
throw new Errors.ErrorCodeHighlighterClientMissingLoadFallbackCode(url);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -57,7 +57,7 @@ function useInitialData(_ref) {
|
|
|
57
57
|
// TODO: fallbackInitialRenderOnly option? this would mean we can't fetch fallback data on the client side
|
|
58
58
|
// Load initial data if not provided
|
|
59
59
|
React.useEffect(function () {
|
|
60
|
-
if (!needsFallback || !url || !
|
|
60
|
+
if (!needsFallback || !url || !loadCodeFallback) {
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -73,7 +73,7 @@ function useInitialData(_ref) {
|
|
|
73
73
|
console.log('Loading initial data for CodeHighlighterClient: ', reason);
|
|
74
74
|
}
|
|
75
75
|
_context.n = 1;
|
|
76
|
-
return
|
|
76
|
+
return loadCodeFallback(url, variantName, code, {
|
|
77
77
|
shouldHighlight: highlightAfter === 'init',
|
|
78
78
|
fallbackUsesExtraFiles: fallbackUsesExtraFiles,
|
|
79
79
|
fallbackUsesAllVariants: fallbackUsesAllVariants,
|
|
@@ -83,7 +83,7 @@ function useInitialData(_ref) {
|
|
|
83
83
|
loadCodeMeta: loadCodeMeta,
|
|
84
84
|
initialFilename: fileName,
|
|
85
85
|
variants: variants,
|
|
86
|
-
globalsCode: globalsCode // Let
|
|
86
|
+
globalsCode: globalsCode // Let loadCodeFallback handle processing
|
|
87
87
|
})["catch"](function (error) {
|
|
88
88
|
return {
|
|
89
89
|
error: error
|
|
@@ -95,7 +95,7 @@ function useInitialData(_ref) {
|
|
|
95
95
|
console.error(new Errors.ErrorCodeHighlighterClientLoadFallbackFailure(loaded.error));
|
|
96
96
|
} else {
|
|
97
97
|
setCode(loaded.code);
|
|
98
|
-
// Store processed globalsCode from
|
|
98
|
+
// Store processed globalsCode from loadCodeFallback result
|
|
99
99
|
if (loaded.processedGlobalsCode) {
|
|
100
100
|
setProcessedGlobalsCode(loaded.processedGlobalsCode);
|
|
101
101
|
}
|
|
@@ -105,7 +105,7 @@ function useInitialData(_ref) {
|
|
|
105
105
|
}
|
|
106
106
|
}, _callee);
|
|
107
107
|
}))();
|
|
108
|
-
}, [initialData, reason, needsFallback, variantName, code, setCode, highlightAfter, url, sourceParser, loadSource, loadVariantMeta, loadCodeMeta, fallbackUsesExtraFiles, fallbackUsesAllVariants, fileName, variants, globalsCode, setProcessedGlobalsCode,
|
|
108
|
+
}, [initialData, reason, needsFallback, variantName, code, setCode, highlightAfter, url, sourceParser, loadSource, loadVariantMeta, loadCodeMeta, fallbackUsesExtraFiles, fallbackUsesAllVariants, fileName, variants, globalsCode, setProcessedGlobalsCode, loadCodeFallback]);
|
|
109
109
|
}
|
|
110
110
|
function useAllVariants(_ref3) {
|
|
111
111
|
var readyForContent = _ref3.readyForContent,
|
|
@@ -121,7 +121,7 @@ function useAllVariants(_ref3) {
|
|
|
121
121
|
loadCodeMeta = _useCodeContext2.loadCodeMeta,
|
|
122
122
|
loadVariantMeta = _useCodeContext2.loadVariantMeta,
|
|
123
123
|
loadSource = _useCodeContext2.loadSource,
|
|
124
|
-
|
|
124
|
+
loadCodeVariant = _useCodeContext2.loadCodeVariant;
|
|
125
125
|
var needsData = !readyForContent && !isControlled;
|
|
126
126
|
|
|
127
127
|
// validation
|
|
@@ -130,7 +130,7 @@ function useAllVariants(_ref3) {
|
|
|
130
130
|
if (!url) {
|
|
131
131
|
throw new Errors.ErrorCodeHighlighterClientMissingUrlForVariants();
|
|
132
132
|
}
|
|
133
|
-
if (!
|
|
133
|
+
if (!loadCodeVariant) {
|
|
134
134
|
throw new Errors.ErrorCodeHighlighterClientMissingLoadVariant(url);
|
|
135
135
|
}
|
|
136
136
|
if (!code && !loadCodeMeta) {
|
|
@@ -160,9 +160,9 @@ function useAllVariants(_ref3) {
|
|
|
160
160
|
throw new Errors.ErrorCodeHighlighterClientMissingLoadSourceForUnloadedUrls();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
}, [code, globalsCode, loadCodeMeta,
|
|
163
|
+
}, [code, globalsCode, loadCodeMeta, loadCodeVariant, loadSource, needsData, url]);
|
|
164
164
|
React.useEffect(function () {
|
|
165
|
-
if (!needsData || !url || !
|
|
165
|
+
if (!needsData || !url || !loadCodeVariant) {
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -245,7 +245,7 @@ function useAllVariants(_ref3) {
|
|
|
245
245
|
}).filter(function (item) {
|
|
246
246
|
return Boolean(item);
|
|
247
247
|
});
|
|
248
|
-
return
|
|
248
|
+
return loadCodeVariant(url, name, loadedCode[name], {
|
|
249
249
|
disableParsing: true,
|
|
250
250
|
disableTransforms: true,
|
|
251
251
|
loadSource: loadSource,
|
|
@@ -297,7 +297,7 @@ function useAllVariants(_ref3) {
|
|
|
297
297
|
}
|
|
298
298
|
}, _callee3, null, [[0, 8]]);
|
|
299
299
|
}))();
|
|
300
|
-
}, [needsData, variants, url, code, setCode, loadSource, loadVariantMeta, loadCodeMeta, processedGlobalsCode, globalsCode, setProcessedGlobalsCode,
|
|
300
|
+
}, [needsData, variants, url, code, setCode, loadSource, loadVariantMeta, loadCodeMeta, processedGlobalsCode, globalsCode, setProcessedGlobalsCode, loadCodeVariant]);
|
|
301
301
|
return {
|
|
302
302
|
readyForContent: readyForContent
|
|
303
303
|
};
|
|
@@ -396,7 +396,7 @@ function useCodeTransforms(_ref7) {
|
|
|
396
396
|
var _useCodeContext4 = useCodeContext(),
|
|
397
397
|
sourceParser = _useCodeContext4.sourceParser,
|
|
398
398
|
getAvailableTransforms = _useCodeContext4.getAvailableTransforms,
|
|
399
|
-
|
|
399
|
+
computeHastDeltas = _useCodeContext4.computeHastDeltas;
|
|
400
400
|
var _React$useState3 = React.useState(undefined),
|
|
401
401
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
402
402
|
transformedCode = _React$useState4[0],
|
|
@@ -412,7 +412,7 @@ function useCodeTransforms(_ref7) {
|
|
|
412
412
|
|
|
413
413
|
// Effect to compute transformations for all variants
|
|
414
414
|
React.useEffect(function () {
|
|
415
|
-
if (!parsedCode || !sourceParser || !
|
|
415
|
+
if (!parsedCode || !sourceParser || !computeHastDeltas) {
|
|
416
416
|
setTransformedCode(parsedCode);
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
@@ -429,7 +429,7 @@ function useCodeTransforms(_ref7) {
|
|
|
429
429
|
case 1:
|
|
430
430
|
parseSource = _context4.v;
|
|
431
431
|
_context4.n = 2;
|
|
432
|
-
return
|
|
432
|
+
return computeHastDeltas(parsedCode, parseSource);
|
|
433
433
|
case 2:
|
|
434
434
|
enhanced = _context4.v;
|
|
435
435
|
setTransformedCode(enhanced);
|
|
@@ -445,7 +445,7 @@ function useCodeTransforms(_ref7) {
|
|
|
445
445
|
}
|
|
446
446
|
}, _callee4, null, [[0, 3]]);
|
|
447
447
|
}))();
|
|
448
|
-
}, [parsedCode, sourceParser,
|
|
448
|
+
}, [parsedCode, sourceParser, computeHastDeltas]);
|
|
449
449
|
return {
|
|
450
450
|
transformedCode: transformedCode,
|
|
451
451
|
availableTransforms: availableTransforms
|
|
@@ -500,7 +500,7 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
500
500
|
loadCodeMeta = _useCodeContext6.loadCodeMeta,
|
|
501
501
|
loadSource = _useCodeContext6.loadSource,
|
|
502
502
|
loadVariantMeta = _useCodeContext6.loadVariantMeta,
|
|
503
|
-
|
|
503
|
+
loadCodeVariant = _useCodeContext6.loadCodeVariant;
|
|
504
504
|
|
|
505
505
|
// Set processedGlobalsCode if we have ready Code objects but haven't stored them yet
|
|
506
506
|
React.useEffect(function () {
|
|
@@ -523,7 +523,7 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
523
523
|
}
|
|
524
524
|
// If not all ready, fall through to loading logic below
|
|
525
525
|
}
|
|
526
|
-
if (!
|
|
526
|
+
if (!loadCodeVariant) {
|
|
527
527
|
console.error(new Errors.ErrorCodeHighlighterClientMissingLoadVariantForGlobals());
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
@@ -606,7 +606,7 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
606
606
|
case 1:
|
|
607
607
|
_context6.p = 1;
|
|
608
608
|
_context6.n = 2;
|
|
609
|
-
return
|
|
609
|
+
return loadCodeVariant(originalUrl || '',
|
|
610
610
|
// Use the original URL if available
|
|
611
611
|
variantName, codeObj[variantName],
|
|
612
612
|
// May be undefined or string
|
|
@@ -658,7 +658,7 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
658
658
|
}
|
|
659
659
|
}, _callee8, null, [[0, 3]]);
|
|
660
660
|
}))();
|
|
661
|
-
}, [url, globalsCode, processedGlobalsCode, setProcessedGlobalsCode, loadCodeMeta, loadSource, loadVariantMeta, variants,
|
|
661
|
+
}, [url, globalsCode, processedGlobalsCode, setProcessedGlobalsCode, loadCodeMeta, loadSource, loadVariantMeta, variants, loadCodeVariant]);
|
|
662
662
|
|
|
663
663
|
// Determine globalsCodeObjects to use (prefer processed, fallback to direct if ready)
|
|
664
664
|
var globalsCodeObjects = React.useMemo(function () {
|
|
@@ -707,11 +707,11 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
707
707
|
return Boolean(item) && _typeof(item) === 'object';
|
|
708
708
|
});
|
|
709
709
|
if (globalsForVariant.length > 0) {
|
|
710
|
-
// Use
|
|
710
|
+
// Use mergeCodeMetadata for sophisticated globals merging with proper positioning
|
|
711
711
|
var currentVariant = variantData;
|
|
712
712
|
globalsForVariant.forEach(function (globalVariant) {
|
|
713
713
|
if (globalVariant.extraFiles) {
|
|
714
|
-
// Convert globals extraFiles to metadata format for
|
|
714
|
+
// Convert globals extraFiles to metadata format for mergeCodeMetadata
|
|
715
715
|
var globalsMetadata = {};
|
|
716
716
|
for (var _i = 0, _Object$entries = Object.entries(globalVariant.extraFiles); _i < _Object$entries.length; _i++) {
|
|
717
717
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
@@ -726,8 +726,8 @@ function useGlobalsCodeMerging(_ref0) {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
// Use
|
|
730
|
-
currentVariant =
|
|
729
|
+
// Use mergeCodeMetadata to properly position and merge the globals
|
|
730
|
+
currentVariant = mergeCodeMetadata(currentVariant, globalsMetadata);
|
|
731
731
|
}
|
|
732
732
|
});
|
|
733
733
|
|
|
@@ -774,11 +774,11 @@ function usePropsCodeGlobalsMerging(_ref14) {
|
|
|
774
774
|
return Boolean(item) && _typeof(item) === 'object';
|
|
775
775
|
});
|
|
776
776
|
if (globalsForVariant.length > 0) {
|
|
777
|
-
// Use
|
|
777
|
+
// Use mergeCodeMetadata for sophisticated globals merging with proper positioning
|
|
778
778
|
var currentVariant = variantData;
|
|
779
779
|
globalsForVariant.forEach(function (globalVariant) {
|
|
780
780
|
if (globalVariant.extraFiles) {
|
|
781
|
-
// Convert globals extraFiles to metadata format for
|
|
781
|
+
// Convert globals extraFiles to metadata format for mergeCodeMetadata
|
|
782
782
|
var globalsMetadata = {};
|
|
783
783
|
for (var _i2 = 0, _Object$entries2 = Object.entries(globalVariant.extraFiles); _i2 < _Object$entries2.length; _i2++) {
|
|
784
784
|
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
@@ -793,8 +793,8 @@ function usePropsCodeGlobalsMerging(_ref14) {
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
// Use
|
|
797
|
-
currentVariant =
|
|
796
|
+
// Use mergeCodeMetadata to properly position and merge the globals
|
|
797
|
+
currentVariant = mergeCodeMetadata(currentVariant, globalsMetadata);
|
|
798
798
|
}
|
|
799
799
|
});
|
|
800
800
|
|
|
@@ -230,7 +230,7 @@ export var ErrorCodeHighlighterServerLoadVariantsFailure = /*#__PURE__*/function
|
|
|
230
230
|
export var ErrorCodeHighlighterClientMissingLoadFallbackCode = /*#__PURE__*/function (_ErrorCodeHighlighter21) {
|
|
231
231
|
function ErrorCodeHighlighterClientMissingLoadFallbackCode(url) {
|
|
232
232
|
_classCallCheck(this, ErrorCodeHighlighterClientMissingLoadFallbackCode);
|
|
233
|
-
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadFallbackCode, ["Missing
|
|
233
|
+
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadFallbackCode, ["Missing loadCodeFallback function - loadCodeFallback is required (".concat(url || 'No URL', ") add a <CodeProvider />")]);
|
|
234
234
|
}
|
|
235
235
|
_inherits(ErrorCodeHighlighterClientMissingLoadFallbackCode, _ErrorCodeHighlighter21);
|
|
236
236
|
return _createClass(ErrorCodeHighlighterClientMissingLoadFallbackCode);
|
|
@@ -238,7 +238,7 @@ export var ErrorCodeHighlighterClientMissingLoadFallbackCode = /*#__PURE__*/func
|
|
|
238
238
|
export var ErrorCodeHighlighterClientMissingLoadVariant = /*#__PURE__*/function (_ErrorCodeHighlighter22) {
|
|
239
239
|
function ErrorCodeHighlighterClientMissingLoadVariant(url) {
|
|
240
240
|
_classCallCheck(this, ErrorCodeHighlighterClientMissingLoadVariant);
|
|
241
|
-
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadVariant, ["Missing
|
|
241
|
+
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadVariant, ["Missing loadCodeVariant function - loadCodeVariant function is required when no initial code is provided (".concat(url || 'No URL', ")")]);
|
|
242
242
|
}
|
|
243
243
|
_inherits(ErrorCodeHighlighterClientMissingLoadVariant, _ErrorCodeHighlighter22);
|
|
244
244
|
return _createClass(ErrorCodeHighlighterClientMissingLoadVariant);
|
|
@@ -417,7 +417,7 @@ export var ErrorCodeHighlighterClientTransformProcessingFailure = /*#__PURE__*/f
|
|
|
417
417
|
export var ErrorCodeHighlighterClientMissingLoadVariantForGlobals = /*#__PURE__*/function (_ErrorCodeHighlighter42) {
|
|
418
418
|
function ErrorCodeHighlighterClientMissingLoadVariantForGlobals() {
|
|
419
419
|
_classCallCheck(this, ErrorCodeHighlighterClientMissingLoadVariantForGlobals);
|
|
420
|
-
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadVariantForGlobals, ["
|
|
420
|
+
return _callSuper(this, ErrorCodeHighlighterClientMissingLoadVariantForGlobals, ["loadCodeVariant function is required for loading missing variants in globalsCode"]);
|
|
421
421
|
}
|
|
422
422
|
_inherits(ErrorCodeHighlighterClientMissingLoadVariantForGlobals, _ErrorCodeHighlighter42);
|
|
423
423
|
return _createClass(ErrorCodeHighlighterClientMissingLoadVariantForGlobals);
|
|
@@ -149,7 +149,7 @@ export interface LoadFileOptions {
|
|
|
149
149
|
output?: 'hast' | 'hastJson' | 'hastGzip';
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* Options for the
|
|
152
|
+
* Options for the loadCodeVariant function, extending LoadFileOptions with required function dependencies
|
|
153
153
|
*/
|
|
154
154
|
export interface LoadVariantOptions extends LoadFileOptions, Pick<CodeFunctionProps, 'sourceParser' | 'loadSource' | 'loadVariantMeta' | 'sourceTransformers'> {}
|
|
155
155
|
/**
|
|
@@ -11,7 +11,7 @@ export type LoadVariantFn = (url: string | undefined, variantName: string, varia
|
|
|
11
11
|
}>;
|
|
12
12
|
export type ParseCodeFn = (code: Code, parseSource: ParseSource) => Code;
|
|
13
13
|
export type ParseControlledCodeFn = (controlledCode: ControlledCode, parseSource: ParseSource) => Code;
|
|
14
|
-
export type
|
|
14
|
+
export type ComputeHastDeltasFn = (parsedCode: Code, parseSource: ParseSource) => Promise<Code>;
|
|
15
15
|
export type GetAvailableTransformsFn = (parsedCode: Code | undefined, variantName: string) => string[];
|
|
16
16
|
export interface CodeContext {
|
|
17
17
|
sourceParser?: Promise<ParseSource>;
|
|
@@ -20,11 +20,11 @@ export interface CodeContext {
|
|
|
20
20
|
loadSource?: LoadSource;
|
|
21
21
|
loadVariantMeta?: LoadVariantMeta;
|
|
22
22
|
loadCodeMeta?: LoadCodeMeta;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
loadCodeFallback?: LoadFallbackCodeFn;
|
|
24
|
+
loadCodeVariant?: LoadVariantFn;
|
|
25
25
|
parseCode?: ParseCodeFn;
|
|
26
26
|
parseControlledCode?: ParseControlledCodeFn;
|
|
27
|
-
|
|
27
|
+
computeHastDeltas?: ComputeHastDeltasFn;
|
|
28
28
|
getAvailableTransforms?: GetAvailableTransformsFn;
|
|
29
29
|
}
|
|
30
30
|
export declare const CodeContext: React.Context<CodeContext>;
|
|
@@ -7,11 +7,11 @@ import { CodeContext } from "./CodeContext.js";
|
|
|
7
7
|
import { extensionMap, grammars } from "../pipeline/parseSource/grammars.js";
|
|
8
8
|
import { starryNightGutter } from "../pipeline/parseSource/addLineGutters.js";
|
|
9
9
|
// Import the heavy functions
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { parseCode } from "../
|
|
10
|
+
import { loadCodeFallback } from "../pipeline/loadCodeVariant/loadCodeFallback.js";
|
|
11
|
+
import { loadCodeVariant } from "../pipeline/loadCodeVariant/loadCodeVariant.js";
|
|
12
|
+
import { parseCode } from "../pipeline/loadCodeVariant/parseCode.js";
|
|
13
13
|
import { parseControlledCode } from "../CodeHighlighter/parseControlledCode.js";
|
|
14
|
-
import {
|
|
14
|
+
import { computeHastDeltas, getAvailableTransforms } from "../pipeline/loadCodeVariant/computeHastDeltas.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export function CodeProvider(_ref) {
|
|
17
17
|
var children = _ref.children,
|
|
@@ -68,11 +68,11 @@ export function CodeProvider(_ref) {
|
|
|
68
68
|
loadVariantMeta: loadVariantMeta,
|
|
69
69
|
loadCodeMeta: loadCodeMeta,
|
|
70
70
|
// Provide the heavy functions
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
loadCodeFallback: loadCodeFallback,
|
|
72
|
+
loadCodeVariant: loadCodeVariant,
|
|
73
73
|
parseCode: parseCode,
|
|
74
74
|
parseControlledCode: parseControlledCode,
|
|
75
|
-
|
|
75
|
+
computeHastDeltas: computeHastDeltas,
|
|
76
76
|
getAvailableTransforms: getAvailableTransforms
|
|
77
77
|
};
|
|
78
78
|
}, [sourceParser, parseSource, loadSource, loadVariantMeta, loadCodeMeta]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Add path utility to add path property to each file in a variant
|
|
3
3
|
* Uses calculateMainFilePath utility and URL resolution for simplified path calculation
|
|
4
4
|
*/
|
|
5
|
-
import type { VariantCode, VariantSource } from "
|
|
5
|
+
import type { VariantCode, VariantSource } from "../../CodeHighlighter/types.js";
|
|
6
6
|
export interface FileWithPath {
|
|
7
7
|
source?: VariantSource;
|
|
8
8
|
metadata?: boolean;
|
package/esm/{CodeHighlighter/applyTransform.d.ts → pipeline/loadCodeVariant/applyCodeTransform.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VariantSource, Transforms } from "
|
|
1
|
+
import type { VariantSource, Transforms } from "../../CodeHighlighter/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Applies a specific transform to a variant source and returns the transformed source
|
|
4
4
|
* @param source - The original variant source (string, HastNodes, or hastJson object)
|
|
@@ -7,7 +7,7 @@ import type { VariantSource, Transforms } from "./types.js";
|
|
|
7
7
|
* @returns The transformed variant source in the same format as the input
|
|
8
8
|
* @throws Error if the transform key doesn't exist or patching fails
|
|
9
9
|
*/
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function applyCodeTransform(source: VariantSource, transforms: Transforms, transformKey: string): VariantSource;
|
|
11
11
|
/**
|
|
12
12
|
* Applies multiple transforms to a variant source in sequence
|
|
13
13
|
* @param source - The original variant source
|
|
@@ -16,4 +16,4 @@ export declare function applyTransform(source: VariantSource, transforms: Transf
|
|
|
16
16
|
* @returns The transformed variant source in the same format as the input
|
|
17
17
|
* @throws Error if any transform key doesn't exist or patching fails
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function applyCodeTransforms(source: VariantSource, transforms: Transforms, transformKeys: string[]): VariantSource;
|
package/esm/{CodeHighlighter/applyTransform.js → pipeline/loadCodeVariant/applyCodeTransform.js}
RENAMED
|
@@ -8,7 +8,7 @@ import { patch, clone } from 'jsondiffpatch';
|
|
|
8
8
|
* @returns The transformed variant source in the same format as the input
|
|
9
9
|
* @throws Error if the transform key doesn't exist or patching fails
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function applyCodeTransform(source, transforms, transformKey) {
|
|
12
12
|
var transform = transforms[transformKey];
|
|
13
13
|
if (!transform) {
|
|
14
14
|
throw new Error("Transform \"".concat(transformKey, "\" not found in transforms"));
|
|
@@ -25,7 +25,7 @@ export function applyTransform(source, transforms, transformKey) {
|
|
|
25
25
|
return patched.join('\n');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// For Hast node sources, deltas are typically node-based (from
|
|
28
|
+
// For Hast node sources, deltas are typically node-based (from diffHast)
|
|
29
29
|
var sourceRoot;
|
|
30
30
|
var isHastJson = 'hastJson' in source;
|
|
31
31
|
if (isHastJson) {
|
|
@@ -57,14 +57,14 @@ export function applyTransform(source, transforms, transformKey) {
|
|
|
57
57
|
* @returns The transformed variant source in the same format as the input
|
|
58
58
|
* @throws Error if any transform key doesn't exist or patching fails
|
|
59
59
|
*/
|
|
60
|
-
export function
|
|
60
|
+
export function applyCodeTransforms(source, transforms, transformKeys) {
|
|
61
61
|
var currentSource = source;
|
|
62
62
|
var _iterator = _createForOfIteratorHelper(transformKeys),
|
|
63
63
|
_step;
|
|
64
64
|
try {
|
|
65
65
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
66
66
|
var transformKey = _step.value;
|
|
67
|
-
currentSource =
|
|
67
|
+
currentSource = applyCodeTransform(currentSource, transforms, transformKey);
|
|
68
68
|
}
|
|
69
69
|
} catch (err) {
|
|
70
70
|
_iterator.e(err);
|
package/esm/{CodeHighlighter/transformCode.d.ts → pipeline/loadCodeVariant/computeHastDeltas.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Code, ParseSource } from "
|
|
1
|
+
import type { Code, ParseSource } from "../../CodeHighlighter/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Pure function to identify which variants need transformation.
|
|
4
4
|
* Returns entries of variants that have transforms requiring processing.
|
|
@@ -13,9 +13,13 @@ export declare function getAvailableTransforms(parsedCode: Code | undefined, var
|
|
|
13
13
|
* Pure async function to transform a single variant's code and extraFiles.
|
|
14
14
|
* Returns the transformed variant or the original if transformation fails.
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function computeVariantDeltas(variant: string, variantCode: any, parseSource: ParseSource): Promise<any>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Computes transform deltas for all variants in the parsed code.
|
|
19
|
+
* This function generates the transformation data that can be applied later.
|
|
20
|
+
*
|
|
21
|
+
* @param parsedCode - The parsed code object containing variants
|
|
22
|
+
* @param parseSource - The parser function to parse source strings
|
|
23
|
+
* @returns A promise that resolves to the code with computed transforms
|
|
20
24
|
*/
|
|
21
|
-
export declare function
|
|
25
|
+
export declare function computeHastDeltas(parsedCode: Code, parseSource: ParseSource): Promise<Code>;
|
package/esm/{CodeHighlighter/transformCode.js → pipeline/loadCodeVariant/computeHastDeltas.js}
RENAMED
|
@@ -5,7 +5,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
7
7
|
import { toText } from 'hast-util-to-text';
|
|
8
|
-
import {
|
|
8
|
+
import { diffHast } from "./diffHast.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Pure function to identify which variants need transformation.
|
|
@@ -85,16 +85,20 @@ export function getAvailableTransforms(parsedCode, variantName) {
|
|
|
85
85
|
* Pure async function to transform a single variant's code and extraFiles.
|
|
86
86
|
* Returns the transformed variant or the original if transformation fails.
|
|
87
87
|
*/
|
|
88
|
-
export function
|
|
89
|
-
return
|
|
88
|
+
export function computeVariantDeltas(_x, _x2, _x3) {
|
|
89
|
+
return _computeVariantDeltas.apply(this, arguments);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* Computes transform deltas for all variants in the parsed code.
|
|
94
|
+
* This function generates the transformation data that can be applied later.
|
|
95
|
+
*
|
|
96
|
+
* @param parsedCode - The parsed code object containing variants
|
|
97
|
+
* @param parseSource - The parser function to parse source strings
|
|
98
|
+
* @returns A promise that resolves to the code with computed transforms
|
|
95
99
|
*/
|
|
96
|
-
function
|
|
97
|
-
|
|
100
|
+
function _computeVariantDeltas() {
|
|
101
|
+
_computeVariantDeltas = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(variant, variantCode, parseSource) {
|
|
98
102
|
var mainTransformResult, transformedExtraFiles, hastNodes, sourceString, transformedVariant;
|
|
99
103
|
return _regenerator().w(function (_context2) {
|
|
100
104
|
while (1) switch (_context2.n) {
|
|
@@ -114,7 +118,7 @@ function _transformVariant() {
|
|
|
114
118
|
whitespace: 'pre'
|
|
115
119
|
});
|
|
116
120
|
_context2.n = 2;
|
|
117
|
-
return
|
|
121
|
+
return diffHast(sourceString, hastNodes, variant,
|
|
118
122
|
// fileName
|
|
119
123
|
variantCode.transforms, parseSource);
|
|
120
124
|
case 2:
|
|
@@ -142,7 +146,7 @@ function _transformVariant() {
|
|
|
142
146
|
whitespace: 'pre'
|
|
143
147
|
});
|
|
144
148
|
_context.n = 2;
|
|
145
|
-
return
|
|
149
|
+
return diffHast(extraSourceString, extraHastNodes, fileName, fileContent.transforms, parseSource);
|
|
146
150
|
case 2:
|
|
147
151
|
extraTransformResult = _context.v;
|
|
148
152
|
return _context.a(2, [fileName, _extends(_extends({}, fileContent), {}, {
|
|
@@ -177,13 +181,13 @@ function _transformVariant() {
|
|
|
177
181
|
}
|
|
178
182
|
}, _callee2);
|
|
179
183
|
}));
|
|
180
|
-
return
|
|
184
|
+
return _computeVariantDeltas.apply(this, arguments);
|
|
181
185
|
}
|
|
182
|
-
export function
|
|
183
|
-
return
|
|
186
|
+
export function computeHastDeltas(_x4, _x5) {
|
|
187
|
+
return _computeHastDeltas.apply(this, arguments);
|
|
184
188
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
189
|
+
function _computeHastDeltas() {
|
|
190
|
+
_computeHastDeltas = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(parsedCode, parseSource) {
|
|
187
191
|
var variantsToTransform, results, enhancedCode, _iterator, _step, _step$value, variant, transformedVariant;
|
|
188
192
|
return _regenerator().w(function (_context4) {
|
|
189
193
|
while (1) switch (_context4.n) {
|
|
@@ -205,7 +209,7 @@ function _applyTransforms() {
|
|
|
205
209
|
_ref8 = _slicedToArray(_ref6, 2), variant = _ref8[0], variantCode = _ref8[1];
|
|
206
210
|
_context3.p = 1;
|
|
207
211
|
_context3.n = 2;
|
|
208
|
-
return
|
|
212
|
+
return computeVariantDeltas(variant, variantCode, parseSource);
|
|
209
213
|
case 2:
|
|
210
214
|
transformedVariant = _context3.v;
|
|
211
215
|
return _context3.a(2, {
|
|
@@ -247,5 +251,5 @@ function _applyTransforms() {
|
|
|
247
251
|
}
|
|
248
252
|
}, _callee4);
|
|
249
253
|
}));
|
|
250
|
-
return
|
|
254
|
+
return _computeHastDeltas.apply(this, arguments);
|
|
251
255
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Nodes } from 'hast';
|
|
2
|
+
import { ParseSource, Transforms } from "../../CodeHighlighter/types.js";
|
|
3
|
+
export declare function diffHast(source: string, parsedSource: Nodes, filename: string, transforms: Transforms, parseSource: ParseSource): Promise<Record<string, any>>;
|
package/esm/{CodeHighlighter/transformParsedSource.js → pipeline/loadCodeVariant/diffHast.js}
RENAMED
|
@@ -9,11 +9,11 @@ var differ = create({
|
|
|
9
9
|
omitRemovedValues: true,
|
|
10
10
|
cloneDiffValues: true
|
|
11
11
|
});
|
|
12
|
-
export function
|
|
13
|
-
return
|
|
12
|
+
export function diffHast(_x, _x2, _x3, _x4, _x5) {
|
|
13
|
+
return _diffHast.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
15
|
+
function _diffHast() {
|
|
16
|
+
_diffHast = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(source, parsedSource, filename, transforms, parseSource) {
|
|
17
17
|
var transformed;
|
|
18
18
|
return _regenerator().w(function (_context2) {
|
|
19
19
|
while (1) switch (_context2.n) {
|
|
@@ -56,5 +56,5 @@ function _transformParsedSource() {
|
|
|
56
56
|
}
|
|
57
57
|
}, _callee2);
|
|
58
58
|
}));
|
|
59
|
-
return
|
|
59
|
+
return _diffHast.apply(this, arguments);
|
|
60
60
|
}
|
package/esm/{CodeHighlighter/examineVariant.d.ts → pipeline/loadCodeVariant/examineCodeVariant.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Variant examination utility for analyzing variant structure and paths
|
|
3
3
|
*/
|
|
4
|
-
import type { VariantCode } from "
|
|
4
|
+
import type { VariantCode } from "../../CodeHighlighter/types.js";
|
|
5
5
|
interface PathContextBase {
|
|
6
6
|
hasMetadata: boolean;
|
|
7
7
|
maxSourceBackNavigation: number;
|
|
@@ -21,5 +21,5 @@ export type PathContext = PathContextWithUrl | PathContextWithoutUrl;
|
|
|
21
21
|
/**
|
|
22
22
|
* Create path context for processing files with extended information
|
|
23
23
|
*/
|
|
24
|
-
export declare function
|
|
24
|
+
export declare function examineCodeVariant(variant: VariantCode): PathContext;
|
|
25
25
|
export {};
|