@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":"static-CVN6JhaR.js","names":["Path","TElement","TText","isDefined","SlateEditor","EditorPlugin","TransformOptions","GetInjectNodePropsOptions","GetInjectNodePropsReturnType","getEditorPlugin","getInjectMatch","pluginInjectNodeProps","editor","plugin","nodeProps","getElementPath","node","key","inject","injectNodeProps","element","text","classNames","defaultNodeValue","nodeKey","getType","query","styleKey","transformClassName","transformNodeValue","transformProps","transformStyle","validNodeValues","injectMatch","queryResult","nodeValue","includes","transformOptions","value","newProps","className","style","props","Path","TElement","TText","clsx","SlateEditor","isEditOnly","pluginInjectNodeProps","pipeInjectNodeProps","editor","nodeProps","getElementPath","node","readOnly","meta","pluginCache","inject","forEach","key","plugin","getPlugin","newAttributes","attributes","className","undefined","style","ranges: TRange[]","window","nodes: Descendant[]","SlateElement","clsx","node","component: React.ReactNode","Component","renderTexts: SlateRenderText[]","textPropsPlugins: SlatePlugin[]","render","clsx","attributes: SlateRenderElementProps['attributes']","children: React.ReactNode","defaultDecorate: (entry: NodeEntry) => DecoratedRange[]","ds: DecoratedRange[]","afterEditable: React.ReactNode","beforeEditable: React.ReactNode","clsx","aboveEditable: React.ReactNode","renderLeafs: SlateRenderLeaf[]","leafPropsPlugins: SlatePlugin[]","render","clsx"],"sources":["../src/internal/plugin/pluginInjectNodeProps.ts","../src/internal/plugin/pipeInjectNodeProps.tsx","../src/static/utils/pipeDecorate.ts","../src/static/internal/getPlainText.tsx","../src/static/utils/getSelectedDomFragment.tsx","../src/static/utils/getSelectedDomNode.ts","../src/static/utils/isSelectOutside.ts","../src/static/plugins/ViewPlugin.ts","../src/static/plugins/getStaticPlugins.ts","../src/static/editor/withStatic.tsx","../src/static/components/slate-nodes.tsx","../src/static/utils/createStaticString.ts","../src/static/utils/getNodeDataAttributes.ts","../src/static/utils/getRenderNodeStaticProps.ts","../src/static/utils/getSelectedDomBlocks.ts","../src/static/utils/stripHtmlClassNames.ts","../src/static/utils/stripSlateDataAttributes.ts","../src/static/pluginRenderElementStatic.tsx","../src/static/pipeRenderElementStatic.tsx","../src/static/pluginRenderTextStatic.tsx","../src/static/components/PlateStatic.tsx","../src/static/pluginRenderLeafStatic.tsx","../src/static/serializeHtml.tsx","../src/static/deserialize/htmlStringToEditorDOM.ts"],"sourcesContent":["import type { Path, TElement, TText } from '@platejs/slate';\n\nimport { isDefined } from '@udecode/utils';\n\nimport type { SlateEditor } from '../../lib/editor';\nimport type {\n EditorPlugin,\n TransformOptions,\n} from '../../lib/plugin/SlatePlugin';\n\nimport {\n type GetInjectNodePropsOptions,\n type GetInjectNodePropsReturnType,\n getEditorPlugin,\n} from '../../lib/plugin';\nimport { getInjectMatch } from '../../lib/utils/getInjectMatch';\n\n/**\n * Return if `element`, `text`, `nodeKey` is defined. Return if `node.type` is\n * not in `targetPlugins` (if defined). Return if `value = node[nodeKey]` is not\n * in `validNodeValues` (if defined). If `classNames[value]` is defined,\n * override `className` with it. If `styleKey` is defined, override `style` with\n * `[styleKey]: value`.\n */\nexport const pluginInjectNodeProps = (\n editor: SlateEditor,\n plugin: EditorPlugin,\n nodeProps: GetInjectNodePropsOptions,\n getElementPath: (node: TElement | TText) => Path\n): GetInjectNodePropsReturnType | undefined => {\n const {\n key,\n inject: { nodeProps: injectNodeProps },\n } = plugin;\n\n const { element, text } = nodeProps;\n\n const node = element ?? text;\n\n if (!node) return;\n if (!injectNodeProps) return;\n\n const {\n classNames,\n defaultNodeValue,\n nodeKey = editor.getType(key),\n query,\n styleKey = nodeKey as any,\n transformClassName,\n transformNodeValue,\n transformProps,\n transformStyle,\n validNodeValues,\n } = injectNodeProps;\n\n const injectMatch = getInjectMatch(editor, plugin);\n\n if (!injectMatch(node, getElementPath(node))) return;\n\n const queryResult = query?.({\n ...injectNodeProps,\n ...(getEditorPlugin(editor, plugin) as any),\n nodeProps,\n });\n\n if (query && !queryResult) {\n return;\n }\n\n const nodeValue = node[nodeKey!] as any;\n\n // early return if there is no reason to inject props\n if (\n !transformProps &&\n (!isDefined(nodeValue) ||\n (validNodeValues && !validNodeValues.includes(nodeValue)) ||\n nodeValue === defaultNodeValue)\n ) {\n return;\n }\n\n const transformOptions: TransformOptions = {\n ...nodeProps,\n ...(getEditorPlugin(editor, plugin) as any),\n nodeValue,\n };\n const value = transformNodeValue?.(transformOptions) ?? nodeValue;\n transformOptions.value = value;\n\n let newProps: GetInjectNodePropsReturnType = {};\n\n if (element && nodeKey && nodeValue) {\n newProps.className = `slate-${nodeKey}-${nodeValue}`;\n }\n if (classNames?.[nodeValue] || transformClassName) {\n newProps.className =\n transformClassName?.(transformOptions) ?? classNames?.[value];\n }\n if (styleKey) {\n newProps.style =\n transformStyle?.(transformOptions) ??\n ({\n [styleKey as string]: value,\n } as any);\n }\n if (transformProps) {\n newProps =\n transformProps({ ...transformOptions, props: newProps }) ?? newProps;\n }\n\n return newProps;\n};\n","import type { Path, TElement, TText } from '@platejs/slate';\n\nimport clsx from 'clsx';\n\nimport type { SlateEditor } from '../../lib/editor';\n\nimport { isEditOnly } from './isEditOnlyDisabled';\nimport { pluginInjectNodeProps } from './pluginInjectNodeProps';\n\n/** Inject plugin props, editor. */\nexport const pipeInjectNodeProps = (\n editor: SlateEditor,\n nodeProps: any,\n getElementPath: (node: TElement | TText) => Path,\n readOnly = false\n) => {\n editor.meta.pluginCache.inject.nodeProps.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n\n const newAttributes = pluginInjectNodeProps(\n editor,\n plugin,\n nodeProps,\n getElementPath\n );\n\n // Since `inject.nodeProps` can have hooks, we can't return early.\n if (isEditOnly(readOnly, plugin, 'inject')) {\n return;\n }\n\n if (!newAttributes) return;\n\n const attributes = nodeProps.attributes;\n\n nodeProps.attributes = {\n ...attributes,\n ...newAttributes,\n className:\n clsx(attributes?.className, newAttributes.className) || undefined,\n style: {\n ...attributes?.style,\n ...newAttributes.style,\n },\n };\n });\n\n return nodeProps;\n};\n","import type { NodeEntry, TRange } from '@platejs/slate';\n\nimport {\n type EditableProps,\n type SlateEditor,\n getEditorPlugin,\n} from '../../lib';\n\n/**\n * @see {@link Decorate} .\n * Optimization: return undefined if empty list so Editable uses a memo.\n */\nexport const pipeDecorate = (\n editor: SlateEditor,\n decorateProp?:\n | ((ctx: { editor: SlateEditor; entry: NodeEntry }) => TRange[] | undefined)\n | null\n): EditableProps['decorate'] => {\n if (editor.meta.pluginCache.decorate.length === 0 && !decorateProp) return;\n\n return (entry: NodeEntry) => {\n let ranges: TRange[] = [];\n\n const addRanges = (newRanges?: TRange[]) => {\n if (newRanges?.length) ranges = [...ranges, ...newRanges];\n };\n\n editor.meta.pluginCache.decorate.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n addRanges(\n plugin.decorate!({\n ...(getEditorPlugin(editor, plugin) as any),\n entry,\n })\n );\n });\n\n if (decorateProp) {\n addRanges(\n decorateProp({\n editor,\n entry,\n })\n );\n }\n\n return ranges;\n };\n};\n","import type { DOMElement, DOMNode, DOMText } from '@platejs/slate';\n\nconst getDefaultView = (value: any): Window | null =>\n value?.ownerDocument?.defaultView || null;\n\n/** Check if a DOM node is an element node. */\n\nconst isDOMElement = (value: any): value is DOMElement =>\n isDOMNode(value) && value.nodeType === 1;\n\n/** Check if a value is a DOM node. */\n\nconst isDOMNode = (value: any): value is DOMNode => {\n const window = getDefaultView(value);\n return !!window && value instanceof window.Node;\n};\n\n/** Check if a DOM node is an element node. */\nconst isDOMText = (value: any): value is DOMText =>\n isDOMNode(value) && value.nodeType === 3;\n\nexport const getPlainText = (domNode: DOMNode) => {\n let text = '';\n\n if (isDOMText(domNode) && domNode.nodeValue) {\n return domNode.nodeValue;\n }\n\n if (isDOMElement(domNode)) {\n for (const childNode of Array.from(domNode.childNodes)) {\n text += getPlainText(childNode);\n }\n\n const display = getComputedStyle(domNode).getPropertyValue('display');\n\n if (display === 'block' || display === 'list' || domNode.tagName === 'BR') {\n text += '\\n';\n }\n }\n\n return text;\n};\n","import { type Descendant, ElementApi, NodeApi } from '@platejs/slate';\n\nimport type { SlateEditor } from '../../lib';\n\nexport const getSelectedDomFragment = (editor: SlateEditor): Descendant[] => {\n const selection = window.getSelection();\n\n if (!selection || selection.rangeCount === 0) return [];\n\n const range = selection.getRangeAt(0);\n const fragment = range.cloneContents();\n\n const _domBlocks = fragment.querySelectorAll(\n '[data-slate-node=\"element\"][data-slate-id]'\n );\n\n const domBlocks = Array.from(_domBlocks);\n\n if (domBlocks.length === 0) return [];\n\n const nodes: Descendant[] = [];\n\n domBlocks.forEach((node, index) => {\n const blockId = (node as HTMLElement).dataset.slateId;\n const block = editor.api.node({ id: blockId, at: [] });\n\n // prevent inline elements like link and table cells.\n if (!block || block[1].length !== 1) return;\n\n /**\n * If the selection don't cover the all first or last block, we need\n * fallback to deserialize the block to get the correct fragment\n */\n if (\n (index === 0 || index === domBlocks.length - 1) &&\n node.textContent?.trim() !== NodeApi.string(block[0]) &&\n ElementApi.isElement(block[0]) &&\n !editor.api.isVoid(block[0])\n ) {\n const html = document.createElement('div');\n html.append(node);\n const results = editor.api.html.deserialize({ element: html });\n nodes.push(results[0]);\n } else {\n nodes.push(block[0]);\n }\n });\n\n return nodes;\n};\n","/** Get the DOM node from the DOM selection */\nexport const getSelectedDomNode = () => {\n const selection = window.getSelection();\n\n if (!selection || selection.rangeCount === 0) return;\n const range = selection.getRangeAt(0);\n\n const htmlFragment = range.cloneContents();\n const div = document.createElement('div');\n div.append(htmlFragment);\n\n return div;\n};\n","import { getSelectedDomNode } from './getSelectedDomNode';\n\n/** Check if the DOM selection is outside the editor */\nexport const isSelectOutside = (html?: HTMLElement): boolean => {\n const domNodes = html ?? getSelectedDomNode();\n\n if (!domNodes) return false;\n\n const selectOutside = !!domNodes?.querySelector('[data-slate-editor=\"true\"]');\n\n return selectOutside;\n};\n","import { DOMPlugin } from '../../lib';\nimport { getPlainText } from '../internal/getPlainText';\nimport { getSelectedDomFragment } from '../utils/getSelectedDomFragment';\nimport { getSelectedDomNode } from '../utils/getSelectedDomNode';\nimport { isSelectOutside } from '../utils/isSelectOutside';\n\nexport const ViewPlugin = DOMPlugin.extendEditorApi(({ editor }) => ({\n getFragment() {\n return getSelectedDomFragment(editor);\n },\n})).overrideEditor(({ editor, tf: { setFragmentData } }) => ({\n transforms: {\n setFragmentData(data, originEvent) {\n if (originEvent !== 'copy') return setFragmentData(data, originEvent);\n\n const fragment = getSelectedDomFragment(editor);\n const html = getSelectedDomNode();\n\n if (!html || !fragment) return;\n\n const selectOutside = isSelectOutside(html);\n\n if (selectOutside) return;\n\n // only crossing multiple blocks\n if (fragment.length > 0) {\n const string = JSON.stringify(fragment);\n const encoded = window.btoa(encodeURIComponent(string));\n\n data.setData('application/x-slate-fragment', encoded);\n data.setData('text/html', html.innerHTML);\n data.setData('text/plain', getPlainText(html));\n }\n },\n },\n}));\n","import { ViewPlugin } from './ViewPlugin';\n\nexport const getStaticPlugins = () => {\n const staticPlugins = [ViewPlugin];\n\n return [...staticPlugins];\n};\n","import { type Editor, type Value, createEditor } from '@platejs/slate';\n\nimport type { AnyPluginConfig } from '../../lib/plugin';\nimport type { CorePlugin } from '../../lib/plugins';\n\nimport {\n type CreateSlateEditorOptions,\n type WithSlateOptions,\n withSlate,\n} from '../../lib/editor';\nimport { getStaticPlugins } from '../plugins/getStaticPlugins';\n\ntype CreateStaticEditorOptions<\n V extends Value = Value,\n P extends AnyPluginConfig = CorePlugin,\n> = CreateSlateEditorOptions<V, P> & {};\n\ntype WithStaticOptions<\n V extends Value = Value,\n P extends AnyPluginConfig = CorePlugin,\n> = WithSlateOptions<V, P> & {};\n\nconst withStatic = <\n V extends Value = Value,\n P extends AnyPluginConfig = CorePlugin,\n>(\n editor: Editor,\n options: WithStaticOptions<V, P> = {}\n) => {\n const { plugins = [], ..._rest } = options;\n\n const staticPlugins = getStaticPlugins() as any;\n\n options.plugins = [...staticPlugins, ...plugins];\n\n return withSlate<V, P>(editor, options);\n};\n\nexport const createStaticEditor = <\n V extends Value = Value,\n P extends AnyPluginConfig = CorePlugin,\n>({\n editor = createEditor(),\n ...options\n}: CreateStaticEditorOptions<V, P> = {}) => withStatic<V, P>(editor, options);\n","import React from 'react';\n\nimport type { Path, TElement, TText } from '@platejs/slate';\nimport type { UnknownObject } from '@udecode/utils';\n\nimport { clsx } from 'clsx';\n\nimport type {\n AnyPluginConfig,\n PluginConfig,\n RenderElementProps,\n RenderLeafProps,\n RenderTextProps,\n SlatePluginContext,\n} from '../../lib';\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,\n style: { ...(props.attributes as any).style, ...props.style },\n});\n\nexport type SlateElementProps<\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n> = SlateNodeProps<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 SlateNodeProps<C extends AnyPluginConfig = PluginConfig> =\n SlatePluginContext<C> & {\n /**\n * Optional ref to be merged with `attributes.ref`\n *\n * @default undefined\n */\n ref?: any;\n };\n\nexport type SlateHTMLProps<\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'div',\n> = SlateNodeProps<C> & {\n /** HTML attributes to pass to the underlying HTML element */\n attributes: React.PropsWithoutRef<React.JSX.IntrinsicElements[T]> &\n UnknownObject;\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 StyledSlateElementProps<\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'div',\n> = Omit<SlateElementProps<N, C>, keyof DeprecatedNodeProps> &\n SlateHTMLProps<C, T>;\n\nexport const SlateElement = React.forwardRef(function SlateElement(\n { as: Tag = 'div', children, ...props }: StyledSlateElementProps,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const attributes = useNodeAttributes(props, ref);\n\n const block = !!props.element.id && !!props.editor.api.isBlock(props.element);\n\n return (\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 </Tag>\n );\n}) as <\n N extends TElement = TElement,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'div',\n>(\n props: StyledSlateElementProps<N, C, T>\n) => React.ReactElement;\n\nexport type SlateTextProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n> = SlateNodeProps<C> &\n RenderTextProps<N> &\n DeprecatedNodeProps & {\n attributes: UnknownObject;\n };\n\nexport type StyledSlateTextProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n> = Omit<SlateTextProps<N, C>, keyof DeprecatedNodeProps> &\n SlateHTMLProps<C, T>;\n\nexport const SlateText = React.forwardRef<\n HTMLSpanElement,\n StyledSlateTextProps\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: StyledSlateTextProps<N, C, T>\n) => React.ReactElement;\n\nexport type SlateLeafProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n> = SlateNodeProps<C> &\n RenderLeafProps<N> &\n DeprecatedNodeProps & {\n attributes: UnknownObject;\n inset?: boolean;\n };\n\nexport type StyledSlateLeafProps<\n N extends TText = TText,\n C extends AnyPluginConfig = PluginConfig,\n T extends keyof HTMLElementTagNameMap = 'span',\n> = Omit<SlateLeafProps<N, C>, keyof DeprecatedNodeProps> &\n SlateHTMLProps<C, T>;\n\nconst NonBreakingSpace = () => (\n <span style={{ fontSize: 0, lineHeight: 0 }} contentEditable={false}>\n {String.fromCodePoint(160)}\n </span>\n);\n\nexport const SlateLeaf = React.forwardRef<\n HTMLSpanElement,\n StyledSlateLeafProps\n>(({ as: Tag = 'span', children, inset, ...props }, ref) => {\n const attributes = useNodeAttributes(props, ref);\n\n if (inset) {\n return (\n <>\n <NonBreakingSpace />\n <Tag {...attributes}>\n {children}\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}: StyledSlateLeafProps<N, C, T>) => React.ReactElement;\n","import React from 'react';\n\nexport function createStaticString({ text }: { text: string }) {\n return React.createElement(\n 'span',\n { 'data-slate-string': true },\n text === '' ? '\\uFEFF' : text\n );\n}\n","import type { TElement, TText } from '@platejs/slate';\n\nimport {\n type AnyEditorPlugin,\n type SlateEditor,\n getEditorPlugin,\n keyToDataAttribute,\n} from '../../lib';\n\nexport const getNodeDataAttributes = (\n editor: SlateEditor,\n node: TElement | TText,\n {\n isElement,\n isLeaf,\n isText,\n }: { isElement?: boolean; isLeaf?: boolean; isText?: boolean }\n) => {\n const dataAttributes = Object.keys(node).reduce(\n (acc, key) => {\n if (typeof node[key] === 'object') return acc;\n if (isElement && key === 'children') return acc;\n if ((isLeaf || isText) && key === 'text') return acc;\n\n const plugin = editor.getPlugin({ key });\n\n if (isLeaf && plugin?.node.isLeaf && plugin?.node.isDecoration !== true) {\n return acc;\n }\n\n if (\n isText &&\n plugin?.node.isLeaf &&\n plugin?.node.isDecoration !== false\n ) {\n return acc;\n }\n\n const attributeName = keyToDataAttribute(key);\n\n acc[attributeName] = node[key];\n return acc;\n },\n {} as Record<string, any>\n );\n\n return dataAttributes;\n};\n\nexport const getPluginDataAttributes = (\n editor: SlateEditor,\n plugin: AnyEditorPlugin,\n node: TElement | TText\n) => {\n const isElement = plugin.node.isElement;\n const isLeaf = plugin.node.isLeaf && plugin.node.isDecoration === true;\n const isText = plugin.node.isLeaf && plugin.node.isDecoration === false;\n\n const dataAttributes = getNodeDataAttributes(editor, node, {\n isElement,\n isLeaf,\n isText,\n });\n\n const customAttributes =\n plugin.node.toDataAttributes?.({\n ...(plugin ? (getEditorPlugin(editor, plugin) as any) : {}),\n node,\n }) ?? {};\n\n return { ...dataAttributes, ...customAttributes };\n};\n","import type { TElement, TText } from '@platejs/slate';\nimport type { AnyObject } from '@udecode/utils';\n\nimport clsx from 'clsx';\n\nimport type { SlateRenderNodeProps } from '../types';\n\nimport { pipeInjectNodeProps } from '../../internal/plugin/pipeInjectNodeProps';\nimport {\n type AnyEditorPlugin,\n type SlateEditor,\n getEditorPlugin,\n getPluginNodeProps,\n getSlateClass,\n} from '../../lib';\n\nexport const getRenderNodeStaticProps = ({\n attributes: nodeAttributes,\n editor,\n node,\n plugin,\n props,\n}: {\n editor: SlateEditor;\n props: SlateRenderNodeProps;\n attributes?: AnyObject;\n node?: TElement | TText;\n plugin?: AnyEditorPlugin;\n}): SlateRenderNodeProps => {\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 node,\n plugin,\n props: newProps,\n });\n\n newProps = {\n ...pluginProps,\n attributes: {\n ...pluginProps.attributes,\n className: clsx(getSlateClass(plugin?.node.type), className) || undefined,\n },\n };\n\n newProps = pipeInjectNodeProps(\n editor,\n newProps,\n (node) => editor.api.findPath(node)!\n );\n\n if (newProps.style && Object.keys(newProps.style).length === 0) {\n newProps.style = undefined;\n }\n\n return newProps;\n};\n","/** Get the slate nodes from the DOM selection */\n/** @deprecated Use getSelectedDomFragment instead */\nexport const getSelectedDomBlocks = () => {\n const selection = window.getSelection();\n\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n const fragment = range.cloneContents();\n\n const domBlocks = fragment.querySelectorAll(\n '[data-slate-node=\"element\"][data-slate-id]'\n );\n\n return Array.from(domBlocks);\n};\n","const classAttrRegExp = / class=\"([^\"]*)\"/g;\nconst whitespaceRegExp = /\\s+/;\n\n/**\n * Remove all class names that do not start with one of preserveClassNames\n * (`slate-` by default)\n */\nexport const stripHtmlClassNames = (\n html: string,\n { preserveClassNames = ['slate-'] }: { preserveClassNames?: string[] }\n) => {\n if (preserveClassNames.length === 0) {\n return html.replaceAll(classAttrRegExp, '');\n }\n\n const preserveRegExp = new RegExp(\n preserveClassNames.map((cn) => `^${cn}`).join('|')\n );\n\n return html.replaceAll(\n classAttrRegExp,\n (_match: string, className: string) => {\n const classesToKeep = className\n .split(whitespaceRegExp)\n .filter((cn) => preserveRegExp.test(cn));\n\n return classesToKeep.length === 0\n ? ''\n : ` class=\"${classesToKeep.join(' ')}\"`;\n }\n );\n};\n","// Remove redundant data attributes\nexport const stripSlateDataAttributes = (rawHtml: string): string =>\n rawHtml\n .replaceAll(/ data-slate(?:-node|-type|-leaf|-string)=\"[^\"]+\"/g, '')\n .replaceAll(/ data-testid=\"[^\"]+\"/g, '');\n","import React from 'react';\n\nimport type { AnyEditorPlugin, RenderElementProps, SlateEditor } from '../lib';\n\nimport { SlateElement } from './components/slate-nodes';\nimport { getPluginDataAttributes } from './utils';\nimport { getRenderNodeStaticProps } from './utils/getRenderNodeStaticProps';\n\nexport type SlateRenderElement = (\n props: RenderElementProps\n) => React.ReactElement<any> | undefined;\n\nexport const pluginRenderElementStatic = (\n editor: SlateEditor,\n plugin: AnyEditorPlugin\n): SlateRenderElement =>\n function render(nodeProps) {\n const element = nodeProps.element;\n\n const Component = editor.meta.components?.[plugin.key] as any;\n const Element = Component ?? SlateElement;\n\n let { children } = nodeProps;\n\n const dataAttributes = getPluginDataAttributes(editor, plugin, element);\n\n // biome-ignore lint/style/noParameterAssign: Intentional props accumulation pattern\n nodeProps = getRenderNodeStaticProps({\n attributes: {\n ...(element.attributes as any),\n ...dataAttributes,\n },\n editor,\n node: element,\n plugin,\n props: nodeProps as any,\n }) as any;\n\n editor.meta.pluginCache.render.belowNodes.forEach((key) => {\n const hoc = editor.getPlugin({ key }).render.belowNodes!({\n ...nodeProps,\n key,\n } as any);\n\n if (hoc) {\n children = hoc({ ...nodeProps, children } as any);\n }\n });\n\n const defaultProps = Component ? {} : { as: plugin.render?.as };\n\n let component: React.ReactNode = (\n <Element {...defaultProps} {...nodeProps}>\n {children}\n\n {editor.meta.pluginCache.render.belowRootNodes.map((key) => {\n const plugin = editor.getPlugin({ key }) as any;\n const Component = plugin.render.belowRootNodes;\n\n return <Component key={key} {...defaultProps} {...nodeProps} />;\n })}\n </Element>\n );\n\n editor.meta.pluginCache.render.aboveNodes.forEach((key) => {\n const hoc = editor.getPlugin({ key }).render.aboveNodes!({\n ...nodeProps,\n key,\n } as any);\n\n if (hoc) {\n component = hoc({ ...nodeProps, children: component } as any);\n }\n });\n\n return component;\n };\n","import React from 'react';\n\nimport { type SlateEditor, getPluginByType } from '../lib';\nimport { SlateElement } from './components/slate-nodes';\nimport {\n type SlateRenderElement,\n pluginRenderElementStatic,\n} from './pluginRenderElementStatic';\nimport { getRenderNodeStaticProps } from './utils';\n\nexport const pipeRenderElementStatic = (\n editor: SlateEditor,\n {\n renderElement: renderElementProp,\n }: {\n renderElement?: SlateRenderElement;\n } = {}\n): SlateRenderElement =>\n function render(props) {\n const plugin = getPluginByType(editor, props.element.type);\n\n if (plugin?.node.isElement) {\n return pluginRenderElementStatic(editor, plugin)(props as any);\n }\n\n if (renderElementProp) {\n return renderElementProp(props);\n }\n\n const ctxProps = getRenderNodeStaticProps({\n editor,\n props: { ...props } as any,\n }) as any;\n\n return (\n <SlateElement {...ctxProps}>\n {props.children}\n\n {editor.meta.pluginCache.render.belowRootNodes.map((key) => {\n const plugin = editor.getPlugin({ key }) as any;\n const Component = plugin.render.belowRootNodes;\n\n return <Component key={key} {...ctxProps} />;\n })}\n </SlateElement>\n );\n };\n","import React from 'react';\n\nimport clsx from 'clsx';\n\nimport type { RenderTextProps, SlateEditor, SlatePlugin } from '..';\n\nimport { SlateText } from './components';\nimport { getNodeDataAttributes } from './utils/getNodeDataAttributes';\nimport { getRenderNodeStaticProps } from './utils/getRenderNodeStaticProps';\n\nexport type SlateRenderText = (\n props: RenderTextProps\n) => React.ReactElement<any> | undefined;\n\nexport const pluginRenderTextStatic = (\n editor: SlateEditor,\n plugin: SlatePlugin\n): SlateRenderText =>\n function render(nodeProps) {\n const { children, text } = nodeProps;\n\n if (text[plugin.node.type ?? plugin.key]) {\n const Component = editor.meta.components?.[plugin.key] as any;\n const Text = Component ?? SlateText;\n\n // const dataAttributes = getPluginDataAttributes(editor, plugin, text);\n\n const ctxProps = getRenderNodeStaticProps({\n attributes: { ...(text.attributes as any) },\n editor,\n node: text,\n plugin,\n props: nodeProps as any,\n }) as any;\n\n const defaultProps = Component ? {} : { as: plugin.render?.as };\n\n return (\n <Text {...defaultProps} {...ctxProps}>\n {children}\n </Text>\n );\n }\n\n return children;\n };\n\n/** @see {@link RenderText} */\nexport const pipeRenderTextStatic = (\n editor: SlateEditor,\n { renderText: renderTextProp }: { renderText?: SlateRenderText } = {}\n): SlateRenderText => {\n const renderTexts: SlateRenderText[] = [];\n const textPropsPlugins: SlatePlugin[] = [];\n\n editor.meta.pluginCache.node.isText.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n\n if (plugin) {\n renderTexts.push(pluginRenderTextStatic(editor, plugin as any));\n }\n });\n\n editor.meta.pluginCache.node.textProps.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n if (plugin) {\n textPropsPlugins.push(plugin as any);\n }\n });\n\n return function render({ attributes, ...props }) {\n renderTexts.forEach((render) => {\n const newChildren = render(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 });\n }\n\n const ctxProps = getRenderNodeStaticProps({\n editor,\n props: { attributes, ...props } as any,\n }) as any;\n\n const text = ctxProps.text;\n const dataAttributes = getNodeDataAttributes(editor, text, {\n isText: true,\n });\n\n return (\n <SlateText\n {...ctxProps}\n attributes={{\n ...ctxProps.attributes,\n ...dataAttributes,\n }}\n />\n );\n };\n};\n","import React from 'react';\n\nimport {\n type DecoratedRange,\n type Descendant,\n type NodeEntry,\n type TElement,\n type TText,\n type Value,\n ElementApi,\n isElementDecorationsEqual,\n isTextDecorationsEqual,\n RangeApi,\n TextApi,\n} from '@platejs/slate';\nimport clsx from 'clsx';\n\nimport type { EditableProps, SlateEditor } from '../../lib';\nimport type { SlateRenderElementProps } from '../types';\n\nimport { pipeRenderElementStatic } from '../pipeRenderElementStatic';\nimport { pipeRenderLeafStatic } from '../pluginRenderLeafStatic';\nimport { pipeRenderTextStatic } from '../pluginRenderTextStatic';\nimport { pipeDecorate } from '../utils/pipeDecorate';\n\nfunction BaseElementStatic({\n decorate,\n decorations,\n editor,\n element = { children: [], type: '' },\n}: {\n decorate: EditableProps['decorate'];\n decorations: DecoratedRange[];\n editor: SlateEditor;\n element: TElement;\n style?: React.CSSProperties;\n}) {\n const renderElement = pipeRenderElementStatic(editor);\n\n const attributes: SlateRenderElementProps['attributes'] = {\n 'data-slate-node': 'element',\n ref: null,\n };\n\n let children: React.ReactNode = (\n <Children decorate={decorate} decorations={decorations} editor={editor}>\n {element.children}\n </Children>\n );\n\n if (editor.api.isVoid(element)) {\n attributes['data-slate-void'] = true;\n children = (\n <span\n style={{\n color: 'transparent',\n height: '0',\n outline: 'none',\n position: 'absolute',\n }}\n data-slate-spacer\n >\n <Children decorate={decorate} decorations={decorations} editor={editor}>\n {element.children}\n </Children>\n </span>\n );\n }\n if (editor.api.isInline(element)) {\n attributes['data-slate-inline'] = true;\n }\n\n return <>{renderElement?.({ attributes, children, element })}</>;\n}\n\nexport const ElementStatic = React.memo(\n BaseElementStatic,\n (prev, next) =>\n (prev.element === next.element ||\n (prev.element._memo !== undefined &&\n prev.element._memo === next.element._memo)) &&\n isElementDecorationsEqual(prev.decorations, next.decorations)\n);\n\nfunction BaseLeafStatic({\n decorations,\n editor,\n text = { text: '' },\n}: {\n decorations: DecoratedRange[];\n editor: SlateEditor;\n text: TText;\n}) {\n const renderLeaf = pipeRenderLeafStatic(editor);\n const renderText = pipeRenderTextStatic(editor);\n\n const decoratedLeaves = TextApi.decorations(text, decorations);\n\n const leafElements = decoratedLeaves.map(({ leaf, position }, index) => {\n const leafElement = renderLeaf({\n attributes: { 'data-slate-leaf': true },\n children: (\n <span data-slate-string={true}>\n {leaf.text === '' ? '\\uFEFF' : leaf.text}\n </span>\n ),\n leaf: leaf as TText,\n leafPosition: position,\n text: leaf as TText,\n });\n\n return <React.Fragment key={index}>{leafElement}</React.Fragment>;\n });\n\n return renderText({\n attributes: { 'data-slate-node': 'text' as const, ref: null },\n children: leafElements,\n text: text as TText,\n });\n}\n\nexport const LeafStatic = React.memo(BaseLeafStatic, (prev, next) => {\n return (\n // prev.text === next.text &&\n TextApi.equals(next.text, prev.text) &&\n isTextDecorationsEqual(next.decorations, prev.decorations)\n );\n});\n\nconst defaultDecorate: (entry: NodeEntry) => DecoratedRange[] = () => [];\n\nfunction Children({\n children = [],\n decorate = defaultDecorate,\n decorations = [],\n editor,\n}: {\n children: Descendant[];\n decorate: EditableProps['decorate'];\n decorations: DecoratedRange[];\n editor: SlateEditor;\n}) {\n return (\n <>\n {children.map((child, i) => {\n const p = editor.api.findPath(child);\n\n let ds: DecoratedRange[] = [];\n\n if (p) {\n const range = editor.api.range(p)!;\n ds = decorate([child, p]);\n\n for (const dec of decorations) {\n const d = RangeApi.intersection(dec, range);\n\n if (d) {\n ds.push(d);\n }\n }\n }\n\n return ElementApi.isElement(child) ? (\n <ElementStatic\n key={i}\n decorate={decorate}\n decorations={ds}\n editor={editor}\n element={child}\n />\n ) : (\n <LeafStatic key={i} decorations={ds} editor={editor} text={child} />\n );\n })}\n </>\n );\n}\n\nexport type PlateStaticProps = {\n /** Editor instance. */\n editor: SlateEditor;\n style?: React.CSSProperties;\n /** Controlled value. Alias to `editor.children`. */\n value?: Value;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nexport function PlateStatic(props: PlateStaticProps) {\n const { className, editor, value, ...rest } = props;\n\n if (value) {\n editor.children = value;\n }\n\n const decorate = pipeDecorate(editor);\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 const BeforeEditable = plugin.render.beforeEditable;\n\n if (BeforeEditable) {\n beforeEditable = (\n <>\n {beforeEditable}\n <BeforeEditable />\n </>\n );\n }\n });\n\n editor.meta.pluginCache.render.afterEditable.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n const AfterEditable = plugin.render.afterEditable;\n\n if (AfterEditable) {\n afterEditable = (\n <>\n {afterEditable}\n <AfterEditable />\n </>\n );\n }\n });\n\n const content = (\n <div\n className={clsx('slate-editor', className)}\n data-slate-editor\n data-slate-node=\"value\"\n {...rest}\n >\n <Children decorate={decorate} decorations={[]} editor={editor}>\n {editor.children}\n </Children>\n </div>\n );\n\n let aboveEditable: React.ReactNode = (\n <>\n {beforeEditable}\n {content}\n {afterEditable}\n </>\n );\n\n // Use pre-computed arrays for aboveEditable components\n editor.meta.pluginCache.render.aboveEditable.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n const AboveEditable = plugin.render.aboveEditable;\n\n if (AboveEditable) {\n aboveEditable = <AboveEditable>{aboveEditable}</AboveEditable>;\n }\n });\n\n return aboveEditable;\n}\n","import React from 'react';\n\nimport clsx from 'clsx';\n\nimport type { RenderLeafProps, SlateEditor, SlatePlugin } from '../lib';\n\nimport { SlateLeaf } from './components';\nimport { getNodeDataAttributes } from './utils/getNodeDataAttributes';\nimport { getRenderNodeStaticProps } from './utils/getRenderNodeStaticProps';\n\nexport type SlateRenderLeaf = (\n props: RenderLeafProps\n) => React.ReactElement<any> | undefined;\n\nexport const pluginRenderLeafStatic = (\n editor: SlateEditor,\n plugin: SlatePlugin\n): SlateRenderLeaf =>\n function render(props) {\n const { children, leaf } = props;\n\n if (leaf[plugin.node.type]) {\n const Component = (plugin.render.leaf ??\n editor.meta.components?.[plugin.key]) as any;\n const Leaf = Component ?? SlateLeaf;\n\n const ctxProps = getRenderNodeStaticProps({\n attributes: { ...(leaf.attributes as any) },\n editor,\n node: leaf,\n plugin,\n props: props as any,\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\n/** @see {@link RenderLeaf} */\nexport const pipeRenderLeafStatic = (\n editor: SlateEditor,\n { renderLeaf: renderLeafProp }: { renderLeaf?: SlateRenderLeaf } = {}\n): SlateRenderLeaf => {\n const renderLeafs: SlateRenderLeaf[] = [];\n const leafPropsPlugins: SlatePlugin[] = [];\n\n editor.meta.pluginCache.node.isLeaf.forEach((key) => {\n const plugin = editor.getPlugin({ key });\n\n if (plugin) {\n renderLeafs.push(pluginRenderLeafStatic(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 renderLeafs.forEach((render) => {\n const newChildren = render(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 });\n }\n\n const ctxProps = getRenderNodeStaticProps({\n editor,\n props: { attributes, ...props } as any,\n }) as any;\n\n const leaf = ctxProps.leaf;\n const dataAttributes = getNodeDataAttributes(editor, leaf, {\n isLeaf: true,\n });\n\n return (\n <SlateLeaf\n {...ctxProps}\n attributes={{\n ...ctxProps.attributes,\n ...dataAttributes,\n }}\n />\n );\n };\n};\n","import React from 'react';\n\nimport { decode } from 'html-entities';\n\nimport type { SlateEditor } from '../lib';\nimport type { PlateStaticProps } from './components/PlateStatic';\n\nimport { PlateStatic } from './components/PlateStatic';\nimport { stripHtmlClassNames } from './utils/stripHtmlClassNames';\nimport { stripSlateDataAttributes } from './utils/stripSlateDataAttributes';\n\nconst getReactDOMServer = async () => {\n const ReactDOMServer = (await import('react-dom/server')).default;\n\n return ReactDOMServer;\n};\n\nconst renderComponentToHtml = <P extends {}>(\n ReactDOMServer: any,\n Component: React.ComponentType<P>,\n props: P\n): string =>\n decode(\n ReactDOMServer.renderToStaticMarkup(React.createElement(Component, props))\n );\n\nexport type SerializeHtmlOptions<\n T extends PlateStaticProps = PlateStaticProps,\n> = {\n /** The component used to render the editor content */\n editorComponent?: React.ComponentType<T>;\n /** List of className prefixes to preserve from being stripped out */\n preserveClassNames?: string[];\n /** Props to pass to the editor component */\n props?: Partial<T>;\n /** Enable stripping class names */\n stripClassNames?: boolean;\n /** Enable stripping data attributes */\n stripDataAttributes?: boolean;\n};\n\n/**\n * Serialize the editor content to HTML. By default, uses `PlateStatic` as the\n * editor component, but you can provide a custom component (e.g.\n * `EditorStatic`).\n */\nexport const serializeHtml = async <\n T extends PlateStaticProps = PlateStaticProps,\n>(\n editor: SlateEditor,\n {\n editorComponent: EditorComponent = PlateStatic,\n preserveClassNames,\n props = {},\n stripClassNames = false,\n stripDataAttributes = false,\n }: SerializeHtmlOptions<T> = {}\n): Promise<string> => {\n const ReactDOMServer = await getReactDOMServer();\n\n let htmlString = renderComponentToHtml(ReactDOMServer, EditorComponent, {\n editor,\n ...props,\n } as T);\n\n if (stripClassNames) {\n htmlString = stripHtmlClassNames(htmlString, {\n preserveClassNames,\n });\n }\n if (stripDataAttributes) {\n htmlString = stripSlateDataAttributes(htmlString);\n }\n\n return htmlString;\n};\n","/**\n * Convert HTML string exported from Plate into HTML element.\n *\n * @param html - The HTML string to convert exported from Plate.\n * @returns The Editor element without head and body.\n */\nexport const getEditorDOMFromHtmlString = (html: string) => {\n const node = document.createElement('body');\n node.innerHTML = html;\n const editorNode = node.querySelector('[data-slate-editor=\"true\"]');\n\n return editorNode as HTMLElement;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAwBA,MAAaW,yBACXC,QACAC,QACAC,WACAC,mBAC6C;CAC7C,MAAM,EACJE,KACAC,QAAQ,EAAEJ,WAAWK,sBACnBN;CAEJ,MAAM,EAAEO,SAASC,SAASP;CAE1B,MAAME,OAAOI,WAAWC;AAExB,KAAI,CAACL,KAAM;AACX,KAAI,CAACG,gBAAiB;CAEtB,MAAM,EACJG,YACAC,kBACAC,UAAUZ,OAAOa,QAAQR,IAAI,EAC7BS,OACAC,WAAWH,SACXI,oBACAC,oBACAC,gBACAC,gBACAC,oBACEb;AAIJ,KAAI,CAFgBT,eAAeE,QAAQC,OAAO,CAEjCG,MAAMD,eAAeC,KAAK,CAAC,CAAE;CAE9C,MAAMkB,cAAcR,QAAQ;EAC1B,GAAGP;E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