@novaprose/tinymce-compat 0.5.3 → 0.7.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.
- package/README.md +20 -8
- package/dist/index.cjs +401 -258
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -8
- package/dist/index.d.ts +29 -8
- package/dist/index.js +399 -255
- package/dist/index.js.map +1 -1
- package/dist/novaprose.css +291 -29
- package/dist/tinymce-chunks/advlist-7a360f16.js +2 -0
- package/dist/tinymce-chunks/advlist-7a360f16.js.map +7 -0
- package/dist/tinymce-chunks/autolink-7e2e7be2.js +2 -0
- package/dist/tinymce-chunks/autolink-7e2e7be2.js.map +7 -0
- package/dist/tinymce-chunks/autoresize-d6c9537b.js +2 -0
- package/dist/tinymce-chunks/autoresize-d6c9537b.js.map +7 -0
- package/dist/tinymce-chunks/autosave-4fd46720.js +2 -0
- package/dist/tinymce-chunks/autosave-4fd46720.js.map +7 -0
- package/dist/tinymce-chunks/charmap-4b14307a.js +2 -0
- package/dist/tinymce-chunks/charmap-4b14307a.js.map +7 -0
- package/dist/tinymce-chunks/comments-panel-37cba890.js +2 -0
- package/dist/tinymce-chunks/comments-panel-37cba890.js.map +7 -0
- package/dist/tinymce-chunks/directionality-60dba768.js +2 -0
- package/dist/tinymce-chunks/directionality-60dba768.js.map +7 -0
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js +2 -0
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js.map +7 -0
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js +2 -0
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js.map +7 -0
- package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js +2 -0
- package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js.map +7 -0
- package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js +2 -0
- package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js.map +7 -0
- package/dist/tinymce-chunks/paste-office-a38659d6.js +3 -0
- package/dist/tinymce-chunks/paste-office-a38659d6.js.map +7 -0
- package/dist/tinymce-chunks/quickbars-d937e10a.js +2 -0
- package/dist/tinymce-chunks/quickbars-d937e10a.js.map +7 -0
- package/dist/tinymce-chunks/revisionhistory-d6306426.js +2 -0
- package/dist/tinymce-chunks/revisionhistory-d6306426.js.map +7 -0
- package/dist/tinymce-chunks/table-80284f6f.js +2 -0
- package/dist/tinymce-chunks/table-80284f6f.js.map +7 -0
- package/dist/tinymce-chunks/visualblocks-58c88e5d.js +2 -0
- package/dist/tinymce-chunks/visualblocks-58c88e5d.js.map +7 -0
- package/dist/tinymce.global.js +27 -24
- package/dist/tinymce.global.js.map +7 -1
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ without rewriting it — then move to the native API when you are ready.
|
|
|
13
13
|
<!-- before -->
|
|
14
14
|
<script src="https://cdn.tiny.cloud/1/your-api-key/tinymce/7/tinymce.min.js"></script>
|
|
15
15
|
<!-- after -->
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/@novaprose/tinymce-compat/dist/tinymce.global.js"></script>
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/@novaprose/tinymce-compat@0.7/dist/tinymce.global.js"></script>
|
|
17
17
|
|
|
18
18
|
<script>
|
|
19
19
|
tinymce.init({
|
|
@@ -27,6 +27,11 @@ without rewriting it — then move to the native API when you are ready.
|
|
|
27
27
|
The script sets `window.tinymce` and loads its stylesheet (`novaprose.css`, next to the script).
|
|
28
28
|
`init()` can run in `<head>`: it waits for the document like TinyMCE.
|
|
29
29
|
|
|
30
|
+
Parts that most pages never need (table editing, optional plugins, Office paste cleanup, plugin
|
|
31
|
+
dialogs) are separate files in `dist/tinymce-chunks/`, loaded on demand from the same address as the script.
|
|
32
|
+
To host the files yourself, copy the whole `dist` folder — the script, `novaprose.css` and `tinymce-chunks/`.
|
|
33
|
+
Chunk file names include a content hash, so caches never mix files from different versions.
|
|
34
|
+
|
|
30
35
|
## npm
|
|
31
36
|
|
|
32
37
|
```bash
|
|
@@ -56,16 +61,23 @@ editor.on('change', () => console.log(editor.getContent()));
|
|
|
56
61
|
`onClose`, `onTabChange`; `api.getData/setData/close/block/unblock/focus/disable/enable/showTab`.
|
|
57
62
|
- **`editor.dom`** (reading): `select`, `get`, `getParent(s)`, `is`, `getAttrib`, `hasClass`, `encode`,
|
|
58
63
|
`decode`, `create`, `uniqueId`. **`editor.formatter`**: `apply`/`remove`/`toggle`/`match` for built-in
|
|
59
|
-
formats (`bold`…`h1`…`alignleft`…, `forecolor`, `hilitecolor`, `fontname`, `fontsize`)
|
|
64
|
+
formats (`bold`…`h1`…`alignleft`…, `forecolor`, `hilitecolor`, `fontname`, `fontsize`) and your own
|
|
65
|
+
(`formats` option, `formatter.register`). **`editor.selection`**: `getContent`, `setContent`, `getNode`,
|
|
66
|
+
`isCollapsed`, `collapse`, `setCursorLocation`, `select`.
|
|
60
67
|
- **`editor.ui.registry`**: `addButton`, `addToggleButton` (with `onSetup` and `api.setActive`),
|
|
61
|
-
`addMenuButton` (`fetch`), `addMenuItem`, `addContextToolbar`, `
|
|
68
|
+
`addMenuButton` (`fetch`), `addMenuItem`, `addContextToolbar`, `addSidebar` (with
|
|
69
|
+
`ToggleSidebar` and `queryCommandValue`), `addIcon`; TinyMCE icon names map to
|
|
62
70
|
NovaProse icons.
|
|
63
71
|
- **Events**: `init`, `input`, `change` (on blur after edits), `NodeChange`, `focus`, `blur`,
|
|
64
72
|
`keydown`, `keyup`, `click`, `paste`, `SetContent`, `GetContent`, `SaveContent`, `ExecCommand`,
|
|
65
73
|
`Dirty`, `remove`.
|
|
66
|
-
- **Options**: `toolbar`, `menubar`, `plugins`, `statusbar`, `placeholder`, `readonly`, `
|
|
67
|
-
`
|
|
68
|
-
`
|
|
74
|
+
- **Options**: `toolbar`, `menubar`, `plugins`, `statusbar`, `placeholder`, `readonly`, `disabled`
|
|
75
|
+
(also `editor.options.set('disabled', …)`), `resize`, `block_formats`, `file_picker_callback`, `file_picker_types`, `formats`, `style_formats`,
|
|
76
|
+
`style_formats_merge`, `valid_classes`, `table_class_list`, `table_cell_class_list` (without it all classes are kept, as in TinyMCE), `language`,
|
|
77
|
+
`inline`, `height`/`min_height`/`max_height`/`width`, `content_style`, `content_css` (your files; skin names
|
|
78
|
+
like `default` or `dark` are ignored), `images_upload_handler`,
|
|
79
|
+
`paste_as_text`, `paste_preprocess`, `valid_elements` (with attribute rules)/`invalid_elements`/`valid_styles`,
|
|
80
|
+
`extended_valid_elements`, `custom_elements`, `directionality`,
|
|
69
81
|
`font_family_formats`, `font_size_formats`, `line_height_formats`, `color_map`, `toolbar_mode`,
|
|
70
82
|
`setup`, `init_instance_callback`, `autosave_*`, `quickbars_*`, `mentions_fetch`.
|
|
71
83
|
- Form submit writes the HTML back into the textarea.
|
|
@@ -75,5 +87,5 @@ nothing; optional ones (`charmap`, `emoticons`, `anchor`, `media`, `autosave`…
|
|
|
75
87
|
Unknown options and plugins don't break initialization — they are listed in a console warning.
|
|
76
88
|
|
|
77
89
|
Not yet: direct DOM edits through `editor.dom` (NovaProse redraws the text from its document model —
|
|
78
|
-
use `setContent`, `insertContent` or `editor.formatter`),
|
|
79
|
-
`
|
|
90
|
+
use `setContent`, `insertContent` or `editor.formatter`), `addContextForm`; format features beyond
|
|
91
|
+
`block`/`inline`/`selector` + `classes`/`styles` (`wrapper`, `attributes`, `%value` variables, `div` blocks). See [the migration guide](https://novaprose.com/guides/migrating-from-tinymce/).
|