@flozy/editor 5.3.1 → 5.3.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.
@@ -1282,3 +1282,18 @@ blockquote {
1282
1282
  .custom-scroll:hover::-webkit-scrollbar-thumb {
1283
1283
  background: #A7AEC1;
1284
1284
  }
1285
+
1286
+ ::selection {
1287
+ color: inherit;
1288
+ background: rgba(35, 131, 226, 0.35) !important;
1289
+ }
1290
+
1291
+ ::-moz-selection {
1292
+ background: rgba(35, 131, 226, 0.35) !important;
1293
+ color: inherit;
1294
+ }
1295
+
1296
+ ::-webkit-selection {
1297
+ background: rgba(35, 131, 226, 0.35) !important;
1298
+ color: inherit;
1299
+ }
@@ -286,8 +286,8 @@ const editorStyles = ({
286
286
  }
287
287
  },
288
288
  "& ::selection": {
289
- color: "inherit",
290
- background: "#EAEBFE"
289
+ background: 'rgba(35, 131, 226, 0.35)!important',
290
+ color: 'inherit'
291
291
  },
292
292
  "&.readOnlyContainer": {
293
293
  "& .max-content": {
@@ -136,7 +136,7 @@ export function onDropItem(props, parentClass) {
136
136
  let newPath = [];
137
137
  newPath = moveTo;
138
138
  const appenBp = breakpoint === "lg" ? "" : `_${breakpoint}`;
139
- const cCalx = handleNegativeInteger(isContainerElement(editor, moveTo, props, appenBp));
139
+ const cCalx = isContainerElement(editor, moveTo, props, appenBp);
140
140
 
141
141
  // const posX = parseInt(
142
142
  // cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX
@@ -18,7 +18,7 @@ import { selectText } from "../../utils/helper";
18
18
  import { removeSign } from "./ElementSettings/OtherSettings";
19
19
  import useDragging from "../../hooks/useDragging";
20
20
  import { dragOverOn } from "../../helper/RnD/focusNode";
21
- import { focusSelection, clearSelection } from "../../helper";
21
+ import { focusSelection, clearSelection, clearSelectionOnly } from "../../helper";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -163,6 +163,7 @@ const RnD = props => {
163
163
  }
164
164
  switch (e.detail) {
165
165
  case 1:
166
+ clearSelectionOnly(editor); //for selection removal on click outside
166
167
  if (!enable) {
167
168
  setSelectedElement({
168
169
  path: str_path,
@@ -308,7 +308,13 @@ export const getTextColor = (color = "") => {
308
308
  color: "transparent !important",
309
309
  caretColor: "black",
310
310
  "& span": {
311
- color: "transparent !important"
311
+ color: "transparent !important",
312
+ "& ::selection": {
313
+ color: "#000 !important"
314
+ }
315
+ },
316
+ "& ::selection": {
317
+ color: "#000 !important"
312
318
  }
313
319
  } : {
314
320
  color
@@ -360,4 +366,11 @@ export const clearBrainText = editor => {
360
366
  } catch (err) {
361
367
  console.log(err);
362
368
  }
369
+ };
370
+ export const clearSelectionOnly = editor => {
371
+ try {
372
+ Transforms.deselect(editor);
373
+ } catch (err) {
374
+ console.log(err);
375
+ }
363
376
  };
@@ -240,7 +240,8 @@ export const getMarked = (leaf, children, theme) => {
240
240
  // },
241
241
  ...textStyles,
242
242
  fontFamily: family,
243
- fontWeight: leaf.fontWeight
243
+ fontWeight: leaf.fontWeight,
244
+ WebkitTextFillColor: 'unset !important'
244
245
  },
245
246
  children: children
246
247
  })
@@ -249,7 +250,6 @@ export const getMarked = (leaf, children, theme) => {
249
250
  if (leaf.highlight) {
250
251
  children = /*#__PURE__*/_jsx("span", {
251
252
  style: {
252
- background: "#EAEBFE",
253
253
  color: "inherit"
254
254
  },
255
255
  children: children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.3.1",
3
+ "version": "5.3.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"