@siemens/live-preview 51.1.0 → 51.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siemens/live-preview",
3
3
  "description": "Element live preview for web",
4
- "version": "51.1.0",
4
+ "version": "51.3.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "peerDependencies": {
30
30
  "@angular/common": "22",
31
31
  "@angular/core": "22",
32
- "@babel/standalone": "8.0.4",
32
+ "@babel/standalone": "8.0.6",
33
33
  "react": "18 || 19",
34
34
  "react-dom": "18 || 19",
35
35
  "vue": "3",
@@ -1,161 +1,36 @@
1
1
  import * as i1 from '@angular/router';
2
- import { Routes, ActivatedRoute, Route } from '@angular/router';
3
- import * as _angular_core from '@angular/core';
4
- import { OnInit, OnDestroy, ViewContainerRef, ElementRef, AfterViewInit, OnChanges, SimpleChanges, DoCheck, Type, Signal, InjectionToken, Provider, ModuleWithProviders } from '@angular/core';
5
- import { UntypedFormControl } from '@angular/forms';
2
+ import { Routes, Route, ActivatedRoute } from '@angular/router';
3
+ import * as i0 from '@angular/core';
4
+ import { AfterViewInit, DoCheck, OnDestroy, Type, Signal, ViewContainerRef, InjectionToken, ApplicationConfig, Injector, EnvironmentProviders, Provider, ElementRef, ModuleWithProviders } from '@angular/core';
6
5
  import { Observable } from 'rxjs';
7
6
 
8
7
  declare const livePreviewRoutes: Routes;
9
8
  declare class SiLivePreviewRoutingModule {
10
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewRoutingModule, never>;
11
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiLivePreviewRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
12
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiLivePreviewRoutingModule>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewRoutingModule, never>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SiLivePreviewRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
11
+ static ɵinj: i0.ɵɵInjectorDeclaration<SiLivePreviewRoutingModule>;
13
12
  }
14
13
 
15
- declare class SiDummyComponent {
16
- path: string;
17
- activeRoute: ActivatedRoute;
18
- private cdRef;
19
- constructor();
20
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDummyComponent, never>;
21
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, true, never>;
22
- }
23
-
24
- interface TreeItem {
25
- label: string;
26
- link?: string;
27
- level: number;
28
- }
29
- declare class SiExampleOverviewComponent implements OnInit, OnDestroy {
30
- private route;
31
- private router;
32
- private title;
33
- private config;
34
- private internalConfig;
35
- private componentList;
36
- private darkMediaQuery;
37
- private mediaQueryListener;
38
- private cdRef;
39
- protected activeExampleRoute: Observable<string>;
40
- protected tree: TreeItem[];
41
- protected baseUrl: string;
42
- protected ticketBaseUrl: string;
43
- protected isCollapsed: boolean;
44
- protected showContent: boolean;
45
- protected searchControl: UntypedFormControl;
46
- ngOnInit(): void;
47
- ngOnDestroy(): void;
48
- private toggleDark;
49
- private makeTree;
50
- toggleCollapse(): void;
51
- resetSearchBar(): void;
52
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiExampleOverviewComponent, never>;
53
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiExampleOverviewComponent, "si-example-overview", never, {}, {}, never, never, true, never>;
54
- }
55
-
56
- declare class DummyAppSampleComponent {
57
- }
58
- declare class SiLivePreviewRendererComponent implements OnDestroy {
59
- readonly renderedExample: _angular_core.Signal<ViewContainerRef>;
60
- readonly react: _angular_core.Signal<ElementRef<any>>;
61
- readonly exampleUrl: _angular_core.InputSignal<string>;
62
- readonly dataId: _angular_core.InputSignal<string>;
63
- readonly template: _angular_core.InputSignal<string>;
64
- protected readonly renderingDone: _angular_core.WritableSignal<boolean>;
65
- readonly templateFromComponent: _angular_core.OutputEmitterRef<string | undefined>;
66
- readonly logClear: _angular_core.OutputEmitterRef<void>;
67
- readonly logMessage: _angular_core.OutputEmitterRef<string>;
68
- readonly logRenderingError: _angular_core.OutputEmitterRef<any>;
69
- readonly inProgress: _angular_core.OutputEmitterRef<boolean>;
70
- readonly supportsLandscapeMode: _angular_core.OutputEmitterRef<boolean>;
71
- private componentRef?;
72
- private componentTs?;
73
- private componentTsSampleComponent;
74
- private dynamicComponent;
75
- private dynamicComponentId?;
76
- private componentTsFirstLoad;
77
- private compiledTemplate?;
78
- private readonly compiler;
79
- private readonly injector;
80
- private readonly rendererFactory;
14
+ /**
15
+ * Base class for components that act as a live-preview runtime shell.
16
+ * Extend this class when providing `SiLivePreviewConfig.runtimeComponent`.
17
+ */
18
+ declare abstract class SiLivePreviewRuntimeComponent implements AfterViewInit, DoCheck, OnDestroy {
19
+ readonly component: i0.InputSignal<Type<unknown>>;
20
+ readonly ready: i0.OutputEmitterRef<void>;
21
+ readonly renderingError: i0.OutputEmitterRef<Error>;
22
+ protected abstract readonly container: Signal<ViewContainerRef>;
23
+ private readonly changeDetector;
24
+ private readonly activatedRoute;
81
25
  private readonly config;
82
- private readonly cdRef;
83
- constructor();
26
+ private componentRef?;
27
+ private childRouteBackup;
28
+ private hasRenderingError;
29
+ ngAfterViewInit(): void;
84
30
  ngOnDestroy(): void;
85
- recompile(): void;
86
- private logError;
87
- private setRenderingError;
88
- private loadFromUrl;
89
- private setInProgress;
90
- private compileWhenReady;
91
- private doCompileTemplate;
92
- private stringifyLog;
93
- private cloneComponentWithoutIvyStuff;
94
- private updateDynamicTemplate;
95
- /**
96
- * When the host application is built with AOT, the Angular compiler tree-shakes the
97
- * `ɵɵsetNgModuleScope` calls (because `ngJitMode` is `false`). As a result, NgModules that are
98
- * compiled from source expose no `imports`/`exports` scope on their `ɵmod` at runtime.
99
- *
100
- * Re-compiling the edited example via JIT (`compileComponent`) therefore cannot resolve the
101
- * directives and pipes that are exported through such an imported NgModule. A common symptom is
102
- * a missing value accessor for a form control component used with `ngModel`, which throws
103
- * `NG01203`.
104
- *
105
- * The originally (AOT-)compiled component already carries the fully resolved scope in its
106
- * component definition. Reusing its directive and pipe defs on the recompiled component restores
107
- * the complete scope without depending on runtime NgModule metadata.
108
- */
109
- private reuseResolvedScopeOfOriginalComponent;
110
- /** Merges two (possibly lazy) Ivy def lists into a single deduplicated factory. */
111
- private mergeDefs;
112
- private getAnnotation;
113
- private getAnnotationInAot;
114
- private clear;
115
- private removeComponentInstance;
116
- private createComponent;
117
- private createComponentInstance;
118
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewRendererComponent, never>;
119
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiLivePreviewRendererComponent, "si-live-preview-renderer", never, { "exampleUrl": { "alias": "exampleUrl"; "required": true; "isSignal": true; }; "dataId": { "alias": "dataId"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; }, { "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; "supportsLandscapeMode": "supportsLandscapeMode"; }, never, never, true, never>;
120
- }
121
-
122
- declare class SiExampleViewerComponent {
123
- private readonly router;
124
- private readonly route;
125
- private readonly config;
126
- private readonly internalConfig;
127
- private readonly themeApi;
128
- private readonly localeApi;
129
- protected readonly renderer: _angular_core.Signal<SiLivePreviewRendererComponent>;
130
- protected readonly ticketBaseUrl: string;
131
- protected readonly baseUrl: string;
132
- protected readonly exampleUrl: _angular_core.WritableSignal<string>;
133
- protected readonly dataId: _angular_core.WritableSignal<string>;
134
- protected readonly mode: _angular_core.WritableSignal<string>;
135
- protected readonly theme: _angular_core.WritableSignal<string>;
136
- protected readonly locale: _angular_core.WritableSignal<string>;
137
- protected readonly isRTL: _angular_core.WritableSignal<boolean>;
138
- protected readonly template: _angular_core.WritableSignal<string>;
139
- protected readonly reactTemplate: _angular_core.WritableSignal<string>;
140
- protected readonly vueTemplate: _angular_core.WritableSignal<string>;
141
- protected readonly jsTemplate: _angular_core.WritableSignal<string>;
142
- protected readonly tabs: _angular_core.WritableSignal<{
143
- heading: string;
144
- base: string;
145
- example: string;
146
- }[]>;
147
- protected readonly hasTabs: _angular_core.Signal<boolean>;
148
- protected readonly hasTabsMobile: _angular_core.Signal<boolean>;
149
- protected readonly activeTabIndex: _angular_core.WritableSignal<number>;
150
- constructor();
151
- private handleQueryParams;
152
- private setUiTheme;
153
- private setTheme;
154
- private setRTL;
155
- private setLocale;
156
- activateTab(index: number): void;
157
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiExampleViewerComponent, never>;
158
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiExampleViewerComponent, "si-example-viewer", never, {}, {}, never, never, true, never>;
31
+ ngDoCheck(): void;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewRuntimeComponent, never>;
33
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SiLivePreviewRuntimeComponent, never, never, { "component": { "alias": "component"; "required": true; "isSignal": true; }; }, { "ready": "ready"; "renderingError": "renderingError"; }, never, never, true, never>;
159
34
  }
160
35
 
161
36
  /**
@@ -163,276 +38,81 @@ declare class SiExampleViewerComponent {
163
38
  * SPDX-License-Identifier: MIT
164
39
  */
165
40
 
166
- type ThemeType = 'dark' | 'light';
167
- declare abstract class SiLivePreviewThemeApi {
168
- abstract setThemeFromPreviewer(mode: ThemeType): void;
169
- abstract getApplicationThemeObservable(): Observable<ThemeType>;
170
- }
171
- declare abstract class SiLivePreviewLocaleApi {
172
- abstract setLocale(locale: string): void;
173
- abstract getLocale(): Observable<string>;
174
- abstract availableLocales(): string[];
41
+ interface SiLivePreviewConfig {
42
+ errorHandler?: (err: any) => void;
43
+ /**
44
+ * Optional shell for rendered examples. The shell receives the standalone example through
45
+ * `component` and is responsible for rendering it, for example by composing the default shell.
46
+ */
47
+ runtimeComponent?: Type<SiLivePreviewRuntimeComponent>;
48
+ /**
49
+ * Routes used by rendered examples that do not provide routes through `provideExampleRoutes`.
50
+ */
51
+ defaultRoutes?: Route[];
52
+ componentLoader: {
53
+ load: (name: string) => Promise<any>;
54
+ list: string[];
55
+ webcomponentsList: string[];
56
+ };
57
+ examplesBaseUrl: string;
58
+ ticketBaseUrl: string;
59
+ themeSwitcher?: boolean;
60
+ rtlSwitcher?: boolean;
61
+ landscapeToggle?: boolean;
62
+ webcomponents?: boolean;
63
+ rootFontSizes?: number[];
175
64
  }
176
-
177
- declare class SiLivePreviewComponent implements OnInit, AfterViewInit, OnChanges {
178
- private readonly config;
179
- private readonly internalConfig;
180
- private readonly self;
181
- private readonly http;
182
- protected readonly localeApi: SiLivePreviewLocaleApi | null;
183
- protected readonly templateElem: _angular_core.Signal<ElementRef<any>>;
184
- protected readonly typescriptElem: _angular_core.Signal<ElementRef<any>>;
185
- protected readonly reactVueElem: _angular_core.Signal<ElementRef<any>>;
186
- protected readonly consoleElem: _angular_core.Signal<ElementRef<any>>;
187
- readonly baseUrl: _angular_core.InputSignal<string>;
188
- readonly example: _angular_core.InputSignal<string | null | undefined>;
189
- readonly template: _angular_core.ModelSignal<string>;
190
- readonly theme: _angular_core.ModelSignal<string>;
191
- readonly locale: _angular_core.ModelSignal<string | null | undefined>;
192
- readonly isRTL: _angular_core.ModelSignal<boolean>;
193
- readonly ticketBaseUrl: _angular_core.InputSignal<string>;
194
- readonly templateReact: _angular_core.ModelSignal<string>;
195
- readonly templateVue: _angular_core.ModelSignal<string>;
196
- readonly templateJs: _angular_core.ModelSignal<string>;
197
- protected readonly isFullscreen: _angular_core.WritableSignal<boolean>;
198
- protected readonly isMobile: boolean;
199
- private templateTs;
200
- protected readonly renderingError: _angular_core.WritableSignal<any>;
201
- protected readonly logMessages: _angular_core.WritableSignal<string[]>;
202
- protected readonly activeTab: _angular_core.WritableSignal<string>;
203
- protected readonly showCopied: _angular_core.WritableSignal<boolean>;
204
- protected readonly inProgress: _angular_core.WritableSignal<boolean>;
205
- protected readonly allowFullscreen: boolean;
206
- protected readonly exampleFullscreen: _angular_core.WritableSignal<boolean>;
207
- protected readonly allowCopy = true;
208
- protected readonly loadReact: _angular_core.WritableSignal<boolean>;
209
- protected readonly loadVue: _angular_core.WritableSignal<boolean>;
210
- protected readonly loadJs: _angular_core.WritableSignal<boolean>;
211
- protected readonly switcherEnabled: boolean | undefined;
212
- protected readonly rtlSwitcher: boolean | undefined;
213
- protected readonly rootFontSizes: number[];
214
- protected readonly rootFontSize: _angular_core.WritableSignal<number | "initial">;
215
- protected readonly webcomponents: boolean | undefined;
216
- protected readonly frameworks: Map<string, string>;
217
- protected selectedFramework: string;
218
- readonly availableLocales: string[];
219
- ticketLinkBug: string;
220
- ticketLinkFeature: string;
221
- protected readonly editorCollapsed: _angular_core.WritableSignal<boolean>;
222
- protected readonly showEditor: _angular_core.WritableSignal<boolean>;
223
- protected readonly newMsgs: _angular_core.WritableSignal<boolean>;
224
- private compileSubject;
225
- private templateModified;
226
- private skipInitialLoad;
227
- private flaskTemplate;
228
- private flaskTypescript;
229
- private flaskReactVue;
230
- private savedScrollPos;
231
- private inProgressCounter;
232
- private tsLoaded;
233
- private reactLoaded;
234
- private vueLoaded;
235
- private jsLoaded;
236
- private delayClearTimer;
237
- private webcomponentsList;
238
- constructor();
239
- ngOnChanges(changes: SimpleChanges<this>): void;
240
- ngOnInit(): void;
241
- ngAfterViewInit(): void;
242
- activateTab(tab: string): void;
243
- themeChange(theme: string): void;
244
- private updateTemplate;
245
- private updateTs;
246
- private updateReact;
247
- private updateVue;
248
- private updateJs;
249
- private loadFromUrl;
250
- private loadTemplateFromUrl;
251
- private loadTsFromUrl;
252
- checkWebComponentsAvailable(): void;
253
- changeFramework(framework: string): void;
254
- templateFromComponent(template?: string): void;
255
- handleInProgressEvent(inProgress: boolean): void;
256
- logClear(delayed?: boolean): void;
257
- private doLogClear;
258
- logEvent(msg: string): void;
259
- private showCopiedLabel;
260
- toggleFullscreen(exampleOnly?: boolean): void;
261
- toggleCollapse(): void;
262
- toggleRTL(): void;
263
- toggleTheme(): void;
264
- localeSelectionChanged(target: EventTarget | null): void;
265
- rfsSelectionChanges(value: string): void;
266
- changeLocale(locale: string | null | undefined): void;
267
- copyTemplate(): void;
268
- copyCode(): void;
269
- private clipboardCopy;
270
- createLink(): void;
271
- openTab(): void;
272
- private createTemplateLink;
273
- private createTicketLinks;
274
- protected onFullscreenChange(): void;
275
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewComponent, never>;
276
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiLivePreviewComponent, "si-live-preview", never, { "baseUrl": { "alias": "baseUrl"; "required": true; "isSignal": true; }; "example": { "alias": "example"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "isRTL": { "alias": "isRTL"; "required": false; "isSignal": true; }; "ticketBaseUrl": { "alias": "ticketBaseUrl"; "required": false; "isSignal": true; }; "templateReact": { "alias": "templateReact"; "required": false; "isSignal": true; }; "templateVue": { "alias": "templateVue"; "required": false; "isSignal": true; }; "templateJs": { "alias": "templateJs"; "required": false; "isSignal": true; }; }, { "template": "templateChange"; "theme": "themeChange"; "locale": "localeChange"; "isRTL": "isRTLChange"; "templateReact": "templateReactChange"; "templateVue": "templateVueChange"; "templateJs": "templateJsChange"; }, never, never, true, never>;
65
+ interface SiLivePreviewInternals {
66
+ isMobile: boolean;
67
+ titleBase: string;
277
68
  }
69
+ declare const SI_LIVE_PREVIEW_CONFIG: InjectionToken<SiLivePreviewConfig>;
70
+ declare const SI_LIVE_PREVIEW_INTERNALS: InjectionToken<SiLivePreviewInternals>;
71
+ declare const SI_LIVE_PREVIEW_EXAMPLE_ROUTES: InjectionToken<Route[]>;
278
72
 
279
73
  /**
280
74
  * Copyright (c) Siemens 2016 - 2026
281
75
  * SPDX-License-Identifier: MIT
282
76
  */
283
- /** */
284
- interface Device {
285
- id: string;
286
- mode: string;
287
- name: string;
288
- height: string;
289
- width: string;
290
- notch?: boolean;
291
- safeAreaPortrait?: {
292
- top?: number;
293
- bottom?: number;
294
- left?: number;
295
- right?: number;
296
- };
297
- safeAreaLandscape?: {
298
- top?: number;
299
- bottom?: number;
300
- left?: number;
301
- right?: number;
302
- };
303
- }
304
77
 
305
- declare class SiLivePreviewIframeComponent implements OnInit {
306
- readonly previewIframe: _angular_core.Signal<ElementRef<any> | undefined>;
307
- readonly baseUrl: _angular_core.InputSignal<string>;
308
- readonly exampleUrl: _angular_core.InputSignal<string>;
309
- readonly template: _angular_core.InputSignal<string>;
310
- readonly ticketLinkBug: _angular_core.InputSignal<string>;
311
- readonly ticketLinkFeature: _angular_core.InputSignal<string>;
312
- readonly isFullscreen: _angular_core.InputSignal<boolean>;
313
- readonly iFrameHeight: _angular_core.InputSignal<string | undefined>;
314
- readonly iFrameWidth: _angular_core.InputSignal<string | undefined>;
315
- readonly theme: _angular_core.ModelSignal<string>;
316
- readonly locale: _angular_core.ModelSignal<string | null | undefined>;
317
- readonly rootFontSize: _angular_core.InputSignal<number | "initial">;
318
- readonly isRTL: _angular_core.InputSignal<boolean | undefined>;
319
- readonly loadReact: _angular_core.InputSignal<boolean | undefined>;
320
- readonly loadVue: _angular_core.InputSignal<boolean | undefined>;
321
- readonly loadJs: _angular_core.InputSignal<boolean | undefined>;
322
- readonly reactVueTemplate: _angular_core.InputSignal<string | undefined>;
323
- readonly templateFromComponent: _angular_core.OutputEmitterRef<string | undefined>;
324
- readonly logClear: _angular_core.OutputEmitterRef<void>;
325
- readonly logMessage: _angular_core.OutputEmitterRef<string>;
326
- readonly logRenderingError: _angular_core.OutputEmitterRef<any>;
327
- readonly inProgress: _angular_core.OutputEmitterRef<boolean>;
328
- private originalTemplate;
329
- private templateModified;
330
- private rendererInProgress;
331
- private readonly config;
332
- private readonly internalConfig;
333
- private readonly ngZone;
334
- private readonly destroyRef;
335
- private readonly cdRef;
336
- protected readonly isMobile: boolean;
337
- /** iframe height, seeded from the {@link iFrameHeight} input and mutable in mobile mode. */
338
- protected readonly currentIFrameHeight: _angular_core.WritableSignal<string | undefined>;
339
- /** iframe width, seeded from the {@link iFrameWidth} input and mutable in mobile mode. */
340
- protected readonly currentIFrameWidth: _angular_core.WritableSignal<string | undefined>;
341
- protected readonly mode: _angular_core.WritableSignal<string>;
342
- protected readonly landscape: _angular_core.WritableSignal<boolean>;
343
- protected readonly switcherEnabled: boolean | undefined;
344
- protected readonly landscapeEnabled: boolean | undefined;
345
- protected readonly supportsLandscape: _angular_core.WritableSignal<boolean>;
346
- protected readonly availableDevices: Device[];
347
- protected readonly selectedDevice: _angular_core.WritableSignal<Device | undefined>;
348
- protected readonly showNotch: _angular_core.WritableSignal<boolean>;
349
- protected readonly showQrMenu: _angular_core.WritableSignal<boolean>;
350
- protected readonly plainUrl: _angular_core.WritableSignal<string>;
351
- protected readonly plainUrlShort: _angular_core.WritableSignal<string>;
352
- constructor();
353
- ngOnInit(): void;
354
- deviceChanged(): void;
355
- private onMessage;
356
- private onMessageInZone;
357
- toggleTheme(): void;
358
- toggleLandscape(): void;
359
- openQrMenu(): void;
360
- private createTemplateLink;
361
- private encode;
362
- private sendMessage;
363
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewIframeComponent, never>;
364
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiLivePreviewIframeComponent, "si-live-preview-iframe", never, { "baseUrl": { "alias": "baseUrl"; "required": true; "isSignal": true; }; "exampleUrl": { "alias": "exampleUrl"; "required": true; "isSignal": true; }; "template": { "alias": "template"; "required": true; "isSignal": true; }; "ticketLinkBug": { "alias": "ticketLinkBug"; "required": true; "isSignal": true; }; "ticketLinkFeature": { "alias": "ticketLinkFeature"; "required": true; "isSignal": true; }; "isFullscreen": { "alias": "isFullscreen"; "required": false; "isSignal": true; }; "iFrameHeight": { "alias": "iFrameHeight"; "required": false; "isSignal": true; }; "iFrameWidth": { "alias": "iFrameWidth"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "rootFontSize": { "alias": "rootFontSize"; "required": false; "isSignal": true; }; "isRTL": { "alias": "isRTL"; "required": false; "isSignal": true; }; "loadReact": { "alias": "loadReact"; "required": false; "isSignal": true; }; "loadVue": { "alias": "loadVue"; "required": false; "isSignal": true; }; "loadJs": { "alias": "loadJs"; "required": false; "isSignal": true; }; "reactVueTemplate": { "alias": "reactVueTemplate"; "required": false; "isSignal": true; }; }, { "theme": "themeChange"; "locale": "localeChange"; "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; }, never, never, true, never>;
78
+ interface SiLivePreviewProviderConfig extends SiLivePreviewConfig {
79
+ /**
80
+ * Configuration applied to each isolated example application. A factory can use the host
81
+ * injector to share selected service instances with the example application.
82
+ */
83
+ exampleApplicationConfig?: ApplicationConfig | ((injector: Injector) => ApplicationConfig);
365
84
  }
366
-
367
85
  /**
368
- * Base class for components that act as a live-preview runtime shell.
369
- * Extend this class when providing `SiLivePreviewConfig.runtimeComponent`.
86
+ * Configures live preview with each example rendered in an independent Angular application.
370
87
  */
371
- declare abstract class SiLivePreviewRuntimeComponent implements AfterViewInit, DoCheck, OnDestroy {
372
- readonly component: _angular_core.InputSignal<Type<unknown>>;
373
- readonly ready: _angular_core.OutputEmitterRef<void>;
374
- readonly renderingError: _angular_core.OutputEmitterRef<Error>;
375
- protected abstract readonly container: Signal<ViewContainerRef>;
376
- private readonly changeDetector;
377
- private readonly activatedRoute;
378
- private readonly config;
379
- private componentRef?;
380
- private childRouteBackup;
381
- private hasRenderingError;
382
- ngAfterViewInit(): void;
383
- ngOnDestroy(): void;
384
- ngDoCheck(): void;
385
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewRuntimeComponent, never>;
386
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiLivePreviewRuntimeComponent, never, never, { "component": { "alias": "component"; "required": true; "isSignal": true; }; }, { "ready": "ready"; "renderingError": "renderingError"; }, never, never, true, never>;
387
- }
88
+ declare const provideLivePreview: (config: SiLivePreviewProviderConfig, isMobile?: boolean) => EnvironmentProviders;
388
89
 
389
- declare class SiLivePreviewWrapperComponent {
390
- private readonly renderer;
391
- private readonly webcomponentRenderer;
392
- protected readonly exampleUrl: _angular_core.WritableSignal<string>;
393
- protected readonly template: _angular_core.WritableSignal<string>;
394
- protected readonly loadReact: _angular_core.WritableSignal<boolean>;
395
- protected readonly loadVue: _angular_core.WritableSignal<boolean>;
396
- protected readonly loadJs: _angular_core.WritableSignal<boolean>;
397
- protected readonly webcomponentTemplateCode: _angular_core.WritableSignal<string>;
398
- private isMobile;
399
- private theme;
400
- private isRTL;
401
- private mode;
402
- private locale?;
403
- private rootFontSize?;
404
- private initialUrl;
405
- private readonly config;
406
- private readonly themeApi;
407
- private readonly localeApi;
408
- private readonly internalConfig;
409
- private readonly ngZone;
410
- private readonly webcomponentService;
411
- private readonly cdRef;
90
+ declare class SiDummyComponent {
91
+ path: string;
92
+ activeRoute: ActivatedRoute;
93
+ private cdRef;
412
94
  constructor();
413
- private onMessage;
414
- private onMessageInZone;
415
- onClick(event: MouseEvent): void;
416
- sendMessage(type: string, message?: any): void;
417
- private setTheme;
418
- private setRTL;
419
- private setLocale;
420
- private setSafeArea;
421
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewWrapperComponent, never>;
422
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiLivePreviewWrapperComponent, "si-live-preview-wrapper", never, {}, {}, never, never, true, never>;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiDummyComponent, never>;
96
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, true, never>;
423
97
  }
424
98
 
425
- declare class SiLivePreviewQrComponent implements AfterViewInit, OnDestroy {
426
- readonly url: _angular_core.InputSignal<string | undefined>;
427
- readonly urlShort: _angular_core.InputSignal<string | undefined>;
428
- readonly closed: _angular_core.OutputEmitterRef<void>;
429
- readonly qrImg: _angular_core.Signal<string | null>;
430
- readonly qrShort: _angular_core.Signal<boolean>;
431
- private unlisten?;
99
+ /**
100
+ * Runtime shell that renders each example in an independent Angular application.
101
+ * The example application owns its router and does not modify the live-preview router.
102
+ */
103
+ declare abstract class SiLivePreviewApplicationRuntimeComponent extends SiLivePreviewRuntimeComponent {
104
+ private readonly applicationConfig;
105
+ private readonly parentInjector;
106
+ private exampleComponentRef?;
107
+ private applicationRef?;
108
+ private hostElement?;
109
+ private destroyed;
432
110
  ngAfterViewInit(): void;
433
111
  ngOnDestroy(): void;
434
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewQrComponent, never>;
435
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiLivePreviewQrComponent, "si-live-preview-qr", never, { "url": { "alias": "url"; "required": false; "isSignal": true; }; "urlShort": { "alias": "urlShort"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
112
+ private createExampleApplication;
113
+ private handleError;
114
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewApplicationRuntimeComponent, never>;
115
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SiLivePreviewApplicationRuntimeComponent, never, never, {}, {}, never, never, true, never>;
436
116
  }
437
117
 
438
118
  /**
@@ -494,37 +174,16 @@ declare const angularTemplateProject: () => AssetProject;
494
174
  * SPDX-License-Identifier: MIT
495
175
  */
496
176
 
497
- interface SiLivePreviewConfig {
498
- errorHandler?: (err: any) => void;
499
- /**
500
- * Optional shell for rendered examples. The shell receives the standalone example through
501
- * `component` and is responsible for rendering it, for example by composing the default shell.
502
- */
503
- runtimeComponent?: Type<SiLivePreviewRuntimeComponent>;
504
- /**
505
- * Routes used by rendered examples that do not provide routes through `provideExampleRoutes`.
506
- */
507
- defaultRoutes?: Route[];
508
- componentLoader: {
509
- load: (name: string) => Promise<any>;
510
- list: string[];
511
- webcomponentsList: string[];
512
- };
513
- examplesBaseUrl: string;
514
- ticketBaseUrl: string;
515
- themeSwitcher?: boolean;
516
- rtlSwitcher?: boolean;
517
- landscapeToggle?: boolean;
518
- webcomponents?: boolean;
519
- rootFontSizes?: number[];
177
+ type ThemeType = 'dark' | 'light';
178
+ declare abstract class SiLivePreviewThemeApi {
179
+ abstract setThemeFromPreviewer(mode: ThemeType): void;
180
+ abstract getApplicationThemeObservable(): Observable<ThemeType>;
520
181
  }
521
- interface SiLivePreviewInternals {
522
- isMobile: boolean;
523
- titleBase: string;
182
+ declare abstract class SiLivePreviewLocaleApi {
183
+ abstract setLocale(locale: string): void;
184
+ abstract getLocale(): Observable<string>;
185
+ abstract availableLocales(): string[];
524
186
  }
525
- declare const SI_LIVE_PREVIEW_CONFIG: InjectionToken<SiLivePreviewConfig>;
526
- declare const SI_LIVE_PREVIEW_INTERNALS: InjectionToken<SiLivePreviewInternals>;
527
- declare const SI_LIVE_PREVIEW_EXAMPLE_ROUTES: InjectionToken<Route[]>;
528
187
 
529
188
  /**
530
189
  * Copyright (c) Siemens 2016 - 2026
@@ -548,13 +207,13 @@ declare const provideExampleRoutes: (routes: Route[]) => Provider;
548
207
  declare abstract class SiLivePreviewWebComponentService {
549
208
  abstract injectComponent(element: ElementRef, inputs?: any, outputs?: any): any;
550
209
  abstract destroyComponent(): void;
551
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewWebComponentService, never>;
552
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<SiLivePreviewWebComponentService>;
210
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewWebComponentService, never>;
211
+ static ɵprov: i0.ɵɵInjectableDeclaration<SiLivePreviewWebComponentService>;
553
212
  }
554
213
 
555
214
  declare class LandscapeSupportService {
556
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<LandscapeSupportService, never>;
557
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<LandscapeSupportService>;
215
+ static ɵfac: i0.ɵɵFactoryDeclaration<LandscapeSupportService, never>;
216
+ static ɵprov: i0.ɵɵInjectableDeclaration<LandscapeSupportService>;
558
217
  }
559
218
 
560
219
  /**
@@ -564,10 +223,10 @@ declare class LandscapeSupportService {
564
223
 
565
224
  declare class SiLivePreviewModule {
566
225
  static forRoot(config: SiLivePreviewConfig, isMobile?: boolean): ModuleWithProviders<SiLivePreviewModule>;
567
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewModule, never>;
568
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiLivePreviewModule, never, [typeof SiExampleViewerComponent, typeof SiExampleOverviewComponent], [typeof SiExampleOverviewComponent, typeof SiExampleViewerComponent]>;
569
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiLivePreviewModule>;
226
+ static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewModule, never>;
227
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SiLivePreviewModule, never, never, never>;
228
+ static ɵinj: i0.ɵɵInjectorDeclaration<SiLivePreviewModule>;
570
229
  }
571
230
 
572
- export { DummyAppSampleComponent, LOG_EVENT, LandscapeSupportService, SI_LIVE_PREVIEW_CONFIG, SI_LIVE_PREVIEW_EXAMPLE_ROUTES, SI_LIVE_PREVIEW_INTERNALS, SI_STACKBLITZ_CONFIG, SiDummyComponent, SiExampleOverviewComponent, SiExampleViewerComponent, SiLivePreviewComponent, SiLivePreviewIframeComponent, SiLivePreviewLocaleApi, SiLivePreviewModule, SiLivePreviewQrComponent, SiLivePreviewRendererComponent, SiLivePreviewRoutingModule, SiLivePreviewRuntimeComponent, SiLivePreviewThemeApi, SiLivePreviewWebComponentService, SiLivePreviewWrapperComponent, SiLivePreviewModule as SimplLivePreviewModule, SiLivePreviewRoutingModule as SimplLivePreviewRoutingModule, angularTemplateProject, livePreviewRoutes, provideExampleRoutes, provideStackblitzConfig };
573
- export type { SiLivePreviewConfig, SiLivePreviewInternals, ThemeType };
231
+ export { LOG_EVENT, LandscapeSupportService, SI_LIVE_PREVIEW_CONFIG, SI_LIVE_PREVIEW_EXAMPLE_ROUTES, SI_LIVE_PREVIEW_INTERNALS, SI_STACKBLITZ_CONFIG, SiDummyComponent, SiLivePreviewApplicationRuntimeComponent, SiLivePreviewLocaleApi, SiLivePreviewModule, SiLivePreviewRoutingModule, SiLivePreviewRuntimeComponent, SiLivePreviewThemeApi, SiLivePreviewWebComponentService, SiLivePreviewModule as SimplLivePreviewModule, SiLivePreviewRoutingModule as SimplLivePreviewRoutingModule, angularTemplateProject, livePreviewRoutes, provideExampleRoutes, provideLivePreview, provideStackblitzConfig };
232
+ export type { SiLivePreviewConfig, SiLivePreviewInternals, SiLivePreviewProviderConfig, ThemeType };