@qualcomm-ui/mdx-vite 3.0.3 → 3.1.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/dist/cli.js +29 -30
- package/dist/cli.js.map +3 -3
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts +5 -1
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/section-extractor.d.ts +0 -5
- package/dist/docs-plugin/markdown/knowledge/section-extractor.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/types.d.ts +8 -0
- package/dist/docs-plugin/markdown/knowledge/types.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts +2 -2
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts.map +1 -1
- package/dist/docs-plugin/plugin-state.d.ts +1 -0
- package/dist/docs-plugin/plugin-state.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-frontmatter-title.d.ts +3 -4
- package/dist/docs-plugin/remark/remark-frontmatter-title.d.ts.map +1 -1
- package/dist/docs-plugin/search-indexer.d.ts.map +1 -1
- package/dist/index.js +118 -101
- package/dist/index.js.map +3 -3
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4322,7 +4322,7 @@ var remarkFrontmatterInterpolation = (frontmatter) => {
|
|
|
4322
4322
|
};
|
|
4323
4323
|
|
|
4324
4324
|
// src/docs-plugin/remark/remark-frontmatter-title.ts
|
|
4325
|
-
import { visit as visit6 } from "unist-util-visit";
|
|
4325
|
+
import { EXIT, visit as visit6 } from "unist-util-visit";
|
|
4326
4326
|
|
|
4327
4327
|
// src/docs-plugin/remark/remark-remove-code-blocks.ts
|
|
4328
4328
|
import { remove } from "unist-util-remove";
|
|
@@ -4617,6 +4617,24 @@ function computeMd5(content) {
|
|
|
4617
4617
|
}
|
|
4618
4618
|
|
|
4619
4619
|
// src/docs-plugin/markdown/knowledge/section-extractor.ts
|
|
4620
|
+
function transformLinks() {
|
|
4621
|
+
return () => (tree) => {
|
|
4622
|
+
visit11(tree, "link", (node) => {
|
|
4623
|
+
let text = "";
|
|
4624
|
+
visit11(node, "text", (textNode) => {
|
|
4625
|
+
text += textNode.value;
|
|
4626
|
+
});
|
|
4627
|
+
Object.assign(node, {
|
|
4628
|
+
children: void 0,
|
|
4629
|
+
type: "inlineCode",
|
|
4630
|
+
url: void 0,
|
|
4631
|
+
value: text
|
|
4632
|
+
});
|
|
4633
|
+
});
|
|
4634
|
+
};
|
|
4635
|
+
}
|
|
4636
|
+
var rawProcessor = unified4().use(remarkGfm2).use(remarkStringify4);
|
|
4637
|
+
var contentProcessor = unified4().use(remarkGfm2).use(transformLinks()).use(remarkStringify4);
|
|
4620
4638
|
var SectionExtractor = class {
|
|
4621
4639
|
depths;
|
|
4622
4640
|
minContentLength;
|
|
@@ -4808,36 +4826,14 @@ var SectionExtractor = class {
|
|
|
4808
4826
|
const content = closeIndex !== -1 ? afterOpen.slice(0, closeIndex) : afterOpen;
|
|
4809
4827
|
return content.split("\n").map((line) => line.trim()).filter((line) => line && line !== ":::");
|
|
4810
4828
|
}
|
|
4811
|
-
/**
|
|
4812
|
-
* Convert links to inline code. URLs are not relevant for text embeddings
|
|
4813
|
-
* and will muddy the vector storage.
|
|
4814
|
-
*/
|
|
4815
|
-
transformLinks() {
|
|
4816
|
-
return () => (tree) => {
|
|
4817
|
-
visit11(tree, "link", (node) => {
|
|
4818
|
-
let text = "";
|
|
4819
|
-
visit11(node, "text", (textNode) => {
|
|
4820
|
-
text += textNode.value;
|
|
4821
|
-
});
|
|
4822
|
-
Object.assign(node, {
|
|
4823
|
-
children: void 0,
|
|
4824
|
-
type: "inlineCode",
|
|
4825
|
-
url: void 0,
|
|
4826
|
-
value: text
|
|
4827
|
-
});
|
|
4828
|
-
});
|
|
4829
|
-
};
|
|
4830
|
-
}
|
|
4831
4829
|
nodesToRawContent(nodes) {
|
|
4832
4830
|
const tree = { children: nodes, type: "root" };
|
|
4833
|
-
|
|
4834
|
-
return processor.stringify(tree);
|
|
4831
|
+
return rawProcessor.stringify(tree);
|
|
4835
4832
|
}
|
|
4836
4833
|
nodesToContent(nodes) {
|
|
4837
4834
|
const tree = { children: structuredClone(nodes), type: "root" };
|
|
4838
|
-
const
|
|
4839
|
-
|
|
4840
|
-
return processor.stringify(transformed);
|
|
4835
|
+
const transformed = contentProcessor.runSync(tree);
|
|
4836
|
+
return contentProcessor.stringify(transformed);
|
|
4841
4837
|
}
|
|
4842
4838
|
generateSectionId(headerPath) {
|
|
4843
4839
|
return headerPath.map((h) => slugify(h)).join("-");
|
|
@@ -5407,6 +5403,7 @@ var SearchIndexer = class {
|
|
|
5407
5403
|
this.metaJson,
|
|
5408
5404
|
routeMeta?.title || frontmatter.title || ""
|
|
5409
5405
|
),
|
|
5406
|
+
data: frontmatter,
|
|
5410
5407
|
description: frontmatter.description,
|
|
5411
5408
|
hidden: defined2(routeMeta.hidden) ? routeMeta.hidden : frontmatter.hidden,
|
|
5412
5409
|
hideBreadcrumbs: defined2(routeMeta.hideBreadcrumbs) ? routeMeta.hideBreadcrumbs : frontmatter.hideBreadcrumbs,
|
|
@@ -5593,10 +5590,12 @@ var SearchIndexer = class {
|
|
|
5593
5590
|
this.config.routingStrategy
|
|
5594
5591
|
);
|
|
5595
5592
|
this._mdxFileCount = mdxFileGlob.length;
|
|
5596
|
-
this.mdxFileReader.gitMetadataMap
|
|
5597
|
-
this.
|
|
5598
|
-
|
|
5599
|
-
|
|
5593
|
+
if (!this.mdxFileReader.enabled || this.mdxFileReader.gitMetadataMap.size === 0) {
|
|
5594
|
+
this.mdxFileReader.gitMetadataMap = buildGitMetadataMap(
|
|
5595
|
+
this.config.srcDir,
|
|
5596
|
+
this.mdxFileReader.pageTimestampMetadata
|
|
5597
|
+
);
|
|
5598
|
+
}
|
|
5600
5599
|
const compiledFiles = mdxFileGlob.map((file) => this.compileMdxFile(file));
|
|
5601
5600
|
const mdxIndex = compiledFiles.map((fileData) => fileData.pageSections).flat();
|
|
5602
5601
|
filterFileGlob(
|