@pixelated-tech/components 3.2.10 → 3.2.12
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 +6 -3
- package/README.md +27 -21
- package/dist/components/cms/cloudinary.image.js +4 -4
- package/dist/components/cms/gravatar.css +8 -0
- package/dist/components/cms/wordpress.components.js +3 -3
- package/dist/components/cms/wordpress.functions.js +30 -1
- package/dist/components/menu/menu-expando.css +16 -11
- package/dist/components/menu/menu-expando.js +2 -2
- package/dist/components/pagebuilder/form/form.js +2 -1
- 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/components/cms/wordpress.functions.d.ts +6 -0
- package/dist/types/components/cms/wordpress.functions.d.ts.map +1 -1
- package/dist/types/components/pagebuilder/form/form.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/dist/types/tests/wordpress.functions.test.d.ts +2 -0
- package/dist/types/tests/wordpress.functions.test.d.ts.map +1 -0
- package/package.json +2 -2
package/README.COMPONENTS.md
CHANGED
|
@@ -315,9 +315,11 @@ import { SmartImage } from '@pixelated-tech/components';
|
|
|
315
315
|
|
|
316
316
|
### WordPress Components
|
|
317
317
|
|
|
318
|
+
WordPress integration components with automatic Photon CDN URL processing for optimized image delivery.
|
|
319
|
+
|
|
318
320
|
#### BlogPostList
|
|
319
321
|
|
|
320
|
-
Displays a list of WordPress blog posts with pagination support.
|
|
322
|
+
Displays a list of WordPress blog posts with pagination support. Automatically converts WordPress Photon CDN URLs to direct image URLs for better Next.js optimization.
|
|
321
323
|
|
|
322
324
|
```tsx
|
|
323
325
|
import { BlogPostList } from '@pixelated-tech/components';
|
|
@@ -332,9 +334,10 @@ import { BlogPostList } from '@pixelated-tech/components';
|
|
|
332
334
|
|
|
333
335
|
| Prop | Type | Default | Description |
|
|
334
336
|
|------|------|---------|-------------|
|
|
335
|
-
| `site` | `string` | - | WordPress site
|
|
337
|
+
| `site` | `string` | - | WordPress site identifier (e.g., 'blog.pixelated.tech' or 'your-blog.wordpress.com') |
|
|
336
338
|
| `count` | `number` | - | Number of posts to fetch (undefined = all) |
|
|
337
339
|
| `posts` | `BlogPostType[]` | - | Pre-fetched posts array |
|
|
340
|
+
| `showCategories` | `boolean` | `true` | Whether to display post categories |
|
|
338
341
|
|
|
339
342
|
#### BlogPostSummary
|
|
340
343
|
|
|
@@ -1426,4 +1429,4 @@ When adding new components, please:
|
|
|
1426
1429
|
|
|
1427
1430
|
---
|
|
1428
1431
|
|
|
1429
|
-
*This documentation is automatically updated when components are modified. Last updated:
|
|
1432
|
+
*This documentation is automatically updated when components are modified. Last updated: December 17, 2025*
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<h3 align="center">Pixelated Components</h3>
|
|
19
19
|
|
|
20
20
|
<p align="center">
|
|
21
|
-
|
|
21
|
+
A comprehensive React component library for modern web development, featuring CMS integrations, UI components, and SEO optimization tools.
|
|
22
22
|
<br />
|
|
23
23
|
<a href="https://github.com/brianwhaley/pixelated-components"><strong>Explore the docs »</strong></a>
|
|
24
24
|
<br />
|
|
@@ -107,7 +107,7 @@ Reusable UI components for common patterns:
|
|
|
107
107
|
|
|
108
108
|
### CMS Integration
|
|
109
109
|
Headless CMS and content management components:
|
|
110
|
-
- **WordPress** - Blog post integration and display
|
|
110
|
+
- **WordPress** - Blog post integration and display with automatic Photon CDN URL processing
|
|
111
111
|
- **Contentful** - Headless CMS components and utilities
|
|
112
112
|
- **PageBuilder** - Dynamic page construction from JSON
|
|
113
113
|
- **PageEngine** - Advanced page rendering with Contentful integration
|
|
@@ -173,18 +173,17 @@ npm run storybook
|
|
|
173
173
|
|
|
174
174
|
### Overview
|
|
175
175
|
|
|
176
|
-
**Current Status**: ✅ 2,
|
|
176
|
+
**Current Status**: ✅ 2,184 tests passing across 59 test files (7 skipped)
|
|
177
177
|
|
|
178
178
|
| Metric | Value |
|
|
179
179
|
|--------|-------|
|
|
180
|
-
| Test Files |
|
|
181
|
-
| Total Tests | 2,
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
| Coverage (
|
|
185
|
-
| Coverage (
|
|
186
|
-
| Coverage (
|
|
187
|
-
| Coverage (Branches) | 57.62% |
|
|
180
|
+
| Test Files | 59 |
|
|
181
|
+
| Total Tests | 2,184 |
|
|
182
|
+
| Skipped Tests | 7 |
|
|
183
|
+
| Coverage (Statements) | 79.26% |
|
|
184
|
+
| Coverage (Lines) | 82.73% |
|
|
185
|
+
| Coverage (Functions) | 84.73% |
|
|
186
|
+
| Coverage (Branches) | 67.19% |
|
|
188
187
|
| Test Framework | Vitest 4.x |
|
|
189
188
|
| Testing Library | @testing-library/react + jsdom |
|
|
190
189
|
|
|
@@ -199,13 +198,13 @@ npm run test:run # Single run (for CI)
|
|
|
199
198
|
|
|
200
199
|
### Component Coverage
|
|
201
200
|
|
|
202
|
-
**
|
|
201
|
+
**52 of 52 Frontend Components + 2 Utility Modules Fully Tested (100%)**
|
|
203
202
|
|
|
204
203
|
#### Component Coverage (Sorted by Statement Coverage)
|
|
205
204
|
- **sitemap.ts**: 100% statements
|
|
206
205
|
- **google.reviews.functions.ts**: 100% statements
|
|
207
206
|
- **googlesearch.tsx**: 100% statements
|
|
208
|
-
- **formvalidations.tsx**: 100% statements
|
|
207
|
+
- **formvalidations.tsx**: 100% statements
|
|
209
208
|
- **tiles.tsx**: 100% statements
|
|
210
209
|
- **markdown.tsx**: 100% statements
|
|
211
210
|
- **buzzwordbingo.tsx**: 100% statements
|
|
@@ -217,15 +216,16 @@ npm run test:run # Single run (for CI)
|
|
|
217
216
|
- **sidepanel.tsx**: 97.5% statements
|
|
218
217
|
- **resume.tsx**: 94.38% statements
|
|
219
218
|
- **callout.tsx**: 93.75% statements
|
|
220
|
-
- **contentful.delivery.ts**: 92.5% statements
|
|
219
|
+
- **contentful.delivery.ts**: 92.5% statements
|
|
221
220
|
- **css.tsx**: 91.42% statements
|
|
222
221
|
- **functions.ts**: 90.9% statements
|
|
223
222
|
- **config.client.tsx**: 90% statements
|
|
224
223
|
- **api.ts**: 87.5% statements
|
|
225
224
|
- **loading.tsx**: 85.71% statements
|
|
226
|
-
- **table.tsx**: 84.48% statements
|
|
227
|
-
- **cloudinary.ts**: 83.33% statements
|
|
225
|
+
- **table.tsx**: 84.48% statements
|
|
226
|
+
- **cloudinary.ts**: 83.33% statements
|
|
228
227
|
- **shoppingcart.functions.ts**: 81.69% statements
|
|
228
|
+
- **carousel.tsx**: 76.19% statements
|
|
229
229
|
- **nerdjoke.tsx**: 70.58% statements
|
|
230
230
|
- **menu-accordion.tsx**: 68.13% statements
|
|
231
231
|
- **carousel.tsx**: 58.49% statements
|
|
@@ -233,11 +233,17 @@ npm run test:run # Single run (for CI)
|
|
|
233
233
|
|
|
234
234
|
### Test Configuration
|
|
235
235
|
|
|
236
|
-
**Coverage
|
|
237
|
-
- **Statements**:
|
|
238
|
-
- **Lines**:
|
|
239
|
-
- **Functions**:
|
|
240
|
-
- **Branches**:
|
|
236
|
+
**Coverage Summary (latest run)**:
|
|
237
|
+
- **Statements**: 79.26%
|
|
238
|
+
- **Lines**: 82.73%
|
|
239
|
+
- **Functions**: 84.73%
|
|
240
|
+
- **Branches**: 67.19%
|
|
241
|
+
|
|
242
|
+
**Coverage Targets** (configured in `vitest.config.ts`):
|
|
243
|
+
- **Statements**: 70% threshold
|
|
244
|
+
- **Lines**: 70% threshold
|
|
245
|
+
- **Functions**: 70% threshold
|
|
246
|
+
- **Branches**: 60% threshold
|
|
241
247
|
|
|
242
248
|
**Coverage Thresholds in vitest.config.ts**:
|
|
243
249
|
- Lines: 70% threshold
|
|
@@ -88,20 +88,20 @@ export function SmartImage(props) {
|
|
|
88
88
|
// if(Array.isArray(src))
|
|
89
89
|
const finalSrc = newProps.cloudinaryEnv
|
|
90
90
|
? buildCloudinaryUrl({
|
|
91
|
-
src: src,
|
|
91
|
+
src: newProps.src,
|
|
92
92
|
productEnv: newProps.cloudinaryEnv,
|
|
93
93
|
cloudinaryDomain: newProps.cloudinaryDomain,
|
|
94
94
|
quality,
|
|
95
95
|
width: newProps.width ?? undefined,
|
|
96
96
|
transforms: newProps.cloudinaryTransforms ?? undefined
|
|
97
97
|
})
|
|
98
|
-
: String(src);
|
|
98
|
+
: String(newProps.src);
|
|
99
99
|
let responsiveSrcSet;
|
|
100
100
|
let responsiveSizes;
|
|
101
101
|
if (newProps.cloudinaryEnv) {
|
|
102
102
|
if (newProps.width) {
|
|
103
103
|
const widths = [Math.ceil(newProps.width * 0.5), newProps.width, Math.ceil(newProps.width * 1.5), Math.ceil(newProps.width * 2)];
|
|
104
|
-
responsiveSrcSet = generateSrcSet(String(src), newProps.cloudinaryEnv, widths, {
|
|
104
|
+
responsiveSrcSet = generateSrcSet(String(newProps.src), newProps.cloudinaryEnv, widths, {
|
|
105
105
|
quality,
|
|
106
106
|
transforms: newProps.cloudinaryTransforms ?? undefined,
|
|
107
107
|
cloudinaryDomain: newProps.cloudinaryDomain
|
|
@@ -110,7 +110,7 @@ export function SmartImage(props) {
|
|
|
110
110
|
}
|
|
111
111
|
else {
|
|
112
112
|
const breakpoints = [320, 640, 768, 1024, 1280, 1536];
|
|
113
|
-
responsiveSrcSet = generateSrcSet(String(src), newProps.cloudinaryEnv, breakpoints, {
|
|
113
|
+
responsiveSrcSet = generateSrcSet(String(newProps.src), newProps.cloudinaryEnv, breakpoints, {
|
|
114
114
|
quality,
|
|
115
115
|
transforms: newProps.cloudinaryTransforms ?? undefined,
|
|
116
116
|
cloudinaryDomain: newProps.cloudinaryDomain
|
|
@@ -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) {
|
|
@@ -25,7 +25,12 @@ export async function getWordPressItems(props) {
|
|
|
25
25
|
if (batch.length === 0) {
|
|
26
26
|
break; // no more posts
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
// Process Photon URLs in featured images
|
|
29
|
+
const processedBatch = batch.map(post => ({
|
|
30
|
+
...post,
|
|
31
|
+
featured_image: post.featured_image ? photonToOriginalUrl(post.featured_image) : post.featured_image
|
|
32
|
+
}));
|
|
33
|
+
posts.push(...processedBatch);
|
|
29
34
|
if (requested && posts.length >= requested) {
|
|
30
35
|
break; // collected enough
|
|
31
36
|
}
|
|
@@ -103,3 +108,27 @@ export async function getWordPressCategories(props) {
|
|
|
103
108
|
}
|
|
104
109
|
return categories; // Return the complete list of categories
|
|
105
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Convert a WordPress Photon CDN URL to the original direct image URL
|
|
113
|
+
* @param photonUrl - The Photon CDN URL (e.g., https://i0.wp.com/domain.com/path)
|
|
114
|
+
* @returns The original direct image URL (e.g., https://domain.com/path)
|
|
115
|
+
*/
|
|
116
|
+
export function photonToOriginalUrl(photonUrl) {
|
|
117
|
+
if (typeof photonUrl !== 'string' || !photonUrl.includes('i0.wp.com/')) {
|
|
118
|
+
return photonUrl; // Return unchanged if not a Photon URL
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
// Photon URL format: https://i0.wp.com/domain.com/path/to/image.jpg?params
|
|
122
|
+
// Extract original: https://domain.com/path/to/image.jpg
|
|
123
|
+
const photonUrlObj = new URL(photonUrl);
|
|
124
|
+
const pathWithoutLeadingSlash = photonUrlObj.pathname.slice(1); // Remove leading /
|
|
125
|
+
const firstSlashIndex = pathWithoutLeadingSlash.indexOf('/');
|
|
126
|
+
const domain = pathWithoutLeadingSlash.slice(0, firstSlashIndex);
|
|
127
|
+
const path = pathWithoutLeadingSlash.slice(firstSlashIndex);
|
|
128
|
+
return `https://${domain}${path}`;
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
console.warn('Failed to parse Photon URL:', photonUrl, e);
|
|
132
|
+
return photonUrl; // Return original on error
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
display: inline-block;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
details.
|
|
11
|
+
details.menu-expando-wrapper {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
details.
|
|
15
|
+
details.menu-expando-wrapper > summary {
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
user-select: none;
|
|
18
18
|
background: #336699;
|
|
@@ -24,26 +24,31 @@ details.menuExpandoWrapper > summary {
|
|
|
24
24
|
transition: background 0.3s ease;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
details.menu-expando-wrapper > summary:hover {
|
|
28
29
|
background: #2d5a8a;
|
|
29
30
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
details.
|
|
33
|
+
|
|
34
|
+
details.menu-expando-wrapper > summary::marker,
|
|
35
|
+
details.menu-expando-wrapper > summary::-webkit-details-marker {
|
|
34
36
|
display: none;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
|
|
40
|
+
details.menu-expando-wrapper > summary::before {
|
|
38
41
|
content: '▼';
|
|
39
42
|
display: inline-block;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
|
|
46
|
+
details.menu-expando-wrapper[open] > summary::before {
|
|
43
47
|
content: '▲';
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
|
|
51
|
+
details.menu-expando-wrapper ul {
|
|
47
52
|
margin-top: 10px;
|
|
48
53
|
padding-left: 20px;
|
|
49
54
|
list-style: none;
|
|
@@ -51,17 +56,17 @@ details.menuExpandoWrapper ul {
|
|
|
51
56
|
max-height: 1000px;
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
details.
|
|
59
|
+
details.menu-expando-wrapper li {
|
|
55
60
|
margin: 5px 0;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
details.
|
|
63
|
+
details.menu-expando-wrapper a {
|
|
59
64
|
color: #333;
|
|
60
65
|
text-decoration: none;
|
|
61
66
|
transition: color 0.2s ease;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
details.
|
|
69
|
+
details.menu-expando-wrapper a:hover {
|
|
65
70
|
color: #336699;
|
|
66
71
|
text-decoration: underline;
|
|
67
72
|
}
|
|
@@ -109,7 +109,7 @@ export function MenuExpando(props) {
|
|
|
109
109
|
}
|
|
110
110
|
return myItems;
|
|
111
111
|
}
|
|
112
|
-
return (_jsx("div", { className: "menuExpando", id: "menuExpando", children: _jsxs("details", { className: "
|
|
112
|
+
return (_jsx("div", { className: "menuExpando", id: "menuExpando", children: _jsxs("details", { className: "menu-expando-wrapper", id: "menu-expando-wrapper", ref: detailsRef, children: [_jsx("summary", {}), _jsx("ul", { ref: ulRef, children: generateMenuItems() })] }) }));
|
|
113
113
|
}
|
|
114
114
|
MenuExpando.propTypes = {
|
|
115
115
|
menuItems: PropTypes.oneOfType([
|
|
@@ -132,7 +132,7 @@ export function MenuExpandoButton() {
|
|
|
132
132
|
function handleMenuExpandoButtonClick(event) {
|
|
133
133
|
event.preventDefault();
|
|
134
134
|
event.stopPropagation();
|
|
135
|
-
const details = document.getElementById('
|
|
135
|
+
const details = document.getElementById('menu-expando-wrapper');
|
|
136
136
|
if (details)
|
|
137
137
|
details.open = !details.open;
|
|
138
138
|
}
|
|
@@ -174,7 +174,8 @@ export function FormBuild(props) {
|
|
|
174
174
|
function handlePhaseOneSubmit(event) {
|
|
175
175
|
// GENERATE THE JSON TO DISPLAY A FORM TO ADD A FIELD - EXTERNAL
|
|
176
176
|
const target = event.target;
|
|
177
|
-
const
|
|
177
|
+
const typeElement = target.elements.namedItem('type');
|
|
178
|
+
const myType = typeElement ? typeElement.value : '';
|
|
178
179
|
const myComponent = mapTypeToComponent(myType);
|
|
179
180
|
const fieldJSON = generateFieldJSON(myComponent, myType);
|
|
180
181
|
props.setFormData(fieldJSON);
|
|
@@ -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"}
|
|
@@ -60,4 +60,10 @@ export declare namespace getWordPressCategories {
|
|
|
60
60
|
baseURL: PropTypes.Requireable<string>;
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Convert a WordPress Photon CDN URL to the original direct image URL
|
|
65
|
+
* @param photonUrl - The Photon CDN URL (e.g., https://i0.wp.com/domain.com/path)
|
|
66
|
+
* @returns The original direct image URL (e.g., https://domain.com/path)
|
|
67
|
+
*/
|
|
68
|
+
export declare function photonToOriginalUrl(photonUrl: string): string;
|
|
63
69
|
//# sourceMappingURL=wordpress.functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wordpress.functions.d.ts","sourceRoot":"","sources":["../../../../src/components/cms/wordpress.functions.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWnD,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAC;KACZ,CAAA;IACD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAMF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACnF,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"wordpress.functions.d.ts","sourceRoot":"","sources":["../../../../src/components/cms/wordpress.functions.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWnD,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE;QAChB,GAAG,EAAE,MAAM,CAAC;KACZ,CAAA;IACD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC,CAAC;AAMF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACnF,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,uCAkChG;yBAlCqB,iBAAiB;;;;;;;AAwCvC,MAAM,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAIF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAC7F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,qBAAqB,EAAE,CAuClF;yBAvCe,sBAAsB;;;;;AA8CtC,MAAM,MAAM,oBAAoB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAKF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAC7F,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,8BAerF;yBAfqB,sBAAsB;;;;;;AAiB5C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAkB7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/pagebuilder/form/form.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,YAAY,CAAC;AAcpB,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;AACrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,2CA+D/C;yBA/De,UAAU;;;;;;;;;AAmF1B,wBAAgB,WAAW,4CA4D1B;AAaD,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/pagebuilder/form/form.tsx"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,YAAY,CAAC;AAcpB,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;AACrE,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,2CA+D/C;yBA/De,UAAU;;;;;;;;;AAmF1B,wBAAgB,WAAW,4CA4D1B;AAaD,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,2CAoF7C;yBApFe,SAAS;;;;;AAiGzB,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,2CAyCrD;yBAzCe,aAAa;;;;;AA8C7B,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AACpE,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,2CAmCrD;yBAnCe,aAAa;;;;;AA0C7B,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAC5E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,2CAmL7D;yBAnLe,iBAAiB"}
|
|
@@ -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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wordpress.functions.test.d.ts","sourceRoot":"","sources":["../../../src/tests/wordpress.functions.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixelated-tech/components",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Pixelated Technologies",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@testing-library/react": "^16.3.1",
|
|
97
97
|
"@testing-library/user-event": "^14.6.1",
|
|
98
98
|
"@types/md5": "^2.3.6",
|
|
99
|
-
"@types/node": "^25.0.
|
|
99
|
+
"@types/node": "^25.0.3",
|
|
100
100
|
"@types/prop-types": "^15.7.15",
|
|
101
101
|
"@types/react": "^19.2.7",
|
|
102
102
|
"@types/react-dom": "^19.2.3",
|