@veloceapps/sdk 5.0.7 → 5.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/bundles/veloce-sdk-cms.umd.js +41 -4
  2. package/bundles/veloce-sdk-cms.umd.js.map +1 -1
  3. package/bundles/veloce-sdk.umd.js +469 -192
  4. package/bundles/veloce-sdk.umd.js.map +1 -1
  5. package/cms/cms.actions.d.ts +8 -2
  6. package/cms/types/common.types.d.ts +5 -0
  7. package/cms/types/index.d.ts +1 -0
  8. package/cms/types/metrics.types.d.ts +5 -0
  9. package/cms/utils/elements-resolver.d.ts +2 -1
  10. package/cms/vendor-map.d.ts +4 -0
  11. package/esm2015/cms/cms.actions.js +11 -1
  12. package/esm2015/cms/types/common.types.js +1 -1
  13. package/esm2015/cms/types/index.js +2 -1
  14. package/esm2015/cms/types/metrics.types.js +2 -0
  15. package/esm2015/cms/utils/element.utils.js +6 -1
  16. package/esm2015/cms/utils/elements-resolver.js +21 -4
  17. package/esm2015/src/components/header/header.component.js +7 -16
  18. package/esm2015/src/components/header/header.module.js +6 -2
  19. package/esm2015/src/components/header/metrics/index.js +2 -0
  20. package/esm2015/src/components/header/metrics/metrics.component.js +216 -0
  21. package/esm2015/src/components/header/metrics/metrics.definitions.js +9 -0
  22. package/esm2015/src/components/header/metrics/metrics.module.js +64 -0
  23. package/esm2015/src/services/flow-router.service.js +13 -1
  24. package/esm2015/src/services/flow.service.js +7 -1
  25. package/fesm2015/veloce-sdk-cms.js +39 -5
  26. package/fesm2015/veloce-sdk-cms.js.map +1 -1
  27. package/fesm2015/veloce-sdk.js +356 -85
  28. package/fesm2015/veloce-sdk.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/components/header/header.component.d.ts +0 -8
  31. package/src/components/header/header.module.d.ts +2 -1
  32. package/src/components/header/metrics/index.d.ts +1 -0
  33. package/src/components/header/metrics/metrics.component.d.ts +49 -0
  34. package/src/components/header/metrics/metrics.definitions.d.ts +4 -0
  35. package/src/components/header/metrics/metrics.module.d.ts +17 -0
  36. package/src/services/flow-router.service.d.ts +1 -0
@@ -40,8 +40,10 @@
40
40
  FlowAction["FLOW_APPLY_PRODUCT_CONFIGURATION"] = "FLOW_APPLY_PRODUCT_CONFIGURATION";
41
41
  FlowAction["FLOW_OPEN_DOC_GEN"] = "FLOW_OPEN_DOC_GEN";
42
42
  FlowAction["FLOW_CLOSE_DOC_GEN"] = "FLOW_CLOSE_DOC_GEN";
43
+ FlowAction["FLOW_SWITCH_OBJECT"] = "FLOW_SWITCH_OBJECT";
43
44
  FlowAction["REMOTE_APPLY"] = "REMOTE_APPLY";
44
45
  FlowAction["REMOTE_CANCEL"] = "REMOTE_CANCEL";
46
+ FlowAction["SET_DEFAULT_METRICS"] = "SET_DEFAULT_METRICS";
45
47
  })(exports.FlowAction || (exports.FlowAction = {}));
46
48
  var ConfigureProductAction = function (_a) {
47
49
  var lineItemId = _a.lineItemId, productId = _a.productId;
@@ -71,6 +73,14 @@
71
73
  var RemoteCancelAction = function () { return ({
72
74
  type: exports.FlowAction.REMOTE_CANCEL,
73
75
  }); };
76
+ var SwitchObjectAction = function (payload) { return ({
77
+ type: exports.FlowAction.FLOW_SWITCH_OBJECT,
78
+ payload: payload,
79
+ }); };
80
+ var SetDefaultMetrics = function (metrics) { return ({
81
+ type: exports.FlowAction.SET_DEFAULT_METRICS,
82
+ payload: { metrics: metrics },
83
+ }); };
74
84
 
75
85
  var cmsActions = /*#__PURE__*/Object.freeze({
76
86
  __proto__: null,
@@ -82,7 +92,9 @@
82
92
  OpenDocGenAction: OpenDocGenAction,
83
93
  CloseDocGenAction: CloseDocGenAction,
84
94
  RemoteApplyAction: RemoteApplyAction,
85
- RemoteCancelAction: RemoteCancelAction
95
+ RemoteCancelAction: RemoteCancelAction,
96
+ SwitchObjectAction: SwitchObjectAction,
97
+ SetDefaultMetrics: SetDefaultMetrics
86
98
  });
87
99
 
88
100
  /*! *****************************************************************************
@@ -837,6 +849,7 @@
837
849
  var name = _e.name;
838
850
  return name;
839
851
  }),
852
+ configuredStyles: metadata.configuredStyles,
840
853
  };
841
854
  var normalizedElMetadata = normalizeElementMetadata(elMetadata);
842
855
  if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
@@ -905,6 +918,10 @@
905
918
  if (!metadata.isShared) {
906
919
  delete metadata.isShared;
907
920
  }
921
+ // configuredStyles
922
+ if (!metadata.configuredStyles) {
923
+ delete metadata.configuredStyles;
924
+ }
908
925
  return metadata;
909
926
  };
910
927
  var extractElementMetadata = function (script) {
@@ -1527,6 +1544,10 @@
1527
1544
  finally { if (e_1) throw e_1.error; }
1528
1545
  }
1529
1546
  }
1547
+ ElementsResolver.prototype.getNgComponents = function () {
1548
+ var _this = this;
1549
+ return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(Boolean);
1550
+ };
1530
1551
  ElementsResolver.prototype.transpile = function (el) {
1531
1552
  var _a;
1532
1553
  if (!el.script) {
@@ -1596,6 +1617,11 @@
1596
1617
  console.warn("Unknown element type \"" + element.type + "\"");
1597
1618
  return;
1598
1619
  }
1620
+ var configuredStyles = this.convertInlineStylesToCSS(element.configuredStyles);
1621
+ if (configuredStyles) {
1622
+ // order is important: styles written by user in CSS code should has higher priority
1623
+ element.styles = configuredStyles + element.styles;
1624
+ }
1599
1625
  var component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
1600
1626
  { provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
1601
1627
  { provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
@@ -1614,9 +1640,18 @@
1614
1640
  lodash.set(cmp, 'path', element.path);
1615
1641
  return cmp;
1616
1642
  };
1617
- ElementsResolver.prototype.getNgComponents = function () {
1618
- var _this = this;
1619
- return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(Boolean);
1643
+ ElementsResolver.prototype.convertInlineStylesToCSS = function (styles) {
1644
+ if (!styles) {
1645
+ return '';
1646
+ }
1647
+ var entries = Object.entries(styles);
1648
+ var result = ':host {';
1649
+ entries.forEach(function (_c) {
1650
+ var _d = __read(_c, 2), style = _d[0], value = _d[1];
1651
+ result += lodash.kebabCase(style) + ":" + value + ";";
1652
+ });
1653
+ result += '}';
1654
+ return result;
1620
1655
  };
1621
1656
  return ElementsResolver;
1622
1657
  }());
@@ -1860,6 +1895,8 @@
1860
1895
  exports.RemoteApplyAction = RemoteApplyAction;
1861
1896
  exports.RemoteCancelAction = RemoteCancelAction;
1862
1897
  exports.SHARED_ELEMENT_METADATA = SHARED_ELEMENT_METADATA;
1898
+ exports.SetDefaultMetrics = SetDefaultMetrics;
1899
+ exports.SwitchObjectAction = SwitchObjectAction;
1863
1900
  exports.TemplatesService = TemplatesService;
1864
1901
  exports.UI_DEFINITION_METADATA = UI_DEFINITION_METADATA;
1865
1902
  exports.UiBuildError = UiBuildError;