dn-react-text-editor 0.1.0 → 0.1.1
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/index.js +3 -12
- package/dist/index.mjs +3 -12
- package/dist/text_editor.d.mts +2 -1
- package/dist/text_editor.d.ts +2 -1
- package/dist/text_editor.js +3 -12
- package/dist/text_editor.mjs +3 -12
- package/package.json +53 -53
package/dist/index.js
CHANGED
|
@@ -586,9 +586,7 @@ function createTextEditor(options = {}) {
|
|
|
586
586
|
}
|
|
587
587
|
return value.split("\n").map((line) => `<p>${line}</p>`).join("");
|
|
588
588
|
};
|
|
589
|
-
wrapper.innerHTML = toInnerHTML(
|
|
590
|
-
defaultValue ? String(defaultValue) : ""
|
|
591
|
-
);
|
|
589
|
+
wrapper.innerHTML = toInnerHTML(defaultValue ? String(defaultValue) : "");
|
|
592
590
|
const view = new import_prosemirror_view4.EditorView(element, {
|
|
593
591
|
...editor,
|
|
594
592
|
attributes: (state2) => {
|
|
@@ -685,6 +683,7 @@ function createTextEditor(options = {}) {
|
|
|
685
683
|
view.focus();
|
|
686
684
|
}
|
|
687
685
|
const textEditorController = {
|
|
686
|
+
schema,
|
|
688
687
|
view,
|
|
689
688
|
subject,
|
|
690
689
|
set value(value) {
|
|
@@ -711,15 +710,7 @@ function createTextEditor(options = {}) {
|
|
|
711
710
|
element.innerHTML = "";
|
|
712
711
|
};
|
|
713
712
|
}, []);
|
|
714
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ import_react.default.createElement(
|
|
715
|
-
"input",
|
|
716
|
-
{
|
|
717
|
-
ref: inputRef,
|
|
718
|
-
type: "hidden",
|
|
719
|
-
name,
|
|
720
|
-
onInput: onChange
|
|
721
|
-
}
|
|
722
|
-
));
|
|
713
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ import_react.default.createElement("input", { ref: inputRef, type: "hidden", name, onInput: onChange }));
|
|
723
714
|
}
|
|
724
715
|
return {
|
|
725
716
|
schema,
|
package/dist/index.mjs
CHANGED
|
@@ -550,9 +550,7 @@ function createTextEditor(options = {}) {
|
|
|
550
550
|
}
|
|
551
551
|
return value.split("\n").map((line) => `<p>${line}</p>`).join("");
|
|
552
552
|
};
|
|
553
|
-
wrapper.innerHTML = toInnerHTML(
|
|
554
|
-
defaultValue ? String(defaultValue) : ""
|
|
555
|
-
);
|
|
553
|
+
wrapper.innerHTML = toInnerHTML(defaultValue ? String(defaultValue) : "");
|
|
556
554
|
const view = new EditorView3(element, {
|
|
557
555
|
...editor,
|
|
558
556
|
attributes: (state2) => {
|
|
@@ -649,6 +647,7 @@ function createTextEditor(options = {}) {
|
|
|
649
647
|
view.focus();
|
|
650
648
|
}
|
|
651
649
|
const textEditorController = {
|
|
650
|
+
schema,
|
|
652
651
|
view,
|
|
653
652
|
subject,
|
|
654
653
|
set value(value) {
|
|
@@ -675,15 +674,7 @@ function createTextEditor(options = {}) {
|
|
|
675
674
|
element.innerHTML = "";
|
|
676
675
|
};
|
|
677
676
|
}, []);
|
|
678
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ React.createElement(
|
|
679
|
-
"input",
|
|
680
|
-
{
|
|
681
|
-
ref: inputRef,
|
|
682
|
-
type: "hidden",
|
|
683
|
-
name,
|
|
684
|
-
onInput: onChange
|
|
685
|
-
}
|
|
686
|
-
));
|
|
677
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ React.createElement("input", { ref: inputRef, type: "hidden", name, onInput: onChange }));
|
|
687
678
|
}
|
|
688
679
|
return {
|
|
689
680
|
schema,
|
package/dist/text_editor.d.mts
CHANGED
|
@@ -4,10 +4,11 @@ import * as prosemirror_model from 'prosemirror-model';
|
|
|
4
4
|
import React, { DetailedHTMLProps, InputHTMLAttributes, Ref } from 'react';
|
|
5
5
|
import { Transaction, EditorStateConfig } from 'prosemirror-state';
|
|
6
6
|
import { EditorView, DirectEditorProps } from 'prosemirror-view';
|
|
7
|
+
import { createSchema } from './schema.mjs';
|
|
7
8
|
import { Subject } from 'rxjs';
|
|
8
|
-
import './schema.mjs';
|
|
9
9
|
|
|
10
10
|
type TextEditorController = {
|
|
11
|
+
schema: ReturnType<typeof createSchema>;
|
|
11
12
|
view: EditorView;
|
|
12
13
|
subject: Subject<Transaction>;
|
|
13
14
|
set value(value: string);
|
package/dist/text_editor.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ import * as prosemirror_model from 'prosemirror-model';
|
|
|
4
4
|
import React, { DetailedHTMLProps, InputHTMLAttributes, Ref } from 'react';
|
|
5
5
|
import { Transaction, EditorStateConfig } from 'prosemirror-state';
|
|
6
6
|
import { EditorView, DirectEditorProps } from 'prosemirror-view';
|
|
7
|
+
import { createSchema } from './schema.js';
|
|
7
8
|
import { Subject } from 'rxjs';
|
|
8
|
-
import './schema.js';
|
|
9
9
|
|
|
10
10
|
type TextEditorController = {
|
|
11
|
+
schema: ReturnType<typeof createSchema>;
|
|
11
12
|
view: EditorView;
|
|
12
13
|
subject: Subject<Transaction>;
|
|
13
14
|
set value(value: string);
|
package/dist/text_editor.js
CHANGED
|
@@ -582,9 +582,7 @@ function createTextEditor(options = {}) {
|
|
|
582
582
|
}
|
|
583
583
|
return value.split("\n").map((line) => `<p>${line}</p>`).join("");
|
|
584
584
|
};
|
|
585
|
-
wrapper.innerHTML = toInnerHTML(
|
|
586
|
-
defaultValue ? String(defaultValue) : ""
|
|
587
|
-
);
|
|
585
|
+
wrapper.innerHTML = toInnerHTML(defaultValue ? String(defaultValue) : "");
|
|
588
586
|
const view = new import_prosemirror_view4.EditorView(element, {
|
|
589
587
|
...editor,
|
|
590
588
|
attributes: (state2) => {
|
|
@@ -681,6 +679,7 @@ function createTextEditor(options = {}) {
|
|
|
681
679
|
view.focus();
|
|
682
680
|
}
|
|
683
681
|
const textEditorController = {
|
|
682
|
+
schema,
|
|
684
683
|
view,
|
|
685
684
|
subject,
|
|
686
685
|
set value(value) {
|
|
@@ -707,15 +706,7 @@ function createTextEditor(options = {}) {
|
|
|
707
706
|
element.innerHTML = "";
|
|
708
707
|
};
|
|
709
708
|
}, []);
|
|
710
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ import_react.default.createElement(
|
|
711
|
-
"input",
|
|
712
|
-
{
|
|
713
|
-
ref: inputRef,
|
|
714
|
-
type: "hidden",
|
|
715
|
-
name,
|
|
716
|
-
onInput: onChange
|
|
717
|
-
}
|
|
718
|
-
));
|
|
709
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ import_react.default.createElement("input", { ref: inputRef, type: "hidden", name, onInput: onChange }));
|
|
719
710
|
}
|
|
720
711
|
return {
|
|
721
712
|
schema,
|
package/dist/text_editor.mjs
CHANGED
|
@@ -550,9 +550,7 @@ function createTextEditor(options = {}) {
|
|
|
550
550
|
}
|
|
551
551
|
return value.split("\n").map((line) => `<p>${line}</p>`).join("");
|
|
552
552
|
};
|
|
553
|
-
wrapper.innerHTML = toInnerHTML(
|
|
554
|
-
defaultValue ? String(defaultValue) : ""
|
|
555
|
-
);
|
|
553
|
+
wrapper.innerHTML = toInnerHTML(defaultValue ? String(defaultValue) : "");
|
|
556
554
|
const view = new EditorView3(element, {
|
|
557
555
|
...editor,
|
|
558
556
|
attributes: (state2) => {
|
|
@@ -649,6 +647,7 @@ function createTextEditor(options = {}) {
|
|
|
649
647
|
view.focus();
|
|
650
648
|
}
|
|
651
649
|
const textEditorController = {
|
|
650
|
+
schema,
|
|
652
651
|
view,
|
|
653
652
|
subject,
|
|
654
653
|
set value(value) {
|
|
@@ -675,15 +674,7 @@ function createTextEditor(options = {}) {
|
|
|
675
674
|
element.innerHTML = "";
|
|
676
675
|
};
|
|
677
676
|
}, []);
|
|
678
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ React.createElement(
|
|
679
|
-
"input",
|
|
680
|
-
{
|
|
681
|
-
ref: inputRef,
|
|
682
|
-
type: "hidden",
|
|
683
|
-
name,
|
|
684
|
-
onInput: onChange
|
|
685
|
-
}
|
|
686
|
-
));
|
|
677
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { ref: containerRef, className: container, ...props }), /* @__PURE__ */ React.createElement("input", { ref: inputRef, type: "hidden", name, onInput: onChange }));
|
|
687
678
|
}
|
|
688
679
|
return {
|
|
689
680
|
schema,
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
"./prosemirror": {
|
|
15
|
-
"types": "./dist/prosemirror/index.d.ts",
|
|
16
|
-
"import": "./dist/prosemirror/index.mjs",
|
|
17
|
-
"require": "./dist/prosemirror/index.js"
|
|
18
|
-
}
|
|
2
|
+
"name": "dn-react-text-editor",
|
|
3
|
+
"version": "0.1.1",
|
|
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"
|
|
19
13
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
"prosemirror-commands": "^1.7.1",
|
|
48
|
-
"prosemirror-history": "^1.5.0",
|
|
49
|
-
"prosemirror-keymap": "^1.2.3",
|
|
50
|
-
"prosemirror-model": "^1.25.4",
|
|
51
|
-
"prosemirror-schema-list": "^1.5.1",
|
|
52
|
-
"prosemirror-state": "^1.4.4",
|
|
53
|
-
"prosemirror-view": "^1.41.3",
|
|
54
|
-
"rxjs": "^7.8.2"
|
|
14
|
+
"./prosemirror": {
|
|
15
|
+
"types": "./dist/prosemirror/index.d.ts",
|
|
16
|
+
"import": "./dist/prosemirror/index.mjs",
|
|
17
|
+
"require": "./dist/prosemirror/index.js"
|
|
55
18
|
}
|
|
56
|
-
}
|
|
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
|
+
"prosemirror-commands": "^1.7.1",
|
|
48
|
+
"prosemirror-history": "^1.5.0",
|
|
49
|
+
"prosemirror-keymap": "^1.2.3",
|
|
50
|
+
"prosemirror-model": "^1.25.4",
|
|
51
|
+
"prosemirror-schema-list": "^1.5.1",
|
|
52
|
+
"prosemirror-state": "^1.4.4",
|
|
53
|
+
"prosemirror-view": "^1.41.3",
|
|
54
|
+
"rxjs": "^7.8.2"
|
|
55
|
+
}
|
|
56
|
+
}
|