tinymce-solid 0.0.3 → 0.0.4
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 +15 -15
- package/dist/dev.jsx +602 -19
- package/dist/{dev.js → dev.mjs} +595 -23
- package/dist/index.jsx +9 -7
- package/dist/{index.js → index.mjs} +583 -11
- package/package.json +4 -3
- package/tailwind.config.js +53 -0
- package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -31
- package/.github/ISSUE_TEMPLATE/feature-request.yml +0 -27
- package/.github/codeql/codeql-config.yml +0 -2
- package/.github/workflows/badges.yml +0 -30
- package/.github/workflows/ci.yml +0 -47
- package/.github/workflows/codeql.yml +0 -75
package/README.md
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
[](https://github.com/thednp/tinymce-solid/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/tinymce-solid)
|
|
7
7
|
[](https://solidjs.com/)
|
|
8
|
-
[](https://www.tiny.cloud/)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://prettier.io/)
|
|
11
|
+
[](https://github.com/vitejs)
|
|
12
12
|
|
|
13
13
|
## About
|
|
14
14
|
|
|
15
15
|
This package is a wrapper around [TinyMCE](https://github.com/tinymce/tinymce) to make it easier to use in a SolidJS / SolidStart application.
|
|
16
16
|
|
|
17
17
|
- If you need detailed documentation on TinyMCE, see: [TinyMCE Documentation](https://www.tiny.cloud/docs/tinymce/7/).
|
|
18
|
-
- This is a community developed package forked from the TinyMCE React, see: [Official TinyMCE React](https://github.com/tinymce/tinymce-react)
|
|
19
|
-
- For
|
|
18
|
+
- This is a community developed package forked from the TinyMCE React, see: [Official TinyMCE React](https://github.com/tinymce/tinymce-react).
|
|
19
|
+
- For a quick test, check out the [demo](https://thednp.github.io/tinymce-solid/).
|
|
20
20
|
|
|
21
21
|
## Quick Start Guide
|
|
22
22
|
|
|
@@ -48,8 +48,8 @@ In your usual SolidJS SPA you can use **tinymce-solid** component like this.
|
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
50
|
import { createSignal } from "solid-js";
|
|
51
|
-
import {
|
|
52
|
-
import { SolidEditor } from "tinymce-solid";
|
|
51
|
+
import { type Editor } from "tinymce";
|
|
52
|
+
import { SolidEditor as Editor } from "tinymce-solid";
|
|
53
53
|
|
|
54
54
|
export default function App() {
|
|
55
55
|
let editorRef!: Editor;
|
|
@@ -57,7 +57,7 @@ export default function App() {
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<main>
|
|
60
|
-
<
|
|
60
|
+
<Editor
|
|
61
61
|
apiKey="your-api-key"
|
|
62
62
|
value={content()}
|
|
63
63
|
onInit={(_content: string, editor: Editor) => (editorRef = editor)}
|
|
@@ -87,17 +87,17 @@ When using SolidStart in SSR mode, you may want to bring the `clientOnly` loader
|
|
|
87
87
|
```tsx
|
|
88
88
|
import { clientOnly } from "@solidjs/start";
|
|
89
89
|
import { Component, createSignal } from "solid-js";
|
|
90
|
-
import {
|
|
90
|
+
import { type Editor } from "tinymce";
|
|
91
91
|
import { type IAllProps } from "tinymce-solid";
|
|
92
92
|
|
|
93
|
-
const
|
|
93
|
+
const Editor = clientOnly<Component<IAllProps>>(() => import("tinymce-solid"));
|
|
94
94
|
|
|
95
95
|
export default function App() {
|
|
96
96
|
const [content, setContent] = createSignal("");
|
|
97
97
|
|
|
98
98
|
return (
|
|
99
99
|
<main>
|
|
100
|
-
<
|
|
100
|
+
<Editor
|
|
101
101
|
apiKey="your-api-key"
|
|
102
102
|
value={content()}
|
|
103
103
|
init={{
|
|
@@ -125,15 +125,15 @@ export default function App() {
|
|
|
125
125
|
* *disabled*: **reactive** - toggles the `disabled` property of the editor
|
|
126
126
|
* *value*: **reactive** - the actual content;
|
|
127
127
|
* *initialValue*: **reactive** - the initial content value;
|
|
128
|
-
* *onEditorChange*: `(content: string, editor: Editor)` - the callback you can use to update the parent state;
|
|
128
|
+
* *onEditorChange*: `(content: string, editor: Editor) => void` - the callback you can use to update the parent state;
|
|
129
129
|
* all other TinyMCE properties are non-reactive and should work as designed for the original TinyMCE React component.
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
### Some notes
|
|
133
133
|
|
|
134
|
-
- This package will automatically load the tinymce library and its dependencies by the use of the `tinymceScriptSrc` property
|
|
135
|
-
- You can make use of the dark mode via TinyMCE skins
|
|
136
|
-
-
|
|
134
|
+
- This package will automatically load the tinymce library and its dependencies by the use of the `tinymceScriptSrc` property;
|
|
135
|
+
- You can make use of the dark mode via TinyMCE skins: `skin="oxide-dark"` and `contentCss="dark"` properties, this very demo is configured to make use of them via `createEffect`;
|
|
136
|
+
- Like the original React adaptation, this component allows you to hook into the TinyMCE instance via an `editorRef` reference.
|
|
137
137
|
|
|
138
138
|
## Issues
|
|
139
139
|
|