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

libs/soba/abstractions/src/lib/billboard.ts

Lines changed: 0 additions & 1 deletion
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>

libs/soba/abstractions/src/lib/helper.ts

Lines changed: 0 additions & 1 deletion
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 />

libs/soba/cameras/src/lib/camera-content.ts

Lines changed: 1 addition & 1 deletion
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;

libs/soba/controls/README.md

Lines changed: 28 additions & 29 deletions
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

libs/soba/controls/src/lib/scroll-controls.ts

Lines changed: 1 addition & 3 deletions
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
})

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

Lines changed: 1 addition & 1 deletion
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;

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

Lines changed: 0 additions & 1 deletion
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()]"

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

Lines changed: 0 additions & 1 deletion
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()"

libs/soba/loaders/README.md

Lines changed: 39 additions & 40 deletions
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

libs/soba/loaders/src/lib/loader.ts

Lines changed: 0 additions & 1 deletion
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

0 commit comments

Comments
 (0)