@ngxi/vscode-icons 0.12.19 → 0.12.21

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
- import { inject, PLATFORM_ID, ElementRef, Renderer2, input, computed, effect, Directive } from "@angular/core";
3
- import { isPlatformServer } from "@angular/common";
2
+ import { inject, input, computed, Directive } from "@angular/core";
3
+ import { DomSanitizer } from "@angular/platform-browser";
4
4
  const vscodeIconsDefaultFile = {
5
5
  "body": '<path fill="#c5c5c5" d="M20.414 2H5v28h22V8.586ZM7 28V4h12v6h6v18Z"/>',
6
6
  "width": 32,
@@ -8409,44 +8409,24 @@ const vscodeIconsFileTypeMakefile = {
8409
8409
  };
8410
8410
  class Ngxi {
8411
8411
  constructor() {
8412
- this.platform = inject(PLATFORM_ID);
8413
- this.el = inject(ElementRef);
8414
- this.renderer = inject(Renderer2);
8415
- this.icon = input(null);
8416
- this.width = input();
8417
- this.height = input();
8418
- this.viewBox = input();
8419
- this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width);
8420
- this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height);
8421
- this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox);
8422
- this.setBody = effect(() => {
8423
- const icon = this.icon();
8424
- if (!icon) {
8425
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", "");
8426
- return;
8427
- }
8428
- if (isPlatformServer(this.platform)) {
8429
- this.el.nativeElement.innerHTML = icon.body;
8430
- this.el.nativeElement.setAttribute("data-ngxi-ssr", "");
8431
- return;
8432
- }
8433
- if (this.el.nativeElement.hasAttribute("data-ngxi-ssr")) {
8434
- this.el.nativeElement.removeAttribute("data-ngxi-ssr");
8435
- if (this.el.nativeElement.innerHTML === icon.body) {
8436
- return;
8437
- }
8438
- }
8439
- this.renderer.setProperty(this.el.nativeElement, "innerHTML", icon.body);
8440
- });
8412
+ this.sanitizer = inject(DomSanitizer);
8413
+ this.icon = input(...[]);
8414
+ this.width = input(...[]);
8415
+ this.height = input(...[]);
8416
+ this.viewBox = input(...[]);
8417
+ this.resolvedWidth = computed(() => this.width() ?? this.icon()?.width, ...[]);
8418
+ this.resolvedHeight = computed(() => this.height() ?? this.icon()?.height, ...[]);
8419
+ this.resolvedViewBox = computed(() => this.viewBox() ?? this.icon()?.viewBox, ...[]);
8420
+ this.safeSVG = computed(() => this.sanitizer.bypassSecurityTrustHtml(this.icon()?.body ?? ""), ...[]);
8441
8421
  }
8442
8422
  static {
8443
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8423
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8444
8424
  }
8445
8425
  static {
8446
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: Ngxi, isStandalone: true, selector: "svg[ngxi]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, viewBox: { classPropertyName: "viewBox", publicName: "viewBox", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.width": "resolvedWidth()", "attr.height": "resolvedHeight()", "attr.viewBox": "resolvedViewBox()" } }, ngImport: i0 });
8426
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.2", type: Ngxi, isStandalone: true, selector: "svg[ngxi]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, viewBox: { classPropertyName: "viewBox", publicName: "viewBox", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.width": "resolvedWidth()", "attr.height": "resolvedHeight()", "attr.viewBox": "resolvedViewBox()", "innerHTML": "safeSVG()" } }, ngImport: i0 });
8447
8427
  }
8448
8428
  }
8449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Ngxi, decorators: [{
8429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: Ngxi, decorators: [{
8450
8430
  type: Directive,
8451
8431
  args: [{
8452
8432
  standalone: true,
@@ -8455,22 +8435,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
8455
8435
  "role": "img",
8456
8436
  "[attr.width]": "resolvedWidth()",
8457
8437
  "[attr.height]": "resolvedHeight()",
8458
- "[attr.viewBox]": "resolvedViewBox()"
8438
+ "[attr.viewBox]": "resolvedViewBox()",
8439
+ "[innerHTML]": "safeSVG()"
8459
8440
  }
8460
8441
  }]
8461
8442
  }] });
8462
8443
  class NgxiVscodeIcons {
8463
8444
  constructor() {
8464
- this.ngxiVscodeIcons = input.required();
8445
+ this.ngxiVscodeIcons = input.required(...[]);
8465
8446
  }
8466
8447
  static {
8467
- this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiVscodeIcons, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8448
+ this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: NgxiVscodeIcons, deps: [], target: i0.ɵɵFactoryTarget.Directive });
8468
8449
  }
8469
8450
  static {
8470
- this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NgxiVscodeIcons, isStandalone: true, selector: "svg[ngxiVscodeIcons]", inputs: { ngxiVscodeIcons: { classPropertyName: "ngxiVscodeIcons", publicName: "ngxiVscodeIcons", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiVscodeIcons", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
8451
+ this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.2", type: NgxiVscodeIcons, isStandalone: true, selector: "svg[ngxiVscodeIcons]", inputs: { ngxiVscodeIcons: { classPropertyName: "ngxiVscodeIcons", publicName: "ngxiVscodeIcons", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: Ngxi, inputs: ["icon", "ngxiVscodeIcons", "width", "width", "height", "height", "viewBox", "viewBox"] }], ngImport: i0 });
8471
8452
  }
8472
8453
  }
8473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NgxiVscodeIcons, decorators: [{
8454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.2", ngImport: i0, type: NgxiVscodeIcons, decorators: [{
8474
8455
  type: Directive,
8475
8456
  args: [{
8476
8457
  standalone: true,