@dndbuilder.com/react
Version:
Drag and drop builder for React
70 lines (69 loc) • 2.03 kB
JavaScript
import { generatePseudoStyle as k, generateResponsiveStyle as h, generateTypography as B, generateSpacingValue as p } from "../../utils/style.js";
import { lazy as r } from "react";
import { CiLink as C } from "../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/ci/index.js";
import { BlockGroup as L, BlockType as S } from "../../types/block.js";
import { createBlockConfig as b } from "../../../../../utils.js";
const A = b({
type: S.LINK,
label: "Link",
icon: C,
component: r(() => import("./components/link.block.js")),
group: L.BASIC,
settings: {
text: { en: "Click Here" }
},
style: ({ settings: o, breakpoints: e }) => ({
"& .link-block": {
"& > a": {
display: "block",
...B(e, o.typography),
transition: o.transitionDuration ? `color ${o.transitionDuration}ms ease-in-out` : void 0,
...h(e, (t) => {
var i, a, l;
const {
top: n,
right: m,
bottom: g,
left: c
} = p((i = o.padding) == null ? void 0 : i[t]), {
top: d,
right: f,
bottom: y,
left: u
} = p((a = o.margin) == null ? void 0 : a[t]);
return {
textAlign: (l = o.alignment) == null ? void 0 : l[t],
marginTop: d,
marginRight: f,
marginBottom: y,
marginLeft: u,
paddingTop: n,
paddingRight: m,
paddingBottom: g,
paddingLeft: c
};
}),
...k((t) => {
var n;
return {
color: (n = o.color) == null ? void 0 : n[t]
};
})
}
}
}),
controls: [
{
label: "Content",
component: r(() => import("./components/link-content-control.js"))
},
{
label: "Style",
component: r(() => import("./components/link-style-control.js"))
}
]
});
export {
A as default
};
//# sourceMappingURL=link.config.js.map