angular-three-soba 1.9.0 → 1.9.1

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,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, Directive, Component, CUSTOM_ELEMENTS_SCHEMA, Input, EventEmitter, Output, TemplateRef, ContentChild, ChangeDetectorRef } from '@angular/core';
3
- import { extend, NgtStore, getLocalState, NgtRxStore, injectNgtRef, NgtArgs, NgtRepeat, is, injectBeforeRender, NgtPush, injectNgtDestroy, injectNgtLoader, startWithUndefined, prepare, NgtPortal, NgtPortalContent, createRunInContext } from 'angular-three';
3
+ import { extend, NgtStore, getLocalState, NgtRxStore, injectNgtRef, NgtArgs, NgtRepeat, is, injectBeforeRender, NgtPush, injectNgtDestroy, injectNgtLoader, startWithUndefined, prepare, NgtPortal, NgtPortalContent, createRunInContext, checkUpdate } from 'angular-three';
4
4
  import { shaderMaterial, SpotLightMaterial } from 'angular-three-soba/shaders';
5
5
  import { Subject, combineLatest, switchMap, isObservable, of, debounceTime, map, takeUntil, startWith, withLatestFrom } from 'rxjs';
6
6
  import * as THREE from 'three';
@@ -2640,10 +2640,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2640
2640
  }] } });
2641
2641
 
2642
2642
  class NgtsSpotLightShadowMeshInput extends NgtRxStore {
2643
- constructor() {
2644
- super(...arguments);
2645
- this.cdr = inject(ChangeDetectorRef);
2646
- }
2647
2643
  set distance(distance) {
2648
2644
  this.set({ distance });
2649
2645
  }
@@ -2658,7 +2654,6 @@ class NgtsSpotLightShadowMeshInput extends NgtRxStore {
2658
2654
  }
2659
2655
  set shader(shader) {
2660
2656
  this.set({ shader });
2661
- this.cdr.detectChanges();
2662
2657
  }
2663
2658
  set width(width) {
2664
2659
  this.set({ width });
@@ -2731,12 +2726,17 @@ class NgtsSpotLightShadowNoShader extends NgtsSpotLightShadowMeshInput {
2731
2726
  this.mesh = injectNgtRef();
2732
2727
  this.spotLightApi = inject(NGTS_SPOT_LIGHT_API);
2733
2728
  this.DoubleSide = THREE.DoubleSide;
2734
- this.RepeatWrapping = THREE.RepeatWrapping;
2735
2729
  this.runInContext = createRunInContext();
2736
2730
  }
2737
2731
  initialize() {
2738
2732
  super.initialize();
2739
2733
  this.set({ distance: 0.4, alphaTest: 0.5, width: 512, height: 512 });
2734
+ this.hold(this.select('map'), (map) => {
2735
+ if (map) {
2736
+ map.wrapS = map.wrapT = THREE.RepeatWrapping;
2737
+ checkUpdate(map);
2738
+ }
2739
+ });
2740
2740
  }
2741
2741
  ngOnInit() {
2742
2742
  const commonEffect = this.runInContext(() => {
@@ -2750,19 +2750,16 @@ NgtsSpotLightShadowNoShader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
2750
2750
  <ngt-mesh [ref]="mesh" [scale]="get('scale')" [castShadow]="true">
2751
2751
  <ngt-plane-geometry />
2752
2752
  <ngt-mesh-basic-material
2753
- *ngIf="!!get('map')"
2754
2753
  [transparent]="true"
2755
2754
  [side]="DoubleSide"
2756
2755
  [alphaTest]="get('alphaTest')"
2757
- [alphaMap]="get('map')"
2756
+ [alphaMap]="key$('map') | ngtPush"
2758
2757
  [opacity]="spotLightApi.debug ? 1 : 0"
2759
2758
  >
2760
- <ngt-value [rawValue]="RepeatWrapping" attach="alphaMap.wrapS" />
2761
- <ngt-value [rawValue]="RepeatWrapping" attach="alphaMap.wrapT" />
2762
2759
  <ng-content />
2763
2760
  </ngt-mesh-basic-material>
2764
2761
  </ngt-mesh>
2765
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2762
+ `, isInline: true, dependencies: [{ kind: "pipe", type: NgtPush, name: "ngtPush" }] });
2766
2763
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgtsSpotLightShadowNoShader, decorators: [{
2767
2764
  type: Component,
2768
2765
  args: [{
@@ -2772,20 +2769,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2772
2769
  <ngt-mesh [ref]="mesh" [scale]="get('scale')" [castShadow]="true">
2773
2770
  <ngt-plane-geometry />
2774
2771
  <ngt-mesh-basic-material
2775
- *ngIf="!!get('map')"
2776
2772
  [transparent]="true"
2777
2773
  [side]="DoubleSide"
2778
2774
  [alphaTest]="get('alphaTest')"
2779
- [alphaMap]="get('map')"
2775
+ [alphaMap]="key$('map') | ngtPush"
2780
2776
  [opacity]="spotLightApi.debug ? 1 : 0"
2781
2777
  >
2782
- <ngt-value [rawValue]="RepeatWrapping" attach="alphaMap.wrapS" />
2783
- <ngt-value [rawValue]="RepeatWrapping" attach="alphaMap.wrapT" />
2784
2778
  <ng-content />
2785
2779
  </ngt-mesh-basic-material>
2786
2780
  </ngt-mesh>
2787
2781
  `,
2788
- imports: [NgIf],
2782
+ imports: [NgtPush],
2789
2783
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
2790
2784
  }]
2791
2785
  }] });
@@ -2909,7 +2903,7 @@ class NgtsSpotLightShadow extends NgtsSpotLightShadowMeshInput {
2909
2903
  NgtsSpotLightShadow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgtsSpotLightShadow, deps: null, target: i0.ɵɵFactoryTarget.Component });
2910
2904
  NgtsSpotLightShadow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.4", type: NgtsSpotLightShadow, isStandalone: true, selector: "ngts-spot-light-shadow", usesInheritance: true, ngImport: i0, template: `
2911
2905
  <ngts-spot-light-shadow-shader
2912
- *ngIf="!!get('shader')"
2906
+ *ngIf="!!get('shader'); else noShader"
2913
2907
  [distance]="get('distance')"
2914
2908
  [shader]="get('shader')"
2915
2909
  [alphaTest]="get('alphaTest')"
@@ -2918,15 +2912,16 @@ NgtsSpotLightShadow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ve
2918
2912
  [width]="get('width')"
2919
2913
  [height]="get('height')"
2920
2914
  />
2921
- <ngts-spot-light-shadow-no-shader
2922
- *ngIf="!get('shader')"
2923
- [distance]="get('distance')"
2924
- [alphaTest]="get('alphaTest')"
2925
- [scale]="get('scale')"
2926
- [map]="get('map')"
2927
- [width]="get('width')"
2928
- [height]="get('height')"
2929
- />
2915
+ <ng-template #noShader>
2916
+ <ngts-spot-light-shadow-no-shader
2917
+ [distance]="get('distance')"
2918
+ [alphaTest]="get('alphaTest')"
2919
+ [scale]="get('scale')"
2920
+ [map]="get('map')"
2921
+ [width]="get('width')"
2922
+ [height]="get('height')"
2923
+ />
2924
+ </ng-template>
2930
2925
  `, isInline: true, dependencies: [{ kind: "component", type: NgtsSpotLightShadowShader, selector: "ngts-spot-light-shadow-shader" }, { kind: "component", type: NgtsSpotLightShadowNoShader, selector: "ngts-spot-light-shadow-no-shader" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2931
2926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: NgtsSpotLightShadow, decorators: [{
2932
2927
  type: Component,
@@ -2935,7 +2930,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2935
2930
  standalone: true,
2936
2931
  template: `
2937
2932
  <ngts-spot-light-shadow-shader
2938
- *ngIf="!!get('shader')"
2933
+ *ngIf="!!get('shader'); else noShader"
2939
2934
  [distance]="get('distance')"
2940
2935
  [shader]="get('shader')"
2941
2936
  [alphaTest]="get('alphaTest')"
@@ -2944,15 +2939,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
2944
2939
  [width]="get('width')"
2945
2940
  [height]="get('height')"
2946
2941
  />
2947
- <ngts-spot-light-shadow-no-shader
2948
- *ngIf="!get('shader')"
2949
- [distance]="get('distance')"
2950
- [alphaTest]="get('alphaTest')"
2951
- [scale]="get('scale')"
2952
- [map]="get('map')"
2953
- [width]="get('width')"
2954
- [height]="get('height')"
2955
- />
2942
+ <ng-template #noShader>
2943
+ <ngts-spot-light-shadow-no-shader
2944
+ [distance]="get('distance')"
2945
+ [alphaTest]="get('alphaTest')"
2946
+ [scale]="get('scale')"
2947
+ [map]="get('map')"
2948
+ [width]="get('width')"
2949
+ [height]="get('height')"
2950
+ />
2951
+ </ng-template>
2956
2952
  `,
2957
2953
  imports: [NgtsSpotLightShadowShader, NgtsSpotLightShadowNoShader, NgIf, NgtPush],
2958
2954
  }]