sdc-build-wp 5.4.3 → 5.4.6

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/lib/project.js CHANGED
@@ -209,8 +209,10 @@ export async function init() {
209
209
  if (process.stdout.isTTY) {
210
210
  process.stdout.write('\x1b[?25h');
211
211
  process.stdout.write('\x1b[0m');
212
+ process.stdout.write('\n');
212
213
  }
213
214
 
215
+ process.stdout.write('');
214
216
  setTimeout(() => process.exit(0), 100);
215
217
  });
216
218
 
package/lib/tui.js CHANGED
@@ -16,6 +16,7 @@ class TUI {
16
16
  this.components = [];
17
17
  this.watchMode = false;
18
18
  this.isPaused = false;
19
+ this.isMouseEnabled = true;
19
20
  this._logHistory = [];
20
21
  }
21
22
 
@@ -101,10 +102,26 @@ class TUI {
101
102
  });
102
103
 
103
104
  this.screen.key(['enter', 'return'], () => {
105
+ if (!this.isMouseEnabled) {
106
+ this.enableMouseCapture();
107
+ this.updateHeader();
108
+ this.render();
109
+ return;
110
+ }
104
111
  this.logBox.log('');
105
112
  this.screen.render();
106
113
  });
107
114
 
115
+ const handleMouseDisable = () => {
116
+ if (this.isMouseEnabled) {
117
+ this.disableMouseCapture();
118
+ this.updateHeader();
119
+ this.render();
120
+ }
121
+ };
122
+ this.logBox.on('click', handleMouseDisable);
123
+ this.headerBox.on('click', handleMouseDisable);
124
+
108
125
  this.screen.key(['down'], () => {
109
126
  this.logBox.scroll(1);
110
127
  this.screen.render();
@@ -142,6 +159,9 @@ class TUI {
142
159
  if (this.isPaused) {
143
160
  titleLine += chalk.bold.yellow(' [PAUSED]');
144
161
  }
162
+ if (!this.isMouseEnabled) {
163
+ titleLine += chalk.bold.yellow(' [TEXT SELECT - Press Enter to Exit]');
164
+ }
145
165
  if (this.components.length > 0) {
146
166
  titleLine += chalk.gray(' [') + chalk.cyan(this.components.join(', ')) + chalk.gray(']');
147
167
  }
@@ -167,7 +187,11 @@ class TUI {
167
187
  lines.push(' ');
168
188
  }
169
189
 
170
- lines.push(' ');
190
+ if (!this.isMouseEnabled) {
191
+ lines.push(' ' + chalk.yellow('Text select on. Press Enter to enable mouse.'));
192
+ } else {
193
+ lines.push(' ');
194
+ }
171
195
 
172
196
  this.headerBox.setContent(lines.join('\n'));
173
197
  }
@@ -319,7 +343,8 @@ class TUI {
319
343
  commands: this.commands,
320
344
  components: [...this.components],
321
345
  watchMode: this.watchMode,
322
- isPaused: this.isPaused
346
+ isPaused: this.isPaused,
347
+ isMouseEnabled: this.isMouseEnabled
323
348
  };
324
349
  }
325
350
 
@@ -330,11 +355,45 @@ class TUI {
330
355
  this.components = [...state.components];
331
356
  this.watchMode = state.watchMode;
332
357
  this.isPaused = state.isPaused;
358
+ this.isMouseEnabled = state.isMouseEnabled ?? true;
359
+ if (this.isMouseEnabled) {
360
+ this.enableMouseCapture();
361
+ } else {
362
+ this.disableMouseCapture();
363
+ }
333
364
  this.updateHeader();
334
365
  this.render();
335
366
  }
336
367
  }
337
368
 
369
+ enableMouseCapture() {
370
+ if (!this.screen || this.isMouseEnabled) {
371
+ return;
372
+ }
373
+ this.isMouseEnabled = true;
374
+ if (this.screen.enableMouse) {
375
+ this.screen.enableMouse();
376
+ return;
377
+ }
378
+ if (this.screen.program && this.screen.program.enableMouse) {
379
+ this.screen.program.enableMouse();
380
+ }
381
+ }
382
+
383
+ disableMouseCapture() {
384
+ if (!this.screen || !this.isMouseEnabled) {
385
+ return;
386
+ }
387
+ this.isMouseEnabled = false;
388
+ if (this.screen.disableMouse) {
389
+ this.screen.disableMouse();
390
+ return;
391
+ }
392
+ if (this.screen.program && this.screen.program.disableMouse) {
393
+ this.screen.program.disableMouse();
394
+ }
395
+ }
396
+
338
397
  destroy() {
339
398
  if (this.isInitialized && this.screen) {
340
399
  if (this.screen.program) {
@@ -348,6 +407,7 @@ class TUI {
348
407
  this.screen = null;
349
408
  this.headerBox = null;
350
409
  this.logBox = null;
410
+ this.isMouseEnabled = true;
351
411
 
352
412
  if (process.stdout.isTTY) {
353
413
  process.stdout.write('\x1b[?25h');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "5.4.3",
3
+ "version": "5.4.6",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -22,26 +22,26 @@
22
22
  "sdc-build-wp": "./index.js"
23
23
  },
24
24
  "dependencies": {
25
- "@stylistic/eslint-plugin": "^5.4.0",
25
+ "@stylistic/eslint-plugin": "^5.6.1",
26
26
  "@stylistic/stylelint-plugin": "^4.0.0",
27
- "@typescript-eslint/eslint-plugin": "^8.46.1",
28
- "@typescript-eslint/parser": "^8.46.1",
29
- "@wordpress/scripts": "^30.25.0",
30
- "autoprefixer": "^10.4.21",
27
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
28
+ "@typescript-eslint/parser": "^8.48.1",
29
+ "@wordpress/scripts": "^31.1.0",
30
+ "autoprefixer": "^10.4.22",
31
31
  "blessed": "^0.1.81",
32
32
  "browser-sync": "^3.0.4",
33
33
  "chalk": "^5.6.2",
34
- "chokidar": "^4.0.3",
35
- "esbuild": "^0.25.11",
36
- "eslint": "^9.37.0",
34
+ "chokidar": "^5.0.0",
35
+ "esbuild": "^0.27.1",
36
+ "eslint": "^9.39.1",
37
37
  "fs-extra": "^11.3.2",
38
38
  "postcss": "^8.5.6",
39
39
  "postcss-scss": "^4.0.9",
40
40
  "postcss-sort-media-queries": "^5.2.0",
41
- "prettier": "^3.6.2",
42
- "sass": "^1.93.2",
43
- "sharp": "^0.34.4",
44
- "stylelint": "^16.25.0",
41
+ "prettier": "^3.7.4",
42
+ "sass": "^1.94.2",
43
+ "sharp": "^0.34.5",
44
+ "stylelint": "^16.26.1",
45
45
  "svgo": "^4.0.0",
46
46
  "tail": "^2.2.6",
47
47
  "yargs": "^18.0.0"