@veloceapps/sdk 7.0.2-0 → 7.0.2-1

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.
@@ -7,12 +7,12 @@ import * as i2 from '@veloceapps/sdk/core';
7
7
  import { ConfigurationService, LineItemWorker, generateLineItem, getAttributeValue, QuoteDraftService, FlowConfigurationService, ProductImagesService, ContextService, lineItemUtils, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
8
8
  import * as i3 from 'primeng/api';
9
9
  import { applyPatch } from 'rfc6902';
10
+ import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, CoreModule } from '@veloceapps/core';
10
11
  import lodash, { compact, isArray, pull, merge, omit, flatten, set, kebabCase, cloneDeep } from 'lodash';
11
12
  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';
@@ -168,24 +168,9 @@ ElementComponent = __decorate([
168
168
  __metadata("design:paramtypes", [Injector])
169
169
  ], ElementComponent);
170
170
 
171
- function getElementUniqueName(collection, name, comparator) {
172
- let result = '';
173
- let index = 0;
174
- while (!result) {
175
- const candidate = name + (index ? ` (${index})` : '');
176
- const exists = collection.some(comparator(candidate));
177
- if (!exists) {
178
- result = candidate;
179
- }
180
- else {
181
- index++;
182
- }
183
- }
184
- return result;
185
- }
186
171
  const insertElementAt = (source, target, parentPath, index) => {
187
172
  const result = [...source];
188
- const name = getElementUniqueName(result, target.name, (name) => (el) => el.name === name);
173
+ const name = getCollectionUniqueName(result, target.name, (name) => (el) => el.name === name);
189
174
  const path = parentPath ? `${parentPath}/${name}` : name;
190
175
  result.splice(index, 0, { ...target, path, name });
191
176
  return result;
@@ -2064,5 +2049,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2064
2049
  * Generated bundle index. Do not edit.
2065
2050
  */
2066
2051
 
2067
- 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 };
2052
+ 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 };
2068
2053
  //# sourceMappingURL=veloceapps-sdk-cms.mjs.map