@lofcz/platejs-core 53.4.6 → 53.4.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-B7ej2XCF.d.ts → index-CtgFx8a9.d.ts} +55 -55
- package/dist/index.d.ts +1 -1
- package/dist/react/index.d.ts +312 -337
- package/dist/react/index.js +475 -6
- package/dist/static/index.d.ts +1 -1
- package/package.json +6 -6
package/dist/react/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Ct as NodeComponents, Et as PluginConfig, F as RenderLeafProps, I as RenderElementFn, Ii as ExtendEditor$1, J as BaseEditor, Jr as NavigationFeedbackConfig, L as RenderElementProps, M as RenderTextFn, Mi as AnySlatePlugin, Mo as HandlerReturnType, N as RenderTextProps, Ot as WithAnyKey, P as RenderLeafFn, Pa as ResolvedInputRulesMeta, Q as SlateEditor, Qa as createStaticEditor, R as RenderChunkFn, So as PlateStaticProps, St as NodeComponent, Tt as ParserOptions, U as BaseWithSlateOptions, Y as InferPlugins, _t as InferOptions, ai as
|
|
1
|
+
import { Ct as NodeComponents, Et as PluginConfig, F as RenderLeafProps, I as RenderElementFn, Ii as ExtendEditor$1, J as BaseEditor, Jr as NavigationFeedbackConfig, L as RenderElementProps, M as RenderTextFn, Mi as AnySlatePlugin, Mo as HandlerReturnType, N as RenderTextProps, Ot as WithAnyKey, P as RenderLeafFn, Pa as ResolvedInputRulesMeta, Q as SlateEditor, Qa as createStaticEditor, R as RenderChunkFn, So as PlateStaticProps, St as NodeComponent, Tt as ParserOptions, U as BaseWithSlateOptions, Y as InferPlugins, _t as InferOptions, ai as LiftBlockOptions, at as BasePluginContext, ba as InputRulesConfig, bt as MatchRules, ct as BaseTransformOptions, et as AnyPluginConfig, fi as AutoScrollOperationsMap, gi as WithAutoScrollOptions, gt as InferKey, hi as ScrollMode, hr as CorePluginTransforms, ht as InferApi, ia as SlatePluginContext, it as BasePlugin, j as EditableProps, kt as WithRequiredKey, li as InitOptions, mi as DomConfig, mr as CorePluginApi, mt as GetInjectNodePropsReturnType, na as SlatePlugin, nt as BaseHtmlDeserializer, pr as CorePlugin, pt as GetInjectNodePropsOptions, qr as NavigationFeedbackActiveTarget, ra as SlatePluginConfig, rt as BaseInjectProps, si as InsertExitBreakOptions, st as BaseSerializer, tt as BaseDeserializer, vt as InferSelectors, xa as InputRulesDefinition, yt as InferTransforms, z as RenderChunkProps } from "../index-CtgFx8a9";
|
|
2
2
|
import * as _platejs_slate20 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, { DependencyList, HTMLAttributes } from "react";
|
|
6
|
+
import React$1, { DependencyList, HTMLAttributes, PropsWithChildren } from "react";
|
|
7
7
|
import { HotkeysEvent, HotkeysOptions, Keys } from "@udecode/react-hotkeys";
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
8
|
+
import * as jotai5 from "jotai";
|
|
9
|
+
import { atom } from "jotai";
|
|
10
|
+
import { Atom, WritableAtom, createStore } from "jotai/vanilla";
|
|
11
|
+
import { useHydrateAtoms } from "jotai/utils";
|
|
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
|
|
14
|
+
import * as jotai_vanilla_internals0 from "jotai/vanilla/internals";
|
|
15
15
|
|
|
16
16
|
//#region src/react/plugins/SlateReactExtensionPlugin.d.ts
|
|
17
17
|
declare const SlateReactExtensionPlugin: PlatePlugin<PluginConfig<"slateExtension", {
|
|
@@ -816,7 +816,7 @@ declare const getPlateCorePlugins: ({
|
|
|
816
816
|
navigationFeedback
|
|
817
817
|
}?: {
|
|
818
818
|
navigationFeedback?: NavigationFeedbackConfig["options"] | boolean;
|
|
819
|
-
}) => (PlatePlugin<PluginConfig<"
|
|
819
|
+
}) => (PlatePlugin<PluginConfig<"slateExtension", {
|
|
820
820
|
onNodeChange: (options: {
|
|
821
821
|
editor: SlateEditor;
|
|
822
822
|
node: _platejs_slate20.Descendant;
|
|
@@ -853,7 +853,7 @@ declare const getPlateCorePlugins: ({
|
|
|
853
853
|
isScrolling: () => boolean;
|
|
854
854
|
}, {
|
|
855
855
|
withScrolling: (fn: () => void, options?: WithAutoScrollOptions | undefined) => void;
|
|
856
|
-
}, {}>> | PlatePlugin<PluginConfig<any, {}, {}, {}, {}>> | PlatePlugin<PluginConfig<"p", {}, {}, {}, {}>>)[];
|
|
856
|
+
}, {}>> | PlatePlugin<PluginConfig<"eventEditor", {}, {}, {}, {}>> | PlatePlugin<PluginConfig<any, {}, {}, {}, {}>> | PlatePlugin<PluginConfig<"p", {}, {}, {}, {}>>)[];
|
|
857
857
|
//#endregion
|
|
858
858
|
//#region src/react/editor/usePlateEditor.d.ts
|
|
859
859
|
/**
|
|
@@ -918,7 +918,7 @@ declare function getPlugin<C extends AnyPluginConfig = PluginConfig>(editor: Pla
|
|
|
918
918
|
} ? C : PlatePlugin<C>;
|
|
919
919
|
//#endregion
|
|
920
920
|
//#region src/react/plugin/omitPluginContext.d.ts
|
|
921
|
-
declare const omitPluginContext: <T extends PlatePluginContext<AnyPlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "
|
|
921
|
+
declare const omitPluginContext: <T extends PlatePluginContext<AnyPlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "type" | "getOption" | "tf" | "getOptions" | "setOptions" | "setOption" | "plugin">;
|
|
922
922
|
//#endregion
|
|
923
923
|
//#region src/react/plugin/toPlatePlugin.d.ts
|
|
924
924
|
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'> & {
|
|
@@ -1070,6 +1070,171 @@ declare const useElementSelector: <T>(selector: <N$1 extends TElement>(state: No
|
|
|
1070
1070
|
equalityFn
|
|
1071
1071
|
}?: UseElementSelectorOptions<T>) => T;
|
|
1072
1072
|
//#endregion
|
|
1073
|
+
//#region ../udecode/jotai-x/src/createAtomStore.d.ts
|
|
1074
|
+
type JotaiStore = ReturnType<typeof createStore>;
|
|
1075
|
+
type UseAtomOptions = {
|
|
1076
|
+
scope?: string;
|
|
1077
|
+
store?: JotaiStore;
|
|
1078
|
+
delay?: number;
|
|
1079
|
+
warnIfNoStore?: boolean;
|
|
1080
|
+
};
|
|
1081
|
+
type UseAtomOptionsOrScope = UseAtomOptions | string;
|
|
1082
|
+
type StoreAtomsWithoutExtend<T> = { [K in keyof T]: T[K] extends Atom<any> ? T[K] : SimpleWritableAtom<T[K]> };
|
|
1083
|
+
type ValueTypesForAtoms<T> = { [K in keyof T]: T[K] extends Atom<infer V> ? V : never };
|
|
1084
|
+
type StoreInitialValues<T> = ValueTypesForAtoms<StoreAtomsWithoutExtend<T>>;
|
|
1085
|
+
type StoreAtoms<T, E> = StoreAtomsWithoutExtend<T> & E;
|
|
1086
|
+
type SimpleWritableAtom<T> = WritableAtom<T, [T], void>;
|
|
1087
|
+
type AtomRecord<O> = { [K in keyof O]: Atom<O[K]> };
|
|
1088
|
+
type UseNameStore<N$1 extends string = ''> = `use${Capitalize<N$1>}Store`;
|
|
1089
|
+
type NameStore<N$1 extends string = ''> = N$1 extends '' ? 'store' : `${N$1}Store`;
|
|
1090
|
+
type NameProvider<N$1 extends string = ''> = `${Capitalize<N$1>}Provider`;
|
|
1091
|
+
type UseKeyValue<K$1 extends string = ''> = `use${Capitalize<K$1>}Value`;
|
|
1092
|
+
type GetKey<K$1 extends string = ''> = `get${Capitalize<K$1>}`;
|
|
1093
|
+
type UseSetKey<K$1 extends string = ''> = `useSet${Capitalize<K$1>}`;
|
|
1094
|
+
type SetKey<K$1 extends string = ''> = `set${Capitalize<K$1>}`;
|
|
1095
|
+
type UseKeyState<K$1 extends string = ''> = `use${Capitalize<K$1>}State`;
|
|
1096
|
+
type SubscribeKey<K$1 extends string = ''> = `subscribe${Capitalize<K$1>}`;
|
|
1097
|
+
type StoreApi<T extends object, E extends AtomRecord<object>, N$1 extends string = ''> = {
|
|
1098
|
+
atom: StoreAtoms<T, E>;
|
|
1099
|
+
name: N$1;
|
|
1100
|
+
};
|
|
1101
|
+
type UseValueOptions<V$1, S> = {
|
|
1102
|
+
selector?: (v: V$1, prevSelectorOutput?: S) => S;
|
|
1103
|
+
equalityFn?: (prev: S, next: S) => boolean;
|
|
1104
|
+
} & UseAtomOptions;
|
|
1105
|
+
type UseKeyValueApis<O> = { [K in keyof O as UseKeyValue<K & string>]: {
|
|
1106
|
+
(): O[K] extends Atom<infer V> ? V : never;
|
|
1107
|
+
<S>(selector: O[K] extends Atom<infer V> ? (v: V, prevSelectorOutput?: S) => S : never, deps?: unknown[]): S;
|
|
1108
|
+
<S>(selector: (O[K] extends Atom<infer V> ? (v: V, prevSelectorOutput?: S) => S : never) | undefined, equalityFn: (prevSelectorOutput: S, selectorOutput: S) => boolean, deps?: unknown[]): S;
|
|
1109
|
+
} };
|
|
1110
|
+
type GetKeyApis<O> = { [K in keyof O as GetKey<K & string>]: O[K] extends Atom<infer V> ? () => V : never };
|
|
1111
|
+
type UseSetKeyApis<O> = { [K in keyof O as UseSetKey<K & string>]: O[K] extends WritableAtom<infer _V, infer A, infer R> ? () => (...args: A) => R : never };
|
|
1112
|
+
type SetKeyApis<O> = { [K in keyof O as SetKey<K & string>]: O[K] extends WritableAtom<infer _V, infer A, infer R> ? (...args: A) => R : never };
|
|
1113
|
+
type UseKeyStateApis<O> = { [K in keyof O as UseKeyState<K & string>]: O[K] extends WritableAtom<infer V, infer A, infer R> ? () => [V, (...args: A) => R] : never };
|
|
1114
|
+
type SubscribeKeyApis<O> = { [K in keyof O as SubscribeKey<K & string>]: O[K] extends Atom<infer V> ? (callback: (newValue: V) => void) => () => void : never };
|
|
1115
|
+
type UseParamKeyValueApi<O> = {
|
|
1116
|
+
<K$1 extends keyof O>(key: K$1): O[K$1] extends Atom<infer V> ? V : never;
|
|
1117
|
+
<K$1 extends keyof O, S>(key: K$1, selector: O[K$1] extends Atom<infer V> ? (v: V, prevSelectorOutput?: S) => S : never, deps?: unknown[]): S;
|
|
1118
|
+
<K$1 extends keyof O, S>(key: K$1, selector: (O[K$1] extends Atom<infer V> ? (v: V, prevSelectorOutput?: S) => S : never) | undefined, equalityFn: (prevSelectorOutput: S, selectorOutput: S) => boolean, deps?: unknown[]): S;
|
|
1119
|
+
};
|
|
1120
|
+
type GetParamKeyApi<O> = <K$1 extends keyof O>(key: K$1) => O[K$1] extends Atom<infer V> ? V : never;
|
|
1121
|
+
type UseSetParamKeyApi<O> = <K$1 extends keyof O>(key: K$1) => O[K$1] extends WritableAtom<infer _V, infer A, infer R> ? (...args: A) => R : never;
|
|
1122
|
+
type SetParamKeyApi<O> = <K$1 extends keyof O, A$1 extends unknown[]>(key: K$1, ...args: A$1) => O[K$1] extends WritableAtom<infer _V, A$1, infer R> ? R : never;
|
|
1123
|
+
type UseParamKeyStateApi<O> = <K$1 extends keyof O>(key: K$1) => O[K$1] extends WritableAtom<infer V, infer A, infer R> ? [V, (...args: A) => R] : never;
|
|
1124
|
+
type SubscribeParamKeyApi<O> = <K$1 extends keyof O, V$1>(key: K$1, callback: (newValue: V$1) => void) => O[K$1] extends Atom<V$1> ? () => void : never;
|
|
1125
|
+
type UseAtomParamValueApi = {
|
|
1126
|
+
<V$1>(atom: Atom<V$1>): V$1;
|
|
1127
|
+
<V$1, S = V$1>(atom: Atom<V$1>, selector: (v: V$1, prevSelectorOutput?: S) => S, deps?: unknown[]): S;
|
|
1128
|
+
<V$1, S = V$1>(atom: Atom<V$1>, selector: ((v: V$1, prevSelectorOutput?: S) => S) | undefined, equalityFn: (prevSelectorOutput: S, selectorOutput: S) => boolean, deps?: unknown[]): S;
|
|
1129
|
+
};
|
|
1130
|
+
type GetAtomParamApi = <V$1>(atom: Atom<V$1>) => V$1;
|
|
1131
|
+
type UseSetAtomParamApi = <V$1, A$1 extends unknown[], R$1>(atom: WritableAtom<V$1, A$1, R$1>) => (...args: A$1) => R$1;
|
|
1132
|
+
type SetAtomParamApi = <V$1, A$1 extends unknown[], R$1>(atom: WritableAtom<V$1, A$1, R$1>) => (...args: A$1) => R$1;
|
|
1133
|
+
type UseAtomParamStateApi = <V$1, A$1 extends unknown[], R$1>(atom: WritableAtom<V$1, A$1, R$1>) => [V$1, (...args: A$1) => R$1];
|
|
1134
|
+
type SubscribeAtomParamApi = <V$1>(atom: Atom<V$1>) => (callback: (newValue: V$1) => void) => () => void;
|
|
1135
|
+
type ReturnOfUseStoreApi<T, E> = UseKeyValueApis<StoreAtoms<T, E>> & GetKeyApis<StoreAtoms<T, E>> & UseSetKeyApis<StoreAtoms<T, E>> & SetKeyApis<StoreAtoms<T, E>> & UseKeyStateApis<StoreAtoms<T, E>> & SubscribeKeyApis<StoreAtoms<T, E>> & {
|
|
1136
|
+
/**
|
|
1137
|
+
* When providing `selector`, the atom value will be transformed using the selector function.
|
|
1138
|
+
* The selector and equalityFn MUST be memoized.
|
|
1139
|
+
*
|
|
1140
|
+
* @see https://jotai.org/docs/utilities/select#selectatom
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* const store = useStore()
|
|
1144
|
+
* // only rerenders when the first element of the array changes
|
|
1145
|
+
* const arrayFirst = store.useValue('array', array => array[0], [])
|
|
1146
|
+
* // only rerenders when the first element of the array changes, but returns the whole array
|
|
1147
|
+
* const array = store.useValue('array', undefined, (prev, next) => prev[0] === next[0], [])
|
|
1148
|
+
* // without dependency array, then you need to memoize the selector and equalityFn yourself
|
|
1149
|
+
* const cb = useCallback((array) => array[n], [n])
|
|
1150
|
+
* const arrayNth = store.useValue('array', cb)
|
|
1151
|
+
*
|
|
1152
|
+
* @param key The key of the atom
|
|
1153
|
+
* @param selector A function that takes the atom value and returns the value to be used. Defaults to identity function that returns the atom value.
|
|
1154
|
+
* @param equalityFnOrDeps Dependency array or a function that compares the previous selector output and the new selector output. Defaults to comparing outputs of the selector function.
|
|
1155
|
+
* @param deps Dependency array for the selector and equalityFn
|
|
1156
|
+
*/
|
|
1157
|
+
useValue: UseParamKeyValueApi<StoreAtoms<T, E>>;
|
|
1158
|
+
get: GetParamKeyApi<StoreAtoms<T, E>>;
|
|
1159
|
+
useSet: UseSetParamKeyApi<StoreAtoms<T, E>>;
|
|
1160
|
+
set: SetParamKeyApi<StoreAtoms<T, E>>;
|
|
1161
|
+
useState: UseParamKeyStateApi<StoreAtoms<T, E>>;
|
|
1162
|
+
subscribe: SubscribeParamKeyApi<StoreAtoms<T, E>>;
|
|
1163
|
+
/**
|
|
1164
|
+
* When providing `selector`, the atom value will be transformed using the selector function.
|
|
1165
|
+
* The selector and equalityFn MUST be memoized.
|
|
1166
|
+
*
|
|
1167
|
+
* @see https://jotai.org/docs/utilities/select#selectatom
|
|
1168
|
+
*
|
|
1169
|
+
* @example
|
|
1170
|
+
* const store = useStore()
|
|
1171
|
+
* // only rerenders when the first element of the array changes
|
|
1172
|
+
* const arrayFirst = store.useAtomValue(arrayAtom, array => array[0])
|
|
1173
|
+
* // only rerenders when the first element of the array changes, but returns the whole array
|
|
1174
|
+
* const array = store.useAtomValue(arrayAtom, undefined, (prev, next) => prev[0] === next[0])
|
|
1175
|
+
* // without dependency array, then you need to memoize the selector and equalityFn yourself
|
|
1176
|
+
* const cb = useCallback((array) => array[n], [n])
|
|
1177
|
+
* const arrayNth = store.useAtomValue(arrayAtom, cb)
|
|
1178
|
+
*
|
|
1179
|
+
* @param atom The atom to use
|
|
1180
|
+
* @param selector A function that takes the atom value and returns the value to be used. Defaults to identity function that returns the atom value.
|
|
1181
|
+
* @param equalityFn Dependency array or a function that compares the previous selector output and the new selector output. Defaults to comparing outputs of the selector function.
|
|
1182
|
+
* @param deps Dependency array for the selector and equalityFn
|
|
1183
|
+
*/
|
|
1184
|
+
useAtomValue: UseAtomParamValueApi;
|
|
1185
|
+
getAtom: GetAtomParamApi;
|
|
1186
|
+
useSetAtom: UseSetAtomParamApi;
|
|
1187
|
+
setAtom: SetAtomParamApi;
|
|
1188
|
+
useAtomState: UseAtomParamStateApi;
|
|
1189
|
+
subscribeAtom: SubscribeAtomParamApi;
|
|
1190
|
+
store: JotaiStore | undefined;
|
|
1191
|
+
};
|
|
1192
|
+
type UseKeyStateUtil<T, E> = <K$1 extends keyof StoreAtoms<T, E>>(key: K$1, options?: UseAtomOptionsOrScope) => StoreAtoms<T, E>[K$1] extends WritableAtom<infer V, infer A, infer R> ? [V, (...args: A) => R] : never;
|
|
1193
|
+
type UseKeyValueUtil<T, E> = <K$1 extends keyof StoreAtoms<T, E>, S = (StoreAtoms<T, E>[K$1] extends Atom<infer V> ? V : never)>(key: K$1, options?: UseValueOptions<StoreAtoms<T, E>[K$1] extends Atom<infer V> ? V : never, S>, deps?: unknown[]) => S;
|
|
1194
|
+
type UseKeySetUtil<T, E> = <K$1 extends keyof StoreAtoms<T, E>>(key: K$1, options?: UseAtomOptionsOrScope) => StoreAtoms<T, E>[K$1] extends WritableAtom<infer _V, infer A, infer R> ? (...args: A) => R : never;
|
|
1195
|
+
type AtomStoreApi<T extends object, E extends AtomRecord<object>, N$1 extends string = ''> = {
|
|
1196
|
+
name: N$1;
|
|
1197
|
+
} & { [key in keyof Record<NameProvider<N$1>, object>]: React$1.FC<ProviderProps<StoreInitialValues<T>>> } & { [key in keyof Record<NameStore<N$1>, object>]: StoreApi<T, E, N$1> } & { [key in keyof Record<UseNameStore<N$1>, object>]: UseStoreApi<T, E> } & { [key in keyof Record<`use${Capitalize<N$1>}State`, object>]: UseKeyStateUtil<T, E> } & { [key in keyof Record<`use${Capitalize<N$1>}Value`, object>]: UseKeyValueUtil<T, E> } & { [key in keyof Record<`use${Capitalize<N$1>}Set`, object>]: UseKeySetUtil<T, E> };
|
|
1198
|
+
type UseStoreApi<T, E> = (options?: UseAtomOptionsOrScope) => ReturnOfUseStoreApi<T, E>;
|
|
1199
|
+
interface CreateAtomStoreOptions<T extends object, E extends AtomRecord<object>, N$1 extends string> {
|
|
1200
|
+
name: N$1;
|
|
1201
|
+
delay?: UseAtomOptions['delay'];
|
|
1202
|
+
effect?: React$1.FC;
|
|
1203
|
+
extend?: (atomsWithoutExtend: StoreAtomsWithoutExtend<T>) => E;
|
|
1204
|
+
suppressWarnings?: boolean;
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Create an atom store from an initial value.
|
|
1208
|
+
* Each property will have a getter and setter.
|
|
1209
|
+
*
|
|
1210
|
+
* @example
|
|
1211
|
+
* const { exampleStore, useExampleStore, useExampleValue, useExampleState, useExampleSet } = createAtomStore({ count: 1, say: 'hello' }, { name: 'example' as const })
|
|
1212
|
+
* const [count, setCount] = useExampleState()
|
|
1213
|
+
* const say = useExampleValue('say')
|
|
1214
|
+
* const setSay = useExampleSet('say')
|
|
1215
|
+
* setSay('world')
|
|
1216
|
+
* const countAtom = exampleStore.atom.count
|
|
1217
|
+
*/
|
|
1218
|
+
declare const createAtomStore: <T extends object, E extends AtomRecord<object>, N$1 extends string = "">(initialState: T, {
|
|
1219
|
+
name,
|
|
1220
|
+
effect,
|
|
1221
|
+
extend,
|
|
1222
|
+
suppressWarnings
|
|
1223
|
+
}: CreateAtomStoreOptions<T, E, N$1>) => AtomStoreApi<T, E, N$1>;
|
|
1224
|
+
declare function useStoreAtomValue<T, E, V$1>(store: ReturnOfUseStoreApi<T, E>, atom: Atom<V$1>): V$1;
|
|
1225
|
+
declare function useStoreAtomValue<T, E, V$1, S>(store: ReturnOfUseStoreApi<T, E>, atom: Atom<V$1>, selector: (v: V$1, prevSelectorOutput?: S) => S, deps?: unknown[]): S;
|
|
1226
|
+
declare function useStoreAtomValue<T, E, V$1, S>(store: ReturnOfUseStoreApi<T, E>, atom: Atom<V$1>, selector: ((v: V$1, prevSelectorOutput?: S) => S) | undefined, equalityFn: (prevSelectorOutput: S, selectorOutput: S) => boolean, deps?: unknown[]): S;
|
|
1227
|
+
declare function useStoreSetAtom<T, E, V$1, A$1 extends unknown[], R$1>(store: ReturnOfUseStoreApi<T, E>, atom: WritableAtom<V$1, A$1, R$1>): (...args: A$1) => R$1;
|
|
1228
|
+
declare function useStoreAtomState<T, E, V$1, A$1 extends unknown[], R$1>(store: ReturnOfUseStoreApi<T, E>, atom: WritableAtom<V$1, A$1, R$1>): [V$1, (...args: A$1) => R$1];
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region ../udecode/jotai-x/src/createAtomProvider.d.ts
|
|
1231
|
+
type ProviderProps<T extends object> = Partial<T> & PropsWithChildren<{
|
|
1232
|
+
store?: JotaiStore;
|
|
1233
|
+
scope?: string;
|
|
1234
|
+
initialValues?: Partial<T>;
|
|
1235
|
+
resetKey?: any;
|
|
1236
|
+
}>;
|
|
1237
|
+
//#endregion
|
|
1073
1238
|
//#region src/react/stores/element/useElementStore.d.ts
|
|
1074
1239
|
declare const SCOPE_ELEMENT = "element";
|
|
1075
1240
|
type ElementStoreState = {
|
|
@@ -1094,11 +1259,11 @@ type ElementRuntimeStore = {
|
|
|
1094
1259
|
setState: (nextState: ElementRuntimeState) => void;
|
|
1095
1260
|
subscribe: (listener: () => void) => () => void;
|
|
1096
1261
|
};
|
|
1097
|
-
declare const elementStore:
|
|
1262
|
+
declare const elementStore: StoreApi<ElementStoreState, object, "element">;
|
|
1098
1263
|
declare const withElementContext: <T>(context: Omit<ElementContextValue, "parent">, callback: () => T) => T;
|
|
1099
1264
|
declare const useElementContext: (scope?: string) => ElementContextValue | null;
|
|
1100
1265
|
declare const useElementStoreContext: (scope?: string) => ElementStoreContextValue | null;
|
|
1101
|
-
declare const useElementStore: (scope?: string) =>
|
|
1266
|
+
declare const useElementStore: (scope?: string) => ReturnOfUseStoreApi<ElementStoreState, object>;
|
|
1102
1267
|
declare function ElementProvider({
|
|
1103
1268
|
children,
|
|
1104
1269
|
path,
|
|
@@ -1232,21 +1397,21 @@ declare const createPlateStore: <E extends PlateEditor = PlateEditor>({
|
|
|
1232
1397
|
onTextChange,
|
|
1233
1398
|
onValueChange,
|
|
1234
1399
|
...state
|
|
1235
|
-
}?: Partial<PlateStoreState<E>>) =>
|
|
1236
|
-
trackedEditor:
|
|
1400
|
+
}?: Partial<PlateStoreState<E>>) => AtomStoreApi<PlateStoreState<E>, {
|
|
1401
|
+
trackedEditor: jotai5.Atom<{
|
|
1237
1402
|
editor: any;
|
|
1238
1403
|
version: number | null;
|
|
1239
1404
|
}>;
|
|
1240
|
-
trackedSelection:
|
|
1405
|
+
trackedSelection: jotai5.Atom<{
|
|
1241
1406
|
selection: any;
|
|
1242
1407
|
version: number | null;
|
|
1243
1408
|
}>;
|
|
1244
|
-
trackedValue:
|
|
1409
|
+
trackedValue: jotai5.Atom<{
|
|
1245
1410
|
value: any;
|
|
1246
1411
|
version: number | null;
|
|
1247
1412
|
}>;
|
|
1248
1413
|
}, "plate">;
|
|
1249
|
-
declare const PlateStoreProvider: React$1.FC<
|
|
1414
|
+
declare const PlateStoreProvider: React$1.FC<ProviderProps<{
|
|
1250
1415
|
composing: boolean | null;
|
|
1251
1416
|
decorate: ((options: {
|
|
1252
1417
|
editor: PlateEditor;
|
|
@@ -1292,282 +1457,282 @@ declare const PlateStoreProvider: React$1.FC<jotai_x2.ProviderProps<{
|
|
|
1292
1457
|
containerRef: React$1.RefObject<HTMLDivElement | null>;
|
|
1293
1458
|
editor: PlateEditor;
|
|
1294
1459
|
scrollRef: React$1.RefObject<HTMLDivElement | null>;
|
|
1295
|
-
}>>, plateStore:
|
|
1296
|
-
trackedEditor:
|
|
1460
|
+
}>>, plateStore: StoreApi<PlateStoreState<PlateEditor>, {
|
|
1461
|
+
trackedEditor: jotai5.Atom<{
|
|
1297
1462
|
editor: any;
|
|
1298
1463
|
version: number | null;
|
|
1299
1464
|
}>;
|
|
1300
|
-
trackedSelection:
|
|
1465
|
+
trackedSelection: jotai5.Atom<{
|
|
1301
1466
|
selection: any;
|
|
1302
1467
|
version: number | null;
|
|
1303
1468
|
}>;
|
|
1304
|
-
trackedValue:
|
|
1469
|
+
trackedValue: jotai5.Atom<{
|
|
1305
1470
|
value: any;
|
|
1306
1471
|
version: number | null;
|
|
1307
1472
|
}>;
|
|
1308
|
-
}, "plate">, usePlateLocalSet: <K$1 extends "decorate" | "renderElement" | "
|
|
1309
|
-
composing:
|
|
1310
|
-
decorate:
|
|
1473
|
+
}, "plate">, usePlateLocalSet: <K$1 extends "decorate" | "renderElement" | "renderLeaf" | "renderText" | "editor" | "id" | "onChange" | "onNodeChange" | "onTextChange" | "readOnly" | "composing" | "isMounted" | "primary" | "renderChunk" | "versionDecorate" | "versionEditor" | "versionSelection" | "versionValue" | "onSelectionChange" | "onValueChange" | "containerRef" | "scrollRef" | "trackedEditor" | "trackedSelection" | "trackedValue">(key: K$1, options?: string | UseAtomOptions) => ({
|
|
1474
|
+
composing: SimpleWritableAtom<boolean | null>;
|
|
1475
|
+
decorate: SimpleWritableAtom<((options: {
|
|
1311
1476
|
editor: PlateEditor;
|
|
1312
1477
|
entry: _platejs_slate20.NodeEntry;
|
|
1313
1478
|
}) => _platejs_slate20.TRange[]) | null>;
|
|
1314
|
-
isMounted:
|
|
1315
|
-
primary:
|
|
1316
|
-
readOnly:
|
|
1317
|
-
renderChunk:
|
|
1318
|
-
renderElement:
|
|
1319
|
-
renderLeaf:
|
|
1320
|
-
renderText:
|
|
1321
|
-
versionDecorate:
|
|
1322
|
-
versionEditor:
|
|
1323
|
-
versionSelection:
|
|
1324
|
-
versionValue:
|
|
1325
|
-
onChange:
|
|
1479
|
+
isMounted: SimpleWritableAtom<boolean | null>;
|
|
1480
|
+
primary: SimpleWritableAtom<boolean | null>;
|
|
1481
|
+
readOnly: SimpleWritableAtom<boolean | null>;
|
|
1482
|
+
renderChunk: SimpleWritableAtom<RenderChunkFn | null>;
|
|
1483
|
+
renderElement: SimpleWritableAtom<RenderElementFn | null>;
|
|
1484
|
+
renderLeaf: SimpleWritableAtom<RenderLeafFn | null>;
|
|
1485
|
+
renderText: SimpleWritableAtom<RenderTextFn | null>;
|
|
1486
|
+
versionDecorate: SimpleWritableAtom<number | null>;
|
|
1487
|
+
versionEditor: SimpleWritableAtom<number | null>;
|
|
1488
|
+
versionSelection: SimpleWritableAtom<number | null>;
|
|
1489
|
+
versionValue: SimpleWritableAtom<number | null>;
|
|
1490
|
+
onChange: SimpleWritableAtom<((options: {
|
|
1326
1491
|
editor: PlateEditor;
|
|
1327
1492
|
value: _platejs_slate20.Value;
|
|
1328
1493
|
}) => void) | null>;
|
|
1329
|
-
onNodeChange:
|
|
1494
|
+
onNodeChange: SimpleWritableAtom<((options: {
|
|
1330
1495
|
editor: PlateEditor;
|
|
1331
1496
|
node: _platejs_slate20.Descendant;
|
|
1332
1497
|
operation: _platejs_slate20.NodeOperation;
|
|
1333
1498
|
prevNode: _platejs_slate20.Descendant;
|
|
1334
1499
|
}) => void) | null>;
|
|
1335
|
-
onSelectionChange:
|
|
1500
|
+
onSelectionChange: SimpleWritableAtom<((options: {
|
|
1336
1501
|
editor: PlateEditor;
|
|
1337
1502
|
selection: _platejs_slate20.TSelection;
|
|
1338
1503
|
}) => void) | null>;
|
|
1339
|
-
onTextChange:
|
|
1504
|
+
onTextChange: SimpleWritableAtom<((options: {
|
|
1340
1505
|
editor: PlateEditor;
|
|
1341
1506
|
node: _platejs_slate20.Descendant;
|
|
1342
1507
|
operation: _platejs_slate20.TextOperation;
|
|
1343
1508
|
prevText: string;
|
|
1344
1509
|
text: string;
|
|
1345
1510
|
}) => void) | null>;
|
|
1346
|
-
onValueChange:
|
|
1511
|
+
onValueChange: SimpleWritableAtom<((options: {
|
|
1347
1512
|
editor: PlateEditor;
|
|
1348
1513
|
value: _platejs_slate20.Value;
|
|
1349
1514
|
}) => void) | null>;
|
|
1350
|
-
id:
|
|
1351
|
-
containerRef:
|
|
1352
|
-
editor:
|
|
1353
|
-
scrollRef:
|
|
1515
|
+
id: SimpleWritableAtom<string>;
|
|
1516
|
+
containerRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1517
|
+
editor: SimpleWritableAtom<PlateEditor>;
|
|
1518
|
+
scrollRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1354
1519
|
} & {
|
|
1355
|
-
trackedEditor:
|
|
1520
|
+
trackedEditor: jotai5.Atom<{
|
|
1356
1521
|
editor: any;
|
|
1357
1522
|
version: number | null;
|
|
1358
1523
|
}>;
|
|
1359
|
-
trackedSelection:
|
|
1524
|
+
trackedSelection: jotai5.Atom<{
|
|
1360
1525
|
selection: any;
|
|
1361
1526
|
version: number | null;
|
|
1362
1527
|
}>;
|
|
1363
|
-
trackedValue:
|
|
1528
|
+
trackedValue: jotai5.Atom<{
|
|
1364
1529
|
value: any;
|
|
1365
1530
|
version: number | null;
|
|
1366
1531
|
}>;
|
|
1367
|
-
})[K$1] extends
|
|
1368
|
-
composing:
|
|
1369
|
-
decorate:
|
|
1532
|
+
})[K$1] extends jotai5.WritableAtom<infer _V, infer A extends unknown[], infer R> ? (...args: A) => R : never, usePlateLocalState: <K$1 extends "decorate" | "renderElement" | "renderLeaf" | "renderText" | "editor" | "id" | "onChange" | "onNodeChange" | "onTextChange" | "readOnly" | "composing" | "isMounted" | "primary" | "renderChunk" | "versionDecorate" | "versionEditor" | "versionSelection" | "versionValue" | "onSelectionChange" | "onValueChange" | "containerRef" | "scrollRef" | "trackedEditor" | "trackedSelection" | "trackedValue">(key: K$1, options?: string | UseAtomOptions) => ({
|
|
1533
|
+
composing: SimpleWritableAtom<boolean | null>;
|
|
1534
|
+
decorate: SimpleWritableAtom<((options: {
|
|
1370
1535
|
editor: PlateEditor;
|
|
1371
1536
|
entry: _platejs_slate20.NodeEntry;
|
|
1372
1537
|
}) => _platejs_slate20.TRange[]) | null>;
|
|
1373
|
-
isMounted:
|
|
1374
|
-
primary:
|
|
1375
|
-
readOnly:
|
|
1376
|
-
renderChunk:
|
|
1377
|
-
renderElement:
|
|
1378
|
-
renderLeaf:
|
|
1379
|
-
renderText:
|
|
1380
|
-
versionDecorate:
|
|
1381
|
-
versionEditor:
|
|
1382
|
-
versionSelection:
|
|
1383
|
-
versionValue:
|
|
1384
|
-
onChange:
|
|
1538
|
+
isMounted: SimpleWritableAtom<boolean | null>;
|
|
1539
|
+
primary: SimpleWritableAtom<boolean | null>;
|
|
1540
|
+
readOnly: SimpleWritableAtom<boolean | null>;
|
|
1541
|
+
renderChunk: SimpleWritableAtom<RenderChunkFn | null>;
|
|
1542
|
+
renderElement: SimpleWritableAtom<RenderElementFn | null>;
|
|
1543
|
+
renderLeaf: SimpleWritableAtom<RenderLeafFn | null>;
|
|
1544
|
+
renderText: SimpleWritableAtom<RenderTextFn | null>;
|
|
1545
|
+
versionDecorate: SimpleWritableAtom<number | null>;
|
|
1546
|
+
versionEditor: SimpleWritableAtom<number | null>;
|
|
1547
|
+
versionSelection: SimpleWritableAtom<number | null>;
|
|
1548
|
+
versionValue: SimpleWritableAtom<number | null>;
|
|
1549
|
+
onChange: SimpleWritableAtom<((options: {
|
|
1385
1550
|
editor: PlateEditor;
|
|
1386
1551
|
value: _platejs_slate20.Value;
|
|
1387
1552
|
}) => void) | null>;
|
|
1388
|
-
onNodeChange:
|
|
1553
|
+
onNodeChange: SimpleWritableAtom<((options: {
|
|
1389
1554
|
editor: PlateEditor;
|
|
1390
1555
|
node: _platejs_slate20.Descendant;
|
|
1391
1556
|
operation: _platejs_slate20.NodeOperation;
|
|
1392
1557
|
prevNode: _platejs_slate20.Descendant;
|
|
1393
1558
|
}) => void) | null>;
|
|
1394
|
-
onSelectionChange:
|
|
1559
|
+
onSelectionChange: SimpleWritableAtom<((options: {
|
|
1395
1560
|
editor: PlateEditor;
|
|
1396
1561
|
selection: _platejs_slate20.TSelection;
|
|
1397
1562
|
}) => void) | null>;
|
|
1398
|
-
onTextChange:
|
|
1563
|
+
onTextChange: SimpleWritableAtom<((options: {
|
|
1399
1564
|
editor: PlateEditor;
|
|
1400
1565
|
node: _platejs_slate20.Descendant;
|
|
1401
1566
|
operation: _platejs_slate20.TextOperation;
|
|
1402
1567
|
prevText: string;
|
|
1403
1568
|
text: string;
|
|
1404
1569
|
}) => void) | null>;
|
|
1405
|
-
onValueChange:
|
|
1570
|
+
onValueChange: SimpleWritableAtom<((options: {
|
|
1406
1571
|
editor: PlateEditor;
|
|
1407
1572
|
value: _platejs_slate20.Value;
|
|
1408
1573
|
}) => void) | null>;
|
|
1409
|
-
id:
|
|
1410
|
-
containerRef:
|
|
1411
|
-
editor:
|
|
1412
|
-
scrollRef:
|
|
1574
|
+
id: SimpleWritableAtom<string>;
|
|
1575
|
+
containerRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1576
|
+
editor: SimpleWritableAtom<PlateEditor>;
|
|
1577
|
+
scrollRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1413
1578
|
} & {
|
|
1414
|
-
trackedEditor:
|
|
1579
|
+
trackedEditor: jotai5.Atom<{
|
|
1415
1580
|
editor: any;
|
|
1416
1581
|
version: number | null;
|
|
1417
1582
|
}>;
|
|
1418
|
-
trackedSelection:
|
|
1583
|
+
trackedSelection: jotai5.Atom<{
|
|
1419
1584
|
selection: any;
|
|
1420
1585
|
version: number | null;
|
|
1421
1586
|
}>;
|
|
1422
|
-
trackedValue:
|
|
1587
|
+
trackedValue: jotai5.Atom<{
|
|
1423
1588
|
value: any;
|
|
1424
1589
|
version: number | null;
|
|
1425
1590
|
}>;
|
|
1426
|
-
})[K$1] extends
|
|
1427
|
-
trackedEditor:
|
|
1591
|
+
})[K$1] extends jotai5.WritableAtom<infer V, infer A extends unknown[], infer R> ? [V, (...args: A) => R] : never, usePlateLocalStore: UseStoreApi<PlateStoreState<PlateEditor>, {
|
|
1592
|
+
trackedEditor: jotai5.Atom<{
|
|
1428
1593
|
editor: any;
|
|
1429
1594
|
version: number | null;
|
|
1430
1595
|
}>;
|
|
1431
|
-
trackedSelection:
|
|
1596
|
+
trackedSelection: jotai5.Atom<{
|
|
1432
1597
|
selection: any;
|
|
1433
1598
|
version: number | null;
|
|
1434
1599
|
}>;
|
|
1435
|
-
trackedValue:
|
|
1600
|
+
trackedValue: jotai5.Atom<{
|
|
1436
1601
|
value: any;
|
|
1437
1602
|
version: number | null;
|
|
1438
1603
|
}>;
|
|
1439
|
-
}>, usePlateLocalValue: <K$1 extends "decorate" | "renderElement" | "
|
|
1440
|
-
composing:
|
|
1441
|
-
decorate:
|
|
1604
|
+
}>, usePlateLocalValue: <K$1 extends "decorate" | "renderElement" | "renderLeaf" | "renderText" | "editor" | "id" | "onChange" | "onNodeChange" | "onTextChange" | "readOnly" | "composing" | "isMounted" | "primary" | "renderChunk" | "versionDecorate" | "versionEditor" | "versionSelection" | "versionValue" | "onSelectionChange" | "onValueChange" | "containerRef" | "scrollRef" | "trackedEditor" | "trackedSelection" | "trackedValue", S = (({
|
|
1605
|
+
composing: SimpleWritableAtom<boolean | null>;
|
|
1606
|
+
decorate: SimpleWritableAtom<((options: {
|
|
1442
1607
|
editor: PlateEditor;
|
|
1443
1608
|
entry: _platejs_slate20.NodeEntry;
|
|
1444
1609
|
}) => _platejs_slate20.TRange[]) | null>;
|
|
1445
|
-
isMounted:
|
|
1446
|
-
primary:
|
|
1447
|
-
readOnly:
|
|
1448
|
-
renderChunk:
|
|
1449
|
-
renderElement:
|
|
1450
|
-
renderLeaf:
|
|
1451
|
-
renderText:
|
|
1452
|
-
versionDecorate:
|
|
1453
|
-
versionEditor:
|
|
1454
|
-
versionSelection:
|
|
1455
|
-
versionValue:
|
|
1456
|
-
onChange:
|
|
1610
|
+
isMounted: SimpleWritableAtom<boolean | null>;
|
|
1611
|
+
primary: SimpleWritableAtom<boolean | null>;
|
|
1612
|
+
readOnly: SimpleWritableAtom<boolean | null>;
|
|
1613
|
+
renderChunk: SimpleWritableAtom<RenderChunkFn | null>;
|
|
1614
|
+
renderElement: SimpleWritableAtom<RenderElementFn | null>;
|
|
1615
|
+
renderLeaf: SimpleWritableAtom<RenderLeafFn | null>;
|
|
1616
|
+
renderText: SimpleWritableAtom<RenderTextFn | null>;
|
|
1617
|
+
versionDecorate: SimpleWritableAtom<number | null>;
|
|
1618
|
+
versionEditor: SimpleWritableAtom<number | null>;
|
|
1619
|
+
versionSelection: SimpleWritableAtom<number | null>;
|
|
1620
|
+
versionValue: SimpleWritableAtom<number | null>;
|
|
1621
|
+
onChange: SimpleWritableAtom<((options: {
|
|
1457
1622
|
editor: PlateEditor;
|
|
1458
1623
|
value: _platejs_slate20.Value;
|
|
1459
1624
|
}) => void) | null>;
|
|
1460
|
-
onNodeChange:
|
|
1625
|
+
onNodeChange: SimpleWritableAtom<((options: {
|
|
1461
1626
|
editor: PlateEditor;
|
|
1462
1627
|
node: _platejs_slate20.Descendant;
|
|
1463
1628
|
operation: _platejs_slate20.NodeOperation;
|
|
1464
1629
|
prevNode: _platejs_slate20.Descendant;
|
|
1465
1630
|
}) => void) | null>;
|
|
1466
|
-
onSelectionChange:
|
|
1631
|
+
onSelectionChange: SimpleWritableAtom<((options: {
|
|
1467
1632
|
editor: PlateEditor;
|
|
1468
1633
|
selection: _platejs_slate20.TSelection;
|
|
1469
1634
|
}) => void) | null>;
|
|
1470
|
-
onTextChange:
|
|
1635
|
+
onTextChange: SimpleWritableAtom<((options: {
|
|
1471
1636
|
editor: PlateEditor;
|
|
1472
1637
|
node: _platejs_slate20.Descendant;
|
|
1473
1638
|
operation: _platejs_slate20.TextOperation;
|
|
1474
1639
|
prevText: string;
|
|
1475
1640
|
text: string;
|
|
1476
1641
|
}) => void) | null>;
|
|
1477
|
-
onValueChange:
|
|
1642
|
+
onValueChange: SimpleWritableAtom<((options: {
|
|
1478
1643
|
editor: PlateEditor;
|
|
1479
1644
|
value: _platejs_slate20.Value;
|
|
1480
1645
|
}) => void) | null>;
|
|
1481
|
-
id:
|
|
1482
|
-
containerRef:
|
|
1483
|
-
editor:
|
|
1484
|
-
scrollRef:
|
|
1646
|
+
id: SimpleWritableAtom<string>;
|
|
1647
|
+
containerRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1648
|
+
editor: SimpleWritableAtom<PlateEditor>;
|
|
1649
|
+
scrollRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1485
1650
|
} & {
|
|
1486
|
-
trackedEditor:
|
|
1651
|
+
trackedEditor: jotai5.Atom<{
|
|
1487
1652
|
editor: any;
|
|
1488
1653
|
version: number | null;
|
|
1489
1654
|
}>;
|
|
1490
|
-
trackedSelection:
|
|
1655
|
+
trackedSelection: jotai5.Atom<{
|
|
1491
1656
|
selection: any;
|
|
1492
1657
|
version: number | null;
|
|
1493
1658
|
}>;
|
|
1494
|
-
trackedValue:
|
|
1659
|
+
trackedValue: jotai5.Atom<{
|
|
1495
1660
|
value: any;
|
|
1496
1661
|
version: number | null;
|
|
1497
1662
|
}>;
|
|
1498
|
-
})[K$1] extends
|
|
1663
|
+
})[K$1] extends jotai5.Atom<infer V> ? V : never)>(key: K$1, options?: ({
|
|
1499
1664
|
selector?: ((v: ({
|
|
1500
|
-
composing:
|
|
1501
|
-
decorate:
|
|
1665
|
+
composing: SimpleWritableAtom<boolean | null>;
|
|
1666
|
+
decorate: SimpleWritableAtom<((options: {
|
|
1502
1667
|
editor: PlateEditor;
|
|
1503
1668
|
entry: _platejs_slate20.NodeEntry;
|
|
1504
1669
|
}) => _platejs_slate20.TRange[]) | null>;
|
|
1505
|
-
isMounted:
|
|
1506
|
-
primary:
|
|
1507
|
-
readOnly:
|
|
1508
|
-
renderChunk:
|
|
1509
|
-
renderElement:
|
|
1510
|
-
renderLeaf:
|
|
1511
|
-
renderText:
|
|
1512
|
-
versionDecorate:
|
|
1513
|
-
versionEditor:
|
|
1514
|
-
versionSelection:
|
|
1515
|
-
versionValue:
|
|
1516
|
-
onChange:
|
|
1670
|
+
isMounted: SimpleWritableAtom<boolean | null>;
|
|
1671
|
+
primary: SimpleWritableAtom<boolean | null>;
|
|
1672
|
+
readOnly: SimpleWritableAtom<boolean | null>;
|
|
1673
|
+
renderChunk: SimpleWritableAtom<RenderChunkFn | null>;
|
|
1674
|
+
renderElement: SimpleWritableAtom<RenderElementFn | null>;
|
|
1675
|
+
renderLeaf: SimpleWritableAtom<RenderLeafFn | null>;
|
|
1676
|
+
renderText: SimpleWritableAtom<RenderTextFn | null>;
|
|
1677
|
+
versionDecorate: SimpleWritableAtom<number | null>;
|
|
1678
|
+
versionEditor: SimpleWritableAtom<number | null>;
|
|
1679
|
+
versionSelection: SimpleWritableAtom<number | null>;
|
|
1680
|
+
versionValue: SimpleWritableAtom<number | null>;
|
|
1681
|
+
onChange: SimpleWritableAtom<((options: {
|
|
1517
1682
|
editor: PlateEditor;
|
|
1518
1683
|
value: _platejs_slate20.Value;
|
|
1519
1684
|
}) => void) | null>;
|
|
1520
|
-
onNodeChange:
|
|
1685
|
+
onNodeChange: SimpleWritableAtom<((options: {
|
|
1521
1686
|
editor: PlateEditor;
|
|
1522
1687
|
node: _platejs_slate20.Descendant;
|
|
1523
1688
|
operation: _platejs_slate20.NodeOperation;
|
|
1524
1689
|
prevNode: _platejs_slate20.Descendant;
|
|
1525
1690
|
}) => void) | null>;
|
|
1526
|
-
onSelectionChange:
|
|
1691
|
+
onSelectionChange: SimpleWritableAtom<((options: {
|
|
1527
1692
|
editor: PlateEditor;
|
|
1528
1693
|
selection: _platejs_slate20.TSelection;
|
|
1529
1694
|
}) => void) | null>;
|
|
1530
|
-
onTextChange:
|
|
1695
|
+
onTextChange: SimpleWritableAtom<((options: {
|
|
1531
1696
|
editor: PlateEditor;
|
|
1532
1697
|
node: _platejs_slate20.Descendant;
|
|
1533
1698
|
operation: _platejs_slate20.TextOperation;
|
|
1534
1699
|
prevText: string;
|
|
1535
1700
|
text: string;
|
|
1536
1701
|
}) => void) | null>;
|
|
1537
|
-
onValueChange:
|
|
1702
|
+
onValueChange: SimpleWritableAtom<((options: {
|
|
1538
1703
|
editor: PlateEditor;
|
|
1539
1704
|
value: _platejs_slate20.Value;
|
|
1540
1705
|
}) => void) | null>;
|
|
1541
|
-
id:
|
|
1542
|
-
containerRef:
|
|
1543
|
-
editor:
|
|
1544
|
-
scrollRef:
|
|
1706
|
+
id: SimpleWritableAtom<string>;
|
|
1707
|
+
containerRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1708
|
+
editor: SimpleWritableAtom<PlateEditor>;
|
|
1709
|
+
scrollRef: SimpleWritableAtom<React$1.RefObject<HTMLDivElement | null>>;
|
|
1545
1710
|
} & {
|
|
1546
|
-
trackedEditor:
|
|
1711
|
+
trackedEditor: jotai5.Atom<{
|
|
1547
1712
|
editor: any;
|
|
1548
1713
|
version: number | null;
|
|
1549
1714
|
}>;
|
|
1550
|
-
trackedSelection:
|
|
1715
|
+
trackedSelection: jotai5.Atom<{
|
|
1551
1716
|
selection: any;
|
|
1552
1717
|
version: number | null;
|
|
1553
1718
|
}>;
|
|
1554
|
-
trackedValue:
|
|
1719
|
+
trackedValue: jotai5.Atom<{
|
|
1555
1720
|
value: any;
|
|
1556
1721
|
version: number | null;
|
|
1557
1722
|
}>;
|
|
1558
|
-
})[K$1] extends
|
|
1723
|
+
})[K$1] extends jotai5.Atom<infer V_1> ? V_1 : never, prevSelectorOutput?: S | undefined) => S) | undefined;
|
|
1559
1724
|
equalityFn?: ((prev: S, next: S) => boolean) | undefined;
|
|
1560
|
-
} &
|
|
1561
|
-
declare const usePlateStore: (id?: string) =>
|
|
1562
|
-
trackedEditor:
|
|
1725
|
+
} & UseAtomOptions) | undefined, deps?: unknown[]) => S;
|
|
1726
|
+
declare const usePlateStore: (id?: string) => ReturnOfUseStoreApi<PlateStoreState<PlateEditor>, {
|
|
1727
|
+
trackedEditor: jotai5.Atom<{
|
|
1563
1728
|
editor: any;
|
|
1564
1729
|
version: number | null;
|
|
1565
1730
|
}>;
|
|
1566
|
-
trackedSelection:
|
|
1731
|
+
trackedSelection: jotai5.Atom<{
|
|
1567
1732
|
selection: any;
|
|
1568
1733
|
version: number | null;
|
|
1569
1734
|
}>;
|
|
1570
|
-
trackedValue:
|
|
1735
|
+
trackedValue: jotai5.Atom<{
|
|
1571
1736
|
value: any;
|
|
1572
1737
|
version: number | null;
|
|
1573
1738
|
}>;
|
|
@@ -1664,218 +1829,28 @@ declare function useEditorPluginOptions<C extends AnyPluginConfig, U>(editor: Pl
|
|
|
1664
1829
|
}): U;
|
|
1665
1830
|
//#endregion
|
|
1666
1831
|
//#region src/react/stores/plate-controller/plateControllerStore.d.ts
|
|
1667
|
-
declare const PlateController: React$1.FC<
|
|
1832
|
+
declare const PlateController: React$1.FC<ProviderProps<{
|
|
1668
1833
|
activeId: string | null;
|
|
1669
|
-
editorStores: Record<string,
|
|
1670
|
-
get: <Value$1>(atom: Atom<Value$1>) => Value$1;
|
|
1671
|
-
set: <Value$1, Args extends unknown[], Result>(atom: jotai10.WritableAtom<Value$1, Args, Result>, ...args: Args) => Result;
|
|
1672
|
-
sub: (atom: Atom<unknown>, listener: () => void) => () => void;
|
|
1673
|
-
} & Partial<{
|
|
1674
|
-
dev_subscribe_store: (l: (action: {
|
|
1675
|
-
type: "write";
|
|
1676
|
-
flushed: Set<Atom<unknown>>;
|
|
1677
|
-
} | {
|
|
1678
|
-
type: "async-write";
|
|
1679
|
-
flushed: Set<Atom<unknown>>;
|
|
1680
|
-
} | {
|
|
1681
|
-
type: "sub";
|
|
1682
|
-
flushed: Set<Atom<unknown>>;
|
|
1683
|
-
} | {
|
|
1684
|
-
type: "unsub";
|
|
1685
|
-
} | {
|
|
1686
|
-
type: "restore";
|
|
1687
|
-
flushed: Set<Atom<unknown>>;
|
|
1688
|
-
}) => void, rev: 2) => () => void;
|
|
1689
|
-
dev_get_mounted_atoms: () => IterableIterator<Atom<unknown>>;
|
|
1690
|
-
dev_get_atom_state: (a: Atom<unknown>) => ({
|
|
1691
|
-
d: Map<Atom<unknown>, /*elided*/any & ({
|
|
1692
|
-
e: unknown;
|
|
1693
|
-
} | {
|
|
1694
|
-
v: unknown;
|
|
1695
|
-
})>;
|
|
1696
|
-
} & ({
|
|
1697
|
-
e: unknown;
|
|
1698
|
-
} | {
|
|
1699
|
-
v: unknown;
|
|
1700
|
-
})) | undefined;
|
|
1701
|
-
dev_get_mounted: (a: Atom<unknown>) => {
|
|
1702
|
-
l: Set<() => void>;
|
|
1703
|
-
t: Set<Atom<unknown>>;
|
|
1704
|
-
u?: () => void;
|
|
1705
|
-
} | undefined;
|
|
1706
|
-
dev_restore_atoms: (values: Iterable<readonly [Atom<unknown>, unknown]>) => void;
|
|
1707
|
-
}>) | null>;
|
|
1834
|
+
editorStores: Record<string, jotai_vanilla_internals0.INTERNAL_Store | null>;
|
|
1708
1835
|
primaryEditorIds: string[];
|
|
1709
|
-
}>>, plateControllerStore:
|
|
1710
|
-
activeId:
|
|
1836
|
+
}>>, plateControllerStore: StoreApi<{
|
|
1837
|
+
activeId: jotai5.PrimitiveAtom<string | null> & {
|
|
1711
1838
|
init: string | null;
|
|
1712
1839
|
};
|
|
1713
|
-
editorStores:
|
|
1714
|
-
|
|
1715
|
-
set: <Value$1, Args extends unknown[], Result>(atom: jotai10.WritableAtom<Value$1, Args, Result>, ...args: Args) => Result;
|
|
1716
|
-
sub: (atom: Atom<unknown>, listener: () => void) => () => void;
|
|
1717
|
-
} & Partial<{
|
|
1718
|
-
dev_subscribe_store: (l: (action: {
|
|
1719
|
-
type: "write";
|
|
1720
|
-
flushed: Set<Atom<unknown>>;
|
|
1721
|
-
} | {
|
|
1722
|
-
type: "async-write";
|
|
1723
|
-
flushed: Set<Atom<unknown>>;
|
|
1724
|
-
} | {
|
|
1725
|
-
type: "sub";
|
|
1726
|
-
flushed: Set<Atom<unknown>>;
|
|
1727
|
-
} | {
|
|
1728
|
-
type: "unsub";
|
|
1729
|
-
} | {
|
|
1730
|
-
type: "restore";
|
|
1731
|
-
flushed: Set<Atom<unknown>>;
|
|
1732
|
-
}) => void, rev: 2) => () => void;
|
|
1733
|
-
dev_get_mounted_atoms: () => IterableIterator<Atom<unknown>>;
|
|
1734
|
-
dev_get_atom_state: (a: Atom<unknown>) => ({
|
|
1735
|
-
d: Map<Atom<unknown>, /*elided*/any & ({
|
|
1736
|
-
e: unknown;
|
|
1737
|
-
} | {
|
|
1738
|
-
v: unknown;
|
|
1739
|
-
})>;
|
|
1740
|
-
} & ({
|
|
1741
|
-
e: unknown;
|
|
1742
|
-
} | {
|
|
1743
|
-
v: unknown;
|
|
1744
|
-
})) | undefined;
|
|
1745
|
-
dev_get_mounted: (a: Atom<unknown>) => {
|
|
1746
|
-
l: Set<() => void>;
|
|
1747
|
-
t: Set<Atom<unknown>>;
|
|
1748
|
-
u?: () => void;
|
|
1749
|
-
} | undefined;
|
|
1750
|
-
dev_restore_atoms: (values: Iterable<readonly [Atom<unknown>, unknown]>) => void;
|
|
1751
|
-
}>) | null>> & {
|
|
1752
|
-
init: Record<string, ({
|
|
1753
|
-
get: <Value$1>(atom: Atom<Value$1>) => Value$1;
|
|
1754
|
-
set: <Value$1, Args extends unknown[], Result>(atom: jotai10.WritableAtom<Value$1, Args, Result>, ...args: Args) => Result;
|
|
1755
|
-
sub: (atom: Atom<unknown>, listener: () => void) => () => void;
|
|
1756
|
-
} & Partial<{
|
|
1757
|
-
dev_subscribe_store: (l: (action: {
|
|
1758
|
-
type: "write";
|
|
1759
|
-
flushed: Set<Atom<unknown>>;
|
|
1760
|
-
} | {
|
|
1761
|
-
type: "async-write";
|
|
1762
|
-
flushed: Set<Atom<unknown>>;
|
|
1763
|
-
} | {
|
|
1764
|
-
type: "sub";
|
|
1765
|
-
flushed: Set<Atom<unknown>>;
|
|
1766
|
-
} | {
|
|
1767
|
-
type: "unsub";
|
|
1768
|
-
} | {
|
|
1769
|
-
type: "restore";
|
|
1770
|
-
flushed: Set<Atom<unknown>>;
|
|
1771
|
-
}) => void, rev: 2) => () => void;
|
|
1772
|
-
dev_get_mounted_atoms: () => IterableIterator<Atom<unknown>>;
|
|
1773
|
-
dev_get_atom_state: (a: Atom<unknown>) => ({
|
|
1774
|
-
d: Map<Atom<unknown>, /*elided*/any & ({
|
|
1775
|
-
e: unknown;
|
|
1776
|
-
} | {
|
|
1777
|
-
v: unknown;
|
|
1778
|
-
})>;
|
|
1779
|
-
} & ({
|
|
1780
|
-
e: unknown;
|
|
1781
|
-
} | {
|
|
1782
|
-
v: unknown;
|
|
1783
|
-
})) | undefined;
|
|
1784
|
-
dev_get_mounted: (a: Atom<unknown>) => {
|
|
1785
|
-
l: Set<() => void>;
|
|
1786
|
-
t: Set<Atom<unknown>>;
|
|
1787
|
-
u?: () => void;
|
|
1788
|
-
} | undefined;
|
|
1789
|
-
dev_restore_atoms: (values: Iterable<readonly [Atom<unknown>, unknown]>) => void;
|
|
1790
|
-
}>) | null>;
|
|
1840
|
+
editorStores: jotai5.PrimitiveAtom<Record<string, jotai_vanilla_internals0.INTERNAL_Store | null>> & {
|
|
1841
|
+
init: Record<string, jotai_vanilla_internals0.INTERNAL_Store | null>;
|
|
1791
1842
|
};
|
|
1792
|
-
primaryEditorIds:
|
|
1843
|
+
primaryEditorIds: jotai5.PrimitiveAtom<string[]> & {
|
|
1793
1844
|
init: string[];
|
|
1794
1845
|
};
|
|
1795
|
-
}, object, "plateController">, _usePlateControllerStore:
|
|
1796
|
-
activeId:
|
|
1846
|
+
}, object, "plateController">, _usePlateControllerStore: UseStoreApi<{
|
|
1847
|
+
activeId: jotai5.PrimitiveAtom<string | null> & {
|
|
1797
1848
|
init: string | null;
|
|
1798
1849
|
};
|
|
1799
|
-
editorStores:
|
|
1800
|
-
|
|
1801
|
-
set: <Value$1, Args extends unknown[], Result>(atom: jotai10.WritableAtom<Value$1, Args, Result>, ...args: Args) => Result;
|
|
1802
|
-
sub: (atom: Atom<unknown>, listener: () => void) => () => void;
|
|
1803
|
-
} & Partial<{
|
|
1804
|
-
dev_subscribe_store: (l: (action: {
|
|
1805
|
-
type: "write";
|
|
1806
|
-
flushed: Set<Atom<unknown>>;
|
|
1807
|
-
} | {
|
|
1808
|
-
type: "async-write";
|
|
1809
|
-
flushed: Set<Atom<unknown>>;
|
|
1810
|
-
} | {
|
|
1811
|
-
type: "sub";
|
|
1812
|
-
flushed: Set<Atom<unknown>>;
|
|
1813
|
-
} | {
|
|
1814
|
-
type: "unsub";
|
|
1815
|
-
} | {
|
|
1816
|
-
type: "restore";
|
|
1817
|
-
flushed: Set<Atom<unknown>>;
|
|
1818
|
-
}) => void, rev: 2) => () => void;
|
|
1819
|
-
dev_get_mounted_atoms: () => IterableIterator<Atom<unknown>>;
|
|
1820
|
-
dev_get_atom_state: (a: Atom<unknown>) => ({
|
|
1821
|
-
d: Map<Atom<unknown>, /*elided*/any & ({
|
|
1822
|
-
e: unknown;
|
|
1823
|
-
} | {
|
|
1824
|
-
v: unknown;
|
|
1825
|
-
})>;
|
|
1826
|
-
} & ({
|
|
1827
|
-
e: unknown;
|
|
1828
|
-
} | {
|
|
1829
|
-
v: unknown;
|
|
1830
|
-
})) | undefined;
|
|
1831
|
-
dev_get_mounted: (a: Atom<unknown>) => {
|
|
1832
|
-
l: Set<() => void>;
|
|
1833
|
-
t: Set<Atom<unknown>>;
|
|
1834
|
-
u?: () => void;
|
|
1835
|
-
} | undefined;
|
|
1836
|
-
dev_restore_atoms: (values: Iterable<readonly [Atom<unknown>, unknown]>) => void;
|
|
1837
|
-
}>) | null>> & {
|
|
1838
|
-
init: Record<string, ({
|
|
1839
|
-
get: <Value$1>(atom: Atom<Value$1>) => Value$1;
|
|
1840
|
-
set: <Value$1, Args extends unknown[], Result>(atom: jotai10.WritableAtom<Value$1, Args, Result>, ...args: Args) => Result;
|
|
1841
|
-
sub: (atom: Atom<unknown>, listener: () => void) => () => void;
|
|
1842
|
-
} & Partial<{
|
|
1843
|
-
dev_subscribe_store: (l: (action: {
|
|
1844
|
-
type: "write";
|
|
1845
|
-
flushed: Set<Atom<unknown>>;
|
|
1846
|
-
} | {
|
|
1847
|
-
type: "async-write";
|
|
1848
|
-
flushed: Set<Atom<unknown>>;
|
|
1849
|
-
} | {
|
|
1850
|
-
type: "sub";
|
|
1851
|
-
flushed: Set<Atom<unknown>>;
|
|
1852
|
-
} | {
|
|
1853
|
-
type: "unsub";
|
|
1854
|
-
} | {
|
|
1855
|
-
type: "restore";
|
|
1856
|
-
flushed: Set<Atom<unknown>>;
|
|
1857
|
-
}) => void, rev: 2) => () => void;
|
|
1858
|
-
dev_get_mounted_atoms: () => IterableIterator<Atom<unknown>>;
|
|
1859
|
-
dev_get_atom_state: (a: Atom<unknown>) => ({
|
|
1860
|
-
d: Map<Atom<unknown>, /*elided*/any & ({
|
|
1861
|
-
e: unknown;
|
|
1862
|
-
} | {
|
|
1863
|
-
v: unknown;
|
|
1864
|
-
})>;
|
|
1865
|
-
} & ({
|
|
1866
|
-
e: unknown;
|
|
1867
|
-
} | {
|
|
1868
|
-
v: unknown;
|
|
1869
|
-
})) | undefined;
|
|
1870
|
-
dev_get_mounted: (a: Atom<unknown>) => {
|
|
1871
|
-
l: Set<() => void>;
|
|
1872
|
-
t: Set<Atom<unknown>>;
|
|
1873
|
-
u?: () => void;
|
|
1874
|
-
} | undefined;
|
|
1875
|
-
dev_restore_atoms: (values: Iterable<readonly [Atom<unknown>, unknown]>) => void;
|
|
1876
|
-
}>) | null>;
|
|
1850
|
+
editorStores: jotai5.PrimitiveAtom<Record<string, jotai_vanilla_internals0.INTERNAL_Store | null>> & {
|
|
1851
|
+
init: Record<string, jotai_vanilla_internals0.INTERNAL_Store | null>;
|
|
1877
1852
|
};
|
|
1878
|
-
primaryEditorIds:
|
|
1853
|
+
primaryEditorIds: jotai5.PrimitiveAtom<string[]> & {
|
|
1879
1854
|
init: string[];
|
|
1880
1855
|
};
|
|
1881
1856
|
}, object>;
|