Skip to content

Commit f894178

Browse files
committed
fix(soba): remove standalone true
1 parent fa304b9 commit f894178

40 files changed

+87
-117
lines changed

Diff for: libs/soba/abstractions/src/lib/billboard.ts

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const defaultOptions: NgtsBillboardOptions = {
2626

2727
@Component({
2828
selector: 'ngts-billboard',
29-
standalone: true,
3029
template: `
3130
<ngt-group #group [parameters]="parameters()">
3231
<ngt-group #inner>

Diff for: libs/soba/abstractions/src/lib/helper.ts

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export function injectHelper<
6666
}
6767

6868
@Component({
69-
standalone: true,
7069
selector: 'ngts-helper',
7170
template: `
7271
<ngt-object3D #helper />

Diff for: libs/soba/cameras/src/lib/camera-content.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Directive, Signal } from '@angular/core';
22
import { Texture } from 'three';
33

4-
@Directive({ standalone: true, selector: 'ng-template[cameraContent]' })
4+
@Directive({ selector: 'ng-template[cameraContent]' })
55
export class NgtsCameraContent {
66
static ngTemplateContextGuard(_: NgtsCameraContent, ctx: unknown): ctx is { $implicit: Signal<Texture> } {
77
return true;

Diff for: libs/soba/controls/README.md

+28-29
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,36 @@ Other options are available in the `camera-controls` library. For more informati
3838

3939
```ts
4040
@Component({
41-
standalone: true,
42-
template: `
43-
<ngt-mesh>
44-
<ngt-box-geometry />
45-
<ngt-mesh-basic-material color="red" [wireframe]="true" />
46-
</ngt-mesh>
47-
48-
<ngt-grid-helper *args="[50, 50]" [position]="[0, -1, 0]" />
49-
50-
<ngts-camera-controls />
51-
`,
52-
imports: [NgtsCameraControls, NgtArgs],
53-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
54-
changeDetection: ChangeDetectionStrategy.OnPush,
41+
template: `
42+
<ngt-mesh>
43+
<ngt-box-geometry />
44+
<ngt-mesh-basic-material color="red" [wireframe]="true" />
45+
</ngt-mesh>
46+
47+
<ngt-grid-helper *args="[50, 50]" [position]="[0, -1, 0]" />
48+
49+
<ngts-camera-controls />
50+
`,
51+
imports: [NgtsCameraControls, NgtArgs],
52+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
53+
changeDetection: ChangeDetectionStrategy.OnPush,
5554
})
5655
class DefaultCameraControlsStory {
57-
rotate = input<keyof typeof rotations | 'none'>('none');
58-
59-
cameraControlsRef = viewChild.required(NgtsCameraControls);
60-
61-
constructor() {
62-
effect(() => {
63-
const [rotate, controls] = [this.rotate(), this.cameraControlsRef().controls()];
64-
if (rotate !== 'none') {
65-
const [theta, phi, animate] = rotations[rotate];
66-
void controls.rotate(theta, phi, animate);
67-
} else {
68-
void controls.reset(true);
69-
}
70-
});
71-
}
56+
rotate = input<keyof typeof rotations | 'none'>('none');
57+
58+
cameraControlsRef = viewChild.required(NgtsCameraControls);
59+
60+
constructor() {
61+
effect(() => {
62+
const [rotate, controls] = [this.rotate(), this.cameraControlsRef().controls()];
63+
if (rotate !== 'none') {
64+
const [theta, phi, animate] = rotations[rotate];
65+
void controls.rotate(theta, phi, animate);
66+
} else {
67+
void controls.reset(true);
68+
}
69+
});
70+
}
7271
}
7372
```
7473

Diff for: libs/soba/controls/src/lib/scroll-controls.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const defaultOptions: NgtsScrollControlsOptions = {
5454

5555
@Component({
5656
selector: 'ngts-scroll-controls',
57-
standalone: true,
5857
template: `
5958
<ng-content />
6059
`,
@@ -271,7 +270,7 @@ export class NgtsScrollControls {
271270
}
272271
}
273272

274-
@Directive({ selector: 'ngt-group[ngtsScrollCanvas]', standalone: true })
273+
@Directive({ selector: 'ngt-group[ngtsScrollCanvas]' })
275274
export class NgtsScrollCanvas {
276275
private host = inject<ElementRef<Group>>(ElementRef);
277276
private scrollControls = inject(NgtsScrollControls);
@@ -294,7 +293,6 @@ export class NgtsScrollCanvas {
294293

295294
@Directive({
296295
selector: 'div[ngtsScrollHTML]',
297-
standalone: true,
298296
host: { style: 'position: absolute; top: 0; left: 0; will-change: transform;' },
299297
providers: [provideHTMLDomElement([NgtsScrollControls], (scrollControls) => scrollControls.fixed)],
300298
})

Diff for: libs/soba/gizmos/src/lib/gizmo-helper/gizmo-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const [q1, q2] = [new Quaternion(), new Quaternion()];
2828
const target = new Vector3();
2929
const targetPosition = new Vector3();
3030

31-
@Directive({ selector: 'ng-template[gizmoHelperContent]', standalone: true })
31+
@Directive({ selector: 'ng-template[gizmoHelperContent]' })
3232
export class NgtsGizmoHelperContent {
3333
static ngTemplateContextGuard(_: NgtsGizmoHelperContent, ctx: unknown): ctx is { container: Object3D } {
3434
return true;

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

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const defaultFaceMaterialOptions: NgtsViewcubeCommonOptions = {
5050

5151
@Component({
5252
selector: 'viewcube-face-material',
53-
standalone: true,
5453
template: `
5554
<ngt-mesh-basic-material
5655
[attach]="['material', index()]"

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

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export class Axis {
6666

6767
@Component({
6868
selector: 'viewport-axis-head',
69-
standalone: true,
7069
template: `
7170
<ngt-sprite
7271
[scale]="scale()"

Diff for: libs/soba/loaders/README.md

+39-40
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,34 @@ The function also has static methods for preloading and setting the decoder path
3535

3636
```ts
3737
@Component({
38-
selector: 'app-suzi',
39-
standalone: true,
40-
template: `
41-
<ngt-primitive *args="[scene()]" [rotation]="[-0.63, 0, 0]" [scale]="2" [position]="[0, -1.175, 0]" />
42-
`,
43-
imports: [NgtArgs],
44-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
45-
changeDetection: ChangeDetectionStrategy.OnPush,
38+
selector: 'app-suzi',
39+
template: `
40+
<ngt-primitive *args="[scene()]" [rotation]="[-0.63, 0, 0]" [scale]="2" [position]="[0, -1.175, 0]" />
41+
`,
42+
imports: [NgtArgs],
43+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
44+
changeDetection: ChangeDetectionStrategy.OnPush,
4645
})
4746
class Suzi {
48-
gltf = injectGLTF(() => './suzanne-high-poly.gltf');
47+
gltf = injectGLTF(() => './suzanne-high-poly.gltf');
4948

50-
scene = computed(() => {
51-
const gltf = this.gltf();
52-
if (!gltf) return null;
53-
const { scene, materials } = gltf;
54-
scene.traverse((obj) => (obj as any).isMesh && (obj.receiveShadow = obj.castShadow = true));
49+
scene = computed(() => {
50+
const gltf = this.gltf();
51+
if (!gltf) return null;
52+
const { scene, materials } = gltf;
53+
scene.traverse((obj) => (obj as any).isMesh && (obj.receiveShadow = obj.castShadow = true));
5554

56-
const material = materials['default'] as MeshStandardMaterial;
55+
const material = materials['default'] as MeshStandardMaterial;
5756

58-
material.color.set('orange');
59-
material.roughness = 0;
60-
material.normalMap = new CanvasTexture(new FlakesTexture(), UVMapping, RepeatWrapping, RepeatWrapping);
61-
material.normalMap.flipY = false;
62-
material.normalMap.repeat.set(40, 40);
63-
material.normalScale.set(0.05, 0.05);
57+
material.color.set('orange');
58+
material.roughness = 0;
59+
material.normalMap = new CanvasTexture(new FlakesTexture(), UVMapping, RepeatWrapping, RepeatWrapping);
60+
material.normalMap.flipY = false;
61+
material.normalMap.repeat.set(40, 40);
62+
material.normalScale.set(0.05, 0.05);
6463

65-
return scene;
66-
});
64+
return scene;
65+
});
6766
}
6867
```
6968

@@ -77,32 +76,32 @@ The function also has a static method for preloading textures:
7776

7877
```ts
7978
@Component({
80-
template: `
81-
<ngt-mesh>
82-
<ngt-mesh-physical-material [normalMap]="normalMap()" [roughnessMap]="roughnessMap()" />
83-
</ngt-mesh>
84-
`,
79+
template: `
80+
<ngt-mesh>
81+
<ngt-mesh-physical-material [normalMap]="normalMap()" [roughnessMap]="roughnessMap()" />
82+
</ngt-mesh>
83+
`,
8584
})
8685
export class MyCmp {
87-
private textures = injectTexture(() => ({
88-
roughnessMap: 'roughness_floor.jpeg',
89-
normalMap: 'NORM.jpg',
90-
}));
91-
roughnessMap = computed(() => this.textures()?.roughnessMap || null);
92-
normalMap = computed(() => this.textures()?.normalMap || null);
86+
private textures = injectTexture(() => ({
87+
roughnessMap: 'roughness_floor.jpeg',
88+
normalMap: 'NORM.jpg',
89+
}));
90+
roughnessMap = computed(() => this.textures()?.roughnessMap || null);
91+
normalMap = computed(() => this.textures()?.normalMap || null);
9392
}
9493
```
9594

9695
## `injectProgress`
9796

9897
```ts
9998
function injectProgress(injector?: Injector): Signal<{
100-
errors: string[];
101-
active: boolean;
102-
progress: number;
103-
item: string;
104-
loaded: number;
105-
total: number;
99+
errors: string[];
100+
active: boolean;
101+
progress: number;
102+
item: string;
103+
loaded: number;
104+
total: number;
106105
}>;
107106
```
108107

Diff for: libs/soba/loaders/src/lib/loader.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const defaultOptions: NgtsLoaderOptions = {
3535

3636
@Component({
3737
selector: 'ngts-loader',
38-
standalone: true,
3938
template: `
4039
@if (shown()) {
4140
<div

Diff for: libs/soba/materials/src/lib/mesh-portal-material.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { FullScreenQuad } from 'three-stdlib';
4040
/**
4141
* This directive is used inside of the render texture, hence has access to the render texture store (a portal store)
4242
*/
43-
@Directive({ selector: 'ngts-manage-portal-scene', standalone: true })
43+
@Directive({ selector: 'ngts-manage-portal-scene' })
4444
export class ManagePortalScene {
4545
events = input<boolean>();
4646
rootScene = input.required<Scene>();

Diff for: libs/soba/misc/src/lib/bake-shadows.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Directive, effect } from '@angular/core';
22
import { injectStore } from 'angular-three';
33

4-
@Directive({ standalone: true, selector: 'ngts-bake-shadows' })
4+
@Directive({ selector: 'ngts-bake-shadows' })
55
export class NgtsBakeShadows {
66
constructor() {
77
const store = injectStore();

Diff for: libs/soba/misc/src/lib/decal.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const defaultOptions: NgtsDecalOptions = {
2727

2828
@Component({
2929
selector: 'ngts-decal',
30-
standalone: true,
3130
template: `
3231
<ngt-mesh #mesh [parameters]="parameters()">
3332
<ngt-value [rawValue]="true" attach="material.transparent" />

Diff for: libs/soba/misc/src/lib/fbo.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function injectFBO(params: () => NgtsFBOParams = () => ({}), { injector }
111111
});
112112
}
113113

114-
@Directive({ selector: 'ng-template[fbo]', standalone: true })
114+
@Directive({ selector: 'ng-template[fbo]' })
115115
export class NgtsFBO {
116116
fbo = input({} as { width: NgtsFBOParams['width']; height: NgtsFBOParams['height'] } & FBOSettings);
117117

Diff for: libs/soba/misc/src/lib/html/html.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const defaultHtmlOptions: NgtsHTMLOptions = {
2727

2828
@Component({
2929
selector: 'ngts-html',
30-
standalone: true,
3130
template: `
3231
<ngt-group #group [parameters]="parameters()">
3332
@if (occlude() && !isRaycastOcclusion()) {

Diff for: libs/soba/misc/src/lib/intersect.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function injectIntersect<TObject extends Object3D>(
4242
});
4343
}
4444

45-
@Directive({ standalone: true, selector: '[intersect]' })
45+
@Directive({ selector: '[intersect]' })
4646
export class NgtsIntersect {
4747
intersect = model(false);
4848

Diff for: libs/soba/misc/src/lib/preload.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { computed, Directive, effect, ElementRef, model } from '@angular/core';
22
import { injectStore, resolveRef } from 'angular-three';
33
import { Camera, CubeCamera, Object3D, WebGLCubeRenderTarget } from 'three';
44

5-
@Directive({ selector: 'ngts-preload', standalone: true })
5+
@Directive({ selector: 'ngts-preload' })
66
export class NgtsPreload {
77
all = model<boolean>();
88
scene = model<Object3D | ElementRef<Object3D>>();

Diff for: libs/soba/misc/src/lib/sampler.ts

-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ const defaultOptions: NgtsSamplerOptions = {
155155

156156
@Component({
157157
selector: 'ngts-sampler',
158-
standalone: true,
159158
template: `
160159
<ngt-group #group [parameters]="parameters()">
161160
<ng-content />

Diff for: libs/soba/performances/src/lib/adaptive-dpr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';
22
import { injectStore } from 'angular-three';
33

4-
@Directive({ selector: 'ngts-adaptive-dpr', standalone: true })
4+
@Directive({ selector: 'ngts-adaptive-dpr' })
55
export class NgtsAdaptiveDpr {
66
pixelated = input(false);
77

Diff for: libs/soba/performances/src/lib/adaptive-events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DestroyRef, Directive, effect, inject } from '@angular/core';
22
import { injectStore } from 'angular-three';
33

4-
@Directive({ standalone: true, selector: 'ngts-adaptive-events' })
4+
@Directive({ selector: 'ngts-adaptive-events' })
55
export class NgtsAdaptiveEvents {
66
constructor() {
77
const store = injectStore();

Diff for: libs/soba/performances/src/lib/detailed.ts

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const defaultOptions: NgtsDetailedOptions = {
2121

2222
@Component({
2323
selector: 'ngts-detailed',
24-
standalone: true,
2524
template: `
2625
<ngt-lOD #lod [parameters]="parameters()">
2726
<ng-content />

Diff for: libs/soba/performances/src/lib/instances/instances.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const scale = new Vector3();
2424

2525
@Component({
2626
selector: 'ngts-instance',
27-
standalone: true,
2827
template: `
2928
<ngt-position-mesh #positionMesh [instance]="instances.instancedMeshRef()" [parameters]="options()">
3029
<ng-content />

Diff for: libs/soba/performances/src/lib/points/points.ts

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { NgtPositionPoint, PositionPoint } from './position-point';
1616

1717
@Component({
1818
selector: 'ngts-point',
19-
standalone: true,
2019
template: `
2120
<ngt-position-point #positionPoint [parameters]="options()" [instance]="points.pointsRef()">
2221
<ng-content />
@@ -44,7 +43,6 @@ export class NgtsPoint {
4443

4544
@Component({
4645
selector: 'ngts-points-buffer',
47-
standalone: true,
4846
template: `
4947
<ngt-points #points [parameters]="options()">
5048
<ngt-buffer-geometry>
@@ -118,7 +116,6 @@ const defaultInstancesOptions: NgtsPointsInstancesOptions = { limit: 1000 };
118116

119117
@Component({
120118
selector: 'ngts-points-instances',
121-
standalone: true,
122119
template: `
123120
<ngt-points
124121
#points

Diff for: libs/soba/performances/src/lib/segments/segments.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { SegmentObject } from './segment-object';
1717

1818
@Component({
1919
selector: 'ngts-segment',
20-
standalone: true,
2120
template: `
2221
<ngt-segment-object #segment [color]="color()" [start]="normalizedStart()" [end]="normalizedEnd()" />
2322
`,

Diff for: libs/soba/src/materials/mesh-distort-material.stories.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { NgtsMeshDistortMaterial, NgtsMeshDistortMaterialOptions } from 'angular
55
import { color, makeDecorators, makeStoryObject, number } from '../setup-canvas';
66

77
@Component({
8-
standalone: true,
98
template: `
109
<ngt-mesh>
1110
<ngt-icosahedron-geometry *args="[1, 4]" />

0 commit comments

Comments
 (0)