@zakmandhro/bunti 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/dsl.ts +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakmandhro/bunti",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A Bun-native terminal layout engine with zero dependencies, 60fps rendering, and an agent-optimized functional API.",
5
5
  "module": "src/index.ts",
6
6
  "exports": {
package/src/dsl.ts CHANGED
@@ -219,7 +219,7 @@ function createDSLContext(
219
219
  ) {
220
220
  const now = Date.now();
221
221
  const start = options.id
222
- ? this.useState(`${options.id}_start`, now)[0]
222
+ ? ctx.useState(`${options.id}_start`, now)[0]
223
223
  : state.startTime;
224
224
  const elapsed = now - start - (options.delay || 0);
225
225
  if (elapsed < 0) return 0;
@@ -316,8 +316,8 @@ function createDSLContext(
316
316
  },
317
317
 
318
318
  list(id: string, items: string[], options: ListOptions = {}) {
319
- const [selectedIndex, setSelectedIndex] = this.useState(`${id}_index`, 0);
320
- const isFocused = this.focusable(id);
319
+ const [selectedIndex, setSelectedIndex] = ctx.useState(`${id}_index`, 0);
320
+ const isFocused = ctx.focusable(id);
321
321
 
322
322
  if (isFocused && options.interactive !== false) {
323
323
  if (state.lastKey === KEYS.UP)
@@ -468,7 +468,7 @@ function createDSLContext(
468
468
  } else if (Array.isArray(input)) {
469
469
  layoutGradient(state, input);
470
470
  } else if (typeof input === 'object' && 'color' in input) {
471
- this.wallpaper(input.color);
471
+ ctx.wallpaper(input.color);
472
472
  } else {
473
473
  layoutWallpaper(state, { bg: input });
474
474
  }