@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.cjs +183 -126
- package/index.js +183 -126
- package/package.json +1 -1
- package/src/lib/api/list.d.ts +4 -0
- package/src/lib/constants/common.d.ts +2 -0
- package/src/lib/context/WidgetContext.d.ts +1 -1
- package/src/lib/hooks/useWidget.d.ts +3 -2
- package/src/lib/types/api.d.ts +5 -1
- package/src/lib/types/context.d.ts +2 -1
package/index.cjs
CHANGED
|
@@ -1758,6 +1758,8 @@ const TRANSLATION_PAIRS_WIDGET = {
|
|
|
1758
1758
|
'widget.widgetTitleInfo': 'HTML is supported',
|
|
1759
1759
|
'widget.minPerRow': 'Value must be greater than zero',
|
|
1760
1760
|
'widget.actionsLabel': 'Actions',
|
|
1761
|
+
'widget.category': 'Category',
|
|
1762
|
+
'widget.categoryPlaceholder': 'Select Category',
|
|
1761
1763
|
'widget.tabNameRequired': 'Tab Name is required'
|
|
1762
1764
|
};
|
|
1763
1765
|
const TRANSLATION_PAIRS_ITEM = {
|
|
@@ -1882,6 +1884,70 @@ var toString$6 = function (argument) {
|
|
|
1882
1884
|
return $String(argument);
|
|
1883
1885
|
};
|
|
1884
1886
|
|
|
1887
|
+
// a string of all valid unicode whitespaces
|
|
1888
|
+
var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
1889
|
+
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
1890
|
+
|
|
1891
|
+
var uncurryThis$b = functionUncurryThis;
|
|
1892
|
+
var requireObjectCoercible$3 = requireObjectCoercible$6;
|
|
1893
|
+
var toString$5 = toString$6;
|
|
1894
|
+
var whitespaces$2 = whitespaces$3;
|
|
1895
|
+
|
|
1896
|
+
var replace$2 = uncurryThis$b(''.replace);
|
|
1897
|
+
var whitespace = '[' + whitespaces$2 + ']';
|
|
1898
|
+
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
1899
|
+
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
1900
|
+
|
|
1901
|
+
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
1902
|
+
var createMethod$2 = function (TYPE) {
|
|
1903
|
+
return function ($this) {
|
|
1904
|
+
var string = toString$5(requireObjectCoercible$3($this));
|
|
1905
|
+
if (TYPE & 1) string = replace$2(string, ltrim, '');
|
|
1906
|
+
if (TYPE & 2) string = replace$2(string, rtrim, '');
|
|
1907
|
+
return string;
|
|
1908
|
+
};
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1911
|
+
var stringTrim = {
|
|
1912
|
+
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
1913
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
1914
|
+
start: createMethod$2(1),
|
|
1915
|
+
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
1916
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
1917
|
+
end: createMethod$2(2),
|
|
1918
|
+
// `String.prototype.trim` method
|
|
1919
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1920
|
+
trim: createMethod$2(3)
|
|
1921
|
+
};
|
|
1922
|
+
|
|
1923
|
+
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
1924
|
+
var fails$b = fails$n;
|
|
1925
|
+
var whitespaces$1 = whitespaces$3;
|
|
1926
|
+
|
|
1927
|
+
var non = '\u200B\u0085\u180E';
|
|
1928
|
+
|
|
1929
|
+
// check that a method works with the correct list
|
|
1930
|
+
// of whitespaces and has a correct name
|
|
1931
|
+
var stringTrimForced = function (METHOD_NAME) {
|
|
1932
|
+
return fails$b(function () {
|
|
1933
|
+
return !!whitespaces$1[METHOD_NAME]()
|
|
1934
|
+
|| non[METHOD_NAME]() !== non
|
|
1935
|
+
|| (PROPER_FUNCTION_NAME$1 && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
|
|
1936
|
+
});
|
|
1937
|
+
};
|
|
1938
|
+
|
|
1939
|
+
var $$c = _export;
|
|
1940
|
+
var $trim = stringTrim.trim;
|
|
1941
|
+
var forcedStringTrimMethod = stringTrimForced;
|
|
1942
|
+
|
|
1943
|
+
// `String.prototype.trim` method
|
|
1944
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1945
|
+
$$c({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
1946
|
+
trim: function trim() {
|
|
1947
|
+
return $trim(this);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
|
|
1885
1951
|
var anObject$8 = anObject$e;
|
|
1886
1952
|
|
|
1887
1953
|
// `RegExp.prototype.flags` getter implementation
|
|
@@ -1900,13 +1966,13 @@ var regexpFlags$1 = function () {
|
|
|
1900
1966
|
return result;
|
|
1901
1967
|
};
|
|
1902
1968
|
|
|
1903
|
-
var fails$
|
|
1969
|
+
var fails$a = fails$n;
|
|
1904
1970
|
var global$c = global$n;
|
|
1905
1971
|
|
|
1906
1972
|
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1907
1973
|
var $RegExp$2 = global$c.RegExp;
|
|
1908
1974
|
|
|
1909
|
-
var UNSUPPORTED_Y$1 = fails$
|
|
1975
|
+
var UNSUPPORTED_Y$1 = fails$a(function () {
|
|
1910
1976
|
var re = $RegExp$2('a', 'y');
|
|
1911
1977
|
re.lastIndex = 2;
|
|
1912
1978
|
return re.exec('abcd') != null;
|
|
@@ -1914,11 +1980,11 @@ var UNSUPPORTED_Y$1 = fails$b(function () {
|
|
|
1914
1980
|
|
|
1915
1981
|
// UC Browser bug
|
|
1916
1982
|
// https://github.com/zloirock/core-js/issues/1008
|
|
1917
|
-
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$
|
|
1983
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$a(function () {
|
|
1918
1984
|
return !$RegExp$2('a', 'y').sticky;
|
|
1919
1985
|
});
|
|
1920
1986
|
|
|
1921
|
-
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$
|
|
1987
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$a(function () {
|
|
1922
1988
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
1923
1989
|
var re = $RegExp$2('^r', 'gy');
|
|
1924
1990
|
re.lastIndex = 2;
|
|
@@ -1931,24 +1997,24 @@ var regexpStickyHelpers = {
|
|
|
1931
1997
|
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
1932
1998
|
};
|
|
1933
1999
|
|
|
1934
|
-
var fails$
|
|
2000
|
+
var fails$9 = fails$n;
|
|
1935
2001
|
var global$b = global$n;
|
|
1936
2002
|
|
|
1937
2003
|
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
1938
2004
|
var $RegExp$1 = global$b.RegExp;
|
|
1939
2005
|
|
|
1940
|
-
var regexpUnsupportedDotAll = fails$
|
|
2006
|
+
var regexpUnsupportedDotAll = fails$9(function () {
|
|
1941
2007
|
var re = $RegExp$1('.', 's');
|
|
1942
2008
|
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
1943
2009
|
});
|
|
1944
2010
|
|
|
1945
|
-
var fails$
|
|
2011
|
+
var fails$8 = fails$n;
|
|
1946
2012
|
var global$a = global$n;
|
|
1947
2013
|
|
|
1948
2014
|
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
1949
2015
|
var $RegExp = global$a.RegExp;
|
|
1950
2016
|
|
|
1951
|
-
var regexpUnsupportedNcg = fails$
|
|
2017
|
+
var regexpUnsupportedNcg = fails$8(function () {
|
|
1952
2018
|
var re = $RegExp('(?<a>b)', 'g');
|
|
1953
2019
|
return re.exec('b').groups.a !== 'b' ||
|
|
1954
2020
|
'b'.replace(re, '$<a>c') !== 'bc';
|
|
@@ -1957,8 +2023,8 @@ var regexpUnsupportedNcg = fails$9(function () {
|
|
|
1957
2023
|
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1958
2024
|
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1959
2025
|
var call$b = functionCall;
|
|
1960
|
-
var uncurryThis$
|
|
1961
|
-
var toString$
|
|
2026
|
+
var uncurryThis$a = functionUncurryThis;
|
|
2027
|
+
var toString$4 = toString$6;
|
|
1962
2028
|
var regexpFlags = regexpFlags$1;
|
|
1963
2029
|
var stickyHelpers = regexpStickyHelpers;
|
|
1964
2030
|
var shared = shared$4.exports;
|
|
@@ -1970,10 +2036,10 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
|
1970
2036
|
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1971
2037
|
var nativeExec = RegExp.prototype.exec;
|
|
1972
2038
|
var patchedExec = nativeExec;
|
|
1973
|
-
var charAt$3 = uncurryThis$
|
|
1974
|
-
var indexOf = uncurryThis$
|
|
1975
|
-
var replace$
|
|
1976
|
-
var stringSlice$3 = uncurryThis$
|
|
2039
|
+
var charAt$3 = uncurryThis$a(''.charAt);
|
|
2040
|
+
var indexOf = uncurryThis$a(''.indexOf);
|
|
2041
|
+
var replace$1 = uncurryThis$a(''.replace);
|
|
2042
|
+
var stringSlice$3 = uncurryThis$a(''.slice);
|
|
1977
2043
|
|
|
1978
2044
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1979
2045
|
var re1 = /a/;
|
|
@@ -1994,7 +2060,7 @@ if (PATCH) {
|
|
|
1994
2060
|
patchedExec = function exec(string) {
|
|
1995
2061
|
var re = this;
|
|
1996
2062
|
var state = getInternalState(re);
|
|
1997
|
-
var str = toString$
|
|
2063
|
+
var str = toString$4(string);
|
|
1998
2064
|
var raw = state.raw;
|
|
1999
2065
|
var result, reCopy, lastIndex, match, i, object, group;
|
|
2000
2066
|
|
|
@@ -2013,7 +2079,7 @@ if (PATCH) {
|
|
|
2013
2079
|
var strCopy = str;
|
|
2014
2080
|
|
|
2015
2081
|
if (sticky) {
|
|
2016
|
-
flags = replace$
|
|
2082
|
+
flags = replace$1(flags, 'y', '');
|
|
2017
2083
|
if (indexOf(flags, 'g') === -1) {
|
|
2018
2084
|
flags += 'g';
|
|
2019
2085
|
}
|
|
@@ -2071,12 +2137,12 @@ if (PATCH) {
|
|
|
2071
2137
|
|
|
2072
2138
|
var regexpExec$2 = patchedExec;
|
|
2073
2139
|
|
|
2074
|
-
var $$
|
|
2140
|
+
var $$b = _export;
|
|
2075
2141
|
var exec$2 = regexpExec$2;
|
|
2076
2142
|
|
|
2077
2143
|
// `RegExp.prototype.exec` method
|
|
2078
2144
|
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2079
|
-
$$
|
|
2145
|
+
$$b({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
|
|
2080
2146
|
exec: exec$2
|
|
2081
2147
|
});
|
|
2082
2148
|
|
|
@@ -2092,21 +2158,21 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$
|
|
|
2092
2158
|
});
|
|
2093
2159
|
|
|
2094
2160
|
var classofRaw = classofRaw$2;
|
|
2095
|
-
var uncurryThis$
|
|
2161
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
2096
2162
|
|
|
2097
2163
|
var functionUncurryThisClause = function (fn) {
|
|
2098
2164
|
// Nashorn bug:
|
|
2099
2165
|
// https://github.com/zloirock/core-js/issues/1128
|
|
2100
2166
|
// https://github.com/zloirock/core-js/issues/1130
|
|
2101
|
-
if (classofRaw(fn) === 'Function') return uncurryThis$
|
|
2167
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$9(fn);
|
|
2102
2168
|
};
|
|
2103
2169
|
|
|
2104
2170
|
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
2105
2171
|
|
|
2106
|
-
var uncurryThis$
|
|
2172
|
+
var uncurryThis$8 = functionUncurryThisClause;
|
|
2107
2173
|
var defineBuiltIn$3 = defineBuiltIn$7;
|
|
2108
2174
|
var regexpExec$1 = regexpExec$2;
|
|
2109
|
-
var fails$
|
|
2175
|
+
var fails$7 = fails$n;
|
|
2110
2176
|
var wellKnownSymbol$9 = wellKnownSymbol$i;
|
|
2111
2177
|
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
2112
2178
|
|
|
@@ -2116,14 +2182,14 @@ var RegExpPrototype$2 = RegExp.prototype;
|
|
|
2116
2182
|
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
2117
2183
|
var SYMBOL = wellKnownSymbol$9(KEY);
|
|
2118
2184
|
|
|
2119
|
-
var DELEGATES_TO_SYMBOL = !fails$
|
|
2185
|
+
var DELEGATES_TO_SYMBOL = !fails$7(function () {
|
|
2120
2186
|
// String methods call symbol-named RegEp methods
|
|
2121
2187
|
var O = {};
|
|
2122
2188
|
O[SYMBOL] = function () { return 7; };
|
|
2123
2189
|
return ''[KEY](O) != 7;
|
|
2124
2190
|
});
|
|
2125
2191
|
|
|
2126
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$
|
|
2192
|
+
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$7(function () {
|
|
2127
2193
|
// Symbol-named RegExp methods call .exec
|
|
2128
2194
|
var execCalled = false;
|
|
2129
2195
|
var re = /a/;
|
|
@@ -2152,9 +2218,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
2152
2218
|
!DELEGATES_TO_EXEC ||
|
|
2153
2219
|
FORCED
|
|
2154
2220
|
) {
|
|
2155
|
-
var uncurriedNativeRegExpMethod = uncurryThis$
|
|
2221
|
+
var uncurriedNativeRegExpMethod = uncurryThis$8(/./[SYMBOL]);
|
|
2156
2222
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2157
|
-
var uncurriedNativeMethod = uncurryThis$
|
|
2223
|
+
var uncurriedNativeMethod = uncurryThis$8(nativeMethod);
|
|
2158
2224
|
var $exec = regexp.exec;
|
|
2159
2225
|
if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
|
|
2160
2226
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
@@ -2175,18 +2241,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
2175
2241
|
if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
|
|
2176
2242
|
};
|
|
2177
2243
|
|
|
2178
|
-
var uncurryThis$
|
|
2244
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
2179
2245
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
|
2180
|
-
var toString$
|
|
2181
|
-
var requireObjectCoercible$
|
|
2246
|
+
var toString$3 = toString$6;
|
|
2247
|
+
var requireObjectCoercible$2 = requireObjectCoercible$6;
|
|
2182
2248
|
|
|
2183
|
-
var charAt$2 = uncurryThis$
|
|
2184
|
-
var charCodeAt = uncurryThis$
|
|
2185
|
-
var stringSlice$2 = uncurryThis$
|
|
2249
|
+
var charAt$2 = uncurryThis$7(''.charAt);
|
|
2250
|
+
var charCodeAt = uncurryThis$7(''.charCodeAt);
|
|
2251
|
+
var stringSlice$2 = uncurryThis$7(''.slice);
|
|
2186
2252
|
|
|
2187
|
-
var createMethod$
|
|
2253
|
+
var createMethod$1 = function (CONVERT_TO_STRING) {
|
|
2188
2254
|
return function ($this, pos) {
|
|
2189
|
-
var S = toString$
|
|
2255
|
+
var S = toString$3(requireObjectCoercible$2($this));
|
|
2190
2256
|
var position = toIntegerOrInfinity$1(pos);
|
|
2191
2257
|
var size = S.length;
|
|
2192
2258
|
var first, second;
|
|
@@ -2206,10 +2272,10 @@ var createMethod$2 = function (CONVERT_TO_STRING) {
|
|
|
2206
2272
|
var stringMultibyte = {
|
|
2207
2273
|
// `String.prototype.codePointAt` method
|
|
2208
2274
|
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
2209
|
-
codeAt: createMethod$
|
|
2275
|
+
codeAt: createMethod$1(false),
|
|
2210
2276
|
// `String.prototype.at` method
|
|
2211
2277
|
// https://github.com/mathiasbynens/String.prototype.at
|
|
2212
|
-
charAt: createMethod$
|
|
2278
|
+
charAt: createMethod$1(true)
|
|
2213
2279
|
};
|
|
2214
2280
|
|
|
2215
2281
|
var charAt$1 = stringMultibyte.charAt;
|
|
@@ -2220,13 +2286,13 @@ var advanceStringIndex$1 = function (S, index, unicode) {
|
|
|
2220
2286
|
return index + (unicode ? charAt$1(S, index).length : 1);
|
|
2221
2287
|
};
|
|
2222
2288
|
|
|
2223
|
-
var uncurryThis$
|
|
2289
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
2224
2290
|
var toObject$1 = toObject$5;
|
|
2225
2291
|
|
|
2226
2292
|
var floor = Math.floor;
|
|
2227
|
-
var charAt = uncurryThis$
|
|
2228
|
-
var replace
|
|
2229
|
-
var stringSlice$1 = uncurryThis$
|
|
2293
|
+
var charAt = uncurryThis$6(''.charAt);
|
|
2294
|
+
var replace = uncurryThis$6(''.replace);
|
|
2295
|
+
var stringSlice$1 = uncurryThis$6(''.slice);
|
|
2230
2296
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
2231
2297
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
2232
2298
|
|
|
@@ -2240,7 +2306,7 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
|
|
|
2240
2306
|
namedCaptures = toObject$1(namedCaptures);
|
|
2241
2307
|
symbols = SUBSTITUTION_SYMBOLS;
|
|
2242
2308
|
}
|
|
2243
|
-
return replace
|
|
2309
|
+
return replace(replacement, symbols, function (match, ch) {
|
|
2244
2310
|
var capture;
|
|
2245
2311
|
switch (charAt(ch, 0)) {
|
|
2246
2312
|
case '$': return '$';
|
|
@@ -2288,16 +2354,16 @@ var regexpExecAbstract = function (R, S) {
|
|
|
2288
2354
|
|
|
2289
2355
|
var apply$1 = functionApply;
|
|
2290
2356
|
var call$8 = functionCall;
|
|
2291
|
-
var uncurryThis$
|
|
2357
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
2292
2358
|
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
2293
|
-
var fails$
|
|
2359
|
+
var fails$6 = fails$n;
|
|
2294
2360
|
var anObject$6 = anObject$e;
|
|
2295
2361
|
var isCallable$5 = isCallable$m;
|
|
2296
2362
|
var isNullOrUndefined$2 = isNullOrUndefined$5;
|
|
2297
2363
|
var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
|
2298
2364
|
var toLength = toLength$2;
|
|
2299
|
-
var toString$
|
|
2300
|
-
var requireObjectCoercible$
|
|
2365
|
+
var toString$2 = toString$6;
|
|
2366
|
+
var requireObjectCoercible$1 = requireObjectCoercible$6;
|
|
2301
2367
|
var advanceStringIndex = advanceStringIndex$1;
|
|
2302
2368
|
var getMethod$2 = getMethod$4;
|
|
2303
2369
|
var getSubstitution = getSubstitution$1;
|
|
@@ -2307,10 +2373,10 @@ var wellKnownSymbol$8 = wellKnownSymbol$i;
|
|
|
2307
2373
|
var REPLACE = wellKnownSymbol$8('replace');
|
|
2308
2374
|
var max = Math.max;
|
|
2309
2375
|
var min = Math.min;
|
|
2310
|
-
var concat = uncurryThis$
|
|
2311
|
-
var push = uncurryThis$
|
|
2312
|
-
var stringIndexOf$1 = uncurryThis$
|
|
2313
|
-
var stringSlice = uncurryThis$
|
|
2376
|
+
var concat = uncurryThis$5([].concat);
|
|
2377
|
+
var push = uncurryThis$5([].push);
|
|
2378
|
+
var stringIndexOf$1 = uncurryThis$5(''.indexOf);
|
|
2379
|
+
var stringSlice = uncurryThis$5(''.slice);
|
|
2314
2380
|
|
|
2315
2381
|
var maybeToString = function (it) {
|
|
2316
2382
|
return it === undefined ? it : String(it);
|
|
@@ -2331,7 +2397,7 @@ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
|
2331
2397
|
return false;
|
|
2332
2398
|
})();
|
|
2333
2399
|
|
|
2334
|
-
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$
|
|
2400
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$6(function () {
|
|
2335
2401
|
var re = /./;
|
|
2336
2402
|
re.exec = function () {
|
|
2337
2403
|
var result = [];
|
|
@@ -2350,17 +2416,17 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2350
2416
|
// `String.prototype.replace` method
|
|
2351
2417
|
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
2352
2418
|
function replace(searchValue, replaceValue) {
|
|
2353
|
-
var O = requireObjectCoercible$
|
|
2419
|
+
var O = requireObjectCoercible$1(this);
|
|
2354
2420
|
var replacer = isNullOrUndefined$2(searchValue) ? undefined : getMethod$2(searchValue, REPLACE);
|
|
2355
2421
|
return replacer
|
|
2356
2422
|
? call$8(replacer, searchValue, O, replaceValue)
|
|
2357
|
-
: call$8(nativeReplace, toString$
|
|
2423
|
+
: call$8(nativeReplace, toString$2(O), searchValue, replaceValue);
|
|
2358
2424
|
},
|
|
2359
2425
|
// `RegExp.prototype[@@replace]` method
|
|
2360
2426
|
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
2361
2427
|
function (string, replaceValue) {
|
|
2362
2428
|
var rx = anObject$6(this);
|
|
2363
|
-
var S = toString$
|
|
2429
|
+
var S = toString$2(string);
|
|
2364
2430
|
|
|
2365
2431
|
if (
|
|
2366
2432
|
typeof replaceValue == 'string' &&
|
|
@@ -2372,7 +2438,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2372
2438
|
}
|
|
2373
2439
|
|
|
2374
2440
|
var functionalReplace = isCallable$5(replaceValue);
|
|
2375
|
-
if (!functionalReplace) replaceValue = toString$
|
|
2441
|
+
if (!functionalReplace) replaceValue = toString$2(replaceValue);
|
|
2376
2442
|
|
|
2377
2443
|
var global = rx.global;
|
|
2378
2444
|
if (global) {
|
|
@@ -2387,7 +2453,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2387
2453
|
push(results, result);
|
|
2388
2454
|
if (!global) break;
|
|
2389
2455
|
|
|
2390
|
-
var matchStr = toString$
|
|
2456
|
+
var matchStr = toString$2(result[0]);
|
|
2391
2457
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
2392
2458
|
}
|
|
2393
2459
|
|
|
@@ -2396,7 +2462,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2396
2462
|
for (var i = 0; i < results.length; i++) {
|
|
2397
2463
|
result = results[i];
|
|
2398
2464
|
|
|
2399
|
-
var matched = toString$
|
|
2465
|
+
var matched = toString$2(result[0]);
|
|
2400
2466
|
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
2401
2467
|
var captures = [];
|
|
2402
2468
|
// NOTE: This is equivalent to
|
|
@@ -2409,7 +2475,7 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2409
2475
|
if (functionalReplace) {
|
|
2410
2476
|
var replacerArgs = concat([matched], captures, position, S);
|
|
2411
2477
|
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
|
2412
|
-
var replacement = toString$
|
|
2478
|
+
var replacement = toString$2(apply$1(replaceValue, undefined, replacerArgs));
|
|
2413
2479
|
} else {
|
|
2414
2480
|
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2415
2481
|
}
|
|
@@ -2423,19 +2489,19 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2423
2489
|
];
|
|
2424
2490
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
2425
2491
|
|
|
2426
|
-
var $$
|
|
2492
|
+
var $$a = _export;
|
|
2427
2493
|
var $includes = arrayIncludes.includes;
|
|
2428
|
-
var fails$
|
|
2494
|
+
var fails$5 = fails$n;
|
|
2429
2495
|
var addToUnscopables = addToUnscopables$2;
|
|
2430
2496
|
|
|
2431
2497
|
// FF99+ bug
|
|
2432
|
-
var BROKEN_ON_SPARSE = fails$
|
|
2498
|
+
var BROKEN_ON_SPARSE = fails$5(function () {
|
|
2433
2499
|
return !Array(1).includes();
|
|
2434
2500
|
});
|
|
2435
2501
|
|
|
2436
2502
|
// `Array.prototype.includes` method
|
|
2437
2503
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2438
|
-
$$
|
|
2504
|
+
$$a({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
2439
2505
|
includes: function includes(el /* , fromIndex = 0 */) {
|
|
2440
2506
|
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
2441
2507
|
}
|
|
@@ -2444,70 +2510,6 @@ $$b({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
|
2444
2510
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2445
2511
|
addToUnscopables('includes');
|
|
2446
2512
|
|
|
2447
|
-
// a string of all valid unicode whitespaces
|
|
2448
|
-
var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
2449
|
-
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
2450
|
-
|
|
2451
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
2452
|
-
var requireObjectCoercible$1 = requireObjectCoercible$6;
|
|
2453
|
-
var toString$2 = toString$6;
|
|
2454
|
-
var whitespaces$2 = whitespaces$3;
|
|
2455
|
-
|
|
2456
|
-
var replace = uncurryThis$5(''.replace);
|
|
2457
|
-
var whitespace = '[' + whitespaces$2 + ']';
|
|
2458
|
-
var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
|
2459
|
-
var rtrim = RegExp(whitespace + whitespace + '*$');
|
|
2460
|
-
|
|
2461
|
-
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
2462
|
-
var createMethod$1 = function (TYPE) {
|
|
2463
|
-
return function ($this) {
|
|
2464
|
-
var string = toString$2(requireObjectCoercible$1($this));
|
|
2465
|
-
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
2466
|
-
if (TYPE & 2) string = replace(string, rtrim, '');
|
|
2467
|
-
return string;
|
|
2468
|
-
};
|
|
2469
|
-
};
|
|
2470
|
-
|
|
2471
|
-
var stringTrim = {
|
|
2472
|
-
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
2473
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
2474
|
-
start: createMethod$1(1),
|
|
2475
|
-
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
2476
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
2477
|
-
end: createMethod$1(2),
|
|
2478
|
-
// `String.prototype.trim` method
|
|
2479
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2480
|
-
trim: createMethod$1(3)
|
|
2481
|
-
};
|
|
2482
|
-
|
|
2483
|
-
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
2484
|
-
var fails$5 = fails$n;
|
|
2485
|
-
var whitespaces$1 = whitespaces$3;
|
|
2486
|
-
|
|
2487
|
-
var non = '\u200B\u0085\u180E';
|
|
2488
|
-
|
|
2489
|
-
// check that a method works with the correct list
|
|
2490
|
-
// of whitespaces and has a correct name
|
|
2491
|
-
var stringTrimForced = function (METHOD_NAME) {
|
|
2492
|
-
return fails$5(function () {
|
|
2493
|
-
return !!whitespaces$1[METHOD_NAME]()
|
|
2494
|
-
|| non[METHOD_NAME]() !== non
|
|
2495
|
-
|| (PROPER_FUNCTION_NAME$1 && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
|
|
2496
|
-
});
|
|
2497
|
-
};
|
|
2498
|
-
|
|
2499
|
-
var $$a = _export;
|
|
2500
|
-
var $trim = stringTrim.trim;
|
|
2501
|
-
var forcedStringTrimMethod = stringTrimForced;
|
|
2502
|
-
|
|
2503
|
-
// `String.prototype.trim` method
|
|
2504
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2505
|
-
$$a({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
2506
|
-
trim: function trim() {
|
|
2507
|
-
return $trim(this);
|
|
2508
|
-
}
|
|
2509
|
-
});
|
|
2510
|
-
|
|
2511
2513
|
/* eslint-disable no-useless-escape */
|
|
2512
2514
|
const paginationDataGatter = data => {
|
|
2513
2515
|
return data.data.docs;
|
|
@@ -2517,7 +2519,7 @@ const dataGatter = data => {
|
|
|
2517
2519
|
};
|
|
2518
2520
|
const capitalizeFirstLetter = (string = '') => {
|
|
2519
2521
|
var _a;
|
|
2520
|
-
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)}`;
|
|
2522
|
+
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)}`;
|
|
2521
2523
|
};
|
|
2522
2524
|
const changeToCode = (string = '') => {
|
|
2523
2525
|
var _a, _b;
|
|
@@ -2692,6 +2694,12 @@ const apiList = {
|
|
|
2692
2694
|
url: `${prefix}/collection-data`,
|
|
2693
2695
|
method: 'POST'
|
|
2694
2696
|
}),
|
|
2697
|
+
CATEGORIES: ({
|
|
2698
|
+
prefix
|
|
2699
|
+
}) => ({
|
|
2700
|
+
url: `${prefix}/categories`,
|
|
2701
|
+
method: 'GET'
|
|
2702
|
+
}),
|
|
2695
2703
|
// Image Upload API
|
|
2696
2704
|
IMAGE_UPLOAD: ({
|
|
2697
2705
|
prefix
|
|
@@ -2897,6 +2905,9 @@ const usePage = ({
|
|
|
2897
2905
|
onError: handleError(code)
|
|
2898
2906
|
});
|
|
2899
2907
|
if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
|
|
2908
|
+
if (formState === 'ADD') {
|
|
2909
|
+
setCurrentPage(1);
|
|
2910
|
+
}
|
|
2900
2911
|
setLoading(false);
|
|
2901
2912
|
onSuccess(code, response === null || response === void 0 ? void 0 : response.code, response === null || response === void 0 ? void 0 : response.message);
|
|
2902
2913
|
getPages();
|
|
@@ -4507,6 +4518,7 @@ const useWidget = ({
|
|
|
4507
4518
|
const [formState, setFormState] = React.useState();
|
|
4508
4519
|
const [itemsTypes, setItemsTypes] = React.useState([]);
|
|
4509
4520
|
const [widgetTypes, setWidgetTypes] = React.useState([]);
|
|
4521
|
+
const [categories, setCategories] = React.useState([]);
|
|
4510
4522
|
const [collectionDataLoading, setCollectionDataLoading] = React.useState(false);
|
|
4511
4523
|
const [collectionData, setCollectionData] = React.useState([]);
|
|
4512
4524
|
const {
|
|
@@ -4685,6 +4697,27 @@ const useWidget = ({
|
|
|
4685
4697
|
}
|
|
4686
4698
|
setLoading(false);
|
|
4687
4699
|
});
|
|
4700
|
+
const getCategories = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
4701
|
+
if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0) return;
|
|
4702
|
+
setLoading(true);
|
|
4703
|
+
const api = getApiType({
|
|
4704
|
+
routes,
|
|
4705
|
+
action: 'CATEGORIES',
|
|
4706
|
+
prefix: widgetRoutesPrefix
|
|
4707
|
+
});
|
|
4708
|
+
const response = yield commonApi({
|
|
4709
|
+
baseUrl,
|
|
4710
|
+
token,
|
|
4711
|
+
method: api.method,
|
|
4712
|
+
url: api.url,
|
|
4713
|
+
onError: handleError(CALLBACK_CODES.GET_ALL)
|
|
4714
|
+
});
|
|
4715
|
+
if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
|
|
4716
|
+
setLoading(false);
|
|
4717
|
+
return setCategories(dataGatter(response));
|
|
4718
|
+
}
|
|
4719
|
+
setLoading(false);
|
|
4720
|
+
});
|
|
4688
4721
|
const getCollectionData = (collectionName, search, callback, collectionItems) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4689
4722
|
setCollectionDataLoading(true);
|
|
4690
4723
|
const api = getApiType({
|
|
@@ -4732,6 +4765,9 @@ const useWidget = ({
|
|
|
4732
4765
|
onError: handleError(code)
|
|
4733
4766
|
});
|
|
4734
4767
|
if ((response === null || response === void 0 ? void 0 : response.code) === 'SUCCESS') {
|
|
4768
|
+
if (formState === 'ADD') {
|
|
4769
|
+
setCurrentPage(1);
|
|
4770
|
+
}
|
|
4735
4771
|
setLoading(false);
|
|
4736
4772
|
onSuccess(code, response === null || response === void 0 ? void 0 : response.code, response === null || response === void 0 ? void 0 : response.message);
|
|
4737
4773
|
getWidgets();
|
|
@@ -4784,6 +4820,7 @@ const useWidget = ({
|
|
|
4784
4820
|
if (state === 'ADD' || state === 'UPDATE') {
|
|
4785
4821
|
getWidgetsTypes();
|
|
4786
4822
|
getWidgetTypes();
|
|
4823
|
+
getCategories();
|
|
4787
4824
|
}
|
|
4788
4825
|
// get Item data if widget is updating
|
|
4789
4826
|
if (state === 'UPDATE' && data) {
|
|
@@ -4878,6 +4915,7 @@ const useWidget = ({
|
|
|
4878
4915
|
// Form
|
|
4879
4916
|
formState,
|
|
4880
4917
|
itemData,
|
|
4918
|
+
categories,
|
|
4881
4919
|
onChangeFormState,
|
|
4882
4920
|
onCloseForm,
|
|
4883
4921
|
onWidgetFormSubmit,
|
|
@@ -5987,6 +6025,7 @@ const WidgetContextProvider = ({
|
|
|
5987
6025
|
onImageRemove: _onImageRemove = id => __awaiter(void 0, void 0, void 0, function* () {}),
|
|
5988
6026
|
itemsTypes: _itemsTypes = [],
|
|
5989
6027
|
widgetTypes: _widgetTypes = [],
|
|
6028
|
+
categories: _categories = [],
|
|
5990
6029
|
getCollectionData: _getCollectionData = () => Promise.resolve(),
|
|
5991
6030
|
collectionDataLoading: _collectionDataLoading = false,
|
|
5992
6031
|
collectionData: _collectionData = [],
|
|
@@ -6034,6 +6073,7 @@ const WidgetContextProvider = ({
|
|
|
6034
6073
|
onImageRemove: _onImageRemove,
|
|
6035
6074
|
onPartialUpdateWidget: _onPartialUpdateWidget,
|
|
6036
6075
|
itemsTypes: _itemsTypes,
|
|
6076
|
+
categories: _categories,
|
|
6037
6077
|
widgetTypes: _widgetTypes,
|
|
6038
6078
|
getCollectionData: _getCollectionData,
|
|
6039
6079
|
collectionDataLoading: _collectionDataLoading,
|
|
@@ -6716,6 +6756,7 @@ const Tabs = ({
|
|
|
6716
6756
|
};
|
|
6717
6757
|
|
|
6718
6758
|
const constants = {
|
|
6759
|
+
categoryTypeAccessor: 'category',
|
|
6719
6760
|
widgetTypeAccessor: 'widgetType',
|
|
6720
6761
|
itemTypeAccessor: 'itemsType',
|
|
6721
6762
|
collectionNameAccessor: 'collectionName',
|
|
@@ -6759,6 +6800,7 @@ const WidgetForm = ({
|
|
|
6759
6800
|
canUpdate,
|
|
6760
6801
|
formState,
|
|
6761
6802
|
itemsTypes,
|
|
6803
|
+
categories,
|
|
6762
6804
|
widgetTypes,
|
|
6763
6805
|
loading,
|
|
6764
6806
|
onWidgetFormSubmit,
|
|
@@ -6870,6 +6912,9 @@ const WidgetForm = ({
|
|
|
6870
6912
|
const getFirstWidgetTypeValue = React.useCallback(() => {
|
|
6871
6913
|
return widgetTypes[0].value;
|
|
6872
6914
|
}, [widgetTypes]);
|
|
6915
|
+
const getFirstCategoryValue = React.useCallback(() => {
|
|
6916
|
+
return categories[0].value;
|
|
6917
|
+
}, [categories]);
|
|
6873
6918
|
// Widget Form Functions
|
|
6874
6919
|
const onWidgetFormInputChange = React.useCallback((value, name) => {
|
|
6875
6920
|
if (name === 'widgetType') {
|
|
@@ -6896,6 +6941,9 @@ const WidgetForm = ({
|
|
|
6896
6941
|
const onFormSubmit = data => {
|
|
6897
6942
|
var _a, _b;
|
|
6898
6943
|
const formData = Object.assign({}, data);
|
|
6944
|
+
if (!formData[constants.categoryTypeAccessor] && categories && categories.length > 0) {
|
|
6945
|
+
formData[constants.categoryTypeAccessor] = getFirstCategoryValue();
|
|
6946
|
+
}
|
|
6899
6947
|
// setting widget type if undefined
|
|
6900
6948
|
if (!formData[constants.widgetTypeAccessor] && formState === 'ADD') {
|
|
6901
6949
|
formData[constants.widgetTypeAccessor] = getFirstWidgetTypeValue();
|
|
@@ -7013,6 +7061,13 @@ const WidgetForm = ({
|
|
|
7013
7061
|
required: t('widget.widgetTypeRequired')
|
|
7014
7062
|
},
|
|
7015
7063
|
options: widgetTypes
|
|
7064
|
+
}, {
|
|
7065
|
+
label: `${t('widget.category')}`,
|
|
7066
|
+
placeholder: t('widget.categoryPlaceholder'),
|
|
7067
|
+
accessor: 'category',
|
|
7068
|
+
type: 'select',
|
|
7069
|
+
show: categories && categories.length > 0,
|
|
7070
|
+
options: categories
|
|
7016
7071
|
}, {
|
|
7017
7072
|
label: t('widget.autoPlay'),
|
|
7018
7073
|
accessor: 'autoPlay',
|
|
@@ -7312,6 +7367,7 @@ const Widget = ({
|
|
|
7312
7367
|
onImageUpload,
|
|
7313
7368
|
onPartialUpdateWidget,
|
|
7314
7369
|
itemsTypes,
|
|
7370
|
+
categories,
|
|
7315
7371
|
widgetTypes,
|
|
7316
7372
|
getCollectionData,
|
|
7317
7373
|
collectionData,
|
|
@@ -7344,6 +7400,7 @@ const Widget = ({
|
|
|
7344
7400
|
onImageRemove: onImageRemove,
|
|
7345
7401
|
onImageUpload: onImageUpload,
|
|
7346
7402
|
onPartialUpdateWidget: onPartialUpdateWidget,
|
|
7403
|
+
categories: categories,
|
|
7347
7404
|
itemsTypes: itemsTypes,
|
|
7348
7405
|
widgetTypes: widgetTypes,
|
|
7349
7406
|
getCollectionData: getCollectionData,
|