dn-react-text-editor 0.2.3 → 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.
@@ -1071,12 +1071,15 @@ function createTextEditor(options = {}) {
1071
1071
  []
1072
1072
  );
1073
1073
  (0, import_react3.useEffect)(() => {
1074
+ const controller = controllerRef.current;
1075
+ if (!controller) {
1076
+ return;
1077
+ }
1074
1078
  if (autoFocus) {
1075
- controllerRef.current?.view.focus();
1079
+ controller.view.focus();
1076
1080
  }
1077
1081
  return () => {
1078
- console.log(controllerRef.current);
1079
- controllerRef.current?.view.destroy();
1082
+ controller.view.destroy();
1080
1083
  };
1081
1084
  }, []);
1082
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(
@@ -1043,12 +1043,15 @@ function createTextEditor(options = {}) {
1043
1043
  []
1044
1044
  );
1045
1045
  useEffect2(() => {
1046
+ const controller = controllerRef.current;
1047
+ if (!controller) {
1048
+ return;
1049
+ }
1046
1050
  if (autoFocus) {
1047
- controllerRef.current?.view.focus();
1051
+ controller.view.focus();
1048
1052
  }
1049
1053
  return () => {
1050
- console.log(controllerRef.current);
1051
- controllerRef.current?.view.destroy();
1054
+ controller.view.destroy();
1052
1055
  };
1053
1056
  }, []);
1054
1057
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ React2.createElement(
package/dist/index.js CHANGED
@@ -1077,12 +1077,15 @@ function createTextEditor(options = {}) {
1077
1077
  []
1078
1078
  );
1079
1079
  (0, import_react3.useEffect)(() => {
1080
+ const controller = controllerRef.current;
1081
+ if (!controller) {
1082
+ return;
1083
+ }
1080
1084
  if (autoFocus) {
1081
- controllerRef.current?.view.focus();
1085
+ controller.view.focus();
1082
1086
  }
1083
1087
  return () => {
1084
- console.log(controllerRef.current);
1085
- controllerRef.current?.view.destroy();
1088
+ controller.view.destroy();
1086
1089
  };
1087
1090
  }, []);
1088
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(
package/dist/index.mjs CHANGED
@@ -1043,12 +1043,15 @@ function createTextEditor(options = {}) {
1043
1043
  []
1044
1044
  );
1045
1045
  useEffect2(() => {
1046
+ const controller = controllerRef.current;
1047
+ if (!controller) {
1048
+ return;
1049
+ }
1046
1050
  if (autoFocus) {
1047
- controllerRef.current?.view.focus();
1051
+ controller.view.focus();
1048
1052
  }
1049
1053
  return () => {
1050
- console.log(controllerRef.current);
1051
- controllerRef.current?.view.destroy();
1054
+ controller.view.destroy();
1052
1055
  };
1053
1056
  }, []);
1054
1057
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", { ...props, ref: containerRef, className }), /* @__PURE__ */ React2.createElement(
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
1
  {
2
- "name": "dn-react-text-editor",
3
- "version": "0.2.3",
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"
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
- "./prosemirror": {
15
- "types": "./dist/prosemirror/index.d.ts",
16
- "import": "./dist/prosemirror/index.mjs",
17
- "require": "./dist/prosemirror/index.js"
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
+ }