@novaprose/tinymce-compat 0.0.0-stage → 0.4.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NovaProse authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,71 @@
1
- # Temporary Holding Version
1
+ # @novaprose/tinymce-compat
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Keep your `tinymce.init()` code and switch the editor underneath to
4
+ [NovaProse](https://www.npmjs.com/package/@novaprose/core) — MIT licensed, no API key, no editor
5
+ loads.
6
+
7
+ > **Status: 0.x preview.** Common integrations work as is; less common APIs print a warning.
8
+ > NovaProse is not affiliated with Tiny Technologies. Compatibility is implemented from TinyMCE's
9
+ > public API documentation.
10
+
11
+ ## Script tag: replace one line
12
+
13
+ ```html
14
+ <!-- before -->
15
+ <script src="https://cdn.tiny.cloud/1/your-api-key/tinymce/7/tinymce.min.js"></script>
16
+ <!-- after -->
17
+ <script src="https://cdn.jsdelivr.net/npm/@novaprose/tinymce-compat/dist/tinymce.global.js"></script>
18
+
19
+ <script>
20
+ tinymce.init({
21
+ selector: 'textarea#post',
22
+ plugins: 'lists link image table code',
23
+ toolbar: 'undo redo | blocks | bold italic | bullist numlist | link image | code',
24
+ });
25
+ </script>
26
+ ```
27
+
28
+ The script sets `window.tinymce` and loads its stylesheet (`novaprose.css`, next to the script).
29
+ `init()` can run in `<head>`: it waits for the document like TinyMCE.
30
+
31
+ ## npm
32
+
33
+ ```bash
34
+ npm install @novaprose/tinymce-compat @novaprose/core
35
+ ```
36
+
37
+ ```ts
38
+ import '@novaprose/core/style.css';
39
+ import { tinymce } from '@novaprose/tinymce-compat';
40
+
41
+ const [editor] = await tinymce.init({ selector: '#post', plugins: 'lists link' });
42
+ editor.on('change', () => console.log(editor.getContent()));
43
+ ```
44
+
45
+ ## What works
46
+
47
+ - **`tinymce`**: `init` (selector, target, textarea or inline), `get`, `remove`, `activeEditor`,
48
+ `triggerSave`, `execCommand`, `PluginManager.add`, `IconManager.add`.
49
+ - **Editor**: `getContent`/`setContent`/`insertContent`, `execCommand` and `queryCommandState` for
50
+ the common commands (`Bold`, `FormatBlock`, `InsertUnorderedList`, `mceInsertContent`, `Undo`…),
51
+ `addCommand`, `on`/`off`/`once`/`fire`/`dispatch`, `selection`, `undoManager`, `mode`,
52
+ `isDirty`/`setDirty`/`save`, `focus`, `remove`, `notificationManager.open`,
53
+ `windowManager.alert`/`confirm`, `getParam`/`options.get`.
54
+ - **`editor.ui.registry`**: `addButton`, `addToggleButton` (with `onSetup` and `api.setActive`),
55
+ `addMenuButton` (`fetch`), `addMenuItem`, `addIcon`; TinyMCE icon names map to NovaProse icons.
56
+ - **Events**: `init`, `input`, `change` (on blur after edits), `NodeChange`, `focus`, `blur`,
57
+ `keydown`, `keyup`, `click`, `paste`, `SetContent`, `GetContent`, `SaveContent`, `ExecCommand`,
58
+ `Dirty`, `remove`.
59
+ - **Options**: `toolbar`, `menubar`, `plugins`, `statusbar`, `placeholder`, `readonly`, `language`,
60
+ `inline`, `height`/`min_height`/`max_height`/`width`, `content_style`, `images_upload_handler`,
61
+ `paste_as_text`, `paste_preprocess`, `valid_elements`/`invalid_elements`/`valid_styles`,
62
+ `font_family_formats`, `font_size_formats`, `line_height_formats`, `color_map`, `toolbar_mode`,
63
+ `setup`, `init_instance_callback`, `autosave_*`, `quickbars_*`, `mentions_fetch`.
64
+ - Form submit writes the HTML back into the textarea.
65
+
66
+ Plugins built into NovaProse (`lists`, `link`, `image`, `table`, `code`, `searchreplace`…) need
67
+ nothing; optional ones (`charmap`, `emoticons`, `anchor`, `media`, `autosave`…) load by name.
68
+ Unknown options and plugins don't break initialization — they are listed in a console warning.
69
+
70
+ Not yet: `windowManager.open` dialogs, `addContextToolbar`, `editor.dom`/`editor.formatter`, iframe
71
+ content (`content_css`). See [the migration guide](https://novaprose.com/guides/migrating-from-tinymce/).