@ng-prism/plugin-jsdoc 21.12.0-beta.2 → 22.0.0-beta.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/README.md +42 -6
- package/dist/jsdoc-panel.component.d.ts +6 -1
- package/dist/jsdoc-panel.component.d.ts.map +1 -1
- package/dist/jsdoc-panel.component.js +175 -81
- package/dist/markdown.d.ts +8 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +22 -0
- package/dist/schematics/ng-add/index.d.ts +4 -0
- package/dist/schematics/ng-add/index.d.ts.map +1 -0
- package/dist/schematics/ng-add/index.js +25 -0
- package/dist/schematics/ng-add/schema.d.ts +4 -0
- package/dist/schematics/ng-add/schema.d.ts.map +1 -0
- package/dist/schematics/ng-add/schema.js +1 -0
- package/package.json +10 -4
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/schema.json +16 -0
package/README.md
CHANGED
|
@@ -12,12 +12,12 @@ npm install @ng-prism/plugin-jsdoc
|
|
|
12
12
|
|
|
13
13
|
### Peer Dependencies
|
|
14
14
|
|
|
15
|
-
| Package
|
|
16
|
-
|
|
17
|
-
| `@ng-prism/core`
|
|
18
|
-
| `@angular/core`
|
|
19
|
-
| `typescript`
|
|
20
|
-
| `highlight.js`
|
|
15
|
+
| Package | Version |
|
|
16
|
+
| ----------------- | ---------- |
|
|
17
|
+
| `@ng-prism/core` | `>=21.0.0` |
|
|
18
|
+
| `@angular/core` | `>=20.0.0` |
|
|
19
|
+
| `typescript` | `>=5.5.0` |
|
|
20
|
+
| `highlight.js` | `>=11.0.0` |
|
|
21
21
|
| `ngx-highlightjs` | `>=14.0.0` |
|
|
22
22
|
|
|
23
23
|
## Setup
|
|
@@ -42,6 +42,42 @@ export default defineConfig({
|
|
|
42
42
|
- Outputs table (name, description)
|
|
43
43
|
- Supported tags: `@deprecated`, `@since`, `@see`, `@example`
|
|
44
44
|
|
|
45
|
+
## Markdown Support
|
|
46
|
+
|
|
47
|
+
JSDoc descriptions are rendered as Markdown:
|
|
48
|
+
|
|
49
|
+
- Headings (`#`, `##`, `###`)
|
|
50
|
+
- Lists (ordered/unordered) and inline code (`` `code` ``)
|
|
51
|
+
- Bold (`**text**`), italic (`*text*`), and links (`[text](url)`)
|
|
52
|
+
- Fenced code blocks with a language hint (` ```html `, ` ```scss ` …)
|
|
53
|
+
|
|
54
|
+
Class descriptions are rendered as block Markdown; input/output/method descriptions are
|
|
55
|
+
rendered inline (no wrapping `<p>`). Existing plain-text descriptions keep working
|
|
56
|
+
unchanged — plain text is valid Markdown.
|
|
57
|
+
|
|
58
|
+
````typescript
|
|
59
|
+
/**
|
|
60
|
+
* Loading spinner component.
|
|
61
|
+
*
|
|
62
|
+
* ## Size
|
|
63
|
+
*
|
|
64
|
+
* - `small` (4px) — inline indicators
|
|
65
|
+
* - `large` (9px, default) — section-level loading
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```html
|
|
69
|
+
* <sgui-loading size="small" color="light" />
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
````
|
|
73
|
+
|
|
74
|
+
`@example` blocks accept a fenced code block with a language hint. The language is
|
|
75
|
+
passed through to `ngx-highlightjs` (`html`, `scss`, `typescript`, …). Examples without
|
|
76
|
+
fences fall back to `typescript` for backwards compatibility. Make sure the languages
|
|
77
|
+
you reference are registered with `highlight.js` in your app — `highlight.js`'s core
|
|
78
|
+
language set is loaded by default, but additional languages must be registered
|
|
79
|
+
explicitly by the consumer.
|
|
80
|
+
|
|
45
81
|
## Example
|
|
46
82
|
|
|
47
83
|
```typescript
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
1
2
|
import type { InputMeta, OutputMeta } from '@ng-prism/core/plugin';
|
|
2
3
|
import type { JsDocData, MethodDoc } from './jsdoc.types.js';
|
|
4
|
+
import { type ParsedExample } from './markdown.js';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
export declare class JsDocPanelComponent {
|
|
5
7
|
readonly activeComponent: import("@angular/core").InputSignal<unknown>;
|
|
8
|
+
private readonly sanitizer;
|
|
6
9
|
protected readonly jsdocData: import("@angular/core").Signal<JsDocData | null>;
|
|
7
10
|
protected readonly inputs: import("@angular/core").Signal<InputMeta[]>;
|
|
8
11
|
protected readonly outputs: import("@angular/core").Signal<OutputMeta[]>;
|
|
9
12
|
protected readonly classDescription: import("@angular/core").Signal<string | undefined>;
|
|
13
|
+
protected readonly renderedClassDescription: import("@angular/core").Signal<SafeHtml | null>;
|
|
10
14
|
protected readonly classTags: import("@angular/core").Signal<import("./jsdoc.types.js").JsDocTags>;
|
|
11
15
|
protected readonly isDeprecated: import("@angular/core").Signal<boolean>;
|
|
12
16
|
protected readonly deprecatedMessage: import("@angular/core").Signal<string | undefined>;
|
|
@@ -18,7 +22,8 @@ export declare class JsDocPanelComponent {
|
|
|
18
22
|
protected readonly hasTags: import("@angular/core").Signal<boolean>;
|
|
19
23
|
protected isMemberDeprecated(name: string): boolean;
|
|
20
24
|
protected getMemberSince(name: string): string | undefined;
|
|
21
|
-
protected
|
|
25
|
+
protected renderInline(text: string | undefined): SafeHtml;
|
|
26
|
+
protected parseExample(raw: string): ParsedExample;
|
|
22
27
|
protected formatDefault(value: unknown): string;
|
|
23
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsDocPanelComponent, never>;
|
|
24
29
|
static ɵcmp: i0.ɵɵComponentDeclaration<JsDocPanelComponent, "prism-jsdoc-panel", never, { "activeComponent": { "alias": "activeComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc-panel.component.d.ts","sourceRoot":"","sources":["../src/jsdoc-panel.component.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;;
|
|
1
|
+
{"version":3,"file":"jsdoc-panel.component.d.ts","sourceRoot":"","sources":["../src/jsdoc-panel.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;;AAEvB,qBAuYa,mBAAmB;IAC9B,QAAQ,CAAC,eAAe,+CAAwB;IAEhD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;IAElD,SAAS,CAAC,QAAQ,CAAC,SAAS,mDAGzB;IAEH,SAAS,CAAC,QAAQ,CAAC,MAAM,8CAGtB;IAEH,SAAS,CAAC,QAAQ,CAAC,OAAO,+CAGvB;IAEH,SAAS,CAAC,QAAQ,CAAC,gBAAgB,qDAEjC;IAIF,SAAS,CAAC,QAAQ,CAAC,wBAAwB,kDAKzC;IAEF,SAAS,CAAC,QAAQ,CAAC,SAAS,uEAE1B;IAEF,SAAS,CAAC,QAAQ,CAAC,YAAY,0CAE7B;IAEF,SAAS,CAAC,QAAQ,CAAC,iBAAiB,qDAGjC;IAEH,SAAS,CAAC,QAAQ,CAAC,KAAK,qDAA0C;IAElE,SAAS,CAAC,QAAQ,CAAC,OAAO,qDAA4C;IAEtE,SAAS,CAAC,QAAQ,CAAC,OAAO,2CAA8C;IAExE,SAAS,CAAC,QAAQ,CAAC,QAAQ,2CAAkD;IAE7E,SAAS,CAAC,QAAQ,CAAC,OAAO,8CAExB;IAEF,SAAS,CAAC,QAAQ,CAAC,OAAO,0CAMxB;IAEF,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAInD,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI1D,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ;IAI1D,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa;IAIlD,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;yCAlFpC,mBAAmB;2CAAnB,mBAAmB;CAsF/B"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
3
|
import { Highlight } from 'ngx-highlightjs';
|
|
4
|
+
import { parseExample, renderBlockMarkdown, renderInlineMarkdown, } from './markdown.js';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
const _forTrack0 = ($index, $item) => $item.name;
|
|
5
7
|
function JsDocPanelComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -8,13 +10,9 @@ function JsDocPanelComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
8
10
|
i0.ɵɵelementEnd();
|
|
9
11
|
} }
|
|
10
12
|
function JsDocPanelComponent_Conditional_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
-
i0.ɵɵ
|
|
12
|
-
i0.ɵɵtext(1);
|
|
13
|
-
i0.ɵɵelementEnd();
|
|
13
|
+
i0.ɵɵelement(0, "div", 2);
|
|
14
14
|
} if (rf & 2) {
|
|
15
|
-
|
|
16
|
-
i0.ɵɵadvance();
|
|
17
|
-
i0.ɵɵtextInterpolate(ctx_r0.classDescription());
|
|
15
|
+
i0.ɵɵproperty("innerHTML", ctx, i0.ɵɵsanitizeHtml);
|
|
18
16
|
} }
|
|
19
17
|
function JsDocPanelComponent_Conditional_2_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
20
18
|
i0.ɵɵelementStart(0, "span", 5);
|
|
@@ -82,14 +80,15 @@ function JsDocPanelComponent_Conditional_2_Conditional_2_For_4_Template(rf, ctx)
|
|
|
82
80
|
i0.ɵɵelementEnd();
|
|
83
81
|
} if (rf & 2) {
|
|
84
82
|
const example_r3 = ctx.$implicit;
|
|
83
|
+
const parsed_r4 = i0.ɵɵnextContext(3).parseExample(example_r3);
|
|
85
84
|
i0.ɵɵadvance();
|
|
86
|
-
i0.ɵɵproperty("highlight",
|
|
85
|
+
i0.ɵɵproperty("highlight", parsed_r4.code)("language", parsed_r4.lang);
|
|
87
86
|
} }
|
|
88
87
|
function JsDocPanelComponent_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
89
88
|
i0.ɵɵelementStart(0, "div", 4)(1, "h3", 8);
|
|
90
89
|
i0.ɵɵtext(2, "Examples");
|
|
91
90
|
i0.ɵɵelementEnd();
|
|
92
|
-
i0.ɵɵrepeaterCreate(3, JsDocPanelComponent_Conditional_2_Conditional_2_For_4_Template, 2,
|
|
91
|
+
i0.ɵɵrepeaterCreate(3, JsDocPanelComponent_Conditional_2_Conditional_2_For_4_Template, 2, 2, "pre", 9, i0.ɵɵrepeaterTrackByIndex);
|
|
93
92
|
i0.ɵɵelementEnd();
|
|
94
93
|
} if (rf & 2) {
|
|
95
94
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
@@ -106,10 +105,10 @@ function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_9_Te
|
|
|
106
105
|
i0.ɵɵtext(1);
|
|
107
106
|
i0.ɵɵelementEnd();
|
|
108
107
|
} if (rf & 2) {
|
|
109
|
-
const
|
|
108
|
+
const inp_r5 = i0.ɵɵnextContext().$implicit;
|
|
110
109
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
111
110
|
i0.ɵɵadvance();
|
|
112
|
-
i0.ɵɵtextInterpolate(ctx_r0.formatDefault(
|
|
111
|
+
i0.ɵɵtextInterpolate(ctx_r0.formatDefault(inp_r5.defaultValue));
|
|
113
112
|
} }
|
|
114
113
|
function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
115
114
|
i0.ɵɵelementStart(0, "span", 17);
|
|
@@ -126,6 +125,29 @@ function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_13_T
|
|
|
126
125
|
i0.ɵɵtext(1, "\u2014");
|
|
127
126
|
i0.ɵɵelementEnd();
|
|
128
127
|
} }
|
|
128
|
+
function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
129
|
+
i0.ɵɵelement(0, "span", 21);
|
|
130
|
+
} if (rf & 2) {
|
|
131
|
+
const inp_r5 = i0.ɵɵnextContext().$implicit;
|
|
132
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
133
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.renderInline(inp_r5.doc), i0.ɵɵsanitizeHtml);
|
|
134
|
+
} }
|
|
135
|
+
function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_16_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
136
|
+
i0.ɵɵelementStart(0, "span", 22);
|
|
137
|
+
i0.ɵɵtext(1, " \u00B7 ");
|
|
138
|
+
i0.ɵɵelementEnd();
|
|
139
|
+
} }
|
|
140
|
+
function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
141
|
+
i0.ɵɵconditionalCreate(0, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_16_Conditional_0_Template, 2, 0, "span", 22);
|
|
142
|
+
i0.ɵɵelementStart(1, "span", 23);
|
|
143
|
+
i0.ɵɵtext(2);
|
|
144
|
+
i0.ɵɵelementEnd();
|
|
145
|
+
} if (rf & 2) {
|
|
146
|
+
const inp_r5 = i0.ɵɵnextContext().$implicit;
|
|
147
|
+
i0.ɵɵconditional(inp_r5.doc ? 0 : -1);
|
|
148
|
+
i0.ɵɵadvance(2);
|
|
149
|
+
i0.ɵɵtextInterpolate1("Since ", ctx);
|
|
150
|
+
} }
|
|
129
151
|
function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Template(rf, ctx) { if (rf & 1) {
|
|
130
152
|
i0.ɵɵelementStart(0, "tr")(1, "td", 13)(2, "code");
|
|
131
153
|
i0.ɵɵtext(3);
|
|
@@ -142,24 +164,28 @@ function JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Template(rf, ctx
|
|
|
142
164
|
i0.ɵɵconditionalCreate(12, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_12_Template, 2, 0, "span", 19)(13, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_13_Template, 2, 0, "span", 17);
|
|
143
165
|
i0.ɵɵelementEnd();
|
|
144
166
|
i0.ɵɵelementStart(14, "td", 20);
|
|
145
|
-
i0.ɵɵ
|
|
167
|
+
i0.ɵɵconditionalCreate(15, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_15_Template, 1, 1, "span", 21);
|
|
168
|
+
i0.ɵɵconditionalCreate(16, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Conditional_16_Template, 3, 2);
|
|
146
169
|
i0.ɵɵelementEnd()();
|
|
147
170
|
} if (rf & 2) {
|
|
148
|
-
|
|
171
|
+
let tmp_19_0;
|
|
172
|
+
const inp_r5 = ctx.$implicit;
|
|
149
173
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
150
|
-
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", ctx_r0.isMemberDeprecated(
|
|
174
|
+
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", ctx_r0.isMemberDeprecated(inp_r5.name));
|
|
151
175
|
i0.ɵɵadvance(3);
|
|
152
|
-
i0.ɵɵtextInterpolate(
|
|
176
|
+
i0.ɵɵtextInterpolate(inp_r5.name);
|
|
153
177
|
i0.ɵɵadvance();
|
|
154
|
-
i0.ɵɵconditional(ctx_r0.isMemberDeprecated(
|
|
178
|
+
i0.ɵɵconditional(ctx_r0.isMemberDeprecated(inp_r5.name) ? 4 : -1);
|
|
155
179
|
i0.ɵɵadvance(3);
|
|
156
|
-
i0.ɵɵtextInterpolate(
|
|
180
|
+
i0.ɵɵtextInterpolate(inp_r5.rawType ?? inp_r5.type);
|
|
157
181
|
i0.ɵɵadvance(2);
|
|
158
|
-
i0.ɵɵconditional(
|
|
182
|
+
i0.ɵɵconditional(inp_r5.defaultValue !== undefined ? 9 : 10);
|
|
159
183
|
i0.ɵɵadvance(3);
|
|
160
|
-
i0.ɵɵconditional(
|
|
184
|
+
i0.ɵɵconditional(inp_r5.required ? 12 : 13);
|
|
161
185
|
i0.ɵɵadvance(3);
|
|
162
|
-
i0.ɵɵ
|
|
186
|
+
i0.ɵɵconditional(inp_r5.doc ? 15 : -1);
|
|
187
|
+
i0.ɵɵadvance();
|
|
188
|
+
i0.ɵɵconditional((tmp_19_0 = ctx_r0.getMemberSince(inp_r5.name)) ? 16 : -1, tmp_19_0);
|
|
163
189
|
} }
|
|
164
190
|
function JsDocPanelComponent_Conditional_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
165
191
|
i0.ɵɵelementStart(0, "div", 4)(1, "h3", 8);
|
|
@@ -181,7 +207,7 @@ function JsDocPanelComponent_Conditional_2_Conditional_3_Template(rf, ctx) { if
|
|
|
181
207
|
i0.ɵɵtext(15, "Description");
|
|
182
208
|
i0.ɵɵelementEnd()()();
|
|
183
209
|
i0.ɵɵelementStart(16, "tbody");
|
|
184
|
-
i0.ɵɵrepeaterCreate(17, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Template,
|
|
210
|
+
i0.ɵɵrepeaterCreate(17, JsDocPanelComponent_Conditional_2_Conditional_3_For_18_Template, 17, 9, "tr", 12, _forTrack0);
|
|
185
211
|
i0.ɵɵelementEnd()()();
|
|
186
212
|
} if (rf & 2) {
|
|
187
213
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
@@ -193,6 +219,29 @@ function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_4_Te
|
|
|
193
219
|
i0.ɵɵtext(1, "deprecated");
|
|
194
220
|
i0.ɵɵelementEnd();
|
|
195
221
|
} }
|
|
222
|
+
function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
223
|
+
i0.ɵɵelement(0, "span", 21);
|
|
224
|
+
} if (rf & 2) {
|
|
225
|
+
const out_r6 = i0.ɵɵnextContext().$implicit;
|
|
226
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
227
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.renderInline(out_r6.doc), i0.ɵɵsanitizeHtml);
|
|
228
|
+
} }
|
|
229
|
+
function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_7_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
230
|
+
i0.ɵɵelementStart(0, "span", 22);
|
|
231
|
+
i0.ɵɵtext(1, " \u00B7 ");
|
|
232
|
+
i0.ɵɵelementEnd();
|
|
233
|
+
} }
|
|
234
|
+
function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
235
|
+
i0.ɵɵconditionalCreate(0, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_7_Conditional_0_Template, 2, 0, "span", 22);
|
|
236
|
+
i0.ɵɵelementStart(1, "span", 23);
|
|
237
|
+
i0.ɵɵtext(2);
|
|
238
|
+
i0.ɵɵelementEnd();
|
|
239
|
+
} if (rf & 2) {
|
|
240
|
+
const out_r6 = i0.ɵɵnextContext().$implicit;
|
|
241
|
+
i0.ɵɵconditional(out_r6.doc ? 0 : -1);
|
|
242
|
+
i0.ɵɵadvance(2);
|
|
243
|
+
i0.ɵɵtextInterpolate1("Since ", ctx);
|
|
244
|
+
} }
|
|
196
245
|
function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Template(rf, ctx) { if (rf & 1) {
|
|
197
246
|
i0.ɵɵelementStart(0, "tr")(1, "td", 13)(2, "code");
|
|
198
247
|
i0.ɵɵtext(3);
|
|
@@ -200,18 +249,22 @@ function JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Template(rf, ctx
|
|
|
200
249
|
i0.ɵɵconditionalCreate(4, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_4_Template, 2, 0, "span", 14);
|
|
201
250
|
i0.ɵɵelementEnd();
|
|
202
251
|
i0.ɵɵelementStart(5, "td", 20);
|
|
203
|
-
i0.ɵɵ
|
|
252
|
+
i0.ɵɵconditionalCreate(6, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_6_Template, 1, 1, "span", 21);
|
|
253
|
+
i0.ɵɵconditionalCreate(7, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Conditional_7_Template, 3, 2);
|
|
204
254
|
i0.ɵɵelementEnd()();
|
|
205
255
|
} if (rf & 2) {
|
|
206
|
-
|
|
256
|
+
let tmp_16_0;
|
|
257
|
+
const out_r6 = ctx.$implicit;
|
|
207
258
|
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
208
|
-
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", ctx_r0.isMemberDeprecated(
|
|
259
|
+
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", ctx_r0.isMemberDeprecated(out_r6.name));
|
|
209
260
|
i0.ɵɵadvance(3);
|
|
210
|
-
i0.ɵɵtextInterpolate(
|
|
261
|
+
i0.ɵɵtextInterpolate(out_r6.name);
|
|
211
262
|
i0.ɵɵadvance();
|
|
212
|
-
i0.ɵɵconditional(ctx_r0.isMemberDeprecated(
|
|
263
|
+
i0.ɵɵconditional(ctx_r0.isMemberDeprecated(out_r6.name) ? 4 : -1);
|
|
213
264
|
i0.ɵɵadvance(2);
|
|
214
|
-
i0.ɵɵ
|
|
265
|
+
i0.ɵɵconditional(out_r6.doc ? 6 : -1);
|
|
266
|
+
i0.ɵɵadvance();
|
|
267
|
+
i0.ɵɵconditional((tmp_16_0 = ctx_r0.getMemberSince(out_r6.name)) ? 7 : -1, tmp_16_0);
|
|
215
268
|
} }
|
|
216
269
|
function JsDocPanelComponent_Conditional_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
217
270
|
i0.ɵɵelementStart(0, "div", 4)(1, "h3", 8);
|
|
@@ -224,7 +277,7 @@ function JsDocPanelComponent_Conditional_2_Conditional_4_Template(rf, ctx) { if
|
|
|
224
277
|
i0.ɵɵtext(9, "Description");
|
|
225
278
|
i0.ɵɵelementEnd()()();
|
|
226
279
|
i0.ɵɵelementStart(10, "tbody");
|
|
227
|
-
i0.ɵɵrepeaterCreate(11, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Template,
|
|
280
|
+
i0.ɵɵrepeaterCreate(11, JsDocPanelComponent_Conditional_2_Conditional_4_For_12_Template, 8, 6, "tr", 12, _forTrack0);
|
|
228
281
|
i0.ɵɵelementEnd()()();
|
|
229
282
|
} if (rf & 2) {
|
|
230
283
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
@@ -241,15 +294,15 @@ function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_6_Fo
|
|
|
241
294
|
i0.ɵɵtext(2);
|
|
242
295
|
i0.ɵɵelementEnd()();
|
|
243
296
|
} if (rf & 2) {
|
|
244
|
-
const
|
|
297
|
+
const p_r7 = ctx.$implicit;
|
|
245
298
|
i0.ɵɵadvance(2);
|
|
246
|
-
i0.ɵɵtextInterpolate2("",
|
|
299
|
+
i0.ɵɵtextInterpolate2("", p_r7.name, "", p_r7.type ? ": " + p_r7.type : "");
|
|
247
300
|
} }
|
|
248
301
|
function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
249
302
|
i0.ɵɵrepeaterCreate(0, JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_6_For_1_Template, 3, 2, "div", null, _forTrack0);
|
|
250
303
|
} if (rf & 2) {
|
|
251
|
-
const
|
|
252
|
-
i0.ɵɵrepeater(
|
|
304
|
+
const method_r8 = i0.ɵɵnextContext().$implicit;
|
|
305
|
+
i0.ɵɵrepeater(method_r8.params);
|
|
253
306
|
} }
|
|
254
307
|
function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
255
308
|
i0.ɵɵelementStart(0, "span", 17);
|
|
@@ -261,15 +314,22 @@ function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_9_Te
|
|
|
261
314
|
i0.ɵɵtext(1);
|
|
262
315
|
i0.ɵɵelementEnd();
|
|
263
316
|
} if (rf & 2) {
|
|
264
|
-
const
|
|
317
|
+
const method_r8 = i0.ɵɵnextContext().$implicit;
|
|
265
318
|
i0.ɵɵadvance();
|
|
266
|
-
i0.ɵɵtextInterpolate(
|
|
319
|
+
i0.ɵɵtextInterpolate(method_r8.returnType);
|
|
267
320
|
} }
|
|
268
321
|
function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
269
322
|
i0.ɵɵelementStart(0, "span", 17);
|
|
270
323
|
i0.ɵɵtext(1, "void");
|
|
271
324
|
i0.ɵɵelementEnd();
|
|
272
325
|
} }
|
|
326
|
+
function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
327
|
+
i0.ɵɵelement(0, "span", 21);
|
|
328
|
+
} if (rf & 2) {
|
|
329
|
+
const method_r8 = i0.ɵɵnextContext().$implicit;
|
|
330
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
331
|
+
i0.ɵɵproperty("innerHTML", ctx_r0.renderInline(method_r8.description), i0.ɵɵsanitizeHtml);
|
|
332
|
+
} }
|
|
273
333
|
function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Template(rf, ctx) { if (rf & 1) {
|
|
274
334
|
i0.ɵɵelementStart(0, "tr")(1, "td", 13)(2, "code");
|
|
275
335
|
i0.ɵɵtext(3);
|
|
@@ -283,21 +343,21 @@ function JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Template(rf, ctx
|
|
|
283
343
|
i0.ɵɵconditionalCreate(9, JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_9_Template, 2, 1, "code")(10, JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_10_Template, 2, 0, "span", 17);
|
|
284
344
|
i0.ɵɵelementEnd();
|
|
285
345
|
i0.ɵɵelementStart(11, "td", 20);
|
|
286
|
-
i0.ɵɵ
|
|
346
|
+
i0.ɵɵconditionalCreate(12, JsDocPanelComponent_Conditional_2_Conditional_5_For_16_Conditional_12_Template, 1, 1, "span", 21);
|
|
287
347
|
i0.ɵɵelementEnd()();
|
|
288
348
|
} if (rf & 2) {
|
|
289
|
-
const
|
|
290
|
-
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", !!
|
|
349
|
+
const method_r8 = ctx.$implicit;
|
|
350
|
+
i0.ɵɵclassProp("prism-jsdoc-panel__row--deprecated", !!method_r8.tags.deprecated);
|
|
291
351
|
i0.ɵɵadvance(3);
|
|
292
|
-
i0.ɵɵtextInterpolate1("",
|
|
352
|
+
i0.ɵɵtextInterpolate1("", method_r8.name, "()");
|
|
293
353
|
i0.ɵɵadvance();
|
|
294
|
-
i0.ɵɵconditional(
|
|
354
|
+
i0.ɵɵconditional(method_r8.tags.deprecated ? 4 : -1);
|
|
295
355
|
i0.ɵɵadvance(2);
|
|
296
|
-
i0.ɵɵconditional(
|
|
356
|
+
i0.ɵɵconditional(method_r8.params.length ? 6 : 7);
|
|
297
357
|
i0.ɵɵadvance(3);
|
|
298
|
-
i0.ɵɵconditional(
|
|
358
|
+
i0.ɵɵconditional(method_r8.returnType ? 9 : 10);
|
|
299
359
|
i0.ɵɵadvance(3);
|
|
300
|
-
i0.ɵɵ
|
|
360
|
+
i0.ɵɵconditional(method_r8.description ? 12 : -1);
|
|
301
361
|
} }
|
|
302
362
|
function JsDocPanelComponent_Conditional_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
303
363
|
i0.ɵɵelementStart(0, "div", 4)(1, "h3", 8);
|
|
@@ -324,15 +384,16 @@ function JsDocPanelComponent_Conditional_2_Conditional_5_Template(rf, ctx) { if
|
|
|
324
384
|
i0.ɵɵrepeater(ctx_r0.methods());
|
|
325
385
|
} }
|
|
326
386
|
function JsDocPanelComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
327
|
-
i0.ɵɵconditionalCreate(0, JsDocPanelComponent_Conditional_2_Conditional_0_Template,
|
|
387
|
+
i0.ɵɵconditionalCreate(0, JsDocPanelComponent_Conditional_2_Conditional_0_Template, 1, 1, "div", 2);
|
|
328
388
|
i0.ɵɵconditionalCreate(1, JsDocPanelComponent_Conditional_2_Conditional_1_Template, 6, 3, "div", 3);
|
|
329
389
|
i0.ɵɵconditionalCreate(2, JsDocPanelComponent_Conditional_2_Conditional_2_Template, 5, 0, "div", 4);
|
|
330
390
|
i0.ɵɵconditionalCreate(3, JsDocPanelComponent_Conditional_2_Conditional_3_Template, 19, 0, "div", 4);
|
|
331
391
|
i0.ɵɵconditionalCreate(4, JsDocPanelComponent_Conditional_2_Conditional_4_Template, 13, 0, "div", 4);
|
|
332
392
|
i0.ɵɵconditionalCreate(5, JsDocPanelComponent_Conditional_2_Conditional_5_Template, 17, 0, "div", 4);
|
|
333
393
|
} if (rf & 2) {
|
|
394
|
+
let tmp_1_0;
|
|
334
395
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
335
|
-
i0.ɵɵconditional(ctx_r0.
|
|
396
|
+
i0.ɵɵconditional((tmp_1_0 = ctx_r0.renderedClassDescription()) ? 0 : -1, tmp_1_0);
|
|
336
397
|
i0.ɵɵadvance();
|
|
337
398
|
i0.ɵɵconditional(ctx_r0.hasTags() ? 1 : -1);
|
|
338
399
|
i0.ɵɵadvance();
|
|
@@ -345,46 +406,68 @@ function JsDocPanelComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
345
406
|
i0.ɵɵconditional(ctx_r0.methods().length ? 5 : -1);
|
|
346
407
|
} }
|
|
347
408
|
export class JsDocPanelComponent {
|
|
348
|
-
activeComponent = input(null,
|
|
409
|
+
activeComponent = input(null, /* @ts-ignore */
|
|
410
|
+
...(ngDevMode ? [{ debugName: "activeComponent" }] : /* istanbul ignore next */ []));
|
|
411
|
+
sanitizer = inject(DomSanitizer);
|
|
349
412
|
jsdocData = computed(() => {
|
|
350
413
|
const comp = this.activeComponent();
|
|
351
414
|
return comp?.meta?.showcaseConfig?.meta?.['jsdoc'] ?? null;
|
|
352
|
-
},
|
|
415
|
+
}, /* @ts-ignore */
|
|
416
|
+
...(ngDevMode ? [{ debugName: "jsdocData" }] : /* istanbul ignore next */ []));
|
|
353
417
|
inputs = computed(() => {
|
|
354
418
|
const comp = this.activeComponent();
|
|
355
419
|
return comp?.meta?.inputs ?? [];
|
|
356
|
-
},
|
|
420
|
+
}, /* @ts-ignore */
|
|
421
|
+
...(ngDevMode ? [{ debugName: "inputs" }] : /* istanbul ignore next */ []));
|
|
357
422
|
outputs = computed(() => {
|
|
358
423
|
const comp = this.activeComponent();
|
|
359
424
|
return comp?.meta?.outputs ?? [];
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
425
|
+
}, /* @ts-ignore */
|
|
426
|
+
...(ngDevMode ? [{ debugName: "outputs" }] : /* istanbul ignore next */ []));
|
|
427
|
+
classDescription = computed(() => this.jsdocData()?.classDescription, /* @ts-ignore */
|
|
428
|
+
...(ngDevMode ? [{ debugName: "classDescription" }] : /* istanbul ignore next */ []));
|
|
429
|
+
// Source is component-author JSDoc compiled into the manifest at build time,
|
|
430
|
+
// not user input — bypassing sanitization is safe here.
|
|
431
|
+
renderedClassDescription = computed(() => {
|
|
432
|
+
const html = renderBlockMarkdown(this.classDescription());
|
|
433
|
+
return html ? this.sanitizer.bypassSecurityTrustHtml(html) : null;
|
|
434
|
+
}, /* @ts-ignore */
|
|
435
|
+
...(ngDevMode ? [{ debugName: "renderedClassDescription" }] : /* istanbul ignore next */ []));
|
|
436
|
+
classTags = computed(() => this.jsdocData()?.classTags ?? {}, /* @ts-ignore */
|
|
437
|
+
...(ngDevMode ? [{ debugName: "classTags" }] : /* istanbul ignore next */ []));
|
|
438
|
+
isDeprecated = computed(() => !!this.classTags().deprecated, /* @ts-ignore */
|
|
439
|
+
...(ngDevMode ? [{ debugName: "isDeprecated" }] : /* istanbul ignore next */ []));
|
|
364
440
|
deprecatedMessage = computed(() => {
|
|
365
441
|
const d = this.classTags().deprecated;
|
|
366
442
|
return typeof d === 'string' ? d : undefined;
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
443
|
+
}, /* @ts-ignore */
|
|
444
|
+
...(ngDevMode ? [{ debugName: "deprecatedMessage" }] : /* istanbul ignore next */ []));
|
|
445
|
+
since = computed(() => this.classTags().since, /* @ts-ignore */
|
|
446
|
+
...(ngDevMode ? [{ debugName: "since" }] : /* istanbul ignore next */ []));
|
|
447
|
+
version = computed(() => this.classTags().version, /* @ts-ignore */
|
|
448
|
+
...(ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []));
|
|
449
|
+
seeRefs = computed(() => this.classTags().see ?? [], /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "seeRefs" }] : /* istanbul ignore next */ []));
|
|
451
|
+
examples = computed(() => this.classTags().example ?? [], /* @ts-ignore */
|
|
452
|
+
...(ngDevMode ? [{ debugName: "examples" }] : /* istanbul ignore next */ []));
|
|
453
|
+
methods = computed(() => this.jsdocData()?.methods ?? [], /* @ts-ignore */
|
|
454
|
+
...(ngDevMode ? [{ debugName: "methods" }] : /* istanbul ignore next */ []));
|
|
455
|
+
hasTags = computed(() => this.isDeprecated() ||
|
|
456
|
+
!!this.since() ||
|
|
457
|
+
!!this.version() ||
|
|
458
|
+
this.seeRefs().length > 0, /* @ts-ignore */
|
|
459
|
+
...(ngDevMode ? [{ debugName: "hasTags" }] : /* istanbul ignore next */ []));
|
|
374
460
|
isMemberDeprecated(name) {
|
|
375
461
|
return !!this.jsdocData()?.memberTags[name]?.deprecated;
|
|
376
462
|
}
|
|
377
463
|
getMemberSince(name) {
|
|
378
464
|
return this.jsdocData()?.memberTags[name]?.since;
|
|
379
465
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (since)
|
|
386
|
-
parts.push(`Since ${since}`);
|
|
387
|
-
return parts.join(' · ');
|
|
466
|
+
renderInline(text) {
|
|
467
|
+
return this.sanitizer.bypassSecurityTrustHtml(renderInlineMarkdown(text));
|
|
468
|
+
}
|
|
469
|
+
parseExample(raw) {
|
|
470
|
+
return parseExample(raw);
|
|
388
471
|
}
|
|
389
472
|
formatDefault(value) {
|
|
390
473
|
if (typeof value === 'string')
|
|
@@ -392,14 +475,14 @@ export class JsDocPanelComponent {
|
|
|
392
475
|
return String(value);
|
|
393
476
|
}
|
|
394
477
|
static ɵfac = function JsDocPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JsDocPanelComponent)(); };
|
|
395
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JsDocPanelComponent, selectors: [["prism-jsdoc-panel"]], inputs: { activeComponent: [1, "activeComponent"] }, decls: 3, vars: 1, consts: [[1, "prism-jsdoc-panel"], [1, "prism-jsdoc-panel__empty"], [1, "prism-jsdoc-panel__description"], [1, "prism-jsdoc-panel__meta"], [1, "prism-jsdoc-panel__section"], [1, "prism-jsdoc-panel__badge", "prism-jsdoc-panel__badge--deprecated"], [1, "prism-jsdoc-panel__meta-item"], [1, "prism-jsdoc-panel__meta-label"], [1, "prism-jsdoc-panel__heading"], [1, "prism-jsdoc-panel__code"], [
|
|
478
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JsDocPanelComponent, selectors: [["prism-jsdoc-panel"]], inputs: { activeComponent: [1, "activeComponent"] }, decls: 3, vars: 1, consts: [[1, "prism-jsdoc-panel"], [1, "prism-jsdoc-panel__empty"], [1, "prism-jsdoc-panel__description", 3, "innerHTML"], [1, "prism-jsdoc-panel__meta"], [1, "prism-jsdoc-panel__section"], [1, "prism-jsdoc-panel__badge", "prism-jsdoc-panel__badge--deprecated"], [1, "prism-jsdoc-panel__meta-item"], [1, "prism-jsdoc-panel__meta-label"], [1, "prism-jsdoc-panel__heading"], [1, "prism-jsdoc-panel__code"], [3, "highlight", "language"], [1, "prism-jsdoc-panel__table"], [3, "prism-jsdoc-panel__row--deprecated"], [1, "prism-jsdoc-panel__cell--name"], [1, "prism-jsdoc-panel__badge", "prism-jsdoc-panel__badge--deprecated", "prism-jsdoc-panel__badge--small"], [1, "prism-jsdoc-panel__cell--type"], [1, "prism-jsdoc-panel__cell--default"], [1, "prism-jsdoc-panel__muted"], [1, "prism-jsdoc-panel__cell--required"], [1, "prism-jsdoc-panel__badge", "prism-jsdoc-panel__badge--required"], [1, "prism-jsdoc-panel__cell--doc"], [3, "innerHTML"], [1, "prism-jsdoc-panel__since-sep"], [1, "prism-jsdoc-panel__since"]], template: function JsDocPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
396
479
|
i0.ɵɵelementStart(0, "div", 0);
|
|
397
480
|
i0.ɵɵconditionalCreate(1, JsDocPanelComponent_Conditional_1_Template, 2, 0, "div", 1)(2, JsDocPanelComponent_Conditional_2_Template, 6, 6);
|
|
398
481
|
i0.ɵɵelementEnd();
|
|
399
482
|
} if (rf & 2) {
|
|
400
483
|
i0.ɵɵadvance();
|
|
401
484
|
i0.ɵɵconditional(!ctx.activeComponent() ? 1 : 2);
|
|
402
|
-
} }, dependencies: [Highlight], styles: ["[_nghost-%COMP%] { display: block; height: 100%; overflow: auto; }\n .prism-jsdoc-panel[_ngcontent-%COMP%] {\n padding: 20px 24px;\n max-width: 880px;\n font-family: var(--font-sans);\n font-size: var(--fs-md);\n color: var(--prism-text);\n }\n .prism-jsdoc-panel__empty[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center;\n min-height: 120px; color: var(--prism-text-muted);\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] {\n margin: 0 0 18px;\n font-size: 14px;\n line-height: 1.7;\n color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta[_ngcontent-%COMP%] {\n display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;\n }\n .prism-jsdoc-panel__meta-item[_ngcontent-%COMP%] {\n display: flex; align-items: center; gap: 6px;\n padding: 3px 9px; border-radius: 4px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n font-size: var(--fs-sm); color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta-label[_ngcontent-%COMP%] {\n font-weight: 500; color: var(--prism-primary);\n font-family: var(--font-mono);\n }\n .prism-jsdoc-panel__badge[_ngcontent-%COMP%] {\n display: inline-flex; align-items: center;\n padding: 2px 8px; border-radius: 10px;\n font-size: 12px; font-weight: 600;\n }\n .prism-jsdoc-panel__badge--deprecated[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .prism-jsdoc-panel__badge--required[_ngcontent-%COMP%] {\n color: var(--prism-accent); font-weight: 700; margin-left: 4px;\n }\n .prism-jsdoc-panel__badge--small[_ngcontent-%COMP%] { padding: 1px 5px; font-size: 10px; margin-left: 4px; }\n .prism-jsdoc-panel__section[_ngcontent-%COMP%] { margin-bottom: 20px; }\n .prism-jsdoc-panel__heading[_ngcontent-%COMP%] {\n font-size: 11px; font-weight: 700; text-transform: uppercase;\n letter-spacing: 0.08em; margin: 22px 0 10px;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__code[_ngcontent-%COMP%] {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__code[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] {\n width: 100%; border-collapse: collapse;\n font-size: var(--fs-md);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: hidden;\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n text-align: left; padding: 8px 12px;\n background: var(--prism-bg-surface);\n font-size: 10.5px; text-transform: uppercase;\n letter-spacing: 0.06em; font-weight: 700;\n color: var(--prism-text-ghost);\n border-bottom: 1px solid var(--prism-border);\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\n padding: 10px 12px;\n border-bottom: 1px solid var(--prism-border);\n vertical-align: top;\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%] { border-bottom: 0; }\n .prism-jsdoc-panel__row--deprecated[_ngcontent-%COMP%] td[_ngcontent-%COMP%] { opacity: 0.6; }\n .prism-jsdoc-panel__cell--name[_ngcontent-%COMP%] code[_ngcontent-%COMP%], \n .prism-jsdoc-panel__cell--type[_ngcontent-%COMP%] code[_ngcontent-%COMP%], \n .prism-jsdoc-panel__cell--default[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__muted[_ngcontent-%COMP%] { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__cell--doc[_ngcontent-%COMP%] { color: var(--prism-text); line-height: 1.4; }
|
|
485
|
+
} }, dependencies: [Highlight], styles: ["[_nghost-%COMP%] { display: block; height: 100%; overflow: auto; }\n .prism-jsdoc-panel[_ngcontent-%COMP%] {\n padding: 20px 24px;\n max-width: 880px;\n font-family: var(--font-sans);\n font-size: var(--fs-md);\n color: var(--prism-text);\n }\n .prism-jsdoc-panel__empty[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center;\n min-height: 120px; color: var(--prism-text-muted);\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] {\n margin: 0 0 18px;\n font-size: 14px;\n line-height: 1.7;\n color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta[_ngcontent-%COMP%] {\n display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;\n }\n .prism-jsdoc-panel__meta-item[_ngcontent-%COMP%] {\n display: flex; align-items: center; gap: 6px;\n padding: 3px 9px; border-radius: 4px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n font-size: var(--fs-sm); color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta-label[_ngcontent-%COMP%] {\n font-weight: 500; color: var(--prism-primary);\n font-family: var(--font-mono);\n }\n .prism-jsdoc-panel__badge[_ngcontent-%COMP%] {\n display: inline-flex; align-items: center;\n padding: 2px 8px; border-radius: 10px;\n font-size: 12px; font-weight: 600;\n }\n .prism-jsdoc-panel__badge--deprecated[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .prism-jsdoc-panel__badge--required[_ngcontent-%COMP%] {\n color: var(--prism-accent); font-weight: 700; margin-left: 4px;\n }\n .prism-jsdoc-panel__badge--small[_ngcontent-%COMP%] { padding: 1px 5px; font-size: 10px; margin-left: 4px; }\n .prism-jsdoc-panel__section[_ngcontent-%COMP%] { margin-bottom: 20px; }\n .prism-jsdoc-panel__heading[_ngcontent-%COMP%] {\n font-size: 11px; font-weight: 700; text-transform: uppercase;\n letter-spacing: 0.08em; margin: 22px 0 10px;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__code[_ngcontent-%COMP%] {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__code[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n background: transparent !important;\n color: var(--prism-text-2);\n }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs { background: transparent; color: var(--prism-text-2); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-tag, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-name, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-selector-tag, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-keyword, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-title, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-title.function_, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-built_in, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-type { color: var(--prism-code-tag); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-attr, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-attribute, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-property, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-variable, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-template-variable, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-params { color: var(--prism-code-attr); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-string, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-doctag, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-regexp, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-symbol, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-number, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-literal { color: var(--prism-code-str); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-comment, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-quote, \n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-meta { color: var(--prism-code-com); font-style: italic; }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-deletion { color: var(--prism-danger); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-addition { color: var(--prism-success); }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-emphasis { font-style: italic; }\n [_nghost-%COMP%] .prism-jsdoc-panel__code .hljs-strong { font-weight: 700; }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] {\n width: 100%; border-collapse: collapse;\n font-size: var(--fs-md);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: hidden;\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n text-align: left; padding: 8px 12px;\n background: var(--prism-bg-surface);\n font-size: 10.5px; text-transform: uppercase;\n letter-spacing: 0.06em; font-weight: 700;\n color: var(--prism-text-ghost);\n border-bottom: 1px solid var(--prism-border);\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\n padding: 10px 12px;\n border-bottom: 1px solid var(--prism-border);\n vertical-align: top;\n }\n .prism-jsdoc-panel__table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%] { border-bottom: 0; }\n .prism-jsdoc-panel__row--deprecated[_ngcontent-%COMP%] td[_ngcontent-%COMP%] { opacity: 0.6; }\n .prism-jsdoc-panel__cell--name[_ngcontent-%COMP%] code[_ngcontent-%COMP%], \n .prism-jsdoc-panel__cell--type[_ngcontent-%COMP%] code[_ngcontent-%COMP%], \n .prism-jsdoc-panel__cell--default[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__muted[_ngcontent-%COMP%] { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__cell--doc[_ngcontent-%COMP%] { color: var(--prism-text); line-height: 1.4; }\n .prism-jsdoc-panel__since-sep[_ngcontent-%COMP%] { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__since[_ngcontent-%COMP%] { color: var(--prism-text-muted); font-size: var(--fs-sm); }\n\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child { margin-top: 0; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child { margin-bottom: 0; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] p[_ngcontent-%COMP%] { margin: 0 0 8px; line-height: 1.7; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], \n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], \n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n color: var(--prism-text);\n font-weight: 600;\n line-height: 1.3;\n margin: 18px 0 8px;\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h1[_ngcontent-%COMP%] { font-size: 18px; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] { font-size: 15px; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n font-size: 11px; font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.08em;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], \n .prism-jsdoc-panel__description[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] {\n margin: 0 0 8px; padding-left: 20px;\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] li[_ngcontent-%COMP%] { margin: 2px 0; line-height: 1.6; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] a[_ngcontent-%COMP%] {\n color: var(--prism-primary);\n text-decoration: none;\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover { text-decoration: underline; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] strong[_ngcontent-%COMP%] { color: var(--prism-text); font-weight: 600; }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] code[_ngcontent-%COMP%], \n .prism-jsdoc-panel__cell--doc[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n background: none; color: var(--prism-text);\n }\n .prism-jsdoc-panel__description[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%] {\n margin: 0 0 8px;\n padding: 4px 12px;\n border-left: 3px solid var(--prism-border);\n color: var(--prism-text-2);\n }"] });
|
|
403
486
|
}
|
|
404
487
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsDocPanelComponent, [{
|
|
405
488
|
type: Component,
|
|
@@ -409,8 +492,8 @@ export class JsDocPanelComponent {
|
|
|
409
492
|
<div class="prism-jsdoc-panel__empty">
|
|
410
493
|
Select a component to view API documentation.
|
|
411
494
|
</div>
|
|
412
|
-
} @else { @if (
|
|
413
|
-
<
|
|
495
|
+
} @else { @if (renderedClassDescription(); as descHtml) {
|
|
496
|
+
<div class="prism-jsdoc-panel__description" [innerHTML]="descHtml"></div>
|
|
414
497
|
} @if (hasTags()) {
|
|
415
498
|
<div class="prism-jsdoc-panel__meta">
|
|
416
499
|
@if (isDeprecated()) {
|
|
@@ -438,10 +521,11 @@ export class JsDocPanelComponent {
|
|
|
438
521
|
} @if (examples().length) {
|
|
439
522
|
<div class="prism-jsdoc-panel__section">
|
|
440
523
|
<h3 class="prism-jsdoc-panel__heading">Examples</h3>
|
|
441
|
-
@for (example of examples(); track $index) {
|
|
524
|
+
@for (example of examples(); track $index) { @let parsed =
|
|
525
|
+
parseExample(example);
|
|
442
526
|
<pre
|
|
443
527
|
class="prism-jsdoc-panel__code"
|
|
444
|
-
><code [highlight]="
|
|
528
|
+
><code [highlight]="parsed.code" [language]="parsed.lang"></code></pre>
|
|
445
529
|
}
|
|
446
530
|
</div>
|
|
447
531
|
} @if (inputs().length) {
|
|
@@ -494,11 +578,13 @@ export class JsDocPanelComponent {
|
|
|
494
578
|
}
|
|
495
579
|
</td>
|
|
496
580
|
<td class="prism-jsdoc-panel__cell--doc">
|
|
497
|
-
{
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
581
|
+
@if (inp.doc) {
|
|
582
|
+
<span [innerHTML]="renderInline(inp.doc)"></span>
|
|
583
|
+
} @if (getMemberSince(inp.name); as since) { @if (inp.doc) {
|
|
584
|
+
<span class="prism-jsdoc-panel__since-sep"> · </span>
|
|
585
|
+
}
|
|
586
|
+
<span class="prism-jsdoc-panel__since">Since {{ since }}</span>
|
|
587
|
+
}
|
|
502
588
|
</td>
|
|
503
589
|
</tr>
|
|
504
590
|
}
|
|
@@ -532,7 +618,13 @@ export class JsDocPanelComponent {
|
|
|
532
618
|
}
|
|
533
619
|
</td>
|
|
534
620
|
<td class="prism-jsdoc-panel__cell--doc">
|
|
535
|
-
|
|
621
|
+
@if (out.doc) {
|
|
622
|
+
<span [innerHTML]="renderInline(out.doc)"></span>
|
|
623
|
+
} @if (getMemberSince(out.name); as since) { @if (out.doc) {
|
|
624
|
+
<span class="prism-jsdoc-panel__since-sep"> · </span>
|
|
625
|
+
}
|
|
626
|
+
<span class="prism-jsdoc-panel__since">Since {{ since }}</span>
|
|
627
|
+
}
|
|
536
628
|
</td>
|
|
537
629
|
</tr>
|
|
538
630
|
}
|
|
@@ -585,7 +677,9 @@ export class JsDocPanelComponent {
|
|
|
585
677
|
}
|
|
586
678
|
</td>
|
|
587
679
|
<td class="prism-jsdoc-panel__cell--doc">
|
|
588
|
-
|
|
680
|
+
@if (method.description) {
|
|
681
|
+
<span [innerHTML]="renderInline(method.description)"></span>
|
|
682
|
+
}
|
|
589
683
|
</td>
|
|
590
684
|
</tr>
|
|
591
685
|
}
|
|
@@ -594,6 +688,6 @@ export class JsDocPanelComponent {
|
|
|
594
688
|
</div>
|
|
595
689
|
} }
|
|
596
690
|
</div>
|
|
597
|
-
`, styles: ["\n :host { display: block; height: 100%; overflow: auto; }\n .prism-jsdoc-panel {\n padding: 20px 24px;\n max-width: 880px;\n font-family: var(--font-sans);\n font-size: var(--fs-md);\n color: var(--prism-text);\n }\n .prism-jsdoc-panel__empty {\n display: flex; align-items: center; justify-content: center;\n min-height: 120px; color: var(--prism-text-muted);\n }\n .prism-jsdoc-panel__description {\n margin: 0 0 18px;\n font-size: 14px;\n line-height: 1.7;\n color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta {\n display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;\n }\n .prism-jsdoc-panel__meta-item {\n display: flex; align-items: center; gap: 6px;\n padding: 3px 9px; border-radius: 4px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n font-size: var(--fs-sm); color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta-label {\n font-weight: 500; color: var(--prism-primary);\n font-family: var(--font-mono);\n }\n .prism-jsdoc-panel__badge {\n display: inline-flex; align-items: center;\n padding: 2px 8px; border-radius: 10px;\n font-size: 12px; font-weight: 600;\n }\n .prism-jsdoc-panel__badge--deprecated {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .prism-jsdoc-panel__badge--required {\n color: var(--prism-accent); font-weight: 700; margin-left: 4px;\n }\n .prism-jsdoc-panel__badge--small { padding: 1px 5px; font-size: 10px; margin-left: 4px; }\n .prism-jsdoc-panel__section { margin-bottom: 20px; }\n .prism-jsdoc-panel__heading {\n font-size: 11px; font-weight: 700; text-transform: uppercase;\n letter-spacing: 0.08em; margin: 22px 0 10px;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__code {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__code code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n }\n .prism-jsdoc-panel__table {\n width: 100%; border-collapse: collapse;\n font-size: var(--fs-md);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: hidden;\n }\n .prism-jsdoc-panel__table th {\n text-align: left; padding: 8px 12px;\n background: var(--prism-bg-surface);\n font-size: 10.5px; text-transform: uppercase;\n letter-spacing: 0.06em; font-weight: 700;\n color: var(--prism-text-ghost);\n border-bottom: 1px solid var(--prism-border);\n }\n .prism-jsdoc-panel__table td {\n padding: 10px 12px;\n border-bottom: 1px solid var(--prism-border);\n vertical-align: top;\n }\n .prism-jsdoc-panel__table tr:last-child td { border-bottom: 0; }\n .prism-jsdoc-panel__row--deprecated td { opacity: 0.6; }\n .prism-jsdoc-panel__cell--name code,\n .prism-jsdoc-panel__cell--type code,\n .prism-jsdoc-panel__cell--default code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__muted { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__cell--doc { color: var(--prism-text); line-height: 1.4; }\n "] }]
|
|
691
|
+
`, styles: ["\n :host { display: block; height: 100%; overflow: auto; }\n .prism-jsdoc-panel {\n padding: 20px 24px;\n max-width: 880px;\n font-family: var(--font-sans);\n font-size: var(--fs-md);\n color: var(--prism-text);\n }\n .prism-jsdoc-panel__empty {\n display: flex; align-items: center; justify-content: center;\n min-height: 120px; color: var(--prism-text-muted);\n }\n .prism-jsdoc-panel__description {\n margin: 0 0 18px;\n font-size: 14px;\n line-height: 1.7;\n color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta {\n display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;\n }\n .prism-jsdoc-panel__meta-item {\n display: flex; align-items: center; gap: 6px;\n padding: 3px 9px; border-radius: 4px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n font-size: var(--fs-sm); color: var(--prism-text-2);\n }\n .prism-jsdoc-panel__meta-label {\n font-weight: 500; color: var(--prism-primary);\n font-family: var(--font-mono);\n }\n .prism-jsdoc-panel__badge {\n display: inline-flex; align-items: center;\n padding: 2px 8px; border-radius: 10px;\n font-size: 12px; font-weight: 600;\n }\n .prism-jsdoc-panel__badge--deprecated {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .prism-jsdoc-panel__badge--required {\n color: var(--prism-accent); font-weight: 700; margin-left: 4px;\n }\n .prism-jsdoc-panel__badge--small { padding: 1px 5px; font-size: 10px; margin-left: 4px; }\n .prism-jsdoc-panel__section { margin-bottom: 20px; }\n .prism-jsdoc-panel__heading {\n font-size: 11px; font-weight: 700; text-transform: uppercase;\n letter-spacing: 0.08em; margin: 22px 0 10px;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__code {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__code code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n background: transparent !important;\n color: var(--prism-text-2);\n }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs { background: transparent; color: var(--prism-text-2); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-tag,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-name,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-selector-tag,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-keyword,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-title,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-title.function_,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-built_in,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-type { color: var(--prism-code-tag); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-attr,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-attribute,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-property,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-variable,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-template-variable,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-params { color: var(--prism-code-attr); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-string,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-doctag,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-regexp,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-symbol,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-number,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-literal { color: var(--prism-code-str); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-comment,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-quote,\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-meta { color: var(--prism-code-com); font-style: italic; }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-deletion { color: var(--prism-danger); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-addition { color: var(--prism-success); }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-emphasis { font-style: italic; }\n :host ::ng-deep .prism-jsdoc-panel__code .hljs-strong { font-weight: 700; }\n .prism-jsdoc-panel__table {\n width: 100%; border-collapse: collapse;\n font-size: var(--fs-md);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: hidden;\n }\n .prism-jsdoc-panel__table th {\n text-align: left; padding: 8px 12px;\n background: var(--prism-bg-surface);\n font-size: 10.5px; text-transform: uppercase;\n letter-spacing: 0.06em; font-weight: 700;\n color: var(--prism-text-ghost);\n border-bottom: 1px solid var(--prism-border);\n }\n .prism-jsdoc-panel__table td {\n padding: 10px 12px;\n border-bottom: 1px solid var(--prism-border);\n vertical-align: top;\n }\n .prism-jsdoc-panel__table tr:last-child td { border-bottom: 0; }\n .prism-jsdoc-panel__row--deprecated td { opacity: 0.6; }\n .prism-jsdoc-panel__cell--name code,\n .prism-jsdoc-panel__cell--type code,\n .prism-jsdoc-panel__cell--default code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__muted { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__cell--doc { color: var(--prism-text); line-height: 1.4; }\n .prism-jsdoc-panel__since-sep { color: var(--prism-text-muted); }\n .prism-jsdoc-panel__since { color: var(--prism-text-muted); font-size: var(--fs-sm); }\n\n .prism-jsdoc-panel__description :first-child { margin-top: 0; }\n .prism-jsdoc-panel__description :last-child { margin-bottom: 0; }\n .prism-jsdoc-panel__description p { margin: 0 0 8px; line-height: 1.7; }\n .prism-jsdoc-panel__description h1,\n .prism-jsdoc-panel__description h2,\n .prism-jsdoc-panel__description h3 {\n color: var(--prism-text);\n font-weight: 600;\n line-height: 1.3;\n margin: 18px 0 8px;\n }\n .prism-jsdoc-panel__description h1 { font-size: 18px; }\n .prism-jsdoc-panel__description h2 { font-size: 15px; }\n .prism-jsdoc-panel__description h3 {\n font-size: 11px; font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.08em;\n color: var(--prism-text-ghost);\n }\n .prism-jsdoc-panel__description ul,\n .prism-jsdoc-panel__description ol {\n margin: 0 0 8px; padding-left: 20px;\n }\n .prism-jsdoc-panel__description li { margin: 2px 0; line-height: 1.6; }\n .prism-jsdoc-panel__description a {\n color: var(--prism-primary);\n text-decoration: none;\n }\n .prism-jsdoc-panel__description a:hover { text-decoration: underline; }\n .prism-jsdoc-panel__description strong { color: var(--prism-text); font-weight: 600; }\n .prism-jsdoc-panel__description code,\n .prism-jsdoc-panel__cell--doc code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n padding: 1px 5px; border-radius: var(--radius-xs);\n }\n .prism-jsdoc-panel__description pre {\n margin: 0 0 8px; padding: 0;\n background: var(--prism-bg-surface);\n border: 1px solid var(--prism-border);\n border-radius: 8px; overflow: auto;\n }\n .prism-jsdoc-panel__description pre code {\n font-family: var(--font-mono);\n font-size: var(--fs-sm); line-height: 1.5;\n padding: 8px 12px; display: block;\n background: none; color: var(--prism-text);\n }\n .prism-jsdoc-panel__description blockquote {\n margin: 0 0 8px;\n padding: 4px 12px;\n border-left: 3px solid var(--prism-border);\n color: var(--prism-text-2);\n }\n "] }]
|
|
598
692
|
}], null, { activeComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeComponent", required: false }] }] }); })();
|
|
599
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsDocPanelComponent, { className: "JsDocPanelComponent", filePath: "jsdoc-panel.component.ts", lineNumber:
|
|
693
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsDocPanelComponent, { className: "JsDocPanelComponent", filePath: "jsdoc-panel.component.ts", lineNumber: 410 }); })();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ParsedExample {
|
|
2
|
+
lang: string;
|
|
3
|
+
code: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function parseExample(raw: string): ParsedExample;
|
|
6
|
+
export declare function renderBlockMarkdown(text: string | undefined): string | null;
|
|
7
|
+
export declare function renderInlineMarkdown(text: string | undefined): string;
|
|
8
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAQvD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAG3E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGrE"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { marked } from 'marked';
|
|
2
|
+
marked.setOptions({ gfm: true, breaks: false });
|
|
3
|
+
const FENCE_RE = /^```([^\n`]*)\n([\s\S]*?)\n?```$/;
|
|
4
|
+
export function parseExample(raw) {
|
|
5
|
+
const trimmed = raw.trim();
|
|
6
|
+
const match = FENCE_RE.exec(trimmed);
|
|
7
|
+
if (!match) {
|
|
8
|
+
return { lang: 'typescript', code: raw };
|
|
9
|
+
}
|
|
10
|
+
const lang = match[1].trim() || 'typescript';
|
|
11
|
+
return { lang, code: match[2] };
|
|
12
|
+
}
|
|
13
|
+
export function renderBlockMarkdown(text) {
|
|
14
|
+
if (!text)
|
|
15
|
+
return null;
|
|
16
|
+
return marked.parse(text, { async: false });
|
|
17
|
+
}
|
|
18
|
+
export function renderInlineMarkdown(text) {
|
|
19
|
+
if (!text)
|
|
20
|
+
return '';
|
|
21
|
+
return marked.parseInline(text, { async: false });
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,EAGV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAyBtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { chain, } from '@angular-devkit/schematics';
|
|
2
|
+
import { addPluginToConfig } from '@ng-prism/core/schematics/utils';
|
|
3
|
+
const PLUGIN_IMPORT_NAME = 'jsDocPlugin';
|
|
4
|
+
const PLUGIN_IMPORT_FROM = '@ng-prism/plugin-jsdoc';
|
|
5
|
+
const PLUGIN_CALL = 'jsDocPlugin()';
|
|
6
|
+
function injectPlugin(options) {
|
|
7
|
+
return (tree, context) => {
|
|
8
|
+
const configPath = options.configPath ?? 'ng-prism.config.ts';
|
|
9
|
+
const changed = addPluginToConfig(tree, configPath, {
|
|
10
|
+
importName: PLUGIN_IMPORT_NAME,
|
|
11
|
+
importFrom: PLUGIN_IMPORT_FROM,
|
|
12
|
+
call: PLUGIN_CALL,
|
|
13
|
+
});
|
|
14
|
+
if (changed) {
|
|
15
|
+
context.logger.info(` ${PLUGIN_IMPORT_FROM} → added to ${configPath}`);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
context.logger.info(` ${PLUGIN_IMPORT_FROM} already configured — skipped`);
|
|
19
|
+
}
|
|
20
|
+
return tree;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export function ngAdd(options) {
|
|
24
|
+
return chain([injectPlugin(options)]);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-prism/plugin-jsdoc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-beta.0",
|
|
4
4
|
"description": "JSDoc API documentation panel for ng-prism.",
|
|
5
|
+
"ng-add": {
|
|
6
|
+
"save": "devDependencies"
|
|
7
|
+
},
|
|
8
|
+
"schematics": "./schematics/collection.json",
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@ng-prism/core",
|
|
7
11
|
"jsdoc",
|
|
@@ -27,19 +31,21 @@
|
|
|
27
31
|
},
|
|
28
32
|
"files": [
|
|
29
33
|
"dist",
|
|
34
|
+
"schematics",
|
|
30
35
|
"!**/*.tsbuildinfo"
|
|
31
36
|
],
|
|
32
37
|
"peerDependencies": {
|
|
33
|
-
"@angular/core": ">=
|
|
34
|
-
"
|
|
38
|
+
"@angular/core": ">=20.0.0",
|
|
39
|
+
"@ng-prism/core": "^22.0.0-0",
|
|
35
40
|
"highlight.js": ">=11.0.0",
|
|
36
41
|
"ngx-highlightjs": ">=14.0.0",
|
|
37
|
-
"
|
|
42
|
+
"typescript": ">=5.5.0"
|
|
38
43
|
},
|
|
39
44
|
"devDependencies": {
|
|
40
45
|
"@ng-prism/core": "*"
|
|
41
46
|
},
|
|
42
47
|
"dependencies": {
|
|
48
|
+
"marked": "^15.0.12",
|
|
43
49
|
"tslib": "^2.3.0"
|
|
44
50
|
},
|
|
45
51
|
"repository": {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Adds @ng-prism/plugin-jsdoc to the ng-prism config",
|
|
6
|
+
"factory": "../dist/schematics/ng-add/index#ngAdd",
|
|
7
|
+
"schema": "./ng-add/schema.json"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "NgPrismPluginJsDocNgAdd",
|
|
4
|
+
"title": "Add @ng-prism/plugin-jsdoc",
|
|
5
|
+
"description": "Registers @ng-prism/plugin-jsdoc in ng-prism.config.ts",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"configPath": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Path to ng-prism.config.ts",
|
|
11
|
+
"default": "ng-prism.config.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": [],
|
|
15
|
+
"additionalProperties": false
|
|
16
|
+
}
|