pom-text-editor 0.2.22 → 0.2.24
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 +97 -70
- package/dist/pom-text-editor.cjs.js +2 -167
- package/dist/pom-text-editor.es.js +1852 -1396
- package/dist/pom-text-editor.umd.js +2 -167
- package/package.json +21 -13
- package/dist/vite.svg +0 -1
package/README.md
CHANGED
|
@@ -1,128 +1,155 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
2
|
# PomTextEditor
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
PomTextEditor is a Vue 3 component library that provides a customizable and lightweight text editor for your Vue applications.
|
|
5
|
+
|
|
6
|
+
|
|
6
7
|
|
|
7
|
-
## Installation
|
|
8
|
+
## **Installation**
|
|
8
9
|
|
|
9
|
-
To
|
|
10
|
+
To install PomTextEditor, use either npm or yarn:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
npm
|
|
13
|
+
|
|
14
|
+
bash
|
|
15
|
+
|
|
16
|
+
Copy code
|
|
12
17
|
|
|
13
|
-
```bash
|
|
14
18
|
npm install pom-text-editor
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
yarn
|
|
21
|
+
|
|
16
22
|
bash
|
|
23
|
+
|
|
17
24
|
Copy code
|
|
25
|
+
```
|
|
18
26
|
yarn add pom-text-editor
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
To use the Editor component globally in your Vue 3 application, register it in your main application file (e.g., main.js or main.ts).
|
|
27
|
+
```
|
|
28
|
+
# Usage
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
##### Global Registration
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
To use the editor globally in your Vue 3 application, register it in your main file (e.g., main.js or main.ts).
|
|
33
|
+
|
|
34
|
+
|
|
26
35
|
js
|
|
27
36
|
Copy code
|
|
37
|
+
```
|
|
28
38
|
import { createApp } from 'vue';
|
|
39
|
+
|
|
29
40
|
import App from './App.vue';
|
|
41
|
+
|
|
30
42
|
import Editor from 'pom-text-editor'; // Correct import path
|
|
31
|
-
import 'node_modules/pom-text-editor/dist/style.css'; // optional Update the path based on actual location
|
|
32
43
|
|
|
33
|
-
|
|
44
|
+
import 'pom-text-editor/dist/style.css'; Optional: Update based on actual location
|
|
45
|
+
|
|
34
46
|
|
|
35
47
|
const app = createApp(App);
|
|
48
|
+
|
|
36
49
|
app.component('Editor', Editor); // Register the component globally
|
|
50
|
+
|
|
37
51
|
app.mount('#app');
|
|
38
|
-
Using in a Component
|
|
39
|
-
Once registered, you can use the Editor component in any of your Vue components.
|
|
40
52
|
|
|
53
|
+
Component Usage
|
|
54
|
+
```
|
|
41
55
|
|
|
56
|
+
After registering, you can use the Editor component in any Vue component.
|
|
57
|
+
|
|
58
|
+
|
|
42
59
|
```
|
|
43
|
-
OtherComponent.vue
|
|
44
|
-
vue
|
|
45
60
|
Copy code
|
|
46
61
|
<template>
|
|
47
|
-
|
|
62
|
+
|
|
63
|
+
<Editor @change="resultData" />
|
|
64
|
+
|
|
48
65
|
</template>
|
|
49
|
-
## add ToolBar
|
|
50
|
-
```
|
|
51
|
-
TextOnly out put
|
|
52
|
-
<Editor TextOnly='true' @change="resultData" />
|
|
53
66
|
|
|
67
|
+
<script setup>
|
|
68
|
+
function resultData(val) {
|
|
69
|
+
console.log(val, 'Your HTML content');
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
# **Text-Only Output**
|
|
75
|
+
For plain text output without any HTML tags, use the TextOnly attribute.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Copy code
|
|
80
|
+
<template>
|
|
81
|
+
<Editor TextOnly="true" @change="resultData" />
|
|
82
|
+
</template>
|
|
54
83
|
```
|
|
55
84
|
|
|
56
|
-
##
|
|
85
|
+
## **Customizing the Toolbar**
|
|
86
|
+
You can customize the editor toolbar using slots.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
Copy code
|
|
57
90
|
```
|
|
58
91
|
<template>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<componet @click='()=>alert()' class='hover:bg-gray-200 bg-gray-50 hover:text-gray-700 elemeSet items-center text-center justify-baseline rounded cursor-pointer text-md p-0 m-1'>Helo5</componet>
|
|
71
|
-
<componet @click='()=>alert()' class='hover:bg-gray-200 bg-gray-50 hover:text-gray-700 elemeSet items-center text-center justify-baseline rounded cursor-pointer text-md p-0 m-1'>Helo6</componet>
|
|
72
|
-
</template>
|
|
73
|
-
</Editor>
|
|
92
|
+
<Editor @change="resultData">
|
|
93
|
+
<template v-slot:toolbar-after>
|
|
94
|
+
<div class="custom-toolbar-btn">12</div>
|
|
95
|
+
<div class="custom-toolbar-btn">14</div>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<template v-slot:toolheader-before>
|
|
99
|
+
<component @click="alert('Hello 5')" class="custom-header-btn">Hello5</component>
|
|
100
|
+
<component @click="alert('Hello 6')" class="custom-header-btn">Hello6</component>
|
|
101
|
+
</template>
|
|
102
|
+
</Editor>
|
|
74
103
|
</template>
|
|
75
104
|
|
|
76
|
-
<script
|
|
77
|
-
function
|
|
78
|
-
|
|
105
|
+
<script setup>
|
|
106
|
+
function resultData(val) {
|
|
107
|
+
console.log(val, 'Your HTML content');
|
|
108
|
+
}
|
|
109
|
+
function alert(message) {
|
|
110
|
+
console.log(message);
|
|
79
111
|
}
|
|
80
112
|
</script>
|
|
81
113
|
```
|
|
82
|
-
CSS
|
|
83
|
-
The CSS for PomTextEditor is included directly within the JavaScript bundle.
|
|
84
|
-
You don’t need to import a separate CSS file for the component to work. However,
|
|
85
|
-
if you want to customize the styles, you can include additional styles in your main
|
|
86
|
-
application stylesheet or scoped styles in your components.
|
|
87
|
-
```
|
|
114
|
+
### CSS
|
|
88
115
|
|
|
89
|
-
|
|
90
|
-
For more detailed information and customization options, please refer to the documentation (Coming soon).
|
|
116
|
+
The CSS for PomTextEditor is included within the JavaScript bundle, so no separate import is required. To customize styles, you can add additional styles to your main stylesheet or use scoped styles in your components.
|
|
91
117
|
|
|
92
|
-
|
|
93
|
-
Contributing
|
|
94
|
-
We welcome contributions! If you would like to contribute, please follow these steps:
|
|
118
|
+
|
|
95
119
|
|
|
96
|
-
|
|
97
|
-
Fork the repository.
|
|
98
|
-
Create a feature branch (git checkout -b feature/your-feature).
|
|
99
|
-
Commit your changes (git commit -am 'Add new feature').
|
|
100
|
-
Push to the branch (git push origin feature/your-feature).
|
|
101
|
-
Create a Pull Request.
|
|
120
|
+
### Documentation
|
|
102
121
|
|
|
103
|
-
|
|
104
|
-
PomTextEditor is licensed under the MIT License. See the LICENSE file for more details.
|
|
122
|
+
Full documentation and customization options will be available soon.
|
|
105
123
|
|
|
106
|
-
|
|
107
|
-
If you have any questions, suggestions, or need support, feel free to reach out to us at ssengendonazil@gmail.com.
|
|
108
|
-
```
|
|
124
|
+
|
|
109
125
|
|
|
126
|
+
### Contributing
|
|
110
127
|
|
|
111
|
-
|
|
112
|
-
|
|
128
|
+
We welcome contributions! To contribute:
|
|
129
|
+
|
|
130
|
+
|
|
113
131
|
|
|
114
132
|
Fork the repository.
|
|
115
|
-
|
|
133
|
+
|
|
134
|
+
Create a feature branch: git checkout -b feature/your-feature.
|
|
135
|
+
|
|
116
136
|
Commit your changes: git commit -m 'Add new feature'.
|
|
137
|
+
|
|
117
138
|
Push to the branch: git push origin feature/your-feature.
|
|
139
|
+
|
|
118
140
|
Open a Pull Request.
|
|
119
141
|
|
|
120
|
-
|
|
121
|
-
[**ssengendonazil@gmail.com**](https://github.com/ssengedonazil) – Lead Project maintainer
|
|
122
|
-
- [**wanderatimothy2@gmail.com**](https://github.com/contributor) – Project maintainer
|
|
142
|
+
Contributors
|
|
123
143
|
|
|
144
|
+
ssengendonazil@gmail.com – Lead Project Maintainer
|
|
124
145
|
|
|
146
|
+
wanderatimothy2@gmail.com – Project Maintainer
|
|
125
147
|
|
|
148
|
+
### License
|
|
126
149
|
|
|
150
|
+
PomTextEditor is licensed under the MIT License. See the LICENSE file for more details.
|
|
127
151
|
|
|
152
|
+
|
|
128
153
|
|
|
154
|
+
## Contact
|
|
155
|
+
For any questions or suggestions, feel free to reach out at ssengendonazil@gmail.com.
|