@flozy/editor 10.9.8 → 11.0.1

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.
@@ -686,7 +686,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
686
686
  id: "slate-wrapper-scroll-container",
687
687
  ref: editorWrapper,
688
688
  onClick: e => {
689
- handleInsertLastElement(e, editor);
689
+ if (!isReadOnly) {
690
+ handleInsertLastElement(e, editor);
691
+ }
690
692
  },
691
693
  onScroll: handleScroll,
692
694
  style: editorWrapperStyle,
@@ -1,12 +1,12 @@
1
1
  import React, { useState, useEffect, useRef } from "react";
2
2
  import { useSlateStatic, ReactEditor } from "slate-react";
3
3
  import { Node, Transforms } from "slate";
4
- import IconButton from '@mui/material/IconButton';
5
- import Tooltip from '@mui/material/Tooltip';
6
- import Box from '@mui/material/Box';
7
- import useTheme from '@mui/material/styles/useTheme';
8
- import Grid from '@mui/material/Grid';
9
- import CircularProgress from '@mui/material/CircularProgress';
4
+ import IconButton from "@mui/material/IconButton";
5
+ import Tooltip from "@mui/material/Tooltip";
6
+ import Box from "@mui/material/Box";
7
+ import useTheme from "@mui/material/styles/useTheme";
8
+ import Grid from "@mui/material/Grid";
9
+ import CircularProgress from "@mui/material/CircularProgress";
10
10
  import DeleteIcon from "@mui/icons-material/Delete";
11
11
  import AspectRatioIcon from "@mui/icons-material/AspectRatio";
12
12
  import HighlightOffRoundedIcon from "@mui/icons-material/HighlightOffRounded";
@@ -388,7 +388,6 @@ const Video = ({
388
388
  if (typeof data === "string") {
389
389
  updateData = {
390
390
  url: data,
391
- uniqueId: undefined,
392
391
  isUploading: false
393
392
  };
394
393
  } else if (typeof data?.url !== "string") {
@@ -321,7 +321,7 @@ const FreeGridItem = props => {
321
321
  customProps: customProps,
322
322
  translation: translation,
323
323
  xsHidden: xsHidden,
324
- disableClick: element?.children?.[0]?.isUploading,
324
+ disableClick: element?.children?.[0]?.isUploading && (element?.childType === "image" || element?.childType === "video"),
325
325
  children: /*#__PURE__*/_jsxs(Box, {
326
326
  component: "div",
327
327
  ...attributes,
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { signedTextFonts } from "../../../utils/font";
3
3
  import { Grid, Button, TextField, InputAdornment, IconButton, Typography } from "@mui/material";
4
- import ClearRoundedIcon from '@mui/icons-material/ClearRounded';
4
+ import ClearRoundedIcon from "@mui/icons-material/ClearRounded";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  const TypeSignature = props => {
@@ -80,7 +80,8 @@ const TypeSignature = props => {
80
80
  children: /*#__PURE__*/_jsx(ClearRoundedIcon, {})
81
81
  })
82
82
  })
83
- }
83
+ },
84
+ autoComplete: "typeName"
84
85
  })
85
86
  })
86
87
  })
@@ -319,7 +319,8 @@ const SignaturePopup = props => {
319
319
  ,
320
320
  size: "small",
321
321
  onChange: onChange,
322
- sx: classes.signaturePopUpNameField
322
+ sx: classes.signaturePopUpNameField,
323
+ autoComplete: "signedBy"
323
324
  })
324
325
  })]
325
326
  }), /*#__PURE__*/_jsxs(Grid, {
@@ -447,6 +448,8 @@ const SignaturePopup = props => {
447
448
  sx: classes.signaturePopUpNameField,
448
449
  value: signedData.signedByEmail || ""
449
450
  // defaultValue={defaultEmail || ""}
451
+ ,
452
+ autoComplete: "signedByEmail"
450
453
  })
451
454
  })]
452
455
  })]
@@ -672,7 +672,7 @@ const RnD = props => {
672
672
  "data-dragoverid": str_path,
673
673
  "data-dragovertype": type,
674
674
  style: {
675
- pointerEvents: disableClick ? "none" : "auto"
675
+ pointerEvents: disableClick && "none"
676
676
  }
677
677
  }) : null]
678
678
  }, eId), xsHidden && breakpoint === "xs" ? null : /*#__PURE__*/_jsxs(_Fragment, {
@@ -4,6 +4,7 @@ import insertNewLine from "./insertNewLine";
4
4
  import { getDevice } from "../helper/theme";
5
5
  import { activeMark, getSelectedElementStyle } from "./SlateUtilityFunctions";
6
6
  import { getCurrentElementText } from "../plugins/withHTML";
7
+ import { isEmptyTextNode } from "../helper";
7
8
  export const windowVar = {};
8
9
  let ST_TIMEOUT = null;
9
10
  const BLOCKS = ["grid", "dataView"];
@@ -174,7 +175,7 @@ export const handleInsertLastElement = (event, editor) => {
174
175
  if (isFreeGrid) {
175
176
  return;
176
177
  }
177
- const isLastElementEmpty = lastElement && lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => BLOCKS.includes(c.type));
178
+ const isLastElementEmpty = isEmptyTextNode(lastElement) && !lastElement.children?.some(c => BLOCKS.includes(c.type));
178
179
  if (!ReactEditor.isFocused(editor)) {
179
180
  if (isLastElementEmpty) {
180
181
  if (hasPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.9.8",
3
+ "version": "11.0.1",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"