@lofcz/platejs-core 52.3.4

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","PlateChunkProps","ContentVisibilityChunk","t0","$","_c","attributes","children","lowest","t1","Symbol","for","contentVisibility","t2","AnyPluginConfig","InferApi","InferOptions","InferSelectors","InferTransforms","PluginConfig","SlatePlugin","PlatePlugin","PlatePluginContext","PlatePluginMethods","PlatePluginConfig","Omit","Partial","C","EO","EA","ET","ES","api","node","options","selectors","transforms","methodsToWrap","toPlatePlugin","basePlugin","extendConfig","ctx","plugin","forEach","method","originalMethod","args","slatePlugin","extendedPlugin","extend","ExtendPluginConfig","toTPlatePlugin","TContext","Modify","PlateEditor","PlatePlugin","PlatePluginMethods","AnyPluginConfig","PluginConfig","createSlatePlugin","toPlatePlugin","PlatePluginConfig","Omit","Partial","K","O","A","T","S","node","TPlatePluginConfig","C","createPlatePlugin","config","editor","plugin","createTPlatePlugin","PlateEditor","InferConfig","PlatePlugin","PlatePluginContext","AnyPluginConfig","WithRequiredKey","getEditorPlugin","getBaseEditorPlugin","editor","plugin","P","AnyPluginConfig","PluginConfig","WithRequiredKey","PlateEditor","PlatePlugin","createPlatePlugin","getPlugin","editor","plugin","C","node","plugins","key","AnyPlatePlugin","PlatePluginContext","omitPluginContext","ctx","T","api","editor","getOption","getOptions","plugin","setOption","setOptions","tf","type","rest","isDefined","Hotkeys","SlateExtensionPlugin","toPlatePlugin","SlateReactExtensionPlugin","handlers","onKeyDown","editor","event","persist","dom","currentKeyboardEvent","isMoveUpward","tf","moveLine","reverse","preventDefault","stopPropagation","isMoveDownward","isTab","isUntab","tab","isSelectAll","selectAll","isEscape","escape","extendEditorApi","redecorate","api","debug","warn","extendEditorTransforms","reset","options","isFocused","focus","edge","overrideEditor","normalizeNode","transforms","entry","_memo","unsetNodes","at","createZustandStore","EventEditorState","blur","focus","last","EventEditorStore","mutative","name","useValue","useEventEditorValue","useEffect","PlateEditor","FOCUS_EDITOR_EVENT","BLUR_EDITOR_EVENT","useFocusEditorEvents","t0","$","_c","editorRef","onEditorBlur","onEditorFocus","t1","t2","onFocusEditor","event","id","detail","onBlurEditor","event_0","id_0","document","addEventListener","removeEventListener","createPlatePlugin","EventEditorStore","BLUR_EDITOR_EVENT","FOCUS_EDITOR_EVENT","EventEditorPlugin","key","handlers","onBlur","editor","focus","get","id","set","document","dispatchEvent","CustomEvent","detail","onFocus","EventEditorStore","getEventPlateId","id","focus","get","blur","useEditorId","useEventEditorValue","useFocusedLast","id","editorId","lastFocusedEditorId","Key","BaseParagraphPlugin","toPlatePlugin","ParagraphPlugin","editor","type","shortcuts","toggleParagraph","keys","Mod","Alt","Shift","preventDefault","handler","tf","toggleBlock","DomConfig","ExtendEditor","withReact","withPlateReact","editor","DOMPlugin","toPlatePlugin","withPlateReact","ReactPlugin","key","extendEditor","ParagraphPlugin","ReactPlugin","EventEditorPlugin","SlateReactExtensionPlugin","getPlateCorePlugins","Editor","Value","createEditor","AnyPlatePlugin","EventEditorPlugin","SlateReactExtensionPlugin","PlateEditor","TPlateEditor","AnyPluginConfig","BaseWithSlateOptions","CorePlugin","InferPlugins","withSlate","createZustandStore","getPlateCorePlugins","PlateCorePlugin","WithPlateOptions","P","Pick","Partial","value","editor","Promise","V","rootPlugin","plugin","onReady","ctx","isAsync","withPlate","e","options","optionsStoreFactory","plugins","rest","CreatePlateEditorOptions","createPlateEditor","LegacyEditorMethods","CreatePlateEditorOptions","createPlateEditor","createPlateFallbackEditor","options","editor","meta","isFallback","apply","Error","DOMHandlers","DOM_HANDLERS","AnyObject","clsx","PlateHTMLProps","PlateEditor","AnyEditorPlatePlugin","pipeInjectNodeProps","getSlateClass","getPluginNodeProps","getEditorPlugin","getRenderNodeProps","attributes","nodeAttributes","disableInjectNodeProps","editor","plugin","props","readOnly","newProps","api","tf","transforms","className","pluginProps","node","type","undefined","findPath","style","Object","keys","length","React","EditableProps","PlateEditor","DOMHandlers","isEditOnly","getEditorPlugin","convertDomEventToSyntheticEvent","domEvent","Event","SyntheticEvent","propagationStopped","bubbles","cancelable","currentTarget","defaultPrevented","eventPhase","isTrusted","nativeEvent","target","timeStamp","type","isDefaultPrevented","isPropagationStopped","persist","Error","preventDefault","stopPropagation","isEventHandled","event","EventType","handler","shouldTreatEventAsHandled","pipeHandler","editor","editableProps","handlerKey","K","Omit","propsHandler","relevantPlugins","meta","pluginList","filter","plugin","handlers","length","isDomEvent","handledEvent","eventIsHandled","some","dom","readOnly","pluginHandler","Value","PlateEditor","isEditOnly","getPlugin","getEditorPlugin","pipeOnChange","editor","value","meta","pluginCache","handlers","onChange","some","key","plugin","dom","readOnly","handler","shouldTreatEventAsHandled","React","Path","TElement","TText","UnknownObject","useComposedRef","clsx","AnyPluginConfig","PluginConfig","RenderChunkProps","RenderElementProps","RenderLeafProps","RenderTextProps","PlatePluginContext","useEditorMounted","useNodeAttributes","props","ref","$","_c","t0","attributes","t1","className","undefined","t2","t3","t4","style","t5","PlateChunkProps","PlateElementProps","PlateNodeProps","C","N","path","DeprecatedNodeProps","CSSProperties","PlateHTMLProps","ComponentType","HTMLElementTagNameMap","PropsWithoutRef","T","ComponentProps","JSX","IntrinsicElements","as","StyledPlateElementProps","Omit","insetProp","PlateElement","forwardRef","children","Tag","mounted","block","element","id","editor","api","isBlock","inset","plugin","rules","selection","affinity","t6","position","t7","t8","t9","t10","ReactElement","PlateTextProps","StyledPlateTextProps","PlateText","HTMLSpanElement","PlateLeafProps","StyledPlateLeafProps","NonBreakingSpace","Symbol","for","fontSize","lineHeight","String","fromCodePoint","PlateLeaf","React","PlateEditor","AnyEditorPlatePlugin","isEditOnly","PlateLeafProps","PlateLeaf","useReadOnly","getRenderNodeProps","RenderLeaf","props","ReactElement","pluginRenderLeaf","editor","plugin","render","leaf","leafComponent","node","children","readOnly","type","Component","Leaf","ctxProps","attributes","defaultProps","as","React","clsx","EditableProps","PlateEditor","AnyEditorPlatePlugin","PlateLeaf","useReadOnly","getRenderNodeProps","RenderLeaf","pluginRenderLeaf","pipeRenderLeaf","editor","renderLeafProp","renderLeafs","leafPropsPlugins","meta","pluginCache","node","isLeaf","forEach","key","plugin","getPlugin","push","leafProps","render","attributes","props","readOnly","renderLeaf","newChildren","undefined","children","leaf","type","pluginLeafProps","className","ctxProps","React","PlateEditor","AnyEditorPlatePlugin","isEditOnly","PlateTextProps","PlateText","useReadOnly","getRenderNodeProps","RenderText","props","ReactElement","pluginRenderText","editor","plugin","render","nodeProps","node","children","text","readOnly","type","key","Text","ctxProps","attributes","defaultProps","as","React","clsx","EditableProps","PlateEditor","AnyEditorPlatePlugin","PlateText","useReadOnly","getRenderNodeProps","RenderText","pluginRenderText","pipeRenderText","editor","renderTextProp","renderTexts","textPropsPlugins","meta","pluginList","forEach","plugin","node","isLeaf","isDecoration","push","textProps","render","attributes","props","readOnly","renderText","newChildren","undefined","children","text","type","key","pluginTextProps","className","ctxProps","React","clsx","useAtomStoreValue","omit","useDeepCompareMemo","PlateProps","EditableProps","ChunkingPlugin","pipeDecorate","ContentVisibilityChunk","useEditorRef","usePlateStore","usePluginOption","DOM_HANDLERS","pipeHandler","pipeRenderElement","pipeRenderLeaf","pipeRenderText","useEditableProps","disabled","readOnly","editableProps","Omit","Pick","id","editor","store","versionDecorate","storeDecorate","storeRenderChunk","storeRenderElement","storeRenderLeaf","storeRenderText","decorateMemo","useMemo","decorate","entry","defaultRenderChunk","undefined","renderChunk","renderElement","renderLeaf","renderText","props","_props","forEach","handlerKey","handler","className","TNode","PathApi","useMemoizedSelector","useEditorRef","useNodePath","node","$","_c","editor","t0","api","findPath","t1","_temp","a","b","equals","React","Value","useAtomStoreValue","useEditorRef","useIncrementVersion","usePlateStore","pipeOnChange","SlateComponentProps","Omit","ComponentProps","Slate","PlateSlateProps","key","Key","useSlateProps","t0","$","_c","id","editor","store","onChangeProp","onValueChangeProp","onSelectionChangeProp","updateVersionEditor","updateVersionSelection","updateVersionValue","t1","newValue","eventIsHandled","value","onChange","t2","onValueChange","t3","selection","onSelectionChange","t4","t5","children","t6","meta","initialValue","Path","useAtomStoreValue","useEditorRef","useElementStore","usePath","pluginKey","editor","value","api","debug","warn","undefined","React","Nullable","ElementEntry","Path","TElement","PathApi","createAtomStore","useComposing","useReadOnly","useEditorRef","usePlateStore","usePath","SCOPE_ELEMENT","ElementStoreState","element","entry","path","initialState","ElementProvider","elementStore","useElementStore","effect","Effect","name","suppressWarnings","const","$","_c","equals","t0","Symbol","for","FirstBlockEffect","editor","store","composing","readOnly","dom","useLayoutEffect","set","React","PlateEditor","AnyEditorPlatePlugin","isEditOnly","PlateElementProps","PlateElement","useReadOnly","useEditorRef","useElement","ElementProvider","getRenderNodeProps","RenderElement","props","ReactElement","ElementContent","t0","$","_c","editor","plugin","t1","element","readOnly","children","_children","Component","render","node","Element","attributes","meta","pluginCache","belowNodes","forEach","key","plugin_0","getPlugin","withHOC","hoc","t2","as","defaultProps","component","aboveNodes","key_0","plugin_1","withHOC_0","hoc_0","BelowRootNodes","belowRootNodes","map","pluginRenderElement","path","React","PlateEditor","EditableProps","getPluginByType","PlateElement","useNodePath","useReadOnly","ElementProvider","getRenderNodeProps","BelowRootNodes","pluginRenderElement","pipeRenderElement","editor","renderElementProp","render","props","readOnly","path","element","plugin","type","node","isElement","ctxProps","disableInjectNodeProps","children","React","JotaiStore","Atom","atom","createAtomStore","useStoreAtomValue","PlateControllerProvider","PlateController","plateControllerStore","usePlateControllerStore","_usePlateControllerStore","activeId","editorStores","Record","primaryEditorIds","name","usePlateControllerLocalStore","options","scope","undefined","warnIfNoStore","usePlateControllerExists","store","idProp","$","_c","t0","get","forId","id","lookupOrder","id_0","storeAtom","React","atom","useAtomStoreSet","useAtomStoreState","useAtomStoreValue","PlateEditor","PlateChangeKey","PlateStoreState","createAtomStore","createPlateFallbackEditor","usePlateControllerExists","usePlateControllerStore","PlateStore","ReturnType","usePlateStore","PLATE_SCOPE","GLOBAL_PLATE_SCOPE","Symbol","createPlateStore","id","composing","containerRef","current","decorate","editor","isMounted","primary","readOnly","renderChunk","renderElement","renderLeaf","renderText","scrollRef","versionDecorate","versionEditor","versionSelection","versionValue","onChange","onNodeChange","onSelectionChange","onTextChange","onValueChange","state","Partial","E","name","suppressWarnings","extend","atoms","trackedEditor","get","version","trackedSelection","selection","trackedValue","value","children","PlateProvider","PlateStoreProvider","plateStore","usePlateSet","usePlateLocalSet","usePlateState","usePlateLocalState","usePlateLocalStore","usePlateValue","usePlateLocalValue","useFallbackPlateStore","localStore","scope","warnIfNoStore","localStoreExists","useState","store","plateControllerExists","fallbackStore","Error","key","options","useEditorId","useEditorContainerRef","useEditorScrollRef","useScrollRef","useEditorMounted","useEditorReadOnly","useEditorComposing","useEditorRef","useEditorSelection","useTrackedSelectionValue","useEditorState","useTrackedEditorValue","useEditorVersion","useSelectionVersion","useEditorValue","useTrackedValueValue","useValueVersion","useIncrementVersion","$","_c","previousVersionRef","useRef","setVersionDecorate","setVersionSelection","setVersionValue","setVersionEditor","t0","nextVersion","bb2","useRedecorate","updateDecorate","React","AnyPluginConfig","WithRequiredKey","PlateEditor","InferConfig","PlatePlugin","PlatePluginContext","getEditorPlugin","PlateStore","useEditorRef","useEditorPlugin","p","id","$","_c","editor","t0","t1","store","React","useStoreAtomValue","selectAtom","PlateEditor","plateStore","usePlateStore","UseEditorSelectorOptions","id","equalityFn","a","T","b","useEditorSelector","selector","editor","E","prev","deps","DependencyList","selectorAtom","useMemo","atom","trackedEditor","TEqualityChecker","useStoreSelect","useStoreValue","AnyPluginConfig","InferOptions","InferSelectors","WithRequiredKey","PlateEditor","useEditorRef","usePluginOption","C","StateType","TSelectors","plugin","key","K","args","Parameters","ReturnType","editor","useEditorPluginOption","store","getOptionsStore","undefined","get","selectors","api","debug","error","state","usePluginOptions","selector","t0","$","_c","t1","id","equalityFn","t2","useEditorPluginOptions","U","a","b","TElement","useAtomStoreValue","useEditorRef","SCOPE_ELEMENT","useElementStore","useElement","t0","$","_c","pluginKey","undefined","editor","value","api","debug","warn","t1","Symbol","for","T","React","NodeEntry","TElement","useStoreAtomValue","selectAtom","elementStore","useElementStore","UseElementSelectorOptions","key","equalityFn","a","T","b","useElementSelector","selector","state","N","prev","deps","DependencyList","selectorAtom","useMemo","atom","entry","useEventEditorValue","PLATE_SCOPE","useEditorRef","useEventPlateId","id","focus","blur","last","providerId","React","useEffect","useHotkeys","isDefined","Shortcut","useEditorRef","EditorHotkeysEffect","t0","$","_c","id","editableRef","editor","t1","meta","shortcuts","Object","entries","map","t2","hotkeyString","hotkeyConfig","keys","handler","HotkeyEffect","options","event","eventDetails","preventDefault","stopPropagation","enableOnContentEditable","t3","Symbol","for","setHotkeyRef","t4","t5","current","React","useEditorRef","useRedecorate","EditorMethodsEffect","id","editor","redecorate","useEffect","api","React","useAtomStoreSet","useAtomStoreValue","AnyEditorPlatePlugin","getEditorPlugin","getPlugin","useEditorRef","usePlateStore","EditorRefPluginEffect","id","plugin","editor","useHooks","EditorRefEffect","store","setIsMounted","useEffect","meta","pluginCache","map","key","React","global","Global","__PLATE_INSTANCES__","checkPlateInstances","globalThis","usePlateInstancesWarn","disabled","$","_c","t0","t1","console","warn","useEffect","React","useId","EditableProps","PlateEditor","usePlateInstancesWarn","PlateStoreState","PlateStoreProvider","PlateProps","Partial","Pick","E","children","ReactNode","editor","renderElement","renderLeaf","suppressInstanceWarning","PlateInner","t0","$","_c","containerRef","decorate","primary","readOnly","scrollRef","onChange","onNodeChange","onSelectionChange","onTextChange","onValueChange","t1","dom","t2","id","Plate","props","useRef","HTMLDivElement","meta","uid","replaceAll","key","React","HTMLAttributes","isEditOnly","useEditorContainerRef","useEditorReadOnly","useEditorRef","PlateContainer","t0","$","_c","children","props","editor","readOnly","containerRef","afterContainer","beforeContainer","mainContainer","t1","meta","uid","pluginCache","render","forEach","key","plugin","getPlugin","BeforeContainer","key_0","plugin_0","AfterContainer","displayName","React","WritableAtom","useStableFn","focusAtom","JotaiStore","useAtomStoreSet","useAtomStoreValue","useFocused","plateControllerStore","useEditorId","usePlateControllerLocalStore","usePlateStore","PlateControllerEffectProps","id","PlateControllerEffect","t0","$","_c","idProp","idFromStore","t1","atom","editorStores","Record","optic","prop","currentStoreAtom","t2","t3","setAtom","t4","setCurrentStore","setPrimaryEditorIds","setActiveId","store","primary","focused","t5","t6","activeId","useEffect","t7","t8","ids","ids_0","filter","i","t10","t9","React","useSlateProps","Slate","useEditorRef","PlateSlate","t0","$","_c","id","children","t1","slateProps","editor","aboveSlate","initialValue","key","onChange","onSelectionChange","onValueChange","meta","pluginCache","render","forEach","plugin","getPlugin","AboveSlate","React","useRef","useComposedRef","isDefined","useAtomStoreValue","EditableProps","PlateEditor","isEditOnly","SlateExtensionPlugin","useEditableProps","Editable","PlateStoreState","useEditorReadOnly","useEditorRef","usePlateStore","EditorHotkeysEffect","EditorMethodsEffect","EditorRefEffect","PlateControllerEffect","PlateSlate","PlateContentProps","Omit","autoFocusOnEditable","decorate","disabled","renderEditable","editable","ReactElement","ReactNode","PlateContent","forwardRef","readOnly","readOnlyProp","props","ref","id","editor","storeReadOnly","dom","Error","editableProps","editableRef","HTMLDivElement","combinedRef","children","length","afterEditable","beforeEditable","meta","pluginCache","render","forEach","key","plugin","getPlugin","BeforeEditable","AfterEditable","aboveEditable","AboveEditable","displayName","EditorStateEffect","t0","$","_c","store","t1","setReadOnly","t2","useLayoutEffect","onNodeChange","t3","t4","setOption","onTextChange","t5","t6","prevReadOnly","t7","tf","current","focus","edge","t8","useEffect","React","Value","AnyPluginConfig","CreatePlateEditorOptions","PlateCorePlugin","TPlateEditor","createPlateEditor","usePlateEditor","options","V","P","enabled","TEnabled","deps","DependencyList","forceRender","useState","isMountedRef","useRef","useEffect","current","useMemo","editor","onReady","ctx","isAsync","id","React","Value","AnyPluginConfig","createStaticEditor","usePlateViewEditor","options","Parameters","V","P","enabled","TEnabled","deps","DependencyList","ReturnType","isMountedRef","useRef","forceRender","useState","useEffect","current","useMemo","onReady","ctx","isAsync","id","React","CreatePlateEditorOptions","createPlateEditor","PlateProps","Plate","PlateContentProps","PlateContent","PlateTest","t0","$","_c","editableProps","editor","props","variant","t1","shouldNormalizeEditor","t2","t3","undefined","id","_editor","plugins","meta","pluginList","React","useCallback","PlateStaticProps","PlateStatic","PlateViewProps","PlateView","props","$","_c","t0","editor","tf","e","setFragmentData","clipboardData","getData","preventDefault","t1","t2","React","RefComponent","FC","P","ref","Ref","R","withHOC","HOC","HOCProps","HOCRef","Component","ComponentProps","ComponentRef","hocProps","Omit","hocRef","forwardRef","props","componentRef","$","_c","t0","t1"],"sources":["../../src/react/components/ContentVisibilityChunk.tsx","../../src/react/plugin/toPlatePlugin.ts","../../src/react/plugin/createPlatePlugin.ts","../../src/react/plugin/getEditorPlugin.ts","../../src/react/plugin/getPlugin.ts","../../src/react/plugin/omitPluginContext.ts","../../src/react/plugins/SlateReactExtensionPlugin.ts","../../src/react/plugins/event-editor/EventEditorStore.ts","../../src/react/plugins/event-editor/useFocusEditorEvents.ts","../../src/react/plugins/event-editor/EventEditorPlugin.ts","../../src/react/plugins/event-editor/getEventPlateId.ts","../../src/react/plugins/event-editor/useFocusedLast.ts","../../src/react/plugins/paragraph/ParagraphPlugin.tsx","../../src/react/plugins/react/withPlateReact.ts","../../src/react/plugins/react/ReactPlugin.ts","../../src/react/editor/getPlateCorePlugins.ts","../../src/react/editor/withPlate.ts","../../src/react/utils/createPlateFallbackEditor.ts","../../src/react/utils/dom-attributes.ts","../../src/react/utils/getRenderNodeProps.ts","../../src/react/utils/pipeHandler.ts","../../src/react/utils/pipeOnChange.ts","../../src/react/components/plate-nodes.tsx","../../src/react/utils/pluginRenderLeaf.tsx","../../src/react/utils/pipeRenderLeaf.tsx","../../src/react/utils/pluginRenderText.tsx","../../src/react/utils/pipeRenderText.tsx","../../src/react/hooks/useEditableProps.ts","../../src/react/hooks/useNodePath.ts","../../src/react/hooks/useSlateProps.ts","../../src/react/stores/element/usePath.ts","../../src/react/stores/element/useElementStore.tsx","../../src/react/utils/pluginRenderElement.tsx","../../src/react/utils/pipeRenderElement.tsx","../../src/react/stores/plate-controller/plateControllerStore.ts","../../src/react/stores/plate/createPlateStore.ts","../../src/react/stores/plate/useEditorPlugin.ts","../../src/react/stores/plate/useEditorSelector.ts","../../src/react/stores/plate/usePluginOption.ts","../../src/react/stores/element/useElement.ts","../../src/react/stores/element/useElementSelector.ts","../../src/react/stores/event-editor/useEventPlateId.ts","../../src/react/components/EditorHotkeysEffect.tsx","../../src/react/components/EditorMethodsEffect.ts","../../src/react/components/EditorRefEffect.tsx","../../src/internal/hooks/usePlateInstancesWarn.ts","../../src/react/components/Plate.tsx","../../src/react/components/PlateContainer.tsx","../../src/react/components/PlateControllerEffect.ts","../../src/react/components/PlateSlate.tsx","../../src/react/components/PlateContent.tsx","../../src/react/editor/usePlateEditor.ts","../../src/react/editor/usePlateViewEditor.ts","../../src/react/components/PlateTest.tsx","../../src/react/components/PlateView.tsx","../../src/react/components/withHOC.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { PlateChunkProps } from './plate-nodes';\n\nexport const ContentVisibilityChunk = ({\n attributes,\n children,\n lowest,\n}: PlateChunkProps) => {\n if (!lowest) return children;\n\n return (\n <div {...attributes} style={{ contentVisibility: 'auto' }}>\n {children}\n </div>\n );\n};\n","import type {\n AnyPluginConfig,\n InferApi,\n InferOptions,\n InferSelectors,\n InferTransforms,\n PluginConfig,\n SlatePlugin,\n} from '../../lib';\nimport type {\n PlatePlugin,\n PlatePluginContext,\n PlatePluginMethods,\n} from './PlatePlugin';\n\ntype PlatePluginConfig<\n C extends AnyPluginConfig,\n EO = {},\n EA = {},\n ET = {},\n ES = {},\n> = Omit<\n Partial<\n PlatePlugin<\n PluginConfig<\n C['key'],\n EO & InferOptions<C>,\n EA & InferApi<C>,\n ET & InferTransforms<C>,\n ES & InferSelectors<C>\n >\n >\n >,\n keyof PlatePluginMethods | 'api' | 'node' | 'options' | 'transforms'\n> & {\n api?: EA & Partial<InferApi<C>>;\n node?: Partial<PlatePlugin<C>['node']>;\n options?: EO & Partial<InferOptions<C>>;\n selectors?: ES & Partial<InferSelectors<C>>;\n transforms?: ET & Partial<InferTransforms<C>>;\n};\n\nconst methodsToWrap: (keyof SlatePlugin)[] = [\n 'configure',\n 'configurePlugin',\n 'extendEditorApi',\n 'extendSelectors',\n 'extendApi',\n 'extendEditorTransforms',\n 'extendTransforms',\n 'overrideEditor',\n 'extend',\n 'extendPlugin',\n];\n\n/**\n * Extends a SlatePlugin to create a React PlatePlugin.\n *\n * @remarks\n * This function transforms a SlatePlugin into a React PlatePlugin, allowing for\n * React-specific functionality to be added.\n * @param basePlugin - The base SlatePlugin to be extended.\n * @param extendConfig - A function or object that provides the extension\n * configuration. If a function, it receives the plugin context and should\n * return a partial PlatePlugin. If an object, it should be a partial\n * PlatePlugin configuration.\n * @returns A new PlatePlugin that combines the base SlatePlugin functionality\n * with React-specific features defined in the extension configuration.\n */\nexport function toPlatePlugin<\n C extends AnyPluginConfig,\n EO = {},\n EA = {},\n ET = {},\n ES = {},\n>(\n basePlugin: SlatePlugin<C>,\n extendConfig?:\n | ((ctx: PlatePluginContext<C>) => PlatePluginConfig<C, EO, EA, ET>)\n | PlatePluginConfig<C, EO, EA, ET>\n): PlatePlugin<\n PluginConfig<\n C['key'],\n EO & InferOptions<C>,\n EA & InferApi<C>,\n ET & InferTransforms<C>,\n ES & InferSelectors<C>\n >\n> {\n const plugin = { ...basePlugin } as unknown as PlatePlugin;\n\n methodsToWrap.forEach((method) => {\n const originalMethod = plugin[method];\n\n (plugin as any)[method] = (...args: any[]) => {\n const slatePlugin = originalMethod(...args);\n\n return toPlatePlugin(slatePlugin);\n };\n });\n\n if (!extendConfig) return plugin as any;\n\n const extendedPlugin = plugin.extend(extendConfig as any);\n\n return extendedPlugin as any;\n}\n\ntype ExtendPluginConfig<C extends AnyPluginConfig = PluginConfig> = Omit<\n Partial<\n PlatePlugin<\n PluginConfig<\n C['key'],\n Partial<InferOptions<C>>,\n Partial<InferApi<C>>,\n Partial<InferTransforms<C>>\n >\n >\n >,\n keyof PlatePluginMethods\n>;\n\n/**\n * Explicitly typed version of {@link toPlatePlugin}.\n *\n * @remarks\n * This function requires explicit type parameters for both the base plugin\n * configuration and the extension configuration. Use this when you need\n * precise control over the plugin's type structure or when type inference\n * doesn't provide the desired result.\n * @typeParam C - The type of the extension configuration for the PlatePlugin\n * (required).\n * @typeParam TContext - The type of the base SlatePlugin configuration\n * (optional).\n */\nexport function toTPlatePlugin<\n C extends AnyPluginConfig = PluginConfig,\n TContext extends AnyPluginConfig = AnyPluginConfig,\n>(\n basePlugin: SlatePlugin<TContext>,\n extendConfig?:\n | ((ctx: PlatePluginContext<TContext>) => ExtendPluginConfig<C>)\n | ExtendPluginConfig<C>\n): PlatePlugin<\n PluginConfig<\n C['key'],\n InferOptions<C>,\n InferApi<C>,\n InferTransforms<C>,\n InferSelectors<C>\n >\n> {\n return toPlatePlugin(basePlugin as any, extendConfig as any);\n}\n","import type { Modify } from '@udecode/utils';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { PlatePlugin, PlatePluginMethods } from './PlatePlugin';\n\nimport {\n type AnyPluginConfig,\n type PluginConfig,\n createSlatePlugin,\n} from '../../lib';\nimport { toPlatePlugin } from './toPlatePlugin';\n\ntype PlatePluginConfig<\n K extends string = any,\n O = {},\n A = {},\n T = {},\n S = {},\n> = Omit<\n Partial<\n Modify<\n PlatePlugin<PluginConfig<K, O, A, T, S>>,\n {\n node: Partial<PlatePlugin<PluginConfig<K, O, A, T, S>>['node']>;\n }\n >\n >,\n keyof PlatePluginMethods | 'optionsStore' | 'useOptionsStore'\n>;\n\ntype TPlatePluginConfig<C extends AnyPluginConfig = PluginConfig> = Omit<\n Partial<\n Modify<\n PlatePlugin<C>,\n {\n node: Partial<PlatePlugin<C>['node']>;\n }\n >\n >,\n keyof PlatePluginMethods | 'optionsStore' | 'useOptionsStore'\n>;\n\nexport const createPlatePlugin = <\n K extends string = any,\n O = {},\n A = {},\n T = {},\n S = {},\n>(\n config:\n | ((editor: PlateEditor) => PlatePluginConfig<K, O, A, T, S>)\n | PlatePluginConfig<K, O, A, T, S> = {}\n): PlatePlugin<PluginConfig<K, O, A, T, S>> => {\n const plugin = createSlatePlugin(config as any);\n\n return toPlatePlugin(plugin as any) as any;\n};\n\n/**\n * Explicitly typed version of `createPlatePlugin`.\n *\n * @remarks\n * While `createPlatePlugin` uses type inference, this function requires an\n * explicit type parameter. Use this when you need precise control over the\n * plugin's type structure or when type inference doesn't provide the desired\n * result.\n */\nexport function createTPlatePlugin<C extends AnyPluginConfig = PluginConfig>(\n config:\n | ((editor: PlateEditor) => TPlatePluginConfig<C>)\n | TPlatePluginConfig<C> = {}\n): PlatePlugin<C> {\n return createPlatePlugin(config as any) as any;\n}\n","import type { PlateEditor } from '../editor';\nimport type {\n InferConfig,\n PlatePlugin,\n PlatePluginContext,\n} from './PlatePlugin';\n\nimport {\n type AnyPluginConfig,\n type WithRequiredKey,\n getEditorPlugin as getBaseEditorPlugin,\n} from '../../lib';\n\nexport function getEditorPlugin<\n P extends AnyPluginConfig | PlatePlugin<AnyPluginConfig>,\n>(\n editor: PlateEditor,\n plugin: WithRequiredKey<P>\n): PlatePluginContext<InferConfig<P> extends never ? P : InferConfig<P>> {\n return getBaseEditorPlugin(editor, plugin) as any;\n}\n","import type { AnyPluginConfig, PluginConfig, WithRequiredKey } from '../../lib';\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { PlatePlugin } from './PlatePlugin';\n\nimport { createPlatePlugin } from './createPlatePlugin';\n\n/** Get editor plugin by key or plugin object. */\nexport function getPlugin<C extends AnyPluginConfig = PluginConfig>(\n editor: PlateEditor,\n plugin: WithRequiredKey<C>\n): C extends { node: any } ? C : PlatePlugin<C> {\n return (\n (editor.plugins[plugin.key] as any) ??\n createPlatePlugin({ key: plugin.key })\n );\n}\n","import type { AnyPlatePlugin, PlatePluginContext } from './PlatePlugin';\n\nexport const omitPluginContext = <T extends PlatePluginContext<AnyPlatePlugin>>(\n ctx: T\n) => {\n const {\n api,\n editor,\n getOption,\n getOptions,\n plugin,\n setOption,\n setOptions,\n tf,\n type,\n ...rest\n } = ctx;\n\n return rest;\n};\n","import { isDefined } from '@udecode/utils';\n\nimport { Hotkeys, SlateExtensionPlugin } from '../../lib';\nimport { toPlatePlugin } from '../plugin';\n\nexport const SlateReactExtensionPlugin = toPlatePlugin(SlateExtensionPlugin, {\n handlers: {\n onKeyDown: ({ editor, event }: any) => {\n // React 16.x needs this event to be persistented due to it's event pooling implementation.\n // https://reactjs.org/docs/legacy-event-pooling.html\n event.persist();\n editor.dom.currentKeyboardEvent = event;\n\n if (Hotkeys.isMoveUpward(event)) {\n if (editor.tf.moveLine({ reverse: true })) {\n event.preventDefault();\n event.stopPropagation();\n }\n } else if (Hotkeys.isMoveDownward(event)) {\n if (editor.tf.moveLine({ reverse: false })) {\n event.preventDefault();\n event.stopPropagation();\n }\n } else if (\n Hotkeys.isTab(editor, event) ||\n Hotkeys.isUntab(editor, event)\n ) {\n if (editor.tf.tab({ reverse: Hotkeys.isUntab(editor, event) })) {\n event.preventDefault();\n event.stopPropagation();\n }\n } else if (Hotkeys.isSelectAll(event)) {\n if (editor.tf.selectAll()) {\n event.preventDefault();\n event.stopPropagation();\n }\n } else if (Hotkeys.isEscape(event) && editor.tf.escape()) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n },\n})\n .extendEditorApi(({ editor }) => ({\n redecorate: () => {\n editor.api.debug.warn(\n 'The method editor.api.redecorate() has not been overridden. ' +\n 'This may cause unexpected behavior. Please ensure that all required editor methods are properly defined.',\n 'OVERRIDE_MISSING'\n );\n },\n }))\n .extendEditorTransforms(({ editor, tf: { reset } }) => ({\n reset(options) {\n const isFocused = editor.api.isFocused();\n\n reset(options);\n\n if (isFocused) {\n editor.tf.focus({ edge: 'startEditor' });\n }\n },\n }))\n .overrideEditor(({ editor, tf: { normalizeNode } }) => ({\n transforms: {\n normalizeNode(entry, options) {\n if (isDefined(entry[0]._memo)) {\n editor.tf.unsetNodes('_memo', { at: entry[1] });\n\n return;\n }\n\n normalizeNode(entry, options);\n },\n },\n }));\n","import { createZustandStore } from 'zustand-x';\n\nexport type EventEditorState = {\n /** Last editor id that has been blurred. */\n blur: string | null;\n /** Editor id that is currently being focused. */\n focus: string | null;\n /** Last editor id. */\n last: string | null;\n};\n\n/** Store where the keys are event names and the values are editor ids. */\nexport const EventEditorStore = createZustandStore(\n {\n blur: null,\n focus: null,\n last: null,\n } as EventEditorState,\n {\n mutative: true,\n name: 'event-editor',\n }\n);\n\nexport const { useValue: useEventEditorValue } = EventEditorStore;\n","import { useEffect } from 'react';\n\nimport type { PlateEditor } from '../../editor/PlateEditor';\n\nexport const FOCUS_EDITOR_EVENT = 'focus-editor-event';\n\nexport const BLUR_EDITOR_EVENT = 'blur-editor-event';\n\nexport const useFocusEditorEvents = ({\n editorRef,\n onEditorBlur,\n onEditorFocus,\n}: {\n editorRef: PlateEditor | null;\n onEditorBlur?: () => void;\n onEditorFocus?: () => void;\n}) => {\n useEffect(() => {\n const onFocusEditor = (event: Event) => {\n const id = (event as any).detail.id;\n\n if (!!onEditorFocus && editorRef && editorRef.id === id) {\n onEditorFocus();\n }\n };\n const onBlurEditor = (event: Event) => {\n const id = (event as any).detail.id;\n\n if (!!onEditorBlur && editorRef && editorRef.id === id) {\n onEditorBlur();\n }\n };\n\n document.addEventListener(FOCUS_EDITOR_EVENT, onFocusEditor);\n document.addEventListener(BLUR_EDITOR_EVENT, onBlurEditor);\n\n return () => {\n document.removeEventListener(FOCUS_EDITOR_EVENT, onFocusEditor);\n document.removeEventListener(BLUR_EDITOR_EVENT, onBlurEditor);\n };\n }, [editorRef, onEditorBlur, onEditorFocus]);\n};\n","import { createPlatePlugin } from '../../plugin';\nimport { EventEditorStore } from './EventEditorStore';\nimport { BLUR_EDITOR_EVENT, FOCUS_EDITOR_EVENT } from './useFocusEditorEvents';\n\nexport const EventEditorPlugin = createPlatePlugin({\n key: 'eventEditor',\n handlers: {\n onBlur: ({ editor }) => {\n const focus = EventEditorStore.get('focus');\n\n if (focus === editor.id) {\n EventEditorStore.set('focus', null);\n }\n\n EventEditorStore.set('blur', editor.id);\n\n document.dispatchEvent(\n new CustomEvent(BLUR_EDITOR_EVENT, {\n detail: { id: editor.id },\n })\n );\n },\n onFocus: ({ editor }) => {\n EventEditorStore.set('focus', editor.id);\n EventEditorStore.set('last', editor.id);\n\n document.dispatchEvent(\n new CustomEvent(FOCUS_EDITOR_EVENT, {\n detail: { id: editor.id },\n })\n );\n },\n },\n});\n","import { EventEditorStore } from './EventEditorStore';\n\nexport const getEventPlateId = (id?: string) => {\n if (id) return id;\n\n const focus = EventEditorStore.get('focus');\n\n if (focus) return focus;\n\n const blur = EventEditorStore.get('blur');\n\n if (blur) return blur;\n\n return EventEditorStore.get('last') ?? 'plate';\n};\n","import { useEditorId } from '../../stores';\nimport { useEventEditorValue } from './EventEditorStore';\n\n/** Whether the current editor is the last focused editor. */\nexport const useFocusedLast = (id?: string) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const editorId = id ?? useEditorId();\n const lastFocusedEditorId = useEventEditorValue('last');\n\n return editorId === lastFocusedEditorId;\n};\n","import { Key } from '@udecode/react-hotkeys';\n\nimport { BaseParagraphPlugin } from '../../../lib';\nimport { toPlatePlugin } from '../../plugin/toPlatePlugin';\n\nexport const ParagraphPlugin = toPlatePlugin(\n BaseParagraphPlugin,\n ({ editor, type }) => ({\n shortcuts: {\n toggleParagraph: {\n keys: [\n [Key.Mod, Key.Alt, '0'],\n [Key.Mod, Key.Shift, '0'],\n ],\n preventDefault: true,\n handler: () => {\n editor.tf.toggleBlock(type);\n },\n },\n },\n })\n);\n","import type { DomConfig, ExtendEditor } from '../../../lib';\n\nimport { withReact } from '../../slate-react';\n\nexport const withPlateReact: ExtendEditor<DomConfig> = ({ editor }) =>\n withReact(editor as any);\n","import { DOMPlugin } from '../../../lib';\nimport { toPlatePlugin } from '../../plugin/toPlatePlugin';\nimport { withPlateReact } from './withPlateReact';\n\n/** @see {@link withReact} */\nexport const ReactPlugin = toPlatePlugin(DOMPlugin, {\n key: 'dom',\n extendEditor: withPlateReact as any,\n});\n","import { ParagraphPlugin, ReactPlugin } from '../plugins';\nimport { EventEditorPlugin } from '../plugins/event-editor/EventEditorPlugin';\nimport { SlateReactExtensionPlugin } from '../plugins/SlateReactExtensionPlugin';\n\nexport const getPlateCorePlugins = () => [\n SlateReactExtensionPlugin,\n ReactPlugin,\n EventEditorPlugin,\n ParagraphPlugin,\n];\n","import { type Editor, type Value, createEditor } from '@platejs/slate';\n\nimport type { AnyPlatePlugin } from '../plugin';\nimport type { EventEditorPlugin, SlateReactExtensionPlugin } from '../plugins';\nimport type { PlateEditor, TPlateEditor } from './PlateEditor';\n\nimport {\n type AnyPluginConfig,\n type BaseWithSlateOptions,\n type CorePlugin,\n type InferPlugins,\n withSlate,\n} from '../../lib';\nimport { createZustandStore } from '../libs/zustand';\nimport { getPlateCorePlugins } from './getPlateCorePlugins';\n\nexport type PlateCorePlugin =\n | CorePlugin\n | typeof EventEditorPlugin\n | typeof SlateReactExtensionPlugin;\n\nexport type WithPlateOptions<\n V extends Value = Value,\n P extends AnyPluginConfig = PlateCorePlugin,\n> = BaseWithSlateOptions<P> &\n Pick<\n Partial<AnyPlatePlugin>,\n | 'api'\n | 'decorate'\n | 'extendEditor'\n | 'handlers'\n | 'inject'\n | 'normalizeInitialValue'\n | 'options'\n | 'override'\n | 'priority'\n | 'render'\n | 'shortcuts'\n | 'transforms'\n | 'useHooks'\n > & {\n // override?: {\n // /** Enable or disable plugins */\n // enabled?: Partial<Record<KeyofPlugins<InferPlugins<P[]>>, boolean>>;\n // plugins?: Partial<\n // Record<\n // KeyofPlugins<InferPlugins<P[]>>,\n // Partial<EditorPlatePlugin<AnyPluginConfig>>\n // >\n // >;\n // };\n value?: ((editor: PlateEditor) => Promise<V> | V) | V | string;\n rootPlugin?: (plugin: AnyPlatePlugin) => AnyPlatePlugin;\n onReady?: (ctx: {\n editor: PlateEditor;\n isAsync: boolean;\n value: V;\n }) => void;\n };\n\n/**\n * Applies Plate enhancements to an editor instance (React version).\n *\n * @remarks\n * This function supports React-specific features including component rendering,\n * event handlers, and React hooks integration.\n * @see {@link createPlateEditor} for a higher-level React editor creation function.\n * @see {@link usePlateEditor} for a memoized version in React components.\n * @see {@link withSlate} for the non-React version of editor enhancement.\n */\nexport const withPlate = <\n V extends Value = Value,\n P extends AnyPluginConfig = PlateCorePlugin,\n>(\n e: Editor,\n options: WithPlateOptions<V, P> = {}\n): TPlateEditor<V, InferPlugins<P[]>> => {\n const { optionsStoreFactory, plugins = [], ...rest } = options;\n\n const editor = withSlate<V, P>(e, {\n ...rest,\n optionsStoreFactory: optionsStoreFactory ?? createZustandStore,\n plugins: [...getPlateCorePlugins(), ...plugins],\n } as any) as unknown as TPlateEditor<V, InferPlugins<P[]>>;\n\n return editor;\n};\n\nexport type CreatePlateEditorOptions<\n V extends Value = Value,\n P extends AnyPluginConfig = PlateCorePlugin,\n> = WithPlateOptions<V, P> & {\n /**\n * Initial editor to be extended with `withPlate`.\n *\n * @default createEditor()\n */\n editor?: Editor;\n};\n\n/**\n * Creates a Plate editor (React version).\n *\n * This function creates a fully configured Plate editor instance with\n * React-specific enhancements including component rendering, event handlers,\n * and hooks integration. It applies all specified plugins and configurations to\n * create a functional editor.\n *\n * Examples:\n *\n * ```ts\n * const editor = createPlateEditor({\n * plugins: [ParagraphPlugin, HeadingPlugin],\n * value: [{ type: 'p', children: [{ text: 'Hello world!' }] }],\n * });\n *\n * // Editor with custom components\n * const editor = createPlateEditor({\n * plugins: [ParagraphPlugin.withComponent(ParagraphElement)],\n * components: { [CodePlugin.key]: CodeLeaf },\n * });\n *\n * // Editor with React-specific options\n * const editor = createPlateEditor({\n * plugins: [ParagraphPlugin],\n * handlers: { onKeyDown: customKeyHandler },\n * });\n * ```\n *\n * @see {@link createSlateEditor} for a non-React version of editor creation.\n * @see {@link usePlateEditor} for a memoized version in React components.\n * @see {@link withPlate} for the underlying function that applies Plate enhancements to an editor.\n */\nexport const createPlateEditor = <\n V extends Value = Value,\n P extends AnyPluginConfig = PlateCorePlugin,\n>({\n editor = createEditor(),\n ...options\n}: CreatePlateEditorOptions<V, P> = {}): TPlateEditor<V, InferPlugins<P[]>> =>\n withPlate<V, P>(editor, options);\n","import type { LegacyEditorMethods } from '@platejs/slate';\n\nimport {\n type CreatePlateEditorOptions,\n createPlateEditor,\n} from '../editor/withPlate';\n\nexport const createPlateFallbackEditor = (\n options: CreatePlateEditorOptions = {}\n) => {\n const editor = createPlateEditor(options);\n\n editor.meta.isFallback = true;\n\n (editor as typeof editor & LegacyEditorMethods).apply = () => {\n throw new Error(\n 'Cannot apply operations on the fallback editor. The fallback editor is used when a hook that depends on the Plate store was unable to locate a valid store. If you are using PlateController, use `useEditorMounted(id?: string)` or `!editor.meta.isFallback` to ensure that a valid Plate store is available before attempting to call operations on the editor.'\n );\n };\n\n return editor;\n};\n","import type { DOMHandlers } from '../plugin/DOMHandlers';\n\nexport const DOM_HANDLERS: (keyof DOMHandlers)[] = [\n // Clipboard Events\n 'onCopy',\n 'onCopyCapture',\n 'onCut',\n 'onCutCapture',\n 'onPaste',\n 'onPasteCapture',\n\n // Composition Events\n 'onCompositionEnd',\n 'onCompositionEndCapture',\n 'onCompositionStart',\n 'onCompositionStartCapture',\n 'onCompositionUpdate',\n 'onCompositionUpdateCapture',\n\n // Focus Events\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n\n // Form Events\n 'onDOMBeforeInput',\n 'onBeforeInput',\n 'onBeforeInputCapture',\n 'onInput',\n 'onInputCapture',\n 'onReset',\n 'onResetCapture',\n 'onSubmit',\n 'onSubmitCapture',\n 'onInvalid',\n 'onInvalidCapture',\n\n // Image Events\n 'onLoad',\n 'onLoadCapture',\n\n // Keyboard Events\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyPressCapture',\n 'onKeyUp',\n 'onKeyUpCapture',\n\n // Media Events\n 'onAbort',\n 'onAbortCapture',\n 'onCanPlay',\n 'onCanPlayCapture',\n 'onCanPlayThrough',\n 'onCanPlayThroughCapture',\n 'onDurationChange',\n 'onDurationChangeCapture',\n 'onEmptied',\n 'onEmptiedCapture',\n 'onEncrypted',\n 'onEncryptedCapture',\n 'onEnded',\n 'onEndedCapture',\n 'onLoadedData',\n 'onLoadedDataCapture',\n 'onLoadedMetadata',\n 'onLoadedMetadataCapture',\n 'onLoadStart',\n 'onLoadStartCapture',\n 'onPause',\n 'onPauseCapture',\n 'onPlay',\n 'onPlayCapture',\n 'onPlaying',\n 'onPlayingCapture',\n 'onProgress',\n 'onProgressCapture',\n 'onRateChange',\n 'onRateChangeCapture',\n 'onSeeked',\n 'onSeekedCapture',\n 'onSeeking',\n 'onSeekingCapture',\n 'onStalled',\n 'onStalledCapture',\n 'onSuspend',\n 'onSuspendCapture',\n 'onTimeUpdate',\n 'onTimeUpdateCapture',\n 'onVolumeChange',\n 'onVolumeChangeCapture',\n 'onWaiting',\n 'onWaitingCapture',\n\n // MouseEvents\n 'onAuxClick',\n 'onAuxClickCapture',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onContextMenuCapture',\n 'onDoubleClick',\n 'onDoubleClickCapture',\n 'onDrag',\n 'onDragCapture',\n 'onDragEnd',\n 'onDragEndCapture',\n 'onDragEnter',\n 'onDragEnterCapture',\n 'onDragExit',\n 'onDragExitCapture',\n 'onDragLeave',\n 'onDragLeaveCapture',\n 'onDragOver',\n 'onDragOverCapture',\n 'onDragStart',\n 'onDragStartCapture',\n 'onDrop',\n 'onDropCapture',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseMoveCapture',\n 'onMouseOut',\n 'onMouseOutCapture',\n 'onMouseOver',\n 'onMouseOverCapture',\n 'onMouseUp',\n 'onMouseUpCapture',\n\n // Selection Events\n 'onSelect',\n 'onSelectCapture',\n\n // Touch Events\n 'onTouchCancel',\n 'onTouchCancelCapture',\n 'onTouchEnd',\n 'onTouchEndCapture',\n 'onTouchMove',\n 'onTouchMoveCapture',\n 'onTouchStart',\n 'onTouchStartCapture',\n\n // Pointer Events\n 'onPointerDown',\n 'onPointerDownCapture',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerUpCapture',\n 'onPointerCancel',\n 'onPointerCancelCapture',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOverCapture',\n 'onPointerOut',\n 'onPointerOutCapture',\n 'onGotPointerCapture',\n 'onGotPointerCaptureCapture',\n 'onLostPointerCapture',\n 'onLostPointerCaptureCapture',\n\n // UI Events\n 'onScroll',\n 'onScrollCapture',\n\n // Wheel Events\n 'onWheel',\n 'onWheelCapture',\n\n // Animation Events\n 'onAnimationStart',\n 'onAnimationStartCapture',\n 'onAnimationEnd',\n 'onAnimationEndCapture',\n 'onAnimationIteration',\n 'onAnimationIterationCapture',\n\n // Transition Events\n 'onTransitionEnd',\n 'onTransitionEndCapture',\n];\n","import type { AnyObject } from '@udecode/utils';\n\nimport { clsx } from 'clsx';\n\nimport type { PlateHTMLProps } from '../components';\nimport type { PlateEditor } from '../editor';\nimport type { AnyEditorPlatePlugin } from '../plugin/PlatePlugin';\n\nimport { pipeInjectNodeProps } from '../../internal/plugin/pipeInjectNodeProps';\nimport { getSlateClass } from '../../lib';\nimport { getPluginNodeProps } from '../../lib/utils/getPluginNodeProps';\nimport { getEditorPlugin } from '../plugin';\n\n/**\n * Override node props with plugin props. Allowed properties in\n * `props.element.attributes` are passed into `props.attributes`. Extend the\n * class name with the node type.\n */\nexport const getRenderNodeProps = ({\n attributes: nodeAttributes,\n disableInjectNodeProps,\n editor,\n plugin,\n props,\n readOnly,\n}: {\n editor: PlateEditor;\n props: PlateHTMLProps;\n attributes?: AnyObject;\n disableInjectNodeProps?: boolean;\n plugin?: AnyEditorPlatePlugin;\n readOnly?: boolean;\n}): PlateHTMLProps => {\n let newProps = {\n ...props,\n ...(plugin\n ? (getEditorPlugin(editor, plugin) as any)\n : {\n api: editor.api,\n editor,\n tf: editor.transforms,\n }),\n };\n\n const { className } = props;\n\n const pluginProps = getPluginNodeProps({\n attributes: nodeAttributes,\n plugin: plugin as any,\n props: newProps as any,\n });\n\n newProps = {\n ...pluginProps,\n attributes: {\n ...pluginProps.attributes,\n className:\n clsx(\n getSlateClass(plugin?.node.type),\n pluginProps.attributes?.className,\n className\n ) || undefined,\n },\n };\n\n if (!disableInjectNodeProps) {\n newProps = pipeInjectNodeProps(\n editor,\n newProps,\n (node) => editor.api.findPath(node)!,\n readOnly\n ) as PlateHTMLProps;\n }\n\n if (\n newProps.attributes?.style &&\n Object.keys(newProps.attributes.style).length === 0\n ) {\n newProps.attributes.style = undefined;\n }\n\n return newProps;\n};\n","import type React from 'react';\n\nimport type { EditableProps } from '../../lib';\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { DOMHandlers } from '../plugin/DOMHandlers';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { getEditorPlugin } from '../plugin/getEditorPlugin';\n\nexport const convertDomEventToSyntheticEvent = (\n domEvent: Event\n): React.SyntheticEvent<unknown, unknown> => {\n let propagationStopped = false;\n\n return {\n ...domEvent,\n bubbles: domEvent.bubbles,\n cancelable: domEvent.cancelable,\n currentTarget: domEvent.currentTarget!,\n defaultPrevented: domEvent.defaultPrevented,\n eventPhase: domEvent.eventPhase,\n isTrusted: domEvent.isTrusted,\n nativeEvent: domEvent,\n target: domEvent.target!,\n timeStamp: domEvent.timeStamp,\n type: domEvent.type,\n isDefaultPrevented: () => domEvent.defaultPrevented,\n isPropagationStopped: () => propagationStopped,\n persist: () => {\n throw new Error(\n 'persist is not implemented for synthetic events created using convertDomEventToSyntheticEvent'\n );\n },\n preventDefault: () => domEvent.preventDefault(),\n stopPropagation: () => {\n propagationStopped = true;\n domEvent.stopPropagation();\n },\n };\n};\n\n/** Check if an event is overrided by a handler. */\nexport const isEventHandled = <\n EventType extends React.SyntheticEvent<unknown, unknown>,\n>(\n event: EventType,\n handler?: (event: EventType) => boolean | void\n) => {\n if (!handler) {\n return false;\n }\n\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler(event);\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled;\n }\n\n return event.isPropagationStopped();\n};\n\n/**\n * Generic pipe for handlers.\n *\n * - Get all the plugins handlers by `handlerKey`.\n * - If there is no plugin handler or editable prop handler for this key, return\n * `undefined`.\n * - Return a handler calling all the plugins handlers then the prop handler.\n * - Any handler returning true will stop the next handlers to be called,\n * including slate internal handler.\n */\nexport const pipeHandler = <K extends keyof DOMHandlers>(\n editor: PlateEditor,\n {\n editableProps,\n handlerKey,\n }: { handlerKey: K; editableProps?: Omit<EditableProps, 'decorate'> | null }\n): ((event: any) => void) | undefined => {\n const propsHandler = editableProps?.[handlerKey] as (\n event: any\n ) => boolean | void;\n\n const relevantPlugins = editor.meta.pluginList.filter(\n (plugin) => plugin.handlers?.[handlerKey]\n );\n\n if (relevantPlugins.length === 0 && !propsHandler) return;\n\n return (event: any) => {\n const isDomEvent = event instanceof Event;\n const handledEvent = isDomEvent\n ? convertDomEventToSyntheticEvent(event)\n : event;\n\n const eventIsHandled = relevantPlugins.some((plugin) => {\n if (isEditOnly(editor.dom.readOnly, plugin, 'handlers')) {\n return false;\n }\n\n const pluginHandler = plugin.handlers[handlerKey]!;\n\n const shouldTreatEventAsHandled = pluginHandler({\n ...(getEditorPlugin(editor, plugin) as any),\n event: handledEvent,\n });\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled;\n }\n\n return false;\n });\n\n if (eventIsHandled) return true;\n\n return isEventHandled(handledEvent, propsHandler);\n };\n};\n","import type { Value } from '@platejs/slate';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { getPlugin } from '../plugin';\nimport { getEditorPlugin } from '../plugin/getEditorPlugin';\n\nexport const pipeOnChange = (editor: PlateEditor, value: Value) => {\n return editor.meta.pluginCache.handlers.onChange.some((key) => {\n const plugin = getPlugin(editor, { key });\n\n if (isEditOnly(editor.dom.readOnly, plugin, 'handlers')) {\n return false;\n }\n\n const handler = plugin.handlers.onChange!;\n\n // The custom event handler may return a boolean to specify whether the event\n // shall be treated as being handled or not.\n const shouldTreatEventAsHandled = handler({\n ...(getEditorPlugin(editor, plugin) as any),\n value,\n });\n\n if (shouldTreatEventAsHandled != null) {\n return shouldTreatEventAsHandled;\n }\n\n return false;\n });\n};\n","import React from 'react';\n\nimport type { Path, TElement, TText } from '@platejs/slate';\nimport type { UnknownObject } from '@udecode/utils';\n\nimport { useComposedRef } from '@udecode/react-utils';\nimport { clsx } from 'clsx';\n\nimport type {\n AnyPluginConfig,\n PluginConfig,\n RenderChunkProps,\n RenderElementProps,\n RenderLeafProps,\n RenderTextProps,\n} from '../../lib';\nimport type { PlatePluginContext } from '../plugin';\n\nimport { useEditorMounted } from '../stores';\n\nexport const useNodeAttributes = (props: any, ref?: any) => ({\n ...props.attributes,\n className:\n clsx((props.attributes as any).className, props.className) || undefined,\n ref: useComposedRef(ref, props.attributes.ref),\n style: { ...(props.attributes as any).style, ...props.style },\n});\n\nexport type PlateChunkProps = RenderChunkProps;\n\nexport type PlateElementProps<\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n> = PlateNodeProps<C> &\n RenderElementProps<N> & {\n attributes: UnknownObject;\n path: Path;\n } & DeprecatedNodeProps;\n\ntype DeprecatedNodeProps = {\n /**\n * @deprecated Optional class to be merged with `attributes.className`.\n * @default undefined\n */\n className?: string;\n /**\n * @deprecated Optional style to be merged with `attributes.style`\n * @default undefined\n */\n style?: React.CSSProperties;\n};\n\nexport type PlateNodeProps<C extends AnyPluginConfig = PluginConfig> =\n PlatePluginContext<C> & {\n /**\n * Optional ref to be merged with `attributes.ref`\n *\n * @default undefined\n */\n ref?: any;\n };\n\nexport type PlateHTMLProps<\n C extends AnyPluginConfig = PluginConfig,\n T extends\n | React.ComponentType<PlateElementProps>\n | keyof HTMLElementTagNameMap = 'div',\n> = PlateNodeProps<C> & {\n /** HTML attributes to pass to the underlying HTML element */\n attributes: React.PropsWithoutRef<\n T extends React.ComponentType<PlateElementProps>\n ? React.ComponentProps<T>\n : T extends keyof HTMLElementTagNameMap\n ? React.JSX.IntrinsicElements[T]\n : never\n >;\n as?: T;\n /** Class to be merged with `attributes.className` */\n className?: string;\n /** Style to be merged with `attributes.style` */\n style?: React.CSSProperties;\n};\n\nexport type StyledPlateElementProps<\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'div',\n> = Omit<PlateElementProps<N, C>, keyof DeprecatedNodeProps> &\n PlateHTMLProps<C, T> & {\n insetProp?: boolean;\n };\n\nexport const PlateElement = React.forwardRef(function PlateElement(\n { as: Tag = 'div', children, insetProp, ...props }: StyledPlateElementProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const attributes = useNodeAttributes(props, ref);\n\n const mounted = useEditorMounted();\n const block = React.useMemo(\n () =>\n mounted &&\n !!props.element.id &&\n !!props.editor.api.isBlock(props.element),\n [props.element, props.editor, mounted]\n );\n\n const inset =\n insetProp ?? props.plugin?.rules.selection?.affinity === 'directional';\n\n return (\n <>\n {inset && <NonBreakingSpace />}\n <Tag\n data-slate-node=\"element\"\n data-slate-inline={attributes['data-slate-inline']}\n data-block-id={block ? props.element.id : undefined}\n {...attributes}\n style={\n {\n position: 'relative',\n ...attributes?.style,\n } as React.CSSProperties\n }\n >\n {children}\n {inset && <NonBreakingSpace />}\n </Tag>\n </>\n );\n}) as <\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'div',\n>(\n props: StyledPlateElementProps<N, C, T>\n) => React.ReactElement;\n\nexport type PlateTextProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n> = PlateNodeProps<C> &\n RenderTextProps<N> &\n DeprecatedNodeProps & {\n attributes: UnknownObject;\n };\n\nexport type StyledPlateTextProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n> = Omit<PlateTextProps<N, C>, keyof DeprecatedNodeProps> &\n PlateHTMLProps<C, T>;\n\nexport const PlateText = React.forwardRef<\n HTMLSpanElement,\n StyledPlateTextProps\n>(({ as: Tag = 'span', children, ...props }, ref) => {\n const attributes = useNodeAttributes(props, ref);\n\n return <Tag {...attributes}>{children}</Tag>;\n}) as <\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n>(\n props: StyledPlateTextProps<N, C, T>\n) => React.ReactElement;\n\nexport type PlateLeafProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n> = PlateNodeProps<C> &\n RenderLeafProps<N> &\n DeprecatedNodeProps & { attributes: UnknownObject; inset?: boolean };\n\nexport type StyledPlateLeafProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n> = Omit<PlateLeafProps<N, C>, keyof DeprecatedNodeProps> &\n PlateHTMLProps<C, T>;\n\nconst NonBreakingSpace = () => (\n <span style={{ fontSize: 0, lineHeight: 0 }} contentEditable={false}>\n {String.fromCodePoint(160)}\n </span>\n);\n\nexport const PlateLeaf = React.forwardRef<\n HTMLSpanElement,\n StyledPlateLeafProps\n>(({ as: Tag = 'span', children, inset: insetProp, ...props }, ref) => {\n const attributes = useNodeAttributes(props, ref);\n\n const inset = insetProp ?? props.plugin?.rules.selection?.affinity === 'hard';\n\n if (inset) {\n return (\n <>\n <NonBreakingSpace />\n <Tag {...attributes}>\n {children}\n\n <NonBreakingSpace />\n </Tag>\n </>\n );\n }\n\n return <Tag {...attributes}>{children}</Tag>;\n}) as <\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n>({\n className,\n ...props\n}: StyledPlateLeafProps<N, C, T>) => React.ReactElement;\n","import React from 'react';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { AnyEditorPlatePlugin } from '../plugin/PlatePlugin';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { type PlateLeafProps, PlateLeaf } from '../components/plate-nodes';\nimport { useReadOnly } from '../slate-react';\nimport { getRenderNodeProps } from './getRenderNodeProps';\n\nexport type RenderLeaf = (props: PlateLeafProps) => React.ReactElement<any>;\n\n/**\n * Get a `Editable.renderLeaf` handler for `plugin.node.type`. If the type is\n * equals to the slate leaf type, render `plugin.render.node`. Else, return\n * `children`.\n */\nexport const pluginRenderLeaf = (\n editor: PlateEditor,\n plugin: AnyEditorPlatePlugin\n): RenderLeaf =>\n function render(props) {\n const {\n render: { leaf: leafComponent, node },\n } = plugin;\n const { children, leaf } = props;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const readOnly = useReadOnly();\n\n if (isEditOnly(readOnly, plugin, 'render')) return children;\n\n if (leaf[plugin.node.type]) {\n const Component = leafComponent ?? node;\n const Leaf = Component ?? PlateLeaf;\n\n const ctxProps = getRenderNodeProps({\n attributes: leaf.attributes as any,\n editor,\n plugin,\n props: props as any,\n readOnly,\n }) as any;\n\n const defaultProps = Component ? {} : { as: plugin.render?.as };\n\n return (\n <Leaf {...defaultProps} {...ctxProps}>\n {children}\n </Leaf>\n );\n }\n\n return children;\n };\n","import React from 'react';\n\nimport clsx from 'clsx';\n\nimport type { EditableProps } from '../../lib';\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { AnyEditorPlatePlugin } from '../plugin';\n\nimport { PlateLeaf } from '../components';\nimport { useReadOnly } from '../slate-react';\nimport { getRenderNodeProps } from './getRenderNodeProps';\nimport { type RenderLeaf, pluginRenderLeaf } from './pluginRenderLeaf';\n\n/** @see {@link RenderLeaf} */\nexport const pipeRenderLeaf = (\n editor: PlateEditor,\n renderLeafProp?: EditableProps['renderLeaf']\n): EditableProps['renderLeaf'] => {\n const renderLeafs: RenderLeaf[] = [];\n const leafPropsPlugins: AnyEditorPlatePlugin[] = [];\n\n editor.meta.pluginCache.node.isLeaf.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n\n if (plugin) {\n renderLeafs.push(pluginRenderLeaf(editor, plugin as any));\n }\n });\n\n editor.meta.pluginCache.node.leafProps.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (plugin) {\n leafPropsPlugins.push(plugin as any);\n }\n });\n\n return function render({ attributes, ...props }) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const readOnly = useReadOnly();\n\n renderLeafs.forEach((renderLeaf) => {\n const newChildren = renderLeaf(props as any);\n\n if (newChildren !== undefined) {\n props.children = newChildren;\n }\n });\n\n leafPropsPlugins.forEach((plugin) => {\n if (props.leaf[plugin.node.type]) {\n const pluginLeafProps =\n typeof plugin.node.leafProps === 'function'\n ? plugin.node.leafProps(props as any)\n : (plugin.node.leafProps ?? {});\n\n if (pluginLeafProps.className) {\n pluginLeafProps.className = clsx(\n (props as any).className,\n pluginLeafProps.className\n );\n }\n\n attributes = {\n ...attributes,\n ...pluginLeafProps,\n };\n }\n });\n\n if (renderLeafProp) {\n return renderLeafProp({ attributes, ...props } as any);\n }\n\n const ctxProps = getRenderNodeProps({\n editor,\n props: { attributes, ...props } as any,\n readOnly,\n }) as any;\n\n return <PlateLeaf {...ctxProps}>{props.children}</PlateLeaf>;\n };\n};\n","import React from 'react';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { AnyEditorPlatePlugin } from '../plugin/PlatePlugin';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { type PlateTextProps, PlateText } from '../components/plate-nodes';\nimport { useReadOnly } from '../slate-react';\nimport { getRenderNodeProps } from './getRenderNodeProps';\n\nexport type RenderText = (props: PlateTextProps) => React.ReactElement<any>;\n\n/**\n * Get a `Editable.renderText` handler for `plugin.node.type`. If the type is\n * equals to the slate text type and isDecoration is false, render\n * `plugin.render.node`. Else, return the default text rendering.\n */\nexport const pluginRenderText = (\n editor: PlateEditor,\n plugin: AnyEditorPlatePlugin\n): RenderText =>\n function render(nodeProps) {\n const {\n render: { node },\n } = plugin;\n const { children, text } = nodeProps;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const readOnly = useReadOnly();\n\n if (isEditOnly(readOnly, plugin, 'render')) return children;\n\n if (text[plugin.node.type ?? plugin.key]) {\n const Text = node ?? PlateText;\n\n const ctxProps = getRenderNodeProps({\n attributes: nodeProps.attributes,\n editor,\n plugin,\n props: nodeProps as any,\n readOnly,\n }) as any;\n\n const defaultProps = node ? {} : { as: plugin.render?.as };\n\n return (\n <Text {...defaultProps} {...ctxProps}>\n {children}\n </Text>\n );\n }\n\n return children;\n };\n","import React from 'react';\n\nimport clsx from 'clsx';\n\nimport type { EditableProps } from '../../lib';\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { AnyEditorPlatePlugin } from '../plugin';\n\nimport { PlateText } from '../components/plate-nodes';\nimport { useReadOnly } from '../slate-react';\nimport { getRenderNodeProps } from './getRenderNodeProps';\nimport { type RenderText, pluginRenderText } from './pluginRenderText';\n\n/** @see {@link RenderText} */\nexport const pipeRenderText = (\n editor: PlateEditor,\n renderTextProp?: EditableProps['renderText']\n): EditableProps['renderText'] => {\n const renderTexts: RenderText[] = [];\n const textPropsPlugins: AnyEditorPlatePlugin[] = [];\n\n editor.meta.pluginList.forEach((plugin) => {\n if (plugin.node.isLeaf && plugin.node.isDecoration === false) {\n renderTexts.push(pluginRenderText(editor, plugin));\n }\n\n if (plugin.node.textProps) {\n textPropsPlugins.push(plugin);\n }\n });\n\n return function render({ attributes, ...props }) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const readOnly = useReadOnly();\n\n renderTexts.forEach((renderText) => {\n const newChildren = renderText(props as any);\n\n if (newChildren !== undefined) {\n props.children = newChildren;\n }\n });\n\n textPropsPlugins.forEach((plugin) => {\n if (props.text[plugin.node.type ?? plugin.key]) {\n const pluginTextProps =\n typeof plugin.node.textProps === 'function'\n ? plugin.node.textProps(props as any)\n : (plugin.node.textProps ?? {});\n\n if (pluginTextProps.className) {\n pluginTextProps.className = clsx(\n (props as any).className,\n pluginTextProps.className\n );\n }\n\n attributes = {\n ...attributes,\n ...pluginTextProps,\n };\n }\n });\n\n if (renderTextProp) {\n return renderTextProp({ attributes, ...props } as any);\n }\n\n const ctxProps = getRenderNodeProps({\n editor,\n props: { attributes, ...props } as any,\n readOnly,\n }) as any;\n\n return <PlateText {...ctxProps}>{props.children}</PlateText>;\n };\n};\n","import React from 'react';\n\nimport clsx from 'clsx';\nimport { useAtomStoreValue } from 'jotai-x';\nimport omit from 'lodash/omit.js';\nimport { useDeepCompareMemo } from 'use-deep-compare';\n\nimport type { PlateProps } from '../components';\n\nimport { type EditableProps, ChunkingPlugin } from '../../lib';\nimport { pipeDecorate } from '../../static/utils/pipeDecorate';\nimport { ContentVisibilityChunk } from '../components';\nimport { useEditorRef, usePlateStore, usePluginOption } from '../stores';\nimport { DOM_HANDLERS } from '../utils/dom-attributes';\nimport { pipeHandler } from '../utils/pipeHandler';\nimport { pipeRenderElement } from '../utils/pipeRenderElement';\nimport { pipeRenderLeaf } from '../utils/pipeRenderLeaf';\nimport { pipeRenderText } from '../utils/pipeRenderText';\n\nexport const useEditableProps = ({\n disabled,\n readOnly,\n ...editableProps\n}: Omit<EditableProps, 'decorate'> &\n Pick<PlateProps, 'decorate'> = {}): EditableProps => {\n const { id } = editableProps;\n\n const editor = useEditorRef(id);\n const store = usePlateStore(id);\n const versionDecorate = useAtomStoreValue(store, 'versionDecorate');\n const storeDecorate = useAtomStoreValue(store, 'decorate');\n const storeRenderChunk = useAtomStoreValue(store, 'renderChunk');\n const storeRenderElement = useAtomStoreValue(store, 'renderElement');\n const storeRenderLeaf = useAtomStoreValue(store, 'renderLeaf');\n const storeRenderText = useAtomStoreValue(store, 'renderText');\n\n const decorateMemo = React.useMemo(\n () =>\n pipeDecorate(editor, storeDecorate ?? (editableProps?.decorate as any)),\n [editableProps?.decorate, editor, storeDecorate]\n );\n\n const decorate: typeof decorateMemo = React.useMemo(() => {\n if (!versionDecorate || !decorateMemo) return;\n\n return (entry) => decorateMemo(entry);\n }, [decorateMemo, versionDecorate]);\n\n const defaultRenderChunk = usePluginOption(\n ChunkingPlugin,\n 'contentVisibilityAuto'\n )\n ? ContentVisibilityChunk\n : undefined;\n\n const renderChunk =\n storeRenderChunk ?? editableProps?.renderChunk ?? defaultRenderChunk;\n\n const renderElement = React.useMemo(\n () =>\n pipeRenderElement(\n editor,\n storeRenderElement ?? editableProps?.renderElement\n ),\n [editableProps?.renderElement, editor, storeRenderElement]\n );\n\n const renderLeaf = React.useMemo(\n () => pipeRenderLeaf(editor, storeRenderLeaf ?? editableProps?.renderLeaf),\n [editableProps?.renderLeaf, editor, storeRenderLeaf]\n );\n\n const renderText = React.useMemo(\n () => pipeRenderText(editor, storeRenderText ?? editableProps?.renderText),\n [editableProps?.renderText, editor, storeRenderText]\n );\n\n const props: EditableProps = useDeepCompareMemo(() => {\n const _props: EditableProps = {\n decorate,\n renderChunk,\n renderElement,\n renderLeaf,\n renderText,\n };\n\n DOM_HANDLERS.forEach((handlerKey) => {\n const handler = pipeHandler(editor, { editableProps, handlerKey }) as any;\n\n if (handler) {\n _props[handlerKey] = handler;\n }\n });\n\n return _props;\n }, [\n decorate,\n editableProps,\n renderChunk,\n renderElement,\n renderLeaf,\n renderText,\n ]);\n\n return useDeepCompareMemo(\n () => ({\n ...omit(editableProps, [\n ...DOM_HANDLERS,\n 'renderChunk',\n 'renderElement',\n 'renderLeaf',\n 'renderText',\n 'decorate',\n ]),\n ...props,\n 'aria-disabled': disabled,\n className: clsx(\n 'slate-editor',\n 'ignore-click-outside/toolbar',\n editableProps.className\n ),\n 'data-readonly': readOnly ? 'true' : undefined,\n readOnly,\n }),\n [editableProps, props, readOnly]\n );\n};\n","import { type TNode, PathApi } from '@platejs/slate';\nimport { useMemoizedSelector } from '@udecode/react-utils';\n\nimport { useEditorRef } from '../stores';\n\n/**\n * Returns the path of a node every time the node changes. Note, however, that\n * if another node is updated in a way that affects this node's path, this hook\n * will not return the new path.\n */\nexport const useNodePath = (node: TNode) => {\n const editor = useEditorRef();\n\n return useMemoizedSelector(\n () => editor.api.findPath(node),\n [editor, node],\n (a, b) => !!a && !!b && PathApi.equals(a, b)\n );\n};\n","import React from 'react';\n\nimport type { Value } from '@platejs/slate';\n\nimport { useAtomStoreValue } from 'jotai-x';\n\nimport { useEditorRef, useIncrementVersion, usePlateStore } from '../stores';\nimport { pipeOnChange } from '../utils/pipeOnChange';\n\ntype SlateComponentProps = Omit<\n React.ComponentProps<typeof import('../slate-react').Slate>,\n 'children'\n>;\n\ninterface PlateSlateProps extends SlateComponentProps {\n key: React.Key;\n}\n\n/** Get Slate props stored in a global store. */\nexport const useSlateProps = ({ id }: { id?: string }): PlateSlateProps => {\n const editor = useEditorRef(id);\n const store = usePlateStore(id);\n const onChangeProp = useAtomStoreValue(store, 'onChange');\n const onValueChangeProp = useAtomStoreValue(store, 'onValueChange');\n const onSelectionChangeProp = useAtomStoreValue(store, 'onSelectionChange');\n const updateVersionEditor = useIncrementVersion('versionEditor', id);\n const updateVersionSelection = useIncrementVersion('versionSelection', id);\n const updateVersionValue = useIncrementVersion('versionValue', id);\n\n const onChange = React.useCallback(\n (newValue: SlateComponentProps['initialValue']) => {\n updateVersionEditor();\n const eventIsHandled = pipeOnChange(editor, newValue as Value);\n\n if (!eventIsHandled) {\n onChangeProp?.({ editor, value: newValue as Value });\n }\n },\n [editor, onChangeProp, updateVersionEditor]\n );\n\n const onValueChange: SlateComponentProps['onValueChange'] = React.useMemo(\n () => (value) => {\n updateVersionValue();\n onValueChangeProp?.({ editor, value: value as Value });\n },\n [editor, onValueChangeProp, updateVersionValue]\n );\n\n const onSelectionChange: SlateComponentProps['onSelectionChange'] =\n React.useMemo(\n () => (selection) => {\n updateVersionSelection();\n onSelectionChangeProp?.({ editor, selection });\n },\n [editor, onSelectionChangeProp, updateVersionSelection]\n );\n\n return React.useMemo(\n () => ({\n key: editor.meta.key,\n editor: editor as unknown as SlateComponentProps['editor'],\n initialValue: editor.children as SlateComponentProps['initialValue'],\n onChange,\n onSelectionChange,\n onValueChange,\n }),\n [editor, onChange, onSelectionChange, onValueChange]\n );\n};\n","import type { Path } from '@platejs/slate';\n\nimport { useAtomStoreValue } from 'jotai-x';\n\nimport { useEditorRef } from '../plate';\nimport { useElementStore } from './useElementStore';\n\n/** Get the memoized path of the closest element. */\nexport const usePath = (pluginKey?: string): Path => {\n const editor = useEditorRef();\n const value = useAtomStoreValue(useElementStore(pluginKey), 'path');\n\n if (!value) {\n editor.api.debug.warn(\n `usePath(${pluginKey}) hook must be used inside the node component's context`,\n 'USE_ELEMENT_CONTEXT'\n );\n\n return undefined as any;\n }\n\n return value;\n};\n","import React from 'react';\n\nimport type { Nullable } from '@udecode/utils';\n\nimport {\n type ElementEntry,\n type Path,\n type TElement,\n PathApi,\n} from '@platejs/slate';\n\nimport { createAtomStore } from '../../libs/jotai';\nimport { useComposing, useReadOnly } from '../../slate-react';\nimport { useEditorRef, usePlateStore } from '../plate';\nimport { usePath } from './usePath';\n\nexport const SCOPE_ELEMENT = 'element';\n\nexport type ElementStoreState = {\n element: TElement;\n entry: ElementEntry;\n path: Path;\n};\n\nconst initialState: Nullable<ElementStoreState> = {\n element: null,\n entry: null,\n path: null,\n};\n\nexport const { ElementProvider, elementStore, useElementStore } =\n createAtomStore(\n initialState as ElementStoreState,\n { effect: Effect, name: 'element', suppressWarnings: true } as const\n );\n\nfunction Effect() {\n const path = usePath();\n\n if (path && PathApi.equals(path, [0])) {\n return <FirstBlockEffect />;\n }\n\n return null;\n}\n\nfunction FirstBlockEffect() {\n const editor = useEditorRef();\n const store = usePlateStore();\n const composing = useComposing();\n const readOnly = useReadOnly();\n\n editor.dom.readOnly = readOnly;\n editor.dom.composing = composing;\n\n React.useLayoutEffect(() => {\n store.set('composing', composing);\n }, [composing, store]);\n\n return null;\n}\n","import React from 'react';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\nimport type { AnyEditorPlatePlugin } from '../plugin/PlatePlugin';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { type PlateElementProps, PlateElement } from '../components';\nimport { useReadOnly } from '../slate-react';\nimport { useEditorRef, useElement } from '../stores';\nimport { ElementProvider } from '../stores/element/useElementStore';\nimport { getRenderNodeProps } from './getRenderNodeProps';\n\n/**\n * Function used to render an element. If the function returns undefined then\n * the next RenderElement function is called. If the function renders a JSX\n * element then that JSX element is rendered.\n */\nexport type RenderElement = (\n props: PlateElementProps\n) => React.ReactElement<any> | undefined;\n\nfunction ElementContent({ editor, plugin, ...props }: PlateElementProps) {\n const element = useElement();\n const readOnly = useReadOnly();\n\n if (isEditOnly(readOnly, plugin, 'render')) return null;\n\n const { children: _children } = props;\n const Component = plugin.render?.node;\n const Element = Component ?? (PlateElement as any);\n\n props = getRenderNodeProps({\n attributes: element.attributes as any,\n editor,\n plugin,\n props: props as any,\n readOnly,\n }) as any;\n\n let children = _children;\n\n editor.meta.pluginCache.render.belowNodes.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n const withHOC = plugin.render.belowNodes!;\n\n // belowNodes can have hooks\n const hoc = withHOC({ ...props, key } as any);\n\n if (hoc && !isEditOnly(readOnly, plugin, 'render')) {\n children = hoc({ ...props, children } as any);\n }\n });\n\n const defaultProps = Component ? {} : { as: plugin.render?.as };\n\n let component: React.ReactNode = (\n <Element {...defaultProps} {...props}>\n {children}\n\n <BelowRootNodes {...defaultProps} {...props} />\n </Element>\n );\n\n editor.meta.pluginCache.render.aboveNodes.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n const withHOC = plugin.render.aboveNodes!;\n\n // aboveNodes can have hooks\n const hoc = withHOC({ ...props, key } as any);\n\n if (hoc && !isEditOnly(readOnly, plugin, 'render')) {\n component = hoc({ ...props, children: component } as any);\n }\n });\n\n return component;\n}\n\nexport function BelowRootNodes(props: any) {\n const editor = useEditorRef();\n const readOnly = useReadOnly();\n\n return (\n <>\n {editor.meta.pluginCache.render.belowRootNodes.map((key) => {\n const plugin = editor.getPlugin({ key });\n\n if (isEditOnly(readOnly, plugin, 'render')) return null;\n\n const Component = plugin.render.belowRootNodes!;\n\n return <Component key={key} {...props} />;\n })}\n </>\n );\n}\n\n/**\n * Get a `Editable.renderElement` handler for `plugin.node.type`. If the type is\n * equals to the slate element type, render `plugin.render.node`. Else, return\n * `undefined` so the pipeline can check the next plugin.\n */\nexport const pluginRenderElement = (\n editor: PlateEditor,\n plugin: AnyEditorPlatePlugin\n): RenderElement =>\n function render(props) {\n const { element, path } = props;\n\n return (\n <ElementProvider\n element={element}\n entry={[element, path]}\n path={path}\n scope={plugin.key}\n >\n <ElementContent editor={editor} plugin={plugin} {...(props as any)} />\n </ElementProvider>\n );\n };\n","/* eslint-disable react-hooks/rules-of-hooks */\nimport React from 'react';\n\nimport type { PlateEditor } from '../editor/PlateEditor';\n\nimport { type EditableProps, getPluginByType } from '../../lib';\nimport { PlateElement } from '../components';\nimport { useNodePath } from '../hooks';\nimport { useReadOnly } from '../slate-react';\nimport { ElementProvider } from '../stores';\nimport { getRenderNodeProps } from './getRenderNodeProps';\nimport { BelowRootNodes, pluginRenderElement } from './pluginRenderElement';\n\n/** @see {@link RenderElement} */\nexport const pipeRenderElement = (\n editor: PlateEditor,\n renderElementProp?: EditableProps['renderElement']\n): EditableProps['renderElement'] => {\n return function render(props) {\n const readOnly = useReadOnly();\n\n const path = useNodePath(props.element)!;\n\n const plugin = getPluginByType(editor, props.element.type);\n\n // We could deprecate isElement (unneeded check)\n if (plugin?.node.isElement) {\n return pluginRenderElement(\n editor,\n plugin as any\n )({\n ...props,\n path,\n } as any) as any;\n }\n\n if (renderElementProp) {\n return renderElementProp({ ...props, path } as any);\n }\n\n const ctxProps = getRenderNodeProps({\n // `transformProps` can run hooks, so we need to disable it for default elements.\n disableInjectNodeProps: true,\n editor,\n props: { ...props, path } as any,\n readOnly,\n }) as any;\n\n return (\n <ElementProvider\n element={ctxProps.element}\n entry={[ctxProps.element, path]}\n path={path}\n scope={ctxProps.element.type ?? 'default'}\n >\n <PlateElement {...ctxProps}>\n {props.children}\n\n <BelowRootNodes {...ctxProps} />\n </PlateElement>\n </ElementProvider>\n );\n };\n};\n","import React from 'react';\n\nimport type { JotaiStore } from 'jotai-x';\n\nimport { type Atom, atom } from 'jotai';\n\nimport { createAtomStore, useStoreAtomValue } from '../../libs';\n\nconst {\n PlateControllerProvider: PlateController,\n plateControllerStore,\n usePlateControllerStore: _usePlateControllerStore,\n} = createAtomStore(\n {\n activeId: atom<string | null>(null),\n editorStores: atom<Record<string, JotaiStore | null>>({}),\n primaryEditorIds: atom<string[]>([]),\n },\n {\n name: 'plateController',\n }\n);\n\nexport { PlateController, plateControllerStore };\n\nexport const usePlateControllerLocalStore: typeof _usePlateControllerStore = (\n options\n) =>\n _usePlateControllerStore({\n scope: typeof options === 'string' ? options : undefined,\n warnIfNoStore: false,\n ...(typeof options === 'object' ? options : {}),\n });\n\n// export const usePlateControllerStore = (options?: UsePlateControllerStoreOptions) =>\n// _usePlateControllerStore(options);\n\nexport const usePlateControllerExists = () =>\n !!usePlateControllerLocalStore().store;\n\n/**\n * Retrieve from PlateController the JotaiStore for the editor with a given ID,\n * or the active editor if no ID is provided, or the first primary editor if no\n * editor is active, or null.\n */\nexport const usePlateControllerStore = (idProp?: string): JotaiStore | null => {\n const storeAtom: Atom<JotaiStore | null> = React.useMemo(\n () =>\n atom((get) => {\n const editorStores = get(plateControllerStore.atom.editorStores);\n\n const forId = (id: string | null): JotaiStore | null => {\n if (!id) return null;\n\n return editorStores[id] ?? null;\n };\n\n if (idProp) return forId(idProp);\n\n const lookupOrder = [\n get(plateControllerStore.atom.activeId),\n ...get(plateControllerStore.atom.primaryEditorIds),\n ];\n\n for (const id of lookupOrder) {\n const store = forId(id);\n\n if (store) return store;\n }\n\n return null;\n }),\n [idProp]\n );\n\n return useStoreAtomValue(usePlateControllerLocalStore(), storeAtom);\n};\n","import React from 'react';\n\nimport { atom } from 'jotai';\nimport { useAtomStoreSet, useAtomStoreState, useAtomStoreValue } from 'jotai-x';\n\nimport type { PlateEditor } from '../../editor/PlateEditor';\nimport type { PlateChangeKey, PlateStoreState } from './PlateStore';\n\nimport { createAtomStore } from '../../libs';\nimport { createPlateFallbackEditor } from '../../utils';\nimport {\n usePlateControllerExists,\n usePlateControllerStore,\n} from '../plate-controller';\n\nexport type PlateStore = ReturnType<typeof usePlateStore>;\n\nexport const PLATE_SCOPE = 'plate';\n\nexport const GLOBAL_PLATE_SCOPE = Symbol('global-plate');\n\nexport const createPlateStore = <E extends PlateEditor = PlateEditor>({\n id,\n composing = false,\n containerRef = { current: null },\n decorate = null,\n editor,\n isMounted = false,\n primary = true,\n readOnly = null,\n renderChunk = null,\n renderElement = null,\n renderLeaf = null,\n renderText = null,\n scrollRef = { current: null },\n versionDecorate = 1,\n versionEditor = 1,\n versionSelection = 1,\n versionValue = 1,\n onChange = null,\n onNodeChange = null,\n onSelectionChange = null,\n onTextChange = null,\n onValueChange = null,\n ...state\n}: Partial<PlateStoreState<E>> = {}) =>\n createAtomStore(\n {\n composing,\n containerRef,\n decorate,\n editor,\n isMounted,\n primary,\n readOnly,\n renderChunk,\n renderElement,\n renderLeaf,\n renderText,\n scrollRef,\n versionDecorate,\n versionEditor,\n versionSelection,\n versionValue,\n onChange,\n onNodeChange,\n onSelectionChange,\n onTextChange,\n onValueChange,\n ...state,\n } as PlateStoreState<E>,\n {\n name: 'plate',\n suppressWarnings: true,\n extend: (atoms) => ({\n trackedEditor: atom((get) => ({\n editor: get(atoms.editor),\n version: get(atoms.versionEditor),\n })),\n trackedSelection: atom((get) => ({\n selection: get(atoms.editor).selection,\n version: get(atoms.versionSelection),\n })),\n trackedValue: atom((get) => ({\n value: get(atoms.editor).children,\n version: get(atoms.versionValue),\n })),\n }),\n }\n );\n\nconst {\n PlateProvider: PlateStoreProvider,\n plateStore,\n usePlateSet: usePlateLocalSet,\n usePlateState: usePlateLocalState,\n usePlateStore: usePlateLocalStore,\n usePlateValue: usePlateLocalValue,\n} = createPlateStore();\n\nconst { usePlateStore: useFallbackPlateStore } = createPlateStore();\n\nexport { plateStore, PlateStoreProvider, usePlateLocalStore };\n\nexport const usePlateStore = (id?: string) => {\n // Try to fetch the store from a Plate provider\n const localStore =\n usePlateLocalStore({ scope: id, warnIfNoStore: false }) ?? null;\n\n const [localStoreExists] = React.useState(!!localStore.store);\n\n // If no store was found, try to fetch the store from a PlateController\n const store = (\n localStoreExists\n ? localStore\n : // eslint-disable-next-line react-hooks/rules-of-hooks\n usePlateControllerStore(id)\n ) as typeof localStore;\n\n /**\n * If we still have no store, there are two possibilities.\n *\n * Case 1: There is neither a Plate nor a PlateController above us in the\n * tree. In this case, throw an error, since calling the hook will never\n * work.\n *\n * Case 2: There is a PlateController, but it has no active editor. In this\n * case, return a fallback store until an editor becomes active.\n */\n const plateControllerExists = usePlateControllerExists();\n const fallbackStore = useFallbackPlateStore();\n\n if (!store) {\n if (plateControllerExists) {\n return fallbackStore;\n }\n\n throw new Error(\n 'Plate hooks must be used inside a Plate or PlateController'\n );\n }\n return store;\n};\n\nexport const usePlateSet: typeof usePlateLocalSet = (key, options) => {\n const store = usePlateStore(\n typeof options === 'string' ? options : options?.scope\n );\n\n return useAtomStoreSet(store, key);\n};\n\nexport const usePlateValue = ((key, options) => {\n const store = usePlateStore(\n typeof options === 'string' ? options : options?.scope\n );\n\n return useAtomStoreValue(store, key);\n}) as typeof usePlateLocalValue;\n\nexport const usePlateState = ((key, options) => {\n const store = usePlateStore(\n typeof options === 'string' ? options : options?.scope\n );\n\n return useAtomStoreState(store, key);\n}) as typeof usePlateLocalState;\n\n// ─── Selectors ───────────────────────────────────────────────────────────────\n\n/** Get the closest `Plate` id. */\nexport const useEditorId = (): string =>\n useAtomStoreValue(usePlateStore(), 'editor').id;\n\nexport const useEditorContainerRef = (id?: string) =>\n useAtomStoreValue(usePlateStore(id), 'containerRef');\n\nexport const useEditorScrollRef = (id?: string) =>\n useAtomStoreValue(usePlateStore(id), 'scrollRef');\n\n/** Returns the scrollRef if it exists, otherwise returns the containerRef. */\nexport const useScrollRef = (id?: string) => {\n const scrollRef = useEditorScrollRef(id);\n const containerRef = useEditorContainerRef(id);\n\n return scrollRef.current ? scrollRef : containerRef;\n};\n\nexport const useEditorMounted = (id?: string): boolean =>\n !!useAtomStoreValue(usePlateStore(id), 'isMounted');\n\n/**\n * Whether the editor is read-only. You can also use `useReadOnly` from\n * `slate-react` in node components.\n */\nexport const useEditorReadOnly = (id?: string): boolean =>\n !!useAtomStoreValue(usePlateStore(id), 'readOnly');\n\n/** Whether the editor is composing. */\nexport const useEditorComposing = (id?: string): boolean =>\n !!useAtomStoreValue(usePlateStore(id), 'composing');\n\n/**\n * Get a reference to the editor instance that remains stable across re-renders.\n * The editor object is enhanced with a `store` property that provides access to\n * the Plate store.\n *\n * @example\n * ```tsx\n * const editor = useEditorRef();\n * const readOnly = useAtomStoreValue(editor.store, 'readOnly');\n */\nexport const useEditorRef = <E extends PlateEditor = PlateEditor>(\n id?: string\n): E & { store: PlateStore } => {\n const store = usePlateStore(id);\n const editor: any =\n (useAtomStoreValue(store, 'editor') as E) ?? createPlateFallbackEditor();\n\n editor.store = store;\n\n return editor;\n};\n\n/** Get the editor selection (deeply memoized). */\nexport const useEditorSelection = (id?: string) =>\n usePlateStore(id).useTrackedSelectionValue().selection;\n\n/** Get editor state which is updated on editor change. */\nexport const useEditorState = <E extends PlateEditor = PlateEditor>(\n id?: string\n): E => usePlateStore(id).useTrackedEditorValue().editor;\n\n/** Version incremented on each editor change. */\nexport const useEditorVersion = (id?: string) =>\n useAtomStoreValue(usePlateStore(id), 'versionEditor');\n\n/** Version incremented on selection change. */\nexport const useSelectionVersion = (id?: string) =>\n useAtomStoreValue(usePlateStore(id), 'versionSelection');\n\n/** Get the editor value (deeply memoized). */\nexport const useEditorValue = (id?: string) =>\n usePlateStore(id).useTrackedValueValue().value;\n\n/** Version incremented on value change. */\nexport const useValueVersion = (id?: string) =>\n useAtomStoreValue(usePlateStore(id), 'versionValue');\n\n// ─── Actions ─────────────────────────────────────────────────────────────────\n\nexport const useIncrementVersion = (key: PlateChangeKey, id?: string) => {\n const previousVersionRef = React.useRef(1);\n\n const store = usePlateStore(id);\n\n const setVersionDecorate = useAtomStoreSet(store, 'versionDecorate');\n const setVersionSelection = useAtomStoreSet(store, 'versionSelection');\n const setVersionValue = useAtomStoreSet(store, 'versionValue');\n const setVersionEditor = useAtomStoreSet(store, 'versionEditor');\n\n return React.useCallback(() => {\n const nextVersion = previousVersionRef.current + 1;\n\n switch (key) {\n case 'versionDecorate': {\n setVersionDecorate(nextVersion);\n\n break;\n }\n case 'versionEditor': {\n setVersionEditor(nextVersion);\n\n break;\n }\n case 'versionSelection': {\n setVersionSelection(nextVersion);\n\n break;\n }\n case 'versionValue': {\n setVersionValue(nextVersion);\n\n break;\n }\n }\n\n previousVersionRef.current = nextVersion;\n }, [\n key,\n setVersionDecorate,\n setVersionEditor,\n setVersionSelection,\n setVersionValue,\n ]);\n};\n\nexport const useRedecorate = (id?: string) => {\n const updateDecorate = useIncrementVersion('versionDecorate', id);\n\n return React.useCallback(() => {\n updateDecorate();\n }, [updateDecorate]);\n};\n","import React from 'react';\n\nimport type { AnyPluginConfig, WithRequiredKey } from '../../../lib';\nimport type { PlateEditor } from '../../editor';\n\nimport {\n type InferConfig,\n type PlatePlugin,\n type PlatePluginContext,\n getEditorPlugin,\n} from '../../plugin';\nimport { type PlateStore, useEditorRef } from './createPlateStore';\n\n/** Get editor and plugin context. */\nexport function useEditorPlugin<\n P extends AnyPluginConfig | PlatePlugin<AnyPluginConfig>,\n E extends PlateEditor = PlateEditor,\n>(\n p: WithRequiredKey<P>,\n id?: string\n): PlatePluginContext<InferConfig<P> extends never ? P : InferConfig<P>, E> & {\n store: PlateStore;\n} {\n const editor = useEditorRef(id);\n\n return React.useMemo(\n () =>\n ({\n ...getEditorPlugin(editor, p),\n store: editor.store,\n }) as any,\n [editor, p]\n );\n}\n","import React from 'react';\n\nimport { useStoreAtomValue } from 'jotai-x';\nimport { selectAtom } from 'jotai/utils';\n\nimport type { PlateEditor } from '../../editor';\n\nimport { plateStore, usePlateStore } from './createPlateStore';\n\nexport type UseEditorSelectorOptions<T> = {\n id?: string;\n equalityFn?: (a: T, b: T) => boolean;\n};\n\nexport const useEditorSelector = <T, E extends PlateEditor = PlateEditor>(\n selector: (editor: E, prev?: T) => T,\n deps: React.DependencyList,\n { id, equalityFn = (a: T, b: T) => a === b }: UseEditorSelectorOptions<T> = {}\n): T => {\n const selectorAtom = React.useMemo(\n () =>\n selectAtom<{ editor: E }, T>(\n plateStore.atom.trackedEditor,\n ({ editor }, prev) => selector(editor, prev),\n equalityFn\n ),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps\n );\n\n return useStoreAtomValue(usePlateStore(id), selectorAtom);\n};\n","import type { TEqualityChecker } from 'zustand-x';\n\nimport { useStoreSelect, useStoreValue } from 'zustand-x';\n\nimport type {\n AnyPluginConfig,\n InferOptions,\n InferSelectors,\n WithRequiredKey,\n} from '../../../lib';\nimport type { PlateEditor } from '../../editor';\n\nimport { useEditorRef } from './createPlateStore';\n\n/**\n * Hook to access plugin options. For usage outside `<Plate>`, use\n * `useEditorPluginOption` instead.\n *\n * @example\n * const value = usePluginOption(plugin, 'value');\n * const doubleValue = usePluginOption(plugin, 'doubleValue', 2);\n */\nexport function usePluginOption<\n C extends AnyPluginConfig,\n StateType extends InferOptions<C>,\n TSelectors extends InferSelectors<C>,\n K extends keyof StateType | keyof TSelectors | 'state',\n>(\n plugin: WithRequiredKey<C>,\n key: K,\n ...args: [\n ...(K extends keyof TSelectors ? Parameters<TSelectors[K]> : unknown[]),\n TEqualityChecker<\n K extends 'state'\n ? StateType\n : K extends keyof TSelectors\n ? ReturnType<TSelectors[K]>\n : K extends keyof StateType\n ? StateType[K]\n : never\n >?,\n ]\n): K extends 'state'\n ? StateType\n : K extends keyof TSelectors\n ? ReturnType<TSelectors[K]>\n : K extends keyof StateType\n ? StateType[K]\n : never {\n const editor = useEditorRef();\n\n return useEditorPluginOption(editor, plugin, key, ...args);\n}\n\nexport function useEditorPluginOption<\n C extends AnyPluginConfig,\n StateType extends InferOptions<C>,\n TSelectors extends InferSelectors<C>,\n K extends keyof StateType | keyof TSelectors | 'state',\n>(\n editor: PlateEditor,\n plugin: WithRequiredKey<C>,\n key: K,\n ...args: [\n ...(K extends keyof TSelectors ? Parameters<TSelectors[K]> : unknown[]),\n TEqualityChecker<\n K extends 'state'\n ? StateType\n : K extends keyof TSelectors\n ? ReturnType<TSelectors[K]>\n : K extends keyof StateType\n ? StateType[K]\n : never\n >?,\n ]\n): K extends 'state'\n ? StateType\n : K extends keyof TSelectors\n ? ReturnType<TSelectors[K]>\n : K extends keyof StateType\n ? StateType[K]\n : never {\n const store = editor.getOptionsStore(plugin);\n\n if (!store) {\n return undefined as any;\n }\n\n if (\n key !== 'state' &&\n !(key in store.get('state')) &&\n !(key in store.selectors)\n ) {\n editor.api.debug.error(\n `usePluginOption: ${key as any} option is not defined in plugin ${plugin.key}`,\n 'OPTION_UNDEFINED'\n );\n return undefined as any;\n }\n\n if (key === 'state') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreSelect(\n store,\n (state) => state,\n args[0] as TEqualityChecker<StateType> | undefined\n ) as any;\n }\n\n return (useStoreValue as any)(store, key, ...args);\n}\n\n/**\n * Use zustand store selector.\n *\n * @example\n * const name = usePluginOptions(plugin, (state) => state.name, equalityFn);\n */\nexport function usePluginOptions<C extends AnyPluginConfig, U>(\n plugin: WithRequiredKey<C>,\n selector: (state: InferOptions<C>) => U,\n {\n id,\n equalityFn,\n }: {\n // Editor id. Default is the closest one.\n id?: string;\n // Equality function. Default is strict equality.\n equalityFn?: (a: U, b: U) => boolean;\n } = {}\n): U {\n const editor = useEditorRef(id);\n\n return useEditorPluginOptions(editor, plugin, selector, {\n equalityFn,\n });\n}\n\nexport function useEditorPluginOptions<C extends AnyPluginConfig, U>(\n editor: PlateEditor,\n plugin: WithRequiredKey<C>,\n selector: (state: InferOptions<C>) => U,\n {\n equalityFn,\n }: {\n // Equality function. Default is strict equality.\n equalityFn?: (a: U, b: U) => boolean;\n } = {}\n): U {\n const store = editor.getOptionsStore(plugin);\n\n if (!store) {\n return undefined as any;\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreSelect(store, selector, equalityFn);\n}\n","import type { TElement } from '@platejs/slate';\n\nimport { useAtomStoreValue } from 'jotai-x';\n\nimport { useEditorRef } from '../plate';\nimport { SCOPE_ELEMENT, useElementStore } from './useElementStore';\n\n/**\n * Get the element by plugin key. If no element is found in the context, it will\n * return an empty object.\n */\nexport const useElement = <T extends TElement = TElement>(\n pluginKey = SCOPE_ELEMENT\n): T => {\n const editor = useEditorRef();\n const value = useAtomStoreValue(useElementStore(pluginKey), 'element');\n\n if (!value) {\n editor.api.debug.warn(\n `useElement(${pluginKey}) hook must be used inside the node component's context`,\n 'USE_ELEMENT_CONTEXT'\n );\n\n return {} as T;\n }\n\n return value as T;\n};\n","import React from 'react';\n\nimport type { NodeEntry, TElement } from '@platejs/slate';\n\nimport { useStoreAtomValue } from 'jotai-x';\nimport { selectAtom } from 'jotai/utils';\n\nimport { elementStore, useElementStore } from './useElementStore';\n\ntype UseElementSelectorOptions<T> = {\n key?: string;\n equalityFn?: (a: T, b: T) => boolean;\n};\n\nexport const useElementSelector = <T>(\n selector: <N extends TElement>(state: NodeEntry<N>, prev?: T) => T,\n deps: React.DependencyList,\n {\n key,\n equalityFn = (a: T, b: T) => a === b,\n }: UseElementSelectorOptions<T> = {}\n): T => {\n const selectorAtom = React.useMemo(\n () =>\n selectAtom(\n elementStore.atom.entry,\n (entry, prev) => selector(entry, prev),\n equalityFn\n ),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps\n );\n\n return useStoreAtomValue(useElementStore(key), selectorAtom);\n};\n","import { useEventEditorValue } from '../../plugins/event-editor/EventEditorStore';\nimport { PLATE_SCOPE, useEditorRef } from '../plate';\n\n/** Get last event editor id: focus, blur or last. */\nexport const useEventPlateId = (id?: string) => {\n const focus = useEventEditorValue('focus');\n const blur = useEventEditorValue('blur');\n const last = useEventEditorValue('last');\n const providerId = useEditorRef().id;\n\n if (id) return id;\n if (focus) return focus;\n if (blur) return blur;\n\n return last ?? providerId ?? PLATE_SCOPE;\n};\n","import React, { useEffect } from 'react';\n\nimport { useHotkeys } from '@udecode/react-hotkeys';\nimport { isDefined } from '@udecode/utils';\n\nimport type { Shortcut } from '../plugin';\n\nimport { useEditorRef } from '../stores';\n\nexport function EditorHotkeysEffect({\n id,\n editableRef,\n}: {\n editableRef: React.RefObject<HTMLDivElement | null>;\n id?: string;\n}) {\n const editor = useEditorRef(id);\n\n return (\n <>\n {Object.entries(editor.meta.shortcuts).map(\n ([hotkeyString, hotkeyConfig]) => {\n if (\n !hotkeyConfig ||\n !isDefined(hotkeyConfig.keys) ||\n !hotkeyConfig.handler\n ) {\n return null;\n }\n\n return (\n <HotkeyEffect\n id={id}\n key={hotkeyString}\n editableRef={editableRef}\n hotkeyConfig={hotkeyConfig}\n />\n );\n }\n )}\n </>\n );\n}\n\nfunction HotkeyEffect({\n id,\n editableRef,\n hotkeyConfig,\n}: {\n editableRef: React.RefObject<HTMLDivElement | null>;\n hotkeyConfig: Shortcut;\n id?: string;\n}) {\n const editor = useEditorRef(id);\n const { keys, handler, ...options } = hotkeyConfig;\n\n const setHotkeyRef = useHotkeys<HTMLDivElement>(\n keys!,\n (event, eventDetails) => {\n if (\n handler!({\n editor,\n event,\n eventDetails,\n }) !== false &&\n !isDefined(options.preventDefault)\n ) {\n // Prevent default if handler returns false and preventDefault is true\n event.preventDefault();\n event.stopPropagation?.();\n }\n },\n {\n enableOnContentEditable: true,\n ...options,\n },\n []\n );\n\n useEffect(() => {\n if (editableRef.current) {\n setHotkeyRef(editableRef.current);\n }\n }, [setHotkeyRef, editableRef]);\n\n return null;\n}\n","import React from 'react';\n\nimport { useEditorRef, useRedecorate } from '../stores';\n\nexport const EditorMethodsEffect = ({ id }: { id?: string }) => {\n const editor = useEditorRef(id);\n const redecorate = useRedecorate(id);\n\n React.useEffect(() => {\n editor.api.redecorate = redecorate;\n }, [editor, redecorate]);\n\n return null;\n};\n","import React from 'react';\n\nimport { useAtomStoreSet, useAtomStoreValue } from 'jotai-x';\n\nimport type { AnyEditorPlatePlugin } from '../plugin/PlatePlugin';\n\nimport { getEditorPlugin, getPlugin } from '../plugin';\nimport { useEditorRef, usePlateStore } from '../stores';\n\nexport function EditorRefPluginEffect({\n id,\n plugin,\n}: {\n plugin: AnyEditorPlatePlugin;\n id?: string;\n}) {\n const editor = useEditorRef(id);\n\n plugin.useHooks?.(getEditorPlugin(editor, plugin) as any);\n\n return null;\n}\n\nexport function EditorRefEffect({ id }: { id?: string }) {\n const store = usePlateStore(id);\n const editor = useAtomStoreValue(store, 'editor');\n const setIsMounted = useAtomStoreSet(store, 'isMounted');\n\n React.useEffect(() => {\n setIsMounted(true);\n\n return () => {\n setIsMounted(false);\n };\n }, [setIsMounted]);\n\n return (\n <>\n {editor.meta.pluginCache.useHooks.map((key) => (\n <EditorRefPluginEffect\n id={id}\n key={key}\n plugin={getPlugin(editor, { key })}\n />\n ))}\n </>\n );\n}\n","import React from 'react';\n\ndeclare global {\n // biome-ignore lint/style/useConsistentTypeDefinitions: Global augmentation must be an interface per TypeScript specification\n interface Global {\n __PLATE_INSTANCES__?: number;\n }\n}\n\nfunction checkPlateInstances() {\n (globalThis as any).__PLATE_INSTANCES__ =\n ((globalThis as any).__PLATE_INSTANCES__ || 0) + 1;\n}\n\ncheckPlateInstances();\n\nexport function usePlateInstancesWarn(disabled?: boolean) {\n React.useEffect(() => {\n if (\n !disabled &&\n (globalThis as any).__PLATE_INSTANCES__ &&\n (globalThis as any).__PLATE_INSTANCES__ > 1\n ) {\n console.warn('Detected multiple @platejs/core instances!');\n }\n }, [disabled]);\n}\n","import React, { useId } from 'react';\n\nimport type { EditableProps } from '../../lib/types/EditableProps';\nimport type { PlateEditor } from '../editor/PlateEditor';\n\nimport { usePlateInstancesWarn } from '../../internal/hooks/usePlateInstancesWarn';\nimport { type PlateStoreState, PlateStoreProvider } from '../stores';\n\nexport interface PlateProps<E extends PlateEditor = PlateEditor>\n extends Partial<\n Pick<\n PlateStoreState<E>,\n | 'decorate'\n | 'onChange'\n | 'onNodeChange'\n | 'onSelectionChange'\n | 'onTextChange'\n | 'onValueChange'\n | 'primary'\n | 'readOnly'\n >\n > {\n children: React.ReactNode;\n\n editor: E | null;\n\n renderElement?: EditableProps['renderElement'];\n\n renderLeaf?: EditableProps['renderLeaf'];\n\n suppressInstanceWarning?: boolean;\n}\n\nfunction PlateInner({\n children,\n containerRef,\n decorate,\n editor,\n primary,\n readOnly,\n renderElement,\n renderLeaf,\n scrollRef,\n onChange,\n onNodeChange,\n onSelectionChange,\n onTextChange,\n onValueChange,\n}: PlateProps & {\n containerRef: React.RefObject<HTMLDivElement | null>;\n scrollRef: React.RefObject<HTMLDivElement | null>;\n}) {\n return (\n <PlateStoreProvider\n readOnly={readOnly ?? editor?.dom.readOnly}\n onChange={onChange}\n onNodeChange={onNodeChange}\n onSelectionChange={onSelectionChange}\n onTextChange={onTextChange}\n onValueChange={onValueChange}\n containerRef={containerRef}\n decorate={decorate}\n editor={editor!}\n primary={primary}\n renderElement={renderElement}\n renderLeaf={renderLeaf}\n scope={editor!.id}\n scrollRef={scrollRef}\n >\n {children}\n </PlateStoreProvider>\n );\n}\n\nexport function Plate<E extends PlateEditor = PlateEditor>(\n props: PlateProps<E>\n) {\n const id = useId();\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n\n usePlateInstancesWarn(props.suppressInstanceWarning);\n\n if (!props.editor) return null;\n\n props.editor.meta.uid = `e-${id.replaceAll(':', '')}`;\n\n return (\n <PlateInner\n key={props.editor.meta.key}\n containerRef={containerRef}\n scrollRef={scrollRef}\n {...(props as any)}\n />\n );\n}\n","import React, { type HTMLAttributes } from 'react';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport {\n useEditorContainerRef,\n useEditorReadOnly,\n useEditorRef,\n} from '../stores';\n\nexport const PlateContainer = ({\n children,\n ...props\n}: HTMLAttributes<HTMLDivElement>) => {\n const editor = useEditorRef();\n const readOnly = useEditorReadOnly();\n\n const containerRef = useEditorContainerRef();\n\n let afterContainer: React.ReactNode = null;\n let beforeContainer: React.ReactNode = null;\n\n const mainContainer = (\n <div id={editor.meta.uid} ref={containerRef} {...props}>\n {children}\n </div>\n );\n\n editor.meta.pluginCache.render.beforeContainer.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (isEditOnly(readOnly, plugin, 'render')) return;\n\n const BeforeContainer = plugin.render.beforeContainer!;\n\n beforeContainer = (\n <>\n {beforeContainer}\n <BeforeContainer {...props} />\n </>\n );\n });\n\n editor.meta.pluginCache.render.afterContainer.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (isEditOnly(readOnly, plugin, 'render')) return;\n\n const AfterContainer = plugin.render.afterContainer!;\n\n afterContainer = (\n <>\n {afterContainer}\n <AfterContainer {...props} />\n </>\n );\n });\n\n return (\n <>\n {beforeContainer}\n {mainContainer}\n {afterContainer}\n </>\n );\n};\n\nPlateContainer.displayName = 'PlateContainer';\n","import React from 'react';\n\nimport type { WritableAtom } from 'jotai/vanilla/atom';\n\nimport { useStableFn } from '@udecode/react-utils';\nimport { focusAtom } from 'jotai-optics';\nimport { type JotaiStore, useAtomStoreSet, useAtomStoreValue } from 'jotai-x';\n\nimport { useFocused } from '../slate-react';\nimport {\n plateControllerStore,\n useEditorId,\n usePlateControllerLocalStore,\n usePlateStore,\n} from '../stores';\n\nexport type PlateControllerEffectProps = {\n id?: string;\n};\n\nexport const PlateControllerEffect = ({\n id: idProp,\n}: PlateControllerEffectProps) => {\n const idFromStore = useEditorId();\n const id = idProp ?? idFromStore;\n\n // Atom to set the store for the editor's ID\n const currentStoreAtom = React.useMemo(\n () =>\n focusAtom(\n plateControllerStore.atom.editorStores as WritableAtom<\n Record<string, JotaiStore | null>,\n any,\n any\n >,\n (optic) => optic.prop(id)\n ),\n [id]\n );\n\n const setCurrentStore = useStableFn(\n usePlateControllerLocalStore().setAtom(currentStoreAtom),\n [currentStoreAtom]\n );\n\n const setPrimaryEditorIds = useStableFn(\n useAtomStoreSet(usePlateControllerLocalStore(), 'primaryEditorIds')\n );\n\n const setActiveId = useStableFn(\n useAtomStoreSet(usePlateControllerLocalStore(), 'activeId')\n );\n\n const store = usePlateStore(id);\n const primary = useAtomStoreValue(store, 'primary');\n const focused = useFocused();\n\n // Keep the store up to date for the editor's ID\n React.useEffect(() => {\n setCurrentStore((store as any) ?? null);\n\n /**\n * On unmount or when the ID changes, unset the store for the old ID. If the\n * old ID was active, set the active ID to null. It is a bug if this code\n * runs at any other time, so the dependency array must be stable.\n */\n return () => {\n setCurrentStore(null);\n setActiveId((activeId) => (activeId === id ? null : activeId));\n };\n }, [store, setCurrentStore, setActiveId, id]);\n\n // If the editor is primary, register it in the list of primary editors\n React.useEffect(() => {\n if (primary) {\n setPrimaryEditorIds((ids) => [...ids, id]);\n\n return () => {\n setPrimaryEditorIds((ids) => ids.filter((i) => i !== id));\n };\n }\n }, [id, primary, setPrimaryEditorIds]);\n\n // Set the editor as active when it becomes focused\n React.useEffect(() => {\n if (id && focused) {\n setActiveId(id);\n }\n }, [id, focused, setActiveId]);\n\n return null;\n};\n","import React from 'react';\n\nimport { useSlateProps } from '../hooks';\nimport { Slate } from '../slate-react';\nimport { useEditorRef } from '../stores/plate';\n\n/**\n * Slate with plugins.\n *\n * - OnChange prop\n * - RenderAboveSlate\n */\nexport function PlateSlate({\n id,\n children,\n}: {\n children: React.ReactNode;\n id?: string;\n}) {\n const slateProps = useSlateProps({ id });\n\n const editor = useEditorRef(id);\n\n let aboveSlate: React.ReactElement<any> | null = (\n <Slate\n key={slateProps.key}\n editor={slateProps.editor}\n initialValue={slateProps.initialValue}\n onChange={slateProps.onChange}\n onSelectionChange={slateProps.onSelectionChange}\n onValueChange={slateProps.onValueChange}\n >\n {children}\n </Slate>\n );\n\n editor.meta.pluginCache.render.aboveSlate.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n const AboveSlate = plugin.render.aboveSlate!;\n\n aboveSlate = <AboveSlate>{aboveSlate}</AboveSlate>;\n });\n\n return aboveSlate;\n}\n","import React, { useRef } from 'react';\n\nimport { useComposedRef } from '@udecode/react-utils';\nimport { isDefined } from '@udecode/utils';\nimport { useAtomStoreValue } from 'jotai-x';\n\nimport type { EditableProps } from '../../lib/types/EditableProps';\nimport type { PlateEditor } from '../editor';\n\nimport { isEditOnly } from '../../internal/plugin/isEditOnlyDisabled';\nimport { SlateExtensionPlugin } from '../../lib';\nimport { useEditableProps } from '../hooks';\nimport { Editable } from '../slate-react';\nimport {\n type PlateStoreState,\n useEditorReadOnly,\n useEditorRef,\n usePlateStore,\n} from '../stores';\nimport { EditorHotkeysEffect } from './EditorHotkeysEffect';\nimport { EditorMethodsEffect } from './EditorMethodsEffect';\nimport { EditorRefEffect } from './EditorRefEffect';\nimport { PlateControllerEffect } from './PlateControllerEffect';\nimport { PlateSlate } from './PlateSlate';\n\nexport type PlateContentProps = Omit<EditableProps, 'decorate'> & {\n /** Autofocus when it becomes editable (readOnly false -> readOnly true) */\n autoFocusOnEditable?: boolean;\n decorate?: PlateStoreState['decorate'];\n disabled?: boolean;\n /** R enders the editable content. */\n renderEditable?: (editable: React.ReactElement<any>) => React.ReactNode;\n};\n\n/**\n * Editable with plugins.\n *\n * - Decorate prop\n * - DOM handler props\n * - ReadOnly prop\n * - Render.afterEditable\n * - Render.beforeEditable\n * - RenderElement prop\n * - RenderLeaf prop\n * - UseHooks\n */\nconst PlateContent = React.forwardRef(\n (\n {\n autoFocusOnEditable,\n readOnly: readOnlyProp,\n renderEditable,\n ...props\n }: PlateContentProps,\n ref\n ) => {\n const { id } = props;\n\n const editor = useEditorRef(id);\n\n const storeReadOnly = useEditorReadOnly();\n const readOnly = props.disabled ? true : (readOnlyProp ?? storeReadOnly);\n\n // Can't be in useLayoutEffect for the first render\n editor.dom.readOnly = readOnly;\n\n if (!editor) {\n throw new Error(\n 'Editor not found. Please ensure that PlateContent is rendered below Plate.'\n );\n }\n\n const editableProps = useEditableProps({ ...props, readOnly });\n\n const editableRef = useRef<HTMLDivElement | null>(null);\n const combinedRef = useComposedRef(ref, editableRef);\n\n // Don't render if editor is not ready (e.g., async value still loading)\n if (!editor.children || editor.children.length === 0) {\n return null;\n }\n\n const editable = <Editable ref={combinedRef} {...(editableProps as any)} />;\n\n let afterEditable: React.ReactNode = null;\n let beforeEditable: React.ReactNode = null;\n\n editor.meta.pluginCache.render.beforeEditable.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (isEditOnly(readOnly, plugin, 'render')) return;\n\n const BeforeEditable = plugin.render.beforeEditable!;\n\n beforeEditable = (\n <>\n {beforeEditable}\n <BeforeEditable {...editableProps} />\n </>\n );\n });\n\n editor.meta.pluginCache.render.afterEditable.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (isEditOnly(readOnly, plugin, 'render')) return;\n\n const AfterEditable = plugin.render.afterEditable!;\n\n afterEditable = (\n <>\n {afterEditable}\n <AfterEditable {...editableProps} />\n </>\n );\n });\n\n let aboveEditable: React.ReactNode = (\n <>\n {renderEditable ? renderEditable(editable) : editable}\n\n <EditorMethodsEffect id={id} />\n <EditorHotkeysEffect id={id} editableRef={editableRef} />\n <EditorRefEffect id={id} />\n <PlateControllerEffect id={id} />\n </>\n );\n\n editor.meta.pluginCache.render.aboveEditable.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (isEditOnly(readOnly, plugin, 'render')) return;\n\n const AboveEditable = plugin.render.aboveEditable!;\n\n aboveEditable = <AboveEditable>{aboveEditable}</AboveEditable>;\n });\n\n return (\n <PlateSlate id={id}>\n <EditorStateEffect\n id={id}\n disabled={props.disabled}\n readOnly={readOnlyProp}\n autoFocusOnEditable={autoFocusOnEditable}\n editor={editor}\n />\n\n {beforeEditable}\n {aboveEditable}\n {afterEditable}\n </PlateSlate>\n );\n }\n);\nPlateContent.displayName = 'PlateContent';\n\nexport { PlateContent };\n\nfunction EditorStateEffect({\n id,\n autoFocusOnEditable,\n disabled,\n editor,\n readOnly,\n}: {\n editor: PlateEditor;\n id?: string;\n autoFocusOnEditable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n}) {\n const store = usePlateStore(id);\n\n // Sync PlateContent.readOnly to Plate.readOnly\n React.useLayoutEffect(() => {\n if (disabled) {\n store.setReadOnly(true);\n return;\n }\n\n if (isDefined(readOnly)) {\n store.setReadOnly(readOnly);\n }\n }, [disabled, editor.dom, readOnly, store]);\n\n // Sync onNodeChange from store to SlateExtensionPlugin\n const onNodeChange = useAtomStoreValue(store, 'onNodeChange');\n React.useLayoutEffect(() => {\n if (onNodeChange) {\n editor.setOption(\n SlateExtensionPlugin,\n 'onNodeChange',\n onNodeChange as any\n );\n }\n }, [editor, onNodeChange]);\n\n // Sync onTextChange from store to SlateExtensionPlugin\n const onTextChange = useAtomStoreValue(store, 'onTextChange');\n React.useLayoutEffect(() => {\n if (onTextChange) {\n editor.setOption(\n SlateExtensionPlugin,\n 'onTextChange',\n onTextChange as any\n );\n }\n }, [editor, onTextChange]);\n\n const prevReadOnly = React.useRef(readOnly);\n\n React.useEffect(() => {\n if (autoFocusOnEditable && prevReadOnly.current && !readOnly) {\n editor.tf.focus({ edge: 'endEditor' });\n }\n\n prevReadOnly.current = readOnly;\n }, [autoFocusOnEditable, editor, readOnly]);\n\n return null;\n}\n","import React from 'react';\n\nimport type { Value } from '@platejs/slate';\n\nimport type { AnyPluginConfig } from '../../lib';\n\nimport {\n type CreatePlateEditorOptions,\n type PlateCorePlugin,\n type TPlateEditor,\n createPlateEditor,\n} from '../editor';\n\n/**\n * Creates a memoized Plate editor for React components.\n *\n * This hook creates a fully configured Plate editor instance that is memoized\n * based on the provided dependencies. It's optimized for React components to\n * prevent unnecessary re-creation of the editor on every render.\n *\n * Examples:\n *\n * ```ts\n * const editor = usePlateEditor({\n * plugins: [ParagraphPlugin, HeadingPlugin],\n * value: [{ type: 'p', children: [{ text: 'Hello world!' }] }],\n * });\n *\n * // Editor with custom dependencies\n * const editor = usePlateEditor(\n * {\n * plugins: [ParagraphPlugin],\n * enabled,\n * },\n * [enabled]\n * ); // Re-create when enabled changes\n * ```\n *\n * @param options - Configuration options for creating the Plate editor\n * @param deps - Additional dependencies for the useMemo hook (default: [])\n * @see {@link createPlateEditor} for detailed information on React editor creation and configuration.\n * @see {@link createSlateEditor} for a non-React version of editor creation.\n * @see {@link withPlate} for the underlying React-specific enhancement function.\n */\nexport function usePlateEditor<\n V extends Value = Value,\n P extends AnyPluginConfig = PlateCorePlugin,\n TEnabled extends boolean | undefined = undefined,\n>(\n options: CreatePlateEditorOptions<V, P> & { enabled?: TEnabled } = {},\n deps: React.DependencyList = []\n): TEnabled extends false\n ? null\n : TEnabled extends true | undefined\n ? TPlateEditor<V, P>\n : TPlateEditor<V, P> | null {\n const [, forceRender] = React.useState({});\n const isMountedRef = React.useRef(false);\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n return React.useMemo(\n (): any => {\n if (options.enabled === false) return null;\n\n const editor = createPlateEditor({\n ...options,\n onReady: (ctx) => {\n if (ctx.isAsync && isMountedRef.current) {\n forceRender({});\n }\n options.onReady?.(ctx);\n },\n });\n\n return editor;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.id, options.enabled, ...deps]\n );\n}\n","import React from 'react';\n\nimport type { Value } from '@platejs/slate';\n\nimport type { AnyPluginConfig } from '../../lib';\n\nimport { createStaticEditor } from '../../static/editor/withStatic';\n\n/**\n * Creates a memoized static Plate editor for view-only React components.\n *\n * This hook creates a fully configured static Plate editor instance that is\n * memoized based on the provided dependencies. It's optimized for React\n * components to prevent unnecessary re-creation of the editor on every render.\n * Uses createStaticEditor.\n *\n * @param options - Configuration options for creating the static Plate editor\n * @param deps - Additional dependencies for the useMemo hook (default: [])\n * @see {@link createStaticEditor} for detailed information on static editor creation and configuration.\n */\nexport function usePlateViewEditor<\n V extends Value = Value,\n P extends AnyPluginConfig = any,\n TEnabled extends boolean | undefined = undefined,\n>(\n options: Parameters<typeof createStaticEditor<V, P>>[0] & {\n enabled?: TEnabled;\n } = {},\n deps: React.DependencyList = []\n): TEnabled extends false\n ? null\n : TEnabled extends true | undefined\n ? ReturnType<typeof createStaticEditor<V, P>>\n : ReturnType<typeof createStaticEditor<V, P>> | null {\n const isMountedRef = React.useRef(false);\n const [, forceRender] = React.useState({});\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n return React.useMemo(\n (): any => {\n if (options.enabled === false) return null;\n // No onReady/async logic for static editor\n return createStaticEditor({\n ...options,\n onReady: (ctx) => {\n if (ctx.isAsync && isMountedRef.current) {\n forceRender({});\n }\n options.onReady?.(ctx);\n },\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options?.id, options?.enabled, ...deps]\n );\n}\n","import React from 'react';\n\nimport { type CreatePlateEditorOptions, createPlateEditor } from '../editor';\nimport { type PlateProps, Plate } from './Plate';\nimport { type PlateContentProps, PlateContent } from './PlateContent';\n\nexport function PlateTest({\n editableProps,\n shouldNormalizeEditor,\n variant = 'wordProcessor',\n ...props\n}: CreatePlateEditorOptions &\n PlateProps & {\n editableProps?: PlateContentProps;\n variant?: 'comment' | 'wordProcessor';\n }) {\n const { id, editor: _editor, plugins } = props;\n\n let editor = _editor;\n\n if (editor && !editor.meta.pluginList) {\n editor = createPlateEditor({\n id,\n editor,\n plugins,\n shouldNormalizeEditor,\n });\n }\n\n return (\n <Plate {...props} editor={editor}>\n <PlateContent\n data-testid=\"slate-content-editable\"\n data-variant={variant}\n autoFocus\n {...editableProps}\n />\n </Plate>\n );\n}\n","import React, { useCallback } from 'react';\n\nimport { type PlateStaticProps, PlateStatic } from '../../static';\n\nexport type PlateViewProps = PlateStaticProps & {};\n\nexport const PlateView = (props: PlateViewProps) => (\n <PlateStatic\n onCopy={useCallback(\n (e: React.ClipboardEvent<HTMLDivElement>) => {\n props.editor.tf.setFragmentData(e.clipboardData, 'copy');\n if (e.clipboardData.getData('application/x-slate-fragment')) {\n e.preventDefault();\n }\n },\n [props.editor.tf]\n )}\n {...props}\n />\n);\n","import React from 'react';\n\ntype RefComponent<P, R> = React.FC<P> & {\n ref?: React.Ref<R>;\n};\n\nexport const withHOC = <ComponentProps, HOCProps, ComponentRef, HOCRef>(\n HOC: RefComponent<HOCProps, HOCRef>,\n Component: RefComponent<ComponentProps, ComponentRef>,\n hocProps?: Omit<HOCProps, 'children'>,\n hocRef?: React.Ref<HOCRef>\n) =>\n React.forwardRef<ComponentRef, ComponentProps>((props, componentRef) => (\n <HOC {...(hocProps as any)} ref={hocRef}>\n <Component {...(props as any)} ref={componentRef} />\n </HOC>\n ));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,MAAaE,0BAAyBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAC,YAAAC,UAAAC,WAAAL;AAKrC,KAAI,CAACK,OAAM,QAASD;CAAS,IAAAE;AAAA,KAAAL,EAAA,OAAAM,OAAAC,IAAA,4BAAA,EAAA;AAGCF,OAAA,EAAAG,mBAAqB,QAAQ;AAAAR,IAAA,KAAAK;OAAAA,MAAAL,EAAA;CAAA,IAAAS;AAAA,KAAAT,EAAA,OAAAE,cAAAF,EAAA,OAAAG,UAAA;AAAzDM,OAAA,oCAAA;GAEM,GAFGP;GAAmB,OAAAG;KACzBF,SACG;AAAAH,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAS;OAAAA,MAAAT,EA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AaQ,4BAA4B;CACvCD;CACAF;CACAC;CACAF;CACD;;;;;;;;;;;;;;AC6DD,MAAakC,aAIXC,GACAC,UAAkC,EAAE,KACG;CACvC,MAAM,EAAEC,qBAAqBC,UAAU,EAAE,EAAE,GAAGC,SAASH;AAQvD,QANenB,UAAgBkB,GAAG;EAChC,GAAGI;EACHF,qBAAqBA,uBAAuBnB;EAC5CoB,SAAS,CAAC,GAAGnB,qBAAqB,EAAE,GAAGmB,QAAO;EAC/C,CAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDX,MAAaG,qBAGX,EACAf,SAASnB,cAAc,EACvB,GAAG6B,YAC+B,EAAE,KACpCF,UAAgBR,QAAQU,QAAQ;;;;ACrIlC,MAAaS,6BACXC,UAAoC,EAAE,KACnC;CACH,MAAMC,SAASH,kBAAkBE,QAAQ;AAEzCC,QAAOC,KAAKC,aAAa;AAEzB,CAACF,OAA+CG,cAAc;AAC5D,QAAM,IAAIC,MACR,qWACD;;AAGH,QAAOJ;;;;;AClBT,MAAaM,eAAsC;CAEjD;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;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AA,MAAAR,EAAA;AAAA,QAPRQ;;;;;ACxBJ,MAAaa,aAAYC,UAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;AAAA,KAAAF,EAAA,OAAAD,MAAAI,OAAAC,IAAA;AAGnBF,QAAAG,MAAA;AACEN,SAAKI,OAAOC,GAAGE,gBAAiBD,EAACE,eAAgB,OAAO;AACxD,OAAIF,EAACE,cAAcC,QAAS,+BAA+B,CACzDH,GAACI,gBAAiB;;AAErBT,IAAA,KAAAD,MAAAI,OAAAC;AAAAJ,IAAA,KAAAE;OAAAA,MAAAF,EAAA;CANK,MAAAU,KAAAR;CAQP,IAAAS;AAAA,KAAAX,EAAA,OAAAD,SAAAC,EAAA,OAAAU,IAAA;AATHC,OAAA,oCAAC;GACS,QAAAD;GAQP,GACGX;IACJ;AAAAC,IAAA,KAAAD;AAAAC,IAAA,KAAAU;AAAAV,IAAA,KAAAW;OAAAA,MAAAX,EAAA;AAAA,QAXFW;;;;;ACDF,MAAaQ,WACXC,KACAG,WACAG,UACAE,WAEAhB,MAAMiB,YAAyCC,OAAAC,iBAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAE3B,MAAAC,KAAAJ;CAAY,IAAAK;AAAA,KAAAH,EAAA,OAAAD,gBAAAC,EAAA,OAAAE,IAAA;AAD9BC,OAAA,oCAAC;GAAG,GAAMT;GAAuBE,KAAAA;KAC/B,oCAAC;GAAS,GAAMM;GAAoBH,KAAAA;IACtC,CAAM;AAAAC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;OAAAA,MAAAH,EAAA;AAAA,QAFNG;EAGA"}
@@ -0,0 +1,2 @@
1
+ import { Aa as PlateStatic, Ba as pluginRenderElementStatic, Bi as getSelectedDomFragment, Ca as SlateRenderLeafProps, Da as serializeHtml, Ea as SerializeHtmlOptions, Fa as SlateRenderLeaf, Fi as stripSlateDataAttributes, Gi as createStaticString, Hi as getRenderNodeStaticProps, Ia as pipeRenderLeafStatic, Ii as stripHtmlClassNames, Ki as getStaticPlugins, La as pluginRenderLeafStatic, Li as pipeDecorate, Ma as SlateRenderText, Na as pipeRenderTextStatic, Oa as ElementStatic, Pa as pluginRenderTextStatic, Ra as pipeRenderElementStatic, Ri as isSelectOutside, Sa as SlateRenderElementProps, Ta as SlateRenderTextProps, Ui as getNodeDataAttributes, Vi as getSelectedDomBlocks, Wi as getPluginDataAttributes, _a as StyledSlateElementProps, ba as useNodeAttributes, ca as getEditorDOMFromHtmlString, da as SlateHTMLProps, fa as SlateLeaf, ga as SlateTextProps, ha as SlateText, ja as PlateStaticProps, ka as LeafStatic, la as SlateElement, ma as SlateNodeProps, pa as SlateLeafProps, qi as ViewPlugin, sa as createStaticEditor, ua as SlateElementProps, va as StyledSlateLeafProps, wa as SlateRenderNodeProps, xa as BoxStaticProps, ya as StyledSlateTextProps, za as SlateRenderElement, zi as getSelectedDomNode } from "../index-NTp--CEF";
2
+ export { BoxStaticProps, ElementStatic, LeafStatic, PlateStatic, PlateStaticProps, SerializeHtmlOptions, SlateElement, SlateElementProps, SlateHTMLProps, SlateLeaf, SlateLeafProps, SlateNodeProps, SlateRenderElement, SlateRenderElementProps, SlateRenderLeaf, SlateRenderLeafProps, SlateRenderNodeProps, SlateRenderText, SlateRenderTextProps, SlateText, SlateTextProps, StyledSlateElementProps, StyledSlateLeafProps, StyledSlateTextProps, ViewPlugin, createStaticEditor, createStaticString, getEditorDOMFromHtmlString, getNodeDataAttributes, getPluginDataAttributes, getRenderNodeStaticProps, getSelectedDomBlocks, getSelectedDomFragment, getSelectedDomNode, getStaticPlugins, isSelectOutside, pipeDecorate, pipeRenderElementStatic, pipeRenderLeafStatic, pipeRenderTextStatic, pluginRenderElementStatic, pluginRenderLeafStatic, pluginRenderTextStatic, serializeHtml, stripHtmlClassNames, stripSlateDataAttributes, useNodeAttributes };
@@ -0,0 +1,4 @@
1
+ import "../withSlate-1B0SfAWG.js";
2
+ import { C as createStaticEditor, D as getSelectedDomNode, E as isSelectOutside, O as getSelectedDomFragment, S as useNodeAttributes, T as ViewPlugin, _ as getPluginDataAttributes, a as ElementStatic, b as SlateLeaf, c as pipeRenderTextStatic, d as pluginRenderElementStatic, f as stripSlateDataAttributes, g as getNodeDataAttributes, h as getRenderNodeStaticProps, i as pluginRenderLeafStatic, k as pipeDecorate, l as pluginRenderTextStatic, m as getSelectedDomBlocks, n as serializeHtml, o as LeafStatic, p as stripHtmlClassNames, r as pipeRenderLeafStatic, s as PlateStatic, t as getEditorDOMFromHtmlString, u as pipeRenderElementStatic, v as createStaticString, w as getStaticPlugins, x as SlateText, y as SlateElement } from "../static-CVN6JhaR.js";
3
+
4
+ export { ElementStatic, LeafStatic, PlateStatic, SlateElement, SlateLeaf, SlateText, ViewPlugin, createStaticEditor, createStaticString, getEditorDOMFromHtmlString, getNodeDataAttributes, getPluginDataAttributes, getRenderNodeStaticProps, getSelectedDomBlocks, getSelectedDomFragment, getSelectedDomNode, getStaticPlugins, isSelectOutside, pipeDecorate, pipeRenderElementStatic, pipeRenderLeafStatic, pipeRenderTextStatic, pluginRenderElementStatic, pluginRenderLeafStatic, pluginRenderTextStatic, serializeHtml, stripHtmlClassNames, stripSlateDataAttributes, useNodeAttributes };