@veloceapps/sdk 7.0.2-72 → 7.0.2-74
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/cms/components/preview/preview.component.d.ts +6 -9
- package/cms/components/preview/preview.types.d.ts +5 -0
- package/cms/services/resources.service.d.ts +9 -0
- package/cms/utils/encoding.utils.d.ts +2 -0
- package/cms/vendor-map.d.ts +2 -1
- package/core/modules/configuration/index.d.ts +1 -0
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +4 -3
- package/core/modules/configuration/services/configuration.service.d.ts +6 -4
- package/core/modules/configuration/services/configuration.state.d.ts +30 -0
- package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
- package/core/types/runtime.types.d.ts +2 -2
- package/esm2020/cms/components/preview/preview.component.mjs +17 -37
- package/esm2020/cms/components/preview/preview.types.mjs +1 -1
- package/esm2020/cms/services/resources.service.mjs +19 -1
- package/esm2020/cms/utils/element.utils.mjs +8 -8
- package/esm2020/cms/utils/encoding.utils.mjs +28 -0
- package/esm2020/cms/vendor-map.mjs +3 -2
- package/esm2020/core/modules/configuration/configuration.module.mjs +4 -1
- package/esm2020/core/modules/configuration/index.mjs +2 -1
- package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +27 -19
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +41 -29
- package/esm2020/core/modules/configuration/services/configuration.state.mjs +142 -0
- package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +10 -11
- package/esm2020/core/services/quote-draft.service.mjs +1 -1
- package/esm2020/core/types/runtime.types.mjs +1 -1
- package/esm2020/src/components/doc-gen/doc-gen.component.mjs +1 -1
- package/esm2020/src/components/guided-selling/guided-selling.component.mjs +1 -1
- package/esm2020/src/pages/assets/assets.component.mjs +1 -1
- package/esm2020/src/pages/catalog/catalog.component.mjs +1 -1
- package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +4 -4
- package/esm2020/src/pages/product/product.component.mjs +50 -66
- package/esm2020/src/pages/remote/remote.component.mjs +19 -19
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +1 -1
- package/esm2020/src/types/flow-customization.types.mjs +1 -1
- package/fesm2015/veloceapps-sdk-cms.mjs +79 -50
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +214 -59
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +67 -80
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +76 -50
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +206 -55
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +64 -76
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/pages/product/product.component.d.ts +10 -21
- package/src/pages/remote/remote.component.d.ts +3 -4
- package/src/types/flow-customization.types.d.ts +3 -3
|
@@ -2,18 +2,17 @@ import { __decorate, __param, __metadata } from 'tslib';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef, SkipSelf, ViewChild, Input, ViewEncapsulation, NgModule, inject, ElementRef, Directive, ApplicationRef, createComponent, createNgModule } from '@angular/core';
|
|
4
4
|
import * as rxjs from 'rxjs';
|
|
5
|
-
import { BehaviorSubject, Subject, filter, map, distinctUntilChanged, of, tap, switchMap, startWith, ReplaySubject, noop, take, Observable, takeUntil, combineLatest,
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import * as
|
|
5
|
+
import { BehaviorSubject, Subject, filter, map, distinctUntilChanged, of, tap, switchMap, startWith, ReplaySubject, noop, take, Observable, takeUntil, combineLatest, catchError } from 'rxjs';
|
|
6
|
+
import * as i3 from '@veloceapps/components';
|
|
7
|
+
import { ToastType, LetDirectiveModule, LoaderModule, ToastService } from '@veloceapps/components';
|
|
8
|
+
import * as i4 from '@veloceapps/sdk/core';
|
|
9
|
+
import { ConfigurationService, ConfigurationState, QuoteDraftService, FlowConfigurationService, LineItemWorker, ProductImagesService, ContextService, RuntimeSettingsService, lineItemUtils, generateLineItem, getAttributeValue, SdkPipesModule, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
|
|
9
10
|
import lodash, { cloneDeep, compact, isArray, pull, merge, omit, flatten, set, kebabCase } from 'lodash';
|
|
10
11
|
import { applyPatch } from 'rfc6902';
|
|
11
12
|
import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, CoreModule } from '@veloceapps/core';
|
|
12
13
|
import * as i5 from '@angular/common';
|
|
13
14
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
14
|
-
import * as
|
|
15
|
-
import { LetDirectiveModule, LoaderModule, ToastService, ToastType } from '@veloceapps/components';
|
|
16
|
-
import * as i2$1 from 'ngx-drag-drop';
|
|
15
|
+
import * as i2 from 'ngx-drag-drop';
|
|
17
16
|
import { DndModule } from 'ngx-drag-drop';
|
|
18
17
|
import { SalesforceApiService, QuoteApiService, DocumentTemplatesApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ShoppingCartSettingsApiService, ConfigurationSettingsApiService, GuidedSellingApiService, ApiModule } from '@veloceapps/api';
|
|
19
18
|
import { DialogService } from 'primeng/dynamicdialog';
|
|
@@ -732,7 +731,11 @@ class ResourcesService {
|
|
|
732
731
|
this.scripts.set(url, false);
|
|
733
732
|
const script = document.createElement('script');
|
|
734
733
|
script.src = url;
|
|
734
|
+
// Hacky fix
|
|
735
|
+
this.persistAMDLoader();
|
|
735
736
|
script.onload = () => {
|
|
737
|
+
// Hacky fix
|
|
738
|
+
this.restoreAMDLoader();
|
|
736
739
|
this.scripts.set(url, true);
|
|
737
740
|
this.loaded$.next();
|
|
738
741
|
};
|
|
@@ -756,6 +759,20 @@ class ResourcesService {
|
|
|
756
759
|
rootEl.appendChild(link);
|
|
757
760
|
});
|
|
758
761
|
}
|
|
762
|
+
persistAMDLoader() {
|
|
763
|
+
// Do nothing if AMD loader is not defined
|
|
764
|
+
if (!window.define?.amd) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
this.amd = window.define.amd;
|
|
768
|
+
window.define.amd = undefined;
|
|
769
|
+
}
|
|
770
|
+
restoreAMDLoader() {
|
|
771
|
+
if (window.define && this.amd) {
|
|
772
|
+
window.define.amd = this.amd;
|
|
773
|
+
this.amd = undefined;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
759
776
|
}
|
|
760
777
|
ResourcesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ResourcesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
761
778
|
ResourcesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ResourcesService, providedIn: 'root' });
|
|
@@ -1038,14 +1055,14 @@ class ElementRendererComponent {
|
|
|
1038
1055
|
this.refs = {};
|
|
1039
1056
|
}
|
|
1040
1057
|
}
|
|
1041
|
-
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token:
|
|
1058
|
+
ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i4.ConfigurationService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1042
1059
|
ElementRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1043
1060
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ElementRendererComponent, decorators: [{
|
|
1044
1061
|
type: Component,
|
|
1045
1062
|
args: [{ selector: 'vl-cms-element-renderer', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ElementContextService], template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"] }]
|
|
1046
1063
|
}], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
|
|
1047
1064
|
type: SkipSelf
|
|
1048
|
-
}] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type:
|
|
1065
|
+
}] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i4.ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
|
|
1049
1066
|
type: ViewChild,
|
|
1050
1067
|
args: ['el', { read: ViewContainerRef, static: true }]
|
|
1051
1068
|
}], meta: [{
|
|
@@ -1053,11 +1070,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
1053
1070
|
}] } });
|
|
1054
1071
|
|
|
1055
1072
|
class PreviewComponent {
|
|
1056
|
-
constructor(runtimeService,
|
|
1073
|
+
constructor(runtimeService, configurationState, toastService, integrationState) {
|
|
1057
1074
|
this.runtimeService = runtimeService;
|
|
1058
|
-
this.
|
|
1059
|
-
this.
|
|
1060
|
-
this.configurationRuntimeService = configurationRuntimeService;
|
|
1075
|
+
this.configurationState = configurationState;
|
|
1076
|
+
this.toastService = toastService;
|
|
1061
1077
|
this.integrationState = integrationState;
|
|
1062
1078
|
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
|
1063
1079
|
this.destroy$ = new Subject();
|
|
@@ -1082,37 +1098,21 @@ class PreviewComponent {
|
|
|
1082
1098
|
ngOnDestroy() {
|
|
1083
1099
|
this.destroy$.next();
|
|
1084
1100
|
this.destroy$.complete();
|
|
1085
|
-
this.
|
|
1101
|
+
this.configurationState.cleanup();
|
|
1086
1102
|
this.runtimeService.clear();
|
|
1087
1103
|
}
|
|
1088
1104
|
trackBy(_, el) {
|
|
1089
1105
|
return el;
|
|
1090
1106
|
}
|
|
1091
|
-
initializeConfiguration$() {
|
|
1092
|
-
const isAlreadyInitialized = this.configurationRuntimeService.isInitialized;
|
|
1093
|
-
if (!this.uiDefinition || this.uiDefinition.type !== 'CONFIGURATION' || isAlreadyInitialized) {
|
|
1094
|
-
return of({});
|
|
1095
|
-
}
|
|
1096
|
-
if (!this.modelId) {
|
|
1097
|
-
console.warn(`No modelId is given for uiDefinition with '${this.uiDefinition.type}' type`);
|
|
1098
|
-
return of({});
|
|
1099
|
-
}
|
|
1100
|
-
// If still not initialized - init configuration in Test mode
|
|
1101
|
-
return this.configurationRuntimeService
|
|
1102
|
-
.initTestMode(this.modelId, this.uiDefinition)
|
|
1103
|
-
.pipe(switchMap(() => this.configurationService.configure()));
|
|
1104
|
-
}
|
|
1105
1107
|
startPreview() {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
forkJoin([this.runtimeService.initialize$(this.uiDefinition, this.config), this.initializeConfiguration$()])
|
|
1110
|
-
.pipe(tap(() => {
|
|
1108
|
+
const customInit$ = this.config?.init$?.() ?? of(undefined);
|
|
1109
|
+
customInit$
|
|
1110
|
+
.pipe(switchMap(() => this.runtimeService.initialize$(this.uiDefinition, this.config)), tap(() => {
|
|
1111
1111
|
this.state$.next({ loading: false, failure: false });
|
|
1112
1112
|
}), catchError(error => {
|
|
1113
1113
|
console.error(error);
|
|
1114
1114
|
if (!this.uiDefinition?.properties?.suppressToastMessages) {
|
|
1115
|
-
this.
|
|
1115
|
+
this.toastService.add({ severity: ToastType.error, summary: error });
|
|
1116
1116
|
}
|
|
1117
1117
|
this.state$.next({ loading: false, failure: true });
|
|
1118
1118
|
return of();
|
|
@@ -1128,14 +1128,12 @@ class PreviewComponent {
|
|
|
1128
1128
|
}));
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
-
PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PreviewComponent, deps: [{ token: RuntimeService }, { token:
|
|
1132
|
-
PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: PreviewComponent, selector: "vl-cms-preview", inputs: {
|
|
1131
|
+
PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PreviewComponent, deps: [{ token: RuntimeService }, { token: i4.ConfigurationState }, { token: i3.ToastService }, { token: IntegrationState }], target: i0.ɵɵFactoryTarget.Component });
|
|
1132
|
+
PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: PreviewComponent, selector: "vl-cms-preview", inputs: { uiDefinition: "uiDefinition", config: "config" }, providers: [IOProviderService, TemplatesService], ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-element-renderer\n *ngFor=\"let el of elements$ | async; trackBy: trackBy\"\n [meta]=\"el\"\n ></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: ["meta"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
1133
1133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PreviewComponent, decorators: [{
|
|
1134
1134
|
type: Component,
|
|
1135
1135
|
args: [{ selector: 'vl-cms-preview', changeDetection: ChangeDetectionStrategy.OnPush, providers: [IOProviderService, TemplatesService], encapsulation: ViewEncapsulation.ShadowDom, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-element-renderer\n *ngFor=\"let el of elements$ | async; trackBy: trackBy\"\n [meta]=\"el\"\n ></vl-cms-element-renderer>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [":host{flex-grow:1;display:flex;flex-direction:column;height:100%}\n"] }]
|
|
1136
|
-
}], ctorParameters: function () { return [{ type: RuntimeService }, { type:
|
|
1137
|
-
type: Input
|
|
1138
|
-
}], uiDefinition: [{
|
|
1136
|
+
}], ctorParameters: function () { return [{ type: RuntimeService }, { type: i4.ConfigurationState }, { type: i3.ToastService }, { type: IntegrationState }]; }, propDecorators: { uiDefinition: [{
|
|
1139
1137
|
type: Input
|
|
1140
1138
|
}], config: [{
|
|
1141
1139
|
type: Input
|
|
@@ -1179,7 +1177,7 @@ class ElementDropHandleComponent {
|
|
|
1179
1177
|
}
|
|
1180
1178
|
}
|
|
1181
1179
|
ElementDropHandleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ElementDropHandleComponent, deps: [{ token: RuntimeEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1182
|
-
ElementDropHandleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: { index: "index", parentPath: "parentPath" }, ngImport: i0, template: "<div class=\"container\" dndDropzone (dndDrop)=\"handleDrop($event)\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{width:0;position:relative}.container{width:40px;height:100%;position:absolute;transform:translate(-50%);display:flex;justify-content:center;align-items:center}.handle{display:none;background:red;height:calc(100% - 10px);width:2px;pointer-events:none}.container.dndDragover .handle{display:block}\n"], dependencies: [{ kind: "directive", type: i2
|
|
1180
|
+
ElementDropHandleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ElementDropHandleComponent, selector: "vl-element-drop-handle", inputs: { index: "index", parentPath: "parentPath" }, ngImport: i0, template: "<div class=\"container\" dndDropzone (dndDrop)=\"handleDrop($event)\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{width:0;position:relative}.container{width:40px;height:100%;position:absolute;transform:translate(-50%);display:flex;justify-content:center;align-items:center}.handle{display:none;background:red;height:calc(100% - 10px);width:2px;pointer-events:none}.container.dndDragover .handle{display:block}\n"], dependencies: [{ kind: "directive", type: i2.DndDropzoneDirective, selector: "[dndDropzone]", inputs: ["dndDropzone", "dndEffectAllowed", "dndAllowExternal", "dndHorizontal", "dndDragoverClass", "dndDropzoneDisabledClass", "dndDisableIf", "dndDisableDropIf"], outputs: ["dndDragover", "dndDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1183
1181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ElementDropHandleComponent, decorators: [{
|
|
1184
1182
|
type: Component,
|
|
1185
1183
|
args: [{ selector: 'vl-element-drop-handle', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"container\" dndDropzone (dndDrop)=\"handleDrop($event)\">\n <div class=\"handle\"></div>\n</div>\n", styles: [":host{width:0;position:relative}.container{width:40px;height:100%;position:absolute;transform:translate(-50%);display:flex;justify-content:center;align-items:center}.handle{display:none;background:red;height:calc(100% - 10px);width:2px;pointer-events:none}.container.dndDragover .handle{display:block}\n"] }]
|
|
@@ -1627,6 +1625,7 @@ const VELOCE_LIBS = {
|
|
|
1627
1625
|
},
|
|
1628
1626
|
'@veloceapps/sdk/core': {
|
|
1629
1627
|
ConfigurationService,
|
|
1628
|
+
ConfigurationState,
|
|
1630
1629
|
QuoteDraftService,
|
|
1631
1630
|
FlowConfigurationService,
|
|
1632
1631
|
LineItemWorker,
|
|
@@ -1766,6 +1765,34 @@ const CONFIG = {
|
|
|
1766
1765
|
},
|
|
1767
1766
|
};
|
|
1768
1767
|
|
|
1768
|
+
function btoaSafe(str) {
|
|
1769
|
+
if (!str) {
|
|
1770
|
+
return '';
|
|
1771
|
+
}
|
|
1772
|
+
try {
|
|
1773
|
+
const encoder = new TextEncoder();
|
|
1774
|
+
const charCodes = encoder.encode(str);
|
|
1775
|
+
return window.btoa(String.fromCharCode(...charCodes)) || '';
|
|
1776
|
+
}
|
|
1777
|
+
catch (e) {
|
|
1778
|
+
return '';
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
function atobSafe(str) {
|
|
1782
|
+
if (!str) {
|
|
1783
|
+
return '';
|
|
1784
|
+
}
|
|
1785
|
+
try {
|
|
1786
|
+
const binary = window.atob(str);
|
|
1787
|
+
const bytes = Uint8Array.from({ length: binary.length }, (_, index) => binary.charCodeAt(index));
|
|
1788
|
+
const decoder = new TextDecoder('utf-8');
|
|
1789
|
+
return decoder.decode(bytes);
|
|
1790
|
+
}
|
|
1791
|
+
catch (e) {
|
|
1792
|
+
return '';
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1769
1796
|
const EXPORTED_CLASS_REGEX = /export class (\S+)/;
|
|
1770
1797
|
const METADATA_DECORATOR_REGEX = /@ElementDefinition\(([\s\S]+)\)(\n|\r\n|.)*export class/g;
|
|
1771
1798
|
class UiBuildError extends Error {
|
|
@@ -1776,9 +1803,9 @@ class UiBuildError extends Error {
|
|
|
1776
1803
|
}
|
|
1777
1804
|
}
|
|
1778
1805
|
const elementToMetadata = (el, parentPath) => {
|
|
1779
|
-
const script =
|
|
1780
|
-
const template =
|
|
1781
|
-
const styles =
|
|
1806
|
+
const script = atobSafe(el.script);
|
|
1807
|
+
const template = atobSafe(el.template);
|
|
1808
|
+
const styles = atobSafe(el.styles);
|
|
1782
1809
|
const exportedClassName = script && (EXPORTED_CLASS_REGEX.exec(script) ?? [])[1];
|
|
1783
1810
|
if (!exportedClassName) {
|
|
1784
1811
|
throw new Error("Script doesn't have exported class");
|
|
@@ -1810,10 +1837,9 @@ const metadataToElement = (metadata, recursive = true) => {
|
|
|
1810
1837
|
if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
|
|
1811
1838
|
throw new UiBuildError(`'${metadata.name}' component script is missing an exported class`, metadata);
|
|
1812
1839
|
}
|
|
1813
|
-
const script = metadata.script
|
|
1814
|
-
|
|
1815
|
-
const
|
|
1816
|
-
const styles = metadata.styles && window.btoa(metadata.styles);
|
|
1840
|
+
const script = btoaSafe(metadata.script?.replace(EXPORTED_CLASS_REGEX, `@ElementDefinition(${stringifyElementMetadata(normalizedElMetadata)})\nexport class Script`));
|
|
1841
|
+
const template = btoaSafe(metadata.template);
|
|
1842
|
+
const styles = btoaSafe(metadata.styles);
|
|
1817
1843
|
return {
|
|
1818
1844
|
script,
|
|
1819
1845
|
template,
|
|
@@ -2334,7 +2360,7 @@ class FederatedComponent {
|
|
|
2334
2360
|
}
|
|
2335
2361
|
}
|
|
2336
2362
|
FederatedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FederatedComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
2337
|
-
FederatedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", options: "options" }, viewQueries: [{ propertyName: "host", first: true, predicate: FederatedHostDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template vlFederatedHost></ng-template>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type:
|
|
2363
|
+
FederatedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: FederatedComponent, selector: "veloce-host-federated", inputs: { remoteEntry: "remoteEntry", remoteName: "remoteName", exposedModule: "exposedModule", data: "data", options: "options" }, viewQueries: [{ propertyName: "host", first: true, predicate: FederatedHostDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template vlFederatedHost></ng-template>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"], dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "directive", type: FederatedHostDirective, selector: "[vlFederatedHost]" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2338
2364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FederatedComponent, decorators: [{
|
|
2339
2365
|
type: Component,
|
|
2340
2366
|
args: [{ selector: 'veloce-host-federated', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template vlFederatedHost></ng-template>\n\n<vl-loader *ngIf=\"!suppressLoading && (isLoading$ | async)\" [label]=\"loadingLabel\"></vl-loader>\n", styles: [":host{display:block}div{height:100%}\n"] }]
|
|
@@ -2526,12 +2552,12 @@ class MigrationsService {
|
|
|
2526
2552
|
}
|
|
2527
2553
|
}
|
|
2528
2554
|
}
|
|
2529
|
-
MigrationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MigrationsService, deps: [{ token:
|
|
2555
|
+
MigrationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MigrationsService, deps: [{ token: i3.ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2530
2556
|
MigrationsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MigrationsService, providedIn: 'root' });
|
|
2531
2557
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: MigrationsService, decorators: [{
|
|
2532
2558
|
type: Injectable,
|
|
2533
2559
|
args: [{ providedIn: 'root' }]
|
|
2534
|
-
}], ctorParameters: function () { return [{ type:
|
|
2560
|
+
}], ctorParameters: function () { return [{ type: i3.ToastService }]; } });
|
|
2535
2561
|
|
|
2536
2562
|
class MigrationsModule {
|
|
2537
2563
|
}
|