@enyxs/wikex-components 0.11.1 → 0.11.2

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.
package/dist/index.mjs CHANGED
@@ -3979,6 +3979,11 @@ function useCmsImage(field, fallback) {
3979
3979
  const value4 = context?.content[field];
3980
3980
  return typeof value4 === "string" && value4.trim() ? value4 : fallback;
3981
3981
  }
3982
+ function useCmsLink(field, fallback) {
3983
+ const context = useContext3(getCmsImageContext());
3984
+ const value4 = context?.content[field];
3985
+ return typeof value4 === "string" && value4.trim() ? value4.trim() : fallback;
3986
+ }
3982
3987
  function useCmsImageResolver() {
3983
3988
  const context = useContext3(getCmsImageContext());
3984
3989
  return (field, fallback) => {
@@ -10304,27 +10309,32 @@ var socialIcons = [
10304
10309
  {
10305
10310
  src: "/landing-assets/footer-social-zalo.svg",
10306
10311
  label: "Zalo",
10307
- link: "https://zalo.me/2938904491037143914"
10312
+ field: "footerZaloUrl",
10313
+ fallback: "https://zalo.me/2938904491037143914"
10308
10314
  },
10309
10315
  {
10310
10316
  src: "/landing-assets/footer-social-tiktok-color.svg",
10311
10317
  label: "TikTok",
10312
- link: "https://www.tiktok.com/@wikexcommodity"
10318
+ field: "footerTiktokUrl",
10319
+ fallback: "https://www.tiktok.com/@wikexcommodity"
10313
10320
  },
10314
10321
  {
10315
10322
  src: "/landing-assets/footer-social-youtube-color.svg",
10316
10323
  label: "YouTube",
10317
- link: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10324
+ field: "footerYoutubeUrl",
10325
+ fallback: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10318
10326
  },
10319
10327
  {
10320
10328
  src: "/landing-assets/footer-social-facebook-color.svg",
10321
10329
  label: "Facebook",
10322
- link: "https://www.facebook.com/profile.php?id=61594044182329"
10330
+ field: "footerFacebookUrl",
10331
+ fallback: "https://www.facebook.com/profile.php?id=61594044182329"
10323
10332
  },
10324
10333
  {
10325
10334
  src: "/landing-assets/footer-social-instagram.svg",
10326
10335
  label: "Instagram",
10327
- link: "https://www.instagram.com/wikexcommodities/"
10336
+ field: "footerInstagramUrl",
10337
+ fallback: "https://www.instagram.com/wikexcommodities/"
10328
10338
  }
10329
10339
  ];
10330
10340
  function StoreDownloadBadge({ store }) {
@@ -10386,6 +10396,47 @@ function LandingFooter() {
10386
10396
  "/Logo/logo_original_dark.png"
10387
10397
  );
10388
10398
  const mxvLogo = useCmsImage("footerMxvLogoImage", "/Logo/Logo_mxv.png");
10399
+ const phoneUrl = useCmsLink("footerPhoneUrl", "tel:0938427079");
10400
+ const emailUrl = useCmsLink("footerEmailUrl", "mailto:admin@wikex.vn");
10401
+ const introductionUrl = useCmsLink(
10402
+ "footerIntroductionUrl",
10403
+ "/about-us/"
10404
+ );
10405
+ const metalUrl = useCmsLink("footerMetalUrl", "/products/");
10406
+ const agricultureUrl = useCmsLink(
10407
+ "footerAgricultureUrl",
10408
+ "/products/"
10409
+ );
10410
+ const industrialUrl = useCmsLink("footerIndustrialUrl", "/products/");
10411
+ const investmentKnowledgeUrl = useCmsLink(
10412
+ "footerInvestmentKnowledgeUrl",
10413
+ "/thong-tin-wikex/"
10414
+ );
10415
+ const complaintsUrl = useCmsLink("footerComplaintsUrl", "/khieu-nai/");
10416
+ const privacyUrl = useCmsLink("footerPrivacyUrl", "/chinh-sach/");
10417
+ const feesUrl = useCmsLink("footerFeesUrl", "/bang-phi-ky-quy/");
10418
+ const socialUrls = {
10419
+ footerZaloUrl: useCmsLink(
10420
+ "footerZaloUrl",
10421
+ "https://zalo.me/2938904491037143914"
10422
+ ),
10423
+ footerTiktokUrl: useCmsLink(
10424
+ "footerTiktokUrl",
10425
+ "https://www.tiktok.com/@wikexcommodity"
10426
+ ),
10427
+ footerYoutubeUrl: useCmsLink(
10428
+ "footerYoutubeUrl",
10429
+ "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10430
+ ),
10431
+ footerFacebookUrl: useCmsLink(
10432
+ "footerFacebookUrl",
10433
+ "https://www.facebook.com/profile.php?id=61594044182329"
10434
+ ),
10435
+ footerInstagramUrl: useCmsLink(
10436
+ "footerInstagramUrl",
10437
+ "https://www.instagram.com/wikexcommodities/"
10438
+ )
10439
+ };
10389
10440
  return /* @__PURE__ */ jsx28("footer", { className: "footer", children: /* @__PURE__ */ jsxs24("div", { className: "container footer-content", children: [
10390
10441
  /* @__PURE__ */ jsxs24("div", { className: "footer-grid", children: [
10391
10442
  /* @__PURE__ */ jsxs24("div", { className: "footer-brand", children: [
@@ -10422,8 +10473,8 @@ function LandingFooter() {
10422
10473
  ] }),
10423
10474
  /* @__PURE__ */ jsxs24("div", { className: "footer-contact-list", children: [
10424
10475
  /* @__PURE__ */ jsx28(ContactRow, { icon: "/landing-assets/footer-map-pin.svg", children: t("landing.footer.address") }),
10425
- /* @__PURE__ */ jsx28(ContactRow, { icon: "/landing-assets/footer-mobile.svg", children: /* @__PURE__ */ jsx28("a", { href: "tel:0938427079", children: t("landing.footer.phone") }) }),
10426
- /* @__PURE__ */ jsx28(ContactRow, { icon: "/landing-assets/footer-email.svg", children: /* @__PURE__ */ jsx28("a", { href: "mailto:admin@wikex.vn", children: t("landing.footer.email") }) })
10476
+ /* @__PURE__ */ jsx28(ContactRow, { icon: "/landing-assets/footer-mobile.svg", children: /* @__PURE__ */ jsx28("a", { href: phoneUrl, children: t("landing.footer.phone") }) }),
10477
+ /* @__PURE__ */ jsx28(ContactRow, { icon: "/landing-assets/footer-email.svg", children: /* @__PURE__ */ jsx28("a", { href: emailUrl, children: t("landing.footer.email") }) })
10427
10478
  ] })
10428
10479
  ] }),
10429
10480
  /* @__PURE__ */ jsx28(
@@ -10434,7 +10485,7 @@ function LandingFooter() {
10434
10485
  children: socialIcons.map((social) => /* @__PURE__ */ jsxs24(
10435
10486
  Link8,
10436
10487
  {
10437
- href: social.link,
10488
+ href: socialUrls[social.field] ?? social.fallback,
10438
10489
  className: "footer-social-button",
10439
10490
  title: social.label,
10440
10491
  target: "_blank",
@@ -10468,7 +10519,7 @@ function LandingFooter() {
10468
10519
  "aria-label": t("landing.footer.aboutWikex"),
10469
10520
  children: [
10470
10521
  /* @__PURE__ */ jsx28("strong", { children: t("landing.footer.aboutWikex") }),
10471
- /* @__PURE__ */ jsx28(Link8, { href: "/about-us/", children: t("landing.footer.introduction") }),
10522
+ /* @__PURE__ */ jsx28(Link8, { href: introductionUrl, children: t("landing.footer.introduction") }),
10472
10523
  /* @__PURE__ */ jsx28("button", { type: "button", disabled: true, children: t("landing.footer.careers") }),
10473
10524
  /* @__PURE__ */ jsx28("button", { type: "button", disabled: true, children: t("landing.footer.contact") })
10474
10525
  ]
@@ -10481,9 +10532,9 @@ function LandingFooter() {
10481
10532
  "aria-label": t("landing.footer.product"),
10482
10533
  children: [
10483
10534
  /* @__PURE__ */ jsx28("strong", { children: t("landing.footer.product") }),
10484
- /* @__PURE__ */ jsx28(Link8, { href: "/products/", children: t("landing.footer.metal") }),
10485
- /* @__PURE__ */ jsx28(Link8, { href: "/products/", children: t("landing.footer.agriculture") }),
10486
- /* @__PURE__ */ jsx28(Link8, { href: "/products/", children: t("landing.footer.industrial") })
10535
+ /* @__PURE__ */ jsx28(Link8, { href: metalUrl, children: t("landing.footer.metal") }),
10536
+ /* @__PURE__ */ jsx28(Link8, { href: agricultureUrl, children: t("landing.footer.agriculture") }),
10537
+ /* @__PURE__ */ jsx28(Link8, { href: industrialUrl, children: t("landing.footer.industrial") })
10487
10538
  ]
10488
10539
  }
10489
10540
  ),
@@ -10496,7 +10547,7 @@ function LandingFooter() {
10496
10547
  /* @__PURE__ */ jsx28("strong", { children: t("landing.footer.guide") }),
10497
10548
  /* @__PURE__ */ jsx28("button", { type: "button", disabled: true, children: t("landing.footer.investmentGuide") }),
10498
10549
  /* @__PURE__ */ jsx28("button", { type: "button", disabled: true, children: t("landing.footer.training") }),
10499
- /* @__PURE__ */ jsx28(Link8, { href: "/thong-tin-wikex/", children: t("landing.footer.investmentKnowledge") })
10550
+ /* @__PURE__ */ jsx28(Link8, { href: investmentKnowledgeUrl, children: t("landing.footer.investmentKnowledge") })
10500
10551
  ]
10501
10552
  }
10502
10553
  ),
@@ -10507,10 +10558,10 @@ function LandingFooter() {
10507
10558
  "aria-label": t("landing.footer.support"),
10508
10559
  children: [
10509
10560
  /* @__PURE__ */ jsx28("strong", { children: t("landing.footer.support") }),
10510
- /* @__PURE__ */ jsx28(Link8, { href: "/khieu-nai/", children: t("landing.footer.complaints") }),
10511
- /* @__PURE__ */ jsx28(Link8, { href: "/chinh-sach/", children: t("landing.footer.privacy") }),
10561
+ /* @__PURE__ */ jsx28(Link8, { href: complaintsUrl, children: t("landing.footer.complaints") }),
10562
+ /* @__PURE__ */ jsx28(Link8, { href: privacyUrl, children: t("landing.footer.privacy") }),
10512
10563
  /* @__PURE__ */ jsx28("button", { type: "button", disabled: true, children: t("landing.footer.termsAndServices") }),
10513
- /* @__PURE__ */ jsx28(Link8, { href: "/bang-phi-ky-quy/", children: t("landing.footer.feesAndMargin") })
10564
+ /* @__PURE__ */ jsx28(Link8, { href: feesUrl, children: t("landing.footer.feesAndMargin") })
10514
10565
  ]
10515
10566
  }
10516
10567
  )
@@ -10735,6 +10786,34 @@ function Header() {
10735
10786
  const lightLogo = useCmsImage("headerLogoImage", "/Logo/logo.png");
10736
10787
  const darkLogo = useCmsImage("headerDarkLogoImage", "/Logo/logo_dark.png");
10737
10788
  const mxvLogo = useCmsImage("headerMxvLogoImage", "/Logo/Logo_mxv.png");
10789
+ const homeUrl = useCmsLink("headerHomeUrl", "/");
10790
+ const mxvUrl = useCmsLink("headerMxvUrl", "https://mxv.com.vn");
10791
+ const navigationUrls = {
10792
+ "header.nav.about": useCmsLink("headerAboutUrl", "/about-us/"),
10793
+ "header.nav.product": useCmsLink("headerProductUrl", "/products/"),
10794
+ "header.nav.fees": useCmsLink("headerFeesUrl", "/bang-phi-ky-quy/"),
10795
+ "header.nav.wikexNews": useCmsLink(
10796
+ "headerBlogsUrl",
10797
+ "/thong-tin-wikex/"
10798
+ ),
10799
+ "header.nav.mxvNews": useCmsLink("headerNewsUrl", "/noti-mxv/"),
10800
+ "header.nav.complaints": useCmsLink(
10801
+ "headerComplaintsUrl",
10802
+ "/khieu-nai/"
10803
+ )
10804
+ };
10805
+ const resolvedNavigationItems = navigationItems2.map(
10806
+ (item) => "children" in item ? {
10807
+ ...item,
10808
+ children: item.children.map((child) => ({
10809
+ ...child,
10810
+ href: navigationUrls[child.labelKey] ?? child.href
10811
+ }))
10812
+ } : {
10813
+ ...item,
10814
+ href: navigationUrls[item.labelKey] ?? item.href
10815
+ }
10816
+ );
10738
10817
  const scrollToPendingMobileSection = () => {
10739
10818
  const sectionId = pendingMobileSectionRef.current;
10740
10819
  if (!sectionId) {
@@ -10774,7 +10853,7 @@ function Header() {
10774
10853
  }, []);
10775
10854
  return /* @__PURE__ */ jsx30(HeaderShell, { ref: setHeaderRef, children: /* @__PURE__ */ jsxs25(HeaderInner, { children: [
10776
10855
  /* @__PURE__ */ jsxs25(BrandGroup, { children: [
10777
- /* @__PURE__ */ jsx30(WikiBrand, { href: "/", "aria-label": t("header.home"), children: /* @__PURE__ */ jsx30(
10856
+ /* @__PURE__ */ jsx30(WikiBrand, { href: homeUrl, "aria-label": t("header.home"), children: /* @__PURE__ */ jsx30(
10778
10857
  WikiLogo,
10779
10858
  {
10780
10859
  src: isDarkTheme ? darkLogo : lightLogo,
@@ -10787,7 +10866,7 @@ function Header() {
10787
10866
  /* @__PURE__ */ jsx30(
10788
10867
  PartnerBrand,
10789
10868
  {
10790
- href: "https://mxv.com.vn",
10869
+ href: mxvUrl,
10791
10870
  target: "_blank",
10792
10871
  rel: "noopener noreferrer",
10793
10872
  "aria-label": t("header.mxv"),
@@ -10804,7 +10883,7 @@ function Header() {
10804
10883
  }
10805
10884
  )
10806
10885
  ] }),
10807
- /* @__PURE__ */ jsx30(DesktopNavigation, { "aria-label": t("header.navigation"), children: navigationItems2.map((item) => {
10886
+ /* @__PURE__ */ jsx30(DesktopNavigation, { "aria-label": t("header.navigation"), children: resolvedNavigationItems.map((item) => {
10808
10887
  const isItemActive = "children" in item ? item.children.some((child) => isRouteActive(child.href)) : isRouteActive(item.href);
10809
10888
  if ("children" in item) {
10810
10889
  return /* @__PURE__ */ jsxs25(
@@ -10959,7 +11038,7 @@ function Header() {
10959
11038
  )
10960
11039
  ] }),
10961
11040
  /* @__PURE__ */ jsxs25(MobileMenuPanel, { "aria-label": t("header.mobileNavigation"), children: [
10962
- navigationItems2.map((item) => {
11041
+ resolvedNavigationItems.map((item) => {
10963
11042
  const isItemActive = "children" in item ? item.children.some((child) => isRouteActive(child.href)) : isRouteActive(item.href);
10964
11043
  if ("children" in item) {
10965
11044
  return /* @__PURE__ */ jsxs25("div", { className: "mobile-menu-group", children: [
@@ -14636,6 +14715,16 @@ function ExactEditableContent({
14636
14715
  const root = rootRef.current;
14637
14716
  if (!root || !editable) return void 0;
14638
14717
  const cleanupTasks = [];
14718
+ const preventPreviewNavigation = (event) => {
14719
+ const target = event.target;
14720
+ if (target instanceof Element && target.closest("a[href]")) {
14721
+ event.preventDefault();
14722
+ }
14723
+ };
14724
+ root.addEventListener("click", preventPreviewNavigation, true);
14725
+ cleanupTasks.push(() => {
14726
+ root.removeEventListener("click", preventPreviewNavigation, true);
14727
+ });
14639
14728
  const usedElements = /* @__PURE__ */ new Set();
14640
14729
  const candidates = Array.from(
14641
14730
  root.querySelectorAll(
@@ -14996,6 +15085,66 @@ var image = (key, label, defaultSrc) => ({
14996
15085
  label,
14997
15086
  defaultSrc
14998
15087
  });
15088
+ var link = (key, label) => ({
15089
+ key,
15090
+ label,
15091
+ type: "link",
15092
+ group: "Li\xEAn k\u1EBFt"
15093
+ });
15094
+ var headerLinkFields = [
15095
+ link("headerHomeUrl", "Logo Wikex / Trang ch\u1EE7"),
15096
+ link("headerMxvUrl", "Logo MXV"),
15097
+ link("headerAboutUrl", "Gi\u1EDBi thi\u1EC7u Wikex"),
15098
+ link("headerProductUrl", "S\u1EA3n ph\u1EA9m"),
15099
+ link("headerFeesUrl", "B\u1EA3ng ph\xED & k\xFD qu\u1EF9"),
15100
+ link("headerBlogsUrl", "Blogs"),
15101
+ link("headerNewsUrl", "News"),
15102
+ link("headerComplaintsUrl", "Gi\u1EA3i quy\u1EBFt khi\u1EBFu n\u1EA1i")
15103
+ ];
15104
+ var headerLinkDefaults = {
15105
+ headerHomeUrl: "/",
15106
+ headerMxvUrl: "https://mxv.com.vn",
15107
+ headerAboutUrl: "/about-us/",
15108
+ headerProductUrl: "/products/",
15109
+ headerFeesUrl: "/bang-phi-ky-quy/",
15110
+ headerBlogsUrl: "/thong-tin-wikex/",
15111
+ headerNewsUrl: "/noti-mxv/",
15112
+ headerComplaintsUrl: "/khieu-nai/"
15113
+ };
15114
+ var footerLinkFields = [
15115
+ link("footerPhoneUrl", "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i"),
15116
+ link("footerEmailUrl", "Email"),
15117
+ link("footerIntroductionUrl", "Gi\u1EDBi thi\u1EC7u Wikex"),
15118
+ link("footerMetalUrl", "Kim lo\u1EA1i"),
15119
+ link("footerAgricultureUrl", "N\xF4ng s\u1EA3n"),
15120
+ link("footerIndustrialUrl", "Nguy\xEAn li\u1EC7u c\xF4ng nghi\u1EC7p"),
15121
+ link("footerInvestmentKnowledgeUrl", "Ki\u1EBFn th\u1EE9c \u0111\u1EA7u t\u01B0"),
15122
+ link("footerComplaintsUrl", "Gi\u1EA3i quy\u1EBFt khi\u1EBFu n\u1EA1i"),
15123
+ link("footerPrivacyUrl", "Ch\xEDnh s\xE1ch b\u1EA3o m\u1EADt"),
15124
+ link("footerFeesUrl", "B\u1EA3ng ph\xED & k\xFD qu\u1EF9"),
15125
+ link("footerZaloUrl", "Zalo"),
15126
+ link("footerTiktokUrl", "TikTok"),
15127
+ link("footerYoutubeUrl", "YouTube"),
15128
+ link("footerFacebookUrl", "Facebook"),
15129
+ link("footerInstagramUrl", "Instagram")
15130
+ ];
15131
+ var footerLinkDefaults = {
15132
+ footerPhoneUrl: "tel:0938427079",
15133
+ footerEmailUrl: "mailto:admin@wikex.vn",
15134
+ footerIntroductionUrl: "/about-us/",
15135
+ footerMetalUrl: "/products/",
15136
+ footerAgricultureUrl: "/products/",
15137
+ footerIndustrialUrl: "/products/",
15138
+ footerInvestmentKnowledgeUrl: "/thong-tin-wikex/",
15139
+ footerComplaintsUrl: "/khieu-nai/",
15140
+ footerPrivacyUrl: "/chinh-sach/",
15141
+ footerFeesUrl: "/bang-phi-ky-quy/",
15142
+ footerZaloUrl: "https://zalo.me/2938904491037143914",
15143
+ footerTiktokUrl: "https://www.tiktok.com/@wikexcommodity",
15144
+ footerYoutubeUrl: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w",
15145
+ footerFacebookUrl: "https://www.facebook.com/profile.php?id=61594044182329",
15146
+ footerInstagramUrl: "https://www.instagram.com/wikexcommodities/"
15147
+ };
14999
15148
  var headerImages = [
15000
15149
  image("headerLogoImage", "Logo Wikex", "/Logo/logo.png"),
15001
15150
  image("headerDarkLogoImage", "Logo Wikex n\u1EC1n t\u1ED1i", "/Logo/logo_dark.png"),
@@ -15176,6 +15325,8 @@ var header = exactBlock(
15176
15325
  name: "Header Wikex Commodity \u2014 b\u1EA3n g\u1ED1c",
15177
15326
  description: "Header nguy\xEAn b\u1EA3n t\u1EEB wikex-commodity-frontend.",
15178
15327
  prefixes: ["header.", "language.", "theme."],
15328
+ fields: headerLinkFields,
15329
+ defaults: headerLinkDefaults,
15179
15330
  images: headerImages,
15180
15331
  placement: "header",
15181
15332
  icon: "solar:menu-dots-bold-duotone"
@@ -15194,6 +15345,8 @@ var footer = exactBlock(
15194
15345
  name: "Footer Wikex Commodity \u2014 b\u1EA3n g\u1ED1c",
15195
15346
  description: "Footer nguy\xEAn b\u1EA3n t\u1EEB wikex-commodity-frontend.",
15196
15347
  prefixes: ["landing.footer.", "landing.floating."],
15348
+ fields: footerLinkFields,
15349
+ defaults: footerLinkDefaults,
15197
15350
  images: footerImages,
15198
15351
  placement: "footer",
15199
15352
  icon: "solar:align-bottom-bold-duotone"