New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@udecode/plate-indent-list

Package Overview
Dependencies
Maintainers
2
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@udecode/plate-indent-list - npm Package Compare versions

Comparing version 24.3.2 to 24.3.5

805

dist/index.d.ts

@@ -1,744 +0,11 @@

import { Scope } from 'jotai/core/atom';
import React__default, { FC, ReactNode, KeyboardEvent, ClipboardEvent, CompositionEvent, FocusEvent, FormEvent, SyntheticEvent, MouseEvent, DragEvent, TouchEvent, PointerEvent, UIEvent, WheelEvent, AnimationEvent, TransitionEvent, CSSProperties, ForwardedRef } from 'react';
import { Value as Value$1, TEditor, THistoryEditor, TRange, TElement as TElement$1, EElement, EElementOrText, TText as TText$1, EText, ENodeEntry, TNodeEntry } from '@udecode/slate';
import { TReactEditor, TRenderLeafProps, RenderLeafFn } from '@udecode/slate-react';
import { AnyObject, WithRequired, UnknownObject } from '@udecode/utils';
import { Path, Range } from 'slate';
import { RenderElementProps } from 'slate-react';
import { EditableProps } from 'slate-react/dist/components/editable';
import { EElement as EElement$1, Value as Value$2, TNodeEntry as TNodeEntry$1, EElementOrText as EElementOrText$1, TNode, TEditor as TEditor$1, EElementEntry, TElement as TElement$2, InjectComponentProps as InjectComponentProps$1, InjectComponentReturnType as InjectComponentReturnType$1, ENodeEntry as ENodeEntry$1, PlateEditor as PlateEditor$1, WithPlatePlugin as WithPlatePlugin$1, KeyboardHandlerReturnType } from '@udecode/plate-common';
import * as _udecode_plate_core from '@udecode/plate-core';
import * as _udecode_slate from '@udecode/slate';
import { EElement, Value, TNodeEntry, EElementOrText, TNode, TEditor, EElementEntry, TElement, InjectComponentProps, InjectComponentReturnType, ENodeEntry, PlateEditor, WithPlatePlugin, KeyboardHandlerReturnType } from '@udecode/plate-common';
import { SetIndentOptions } from '@udecode/plate-indent';
import { Path } from 'slate';
type SetRecord<O> = {
[K in keyof O]: (scope?: Scope) => (value: O[K]) => void;
};
/**
* A unique id used as a provider scope.
* Use it if you have multiple `Plate` in the same React tree.
* @default PLATE_SCOPE
*/
type PlateId = string;
type NoInfer<T> = [T][T extends any ? 0 : never];
type Nullable<T> = {
[P in keyof T]: T[P] | null;
};
/**
* If true, the next handlers will be skipped.
*/
type HandlerReturnType = boolean | void;
type DOMHandlerReturnType<EV = {}> = (event: EV) => HandlerReturnType;
type DOMHandler<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>, EV = {}> = (editor: E, plugin: WithPlatePlugin<P, V, E>) => DOMHandlerReturnType<EV>;
interface DOMHandlers<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> {
onCopy?: DOMHandler<P, V, E, ClipboardEvent>;
onCopyCapture?: DOMHandler<P, V, E, ClipboardEvent>;
onCut?: DOMHandler<P, V, E, ClipboardEvent>;
onCutCapture?: DOMHandler<P, V, E, ClipboardEvent>;
onPaste?: DOMHandler<P, V, E, ClipboardEvent>;
onPasteCapture?: DOMHandler<P, V, E, ClipboardEvent>;
onCompositionEnd?: DOMHandler<P, V, E, CompositionEvent>;
onCompositionEndCapture?: DOMHandler<P, V, E, CompositionEvent>;
onCompositionStart?: DOMHandler<P, V, E, CompositionEvent>;
onCompositionStartCapture?: DOMHandler<P, V, E, CompositionEvent>;
onCompositionUpdate?: DOMHandler<P, V, E, CompositionEvent>;
onCompositionUpdateCapture?: DOMHandler<P, V, E, CompositionEvent>;
onFocus?: DOMHandler<P, V, E, FocusEvent>;
onFocusCapture?: DOMHandler<P, V, E, FocusEvent>;
onBlur?: DOMHandler<P, V, E, FocusEvent>;
onBlurCapture?: DOMHandler<P, V, E, FocusEvent>;
onDOMBeforeInput?: DOMHandler<P, V, E, Event>;
onBeforeInput?: DOMHandler<P, V, E, FormEvent>;
onBeforeInputCapture?: DOMHandler<P, V, E, FormEvent>;
onInput?: DOMHandler<P, V, E, FormEvent>;
onInputCapture?: DOMHandler<P, V, E, FormEvent>;
onReset?: DOMHandler<P, V, E, FormEvent>;
onResetCapture?: DOMHandler<P, V, E, FormEvent>;
onSubmit?: DOMHandler<P, V, E, FormEvent>;
onSubmitCapture?: DOMHandler<P, V, E, FormEvent>;
onInvalid?: DOMHandler<P, V, E, FormEvent>;
onInvalidCapture?: DOMHandler<P, V, E, FormEvent>;
onLoad?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onKeyDown?: DOMHandler<P, V, E, KeyboardEvent>;
onKeyDownCapture?: DOMHandler<P, V, E, KeyboardEvent>;
onKeyPress?: DOMHandler<P, V, E, KeyboardEvent>;
onKeyPressCapture?: DOMHandler<P, V, E, KeyboardEvent>;
onKeyUp?: DOMHandler<P, V, E, KeyboardEvent>;
onKeyUpCapture?: DOMHandler<P, V, E, KeyboardEvent>;
onAbort?: DOMHandler<P, V, E, SyntheticEvent>;
onAbortCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onCanPlay?: DOMHandler<P, V, E, SyntheticEvent>;
onCanPlayCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onCanPlayThrough?: DOMHandler<P, V, E, SyntheticEvent>;
onCanPlayThroughCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onDurationChange?: DOMHandler<P, V, E, SyntheticEvent>;
onDurationChangeCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onEmptied?: DOMHandler<P, V, E, SyntheticEvent>;
onEmptiedCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onEncrypted?: DOMHandler<P, V, E, SyntheticEvent>;
onEncryptedCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onEnded?: DOMHandler<P, V, E, SyntheticEvent>;
onEndedCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadedData?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadedDataCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadedMetadata?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadedMetadataCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadStart?: DOMHandler<P, V, E, SyntheticEvent>;
onLoadStartCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onPause?: DOMHandler<P, V, E, SyntheticEvent>;
onPauseCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onPlay?: DOMHandler<P, V, E, SyntheticEvent>;
onPlayCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onPlaying?: DOMHandler<P, V, E, SyntheticEvent>;
onPlayingCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onProgress?: DOMHandler<P, V, E, SyntheticEvent>;
onProgressCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onRateChange?: DOMHandler<P, V, E, SyntheticEvent>;
onRateChangeCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onSeeked?: DOMHandler<P, V, E, SyntheticEvent>;
onSeekedCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onSeeking?: DOMHandler<P, V, E, SyntheticEvent>;
onSeekingCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onStalled?: DOMHandler<P, V, E, SyntheticEvent>;
onStalledCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onSuspend?: DOMHandler<P, V, E, SyntheticEvent>;
onSuspendCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onTimeUpdate?: DOMHandler<P, V, E, SyntheticEvent>;
onTimeUpdateCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onVolumeChange?: DOMHandler<P, V, E, SyntheticEvent>;
onVolumeChangeCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onWaiting?: DOMHandler<P, V, E, SyntheticEvent>;
onWaitingCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onAuxClick?: DOMHandler<P, V, E, MouseEvent>;
onAuxClickCapture?: DOMHandler<P, V, E, MouseEvent>;
onClick?: DOMHandler<P, V, E, MouseEvent>;
onClickCapture?: DOMHandler<P, V, E, MouseEvent>;
onContextMenu?: DOMHandler<P, V, E, MouseEvent>;
onContextMenuCapture?: DOMHandler<P, V, E, MouseEvent>;
onDoubleClick?: DOMHandler<P, V, E, MouseEvent>;
onDoubleClickCapture?: DOMHandler<P, V, E, MouseEvent>;
onDrag?: DOMHandler<P, V, E, DragEvent>;
onDragCapture?: DOMHandler<P, V, E, DragEvent>;
onDragEnd?: DOMHandler<P, V, E, DragEvent>;
onDragEndCapture?: DOMHandler<P, V, E, DragEvent>;
onDragEnter?: DOMHandler<P, V, E, DragEvent>;
onDragEnterCapture?: DOMHandler<P, V, E, DragEvent>;
onDragExit?: DOMHandler<P, V, E, DragEvent>;
onDragExitCapture?: DOMHandler<P, V, E, DragEvent>;
onDragLeave?: DOMHandler<P, V, E, DragEvent>;
onDragLeaveCapture?: DOMHandler<P, V, E, DragEvent>;
onDragOver?: DOMHandler<P, V, E, DragEvent>;
onDragOverCapture?: DOMHandler<P, V, E, DragEvent>;
onDragStart?: DOMHandler<P, V, E, DragEvent>;
onDragStartCapture?: DOMHandler<P, V, E, DragEvent>;
onDrop?: DOMHandler<P, V, E, DragEvent>;
onDropCapture?: DOMHandler<P, V, E, DragEvent>;
onMouseDown?: DOMHandler<P, V, E, MouseEvent>;
onMouseDownCapture?: DOMHandler<P, V, E, MouseEvent>;
onMouseEnter?: DOMHandler<P, V, E, MouseEvent>;
onMouseLeave?: DOMHandler<P, V, E, MouseEvent>;
onMouseMove?: DOMHandler<P, V, E, MouseEvent>;
onMouseMoveCapture?: DOMHandler<P, V, E, MouseEvent>;
onMouseOut?: DOMHandler<P, V, E, MouseEvent>;
onMouseOutCapture?: DOMHandler<P, V, E, MouseEvent>;
onMouseOver?: DOMHandler<P, V, E, MouseEvent>;
onMouseOverCapture?: DOMHandler<P, V, E, MouseEvent>;
onMouseUp?: DOMHandler<P, V, E, MouseEvent>;
onMouseUpCapture?: DOMHandler<P, V, E, MouseEvent>;
onSelect?: DOMHandler<P, V, E, SyntheticEvent>;
onSelectCapture?: DOMHandler<P, V, E, SyntheticEvent>;
onTouchCancel?: DOMHandler<P, V, E, TouchEvent>;
onTouchCancelCapture?: DOMHandler<P, V, E, TouchEvent>;
onTouchEnd?: DOMHandler<P, V, E, TouchEvent>;
onTouchEndCapture?: DOMHandler<P, V, E, TouchEvent>;
onTouchMove?: DOMHandler<P, V, E, TouchEvent>;
onTouchMoveCapture?: DOMHandler<P, V, E, TouchEvent>;
onTouchStart?: DOMHandler<P, V, E, TouchEvent>;
onTouchStartCapture?: DOMHandler<P, V, E, TouchEvent>;
onPointerDown?: DOMHandler<P, V, E, PointerEvent>;
onPointerDownCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerMove?: DOMHandler<P, V, E, PointerEvent>;
onPointerMoveCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerUp?: DOMHandler<P, V, E, PointerEvent>;
onPointerUpCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerCancel?: DOMHandler<P, V, E, PointerEvent>;
onPointerCancelCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerEnter?: DOMHandler<P, V, E, PointerEvent>;
onPointerEnterCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerLeave?: DOMHandler<P, V, E, PointerEvent>;
onPointerLeaveCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerOver?: DOMHandler<P, V, E, PointerEvent>;
onPointerOverCapture?: DOMHandler<P, V, E, PointerEvent>;
onPointerOut?: DOMHandler<P, V, E, PointerEvent>;
onPointerOutCapture?: DOMHandler<P, V, E, PointerEvent>;
onGotPointerCapture?: DOMHandler<P, V, E, PointerEvent>;
onGotPointerCaptureCapture?: DOMHandler<P, V, E, PointerEvent>;
onLostPointerCapture?: DOMHandler<P, V, E, PointerEvent>;
onLostPointerCaptureCapture?: DOMHandler<P, V, E, PointerEvent>;
onScroll?: DOMHandler<P, V, E, UIEvent>;
onScrollCapture?: DOMHandler<P, V, E, UIEvent>;
onWheel?: DOMHandler<P, V, E, WheelEvent>;
onWheelCapture?: DOMHandler<P, V, E, WheelEvent>;
onAnimationStart?: DOMHandler<P, V, E, AnimationEvent>;
onAnimationStartCapture?: DOMHandler<P, V, E, AnimationEvent>;
onAnimationEnd?: DOMHandler<P, V, E, AnimationEvent>;
onAnimationEndCapture?: DOMHandler<P, V, E, AnimationEvent>;
onAnimationIteration?: DOMHandler<P, V, E, AnimationEvent>;
onAnimationIterationCapture?: DOMHandler<P, V, E, AnimationEvent>;
onTransitionEnd?: DOMHandler<P, V, E, TransitionEvent>;
onTransitionEndCapture?: DOMHandler<P, V, E, TransitionEvent>;
}
type DecorateEntry<V extends Value$1 = Value$1> = (entry: ENodeEntry<V>) => Range[] | undefined;
/**
* Property used by Plate to decorate editor ranges.
* If the function returns undefined then no ranges are modified.
* If the function returns an array the returned ranges are merged with the ranges called by other plugins.
*/
type Decorate<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = (editor: PlateEditor<V>, plugin: WithPlatePlugin<P, V, E>) => DecorateEntry<V>;
type DeserializeHtml = {
interface GetSiblingIndentListOptions<N extends EElement<V>, V extends Value = Value> {
getPreviousEntry?: (entry: TNodeEntry<EElementOrText<V>>) => TNodeEntry<N> | undefined;
getNextEntry?: (entry: TNodeEntry<EElementOrText<V>>) => TNodeEntry<N> | undefined;
/**
* List of HTML attribute names to store their values in `node.attributes`.
*/
attributeNames?: string[];
/**
* Deserialize an element.
* Use this instead of plugin.isElement if you don't want the plugin to renderElement.
* @default plugin.isElement
*/
isElement?: boolean;
/**
* Deserialize a leaf.
* Use this instead of plugin.isLeaf if you don't want the plugin to renderLeaf.
* @default plugin.isLeaf
*/
isLeaf?: boolean;
/**
* Deserialize html element to slate node.
*/
getNode?: (element: HTMLElement, node: AnyObject) => AnyObject | undefined | void;
query?: (element: HTMLElement) => boolean;
rules?: {
/**
* Deserialize an element:
* - if this option (string) is in the element attribute names.
* - if this option (object) values match the element attributes.
*/
validAttribute?: string | {
[key: string]: string | string[];
};
/**
* Valid element `className`.
*/
validClassName?: string;
/**
* Valid element `nodeName`.
* Set '*' to allow any node name.
*/
validNodeName?: string | string[];
/**
* Valid element style values.
* Can be a list of string (only one match is needed).
*/
validStyle?: Partial<Record<keyof CSSStyleDeclaration, string | string[] | undefined>>;
}[];
/**
* Whether or not to include deserialized children on this node
*/
withoutChildren?: boolean;
};
type TRenderElementProps<V extends Value$1 = Value$1, N extends TElement$1 = EElement<V>> = Omit<RenderElementProps, 'element'> & {
element: N;
};
type RenderElementFn = (props: TRenderElementProps) => React.ReactElement;
/**
* Element props passed by Plate
*/
type PlateRenderElementProps<V extends Value$1 = Value$1, N extends TElement$1 = EElement<V>> = PlateRenderNodeProps<V> & TRenderElementProps<V, N>;
interface InjectComponentProps<V extends Value$1 = Value$1> extends PlateRenderElementProps<V> {
key: string;
}
type InjectComponentReturnType<V extends Value$1 = Value$1> = React__default.FC<PlateRenderElementProps<V>> | undefined;
type InjectComponent<V extends Value$1 = Value$1> = (props: InjectComponentProps<V>) => InjectComponentReturnType;
interface GetInjectPropsOptions<V extends Value$1 = Value$1> {
/**
* Existing className.
*/
className?: string;
/**
* Style value or className key.
*/
element?: EElement<V>;
/**
* Style value or className key.
*/
text?: EText<V>;
/**
* Existing style.
*/
style?: CSSProperties;
}
interface GetInjectPropsReturnType extends AnyObject {
className?: string;
style?: CSSProperties;
}
interface TransformOptions<V extends Value$1 = Value$1> extends GetInjectPropsOptions<V> {
nodeValue?: any;
value?: any;
}
interface InjectProps<V extends Value$1> {
inject?: {
/**
* Properties used by Plate to inject props into any node `component`.
*/
props?: {
/**
* Object whose keys are node values and values are classNames which will be extended.
*/
classNames?: AnyObject;
/**
* Default node value.
* The node key would be unset if the node value = defaultNodeValue.
*/
defaultNodeValue?: any;
/**
* Node key to map to the styles.
*/
nodeKey?: string;
/**
* Whether to inject the props. If true, overrides all other checks.
*/
query?: (options: NonNullable<NonNullable<InjectProps<V>['inject']>['props']>, nodeProps: GetInjectPropsOptions<V>) => boolean;
/**
* Style key to override.
* @default nodeKey
*/
styleKey?: keyof CSSProperties;
/**
* Transform the className.
* @default clsx(className, classNames[value])
*/
transformClassName?: (options: TransformOptions<V>) => any;
/**
* Transform the node value for the style or className.
* @default nodeValue
*/
transformNodeValue?: (options: TransformOptions<V>) => any;
/**
* Transform the injected props.
*/
transformProps?: (options: TransformOptions<V>, props: GetInjectPropsReturnType) => AnyObject | undefined;
/**
* Transform the style.
* @default { ...style, [styleKey]: value }
*/
transformStyle?: (options: TransformOptions<V>) => CSSProperties;
/**
* List of supported node values.
*/
validNodeValues?: any[];
/**
* Node types required to inject the props.
* @default [ELEMENT_DEFAULT]
*/
validTypes?: string[];
};
};
}
/**
* Function called whenever a change occurs in the editor.
* Return `false` to prevent calling the next plugin handler.
* @see {@link SlatePropsOnChange}
*/
type OnChange<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = (editor: E, plugin: WithPlatePlugin<P, V, E>) => (value: V) => HandlerReturnType;
/**
* The plate plugin component.
*/
type PlatePluginComponent<T = any> = React__default.FC<T>;
type PlatePluginInsertDataOptions = {
data: string;
dataTransfer: DataTransfer;
};
type PlatePluginInsertData<V extends Value$1 = Value$1> = {
/**
* Format to get data. Example data types are text/plain and text/uri-list.
*/
format?: string;
/**
* Query to skip this plugin.
*/
query?: (options: PlatePluginInsertDataOptions) => boolean;
/**
* Deserialize data to fragment
*/
getFragment?: (options: PlatePluginInsertDataOptions) => EElementOrText<V>[] | undefined;
/**
* Function called on `editor.insertData` just before `editor.insertFragment`.
* Default: if the block above the selection is empty and the first fragment node type is not inline,
* set the selected node type to the first fragment node type.
* @return if true, the next handlers will be skipped.
*/
preInsert?: (fragment: EElementOrText<V>[], options: PlatePluginInsertDataOptions) => HandlerReturnType;
/**
* Transform the inserted data.
*/
transformData?: (data: string, options: {
dataTransfer: DataTransfer;
}) => string;
/**
* Transform the fragment to insert.
*/
transformFragment?: (fragment: EElementOrText<V>[], options: PlatePluginInsertDataOptions) => EElementOrText<V>[];
};
/**
* Unique key to store the plugins by key.
*/
type PluginKey = string;
interface PlatePluginKey {
/**
* Property used by Plate to store the plugins by key in `editor.pluginsByKey`.
*/
key?: PluginKey;
}
/**
* Props object or function returning props object.
*/
type PlatePluginProps<V extends Value$1 = Value$1> = AnyObject | ((props: PlateRenderElementProps<V> & PlateRenderLeafProps<V>) => AnyObject | undefined);
/**
* `EditableProps` are passed to the <Editable> component.
*/
type TEditableProps = Omit<EditableProps, 'decorate' | 'renderElement' | 'renderLeaf'> & {
decorate?: (entry: TNodeEntry) => Range[];
renderElement?: RenderElementFn;
renderLeaf?: RenderLeafFn;
};
type RenderAfterEditable = (editableProps: TEditableProps) => React.ReactElement | null;
type SerializeHtml<V extends Value$1 = Value$1> = React__default.FC<PlateRenderElementProps<V> & PlateRenderLeafProps<V>>;
/**
* Plate plugin overriding the `editor` methods.
* Naming convention is `with*`.
*/
type WithOverride<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>, EE extends E = E> = (editor: E, plugin: WithPlatePlugin<P, V, E>) => EE;
/**
* The `PlatePlugin` interface is a base interface for all plugins.
*/
type PlatePlugin<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = Required<PlatePluginKey> & {
editor?: Nullable<{
/**
* Properties used by the `insertData` core plugin to deserialize inserted data to a slate fragment.
* The fragment will be inserted to the editor if not empty.
*/
insertData?: PlatePluginInsertData<V>;
}>;
/**
* Handlers called whenever the corresponding event occurs in the editor.
* Event handlers can return a boolean flag to specify whether the event can be treated as being handled.
* If it returns `true`, the next handlers will not be called.
*/
handlers?: Nullable<DOMHandlers<P, V, E> & {
/**
* @see {@link OnChange}
*/
onChange?: OnChange<P, V, E>;
}>;
/**
* Inject into Plate.
*/
inject?: Nullable<{
/**
* Property used by Plate to inject a component above other plugins `component`.
*/
aboveComponent?: InjectComponent<V>;
/**
* Property used by Plate to inject a component below other plugins `component`, i.e. above its `children`.
*/
belowComponent?: InjectComponent<V>;
/**
* Property that can be used by a plugin to allow other plugins to inject code.
* For example, if multiple plugins have defined
* `inject.editor.insertData.transformData` for `key=KEY_DESERIALIZE_HTML`,
* `insertData` plugin will call all of these `transformData` for `KEY_DESERIALIZE_HTML` plugin.
* Differs from `overrideByKey` as this is not overriding any plugin.
*/
pluginsByKey?: Record<PluginKey, Partial<PlatePlugin<PluginOptions, V, E>>>;
}>;
/**
* Property used by Plate to render nodes of this `type` as elements, i.e. `renderElement`.
*/
isElement?: boolean;
/**
* Property used by `inlineVoid` core plugin to set elements of this `type` as inline.
*/
isInline?: boolean;
/**
* Property used by `isMarkableVoid` core plugin to set void elements of this `type` as markable.
*/
isMarkableVoid?: boolean;
/**
* Property used by Plate to render nodes of this `type` as leaves, i.e. `renderLeaf`.
*/
isLeaf?: boolean;
/**
* Property used by `inlineVoid` core plugin to set elements of this `type` as void.
*/
isVoid?: boolean;
/**
* Property used by Plate to enable/disable the plugin.
*/
enabled?: boolean;
/**
* Extended properties used by any plugin as options.
*/
options?: P;
/**
* Property used by Plate to render a node by type.
* It requires slate node properties to have a `type` property.
* @default key
*/
type?: string;
} & InjectProps<V> & Nullable<{
/**
* React component rendering a slate element or leaf.
* @default DefaultElement | DefaultLeaf
*/
component?: PlatePluginComponent;
/**
* @see {@link Decorate}
*/
decorate?: Decorate<P, V, E>;
/**
* Properties used by the HTML deserializer core plugin for each HTML element.
*/
deserializeHtml?: Nullable<DeserializeHtml>;
/**
* Normalize initial value before passing it into the editor.
* @return normalized value
*/
normalizeInitialValue?: (initialValue: V) => V;
/**
* Property used by Plate to deeply override plugins by key.
*/
overrideByKey?: Record<PluginKey, Partial<PlatePlugin<PluginOptions, V, E>>>;
/**
* Recursive plugin support to allow having multiple plugins in a single plugin.
* Plate eventually flattens all the plugins into the editor.
*/
plugins?: PlatePlugin<PluginOptions, V, E>[];
/**
* Property used by Plate to override node `component` props.
* If function, its returning value will be shallow merged to the old props, with the old props as parameter.
* If object, its value will be shallow merged to the old props.
*/
props?: PlatePluginProps<V>;
/**
* Render a component above `Editable`.
*/
renderAboveEditable?: FC<{
children: ReactNode;
}>;
/**
* Render a component above `Slate`.
*/
renderAboveSlate?: FC<{
children: ReactNode;
}>;
/**
* Render a component after `Editable`.
*/
renderAfterEditable?: RenderAfterEditable;
/**
* Render a component before `Editable`.
*/
renderBeforeEditable?: RenderAfterEditable;
/**
* Property used by `serializeHtml` util to replace `renderElement` and `renderLeaf` when serializing a node of this `type`.
*/
serializeHtml?: SerializeHtml<V>;
/**
* Recursive plugin merging.
* Can be used to derive plugin fields from `editor` and `plugin`.
* The returned value will be deeply merged to the plugin.
*/
then?: (editor: E, plugin: WithPlatePlugin<P, V, E>) => Partial<PlatePlugin<PluginOptions, V, E>> | undefined | void;
/**
* For internal use. Tracks if then has been replaced for recursive calls.
*/
_thenReplaced?: number;
/**
* Hook called when the editor is initialized.
*/
useHooks?: (editor: E, plugin: WithPlatePlugin<P, V, E>) => void;
/**
* Editor method overriders.
*/
withOverrides?: WithOverride<P, V, E>;
}>;
type PluginOptions = AnyObject;
type WithPlatePlugin<P = PluginOptions, V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = WithRequired<PlatePlugin<P, V, E>, 'type' | 'options' | 'inject' | 'editor'>;
type OverrideByKey<V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = Record<PluginKey, Partial<PlatePlugin<{}, V, E>>>;
type PlateStoreState<V extends Value$1 = Value$1, E extends PlateEditor<V> = PlateEditor<V>> = {
/**
* A unique id used as a provider scope.
* Use it if you have multiple `Plate` in the same React tree.
* @default PLATE_SCOPE
*/
id: PlateId;
/**
* Slate editor reference.
* @default pipe(createTEditor(), withPlate({ id, plugins, options, components }))
*/
editor: E;
/**
* Plugins prop passed to `Plate`.
*/
rawPlugins: PlatePlugin<PluginOptions, V, E>[];
readOnly: boolean;
/**
* Flattened plugins.
*/
plugins: WithPlatePlugin<PluginOptions, V, E>[];
/**
* Value of the editor.
* @default [{ type: 'p', children: [{ text: '' }]}]
*/
value: V;
} & Nullable<{
/**
* Whether `Editable` is rendered so slate DOM is resolvable.
*/
isMounted: boolean;
/**
* Version incremented on each editor change.
*/
versionEditor: number;
/**
* Version incremented on each editor.selection change.
*/
versionSelection: number;
/**
* Version incremented when calling `redecorate`.
* This is a dependency of the `decorate` function.
*/
versionDecorate: number;
/**
* Controlled callback called when the editor state changes.
*/
onChange: {
fn: (value: V) => void;
};
/**
* Access the editor object using a React ref.
*/
editorRef: {
ref: ForwardedRef<E>;
};
decorate: {
fn: NonNullable<TEditableProps['decorate']>;
};
renderElement: {
fn: NonNullable<TEditableProps['renderElement']>;
};
renderLeaf: {
fn: NonNullable<TEditableProps['renderLeaf']>;
};
}>;
declare const EXPOSED_STORE_KEYS: (keyof PlateStoreState)[];
type PlateEditorMethods<V extends Value$1 = Value$1> = {
reset: () => void;
redecorate: () => void;
plate: {
set: {
[K in (typeof EXPOSED_STORE_KEYS)[number]]: ReturnType<SetRecord<PlateStoreState<V>>[K]>;
};
};
};
type PlateEditor<V extends Value$1 = Value$1> = TEditor<V> & THistoryEditor<V> & TReactEditor<V> & PlateEditorMethods<V> & {
key: any;
plugins: WithPlatePlugin<{}, V>[];
pluginsByKey: Record<PluginKey, WithPlatePlugin<{}, V>>;
prevSelection: TRange | null;
/**
* Default block factory.
* @default [{ type: getPluginType(editor, ELEMENT_DEFAULT), children: [{ text: '' }] }]
*/
blockFactory: (node?: Partial<TElement$1>, path?: Path) => EElement<V>;
/**
* Editor children factory.
* @default [editor.blockFactory()]
*/
childrenFactory: () => V;
currentKeyboardEvent: KeyboardEvent | null;
};
/**
* Node props passed by Plate
*/
interface PlateRenderNodeProps<V extends Value$1, E extends PlateEditor<V> = PlateEditor<V>> {
className?: string;
editor: E;
/**
* @see {@link NodeProps}
*/
nodeProps?: AnyObject;
}
/**
* Leaf props passed by Plate
*/
type PlateRenderLeafProps<V extends Value$1 = Value$1, N extends TText$1 = EText<V>> = PlateRenderNodeProps<V> & TRenderLeafProps<V, N>;
/**
* `Text` objects represent the nodes that contain the actual text content of a
* Slate document along with any formatting properties. They are always leaf
* nodes in the document tree as they cannot contain any children.
*/
type TText = UnknownObject & {
text: string;
};
/**
* `Element` objects are a type of node in a Slate document that contain other
* element nodes or text nodes. They can be either "blocks" or "inlines"
* depending on the Slate editor's configuration.
*/
type TElement = UnknownObject & {
children: TDescendant[];
type: string;
};
/**
* The `Descendant` union type represents nodes that are descendants in the
* tree. It is returned as a convenience in certain cases to narrow a value
* further than the more generic `Node` union.
*/
type TDescendant = TElement | TText;
type Value = TElement[];
interface GetSiblingIndentListOptions<N extends EElement$1<V>, V extends Value$2 = Value$2> {
getPreviousEntry?: (entry: TNodeEntry$1<EElementOrText$1<V>>) => TNodeEntry$1<N> | undefined;
getNextEntry?: (entry: TNodeEntry$1<EElementOrText$1<V>>) => TNodeEntry$1<N> | undefined;
/**
* Query to validate lookup. If false, check the next sibling.

@@ -759,3 +26,3 @@ */

*/
declare const getSiblingIndentList: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, [node, path]: EElementEntry<V>, { getPreviousEntry, getNextEntry, query, eqIndent, breakQuery, breakOnLowerIndent, breakOnEqIndentNeqListStyleType, }: GetSiblingIndentListOptions<N, V>) => TNodeEntry$1<N> | undefined;
declare const getSiblingIndentList: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, [node, path]: EElementEntry<V>, { getPreviousEntry, getNextEntry, query, eqIndent, breakQuery, breakOnLowerIndent, breakOnEqIndentNeqListStyleType, }: GetSiblingIndentListOptions<N, V>) => TNodeEntry<N> | undefined;

@@ -792,3 +59,3 @@ declare enum ListStyleType {

interface IndentListPlugin {
getSiblingIndentListOptions?: GetSiblingIndentListOptions<TElement$2>;
getSiblingIndentListOptions?: GetSiblingIndentListOptions<TElement>;
/**

@@ -799,13 +66,13 @@ * Map html element to list style type.

}
declare const createIndentListPlugin: <OP = IndentListPlugin, OV extends Value = Value, OE extends PlateEditor<OV> = PlateEditor<OV>>(override?: Partial<PlatePlugin<NoInfer<OP>, OV, OE>> | undefined, overrideByKey?: OverrideByKey<OV, OE> | undefined) => PlatePlugin<NoInfer<OP>, OV, OE>;
declare const createIndentListPlugin: <OP = IndentListPlugin, OV extends _udecode_slate.Value = _udecode_slate.Value, OE extends _udecode_plate_core.PlateEditor<OV> = _udecode_plate_core.PlateEditor<OV>>(override?: Partial<_udecode_plate_core.PlatePlugin<_udecode_plate_core.NoInfer<OP>, OV, OE>> | undefined, overrideByKey?: _udecode_plate_core.OverrideByKey<OV, OE> | undefined) => _udecode_plate_core.PlatePlugin<_udecode_plate_core.NoInfer<OP>, OV, OE>;
declare const injectIndentListComponent: (props: InjectComponentProps$1) => InjectComponentReturnType$1;
declare const injectIndentListComponent: (props: InjectComponentProps) => InjectComponentReturnType;
declare const normalizeIndentList: <V extends Value$2>(editor: TEditor$1<V>, { getSiblingIndentListOptions }?: IndentListPlugin) => ([node, path]: ENodeEntry$1<V>) => void;
declare const normalizeIndentList: <V extends Value>(editor: TEditor<V>, { getSiblingIndentListOptions }?: IndentListPlugin) => ([node, path]: ENodeEntry<V>) => void;
declare const onKeyDownIndentList: <V extends Value$2 = Value$2, E extends PlateEditor$1<V> = PlateEditor$1<V>>(editor: E, plugin: WithPlatePlugin$1<IndentListPlugin, V, E>) => KeyboardHandlerReturnType;
declare const onKeyDownIndentList: <V extends Value = Value, E extends PlateEditor<V> = PlateEditor<V>>(editor: E, plugin: WithPlatePlugin<IndentListPlugin, V, E>) => KeyboardHandlerReturnType;
declare const withIndentList: <V extends Value$2 = Value$2, E extends PlateEditor$1<V> = PlateEditor$1<V>>(editor: E, { options }: WithPlatePlugin$1<IndentListPlugin, V, E>) => E;
declare const withIndentList: <V extends Value = Value, E extends PlateEditor<V> = PlateEditor<V>>(editor: E, { options }: WithPlatePlugin<IndentListPlugin, V, E>) => E;
declare const someIndentList: <V extends Value$2>(editor: PlateEditor$1<V>, type: string) => boolean;
declare const someIndentList: <V extends Value>(editor: PlateEditor<V>, type: string) => boolean;

@@ -828,3 +95,3 @@ declare const useIndentListToolbarButtonState: ({ nodeType, }?: {

*/
declare const normalizeFirstIndentListStart: <V extends Value$2>(editor: TEditor$1<V>, [node, path]: TNodeEntry$1) => true | undefined;
declare const normalizeFirstIndentListStart: <V extends Value>(editor: TEditor<V>, [node, path]: TNodeEntry) => true | undefined;

@@ -834,12 +101,12 @@ /**

*/
declare const normalizeIndentListNotIndented: <V extends Value$2>(editor: TEditor$1<V>, [node, path]: TNodeEntry$1) => true | undefined;
declare const normalizeIndentListNotIndented: <V extends Value>(editor: TEditor<V>, [node, path]: TNodeEntry) => true | undefined;
declare const normalizeNextIndentListStart: <V extends Value$2>(editor: TEditor$1<V>, entry: TNodeEntry$1, prevEntry?: TNodeEntry$1) => boolean;
declare const normalizeIndentListStart: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => boolean;
declare const normalizeNextIndentListStart: <V extends Value>(editor: TEditor<V>, entry: TNodeEntry, prevEntry?: TNodeEntry) => boolean;
declare const normalizeIndentListStart: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => boolean;
declare const areEqListStyleType: <V extends Value$2>(editor: TEditor$1<V>, entries: TNodeEntry$1[], { listStyleType, }: {
declare const areEqListStyleType: <V extends Value>(editor: TEditor<V>, entries: TNodeEntry[], { listStyleType, }: {
listStyleType?: string | undefined;
}) => boolean;
interface GetIndentListSiblingsOptions<N extends EElement$1<V>, V extends Value$2 = Value$2> extends Partial<GetSiblingIndentListOptions<N, V>> {
interface GetIndentListSiblingsOptions<N extends EElement<V>, V extends Value = Value> extends Partial<GetSiblingIndentListOptions<N, V>> {
previous?: boolean;

@@ -849,3 +116,3 @@ current?: boolean;

}
declare const getIndentListSiblings: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, entry: EElementEntry<V>, { previous, current, next, ...options }?: GetIndentListSiblingsOptions<N, V>) => TNodeEntry$1[];
declare const getIndentListSiblings: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, entry: EElementEntry<V>, { previous, current, next, ...options }?: GetIndentListSiblingsOptions<N, V>) => TNodeEntry[];

@@ -855,3 +122,3 @@ /**

*/
declare const getNextIndentList: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => TNodeEntry$1<N> | undefined;
declare const getNextIndentList: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => TNodeEntry<N> | undefined;

@@ -861,3 +128,3 @@ /**

*/
declare const getPreviousIndentList: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => TNodeEntry$1<N> | undefined;
declare const getPreviousIndentList: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, entry: EElementEntry<V>, options?: Partial<GetSiblingIndentListOptions<N, V>> | undefined) => TNodeEntry<N> | undefined;

@@ -868,8 +135,8 @@ /**

*/
declare const getSiblingListStyleType: <V extends Value$2 = Value$2>(editor: PlateEditor$1<V>, { entry, indent, ...options }: {
entry: TNodeEntry$1<TElement$2>;
declare const getSiblingListStyleType: <V extends Value = Value>(editor: PlateEditor<V>, { entry, indent, ...options }: {
entry: TNodeEntry<TElement>;
indent: number;
} & GetIndentListSiblingsOptions<EElement$1<V>, V>) => ListStyleType;
} & GetIndentListSiblingsOptions<EElement<V>, V>) => ListStyleType;
interface IndentListOptions<V extends Value$2 = Value$2> extends SetIndentOptions<V> {
interface IndentListOptions<V extends Value = Value> extends SetIndentOptions<V> {
listStyleType?: ListStyleType | string;

@@ -880,3 +147,3 @@ }

*/
declare const indentList: <V extends Value$2>(editor: PlateEditor$1<V>, { listStyleType, ...options }?: IndentListOptions<V>) => void;
declare const indentList: <V extends Value>(editor: PlateEditor<V>, { listStyleType, ...options }?: IndentListOptions<V>) => void;

@@ -886,5 +153,5 @@ /**

*/
declare const outdentList: <V extends Value$2>(editor: PlateEditor$1<V>, options?: IndentListOptions<V>) => void;
declare const outdentList: <V extends Value>(editor: PlateEditor<V>, options?: IndentListOptions<V>) => void;
declare const setIndentListNode: <V extends Value$2>(editor: TEditor$1<V>, { listStyleType, indent, at, }: {
declare const setIndentListNode: <V extends Value>(editor: TEditor<V>, { listStyleType, indent, at, }: {
listStyleType?: string | undefined;

@@ -899,3 +166,3 @@ indent?: number | undefined;

*/
declare const setIndentListNodes: <V extends Value$2>(editor: TEditor$1<V>, entries: TNodeEntry$1[], { listStyleType, }: {
declare const setIndentListNodes: <V extends Value>(editor: TEditor<V>, entries: TNodeEntry[], { listStyleType, }: {
listStyleType?: string | undefined;

@@ -907,3 +174,3 @@ }) => void;

*/
declare const setIndentListSiblingNodes: <N extends EElement$1<V>, V extends Value$2 = Value$2>(editor: TEditor$1<V>, entry: EElementEntry<V>, { listStyleType, getSiblingIndentListOptions, }: {
declare const setIndentListSiblingNodes: <N extends EElement<V>, V extends Value = Value>(editor: TEditor<V>, entry: EElementEntry<V>, { listStyleType, getSiblingIndentListOptions, }: {
listStyleType?: string | undefined;

@@ -916,3 +183,3 @@ getSiblingIndentListOptions?: GetSiblingIndentListOptions<N, V> | undefined;

*/
declare const toggleIndentList: <V extends Value$2>(editor: PlateEditor$1<V>, options: IndentListOptions<V>) => void;
declare const toggleIndentList: <V extends Value>(editor: PlateEditor<V>, options: IndentListOptions<V>) => void;

@@ -922,3 +189,3 @@ /**

*/
declare const toggleIndentListSet: <V extends Value$2>(editor: TEditor$1<V>, [node]: TNodeEntry$1, { listStyleType, ...options }: IndentListOptions<V>) => true | undefined;
declare const toggleIndentListSet: <V extends Value>(editor: TEditor<V>, [node]: TNodeEntry, { listStyleType, ...options }: IndentListOptions<V>) => true | undefined;

@@ -928,3 +195,3 @@ /**

*/
declare const toggleIndentListUnset: <V extends Value$2>(editor: TEditor$1<V>, [node, path]: TNodeEntry$1, { listStyleType, }: {
declare const toggleIndentListUnset: <V extends Value>(editor: TEditor<V>, [node, path]: TNodeEntry, { listStyleType, }: {
listStyleType?: string | undefined;

@@ -931,0 +198,0 @@ }) => true | undefined;

8

package.json
{
"name": "@udecode/plate-indent-list",
"version": "24.3.2",
"version": "24.3.5",
"description": "Indent list plugin for Plate",

@@ -42,5 +42,5 @@ "license": "MIT",

"dependencies": {
"@udecode/plate-common": "24.3.2",
"@udecode/plate-indent": "24.3.2",
"@udecode/plate-list": "24.3.2",
"@udecode/plate-common": "24.3.5",
"@udecode/plate-indent": "24.3.5",
"@udecode/plate-list": "24.3.5",
"clsx": "^1.2.1"

@@ -47,0 +47,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc