qword 1.0.2 → 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 CHANGED
@@ -1,3 +1,11 @@
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
+
1
9
  2026.05.13, v1.0.2
2
10
 
3
11
  feature:
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 overriden by `~/.qword.json`)
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 purpuse API could be used.
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
- // FIX: добавили vim compartment
81
+ this._historyCompartment = new Compartment();
82
82
  this._vimCompartment = new Compartment();
83
83
 
84
84
  this._Element.addEventListener('drop', this._onDrop.bind(this));
@@ -132,14 +132,18 @@ Qword.prototype._init = async function() {
132
132
 
133
133
  Qword.prototype._initEditor = function() {
134
134
  this._Element.style.height = '100vh';
135
+
135
136
  const baseExtensions = () => [
137
+ this._historyCompartment.of([
138
+ history(),
139
+ keymap.of(historyKeymap),
140
+ ]),
136
141
  lineNumbers(),
137
142
  history(),
138
143
  highlightActiveLine(),
139
144
  syntaxHighlighting(defaultHighlightStyle),
140
145
  oneDark,
141
146
  this._langCompartment.of(javascript()),
142
- // ✅ FIX: vim теперь через compartment
143
147
  this._vimCompartment.of([]),
144
148
  keymap.of([
145
149
  ...defaultKeymap,
@@ -260,6 +264,7 @@ Qword.prototype.setValueFirst = function(name, value) {
260
264
  this._FileName = name;
261
265
  this._Value = value;
262
266
 
267
+ this.clearHistory();
263
268
  this.moveCursorTo(0, 0);
264
269
 
265
270
  return this;
@@ -374,7 +379,6 @@ Qword.prototype.sha = function() {
374
379
  };
375
380
 
376
381
  Qword.prototype.setOption = function(name, value) {
377
- const {_Ace} = this;
378
382
  const preventOverwrite = () => {
379
383
  this._Config.options[name] = value;
380
384
  };
@@ -431,3 +435,24 @@ Qword.prototype.enableKey = function() {
431
435
  this._isKey = true;
432
436
  return this;
433
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 zipedValue = await zipio(value);
37
+ const zippedValue = await zipio(value);
38
38
 
39
- return this._write(`${_filename}?unzip`, zipedValue);
39
+ return this._write(`${_filename}?unzip`, zippedValue);
40
40
  }
41
41
 
42
42
  function _setValue(ctx) {