@bigbinary/neeto-themes-frontend 4.0.17 → 4.0.19

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.
Files changed (56) hide show
  1. package/app/javascript/src/translations/ar.json +24 -14
  2. package/app/javascript/src/translations/bg.json +24 -14
  3. package/app/javascript/src/translations/ca.json +24 -14
  4. package/app/javascript/src/translations/cs.json +24 -14
  5. package/app/javascript/src/translations/da.json +24 -14
  6. package/app/javascript/src/translations/de.json +24 -14
  7. package/app/javascript/src/translations/en.json +3 -0
  8. package/app/javascript/src/translations/es-MX.json +24 -14
  9. package/app/javascript/src/translations/es.json +24 -14
  10. package/app/javascript/src/translations/et.json +24 -14
  11. package/app/javascript/src/translations/fi.json +24 -14
  12. package/app/javascript/src/translations/fil.json +24 -14
  13. package/app/javascript/src/translations/fr.json +24 -14
  14. package/app/javascript/src/translations/he.json +24 -14
  15. package/app/javascript/src/translations/hi.json +24 -14
  16. package/app/javascript/src/translations/hr.json +24 -14
  17. package/app/javascript/src/translations/hu.json +24 -14
  18. package/app/javascript/src/translations/id.json +24 -14
  19. package/app/javascript/src/translations/it.json +24 -14
  20. package/app/javascript/src/translations/ja.json +24 -14
  21. package/app/javascript/src/translations/ko.json +24 -14
  22. package/app/javascript/src/translations/nl.json +24 -14
  23. package/app/javascript/src/translations/pl.json +24 -14
  24. package/app/javascript/src/translations/pt-BR.json +24 -14
  25. package/app/javascript/src/translations/pt.json +24 -14
  26. package/app/javascript/src/translations/ro.json +24 -14
  27. package/app/javascript/src/translations/ru.json +24 -14
  28. package/app/javascript/src/translations/sk.json +24 -14
  29. package/app/javascript/src/translations/sl.json +24 -14
  30. package/app/javascript/src/translations/sv.json +24 -14
  31. package/app/javascript/src/translations/th.json +24 -14
  32. package/app/javascript/src/translations/tr.json +24 -14
  33. package/app/javascript/src/translations/uk.json +24 -14
  34. package/app/javascript/src/translations/vi.json +24 -14
  35. package/app/javascript/src/translations/zh-CN.json +24 -14
  36. package/app/javascript/src/translations/zh-TW.json +24 -14
  37. package/dist/.ready +1 -1
  38. package/dist/NeetoThemesBuilder.js +28 -17
  39. package/dist/NeetoThemesBuilder.js.map +1 -1
  40. package/dist/cjs/NeetoThemesBuilder.js +27 -16
  41. package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
  42. package/dist/cjs/hooks.js +1 -2
  43. package/dist/cjs/hooks.js.map +1 -1
  44. package/dist/cjs/index.js +2 -3
  45. package/dist/cjs/index.js.map +1 -1
  46. package/dist/hooks.js +1 -2
  47. package/dist/hooks.js.map +1 -1
  48. package/dist/index.js +2 -3
  49. package/dist/index.js.map +1 -1
  50. package/dist/{useExpandedSection-DvbcFXMx.js → useExpandedSection-B6w2AxTV.js} +40 -12
  51. package/dist/useExpandedSection-B6w2AxTV.js.map +1 -0
  52. package/dist/{useExpandedSection-BkPg-7yk.js → useExpandedSection-D9J7nzlC.js} +40 -13
  53. package/dist/useExpandedSection-D9J7nzlC.js.map +1 -0
  54. package/package.json +9 -9
  55. package/dist/useExpandedSection-BkPg-7yk.js.map +0 -1
  56. package/dist/useExpandedSection-DvbcFXMx.js.map +0 -1
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
9
9
  var utils = require('../index-BP-ka0mC.js');
10
10
  var reactQuery = require('@tanstack/react-query');
11
11
  var axios = require('axios');
12
- var useExpandedSection = require('../useExpandedSection-DvbcFXMx.js');
12
+ var useExpandedSection = require('../useExpandedSection-B6w2AxTV.js');
13
13
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
14
14
  var classnames = require('classnames');
15
15
  var utils$1 = require('@bigbinary/neeto-commons-frontend/utils');
@@ -20,13 +20,13 @@ var reactRouterDom = require('react-router-dom');
20
20
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
21
21
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
22
22
  var Close = require('@bigbinary/neeto-icons/Close');
23
+ var ramda = require('ramda');
23
24
  var Popover = require('@bigbinary/neetoui/Popover');
24
25
  var Typography = require('@bigbinary/neetoui/Typography');
25
26
  var Switch = require('@bigbinary/neetoui/Switch');
26
27
  var Tooltip = require('@bigbinary/neetoui/Tooltip');
27
28
  var Form = require('@bigbinary/neetoui/formik/Form');
28
29
  var BlockNavigation = require('@bigbinary/neetoui/formik/BlockNavigation');
29
- var ramda = require('ramda');
30
30
  var formik = require('formik');
31
31
  var jsxRuntime = require('react/jsx-runtime');
32
32
  var i18n = require('i18next');
@@ -51,7 +51,6 @@ var Search = require('@bigbinary/neeto-molecules/Search');
51
51
  var AddImage = require('@bigbinary/neeto-icons/AddImage');
52
52
  var CodeBlock = require('@bigbinary/neeto-icons/CodeBlock');
53
53
  var ColorPicker$1 = require('@bigbinary/neeto-icons/ColorPicker');
54
- var Image = require('@bigbinary/neeto-icons/Image');
55
54
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
56
55
  var LeftArrow = require('@bigbinary/neeto-icons/LeftArrow');
57
56
  var RightArrow = require('@bigbinary/neeto-icons/RightArrow');
@@ -1374,6 +1373,7 @@ var Customize = function Customize(_ref) {
1374
1373
  currentScreen = _ref.currentScreen;
1375
1374
  var _useTranslation = reactI18next.useTranslation(),
1376
1375
  t = _useTranslation.t;
1376
+ useExpandedSection.useSyncExpandedSectionFromUrl();
1377
1377
  var history = reactRouterDom.useHistory();
1378
1378
  var _useState = react.useState({}),
1379
1379
  _useState2 = _slicedToArray(_useState, 2),
@@ -1572,11 +1572,11 @@ var Customize = function Customize(_ref) {
1572
1572
  type: "reset"
1573
1573
  }), /*#__PURE__*/jsxRuntime.jsx(Button, {
1574
1574
  "data-testid": "save-changes-button",
1575
+ disabled: !dirty && (themeData === null || themeData === void 0 ? void 0 : themeData.id) || isSubmitting || !isValid,
1575
1576
  label: t("neetoThemes.buttons.save"),
1576
1577
  loading: isSubmitting,
1577
1578
  ref: submitBtnRef,
1578
- type: "submit",
1579
- disabled: !dirty && (themeData === null || themeData === void 0 ? void 0 : themeData.id) || isSubmitting || !isValid
1579
+ type: "submit"
1580
1580
  })]
1581
1581
  }), /*#__PURE__*/jsxRuntime.jsx(Popover, {
1582
1582
  appendTo: function appendTo() {
@@ -1726,7 +1726,6 @@ var Thumbnail = function Thumbnail(_ref) {
1726
1726
  };
1727
1727
 
1728
1728
  var Card = function Card(_ref) {
1729
- var _theme$logo, _theme$coverImage;
1730
1729
  var _ref$active = _ref.active,
1731
1730
  active = _ref$active === void 0 ? false : _ref$active,
1732
1731
  isPreviewing = _ref.isPreviewing,
@@ -1742,8 +1741,17 @@ var Card = function Card(_ref) {
1742
1741
  Thumbnail$1 = _ref.thumbnail;
1743
1742
  var _useTranslation = reactI18next.useTranslation(),
1744
1743
  t = _useTranslation.t;
1744
+ var _useConfigStore = useExpandedSection.useConfigStore(function (store) {
1745
+ return {
1746
+ themePropertiesSchema: store["themePropertiesSchema"]
1747
+ };
1748
+ }, shallow.shallow),
1749
+ themePropertiesSchema = _useConfigStore.themePropertiesSchema;
1745
1750
  var id = theme.id,
1746
1751
  name = theme.name;
1752
+ var imageProperties = neetoCist.filterBy({
1753
+ kind: "image"
1754
+ }, themePropertiesSchema);
1747
1755
  var handleDeleteTheme = function handleDeleteTheme() {
1748
1756
  return onDeleteTheme(id, name);
1749
1757
  };
@@ -1867,16 +1875,19 @@ var Card = function Card(_ref) {
1867
1875
  label: t("neetoThemes.common.customizeStyle"),
1868
1876
  testId: "quick-customize-style",
1869
1877
  onClick: handleQuickEdit("style")
1870
- }), /*#__PURE__*/jsxRuntime.jsx(QuickActionRow, {
1871
- icon: AddImage,
1872
- testId: "quick-add-logo",
1873
- label: t((_theme$logo = theme.logo) !== null && _theme$logo !== void 0 && _theme$logo.url ? "neetoThemes.common.changeLogo" : "neetoThemes.common.addLogo"),
1874
- onClick: handleQuickEdit("logo")
1875
- }), /*#__PURE__*/jsxRuntime.jsx(QuickActionRow, {
1876
- icon: Image,
1877
- testId: "quick-add-cover-image",
1878
- label: t((_theme$coverImage = theme.coverImage) !== null && _theme$coverImage !== void 0 && _theme$coverImage.url ? "neetoThemes.common.changeCoverImage" : "neetoThemes.common.addCoverImage"),
1879
- onClick: handleQuickEdit("coverImage")
1878
+ }), imageProperties.map(function (_ref2) {
1879
+ var _theme$camelKey;
1880
+ var key = _ref2.key;
1881
+ var camelKey = neetoCist.snakeToCamelCase(key);
1882
+ var hasImage = neetoCist.isPresent((_theme$camelKey = theme[camelKey]) === null || _theme$camelKey === void 0 ? void 0 : _theme$camelKey.url);
1883
+ var action = hasImage ? "change" : "add";
1884
+ var specificKey = "neetoThemes.common.".concat(action).concat(neetoCist.capitalize(camelKey));
1885
+ return /*#__PURE__*/jsxRuntime.jsx(QuickActionRow, {
1886
+ icon: AddImage,
1887
+ label: t([specificKey, "neetoThemes.common.addImage"]),
1888
+ testId: "quick-add-".concat(neetoCist.hyphenate(key)),
1889
+ onClick: handleQuickEdit(camelKey)
1890
+ }, key);
1880
1891
  }), /*#__PURE__*/jsxRuntime.jsx(QuickActionRow, {
1881
1892
  icon: CodeBlock,
1882
1893
  label: t("neetoThemes.build.leftSideBar.themes.customCSS"),