@veloceapps/sdk 7.0.2-0 → 7.0.2-10

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.
@@ -4,6 +4,7 @@ import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, I
4
4
  import * as rxjs from 'rxjs';
5
5
  import { BehaviorSubject, Subject, of, map, tap, switchMap, startWith, distinctUntilChanged, filter, ReplaySubject, noop, take, Observable, takeUntil, forkJoin, catchError, combineLatest } from 'rxjs';
6
6
  import lodash, { compact, isArray, pull, merge, omit, flatten, set, kebabCase, cloneDeep } from 'lodash';
7
+ import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, CoreModule } from '@veloceapps/core';
7
8
  import { applyPatch } from 'rfc6902';
8
9
  import * as i2 from '@veloceapps/sdk/core';
9
10
  import { ConfigurationService, LineItemWorker, generateLineItem, getAttributeValue, QuoteDraftService, FlowConfigurationService, ProductImagesService, ContextService, lineItemUtils, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
@@ -12,7 +13,6 @@ import * as i5 from '@angular/common';
12
13
  import { CommonModule, DOCUMENT } from '@angular/common';
13
14
  import * as i1 from '@veloceapps/components';
14
15
  import { LetDirectiveModule, LoaderModule, ToastService, ToastType } from '@veloceapps/components';
15
- import { UUID, isDefined, Operator, Predicate, parseJsonSafely, CoreModule } from '@veloceapps/core';
16
16
  import * as i2$1 from 'ngx-drag-drop';
17
17
  import { DndModule } from 'ngx-drag-drop';
18
18
  import { SalesforceApiService, QuoteApiService, DocumentTemplatesApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ShoppingCartSettingsApiService, ConfigurationSettingsApiService, GuidedSellingApiService, ApiModule } from '@veloceapps/api';
@@ -169,24 +169,9 @@ ElementComponent = __decorate([
169
169
  __metadata("design:paramtypes", [Injector])
170
170
  ], ElementComponent);
171
171
 
172
- function getElementUniqueName(collection, name, comparator) {
173
- let result = '';
174
- let index = 0;
175
- while (!result) {
176
- const candidate = name + (index ? ` (${index})` : '');
177
- const exists = collection.some(comparator(candidate));
178
- if (!exists) {
179
- result = candidate;
180
- }
181
- else {
182
- index++;
183
- }
184
- }
185
- return result;
186
- }
187
172
  const insertElementAt = (source, target, parentPath, index) => {
188
173
  const result = [...source];
189
- const name = getElementUniqueName(result, target.name, (name) => (el) => el.name === name);
174
+ const name = getCollectionUniqueName(result, target.name, (name) => (el) => el.name === name);
190
175
  const path = parentPath ? `${parentPath}/${name}` : name;
191
176
  result.splice(index, 0, Object.assign(Object.assign({}, target), { path, name }));
192
177
  return result;
@@ -1813,7 +1798,11 @@ class FederatedComponent {
1813
1798
  if (!remoteEntry || !exposedModule) {
1814
1799
  return;
1815
1800
  }
1816
- loadRemoteModule({ type: 'module', remoteEntry, exposedModule }).then(federated => {
1801
+ loadRemoteModule({
1802
+ type: 'module',
1803
+ remoteEntry: this.normalizeRemoteEntry(remoteEntry),
1804
+ exposedModule,
1805
+ }).then(federated => {
1817
1806
  var _a, _b;
1818
1807
  const moduleRef = createNgModule(federated[exposedModule], this.injector);
1819
1808
  const componentRef = this.host.viewContainerRef.createComponent(federated[exposedModule].rootComponent, { ngModuleRef: moduleRef });
@@ -1822,6 +1811,13 @@ class FederatedComponent {
1822
1811
  this.isLoading$.next(false);
1823
1812
  });
1824
1813
  }
1814
+ normalizeRemoteEntry(value) {
1815
+ const { proxyTargetUrl, VELO_API } = window;
1816
+ if (proxyTargetUrl && VELO_API) {
1817
+ return value.replace(proxyTargetUrl, VELO_API);
1818
+ }
1819
+ return value;
1820
+ }
1825
1821
  }
1826
1822
  FederatedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FederatedComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1827
1823
  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: i1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "directive", type: FederatedHostDirective, selector: "[vlFederatedHost]" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
@@ -2031,5 +2027,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2031
2027
  * Generated bundle index. Do not edit.
2032
2028
  */
2033
2029
 
2034
- export { ApplyProductConfigurationAction, CloseDocGenAction, CmsAction, ConfigureProductAction, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementsResolver, FlowAction, IntegrationState, LauncherModule, MigrationsModule, MigrationsService, NavigateBackAction, NavigateToCatalogAction, OpenDocGenAction, PreviewComponent, PreviewModule, RemoteApplyAction, RemoteCancelAction, ResourcesService, RuntimeEditorService, RuntimeModule, SHARED_ELEMENT_METADATA, SwitchObjectAction, TemplatesService, UI_DEFINITION_METADATA, UiBuildError, VENDOR_MAP, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementConfig, getElementUniqueName, insertElement, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata, parseBoundPath, parsePath, removeElement, stringifyElementMetadata };
2030
+ export { ApplyProductConfigurationAction, CloseDocGenAction, CmsAction, ConfigureProductAction, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementsResolver, FlowAction, IntegrationState, LauncherModule, MigrationsModule, MigrationsService, NavigateBackAction, NavigateToCatalogAction, OpenDocGenAction, PreviewComponent, PreviewModule, RemoteApplyAction, RemoteCancelAction, ResourcesService, RuntimeEditorService, RuntimeModule, SHARED_ELEMENT_METADATA, SwitchObjectAction, TemplatesService, UI_DEFINITION_METADATA, UiBuildError, VENDOR_MAP, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementConfig, insertElement, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata, parseBoundPath, parsePath, removeElement, stringifyElementMetadata };
2035
2031
  //# sourceMappingURL=veloceapps-sdk-cms.mjs.map