@flowtty/core 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -1,5 +1,5 @@
1
- import { C as Container } from '../host-DttBG-OZ.js';
2
- export { B as BORDER_CHARS, H as HostType, I as Instance, R as Rect, T as TextInstance, Y as Yoga, e as YogaNode, f as appendChild, g as applyProps, h as computeLayout, i as createInstance, j as createTextInstance, k as getYoga, l as insertBefore, m as layoutOf, n as measureText, o as ownText, r as refreshMeasure, p as removeChild } from '../host-DttBG-OZ.js';
1
+ import { C as Container } from '../host-zpuR6C1c.js';
2
+ export { B as BORDER_CHARS, H as HostType, I as Instance, R as Rect, T as TextInstance, Y as Yoga, a as YogaNode, b as appendChild, c as applyProps, d as computeLayout, e as createInstance, f as createTextInstance, g as getYoga, i as insertBefore, l as layoutOf, m as measureText, o as ownText, r as refreshMeasure, h as removeChild } from '../host-zpuR6C1c.js';
3
3
  import { B as Buffer } from '../cells-CaXEx4lH.js';
4
4
  import 'yoga-layout/load';
5
5
 
@@ -255,13 +255,15 @@ function intersectRects(a, b) {
255
255
  if (right <= left || bottom <= top) return { left, top, width: 0, height: 0 };
256
256
  return { left, top, width: right - left, height: bottom - top };
257
257
  }
258
- function paintBorder(inst, buffer, box, clip) {
258
+ function paintBorder(inst, buffer, box, clip, effectiveBg) {
259
259
  const style = inst.props.border;
260
260
  if (!style) return;
261
261
  if (box.width < 2 || box.height < 2) return;
262
262
  const chars = BORDER_CHARS[style];
263
263
  const cellStyle = {};
264
264
  if (inst.props.borderColor !== void 0) cellStyle.fg = inst.props.borderColor;
265
+ const bg = inst.props.borderBackgroundColor ?? effectiveBg;
266
+ if (bg !== void 0 && bg !== "default") cellStyle.bg = bg;
265
267
  const x0 = box.left;
266
268
  const y0 = box.top;
267
269
  const x1 = box.left + box.width - 1;
@@ -319,7 +321,7 @@ function paintInstance(inst, buffer, offsetX, offsetY, inheritedBg = void 0, cli
319
321
  }
320
322
  }
321
323
  }
322
- paintBorder(inst, buffer, box, clip);
324
+ paintBorder(inst, buffer, box, clip, effectiveBg);
323
325
  const text = ownText(inst);
324
326
  if (text) {
325
327
  const content = contentRectOf(inst, box);
@@ -62,6 +62,7 @@ interface BoxProps {
62
62
  backgroundColor?: string;
63
63
  border?: BorderStyle;
64
64
  borderColor?: string;
65
+ borderBackgroundColor?: string;
65
66
  borderTitle?: string;
66
67
  padding?: number;
67
68
  paddingX?: number;
@@ -148,4 +149,4 @@ declare function appendChild(parent: Instance, child: Instance | TextInstance, Y
148
149
  declare function removeChild(parent: Instance, child: Instance | TextInstance, Yoga: Yoga): void;
149
150
  declare function insertBefore(parent: Instance, child: Instance | TextInstance, before: Instance | TextInstance, Yoga: Yoga): void;
150
151
 
151
- export { BORDER_CHARS as B, type Container as C, DEFAULT_BORDER_STYLE as D, GRID_CHARS as G, type HostType as H, type Instance as I, type Rect as R, type TextInstance as T, type Yoga as Y, type BorderChars as a, type BorderStyle as b, type BoxProps as c, type GridChars as d, type YogaNode as e, appendChild as f, applyProps as g, computeLayout as h, createInstance as i, createTextInstance as j, getYoga as k, insertBefore as l, layoutOf as m, measureText as n, ownText as o, removeChild as p, refreshMeasure as r };
152
+ export { BORDER_CHARS as B, type Container as C, DEFAULT_BORDER_STYLE as D, GRID_CHARS as G, type HostType as H, type Instance as I, type Rect as R, type TextInstance as T, type Yoga as Y, type YogaNode as a, appendChild as b, applyProps as c, computeLayout as d, createInstance as e, createTextInstance as f, getYoga as g, removeChild as h, insertBefore as i, type BorderChars as j, type BorderStyle as k, layoutOf as l, measureText as m, type BoxProps as n, ownText as o, type GridChars as p, refreshMeasure as r };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { B as Buffer, C as Cell, S as Style } from './cells-CaXEx4lH.js';
2
2
  import { K as Key } from './backend-BcB7VR87.js';
3
3
  export { B as Backend } from './backend-BcB7VR87.js';
4
- export { a as BorderChars, b as BorderStyle, c as BoxProps, D as DEFAULT_BORDER_STYLE, G as GRID_CHARS, d as GridChars } from './host-DttBG-OZ.js';
4
+ export { j as BorderChars, k as BorderStyle, n as BoxProps, D as DEFAULT_BORDER_STYLE, G as GRID_CHARS, p as GridChars } from './host-zpuR6C1c.js';
5
5
  import 'yoga-layout/load';
6
6
 
7
7
  type WrapMode = 'wrap' | 'truncate' | 'none';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowtty/core",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {