wpheadless-lib 1.1.6 → 1.1.7

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.
@@ -21,6 +21,12 @@ export default async function Footer({ menuId, wpApiUrl, wpUsername, wpAppPasswo
21
21
  const t = getTranslator(locale);
22
22
  const logoData = logo?.src ? logo : null;
23
23
  const logoAlt = logoData?.alt || siteName;
24
+ const logoStyle = logoData
25
+ ? {
26
+ ...(logoData.height ? { height: logoData.height } : {}),
27
+ ...(logoData.width ? { width: logoData.width } : {}),
28
+ }
29
+ : undefined;
24
30
  try {
25
31
  const parsedMenuId = parseInt(menuId);
26
32
  const itemsResponse = await menusApi.items.list({
@@ -34,5 +40,5 @@ export default async function Footer({ menuId, wpApiUrl, wpUsername, wpAppPasswo
34
40
  catch (e) {
35
41
  console.error("Error obteniendo menú footer:", e);
36
42
  }
37
- return (_jsx("footer", { className: styles.footer, children: _jsx("div", { className: "container", children: _jsxs("div", { className: styles.wrapper, children: [_jsxs("div", { className: styles.grid, children: [_jsxs("div", { children: [_jsx("h3", { className: styles.siteName, children: logoData ? (_jsx("img", { src: logoData.src, alt: logoAlt, className: styles.logoImage, width: logoData.width, height: logoData.height })) : (siteName) }), _jsx("p", { className: `${styles.muted} text-muted`, children: t("footer.tagline") })] }), menuItems.length > 0 && (_jsxs("nav", { "aria-label": t("footer.navAria"), className: styles.nav, children: [_jsx("h4", { className: styles.navTitle, children: t("footer.navTitle") }), _jsx("ul", { className: styles.list, children: menuItems.map((item) => (_jsx("li", { children: _jsx(Link, { href: convertWpUrl(item.url, wpApiUrl), className: "footer-link", children: item.title.rendered }) }, item.id))) })] }))] }), _jsxs("div", { className: styles.bottomBar, children: [_jsxs("span", { children: ["\u00A9 ", new Date().getFullYear(), " ", siteName] }), _jsx("span", { children: t("footer.noCookies") })] })] }) }) }));
43
+ return (_jsx("footer", { className: styles.footer, children: _jsx("div", { className: "container", children: _jsxs("div", { className: styles.wrapper, children: [_jsxs("div", { className: styles.grid, children: [_jsxs("div", { children: [_jsx("h3", { className: styles.siteName, children: logoData ? (_jsx("img", { src: logoData.src, alt: logoAlt, className: styles.logoImage, width: logoData.width, height: logoData.height, style: logoStyle })) : (siteName) }), _jsx("p", { className: `${styles.muted} text-muted`, children: t("footer.tagline") })] }), menuItems.length > 0 && (_jsxs("nav", { "aria-label": t("footer.navAria"), className: styles.nav, children: [_jsx("h4", { className: styles.navTitle, children: t("footer.navTitle") }), _jsx("ul", { className: styles.list, children: menuItems.map((item) => (_jsx("li", { children: _jsx(Link, { href: convertWpUrl(item.url, wpApiUrl), className: "footer-link", children: item.title.rendered }) }, item.id))) })] }))] }), _jsxs("div", { className: styles.bottomBar, children: [_jsxs("span", { children: ["\u00A9 ", new Date().getFullYear(), " ", siteName] }), _jsx("span", { children: t("footer.noCookies") })] })] }) }) }));
38
44
  }
@@ -25,7 +25,7 @@
25
25
  }
26
26
 
27
27
  .logoImage {
28
- height: 44px;
28
+ height: 64px;
29
29
  width: auto;
30
30
  display: block;
31
31
  object-fit: contain;
@@ -23,7 +23,13 @@ export default function HeaderClient({ menuLinks, siteName, homeHref, labels, lo
23
23
  const menuLabel = isMenuOpen ? labels.closeMenu : labels.openMenu;
24
24
  const logoData = logo?.src ? logo : null;
25
25
  const logoAlt = logoData?.alt || siteName;
26
- return (_jsxs("div", { className: styles.inner, children: [_jsx(Link, { href: homeHref, className: styles.logo, children: logoData ? (_jsx("img", { src: logoData.src, alt: logoAlt, className: styles.logoImage, width: logoData.width, height: logoData.height })) : (siteName) }), menuLinks.length > 0 && (_jsxs("div", { className: styles.navWrapper, children: [_jsxs("button", { type: "button", className: styles.menuButton, "aria-expanded": isMenuOpen, "aria-controls": "primary-navigation", "aria-label": menuLabel, onClick: toggleMenu, children: [_jsxs("span", { className: styles.menuIcon, "aria-hidden": "true", children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {})] }), _jsx("span", { className: styles.menuText, children: menuLabel })] }), _jsx("nav", { id: "primary-navigation", "aria-label": labels.navAria, className: `${styles.nav} ${isMenuOpen ? styles.navOpen : ""}`, "aria-hidden": !isMenuOpen && isMobileView, hidden: !isMenuOpen && isMobileView, children: _jsx("ul", { className: styles.list, children: menuLinks.map((item) => (_jsx("li", { children: _jsx(Link, { href: item.href, className: "header-link", onClick: handleLinkClick, target: item.target || undefined, rel: item.target === "_blank"
26
+ const logoStyle = logoData
27
+ ? {
28
+ ...(logoData.height ? { height: logoData.height } : {}),
29
+ ...(logoData.width ? { width: logoData.width } : {}),
30
+ }
31
+ : undefined;
32
+ return (_jsxs("div", { className: styles.inner, children: [_jsx(Link, { href: homeHref, className: styles.logo, children: logoData ? (_jsx("img", { src: logoData.src, alt: logoAlt, className: styles.logoImage, width: logoData.width, height: logoData.height, style: logoStyle })) : (siteName) }), menuLinks.length > 0 && (_jsxs("div", { className: styles.navWrapper, children: [_jsxs("button", { type: "button", className: styles.menuButton, "aria-expanded": isMenuOpen, "aria-controls": "primary-navigation", "aria-label": menuLabel, onClick: toggleMenu, children: [_jsxs("span", { className: styles.menuIcon, "aria-hidden": "true", children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {})] }), _jsx("span", { className: styles.menuText, children: menuLabel })] }), _jsx("nav", { id: "primary-navigation", "aria-label": labels.navAria, className: `${styles.nav} ${isMenuOpen ? styles.navOpen : ""}`, "aria-hidden": !isMenuOpen && isMobileView, hidden: !isMenuOpen && isMobileView, children: _jsx("ul", { className: styles.list, children: menuLinks.map((item) => (_jsx("li", { children: _jsx(Link, { href: item.href, className: "header-link", onClick: handleLinkClick, target: item.target || undefined, rel: item.target === "_blank"
27
33
  ? "noopener noreferrer"
28
34
  : undefined, children: item.label }) }, item.id))) }) })] }))] }));
29
35
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  .logoImage {
35
- height: 40px;
35
+ height: 64px;
36
36
  width: auto;
37
37
  display: block;
38
38
  object-fit: contain;
@@ -6,6 +6,7 @@ type PostViewProps = {
6
6
  categoryBasePath?: string;
7
7
  locale?: Locale;
8
8
  authorDescription?: string | null;
9
+ disclaimer?: string;
9
10
  };
10
- export declare function PostView({ post, dateLocale, categoryBasePath, locale, authorDescription, }: PostViewProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function PostView({ post, dateLocale, categoryBasePath, locale, authorDescription, disclaimer, }: PostViewProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -9,7 +9,7 @@ function truncateLabel(label, max = 20) {
9
9
  const trimmed = label.trim();
10
10
  return trimmed.length > max ? `${trimmed.slice(0, max)}...` : trimmed;
11
11
  }
12
- export function PostView({ post, dateLocale = "en-US", categoryBasePath = "/", locale, authorDescription, }) {
12
+ export function PostView({ post, dateLocale = "en-US", categoryBasePath = "/", locale, authorDescription, disclaimer, }) {
13
13
  const t = getTranslator(locale);
14
14
  const author = getAuthor(post);
15
15
  const authorBio = authorDescription ?? author?.description;
@@ -27,5 +27,5 @@ export function PostView({ post, dateLocale = "en-US", categoryBasePath = "/", l
27
27
  { label: "Home", href: categoryBasePath },
28
28
  { label: stripTags(post.title.rendered) || post.title.rendered },
29
29
  ];
30
- return (_jsx("div", { className: `container ${styles.container}`, children: _jsxs("article", { className: styles.article, children: [_jsx(Breadcrumbs, { items: breadcrumbs }), _jsx("header", { className: styles.postHeader, children: _jsx("h1", { dangerouslySetInnerHTML: { __html: post.title.rendered }, className: styles.title }) }), featuredImage && (_jsxs("figure", { className: styles.figure, children: [primaryCategory && (_jsx("div", { className: styles.badgeOverlay, children: categoryUrl ? (_jsx("a", { href: categoryUrl, className: "badge", title: primaryCategory.name, children: truncateLabel(primaryCategory.name, 20) })) : (_jsx("span", { className: "badge", title: primaryCategory.name, children: truncateLabel(primaryCategory.name, 20) })) })), _jsx(Image, { src: featuredImage.src, alt: featuredImage.alt, width: featuredImage.width, height: featuredImage.height, className: styles.image, priority: true, sizes: "(max-width: 900px) 100vw, 900px" })] })), _jsxs("div", { className: styles.meta, children: [author && (_jsx("span", { className: styles.authorLabel, children: t("post.authorPrefix", { name: author.name }) })), _jsx("span", { children: "\u2022" }), _jsx("time", { dateTime: post.date, children: publishedDate })] }), _jsx("div", { dangerouslySetInnerHTML: { __html: post.content.rendered }, className: `post-content ${styles.content}` }), author && (_jsx("aside", { className: `card ${styles.authorCard}`, children: _jsxs("address", { className: styles.authorAddress, children: [_jsx("strong", { className: styles.authorName, children: author.name }), authorBio && (_jsx("p", { className: styles.authorBio, children: authorBio }))] }) }))] }) }));
30
+ return (_jsx("div", { className: `container ${styles.container}`, children: _jsxs("article", { className: styles.article, children: [_jsx(Breadcrumbs, { items: breadcrumbs }), _jsx("header", { className: styles.postHeader, children: _jsx("h1", { dangerouslySetInnerHTML: { __html: post.title.rendered }, className: styles.title }) }), featuredImage && (_jsxs("figure", { className: styles.figure, children: [primaryCategory && (_jsx("div", { className: styles.badgeOverlay, children: categoryUrl ? (_jsx("a", { href: categoryUrl, className: "badge", title: primaryCategory.name, children: truncateLabel(primaryCategory.name, 20) })) : (_jsx("span", { className: "badge", title: primaryCategory.name, children: truncateLabel(primaryCategory.name, 20) })) })), _jsx(Image, { src: featuredImage.src, alt: featuredImage.alt, width: featuredImage.width, height: featuredImage.height, className: styles.image, priority: true, sizes: "(max-width: 900px) 100vw, 900px" })] })), _jsxs("div", { className: styles.meta, children: [author && (_jsx("span", { className: styles.authorLabel, children: t("post.authorPrefix", { name: author.name }) })), _jsx("span", { children: "\u2022" }), _jsx("time", { dateTime: post.date, children: publishedDate })] }), _jsx("div", { dangerouslySetInnerHTML: { __html: post.content.rendered }, className: `post-content ${styles.content}` }), disclaimer && (_jsx("div", { className: styles.disclaimer, role: "note", children: disclaimer })), author && (_jsx("aside", { className: `card ${styles.authorCard}`, children: _jsxs("address", { className: styles.authorAddress, children: [_jsx("strong", { className: styles.authorName, children: author.name }), authorBio && (_jsx("p", { className: styles.authorBio, children: authorBio }))] }) }))] }) }));
31
31
  }
@@ -62,6 +62,18 @@
62
62
  color: var(--foreground);
63
63
  }
64
64
 
65
+ .disclaimer {
66
+ margin-top: var(--spacing-md);
67
+ padding: 0.9rem 1.1rem;
68
+ border-radius: 10px;
69
+ border: 1px dashed var(--border);
70
+ background: #f1f5f9;
71
+ color: var(--foreground-light);
72
+ font-size: 0.95rem;
73
+ line-height: 1.6;
74
+ font-style: italic;
75
+ }
76
+
65
77
  .authorCard {
66
78
  margin-top: var(--spacing-lg);
67
79
  margin-left: auto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wpheadless-lib",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",