lib-pixelbuild 0.4.2 → 0.4.3

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.
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
- import { ComponentShell } from '../ui/PbComponentShell.js';
4
3
  import { ElementFactory } from '../factories/ElementFactory.js';
5
4
  import { orderBySort } from '../utils/orderBySort.js';
6
5
  import { getString } from '../utils/propertyUtils.js';
@@ -17,6 +16,7 @@ const HeroComponent = memo(function HeroComponent({ component }) {
17
16
  : 0.5;
18
17
  const contentAlign = getString(properties, 'contentAlign', 'center');
19
18
  const contentVerticalAlign = getString(properties, 'contentVerticalAlign', 'center');
19
+ const contentPadding = getString(properties, 'contentPadding', '');
20
20
  const elements = useMemo(() => orderBySort(component.elements), [component.elements]);
21
21
  const justifyContent = contentAlign === 'left' ? 'flex-start' : contentAlign === 'right' ? 'flex-end' : 'center';
22
22
  const alignItems = contentVerticalAlign === 'top' ? 'flex-start' : contentVerticalAlign === 'bottom' ? 'flex-end' : 'center';
@@ -30,6 +30,8 @@ const HeroComponent = memo(function HeroComponent({ component }) {
30
30
  alignItems: justifyContent,
31
31
  textAlign: contentAlign === 'left' || contentAlign === 'right' ? contentAlign : 'center'
32
32
  };
33
+ if (contentPadding)
34
+ contentStyle.padding = contentPadding;
33
35
  const media = useMemo(() => {
34
36
  if (mediaType === 'video' && mediaSrc) {
35
37
  return (_jsx("video", { autoPlay: true, muted: true, loop: true, playsInline: true, src: mediaSrc, poster: mediaPoster || undefined, style: { position: 'absolute', inset: 0, width: '100%', height: '100%', objectFit: 'cover' } }));
@@ -46,6 +48,6 @@ const HeroComponent = memo(function HeroComponent({ component }) {
46
48
  backgroundColor: overlayColor,
47
49
  opacity: overlayOpacity
48
50
  } }));
49
- return (_jsx(ComponentShell, { component: component, outer: "div", children: _jsxs("div", { style: { position: 'relative', overflow: 'hidden', minHeight }, children: [media, overlay, _jsx("div", { style: contentStyle, children: elements.map((element) => elementFactory.build(element)) })] }) }));
51
+ return (_jsx("div", { "data-pb-component": component.id, style: component.styles, children: _jsxs("div", { style: { position: 'relative', overflow: 'hidden', minHeight }, children: [media, overlay, _jsx("div", { style: contentStyle, children: elements.map((element) => elementFactory.build(element)) })] }) }));
50
52
  });
51
53
  export { HeroComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lib-pixelbuild",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "engines": {
5
5
  "node": "^24.0.0",
6
6
  "npm": ">=10"