@ng-prism/core 21.0.1 → 21.0.2
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/app/page-renderer/prism-page-renderer.component.d.ts.map +1 -1
- package/dist/app/page-renderer/prism-page-renderer.component.js +3 -3
- package/dist/app/shell/prism-shell.component.js +4 -4
- package/dist/builder/manifest/runtime-manifest.generator.js +1 -1
- package/package.json +1 -1
- package/dist/app/page-renderer/prism-icon-page.component.d.ts +0 -8
- package/dist/app/page-renderer/prism-icon-page.component.d.ts.map +0 -1
- package/dist/app/page-renderer/prism-icon-page.component.js +0 -42
- package/dist/app/page-renderer/prism-token-page.component.d.ts +0 -8
- package/dist/app/page-renderer/prism-token-page.component.d.ts.map +0 -1
- package/dist/app/page-renderer/prism-token-page.component.js +0 -164
- package/dist/app/renderer/highlight-xml.d.ts +0 -2
- package/dist/app/renderer/highlight-xml.d.ts.map +0 -1
- package/dist/app/renderer/highlight-xml.js +0 -27
- package/dist/builder/icon-resolver/icon-resolver.d.ts +0 -7
- package/dist/builder/icon-resolver/icon-resolver.d.ts.map +0 -1
- package/dist/builder/icon-resolver/icon-resolver.js +0 -12
- package/dist/builder/icon-resolver/index.d.ts +0 -2
- package/dist/builder/icon-resolver/index.d.ts.map +0 -1
- package/dist/builder/icon-resolver/index.js +0 -1
- package/dist/builder/token-scanner/index.d.ts +0 -2
- package/dist/builder/token-scanner/index.d.ts.map +0 -1
- package/dist/builder/token-scanner/index.js +0 -1
- package/dist/builder/token-scanner/token-scanner.d.ts +0 -9
- package/dist/builder/token-scanner/token-scanner.d.ts.map +0 -1
- package/dist/builder/token-scanner/token-scanner.js +0 -95
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-page-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/page-renderer/prism-page-renderer.component.ts"],"names":[],"mappings":";AAIA,
|
|
1
|
+
{"version":3,"file":"prism-page-renderer.component.d.ts","sourceRoot":"","sources":["../../../src/app/page-renderer/prism-page-renderer.component.ts"],"names":[],"mappings":";AAIA,qBAiDa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,SAAS,CAAC,QAAQ,CAAC,IAAI,iFAAuB;yCAFnC,0BAA0B;2CAA1B,0BAA0B;CAGtC"}
|
|
@@ -47,7 +47,7 @@ export class PrismPageRendererComponent {
|
|
|
47
47
|
} if (rf & 2) {
|
|
48
48
|
let tmp_0_0;
|
|
49
49
|
i0.ɵɵconditional((tmp_0_0 = ctx.page()) ? 0 : -1, tmp_0_0);
|
|
50
|
-
} }, dependencies: [NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; flex: 1; overflow-y: auto; }\n .prism-page-renderer__title[_ngcontent-%COMP%] {\n margin: 0;\n padding: 16px
|
|
50
|
+
} }, dependencies: [NgComponentOutlet], styles: ["[_nghost-%COMP%] { display: block; flex: 1; overflow-y: auto; }\n .prism-page-renderer__title[_ngcontent-%COMP%] {\n margin: 0;\n padding: 16px 20px;\n font-size: 18px;\n font-weight: 600;\n letter-spacing: -0.01em;\n color: var(--prism-text);\n font-family: var(--prism-font-sans);\n border-bottom: 1px solid var(--prism-border);\n border-left: 3px solid;\n border-image: linear-gradient(180deg, var(--prism-primary-from), var(--prism-primary-to)) 1;\n background: var(--prism-bg-surface);\n }\n .prism-page-renderer__component[_ngcontent-%COMP%] {\n padding: 16px 20px;\n }\n .prism-page-renderer__json[_ngcontent-%COMP%] {\n margin: 0;\n padding: 24px;\n font-size: 12px;\n font-family: monospace;\n color: var(--prism-text-muted);\n white-space: pre-wrap;\n }"] });
|
|
51
51
|
}
|
|
52
52
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismPageRendererComponent, [{
|
|
53
53
|
type: Component,
|
|
@@ -67,6 +67,6 @@ export class PrismPageRendererComponent {
|
|
|
67
67
|
}
|
|
68
68
|
</div>
|
|
69
69
|
}
|
|
70
|
-
`, styles: ["\n :host { display: block; flex: 1; overflow-y: auto; }\n .prism-page-renderer__title {\n margin: 0;\n padding: 16px
|
|
70
|
+
`, styles: ["\n :host { display: block; flex: 1; overflow-y: auto; }\n .prism-page-renderer__title {\n margin: 0;\n padding: 16px 20px;\n font-size: 18px;\n font-weight: 600;\n letter-spacing: -0.01em;\n color: var(--prism-text);\n font-family: var(--prism-font-sans);\n border-bottom: 1px solid var(--prism-border);\n border-left: 3px solid;\n border-image: linear-gradient(180deg, var(--prism-primary-from), var(--prism-primary-to)) 1;\n background: var(--prism-bg-surface);\n }\n .prism-page-renderer__component {\n padding: 16px 20px;\n }\n .prism-page-renderer__json {\n margin: 0;\n padding: 24px;\n font-size: 12px;\n font-family: monospace;\n color: var(--prism-text-muted);\n white-space: pre-wrap;\n }\n "] }]
|
|
71
71
|
}], null, null); })();
|
|
72
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPageRendererComponent, { className: "PrismPageRendererComponent", filePath: "app/page-renderer/prism-page-renderer.component.ts", lineNumber:
|
|
72
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPageRendererComponent, { className: "PrismPageRendererComponent", filePath: "app/page-renderer/prism-page-renderer.component.ts", lineNumber: 54 }); })();
|
|
@@ -191,11 +191,11 @@ export class PrismShellComponent {
|
|
|
191
191
|
i0.ɵɵelementEnd();
|
|
192
192
|
} if (rf & 2) {
|
|
193
193
|
i0.ɵɵstyleMap(ctx.shellStyle());
|
|
194
|
-
i0.ɵɵattribute("data-sidebar", ctx.layout.sidebarVisible() ? "visible" : "hidden")("data-addons", ctx.layout.addonsVisible() && ctx.panelService.activeViewId() === "renderer" ? "visible" : "hidden")("data-orientation", ctx.layout.addonsOrientation())("data-toolbar", ctx.layout.toolbarVisible() ? "visible" : "hidden");
|
|
194
|
+
i0.ɵɵattribute("data-sidebar", ctx.layout.sidebarVisible() ? "visible" : "hidden")("data-addons", ctx.layout.addonsVisible() && ctx.panelService.activeViewId() === "renderer" && !ctx.navigationService.activePage() ? "visible" : "hidden")("data-orientation", ctx.layout.addonsOrientation())("data-toolbar", ctx.layout.toolbarVisible() ? "visible" : "hidden");
|
|
195
195
|
i0.ɵɵadvance(6);
|
|
196
196
|
i0.ɵɵconditional(ctx.navigationService.activeComponent() ? 6 : ctx.navigationService.activePage() ? 7 : 8);
|
|
197
197
|
i0.ɵɵadvance(3);
|
|
198
|
-
i0.ɵɵconditional(ctx.layout.addonsVisible() && ctx.panelService.activeViewId() === "renderer" ? 9 : -1);
|
|
198
|
+
i0.ɵɵconditional(ctx.layout.addonsVisible() && ctx.panelService.activeViewId() === "renderer" && !ctx.navigationService.activePage() ? 9 : -1);
|
|
199
199
|
} }, dependencies: [PrismHeaderComponent,
|
|
200
200
|
PrismSidebarComponent,
|
|
201
201
|
PrismComponentHeaderComponent,
|
|
@@ -221,7 +221,7 @@ export class PrismShellComponent {
|
|
|
221
221
|
class="prism-shell"
|
|
222
222
|
[style]="shellStyle()"
|
|
223
223
|
[attr.data-sidebar]="layout.sidebarVisible() ? 'visible' : 'hidden'"
|
|
224
|
-
[attr.data-addons]="layout.addonsVisible() && panelService.activeViewId() === 'renderer' ? 'visible' : 'hidden'"
|
|
224
|
+
[attr.data-addons]="layout.addonsVisible() && panelService.activeViewId() === 'renderer' && !navigationService.activePage() ? 'visible' : 'hidden'"
|
|
225
225
|
[attr.data-orientation]="layout.addonsOrientation()"
|
|
226
226
|
[attr.data-toolbar]="layout.toolbarVisible() ? 'visible' : 'hidden'"
|
|
227
227
|
>
|
|
@@ -265,7 +265,7 @@ export class PrismShellComponent {
|
|
|
265
265
|
}
|
|
266
266
|
</main>
|
|
267
267
|
|
|
268
|
-
@if (layout.addonsVisible() && panelService.activeViewId() === 'renderer') {
|
|
268
|
+
@if (layout.addonsVisible() && panelService.activeViewId() === 'renderer' && !navigationService.activePage()) {
|
|
269
269
|
<div
|
|
270
270
|
class="prism-shell__panel-handle"
|
|
271
271
|
(mousedown)="startPanelResize($event)"
|
|
@@ -113,7 +113,7 @@ export function generateRuntimeManifest(options) {
|
|
|
113
113
|
const hasDirectives = directives.length > 0;
|
|
114
114
|
const lines = [
|
|
115
115
|
'// AUTO-GENERATED by ng-prism — do not edit!',
|
|
116
|
-
"import type { RuntimeManifest } from 'ng-prism/plugin';",
|
|
116
|
+
"import type { RuntimeManifest } from '@ng-prism/core/plugin';",
|
|
117
117
|
];
|
|
118
118
|
if (hasDirectives) {
|
|
119
119
|
lines.push("import { Component, input, output } from '@angular/core';");
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { IconPage } from '../../plugin/page.types.js';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class PrismIconPageComponent {
|
|
4
|
-
readonly page: import("@angular/core").InputSignal<IconPage>;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PrismIconPageComponent, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PrismIconPageComponent, "prism-icon-page", never, { "page": { "alias": "page"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=prism-icon-page.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prism-icon-page.component.d.ts","sourceRoot":"","sources":["../../../src/app/page-renderer/prism-icon-page.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;;AAE3D,qBAmDa,sBAAsB;IACjC,QAAQ,CAAC,IAAI,gDAA8B;yCADhC,sBAAsB;2CAAtB,sBAAsB;CAElC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Component, input } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
const _forTrack0 = ($index, $item) => $item.name;
|
|
4
|
-
function PrismIconPageComponent_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
5
|
-
i0.ɵɵdomElementStart(0, "div", 1);
|
|
6
|
-
i0.ɵɵdomElement(1, "div", 2);
|
|
7
|
-
i0.ɵɵdomElementStart(2, "span", 3);
|
|
8
|
-
i0.ɵɵtext(3);
|
|
9
|
-
i0.ɵɵdomElementEnd()();
|
|
10
|
-
} if (rf & 2) {
|
|
11
|
-
const icon_r1 = ctx.$implicit;
|
|
12
|
-
i0.ɵɵadvance();
|
|
13
|
-
i0.ɵɵdomProperty("innerHTML", icon_r1.svg, i0.ɵɵsanitizeHtml);
|
|
14
|
-
i0.ɵɵadvance(2);
|
|
15
|
-
i0.ɵɵtextInterpolate(icon_r1.name);
|
|
16
|
-
} }
|
|
17
|
-
export class PrismIconPageComponent {
|
|
18
|
-
page = input.required(...(ngDevMode ? [{ debugName: "page" }] : []));
|
|
19
|
-
static ɵfac = function PrismIconPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismIconPageComponent)(); };
|
|
20
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismIconPageComponent, selectors: [["prism-icon-page"]], inputs: { page: [1, "page"] }, decls: 3, vars: 0, consts: [[1, "prism-icon-grid"], [1, "prism-icon-card"], [1, "prism-icon-card__preview", 3, "innerHTML"], [1, "prism-icon-card__name"]], template: function PrismIconPageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
-
i0.ɵɵdomElementStart(0, "div", 0);
|
|
22
|
-
i0.ɵɵrepeaterCreate(1, PrismIconPageComponent_For_2_Template, 4, 2, "div", 1, _forTrack0);
|
|
23
|
-
i0.ɵɵdomElementEnd();
|
|
24
|
-
} if (rf & 2) {
|
|
25
|
-
i0.ɵɵadvance();
|
|
26
|
-
i0.ɵɵrepeater(ctx.page().icons);
|
|
27
|
-
} }, styles: ["[_nghost-%COMP%] { display: block; padding: 24px; }\n .prism-icon-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));\n gap: 16px;\n }\n .prism-icon-card[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 16px 8px;\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n background: var(--prism-bg);\n cursor: default;\n }\n .prism-icon-card[_ngcontent-%COMP%]:hover {\n border-color: var(--prism-primary);\n }\n .prism-icon-card__preview[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n color: var(--prism-text);\n }\n .prism-icon-card__preview[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] {\n width: 100%;\n height: 100%;\n }\n .prism-icon-card__name[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--prism-text-muted);\n text-align: center;\n word-break: break-all;\n }"] });
|
|
28
|
-
}
|
|
29
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismIconPageComponent, [{
|
|
30
|
-
type: Component,
|
|
31
|
-
args: [{ selector: 'prism-icon-page', standalone: true, template: `
|
|
32
|
-
<div class="prism-icon-grid">
|
|
33
|
-
@for (icon of page().icons; track icon.name) {
|
|
34
|
-
<div class="prism-icon-card">
|
|
35
|
-
<div class="prism-icon-card__preview" [innerHTML]="icon.svg"></div>
|
|
36
|
-
<span class="prism-icon-card__name">{{ icon.name }}</span>
|
|
37
|
-
</div>
|
|
38
|
-
}
|
|
39
|
-
</div>
|
|
40
|
-
`, styles: ["\n :host { display: block; padding: 24px; }\n .prism-icon-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));\n gap: 16px;\n }\n .prism-icon-card {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n padding: 16px 8px;\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n background: var(--prism-bg);\n cursor: default;\n }\n .prism-icon-card:hover {\n border-color: var(--prism-primary);\n }\n .prism-icon-card__preview {\n width: 32px;\n height: 32px;\n color: var(--prism-text);\n }\n .prism-icon-card__preview svg {\n width: 100%;\n height: 100%;\n }\n .prism-icon-card__name {\n font-size: 11px;\n color: var(--prism-text-muted);\n text-align: center;\n word-break: break-all;\n }\n "] }]
|
|
41
|
-
}], null, { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: true }] }] }); })();
|
|
42
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismIconPageComponent, { className: "PrismIconPageComponent", filePath: "app/page-renderer/prism-icon-page.component.ts", lineNumber: 55 }); })();
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TokenPage } from '../../plugin/page.types.js';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class PrismTokenPageComponent {
|
|
4
|
-
readonly page: import("@angular/core").InputSignal<TokenPage>;
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PrismTokenPageComponent, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PrismTokenPageComponent, "prism-token-page", never, { "page": { "alias": "page"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=prism-token-page.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prism-token-page.component.d.ts","sourceRoot":"","sources":["../../../src/app/page-renderer/prism-token-page.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;;AAE5D,qBA2Ha,uBAAuB;IAClC,QAAQ,CAAC,IAAI,iDAA+B;yCADjC,uBAAuB;2CAAvB,uBAAuB;CAEnC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { Component, input } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
const _forTrack0 = ($index, $item) => $item.title;
|
|
4
|
-
const _forTrack1 = ($index, $item) => $item.name;
|
|
5
|
-
function PrismTokenPageComponent_For_1_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
-
i0.ɵɵdomElementStart(0, "p", 2);
|
|
7
|
-
i0.ɵɵtext(1);
|
|
8
|
-
i0.ɵɵdomElementEnd();
|
|
9
|
-
} if (rf & 2) {
|
|
10
|
-
const group_r1 = i0.ɵɵnextContext().$implicit;
|
|
11
|
-
i0.ɵɵadvance();
|
|
12
|
-
i0.ɵɵtextInterpolate(group_r1.description);
|
|
13
|
-
} }
|
|
14
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
-
i0.ɵɵdomElement(0, "div", 15);
|
|
16
|
-
} if (rf & 2) {
|
|
17
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
18
|
-
i0.ɵɵstyleProp("background", token_r2.value);
|
|
19
|
-
} }
|
|
20
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
-
i0.ɵɵdomElement(0, "div", 16);
|
|
22
|
-
} if (rf & 2) {
|
|
23
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
24
|
-
i0.ɵɵstyleProp("width", token_r2.value);
|
|
25
|
-
} }
|
|
26
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
-
i0.ɵɵdomElement(0, "div", 17);
|
|
28
|
-
} if (rf & 2) {
|
|
29
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
30
|
-
i0.ɵɵstyleProp("box-shadow", token_r2.value);
|
|
31
|
-
} }
|
|
32
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
33
|
-
i0.ɵɵdomElementStart(0, "div", 18);
|
|
34
|
-
i0.ɵɵtext(1, "Aa Bb Cc 123");
|
|
35
|
-
i0.ɵɵdomElementEnd();
|
|
36
|
-
} if (rf & 2) {
|
|
37
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
38
|
-
i0.ɵɵstyleProp("font-family", token_r2.value);
|
|
39
|
-
} }
|
|
40
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
41
|
-
i0.ɵɵdomElementStart(0, "div", 10);
|
|
42
|
-
i0.ɵɵtext(1);
|
|
43
|
-
i0.ɵɵdomElementEnd();
|
|
44
|
-
} if (rf & 2) {
|
|
45
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
46
|
-
i0.ɵɵadvance();
|
|
47
|
-
i0.ɵɵtextInterpolate(token_r2.value);
|
|
48
|
-
} }
|
|
49
|
-
function PrismTokenPageComponent_For_1_For_6_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
-
i0.ɵɵdomElementStart(0, "span", 14);
|
|
51
|
-
i0.ɵɵtext(1);
|
|
52
|
-
i0.ɵɵdomElementEnd();
|
|
53
|
-
} if (rf & 2) {
|
|
54
|
-
const token_r2 = i0.ɵɵnextContext().$implicit;
|
|
55
|
-
i0.ɵɵadvance();
|
|
56
|
-
i0.ɵɵtextInterpolate(token_r2.description);
|
|
57
|
-
} }
|
|
58
|
-
function PrismTokenPageComponent_For_1_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
59
|
-
i0.ɵɵdomElementStart(0, "div", 4)(1, "div", 5);
|
|
60
|
-
i0.ɵɵconditionalCreate(2, PrismTokenPageComponent_For_1_For_6_Conditional_2_Template, 1, 2, "div", 6);
|
|
61
|
-
i0.ɵɵconditionalCreate(3, PrismTokenPageComponent_For_1_For_6_Conditional_3_Template, 1, 2, "div", 7);
|
|
62
|
-
i0.ɵɵconditionalCreate(4, PrismTokenPageComponent_For_1_For_6_Conditional_4_Template, 1, 2, "div", 8);
|
|
63
|
-
i0.ɵɵconditionalCreate(5, PrismTokenPageComponent_For_1_For_6_Conditional_5_Template, 2, 2, "div", 9);
|
|
64
|
-
i0.ɵɵconditionalCreate(6, PrismTokenPageComponent_For_1_For_6_Conditional_6_Template, 2, 1, "div", 10);
|
|
65
|
-
i0.ɵɵdomElementEnd();
|
|
66
|
-
i0.ɵɵdomElementStart(7, "div", 11)(8, "code", 12);
|
|
67
|
-
i0.ɵɵtext(9);
|
|
68
|
-
i0.ɵɵdomElementEnd();
|
|
69
|
-
i0.ɵɵdomElementStart(10, "span", 13);
|
|
70
|
-
i0.ɵɵtext(11);
|
|
71
|
-
i0.ɵɵdomElementEnd();
|
|
72
|
-
i0.ɵɵconditionalCreate(12, PrismTokenPageComponent_For_1_For_6_Conditional_12_Template, 2, 1, "span", 14);
|
|
73
|
-
i0.ɵɵdomElementEnd()();
|
|
74
|
-
} if (rf & 2) {
|
|
75
|
-
const token_r2 = ctx.$implicit;
|
|
76
|
-
i0.ɵɵadvance();
|
|
77
|
-
i0.ɵɵdomProperty("ngSwitch", token_r2.visualization);
|
|
78
|
-
i0.ɵɵadvance();
|
|
79
|
-
i0.ɵɵconditional(token_r2.visualization === "color" ? 2 : -1);
|
|
80
|
-
i0.ɵɵadvance();
|
|
81
|
-
i0.ɵɵconditional(token_r2.visualization === "spacing" ? 3 : -1);
|
|
82
|
-
i0.ɵɵadvance();
|
|
83
|
-
i0.ɵɵconditional(token_r2.visualization === "shadow" ? 4 : -1);
|
|
84
|
-
i0.ɵɵadvance();
|
|
85
|
-
i0.ɵɵconditional(token_r2.visualization === "typography" ? 5 : -1);
|
|
86
|
-
i0.ɵɵadvance();
|
|
87
|
-
i0.ɵɵconditional(token_r2.visualization === "raw" ? 6 : -1);
|
|
88
|
-
i0.ɵɵadvance(3);
|
|
89
|
-
i0.ɵɵtextInterpolate(token_r2.name);
|
|
90
|
-
i0.ɵɵadvance(2);
|
|
91
|
-
i0.ɵɵtextInterpolate(token_r2.value);
|
|
92
|
-
i0.ɵɵadvance();
|
|
93
|
-
i0.ɵɵconditional(token_r2.description ? 12 : -1);
|
|
94
|
-
} }
|
|
95
|
-
function PrismTokenPageComponent_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
96
|
-
i0.ɵɵdomElementStart(0, "section", 0)(1, "h3", 1);
|
|
97
|
-
i0.ɵɵtext(2);
|
|
98
|
-
i0.ɵɵdomElementEnd();
|
|
99
|
-
i0.ɵɵconditionalCreate(3, PrismTokenPageComponent_For_1_Conditional_3_Template, 2, 1, "p", 2);
|
|
100
|
-
i0.ɵɵdomElementStart(4, "div", 3);
|
|
101
|
-
i0.ɵɵrepeaterCreate(5, PrismTokenPageComponent_For_1_For_6_Template, 13, 9, "div", 4, _forTrack1);
|
|
102
|
-
i0.ɵɵdomElementEnd()();
|
|
103
|
-
} if (rf & 2) {
|
|
104
|
-
const group_r1 = ctx.$implicit;
|
|
105
|
-
i0.ɵɵadvance(2);
|
|
106
|
-
i0.ɵɵtextInterpolate(group_r1.title);
|
|
107
|
-
i0.ɵɵadvance();
|
|
108
|
-
i0.ɵɵconditional(group_r1.description ? 3 : -1);
|
|
109
|
-
i0.ɵɵadvance(2);
|
|
110
|
-
i0.ɵɵrepeater(group_r1.tokens);
|
|
111
|
-
} }
|
|
112
|
-
export class PrismTokenPageComponent {
|
|
113
|
-
page = input.required(...(ngDevMode ? [{ debugName: "page" }] : []));
|
|
114
|
-
static ɵfac = function PrismTokenPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismTokenPageComponent)(); };
|
|
115
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismTokenPageComponent, selectors: [["prism-token-page"]], inputs: { page: [1, "page"] }, decls: 2, vars: 0, consts: [[1, "prism-token-group"], [1, "prism-token-group__title"], [1, "prism-token-group__desc"], [1, "prism-token-group__grid"], [1, "prism-token"], [1, "prism-token__preview", 3, "ngSwitch"], [1, "prism-token__swatch", 3, "background"], [1, "prism-token__bar", 3, "width"], [1, "prism-token__shadow-box", 3, "box-shadow"], [1, "prism-token__type-sample", 3, "font-family"], [1, "prism-token__raw"], [1, "prism-token__info"], [1, "prism-token__name"], [1, "prism-token__value"], [1, "prism-token__desc"], [1, "prism-token__swatch"], [1, "prism-token__bar"], [1, "prism-token__shadow-box"], [1, "prism-token__type-sample"]], template: function PrismTokenPageComponent_Template(rf, ctx) { if (rf & 1) {
|
|
116
|
-
i0.ɵɵrepeaterCreate(0, PrismTokenPageComponent_For_1_Template, 7, 2, "section", 0, _forTrack0);
|
|
117
|
-
} if (rf & 2) {
|
|
118
|
-
i0.ɵɵrepeater(ctx.page().tokenGroups);
|
|
119
|
-
} }, styles: ["[_nghost-%COMP%] { display: block; padding: 24px; }\n .prism-token-group[_ngcontent-%COMP%] { margin-bottom: 32px; }\n .prism-token-group__title[_ngcontent-%COMP%] {\n margin: 0 0 4px;\n font-size: 18px;\n font-weight: 600;\n color: var(--prism-text);\n }\n .prism-token-group__desc[_ngcontent-%COMP%] {\n margin: 0 0 16px;\n font-size: 13px;\n color: var(--prism-text-muted);\n }\n .prism-token-group__grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));\n gap: 12px;\n }\n .prism-token[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px;\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n background: var(--prism-bg);\n }\n .prism-token__preview[_ngcontent-%COMP%] { flex-shrink: 0; }\n .prism-token__swatch[_ngcontent-%COMP%] {\n width: 40px;\n height: 40px;\n border-radius: 6px;\n border: 1px solid var(--prism-border);\n }\n .prism-token__bar[_ngcontent-%COMP%] {\n height: 8px;\n min-width: 4px;\n max-width: 120px;\n background: var(--prism-primary);\n border-radius: 4px;\n }\n .prism-token__shadow-box[_ngcontent-%COMP%] {\n width: 40px;\n height: 40px;\n border-radius: 6px;\n background: #fff;\n }\n .prism-token__type-sample[_ngcontent-%COMP%] {\n font-size: 16px;\n color: var(--prism-text);\n white-space: nowrap;\n }\n .prism-token__raw[_ngcontent-%COMP%] {\n font-family: monospace;\n font-size: 12px;\n color: var(--prism-text-muted);\n }\n .prism-token__info[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n }\n .prism-token__name[_ngcontent-%COMP%] {\n font-size: 13px;\n font-weight: 500;\n color: var(--prism-text);\n }\n .prism-token__value[_ngcontent-%COMP%] {\n font-size: 12px;\n font-family: monospace;\n color: var(--prism-text-muted);\n }\n .prism-token__desc[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--prism-text-muted);\n }"] });
|
|
120
|
-
}
|
|
121
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismTokenPageComponent, [{
|
|
122
|
-
type: Component,
|
|
123
|
-
args: [{ selector: 'prism-token-page', standalone: true, template: `
|
|
124
|
-
@for (group of page().tokenGroups; track group.title) {
|
|
125
|
-
<section class="prism-token-group">
|
|
126
|
-
<h3 class="prism-token-group__title">{{ group.title }}</h3>
|
|
127
|
-
@if (group.description) {
|
|
128
|
-
<p class="prism-token-group__desc">{{ group.description }}</p>
|
|
129
|
-
}
|
|
130
|
-
<div class="prism-token-group__grid">
|
|
131
|
-
@for (token of group.tokens; track token.name) {
|
|
132
|
-
<div class="prism-token">
|
|
133
|
-
<div class="prism-token__preview" [ngSwitch]="token.visualization">
|
|
134
|
-
@if (token.visualization === 'color') {
|
|
135
|
-
<div class="prism-token__swatch" [style.background]="token.value"></div>
|
|
136
|
-
}
|
|
137
|
-
@if (token.visualization === 'spacing') {
|
|
138
|
-
<div class="prism-token__bar" [style.width]="token.value"></div>
|
|
139
|
-
}
|
|
140
|
-
@if (token.visualization === 'shadow') {
|
|
141
|
-
<div class="prism-token__shadow-box" [style.box-shadow]="token.value"></div>
|
|
142
|
-
}
|
|
143
|
-
@if (token.visualization === 'typography') {
|
|
144
|
-
<div class="prism-token__type-sample" [style.font-family]="token.value">Aa Bb Cc 123</div>
|
|
145
|
-
}
|
|
146
|
-
@if (token.visualization === 'raw') {
|
|
147
|
-
<div class="prism-token__raw">{{ token.value }}</div>
|
|
148
|
-
}
|
|
149
|
-
</div>
|
|
150
|
-
<div class="prism-token__info">
|
|
151
|
-
<code class="prism-token__name">{{ token.name }}</code>
|
|
152
|
-
<span class="prism-token__value">{{ token.value }}</span>
|
|
153
|
-
@if (token.description) {
|
|
154
|
-
<span class="prism-token__desc">{{ token.description }}</span>
|
|
155
|
-
}
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
}
|
|
159
|
-
</div>
|
|
160
|
-
</section>
|
|
161
|
-
}
|
|
162
|
-
`, styles: ["\n :host { display: block; padding: 24px; }\n .prism-token-group { margin-bottom: 32px; }\n .prism-token-group__title {\n margin: 0 0 4px;\n font-size: 18px;\n font-weight: 600;\n color: var(--prism-text);\n }\n .prism-token-group__desc {\n margin: 0 0 16px;\n font-size: 13px;\n color: var(--prism-text-muted);\n }\n .prism-token-group__grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));\n gap: 12px;\n }\n .prism-token {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px;\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n background: var(--prism-bg);\n }\n .prism-token__preview { flex-shrink: 0; }\n .prism-token__swatch {\n width: 40px;\n height: 40px;\n border-radius: 6px;\n border: 1px solid var(--prism-border);\n }\n .prism-token__bar {\n height: 8px;\n min-width: 4px;\n max-width: 120px;\n background: var(--prism-primary);\n border-radius: 4px;\n }\n .prism-token__shadow-box {\n width: 40px;\n height: 40px;\n border-radius: 6px;\n background: #fff;\n }\n .prism-token__type-sample {\n font-size: 16px;\n color: var(--prism-text);\n white-space: nowrap;\n }\n .prism-token__raw {\n font-family: monospace;\n font-size: 12px;\n color: var(--prism-text-muted);\n }\n .prism-token__info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n }\n .prism-token__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--prism-text);\n }\n .prism-token__value {\n font-size: 12px;\n font-family: monospace;\n color: var(--prism-text-muted);\n }\n .prism-token__desc {\n font-size: 11px;\n color: var(--prism-text-muted);\n }\n "] }]
|
|
163
|
-
}], null, { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: true }] }] }); })();
|
|
164
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismTokenPageComponent, { className: "PrismTokenPageComponent", filePath: "app/page-renderer/prism-token-page.component.ts", lineNumber: 127 }); })();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"highlight-xml.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/highlight-xml.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyBjD"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const ESC = { '&': '&', '<': '<', '>': '>', '"': '"' };
|
|
2
|
-
function esc(text) {
|
|
3
|
-
return text.replace(/[&<>"]/g, (ch) => ESC[ch]);
|
|
4
|
-
}
|
|
5
|
-
export function highlightXml(code) {
|
|
6
|
-
return code.replace(/(<\/?)(\w[\w-]*)|(\[[\w.-]+\])=("(?:[^"\\]|\\.)*")|(\([\w.-]+\))=("(?:[^"\\]|\\.)*")|([\w[\].-]+)=("(?:[^"\\]|\\.)*")|("(?:[^"\\]|\\.)*")|(\/?>)/g, (_match, tagOpen, tagName, bindingAttr, bindingVal, eventAttr, eventVal, attrName, attrValue, strLiteral, closing) => {
|
|
7
|
-
if (tagOpen != null && tagName != null) {
|
|
8
|
-
return `<span class="prism-hl-tag">${esc(tagOpen)}</span><span class="prism-hl-name">${esc(tagName)}</span>`;
|
|
9
|
-
}
|
|
10
|
-
if (bindingAttr != null && bindingVal != null) {
|
|
11
|
-
return `<span class="prism-hl-binding">${esc(bindingAttr)}</span>=<span class="prism-hl-string">${esc(bindingVal)}</span>`;
|
|
12
|
-
}
|
|
13
|
-
if (eventAttr != null && eventVal != null) {
|
|
14
|
-
return `<span class="prism-hl-event">${esc(eventAttr)}</span>=<span class="prism-hl-string">${esc(eventVal)}</span>`;
|
|
15
|
-
}
|
|
16
|
-
if (attrName != null && attrValue != null) {
|
|
17
|
-
return `<span class="prism-hl-attr">${esc(attrName)}</span>=<span class="prism-hl-string">${esc(attrValue)}</span>`;
|
|
18
|
-
}
|
|
19
|
-
if (strLiteral != null) {
|
|
20
|
-
return `<span class="prism-hl-string">${esc(strLiteral)}</span>`;
|
|
21
|
-
}
|
|
22
|
-
if (closing != null) {
|
|
23
|
-
return `<span class="prism-hl-tag">${esc(closing)}</span>`;
|
|
24
|
-
}
|
|
25
|
-
return esc(_match);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IconEntry } from '../../plugin/page.types.js';
|
|
2
|
-
export interface ResolveIconsOptions {
|
|
3
|
-
pattern: string;
|
|
4
|
-
workspaceRoot: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function resolveIcons(options: ResolveIconsOptions): IconEntry[];
|
|
7
|
-
//# sourceMappingURL=icon-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon-resolver.d.ts","sourceRoot":"","sources":["../../../src/builder/icon-resolver/icon-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,EAAE,CAStE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { basename } from 'path';
|
|
3
|
-
import { globSync } from 'glob';
|
|
4
|
-
export function resolveIcons(options) {
|
|
5
|
-
const { pattern, workspaceRoot } = options;
|
|
6
|
-
const files = globSync(pattern, { cwd: workspaceRoot, absolute: true }).sort();
|
|
7
|
-
return files.map((filePath) => ({
|
|
8
|
-
name: basename(filePath, '.svg'),
|
|
9
|
-
svg: readFileSync(filePath, 'utf-8'),
|
|
10
|
-
filePath,
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/icon-resolver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { resolveIcons } from './icon-resolver.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/token-scanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { parseTokenFile, detectVisualization, scanTokens } from './token-scanner.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DesignTokenGroup, TokenVisualization } from '../../plugin/page.types.js';
|
|
2
|
-
export interface ScanTokensOptions {
|
|
3
|
-
patterns: string[];
|
|
4
|
-
workspaceRoot: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function detectVisualization(value: string): TokenVisualization;
|
|
7
|
-
export declare function parseTokenFile(content: string, filePath: string): DesignTokenGroup[];
|
|
8
|
-
export declare function scanTokens(options: ScanTokensOptions): DesignTokenGroup[];
|
|
9
|
-
//# sourceMappingURL=token-scanner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"token-scanner.d.ts","sourceRoot":"","sources":["../../../src/builder/token-scanner/token-scanner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEpG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CAerE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA0DpF;AAsBD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,EAAE,CAazE"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { globSync } from 'glob';
|
|
3
|
-
export function detectVisualization(value) {
|
|
4
|
-
const trimmed = value.trim();
|
|
5
|
-
if (/^#([0-9a-fA-F]{3,8})$/.test(trimmed))
|
|
6
|
-
return 'color';
|
|
7
|
-
if (/^rgba?\s*\(/.test(trimmed))
|
|
8
|
-
return 'color';
|
|
9
|
-
if (/^hsla?\s*\(/.test(trimmed))
|
|
10
|
-
return 'color';
|
|
11
|
-
if (/^\d+(\.\d+)?\s*(px|rem|em|%)$/.test(trimmed))
|
|
12
|
-
return 'spacing';
|
|
13
|
-
if (/\d+\s*px\s+\d+\s*px\s+.*rgba?\s*\(/.test(trimmed))
|
|
14
|
-
return 'shadow';
|
|
15
|
-
if (/^0\s+\d/.test(trimmed) && /rgba?\s*\(/.test(trimmed))
|
|
16
|
-
return 'shadow';
|
|
17
|
-
if (/['"][^'"]+['"]/.test(trimmed) && /sans-serif|serif|monospace|system-ui/.test(trimmed))
|
|
18
|
-
return 'typography';
|
|
19
|
-
return 'raw';
|
|
20
|
-
}
|
|
21
|
-
export function parseTokenFile(content, filePath) {
|
|
22
|
-
const groups = [];
|
|
23
|
-
let current = null;
|
|
24
|
-
let nextTypeOverride = null;
|
|
25
|
-
for (const line of content.split('\n')) {
|
|
26
|
-
const trimmed = line.trim();
|
|
27
|
-
const prismMatch = trimmed.match(/^\/\/\s*@prism\s+(.+)$/);
|
|
28
|
-
if (prismMatch) {
|
|
29
|
-
current = {
|
|
30
|
-
title: prismMatch[1].trim(),
|
|
31
|
-
filePath,
|
|
32
|
-
tokens: [],
|
|
33
|
-
};
|
|
34
|
-
groups.push(current);
|
|
35
|
-
nextTypeOverride = null;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (!current)
|
|
39
|
-
continue;
|
|
40
|
-
const descMatch = trimmed.match(/^\/\/\s*@description\s+(.+)$/);
|
|
41
|
-
if (descMatch) {
|
|
42
|
-
current.description = descMatch[1].trim();
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const catMatch = trimmed.match(/^\/\/\s*@category\s+(.+)$/);
|
|
46
|
-
if (catMatch) {
|
|
47
|
-
current.category = catMatch[1].trim();
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
const typeMatch = trimmed.match(/^\/\/\s*@type\s+(\w+)$/);
|
|
51
|
-
if (typeMatch) {
|
|
52
|
-
nextTypeOverride = typeMatch[1];
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const scssMatch = trimmed.match(/^(\$[\w-]+)\s*:\s*(.+?)\s*(!default\s*)?;(.*)$/);
|
|
56
|
-
if (scssMatch) {
|
|
57
|
-
const token = buildToken(scssMatch[1], scssMatch[2], scssMatch[4], nextTypeOverride);
|
|
58
|
-
current.tokens.push(token);
|
|
59
|
-
nextTypeOverride = null;
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
const cssMatch = trimmed.match(/^(--[\w-]+)\s*:\s*(.+?)\s*;(.*)$/);
|
|
63
|
-
if (cssMatch) {
|
|
64
|
-
const token = buildToken(cssMatch[1], cssMatch[2], cssMatch[3], nextTypeOverride);
|
|
65
|
-
current.tokens.push(token);
|
|
66
|
-
nextTypeOverride = null;
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return groups;
|
|
71
|
-
}
|
|
72
|
-
function buildToken(name, value, trailingComment, typeOverride) {
|
|
73
|
-
const token = {
|
|
74
|
-
name,
|
|
75
|
-
value: value.trim(),
|
|
76
|
-
visualization: typeOverride ?? detectVisualization(value),
|
|
77
|
-
};
|
|
78
|
-
const commentMatch = trailingComment?.match(/\/\/\s*(.+)$/);
|
|
79
|
-
if (commentMatch) {
|
|
80
|
-
token.description = commentMatch[1].trim();
|
|
81
|
-
}
|
|
82
|
-
return token;
|
|
83
|
-
}
|
|
84
|
-
export function scanTokens(options) {
|
|
85
|
-
const { patterns, workspaceRoot } = options;
|
|
86
|
-
const groups = [];
|
|
87
|
-
for (const pattern of patterns) {
|
|
88
|
-
const files = globSync(pattern, { cwd: workspaceRoot, absolute: true });
|
|
89
|
-
for (const file of files) {
|
|
90
|
-
const content = readFileSync(file, 'utf-8');
|
|
91
|
-
groups.push(...parseTokenFile(content, file));
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return groups;
|
|
95
|
-
}
|