nvis-fe-cms-libs 1.1.22 → 1.1.24

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.
@@ -660,11 +660,12 @@ var __async = (__this, __arguments, generator) => {
660
660
  )
661
661
  ] });
662
662
  };
663
- const TimelineSection = ({ data, t, isDarkMode }) => {
663
+ const TimelineSection = ({ data, t, isDarkMode, section }) => {
664
664
  var _a;
665
665
  const timelineData = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data).map((item) => item.data)) || [];
666
666
  const [timelineVisible, setTimelineVisible] = require$$0.useState([]);
667
667
  const timelineRefs = require$$0.useRef([]);
668
+ const sectionTitle = (section == null ? void 0 : section.title) || "...";
668
669
  require$$0.useEffect(() => {
669
670
  setTimelineVisible(new Array(timelineData.length).fill(false));
670
671
  }, [timelineData.length]);
@@ -706,7 +707,7 @@ var __async = (__this, __arguments, generator) => {
706
707
  className: `relative inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 border transition-all duration-300 transform hover:scale-105 shadow-md hover:shadow-lg overflow-hidden ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 text-emerald-300 border-blue-800" : "bg-white text-emerald-800 border-gray-200"}`,
707
708
  children: [
708
709
  "📈 ",
709
- timelineData.title,
710
+ sectionTitle,
710
711
  isDarkMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
711
712
  /* @__PURE__ */ jsxRuntimeExports.jsx(
712
713
  "div",
@@ -1751,7 +1752,7 @@ var __async = (__this, __arguments, generator) => {
1751
1752
  ["path", { d: "M5 12h14", key: "1ays0h" }],
1752
1753
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
1753
1754
  ];
1754
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$B);
1755
+ const ArrowRight$1 = createLucideIcon("arrow-right", __iconNode$B);
1755
1756
  /**
1756
1757
  * @license lucide-react v0.536.0 - ISC
1757
1758
  *
@@ -4687,17 +4688,23 @@ var __async = (__this, __arguments, generator) => {
4687
4688
  ] })
4688
4689
  ] });
4689
4690
  };
4690
- const PageChildrenSelectSection = ({ data, isDarkMode, section, imageBaseUrl = "" }) => {
4691
+ const PageChildrenSelectSection = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
4691
4692
  var _a;
4692
4693
  const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
4693
4694
  const sectionTitle = (section == null ? void 0 : section.title) || "";
4694
4695
  const sectionDescription = (section == null ? void 0 : section.description) || "";
4696
+ const [visibleCount, setVisibleCount] = require$$0.useState(8);
4697
+ const visiblePages = pages.slice(0, visibleCount);
4698
+ const hasMore = visibleCount < pages.length;
4695
4699
  if (!pages || pages.length === 0) {
4696
4700
  return null;
4697
4701
  }
4698
4702
  const handleNavigate = (slug) => {
4699
4703
  window.location.href = slug;
4700
4704
  };
4705
+ const handleLoadMore = () => {
4706
+ setVisibleCount((prev) => prev + 8);
4707
+ };
4701
4708
  const getImageUrl = (url) => {
4702
4709
  if (!url) return "";
4703
4710
  if (url.startsWith("http://") || url.startsWith("https://")) return url;
@@ -4732,8 +4739,9 @@ var __async = (__this, __arguments, generator) => {
4732
4739
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
4733
4740
  display: "grid",
4734
4741
  gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
4735
- gap: "24px"
4736
- }, children: pages.map((page) => {
4742
+ gap: "24px",
4743
+ marginBottom: hasMore ? "40px" : "0"
4744
+ }, children: visiblePages.map((page) => {
4737
4745
  const iconUrl = getImageUrl(page.icon);
4738
4746
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4739
4747
  "div",
@@ -4756,7 +4764,7 @@ var __async = (__this, __arguments, generator) => {
4756
4764
  onMouseEnter: (e) => {
4757
4765
  e.currentTarget.style.transform = "translateY(-8px)";
4758
4766
  e.currentTarget.style.boxShadow = isDarkMode ? "0 20px 25px -5px rgba(0, 0, 0, 0.5)" : "0 20px 25px -5px rgba(0, 0, 0, 0.15)";
4759
- e.currentTarget.style.borderColor = isDarkMode ? "#f97316" : "#f97316";
4767
+ e.currentTarget.style.borderColor = "#1638f9ff";
4760
4768
  },
4761
4769
  onMouseLeave: (e) => {
4762
4770
  e.currentTarget.style.transform = "translateY(0)";
@@ -4793,19 +4801,59 @@ var __async = (__this, __arguments, generator) => {
4793
4801
  },
4794
4802
  page.id
4795
4803
  );
4796
- }) })
4804
+ }) }),
4805
+ hasMore && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
4806
+ "button",
4807
+ {
4808
+ onClick: handleLoadMore,
4809
+ style: {
4810
+ display: "inline-flex",
4811
+ alignItems: "center",
4812
+ justifyContent: "center",
4813
+ gap: "8px",
4814
+ padding: "14px 32px",
4815
+ fontSize: "16px",
4816
+ fontWeight: "600",
4817
+ color: "#fff",
4818
+ backgroundColor: "#f97316",
4819
+ border: "none",
4820
+ borderRadius: "9999px",
4821
+ cursor: "pointer",
4822
+ transition: "all 0.3s",
4823
+ boxShadow: "0 4px 6px -1px rgba(249, 115, 22, 0.3)"
4824
+ },
4825
+ onMouseEnter: (e) => {
4826
+ e.currentTarget.style.backgroundColor = "#ea580c";
4827
+ e.currentTarget.style.transform = "translateY(-2px)";
4828
+ },
4829
+ onMouseLeave: (e) => {
4830
+ e.currentTarget.style.backgroundColor = "#f97316";
4831
+ e.currentTarget.style.transform = "translateY(0)";
4832
+ },
4833
+ children: [
4834
+ t("pageChildrenSelect.moreInsights"),
4835
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { size: 18 })
4836
+ ]
4837
+ }
4838
+ ) })
4797
4839
  ] }) });
4798
4840
  };
4799
- const PageChildrenSelectSection1 = ({ data, isDarkMode, section, imageBaseUrl = "" }) => {
4841
+ const PageChildrenSelectSection1 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
4800
4842
  var _a;
4801
4843
  const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
4802
4844
  const sectionTitle = (section == null ? void 0 : section.title) || "";
4845
+ const [visibleCount, setVisibleCount] = require$$0.useState(5);
4846
+ const visiblePages = pages.slice(0, visibleCount);
4847
+ const hasMore = visibleCount < pages.length;
4803
4848
  if (!pages || pages.length === 0) {
4804
4849
  return null;
4805
4850
  }
4806
4851
  const handleNavigate = (slug) => {
4807
4852
  window.location.href = slug;
4808
4853
  };
4854
+ const handleLoadMore = () => {
4855
+ setVisibleCount((prev) => prev + 5);
4856
+ };
4809
4857
  const getImageUrl = (url) => {
4810
4858
  if (!url) return "";
4811
4859
  if (url.startsWith("http://") || url.startsWith("https://")) return url;
@@ -4831,7 +4879,7 @@ var __async = (__this, __arguments, generator) => {
4831
4879
  display: "flex",
4832
4880
  flexDirection: "column",
4833
4881
  gap: "24px"
4834
- }, children: pages.map((page) => {
4882
+ }, children: visiblePages.map((page) => {
4835
4883
  var _a2, _b;
4836
4884
  const mainImage = ((_b = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b.url) || page.icon;
4837
4885
  const imageUrl = getImageUrl(mainImage);
@@ -4921,226 +4969,44 @@ var __async = (__this, __arguments, generator) => {
4921
4969
  },
4922
4970
  page.id
4923
4971
  );
4924
- }) })
4925
- ] }) });
4926
- };
4927
- const warn = (i18n, code, msg, rest) => {
4928
- var _a, _b, _c, _d;
4929
- const args = [msg, __spreadValues({
4930
- code
4931
- }, rest || {})];
4932
- if ((_b = (_a = i18n == null ? void 0 : i18n.services) == null ? void 0 : _a.logger) == null ? void 0 : _b.forward) {
4933
- return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
4934
- }
4935
- if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
4936
- if ((_d = (_c = i18n == null ? void 0 : i18n.services) == null ? void 0 : _c.logger) == null ? void 0 : _d.warn) {
4937
- i18n.services.logger.warn(...args);
4938
- } else if (console == null ? void 0 : console.warn) {
4939
- console.warn(...args);
4940
- }
4941
- };
4942
- const alreadyWarned = {};
4943
- const warnOnce = (i18n, code, msg, rest) => {
4944
- if (isString(msg) && alreadyWarned[msg]) return;
4945
- if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
4946
- warn(i18n, code, msg, rest);
4947
- };
4948
- const loadedClb = (i18n, cb) => () => {
4949
- if (i18n.isInitialized) {
4950
- cb();
4951
- } else {
4952
- const initialized = () => {
4953
- setTimeout(() => {
4954
- i18n.off("initialized", initialized);
4955
- }, 0);
4956
- cb();
4957
- };
4958
- i18n.on("initialized", initialized);
4959
- }
4960
- };
4961
- const loadNamespaces = (i18n, ns, cb) => {
4962
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
4963
- };
4964
- const loadLanguages = (i18n, lng, ns, cb) => {
4965
- if (isString(ns)) ns = [ns];
4966
- if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
4967
- ns.forEach((n) => {
4968
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
4969
- });
4970
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
4971
- };
4972
- const hasLoadedNamespace = (ns, i18n, options = {}) => {
4973
- if (!i18n.languages || !i18n.languages.length) {
4974
- warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
4975
- languages: i18n.languages
4976
- });
4977
- return true;
4978
- }
4979
- return i18n.hasLoadedNamespace(ns, {
4980
- lng: options.lng,
4981
- precheck: (i18nInstance2, loadNotPending) => {
4982
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
4983
- }
4984
- });
4985
- };
4986
- const isString = (obj) => typeof obj === "string";
4987
- const isObject = (obj) => typeof obj === "object" && obj !== null;
4988
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
4989
- const htmlEntities = {
4990
- "&amp;": "&",
4991
- "&#38;": "&",
4992
- "&lt;": "<",
4993
- "&#60;": "<",
4994
- "&gt;": ">",
4995
- "&#62;": ">",
4996
- "&apos;": "'",
4997
- "&#39;": "'",
4998
- "&quot;": '"',
4999
- "&#34;": '"',
5000
- "&nbsp;": " ",
5001
- "&#160;": " ",
5002
- "&copy;": "©",
5003
- "&#169;": "©",
5004
- "&reg;": "®",
5005
- "&#174;": "®",
5006
- "&hellip;": "…",
5007
- "&#8230;": "…",
5008
- "&#x2F;": "/",
5009
- "&#47;": "/"
5010
- };
5011
- const unescapeHtmlEntity = (m) => htmlEntities[m];
5012
- const unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
5013
- let defaultOptions = {
5014
- bindI18n: "languageChanged",
5015
- bindI18nStore: "",
5016
- transEmptyNodeValue: "",
5017
- transSupportBasicHtmlNodes: true,
5018
- transWrapTextNodes: "",
5019
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
5020
- useSuspense: true,
5021
- unescape
5022
- };
5023
- const getDefaults = () => defaultOptions;
5024
- let i18nInstance;
5025
- const getI18n = () => i18nInstance;
5026
- const I18nContext = require$$0.createContext();
5027
- class ReportNamespaces {
5028
- constructor() {
5029
- this.usedNamespaces = {};
5030
- }
5031
- addUsedNamespaces(namespaces) {
5032
- namespaces.forEach((ns) => {
5033
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
5034
- });
5035
- }
5036
- getUsedNamespaces() {
5037
- return Object.keys(this.usedNamespaces);
5038
- }
5039
- }
5040
- const usePrevious = (value, ignore) => {
5041
- const ref = require$$0.useRef();
5042
- require$$0.useEffect(() => {
5043
- ref.current = value;
5044
- }, [value, ignore]);
5045
- return ref.current;
5046
- };
5047
- const alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
5048
- const useMemoizedT = (i18n, language, namespace, keyPrefix) => require$$0.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
5049
- const useTranslation = (ns, props = {}) => {
5050
- var _a, _b, _c, _d;
5051
- const {
5052
- i18n: i18nFromProps
5053
- } = props;
5054
- const {
5055
- i18n: i18nFromContext,
5056
- defaultNS: defaultNSFromContext
5057
- } = require$$0.useContext(I18nContext) || {};
5058
- const i18n = i18nFromProps || i18nFromContext || getI18n();
5059
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
5060
- if (!i18n) {
5061
- warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
5062
- const notReadyT = (k, optsOrDefaultValue) => {
5063
- if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
5064
- if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
5065
- return Array.isArray(k) ? k[k.length - 1] : k;
5066
- };
5067
- const retNotReady = [notReadyT, {}, false];
5068
- retNotReady.t = notReadyT;
5069
- retNotReady.i18n = {};
5070
- retNotReady.ready = false;
5071
- return retNotReady;
5072
- }
5073
- if ((_a = i18n.options.react) == null ? void 0 : _a.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
5074
- const i18nOptions = __spreadValues(__spreadValues(__spreadValues({}, getDefaults()), i18n.options.react), props);
5075
- const {
5076
- useSuspense,
5077
- keyPrefix
5078
- } = i18nOptions;
5079
- let namespaces = defaultNSFromContext || ((_b = i18n.options) == null ? void 0 : _b.defaultNS);
5080
- namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
5081
- (_d = (_c = i18n.reportNamespaces).addUsedNamespaces) == null ? void 0 : _d.call(_c, namespaces);
5082
- const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
5083
- const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
5084
- const getT = () => memoGetT;
5085
- const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
5086
- const [t, setT] = require$$0.useState(getT);
5087
- let joinedNS = namespaces.join();
5088
- if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
5089
- const previousJoinedNS = usePrevious(joinedNS);
5090
- const isMounted = require$$0.useRef(true);
5091
- require$$0.useEffect(() => {
5092
- const {
5093
- bindI18n,
5094
- bindI18nStore
5095
- } = i18nOptions;
5096
- isMounted.current = true;
5097
- if (!ready && !useSuspense) {
5098
- if (props.lng) {
5099
- loadLanguages(i18n, props.lng, namespaces, () => {
5100
- if (isMounted.current) setT(getNewT);
5101
- });
5102
- } else {
5103
- loadNamespaces(i18n, namespaces, () => {
5104
- if (isMounted.current) setT(getNewT);
5105
- });
4972
+ }) }),
4973
+ hasMore && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", justifyContent: "center", marginTop: "40px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
4974
+ "button",
4975
+ {
4976
+ onClick: handleLoadMore,
4977
+ style: {
4978
+ display: "inline-flex",
4979
+ alignItems: "center",
4980
+ gap: "8px",
4981
+ padding: "12px 28px",
4982
+ fontSize: "16px",
4983
+ fontWeight: "600",
4984
+ color: "#fff",
4985
+ backgroundColor: "#2563eb",
4986
+ border: "none",
4987
+ borderRadius: "9999px",
4988
+ cursor: "pointer",
4989
+ transition: "all 0.3s",
4990
+ boxShadow: "0 4px 6px -1px rgba(37, 99, 235, 0.3)"
4991
+ },
4992
+ onMouseEnter: (e) => {
4993
+ e.currentTarget.style.backgroundColor = "#1d4ed8";
4994
+ e.currentTarget.style.transform = "translateY(-2px)";
4995
+ },
4996
+ onMouseLeave: (e) => {
4997
+ e.currentTarget.style.backgroundColor = "#2563eb";
4998
+ e.currentTarget.style.transform = "translateY(0)";
4999
+ },
5000
+ children: [
5001
+ t("pageChildrenSelect.moreInsights"),
5002
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { size: 18 })
5003
+ ]
5106
5004
  }
5107
- }
5108
- if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
5109
- setT(getNewT);
5110
- }
5111
- const boundReset = () => {
5112
- if (isMounted.current) setT(getNewT);
5113
- };
5114
- if (bindI18n) i18n == null ? void 0 : i18n.on(bindI18n, boundReset);
5115
- if (bindI18nStore) i18n == null ? void 0 : i18n.store.on(bindI18nStore, boundReset);
5116
- return () => {
5117
- isMounted.current = false;
5118
- if (i18n && bindI18n) bindI18n == null ? void 0 : bindI18n.split(" ").forEach((e) => i18n.off(e, boundReset));
5119
- if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e) => i18n.store.off(e, boundReset));
5120
- };
5121
- }, [i18n, joinedNS]);
5122
- require$$0.useEffect(() => {
5123
- if (isMounted.current && ready) {
5124
- setT(getT);
5125
- }
5126
- }, [i18n, keyPrefix, ready]);
5127
- const ret = [t, i18n, ready];
5128
- ret.t = t;
5129
- ret.i18n = i18n;
5130
- ret.ready = ready;
5131
- if (ready) return ret;
5132
- if (!ready && !useSuspense) return ret;
5133
- throw new Promise((resolve) => {
5134
- if (props.lng) {
5135
- loadLanguages(i18n, props.lng, namespaces, () => resolve());
5136
- } else {
5137
- loadNamespaces(i18n, namespaces, () => resolve());
5138
- }
5139
- });
5005
+ ) })
5006
+ ] }) });
5140
5007
  };
5141
- const PageChildrenSelectSection2 = ({ data, isDarkMode, section, imageBaseUrl = "" }) => {
5008
+ const PageChildrenSelectSection2 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
5142
5009
  var _a;
5143
- const { t } = useTranslation();
5144
5010
  const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
5145
5011
  const sectionTitle = (section == null ? void 0 : section.title) || "";
5146
5012
  const [visibleCount, setVisibleCount] = require$$0.useState(6);
@@ -5290,7 +5156,7 @@ var __async = (__this, __arguments, generator) => {
5290
5156
  },
5291
5157
  children: [
5292
5158
  t("pageChildrenSelect.moreInsights"),
5293
- /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { size: 18 })
5159
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight$1, { size: 18 })
5294
5160
  ]
5295
5161
  }
5296
5162
  ) })