<>
-
+ {isLoadError ? (
+
+ ) : (
+ setIsLoadError(true)}
+ />
+ )}
+
{showCaption && (
@@ -428,7 +456,7 @@ export default function ImageComponent({
maxWidth={maxWidth}
onResizeStart={onResizeStart}
onResizeEnd={onResizeEnd}
- captionsEnabled={captionsEnabled}
+ captionsEnabled={!isLoadError && captionsEnabled}
/>
)}
>
diff --git a/packages/lexical-react/src/LexicalErrorBoundary.tsx b/packages/lexical-react/src/LexicalErrorBoundary.tsx
index 8c3fab9b6a5..5eb59aa741a 100644
--- a/packages/lexical-react/src/LexicalErrorBoundary.tsx
+++ b/packages/lexical-react/src/LexicalErrorBoundary.tsx
@@ -6,6 +6,7 @@
*
*/
+import * as React from 'react';
import {ErrorBoundary as ReactErrorBoundary} from 'react-error-boundary';
export type LexicalErrorBoundaryProps = {
diff --git a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts
index 400d88fdde6..7d89e3fb961 100644
--- a/packages/lexical-table/src/LexicalTableSelectionHelpers.ts
+++ b/packages/lexical-table/src/LexicalTableSelectionHelpers.ts
@@ -32,6 +32,7 @@ import {
$getNearestNodeFromDOMNode,
$getPreviousSelection,
$getSelection,
+ $isDecoratorNode,
$isElementNode,
$isRangeSelection,
$isTextNode,
@@ -1359,6 +1360,11 @@ function $handleArrowKey(
return false;
}
+ const selectedNodes = selection.getNodes();
+ if (selectedNodes.length === 1 && $isDecoratorNode(selectedNodes[0])) {
+ return false;
+ }
+
if (
isExitingTableAnchor(anchorType, anchorOffset, anchorNode, direction)
) {
diff --git a/packages/lexical/src/LexicalEvents.ts b/packages/lexical/src/LexicalEvents.ts
index e81ce0a5124..c56806c596e 100644
--- a/packages/lexical/src/LexicalEvents.ts
+++ b/packages/lexical/src/LexicalEvents.ts
@@ -1005,6 +1005,10 @@ function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {
return;
}
+ if (key == null) {
+ return;
+ }
+
if (isMoveForward(key, ctrlKey, altKey, metaKey)) {
dispatchCommand(editor, KEY_ARROW_RIGHT_COMMAND, event);
} else if (isMoveToEnd(key, ctrlKey, shiftKey, altKey, metaKey)) {
diff --git a/packages/lexical/src/nodes/LexicalElementNode.ts b/packages/lexical/src/nodes/LexicalElementNode.ts
index 2a521ab5f4e..2707fb318de 100644
--- a/packages/lexical/src/nodes/LexicalElementNode.ts
+++ b/packages/lexical/src/nodes/LexicalElementNode.ts
@@ -525,9 +525,11 @@ export class ElementNode extends LexicalNode {
excludeFromCopy(destination?: 'clone' | 'html'): boolean {
return false;
}
+ /** @deprecated @internal */
canReplaceWith(replacement: LexicalNode): boolean {
return true;
}
+ /** @deprecated @internal */
canInsertAfter(node: LexicalNode): boolean {
return true;
}
@@ -550,6 +552,7 @@ export class ElementNode extends LexicalNode {
isShadowRoot(): boolean {
return false;
}
+ /** @deprecated @internal */
canMergeWith(node: ElementNode): boolean {
return false;
}
diff --git a/scripts/build.js b/scripts/build.js
index 41b8d0ffed6..d80d5a6d1bf 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -192,7 +192,7 @@ async function build(name, inputFile, outputPath, outputFile, isProd, format) {
tsconfig: path.resolve('./tsconfig.build.json'),
},
],
- ['@babel/preset-react', {runtime: 'automatic'}],
+ ['@babel/preset-react', {runtime: isWWW ? 'classic' : 'automatic'}],
],
}),
{