@blocknote/core 0.20.0 → 0.21.0

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.
Files changed (168) hide show
  1. package/dist/blocknote.js +1743 -1734
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +7 -7
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +1 -1
  6. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +1 -1
  7. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +3 -3
  8. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +1 -1
  9. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +1 -1
  10. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +1 -1
  11. package/dist/src/api/blockManipulation/selections/selection.js +4 -4
  12. package/dist/src/api/blockManipulation/selections/selection.js.map +1 -1
  13. package/dist/src/api/clipboard/clipboard.test.js +6 -3
  14. package/dist/src/api/clipboard/clipboard.test.js.map +1 -1
  15. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +1 -1
  16. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -1
  17. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +2 -3
  18. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +1 -1
  19. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +5 -5
  20. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +1 -1
  21. package/dist/src/api/clipboard/toClipboard/copyExtension.js +4 -2
  22. package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +1 -1
  23. package/dist/src/api/parsers/markdown/parseMarkdown.test.js +4 -1
  24. package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +1 -1
  25. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +14 -7
  26. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +1 -1
  27. package/dist/src/blocks/AudioBlockContent/{audioBlockHelpers.js → parseAudioElement.js} +1 -1
  28. package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +1 -0
  29. package/dist/src/blocks/FileBlockContent/FileBlockContent.js +5 -4
  30. package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +1 -1
  31. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +5 -0
  32. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +1 -0
  33. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +10 -0
  34. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +1 -0
  35. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +39 -0
  36. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +1 -0
  37. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +51 -0
  38. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +1 -0
  39. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +17 -0
  40. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +1 -0
  41. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +147 -0
  42. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +1 -0
  43. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +9 -0
  44. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +1 -0
  45. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +11 -0
  46. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +1 -0
  47. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +17 -9
  48. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +1 -1
  49. package/dist/src/blocks/ImageBlockContent/{imageBlockHelpers.js → parseImageElement.js} +1 -1
  50. package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +1 -0
  51. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +18 -7
  52. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +1 -1
  53. package/dist/src/blocks/VideoBlockContent/{videoBlockHelpers.js → parseVideoElement.js} +1 -1
  54. package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +1 -0
  55. package/dist/src/editor/BlockNoteEditor.js +8 -5
  56. package/dist/src/editor/BlockNoteEditor.js.map +1 -1
  57. package/dist/src/editor/BlockNoteExtensions.js +4 -8
  58. package/dist/src/editor/BlockNoteExtensions.js.map +1 -1
  59. package/dist/src/extensions/LinkToolbar/protocols.js +14 -0
  60. package/dist/src/extensions/LinkToolbar/protocols.js.map +1 -0
  61. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +6 -6
  62. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -1
  63. package/dist/src/extensions/SideMenu/SideMenuPlugin.js +5 -1
  64. package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +1 -1
  65. package/dist/src/extensions/SideMenu/dragging.js +3 -0
  66. package/dist/src/extensions/SideMenu/dragging.js.map +1 -1
  67. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +3 -3
  68. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +1 -1
  69. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +12 -3
  70. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +1 -1
  71. package/dist/src/index.js +9 -2
  72. package/dist/src/index.js.map +1 -1
  73. package/dist/src/schema/inlineContent/createSpec.js +1 -1
  74. package/dist/src/schema/inlineContent/createSpec.js.map +1 -1
  75. package/dist/style.css +1 -1
  76. package/dist/tsconfig.tsbuildinfo +1 -1
  77. package/dist/webpack-stats.json +1 -1
  78. package/package.json +2 -2
  79. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +3 -3
  80. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +1 -3
  81. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +1 -1
  82. package/src/api/blockManipulation/selections/selection.ts +5 -5
  83. package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -1
  84. package/src/api/clipboard/__snapshots__/tableCell.html +1 -1
  85. package/src/api/clipboard/__snapshots__/tableRow.html +1 -1
  86. package/src/api/clipboard/clipboard.test.ts +7 -3
  87. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +1 -1
  88. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +7 -14
  89. package/src/api/clipboard/fromClipboard/pasteExtension.ts +6 -6
  90. package/src/api/clipboard/toClipboard/copyExtension.ts +7 -2
  91. package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -1
  92. package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -1
  93. package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -1
  94. package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -1
  95. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  96. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  97. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -1
  98. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
  99. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -1
  100. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  101. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  102. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  103. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  104. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
  105. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -1
  106. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
  107. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
  108. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
  109. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -1
  110. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +1 -1
  111. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +2 -2
  112. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -1
  113. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +1 -1
  114. package/src/api/parsers/markdown/parseMarkdown.test.ts +5 -7
  115. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +13 -14
  116. package/src/blocks/FileBlockContent/FileBlockContent.ts +5 -12
  117. package/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts +5 -0
  118. package/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts +16 -0
  119. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +63 -0
  120. package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +80 -0
  121. package/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts +24 -0
  122. package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +204 -0
  123. package/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts +13 -0
  124. package/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts +15 -0
  125. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +20 -28
  126. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +20 -27
  127. package/src/editor/Block.css +35 -51
  128. package/src/editor/BlockNoteEditor.ts +14 -7
  129. package/src/editor/BlockNoteExtensions.ts +7 -8
  130. package/src/editor/editor.css +1 -0
  131. package/src/extensions/LinkToolbar/protocols.ts +13 -0
  132. package/src/extensions/Placeholder/PlaceholderPlugin.ts +6 -6
  133. package/src/extensions/SideMenu/SideMenuPlugin.ts +5 -1
  134. package/src/extensions/SideMenu/dragging.ts +3 -0
  135. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -6
  136. package/src/extensions/TableHandles/TableHandlesPlugin.ts +15 -3
  137. package/src/index.ts +9 -2
  138. package/src/schema/inlineContent/createSpec.ts +2 -2
  139. package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +2 -3
  140. package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +1 -3
  141. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +2 -5
  142. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +2 -5
  143. package/types/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.d.ts +3 -0
  144. package/types/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.d.ts +4 -0
  145. package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +6 -0
  146. package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +9 -0
  147. package/types/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.d.ts +6 -0
  148. package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +9 -0
  149. package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.d.ts +3 -0
  150. package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.d.ts +3 -0
  151. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -5
  152. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -5
  153. package/types/src/editor/BlockNoteEditor.d.ts +6 -4
  154. package/types/src/extensions/LinkToolbar/protocols.d.ts +2 -0
  155. package/types/src/index.d.ts +9 -2
  156. package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +0 -1
  157. package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +0 -317
  158. package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +0 -1
  159. package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +0 -1
  160. package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +0 -1
  161. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +0 -456
  162. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +0 -41
  163. /package/src/blocks/AudioBlockContent/{audioBlockHelpers.ts → parseAudioElement.ts} +0 -0
  164. /package/src/blocks/ImageBlockContent/{imageBlockHelpers.ts → parseImageElement.ts} +0 -0
  165. /package/src/blocks/VideoBlockContent/{videoBlockHelpers.ts → parseVideoElement.ts} +0 -0
  166. /package/types/src/blocks/AudioBlockContent/{audioBlockHelpers.d.ts → parseAudioElement.d.ts} +0 -0
  167. /package/types/src/blocks/ImageBlockContent/{imageBlockHelpers.d.ts → parseImageElement.d.ts} +0 -0
  168. /package/types/src/blocks/VideoBlockContent/{videoBlockHelpers.d.ts → parseVideoElement.d.ts} +0 -0
@@ -1,317 +0,0 @@
1
- export const FILE_ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`;
2
- export const createFileBlockWrapper = (block, editor,
3
- // TODO: Maybe make optional for default preview
4
- element, buttonText, buttonIcon) => {
5
- const wrapper = document.createElement("div");
6
- wrapper.className = "bn-file-block-content-wrapper";
7
- if (block.props.url === "") {
8
- const addFileButton = createAddFileButton(block, editor, buttonText, buttonIcon);
9
- wrapper.appendChild(addFileButton.dom);
10
- const loading = document.createElement("div");
11
- loading.className = "bn-file-loading-preview";
12
- loading.textContent = "Loading...";
13
- const destroyUploadStartHandler = editor.onUploadStart((blockId) => {
14
- if (blockId === block.id) {
15
- wrapper.removeChild(addFileButton.dom);
16
- wrapper.appendChild(loading);
17
- }
18
- });
19
- const destroyUploadEndHandler = editor.onUploadEnd((blockId) => {
20
- if (blockId === block.id) {
21
- wrapper.removeChild(loading);
22
- wrapper.appendChild(addFileButton.dom);
23
- }
24
- });
25
- return {
26
- dom: wrapper,
27
- destroy: () => {
28
- addFileButton.destroy?.();
29
- destroyUploadStartHandler();
30
- destroyUploadEndHandler();
31
- },
32
- };
33
- }
34
- else if (block.props.showPreview === false) {
35
- // TODO: Not using the wrapper element here?
36
- const file = createDefaultFilePreview(block).dom;
37
- const element = createFileAndCaptionWrapper(block, file);
38
- return {
39
- dom: element.dom,
40
- };
41
- }
42
- else {
43
- wrapper.appendChild(element.dom);
44
- return {
45
- dom: wrapper,
46
- destroy: element.destroy,
47
- };
48
- }
49
- };
50
- // Default file preview, displaying a file icon and file name.
51
- export const createDefaultFilePreview = (block) => {
52
- const file = document.createElement("div");
53
- file.className = "bn-file-default-preview";
54
- const icon = document.createElement("div");
55
- icon.className = "bn-file-default-preview-icon";
56
- icon.innerHTML = FILE_ICON_SVG;
57
- const fileName = document.createElement("p");
58
- fileName.className = "bn-file-default-preview-name";
59
- fileName.textContent = block.props.name || "";
60
- file.appendChild(icon);
61
- file.appendChild(fileName);
62
- return {
63
- dom: file,
64
- };
65
- };
66
- // Wrapper element containing file preview and caption.
67
- export const createFileAndCaptionWrapper = (block, file) => {
68
- const fileAndCaptionWrapper = document.createElement("div");
69
- fileAndCaptionWrapper.className = "bn-file-and-caption-wrapper";
70
- const caption = document.createElement("p");
71
- caption.className = "bn-file-caption";
72
- caption.textContent = block.props.caption;
73
- if (typeof block.props.previewWidth === "number" &&
74
- block.props.previewWidth > 0 &&
75
- block.props.caption !== undefined) {
76
- caption.style.width = `${block.props.previewWidth}px`;
77
- }
78
- fileAndCaptionWrapper.appendChild(file);
79
- fileAndCaptionWrapper.appendChild(caption);
80
- return {
81
- dom: fileAndCaptionWrapper,
82
- };
83
- };
84
- // Button element that acts as a placeholder for files with no src.
85
- export const createAddFileButton = (block, editor, buttonText, buttonIcon) => {
86
- const addFileButton = document.createElement("div");
87
- addFileButton.className = "bn-add-file-button";
88
- const addFileButtonIcon = document.createElement("div");
89
- addFileButtonIcon.className = "bn-add-file-button-icon";
90
- if (buttonIcon) {
91
- addFileButtonIcon.appendChild(buttonIcon);
92
- }
93
- else {
94
- addFileButtonIcon.innerHTML =
95
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';
96
- }
97
- const addFileButtonText = document.createElement("p");
98
- addFileButtonText.className = "bn-add-file-button-text";
99
- addFileButtonText.innerHTML =
100
- buttonText || editor.dictionary.file_blocks.file.add_button_text;
101
- // Prevents focus from moving to the button.
102
- const addFileButtonMouseDownHandler = (event) => {
103
- event.preventDefault();
104
- };
105
- // Opens the file toolbar.
106
- const addFileButtonClickHandler = () => {
107
- editor.dispatch(editor._tiptapEditor.state.tr.setMeta(editor.filePanel.plugin, {
108
- block: block,
109
- }));
110
- };
111
- addFileButton.appendChild(addFileButtonIcon);
112
- addFileButton.appendChild(addFileButtonText);
113
- addFileButton.addEventListener("mousedown", addFileButtonMouseDownHandler, true);
114
- addFileButton.addEventListener("click", addFileButtonClickHandler, true);
115
- return {
116
- dom: addFileButton,
117
- destroy: () => {
118
- addFileButton.removeEventListener("mousedown", addFileButtonMouseDownHandler, true);
119
- addFileButton.removeEventListener("click", addFileButtonClickHandler, true);
120
- },
121
- };
122
- };
123
- export const parseEmbedElement = (embedElement) => {
124
- const url = embedElement.src || undefined;
125
- return { url };
126
- };
127
- export const parseFigureElement = (figureElement, targetTag) => {
128
- const targetElement = figureElement.querySelector(targetTag);
129
- if (!targetElement) {
130
- return undefined;
131
- }
132
- const captionElement = figureElement.querySelector("figcaption");
133
- const caption = captionElement?.textContent ?? undefined;
134
- return { targetElement, caption };
135
- };
136
- // Wrapper figure element to display file link with caption. Used for external
137
- // HTML
138
- export const createLinkWithCaption = (element, caption) => {
139
- const wrapper = document.createElement("div");
140
- const fileCaption = document.createElement("p");
141
- fileCaption.textContent = caption;
142
- wrapper.appendChild(element);
143
- wrapper.appendChild(fileCaption);
144
- return {
145
- dom: wrapper,
146
- };
147
- };
148
- // Wrapper figure element to display file preview with caption. Used for
149
- // external HTML.
150
- export const createFigureWithCaption = (element, caption) => {
151
- const figure = document.createElement("figure");
152
- const captionElement = document.createElement("figcaption");
153
- captionElement.textContent = caption;
154
- figure.appendChild(element);
155
- figure.appendChild(captionElement);
156
- return { dom: figure };
157
- };
158
- // Wrapper element which adds resize handles & logic for visual media file
159
- // previews.
160
- export const createResizeHandlesWrapper = (block, editor, element, getWidth, setWidth) => {
161
- if (!block.props.previewWidth) {
162
- throw new Error("Block must have a `previewWidth` prop.");
163
- }
164
- // Wrapper element for rendered element and resize handles.
165
- const wrapper = document.createElement("div");
166
- wrapper.className = "bn-visual-media-wrapper";
167
- // Resize handle elements.
168
- const leftResizeHandle = document.createElement("div");
169
- leftResizeHandle.className = "bn-visual-media-resize-handle";
170
- leftResizeHandle.style.left = "4px";
171
- const rightResizeHandle = document.createElement("div");
172
- rightResizeHandle.className = "bn-visual-media-resize-handle";
173
- rightResizeHandle.style.right = "4px";
174
- // Temporary parameters set when the user begins resizing the element, used to
175
- // calculate the new width of the element.
176
- let resizeParams;
177
- // Updates the element width with an updated width depending on the cursor X
178
- // offset from when the resize began, and which resize handle is being used.
179
- const windowMouseMoveHandler = (event) => {
180
- if (!resizeParams) {
181
- if (!editor.isEditable &&
182
- wrapper.contains(leftResizeHandle) &&
183
- wrapper.contains(rightResizeHandle)) {
184
- wrapper.removeChild(leftResizeHandle);
185
- wrapper.removeChild(rightResizeHandle);
186
- }
187
- return;
188
- }
189
- let newWidth;
190
- if (block.props.textAlignment === "center") {
191
- if (resizeParams.handleUsed === "left") {
192
- newWidth =
193
- resizeParams.initialWidth +
194
- (resizeParams.initialClientX - event.clientX) * 2;
195
- }
196
- else {
197
- newWidth =
198
- resizeParams.initialWidth +
199
- (event.clientX - resizeParams.initialClientX) * 2;
200
- }
201
- }
202
- else {
203
- if (resizeParams.handleUsed === "left") {
204
- newWidth =
205
- resizeParams.initialWidth +
206
- resizeParams.initialClientX -
207
- event.clientX;
208
- }
209
- else {
210
- newWidth =
211
- resizeParams.initialWidth +
212
- event.clientX -
213
- resizeParams.initialClientX;
214
- }
215
- }
216
- // Min element width in px.
217
- const minWidth = 64;
218
- // Ensures the element is not wider than the editor and not smaller than a
219
- // predetermined minimum width.
220
- if (newWidth < minWidth) {
221
- setWidth(minWidth);
222
- }
223
- else if (newWidth > editor.domElement.firstElementChild.clientWidth) {
224
- setWidth(editor.domElement.firstElementChild.clientWidth);
225
- }
226
- else {
227
- setWidth(newWidth);
228
- }
229
- };
230
- // Stops mouse movements from resizing the element and updates the block's
231
- // `width` prop to the new value.
232
- const windowMouseUpHandler = (event) => {
233
- // Hides the drag handles if the cursor is no longer over the element.
234
- if ((!event.target ||
235
- !wrapper.contains(event.target) ||
236
- !editor.isEditable) &&
237
- wrapper.contains(leftResizeHandle) &&
238
- wrapper.contains(rightResizeHandle)) {
239
- wrapper.removeChild(leftResizeHandle);
240
- wrapper.removeChild(rightResizeHandle);
241
- }
242
- if (!resizeParams) {
243
- return;
244
- }
245
- resizeParams = undefined;
246
- editor.updateBlock(block, {
247
- props: {
248
- previewWidth: getWidth(),
249
- },
250
- });
251
- };
252
- // Shows the resize handles when hovering over the element with the cursor.
253
- const elementMouseEnterHandler = () => {
254
- if (editor.isEditable) {
255
- wrapper.appendChild(leftResizeHandle);
256
- wrapper.appendChild(rightResizeHandle);
257
- }
258
- };
259
- // Hides the resize handles when the cursor leaves the element, unless the
260
- // cursor moves to one of the resize handles.
261
- const elementMouseLeaveHandler = (event) => {
262
- if (event.relatedTarget === leftResizeHandle ||
263
- event.relatedTarget === rightResizeHandle) {
264
- return;
265
- }
266
- if (resizeParams) {
267
- return;
268
- }
269
- if (editor.isEditable &&
270
- wrapper.contains(leftResizeHandle) &&
271
- wrapper.contains(rightResizeHandle)) {
272
- wrapper.removeChild(leftResizeHandle);
273
- wrapper.removeChild(rightResizeHandle);
274
- }
275
- };
276
- // Sets the resize params, allowing the user to begin resizing the element by
277
- // moving the cursor left or right.
278
- const leftResizeHandleMouseDownHandler = (event) => {
279
- event.preventDefault();
280
- wrapper.appendChild(leftResizeHandle);
281
- wrapper.appendChild(rightResizeHandle);
282
- resizeParams = {
283
- handleUsed: "left",
284
- initialWidth: block.props.previewWidth,
285
- initialClientX: event.clientX,
286
- };
287
- };
288
- const rightResizeHandleMouseDownHandler = (event) => {
289
- event.preventDefault();
290
- wrapper.appendChild(leftResizeHandle);
291
- wrapper.appendChild(rightResizeHandle);
292
- resizeParams = {
293
- handleUsed: "right",
294
- initialWidth: block.props.previewWidth,
295
- initialClientX: event.clientX,
296
- };
297
- };
298
- wrapper.appendChild(element);
299
- window.addEventListener("mousemove", windowMouseMoveHandler);
300
- window.addEventListener("mouseup", windowMouseUpHandler);
301
- element.addEventListener("mouseenter", elementMouseEnterHandler);
302
- element.addEventListener("mouseleave", elementMouseLeaveHandler);
303
- leftResizeHandle.addEventListener("mousedown", leftResizeHandleMouseDownHandler);
304
- rightResizeHandle.addEventListener("mousedown", rightResizeHandleMouseDownHandler);
305
- return {
306
- dom: wrapper,
307
- destroy: () => {
308
- window.removeEventListener("mousemove", windowMouseMoveHandler);
309
- window.removeEventListener("mouseup", windowMouseUpHandler);
310
- element.removeEventListener("mouseenter", elementMouseEnterHandler);
311
- element.removeEventListener("mouseleave", elementMouseLeaveHandler);
312
- leftResizeHandle.removeEventListener("mousedown", leftResizeHandleMouseDownHandler);
313
- rightResizeHandle.removeEventListener("mousedown", rightResizeHandleMouseDownHandler);
314
- },
315
- };
316
- };
317
- //# sourceMappingURL=fileBlockHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileBlockHelpers.js","sourceRoot":"","sources":["../../../../src/blocks/FileBlockContent/fileBlockHelpers.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,aAAa,GAAG,qQAAqQ,CAAC;AACnS,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAiD,EACjD,MAIC;AACD,gDAAgD;AAChD,OAAmD,EACnD,UAAmB,EACnB,UAAwB,EACxB,EAAE;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,SAAS,GAAG,+BAA+B,CAAC;IAEpD,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;QAC3B,MAAM,aAAa,GAAG,mBAAmB,CACvC,KAAK,EACL,MAAM,EACN,UAAU,EACV,UAAU,CACX,CAAC;QACF,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAEvC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,SAAS,GAAG,yBAAyB,CAAC;QAC9C,OAAO,CAAC,WAAW,GAAG,YAAY,CAAC;QAEnC,MAAM,yBAAyB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE;YACjE,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;gBACzB,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;gBACvC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,uBAAuB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7D,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;gBACzB,OAAO,CAAC,WAAW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CAAC,YAAa;YACvC,cAAc,EAAE,KAAK,CAAC,OAAO;SAC9B,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE7B,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IAC7D,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACzD,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;IACjE,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;IACjE,gBAAgB,CAAC,gBAAgB,CAC/B,WAAW,EACX,gCAAgC,CACjC,CAAC;IACF,iBAAiB,CAAC,gBAAgB,CAChC,WAAW,EACX,iCAAiC,CAClC,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,OAAO;QACZ,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;YAChE,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YAC5D,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;YACpE,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;YACpE,gBAAgB,CAAC,mBAAmB,CAClC,WAAW,EACX,gCAAgC,CACjC,CAAC;YACF,iBAAiB,CAAC,mBAAmB,CACnC,WAAW,EACX,iCAAiC,CAClC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"imageBlockHelpers.js","sourceRoot":"","sources":["../../../../src/blocks/ImageBlockContent/imageBlockHelpers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,EAAE;IAClE,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC;IAC1C,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,IAAI,SAAS,CAAC;IAErD,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC/B,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"videoBlockHelpers.js","sourceRoot":"","sources":["../../../../src/blocks/VideoBlockContent/videoBlockHelpers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAA8B,EAAE,EAAE;IAClE,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,SAAS,CAAC;IAC1C,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,IAAI,SAAS,CAAC;IAErD,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC/B,CAAC,CAAC"}