slate-vue3 0.0.9 → 0.0.12
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/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
# slate-react library implemented with vue3
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
slate-<a style="color: #087ea4" href="https://react.dev/">react</a> library implemented with <a style="color: #42b883" href="https://vuejs.org/">vue</a>
|
|
5
|
-
</p>
|
|
6
|
-
<br/>
|
|
3
|
+

|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
## Why use it?
|
|
9
6
|
|
|
10
7
|
1. Use vue internal response implementation to reduce the number of re-renderings
|
|
11
8
|
2. You can easily use vue-devtools to debug in a vue project
|
|
12
9
|
3. This library provides the same usage as slate-react
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
## Demo
|
|
15
12
|
|
|
16
13
|
Check out the [**live demo**](https://guan-erjia.github.io/slate-vue3/) of all of the examples
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
## Hooks
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
### [useComposing](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-composing.ts)
|
|
21
18
|
|
|
22
19
|
```
|
|
23
20
|
const useFocused: () => Ref<boolean, boolean>
|
|
@@ -28,7 +25,7 @@ Get the current composing state of the editor. It deals with compositionstart, c
|
|
|
28
25
|
Composition events are triggered by typing (composing) with a language that uses a composition character (e.g. Chinese, Japanese, Korean, etc.) example.
|
|
29
26
|
Some basic Git commands are:
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
### [useFocused](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-focus.ts)
|
|
32
29
|
|
|
33
30
|
```
|
|
34
31
|
const useFocused: () => Ref<boolean, boolean>
|
|
@@ -36,7 +33,7 @@ const useFocused: () => Ref<boolean, boolean>
|
|
|
36
33
|
|
|
37
34
|
Get the current focused state of the editor.
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
### [useReadOnly](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-read-only.ts)
|
|
40
37
|
|
|
41
38
|
```
|
|
42
39
|
const useReadOnly: () => Ref<boolean, boolean>
|
|
@@ -44,7 +41,7 @@ const useReadOnly: () => Ref<boolean, boolean>
|
|
|
44
41
|
|
|
45
42
|
Get the current readOnly state of the editor.
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
### [useSelected](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-selected.ts)
|
|
48
45
|
|
|
49
46
|
```
|
|
50
47
|
const useSelected: () => ComputedRef<boolean>
|
|
@@ -52,7 +49,7 @@ const useSelected: () => ComputedRef<boolean>
|
|
|
52
49
|
|
|
53
50
|
Get the current selected state of an element.
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
### [useEditor](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-editor.ts)
|
|
56
53
|
|
|
57
54
|
```
|
|
58
55
|
const useSlate: () => Editor;
|
|
@@ -60,7 +57,7 @@ const useSlate: () => Editor;
|
|
|
60
57
|
|
|
61
58
|
Get the current editor object from the React context. Re-renders the context whenever changes occur in the editor.
|
|
62
59
|
|
|
63
|
-
|
|
60
|
+
### [useSelection](https://github.com/Guan-Erjia/slate-vue3/blob/master/packages/slate-vue/src/hooks/use-selection.ts)
|
|
64
61
|
|
|
65
62
|
```
|
|
66
63
|
const useSelection: () => ComputedRef<boolean>
|
|
@@ -68,7 +65,7 @@ const useSelection: () => ComputedRef<boolean>
|
|
|
68
65
|
|
|
69
66
|
Get the current editor selection from the React context.
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
## Packages
|
|
72
69
|
|
|
73
70
|
**slate's codebase is monorepo managed with pnpm workspace**
|
|
74
71
|
|
|
@@ -78,10 +75,12 @@ Get the current editor selection from the React context.
|
|
|
78
75
|
Implementation of slate on dom, update synchronously with slate-dom
|
|
79
76
|
- [slate-vue](https://github.com/Guan-Erjia/slate-vue3/tree/master/packages/slate-vue)
|
|
80
77
|
Vue components for rendering slate editors
|
|
78
|
+
- [slate-history](https://github.com/Guan-Erjia/slate-vue3/tree/master/packages/slate-history)
|
|
79
|
+
Provide undo redo functions, replace Weakmap to UnProxyWeakmap
|
|
81
80
|
- [share-tools](https://github.com/Guan-Erjia/slate-vue3/tree/master/packages/share-tools)
|
|
82
81
|
for special processing of proxy type data, obtain the raw pointer, isPlainObject declare
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
## compact files of slate
|
|
85
84
|
|
|
86
85
|
**reactive implement**
|
|
87
86
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slate-vue3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"slate-vue3",
|
|
47
|
-
"
|
|
47
|
+
"slate-vue",
|
|
48
|
+
"slate",
|
|
48
49
|
"editor",
|
|
49
50
|
"contenteditable",
|
|
50
|
-
"
|
|
51
|
+
"richtext",
|
|
51
52
|
"rich",
|
|
52
53
|
"editable",
|
|
53
54
|
"markdown",
|
|
54
|
-
"html"
|
|
55
|
-
"paper"
|
|
55
|
+
"html"
|
|
56
56
|
],
|
|
57
57
|
"repository": {
|
|
58
58
|
"type": "git",
|