@veloceapps/sdk 6.0.0-9 → 6.0.0-91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. package/README.md +10 -2
  2. package/bundles/veloceapps-sdk-cms.umd.js +1268 -798
  3. package/bundles/veloceapps-sdk-cms.umd.js.map +1 -1
  4. package/bundles/veloceapps-sdk-core.umd.js +821 -713
  5. package/bundles/veloceapps-sdk-core.umd.js.map +1 -1
  6. package/bundles/veloceapps-sdk-runtime.umd.js +216 -150
  7. package/bundles/veloceapps-sdk-runtime.umd.js.map +1 -1
  8. package/bundles/veloceapps-sdk.umd.js +385 -302
  9. package/bundles/veloceapps-sdk.umd.js.map +1 -1
  10. package/cms/cms.actions.d.ts +2 -4
  11. package/cms/components/element-children/element-children.component.d.ts +13 -3
  12. package/cms/components/element-children/element-children.module.d.ts +4 -2
  13. package/cms/components/element-drop-handle/element-drop-handle.component.d.ts +12 -0
  14. package/cms/components/element-drop-handle/element-drop-handle.module.d.ts +9 -0
  15. package/cms/components/element-renderer/element-renderer.component.d.ts +3 -3
  16. package/cms/components/preview/index.d.ts +1 -0
  17. package/cms/components/preview/preview.component.d.ts +9 -8
  18. package/cms/components/preview/preview.module.d.ts +2 -1
  19. package/cms/components/preview/preview.types.d.ts +11 -0
  20. package/cms/index.d.ts +2 -0
  21. package/cms/launcher.module.d.ts +3 -1
  22. package/cms/modules/migrations/index.d.ts +2 -0
  23. package/cms/modules/migrations/migrations.d.ts +2 -0
  24. package/cms/modules/migrations/migrations.module.d.ts +6 -0
  25. package/cms/modules/migrations/services/migrations.service.d.ts +10 -0
  26. package/cms/modules/migrations/types/migrations.types.d.ts +2 -0
  27. package/cms/modules/runtime/index.d.ts +2 -0
  28. package/cms/modules/runtime/runtime.module.d.ts +8 -0
  29. package/cms/modules/runtime/services/compilation.service.d.ts +18 -0
  30. package/cms/modules/runtime/services/runtime-editor.service.d.ts +18 -0
  31. package/cms/modules/runtime/services/runtime.service.d.ts +27 -0
  32. package/cms/modules/runtime/tokens.d.ts +3 -0
  33. package/cms/{types → modules/runtime/types}/compilation.types.d.ts +1 -1
  34. package/cms/modules/runtime/types/runtime.actions.d.ts +9 -0
  35. package/cms/services/index.d.ts +1 -1
  36. package/cms/services/io-provider.service.d.ts +3 -3
  37. package/cms/services/resources.service.d.ts +10 -0
  38. package/cms/types/common.types.d.ts +1 -1
  39. package/cms/types/configuration.types.d.ts +1 -0
  40. package/cms/types/index.d.ts +1 -1
  41. package/cms/utils/elements-resolver.d.ts +3 -2
  42. package/cms/utils/index.d.ts +1 -0
  43. package/cms/utils/path.utils.d.ts +0 -1
  44. package/cms/utils/ui-definition.utils.d.ts +6 -0
  45. package/cms/vendor-map.d.ts +50 -31
  46. package/core/modules/configuration/services/configuration-runtime.service.d.ts +2 -4
  47. package/core/modules/configuration/services/configuration.service.d.ts +6 -4
  48. package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -2
  49. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +3 -2
  50. package/core/modules/flow-configuration/services/flow-update.service.d.ts +3 -2
  51. package/core/services/metric-calculation/metric-calculation.service.d.ts +5 -1
  52. package/core/services/quote-draft.service.d.ts +2 -2
  53. package/core/types/index.d.ts +0 -1
  54. package/core/types/ui-definition.types.d.ts +19 -4
  55. package/core/utils/index.d.ts +1 -0
  56. package/core/utils/line-item.utils.d.ts +2 -0
  57. package/core/utils/ui-definition.utils.d.ts +2 -0
  58. package/esm2015/cms/cms.actions.js +1 -6
  59. package/esm2015/cms/components/element-children/element-children.component.js +24 -8
  60. package/esm2015/cms/components/element-children/element-children.module.js +8 -6
  61. package/esm2015/cms/components/element-drop-handle/element-drop-handle.component.js +32 -0
  62. package/esm2015/cms/components/element-drop-handle/element-drop-handle.module.js +19 -0
  63. package/esm2015/cms/components/element-renderer/element-renderer.component.js +9 -9
  64. package/esm2015/cms/components/element-renderer/element-renderer.module.js +4 -4
  65. package/esm2015/cms/components/plugin.component.js +3 -3
  66. package/esm2015/cms/components/preview/index.js +2 -1
  67. package/esm2015/cms/components/preview/preview.component.js +21 -36
  68. package/esm2015/cms/components/preview/preview.module.js +7 -6
  69. package/esm2015/cms/components/preview/preview.types.js +2 -0
  70. package/esm2015/cms/directives/custom-template.directive.js +3 -3
  71. package/esm2015/cms/index.js +3 -1
  72. package/esm2015/cms/launcher.module.js +11 -10
  73. package/esm2015/cms/modules/federated/federated.component.js +3 -3
  74. package/esm2015/cms/modules/federated/federated.module.js +4 -4
  75. package/esm2015/cms/modules/migrations/index.js +3 -0
  76. package/esm2015/cms/modules/migrations/migrations.js +11 -0
  77. package/esm2015/cms/modules/migrations/migrations.module.js +15 -0
  78. package/esm2015/cms/modules/migrations/services/migrations.service.js +43 -0
  79. package/esm2015/cms/modules/migrations/types/migrations.types.js +2 -0
  80. package/esm2015/cms/modules/runtime/index.js +3 -0
  81. package/esm2015/cms/modules/runtime/runtime.module.js +32 -0
  82. package/esm2015/cms/modules/runtime/services/compilation.service.js +84 -0
  83. package/esm2015/cms/modules/runtime/services/runtime-editor.service.js +27 -0
  84. package/esm2015/cms/modules/runtime/services/runtime.service.js +74 -0
  85. package/esm2015/cms/modules/runtime/tokens.js +3 -0
  86. package/esm2015/cms/modules/runtime/types/compilation.types.js +2 -0
  87. package/esm2015/cms/modules/runtime/types/runtime.actions.js +2 -0
  88. package/esm2015/cms/plugins/configuration.plugin.js +12 -4
  89. package/esm2015/cms/plugins/io.plugin.js +3 -3
  90. package/esm2015/cms/plugins/script.plugin.js +3 -3
  91. package/esm2015/cms/services/element-context.service.js +3 -3
  92. package/esm2015/cms/services/index.js +2 -2
  93. package/esm2015/cms/services/integration.state.js +3 -3
  94. package/esm2015/cms/services/io-provider.service.js +9 -9
  95. package/esm2015/cms/services/resources.service.js +50 -0
  96. package/esm2015/cms/services/templates.service.js +3 -3
  97. package/esm2015/cms/types/common.types.js +1 -1
  98. package/esm2015/cms/types/configuration.types.js +1 -1
  99. package/esm2015/cms/types/index.js +2 -2
  100. package/esm2015/cms/utils/elements-resolver.js +18 -8
  101. package/esm2015/cms/utils/index.js +2 -1
  102. package/esm2015/cms/utils/path.utils.js +2 -13
  103. package/esm2015/cms/utils/ui-definition.utils.js +82 -0
  104. package/esm2015/cms/vendor-map.js +25 -10
  105. package/esm2015/core/core.module.js +4 -4
  106. package/esm2015/core/modules/configuration/configuration.module.js +4 -4
  107. package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +5 -10
  108. package/esm2015/core/modules/configuration/services/configuration.service.js +38 -34
  109. package/esm2015/core/modules/configuration/services/runtime-context.service.js +3 -3
  110. package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +1 -1
  111. package/esm2015/core/modules/flow-configuration/flow-configuration.module.js +4 -4
  112. package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +11 -10
  113. package/esm2015/core/modules/flow-configuration/services/flow-update.service.js +9 -9
  114. package/esm2015/core/services/context.service.js +3 -3
  115. package/esm2015/core/services/metric-calculation/metric-calculation.service.js +18 -9
  116. package/esm2015/core/services/product-images.service.js +3 -3
  117. package/esm2015/core/services/quote-draft.service.js +7 -7
  118. package/esm2015/core/types/index.js +1 -2
  119. package/esm2015/core/types/ui-definition.types.js +2 -2
  120. package/esm2015/core/utils/index.js +2 -1
  121. package/esm2015/core/utils/line-item.utils.js +27 -11
  122. package/esm2015/core/utils/ui-definition.utils.js +9 -0
  123. package/esm2015/runtime/components/component-preview/component-preview.component.js +4 -4
  124. package/esm2015/runtime/components/section-renderer/section-renderer.component.js +3 -3
  125. package/esm2015/runtime/components/ui-runtime/runtime.component.js +3 -3
  126. package/esm2015/runtime/components/ui-runtime-preview/runtime-preview.component.js +3 -3
  127. package/esm2015/runtime/execution/components/children-placeholder/children-placeholder.component.js +6 -6
  128. package/esm2015/runtime/execution/components/context-provider/context-provider.component.js +3 -3
  129. package/esm2015/runtime/execution/components/execution-section-renderer/execution-section-renderer.component.js +3 -3
  130. package/esm2015/runtime/execution/components/federated/federated.component.js +3 -3
  131. package/esm2015/runtime/execution/components/velo-attribute/velo-attribute.component.js +3 -3
  132. package/esm2015/runtime/execution/components/velo-multiselect/velo-multiselect.component.js +3 -3
  133. package/esm2015/runtime/execution/components/velo-port-checkbox/velo-port-checkbox.component.js +3 -3
  134. package/esm2015/runtime/execution/components/velo-port-dropdown/velo-port-dropdown.component.js +3 -3
  135. package/esm2015/runtime/execution/components/velo-port-radio/velo-port-radio.component.js +3 -3
  136. package/esm2015/runtime/execution/components/velo-type/velo-type.component.js +3 -3
  137. package/esm2015/runtime/execution/directives/section-script.directive.js +3 -3
  138. package/esm2015/runtime/execution/directives/sf-query.directive.js +3 -3
  139. package/esm2015/runtime/execution/directives/velo-attribute.directive.js +3 -3
  140. package/esm2015/runtime/execution/directives/velo-port.directive.js +18 -18
  141. package/esm2015/runtime/execution/directives/vl-approval.directive.js +3 -3
  142. package/esm2015/runtime/execution/directives/vl-document-attachments.directive.js +3 -3
  143. package/esm2015/runtime/execution/directives/vl-document-templates.directive.js +3 -3
  144. package/esm2015/runtime/execution/directives/vl-quote.directive.js +4 -4
  145. package/esm2015/runtime/execution/directives/vl-ramp.directive.js +3 -3
  146. package/esm2015/runtime/execution/runtime-execution.module.js +4 -4
  147. package/esm2015/runtime/runtime.module.js +4 -4
  148. package/esm2015/runtime/services/cart.service.js +3 -3
  149. package/esm2015/runtime/services/collapsible-state.service.js +3 -3
  150. package/esm2015/runtime/services/configuration.service.js +11 -12
  151. package/esm2015/runtime/services/current-state.service.js +3 -3
  152. package/esm2015/runtime/services/form-scope.service.js +3 -3
  153. package/esm2015/runtime/services/product-model-cache.service.js +3 -3
  154. package/esm2015/runtime/services/runtime-context.service.js +3 -3
  155. package/esm2015/runtime/services/runtime-form.service.js +3 -3
  156. package/esm2015/runtime/services/runtime.service.js +4 -4
  157. package/esm2015/runtime/services/section-helper.service.js +3 -3
  158. package/esm2015/runtime/services/section-scope.service.js +3 -3
  159. package/esm2015/runtime/services/section-store.service.js +3 -3
  160. package/esm2015/runtime/services/section.service.js +6 -6
  161. package/esm2015/runtime/types/index.js +2 -1
  162. package/esm2015/runtime/types/quote-states.types.js +2 -0
  163. package/esm2015/src/components/dialog/dialog.component.js +16 -6
  164. package/esm2015/src/components/dialog/dialog.module.js +4 -4
  165. package/esm2015/src/components/dialog/dialog.types.js +1 -1
  166. package/esm2015/src/components/doc-gen/doc-gen.component.js +3 -3
  167. package/esm2015/src/components/doc-gen/doc-gen.module.js +4 -4
  168. package/esm2015/src/components/header/cart-overlay/cart-preview.component.js +3 -3
  169. package/esm2015/src/components/header/cart-overlay/cart-preview.module.js +4 -4
  170. package/esm2015/src/components/header/header.component.js +20 -12
  171. package/esm2015/src/components/header/header.module.js +4 -4
  172. package/esm2015/src/components/header/metrics/metrics.component.js +79 -67
  173. package/esm2015/src/components/header/metrics/metrics.definitions.js +1 -8
  174. package/esm2015/src/components/header/metrics/metrics.module.js +4 -4
  175. package/esm2015/src/flow-routing.module.js +4 -4
  176. package/esm2015/src/flow.component.js +3 -3
  177. package/esm2015/src/flow.module.js +4 -4
  178. package/esm2015/src/guards/context.guard.js +3 -3
  179. package/esm2015/src/guards/product-unload.guard.js +5 -5
  180. package/esm2015/src/guards/root.guard.js +3 -3
  181. package/esm2015/src/pages/catalog/catalog.component.js +3 -3
  182. package/esm2015/src/pages/catalog/catalog.module.js +4 -4
  183. package/esm2015/src/pages/debug/debug.component.js +3 -3
  184. package/esm2015/src/pages/debug/debug.module.js +4 -4
  185. package/esm2015/src/pages/empty-account/empty-account.component.js +3 -3
  186. package/esm2015/src/pages/empty-account/empty-account.module.js +4 -4
  187. package/esm2015/src/pages/legacy-product/legacy-product.component.js +4 -4
  188. package/esm2015/src/pages/legacy-product/legacy-product.module.js +4 -4
  189. package/esm2015/src/pages/product/product.component.js +5 -12
  190. package/esm2015/src/pages/product/product.module.js +4 -4
  191. package/esm2015/src/pages/record-not-found/record-not-found.component.js +3 -3
  192. package/esm2015/src/pages/record-not-found/record-not-found.module.js +4 -4
  193. package/esm2015/src/pages/remote/remote.component.js +5 -8
  194. package/esm2015/src/pages/remote/remote.module.js +4 -4
  195. package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +3 -3
  196. package/esm2015/src/pages/shopping-cart/shopping-cart.module.js +4 -4
  197. package/esm2015/src/resolvers/flow.resolver.js +3 -3
  198. package/esm2015/src/resolvers/quote.resolver.js +8 -8
  199. package/esm2015/src/services/doc-gen.service.js +3 -3
  200. package/esm2015/src/services/flow-dialog.service.js +5 -4
  201. package/esm2015/src/services/flow-router.service.js +3 -3
  202. package/esm2015/src/services/flow.service.js +3 -3
  203. package/esm2015/src/utils/flow.utils.js +3 -3
  204. package/fesm2015/veloceapps-sdk-cms.js +1072 -718
  205. package/fesm2015/veloceapps-sdk-cms.js.map +1 -1
  206. package/fesm2015/veloceapps-sdk-core.js +568 -534
  207. package/fesm2015/veloceapps-sdk-core.js.map +1 -1
  208. package/fesm2015/veloceapps-sdk-runtime.js +145 -146
  209. package/fesm2015/veloceapps-sdk-runtime.js.map +1 -1
  210. package/fesm2015/veloceapps-sdk.js +270 -255
  211. package/fesm2015/veloceapps-sdk.js.map +1 -1
  212. package/package.json +5 -3
  213. package/runtime/services/configuration.service.d.ts +2 -1
  214. package/runtime/services/runtime.service.d.ts +2 -1
  215. package/runtime/types/index.d.ts +1 -0
  216. package/src/components/dialog/dialog.types.d.ts +1 -0
  217. package/src/components/header/header.component.d.ts +4 -2
  218. package/src/components/header/metrics/metrics.component.d.ts +15 -6
  219. package/src/components/header/metrics/metrics.definitions.d.ts +0 -3
  220. package/src/pages/product/product.component.d.ts +0 -1
  221. package/cms/services/dynamic-module.service.d.ts +0 -15
  222. package/cms/services/launcher.service.d.ts +0 -18
  223. package/esm2015/cms/services/dynamic-module.service.js +0 -33
  224. package/esm2015/cms/services/launcher.service.js +0 -58
  225. package/esm2015/cms/types/compilation.types.js +0 -2
  226. package/esm2015/core/types/quote-states.types.js +0 -2
  227. /package/{core → runtime}/types/quote-states.types.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { IntegrationAction, Metric } from './types';
1
+ import { IntegrationAction } from './types';
2
2
  export declare enum FlowAction {
3
3
  FLOW_CONFIGURE_PRODUCT = "FLOW_CONFIGURE_PRODUCT",
4
4
  FLOW_NAVIGATE_BACK = "FLOW_NAVIGATE_BACK",
@@ -8,8 +8,7 @@ export declare enum FlowAction {
8
8
  FLOW_CLOSE_DOC_GEN = "FLOW_CLOSE_DOC_GEN",
9
9
  FLOW_SWITCH_OBJECT = "FLOW_SWITCH_OBJECT",
10
10
  REMOTE_APPLY = "REMOTE_APPLY",
11
- REMOTE_CANCEL = "REMOTE_CANCEL",
12
- SET_DEFAULT_METRICS = "SET_DEFAULT_METRICS"
11
+ REMOTE_CANCEL = "REMOTE_CANCEL"
13
12
  }
14
13
  export declare const ConfigureProductAction: ({ lineItemId, productId, }: {
15
14
  lineItemId?: string | undefined;
@@ -25,4 +24,3 @@ export declare const RemoteCancelAction: () => IntegrationAction;
25
24
  export declare const SwitchObjectAction: (payload: {
26
25
  id: string;
27
26
  }) => IntegrationAction;
28
- export declare const SetDefaultMetrics: (metrics: Metric[]) => IntegrationAction;
@@ -1,10 +1,20 @@
1
+ import { ChangeDetectorRef, OnDestroy } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { RuntimeEditorService } from '../../modules/runtime/services/runtime-editor.service';
4
+ import { RuntimeService } from '../../modules/runtime/services/runtime.service';
1
5
  import { ElementContextService } from '../../services/element-context.service';
2
6
  import { ElementMetadata } from '../../types/common.types';
3
7
  import * as i0 from "@angular/core";
4
- export declare class ElementChildrenComponent {
8
+ export declare class ElementChildrenComponent implements OnDestroy {
5
9
  private elementContext;
6
- metadata?: ElementMetadata;
7
- constructor(elementContext: ElementContextService);
10
+ private runtimeService;
11
+ private runtimeEditorService;
12
+ private cdr;
13
+ metadata$: Observable<ElementMetadata | undefined>;
14
+ dragMode$: Observable<boolean>;
15
+ private destroyed$;
16
+ constructor(elementContext: ElementContextService, runtimeService: RuntimeService, runtimeEditorService: RuntimeEditorService, cdr: ChangeDetectorRef);
17
+ ngOnDestroy(): void;
8
18
  static ɵfac: i0.ɵɵFactoryDeclaration<ElementChildrenComponent, never>;
9
19
  static ɵcmp: i0.ɵɵComponentDeclaration<ElementChildrenComponent, "element-children", never, {}, {}, never, never>;
10
20
  }
@@ -1,8 +1,10 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./element-children.component";
3
- import * as i2 from "../element-renderer/element-renderer.module";
3
+ import * as i2 from "@veloceapps/components";
4
+ import * as i3 from "../element-renderer/element-renderer.module";
5
+ import * as i4 from "../element-drop-handle/element-drop-handle.module";
4
6
  export declare class ElementChildrenModule {
5
7
  static ɵfac: i0.ɵɵFactoryDeclaration<ElementChildrenModule, never>;
6
- static ɵmod: i0.ɵɵNgModuleDeclaration<ElementChildrenModule, [typeof i1.ElementChildrenComponent], [typeof i2.ElementRendererModule], [typeof i1.ElementChildrenComponent]>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ElementChildrenModule, [typeof i1.ElementChildrenComponent], [typeof i2.LetDirectiveModule, typeof i3.ElementRendererModule, typeof i4.ElementDropHandleModule], [typeof i1.ElementChildrenComponent]>;
7
9
  static ɵinj: i0.ɵɵInjectorDeclaration<ElementChildrenModule>;
8
10
  }
@@ -0,0 +1,12 @@
1
+ import { DndDropEvent } from 'ngx-drag-drop';
2
+ import { RuntimeEditorService } from '../../modules/runtime/services/runtime-editor.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ElementDropHandleComponent {
5
+ private runtimeService;
6
+ index: number;
7
+ parentPath: string;
8
+ constructor(runtimeService: RuntimeEditorService);
9
+ handleDrop(e: DndDropEvent): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementDropHandleComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElementDropHandleComponent, "vl-element-drop-handle", never, { "index": "index"; "parentPath": "parentPath"; }, {}, never, never>;
12
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./element-drop-handle.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "ngx-drag-drop";
5
+ export declare class ElementDropHandleModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<ElementDropHandleModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ElementDropHandleModule, [typeof i1.ElementDropHandleComponent], [typeof i2.CommonModule, typeof i3.DndModule], [typeof i1.ElementDropHandleComponent]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<ElementDropHandleModule>;
9
+ }
@@ -1,13 +1,13 @@
1
1
  import { ChangeDetectorRef, ElementRef, Injector, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
2
2
  import { ConfigurationService } from '@veloceapps/sdk/core';
3
- import { DynamicModuleService } from '../../services/dynamic-module.service';
3
+ import { RuntimeService } from '../../modules/runtime/services/runtime.service';
4
4
  import { ElementContextService } from '../../services/element-context.service';
5
5
  import { IOProviderService } from '../../services/io-provider.service';
6
6
  import { ElementMetadata } from '../../types/common.types';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class ElementRendererComponent implements OnInit, OnDestroy {
9
9
  private parentInjector;
10
- private dynamicModuleService;
10
+ private runtimeService;
11
11
  private elementContext;
12
12
  private ioProviderService;
13
13
  private configurationService;
@@ -18,7 +18,7 @@ export declare class ElementRendererComponent implements OnInit, OnDestroy {
18
18
  private factory?;
19
19
  private refs;
20
20
  private destroy$;
21
- constructor(parentInjector: Injector, dynamicModuleService: DynamicModuleService, elementContext: ElementContextService, ioProviderService: IOProviderService, configurationService: ConfigurationService, elementRef: ElementRef, cdr: ChangeDetectorRef);
21
+ constructor(parentInjector: Injector, runtimeService: RuntimeService, elementContext: ElementContextService, ioProviderService: IOProviderService, configurationService: ConfigurationService, elementRef: ElementRef, cdr: ChangeDetectorRef);
22
22
  ngOnInit(): void;
23
23
  ngOnDestroy(): void;
24
24
  private createComponents;
@@ -1,2 +1,3 @@
1
1
  export * from './preview.component';
2
2
  export * from './preview.module';
3
+ export * from './preview.types';
@@ -1,34 +1,35 @@
1
- import { OnDestroy, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { ConfigurationRuntimeService, ConfigurationService, UIDefinition } from '@veloceapps/sdk/core';
3
3
  import { MessageService } from 'primeng/api';
4
4
  import { BehaviorSubject } from 'rxjs';
5
+ import { RuntimeService } from '../../modules/runtime/services/runtime.service';
5
6
  import { IntegrationState } from '../../services';
6
- import { LauncherService } from '../../services/launcher.service';
7
7
  import { ElementMetadata } from '../../types/common.types';
8
+ import { CMSPreviewConfig } from './preview.types';
8
9
  import * as i0 from "@angular/core";
9
10
  interface State {
10
11
  loading: boolean;
11
12
  failure: boolean;
12
13
  }
13
14
  export declare class PreviewComponent implements OnInit, OnDestroy {
14
- private launcherService;
15
+ private runtimeService;
15
16
  private configurationService;
16
17
  private messageService;
17
- private runtimeService;
18
+ private configurationRuntimeService;
18
19
  private integrationState;
20
+ private cdr;
19
21
  modelId?: string;
20
22
  uiDefinition?: UIDefinition;
21
- clearState: boolean;
23
+ config?: CMSPreviewConfig;
22
24
  state$: BehaviorSubject<State>;
23
25
  elements: ElementMetadata[];
24
26
  private destroy$;
25
- constructor(launcherService: LauncherService, configurationService: ConfigurationService, messageService: MessageService, runtimeService: ConfigurationRuntimeService, integrationState: IntegrationState);
27
+ constructor(runtimeService: RuntimeService, configurationService: ConfigurationService, messageService: MessageService, configurationRuntimeService: ConfigurationRuntimeService, integrationState: IntegrationState, cdr: ChangeDetectorRef);
26
28
  ngOnInit(): void;
27
29
  ngOnDestroy(): void;
28
30
  private initializeConfiguration$;
29
- private elementToMetadataSafe;
30
31
  private startPreview;
31
32
  static ɵfac: i0.ɵɵFactoryDeclaration<PreviewComponent, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "vl-cms-preview", never, { "modelId": "modelId"; "uiDefinition": "uiDefinition"; "clearState": "clearState"; }, {}, never, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "vl-cms-preview", never, { "modelId": "modelId"; "uiDefinition": "uiDefinition"; "config": "config"; }, {}, never, never>;
33
34
  }
34
35
  export {};
@@ -4,8 +4,9 @@ import * as i2 from "@angular/common";
4
4
  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
+ import * as i6 from "../element-drop-handle/element-drop-handle.module";
7
8
  export declare class PreviewModule {
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<PreviewModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<PreviewModule, [typeof i1.PreviewComponent], [typeof i2.CommonModule, typeof i3.LoaderModule, typeof i4.ElementRendererModule, typeof i5.ElementChildrenModule], [typeof i1.PreviewComponent]>;
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]>;
10
11
  static ɵinj: i0.ɵɵInjectorDeclaration<PreviewModule>;
11
12
  }
@@ -0,0 +1,11 @@
1
+ export interface CMSPreviewConfig {
2
+ /**
3
+ * When `true`, IntegrationState keeps data on component destroy
4
+ */
5
+ suppressClearState?: boolean;
6
+ /**
7
+ * When `true`, preview adds additional components/plugins needed for UIBuilder
8
+ * (like element hover/selection or Drag&Drop zones)
9
+ */
10
+ uiBuilderMode?: boolean;
11
+ }
package/cms/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from './decorators';
5
5
  export * from './injection-tokens';
6
6
  export * from './launcher.module';
7
7
  export * from './modules/federated/export';
8
+ export * from './modules/migrations';
9
+ export * from './modules/runtime';
8
10
  export * from './services';
9
11
  export * from './types';
10
12
  export * from './utils';
@@ -3,8 +3,10 @@ import * as i1 from "@angular/common";
3
3
  import * as i2 from "@veloceapps/core";
4
4
  import * as i3 from "@veloceapps/api";
5
5
  import * as i4 from "@veloceapps/sdk/core";
6
+ import * as i5 from "./modules/runtime/runtime.module";
7
+ import * as i6 from "./components/preview/preview.module";
6
8
  export declare class LauncherModule {
7
9
  static ɵfac: i0.ɵɵFactoryDeclaration<LauncherModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<LauncherModule, never, [typeof i1.CommonModule, typeof i2.CoreModule, typeof i3.ApiModule, typeof i4.SdkCoreModule], never>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LauncherModule, never, [typeof i1.CommonModule, typeof i2.CoreModule, typeof i3.ApiModule, typeof i4.SdkCoreModule, typeof i5.RuntimeModule, typeof i6.PreviewModule], [typeof i6.PreviewModule]>;
9
11
  static ɵinj: i0.ɵɵInjectorDeclaration<LauncherModule>;
10
12
  }
@@ -0,0 +1,2 @@
1
+ export * from './migrations.module';
2
+ export * from './services/migrations.service';
@@ -0,0 +1,2 @@
1
+ import { UIDefinitionMigrationFn } from './types/migrations.types';
2
+ export declare const migrations: Record<number, UIDefinitionMigrationFn>;
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MigrationsModule {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<MigrationsModule, never>;
4
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MigrationsModule, never, never, never>;
5
+ static ɵinj: i0.ɵɵInjectorDeclaration<MigrationsModule>;
6
+ }
@@ -0,0 +1,10 @@
1
+ import { ToastService } from '@veloceapps/components';
2
+ import { UIDefinition } from '@veloceapps/sdk/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class MigrationsService {
5
+ private toastService;
6
+ constructor(toastService: ToastService);
7
+ migrateUIDefinition(uiDef: UIDefinition): UIDefinition | undefined;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<MigrationsService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<MigrationsService>;
10
+ }
@@ -0,0 +1,2 @@
1
+ import { UIDefinition } from '@veloceapps/sdk/core';
2
+ export declare type UIDefinitionMigrationFn = (uiDef: UIDefinition) => UIDefinition;
@@ -0,0 +1,2 @@
1
+ export * from './runtime.module';
2
+ export * from './services/runtime-editor.service';
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "@veloceapps/core";
4
+ export declare class RuntimeModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RuntimeModule, never, [typeof i1.CommonModule, typeof i2.CoreModule], never>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<RuntimeModule>;
8
+ }
@@ -0,0 +1,18 @@
1
+ import { Compiler, NgModule, Type } from '@angular/core';
2
+ import { UIDefinition } from '@veloceapps/sdk/core';
3
+ import { Observable } from 'rxjs';
4
+ import { CompilationResult } from '../../../modules/runtime/types/compilation.types';
5
+ import { ElementMetadata } from '../../../types/common.types';
6
+ import * as i0 from "@angular/core";
7
+ export declare class CompilationService {
8
+ private compiler;
9
+ private uiDefinitionMeta?;
10
+ private elementsResolver?;
11
+ constructor(compiler: Compiler);
12
+ compileUIDefinition$(uiDefinition: UIDefinition): Observable<CompilationResult>;
13
+ compileElement$(element: ElementMetadata): Observable<CompilationResult>;
14
+ clearModuleCache(modules: Type<NgModule>[]): void;
15
+ private getModule;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<CompilationService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<CompilationService>;
18
+ }
@@ -0,0 +1,18 @@
1
+ import { Patch } from 'rfc6902';
2
+ import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
3
+ import { RuntimeElementDeleted, RuntimeElementDropped } from '../types/runtime.actions';
4
+ import { RuntimeService } from './runtime.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class RuntimeEditorService {
7
+ private runtimeService;
8
+ private editorModeSubj$;
9
+ dragMode$: BehaviorSubject<boolean>;
10
+ elementDropped$: ReplaySubject<RuntimeElementDropped>;
11
+ elementDeleted$: ReplaySubject<RuntimeElementDeleted>;
12
+ editorMode$: Observable<boolean>;
13
+ constructor(runtimeService: RuntimeService);
14
+ applyPatch$(patch: Patch): Observable<void>;
15
+ toggleEditorMode(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeEditorService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeEditorService>;
18
+ }
@@ -0,0 +1,27 @@
1
+ import { ComponentFactory, Injector, NgModule, Type } from '@angular/core';
2
+ import { UIDefinition } from '@veloceapps/sdk/core';
3
+ import { Patch } from 'rfc6902';
4
+ import { BehaviorSubject, Observable, Subject } from 'rxjs';
5
+ import { CMSPreviewConfig } from '../../../components/preview/preview.types';
6
+ import { ElementMetadata } from '../../../types';
7
+ import * as i0 from "@angular/core";
8
+ export declare class RuntimeService {
9
+ private injector;
10
+ modules: Type<NgModule>[];
11
+ componentFactories: Record<string, ComponentFactory<any>>;
12
+ applicationTree: ElementMetadata[];
13
+ config?: CMSPreviewConfig;
14
+ isInitialized$: BehaviorSubject<boolean>;
15
+ updated$: Subject<void>;
16
+ private compilationService;
17
+ constructor(injector: Injector);
18
+ initialize$(uiDefinition?: UIDefinition, config?: CMSPreviewConfig): Observable<ElementMetadata[]>;
19
+ applyPatch$(patch: Patch): Observable<void>;
20
+ getCompiledElement$(path: string): Observable<ElementMetadata | undefined>;
21
+ clear(): void;
22
+ private addElement$;
23
+ private deleteElement;
24
+ private addComponentFactories;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeService, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeService>;
27
+ }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { CompilationService } from './services/compilation.service';
3
+ export declare const CMS_COMPILATION_SERVICE: InjectionToken<CompilationService>;
@@ -1,5 +1,5 @@
1
1
  import { ModuleWithComponentFactories, NgModule } from '@angular/core';
2
- import { ElementMetadata } from './common.types';
2
+ import { ElementMetadata } from '../../../types/common.types';
3
3
  export interface CompilationResult {
4
4
  elements: ElementMetadata[];
5
5
  module: ModuleWithComponentFactories<NgModule>;
@@ -0,0 +1,9 @@
1
+ import { ElementMetadata } from '../../../types';
2
+ export interface RuntimeElementDropped {
3
+ element: ElementMetadata;
4
+ path: string;
5
+ index: number;
6
+ }
7
+ export interface RuntimeElementDeleted {
8
+ path: string;
9
+ }
@@ -1,3 +1,3 @@
1
1
  export * from './integration.state';
2
- export * from './launcher.service';
2
+ export * from './resources.service';
3
3
  export * from './templates.service';
@@ -1,11 +1,11 @@
1
1
  import { BehaviorSubject, Observable } from 'rxjs';
2
+ import { RuntimeService } from '../modules/runtime/services/runtime.service';
2
3
  import { ElementMetadata } from '../types/common.types';
3
- import { DynamicModuleService } from './dynamic-module.service';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class IOProviderService {
6
- private dynamicModuleService;
6
+ private runtimeService;
7
7
  private inputs;
8
- constructor(dynamicModuleService: DynamicModuleService);
8
+ constructor(runtimeService: RuntimeService);
9
9
  connect(el: ElementMetadata, name: string, target?: string | null): Observable<any> | undefined;
10
10
  provide(el: ElementMetadata, name: string, target?: string | null): BehaviorSubject<any> | undefined;
11
11
  private resolveTarget;
@@ -0,0 +1,10 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ResourcesService {
4
+ private scripts;
5
+ private loaded$;
6
+ loadScript(url: string): Observable<void>;
7
+ loadStyles(url: string): Observable<void>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<ResourcesService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<ResourcesService>;
10
+ }
@@ -5,7 +5,7 @@ export declare type ELEMENT_TYPE = 'CUSTOM' | 'CONTAINER' | 'SERVICE' | 'REFEREN
5
5
  export declare type ElementStyleDeclaration = Partial<CSSStyleDeclaration>;
6
6
  export interface ElementConfig {
7
7
  component: typeof Entity;
8
- plugins?: typeof Plugin[];
8
+ plugins?: (typeof Plugin)[];
9
9
  defaultTemplate?: string;
10
10
  suppressTemplate?: boolean;
11
11
  suppressStyles?: boolean;
@@ -4,6 +4,7 @@ export interface ConfigurationElement {
4
4
  boundName: string;
5
5
  }
6
6
  export interface TypeElement extends ConfigurationElement {
7
+ updateQty: (qty: number) => void;
7
8
  remove: () => void;
8
9
  }
9
10
  export interface PortElement extends ConfigurationElement {
@@ -1,5 +1,5 @@
1
+ export * from '../modules/runtime/types/compilation.types';
1
2
  export * from './common.types';
2
- export * from './compilation.types';
3
3
  export * from './configuration.types';
4
4
  export * from './elements.types';
5
5
  export * from './integration.types';
@@ -3,10 +3,11 @@ import { UIDefinitionMetadata } from '@veloceapps/sdk/core';
3
3
  import { ElementMetadata } from '../types';
4
4
  export declare class ElementsResolver {
5
5
  private uiDef;
6
- readonly elements: ElementMetadata[];
6
+ elements: ElementMetadata[];
7
7
  private renderableElements;
8
8
  private sharedElements;
9
- constructor(uiDef: UIDefinitionMetadata, elements: ElementMetadata[]);
9
+ constructor(uiDef: UIDefinitionMetadata, elements: ElementMetadata[], sharedElements?: ElementMetadata[]);
10
+ addElement(element: ElementMetadata): void;
10
11
  getNgComponents(): Type<any>[];
11
12
  private transpile;
12
13
  private transpileScripts;
@@ -1,3 +1,4 @@
1
1
  export * from './element.utils';
2
2
  export * from './elements-resolver';
3
3
  export * from './path.utils';
4
+ export * from './ui-definition.utils';
@@ -1,5 +1,4 @@
1
1
  import { ElementMetadata, ElementPath, PathBlock } from '../types';
2
2
  export declare const parseBoundPath: (path: string) => PathBlock[];
3
3
  export declare const parsePath: (path: string) => ElementPath;
4
- export declare const findElementByModule: (elements: ElementMetadata[], module: string, elementName: string) => ElementMetadata | undefined;
5
4
  export declare const getAbsolutePath: (elements: ElementMetadata[], subject: ElementMetadata, path: ElementPath) => string | undefined;
@@ -0,0 +1,6 @@
1
+ import { ElementMetadata } from '../types';
2
+ export declare function getElementUniqueName<T>(collection: T[], name: string, comparator: (name: string) => (value: T, index?: number, array?: T[]) => boolean): string;
3
+ export declare const insertElement: (source: ElementMetadata[], target: ElementMetadata, path: string, index: number) => ElementMetadata[];
4
+ export declare const removeElement: (source: ElementMetadata[], path: string) => ElementMetadata[];
5
+ export declare const findElementByPath: (source: ElementMetadata[], path: string) => ElementMetadata | undefined;
6
+ export declare const findElementByModule: (elements: ElementMetadata[], module: string, elementName: string) => ElementMetadata | undefined;