@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
@@ -271,7 +271,9 @@ var Card$2 = function Card(_ref) {
271
271
  name = _ref.name,
272
272
  className = _ref.className,
273
273
  helpPopoverProps = _ref.helpPopoverProps,
274
- required = _ref.required;
274
+ required = _ref.required,
275
+ _ref$isDisabled = _ref.isDisabled,
276
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
275
277
  var _useConfigStore = useConfigStore(function (store) {
276
278
  return {
277
279
  accordionOpenState: store["accordionOpenState"],
@@ -286,10 +288,12 @@ var Card$2 = function Card(_ref) {
286
288
  "data-cy": "theme-".concat(hyphenate(title), "-properties"),
287
289
  className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
288
290
  "pb-2": !accordionOpenState[name],
289
- "pb-3": accordionOpenState[name]
291
+ "pb-3": accordionOpenState[name],
292
+ "opacity-40": isDisabled
290
293
  }),
291
294
  children: [title && /*#__PURE__*/jsxs("button", {
292
295
  className: "neeto-themes-nano-section__title flex w-full cursor-pointer items-center justify-between px-1 py-2 focus:outline-none",
296
+ disabled: isDisabled,
293
297
  type: "button",
294
298
  onClick: function onClick() {
295
299
  return setAccordionOpenState(_objectSpread$4(_objectSpread$4({}, accordionOpenState), {}, _defineProperty({}, name, !accordionOpenState[name])));
@@ -353,7 +357,9 @@ var buildPathname = function buildPathname(route) {
353
357
 
354
358
  var CustomCSS = function CustomCSS(_ref) {
355
359
  var onEditCSSClick = _ref.onEditCSSClick,
356
- currentScreen = _ref.currentScreen;
360
+ currentScreen = _ref.currentScreen,
361
+ isEnabled = _ref.isEnabled,
362
+ isProFeature = _ref.isProFeature;
357
363
  var _useTranslation = useTranslation(),
358
364
  t = _useTranslation.t;
359
365
  var _useFormikContext = useFormikContext(),
@@ -374,7 +380,7 @@ var CustomCSS = function CustomCSS(_ref) {
374
380
  var customCSS = findBy({
375
381
  kind: "custom_css"
376
382
  }, values.properties);
377
- if (!customCSS) return null;
383
+ if (!customCSS || !isEnabled && !isProFeature) return null;
378
384
  var parentElementClass = findBy({
379
385
  kind: "custom_css"
380
386
  }, themePropertiesSchema).parentClass;
@@ -403,10 +409,14 @@ var CustomCSS = function CustomCSS(_ref) {
403
409
  className: "neeto-themes-sidebar__custom-css-wrapper",
404
410
  id: "css-editor",
405
411
  children: /*#__PURE__*/jsx(Card$2, {
406
- helpPopoverProps: customCssHelpPopoverProps,
412
+ isDisabled: !isEnabled,
407
413
  name: "customcss",
414
+ helpPopoverProps: isEnabled ? customCssHelpPopoverProps : {
415
+ title: t("neetoThemes.common.proFeature.title"),
416
+ description: t("neetoThemes.common.proFeature.description")
417
+ },
408
418
  title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
409
- children: /*#__PURE__*/jsxs("div", {
419
+ children: isEnabled && /*#__PURE__*/jsxs("div", {
410
420
  className: "w-full",
411
421
  children: [/*#__PURE__*/jsx("div", {
412
422
  className: "neeto-themes-sidebar__custom-css-editor-header w-full justify-end gap-1 rounded-b-none p-2",
@@ -1305,14 +1315,16 @@ var Customize = function Customize(_ref) {
1305
1315
  entityType: store["entityType"],
1306
1316
  isFetchingSchema: store["isFetchingSchema"],
1307
1317
  helpPopoverProps: store["helpPopoverProps"],
1308
- enabledFeatures: store["enabledFeatures"]
1318
+ enabledFeatures: store["enabledFeatures"],
1319
+ proFeatures: store["proFeatures"]
1309
1320
  };
1310
1321
  }, shallow),
1311
1322
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1312
1323
  entityType = _useConfigStore.entityType,
1313
1324
  isFetchingSchema = _useConfigStore.isFetchingSchema,
1314
1325
  helpPopoverProps = _useConfigStore.helpPopoverProps,
1315
- enabledFeatures = _useConfigStore.enabledFeatures;
1326
+ enabledFeatures = _useConfigStore.enabledFeatures,
1327
+ proFeatures = _useConfigStore.proFeatures;
1316
1328
  var _useParams = useParams(),
1317
1329
  themeId = _useParams.themeId;
1318
1330
  var _useThemeStore = useThemeStore(function (store) {
@@ -1447,9 +1459,11 @@ var Customize = function Customize(_ref) {
1447
1459
  defaultImageSize: propertyDefaultSize || defaultImageSize,
1448
1460
  key: key
1449
1461
  }, "fixedAspectRatio", propertyFixedAspectRatio || fixedAspectRatio));
1450
- }), enabledFeatures.customCSS && /*#__PURE__*/jsx(CustomCSS, {
1462
+ }), /*#__PURE__*/jsx(CustomCSS, {
1451
1463
  currentScreen: currentScreen,
1452
- onEditCSSClick: onEditCSSClick
1464
+ onEditCSSClick: onEditCSSClick,
1465
+ isEnabled: enabledFeatures.customCSS,
1466
+ isProFeature: proFeatures.customCSS
1453
1467
  }), /*#__PURE__*/jsxs("div", {
1454
1468
  className: "neeto-ui-bg-gray-50 neeto-ui-border-gray-200 mt-2 flex flex-col space-y-2 border p-2",
1455
1469
  children: [/*#__PURE__*/jsx(Tooltip, {
@@ -2334,7 +2348,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2334
2348
  _ref$enabledFeatures = _ref.enabledFeatures,
2335
2349
  enabledFeatures = _ref$enabledFeatures === void 0 ? {
2336
2350
  customCSS: true
2337
- } : _ref$enabledFeatures;
2351
+ } : _ref$enabledFeatures,
2352
+ _ref$proFeatures = _ref.proFeatures,
2353
+ proFeatures = _ref$proFeatures === void 0 ? {} : _ref$proFeatures;
2338
2354
  var _useThemeStore = useThemeStore(function (store) {
2339
2355
  return {
2340
2356
  setThemeState: store["setThemeState"]
@@ -2366,7 +2382,8 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2366
2382
  isTemplateThemesEnabled: isTemplateThemesEnabled,
2367
2383
  helpDocUrl: helpDocUrl,
2368
2384
  helpPopoverProps: helpPopoverProps,
2369
- enabledFeatures: enabledFeatures
2385
+ enabledFeatures: enabledFeatures,
2386
+ proFeatures: proFeatures
2370
2387
  });
2371
2388
  }, []);
2372
2389
  useEffect(function () {