@byline/richtext-lexical 6.12.0 → 6.13.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.
@@ -277,7 +277,7 @@ function TableActionMenu({ onClose, tableCellNode: _tableCellNode, setIsMenuOpen
277
277
  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
278
278
  const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
279
279
  const tableRows = tableNode.getChildren();
280
- const maxRowsLength = Math.max(...tableRows.map((row)=>row.getChildren().length));
280
+ const maxRowsLength = Math.max(...tableRows.map((row)=>$isTableRowNode(row) ? row.getChildrenSize() : 0));
281
281
  if (tableColumnIndex >= maxRowsLength || tableColumnIndex < 0) throw new Error('Expected table cell to be inside of table row.');
282
282
  for(let r = 0; r < tableRows.length; r++){
283
283
  const tableRow = tableRows[r];
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.12.0",
6
+ "version": "6.13.0",
7
7
  "engines": {
8
8
  "node": ">=22.22.2"
9
9
  },
@@ -62,27 +62,27 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@byline/admin": "6.12.0",
66
- "@byline/client": "6.12.0",
67
- "@byline/core": "6.12.0",
68
- "@byline/i18n": "6.12.0",
69
- "@byline/ui": "6.12.0",
70
- "@lexical/code": "0.52.0",
71
- "@lexical/code-prism": "0.52.0",
72
- "@lexical/extension": "0.52.0",
73
- "@lexical/headless": "0.52.0",
74
- "@lexical/link": "0.52.0",
75
- "@lexical/list": "0.52.0",
76
- "@lexical/mark": "0.52.0",
77
- "@lexical/markdown": "0.52.0",
78
- "@lexical/overflow": "0.52.0",
79
- "@lexical/react": "0.52.0",
80
- "@lexical/rich-text": "0.52.0",
81
- "@lexical/selection": "0.52.0",
82
- "@lexical/table": "0.52.0",
83
- "@lexical/utils": "0.52.0",
65
+ "@byline/admin": "6.13.0",
66
+ "@byline/client": "6.13.0",
67
+ "@byline/core": "6.13.0",
68
+ "@byline/i18n": "6.13.0",
69
+ "@byline/ui": "6.13.0",
70
+ "@lexical/code": "0.53.0",
71
+ "@lexical/code-prism": "0.53.0",
72
+ "@lexical/extension": "0.53.0",
73
+ "@lexical/headless": "0.53.0",
74
+ "@lexical/link": "0.53.0",
75
+ "@lexical/list": "0.53.0",
76
+ "@lexical/mark": "0.53.0",
77
+ "@lexical/markdown": "0.53.0",
78
+ "@lexical/overflow": "0.53.0",
79
+ "@lexical/react": "0.53.0",
80
+ "@lexical/rich-text": "0.53.0",
81
+ "@lexical/selection": "0.53.0",
82
+ "@lexical/table": "0.53.0",
83
+ "@lexical/utils": "0.53.0",
84
84
  "clsx": "^2.1.1",
85
- "lexical": "0.52.0",
85
+ "lexical": "0.53.0",
86
86
  "react-error-boundary": "^6.1.6"
87
87
  },
88
88
  "peerDependencies": {
@@ -90,12 +90,12 @@
90
90
  "react-dom": "^19.0.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@biomejs/biome": "2.6.2",
94
- "@lexical/clipboard": "0.52.0",
95
- "@lexical/html": "0.52.0",
93
+ "@biomejs/biome": "2.6.4",
94
+ "@lexical/clipboard": "0.53.0",
95
+ "@lexical/html": "0.53.0",
96
96
  "@rsbuild/plugin-react": "^2.1.1",
97
- "@rslib/core": "^1.0.3",
98
- "@types/node": "^26.6.5",
97
+ "@rslib/core": "^1.0.5",
98
+ "@types/node": "^26.6.6",
99
99
  "@types/react": "19.3.0",
100
100
  "@types/react-dom": "19.3.0",
101
101
  "@vitejs/plugin-react": "^6.1.2",
@@ -103,7 +103,7 @@
103
103
  "react": "^19.3.1",
104
104
  "react-dom": "^19.3.1",
105
105
  "typescript": "^7.0.2",
106
- "typescript-plugin-css-modules": "^5.2.0",
106
+ "typescript-plugin-css-modules": "^5.3.0",
107
107
  "vite": "^8.3.5",
108
108
  "vitest": "^5.0.5"
109
109
  },
@@ -13,7 +13,7 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
13
13
  */
14
14
  import { ReactExtension } from '@lexical/react/ReactExtension'
15
15
  import { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'
16
- import type { ElementNode, LexicalCommand, LexicalNode, NodeKey } from 'lexical'
16
+ import type { LexicalCommand, NodeKey } from 'lexical'
17
17
  import {
18
18
  $createParagraphNode,
19
19
  $getNodeByKey,
@@ -106,7 +106,7 @@ export function LayoutPlugin(): React.JSX.Element {
106
106
  UPDATE_LAYOUT_COMMAND,
107
107
  ({ template, nodeKey }) => {
108
108
  editor.update(() => {
109
- const container = $getNodeByKey<LexicalNode>(nodeKey)
109
+ const container = $getNodeByKey(nodeKey)
110
110
 
111
111
  if (!$isLayoutContainerNode(container)) {
112
112
  return
@@ -122,7 +122,7 @@ export function LayoutPlugin(): React.JSX.Element {
122
122
  }
123
123
  } else if (itemsCount < prevItemsCount) {
124
124
  for (let i = prevItemsCount - 1; i >= itemsCount; i--) {
125
- const layoutItem = container.getChildAtIndex<LexicalNode>(i)
125
+ const layoutItem = container.getChildAtIndex(i)
126
126
 
127
127
  if ($isLayoutItemNode(layoutItem)) {
128
128
  layoutItem.remove()
@@ -141,9 +141,9 @@ export function LayoutPlugin(): React.JSX.Element {
141
141
  // "Container > Item" it'll unwrap nodes and convert it back
142
142
  // to regular content.
143
143
  editor.registerNodeTransform(LayoutItemNode, (node) => {
144
- const parent = node.getParent<ElementNode>()
144
+ const parent = node.getParent()
145
145
  if (!$isLayoutContainerNode(parent)) {
146
- const children = node.getChildren<LexicalNode>()
146
+ const children = node.getChildren()
147
147
  for (const child of children) {
148
148
  node.insertBefore(child)
149
149
  }
@@ -151,7 +151,7 @@ export function LayoutPlugin(): React.JSX.Element {
151
151
  }
152
152
  }),
153
153
  editor.registerNodeTransform(LayoutContainerNode, (node) => {
154
- const children = node.getChildren<LexicalNode>()
154
+ const children = node.getChildren()
155
155
  if (!children.every($isLayoutItemNode)) {
156
156
  for (const child of children) {
157
157
  node.insertBefore(child)
@@ -35,7 +35,6 @@ import {
35
35
  TableExtension as LexicalTableExtension,
36
36
  TableCellHeaderStates,
37
37
  TableCellNode,
38
- type TableRowNode,
39
38
  type TableSelection,
40
39
  } from '@lexical/table'
41
40
  import type { ElementNode, LexicalEditor } from 'lexical'
@@ -425,8 +424,10 @@ function TableActionMenu({
425
424
 
426
425
  const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode)
427
426
 
428
- const tableRows = tableNode.getChildren<TableRowNode>()
429
- const maxRowsLength = Math.max(...tableRows.map((row) => row.getChildren().length))
427
+ const tableRows = tableNode.getChildren()
428
+ const maxRowsLength = Math.max(
429
+ ...tableRows.map((row) => ($isTableRowNode(row) ? row.getChildrenSize() : 0))
430
+ )
430
431
 
431
432
  if (tableColumnIndex >= maxRowsLength || tableColumnIndex < 0) {
432
433
  throw new Error('Expected table cell to be inside of table row.')