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