ccstatusline 2.0.24 → 2.0.25
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/dist/ccstatusline.js +56 -10
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -51405,7 +51405,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51405
51405
|
import * as fs5 from "fs";
|
|
51406
51406
|
import * as path4 from "path";
|
|
51407
51407
|
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
|
|
51408
|
-
var PACKAGE_VERSION = "2.0.
|
|
51408
|
+
var PACKAGE_VERSION = "2.0.25";
|
|
51409
51409
|
function getPackageVersion() {
|
|
51410
51410
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51411
51411
|
return PACKAGE_VERSION;
|
|
@@ -55917,6 +55917,7 @@ var LineSelector = ({
|
|
|
55917
55917
|
}) => {
|
|
55918
55918
|
const [selectedIndex, setSelectedIndex] = import_react37.useState(initialSelection);
|
|
55919
55919
|
const [showDeleteDialog, setShowDeleteDialog] = import_react37.useState(false);
|
|
55920
|
+
const [moveMode, setMoveMode] = import_react37.useState(false);
|
|
55920
55921
|
const [localLines, setLocalLines] = import_react37.useState(lines);
|
|
55921
55922
|
import_react37.useEffect(() => {
|
|
55922
55923
|
setLocalLines(lines);
|
|
@@ -55948,6 +55949,32 @@ var LineSelector = ({
|
|
|
55948
55949
|
onBack();
|
|
55949
55950
|
return;
|
|
55950
55951
|
}
|
|
55952
|
+
if (moveMode) {
|
|
55953
|
+
if (key.upArrow && selectedIndex > 0) {
|
|
55954
|
+
const newLines = [...localLines];
|
|
55955
|
+
const temp = newLines[selectedIndex];
|
|
55956
|
+
const prev = newLines[selectedIndex - 1];
|
|
55957
|
+
if (temp && prev) {
|
|
55958
|
+
[newLines[selectedIndex], newLines[selectedIndex - 1]] = [prev, temp];
|
|
55959
|
+
}
|
|
55960
|
+
setLocalLines(newLines);
|
|
55961
|
+
onLinesUpdate(newLines);
|
|
55962
|
+
setSelectedIndex(selectedIndex - 1);
|
|
55963
|
+
} else if (key.downArrow && selectedIndex < localLines.length - 1) {
|
|
55964
|
+
const newLines = [...localLines];
|
|
55965
|
+
const temp = newLines[selectedIndex];
|
|
55966
|
+
const next = newLines[selectedIndex + 1];
|
|
55967
|
+
if (temp && next) {
|
|
55968
|
+
[newLines[selectedIndex], newLines[selectedIndex + 1]] = [next, temp];
|
|
55969
|
+
}
|
|
55970
|
+
setLocalLines(newLines);
|
|
55971
|
+
onLinesUpdate(newLines);
|
|
55972
|
+
setSelectedIndex(selectedIndex + 1);
|
|
55973
|
+
} else if (key.escape || key.return) {
|
|
55974
|
+
setMoveMode(false);
|
|
55975
|
+
}
|
|
55976
|
+
return;
|
|
55977
|
+
}
|
|
55951
55978
|
switch (input) {
|
|
55952
55979
|
case "a":
|
|
55953
55980
|
if (allowEditing) {
|
|
@@ -55959,6 +55986,11 @@ var LineSelector = ({
|
|
|
55959
55986
|
setShowDeleteDialog(true);
|
|
55960
55987
|
}
|
|
55961
55988
|
return;
|
|
55989
|
+
case "m":
|
|
55990
|
+
if (allowEditing && localLines.length > 1 && selectedIndex < localLines.length) {
|
|
55991
|
+
setMoveMode(true);
|
|
55992
|
+
}
|
|
55993
|
+
return;
|
|
55962
55994
|
}
|
|
55963
55995
|
if (key.escape) {
|
|
55964
55996
|
onBack();
|
|
@@ -56081,17 +56113,31 @@ var LineSelector = ({
|
|
|
56081
56113
|
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56082
56114
|
flexDirection: "column",
|
|
56083
56115
|
children: [
|
|
56084
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(
|
|
56085
|
-
|
|
56086
|
-
|
|
56087
|
-
|
|
56116
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56117
|
+
children: [
|
|
56118
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56119
|
+
bold: true,
|
|
56120
|
+
children: [
|
|
56121
|
+
title ?? "Select Line to Edit",
|
|
56122
|
+
" "
|
|
56123
|
+
]
|
|
56124
|
+
}, undefined, true, undefined, this),
|
|
56125
|
+
moveMode && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56126
|
+
color: "blue",
|
|
56127
|
+
children: "[MOVE MODE]"
|
|
56128
|
+
}, undefined, false, undefined, this)
|
|
56129
|
+
]
|
|
56130
|
+
}, undefined, true, undefined, this),
|
|
56088
56131
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56089
56132
|
dimColor: true,
|
|
56090
56133
|
children: "Choose which status line to configure"
|
|
56091
56134
|
}, undefined, false, undefined, this),
|
|
56092
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56135
|
+
moveMode ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56136
|
+
dimColor: true,
|
|
56137
|
+
children: "↑↓ to move line, ESC or Enter to exit move mode"
|
|
56138
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56093
56139
|
dimColor: true,
|
|
56094
|
-
children: allowEditing ? localLines.length > 1 ? "(a) to append new line, (d) to delete line, ESC to go back" : "(a) to append new line, ESC to go back" : "ESC to go back"
|
|
56140
|
+
children: allowEditing ? localLines.length > 1 ? "(a) to append new line, (d) to delete line, (m) to move line, ESC to go back" : "(a) to append new line, ESC to go back" : "ESC to go back"
|
|
56095
56141
|
}, undefined, false, undefined, this),
|
|
56096
56142
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56097
56143
|
marginTop: 1,
|
|
@@ -56102,10 +56148,10 @@ var LineSelector = ({
|
|
|
56102
56148
|
const suffix = line.length ? import_pluralize.default("widget", line.length, true) : "empty";
|
|
56103
56149
|
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56104
56150
|
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56105
|
-
color: isSelected ? "green" : undefined,
|
|
56151
|
+
color: isSelected ? moveMode ? "blue" : "green" : undefined,
|
|
56106
56152
|
children: [
|
|
56107
56153
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56108
|
-
children: isSelected ? "▶ " : " "
|
|
56154
|
+
children: isSelected ? moveMode ? "◆ " : "▶ " : " "
|
|
56109
56155
|
}, undefined, false, undefined, this),
|
|
56110
56156
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56111
56157
|
children: [
|
|
@@ -56131,7 +56177,7 @@ var LineSelector = ({
|
|
|
56131
56177
|
}, undefined, true, undefined, this)
|
|
56132
56178
|
}, index, false, undefined, this);
|
|
56133
56179
|
}),
|
|
56134
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56180
|
+
!moveMode && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
56135
56181
|
marginTop: 1,
|
|
56136
56182
|
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text, {
|
|
56137
56183
|
color: selectedIndex === localLines.length ? "green" : undefined,
|