@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.
@@ -1,13 +1,13 @@
1
1
  import { shallow } from 'zustand/shallow';
2
2
  import { Suspense, lazy, useEffect, createElement, useState, useRef, memo, useCallback } from 'react';
3
- import { hyphenate, findBy, findIndexBy, isPresent, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
4
- import { useMutationWithInvalidation, withT, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
3
+ import { hyphenate, isPresent, findBy, findIndexBy, isNot, filterBy, snakeToCamelCase, isNotPresent, toLabelAndValue, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
4
+ import { useMutationWithInvalidation, useBreakpoints, PageTitle } from '@bigbinary/neeto-commons-frontend/react-utils';
5
5
  import Spinner from '@bigbinary/neetoui/Spinner';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
7
  import { B as BASE_URL, b as scrollElementIntoView, c as setCustomCSS, g as getDominantColorFromUrl, i as isEditThemeRoute, d as isFunction, e as isNewThemeRoute } from './index-Bxlleq-V.js';
8
8
  import { useQuery, useQueryClient } from '@tanstack/react-query';
9
9
  import axios from 'axios';
10
- import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils, P as POSITION_OPTIONS, O as OVERLAY_OPACITY_SLIDER_MARKS, H as HUNDRED, F as FONT_OPTIONS, T as THEME_VALIDATION_SCHEMA } from './useThemeUtils-DdkCd9iz.js';
10
+ import { Q as QUERY_KEYS, a as useConfigStore, b as useThemeStore, u as useThemeUtils, P as POSITION_OPTIONS, O as OVERLAY_OPACITY_SLIDER_MARKS, H as HUNDRED, F as FONT_OPTIONS, T as THEME_VALIDATION_SCHEMA } from './useThemeUtils-Do1vR9LD.js';
11
11
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
12
12
  import classnames from 'classnames';
13
13
  import { joinHyphenCase, buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
@@ -28,14 +28,14 @@ import BlockNavigation from '@bigbinary/neetoui/formik/BlockNavigation';
28
28
  import { isEmpty, negate, isNotNil } from 'ramda';
29
29
  import { useFormikContext, Field } from 'formik';
30
30
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
31
- import Down from '@bigbinary/neeto-icons/Down';
31
+ import Right from '@bigbinary/neeto-icons/Right';
32
+ import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
32
33
  import { t as t$1 } from 'i18next';
33
34
  import CenterAlign from '@bigbinary/neeto-icons/CenterAlign';
34
35
  import LeftAlign from '@bigbinary/neeto-icons/LeftAlign';
35
36
  import ColorPicker from '@bigbinary/neetoui/ColorPicker';
36
37
  import Select from '@bigbinary/neetoui/Select';
37
38
  import { Slider } from 'antd';
38
- import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
39
39
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
40
40
  import _regeneratorRuntime from '@babel/runtime/regenerator';
41
41
  import ImageUploader from '@bigbinary/neeto-image-uploader-frontend/ImageUploader';
@@ -265,7 +265,8 @@ var Card$2 = function Card(_ref) {
265
265
  title = _ref$title === void 0 ? "" : _ref$title,
266
266
  children = _ref.children,
267
267
  name = _ref.name,
268
- className = _ref.className;
268
+ className = _ref.className,
269
+ helpPopoverProps = _ref.helpPopoverProps;
269
270
  var _useConfigStore = useConfigStore(function (store) {
270
271
  return {
271
272
  accordionOpenState: store["accordionOpenState"],
@@ -286,18 +287,18 @@ var Card$2 = function Card(_ref) {
286
287
  onClick: function onClick() {
287
288
  return setAccordionOpenState(_objectSpread$4(_objectSpread$4({}, accordionOpenState), {}, _defineProperty({}, name, !accordionOpenState[name])));
288
289
  },
289
- children: [/*#__PURE__*/jsx(Typography, {
290
- className: "min-w-0 flex-grow text-left",
290
+ children: [/*#__PURE__*/jsxs(Typography, {
291
+ className: "flex min-w-0 flex-grow items-center gap-2 text-left",
291
292
  component: "span",
292
293
  "data-cy": "theme-properties",
293
294
  lineHeight: "normal",
294
295
  style: "h4",
295
296
  weight: "semibold",
296
- children: title
297
- }), /*#__PURE__*/jsx(Down, {
297
+ children: [title, isPresent(helpPopoverProps) && /*#__PURE__*/jsx(HelpPopover, _objectSpread$4({}, helpPopoverProps))]
298
+ }), /*#__PURE__*/jsx(Right, {
298
299
  size: 20,
299
300
  className: classnames("transition-all duration-300", {
300
- "rotate-180": accordionOpenState[name]
301
+ "rotate-90": accordionOpenState[name]
301
302
  })
302
303
  })]
303
304
  }), children && /*#__PURE__*/jsx("div", {
@@ -350,11 +351,15 @@ var CustomCSS = function CustomCSS(_ref) {
350
351
  var _useConfigStore = useConfigStore(function (store) {
351
352
  return {
352
353
  themePropertiesSchema: store["themePropertiesSchema"],
353
- accordionOpenState: store["accordionOpenState"]
354
+ accordionOpenState: store["accordionOpenState"],
355
+ helpPopoverProps: store["helpPopoverProps"]
354
356
  };
355
357
  }, shallow),
356
358
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
357
- accordionOpenState = _useConfigStore.accordionOpenState;
359
+ accordionOpenState = _useConfigStore.accordionOpenState,
360
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
361
+ var _helpPopoverProps$cus = helpPopoverProps.customCss,
362
+ customCssHelpPopoverProps = _helpPopoverProps$cus === void 0 ? {} : _helpPopoverProps$cus;
358
363
  var customCSS = findBy({
359
364
  kind: "custom_css"
360
365
  }, values.properties);
@@ -387,6 +392,7 @@ var CustomCSS = function CustomCSS(_ref) {
387
392
  className: "neeto-themes-sidebar__custom-css-wrapper",
388
393
  id: "css-editor",
389
394
  children: /*#__PURE__*/jsx(Card$2, {
395
+ helpPopoverProps: customCssHelpPopoverProps,
390
396
  name: "customcss",
391
397
  title: isCustomCssScreen ? "" : t("neetoThemes.build.leftSideBar.themes.customCSS"),
392
398
  children: /*#__PURE__*/jsxs("div", {
@@ -1076,12 +1082,19 @@ var Images = function Images(_ref) {
1076
1082
  useDefaultImageSize = _ref.useDefaultImageSize;
1077
1083
  var _useFormikContext = useFormikContext(),
1078
1084
  values = _useFormikContext.values;
1085
+ var _useConfigStore = useConfigStore(function (store) {
1086
+ return {
1087
+ helpPopoverProps: store["helpPopoverProps"]
1088
+ };
1089
+ }, shallow),
1090
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1079
1091
  var key = snakeToCamelCase(attribute);
1080
1092
  var title = buildLabel(key, "image");
1081
1093
  var imageData = values[key];
1082
1094
  return /*#__PURE__*/jsxs(Card$2, {
1083
1095
  className: className,
1084
1096
  title: title,
1097
+ helpPopoverProps: helpPopoverProps[key],
1085
1098
  name: key,
1086
1099
  children: [/*#__PURE__*/jsx(ImageBlock, {
1087
1100
  attribute: attribute,
@@ -1096,11 +1109,21 @@ var Images = function Images(_ref) {
1096
1109
  });
1097
1110
  };
1098
1111
 
1099
- var ThemeMeta = withT(function (_ref) {
1100
- var t = _ref.t,
1101
- className = _ref.className;
1112
+ var ThemeMeta = function ThemeMeta(_ref) {
1113
+ var className = _ref.className;
1114
+ var _useTranslation = useTranslation(),
1115
+ t = _useTranslation.t;
1116
+ var _useConfigStore = useConfigStore(function (store) {
1117
+ return {
1118
+ helpPopoverProps: store["helpPopoverProps"]
1119
+ };
1120
+ }, shallow),
1121
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1122
+ var _helpPopoverProps$nam = helpPopoverProps.name,
1123
+ nameHelpPopoverProps = _helpPopoverProps$nam === void 0 ? {} : _helpPopoverProps$nam;
1102
1124
  return /*#__PURE__*/jsx(Card$2, {
1103
1125
  className: className,
1126
+ helpPopoverProps: nameHelpPopoverProps,
1104
1127
  name: "name",
1105
1128
  title: t("neetoThemes.common.name"),
1106
1129
  children: /*#__PURE__*/jsx(Input, {
@@ -1109,7 +1132,7 @@ var ThemeMeta = withT(function (_ref) {
1109
1132
  name: "name"
1110
1133
  })
1111
1134
  });
1112
- });
1135
+ };
1113
1136
 
1114
1137
  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; }
1115
1138
  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; }
@@ -1134,12 +1157,14 @@ var Customize = function Customize(_ref) {
1134
1157
  return {
1135
1158
  themePropertiesSchema: store["themePropertiesSchema"],
1136
1159
  entityType: store["entityType"],
1137
- isFetchingSchema: store["isFetchingSchema"]
1160
+ isFetchingSchema: store["isFetchingSchema"],
1161
+ helpPopoverProps: store["helpPopoverProps"]
1138
1162
  };
1139
1163
  }, shallow),
1140
1164
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1141
1165
  entityType = _useConfigStore.entityType,
1142
- isFetchingSchema = _useConfigStore.isFetchingSchema;
1166
+ isFetchingSchema = _useConfigStore.isFetchingSchema,
1167
+ helpPopoverProps = _useConfigStore.helpPopoverProps;
1143
1168
  var _useParams = useParams(),
1144
1169
  themeId = _useParams.themeId;
1145
1170
  var _useThemeStore = useThemeStore(function (store) {
@@ -1165,6 +1190,8 @@ var Customize = function Customize(_ref) {
1165
1190
  var isLoading = isFetchingSchema || isLoadingTheme;
1166
1191
  var isThemeGlobalTheme = themeId && (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id) === themeId;
1167
1192
  var isCurrentThemeAndGlobalThemeSame = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === (globalTheme === null || globalTheme === void 0 ? void 0 : globalTheme.id);
1193
+ var _helpPopoverProps$sty = helpPopoverProps.style,
1194
+ styleHelpPopoverProps = _helpPopoverProps$sty === void 0 ? {} : _helpPopoverProps$sty;
1168
1195
  var isEditingCurrentlyAppliedTheme = themeId === (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id);
1169
1196
  var submitBtnRef = useRef(null);
1170
1197
  var _useCreateTheme = useCreateTheme(),
@@ -1247,6 +1274,7 @@ var Customize = function Customize(_ref) {
1247
1274
  className: classnames({
1248
1275
  hidden: isCustomCssScreen
1249
1276
  }),
1277
+ helpPopoverProps: styleHelpPopoverProps,
1250
1278
  name: "style",
1251
1279
  title: t("neetoThemes.common.style"),
1252
1280
  children: /*#__PURE__*/jsx(Properties, {
@@ -2142,7 +2170,9 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2142
2170
  _ref$onUpdateThemeSuc = _ref.onUpdateThemeSuccess,
2143
2171
  onUpdateThemeSuccess = _ref$onUpdateThemeSuc === void 0 ? noop : _ref$onUpdateThemeSuc,
2144
2172
  _ref$onApplyGlobalThe = _ref.onApplyGlobalThemeSuccess,
2145
- onApplyGlobalThemeSuccess = _ref$onApplyGlobalThe === void 0 ? noop : _ref$onApplyGlobalThe;
2173
+ onApplyGlobalThemeSuccess = _ref$onApplyGlobalThe === void 0 ? noop : _ref$onApplyGlobalThe,
2174
+ _ref$helpPopoverProps = _ref.helpPopoverProps,
2175
+ helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps;
2146
2176
  var _useThemeStore = useThemeStore(function (store) {
2147
2177
  return {
2148
2178
  setThemeState: store["setThemeState"]
@@ -2172,7 +2202,8 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
2172
2202
  entityType: entityType,
2173
2203
  entityId: entityId,
2174
2204
  isTemplateThemesEnabled: isTemplateThemesEnabled,
2175
- helpDocUrl: helpDocUrl
2205
+ helpDocUrl: helpDocUrl,
2206
+ helpPopoverProps: helpPopoverProps
2176
2207
  });
2177
2208
  }, []);
2178
2209
  useEffect(function () {