@seafile/seafile-editor 1.0.4-9 → 1.0.5-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.
- package/dist/constants/event-types.js +3 -1
- package/dist/editors/plain-markdown-editor/code-mirror.js +1 -1
- package/dist/editors/plain-markdown-editor/index.js +1 -1
- package/dist/editors/simple-slate-editor /index.js +14 -2
- package/dist/editors/slate-editor/index.js +15 -3
- package/dist/editors/slate-viewer/index.js +8 -1
- package/dist/editors/slate-viewer/style.css +11 -11
- package/dist/extension/constants/index.js +7 -7
- package/dist/extension/core/utils/index.js +12 -1
- package/dist/extension/plugins/image/helper.js +28 -2
- package/dist/extension/plugins/image/menu/image-menu-popover.js +20 -9
- package/dist/extension/plugins/image/menu/index.js +4 -2
- package/dist/extension/plugins/image/menu/style.css +2 -0
- package/dist/extension/plugins/link/helper.js +41 -2
- package/dist/extension/toolbar/header-toolbar/index.js +5 -2
- package/dist/hooks/use-insert-image.js +36 -0
- package/dist/pages/markdown-editor.js +7 -5
- package/dist/pages/rich-markdown-editor.js +15 -6
- package/dist/pages/simple-editor.js +7 -5
- package/dist/slate-convert/md-to-slate/transform.js +9 -4
- package/dist/slate-convert/slate-to-md/transform.js +3 -0
- package/dist/utils/event-handler.js +4 -0
- package/package.json +1 -1
- package/public/locales/cs/seafile-editor.json +170 -116
- package/public/locales/de/seafile-editor.json +184 -130
- package/public/locales/es/seafile-editor.json +171 -117
- package/public/locales/fr/seafile-editor.json +174 -120
- package/public/locales/it/seafile-editor.json +171 -117
- package/public/locales/ru/seafile-editor.json +171 -117
- package/public/locales/zh-CN/seafile-editor.json +4 -4
|
@@ -65,6 +65,9 @@ const applyMarkForInlineItem = function (result, item) {
|
|
|
65
65
|
result.push(nodes);
|
|
66
66
|
return result;
|
|
67
67
|
}
|
|
68
|
+
if (!textNode.id) {
|
|
69
|
+
textNode['id'] = slugid.nice();
|
|
70
|
+
}
|
|
68
71
|
if (type === 'text') {
|
|
69
72
|
textNode['text'] = value || '';
|
|
70
73
|
result.push(textNode);
|
|
@@ -149,7 +152,9 @@ export const transformListItem = node => {
|
|
|
149
152
|
children: children.map(child => {
|
|
150
153
|
if (child.type === PARAGRAPH) {
|
|
151
154
|
return transformListContent(child);
|
|
152
|
-
} else {
|
|
155
|
+
} else if (child.type === 'code') {
|
|
156
|
+
return transformCodeBlock(child);
|
|
157
|
+
} else if (child.type === 'list') {
|
|
153
158
|
return transformList(child);
|
|
154
159
|
}
|
|
155
160
|
})
|
|
@@ -251,7 +256,7 @@ export const transformCodeBlock = node => {
|
|
|
251
256
|
lang,
|
|
252
257
|
value
|
|
253
258
|
} = node;
|
|
254
|
-
const children = value.split('\n');
|
|
259
|
+
const children = value.split('\n').filter(Boolean);
|
|
255
260
|
return {
|
|
256
261
|
id: slugid.nice(),
|
|
257
262
|
type: CODE_BLOCK,
|
|
@@ -274,7 +279,7 @@ export const transformHtml = node => {
|
|
|
274
279
|
} = new DOMParser().parseFromString(node.value, 'text/html');
|
|
275
280
|
const img = body.firstChild;
|
|
276
281
|
const src = img.getAttribute('src');
|
|
277
|
-
if (src) return defaultTextNode;
|
|
282
|
+
if (!src) return defaultTextNode;
|
|
278
283
|
const alt = img.getAttribute('alt');
|
|
279
284
|
const title = img.getAttribute('title');
|
|
280
285
|
const width = img.getAttribute('width');
|
|
@@ -300,7 +305,7 @@ export const transformHtml = node => {
|
|
|
300
305
|
type: IMAGE,
|
|
301
306
|
children: [generateDefaultText()]
|
|
302
307
|
};
|
|
303
|
-
return [
|
|
308
|
+
return [generateDefaultText(), image, generateDefaultText()];
|
|
304
309
|
}
|
|
305
310
|
return defaultTextNode;
|
|
306
311
|
};
|
|
@@ -140,6 +140,9 @@ const transformListItem = node => {
|
|
|
140
140
|
if (child.type === 'paragraph') {
|
|
141
141
|
return transformListContent(child);
|
|
142
142
|
}
|
|
143
|
+
if (child.type === 'code_block') {
|
|
144
|
+
return transformCodeBlock(child);
|
|
145
|
+
}
|
|
143
146
|
if (child.type === 'unordered_list' || child.type === 'ordered_list') {
|
|
144
147
|
return transformList(child);
|
|
145
148
|
}
|
package/package.json
CHANGED
|
@@ -1,112 +1,151 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
2
|
+
"Bold": "Tučně",
|
|
3
|
+
"Italic": "Kurzíva",
|
|
4
|
+
"Inline_code": "Kód",
|
|
5
|
+
"Header_one": "Záhlaví 1",
|
|
6
|
+
"Header_two": "Záhlaví 2",
|
|
7
|
+
"Header_three": "Záhlaví 3",
|
|
8
|
+
"Header_four": "Záhlaví 4",
|
|
9
|
+
"Header_five": "Záhlaví 5",
|
|
10
|
+
"Header_six": "Záhlaví 6",
|
|
11
|
+
"Paragraph": "Odstavec",
|
|
12
|
+
"Quote": "Citace",
|
|
13
|
+
"Ordered_list": "Číslovaný seznam",
|
|
14
|
+
"Unordered_list": "Nečíslovaný seznam",
|
|
15
|
+
"Check_list_item": "Zkontrolovat položku seznamu",
|
|
16
|
+
"Insert_image": "Vložit obrázek",
|
|
17
|
+
"Insert_formula": "Insert Formula",
|
|
18
|
+
"Formula": "Formula",
|
|
19
|
+
"Insert_file": "Vložit soubor",
|
|
20
|
+
"Code": "Řádkový kód",
|
|
21
|
+
"Code_block": "Blok kódu",
|
|
22
|
+
"Insert_link": "Vložit odkaz",
|
|
23
|
+
"Insert_table": "Vložit tabulku",
|
|
24
|
+
"Save": "Uložit",
|
|
25
|
+
"More": "Více",
|
|
26
|
+
"Invalid_url": "Chybná URL",
|
|
27
|
+
"Link_address": "Adresa odkazu",
|
|
28
|
+
"Image_address": "Adresa obrázku",
|
|
29
|
+
"Submit": "Odeslat",
|
|
30
|
+
"Cancel": "Storno",
|
|
31
|
+
"Switch_to_plain_text_editor": "Přepnout do textového editoru",
|
|
32
|
+
"Switch_to_rich_text_editor": "Přepnout do rozšířeného textového editoru",
|
|
33
|
+
"Switch_to_viewer": "Přepnout do značkovacího prohlížeče",
|
|
34
|
+
"Help": "Pomoc",
|
|
35
|
+
"Remove_table": "Odebrat tabulku",
|
|
36
|
+
"Column": "Sloupec",
|
|
37
|
+
"Row": "Řádek",
|
|
38
|
+
"Insert_row_before": "Insert row before",
|
|
39
|
+
"Insert_row_after": "Insert row after",
|
|
40
|
+
"Insert_column_before": "Insert column before",
|
|
41
|
+
"Insert_column_after": "Insert column after",
|
|
42
|
+
"Remove_row": "Remove row",
|
|
43
|
+
"Remove_column": "Remove column",
|
|
44
|
+
"Insert_row": "Insert row",
|
|
45
|
+
"Insert_column": "Insert column",
|
|
46
|
+
"Set_align": "Nastavit zarovnání",
|
|
47
|
+
"Left": "Vlevo",
|
|
48
|
+
"Center": "Střed",
|
|
49
|
+
"Right": "Vpravo",
|
|
50
|
+
"File_saved": "Soubor uložen",
|
|
51
|
+
"File_failed_to_save": "Soubor nebyl uložen",
|
|
52
|
+
"Star": "Přidat hvězdičku",
|
|
53
|
+
"Unstar": "Odebrat hvězdičku",
|
|
54
|
+
"Back_to_parent_directory": "Zpět do nadřazeného adresáře",
|
|
55
|
+
"Edit": "Upravit",
|
|
56
|
+
"Copy": "Kopírovat",
|
|
57
|
+
"Copied": "Zkopírováno",
|
|
58
|
+
"Internal_link": "Interní odkaz",
|
|
59
|
+
"Copy_internal_link": "Interní odkaz byl zkopírován do schránky",
|
|
60
|
+
"Internal_link_desc": "Interní odkaz směřuje na soubor nebo složku u které má uživatel oprávnění ke čtení.",
|
|
61
|
+
"Share": "Sdílet",
|
|
62
|
+
"Share_link": "Veřejný odkaz",
|
|
63
|
+
"Generate": "Generovat",
|
|
64
|
+
"Add_password_protection": "Přidat ochranu heslem",
|
|
65
|
+
"Password": "Heslo",
|
|
66
|
+
"At_least_8_characters": "nejméně 8 znaků",
|
|
67
|
+
"Password_again": "Heslo znovu",
|
|
68
|
+
"Add_auto_expiration": "Přidat automatickou expiraci",
|
|
69
|
+
"Days": "dní",
|
|
70
|
+
"Please_enter_password": "Zadejte heslo",
|
|
71
|
+
"Greater_than_or_equal_to": "Vyšší nebo rovno",
|
|
72
|
+
"Less_than_or_equal_to": "Nižší nebo rovno",
|
|
73
|
+
"Set_permission": "Nastavit oprávnění",
|
|
74
|
+
"Preview_and_download": "Zobrazit a stáhnout",
|
|
75
|
+
"Preview_only": "Pouze zobrazit",
|
|
76
|
+
"Please_enter_valid_days": "Zadejte platné dny",
|
|
77
|
+
"Please_enter_a_non-negative_integer": "Vložte prosím nezáporné celé číslo",
|
|
78
|
+
"Please_enter_days": "Prosím zadejte dny",
|
|
79
|
+
"Password_is_too_short": "Heslo je příliš krátké.",
|
|
80
|
+
"Passwords_do_not_match": "Hesla nesouhlasí",
|
|
81
|
+
"Return_to_wiki_page": "Návrat na stránku Wiki",
|
|
82
|
+
"Insert_network_image": "Vložit síťový obrázek",
|
|
83
|
+
"Upload_local_image": "Nahrát lokální obrázek",
|
|
84
|
+
"Add_link": "Přidat odkaz",
|
|
85
|
+
"File_history": "Historie souboru",
|
|
86
|
+
"History_version": "Historie verzí",
|
|
87
|
+
"Back_to_viewer": "Zpět na prohlížeč",
|
|
88
|
+
"Link_title": "Název odkazu",
|
|
89
|
+
"Local_draft": "Místní koncept",
|
|
90
|
+
"Use_draft": "Použít koncept",
|
|
91
|
+
"Delete_draft": "Smazat koncept",
|
|
92
|
+
"You_have_an_unsaved_draft_do_you_like_to_use_it": "Máte neuložený koncept. Chcete ho použít?",
|
|
93
|
+
"Local_draft_saved": "Místní koncept byl uložen",
|
|
94
|
+
"New_draft": "Nový návrh",
|
|
95
|
+
"View_draft": "Zobrazit koncept",
|
|
96
|
+
"Publish": "Zveřejnit",
|
|
97
|
+
"This_file_has_a_draft": "Tento soubor má koncept.",
|
|
98
|
+
"Delete": "Smazat",
|
|
99
|
+
"Comments": "Komentáře",
|
|
100
|
+
"Add_a_comment": "Přidat komentář…",
|
|
101
|
+
"No_comment_yet": "Žádné komentáře",
|
|
90
102
|
"Mark_as_Resolved": "Označit jako vyřešené",
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
103
|
+
"Ask_for_review": "Požádat o kontrolu",
|
|
104
|
+
"Review_already_exists": "Kontrola již existuje. ",
|
|
105
|
+
"View_review": "Zobrazit kontrolu",
|
|
106
|
+
"There_is_an_associated_review_with_this_file": "K tomuto souboru je přiřazená kontrola",
|
|
107
|
+
"Start_review": "Začít kontrolu",
|
|
108
|
+
"This_file_is_in_draft_stage": "Tento soubor je ve fázi návrhu.",
|
|
109
|
+
"This_file_is_in_review_stage": "Tento soubor je ve fázi kontroly.",
|
|
110
|
+
"This_file_has_been_updated": "Tento soubor byl aktualizován.",
|
|
111
|
+
"Refresh": "Obnovit",
|
|
112
|
+
"Related_files": "související soubory",
|
|
113
|
+
"Related_file": "související soubor",
|
|
114
|
+
"No_tags": "Žádné značky",
|
|
115
|
+
"Date": "Datum",
|
|
116
|
+
"Participants": "Účastníci",
|
|
117
|
+
"Meeting_note": "Poznámky ze schůzky",
|
|
118
|
+
"Chooser_document_type": "Výběr typu dokumentu",
|
|
119
|
+
"Empty": "Prázdný",
|
|
120
|
+
"No_related_files": "Žádné související soubory",
|
|
121
|
+
"No_out_line": "Bez obrysu",
|
|
122
|
+
"Editing_files_in_this_browser_can_lead_to_slight_display_problems": "Úpravy souborů v tomto prohlížeči mohou způsobit malé problémy se zobrazením.",
|
|
123
|
+
"No_document_improvement_suggestion": "Žádný návrh na zlepšení dokumentu",
|
|
124
|
+
"Hide_side_panel": "Skrýt postranní panel",
|
|
125
|
+
"Show_side_panel": "Zobrazit postranní panel",
|
|
126
|
+
"Show_resolved_comments": "Zobrazit vyřešené komentáře",
|
|
127
|
+
"Update": "Aktualizovat",
|
|
128
|
+
"Width": "Šířka",
|
|
129
|
+
"Height": "Výška",
|
|
130
|
+
"Full_screen": "Celá obrazovka",
|
|
131
|
+
"Insert_library_image": "Vložit obrázek knihovny",
|
|
132
|
+
"Size": "Velikost",
|
|
133
|
+
"Location": "Umístění",
|
|
134
|
+
"Last_update": "Last update",
|
|
135
|
+
"Tags": "Štítky",
|
|
136
|
+
"Add_participants": "Přidat účastníky",
|
|
137
|
+
"Clear_format": "Clear format",
|
|
138
|
+
"Image_address_invalid": "Image address invalid",
|
|
139
|
+
"Shortcut_help": "Shortcut help",
|
|
140
|
+
"Link_address_required": "Link address required",
|
|
141
|
+
"Link_address_invalid": "Link address invalid",
|
|
142
|
+
"Link_title_required": "Link title required",
|
|
143
|
+
"Blank_title_not_allowed": "Blank title not allowed",
|
|
105
144
|
"userHelp": {
|
|
106
145
|
"title": "Klávesové zkratky",
|
|
107
146
|
"userHelpData": [
|
|
108
147
|
{
|
|
109
|
-
"shortcutType":"Seznam zkratek",
|
|
148
|
+
"shortcutType": "Seznam zkratek",
|
|
110
149
|
"shortcutData": {
|
|
111
150
|
"Make_list": "Vytvořit seznam",
|
|
112
151
|
"Make_ordered_list": "Vytvořit číslovaný seznam",
|
|
@@ -114,7 +153,8 @@
|
|
|
114
153
|
"Insert_child_in_item": "Vložit podpoložku",
|
|
115
154
|
"Increase_depth": "Zvýšit hloubku"
|
|
116
155
|
}
|
|
117
|
-
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
118
158
|
"shortcutType": "Zkratky záhlaví",
|
|
119
159
|
"shortcutData": {
|
|
120
160
|
"Heading_1": "Záhlaví 1",
|
|
@@ -124,7 +164,8 @@
|
|
|
124
164
|
"Heading_5": "Záhlaví 5",
|
|
125
165
|
"Heading_6": "Záhlaví 6"
|
|
126
166
|
}
|
|
127
|
-
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
128
169
|
"shortcutType": "Zkratky bloků kódu",
|
|
129
170
|
"shortcutData": {
|
|
130
171
|
"Make_code_block": "Vytvořit blok kódu",
|
|
@@ -132,32 +173,43 @@
|
|
|
132
173
|
"Escape_code_block": "Opustit blok kódu",
|
|
133
174
|
"Insert_indent": "Vložit odrážku"
|
|
134
175
|
}
|
|
135
|
-
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
136
178
|
"shortcutType": "Zkratky bloku citace",
|
|
137
179
|
"shortcutData": {
|
|
138
|
-
"
|
|
139
|
-
"
|
|
180
|
+
"Make_block_quote": "Make block quote",
|
|
181
|
+
"Escape_block_quote": "Escape block quote"
|
|
140
182
|
}
|
|
141
|
-
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
142
185
|
"shortcutType": "Zkratky tabulky",
|
|
143
186
|
"shortcutData": {
|
|
144
|
-
"
|
|
187
|
+
"Insert_table_row": "Insert table tow",
|
|
145
188
|
"Escape_table": "Opustit tabulku"
|
|
146
189
|
}
|
|
147
|
-
},
|
|
148
|
-
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"shortcutType": "Zkratky vzorečku",
|
|
193
|
+
"shortcutData": {
|
|
194
|
+
"Insert_formula": "Insert formula"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"shortcutType": "Řádkové zkratky",
|
|
149
199
|
"shortcutData": {
|
|
150
200
|
"Bold": "Tučně",
|
|
151
201
|
"Italic": "Kurzíva",
|
|
152
|
-
"
|
|
202
|
+
"Italic_bold": "Italic bold",
|
|
153
203
|
"Inline_code": "Řádkový kód"
|
|
154
204
|
}
|
|
155
|
-
},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
156
207
|
"shortcutType": "Uložit zkratky",
|
|
157
208
|
"shortcutData": {
|
|
158
209
|
"Save_file": "Uložit soubor"
|
|
159
210
|
}
|
|
160
|
-
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
161
213
|
"shortcutType": "Zkratky obrázku",
|
|
162
214
|
"shortcutData": {
|
|
163
215
|
"Paste_screen_shot": "Vložit snímek obrazovky",
|
|
@@ -165,5 +217,7 @@
|
|
|
165
217
|
}
|
|
166
218
|
}
|
|
167
219
|
]
|
|
168
|
-
}
|
|
220
|
+
},
|
|
221
|
+
"Select_field": "Select field",
|
|
222
|
+
"Font_style": "Font style"
|
|
169
223
|
}
|