dn-react-text-editor 0.2.2 → 0.2.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/dist/create_text_editor.js +30 -19
- package/dist/create_text_editor.mjs +30 -19
- package/dist/index.js +30 -19
- package/dist/index.mjs +30 -19
- package/package.json +55 -55
|
@@ -1048,28 +1048,39 @@ function createTextEditor(options = {}) {
|
|
|
1048
1048
|
} = {}) {
|
|
1049
1049
|
const containerRef = (0, import_react3.useRef)(null);
|
|
1050
1050
|
const controllerRef = (0, import_react3.useRef)(null);
|
|
1051
|
-
(0, import_react2.useImperativeHandle)(
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
container
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1051
|
+
(0, import_react2.useImperativeHandle)(
|
|
1052
|
+
ref || controllerRef,
|
|
1053
|
+
() => {
|
|
1054
|
+
const container = containerRef.current;
|
|
1055
|
+
const textEditorController = createTextEditorController(
|
|
1056
|
+
container,
|
|
1057
|
+
schema,
|
|
1058
|
+
options,
|
|
1059
|
+
{
|
|
1060
|
+
mode,
|
|
1061
|
+
state,
|
|
1062
|
+
editor,
|
|
1063
|
+
defaultValue,
|
|
1064
|
+
updateDelay,
|
|
1065
|
+
placeholder
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1068
|
+
controllerRef.current = textEditorController;
|
|
1069
|
+
return textEditorController;
|
|
1070
|
+
},
|
|
1071
|
+
[]
|
|
1072
|
+
);
|
|
1069
1073
|
(0, import_react3.useEffect)(() => {
|
|
1074
|
+
const controller = controllerRef.current;
|
|
1075
|
+
if (!controller) {
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1070
1078
|
if (autoFocus) {
|
|
1071
|
-
|
|
1079
|
+
controller.view.focus();
|
|
1072
1080
|
}
|
|
1081
|
+
return () => {
|
|
1082
|
+
controller.view.destroy();
|
|
1083
|
+
};
|
|
1073
1084
|
}, []);
|
|
1074
1085
|
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ import_react2.default.createElement(
|
|
1075
1086
|
TextEditorInput,
|
|
@@ -1020,28 +1020,39 @@ function createTextEditor(options = {}) {
|
|
|
1020
1020
|
} = {}) {
|
|
1021
1021
|
const containerRef = useRef(null);
|
|
1022
1022
|
const controllerRef = useRef(null);
|
|
1023
|
-
useImperativeHandle(
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
container
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1023
|
+
useImperativeHandle(
|
|
1024
|
+
ref || controllerRef,
|
|
1025
|
+
() => {
|
|
1026
|
+
const container = containerRef.current;
|
|
1027
|
+
const textEditorController = createTextEditorController(
|
|
1028
|
+
container,
|
|
1029
|
+
schema,
|
|
1030
|
+
options,
|
|
1031
|
+
{
|
|
1032
|
+
mode,
|
|
1033
|
+
state,
|
|
1034
|
+
editor,
|
|
1035
|
+
defaultValue,
|
|
1036
|
+
updateDelay,
|
|
1037
|
+
placeholder
|
|
1038
|
+
}
|
|
1039
|
+
);
|
|
1040
|
+
controllerRef.current = textEditorController;
|
|
1041
|
+
return textEditorController;
|
|
1042
|
+
},
|
|
1043
|
+
[]
|
|
1044
|
+
);
|
|
1041
1045
|
useEffect2(() => {
|
|
1046
|
+
const controller = controllerRef.current;
|
|
1047
|
+
if (!controller) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1042
1050
|
if (autoFocus) {
|
|
1043
|
-
|
|
1051
|
+
controller.view.focus();
|
|
1044
1052
|
}
|
|
1053
|
+
return () => {
|
|
1054
|
+
controller.view.destroy();
|
|
1055
|
+
};
|
|
1045
1056
|
}, []);
|
|
1046
1057
|
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ React2.createElement(
|
|
1047
1058
|
TextEditorInput,
|
package/dist/index.js
CHANGED
|
@@ -1054,28 +1054,39 @@ function createTextEditor(options = {}) {
|
|
|
1054
1054
|
} = {}) {
|
|
1055
1055
|
const containerRef = (0, import_react3.useRef)(null);
|
|
1056
1056
|
const controllerRef = (0, import_react3.useRef)(null);
|
|
1057
|
-
(0, import_react2.useImperativeHandle)(
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
container
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1057
|
+
(0, import_react2.useImperativeHandle)(
|
|
1058
|
+
ref || controllerRef,
|
|
1059
|
+
() => {
|
|
1060
|
+
const container = containerRef.current;
|
|
1061
|
+
const textEditorController = createTextEditorController(
|
|
1062
|
+
container,
|
|
1063
|
+
schema,
|
|
1064
|
+
options,
|
|
1065
|
+
{
|
|
1066
|
+
mode,
|
|
1067
|
+
state,
|
|
1068
|
+
editor,
|
|
1069
|
+
defaultValue,
|
|
1070
|
+
updateDelay,
|
|
1071
|
+
placeholder
|
|
1072
|
+
}
|
|
1073
|
+
);
|
|
1074
|
+
controllerRef.current = textEditorController;
|
|
1075
|
+
return textEditorController;
|
|
1076
|
+
},
|
|
1077
|
+
[]
|
|
1078
|
+
);
|
|
1075
1079
|
(0, import_react3.useEffect)(() => {
|
|
1080
|
+
const controller = controllerRef.current;
|
|
1081
|
+
if (!controller) {
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1076
1084
|
if (autoFocus) {
|
|
1077
|
-
|
|
1085
|
+
controller.view.focus();
|
|
1078
1086
|
}
|
|
1087
|
+
return () => {
|
|
1088
|
+
controller.view.destroy();
|
|
1089
|
+
};
|
|
1079
1090
|
}, []);
|
|
1080
1091
|
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ import_react2.default.createElement(
|
|
1081
1092
|
TextEditorInput,
|
package/dist/index.mjs
CHANGED
|
@@ -1020,28 +1020,39 @@ function createTextEditor(options = {}) {
|
|
|
1020
1020
|
} = {}) {
|
|
1021
1021
|
const containerRef = useRef(null);
|
|
1022
1022
|
const controllerRef = useRef(null);
|
|
1023
|
-
useImperativeHandle(
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
container
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1023
|
+
useImperativeHandle(
|
|
1024
|
+
ref || controllerRef,
|
|
1025
|
+
() => {
|
|
1026
|
+
const container = containerRef.current;
|
|
1027
|
+
const textEditorController = createTextEditorController(
|
|
1028
|
+
container,
|
|
1029
|
+
schema,
|
|
1030
|
+
options,
|
|
1031
|
+
{
|
|
1032
|
+
mode,
|
|
1033
|
+
state,
|
|
1034
|
+
editor,
|
|
1035
|
+
defaultValue,
|
|
1036
|
+
updateDelay,
|
|
1037
|
+
placeholder
|
|
1038
|
+
}
|
|
1039
|
+
);
|
|
1040
|
+
controllerRef.current = textEditorController;
|
|
1041
|
+
return textEditorController;
|
|
1042
|
+
},
|
|
1043
|
+
[]
|
|
1044
|
+
);
|
|
1041
1045
|
useEffect2(() => {
|
|
1046
|
+
const controller = controllerRef.current;
|
|
1047
|
+
if (!controller) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1042
1050
|
if (autoFocus) {
|
|
1043
|
-
|
|
1051
|
+
controller.view.focus();
|
|
1044
1052
|
}
|
|
1053
|
+
return () => {
|
|
1054
|
+
controller.view.destroy();
|
|
1055
|
+
};
|
|
1045
1056
|
}, []);
|
|
1046
1057
|
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ React2.createElement(
|
|
1047
1058
|
TextEditorInput,
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"name": "dn-react-text-editor",
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.mjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./prosemirror": {
|
|
15
|
+
"types": "./dist/prosemirror/index.d.ts",
|
|
16
|
+
"import": "./dist/prosemirror/index.mjs",
|
|
17
|
+
"require": "./dist/prosemirror/index.js"
|
|
18
|
+
}
|
|
13
19
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "NODE_OPTIONS='--max-old-space-size=16384' tsup",
|
|
22
|
+
"dev": "tsup --watch"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/dndnsoft/dn-react-text-editor.git"
|
|
27
|
+
},
|
|
28
|
+
"author": "",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/dndnsoft/dn-react-text-editor/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/dndnsoft/dn-react-text-editor#readme",
|
|
34
|
+
"description": "",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^24.10.1",
|
|
37
|
+
"@types/react": "^19",
|
|
38
|
+
"@types/react-dom": "^19",
|
|
39
|
+
"tsup": "^8.5.1",
|
|
40
|
+
"typescript": "^5.7.3"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^19",
|
|
44
|
+
"react-dom": "^19"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"highlight.js": "^11.11.1",
|
|
48
|
+
"html-entities": "^2.6.0",
|
|
49
|
+
"prosemirror-commands": "^1.7.1",
|
|
50
|
+
"prosemirror-history": "^1.5.0",
|
|
51
|
+
"prosemirror-keymap": "^1.2.3",
|
|
52
|
+
"prosemirror-model": "^1.25.4",
|
|
53
|
+
"prosemirror-schema-list": "^1.5.1",
|
|
54
|
+
"prosemirror-state": "^1.4.4",
|
|
55
|
+
"prosemirror-view": "^1.41.3",
|
|
56
|
+
"rxjs": "^7.8.2"
|
|
18
57
|
}
|
|
19
|
-
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "NODE_OPTIONS='--max-old-space-size=16384' tsup",
|
|
22
|
-
"dev": "tsup --watch"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/dndnsoft/dn-react-text-editor.git"
|
|
27
|
-
},
|
|
28
|
-
"author": "",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"bugs": {
|
|
31
|
-
"url": "https://github.com/dndnsoft/dn-react-text-editor/issues"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://github.com/dndnsoft/dn-react-text-editor#readme",
|
|
34
|
-
"description": "",
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/node": "^24.10.1",
|
|
37
|
-
"@types/react": "^19",
|
|
38
|
-
"@types/react-dom": "^19",
|
|
39
|
-
"tsup": "^8.5.1",
|
|
40
|
-
"typescript": "^5.7.3"
|
|
41
|
-
},
|
|
42
|
-
"peerDependencies": {
|
|
43
|
-
"react": "^19",
|
|
44
|
-
"react-dom": "^19"
|
|
45
|
-
},
|
|
46
|
-
"dependencies": {
|
|
47
|
-
"highlight.js": "^11.11.1",
|
|
48
|
-
"html-entities": "^2.6.0",
|
|
49
|
-
"prosemirror-commands": "^1.7.1",
|
|
50
|
-
"prosemirror-history": "^1.5.0",
|
|
51
|
-
"prosemirror-keymap": "^1.2.3",
|
|
52
|
-
"prosemirror-model": "^1.25.4",
|
|
53
|
-
"prosemirror-schema-list": "^1.5.1",
|
|
54
|
-
"prosemirror-state": "^1.4.4",
|
|
55
|
-
"prosemirror-view": "^1.41.3",
|
|
56
|
-
"rxjs": "^7.8.2"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
58
|
+
}
|