@standardnotes/bold-editor 1.7.1 → 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 +46 -0
- package/app/components/Editor.js +5 -48
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.LICENSE.txt +0 -6
- package/dist/vendor.css +0 -4
- package/package.json +8 -5
- package/webpack.config.js +0 -6
- package/webpack.dev.js +0 -3
- package/dist/filesafe-js/EncryptionWorker.js +0 -2
- package/dist/filesafe-js/EncryptionWorker.js.LICENSE.txt +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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
|
+
|
|
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)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
15
|
+
|
|
16
|
+
## [1.7.10](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.9...@standardnotes/bold-editor@1.7.10) (2026-01-16)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
19
|
+
|
|
20
|
+
## [1.7.9](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.8...@standardnotes/bold-editor@1.7.9) (2026-01-16)
|
|
21
|
+
|
|
22
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
23
|
+
|
|
24
|
+
## [1.7.8](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.7...@standardnotes/bold-editor@1.7.8) (2026-01-15)
|
|
25
|
+
|
|
26
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
27
|
+
|
|
28
|
+
## [1.7.7](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.6...@standardnotes/bold-editor@1.7.7) (2026-01-15)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
31
|
+
|
|
32
|
+
## [1.7.6](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.5...@standardnotes/bold-editor@1.7.6) (2026-01-14)
|
|
33
|
+
|
|
34
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
35
|
+
|
|
36
|
+
## [1.7.5](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.4...@standardnotes/bold-editor@1.7.5) (2026-01-14)
|
|
37
|
+
|
|
38
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
39
|
+
|
|
40
|
+
## [1.7.4](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.3...@standardnotes/bold-editor@1.7.4) (2026-01-14)
|
|
41
|
+
|
|
42
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
43
|
+
|
|
44
|
+
## [1.7.3](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.2...@standardnotes/bold-editor@1.7.3) (2026-01-14)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
47
|
+
|
|
48
|
+
## [1.7.2](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.1...@standardnotes/bold-editor@1.7.2) (2026-01-13)
|
|
49
|
+
|
|
50
|
+
**Note:** Version bump only for package @standardnotes/bold-editor
|
|
51
|
+
|
|
6
52
|
## [1.7.1](https://github.com/standardnotes/plugins/compare/@standardnotes/bold-editor@1.7.0...@standardnotes/bold-editor@1.7.1) (2024-02-22)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @standardnotes/bold-editor
|
package/app/components/Editor.js
CHANGED
|
@@ -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', '
|
|
170
|
+
'fontfamily', 'fontcolor', 'link', 'lists', 'alignment',
|
|
189
171
|
'line', 'redo', 'undo', 'indent', 'outdent', 'textdirection', 'html'
|
|
190
172
|
],
|
|
191
173
|
plugins: [
|
|
192
|
-
'
|
|
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
|
|
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
|
*/
|