qword 1.0.1 → 1.0.3
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/ChangeLog +13 -0
- package/README.md +2 -3
- package/client/qword.js +29 -3
- package/client/save.js +2 -2
- package/dist/qword.js +1 -1
- package/dist/qword.js.map +1 -1
- package/dist-dev/qword.js +2 -2
- package/package.json +2 -3
package/ChangeLog
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
2026.05.18, v1.0.3
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- 73fb35d qword: clear history on setValueFirst to avoid undo to empty editor
|
|
5
|
+
|
|
6
|
+
feature:
|
|
7
|
+
- 9b3200c qword: cssnano v8.0.1
|
|
8
|
+
|
|
9
|
+
2026.05.13, v1.0.2
|
|
10
|
+
|
|
11
|
+
feature:
|
|
12
|
+
- b5f57a7 qword: full height
|
|
13
|
+
|
|
1
14
|
2026.05.13, v1.0.1
|
|
2
15
|
|
|
3
16
|
fix:
|
package/README.md
CHANGED
|
@@ -14,13 +14,12 @@ Fork of [edward](https://github.com/cloudcmd/edward "Edward").
|
|
|
14
14
|
|
|
15
15
|
<img width="601" height="295" alt="image" src="https://github.com/user-attachments/assets/e632f48a-ef74-4d5c-bbe8-8f6e44151d00" />
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
## Features
|
|
19
18
|
|
|
20
19
|
- Syntax highlighting based on extension of file for over 90 languages.
|
|
21
20
|
- Built-in `emmet` (for html files)
|
|
22
21
|
- Drag n drop (drag file from desktop to editor).
|
|
23
|
-
- Configurable options ([json/edit.json][edit.json] could be
|
|
22
|
+
- Configurable options ([json/edit.json][edit.json] could be overridden by `~/.qword.json`)
|
|
24
23
|
|
|
25
24
|
## Install
|
|
26
25
|
|
|
@@ -52,7 +51,7 @@ Usage: `qword [filename]`
|
|
|
52
51
|
## API
|
|
53
52
|
|
|
54
53
|
qword could be used as middleware for [express](http://expressjs.com "Express").
|
|
55
|
-
For this
|
|
54
|
+
For this purpose API could be used.
|
|
56
55
|
|
|
57
56
|
### Server
|
|
58
57
|
|
package/client/qword.js
CHANGED
|
@@ -78,7 +78,7 @@ export default function Qword(el, options = {}, callback = noop) {
|
|
|
78
78
|
this._keymapCompartment = new Compartment();
|
|
79
79
|
this._fontCompartment = new Compartment();
|
|
80
80
|
this._langCompartment = new Compartment();
|
|
81
|
-
|
|
81
|
+
this._historyCompartment = new Compartment();
|
|
82
82
|
this._vimCompartment = new Compartment();
|
|
83
83
|
|
|
84
84
|
this._Element.addEventListener('drop', this._onDrop.bind(this));
|
|
@@ -131,14 +131,19 @@ Qword.prototype._init = async function() {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
Qword.prototype._initEditor = function() {
|
|
134
|
+
this._Element.style.height = '100vh';
|
|
135
|
+
|
|
134
136
|
const baseExtensions = () => [
|
|
137
|
+
this._historyCompartment.of([
|
|
138
|
+
history(),
|
|
139
|
+
keymap.of(historyKeymap),
|
|
140
|
+
]),
|
|
135
141
|
lineNumbers(),
|
|
136
142
|
history(),
|
|
137
143
|
highlightActiveLine(),
|
|
138
144
|
syntaxHighlighting(defaultHighlightStyle),
|
|
139
145
|
oneDark,
|
|
140
146
|
this._langCompartment.of(javascript()),
|
|
141
|
-
// ✅ FIX: vim теперь через compartment
|
|
142
147
|
this._vimCompartment.of([]),
|
|
143
148
|
keymap.of([
|
|
144
149
|
...defaultKeymap,
|
|
@@ -259,6 +264,7 @@ Qword.prototype.setValueFirst = function(name, value) {
|
|
|
259
264
|
this._FileName = name;
|
|
260
265
|
this._Value = value;
|
|
261
266
|
|
|
267
|
+
this.clearHistory();
|
|
262
268
|
this.moveCursorTo(0, 0);
|
|
263
269
|
|
|
264
270
|
return this;
|
|
@@ -373,7 +379,6 @@ Qword.prototype.sha = function() {
|
|
|
373
379
|
};
|
|
374
380
|
|
|
375
381
|
Qword.prototype.setOption = function(name, value) {
|
|
376
|
-
const {_Ace} = this;
|
|
377
382
|
const preventOverwrite = () => {
|
|
378
383
|
this._Config.options[name] = value;
|
|
379
384
|
};
|
|
@@ -430,3 +435,24 @@ Qword.prototype.enableKey = function() {
|
|
|
430
435
|
this._isKey = true;
|
|
431
436
|
return this;
|
|
432
437
|
};
|
|
438
|
+
|
|
439
|
+
Qword.prototype.clearHistory = function() {
|
|
440
|
+
if (!this._view)
|
|
441
|
+
return this;
|
|
442
|
+
|
|
443
|
+
this._view.dispatch({
|
|
444
|
+
effects: this._historyCompartment.reconfigure(this._vimEnabled ? [] : [
|
|
445
|
+
history(),
|
|
446
|
+
keymap.of(historyKeymap),
|
|
447
|
+
]),
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
const {cm} = this._view;
|
|
451
|
+
|
|
452
|
+
cm.state.vim.undoHistory = [];
|
|
453
|
+
cm.state.vim.redoHistory = [];
|
|
454
|
+
cm.state.vim.globalState.jumpList = [];
|
|
455
|
+
|
|
456
|
+
return this;
|
|
457
|
+
};
|
|
458
|
+
|
package/client/save.js
CHANGED
|
@@ -34,9 +34,9 @@ async function save() {
|
|
|
34
34
|
if (!zip)
|
|
35
35
|
return this._write(_filename, value);
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const zippedValue = await zipio(value);
|
|
38
38
|
|
|
39
|
-
return this._write(`${_filename}?unzip`,
|
|
39
|
+
return this._write(`${_filename}?unzip`, zippedValue);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function _setValue(ctx) {
|