@veloceapps/sdk 11.0.0-2 → 11.0.0-20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/cms/cms.actions.d.ts +92 -29
  2. package/cms/components/element-renderer/element-renderer.component.d.ts +3 -10
  3. package/cms/services/element-context.service.d.ts +0 -1
  4. package/cms/types/common.types.d.ts +2 -0
  5. package/cms/types/index.d.ts +0 -1
  6. package/cms/utils/path.utils.d.ts +1 -2
  7. package/cms/vendor-map.d.ts +19 -40
  8. package/core/index.d.ts +0 -1
  9. package/core/modules/configuration/index.d.ts +1 -4
  10. package/core/modules/configuration/services/configuration-runtime.service.d.ts +3 -22
  11. package/core/modules/configuration/services/configuration-state.service.d.ts +8 -8
  12. package/core/modules/configuration/services/configuration.service.d.ts +23 -47
  13. package/core/modules/flow-configuration/index.d.ts +0 -3
  14. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +10 -39
  15. package/core/services/catalog-products.service.d.ts +11 -0
  16. package/core/services/flow-info.service.d.ts +25 -11
  17. package/core/services/flow-state-configuration.service.d.ts +2 -8
  18. package/core/services/flow-state.service.d.ts +13 -22
  19. package/core/services/index.d.ts +2 -3
  20. package/core/services/integration.state.d.ts +1 -1
  21. package/core/services/sales-transaction.service.d.ts +30 -0
  22. package/core/types/flow-state.types.d.ts +2 -2
  23. package/core/types/index.d.ts +0 -1
  24. package/core/utils/index.d.ts +2 -2
  25. package/core/utils/transaction-item.utils.d.ts +7 -0
  26. package/core/utils/transaction-item.worker.d.ts +8 -0
  27. package/esm2020/cms/cms.actions.mjs +93 -71
  28. package/esm2020/cms/cms.default.mjs +2 -3
  29. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +7 -64
  30. package/esm2020/cms/components/preview/preview.component.mjs +3 -3
  31. package/esm2020/cms/services/element-context.service.mjs +1 -1
  32. package/esm2020/cms/types/common.types.mjs +1 -1
  33. package/esm2020/cms/types/index.mjs +1 -2
  34. package/esm2020/cms/utils/element.utils.mjs +3 -3
  35. package/esm2020/cms/utils/path.utils.mjs +1 -10
  36. package/esm2020/cms/vendor-map.mjs +12 -17
  37. package/esm2020/core/core.module.mjs +9 -7
  38. package/esm2020/core/index.mjs +1 -2
  39. package/esm2020/core/modules/configuration/configuration.module.mjs +3 -4
  40. package/esm2020/core/modules/configuration/index.mjs +2 -5
  41. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +9 -102
  42. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +60 -76
  43. package/esm2020/core/modules/configuration/services/configuration.service.mjs +96 -225
  44. package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +3 -4
  45. package/esm2020/core/modules/flow-configuration/index.mjs +1 -4
  46. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +33 -126
  47. package/esm2020/core/services/catalog-products.service.mjs +25 -0
  48. package/esm2020/core/services/flow-info.service.mjs +77 -29
  49. package/esm2020/core/services/flow-state-configuration.service.mjs +10 -25
  50. package/esm2020/core/services/flow-state.service.mjs +62 -169
  51. package/esm2020/core/services/index.mjs +3 -4
  52. package/esm2020/core/services/integration.state.mjs +2 -2
  53. package/esm2020/core/services/sales-transaction.service.mjs +68 -0
  54. package/esm2020/core/types/flow-state.types.mjs +1 -1
  55. package/esm2020/core/types/index.mjs +1 -2
  56. package/esm2020/core/utils/index.mjs +3 -3
  57. package/esm2020/core/utils/transaction-item.utils.mjs +60 -0
  58. package/esm2020/core/utils/transaction-item.worker.mjs +16 -0
  59. package/esm2020/src/components/flow-header/flow-header.component.mjs +3 -6
  60. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +3 -6
  61. package/esm2020/src/flow-routing.module.mjs +11 -41
  62. package/esm2020/src/flow.component.mjs +5 -5
  63. package/esm2020/src/guards/flow.guard.mjs +13 -14
  64. package/esm2020/src/guards/product-unload.guard.mjs +7 -9
  65. package/esm2020/src/index.mjs +1 -3
  66. package/esm2020/src/pages/assets/assets.component.mjs +3 -3
  67. package/esm2020/src/pages/catalog/catalog.component.mjs +3 -3
  68. package/esm2020/src/pages/debug/debug.component.mjs +12 -21
  69. package/esm2020/src/pages/product/product.component.mjs +12 -82
  70. package/esm2020/src/pages/product/product.module.mjs +5 -5
  71. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +5 -6
  72. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +3 -3
  73. package/esm2020/src/resolvers/flow.resolver.mjs +10 -18
  74. package/esm2020/src/resolvers/sales-transaction.resolver.mjs +83 -0
  75. package/esm2020/src/resolvers/ui-definition.resolver.mjs +42 -0
  76. package/esm2020/src/services/flow-dialog.service.mjs +8 -8
  77. package/esm2020/src/services/flow-router.service.mjs +16 -33
  78. package/esm2020/src/services/flow.service.mjs +13 -54
  79. package/esm2020/src/types/index.mjs +2 -3
  80. package/esm2020/src/types/route.types.mjs +1 -1
  81. package/fesm2015/veloceapps-sdk-cms.mjs +126 -268
  82. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  83. package/fesm2015/veloceapps-sdk-core.mjs +712 -1644
  84. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  85. package/fesm2015/veloceapps-sdk.mjs +167 -758
  86. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  87. package/fesm2020/veloceapps-sdk-cms.mjs +114 -262
  88. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  89. package/fesm2020/veloceapps-sdk-core.mjs +758 -1725
  90. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  91. package/fesm2020/veloceapps-sdk.mjs +167 -752
  92. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  93. package/package.json +1 -1
  94. package/src/components/flow-header/flow-header.component.d.ts +1 -1
  95. package/src/components/guided-selling/guided-selling.component.d.ts +1 -1
  96. package/src/flow-routing.module.d.ts +1 -2
  97. package/src/flow.component.d.ts +2 -2
  98. package/src/guards/product-unload.guard.d.ts +5 -6
  99. package/src/index.d.ts +0 -2
  100. package/src/pages/assets/assets.component.d.ts +1 -1
  101. package/src/pages/catalog/catalog.component.d.ts +1 -1
  102. package/src/pages/debug/debug.component.d.ts +1 -4
  103. package/src/pages/product/product.component.d.ts +5 -14
  104. package/src/pages/product/product.module.d.ts +1 -1
  105. package/src/pages/record-not-found/record-not-found.component.d.ts +2 -3
  106. package/src/pages/shopping-cart/shopping-cart.component.d.ts +1 -1
  107. package/src/resolvers/flow.resolver.d.ts +5 -6
  108. package/src/resolvers/sales-transaction.resolver.d.ts +18 -0
  109. package/src/resolvers/ui-definition.resolver.d.ts +3 -0
  110. package/src/services/flow-dialog.service.d.ts +5 -4
  111. package/src/services/flow-router.service.d.ts +4 -6
  112. package/src/services/flow.service.d.ts +2 -7
  113. package/src/types/index.d.ts +1 -2
  114. package/src/types/route.types.d.ts +0 -5
  115. package/cms/plugins/configuration.plugin.d.ts +0 -23
  116. package/cms/types/configuration.types.d.ts +0 -21
  117. package/core/modules/configuration/helpers.d.ts +0 -6
  118. package/core/modules/configuration/services/runtime-context.service.d.ts +0 -12
  119. package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -6
  120. package/core/modules/flow-configuration/services/flow-update.service.d.ts +0 -13
  121. package/core/modules/flow-configuration/types/update.types.d.ts +0 -12
  122. package/core/services/context.service.d.ts +0 -23
  123. package/core/services/quote-draft.service.d.ts +0 -50
  124. package/core/types/runtime.types.d.ts +0 -30
  125. package/core/utils/line-item.utils.d.ts +0 -25
  126. package/core/utils/line-item.worker.d.ts +0 -9
  127. package/esm2020/cms/plugins/configuration.plugin.mjs +0 -109
  128. package/esm2020/cms/types/configuration.types.mjs +0 -2
  129. package/esm2020/core/modules/configuration/helpers.mjs +0 -73
  130. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +0 -43
  131. package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +0 -2
  132. package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +0 -138
  133. package/esm2020/core/modules/flow-configuration/types/update.types.mjs +0 -2
  134. package/esm2020/core/services/context.service.mjs +0 -91
  135. package/esm2020/core/services/quote-draft.service.mjs +0 -192
  136. package/esm2020/core/types/runtime.types.mjs +0 -16
  137. package/esm2020/core/utils/line-item.utils.mjs +0 -187
  138. package/esm2020/core/utils/line-item.worker.mjs +0 -19
  139. package/esm2020/src/guards/context.guard.mjs +0 -91
  140. package/esm2020/src/guards/index.mjs +0 -2
  141. package/esm2020/src/pages/remote/remote.component.mjs +0 -342
  142. package/esm2020/src/pages/remote/remote.module.mjs +0 -20
  143. package/esm2020/src/pages/remote/remote.types.mjs +0 -2
  144. package/esm2020/src/resolvers/quote.resolver.mjs +0 -82
  145. package/esm2020/src/types/context-route.types.mjs +0 -2
  146. package/esm2020/src/types/metrics.types.mjs +0 -2
  147. package/esm2020/src/utils/flow.utils.mjs +0 -25
  148. package/esm2020/src/utils/index.mjs +0 -2
  149. package/src/guards/context.guard.d.ts +0 -19
  150. package/src/guards/index.d.ts +0 -1
  151. package/src/pages/remote/remote.component.d.ts +0 -46
  152. package/src/pages/remote/remote.module.d.ts +0 -10
  153. package/src/pages/remote/remote.types.d.ts +0 -4
  154. package/src/resolvers/quote.resolver.d.ts +0 -19
  155. package/src/types/context-route.types.d.ts +0 -5
  156. package/src/types/metrics.types.d.ts +0 -5
  157. package/src/utils/flow.utils.d.ts +0 -8
  158. package/src/utils/index.d.ts +0 -1
@@ -1,27 +1,28 @@
1
1
  import * as i2 from '@veloceapps/sdk/core';
2
- import { IntegrationState, ConfigurationService, ConfigurationStateService, QuoteDraftService, FlowConfigurationService, FlowStateService, FlowStateConfigurationService, LineItemWorker, ProductImagesService, ContextService, RuntimeSettingsService, ActionCodePipe, DatePipe, NumberPipe, PricePipe, lineItemUtils, generateLineItem, getAttributeValue, SdkPipesModule, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
2
+ import { IntegrationState, ConfigurationService, ConfigurationStateService, FlowConfigurationService, FlowStateService, FlowStateConfigurationService, TransactionItemWorker, ProductImagesService, RuntimeSettingsService, ActionCodePipe, DatePipe, NumberPipe, PricePipe, SalesTransactionService, SdkPipesModule, SdkCoreModule, UI_DEFINITION_VERSION } from '@veloceapps/sdk/core';
3
3
  export { IntegrationState } from '@veloceapps/sdk/core';
4
4
  import { __decorate, __param, __metadata, __awaiter, __rest } from 'tslib';
5
5
  import * as i0 from '@angular/core';
6
- import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef, SkipSelf, ViewChild, Input, ViewEncapsulation, NgModule, inject, ElementRef, Directive, ApplicationRef, createComponent, EventEmitter, createNgModule } from '@angular/core';
6
+ import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Injector, Injectable, ViewContainerRef, ViewChild, Input, ViewEncapsulation, NgModule, inject, ElementRef, Directive, ApplicationRef, createComponent, EventEmitter, createNgModule } from '@angular/core';
7
7
  import * as rxjs from 'rxjs';
8
8
  import { BehaviorSubject, Subject, map, distinctUntilChanged, of, tap, switchMap, startWith, takeUntil, combineLatest, catchError, ReplaySubject, noop, filter, take, Observable, from } from 'rxjs';
9
9
  import * as i3 from '@veloceapps/components';
10
10
  import { ToastType, LetDirectiveModule, LoaderModule, ToastService, HiddenTextTooltipModule, ErrorTooltipModule } from '@veloceapps/components';
11
- import lodash, { compact, cloneDeep, isArray, pull, merge, omit, flatten, kebabCase, set } from 'lodash';
12
- import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, ConfigurationContextMode, parseJwt, CoreModule } from '@veloceapps/core';
11
+ import { getCollectionUniqueName, UUID, isDefined, Operator, Predicate, parseJsonSafely, parseJwt, TokenInfoService, CoreModule } from '@veloceapps/core';
12
+ import lodash, { cloneDeep, isArray, pull, merge, omit, flatten, kebabCase, set } from 'lodash';
13
13
  import { applyPatch } from 'rfc6902';
14
14
  import * as i4 from '@angular/common';
15
15
  import { CommonModule, DOCUMENT } from '@angular/common';
16
16
  import * as i2$1 from 'ngx-drag-drop';
17
17
  import { DndModule } from 'ngx-drag-drop';
18
- import { SalesforceApiService, QuoteApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ShoppingCartSettingsApiService, ConfigurationSettingsApiService, GuidedSellingApiService, ContractedPriceApiService, ApiModule } from '@veloceapps/api';
18
+ import { SalesforceApiService, DocumentAttachmentApiService, RampApiService, CatalogApiService, DeltaApiService, PicklistsApiService, PriceApiService, ShoppingCartSettingsApiService, ConfigurationSettingsApiService, GuidedSellingApiService, ContractedPriceApiService, ApiModule } from '@veloceapps/api';
19
19
  import { DialogService } from 'primeng/dynamicdialog';
20
20
  import { DragDropModule } from '@angular/cdk/drag-drop';
21
21
  import { ScrollingModule } from '@angular/cdk/scrolling';
22
22
  import * as angularForms from '@angular/forms';
23
23
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
24
24
  import { DataSource } from '@angular/cdk/collections';
25
+ import { SalesTransactionApiService } from '@veloceapps/api/v2';
25
26
  import * as rxjsOperators from 'rxjs/operators';
26
27
  import * as sass from 'sass';
27
28
  import { transform } from '@babel/standalone';
@@ -44,58 +45,79 @@ var FlowAction;
44
45
  FlowAction.SUBMIT_GUIDED_SELLING = '[FLOW]_SUBMIT_GUIDED_SELLING';
45
46
  FlowAction.CLOSE_GUIDED_SELLING = '[FLOW]_CLOSE_GUIDED_SELLING';
46
47
  FlowAction.OPEN_DIALOG = '[FLOW]_OPEN_DIALOG';
47
- FlowAction.ConfigureProductAction = ({ lineItemId, productId, }) => ({
48
- type: FlowAction.FLOW_CONFIGURE_PRODUCT,
49
- payload: { lineItemId, productId },
50
- });
51
- FlowAction.NavigateBackAction = () => ({
52
- type: FlowAction.FLOW_NAVIGATE_BACK,
53
- });
54
- FlowAction.NavigateToAction = (path, productId, lineItemId) => ({
48
+ FlowAction.ConfigureProductAction = ({ transactionItemId, productId, }) => {
49
+ return {
50
+ type: FlowAction.FLOW_CONFIGURE_PRODUCT,
51
+ payload: { transactionItemId, productId },
52
+ };
53
+ };
54
+ FlowAction.NavigateBackAction = () => {
55
+ return {
56
+ type: FlowAction.FLOW_NAVIGATE_BACK,
57
+ };
58
+ };
59
+ FlowAction.NavigateToAction = (path, productId, transactionItemId) => ({
55
60
  type: FlowAction.FLOW_NAVIGATE_TO,
56
- payload: { path, productId, lineItemId },
61
+ payload: { path, productId, transactionItemId },
57
62
  });
58
63
  FlowAction.NavigateToCatalogAction = () => ({
59
64
  type: FlowAction.FLOW_NAVIGATE_TO_CATALOG,
60
65
  });
61
- FlowAction.NavigateToShoppingCartAction = () => ({
62
- type: FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART,
63
- });
64
- FlowAction.ApplyProductConfigurationAction = () => ({
65
- type: FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION,
66
- });
67
- FlowAction.RemoteApplyAction = () => ({
68
- type: FlowAction.REMOTE_APPLY,
69
- });
70
- FlowAction.RemoteCancelAction = () => ({
71
- type: FlowAction.REMOTE_CANCEL,
72
- });
73
- FlowAction.SwitchObjectAction = (payload) => ({
74
- type: FlowAction.FLOW_SWITCH_OBJECT,
75
- payload,
76
- });
77
- FlowAction.OpenGuidedSelling = (payload) => ({
78
- type: FlowAction.OPEN_GUIDED_SELLING,
79
- payload,
80
- });
81
- FlowAction.CloseGuidedSelling = (payload) => ({
82
- type: FlowAction.CLOSE_GUIDED_SELLING,
83
- payload,
84
- });
85
- FlowAction.SubmitGuidedSelling = (payload) => ({
86
- type: FlowAction.SUBMIT_GUIDED_SELLING,
87
- payload,
88
- });
89
- FlowAction.OpenDialog = (dialog) => ({
90
- type: FlowAction.OPEN_DIALOG,
91
- payload: { dialog },
92
- });
66
+ FlowAction.NavigateToShoppingCartAction = () => {
67
+ return {
68
+ type: FlowAction.FLOW_NAVIGATE_TO_SHOPPING_CART,
69
+ };
70
+ };
71
+ FlowAction.ApplyProductConfigurationAction = () => {
72
+ return {
73
+ type: FlowAction.FLOW_APPLY_PRODUCT_CONFIGURATION,
74
+ };
75
+ };
76
+ FlowAction.RemoteApplyAction = () => {
77
+ return {
78
+ type: FlowAction.REMOTE_APPLY,
79
+ };
80
+ };
81
+ FlowAction.RemoteCancelAction = () => {
82
+ return {
83
+ type: FlowAction.REMOTE_CANCEL,
84
+ };
85
+ };
86
+ FlowAction.SwitchObjectAction = (payload) => {
87
+ return {
88
+ type: FlowAction.FLOW_SWITCH_OBJECT,
89
+ payload,
90
+ };
91
+ };
92
+ FlowAction.OpenGuidedSelling = (payload) => {
93
+ return {
94
+ type: FlowAction.OPEN_GUIDED_SELLING,
95
+ payload,
96
+ };
97
+ };
98
+ FlowAction.CloseGuidedSelling = (payload) => {
99
+ return {
100
+ type: FlowAction.CLOSE_GUIDED_SELLING,
101
+ payload,
102
+ };
103
+ };
104
+ FlowAction.SubmitGuidedSelling = (payload) => {
105
+ return {
106
+ type: FlowAction.SUBMIT_GUIDED_SELLING,
107
+ payload,
108
+ };
109
+ };
110
+ FlowAction.OpenDialog = (dialog) => {
111
+ return {
112
+ type: FlowAction.OPEN_DIALOG,
113
+ payload: { dialog },
114
+ };
115
+ };
93
116
  })(FlowAction || (FlowAction = {}));
94
117
  var CmsAction;
95
118
  (function (CmsAction) {
96
119
  CmsAction.GO_TO_PAGE = '[CMS]_GO_TO_PAGE';
97
120
  CmsAction.UPDATE_CUSTOMIZATION = '[CMS]_UPDATE_CUSTOMIZATION';
98
- CmsAction.EMIT_CUSTOMIZATION_CHANGES = '[CMS]_EMIT_CUSTOMIZATION_CHANGES';
99
121
  CmsAction.SHOW_OVERLAY = '[CMS]_SHOW_OVERLAY';
100
122
  CmsAction.HIDE_OVERLAY = '[CMS]_HIDE_OVERLAY';
101
123
  CmsAction.HIDE_ALL_OVERLAYS = '[CMS]_HIDE_ALL_OVERLAYS';
@@ -104,56 +126,57 @@ var CmsAction;
104
126
  *
105
127
  * @param pageName name of the page
106
128
  */
107
- CmsAction.GoToPage = (pageName) => ({
108
- type: CmsAction.GO_TO_PAGE,
109
- payload: { pageName },
110
- });
129
+ CmsAction.GoToPage = (pageName) => {
130
+ return {
131
+ type: CmsAction.GO_TO_PAGE,
132
+ payload: { pageName },
133
+ };
134
+ };
111
135
  /**
112
136
  * Update UI definition customization state
113
137
  *
114
138
  * @param pageName name of the page
115
139
  */
116
- CmsAction.UpdateCustomization = (value) => ({
117
- type: CmsAction.UPDATE_CUSTOMIZATION,
118
- payload: { value },
119
- });
120
- /**
121
- * Emit customization page changes
122
- *
123
- * @param changes - object with customization page changes
124
- */
125
- CmsAction.EmitCustomizationChanges = (changes) => ({
126
- type: CmsAction.EMIT_CUSTOMIZATION_CHANGES,
127
- payload: { changes },
128
- });
140
+ CmsAction.UpdateCustomization = (value) => {
141
+ return {
142
+ type: CmsAction.UPDATE_CUSTOMIZATION,
143
+ payload: { value },
144
+ };
145
+ };
129
146
  /**
130
147
  * Show an Overlay on the selected page
131
148
  *
132
149
  * @param name - name of the overlay
133
150
  * @returns void
134
151
  */
135
- CmsAction.ShowOverlay = (name) => ({
136
- type: CmsAction.SHOW_OVERLAY,
137
- payload: { name },
138
- });
152
+ CmsAction.ShowOverlay = (name) => {
153
+ return {
154
+ type: CmsAction.SHOW_OVERLAY,
155
+ payload: { name },
156
+ };
157
+ };
139
158
  /**
140
159
  * Hide an Overlay on the selected page
141
160
  *
142
161
  * @param name - name of the overlay
143
162
  * @returns void
144
163
  */
145
- CmsAction.HideOverlay = (name) => ({
146
- type: CmsAction.HIDE_OVERLAY,
147
- payload: { name },
148
- });
164
+ CmsAction.HideOverlay = (name) => {
165
+ return {
166
+ type: CmsAction.HIDE_OVERLAY,
167
+ payload: { name },
168
+ };
169
+ };
149
170
  /**
150
171
  * Hide all Overlays on the selected page
151
172
  *
152
173
  * @returns void
153
174
  */
154
- CmsAction.HideAllOverlays = () => ({
155
- type: CmsAction.HIDE_ALL_OVERLAYS,
156
- });
175
+ CmsAction.HideAllOverlays = () => {
176
+ return {
177
+ type: CmsAction.HIDE_ALL_OVERLAYS,
178
+ };
179
+ };
157
180
  })(CmsAction || (CmsAction = {}));
158
181
 
159
182
  var cmsActions = /*#__PURE__*/Object.freeze({
@@ -551,15 +574,6 @@ const findElement = (source, comparatorFn) => {
551
574
  return;
552
575
  };
553
576
 
554
- const parseBoundPath = (path) => {
555
- var _a, _b;
556
- const regexp = new RegExp(`(?:\\/)(?:\\w+)(?:\\/)(?:ports|attributes)(?:\\/)(?:\\w+)|(?:\\/)(?:\\w+)`, 'g');
557
- const blocks = (_b = (_a = path.match(regexp)) === null || _a === void 0 ? void 0 : _a.map(match => {
558
- const [type, property, name] = compact(match.split('/'));
559
- return { type: type !== null && type !== void 0 ? type : '', property, name };
560
- })) !== null && _b !== void 0 ? _b : [];
561
- return blocks;
562
- };
563
577
  const parsePath = (path) => {
564
578
  var _a, _b, _c, _d;
565
579
  const segments = path.split('/');
@@ -796,13 +810,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
796
810
  }] });
797
811
 
798
812
  class ElementRendererComponent {
799
- constructor(parentInjector, runtimeService, elementContext, ioProviderService, configurationService, elementRef, cdr) {
800
- this.parentInjector = parentInjector;
813
+ constructor(runtimeService, elementContext, ioProviderService, cdr) {
801
814
  this.runtimeService = runtimeService;
802
815
  this.elementContext = elementContext;
803
816
  this.ioProviderService = ioProviderService;
804
- this.configurationService = configurationService;
805
- this.elementRef = elementRef;
806
817
  this.cdr = cdr;
807
818
  this.refs = {};
808
819
  this.destroy$ = new Subject();
@@ -826,10 +837,7 @@ class ElementRendererComponent {
826
837
  this.refs[UUID.UUID()] = this.createComponent();
827
838
  return;
828
839
  }
829
- if (modelMeta.lineItem) {
830
- this.createFromLineItem(modelMeta.lineItem);
831
- }
832
- else if (modelMeta.path) {
840
+ if (modelMeta.path) {
833
841
  this.createFromPath(modelMeta.path);
834
842
  }
835
843
  }
@@ -842,45 +850,6 @@ class ElementRendererComponent {
842
850
  this.processChildren(children);
843
851
  });
844
852
  }
845
- getModelComponent() {
846
- let component = null;
847
- let injector = this.parentInjector;
848
- while (!component) {
849
- const parentComp = injector.get(ElementRendererComponent, null);
850
- if (parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) {
851
- component = parentComp;
852
- break;
853
- }
854
- if (parentComp) {
855
- injector = parentComp.parentInjector;
856
- }
857
- else {
858
- break;
859
- }
860
- }
861
- return component;
862
- }
863
- createFromLineItem(path) {
864
- var _a, _b;
865
- const parentComp = this.getModelComponent();
866
- const parentPath = (_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.meta.model) === null || _a === void 0 ? void 0 : _a.lineItem;
867
- const pathBlocks = parseBoundPath(path).reverse();
868
- const { property, name } = (_b = pathBlocks[1]) !== null && _b !== void 0 ? _b : {};
869
- const finalPath = pathBlocks[0];
870
- const children$ = this.getParentLineItem$(parentComp).pipe(map(model => {
871
- var _a;
872
- if (!model) {
873
- return [];
874
- }
875
- if (property === 'ports' && !(finalPath === null || finalPath === void 0 ? void 0 : finalPath.property) && parentPath !== path) {
876
- return (_a = model.lineItems.filter(({ port }) => port === name)) !== null && _a !== void 0 ? _a : [];
877
- }
878
- return [model];
879
- }));
880
- children$.pipe(takeUntil(this.destroy$)).subscribe(children => {
881
- this.processChildren(children);
882
- });
883
- }
884
853
  processChildren(children) {
885
854
  var _a;
886
855
  (_a = this.runtimeService.moduleRefs[0]) === null || _a === void 0 ? void 0 : _a.injector.runInContext(() => {
@@ -903,16 +872,6 @@ class ElementRendererComponent {
903
872
  this.cdr.detectChanges();
904
873
  });
905
874
  }
906
- getParentLineItem$(parentComp) {
907
- var _a;
908
- const parentRefs = Object.values((_a = parentComp === null || parentComp === void 0 ? void 0 : parentComp.refs) !== null && _a !== void 0 ? _a : {});
909
- const parentRef = parentRefs.find(ref => { var _a; return (_a = ref === null || ref === void 0 ? void 0 : ref.location.nativeElement) === null || _a === void 0 ? void 0 : _a.contains(this.elementRef.nativeElement); });
910
- let parentModel$;
911
- if ((parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance) instanceof ElementComponent) {
912
- parentModel$ = parentRef === null || parentRef === void 0 ? void 0 : parentRef.instance.model$;
913
- }
914
- return parentModel$ !== null && parentModel$ !== void 0 ? parentModel$ : this.configurationService.get();
915
- }
916
875
  createComponent(data, index) {
917
876
  var _a;
918
877
  if (!this.type) {
@@ -947,16 +906,12 @@ class ElementRendererComponent {
947
906
  this.refs = {};
948
907
  }
949
908
  }
950
- ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, deps: [{ token: i0.Injector, skipSelf: true }, { token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i2.ConfigurationService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
909
+ ElementRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, deps: [{ token: RuntimeService }, { token: ElementContextService }, { token: IOProviderService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
951
910
  ElementRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ElementRendererComponent, selector: "vl-cms-element-renderer", inputs: { meta: "meta" }, providers: [ElementContextService], viewQueries: [{ propertyName: "el", first: true, predicate: ["el"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
952
911
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ElementRendererComponent, decorators: [{
953
912
  type: Component,
954
913
  args: [{ selector: 'vl-cms-element-renderer', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ElementContextService], template: "<ng-template #el></ng-template>\n", styles: [":host{display:contents}\n"] }]
955
- }], ctorParameters: function () {
956
- return [{ type: i0.Injector, decorators: [{
957
- type: SkipSelf
958
- }] }, { type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i2.ConfigurationService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }];
959
- }, propDecorators: { el: [{
914
+ }], ctorParameters: function () { return [{ type: RuntimeService }, { type: ElementContextService }, { type: IOProviderService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { el: [{
960
915
  type: ViewChild,
961
916
  args: ['el', { read: ViewContainerRef, static: true }]
962
917
  }], meta: [{
@@ -987,7 +942,7 @@ class PreviewComponent {
987
942
  ngOnInit() {
988
943
  var _a;
989
944
  if ((_a = this.config) === null || _a === void 0 ? void 0 : _a.clearStateOnInit) {
990
- this.integrationState.clear();
945
+ this.integrationState.reset();
991
946
  }
992
947
  this.startPreview();
993
948
  }
@@ -1606,14 +1561,14 @@ function getError(token, self, reason) {
1606
1561
  return new Error(`Injecting "${token}" in "/${self.path}": ${reason}`);
1607
1562
  }
1608
1563
 
1609
- const VELOCE_LIBS = {
1564
+ const vendorMap = {
1610
1565
  '@veloceapps/core': {
1611
1566
  isDefined,
1612
1567
  Operator,
1613
1568
  Predicate,
1614
1569
  parseJsonSafely,
1615
- ConfigurationContextMode,
1616
1570
  parseJwt,
1571
+ TokenInfoService,
1617
1572
  },
1618
1573
  '@veloceapps/components': {
1619
1574
  ToastService,
@@ -1621,7 +1576,6 @@ const VELOCE_LIBS = {
1621
1576
  },
1622
1577
  '@veloceapps/api': {
1623
1578
  SalesforceApiService,
1624
- QuoteApiService,
1625
1579
  DocumentAttachmentApiService,
1626
1580
  RampApiService,
1627
1581
  CatalogApiService,
@@ -1633,30 +1587,38 @@ const VELOCE_LIBS = {
1633
1587
  GuidedSellingApiService,
1634
1588
  ContractedPriceApiService,
1635
1589
  },
1636
- '@veloceapps/sdk/core': Object.assign({ ConfigurationService,
1590
+ '@veloceapps/api/v2': {
1591
+ SalesTransactionApiService,
1592
+ },
1593
+ '@veloceapps/sdk/core': {
1594
+ ConfigurationService,
1637
1595
  ConfigurationStateService,
1638
- QuoteDraftService,
1639
1596
  FlowConfigurationService,
1640
1597
  IntegrationState,
1641
1598
  FlowStateService,
1642
1599
  FlowStateConfigurationService,
1643
- LineItemWorker,
1600
+ TransactionItemWorker,
1644
1601
  ProductImagesService,
1645
- ContextService,
1646
1602
  RuntimeSettingsService,
1647
1603
  ActionCodePipe,
1648
1604
  DatePipe,
1649
1605
  NumberPipe,
1650
- PricePipe }, lineItemUtils),
1606
+ PricePipe,
1607
+ SalesTransactionService,
1608
+ },
1651
1609
  '@veloceapps/sdk/cms': Object.assign(Object.assign(Object.assign({}, cmsInjectionTokens), cmsActions), { TemplatesService,
1652
1610
  IntegrationState,
1653
1611
  ResourcesService,
1654
1612
  cmsInject }),
1655
- };
1656
- const VELOCE_LIBS_BACKWARDS_COMPATIBLE = Object.entries(VELOCE_LIBS).reduce((trunk, [key, value]) => (Object.assign(Object.assign({}, trunk), { [key.replace('@veloceapps/', '@veloce/')]: value })), {});
1657
- const vendorMap = Object.assign(Object.assign(Object.assign({}, VELOCE_LIBS), VELOCE_LIBS_BACKWARDS_COMPATIBLE), { '@angular/core': i0, '@angular/forms': angularForms, '@angular/cdk/collections': {
1613
+ '@angular/core': i0,
1614
+ '@angular/forms': angularForms,
1615
+ '@angular/cdk/collections': {
1658
1616
  DataSource,
1659
- }, rxjs: rxjs, 'rxjs/operators': rxjsOperators, lodash: lodash });
1617
+ },
1618
+ rxjs: rxjs,
1619
+ 'rxjs/operators': rxjsOperators,
1620
+ lodash: lodash,
1621
+ };
1660
1622
 
1661
1623
  const importRegexp = new RegExp(`import\\s+(?:{[^{}]+}|.*?)\\s*(?:from)?\\s*['"].*?['"]|import\\(.*?\\)`, 'g');
1662
1624
  const importPartsRegexp = new RegExp(`import ([\\n\\t]*(?:[^ \\n\\t\\{\\}]+[ \\n\\t]*,?)?(?:[ \\n\\t]*\\{(?:[ \\n\\t]*[^ \\n\\t"'\\{\\}]+[ \\n\\t]*,?)+\\})?[\\n\\t]*) from[ \\n\\t]*(['"])([^'"\\n]+)(?:['"])`, 'g');
@@ -1855,8 +1817,8 @@ const normalizeElementMetadata = (elementMetadata) => {
1855
1817
  var _a, _b, _c, _d;
1856
1818
  const metadata = Object.assign({}, elementMetadata);
1857
1819
  // model
1858
- const { lineItem, path } = (_a = metadata.model) !== null && _a !== void 0 ? _a : {};
1859
- const model = lineItem ? { lineItem } : path ? { path } : undefined;
1820
+ const { path } = (_a = metadata.model) !== null && _a !== void 0 ? _a : {};
1821
+ const model = path ? { path } : undefined;
1860
1822
  if (model) {
1861
1823
  metadata.model = model;
1862
1824
  }
@@ -2013,112 +1975,8 @@ class ElementMetadataWorker {
2013
1975
  }
2014
1976
  }
2015
1977
 
2016
- class ConfigurationPlugin {
2017
- constructor(host) {
2018
- var _a, _b;
2019
- this.host = host;
2020
- this.destroy$ = new Subject();
2021
- this.elementMetadata = this.host.injector.get(ELEMENT_METADATA);
2022
- this.configurationService = this.host.injector.get(ConfigurationService);
2023
- if ((_a = this.elementMetadata.model) === null || _a === void 0 ? void 0 : _a.lineItem) {
2024
- this.host.model$.pipe(takeUntil(this.destroy$)).subscribe(model => (this.modelSnapshot = model));
2025
- const pathBlocks = parseBoundPath((_b = this.elementMetadata.model) === null || _b === void 0 ? void 0 : _b.lineItem);
2026
- const firstPathBlock = pathBlocks.reverse()[0];
2027
- if (!firstPathBlock) {
2028
- return;
2029
- }
2030
- const { type, property, name } = firstPathBlock;
2031
- this.host.boundName = name !== null && name !== void 0 ? name : type;
2032
- this.register(type, property, name);
2033
- }
2034
- }
2035
- ngOnDestroy() {
2036
- this.destroy$.next();
2037
- this.destroy$.complete();
2038
- }
2039
- register(type, property, name) {
2040
- if (!type) {
2041
- return;
2042
- }
2043
- if (!property) {
2044
- this.registerType();
2045
- }
2046
- else if (property === 'ports' && name) {
2047
- this.registerPort(name);
2048
- }
2049
- else if (property === 'attributes' && name) {
2050
- this.registerAttribute(name);
2051
- }
2052
- }
2053
- registerType() {
2054
- const remove = () => {
2055
- const rootLineItem = this.configurationService.getSnapshot();
2056
- if (!rootLineItem || !this.modelSnapshot) {
2057
- return;
2058
- }
2059
- this.configurationService.patch(new LineItemWorker(rootLineItem).remove(this.modelSnapshot.id).li);
2060
- };
2061
- const updateQty = (qty) => {
2062
- const rootLineItem = this.configurationService.getSnapshot();
2063
- if (!rootLineItem || !this.modelSnapshot) {
2064
- return;
2065
- }
2066
- this.configurationService.patch(new LineItemWorker(rootLineItem).replace(Object.assign(Object.assign({}, this.modelSnapshot), { qty })).li);
2067
- };
2068
- this.typeHost.remove = remove;
2069
- this.typeHost.updateQty = updateQty;
2070
- }
2071
- registerPort(name) {
2072
- const model$ = this.host.model$;
2073
- const portItems$ = model$.pipe(map(model => { var _a; return (_a = model === null || model === void 0 ? void 0 : model.lineItems.filter(li => li.port === this.host.boundName)) !== null && _a !== void 0 ? _a : []; }));
2074
- const portDomain$ = model$.pipe(map(model => model === null || model === void 0 ? void 0 : model.portDomains[this.host.boundName]));
2075
- const add = (type, attributes = []) => {
2076
- if (!this.modelSnapshot) {
2077
- return;
2078
- }
2079
- const portDomain = this.modelSnapshot.portDomains[name];
2080
- if (!portDomain) {
2081
- return;
2082
- }
2083
- const generated = generateLineItem(portDomain.name, type, this.modelSnapshot.id, attributes);
2084
- this.configurationService.patch(new LineItemWorker(this.modelSnapshot).insert(this.modelSnapshot.id, generated).li);
2085
- };
2086
- this.portHost.portItems$ = portItems$;
2087
- this.portHost.portDomain$ = portDomain$;
2088
- this.portHost.addPortItem = add;
2089
- }
2090
- registerAttribute(name) {
2091
- if (!this.host.model$) {
2092
- return;
2093
- }
2094
- const value$ = this.host.model$.pipe(map(model => { var _a; return getAttributeValue((_a = model === null || model === void 0 ? void 0 : model.attributes) !== null && _a !== void 0 ? _a : [], name); }));
2095
- const patch = (value) => {
2096
- if (!this.modelSnapshot) {
2097
- return;
2098
- }
2099
- this.configurationService.patch(new LineItemWorker(this.modelSnapshot).patchAttribute([{ name, value }]).li);
2100
- };
2101
- this.attributeHost.value$ = value$;
2102
- this.attributeHost.patch = patch;
2103
- }
2104
- get attributeHost() {
2105
- return this.host;
2106
- }
2107
- get typeHost() {
2108
- return this.host;
2109
- }
2110
- get portHost() {
2111
- return this.host;
2112
- }
2113
- }
2114
- ConfigurationPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationPlugin, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
2115
- ConfigurationPlugin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: ConfigurationPlugin, ngImport: i0 });
2116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationPlugin, decorators: [{
2117
- type: Directive
2118
- }], ctorParameters: function () { return [{ type: undefined }]; } });
2119
-
2120
1978
  const DEFAULT_PLUGINS = {
2121
- CONFIGURATION: [ConfigurationPlugin],
1979
+ CONFIGURATION: [],
2122
1980
  DEFAULT: [],
2123
1981
  };
2124
1982
 
@@ -2647,5 +2505,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2647
2505
  * Generated bundle index. Do not edit.
2648
2506
  */
2649
2507
 
2650
- export { CmsAction, DEFAULT_ELEMENT, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementMetadataWorker, ElementsResolver, FlowAction, LAYOUT, LauncherModule, MigrationsModule, MigrationsService, PreviewComponent, PreviewModule, ResourcesService, RuntimeEditorService, RuntimeModule, RuntimeService, SHARED_ELEMENT_METADATA, STARTING_PAGE_LAYOUT, STARTING_PAGE_NAME, STARTING_PAGE_STYLES, STARTING_PAGE_TYPE, TemplatesService, TranspilationWorker, UI_DEFINITION_METADATA, UiBuildError, atobSafe, btoaSafe, cmsInject, constructPage, constructPageChildren, constructRegion, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElement, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementAngularIOs, getElementConfig, insertElement, isElementAngularIO, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata, parseBoundPath, parsePath, removeElement, stringifyElementMetadata, toElementAngularIO };
2508
+ export { CmsAction, DEFAULT_ELEMENT, DEFAULT_PLUGINS_TOKEN, ELEMENT_CONFIG, ELEMENT_METADATA, ElementComponent, ElementDefinition, ElementMetadataWorker, ElementsResolver, FlowAction, LAYOUT, LauncherModule, MigrationsModule, MigrationsService, PreviewComponent, PreviewModule, ResourcesService, RuntimeEditorService, RuntimeModule, RuntimeService, SHARED_ELEMENT_METADATA, STARTING_PAGE_LAYOUT, STARTING_PAGE_NAME, STARTING_PAGE_STYLES, STARTING_PAGE_TYPE, TemplatesService, TranspilationWorker, UI_DEFINITION_METADATA, UiBuildError, atobSafe, btoaSafe, cmsInject, constructPage, constructPageChildren, constructRegion, doesElementSupportIO, elementToMetadata, extendElementMetadata, extractElementMetadata, findElement, findElementByModule, findElementByPath, flattenElements, getAbsolutePath, getElementAngularIOs, getElementConfig, insertElement, isElementAngularIO, isSharedElement, isValidScript, metadataToElement, normalizeElementMetadata, parsePath, removeElement, stringifyElementMetadata, toElementAngularIO };
2651
2509
  //# sourceMappingURL=veloceapps-sdk-cms.mjs.map