neiki-editor 2.9.2 → 2.9.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.
- package/LICENSE +13 -17
- package/README.md +24 -13
- package/dist/neiki-editor.css +103 -2
- package/dist/neiki-editor.js +578 -98
- package/dist/neiki-editor.min.css +1 -1
- package/dist/neiki-editor.min.js +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 19 November 2007
|
|
2
3
|
|
|
3
|
-
Copyright (
|
|
4
|
+
Copyright (C) 2026 neikiri
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU Affero General Public License for more details.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
16
|
+
You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
package/README.md
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<img src="https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white" alt="HTML5">
|
|
11
11
|
<img src="https://img.shields.io/badge/css-%23663399.svg?style=for-the-badge&logo=css&logoColor=white" alt="CSS">
|
|
12
12
|
<br>
|
|
13
|
-
<img src="https://img.shields.io/badge/License-
|
|
14
|
-
<img src="https://img.shields.io/badge/Version-2.9.
|
|
13
|
+
<img src="https://img.shields.io/badge/License-AGPL--3.0-2563EB?style=for-the-badge&logo=open-source-initiative&logoColor=white&labelColor=000F15&logoWidth=20" alt="License">
|
|
14
|
+
<img src="https://img.shields.io/badge/Version-2.9.4-2563EB?style=for-the-badge&logo=semantic-release&logoColor=white&labelColor=000F15&logoWidth=20" alt="Version">
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
**Live version:** [https://
|
|
41
|
+
**Live version:** [https://neikiri.dev/editor](https://neikiri.dev/editor)
|
|
42
42
|
|
|
43
43
|
---
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ Most WYSIWYG editors either pull in a tree of dependencies or force you into a h
|
|
|
52
52
|
Add this single line — CSS is included automatically, always the **latest version**:
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
|
-
<script src="https://cdn.
|
|
55
|
+
<script src="https://cdn.neikiri.dev/neiki-editor/neiki-editor.min.js"></script>
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<details>
|
|
@@ -62,19 +62,19 @@ Add this single line — CSS is included automatically, always the **latest vers
|
|
|
62
62
|
#### Pin a specific version
|
|
63
63
|
|
|
64
64
|
```html
|
|
65
|
-
<script src="https://cdn.
|
|
65
|
+
<script src="https://cdn.neikiri.dev/neiki-editor/2.9.4/neiki-editor.min.js"></script>
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
#### Load CSS and JS separately
|
|
69
69
|
|
|
70
70
|
```html
|
|
71
71
|
<!-- Latest -->
|
|
72
|
-
<link rel="stylesheet" href="https://cdn.
|
|
73
|
-
<script src="https://cdn.
|
|
72
|
+
<link rel="stylesheet" href="https://cdn.neikiri.dev/neiki-editor/neiki-editor.css">
|
|
73
|
+
<script src="https://cdn.neikiri.dev/neiki-editor/neiki-editor.js"></script>
|
|
74
74
|
|
|
75
75
|
<!-- Or pinned -->
|
|
76
|
-
<link rel="stylesheet" href="https://cdn.
|
|
77
|
-
<script src="https://cdn.
|
|
76
|
+
<link rel="stylesheet" href="https://cdn.neikiri.dev/neiki-editor/2.9.4/neiki-editor.css">
|
|
77
|
+
<script src="https://cdn.neikiri.dev/neiki-editor/2.9.4/neiki-editor.js"></script>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
#### Alternative CDN — jsDelivr
|
|
@@ -84,15 +84,15 @@ Add this single line — CSS is included automatically, always the **latest vers
|
|
|
84
84
|
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@latest/dist/neiki-editor.min.js"></script>
|
|
85
85
|
|
|
86
86
|
<!-- Pinned -->
|
|
87
|
-
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.
|
|
87
|
+
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.4/dist/neiki-editor.min.js"></script>
|
|
88
88
|
|
|
89
89
|
<!-- Separate files (latest) -->
|
|
90
90
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@latest/dist/neiki-editor.css">
|
|
91
91
|
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@latest/dist/neiki-editor.js"></script>
|
|
92
92
|
|
|
93
93
|
<!-- Separate files (pinned) -->
|
|
94
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.
|
|
95
|
-
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.
|
|
94
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.4/dist/neiki-editor.css">
|
|
95
|
+
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@2.9.4/dist/neiki-editor.js"></script>
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
#### Package Manager
|
|
@@ -146,6 +146,7 @@ const editor = new NeikiEditor('#editor', {
|
|
|
146
146
|
theme: 'light', // 'light' or 'dark'
|
|
147
147
|
language: 'en', // 'en', 'cs', or custom via addTranslation()
|
|
148
148
|
translations: null, // custom translation keys (merged with built-in)
|
|
149
|
+
autosaveKey: null, // optional custom localStorage scope for autosave
|
|
149
150
|
toolbar: [
|
|
150
151
|
'viewCode', 'undo', 'redo', 'findReplace', '|',
|
|
151
152
|
'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'removeFormat', '|',
|
|
@@ -182,6 +183,7 @@ const editor = new NeikiEditor('#editor', {
|
|
|
182
183
|
| `theme` | `string` | `'light'` | `'light'` or `'dark'` |
|
|
183
184
|
| `language` | `string` | `'en'` | UI language — `en`, `cs`, `zh`, `es`, `de`, `fr`, `pt`, `ja` |
|
|
184
185
|
| `translations` | `object\|null` | `null` | Custom translation keys (merged with built-in) |
|
|
186
|
+
| `autosaveKey` | `string\|null` | `null` | Custom `localStorage` scope for autosave content and enabled state |
|
|
185
187
|
| `toolbar` | `array` | *(see above)* | Toolbar button configuration |
|
|
186
188
|
| `onChange` | `function\|null` | `null` | Callback on content change |
|
|
187
189
|
| `onSave` | `function\|null` | `null` | Callback on save (triggered by Ctrl+S or More menu → Save) |
|
|
@@ -365,6 +367,15 @@ Autosave is accessible from the **More menu** (⋯) in the default toolbar. When
|
|
|
365
367
|
- Content is saved to `localStorage` on every content change (debounced)
|
|
366
368
|
- The status bar shows "Autosaving..." / "Saved locally"
|
|
367
369
|
- Content is restored on page reload **only when autosave was enabled**
|
|
370
|
+
- Autosave keys are scoped by page URL and editor identity by default, so multiple editors do not overwrite each other
|
|
371
|
+
|
|
372
|
+
For apps where the same URL can edit different records, pass a custom `autosaveKey`:
|
|
373
|
+
|
|
374
|
+
```javascript
|
|
375
|
+
new NeikiEditor('#editor', {
|
|
376
|
+
autosaveKey: 'article-42'
|
|
377
|
+
});
|
|
378
|
+
```
|
|
368
379
|
|
|
369
380
|
> **Note:** For production use (CMS, blog, etc.), use the `onSave` callback or `onChange` callback to save content to your database instead.
|
|
370
381
|
|
|
@@ -731,7 +742,7 @@ neiki-editor/
|
|
|
731
742
|
|
|
732
743
|
## 📄 License
|
|
733
744
|
|
|
734
|
-
This project is licensed under the
|
|
745
|
+
This project is licensed under the GNU Affero General Public License v3 — see the [LICENSE](LICENSE) file for details.
|
|
735
746
|
|
|
736
747
|
---
|
|
737
748
|
|
package/dist/neiki-editor.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NeikiEditor - Production-Ready WYSIWYG Rich Text Editor
|
|
3
3
|
* CSS Stylesheet
|
|
4
|
-
* Version: 2.9.
|
|
4
|
+
* Version: 2.9.4
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* ============================================
|
|
@@ -1141,6 +1141,84 @@
|
|
|
1141
1141
|
border-radius: 5px 0 0 5px;
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
|
+
.neiki-image-upload-zone {
|
|
1145
|
+
position: relative;
|
|
1146
|
+
display: grid;
|
|
1147
|
+
justify-items: center;
|
|
1148
|
+
gap: 7px;
|
|
1149
|
+
padding: 24px 18px;
|
|
1150
|
+
border: 2px dashed var(--neiki-border-color);
|
|
1151
|
+
border-radius: 8px;
|
|
1152
|
+
background: var(--neiki-bg-secondary);
|
|
1153
|
+
color: var(--neiki-text-secondary);
|
|
1154
|
+
text-align: center;
|
|
1155
|
+
cursor: pointer;
|
|
1156
|
+
transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.neiki-image-upload-zone:hover,
|
|
1160
|
+
.neiki-image-upload-zone:focus-visible {
|
|
1161
|
+
border-color: var(--neiki-accent-color);
|
|
1162
|
+
background: var(--neiki-bg-primary);
|
|
1163
|
+
box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
|
|
1164
|
+
outline: none;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.neiki-image-upload-zone.drag-over {
|
|
1168
|
+
border-color: var(--neiki-accent-color);
|
|
1169
|
+
background: rgba(13, 110, 253, 0.08);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
.neiki-image-upload-zone.has-files {
|
|
1173
|
+
border-style: solid;
|
|
1174
|
+
border-color: var(--neiki-accent-color);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
.neiki-image-upload-input {
|
|
1178
|
+
position: absolute;
|
|
1179
|
+
width: 1px;
|
|
1180
|
+
height: 1px;
|
|
1181
|
+
opacity: 0;
|
|
1182
|
+
pointer-events: none;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.neiki-image-upload-icon {
|
|
1186
|
+
width: 38px;
|
|
1187
|
+
height: 38px;
|
|
1188
|
+
color: var(--neiki-accent-color);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
.neiki-image-upload-icon svg {
|
|
1192
|
+
width: 100%;
|
|
1193
|
+
height: 100%;
|
|
1194
|
+
fill: currentColor;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.neiki-image-upload-title {
|
|
1198
|
+
color: var(--neiki-text-primary);
|
|
1199
|
+
font-size: 14px;
|
|
1200
|
+
font-weight: 600;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
.neiki-image-upload-hint,
|
|
1204
|
+
.neiki-image-upload-files {
|
|
1205
|
+
max-width: 100%;
|
|
1206
|
+
color: var(--neiki-text-muted);
|
|
1207
|
+
font-size: 12px;
|
|
1208
|
+
line-height: 1.4;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
.neiki-image-upload-files {
|
|
1212
|
+
overflow: hidden;
|
|
1213
|
+
text-overflow: ellipsis;
|
|
1214
|
+
white-space: nowrap;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.neiki-image-upload-zone.has-files .neiki-image-upload-files {
|
|
1218
|
+
color: var(--neiki-accent-color);
|
|
1219
|
+
font-weight: 500;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1144
1222
|
.neiki-form-row {
|
|
1145
1223
|
display: flex;
|
|
1146
1224
|
gap: 16px;
|
|
@@ -1513,7 +1591,7 @@
|
|
|
1513
1591
|
Floating Selection Toolbar
|
|
1514
1592
|
============================================ */
|
|
1515
1593
|
.neiki-floating-toolbar {
|
|
1516
|
-
position:
|
|
1594
|
+
position: fixed;
|
|
1517
1595
|
z-index: 1000;
|
|
1518
1596
|
display: none;
|
|
1519
1597
|
background: var(--neiki-bg-primary);
|
|
@@ -1975,6 +2053,29 @@
|
|
|
1975
2053
|
font-size: 16px; /* Prevents iOS zoom on focus */
|
|
1976
2054
|
}
|
|
1977
2055
|
|
|
2056
|
+
.neiki-image-upload-zone {
|
|
2057
|
+
grid-template-columns: 32px 1fr;
|
|
2058
|
+
justify-items: start;
|
|
2059
|
+
gap: 4px 10px;
|
|
2060
|
+
padding: 14px;
|
|
2061
|
+
text-align: left;
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
.neiki-image-upload-icon {
|
|
2065
|
+
grid-row: span 3;
|
|
2066
|
+
width: 30px;
|
|
2067
|
+
height: 30px;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
.neiki-image-upload-title {
|
|
2071
|
+
font-size: 13px;
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
.neiki-image-upload-hint,
|
|
2075
|
+
.neiki-image-upload-files {
|
|
2076
|
+
font-size: 11px;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
1978
2079
|
.neiki-find-replace {
|
|
1979
2080
|
width: 100%;
|
|
1980
2081
|
border-radius: 0;
|