@bigbinary/neeto-themes-frontend 4.0.5 → 4.0.7

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 (41) hide show
  1. package/README.md +24 -1
  2. package/app/javascript/src/translations/ar.json +5 -1
  3. package/app/javascript/src/translations/bg.json +5 -1
  4. package/app/javascript/src/translations/ca.json +5 -1
  5. package/app/javascript/src/translations/cs.json +5 -1
  6. package/app/javascript/src/translations/da.json +5 -1
  7. package/app/javascript/src/translations/de.json +5 -1
  8. package/app/javascript/src/translations/en.json +5 -1
  9. package/app/javascript/src/translations/es-MX.json +5 -1
  10. package/app/javascript/src/translations/es.json +5 -1
  11. package/app/javascript/src/translations/et.json +5 -1
  12. package/app/javascript/src/translations/fi.json +5 -1
  13. package/app/javascript/src/translations/fil.json +5 -1
  14. package/app/javascript/src/translations/fr.json +5 -1
  15. package/app/javascript/src/translations/he.json +5 -1
  16. package/app/javascript/src/translations/hi.json +5 -1
  17. package/app/javascript/src/translations/hr.json +5 -1
  18. package/app/javascript/src/translations/id.json +5 -1
  19. package/app/javascript/src/translations/it.json +5 -1
  20. package/app/javascript/src/translations/ja.json +5 -1
  21. package/app/javascript/src/translations/ko.json +5 -1
  22. package/app/javascript/src/translations/nl.json +5 -1
  23. package/app/javascript/src/translations/pl.json +5 -1
  24. package/app/javascript/src/translations/pt-BR.json +5 -1
  25. package/app/javascript/src/translations/pt.json +5 -1
  26. package/app/javascript/src/translations/ro.json +5 -1
  27. package/app/javascript/src/translations/ru.json +5 -1
  28. package/app/javascript/src/translations/sk.json +5 -1
  29. package/app/javascript/src/translations/sl.json +5 -1
  30. package/app/javascript/src/translations/sv.json +5 -1
  31. package/app/javascript/src/translations/th.json +5 -1
  32. package/app/javascript/src/translations/tr.json +5 -1
  33. package/app/javascript/src/translations/uk.json +5 -1
  34. package/app/javascript/src/translations/vi.json +5 -1
  35. package/app/javascript/src/translations/zh-CN.json +5 -1
  36. package/app/javascript/src/translations/zh-TW.json +5 -1
  37. package/dist/NeetoThemesBuilder.js +29 -12
  38. package/dist/NeetoThemesBuilder.js.map +1 -1
  39. package/dist/cjs/NeetoThemesBuilder.js +29 -12
  40. package/dist/cjs/NeetoThemesBuilder.js.map +1 -1
  41. package/package.json +7 -7
@@ -273,7 +273,9 @@ var Card$2 = function Card(_ref) {
273
273
  name = _ref.name,
274
274
  className = _ref.className,
275
275
  helpPopoverProps = _ref.helpPopoverProps,
276
- required = _ref.required;
276
+ required = _ref.required,
277
+ _ref$isDisabled = _ref.isDisabled,
278
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
277
279
  var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
278
280
  return {
279
281
  accordionOpenState: store["accordionOpenState"],
@@ -288,10 +290,12 @@ var Card$2 = function Card(_ref) {
288
290
  "data-cy": "theme-".concat(neetoCist.hyphenate(title), "-properties"),
289
291
  className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
290
292
  "pb-2": !accordionOpenState[name],
291
- "pb-3": accordionOpenState[name]
293
+ "pb-3": accordionOpenState[name],
294
+ "opacity-40": isDisabled
292
295
  }),
293
296
  children: [title && /*#__PURE__*/jsxRuntime.jsxs("button", {
294
297
  className: "neeto-themes-nano-section__title flex w-full cursor-pointer items-center justify-between px-1 py-2 focus:outline-none",
298
+ disabled: isDisabled,
295
299
  type: "button",
296
300
  onClick: function onClick() {
297
301
  return setAccordionOpenState(_objectSpread$4(_objectSpread$4({}, accordionOpenState), {}, _defineProperty({}, name, !accordionOpenState[name])));
@@ -355,7 +359,9 @@ var buildPathname = function buildPathname(route) {
355
359
 
356
360
  var CustomCSS = function CustomCSS(_ref) {
357
361
  var onEditCSSClick = _ref.onEditCSSClick,
358
- currentScreen = _ref.currentScreen;
362
+ currentScreen = _ref.currentScreen,
363
+ isEnabled = _ref.isEnabled,
364
+ isProFeature = _ref.isProFeature;
359
365
  var _useTranslation = reactI18next.useTranslation(),
360
366
  t = _useTranslation.t;
361
367
  var _useFormikContext = formik.useFormikContext(),
@@ -376,7 +382,7 @@ var CustomCSS = function CustomCSS(_ref) {
376
382
  var customCSS = neetoCist.findBy({
377
383
  kind: "custom_css"
378
384
  }, values.properties);
379
- if (!customCSS) return null;
385
+ if (!customCSS || !isEnabled && !isProFeature) return null;
380
386
  var parentElementClass = neetoCist.findBy({
381
387
  kind: "custom_css"
382
388
  }, themePropertiesSchema).parentClass;
@@ -405,10 +411,14 @@ var CustomCSS = function CustomCSS(_ref) {
405
411
  className: "neeto-themes-sidebar__custom-css-wrapper",
406
412
  id: "css-editor",
407
413
  children: /*#__PURE__*/jsxRuntime.jsx(Card$2, {
408
- helpPopoverProps: customCssHelpPopoverProps,
414
+ isDisabled: !isEnabled,
409
415
  name: "customcss",
416
+ helpPopoverProps: isEnabled ? customCssHelpPopoverProps : {
417
+ title: t("neetoThemes.common.proFeature.title"),
418
+ description: t("neetoThemes.common.proFeature.description")
419
+ },
410
420
  title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
411
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
421
+ children: isEnabled && /*#__PURE__*/jsxRuntime.jsxs("div", {
412
422
  className: "w-full",
413
423
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
414
424
  className: "neeto-themes-sidebar__custom-css-editor-header w-full justify-end gap-1 rounded-b-none p-2",
@@ -1307,14 +1317,16 @@ var Customize = function Customize(_ref) {
1307
1317
  entityType: store["entityType"],
1308
1318
  isFetchingSchema: store["isFetchingSchema"],
1309
1319
  helpPopoverProps: store["helpPopoverProps"],
1310
- enabledFeatures: store["enabledFeatures"]
1320
+ enabledFeatures: store["enabledFeatures"],
1321
+ proFeatures: store["proFeatures"]
1311
1322
  };
1312
1323
  }, shallow.shallow),
1313
1324
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1314
1325
  entityType = _useConfigStore.entityType,
1315
1326
  isFetchingSchema = _useConfigStore.isFetchingSchema,
1316
1327
  helpPopoverProps = _useConfigStore.helpPopoverProps,
1317
- enabledFeatures = _useConfigStore.enabledFeatures;
1328
+ enabledFeatures = _useConfigStore.enabledFeatures,
1329
+ proFeatures = _useConfigStore.proFeatures;
1318
1330
  var _useParams = reactRouterDom.useParams(),
1319
1331
  themeId = _useParams.themeId;
1320
1332
  var _useThemeStore = useThemeUtils.useThemeStore(function (store) {
@@ -1449,9 +1461,11 @@ var Customize = function Customize(_ref) {
1449
1461
  defaultImageSize: propertyDefaultSize || defaultImageSize,
1450
1462
  key: key
1451
1463
  }, "fixedAspectRatio", propertyFixedAspectRatio || fixedAspectRatio));
1452
- }), enabledFeatures.customCSS && /*#__PURE__*/jsxRuntime.jsx(CustomCSS, {
1464
+ }), /*#__PURE__*/jsxRuntime.jsx(CustomCSS, {
1453
1465
  currentScreen: currentScreen,
1454
- onEditCSSClick: onEditCSSClick
1466
+ onEditCSSClick: onEditCSSClick,
1467
+ isEnabled: enabledFeatures.customCSS,
1468
+ isProFeature: proFeatures.customCSS
1455
1469
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1456
1470
  className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 mt-2 flex flex-col space-y-2 border p-2",
1457
1471
  children: [/*#__PURE__*/jsxRuntime.jsx(Tooltip, {
@@ -2336,7 +2350,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2336
2350
  _ref$enabledFeatures = _ref.enabledFeatures,
2337
2351
  enabledFeatures = _ref$enabledFeatures === void 0 ? {
2338
2352
  customCSS: true
2339
- } : _ref$enabledFeatures;
2353
+ } : _ref$enabledFeatures,
2354
+ _ref$proFeatures = _ref.proFeatures,
2355
+ proFeatures = _ref$proFeatures === void 0 ? {} : _ref$proFeatures;
2340
2356
  var _useThemeStore = useThemeUtils.useThemeStore(function (store) {
2341
2357
  return {
2342
2358
  setThemeState: store["setThemeState"]
@@ -2368,7 +2384,8 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2368
2384
  isTemplateThemesEnabled: isTemplateThemesEnabled,
2369
2385
  helpDocUrl: helpDocUrl,
2370
2386
  helpPopoverProps: helpPopoverProps,
2371
- enabledFeatures: enabledFeatures
2387
+ enabledFeatures: enabledFeatures,
2388
+ proFeatures: proFeatures
2372
2389
  });
2373
2390
  }, []);
2374
2391
  react.useEffect(function () {