@lofcz/platejs-core 52.3.6 → 53.1.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-CLvWpTKx.d.ts → index-DRweaH9Q.d.ts} +459 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +105 -2
- package/dist/react/index.d.ts +100 -84
- package/dist/react/index.js +49 -6
- package/dist/static/index.d.ts +1 -1
- package/dist/static/index.js +2 -2
- package/dist/{static-DIYyt_jS.js → static-HrbPXDQ1.js} +2 -2
- package/dist/{withSlate-BfRR5wTZ.js → withSlate-DsAgt7dN.js} +846 -26
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as TSlateEditor, $n as
|
|
2
|
-
export { AUTO_SCROLL, AffinityConfig, AffinityPlugin, AnyEditorPlugin, AnyPluginConfig, AnySlatePlugin, ApplyDeepToNodesOptions, AstPlugin, AutoScrollOperationsMap, BaseDeserializer, BaseEditor, BaseHtmlDeserializer, BaseInjectProps, BaseParagraphPlugin, BasePlugin, BasePluginContext, BasePluginNode, BaseSerializer, BaseTransformOptions, BaseWithSlateOptions, BreakRules, CARRIAGE_RETURN, ChunkingConfig, ChunkingPlugin, CollapseWhiteSpaceState, CorePlugin, CorePluginApi, CorePluginTransforms, CreateSlateEditorOptions, DOMPlugin, DebugConfig, DebugErrorType, DebugPlugin, Decorate, DeleteRules, 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, InsertExitBreakOptions, KeyofNodePlugins, KeyofPlugins, LINE_FEED, LeafStaticProps, LengthConfig, LengthPlugin, LogLevel, MatchRules, MergeRules, NO_BREAK_SPACE, 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, SPACE, STATIC_VALUE_CREATED_AT, ScrollMode, SelectionRules, Serializer, SlateEditor, SlateExtensionConfig, SlateExtensionPlugin, SlatePlugin, SlatePluginConfig, SlatePluginContext, SlatePluginMethods, SlatePlugins, SlateShortcut, TAB, TSlateEditor, TextStaticProps, TransformOptions, TrimEndRule, TrimStartRule, WhiteSpaceRule, WithAnyKey, WithAutoScrollOptions, WithRequiredKey, WithSlateOptions, ZERO_WIDTH_SPACE, ZustandStoreApi, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createHotkey, createSlateEditor, createSlatePlugin, createTSlatePlugin, createZustandStore, defaultsDeepToNodes, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, 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, mergeDeepToNodes, nanoid, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, 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 Serializer, $n as cleanHtmlFontElements, $r as AUTO_SCROLL, $t as upsertInlineFormattingContext, A as applyDeepToNodes, Aa as ResolvedInputRule, Ai as AnySlatePlugin, An as isHtmlInlineElement, Ao as AstPlugin, Ar as PlateError, At as BaseParagraphPlugin, B as ZustandStoreApi, Bi as InjectNodeProps, Bn as htmlBrToNewLine, Br as navigate, Bt as STATIC_VALUE_CREATED_AT, C as isSlateNode, Ca as InsertDataInputRuleContext, Ci as getPluginType, Cn as pipeDeserializeHtmlLeaf, Cr as NodeIdOptions, Ct as NodeComponents, D as isSlateText, Da as MatchBlockFenceOptions, Di as createSlatePlugin, Dn as isOlSymbol, Dr as DebugErrorType, Dt as SelectionRules, E as isSlateString, Ea as MarkInputRuleConfig, Ei as getEditorPlugin, En as parseHtmlDocument, Er as normalizeNodeId, Et as PluginConfig, F as RenderLeafProps, Fa as TextSubstitutionPattern, Fi as ExtendEditorApi, Fn as inlineTagNames, Fr as getEdgeNodes, Ft as withBreakRules, G as WithSlateOptions, Gi as NodeStaticWrapperComponentReturnType, Gn as someHtmlElement, Gr as NAVIGATION_FEEDBACK_KEY, Gt as createBlockFenceInputRule, H as nanoid, Hi as NodeStaticProps, Hn as getHtmlComments, Hr as flashTarget, Ht as LengthPlugin, I as RenderElementFn, Ii as ExtendEditorTransforms, In as htmlTextNodeToString, Ir as EdgeNodes, It as OverridePlugin, J as BaseEditor, Ji as Parser, Jn as deserializeHtmlElement, Jr as NavigationFeedbackPluginKey, Jt as createTextSubstitutionInputRule, K as createSlateEditor, Ki as NormalizeInitialValue, Kn as deserializeHtmlNodeChildren, Kr as NavigationFeedbackActiveTarget, Kt as createBlockStartInputRule, L as RenderElementProps, Li as HtmlDeserializer, Ln as htmlStringToDOMNode, Lr as AffinityConfig, Lt as withOverrides, M as RenderTextFn, Ma as SelectionInputRuleContext, Mi as Deserializer, Mn as isHtmlElement, Mr as isNodeAffinity, Mt as withNormalizeRules, N as RenderTextProps, Na as TextSubstitutionInputRuleConfig, Ni as EditorPlugin, Nn as isHtmlComment, Nr as isNodesAffinity, Nt as withMergeRules, O as isSlateVoid, Oa as MatchBlockStartOptions, Oi as createTSlatePlugin, On as isHtmlText, Or as DebugPlugin, Ot as WithAnyKey, P as RenderLeafFn, Pa as TextSubstitutionMatch, Pi as ExtendEditor, Pn as isHtmlBlockElement, Pr as getMarkBoundaryAffinity, Pt as withDeleteRules, Q as SlateEditor, Qi as RenderStaticNodeWrapperProps, Qn as cleanHtmlLinkElements, Qr as NavigationNavigateOptions, Qt as endInlineFormattingContext, R as RenderChunkFn, Ri as HtmlSerializer, Rn as htmlElementToLeaf, Rr as AffinityPlugin, Rt as withNodeId, S as isSlateLeaf, Sa as InsertDataInputRule, Si as getPluginKeys, Sn as pluginDeserializeHtml, Sr as NodeIdConfig, St as NodeComponent, T as isSlatePluginNode, Ta as InsertTextInputRuleContext, Ti as getSlatePlugin, Tn as parseHtmlElement, Tr as NormalizeNodeIdOptions, Tt as ParserOptions, U as BaseWithSlateOptions, Ui as NodeStaticWrapperComponent, Un as getDataNodeProps, Ur as resolveNavigationFeedbackTarget, Ut as defineInputRule, V as createZustandStore, Vi as LeafStaticProps, Vn as htmlBodyToFragment, Vr as clearNavigationFeedbackTarget, Vt as normalizeStaticValue, W as CreateSlateEditorOptions, Wi as NodeStaticWrapperComponentProps, Wn as findHtmlElement, Wr as NavigationFeedbackPlugin, Wt as createRuleFactory, X as KeyofNodePlugins, Xi as RenderStaticNodeWrapper, Xn as copyBlockMarksToSpanChild, Xr as NavigationFeedbackTarget, Xt as matchBlockStart, Y as InferPlugins, Yi as PartialEditorPlugin, Yn as deserializeHtml, Yr as NavigationFeedbackStoredTarget, Yt as matchBlockFence, Z as KeyofPlugins, Zi as RenderStaticNodeWrapperFunction, Zn as cleanHtmlTextNodes, Zr as NavigationFlashTargetOptions, Zt as matchDelimitedInline, _ as getInjectMatch, _a as InputRulesConfig, _i as HistoryPlugin, _n as replaceTagName, _r as GetCorePluginsOptions, _t as InferOptions, a as omitPluginContext, aa as SlateShortcut, ai as withScrolling, an as collapseWhiteSpaceChildren, ar as CARRIAGE_RETURN, at as BasePluginContext, b as isSlateEditor, ba as InsertBreakInputRule, bi as getPluginByType, bn as preCleanHtml, br as ChunkingConfig, bt as MatchRules, c as isType, ca as AnyInputRule, ci as setValue, cn as CollapseWhiteSpaceState, cr as SPACE, ct as BaseTransformOptions, d as isHotkey, da as BlockFenceInputRuleMatch, di as liftBlock, dn as WhiteSpaceRule, dr as HtmlPlugin, dt as EditOnlyConfig, ea as SlatePlugin, ei as AutoScrollOperationsMap, en as isLastNonEmptyTextOfInlineFormattingContext, er as cleanHtmlEmptyElements, et as AnyPluginConfig, f as getSlateClass, fa as BlockStartInputRuleConfig, fi as InsertExitBreakOptions, fn as unwrapHtmlElement, fr as withChunking, ft as ExtendConfig, g as getInjectedPlugins, ga as InputRuleTarget, gi as ParserPlugin, gn as traverseHtmlComments, gr as DebugConfig, gt as InferKey, h as keyToDataAttribute, ha as InputRuleBuilder, hi as init, hn as traverseHtmlElements, hr as CorePluginTransforms, ht as InferApi, i as overridePluginsByKey, ia as SlatePlugins, ii as WithAutoScrollOptions, in as collapseWhiteSpaceElement, ir as DeserializeHtmlNodeReturnType, it as BasePlugin, j as EditableProps, ja as ResolvedInputRulesMeta, ji as Decorate, jn as isHtmlFragmentHref, jr as setAffinitySelection, jt as ParagraphConfig, k as ApplyDeepToNodesOptions, ka as MatchDelimitedInlineOptions, ki as AnyEditorPlugin, kn as isHtmlTable, ko as HandlerReturnType, kr as LogLevel, kt as WithRequiredKey, l as Hotkeys, la as BaseInputRule, li as resetBlock, ln as TrimEndRule, lr as TAB, lt as BreakRules, m as getNodeDataAttributeKeys, ma as DelimitedInlineInputRuleMatch, mi as InitOptions, mn as traverseHtmlNode, mr as CorePluginApi, mt as GetInjectNodePropsReturnType, n as pipeOnNodeChange, na as SlatePluginContext, ni as DomConfig, nn as collapseWhiteSpaceText, nr as cleanHtmlBrElements, nt as BaseHtmlDeserializer, o as normalizeDescendantsToDocumentFragment, oa as TextStaticProps, oi as SlateExtensionConfig, on as collapseWhiteSpace, or as LINE_FEED, ot as BasePluginNode, p as getPluginNodeProps, pa as BlockStartInputRuleMatch, pi as insertExitBreak, pn as traverseHtmlTexts, pr as CorePlugin, pt as GetInjectNodePropsOptions, q as withSlate, qi as OverrideEditor, qn as deserializeHtmlNode, qr as NavigationFeedbackConfig, qt as createMarkInputRule, r as pipeInsertDataQuery, ra as SlatePluginMethods, ri as ScrollMode, rn as collapseWhiteSpaceNode, rr as DeserializeHtmlChildren, rt as BaseInjectProps, s as mergeDeepToNodes, sa as TransformOptions, si as SlateExtensionPlugin, sn as collapseString, sr as NO_BREAK_SPACE, st as BaseSerializer, t as pipeOnTextChange, ta as SlatePluginConfig, ti as DOMPlugin, tn as inferWhiteSpaceRule, tr as cleanHtmlCrLf, tt as BaseDeserializer, u as createHotkey, ua as BlockFenceInputRuleConfig, ui as LiftBlockOptions, un as TrimStartRule, ur as ZERO_WIDTH_SPACE, ut as DeleteRules, v as defaultsDeepToNodes, va as InputRulesDefinition, vi as withPlateHistory, vn as removeHtmlSurroundings, vr as LengthConfig, vt as InferSelectors, w as isSlatePluginElement, wa as InsertTextInputRule, wi as getPluginTypes, wn as pipeDeserializeHtmlElement, wr as NodeIdPlugin, wt as NormalizeRules, x as isSlateElement, xa as InsertBreakInputRuleContext, xi as getPluginKey, xn as postCleanHtml, xr as ChunkingPlugin, xt as MergeRules, y as getSlateElements, ya as InputRulesFactoryContext, yi as getContainerTypes, yn as removeHtmlNodesBetweenComments, yr as getCorePlugins, yt as InferTransforms, z as RenderChunkProps, zi as InferConfig, zn as htmlElementToElement, zr as ElementAffinity, zt as NormalizeStaticValueOptions } from "./index-DRweaH9Q";
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as isHtmlBlockElement, $t as defineInputRule, A as htmlStringToDOMNode, At as isSlatePluginElement, B as htmlBrToNewLine, Bt as withDeleteRules, C as resolveNavigationFeedbackTarget, Ct as getInjectMatch, D as HtmlPlugin, Dt as isSlateElement, E as LengthPlugin, Et as isSlateEditor, F as pipeDeserializeHtmlLeaf, Ft as applyDeepToNodes, G as inferWhiteSpaceRule, Gt as AstPlugin, H as deserializeHtmlNodeChildren, Ht as BaseParagraphPlugin, I as htmlElementToElement, It as OverridePlugin, J as collapseWhiteSpaceText, Jt as createMarkInputRule, K as collapseWhiteSpaceChildren, Kt as createBlockFenceInputRule, L as pipeDeserializeHtmlElement, Lt as withOverrides, M as deserializeHtmlNode, Mt as isSlateString, N as htmlTextNodeToString, Nt as isSlateText, O as parseHtmlDocument, Ot as isSlateLeaf, P as htmlElementToLeaf, Pt as isSlateVoid, Q as collapseString, Qt as matchDelimitedInline, R as pluginDeserializeHtml, Rt as withNormalizeRules, S as flashTarget, St as getInjectedPlugins, T as NavigationFeedbackPluginKey, Tt as getSlateElements, U as collapseWhiteSpace, Ut as HistoryPlugin, V as htmlBodyToFragment, Vt as withBreakRules, W as collapseWhiteSpaceElement, Wt as withPlateHistory, X as upsertInlineFormattingContext, Xt as matchBlockFence, Y as endInlineFormattingContext, Yt as createTextSubstitutionInputRule, Z as isLastNonEmptyTextOfInlineFormattingContext, Zt as matchBlockStart, _ as normalizeNodeId, _t as mergeDeepToNodes, a as pipeInsertDataQuery, an as getPluginTypes, at as DOMPlugin, b as navigate, bt as getNodeDataAttributeKeys, c as setValue, cn as createSlatePlugin, ct as PlateError, d as insertExitBreak, dt as AffinityPlugin, en as getContainerTypes, et as isHtmlInlineElement, f as init, ft as setAffinitySelection, g as NodeIdPlugin, gt as getEdgeNodes, h as pipeOnNodeChange, ht as getMarkBoundaryAffinity, i as ParserPlugin, in as getPluginType, it as AUTO_SCROLL, j as deserializeHtmlElement, jt as isSlatePluginNode, k as deserializeHtml, kt as isSlateNode, l as resetBlock, ln as createTSlatePlugin, lt as ChunkingPlugin, m as pipeOnTextChange, mt as isNodesAffinity, n as withSlate, nn as getPluginKey, nt as isHtmlText, o as normalizeDescendantsToDocumentFragment, on as getSlatePlugin, ot as withScrolling, pt as isNodeAffinity, q as collapseWhiteSpaceNode, qt as createBlockStartInputRule, r as getCorePlugins, rn as getPluginKeys, rt as isHtmlElement, s as SlateExtensionPlugin, sn as getEditorPlugin, st as DebugPlugin, t as createSlateEditor, tn as getPluginByType, tt as inlineTagNames, u as liftBlock, ut as withChunking, v as withNodeId, vt as getSlateClass, w as NAVIGATION_FEEDBACK_KEY, wt as defaultsDeepToNodes, x as clearNavigationFeedbackTarget, xt as keyToDataAttribute, y as NavigationFeedbackPlugin, yt as getPluginNodeProps, z as getDataNodeProps, zt as withMergeRules } from "./withSlate-DsAgt7dN.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";
|
|
@@ -356,6 +356,109 @@ const removeHtmlNodesBetweenComments = (rootNode, start, end) => {
|
|
|
356
356
|
});
|
|
357
357
|
};
|
|
358
358
|
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/lib/plugins/input-rules/createRuleFactory.ts
|
|
361
|
+
const getMergedInput = (context, options) => ({
|
|
362
|
+
...options,
|
|
363
|
+
...context
|
|
364
|
+
});
|
|
365
|
+
const resolveFactoryValue = (value, input) => {
|
|
366
|
+
if (typeof value === "function") return value(input);
|
|
367
|
+
return value;
|
|
368
|
+
};
|
|
369
|
+
function createRuleFactory(configOrBuilder) {
|
|
370
|
+
return (options = {}) => {
|
|
371
|
+
const factoryOptions = typeof configOrBuilder === "function" ? options : {
|
|
372
|
+
...configOrBuilder,
|
|
373
|
+
...options
|
|
374
|
+
};
|
|
375
|
+
const config = typeof configOrBuilder === "function" ? configOrBuilder(options) : configOrBuilder;
|
|
376
|
+
const priority = typeof options.priority === "number" ? options.priority : typeof config.priority === "number" ? config.priority : void 0;
|
|
377
|
+
const insertTextEnabled = typeof options.enabled === "function" ? options.enabled : void 0;
|
|
378
|
+
const insertBreakEnabled = typeof options.enabled === "function" ? options.enabled : void 0;
|
|
379
|
+
const insertDataEnabled = typeof options.enabled === "function" ? options.enabled : void 0;
|
|
380
|
+
const selectionEnabled = typeof options.enabled === "function" ? options.enabled : void 0;
|
|
381
|
+
const getFactoryInput = (context) => getMergedInput(context, factoryOptions);
|
|
382
|
+
if (config.type === "mark") {
|
|
383
|
+
const markConfig = config;
|
|
384
|
+
return createMarkInputRule({
|
|
385
|
+
enabled: markConfig.enabled ? (context) => markConfig.enabled(getFactoryInput(context)) : insertTextEnabled,
|
|
386
|
+
end: resolveFactoryValue(markConfig.end, getFactoryInput({})),
|
|
387
|
+
mark: resolveFactoryValue(markConfig.mark, getFactoryInput({})),
|
|
388
|
+
marks: resolveFactoryValue(markConfig.marks, getFactoryInput({})),
|
|
389
|
+
priority,
|
|
390
|
+
start: resolveFactoryValue(markConfig.start, getFactoryInput({})),
|
|
391
|
+
trigger: resolveFactoryValue(markConfig.trigger, getFactoryInput({})),
|
|
392
|
+
trim: resolveFactoryValue(markConfig.trim, getFactoryInput({}))
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
if (config.type === "blockStart") {
|
|
396
|
+
const blockStartConfig = config;
|
|
397
|
+
return createBlockStartInputRule({
|
|
398
|
+
enabled: blockStartConfig.enabled ? (context) => blockStartConfig.enabled(getFactoryInput(context)) : insertTextEnabled,
|
|
399
|
+
match: (context) => resolveFactoryValue(blockStartConfig.match, getFactoryInput(context)),
|
|
400
|
+
mode: resolveFactoryValue(blockStartConfig.mode, getFactoryInput({})),
|
|
401
|
+
node: resolveFactoryValue(blockStartConfig.node, getFactoryInput({})),
|
|
402
|
+
priority,
|
|
403
|
+
removeMatchedText: resolveFactoryValue(blockStartConfig.removeMatchedText, getFactoryInput({})),
|
|
404
|
+
resolveMatch: blockStartConfig.resolveMatch ? ((args) => blockStartConfig.resolveMatch(args, getFactoryInput({}))) : void 0,
|
|
405
|
+
apply: blockStartConfig.apply ? (context, match) => blockStartConfig.apply(getFactoryInput(context), match) : void 0,
|
|
406
|
+
trigger: resolveFactoryValue(blockStartConfig.trigger, getFactoryInput({}))
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if (config.type === "blockFence") {
|
|
410
|
+
const blockFenceConfig = config;
|
|
411
|
+
return createBlockFenceInputRule({
|
|
412
|
+
apply: (context, match) => blockFenceConfig.apply(getFactoryInput(context), match),
|
|
413
|
+
block: resolveFactoryValue(blockFenceConfig.block, getFactoryInput({})),
|
|
414
|
+
enabled: blockFenceConfig.enabled ? (context) => blockFenceConfig.enabled(getFactoryInput(context)) : selectionEnabled,
|
|
415
|
+
fence: resolveFactoryValue(blockFenceConfig.fence, getFactoryInput({})),
|
|
416
|
+
on: resolveFactoryValue(blockFenceConfig.on ?? options.on, getFactoryInput({})),
|
|
417
|
+
priority,
|
|
418
|
+
resolveMatch: blockFenceConfig.resolveMatch ? ((args) => blockFenceConfig.resolveMatch(args, getFactoryInput({}))) : void 0
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
if (config.type === "insertText") {
|
|
422
|
+
const insertTextConfig = config;
|
|
423
|
+
return defineInputRule({
|
|
424
|
+
apply: (context, match) => insertTextConfig.apply(getFactoryInput(context), match),
|
|
425
|
+
enabled: insertTextConfig.enabled ? (context) => insertTextConfig.enabled(getFactoryInput(context)) : insertTextEnabled,
|
|
426
|
+
priority,
|
|
427
|
+
resolve: insertTextConfig.resolve ? (context) => insertTextConfig.resolve(getFactoryInput(context)) : void 0,
|
|
428
|
+
target: "insertText",
|
|
429
|
+
trigger: resolveFactoryValue(insertTextConfig.trigger, getFactoryInput({}))
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
if (config.type === "insertBreak") {
|
|
433
|
+
const insertBreakConfig = config;
|
|
434
|
+
return defineInputRule({
|
|
435
|
+
apply: (context, match) => insertBreakConfig.apply(getFactoryInput(context), match),
|
|
436
|
+
enabled: insertBreakConfig.enabled ? (context) => insertBreakConfig.enabled(getFactoryInput(context)) : insertBreakEnabled,
|
|
437
|
+
priority,
|
|
438
|
+
resolve: insertBreakConfig.resolve ? (context) => insertBreakConfig.resolve(getFactoryInput(context)) : void 0,
|
|
439
|
+
target: "insertBreak"
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
if (config.type === "insertData") {
|
|
443
|
+
const insertDataConfig = config;
|
|
444
|
+
return defineInputRule({
|
|
445
|
+
apply: (context, match) => insertDataConfig.apply(getFactoryInput(context), match),
|
|
446
|
+
enabled: insertDataConfig.enabled ? (context) => insertDataConfig.enabled(getFactoryInput(context)) : insertDataEnabled,
|
|
447
|
+
mimeTypes: resolveFactoryValue(insertDataConfig.mimeTypes, getFactoryInput({})),
|
|
448
|
+
priority,
|
|
449
|
+
resolve: insertDataConfig.resolve ? (context) => insertDataConfig.resolve(getFactoryInput(context)) : void 0,
|
|
450
|
+
target: "insertData"
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
const textSubstitutionConfig = config;
|
|
454
|
+
return createTextSubstitutionInputRule({
|
|
455
|
+
enabled: textSubstitutionConfig.enabled ? (context) => textSubstitutionConfig.enabled(getFactoryInput(context)) : insertTextEnabled,
|
|
456
|
+
patterns: resolveFactoryValue(textSubstitutionConfig.patterns, getFactoryInput({})),
|
|
457
|
+
priority
|
|
458
|
+
});
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
|
|
359
462
|
//#endregion
|
|
360
463
|
//#region src/lib/plugins/node-id/normalizeStaticValue.ts
|
|
361
464
|
const STATIC_VALUE_CREATED_AT = 17040672e5;
|
|
@@ -412,4 +515,4 @@ const overridePluginsByKey = (plugin, overrideByKey = {}, nested = false) => {
|
|
|
412
515
|
};
|
|
413
516
|
|
|
414
517
|
//#endregion
|
|
415
|
-
export { AUTO_SCROLL, AffinityPlugin, AstPlugin, BaseParagraphPlugin, CARRIAGE_RETURN, ChunkingPlugin, DOMPlugin, DebugPlugin, HistoryPlugin, Hotkeys, HtmlPlugin, LINE_FEED, LengthPlugin, NO_BREAK_SPACE, NodeIdPlugin, OverridePlugin, ParserPlugin, PlateError, SPACE, STATIC_VALUE_CREATED_AT, SlateExtensionPlugin, TAB, ZERO_WIDTH_SPACE, applyDeepToNodes, cleanHtmlBrElements, cleanHtmlCrLf, cleanHtmlEmptyElements, cleanHtmlFontElements, cleanHtmlLinkElements, cleanHtmlTextNodes, collapseString, collapseWhiteSpace, collapseWhiteSpaceChildren, collapseWhiteSpaceElement, collapseWhiteSpaceNode, collapseWhiteSpaceText, copyBlockMarksToSpanChild, createHotkey, createSlateEditor, createSlatePlugin, createTSlatePlugin, createZustandStore, defaultsDeepToNodes, deserializeHtml, deserializeHtmlElement, deserializeHtmlNode, deserializeHtmlNodeChildren, endInlineFormattingContext, findHtmlElement, 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, mergeDeepToNodes, nanoid, normalizeDescendantsToDocumentFragment, normalizeNodeId, normalizeStaticValue, omitPluginContext, overridePluginsByKey, parseHtmlDocument, parseHtmlElement, pipeDeserializeHtmlElement, pipeDeserializeHtmlLeaf, pipeInsertDataQuery, pipeOnNodeChange, pipeOnTextChange, pluginDeserializeHtml, postCleanHtml, preCleanHtml, removeHtmlNodesBetweenComments, removeHtmlSurroundings, replaceTagName, resetBlock, setAffinitySelection, setValue, someHtmlElement, traverseHtmlComments, traverseHtmlElements, traverseHtmlNode, traverseHtmlTexts, unwrapHtmlElement, upsertInlineFormattingContext, withBreakRules, withChunking, withDeleteRules, withMergeRules, withNodeId, withNormalizeRules, withOverrides, withPlateHistory, withScrolling, withSlate };
|
|
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 };
|