@qualcomm-ui/mdx-vite 3.4.0 → 3.6.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 CHANGED
@@ -4858,8 +4858,12 @@ var SectionExtractor = class {
4858
4858
  if (node.type === "code") {
4859
4859
  const codeNode = node;
4860
4860
  if (codeNode.data?.typeDocProps) {
4861
- const { name, props } = codeNode.data.typeDocProps;
4862
- sectionTypes.push({ props, type: name });
4861
+ const { name, props, since } = codeNode.data.typeDocProps;
4862
+ sectionTypes.push({
4863
+ props,
4864
+ since,
4865
+ type: name
4866
+ });
4863
4867
  }
4864
4868
  codeExamples.push({
4865
4869
  code: codeNode.value,
@@ -4960,6 +4964,9 @@ function getRouteMeta(pathSegments, metaJson) {
4960
4964
  // src/docs-plugin/nav-builder/nav-builder.ts
4961
4965
  import { sortBy } from "lodash-es";
4962
4966
  import { v4 as uuidv4 } from "uuid";
4967
+ import {
4968
+ isNavBadge
4969
+ } from "@qualcomm-ui/mdx-common";
4963
4970
  import { capitalCase } from "@qualcomm-ui/utils/change-case";
4964
4971
  import { defined } from "@qualcomm-ui/utils/guard";
4965
4972
  var NavBuilder = class {
@@ -5071,6 +5078,7 @@ var NavBuilder = class {
5071
5078
  this.metaJson
5072
5079
  ) ?? {};
5073
5080
  this.flatNavItems.push({
5081
+ badges: isPage ? this.extractBadges(pageFrontmatter) : void 0,
5074
5082
  depth,
5075
5083
  expanded: routeMeta?.expanded || false,
5076
5084
  group: isPage ? routeMeta.group || pageFrontmatter.group : routeMeta.group,
@@ -5243,6 +5251,13 @@ var NavBuilder = class {
5243
5251
  }
5244
5252
  return results;
5245
5253
  }
5254
+ extractBadges(pageFrontmatter) {
5255
+ const badges = pageFrontmatter.badges;
5256
+ if (badges && typeof badges === "object" && Array.isArray(badges)) {
5257
+ return badges.filter((badge) => isNavBadge(badge) && !badge.hideFromNav);
5258
+ }
5259
+ return void 0;
5260
+ }
5246
5261
  };
5247
5262
 
5248
5263
  // src/docs-plugin/nav-builder/page-map.ts