tinymce-solid 0.0.2 → 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 +27 -16
- package/components.json +2 -2
- package/dist/dev.jsx +609 -17
- package/dist/{dev.js → dev.mjs} +610 -33
- package/dist/index.jsx +26 -15
- package/dist/{index.js → index.mjs} +608 -31
- package/package.json +15 -7
- package/src/TinyMCE.ts +1 -1
- package/src/components/SolidEditor.tsx +28 -23
- package/tailwind.config.js +53 -0
- package/tsconfig.json +1 -0
- package/tsup.config.ts +0 -2
- 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
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# TinyMCE Component for SolidJS
|
|
2
2
|
|
|
3
|
-
[<img width="100%" src="
|
|
3
|
+
[<img width="100%" src="https://raw.githubusercontent.com/thednp/tinymce-solid/main/banner.svg" alt="TinyMCE Component for SolidJS">](https://thednp.github.io/tinymce-solid)
|
|
4
4
|
|
|
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
|
-
This package is a wrapper around [TinyMCE](https://github.com/tinymce/tinymce) to make it easier to use in a
|
|
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={{
|
|
@@ -118,11 +118,22 @@ export default function App() {
|
|
|
118
118
|
}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
### Properties
|
|
122
|
+
|
|
123
|
+
* *skin*: **reactive** - change the skin of the editor
|
|
124
|
+
* *contentCss*: **reactive** - change the styling of the content
|
|
125
|
+
* *disabled*: **reactive** - toggles the `disabled` property of the editor
|
|
126
|
+
* *value*: **reactive** - the actual content;
|
|
127
|
+
* *initialValue*: **reactive** - the initial content value;
|
|
128
|
+
* *onEditorChange*: `(content: string, editor: Editor) => void` - the callback you can use to update the parent state;
|
|
129
|
+
* all other TinyMCE properties are non-reactive and should work as designed for the original TinyMCE React component.
|
|
130
|
+
|
|
131
|
+
|
|
121
132
|
### Some notes
|
|
122
133
|
|
|
123
|
-
- This package will automatically load the tinymce library and its dependencies by the use of the `tinymceScriptSrc` property
|
|
124
|
-
- You can make use of the dark mode via TinyMCE skins
|
|
125
|
-
-
|
|
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.
|
|
126
137
|
|
|
127
138
|
## Issues
|
|
128
139
|
|