@bigbinary/neeto-themes-frontend 3.1.13 → 3.1.14

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.
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
9
9
  var utils = require('../index-D6OhrVJO.js');
10
10
  var reactQuery = require('@tanstack/react-query');
11
11
  var axios = require('axios');
12
- var useThemeUtils = require('../useThemeUtils-CL0WCj1m.js');
12
+ var useThemeUtils = require('../useThemeUtils-Dx-g0zNJ.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');
@@ -30,14 +30,14 @@ var BlockNavigation = require('@bigbinary/neetoui/formik/BlockNavigation');
30
30
  var ramda = require('ramda');
31
31
  var formik = require('formik');
32
32
  var jsxRuntime = require('react/jsx-runtime');
33
- var Down = require('@bigbinary/neeto-icons/Down');
33
+ var Right = require('@bigbinary/neeto-icons/Right');
34
+ var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
34
35
  var i18next = require('i18next');
35
36
  var CenterAlign = require('@bigbinary/neeto-icons/CenterAlign');
36
37
  var LeftAlign = require('@bigbinary/neeto-icons/LeftAlign');
37
38
  var ColorPicker = require('@bigbinary/neetoui/ColorPicker');
38
39
  var Select = require('@bigbinary/neetoui/Select');
39
40
  var antd = require('antd');
40
- var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
41
41
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
42
42
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
43
43
  var ImageUploader = require('@bigbinary/neeto-image-uploader-frontend/ImageUploader');
@@ -267,7 +267,8 @@ var Card$2 = function Card(_ref) {
267
267
  title = _ref$title === void 0 ? "" : _ref$title,
268
268
  children = _ref.children,
269
269
  name = _ref.name,
270
- className = _ref.className;
270
+ className = _ref.className,
271
+ helpPopoverProps = _ref.helpPopoverProps;
271
272
  var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
272
273
  return {
273
274
  accordionOpenState: store["accordionOpenState"],
@@ -288,18 +289,18 @@ var Card$2 = function Card(_ref) {
288
289
  onClick: function onClick() {
289
290
  return setAccordionOpenState(_objectSpread$4(_objectSpread$4({}, accordionOpenState), {}, _defineProperty({}, name, !accordionOpenState[name])));
290
291
  },
291
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
292
- className: "min-w-0 flex-grow text-left",
292
+ children: [/*#__PURE__*/jsxRuntime.jsxs(Typography, {
293
+ className: "flex min-w-0 flex-grow items-center gap-2 text-left",
293
294
  component: "span",
294
295
  "data-cy": "theme-properties",
295
296
  lineHeight: "normal",
296
297
  style: "h4",
297
298
  weight: "semibold",
298
- children: title
299
- }), /*#__PURE__*/jsxRuntime.jsx(Down, {
299
+ children: [title, neetoCist.isPresent(helpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread$4({}, helpPopoverProps))]
300
+ }), /*#__PURE__*/jsxRuntime.jsx(Right, {
300
301
  size: 20,
301
302
  className: classnames("transition-all duration-300", {
302
- "rotate-180": accordionOpenState[name]
303
+ "rotate-90": accordionOpenState[name]
303
304
  })
304
305
  })]
305
306
  }), children && /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -352,11 +353,15 @@ var CustomCSS = function CustomCSS(_ref) {
352
353
  var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
353
354
  return {
354
355
  themePropertiesSchema: store["themePropertiesSchema"],
355
- accordionOpenState: store["accordionOpenState"]
356
+ accordionOpenState: store["accordionOpenState"],
357
+ helpPopoverProps: store["helpPopoverProps"]
356
358
  };
357
359
  }, shallow.shallow),
358
360
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
359
- accordionOpenState = _useConfigStore.accordionOpenState;
361
+ accordionOpenState = _useConfigStore.accordionOpenState,
362
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
363
+ var _helpPopoverProps$cus = helpPopoverProps.customCss,
364
+ customCssHelpPopoverProps = _helpPopoverProps$cus === void 0 ? {} : _helpPopoverProps$cus;
360
365
  var customCSS = neetoCist.findBy({
361
366
  kind: "custom_css"
362
367
  }, values.properties);
@@ -389,6 +394,7 @@ var CustomCSS = function CustomCSS(_ref) {
389
394
  className: "neeto-themes-sidebar__custom-css-wrapper",
390
395
  id: "css-editor",
391
396
  children: /*#__PURE__*/jsxRuntime.jsx(Card$2, {
397
+ helpPopoverProps: customCssHelpPopoverProps,
392
398
  name: "customcss",
393
399
  title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
394
400
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -1078,12 +1084,19 @@ var Images = function Images(_ref) {
1078
1084
  useDefaultImageSize = _ref.useDefaultImageSize;
1079
1085
  var _useFormikContext = formik.useFormikContext(),
1080
1086
  values = _useFormikContext.values;
1087
+ var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
1088
+ return {
1089
+ helpPopoverProps: store["helpPopoverProps"]
1090
+ };
1091
+ }, shallow.shallow),
1092
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1081
1093
  var key = neetoCist.snakeToCamelCase(attribute);
1082
1094
  var title = buildLabel(key, "image");
1083
1095
  var imageData = values[key];
1084
1096
  return /*#__PURE__*/jsxRuntime.jsxs(Card$2, {
1085
1097
  className: className,
1086
1098
  title: title,
1099
+ helpPopoverProps: helpPopoverProps[key],
1087
1100
  name: key,
1088
1101
  children: [/*#__PURE__*/jsxRuntime.jsx(ImageBlock, {
1089
1102
  attribute: attribute,
@@ -1098,11 +1111,21 @@ var Images = function Images(_ref) {
1098
1111
  });
1099
1112
  };
1100
1113
 
1101
- var ThemeMeta = reactUtils.withT(function (_ref) {
1102
- var t = _ref.t,
1103
- className = _ref.className;
1114
+ var ThemeMeta = function ThemeMeta(_ref) {
1115
+ var className = _ref.className;
1116
+ var _useTranslation = reactI18next.useTranslation(),
1117
+ t = _useTranslation.t;
1118
+ var _useConfigStore = useThemeUtils.useConfigStore(function (store) {
1119
+ return {
1120
+ helpPopoverProps: store["helpPopoverProps"]
1121
+ };
1122
+ }, shallow.shallow),
1123
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1124
+ var _helpPopoverProps$nam = helpPopoverProps.name,
1125
+ nameHelpPopoverProps = _helpPopoverProps$nam === void 0 ? {} : _helpPopoverProps$nam;
1104
1126
  return /*#__PURE__*/jsxRuntime.jsx(Card$2, {
1105
1127
  className: className,
1128
+ helpPopoverProps: nameHelpPopoverProps,
1106
1129
  name: "name",
1107
1130
  title: t("neetoThemes.common.name"),
1108
1131
  children: /*#__PURE__*/jsxRuntime.jsx(Input, {
@@ -1111,7 +1134,7 @@ var ThemeMeta = reactUtils.withT(function (_ref) {
1111
1134
  name: "name"
1112
1135
  })
1113
1136
  });
1114
- });
1137
+ };
1115
1138
 
1116
1139
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1117
1140
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -1136,12 +1159,14 @@ var Customize = function Customize(_ref) {
1136
1159
  return {
1137
1160
  themePropertiesSchema: store["themePropertiesSchema"],
1138
1161
  entityType: store["entityType"],
1139
- isFetchingSchema: store["isFetchingSchema"]
1162
+ isFetchingSchema: store["isFetchingSchema"],
1163
+ helpPopoverProps: store["helpPopoverProps"]
1140
1164
  };
1141
1165
  }, shallow.shallow),
1142
1166
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1143
1167
  entityType = _useConfigStore.entityType,
1144
- isFetchingSchema = _useConfigStore.isFetchingSchema;
1168
+ isFetchingSchema = _useConfigStore.isFetchingSchema,
1169
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1145
1170
  var _useParams = reactRouterDom.useParams(),
1146
1171
  themeId = _useParams.themeId;
1147
1172
  var _useThemeStore = useThemeUtils.useThemeStore(function (store) {
@@ -1167,6 +1192,8 @@ var Customize = function Customize(_ref) {
1167
1192
  var isLoading = isFetchingSchema || isLoadingTheme;
1168
1193
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1169
1194
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
1195
+ var _helpPopoverProps$sty = helpPopoverProps.style,
1196
+ styleHelpPopoverProps = _helpPopoverProps$sty === void 0 ? {} : _helpPopoverProps$sty;
1170
1197
  var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
1171
1198
  var submitBtnRef = react.useRef(null);
1172
1199
  var _useCreateTheme = useCreateTheme(),
@@ -1249,6 +1276,7 @@ var Customize = function Customize(_ref) {
1249
1276
  className: classnames({
1250
1277
  hidden: isCustomCssScreen
1251
1278
  }),
1279
+ helpPopoverProps: styleHelpPopoverProps,
1252
1280
  name: "style",
1253
1281
  title: t("neetoThemes.common.style"),
1254
1282
  children: /*#__PURE__*/jsxRuntime.jsx(Properties, {
@@ -2144,7 +2172,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2144
2172
  _ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
2145
2173
  onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? neetoCist.noop : _ref$onUpdateThemeSuc,
2146
2174
  _ref$onApplyGlobalThe = _ref.onApplyGlobalThemeSuccess,
2147
- onApplyGlobalThemeSuccess = _ref$onApplyGlobalThe === void 0 ? neetoCist.noop : _ref$onApplyGlobalThe;
2175
+ onApplyGlobalThemeSuccess = _ref$onApplyGlobalThe === void 0 ? neetoCist.noop : _ref$onApplyGlobalThe,
2176
+ _ref$helpPopoverProps = _ref.helpPopoverProps,
2177
+ helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps;
2148
2178
  var _useThemeStore = useThemeUtils.useThemeStore(function (store) {
2149
2179
  return {
2150
2180
  setThemeState: store["setThemeState"]
@@ -2174,7 +2204,8 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2174
2204
  entityType: entityType,
2175
2205
  entityId: entityId,
2176
2206
  isTemplateThemesEnabled: isTemplateThemesEnabled,
2177
- helpDocUrl: helpDocUrl
2207
+ helpDocUrl: helpDocUrl,
2208
+ helpPopoverProps: helpPopoverProps
2178
2209
  });
2179
2210
  }, []);
2180
2211
  react.useEffect(function () {