Skip to content

Commit 919a1a8

Browse files
committed
feat(core): expose NgtPortal as module with portal and portalContent grouped
1 parent bb0a949 commit 919a1a8

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

libs/core/src/lib/portal.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
inject,
1111
Injector,
1212
input,
13+
NgModule,
1314
numberAttribute,
1415
signal,
1516
SkipSelf,
@@ -34,7 +35,7 @@ import { updateCamera } from './utils/update';
3435
export class NgtPortalAutoRender {
3536
private portalStore = injectStore({ host: true });
3637
private parentStore = injectStore({ skipSelf: true });
37-
private portal = inject(NgtPortal, { host: true });
38+
private portal = inject(NgtPortalImpl, { host: true });
3839

3940
renderPriority = input(1, { alias: 'autoRender', transform: (value) => numberAttribute(value, 1) });
4041

@@ -187,7 +188,7 @@ function mergeState(
187188
},
188189
],
189190
})
190-
export class NgtPortal {
191+
export class NgtPortalImpl {
191192
container = input.required<THREE.Object3D>();
192193
state = input<Partial<NgtPortalState>>({});
193194

@@ -249,4 +250,5 @@ export class NgtPortal {
249250
}
250251
}
251252

252-
export const NgtPortalDeclarations = [NgtPortal, NgtPortalContent] as const;
253+
@NgModule({ imports: [NgtPortalImpl, NgtPortalContent], exports: [NgtPortalImpl, NgtPortalContent] })
254+
export class NgtPortal {}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
input,
88
viewChild,
99
} from '@angular/core';
10-
import { NgtArgs, NgtPortal, NgtPortalContent, injectBeforeRender } from 'angular-three';
10+
import { NgtArgs, NgtPortal, injectBeforeRender } from 'angular-three';
1111
import { NgtsPerspectiveCamera } from 'angular-three-soba/cameras';
1212
import { NgtsFBO } from 'angular-three-soba/misc';
1313
import { Color, Mesh, Scene, WebGLRenderTarget } from 'three';
@@ -50,7 +50,7 @@ class SpinningThing {
5050
<ngt-mesh-standard-material [map]="target().texture" />
5151
</ngt-mesh>
5252
`,
53-
imports: [NgtsPerspectiveCamera, SpinningThing, NgtPortal, NgtPortalContent, NgtArgs],
53+
imports: [NgtsPerspectiveCamera, SpinningThing, NgtPortal, NgtArgs],
5454
schemas: [CUSTOM_ELEMENTS_SCHEMA],
5555
changeDetection: ChangeDetectionStrategy.OnPush,
5656
})

libs/soba/staging/src/lib/environment/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
NgtArgs,
2727
NgtEuler,
2828
NgtPortal,
29-
NgtPortalContent,
3029
pick,
3130
} from 'angular-three';
3231
import { mergeInputs } from 'ngxtension/inject-inputs';
@@ -213,7 +212,7 @@ export class NgtsEnvironmentCube {
213212
</ng-template>
214213
</ngt-portal>
215214
`,
216-
imports: [NgtsEnvironmentCube, NgtsEnvironmentMap, NgtArgs, NgtPortal, NgtPortalContent, NgTemplateOutlet],
215+
imports: [NgtsEnvironmentCube, NgtsEnvironmentMap, NgtArgs, NgtPortal, NgTemplateOutlet],
217216
schemas: [CUSTOM_ELEMENTS_SCHEMA],
218217
changeDetection: ChangeDetectionStrategy.OnPush,
219218
})

0 commit comments

Comments
 (0)