pom-text-editor 0.2.21 → 0.2.23

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 CHANGED
@@ -1,121 +1,155 @@
1
1
 
2
-
3
2
  # PomTextEditor
4
3
 
5
- **PomTextEditor** is a Vue 3 component library that provides a customizable text editor for your Vue applications.
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 use **PomTextEditor** in your project, install it via npm or yarn.
10
+ To install PomTextEditor, use either npm or yarn:
10
11
 
11
- ### Using np
12
+ npm
13
+
14
+ bash
15
+
16
+ Copy code
12
17
 
13
- ```bash
14
18
  npm install pom-text-editor
15
- Using yarn
19
+
20
+ yarn
21
+
16
22
  bash
23
+
17
24
  Copy code
25
+ ```
18
26
  yarn add pom-text-editor
19
- Usage
20
- Global Registration
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
- main.js
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
+ ```
55
+
56
+ After registering, you can use the Editor component in any Vue component.
41
57
 
58
+
42
59
  ```
43
- OtherComponent.vue
44
- vue
45
60
  Copy code
46
61
  <template>
47
- <Editor @change="resultData" />
48
- </template>
49
- ## add ToolBar
50
- ```
51
- <template>
52
- // if only text needed out ie this will give clean text no tags
53
- <Editor @change="resultData" TextOnly="true">
54
-
55
-
56
-
57
- <Editor @change="resultData" >
58
- <template v-slot:toolbar-after>
59
- <div 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-1">12</div>
60
- <div 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-1">12</div>
61
- </template>
62
- <template v-slot:toolheader-after>
63
- <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>
64
- <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>
65
- </template>
66
- </Editor>
62
+
63
+ <Editor @change="resultData" />
64
+
67
65
  </template>
68
66
 
69
- <script setup>
70
- function resultData(val) {
71
- console.log(val, 'Your HTML content');
67
+ <script setup>
68
+ function resultData(val) {
69
+ console.log(val, 'Your HTML content');
72
70
  }
73
71
  </script>
72
+ ```
73
+
74
+ # **Text-Only Output**
75
+ For plain text output without any HTML tags, use the TextOnly attribute.
76
+
77
+
74
78
  ```
75
- CSS
76
- The CSS for PomTextEditor is included directly within the JavaScript bundle.
77
- You don’t need to import a separate CSS file for the component to work. However,
78
- if you want to customize the styles, you can include additional styles in your main
79
- application stylesheet or scoped styles in your components.
79
+ Copy code
80
+ <template>
81
+ <Editor TextOnly="true" @change="resultData" />
82
+ </template>
80
83
  ```
81
84
 
82
- Documentation
83
- For more detailed information and customization options, please refer to the documentation (Coming soon).
85
+ ## **Customizing the Toolbar**
86
+ You can customize the editor toolbar using slots.
84
87
 
85
- ```
86
- Contributing
87
- We welcome contributions! If you would like to contribute, please follow these steps:
88
88
 
89
+ Copy code
89
90
  ```
90
- Fork the repository.
91
- Create a feature branch (git checkout -b feature/your-feature).
92
- Commit your changes (git commit -am 'Add new feature').
93
- Push to the branch (git push origin feature/your-feature).
94
- Create a Pull Request.
91
+ <template>
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>
95
97
 
96
- License`
97
- PomTextEditor is licensed under the MIT License. See the LICENSE file for more details.
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>
103
+ </template>
98
104
 
99
- Contact
100
- If you have any questions, suggestions, or need support, feel free to reach out to us at ssengendonazil@gmail.com.
105
+ <script setup>
106
+ function resultData(val) {
107
+ console.log(val, 'Your HTML content');
108
+ }
109
+ function alert(message) {
110
+ console.log(message);
111
+ }
112
+ </script>
101
113
  ```
114
+ ### CSS
115
+
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.
117
+
118
+
119
+
120
+ ### Documentation
121
+
122
+ Full documentation and customization options will be available soon.
123
+
124
+
102
125
 
126
+ ### Contributing
103
127
 
104
- Contributing
105
- We welcome contributions to PomTextEditor! To contribute:
128
+ We welcome contributions! To contribute:
129
+
130
+
106
131
 
107
132
  Fork the repository.
108
- Create a new feature branch: git checkout -b feature/your-feature.
133
+
134
+ Create a feature branch: git checkout -b feature/your-feature.
135
+
109
136
  Commit your changes: git commit -m 'Add new feature'.
137
+
110
138
  Push to the branch: git push origin feature/your-feature.
139
+
111
140
  Open a Pull Request.
112
141
 
113
- ## Contributors
114
- [**SSENGENDO NAZIL**](https://github.com/ssengedonazil) – Lead Project maintainer
115
- - [**wanderatimothy2@gmail.com**](https://github.com/contributor) – Project maintainer
142
+ Contributors
116
143
 
144
+ ssengendonazil@gmail.com – Lead Project Maintainer
117
145
 
146
+ wanderatimothy2@gmail.com – Project Maintainer
118
147
 
148
+ ### License
119
149
 
150
+ PomTextEditor is licensed under the MIT License. See the LICENSE file for more details.
120
151
 
152
+
121
153
 
154
+ ## Contact
155
+ For any questions or suggestions, feel free to reach out at ssengendonazil@gmail.com.