@knovator/pagecreator-admin 0.7.5 → 0.8.0

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/index.js CHANGED
@@ -1746,6 +1746,8 @@ const TRANSLATION_PAIRS_WIDGET = {
1746
1746
  'widget.widgetTitleInfo': 'HTML is supported',
1747
1747
  'widget.minPerRow': 'Value must be greater than zero',
1748
1748
  'widget.actionsLabel': 'Actions',
1749
+ 'widget.category': 'Category',
1750
+ 'widget.categoryPlaceholder': 'Select Category',
1749
1751
  'widget.tabNameRequired': 'Tab Name is required'
1750
1752
  };
1751
1753
  const TRANSLATION_PAIRS_ITEM = {
@@ -1870,6 +1872,70 @@ var toString$6 = function (argument) {
1870
1872
  return $String(argument);
1871
1873
  };
1872
1874
 
1875
+ // a string of all valid unicode whitespaces
1876
+ var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1877
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1878
+
1879
+ var uncurryThis$b = functionUncurryThis;
1880
+ var requireObjectCoercible$3 = requireObjectCoercible$6;
1881
+ var toString$5 = toString$6;
1882
+ var whitespaces$2 = whitespaces$3;
1883
+
1884
+ var replace$2 = uncurryThis$b(''.replace);
1885
+ var whitespace = '[' + whitespaces$2 + ']';
1886
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
1887
+ var rtrim = RegExp(whitespace + whitespace + '*$');
1888
+
1889
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1890
+ var createMethod$2 = function (TYPE) {
1891
+ return function ($this) {
1892
+ var string = toString$5(requireObjectCoercible$3($this));
1893
+ if (TYPE & 1) string = replace$2(string, ltrim, '');
1894
+ if (TYPE & 2) string = replace$2(string, rtrim, '');
1895
+ return string;
1896
+ };
1897
+ };
1898
+
1899
+ var stringTrim = {
1900
+ // `String.prototype.{ trimLeft, trimStart }` methods
1901
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1902
+ start: createMethod$2(1),
1903
+ // `String.prototype.{ trimRight, trimEnd }` methods
1904
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
1905
+ end: createMethod$2(2),
1906
+ // `String.prototype.trim` method
1907
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1908
+ trim: createMethod$2(3)
1909
+ };
1910
+
1911
+ var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
1912
+ var fails$b = fails$n;
1913
+ var whitespaces$1 = whitespaces$3;
1914
+
1915
+ var non = '\u200B\u0085\u180E';
1916
+
1917
+ // check that a method works with the correct list
1918
+ // of whitespaces and has a correct name
1919
+ var stringTrimForced = function (METHOD_NAME) {
1920
+ return fails$b(function () {
1921
+ return !!whitespaces$1[METHOD_NAME]()
1922
+ || non[METHOD_NAME]() !== non
1923
+ || (PROPER_FUNCTION_NAME$1 && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
1924
+ });
1925
+ };
1926
+
1927
+ var $$c = _export;
1928
+ var $trim = stringTrim.trim;
1929
+ var forcedStringTrimMethod = stringTrimForced;
1930
+
1931
+ // `String.prototype.trim` method
1932
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1933
+ $$c({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1934
+ trim: function trim() {
1935
+ return $trim(this);
1936
+ }
1937
+ });
1938
+
1873
1939
  var anObject$8 = anObject$e;
1874
1940
 
1875
1941
  // `RegExp.prototype.flags` getter implementation
@@ -1888,13 +1954,13 @@ var regexpFlags$1 = function () {
1888
1954
  return result;
1889
1955
  };
1890
1956
 
1891
- var fails$b = fails$n;
1957
+ var fails$a = fails$n;
1892
1958
  var global$c = global$n;
1893
1959
 
1894
1960
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1895
1961
  var $RegExp$2 = global$c.RegExp;
1896
1962
 
1897
- var UNSUPPORTED_Y$1 = fails$b(function () {
1963
+ var UNSUPPORTED_Y$1 = fails$a(function () {
1898
1964
  var re = $RegExp$2('a', 'y');
1899
1965
  re.lastIndex = 2;
1900
1966
  return re.exec('abcd') != null;
@@ -1902,11 +1968,11 @@ var UNSUPPORTED_Y$1 = fails$b(function () {
1902
1968
 
1903
1969
  // UC Browser bug
1904
1970
  // https://github.com/zloirock/core-js/issues/1008
1905
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$b(function () {
1971
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$a(function () {
1906
1972
  return !$RegExp$2('a', 'y').sticky;
1907
1973
  });
1908
1974
 
1909
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$b(function () {
1975
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$a(function () {
1910
1976
  // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1911
1977
  var re = $RegExp$2('^r', 'gy');
1912
1978
  re.lastIndex = 2;
@@ -1919,24 +1985,24 @@ var regexpStickyHelpers = {
1919
1985
  UNSUPPORTED_Y: UNSUPPORTED_Y$1
1920
1986
  };
1921
1987
 
1922
- var fails$a = fails$n;
1988
+ var fails$9 = fails$n;
1923
1989
  var global$b = global$n;
1924
1990
 
1925
1991
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1926
1992
  var $RegExp$1 = global$b.RegExp;
1927
1993
 
1928
- var regexpUnsupportedDotAll = fails$a(function () {
1994
+ var regexpUnsupportedDotAll = fails$9(function () {
1929
1995
  var re = $RegExp$1('.', 's');
1930
1996
  return !(re.dotAll && re.exec('\n') && re.flags === 's');
1931
1997
  });
1932
1998
 
1933
- var fails$9 = fails$n;
1999
+ var fails$8 = fails$n;
1934
2000
  var global$a = global$n;
1935
2001
 
1936
2002
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1937
2003
  var $RegExp = global$a.RegExp;
1938
2004
 
1939
- var regexpUnsupportedNcg = fails$9(function () {
2005
+ var regexpUnsupportedNcg = fails$8(function () {
1940
2006
  var re = $RegExp('(?<a>b)', 'g');
1941
2007
  return re.exec('b').groups.a !== 'b' ||
1942
2008
  'b'.replace(re, '$<a>c') !== 'bc';
@@ -1945,8 +2011,8 @@ var regexpUnsupportedNcg = fails$9(function () {
1945
2011
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1946
2012
  /* eslint-disable regexp/no-useless-quantifier -- testing */
1947
2013
  var call$b = functionCall;
1948
- var uncurryThis$b = functionUncurryThis;
1949
- var toString$5 = toString$6;
2014
+ var uncurryThis$a = functionUncurryThis;
2015
+ var toString$4 = toString$6;
1950
2016
  var regexpFlags = regexpFlags$1;
1951
2017
  var stickyHelpers = regexpStickyHelpers;
1952
2018
  var shared = shared$4.exports;
@@ -1958,10 +2024,10 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1958
2024
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
1959
2025
  var nativeExec = RegExp.prototype.exec;
1960
2026
  var patchedExec = nativeExec;
1961
- var charAt$3 = uncurryThis$b(''.charAt);
1962
- var indexOf = uncurryThis$b(''.indexOf);
1963
- var replace$2 = uncurryThis$b(''.replace);
1964
- var stringSlice$3 = uncurryThis$b(''.slice);
2027
+ var charAt$3 = uncurryThis$a(''.charAt);
2028
+ var indexOf = uncurryThis$a(''.indexOf);
2029
+ var replace$1 = uncurryThis$a(''.replace);
2030
+ var stringSlice$3 = uncurryThis$a(''.slice);
1965
2031
 
1966
2032
  var UPDATES_LAST_INDEX_WRONG = (function () {
1967
2033
  var re1 = /a/;
@@ -1982,7 +2048,7 @@ if (PATCH) {
1982
2048
  patchedExec = function exec(string) {
1983
2049
  var re = this;
1984
2050
  var state = getInternalState(re);
1985
- var str = toString$5(string);
2051
+ var str = toString$4(string);
1986
2052
  var raw = state.raw;
1987
2053
  var result, reCopy, lastIndex, match, i, object, group;
1988
2054
 
@@ -2001,7 +2067,7 @@ if (PATCH) {
2001
2067
  var strCopy = str;
2002
2068
 
2003
2069
  if (sticky) {
2004
- flags = replace$2(flags, 'y', '');
2070
+ flags = replace$1(flags, 'y', '');
2005
2071
  if (indexOf(flags, 'g') === -1) {
2006
2072
  flags += 'g';
2007
2073
  }
@@ -2059,12 +2125,12 @@ if (PATCH) {
2059
2125
 
2060
2126
  var regexpExec$2 = patchedExec;
2061
2127
 
2062
- var $$c = _export;
2128
+ var $$b = _export;
2063
2129
  var exec$2 = regexpExec$2;
2064
2130
 
2065
2131
  // `RegExp.prototype.exec` method
2066
2132
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2067
- $$c({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2133
+ $$b({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2068
2134
  exec: exec$2
2069
2135
  });
2070
2136
 
@@ -2080,21 +2146,21 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$
2080
2146
  });
2081
2147
 
2082
2148
  var classofRaw = classofRaw$2;
2083
- var uncurryThis$a = functionUncurryThis;
2149
+ var uncurryThis$9 = functionUncurryThis;
2084
2150
 
2085
2151
  var functionUncurryThisClause = function (fn) {
2086
2152
  // Nashorn bug:
2087
2153
  // https://github.com/zloirock/core-js/issues/1128
2088
2154
  // https://github.com/zloirock/core-js/issues/1130
2089
- if (classofRaw(fn) === 'Function') return uncurryThis$a(fn);
2155
+ if (classofRaw(fn) === 'Function') return uncurryThis$9(fn);
2090
2156
  };
2091
2157
 
2092
2158
  // TODO: Remove from `core-js@4` since it's moved to entry points
2093
2159
 
2094
- var uncurryThis$9 = functionUncurryThisClause;
2160
+ var uncurryThis$8 = functionUncurryThisClause;
2095
2161
  var defineBuiltIn$3 = defineBuiltIn$7;
2096
2162
  var regexpExec$1 = regexpExec$2;
2097
- var fails$8 = fails$n;
2163
+ var fails$7 = fails$n;
2098
2164
  var wellKnownSymbol$9 = wellKnownSymbol$i;
2099
2165
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
2100
2166
 
@@ -2104,14 +2170,14 @@ var RegExpPrototype$2 = RegExp.prototype;
2104
2170
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2105
2171
  var SYMBOL = wellKnownSymbol$9(KEY);
2106
2172
 
2107
- var DELEGATES_TO_SYMBOL = !fails$8(function () {
2173
+ var DELEGATES_TO_SYMBOL = !fails$7(function () {
2108
2174
  // String methods call symbol-named RegEp methods
2109
2175
  var O = {};
2110
2176
  O[SYMBOL] = function () { return 7; };
2111
2177
  return ''[KEY](O) != 7;
2112
2178
  });
2113
2179
 
2114
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$8(function () {
2180
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$7(function () {
2115
2181
  // Symbol-named RegExp methods call .exec
2116
2182
  var execCalled = false;
2117
2183
  var re = /a/;
@@ -2140,9 +2206,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2140
2206
  !DELEGATES_TO_EXEC ||
2141
2207
  FORCED
2142
2208
  ) {
2143
- var uncurriedNativeRegExpMethod = uncurryThis$9(/./[SYMBOL]);
2209
+ var uncurriedNativeRegExpMethod = uncurryThis$8(/./[SYMBOL]);
2144
2210
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2145
- var uncurriedNativeMethod = uncurryThis$9(nativeMethod);
2211
+ var uncurriedNativeMethod = uncurryThis$8(nativeMethod);
2146
2212
  var $exec = regexp.exec;
2147
2213
  if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
2148
2214
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
@@ -2163,18 +2229,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2163
2229
  if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
2164
2230
  };
2165
2231
 
2166
- var uncurryThis$8 = functionUncurryThis;
2232
+ var uncurryThis$7 = functionUncurryThis;
2167
2233
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
2168
- var toString$4 = toString$6;
2169
- var requireObjectCoercible$3 = requireObjectCoercible$6;
2234
+ var toString$3 = toString$6;
2235
+ var requireObjectCoercible$2 = requireObjectCoercible$6;
2170
2236
 
2171
- var charAt$2 = uncurryThis$8(''.charAt);
2172
- var charCodeAt = uncurryThis$8(''.charCodeAt);
2173
- var stringSlice$2 = uncurryThis$8(''.slice);
2237
+ var charAt$2 = uncurryThis$7(''.charAt);
2238
+ var charCodeAt = uncurryThis$7(''.charCodeAt);
2239
+ var stringSlice$2 = uncurryThis$7(''.slice);
2174
2240
 
2175
- var createMethod$2 = function (CONVERT_TO_STRING) {
2241
+ var createMethod$1 = function (CONVERT_TO_STRING) {
2176
2242
  return function ($this, pos) {
2177
- var S = toString$4(requireObjectCoercible$3($this));
2243
+ var S = toString$3(requireObjectCoercible$2($this));
2178
2244
  var position = toIntegerOrInfinity$1(pos);
2179
2245
  var size = S.length;
2180
2246
  var first, second;
@@ -2194,10 +2260,10 @@ var createMethod$2 = function (CONVERT_TO_STRING) {
2194
2260
  var stringMultibyte = {
2195
2261
  // `String.prototype.codePointAt` method
2196
2262
  // https://tc39.es/ecma262/#sec-string.prototype.codepointat
2197
- codeAt: createMethod$2(false),
2263
+ codeAt: createMethod$1(false),
2198
2264
  // `String.prototype.at` method
2199
2265
  // https://github.com/mathiasbynens/String.prototype.at
2200
- charAt: createMethod$2(true)
2266
+ charAt: createMethod$1(true)
2201
2267
  };
2202
2268
 
2203
2269
  var charAt$1 = stringMultibyte.charAt;
@@ -2208,13 +2274,13 @@ var advanceStringIndex$1 = function (S, index, unicode) {
2208
2274
  return index + (unicode ? charAt$1(S, index).length : 1);
2209
2275
  };
2210
2276
 
2211
- var uncurryThis$7 = functionUncurryThis;
2277
+ var uncurryThis$6 = functionUncurryThis;
2212
2278
  var toObject$1 = toObject$5;
2213
2279
 
2214
2280
  var floor = Math.floor;
2215
- var charAt = uncurryThis$7(''.charAt);
2216
- var replace$1 = uncurryThis$7(''.replace);
2217
- var stringSlice$1 = uncurryThis$7(''.slice);
2281
+ var charAt = uncurryThis$6(''.charAt);
2282
+ var replace = uncurryThis$6(''.replace);
2283
+ var stringSlice$1 = uncurryThis$6(''.slice);
2218
2284
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2219
2285
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2220
2286
 
@@ -2228,7 +2294,7 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2228
2294
  namedCaptures = toObject$1(namedCaptures);
2229
2295
  symbols = SUBSTITUTION_SYMBOLS;
2230
2296
  }
2231
- return replace$1(replacement, symbols, function (match, ch) {
2297
+ return replace(replacement, symbols, function (match, ch) {
2232
2298
  var capture;
2233
2299
  switch (charAt(ch, 0)) {
2234
2300
  case '$': return '$';
@@ -2276,16 +2342,16 @@ var regexpExecAbstract = function (R, S) {
2276
2342
 
2277
2343
  var apply$1 = functionApply;
2278
2344
  var call$8 = functionCall;
2279
- var uncurryThis$6 = functionUncurryThis;
2345
+ var uncurryThis$5 = functionUncurryThis;
2280
2346
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2281
- var fails$7 = fails$n;
2347
+ var fails$6 = fails$n;
2282
2348
  var anObject$6 = anObject$e;
2283
2349
  var isCallable$5 = isCallable$m;
2284
2350
  var isNullOrUndefined$2 = isNullOrUndefined$5;
2285
2351
  var toIntegerOrInfinity = toIntegerOrInfinity$4;
2286
2352
  var toLength = toLength$2;
2287
- var toString$3 = toString$6;
2288
- var requireObjectCoercible$2 = requireObjectCoercible$6;
2353
+ var toString$2 = toString$6;
2354
+ var requireObjectCoercible$1 = requireObjectCoercible$6;
2289
2355
  var advanceStringIndex = advanceStringIndex$1;
2290
2356
  var getMethod$2 = getMethod$4;
2291
2357
  var getSubstitution = getSubstitution$1;
@@ -2295,10 +2361,10 @@ var wellKnownSymbol$8 = wellKnownSymbol$i;
2295
2361
  var REPLACE = wellKnownSymbol$8('replace');
2296
2362
  var max = Math.max;
2297
2363
  var min = Math.min;
2298
- var concat = uncurryThis$6([].concat);
2299
- var push = uncurryThis$6([].push);
2300
- var stringIndexOf$1 = uncurryThis$6(''.indexOf);
2301
- var stringSlice = uncurryThis$6(''.slice);
2364
+ var concat = uncurryThis$5([].concat);
2365
+ var push = uncurryThis$5([].push);
2366
+ var stringIndexOf$1 = uncurryThis$5(''.indexOf);
2367
+ var stringSlice = uncurryThis$5(''.slice);
2302
2368
 
2303
2369
  var maybeToString = function (it) {
2304
2370
  return it === undefined ? it : String(it);
@@ -2319,7 +2385,7 @@ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2319
2385
  return false;
2320
2386
  })();
2321
2387
 
2322
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
2388
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () {
2323
2389
  var re = /./;
2324
2390
  re.exec = function () {
2325
2391
  var result = [];
@@ -2338,17 +2404,17 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2338
2404
  // `String.prototype.replace` method
2339
2405
  // https://tc39.es/ecma262/#sec-string.prototype.replace
2340
2406
  function replace(searchValue, replaceValue) {
2341
- var O = requireObjectCoercible$2(this);
2407
+ var O = requireObjectCoercible$1(this);
2342
2408
  var replacer = isNullOrUndefined$2(searchValue) ? undefined : getMethod$2(searchValue, REPLACE);
2343
2409
  return replacer
2344
2410
  ? call$8(replacer, searchValue, O, replaceValue)
2345
- : call$8(nativeReplace, toString$3(O), searchValue, replaceValue);
2411
+ : call$8(nativeReplace, toString$2(O), searchValue, replaceValue);
2346
2412
  },
2347
2413
  // `RegExp.prototype[@@replace]` method
2348
2414
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2349
2415
  function (string, replaceValue) {
2350
2416
  var rx = anObject$6(this);
2351
- var S = toString$3(string);
2417
+ var S = toString$2(string);
2352
2418
 
2353
2419
  if (
2354
2420
  typeof replaceValue == 'string' &&
@@ -2360,7 +2426,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2360
2426
  }
2361
2427
 
2362
2428
  var functionalReplace = isCallable$5(replaceValue);
2363
- if (!functionalReplace) replaceValue = toString$3(replaceValue);
2429
+ if (!functionalReplace) replaceValue = toString$2(replaceValue);
2364
2430
 
2365
2431
  var global = rx.global;
2366
2432
  if (global) {
@@ -2375,7 +2441,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2375
2441
  push(results, result);
2376
2442
  if (!global) break;
2377
2443
 
2378
- var matchStr = toString$3(result[0]);
2444
+ var matchStr = toString$2(result[0]);
2379
2445
  if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2380
2446
  }
2381
2447
 
@@ -2384,7 +2450,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2384
2450
  for (var i = 0; i < results.length; i++) {
2385
2451
  result = results[i];
2386
2452
 
2387
- var matched = toString$3(result[0]);
2453
+ var matched = toString$2(result[0]);
2388
2454
  var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
2389
2455
  var captures = [];
2390
2456
  // NOTE: This is equivalent to
@@ -2397,7 +2463,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2397
2463
  if (functionalReplace) {
2398
2464
  var replacerArgs = concat([matched], captures, position, S);
2399
2465
  if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2400
- var replacement = toString$3(apply$1(replaceValue, undefined, replacerArgs));
2466
+ var replacement = toString$2(apply$1(replaceValue, undefined, replacerArgs));
2401
2467
  } else {
2402
2468
  replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2403
2469
  }
@@ -2411,19 +2477,19 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
2411
2477
  ];
2412
2478
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2413
2479
 
2414
- var $$b = _export;
2480
+ var $$a = _export;
2415
2481
  var $includes = arrayIncludes.includes;
2416
- var fails$6 = fails$n;
2482
+ var fails$5 = fails$n;
2417
2483
  var addToUnscopables = addToUnscopables$2;
2418
2484
 
2419
2485
  // FF99+ bug
2420
- var BROKEN_ON_SPARSE = fails$6(function () {
2486
+ var BROKEN_ON_SPARSE = fails$5(function () {
2421
2487
  return !Array(1).includes();
2422
2488
  });
2423
2489
 
2424
2490
  // `Array.prototype.includes` method
2425
2491
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2426
- $$b({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2492
+ $$a({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2427
2493
  includes: function includes(el /* , fromIndex = 0 */) {
2428
2494
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2429
2495
  }
@@ -2432,70 +2498,6 @@ $$b({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2432
2498
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2433
2499
  addToUnscopables('includes');
2434
2500
 
2435
- // a string of all valid unicode whitespaces
2436
- var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
2437
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
2438
-
2439
- var uncurryThis$5 = functionUncurryThis;
2440
- var requireObjectCoercible$1 = requireObjectCoercible$6;
2441
- var toString$2 = toString$6;
2442
- var whitespaces$2 = whitespaces$3;
2443
-
2444
- var replace = uncurryThis$5(''.replace);
2445
- var whitespace = '[' + whitespaces$2 + ']';
2446
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
2447
- var rtrim = RegExp(whitespace + whitespace + '*$');
2448
-
2449
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
2450
- var createMethod$1 = function (TYPE) {
2451
- return function ($this) {
2452
- var string = toString$2(requireObjectCoercible$1($this));
2453
- if (TYPE & 1) string = replace(string, ltrim, '');
2454
- if (TYPE & 2) string = replace(string, rtrim, '');
2455
- return string;
2456
- };
2457
- };
2458
-
2459
- var stringTrim = {
2460
- // `String.prototype.{ trimLeft, trimStart }` methods
2461
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
2462
- start: createMethod$1(1),
2463
- // `String.prototype.{ trimRight, trimEnd }` methods
2464
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
2465
- end: createMethod$1(2),
2466
- // `String.prototype.trim` method
2467
- // https://tc39.es/ecma262/#sec-string.prototype.trim
2468
- trim: createMethod$1(3)
2469
- };
2470
-
2471
- var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
2472
- var fails$5 = fails$n;
2473
- var whitespaces$1 = whitespaces$3;
2474
-
2475
- var non = '\u200B\u0085\u180E';
2476
-
2477
- // check that a method works with the correct list
2478
- // of whitespaces and has a correct name
2479
- var stringTrimForced = function (METHOD_NAME) {
2480
- return fails$5(function () {
2481
- return !!whitespaces$1[METHOD_NAME]()
2482
- || non[METHOD_NAME]() !== non
2483
- || (PROPER_FUNCTION_NAME$1 && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
2484
- });
2485
- };
2486
-
2487
- var $$a = _export;
2488
- var $trim = stringTrim.trim;
2489
- var forcedStringTrimMethod = stringTrimForced;
2490
-
2491
- // `String.prototype.trim` method
2492
- // https://tc39.es/ecma262/#sec-string.prototype.trim
2493
- $$a({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2494
- trim: function trim() {
2495
- return $trim(this);
2496
- }
2497
- });
2498
-
2499
2501
  /* eslint-disable no-useless-escape */
2500
2502
  const paginationDataGatter = data => {
2501
2503
  return data.data.docs;
@@ -2505,7 +2507,7 @@ const dataGatter = data => {
2505
2507
  };
2506
2508
  const capitalizeFirstLetter = (string = '') => {
2507
2509
  var _a;
2508
- return `${(_a = string === null || string === void 0 ? void 0 : string.charAt(0)) === null || _a === void 0 ? void 0 : _a.toUpperCase()}${string === null || string === void 0 ? void 0 : string.slice(1)}`;
2510
+ return `${(_a = string === null || string === void 0 ? void 0 : string.trim().charAt(0)) === null || _a === void 0 ? void 0 : _a.toUpperCase()}${string === null || string === void 0 ? void 0 : string.slice(1)}`;
2509
2511
  };
2510
2512
  const changeToCode = (string = '') => {
2511
2513
  var _a, _b;
@@ -2680,6 +2682,12 @@ const apiList = {
2680
2682
  url: `${prefix}/collection-data`,
2681
2683
  method: 'POST'
2682
2684
  }),
2685
+ CATEGORIES: ({
2686
+ prefix
2687
+ }) => ({
2688
+ url: `${prefix}/categories`,
2689
+ method: 'GET'
2690
+ }),
2683
2691
  // Image Upload API
2684
2692
  IMAGE_UPLOAD: ({
2685
2693
  prefix
@@ -2885,6 +2893,9 @@ const usePage = ({
2885
2893
  onError: handleError(code)
2886
2894
  });
2887
2895
  if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
2896
+ if (formState === 'ADD') {
2897
+ setCurrentPage(1);
2898
+ }
2888
2899
  setLoading(false);
2889
2900
  onSuccess(code, response === null || response === void 0 ? void 0 : response.code, response === null || response === void 0 ? void 0 : response.message);
2890
2901
  getPages();
@@ -4495,6 +4506,7 @@ const useWidget = ({
4495
4506
  const [formState, setFormState] = useState();
4496
4507
  const [itemsTypes, setItemsTypes] = useState([]);
4497
4508
  const [widgetTypes, setWidgetTypes] = useState([]);
4509
+ const [categories, setCategories] = useState([]);
4498
4510
  const [collectionDataLoading, setCollectionDataLoading] = useState(false);
4499
4511
  const [collectionData, setCollectionData] = useState([]);
4500
4512
  const {
@@ -4673,6 +4685,27 @@ const useWidget = ({
4673
4685
  }
4674
4686
  setLoading(false);
4675
4687
  });
4688
+ const getCategories = () => __awaiter(void 0, void 0, void 0, function* () {
4689
+ if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0) return;
4690
+ setLoading(true);
4691
+ const api = getApiType({
4692
+ routes,
4693
+ action: 'CATEGORIES',
4694
+ prefix: widgetRoutesPrefix
4695
+ });
4696
+ const response = yield commonApi({
4697
+ baseUrl,
4698
+ token,
4699
+ method: api.method,
4700
+ url: api.url,
4701
+ onError: handleError(CALLBACK_CODES.GET_ALL)
4702
+ });
4703
+ if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
4704
+ setLoading(false);
4705
+ return setCategories(dataGatter(response));
4706
+ }
4707
+ setLoading(false);
4708
+ });
4676
4709
  const getCollectionData = (collectionName, search, callback, collectionItems) => __awaiter(void 0, void 0, void 0, function* () {
4677
4710
  setCollectionDataLoading(true);
4678
4711
  const api = getApiType({
@@ -4720,6 +4753,9 @@ const useWidget = ({
4720
4753
  onError: handleError(code)
4721
4754
  });
4722
4755
  if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
4756
+ if (formState === 'ADD') {
4757
+ setCurrentPage(1);
4758
+ }
4723
4759
  setLoading(false);
4724
4760
  onSuccess(code, response === null || response === void 0 ? void 0 : response.code, response === null || response === void 0 ? void 0 : response.message);
4725
4761
  getWidgets();
@@ -4772,6 +4808,7 @@ const useWidget = ({
4772
4808
  if (state === 'ADD' || state === 'UPDATE') {
4773
4809
  getWidgetsTypes();
4774
4810
  getWidgetTypes();
4811
+ getCategories();
4775
4812
  }
4776
4813
  // get Item data if widget is updating
4777
4814
  if (state === 'UPDATE' && data) {
@@ -4866,6 +4903,7 @@ const useWidget = ({
4866
4903
  // Form
4867
4904
  formState,
4868
4905
  itemData,
4906
+ categories,
4869
4907
  onChangeFormState,
4870
4908
  onCloseForm,
4871
4909
  onWidgetFormSubmit,
@@ -5975,6 +6013,7 @@ const WidgetContextProvider = ({
5975
6013
  onImageRemove: _onImageRemove = id => __awaiter(void 0, void 0, void 0, function* () {}),
5976
6014
  itemsTypes: _itemsTypes = [],
5977
6015
  widgetTypes: _widgetTypes = [],
6016
+ categories: _categories = [],
5978
6017
  getCollectionData: _getCollectionData = () => Promise.resolve(),
5979
6018
  collectionDataLoading: _collectionDataLoading = false,
5980
6019
  collectionData: _collectionData = [],
@@ -6022,6 +6061,7 @@ const WidgetContextProvider = ({
6022
6061
  onImageRemove: _onImageRemove,
6023
6062
  onPartialUpdateWidget: _onPartialUpdateWidget,
6024
6063
  itemsTypes: _itemsTypes,
6064
+ categories: _categories,
6025
6065
  widgetTypes: _widgetTypes,
6026
6066
  getCollectionData: _getCollectionData,
6027
6067
  collectionDataLoading: _collectionDataLoading,
@@ -6704,6 +6744,7 @@ const Tabs = ({
6704
6744
  };
6705
6745
 
6706
6746
  const constants = {
6747
+ categoryTypeAccessor: 'category',
6707
6748
  widgetTypeAccessor: 'widgetType',
6708
6749
  itemTypeAccessor: 'itemsType',
6709
6750
  collectionNameAccessor: 'collectionName',
@@ -6747,6 +6788,7 @@ const WidgetForm = ({
6747
6788
  canUpdate,
6748
6789
  formState,
6749
6790
  itemsTypes,
6791
+ categories,
6750
6792
  widgetTypes,
6751
6793
  loading,
6752
6794
  onWidgetFormSubmit,
@@ -6858,6 +6900,9 @@ const WidgetForm = ({
6858
6900
  const getFirstWidgetTypeValue = useCallback(() => {
6859
6901
  return widgetTypes[0].value;
6860
6902
  }, [widgetTypes]);
6903
+ const getFirstCategoryValue = useCallback(() => {
6904
+ return categories[0].value;
6905
+ }, [categories]);
6861
6906
  // Widget Form Functions
6862
6907
  const onWidgetFormInputChange = useCallback((value, name) => {
6863
6908
  if (name === 'widgetType') {
@@ -6884,6 +6929,9 @@ const WidgetForm = ({
6884
6929
  const onFormSubmit = data => {
6885
6930
  var _a, _b;
6886
6931
  const formData = Object.assign({}, data);
6932
+ if (!formData[constants.categoryTypeAccessor] && categories && categories.length > 0) {
6933
+ formData[constants.categoryTypeAccessor] = getFirstCategoryValue();
6934
+ }
6887
6935
  // setting widget type if undefined
6888
6936
  if (!formData[constants.widgetTypeAccessor] && formState === 'ADD') {
6889
6937
  formData[constants.widgetTypeAccessor] = getFirstWidgetTypeValue();
@@ -7001,6 +7049,13 @@ const WidgetForm = ({
7001
7049
  required: t('widget.widgetTypeRequired')
7002
7050
  },
7003
7051
  options: widgetTypes
7052
+ }, {
7053
+ label: `${t('widget.category')}`,
7054
+ placeholder: t('widget.categoryPlaceholder'),
7055
+ accessor: 'category',
7056
+ type: 'select',
7057
+ show: categories && categories.length > 0,
7058
+ options: categories
7004
7059
  }, {
7005
7060
  label: t('widget.autoPlay'),
7006
7061
  accessor: 'autoPlay',
@@ -7300,6 +7355,7 @@ const Widget = ({
7300
7355
  onImageUpload,
7301
7356
  onPartialUpdateWidget,
7302
7357
  itemsTypes,
7358
+ categories,
7303
7359
  widgetTypes,
7304
7360
  getCollectionData,
7305
7361
  collectionData,
@@ -7332,6 +7388,7 @@ const Widget = ({
7332
7388
  onImageRemove: onImageRemove,
7333
7389
  onImageUpload: onImageUpload,
7334
7390
  onPartialUpdateWidget: onPartialUpdateWidget,
7391
+ categories: categories,
7335
7392
  itemsTypes: itemsTypes,
7336
7393
  widgetTypes: widgetTypes,
7337
7394
  getCollectionData: getCollectionData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knovator/pagecreator-admin",
3
- "version": "0.7.5",
3
+ "version": "0.8.0",
4
4
  "dependencies": {
5
5
  "classnames": "^2.3.1",
6
6
  "react-beautiful-dnd": "^13.1.0",