@portabletext/editor 6.0.1-canary.2 → 6.0.2
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.
|
@@ -2,7 +2,7 @@ import * as _portabletext_schema6 from "@portabletext/schema";
|
|
|
2
2
|
import { AnnotationDefinition, AnnotationSchemaType, AnnotationSchemaType as AnnotationSchemaType$1, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, BlockObjectSchemaType as BlockObjectSchemaType$1, DecoratorDefinition, DecoratorSchemaType, DecoratorSchemaType as DecoratorSchemaType$1, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, InlineObjectSchemaType as InlineObjectSchemaType$1, ListDefinition, ListSchemaType, ListSchemaType as ListSchemaType$1, PortableTextBlock, PortableTextBlock as PortableTextBlock$1, PortableTextChild, PortableTextChild as PortableTextChild$1, PortableTextListBlock, PortableTextObject, PortableTextObject as PortableTextObject$1, PortableTextSpan, PortableTextSpan as PortableTextSpan$1, PortableTextTextBlock, PortableTextTextBlock as PortableTextTextBlock$1, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, StyleSchemaType as StyleSchemaType$1, TypedObject, defineSchema } from "@portabletext/schema";
|
|
3
3
|
import * as xstate73 from "xstate";
|
|
4
4
|
import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react10 from "react";
|
|
6
6
|
import React$1, { BaseSyntheticEvent, ClipboardEvent as ClipboardEvent$1, FocusEvent, JSX, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
|
|
7
7
|
import { Patch, Patch as Patch$1 } from "@portabletext/patches";
|
|
8
8
|
type MIMEType = `${string}/${string}`;
|
|
@@ -2316,7 +2316,7 @@ type PortableTextEditableProps = Omit<TextareaHTMLAttributes<HTMLDivElement>, 'o
|
|
|
2316
2316
|
* ```
|
|
2317
2317
|
* @group Components
|
|
2318
2318
|
*/
|
|
2319
|
-
declare const PortableTextEditable:
|
|
2319
|
+
declare const PortableTextEditable: react10.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react10.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
|
|
2320
2320
|
/** @beta */
|
|
2321
2321
|
interface EditableAPIDeleteOptions {
|
|
2322
2322
|
mode?: 'blocks' | 'children' | 'selected';
|
|
@@ -2952,7 +2952,7 @@ declare const editorMachine: xstate73.StateMachine<{
|
|
|
2952
2952
|
initialValue?: Array<PortableTextBlock>;
|
|
2953
2953
|
}, xstate73.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2954
2954
|
type: "blurred";
|
|
2955
|
-
event:
|
|
2955
|
+
event: react10.FocusEvent<HTMLDivElement, Element>;
|
|
2956
2956
|
} | {
|
|
2957
2957
|
type: "done loading";
|
|
2958
2958
|
} | {
|
|
@@ -2964,7 +2964,7 @@ declare const editorMachine: xstate73.StateMachine<{
|
|
|
2964
2964
|
data: unknown;
|
|
2965
2965
|
} | {
|
|
2966
2966
|
type: "focused";
|
|
2967
|
-
event:
|
|
2967
|
+
event: react10.FocusEvent<HTMLDivElement, Element>;
|
|
2968
2968
|
} | {
|
|
2969
2969
|
type: "invalid value";
|
|
2970
2970
|
resolution: InvalidValueResolution | null;
|
package/lib/index.js
CHANGED
|
@@ -6800,15 +6800,9 @@ const createRestoreDomManager = (editor, receivedUserInput) => {
|
|
|
6800
6800
|
function restoreDOM() {
|
|
6801
6801
|
bufferedMutations.length > 0 && (bufferedMutations.reverse().forEach((mutation) => {
|
|
6802
6802
|
mutation.type !== "characterData" && (mutation.removedNodes.forEach((node2) => {
|
|
6803
|
-
|
|
6804
|
-
mutation.target.insertBefore(node2, mutation.nextSibling);
|
|
6805
|
-
} catch {
|
|
6806
|
-
}
|
|
6803
|
+
mutation.target.insertBefore(node2, mutation.nextSibling);
|
|
6807
6804
|
}), mutation.addedNodes.forEach((node2) => {
|
|
6808
|
-
|
|
6809
|
-
mutation.target.removeChild(node2);
|
|
6810
|
-
} catch {
|
|
6811
|
-
}
|
|
6805
|
+
mutation.target.removeChild(node2);
|
|
6812
6806
|
}));
|
|
6813
6807
|
}), clear());
|
|
6814
6808
|
}
|