Skip to content

Commit dd1fd54

Browse files
committed
style: run formatter to fix formatting checks
1 parent a1b861f commit dd1fd54

4 files changed

Lines changed: 38 additions & 14 deletions

File tree

renderers/angular/src/v0_9/core/component-binder.service.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616

1717
import {TestBed} from '@angular/core/testing';
1818
import {ComponentBinder} from './component-binder.service';
19-
import {Catalog, ComponentContext, ComponentModel, SurfaceModel, CommonSchemas} from '@a2ui/web_core/v0_9';
19+
import {
20+
Catalog,
21+
ComponentContext,
22+
ComponentModel,
23+
SurfaceModel,
24+
CommonSchemas,
25+
} from '@a2ui/web_core/v0_9';
2026
import {z} from 'zod';
2127

2228
/**

renderers/angular/src/v0_9/core/component-binder.service.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,19 @@ export class ComponentBinder {
6363
for (const key of Object.keys(props)) {
6464
const value = props[key];
6565
let template: ComponentTemplate | undefined = undefined;
66-
const behavior: BehaviorNode =
67-
(behaviorTree.type === 'OBJECT' ? behaviorTree.shape[key] : null) || {type: 'STATIC'};
66+
const behavior: BehaviorNode = (behaviorTree.type === 'OBJECT'
67+
? behaviorTree.shape[key]
68+
: null) || {type: 'STATIC'};
6869

6970
const resolvedPreactSig = this.resolveNested(value, behavior, context);
7071
const angSig = toAngularSignal(resolvedPreactSig as any, this.destroyRef, this.ngZone);
7172

72-
if (behavior.type === 'STRUCTURAL' && value && typeof value === 'object' && 'componentId' in value) {
73+
if (
74+
behavior.type === 'STRUCTURAL' &&
75+
value &&
76+
typeof value === 'object' &&
77+
'componentId' in value
78+
) {
7379
template = {id: value.componentId, path: value.path};
7480
}
7581

@@ -120,7 +126,11 @@ export class ComponentBinder {
120126
return bound;
121127
}
122128

123-
private resolveNested(value: any, behavior: BehaviorNode, context: ComponentContext): Signal<any> {
129+
private resolveNested(
130+
value: any,
131+
behavior: BehaviorNode,
132+
context: ComponentContext,
133+
): Signal<any> {
124134
if (value === undefined || value === null) {
125135
if (behavior.type === 'STRUCTURAL') {
126136
return signal([]);
@@ -171,9 +181,7 @@ export class ComponentBinder {
171181
}
172182
case 'ARRAY': {
173183
if (!Array.isArray(value)) return signal(value);
174-
const itemSignals = value.map((item) =>
175-
this.resolveNested(item, behavior.element, context),
176-
);
184+
const itemSignals = value.map(item => this.resolveNested(item, behavior.element, context));
177185
return computed(() => itemSignals.map(sig => sig.value));
178186
}
179187
case 'OBJECT': {

renderers/web_core/src/v0_9/rendering/generic-binder.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ describe('GenericBinder Child and Structural Behavior', () => {
244244

245245
// Dynamic list resolution
246246
assert.deepStrictEqual(binder.snapshot.children, [
247-
{ id: 'item-comp', basePath: '/items/0' },
248-
{ id: 'item-comp', basePath: '/items/1' },
247+
{id: 'item-comp', basePath: '/items/0'},
248+
{id: 'item-comp', basePath: '/items/1'},
249249
]);
250250

251251
// Static list resolution
@@ -258,8 +258,8 @@ describe('GenericBinder Child and Structural Behavior', () => {
258258
const staticBinder = new GenericBinder<any>(staticContext, schema);
259259

260260
assert.deepStrictEqual(staticBinder.snapshot.children, [
261-
{ id: 'child1', basePath: '/parent_path' },
262-
{ id: 'child2', basePath: '/parent_path' },
261+
{id: 'child1', basePath: '/parent_path'},
262+
{id: 'child2', basePath: '/parent_path'},
263263
]);
264264
});
265265
});

renderers/web_core/src/v0_9/rendering/generic-binder.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616

1717
import {z} from 'zod';
1818
import {ComponentContext} from './component-context.js';
19-
import {Action, ChildList, DataBinding, FunctionCall, ComponentId, A2uiTypeDef} from '../schema/common-types.js';
19+
import {
20+
Action,
21+
ChildList,
22+
DataBinding,
23+
FunctionCall,
24+
ComponentId,
25+
A2uiTypeDef,
26+
} from '../schema/common-types.js';
2027

2128
// --- Schema Scraping ---
2229

@@ -277,7 +284,10 @@ export class GenericBinder<T> {
277284

278285
case 'CHILD': {
279286
const bound = this.context.dataContext.subscribeDynamicValue(value, newVal => {
280-
this.updateDeepValue(path, newVal ? {id: newVal, basePath: this.context.dataContext.path} : null);
287+
this.updateDeepValue(
288+
path,
289+
newVal ? {id: newVal, basePath: this.context.dataContext.path} : null,
290+
);
281291
this.notify();
282292
});
283293

0 commit comments

Comments
 (0)