config-editor-base 3.1.0 → 3.2.1

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/dist/index.js CHANGED
@@ -5,7 +5,8 @@ var reactRedux = require('react-redux');
5
5
  var classNames = _interopDefault(require('classnames'));
6
6
  var validator = _interopDefault(require('@rjsf/validator-ajv6'));
7
7
  var Form = _interopDefault(require('@rjsf/core'));
8
- var saveAs = _interopDefault(require('file-saver'));
8
+ var saveAs = require('file-saver');
9
+ var saveAs__default = _interopDefault(saveAs);
9
10
  var Select = _interopDefault(require('react-select'));
10
11
  var Files = _interopDefault(require('react-files'));
11
12
  var applyNav = require('rjsf-tabs');
@@ -150,7 +151,7 @@ var loadFile = function loadFile(fileName) {
150
151
  var _require = require('detect-browser'),
151
152
  detect = _require.detect;
152
153
  var browser = detect();
153
- var crcBrowserSupport = ['chrome', 'firefox', 'opera', 'safari', 'edge'].includes(browser.name);
154
+ var crcBrowserSupport = ['chrome', 'firefox', 'opera', 'safari', 'edge'].includes(browser && browser.name);
154
155
 
155
156
  var SET_SCHEMA_LIST = "editor/SET_SCHEMA_LIST";
156
157
  var SET_CONFIG_LIST = "editor/SET_CONFIG_LIST";
@@ -1294,6 +1295,19 @@ var runConfigurationWarningChecks = function runConfigurationWarningChecks(conte
1294
1295
  dispatch(checkCANmodMonitoringMode(content));
1295
1296
  };
1296
1297
  };
1298
+ var collectConfigurationWarnings = function collectConfigurationWarnings(content) {
1299
+ var messages = [];
1300
+ var _capture = function capture(action) {
1301
+ if (typeof action === "function") return action(_capture, function () {
1302
+ return {};
1303
+ });
1304
+ if (action && action.type === "alert/SET" && action.alert && action.alert.type === "warning") {
1305
+ messages.push(action.alert.message);
1306
+ }
1307
+ };
1308
+ _capture(runConfigurationWarningChecks(content));
1309
+ return messages;
1310
+ };
1297
1311
  var checkCANmodMonitoringMode = function checkCANmodMonitoringMode(content) {
1298
1312
  return function (dispatch) {
1299
1313
  var _content$phy, _content$phy$can, _content$phy$can$phy;
@@ -1314,7 +1328,7 @@ var saveUpdatedConfiguration = function saveUpdatedConfiguration(filename, conte
1314
1328
  var blob = new Blob([JSON.stringify(content, null, 2)], {
1315
1329
  type: "text/json"
1316
1330
  });
1317
- saveAs(blob, "" + filename);
1331
+ saveAs__default(blob, "" + filename);
1318
1332
  };
1319
1333
  };
1320
1334
  var setUpdatedFormData = function setUpdatedFormData(formData) {
@@ -1433,6 +1447,7 @@ var actions = {
1433
1447
  checkFileSplitValue: checkFileSplitValue,
1434
1448
  checkGNSSEstimate: checkGNSSEstimate,
1435
1449
  runConfigurationWarningChecks: runConfigurationWarningChecks,
1450
+ collectConfigurationWarnings: collectConfigurationWarnings,
1436
1451
  checkCANmodMonitoringMode: checkCANmodMonitoringMode,
1437
1452
  saveUpdatedConfiguration: saveUpdatedConfiguration,
1438
1453
  setUpdatedFormData: setUpdatedFormData,
@@ -18938,11 +18953,9 @@ var PartialConfigLoader = /*#__PURE__*/function (_React$Component) {
18938
18953
  var _this$props = this.props,
18939
18954
  formData = _this$props.formData,
18940
18955
  schemaContent = _this$props.schemaContent;
18941
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "Partial config loader"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
18956
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "Partial config loader"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
18942
18957
  className: "form-group pl0 field-string"
18943
18958
  }, /*#__PURE__*/React.createElement("p", {
18944
- className: "reduced-margin"
18945
- }, "Upload partial Configuration File"), /*#__PURE__*/React.createElement("p", {
18946
18959
  className: "field-description field-description-shift"
18947
18960
  }, "Select a JSON file containing a partial Configuration File. This lets you e.g. load a list of transmit messages or filters. The loaded JSON is validated vs. the Rule Schema, after which it can be merged into the editor Configuration File (even if it is not valid)")), /*#__PURE__*/React.createElement("div", null, formData ? /*#__PURE__*/React.createElement("div", {
18948
18961
  className: "text-area-wrapper row no-gutters reduced-margin"
@@ -18961,20 +18974,31 @@ var PartialConfigLoader = /*#__PURE__*/function (_React$Component) {
18961
18974
  minFileSize: 0,
18962
18975
  clickable: true
18963
18976
  }, /*#__PURE__*/React.createElement("button", {
18964
- className: "btn btn-primary"
18977
+ className: "btn btn-primary",
18978
+ title: "Upload a partial Configuration File to merge it"
18965
18979
  }, "Load JSON file"), /*#__PURE__*/React.createElement("div", {
18966
18980
  className: "browse-file-name"
18967
- }, jsonFileName))), Object.keys(jsonFile).length ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("pre", {
18981
+ }, jsonFileName))), Object.keys(jsonFile).length ? /*#__PURE__*/React.createElement("div", {
18982
+ className: "text-area-wrapper row no-gutters"
18983
+ }, /*#__PURE__*/React.createElement("pre", {
18968
18984
  className: "browse-file-preview"
18969
- }, JSON.stringify(jsonFile, null, 2)), formData ? /*#__PURE__*/React.createElement("div", null, mergedConfigValid ? /*#__PURE__*/React.createElement("span", null, " ", /*#__PURE__*/React.createElement("p", {
18970
- className: "btn-highlight"
18985
+ }, JSON.stringify(jsonFile, null, 2)), formData ? /*#__PURE__*/React.createElement("div", null, mergedConfigValid ? /*#__PURE__*/React.createElement("div", {
18986
+ className: "btn-highlight",
18987
+ style: {
18988
+ fontSize: "12px",
18989
+ marginBottom: "8px"
18990
+ }
18971
18991
  }, /*#__PURE__*/React.createElement("i", {
18972
18992
  className: "fa fa-check"
18973
- }), " \xA0Merged Configuration File validated")) : null, !mergedConfigValid ? /*#__PURE__*/React.createElement("p", {
18974
- className: "red-text"
18993
+ }), " Merged Configuration File validated") : null, !mergedConfigValid ? /*#__PURE__*/React.createElement("div", {
18994
+ className: "red-text",
18995
+ style: {
18996
+ fontSize: "12px",
18997
+ marginBottom: "8px"
18998
+ }
18975
18999
  }, /*#__PURE__*/React.createElement("i", {
18976
19000
  className: "fa fa-times"
18977
- }), " \xA0Merged Configuration File is invalid") : null, /*#__PURE__*/React.createElement("button", {
19001
+ }), " Merged Configuration File is invalid") : null, /*#__PURE__*/React.createElement("button", {
18978
19002
  className: "btn btn-primary",
18979
19003
  onClick: this.onReview
18980
19004
  }, "Merge files")) : null) : null) : /*#__PURE__*/React.createElement("div", {
@@ -19151,6 +19175,57 @@ function ArrayFieldTemplate(props) {
19151
19175
  }), " "))));
19152
19176
  }
19153
19177
 
19178
+ var isPlainObject = function isPlainObject(value) {
19179
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
19180
+ };
19181
+ var jsonEqual = function jsonEqual(a, b) {
19182
+ return JSON.stringify(a) === JSON.stringify(b);
19183
+ };
19184
+ var clone = function clone(value) {
19185
+ return JSON.parse(JSON.stringify(value));
19186
+ };
19187
+ var computeConfigDelta = function computeConfigDelta(past, current) {
19188
+ var deletions = [];
19189
+ if (!isPlainObject(past) || !isPlainObject(current)) {
19190
+ return {
19191
+ partial: isPlainObject(current) ? clone(current) : {},
19192
+ deletions: deletions
19193
+ };
19194
+ }
19195
+ var _walk = function walk(pastNode, currentNode, path) {
19196
+ var partialNode = {};
19197
+ Object.keys(currentNode).forEach(function (key) {
19198
+ var childPath = path ? path + '.' + key : key;
19199
+ var pastValue = pastNode[key];
19200
+ var currentValue = currentNode[key];
19201
+ if (!(key in pastNode)) {
19202
+ partialNode[key] = clone(currentValue);
19203
+ } else if (isPlainObject(pastValue) && isPlainObject(currentValue)) {
19204
+ var childPartial = _walk(pastValue, currentValue, childPath);
19205
+ if (Object.keys(childPartial).length) {
19206
+ partialNode[key] = childPartial;
19207
+ }
19208
+ } else if (!jsonEqual(pastValue, currentValue)) {
19209
+ if (Array.isArray(pastValue) && isPlainObject(currentValue)) {
19210
+ deletions.push(childPath);
19211
+ } else {
19212
+ partialNode[key] = clone(currentValue);
19213
+ }
19214
+ }
19215
+ });
19216
+ Object.keys(pastNode).forEach(function (key) {
19217
+ if (!(key in currentNode)) {
19218
+ deletions.push(path ? path + '.' + key : key);
19219
+ }
19220
+ });
19221
+ return partialNode;
19222
+ };
19223
+ return {
19224
+ partial: _walk(past, current, ''),
19225
+ deletions: deletions
19226
+ };
19227
+ };
19228
+
19154
19229
  var selectOptions$1 = function selectOptions(Files) {
19155
19230
  Files = lodash.orderBy(Files, ["name"], ["desc"]);
19156
19231
  return [].concat(Files, [{
@@ -19166,7 +19241,7 @@ var pastCrc32 = "N/A";
19166
19241
  var _require$1 = require("detect-browser"),
19167
19242
  detect$1 = _require$1.detect;
19168
19243
  var browser$1 = detect$1();
19169
- var crcBrowserSupport$1 = ["chrome", "firefox", "opera", "safari", "edge"].includes(browser$1.name);
19244
+ var crcBrowserSupport$1 = ["chrome", "firefox", "opera", "safari", "edge"].includes(browser$1 && browser$1.name);
19170
19245
  var EditorChangesComparison = /*#__PURE__*/function (_React$Component) {
19171
19246
  function EditorChangesComparison(props) {
19172
19247
  var _this;
@@ -19179,6 +19254,68 @@ var EditorChangesComparison = /*#__PURE__*/function (_React$Component) {
19179
19254
  _this.handleSelectChange = function (selectedValue) {
19180
19255
  _this.props.handleDropdownChange(selectedValue.value, "Previous Configuration File");
19181
19256
  };
19257
+ _this.getPartialDelta = function () {
19258
+ var _this$props = _this.props,
19259
+ past = _this$props.past,
19260
+ current = _this$props.current,
19261
+ showAlert = _this$props.showAlert;
19262
+ var pastObj = null;
19263
+ try {
19264
+ pastObj = JSON.parse(past);
19265
+ } catch (e) {
19266
+ pastObj = null;
19267
+ }
19268
+ if (!pastObj || typeof pastObj !== "object") {
19269
+ if (showAlert) {
19270
+ showAlert("info", "Select a Previous Configuration File first");
19271
+ }
19272
+ return null;
19273
+ }
19274
+ var _computeConfigDelta = computeConfigDelta(pastObj, current),
19275
+ partial = _computeConfigDelta.partial,
19276
+ deletions = _computeConfigDelta.deletions;
19277
+ if (!Object.keys(partial).length) {
19278
+ if (showAlert) {
19279
+ showAlert("info", "No changes detected vs. the Previous Configuration File");
19280
+ }
19281
+ return null;
19282
+ }
19283
+ if (deletions.length && showAlert) {
19284
+ showAlert("warning", deletions.length + " deleted setting(s) cannot be expressed in a partial config and were excluded: " + deletions.join(", "));
19285
+ }
19286
+ return {
19287
+ partial: partial,
19288
+ deletions: deletions
19289
+ };
19290
+ };
19291
+ _this.onDownloadPartial = function () {
19292
+ var delta = _this.getPartialDelta();
19293
+ if (!delta) {
19294
+ return;
19295
+ }
19296
+ var revisedConfigFile = _this.props.revisedConfigFile;
19297
+ var fileName = "partial-" + (revisedConfigFile && revisedConfigFile.value || "config.json");
19298
+ var blob = new Blob([JSON.stringify(delta.partial, null, 2)], {
19299
+ type: "text/json"
19300
+ });
19301
+ saveAs.saveAs(blob, fileName);
19302
+ };
19303
+ _this.onTransferClick = function () {
19304
+ var delta = _this.getPartialDelta();
19305
+ if (!delta) {
19306
+ return;
19307
+ }
19308
+ var _this$props2 = _this.props,
19309
+ onTransferPartial = _this$props2.onTransferPartial,
19310
+ closeChangesModal = _this$props2.closeChangesModal,
19311
+ revisedConfigFile = _this$props2.revisedConfigFile;
19312
+ closeChangesModal();
19313
+ onTransferPartial({
19314
+ partial: delta.partial,
19315
+ deletions: delta.deletions,
19316
+ configName: revisedConfigFile && revisedConfigFile.value || null
19317
+ });
19318
+ };
19182
19319
  _this.toggleCheckbox = _this.toggleCheckbox.bind(_this);
19183
19320
  _this.handleSelectChange = _this.handleSelectChange.bind(_this);
19184
19321
  _this.state = {
@@ -19189,17 +19326,17 @@ var EditorChangesComparison = /*#__PURE__*/function (_React$Component) {
19189
19326
  _inheritsLoose(EditorChangesComparison, _React$Component);
19190
19327
  var _proto = EditorChangesComparison.prototype;
19191
19328
  _proto.render = function render() {
19192
- var _this$props = this.props,
19193
- options = _this$props.options,
19194
- selected = _this$props.selected,
19195
- past = _this$props.past,
19196
- current = _this$props.current,
19197
- closeChangesModal = _this$props.closeChangesModal,
19198
- revisedConfigFile = _this$props.revisedConfigFile,
19199
- crc32EditorLive = _this$props.crc32EditorLive,
19200
- isCompareChanges = _this$props.isCompareChanges,
19201
- enableDownload = _this$props.enableDownload,
19202
- externalSubmit = _this$props.externalSubmit;
19329
+ var _this$props3 = this.props,
19330
+ options = _this$props3.options,
19331
+ selected = _this$props3.selected,
19332
+ past = _this$props3.past,
19333
+ current = _this$props3.current,
19334
+ closeChangesModal = _this$props3.closeChangesModal,
19335
+ revisedConfigFile = _this$props3.revisedConfigFile,
19336
+ crc32EditorLive = _this$props3.crc32EditorLive,
19337
+ isCompareChanges = _this$props3.isCompareChanges,
19338
+ enableDownload = _this$props3.enableDownload,
19339
+ externalSubmit = _this$props3.externalSubmit;
19203
19340
  var pastCleaned = past && Object.keys(past).length ? JSON.stringify(JSON.parse(past), null, 2) : "";
19204
19341
  if (crcBrowserSupport$1 == 1 && past && Object.keys(past).length) {
19205
19342
  var _require2 = require("crc"),
@@ -19208,6 +19345,15 @@ var EditorChangesComparison = /*#__PURE__*/function (_React$Component) {
19208
19345
  } else {
19209
19346
  pastCrc32 = "N/A";
19210
19347
  }
19348
+ var partialAvailable = false;
19349
+ try {
19350
+ var pastObj = past ? JSON.parse(past) : null;
19351
+ if (pastObj && typeof pastObj === "object") {
19352
+ partialAvailable = Object.keys(computeConfigDelta(pastObj, current).partial).length > 0;
19353
+ }
19354
+ } catch (e) {
19355
+ partialAvailable = false;
19356
+ }
19211
19357
  return /*#__PURE__*/React.createElement("div", {
19212
19358
  className: isCompareChanges ? "show modal-custom-wrapper" : "hidden modal-custom-wrapper"
19213
19359
  }, /*#__PURE__*/React.createElement("div", {
@@ -19284,7 +19430,19 @@ var EditorChangesComparison = /*#__PURE__*/function (_React$Component) {
19284
19430
  type: "submit",
19285
19431
  onClick: enableDownload,
19286
19432
  className: "btn btn-primary ml15"
19287
- }, " ", "Download to disk", " "))));
19433
+ }, " ", "Download to disk", " "), /*#__PURE__*/React.createElement("button", {
19434
+ type: "button",
19435
+ onClick: this.onDownloadPartial,
19436
+ className: "btn btn-white ml15",
19437
+ disabled: !partialAvailable,
19438
+ title: "Download the delta changes as a partial config JSON e.g. for application across multiple devices"
19439
+ }, " ", "Download partial JSON to disk", " "), typeof this.props.onTransferPartial === "function" ? /*#__PURE__*/React.createElement("button", {
19440
+ type: "button",
19441
+ onClick: this.onTransferClick,
19442
+ className: "btn btn-white ml15",
19443
+ disabled: !partialAvailable,
19444
+ title: "Transfer the delta changes as a partial config JSON to the OTA batch manager for application across multiple devices"
19445
+ }, " ", "Transfer to OTA batch manager", " ") : null)));
19288
19446
  };
19289
19447
  return EditorChangesComparison;
19290
19448
  }(React.Component);
@@ -19619,7 +19777,9 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19619
19777
  handleDropdownChange: this.handleDropdownChange,
19620
19778
  closeChangesModal: this.closeChangesModal,
19621
19779
  enableDownload: this.enableDownload.bind(this),
19622
- externalSubmit: this.props.fetchFileContentExt ? true : false
19780
+ externalSubmit: this.props.fetchFileContentExt ? true : false,
19781
+ showAlert: this.props.showAlert,
19782
+ onTransferPartial: this.props.onTransferPartial
19623
19783
  }), /*#__PURE__*/React.createElement("div", {
19624
19784
  className: classNames({
19625
19785
  'config-bar': true,
@@ -19834,6 +19994,64 @@ var SimpleDropdown = /*#__PURE__*/function (_React$Component) {
19834
19994
  return SimpleDropdown;
19835
19995
  }(React.Component);
19836
19996
 
19997
+ var CollapsiblePreview = /*#__PURE__*/function (_React$Component) {
19998
+ function CollapsiblePreview() {
19999
+ return _React$Component.apply(this, arguments) || this;
20000
+ }
20001
+ _inheritsLoose(CollapsiblePreview, _React$Component);
20002
+ var _proto = CollapsiblePreview.prototype;
20003
+ _proto.render = function render() {
20004
+ var _this$props = this.props,
20005
+ open = _this$props.open,
20006
+ onToggle = _this$props.onToggle,
20007
+ data = _this$props.data,
20008
+ onDownload = _this$props.onDownload,
20009
+ label = _this$props.label;
20010
+ return /*#__PURE__*/React.createElement("div", {
20011
+ style: {
20012
+ marginTop: "10px"
20013
+ }
20014
+ }, /*#__PURE__*/React.createElement("div", {
20015
+ onClick: onToggle,
20016
+ style: {
20017
+ display: "inline-flex",
20018
+ alignItems: "center",
20019
+ cursor: "pointer",
20020
+ fontSize: "12px",
20021
+ color: "#999999",
20022
+ userSelect: "none"
20023
+ }
20024
+ }, /*#__PURE__*/React.createElement("i", {
20025
+ className: open ? "fa fa-angle-down" : "fa fa-angle-right",
20026
+ style: {
20027
+ marginRight: "6px",
20028
+ width: "8px"
20029
+ }
20030
+ }), label || "Show partial config preview"), open ? /*#__PURE__*/React.createElement("div", {
20031
+ style: {
20032
+ marginTop: "10px"
20033
+ }
20034
+ }, /*#__PURE__*/React.createElement("pre", {
20035
+ className: "browse-file-preview",
20036
+ style: {
20037
+ maxHeight: "300px",
20038
+ overflow: "auto",
20039
+ fontSize: "11px"
20040
+ }
20041
+ }, JSON.stringify(data, null, 2)), onDownload ? /*#__PURE__*/React.createElement("button", {
20042
+ className: "btn",
20043
+ onClick: onDownload,
20044
+ style: {
20045
+ backgroundColor: "#fff",
20046
+ border: "1px solid #ccc",
20047
+ color: "#333",
20048
+ marginTop: "8px"
20049
+ }
20050
+ }, "Download JSON") : null) : null);
20051
+ };
20052
+ return CollapsiblePreview;
20053
+ }(React.Component);
20054
+
19837
20055
  var obdPids = [
19838
20056
  {
19839
20057
  service: "01",
@@ -22745,48 +22963,28 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
22745
22963
  marginBottom: "15px",
22746
22964
  marginTop: "10px"
22747
22965
  }
22748
- }, "When testing supported PIDs, make sure the ignition is on for 2 minutes before you connect the device. Let the device be connected for 5 minutes to perform the test."), mergedConfigValid === false && /*#__PURE__*/React.createElement("p", {
22749
- className: "red-text"
22966
+ }, "When testing supported PIDs, make sure the ignition is on for 2 minutes before you connect the device. Let the device be connected for 5 minutes to perform the test."), mergedConfigValid === false && /*#__PURE__*/React.createElement("div", {
22967
+ className: "red-text",
22968
+ style: {
22969
+ fontSize: "12px",
22970
+ marginBottom: "8px"
22971
+ }
22750
22972
  }, /*#__PURE__*/React.createElement("i", {
22751
22973
  className: "fa fa-times"
22752
22974
  }), " Merged Configuration File is invalid"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
22753
22975
  className: "btn btn-primary",
22754
22976
  onClick: this.onMerge,
22755
22977
  disabled: !formData || Object.keys(formData).length === 0 || mergedConfigValid !== true
22756
- }, "Merge files"), /*#__PURE__*/React.createElement("button", {
22757
- className: "btn btn-default",
22758
- onClick: this.onDownload,
22759
- disabled: Object.keys(generatedConfig).length === 0,
22760
- style: {
22761
- marginLeft: "10px"
22762
- }
22763
- }, "Download JSON"))), Object.keys(generatedConfig).length > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
22764
- style: {
22765
- display: "flex",
22766
- alignItems: "center",
22767
- cursor: "pointer",
22768
- fontSize: "12px",
22769
- marginTop: "8px"
22770
- }
22771
- }, /*#__PURE__*/React.createElement("input", {
22772
- type: "checkbox",
22773
- checked: showPreview,
22774
- onChange: function onChange() {
22978
+ }, "Merge files"))), Object.keys(generatedConfig).length > 0 && /*#__PURE__*/React.createElement(CollapsiblePreview, {
22979
+ open: showPreview,
22980
+ onToggle: function onToggle() {
22775
22981
  return _this9.setState({
22776
22982
  showPreview: !showPreview
22777
22983
  });
22778
22984
  },
22779
- style: {
22780
- marginRight: "6px",
22781
- marginBottom: "4px"
22782
- }
22783
- }), "Show partial config preview"), showPreview && /*#__PURE__*/React.createElement("div", {
22784
- style: {
22785
- marginTop: "10px"
22786
- }
22787
- }, /*#__PURE__*/React.createElement("pre", {
22788
- className: "browse-file-preview"
22789
- }, JSON.stringify(combinedConfig, null, 2))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
22985
+ data: combinedConfig,
22986
+ onDownload: this.onDownload
22987
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
22790
22988
  };
22791
22989
  return OBDTool;
22792
22990
  }(React.Component);
@@ -24871,7 +25069,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24871
25069
  style: {
24872
25070
  width: barWidth + "px",
24873
25071
  height: "10px",
24874
- backgroundColor: "#4a90d9",
25072
+ backgroundColor: "#46a5e0",
24875
25073
  borderRadius: "2px",
24876
25074
  display: "inline-block"
24877
25075
  }
@@ -25337,7 +25535,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25337
25535
  }
25338
25536
  }, "Select: "), /*#__PURE__*/React.createElement("span", {
25339
25537
  style: {
25340
- color: "#337ab7",
25538
+ color: "#46a5e0",
25341
25539
  cursor: "pointer",
25342
25540
  marginLeft: "4px"
25343
25541
  },
@@ -25351,7 +25549,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25351
25549
  }
25352
25550
  }, "|"), /*#__PURE__*/React.createElement("span", {
25353
25551
  style: {
25354
- color: "#337ab7",
25552
+ color: "#46a5e0",
25355
25553
  cursor: "pointer"
25356
25554
  },
25357
25555
  onClick: function onClick() {
@@ -25364,7 +25562,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25364
25562
  }
25365
25563
  }, "|"), /*#__PURE__*/React.createElement("span", {
25366
25564
  style: {
25367
- color: "#337ab7",
25565
+ color: "#46a5e0",
25368
25566
  cursor: "pointer"
25369
25567
  },
25370
25568
  onClick: function onClick() {
@@ -25377,7 +25575,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25377
25575
  }
25378
25576
  }, "|"), /*#__PURE__*/React.createElement("span", {
25379
25577
  style: {
25380
- color: "#337ab7",
25578
+ color: "#46a5e0",
25381
25579
  cursor: "pointer"
25382
25580
  },
25383
25581
  onClick: function onClick() {
@@ -25645,11 +25843,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25645
25843
  className: "btn btn-primary",
25646
25844
  onClick: _this10.onMerge,
25647
25845
  disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25648
- }, "Merge files"), /*#__PURE__*/React.createElement("button", {
25649
- className: "btn btn-default",
25650
- onClick: _this10.onDownload,
25651
- disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
25652
- }, "Download JSON")), function () {
25846
+ }, "Merge files")), function () {
25653
25847
  var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25654
25848
  if (!mergeDisabled) return null;
25655
25849
  var reason = "";
@@ -25672,41 +25866,16 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25672
25866
  }
25673
25867
  }, reason) : null;
25674
25868
  }());
25675
- }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25676
- style: {
25677
- marginTop: "10px"
25678
- }
25679
- }, /*#__PURE__*/React.createElement("label", {
25680
- style: {
25681
- display: "flex",
25682
- alignItems: "center",
25683
- cursor: "pointer",
25684
- fontSize: "12px"
25685
- }
25686
- }, /*#__PURE__*/React.createElement("input", {
25687
- type: "checkbox",
25688
- checked: _this10.state.showFilterPreview,
25689
- onChange: function onChange() {
25869
+ }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement(CollapsiblePreview, {
25870
+ open: _this10.state.showFilterPreview,
25871
+ onToggle: function onToggle() {
25690
25872
  return _this10.setState({
25691
25873
  showFilterPreview: !_this10.state.showFilterPreview
25692
25874
  });
25693
25875
  },
25694
- style: {
25695
- marginRight: "6px",
25696
- marginBottom: "4px"
25697
- }
25698
- }), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25699
- style: {
25700
- marginTop: "10px"
25701
- }
25702
- }, /*#__PURE__*/React.createElement("pre", {
25703
- className: "browse-file-preview",
25704
- style: {
25705
- maxHeight: "300px",
25706
- overflow: "auto",
25707
- fontSize: "11px"
25708
- }
25709
- }, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
25876
+ data: _this10.state.generatedFilterConfig,
25877
+ onDownload: _this10.onDownload
25878
+ }));
25710
25879
  }()), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
25711
25880
  };
25712
25881
  return FilterBuilderTool;
@@ -25734,6 +25903,7 @@ var FilterBuilderTool$1 = reactRedux.connect(mapStateToProps$4, mapDispatchToPro
25734
25903
  exports.EditorSection = EditorSection$1;
25735
25904
  exports.FilterBuilderTool = FilterBuilderTool$1;
25736
25905
  exports.OBDTool = OBDTool$1;
25906
+ exports.computeConfigDelta = computeConfigDelta;
25737
25907
  exports.editor = reducer;
25738
25908
  exports.editorActions = actions;
25739
25909
  //# sourceMappingURL=index.js.map