@bigbinary/neeto-themes-frontend 4.2.9 → 4.2.11-beta1

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 (63) hide show
  1. package/app/javascript/src/translations/ar.json +0 -1
  2. package/app/javascript/src/translations/bg.json +0 -1
  3. package/app/javascript/src/translations/ca.json +0 -1
  4. package/app/javascript/src/translations/cs.json +0 -1
  5. package/app/javascript/src/translations/da.json +0 -1
  6. package/app/javascript/src/translations/de.json +0 -1
  7. package/app/javascript/src/translations/en.json +0 -1
  8. package/app/javascript/src/translations/es-MX.json +0 -1
  9. package/app/javascript/src/translations/es.json +0 -1
  10. package/app/javascript/src/translations/et.json +0 -1
  11. package/app/javascript/src/translations/fi.json +0 -1
  12. package/app/javascript/src/translations/fil.json +0 -1
  13. package/app/javascript/src/translations/fr.json +0 -1
  14. package/app/javascript/src/translations/he.json +0 -1
  15. package/app/javascript/src/translations/hi.json +0 -1
  16. package/app/javascript/src/translations/hr.json +0 -1
  17. package/app/javascript/src/translations/hu.json +0 -1
  18. package/app/javascript/src/translations/id.json +0 -1
  19. package/app/javascript/src/translations/it.json +0 -1
  20. package/app/javascript/src/translations/ja.json +0 -1
  21. package/app/javascript/src/translations/ko.json +0 -1
  22. package/app/javascript/src/translations/lv.json +0 -1
  23. package/app/javascript/src/translations/nl.json +0 -1
  24. package/app/javascript/src/translations/pl.json +0 -1
  25. package/app/javascript/src/translations/pt-BR.json +0 -1
  26. package/app/javascript/src/translations/pt.json +0 -1
  27. package/app/javascript/src/translations/ro.json +0 -1
  28. package/app/javascript/src/translations/ru.json +0 -1
  29. package/app/javascript/src/translations/sk.json +0 -1
  30. package/app/javascript/src/translations/sl.json +0 -1
  31. package/app/javascript/src/translations/sv.json +0 -1
  32. package/app/javascript/src/translations/th.json +0 -1
  33. package/app/javascript/src/translations/tr.json +0 -1
  34. package/app/javascript/src/translations/uk.json +0 -1
  35. package/app/javascript/src/translations/vi.json +0 -1
  36. package/app/javascript/src/translations/zh-CN.json +0 -1
  37. package/app/javascript/src/translations/zh-TW.json +0 -1
  38. package/dist/.ready +1 -1
  39. package/dist/NeetoThemesBuilder.js +43 -46
  40. package/dist/NeetoThemesBuilder.js.map +1 -1
  41. package/dist/cjs/NeetoThemesBuilder.js +42 -45
  42. package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
  43. package/dist/cjs/hooks.js +1 -1
  44. package/dist/cjs/index.js +2 -2
  45. package/dist/cjs/v2/NeetoThemesBuilder.js +42 -45
  46. package/dist/cjs/v2/NeetoThemesBuilder.js.map +1 -1
  47. package/dist/cjs/v2/hooks.js +1 -1
  48. package/dist/cjs/v2/index.js +2 -2
  49. package/dist/hooks.js +1 -1
  50. package/dist/index.js +2 -2
  51. package/dist/{useExpandedSection-BTBI4UqP.js → useExpandedSection-D0PusQFE.js} +7 -7
  52. package/dist/{useExpandedSection-BTBI4UqP.js.map → useExpandedSection-D0PusQFE.js.map} +1 -1
  53. package/dist/{useExpandedSection-MjgB7rh6.js → useExpandedSection-Dpv_-kLy.js} +8 -8
  54. package/dist/{useExpandedSection-MjgB7rh6.js.map → useExpandedSection-Dpv_-kLy.js.map} +1 -1
  55. package/dist/{useGlobalThemesApi-DjZDCCZE.js → useGlobalThemesApi-Bumd-UCH.js} +4 -40
  56. package/dist/{useGlobalThemesApi-DjZDCCZE.js.map → useGlobalThemesApi-Bumd-UCH.js.map} +1 -1
  57. package/dist/{useGlobalThemesApi-BdrPI8PW.js → useGlobalThemesApi-efNiy6YY.js} +5 -41
  58. package/dist/{useGlobalThemesApi-BdrPI8PW.js.map → useGlobalThemesApi-efNiy6YY.js.map} +1 -1
  59. package/dist/v2/NeetoThemesBuilder.js +43 -46
  60. package/dist/v2/NeetoThemesBuilder.js.map +1 -1
  61. package/dist/v2/hooks.js +1 -1
  62. package/dist/v2/index.js +2 -2
  63. package/package.json +11 -11
@@ -1,11 +1,11 @@
1
- import { shallow } from 'zustand/shallow';
1
+ import { useShallow } from 'zustand/shallow';
2
2
  import { Suspense, lazy, useId, useEffect, createElement, useState, useMemo, memo, useRef, useCallback } from 'react';
3
3
  import { Toastr, Spinner, Typography, Button, Label, ColorPicker, Select, Slider, Checkbox, Switch, Input, Tooltip, Popover, Badge, Alert } from '@bigbinary/neeto-atoms';
4
4
  import { hyphenate, isPresent, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, capitalize, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
5
5
  import { useQueryParams, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
- import { n, u as useShowGlobalTheme, a as useFetchTheme, b as useListThemes, c as useCreateTheme, d as useUpdateTheme, e as useApplyTheme, f as routes, g as useShowThemeEntity, h as useDeleteTheme, r as registerNeetoThemesTranslations } from '../useGlobalThemesApi-BdrPI8PW.js';
8
- import { a as useExpandedSection, b as useConfigStore, c as useThemeStore, u as useThemeUtils, d as useSyncExpandedSectionFromUrl } from '../useExpandedSection-MjgB7rh6.js';
7
+ import { n, u as useShowGlobalTheme, a as useFetchTheme, b as useListThemes, c as useCreateTheme, d as useUpdateTheme, e as useApplyTheme, f as routes, g as useShowThemeEntity, h as useDeleteTheme, r as registerNeetoThemesTranslations } from '../useGlobalThemesApi-efNiy6YY.js';
8
+ import { a as useExpandedSection, b as useConfigStore, c as useThemeStore, u as useThemeUtils, d as useSyncExpandedSectionFromUrl } from '../useExpandedSection-Dpv_-kLy.js';
9
9
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
10
10
  import _regeneratorRuntime from '@babel/runtime/regenerator';
11
11
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -404,12 +404,12 @@ var CustomCSS = function CustomCSS(_ref) {
404
404
  var _useFormikContext = useFormikContext(),
405
405
  values = _useFormikContext.values,
406
406
  setFieldValue = _useFormikContext.setFieldValue;
407
- var _useConfigStore = useConfigStore(function (store) {
407
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
408
408
  return {
409
409
  themePropertiesSchema: store["themePropertiesSchema"],
410
410
  helpPopoverProps: store["helpPopoverProps"]
411
411
  };
412
- }, shallow),
412
+ })),
413
413
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
414
414
  helpPopoverProps = _useConfigStore.helpPopoverProps;
415
415
  var _helpPopoverProps$cus = helpPopoverProps.customCss,
@@ -1001,17 +1001,17 @@ var Properties = function Properties(_ref) {
1001
1001
  var onPropertiesChange = _ref.onPropertiesChange,
1002
1002
  condition = _ref.condition,
1003
1003
  themeId = _ref.themeId;
1004
- var _useConfigStore = useConfigStore(function (store) {
1004
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1005
1005
  return {
1006
1006
  themePropertiesSchema: store["themePropertiesSchema"]
1007
1007
  };
1008
- }, shallow),
1008
+ })),
1009
1009
  themePropertiesSchema = _useConfigStore.themePropertiesSchema;
1010
- var _useThemeStore = useThemeStore(function (store) {
1010
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
1011
1011
  return {
1012
1012
  setThemeState: store["setThemeState"]
1013
1013
  };
1014
- }, shallow),
1014
+ })),
1015
1015
  setThemeState = _useThemeStore.setThemeState;
1016
1016
  var _useFormikContext = useFormikContext(),
1017
1017
  setFieldValue = _useFormikContext.setFieldValue,
@@ -1240,11 +1240,11 @@ var ImageBlock = function ImageBlock(_ref) {
1240
1240
  var _useFormikContext = useFormikContext(),
1241
1241
  setFieldValue = _useFormikContext.setFieldValue,
1242
1242
  values = _useFormikContext.values;
1243
- var _useConfigStore = useConfigStore(function (store) {
1243
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1244
1244
  return {
1245
1245
  themePropertiesSchema: store["themePropertiesSchema"]
1246
1246
  };
1247
- }, shallow),
1247
+ })),
1248
1248
  themePropertiesSchema = _useConfigStore.themePropertiesSchema;
1249
1249
  var propertySchema = findBy({
1250
1250
  key: attribute
@@ -1349,12 +1349,12 @@ var Images = function Images(_ref) {
1349
1349
  fixedAspectRatio = _ref.fixedAspectRatio;
1350
1350
  var _useFormikContext = useFormikContext(),
1351
1351
  values = _useFormikContext.values;
1352
- var _useConfigStore = useConfigStore(function (store) {
1352
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1353
1353
  return {
1354
1354
  helpPopoverProps: store["helpPopoverProps"],
1355
1355
  themePropertiesSchema: store["themePropertiesSchema"]
1356
1356
  };
1357
- }, shallow),
1357
+ })),
1358
1358
  helpPopoverProps = _useConfigStore.helpPopoverProps,
1359
1359
  themePropertiesSchema = _useConfigStore.themePropertiesSchema;
1360
1360
  var key = snakeToCamelCase(attribute);
@@ -1386,11 +1386,11 @@ var ThemeMeta = function ThemeMeta(_ref) {
1386
1386
  var className = _ref.className;
1387
1387
  var _useTranslation = useTranslation(),
1388
1388
  t = _useTranslation.t;
1389
- var _useConfigStore = useConfigStore(function (store) {
1389
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1390
1390
  return {
1391
1391
  helpPopoverProps: store["helpPopoverProps"]
1392
1392
  };
1393
- }, shallow),
1393
+ })),
1394
1394
  helpPopoverProps = _useConfigStore.helpPopoverProps;
1395
1395
  var _helpPopoverProps$nam = helpPopoverProps.name,
1396
1396
  nameHelpPopoverProps = _helpPopoverProps$nam === void 0 ? {} : _helpPopoverProps$nam;
@@ -1431,7 +1431,7 @@ var Customize = function Customize(_ref) {
1431
1431
  _useState2 = _slicedToArray(_useState, 2),
1432
1432
  isNotAppliedPopoverOpen = _useState2[0],
1433
1433
  setIsNotAppliedPopoverOpen = _useState2[1];
1434
- var _useConfigStore = useConfigStore(function (store) {
1434
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1435
1435
  return {
1436
1436
  themePropertiesSchema: store["themePropertiesSchema"],
1437
1437
  entityId: store["entityId"],
@@ -1441,7 +1441,7 @@ var Customize = function Customize(_ref) {
1441
1441
  enabledFeatures: store["enabledFeatures"],
1442
1442
  proFeatures: store["proFeatures"]
1443
1443
  };
1444
- }, shallow),
1444
+ })),
1445
1445
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1446
1446
  entityId = _useConfigStore.entityId,
1447
1447
  entityType = _useConfigStore.entityType,
@@ -1454,12 +1454,12 @@ var Customize = function Customize(_ref) {
1454
1454
  var _useQueryParams = useQueryParams(),
1455
1455
  sourceThemeId = _useQueryParams.source;
1456
1456
  var isCustomizingSystemTheme = !themeId && isPresent(sourceThemeId);
1457
- var _useThemeStore = useThemeStore(function (store) {
1457
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
1458
1458
  return {
1459
1459
  currentTheme: store["currentTheme"],
1460
1460
  setThemeState: store["setThemeState"]
1461
1461
  };
1462
- }, shallow),
1462
+ })),
1463
1463
  currentTheme = _useThemeStore.currentTheme,
1464
1464
  setThemeState = _useThemeStore.setThemeState;
1465
1465
  var _useShowGlobalTheme = useShowGlobalTheme(entityType),
@@ -1784,11 +1784,11 @@ var Thumbnail = function Thumbnail(_ref) {
1784
1784
  isPreviewing = _ref.isPreviewing,
1785
1785
  isHighLightedTheme = _ref.isHighLightedTheme,
1786
1786
  theme = _ref.theme;
1787
- var _useConfigStore = useConfigStore(function (store) {
1787
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1788
1788
  return {
1789
1789
  themePropertiesSchema: store["themePropertiesSchema"]
1790
1790
  };
1791
- }, shallow),
1791
+ })),
1792
1792
  _useConfigStore$theme = _useConfigStore.themePropertiesSchema,
1793
1793
  themePropertiesSchema = _useConfigStore$theme === void 0 ? [] : _useConfigStore$theme;
1794
1794
  var _themePropertiesSchem = _slicedToArray(themePropertiesSchema, 2),
@@ -1872,13 +1872,13 @@ var Card$1 = function Card(_ref) {
1872
1872
  Thumbnail$1 = _ref.thumbnail;
1873
1873
  var _useTranslation = useTranslation(),
1874
1874
  t = _useTranslation.t;
1875
- var _useConfigStore = useConfigStore(function (store) {
1875
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
1876
1876
  return {
1877
1877
  themePropertiesSchema: store["themePropertiesSchema"],
1878
1878
  enabledFeatures: store["enabledFeatures"],
1879
1879
  proFeatures: store["proFeatures"]
1880
1880
  };
1881
- }, shallow),
1881
+ })),
1882
1882
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1883
1883
  enabledFeatures = _useConfigStore.enabledFeatures,
1884
1884
  proFeatures = _useConfigStore.proFeatures;
@@ -2081,19 +2081,19 @@ var Themes = function Themes(_ref) {
2081
2081
  t = _useTranslation.t;
2082
2082
  var _useThemeUtils = useThemeUtils(),
2083
2083
  setTheme = _useThemeUtils.setTheme;
2084
- var _useThemeStore = useThemeStore(function (store) {
2084
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
2085
2085
  return {
2086
2086
  setThemeState: store["setThemeState"],
2087
2087
  previewingTheme: store["previewingTheme"]
2088
2088
  };
2089
- }, shallow),
2089
+ })),
2090
2090
  setThemeState = _useThemeStore.setThemeState,
2091
2091
  previewingTheme = _useThemeStore.previewingTheme;
2092
- var _useConfigStore = useConfigStore(function (store) {
2092
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
2093
2093
  return {
2094
2094
  entityType: store["entityType"]
2095
2095
  };
2096
- }, shallow),
2096
+ })),
2097
2097
  entityType = _useConfigStore.entityType;
2098
2098
  var _useQueryParams = useQueryParams(),
2099
2099
  _useQueryParams$searc = _useQueryParams.searchTerm,
@@ -2158,12 +2158,9 @@ var Themes = function Themes(_ref) {
2158
2158
  onSetPreviewTheme: setPreviewTheme
2159
2159
  })
2160
2160
  });
2161
- var systemThemesSection = isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxs("div", {
2162
- className: "mb-6 space-y-3",
2163
- children: [/*#__PURE__*/jsx(SectionHeading, {
2164
- label: t("neetoThemes.build.leftSideBar.themes.systemThemes"),
2165
- testId: "system-themes-heading"
2166
- }), /*#__PURE__*/jsx("div", {
2161
+ var systemThemesSection = isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsx("div", {
2162
+ className: "mb-6",
2163
+ children: /*#__PURE__*/jsx("div", {
2167
2164
  className: "flex flex-col gap-4 px-6 pb-10 lg:px-5 xl:px-6",
2168
2165
  "data-testid": "system-themes",
2169
2166
  children: filteredDefaultThemes.map(function (theme) {
@@ -2179,7 +2176,7 @@ var Themes = function Themes(_ref) {
2179
2176
  onSetPreviewTheme: setPreviewTheme
2180
2177
  });
2181
2178
  })
2182
- })]
2179
+ })
2183
2180
  });
2184
2181
  var customThemesSection = isNotEmpty(filteredThemes) && /*#__PURE__*/jsxs("div", {
2185
2182
  className: "mb-6 space-y-3",
@@ -2238,19 +2235,19 @@ var TitleBar = function TitleBar(_ref) {
2238
2235
  handleToggleSearch = _ref.handleToggleSearch;
2239
2236
  var _useTranslation = useTranslation(),
2240
2237
  t = _useTranslation.t;
2241
- var _useThemeStore = useThemeStore(function (store) {
2238
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
2242
2239
  return {
2243
2240
  previewingTheme: store["previewingTheme"]
2244
2241
  };
2245
- }, shallow),
2242
+ })),
2246
2243
  previewingTheme = _useThemeStore.previewingTheme;
2247
2244
  var themeId = previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id;
2248
- var _useConfigStore = useConfigStore(function (store) {
2245
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
2249
2246
  return {
2250
2247
  entityType: store["entityType"],
2251
2248
  helpDocUrl: store["helpDocUrl"]
2252
2249
  };
2253
- }, shallow),
2250
+ })),
2254
2251
  entityType = _useConfigStore.entityType,
2255
2252
  helpDocUrl = _useConfigStore.helpDocUrl;
2256
2253
  var _useQueryParams = useQueryParams(),
@@ -2357,23 +2354,23 @@ var Sidebar = function Sidebar(_ref) {
2357
2354
  useEffect(function () {
2358
2355
  setIsThemesSidebarCollapsed(!isLargerScreen);
2359
2356
  }, [isLargerScreen]);
2360
- var _useConfigStore = useConfigStore(function (store) {
2357
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
2361
2358
  return {
2362
2359
  entityType: store["entityType"],
2363
2360
  entityId: store["entityId"],
2364
2361
  isFetchingSchema: store["isFetchingSchema"],
2365
2362
  defaultThemeName: store["defaultThemeName"]
2366
2363
  };
2367
- }, shallow),
2364
+ })),
2368
2365
  entityType = _useConfigStore.entityType,
2369
2366
  entityId = _useConfigStore.entityId,
2370
2367
  isFetchingSchema = _useConfigStore.isFetchingSchema,
2371
2368
  defaultThemeName = _useConfigStore.defaultThemeName;
2372
- var _useThemeStore = useThemeStore(function (store) {
2369
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
2373
2370
  return {
2374
2371
  setThemeState: store["setThemeState"]
2375
2372
  };
2376
- }, shallow),
2373
+ })),
2377
2374
  setThemeState = _useThemeStore.setThemeState;
2378
2375
  var didScrollActiveThemeIntoView = useRef(null);
2379
2376
  var _useTranslation = useTranslation(),
@@ -2654,19 +2651,19 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2654
2651
  _ref$proFeatures = _ref.proFeatures,
2655
2652
  proFeatures = _ref$proFeatures === void 0 ? {} : _ref$proFeatures;
2656
2653
  useMemo(registerNeetoThemesTranslations, []);
2657
- var _useThemeStore = useThemeStore(function (store) {
2654
+ var _useThemeStore = useThemeStore(useShallow(function (store) {
2658
2655
  return {
2659
2656
  setThemeState: store["setThemeState"]
2660
2657
  };
2661
- }, shallow),
2658
+ })),
2662
2659
  setThemeState = _useThemeStore.setThemeState;
2663
2660
  var _useThemeUtils = useThemeUtils(),
2664
2661
  setTheme = _useThemeUtils.setTheme;
2665
- var _useConfigStore = useConfigStore(function (store) {
2662
+ var _useConfigStore = useConfigStore(useShallow(function (store) {
2666
2663
  return {
2667
2664
  setConfigState: store["setConfigState"]
2668
2665
  };
2669
- }, shallow),
2666
+ })),
2670
2667
  setConfigState = _useConfigStore.setConfigState;
2671
2668
  var _useTranslation = useTranslation(),
2672
2669
  t = _useTranslation.t;