@flozy/editor 1.4.4 → 1.4.5

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.
@@ -97,6 +97,8 @@ blockquote {
97
97
  padding: 0px;
98
98
  position: relative;
99
99
  flex-wrap: wrap;
100
+ background-repeat: no-repeat;
101
+ background-size: cover;
100
102
  }
101
103
 
102
104
  .grid-container-toolbar,
@@ -1,6 +1,6 @@
1
1
  import React, { useRef, useState } from "react";
2
2
  import { useSlateStatic, ReactEditor } from "slate-react";
3
- import { Transforms } from "slate";
3
+ import { Transforms, Editor, Element } from "slate";
4
4
  import AppBar from "@mui/material/AppBar";
5
5
  import Box from "@mui/material/Box";
6
6
  import CssBaseline from "@mui/material/CssBaseline";
@@ -63,7 +63,8 @@ function AppHeader(props) {
63
63
  const handleDrawerToggle = () => {
64
64
  setMobileOpen(prevState => !prevState);
65
65
  };
66
- const onSettings = () => {
66
+ const onSettings = e => {
67
+ e.stopPropagation();
67
68
  setOpenSettings(true);
68
69
  };
69
70
  const ToolBar = () => {
@@ -103,7 +104,8 @@ function AppHeader(props) {
103
104
  });
104
105
  onClose();
105
106
  };
106
- const onDelete = () => {
107
+ const onDelete = e => {
108
+ e.stopPropagation();
107
109
  Transforms.removeNodes(editor, {
108
110
  at: path
109
111
  });
@@ -111,6 +113,20 @@ function AppHeader(props) {
111
113
  const onClose = () => {
112
114
  setOpenSettings(false);
113
115
  };
116
+ const handleFocus = e => {
117
+ e.preventDefault();
118
+ try {
119
+ const [[, gridItemPath]] = Editor.nodes(editor, {
120
+ at: path,
121
+ match: n => !Editor.isEditor(n) && Element.isElement(n) && n.type === "grid-item"
122
+ });
123
+ if (gridItemPath) {
124
+ Transforms.select(editor, gridItemPath);
125
+ }
126
+ } catch (err) {
127
+ console.log(err);
128
+ }
129
+ };
114
130
 
115
131
  // const onMenuSettings = (menuItem, i) => (event) => {
116
132
  // event.preventDefault();
@@ -168,6 +184,7 @@ function AppHeader(props) {
168
184
  },
169
185
  ...attributes,
170
186
  contentEditable: false,
187
+ onClick: handleFocus,
171
188
  children: [/*#__PURE__*/_jsxs("div", {
172
189
  ref: navWrprRef,
173
190
  style: {
@@ -2,7 +2,7 @@ import React, { useState } from "react";
2
2
  import { Transforms } from "slate";
3
3
  import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
4
  import GridItemPopup from "./GridItemPopup";
5
- import { IconButton, Tooltip, Box } from "@mui/material";
5
+ import { IconButton, Tooltip, Box, Grid as GridContainer } from "@mui/material";
6
6
  import SettingsIcon from "@mui/icons-material/Settings";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -14,8 +14,8 @@ const DrawSignature = props => {
14
14
  } = props;
15
15
  const [uploading, setUploading] = useState(false);
16
16
  const onSigned = async () => {
17
- setUploading(true);
18
17
  const strImage = canvasRef.toDataURL();
18
+ setUploading(true);
19
19
  const result = await services("uploadFile", {
20
20
  image: strImage
21
21
  });
@@ -33,7 +33,10 @@ const SignaturePopup = props => {
33
33
  const handleClose = () => {
34
34
  setOpen(false);
35
35
  };
36
- const handleSave = () => {
36
+ const handleSave = async () => {
37
+ await customProps?.services("workFlowAction", {
38
+ resource_id: customProps?.page_id
39
+ });
37
40
  onSave(signedData);
38
41
  handleClose();
39
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"