@lexical/react 0.48.0 → 0.48.1-nightly.20260720.0

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.
@@ -6,19 +6,26 @@
6
6
  *
7
7
  */
8
8
  import { $isHorizontalRuleNode, HorizontalRuleNode as BaseHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND, type SerializedHorizontalRuleNode } from '@lexical/extension';
9
- import { type DOMConversionMap } from 'lexical';
9
+ import { type DOMConversionOutput } from 'lexical';
10
10
  import { type JSX } from 'react';
11
11
  export { $isHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND, type SerializedHorizontalRuleNode, };
12
12
  /**
13
13
  * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
14
14
  */
15
15
  export declare class HorizontalRuleNode extends BaseHorizontalRuleNode {
16
- static getType(): string;
17
- static clone(node: HorizontalRuleNode): HorizontalRuleNode;
18
- static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode;
19
- static importDOM(): DOMConversionMap | null;
16
+ $config(): import("lexical").BaseStaticNodeConfig & {
17
+ readonly horizontalrule?: {
18
+ readonly importDOM: {
19
+ readonly hr: () => {
20
+ conversion: typeof $convertHorizontalRuleElement;
21
+ priority: 0;
22
+ };
23
+ };
24
+ } | undefined;
25
+ };
20
26
  decorate(): JSX.Element;
21
27
  }
28
+ declare function $convertHorizontalRuleElement(): DOMConversionOutput;
22
29
  /**
23
30
  * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
24
31
  */
@@ -59,22 +59,19 @@ function HorizontalRuleComponent({
59
59
  * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
60
60
  */
61
61
  class HorizontalRuleNode extends extension.HorizontalRuleNode {
62
- static getType() {
63
- return 'horizontalrule';
64
- }
65
- static clone(node) {
66
- return new HorizontalRuleNode(node.__key);
67
- }
68
- static importJSON(serializedNode) {
69
- return $createHorizontalRuleNode().updateFromJSON(serializedNode);
70
- }
71
- static importDOM() {
72
- return {
73
- hr: () => ({
74
- conversion: $convertHorizontalRuleElement,
75
- priority: 0
76
- })
77
- };
62
+ $config() {
63
+ // `extends` is left to the runtime default (the prototype parent,
64
+ // BaseHorizontalRuleNode) so this deprecated subclass infers a `$config()`
65
+ // shape compatible with the base node it reuses the 'horizontalrule' type
66
+ // from.
67
+ return this.config('horizontalrule', {
68
+ importDOM: {
69
+ hr: () => ({
70
+ conversion: $convertHorizontalRuleElement,
71
+ priority: 0
72
+ })
73
+ }
74
+ });
78
75
  }
79
76
  decorate() {
80
77
  return /*#__PURE__*/jsxRuntime.jsx(HorizontalRuleComponent, {
@@ -58,22 +58,19 @@ function HorizontalRuleComponent({
58
58
  * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
59
59
  */
60
60
  class HorizontalRuleNode extends HorizontalRuleNode$1 {
61
- static getType() {
62
- return 'horizontalrule';
63
- }
64
- static clone(node) {
65
- return new HorizontalRuleNode(node.__key);
66
- }
67
- static importJSON(serializedNode) {
68
- return $createHorizontalRuleNode().updateFromJSON(serializedNode);
69
- }
70
- static importDOM() {
71
- return {
72
- hr: () => ({
73
- conversion: $convertHorizontalRuleElement,
74
- priority: 0
75
- })
76
- };
61
+ $config() {
62
+ // `extends` is left to the runtime default (the prototype parent,
63
+ // BaseHorizontalRuleNode) so this deprecated subclass infers a `$config()`
64
+ // shape compatible with the base node it reuses the 'horizontalrule' type
65
+ // from.
66
+ return this.config('horizontalrule', {
67
+ importDOM: {
68
+ hr: () => ({
69
+ conversion: $convertHorizontalRuleElement,
70
+ priority: 0
71
+ })
72
+ }
73
+ });
77
74
  }
78
75
  decorate() {
79
76
  return /*#__PURE__*/jsx(HorizontalRuleComponent, {
@@ -11,8 +11,6 @@ import type {LexicalNode, LexicalCommand, SerializedLexicalNode} from 'lexical';
11
11
  import {DecoratorNode} from 'lexical';
12
12
  export type SerializedHorizontalRuleNode = SerializedLexicalNode;
13
13
  declare export class HorizontalRuleNode extends DecoratorNode<React.Node> {
14
- static getType(): string;
15
- static clone(node: HorizontalRuleNode): HorizontalRuleNode;
16
14
  createDOM(): HTMLElement;
17
15
  getTextContent(): '\n';
18
16
  updateDOM(): false;
@@ -6,5 +6,5 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalNodeSelection"),o=require("lexical"),n=require("react"),i=require("react/jsx-runtime");function l({nodeKey:e}){const[i]=t.useLexicalComposerContext(),[l,s,a]=r.useLexicalNodeSelection(e);return n.useEffect(()=>o.mergeRegister(i.registerCommand(o.CLICK_COMMAND,t=>{const r=i.getElementByKey(e);return o.getComposedEventTarget(t)===r&&(t.shiftKey||a(),s(!l),!0)},o.COMMAND_PRIORITY_LOW)),[a,i,l,e,s]),n.useEffect(()=>{const t=i.getElementByKey(e),r=i._config.theme.hrSelected??"selected";null!==t&&(l?o.addClassNamesToElement(t,r):o.removeClassNamesFromElement(t,r))},[i,l,e]),null}class s extends e.HorizontalRuleNode{static getType(){return"horizontalrule"}static clone(e){return new s(e.__key)}static importJSON(e){return c().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:a,priority:0})}}decorate(){
10
- return i.jsx(l,{nodeKey:this.__key})}}function a(){return{node:c()}}function c(){return o.$applyNodeReplacement(new s)}exports.$isHorizontalRuleNode=e.$isHorizontalRuleNode,exports.INSERT_HORIZONTAL_RULE_COMMAND=e.INSERT_HORIZONTAL_RULE_COMMAND,exports.$createHorizontalRuleNode=c,exports.HorizontalRuleNode=s;
9
+ "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalNodeSelection"),o=require("lexical"),n=require("react"),i=require("react/jsx-runtime");function l({nodeKey:e}){const[i]=t.useLexicalComposerContext(),[l,s,c]=r.useLexicalNodeSelection(e);return n.useEffect(()=>o.mergeRegister(i.registerCommand(o.CLICK_COMMAND,t=>{const r=i.getElementByKey(e);return o.getComposedEventTarget(t)===r&&(t.shiftKey||c(),s(!l),!0)},o.COMMAND_PRIORITY_LOW)),[c,i,l,e,s]),n.useEffect(()=>{const t=i.getElementByKey(e),r=i._config.theme.hrSelected??"selected";null!==t&&(l?o.addClassNamesToElement(t,r):o.removeClassNamesFromElement(t,r))},[i,l,e]),null}class s extends e.HorizontalRuleNode{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:c,priority:0})}})}decorate(){
10
+ return i.jsx(l,{nodeKey:this.__key})}}function c(){return{node:a()}}function a(){return o.$applyNodeReplacement(new s)}exports.$isHorizontalRuleNode=e.$isHorizontalRuleNode,exports.INSERT_HORIZONTAL_RULE_COMMAND=e.INSERT_HORIZONTAL_RULE_COMMAND,exports.$createHorizontalRuleNode=a,exports.HorizontalRuleNode=s;
@@ -6,5 +6,5 @@
6
6
  *
7
7
  */
8
8
 
9
- import{HorizontalRuleNode as e}from"@lexical/extension";export{$isHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as r}from"@lexical/react/useLexicalNodeSelection";import{$applyNodeReplacement as o,mergeRegister as n,CLICK_COMMAND as i,getComposedEventTarget as c,COMMAND_PRIORITY_LOW as l,addClassNamesToElement as a,removeClassNamesFromElement as m}from"lexical";import{useEffect as s}from"react";import{jsx as u}from"react/jsx-runtime";function p({nodeKey:e}){const[o]=t(),[u,p,x]=r(e);return s(()=>n(o.registerCommand(i,t=>{const r=o.getElementByKey(e);return c(t)===r&&(t.shiftKey||x(),p(!u),!0)},l)),[x,o,u,e,p]),s(()=>{const t=o.getElementByKey(e),r=o._config.theme.hrSelected??"selected";null!==t&&(u?a(t,r):m(t,r))},[o,u,e]),null}class x extends e{static getType(){return"horizontalrule"}static clone(e){return new x(e.__key)}static importJSON(e){return f().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:d,priority:0})}}decorate(){
10
- return u(p,{nodeKey:this.__key})}}function d(){return{node:f()}}function f(){return o(new x)}export{f as $createHorizontalRuleNode,x as HorizontalRuleNode};
9
+ import{HorizontalRuleNode as e}from"@lexical/extension";export{$isHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND}from"@lexical/extension";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as t}from"@lexical/react/useLexicalNodeSelection";import{$applyNodeReplacement as r,mergeRegister as n,CLICK_COMMAND as i,getComposedEventTarget as l,COMMAND_PRIORITY_LOW as c,addClassNamesToElement as m,removeClassNamesFromElement as s}from"lexical";import{useEffect as a}from"react";import{jsx as u}from"react/jsx-runtime";function f({nodeKey:e}){const[r]=o(),[u,f,x]=t(e);return a(()=>n(r.registerCommand(i,o=>{const t=r.getElementByKey(e);return l(o)===t&&(o.shiftKey||x(),f(!u),!0)},c)),[x,r,u,e,f]),a(()=>{const o=r.getElementByKey(e),t=r._config.theme.hrSelected??"selected";null!==o&&(u?m(o,t):s(o,t))},[r,u,e]),null}class x extends e{$config(){return this.config("horizontalrule",{importDOM:{hr:()=>({conversion:d,priority:0})}})}decorate(){
10
+ return u(f,{nodeKey:this.__key})}}function d(){return{node:p()}}function p(){return r(new x)}export{p as $createHorizontalRuleNode,x as HorizontalRuleNode};
package/package.json CHANGED
@@ -8,28 +8,28 @@
8
8
  "rich-text"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.48.0",
11
+ "version": "0.48.1-nightly.20260720.0",
12
12
  "dependencies": {
13
13
  "@floating-ui/react": "^0.27.19",
14
- "@lexical/a11y": "0.48.0",
15
- "@lexical/devtools-core": "0.48.0",
16
- "@lexical/dragon": "0.48.0",
17
- "@lexical/hashtag": "0.48.0",
18
- "@lexical/extension": "0.48.0",
19
- "@lexical/history": "0.48.0",
20
- "@lexical/link": "0.48.0",
21
- "@lexical/mark": "0.48.0",
22
- "@lexical/internal": "0.48.0",
23
- "@lexical/list": "0.48.0",
24
- "@lexical/markdown": "0.48.0",
25
- "@lexical/plain-text": "0.48.0",
26
- "@lexical/rich-text": "0.48.0",
27
- "@lexical/table": "0.48.0",
28
- "@lexical/overflow": "0.48.0",
29
- "@lexical/text": "0.48.0",
30
- "@lexical/yjs": "0.48.0",
31
- "lexical": "0.48.0",
32
- "@lexical/utils": "0.48.0"
14
+ "@lexical/a11y": "0.48.1-nightly.20260720.0",
15
+ "@lexical/devtools-core": "0.48.1-nightly.20260720.0",
16
+ "@lexical/dragon": "0.48.1-nightly.20260720.0",
17
+ "@lexical/extension": "0.48.1-nightly.20260720.0",
18
+ "@lexical/hashtag": "0.48.1-nightly.20260720.0",
19
+ "@lexical/history": "0.48.1-nightly.20260720.0",
20
+ "@lexical/internal": "0.48.1-nightly.20260720.0",
21
+ "@lexical/list": "0.48.1-nightly.20260720.0",
22
+ "@lexical/overflow": "0.48.1-nightly.20260720.0",
23
+ "@lexical/mark": "0.48.1-nightly.20260720.0",
24
+ "@lexical/plain-text": "0.48.1-nightly.20260720.0",
25
+ "@lexical/rich-text": "0.48.1-nightly.20260720.0",
26
+ "@lexical/link": "0.48.1-nightly.20260720.0",
27
+ "@lexical/table": "0.48.1-nightly.20260720.0",
28
+ "@lexical/markdown": "0.48.1-nightly.20260720.0",
29
+ "@lexical/text": "0.48.1-nightly.20260720.0",
30
+ "@lexical/utils": "0.48.1-nightly.20260720.0",
31
+ "@lexical/yjs": "0.48.1-nightly.20260720.0",
32
+ "lexical": "0.48.1-nightly.20260720.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=18.x",
@@ -19,7 +19,6 @@ import {
19
19
  addClassNamesToElement,
20
20
  CLICK_COMMAND,
21
21
  COMMAND_PRIORITY_LOW,
22
- type DOMConversionMap,
23
22
  type DOMConversionOutput,
24
23
  getComposedEventTarget,
25
24
  mergeRegister,
@@ -82,27 +81,19 @@ function HorizontalRuleComponent({nodeKey}: {nodeKey: NodeKey}) {
82
81
  * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
83
82
  */
84
83
  export class HorizontalRuleNode extends BaseHorizontalRuleNode {
85
- static getType(): string {
86
- return 'horizontalrule';
87
- }
88
-
89
- static clone(node: HorizontalRuleNode): HorizontalRuleNode {
90
- return new HorizontalRuleNode(node.__key);
91
- }
92
-
93
- static importJSON(
94
- serializedNode: SerializedHorizontalRuleNode,
95
- ): HorizontalRuleNode {
96
- return $createHorizontalRuleNode().updateFromJSON(serializedNode);
97
- }
98
-
99
- static importDOM(): DOMConversionMap | null {
100
- return {
101
- hr: () => ({
102
- conversion: $convertHorizontalRuleElement,
103
- priority: 0,
104
- }),
105
- };
84
+ $config() {
85
+ // `extends` is left to the runtime default (the prototype parent,
86
+ // BaseHorizontalRuleNode) so this deprecated subclass infers a `$config()`
87
+ // shape compatible with the base node it reuses the 'horizontalrule' type
88
+ // from.
89
+ return this.config('horizontalrule', {
90
+ importDOM: {
91
+ hr: () => ({
92
+ conversion: $convertHorizontalRuleElement,
93
+ priority: 0,
94
+ }),
95
+ },
96
+ });
106
97
  }
107
98
 
108
99
  decorate(): JSX.Element {