Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-website] Feature: Traditional Chinese Localization #6557

Closed
wants to merge 67 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
8eda622
document ZH-Hant localization config
Edit-Mr Aug 13, 2024
23936be
document ZH-Hant localization
Edit-Mr Aug 13, 2024
6305d04
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
00ad771
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
c6287c6
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
097a432
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
7c9e8a8
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
cc8ebf1
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
150cdb6
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
ea9e099
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
bf4a006
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
f2ec29f
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
d0ff6ef
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
88dea7f
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
4a87d4a
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
6bdebd7
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
ea23445
Traditional Chinese Localization
Edit-Mr Aug 14, 2024
94d2f08
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
445ecab
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
ad5cef7
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
54a8f72
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
65de892
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
7a017c4
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
75a9bae
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
77356b2
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
4901e99
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
dd707ff
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
1562d81
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
34a25d8
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
f9b707f
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
c3ab026
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
411b966
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
aa2ec76
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
f4afd52
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
a7de657
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
b9eeeeb
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
27af459
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
8525350
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
7c325af
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
70836bc
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
527249d
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
d771559
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
8f4d267
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
623dcae
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
3f040b2
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
2ea8127
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
7e08786
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
aa48504
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
dfd89f0
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
0b0ce2c
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
71f6553
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
1fe9f99
Traditional Chinese Localization
Edit-Mr Aug 17, 2024
82baaee
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
305b70b
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
980baf7
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
eeb4198
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
70dd799
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
5ea92c0
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
629681b
Traditional Chinese Localization
Edit-Mr Aug 20, 2024
535d691
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
12f7a21
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
10ef893
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
fce9434
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
9877906
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
5f67329
Traditional Chinese Localization
Edit-Mr Aug 21, 2024
59634c4
Merge branch 'facebook:main' into main
Edit-Mr Aug 26, 2024
c94f8d6
Merge branch 'facebook:main' into main
Edit-Mr Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Traditional Chinese Localization
Edit-Mr committed Aug 17, 2024
commit dd707ff7ff0968d4434a1f8364cc5eb04284c9af
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
---
id: 'lexical.LineBreakNode'
title: 'Class: LineBreakNode'
custom_edit_url: null
---

[lexical](../modules/lexical.md).LineBreakNode

## 繼承層級

- [`LexicalNode`](lexical.LexicalNode.md)

↳ **`LineBreakNode`**

## 建構子

### constructor

• **new LineBreakNode**(`key?`): [`LineBreakNode`](lexical.LineBreakNode.md)

#### 參數

| 名稱 | 類型 |
| :----- | :------- |
| `key?` | `string` |

#### 返回

[`LineBreakNode`](lexical.LineBreakNode.md)

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[constructor](lexical.LexicalNode.md#constructor)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:34](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L34)

## 屬性

### constructor

• **constructor**: [`KlassConstructor`](../modules/lexical.md#klassconstructor)\<typeof [`LineBreakNode`](lexical.LineBreakNode.md)\>

#### 覆寫

LexicalNode.constructor

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:25](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L25)

## 函式

### createDOM

▸ **createDOM**(): `HTMLElement`

在和解過程中調用,以確定要插入到 DOM 中的節點。

此函式必須返回正好一個 `HTMLElement`。不支持嵌套元素。

在此更新生命週期階段,請勿嘗試更新 Lexical EditorState。

#### 返回

`HTMLElement`

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[createDOM](lexical.LexicalNode.md#createdom)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:42](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L42)

---

### exportJSON

▸ **exportJSON**(): [`SerializedLexicalNode`](../modules/lexical.md#serializedlexicalnode)

控制此節點如何序列化為 JSON。這對於在共享相同命名空間的 Lexical 編輯器之間進行複製和粘貼非常重要。如果你需要將其序列化為 JSON 以便於持久存儲,也很重要。請參見 [Serialization & Deserialization](https://lexical.dev/docs/concepts/serialization#lexical---html)。

#### 返回

[`SerializedLexicalNode`](../modules/lexical.md#serializedlexicalnode)

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[exportJSON](lexical.LexicalNode.md#exportjson)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:70](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L70)

---

### getTextContent

▸ **getTextContent**(): `"\n"`

返回節點的文本內容。為了實現應有的純文本表示(例如用於複製 + 粘貼),請覆寫此函式。

#### 返回

`"\n"`

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[getTextContent](lexical.LexicalNode.md#gettextcontent)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:38](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L38)

---

### updateDOM

▸ **updateDOM**(): `false`

當節點更改並應更新 DOM 以對齊更新過程中可能發生的任何變更時調用。

返回 "true" 將導致 lexical 卸載並重新創建 DOM 節點(通過調用 createDOM)。例如,如果元素標籤發生變化,則需要執行此操作。

#### 返回

`false`

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[updateDOM](lexical.LexicalNode.md#updatedom)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:46](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L46)

---

### clone

▸ **clone**(`node`): [`LineBreakNode`](lexical.LineBreakNode.md)

克隆此節點,創建一個具有不同鍵的新節點,並將其添加到 EditorState(但不會附加到任何地方!)。所有節點都必須實現此函式。

#### 參數

| 名稱 | 類型 |
| :----- | :------------------------------------------ |
| `node` | [`LineBreakNode`](lexical.LineBreakNode.md) |

#### 返回

[`LineBreakNode`](lexical.LineBreakNode.md)

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[clone](lexical.LexicalNode.md#clone)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:30](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L30)

---

### getType

▸ **getType**(): `string`

返回此節點的字符串類型。每個節點都必須實現此函式,且在編輯器中註冊的節點中必須唯一。

#### 返回

`string`

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[getType](lexical.LexicalNode.md#gettype-1)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:26](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L26)

---

### importDOM

▸ **importDOM**(): `null` \| [`DOMConversionMap`](../modules/lexical.md#domconversionmap)

#### 返回

`null` \| [`DOMConversionMap`](../modules/lexical.md#domconversionmap)

#### 覆寫

LexicalNode.importDOM

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:50](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L50)

---

### importJSON

▸ **importJSON**(`serializedLineBreakNode`): [`LineBreakNode`](lexical.LineBreakNode.md)

控制此節點如何從 JSON 反序列化。這通常是樣板代碼,但提供了節點實現和序列化接口之間的抽象,這在對節點模式進行重大更改(如添加或移除屬性)時非常重要。請參見 [Serialization & Deserialization](https://lexical.dev/docs/concepts/serialization#lexical---html)。

#### 參數

| 名稱 | 類型 |
| :------------------------ | :--------------------------------------------------------------------- |
| `serializedLineBreakNode` | [`SerializedLexicalNode`](../modules/lexical.md#serializedlexicalnode) |

#### 返回

[`LineBreakNode`](lexical.LineBreakNode.md)

#### 覆寫

[LexicalNode](lexical.LexicalNode.md).[importJSON](lexical.LexicalNode.md#importjson)

#### 定義於

[packages/lexical/src/nodes/LexicalLineBreakNode.ts:64](https://github.com/facebook/lexical/tree/main/packages/lexical/src/nodes/LexicalLineBreakNode.ts#L64)
Loading