@blocknote/core 0.13.0 → 0.13.2

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.
@@ -1 +1 @@
1
- {"builtAt":1714926597310,"assets":[{"name":"blocknote.umd.cjs","size":109661},{"name":"blocknote.umd.cjs.map","size":481369}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/i18n/locales/en.ts","size":4307,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":4477,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8518,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":1691,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeConversions.ts","size":11959,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/sharedHTMLConversion.ts","size":2293,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts","size":2687,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":1066,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":704,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1731,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":3701,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":2781,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1357,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":1627,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/api/getCurrentBlockContentType.ts","size":192,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3439,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":9303,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1151,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":2964,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":1862,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":3421,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1172,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":1462,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":1207,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1025,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":757,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":548,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/blockManipulation.ts","size":5738,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":549,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1054,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":4287,"chunks":["a1ee98a"]},{"name":"./src/extensions/ImagePanel/ImageToolbarPlugin.ts","size":3393,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7273,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":7646,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14952,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":14755,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/copyExtension.ts","size":2883,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/pasteExtension.ts","size":1131,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":688,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":748,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":622,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1594,"chunks":["a1ee98a"]},{"name":"./src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts","size":467,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4578,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":17589,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":3859,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":1017,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":827,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":2655,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":2253,"chunks":["a1ee98a"]},{"name":"./src/editor/Block.css","size":17,"chunks":["a1ee98a"]},{"name":"./src/editor/editor.css","size":18,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":22961,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":4553,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":2166,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
1
+ {"builtAt":1715360257829,"assets":[{"name":"blocknote.umd.cjs","size":116459},{"name":"blocknote.umd.cjs.map","size":497369}],"chunks":[{"id":"a1ee98a","entry":true,"initial":true,"files":["blocknote.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/i18n/locales/en.ts","size":4307,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/nl.ts","size":4477,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/zh.ts","size":3872,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/fr.ts","size":4639,"chunks":["a1ee98a"]},{"name":"./src/i18n/locales/index.ts","size":0,"chunks":["a1ee98a"]},{"name":"./src/extensions/UniqueID/UniqueID.ts","size":8518,"chunks":["a1ee98a"]},{"name":"./src/api/getBlockInfoFromPos.ts","size":1691,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/types.ts","size":302,"chunks":["a1ee98a"]},{"name":"./src/util/typescript.ts","size":331,"chunks":["a1ee98a"]},{"name":"./src/api/nodeConversions/nodeConversions.ts","size":11959,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/sharedHTMLConversion.ts","size":2293,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts","size":2687,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/externalHTMLExporter.ts","size":1066,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/html/internalHTMLSerializer.ts","size":704,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts","size":316,"chunks":["a1ee98a"]},{"name":"./src/util/browser.ts","size":536,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockHelpers.ts","size":1731,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultProps.ts","size":269,"chunks":["a1ee98a"]},{"name":"./src/util/string.ts","size":108,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/internal.ts","size":3701,"chunks":["a1ee98a"]},{"name":"./src/schema/blocks/createSpec.ts","size":2781,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/internal.ts","size":1357,"chunks":["a1ee98a"]},{"name":"./src/schema/inlineContent/createSpec.ts","size":1627,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/internal.ts","size":1162,"chunks":["a1ee98a"]},{"name":"./src/schema/styles/createSpec.ts","size":1263,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorMark.ts","size":946,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorMark.ts","size":866,"chunks":["a1ee98a"]},{"name":"./src/api/getCurrentBlockContentType.ts","size":192,"chunks":["a1ee98a"]},{"name":"./src/blocks/HeadingBlockContent/HeadingBlockContent.ts","size":3439,"chunks":["a1ee98a"]},{"name":"./src/blocks/ImageBlockContent/ImageBlockContent.ts","size":9303,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts","size":1151,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts","size":2964,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts","size":1862,"chunks":["a1ee98a"]},{"name":"./src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts","size":3421,"chunks":["a1ee98a"]},{"name":"./src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts","size":1172,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableExtension.ts","size":1462,"chunks":["a1ee98a"]},{"name":"./src/blocks/TableBlockContent/TableBlockContent.ts","size":1207,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlocks.ts","size":1025,"chunks":["a1ee98a"]},{"name":"./src/blocks/defaultBlockTypeGuards.ts","size":757,"chunks":["a1ee98a"]},{"name":"./src/api/nodeUtil.ts","size":548,"chunks":["a1ee98a"]},{"name":"./src/api/blockManipulation/blockManipulation.ts","size":5738,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/removeUnderlinesRehypePlugin.ts","size":752,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/markdown/markdownExporter.ts","size":549,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/util/nestedLists.ts","size":2174,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/html/parseHTML.ts","size":503,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/markdown/parseMarkdown.ts","size":1054,"chunks":["a1ee98a"]},{"name":"./src/util/EventEmitter.ts","size":744,"chunks":["a1ee98a"]},{"name":"./src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts","size":4287,"chunks":["a1ee98a"]},{"name":"./src/extensions/ImagePanel/ImageToolbarPlugin.ts","size":3393,"chunks":["a1ee98a"]},{"name":"./src/extensions/LinkToolbar/LinkToolbarPlugin.ts","size":7273,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/SuggestionPlugin.ts","size":7646,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/MultipleNodeSelection.ts","size":1616,"chunks":["a1ee98a"]},{"name":"./src/extensions/SideMenu/SideMenuPlugin.ts","size":14952,"chunks":["a1ee98a"]},{"name":"./src/extensions/TableHandles/TableHandlesPlugin.ts","size":14755,"chunks":["a1ee98a"]},{"name":"./src/api/exporters/copyExtension.ts","size":2883,"chunks":["a1ee98a"]},{"name":"./src/api/parsers/pasteExtension.ts","size":1131,"chunks":["a1ee98a"]},{"name":"./src/extensions/BackgroundColor/BackgroundColorExtension.ts","size":688,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextAlignment/TextAlignmentExtension.ts","size":748,"chunks":["a1ee98a"]},{"name":"./src/extensions/TextColor/TextColorExtension.ts","size":622,"chunks":["a1ee98a"]},{"name":"./src/extensions/TrailingNode/TrailingNodeExtension.ts","size":1594,"chunks":["a1ee98a"]},{"name":"./src/extensions/NonEditableBlocks/NonEditableBlockPlugin.ts","size":1014,"chunks":["a1ee98a"]},{"name":"./src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts","size":4578,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockContainer.ts","size":17643,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/BlockGroup.ts","size":1097,"chunks":["a1ee98a"]},{"name":"./src/pm-nodes/Doc.ts","size":90,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteExtensions.ts","size":3884,"chunks":["a1ee98a"]},{"name":"./src/editor/transformPasted.ts","size":1017,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteSchema.ts","size":827,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteTipTapEditor.ts","size":2655,"chunks":["a1ee98a"]},{"name":"./src/extensions/Placeholder/PlaceholderPlugin.ts","size":2253,"chunks":["a1ee98a"]},{"name":"./src/editor/Block.css","size":17,"chunks":["a1ee98a"]},{"name":"./src/editor/editor.css","size":18,"chunks":["a1ee98a"]},{"name":"./src/editor/BlockNoteEditor.ts","size":22961,"chunks":["a1ee98a"]},{"name":"./src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts","size":4553,"chunks":["a1ee98a"]},{"name":"./src/api/testUtil/partialBlockTestUtil.ts","size":2166,"chunks":["a1ee98a"]},{"name":"./src/index.ts","size":0,"chunks":["a1ee98a"]}]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "homepage": "https://github.com/TypeCellOS/BlockNote",
4
4
  "private": false,
5
5
  "license": "MPL-2.0",
6
- "version": "0.13.0",
6
+ "version": "0.13.2",
7
7
  "files": [
8
8
  "dist",
9
9
  "types",
@@ -116,5 +116,5 @@
116
116
  "access": "public",
117
117
  "registry": "https://registry.npmjs.org/"
118
118
  },
119
- "gitHead": "501dc35254104a4ee56718ee299d31d534586b55"
119
+ "gitHead": "fe1c634f65b842d9adcd735cbf2b8cb0d659cf5b"
120
120
  }
@@ -68,7 +68,7 @@ export const getBlockNoteExtensions = <
68
68
  UniqueID.configure({
69
69
  types: ["blockContainer"],
70
70
  }),
71
- HardBreak,
71
+ HardBreak.extend({ priority: 10 }),
72
72
  // Comments,
73
73
 
74
74
  // basics:
@@ -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
- // Prevent typing for blocks without inline content, as this would otherwise
5
- // convert them into paragraph blocks.
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 input will insert a character - we want to block this
14
- // as it will convert the block into a paragraph.
15
- if (
16
- event.key.length === 1 &&
17
- !event.ctrlKey &&
18
- !event.altKey &&
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
  });
@@ -0,0 +1,196 @@
1
+ export const fr = {
2
+ slash_menu: {
3
+ heading: {
4
+ title: "Titre 1",
5
+ subtext: "Utilisé pour un titre de premier niveau",
6
+ aliases: ["h", "titre1", "h1"],
7
+ group: "Titres",
8
+ },
9
+ heading_2: {
10
+ title: "Titre 2",
11
+ subtext: "Utilisé pour les sections clés",
12
+ aliases: ["h2", "titre2", "sous-titre"],
13
+ group: "Titres",
14
+ },
15
+ heading_3: {
16
+ title: "Titre 3",
17
+ subtext: "Utilisé pour les sous-sections et les titres de groupe",
18
+ aliases: ["h3", "titre3", "sous-titre"],
19
+ group: "Titres",
20
+ },
21
+ numbered_list: {
22
+ title: "Liste Numérotée",
23
+ subtext: "Utilisé pour afficher une liste numérotée",
24
+ aliases: ["ol", "li", "liste", "listenumérotée", "liste numérotée"],
25
+ group: "Blocs de base",
26
+ },
27
+ bullet_list: {
28
+ title: "Liste à Puces",
29
+ subtext: "Utilisé pour afficher une liste non ordonnée",
30
+ aliases: ["ul", "li", "liste", "listeàpuces", "liste à puces"],
31
+ group: "Blocs de base",
32
+ },
33
+ paragraph: {
34
+ title: "Paragraphe",
35
+ subtext: "Utilisé pour le corps de votre document",
36
+ aliases: ["p", "paragraphe"],
37
+ group: "Blocs de base",
38
+ },
39
+ table: {
40
+ title: "Tableau",
41
+ subtext: "Utilisé pour les tableaux",
42
+ aliases: ["tableau"],
43
+ group: "Avancé",
44
+ },
45
+ image: {
46
+ title: "Image",
47
+ subtext: "Insérer une image",
48
+ aliases: [
49
+ "image",
50
+ "uploadImage",
51
+ "télécharger",
52
+ "img",
53
+ "photo",
54
+ "média",
55
+ "url",
56
+ "drive",
57
+ "dropbox",
58
+ ],
59
+ group: "Médias",
60
+ },
61
+ },
62
+ placeholders: {
63
+ default: "Entrez du texte ou tapez '/' pour les commandes",
64
+ heading: "Titre",
65
+ bulletListItem: "Liste",
66
+ numberedListItem: "Liste",
67
+ },
68
+ image: {
69
+ add_button: "Ajouter une Image",
70
+ },
71
+ // from react package:
72
+ side_menu: {
73
+ add_block_label: "Ajouter un bloc",
74
+ drag_handle_label: "Ouvrir le menu du bloc",
75
+ },
76
+ drag_handle: {
77
+ delete_menuitem: "Supprimer",
78
+ colors_menuitem: "Couleurs",
79
+ },
80
+ table_handle: {
81
+ delete_column_menuitem: "Supprimer la colonne",
82
+ delete_row_menuitem: "Supprimer la ligne",
83
+ add_left_menuitem: "Ajouter une colonne à gauche",
84
+ add_right_menuitem: "Ajouter une colonne à droite",
85
+ add_above_menuitem: "Ajouter une ligne au-dessus",
86
+ add_below_menuitem: "Ajouter une ligne en dessous",
87
+ },
88
+ suggestion_menu: {
89
+ no_items_title: "Aucun élément trouvé",
90
+ loading: "Chargement…",
91
+ },
92
+ color_picker: {
93
+ text_title: "Texte",
94
+ background_title: "Fond",
95
+ colors: {
96
+ default: "Défaut",
97
+ gray: "Gris",
98
+ brown: "Marron",
99
+ red: "Rouge",
100
+ orange: "Orange",
101
+ yellow: "Jaune",
102
+ green: "Vert",
103
+ blue: "Bleu",
104
+ purple: "Violet",
105
+ pink: "Rose",
106
+ },
107
+ },
108
+
109
+ formatting_toolbar: {
110
+ bold: {
111
+ tooltip: "Gras",
112
+ secondary_tooltip: "Mod+B",
113
+ },
114
+ italic: {
115
+ tooltip: "Italique",
116
+ secondary_tooltip: "Mod+I",
117
+ },
118
+ underline: {
119
+ tooltip: "Souligner",
120
+ secondary_tooltip: "Mod+U",
121
+ },
122
+ strike: {
123
+ tooltip: "Barré",
124
+ secondary_tooltip: "Mod+Shift+X",
125
+ },
126
+ code: {
127
+ tooltip: "Code",
128
+ secondary_tooltip: "",
129
+ },
130
+ colors: {
131
+ tooltip: "Couleurs",
132
+ },
133
+ link: {
134
+ tooltip: "Créer un lien",
135
+ secondary_tooltip: "Mod+K",
136
+ },
137
+ image_caption: {
138
+ tooltip: "Modifier la légende",
139
+ input_placeholder: "Modifier la légende",
140
+ },
141
+ image_replace: {
142
+ tooltip: "Remplacer l'image",
143
+ },
144
+ nest: {
145
+ tooltip: "Emboîter le bloc",
146
+ secondary_tooltip: "Tab",
147
+ },
148
+ unnest: {
149
+ tooltip: "Démboîter le bloc",
150
+ secondary_tooltip: "Shift+Tab",
151
+ },
152
+ align_left: {
153
+ tooltip: "Aligner le texte à gauche",
154
+ },
155
+ align_center: {
156
+ tooltip: "Aligner le texte au centre",
157
+ },
158
+ align_right: {
159
+ tooltip: "Aligner le texte à droite",
160
+ },
161
+ align_justify: {
162
+ tooltip: "Justifier le texte",
163
+ },
164
+ },
165
+ image_panel: {
166
+ upload: {
167
+ title: "Télécharger",
168
+ file_placeholder: "Télécharger l'image",
169
+ upload_error: "Erreur : Échec du téléchargement",
170
+ },
171
+ embed: {
172
+ title: "Intégrer",
173
+ embed_button: "Intégrer l'image",
174
+ url_placeholder: "Entrez l'URL",
175
+ },
176
+ },
177
+ link_toolbar: {
178
+ delete: {
179
+ tooltip: "Supprimer le lien",
180
+ },
181
+ edit: {
182
+ text: "Modifier le lien",
183
+ tooltip: "Modifier",
184
+ },
185
+ open: {
186
+ tooltip: "Ouvrir dans un nouvel onglet",
187
+ },
188
+ form: {
189
+ title_placeholder: "Modifier le titre",
190
+ url_placeholder: "Modifier l'URL",
191
+ },
192
+ },
193
+ generic: {
194
+ ctrl_shortcut: "Ctrl",
195
+ },
196
+ };
@@ -1,2 +1,4 @@
1
1
  export * from "./en";
2
2
  export * from "./nl";
3
+ export * from "./zh";
4
+ export * from "./fr";
@@ -0,0 +1,213 @@
1
+ import type { Dictionary } from "../dictionary";
2
+
3
+ export const zh: Dictionary = {
4
+ slash_menu: {
5
+ heading: {
6
+ title: "一级标题",
7
+ subtext: "用于顶级标题",
8
+ aliases: ["h", "heading1", "h1", "标题", "一级标题"],
9
+ group: "标题",
10
+ },
11
+ heading_2: {
12
+ title: "二级标题",
13
+ subtext: "用于关键部分",
14
+ aliases: ["h2", "heading2", "subheading", "标题", "二级标题", "副标题"],
15
+ group: "标题",
16
+ },
17
+ heading_3: {
18
+ title: "三级标题",
19
+ subtext: "用于小节和分组标题",
20
+ aliases: ["h3", "heading3", "subheading", "标题", "三级标题"],
21
+ group: "标题",
22
+ },
23
+ numbered_list: {
24
+ title: "有序列表",
25
+ subtext: "用于显示有序列表",
26
+ aliases: [
27
+ "ol",
28
+ "li",
29
+ "list",
30
+ "numberedlist",
31
+ "numbered list",
32
+ "列表",
33
+ "有序列表",
34
+ ],
35
+ group: "基础",
36
+ },
37
+ bullet_list: {
38
+ title: "无序列表",
39
+ subtext: "用于显示无序列表",
40
+ aliases: [
41
+ "ul",
42
+ "li",
43
+ "list",
44
+ "bulletlist",
45
+ "bullet list",
46
+ "列表",
47
+ "无序列表",
48
+ ],
49
+ group: "基础",
50
+ },
51
+ paragraph: {
52
+ title: "段落",
53
+ subtext: "用于文档正文",
54
+ aliases: ["p", "paragraph", "text", "正文"],
55
+ group: "基础",
56
+ },
57
+ table: {
58
+ title: "表格",
59
+ subtext: "使用表格",
60
+ aliases: ["table", "表格"],
61
+ group: "高级功能",
62
+ },
63
+ image: {
64
+ title: "图片",
65
+ subtext: "插入图片",
66
+ aliases: [
67
+ "图片",
68
+ "上传图片",
69
+ "上传",
70
+ "image",
71
+ "img",
72
+ "相册",
73
+ "媒体",
74
+ "url",
75
+ ],
76
+ group: "媒体",
77
+ },
78
+ },
79
+ placeholders: {
80
+ default: "输入 '/' 以使用命令",
81
+ heading: "标题",
82
+ bulletListItem: "列表",
83
+ numberedListItem: "列表",
84
+ },
85
+ image: {
86
+ add_button: "添加图片",
87
+ },
88
+ // from react package:
89
+ side_menu: {
90
+ add_block_label: "添加块",
91
+ drag_handle_label: "打开菜单",
92
+ },
93
+ drag_handle: {
94
+ delete_menuitem: "删除",
95
+ colors_menuitem: "颜色",
96
+ },
97
+ table_handle: {
98
+ delete_column_menuitem: "删除列",
99
+ delete_row_menuitem: "删除行",
100
+ add_left_menuitem: "左侧添加列",
101
+ add_right_menuitem: "右侧添加列",
102
+ add_above_menuitem: "上方添加行",
103
+ add_below_menuitem: "下方添加行",
104
+ },
105
+ suggestion_menu: {
106
+ no_items_title: "无匹配项",
107
+ loading: "加载中…",
108
+ },
109
+ color_picker: {
110
+ text_title: "文本",
111
+ background_title: "背景色",
112
+ colors: {
113
+ default: "默认",
114
+ gray: "灰色",
115
+ brown: "棕色",
116
+ red: "红色",
117
+ orange: "橙色",
118
+ yellow: "黄色",
119
+ green: "绿色",
120
+ blue: "蓝色",
121
+ purple: "紫色",
122
+ pink: "粉色",
123
+ },
124
+ },
125
+
126
+ formatting_toolbar: {
127
+ bold: {
128
+ tooltip: "加粗",
129
+ secondary_tooltip: "Mod+B",
130
+ },
131
+ italic: {
132
+ tooltip: "斜体",
133
+ secondary_tooltip: "Mod+I",
134
+ },
135
+ underline: {
136
+ tooltip: "下划线",
137
+ secondary_tooltip: "Mod+U",
138
+ },
139
+ strike: {
140
+ tooltip: "删除线",
141
+ secondary_tooltip: "Mod+Shift+X",
142
+ },
143
+ code: {
144
+ tooltip: "代码标记",
145
+ secondary_tooltip: "",
146
+ },
147
+ colors: {
148
+ tooltip: "颜色",
149
+ },
150
+ link: {
151
+ tooltip: "添加链接",
152
+ secondary_tooltip: "Mod+K",
153
+ },
154
+ image_caption: {
155
+ tooltip: "编辑标题",
156
+ input_placeholder: "编辑标题",
157
+ },
158
+ image_replace: {
159
+ tooltip: "替换图片",
160
+ },
161
+ nest: {
162
+ tooltip: "嵌套",
163
+ secondary_tooltip: "Tab",
164
+ },
165
+ unnest: {
166
+ tooltip: "取消嵌套",
167
+ secondary_tooltip: "Shift+Tab",
168
+ },
169
+ align_left: {
170
+ tooltip: "左对齐",
171
+ },
172
+ align_center: {
173
+ tooltip: "居中",
174
+ },
175
+ align_right: {
176
+ tooltip: "右对齐",
177
+ },
178
+ align_justify: {
179
+ tooltip: "文本对齐",
180
+ },
181
+ },
182
+ image_panel: {
183
+ upload: {
184
+ title: "上传",
185
+ file_placeholder: "上传图片",
186
+ upload_error: "Error:上传失败",
187
+ },
188
+ embed: {
189
+ title: "嵌入",
190
+ embed_button: "嵌入图片",
191
+ url_placeholder: "输入图片地址",
192
+ },
193
+ },
194
+ link_toolbar: {
195
+ delete: {
196
+ tooltip: "清除链接",
197
+ },
198
+ edit: {
199
+ text: "编辑链接",
200
+ tooltip: "编辑",
201
+ },
202
+ open: {
203
+ tooltip: "新窗口打开",
204
+ },
205
+ form: {
206
+ title_placeholder: "编辑标题",
207
+ url_placeholder: "编辑链接地址",
208
+ },
209
+ },
210
+ generic: {
211
+ ctrl_shortcut: "Ctrl",
212
+ },
213
+ };
@@ -139,7 +139,7 @@ export const BlockContainer = Node.create<{
139
139
  state.schema.nodes["blockContainer"].createAndFill()!;
140
140
 
141
141
  if (dispatch) {
142
- state.tr.insert(pos, newBlock);
142
+ state.tr.insert(pos, newBlock).scrollIntoView();
143
143
  }
144
144
 
145
145
  return true;
@@ -470,6 +470,8 @@ export const BlockContainer = Node.create<{
470
470
  )
471
471
  : undefined
472
472
  );
473
+
474
+ state.tr.scrollIntoView();
473
475
  }
474
476
 
475
477
  return true;