@siemens/live-preview 51.6.0 → 51.7.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.6.0",
4
+ "version": "51.7.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "repository": {
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@stackblitz/sdk": "^1.11.0",
23
23
  "codeflask": "^1.4.1",
24
- "glob": "13.0.6",
24
+ "glob": "14.0.6",
25
25
  "prismjs": "^1.30.0",
26
26
  "qrcode-generator": "^2.0.0",
27
27
  "tslib": "^2.3.0"
@@ -29,6 +29,9 @@
29
29
  "peerDependencies": {
30
30
  "@angular/common": "22",
31
31
  "@angular/core": "22",
32
+ "@angular/elements": "22",
33
+ "@angular/forms": "22",
34
+ "@angular/router": "22",
32
35
  "@babel/standalone": "8",
33
36
  "react": "18 || 19",
34
37
  "react-dom": "18 || 19",
@@ -36,6 +39,9 @@
36
39
  "vue3-sfc-loader": "0.9.5"
37
40
  },
38
41
  "peerDependenciesMeta": {
42
+ "@angular/elements": {
43
+ "optional": true
44
+ },
39
45
  "react": {
40
46
  "optional": true
41
47
  },
@@ -66,6 +72,10 @@
66
72
  "types": "./types/siemens-live-preview.d.ts",
67
73
  "default": "./fesm2022/siemens-live-preview.mjs"
68
74
  },
75
+ "./elements": {
76
+ "types": "./types/siemens-live-preview-elements.d.ts",
77
+ "default": "./fesm2022/siemens-live-preview-elements.mjs"
78
+ },
69
79
  "./webcomponents": {
70
80
  "types": "./types/siemens-live-preview-webcomponents.d.ts",
71
81
  "default": "./fesm2022/siemens-live-preview-webcomponents.mjs"
@@ -18,9 +18,10 @@ $live-preview-button-background-color: variables.$si-sys-color-background-accent
18
18
 
19
19
  $live-preview-control-fill-color: variables.$si-sys-color-text-primary;
20
20
 
21
- $live-preview-focus-outline: variables.$focus-style-outline;
22
- $live-preview-focus-outline-offset: variables.$focus-style-outline-offset;
23
- $live-preview-focus-outline-inside-offset: variables.$focus-style-outline-inside-offset;
21
+ $live-preview-focus-outline: var(--si-sys-sizing-focus-ring-width, 2px) solid
22
+ variables.$si-sys-color-effects-focus;
23
+ $live-preview-focus-outline-offset: var(--si-sys-sizing-focus-ring-offset, 1px);
24
+ $live-preview-focus-outline-inside-offset: calc(-1 * var(--si-sys-sizing-focus-ring-width, 2px));
24
25
  $live-preview-font-color: variables.$si-sys-color-text-primary;
25
26
 
26
27
  $live-preview-link-color: variables.$si-sys-color-text-accent;
@@ -0,0 +1,11 @@
1
+ import { Injector } from '@angular/core';
2
+
3
+ /**
4
+ * Copyright (c) Siemens 2016 - 2026
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+
8
+ /** Registers the existing documentation markup as live-preview custom elements. */
9
+ declare const defineLivePreviewElements: (injector: Injector) => void;
10
+
11
+ export { defineLivePreviewElements };
@@ -1,14 +1,14 @@
1
1
  import * as i1 from '@angular/router';
2
2
  import { Routes, Route, ActivatedRoute } from '@angular/router';
3
- import * as i0 from '@angular/core';
3
+ import * as _angular_core from '@angular/core';
4
4
  import { AfterViewInit, DoCheck, OnDestroy, Type, Signal, ViewContainerRef, InjectionToken, ApplicationConfig, Injector, EnvironmentProviders, Provider, ElementRef, ModuleWithProviders } from '@angular/core';
5
5
  import { Observable } from 'rxjs';
6
6
 
7
7
  declare const livePreviewRoutes: Routes;
8
8
  declare class 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>;
9
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewRoutingModule, never>;
10
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiLivePreviewRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
11
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiLivePreviewRoutingModule>;
12
12
  }
13
13
 
14
14
  /**
@@ -16,9 +16,9 @@ declare class SiLivePreviewRoutingModule {
16
16
  * Extend this class when providing `SiLivePreviewConfig.runtimeComponent`.
17
17
  */
18
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>;
19
+ readonly component: _angular_core.InputSignal<Type<unknown>>;
20
+ readonly ready: _angular_core.OutputEmitterRef<void>;
21
+ readonly renderingError: _angular_core.OutputEmitterRef<Error>;
22
22
  protected abstract readonly container: Signal<ViewContainerRef>;
23
23
  private readonly changeDetector;
24
24
  private readonly activatedRoute;
@@ -29,8 +29,8 @@ declare abstract class SiLivePreviewRuntimeComponent implements AfterViewInit, D
29
29
  ngAfterViewInit(): void;
30
30
  ngOnDestroy(): void;
31
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>;
32
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewRuntimeComponent, never>;
33
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiLivePreviewRuntimeComponent, never, never, { "component": { "alias": "component"; "required": true; "isSignal": true; }; }, { "ready": "ready"; "renderingError": "renderingError"; }, never, never, true, never>;
34
34
  }
35
35
 
36
36
  /**
@@ -87,13 +87,125 @@ interface SiLivePreviewProviderConfig extends SiLivePreviewConfig {
87
87
  */
88
88
  declare const provideLivePreview: (config: SiLivePreviewProviderConfig, isMobile?: boolean) => EnvironmentProviders;
89
89
 
90
+ /**
91
+ * Copyright (c) Siemens 2016 - 2026
92
+ * SPDX-License-Identifier: MIT
93
+ */
94
+
95
+ type ThemeType = 'dark' | 'light';
96
+ declare abstract class SiLivePreviewThemeApi {
97
+ abstract setThemeFromPreviewer(mode: ThemeType): void;
98
+ abstract getApplicationThemeObservable(): Observable<ThemeType>;
99
+ }
100
+ declare abstract class SiLivePreviewLocaleApi {
101
+ abstract setLocale(locale: string): void;
102
+ abstract getLocale(): Observable<string>;
103
+ abstract availableLocales(): string[];
104
+ }
105
+
106
+ /**
107
+ * Copyright (c) Siemens 2016 - 2026
108
+ * SPDX-License-Identifier: MIT
109
+ */
110
+ interface LivePreviewViewport {
111
+ mode: string;
112
+ safeAreaTop?: number;
113
+ safeAreaBottom?: number;
114
+ safeAreaLeft?: number;
115
+ safeAreaRight?: number;
116
+ }
117
+
118
+ type LivePreviewFramework = 'angular' | 'react' | 'vue' | 'js';
119
+ interface LivePreviewRenderRequest extends LivePreviewViewport {
120
+ exampleUrl: string;
121
+ template: string;
122
+ loadReact: boolean;
123
+ loadVue: boolean;
124
+ loadJs: boolean;
125
+ reactVueTemplate: string;
126
+ }
127
+ declare class LivePreviewStateService {
128
+ private readonly router;
129
+ private readonly overviewExample;
130
+ private delayedLogClearTimer?;
131
+ readonly example: _angular_core.WritableSignal<string>;
132
+ readonly dataId: _angular_core.WritableSignal<string>;
133
+ readonly template: _angular_core.WritableSignal<string>;
134
+ readonly templateReact: _angular_core.WritableSignal<string>;
135
+ readonly templateVue: _angular_core.WritableSignal<string>;
136
+ readonly templateJs: _angular_core.WritableSignal<string>;
137
+ readonly originalTemplate: _angular_core.WritableSignal<string>;
138
+ readonly theme: _angular_core.WritableSignal<ThemeType>;
139
+ readonly locale: _angular_core.WritableSignal<string | undefined>;
140
+ readonly isRTL: _angular_core.WritableSignal<boolean>;
141
+ readonly rootFontSize: _angular_core.WritableSignal<number | "initial">;
142
+ readonly framework: _angular_core.WritableSignal<LivePreviewFramework>;
143
+ readonly loadReact: _angular_core.WritableSignal<boolean>;
144
+ readonly loadVue: _angular_core.WritableSignal<boolean>;
145
+ readonly loadJs: _angular_core.WritableSignal<boolean>;
146
+ readonly supportsLandscape: _angular_core.WritableSignal<boolean>;
147
+ readonly viewport: _angular_core.WritableSignal<LivePreviewViewport>;
148
+ readonly iFrameHeight: _angular_core.WritableSignal<string | undefined>;
149
+ readonly iFrameWidth: _angular_core.WritableSignal<string | undefined>;
150
+ readonly renderingError: _angular_core.WritableSignal<unknown>;
151
+ readonly logMessages: _angular_core.WritableSignal<string[]>;
152
+ readonly newMessages: _angular_core.WritableSignal<boolean>;
153
+ readonly pendingOperations: _angular_core.WritableSignal<number>;
154
+ readonly inProgress: _angular_core.Signal<boolean>;
155
+ readonly templateModified: _angular_core.Signal<boolean>;
156
+ readonly activeWebComponentTemplate: _angular_core.Signal<string>;
157
+ constructor();
158
+ private findOverviewRoute;
159
+ private getOverviewExample;
160
+ setFramework(framework: LivePreviewFramework): void;
161
+ applyRenderRequest(request: LivePreviewRenderRequest): void;
162
+ stopWebComponentLoading(): void;
163
+ clearTemplates(): void;
164
+ toggleTheme(): void;
165
+ setRenderingProgress(inProgress: boolean): void;
166
+ resetRenderingProgress(): void;
167
+ addLog(message: string): void;
168
+ clearLogs(delayed?: boolean): void;
169
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LivePreviewStateService, never>;
170
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<LivePreviewStateService>;
171
+ }
172
+
173
+ interface DocsExample {
174
+ example: string;
175
+ heading: string;
176
+ }
177
+ /**
178
+ * Documentation component shared with the optional elements entry point.
179
+ * @internal
180
+ */
181
+ declare class SiDocsComponentComponent {
182
+ readonly example: _angular_core.InputSignal<string>;
183
+ readonly base: _angular_core.InputSignal<string>;
184
+ readonly height: _angular_core.InputSignalWithTransform<number, unknown>;
185
+ readonly theme: _angular_core.InputSignal<ThemeType | undefined>;
186
+ protected readonly state: LivePreviewStateService;
187
+ private readonly document;
188
+ private readonly host;
189
+ private readonly documentTheme;
190
+ private readonly childExamples;
191
+ protected readonly previewTheme: _angular_core.Signal<ThemeType>;
192
+ protected readonly activeTabIndex: _angular_core.WritableSignal<number>;
193
+ protected readonly previewHeight: _angular_core.Signal<number>;
194
+ protected readonly tabs: _angular_core.Signal<DocsExample[]>;
195
+ constructor();
196
+ private readDocumentTheme;
197
+ protected activateTab(index: number, focus?: boolean): void;
198
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDocsComponentComponent, never>;
199
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiDocsComponentComponent, "si-docs-component", never, { "example": { "alias": "example"; "required": false; "isSignal": true; }; "base": { "alias": "base"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
200
+ }
201
+
90
202
  declare class SiDummyComponent {
91
203
  path: string;
92
204
  activeRoute: ActivatedRoute;
93
205
  private cdRef;
94
206
  constructor();
95
- static ɵfac: i0.ɵɵFactoryDeclaration<SiDummyComponent, never>;
96
- static ɵcmp: i0.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, true, never>;
207
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDummyComponent, never>;
208
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, true, never>;
97
209
  }
98
210
 
99
211
  /**
@@ -111,8 +223,8 @@ declare abstract class SiLivePreviewApplicationRuntimeComponent extends SiLivePr
111
223
  ngOnDestroy(): void;
112
224
  private createExampleApplication;
113
225
  private handleError;
114
- static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewApplicationRuntimeComponent, never>;
115
- static ɵdir: i0.ɵɵDirectiveDeclaration<SiLivePreviewApplicationRuntimeComponent, never, never, {}, {}, never, never, true, never>;
226
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewApplicationRuntimeComponent, never>;
227
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<SiLivePreviewApplicationRuntimeComponent, never, never, {}, {}, never, never, true, never>;
116
228
  }
117
229
 
118
230
  /**
@@ -169,22 +281,6 @@ declare const provideStackblitzConfig: (config?: StackblitzConfig) => Provider;
169
281
  */
170
282
  declare const angularTemplateProject: () => AssetProject;
171
283
 
172
- /**
173
- * Copyright (c) Siemens 2016 - 2026
174
- * SPDX-License-Identifier: MIT
175
- */
176
-
177
- type ThemeType = 'dark' | 'light';
178
- declare abstract class SiLivePreviewThemeApi {
179
- abstract setThemeFromPreviewer(mode: ThemeType): void;
180
- abstract getApplicationThemeObservable(): Observable<ThemeType>;
181
- }
182
- declare abstract class SiLivePreviewLocaleApi {
183
- abstract setLocale(locale: string): void;
184
- abstract getLocale(): Observable<string>;
185
- abstract availableLocales(): string[];
186
- }
187
-
188
284
  /**
189
285
  * Copyright (c) Siemens 2016 - 2026
190
286
  * SPDX-License-Identifier: MIT
@@ -207,13 +303,13 @@ declare const provideExampleRoutes: (routes: Route[]) => Provider;
207
303
  declare abstract class SiLivePreviewWebComponentService {
208
304
  abstract injectComponent(element: ElementRef, inputs?: any, outputs?: any): any;
209
305
  abstract destroyComponent(): void;
210
- static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewWebComponentService, never>;
211
- static ɵprov: i0.ɵɵInjectableDeclaration<SiLivePreviewWebComponentService>;
306
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewWebComponentService, never>;
307
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<SiLivePreviewWebComponentService>;
212
308
  }
213
309
 
214
310
  declare class LandscapeSupportService {
215
- static ɵfac: i0.ɵɵFactoryDeclaration<LandscapeSupportService, never>;
216
- static ɵprov: i0.ɵɵInjectableDeclaration<LandscapeSupportService>;
311
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LandscapeSupportService, never>;
312
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<LandscapeSupportService>;
217
313
  }
218
314
 
219
315
  /**
@@ -223,10 +319,10 @@ declare class LandscapeSupportService {
223
319
 
224
320
  declare class SiLivePreviewModule {
225
321
  static forRoot(config: SiLivePreviewConfig, isMobile?: boolean): ModuleWithProviders<SiLivePreviewModule>;
226
- static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewModule, never>;
227
- static ɵmod: i0.ɵɵNgModuleDeclaration<SiLivePreviewModule, never, never, never>;
228
- static ɵinj: i0.ɵɵInjectorDeclaration<SiLivePreviewModule>;
322
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiLivePreviewModule, never>;
323
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiLivePreviewModule, never, never, never>;
324
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiLivePreviewModule>;
229
325
  }
230
326
 
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 };
327
+ export { LOG_EVENT, LandscapeSupportService, SI_LIVE_PREVIEW_CONFIG, SI_LIVE_PREVIEW_EXAMPLE_ROUTES, SI_LIVE_PREVIEW_INTERNALS, SI_STACKBLITZ_CONFIG, SiDocsComponentComponent, SiDummyComponent, SiLivePreviewApplicationRuntimeComponent, SiLivePreviewLocaleApi, SiLivePreviewModule, SiLivePreviewRoutingModule, SiLivePreviewRuntimeComponent, SiLivePreviewThemeApi, SiLivePreviewWebComponentService, SiLivePreviewModule as SimplLivePreviewModule, SiLivePreviewRoutingModule as SimplLivePreviewRoutingModule, angularTemplateProject, livePreviewRoutes, provideExampleRoutes, provideLivePreview, provideStackblitzConfig };
232
328
  export type { SiLivePreviewConfig, SiLivePreviewInternals, SiLivePreviewProviderConfig, ThemeType };