angular-three-soba 4.2.1 → 4.2.2

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.
@@ -39,7 +39,7 @@ class NgtsStats {
39
39
  * Configuration options for the stats panel.
40
40
  * Accepts a partial NgtsStatsOptions object that will be merged with defaults.
41
41
  */
42
- this.options = input(defaultOptions, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions), alias: 'stats' });
42
+ this.options = input(defaultOptions, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), transform: mergeInputs(defaultOptions), alias: 'stats' });
43
43
  const statsOptions = omit(this.options, ['parent', 'domClass']);
44
44
  const parent = pick(this.options, 'parent');
45
45
  const domClass = pick(this.options, 'domClass');
@@ -52,7 +52,7 @@ class NgtsStats {
52
52
  const stats = new Stats({ ...untracked(statsOptions) });
53
53
  void stats.init(gl);
54
54
  return stats;
55
- }, ...(ngDevMode ? [{ debugName: "stats" }] : []));
55
+ }, ...(ngDevMode ? [{ debugName: "stats" }] : /* istanbul ignore next */ []));
56
56
  effect((onCleanup) => {
57
57
  const _stats = stats();
58
58
  if (!_stats)
@@ -72,10 +72,10 @@ class NgtsStats {
72
72
  });
73
73
  });
74
74
  }
75
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: NgtsStats, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.6", type: NgtsStats, isStandalone: true, selector: "ngt-canvas[stats]", inputs: { options: { classPropertyName: "options", publicName: "stats", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgtsStats, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
76
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: NgtsStats, isStandalone: true, selector: "ngt-canvas[stats]", inputs: { options: { classPropertyName: "options", publicName: "stats", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
77
77
  }
78
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: NgtsStats, decorators: [{
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NgtsStats, decorators: [{
79
79
  type: Directive,
80
80
  args: [{ selector: 'ngt-canvas[stats]' }]
81
81
  }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "stats", required: false }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"angular-three-soba-stats.mjs","sources":["../../../../libs/soba/stats/src/lib/stats.ts","../../../../libs/soba/stats/src/angular-three-soba-stats.ts"],"sourcesContent":["import { computed, Directive, DOCUMENT, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { addAfterEffect, injectStore, omit, pick, resolveRef } from 'angular-three';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport Stats from 'stats-gl';\n\n/**\n * Configuration options for the NgtsStats directive.\n *\n * Extends all properties from the stats-gl Stats class with additional\n * Angular-specific options for DOM placement and styling.\n */\nexport type NgtsStatsOptions = Partial<Stats> & {\n\t/**\n\t * The panel index to display by default.\n\t * - 0: FPS (Frames per Second)\n\t * - 1: MS (Milliseconds per frame)\n\t * - 2: MB (Memory usage)\n\t */\n\tshowPanel?: number;\n\t/**\n\t * CSS class(es) to apply to the stats DOM element.\n\t * Multiple classes can be separated by spaces.\n\t * @default ''\n\t */\n\tdomClass: string;\n\t/**\n\t * The parent element to attach the stats panel to.\n\t * If not provided, the stats panel will be appended to document.body.\n\t * @default null\n\t */\n\tparent: ElementRef<HTMLElement> | HTMLElement | null | undefined;\n};\n\nconst defaultOptions: NgtsStatsOptions = {\n\tdomClass: '',\n\tparent: null,\n};\n\n/**\n * A directive that displays performance statistics (FPS, MS, MB) for the Three.js renderer.\n *\n * This directive uses stats-gl to show real-time performance metrics for your 3D scene.\n * It automatically attaches to the canvas and updates every frame.\n *\n * @example\n * Basic usage:\n * ```html\n * <ngt-canvas [stats]=\"true\" />\n * ```\n *\n * @example\n * With custom options:\n * ```html\n * <ngt-canvas [stats]=\"{ domClass: 'my-stats', showPanel: 0 }\" />\n * ```\n *\n * @example\n * Attached to a custom parent element:\n * ```html\n * <div #statsContainer></div>\n * <ngt-canvas [stats]=\"{ parent: statsContainer }\" />\n * ```\n */\n@Directive({ selector: 'ngt-canvas[stats]' })\nexport class NgtsStats {\n\t/**\n\t * Configuration options for the stats panel.\n\t * Accepts a partial NgtsStatsOptions object that will be merged with defaults.\n\t */\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions), alias: 'stats' });\n\n\tconstructor() {\n\t\tconst statsOptions = omit(this.options, ['parent', 'domClass']);\n\t\tconst parent = pick(this.options, 'parent');\n\t\tconst domClass = pick(this.options, 'domClass');\n\n\t\tconst document = inject(DOCUMENT);\n\t\tconst store = injectStore();\n\n\t\tconst stats = computed(() => {\n\t\t\tconst gl = store.gl();\n\t\t\tif (!gl) return null;\n\n\t\t\tconst stats = new Stats({ ...untracked(statsOptions) });\n\t\t\tvoid stats.init(gl);\n\t\t\treturn stats;\n\t\t});\n\n\t\teffect((onCleanup) => {\n\t\t\tconst _stats = stats();\n\t\t\tif (!_stats) return;\n\n\t\t\tconst [_parent, _domClass] = [resolveRef(parent()), domClass()];\n\t\t\tconst target = _parent ?? document.body;\n\t\t\ttarget.appendChild(_stats.dom);\n\t\t\tconst classList = _domClass.split(' ').filter(Boolean);\n\t\t\tif (classList.length) _stats.dom.classList.add(...classList);\n\t\t\tconst end = addAfterEffect(() => _stats.update());\n\n\t\t\tonCleanup(() => {\n\t\t\t\tif (classList.length) _stats.dom.classList.remove(...classList);\n\t\t\t\ttarget.removeChild(_stats.dom);\n\t\t\t\tend();\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AA,EAAA,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,SAAS;mBAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE;;;AC/D5C;;AAEG;;;;"}
1
+ {"version":3,"file":"angular-three-soba-stats.mjs","sources":["../../../../libs/soba/stats/src/lib/stats.ts","../../../../libs/soba/stats/src/angular-three-soba-stats.ts"],"sourcesContent":["import { computed, Directive, DOCUMENT, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { addAfterEffect, injectStore, omit, pick, resolveRef } from 'angular-three';\nimport { mergeInputs } from 'ngxtension/inject-inputs';\nimport Stats from 'stats-gl';\n\n/**\n * Configuration options for the NgtsStats directive.\n *\n * Extends all properties from the stats-gl Stats class with additional\n * Angular-specific options for DOM placement and styling.\n */\nexport type NgtsStatsOptions = Partial<Stats> & {\n\t/**\n\t * The panel index to display by default.\n\t * - 0: FPS (Frames per Second)\n\t * - 1: MS (Milliseconds per frame)\n\t * - 2: MB (Memory usage)\n\t */\n\tshowPanel?: number;\n\t/**\n\t * CSS class(es) to apply to the stats DOM element.\n\t * Multiple classes can be separated by spaces.\n\t * @default ''\n\t */\n\tdomClass: string;\n\t/**\n\t * The parent element to attach the stats panel to.\n\t * If not provided, the stats panel will be appended to document.body.\n\t * @default null\n\t */\n\tparent: ElementRef<HTMLElement> | HTMLElement | null | undefined;\n};\n\nconst defaultOptions: NgtsStatsOptions = {\n\tdomClass: '',\n\tparent: null,\n};\n\n/**\n * A directive that displays performance statistics (FPS, MS, MB) for the Three.js renderer.\n *\n * This directive uses stats-gl to show real-time performance metrics for your 3D scene.\n * It automatically attaches to the canvas and updates every frame.\n *\n * @example\n * Basic usage:\n * ```html\n * <ngt-canvas [stats]=\"true\" />\n * ```\n *\n * @example\n * With custom options:\n * ```html\n * <ngt-canvas [stats]=\"{ domClass: 'my-stats', showPanel: 0 }\" />\n * ```\n *\n * @example\n * Attached to a custom parent element:\n * ```html\n * <div #statsContainer></div>\n * <ngt-canvas [stats]=\"{ parent: statsContainer }\" />\n * ```\n */\n@Directive({ selector: 'ngt-canvas[stats]' })\nexport class NgtsStats {\n\t/**\n\t * Configuration options for the stats panel.\n\t * Accepts a partial NgtsStatsOptions object that will be merged with defaults.\n\t */\n\toptions = input(defaultOptions, { transform: mergeInputs(defaultOptions), alias: 'stats' });\n\n\tconstructor() {\n\t\tconst statsOptions = omit(this.options, ['parent', 'domClass']);\n\t\tconst parent = pick(this.options, 'parent');\n\t\tconst domClass = pick(this.options, 'domClass');\n\n\t\tconst document = inject(DOCUMENT);\n\t\tconst store = injectStore();\n\n\t\tconst stats = computed(() => {\n\t\t\tconst gl = store.gl();\n\t\t\tif (!gl) return null;\n\n\t\t\tconst stats = new Stats({ ...untracked(statsOptions) });\n\t\t\tvoid stats.init(gl);\n\t\t\treturn stats;\n\t\t});\n\n\t\teffect((onCleanup) => {\n\t\t\tconst _stats = stats();\n\t\t\tif (!_stats) return;\n\n\t\t\tconst [_parent, _domClass] = [resolveRef(parent()), domClass()];\n\t\t\tconst target = _parent ?? document.body;\n\t\t\ttarget.appendChild(_stats.dom);\n\t\t\tconst classList = _domClass.split(' ').filter(Boolean);\n\t\t\tif (classList.length) _stats.dom.classList.add(...classList);\n\t\t\tconst end = addAfterEffect(() => _stats.update());\n\n\t\t\tonCleanup(() => {\n\t\t\t\tif (classList.length) _stats.dom.classList.remove(...classList);\n\t\t\t\ttarget.removeChild(_stats.dom);\n\t\t\t\tend();\n\t\t\t});\n\t\t});\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAiCA,MAAM,cAAc,GAAqB;AACxC,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,MAAM,EAAE,IAAI;CACZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAEU,SAAS,CAAA;AAOrB,IAAA,WAAA,GAAA;AANA;;;AAGG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,K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AAG,CAAC;AAC9B,YAAA,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;YACtD,IAAI,SAAS,CAAC,MAAM;gBAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AAC5D,YAAA,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;YAEjD,SAAS,CAAC,MAAK;gBACd,IAAI,SAAS,CAAC,MAAM;oBAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAC/D,gBAAA,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC;AAC9B,gBAAA,GAAG,EAAE;AACN,YAAA,CAAC,CAAC;AACH,QAAA,CAAC,CAAC;IACH;8GAzCY,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,SAAS;mBAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE;;;AC/D5C;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-three-soba",
3
- "version": "4.2.1",
3
+ "version": "4.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -138,5 +138,6 @@
138
138
  "./web-types.json"
139
139
  ],
140
140
  "module": "fesm2022/angular-three-soba.mjs",
141
- "typings": "types/angular-three-soba.d.ts"
141
+ "typings": "types/angular-three-soba.d.ts",
142
+ "type": "module"
142
143
  }
@@ -355,8 +355,13 @@ interface NgtsFBOParams {
355
355
  height?: number;
356
356
  /**
357
357
  * Additional THREE.RenderTargetOptions for the WebGLRenderTarget.
358
+ *
359
+ * Note: `depth` accepts a boolean here as a flag to attach a `DepthTexture`
360
+ * to the render target (on top of THREE's default number meaning for 3D targets).
358
361
  */
359
- settings?: THREE.RenderTargetOptions;
362
+ settings?: Omit<THREE.RenderTargetOptions, 'depth'> & {
363
+ depth?: boolean | number;
364
+ };
360
365
  }
361
366
  /**
362
367
  * Creates a WebGLRenderTarget (Frame Buffer Object) for off-screen rendering.
@@ -2328,7 +2328,7 @@ type NgtsSparklesOptions = Partial<NgtThreeElements['ngt-points']> & SparklesPro
2328
2328
  declare class NgtsSparkles {
2329
2329
  /** Configuration options for the sparkles effect. */
2330
2330
  options: _angular_core.InputSignalWithTransform<NgtsSparklesOptions, "" | Partial<NgtsSparklesOptions>>;
2331
- protected parameters: _angular_core.Signal<Omit<NgtsSparklesOptions, "scale" | "opacity" | "color" | "size" | "speed" | "count" | "noise">>;
2331
+ protected parameters: _angular_core.Signal<Omit<NgtsSparklesOptions, "scale" | "opacity" | "color" | "size" | "count" | "speed" | "noise">>;
2332
2332
  private sparklesOptions;
2333
2333
  private store;
2334
2334
  /**