config-editor-base 1.5.7 → 1.5.8

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.
@@ -10,7 +10,7 @@ import { GENERIC_NAV } from 'react-jsonschema-form-pagination/lib/utils';
10
10
  import { ReactGhLikeDiff } from 'react-gh-like-diff';
11
11
 
12
12
  function _extends() {
13
- _extends = Object.assign || function (target) {
13
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
14
14
  for (var i = 1; i < arguments.length; i++) {
15
15
  var source = arguments[i];
16
16
 
@@ -23,14 +23,22 @@ function _extends() {
23
23
 
24
24
  return target;
25
25
  };
26
-
27
26
  return _extends.apply(this, arguments);
28
27
  }
29
28
 
30
29
  function _inheritsLoose(subClass, superClass) {
31
30
  subClass.prototype = Object.create(superClass.prototype);
32
31
  subClass.prototype.constructor = subClass;
33
- subClass.__proto__ = superClass;
32
+
33
+ _setPrototypeOf(subClass, superClass);
34
+ }
35
+
36
+ function _setPrototypeOf(o, p) {
37
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
38
+ o.__proto__ = p;
39
+ return o;
40
+ };
41
+ return _setPrototypeOf(o, p);
34
42
  }
35
43
 
36
44
  function _assertThisInitialized(self) {
@@ -41,6 +49,41 @@ function _assertThisInitialized(self) {
41
49
  return self;
42
50
  }
43
51
 
52
+ var SET = "alert/SET";
53
+ var CLEAR = "alert/CLEAR";
54
+ var alertId = 0;
55
+ var set = function set(alert) {
56
+ var id = alertId++;
57
+ return function (dispatch) {
58
+ if (alert.type == "warning") {
59
+ setTimeout(function () {
60
+ dispatch({
61
+ type: CLEAR,
62
+ alert: {
63
+ id: id
64
+ }
65
+ });
66
+ }, 10000);
67
+ } else if (alert.type !== "danger" || alert.autoClear) {
68
+ setTimeout(function () {
69
+ dispatch({
70
+ type: CLEAR,
71
+ alert: {
72
+ id: id
73
+ }
74
+ });
75
+ }, 5000);
76
+ }
77
+
78
+ dispatch({
79
+ type: SET,
80
+ alert: Object.assign({}, alert, {
81
+ id: id
82
+ })
83
+ });
84
+ };
85
+ };
86
+
44
87
  var demoConfig = 'config-01.04.json';
45
88
  var regexUISchemaPublic = new RegExp(/^uischema-\d{2}\.\d{2}\.json/, 'g');
46
89
  var regexSchemaPublic = new RegExp(/^schema-\d{2}\.\d{2}\.json/, 'g');
@@ -239,6 +282,16 @@ var handleUploadedFile = function handleUploadedFile(file, dropdown, schemaAry,
239
282
  dispatch(publicSchemaFiles(file.name, schemaAry, contentJSON, uiSchemaAry));
240
283
  }
241
284
 
285
+ var configIncludesServerDetails = JSON.stringify(contentJSON, null, 2).includes("http://") || JSON.stringify(contentJSON, null, 2).includes("https://");
286
+
287
+ if (configIncludesServerDetails) {
288
+ dispatch(set({
289
+ type: "warning",
290
+ message: "If your device is already connected to your server, changes made via the SD will be overwritten by the server Configuration File",
291
+ autoClear: false
292
+ }));
293
+ }
294
+
242
295
  dispatch(setConfigContentLocal(content));
243
296
  dispatch(setConfigContent(contentJSON));
244
297
  dispatch(resetLocalConfigList());
@@ -1553,14 +1606,15 @@ var lodash = createCommonjsModule(function (module, exports) {
1553
1606
  var undefined$1;
1554
1607
 
1555
1608
  /** Used as the semantic version number. */
1556
- var VERSION = '4.17.20';
1609
+ var VERSION = '4.17.21';
1557
1610
 
1558
1611
  /** Used as the size to enable large array optimizations. */
1559
1612
  var LARGE_ARRAY_SIZE = 200;
1560
1613
 
1561
1614
  /** Error message constants. */
1562
1615
  var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
1563
- FUNC_ERROR_TEXT = 'Expected a function';
1616
+ FUNC_ERROR_TEXT = 'Expected a function',
1617
+ INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
1564
1618
 
1565
1619
  /** Used to stand-in for `undefined` hash values. */
1566
1620
  var HASH_UNDEFINED = '__lodash_hash_undefined__';
@@ -1693,10 +1747,11 @@ var lodash = createCommonjsModule(function (module, exports) {
1693
1747
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
1694
1748
  reHasRegExpChar = RegExp(reRegExpChar.source);
1695
1749
 
1696
- /** Used to match leading and trailing whitespace. */
1697
- var reTrim = /^\s+|\s+$/g,
1698
- reTrimStart = /^\s+/,
1699
- reTrimEnd = /\s+$/;
1750
+ /** Used to match leading whitespace. */
1751
+ var reTrimStart = /^\s+/;
1752
+
1753
+ /** Used to match a single whitespace character. */
1754
+ var reWhitespace = /\s/;
1700
1755
 
1701
1756
  /** Used to match wrap detail comments. */
1702
1757
  var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
@@ -1706,6 +1761,18 @@ var lodash = createCommonjsModule(function (module, exports) {
1706
1761
  /** Used to match words composed of alphanumeric characters. */
1707
1762
  var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
1708
1763
 
1764
+ /**
1765
+ * Used to validate the `validate` option in `_.template` variable.
1766
+ *
1767
+ * Forbids characters which could potentially change the meaning of the function argument definition:
1768
+ * - "()," (modification of function parameters)
1769
+ * - "=" (default value)
1770
+ * - "[]{}" (destructuring of function parameters)
1771
+ * - "/" (beginning of a comment)
1772
+ * - whitespace
1773
+ */
1774
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
1775
+
1709
1776
  /** Used to match backslashes in property paths. */
1710
1777
  var reEscapeChar = /\\(\\)?/g;
1711
1778
 
@@ -2534,6 +2601,19 @@ var lodash = createCommonjsModule(function (module, exports) {
2534
2601
  });
2535
2602
  }
2536
2603
 
2604
+ /**
2605
+ * The base implementation of `_.trim`.
2606
+ *
2607
+ * @private
2608
+ * @param {string} string The string to trim.
2609
+ * @returns {string} Returns the trimmed string.
2610
+ */
2611
+ function baseTrim(string) {
2612
+ return string
2613
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
2614
+ : string;
2615
+ }
2616
+
2537
2617
  /**
2538
2618
  * The base implementation of `_.unary` without support for storing metadata.
2539
2619
  *
@@ -2867,6 +2947,21 @@ var lodash = createCommonjsModule(function (module, exports) {
2867
2947
  : asciiToArray(string);
2868
2948
  }
2869
2949
 
2950
+ /**
2951
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
2952
+ * character of `string`.
2953
+ *
2954
+ * @private
2955
+ * @param {string} string The string to inspect.
2956
+ * @returns {number} Returns the index of the last non-whitespace character.
2957
+ */
2958
+ function trimmedEndIndex(string) {
2959
+ var index = string.length;
2960
+
2961
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
2962
+ return index;
2963
+ }
2964
+
2870
2965
  /**
2871
2966
  * Used by `_.unescape` to convert HTML entities to characters.
2872
2967
  *
@@ -14035,7 +14130,7 @@ var lodash = createCommonjsModule(function (module, exports) {
14035
14130
  if (typeof value != 'string') {
14036
14131
  return value === 0 ? value : +value;
14037
14132
  }
14038
- value = value.replace(reTrim, '');
14133
+ value = baseTrim(value);
14039
14134
  var isBinary = reIsBinary.test(value);
14040
14135
  return (isBinary || reIsOctal.test(value))
14041
14136
  ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
@@ -16407,6 +16502,12 @@ var lodash = createCommonjsModule(function (module, exports) {
16407
16502
  if (!variable) {
16408
16503
  source = 'with (obj) {\n' + source + '\n}\n';
16409
16504
  }
16505
+ // Throw an error if a forbidden character was found in `variable`, to prevent
16506
+ // potential command injection attacks.
16507
+ else if (reForbiddenIdentifierChars.test(variable)) {
16508
+ throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
16509
+ }
16510
+
16410
16511
  // Cleanup code by stripping empty strings.
16411
16512
  source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
16412
16513
  .replace(reEmptyStringMiddle, '$1')
@@ -16520,7 +16621,7 @@ var lodash = createCommonjsModule(function (module, exports) {
16520
16621
  function trim(string, chars, guard) {
16521
16622
  string = toString(string);
16522
16623
  if (string && (guard || chars === undefined$1)) {
16523
- return string.replace(reTrim, '');
16624
+ return baseTrim(string);
16524
16625
  }
16525
16626
  if (!string || !(chars = baseToString(chars))) {
16526
16627
  return string;
@@ -16555,7 +16656,7 @@ var lodash = createCommonjsModule(function (module, exports) {
16555
16656
  function trimEnd(string, chars, guard) {
16556
16657
  string = toString(string);
16557
16658
  if (string && (guard || chars === undefined$1)) {
16558
- return string.replace(reTrimEnd, '');
16659
+ return string.slice(0, trimmedEndIndex(string) + 1);
16559
16660
  }
16560
16661
  if (!string || !(chars = baseToString(chars))) {
16561
16662
  return string;