@siemens/live-preview 47.6.0 → 47.8.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.
Files changed (28) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +9 -0
  3. package/components/si-dummy.component.d.ts +3 -2
  4. package/components/si-example-overview/si-example-overview.component.d.ts +1 -5
  5. package/components/si-example-viewer/si-example-viewer.component.d.ts +1 -1
  6. package/components/si-live-preview/si-live-preview.component.d.ts +1 -1
  7. package/components/si-live-preview-iframe/devices.d.ts +1 -1
  8. package/components/si-live-preview-iframe/si-live-preview-iframe.component.d.ts +2 -2
  9. package/components/si-live-preview-qr/si-live-preview-qr.component.d.ts +2 -2
  10. package/components/si-live-preview-renderer/si-live-preview-renderer.component.d.ts +2 -2
  11. package/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.d.ts +1 -1
  12. package/components/si-live-preview-wrapper/si-live-preview-wrapper.component.d.ts +2 -2
  13. package/fesm2022/siemens-live-preview-webcomponents.mjs +5 -7
  14. package/fesm2022/siemens-live-preview-webcomponents.mjs.map +1 -1
  15. package/fesm2022/siemens-live-preview.mjs +93 -114
  16. package/fesm2022/siemens-live-preview.mjs.map +1 -1
  17. package/helpers/log-event.d.ts +1 -1
  18. package/helpers/utils.d.ts +1 -1
  19. package/interfaces/live-preview-config.d.ts +1 -1
  20. package/interfaces/si-live-preview.api.d.ts +1 -1
  21. package/package.json +2 -2
  22. package/public-api.d.ts +1 -1
  23. package/public-api.module.d.ts +7 -11
  24. package/webcomponents/components/si-live-preview-renderer/webcomponent/si-live-preview-web.component.d.ts +2 -2
  25. package/webcomponents/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.d.ts +1 -1
  26. package/webcomponents/components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service.d.ts +1 -1
  27. package/webcomponents/interfaces/live-preview-config.d.ts +1 -1
  28. package/webcomponents/public-api.webcomponents.d.ts +1 -1
package/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Siemens 2016 - 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the “Software”), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -11,3 +11,12 @@ components.
11
11
  ## Components overview
12
12
 
13
13
  ![Component structure](docs/live-preview-components-structure.drawio.png)
14
+
15
+ ## License
16
+
17
+ The following applies for code and documentation of the git repository,
18
+ unless explicitly mentioned.
19
+
20
+ Copyright (c) Siemens 2016 - 2025
21
+
22
+ MIT, see [LICENSE.md](LICENSE.md).
@@ -2,7 +2,8 @@ import { ActivatedRoute } from '@angular/router';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class SiDummyComponent {
4
4
  path: string;
5
- constructor(activeRoute: ActivatedRoute);
5
+ activeRoute: ActivatedRoute;
6
+ constructor();
6
7
  static ɵfac: i0.ɵɵFactoryDeclaration<SiDummyComponent, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, false, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiDummyComponent, "si-dummy", never, {}, {}, never, never, true, never>;
8
9
  }
@@ -1,7 +1,3 @@
1
- /**
2
- * Copyright Siemens 2016 - 2025.
3
- * SPDX-License-Identifier: MIT
4
- */
5
1
  import { OnDestroy, OnInit } from '@angular/core';
6
2
  import { UntypedFormControl } from '@angular/forms';
7
3
  import { Observable } from 'rxjs';
@@ -34,6 +30,6 @@ export declare class SiExampleOverviewComponent implements OnInit, OnDestroy {
34
30
  toggleCollapse(): void;
35
31
  resetSearchBar(): void;
36
32
  static ɵfac: i0.ɵɵFactoryDeclaration<SiExampleOverviewComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<SiExampleOverviewComponent, "si-example-overview", never, {}, {}, never, never, false, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiExampleOverviewComponent, "si-example-overview", never, {}, {}, never, never, true, never>;
38
34
  }
39
35
  export {};
@@ -36,5 +36,5 @@ export declare class SiExampleViewerComponent {
36
36
  private setLocale;
37
37
  activateTab(index: number): void;
38
38
  static ɵfac: i0.ɵɵFactoryDeclaration<SiExampleViewerComponent, never>;
39
- static ɵcmp: i0.ɵɵComponentDeclaration<SiExampleViewerComponent, "si-example-viewer", never, {}, {}, never, never, false, never>;
39
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiExampleViewerComponent, "si-example-viewer", never, {}, {}, never, never, true, never>;
40
40
  }
@@ -99,5 +99,5 @@ export declare class SiLivePreviewComponent implements OnInit, AfterViewInit, On
99
99
  private createTicketLinks;
100
100
  onFullscreenChange(): void;
101
101
  static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewComponent, never>;
102
- static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewComponent, "si-live-preview", never, { "baseUrl": { "alias": "baseUrl"; "required": false; }; "example": { "alias": "example"; "required": false; }; "template": { "alias": "template"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "isRTL": { "alias": "isRTL"; "required": false; }; "ticketBaseUrl": { "alias": "ticketBaseUrl"; "required": false; }; "templateReact": { "alias": "templateReact"; "required": false; }; "templateVue": { "alias": "templateVue"; "required": false; }; "templateJs": { "alias": "templateJs"; "required": false; }; }, {}, never, never, false, never>;
102
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewComponent, "si-live-preview", never, { "baseUrl": { "alias": "baseUrl"; "required": false; }; "example": { "alias": "example"; "required": false; }; "template": { "alias": "template"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "isRTL": { "alias": "isRTL"; "required": false; }; "ticketBaseUrl": { "alias": "ticketBaseUrl"; "required": false; }; "templateReact": { "alias": "templateReact"; "required": false; }; "templateVue": { "alias": "templateVue"; "required": false; }; "templateJs": { "alias": "templateJs"; "required": false; }; }, {}, never, never, true, never>;
103
103
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  export interface Device {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  import { ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
@@ -60,5 +60,5 @@ export declare class SiLivePreviewIframeComponent implements OnInit, OnChanges {
60
60
  private encode;
61
61
  private sendMessage;
62
62
  static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewIframeComponent, never>;
63
- static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewIframeComponent, "si-live-preview-iframe", never, { "baseUrl": { "alias": "baseUrl"; "required": false; }; "exampleUrl": { "alias": "exampleUrl"; "required": false; }; "template": { "alias": "template"; "required": false; }; "ticketLinkBug": { "alias": "ticketLinkBug"; "required": false; }; "ticketLinkFeature": { "alias": "ticketLinkFeature"; "required": false; }; "isFullscreen": { "alias": "isFullscreen"; "required": false; }; "iFrameHeight": { "alias": "iFrameHeight"; "required": false; }; "iFrameWidth": { "alias": "iFrameWidth"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "isRTL": { "alias": "isRTL"; "required": false; }; "loadReact": { "alias": "loadReact"; "required": false; }; "loadVue": { "alias": "loadVue"; "required": false; }; "loadJs": { "alias": "loadJs"; "required": false; }; "reactVueTemplate": { "alias": "reactVueTemplate"; "required": false; }; }, { "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; "themeChange": "themeChange"; "localeChange": "localeChange"; }, never, never, false, never>;
63
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewIframeComponent, "si-live-preview-iframe", never, { "baseUrl": { "alias": "baseUrl"; "required": false; }; "exampleUrl": { "alias": "exampleUrl"; "required": false; }; "template": { "alias": "template"; "required": false; }; "ticketLinkBug": { "alias": "ticketLinkBug"; "required": false; }; "ticketLinkFeature": { "alias": "ticketLinkFeature"; "required": false; }; "isFullscreen": { "alias": "isFullscreen"; "required": false; }; "iFrameHeight": { "alias": "iFrameHeight"; "required": false; }; "iFrameWidth": { "alias": "iFrameWidth"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "isRTL": { "alias": "isRTL"; "required": false; }; "loadReact": { "alias": "loadReact"; "required": false; }; "loadVue": { "alias": "loadVue"; "required": false; }; "loadJs": { "alias": "loadJs"; "required": false; }; "reactVueTemplate": { "alias": "reactVueTemplate"; "required": false; }; }, { "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; "themeChange": "themeChange"; "localeChange": "localeChange"; }, never, never, true, never>;
64
64
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
@@ -16,5 +16,5 @@ export declare class SiLivePreviewQrComponent implements AfterViewInit, OnDestro
16
16
  ngOnDestroy(): void;
17
17
  private generateQr;
18
18
  static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewQrComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewQrComponent, "si-live-preview-qr", never, { "url": { "alias": "url"; "required": false; }; "urlShort": { "alias": "urlShort"; "required": false; }; }, { "closed": "closed"; }, never, never, false, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewQrComponent, "si-live-preview-qr", never, { "url": { "alias": "url"; "required": false; }; "urlShort": { "alias": "urlShort"; "required": false; }; }, { "closed": "closed"; }, never, never, true, never>;
20
20
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  import { ElementRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef } from '@angular/core';
@@ -60,5 +60,5 @@ export declare class SiLivePreviewRendererComponent implements OnChanges, OnDest
60
60
  private createComponent;
61
61
  private createComponentInstance;
62
62
  static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewRendererComponent, never>;
63
- static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewRendererComponent, "si-live-preview-renderer", never, { "exampleUrl": { "alias": "exampleUrl"; "required": false; }; "dataId": { "alias": "dataId"; "required": false; }; "template": { "alias": "template"; "required": false; }; }, { "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; "supportsLandscapeMode": "supportsLandscapeMode"; }, never, never, false, never>;
63
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewRendererComponent, "si-live-preview-renderer", never, { "exampleUrl": { "alias": "exampleUrl"; "required": false; }; "dataId": { "alias": "dataId"; "required": false; }; "template": { "alias": "template"; "required": false; }; }, { "templateFromComponent": "templateFromComponent"; "logClear": "logClear"; "logMessage": "logMessage"; "logRenderingError": "logRenderingError"; "inProgress": "inProgress"; "supportsLandscapeMode": "supportsLandscapeMode"; }, never, never, true, never>;
64
64
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  import { ElementRef } from '@angular/core';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright Siemens 2016 - 2025.
2
+ * Copyright (c) Siemens 2016 - 2025
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
  import { ElementRef } from '@angular/core';
@@ -37,5 +37,5 @@ export declare class SiLivePreviewWrapperComponent {
37
37
  private setLocale;
38
38
  private setSafeArea;
39
39
  static ɵfac: i0.ɵɵFactoryDeclaration<SiLivePreviewWrapperComponent, never>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewWrapperComponent, "si-live-preview-wrapper", never, {}, {}, never, never, false, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<SiLivePreviewWrapperComponent, "si-live-preview-wrapper", never, {}, {}, never, never, true, never>;
41
41
  }
@@ -4,7 +4,7 @@ import { Subject } from 'rxjs';
4
4
  import { takeUntil } from 'rxjs/operators';
5
5
 
6
6
  /**
7
- * Copyright Siemens 2016 - 2025.
7
+ * Copyright (c) Siemens 2016 - 2025
8
8
  * SPDX-License-Identifier: MIT
9
9
  */
10
10
  class SiLivePreviewWebComponent {
@@ -110,14 +110,12 @@ class SiLivePreviewWebComponent {
110
110
  return module;
111
111
  }
112
112
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLivePreviewWebComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
113
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.6", type: SiLivePreviewWebComponent, isStandalone: false, selector: "si-live-preview-webcomponent", inputs: { loadReact: "loadReact", loadVue: "loadVue", loadJs: "loadJs", webcomponentTemplateCode: "webcomponentTemplateCode", exampleUrl: "exampleUrl", config: "config" }, outputs: { inProgress: "inProgress" }, host: { properties: { "class.live-preview-done": "this.renderingDone" } }, viewQueries: [{ propertyName: "root", first: true, predicate: ["root"], descendants: true, read: ElementRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: '<div #root id="app"></div>', isInline: true });
113
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.6", type: SiLivePreviewWebComponent, isStandalone: true, selector: "si-live-preview-webcomponent", inputs: { loadReact: "loadReact", loadVue: "loadVue", loadJs: "loadJs", webcomponentTemplateCode: "webcomponentTemplateCode", exampleUrl: "exampleUrl", config: "config" }, outputs: { inProgress: "inProgress" }, host: { properties: { "class.live-preview-done": "this.renderingDone" } }, viewQueries: [{ propertyName: "root", first: true, predicate: ["root"], descendants: true, read: ElementRef, isSignal: true }], usesOnChanges: true, ngImport: i0, template: '<div #root id="app"></div>', isInline: true });
114
114
  }
115
115
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiLivePreviewWebComponent, decorators: [{
116
116
  type: Component,
117
117
  args: [{
118
118
  selector: 'si-live-preview-webcomponent',
119
- // eslint-disable-next-line @angular-eslint/prefer-standalone
120
- standalone: false,
121
119
  template: '<div #root id="app"></div>'
122
120
  }]
123
121
  }], propDecorators: { loadReact: [{
@@ -140,7 +138,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
140
138
  }] } });
141
139
 
142
140
  /**
143
- * Copyright Siemens 2016 - 2025.
141
+ * Copyright (c) Siemens 2016 - 2025
144
142
  * SPDX-License-Identifier: MIT
145
143
  */
146
144
  class SiLivePreviewWebComponentService {
@@ -152,7 +150,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
152
150
  }] });
153
151
 
154
152
  /**
155
- * Copyright Siemens 2016 - 2025.
153
+ * Copyright (c) Siemens 2016 - 2025
156
154
  * SPDX-License-Identifier: MIT
157
155
  */
158
156
  class SiWebComponentRenderService extends SiLivePreviewWebComponentService {
@@ -193,7 +191,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
193
191
  }] });
194
192
 
195
193
  /**
196
- * Copyright Siemens 2016 - 2025.
194
+ * Copyright (c) Siemens 2016 - 2025
197
195
  * SPDX-License-Identifier: MIT
198
196
  */
199
197
 
@@ -1 +1 @@
1
- {"version":3,"file":"siemens-live-preview-webcomponents.mjs","sources":["../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-live-preview-web.component.ts","../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.ts","../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service.ts","../../../../projects/live-preview/public-api.webcomponents.ts","../../../../projects/live-preview/siemens-live-preview-webcomponents.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n viewChild\n} from '@angular/core';\n\nimport { SiLivePreviewConfig } from '../../../interfaces/live-preview-config';\n\n@Component({\n selector: 'si-live-preview-webcomponent',\n // eslint-disable-next-line @angular-eslint/prefer-standalone\n standalone: false,\n template: '<div #root id=\"app\"></div>'\n})\nexport class SiLivePreviewWebComponent implements OnChanges {\n readonly root = viewChild.required('root', { read: ElementRef });\n @Input() loadReact = false;\n @Input() loadVue = false;\n @Input() loadJs = false;\n @Input() webcomponentTemplateCode = '';\n @Input() exampleUrl!: string;\n @Input() config!: SiLivePreviewConfig;\n @Output() readonly inProgress = new EventEmitter<boolean>();\n\n @HostBinding('class.live-preview-done') renderingDone = false;\n\n private reactRoot: any;\n private vueRoot: any;\n\n ngOnChanges(changes: SimpleChanges): void {\n this.reactRoot?.unmount();\n this.vueRoot?.unmount();\n if (\n changes.loadReact?.currentValue &&\n changes.loadReact?.currentValue !== changes.loadReact?.previousValue\n ) {\n this.loadReactFromCodeTemplate(this.webcomponentTemplateCode);\n }\n if (\n changes.loadVue?.currentValue &&\n changes.loadVue?.currentValue !== changes.loadVue?.previousValue\n ) {\n this.loadVueFromCodeTemplate(this.webcomponentTemplateCode);\n }\n if (\n changes.loadJs?.currentValue &&\n changes.loadJs?.currentValue !== changes.loadJs?.previousValue\n ) {\n this.loadHTMLFromCodeTemplate(this.webcomponentTemplateCode);\n }\n }\n\n loadReactFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n import('react-dom/client').then(reactDom => {\n this.reactRoot = this.getDefault(reactDom).createRoot(this.root().nativeElement);\n const moduleInput = code;\n import('@babel/standalone').then(babel => {\n const output: any = this.getDefault(babel).transform(moduleInput, {\n presets: [\n // `modules: false` creates a module that can be imported\n ['env', { modules: false }],\n 'react',\n ['typescript', { isTSX: true, allExtensions: true }]\n ],\n filename: 'example.ts'\n }).code;\n\n import('react').then(react => {\n window.React = this.getDefault(react);\n const dataUrl = 'data:text/javascript;base64,' + btoa(output);\n\n import(/* webpackIgnore: true */ /* @vite-ignore */ dataUrl).then(module => {\n this.reactRoot.render(this.getDefault(react).createElement(module.default));\n setTimeout(() => this.setInProgress(false));\n });\n });\n });\n });\n }\n\n loadVueFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n\n import('vue/dist/vue.esm-bundler.js' as any).then(vue => {\n (globalThis as any).__VUE_OPTIONS_API__ = true;\n (globalThis as any).__VUE_PROD_DEVTOOLS__ = false;\n (globalThis as any).Vue = vue;\n\n import('vue3-sfc-loader' as any).then(sfcLoader => {\n const options = {\n moduleCache: {\n vue\n },\n getFile: (url: any) => {\n return url === '/example.vue' ? Promise.resolve(code) : undefined;\n },\n addStyle: () => {\n /* unused here */\n }\n };\n const { loadModule } = this.getDefault(sfcLoader);\n this.vueRoot?.unmount();\n this.vueRoot = vue.createApp(\n vue.defineAsyncComponent(() => loadModule('/example.vue', options))\n );\n\n const root = this.root();\n if (document.body.contains(root.nativeElement)) {\n const div = document.createElement('div');\n div.id = 'vue_app';\n root.nativeElement.replaceChildren(div);\n this.vueRoot.mount('#vue_app');\n }\n\n setTimeout(() => this.setInProgress(false));\n });\n });\n }\n\n loadHTMLFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n const scriptEl = document.createRange().createContextualFragment(code);\n this.root().nativeElement.append(scriptEl);\n this.setInProgress(false);\n }\n\n private setInProgress(inProgress: boolean): void {\n this.renderingDone = !inProgress;\n this.inProgress.emit(inProgress);\n }\n\n private getDefault<T extends Record<string, any>>(module: T): T {\n if ('default' in module) {\n return module.default as T;\n }\n return module;\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { ElementRef, Injectable } from '@angular/core';\n\n@Injectable()\nexport abstract class SiLivePreviewWebComponentService {\n abstract injectComponent(element: ElementRef, inputs?: any, outputs?: any): any;\n abstract destroyComponent(): void;\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport {\n ApplicationRef,\n ComponentRef,\n createComponent,\n ElementRef,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n OnDestroy,\n reflectComponentType\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SiLivePreviewWebComponent } from './si-live-preview-web.component';\nimport { SiLivePreviewWebComponentService } from './si-live-webcomponent.service';\n\n@Injectable({ providedIn: 'root' })\nexport class SiWebComponentRenderService\n extends SiLivePreviewWebComponentService\n implements OnDestroy\n{\n private componentRef!: ComponentRef<SiLivePreviewWebComponent>;\n private componentMirror = reflectComponentType(SiLivePreviewWebComponent);\n private appRef = inject(ApplicationRef);\n private injector = inject(Injector);\n private environmentInjector = inject(EnvironmentInjector);\n private destroyer = new Subject<void>();\n\n injectComponent(element: ElementRef, inputs: any, outputs: any): void {\n this.destroyComponent();\n this.componentRef = createComponent(SiLivePreviewWebComponent, {\n environmentInjector: this.environmentInjector,\n elementInjector: this.injector\n });\n\n this.componentMirror?.inputs.forEach(value => {\n this.componentRef.setInput(value.propName, inputs[value.propName]);\n });\n this.componentRef.instance.inProgress.pipe(takeUntil(this.destroyer)).subscribe(event => {\n outputs.inProgress('progress', event);\n });\n\n this.appRef.attachView(this.componentRef.hostView);\n element.nativeElement.appendChild(this.componentRef.location.nativeElement);\n }\n\n destroyComponent(): void {\n this.componentRef?.destroy();\n }\n\n ngOnDestroy(): void {\n this.destroyer.next();\n this.destroyer.complete();\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './components/si-live-preview-renderer/webcomponent/si-live-preview-web.component';\nexport * from './components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api.webcomponents';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;MAqBU,yBAAyB,CAAA;AAC3B,IAAA,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACvD,SAAS,GAAG,KAAK;IACjB,OAAO,GAAG,KAAK;IACf,MAAM,GAAG,KAAK;IACd,wBAAwB,GAAG,EAAE;AAC7B,IAAA,UAAU;AACV,IAAA,MAAM;AACI,IAAA,UAAU,GAAG,IAAI,YAAY,EAAW;IAEnB,aAAa,GAAG,KAAK;AAErD,IAAA,SAAS;AACT,IAAA,OAAO;AAEf,IAAA,WAAW,CAAC,OAA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,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,IAAG;AACtF,YAAA,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC;AACvC,SAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;AAClD,QAAA,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC;;IAG7E,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE;;IAG9B,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;AACrB,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;;uGAnChB,2BAA2B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACtBlC;;;AAGG;;ACHH;;AAEG;;;;"}
1
+ {"version":3,"file":"siemens-live-preview-webcomponents.mjs","sources":["../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-live-preview-web.component.ts","../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-live-webcomponent.service.ts","../../../../projects/live-preview/components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service.ts","../../../../projects/live-preview/public-api.webcomponents.ts","../../../../projects/live-preview/siemens-live-preview-webcomponents.ts"],"sourcesContent":["/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n viewChild\n} from '@angular/core';\n\nimport { SiLivePreviewConfig } from '../../../interfaces/live-preview-config';\n\n@Component({\n selector: 'si-live-preview-webcomponent',\n template: '<div #root id=\"app\"></div>'\n})\nexport class SiLivePreviewWebComponent implements OnChanges {\n readonly root = viewChild.required('root', { read: ElementRef });\n @Input() loadReact = false;\n @Input() loadVue = false;\n @Input() loadJs = false;\n @Input() webcomponentTemplateCode = '';\n @Input() exampleUrl!: string;\n @Input() config!: SiLivePreviewConfig;\n @Output() readonly inProgress = new EventEmitter<boolean>();\n\n @HostBinding('class.live-preview-done') renderingDone = false;\n\n private reactRoot: any;\n private vueRoot: any;\n\n ngOnChanges(changes: SimpleChanges): void {\n this.reactRoot?.unmount();\n this.vueRoot?.unmount();\n if (\n changes.loadReact?.currentValue &&\n changes.loadReact?.currentValue !== changes.loadReact?.previousValue\n ) {\n this.loadReactFromCodeTemplate(this.webcomponentTemplateCode);\n }\n if (\n changes.loadVue?.currentValue &&\n changes.loadVue?.currentValue !== changes.loadVue?.previousValue\n ) {\n this.loadVueFromCodeTemplate(this.webcomponentTemplateCode);\n }\n if (\n changes.loadJs?.currentValue &&\n changes.loadJs?.currentValue !== changes.loadJs?.previousValue\n ) {\n this.loadHTMLFromCodeTemplate(this.webcomponentTemplateCode);\n }\n }\n\n loadReactFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n import('react-dom/client').then(reactDom => {\n this.reactRoot = this.getDefault(reactDom).createRoot(this.root().nativeElement);\n const moduleInput = code;\n import('@babel/standalone').then(babel => {\n const output: any = this.getDefault(babel).transform(moduleInput, {\n presets: [\n // `modules: false` creates a module that can be imported\n ['env', { modules: false }],\n 'react',\n ['typescript', { isTSX: true, allExtensions: true }]\n ],\n filename: 'example.ts'\n }).code;\n\n import('react').then(react => {\n window.React = this.getDefault(react);\n const dataUrl = 'data:text/javascript;base64,' + btoa(output);\n\n import(/* webpackIgnore: true */ /* @vite-ignore */ dataUrl).then(module => {\n this.reactRoot.render(this.getDefault(react).createElement(module.default));\n setTimeout(() => this.setInProgress(false));\n });\n });\n });\n });\n }\n\n loadVueFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n\n import('vue/dist/vue.esm-bundler.js' as any).then(vue => {\n (globalThis as any).__VUE_OPTIONS_API__ = true;\n (globalThis as any).__VUE_PROD_DEVTOOLS__ = false;\n (globalThis as any).Vue = vue;\n\n import('vue3-sfc-loader' as any).then(sfcLoader => {\n const options = {\n moduleCache: {\n vue\n },\n getFile: (url: any) => {\n return url === '/example.vue' ? Promise.resolve(code) : undefined;\n },\n addStyle: () => {\n /* unused here */\n }\n };\n const { loadModule } = this.getDefault(sfcLoader);\n this.vueRoot?.unmount();\n this.vueRoot = vue.createApp(\n vue.defineAsyncComponent(() => loadModule('/example.vue', options))\n );\n\n const root = this.root();\n if (document.body.contains(root.nativeElement)) {\n const div = document.createElement('div');\n div.id = 'vue_app';\n root.nativeElement.replaceChildren(div);\n this.vueRoot.mount('#vue_app');\n }\n\n setTimeout(() => this.setInProgress(false));\n });\n });\n }\n\n loadHTMLFromCodeTemplate(code: string): void {\n this.setInProgress(true);\n const scriptEl = document.createRange().createContextualFragment(code);\n this.root().nativeElement.append(scriptEl);\n this.setInProgress(false);\n }\n\n private setInProgress(inProgress: boolean): void {\n this.renderingDone = !inProgress;\n this.inProgress.emit(inProgress);\n }\n\n private getDefault<T extends Record<string, any>>(module: T): T {\n if ('default' in module) {\n return module.default as T;\n }\n return module;\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport { ElementRef, Injectable } from '@angular/core';\n\n@Injectable()\nexport abstract class SiLivePreviewWebComponentService {\n abstract injectComponent(element: ElementRef, inputs?: any, outputs?: any): any;\n abstract destroyComponent(): void;\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nimport {\n ApplicationRef,\n ComponentRef,\n createComponent,\n ElementRef,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n OnDestroy,\n reflectComponentType\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SiLivePreviewWebComponent } from './si-live-preview-web.component';\nimport { SiLivePreviewWebComponentService } from './si-live-webcomponent.service';\n\n@Injectable({ providedIn: 'root' })\nexport class SiWebComponentRenderService\n extends SiLivePreviewWebComponentService\n implements OnDestroy\n{\n private componentRef!: ComponentRef<SiLivePreviewWebComponent>;\n private componentMirror = reflectComponentType(SiLivePreviewWebComponent);\n private appRef = inject(ApplicationRef);\n private injector = inject(Injector);\n private environmentInjector = inject(EnvironmentInjector);\n private destroyer = new Subject<void>();\n\n injectComponent(element: ElementRef, inputs: any, outputs: any): void {\n this.destroyComponent();\n this.componentRef = createComponent(SiLivePreviewWebComponent, {\n environmentInjector: this.environmentInjector,\n elementInjector: this.injector\n });\n\n this.componentMirror?.inputs.forEach(value => {\n this.componentRef.setInput(value.propName, inputs[value.propName]);\n });\n this.componentRef.instance.inProgress.pipe(takeUntil(this.destroyer)).subscribe(event => {\n outputs.inProgress('progress', event);\n });\n\n this.appRef.attachView(this.componentRef.hostView);\n element.nativeElement.appendChild(this.componentRef.location.nativeElement);\n }\n\n destroyComponent(): void {\n this.componentRef?.destroy();\n }\n\n ngOnDestroy(): void {\n this.destroyer.next();\n this.destroyer.complete();\n }\n}\n","/**\n * Copyright (c) Siemens 2016 - 2025\n * SPDX-License-Identifier: MIT\n */\nexport * from './components/si-live-preview-renderer/webcomponent/si-live-preview-web.component';\nexport * from './components/si-live-preview-renderer/webcomponent/si-webcomponent-render.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api.webcomponents';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;MAmBU,yBAAyB,CAAA;AAC3B,IAAA,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,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