@qualcomm-ui/mdx-vite 3.3.3 → 3.5.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.
@@ -2,6 +2,7 @@ import { type Plugin } from "unified";
2
2
  import { type PageDocProps, type PageHeading, UniqueIdService } from "@qualcomm-ui/mdx-common";
3
3
  import type { QuiPropTypes } from "@qualcomm-ui/typedoc-common";
4
4
  import { type IndexedSection } from "../markdown";
5
+ export declare const docPropsJsxNodes: string[];
5
6
  interface DocPropEntry {
6
7
  name: string;
7
8
  omitFrom?: string[];
@@ -21,6 +22,7 @@ export declare class DocPropsIndexer {
21
22
  getTypeDocPropsNodes: Plugin;
22
23
  build(fileContents: string, toc: PageHeading[]): IndexedSection[] | null;
23
24
  getDocProps(): PageDocProps;
25
+ private assembleFunctionParams;
24
26
  private assembleProp;
25
27
  }
26
28
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"doc-props-indexer.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/doc-props/doc-props-indexer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,KAAK,MAAM,EAAU,MAAM,SAAS,CAAA;AAG5C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAA4B,KAAK,cAAc,EAAC,MAAM,aAAa,CAAA;AAuD1E,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,qBAAa,eAAe;IAC1B,eAAe,EAAE,YAAY,EAAE,CAAK;IACpC,SAAS,EAAE,eAAe,CAAwB;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IACpD,OAAO,CAAC,YAAY,CAAmB;gBAE3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY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 @@
1
- {"version":3,"file":"doc-props-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,SAAS,CAAA;AAGnC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAA;AAO3D,OAAO,KAAK,EAAC,cAAc,EAAE,QAAQ,EAAW,MAAM,UAAU,CAAA;AAoDhE,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,oBAAoB;IAMnC,YAAY,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAoC9C,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,aAAa;IAoCrB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,GAAG,cAAc,EAAE;IA0BzE,OAAO,CAAC,eAAe;IAiBvB;;;OAGG;IACH,mBAAmB,IAAI,MAAM;CA8F9B"}
1
+ {"version":3,"file":"doc-props-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,SAAS,CAAA;AAGnC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAA;AAQ3D,OAAO,KAAK,EAAC,cAAc,EAAE,QAAQ,EAAW,MAAM,UAAU,CAAA;AAoDhE,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,oBAAoB;IAMnC,YAAY,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAoC9C,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,aAAa;IAoCrB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,GAAG,cAAc,EAAE;IA0BzE,OAAO,CAAC,eAAe;IAiBvB;;;OAGG;IACH,mBAAmB,IAAI,MAAM;CA8F9B"}
@@ -1,4 +1,4 @@
1
- import type { NavItem, PageFrontmatter, PageSection } from "@qualcomm-ui/mdx-common";
1
+ import { type NavItem, type PageFrontmatter, type PageSection } from "@qualcomm-ui/mdx-common";
2
2
  import type { NavMeta, RouteMetaEntryInternal, RouteMetaInternal } from "./types";
3
3
  /**
4
4
  * Given a flat remix route structure, computes nested navigation items for the QUI
@@ -52,5 +52,6 @@ export declare class NavBuilder {
52
52
  * Walks over the tree and builds search metadata using the nearest sectionTitle.
53
53
  */
54
54
  private buildSearchMeta;
55
+ private extractBadges;
55
56
  }
56
57
  //# sourceMappingURL=nav-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nav-builder.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/nav-builder/nav-builder.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAKhC,OAAO,KAAK,EAAC,OAAO,EAAE,sBAAsB,EAAE,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C,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2C;IACxE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;IACrC,WAAW,EAAE,OAAO,CAAA;IAEpB,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAE/D;IACD,OAAO,CAAC,aAAa,CAAmD;IAExE,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,OAAO,CAAC,aAAa,CAAY;IAEjC,IAAI,QAAQ,IAAI,OAAO,EAAE,CAExB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,OAAO,CAAC,QAAQ,CAAc;IAE9B,IAAI,WAAW,IAAI,WAAW,EAAE,CAE/B;IACD,OAAO,CAAC,YAAY,CAAoB;IAExC,KAAK,IAAI,IAAI;gBASX,MAAM,EAAE,oBAAoB,EAC5B,WAAW,UAAO,EAElB,MAAM,GAAE;QACN,eAAe,CAAC,EAAE,eAAe,CAAA;QACjC,aAAa,CAAC,EAAE,aAAa,CAAA;QAC7B,UAAU,CAAC,EAAE,UAAU,CAAA;QACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;KAC/B;IA+BR;;;OAGG;IACH,OAAO,CAAC,YAAY;IAgEpB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAgKtB,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,cAAc;IAqBtB,UAAU,CACR,aAAa,EAAE,MAAM,EAAE,EACvB,WAAW,GAAE,OAAc,GAC1B,eAAe,EAAE;CAsDrB"}
package/dist/index.js CHANGED
@@ -1289,7 +1289,7 @@ function createRemarkProcessor(options = {}) {
1289
1289
  import { minimatch as minimatch2 } from "minimatch";
1290
1290
  import { readdir } from "node:fs/promises";
1291
1291
  import { join as join5, relative } from "node:path";
1292
- import { visit as visit16 } from "unist-util-visit";
1292
+ import { visit as visit17 } from "unist-util-visit";
1293
1293
 
1294
1294
  // src/docs-plugin/nav-builder/get-route-meta.ts
1295
1295
  function getRouteMeta(pathSegments, metaJson) {
@@ -1308,6 +1308,9 @@ function getRouteMeta(pathSegments, metaJson) {
1308
1308
  // src/docs-plugin/nav-builder/nav-builder.ts
1309
1309
  import { sortBy } from "lodash-es";
1310
1310
  import { v4 as uuidv4 } from "uuid";
1311
+ import {
1312
+ isNavBadge
1313
+ } from "@qualcomm-ui/mdx-common";
1311
1314
  import { capitalCase } from "@qualcomm-ui/utils/change-case";
1312
1315
  import { defined } from "@qualcomm-ui/utils/guard";
1313
1316
  var NavBuilder = class {
@@ -1419,6 +1422,7 @@ var NavBuilder = class {
1419
1422
  this.metaJson
1420
1423
  ) ?? {};
1421
1424
  this.flatNavItems.push({
1425
+ badges: isPage ? this.extractBadges(pageFrontmatter) : void 0,
1422
1426
  depth,
1423
1427
  expanded: routeMeta?.expanded || false,
1424
1428
  group: isPage ? routeMeta.group || pageFrontmatter.group : routeMeta.group,
@@ -1591,6 +1595,13 @@ var NavBuilder = class {
1591
1595
  }
1592
1596
  return results;
1593
1597
  }
1598
+ extractBadges(pageFrontmatter) {
1599
+ const badges = pageFrontmatter.badges;
1600
+ if (badges && typeof badges === "object" && Array.isArray(badges)) {
1601
+ return badges.filter((badge) => isNavBadge(badge) && !badge.hideFromNav);
1602
+ }
1603
+ return void 0;
1604
+ }
1594
1605
  };
1595
1606
 
1596
1607
  // src/docs-plugin/nav-builder/page-map.ts
@@ -2012,7 +2023,217 @@ function formatDemos(demosFolder, verbose) {
2012
2023
  // src/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.ts
2013
2024
  import { readFile as readFile3 } from "node:fs/promises";
2014
2025
  import { dirname as dirname2, join as join4, resolve as resolve3 } from "node:path";
2026
+ import { visit as visit12 } from "unist-util-visit";
2027
+
2028
+ // src/docs-plugin/doc-props/doc-props-indexer.ts
2029
+ import remarkMdx2 from "remark-mdx";
2030
+ import remarkParse3 from "remark-parse";
2031
+ import remarkStringify3 from "remark-stringify";
2032
+ import { unified as unified3 } from "unified";
2015
2033
  import { visit as visit11 } from "unist-util-visit";
2034
+ import {
2035
+ UniqueIdService
2036
+ } from "@qualcomm-ui/mdx-common";
2037
+ function extractPickPropsRecord(node) {
2038
+ if (node.name !== "unionWithPick" || !node.value || typeof node.value === "string") {
2039
+ return null;
2040
+ }
2041
+ const estree = node.value.data?.estree;
2042
+ if (!estree?.body?.[0] || estree.body[0].type !== "ExpressionStatement") {
2043
+ return null;
2044
+ }
2045
+ const expression = estree.body[0].expression;
2046
+ if (expression.type !== "ObjectExpression") {
2047
+ return null;
2048
+ }
2049
+ const result = {};
2050
+ for (const property of expression.properties) {
2051
+ if (property.type !== "Property" || property.key.type !== "Identifier") {
2052
+ continue;
2053
+ }
2054
+ if (property.value.type !== "ArrayExpression") {
2055
+ continue;
2056
+ }
2057
+ const key = property.key.name;
2058
+ const values = [];
2059
+ for (const element of property.value.elements) {
2060
+ if (element?.type === "Literal" && typeof element.value === "string") {
2061
+ values.push(element.value);
2062
+ }
2063
+ }
2064
+ result[key] = values;
2065
+ }
2066
+ return result;
2067
+ }
2068
+ var docPropsJsxNodes = [
2069
+ "TypeDocProps",
2070
+ "TypeDocAttributes",
2071
+ "TypeDocAngularAttributes",
2072
+ "TypeDocFunction"
2073
+ ];
2074
+ var DocPropsIndexer = class {
2075
+ docPropsEntries = [];
2076
+ idService = new UniqueIdService();
2077
+ props;
2078
+ pageDocProps = {};
2079
+ constructor(props) {
2080
+ this.props = props;
2081
+ }
2082
+ reset() {
2083
+ this.idService.reset();
2084
+ this.docPropsEntries = [];
2085
+ }
2086
+ /**
2087
+ * Finds all JSX `<TypeDocProps />` nodes on the current page and adds their names
2088
+ * to an array. Once all nodes have been collected, we process them into
2089
+ * `PageSection` entries for the search index.
2090
+ */
2091
+ getTypeDocPropsNodes = () => {
2092
+ return (tree, _file, done) => {
2093
+ visit11(tree, "mdxJsxFlowElement", (node) => {
2094
+ if (node && "name" in node && docPropsJsxNodes.includes(node.name)) {
2095
+ const nameAttr = node.attributes?.find(
2096
+ (attr) => attr.name === "name"
2097
+ );
2098
+ const omitFromAttr = node.attributes?.find(
2099
+ (attr) => attr.name === "omitFrom"
2100
+ );
2101
+ const omitFrom = omitFromAttr ? extractNamesFromAttribute(omitFromAttr) : void 0;
2102
+ if (nameAttr) {
2103
+ const names = extractNamesFromAttribute(nameAttr);
2104
+ for (const name of names) {
2105
+ this.docPropsEntries.push({ name, omitFrom });
2106
+ if (name.endsWith("Props")) {
2107
+ this.docPropsEntries.push({ name: name.slice(0, -5), omitFrom });
2108
+ }
2109
+ }
2110
+ }
2111
+ const unionWithPickAttr = node.attributes?.find(
2112
+ (attr) => attr.name === "unionWithPick"
2113
+ );
2114
+ if (unionWithPickAttr) {
2115
+ try {
2116
+ const unionWithPick = extractPickPropsRecord(unionWithPickAttr);
2117
+ if (unionWithPick) {
2118
+ this.docPropsEntries.push(
2119
+ ...Object.keys(unionWithPick).map((entry) => ({
2120
+ name: entry,
2121
+ omitFrom
2122
+ }))
2123
+ );
2124
+ }
2125
+ } catch (e) {
2126
+ }
2127
+ }
2128
+ }
2129
+ });
2130
+ done();
2131
+ };
2132
+ };
2133
+ build(fileContents, toc) {
2134
+ unified3().use(remarkMdx2).use(this.getTypeDocPropsNodes).use(remarkParse3).use(remarkStringify3).processSync(fileContents);
2135
+ if (!this.docPropsEntries.length) {
2136
+ return null;
2137
+ }
2138
+ for (const item of toc) {
2139
+ this.idService.add(item.id);
2140
+ }
2141
+ return this.docPropsEntries.map((entry) => {
2142
+ const propTypes = this.props[entry.name];
2143
+ if (!propTypes) {
2144
+ return [];
2145
+ }
2146
+ const omittedProps = new Set(
2147
+ (entry.omitFrom ?? []).map((entry2) => {
2148
+ const propTypes2 = this.props[entry2];
2149
+ if (!propTypes2) {
2150
+ return [];
2151
+ }
2152
+ return [
2153
+ propTypes2.props,
2154
+ propTypes2.input,
2155
+ propTypes2.output,
2156
+ propTypes2.publicMethods
2157
+ ].reduce((acc, current) => {
2158
+ if (current) {
2159
+ acc.push(...current.map((prop) => prop.name));
2160
+ }
2161
+ return acc;
2162
+ }, []);
2163
+ }).flat(1).filter(Boolean)
2164
+ );
2165
+ const sections = [];
2166
+ const assembleProps = (propsInput) => {
2167
+ if (!propsInput) {
2168
+ return void 0;
2169
+ }
2170
+ const props = [];
2171
+ for (const prop of propsInput) {
2172
+ if (omittedProps.has(prop.name)) {
2173
+ continue;
2174
+ }
2175
+ const id = this.idService.add(prop.name);
2176
+ props.push({ ...prop, id });
2177
+ sections.push(this.assembleProp(prop, id));
2178
+ }
2179
+ return props;
2180
+ };
2181
+ const resolvedType = propTypes.resolvedType;
2182
+ const functionParameters = resolvedType?.type === "signature" && resolvedType.functionParameters?.length ? this.assembleFunctionParams(
2183
+ resolvedType.functionParameters,
2184
+ sections
2185
+ ) : void 0;
2186
+ this.pageDocProps[entry.name] = {
2187
+ ...this.props[entry.name],
2188
+ input: assembleProps(propTypes.input),
2189
+ output: assembleProps(propTypes.output),
2190
+ props: assembleProps(propTypes.props),
2191
+ publicMethods: assembleProps(propTypes.publicMethods),
2192
+ resolvedType: functionParameters ? { ...resolvedType, functionParameters } : resolvedType
2193
+ };
2194
+ return sections;
2195
+ }).flat();
2196
+ }
2197
+ getDocProps() {
2198
+ return this.docPropsEntries.reduce((acc, entry) => {
2199
+ const propTypes = this.pageDocProps[entry.name];
2200
+ if (propTypes) {
2201
+ acc[entry.name] = propTypes;
2202
+ }
2203
+ return acc;
2204
+ }, {});
2205
+ }
2206
+ assembleFunctionParams(params, sections) {
2207
+ return params.map((param) => {
2208
+ const id = this.idService.add(param.name);
2209
+ sections.push(this.assembleProp(param, id));
2210
+ const args = param.args?.length ? this.assembleFunctionParams(param.args, sections) : void 0;
2211
+ return { ...param, args, id };
2212
+ });
2213
+ }
2214
+ assembleProp(prop, id) {
2215
+ const name = prop.name;
2216
+ const heading2 = {
2217
+ headingLevel: 4,
2218
+ id,
2219
+ tagName: "a",
2220
+ textContent: name
2221
+ };
2222
+ const comment = prop.comment;
2223
+ if (!comment) {
2224
+ return { content: [], heading: heading2 };
2225
+ }
2226
+ const content = {
2227
+ tagName: "p",
2228
+ text: [
2229
+ comment.summary.map((entry) => entry.text.replaceAll("\n", " ")).join("")
2230
+ ]
2231
+ };
2232
+ return { content: [content], heading: heading2 };
2233
+ }
2234
+ };
2235
+
2236
+ // src/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.ts
2016
2237
  function extractBestType(propInfo) {
2017
2238
  const type = propInfo.resolvedType?.prettyType || propInfo.type;
2018
2239
  return cleanType(type.startsWith("| ") ? type.substring(2) : type);
@@ -2184,11 +2405,11 @@ ${tagContent.trim()}
2184
2405
  */
2185
2406
  propsToMarkdownList() {
2186
2407
  return () => (tree, _file, done) => {
2187
- visit11(
2408
+ visit12(
2188
2409
  tree,
2189
2410
  "mdxJsxFlowElement",
2190
2411
  (node, index, parent) => {
2191
- if (node?.name !== "TypeDocProps") {
2412
+ if (!node.name || !docPropsJsxNodes.includes(node.name)) {
2192
2413
  return;
2193
2414
  }
2194
2415
  const nameAttr = node.attributes?.find(
@@ -2269,10 +2490,10 @@ ${propsToDefinitionList(outputs)}`);
2269
2490
  };
2270
2491
 
2271
2492
  // src/docs-plugin/markdown/knowledge/plugins/filter-text-directives.ts
2272
- import { visit as visit12 } from "unist-util-visit";
2493
+ import { visit as visit13 } from "unist-util-visit";
2273
2494
  var filterTextDirectives = () => {
2274
2495
  return (tree, _file, done) => {
2275
- visit12(tree, "text", (node) => {
2496
+ visit13(tree, "text", (node) => {
2276
2497
  const value = node.value?.trim?.();
2277
2498
  if (value && (isStepBlock(value) || isSpoilerBlock(value))) {
2278
2499
  Object.assign(node, {
@@ -2285,10 +2506,10 @@ var filterTextDirectives = () => {
2285
2506
  };
2286
2507
 
2287
2508
  // src/docs-plugin/markdown/knowledge/plugins/npm-install-tabs-plugin.ts
2288
- import { visit as visit13 } from "unist-util-visit";
2509
+ import { visit as visit14 } from "unist-util-visit";
2289
2510
  var formatNpmInstallTabs = () => {
2290
2511
  return (tree, _file, done) => {
2291
- visit13(
2512
+ visit14(
2292
2513
  tree,
2293
2514
  "mdxJsxFlowElement",
2294
2515
  (node, index, parent) => {
@@ -2317,7 +2538,7 @@ var formatNpmInstallTabs = () => {
2317
2538
  };
2318
2539
 
2319
2540
  // src/docs-plugin/markdown/knowledge/plugins/qds-theme-plugin.ts
2320
- import { visit as visit14 } from "unist-util-visit";
2541
+ import { visit as visit15 } from "unist-util-visit";
2321
2542
  function themeDataToJson(data, cssPropertyName) {
2322
2543
  if (!data || typeof data !== "object") {
2323
2544
  return "";
@@ -2376,7 +2597,7 @@ async function formatThemeNodes() {
2376
2597
  }
2377
2598
  };
2378
2599
  return () => (tree, _file, done) => {
2379
- visit14(tree, "mdxJsxFlowElement", (node) => {
2600
+ visit15(tree, "mdxJsxFlowElement", (node) => {
2380
2601
  const handler = node.name && handlers[node.name];
2381
2602
  if (!handler) {
2382
2603
  return;
@@ -2410,14 +2631,14 @@ async function formatThemeNodes() {
2410
2631
  // src/docs-plugin/markdown/knowledge/section-extractor.ts
2411
2632
  import { toString as toString2 } from "mdast-util-to-string";
2412
2633
  import remarkGfm2 from "remark-gfm";
2413
- import remarkStringify3 from "remark-stringify";
2414
- import { unified as unified3 } from "unified";
2415
- import { visit as visit15 } from "unist-util-visit";
2634
+ import remarkStringify4 from "remark-stringify";
2635
+ import { unified as unified4 } from "unified";
2636
+ import { visit as visit16 } from "unist-util-visit";
2416
2637
  function transformLinks() {
2417
2638
  return () => (tree) => {
2418
- visit15(tree, "link", (node) => {
2639
+ visit16(tree, "link", (node) => {
2419
2640
  let text = "";
2420
- visit15(node, "text", (textNode) => {
2641
+ visit16(node, "text", (textNode) => {
2421
2642
  text += textNode.value;
2422
2643
  });
2423
2644
  Object.assign(node, {
@@ -2429,8 +2650,8 @@ function transformLinks() {
2429
2650
  });
2430
2651
  };
2431
2652
  }
2432
- var rawProcessor = unified3().use(remarkGfm2).use(remarkStringify3);
2433
- var contentProcessor = unified3().use(remarkGfm2).use(transformLinks()).use(remarkStringify3);
2653
+ var rawProcessor = unified4().use(remarkGfm2).use(remarkStringify4);
2654
+ var contentProcessor = unified4().use(remarkGfm2).use(transformLinks()).use(remarkStringify4);
2434
2655
  var SectionExtractor = class {
2435
2656
  depths;
2436
2657
  minContentLength;
@@ -2827,7 +3048,7 @@ ${pageEntry.content}`;
2827
3048
  }
2828
3049
  formatFrontmatterExpressions(frontmatter) {
2829
3050
  return () => (tree) => {
2830
- visit16(
3051
+ visit17(
2831
3052
  tree,
2832
3053
  "mdxFlowExpression",
2833
3054
  (node, index, parent) => {
@@ -2866,7 +3087,7 @@ ${pageEntry.content}`;
2866
3087
  if (!baseUrl) {
2867
3088
  return;
2868
3089
  }
2869
- visit16(tree, "link", (node) => {
3090
+ visit17(tree, "link", (node) => {
2870
3091
  if (node.url.startsWith("/")) {
2871
3092
  node.url = `${baseUrl}${node.url}`;
2872
3093
  }
@@ -2969,199 +3190,6 @@ ${pageEntry.content}`;
2969
3190
  import chalk3 from "chalk";
2970
3191
  import { defined as defined2 } from "@qualcomm-ui/utils/guard";
2971
3192
 
2972
- // src/docs-plugin/doc-props/doc-props-indexer.ts
2973
- import remarkMdx2 from "remark-mdx";
2974
- import remarkParse3 from "remark-parse";
2975
- import remarkStringify4 from "remark-stringify";
2976
- import { unified as unified4 } from "unified";
2977
- import { visit as visit17 } from "unist-util-visit";
2978
- import {
2979
- UniqueIdService
2980
- } from "@qualcomm-ui/mdx-common";
2981
- function extractPickPropsRecord(node) {
2982
- if (node.name !== "unionWithPick" || !node.value || typeof node.value === "string") {
2983
- return null;
2984
- }
2985
- const estree = node.value.data?.estree;
2986
- if (!estree?.body?.[0] || estree.body[0].type !== "ExpressionStatement") {
2987
- return null;
2988
- }
2989
- const expression = estree.body[0].expression;
2990
- if (expression.type !== "ObjectExpression") {
2991
- return null;
2992
- }
2993
- const result = {};
2994
- for (const property of expression.properties) {
2995
- if (property.type !== "Property" || property.key.type !== "Identifier") {
2996
- continue;
2997
- }
2998
- if (property.value.type !== "ArrayExpression") {
2999
- continue;
3000
- }
3001
- const key = property.key.name;
3002
- const values = [];
3003
- for (const element of property.value.elements) {
3004
- if (element?.type === "Literal" && typeof element.value === "string") {
3005
- values.push(element.value);
3006
- }
3007
- }
3008
- result[key] = values;
3009
- }
3010
- return result;
3011
- }
3012
- var targetMdxElements = [
3013
- "TypeDocProps",
3014
- "TypeDocAttributes",
3015
- "TypeDocAngularAttributes"
3016
- ];
3017
- var DocPropsIndexer = class {
3018
- docPropsEntries = [];
3019
- idService = new UniqueIdService();
3020
- props;
3021
- pageDocProps = {};
3022
- constructor(props) {
3023
- this.props = props;
3024
- }
3025
- reset() {
3026
- this.idService.reset();
3027
- this.docPropsEntries = [];
3028
- }
3029
- /**
3030
- * Finds all JSX `<TypeDocProps />` nodes on the current page and adds their names
3031
- * to an array. Once all nodes have been collected, we process them into
3032
- * `PageSection` entries for the search index.
3033
- */
3034
- getTypeDocPropsNodes = () => {
3035
- return (tree, _file, done) => {
3036
- visit17(tree, "mdxJsxFlowElement", (node) => {
3037
- if (node && "name" in node && targetMdxElements.includes(node.name)) {
3038
- const nameAttr = node.attributes?.find(
3039
- (attr) => attr.name === "name"
3040
- );
3041
- const omitFromAttr = node.attributes?.find(
3042
- (attr) => attr.name === "omitFrom"
3043
- );
3044
- const omitFrom = omitFromAttr ? extractNamesFromAttribute(omitFromAttr) : void 0;
3045
- if (nameAttr) {
3046
- const names = extractNamesFromAttribute(nameAttr);
3047
- for (const name of names) {
3048
- this.docPropsEntries.push({ name, omitFrom });
3049
- if (name.endsWith("Props")) {
3050
- this.docPropsEntries.push({ name: name.slice(0, -5), omitFrom });
3051
- }
3052
- }
3053
- }
3054
- const unionWithPickAttr = node.attributes?.find(
3055
- (attr) => attr.name === "unionWithPick"
3056
- );
3057
- if (unionWithPickAttr) {
3058
- try {
3059
- const unionWithPick = extractPickPropsRecord(unionWithPickAttr);
3060
- if (unionWithPick) {
3061
- this.docPropsEntries.push(
3062
- ...Object.keys(unionWithPick).map((entry) => ({
3063
- name: entry,
3064
- omitFrom
3065
- }))
3066
- );
3067
- }
3068
- } catch (e) {
3069
- }
3070
- }
3071
- }
3072
- });
3073
- done();
3074
- };
3075
- };
3076
- build(fileContents, toc) {
3077
- unified4().use(remarkMdx2).use(this.getTypeDocPropsNodes).use(remarkParse3).use(remarkStringify4).processSync(fileContents);
3078
- if (!this.docPropsEntries.length) {
3079
- return null;
3080
- }
3081
- for (const item of toc) {
3082
- this.idService.add(item.id);
3083
- }
3084
- return this.docPropsEntries.map((entry) => {
3085
- const propTypes = this.props[entry.name];
3086
- if (!propTypes) {
3087
- return [];
3088
- }
3089
- const omittedProps = new Set(
3090
- (entry.omitFrom ?? []).map((entry2) => {
3091
- const propTypes2 = this.props[entry2];
3092
- if (!propTypes2) {
3093
- return [];
3094
- }
3095
- return [
3096
- propTypes2.props,
3097
- propTypes2.input,
3098
- propTypes2.output,
3099
- propTypes2.publicMethods
3100
- ].reduce((acc, current) => {
3101
- if (current) {
3102
- acc.push(...current.map((prop) => prop.name));
3103
- }
3104
- return acc;
3105
- }, []);
3106
- }).flat(1).filter(Boolean)
3107
- );
3108
- const sections = [];
3109
- const assembleProps = (propsInput) => {
3110
- if (!propsInput) {
3111
- return void 0;
3112
- }
3113
- const props = [];
3114
- for (const prop of propsInput) {
3115
- if (omittedProps.has(prop.name)) {
3116
- continue;
3117
- }
3118
- const id = this.idService.add(prop.name);
3119
- props.push({ ...prop, id });
3120
- sections.push(this.assembleProp(prop, id));
3121
- }
3122
- return props;
3123
- };
3124
- this.pageDocProps[entry.name] = {
3125
- ...this.props[entry.name],
3126
- input: assembleProps(propTypes.input),
3127
- output: assembleProps(propTypes.output),
3128
- props: assembleProps(propTypes.props),
3129
- publicMethods: assembleProps(propTypes.publicMethods)
3130
- };
3131
- return sections;
3132
- }).flat();
3133
- }
3134
- getDocProps() {
3135
- return this.docPropsEntries.reduce((acc, entry) => {
3136
- const propTypes = this.pageDocProps[entry.name];
3137
- if (propTypes) {
3138
- acc[entry.name] = propTypes;
3139
- }
3140
- return acc;
3141
- }, {});
3142
- }
3143
- assembleProp(prop, id) {
3144
- const name = prop.name;
3145
- const heading2 = {
3146
- headingLevel: 4,
3147
- id,
3148
- tagName: "a",
3149
- textContent: name
3150
- };
3151
- const comment = prop.comment;
3152
- if (!comment) {
3153
- return { content: [], heading: heading2 };
3154
- }
3155
- const content = {
3156
- tagName: "p",
3157
- text: [
3158
- comment.summary.map((entry) => entry.text.replaceAll("\n", " ")).join("")
3159
- ]
3160
- };
3161
- return { content: [content], heading: heading2 };
3162
- }
3163
- };
3164
-
3165
3193
  // src/docs-plugin/link-validator.ts
3166
3194
  import chalk2 from "chalk";
3167
3195
  import { posix } from "node:path";
@@ -3444,7 +3472,8 @@ var SearchIndexer = class {
3444
3472
  docPropSections = cached?.pageDocPropSections || (this.docPropsIndexer.build(fileContents, toc) ?? []);
3445
3473
  docProps = cached?.pageDocProps || this.docPropsIndexer.getDocProps();
3446
3474
  }
3447
- if (docPropSections.length) {
3475
+ const hasDocProps = docPropSections.length || Object.keys(docProps).length;
3476
+ if (hasDocProps) {
3448
3477
  this._pageDocProps[defaultSection.pathname] = docProps;
3449
3478
  if (this.config.validatePageLinks) {
3450
3479
  const ids = /* @__PURE__ */ new Set();