@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.js CHANGED
@@ -4004,6 +4004,11 @@ function useCmsImage(field, fallback) {
4004
4004
  const value4 = context?.content[field];
4005
4005
  return typeof value4 === "string" && value4.trim() ? value4 : fallback;
4006
4006
  }
4007
+ function useCmsLink(field, fallback) {
4008
+ const context = (0, import_react8.useContext)(getCmsImageContext());
4009
+ const value4 = context?.content[field];
4010
+ return typeof value4 === "string" && value4.trim() ? value4.trim() : fallback;
4011
+ }
4007
4012
  function useCmsImageResolver() {
4008
4013
  const context = (0, import_react8.useContext)(getCmsImageContext());
4009
4014
  return (field, fallback) => {
@@ -10329,27 +10334,32 @@ var socialIcons = [
10329
10334
  {
10330
10335
  src: "/landing-assets/footer-social-zalo.svg",
10331
10336
  label: "Zalo",
10332
- link: "https://zalo.me/2938904491037143914"
10337
+ field: "footerZaloUrl",
10338
+ fallback: "https://zalo.me/2938904491037143914"
10333
10339
  },
10334
10340
  {
10335
10341
  src: "/landing-assets/footer-social-tiktok-color.svg",
10336
10342
  label: "TikTok",
10337
- link: "https://www.tiktok.com/@wikexcommodity"
10343
+ field: "footerTiktokUrl",
10344
+ fallback: "https://www.tiktok.com/@wikexcommodity"
10338
10345
  },
10339
10346
  {
10340
10347
  src: "/landing-assets/footer-social-youtube-color.svg",
10341
10348
  label: "YouTube",
10342
- link: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10349
+ field: "footerYoutubeUrl",
10350
+ fallback: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10343
10351
  },
10344
10352
  {
10345
10353
  src: "/landing-assets/footer-social-facebook-color.svg",
10346
10354
  label: "Facebook",
10347
- link: "https://www.facebook.com/profile.php?id=61594044182329"
10355
+ field: "footerFacebookUrl",
10356
+ fallback: "https://www.facebook.com/profile.php?id=61594044182329"
10348
10357
  },
10349
10358
  {
10350
10359
  src: "/landing-assets/footer-social-instagram.svg",
10351
10360
  label: "Instagram",
10352
- link: "https://www.instagram.com/wikexcommodities/"
10361
+ field: "footerInstagramUrl",
10362
+ fallback: "https://www.instagram.com/wikexcommodities/"
10353
10363
  }
10354
10364
  ];
10355
10365
  function StoreDownloadBadge({ store }) {
@@ -10411,6 +10421,47 @@ function LandingFooter() {
10411
10421
  "/Logo/logo_original_dark.png"
10412
10422
  );
10413
10423
  const mxvLogo = useCmsImage("footerMxvLogoImage", "/Logo/Logo_mxv.png");
10424
+ const phoneUrl = useCmsLink("footerPhoneUrl", "tel:0938427079");
10425
+ const emailUrl = useCmsLink("footerEmailUrl", "mailto:admin@wikex.vn");
10426
+ const introductionUrl = useCmsLink(
10427
+ "footerIntroductionUrl",
10428
+ "/about-us/"
10429
+ );
10430
+ const metalUrl = useCmsLink("footerMetalUrl", "/products/");
10431
+ const agricultureUrl = useCmsLink(
10432
+ "footerAgricultureUrl",
10433
+ "/products/"
10434
+ );
10435
+ const industrialUrl = useCmsLink("footerIndustrialUrl", "/products/");
10436
+ const investmentKnowledgeUrl = useCmsLink(
10437
+ "footerInvestmentKnowledgeUrl",
10438
+ "/thong-tin-wikex/"
10439
+ );
10440
+ const complaintsUrl = useCmsLink("footerComplaintsUrl", "/khieu-nai/");
10441
+ const privacyUrl = useCmsLink("footerPrivacyUrl", "/chinh-sach/");
10442
+ const feesUrl = useCmsLink("footerFeesUrl", "/bang-phi-ky-quy/");
10443
+ const socialUrls = {
10444
+ footerZaloUrl: useCmsLink(
10445
+ "footerZaloUrl",
10446
+ "https://zalo.me/2938904491037143914"
10447
+ ),
10448
+ footerTiktokUrl: useCmsLink(
10449
+ "footerTiktokUrl",
10450
+ "https://www.tiktok.com/@wikexcommodity"
10451
+ ),
10452
+ footerYoutubeUrl: useCmsLink(
10453
+ "footerYoutubeUrl",
10454
+ "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w"
10455
+ ),
10456
+ footerFacebookUrl: useCmsLink(
10457
+ "footerFacebookUrl",
10458
+ "https://www.facebook.com/profile.php?id=61594044182329"
10459
+ ),
10460
+ footerInstagramUrl: useCmsLink(
10461
+ "footerInstagramUrl",
10462
+ "https://www.instagram.com/wikexcommodities/"
10463
+ )
10464
+ };
10414
10465
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("footer", { className: "footer", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "container footer-content", children: [
10415
10466
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "footer-grid", children: [
10416
10467
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "footer-brand", children: [
@@ -10447,8 +10498,8 @@ function LandingFooter() {
10447
10498
  ] }),
10448
10499
  /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "footer-contact-list", children: [
10449
10500
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ContactRow, { icon: "/landing-assets/footer-map-pin.svg", children: t("landing.footer.address") }),
10450
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ContactRow, { icon: "/landing-assets/footer-mobile.svg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: "tel:0938427079", children: t("landing.footer.phone") }) }),
10451
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ContactRow, { icon: "/landing-assets/footer-email.svg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: "mailto:admin@wikex.vn", children: t("landing.footer.email") }) })
10501
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ContactRow, { icon: "/landing-assets/footer-mobile.svg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: phoneUrl, children: t("landing.footer.phone") }) }),
10502
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ContactRow, { icon: "/landing-assets/footer-email.svg", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("a", { href: emailUrl, children: t("landing.footer.email") }) })
10452
10503
  ] })
10453
10504
  ] }),
10454
10505
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
@@ -10459,7 +10510,7 @@ function LandingFooter() {
10459
10510
  children: socialIcons.map((social) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
10460
10511
  import_link6.default,
10461
10512
  {
10462
- href: social.link,
10513
+ href: socialUrls[social.field] ?? social.fallback,
10463
10514
  className: "footer-social-button",
10464
10515
  title: social.label,
10465
10516
  target: "_blank",
@@ -10493,7 +10544,7 @@ function LandingFooter() {
10493
10544
  "aria-label": t("landing.footer.aboutWikex"),
10494
10545
  children: [
10495
10546
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: t("landing.footer.aboutWikex") }),
10496
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/about-us/", children: t("landing.footer.introduction") }),
10547
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: introductionUrl, children: t("landing.footer.introduction") }),
10497
10548
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", disabled: true, children: t("landing.footer.careers") }),
10498
10549
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", disabled: true, children: t("landing.footer.contact") })
10499
10550
  ]
@@ -10506,9 +10557,9 @@ function LandingFooter() {
10506
10557
  "aria-label": t("landing.footer.product"),
10507
10558
  children: [
10508
10559
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: t("landing.footer.product") }),
10509
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/products/", children: t("landing.footer.metal") }),
10510
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/products/", children: t("landing.footer.agriculture") }),
10511
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/products/", children: t("landing.footer.industrial") })
10560
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: metalUrl, children: t("landing.footer.metal") }),
10561
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: agricultureUrl, children: t("landing.footer.agriculture") }),
10562
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: industrialUrl, children: t("landing.footer.industrial") })
10512
10563
  ]
10513
10564
  }
10514
10565
  ),
@@ -10521,7 +10572,7 @@ function LandingFooter() {
10521
10572
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: t("landing.footer.guide") }),
10522
10573
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", disabled: true, children: t("landing.footer.investmentGuide") }),
10523
10574
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", disabled: true, children: t("landing.footer.training") }),
10524
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/thong-tin-wikex/", children: t("landing.footer.investmentKnowledge") })
10575
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: investmentKnowledgeUrl, children: t("landing.footer.investmentKnowledge") })
10525
10576
  ]
10526
10577
  }
10527
10578
  ),
@@ -10532,10 +10583,10 @@ function LandingFooter() {
10532
10583
  "aria-label": t("landing.footer.support"),
10533
10584
  children: [
10534
10585
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: t("landing.footer.support") }),
10535
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/khieu-nai/", children: t("landing.footer.complaints") }),
10536
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/chinh-sach/", children: t("landing.footer.privacy") }),
10586
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: complaintsUrl, children: t("landing.footer.complaints") }),
10587
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: privacyUrl, children: t("landing.footer.privacy") }),
10537
10588
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", disabled: true, children: t("landing.footer.termsAndServices") }),
10538
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: "/bang-phi-ky-quy/", children: t("landing.footer.feesAndMargin") })
10589
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_link6.default, { href: feesUrl, children: t("landing.footer.feesAndMargin") })
10539
10590
  ]
10540
10591
  }
10541
10592
  )
@@ -10760,6 +10811,34 @@ function Header() {
10760
10811
  const lightLogo = useCmsImage("headerLogoImage", "/Logo/logo.png");
10761
10812
  const darkLogo = useCmsImage("headerDarkLogoImage", "/Logo/logo_dark.png");
10762
10813
  const mxvLogo = useCmsImage("headerMxvLogoImage", "/Logo/Logo_mxv.png");
10814
+ const homeUrl = useCmsLink("headerHomeUrl", "/");
10815
+ const mxvUrl = useCmsLink("headerMxvUrl", "https://mxv.com.vn");
10816
+ const navigationUrls = {
10817
+ "header.nav.about": useCmsLink("headerAboutUrl", "/about-us/"),
10818
+ "header.nav.product": useCmsLink("headerProductUrl", "/products/"),
10819
+ "header.nav.fees": useCmsLink("headerFeesUrl", "/bang-phi-ky-quy/"),
10820
+ "header.nav.wikexNews": useCmsLink(
10821
+ "headerBlogsUrl",
10822
+ "/thong-tin-wikex/"
10823
+ ),
10824
+ "header.nav.mxvNews": useCmsLink("headerNewsUrl", "/noti-mxv/"),
10825
+ "header.nav.complaints": useCmsLink(
10826
+ "headerComplaintsUrl",
10827
+ "/khieu-nai/"
10828
+ )
10829
+ };
10830
+ const resolvedNavigationItems = navigationItems2.map(
10831
+ (item) => "children" in item ? {
10832
+ ...item,
10833
+ children: item.children.map((child) => ({
10834
+ ...child,
10835
+ href: navigationUrls[child.labelKey] ?? child.href
10836
+ }))
10837
+ } : {
10838
+ ...item,
10839
+ href: navigationUrls[item.labelKey] ?? item.href
10840
+ }
10841
+ );
10763
10842
  const scrollToPendingMobileSection = () => {
10764
10843
  const sectionId = pendingMobileSectionRef.current;
10765
10844
  if (!sectionId) {
@@ -10799,7 +10878,7 @@ function Header() {
10799
10878
  }, []);
10800
10879
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(HeaderShell, { ref: setHeaderRef, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(HeaderInner, { children: [
10801
10880
  /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(BrandGroup, { children: [
10802
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WikiBrand, { href: "/", "aria-label": t("header.home"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10881
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WikiBrand, { href: homeUrl, "aria-label": t("header.home"), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10803
10882
  WikiLogo,
10804
10883
  {
10805
10884
  src: isDarkTheme ? darkLogo : lightLogo,
@@ -10812,7 +10891,7 @@ function Header() {
10812
10891
  /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
10813
10892
  PartnerBrand,
10814
10893
  {
10815
- href: "https://mxv.com.vn",
10894
+ href: mxvUrl,
10816
10895
  target: "_blank",
10817
10896
  rel: "noopener noreferrer",
10818
10897
  "aria-label": t("header.mxv"),
@@ -10829,7 +10908,7 @@ function Header() {
10829
10908
  }
10830
10909
  )
10831
10910
  ] }),
10832
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DesktopNavigation, { "aria-label": t("header.navigation"), children: navigationItems2.map((item) => {
10911
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DesktopNavigation, { "aria-label": t("header.navigation"), children: resolvedNavigationItems.map((item) => {
10833
10912
  const isItemActive = "children" in item ? item.children.some((child) => isRouteActive(child.href)) : isRouteActive(item.href);
10834
10913
  if ("children" in item) {
10835
10914
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
@@ -10984,7 +11063,7 @@ function Header() {
10984
11063
  )
10985
11064
  ] }),
10986
11065
  /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(MobileMenuPanel, { "aria-label": t("header.mobileNavigation"), children: [
10987
- navigationItems2.map((item) => {
11066
+ resolvedNavigationItems.map((item) => {
10988
11067
  const isItemActive = "children" in item ? item.children.some((child) => isRouteActive(child.href)) : isRouteActive(item.href);
10989
11068
  if ("children" in item) {
10990
11069
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mobile-menu-group", children: [
@@ -14661,6 +14740,16 @@ function ExactEditableContent({
14661
14740
  const root = rootRef.current;
14662
14741
  if (!root || !editable) return void 0;
14663
14742
  const cleanupTasks = [];
14743
+ const preventPreviewNavigation = (event) => {
14744
+ const target = event.target;
14745
+ if (target instanceof Element && target.closest("a[href]")) {
14746
+ event.preventDefault();
14747
+ }
14748
+ };
14749
+ root.addEventListener("click", preventPreviewNavigation, true);
14750
+ cleanupTasks.push(() => {
14751
+ root.removeEventListener("click", preventPreviewNavigation, true);
14752
+ });
14664
14753
  const usedElements = /* @__PURE__ */ new Set();
14665
14754
  const candidates = Array.from(
14666
14755
  root.querySelectorAll(
@@ -15021,6 +15110,66 @@ var image = (key, label, defaultSrc) => ({
15021
15110
  label,
15022
15111
  defaultSrc
15023
15112
  });
15113
+ var link = (key, label) => ({
15114
+ key,
15115
+ label,
15116
+ type: "link",
15117
+ group: "Li\xEAn k\u1EBFt"
15118
+ });
15119
+ var headerLinkFields = [
15120
+ link("headerHomeUrl", "Logo Wikex / Trang ch\u1EE7"),
15121
+ link("headerMxvUrl", "Logo MXV"),
15122
+ link("headerAboutUrl", "Gi\u1EDBi thi\u1EC7u Wikex"),
15123
+ link("headerProductUrl", "S\u1EA3n ph\u1EA9m"),
15124
+ link("headerFeesUrl", "B\u1EA3ng ph\xED & k\xFD qu\u1EF9"),
15125
+ link("headerBlogsUrl", "Blogs"),
15126
+ link("headerNewsUrl", "News"),
15127
+ link("headerComplaintsUrl", "Gi\u1EA3i quy\u1EBFt khi\u1EBFu n\u1EA1i")
15128
+ ];
15129
+ var headerLinkDefaults = {
15130
+ headerHomeUrl: "/",
15131
+ headerMxvUrl: "https://mxv.com.vn",
15132
+ headerAboutUrl: "/about-us/",
15133
+ headerProductUrl: "/products/",
15134
+ headerFeesUrl: "/bang-phi-ky-quy/",
15135
+ headerBlogsUrl: "/thong-tin-wikex/",
15136
+ headerNewsUrl: "/noti-mxv/",
15137
+ headerComplaintsUrl: "/khieu-nai/"
15138
+ };
15139
+ var footerLinkFields = [
15140
+ link("footerPhoneUrl", "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i"),
15141
+ link("footerEmailUrl", "Email"),
15142
+ link("footerIntroductionUrl", "Gi\u1EDBi thi\u1EC7u Wikex"),
15143
+ link("footerMetalUrl", "Kim lo\u1EA1i"),
15144
+ link("footerAgricultureUrl", "N\xF4ng s\u1EA3n"),
15145
+ link("footerIndustrialUrl", "Nguy\xEAn li\u1EC7u c\xF4ng nghi\u1EC7p"),
15146
+ link("footerInvestmentKnowledgeUrl", "Ki\u1EBFn th\u1EE9c \u0111\u1EA7u t\u01B0"),
15147
+ link("footerComplaintsUrl", "Gi\u1EA3i quy\u1EBFt khi\u1EBFu n\u1EA1i"),
15148
+ link("footerPrivacyUrl", "Ch\xEDnh s\xE1ch b\u1EA3o m\u1EADt"),
15149
+ link("footerFeesUrl", "B\u1EA3ng ph\xED & k\xFD qu\u1EF9"),
15150
+ link("footerZaloUrl", "Zalo"),
15151
+ link("footerTiktokUrl", "TikTok"),
15152
+ link("footerYoutubeUrl", "YouTube"),
15153
+ link("footerFacebookUrl", "Facebook"),
15154
+ link("footerInstagramUrl", "Instagram")
15155
+ ];
15156
+ var footerLinkDefaults = {
15157
+ footerPhoneUrl: "tel:0938427079",
15158
+ footerEmailUrl: "mailto:admin@wikex.vn",
15159
+ footerIntroductionUrl: "/about-us/",
15160
+ footerMetalUrl: "/products/",
15161
+ footerAgricultureUrl: "/products/",
15162
+ footerIndustrialUrl: "/products/",
15163
+ footerInvestmentKnowledgeUrl: "/thong-tin-wikex/",
15164
+ footerComplaintsUrl: "/khieu-nai/",
15165
+ footerPrivacyUrl: "/chinh-sach/",
15166
+ footerFeesUrl: "/bang-phi-ky-quy/",
15167
+ footerZaloUrl: "https://zalo.me/2938904491037143914",
15168
+ footerTiktokUrl: "https://www.tiktok.com/@wikexcommodity",
15169
+ footerYoutubeUrl: "https://www.youtube.com/channel/UCJDPfQ-n4dLTsqW2KhQ1v9w",
15170
+ footerFacebookUrl: "https://www.facebook.com/profile.php?id=61594044182329",
15171
+ footerInstagramUrl: "https://www.instagram.com/wikexcommodities/"
15172
+ };
15024
15173
  var headerImages = [
15025
15174
  image("headerLogoImage", "Logo Wikex", "/Logo/logo.png"),
15026
15175
  image("headerDarkLogoImage", "Logo Wikex n\u1EC1n t\u1ED1i", "/Logo/logo_dark.png"),
@@ -15201,6 +15350,8 @@ var header = exactBlock(
15201
15350
  name: "Header Wikex Commodity \u2014 b\u1EA3n g\u1ED1c",
15202
15351
  description: "Header nguy\xEAn b\u1EA3n t\u1EEB wikex-commodity-frontend.",
15203
15352
  prefixes: ["header.", "language.", "theme."],
15353
+ fields: headerLinkFields,
15354
+ defaults: headerLinkDefaults,
15204
15355
  images: headerImages,
15205
15356
  placement: "header",
15206
15357
  icon: "solar:menu-dots-bold-duotone"
@@ -15219,6 +15370,8 @@ var footer = exactBlock(
15219
15370
  name: "Footer Wikex Commodity \u2014 b\u1EA3n g\u1ED1c",
15220
15371
  description: "Footer nguy\xEAn b\u1EA3n t\u1EEB wikex-commodity-frontend.",
15221
15372
  prefixes: ["landing.footer.", "landing.floating."],
15373
+ fields: footerLinkFields,
15374
+ defaults: footerLinkDefaults,
15222
15375
  images: footerImages,
15223
15376
  placement: "footer",
15224
15377
  icon: "solar:align-bottom-bold-duotone"