@builder.io/sdk-vue
Version:
Builder.io SDK for Vue
77 lines (76 loc) • 2.19 kB
JavaScript
import { defineComponent as C, resolveComponent as g, openBlock as $, createBlock as v, createCommentVNode as B } from "vue";
import { _, g as T, c as l, a as h, b as w, d as I } from "./index-dZfvXbI_.js";
import { T as N, e as k } from "./should-force-browser-runtime-in-node-ikxWrCvn.js";
const z = C({
name: "block-styles",
components: { InlinedStyles: _ },
props: ["block", "context"],
data() {
return { TARGET: N };
},
computed: {
canShowBlock() {
const e = this.block;
return k(e.hide) ? !e.hide : k(e.show) ? e.show : !0;
},
css() {
var p, u, y;
const e = this.block, s = e.responsiveStyles, n = this.context.content, r = T(
((p = n == null ? void 0 : n.meta) == null ? void 0 : p.breakpoints) || {}
), c = s == null ? void 0 : s.large, i = s == null ? void 0 : s.medium, a = s == null ? void 0 : s.small, o = e.id;
if (!o)
return "";
const S = c ? l({
className: o,
styles: c
}) : "", f = i ? l({
className: o,
styles: i,
mediaQuery: h(
"medium",
r
)
}) : "", b = a ? l({
className: o,
styles: a,
mediaQuery: h(
"small",
r
)
}) : "", t = e.animations && e.animations.find((m) => m.trigger === "hover");
let d = "";
if (t) {
const m = ((y = (u = t.steps) == null ? void 0 : u[1]) == null ? void 0 : y.styles) || {};
d = l({
className: `${o}:hover`,
styles: {
...m,
transition: `all ${t.duration}s ${w(
t.easing
)}`,
transitionDelay: t.delay ? `${t.delay}s` : "0s"
}
}) || "";
}
return [
S,
f,
b,
d
].join(" ");
}
}
});
function A(e, s, n, r, c, i) {
const a = g("InlinedStyles");
return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? ($(), v(a, {
key: 0,
id: "builderio-block",
styles: e.css,
nonce: e.context.nonce
}, null, 8, ["styles", "nonce"])) : B("", !0);
}
const E = /* @__PURE__ */ I(z, [["render", A]]);
export {
E as default
};