Skip to content

Commit a85cf9a

Browse files
committed
feat(soba/gizmos): expose NgtsGizmoHelper as module
1 parent 919a1a8 commit a85cf9a

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

libs/soba/gizmos/src/lib/gizmo-helper/gizmo-helper.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
ElementRef,
1111
Injector,
1212
input,
13+
NgModule,
1314
output,
1415
TemplateRef,
1516
viewChild,
@@ -21,7 +22,6 @@ import {
2122
injectStore,
2223
NgtPortal,
2324
NgtPortalAutoRender,
24-
NgtPortalContent,
2525
pick,
2626
} from 'angular-three';
2727
import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';
@@ -96,9 +96,9 @@ const defaultOptions: NgtsGizmoHelperOptions = {
9696
`,
9797
schemas: [CUSTOM_ELEMENTS_SCHEMA],
9898
changeDetection: ChangeDetectionStrategy.OnPush,
99-
imports: [NgtPortal, NgtPortalAutoRender, NgtPortalContent, NgtsOrthographicCamera, NgTemplateOutlet],
99+
imports: [NgtPortal, NgtPortalAutoRender, NgtsOrthographicCamera, NgTemplateOutlet],
100100
})
101-
export class NgtsGizmoHelper {
101+
export class NgtsGizmoHelperImpl {
102102
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
103103
update = output<void>();
104104

@@ -232,3 +232,9 @@ export class NgtsGizmoHelper {
232232
return 'getTarget' in (controls as CameraControls);
233233
}
234234
}
235+
236+
@NgModule({
237+
imports: [NgtsGizmoHelperImpl, NgtsGizmoHelperContent],
238+
exports: [NgtsGizmoHelperImpl, NgtsGizmoHelperContent],
239+
})
240+
export class NgtsGizmoHelper {}

libs/soba/gizmos/src/lib/gizmo-helper/gizmo-viewcube.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
import { mergeInputs } from 'ngxtension/inject-inputs';
2323
import * as THREE from 'three';
2424
import { BoxGeometry, Group, Mesh, MeshBasicMaterial } from 'three';
25-
import { NgtsGizmoHelper } from './gizmo-helper';
25+
import { NgtsGizmoHelperImpl } from './gizmo-helper';
2626

2727
type XYZ = [number, number, number];
2828

@@ -138,7 +138,7 @@ export class FaceCube {
138138
options = input({} as Partial<NgtsViewcubeCommonOptions>);
139139
onClick = input<NgtEventHandlers['click']>();
140140

141-
private gizmoHelper = inject(NgtsGizmoHelper);
141+
private gizmoHelper = inject(NgtsGizmoHelperImpl);
142142

143143
protected hover = signal(-1);
144144
protected count = Array.from({ length: 6 });
@@ -188,7 +188,7 @@ export class EdgeCube {
188188
});
189189
onClick = input<NgtEventHandlers['click']>();
190190

191-
private gizmoHelper = inject(NgtsGizmoHelper);
191+
private gizmoHelper = inject(NgtsGizmoHelperImpl);
192192

193193
protected hover = signal(false);
194194
protected color = computed(() => (this.hover() ? this.hoverColor() : 'white'));

libs/soba/gizmos/src/lib/gizmo-helper/gizmo-viewport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
import { mergeInputs } from 'ngxtension/inject-inputs';
2727
import * as THREE from 'three';
2828
import { BoxGeometry, Group, Mesh, MeshBasicMaterial, Sprite, SpriteMaterial } from 'three';
29-
import { NgtsGizmoHelper } from './gizmo-helper';
29+
import { NgtsGizmoHelperImpl } from './gizmo-helper';
3030

3131
@Component({
3232
selector: 'viewport-axis',
@@ -85,7 +85,7 @@ export class AxisHead {
8585
onClick = input<NgtEventHandlers['click']>();
8686

8787
private document = inject(DOCUMENT);
88-
private gizmoHelper = inject(NgtsGizmoHelper);
88+
private gizmoHelper = inject(NgtsGizmoHelperImpl);
8989
private store = injectStore();
9090

9191
protected texture = computed(() => {

libs/soba/src/gizmos/gizmo-helper.stories.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { NgtArgs } from 'angular-three';
44
import { NgtsOrbitControls } from 'angular-three-soba/controls';
55
import {
66
NgtsGizmoHelper,
7-
NgtsGizmoHelperContent,
87
NgtsGizmoHelperOptions,
98
NgtsGizmoViewcube,
109
NgtsGizmoViewport,
@@ -40,7 +39,7 @@ class Tokyo {
4039
4140
<ngts-orbit-controls [options]="{ makeDefault: true }" />
4241
`,
43-
imports: [Tokyo, NgtsGizmoHelper, NgtsGizmoHelperContent, NgtsOrbitControls, NgtsGizmoViewport],
42+
imports: [Tokyo, NgtsGizmoHelper, NgtsOrbitControls, NgtsGizmoViewport],
4443
schemas: [CUSTOM_ELEMENTS_SCHEMA],
4544
changeDetection: ChangeDetectionStrategy.OnPush,
4645
})
@@ -58,7 +57,7 @@ class ViewportStory {
5857
5958
<ngts-orbit-controls [options]="{ makeDefault: true }" />
6059
`,
61-
imports: [Tokyo, NgtsGizmoHelper, NgtsGizmoViewcube, NgtsGizmoHelperContent, NgtsOrbitControls],
60+
imports: [Tokyo, NgtsGizmoHelper, NgtsGizmoViewcube, NgtsOrbitControls],
6261
schemas: [CUSTOM_ELEMENTS_SCHEMA],
6362
changeDetection: ChangeDetectionStrategy.OnPush,
6463
})

0 commit comments

Comments
 (0)