You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: shorten line length in code snippet comments to avoid horizontal scrolling (#13217)
prettier doesn't seem to cover that, and horizontal scrolling in the
browser is even more annoying than in the IDE.
Regex used in the search engine: `^[ \t]*\* `
* Determines how the hr element is rendered in the lexical editor. This is only the "initial" / "outer" HTML element.
522
+
* Determines how the hr element is rendered in the
523
+
* lexical editor. This is only the "initial" / "outer"
524
+
* HTML element.
515
525
*/
516
526
createDOM(config:EditorConfig):HTMLElement {
517
527
const element =document.createElement('div')
518
528
returnelement
519
529
}
520
530
521
531
/**
522
-
* Allows you to render a React component within whatever createDOM returns.
532
+
* Allows you to render a React component within
533
+
* whatever createDOM returns.
523
534
*/
524
535
decorate():React.ReactElement {
525
536
return <MyNodeComponentnodeKey={this.__key} />
526
537
}
527
538
528
539
/**
529
-
* Opposite of importDOM, this function defines what happens when you copy a div element from the lexical editor and paste it into another page.
540
+
* Opposite of importDOM, this function defines what
541
+
* happens when you copy a div element from the lexical
542
+
* editor and paste it into another page.
530
543
*
531
-
* This also determines the behavior of lexical's internal Lexical -> HTML converter
544
+
* This also determines the behavior of lexical's
545
+
* internal Lexical -> HTML converter
532
546
*/
533
547
exportDOM(): DOMExportOutput {
534
548
return { element: document.createElement('div') }
535
549
}
536
550
/**
537
-
* Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.
551
+
* Opposite of importJSON. This determines what
552
+
* data is saved in the database / in the lexical
553
+
* editor state.
538
554
*/
539
555
exportJSON(): SerializedLexicalNode {
540
556
return {
@@ -556,18 +572,23 @@ export class MyNode extends DecoratorNode<React.ReactElement> {
556
572
}
557
573
}
558
574
559
-
// This is used in the importDOM method. Totally optional if you do not want your node to be created automatically when copy & pasting certain dom elements
560
-
// into your editor.
575
+
// This is used in the importDOM method. Totally optional
576
+
// if you do not want your node to be created automatically
577
+
// when copy & pasting certain dom elements into your editor.
561
578
function $yourConversionMethod():DOMConversionOutput {
562
579
return { node: $createMyNode() }
563
580
}
564
581
565
-
// This is a utility method to create a new MyNode. Utility methods prefixed with $ make it explicit that this should only be used within lexical
582
+
// This is a utility method to create a new MyNode.
583
+
// Utility methods prefixed with $ make it explicit
584
+
// that this should only be used within lexical
566
585
exportfunction $createMyNode():MyNode {
567
586
return$applyNodeReplacement(newMyNode())
568
587
}
569
588
570
-
// This is just a utility method you can use to check if a node is a MyNode. This also ensures correct typing.
Copy file name to clipboardExpand all lines: docs/rich-text/official-features.mdx
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,12 +124,15 @@ HeadingFeature({
124
124
```ts
125
125
typeIndentFeatureProps= {
126
126
/**
127
-
* The nodes that should not be indented. "type" property of the nodes you don't want to be indented.
128
-
* These can be: "paragraph", "heading", "listitem", "quote" or other indentable nodes if they exist.
127
+
* The nodes that should not be indented. "type"
128
+
* property of the nodes you don't want to be indented.
129
+
* These can be: "paragraph", "heading", "listitem",
130
+
* "quote" or other indentable nodes if they exist.
129
131
*/
130
132
disabledNodes?:string[]
131
133
/**
132
-
* If true, pressing Tab in the middle of a block such as a paragraph or heading will not insert a tabNode.
134
+
* If true, pressing Tab in the middle of a block such
135
+
* as a paragraph or heading will not insert a tabNode.
133
136
* Instead, Tab will only be used for block-level indentation.
134
137
* @defaultfalse
135
138
*/
@@ -180,7 +183,8 @@ type LinkFeatureServerProps = {
180
183
*/
181
184
disableAutoLinks?:'creationOnly'|true
182
185
/**
183
-
* A function or array defining additional fields for the link feature.
186
+
* A function or array defining additional
187
+
* fields for the link feature.
184
188
* These will be displayed in the link editor drawer.
185
189
*/
186
190
fields?:
@@ -235,7 +239,9 @@ LinkFeature({
235
239
```ts
236
240
typeRelationshipFeatureProps= {
237
241
/**
238
-
* Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.
242
+
* Sets a maximum population depth for this relationship,
243
+
* regardless of the remaining depth when the respective
244
+
* field is reached.
239
245
*/
240
246
maxDepth?:number
241
247
} &ExclusiveRelationshipFeatureProps
@@ -274,7 +280,10 @@ type UploadFeatureProps = {
274
280
}
275
281
}
276
282
/**
277
-
* Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.
283
+
* Sets a maximum population depth for this upload
284
+
* (not the fields for this upload), regardless of
285
+
* the remaining depth when the respective field is
0 commit comments