@marvalt/wparser 0.1.55 → 0.1.56
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.cjs +28 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +28 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/registry/defaultRegistry.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2746,6 +2746,34 @@ function createDefaultRegistry(colorMapper, spacingConfig) {
|
|
|
2746
2746
|
// Default fallback if height not found
|
|
2747
2747
|
return jsxRuntimeExports.jsx("div", { style: { height: '100px' }, "aria-hidden": "true" });
|
|
2748
2748
|
},
|
|
2749
|
+
// Site Logo block - renders site logo from WordPress settings
|
|
2750
|
+
'core/site-logo': ({ block, context }) => {
|
|
2751
|
+
const attrs = block.attributes || {};
|
|
2752
|
+
const width = attrs['width'];
|
|
2753
|
+
// Try to get logo from site settings (if available in context)
|
|
2754
|
+
// For now, render innerHTML which WordPress provides
|
|
2755
|
+
if (block.innerHTML) {
|
|
2756
|
+
return jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: block.innerHTML } });
|
|
2757
|
+
}
|
|
2758
|
+
// Fallback: render empty div (logo will be handled by app-level components)
|
|
2759
|
+
return jsxRuntimeExports.jsx("div", { className: "site-logo", style: width ? { width: `${width}px` } : undefined });
|
|
2760
|
+
},
|
|
2761
|
+
// Navigation block - renders WordPress navigation menu
|
|
2762
|
+
'core/navigation': ({ block, context }) => {
|
|
2763
|
+
const attrs = block.attributes || {};
|
|
2764
|
+
const layout = attrs['layout'];
|
|
2765
|
+
const orientation = layout?.orientation || 'horizontal';
|
|
2766
|
+
const ariaLabel = attrs['ariaLabel'];
|
|
2767
|
+
// Render innerHTML which WordPress provides (contains the menu HTML)
|
|
2768
|
+
if (block.innerHTML) {
|
|
2769
|
+
const navClasses = orientation === 'vertical'
|
|
2770
|
+
? 'flex flex-col space-y-2'
|
|
2771
|
+
: 'flex flex-wrap gap-4';
|
|
2772
|
+
return (jsxRuntimeExports.jsx("nav", { className: navClasses, "aria-label": ariaLabel || 'Navigation', dangerouslySetInnerHTML: { __html: block.innerHTML } }));
|
|
2773
|
+
}
|
|
2774
|
+
// Fallback: render empty nav
|
|
2775
|
+
return jsxRuntimeExports.jsx("nav", { className: "flex flex-wrap gap-4", "aria-label": ariaLabel || 'Navigation' });
|
|
2776
|
+
},
|
|
2749
2777
|
};
|
|
2750
2778
|
return {
|
|
2751
2779
|
renderers,
|