+
diff --git a/packages/builder/src/components/userInterface/FlatButtonGroup.svelte b/packages/builder/src/components/userInterface/FlatButtonGroup.svelte
index ffa1a98393..ad1107b1f1 100644
--- a/packages/builder/src/components/userInterface/FlatButtonGroup.svelte
+++ b/packages/builder/src/components/userInterface/FlatButtonGroup.svelte
@@ -27,13 +27,18 @@
}
onChange(val)
}
+
+
+ const checkSelected = val =>
+ isMultiSelect ? value.includes(val) : value === val
+
{#each buttonProps as props}
diff --git a/packages/builder/src/components/userInterface/OptionSelect.svelte b/packages/builder/src/components/userInterface/OptionSelect.svelte
index 4fbedde4ac..d226e6129c 100644
--- a/packages/builder/src/components/userInterface/OptionSelect.svelte
+++ b/packages/builder/src/components/userInterface/OptionSelect.svelte
@@ -1,36 +1,223 @@
-
+
toggleSelect(!open)}>
+
+ {displayLabel}
+
+
+
+
+{#if open}
+
toggleSelect(false)} class="overlay" />
+{/if}
+
+
diff --git a/packages/builder/src/components/userInterface/OptionSelectOld.svelte b/packages/builder/src/components/userInterface/OptionSelectOld.svelte
new file mode 100644
index 0000000000..db3c19de35
--- /dev/null
+++ b/packages/builder/src/components/userInterface/OptionSelectOld.svelte
@@ -0,0 +1,33 @@
+
+
+
diff --git a/packages/builder/src/components/userInterface/PropertyControl.svelte b/packages/builder/src/components/userInterface/PropertyControl.svelte
index 82acb8b3f9..a7ea35c014 100644
--- a/packages/builder/src/components/userInterface/PropertyControl.svelte
+++ b/packages/builder/src/components/userInterface/PropertyControl.svelte
@@ -50,6 +50,9 @@
.label {
flex: 0 0 50px;
+ display: flex;
+ align-items: center;
+ padding: 0px 5px;
font-size: 12px;
font-weight: 400;
text-align: left;
@@ -60,6 +63,7 @@
.control {
flex: 1;
+ display: flex;
padding-left: 2px;
max-width: 164px;
}
diff --git a/packages/builder/src/components/userInterface/PropertyGroup.svelte b/packages/builder/src/components/userInterface/PropertyGroup.svelte
index 6d0cf63ab0..a51607833a 100644
--- a/packages/builder/src/components/userInterface/PropertyGroup.svelte
+++ b/packages/builder/src/components/userInterface/PropertyGroup.svelte
@@ -71,12 +71,16 @@
}
.property-panel {
- height: 0px;
- overflow: hidden;
+ /* height: 0px;
+ overflow: hidden; */
+ display: none;
}
.show {
- overflow: auto;
- height: auto;
+ /* overflow: auto;
+ height: auto; */
+ display: flex;
+ flex-direction: column;
+ flex: 1;
}
diff --git a/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte b/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte
index da57b134a0..d2924675e6 100644
--- a/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte
+++ b/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte
@@ -123,8 +123,7 @@
.components-pane {
grid-column: 3;
background-color: var(--white);
- height: 100vh;
- overflow-y: scroll;
+ height: calc(100vh - 49px);
}
.components-nav-page {
diff --git a/packages/builder/src/components/userInterface/propertyCategories.js b/packages/builder/src/components/userInterface/propertyCategories.js
index 2a81b5fcf7..719396a2fb 100644
--- a/packages/builder/src/components/userInterface/propertyCategories.js
+++ b/packages/builder/src/components/userInterface/propertyCategories.js
@@ -1,6 +1,7 @@
import Input from "../common/Input.svelte"
import OptionSelect from "./OptionSelect.svelte"
import InputGroup from "../common/Inputs/InputGroup.svelte"
+import FlatButtonGroup from "./FlatButtonGroup.svelte"
// import Colorpicker from "../common/Colorpicker.svelte"
/*
TODO: Allow for default values for all properties
@@ -11,9 +12,8 @@ export const layout = [
label: "Display",
key: "display",
control: OptionSelect,
- initialValue: "Select Option",
+ initialValue: "Flex",
options: [
- { label: "Select Option", value: "" },
{ label: "Flex", value: "flex" },
{ label: "Inline Flex", value: "inline-flex" },
],
@@ -21,23 +21,24 @@ export const layout = [
{
label: "Direction",
key: "flex-direction",
- control: OptionSelect,
- initialValue: "Select Option",
- options: [
- { label: "Select Option", value: "" },
- { label: "Row", value: "row" },
- { label: "Row Reverse", value: "rowReverse" },
- { label: "Column", value: "column" },
- { label: "Column Reverse", value: "columnReverse" },
+ control: FlatButtonGroup,
+ buttonProps: [
+ { icon: "ri-arrow-right-line", padding: "0px 5px", value: "row" },
+ { icon: "ri-arrow-left-line", padding: "0px 5px", value: "rowReverse" },
+ { icon: "ri-arrow-down-line", padding: "0px 5px", value: "column" },
+ {
+ icon: "ri-arrow-up-line",
+ padding: "0px 5px",
+ value: "columnReverse",
+ },
],
},
{
label: "Justify",
key: "justify-content",
control: OptionSelect,
- initialValue: "Select Option",
+ initialValue: "Flex Start",
options: [
- { label: "Select Option", value: "" },
{ label: "Flex Start", value: "flex-start" },
{ label: "Flex End", value: "flex-end" },
{ label: "Center", value: "center" },
@@ -50,9 +51,8 @@ export const layout = [
label: "Align",
key: "align-items",
control: OptionSelect,
- initialValue: "Select Option",
+ initialValue: "Flex Start",
options: [
- { label: "Select Option", value: "" },
{ label: "Flex Start", value: "flex-start" },
{ label: "Flex End", value: "flex-end" },
{ label: "Center", value: "center" },
@@ -64,12 +64,9 @@ export const layout = [
label: "Wrap",
key: "flex-wrap",
control: OptionSelect,
- initialValue: "Select Option",
options: [
- { label: "Select Option", value: "" },
- { label: "No Wrap", value: "nowrap" },
- { label: "Wrap", value: "wrap" },
- { label: "Wrap Reverse", value: "wrap-reverse" },
+ { label: "wrap", value: "wrap" },
+ { label: "no wrap", value: "noWrap" },
],
},
]
@@ -82,22 +79,73 @@ const spacingMeta = [
]
export const spacing = [
- { label: "Margin", key: "margin", control: InputGroup, meta: spacingMeta },
+ {
+ label: "Margin",
+ key: "margin",
+ control: InputGroup,
+ meta: spacingMeta,
+ suffix: "px",
+ defaultValue: ["0", "0", "0", "0"],
+ },
{
label: "Padding",
key: "padding",
control: InputGroup,
meta: spacingMeta,
+ suffix: "px",
+ defaultValue: ["0", "0", "0", "0"],
},
]
export const size = [
- { label: "Width", key: "width", control: Input },
- { label: "Height", key: "height", control: Input },
- { label: "Min W", key: "min-width", control: Input },
- { label: "Min H", key: "min-height", control: Input },
- { label: "Max W", key: "max-width", control: Input },
- { label: "Max H", key: "max-height", control: Input },
+ {
+ label: "Width",
+ key: "width",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Height",
+ key: "height",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Min W",
+ key: "min-width",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Min H",
+ key: "min-height",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Max W",
+ key: "max-width",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Max H",
+ key: "max-height",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
]
export const position = [
@@ -118,26 +166,41 @@ export const position = [
label: "Top",
key: "top",
control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
},
{
label: "Right",
key: "right",
control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
},
{
label: "Bottom",
key: "bottom",
control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
},
{
label: "Left",
key: "left",
control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
},
{
label: "Z-index",
key: "z-index",
control: Input,
+ placeholder: "num",
+ width: "48px",
+ textAlign: "center",
},
]
@@ -171,47 +234,59 @@ export const typography = [
label: "Weight",
key: "font-weight",
control: OptionSelect,
- options: [
- { label: "100", value: "100" },
- { label: "200", value: "200" },
- { label: "300", value: "300" },
- { label: "400", value: "400" },
- { label: "500", value: "500" },
- { label: "600", value: "600" },
- { label: "700", value: "700" },
- { label: "800", value: "800" },
- { label: "900", value: "900" },
- ],
+ options: ["normal", "bold", "bolder", "lighter"],
+ },
+ {
+ label: "size",
+ key: "font-size",
+ defaultValue: "",
+ control: Input,
+ placeholder: "px",
+ width: "48px",
+ textAlign: "center",
+ },
+ {
+ label: "Line H",
+ key: "line-height",
+ control: Input,
+ placeholder: "lh",
+ width: "48px",
+ textAlign: "center",
},
- { label: "size", key: "font-size", defaultValue: "", control: Input },
- { label: "Line H", key: "line-height", control: Input },
{
label: "Color",
key: "color",
control: Input,
+ placeholder: "hex",
},
{
label: "align",
key: "text-align",
- control: OptionSelect,
- options: ["initial", "left", "right", "center", "justify"],
- }, //custom
- {
- label: "Decoration",
- key: "text-decoration-line",
- control: OptionSelect,
- defaultValue: "None",
- options: [
- { label: "None", value: "none" },
- { label: "Underline", value: "underline" },
- { label: "Overline", value: "overline" },
- { label: "Line-through", value: "line-through" },
- { label: "Under Over", value: "underline overline" },
+ control: FlatButtonGroup,
+ buttonProps: [
+ { icon: "ri-align-left", padding: "0px 5px", value: "left" },
+ { icon: "ri-align-center", padding: "0px 5px", value: "center" },
+ { icon: "ri-align-right", padding: "0px 5px", value: "right" },
+ { icon: "ri-align-justify", padding: "0px 5px", value: "justify" },
],
},
-
- { label: "transform", key: "text-transform", control: Input }, //custom
- { label: "style", key: "font-style", control: Input }, //custom
+ {
+ label: "transform",
+ key: "text-transform",
+ control: FlatButtonGroup,
+ buttonProps: [
+ { text: "BB", padding: "0px 5px", fontWeight: 500, value: "uppercase" },
+ { text: "Bb", padding: "0px 5px", fontWeight: 500, value: "capitalize" },
+ { text: "bb", padding: "0px 5px", fontWeight: 500, value: "lowercase" },
+ {
+ text: "×",
+ padding: "0px 5px",
+ fontWeight: 500,
+ value: "none",
+ },
+ ],
+ },
+ { label: "style", key: "font-style", control: Input },
]
export const background = [
@@ -220,12 +295,31 @@ export const background = [
key: "background",
control: Input,
},
- { label: "Image", key: "image", control: Input }, //custom
+ {
+ label: "Image",
+ key: "background-image",
+ control: Input,
+ placeholder: "src",
+ },
]
export const border = [
- { label: "Radius", key: "border-radius", control: Input },
- { label: "Width", key: "border-width", control: Input }, //custom
+ {
+ label: "Radius",
+ key: "border-radius",
+ control: Input,
+ width: "48px",
+ placeholder: "px",
+ textAlign: "center",
+ },
+ {
+ label: "Width",
+ key: "border-width",
+ control: Input,
+ width: "48px",
+ placeholder: "px",
+ textAlign: "center",
+ }, //custom
{
label: "Color",
key: "border-color",
@@ -251,30 +345,65 @@ export const border = [
]
export const effects = [
- { label: "Opacity", key: "opacity", control: Input },
+ {
+ label: "Opacity",
+ key: "opacity",
+ control: Input,
+ width: "48px",
+ textAlign: "center",
+ placeholder: "%",
+ },
{
label: "Rotate",
key: "transform",
- control: OptionSelect,
- options: [
- { label: "None", value: "rotate(0deg)" },
- { label: "45 degrees", value: "rotate(45deg)" },
- { label: "90 degrees", value: "rotate(90deg)" },
- { label: "135 degrees", value: "rotate(135deg)" },
- { label: "180 degrees", value: "rotate(180deg)" },
- { label: "225 degrees", value: "rotate(225deg)" },
- { label: "270 degrees", value: "rotate(270deg)" },
- { label: "315 degrees", value: "rotate(315deg)" },
- { label: "360 degrees", value: "rotate(360deg)" },
- ],
+ control: Input,
+ width: "48px",
+ textAlign: "center",
+ placeholder: "deg",
}, //needs special control
- { label: "Shadow", key: "box-shadow", control: Input },
+ {
+ label: "Shadow",
+ key: "box-shadow",
+ control: InputGroup,
+ meta: [{ placeholder: "X" }, { placeholder: "Y" }, { placeholder: "B" }],
+ },
]
export const transitions = [
- { label: "Property", key: "transition-property", control: Input },
- { label: "Duration", key: "transition-timing-function", control: Input },
- { label: "Ease", key: "transition-ease", control: Input },
+ {
+ label: "Property",
+ key: "transition-property",
+ control: OptionSelect,
+ options: [
+ "None",
+ "All",
+ "Background Color",
+ "Color",
+ "Font Size",
+ "Font Weight",
+ "Height",
+ "Margin",
+ "Opacity",
+ "Padding",
+ "Rotate",
+ "Shadow",
+ "Width",
+ ],
+ },
+ {
+ label: "Duration",
+ key: "transition-timing-function",
+ control: Input,
+ width: "48px",
+ textAlign: "center",
+ placeholder: "sec",
+ },
+ {
+ label: "Ease",
+ key: "transition-ease",
+ control: OptionSelect,
+ options: ["linear", "ease", "ease-in", "ease-out", "ease-in-out"],
+ },
]
export const all = {
diff --git a/packages/builder/src/helpers.js b/packages/builder/src/helpers.js
new file mode 100644
index 0000000000..5d9ff750af
--- /dev/null
+++ b/packages/builder/src/helpers.js
@@ -0,0 +1,14 @@
+export const buildStyle = styles => {
+ let str = ""
+ for (let s in styles) {
+ if (styles[s]) {
+ let key = convertCamel(s)
+ str += `${key}: ${styles[s]}; `
+ }
+ }
+ return str
+}
+
+export const convertCamel = str => {
+ return str.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)
+}
diff --git a/packages/builder/src/pages/[application]/frontend/_layout.svelte b/packages/builder/src/pages/[application]/frontend/_layout.svelte
index 95f3f1fd67..9acdfe70fc 100644
--- a/packages/builder/src/pages/[application]/frontend/_layout.svelte
+++ b/packages/builder/src/pages/[application]/frontend/_layout.svelte
@@ -84,7 +84,7 @@
.ui-nav {
grid-column: 1;
background-color: var(--white);
- height: calc(100vh - 49px);
+ height: calc(100vh - 69px);
padding: 0;
display: flex;
flex-direction: column;
@@ -101,6 +101,47 @@
.components-pane {
grid-column: 3;
background-color: var(--white);
+ min-height: 0px;
+ height: calc(100vh - 69px);
+ overflow-y: hidden;
+ }
+
+ .components-nav-page {
+ font-size: 13px;
+ color: var(--ink);
+ padding-left: 20px;
+ margin-top: 20px;
+ font-weight: 600;
+ opacity: 0.4;
+ letter-spacing: 1px;
+ }
+
+ .components-nav-header {
+ font-size: 13px;
+ color: var(--ink);
+ margin-top: 20px;
+ font-weight: 600;
+ opacity: 0.4;
+ letter-spacing: 1px;
+ }
+
+ .nav-header {
+ display: flex;
+ flex-direction: column;
+ margin-top: 20px;
+ }
+
+ .nav-items-container {
+ padding: 1rem 0rem 0rem 0rem;
+ }
+
+ .nav-group-header {
+ display: flex;
+ padding: 0px 20px 0px 20px;
+ font-size: 0.9rem;
+ font-weight: bold;
+ justify-content: space-between;
+ align-items: center;
min-height: 0;
}
diff --git a/packages/builder/tests/generate_css.spec.js b/packages/builder/tests/generate_css.spec.js
index b2a7fca64d..5fcdef25c1 100644
--- a/packages/builder/tests/generate_css.spec.js
+++ b/packages/builder/tests/generate_css.spec.js
@@ -1,14 +1,10 @@
import {
generate_css,
generate_screen_css,
- generate_array_styles
} from "../src/builderStore/generate_css.js"
describe("generate_css", () => {
- test("Check how partially empty arrays are handled", () => {
- expect(["", "5", "", ""].map(generate_array_styles)).toEqual(["0px", "5px", "0px", "0px"])
- })
test("Check how array styles are output", () => {
expect(generate_css({ margin: ["0", "10", "0", "15"] })).toBe("margin: 0px 10px 0px 15px;")