@marvalt/wparser 0.1.70 → 0.1.72

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 CHANGED
@@ -1886,12 +1886,18 @@ function extractAlignment(block) {
1886
1886
  }
1887
1887
  /**
1888
1888
  * Extract overlay color from cover block
1889
+ * Checks both customOverlayColor (hex) and overlayColor (theme color name)
1889
1890
  */
1890
1891
  function extractOverlayColor(block) {
1891
1892
  const attrs = block.attributes || {};
1893
+ // Priority: customOverlayColor (hex) > overlayColor (theme color name)
1894
+ const customOverlayColor = attrs['customOverlayColor'];
1895
+ if (typeof customOverlayColor === 'string' && customOverlayColor.trim()) {
1896
+ return customOverlayColor.trim();
1897
+ }
1892
1898
  const overlayColor = attrs['overlayColor'];
1893
- if (typeof overlayColor === 'string') {
1894
- return overlayColor;
1899
+ if (typeof overlayColor === 'string' && overlayColor.trim()) {
1900
+ return overlayColor.trim();
1895
1901
  }
1896
1902
  return null;
1897
1903
  }
@@ -2169,10 +2175,15 @@ function parseContentPosition(contentPosition) {
2169
2175
  horizontal = 'center';
2170
2176
  vertical = part2;
2171
2177
  }
2178
+ else if (part2 === 'left' || part2 === 'right') {
2179
+ // WordPress format: "center right" -> vertical=center, horizontal=right
2180
+ vertical = 'center';
2181
+ horizontal = part2;
2182
+ }
2172
2183
  else {
2173
- // "center center" or "center left/right" -> both center or horizontal=center
2184
+ // "center center" -> both center
2174
2185
  horizontal = 'center';
2175
- vertical = (part2 === 'top' || part2 === 'bottom' ? part2 : 'center');
2186
+ vertical = 'center';
2176
2187
  }
2177
2188
  }
2178
2189
  else {