@standardnotes/bold-editor 1.7.11 → 1.7.12

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.7.12](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.11...@standardnotes/bold-editor@1.7.12) (2026-02-05)
7
+
8
+ ### Bug Fixes
9
+
10
+ * Removes filesafe dependency from bold editor ([#69](https://github.com/standardnotes/plugins/issues/69)) ([8d168d4](https://github.com/standardnotes/plugins/commit/8d168d4db685a7f9912f42d67a90a57bc1eaf191))
11
+
6
12
  ## [1.7.11](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.10...@standardnotes/bold-editor@1.7.11) (2026-01-16)
7
13
 
8
14
  **Note:** Version bump only for package @standardnotes/bold-editor
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
- import FilesafeEmbed from 'filesafe-embed';
3
2
  import EditorKit from '@standardnotes/editor-kit';
4
3
  import DOMPurify from 'dompurify';
5
4
  import { SKAlert } from 'sn-stylekit';
6
5
 
7
- // Not used directly here, but required to be imported so that it is included
8
- // in dist file.
9
- // Note that filesafe-embed also imports filesafe-js, but conditionally, so
10
- // it's not included in it's own dist files.
11
- // eslint-disable-next-line no-unused-vars
12
- import Filesafe from 'filesafe-js';
13
-
14
6
  export default class Editor extends React.Component {
15
7
 
16
8
  constructor(props) {
@@ -161,35 +153,25 @@ export default class Editor extends React.Component {
161
153
 
162
154
  this.editorKit = new EditorKit(delegate, {
163
155
  mode: 'html',
164
- supportsFileSafe: true,
165
156
  // Redactor has its own debouncing, so we'll set ours to 0
166
157
  coallesedSavingDelay: 0
167
158
  });
168
159
  }
169
160
 
170
161
  async configureEditor() {
171
- // We need to set this as a window variable so that the filesafe plugin
172
- // can interact with this object passing it as an opt for some reason
173
- // strips any functions off the objects.
174
- const filesafeInstance = await this.editorKit.getFileSafe();
175
- window.filesafe_params = {
176
- embed: FilesafeEmbed,
177
- client: filesafeInstance
178
- };
179
162
  this.redactor = $R('#editor', {
180
163
  styles: true,
181
164
  toolbarFixed: true, // sticky toolbar
182
165
  tabAsSpaces: 2, // currently tab only works if you use spaces.
183
166
  tabKey: true, // explicitly set tabkey for editor use, not for focus.
184
167
  linkSize: 20000, // redactor default is 30, which truncates the link.
185
- buttonsAdd: ['filesafe'],
186
168
  buttons: [
187
169
  'bold', 'italic', 'underline', 'deleted', 'format', 'fontsize',
188
- 'fontfamily', 'fontcolor', 'filesafe', 'link', 'lists', 'alignment',
170
+ 'fontfamily', 'fontcolor', 'link', 'lists', 'alignment',
189
171
  'line', 'redo', 'undo', 'indent', 'outdent', 'textdirection', 'html'
190
172
  ],
191
173
  plugins: [
192
- 'filesafe', 'fontsize', 'fontfamily', 'fontcolor', 'alignment',
174
+ 'fontsize', 'fontfamily', 'fontcolor', 'alignment',
193
175
  'table', 'inlinestyle', 'textdirection'
194
176
  ],
195
177
  fontfamily: [
@@ -206,7 +188,7 @@ export default class Editor extends React.Component {
206
188
  this.editorKit.onEditorValueChanged(html);
207
189
  },
208
190
  pasted: (_nodes) => {
209
- this.editorKit.onEditorPaste();
191
+ this.editorKit.onEditorPaste?.();
210
192
  },
211
193
  image: {
212
194
  resized: (image) => {
@@ -222,16 +204,12 @@ export default class Editor extends React.Component {
222
204
  imageEditable: false,
223
205
  imageCaption: false,
224
206
  imageLink: false,
225
- imageResizable: true, // requires image to be wrapped in a figure.
226
- imageUpload: (formData, files, _event) => {
227
- // Called when images are pasted from the clipboard too.
228
- this.onEditorFilesDrop(files);
229
- }
207
+ imageResizable: true // requires image to be wrapped in a figure.
230
208
  });
231
209
 
232
210
  this.redactor.editor.getElement().on('keyup.textsearcher', (event) => {
233
211
  const key = event.which;
234
- this.editorKit.onEditorKeyUp({
212
+ this.editorKit.onEditorKeyUp?.({
235
213
  key,
236
214
  isSpace: key == this.redactor.keycodes.SPACE,
237
215
  isEnter: key == this.redactor.keycodes.ENTER
@@ -246,27 +224,6 @@ export default class Editor extends React.Component {
246
224
  }
247
225
  }
248
226
 
249
- onEditorFilesDrop(files) {
250
- if (!this.editorKit.canUseFileSafe()) {
251
- return;
252
- }
253
-
254
- if (!this.editorKit.canUploadFiles()) {
255
- // Open filesafe modal
256
- this.redactor.plugin.filesafe.open();
257
- return;
258
- }
259
-
260
- for (const file of files) {
261
- // Observers in EditorKitInternal.js will handle successful upload
262
- this.editorKit.uploadJSFileObject(file).then((descriptor) => {
263
- if (!descriptor || !descriptor.uuid) {
264
- // alert("File failed to upload. Please try again");
265
- }
266
- });
267
- }
268
- }
269
-
270
227
  /**
271
228
  * Checks if HTML is safe to render.
272
229
  */