@veloceapps/sdk 7.0.2-71 → 7.0.2-73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/cms/components/preview/preview.component.d.ts +6 -9
  2. package/cms/components/preview/preview.types.d.ts +5 -0
  3. package/cms/services/resources.service.d.ts +9 -0
  4. package/cms/vendor-map.d.ts +2 -1
  5. package/core/modules/configuration/index.d.ts +1 -0
  6. package/core/modules/configuration/services/configuration-runtime.service.d.ts +4 -3
  7. package/core/modules/configuration/services/configuration.service.d.ts +6 -4
  8. package/core/modules/configuration/services/configuration.state.d.ts +30 -0
  9. package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
  10. package/core/types/runtime.types.d.ts +2 -2
  11. package/esm2020/cms/components/preview/preview.component.mjs +17 -37
  12. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  13. package/esm2020/cms/services/resources.service.mjs +19 -1
  14. package/esm2020/cms/vendor-map.mjs +3 -2
  15. package/esm2020/core/modules/configuration/configuration.module.mjs +4 -1
  16. package/esm2020/core/modules/configuration/index.mjs +2 -1
  17. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +27 -19
  18. package/esm2020/core/modules/configuration/services/configuration.service.mjs +41 -29
  19. package/esm2020/core/modules/configuration/services/configuration.state.mjs +142 -0
  20. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +10 -11
  21. package/esm2020/core/services/quote-draft.service.mjs +1 -1
  22. package/esm2020/core/types/runtime.types.mjs +1 -1
  23. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +1 -1
  24. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +1 -1
  25. package/esm2020/src/pages/assets/assets.component.mjs +1 -1
  26. package/esm2020/src/pages/catalog/catalog.component.mjs +1 -1
  27. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +4 -4
  28. package/esm2020/src/pages/product/product.component.mjs +50 -66
  29. package/esm2020/src/pages/remote/remote.component.mjs +19 -19
  30. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +1 -1
  31. package/esm2020/src/types/flow-customization.types.mjs +1 -1
  32. package/fesm2015/veloceapps-sdk-cms.mjs +44 -43
  33. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  34. package/fesm2015/veloceapps-sdk-core.mjs +214 -59
  35. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  36. package/fesm2015/veloceapps-sdk.mjs +67 -80
  37. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  38. package/fesm2020/veloceapps-sdk-cms.mjs +42 -43
  39. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  40. package/fesm2020/veloceapps-sdk-core.mjs +206 -55
  41. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  42. package/fesm2020/veloceapps-sdk.mjs +64 -76
  43. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  44. package/package.json +1 -1
  45. package/src/pages/product/product.component.d.ts +10 -21
  46. package/src/pages/remote/remote.component.d.ts +3 -4
  47. package/src/types/flow-customization.types.d.ts +3 -3
@@ -13,7 +13,7 @@ import { isLineItemModified, getOriginParent, SdkPipesModule, RuntimeOperation,
13
13
  import * as i3 from 'primeng/button';
14
14
  import { ButtonModule } from 'primeng/button';
15
15
  import * as i1 from 'primeng/dynamicdialog';
16
- import { UITemplateComponentType, UITemplateType, SalesforceIdUtils, ConfigurationContextMode, EntityUtil, UUID } from '@veloceapps/core';
16
+ import { UITemplateComponentType, UITemplateType, SalesforceIdUtils, ConfigurationContextMode, EntityUtil, isLegacyUIDefinition, getUIDefinitionProperties, UUID } from '@veloceapps/core';
17
17
  import { Subject, BehaviorSubject, tap, takeUntil, first, catchError, of, map, switchMap, filter, shareReplay, startWith, distinctUntilChanged, combineLatest, finalize, noop, forkJoin, from, throwError } from 'rxjs';
18
18
  import * as i7 from 'primeng/overlaypanel';
19
19
  import { OverlayPanel, OverlayPanelModule } from 'primeng/overlaypanel';
@@ -226,7 +226,7 @@ class DocGenComponent {
226
226
  }
227
227
  }
228
228
  DocGenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocGenComponent, deps: [{ token: i1$1.QuoteDraftService }, { token: i1$1.ContextService }, { token: i2.UITemplatesApiService }, { token: FlowDocGenService }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
229
- DocGenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: DocGenComponent, selector: "vl-flow-doc-gen", ngImport: i0, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
229
+ DocGenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: DocGenComponent, selector: "vl-flow-doc-gen", ngImport: i0, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
230
230
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DocGenComponent, decorators: [{
231
231
  type: Component,
232
232
  args: [{ selector: 'vl-flow-doc-gen', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"isVisible$ | async\">\n <ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
@@ -370,7 +370,7 @@ class GuidedSellingComponent {
370
370
  }
371
371
  }
372
372
  GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.QuoteDraftService }, { token: i1$1.ContextService }, { token: i2.UITemplatesApiService }, { token: FlowGuidedSellingService }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
373
- GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
373
+ GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
374
374
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: GuidedSellingComponent, decorators: [{
375
375
  type: Component,
376
376
  args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
@@ -1820,7 +1820,7 @@ class AssetsComponent {
1820
1820
  }
1821
1821
  }
1822
1822
  AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AssetsComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1823
- AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: AssetsComponent, selector: "vl-flow-assets", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1823
+ AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: AssetsComponent, selector: "vl-flow-assets", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1824
1824
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AssetsComponent, decorators: [{
1825
1825
  type: Component,
1826
1826
  args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
@@ -1932,7 +1932,7 @@ class CatalogComponent {
1932
1932
  }
1933
1933
  }
1934
1934
  CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1935
- CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: CatalogComponent, selector: "vl-flow-catalog", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1935
+ CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: CatalogComponent, selector: "vl-flow-catalog", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1936
1936
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogComponent, decorators: [{
1937
1937
  type: Component,
1938
1938
  args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
@@ -2160,9 +2160,9 @@ class LegacyProductComponent {
2160
2160
  if (!this.customizationService?.getLegacyUiDefinition) {
2161
2161
  return of(context);
2162
2162
  }
2163
- return this.customizationService.getLegacyUiDefinition(productId).pipe(map$1(uiDef => ({
2163
+ return this.customizationService.getLegacyUiDefinition(productId).pipe(map$1(uiDefinitionContainer => ({
2164
2164
  ...context,
2165
- uiDefinition: uiDef ?? context.uiDefinition,
2165
+ uiDefinitionContainer: uiDefinitionContainer ?? undefined,
2166
2166
  })));
2167
2167
  }
2168
2168
  getRuntimeContext(productId, offeringId, runtimeOperation) {
@@ -2199,72 +2199,58 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2199
2199
  }] });
2200
2200
 
2201
2201
  class ProductComponent {
2202
- constructor(contextService, runtimeService, configurationService, quoteDraftService, messageService, integrationState, customizationService) {
2202
+ constructor(contextService, configurationRuntimeService, configurationService, configurationState, quoteDraftService, integrationState, customizationService) {
2203
2203
  this.contextService = contextService;
2204
- this.runtimeService = runtimeService;
2204
+ this.configurationRuntimeService = configurationRuntimeService;
2205
2205
  this.configurationService = configurationService;
2206
+ this.configurationState = configurationState;
2206
2207
  this.quoteDraftService = quoteDraftService;
2207
- this.messageService = messageService;
2208
2208
  this.integrationState = integrationState;
2209
2209
  this.customizationService = customizationService;
2210
- this.destroy$ = new Subject();
2211
- this.state$ = new BehaviorSubject({ loading: true, failure: false });
2212
- }
2213
- ngOnInit() {
2214
- this.quoteDraftService.quoteDraft$.pipe(first(), takeUntil(this.destroy$)).subscribe(quote => this.init(quote));
2215
- }
2216
- ngOnDestroy() {
2217
- this.destroy$.next();
2218
- this.destroy$.complete();
2210
+ this.uiDefinition$ = new BehaviorSubject(undefined);
2211
+ this.config = {
2212
+ init$: () => this.init$(),
2213
+ };
2219
2214
  }
2220
- customize(productId) {
2221
- if (!this.customizationService?.getUiDefinition) {
2222
- return of(null);
2215
+ customizeUI$() {
2216
+ const { productId } = this.configurationRuntimeService.runtimeContext ?? {};
2217
+ if (!productId || !this.customizationService?.getUiDefinition) {
2218
+ return of(undefined);
2223
2219
  }
2224
- return this.customizationService.getUiDefinition(productId).pipe(tap(uiDef => {
2225
- if (uiDef) {
2226
- this.uiDefinition = uiDef;
2227
- this.runtimeService.uiDefinitionProperties = uiDef.properties ?? {};
2220
+ return this.customizationService.getUiDefinition(productId).pipe(map(uiDefinitionContainer => {
2221
+ if (uiDefinitionContainer) {
2222
+ this.configurationRuntimeService.overrideUIDefinition(uiDefinitionContainer);
2228
2223
  }
2229
2224
  }));
2230
2225
  }
2231
- init(quote) {
2232
- const contextProperties = this.contextService.resolve().properties;
2233
- const productId = contextProperties.productId;
2234
- if (!productId) {
2235
- return;
2236
- }
2237
- const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
2238
- const currentStateItem = quote.currentState.find(({ id }) => id === lineItemId);
2239
- if (currentStateItem) {
2240
- this.configurationService.setConfigurableRamp(currentStateItem);
2241
- }
2242
- const { offeringId } = currentStateItem ?? {};
2243
- this.runtimeService
2244
- .init({ productId, offeringId })
2245
- .pipe(tap(context => (this.uiDefinition = context?.uiDefinition)), switchMap(() => this.customize(productId)), this.throwIfNoUIDefinition(), switchMap(() => {
2246
- if (this.runtimeService.initializationProps) {
2247
- this.runtimeService.initializationProps.attributesMap = this.integrationState.state.guidedSelling;
2226
+ init$() {
2227
+ return this.quoteDraftService.quoteDraft$.pipe(first(), switchMap(quote => {
2228
+ const contextProperties = this.contextService.resolve().properties;
2229
+ const productId = contextProperties.productId;
2230
+ if (!productId) {
2231
+ throw new Error(`Unable to start configuration for 'productId == null'`);
2232
+ }
2233
+ const lineItemId = this.getLineItemId(quote, productId, contextProperties.lineItemId);
2234
+ const currentStateItem = quote.currentState.find(({ id }) => id === lineItemId);
2235
+ if (currentStateItem) {
2236
+ this.configurationService.setConfigurableRamp(currentStateItem);
2237
+ }
2238
+ const { offeringId } = currentStateItem ?? {};
2239
+ return this.configurationRuntimeService.init({ productId, offeringId });
2240
+ }), switchMap(() => this.customizeUI$()), tap(() => {
2241
+ const uiDefinition = this.configurationRuntimeService.runtimeContext?.uiDefinitionContainer?.source;
2242
+ if (uiDefinition && !isLegacyUIDefinition(uiDefinition)) {
2243
+ this.uiDefinition$.next(uiDefinition);
2248
2244
  }
2249
- return this.configurationService.configure();
2250
- }), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2251
- if (!this.uiDefinition?.properties?.suppressToastMessages) {
2252
- this.messageService.add({ severity: 'error', summary: error });
2245
+ else {
2246
+ throw new Error('Product does not have Configuration UI');
2253
2247
  }
2254
- this.state$.next({ loading: false, failure: true });
2255
- return of();
2256
- }), takeUntil(this.destroy$))
2257
- .subscribe();
2258
- }
2259
- throwIfNoUIDefinition() {
2260
- return (source$) => {
2261
- return source$.pipe(switchMap(() => {
2262
- if (!this.uiDefinition) {
2263
- return throwError(() => 'Product does not have Configuration UI');
2264
- }
2265
- return source$;
2266
- }));
2267
- };
2248
+ }), tap(() => {
2249
+ if (this.configurationRuntimeService.initializationProps) {
2250
+ this.configurationRuntimeService.initializationProps.attributesMap =
2251
+ this.integrationState.state.guidedSelling;
2252
+ }
2253
+ }), switchMap(() => this.configurationState.init$()));
2268
2254
  }
2269
2255
  getLineItemId(quote, productId, lineItemId) {
2270
2256
  // search by lineItemId first
@@ -2275,12 +2261,12 @@ class ProductComponent {
2275
2261
  return id;
2276
2262
  }
2277
2263
  }
2278
- ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.QuoteDraftService }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2279
- ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ProductComponent, selector: "vl-flow-product", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2264
+ ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.ConfigurationState }, { token: i1$1.QuoteDraftService }, { token: i5.IntegrationState }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2265
+ ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n", styles: [""], dependencies: [{ kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2280
2266
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ProductComponent, decorators: [{
2281
2267
  type: Component,
2282
- args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2283
- }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.QuoteDraftService }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: undefined, decorators: [{
2268
+ args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"$any(uiDefinition$ | async)\" [config]=\"config\"></vl-cms-preview>\n" }]
2269
+ }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.ConfigurationState }, { type: i1$1.QuoteDraftService }, { type: i5.IntegrationState }, { type: undefined, decorators: [{
2284
2270
  type: Optional
2285
2271
  }, {
2286
2272
  type: Inject,
@@ -2336,12 +2322,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2336
2322
  }] });
2337
2323
 
2338
2324
  class RemoteComponent {
2339
- constructor(contextService, quoteDraftService, quoteApiService, runtimeService, configurationService, messageService, integrationState, location) {
2325
+ constructor(contextService, quoteDraftService, runtimeService, configurationService, configurationState, messageService, integrationState, location) {
2340
2326
  this.contextService = contextService;
2341
2327
  this.quoteDraftService = quoteDraftService;
2342
- this.quoteApiService = quoteApiService;
2343
2328
  this.runtimeService = runtimeService;
2344
2329
  this.configurationService = configurationService;
2330
+ this.configurationState = configurationState;
2345
2331
  this.messageService = messageService;
2346
2332
  this.integrationState = integrationState;
2347
2333
  this.location = location;
@@ -2380,8 +2366,11 @@ class RemoteComponent {
2380
2366
  this.runtimeService
2381
2367
  .init({ productId })
2382
2368
  .pipe(first(), tap(context => {
2383
- const pricingEnabled = context?.uiDefinition?.properties?.pricingEnabled ? 'true' : 'false';
2384
- const priceListId = context?.uiDefinition?.properties?.priceList;
2369
+ const uiDefinitionProperties = getUIDefinitionProperties(context.uiDefinitionContainer);
2370
+ const uiDefinition = context.uiDefinitionContainer?.source;
2371
+ this.uiDefinition = uiDefinition && !isLegacyUIDefinition(uiDefinition) ? uiDefinition : undefined;
2372
+ const pricingEnabled = uiDefinitionProperties.pricingEnabled ? 'true' : 'false';
2373
+ const priceListId = uiDefinitionProperties.priceList;
2385
2374
  const runtimeContextProperties = this.runtimeService.runtimeContext?.properties;
2386
2375
  if (runtimeContextProperties) {
2387
2376
  runtimeContextProperties.PriceListId = priceListId;
@@ -2389,15 +2378,14 @@ class RemoteComponent {
2389
2378
  }
2390
2379
  this.contextService.update({
2391
2380
  properties: {
2392
- ModelId: context?.modelId,
2381
+ ModelId: context.modelId,
2393
2382
  RuntimeMode: 'TEST',
2394
2383
  PricingEnabled: pricingEnabled,
2395
2384
  PriceListId: priceListId,
2396
2385
  },
2397
2386
  });
2398
- this.uiDefinition = context?.uiDefinition;
2399
2387
  this.configurationService.setConfigurableRamp(this.createLineItem());
2400
- }), this.throwIfNoUIDefinition(), switchMap(() => this.configurationService.configure()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2388
+ }), this.throwIfNoUIDefinition(), switchMap(() => this.configurationState.init$()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
2401
2389
  if (!this.uiDefinition?.properties?.suppressToastMessages) {
2402
2390
  this.messageService.add({ severity: 'error', summary: error });
2403
2391
  }
@@ -2655,12 +2643,12 @@ class RemoteComponent {
2655
2643
  return optionConfigurations;
2656
2644
  }
2657
2645
  }
2658
- RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.QuoteDraftService }, { token: i2.QuoteApiService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
2659
- RemoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: RemoteComponent, selector: "vl-flow-remote", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2646
+ RemoteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.QuoteDraftService }, { token: i1$1.ConfigurationRuntimeService }, { token: i1$1.ConfigurationService }, { token: i1$1.ConfigurationState }, { token: i8.MessageService }, { token: i5.IntegrationState }, { token: i4.Location }], target: i0.ɵɵFactoryTarget.Component });
2647
+ RemoteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: RemoteComponent, selector: "vl-flow-remote", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2660
2648
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: RemoteComponent, decorators: [{
2661
2649
  type: Component,
2662
2650
  args: [{ selector: 'vl-flow-remote', changeDetection: ChangeDetectionStrategy.OnPush, 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
2663
- }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.QuoteDraftService }, { type: i2.QuoteApiService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: i4.Location }]; } });
2651
+ }], ctorParameters: function () { return [{ type: i1$1.ContextService }, { type: i1$1.QuoteDraftService }, { type: i1$1.ConfigurationRuntimeService }, { type: i1$1.ConfigurationService }, { type: i1$1.ConfigurationState }, { type: i8.MessageService }, { type: i5.IntegrationState }, { type: i4.Location }]; } });
2664
2652
 
2665
2653
  class RemoteModule {
2666
2654
  }
@@ -2763,7 +2751,7 @@ class ShoppingCartComponent {
2763
2751
  }
2764
2752
  }
2765
2753
  ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2766
- ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2754
+ ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i3$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2767
2755
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ShoppingCartComponent, decorators: [{
2768
2756
  type: Component,
2769
2757
  args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, 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-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]