Skip to content

Commit 60df777

Browse files
committed
feat(soba/misc): expose NgtsHTML as module
1 parent a85cf9a commit 60df777

File tree

8 files changed

+19
-17
lines changed

8 files changed

+19
-17
lines changed

libs/soba/gizmos/src/lib/pivot-controls/axis-arrow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@angular/core';
1212
import { extend, injectStore, NgtArgs, NgtThreeEvent } from 'angular-three';
1313
import { NgtsLine } from 'angular-three-soba/abstractions';
14-
import { NgtsHTMLDeclarations } from 'angular-three-soba/misc';
14+
import { NgtsHTML } from 'angular-three-soba/misc';
1515
import * as THREE from 'three';
1616
import { ConeGeometry, CylinderGeometry, Group, Mesh, MeshBasicMaterial } from 'three';
1717
import { NgtsPivotControls } from './pivot-controls';
@@ -116,7 +116,7 @@ const offsetMatrix = new THREE.Matrix4();
116116
`,
117117
schemas: [CUSTOM_ELEMENTS_SCHEMA],
118118
changeDetection: ChangeDetectionStrategy.OnPush,
119-
imports: [NgtArgs, NgtsLine, NgtsHTMLDeclarations],
119+
imports: [NgtArgs, NgtsLine, NgtsHTML],
120120
})
121121
export class NgtsAxisArrow {
122122
protected readonly DoubleSide = THREE.DoubleSide;

libs/soba/gizmos/src/lib/pivot-controls/axis-rotator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@angular/core';
1212
import { extend, injectStore, NgtThreeEvent } from 'angular-three';
1313
import { NgtsLine } from 'angular-three-soba/abstractions';
14-
import { NgtsHTMLDeclarations } from 'angular-three-soba/misc';
14+
import { NgtsHTML } from 'angular-three-soba/misc';
1515
import * as THREE from 'three';
1616
import { Group } from 'three';
1717
import { NgtsPivotControls } from './pivot-controls';
@@ -120,7 +120,7 @@ const intersection = new THREE.Vector3();
120120
`,
121121
schemas: [CUSTOM_ELEMENTS_SCHEMA],
122122
changeDetection: ChangeDetectionStrategy.OnPush,
123-
imports: [NgtsLine, NgtsHTMLDeclarations],
123+
imports: [NgtsLine, NgtsHTML],
124124
})
125125
export class NgtsAxisRotator {
126126
protected readonly DoubleSide = THREE.DoubleSide;

libs/soba/gizmos/src/lib/pivot-controls/plane-slider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@angular/core';
1212
import { extend, injectStore, NgtThreeEvent } from 'angular-three';
1313
import { NgtsLine } from 'angular-three-soba/abstractions';
14-
import { NgtsHTMLDeclarations } from 'angular-three-soba/misc';
14+
import { NgtsHTML } from 'angular-three-soba/misc';
1515
import * as THREE from 'three';
1616
import { Group, Mesh, MeshBasicMaterial, PlaneGeometry } from 'three';
1717
import { NgtsPivotControls } from './pivot-controls';
@@ -97,7 +97,7 @@ const offsetMatrix = new THREE.Matrix4();
9797
`,
9898
schemas: [CUSTOM_ELEMENTS_SCHEMA],
9999
changeDetection: ChangeDetectionStrategy.OnPush,
100-
imports: [NgtsHTMLDeclarations, NgtsLine],
100+
imports: [NgtsHTML, NgtsLine],
101101
})
102102
export class NgtsPlaneSlider {
103103
protected readonly DoubleSide = THREE.DoubleSide;

libs/soba/gizmos/src/lib/pivot-controls/scaling-sphere.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
viewChild,
1111
} from '@angular/core';
1212
import { extend, injectStore, NgtArgs, NgtThreeEvent } from 'angular-three';
13-
import { calculateScaleFactor, NgtsHTMLDeclarations } from 'angular-three-soba/misc';
13+
import { calculateScaleFactor, NgtsHTML } from 'angular-three-soba/misc';
1414
import * as THREE from 'three';
1515
import { Group, Mesh, MeshBasicMaterial, SphereGeometry } from 'three';
1616
import { NgtsPivotControls } from './pivot-controls';
@@ -87,7 +87,7 @@ const scaleMatrix = new THREE.Matrix4();
8787
`,
8888
schemas: [CUSTOM_ELEMENTS_SCHEMA],
8989
changeDetection: ChangeDetectionStrategy.OnPush,
90-
imports: [NgtsHTMLDeclarations, NgtArgs],
90+
imports: [NgtsHTML, NgtArgs],
9191
})
9292
export class NgtsScalingSphere {
9393
direction = input.required<THREE.Vector3>();

libs/soba/misc/src/lib/html/html-content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import { injectBeforeRender, injectStore, is, NgtHTML, pick, resolveRef } from 'angular-three';
1616
import { mergeInputs } from 'ngxtension/inject-inputs';
1717
import * as THREE from 'three';
18-
import { NgtsHTML } from './html';
18+
import { NgtsHTMLImpl } from './html';
1919
import {
2020
CalculatePosition,
2121
defaultCalculatePosition,
@@ -120,7 +120,7 @@ export class NgtsHTMLContent extends NgtHTML {
120120
transformInnerRef = viewChild<ElementRef<HTMLDivElement>>('transformInner');
121121
containerRef = viewChild<ElementRef<HTMLDivElement>>('container');
122122

123-
protected html = inject(NgtsHTML);
123+
protected html = inject(NgtsHTMLImpl);
124124
private host = inject<ElementRef<HTMLElement>>(ElementRef);
125125
private store = injectStore();
126126
protected size = this.store.size;

libs/soba/misc/src/lib/html/html.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
CUSTOM_ELEMENTS_SCHEMA,
66
ElementRef,
77
input,
8+
NgModule,
89
viewChild,
910
} from '@angular/core';
1011
import { extend, is, NgtThreeElements, omit, pick } from 'angular-three';
@@ -52,7 +53,7 @@ const defaultHtmlOptions: NgtsHTMLOptions = {
5253
schemas: [CUSTOM_ELEMENTS_SCHEMA],
5354
changeDetection: ChangeDetectionStrategy.OnPush,
5455
})
55-
export class NgtsHTML {
56+
export class NgtsHTMLImpl {
5657
options = input(defaultHtmlOptions, { transform: mergeInputs(defaultHtmlOptions) });
5758
protected parameters = omit(this.options, ['occlude', 'castShadow', 'receiveShadow', 'transform']);
5859

@@ -128,4 +129,5 @@ export class NgtsHTML {
128129
protected readonly DoubleSide = THREE.DoubleSide;
129130
}
130131

131-
export const NgtsHTMLDeclarations = [NgtsHTML, NgtsHTMLContent] as const;
132+
@NgModule({ imports: [NgtsHTMLImpl, NgtsHTMLContent], exports: [NgtsHTMLImpl, NgtsHTMLContent] })
133+
export class NgtsHTML {}

libs/soba/src/misc/html.stories.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChangeDetectionStrategy, Component, CUSTOM_ELEMENTS_SCHEMA, input } from '@angular/core';
22
import { Meta } from '@storybook/angular';
33
import { NgtArgs } from 'angular-three';
4-
import { NgtsHTML, NgtsHTMLContent, NgtsHTMLContentOptions, NgtsHTMLOptions } from 'angular-three-soba/misc';
4+
import { NgtsHTML, NgtsHTMLContentOptions, NgtsHTMLOptions } from 'angular-three-soba/misc';
55
import { ColorRepresentation } from 'three';
66
import { storyDecorators, storyFunction, storyObject, Turnable } from '../setup-canvas';
77

@@ -47,7 +47,7 @@ import { storyDecorators, storyFunction, storyObject, Turnable } from '../setup-
4747
`,
4848
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4949
changeDetection: ChangeDetectionStrategy.OnPush,
50-
imports: [NgtArgs, NgtsHTML, NgtsHTMLContent, Turnable],
50+
imports: [NgtArgs, NgtsHTML, Turnable],
5151
})
5252
class HtmlScene {
5353
color = input<ColorRepresentation>('hotpink');
@@ -71,7 +71,7 @@ class HtmlScene {
7171
}
7272
`,
7373
changeDetection: ChangeDetectionStrategy.OnPush,
74-
imports: [HtmlScene, NgtsHTML, NgtsHTMLContent],
74+
imports: [HtmlScene, NgtsHTML],
7575
})
7676
class HtmlTransformScene {
7777
htmlOptions = input({} as NgtsHTMLOptions);

libs/soba/src/staging/bb-anchor.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Meta } from '@storybook/angular';
33
import { NgtArgs } from 'angular-three';
44
import { NgtsHelper } from 'angular-three-soba/abstractions';
55
import { NgtsOrbitControls } from 'angular-three-soba/controls';
6-
import { NgtsHTML, NgtsHTMLContent } from 'angular-three-soba/misc';
6+
import { NgtsHTML } from 'angular-three-soba/misc';
77
import { NgtsBBAnchor, NgtsBBAnchorOptions } from 'angular-three-soba/staging';
88
import { BoxHelper } from 'three';
99
import { storyDecorators, storyObject } from '../setup-canvas';
@@ -60,7 +60,7 @@ class BBAnchorWrapper {
6060
`,
6161
schemas: [CUSTOM_ELEMENTS_SCHEMA],
6262
changeDetection: ChangeDetectionStrategy.OnPush,
63-
imports: [BBAnchorWrapper, NgtsHTML, NgtsHTMLContent],
63+
imports: [BBAnchorWrapper, NgtsHTML],
6464
})
6565
class WithHTMLBBAnchorStory {
6666
options = input<NgtsBBAnchorOptions>({ anchor: [1, 1, 1] });

0 commit comments

Comments
 (0)