Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand Down Expand Up @@ -45,8 +45,8 @@ class DemoValueComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -62,7 +62,11 @@ class DemoValueComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect, signal } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect, signal } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand All @@ -17,8 +17,8 @@ import { ELEMENT_RENDERING_SPECS } from './specs';
selector: 'demo-text',
standalone: true,
template: `
@if (content()) {
<p class="text-gray-100 text-sm">{{ content() }}</p>
@if (displayContent()) {
<p class="text-gray-100 text-sm">{{ displayContent() }}</p>
} @else if (loading()) {
<div class="space-y-1.5 py-1">
<div class="h-3 w-full bg-gray-800 rounded skeleton-shimmer"></div>
Expand All @@ -28,7 +28,11 @@ import { ELEMENT_RENDERING_SPECS } from './specs';
`,
})
class DemoTextComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand All @@ -41,8 +45,8 @@ class DemoTextComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -58,7 +62,11 @@ class DemoTextComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
22 changes: 15 additions & 7 deletions cockpit/render/registry/angular/src/app/registry.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand All @@ -17,8 +17,8 @@ import { REGISTRY_SPECS } from './specs';
selector: 'demo-text',
standalone: true,
template: `
@if (content()) {
<p class="text-gray-100 text-sm">{{ content() }}</p>
@if (displayContent()) {
<p class="text-gray-100 text-sm">{{ displayContent() }}</p>
} @else if (loading()) {
<div class="space-y-1.5 py-1">
<div class="h-3 w-full bg-gray-800 rounded skeleton-shimmer"></div>
Expand All @@ -28,7 +28,11 @@ import { REGISTRY_SPECS } from './specs';
`,
})
class DemoTextComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand All @@ -41,8 +45,8 @@ class DemoTextComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -58,7 +62,11 @@ class DemoTextComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand All @@ -17,8 +17,8 @@ import { REPEAT_LOOPS_SPECS } from './specs';
selector: 'demo-text',
standalone: true,
template: `
@if (content()) {
<p class="text-gray-100 text-sm">{{ content() }}</p>
@if (displayContent()) {
<p class="text-gray-100 text-sm">{{ displayContent() }}</p>
} @else if (loading()) {
<div class="space-y-1.5 py-1">
<div class="h-3 w-full bg-gray-800 rounded skeleton-shimmer"></div>
Expand All @@ -28,7 +28,11 @@ import { REPEAT_LOOPS_SPECS } from './specs';
`,
})
class DemoTextComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand All @@ -41,8 +45,8 @@ class DemoTextComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -58,7 +62,11 @@ class DemoTextComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand All @@ -17,8 +17,8 @@ import { SPEC_RENDERING_SPECS } from './specs';
selector: 'demo-text',
standalone: true,
template: `
@if (content()) {
<p class="text-gray-100 text-sm">{{ content() }}</p>
@if (displayContent()) {
<p class="text-gray-100 text-sm">{{ displayContent() }}</p>
} @else if (loading()) {
<div class="space-y-1.5 py-1">
<div class="h-3 w-full bg-gray-800 rounded skeleton-shimmer"></div>
Expand All @@ -28,7 +28,11 @@ import { SPEC_RENDERING_SPECS } from './specs';
`,
})
class DemoTextComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand All @@ -41,8 +45,8 @@ class DemoTextComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -58,7 +62,11 @@ class DemoTextComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
import { Component, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import { Component, computed, input, OnDestroy, viewChild, ElementRef, effect } from '@angular/core';
import {
RenderSpecComponent,
RenderElementComponent,
Expand All @@ -17,8 +17,8 @@ import { STATE_MANAGEMENT_SPECS } from './specs';
selector: 'demo-text',
standalone: true,
template: `
@if (content()) {
<p class="text-gray-100 text-sm">{{ content() }}</p>
@if (displayContent()) {
<p class="text-gray-100 text-sm">{{ displayContent() }}</p>
} @else if (loading()) {
<div class="space-y-1.5 py-1">
<div class="h-3 w-full bg-gray-800 rounded skeleton-shimmer"></div>
Expand All @@ -28,7 +28,11 @@ import { STATE_MANAGEMENT_SPECS } from './specs';
`,
})
class DemoTextComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand All @@ -41,8 +45,8 @@ class DemoTextComponent {
standalone: true,
imports: [RenderElementComponent],
template: `
@if (content()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ content() }}</h2>
@if (displayContent()) {
<h2 class="text-lg font-bold text-gray-100 mb-2">{{ displayContent() }}</h2>
} @else if (loading()) {
<div class="h-5 w-48 bg-gray-700 rounded skeleton-shimmer mb-2"></div>
}
Expand All @@ -58,7 +62,11 @@ class DemoTextComponent {
`,
})
class DemoHeadingComponent {
readonly content = input('');
readonly content = input<unknown>('');
readonly displayContent = computed(() => {
const c = this.content();
return typeof c === 'string' ? c : '';
});
readonly childKeys = input<string[]>([]);
readonly spec = input<Spec | null>(null);
readonly bindings = input<Record<string, string>>({});
Expand Down
1 change: 0 additions & 1 deletion libs/a2ui/src/lib/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { A2uiMessage } from './types';

const ENVELOPE_KEYS = ['createSurface', 'updateComponents', 'updateDataModel', 'deleteSurface'] as const;
type EnvelopeKey = typeof ENVELOPE_KEYS[number];

export interface A2uiMessageParser {
push(chunk: string): A2uiMessage[];
Expand Down
Loading