@veloceapps/sdk 7.0.2-9 → 7.0.2-90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. package/cms/cms.actions.d.ts +102 -11
  2. package/cms/cms.default.d.ts +2 -2
  3. package/cms/components/element-children/element-children.component.d.ts +3 -1
  4. package/cms/components/element-tools-panel/element-tools-panel.component.d.ts +14 -0
  5. package/cms/components/preview/preview.component.d.ts +10 -12
  6. package/cms/components/preview/preview.module.d.ts +2 -1
  7. package/cms/components/preview/preview.types.d.ts +9 -0
  8. package/cms/definitions/index.d.ts +1 -0
  9. package/cms/definitions/ui-builder.definitions.d.ts +6 -0
  10. package/cms/index.d.ts +2 -0
  11. package/cms/injection-tokens.d.ts +2 -4
  12. package/cms/modules/migrations/services/migrations.service.d.ts +1 -1
  13. package/cms/modules/migrations/types/migrations.types.d.ts +1 -1
  14. package/cms/modules/runtime/index.d.ts +1 -0
  15. package/cms/modules/runtime/services/compilation.service.d.ts +3 -2
  16. package/cms/modules/runtime/services/runtime-editor.service.d.ts +6 -4
  17. package/cms/modules/runtime/services/runtime.service.d.ts +6 -2
  18. package/cms/modules/runtime/types/runtime.actions.d.ts +5 -2
  19. package/cms/plugins/element-hover.plugin.d.ts +33 -0
  20. package/cms/plugins/page.plugin.d.ts +15 -0
  21. package/cms/plugins/script.plugin.d.ts +0 -3
  22. package/cms/services/resources.service.d.ts +9 -0
  23. package/cms/types/common.types.d.ts +11 -1
  24. package/cms/types/index.d.ts +2 -0
  25. package/cms/types/integration.types.d.ts +1 -0
  26. package/cms/types/layouts.types.d.ts +30 -2
  27. package/cms/types/pages.types.d.ts +1 -0
  28. package/cms/utils/element.utils.d.ts +1 -1
  29. package/cms/utils/elements-resolver.d.ts +6 -2
  30. package/cms/utils/encoding.utils.d.ts +2 -0
  31. package/cms/utils/index.d.ts +1 -0
  32. package/cms/utils/script.utils.d.ts +2 -0
  33. package/cms/utils/ui-builder-layout.utils.d.ts +4 -0
  34. package/cms/vendor-map.d.ts +16 -19
  35. package/core/core.module.d.ts +2 -0
  36. package/core/directives/directives.module.d.ts +7 -0
  37. package/core/directives/index.d.ts +2 -0
  38. package/core/directives/primeng-calendar.directive.d.ts +14 -0
  39. package/core/index.d.ts +2 -0
  40. package/core/modules/configuration/helpers.d.ts +4 -2
  41. package/core/modules/configuration/index.d.ts +2 -0
  42. package/core/modules/configuration/services/configuration-runtime.service.d.ts +5 -4
  43. package/core/modules/configuration/services/configuration.service.d.ts +13 -7
  44. package/core/modules/configuration/services/configuration.state.d.ts +30 -0
  45. package/core/modules/configuration/services/runtime-context.service.d.ts +1 -1
  46. package/core/modules/configuration/types/configuration-runtime.types.d.ts +1 -0
  47. package/core/modules/configuration/types/configuration.types.d.ts +10 -0
  48. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +2 -1
  49. package/core/pipes/date.pipe.d.ts +12 -0
  50. package/core/pipes/index.d.ts +4 -0
  51. package/core/pipes/number.pipe.d.ts +10 -0
  52. package/core/pipes/pipes.module.d.ts +9 -0
  53. package/core/pipes/price.pipe.d.ts +10 -0
  54. package/core/services/index.d.ts +1 -0
  55. package/core/services/runtime-settings.service.d.ts +21 -0
  56. package/core/types/formatting-settings.types.d.ts +11 -0
  57. package/core/types/index.d.ts +1 -0
  58. package/core/types/runtime.types.d.ts +2 -3
  59. package/core/types/ui-definition.types.d.ts +1 -41
  60. package/core/utils/line-item.utils.d.ts +10 -15
  61. package/core/utils/line-item.worker.d.ts +3 -6
  62. package/core/utils/ui-definition.utils.d.ts +1 -1
  63. package/esm2020/cms/cms.actions.mjs +140 -40
  64. package/esm2020/cms/cms.default.mjs +1 -1
  65. package/esm2020/cms/cms.elements.mjs +16 -4
  66. package/esm2020/cms/cms.layouts.mjs +73 -13
  67. package/esm2020/cms/components/element-children/element-children.component.mjs +11 -6
  68. package/esm2020/cms/components/element-drop-handle/element-drop-handle.component.mjs +2 -2
  69. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +35 -0
  70. package/esm2020/cms/components/preview/preview.component.mjs +30 -48
  71. package/esm2020/cms/components/preview/preview.module.mjs +22 -4
  72. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  73. package/esm2020/cms/definitions/index.mjs +2 -0
  74. package/esm2020/cms/definitions/ui-builder.definitions.mjs +18 -0
  75. package/esm2020/cms/index.mjs +3 -1
  76. package/esm2020/cms/injection-tokens.mjs +1 -2
  77. package/esm2020/cms/modules/migrations/migrations.mjs +10 -3
  78. package/esm2020/cms/modules/migrations/services/migrations.service.mjs +1 -1
  79. package/esm2020/cms/modules/migrations/types/migrations.types.mjs +1 -1
  80. package/esm2020/cms/modules/runtime/index.mjs +2 -1
  81. package/esm2020/cms/modules/runtime/services/compilation.service.mjs +5 -3
  82. package/esm2020/cms/modules/runtime/services/runtime-editor.service.mjs +5 -3
  83. package/esm2020/cms/modules/runtime/services/runtime.service.mjs +41 -6
  84. package/esm2020/cms/modules/runtime/types/runtime.actions.mjs +1 -1
  85. package/esm2020/cms/plugins/element-hover.plugin.mjs +121 -0
  86. package/esm2020/cms/plugins/page.plugin.mjs +37 -0
  87. package/esm2020/cms/plugins/region.plugin.mjs +3 -2
  88. package/esm2020/cms/plugins/script.plugin.mjs +6 -40
  89. package/esm2020/cms/services/integration.state.mjs +3 -6
  90. package/esm2020/cms/services/io-provider.service.mjs +7 -5
  91. package/esm2020/cms/services/resources.service.mjs +19 -1
  92. package/esm2020/cms/types/common.types.mjs +1 -1
  93. package/esm2020/cms/types/index.mjs +3 -1
  94. package/esm2020/cms/types/integration.types.mjs +1 -1
  95. package/esm2020/cms/types/layouts.types.mjs +70 -1
  96. package/esm2020/cms/types/pages.types.mjs +2 -0
  97. package/esm2020/cms/utils/element.utils.mjs +9 -9
  98. package/esm2020/cms/utils/elements-resolver.mjs +22 -8
  99. package/esm2020/cms/utils/encoding.utils.mjs +28 -0
  100. package/esm2020/cms/utils/index.mjs +2 -1
  101. package/esm2020/cms/utils/script.utils.mjs +42 -0
  102. package/esm2020/cms/utils/ui-builder-layout.utils.mjs +46 -0
  103. package/esm2020/cms/vendor-map.mjs +6 -3
  104. package/esm2020/core/core.module.mjs +33 -4
  105. package/esm2020/core/directives/directives.module.mjs +16 -0
  106. package/esm2020/core/directives/index.mjs +3 -0
  107. package/esm2020/core/directives/primeng-calendar.directive.mjs +41 -0
  108. package/esm2020/core/index.mjs +3 -1
  109. package/esm2020/core/modules/configuration/configuration.module.mjs +5 -2
  110. package/esm2020/core/modules/configuration/helpers.mjs +37 -7
  111. package/esm2020/core/modules/configuration/index.mjs +3 -1
  112. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +28 -19
  113. package/esm2020/core/modules/configuration/services/configuration.service.mjs +68 -28
  114. package/esm2020/core/modules/configuration/services/configuration.state.mjs +142 -0
  115. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +10 -17
  116. package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +1 -1
  117. package/esm2020/core/modules/configuration/types/configuration.types.mjs +2 -0
  118. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +4 -4
  119. package/esm2020/core/pipes/date.pipe.mjs +38 -0
  120. package/esm2020/core/pipes/index.mjs +5 -0
  121. package/esm2020/core/pipes/number.pipe.mjs +27 -0
  122. package/esm2020/core/pipes/pipes.module.mjs +18 -0
  123. package/esm2020/core/pipes/price.pipe.mjs +30 -0
  124. package/esm2020/core/services/index.mjs +2 -1
  125. package/esm2020/core/services/quote-draft.service.mjs +1 -1
  126. package/esm2020/core/services/runtime-settings.service.mjs +95 -0
  127. package/esm2020/core/types/formatting-settings.types.mjs +3 -0
  128. package/esm2020/core/types/index.mjs +2 -1
  129. package/esm2020/core/types/runtime.types.mjs +1 -1
  130. package/esm2020/core/types/ui-definition.types.mjs +2 -2
  131. package/esm2020/core/utils/line-item.utils.mjs +24 -11
  132. package/esm2020/core/utils/line-item.worker.mjs +5 -5
  133. package/esm2020/core/utils/ui-definition.utils.mjs +1 -1
  134. package/esm2020/runtime/components/ui-runtime-preview/runtime-preview.component.mjs +2 -2
  135. package/esm2020/runtime/services/runtime-context.service.mjs +8 -5
  136. package/esm2020/runtime/services/runtime.service.mjs +1 -1
  137. package/esm2020/runtime/types/runtime.types.mjs +1 -1
  138. package/esm2020/src/components/dialog/dialog.component.mjs +3 -3
  139. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +34 -15
  140. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +114 -0
  141. package/esm2020/src/components/guided-selling/guided-selling.module.mjs +19 -0
  142. package/esm2020/src/components/header/cart-overlay/cart-preview.component.mjs +5 -6
  143. package/esm2020/src/components/header/cart-overlay/cart-preview.module.mjs +7 -4
  144. package/esm2020/src/components/header/header.component.mjs +46 -36
  145. package/esm2020/src/components/header/header.module.mjs +7 -3
  146. package/esm2020/src/components/header/metrics/metrics.component.mjs +35 -7
  147. package/esm2020/src/components/header/metrics/metrics.module.mjs +7 -3
  148. package/esm2020/src/flow-routing.module.mjs +1 -1
  149. package/esm2020/src/flow.component.mjs +4 -3
  150. package/esm2020/src/flow.module.mjs +11 -6
  151. package/esm2020/src/guards/context.guard.mjs +11 -8
  152. package/esm2020/src/pages/assets/assets.component.mjs +3 -3
  153. package/esm2020/src/pages/catalog/catalog.component.mjs +4 -4
  154. package/esm2020/src/pages/legacy-product/legacy-product.component.mjs +4 -4
  155. package/esm2020/src/pages/product/product.component.mjs +52 -61
  156. package/esm2020/src/pages/remote/remote.component.mjs +19 -19
  157. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +4 -4
  158. package/esm2020/src/services/flow-dialog.service.mjs +15 -15
  159. package/esm2020/src/services/flow-router.service.mjs +10 -5
  160. package/esm2020/src/services/flow.service.mjs +2 -2
  161. package/esm2020/src/services/guided-selling.service.mjs +33 -0
  162. package/esm2020/src/types/flow-customization.types.mjs +1 -1
  163. package/fesm2015/veloceapps-sdk-cms.mjs +947 -440
  164. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  165. package/fesm2015/veloceapps-sdk-core.mjs +579 -90
  166. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  167. package/fesm2015/veloceapps-sdk-runtime.mjs +7 -4
  168. package/fesm2015/veloceapps-sdk-runtime.mjs.map +1 -1
  169. package/fesm2015/veloceapps-sdk.mjs +435 -216
  170. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  171. package/fesm2020/veloceapps-sdk-cms.mjs +1027 -442
  172. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  173. package/fesm2020/veloceapps-sdk-core.mjs +564 -86
  174. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  175. package/fesm2020/veloceapps-sdk-runtime.mjs +7 -4
  176. package/fesm2020/veloceapps-sdk-runtime.mjs.map +1 -1
  177. package/fesm2020/veloceapps-sdk.mjs +424 -212
  178. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  179. package/package.json +1 -1
  180. package/runtime/components/ui-runtime-preview/runtime-preview.component.d.ts +3 -3
  181. package/runtime/services/runtime.service.d.ts +2 -2
  182. package/runtime/types/runtime.types.d.ts +2 -2
  183. package/src/components/doc-gen/doc-gen.component.d.ts +8 -7
  184. package/src/components/guided-selling/guided-selling.component.d.ts +27 -0
  185. package/src/components/guided-selling/guided-selling.module.d.ts +9 -0
  186. package/src/components/header/cart-overlay/cart-preview.component.d.ts +1 -1
  187. package/src/components/header/cart-overlay/cart-preview.module.d.ts +1 -1
  188. package/src/components/header/header.component.d.ts +3 -4
  189. package/src/components/header/header.module.d.ts +2 -1
  190. package/src/components/header/metrics/metrics.component.d.ts +10 -2
  191. package/src/components/header/metrics/metrics.module.d.ts +2 -1
  192. package/src/flow.module.d.ts +6 -5
  193. package/src/guards/context.guard.d.ts +3 -2
  194. package/src/pages/assets/assets.component.d.ts +2 -1
  195. package/src/pages/catalog/catalog.component.d.ts +2 -1
  196. package/src/pages/product/product.component.d.ts +13 -21
  197. package/src/pages/remote/remote.component.d.ts +4 -4
  198. package/src/pages/shopping-cart/shopping-cart.component.d.ts +2 -1
  199. package/src/services/flow-router.service.d.ts +3 -1
  200. package/src/services/guided-selling.service.d.ts +13 -0
  201. package/src/types/flow-customization.types.d.ts +4 -4
@@ -1,36 +1,127 @@
1
1
  import { IntegrationAction } from './types';
2
- export declare enum FlowAction {
3
- FLOW_CONFIGURE_PRODUCT = "FLOW_CONFIGURE_PRODUCT",
4
- FLOW_NAVIGATE_BACK = "FLOW_NAVIGATE_BACK",
5
- FLOW_NAVIGATE_TO_CATALOG = "FLOW_NAVIGATE_TO_CATALOG",
6
- FLOW_APPLY_PRODUCT_CONFIGURATION = "FLOW_APPLY_PRODUCT_CONFIGURATION",
7
- FLOW_OPEN_DOC_GEN = "FLOW_OPEN_DOC_GEN",
8
- FLOW_CLOSE_DOC_GEN = "FLOW_CLOSE_DOC_GEN",
9
- FLOW_SWITCH_OBJECT = "FLOW_SWITCH_OBJECT",
10
- REMOTE_APPLY = "REMOTE_APPLY",
11
- REMOTE_CANCEL = "REMOTE_CANCEL"
2
+ export declare namespace FlowAction {
3
+ const FLOW_CONFIGURE_PRODUCT = "[FLOW]_CONFIGURE_PRODUCT";
4
+ const FLOW_NAVIGATE_BACK = "[FLOW]_NAVIGATE_BACK";
5
+ const FLOW_NAVIGATE_TO_CATALOG = "[FLOW]_NAVIGATE_TO_CATALOG";
6
+ const FLOW_APPLY_PRODUCT_CONFIGURATION = "[FLOW]_APPLY_PRODUCT_CONFIGURATION";
7
+ const FLOW_OPEN_DOC_GEN = "[FLOW]_OPEN_DOC_GEN";
8
+ const FLOW_CLOSE_DOC_GEN = "[FLOW]_CLOSE_DOC_GEN";
9
+ const FLOW_SWITCH_OBJECT = "[FLOW]_SWITCH_OBJECT";
10
+ const REMOTE_APPLY = "[FLOW]_REMOTE_APPLY";
11
+ const REMOTE_CANCEL = "[FLOW]_REMOTE_CANCEL";
12
+ const OPEN_GUIDED_SELLING = "[FLOW]_OPEN_GUIDED_SELLING";
13
+ const SUBMIT_GUIDED_SELLING = "[FLOW]_SUBMIT_GUIDED_SELLING";
14
+ const CLOSE_GUIDED_SELLING = "[FLOW]_CLOSE_GUIDED_SELLING";
15
+ const ConfigureProductAction: ({ lineItemId, productId, }: {
16
+ lineItemId?: string | undefined;
17
+ productId?: string | undefined;
18
+ }) => IntegrationAction;
19
+ const NavigateBackAction: () => IntegrationAction;
20
+ const NavigateToCatalogAction: () => IntegrationAction;
21
+ const ApplyProductConfigurationAction: () => IntegrationAction;
22
+ const OpenDocGenAction: () => IntegrationAction;
23
+ const CloseDocGenAction: () => IntegrationAction;
24
+ const RemoteApplyAction: () => IntegrationAction;
25
+ const RemoteCancelAction: () => IntegrationAction;
26
+ const SwitchObjectAction: (payload: {
27
+ id: string;
28
+ }) => IntegrationAction;
29
+ const OpenGuidedSelling: (payload: {
30
+ guidedSellingId: string;
31
+ }) => IntegrationAction;
32
+ const CloseGuidedSelling: (payload?: {
33
+ keepState?: boolean;
34
+ }) => IntegrationAction;
35
+ const SubmitGuidedSelling: (payload: {
36
+ result: Record<string, any>;
37
+ }) => IntegrationAction;
12
38
  }
39
+ /**
40
+ * @deprecated
41
+ * Use FlowAction namespace instead
42
+ */
13
43
  export declare const ConfigureProductAction: ({ lineItemId, productId, }: {
14
44
  lineItemId?: string | undefined;
15
45
  productId?: string | undefined;
16
46
  }) => IntegrationAction;
47
+ /**
48
+ * @deprecated
49
+ * Use FlowAction namespace instead
50
+ */
17
51
  export declare const NavigateBackAction: () => IntegrationAction;
52
+ /**
53
+ * @deprecated
54
+ * Use FlowAction namespace instead
55
+ */
18
56
  export declare const NavigateToCatalogAction: () => IntegrationAction;
57
+ /**
58
+ * @deprecated
59
+ * Use FlowAction namespace instead
60
+ */
19
61
  export declare const ApplyProductConfigurationAction: () => IntegrationAction;
62
+ /**
63
+ * @deprecated
64
+ * Use FlowAction namespace instead
65
+ */
20
66
  export declare const OpenDocGenAction: () => IntegrationAction;
67
+ /**
68
+ * @deprecated
69
+ * Use FlowAction namespace instead
70
+ */
21
71
  export declare const CloseDocGenAction: () => IntegrationAction;
72
+ /**
73
+ * @deprecated
74
+ * Use FlowAction namespace instead
75
+ */
22
76
  export declare const RemoteApplyAction: () => IntegrationAction;
77
+ /**
78
+ * @deprecated
79
+ * Use FlowAction namespace instead
80
+ */
23
81
  export declare const RemoteCancelAction: () => IntegrationAction;
82
+ /**
83
+ * @deprecated
84
+ * Use FlowAction namespace instead
85
+ */
24
86
  export declare const SwitchObjectAction: (payload: {
25
87
  id: string;
26
88
  }) => IntegrationAction;
27
89
  export declare namespace CmsAction {
28
90
  const GO_TO_PAGE = "[CMS]_GO_TO_PAGE";
91
+ const UPDATE_CUSTOMIZATION = "[CMS]_UPDATE_CUSTOMIZATION";
92
+ const SHOW_OVERLAY = "[CMS]_SHOW_OVERLAY";
93
+ const HIDE_OVERLAY = "[CMS]_HIDE_OVERLAY";
94
+ const HIDE_ALL_OVERLAYS = "[CMS]_HIDE_ALL_OVERLAYS";
29
95
  /**
30
96
  * Navigate UI definition to a specific page
31
97
  *
32
98
  * @param pageName name of the page
33
- * @returns void
34
99
  */
35
100
  const GoToPage: (pageName: string) => IntegrationAction;
101
+ /**
102
+ * Update UI definition customization state
103
+ *
104
+ * @param pageName name of the page
105
+ */
106
+ const UpdateCustomization: (value: any) => IntegrationAction;
107
+ /**
108
+ * Show an Overlay on the selected page
109
+ *
110
+ * @param name - name of the overlay
111
+ * @returns void
112
+ */
113
+ const ShowOverlay: (name: string) => IntegrationAction;
114
+ /**
115
+ * Hide an Overlay on the selected page
116
+ *
117
+ * @param name - name of the overlay
118
+ * @returns void
119
+ */
120
+ const HideOverlay: (name: string) => IntegrationAction;
121
+ /**
122
+ * Hide all Overlays on the selected page
123
+ *
124
+ * @returns void
125
+ */
126
+ const HideAllOverlays: () => IntegrationAction;
36
127
  }
@@ -1,5 +1,5 @@
1
- import { UIDefinitionType } from '@veloceapps/sdk/core';
1
+ import { UIDefinitionType } from '@veloceapps/core';
2
2
  import { Plugin } from './engine/models/plugin';
3
3
  export declare const DEFAULT_PLUGINS: {
4
- [key in UIDefinitionType]: typeof Plugin[];
4
+ [key in UIDefinitionType]: (typeof Plugin)[];
5
5
  };
@@ -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
+ }
@@ -1,6 +1,7 @@
1
- import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
- import { ConfigurationRuntimeService, ConfigurationService, UIDefinition } from '@veloceapps/sdk/core';
3
- import { MessageService } from 'primeng/api';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { ToastService } from '@veloceapps/components';
3
+ import { UIDefinition } from '@veloceapps/core';
4
+ import { ConfigurationState } from '@veloceapps/sdk/core';
4
5
  import { BehaviorSubject, Observable } from 'rxjs';
5
6
  import { RuntimeService } from '../../modules/runtime/services/runtime.service';
6
7
  import { IntegrationState } from '../../services';
@@ -13,24 +14,21 @@ interface State {
13
14
  }
14
15
  export declare class PreviewComponent implements OnInit, OnDestroy {
15
16
  private runtimeService;
16
- private configurationService;
17
- private messageService;
18
- private configurationRuntimeService;
17
+ private configurationState;
18
+ private toastService;
19
19
  private integrationState;
20
- private cdr;
21
- modelId?: string;
22
20
  uiDefinition?: UIDefinition;
23
21
  config?: CMSPreviewConfig;
24
22
  state$: BehaviorSubject<State>;
25
23
  elements$: Observable<ElementMetadata[]>;
26
24
  private destroy$;
27
- constructor(runtimeService: RuntimeService, configurationService: ConfigurationService, messageService: MessageService, configurationRuntimeService: ConfigurationRuntimeService, integrationState: IntegrationState, cdr: ChangeDetectorRef);
25
+ constructor(runtimeService: RuntimeService, configurationState: ConfigurationState, toastService: ToastService, integrationState: IntegrationState);
28
26
  ngOnInit(): void;
29
27
  ngOnDestroy(): void;
30
- trackBy(_: number, el: ElementMetadata): string;
31
- private initializeConfiguration$;
28
+ trackBy(_: number, el: ElementMetadata): ElementMetadata;
32
29
  private startPreview;
30
+ private getPages$;
33
31
  static ɵfac: i0.ɵɵFactoryDeclaration<PreviewComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "vl-cms-preview", never, { "modelId": "modelId"; "uiDefinition": "uiDefinition"; "config": "config"; }, {}, never, never, false, never>;
32
+ static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "vl-cms-preview", never, { "uiDefinition": "uiDefinition"; "config": "config"; }, {}, never, never, false, never>;
35
33
  }
36
34
  export {};
@@ -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
  }
@@ -1,3 +1,4 @@
1
+ import { Observable } from 'rxjs';
1
2
  export interface CMSPreviewConfig {
2
3
  /**
3
4
  * When `true`, IntegrationState will be cleared on component init
@@ -8,4 +9,12 @@ export interface CMSPreviewConfig {
8
9
  * (like element hover/selection or Drag&Drop zones)
9
10
  */
10
11
  uiBuilderMode?: boolean;
12
+ /**
13
+ * When `true`, preview renders settings page (element with `type: CUSTOMIZATION_PAGE`)
14
+ */
15
+ customizationMode?: boolean;
16
+ /**
17
+ * Custom initialization function which will be executed before starting a preview
18
+ */
19
+ init$?: () => Observable<void>;
11
20
  }
@@ -0,0 +1 @@
1
+ export * from './ui-builder.definitions';
@@ -0,0 +1,6 @@
1
+ import { ElementMetadata, ElementStyleDeclaration, FullPageLayout, PageType } from '../types';
2
+ export declare const DEFAULT_ELEMENT: Partial<ElementMetadata>;
3
+ export declare const STARTING_PAGE_NAME = "Starting Page";
4
+ export declare const STARTING_PAGE_TYPE: PageType;
5
+ export declare const STARTING_PAGE_LAYOUT: FullPageLayout;
6
+ export declare const STARTING_PAGE_STYLES: ElementStyleDeclaration;
package/cms/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from './cms.actions';
2
+ export * from './cms.layouts';
2
3
  export * from './components';
3
4
  export * from './components/preview';
4
5
  export * from './decorators';
6
+ export * from './definitions';
5
7
  export * from './injection-tokens';
6
8
  export * from './launcher.module';
7
9
  export * from './modules/federated/export';
@@ -1,11 +1,9 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- import { UIDefinitionMetadata } from '@veloceapps/sdk/core';
3
- import { Dictionary } from 'lodash';
2
+ import { UIDefinitionMetadata } from '@veloceapps/core';
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,5 +1,5 @@
1
1
  import { ToastService } from '@veloceapps/components';
2
- import { UIDefinition } from '@veloceapps/sdk/core';
2
+ import { UIDefinition } from '@veloceapps/core';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class MigrationsService {
5
5
  private toastService;
@@ -1,2 +1,2 @@
1
- import { UIDefinition } from '@veloceapps/sdk/core';
1
+ import { UIDefinition } from '@veloceapps/core';
2
2
  export type UIDefinitionMigrationFn = (uiDef: UIDefinition) => UIDefinition;
@@ -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
- import { UIDefinition } from '@veloceapps/sdk/core';
2
+ import { UIDefinition } from '@veloceapps/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;
@@ -1,21 +1,25 @@
1
1
  import { Injector, NgModule, NgModuleRef, Type } from '@angular/core';
2
- import { UIDefinition } from '@veloceapps/sdk/core';
2
+ import { UIDefinition } from '@veloceapps/core';
3
3
  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,33 @@
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 listenersAttached;
18
+ private mouseOverListenerBound;
19
+ private mouseLeaveListenerBound;
20
+ private clickListenerBound;
21
+ constructor(host: ElementComponent);
22
+ ngOnDestroy(): void;
23
+ private attachListeners;
24
+ private detachListeners;
25
+ private mouseOverListener;
26
+ private clickListener;
27
+ private mouseLeaveListener;
28
+ private addHighlight;
29
+ private removeHighlight;
30
+ private updateHighlight;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementHoverPlugin, never>;
32
+ static ɵprov: i0.ɵɵInjectableDeclaration<ElementHoverPlugin>;
33
+ }
@@ -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
  }
@@ -3,8 +3,17 @@ import * as i0 from "@angular/core";
3
3
  export declare class ResourcesService {
4
4
  private scripts;
5
5
  private loaded$;
6
+ /**
7
+ * ngx-monaco-editor adds amd-loader library for loading resources when first time initialized
8
+ * Which breaks further loading of 3rd party libaries.
9
+ *
10
+ * To handle this issue, in case 'amd' is defined, we clear it, and then restore when the script is loaded
11
+ */
12
+ private amd;
6
13
  loadScript(url: string): Observable<void>;
7
14
  loadStyles(url: string): Observable<void>;
15
+ private persistAMDLoader;
16
+ private restoreAMDLoader;
8
17
  static ɵfac: i0.ɵɵFactoryDeclaration<ResourcesService, never>;
9
18
  static ɵprov: i0.ɵɵInjectableDeclaration<ResourcesService>;
10
19
  }
@@ -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';
@@ -4,6 +4,7 @@ export interface IntegrationAction<T = any> {
4
4
  payload?: T;
5
5
  }
6
6
  export type IntegrationStateModel = {
7
+ guidedSelling?: Dictionary<any>;
7
8
  modifiedAssets: Dictionary<boolean>;
8
9
  flowPath: string;
9
10
  } & Dictionary<any>;
@@ -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,37 @@
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 {
99
+ hasHeader: boolean;
100
+ hasFooter: boolean;
73
101
  styles?: string;
74
102
  }
@@ -0,0 +1 @@
1
+ export type PageType = 'FULL_PAGE' | 'SIDEPANEL';
@@ -1,4 +1,4 @@
1
- import { UIElement } from '@veloceapps/sdk/core';
1
+ import { UIElement } from '@veloceapps/core';
2
2
  import { ELEMENT_TYPE, ElementConfig, ElementDefaultMetadata, ElementMetadata } from '../types';
3
3
  export declare class UiBuildError extends Error {
4
4
  affectedMetadata: ElementMetadata;
@@ -1,13 +1,16 @@
1
1
  import { Type } from '@angular/core';
2
- import { UIDefinitionMetadata } from '@veloceapps/sdk/core';
2
+ import { UIDefinitionMetadata } from '@veloceapps/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
+ export declare function btoaSafe(str?: string): string;
2
+ export declare function atobSafe(str?: string): string;
@@ -1,4 +1,5 @@
1
1
  export * from './element.utils';
2
2
  export * from './elements-resolver';
3
3
  export * from './path.utils';
4
+ export * from './ui-builder-layout.utils';
4
5
  export * from './ui-definition.utils';
@@ -0,0 +1,2 @@
1
+ import { ElementMetadata } from '../types';
2
+ export declare const getScriptClass: (metadata?: ElementMetadata) => object | undefined;
@@ -0,0 +1,4 @@
1
+ import { ElementMetadata, ElementStyleDeclaration, PageLayout, PageType } from '../types';
2
+ export declare const constructPageChildren: (path: string, layout: PageLayout) => ElementMetadata[];
3
+ export declare const constructRegion: (name: string, parentPath: string) => ElementMetadata;
4
+ export declare const constructPage: (name: string, pageType: PageType, layout: PageLayout, configuredStyles?: ElementStyleDeclaration) => ElementMetadata;