@byline/richtext-lexical 6.2.1 → 6.4.0

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.
@@ -16,6 +16,6 @@ const SharedOnChangeContext = ({ children, onChange })=>{
16
16
  const useSharedOnChange = ()=>{
17
17
  const context = useContext(Context);
18
18
  if (void 0 !== context) return context;
19
- throw new Error('useSharedOnChange must be used within an SharedOnChangeProvider');
19
+ else throw new Error('useSharedOnChange must be used within an SharedOnChangeProvider');
20
20
  };
21
21
  export { SharedOnChangeContext, useSharedOnChange };
@@ -7,6 +7,6 @@ function getSelectedNode(selection) {
7
7
  if (anchorNode === focusNode) return anchorNode;
8
8
  const isBackward = selection.isBackward();
9
9
  if (isBackward) return $isAtNodeEnd(focus) ? anchorNode : focusNode;
10
- return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
10
+ else return $isAtNodeEnd(anchor) ? anchorNode : focusNode;
11
11
  }
12
12
  export { getSelectedNode };
@@ -38,8 +38,7 @@ class Rect {
38
38
  },
39
39
  result
40
40
  };
41
- }
42
- {
41
+ } else {
43
42
  const { top, left, bottom, right } = target;
44
43
  return top >= this._top && top <= this._bottom && bottom >= this._top && bottom <= this._bottom && left >= this._left && left <= this._right && right >= this._left && right <= this._right;
45
44
  }
@@ -45,7 +45,7 @@ const RichTextField = ({ field, value, defaultValue, editorConfig, readonly = fa
45
45
  id: fieldId,
46
46
  name: field.name,
47
47
  description: field.helpText,
48
- readonly: readonly,
48
+ readonly: readonly || true === field.readOnly,
49
49
  label: labelNode,
50
50
  required: !field.optional,
51
51
  value: incomingValue,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "6.2.1",
6
+ "version": "6.4.0",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -78,11 +78,11 @@
78
78
  "clsx": "^2.1.1",
79
79
  "lexical": "0.50.0",
80
80
  "react-error-boundary": "^6.1.5",
81
- "@byline/admin": "6.2.1",
82
- "@byline/client": "6.2.1",
83
- "@byline/i18n": "6.2.1",
84
- "@byline/core": "6.2.1",
85
- "@byline/ui": "6.2.1"
81
+ "@byline/admin": "6.4.0",
82
+ "@byline/ui": "6.4.0",
83
+ "@byline/core": "6.4.0",
84
+ "@byline/i18n": "6.4.0",
85
+ "@byline/client": "6.4.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": "^19.0.0",
@@ -93,8 +93,8 @@
93
93
  "@lexical/clipboard": "0.50.0",
94
94
  "@lexical/html": "0.50.0",
95
95
  "@rsbuild/plugin-react": "^2.1.0",
96
- "@rslib/core": "^1.0.0",
97
- "@types/node": "^26.5.1",
96
+ "@rslib/core": "^1.0.1",
97
+ "@types/node": "^26.6.1",
98
98
  "@types/react": "19.3.0",
99
99
  "@types/react-dom": "19.3.0",
100
100
  "@vitejs/plugin-react": "^6.1.1",
@@ -104,7 +104,7 @@
104
104
  "typescript": "^7.0.2",
105
105
  "typescript-plugin-css-modules": "^5.2.0",
106
106
  "vite": "^8.3.0",
107
- "vitest": "^5.0.0"
107
+ "vitest": "^5.0.1"
108
108
  },
109
109
  "publishConfig": {
110
110
  "access": "public",
@@ -121,7 +121,7 @@ export const RichTextField = ({
121
121
  id={fieldId}
122
122
  name={field.name}
123
123
  description={field.helpText}
124
- readonly={readonly}
124
+ readonly={readonly || field.readOnly === true}
125
125
  label={labelNode}
126
126
  required={!field.optional}
127
127
  value={incomingValue}