@mingxy/opencode-mascot 0.4.17 → 0.4.19
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/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import type { JSX } from "@opentui/solid";
|
|
|
5
5
|
import type { MascotPack, MascotState } from "../core/types";
|
|
6
6
|
import { createAnimatedRenderer } from "../core/ascii-renderer";
|
|
7
7
|
import { onCelebrate, onVersion } from "../core/celebration-bus";
|
|
8
|
+
import { log } from "../core/logger";
|
|
8
9
|
|
|
9
10
|
interface SidebarMascotProps {
|
|
10
11
|
mascots: Record<string, MascotPack>;
|
|
@@ -88,6 +89,7 @@ export function SidebarMascot(props: SidebarMascotProps): JSX.Element {
|
|
|
88
89
|
const checkEdge = () => {
|
|
89
90
|
const cw = getCw();
|
|
90
91
|
const x = posX();
|
|
92
|
+
log("EDGE", `checkEdge x=${x} cw=${cw} leftThreshold=${-(MASCOT_WIDTH - PEEK) + EDGE_THRESHOLD} rightThreshold=${cw - PEEK - EDGE_THRESHOLD}`);
|
|
91
93
|
if (x <= -(MASCOT_WIDTH - PEEK) + EDGE_THRESHOLD) {
|
|
92
94
|
hideSide = "left";
|
|
93
95
|
startPeek();
|
|
@@ -112,7 +112,7 @@ export function createAnimatedRenderer(pack: MascotPack): {
|
|
|
112
112
|
if (currentState() !== "idle") return;
|
|
113
113
|
idleSleepTimeout = setTimeout(() => {
|
|
114
114
|
if (currentState() === "idle") {
|
|
115
|
-
|
|
115
|
+
setState("sleeping");
|
|
116
116
|
stopWalk();
|
|
117
117
|
}
|
|
118
118
|
}, anim.idleTimeout);
|