@flozy/editor 10.1.2 → 10.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -449,16 +449,18 @@ const Form = props => {
449
449
  onClick: onSubmitClick,
450
450
  disabled: loading,
451
451
  sx: {
452
- background: buttonProps?.bgColor || "rgb(30, 75, 122)",
452
+ background: buttonProps?.bgColor || "#2563EB",
453
453
  borderWidth: "1px",
454
454
  borderBlockStyle: "solid",
455
+ borderRadius: `${buttonProps?.borderRadius || "8px"}`,
455
456
  ...btnBorderStyle,
456
457
  ...buttonSX,
457
458
  color: `${buttonProps?.textColor || "#FFFFFF"}`,
458
459
  fontSize: buttonProps?.textSize || "inherit",
459
460
  height: "fit-content",
460
- fontFamily: buttonProps?.fontFamily || "PoppinsRegular",
461
- width: buttonProps?.fullWidth ? "100%" : "auto"
461
+ fontFamily: buttonProps?.fontFamily || "Inter, sans-serif",
462
+ width: buttonProps?.fullWidth ? "100%" : "auto",
463
+ borderColor: `${buttonProps?.borderColor || "transparent"}`
462
464
  },
463
465
  children: buttonProps?.label || "Submit"
464
466
  })
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { Box } from "@mui/material";
3
- import { getTRBLBreakPoints, getBreakPointsValue } from "../../../helper/theme";
3
+ import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../../helper/theme";
4
+ import { useTheme } from "@emotion/react";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const FormText = props => {
6
7
  const {
@@ -19,11 +20,26 @@ const FormText = props => {
19
20
  textSize,
20
21
  fontFamily,
21
22
  fontWeight,
23
+ marginSpacing,
22
24
  ...rest
23
25
  } = fieldProps;
24
26
  const onChange = e => {
25
27
  e.preventDefault();
26
28
  };
29
+ const theme = useTheme();
30
+ const buttonSX = {
31
+ ...groupByBreakpoint({
32
+ borderRadius: {
33
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
34
+ },
35
+ padding: {
36
+ ...getTRBLBreakPoints(bannerSpacing)
37
+ },
38
+ margin: {
39
+ ...getTRBLBreakPoints(marginSpacing)
40
+ }
41
+ }, theme)
42
+ };
27
43
  return /*#__PURE__*/_jsx("div", {
28
44
  style: {
29
45
  width: "100%",
@@ -40,16 +56,17 @@ const FormText = props => {
40
56
  padding: {
41
57
  ...getTRBLBreakPoints(bannerSpacing)
42
58
  },
43
- height: height || "auto",
44
- borderColor: borderColor || "transparent",
59
+ height: height && `${height} !important`,
60
+ borderColor: borderColor && `${borderColor} !important`,
45
61
  borderWidth: borderWidth || "1px",
46
62
  borderRadius: {
47
63
  ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
48
64
  },
65
+ ...buttonSX,
49
66
  borderStyle: borderStyle || "solid",
50
- color: textColor || "#000",
51
- background: bgColor || "transparent",
52
- fontSize: textSize || "inherit",
67
+ color: textColor && `${textColor} !important`,
68
+ background: bgColor && `${bgColor} !important`,
69
+ fontSize: textSize && `${textSize} !important`,
53
70
  fontFamily: fontFamily || "PoppinsRegular",
54
71
  fontWeight: `${fontWeight} !important` || "400 !important"
55
72
  }
@@ -35,12 +35,13 @@ const FormTextArea = props => {
35
35
  onChange: onChange,
36
36
  sx: {
37
37
  width: "100%",
38
- border: `1px solid ${borderColor || "#FFF"}`,
38
+ borderWidth: "1px",
39
+ borderBlockStyle: "solid",
39
40
  padding: {
40
41
  ...getTRBLBreakPoints(bannerSpacing)
41
42
  },
42
43
  height: height || "150px",
43
- borderColor: `${borderColor || "transparent"} !important`,
44
+ borderColor: borderColor && `${borderColor} !important`,
44
45
  borderWidth: borderWidth || "1px",
45
46
  borderRadius: {
46
47
  ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import { Transforms, Node } from "slate";
2
+ import { Transforms } from "slate";
3
3
  import { useSlateStatic, ReactEditor } from "slate-react";
4
4
  import { IconButton, Tooltip, Grid, useTheme } from "@mui/material";
5
5
  import FormElements from "./FormElements";
@@ -9,6 +9,7 @@ import { DeleteIcon } from "../../assets/svg/AIIcons";
9
9
  import { SettingsIcon } from "../../assets/svg/TableIcons";
10
10
  import { useEditorContext } from "../../hooks/useMouseMove";
11
11
  import useCommonStyle from "../../commonStyle";
12
+ import { getNode } from "../../utils/helper";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const FormField = props => {
@@ -35,7 +36,7 @@ const FormField = props => {
35
36
  const formPath = path.slice(0, path.length - 1);
36
37
  const {
37
38
  metadatamapping
38
- } = Node?.get(editor, formPath) || {};
39
+ } = getNode(editor, formPath) || {};
39
40
  const updatedElement = {
40
41
  ...element,
41
42
  metadatamapping
@@ -635,24 +635,15 @@ const useCommonStyle = theme => ({
635
635
  formStyles: {
636
636
  "& input": {
637
637
  background: theme?.palette?.editor?.inputFieldBgColor,
638
- border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
639
- borderRadius: "8px",
638
+ borderColor: theme?.palette?.editor?.inputFieldBorder,
640
639
  height: "44px",
641
640
  fontSize: "14px",
642
641
  color: theme?.palette?.editor?.textColor
643
642
  },
644
643
  "& .form-btn-wrpr": {
645
644
  "& button": {
646
- background: "#2563EB",
647
- fontSize: "14px",
648
645
  fontWeight: 500,
649
- padding: "4px 24px",
650
- textTransform: "none",
651
- color: "#FFFFFF",
652
- height: "44px",
653
- borderRadius: "8px",
654
- border: "unset",
655
- fontFamily: "Inter, sans-serif"
646
+ height: "44px"
656
647
  }
657
648
  }
658
649
  },
@@ -12,10 +12,10 @@ export const FORM_NODE = () => {
12
12
  },
13
13
  buttonProps: {
14
14
  bannerSpacing: {
15
- left: 12,
16
- right: 12,
17
- top: 12,
18
- bottom: 12
15
+ left: 24,
16
+ right: 24,
17
+ top: 4,
18
+ bottom: 4
19
19
  }
20
20
  },
21
21
  workflow: [],
@@ -22,8 +22,14 @@ export const formField = data => {
22
22
  },
23
23
  fontFamily: data?.fontFamily ? data?.fontFamily : "",
24
24
  textSize: data?.textSize ? data?.textSize : "",
25
- textColor: data?.textColor ? data?.textColor : "",
26
- fontWeight: data?.fontWeight ? data?.fontWeight : "500"
25
+ textColor: data?.textColor && `${data?.textColor} !important`,
26
+ fontWeight: data?.fontWeight ? data?.fontWeight : "500",
27
+ borderRadius: {
28
+ topLeft: 8,
29
+ topRight: 8,
30
+ bottomLeft: 8,
31
+ bottomRight: 8
32
+ }
27
33
  };
28
34
  };
29
35
  export const insertGridItem = editor => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.1.2",
3
+ "version": "10.1.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"