@veloceapps/sdk 5.0.8 → 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.
- package/bundles/veloce-sdk-cms.umd.js +34 -4
- package/bundles/veloce-sdk-cms.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +454 -194
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/cms/cms.actions.d.ts +4 -2
- package/cms/types/common.types.d.ts +5 -0
- package/cms/types/index.d.ts +1 -0
- package/cms/types/metrics.types.d.ts +5 -0
- package/cms/utils/elements-resolver.d.ts +2 -1
- package/cms/vendor-map.d.ts +117 -124
- package/esm2015/cms/cms.actions.js +6 -1
- package/esm2015/cms/types/common.types.js +1 -1
- package/esm2015/cms/types/index.js +2 -1
- package/esm2015/cms/types/metrics.types.js +2 -0
- package/esm2015/cms/utils/element.utils.js +6 -1
- package/esm2015/cms/utils/elements-resolver.js +21 -4
- package/esm2015/src/components/header/header.component.js +9 -18
- package/esm2015/src/components/header/header.module.js +6 -2
- package/esm2015/src/components/header/metrics/index.js +2 -0
- package/esm2015/src/components/header/metrics/metrics.component.js +216 -0
- package/esm2015/src/components/header/metrics/metrics.definitions.js +9 -0
- package/esm2015/src/components/header/metrics/metrics.module.js +64 -0
- package/fesm2015/veloce-sdk-cms.js +33 -5
- package/fesm2015/veloce-sdk-cms.js.map +1 -1
- package/fesm2015/veloce-sdk.js +338 -84
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/header.component.d.ts +0 -8
- package/src/components/header/header.module.d.ts +2 -1
- package/src/components/header/metrics/index.d.ts +1 -0
- package/src/components/header/metrics/metrics.component.d.ts +49 -0
- package/src/components/header/metrics/metrics.definitions.d.ts +4 -0
- package/src/components/header/metrics/metrics.module.d.ts +17 -0
@@ -43,6 +43,7 @@
|
|
43
43
|
FlowAction["FLOW_SWITCH_OBJECT"] = "FLOW_SWITCH_OBJECT";
|
44
44
|
FlowAction["REMOTE_APPLY"] = "REMOTE_APPLY";
|
45
45
|
FlowAction["REMOTE_CANCEL"] = "REMOTE_CANCEL";
|
46
|
+
FlowAction["SET_DEFAULT_METRICS"] = "SET_DEFAULT_METRICS";
|
46
47
|
})(exports.FlowAction || (exports.FlowAction = {}));
|
47
48
|
var ConfigureProductAction = function (_a) {
|
48
49
|
var lineItemId = _a.lineItemId, productId = _a.productId;
|
@@ -76,6 +77,10 @@
|
|
76
77
|
type: exports.FlowAction.FLOW_SWITCH_OBJECT,
|
77
78
|
payload: payload,
|
78
79
|
}); };
|
80
|
+
var SetDefaultMetrics = function (metrics) { return ({
|
81
|
+
type: exports.FlowAction.SET_DEFAULT_METRICS,
|
82
|
+
payload: { metrics: metrics },
|
83
|
+
}); };
|
79
84
|
|
80
85
|
var cmsActions = /*#__PURE__*/Object.freeze({
|
81
86
|
__proto__: null,
|
@@ -88,7 +93,8 @@
|
|
88
93
|
CloseDocGenAction: CloseDocGenAction,
|
89
94
|
RemoteApplyAction: RemoteApplyAction,
|
90
95
|
RemoteCancelAction: RemoteCancelAction,
|
91
|
-
SwitchObjectAction: SwitchObjectAction
|
96
|
+
SwitchObjectAction: SwitchObjectAction,
|
97
|
+
SetDefaultMetrics: SetDefaultMetrics
|
92
98
|
});
|
93
99
|
|
94
100
|
/*! *****************************************************************************
|
@@ -843,6 +849,7 @@
|
|
843
849
|
var name = _e.name;
|
844
850
|
return name;
|
845
851
|
}),
|
852
|
+
configuredStyles: metadata.configuredStyles,
|
846
853
|
};
|
847
854
|
var normalizedElMetadata = normalizeElementMetadata(elMetadata);
|
848
855
|
if (!metadata.script || !EXPORTED_CLASS_REGEX.test(metadata.script)) {
|
@@ -911,6 +918,10 @@
|
|
911
918
|
if (!metadata.isShared) {
|
912
919
|
delete metadata.isShared;
|
913
920
|
}
|
921
|
+
// configuredStyles
|
922
|
+
if (!metadata.configuredStyles) {
|
923
|
+
delete metadata.configuredStyles;
|
924
|
+
}
|
914
925
|
return metadata;
|
915
926
|
};
|
916
927
|
var extractElementMetadata = function (script) {
|
@@ -1533,6 +1544,10 @@
|
|
1533
1544
|
finally { if (e_1) throw e_1.error; }
|
1534
1545
|
}
|
1535
1546
|
}
|
1547
|
+
ElementsResolver.prototype.getNgComponents = function () {
|
1548
|
+
var _this = this;
|
1549
|
+
return this.renderableElements.map(function (el) { return _this.resolveElement(el); }).filter(Boolean);
|
1550
|
+
};
|
1536
1551
|
ElementsResolver.prototype.transpile = function (el) {
|
1537
1552
|
var _a;
|
1538
1553
|
if (!el.script) {
|
@@ -1602,6 +1617,11 @@
|
|
1602
1617
|
console.warn("Unknown element type \"" + element.type + "\"");
|
1603
1618
|
return;
|
1604
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
|
+
}
|
1605
1625
|
var component = Object.assign(Object.assign({ selector: 'vl-element', template: element.template }, (element.styles ? { styles: [element.styles] } : {})), { providers: [
|
1606
1626
|
{ provide: DEFAULT_PLUGINS_TOKEN, useValue: defaultPlugins },
|
1607
1627
|
{ provide: UI_DEFINITION_METADATA, useValue: this.uiDef },
|
@@ -1620,9 +1640,18 @@
|
|
1620
1640
|
lodash.set(cmp, 'path', element.path);
|
1621
1641
|
return cmp;
|
1622
1642
|
};
|
1623
|
-
ElementsResolver.prototype.
|
1624
|
-
|
1625
|
-
|
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;
|
1626
1655
|
};
|
1627
1656
|
return ElementsResolver;
|
1628
1657
|
}());
|
@@ -1866,6 +1895,7 @@
|
|
1866
1895
|
exports.RemoteApplyAction = RemoteApplyAction;
|
1867
1896
|
exports.RemoteCancelAction = RemoteCancelAction;
|
1868
1897
|
exports.SHARED_ELEMENT_METADATA = SHARED_ELEMENT_METADATA;
|
1898
|
+
exports.SetDefaultMetrics = SetDefaultMetrics;
|
1869
1899
|
exports.SwitchObjectAction = SwitchObjectAction;
|
1870
1900
|
exports.TemplatesService = TemplatesService;
|
1871
1901
|
exports.UI_DEFINITION_METADATA = UI_DEFINITION_METADATA;
|