Skip to content

Commit 7086ea3

Browse files
committed
feat: enhance Builder components with additional style properties and improved element handling
1 parent a83771b commit 7086ea3

File tree

6 files changed

+457
-207
lines changed

6 files changed

+457
-207
lines changed

modules/CMS/resources/js/components/builder/builder-dom.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ export type BuilderElementStyleValues = {
88
color: string;
99
fontSize: string;
1010
fontWeight: string;
11+
height: string;
1112
marginBottom: string;
13+
marginLeft: string;
14+
marginRight: string;
1215
marginTop: string;
16+
opacity: string;
1317
paddingBottom: string;
1418
paddingLeft: string;
1519
paddingRight: string;
1620
paddingTop: string;
1721
textAlign: string;
22+
width: string;
1823
};
1924

2025
export type BuilderEditableElement = {
@@ -77,13 +82,18 @@ const DEFAULT_STYLE_VALUES: BuilderElementStyleValues = {
7782
color: '',
7883
fontSize: '',
7984
fontWeight: '',
85+
height: '',
8086
marginBottom: '',
87+
marginLeft: '',
88+
marginRight: '',
8189
marginTop: '',
90+
opacity: '',
8291
paddingBottom: '',
8392
paddingLeft: '',
8493
paddingRight: '',
8594
paddingTop: '',
8695
textAlign: '',
96+
width: '',
8797
};
8898

8999
function parseHtml(html: string): HTMLDivElement {
@@ -138,13 +148,18 @@ function readStyleValues(element: HTMLElement): BuilderElementStyleValues {
138148
color: element.style.color,
139149
fontSize: element.style.fontSize,
140150
fontWeight: element.style.fontWeight,
151+
height: element.style.height,
141152
marginBottom: element.style.marginBottom,
153+
marginLeft: element.style.marginLeft,
154+
marginRight: element.style.marginRight,
142155
marginTop: element.style.marginTop,
156+
opacity: element.style.opacity,
143157
paddingBottom: element.style.paddingBottom,
144158
paddingLeft: element.style.paddingLeft,
145159
paddingRight: element.style.paddingRight,
146160
paddingTop: element.style.paddingTop,
147161
textAlign: element.style.textAlign,
162+
width: element.style.width,
148163
};
149164
}
150165

modules/CMS/resources/js/components/builder/builder-header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function BuilderHeader({
6161
onRedo,
6262
}: BuilderHeaderProps) {
6363
return (
64-
<header className="flex h-[42px] shrink-0 items-center border-b border-border/70 bg-background/95 px-2 backdrop-blur">
64+
<header className="flex h-[42px] shrink-0 items-center border-b border-border/60 bg-background px-2">
6565
{/* Left section: Back + Panel toggle */}
6666
<div className="flex items-center gap-1">
6767
<Tooltip>

0 commit comments

Comments
 (0)