rj-editor 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,10 @@
1
1
  import { type LexicalEditor, type NodeKey } from 'lexical';
2
2
  type CodeBlockActionProps = {
3
+ displayTitle: string;
3
4
  editor: LexicalEditor;
4
5
  language: string;
5
6
  nodeKey: NodeKey;
7
+ title?: string;
6
8
  };
7
- export declare function CodeBlockAction({ editor, language, nodeKey, }: CodeBlockActionProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function CodeBlockAction({ displayTitle, editor, language, nodeKey, title, }: CodeBlockActionProps): import("react/jsx-runtime").JSX.Element | null;
8
10
  export {};
@@ -3,7 +3,7 @@ import { ListItemNode, ListNode } from '@lexical/list';
3
3
  import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
4
4
  import { CodeHighlightNode, CodeNode } from '@lexical/code-core';
5
5
  import { TextNode, type LexicalEditor } from 'lexical';
6
- import { EquationNode, ExtendedTextNode, ImageNode, YouTubeNode, replaceTextNodeWithExtendedTextNode } from '../../nodes/index';
6
+ import { EquationNode, ExtendedCodeNode, ExtendedTextNode, ImageNode, YouTubeNode, replaceCodeNodeWithExtendedCodeNode, replaceTextNodeWithExtendedTextNode } from '../../nodes/index';
7
7
  type CreateInitialConfigOptions = {
8
8
  defaultValue?: string;
9
9
  namespace: string;
@@ -11,7 +11,11 @@ type CreateInitialConfigOptions = {
11
11
  };
12
12
  export declare function createInitialConfig({ defaultValue, namespace, value, }: CreateInitialConfigOptions): {
13
13
  namespace: string;
14
- nodes: (typeof EquationNode | typeof ExtendedTextNode | typeof ImageNode | typeof YouTubeNode | typeof CodeNode | typeof CodeHighlightNode | typeof LinkNode | typeof ListNode | typeof ListItemNode | typeof TableCellNode | typeof TableNode | typeof TableRowNode | {
14
+ nodes: (typeof EquationNode | typeof ExtendedCodeNode | typeof CodeNode | typeof ExtendedTextNode | typeof ImageNode | typeof YouTubeNode | typeof CodeHighlightNode | typeof LinkNode | typeof ListNode | typeof ListItemNode | typeof TableCellNode | typeof TableNode | typeof TableRowNode | {
15
+ replace: typeof CodeNode;
16
+ with: typeof replaceCodeNodeWithExtendedCodeNode;
17
+ withKlass: typeof ExtendedCodeNode;
18
+ } | {
15
19
  replace: typeof TextNode;
16
20
  with: typeof replaceTextNodeWithExtendedTextNode;
17
21
  withKlass: typeof ExtendedTextNode;
@@ -0,0 +1,29 @@
1
+ import { CodeNode, type SerializedCodeNode } from '@lexical/code-core';
2
+ import { type DOMConversionMap, type DOMExportOutput, type EditorConfig, type LexicalEditor, type LexicalNode, type LexicalUpdateJSON, type NodeKey, type Spread } from 'lexical';
3
+ export declare const CODE_BLOCK_TITLE_ATTRIBUTE = "data-rj-code-title";
4
+ export declare const CODE_BLOCK_CUSTOM_TITLE_ATTRIBUTE = "data-rj-code-custom-title";
5
+ export type SerializedExtendedCodeNode = Spread<{
6
+ codeBlockTitle?: string;
7
+ }, SerializedCodeNode>;
8
+ export declare class ExtendedCodeNode extends CodeNode {
9
+ __title: string | undefined;
10
+ static clone(node: ExtendedCodeNode): ExtendedCodeNode;
11
+ static getType(): string;
12
+ static importDOM(): DOMConversionMap | null;
13
+ static importJSON(serializedNode: SerializedExtendedCodeNode): ExtendedCodeNode;
14
+ constructor(language?: string | null | undefined, title?: string | null | undefined, key?: NodeKey);
15
+ afterCloneFrom(prevNode: this): void;
16
+ createDOM(config: EditorConfig): HTMLElement;
17
+ updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
18
+ exportDOM(editor: LexicalEditor): DOMExportOutput;
19
+ updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedExtendedCodeNode>): this;
20
+ exportJSON(): SerializedExtendedCodeNode;
21
+ setTitle(title: string | null | undefined): this;
22
+ getTitle(): string | undefined;
23
+ getDisplayTitle(): string;
24
+ }
25
+ export declare function $createExtendedCodeNode(language?: string | null | undefined, title?: string | null | undefined): ExtendedCodeNode;
26
+ export declare function $isExtendedCodeNode(node: LexicalNode | null | undefined): node is ExtendedCodeNode;
27
+ export declare function getCodeNodeTitle(node: CodeNode): string | undefined;
28
+ export declare function getCodeNodeDisplayTitle(node: CodeNode): string;
29
+ export declare function replaceCodeNodeWithExtendedCodeNode(node: CodeNode): ExtendedCodeNode;
@@ -1,4 +1,5 @@
1
1
  export { $createEquationNode, $isEquationNode, EquationNode, } from './EquationNode';
2
+ export { $createExtendedCodeNode, $isExtendedCodeNode, CODE_BLOCK_CUSTOM_TITLE_ATTRIBUTE, CODE_BLOCK_TITLE_ATTRIBUTE, ExtendedCodeNode, getCodeNodeDisplayTitle, getCodeNodeTitle, replaceCodeNodeWithExtendedCodeNode, } from './ExtendedCodeNode';
2
3
  export { $createExtendedTextNode, $isExtendedTextNode, ExtendedTextNode, replaceTextNodeWithExtendedTextNode, } from './ExtendedTextNode';
3
4
  export { $createImageNode, $isImageNode, ImageNode } from './ImageNode';
4
5
  export { $createYouTubeNode, $isYouTubeNode, YouTubeNode } from './YouTubeNode';
@@ -0,0 +1 @@
1
+ export declare function CodeCompletionPlugin(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare function CodeHighlightPlugin(): null;
@@ -0,0 +1 @@
1
+ export declare function InlineCodeStylePlugin(): null;