@lofcz/platejs-core 53.1.6 → 53.2.1
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-BooMghRU.d.ts → index-ClAE30YQ.d.ts} +99 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -4
- package/dist/react/index.d.ts +173 -131
- package/dist/react/index.js +1016 -175
- package/dist/static/index.d.ts +1 -1
- package/dist/static/index.js +2 -2
- package/dist/{static-DAs0P1Ms.js → static-C-jR24Fx.js} +3 -3
- package/dist/{withSlate-Ck8dLhUt.js → withSlate-pfxNb3FA.js} +255 -102
- package/package.json +4 -4
|
@@ -565,9 +565,13 @@ interface NodeStaticWrapperComponentProps<C extends AnyPluginConfig = PluginConf
|
|
|
565
565
|
}
|
|
566
566
|
/** @deprecated Use {@link RenderStaticNodeWrapperFunction} instead. */
|
|
567
567
|
type NodeStaticWrapperComponentReturnType<C extends AnyPluginConfig = PluginConfig> = React.FC<SlateRenderElementProps<TElement, C>> | undefined;
|
|
568
|
+
type TransformInitialValue<C extends AnyPluginConfig = PluginConfig> = (ctx: SlatePluginContext<C> & {
|
|
569
|
+
value: Value;
|
|
570
|
+
}) => Value;
|
|
571
|
+
/** @deprecated Use {@link TransformInitialValue} instead. */
|
|
568
572
|
type NormalizeInitialValue<C extends AnyPluginConfig = PluginConfig> = (ctx: SlatePluginContext<C> & {
|
|
569
573
|
value: Value;
|
|
570
|
-
}) => void;
|
|
574
|
+
}) => Value | void;
|
|
571
575
|
type OverrideEditor<C extends AnyPluginConfig = PluginConfig> = (ctx: SlatePluginContext<C>) => {
|
|
572
576
|
api?: Deep2Partial<EditorApi & CorePluginApi> & { [K in keyof InferApi<C>]?: InferApi<C>[K] extends ((...args: any[]) => any) ? (...args: Parameters<InferApi<C>[K]>) => ReturnType<InferApi<C>[K]> : InferApi<C>[K] extends Record<string, (...args: any[]) => any> ? { [N in keyof InferApi<C>[K]]?: (...args: Parameters<InferApi<C>[K][N]>) => ReturnType<InferApi<C>[K][N]> } : never };
|
|
573
577
|
transforms?: Deep2Partial<EditorTransforms & CorePluginTransforms> & { [K in keyof InferTransforms<C>]?: InferTransforms<C>[K] extends ((...args: any[]) => any) ? (...args: Parameters<InferTransforms<C>[K]>) => ReturnType<InferTransforms<C>[K]> : InferTransforms<C>[K] extends Record<string, (...args: any[]) => any> ? { [N in keyof InferTransforms<C>[K]]?: (...args: Parameters<InferTransforms<C>[K][N]>) => ReturnType<InferTransforms<C>[K][N]> } : never };
|
|
@@ -605,6 +609,8 @@ type Serializer<C extends AnyPluginConfig = PluginConfig> = BaseSerializer & {
|
|
|
605
609
|
type SlatePlugin<C extends AnyPluginConfig = PluginConfig> = BasePlugin<C> & Nullable<{
|
|
606
610
|
decorate?: Decorate<WithAnyKey<C>>;
|
|
607
611
|
extendEditor?: ExtendEditor<WithAnyKey<C>>;
|
|
612
|
+
transformInitialValue?: TransformInitialValue<WithAnyKey<C>>;
|
|
613
|
+
/** @deprecated Use `transformInitialValue` instead. */
|
|
608
614
|
normalizeInitialValue?: NormalizeInitialValue<WithAnyKey<C>>;
|
|
609
615
|
}> & SlatePluginMethods<C> & {
|
|
610
616
|
handlers: Nullable<{
|
|
@@ -953,6 +959,7 @@ declare const resetBlock: (editor: SlateEditor, {
|
|
|
953
959
|
declare const setValue: <V extends Value>(editor: SlateEditor, value?: V | string) => void;
|
|
954
960
|
//#endregion
|
|
955
961
|
//#region src/lib/plugins/slate-extension/SlateExtensionPlugin.d.ts
|
|
962
|
+
declare const isElementStateEmpty: (editor: SlateEditor, element: TElement) => boolean;
|
|
956
963
|
type SlateExtensionConfig = PluginConfig<'slateExtension', {
|
|
957
964
|
onNodeChange: (options: {
|
|
958
965
|
editor: SlateEditor;
|
|
@@ -992,6 +999,7 @@ declare const SlateExtensionPlugin: SlatePlugin<PluginConfig<"slateExtension", {
|
|
|
992
999
|
text: string;
|
|
993
1000
|
}) => void;
|
|
994
1001
|
}, {
|
|
1002
|
+
isElementStateEmpty: (element: TElement) => boolean;
|
|
995
1003
|
redecorate: () => void;
|
|
996
1004
|
}, {
|
|
997
1005
|
init: ((args_0: InitOptions) => void) & ((args_0: InitOptions) => void);
|
|
@@ -1003,7 +1011,7 @@ declare const SlateExtensionPlugin: SlatePlugin<PluginConfig<"slateExtension", {
|
|
|
1003
1011
|
at?: _platejs_slate30.Path;
|
|
1004
1012
|
} | undefined) => true | undefined);
|
|
1005
1013
|
setValue: ((value?: string | _platejs_slate30.Value | undefined) => void) & ((value?: string | _platejs_slate30.Value | undefined) => void);
|
|
1006
|
-
apply: <N$1 extends
|
|
1014
|
+
apply: <N$1 extends TElement | TText>(operation: _platejs_slate30.Operation<N$1>) => void;
|
|
1007
1015
|
}, {}>>;
|
|
1008
1016
|
//#endregion
|
|
1009
1017
|
//#region src/lib/plugins/dom/withScrolling.d.ts
|
|
@@ -1217,13 +1225,35 @@ type NodeIdOptions = {
|
|
|
1217
1225
|
*/
|
|
1218
1226
|
idKey?: string;
|
|
1219
1227
|
/**
|
|
1220
|
-
*
|
|
1221
|
-
* are missing id. To disable this behavior, use `NodeIdPlugin.configure({
|
|
1222
|
-
* normalizeInitialValue: null })`.
|
|
1228
|
+
* Controls how missing ids are assigned in the initial value.
|
|
1223
1229
|
*
|
|
1224
|
-
*
|
|
1230
|
+
* - `'if-needed'`: normalize only when the first or last top-level node is
|
|
1231
|
+
* missing an id
|
|
1232
|
+
* - `'always'`: walk the whole initial value and fill any missing ids
|
|
1233
|
+
* - `false`: skip initial-value id assignment
|
|
1234
|
+
*
|
|
1235
|
+
* @default 'if-needed'
|
|
1225
1236
|
*/
|
|
1226
|
-
|
|
1237
|
+
initialValueIds?: false | 'always' | 'if-needed';
|
|
1238
|
+
/**
|
|
1239
|
+
* Legacy alias for `initialValueIds`.
|
|
1240
|
+
*
|
|
1241
|
+
* - `false`: only check the first and last top-level nodes
|
|
1242
|
+
* - `true`: walk the whole initial value and fill missing ids
|
|
1243
|
+
* - `null`: skip initial-value id assignment
|
|
1244
|
+
*
|
|
1245
|
+
* @deprecated Use `initialValueIds` instead.
|
|
1246
|
+
*/
|
|
1247
|
+
normalizeInitialValue?: boolean | null;
|
|
1248
|
+
/**
|
|
1249
|
+
* Reports duplicate-id scan cost during inserted-node normalization.
|
|
1250
|
+
*/
|
|
1251
|
+
onDuplicateIdScan?: (stats: {
|
|
1252
|
+
candidateCount: number;
|
|
1253
|
+
duration: number;
|
|
1254
|
+
existingCount: number;
|
|
1255
|
+
visitedCount: number;
|
|
1256
|
+
}) => void;
|
|
1227
1257
|
/**
|
|
1228
1258
|
* Reuse ids on undo/redo and copy/pasting if not existing in the document.
|
|
1229
1259
|
* This is disabled by default to avoid duplicate ids across documents.
|
|
@@ -1239,11 +1269,12 @@ type NodeIdOptions = {
|
|
|
1239
1269
|
idCreator?: () => any;
|
|
1240
1270
|
} & QueryNodeOptions;
|
|
1241
1271
|
type NormalizeNodeIdOptions = Pick<NodeIdOptions, 'allow' | 'exclude' | 'filter' | 'filterInline' | 'filterText' | 'idCreator' | 'idKey'>;
|
|
1242
|
-
/**
|
|
1243
|
-
* Normalize node IDs in a value without using editor operations. This is a pure
|
|
1244
|
-
* function that returns a new normalized value.
|
|
1245
|
-
*/
|
|
1246
1272
|
declare const normalizeNodeId: <V extends Value>(value: V, options?: NormalizeNodeIdOptions) => V;
|
|
1273
|
+
declare const normalizeNodeIdWithEditor: <V extends Value>(editor: {
|
|
1274
|
+
api: {
|
|
1275
|
+
isBlock: (node: Descendant) => boolean;
|
|
1276
|
+
};
|
|
1277
|
+
}, value: V, options?: NormalizeNodeIdOptions) => V;
|
|
1247
1278
|
type NodeIdConfig = PluginConfig<'nodeId', NodeIdOptions, {}, {
|
|
1248
1279
|
nodeId: {
|
|
1249
1280
|
normalize: () => void;
|
|
@@ -1276,13 +1307,35 @@ declare const NodeIdPlugin: SlatePlugin<PluginConfig<"nodeId", {
|
|
|
1276
1307
|
*/
|
|
1277
1308
|
idKey?: string;
|
|
1278
1309
|
/**
|
|
1279
|
-
*
|
|
1280
|
-
* are missing id. To disable this behavior, use `NodeIdPlugin.configure({
|
|
1281
|
-
* normalizeInitialValue: null })`.
|
|
1310
|
+
* Controls how missing ids are assigned in the initial value.
|
|
1282
1311
|
*
|
|
1283
|
-
*
|
|
1312
|
+
* - `'if-needed'`: normalize only when the first or last top-level node is
|
|
1313
|
+
* missing an id
|
|
1314
|
+
* - `'always'`: walk the whole initial value and fill any missing ids
|
|
1315
|
+
* - `false`: skip initial-value id assignment
|
|
1316
|
+
*
|
|
1317
|
+
* @default 'if-needed'
|
|
1284
1318
|
*/
|
|
1285
|
-
|
|
1319
|
+
initialValueIds?: false | "always" | "if-needed";
|
|
1320
|
+
/**
|
|
1321
|
+
* Legacy alias for `initialValueIds`.
|
|
1322
|
+
*
|
|
1323
|
+
* - `false`: only check the first and last top-level nodes
|
|
1324
|
+
* - `true`: walk the whole initial value and fill missing ids
|
|
1325
|
+
* - `null`: skip initial-value id assignment
|
|
1326
|
+
*
|
|
1327
|
+
* @deprecated Use `initialValueIds` instead.
|
|
1328
|
+
*/
|
|
1329
|
+
normalizeInitialValue?: boolean | null;
|
|
1330
|
+
/**
|
|
1331
|
+
* Reports duplicate-id scan cost during inserted-node normalization.
|
|
1332
|
+
*/
|
|
1333
|
+
onDuplicateIdScan?: (stats: {
|
|
1334
|
+
candidateCount: number;
|
|
1335
|
+
duration: number;
|
|
1336
|
+
existingCount: number;
|
|
1337
|
+
visitedCount: number;
|
|
1338
|
+
}) => void;
|
|
1286
1339
|
/**
|
|
1287
1340
|
* Reuse ids on undo/redo and copy/pasting if not existing in the document.
|
|
1288
1341
|
* This is disabled by default to avoid duplicate ids across documents.
|
|
@@ -1368,6 +1421,7 @@ declare const getCorePlugins: ({
|
|
|
1368
1421
|
text: string;
|
|
1369
1422
|
}) => void;
|
|
1370
1423
|
}, {
|
|
1424
|
+
isElementStateEmpty: (element: _platejs_slate30.TElement) => boolean;
|
|
1371
1425
|
redecorate: () => void;
|
|
1372
1426
|
}, {
|
|
1373
1427
|
init: ((args_0: InitOptions) => void) & ((args_0: InitOptions) => void);
|
|
@@ -1414,7 +1468,14 @@ declare const getCorePlugins: ({
|
|
|
1414
1468
|
filterInline?: boolean;
|
|
1415
1469
|
filterText?: boolean;
|
|
1416
1470
|
idKey?: string;
|
|
1417
|
-
|
|
1471
|
+
initialValueIds?: false | "always" | "if-needed";
|
|
1472
|
+
normalizeInitialValue?: boolean | null;
|
|
1473
|
+
onDuplicateIdScan?: (stats: {
|
|
1474
|
+
candidateCount: number;
|
|
1475
|
+
duration: number;
|
|
1476
|
+
existingCount: number;
|
|
1477
|
+
visitedCount: number;
|
|
1478
|
+
}) => void;
|
|
1418
1479
|
reuseId?: boolean;
|
|
1419
1480
|
idCreator?: () => any;
|
|
1420
1481
|
} & _platejs_slate30.QueryNodeOptions, {}, {
|
|
@@ -2156,7 +2217,7 @@ type BasePlugin<C extends AnyPluginConfig = PluginConfig> = {
|
|
|
2156
2217
|
* always be active.
|
|
2157
2218
|
* - `inject` (for `inject.nodeProps`): Edit-only by default (true if not
|
|
2158
2219
|
* specified). Set to `false` to always be active.
|
|
2159
|
-
* - `
|
|
2220
|
+
* - `transformInitialValue`: NOT edit-only by default (false if not specified).
|
|
2160
2221
|
* Set to `true` to make it edit-only.
|
|
2161
2222
|
*/
|
|
2162
2223
|
editOnly?: EditOnlyConfig | boolean;
|
|
@@ -2263,6 +2324,16 @@ type BasePluginNode<C extends AnyPluginConfig = PluginConfig> = {
|
|
|
2263
2324
|
* inlineVoid core plugin.
|
|
2264
2325
|
*/
|
|
2265
2326
|
isMarkableVoid?: boolean;
|
|
2327
|
+
/**
|
|
2328
|
+
* Returns whether an element prop is inert metadata for empty-state checks.
|
|
2329
|
+
*
|
|
2330
|
+
* Props not claimed by a plugin are treated as meaningful state.
|
|
2331
|
+
*/
|
|
2332
|
+
isMetadataProp?: (options: BasePluginContext<C> & {
|
|
2333
|
+
key: string;
|
|
2334
|
+
node: TElement;
|
|
2335
|
+
value: unknown;
|
|
2336
|
+
}) => boolean;
|
|
2266
2337
|
/**
|
|
2267
2338
|
* Whether the node is selectable.
|
|
2268
2339
|
*
|
|
@@ -2372,11 +2443,15 @@ type EditOnlyConfig = {
|
|
|
2372
2443
|
*/
|
|
2373
2444
|
inject?: boolean;
|
|
2374
2445
|
/**
|
|
2375
|
-
* If true, `
|
|
2446
|
+
* If true, `transformInitialValue` is only called when the editor is not
|
|
2376
2447
|
* read-only.
|
|
2377
2448
|
*
|
|
2378
2449
|
* @default false (This is an exception. It's not edit-only by default, even if `editOnly` is true or an object, unless explicitly set to true here).
|
|
2379
2450
|
*/
|
|
2451
|
+
transformInitialValue?: boolean;
|
|
2452
|
+
/**
|
|
2453
|
+
* @deprecated Use `transformInitialValue` instead.
|
|
2454
|
+
*/
|
|
2380
2455
|
normalizeInitialValue?: boolean;
|
|
2381
2456
|
/**
|
|
2382
2457
|
* If true, `render` functions are only active when the editor is not
|
|
@@ -2484,13 +2559,14 @@ type BaseEditor = EditorBase & {
|
|
|
2484
2559
|
node: {
|
|
2485
2560
|
isContainer: string[];
|
|
2486
2561
|
isLeaf: string[];
|
|
2562
|
+
isMetadataProp: string[];
|
|
2487
2563
|
isText: string[];
|
|
2488
2564
|
leafProps: string[];
|
|
2489
2565
|
textProps: string[];
|
|
2490
2566
|
/** Node types to plugin keys. */
|
|
2491
2567
|
types: Record<string, string>;
|
|
2492
2568
|
};
|
|
2493
|
-
|
|
2569
|
+
transformInitialValue: string[];
|
|
2494
2570
|
render: {
|
|
2495
2571
|
aboveEditable: string[];
|
|
2496
2572
|
aboveNodes: string[];
|
|
@@ -2695,7 +2771,7 @@ type BaseWithSlateOptions<P extends AnyPluginConfig = CorePlugin> = {
|
|
|
2695
2771
|
*/
|
|
2696
2772
|
skipInitialization?: boolean;
|
|
2697
2773
|
};
|
|
2698
|
-
type WithSlateOptions<V extends Value = Value, P extends AnyPluginConfig = CorePlugin> = BaseWithSlateOptions<P> & Pick<Partial<AnySlatePlugin>, 'api' | 'decorate' | 'extendEditor' | 'inject' | 'normalizeInitialValue' | 'options' | 'override' | 'transforms'> & {
|
|
2774
|
+
type WithSlateOptions<V extends Value = Value, P extends AnyPluginConfig = CorePlugin> = BaseWithSlateOptions<P> & Pick<Partial<AnySlatePlugin>, 'api' | 'decorate' | 'extendEditor' | 'inject' | 'transformInitialValue' | 'normalizeInitialValue' | 'options' | 'override' | 'transforms'> & {
|
|
2699
2775
|
/**
|
|
2700
2776
|
* Initial content for the editor.
|
|
2701
2777
|
*
|
|
@@ -3029,7 +3105,7 @@ declare const normalizeDescendantsToDocumentFragment: (editor: SlateEditor, {
|
|
|
3029
3105
|
}) => Descendant[];
|
|
3030
3106
|
//#endregion
|
|
3031
3107
|
//#region src/lib/utils/omitPluginContext.d.ts
|
|
3032
|
-
declare const omitPluginContext: <T extends SlatePluginContext<AnySlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "getOptions" | "
|
|
3108
|
+
declare const omitPluginContext: <T extends SlatePluginContext<AnySlatePlugin>>(ctx: T) => Omit<T, "api" | "editor" | "getOptions" | "type" | "getOption" | "tf" | "setOptions" | "setOption" | "plugin">;
|
|
3033
3109
|
//#endregion
|
|
3034
3110
|
//#region src/lib/utils/overridePluginsByKey.d.ts
|
|
3035
3111
|
/**
|
|
@@ -3048,4 +3124,4 @@ declare const pipeOnNodeChange: (editor: SlateEditor, node: Descendant, prevNode
|
|
|
3048
3124
|
//#region src/lib/utils/pipeOnTextChange.d.ts
|
|
3049
3125
|
declare const pipeOnTextChange: (editor: SlateEditor, node: Descendant, text: string, prevText: string, operation: TextOperation) => boolean;
|
|
3050
3126
|
//#endregion
|
|
3051
|
-
export { TSlateEditor as $,
|
|
3127
|
+
export { TSlateEditor as $, getEditorDOMFromHtmlString as $a, RenderStaticNodeWrapperFunction as $i, cleanHtmlFontElements as $n, NavigationNavigateOptions as $r, upsertInlineFormattingContext as $t, applyDeepToNodes as A, MatchBlockFenceOptions as Aa, createTSlatePlugin as Ai, isHtmlInlineElement as An, SlateRenderElement as Ao, LogLevel as Ar, BaseParagraphPlugin as At, ZustandStoreApi as B, stripHtmlClassNames as Ba, HtmlSerializer as Bi, htmlBrToNewLine as Bn, ElementAffinity as Br, STATIC_VALUE_CREATED_AT as Bt, isSlateNode as C, InsertBreakInputRule as Ca, getPluginKey as Ci, pipeDeserializeHtmlLeaf as Cn, SlateRenderText as Co, NodeIdOptions as Cr, NodeComponents as Ct, isSlateText as D, InsertTextInputRule as Da, getSlatePlugin as Di, isOlSymbol as Dn, pipeRenderLeafStatic as Do, normalizeNodeIdWithEditor as Dr, SelectionRules as Dt, isSlateString as E, InsertDataInputRuleContext as Ea, getPluginTypes as Ei, parseHtmlDocument as En, SlateRenderLeaf as Eo, normalizeNodeId as Er, PluginConfig as Et, RenderLeafProps as F, SelectionInputRuleContext as Fa, EditorPlugin as Fi, inlineTagNames as Fn, getMarkBoundaryAffinity as Fr, withBreakRules as Ft, WithSlateOptions as G, getSelectedDomBlocks as Ga, NodeStaticWrapperComponent as Gi, someHtmlElement as Gn, NavigationFeedbackPlugin as Gr, createBlockFenceInputRule as Gt, nanoid$1 as H, isSelectOutside as Ha, InjectNodeProps as Hi, getHtmlComments as Hn, clearNavigationFeedbackTarget as Hr, LengthPlugin as Ht, RenderElementFn as I, TextSubstitutionInputRuleConfig as Ia, ExtendEditor as Ii, htmlTextNodeToString as In, getEdgeNodes as Ir, OverridePlugin as It, BaseEditor as J, getPluginDataAttributes as Ja, NormalizeInitialValue as Ji, deserializeHtmlElement as Jn, NavigationFeedbackConfig as Jr, createTextSubstitutionInputRule as Jt, createSlateEditor as K, getRenderNodeStaticProps as Ka, NodeStaticWrapperComponentProps as Ki, deserializeHtmlNodeChildren as Kn, NAVIGATION_FEEDBACK_KEY as Kr, createBlockStartInputRule as Kt, RenderElementProps as L, TextSubstitutionMatch as La, ExtendEditorApi as Li, htmlStringToDOMNode as Ln, EdgeNodes as Lr, withOverrides as Lt, RenderTextFn as M, MatchDelimitedInlineOptions as Ma, AnySlatePlugin as Mi, isHtmlElement as Mn, HandlerReturnType as Mo, setAffinitySelection as Mr, withNormalizeRules as Mt, RenderTextProps as N, ResolvedInputRule as Na, Decorate as Ni, isHtmlComment as Nn, AstPlugin as No, isNodeAffinity as Nr, withMergeRules as Nt, isSlateVoid as O, InsertTextInputRuleContext as Oa, getEditorPlugin as Oi, isHtmlText as On, pluginRenderLeafStatic as Oo, DebugErrorType as Or, WithAnyKey as Ot, RenderLeafFn as P, ResolvedInputRulesMeta as Pa, Deserializer as Pi, isHtmlBlockElement as Pn, isNodesAffinity as Pr, withDeleteRules as Pt, SlateEditor as Q, createStaticEditor as Qa, RenderStaticNodeWrapper as Qi, cleanHtmlLinkElements as Qn, NavigationFlashTargetOptions as Qr, endInlineFormattingContext as Qt, RenderChunkFn as R, TextSubstitutionPattern as Ra, ExtendEditorTransforms as Ri, htmlElementToLeaf as Rn, AffinityConfig as Rr, withNodeId as Rt, isSlateLeaf as S, InputRulesFactoryContext as Sa, getPluginByType as Si, pluginDeserializeHtml as Sn, PlateStaticProps as So, NodeIdConfig as Sr, NodeComponent as St, isSlatePluginNode as T, InsertDataInputRule as Ta, getPluginType as Ti, parseHtmlElement as Tn, pluginRenderTextStatic as To, NormalizeNodeIdOptions as Tr, ParserOptions as Tt, BaseWithSlateOptions as U, getSelectedDomNode as Ua, LeafStaticProps as Ui, getDataNodeProps as Un, flashTarget as Ur, defineInputRule as Ut, createZustandStore$1 as V, pipeDecorate as Va, InferConfig as Vi, htmlBodyToFragment as Vn, navigate as Vr, normalizeStaticValue as Vt, CreateSlateEditorOptions as W, getSelectedDomFragment as Wa, NodeStaticProps as Wi, findHtmlElement as Wn, resolveNavigationFeedbackTarget as Wr, createRuleFactory as Wt, KeyofNodePlugins as X, getStaticPlugins as Xa, Parser as Xi, copyBlockMarksToSpanChild as Xn, NavigationFeedbackStoredTarget as Xr, matchBlockStart as Xt, InferPlugins as Y, createStaticString as Ya, OverrideEditor as Yi, deserializeHtml as Yn, NavigationFeedbackPluginKey as Yr, matchBlockFence as Yt, KeyofPlugins as Z, ViewPlugin as Za, PartialEditorPlugin as Zi, cleanHtmlTextNodes as Zn, NavigationFeedbackTarget as Zr, matchDelimitedInline as Zt, getInjectMatch as _, DelimitedInlineInputRuleMatch as _a, init as _i, replaceTagName as _n, SerializeHtmlOptions as _o, GetCorePluginsOptions as _r, InferOptions as _t, omitPluginContext as a, SlatePluginMethods as aa, WithAutoScrollOptions as ai, collapseWhiteSpaceChildren as an, SlateNodeProps as ao, CARRIAGE_RETURN as ar, BasePluginContext as at, isSlateEditor as b, InputRulesConfig as ba, withPlateHistory as bi, preCleanHtml as bn, LeafStatic as bo, ChunkingConfig as br, MatchRules as bt, isType as c, TextStaticProps as ca, SlateExtensionPlugin as ci, CollapseWhiteSpaceState as cn, StyledSlateElementProps as co, SPACE as cr, BaseTransformOptions as ct, isHotkey as d, AnyInputRule as da, resetBlock as di, WhiteSpaceRule as dn, useNodeAttributes as do, HtmlPlugin as dr, EditOnlyConfig as dt, RenderStaticNodeWrapperProps as ea, AUTO_SCROLL as ei, isLastNonEmptyTextOfInlineFormattingContext as en, SlateElement as eo, cleanHtmlEmptyElements as er, AnyPluginConfig as et, getSlateClass as f, BaseInputRule as fa, LiftBlockOptions as fi, unwrapHtmlElement as fn, BoxStaticProps as fo, withChunking as fr, ExtendConfig as ft, getInjectedPlugins as g, BlockStartInputRuleMatch as ga, InitOptions as gi, traverseHtmlComments as gn, SlateRenderTextProps as go, DebugConfig as gr, InferKey as gt, keyToDataAttribute as h, BlockStartInputRuleConfig as ha, insertExitBreak as hi, traverseHtmlElements as hn, SlateRenderNodeProps as ho, CorePluginTransforms as hr, InferApi as ht, overridePluginsByKey as i, SlatePluginContext as ia, ScrollMode as ii, collapseWhiteSpaceElement as in, SlateLeafProps as io, DeserializeHtmlNodeReturnType as ir, BasePlugin as it, EditableProps as j, MatchBlockStartOptions as ja, AnyEditorPlugin as ji, isHtmlFragmentHref as jn, pluginRenderElementStatic as jo, PlateError as jr, ParagraphConfig as jt, ApplyDeepToNodesOptions as k, MarkInputRuleConfig as ka, createSlatePlugin as ki, isHtmlTable as kn, pipeRenderElementStatic as ko, DebugPlugin as kr, WithRequiredKey as kt, Hotkeys as l, TransformInitialValue as la, isElementStateEmpty as li, TrimEndRule as ln, StyledSlateLeafProps as lo, TAB as lr, BreakRules as lt, getNodeDataAttributeKeys as m, BlockFenceInputRuleMatch as ma, InsertExitBreakOptions as mi, traverseHtmlNode as mn, SlateRenderLeafProps as mo, CorePluginApi as mr, GetInjectNodePropsReturnType as mt, pipeOnNodeChange as n, SlatePlugin as na, DOMPlugin as ni, collapseWhiteSpaceText as nn, SlateHTMLProps as no, cleanHtmlBrElements as nr, BaseHtmlDeserializer as nt, normalizeDescendantsToDocumentFragment as o, SlatePlugins as oa, withScrolling as oi, collapseWhiteSpace as on, SlateText as oo, LINE_FEED as or, BasePluginNode as ot, getPluginNodeProps as p, BlockFenceInputRuleConfig as pa, liftBlock as pi, traverseHtmlTexts as pn, SlateRenderElementProps as po, CorePlugin as pr, GetInjectNodePropsOptions as pt, withSlate as q, getNodeDataAttributes as qa, NodeStaticWrapperComponentReturnType as qi, deserializeHtmlNode as qn, NavigationFeedbackActiveTarget as qr, createMarkInputRule as qt, pipeInsertDataQuery as r, SlatePluginConfig$1 as ra, DomConfig as ri, collapseWhiteSpaceNode as rn, SlateLeaf as ro, DeserializeHtmlChildren as rr, BaseInjectProps as rt, mergeDeepToNodes as s, SlateShortcut as sa, SlateExtensionConfig as si, collapseString as sn, SlateTextProps as so, NO_BREAK_SPACE as sr, BaseSerializer as st, pipeOnTextChange as t, Serializer as ta, AutoScrollOperationsMap as ti, inferWhiteSpaceRule as tn, SlateElementProps as to, cleanHtmlCrLf as tr, BaseDeserializer as tt, createHotkey as u, TransformOptions as ua, setValue as ui, TrimStartRule as un, StyledSlateTextProps as uo, ZERO_WIDTH_SPACE as ur, DeleteRules as ut, defaultsDeepToNodes as v, InputRuleBuilder as va, ParserPlugin as vi, removeHtmlSurroundings as vn, serializeHtml as vo, LengthConfig as vr, InferSelectors as vt, isSlatePluginElement as w, InsertBreakInputRuleContext as wa, getPluginKeys as wi, pipeDeserializeHtmlElement as wn, pipeRenderTextStatic as wo, NodeIdPlugin as wr, NormalizeRules as wt, isSlateElement as x, InputRulesDefinition as xa, getContainerTypes as xi, postCleanHtml as xn, PlateStatic as xo, ChunkingPlugin as xr, MergeRules as xt, getSlateElements as y, InputRuleTarget as ya, HistoryPlugin as yi, removeHtmlNodesBetweenComments as yn, ElementStatic as yo, getCorePlugins as yr, InferTransforms as yt, RenderChunkProps as z, stripSlateDataAttributes as za, HtmlDeserializer as zi, htmlElementToElement as zn, AffinityPlugin as zr, NormalizeStaticValueOptions as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as TSlateEditor, $i as
|
|
2
|
-
export { AUTO_SCROLL, AffinityConfig, AffinityPlugin, AnyEditorPlugin, AnyInputRule, AnyPluginConfig, AnySlatePlugin, ApplyDeepToNodesOptions, AstPlugin, AutoScrollOperationsMap, BaseDeserializer, BaseEditor, BaseHtmlDeserializer, BaseInjectProps, BaseInputRule, BaseParagraphPlugin, BasePlugin, BasePluginContext, BasePluginNode, BaseSerializer, BaseTransformOptions, BaseWithSlateOptions, BlockFenceInputRuleConfig, BlockFenceInputRuleMatch, BlockStartInputRuleConfig, BlockStartInputRuleMatch, BreakRules, CARRIAGE_RETURN, ChunkingConfig, ChunkingPlugin, CollapseWhiteSpaceState, CorePlugin, CorePluginApi, CorePluginTransforms, CreateSlateEditorOptions, DOMPlugin, DebugConfig, DebugErrorType, DebugPlugin, Decorate, DeleteRules, DelimitedInlineInputRuleMatch, DeserializeHtmlChildren, DeserializeHtmlNodeReturnType, Deserializer, DomConfig, EdgeNodes, EditOnlyConfig, EditableProps, EditorPlugin, ElementAffinity, ExtendConfig, ExtendEditor, ExtendEditorApi, ExtendEditorTransforms, GetCorePluginsOptions, GetInjectNodePropsOptions, GetInjectNodePropsReturnType, HandlerReturnType, HistoryPlugin, Hotkeys, HtmlDeserializer, HtmlPlugin, HtmlSerializer, InferApi, InferConfig, InferKey, InferOptions, InferPlugins, InferSelectors, InferTransforms, InitOptions, InjectNodeProps, InputRuleBuilder, InputRuleTarget, InputRulesConfig, InputRulesDefinition, InputRulesFactoryContext, InsertBreakInputRule, InsertBreakInputRuleContext, InsertDataInputRule, InsertDataInputRuleContext, InsertExitBreakOptions, InsertTextInputRule, InsertTextInputRuleContext, KeyofNodePlugins, KeyofPlugins, LINE_FEED, LeafStaticProps, LengthConfig, LengthPlugin, LiftBlockOptions, LogLevel, MarkInputRuleConfig, MatchBlockFenceOptions, MatchBlockStartOptions, MatchDelimitedInlineOptions, MatchRules, MergeRules, NAVIGATION_FEEDBACK_KEY, NO_BREAK_SPACE, NavigationFeedbackActiveTarget, NavigationFeedbackConfig, NavigationFeedbackPlugin, NavigationFeedbackPluginKey, NavigationFeedbackStoredTarget, NavigationFeedbackTarget, NavigationFlashTargetOptions, NavigationNavigateOptions, NodeComponent, NodeComponents, NodeIdConfig, NodeIdOptions, NodeIdPlugin, NodeStaticProps, NodeStaticWrapperComponent, NodeStaticWrapperComponentProps, NodeStaticWrapperComponentReturnType, NormalizeInitialValue, NormalizeNodeIdOptions, NormalizeRules, NormalizeStaticValueOptions, OverrideEditor, OverridePlugin, ParagraphConfig, Parser, ParserOptions, ParserPlugin, PartialEditorPlugin, PlateError, PluginConfig, RenderChunkFn, RenderChunkProps, RenderElementFn, RenderElementProps, RenderLeafFn, RenderLeafProps, RenderStaticNodeWrapper, RenderStaticNodeWrapperFunction, RenderStaticNodeWrapperProps, RenderTextFn, RenderTextProps, ResolvedInputRule, ResolvedInputRulesMeta, SPACE, STATIC_VALUE_CREATED_AT, ScrollMode, SelectionInputRuleContext, SelectionRules, Serializer, SlateEditor, SlateExtensionConfig, SlateExtensionPlugin, SlatePlugin, SlatePluginConfig, SlatePluginContext, SlatePluginMethods, SlatePlugins, SlateShortcut, TAB, TSlateEditor, TextStaticProps, TextSubstitutionInputRuleConfig, TextSubstitutionMatch, TextSubstitutionPattern, TransformOptions, TrimEndRule, TrimStartRule, WhiteSpaceRule, WithAnyKey, WithAutoScrollOptions, WithRequiredKey, WithSlateOptions, ZERO_WIDTH_SPACE, ZustandStoreApi, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, clearNavigationFeedbackTarget, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createBlockFenceInputRule, createBlockStartInputRule, createHotkey, createMarkInputRule, createRuleFactory, createSlateEditor, createSlatePlugin, createTSlatePlugin, createTextSubstitutionInputRule, createZustandStore, defaultsDeepToNodes, defineInputRule, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, flashTarget, getContainerTypes, getCorePlugins, getDataNodeProps, getEdgeNodes, getEditorPlugin, getHtmlComments, getInjectMatch, getInjectedPlugins, getMarkBoundaryAffinity, getNodeDataAttributeKeys, getPluginByType, getPluginKey, getPluginKeys, getPluginNodeProps, getPluginType, getPluginTypes, getSlateClass, getSlateElements, getSlatePlugin, htmlBodyToFragment, htmlBrToNewLine, htmlElementToElement, htmlElementToLeaf, htmlStringToDOMNode, htmlTextNodeToString, inferWhiteSpaceRule, init, inlineTagNames, insertExitBreak, isHotkey, isHtmlBlockElement, isHtmlComment, isHtmlElement, isHtmlFragmentHref, isHtmlInlineElement, isHtmlTable, isHtmlText, isLastNonEmptyTextOfInlineFormattingContext, isNodeAffinity, isNodesAffinity, isOlSymbol, isSlateEditor, isSlateElement, isSlateLeaf, isSlateNode, isSlatePluginElement, isSlatePluginNode, isSlateString, isSlateText, isSlateVoid, isType, keyToDataAttribute, liftBlock, matchBlockFence, matchBlockStart, matchDelimitedInline, mergeDeepToNodes, nanoid, navigate, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, resolveNavigationFeedbackTarget, setAffinitySelection, setValue, someHtmlElement, traverseHtmlComments, traverseHtmlElements, traverseHtmlNode, traverseHtmlTexts, unwrapHtmlElement, upsertInlineFormattingContext, withBreakRules, withChunking, withDeleteRules, withMergeRules, withNodeId, withNormalizeRules, withOverrides, withPlateHistory, withScrolling, withSlate };
|
|
1
|
+
import { $ as TSlateEditor, $i as RenderStaticNodeWrapperFunction, $n as cleanHtmlFontElements, $r as NavigationNavigateOptions, $t as upsertInlineFormattingContext, A as applyDeepToNodes, Aa as MatchBlockFenceOptions, Ai as createTSlatePlugin, An as isHtmlInlineElement, Ar as LogLevel, At as BaseParagraphPlugin, B as ZustandStoreApi, Bi as HtmlSerializer, Bn as htmlBrToNewLine, Br as ElementAffinity, Bt as STATIC_VALUE_CREATED_AT, C as isSlateNode, Ca as InsertBreakInputRule, Ci as getPluginKey, Cn as pipeDeserializeHtmlLeaf, Cr as NodeIdOptions, Ct as NodeComponents, D as isSlateText, Da as InsertTextInputRule, Di as getSlatePlugin, Dn as isOlSymbol, Dr as normalizeNodeIdWithEditor, Dt as SelectionRules, E as isSlateString, Ea as InsertDataInputRuleContext, Ei as getPluginTypes, En as parseHtmlDocument, Er as normalizeNodeId, Et as PluginConfig, F as RenderLeafProps, Fa as SelectionInputRuleContext, Fi as EditorPlugin, Fn as inlineTagNames, Fr as getMarkBoundaryAffinity, Ft as withBreakRules, G as WithSlateOptions, Gi as NodeStaticWrapperComponent, Gn as someHtmlElement, Gr as NavigationFeedbackPlugin, Gt as createBlockFenceInputRule, H as nanoid, Hi as InjectNodeProps, Hn as getHtmlComments, Hr as clearNavigationFeedbackTarget, Ht as LengthPlugin, I as RenderElementFn, Ia as TextSubstitutionInputRuleConfig, Ii as ExtendEditor, In as htmlTextNodeToString, Ir as getEdgeNodes, It as OverridePlugin, J as BaseEditor, Ji as NormalizeInitialValue, Jn as deserializeHtmlElement, Jr as NavigationFeedbackConfig, Jt as createTextSubstitutionInputRule, K as createSlateEditor, Ki as NodeStaticWrapperComponentProps, Kn as deserializeHtmlNodeChildren, Kr as NAVIGATION_FEEDBACK_KEY, Kt as createBlockStartInputRule, L as RenderElementProps, La as TextSubstitutionMatch, Li as ExtendEditorApi, Ln as htmlStringToDOMNode, Lr as EdgeNodes, Lt as withOverrides, M as RenderTextFn, Ma as MatchDelimitedInlineOptions, Mi as AnySlatePlugin, Mn as isHtmlElement, Mo as HandlerReturnType, Mr as setAffinitySelection, Mt as withNormalizeRules, N as RenderTextProps, Na as ResolvedInputRule, Ni as Decorate, Nn as isHtmlComment, No as AstPlugin, Nr as isNodeAffinity, Nt as withMergeRules, O as isSlateVoid, Oa as InsertTextInputRuleContext, Oi as getEditorPlugin, On as isHtmlText, Or as DebugErrorType, Ot as WithAnyKey, P as RenderLeafFn, Pa as ResolvedInputRulesMeta, Pi as Deserializer, Pn as isHtmlBlockElement, Pr as isNodesAffinity, Pt as withDeleteRules, Q as SlateEditor, Qi as RenderStaticNodeWrapper, Qn as cleanHtmlLinkElements, Qr as NavigationFlashTargetOptions, Qt as endInlineFormattingContext, R as RenderChunkFn, Ra as TextSubstitutionPattern, Ri as ExtendEditorTransforms, Rn as htmlElementToLeaf, Rr as AffinityConfig, Rt as withNodeId, S as isSlateLeaf, Sa as InputRulesFactoryContext, Si as getPluginByType, Sn as pluginDeserializeHtml, Sr as NodeIdConfig, St as NodeComponent, T as isSlatePluginNode, Ta as InsertDataInputRule, Ti as getPluginType, Tn as parseHtmlElement, Tr as NormalizeNodeIdOptions, Tt as ParserOptions, U as BaseWithSlateOptions, Ui as LeafStaticProps, Un as getDataNodeProps, Ur as flashTarget, Ut as defineInputRule, V as createZustandStore, Vi as InferConfig, Vn as htmlBodyToFragment, Vr as navigate, Vt as normalizeStaticValue, W as CreateSlateEditorOptions, Wi as NodeStaticProps, Wn as findHtmlElement, Wr as resolveNavigationFeedbackTarget, Wt as createRuleFactory, X as KeyofNodePlugins, Xi as Parser, Xn as copyBlockMarksToSpanChild, Xr as NavigationFeedbackStoredTarget, Xt as matchBlockStart, Y as InferPlugins, Yi as OverrideEditor, Yn as deserializeHtml, Yr as NavigationFeedbackPluginKey, Yt as matchBlockFence, Z as KeyofPlugins, Zi as PartialEditorPlugin, Zn as cleanHtmlTextNodes, Zr as NavigationFeedbackTarget, Zt as matchDelimitedInline, _ as getInjectMatch, _a as DelimitedInlineInputRuleMatch, _i as init, _n as replaceTagName, _r as GetCorePluginsOptions, _t as InferOptions, a as omitPluginContext, aa as SlatePluginMethods, ai as WithAutoScrollOptions, an as collapseWhiteSpaceChildren, ar as CARRIAGE_RETURN, at as BasePluginContext, b as isSlateEditor, ba as InputRulesConfig, bi as withPlateHistory, bn as preCleanHtml, br as ChunkingConfig, bt as MatchRules, c as isType, ca as TextStaticProps, ci as SlateExtensionPlugin, cn as CollapseWhiteSpaceState, cr as SPACE, ct as BaseTransformOptions, d as isHotkey, da as AnyInputRule, di as resetBlock, dn as WhiteSpaceRule, dr as HtmlPlugin, dt as EditOnlyConfig, ea as RenderStaticNodeWrapperProps, ei as AUTO_SCROLL, en as isLastNonEmptyTextOfInlineFormattingContext, er as cleanHtmlEmptyElements, et as AnyPluginConfig, f as getSlateClass, fa as BaseInputRule, fi as LiftBlockOptions, fn as unwrapHtmlElement, fr as withChunking, ft as ExtendConfig, g as getInjectedPlugins, ga as BlockStartInputRuleMatch, gi as InitOptions, gn as traverseHtmlComments, gr as DebugConfig, gt as InferKey, h as keyToDataAttribute, ha as BlockStartInputRuleConfig, hi as insertExitBreak, hn as traverseHtmlElements, hr as CorePluginTransforms, ht as InferApi, i as overridePluginsByKey, ia as SlatePluginContext, ii as ScrollMode, in as collapseWhiteSpaceElement, ir as DeserializeHtmlNodeReturnType, it as BasePlugin, j as EditableProps, ja as MatchBlockStartOptions, ji as AnyEditorPlugin, jn as isHtmlFragmentHref, jr as PlateError, jt as ParagraphConfig, k as ApplyDeepToNodesOptions, ka as MarkInputRuleConfig, ki as createSlatePlugin, kn as isHtmlTable, kr as DebugPlugin, kt as WithRequiredKey, l as Hotkeys, la as TransformInitialValue, li as isElementStateEmpty, ln as TrimEndRule, lr as TAB, lt as BreakRules, m as getNodeDataAttributeKeys, ma as BlockFenceInputRuleMatch, mi as InsertExitBreakOptions, mn as traverseHtmlNode, mr as CorePluginApi, mt as GetInjectNodePropsReturnType, n as pipeOnNodeChange, na as SlatePlugin, ni as DOMPlugin, nn as collapseWhiteSpaceText, nr as cleanHtmlBrElements, nt as BaseHtmlDeserializer, o as normalizeDescendantsToDocumentFragment, oa as SlatePlugins, oi as withScrolling, on as collapseWhiteSpace, or as LINE_FEED, ot as BasePluginNode, p as getPluginNodeProps, pa as BlockFenceInputRuleConfig, pi as liftBlock, pn as traverseHtmlTexts, pr as CorePlugin, pt as GetInjectNodePropsOptions, q as withSlate, qi as NodeStaticWrapperComponentReturnType, qn as deserializeHtmlNode, qr as NavigationFeedbackActiveTarget, qt as createMarkInputRule, r as pipeInsertDataQuery, ra as SlatePluginConfig, ri as DomConfig, rn as collapseWhiteSpaceNode, rr as DeserializeHtmlChildren, rt as BaseInjectProps, s as mergeDeepToNodes, sa as SlateShortcut, si as SlateExtensionConfig, sn as collapseString, sr as NO_BREAK_SPACE, st as BaseSerializer, t as pipeOnTextChange, ta as Serializer, ti as AutoScrollOperationsMap, tn as inferWhiteSpaceRule, tr as cleanHtmlCrLf, tt as BaseDeserializer, u as createHotkey, ua as TransformOptions, ui as setValue, un as TrimStartRule, ur as ZERO_WIDTH_SPACE, ut as DeleteRules, v as defaultsDeepToNodes, va as InputRuleBuilder, vi as ParserPlugin, vn as removeHtmlSurroundings, vr as LengthConfig, vt as InferSelectors, w as isSlatePluginElement, wa as InsertBreakInputRuleContext, wi as getPluginKeys, wn as pipeDeserializeHtmlElement, wr as NodeIdPlugin, wt as NormalizeRules, x as isSlateElement, xa as InputRulesDefinition, xi as getContainerTypes, xn as postCleanHtml, xr as ChunkingPlugin, xt as MergeRules, y as getSlateElements, ya as InputRuleTarget, yi as HistoryPlugin, yn as removeHtmlNodesBetweenComments, yr as getCorePlugins, yt as InferTransforms, z as RenderChunkProps, zi as HtmlDeserializer, zn as htmlElementToElement, zr as AffinityPlugin, zt as NormalizeStaticValueOptions } from "./index-ClAE30YQ";
|
|
2
|
+
export { AUTO_SCROLL, AffinityConfig, AffinityPlugin, AnyEditorPlugin, AnyInputRule, AnyPluginConfig, AnySlatePlugin, ApplyDeepToNodesOptions, AstPlugin, AutoScrollOperationsMap, BaseDeserializer, BaseEditor, BaseHtmlDeserializer, BaseInjectProps, BaseInputRule, BaseParagraphPlugin, BasePlugin, BasePluginContext, BasePluginNode, BaseSerializer, BaseTransformOptions, BaseWithSlateOptions, BlockFenceInputRuleConfig, BlockFenceInputRuleMatch, BlockStartInputRuleConfig, BlockStartInputRuleMatch, BreakRules, CARRIAGE_RETURN, ChunkingConfig, ChunkingPlugin, CollapseWhiteSpaceState, CorePlugin, CorePluginApi, CorePluginTransforms, CreateSlateEditorOptions, DOMPlugin, DebugConfig, DebugErrorType, DebugPlugin, Decorate, DeleteRules, DelimitedInlineInputRuleMatch, DeserializeHtmlChildren, DeserializeHtmlNodeReturnType, Deserializer, DomConfig, EdgeNodes, EditOnlyConfig, EditableProps, EditorPlugin, ElementAffinity, ExtendConfig, ExtendEditor, ExtendEditorApi, ExtendEditorTransforms, GetCorePluginsOptions, GetInjectNodePropsOptions, GetInjectNodePropsReturnType, HandlerReturnType, HistoryPlugin, Hotkeys, HtmlDeserializer, HtmlPlugin, HtmlSerializer, InferApi, InferConfig, InferKey, InferOptions, InferPlugins, InferSelectors, InferTransforms, InitOptions, InjectNodeProps, InputRuleBuilder, InputRuleTarget, InputRulesConfig, InputRulesDefinition, InputRulesFactoryContext, InsertBreakInputRule, InsertBreakInputRuleContext, InsertDataInputRule, InsertDataInputRuleContext, InsertExitBreakOptions, InsertTextInputRule, InsertTextInputRuleContext, KeyofNodePlugins, KeyofPlugins, LINE_FEED, LeafStaticProps, LengthConfig, LengthPlugin, LiftBlockOptions, LogLevel, MarkInputRuleConfig, MatchBlockFenceOptions, MatchBlockStartOptions, MatchDelimitedInlineOptions, MatchRules, MergeRules, NAVIGATION_FEEDBACK_KEY, NO_BREAK_SPACE, NavigationFeedbackActiveTarget, NavigationFeedbackConfig, NavigationFeedbackPlugin, NavigationFeedbackPluginKey, NavigationFeedbackStoredTarget, NavigationFeedbackTarget, NavigationFlashTargetOptions, NavigationNavigateOptions, NodeComponent, NodeComponents, NodeIdConfig, NodeIdOptions, NodeIdPlugin, NodeStaticProps, NodeStaticWrapperComponent, NodeStaticWrapperComponentProps, NodeStaticWrapperComponentReturnType, NormalizeInitialValue, NormalizeNodeIdOptions, NormalizeRules, NormalizeStaticValueOptions, OverrideEditor, OverridePlugin, ParagraphConfig, Parser, ParserOptions, ParserPlugin, PartialEditorPlugin, PlateError, PluginConfig, RenderChunkFn, RenderChunkProps, RenderElementFn, RenderElementProps, RenderLeafFn, RenderLeafProps, RenderStaticNodeWrapper, RenderStaticNodeWrapperFunction, RenderStaticNodeWrapperProps, RenderTextFn, RenderTextProps, ResolvedInputRule, ResolvedInputRulesMeta, SPACE, STATIC_VALUE_CREATED_AT, ScrollMode, SelectionInputRuleContext, SelectionRules, Serializer, SlateEditor, SlateExtensionConfig, SlateExtensionPlugin, SlatePlugin, SlatePluginConfig, SlatePluginContext, SlatePluginMethods, SlatePlugins, SlateShortcut, TAB, TSlateEditor, TextStaticProps, TextSubstitutionInputRuleConfig, TextSubstitutionMatch, TextSubstitutionPattern, TransformInitialValue, TransformOptions, TrimEndRule, TrimStartRule, WhiteSpaceRule, WithAnyKey, WithAutoScrollOptions, WithRequiredKey, WithSlateOptions, ZERO_WIDTH_SPACE, ZustandStoreApi, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, clearNavigationFeedbackTarget, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createBlockFenceInputRule, createBlockStartInputRule, createHotkey, createMarkInputRule, createRuleFactory, createSlateEditor, createSlatePlugin, createTSlatePlugin, createTextSubstitutionInputRule, createZustandStore, defaultsDeepToNodes, defineInputRule, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, flashTarget, getContainerTypes, getCorePlugins, getDataNodeProps, getEdgeNodes, getEditorPlugin, getHtmlComments, getInjectMatch, getInjectedPlugins, getMarkBoundaryAffinity, getNodeDataAttributeKeys, getPluginByType, getPluginKey, getPluginKeys, getPluginNodeProps, getPluginType, getPluginTypes, getSlateClass, getSlateElements, getSlatePlugin, htmlBodyToFragment, htmlBrToNewLine, htmlElementToElement, htmlElementToLeaf, htmlStringToDOMNode, htmlTextNodeToString, inferWhiteSpaceRule, init, inlineTagNames, insertExitBreak, isElementStateEmpty, isHotkey, isHtmlBlockElement, isHtmlComment, isHtmlElement, isHtmlFragmentHref, isHtmlInlineElement, isHtmlTable, isHtmlText, isLastNonEmptyTextOfInlineFormattingContext, isNodeAffinity, isNodesAffinity, isOlSymbol, isSlateEditor, isSlateElement, isSlateLeaf, isSlateNode, isSlatePluginElement, isSlatePluginNode, isSlateString, isSlateText, isSlateVoid, isType, keyToDataAttribute, liftBlock, matchBlockFence, matchBlockStart, matchDelimitedInline, mergeDeepToNodes, nanoid, navigate, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeNodeIdWithEditor, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, resolveNavigationFeedbackTarget, setAffinitySelection, setValue, someHtmlElement, traverseHtmlComments, traverseHtmlElements, traverseHtmlNode, traverseHtmlTexts, unwrapHtmlElement, upsertInlineFormattingContext, withBreakRules, withChunking, withDeleteRules, withMergeRules, withNodeId, withNormalizeRules, withOverrides, withPlateHistory, withScrolling, withSlate };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isLastNonEmptyTextOfInlineFormattingContext, $t as matchDelimitedInline, A as parseHtmlDocument, At as isSlateNode, B as pluginDeserializeHtml, Bt as withMergeRules, C as clearNavigationFeedbackTarget, Ct as keyToDataAttribute, D as NavigationFeedbackPluginKey, Dt as isSlateEditor, E as NAVIGATION_FEEDBACK_KEY, Et as getSlateElements, F as htmlTextNodeToString, Ft as isSlateVoid, G as collapseWhiteSpace, Gt as withPlateHistory, H as htmlBrToNewLine, Ht as withBreakRules, I as htmlElementToLeaf, It as applyDeepToNodes, J as collapseWhiteSpaceChildren, Jt as createBlockStartInputRule, K as collapseWhiteSpaceElement, Kt as AstPlugin, L as pipeDeserializeHtmlLeaf, Lt as OverridePlugin, M as htmlStringToDOMNode, Mt as isSlatePluginNode, N as deserializeHtmlElement, Nt as isSlateString, O as LengthPlugin, Ot as isSlateElement, P as deserializeHtmlNode, Pt as isSlateText, Q as upsertInlineFormattingContext, Qt as matchBlockStart, R as htmlElementToElement, Rt as withOverrides, S as navigate, St as getNodeDataAttributeKeys, T as resolveNavigationFeedbackTarget, Tt as getInjectMatch, U as htmlBodyToFragment, Ut as BaseParagraphPlugin, V as getDataNodeProps, Vt as withDeleteRules, W as deserializeHtmlNodeChildren, Wt as HistoryPlugin, X as collapseWhiteSpaceText, Xt as createTextSubstitutionInputRule, Y as collapseWhiteSpaceNode, Yt as createMarkInputRule, Z as endInlineFormattingContext, Zt as matchBlockFence, _ as NodeIdPlugin, _t as getMarkBoundaryAffinity, a as pipeInsertDataQuery, an as getPluginType, at as isHtmlElement, b as withNodeId, bt as getSlateClass, c as isElementStateEmpty, cn as getEditorPlugin, ct as withScrolling, d as liftBlock, dt as ChunkingPlugin, en as defineInputRule, et as collapseString, f as insertExitBreak, ft as withChunking, g as pipeOnNodeChange, gt as isNodesAffinity, h as pipeOnTextChange, ht as isNodeAffinity, i as ParserPlugin, in as getPluginKeys, it as isHtmlText, j as deserializeHtml, jt as isSlatePluginElement, k as HtmlPlugin, kt as isSlateLeaf, l as setValue, ln as createSlatePlugin, lt as DebugPlugin, mt as setAffinitySelection, n as withSlate, nn as getPluginByType, nt as isHtmlInlineElement, o as normalizeDescendantsToDocumentFragment, on as getPluginTypes, ot as AUTO_SCROLL, p as init, pt as AffinityPlugin, q as inferWhiteSpaceRule, qt as createBlockFenceInputRule, r as getCorePlugins, rn as getPluginKey, rt as inlineTagNames, s as SlateExtensionPlugin, sn as getSlatePlugin, st as DOMPlugin, t as createSlateEditor, tn as getContainerTypes, tt as isHtmlBlockElement, u as resetBlock, un as createTSlatePlugin, ut as PlateError, v as normalizeNodeId, vt as getEdgeNodes, w as flashTarget, wt as getInjectedPlugins, x as NavigationFeedbackPlugin, xt as getPluginNodeProps, y as normalizeNodeIdWithEditor, yt as mergeDeepToNodes, z as pipeDeserializeHtmlElement, zt as withNormalizeRules } from "./withSlate-pfxNb3FA.js";
|
|
2
2
|
import { n as createHotkey, r as isHotkey, t as Hotkeys } from "./hotkeys-DI1HPO2Q.js";
|
|
3
3
|
import { nanoid } from "nanoid";
|
|
4
4
|
import { createVanillaStore as createZustandStore } from "zustand-x/vanilla";
|
|
5
|
+
import defaults from "lodash/defaults.js";
|
|
5
6
|
import castArray from "lodash/castArray.js";
|
|
6
|
-
import cloneDeep from "lodash/cloneDeep.js";
|
|
7
7
|
import defaultsDeep from "lodash/defaultsDeep.js";
|
|
8
8
|
|
|
9
|
+
//#region src/lib/utils/defaultsDeepToNodes.ts
|
|
10
|
+
/** Recursively merge a source object to children nodes with a query. */
|
|
11
|
+
const defaultsDeepToNodes = (options) => {
|
|
12
|
+
applyDeepToNodes({
|
|
13
|
+
...options,
|
|
14
|
+
apply: defaults
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
9
19
|
//#region src/lib/utils/isType.ts
|
|
10
20
|
/** Does the node match the type provided. */
|
|
11
21
|
const isType = (editor, node, key) => {
|
|
@@ -481,7 +491,7 @@ const replaceStaticMetadata = (value, createdAt) => {
|
|
|
481
491
|
};
|
|
482
492
|
const normalizeStaticValue = (value, options = {}) => {
|
|
483
493
|
const { createdAt = STATIC_VALUE_CREATED_AT, idCreator = createStaticIdFactory(), ...normalizeNodeIdOptions } = options;
|
|
484
|
-
return replaceStaticMetadata(normalizeNodeId(
|
|
494
|
+
return replaceStaticMetadata(normalizeNodeId(value, {
|
|
485
495
|
...normalizeNodeIdOptions,
|
|
486
496
|
idCreator
|
|
487
497
|
}), createdAt);
|
|
@@ -515,4 +525,4 @@ const overridePluginsByKey = (plugin, overrideByKey = {}, nested = false) => {
|
|
|
515
525
|
};
|
|
516
526
|
|
|
517
527
|
//#endregion
|
|
518
|
-
export { AUTO_SCROLL, AffinityPlugin, AstPlugin, BaseParagraphPlugin, CARRIAGE_RETURN, ChunkingPlugin, DOMPlugin, DebugPlugin, HistoryPlugin, Hotkeys, HtmlPlugin, LINE_FEED, LengthPlugin, NAVIGATION_FEEDBACK_KEY, NO_BREAK_SPACE, NavigationFeedbackPlugin, NavigationFeedbackPluginKey, NodeIdPlugin, OverridePlugin, ParserPlugin, PlateError, SPACE, STATIC_VALUE_CREATED_AT, SlateExtensionPlugin, TAB, ZERO_WIDTH_SPACE, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, clearNavigationFeedbackTarget, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createBlockFenceInputRule, createBlockStartInputRule, createHotkey, createMarkInputRule, createRuleFactory, createSlateEditor, createSlatePlugin, createTSlatePlugin, createTextSubstitutionInputRule, createZustandStore, defaultsDeepToNodes, defineInputRule, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, flashTarget, getContainerTypes, getCorePlugins, getDataNodeProps, getEdgeNodes, getEditorPlugin, getHtmlComments, getInjectMatch, getInjectedPlugins, getMarkBoundaryAffinity, getNodeDataAttributeKeys, getPluginByType, getPluginKey, getPluginKeys, getPluginNodeProps, getPluginType, getPluginTypes, getSlateClass, getSlateElements, getSlatePlugin, htmlBodyToFragment, htmlBrToNewLine, htmlElementToElement, htmlElementToLeaf, htmlStringToDOMNode, htmlTextNodeToString, inferWhiteSpaceRule, init, inlineTagNames, insertExitBreak, isHotkey, isHtmlBlockElement, isHtmlComment, isHtmlElement, isHtmlFragmentHref, isHtmlInlineElement, isHtmlTable, isHtmlText, isLastNonEmptyTextOfInlineFormattingContext, isNodeAffinity, isNodesAffinity, isOlSymbol, isSlateEditor, isSlateElement, isSlateLeaf, isSlateNode, isSlatePluginElement, isSlatePluginNode, isSlateString, isSlateText, isSlateVoid, isType, keyToDataAttribute, liftBlock, matchBlockFence, matchBlockStart, matchDelimitedInline, mergeDeepToNodes, nanoid, navigate, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, resolveNavigationFeedbackTarget, setAffinitySelection, setValue, someHtmlElement, traverseHtmlComments, traverseHtmlElements, traverseHtmlNode, traverseHtmlTexts, unwrapHtmlElement, upsertInlineFormattingContext, withBreakRules, withChunking, withDeleteRules, withMergeRules, withNodeId, withNormalizeRules, withOverrides, withPlateHistory, withScrolling, withSlate };
|
|
528
|
+
export { AUTO_SCROLL, AffinityPlugin, AstPlugin, BaseParagraphPlugin, CARRIAGE_RETURN, ChunkingPlugin, DOMPlugin, DebugPlugin, HistoryPlugin, Hotkeys, HtmlPlugin, LINE_FEED, LengthPlugin, NAVIGATION_FEEDBACK_KEY, NO_BREAK_SPACE, NavigationFeedbackPlugin, NavigationFeedbackPluginKey, NodeIdPlugin, OverridePlugin, ParserPlugin, PlateError, SPACE, STATIC_VALUE_CREATED_AT, SlateExtensionPlugin, TAB, ZERO_WIDTH_SPACE, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, clearNavigationFeedbackTarget, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createBlockFenceInputRule, createBlockStartInputRule, createHotkey, createMarkInputRule, createRuleFactory, createSlateEditor, createSlatePlugin, createTSlatePlugin, createTextSubstitutionInputRule, createZustandStore, defaultsDeepToNodes, defineInputRule, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, flashTarget, getContainerTypes, getCorePlugins, getDataNodeProps, getEdgeNodes, getEditorPlugin, getHtmlComments, getInjectMatch, getInjectedPlugins, getMarkBoundaryAffinity, getNodeDataAttributeKeys, getPluginByType, getPluginKey, getPluginKeys, getPluginNodeProps, getPluginType, getPluginTypes, getSlateClass, getSlateElements, getSlatePlugin, htmlBodyToFragment, htmlBrToNewLine, htmlElementToElement, htmlElementToLeaf, htmlStringToDOMNode, htmlTextNodeToString, inferWhiteSpaceRule, init, inlineTagNames, insertExitBreak, isElementStateEmpty, isHotkey, isHtmlBlockElement, isHtmlComment, isHtmlElement, isHtmlFragmentHref, isHtmlInlineElement, isHtmlTable, isHtmlText, isLastNonEmptyTextOfInlineFormattingContext, isNodeAffinity, isNodesAffinity, isOlSymbol, isSlateEditor, isSlateElement, isSlateLeaf, isSlateNode, isSlatePluginElement, isSlatePluginNode, isSlateString, isSlateText, isSlateVoid, isType, keyToDataAttribute, liftBlock, matchBlockFence, matchBlockStart, matchDelimitedInline, mergeDeepToNodes, nanoid, navigate, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeNodeIdWithEditor, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, resolveNavigationFeedbackTarget, setAffinitySelection, setValue, someHtmlElement, traverseHtmlComments, traverseHtmlElements, traverseHtmlNode, traverseHtmlTexts, unwrapHtmlElement, upsertInlineFormattingContext, withBreakRules, withChunking, withDeleteRules, withMergeRules, withNodeId, withNormalizeRules, withOverrides, withPlateHistory, withScrolling, withSlate };
|