@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.
- package/dist/LexicalHorizontalRuleNode.d.ts +12 -5
- package/dist/LexicalHorizontalRuleNode.dev.js +13 -16
- package/dist/LexicalHorizontalRuleNode.dev.mjs +13 -16
- package/dist/LexicalHorizontalRuleNode.js.flow +0 -2
- package/dist/LexicalHorizontalRuleNode.prod.js +2 -2
- package/dist/LexicalHorizontalRuleNode.prod.mjs +2 -2
- package/package.json +20 -20
- package/src/LexicalHorizontalRuleNode.tsx +13 -22
|
@@ -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
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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,
|
|
10
|
-
return i.jsx(l,{nodeKey:this.__key})}}function
|
|
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
|
|
10
|
-
return u(
|
|
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/
|
|
18
|
-
"@lexical/
|
|
19
|
-
"@lexical/history": "0.48.0",
|
|
20
|
-
"@lexical/
|
|
21
|
-
"@lexical/
|
|
22
|
-
"@lexical/
|
|
23
|
-
"@lexical/
|
|
24
|
-
"@lexical/
|
|
25
|
-
"@lexical/
|
|
26
|
-
"@lexical/
|
|
27
|
-
"@lexical/table": "0.48.0",
|
|
28
|
-
"@lexical/
|
|
29
|
-
"@lexical/text": "0.48.0",
|
|
30
|
-
"@lexical/
|
|
31
|
-
"lexical": "0.48.0",
|
|
32
|
-
"
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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 {
|