@micromag/core 0.3.508 → 0.3.512
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/assets/css/styles.css +12 -12
- package/assets/css/vendor.css +1 -1
- package/es/components.js +11 -6
- package/es/contexts.js +69 -611
- package/es/index.js +3 -2
- package/es/utils.js +3 -3
- package/lib/components.js +590 -11
- package/lib/contexts.js +72 -617
- package/lib/index.js +105 -70
- package/lib/utils.js +127 -89
- package/package.json +13 -23
- package/scss/_theme.scss +45 -30
- package/scss/vendor.scss +14 -0
package/lib/components.js
CHANGED
|
@@ -20,9 +20,11 @@ var faAngleLeft = require('@fortawesome/free-solid-svg-icons/faAngleLeft');
|
|
|
20
20
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
21
21
|
var hooks = require('@micromag/core/hooks');
|
|
22
22
|
var get = require('lodash/get');
|
|
23
|
-
var
|
|
23
|
+
var _createForOfIteratorHelper = require('@babel/runtime/helpers/createForOfIteratorHelper');
|
|
24
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
24
25
|
var ReactDOM = require('react-dom');
|
|
25
26
|
var isArray = require('lodash/isArray');
|
|
27
|
+
var uppy = require('@panneau/uppy');
|
|
26
28
|
var faAngleDown = require('@fortawesome/free-solid-svg-icons/faAngleDown');
|
|
27
29
|
var faAngleUp = require('@fortawesome/free-solid-svg-icons/faAngleUp');
|
|
28
30
|
var dayjs = require('dayjs');
|
|
@@ -347,7 +349,7 @@ Label.propTypes = propTypes$T;
|
|
|
347
349
|
Label.defaultProps = defaultProps$T;
|
|
348
350
|
var Label$1 = Label;
|
|
349
351
|
|
|
350
|
-
var styles$x = {"container":"micromag-core-buttons-button-container","asLink":"micromag-core-buttons-button-asLink","withoutStyle":"micromag-core-buttons-button-withoutStyle","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withAnimations":"micromag-core-buttons-button-withAnimations","icon-right":"micromag-core-buttons-button-icon-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"
|
|
352
|
+
var styles$x = {"container":"micromag-core-buttons-button-container","asLink":"micromag-core-buttons-button-asLink","withoutStyle":"micromag-core-buttons-button-withoutStyle","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withAnimations":"micromag-core-buttons-button-withAnimations","icon-right":"micromag-core-buttons-button-icon-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"};
|
|
351
353
|
|
|
352
354
|
var _excluded$b = ["type", "theme", "size", "href", "external", "direct", "target", "label", "children", "focusable", "active", "icon", "iconPosition", "disabled", "loading", "disableOnLoading", "small", "big", "withShadow", "withoutStyle", "withoutBootstrapStyles", "withoutTheme", "asLink", "outline", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
|
|
353
355
|
var propTypes$S = {
|
|
@@ -1824,6 +1826,579 @@ Navbar.propTypes = propTypes$y;
|
|
|
1824
1826
|
Navbar.defaultProps = defaultProps$y;
|
|
1825
1827
|
var Navbar$1 = Navbar;
|
|
1826
1828
|
|
|
1829
|
+
var token = '%[a-f0-9]{2}';
|
|
1830
|
+
var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
|
|
1831
|
+
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
|
|
1832
|
+
function decodeComponents(components, split) {
|
|
1833
|
+
try {
|
|
1834
|
+
// Try to decode the entire string first
|
|
1835
|
+
return [decodeURIComponent(components.join(''))];
|
|
1836
|
+
} catch (_unused) {
|
|
1837
|
+
// Do nothing
|
|
1838
|
+
}
|
|
1839
|
+
if (components.length === 1) {
|
|
1840
|
+
return components;
|
|
1841
|
+
}
|
|
1842
|
+
split = split || 1;
|
|
1843
|
+
|
|
1844
|
+
// Split the array in 2 parts
|
|
1845
|
+
var left = components.slice(0, split);
|
|
1846
|
+
var right = components.slice(split);
|
|
1847
|
+
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
|
|
1848
|
+
}
|
|
1849
|
+
function decode$1(input) {
|
|
1850
|
+
try {
|
|
1851
|
+
return decodeURIComponent(input);
|
|
1852
|
+
} catch (_unused2) {
|
|
1853
|
+
var tokens = input.match(singleMatcher) || [];
|
|
1854
|
+
for (var i = 1; i < tokens.length; i++) {
|
|
1855
|
+
input = decodeComponents(tokens, i).join('');
|
|
1856
|
+
tokens = input.match(singleMatcher) || [];
|
|
1857
|
+
}
|
|
1858
|
+
return input;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
function customDecodeURIComponent(input) {
|
|
1862
|
+
// Keep track of all the replacements and prefill the map with the `BOM`
|
|
1863
|
+
var replaceMap = {
|
|
1864
|
+
'%FE%FF': "\uFFFD\uFFFD",
|
|
1865
|
+
'%FF%FE': "\uFFFD\uFFFD"
|
|
1866
|
+
};
|
|
1867
|
+
var match = multiMatcher.exec(input);
|
|
1868
|
+
while (match) {
|
|
1869
|
+
try {
|
|
1870
|
+
// Decode as big chunks as possible
|
|
1871
|
+
replaceMap[match[0]] = decodeURIComponent(match[0]);
|
|
1872
|
+
} catch (_unused3) {
|
|
1873
|
+
var result = decode$1(match[0]);
|
|
1874
|
+
if (result !== match[0]) {
|
|
1875
|
+
replaceMap[match[0]] = result;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
match = multiMatcher.exec(input);
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
|
|
1882
|
+
replaceMap['%C2'] = "\uFFFD";
|
|
1883
|
+
var entries = Object.keys(replaceMap);
|
|
1884
|
+
for (var _i = 0, _entries = entries; _i < _entries.length; _i++) {
|
|
1885
|
+
var key = _entries[_i];
|
|
1886
|
+
// Replace all decoded components
|
|
1887
|
+
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
|
|
1888
|
+
}
|
|
1889
|
+
return input;
|
|
1890
|
+
}
|
|
1891
|
+
function decodeUriComponent(encodedURI) {
|
|
1892
|
+
if (typeof encodedURI !== 'string') {
|
|
1893
|
+
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + _typeof(encodedURI) + '`');
|
|
1894
|
+
}
|
|
1895
|
+
try {
|
|
1896
|
+
// Try the built in decoder first
|
|
1897
|
+
return decodeURIComponent(encodedURI);
|
|
1898
|
+
} catch (_unused4) {
|
|
1899
|
+
// Fallback to a more advanced decoder
|
|
1900
|
+
return customDecodeURIComponent(encodedURI);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
function splitOnFirst(string, separator) {
|
|
1905
|
+
if (!(typeof string === 'string' && typeof separator === 'string')) {
|
|
1906
|
+
throw new TypeError('Expected the arguments to be of type `string`');
|
|
1907
|
+
}
|
|
1908
|
+
if (string === '' || separator === '') {
|
|
1909
|
+
return [];
|
|
1910
|
+
}
|
|
1911
|
+
var separatorIndex = string.indexOf(separator);
|
|
1912
|
+
if (separatorIndex === -1) {
|
|
1913
|
+
return [];
|
|
1914
|
+
}
|
|
1915
|
+
return [string.slice(0, separatorIndex), string.slice(separatorIndex + separator.length)];
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
function includeKeys(object, predicate) {
|
|
1919
|
+
var result = {};
|
|
1920
|
+
if (Array.isArray(predicate)) {
|
|
1921
|
+
var _iterator = _createForOfIteratorHelper(predicate),
|
|
1922
|
+
_step;
|
|
1923
|
+
try {
|
|
1924
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1925
|
+
var key = _step.value;
|
|
1926
|
+
var descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
1927
|
+
if (descriptor !== null && descriptor !== void 0 && descriptor.enumerable) {
|
|
1928
|
+
Object.defineProperty(result, key, descriptor);
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
} catch (err) {
|
|
1932
|
+
_iterator.e(err);
|
|
1933
|
+
} finally {
|
|
1934
|
+
_iterator.f();
|
|
1935
|
+
}
|
|
1936
|
+
} else {
|
|
1937
|
+
// `Reflect.ownKeys()` is required to retrieve symbol properties
|
|
1938
|
+
var _iterator2 = _createForOfIteratorHelper(Reflect.ownKeys(object)),
|
|
1939
|
+
_step2;
|
|
1940
|
+
try {
|
|
1941
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
1942
|
+
var _key = _step2.value;
|
|
1943
|
+
var _descriptor = Object.getOwnPropertyDescriptor(object, _key);
|
|
1944
|
+
if (_descriptor.enumerable) {
|
|
1945
|
+
var value = object[_key];
|
|
1946
|
+
if (predicate(_key, value, object)) {
|
|
1947
|
+
Object.defineProperty(result, _key, _descriptor);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
} catch (err) {
|
|
1952
|
+
_iterator2.e(err);
|
|
1953
|
+
} finally {
|
|
1954
|
+
_iterator2.f();
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
return result;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
var isNullOrUndefined = function isNullOrUndefined(value) {
|
|
1961
|
+
return value === null || value === undefined;
|
|
1962
|
+
};
|
|
1963
|
+
|
|
1964
|
+
// eslint-disable-next-line unicorn/prefer-code-point
|
|
1965
|
+
var strictUriEncode = function strictUriEncode(string) {
|
|
1966
|
+
return encodeURIComponent(string).replaceAll(/[!'()*]/g, function (x) {
|
|
1967
|
+
return "%".concat(x.charCodeAt(0).toString(16).toUpperCase());
|
|
1968
|
+
});
|
|
1969
|
+
};
|
|
1970
|
+
var encodeFragmentIdentifier = Symbol('encodeFragmentIdentifier');
|
|
1971
|
+
function encoderForArrayFormat(options) {
|
|
1972
|
+
switch (options.arrayFormat) {
|
|
1973
|
+
case 'index':
|
|
1974
|
+
{
|
|
1975
|
+
return function (key) {
|
|
1976
|
+
return function (result, value) {
|
|
1977
|
+
var index = result.length;
|
|
1978
|
+
if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === '') {
|
|
1979
|
+
return result;
|
|
1980
|
+
}
|
|
1981
|
+
if (value === null) {
|
|
1982
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), '[', index, ']'].join('')]);
|
|
1983
|
+
}
|
|
1984
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')]);
|
|
1985
|
+
};
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
case 'bracket':
|
|
1989
|
+
{
|
|
1990
|
+
return function (key) {
|
|
1991
|
+
return function (result, value) {
|
|
1992
|
+
if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === '') {
|
|
1993
|
+
return result;
|
|
1994
|
+
}
|
|
1995
|
+
if (value === null) {
|
|
1996
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), '[]'].join('')]);
|
|
1997
|
+
}
|
|
1998
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), '[]=', encode(value, options)].join('')]);
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
case 'colon-list-separator':
|
|
2003
|
+
{
|
|
2004
|
+
return function (key) {
|
|
2005
|
+
return function (result, value) {
|
|
2006
|
+
if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === '') {
|
|
2007
|
+
return result;
|
|
2008
|
+
}
|
|
2009
|
+
if (value === null) {
|
|
2010
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), ':list='].join('')]);
|
|
2011
|
+
}
|
|
2012
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), ':list=', encode(value, options)].join('')]);
|
|
2013
|
+
};
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
case 'comma':
|
|
2017
|
+
case 'separator':
|
|
2018
|
+
case 'bracket-separator':
|
|
2019
|
+
{
|
|
2020
|
+
var keyValueSeparator = options.arrayFormat === 'bracket-separator' ? '[]=' : '=';
|
|
2021
|
+
return function (key) {
|
|
2022
|
+
return function (result, value) {
|
|
2023
|
+
if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === '') {
|
|
2024
|
+
return result;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
// Translate null to an empty string so that it doesn't serialize as 'null'
|
|
2028
|
+
value = value === null ? '' : value;
|
|
2029
|
+
if (result.length === 0) {
|
|
2030
|
+
return [[encode(key, options), keyValueSeparator, encode(value, options)].join('')];
|
|
2031
|
+
}
|
|
2032
|
+
return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
|
|
2033
|
+
};
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
default:
|
|
2037
|
+
{
|
|
2038
|
+
return function (key) {
|
|
2039
|
+
return function (result, value) {
|
|
2040
|
+
if (value === undefined || options.skipNull && value === null || options.skipEmptyString && value === '') {
|
|
2041
|
+
return result;
|
|
2042
|
+
}
|
|
2043
|
+
if (value === null) {
|
|
2044
|
+
return [].concat(_toConsumableArray(result), [encode(key, options)]);
|
|
2045
|
+
}
|
|
2046
|
+
return [].concat(_toConsumableArray(result), [[encode(key, options), '=', encode(value, options)].join('')]);
|
|
2047
|
+
};
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
function parserForArrayFormat(options) {
|
|
2053
|
+
var result;
|
|
2054
|
+
switch (options.arrayFormat) {
|
|
2055
|
+
case 'index':
|
|
2056
|
+
{
|
|
2057
|
+
return function (key, value, accumulator) {
|
|
2058
|
+
result = /\[(\d*)]$/.exec(key);
|
|
2059
|
+
key = key.replace(/\[\d*]$/, '');
|
|
2060
|
+
if (!result) {
|
|
2061
|
+
accumulator[key] = value;
|
|
2062
|
+
return;
|
|
2063
|
+
}
|
|
2064
|
+
if (accumulator[key] === undefined) {
|
|
2065
|
+
accumulator[key] = {};
|
|
2066
|
+
}
|
|
2067
|
+
accumulator[key][result[1]] = value;
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
case 'bracket':
|
|
2071
|
+
{
|
|
2072
|
+
return function (key, value, accumulator) {
|
|
2073
|
+
result = /(\[])$/.exec(key);
|
|
2074
|
+
key = key.replace(/\[]$/, '');
|
|
2075
|
+
if (!result) {
|
|
2076
|
+
accumulator[key] = value;
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2079
|
+
if (accumulator[key] === undefined) {
|
|
2080
|
+
accumulator[key] = [value];
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
accumulator[key] = [].concat(_toConsumableArray(accumulator[key]), [value]);
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
case 'colon-list-separator':
|
|
2087
|
+
{
|
|
2088
|
+
return function (key, value, accumulator) {
|
|
2089
|
+
result = /(:list)$/.exec(key);
|
|
2090
|
+
key = key.replace(/:list$/, '');
|
|
2091
|
+
if (!result) {
|
|
2092
|
+
accumulator[key] = value;
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
2095
|
+
if (accumulator[key] === undefined) {
|
|
2096
|
+
accumulator[key] = [value];
|
|
2097
|
+
return;
|
|
2098
|
+
}
|
|
2099
|
+
accumulator[key] = [].concat(_toConsumableArray(accumulator[key]), [value]);
|
|
2100
|
+
};
|
|
2101
|
+
}
|
|
2102
|
+
case 'comma':
|
|
2103
|
+
case 'separator':
|
|
2104
|
+
{
|
|
2105
|
+
return function (key, value, accumulator) {
|
|
2106
|
+
var isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
|
|
2107
|
+
var isEncodedArray = typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator);
|
|
2108
|
+
value = isEncodedArray ? decode(value, options) : value;
|
|
2109
|
+
var newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(function (item) {
|
|
2110
|
+
return decode(item, options);
|
|
2111
|
+
}) : value === null ? value : decode(value, options);
|
|
2112
|
+
accumulator[key] = newValue;
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
case 'bracket-separator':
|
|
2116
|
+
{
|
|
2117
|
+
return function (key, value, accumulator) {
|
|
2118
|
+
var isArray = /(\[])$/.test(key);
|
|
2119
|
+
key = key.replace(/\[]$/, '');
|
|
2120
|
+
if (!isArray) {
|
|
2121
|
+
accumulator[key] = value ? decode(value, options) : value;
|
|
2122
|
+
return;
|
|
2123
|
+
}
|
|
2124
|
+
var arrayValue = value === null ? [] : value.split(options.arrayFormatSeparator).map(function (item) {
|
|
2125
|
+
return decode(item, options);
|
|
2126
|
+
});
|
|
2127
|
+
if (accumulator[key] === undefined) {
|
|
2128
|
+
accumulator[key] = arrayValue;
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
accumulator[key] = [].concat(_toConsumableArray(accumulator[key]), _toConsumableArray(arrayValue));
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
default:
|
|
2135
|
+
{
|
|
2136
|
+
return function (key, value, accumulator) {
|
|
2137
|
+
if (accumulator[key] === undefined) {
|
|
2138
|
+
accumulator[key] = value;
|
|
2139
|
+
return;
|
|
2140
|
+
}
|
|
2141
|
+
accumulator[key] = [].concat(_toConsumableArray([accumulator[key]].flat()), [value]);
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
function validateArrayFormatSeparator(value) {
|
|
2147
|
+
if (typeof value !== 'string' || value.length !== 1) {
|
|
2148
|
+
throw new TypeError('arrayFormatSeparator must be single character string');
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
function encode(value, options) {
|
|
2152
|
+
if (options.encode) {
|
|
2153
|
+
return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
|
2154
|
+
}
|
|
2155
|
+
return value;
|
|
2156
|
+
}
|
|
2157
|
+
function decode(value, options) {
|
|
2158
|
+
if (options.decode) {
|
|
2159
|
+
return decodeUriComponent(value);
|
|
2160
|
+
}
|
|
2161
|
+
return value;
|
|
2162
|
+
}
|
|
2163
|
+
function keysSorter(input) {
|
|
2164
|
+
if (Array.isArray(input)) {
|
|
2165
|
+
return input.sort();
|
|
2166
|
+
}
|
|
2167
|
+
if (_typeof(input) === 'object') {
|
|
2168
|
+
return keysSorter(Object.keys(input)).sort(function (a, b) {
|
|
2169
|
+
return Number(a) - Number(b);
|
|
2170
|
+
}).map(function (key) {
|
|
2171
|
+
return input[key];
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
return input;
|
|
2175
|
+
}
|
|
2176
|
+
function removeHash(input) {
|
|
2177
|
+
var hashStart = input.indexOf('#');
|
|
2178
|
+
if (hashStart !== -1) {
|
|
2179
|
+
input = input.slice(0, hashStart);
|
|
2180
|
+
}
|
|
2181
|
+
return input;
|
|
2182
|
+
}
|
|
2183
|
+
function getHash(url) {
|
|
2184
|
+
var hash = '';
|
|
2185
|
+
var hashStart = url.indexOf('#');
|
|
2186
|
+
if (hashStart !== -1) {
|
|
2187
|
+
hash = url.slice(hashStart);
|
|
2188
|
+
}
|
|
2189
|
+
return hash;
|
|
2190
|
+
}
|
|
2191
|
+
function parseValue(value, options) {
|
|
2192
|
+
if (options.parseNumbers && !Number.isNaN(Number(value)) && typeof value === 'string' && value.trim() !== '') {
|
|
2193
|
+
value = Number(value);
|
|
2194
|
+
} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
|
|
2195
|
+
value = value.toLowerCase() === 'true';
|
|
2196
|
+
}
|
|
2197
|
+
return value;
|
|
2198
|
+
}
|
|
2199
|
+
function extract(input) {
|
|
2200
|
+
input = removeHash(input);
|
|
2201
|
+
var queryStart = input.indexOf('?');
|
|
2202
|
+
if (queryStart === -1) {
|
|
2203
|
+
return '';
|
|
2204
|
+
}
|
|
2205
|
+
return input.slice(queryStart + 1);
|
|
2206
|
+
}
|
|
2207
|
+
function parse(query, options) {
|
|
2208
|
+
options = _objectSpread({
|
|
2209
|
+
decode: true,
|
|
2210
|
+
sort: true,
|
|
2211
|
+
arrayFormat: 'none',
|
|
2212
|
+
arrayFormatSeparator: ',',
|
|
2213
|
+
parseNumbers: false,
|
|
2214
|
+
parseBooleans: false
|
|
2215
|
+
}, options);
|
|
2216
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
2217
|
+
var formatter = parserForArrayFormat(options);
|
|
2218
|
+
|
|
2219
|
+
// Create an object with no prototype
|
|
2220
|
+
var returnValue = Object.create(null);
|
|
2221
|
+
if (typeof query !== 'string') {
|
|
2222
|
+
return returnValue;
|
|
2223
|
+
}
|
|
2224
|
+
query = query.trim().replace(/^[?#&]/, '');
|
|
2225
|
+
if (!query) {
|
|
2226
|
+
return returnValue;
|
|
2227
|
+
}
|
|
2228
|
+
var _iterator = _createForOfIteratorHelper(query.split('&')),
|
|
2229
|
+
_step;
|
|
2230
|
+
try {
|
|
2231
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2232
|
+
var parameter = _step.value;
|
|
2233
|
+
if (parameter === '') {
|
|
2234
|
+
continue;
|
|
2235
|
+
}
|
|
2236
|
+
var parameter_ = options.decode ? parameter.replaceAll('+', ' ') : parameter;
|
|
2237
|
+
var _splitOnFirst = splitOnFirst(parameter_, '='),
|
|
2238
|
+
_splitOnFirst2 = _slicedToArray(_splitOnFirst, 2),
|
|
2239
|
+
_key = _splitOnFirst2[0],
|
|
2240
|
+
_value = _splitOnFirst2[1];
|
|
2241
|
+
if (_key === undefined) {
|
|
2242
|
+
_key = parameter_;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
// Missing `=` should be `null`:
|
|
2246
|
+
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
|
2247
|
+
_value = _value === undefined ? null : ['comma', 'separator', 'bracket-separator'].includes(options.arrayFormat) ? _value : decode(_value, options);
|
|
2248
|
+
formatter(decode(_key, options), _value, returnValue);
|
|
2249
|
+
}
|
|
2250
|
+
} catch (err) {
|
|
2251
|
+
_iterator.e(err);
|
|
2252
|
+
} finally {
|
|
2253
|
+
_iterator.f();
|
|
2254
|
+
}
|
|
2255
|
+
for (var _i = 0, _Object$entries = Object.entries(returnValue); _i < _Object$entries.length; _i++) {
|
|
2256
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
2257
|
+
key = _Object$entries$_i[0],
|
|
2258
|
+
value = _Object$entries$_i[1];
|
|
2259
|
+
if (_typeof(value) === 'object' && value !== null) {
|
|
2260
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(value); _i2 < _Object$entries2.length; _i2++) {
|
|
2261
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
|
|
2262
|
+
key2 = _Object$entries2$_i[0],
|
|
2263
|
+
value2 = _Object$entries2$_i[1];
|
|
2264
|
+
value[key2] = parseValue(value2, options);
|
|
2265
|
+
}
|
|
2266
|
+
} else {
|
|
2267
|
+
returnValue[key] = parseValue(value, options);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
if (options.sort === false) {
|
|
2271
|
+
return returnValue;
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
// TODO: Remove the use of `reduce`.
|
|
2275
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
2276
|
+
return (options.sort === true ? Object.keys(returnValue).sort() : Object.keys(returnValue).sort(options.sort)).reduce(function (result, key) {
|
|
2277
|
+
var value = returnValue[key];
|
|
2278
|
+
result[key] = Boolean(value) && _typeof(value) === 'object' && !Array.isArray(value) ? keysSorter(value) : value;
|
|
2279
|
+
return result;
|
|
2280
|
+
}, Object.create(null));
|
|
2281
|
+
}
|
|
2282
|
+
function stringify(object, options) {
|
|
2283
|
+
if (!object) {
|
|
2284
|
+
return '';
|
|
2285
|
+
}
|
|
2286
|
+
options = _objectSpread({
|
|
2287
|
+
encode: true,
|
|
2288
|
+
strict: true,
|
|
2289
|
+
arrayFormat: 'none',
|
|
2290
|
+
arrayFormatSeparator: ','
|
|
2291
|
+
}, options);
|
|
2292
|
+
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
2293
|
+
var shouldFilter = function shouldFilter(key) {
|
|
2294
|
+
return options.skipNull && isNullOrUndefined(object[key]) || options.skipEmptyString && object[key] === '';
|
|
2295
|
+
};
|
|
2296
|
+
var formatter = encoderForArrayFormat(options);
|
|
2297
|
+
var objectCopy = {};
|
|
2298
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(object); _i3 < _Object$entries3.length; _i3++) {
|
|
2299
|
+
var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
|
|
2300
|
+
key = _Object$entries3$_i[0],
|
|
2301
|
+
value = _Object$entries3$_i[1];
|
|
2302
|
+
if (!shouldFilter(key)) {
|
|
2303
|
+
objectCopy[key] = value;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
var keys = Object.keys(objectCopy);
|
|
2307
|
+
if (options.sort !== false) {
|
|
2308
|
+
keys.sort(options.sort);
|
|
2309
|
+
}
|
|
2310
|
+
return keys.map(function (key) {
|
|
2311
|
+
var value = object[key];
|
|
2312
|
+
if (value === undefined) {
|
|
2313
|
+
return '';
|
|
2314
|
+
}
|
|
2315
|
+
if (value === null) {
|
|
2316
|
+
return encode(key, options);
|
|
2317
|
+
}
|
|
2318
|
+
if (Array.isArray(value)) {
|
|
2319
|
+
if (value.length === 0 && options.arrayFormat === 'bracket-separator') {
|
|
2320
|
+
return encode(key, options) + '[]';
|
|
2321
|
+
}
|
|
2322
|
+
return value.reduce(formatter(key), []).join('&');
|
|
2323
|
+
}
|
|
2324
|
+
return encode(key, options) + '=' + encode(value, options);
|
|
2325
|
+
}).filter(function (x) {
|
|
2326
|
+
return x.length > 0;
|
|
2327
|
+
}).join('&');
|
|
2328
|
+
}
|
|
2329
|
+
function parseUrl(url, options) {
|
|
2330
|
+
var _url_$split$, _url_;
|
|
2331
|
+
options = _objectSpread({
|
|
2332
|
+
decode: true
|
|
2333
|
+
}, options);
|
|
2334
|
+
var _splitOnFirst3 = splitOnFirst(url, '#'),
|
|
2335
|
+
_splitOnFirst4 = _slicedToArray(_splitOnFirst3, 2),
|
|
2336
|
+
url_ = _splitOnFirst4[0],
|
|
2337
|
+
hash = _splitOnFirst4[1];
|
|
2338
|
+
if (url_ === undefined) {
|
|
2339
|
+
url_ = url;
|
|
2340
|
+
}
|
|
2341
|
+
return _objectSpread({
|
|
2342
|
+
url: (_url_$split$ = (_url_ = url_) === null || _url_ === void 0 || (_url_ = _url_.split('?')) === null || _url_ === void 0 ? void 0 : _url_[0]) !== null && _url_$split$ !== void 0 ? _url_$split$ : '',
|
|
2343
|
+
query: parse(extract(url), options)
|
|
2344
|
+
}, options && options.parseFragmentIdentifier && hash ? {
|
|
2345
|
+
fragmentIdentifier: decode(hash, options)
|
|
2346
|
+
} : {});
|
|
2347
|
+
}
|
|
2348
|
+
function stringifyUrl(object, options) {
|
|
2349
|
+
options = _objectSpread(_defineProperty({
|
|
2350
|
+
encode: true,
|
|
2351
|
+
strict: true
|
|
2352
|
+
}, encodeFragmentIdentifier, true), options);
|
|
2353
|
+
var url = removeHash(object.url).split('?')[0] || '';
|
|
2354
|
+
var queryFromUrl = extract(object.url);
|
|
2355
|
+
var query = _objectSpread(_objectSpread({}, parse(queryFromUrl, {
|
|
2356
|
+
sort: false
|
|
2357
|
+
})), object.query);
|
|
2358
|
+
var queryString = stringify(query, options);
|
|
2359
|
+
queryString && (queryString = "?".concat(queryString));
|
|
2360
|
+
var hash = getHash(object.url);
|
|
2361
|
+
if (typeof object.fragmentIdentifier === 'string') {
|
|
2362
|
+
var urlObjectForFragmentEncode = new URL(url);
|
|
2363
|
+
urlObjectForFragmentEncode.hash = object.fragmentIdentifier;
|
|
2364
|
+
hash = options[encodeFragmentIdentifier] ? urlObjectForFragmentEncode.hash : "#".concat(object.fragmentIdentifier);
|
|
2365
|
+
}
|
|
2366
|
+
return "".concat(url).concat(queryString).concat(hash);
|
|
2367
|
+
}
|
|
2368
|
+
function pick(input, filter, options) {
|
|
2369
|
+
options = _objectSpread(_defineProperty({
|
|
2370
|
+
parseFragmentIdentifier: true
|
|
2371
|
+
}, encodeFragmentIdentifier, false), options);
|
|
2372
|
+
var _parseUrl = parseUrl(input, options),
|
|
2373
|
+
url = _parseUrl.url,
|
|
2374
|
+
query = _parseUrl.query,
|
|
2375
|
+
fragmentIdentifier = _parseUrl.fragmentIdentifier;
|
|
2376
|
+
return stringifyUrl({
|
|
2377
|
+
url: url,
|
|
2378
|
+
query: includeKeys(query, filter),
|
|
2379
|
+
fragmentIdentifier: fragmentIdentifier
|
|
2380
|
+
}, options);
|
|
2381
|
+
}
|
|
2382
|
+
function exclude(input, filter, options) {
|
|
2383
|
+
var exclusionFilter = Array.isArray(filter) ? function (key) {
|
|
2384
|
+
return !filter.includes(key);
|
|
2385
|
+
} : function (key, value) {
|
|
2386
|
+
return !filter(key, value);
|
|
2387
|
+
};
|
|
2388
|
+
return pick(input, exclusionFilter, options);
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
var queryString = /*#__PURE__*/Object.freeze({
|
|
2392
|
+
__proto__: null,
|
|
2393
|
+
exclude: exclude,
|
|
2394
|
+
extract: extract,
|
|
2395
|
+
parse: parse,
|
|
2396
|
+
parseUrl: parseUrl,
|
|
2397
|
+
pick: pick,
|
|
2398
|
+
stringify: stringify,
|
|
2399
|
+
stringifyUrl: stringifyUrl
|
|
2400
|
+
});
|
|
2401
|
+
|
|
1827
2402
|
var styles$p = {};
|
|
1828
2403
|
|
|
1829
2404
|
var messages = reactIntl.defineMessages({
|
|
@@ -2163,6 +2738,7 @@ var propTypes$r = {
|
|
|
2163
2738
|
header: PropTypes.node,
|
|
2164
2739
|
children: PropTypes.node,
|
|
2165
2740
|
footer: PropTypes.node,
|
|
2741
|
+
size: PropTypes.string,
|
|
2166
2742
|
buttons: core.PropTypes.buttons,
|
|
2167
2743
|
// theme: PropTypes.oneOf([null, 'dark', 'light']),
|
|
2168
2744
|
onClickClose: PropTypes.func,
|
|
@@ -2174,6 +2750,7 @@ var defaultProps$r = {
|
|
|
2174
2750
|
header: null,
|
|
2175
2751
|
children: null,
|
|
2176
2752
|
footer: null,
|
|
2753
|
+
size: null,
|
|
2177
2754
|
buttons: null,
|
|
2178
2755
|
// theme: 'dark',
|
|
2179
2756
|
onClickClose: null,
|
|
@@ -2186,11 +2763,12 @@ var ModalDialog = function ModalDialog(_ref) {
|
|
|
2186
2763
|
children = _ref.children,
|
|
2187
2764
|
buttons = _ref.buttons,
|
|
2188
2765
|
footer = _ref.footer,
|
|
2766
|
+
size = _ref.size,
|
|
2189
2767
|
onClickClose = _ref.onClickClose,
|
|
2190
2768
|
className = _ref.className,
|
|
2191
2769
|
bodyClassName = _ref.bodyClassName;
|
|
2192
2770
|
return /*#__PURE__*/React.createElement("div", {
|
|
2193
|
-
className: classNames(['modal-dialog',
|
|
2771
|
+
className: classNames([styles$l.container, 'modal-dialog', _defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), className, className)]),
|
|
2194
2772
|
role: "dialog"
|
|
2195
2773
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2196
2774
|
className: "modal-content"
|
|
@@ -2208,7 +2786,7 @@ var ModalDialog = function ModalDialog(_ref) {
|
|
|
2208
2786
|
"aria-label": "Close",
|
|
2209
2787
|
onClick: onClickClose
|
|
2210
2788
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2211
|
-
className: classNames(['modal-body', 'p-2',
|
|
2789
|
+
className: classNames(['modal-body', 'p-2', _defineProperty({}, bodyClassName, bodyClassName !== null)])
|
|
2212
2790
|
}, children), footer !== null || buttons !== null ? /*#__PURE__*/React.createElement("div", {
|
|
2213
2791
|
className: classNames(['modal-footer', styles$l.footer])
|
|
2214
2792
|
}, footer, buttons !== null ? /*#__PURE__*/React.createElement(Buttons$1, {
|
|
@@ -2265,20 +2843,20 @@ var UploadModal = function UploadModal(_ref2) {
|
|
|
2265
2843
|
}
|
|
2266
2844
|
return ['image', 'video', 'audio'].indexOf(type) !== -1 ? ["".concat(type, "/*")] : null;
|
|
2267
2845
|
}, [type]);
|
|
2268
|
-
var uppy =
|
|
2846
|
+
var uppy$1 = uppy.useUppy({
|
|
2269
2847
|
onComplete: onUppyComplete,
|
|
2270
2848
|
sources: sources,
|
|
2271
2849
|
allowedFileTypes: fileTypes !== null && fileTypes.length > 0 ? fileTypes : null
|
|
2272
2850
|
});
|
|
2273
2851
|
React.useEffect(function () {
|
|
2274
|
-
if (uppy !== null && !opened) {
|
|
2275
|
-
uppy.
|
|
2852
|
+
if (uppy$1 !== null && !opened) {
|
|
2853
|
+
uppy$1.cancelAll();
|
|
2276
2854
|
}
|
|
2277
|
-
}, [uppy, opened]);
|
|
2278
|
-
return uppy !== null ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
2855
|
+
}, [uppy$1, opened]);
|
|
2856
|
+
return uppy$1 !== null ? /*#__PURE__*/React.createElement(React.Suspense, {
|
|
2279
2857
|
fallback: /*#__PURE__*/React.createElement("div", null)
|
|
2280
2858
|
}, /*#__PURE__*/React.createElement(DashboardModal, {
|
|
2281
|
-
uppy: uppy,
|
|
2859
|
+
uppy: uppy$1,
|
|
2282
2860
|
open: opened,
|
|
2283
2861
|
closeAfterFinish: true,
|
|
2284
2862
|
onRequestClose: onRequestClose,
|
|
@@ -3047,10 +3625,11 @@ PropTypes.shape({
|
|
|
3047
3625
|
var font = PropTypes.oneOfType([PropTypes.object, PropTypes.string]);
|
|
3048
3626
|
PropTypes.arrayOf(font);
|
|
3049
3627
|
var textAlign = PropTypes.oneOf(['left', 'right', 'center']);
|
|
3050
|
-
var
|
|
3628
|
+
var colorObject = PropTypes.shape({
|
|
3051
3629
|
color: PropTypes.string,
|
|
3052
3630
|
alpha: PropTypes.number
|
|
3053
3631
|
});
|
|
3632
|
+
var color = PropTypes.oneOfType([colorObject, PropTypes.string]);
|
|
3054
3633
|
var textStyle = PropTypes.shape({
|
|
3055
3634
|
fontFamily: font,
|
|
3056
3635
|
fontSize: PropTypes.number,
|