@aeondave/pi-theme-1337 0.5.1 → 0.6.0
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.md +10 -0
- package/README.md +11 -4
- package/docs/architecture.md +12 -7
- package/docs/configuration.md +16 -0
- package/docs/theme-motion.md +3 -3
- package/package.json +6 -6
- package/src/config.ts +400 -357
- package/src/draft.ts +10 -0
- package/src/editor.ts +545 -443
- package/src/format.ts +464 -464
- package/src/git-status-cache.ts +198 -0
- package/src/git-status-reader.ts +28 -0
- package/src/git-status.ts +72 -0
- package/src/header-controller.ts +58 -0
- package/src/header.ts +151 -0
- package/src/index.ts +1264 -1195
- package/src/status-style.ts +26 -0
- package/src/tool-adapter.ts +491 -491
- package/src/tool-groups.ts +192 -192
- package/src/tool-lexicon.ts +200 -200
- package/src/tool-view.ts +788 -788
- package/src/width.ts +1 -1
- package/themes/1337-amber.json +94 -94
- package/themes/1337-fallout.json +94 -94
- package/themes/1337-ice.json +94 -94
- package/themes/1337-skynet-dark.pi1337 +1 -1
- package/themes/1337-skynet.json +61 -61
- package/themes/1337-skynet.pi1337 +1 -1
- package/themes/1337.json +85 -85
package/src/draft.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Minimum useful size before a draft meter takes the workspace slot. */
|
|
2
|
+
export const DRAFT_TOKEN_THRESHOLD = 256;
|
|
3
|
+
|
|
4
|
+
/** A compact meter label, or an empty string when it would be noise. */
|
|
5
|
+
export function formatDraftMeter(tokens: number): string {
|
|
6
|
+
if (!Number.isFinite(tokens) || tokens < DRAFT_TOKEN_THRESHOLD) return "";
|
|
7
|
+
const count = tokens >= 1_000_000 ? `${(tokens / 1_000_000).toFixed(1)}M`
|
|
8
|
+
: tokens >= 1000 ? `${(tokens / 1000).toFixed(1)}k` : String(Math.ceil(tokens));
|
|
9
|
+
return `~${count} tok`;
|
|
10
|
+
}
|