ccstatusline 2.0.2 → 2.0.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/dist/ccstatusline.js +18 -21
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -51035,7 +51035,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51035
51035
|
import * as fs5 from "fs";
|
|
51036
51036
|
import * as path4 from "path";
|
|
51037
51037
|
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
|
|
51038
|
-
var PACKAGE_VERSION = "2.0.
|
|
51038
|
+
var PACKAGE_VERSION = "2.0.4";
|
|
51039
51039
|
function getPackageVersion() {
|
|
51040
51040
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51041
51041
|
return PACKAGE_VERSION;
|
|
@@ -52963,7 +52963,6 @@ var import_react30 = __toESM(require_react(), 1);
|
|
|
52963
52963
|
var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
52964
52964
|
|
|
52965
52965
|
class CustomCommandWidget {
|
|
52966
|
-
currentAction = "edit-command";
|
|
52967
52966
|
getDefaultColor() {
|
|
52968
52967
|
return "white";
|
|
52969
52968
|
}
|
|
@@ -52992,9 +52991,6 @@ class CustomCommandWidget {
|
|
|
52992
52991
|
modifierText: modifiers.length > 0 ? `(${modifiers.join(", ")})` : undefined
|
|
52993
52992
|
};
|
|
52994
52993
|
}
|
|
52995
|
-
setEditorAction(action) {
|
|
52996
|
-
this.currentAction = action;
|
|
52997
|
-
}
|
|
52998
52994
|
handleEditorAction(action, item) {
|
|
52999
52995
|
if (action === "toggle-preserve") {
|
|
53000
52996
|
return { ...item, preserveColors: !item.preserveColors };
|
|
@@ -53052,8 +53048,7 @@ class CustomCommandWidget {
|
|
|
53052
53048
|
}
|
|
53053
53049
|
renderEditor(props) {
|
|
53054
53050
|
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(CustomCommandEditor, {
|
|
53055
|
-
...props
|
|
53056
|
-
action: this.currentAction
|
|
53051
|
+
...props
|
|
53057
53052
|
}, undefined, false, undefined, this);
|
|
53058
53053
|
}
|
|
53059
53054
|
supportsRawValue() {
|
|
@@ -54647,12 +54642,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
54647
54642
|
const newWidgets = [...widgets];
|
|
54648
54643
|
newWidgets[selectedIndex] = updatedWidget;
|
|
54649
54644
|
onUpdate(newWidgets);
|
|
54645
|
+
} else if (widgetImpl.renderEditor) {
|
|
54646
|
+
setCustomEditorWidget({ widget: currentWidget2, impl: widgetImpl, action: matchedKeybind.action });
|
|
54650
54647
|
}
|
|
54651
54648
|
} else if (widgetImpl.renderEditor) {
|
|
54652
|
-
|
|
54653
|
-
widgetImpl.setEditorAction(matchedKeybind.action);
|
|
54654
|
-
}
|
|
54655
|
-
setCustomEditorWidget({ widget: currentWidget2, impl: widgetImpl });
|
|
54649
|
+
setCustomEditorWidget({ widget: currentWidget2, impl: widgetImpl, action: matchedKeybind.action });
|
|
54656
54650
|
}
|
|
54657
54651
|
}
|
|
54658
54652
|
}
|
|
@@ -54710,7 +54704,8 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
54710
54704
|
return customEditorWidget.impl.renderEditor({
|
|
54711
54705
|
widget: customEditorWidget.widget,
|
|
54712
54706
|
onComplete: handleEditorComplete,
|
|
54713
|
-
onCancel: handleEditorCancel
|
|
54707
|
+
onCancel: handleEditorCancel,
|
|
54708
|
+
action: customEditorWidget.action
|
|
54714
54709
|
});
|
|
54715
54710
|
}
|
|
54716
54711
|
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
@@ -57931,7 +57926,7 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
57931
57926
|
if (!mostRecentTimestamp) {
|
|
57932
57927
|
return null;
|
|
57933
57928
|
}
|
|
57934
|
-
let
|
|
57929
|
+
let continuousWorkStart = mostRecentTimestamp;
|
|
57935
57930
|
for (let i = 1;i < timestamps.length; i++) {
|
|
57936
57931
|
const currentTimestamp = timestamps[i];
|
|
57937
57932
|
const previousTimestamp = timestamps[i - 1];
|
|
@@ -57939,17 +57934,19 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
57939
57934
|
continue;
|
|
57940
57935
|
}
|
|
57941
57936
|
const gap = previousTimestamp.getTime() - currentTimestamp.getTime();
|
|
57942
|
-
|
|
57943
|
-
|
|
57944
|
-
}
|
|
57945
|
-
const timeFromMostRecent = mostRecentTimestamp.getTime() - currentTimestamp.getTime();
|
|
57946
|
-
if (timeFromMostRecent < sessionDurationMs) {
|
|
57947
|
-
blockStartTimestamp = currentTimestamp;
|
|
57948
|
-
} else {
|
|
57937
|
+
const oneHourMs = 60 * 60 * 1000;
|
|
57938
|
+
if (gap > oneHourMs) {
|
|
57949
57939
|
break;
|
|
57950
57940
|
}
|
|
57941
|
+
continuousWorkStart = currentTimestamp;
|
|
57942
|
+
}
|
|
57943
|
+
const flooredWorkStart = floorToHour(continuousWorkStart);
|
|
57944
|
+
const totalWorkTime = now.getTime() - flooredWorkStart.getTime();
|
|
57945
|
+
let blockStart = flooredWorkStart;
|
|
57946
|
+
if (totalWorkTime > sessionDurationMs) {
|
|
57947
|
+
const completedBlocks = Math.floor(totalWorkTime / sessionDurationMs);
|
|
57948
|
+
blockStart = new Date(flooredWorkStart.getTime() + completedBlocks * sessionDurationMs);
|
|
57951
57949
|
}
|
|
57952
|
-
const blockStart = floorToHour(blockStartTimestamp);
|
|
57953
57950
|
const timeSinceActivity = now.getTime() - mostRecentTimestamp.getTime();
|
|
57954
57951
|
const blockEnd = new Date(blockStart.getTime() + sessionDurationMs);
|
|
57955
57952
|
const isActive = timeSinceActivity < sessionDurationMs && now < blockEnd;
|