@blocknote/core 0.13.0 → 0.13.3
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/README.md +6 -2
- package/dist/blocknote.js +5724 -2803
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +7 -7
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/exporters/html/__snapshots__/file/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +7 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +3 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +6 -2
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +3 -0
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +3 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +212 -4
- package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +3 -1
- package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +3 -1
- package/src/api/testUtil/cases/customBlocks.ts +79 -33
- package/src/api/testUtil/cases/customInlineContent.ts +1 -1
- package/src/api/testUtil/cases/customStyles.ts +1 -1
- package/src/api/testUtil/cases/defaultSchema.ts +114 -4
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +162 -0
- package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
- package/src/blocks/FileBlockContent/FileBlockContent.ts +121 -0
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +135 -356
- package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +182 -0
- package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
- package/src/blocks/defaultBlockTypeGuards.ts +53 -1
- package/src/blocks/defaultBlocks.ts +8 -2
- package/src/editor/Block.css +67 -27
- package/src/editor/BlockNoteEditor.ts +14 -10
- package/src/editor/BlockNoteExtensions.ts +1 -1
- package/src/editor/BlockNoteSchema.ts +12 -3
- package/src/extensions/{ImagePanel/ImageToolbarPlugin.ts → FilePanel/FilePanelPlugin.ts} +22 -25
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +14 -2
- package/src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts +43 -12
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +59 -2
- package/src/i18n/locales/en.ts +102 -11
- package/src/i18n/locales/fr.ts +289 -0
- package/src/i18n/locales/index.ts +8 -0
- package/src/i18n/locales/is.ts +288 -0
- package/src/i18n/locales/ja.ts +300 -0
- package/src/i18n/locales/ko.ts +292 -0
- package/src/i18n/locales/nl.ts +101 -8
- package/src/i18n/locales/pl.ts +280 -0
- package/src/i18n/locales/pt.ts +281 -0
- package/src/i18n/locales/vi.ts +281 -0
- package/src/i18n/locales/zh.ts +312 -0
- package/src/index.ts +9 -2
- package/src/pm-nodes/BlockContainer.ts +5 -3
- package/src/schema/blocks/createSpec.ts +1 -0
- package/src/schema/blocks/internal.ts +10 -0
- package/src/schema/blocks/types.ts +41 -5
- package/src/util/string.ts +12 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +228 -42
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +178 -4
- package/types/src/api/testUtil/cases/customStyles.d.ts +178 -4
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +104 -0
- package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +96 -0
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +53 -14
- package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +132 -0
- package/types/src/blocks/VideoBlockContent/videoBlockHelpers.d.ts +4 -0
- package/types/src/blocks/defaultBlockTypeGuards.d.ts +6 -1
- package/types/src/blocks/defaultBlocks.d.ts +356 -8
- package/types/src/editor/BlockNoteEditor.d.ts +5 -5
- package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
- package/types/src/i18n/locales/en.d.ts +49 -7
- package/types/src/i18n/locales/fr.d.ts +2 -0
- package/types/src/i18n/locales/index.d.ts +8 -0
- package/types/src/i18n/locales/is.d.ts +2 -0
- package/types/src/i18n/locales/ja.d.ts +2 -0
- package/types/src/i18n/locales/ko.d.ts +2 -0
- package/types/src/i18n/locales/pl.d.ts +2 -0
- package/types/src/i18n/locales/pt.d.ts +2 -0
- package/types/src/i18n/locales/vi.d.ts +2 -0
- package/types/src/i18n/locales/zh.d.ts +2 -0
- package/types/src/index.d.ts +8 -2
- package/types/src/schema/blocks/internal.d.ts +1 -1
- package/types/src/schema/blocks/types.d.ts +26 -1
- package/types/src/util/string.d.ts +1 -0
- /package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
- /package/types/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNodeSelection, posToDOMRect } from "@tiptap/core";
|
|
1
|
+
import { isNodeSelection, isTextSelection, posToDOMRect } from "@tiptap/core";
|
|
2
2
|
import { EditorState, Plugin, PluginKey, PluginView } from "prosemirror-state";
|
|
3
3
|
import { EditorView } from "prosemirror-view";
|
|
4
4
|
|
|
@@ -22,7 +22,19 @@ export class FormattingToolbarView implements PluginView {
|
|
|
22
22
|
state: EditorState;
|
|
23
23
|
from: number;
|
|
24
24
|
to: number;
|
|
25
|
-
}) => boolean = ({ state }) =>
|
|
25
|
+
}) => boolean = ({ state, from, to, view }) => {
|
|
26
|
+
const { doc, selection } = state;
|
|
27
|
+
const { empty } = selection;
|
|
28
|
+
|
|
29
|
+
// Sometime check for `empty` is not enough.
|
|
30
|
+
// Doubleclick an empty paragraph returns a node size of 2.
|
|
31
|
+
// So we check also for an empty text size.
|
|
32
|
+
const isEmptyTextBlock =
|
|
33
|
+
!doc.textBetween(from, to).length && isTextSelection(state.selection);
|
|
34
|
+
|
|
35
|
+
// check view.hasFocus so that the toolbar doesn't show up when the editor is not focused or when for example a code block is focused
|
|
36
|
+
return !(!view.hasFocus() || empty || isEmptyTextBlock);
|
|
37
|
+
};
|
|
26
38
|
|
|
27
39
|
constructor(
|
|
28
40
|
private readonly editor: BlockNoteEditor<
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from "prosemirror-state";
|
|
1
|
+
import { Plugin, PluginKey, TextSelection } from "prosemirror-state";
|
|
2
2
|
|
|
3
3
|
const PLUGIN_KEY = new PluginKey("non-editable-block");
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// By default, typing with a node selection active will cause ProseMirror to
|
|
5
|
+
// replace the node with one that contains editable content. This plugin blocks
|
|
6
|
+
// this behaviour without also blocking things like keyboard shortcuts:
|
|
7
|
+
//
|
|
8
|
+
// - Lets through key presses that do not include alphanumeric characters. This
|
|
9
|
+
// includes things like backspace/delete/home/end/etc.
|
|
10
|
+
// - Lets through any key presses that include ctrl/meta keys. These will be
|
|
11
|
+
// shortcuts of some kind like ctrl+C/mod+C.
|
|
12
|
+
// - Special case for Enter key which creates a new paragraph block below and
|
|
13
|
+
// sets the selection to it. This is just to bring the UX closer to Notion
|
|
14
|
+
//
|
|
15
|
+
// While a more elegant solution would probably process transactions instead of
|
|
16
|
+
// keystrokes, this brings us most of the way to Notion's UX without much added
|
|
17
|
+
// complexity.
|
|
6
18
|
export const NonEditableBlockPlugin = () => {
|
|
7
19
|
return new Plugin({
|
|
8
20
|
key: PLUGIN_KEY,
|
|
@@ -10,18 +22,37 @@ export const NonEditableBlockPlugin = () => {
|
|
|
10
22
|
handleKeyDown: (view, event) => {
|
|
11
23
|
// Checks for node selection
|
|
12
24
|
if ("node" in view.state.selection) {
|
|
13
|
-
// Checks if key
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
!event.metaKey &&
|
|
20
|
-
!event.shiftKey
|
|
21
|
-
) {
|
|
25
|
+
// Checks if key press uses ctrl/meta modifier
|
|
26
|
+
if (event.ctrlKey || event.metaKey) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// Checks if key press is alphanumeric
|
|
30
|
+
if (event.key.length === 1) {
|
|
22
31
|
event.preventDefault();
|
|
32
|
+
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
// Checks if key press is Enter
|
|
36
|
+
if (event.key === "Enter") {
|
|
37
|
+
const tr = view.state.tr;
|
|
38
|
+
view.dispatch(
|
|
39
|
+
tr
|
|
40
|
+
.insert(
|
|
41
|
+
view.state.tr.selection.$to.after(),
|
|
42
|
+
view.state.schema.nodes["paragraph"].create()
|
|
43
|
+
)
|
|
44
|
+
.setSelection(
|
|
45
|
+
new TextSelection(
|
|
46
|
+
tr.doc.resolve(view.state.tr.selection.$to.after() + 1)
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return true;
|
|
23
52
|
}
|
|
24
53
|
}
|
|
54
|
+
|
|
55
|
+
return false;
|
|
25
56
|
},
|
|
26
57
|
},
|
|
27
58
|
});
|
|
@@ -188,9 +188,9 @@ export function getDefaultSlashMenuItems<
|
|
|
188
188
|
type: "image",
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
// Immediately open the
|
|
191
|
+
// Immediately open the file toolbar
|
|
192
192
|
editor.prosemirrorView.dispatch(
|
|
193
|
-
editor._tiptapEditor.state.tr.setMeta(editor.
|
|
193
|
+
editor._tiptapEditor.state.tr.setMeta(editor.filePanel!.plugin, {
|
|
194
194
|
block: insertedBlock,
|
|
195
195
|
})
|
|
196
196
|
);
|
|
@@ -200,6 +200,63 @@ export function getDefaultSlashMenuItems<
|
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
if (checkDefaultBlockTypeInSchema("video", editor)) {
|
|
204
|
+
items.push({
|
|
205
|
+
onItemClick: () => {
|
|
206
|
+
const insertedBlock = insertOrUpdateBlock(editor, {
|
|
207
|
+
type: "video",
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Immediately open the file toolbar
|
|
211
|
+
editor.prosemirrorView.dispatch(
|
|
212
|
+
editor._tiptapEditor.state.tr.setMeta(editor.filePanel!.plugin, {
|
|
213
|
+
block: insertedBlock,
|
|
214
|
+
})
|
|
215
|
+
);
|
|
216
|
+
},
|
|
217
|
+
key: "video",
|
|
218
|
+
...editor.dictionary.slash_menu.video,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (checkDefaultBlockTypeInSchema("audio", editor)) {
|
|
223
|
+
items.push({
|
|
224
|
+
onItemClick: () => {
|
|
225
|
+
const insertedBlock = insertOrUpdateBlock(editor, {
|
|
226
|
+
type: "audio",
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
// Immediately open the file toolbar
|
|
230
|
+
editor.prosemirrorView.dispatch(
|
|
231
|
+
editor._tiptapEditor.state.tr.setMeta(editor.filePanel!.plugin, {
|
|
232
|
+
block: insertedBlock,
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
},
|
|
236
|
+
key: "audio",
|
|
237
|
+
...editor.dictionary.slash_menu.audio,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (checkDefaultBlockTypeInSchema("file", editor)) {
|
|
242
|
+
items.push({
|
|
243
|
+
onItemClick: () => {
|
|
244
|
+
const insertedBlock = insertOrUpdateBlock(editor, {
|
|
245
|
+
type: "file",
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
// Immediately open the file toolbar
|
|
249
|
+
editor.prosemirrorView.dispatch(
|
|
250
|
+
editor._tiptapEditor.state.tr.setMeta(editor.filePanel!.plugin, {
|
|
251
|
+
block: insertedBlock,
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
},
|
|
255
|
+
key: "image",
|
|
256
|
+
...editor.dictionary.slash_menu.file,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
203
260
|
return items;
|
|
204
261
|
}
|
|
205
262
|
|
package/src/i18n/locales/en.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const en = {
|
|
|
38
38
|
},
|
|
39
39
|
table: {
|
|
40
40
|
title: "Table",
|
|
41
|
-
subtext: "Used for
|
|
41
|
+
subtext: "Used for tables",
|
|
42
42
|
aliases: ["table"],
|
|
43
43
|
group: "Advanced",
|
|
44
44
|
},
|
|
@@ -53,11 +53,43 @@ export const en = {
|
|
|
53
53
|
"picture",
|
|
54
54
|
"media",
|
|
55
55
|
"url",
|
|
56
|
-
"drive",
|
|
57
|
-
"dropbox",
|
|
58
56
|
],
|
|
59
57
|
group: "Media",
|
|
60
58
|
},
|
|
59
|
+
video: {
|
|
60
|
+
title: "Video",
|
|
61
|
+
subtext: "Insert a video",
|
|
62
|
+
aliases: [
|
|
63
|
+
"video",
|
|
64
|
+
"videoUpload",
|
|
65
|
+
"upload",
|
|
66
|
+
"mp4",
|
|
67
|
+
"film",
|
|
68
|
+
"media",
|
|
69
|
+
"url",
|
|
70
|
+
],
|
|
71
|
+
group: "Media",
|
|
72
|
+
},
|
|
73
|
+
audio: {
|
|
74
|
+
title: "Audio",
|
|
75
|
+
subtext: "Insert audio",
|
|
76
|
+
aliases: [
|
|
77
|
+
"audio",
|
|
78
|
+
"audioUpload",
|
|
79
|
+
"upload",
|
|
80
|
+
"mp3",
|
|
81
|
+
"sound",
|
|
82
|
+
"media",
|
|
83
|
+
"url",
|
|
84
|
+
],
|
|
85
|
+
group: "Media",
|
|
86
|
+
},
|
|
87
|
+
file: {
|
|
88
|
+
title: "File",
|
|
89
|
+
subtext: "Insert a file",
|
|
90
|
+
aliases: ["file", "upload", "embed", "media", "url"],
|
|
91
|
+
group: "Media",
|
|
92
|
+
},
|
|
61
93
|
},
|
|
62
94
|
placeholders: {
|
|
63
95
|
default: "Enter text or type '/' for commands",
|
|
@@ -65,8 +97,19 @@ export const en = {
|
|
|
65
97
|
bulletListItem: "List",
|
|
66
98
|
numberedListItem: "List",
|
|
67
99
|
},
|
|
68
|
-
|
|
69
|
-
|
|
100
|
+
file_blocks: {
|
|
101
|
+
image: {
|
|
102
|
+
add_button_text: "Add image",
|
|
103
|
+
},
|
|
104
|
+
video: {
|
|
105
|
+
add_button_text: "Add video",
|
|
106
|
+
},
|
|
107
|
+
audio: {
|
|
108
|
+
add_button_text: "Add audio",
|
|
109
|
+
},
|
|
110
|
+
file: {
|
|
111
|
+
add_button_text: "Add file",
|
|
112
|
+
},
|
|
70
113
|
},
|
|
71
114
|
// from react package:
|
|
72
115
|
side_menu: {
|
|
@@ -134,12 +177,50 @@ export const en = {
|
|
|
134
177
|
tooltip: "Create link",
|
|
135
178
|
secondary_tooltip: "Mod+K",
|
|
136
179
|
},
|
|
137
|
-
|
|
180
|
+
file_caption: {
|
|
138
181
|
tooltip: "Edit caption",
|
|
139
182
|
input_placeholder: "Edit caption",
|
|
140
183
|
},
|
|
141
|
-
|
|
142
|
-
tooltip:
|
|
184
|
+
file_replace: {
|
|
185
|
+
tooltip: {
|
|
186
|
+
image: "Replace image",
|
|
187
|
+
video: "Replace video",
|
|
188
|
+
audio: "Replace audio",
|
|
189
|
+
file: "Replace file",
|
|
190
|
+
} as Record<string, string>,
|
|
191
|
+
},
|
|
192
|
+
file_rename: {
|
|
193
|
+
tooltip: {
|
|
194
|
+
image: "Rename image",
|
|
195
|
+
video: "Rename video",
|
|
196
|
+
audio: "Rename audio",
|
|
197
|
+
file: "Rename file",
|
|
198
|
+
} as Record<string, string>,
|
|
199
|
+
input_placeholder: {
|
|
200
|
+
image: "Rename image",
|
|
201
|
+
video: "Rename video",
|
|
202
|
+
audio: "Rename audio",
|
|
203
|
+
file: "Rename file",
|
|
204
|
+
} as Record<string, string>,
|
|
205
|
+
},
|
|
206
|
+
file_download: {
|
|
207
|
+
tooltip: {
|
|
208
|
+
image: "Download image",
|
|
209
|
+
video: "Download video",
|
|
210
|
+
audio: "Download audio",
|
|
211
|
+
file: "Download file",
|
|
212
|
+
} as Record<string, string>,
|
|
213
|
+
},
|
|
214
|
+
file_delete: {
|
|
215
|
+
tooltip: {
|
|
216
|
+
image: "Delete image",
|
|
217
|
+
video: "Delete video",
|
|
218
|
+
audio: "Delete audio",
|
|
219
|
+
file: "Delete file",
|
|
220
|
+
} as Record<string, string>,
|
|
221
|
+
},
|
|
222
|
+
file_preview_toggle: {
|
|
223
|
+
tooltip: "Toggle preview",
|
|
143
224
|
},
|
|
144
225
|
nest: {
|
|
145
226
|
tooltip: "Nest block",
|
|
@@ -162,15 +243,25 @@ export const en = {
|
|
|
162
243
|
tooltip: "Justify text",
|
|
163
244
|
},
|
|
164
245
|
},
|
|
165
|
-
|
|
246
|
+
file_panel: {
|
|
166
247
|
upload: {
|
|
167
248
|
title: "Upload",
|
|
168
|
-
file_placeholder:
|
|
249
|
+
file_placeholder: {
|
|
250
|
+
image: "Upload image",
|
|
251
|
+
video: "Upload video",
|
|
252
|
+
audio: "Upload audio",
|
|
253
|
+
file: "Upload file",
|
|
254
|
+
} as Record<string, string>,
|
|
169
255
|
upload_error: "Error: Upload failed",
|
|
170
256
|
},
|
|
171
257
|
embed: {
|
|
172
258
|
title: "Embed",
|
|
173
|
-
embed_button:
|
|
259
|
+
embed_button: {
|
|
260
|
+
image: "Embed image",
|
|
261
|
+
video: "Embed video",
|
|
262
|
+
audio: "Embed audio",
|
|
263
|
+
file: "Embed file",
|
|
264
|
+
} as Record<string, string>,
|
|
174
265
|
url_placeholder: "Enter URL",
|
|
175
266
|
},
|
|
176
267
|
},
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { Dictionary } from "../dictionary";
|
|
2
|
+
|
|
3
|
+
export const fr: Dictionary = {
|
|
4
|
+
slash_menu: {
|
|
5
|
+
heading: {
|
|
6
|
+
title: "Titre 1",
|
|
7
|
+
subtext: "Utilisé pour un titre de premier niveau",
|
|
8
|
+
aliases: ["h", "titre1", "h1"],
|
|
9
|
+
group: "Titres",
|
|
10
|
+
},
|
|
11
|
+
heading_2: {
|
|
12
|
+
title: "Titre 2",
|
|
13
|
+
subtext: "Utilisé pour les sections clés",
|
|
14
|
+
aliases: ["h2", "titre2", "sous-titre"],
|
|
15
|
+
group: "Titres",
|
|
16
|
+
},
|
|
17
|
+
heading_3: {
|
|
18
|
+
title: "Titre 3",
|
|
19
|
+
subtext: "Utilisé pour les sous-sections et les titres de groupe",
|
|
20
|
+
aliases: ["h3", "titre3", "sous-titre"],
|
|
21
|
+
group: "Titres",
|
|
22
|
+
},
|
|
23
|
+
numbered_list: {
|
|
24
|
+
title: "Liste Numérotée",
|
|
25
|
+
subtext: "Utilisé pour afficher une liste numérotée",
|
|
26
|
+
aliases: ["ol", "li", "liste", "listenumérotée", "liste numérotée"],
|
|
27
|
+
group: "Blocs de base",
|
|
28
|
+
},
|
|
29
|
+
bullet_list: {
|
|
30
|
+
title: "Liste à Puces",
|
|
31
|
+
subtext: "Utilisé pour afficher une liste non ordonnée",
|
|
32
|
+
aliases: ["ul", "li", "liste", "listeàpuces", "liste à puces"],
|
|
33
|
+
group: "Blocs de base",
|
|
34
|
+
},
|
|
35
|
+
paragraph: {
|
|
36
|
+
title: "Paragraphe",
|
|
37
|
+
subtext: "Utilisé pour le corps de votre document",
|
|
38
|
+
aliases: ["p", "paragraphe"],
|
|
39
|
+
group: "Blocs de base",
|
|
40
|
+
},
|
|
41
|
+
table: {
|
|
42
|
+
title: "Tableau",
|
|
43
|
+
subtext: "Utilisé pour les tableaux",
|
|
44
|
+
aliases: ["tableau"],
|
|
45
|
+
group: "Avancé",
|
|
46
|
+
},
|
|
47
|
+
image: {
|
|
48
|
+
title: "Image",
|
|
49
|
+
subtext: "Insérer une image",
|
|
50
|
+
aliases: [
|
|
51
|
+
"image",
|
|
52
|
+
"uploadImage",
|
|
53
|
+
"télécharger",
|
|
54
|
+
"img",
|
|
55
|
+
"photo",
|
|
56
|
+
"média",
|
|
57
|
+
"url",
|
|
58
|
+
],
|
|
59
|
+
group: "Médias",
|
|
60
|
+
},
|
|
61
|
+
video: {
|
|
62
|
+
title: "Vidéo",
|
|
63
|
+
subtext: "Insérer une vidéo",
|
|
64
|
+
aliases: [
|
|
65
|
+
"vidéo",
|
|
66
|
+
"téléchargerVidéo",
|
|
67
|
+
"téléverser",
|
|
68
|
+
"mp4",
|
|
69
|
+
"film",
|
|
70
|
+
"média",
|
|
71
|
+
"url",
|
|
72
|
+
],
|
|
73
|
+
group: "Média",
|
|
74
|
+
},
|
|
75
|
+
audio: {
|
|
76
|
+
title: "Audio",
|
|
77
|
+
subtext: "Insérer un audio",
|
|
78
|
+
aliases: [
|
|
79
|
+
"audio",
|
|
80
|
+
"téléchargerAudio",
|
|
81
|
+
"téléverser",
|
|
82
|
+
"mp3",
|
|
83
|
+
"son",
|
|
84
|
+
"média",
|
|
85
|
+
"url",
|
|
86
|
+
],
|
|
87
|
+
group: "Média",
|
|
88
|
+
},
|
|
89
|
+
file: {
|
|
90
|
+
title: "Fichier",
|
|
91
|
+
subtext: "Insérer un fichier",
|
|
92
|
+
aliases: ["fichier", "téléverser", "intégrer", "média", "url"],
|
|
93
|
+
group: "Média",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
placeholders: {
|
|
97
|
+
default: "Entrez du texte ou tapez '/' pour les commandes",
|
|
98
|
+
heading: "Titre",
|
|
99
|
+
bulletListItem: "Liste",
|
|
100
|
+
numberedListItem: "Liste",
|
|
101
|
+
},
|
|
102
|
+
file_blocks: {
|
|
103
|
+
image: {
|
|
104
|
+
add_button_text: "Ajouter une image",
|
|
105
|
+
},
|
|
106
|
+
video: {
|
|
107
|
+
add_button_text: "Ajouter une vidéo",
|
|
108
|
+
},
|
|
109
|
+
audio: {
|
|
110
|
+
add_button_text: "Ajouter un audio",
|
|
111
|
+
},
|
|
112
|
+
file: {
|
|
113
|
+
add_button_text: "Ajouter un fichier",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
// from react package:
|
|
117
|
+
side_menu: {
|
|
118
|
+
add_block_label: "Ajouter un bloc",
|
|
119
|
+
drag_handle_label: "Ouvrir le menu du bloc",
|
|
120
|
+
},
|
|
121
|
+
drag_handle: {
|
|
122
|
+
delete_menuitem: "Supprimer",
|
|
123
|
+
colors_menuitem: "Couleurs",
|
|
124
|
+
},
|
|
125
|
+
table_handle: {
|
|
126
|
+
delete_column_menuitem: "Supprimer la colonne",
|
|
127
|
+
delete_row_menuitem: "Supprimer la ligne",
|
|
128
|
+
add_left_menuitem: "Ajouter une colonne à gauche",
|
|
129
|
+
add_right_menuitem: "Ajouter une colonne à droite",
|
|
130
|
+
add_above_menuitem: "Ajouter une ligne au-dessus",
|
|
131
|
+
add_below_menuitem: "Ajouter une ligne en dessous",
|
|
132
|
+
},
|
|
133
|
+
suggestion_menu: {
|
|
134
|
+
no_items_title: "Aucun élément trouvé",
|
|
135
|
+
loading: "Chargement…",
|
|
136
|
+
},
|
|
137
|
+
color_picker: {
|
|
138
|
+
text_title: "Texte",
|
|
139
|
+
background_title: "Fond",
|
|
140
|
+
colors: {
|
|
141
|
+
default: "Défaut",
|
|
142
|
+
gray: "Gris",
|
|
143
|
+
brown: "Marron",
|
|
144
|
+
red: "Rouge",
|
|
145
|
+
orange: "Orange",
|
|
146
|
+
yellow: "Jaune",
|
|
147
|
+
green: "Vert",
|
|
148
|
+
blue: "Bleu",
|
|
149
|
+
purple: "Violet",
|
|
150
|
+
pink: "Rose",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
formatting_toolbar: {
|
|
155
|
+
bold: {
|
|
156
|
+
tooltip: "Gras",
|
|
157
|
+
secondary_tooltip: "Mod+B",
|
|
158
|
+
},
|
|
159
|
+
italic: {
|
|
160
|
+
tooltip: "Italique",
|
|
161
|
+
secondary_tooltip: "Mod+I",
|
|
162
|
+
},
|
|
163
|
+
underline: {
|
|
164
|
+
tooltip: "Souligner",
|
|
165
|
+
secondary_tooltip: "Mod+U",
|
|
166
|
+
},
|
|
167
|
+
strike: {
|
|
168
|
+
tooltip: "Barré",
|
|
169
|
+
secondary_tooltip: "Mod+Shift+X",
|
|
170
|
+
},
|
|
171
|
+
code: {
|
|
172
|
+
tooltip: "Code",
|
|
173
|
+
secondary_tooltip: "",
|
|
174
|
+
},
|
|
175
|
+
colors: {
|
|
176
|
+
tooltip: "Couleurs",
|
|
177
|
+
},
|
|
178
|
+
link: {
|
|
179
|
+
tooltip: "Créer un lien",
|
|
180
|
+
secondary_tooltip: "Mod+K",
|
|
181
|
+
},
|
|
182
|
+
file_caption: {
|
|
183
|
+
tooltip: "Modifier la légende",
|
|
184
|
+
input_placeholder: "Modifier la légende",
|
|
185
|
+
},
|
|
186
|
+
file_replace: {
|
|
187
|
+
tooltip: {
|
|
188
|
+
image: "Remplacer l'image",
|
|
189
|
+
video: "Remplacer la vidéo",
|
|
190
|
+
audio: "Remplacer l'audio",
|
|
191
|
+
file: "Remplacer le fichier",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
file_rename: {
|
|
195
|
+
tooltip: {
|
|
196
|
+
image: "Renommer l'image",
|
|
197
|
+
video: "Renommer la vidéo",
|
|
198
|
+
audio: "Renommer l'audio",
|
|
199
|
+
file: "Renommer le fichier",
|
|
200
|
+
},
|
|
201
|
+
input_placeholder: {
|
|
202
|
+
image: "Renommer l'image",
|
|
203
|
+
video: "Renommer la vidéo",
|
|
204
|
+
audio: "Renommer l'audio",
|
|
205
|
+
file: "Renommer le fichier",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
file_download: {
|
|
209
|
+
tooltip: {
|
|
210
|
+
image: "Télécharger l'image",
|
|
211
|
+
video: "Télécharger la vidéo",
|
|
212
|
+
audio: "Télécharger l'audio",
|
|
213
|
+
file: "Télécharger le fichier",
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
file_delete: {
|
|
217
|
+
tooltip: {
|
|
218
|
+
image: "Supprimer l'image",
|
|
219
|
+
video: "Supprimer la vidéo",
|
|
220
|
+
audio: "Supprimer l'audio",
|
|
221
|
+
file: "Supprimer le fichier",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
file_preview_toggle: {
|
|
225
|
+
tooltip: "Basculer l'aperçu",
|
|
226
|
+
},
|
|
227
|
+
nest: {
|
|
228
|
+
tooltip: "Emboîter le bloc",
|
|
229
|
+
secondary_tooltip: "Tab",
|
|
230
|
+
},
|
|
231
|
+
unnest: {
|
|
232
|
+
tooltip: "Démboîter le bloc",
|
|
233
|
+
secondary_tooltip: "Shift+Tab",
|
|
234
|
+
},
|
|
235
|
+
align_left: {
|
|
236
|
+
tooltip: "Aligner le texte à gauche",
|
|
237
|
+
},
|
|
238
|
+
align_center: {
|
|
239
|
+
tooltip: "Aligner le texte au centre",
|
|
240
|
+
},
|
|
241
|
+
align_right: {
|
|
242
|
+
tooltip: "Aligner le texte à droite",
|
|
243
|
+
},
|
|
244
|
+
align_justify: {
|
|
245
|
+
tooltip: "Justifier le texte",
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
file_panel: {
|
|
249
|
+
upload: {
|
|
250
|
+
title: "Télécharger",
|
|
251
|
+
file_placeholder: {
|
|
252
|
+
image: "Télécharger une image",
|
|
253
|
+
video: "Télécharger une vidéo",
|
|
254
|
+
audio: "Télécharger un fichier audio",
|
|
255
|
+
file: "Télécharger un fichier",
|
|
256
|
+
},
|
|
257
|
+
upload_error: "Erreur : Échec du téléchargement",
|
|
258
|
+
},
|
|
259
|
+
embed: {
|
|
260
|
+
title: "Intégrer",
|
|
261
|
+
embed_button: {
|
|
262
|
+
image: "Intégrer une image",
|
|
263
|
+
video: "Intégrer une vidéo",
|
|
264
|
+
audio: "Intégrer un fichier audio",
|
|
265
|
+
file: "Intégrer un fichier",
|
|
266
|
+
},
|
|
267
|
+
url_placeholder: "Entrez l'URL",
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
link_toolbar: {
|
|
271
|
+
delete: {
|
|
272
|
+
tooltip: "Supprimer le lien",
|
|
273
|
+
},
|
|
274
|
+
edit: {
|
|
275
|
+
text: "Modifier le lien",
|
|
276
|
+
tooltip: "Modifier",
|
|
277
|
+
},
|
|
278
|
+
open: {
|
|
279
|
+
tooltip: "Ouvrir dans un nouvel onglet",
|
|
280
|
+
},
|
|
281
|
+
form: {
|
|
282
|
+
title_placeholder: "Modifier le titre",
|
|
283
|
+
url_placeholder: "Modifier l'URL",
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
generic: {
|
|
287
|
+
ctrl_shortcut: "Ctrl",
|
|
288
|
+
},
|
|
289
|
+
};
|