UNPKG

@builder.io/sdk-vue

Version:
76 lines (75 loc) 2.11 kB
import { defineComponent as C, resolveComponent as g, openBlock as $, createBlock as v, createCommentVNode as B } from "vue"; import { _, T, c as h, g as w, a as l, b as k, d as I, e as N } from "./index-8E5G8ahg.js"; const z = C({ name: "block-styles", components: { InlinedStyles: _ }, props: ["block", "context"], data() { return { TARGET: T }; }, computed: { canShowBlock() { const e = this.block; return h(e.hide) ? !e.hide : h(e.show) ? e.show : !0; }, css() { var p, u, y; const e = this.block, s = e.responsiveStyles, n = this.context.content, c = w( ((p = n == null ? void 0 : n.meta) == null ? void 0 : p.breakpoints) || {} ), r = 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 = r ? l({ className: o, styles: r }) : "", f = i ? l({ className: o, styles: i, mediaQuery: k( "medium", c ) }) : "", b = a ? l({ className: o, styles: a, mediaQuery: k( "small", c ) }) : "", 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 ${I( t.easing )}`, transitionDelay: t.delay ? `${t.delay}s` : "0s" } }) || ""; } return [ S, f, b, d ].join(" "); } } }); function A(e, s, n, c, r, 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 D = /* @__PURE__ */ N(z, [["render", A]]); export { D as default };