@bigbinary/neeto-templates-frontend 1.1.16 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useRef, useCallback, useEffect, memo } from 'react';
3
- import { noop, removeBy, renameKeys } from '@bigbinary/neeto-cist';
3
+ import { noop, removeBy, renameKeys } from 'neetocist';
4
4
  import { Typography, Spinner, Button, Modal, Label } from '@bigbinary/neetoui';
5
5
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
6
6
  import Search from '@bigbinary/neeto-molecules/Search';
@@ -1855,7 +1855,6 @@ var arrayPrefixGenerators = {
1855
1855
  };
1856
1856
 
1857
1857
  var isArray$1 = Array.isArray;
1858
- var split = String.prototype.split;
1859
1858
  var push = Array.prototype.push;
1860
1859
  var pushToArray = function (arr, valueOrArray) {
1861
1860
  push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -1957,14 +1956,6 @@ var stringify$1 = function stringify(
1957
1956
  if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
1958
1957
  if (encoder) {
1959
1958
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
1960
- if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
1961
- var valuesArray = split.call(String(obj), ',');
1962
- var valuesJoined = '';
1963
- for (var i = 0; i < valuesArray.length; ++i) {
1964
- valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
1965
- }
1966
- return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
1967
- }
1968
1959
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
1969
1960
  }
1970
1961
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -1979,6 +1970,9 @@ var stringify$1 = function stringify(
1979
1970
  var objKeys;
1980
1971
  if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1981
1972
  // we need to join elements in
1973
+ if (encodeValuesOnly && encoder) {
1974
+ obj = utils$1.maybeMap(obj, encoder);
1975
+ }
1982
1976
  objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
1983
1977
  } else if (isArray$1(filter)) {
1984
1978
  objKeys = filter;
@@ -2011,7 +2005,7 @@ var stringify$1 = function stringify(
2011
2005
  commaRoundTrip,
2012
2006
  strictNullHandling,
2013
2007
  skipNulls,
2014
- encoder,
2008
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
2015
2009
  filter,
2016
2010
  sort,
2017
2011
  allowDots,
@@ -2210,7 +2204,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2210
2204
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2211
2205
 
2212
2206
  var parseValues = function parseQueryStringValues(str, options) {
2213
- var obj = {};
2207
+ var obj = { __proto__: null };
2208
+
2214
2209
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2215
2210
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2216
2211
  var parts = cleanStr.split(options.delimiter, limit);
@@ -2722,7 +2717,8 @@ var List = function List(_ref) {
2722
2717
  hasNextPage = _useFetchTemplates$ha === void 0 ? false : _useFetchTemplates$ha,
2723
2718
  fetchNextPage = _useFetchTemplates.fetchNextPage,
2724
2719
  isTemplatesLoading = _useFetchTemplates.isLoading,
2725
- data = _useFetchTemplates.data;
2720
+ _useFetchTemplates$da = _useFetchTemplates.data,
2721
+ data = _useFetchTemplates$da === void 0 ? {} : _useFetchTemplates$da;
2726
2722
  var _useInfiniteScroll = useInfiniteScroll({
2727
2723
  loading: isTemplatesLoading,
2728
2724
  hasNextPage: hasNextPage,
@@ -2740,9 +2736,12 @@ var List = function List(_ref) {
2740
2736
  if (isTemplatesLoading) {
2741
2737
  return /*#__PURE__*/React__default.createElement(PageLoader, null);
2742
2738
  }
2743
- var tags = data.tags,
2744
- templates = data.templates,
2745
- templatesCount = data.templatesCount;
2739
+ var _data$tags = data.tags,
2740
+ tags = _data$tags === void 0 ? [] : _data$tags,
2741
+ _data$templates = data.templates,
2742
+ templates = _data$templates === void 0 ? [] : _data$templates,
2743
+ _data$templatesCount = data.templatesCount,
2744
+ templatesCount = _data$templatesCount === void 0 ? 0 : _data$templatesCount;
2746
2745
  var categories = [_objectSpread$2(_objectSpread$2({}, DEFAULT_CATEGORY), {}, {
2747
2746
  count: templatesCount
2748
2747
  })].concat(_toConsumableArray(tags));
@@ -2805,7 +2804,7 @@ var List = function List(_ref) {
2805
2804
  icon: isCreating ? Spinner : SvgCustom,
2806
2805
  title: t("neetoTemplate.templates.blankCard.title"),
2807
2806
  onClick: onCreate
2808
- }), templates === null || templates === void 0 ? void 0 : templates.map(function (template, index) {
2807
+ }), templates.map(function (template, index) {
2809
2808
  return /*#__PURE__*/React__default.createElement(Card, {
2810
2809
  key: index,
2811
2810
  template: template,