lib-pixelbuild 0.4.2 → 0.4.4

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 };
@@ -25,10 +25,15 @@ const BlockGrid = memo(function BlockGrid({ block, editionMode, componentDefault
25
25
  const sm = ((_b = component.width) === null || _b === void 0 ? void 0 : _b.sm) || xs;
26
26
  const md = ((_c = component.width) === null || _c === void 0 ? void 0 : _c.md) || sm;
27
27
  const cls = gridClass(component.id);
28
+ let base = `.${grid} .${cls}{grid-column:span ${xs};grid-row:auto;min-width:0}`;
29
+ const mobileOrder = properties.mobileOrder;
30
+ if (mobileOrder !== undefined && mobileOrder !== null && mobileOrder !== '') {
31
+ base = `.${grid} .${cls}{grid-column:span ${xs};grid-row:auto;min-width:0;order:${mobileOrder}}`;
32
+ }
28
33
  return [
29
- `.${grid} .${cls}{grid-column:span ${xs};grid-row:auto;min-width:0}`,
34
+ base,
30
35
  `@media (min-width:576px){.${grid} .${cls}{grid-column:span ${sm}}}`,
31
- `@media (min-width:768px){.${grid} .${cls}{grid-column:span ${md};grid-row:${row + 1}/span ${rowSpan}}}`
36
+ `@media (min-width:768px){.${grid} .${cls}{grid-column:span ${md};grid-row:${row + 1}/span ${rowSpan};order:0}}`
32
37
  ].join('');
33
38
  })
34
39
  .join('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lib-pixelbuild",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "engines": {
5
5
  "node": "^24.0.0",
6
6
  "npm": ">=10"