@lofcz/platejs-core 53.1.1 → 53.1.8
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.
- package/dist/{index-DRweaH9Q.d.ts → index-BDSzA1zP.d.ts} +137 -75
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -4
- package/dist/react/index.d.ts +130 -90
- package/dist/react/index.js +1014 -171
- package/dist/static/index.d.ts +1 -1
- package/dist/static/index.js +2 -2
- package/dist/{static-HrbPXDQ1.js → static-KMalmfNw.js} +3 -3
- package/dist/{withSlate-DsAgt7dN.js → withSlate-NVP0S9vL.js} +291 -141
- package/package.json +4 -4
package/dist/react/index.d.ts
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { Ct as NodeComponents, Et as PluginConfig, F as RenderLeafProps, Fi as ExtendEditor$1, I as RenderElementFn, J as BaseEditor, Jr as NavigationFeedbackConfig, L as RenderElementProps, M as RenderTextFn, N as RenderTextProps, Na as ResolvedInputRulesMeta, Ot as WithAnyKey, P as RenderLeafFn, Q as SlateEditor, R as RenderChunkFn, St as NodeComponent, Tt as ParserOptions, U as BaseWithSlateOptions, Y as InferPlugins, Za as createStaticEditor, _t as InferOptions, at as BasePluginContext, ba as InputRulesDefinition, bt as MatchRules, ci as InitOptions, ct as BaseTransformOptions, di as AutoScrollOperationsMap, et as AnyPluginConfig, gt as InferKey, hi as WithAutoScrollOptions, hr as CorePluginTransforms, ht as InferApi, ii as LiftBlockOptions, it as BasePlugin, j as EditableProps, ji as AnySlatePlugin, jo as HandlerReturnType, kt as WithRequiredKey, mi as ScrollMode, mr as CorePluginApi, mt as GetInjectNodePropsReturnType, na as SlatePluginConfig, nt as BaseHtmlDeserializer, oi as InsertExitBreakOptions, pi as DomConfig, pr as CorePlugin, pt as GetInjectNodePropsOptions, qr as NavigationFeedbackActiveTarget, ra as SlatePluginContext, rt as BaseInjectProps, st as BaseSerializer, ta as SlatePlugin, tt as BaseDeserializer, vt as InferSelectors, xo as PlateStaticProps, ya as InputRulesConfig, yt as InferTransforms, z as RenderChunkProps } from "../index-BDSzA1zP";
|
|
2
|
+
import * as _platejs_slate4 from "@platejs/slate";
|
|
3
3
|
import { DecoratedRange, Descendant, DescendantIn, Editor, EditorApi, EditorTransforms, ElementEntry, NodeEntry, NodeOperation, Operation, Path, TElement, TNode, TRange, TSelection, TText, TextOperation, Value, ValueOf } from "@platejs/slate";
|
|
4
4
|
import { AnyObject, Deep2Partial, Modify, Nullable, UnionToIntersection, UnknownObject } from "@udecode/utils";
|
|
5
5
|
import { DefaultPlaceholder, Editable, RenderPlaceholderProps, Slate, useComposing, useFocused, useReadOnly, useSelected, useSlateStatic, withReact } from "slate-react";
|
|
6
|
-
import React$1, { HTMLAttributes } from "react";
|
|
6
|
+
import React$1, { DependencyList, HTMLAttributes } from "react";
|
|
7
7
|
import { HotkeysEvent, HotkeysOptions, Keys } from "@udecode/react-hotkeys";
|
|
8
|
-
import * as jotai_x2 from "jotai-x";
|
|
9
|
-
import { JotaiStore, createAtomStore, useStoreAtomState, useStoreAtomValue, useStoreSetAtom } from "jotai-x";
|
|
10
8
|
import * as jotai10 from "jotai";
|
|
11
9
|
import { Atom, atom } from "jotai";
|
|
10
|
+
import * as jotai_x2 from "jotai-x";
|
|
11
|
+
import { JotaiStore, createAtomStore, useStoreAtomState, useStoreAtomValue, useStoreSetAtom } from "jotai-x";
|
|
12
12
|
import * as zustand_x0 from "zustand-x";
|
|
13
13
|
import { TCreatedStoreType, TEqualityChecker, createZustandStore, useStoreSelect, useStoreState, useStoreValue, useTracked, useTrackedStore } from "zustand-x";
|
|
14
|
+
import { createStore } from "jotai/vanilla";
|
|
14
15
|
|
|
15
16
|
//#region src/react/plugins/SlateReactExtensionPlugin.d.ts
|
|
16
17
|
declare const SlateReactExtensionPlugin: PlatePlugin<PluginConfig<"slateExtension", {
|
|
17
18
|
onNodeChange: (options: {
|
|
18
19
|
editor: SlateEditor;
|
|
19
|
-
node:
|
|
20
|
-
operation:
|
|
21
|
-
prevNode:
|
|
20
|
+
node: _platejs_slate4.Descendant;
|
|
21
|
+
operation: _platejs_slate4.NodeOperation;
|
|
22
|
+
prevNode: _platejs_slate4.Descendant;
|
|
22
23
|
}) => void;
|
|
23
24
|
onTextChange: (options: {
|
|
24
25
|
editor: SlateEditor;
|
|
25
|
-
node:
|
|
26
|
-
operation:
|
|
26
|
+
node: _platejs_slate4.Descendant;
|
|
27
|
+
operation: _platejs_slate4.TextOperation;
|
|
27
28
|
prevText: string;
|
|
28
29
|
text: string;
|
|
29
30
|
}) => void;
|
|
30
31
|
}, {
|
|
31
32
|
redecorate: (() => void) & (() => void);
|
|
32
33
|
}, {
|
|
33
|
-
reset: (options:
|
|
34
|
+
reset: (options: _platejs_slate4.ResetOptions | undefined) => void;
|
|
34
35
|
init: ((args_0: InitOptions) => void) & ((args_0: InitOptions) => void);
|
|
35
36
|
insertExitBreak: ((args_0?: InsertExitBreakOptions | undefined) => true | undefined) & ((args_0?: InsertExitBreakOptions | undefined) => true | undefined);
|
|
36
37
|
liftBlock: ((args_0?: LiftBlockOptions | undefined) => true | undefined) & ((args_0?: LiftBlockOptions | undefined) => true | undefined);
|
|
37
38
|
resetBlock: ((args_0?: {
|
|
38
|
-
at?:
|
|
39
|
+
at?: _platejs_slate4.Path;
|
|
39
40
|
} | undefined) => true | undefined) & ((args_0?: {
|
|
40
|
-
at?:
|
|
41
|
+
at?: _platejs_slate4.Path;
|
|
41
42
|
} | undefined) => true | undefined);
|
|
42
|
-
setValue: ((value?: string |
|
|
43
|
-
apply: <N$1 extends
|
|
43
|
+
setValue: ((value?: string | _platejs_slate4.Value | undefined) => void) & ((value?: string | _platejs_slate4.Value | undefined) => void);
|
|
44
|
+
apply: <N$1 extends _platejs_slate4.TElement | _platejs_slate4.TText>(operation: _platejs_slate4.Operation<N$1>) => void;
|
|
44
45
|
}, {}>>;
|
|
45
46
|
//#endregion
|
|
46
47
|
//#region src/react/plugins/event-editor/EventEditorPlugin.d.ts
|
|
@@ -100,7 +101,7 @@ declare const ParagraphPlugin: PlatePlugin<PluginConfig<"p", {}, {}, {}, {}>>;
|
|
|
100
101
|
declare const ReactPlugin: PlatePlugin<PluginConfig<"dom", {
|
|
101
102
|
scrollMode?: ScrollMode;
|
|
102
103
|
scrollOperations?: AutoScrollOperationsMap;
|
|
103
|
-
scrollOptions?:
|
|
104
|
+
scrollOptions?: _platejs_slate4.ScrollIntoViewOptions;
|
|
104
105
|
}, {
|
|
105
106
|
isScrolling: () => boolean;
|
|
106
107
|
}, {
|
|
@@ -112,7 +113,7 @@ declare const withPlateReact: ExtendEditor$1<DomConfig>;
|
|
|
112
113
|
//#endregion
|
|
113
114
|
//#region src/react/editor/withPlate.d.ts
|
|
114
115
|
type PlateCorePlugin = CorePlugin | typeof EventEditorPlugin | typeof SlateReactExtensionPlugin;
|
|
115
|
-
type WithPlateOptions<V$1 extends Value = Value, P$1 extends AnyPluginConfig = PlateCorePlugin> = BaseWithSlateOptions<P$1> & Pick<Partial<AnyPlatePlugin>, 'api' | 'decorate' | 'extendEditor' | 'handlers' | 'inject' | 'normalizeInitialValue' | 'options' | 'override' | 'priority' | 'render' | 'shortcuts' | 'transforms' | 'useHooks'> & {
|
|
116
|
+
type WithPlateOptions<V$1 extends Value = Value, P$1 extends AnyPluginConfig = PlateCorePlugin> = BaseWithSlateOptions<P$1> & Pick<Partial<AnyPlatePlugin>, 'api' | 'decorate' | 'extendEditor' | 'handlers' | 'inject' | 'transformInitialValue' | 'normalizeInitialValue' | 'options' | 'override' | 'priority' | 'render' | 'shortcuts' | 'transforms' | 'useHooks'> & {
|
|
116
117
|
value?: ((editor: PlateEditor) => Promise<V$1> | V$1) | V$1 | string;
|
|
117
118
|
rootPlugin?: (plugin: AnyPlatePlugin) => AnyPlatePlugin;
|
|
118
119
|
onReady?: (ctx: {
|
|
@@ -307,9 +308,13 @@ interface NodeWrapperComponentProps<C extends AnyPluginConfig = PluginConfig> ex
|
|
|
307
308
|
}
|
|
308
309
|
/** @deprecated Use {@link RenderNodeWrapperFunction} instead. */
|
|
309
310
|
type NodeWrapperComponentReturnType<C extends AnyPluginConfig = PluginConfig> = React$1.FC<PlateElementProps<TElement, C>> | undefined;
|
|
311
|
+
type TransformInitialValue<C extends AnyPluginConfig = PluginConfig> = (ctx: PlatePluginContext<C> & {
|
|
312
|
+
value: Value;
|
|
313
|
+
}) => Value;
|
|
314
|
+
/** @deprecated Use {@link TransformInitialValue} instead. */
|
|
310
315
|
type NormalizeInitialValue<C extends AnyPluginConfig = PluginConfig> = (ctx: PlatePluginContext<C> & {
|
|
311
316
|
value: Value;
|
|
312
|
-
}) => void;
|
|
317
|
+
}) => Value | void;
|
|
313
318
|
/**
|
|
314
319
|
* Function called whenever a change occurs in the editor. Return `false` to
|
|
315
320
|
* prevent calling the next plugin handler.
|
|
@@ -378,7 +383,10 @@ type PlatePlugin<C extends AnyPluginConfig = PluginConfig> = BasePlugin<C> & Nul
|
|
|
378
383
|
decorate?: Decorate<WithAnyKey<C>>;
|
|
379
384
|
/** @see {@link ExtendEditor} */
|
|
380
385
|
extendEditor?: ExtendEditor<WithAnyKey<C>>;
|
|
386
|
+
/** Transform the initial value before the editor is ready. */
|
|
387
|
+
transformInitialValue?: TransformInitialValue<WithAnyKey<C>>;
|
|
381
388
|
/** Normalize initial value before passing it into the editor. */
|
|
389
|
+
/** @deprecated Use `transformInitialValue` instead. */
|
|
382
390
|
normalizeInitialValue?: NormalizeInitialValue<WithAnyKey<C>>;
|
|
383
391
|
/** @see {@link UseHooks} */
|
|
384
392
|
useHooks?: UseHooks<WithAnyKey<C>>;
|
|
@@ -810,35 +818,35 @@ declare const getPlateCorePlugins: ({
|
|
|
810
818
|
}) => (PlatePlugin<PluginConfig<"eventEditor", {}, {}, {}, {}>> | PlatePlugin<PluginConfig<"slateExtension", {
|
|
811
819
|
onNodeChange: (options: {
|
|
812
820
|
editor: SlateEditor;
|
|
813
|
-
node:
|
|
814
|
-
operation:
|
|
815
|
-
prevNode:
|
|
821
|
+
node: _platejs_slate4.Descendant;
|
|
822
|
+
operation: _platejs_slate4.NodeOperation;
|
|
823
|
+
prevNode: _platejs_slate4.Descendant;
|
|
816
824
|
}) => void;
|
|
817
825
|
onTextChange: (options: {
|
|
818
826
|
editor: SlateEditor;
|
|
819
|
-
node:
|
|
820
|
-
operation:
|
|
827
|
+
node: _platejs_slate4.Descendant;
|
|
828
|
+
operation: _platejs_slate4.TextOperation;
|
|
821
829
|
prevText: string;
|
|
822
830
|
text: string;
|
|
823
831
|
}) => void;
|
|
824
832
|
}, {
|
|
825
833
|
redecorate: (() => void) & (() => void);
|
|
826
834
|
}, {
|
|
827
|
-
reset: (options:
|
|
835
|
+
reset: (options: _platejs_slate4.ResetOptions | undefined) => void;
|
|
828
836
|
init: ((args_0: InitOptions) => void) & ((args_0: InitOptions) => void);
|
|
829
837
|
insertExitBreak: ((args_0?: InsertExitBreakOptions | undefined) => true | undefined) & ((args_0?: InsertExitBreakOptions | undefined) => true | undefined);
|
|
830
838
|
liftBlock: ((args_0?: LiftBlockOptions | undefined) => true | undefined) & ((args_0?: LiftBlockOptions | undefined) => true | undefined);
|
|
831
839
|
resetBlock: ((args_0?: {
|
|
832
|
-
at?:
|
|
840
|
+
at?: _platejs_slate4.Path;
|
|
833
841
|
} | undefined) => true | undefined) & ((args_0?: {
|
|
834
|
-
at?:
|
|
842
|
+
at?: _platejs_slate4.Path;
|
|
835
843
|
} | undefined) => true | undefined);
|
|
836
|
-
setValue: ((value?: string |
|
|
837
|
-
apply: <N$1 extends
|
|
844
|
+
setValue: ((value?: string | _platejs_slate4.Value | undefined) => void) & ((value?: string | _platejs_slate4.Value | undefined) => void);
|
|
845
|
+
apply: <N$1 extends _platejs_slate4.TElement | _platejs_slate4.TText>(operation: _platejs_slate4.Operation<N$1>) => void;
|
|
838
846
|
}, {}>> | PlatePlugin<PluginConfig<"dom", {
|
|
839
847
|
scrollMode?: ScrollMode;
|
|
840
848
|
scrollOperations?: AutoScrollOperationsMap;
|
|
841
|
-
scrollOptions?:
|
|
849
|
+
scrollOptions?: _platejs_slate4.ScrollIntoViewOptions;
|
|
842
850
|
}, {
|
|
843
851
|
isScrolling: () => boolean;
|
|
844
852
|
}, {
|
|
@@ -908,7 +916,7 @@ declare function getPlugin<C extends AnyPluginConfig = PluginConfig>(editor: Pla
|
|
|
908
916
|
} ? C : PlatePlugin<C>;
|
|
909
917
|
//#endregion
|
|
910
918
|
//#region src/react/plugin/omitPluginContext.d.ts
|
|
911
|
-
declare const omitPluginContext: <T extends PlatePluginContext<AnyPlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "
|
|
919
|
+
declare const omitPluginContext: <T extends PlatePluginContext<AnyPlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "type" | "getOption" | "tf" | "setOptions" | "getOptions" | "setOption" | "plugin">;
|
|
912
920
|
//#endregion
|
|
913
921
|
//#region src/react/plugin/toPlatePlugin.d.ts
|
|
914
922
|
type PlatePluginConfig$1<C extends AnyPluginConfig, EO = {}, EA = {}, ET = {}, ES = {}> = Omit<Partial<PlatePlugin<PluginConfig<C['key'], EO & InferOptions<C>, EA & InferApi<C>, ET & InferTransforms<C>, ES & InferSelectors<C>>>>, keyof PlatePluginMethods | 'api' | 'node' | 'options' | 'transforms'> & {
|
|
@@ -951,6 +959,8 @@ declare function toTPlatePlugin<C extends AnyPluginConfig = PluginConfig, TConte
|
|
|
951
959
|
//#endregion
|
|
952
960
|
//#region src/react/components/plate-nodes.d.ts
|
|
953
961
|
declare const useNodeAttributes: (props: any, ref?: any) => any;
|
|
962
|
+
declare const isHtmlVoidElementTag: (tag: keyof HTMLElementTagNameMap) => boolean;
|
|
963
|
+
declare const useBlockIdAttributeRef: <T extends HTMLElement>(blockId: unknown, ref?: React$1.Ref<T>) => (node: T) => (() => void) | undefined;
|
|
954
964
|
type PlateChunkProps = RenderChunkProps;
|
|
955
965
|
type PlateElementProps<N$1 extends TElement = TElement, C extends AnyPluginConfig = PluginConfig> = PlateNodeProps<C> & RenderElementProps<N$1> & {
|
|
956
966
|
attributes: UnknownObject;
|
|
@@ -1053,7 +1063,7 @@ type UseElementSelectorOptions<T> = {
|
|
|
1053
1063
|
key?: string;
|
|
1054
1064
|
equalityFn?: (a: T, b: T) => boolean;
|
|
1055
1065
|
};
|
|
1056
|
-
declare const useElementSelector: <T>(selector: <N$1 extends TElement>(state: NodeEntry<N$1>, prev?: T) => T, deps:
|
|
1066
|
+
declare const useElementSelector: <T>(selector: <N$1 extends TElement>(state: NodeEntry<N$1>, prev?: T) => T, deps: DependencyList, {
|
|
1057
1067
|
key,
|
|
1058
1068
|
equalityFn
|
|
1059
1069
|
}?: UseElementSelectorOptions<T>) => T;
|
|
@@ -1065,11 +1075,37 @@ type ElementStoreState = {
|
|
|
1065
1075
|
entry: ElementEntry;
|
|
1066
1076
|
path: Path;
|
|
1067
1077
|
};
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1078
|
+
type ElementContextValue = Nullable<ElementStoreState> & {
|
|
1079
|
+
parent: ElementContextValue | null;
|
|
1080
|
+
scope?: string;
|
|
1081
|
+
};
|
|
1082
|
+
type ElementStoreContextValue = {
|
|
1083
|
+
parent: ElementStoreContextValue | null;
|
|
1084
|
+
runtime: ElementRuntimeStore;
|
|
1085
|
+
scope?: string;
|
|
1086
|
+
store: ReturnType<typeof createStore>;
|
|
1087
|
+
};
|
|
1088
|
+
type ElementRuntimeState = Nullable<ElementStoreState>;
|
|
1089
|
+
type ElementRuntimeStore = {
|
|
1090
|
+
getJotaiStore: () => ReturnType<typeof createStore>;
|
|
1091
|
+
getState: () => ElementRuntimeState;
|
|
1092
|
+
setState: (nextState: ElementRuntimeState) => void;
|
|
1093
|
+
subscribe: (listener: () => void) => () => void;
|
|
1094
|
+
};
|
|
1095
|
+
declare const elementStore: jotai_x2.StoreApi<ElementStoreState, object, "element">;
|
|
1096
|
+
declare const withElementContext: <T>(context: Omit<ElementContextValue, "parent">, callback: () => T) => T;
|
|
1097
|
+
declare const useElementContext: (scope?: string) => ElementContextValue | null;
|
|
1098
|
+
declare const useElementStoreContext: (scope?: string) => ElementStoreContextValue | null;
|
|
1099
|
+
declare const useElementStore: (scope?: string) => jotai_x2.ReturnOfUseStoreApi<ElementStoreState, object>;
|
|
1100
|
+
declare function ElementProvider({
|
|
1101
|
+
children,
|
|
1102
|
+
path,
|
|
1103
|
+
scope,
|
|
1104
|
+
...props
|
|
1105
|
+
}: React$1.PropsWithChildren<Partial<ElementStoreState> & {
|
|
1106
|
+
scope?: string;
|
|
1107
|
+
}>): React$1.JSX.Element;
|
|
1108
|
+
declare function FirstBlockEffect(): null;
|
|
1073
1109
|
//#endregion
|
|
1074
1110
|
//#region src/react/stores/element/usePath.d.ts
|
|
1075
1111
|
/** Get the memoized path of the closest element. */
|
|
@@ -1212,8 +1248,8 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1212
1248
|
composing: boolean | null;
|
|
1213
1249
|
decorate: ((options: {
|
|
1214
1250
|
editor: PlateEditor;
|
|
1215
|
-
entry:
|
|
1216
|
-
}) =>
|
|
1251
|
+
entry: _platejs_slate4.NodeEntry;
|
|
1252
|
+
}) => _platejs_slate4.TRange[]) | null;
|
|
1217
1253
|
isMounted: boolean | null;
|
|
1218
1254
|
primary: boolean | null;
|
|
1219
1255
|
readOnly: boolean | null;
|
|
@@ -1227,28 +1263,28 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1227
1263
|
versionValue: number | null;
|
|
1228
1264
|
onChange: ((options: {
|
|
1229
1265
|
editor: PlateEditor;
|
|
1230
|
-
value:
|
|
1266
|
+
value: _platejs_slate4.Value;
|
|
1231
1267
|
}) => void) | null;
|
|
1232
1268
|
onNodeChange: ((options: {
|
|
1233
1269
|
editor: PlateEditor;
|
|
1234
|
-
node:
|
|
1235
|
-
operation:
|
|
1236
|
-
prevNode:
|
|
1270
|
+
node: _platejs_slate4.Descendant;
|
|
1271
|
+
operation: _platejs_slate4.NodeOperation;
|
|
1272
|
+
prevNode: _platejs_slate4.Descendant;
|
|
1237
1273
|
}) => void) | null;
|
|
1238
1274
|
onSelectionChange: ((options: {
|
|
1239
1275
|
editor: PlateEditor;
|
|
1240
|
-
selection:
|
|
1276
|
+
selection: _platejs_slate4.TSelection;
|
|
1241
1277
|
}) => void) | null;
|
|
1242
1278
|
onTextChange: ((options: {
|
|
1243
1279
|
editor: PlateEditor;
|
|
1244
|
-
node:
|
|
1245
|
-
operation:
|
|
1280
|
+
node: _platejs_slate4.Descendant;
|
|
1281
|
+
operation: _platejs_slate4.TextOperation;
|
|
1246
1282
|
prevText: string;
|
|
1247
1283
|
text: string;
|
|
1248
1284
|
}) => void) | null;
|
|
1249
1285
|
onValueChange: ((options: {
|
|
1250
1286
|
editor: PlateEditor;
|
|
1251
|
-
value:
|
|
1287
|
+
value: _platejs_slate4.Value;
|
|
1252
1288
|
}) => void) | null;
|
|
1253
1289
|
id: string;
|
|
1254
1290
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
@@ -1271,8 +1307,8 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1271
1307
|
composing: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1272
1308
|
decorate: jotai_x2.SimpleWritableAtom<((options: {
|
|
1273
1309
|
editor: PlateEditor;
|
|
1274
|
-
entry:
|
|
1275
|
-
}) =>
|
|
1310
|
+
entry: _platejs_slate4.NodeEntry;
|
|
1311
|
+
}) => _platejs_slate4.TRange[]) | null>;
|
|
1276
1312
|
isMounted: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1277
1313
|
primary: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1278
1314
|
readOnly: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
@@ -1286,28 +1322,28 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1286
1322
|
versionValue: jotai_x2.SimpleWritableAtom<number | null>;
|
|
1287
1323
|
onChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1288
1324
|
editor: PlateEditor;
|
|
1289
|
-
value:
|
|
1325
|
+
value: _platejs_slate4.Value;
|
|
1290
1326
|
}) => void) | null>;
|
|
1291
1327
|
onNodeChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1292
1328
|
editor: PlateEditor;
|
|
1293
|
-
node:
|
|
1294
|
-
operation:
|
|
1295
|
-
prevNode:
|
|
1329
|
+
node: _platejs_slate4.Descendant;
|
|
1330
|
+
operation: _platejs_slate4.NodeOperation;
|
|
1331
|
+
prevNode: _platejs_slate4.Descendant;
|
|
1296
1332
|
}) => void) | null>;
|
|
1297
1333
|
onSelectionChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1298
1334
|
editor: PlateEditor;
|
|
1299
|
-
selection:
|
|
1335
|
+
selection: _platejs_slate4.TSelection;
|
|
1300
1336
|
}) => void) | null>;
|
|
1301
1337
|
onTextChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1302
1338
|
editor: PlateEditor;
|
|
1303
|
-
node:
|
|
1304
|
-
operation:
|
|
1339
|
+
node: _platejs_slate4.Descendant;
|
|
1340
|
+
operation: _platejs_slate4.TextOperation;
|
|
1305
1341
|
prevText: string;
|
|
1306
1342
|
text: string;
|
|
1307
1343
|
}) => void) | null>;
|
|
1308
1344
|
onValueChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1309
1345
|
editor: PlateEditor;
|
|
1310
|
-
value:
|
|
1346
|
+
value: _platejs_slate4.Value;
|
|
1311
1347
|
}) => void) | null>;
|
|
1312
1348
|
id: jotai_x2.SimpleWritableAtom<string>;
|
|
1313
1349
|
containerRef: jotai_x2.SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
@@ -1330,8 +1366,8 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1330
1366
|
composing: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1331
1367
|
decorate: jotai_x2.SimpleWritableAtom<((options: {
|
|
1332
1368
|
editor: PlateEditor;
|
|
1333
|
-
entry:
|
|
1334
|
-
}) =>
|
|
1369
|
+
entry: _platejs_slate4.NodeEntry;
|
|
1370
|
+
}) => _platejs_slate4.TRange[]) | null>;
|
|
1335
1371
|
isMounted: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1336
1372
|
primary: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1337
1373
|
readOnly: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
@@ -1345,28 +1381,28 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1345
1381
|
versionValue: jotai_x2.SimpleWritableAtom<number | null>;
|
|
1346
1382
|
onChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1347
1383
|
editor: PlateEditor;
|
|
1348
|
-
value:
|
|
1384
|
+
value: _platejs_slate4.Value;
|
|
1349
1385
|
}) => void) | null>;
|
|
1350
1386
|
onNodeChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1351
1387
|
editor: PlateEditor;
|
|
1352
|
-
node:
|
|
1353
|
-
operation:
|
|
1354
|
-
prevNode:
|
|
1388
|
+
node: _platejs_slate4.Descendant;
|
|
1389
|
+
operation: _platejs_slate4.NodeOperation;
|
|
1390
|
+
prevNode: _platejs_slate4.Descendant;
|
|
1355
1391
|
}) => void) | null>;
|
|
1356
1392
|
onSelectionChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1357
1393
|
editor: PlateEditor;
|
|
1358
|
-
selection:
|
|
1394
|
+
selection: _platejs_slate4.TSelection;
|
|
1359
1395
|
}) => void) | null>;
|
|
1360
1396
|
onTextChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1361
1397
|
editor: PlateEditor;
|
|
1362
|
-
node:
|
|
1363
|
-
operation:
|
|
1398
|
+
node: _platejs_slate4.Descendant;
|
|
1399
|
+
operation: _platejs_slate4.TextOperation;
|
|
1364
1400
|
prevText: string;
|
|
1365
1401
|
text: string;
|
|
1366
1402
|
}) => void) | null>;
|
|
1367
1403
|
onValueChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1368
1404
|
editor: PlateEditor;
|
|
1369
|
-
value:
|
|
1405
|
+
value: _platejs_slate4.Value;
|
|
1370
1406
|
}) => void) | null>;
|
|
1371
1407
|
id: jotai_x2.SimpleWritableAtom<string>;
|
|
1372
1408
|
containerRef: jotai_x2.SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
@@ -1402,8 +1438,8 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1402
1438
|
composing: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1403
1439
|
decorate: jotai_x2.SimpleWritableAtom<((options: {
|
|
1404
1440
|
editor: PlateEditor;
|
|
1405
|
-
entry:
|
|
1406
|
-
}) =>
|
|
1441
|
+
entry: _platejs_slate4.NodeEntry;
|
|
1442
|
+
}) => _platejs_slate4.TRange[]) | null>;
|
|
1407
1443
|
isMounted: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1408
1444
|
primary: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1409
1445
|
readOnly: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
@@ -1417,28 +1453,28 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1417
1453
|
versionValue: jotai_x2.SimpleWritableAtom<number | null>;
|
|
1418
1454
|
onChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1419
1455
|
editor: PlateEditor;
|
|
1420
|
-
value:
|
|
1456
|
+
value: _platejs_slate4.Value;
|
|
1421
1457
|
}) => void) | null>;
|
|
1422
1458
|
onNodeChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1423
1459
|
editor: PlateEditor;
|
|
1424
|
-
node:
|
|
1425
|
-
operation:
|
|
1426
|
-
prevNode:
|
|
1460
|
+
node: _platejs_slate4.Descendant;
|
|
1461
|
+
operation: _platejs_slate4.NodeOperation;
|
|
1462
|
+
prevNode: _platejs_slate4.Descendant;
|
|
1427
1463
|
}) => void) | null>;
|
|
1428
1464
|
onSelectionChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1429
1465
|
editor: PlateEditor;
|
|
1430
|
-
selection:
|
|
1466
|
+
selection: _platejs_slate4.TSelection;
|
|
1431
1467
|
}) => void) | null>;
|
|
1432
1468
|
onTextChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1433
1469
|
editor: PlateEditor;
|
|
1434
|
-
node:
|
|
1435
|
-
operation:
|
|
1470
|
+
node: _platejs_slate4.Descendant;
|
|
1471
|
+
operation: _platejs_slate4.TextOperation;
|
|
1436
1472
|
prevText: string;
|
|
1437
1473
|
text: string;
|
|
1438
1474
|
}) => void) | null>;
|
|
1439
1475
|
onValueChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1440
1476
|
editor: PlateEditor;
|
|
1441
|
-
value:
|
|
1477
|
+
value: _platejs_slate4.Value;
|
|
1442
1478
|
}) => void) | null>;
|
|
1443
1479
|
id: jotai_x2.SimpleWritableAtom<string>;
|
|
1444
1480
|
containerRef: jotai_x2.SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
@@ -1462,8 +1498,8 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1462
1498
|
composing: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1463
1499
|
decorate: jotai_x2.SimpleWritableAtom<((options: {
|
|
1464
1500
|
editor: PlateEditor;
|
|
1465
|
-
entry:
|
|
1466
|
-
}) =>
|
|
1501
|
+
entry: _platejs_slate4.NodeEntry;
|
|
1502
|
+
}) => _platejs_slate4.TRange[]) | null>;
|
|
1467
1503
|
isMounted: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1468
1504
|
primary: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
1469
1505
|
readOnly: jotai_x2.SimpleWritableAtom<boolean | null>;
|
|
@@ -1477,28 +1513,28 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1477
1513
|
versionValue: jotai_x2.SimpleWritableAtom<number | null>;
|
|
1478
1514
|
onChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1479
1515
|
editor: PlateEditor;
|
|
1480
|
-
value:
|
|
1516
|
+
value: _platejs_slate4.Value;
|
|
1481
1517
|
}) => void) | null>;
|
|
1482
1518
|
onNodeChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1483
1519
|
editor: PlateEditor;
|
|
1484
|
-
node:
|
|
1485
|
-
operation:
|
|
1486
|
-
prevNode:
|
|
1520
|
+
node: _platejs_slate4.Descendant;
|
|
1521
|
+
operation: _platejs_slate4.NodeOperation;
|
|
1522
|
+
prevNode: _platejs_slate4.Descendant;
|
|
1487
1523
|
}) => void) | null>;
|
|
1488
1524
|
onSelectionChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1489
1525
|
editor: PlateEditor;
|
|
1490
|
-
selection:
|
|
1526
|
+
selection: _platejs_slate4.TSelection;
|
|
1491
1527
|
}) => void) | null>;
|
|
1492
1528
|
onTextChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1493
1529
|
editor: PlateEditor;
|
|
1494
|
-
node:
|
|
1495
|
-
operation:
|
|
1530
|
+
node: _platejs_slate4.Descendant;
|
|
1531
|
+
operation: _platejs_slate4.TextOperation;
|
|
1496
1532
|
prevText: string;
|
|
1497
1533
|
text: string;
|
|
1498
1534
|
}) => void) | null>;
|
|
1499
1535
|
onValueChange: jotai_x2.SimpleWritableAtom<((options: {
|
|
1500
1536
|
editor: PlateEditor;
|
|
1501
|
-
value:
|
|
1537
|
+
value: _platejs_slate4.Value;
|
|
1502
1538
|
}) => void) | null>;
|
|
1503
1539
|
id: jotai_x2.SimpleWritableAtom<string>;
|
|
1504
1540
|
containerRef: jotai_x2.SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
@@ -1956,7 +1992,7 @@ declare const useEditableProps: ({
|
|
|
1956
1992
|
* if another node is updated in a way that affects this node's path, this hook
|
|
1957
1993
|
* will not return the new path.
|
|
1958
1994
|
*/
|
|
1959
|
-
declare const useNodePath: (node: TNode) =>
|
|
1995
|
+
declare const useNodePath: (node: TNode) => _platejs_slate4.Path | undefined;
|
|
1960
1996
|
//#endregion
|
|
1961
1997
|
//#region src/react/hooks/useSlateProps.d.ts
|
|
1962
1998
|
type SlateComponentProps = Omit<React$1.ComponentProps<typeof Slate>, 'children'>;
|
|
@@ -1971,7 +2007,7 @@ declare const useSlateProps: ({
|
|
|
1971
2007
|
}) => PlateSlateProps;
|
|
1972
2008
|
//#endregion
|
|
1973
2009
|
//#region src/react/utils/createPlateFallbackEditor.d.ts
|
|
1974
|
-
declare const createPlateFallbackEditor: (options?: CreatePlateEditorOptions) => TPlateEditor<
|
|
2010
|
+
declare const createPlateFallbackEditor: (options?: CreatePlateEditorOptions) => TPlateEditor<_platejs_slate4.Value, PlateCorePlugin>;
|
|
1975
2011
|
//#endregion
|
|
1976
2012
|
//#region src/react/utils/dom-attributes.d.ts
|
|
1977
2013
|
declare const DOM_HANDLERS: (keyof DOMHandlers)[];
|
|
@@ -1987,6 +2023,7 @@ declare const getRenderNodeProps: ({
|
|
|
1987
2023
|
disableInjectNodeProps,
|
|
1988
2024
|
editor,
|
|
1989
2025
|
plugin,
|
|
2026
|
+
pluginContext,
|
|
1990
2027
|
props,
|
|
1991
2028
|
readOnly
|
|
1992
2029
|
}: {
|
|
@@ -1995,6 +2032,7 @@ declare const getRenderNodeProps: ({
|
|
|
1995
2032
|
attributes?: AnyObject;
|
|
1996
2033
|
disableInjectNodeProps?: boolean;
|
|
1997
2034
|
plugin?: AnyEditorPlatePlugin;
|
|
2035
|
+
pluginContext?: AnyObject;
|
|
1998
2036
|
readOnly?: boolean;
|
|
1999
2037
|
}) => PlateHTMLProps;
|
|
2000
2038
|
//#endregion
|
|
@@ -2042,7 +2080,9 @@ declare const pipeRenderText: (editor: PlateEditor, renderTextProp?: EditablePro
|
|
|
2042
2080
|
* element then that JSX element is rendered.
|
|
2043
2081
|
*/
|
|
2044
2082
|
type RenderElement = (props: PlateElementProps) => React$1.ReactElement<any> | undefined;
|
|
2045
|
-
declare function BelowRootNodes(
|
|
2083
|
+
declare function BelowRootNodes({
|
|
2084
|
+
...props
|
|
2085
|
+
}: any): React$1.JSX.Element;
|
|
2046
2086
|
/**
|
|
2047
2087
|
* Get a `Editable.renderElement` handler for `plugin.node.type`. If the type is
|
|
2048
2088
|
* equals to the slate element type, render `plugin.render.node`. Else, return
|
|
@@ -2068,4 +2108,4 @@ type RenderText = (props: PlateTextProps) => React$1.ReactElement<any>;
|
|
|
2068
2108
|
*/
|
|
2069
2109
|
declare const pluginRenderText: (editor: PlateEditor, plugin: AnyEditorPlatePlugin) => RenderText;
|
|
2070
2110
|
//#endregion
|
|
2071
|
-
export { AnyEditorPlatePlugin, AnyPlatePlugin, BLUR_EDITOR_EVENT, BelowRootNodes, ContentVisibilityChunk, CreatePlateEditorOptions, DOMHandler, DOMHandlers, DOM_HANDLERS, Decorate, DefaultPlaceholder, Deserializer, Editable, EditableSiblingComponent, EditorHotkeysEffect, EditorMethodsEffect, EditorPlatePlugin, EditorRefEffect, EditorRefPluginEffect, ElementProvider, ElementStoreState, EventEditorPlugin, EventEditorState, EventEditorStore, ExtendEditor, ExtendEditorApi, ExtendEditorTransforms, FOCUS_EDITOR_EVENT, GLOBAL_PLATE_SCOPE, HtmlDeserializer, HtmlReactSerializer, HtmlSerializer, InferConfig, InjectNodeProps, KeyboardHandler, KeyofPlugins, LeafNodeProps, NavigationFeedbackPlugin, NodeProps, NodeWrapperComponent, NodeWrapperComponentProps, NodeWrapperComponentReturnType, NormalizeInitialValue, OnChange, OnNodeChange, OnTextChange, OverrideEditor, PLATE_SCOPE, ParagraphPlugin, Parser, Plate, PlateChangeKey, PlateChunkProps, PlateContainer, PlateContent, PlateContentProps, PlateController, PlateControllerEffect, PlateControllerEffectProps, PlateCorePlugin, PlateEditor, PlateElement, PlateElementProps, PlateHTMLProps, PlateLeaf, PlateLeafProps, PlateNodeProps, PlatePlugin, PlatePluginConfig, PlatePluginContext, PlatePluginMethods, PlatePlugins, PlateProps, PlateSlate, PlateStore, PlateStoreProvider, PlateStoreState, PlateTest, PlateText, PlateTextProps, PlateView, PlateViewProps, ReactPlugin, RenderElement, RenderLeaf, RenderNodeWrapper, RenderNodeWrapperFunction, RenderNodeWrapperProps, type RenderPlaceholderProps, RenderText, SCOPE_ELEMENT, Serializer, Shortcut, Shortcuts, Slate, SlateReactExtensionPlugin, StyledPlateElementProps, StyledPlateLeafProps, StyledPlateTextProps, TPlateEditor, TextNodeProps, TransformOptions, UseEditorSelectorOptions, UseHooks, WithPlateOptions, atom, convertDomEventToSyntheticEvent, createAtomStore, createPlateEditor, createPlateFallbackEditor, createPlatePlugin, createPlateStore, createTPlatePlugin, createZustandStore, elementStore, getEditorPlugin, getEventPlateId, getPlateCorePlugins, getPlugin, getRenderNodeProps, isEventHandled, omitPluginContext, pipeHandler, pipeOnChange, pipeRenderElement, pipeRenderLeaf, pipeRenderText, plateControllerStore, plateStore, pluginRenderElement, pluginRenderLeaf, pluginRenderText, toPlatePlugin, toTPlatePlugin, useComposing, useEditableProps, useEditorComposing, useEditorContainerRef, useEditorId, useEditorMounted, useEditorPlugin, useEditorPluginOption, useEditorPluginOptions, useEditorReadOnly, useEditorRef, useEditorScrollRef, useEditorSelection, useEditorSelector, useEditorState, useEditorValue, useEditorVersion, useElement, useElementSelector, useElementStore, useEventEditorValue, useEventPlateId, useFocusEditorEvents, useFocused, useFocusedLast, useIncrementVersion, useNavigationHighlight, useNodeAttributes, useNodePath, usePath, usePlateControllerExists, usePlateControllerLocalStore, usePlateControllerStore, usePlateEditor, usePlateLocalStore, usePlateSet, usePlateState, usePlateStore, usePlateValue, usePlateViewEditor, usePluginOption, usePluginOptions, useReadOnly, useRedecorate, useScrollRef, useSelected, useSelectionVersion, useSlateProps, useSlateStatic, useStoreAtomState, useStoreAtomValue, useStoreSelect, useStoreSetAtom, useStoreState, useStoreValue, useTracked, useTrackedStore, useValueVersion, withHOC, withPlate, withPlateReact, withReact };
|
|
2111
|
+
export { AnyEditorPlatePlugin, AnyPlatePlugin, BLUR_EDITOR_EVENT, BelowRootNodes, ContentVisibilityChunk, CreatePlateEditorOptions, DOMHandler, DOMHandlers, DOM_HANDLERS, Decorate, DefaultPlaceholder, Deserializer, Editable, EditableSiblingComponent, EditorHotkeysEffect, EditorMethodsEffect, EditorPlatePlugin, EditorRefEffect, EditorRefPluginEffect, ElementProvider, ElementStoreState, EventEditorPlugin, EventEditorState, EventEditorStore, ExtendEditor, ExtendEditorApi, ExtendEditorTransforms, FOCUS_EDITOR_EVENT, FirstBlockEffect, GLOBAL_PLATE_SCOPE, HtmlDeserializer, HtmlReactSerializer, HtmlSerializer, InferConfig, InjectNodeProps, KeyboardHandler, KeyofPlugins, LeafNodeProps, NavigationFeedbackPlugin, NodeProps, NodeWrapperComponent, NodeWrapperComponentProps, NodeWrapperComponentReturnType, NormalizeInitialValue, OnChange, OnNodeChange, OnTextChange, OverrideEditor, PLATE_SCOPE, ParagraphPlugin, Parser, Plate, PlateChangeKey, PlateChunkProps, PlateContainer, PlateContent, PlateContentProps, PlateController, PlateControllerEffect, PlateControllerEffectProps, PlateCorePlugin, PlateEditor, PlateElement, PlateElementProps, PlateHTMLProps, PlateLeaf, PlateLeafProps, PlateNodeProps, PlatePlugin, PlatePluginConfig, PlatePluginContext, PlatePluginMethods, PlatePlugins, PlateProps, PlateSlate, PlateStore, PlateStoreProvider, PlateStoreState, PlateTest, PlateText, PlateTextProps, PlateView, PlateViewProps, ReactPlugin, RenderElement, RenderLeaf, RenderNodeWrapper, RenderNodeWrapperFunction, RenderNodeWrapperProps, type RenderPlaceholderProps, RenderText, SCOPE_ELEMENT, Serializer, Shortcut, Shortcuts, Slate, SlateReactExtensionPlugin, StyledPlateElementProps, StyledPlateLeafProps, StyledPlateTextProps, TPlateEditor, TextNodeProps, TransformInitialValue, TransformOptions, UseEditorSelectorOptions, UseHooks, WithPlateOptions, atom, convertDomEventToSyntheticEvent, createAtomStore, createPlateEditor, createPlateFallbackEditor, createPlatePlugin, createPlateStore, createTPlatePlugin, createZustandStore, elementStore, getEditorPlugin, getEventPlateId, getPlateCorePlugins, getPlugin, getRenderNodeProps, isEventHandled, isHtmlVoidElementTag, omitPluginContext, pipeHandler, pipeOnChange, pipeRenderElement, pipeRenderLeaf, pipeRenderText, plateControllerStore, plateStore, pluginRenderElement, pluginRenderLeaf, pluginRenderText, toPlatePlugin, toTPlatePlugin, useBlockIdAttributeRef, useComposing, useEditableProps, useEditorComposing, useEditorContainerRef, useEditorId, useEditorMounted, useEditorPlugin, useEditorPluginOption, useEditorPluginOptions, useEditorReadOnly, useEditorRef, useEditorScrollRef, useEditorSelection, useEditorSelector, useEditorState, useEditorValue, useEditorVersion, useElement, useElementContext, useElementSelector, useElementStore, useElementStoreContext, useEventEditorValue, useEventPlateId, useFocusEditorEvents, useFocused, useFocusedLast, useIncrementVersion, useNavigationHighlight, useNodeAttributes, useNodePath, usePath, usePlateControllerExists, usePlateControllerLocalStore, usePlateControllerStore, usePlateEditor, usePlateLocalStore, usePlateSet, usePlateState, usePlateStore, usePlateValue, usePlateViewEditor, usePluginOption, usePluginOptions, useReadOnly, useRedecorate, useScrollRef, useSelected, useSelectionVersion, useSlateProps, useSlateStatic, useStoreAtomState, useStoreAtomValue, useStoreSelect, useStoreSetAtom, useStoreState, useStoreValue, useTracked, useTrackedStore, useValueVersion, withElementContext, withHOC, withPlate, withPlateReact, withReact };
|