@ng-prism/plugin-figma 21.12.0-beta.1 → 21.12.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.
@@ -1 +1 @@
1
- {"version":3,"file":"figma-plugin.d.ts","sourceRoot":"","sources":["../src/figma-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AASvF,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,aAAa,CAyB3E"}
1
+ {"version":3,"file":"figma-plugin.d.ts","sourceRoot":"","sources":["../src/figma-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAejC,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,aAAa,CAyB3E"}
@@ -1,7 +1,8 @@
1
- import { FIGMA_PLUGIN_CONFIG } from './figma-config.token.js';
1
+ import { FIGMA_PLUGIN_CONFIG, } from './figma-config.token.js';
2
2
  import { FigmaPanelComponent } from './figma-panel.component.js';
3
3
  const hasFigmaMeta = (comp) => typeof comp.meta.showcaseConfig.meta?.['figma'] === 'string';
4
- const hasVariantFigmaMeta = (comp) => comp.meta.showcaseConfig.variants?.some((v) => v.meta?.['figma'] != null) === true;
4
+ const hasVariantFigmaMeta = (comp) => comp.meta.showcaseConfig.variants?.some((v) => v.meta?.['figma'] != null) ===
5
+ true;
5
6
  export function figmaPlugin(options = {}) {
6
7
  return {
7
8
  name: '@ng-prism/plugin-figma',
@@ -0,0 +1,4 @@
1
+ import { type Rule } from '@angular-devkit/schematics';
2
+ import type { NgAddSchemaOptions } from './schema.js';
3
+ export declare function ngAdd(options: NgAddSchemaOptions): Rule;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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;AAoCtD,wBAAgB,KAAK,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEvD"}
@@ -0,0 +1,33 @@
1
+ import { chain, } from '@angular-devkit/schematics';
2
+ import { addPluginToConfig } from '@ng-prism/core/schematics/utils';
3
+ const PLUGIN_IMPORT_NAME = 'figmaPlugin';
4
+ const PLUGIN_IMPORT_FROM = '@ng-prism/plugin-figma';
5
+ const PLUGIN_CALL = 'figmaPlugin()';
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
+ function logOptionalPeersHint() {
24
+ return (tree, context) => {
25
+ context.logger.info('');
26
+ context.logger.info(' Optional peers for screenshot/diff features (install if needed):');
27
+ context.logger.info(' npm install --save-dev html2canvas pixelmatch');
28
+ return tree;
29
+ };
30
+ }
31
+ export function ngAdd(options) {
32
+ return chain([injectPlugin(options), logOptionalPeersHint()]);
33
+ }
@@ -0,0 +1,4 @@
1
+ export interface NgAddSchemaOptions {
2
+ configPath?: string;
3
+ }
4
+ //# sourceMappingURL=schema.d.ts.map
@@ -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-figma",
3
- "version": "21.12.0-beta.1",
3
+ "version": "21.12.0",
4
4
  "description": "Figma design embed 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
  "figma",
@@ -24,13 +28,14 @@
24
28
  },
25
29
  "files": [
26
30
  "dist",
31
+ "schematics",
27
32
  "!**/*.tsbuildinfo"
28
33
  ],
29
34
  "peerDependencies": {
30
35
  "@angular/core": ">=21.0.0",
31
36
  "html2canvas": ">=1.4.0",
32
37
  "pixelmatch": ">=6.0.0",
33
- "@ng-prism/core": ">=21.0.0-0"
38
+ "@ng-prism/core": "^21.12.0-0"
34
39
  },
35
40
  "peerDependenciesMeta": {
36
41
  "html2canvas": {
@@ -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-figma 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": "NgPrismPluginFigmaNgAdd",
4
+ "title": "Add @ng-prism/plugin-figma",
5
+ "description": "Registers @ng-prism/plugin-figma 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
+ }