@siemens/live-preview 47.0.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/README.md +13 -0
- package/component-loader.cjs +54 -0
- package/components/si-dummy.component.d.ts +8 -0
- package/components/si-example-overview/si-example-overview.component.d.ts +35 -0
- package/components/si-example-viewer/si-example-viewer.component.d.ts +40 -0
- package/components/si-live-preview/si-live-preview.component.d.ts +103 -0
- package/components/si-live-preview-iframe/devices.d.ts +25 -0
- package/components/si-live-preview-iframe/si-live-preview-iframe.component.d.ts +65 -0
- package/components/si-live-preview-qr/si-live-preview-qr.component.d.ts +20 -0
- package/components/si-live-preview-renderer/si-live-preview-renderer.component.d.ts +64 -0
- package/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.d.ts +12 -0
- package/components/si-live-preview-wrapper/si-live-preview-wrapper.component.d.ts +41 -0
- package/esbuild-component-loader.mjs +64 -0
- package/fesm2022/siemens-live-preview-webcomponents.mjs +205 -0
- package/fesm2022/siemens-live-preview-webcomponents.mjs.map +1 -0
- package/fesm2022/siemens-live-preview.mjs +2027 -0
- package/fesm2022/siemens-live-preview.mjs.map +1 -0
- package/helpers/log-event.d.ts +6 -0
- package/helpers/utils.d.ts +9 -0
- package/index.d.ts +5 -0
- package/interfaces/live-preview-config.d.ts +28 -0
- package/interfaces/si-live-preview.api.d.ts +15 -0
- package/live-preview-routes.d.ts +9 -0
- package/package.json +74 -0
- package/public-api.d.ts +20 -0
- package/public-api.module.d.ts +19 -0
- package/services/landscape-support.service.d.ts +5 -0
- package/styles/_variables.scss +23 -0
- package/styles/components/_links.scss +14 -0
- package/styles/components/_tabs.scss +46 -0
- package/styles/live-preview.scss +16 -0
- package/webcomponents/components/si-live-preview-renderer/webcomponent/si-live-preview-web.component.d.ts +28 -0
- package/webcomponents/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.d.ts +12 -0
- package/webcomponents/components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service.d.ts +20 -0
- package/webcomponents/index.d.ts +5 -0
- package/webcomponents/interfaces/live-preview-config.d.ts +28 -0
- package/webcomponents/package.json +3 -0
- package/webcomponents/public-api.webcomponents.d.ts +6 -0
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export * from './live-preview-routes';
|
|
6
|
+
export * from './components/si-dummy.component';
|
|
7
|
+
export * from './components/si-example-overview/si-example-overview.component';
|
|
8
|
+
export * from './components/si-example-viewer/si-example-viewer.component';
|
|
9
|
+
export * from './components/si-live-preview/si-live-preview.component';
|
|
10
|
+
export * from './components/si-live-preview-iframe/si-live-preview-iframe.component';
|
|
11
|
+
export * from './components/si-live-preview-renderer/si-live-preview-renderer.component';
|
|
12
|
+
export * from './components/si-live-preview-wrapper/si-live-preview-wrapper.component';
|
|
13
|
+
export * from './components/si-live-preview-qr/si-live-preview-qr.component';
|
|
14
|
+
export * from './interfaces/live-preview-config';
|
|
15
|
+
export * from './interfaces/si-live-preview.api';
|
|
16
|
+
export * from './helpers/log-event';
|
|
17
|
+
export { provideExampleRoutes } from './helpers/utils';
|
|
18
|
+
export * from './components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service';
|
|
19
|
+
export * from './services/landscape-support.service';
|
|
20
|
+
export * from './public-api.module';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { SiLivePreviewConfig } from './interfaces/live-preview-config';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./components/si-example-overview/si-example-overview.component";
|
|
5
|
+
import * as i2 from "./components/si-example-viewer/si-example-viewer.component";
|
|
6
|
+
import * as i3 from "./components/si-live-preview/si-live-preview.component";
|
|
7
|
+
import * as i4 from "./components/si-live-preview-iframe/si-live-preview-iframe.component";
|
|
8
|
+
import * as i5 from "./components/si-live-preview-qr/si-live-preview-qr.component";
|
|
9
|
+
import * as i6 from "./components/si-live-preview-renderer/si-live-preview-renderer.component";
|
|
10
|
+
import * as i7 from "./components/si-live-preview-wrapper/si-live-preview-wrapper.component";
|
|
11
|
+
import * as i8 from "@angular/common";
|
|
12
|
+
import * as i9 from "@angular/forms";
|
|
13
|
+
import * as i10 from "@angular/router";
|
|
14
|
+
export declare class SimplLivePreviewModule {
|
|
15
|
+
static forRoot(config: SiLivePreviewConfig, isMobile?: boolean): ModuleWithProviders<SimplLivePreviewModule>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SimplLivePreviewModule, never>;
|
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SimplLivePreviewModule, [typeof i1.SiExampleOverviewComponent, typeof i2.SiExampleViewerComponent, typeof i3.SiLivePreviewComponent, typeof i4.SiLivePreviewIframeComponent, typeof i5.SiLivePreviewQrComponent, typeof i6.SiLivePreviewRendererComponent, typeof i7.SiLivePreviewWrapperComponent], [typeof i8.CommonModule, typeof i9.FormsModule, typeof i9.ReactiveFormsModule, typeof i10.RouterModule], [typeof i1.SiExampleOverviewComponent, typeof i2.SiExampleViewerComponent]>;
|
|
18
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<SimplLivePreviewModule>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@use '@siemens/element-theme/src/styles/variables';
|
|
2
|
+
|
|
3
|
+
$font-family-monospace: Menlo, 'Ubuntu Mono', 'Liberation Mono', Consolas, Courier, monospace;
|
|
4
|
+
|
|
5
|
+
$live-preview-alert-color: variables.$element-action-danger-text;
|
|
6
|
+
$live-preview-alert-background-color: variables.$element-action-danger;
|
|
7
|
+
|
|
8
|
+
$live-preview-info-color: variables.$element-action-secondary-text;
|
|
9
|
+
$live-preview-info-background-color: variables.$element-action-secondary;
|
|
10
|
+
|
|
11
|
+
$live-preview-background-color: variables.$element-base-0;
|
|
12
|
+
$live-preview-bar-background-color: variables.$element-base-0;
|
|
13
|
+
$live-preview-border-color: variables.$element-ui-4;
|
|
14
|
+
$live-preview-button-background-color: variables.$element-action-secondary;
|
|
15
|
+
|
|
16
|
+
$live-preview-control-fill-color: variables.$element-text-primary;
|
|
17
|
+
|
|
18
|
+
$live-preview-focus-shadow-color: variables.$focus-style-outline;
|
|
19
|
+
$live-preview-font-color: variables.$element-text-primary;
|
|
20
|
+
|
|
21
|
+
$live-preview-link-color: variables.$element-action-secondary-text;
|
|
22
|
+
$live-preview-link-hover-color: variables.$element-action-secondary-text-hover;
|
|
23
|
+
$live-preview-link-inactive-color: variables.$element-text-primary;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../variables';
|
|
2
|
+
|
|
3
|
+
.lp-tabs {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
padding-inline-start: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
list-style: none;
|
|
9
|
+
background: none;
|
|
10
|
+
inline-size: inherit;
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
|
|
13
|
+
.tab-item {
|
|
14
|
+
&.tab-active {
|
|
15
|
+
&.tab-link {
|
|
16
|
+
color: variables.$live-preview-link-color;
|
|
17
|
+
border-block-end-color: variables.$live-preview-link-color !important; // stylelint-disable-line declaration-no-important
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
color: variables.$live-preview-link-hover-color;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.tab-link {
|
|
26
|
+
font: inherit;
|
|
27
|
+
background: none;
|
|
28
|
+
min-inline-size: 150px;
|
|
29
|
+
display: block;
|
|
30
|
+
padding-block: 8px;
|
|
31
|
+
padding-inline: 15px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
text-align: start;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
color: variables.$live-preview-link-inactive-color;
|
|
36
|
+
border: 0;
|
|
37
|
+
border-block-end: 4px solid transparent;
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
color: variables.$live-preview-link-hover-color;
|
|
42
|
+
border-block-end-color: variables.$live-preview-border-color;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
body {
|
|
2
|
+
font-size: 14px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body,
|
|
6
|
+
app-root,
|
|
7
|
+
app-root > * {
|
|
8
|
+
display: flex !important; // stylelint-disable-line declaration-no-important
|
|
9
|
+
|
|
10
|
+
flex: auto;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
router-outlet {
|
|
15
|
+
display: none !important; // stylelint-disable-line declaration-no-important
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
6
|
+
import { SiLivePreviewConfig } from '../../../interfaces/live-preview-config';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SiLivePreviewWebComponent implements OnChanges {
|
|
9
|
+
readonly root: import("@angular/core").Signal<ElementRef<any>>;
|
|
10
|
+
loadReact: boolean;
|
|
11
|
+
loadVue: boolean;
|
|
12
|
+
loadJs: boolean;
|
|
13
|
+
webcomponentTemplateCode: string;
|
|
14
|
+
exampleUrl: string;
|
|
15
|
+
config: SiLivePreviewConfig;
|
|
16
|
+
readonly inProgress: EventEmitter<boolean>;
|
|
17
|
+
renderingDone: boolean;
|
|
18
|
+
private reactRoot;
|
|
19
|
+
private vueRoot;
|
|
20
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
21
|
+
loadReactFromCodeTemplate(code: string): void;
|
|
22
|
+
loadVueFromCodeTemplate(code: string): void;
|
|
23
|
+
loadHTMLFromCodeTemplate(code: string): void;
|
|
24
|
+
private setInProgress;
|
|
25
|
+
private getDefault;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewWebComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewWebComponent, "si-live-preview-webcomponent", never, { "loadReact": { "alias": "loadReact"; "required": false; }; "loadVue": { "alias": "loadVue"; "required": false; }; "loadJs": { "alias": "loadJs"; "required": false; }; "webcomponentTemplateCode": { "alias": "webcomponentTemplateCode"; "required": false; }; "exampleUrl": { "alias": "exampleUrl"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "inProgress": "inProgress"; }, never, never, false, never>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ElementRef } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare abstract class SiLivePreviewWebComponentService {
|
|
8
|
+
abstract injectComponent(element: ElementRef, inputs?: any, outputs?: any): any;
|
|
9
|
+
abstract destroyComponent(): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewWebComponentService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SiLivePreviewWebComponentService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ElementRef, OnDestroy } from '@angular/core';
|
|
6
|
+
import { SiLivePreviewWebComponentService } from './si-live-webcomponent.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SiWebComponentRenderService extends SiLivePreviewWebComponentService implements OnDestroy {
|
|
9
|
+
private componentRef;
|
|
10
|
+
private componentMirror;
|
|
11
|
+
private appRef;
|
|
12
|
+
private injector;
|
|
13
|
+
private environmentInjector;
|
|
14
|
+
private destroyer;
|
|
15
|
+
injectComponent(element: ElementRef, inputs: any, outputs: any): void;
|
|
16
|
+
destroyComponent(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiWebComponentRenderService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SiWebComponentRenderService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { InjectionToken } from '@angular/core';
|
|
6
|
+
import { Route } from '@angular/router';
|
|
7
|
+
export interface SiLivePreviewConfig {
|
|
8
|
+
modules: any[];
|
|
9
|
+
errorHandler?: (err: any) => void;
|
|
10
|
+
componentLoader: {
|
|
11
|
+
load: (name: string) => Promise<any>;
|
|
12
|
+
list: string[];
|
|
13
|
+
webcomponentsList: string[];
|
|
14
|
+
};
|
|
15
|
+
examplesBaseUrl: string;
|
|
16
|
+
ticketBaseUrl: string;
|
|
17
|
+
themeSwitcher?: boolean;
|
|
18
|
+
rtlSwitcher?: boolean;
|
|
19
|
+
landscapeToggle?: boolean;
|
|
20
|
+
webcomponents?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SiLivePreviewInternals {
|
|
23
|
+
isMobile: boolean;
|
|
24
|
+
titleBase: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const SI_LIVE_PREVIEW_CONFIG: InjectionToken<SiLivePreviewConfig>;
|
|
27
|
+
export declare const SI_LIVE_PREVIEW_INTERNALS: InjectionToken<SiLivePreviewInternals>;
|
|
28
|
+
export declare const SI_LIVE_PREVIEW_EXAMPLE_ROUTES: InjectionToken<Route[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Siemens 2016 - 2025.
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export * from './components/si-live-preview-renderer/webcomponent/si-live-preview-web.component';
|
|
6
|
+
export * from './components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service';
|