@ng-prism/plugin-figma 21.12.0 → 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.
|
@@ -147,10 +147,14 @@ export class FigmaDesignDiffPanelComponent {
|
|
|
147
147
|
config = inject(FIGMA_PLUGIN_CONFIG);
|
|
148
148
|
nav = inject(PrismNavigationService);
|
|
149
149
|
renderer = inject(PrismRendererService);
|
|
150
|
-
activeComponent = input(null,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
activeComponent = input(null, /* @ts-ignore */
|
|
151
|
+
...(ngDevMode ? [{ debugName: "activeComponent" }] : /* istanbul ignore next */ []));
|
|
152
|
+
state = signal({ status: 'idle' }, /* @ts-ignore */
|
|
153
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
154
|
+
activeMode = signal('side-by-side', /* @ts-ignore */
|
|
155
|
+
...(ngDevMode ? [{ debugName: "activeMode" }] : /* istanbul ignore next */ []));
|
|
156
|
+
overlayOpacity = signal(50, /* @ts-ignore */
|
|
157
|
+
...(ngDevMode ? [{ debugName: "overlayOpacity" }] : /* istanbul ignore next */ []));
|
|
154
158
|
modes = [
|
|
155
159
|
{ value: 'side-by-side', label: 'Side-by-side' },
|
|
156
160
|
{ value: 'overlay', label: 'Overlay' },
|
|
@@ -159,15 +163,18 @@ export class FigmaDesignDiffPanelComponent {
|
|
|
159
163
|
doneResult = computed(() => {
|
|
160
164
|
const s = this.state();
|
|
161
165
|
return s.status === 'done' ? s.result : null;
|
|
162
|
-
},
|
|
166
|
+
}, /* @ts-ignore */
|
|
167
|
+
...(ngDevMode ? [{ debugName: "doneResult" }] : /* istanbul ignore next */ []));
|
|
163
168
|
similarity = computed(() => {
|
|
164
169
|
const r = this.doneResult();
|
|
165
170
|
return r ? r.similarity.toFixed(1) : '0';
|
|
166
|
-
},
|
|
171
|
+
}, /* @ts-ignore */
|
|
172
|
+
...(ngDevMode ? [{ debugName: "similarity" }] : /* istanbul ignore next */ []));
|
|
167
173
|
errorMessage = computed(() => {
|
|
168
174
|
const s = this.state();
|
|
169
175
|
return s.status === 'error-api' ? s.message : '';
|
|
170
|
-
},
|
|
176
|
+
}, /* @ts-ignore */
|
|
177
|
+
...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
171
178
|
activeVariantMeta = computed(() => {
|
|
172
179
|
const comp = this.nav.activeComponent();
|
|
173
180
|
if (!comp)
|
|
@@ -178,7 +185,8 @@ export class FigmaDesignDiffPanelComponent {
|
|
|
178
185
|
if (variantFigma !== undefined)
|
|
179
186
|
return parseFigmaMeta(variantFigma);
|
|
180
187
|
return parseFigmaMeta(comp.meta.showcaseConfig.meta?.['figma']);
|
|
181
|
-
},
|
|
188
|
+
}, /* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [{ debugName: "activeVariantMeta" }] : /* istanbul ignore next */ []));
|
|
182
190
|
runDiff() {
|
|
183
191
|
if (!this.config.accessToken) {
|
|
184
192
|
this.state.set({ status: 'error-no-token' });
|
|
@@ -228,7 +236,7 @@ export class FigmaDesignDiffPanelComponent {
|
|
|
228
236
|
let tmp_0_0;
|
|
229
237
|
i0.ɵɵadvance();
|
|
230
238
|
i0.ɵɵconditional((tmp_0_0 = ctx.state().status) === "error-no-token" ? 1 : tmp_0_0 === "error-no-node" ? 2 : tmp_0_0 === "error-api" ? 3 : tmp_0_0 === "idle" ? 4 : tmp_0_0 === "loading" ? 5 : tmp_0_0 === "done" ? 6 : -1);
|
|
231
|
-
} }, styles: [".diff-panel[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n font-family: var(--prism-font-sans);\n font-size: 13px;\n color: var(--prism-text-1);\n background: var(--prism-bg-elevated);\n }\n\n .diff-panel__empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 8px;\n padding: 24px;\n text-align: center;\n }\n\n .diff-panel__empty-title[_ngcontent-%COMP%] { font-weight: 500; color: var(--prism-text-1); margin: 0; }\n .diff-panel__empty-hint[_ngcontent-%COMP%] { color: var(--prism-text-muted); margin: 0; }\n .diff-panel__empty--error[_ngcontent-%COMP%] .diff-panel__empty-title[_ngcontent-%COMP%] { color: #ef4444; }\n\n .diff-panel__idle[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n }\n\n .diff-panel__loading[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n height: 100%;\n color: var(--prism-text-muted);\n }\n\n .diff-panel__spinner[_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n border: 2px solid var(--prism-border);\n border-top-color: var(--prism-primary);\n border-radius: 50%;\n animation: _ngcontent-%COMP%_spin 0.7s linear infinite;\n }\n\n @keyframes _ngcontent-%COMP%_spin { to { transform: rotate(360deg); } }\n\n .diff-panel__run-btn[_ngcontent-%COMP%] {\n padding: 8px 16px;\n background: var(--prism-primary);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n cursor: pointer;\n }\n\n .diff-panel__run-btn[_ngcontent-%COMP%]:hover { opacity: 0.9; }\n .diff-panel__run-btn--sm[_ngcontent-%COMP%] { padding: 5px 10px; font-size: 12px; }\n\n .diff-panel__result[_ngcontent-%COMP%] { display: flex; flex-direction: column; height: 100%; }\n\n .diff-panel__toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--prism-border);\n flex-shrink: 0;\n }\n\n .diff-panel__modes[_ngcontent-%COMP%] { display: flex; gap: 2px; }\n\n .diff-panel__mode-btn[_ngcontent-%COMP%] {\n padding: 4px 10px;\n border: 1px solid var(--prism-border);\n background: none;\n font-size: 12px;\n font-family: var(--prism-font-sans);\n color: var(--prism-text-muted);\n cursor: pointer;\n border-radius: 4px;\n }\n\n .diff-panel__mode-btn--active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n color: #fff;\n border-color: var(--prism-primary);\n }\n\n .diff-panel__stats[_ngcontent-%COMP%] {\n margin-left: auto;\n color: var(--prism-text-muted);\n font-variant-numeric: tabular-nums;\n }\n\n .diff-panel__canvas-area[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n padding: 16px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n }\n\n .diff-panel__split[_ngcontent-%COMP%] { display: flex; gap: 16px; width: 100%; }\n\n .diff-panel__split-side[_ngcontent-%COMP%] { flex: 1; display: flex; flex-direction: column; gap: 6px; }\n\n .diff-panel__split-label[_ngcontent-%COMP%] {\n font-size: 11px;\n font-weight: 500;\n color: var(--prism-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n\n .diff-panel__split-side[_ngcontent-%COMP%] img[_ngcontent-%COMP%], \n .diff-panel__canvas-area[_ngcontent-%COMP%] img[_ngcontent-%COMP%] {\n max-width: 100%;\n border: 1px solid var(--prism-border);\n border-radius: 4px;\n }\n\n .diff-panel__overlay-wrap[_ngcontent-%COMP%] { position: relative; display: inline-block; }\n\n .diff-panel__overlay-top[_ngcontent-%COMP%] {\n position: absolute;\n top: 0; left: 0;\n width: 100%; height: 100%;\n }\n\n .diff-panel__opacity-slider[_ngcontent-%COMP%] { display: block; width: 200px; margin-top: 12px; }"]
|
|
239
|
+
} }, styles: [".diff-panel[_ngcontent-%COMP%] {\n height: 100%;\n display: flex;\n flex-direction: column;\n font-family: var(--prism-font-sans);\n font-size: 13px;\n color: var(--prism-text-1);\n background: var(--prism-bg-elevated);\n }\n\n .diff-panel__empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 8px;\n padding: 24px;\n text-align: center;\n }\n\n .diff-panel__empty-title[_ngcontent-%COMP%] { font-weight: 500; color: var(--prism-text-1); margin: 0; }\n .diff-panel__empty-hint[_ngcontent-%COMP%] { color: var(--prism-text-muted); margin: 0; }\n .diff-panel__empty--error[_ngcontent-%COMP%] .diff-panel__empty-title[_ngcontent-%COMP%] { color: #ef4444; }\n\n .diff-panel__idle[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n }\n\n .diff-panel__loading[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n height: 100%;\n color: var(--prism-text-muted);\n }\n\n .diff-panel__spinner[_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n border: 2px solid var(--prism-border);\n border-top-color: var(--prism-primary);\n border-radius: 50%;\n animation: _ngcontent-%COMP%_spin 0.7s linear infinite;\n }\n\n @keyframes _ngcontent-%COMP%_spin { to { transform: rotate(360deg); } }\n\n .diff-panel__run-btn[_ngcontent-%COMP%] {\n padding: 8px 16px;\n background: var(--prism-primary);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n cursor: pointer;\n }\n\n .diff-panel__run-btn[_ngcontent-%COMP%]:hover { opacity: 0.9; }\n .diff-panel__run-btn--sm[_ngcontent-%COMP%] { padding: 5px 10px; font-size: 12px; }\n\n .diff-panel__result[_ngcontent-%COMP%] { display: flex; flex-direction: column; height: 100%; }\n\n .diff-panel__toolbar[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--prism-border);\n flex-shrink: 0;\n }\n\n .diff-panel__modes[_ngcontent-%COMP%] { display: flex; gap: 2px; }\n\n .diff-panel__mode-btn[_ngcontent-%COMP%] {\n padding: 4px 10px;\n border: 1px solid var(--prism-border);\n background: none;\n font-size: 12px;\n font-family: var(--prism-font-sans);\n color: var(--prism-text-muted);\n cursor: pointer;\n border-radius: 4px;\n }\n\n .diff-panel__mode-btn--active[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n color: #fff;\n border-color: var(--prism-primary);\n }\n\n .diff-panel__stats[_ngcontent-%COMP%] {\n margin-left: auto;\n color: var(--prism-text-muted);\n font-variant-numeric: tabular-nums;\n }\n\n .diff-panel__canvas-area[_ngcontent-%COMP%] {\n flex: 1;\n overflow: auto;\n padding: 16px;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n }\n\n .diff-panel__split[_ngcontent-%COMP%] { display: flex; gap: 16px; width: 100%; }\n\n .diff-panel__split-side[_ngcontent-%COMP%] { flex: 1; display: flex; flex-direction: column; gap: 6px; }\n\n .diff-panel__split-label[_ngcontent-%COMP%] {\n font-size: 11px;\n font-weight: 500;\n color: var(--prism-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n\n .diff-panel__split-side[_ngcontent-%COMP%] img[_ngcontent-%COMP%], \n .diff-panel__canvas-area[_ngcontent-%COMP%] img[_ngcontent-%COMP%] {\n max-width: 100%;\n border: 1px solid var(--prism-border);\n border-radius: 4px;\n }\n\n .diff-panel__overlay-wrap[_ngcontent-%COMP%] { position: relative; display: inline-block; }\n\n .diff-panel__overlay-top[_ngcontent-%COMP%] {\n position: absolute;\n top: 0; left: 0;\n width: 100%; height: 100%;\n }\n\n .diff-panel__opacity-slider[_ngcontent-%COMP%] { display: block; width: 200px; margin-top: 12px; }"] });
|
|
232
240
|
}
|
|
233
241
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FigmaDesignDiffPanelComponent, [{
|
|
234
242
|
type: Component,
|
|
@@ -18,15 +18,18 @@ function FigmaPanelComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
|
18
18
|
} }
|
|
19
19
|
export class FigmaPanelComponent {
|
|
20
20
|
renderer = inject(Renderer2);
|
|
21
|
-
iframe = viewChild('iframe',
|
|
22
|
-
|
|
21
|
+
iframe = viewChild('iframe', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "iframe" }] : /* istanbul ignore next */ []));
|
|
23
|
+
activeComponent = input(null, /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "activeComponent" }] : /* istanbul ignore next */ []));
|
|
23
25
|
figmaUrl = computed(() => {
|
|
24
26
|
const comp = this.activeComponent();
|
|
25
27
|
if (!comp)
|
|
26
28
|
return null;
|
|
27
29
|
const url = comp.meta?.showcaseConfig?.meta?.['figma'];
|
|
28
30
|
return typeof url === 'string' ? url : null;
|
|
29
|
-
},
|
|
31
|
+
}, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "figmaUrl" }] : /* istanbul ignore next */ []));
|
|
30
33
|
constructor() {
|
|
31
34
|
effect(() => {
|
|
32
35
|
const url = this.figmaUrl();
|
|
@@ -45,7 +48,7 @@ export class FigmaPanelComponent {
|
|
|
45
48
|
i0.ɵɵconditionalCreate(0, FigmaPanelComponent_Conditional_0_Template, 2, 0, "iframe", 1)(1, FigmaPanelComponent_Conditional_1_Template, 5, 2, "div", 2);
|
|
46
49
|
} if (rf & 2) {
|
|
47
50
|
i0.ɵɵconditional(ctx.figmaUrl() ? 0 : 1);
|
|
48
|
-
} }, styles: ["[_nghost-%COMP%] { display: block; width: 100%; height: 100%; }\n .prism-figma-panel__iframe[_ngcontent-%COMP%] {\n width: 100%; height: 100%; min-height: 400px; border: none;\n }\n .prism-figma-panel__empty[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center;\n height: 100%; min-height: 200px;\n color: var(--prism-text-muted); font-size: 14px;\n }\n .prism-figma-panel__empty[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n color: var(--prism-primary);\n padding: 2px 6px; border-radius: var(--radius-xs);\n font-size: var(--fs-lg);\n }"]
|
|
51
|
+
} }, styles: ["[_nghost-%COMP%] { display: block; width: 100%; height: 100%; }\n .prism-figma-panel__iframe[_ngcontent-%COMP%] {\n width: 100%; height: 100%; min-height: 400px; border: none;\n }\n .prism-figma-panel__empty[_ngcontent-%COMP%] {\n display: flex; align-items: center; justify-content: center;\n height: 100%; min-height: 200px;\n color: var(--prism-text-muted); font-size: 14px;\n }\n .prism-figma-panel__empty[_ngcontent-%COMP%] code[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n color: var(--prism-primary);\n padding: 2px 6px; border-radius: var(--radius-xs);\n font-size: var(--fs-lg);\n }"] });
|
|
49
52
|
}
|
|
50
53
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FigmaPanelComponent, [{
|
|
51
54
|
type: Component,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-prism/plugin-figma",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-beta.0",
|
|
4
4
|
"description": "Figma design embed panel for ng-prism.",
|
|
5
5
|
"ng-add": {
|
|
6
6
|
"save": "devDependencies"
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"!**/*.tsbuildinfo"
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@angular/core": ">=
|
|
35
|
+
"@angular/core": ">=20.0.0",
|
|
36
36
|
"html2canvas": ">=1.4.0",
|
|
37
37
|
"pixelmatch": ">=6.0.0",
|
|
38
|
-
"@ng-prism/core": "^
|
|
38
|
+
"@ng-prism/core": "^22.0.0-0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"html2canvas": {
|