@qualcomm-ui/mdx-common 1.0.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/LICENSE.txt ADDED
@@ -0,0 +1,31 @@
1
+ Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted (subject to the limitations in the
5
+ disclaimer below) provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above
11
+ copyright notice, this list of conditions and the following
12
+ disclaimer in the documentation and/or other materials provided
13
+ with the distribution.
14
+
15
+ * Neither the name of Qualcomm Technologies, Inc. nor the names of its
16
+ contributors may be used to endorse or promote products derived
17
+ from this software without specific prior written permission.
18
+
19
+ NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
20
+ GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
21
+ HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
22
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29
+ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,58 @@
1
+ export interface SourceCodeData {
2
+ fileName: string;
3
+ filePath?: string;
4
+ highlighted: {
5
+ full: string;
6
+ preview?: string;
7
+ };
8
+ raw: {
9
+ full: string;
10
+ preview: string;
11
+ withoutImports: string;
12
+ };
13
+ }
14
+ export interface ReactDemoData {
15
+ demoName: string;
16
+ errorMessage?: string;
17
+ fileName: string;
18
+ imports: string[];
19
+ pageId: string;
20
+ sourceCode: SourceCodeData[];
21
+ }
22
+ export interface ReactDemoWithScope extends ReactDemoData {
23
+ demoName: string;
24
+ scope: Record<string, any>;
25
+ }
26
+ export interface PreviewBlock {
27
+ content: string;
28
+ endLine: number;
29
+ startLine: number;
30
+ }
31
+ export interface AngularDemoInfo {
32
+ componentClass: string;
33
+ dimensions?: {
34
+ height: number;
35
+ };
36
+ filePath: string;
37
+ hasDefaultExport: boolean;
38
+ id: string;
39
+ imports: string[];
40
+ initialHtml?: string;
41
+ isStandalone: boolean;
42
+ lastModified: number;
43
+ pageId: string;
44
+ selector: string;
45
+ sourceCode: SourceCodeData[];
46
+ }
47
+ export interface PreviewContext {
48
+ content: string;
49
+ context: "template" | "typescript";
50
+ endLine: number;
51
+ startLine: number;
52
+ }
53
+ export interface ExtractedPreview {
54
+ formattedPreview?: string;
55
+ previewBlocks?: PreviewContext[];
56
+ sourceWithoutPreviews: string;
57
+ }
58
+ //# sourceMappingURL=demo-plugin.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-plugin.types.d.ts","sourceRoot":"","sources":["../src/demo-plugin.types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;K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M,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,cAAc,EAAE,CAAA;IAChC,qBAAqB,EAAE,MAAM,CAAA;CAC9B"}
@@ -0,0 +1,242 @@
1
+ import type { QuiPropDeclaration, QuiPropTypes } from "@qualcomm-ui/typedoc-common";
2
+ export interface PageHeading {
3
+ /**
4
+ * h1 is 1, h2 is 2, etc...
5
+ */
6
+ headingLevel: number;
7
+ /**
8
+ * Automatically generated, unique ID. Used to generate anchor links.
9
+ */
10
+ id: string;
11
+ /**
12
+ * Heading HTML tag.
13
+ */
14
+ tagName: string;
15
+ /**
16
+ * The text content of the heading.
17
+ */
18
+ textContent: string;
19
+ }
20
+ /**
21
+ * Page data, defined in each MDX file's {@link https://mdxjs.com/guides/frontmatter/ frontmatter} section.
22
+ *
23
+ * @docLink /api/page-frontmatter
24
+ *
25
+ * @public
26
+ */
27
+ export interface PageFrontmatter {
28
+ /**
29
+ * Override the categories used to render the breadcrumb labels. Note that this
30
+ * will only match up to the length of the route's path segments. If a route only
31
+ * has 1 path segment, and you supply 2 categories, only the first category will be
32
+ * accounted for.
33
+ */
34
+ categories?: string[];
35
+ /**
36
+ * Used for grouping pages at the same level under a common section heading.
37
+ */
38
+ group?: string;
39
+ /**
40
+ * If true, this route will not be shown in the side navigation or adjacent
41
+ * routes' page links.
42
+ */
43
+ hidden?: boolean;
44
+ /**
45
+ * If true, the breadcrumbs will not render on this route.
46
+ */
47
+ hideBreadcrumbs?: boolean;
48
+ /**
49
+ * If true, this page's contents will not be added to the search index.
50
+ */
51
+ hideFromSearch?: boolean;
52
+ /**
53
+ * If true, the page links will be hidden on this route.
54
+ */
55
+ hidePageLinks?: boolean;
56
+ /**
57
+ * If true, the side navigation will be hidden on this route.
58
+ */
59
+ hideSideNav?: boolean;
60
+ /**
61
+ * If true, the table of contents be hidden on this route.
62
+ */
63
+ hideToc?: boolean;
64
+ /**
65
+ * Optional id. Used to associate the page with its entry in the _meta.json.
66
+ */
67
+ id?: string;
68
+ /**
69
+ * If `true`, the route will be flagged as restricted. This flag does nothing
70
+ * internally. You will need to handle this in your application.
71
+ */
72
+ restricted?: boolean;
73
+ /**
74
+ * Title for the page in the side nav. Takes precedence over {@link title}.
75
+ */
76
+ sideNavTitle?: string;
77
+ /**
78
+ * The title of the page.
79
+ */
80
+ title: string;
81
+ }
82
+ export interface PageSectionContent {
83
+ /**
84
+ * The tagName of the HTML section.
85
+ */
86
+ tagName: string;
87
+ /**
88
+ * The text paragraphs of the indexed section.
89
+ */
90
+ text: string[];
91
+ }
92
+ /**
93
+ * The data structure of each linkable entity in the search index.
94
+ *
95
+ * @public
96
+ */
97
+ export interface PageSection extends PageFrontmatter {
98
+ /**
99
+ * The `Capital Case` transformed path segments.
100
+ */
101
+ categories: string[];
102
+ /**
103
+ * The text content of the indexed section.
104
+ */
105
+ content?: string;
106
+ /**
107
+ * The section content of the indexed section with a bit more metadata.
108
+ */
109
+ contentSections?: PageSectionContent[];
110
+ /**
111
+ * Text content of the {@link content}'s closest heading.
112
+ */
113
+ heading?: string;
114
+ /**
115
+ * Depth of the {@link content}'s closest heading.
116
+ */
117
+ headingLevel?: number;
118
+ /**
119
+ * The href to the page content with a # pointing to the nearest anchor tag.
120
+ */
121
+ href?: string;
122
+ /**
123
+ * The id of the page, typically the shortened filepath.
124
+ */
125
+ id: string;
126
+ /**
127
+ * For use with the experimental TypeDoc integration. If true, this content is
128
+ * part of a prop table.
129
+ */
130
+ isDocProp?: boolean;
131
+ /**
132
+ * The href to the page.
133
+ */
134
+ pathname: string;
135
+ /**
136
+ * The route path segments separated by `/`.
137
+ */
138
+ pathSegments: string[];
139
+ /**
140
+ * Page table of contents.
141
+ */
142
+ toc?: PageHeading[];
143
+ }
144
+ /**
145
+ * The PageMap is a record of the available routes in the application. Each key is
146
+ * the route's pathname.
147
+ *
148
+ * @public
149
+ */
150
+ export type PageMap = Record<string, PageSection>;
151
+ export interface NavItem {
152
+ /**
153
+ * The depth of the nav item. The root nav item starts at 1. Each child has n+1
154
+ * depth, where n is the depth of the parent item.
155
+ */
156
+ depth: number;
157
+ /**
158
+ * If `true`, the side nav item will be expanded on initial load. Does nothing if
159
+ * the entry is a page.
160
+ */
161
+ expanded?: boolean;
162
+ /**
163
+ * Used for grouping pages at the same level under a common section heading.
164
+ */
165
+ group?: string;
166
+ /**
167
+ * Path segment.
168
+ */
169
+ id: string;
170
+ items?: NavItem[];
171
+ /**
172
+ * The order of the item relative to other items at the same depth. If an item's
173
+ * order is not defined, it is unordered. Unordered items appear after ordered
174
+ * items. Unordered items are sorted alphabetically.
175
+ */
176
+ order?: number;
177
+ /**
178
+ * Pathname, only applicable to pages (not folders).
179
+ */
180
+ pathname?: string;
181
+ /**
182
+ * The route path segments.
183
+ */
184
+ pathSegments: string[];
185
+ /**
186
+ * Additional metadata to be used for filtering the nav tree.
187
+ */
188
+ searchMeta?: string[];
189
+ /**
190
+ * A label that renders above the item's content.
191
+ */
192
+ sectionTitle?: string;
193
+ /**
194
+ * Whether to render this item as a separator. If this property is supplied, a
195
+ * horizontal separator will be drawn and all content will be ignored.
196
+ */
197
+ separator?: boolean;
198
+ /**
199
+ * The title of the nav item, obtained from the _meta.json or the page's
200
+ * frontmatter.
201
+ */
202
+ title: string;
203
+ }
204
+ export type TocHeading = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
205
+ export type PagePropType = QuiPropDeclaration & {
206
+ id: string;
207
+ };
208
+ export type PagePropTypes = QuiPropTypes & {
209
+ input?: PagePropType[] | undefined;
210
+ output?: PagePropType[] | undefined;
211
+ props?: PagePropType[] | undefined;
212
+ publicMethods?: PagePropType[] | undefined;
213
+ };
214
+ export type PageDocProps = Record<string, PagePropTypes>;
215
+ export interface SiteData {
216
+ /**
217
+ * Nav items, typically used for the site's side navigation.
218
+ *
219
+ * @inheritDoc
220
+ */
221
+ navItems: NavItem[];
222
+ /**
223
+ * If QUI DocProps are detected on a page, they will be added to this array. The
224
+ * key is the route's pathname.
225
+ *
226
+ * @inheritDoc
227
+ */
228
+ pageDocProps?: PageDocProps;
229
+ /**
230
+ * The available routes in the application. Each key is
231
+ * the route's pathname.
232
+ *
233
+ * @inheritDoc
234
+ */
235
+ pageMap: PageMap;
236
+ /**
237
+ * A compiled array of page content, separated by each heading's individual
238
+ * segments of text content.
239
+ */
240
+ searchIndex: PageSection[];
241
+ }
242
+ //# sourceMappingURL=docs-plugin.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-plugin.types.d.ts","sourceRoot":"","sources":["../src/docs-plugin.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACb,MAAM,6BAA6B,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAA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,EAAE,MAAM,EAAE,CAAA;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,CAAA;AAE5D,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IACzC,KAAK,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;IACnC,KAAK,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;IAClC,aAAa,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAExD,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,EAAE,CAAA;IAEnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAA;IAE3B;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB;;;OAGG;IACH,WAAW,EAAE,WAAW,EAAE,CAAA;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export * from "@qualcomm-ui/typedoc-common";
2
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAGA,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./unique-id-service";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/id-service/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,7 @@
1
+ export declare class UniqueIdService {
2
+ pathname: string;
3
+ private idMap;
4
+ reset(): void;
5
+ add(idParam: string): string;
6
+ }
7
+ //# sourceMappingURL=unique-id-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unique-id-service.d.ts","sourceRoot":"","sources":["../../src/id-service/unique-id-service.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IAC1B,QAAQ,EAAE,MAAM,CAAK;IACrB,OAAO,CAAC,KAAK,CAA6B;IAE1C,KAAK;IAIL,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAW7B"}
@@ -0,0 +1,6 @@
1
+ export type * from "./demo-plugin.types";
2
+ export type * from "./docs-plugin.types";
3
+ export * from "./id-service";
4
+ export * from "./search";
5
+ export * from "./shiki-themes";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,qBAAqB,CAAA;AACxC,mBAAmB,qBAAqB,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA"}