@pixelated-tech/components 3.2.10 → 3.2.11
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/README.COMPONENTS.md +2 -1
- package/dist/components/cms/gravatar.css +8 -0
- package/dist/components/cms/wordpress.components.js +3 -3
- package/dist/types/components/cms/wordpress.components.d.ts +4 -1
- package/dist/types/components/cms/wordpress.components.d.ts.map +1 -1
- package/dist/types/stories/cms/wordpress.stories.d.ts +5 -0
- package/dist/types/stories/cms/wordpress.stories.d.ts.map +1 -1
- package/package.json +1 -1
package/README.COMPONENTS.md
CHANGED
|
@@ -332,9 +332,10 @@ import { BlogPostList } from '@pixelated-tech/components';
|
|
|
332
332
|
|
|
333
333
|
| Prop | Type | Default | Description |
|
|
334
334
|
|------|------|---------|-------------|
|
|
335
|
-
| `site` | `string` | - | WordPress site
|
|
335
|
+
| `site` | `string` | - | WordPress site identifier (e.g., 'your-blog.wordpress.com') |
|
|
336
336
|
| `count` | `number` | - | Number of posts to fetch (undefined = all) |
|
|
337
337
|
| `posts` | `BlogPostType[]` | - | Pre-fetched posts array |
|
|
338
|
+
| `showCategories` | `boolean` | `true` | Whether to display post categories |
|
|
338
339
|
|
|
339
340
|
#### BlogPostSummary
|
|
340
341
|
|
|
@@ -107,4 +107,12 @@
|
|
|
107
107
|
|
|
108
108
|
.gravatar-card-compact .gravatar-about {
|
|
109
109
|
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Responsive: Stack horizontal layout vertically on small screens */
|
|
113
|
+
@media (max-width: 480px) {
|
|
114
|
+
.gravatar-card-horizontal {
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
}
|
|
110
118
|
}
|
|
@@ -13,7 +13,7 @@ function decodeString(str) {
|
|
|
13
13
|
return textarea.value;
|
|
14
14
|
}
|
|
15
15
|
export function BlogPostList(props) {
|
|
16
|
-
const { site: propSite, baseURL: propBaseURL, count, posts: cachedPosts } = props;
|
|
16
|
+
const { site: propSite, baseURL: propBaseURL, count, posts: cachedPosts, showCategories = true } = props;
|
|
17
17
|
const config = usePixelatedConfig();
|
|
18
18
|
const site = propSite ?? config?.wordpress?.site;
|
|
19
19
|
const baseURL = propBaseURL ?? config?.wordpress?.baseURL;
|
|
@@ -39,14 +39,14 @@ export function BlogPostList(props) {
|
|
|
39
39
|
ToggleLoading({ show: false });
|
|
40
40
|
})();
|
|
41
41
|
}, [site, baseURL, count, cachedPosts]);
|
|
42
|
-
return (_jsxs(_Fragment, { children: [_jsx(Loading, {}), posts.map((post) => (_jsx(PageGridItem, { children: _jsx(BlogPostSummary, { ID: post.ID, title: post.title, date: post.date, excerpt: post.excerpt, URL: post.URL, categories: post.categories, featured_image: post.featured_image }) }, post.ID)))] }));
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx(Loading, {}), posts.map((post) => (_jsx(PageGridItem, { children: _jsx(BlogPostSummary, { ID: post.ID, title: post.title, date: post.date, excerpt: post.excerpt, URL: post.URL, categories: post.categories, featured_image: post.featured_image, showCategories: showCategories }) }, post.ID)))] }));
|
|
43
43
|
}
|
|
44
44
|
export function BlogPostSummary(props) {
|
|
45
45
|
const myCategoryImages = Object.entries(props.categories).map(([category, index]) => [category.trim().toLowerCase().replace(/[ /]+/g, '-'), index]).sort();
|
|
46
46
|
const config = usePixelatedConfig();
|
|
47
47
|
const myExcerpt = decodeString(props.excerpt).replace(/\[…\]/g, '<a href="' + props.URL + '" target="_blank" rel="noopener noreferrer">[…]</a>');
|
|
48
48
|
return (_jsx("div", { className: "blog-post-summary", children: _jsxs("article", { className: "h-entry", children: [_jsx("h2", { className: "p-name", children: _jsx("a", { className: "u-url blog-post-url", href: props.URL, target: "_blank", rel: "noopener noreferrer", children: decodeString(props.title) }) }), _jsxs("div", { className: "dt-published", children: ["Published: ", new Date(props.date).toLocaleDateString()] }), props.featured_image ? (_jsxs("div", { className: "article-body row-12col", children: [_jsx("div", { className: "article-featured-image grid-s1-e4", children: _jsx(SmartImage, { className: "u-photo", src: props.featured_image, alt: decodeString(props.title), title: decodeString(props.title), style: { borderRadius: '20px' }, cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined }) }), _jsx("div", { className: "article-excerpt grid-s4-e13", children: _jsx("div", { className: "p-summary", dangerouslySetInnerHTML: { __html: myExcerpt } }) })] })) :
|
|
49
|
-
_jsx("div", { className: "article-excerpt grid-s1-e13", children: _jsx("div", { className: "p-summary", dangerouslySetInnerHTML: { __html: myExcerpt } }) }), _jsxs("div", { children: ["Categories:", myCategoryImages.map(([categoryImg, index]) => (_jsx("span", { className: "p-category", children: _jsx(SmartImage, { src: `/images/icons/${categoryImg}.png`, title: String(categoryImg), alt: String(categoryImg), cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined }) }, categoryImg + "-" + index)))] })] }) }, props.ID));
|
|
49
|
+
_jsx("div", { className: "article-excerpt grid-s1-e13", children: _jsx("div", { className: "p-summary", dangerouslySetInnerHTML: { __html: myExcerpt } }) }), props.showCategories !== false && (_jsxs("div", { children: ["Categories:", myCategoryImages.map(([categoryImg, index]) => (_jsx("span", { className: "p-category", children: _jsx(SmartImage, { src: `/images/icons/${categoryImg}.png`, title: String(categoryImg), alt: String(categoryImg), cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined }) }, categoryImg + "-" + index)))] }))] }) }, props.ID));
|
|
50
50
|
}
|
|
51
51
|
export function BlogPostCategories(props) {
|
|
52
52
|
if (!props.categories || props.categories.length === 0) {
|
|
@@ -5,8 +5,11 @@ export declare function BlogPostList(props: {
|
|
|
5
5
|
baseURL?: string;
|
|
6
6
|
count?: number;
|
|
7
7
|
posts?: BlogPostType[];
|
|
8
|
+
showCategories?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function BlogPostSummary(props: BlogPostType & {
|
|
11
|
+
showCategories?: boolean;
|
|
8
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function BlogPostSummary(props: BlogPostType): import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
export declare function BlogPostCategories(props: {
|
|
11
14
|
categories: string[];
|
|
12
15
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordpress.components.d.ts","sourceRoot":"","sources":["../../../../src/components/cms/wordpress.components.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,iBAAiB,CAAC;AAWzB,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"wordpress.components.d.ts","sourceRoot":"","sources":["../../../../src/components/cms/wordpress.components.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,OAAO,iBAAiB,CAAC;AAWzB,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,2CAmDxI;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,2CAiDjF;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,kDA0BjE"}
|
|
@@ -3,6 +3,11 @@ export function WordpressBlogPostList(): import("react/jsx-runtime").JSX.Element
|
|
|
3
3
|
export namespace WordpressBlogPostList {
|
|
4
4
|
let storyName: string;
|
|
5
5
|
}
|
|
6
|
+
export function WordpressBlogPostListNoCategories(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export namespace WordpressBlogPostListNoCategories {
|
|
8
|
+
let storyName_1: string;
|
|
9
|
+
export { storyName_1 as storyName };
|
|
10
|
+
}
|
|
6
11
|
declare namespace _default {
|
|
7
12
|
export let title: string;
|
|
8
13
|
export { BlogPostSummary as component };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordpress.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/cms/wordpress.stories.js"],"names":[],"mappings":"AA8BA,oFAsCC;AAED,iFAEC
|
|
1
|
+
{"version":3,"file":"wordpress.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/cms/wordpress.stories.js"],"names":[],"mappings":"AA8BA,oFAsCC;AAED,iFAEC;;;;AAID,6FAEC;;;;;;;;;;;gCA7E6C,uCAAuC"}
|