@qualcomm-ui/mdx-vite 3.8.3 → 3.8.4
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/angular-demo-plugin/index.d.ts +1 -1
- package/dist/angular-demo-plugin/index.d.ts.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/docs-plugin/config/config-loader.d.ts +1 -1
- package/dist/docs-plugin/config/config-loader.d.ts.map +1 -1
- package/dist/docs-plugin/config/config-schema.d.ts +4 -48
- package/dist/docs-plugin/config/config-schema.d.ts.map +1 -1
- package/dist/docs-plugin/config/index.d.ts +2 -3
- package/dist/docs-plugin/config/index.d.ts.map +1 -1
- package/dist/docs-plugin/config/types.d.ts +1 -1
- package/dist/docs-plugin/config/types.d.ts.map +1 -1
- package/dist/docs-plugin/config/zod.d.ts +2 -6
- package/dist/docs-plugin/config/zod.d.ts.map +1 -1
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts +1 -1
- package/dist/docs-plugin/doc-props/doc-props-indexer.d.ts.map +1 -1
- package/dist/docs-plugin/doc-props/index.d.ts +1 -1
- package/dist/docs-plugin/doc-props/index.d.ts.map +1 -1
- package/dist/docs-plugin/docs-plugin.d.ts +1 -1
- package/dist/docs-plugin/docs-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/generate-page-map.d.ts.map +1 -1
- package/dist/docs-plugin/index.d.ts +7 -7
- package/dist/docs-plugin/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/frontmatter-schema.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/index.d.ts +5 -5
- package/dist/docs-plugin/markdown/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/filter-frontmatter.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/filter-frontmatter.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/index.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts +3 -3
- package/dist/docs-plugin/markdown/knowledge/knowledge-exporter.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/doc-props-plugin.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/filter-text-directives.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/plugins/index.d.ts +5 -5
- package/dist/docs-plugin/markdown/knowledge/plugins/index.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/knowledge/utils.d.ts +1 -1
- package/dist/docs-plugin/markdown/knowledge/utils.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/markdown-file-reader.d.ts +3 -3
- package/dist/docs-plugin/markdown/markdown-file-reader.d.ts.map +1 -1
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts +3 -2
- package/dist/docs-plugin/markdown/remark-pipeline.d.ts.map +1 -1
- package/dist/docs-plugin/mdx-plugins.d.ts +1 -1
- package/dist/docs-plugin/mdx-plugins.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/get-route-meta.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/get-route-meta.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/index.d.ts +5 -5
- package/dist/docs-plugin/nav-builder/index.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/nav-builder.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/nav-builder.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/page-map.d.ts +2 -2
- package/dist/docs-plugin/nav-builder/page-map.d.ts.map +1 -1
- package/dist/docs-plugin/nav-builder/transform-route-meta-array.d.ts +1 -1
- package/dist/docs-plugin/nav-builder/transform-route-meta-array.d.ts.map +1 -1
- package/dist/docs-plugin/plugin-state.d.ts +4 -4
- package/dist/docs-plugin/plugin-state.d.ts.map +1 -1
- package/dist/docs-plugin/rehype/index.d.ts +2 -2
- package/dist/docs-plugin/rehype/index.d.ts.map +1 -1
- package/dist/docs-plugin/remark/index.d.ts +12 -12
- package/dist/docs-plugin/remark/index.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-alerts.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-serialize-jsx.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-spoilers.d.ts.map +1 -1
- package/dist/docs-plugin/remark/remark-steps.d.ts.map +1 -1
- package/dist/docs-plugin/search-indexer.d.ts +5 -5
- package/dist/docs-plugin/search-indexer.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/index.d.ts +4 -4
- package/dist/docs-plugin/shiki/index.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/internal/index.d.ts +1 -1
- package/dist/docs-plugin/shiki/internal/index.d.ts.map +1 -1
- package/dist/docs-plugin/shiki/utils.d.ts.map +1 -1
- package/dist/exports.d.ts +1 -1
- package/dist/exports.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -27
- package/dist/index.js.map +1 -1
- package/dist/open-web-ui/common.d.ts +1 -1
- package/dist/open-web-ui/common.d.ts.map +1 -1
- package/dist/open-web-ui/download-knowledge.d.ts.map +1 -1
- package/dist/open-web-ui/env.d.ts.map +1 -1
- package/dist/open-web-ui/upload-knowledge.d.ts.map +1 -1
- package/dist/react-demo-plugin/demo-plugin-utils.d.ts.map +1 -1
- package/dist/react-demo-plugin/index.d.ts +4 -4
- package/dist/react-demo-plugin/index.d.ts.map +1 -1
- package/dist/react-demo-plugin/react-demo-plugin.d.ts +1 -1
- package/dist/react-demo-plugin/react-demo-plugin.d.ts.map +1 -1
- package/dist/search-indexer-BJpNrIum.js +14 -0
- package/dist/search-indexer-BJpNrIum.js.map +1 -0
- package/package.json +10 -10
- package/dist/open-web-ui/knowledge-cleaner.d.ts +0 -14
- package/dist/open-web-ui/knowledge-cleaner.d.ts.map +0 -1
- package/dist/search-indexer-Chr-z_vN.js +0 -14
- package/dist/search-indexer-Chr-z_vN.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remark-steps.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/remark/remark-steps.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,IAAI,EAAC,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,SAAS,CAAA;AAyCnC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"remark-steps.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/remark/remark-steps.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,IAAI,EAAC,MAAM,OAAO,CAAA;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,SAAS,CAAA;AAyCnC,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CA+DxC,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { NavItem, PageMap, PageSection } from "@qualcomm-ui/mdx-common";
|
|
2
2
|
import type { QuiPropTypes } from "@qualcomm-ui/typedoc-common";
|
|
3
|
-
import type { SearchIndexerOptions } from "./config";
|
|
4
|
-
import { DocPropsIndexer } from "./doc-props";
|
|
5
|
-
import { type CompiledMdxFile, MdxFileReader } from "./markdown";
|
|
6
|
-
import { SectionExtractor } from "./markdown/knowledge/section-extractor";
|
|
7
|
-
import { NavBuilder } from "./nav-builder";
|
|
3
|
+
import type { SearchIndexerOptions } from "./config/index.js";
|
|
4
|
+
import { DocPropsIndexer } from "./doc-props/index.js";
|
|
5
|
+
import { type CompiledMdxFile, MdxFileReader } from "./markdown/index.js";
|
|
6
|
+
import { SectionExtractor } from "./markdown/knowledge/section-extractor.js";
|
|
7
|
+
import { NavBuilder } from "./nav-builder/index.js";
|
|
8
8
|
export declare class SearchIndexer {
|
|
9
9
|
private readonly docPropsIndexer;
|
|
10
10
|
private readonly sectionExtractor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-indexer.d.ts","sourceRoot":"","sources":["../../src/docs-plugin/search-indexer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,OAAO,EAEP,OAAO,EACP,WAAW,EAEZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAA;AAG7D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"search-indexer.d.ts","sourceRoot":"","sources":["../../src/docs-plugin/search-indexer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,OAAO,EAEP,OAAO,EACP,WAAW,EAEZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAA;AAG7D,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AAQpD,OAAO,EAEL,KAAK,eAAe,EAKpB,aAAa,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,gBAAgB,EACjB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAML,UAAU,EAEX,MAAM,wBAAwB,CAAA;AAQ/B,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkB;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAa;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,UAAU,CAAkC;IACpD,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;gBAUX,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;IA+KtB,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;CAuDrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./shiki-transformer-code-attribute";
|
|
2
|
-
export * from "./shiki-transformer-hidden";
|
|
3
|
-
export * from "./shiki-transformer-preview-block";
|
|
4
|
-
export * from "./utils";
|
|
1
|
+
export * from "./shiki-transformer-code-attribute.js";
|
|
2
|
+
export * from "./shiki-transformer-hidden.js";
|
|
3
|
+
export * from "./shiki-transformer-preview-block.js";
|
|
4
|
+
export * from "./utils.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/shiki/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/shiki/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,YAAY,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./shiki-transformer-tailwind";
|
|
1
|
+
export * from "./shiki-transformer-tailwind.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/docs-plugin/shiki/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/docs-plugin/shiki/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/shiki/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/docs-plugin/shiki/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA2D1D;AAED,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI,CAuDf"}
|
package/dist/exports.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import rehypeMdxCodeProps from "rehype-mdx-code-props";
|
|
|
2
2
|
import remarkFrontmatter from "remark-frontmatter";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
4
|
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
|
|
5
|
-
import { rehypeSlug } from "./docs-plugin/rehype/rehype-slug";
|
|
5
|
+
import { rehypeSlug } from "./docs-plugin/rehype/rehype-slug.js";
|
|
6
6
|
export { remarkFrontmatter, remarkGfm, remarkMdxFrontmatter, rehypeMdxCodeProps, rehypeSlug, };
|
|
7
7
|
//# sourceMappingURL=exports.d.ts.map
|
package/dist/exports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,MAAM,uBAAuB,CAAA;AACtD,OAAO,iBAAiB,MAAM,oBAAoB,CAAA;AAClD,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAC,UAAU,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,MAAM,uBAAuB,CAAA;AACtD,OAAO,iBAAiB,MAAM,oBAAoB,CAAA;AAClD,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AAEzD,OAAO,EAAC,UAAU,EAAC,MAAM,qCAAqC,CAAA;AAK9D,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,UAAU,GACX,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./angular-demo-plugin";
|
|
2
|
-
export * from "./docs-plugin";
|
|
3
|
-
export * from "./exports";
|
|
4
|
-
export * from "./react-demo-plugin";
|
|
1
|
+
export * from "./angular-demo-plugin/index.js";
|
|
2
|
+
export * from "./docs-plugin/index.js";
|
|
3
|
+
export * from "./exports.js";
|
|
4
|
+
export * from "./react-demo-plugin/index.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,8BAA8B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,
|
|
2
|
-
`)}var
|
|
1
|
+
import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,i as ee,j as te,k as _,l as v,m as y,n as b,o as x,p as ne,r as re,s as ie,t as ae,u as oe,v as S,w as se,x as ce,y as le}from"./search-indexer-BJpNrIum.js";import{basename as C,dirname as w,extname as ue,join as T,relative as de,resolve as E,sep as fe}from"node:path";import{existsSync as D,readFileSync as pe,statSync as me}from"node:fs";import{glob as he}from"glob";import{mkdir as ge,readFile as O,readdir as _e,writeFile as ve}from"node:fs/promises";import k from"chalk";import{visit as A}from"unist-util-visit";import{quiCustomDarkTheme as ye}from"@qualcomm-ui/mdx-common";import be from"remark-frontmatter";import xe from"remark-gfm";import*as j from"typescript";import{merge as Se}from"lodash-es";import{camelCase as Ce,kebabCase as we,pascalCase as Te}from"@qualcomm-ui/utils/change-case";import Ee,{watch as De}from"chokidar";import{createHighlighter as Oe}from"shiki";import{dedent as M}from"@qualcomm-ui/utils/dedent";import ke from"pretty-ms";import{minimatch as Ae}from"minimatch";import je from"@shikijs/rehype";import{transformerNotationDiff as Me,transformerNotationErrorLevel as Ne,transformerNotationFocus as Pe,transformerNotationHighlight as Fe,transformerNotationWordHighlight as Ie,transformerRemoveNotationEscape as Le,transformerRenderIndentGuides as Re}from"@shikijs/transformers";import ze from"rehype-mdx-code-props";import Be from"remark-mdx-frontmatter";import{headingRank as Ve}from"hast-util-heading-rank";import{toString as He}from"hast-util-to-string";import{heading as Ue}from"hast-util-heading";import"hast-util-from-html";import"hast-util-to-html";import We from"postcss";import Ge from"postcss-selector-parser";import{compile as Ke}from"tailwindcss";function qe(e,t){if(!t?.include?.length)return e;let n=t.include,r=t.exclude??[],i={};for(let[t,a]of Object.entries(e)){if(a===void 0)continue;let e=n.some(e=>Ae(t,e)),o=r.some(e=>Ae(t,e));e&&!o&&(i[t]=a)}return i}async function Je(e,t,n=new Set,r){let i=[],a=ie(e);for(let e of a){let a=await v(e,t);if(!(!a||n.has(a))){n.add(a);try{let e=await O(a,`utf-8`);i.push({content:e,path:a});let t=await Je(e,a,n,r);i.push(...t)}catch{r&&console.log(` Could not read import: ${a}`)}}}return i}function Ye(e,t){return()=>async n=>{let r=[];A(n,`mdxJsxFlowElement`,(n,i,a)=>{if(!n?.name||![`QdsDemo`,`CodeDemo`,`Demo`].includes(n.name))return;let o=n.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===`name`),s=n.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===`node`),c;if(o&&typeof o.value==`string`)c=o.value;else if(s?.value&&typeof s.value!=`string`){let e=s.value.data?.estree;if(e?.body?.[0]?.type===`ExpressionStatement`){let t=e.body[0].expression;t.type===`MemberExpression`&&t.object.type===`Identifier`&&t.object.name===`Demo`&&t.property.type===`Identifier`&&(c=t.property.name)}}if(!c){a&&i!==void 0&&a.children.splice(i,1);return}r.push((async()=>{let r=we(c),o=`${r}.tsx`;if(!e){t&&console.log(` No demos folder for ${c}`),a&&i!==void 0&&a.children.splice(i,1);return}let s=T(e,o),l=!1;if(!await x(s))if(s=T(e,`${r}.ts`),await x(s))l=!0,o=`${we(c).replace(`-component`,`.component`)}.ts`,s=T(e,o);else{console.log(` Demo not found ${c}`),a&&i!==void 0&&a.children.splice(i,1);return}try{let e=await O(s,`utf-8`),r=f(e);t&&console.log(` Replaced demo ${c} with source code`);let o={lang:l?`angular-ts`:`tsx`,meta:null,type:`code`,value:r},u=await Je(e,s,new Set,t);if(u.length===0||!a||i===void 0)Object.assign(n,o);else{let e=[o];for(let t of u){let n=ue(t.path).slice(1),r=C(t.path);e.push({lang:n,meta:`title="${r}"`,type:`code`,value:t.content})}a.children.splice(i,1,...e),t&&console.log(` Added ${u.length} imported file(s) after demo`)}}catch(e){t&&console.log(`Error reading demo ${c}`,e),a&&i!==void 0&&a.children.splice(i,1)}})())}),await Promise.all(r)}}function Xe(e){let t=e.resolvedType?.prettyType||e.type;return Qe(t.startsWith(`| `)?t.substring(2):t)}function Ze(e,t){return!!(e.resolvedType?.required&&!t)}function Qe(e){return e.replace(/\n/g,` `).replace(/\s+/g,` `).trim()}function $e(e){return e.replace(/^\n+/,``).replace(/\n+$/,``).trim()}function et(e){return e.replace(/\n/g,` `)}function tt(e){return e.length===0?``:e.map(e=>{let t=[`- **${e.name}** (\`${et(e.type)}\``];return e.defaultValue&&t.push(`, default: \`${et(e.defaultValue)}\``),e.required&&t.push(`, required`),t.push(`)`),e.description&&t.push(` - ${et(e.description)}`),t.join(``)}).join(`
|
|
2
|
+
`)}var nt=class{docProps=null;docPropsPath;routeDir;verbose;constructor(e){this.docPropsPath=e.docPropsPath,this.routeDir=e.routeDir,this.verbose=e.verbose??!1}async loadDocProps(){if(this.docProps)return this.docProps;let e=this.docPropsPath?await x(this.docPropsPath)?this.docPropsPath:E(process.cwd(),this.docPropsPath):T(w(this.routeDir),`doc-props.json`);if(!await x(e))return this.verbose&&console.log(`Doc props file not found at: ${e}`),null;try{let t=await O(e,`utf-8`),n=JSON.parse(t);return this.verbose&&(console.log(`Loaded doc props from: ${e}`),console.log(`Found ${Object.keys(n.props).length} component types`)),this.docProps=n,n}catch(e){return this.verbose&&console.log(`Error loading doc props`,e),null}}formatCommentParts(e){return e.map(e=>{switch(e.kind){case`text`:return e.text;case`code`:let t=e.text.replace(/```\w*\n?/g,``).replace(/\n?```/g,``).trim();return t.includes(`
|
|
3
3
|
`)?`\`\`\`\n${t}\n\`\`\``:t;default:return`tag`in e&&e.tag===`@link`&&typeof e.target==`string`&&e.text===`Learn more`?``:e.text}}).join(``).replace(/\n/g,` `).replace(/\s+/g,` `).trim()}formatComment(e){if(!e)return``;let t=[];if(e.summary&&e.summary.length>0){let n=this.formatCommentParts(e.summary);n.trim()&&t.push(n.trim())}if(e.blockTags&&e.blockTags.length>0)for(let n of e.blockTags){let e=this.formatCommentParts(n.content);if(e.trim()){let r=n.tag.replace(`@`,``);if(r===`default`||r===`defaultValue`)continue;r===`example`?t.push(`**Example:**\n\`\`\`\n${e.trim()}\n\`\`\``):t.push(`**${r}:** ${e.trim()}`)}}return t.join(`
|
|
4
4
|
|
|
5
|
-
`)}extractSinceTag(e){return(e?.blockTags?.find(e=>e?.tag===`@since`))?.content?.[0]?.text}extractProps(e,t){let n=[];return e.props?.length&&n.push(...e.props.map(e=>this.convertPropInfo(e,t))),e.input?.length&&n.push(...e.input.map(e=>this.convertPropInfo(e,t,`input`))),e.output?.length&&n.push(...e.output.map(e=>this.convertPropInfo(e,t,`output`))),n}convertPropInfo(e,t,n=void 0){return{name:e.name,type:
|
|
5
|
+
`)}extractSinceTag(e){return(e?.blockTags?.find(e=>e?.tag===`@since`))?.content?.[0]?.text}extractProps(e,t){let n=[];return e.props?.length&&n.push(...e.props.map(e=>this.convertPropInfo(e,t))),e.input?.length&&n.push(...e.input.map(e=>this.convertPropInfo(e,t,`input`))),e.output?.length&&n.push(...e.output.map(e=>this.convertPropInfo(e,t,`output`))),n}convertPropInfo(e,t,n=void 0){return{name:e.name,type:Xe(e),...e.defaultValue&&{defaultValue:$e(e.defaultValue)},description:this.formatComment(e.comment||null),propType:n,required:Ze(e,t)||void 0,since:this.extractSinceTag(e.comment)}}propsToMarkdownList(){return()=>(e,t,n)=>{A(e,`mdxJsxFlowElement`,(e,t,n)=>{if(!e.name||!oe.includes(e.name))return;let r=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===`name`),i=e.attributes?.some(e=>e.type===`mdxJsxAttribute`&&e.name===`partial`);if(!this.docProps||!r){n&&t!==void 0&&n.children.splice(t,1);return}let a=_(r);if(a.length===0){n&&t!==void 0&&n.children.splice(t,1);return}let o=a[0],s=this.docProps.props[o];if(!s){this.verbose&&console.log(` TypeDocProps not found: ${o}`),n&&t!==void 0&&n.children.splice(t,1);return}let c=this.extractProps(s,!!i);this.verbose&&console.log(` Replaced TypeDocProps ${o} with API documentation`);let l=c.filter(e=>e.propType===void 0),u=c.filter(e=>e.propType===`input`),d=c.filter(e=>e.propType===`output`),f=[];l.length>0&&f.push(tt(l)),u.length>0&&f.push(`**Inputs**\n\n${tt(u)}`),d.length>0&&f.push(`**Outputs**\n\n${tt(d)}`);let p=f.join(`
|
|
6
6
|
|
|
7
|
-
`);if(!p){n&&t!==void 0&&n.children.splice(t,1);return}Object.assign(e,{data:{typeDocProps:{name:o,props:c,since:this.extractSinceTag(s.comment)}},lang:null,meta:null,type:`code`,value:p})}),n()}}},
|
|
8
|
-
`),s=
|
|
7
|
+
`);if(!p){n&&t!==void 0&&n.children.splice(t,1);return}Object.assign(e,{data:{typeDocProps:{name:o,props:c,since:this.extractSinceTag(s.comment)}},lang:null,meta:null,type:`code`,value:p})}),n()}}},rt=()=>(e,t,n)=>{A(e,`text`,e=>{let t=e.value?.trim?.();t&&(m(t)||y(t)||h(t))&&Object.assign(e,{value:``})}),n()},it=()=>(e,t,n)=>{A(e,`mdxJsxFlowElement`,(e,t,n)=>{if(e?.name===`NpmInstallTabs`){let r=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===`packages`),i=r?_(r):[];if(i.length===0){n&&t!==void 0&&n.children.splice(t,1);return}Object.assign(e,{lang:`shell`,meta:null,type:`code`,value:`npm install ${i.join(` `)}`})}}),n()};function at(e,t){return!e||typeof e!=`object`?``:JSON.stringify(t?{cssProperty:t,data:e}:e,null,2)}function N(e,t){return t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)}function P(e,t){let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n?.value?typeof n.value==`string`?n.value:typeof n.value==`object`&&`value`in n.value?n.value.value:null:null}async function ot(){let e=null;try{e=await import(`@qualcomm-ui/tailwind-plugin/theme`)}catch{return()=>{}}let t={ColorTable:t=>{let n=P(t,`data`);return n&&N(e,n)},FontTable:t=>{let n=P(t,`data`);return n&&N(e,n)},SpacingTable:t=>{let n=P(t,`data`);return n&&N(e,n)},ThemePropertyTable:t=>{let n=P(t,`data`),r=P(t,`cssProperty`),i=n&&N(e,n);return n&&r?{cssPropertyName:r,data:i}:void 0}};return()=>(e,n,r)=>{A(e,`mdxJsxFlowElement`,e=>{let n=e.name&&t[e.name];if(!n)return;let r=n(e);if(!r){console.warn(`No theme data for ${e.name}`);return}let i;if(typeof r==`object`&&r&&`cssPropertyName`in r&&`data`in r){let{cssPropertyName:e,data:t}=r;i=at(t,e)}else i=at(r);i&&Object.assign(e,{lang:`json`,meta:null,type:`code`,value:i})}),r()}}var st=class{cache;config;fileReader;propFormatter;constructor(e,t,n){this.cache=n??new Map,this.config=e,this.fileReader=t,this.propFormatter=new nt({docPropsPath:e.docPropsPath,routeDir:e.routeDir,verbose:e.verbose})}async generate(){this.config.verbose&&(console.log(`Scanning pages in: ${this.config.routeDir}`),this.config.exclude?.length&&console.log(`Excluding patterns: ${this.config.exclude.join(`, `)}`));let[e]=await Promise.all([this.scanPages(),this.propFormatter.loadDocProps()]);e.length===0?console.log(`No pages found.`):this.config.verbose&&console.log(`Found ${e.length} page(s)`);let t=0,n=new Set,r=[],i=[],a=this.config.sections??{},o=new ee({depths:a.depths,minContentLength:a.minContentLength,pageIdPrefix:this.config.pageIdPrefix});for(let a of e){n.add(a.mdxFile);try{this.config.verbose&&console.log(`Processing page: ${a.name}`);let{fileContents:e,frontmatter:n}=this.fileReader.readFileSync(a.mdxFile),s=u(e),c=this.cache.get(a.mdxFile);if(c&&c.contentHash===s){t++,r.push(...c.sections),c.pageEntry&&i.push(c.pageEntry);continue}let l=await this.processMdxPage(a,{fileContents:e,frontmatter:n}),d={frontmatter:qe(l.frontmatter,this.config.frontmatter),id:a.id,pathname:a.pathname,title:l.title,url:l.url},{sections:f}=o.extract(l.sectionAst,d);r.push(...f);let p=o.extractPage(l.sectionAst,d);p&&(p.content=`# ${l.title}\n\n${p.content}`,i.push(p)),this.cache.set(a.mdxFile,{contentHash:s,pageEntry:p??null,processedPage:l,sections:f})}catch(e){throw console.error(`Failed to process page: ${a.name}`),e}}for(let e of this.cache.keys())n.has(e)||this.cache.delete(e);this.config.extraFiles?.length&&await this.processExtraFiles(this.config.extraFiles,o,r,i);let s=u(JSON.stringify(r)),c=u(JSON.stringify(i));return{cachedPageCount:t,pages:{generatedAt:new Date().toISOString(),hash:c,pages:i,totalPages:i.length,version:1},sections:{generatedAt:new Date().toISOString(),hash:s,sections:r,totalSections:r.length,version:1},totalPageCount:e.length}}async scanPages(){let e=[],t=this.config.exclude??[],n=e=>{if(t.length===0)return!1;let n=de(this.config.routeDir,e);return t.some(e=>Ae(n,e,{matchBase:!0}))},r=async t=>{if(n(t)){this.config.verbose&&console.log(`Excluding directory: ${de(this.config.routeDir,t)}`);return}let i=await _e(t,{withFileTypes:!0}),a=i.filter(e=>e.name.endsWith(`.mdx`)&&!n(T(t,e.name)))??[];for(let n of a){let r=i.find(e=>e.name===`demos`),a=r?T(t,r.name):void 0,o=b(T(t,n.name),this.config.routeDir),s=re(o);e.push({demosFolder:a,filePath:t,id:o.join(`-`).trim(),mdxFile:T(t,n.name),name:o.at(-1),pathname:s,url:this.config.baseUrl?new URL(s,this.config.baseUrl).toString():void 0}),this.config.verbose&&(console.log(`Found file: ${o.at(-1)}`),console.log(` Demos folder: ${a||`NOT FOUND`}`))}for(let e of i)e.isDirectory()&&await r(T(t,e.name))};return await r(this.config.routeDir),e}formatFrontmatterExpressions(e){return()=>t=>{A(t,`mdxFlowExpression`,(t,n,r)=>{t.value.trim()!==`frontmatter.description`||n===void 0||!r||(e.description?r.children.splice(n,1,{children:[{type:`text`,value:e.description}],type:`paragraph`}):r.children.splice(n,1))});let n=t,r=n.children.findIndex(e=>e.type!==`heading`||e.depth!==1?!1:e.children?.some(e=>e.type===`mdxTextExpression`&&e.value?.includes(`frontmatter`)));r>=0&&n.children.splice(r,1)}}transformRelativeUrls(){let e=this.config.baseUrl;return()=>t=>{e&&A(t,`link`,t=>{t.url.startsWith(`/`)&&(t.url=`${e}${t.url}`)})}}async processMdxContent(e,t,n){let r=await ot(),i=p({frontmatter:!0,gfm:!0,mdx:!0,plugins:[l,it,this.propFormatter.propsToMarkdownList(),this.formatFrontmatterExpressions(n),r,Ye(t.demosFolder,this.config.verbose),rt,this.transformRelativeUrls()]});return await i.run(i.parse(e))}async processMdxPage(e,t){let{fileContents:n,frontmatter:r}=t??this.fileReader.readFileSync(e.mdxFile),i=await this.processMdxContent(n,e,r),a=p({extractMeta:{},frontmatter:!0,gfm:!0,mdx:!0,output:`md`,removeJsx:!0}),o=a.runSync(i),s=String(a.stringify(o)).replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``).replace(/(^#{1,6} .*\\<[^>]+)>/gm,`$1\\>`),c=p({extractMeta:{},output:`md`}),l=String(await c.process(s)),u=r.title||e.name;return{content:l.trim(),frontmatter:r,rawContent:s.trim(),sectionAst:o,title:u,url:e.url}}async processExtraFiles(e,t,n,r){await Promise.all(e.map(async e=>{let i=e.contents;if(e.processAsMdx){let e=p({frontmatter:!0,gfm:!0,mdx:!0,output:`md`,plugins:[this.transformRelativeUrls()],removeJsx:!0});i=String(await e.process(i))}let a=[];e.title&&(a.push(`# ${e.title}`),a.push(``)),a.push(i);let o=a.join(`
|
|
8
|
+
`),s=p({gfm:!0,output:`md`}).parse(o),c={frontmatter:{},id:e.id,pathname:`/${e.id}`,title:e.title||e.id},{sections:l}=t.extract(s,c);n.push(...l);let u=t.extractPage(s,c);u&&r.push(u)}))}},ct=process.env.NODE_ENV===`development`,lt=`\0@qualcomm-ui/mdx-vite-plugin`,ut=`\0@qualcomm-ui/docs-plugin/config`,dt=`\0@qualcomm-ui/docs-plugin/markdown-content`,ft=class{buildCount=0;config=null;configFilePath=``;docPropsFilePath=``;exports={dir:``,enabled:!1,pathnames:[]};indexer;configLoader=null;knowledgeConfig=void 0;knowledgePageCache=new Map;pages=null;sections=null;routesDir;servers=[];timeout=void 0;exportsTimeout=void 0;watching=!1;cwd;init(e){this.cwd=e}getCwd(){return this.cwd}get docPropsDirectory(){return this.docPropsFilePath?this.docPropsFilePath.substring(0,this.docPropsFilePath.lastIndexOf(`/`)):``}get siteData(){let{filePath:e,...t}=this.config??{};return{config:t,exports:this.exports,navItems:this.indexer.navItems,pageDocProps:this.indexer.pageDocProps,pageMap:this.indexer.pageMap,searchIndex:this.indexer.searchIndex}}resolveDocProps(){if(!this.docPropsFilePath)return{};try{return JSON.parse(pe(this.docPropsFilePath,`utf-8`))?.props}catch{return console.debug(`Invalid doc props file. Unable to parse JSON. Please check the file`),{}}}createIndexer(e){this.knowledgePageCache.clear(),this.config=e,this.configFilePath=e.filePath,this.docPropsFilePath=e.typeDocProps?a(E(this.cwd,e.typeDocProps)):``,this.routesDir=a(E(e.appDirectory,e.pageDirectory)),this.knowledgeConfig=e.knowledge,this.indexer=new ae({...e,srcDir:a(E(this.cwd,e.appDirectory)),typeDocProps:this.resolveDocProps()});let t=!!e.knowledge,n=e.knowledge?.outputPath??`exports`;this.exports={dir:t?`/${n}`:``,enabled:t,pathnames:[]}}buildIndex(e){let t=he.sync([`${this.routesDir}/**/*.mdx`,`${this.routesDir}/**/*.tsx`],{absolute:!0,cwd:this.cwd});if(!t.length)return[];let n=Date.now(),r=this.indexer.buildIndex(t,e);return ct&&e&&console.debug(`${k.magenta.bold(`@qualcomm-ui/mdx-vite/docs-plugin:`)} Compiled search index in: ${k.blueBright.bold(ke(Date.now()-n))}${this.indexer.cachedFileCount?k.greenBright.bold(` (${this.indexer.cachedFileCount}/${this.indexer.mdxFileCount} files cached)`):``}`),r}sendUpdate(){for(let e of this.servers){let t=e.moduleGraph.getModuleById(lt);t&&(e.moduleGraph.invalidateModule(t),e.reloadModule(t))}}handleChange(e={}){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.buildIndex(!0),this.sendUpdate(),e?.onComplete?.()},300)}initWatchers(e){this.watching||=(this.initConfigWatcher(e),!0)}initConfigWatcher(e){let t=[this.configFilePath];this.docPropsFilePath&&t.push(this.docPropsFilePath),Ee.watch(t,{cwd:this.cwd}).on(`change`,()=>{console.debug(`qui-docs config changed, reloading plugin`),this.configLoader=new i({configFile:e});let t=this.configLoader.loadConfig();this.configFilePath=t.filePath,this.createIndexer(t),this.handleChange({onComplete:()=>{for(let e of this.servers)e.ws.send({type:`full-reload`})}})})}async generateKnowledge(t){if(!this.knowledgeConfig)return;let n=T(t,this.knowledgeConfig.outputPath??`exports`),r=Date.now(),i=new e(ct),a=await new st({baseUrl:this.knowledgeConfig.baseUrl,docPropsPath:this.docPropsFilePath||void 0,exclude:this.knowledgeConfig.exclude,extraFiles:this.knowledgeConfig.extraFiles,frontmatter:this.knowledgeConfig.frontmatter,pageIdPrefix:this.knowledgeConfig.pageIdPrefix,pages:this.knowledgeConfig.pages,routeDir:this.routesDir,sections:this.knowledgeConfig.sections},i,this.knowledgePageCache).generate();this.pages=a.pages,this.sections=a.sections,await ge(n,{recursive:!0}),await ve(T(n,`sections.json`),JSON.stringify(a.sections,null,2),`utf-8`),await ve(T(n,`pages.json`),JSON.stringify(a.pages,null,2),`utf-8`),this.exports.pathnames=a.pages.pages.map(e=>e.pathname);let o=a.cachedPageCount>0?k.greenBright.bold(` (${a.cachedPageCount}/${a.totalPageCount} pages cached)`):``;console.debug(`${k.magenta.bold(`@qualcomm-ui/mdx-vite/docs-plugin:`)} Generated knowledge exports in: ${k.blueBright.bold(ke(Date.now()-r))}${o}`)}debouncedGenerateKnowledge(e,t={}){this.knowledgeConfig&&(clearTimeout(this.exportsTimeout),this.exportsTimeout=setTimeout(()=>{this.generateKnowledge(e).then(()=>{t.onDone?.()})},500))}},pt=process.env.NODE_ENV===`development`,F=new ft;function mt(e){F.init(a(e?.cwd??process.cwd()));let t=new i(e||{}).loadConfig();F.createIndexer(t);let n;function r(){return n.publicDir||T(F.getCwd(),`public`)}return{apply(e,t){return t.mode===`development`&&t.command===`serve`||t.mode===`production`&&t.command===`build`},buildStart:async()=>{F.buildIndex(F.buildCount>0),F.buildCount++,!pt&&F.knowledgeConfig&&await F.generateKnowledge(r())},configResolved(e){n=e},configureServer:async t=>{pt&&(F.initWatchers(e?.configFile),F.knowledgeConfig&&await F.generateKnowledge(r()),t.middlewares.use(`/__qui-docs/pages`,(e,t)=>{t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify(F.pages))}),t.middlewares.use(`/__qui-docs/sections`,(e,t)=>{t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify(F.sections))}),t.watcher.on(`add`,e=>{e.endsWith(`.mdx`)&&F.handleChange({onComplete:()=>{t.ws.send({type:`full-reload`}),F.debouncedGenerateKnowledge(r())}})}),t.watcher.on(`unlink`,e=>{e.endsWith(`.mdx`)&&F.handleChange({onComplete:()=>{t.ws.send({type:`full-reload`}),F.debouncedGenerateKnowledge(r())}})}),F.servers.push(t))},handleHotUpdate:({file:e,modules:n,server:i})=>{if(e.endsWith(`.css`))return n;let o=a(e);if((!t.hotUpdateIgnore||!t.hotUpdateIgnore.test(o))&&o!==F.configFilePath){if(F.docPropsDirectory&&o.startsWith(F.docPropsFilePath))return[];if(e.endsWith(`.mdx`)){F.debouncedGenerateKnowledge(r());let t=F.buildIndex(!0);if(!i.moduleGraph.getModulesByFile(e)?.size)return console.debug(`no module found for file, returning`,e),[];let n=i.moduleGraph.getModuleById(lt);return n&&(i.moduleGraph.invalidateModule(n),i.ws.send({data:F.siteData,event:`qui-docs-plugin:refresh-site-data`,type:`custom`})),t.some(e=>e.metadata.changed.frontmatter)?(console.debug(`Frontmatter changed, reloading plugin to reflect changes in the page configuration`),n&&i.moduleGraph.invalidateModule(n),i.ws.send({type:`full-reload`}),[]):n?[n]:[]}}return[]},load:e=>{if(e===`\0@qualcomm-ui/mdx-vite-plugin`)return`export const siteData = ${JSON.stringify(F.siteData)}`;if(e===`\0@qualcomm-ui/docs-plugin/config`)return`export const quiDocsConfig = ${JSON.stringify({...F.config,cwd:F.cwd,publicDir:n.publicDir})}`;if(e===`\0@qualcomm-ui/docs-plugin/markdown-content`){if(pt){let{host:e=`localhost`,port:t=5173}=n.server,r=e===!0?`localhost`:e||`localhost`,i=`${n.server.https?`https`:`http`}://${r}:${t}`;return M`
|
|
9
9
|
export const getSections = () => fetch('${i}/__qui-docs/sections').then(r => r.json())
|
|
10
10
|
export const getPages = () => fetch('${i}/__qui-docs/pages').then(r => r.json())
|
|
11
|
-
`}return
|
|
12
|
-
export const getSections = () => Promise.resolve(${JSON.stringify(
|
|
13
|
-
export const getPages = () => Promise.resolve(${JSON.stringify(
|
|
14
|
-
`}},name:`qui-mdx-vite-plugin`,resolveId:e=>{if(e===`@qualcomm-ui/mdx-vite-plugin`)return
|
|
11
|
+
`}return M`
|
|
12
|
+
export const getSections = () => Promise.resolve(${JSON.stringify(F.sections)})
|
|
13
|
+
export const getPages = () => Promise.resolve(${JSON.stringify(F.pages)})
|
|
14
|
+
`}},name:`qui-mdx-vite-plugin`,resolveId:e=>{if(e===`@qualcomm-ui/mdx-vite-plugin`)return lt;if(e===`@qualcomm-ui/docs-plugin/config`)return ut;if(e===`@qualcomm-ui/docs-plugin/markdown-content`)return dt}}}var ht=`virtual:react-router/hmr-runtime`,gt=`/__frontmatter-hmr-fix/full-reload`,_t=/^(\s*)throw Error\(\s*`\[react-router:hmr\] No module update found for route \$\{route\.id\}`,\s*\);/m;function vt(e={}){let{exportName:t=`frontmatter`}=e;return{configureServer(e){e.middlewares.use(gt,(t,n,r)=>{if(t.method!==`POST`){r();return}e.ws.send({type:`full-reload`}),n.statusCode=204,n.end()})},name:`frontmatter-hmr-fix`,transform(e,n){if(n.includes(ht))return e.replace(_t,(e,t)=>[`${t}console.debug(\`[react-router:hmr] No module update found for route \${route.id}\`);`,`${t}void fetch("${gt}", {method: "POST"}).catch(() => window.location.reload());`,`${t}return;`].join(`
|
|
15
15
|
`));if(e.includes(`export const ${t}`))return e+=`
|
|
16
16
|
if (typeof ${t} === 'object') {
|
|
17
17
|
Object.defineProperty(${t}, "$$typeof", {
|
|
@@ -19,37 +19,37 @@ import{A as e,C as t,D as n,E as r,F as i,I as a,M as o,N as s,O as c,P as l,S a
|
|
|
19
19
|
value: Symbol.for('react.memo')
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
`,e}}}var
|
|
23
|
-
`).map(
|
|
24
|
-
`)}function
|
|
22
|
+
`,e}}}var yt={},bt=e=>{let t=e||yt,n=t.prefix||``,r=new Set(t.allowedHeadings||[`h2`,`h3`,`h4`]),i=new te;return e=>{i.reset(),A(e,`element`,function(e){Ve(e)&&!e.properties.id&&r.has(e.tagName)&&(e.properties.id=n+i.createSlug(He(e)))})}},I={enableRootSection:!1,idPropertyName:`ariaLabelledby`,properties:{},rankPropertyName:`dataHeadingRank`},xt=(e,t)=>{if(e==null||t==null||!(`properties`in e))throw Error(`rootContent and rankPropertyName must have value`);let n=e.properties?.[t];if(typeof n!=`number`)throw Error(`rankPropertyName(${t}) must be number`);return n},St=(e,t,n=[])=>{let{idPropertyName:r,properties:i,rankPropertyName:a}=t;if(i!=null&&a!=null&&a in i)throw Error(`rankPropertyName(${a}) dataHeadingRank must exist`);let o=n.at(0)?.properties?.id;return{children:n,properties:{className:[`heading`],...a?{[a]:e}:{},...r&&typeof o==`string`?{[r]:o}:{},...i||{}},tagName:`section`,type:`element`}},Ct=(e=I)=>{let{enableRootSection:t,...n}={enableRootSection:e.enableRootSection??I.enableRootSection,idPropertyName:e.idPropertyName??I.idPropertyName,properties:e.properties??I.properties,rankPropertyName:e.rankPropertyName??I.rankPropertyName};return e=>{let r=St(0,n),i=[];i.push(r);let a=()=>{let e=i.at(-1);if(e==null||e.type!==`element`)throw Error(`lastStackItem must be Element`);return i.at(-1)};for(let t of e.children)if(Ue(t)){let e=Ve(t);if(e==null)throw Error(`heading or headingRank is not working`);if(e>xt(a(),n.rankPropertyName)){let r=St(e,n,[t]);a().children.push(r),i.push(r)}else if(e<=xt(a(),n.rankPropertyName)){for(;e<=xt(a(),n.rankPropertyName);)i.pop();let r=St(e,n,[t]);a().children.push(r),i.push(r)}}else{if(t.type===`doctype`)throw Error(`must be used in a fragment`);a().children.push(t)}return{...e,children:t?[r]:r.children}}};function wt(e){let t=/\/\/\s*\[!code\s+hide(?::\d+)?\]/,n=/\/\/\s*\[!code\s+--\]/,r=/\/\/\s*\[!code\s*(?:\S.*)?\]/,i=/\{\s*\/\*\s*\[!code(?:\s+\S+)?\]\s*\*\/\s*\}/,a=/<!--\s*\[!code(?:\s+\S+)?\]\s*-->/,o=/\/\*\s*\[!code(?:\s+\S+)?\]\s*\*\/\s*/,s=/(?:\/\/\s*)?\[!code \+\+\]/;function c(e){let c=e,l=!1,u=t.test(e),d=n.test(e),f=[s,i,a,o,r];for(let e of f){let t=c.replace(e,``);t!==c&&(l=!0,c=t)}return{hasHideAnnotation:u||d,processed:c,touched:l}}return e.split(`
|
|
23
|
+
`).map(c).filter(({hasHideAnnotation:e,processed:t,touched:n})=>{if(e)return!1;let r=!t.trim();return!(n&&r)}).map(({processed:e})=>e).join(`
|
|
24
|
+
`)}function Tt(e){let t=e.match(/<pre((?:\s+[\w-]+="[^"]*")*)>/),n=e.match(/<code([^>]*)>(.*?)<\/code>/s);if(!t||!n)return null;let r=n[2].split(/<span class="line/).slice(1).filter(e=>e.includes(`data-preview-line="true"`)),i=r.map(e=>{let t=e.match(/<span class="indent">(.+?)<\/span>/g)||[],n=0;for(let e of t){let t=e.match(/<span class="indent">(.+?)<\/span>/);if(t)n+=t[1].length;else break}return n}),a=Math.min(...i.filter(e=>e>0)),o=r.map(e=>{let t=`<span class="line${e}`,n=a;for(;n>0&&t.includes(`<span class="indent">`);){let e=t;if(t=t.replace(/<span class="indent">(.+?)<\/span>/,(e,t)=>{if(t.length<=n)return n-=t.length,``;{let e=t.substring(n);return n=0,`<span class="indent">${e}</span>`}}),e===t)break}return t});return`<pre${t[1]}><code${n[1]}>${o.join(``)}</code></pre>`}function Et(e={attributeName:`data-code`}){return{enforce:`post`,name:`shiki-transformer-code-attribute`,pre(t){let n=wt(this.source),r=e.formatter?.(n)??n;e.attributeName!==null&&(t.properties[e.attributeName??`data-code`]=r),e.onComplete?.(r)}}}function Dt(){return{name:`shiki-transformer-notation-hidden`,preprocess(e){let t=e.split(`
|
|
25
25
|
`),n=[],r=0;for(let e of t){let t=e,i=t.match(/\[!code\s+hide(?::(\d+))?\]/);if(i){let e=t.slice(0,i.index??0),n=t.slice((i.index??0)+i[0].length),a=i[1]?Number(i[1]):1,o=Number.isFinite(a)&&a>0?a:0,s=e.trim()===``||/^[\s/]*$/.test(e),c=n.trim()===``;if(s&&c){r+=o;continue}continue}if(r>0){--r;continue}n.push(t)}return n.join(`
|
|
26
|
-
`).trim()}}}function
|
|
27
|
-
`),s=[],c=[],l=!1,u=!1,d=0;for(let e of o){if(
|
|
26
|
+
`).trim()}}}function Ot(e){return e===`// preview`||/^\{\s*\/\*\s*preview\s*\*\/\s*\}$/.test(e)||/^<!--\s*preview\s*-->$/.test(e)}function kt(e={displayMode:`full-code`}){let t=null,n=-1,r=-1,i=0;return{enforce:`post`,line(e){i>=n&&i<=r&&(e.properties[`data-preview-line`]=`true`),i++},name:`transformer-preview-block`,pre(n){let r=t?wt(t):null;r&&e.attributeName!=null&&(n.properties[e.attributeName]=r),e.onComplete?.(r||null)},preprocess(a){t=null,i=0,n=-1,r=-1;let o=a.split(`
|
|
27
|
+
`),s=[],c=[],l=!1,u=!1,d=0;for(let e of o){if(Ot(e.trim())){l?(l=!1,r=d-1):(l=!0,u=!0,n=d);continue}s.push(e),l&&c.push(e),d++}return u&&(t=M(c.join(`
|
|
28
28
|
`).trim()),e.displayMode===`only-preview`)?t:s.join(`
|
|
29
|
-
`).trim()}}}function
|
|
29
|
+
`).trim()}}}function L(){return[Me(),Pe(),Fe(),Ie(),Ne(),Dt(),Re(),Le()]}function At(e={}){let t=new i(e).loadConfig();return[[ze,{enforce:`pre`}],[bt,{allowedHeadings:t.headings}],Ct,[je,Se({addLanguageClass:!0,defaultColor:`light-dark()`,defaultLanguage:`plaintext`,fallbackLanguage:`plaintext`,themes:{dark:ye,light:`github-light-high-contrast`},transformers:[...L(),Et()]},e.rehypeShikiOptions)]]}function jt(){return[be,Be,xe,o,r,s,se,g,ne,S,c]}async function Mt(e){let t=e===`tailwindcss`?`tailwindcss/index.css`:e,n;return n=typeof createRequire<`u`?createRequire(import.meta.url).resolve(t):(await import(`node:module`).then(e=>e.createRequire))(import.meta.url).resolve(t),O(n,`utf-8`)}async function Nt(e){return Ke(e,{loadStylesheet:async(e,t)=>({base:t,content:await Mt(e),path:`virtual:${e}`})})}function Pt(e){let t=new Map;return We.parse(e).walkAtRules(`layer`,e=>{e.params===`theme`&&e.walkRules(`:root, :host`,e=>{e.walkDecls(e=>{e.prop.startsWith(`--`)&&t.set(e.prop,e.value)})})}),t}function Ft(e){let t=e.trim(),n=t.match(/^([\d.]+)(rem|px|em|%|vh|vw)\s*([*/+-])\s*([\d.]+)$/);if(n){let[,e,t,r,i]=n,a=It(parseFloat(e),r,parseFloat(i));return Number.isFinite(a)?R(a)+t:null}let r=t.match(/^([\d.]+)\s*([*/+-])\s*([\d.]+)(rem|px|em|%|vh|vw)$/);if(r){let[,e,t,n,i]=r,a=It(parseFloat(e),t,parseFloat(n));return Number.isFinite(a)?R(a)+i:null}let i=t.match(/^([\d.]+)\s*([*/+-])\s*([\d.]+)$/);if(i){let[,e,t,n]=i,r=It(parseFloat(e),t,parseFloat(n));return Number.isFinite(r)?R(r):null}return null}function It(e,t,n){switch(t){case`*`:return e*n;case`/`:return e/n;case`+`:return e+n;case`-`:return e-n;default:return NaN}}function R(e){let t=Math.round(e*1e4)/1e4;return String(t)}function Lt(e){return e.replace(/([\d.]+)rem/g,(e,t)=>`${R(parseFloat(t)*16)}px`)}function Rt(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`(`)n++;else if(e[r]===`)`&&(n--,n===0))return r;return-1}function zt(e,t){let n=e.indexOf(`var(`,t);if(n===-1)return null;let r=n+4,i=Rt(e,n);if(i===-1)return null;let a=e.slice(r,i),o=-1,s=0;for(let e=0;e<a.length;e++)if(a[e]===`(`)s++;else if(a[e]===`)`)s--;else if(a[e]===`,`&&s===0){o=e;break}return o===-1?{end:i,fallback:null,varName:a.trim()}:{end:i,fallback:a.slice(o+1).trim(),varName:a.slice(0,o).trim()}}function Bt(e,t,n=0){if(n>10)return e;let r=e,i=0;for(;;){let e=zt(r,i);if(!e)break;let{end:a,fallback:o,varName:s}=e,c=r.indexOf(`var(`,i),l,u=t.get(s);if(u!==void 0)l=Bt(u,t,n+1);else if(o)l=Bt(o,t,n+1);else{i=a+1;continue}r=r.slice(0,c)+l+r.slice(a+1)}return r=r.replace(/calc\(([^)]+)\)/g,(e,t)=>Ft(t)??e),r=Lt(r),r}function Vt(e){let t=!0,n=null;return Ge(e=>{if(e.nodes.length!==1){t=!1;return}let r=e.nodes[0];if(r.nodes.length!==1){t=!1;return}let i=r.nodes[0];if(i.type!==`class`){t=!1;return}n=i.value,r.walk(e=>{(e.type===`pseudo`||e.type===`combinator`||e.type===`nesting`||e.type===`attribute`)&&(t=!1)})}).processSync(e),{className:n,inlineable:t}}function Ht(e){let t=[],n=We.parse(e),r=Pt(e);function i(e,n){let{className:i,inlineable:a}=Vt(e.selector);if(!i)return;let o=!1;e.walkAtRules(()=>{o=!0});let s=[];e.each(e=>{if(e.type===`decl`){let t=Bt(e.value,r);s.push(`${e.prop}: ${t}`)}}),!(s.length===0&&!o)&&t.push({className:i,declarations:s.join(`; `),inlineable:a&&!n&&!o,originalRule:e.toString()})}return n.walkAtRules(`layer`,e=>{e.walkRules(e=>{let t=e.parent;i(e,t?.type===`atrule`&&t.name!==`layer`)}),e.walkAtRules(e=>{e.name!==`layer`&&e.walkRules(e=>{i(e,!0)})})}),n.walkRules(e=>{e.parent?.type===`root`&&i(e,!1)}),t}function Ut(e,t){let n=Ht(t.build(e)),r=new Map,i=new Map;for(let e of n)e.inlineable?r.set(e.className,e.declarations):i.set(e.className,e.originalRule);let a=[],o=[];for(let t of e){let e=r.get(t);e?a.push(e):o.push(t)}return{inlineStyles:a,remainingClasses:o,residualRules:i}}function Wt(e){return`{ ${e.flatMap(e=>e.split(`;`).map(e=>e.trim()).filter(Boolean)).map(e=>{let t=e.indexOf(`:`);if(t===-1)return null;let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return`${Ce(n)}: '${r}'`}).filter(Boolean).join(`, `)} }`}function Gt(e,t,n=`html`){let r=new Map,i=new Map,a=/(className|class)=(["'`])([^"'`]*)\2/g,o;for(;(o=a.exec(e))!==null;){let e=o[0],a=o[1],s=o[2],c=o[3].split(/\s+/).filter(Boolean);if(c.length===0)continue;let{inlineStyles:l,remainingClasses:u,residualRules:d}=Ut(c,t);for(let[e,t]of d)i.set(e,t);if(l.length===0)continue;let f;f=n===`jsx`?`style={${Wt(l)}}`:`style=${s}${l.join(`; `)}${s}`,u.length>0&&(f+=` ${a}=${s}${u.join(` `)}${s}`),r.set(e,f)}return{replacements:r,residualRules:i}}function Kt(e,t,n=`html`){let r=new Map,i=!1,{replacements:a,residualRules:o}=Gt(e,t,n);(a.size>0||o.size>0)&&(i=!0);for(let[e,t]of o)r.set(e,t);let s=e;for(let[e,t]of a)s=s.replaceAll(e,t);return{classesDetected:i,residualRules:r,source:s}}async function qt(e){let{onClassesDetected:t,onResidualCss:n,styleFormat:r=`html`,styles:i}=e,a=await Nt(i);return{name:`shiki-transformer-tailwind-to-inline`,preprocess(e){let{classesDetected:i,residualRules:o,source:s}=Kt(e,a,r);return t?.(i),n&&o.size>0&&n(o),s}}}var z=`\0virtual:angular-demo-registry`,B=`[angular-demo]`,V=!1;function H(...e){V&&console.log(...e)}var U={},W=null,Jt=0,G=new Map,K=[];function Yt({demoPattern:e=`src/routes/**/demos/*.ts`,initialHtml:t,routesDir:n=`src/routes`,theme:r={dark:ye,light:`github-light-high-contrast`},transformTailwindStyles:i}={}){let a=null,o=null,s={defaultColor:`light-dark()`,themes:{dark:r.dark,light:r.light}};return{async buildEnd(){a&&(await a.close(),a=null,V=!1)},async buildStart(){if(Jt===0){Jt++;return}if(!W)try{W=await Oe({langs:[`angular-ts`,`angular-html`,`css`],themes:[r.dark,r.light]}),H(`${k.blue.bold(B)} Shiki highlighter initialized`)}catch(e){console.warn(`${k.blue.bold(B)} Failed to initialize highlighter:`,e)}H(`${k.blue.bold(B)} Initializing Angular demo scanner`),await c(),process.env.NODE_ENV===`development`&&(V?H(`${k.blue.bold(B)} Watcher already initialized by another instance`):(V=!0,ae()))},configureServer(e){o=e;let t=null;e.ws.on(`custom:store-demo-dimensions`,n=>{let r=n.demoId;U[r]=n.dimensions,t&&clearTimeout(t),t=setTimeout(()=>{let t=e.moduleGraph.getModuleById(z);t&&e.moduleGraph.invalidateModule(t)},50)}),e.ws.on(`custom:reset-demo-dimensions`,()=>{U={};let t=e.moduleGraph.getModuleById(z);t&&(e.moduleGraph.invalidateModule(t),e.reloadModule(t))})},async handleHotUpdate({file:e,modules:t,server:n}){if(!v(e)){if(b(e))return t;if(e.endsWith(`main.js`)){let e=[...K];n.ws.send({data:{demoInfo:e.reduce((e,t)=>(e[t]=G.get(t),e),{})},event:`demo-bundle-updated`,type:`custom`})}return[]}H(`${k.blue.bold(B)} Processing Angular demo change: ${k.cyan(e)}`);let r=await m(e,await O(e,`utf-8`));if(!r||!y(e)){let t=await l(e);if(t.length>0){K=[];for(let e of t)K.push(e.id)}n.ws.send({data:{ids:[...K]},event:`demo-bundle-updating`,type:`custom`});return}delete U[r.id],G.set(r.id,r),K=[r.id],n.ws.send({data:{ids:[...K]},event:`demo-bundle-updating`,type:`custom`});let i=n.moduleGraph.getModuleById(z);i&&n.moduleGraph.invalidateModule(i);let a=n.moduleGraph.getModuleById(e);return a&&n.moduleGraph.invalidateModule(a),[]},load(e){if(e===z)return _()},name:`angular-demo-plugin`,resolveId(e){if(e===`virtual:angular-demo-registry`)return z},writeBundle(){console.log(`${k.blue.bold(B)} Successfully integrated ${k.green(G.size)} component demos`)}};async function c(){if(G.size){H(`${k.magenta.bold(B)} Using cached ${k.cyanBright.bold(G.size)} demos`);return}let t=await he(e);G.clear();for(let e of t){let t=await m(e,await O(e,`utf-8`));t&&G.set(t.id,t)}}async function l(e){let t=[];for(let[n,r]of G.entries())if(r.sourceCode.find(t=>t.filePath===e)){H(`${k.blue.bold(B)} Reloading demo ${k.cyan(n)} due to imported file change: ${k.yellow(e)}`);let i=await O(r.filePath,`utf-8`),a=await m(r.filePath,i);a&&(delete U[a.id],G.set(a.id,a),t.push(a),K.push(a.id))}return t}async function u(e,t=`angular-ts`,n={}){let{onClassesDetected:r,onResidualCss:a}=n;if(!W)return{full:e};let o=null,c=[];if(i&&a){let e=await qt({onClassesDetected:e=>{r?.(e)},onResidualCss:a,styleFormat:`html`,styles:M`
|
|
30
30
|
@layer theme, base, components, utilities;
|
|
31
31
|
@import "tailwindcss/theme.css" layer(theme);
|
|
32
32
|
@import "tailwindcss/utilities.css" layer(utilities);
|
|
33
33
|
@import "@qualcomm-ui/tailwind-plugin/qui-strict.css";
|
|
34
|
-
`});c.push(e)}try{let n=
|
|
35
|
-
`&&n++,e.slice(t.start,n).trim()})}catch(e){return
|
|
34
|
+
`});c.push(e)}try{let n=W.codeToHtml(e,{...s,lang:t,transformers:[...L(),...c,kt({attributeName:`data-preview`,onComplete:e=>{o=e}}),Et({attributeName:`data-code`}),{enforce:`post`,name:`shiki-transformer-trim`,preprocess(e){return e.trim()}}]});return{full:n,preview:o?Tt(n):null}}catch(n){return console.warn(`${k.blue.bold(B)} Failed to highlight code with ${t} language:`,n),{full:e}}}async function d(e){try{let t=await O(e,`utf-8`),n=j.createSourceFile(e,t,j.ScriptTarget.Latest,!0,j.ScriptKind.TS),r=[];function i(t){if(j.isImportDeclaration(t)){let n=t.moduleSpecifier;if(j.isStringLiteral(n)){let t=n.text;if(x(t)){let n=re(t,e);r.push({resolvedPath:n,source:t})}else if(!ne(t)){let n=ie(e);if(Zt(t,n)){let e=Qt(t,n);e&&r.push({resolvedPath:e,source:t})}}}}j.forEachChild(t,i)}return i(n),r}catch(t){return H(`${k.blue.bold(B)} ${k.yellowBright(`Failed to extract imports from`)} ${k.cyan(e)}:`,t),[]}}async function f(e,t=new Set){if(t.has(e))return[];t.add(e);let n=await d(e);for(let{resolvedPath:e}of n)await f(e,t);return Array.from(t).slice(1)}function p(e,t){try{let n=j.createSourceFile(t,e,j.ScriptTarget.Latest,!0,j.ScriptKind.TS),r=[];function i(e){j.isImportDeclaration(e)&&r.push({end:e.getEnd(),start:e.getFullStart()}),j.forEachChild(e,i)}return i(n),r.map(t=>{let n=t.end;return e[n]===`
|
|
35
|
+
`&&n++,e.slice(t.start,n).trim()})}catch(e){return H(`${k.blue.bold(B)} ${k.redBright(`Failed to strip imports from`)} ${k.cyan(t)}:`,e),[]}}async function m(e,n){try{let{componentClass:r,hasDefaultExport:i,isStandalone:a,selector:o,templateUrl:s}=h(e,n);if(!r||!o)return null;let c=r,l=de(process.cwd(),e).replace(/\\/g,`/`),d=C(e),f=p(n,e),m=[],_=new Map,v=await g({code:n,fileName:d,filePath:e,language:`angular-ts`});if(m.push(v.sourceCodeData),v.residualRules)for(let[e,t]of v.residualRules)_.set(e,t);if(s){let t=await ee(s,e);if(t&&(m.push(t.sourceCodeData),t.residualRules))for(let[e,n]of t.residualRules)_.set(e,n)}let y=await te(e);for(let e of y)if(m.push(e.sourceCodeData),e.residualRules)for(let[t,n]of e.residualRules)_.set(t,n);let b=_.size>0?[..._.values()].join(`
|
|
36
36
|
|
|
37
|
-
`):void 0;if(
|
|
37
|
+
`):void 0;if(b){let e=await u(b,`css`);m.push({fileName:`styles.css`,highlighted:e,type:`residual-css`})}return{componentClass:r,filePath:l.startsWith(`.`)?l:`./${l}`,hasDefaultExport:i,id:c,imports:f,initialHtml:t?.[c]||void 0,isStandalone:a,lastModified:Date.now(),selector:o,sourceCode:m}}catch(t){return console.error(`${k.blue.bold(B)} Failed to parse Angular demo ${e}:`,t),null}}function h(e,t){let n=j.createSourceFile(e,t,j.ScriptTarget.Latest,!0,j.ScriptKind.TS),r=``,i=``,a=!0,o=null,s=!1,c=[];function l(e){if(j.isImportDeclaration(e)&&c.push(e.getFullText(n).trim()),j.isClassDeclaration(e)){let t=(e.modifiers?.filter(j.isDecorator))?.find(e=>{if(!j.isCallExpression(e.expression))return!1;let t=e.expression.expression;return j.isIdentifier(t)&&t.text===`Component`});if(t&&e.name&&(r=e.name.text,j.isCallExpression(t.expression)&&t.expression.arguments[0]&&j.isObjectLiteralExpression(t.expression.arguments[0]))){let e=t.expression.arguments[0].properties,n=e.find(e=>j.isPropertyAssignment(e)&&j.isIdentifier(e.name)&&e.name.text===`selector`);n&&j.isStringLiteral(n.initializer)&&(i=n.initializer.text);let r=e.find(e=>j.isPropertyAssignment(e)&&j.isIdentifier(e.name)&&e.name.text===`templateUrl`);if(r){let e=r.initializer;(j.isStringLiteral(e)||j.isNoSubstitutionTemplateLiteral(e))&&(o=e.text)}let s=e.find(e=>j.isPropertyAssignment(e)&&j.isIdentifier(e.name)&&e.name.text===`standalone`);s&&s.initializer.kind===j.SyntaxKind.FalseKeyword&&(a=!1)}}j.isExportAssignment(e)&&!e.isExportEquals&&(s=!0),j.forEachChild(e,l)}return l(n),{componentClass:r,hasDefaultExport:s,importsFromAst:c,isStandalone:a,selector:i,templateUrl:o}}async function g(e){let{code:t,fileName:n,filePath:r,language:a}=e,o=await u(t,a),s,c=!1,l;return i&&(s=await u(t,a,{onClassesDetected:e=>{c=e},onResidualCss:e=>{l=e}})),{residualRules:l,sourceCodeData:{fileName:n,filePath:r,highlighted:{full:o.full,preview:o.preview},highlightedInline:c&&s?{full:s.full,preview:s.preview}:void 0,type:`file`}}}async function ee(e,t){let n=$t(e,t);if(!D(n))return null;try{return g({code:await O(n,`utf-8`),fileName:C(n),filePath:n,language:`angular-html`})}catch(e){return console.log(`${k.blue.bold(B)} ${k.redBright(`Failed to read template file:`)} ${k.cyan(n)}`,e),null}}async function te(e){let t=[],n=await f(e);for(let e of n)try{let n=await g({code:await O(e,`utf-8`),fileName:C(e),filePath:e,language:`angular-ts`});t.push(n)}catch{H(`${k.blue.bold(B)} ${k.yellowBright(`Failed to process relative import:`)} ${k.cyan(e)}`)}return t}function _(){return`// Auto-generated Angular demo registry
|
|
38
38
|
export const ANGULAR_DEMOS = {
|
|
39
|
-
${Array.from(
|
|
39
|
+
${Array.from(G.values()).map(e=>` "${e.id}": ${JSON.stringify({componentClass:e.componentClass,dimensions:U[e.id],filePath:e.filePath,hasDefaultExport:e.hasDefaultExport,id:e.id,imports:e.imports,initialHtml:e.initialHtml,isStandalone:e.isStandalone,lastModified:e.lastModified,selector:e.selector,sourceCode:e.sourceCode},null,4)}`).join(`,
|
|
40
40
|
`)}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function getAngularDemoInfo(demoId) {
|
|
44
44
|
return ANGULAR_DEMOS[demoId] || null
|
|
45
|
-
}`}function v(e){return e.includes(`/demos/`)&&(e.endsWith(`.ts`)||e.endsWith(`html`))}function
|
|
45
|
+
}`}function v(e){return e.includes(`/demos/`)&&(e.endsWith(`.ts`)||e.endsWith(`html`))}function y(e){return e.endsWith(`-demo.ts`)||e.endsWith(`-demo.html`)}function b(e){return e.endsWith(`.css`)}function x(e){return e.startsWith(`./`)||e.startsWith(`../`)}function ne(e){return e.startsWith(`node:`)||`assert.buffer.child_process.cluster.crypto.dgram.dns.domain.events.fs.http.https.net.os.path.punycode.querystring.readline.stream.string_decoder.timers.tls.tty.url.util.v8.vm.zlib`.split(`.`).includes(e)}function re(e,t){let n=E(w(t),e),r=[`.ts`,`.js`];for(let e of r){let t=n+e;if(D(t))return t}for(let e of r){let t=T(n,`index${e}`);if(D(t))return t}return n}function ie(e){let t=w(e),n=[];for(;t!==w(t);){let e=T(t,`tsconfig.json`);if(D(e))try{let r=j.sys.readFile(e);if(!r){t=w(t);continue}let i=j.parseConfigFileTextToJson(e,r);if(i.error){t=w(t);continue}let a=i.config?.compilerOptions?.paths,o=i.config?.compilerOptions?.baseUrl||`./`,s=E(t,o);if(a){for(let[e,t]of Object.entries(a))if(Array.isArray(t)&&t.length>0){let r=t[0],i=RegExp(`^${e.replace(`*`,`(.*)`).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`\\(\\*\\)`,`(.*)`)}$`),a=E(s,r.replace(`*`,`$1`));n.push({pattern:i,replacement:a})}}let c=i.config?.extends;if(c){let e=Xt(E(t,c));n.push(...e)}return n}catch{t=w(t);continue}t=w(t)}return n}function ae(){a=De(n,{ignoreInitial:!0,persistent:!0}),a.on(`ready`,()=>{H(`${k.blue.bold(B)} Registered ${k.green(G.size)} demo files. Watching for file changes...`)}),a.on(`add`,e=>{try{let t=me(e);if(!t||t.size===0){console.debug(`Failed to read file stats`,e);return}v(e)&&(H(`${k.blue.bold(B)} New Angular demo: ${k.green(e)}`),oe(e).then(()=>{S()}))}catch{console.debug(`Failed to update registry file stats`)}}),a.on(`unlink`,e=>{if(v(e)){let t=Array.from(G.entries()).find(([,t])=>t.filePath===e);if(t){let[e]=t;G.delete(e),H(`${k.blue.bold(B)} Removed demo: ${k.red(e)}`),S()}}})}async function oe(e){let t=await m(e,await O(e,`utf-8`));t&&G.set(t.id,t)}function S(){if(!o)return;let e=o.moduleGraph.getModuleById(z);e&&(o.moduleGraph.invalidateModule(e),e.lastHMRTimestamp=Date.now(),o.reloadModule(e))}}function Xt(e){let t=[],n=w(e);try{let r=j.sys.readFile(e);if(!r)return t;let i=j.parseConfigFileTextToJson(e,r);if(i.error)return t;let a=i.config?.compilerOptions?.paths,o=E(n,i.config?.compilerOptions?.baseUrl||`./`);if(a){for(let[e,n]of Object.entries(a))if(Array.isArray(n)&&n.length>0){let r=n[0],i=RegExp(`^${e.replace(`*`,`(.*)`).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`\\(\\*\\)`,`(.*)`)}$`),a=E(o,r.replace(`*`,`$1`));t.push({pattern:i,replacement:a})}}let s=i.config?.extends;if(s){let e=E(n,s);if(e.endsWith(`.json`)||(e+=`.json`),D(e)){let n=Xt(e);t.push(...n)}}}catch{return t}return t}function Zt(e,t){return t.some(t=>t.pattern.test(e))}function Qt(e,t){for(let n of t)if(n.pattern.test(e)){let t=e.replace(n.pattern,n.replacement),r=[`.ts`,`.js`];for(let e of r){let n=t+e;if(D(n))return n}for(let e of r){let n=T(t,`index${e}`);if(D(n))return n}return t}return null}function $t(e,t){let n=E(w(t),e);if(D(n))return n;if(!n.endsWith(`.html`)){let e=`${n}.html`;if(D(e))return e}return n}var q={AUTO:`\0virtual:qui-demo-scope/auto`,CONFIG:`\0virtual:qui-demo-scope/config`,PAGE_PREFIX:`\0virtual:qui-demo-scope/page:`},J=`@qualcomm-ui/mdx-vite/react-demo-plugin:`,en=[`useState`,`useEffect`,`useMemo`,`useCallback`,`useRef`,`useContext`,`createContext`,`forwardRef`,`memo`,`lazy`,`Suspense`,`Fragment`],tn=[`fs`,`path`,`url`,`util`,`os`,`crypto`,`events`,`stream`,`buffer`];function Y(e){let t=e.includes(`/`)?`/`:`\\`,n=e.substring(e.lastIndexOf(t),e.lastIndexOf(`.`));if(!n)throw Error(`Failed to create demo name for ${e}`);return Te(n)}async function X(e){try{return nn(await O(e,`utf-8`),e)}catch(t){return console.log(`${k.magenta.bold(J)} ${k.yellowBright(`Failed to parse`)} ${k.blueBright.bold(e)}:`,t),null}}function nn(e,t){let n=j.createSourceFile(t,e,j.ScriptTarget.Latest,!0,rn(t)),r=[],i=[];function a(e){if(j.isImportDeclaration(e)){let n=an(e,t);n&&(n.type===`relative`?i.push(n):r.push(n))}j.forEachChild(e,a)}return a(n),{relativeImports:i,thirdPartyImports:r}}function rn(e){return e.endsWith(`.tsx`)||e.endsWith(`.jsx`)?j.ScriptKind.TSX:j.ScriptKind.TS}function an(e,t){let n=e.moduleSpecifier;if(!j.isStringLiteral(n))return null;let r=n.text;if(e.importClause?.isTypeOnly)return null;let i=on(e.importClause);if(i.length===0)return null;if(cn(r))return{resolvedPath:sn(r,t),source:r,specifiers:i,type:`relative`};if(ln(r))return null;let a=un(t);if(fn(r,a)){let e=pn(r,a);if(e)return{resolvedPath:e,source:r,specifiers:i,type:`relative`}}return{source:r,specifiers:i,type:`thirdParty`}}function on(e){if(!e)return[];let t=[];return e.name&&t.push({imported:`default`,local:`default`}),e.namedBindings&&(j.isNamespaceImport(e.namedBindings)?t.push({imported:`*`,local:`*`}):j.isNamedImports(e.namedBindings)&&e.namedBindings.elements.forEach(e=>{if(!e.isTypeOnly){let n=e.propertyName?e.propertyName.text:e.name.text,r=e.name.text;t.push({imported:n,local:r})}})),t}function sn(e,t){let n=E(w(t),e),r=[`.ts`,`.tsx`,`.js`,`.jsx`];for(let e of r){let t=n+e;if(D(t))return t}for(let e of r){let t=T(n,`index${e}`);if(D(t))return t}return n}function cn(e){return e.startsWith(`./`)||e.startsWith(`../`)}function ln(e){return e.startsWith(`node:`)||tn.includes(e)}function un(e){let t=w(e),n=[];for(;t!==w(t);){let e=T(t,`tsconfig.json`);if(D(e))try{let r=j.sys.readFile(e);if(!r){t=w(t);continue}let i=j.parseConfigFileTextToJson(e,r);if(i.error){t=w(t);continue}let a=i.config?.compilerOptions?.paths,o=i.config?.compilerOptions?.baseUrl||`./`,s=E(t,o);if(a){for(let[e,t]of Object.entries(a))if(Array.isArray(t)&&t.length>0){let r=t[0],i=RegExp(`^${e.replace(`*`,`(.*)`).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`\\(\\*\\)`,`(.*)`)}$`),a=E(s,r.replace(`*`,`$1`));n.push({pattern:i,replacement:a})}}let c=i.config?.extends;if(c){let e=dn(E(t,c));n.push(...e)}return n}catch{t=w(t);continue}t=w(t)}return n}function dn(e){let t=[],n=w(e);try{let r=j.sys.readFile(e);if(!r)return t;let i=j.parseConfigFileTextToJson(e,r);if(i.error)return t;let a=i.config?.compilerOptions?.paths,o=E(n,i.config?.compilerOptions?.baseUrl||`./`);if(a){for(let[e,n]of Object.entries(a))if(Array.isArray(n)&&n.length>0){let r=n[0],i=RegExp(`^${e.replace(`*`,`(.*)`).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(`\\(\\*\\)`,`(.*)`)}$`),a=E(o,r.replace(`*`,`$1`));t.push({pattern:i,replacement:a})}}let s=i.config?.extends;if(s){let e=E(n,s);if(e.endsWith(`.json`)||(e+=`.json`),D(e)){let n=dn(e);t.push(...n)}}}catch{return t}return t}function fn(e,t){return t.some(t=>t.pattern.test(e))}function pn(e,t){for(let n of t)if(n.pattern.test(e)){let t=e.replace(n.pattern,n.replacement),r=[`.ts`,`.tsx`,`.js`,`.jsx`];for(let e of r){let n=t+e;if(D(n))return n}for(let e of r){let n=T(t,`index${e}`);if(D(n))return n}return t}return null}function mn(e,t){let n=de(t,e),r=n.split(fe);if(r.includes(`demos`)){let e=r.indexOf(`demos`);return r.slice(0,e).join(fe)}return w(n)}function hn(e){return e.endsWith(`.css`)}function gn(e){try{return e.includes(`/demos/`)&&e.endsWith(`.tsx`)&&!pe(e).includes(`export default`)}catch{return!1}}var Z=null,_n=!1,Q=new Map,vn=new Map,$=new Map;function yn({demoPattern:e=`src/routes/**/demos/*.tsx`,routesDir:t=`src/routes`,theme:n={dark:ye,light:`github-light-high-contrast`},transformers:r=[],transformLine:i,transformTailwindStyles:a}={}){let o={defaultColor:`light-dark()`,lang:`tsx`,themes:{dark:n.dark,light:n.light}};return{apply(e,t){return t.mode===`development`&&t.command===`serve`||t.mode===`production`&&t.command===`build`},async buildStart(){if(!Z&&!_n){_n=!0;try{Z=await Oe({langs:[`tsx`,`typescript`,`css`],themes:[n.dark,n.light]}),console.log(`${k.magenta.bold(J)} Shiki highlighter initialized`)}catch(e){console.warn(`${k.magenta.bold(J)} Failed to initialize highlighter:`,e)}finally{_n=!1}}await l()},async handleHotUpdate({file:e,modules:t,server:n}){if(hn(e))return t;if(e.endsWith(`.mdx`))return[];let r=[];if(gn(e))await s({filePath:e}),r.push(Y(e));else{let t=E(e),n=$.get(t);if(!n?.size)return[];for(let e of Array.from(n)){let t=Q.get(e);t&&(await s({filePath:t.filePath}),r.push(e))}}let i=n.moduleGraph.getModuleById(q.AUTO);i&&n.moduleGraph.invalidateModule(i);for(let e of r){let t=Q.get(e);t&&n.ws.send({data:t,event:`qui-demo:update`,type:`custom`})}return[]},load(e){if(e===q.AUTO)return u()},name:`auto-demo-scope`,resolveId(e){if(e===`virtual:qui-demo-scope/auto`)return q.AUTO},writeBundle(){console.log(`${k.blue.bold(J)} Successfully integrated ${k.green(Q.size)} component demos`)}};async function s({filePath:e}){let n=mn(e,t),r=Y(e),i=vn.get(n)??[];i.includes(e)||(i.push(e),vn.set(n,i));let a=await m(e);if(a){Q.set(r,{...a,demoName:r,pageId:n});let t=await X(e);if(t)for(let e of t.relativeImports){let t=$.get(e.resolvedPath)??new Set;t.add(r),$.set(e.resolvedPath,t)}}}async function c(e,t={}){let{extraTransformers:n=[],onResidualCss:i}=t;if(!Z)return{full:e};let s=null,c=[];if(a&&i){let e=await qt({onClassesDetected:e=>{t.onClassesDetected?.(e)},onResidualCss:i,styleFormat:`jsx`,styles:M`
|
|
46
46
|
@layer theme, base, components, utilities;
|
|
47
47
|
@import "tailwindcss/theme.css" layer(theme);
|
|
48
48
|
@import "tailwindcss/utilities.css" layer(utilities);
|
|
49
49
|
@import "@qualcomm-ui/tailwind-plugin/qui-strict.css";
|
|
50
|
-
`});c.push(e)}else n.length>0&&c.push(...n);try{let t=
|
|
50
|
+
`});c.push(e)}else n.length>0&&c.push(...n);try{let t=Z.codeToHtml(e,{...o,transformers:[...L(),...r,...c,kt({attributeName:`data-preview`,onComplete:e=>{s=e}}),Et({attributeName:`data-code`}),{enforce:`post`,name:`shiki-transformer-trim`,preprocess(e){return e.trim()}},...r]});return{full:t,preview:s?Tt(t):null}}catch(t){return console.warn(`${k.magenta.bold(J)} Failed to highlight code:`,t),{full:e}}}async function l(){if(Q.size)return;let n=(await he(e)).filter(gn);for(let e of n){let n=mn(e,t),r=vn.get(n)??[];r.push(e),vn.set(n,r);let i=await m(e);if(i){let t=Y(e);Q.set(t,{...i,pageId:n})}let a=await X(e);if(a)for(let t of a.relativeImports){let n=Y(e),r=$.get(t.resolvedPath)??new Set;r.add(n),$.set(t.resolvedPath,r)}}}function u(){let e=[`// Auto-generated demo scope resolver`,g(Q),ee()];return process.env.NODE_ENV===`development`&&e.push(d()),e.join(`
|
|
51
51
|
|
|
52
|
-
`)}function d(){return
|
|
52
|
+
`)}function d(){return M`
|
|
53
53
|
if (import.meta.hot) {
|
|
54
54
|
import.meta.hot.on("qui-demo:update", (data) => {
|
|
55
55
|
demoRegistry.set(data.demoName, data)
|
|
@@ -57,11 +57,11 @@ export function getAngularDemoInfo(demoId) {
|
|
|
57
57
|
}
|
|
58
58
|
`}function f(e){if(!i)return e;let t=[];for(let n of e.split(`
|
|
59
59
|
`))if(n.trim()){let e=i(n);e&&t.push(e)}else t.push(n);return t.join(`
|
|
60
|
-
`)}async function p(e,t){try{let n=
|
|
60
|
+
`)}async function p(e,t){try{let n=C(e),r=await c(t),i,o=!1,s;return a&&(i=await c(t,{onClassesDetected:e=>{o=e},onResidualCss:e=>{s=e}})),{residualRules:s,sourceCodeData:{fileName:n,filePath:e,highlighted:{full:r.full,preview:r.preview},highlightedInline:o&&i?{full:i.full,preview:i.preview}:void 0,type:`file`}}}catch{return null}}async function m(e){try{let t=await O(e,`utf-8`).then(f),n=h(t,e),r=[],i=new Map,a=await p(e,t);if(a&&(r.push(a.sourceCodeData),a.residualRules))for(let[e,t]of a.residualRules)i.set(e,t);let o=await X(e);if(o)for(let e of o.relativeImports)try{let t=await O(e.resolvedPath,`utf-8`).then(f),n=await p(e.resolvedPath,t);if(n&&(r.push(n.sourceCodeData),n.residualRules))for(let[e,t]of n.residualRules)i.set(e,t)}catch{console.debug(`Failed to process file`,e.resolvedPath)}let s=i.size>0?[...i.values()].join(`
|
|
61
61
|
|
|
62
|
-
`):void 0;return s&&r.push({fileName:`styles.css`,highlighted:await c(s),type:`residual-css`}),{demoName:
|
|
63
|
-
`&&n++,e.slice(t.start,n).trim()})}catch{return[]}}function
|
|
64
|
-
`)}\n])`}function
|
|
62
|
+
`):void 0;return s&&r.push({fileName:`styles.css`,highlighted:await c(s),type:`residual-css`}),{demoName:Y(e),fileName:a?.sourceCodeData.fileName||C(e),filePath:e,imports:n,sourceCode:r}}catch{return null}}function h(e,t){try{let n=j.createSourceFile(t,e,j.ScriptTarget.Latest,!0,rn(t)),r=[];function i(e){j.isImportDeclaration(e)&&r.push({end:e.getEnd(),start:e.getFullStart()}),j.forEachChild(e,i)}return i(n),r.map(t=>{let n=t.end;return e[n]===`
|
|
63
|
+
`&&n++,e.slice(t.start,n).trim()})}catch{return[]}}function g(e){return`const demoRegistry = new Map([\n${Array.from(e.entries()).map(([e,{fileName:t,imports:n,pageId:r,sourceCode:i}])=>` ["${e}", { fileName: "${t}", imports: ${JSON.stringify(n)}, pageId: "${r}", sourceCode: ${JSON.stringify(i)}, demoName: "${e}" }]`).join(`,
|
|
64
|
+
`)}\n])`}function ee(){return M`
|
|
65
65
|
export function getDemo(demoName) {
|
|
66
66
|
const demo = demoRegistry.get(demoName)
|
|
67
67
|
if (!demo) {
|
|
@@ -75,5 +75,5 @@ export function getAngularDemoInfo(demoId) {
|
|
|
75
75
|
}
|
|
76
76
|
return demo
|
|
77
77
|
}
|
|
78
|
-
`}}export{
|
|
78
|
+
`}}export{i as ConfigLoader,J as LOG_PREFIX,tn as NODE_BUILTINS,en as REACT_IMPORTS,q as VIRTUAL_MODULE_IDS,Yt as angularDemoPlugin,Y as createDemoName,X as extractFileImports,mn as extractPageId,vt as frontmatterHmrPlugin,n as getAlertIcon,At as getRehypePlugins,jt as getRemarkPlugins,rn as getScriptKind,L as getShikiTransformers,hn as isCssAsset,gn as isDemoFile,h as isSerializeJsxBlock,y as isSpoilerBlock,m as isStepBlock,mt as quiDocsPlugin,yn as reactDemoPlugin,ze as rehypeMdxCodeProps,Ct as rehypeSectionize,bt as rehypeSlug,o as remarkAlerts,r as remarkCodeTabs,c as remarkExtractMeta,be as remarkFrontmatter,se as remarkFrontmatterDescription,t as remarkFrontmatterInterpolation,s as remarkFrontmatterTitle,xe as remarkGfm,Be as remarkMdxFrontmatter,d as remarkRemoveJsx,ce as remarkRemoveMermaidCodeBlocks,le as remarkSelfLinkHeadings,l as remarkSerializeJsxKnowledge,S as remarkSerializeJsxRender,g as remarkSpoilers,ne as remarkSteps};
|
|
79
79
|
//# sourceMappingURL=index.js.map
|