tinymce-solid 0.0.4 → 0.0.6
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 -16
- package/banner.svg +98 -98
- package/dist/{dev.mjs → dev.js} +28 -618
- package/dist/dev.jsx +11 -595
- package/dist/index.d.ts +5 -5
- package/dist/{index.mjs → index.js} +26 -616
- package/dist/index.jsx +10 -13
- package/package.json +13 -13
- package/src/Utils.ts +1 -1
- package/src/components/{SolidEditor.tsx → Editor.tsx} +8 -13
- package/src/index.tsx +2 -2
package/dist/index.jsx
CHANGED
|
@@ -105,8 +105,9 @@ var require_prop_types = __commonJS({
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
// src/components/
|
|
108
|
+
// src/components/Editor.tsx
|
|
109
109
|
import { createEffect, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
110
|
+
import { Dynamic } from "solid-js/web";
|
|
110
111
|
|
|
111
112
|
// src/components/EditorPropTypes.ts
|
|
112
113
|
var PropTypes = __toESM(require_prop_types(), 1);
|
|
@@ -226,7 +227,7 @@ var EditorPropTypes = {
|
|
|
226
227
|
// src/Utils.ts
|
|
227
228
|
var isFunction = (x) => typeof x === "function";
|
|
228
229
|
var isEventProp = (name) => name in eventPropTypes;
|
|
229
|
-
var eventAttrToEventName = (attrName) => attrName.
|
|
230
|
+
var eventAttrToEventName = (attrName) => String(attrName.slice(2));
|
|
230
231
|
var configHandlers2 = (handlerLookup, on2, off, adapter, prevProps, props, boundHandlers) => {
|
|
231
232
|
const prevEventKeys = Object.keys(prevProps).filter(isEventProp);
|
|
232
233
|
const currEventKeys = Object.keys(props).filter(isEventProp);
|
|
@@ -421,12 +422,13 @@ var getTinymce = (view) => {
|
|
|
421
422
|
return global && global.tinymce ? global.tinymce : null;
|
|
422
423
|
};
|
|
423
424
|
|
|
424
|
-
// src/components/
|
|
425
|
-
var
|
|
425
|
+
// src/components/Editor.tsx
|
|
426
|
+
var Editor = (props) => {
|
|
426
427
|
const [id] = createSignal(props.id || uuid("solid-tinymce-editor"));
|
|
427
428
|
const initialValue = () => props.initialValue;
|
|
428
429
|
const value = () => props.value || "";
|
|
429
430
|
const skin = () => props.skin || "oxide";
|
|
431
|
+
const tagName = () => props.tagName || "div";
|
|
430
432
|
const contentCss = () => props.contentCss || "default";
|
|
431
433
|
const disabled = () => props.disabled || false;
|
|
432
434
|
const [editor, setEditor] = createSignal();
|
|
@@ -697,23 +699,18 @@ var SolidEditor = (props) => {
|
|
|
697
699
|
handleBeforeInput(evt);
|
|
698
700
|
}
|
|
699
701
|
};
|
|
700
|
-
return
|
|
701
|
-
|
|
702
|
-
ref={props.elementRef}
|
|
702
|
+
return <Dynamic
|
|
703
|
+
component={props.inline ? tagName() : "textarea"}
|
|
703
704
|
id={id()}
|
|
704
705
|
data-testid={props.testid}
|
|
705
706
|
tabIndex={props.tabIndex}
|
|
706
|
-
/> : <textarea
|
|
707
|
-
style={{ visibility: "hidden" }}
|
|
708
707
|
ref={props.elementRef}
|
|
709
|
-
|
|
710
|
-
data-testid={props.testid}
|
|
711
|
-
tabIndex={props.tabIndex}
|
|
708
|
+
{...props}
|
|
712
709
|
/>;
|
|
713
710
|
};
|
|
714
711
|
|
|
715
712
|
// src/index.tsx
|
|
716
|
-
var src_default =
|
|
713
|
+
var src_default = Editor;
|
|
717
714
|
export {
|
|
718
715
|
EditorPropTypes,
|
|
719
716
|
src_default as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinymce-solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "📝 TinyMCE Component for SolidJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,29 +20,29 @@
|
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"solid-js": "^1.8.
|
|
24
|
-
"tinymce": "^7.1
|
|
23
|
+
"solid-js": "^1.8.18",
|
|
24
|
+
"tinymce": "^7.2.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@kobalte/core": "^0.13.3",
|
|
28
28
|
"@kobalte/utils": "^0.9.0",
|
|
29
|
-
"@types/node": "^20.14.
|
|
29
|
+
"@types/node": "^20.14.11",
|
|
30
30
|
"@types/prop-types": "^15.7.12",
|
|
31
31
|
"autoprefixer": "^10.4.19",
|
|
32
32
|
"class-variance-authority": "^0.7.0",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
34
|
-
"postcss": "^8.4.
|
|
35
|
-
"prettier": "^3.3.
|
|
34
|
+
"postcss": "^8.4.39",
|
|
35
|
+
"prettier": "^3.3.3",
|
|
36
36
|
"prop-types": "^15.8.1",
|
|
37
|
-
"tailwind-merge": "^2.
|
|
38
|
-
"tailwindcss": "^3.4.
|
|
37
|
+
"tailwind-merge": "^2.4.0",
|
|
38
|
+
"tailwindcss": "^3.4.6",
|
|
39
39
|
"tailwindcss-animate": "^1.0.7",
|
|
40
|
-
"tsup": "^8.1
|
|
40
|
+
"tsup": "^8.2.1",
|
|
41
41
|
"tsup-preset-solid": "^2.2.0",
|
|
42
|
-
"typescript": "^5.
|
|
43
|
-
"typescript-eslint": "^7.
|
|
44
|
-
"vite": "^5.
|
|
45
|
-
"vite-plugin-compression2": "^1.1.
|
|
42
|
+
"typescript": "^5.5.3",
|
|
43
|
+
"typescript-eslint": "^7.16.1",
|
|
44
|
+
"vite": "^5.3.4",
|
|
45
|
+
"vite-plugin-compression2": "^1.1.3",
|
|
46
46
|
"vite-plugin-solid": "^2.10.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
package/src/Utils.ts
CHANGED
|
@@ -9,7 +9,7 @@ const isEventProp = (name: string): name is keyof IEventPropTypes =>
|
|
|
9
9
|
name in eventPropTypes;
|
|
10
10
|
|
|
11
11
|
const eventAttrToEventName = <T extends string>(attrName: `on${T}`): T =>
|
|
12
|
-
attrName.
|
|
12
|
+
String(attrName.slice(2)) as T;
|
|
13
13
|
|
|
14
14
|
type PropLookup = <K extends keyof IAllProps>(key: K) => IAllProps[K];
|
|
15
15
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createEffect, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
2
|
+
import { Dynamic } from "solid-js/web";
|
|
2
3
|
import { type ScriptItem, ScriptLoader } from "../ScriptLoader2";
|
|
3
4
|
import { getTinymce } from "../TinyMCE";
|
|
4
5
|
import {
|
|
@@ -21,11 +22,12 @@ import {
|
|
|
21
22
|
} from "./EditorPropTypes";
|
|
22
23
|
import { Bookmark, Editor as TinyMCEEditor, EditorEvent } from "tinymce";
|
|
23
24
|
|
|
24
|
-
export const
|
|
25
|
+
export const Editor = (props: Partial<IAllProps>) => {
|
|
25
26
|
const [id] = createSignal(props.id || uuid("solid-tinymce-editor"));
|
|
26
27
|
const initialValue = () => props.initialValue;
|
|
27
28
|
const value = () => props.value || "";
|
|
28
29
|
const skin = () => props.skin || "oxide";
|
|
30
|
+
const tagName = () => props.tagName || "div";
|
|
29
31
|
const contentCss = () => props.contentCss || "default";
|
|
30
32
|
const disabled = () => props.disabled || false;
|
|
31
33
|
const [editor, setEditor] = createSignal<TinyMCEEditor>();
|
|
@@ -376,21 +378,14 @@ export const SolidEditor = (props: Partial<IAllProps>) => {
|
|
|
376
378
|
}
|
|
377
379
|
};
|
|
378
380
|
|
|
379
|
-
return
|
|
380
|
-
<
|
|
381
|
-
|
|
382
|
-
ref={props.elementRef as HTMLDivElement}
|
|
383
|
-
id={id()}
|
|
384
|
-
data-testid={props.testid}
|
|
385
|
-
tabIndex={props.tabIndex}
|
|
386
|
-
/>
|
|
387
|
-
) : (
|
|
388
|
-
<textarea
|
|
389
|
-
style={{ visibility: "hidden" }}
|
|
390
|
-
ref={props.elementRef as HTMLTextAreaElement}
|
|
381
|
+
return (
|
|
382
|
+
<Dynamic
|
|
383
|
+
component={props.inline ? tagName() : "textarea"}
|
|
391
384
|
id={id()}
|
|
392
385
|
data-testid={props.testid}
|
|
393
386
|
tabIndex={props.tabIndex}
|
|
387
|
+
ref={props.elementRef}
|
|
388
|
+
{...props}
|
|
394
389
|
/>
|
|
395
390
|
);
|
|
396
391
|
};
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Editor } from "./components/Editor";
|
|
2
2
|
import { type IAllProps, EditorPropTypes } from "./components/EditorPropTypes";
|
|
3
3
|
|
|
4
|
-
export default
|
|
4
|
+
export default Editor;
|
|
5
5
|
export { type IAllProps };
|
|
6
6
|
export { EditorPropTypes };
|