tinymce-solid 0.0.9 → 0.0.10
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 +5 -5
- package/dist/dev.js +34 -28
- package/dist/dev.jsx +18 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +34 -28
- package/dist/index.jsx +18 -12
- package/package.json +27 -27
- package/vitest.config-ui.ts +33 -0
- package/vitest.config.ts +32 -0
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
[](https://coveralls.io/github/thednp/tinymce-solid)
|
|
6
6
|
[](https://github.com/thednp/tinymce-solid/actions/workflows/ci.yml)
|
|
7
7
|
[](https://www.npmjs.com/package/tinymce-solid)
|
|
8
|
-
[](https://solidjs.com/)
|
|
9
|
+
[](https://www.tiny.cloud/)
|
|
10
|
+
[](https://www.typescriptlang.org/)
|
|
11
|
+
[](https://vitest.dev/)
|
|
12
|
+
[](https://github.com/vitejs)
|
|
13
13
|
|
|
14
14
|
## About
|
|
15
15
|
|
package/dist/dev.js
CHANGED
|
@@ -952,7 +952,10 @@ var normalizePluginArray = (plugins) => {
|
|
|
952
952
|
if (typeof plugins === "undefined" || plugins === "") {
|
|
953
953
|
return [];
|
|
954
954
|
}
|
|
955
|
-
return Array.isArray(plugins) ?
|
|
955
|
+
return Array.isArray(plugins) ? (
|
|
956
|
+
/* istanbul ignore next */
|
|
957
|
+
plugins
|
|
958
|
+
) : plugins.split(" ");
|
|
956
959
|
};
|
|
957
960
|
var mergePlugins = (initPlugins, inputPlugins) => normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
958
961
|
var isBeforeInputEventAvailable = () => globalThis.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
|
|
@@ -1378,33 +1381,36 @@ var Editor = (props) => {
|
|
|
1378
1381
|
handleBeforeInput(evt);
|
|
1379
1382
|
}
|
|
1380
1383
|
};
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1384
|
+
return (
|
|
1385
|
+
/* istanbul ignore next @preserve */
|
|
1386
|
+
createComponent(Dynamic, mergeProps(props, {
|
|
1387
|
+
get component() {
|
|
1388
|
+
return memo(() => !!props.inline)() ? tagName() : "textarea";
|
|
1389
|
+
},
|
|
1390
|
+
get id() {
|
|
1391
|
+
return id();
|
|
1392
|
+
},
|
|
1393
|
+
get ["data-testid"]() {
|
|
1394
|
+
return props.testid;
|
|
1395
|
+
},
|
|
1396
|
+
get tabIndex() {
|
|
1397
|
+
return props.tabIndex;
|
|
1398
|
+
},
|
|
1399
|
+
ref(r$) {
|
|
1400
|
+
var _ref$ = props.elementRef;
|
|
1401
|
+
typeof _ref$ === "function" ? _ref$(r$) : props.elementRef = r$;
|
|
1402
|
+
},
|
|
1403
|
+
get ["data-disabled"]() {
|
|
1404
|
+
return disabled();
|
|
1405
|
+
},
|
|
1406
|
+
get ["data-skin"]() {
|
|
1407
|
+
return skin();
|
|
1408
|
+
},
|
|
1409
|
+
get ["data-css"]() {
|
|
1410
|
+
return contentCss();
|
|
1411
|
+
}
|
|
1412
|
+
}))
|
|
1413
|
+
);
|
|
1408
1414
|
};
|
|
1409
1415
|
|
|
1410
1416
|
// src/index.tsx
|
package/dist/dev.jsx
CHANGED
|
@@ -966,7 +966,10 @@ var normalizePluginArray = (plugins) => {
|
|
|
966
966
|
if (typeof plugins === "undefined" || plugins === "") {
|
|
967
967
|
return [];
|
|
968
968
|
}
|
|
969
|
-
return Array.isArray(plugins) ?
|
|
969
|
+
return Array.isArray(plugins) ? (
|
|
970
|
+
/* istanbul ignore next */
|
|
971
|
+
plugins
|
|
972
|
+
) : plugins.split(" ");
|
|
970
973
|
};
|
|
971
974
|
var mergePlugins = (initPlugins, inputPlugins) => normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
972
975
|
var isBeforeInputEventAvailable = () => globalThis.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
|
|
@@ -1400,17 +1403,20 @@ var Editor = (props) => {
|
|
|
1400
1403
|
handleBeforeInput(evt);
|
|
1401
1404
|
}
|
|
1402
1405
|
};
|
|
1403
|
-
return
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1406
|
+
return (
|
|
1407
|
+
/* istanbul ignore next @preserve */
|
|
1408
|
+
<Dynamic
|
|
1409
|
+
{...props}
|
|
1410
|
+
component={props.inline ? tagName() : "textarea"}
|
|
1411
|
+
id={id()}
|
|
1412
|
+
data-testid={props.testid}
|
|
1413
|
+
tabIndex={props.tabIndex}
|
|
1414
|
+
ref={props.elementRef}
|
|
1415
|
+
data-disabled={disabled()}
|
|
1416
|
+
data-skin={skin()}
|
|
1417
|
+
data-css={contentCss()}
|
|
1418
|
+
/>
|
|
1419
|
+
);
|
|
1414
1420
|
};
|
|
1415
1421
|
|
|
1416
1422
|
// src/index.tsx
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as solid_js from 'solid-js';
|
|
2
2
|
import * as PropTypes from 'prop-types';
|
|
3
|
-
import { EditorEvent, Editor as Editor$1,
|
|
3
|
+
import { Events, EditorEvent, Editor as Editor$1, TinyMCE } from 'tinymce';
|
|
4
4
|
|
|
5
5
|
type EventHandler<A> = (a: EditorEvent<A>, editor: Editor$1) => unknown;
|
|
6
6
|
type EEventHandler<K extends keyof Events.EditorEventMap> = EventHandler<Events.EditorEventMap[K]>;
|
package/dist/index.js
CHANGED
|
@@ -256,7 +256,10 @@ var normalizePluginArray = (plugins) => {
|
|
|
256
256
|
if (typeof plugins === "undefined" || plugins === "") {
|
|
257
257
|
return [];
|
|
258
258
|
}
|
|
259
|
-
return Array.isArray(plugins) ?
|
|
259
|
+
return Array.isArray(plugins) ? (
|
|
260
|
+
/* istanbul ignore next */
|
|
261
|
+
plugins
|
|
262
|
+
) : plugins.split(" ");
|
|
260
263
|
};
|
|
261
264
|
var mergePlugins = (initPlugins, inputPlugins) => normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
262
265
|
var isBeforeInputEventAvailable = () => globalThis.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
|
|
@@ -682,33 +685,36 @@ var Editor = (props) => {
|
|
|
682
685
|
handleBeforeInput(evt);
|
|
683
686
|
}
|
|
684
687
|
};
|
|
685
|
-
return
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
688
|
+
return (
|
|
689
|
+
/* istanbul ignore next @preserve */
|
|
690
|
+
createComponent(Dynamic, mergeProps(props, {
|
|
691
|
+
get component() {
|
|
692
|
+
return memo(() => !!props.inline)() ? tagName() : "textarea";
|
|
693
|
+
},
|
|
694
|
+
get id() {
|
|
695
|
+
return id();
|
|
696
|
+
},
|
|
697
|
+
get ["data-testid"]() {
|
|
698
|
+
return props.testid;
|
|
699
|
+
},
|
|
700
|
+
get tabIndex() {
|
|
701
|
+
return props.tabIndex;
|
|
702
|
+
},
|
|
703
|
+
ref(r$) {
|
|
704
|
+
var _ref$ = props.elementRef;
|
|
705
|
+
typeof _ref$ === "function" ? _ref$(r$) : props.elementRef = r$;
|
|
706
|
+
},
|
|
707
|
+
get ["data-disabled"]() {
|
|
708
|
+
return disabled();
|
|
709
|
+
},
|
|
710
|
+
get ["data-skin"]() {
|
|
711
|
+
return skin();
|
|
712
|
+
},
|
|
713
|
+
get ["data-css"]() {
|
|
714
|
+
return contentCss();
|
|
715
|
+
}
|
|
716
|
+
}))
|
|
717
|
+
);
|
|
712
718
|
};
|
|
713
719
|
|
|
714
720
|
// src/index.tsx
|
package/dist/index.jsx
CHANGED
|
@@ -268,7 +268,10 @@ var normalizePluginArray = (plugins) => {
|
|
|
268
268
|
if (typeof plugins === "undefined" || plugins === "") {
|
|
269
269
|
return [];
|
|
270
270
|
}
|
|
271
|
-
return Array.isArray(plugins) ?
|
|
271
|
+
return Array.isArray(plugins) ? (
|
|
272
|
+
/* istanbul ignore next */
|
|
273
|
+
plugins
|
|
274
|
+
) : plugins.split(" ");
|
|
272
275
|
};
|
|
273
276
|
var mergePlugins = (initPlugins, inputPlugins) => normalizePluginArray(initPlugins).concat(normalizePluginArray(inputPlugins));
|
|
274
277
|
var isBeforeInputEventAvailable = () => globalThis.InputEvent && typeof InputEvent.prototype.getTargetRanges === "function";
|
|
@@ -702,17 +705,20 @@ var Editor = (props) => {
|
|
|
702
705
|
handleBeforeInput(evt);
|
|
703
706
|
}
|
|
704
707
|
};
|
|
705
|
-
return
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
708
|
+
return (
|
|
709
|
+
/* istanbul ignore next @preserve */
|
|
710
|
+
<Dynamic
|
|
711
|
+
{...props}
|
|
712
|
+
component={props.inline ? tagName() : "textarea"}
|
|
713
|
+
id={id()}
|
|
714
|
+
data-testid={props.testid}
|
|
715
|
+
tabIndex={props.tabIndex}
|
|
716
|
+
ref={props.elementRef}
|
|
717
|
+
data-disabled={disabled()}
|
|
718
|
+
data-skin={skin()}
|
|
719
|
+
data-css={contentCss()}
|
|
720
|
+
/>
|
|
721
|
+
);
|
|
716
722
|
};
|
|
717
723
|
|
|
718
724
|
// src/index.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinymce-solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "📝 TinyMCE Component for SolidJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,35 +20,35 @@
|
|
|
20
20
|
"registry": "https://registry.npmjs.org/"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"solid-js": "^1.9.
|
|
24
|
-
"tinymce": "^7.
|
|
23
|
+
"solid-js": "^1.9.7",
|
|
24
|
+
"tinymce": "^7.9.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@kobalte/core": "^0.13.
|
|
27
|
+
"@kobalte/core": "^0.13.9",
|
|
28
28
|
"@kobalte/utils": "^0.9.1",
|
|
29
29
|
"@testing-library/jest-dom": "^6.6.3",
|
|
30
|
-
"@types/node": "^
|
|
31
|
-
"@types/prop-types": "^15.7.
|
|
32
|
-
"@vitest/browser": "^
|
|
33
|
-
"@vitest/coverage-istanbul": "^
|
|
34
|
-
"@vitest/ui": "^
|
|
35
|
-
"autoprefixer": "^10.4.
|
|
36
|
-
"class-variance-authority": "^0.7.
|
|
30
|
+
"@types/node": "^22.15.24",
|
|
31
|
+
"@types/prop-types": "^15.7.14",
|
|
32
|
+
"@vitest/browser": "^3.1.4",
|
|
33
|
+
"@vitest/coverage-istanbul": "^3.1.4",
|
|
34
|
+
"@vitest/ui": "^3.1.4",
|
|
35
|
+
"autoprefixer": "^10.4.21",
|
|
36
|
+
"class-variance-authority": "^0.7.1",
|
|
37
37
|
"clsx": "^2.1.1",
|
|
38
|
-
"jsdom": "^
|
|
39
|
-
"playwright": "^1.
|
|
40
|
-
"postcss": "^8.
|
|
38
|
+
"jsdom": "^26.1.0",
|
|
39
|
+
"playwright": "^1.52.0",
|
|
40
|
+
"postcss": "^8.5.3",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
|
-
"tailwind-merge": "^
|
|
43
|
-
"tailwindcss": "
|
|
44
|
-
"tailwindcss-animate": "
|
|
45
|
-
"tsup": "^8.
|
|
42
|
+
"tailwind-merge": "^3.3.0",
|
|
43
|
+
"tailwindcss": "3.4.17",
|
|
44
|
+
"tailwindcss-animate": "1.0.7",
|
|
45
|
+
"tsup": "^8.5.0",
|
|
46
46
|
"tsup-preset-solid": "^2.2.0",
|
|
47
|
-
"typescript": "^5.
|
|
48
|
-
"vite": "^
|
|
49
|
-
"vite-plugin-compression2": "^1.
|
|
50
|
-
"vite-plugin-solid": "^2.
|
|
51
|
-
"vitest": "^
|
|
47
|
+
"typescript": "^5.8.3",
|
|
48
|
+
"vite": "^6.3.5",
|
|
49
|
+
"vite-plugin-compression2": "^1.4.0",
|
|
50
|
+
"vite-plugin-solid": "^2.11.6",
|
|
51
|
+
"vitest": "^3.1.4"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=18"
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
"typesVersions": {},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"pre-test": "pnpm clean-coverage",
|
|
79
|
-
"test": "pnpm pre-test && vitest --config vitest.config.
|
|
80
|
-
"test-ui": "pnpm pre-test && vitest --config vitest.config-ui.
|
|
79
|
+
"test": "pnpm pre-test && vitest --config vitest.config.ts",
|
|
80
|
+
"test-ui": "pnpm pre-test && vitest --config vitest.config-ui.ts",
|
|
81
81
|
"clean-coverage": "rm -rf coverage .nyc_output",
|
|
82
82
|
"format": "deno fmt src",
|
|
83
83
|
"build": "tsup",
|
|
84
84
|
"build:all": "pnpm build && pnpm build:docs",
|
|
85
85
|
"dev": "vite serve demo",
|
|
86
|
-
"build:docs": "vite build demo --config demo/vite.config.docs.
|
|
87
|
-
"copy:tiny": "cp -a './node_modules/.pnpm/tinymce@7.
|
|
86
|
+
"build:docs": "vite build demo --config demo/vite.config.docs.ts",
|
|
87
|
+
"copy:tiny": "cp -a './node_modules/.pnpm/tinymce@7.9.0/node_modules/tinymce' './demo/public'",
|
|
88
88
|
"serve:docs": "vite serve docs --port 3000",
|
|
89
89
|
"badges": "npx -p dependency-version-badge update-badge solid-js tinymce typescript vitest vite",
|
|
90
90
|
"lint": "pnpm lint:types && pnpm lint:code",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import solid from "vite-plugin-solid";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [solid()],
|
|
7
|
+
resolve: {
|
|
8
|
+
conditions: ["development", "browser"],
|
|
9
|
+
alias: {
|
|
10
|
+
"~": path.resolve(__dirname, "src"),
|
|
11
|
+
"@": path.resolve(__dirname),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
publicDir: path.resolve(__dirname, "demo/public"),
|
|
15
|
+
test: {
|
|
16
|
+
globals: true,
|
|
17
|
+
coverage: {
|
|
18
|
+
provider: "istanbul",
|
|
19
|
+
reporter: ["html", "text", "lcov"],
|
|
20
|
+
enabled: true,
|
|
21
|
+
include: ["src/**/*.{ts,tsx}"],
|
|
22
|
+
},
|
|
23
|
+
browser: {
|
|
24
|
+
provider: 'preview', // or 'webdriverio'
|
|
25
|
+
enabled: true,
|
|
26
|
+
headless: false,
|
|
27
|
+
instances: [
|
|
28
|
+
{ browser: 'chromium' }
|
|
29
|
+
]
|
|
30
|
+
// enableUI: true
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import solid from "vite-plugin-solid";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [solid()],
|
|
7
|
+
resolve: {
|
|
8
|
+
conditions: ["development", "browser"],
|
|
9
|
+
alias: {
|
|
10
|
+
"~": path.resolve(__dirname, "src"),
|
|
11
|
+
"@": path.resolve(__dirname),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
publicDir: path.resolve(__dirname, "demo/public"),
|
|
15
|
+
test: {
|
|
16
|
+
globals: true,
|
|
17
|
+
coverage: {
|
|
18
|
+
provider: "istanbul",
|
|
19
|
+
reporter: ["html", "text", "lcov"],
|
|
20
|
+
enabled: true,
|
|
21
|
+
include: ["src/**/*.{ts,tsx}"],
|
|
22
|
+
},
|
|
23
|
+
browser: {
|
|
24
|
+
provider: 'playwright', // or 'webdriverio'
|
|
25
|
+
enabled: true,
|
|
26
|
+
headless: true,
|
|
27
|
+
instances: [
|
|
28
|
+
{ browser: 'chromium' }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|