@qualcomm-ui/mdx-vite 3.3.2 → 3.4.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 +21 -5
- package/dist/cli.js.map +2 -2
- package/dist/docs-plugin/config/types.d.ts +12 -0
- package/dist/docs-plugin/config/types.d.ts.map +1 -1
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts +2 -0
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts.map +1 -1
- package/dist/docs-plugin/docs-plugin.d.ts +1 -12
- package/dist/docs-plugin/docs-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/search-indexer.d.ts.map +1 -1
- package/dist/index.js +230 -212
- package/dist/index.js.map +4 -4
- package/dist/tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -4450,10 +4450,11 @@ function extractPickPropsRecord(node) {
|
|
|
4450
4450
|
}
|
|
4451
4451
|
return result;
|
|
4452
4452
|
}
|
|
4453
|
-
var
|
|
4453
|
+
var docPropsJsxNodes = [
|
|
4454
4454
|
"TypeDocProps",
|
|
4455
4455
|
"TypeDocAttributes",
|
|
4456
|
-
"TypeDocAngularAttributes"
|
|
4456
|
+
"TypeDocAngularAttributes",
|
|
4457
|
+
"TypeDocFunction"
|
|
4457
4458
|
];
|
|
4458
4459
|
var DocPropsIndexer = class {
|
|
4459
4460
|
docPropsEntries = [];
|
|
@@ -4475,7 +4476,7 @@ var DocPropsIndexer = class {
|
|
|
4475
4476
|
getTypeDocPropsNodes = () => {
|
|
4476
4477
|
return (tree, _file, done) => {
|
|
4477
4478
|
visit10(tree, "mdxJsxFlowElement", (node) => {
|
|
4478
|
-
if (node && "name" in node &&
|
|
4479
|
+
if (node && "name" in node && docPropsJsxNodes.includes(node.name)) {
|
|
4479
4480
|
const nameAttr = node.attributes?.find(
|
|
4480
4481
|
(attr) => attr.name === "name"
|
|
4481
4482
|
);
|
|
@@ -4562,12 +4563,18 @@ var DocPropsIndexer = class {
|
|
|
4562
4563
|
}
|
|
4563
4564
|
return props;
|
|
4564
4565
|
};
|
|
4566
|
+
const resolvedType = propTypes.resolvedType;
|
|
4567
|
+
const functionParameters = resolvedType?.type === "signature" && resolvedType.functionParameters?.length ? this.assembleFunctionParams(
|
|
4568
|
+
resolvedType.functionParameters,
|
|
4569
|
+
sections
|
|
4570
|
+
) : void 0;
|
|
4565
4571
|
this.pageDocProps[entry.name] = {
|
|
4566
4572
|
...this.props[entry.name],
|
|
4567
4573
|
input: assembleProps(propTypes.input),
|
|
4568
4574
|
output: assembleProps(propTypes.output),
|
|
4569
4575
|
props: assembleProps(propTypes.props),
|
|
4570
|
-
publicMethods: assembleProps(propTypes.publicMethods)
|
|
4576
|
+
publicMethods: assembleProps(propTypes.publicMethods),
|
|
4577
|
+
resolvedType: functionParameters ? { ...resolvedType, functionParameters } : resolvedType
|
|
4571
4578
|
};
|
|
4572
4579
|
return sections;
|
|
4573
4580
|
}).flat();
|
|
@@ -4581,6 +4588,14 @@ var DocPropsIndexer = class {
|
|
|
4581
4588
|
return acc;
|
|
4582
4589
|
}, {});
|
|
4583
4590
|
}
|
|
4591
|
+
assembleFunctionParams(params, sections) {
|
|
4592
|
+
return params.map((param) => {
|
|
4593
|
+
const id = this.idService.add(param.name);
|
|
4594
|
+
sections.push(this.assembleProp(param, id));
|
|
4595
|
+
const args = param.args?.length ? this.assembleFunctionParams(param.args, sections) : void 0;
|
|
4596
|
+
return { ...param, args, id };
|
|
4597
|
+
});
|
|
4598
|
+
}
|
|
4584
4599
|
assembleProp(prop, id) {
|
|
4585
4600
|
const name = prop.name;
|
|
4586
4601
|
const heading = {
|
|
@@ -5605,7 +5620,8 @@ var SearchIndexer = class {
|
|
|
5605
5620
|
docPropSections = cached?.pageDocPropSections || (this.docPropsIndexer.build(fileContents, toc) ?? []);
|
|
5606
5621
|
docProps = cached?.pageDocProps || this.docPropsIndexer.getDocProps();
|
|
5607
5622
|
}
|
|
5608
|
-
|
|
5623
|
+
const hasDocProps = docPropSections.length || Object.keys(docProps).length;
|
|
5624
|
+
if (hasDocProps) {
|
|
5609
5625
|
this._pageDocProps[defaultSection.pathname] = docProps;
|
|
5610
5626
|
if (this.config.validatePageLinks) {
|
|
5611
5627
|
const ids = /* @__PURE__ */ new Set();
|