@morphika/andami 0.2.24 → 0.2.25
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.
|
@@ -7,7 +7,7 @@ import type { DeviceViewport } from "../../lib/builder/types";
|
|
|
7
7
|
import SectionV2Canvas from "./SectionV2Canvas";
|
|
8
8
|
import CoverRowResizeHandle from "./CoverRowResizeHandle";
|
|
9
9
|
import { DEVICE_HEIGHTS } from "../../lib/builder/types";
|
|
10
|
-
import {
|
|
10
|
+
import { adminAssetUrl } from "../../lib/assets";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* CoverSectionCanvas — renders a CoverSection in the builder canvas.
|
|
@@ -51,7 +51,6 @@ export default function CoverSectionCanvas({
|
|
|
51
51
|
const store = useBuilderStore();
|
|
52
52
|
const activeViewport = store.activeViewport || "desktop";
|
|
53
53
|
const previewMode = store.previewMode;
|
|
54
|
-
const assetUrl = useAssetUrl();
|
|
55
54
|
const [isSectionHovered, setIsSectionHovered] = useState(false);
|
|
56
55
|
|
|
57
56
|
const vhPixels = DEVICE_HEIGHTS[activeViewport];
|
|
@@ -59,7 +58,10 @@ export default function CoverSectionCanvas({
|
|
|
59
58
|
const containerHeight = Math.round(vhPixels * heightMultiplier);
|
|
60
59
|
|
|
61
60
|
const bgImageUrl = section.background_type === "image" && section.background_image
|
|
62
|
-
?
|
|
61
|
+
? adminAssetUrl(section.background_image)
|
|
62
|
+
: null;
|
|
63
|
+
const bgVideoUrl = section.background_type === "video" && section.background_video
|
|
64
|
+
? adminAssetUrl(section.background_video)
|
|
63
65
|
: null;
|
|
64
66
|
|
|
65
67
|
const effectiveRows = useMemo(
|
|
@@ -135,27 +137,37 @@ export default function CoverSectionCanvas({
|
|
|
135
137
|
className="relative"
|
|
136
138
|
style={{ height: containerHeight }}
|
|
137
139
|
>
|
|
138
|
-
{/* Background preview —
|
|
140
|
+
{/* Background preview — image */}
|
|
139
141
|
{bgImageUrl && (
|
|
140
142
|
<div
|
|
141
|
-
className="absolute inset-0 pointer-events-none"
|
|
143
|
+
className="absolute inset-0 bg-cover bg-center pointer-events-none"
|
|
142
144
|
style={{
|
|
143
|
-
backgroundImage: `url(${bgImageUrl})`,
|
|
145
|
+
backgroundImage: `url("${bgImageUrl}")`,
|
|
144
146
|
backgroundSize: section.background_size || "cover",
|
|
145
147
|
backgroundPosition: section.background_position || "center center",
|
|
146
|
-
opacity: 0.
|
|
147
|
-
overflow: "hidden",
|
|
148
|
+
opacity: 0.12,
|
|
148
149
|
}}
|
|
149
150
|
/>
|
|
150
151
|
)}
|
|
152
|
+
|
|
153
|
+
{/* Background preview — video */}
|
|
154
|
+
{bgVideoUrl && (
|
|
155
|
+
<video
|
|
156
|
+
src={bgVideoUrl}
|
|
157
|
+
muted
|
|
158
|
+
playsInline
|
|
159
|
+
autoPlay
|
|
160
|
+
loop
|
|
161
|
+
className="absolute inset-0 w-full h-full object-cover pointer-events-none"
|
|
162
|
+
style={{ opacity: 0.12 }}
|
|
163
|
+
/>
|
|
164
|
+
)}
|
|
165
|
+
|
|
166
|
+
{/* Background preview — solid color */}
|
|
151
167
|
{section.background_type === "color" && section.background_color && (
|
|
152
168
|
<div
|
|
153
169
|
className="absolute inset-0 pointer-events-none"
|
|
154
|
-
style={{
|
|
155
|
-
backgroundColor: section.background_color,
|
|
156
|
-
opacity: 0.25,
|
|
157
|
-
overflow: "hidden",
|
|
158
|
-
}}
|
|
170
|
+
style={{ backgroundColor: section.background_color, opacity: 0.25 }}
|
|
159
171
|
/>
|
|
160
172
|
)}
|
|
161
173
|
|
package/lib/version.ts
CHANGED
package/package.json
CHANGED