angular-three-postprocessing 2.0.0-beta.255 → 2.0.0-beta.257

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 { inject, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, input, Directive, Injector, computed, viewChild, afterNextRender } from '@angular/core';
3
- import { injectStore, extend, createApiToken, pick, injectBeforeRender, getLocalState, NgtArgs, vector2, is } from 'angular-three';
3
+ import { injectStore, extend, pick, injectBeforeRender, getLocalState, NgtArgs, vector2, is } from 'angular-three';
4
4
  import { createNoopInjectionToken } from 'ngxtension/create-injection-token';
5
5
  import { injectAutoEffect } from 'ngxtension/auto-effect';
6
6
  import { mergeInputs } from 'ngxtension/inject-inputs';
@@ -56,7 +56,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
56
56
  const NgtpEffectHostDirective = { directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] };
57
57
 
58
58
  extend({ Group });
59
- const [injectEffectComposerApi, provideEffectComposerApi] = createApiToken(() => NgtpEffectComposer);
60
59
  const defaultOptions$3 = {
61
60
  enabled: true,
62
61
  renderPriority: 1,
@@ -123,15 +122,6 @@ class NgtpEffectComposer {
123
122
  }
124
123
  return { composer, normalPass, downSamplingPass };
125
124
  });
126
- this.api = computed(() => {
127
- const [{ composer, normalPass, downSamplingPass }, camera, scene, resolutionScale] = [
128
- this.composerData(),
129
- this.camera(),
130
- this.scene(),
131
- this.resolutionScale(),
132
- ];
133
- return { composer, camera, scene, normalPass, downSamplingPass, resolutionScale };
134
- });
135
125
  afterNextRender(() => {
136
126
  this.disableToneMapping();
137
127
  this.setComposerSize();
@@ -224,7 +214,7 @@ class NgtpEffectComposer {
224
214
  });
225
215
  }
226
216
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: NgtpEffectComposer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
227
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.0.6", type: NgtpEffectComposer, isStandalone: true, selector: "ngtp-effect-composer", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideEffectComposerApi()], viewQueries: [{ propertyName: "group", first: true, predicate: ["group"], descendants: true, isSignal: true }], ngImport: i0, template: `
217
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.0.6", type: NgtpEffectComposer, isStandalone: true, selector: "ngtp-effect-composer", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "group", first: true, predicate: ["group"], descendants: true, isSignal: true }], ngImport: i0, template: `
228
218
  <ngt-group #group>
229
219
  <ng-content />
230
220
  </ngt-group>
@@ -240,7 +230,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
240
230
  <ng-content />
241
231
  </ngt-group>
242
232
  `,
243
- providers: [provideEffectComposerApi()],
244
233
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
245
234
  changeDetection: ChangeDetectionStrategy.OnPush,
246
235
  }]
@@ -552,11 +541,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
552
541
  class NgtpDepthOfField {
553
542
  constructor() {
554
543
  this.autoEffect = injectAutoEffect();
555
- this.composerApi = injectEffectComposerApi();
544
+ this.effectComposer = inject(NgtpEffectComposer);
556
545
  this.options = input({});
557
546
  this.autoFocus = computed(() => this.options().target != null);
558
547
  this.effect = computed(() => {
559
- const [{ camera }, options, autoFocus] = [this.composerApi(), this.options(), this.autoFocus()];
548
+ const [camera, options, autoFocus] = [this.effectComposer.camera(), this.options(), this.autoFocus()];
560
549
  const effect = new DepthOfFieldEffect(camera, options);
561
550
  // Creating a target enables autofocus, R3F will set via props
562
551
  if (autoFocus)
@@ -722,10 +711,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
722
711
  class NgtpGodRays {
723
712
  constructor() {
724
713
  this.autoEffect = injectAutoEffect();
725
- this.composerApi = injectEffectComposerApi();
714
+ this.effectComposer = inject(NgtpEffectComposer);
726
715
  this.options = input({});
727
716
  this.effect = computed(() => {
728
- const [{ camera }, { sun, ...options }] = [this.composerApi(), this.options()];
717
+ const [camera, { sun, ...options }] = [this.effectComposer.camera(), this.options()];
729
718
  return new GodRaysEffect(camera, is.ref(sun) ? sun.nativeElement : sun, options);
730
719
  });
731
720
  afterNextRender(() => {
@@ -920,7 +909,7 @@ class NgtpLensFlare {
920
909
  this.viewport = this.store.select('viewport');
921
910
  this.raycaster = this.store.select('raycaster');
922
911
  this.pointer = this.store.select('pointer');
923
- this.composerApi = injectEffectComposerApi();
912
+ this.effectComposer = inject(NgtpEffectComposer);
924
913
  this.options = input(defaultOptions$1, { transform: mergeInputs(defaultOptions$1) });
925
914
  this.projectedPosition = new Vector3();
926
915
  this.mouse2d = new Vector2();
@@ -942,10 +931,11 @@ class NgtpLensFlare {
942
931
  const [effect] = [this.effect()];
943
932
  if (!effect)
944
933
  return;
945
- const [{ followMouse, position, smoothTime }, pointer, { camera, scene }, raycaster] = [
934
+ const [{ followMouse, position, smoothTime }, pointer, camera, scene, raycaster] = [
946
935
  this.options(),
947
936
  this.pointer(),
948
- this.composerApi(),
937
+ this.effectComposer.camera(),
938
+ this.effectComposer.scene(),
949
939
  this.raycaster(),
950
940
  ];
951
941
  const uLensPosition = effect.uniforms.get('lensPosition');
@@ -1485,5 +1475,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
1485
1475
  * Generated bundle index. Do not edit.
1486
1476
  */
1487
1477
 
1488
- export { ASCIIEffect, LensFlareEffect, NgtpASCII, NgtpBloom, NgtpBrightnessContrast, NgtpChromaticAberration, NgtpColorAverage, NgtpColorDepth, NgtpDepth, NgtpDepthOfField, NgtpDotScreen, NgtpEffect, NgtpEffectBlendMode, NgtpEffectComposer, NgtpEffectHostDirective, NgtpFXAA, NgtpGlitch, NgtpGodRays, NgtpGrid, NgtpHueSaturation, NgtpLUT, NgtpLensFlare, NgtpNoise, NgtpPixelation, NgtpSMAA, NgtpScanline, NgtpSepia, NgtpShockWave, NgtpTiltShift, NgtpTiltShift2, NgtpVignette, NgtpWater, TiltShift2Effect, WaterEffect, injectDefaultEffectOptions, injectEffectComposerApi, provideDefaultEffectOptions, provideEffectComposerApi };
1478
+ export { ASCIIEffect, LensFlareEffect, NgtpASCII, NgtpBloom, NgtpBrightnessContrast, NgtpChromaticAberration, NgtpColorAverage, NgtpColorDepth, NgtpDepth, NgtpDepthOfField, NgtpDotScreen, NgtpEffect, NgtpEffectBlendMode, NgtpEffectComposer, NgtpEffectHostDirective, NgtpFXAA, NgtpGlitch, NgtpGodRays, NgtpGrid, NgtpHueSaturation, NgtpLUT, NgtpLensFlare, NgtpNoise, NgtpPixelation, NgtpSMAA, NgtpScanline, NgtpSepia, NgtpShockWave, NgtpTiltShift, NgtpTiltShift2, NgtpVignette, NgtpWater, TiltShift2Effect, WaterEffect, injectDefaultEffectOptions, provideDefaultEffectOptions };
1489
1479
  //# sourceMappingURL=angular-three-postprocessing.mjs.map