@veloceapps/sdk 7.0.2-3 → 7.0.2-31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/cms/cms.actions.d.ts +30 -1
  2. package/cms/components/element-children/element-children.component.d.ts +3 -1
  3. package/cms/components/element-tools-panel/element-tools-panel.component.d.ts +14 -0
  4. package/cms/components/preview/preview.component.d.ts +1 -0
  5. package/cms/components/preview/preview.module.d.ts +2 -1
  6. package/cms/components/preview/preview.types.d.ts +4 -0
  7. package/cms/injection-tokens.d.ts +1 -3
  8. package/cms/modules/runtime/index.d.ts +1 -0
  9. package/cms/modules/runtime/services/compilation.service.d.ts +2 -1
  10. package/cms/modules/runtime/services/runtime-editor.service.d.ts +6 -4
  11. package/cms/modules/runtime/services/runtime.service.d.ts +5 -1
  12. package/cms/modules/runtime/types/runtime.actions.d.ts +5 -2
  13. package/cms/plugins/element-hover.plugin.d.ts +32 -0
  14. package/cms/plugins/page.plugin.d.ts +15 -0
  15. package/cms/plugins/script.plugin.d.ts +0 -3
  16. package/cms/types/common.types.d.ts +11 -1
  17. package/cms/types/index.d.ts +2 -0
  18. package/cms/types/layouts.types.d.ts +28 -2
  19. package/cms/types/pages.types.d.ts +1 -0
  20. package/cms/utils/elements-resolver.d.ts +5 -1
  21. package/cms/utils/script.utils.d.ts +2 -0
  22. package/cms/vendor-map.d.ts +9 -6
  23. package/core/modules/configuration/services/configuration.service.d.ts +3 -3
  24. package/core/services/index.d.ts +1 -0
  25. package/core/services/runtime-settings.service.d.ts +18 -0
  26. package/core/types/ui-definition.types.d.ts +7 -2
  27. package/core/utils/line-item.utils.d.ts +4 -2
  28. package/core/utils/line-item.worker.d.ts +2 -2
  29. package/esm2020/cms/cms.actions.mjs +42 -2
  30. package/esm2020/cms/cms.elements.mjs +16 -4
  31. package/esm2020/cms/cms.layouts.mjs +53 -1
  32. package/esm2020/cms/components/element-children/element-children.component.mjs +11 -6
  33. package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +2 -2
  34. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +35 -0
  35. package/esm2020/cms/components/preview/preview.component.mjs +11 -7
  36. package/esm2020/cms/components/preview/preview.module.mjs +22 -4
  37. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  38. package/esm2020/cms/injection-tokens.mjs +1 -2
  39. package/esm2020/cms/modules/runtime/index.mjs +2 -1
  40. package/esm2020/cms/modules/runtime/services/compilation.service.mjs +3 -3
  41. package/esm2020/cms/modules/runtime/services/runtime-editor.service.mjs +5 -3
  42. package/esm2020/cms/modules/runtime/services/runtime.service.mjs +39 -5
  43. package/esm2020/cms/modules/runtime/types/runtime.actions.mjs +1 -1
  44. package/esm2020/cms/plugins/element-hover.plugin.mjs +112 -0
  45. package/esm2020/cms/plugins/page.plugin.mjs +37 -0
  46. package/esm2020/cms/plugins/script.plugin.mjs +6 -40
  47. package/esm2020/cms/services/integration.state.mjs +3 -6
  48. package/esm2020/cms/services/io-provider.service.mjs +7 -5
  49. package/esm2020/cms/types/common.types.mjs +1 -1
  50. package/esm2020/cms/types/index.mjs +3 -1
  51. package/esm2020/cms/types/layouts.types.mjs +70 -1
  52. package/esm2020/cms/types/pages.types.mjs +2 -0
  53. package/esm2020/cms/utils/elements-resolver.mjs +22 -8
  54. package/esm2020/cms/utils/script.utils.mjs +42 -0
  55. package/esm2020/cms/vendor-map.mjs +5 -3
  56. package/esm2020/core/core.module.mjs +16 -4
  57. package/esm2020/core/modules/configuration/services/configuration.service.mjs +6 -5
  58. package/esm2020/core/services/index.mjs +2 -1
  59. package/esm2020/core/services/runtime-settings.service.mjs +62 -0
  60. package/esm2020/core/types/ui-definition.types.mjs +1 -1
  61. package/esm2020/core/utils/line-item.utils.mjs +35 -16
  62. package/esm2020/core/utils/line-item.worker.mjs +5 -5
  63. package/esm2020/src/components/header/header.component.mjs +15 -3
  64. package/esm2020/src/components/header/metrics/metrics.component.mjs +9 -7
  65. package/esm2020/src/flow-routing.module.mjs +1 -1
  66. package/esm2020/src/guards/context.guard.mjs +11 -8
  67. package/fesm2015/veloceapps-sdk-cms.mjs +497 -150
  68. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  69. package/fesm2015/veloceapps-sdk-core.mjs +117 -27
  70. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  71. package/fesm2015/veloceapps-sdk.mjs +31 -13
  72. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  73. package/fesm2020/veloceapps-sdk-cms.mjs +578 -164
  74. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  75. package/fesm2020/veloceapps-sdk-core.mjs +117 -27
  76. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  77. package/fesm2020/veloceapps-sdk.mjs +30 -13
  78. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  79. package/package.json +1 -1
  80. package/src/components/header/metrics/metrics.component.d.ts +4 -2
  81. package/src/guards/context.guard.d.ts +3 -2
@@ -26,11 +26,40 @@ export declare const SwitchObjectAction: (payload: {
26
26
  }) => IntegrationAction;
27
27
  export declare namespace CmsAction {
28
28
  const GO_TO_PAGE = "[CMS]_GO_TO_PAGE";
29
+ const UPDATE_CUSTOMIZATION = "[CMS]_UPDATE_CUSTOMIZATION";
30
+ const SHOW_OVERLAY = "[CMS]_SHOW_OVERLAY";
31
+ const HIDE_OVERLAY = "[CMS]_HIDE_OVERLAY";
32
+ const HIDE_ALL_OVERLAYS = "[CMS]_HIDE_ALL_OVERLAYS";
29
33
  /**
30
34
  * Navigate UI definition to a specific page
31
35
  *
32
36
  * @param pageName name of the page
33
- * @returns void
34
37
  */
35
38
  const GoToPage: (pageName: string) => IntegrationAction;
39
+ /**
40
+ * Update UI definition customization state
41
+ *
42
+ * @param pageName name of the page
43
+ */
44
+ const UpdateCustomization: (value: any) => IntegrationAction;
45
+ /**
46
+ * Show an Overlay on the selected page
47
+ *
48
+ * @param name - name of the overlay
49
+ * @returns void
50
+ */
51
+ const ShowOverlay: (name: string) => IntegrationAction;
52
+ /**
53
+ * Hide an Overlay on the selected page
54
+ *
55
+ * @param name - name of the overlay
56
+ * @returns void
57
+ */
58
+ const HideOverlay: (name: string) => IntegrationAction;
59
+ /**
60
+ * Hide all Overlays on the selected page
61
+ *
62
+ * @returns void
63
+ */
64
+ const HideAllOverlays: () => IntegrationAction;
36
65
  }
@@ -10,11 +10,13 @@ export declare class ElementChildrenComponent implements OnDestroy {
10
10
  private runtimeService;
11
11
  private runtimeEditorService;
12
12
  private cdr;
13
+ filter?: (elements: ElementMetadata[]) => ElementMetadata[];
13
14
  metadata$: Observable<ElementMetadata | undefined>;
14
15
  dragMode$: Observable<boolean>;
15
16
  private destroyed$;
16
17
  constructor(elementContext: ElementContextService, runtimeService: RuntimeService, runtimeEditorService: RuntimeEditorService, cdr: ChangeDetectorRef);
17
18
  ngOnDestroy(): void;
19
+ getFilteredChildren(elements: ElementMetadata[]): ElementMetadata[];
18
20
  static ɵfac: i0.ɵɵFactoryDeclaration<ElementChildrenComponent, never>;
19
- static ɵcmp: i0.ɵɵComponentDeclaration<ElementChildrenComponent, "element-children", never, {}, {}, never, never, false, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElementChildrenComponent, "element-children", never, { "filter": "filter"; }, {}, never, never, false, never>;
20
22
  }
@@ -0,0 +1,14 @@
1
+ import { RuntimeEditorService } from '../../modules/runtime';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ElementToolsPanelComponent {
4
+ private readonly metadata;
5
+ private readonly config;
6
+ private readonly elementRef;
7
+ runtimeEditorService?: RuntimeEditorService;
8
+ showDeleteButton: boolean;
9
+ constructor();
10
+ deleteHandler(): void;
11
+ showSettingsHandler(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementToolsPanelComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElementToolsPanelComponent, "ng-component", never, {}, {}, never, never, true, never>;
14
+ }
@@ -30,6 +30,7 @@ export declare class PreviewComponent implements OnInit, OnDestroy {
30
30
  trackBy(_: number, el: ElementMetadata): string;
31
31
  private initializeConfiguration$;
32
32
  private startPreview;
33
+ private getPages$;
33
34
  static ɵfac: i0.ɵɵFactoryDeclaration<PreviewComponent, never>;
34
35
  static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "vl-cms-preview", never, { "modelId": "modelId"; "uiDefinition": "uiDefinition"; "config": "config"; }, {}, never, never, false, never>;
35
36
  }
@@ -5,8 +5,9 @@ import * as i3 from "@veloceapps/components";
5
5
  import * as i4 from "../element-renderer/element-renderer.module";
6
6
  import * as i5 from "../element-children/element-children.module";
7
7
  import * as i6 from "../element-drop-handle/element-drop-handle.module";
8
+ import * as i7 from "../element-tools-panel/element-tools-panel.component";
8
9
  export declare class PreviewModule {
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<PreviewModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<PreviewModule, [typeof i1.PreviewComponent], [typeof i2.CommonModule, typeof i3.LoaderModule, typeof i4.ElementRendererModule, typeof i5.ElementChildrenModule, typeof i6.ElementDropHandleModule], [typeof i1.PreviewComponent]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PreviewModule, [typeof i1.PreviewComponent], [typeof i2.CommonModule, typeof i3.LoaderModule, typeof i4.ElementRendererModule, typeof i5.ElementChildrenModule, typeof i6.ElementDropHandleModule, typeof i7.ElementToolsPanelComponent], [typeof i1.PreviewComponent]>;
11
12
  static ɵinj: i0.ɵɵInjectorDeclaration<PreviewModule>;
12
13
  }
@@ -8,4 +8,8 @@ export interface CMSPreviewConfig {
8
8
  * (like element hover/selection or Drag&Drop zones)
9
9
  */
10
10
  uiBuilderMode?: boolean;
11
+ /**
12
+ * When `true`, preview renders settings page (element with `type: CUSTOMIZATION_PAGE`)
13
+ */
14
+ customizationMode?: boolean;
11
15
  }
@@ -1,11 +1,9 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { UIDefinitionMetadata } from '@veloceapps/sdk/core';
3
- import { Dictionary } from 'lodash';
4
3
  import { Plugin } from './engine/models/plugin';
5
4
  import { ElementConfig, ElementMetadata } from './types/common.types';
6
5
  export declare const DEFAULT_PLUGINS_TOKEN: InjectionToken<(typeof Plugin)[]>;
7
6
  export declare const UI_DEFINITION_METADATA: InjectionToken<UIDefinitionMetadata>;
8
7
  export declare const ELEMENT_METADATA: InjectionToken<ElementMetadata>;
9
- export declare const SHARED_ELEMENT_METADATA: InjectionToken<ElementMetadata>;
8
+ export declare const SHARED_ELEMENT_METADATA: InjectionToken<ElementMetadata | undefined>;
10
9
  export declare const ELEMENT_CONFIG: InjectionToken<ElementConfig>;
11
- export declare const VENDOR_MAP: InjectionToken<Dictionary<any>>;
@@ -1,2 +1,3 @@
1
1
  export * from './runtime.module';
2
2
  export * from './services/runtime-editor.service';
3
+ export * from './services/runtime.service';
@@ -1,6 +1,7 @@
1
1
  import { Injector } from '@angular/core';
2
2
  import { UIDefinition } from '@veloceapps/sdk/core';
3
3
  import { Observable } from 'rxjs';
4
+ import { CMSPreviewConfig } from '../../../components/preview';
4
5
  import { CompilationResult } from '../../../modules/runtime/types/compilation.types';
5
6
  import { ElementMetadata } from '../../../types/common.types';
6
7
  import * as i0 from "@angular/core";
@@ -9,7 +10,7 @@ export declare class CompilationService {
9
10
  private uiDefinitionMeta?;
10
11
  private elementsResolver?;
11
12
  constructor(injector: Injector);
12
- compileUIDefinition$(uiDefinition: UIDefinition): Observable<CompilationResult>;
13
+ compileUIDefinition$(uiDefinition: UIDefinition, config?: CMSPreviewConfig): Observable<CompilationResult>;
13
14
  compileElement$(element: ElementMetadata): Observable<CompilationResult>;
14
15
  clear(): void;
15
16
  private getModule;
@@ -1,15 +1,17 @@
1
1
  import { Patch } from 'rfc6902';
2
2
  import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
3
- import { RuntimeElementDeleted, RuntimeElementDropped } from '../types/runtime.actions';
3
+ import { RuntimeElementDeleteEvent, RuntimeElementDropEvent, RuntimeShowSettingsEvent } from '../types/runtime.actions';
4
4
  import { RuntimeService } from './runtime.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class RuntimeEditorService {
7
7
  private runtimeService;
8
8
  private editorModeSubj$;
9
- dragMode$: BehaviorSubject<boolean>;
10
- elementDropped$: ReplaySubject<RuntimeElementDropped>;
11
- elementDeleted$: ReplaySubject<RuntimeElementDeleted>;
9
+ onElementDropped$: ReplaySubject<RuntimeElementDropEvent>;
10
+ onElementDeleted$: ReplaySubject<RuntimeElementDeleteEvent>;
11
+ onElementSettingsToggled$: ReplaySubject<RuntimeShowSettingsEvent>;
12
12
  editorMode$: Observable<boolean>;
13
+ dragMode$: BehaviorSubject<boolean>;
14
+ selectedElementPath$: BehaviorSubject<string | null>;
13
15
  constructor(runtimeService: RuntimeService);
14
16
  applyPatch$(patch: Patch): Observable<void>;
15
17
  toggleEditorMode(): void;
@@ -4,18 +4,22 @@ import { Patch } from 'rfc6902';
4
4
  import { BehaviorSubject, Observable, Subject } from 'rxjs';
5
5
  import { CMSPreviewConfig } from '../../../components/preview/preview.types';
6
6
  import { Entity } from '../../../engine/models/entity';
7
+ import { IntegrationState } from '../../../services/integration.state';
7
8
  import { ElementMetadata } from '../../../types';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class RuntimeService {
10
11
  private injector;
12
+ private integrationState;
11
13
  moduleRefs: NgModuleRef<NgModule>[];
12
14
  componentTypes: Record<string, Type<Entity>>;
13
15
  applicationTree: ElementMetadata[];
14
16
  config?: CMSPreviewConfig;
15
17
  isInitialized$: BehaviorSubject<boolean>;
16
18
  updated$: Subject<void>;
19
+ selectedPageName$: BehaviorSubject<string | null>;
20
+ selectedOverlayNames$: BehaviorSubject<string[]>;
17
21
  private compilationService;
18
- constructor(injector: Injector);
22
+ constructor(injector: Injector, integrationState: IntegrationState);
19
23
  initialize$(uiDefinition?: UIDefinition, config?: CMSPreviewConfig): Observable<ElementMetadata[]>;
20
24
  applyPatch$(patch: Patch): Observable<void>;
21
25
  getCompiledElement$(path: string): Observable<ElementMetadata | undefined>;
@@ -1,9 +1,12 @@
1
1
  import { ElementMetadata } from '../../../types';
2
- export interface RuntimeElementDropped {
2
+ export interface RuntimeElementDropEvent {
3
3
  element: ElementMetadata;
4
4
  path: string;
5
5
  index: number;
6
6
  }
7
- export interface RuntimeElementDeleted {
7
+ export interface RuntimeElementDeleteEvent {
8
+ path: string;
9
+ }
10
+ export interface RuntimeShowSettingsEvent {
8
11
  path: string;
9
12
  }
@@ -0,0 +1,32 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { ElementComponent } from '../components/element.component';
3
+ import { PluginComponent } from '../components/plugin.component';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ElementHoverPlugin implements PluginComponent, OnDestroy {
6
+ host: ElementComponent;
7
+ private readonly hoverClassName;
8
+ private readonly metadata;
9
+ private readonly appRef;
10
+ private readonly el;
11
+ private readonly document;
12
+ private readonly runtimeEditorService;
13
+ private overlayEl?;
14
+ private isHovered$;
15
+ private isSelected$;
16
+ private destroyed$;
17
+ private mouseOverListenerBound;
18
+ private mouseLeaveListenerBound;
19
+ private clickListenerBound;
20
+ constructor(host: ElementComponent);
21
+ ngOnDestroy(): void;
22
+ private attachListeners;
23
+ private detachListeners;
24
+ private mouseOverListener;
25
+ private clickListener;
26
+ private mouseLeaveListener;
27
+ private addHighlight;
28
+ private removeHighlight;
29
+ private updateHighlight;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementHoverPlugin, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<ElementHoverPlugin>;
32
+ }
@@ -0,0 +1,15 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { ElementComponent } from '../components/element.component';
3
+ import { PluginComponent } from '../components/plugin.component';
4
+ import * as i0 from "@angular/core";
5
+ export declare class PagePlugin implements PluginComponent, OnDestroy {
6
+ host: ElementComponent;
7
+ private metadata;
8
+ private el;
9
+ private destroy$;
10
+ constructor(host: ElementComponent);
11
+ ngOnDestroy(): void;
12
+ private styleFullPage;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<PagePlugin, never>;
14
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PagePlugin, never, never, {}, {}, never, never, false, never>;
15
+ }
@@ -3,11 +3,8 @@ import { PluginComponent } from '../components/plugin.component';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ScriptPlugin implements PluginComponent {
5
5
  host: ElementComponent;
6
- private document;
7
- private vendorMap;
8
6
  constructor(host: ElementComponent);
9
7
  private addScript;
10
- private normalizeImports;
11
8
  static ɵfac: i0.ɵɵFactoryDeclaration<ScriptPlugin, never>;
12
9
  static ɵdir: i0.ɵɵDirectiveDeclaration<ScriptPlugin, never, never, {}, {}, never, never, false, never>;
13
10
  }
@@ -2,7 +2,8 @@ import { Dictionary } from 'lodash';
2
2
  import { Entity } from '../engine/models/entity';
3
3
  import { Plugin } from '../engine/models/plugin';
4
4
  import { PageLayout } from './layouts.types';
5
- export type ELEMENT_TYPE = 'CUSTOM' | 'CONTAINER' | 'SERVICE' | 'REFERENCE' | 'PAGE' | 'REGION';
5
+ import { PageType } from './pages.types';
6
+ export type ELEMENT_TYPE = 'CUSTOMIZATION_PAGE' | 'CUSTOM' | 'CONTAINER' | 'SERVICE' | 'REFERENCE' | 'PAGE' | 'REGION';
6
7
  export type ElementStyleDeclaration = Partial<CSSStyleDeclaration>;
7
8
  export interface ElementConfig {
8
9
  component: typeof Entity;
@@ -10,6 +11,9 @@ export interface ElementConfig {
10
11
  defaultTemplate?: string;
11
12
  suppressTemplate?: boolean;
12
13
  suppressStyles?: boolean;
14
+ builder?: {
15
+ suppressRemovable?: boolean;
16
+ };
13
17
  }
14
18
  export interface ElementModel {
15
19
  /**
@@ -104,6 +108,12 @@ export interface ElementDefaultMetadata {
104
108
  * Used only when `type === PAGE`
105
109
  */
106
110
  layout?: PageLayout;
111
+ /**
112
+ * Page Type
113
+ *
114
+ * Used only when `type === PAGE`
115
+ */
116
+ pageType?: PageType;
107
117
  }
108
118
  export interface ElementMetadata extends Omit<ElementDefaultMetadata, 'children'> {
109
119
  path: string;
@@ -3,4 +3,6 @@ export * from './common.types';
3
3
  export * from './configuration.types';
4
4
  export * from './elements.types';
5
5
  export * from './integration.types';
6
+ export * from './layouts.types';
7
+ export * from './pages.types';
6
8
  export * from './path.types';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * List of available layouts:
2
+ * List of available layouts for Full Page Type:
3
3
  *
4
4
  LAYOUT_1
5
5
  +-------------------------+
@@ -66,9 +66,35 @@
66
66
  | |
67
67
  | |
68
68
  +-------------------------+
69
+ */
70
+ /**
71
+ * List of available layouts for Sidepanel Page Type:
72
+ *
73
+ LAYOUT_7
74
+ +-------------------------+
75
+ | | |
76
+ | | |
77
+ | LEFT | DISABLED |
78
+ | SIDE | PAGE |
79
+ | PANEL | |
80
+ | | |
81
+ | | |
82
+ +-------------------------+
69
83
 
84
+ LAYOUT_8
85
+ +-------------------------+
86
+ | | |
87
+ | | |
88
+ | DISABLED | RIGHT |
89
+ | PAGE | SIDE |
90
+ | | PANEL |
91
+ | | |
92
+ | | |
93
+ +-------------------------+
70
94
  */
71
- export type PageLayout = 'LAYOUT_1' | 'LAYOUT_2' | 'LAYOUT_3' | 'LAYOUT_4' | 'LAYOUT_5' | 'LAYOUT_6';
95
+ export type FullPageLayout = 'LAYOUT_1' | 'LAYOUT_2' | 'LAYOUT_3' | 'LAYOUT_4' | 'LAYOUT_5' | 'LAYOUT_6';
96
+ export type SidepanelPageLayout = 'LAYOUT_7' | 'LAYOUT_8';
97
+ export type PageLayout = FullPageLayout | SidepanelPageLayout;
72
98
  export interface PageLayoutConfig {
73
99
  styles?: string;
74
100
  }
@@ -0,0 +1 @@
1
+ export type PageType = 'FULL_PAGE' | 'SIDEPANEL';
@@ -1,13 +1,16 @@
1
1
  import { Type } from '@angular/core';
2
2
  import { UIDefinitionMetadata } from '@veloceapps/sdk/core';
3
+ import { CMSPreviewConfig } from '../components/preview';
3
4
  import { Entity } from '../engine/models/entity';
4
5
  import { ElementMetadata } from '../types';
5
6
  export declare class ElementsResolver {
6
7
  private uiDef;
8
+ private config?;
7
9
  elements: ElementMetadata[];
8
10
  private renderableElements;
9
11
  private sharedElements;
10
- constructor(uiDef: UIDefinitionMetadata, elements: ElementMetadata[], sharedElements?: ElementMetadata[]);
12
+ private uiDefMetadata;
13
+ constructor(uiDef: UIDefinitionMetadata, elements: ElementMetadata[], sharedElements?: ElementMetadata[], config?: CMSPreviewConfig | undefined);
11
14
  addElement(element: ElementMetadata): void;
12
15
  getNgComponents(): Record<string, Type<Entity>>;
13
16
  private transpile;
@@ -23,4 +26,5 @@ export declare class ElementsResolver {
23
26
  private resolveElement;
24
27
  private getElementStyles;
25
28
  private convertInlineStylesToCSS;
29
+ private getDefaultCustomizationState;
26
30
  }
@@ -0,0 +1,2 @@
1
+ import { ElementMetadata } from '../types';
2
+ export declare const getScriptClass: (metadata?: ElementMetadata) => object | undefined;
@@ -1,9 +1,9 @@
1
1
  import * as angularCore from '@angular/core';
2
2
  import * as angularForms from '@angular/forms';
3
3
  import { CatalogApiService, ConfigurationSettingsApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, GuidedSellingApiService, PicklistsApiService, PriceApiService, QuoteApiService, RampApiService, SalesforceApiService, ShoppingCartSettingsApiService } from '@veloceapps/api';
4
- import { ToastService } from '@veloceapps/components';
4
+ import { ToastService, ToastType } from '@veloceapps/components';
5
5
  import { Operator, Predicate, parseJsonSafely } from '@veloceapps/core';
6
- import { ConfigurationService, ContextService, FlowConfigurationService, LineItemWorker, ProductImagesService, QuoteDraftService } from '@veloceapps/sdk/core';
6
+ import { ConfigurationService, ContextService, FlowConfigurationService, LineItemWorker, ProductImagesService, QuoteDraftService, RuntimeSettingsService } from '@veloceapps/sdk/core';
7
7
  import lodash from 'lodash';
8
8
  import * as rxjs from 'rxjs';
9
9
  import * as rxjsOperators from 'rxjs/operators';
@@ -25,6 +25,7 @@ export declare const vendorMap: {
25
25
  };
26
26
  '@veloceapps/components': {
27
27
  ToastService: typeof ToastService;
28
+ ToastType: typeof ToastType;
28
29
  };
29
30
  '@veloceapps/api': {
30
31
  SalesforceApiService: typeof SalesforceApiService;
@@ -45,7 +46,7 @@ export declare const vendorMap: {
45
46
  findLineItemWithComparator: (lineItems: import("@veloceapps/core").LineItem[], comparator: (li: import("@veloceapps/core").LineItem) => boolean) => import("@veloceapps/core").LineItem | undefined;
46
47
  insertLineItem: (lineItem: import("@veloceapps/core").LineItem, parentId: string, toInsert: import("@veloceapps/core").LineItem) => import("@veloceapps/core").LineItem;
47
48
  removeLineItem: (lineItem: import("@veloceapps/core").LineItem, idToRemove: string) => import("@veloceapps/core").LineItem;
48
- replaceLineItem: (lineItem: import("@veloceapps/core").LineItem, replaceTo: import("@veloceapps/core").LineItem) => import("@veloceapps/core").LineItem;
49
+ replaceLineItem: (lineItem: import("@veloceapps/core").LineItem, replaceTo: import("@veloceapps/core").LineItem, skipCardinalityCalculation?: boolean | undefined) => import("@veloceapps/core").LineItem;
49
50
  calculateCardinalityVariables: (lineItems: import("@veloceapps/core").LineItem[]) => Map<string, number>;
50
51
  recalculateCardinalityVariables: (original: import("@veloceapps/core").LineItem, updated: import("@veloceapps/core").LineItem) => import("@veloceapps/core").LineItem;
51
52
  mapAttributes: (attributes: import("@veloceapps/core").Attribute[]) => lodash.Dictionary<any>;
@@ -57,7 +58,7 @@ export declare const vendorMap: {
57
58
  patchAttributes: (rootLineItem: import("@veloceapps/core").LineItem, id: string, attrs: {
58
59
  name: string;
59
60
  value: any;
60
- }[]) => import("@veloceapps/core").LineItem;
61
+ }[], skipCardinalityCalculation?: boolean | undefined) => import("@veloceapps/core").LineItem;
61
62
  getAttributeValue: (attributes: import("@veloceapps/core").Attribute[], name: string) => any;
62
63
  generateLineItem: (port: string, type: string, parentId: string, attributes?: {
63
64
  name: string;
@@ -68,6 +69,8 @@ export declare const vendorMap: {
68
69
  list: number;
69
70
  };
70
71
  generateModifiedAssetsMap: (lineItems: import("@veloceapps/core").LineItem[]) => Record<string, boolean>;
72
+ getOriginParent: (lineItems: import("@veloceapps/core").LineItem[], currentLineItem: import("@veloceapps/core").LineItem) => import("@veloceapps/core").LineItem | undefined;
73
+ isLineItemModified: <T_1 extends Pick<import("@veloceapps/core").LineItem, "actionCode" | "status">>(lineItem: T_1) => boolean;
71
74
  multiplyLineItems: (lineItem: import("@veloceapps/core").LineItem, qty: number, split: boolean) => import("@veloceapps/core").LineItem[];
72
75
  ConfigurationService: typeof ConfigurationService;
73
76
  QuoteDraftService: typeof QuoteDraftService;
@@ -75,6 +78,7 @@ export declare const vendorMap: {
75
78
  LineItemWorker: typeof LineItemWorker;
76
79
  ProductImagesService: typeof ProductImagesService;
77
80
  ContextService: typeof ContextService;
81
+ RuntimeSettingsService: typeof RuntimeSettingsService;
78
82
  };
79
83
  '@veloceapps/sdk/cms': {
80
84
  TemplatesService: typeof TemplatesService;
@@ -99,9 +103,8 @@ export declare const vendorMap: {
99
103
  DEFAULT_PLUGINS_TOKEN: angularCore.InjectionToken<typeof import("./engine/models/plugin").Plugin[]>;
100
104
  UI_DEFINITION_METADATA: angularCore.InjectionToken<import("@veloceapps/sdk/core").UIDefinitionMetadata>;
101
105
  ELEMENT_METADATA: angularCore.InjectionToken<import("@veloceapps/sdk/cms").ElementMetadata>;
102
- SHARED_ELEMENT_METADATA: angularCore.InjectionToken<import("@veloceapps/sdk/cms").ElementMetadata>;
106
+ SHARED_ELEMENT_METADATA: angularCore.InjectionToken<import("@veloceapps/sdk/cms").ElementMetadata | undefined>;
103
107
  ELEMENT_CONFIG: angularCore.InjectionToken<import("@veloceapps/sdk/cms").ElementConfig>;
104
- VENDOR_MAP: angularCore.InjectionToken<lodash.Dictionary<any>>;
105
108
  };
106
109
  };
107
110
  export type VendorMap = typeof vendorMap;
@@ -1,5 +1,5 @@
1
1
  import { ConfigurationApiService } from '@veloceapps/api';
2
- import { Charge, CompiledPricePlan, ConfigurationContext, LineItem, RuntimeModel } from '@veloceapps/core';
2
+ import { Charge, CompiledPricePlan, ConfigurationContext, LineItem, PatchLineItemOptions, RuntimeModel } from '@veloceapps/core';
3
3
  import { Dictionary } from 'lodash';
4
4
  import { MessageService } from 'primeng/api';
5
5
  import { DialogService } from 'primeng/dynamicdialog';
@@ -24,8 +24,8 @@ export declare class ConfigurationService {
24
24
  hasUnsavedChanges: boolean;
25
25
  constructor(quoteDraftService: QuoteDraftService, runtimeService: ConfigurationRuntimeService, contextService: ContextService, configurationApiService: ConfigurationApiService, messageService: MessageService, dialogService: DialogService);
26
26
  reset(): void;
27
- patch$(lineItem: LineItem): Observable<LineItem>;
28
- patch(lineItem: LineItem): void;
27
+ patch$(lineItem: LineItem, options?: PatchLineItemOptions): Observable<LineItem>;
28
+ patch(lineItem: LineItem, options?: PatchLineItemOptions): void;
29
29
  setConfigurableRamp(lineItem: LineItem): void;
30
30
  get(): Observable<LineItem | undefined>;
31
31
  getSnapshot(): LineItem | undefined;
@@ -2,3 +2,4 @@ export * from './context.service';
2
2
  export * from './metric-calculation/metric-calculation.service';
3
3
  export * from './product-images.service';
4
4
  export * from './quote-draft.service';
5
+ export * from './runtime-settings.service';
@@ -0,0 +1,18 @@
1
+ import { ConfigurationSettingsApiService } from '@veloceapps/api';
2
+ import { RuntimeConfigurationSettings, RuntimeCurrencySettings } from '@veloceapps/core';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RuntimeSettingsService {
6
+ private configurationSettingsApiService;
7
+ private configurationSettings$;
8
+ private currencySettings$;
9
+ constructor(configurationSettingsApiService: ConfigurationSettingsApiService);
10
+ create(): Observable<void>;
11
+ initCurrency(iso?: string): void;
12
+ getConfigurationSettings(): RuntimeConfigurationSettings;
13
+ getCurrencySettings(): RuntimeCurrencySettings;
14
+ private parseConfigurationSettings;
15
+ private getCurrencySymbol;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeSettingsService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeSettingsService>;
18
+ }
@@ -3,6 +3,10 @@ export declare const UI_DEFINITION_VERSION = 3;
3
3
  export type UIExternalsType = Record<string, string | number | boolean>;
4
4
  export interface UIDefinitionProps {
5
5
  suppressToastMessages?: boolean;
6
+ /**
7
+ * When 'true', the Structure module in UI Builder is hidden
8
+ */
9
+ simplifiedEditorMode?: boolean;
6
10
  rootType?: string;
7
11
  pricingEnabled?: boolean;
8
12
  priceList?: string;
@@ -11,11 +15,12 @@ export interface UIDefinitionProps {
11
15
  export interface UIDefinitionMetadata {
12
16
  name: string;
13
17
  type: UIDefinitionType;
14
- properties?: UIDefinitionProps;
15
18
  primary: boolean;
19
+ version: number;
16
20
  createdTimestamp: number;
21
+ properties?: UIDefinitionProps;
17
22
  externals?: UIExternalsType;
18
- version: number;
23
+ customization?: any;
19
24
  }
20
25
  export interface UIDefinition extends UIDefinitionMetadata {
21
26
  /**
@@ -4,7 +4,7 @@ export declare const findLineItem: (id: string, lineItems: LineItem[]) => LineIt
4
4
  export declare const findLineItemWithComparator: (lineItems: LineItem[], comparator: (li: LineItem) => boolean) => LineItem | undefined;
5
5
  export declare const insertLineItem: (lineItem: LineItem, parentId: string, toInsert: LineItem) => LineItem;
6
6
  export declare const removeLineItem: (lineItem: LineItem, idToRemove: string) => LineItem;
7
- export declare const replaceLineItem: (lineItem: LineItem, replaceTo: LineItem) => LineItem;
7
+ export declare const replaceLineItem: (lineItem: LineItem, replaceTo: LineItem, skipCardinalityCalculation?: boolean) => LineItem;
8
8
  export declare const calculateCardinalityVariables: (lineItems: LineItem[]) => Map<string, number>;
9
9
  export declare const recalculateCardinalityVariables: (original: LineItem, updated: LineItem) => LineItem;
10
10
  export declare const mapAttributes: (attributes: Attribute[]) => Dictionary<any>;
@@ -16,7 +16,7 @@ export declare const upsertAttributes: (originalAttributes: Attribute[], attribu
16
16
  export declare const patchAttributes: (rootLineItem: LineItem, id: string, attrs: {
17
17
  name: string;
18
18
  value: any;
19
- }[]) => LineItem;
19
+ }[], skipCardinalityCalculation?: boolean) => LineItem;
20
20
  export declare const getAttributeValue: (attributes: Attribute[], name: string) => any;
21
21
  export declare const generateLineItem: (port: string, type: string, parentId: string, attributes?: {
22
22
  name: string;
@@ -27,4 +27,6 @@ export declare const getRecommendedPrices: (portDomain: PortDomain, type: string
27
27
  list: number;
28
28
  };
29
29
  export declare const generateModifiedAssetsMap: (lineItems: LineItem[]) => Record<string, boolean>;
30
+ export declare const getOriginParent: (lineItems: LineItem[], currentLineItem: LineItem) => LineItem | undefined;
31
+ export declare const isLineItemModified: <T extends Pick<LineItem, "actionCode" | "status">>(lineItem: T) => boolean;
30
32
  export declare const multiplyLineItems: (lineItem: LineItem, qty: number, split: boolean) => LineItem[];
@@ -4,9 +4,9 @@ export declare class LineItemWorker {
4
4
  constructor(src: LineItem);
5
5
  insert(parentId: string, toInsert: LineItem): LineItemWorker;
6
6
  remove(id: string): LineItemWorker;
7
- replace(toReplace: LineItem): LineItemWorker;
7
+ replace(toReplace: LineItem, skipCardinalityCalculation?: boolean): LineItemWorker;
8
8
  patchAttribute(attrs: {
9
9
  name: string;
10
10
  value: any;
11
- }[], id?: string): LineItemWorker;
11
+ }[], id?: string, skipCardinalityCalculation?: boolean): LineItemWorker;
12
12
  }