@flowtty/core 1.0.0-alpha.10 → 1.0.0-alpha.12

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,4 +1,4 @@
1
- import { D as getYoga, E as YogaNode, T as Yoga, _ as computeLayout, c as applyProps, d as insertBefore, f as measureText, g as Rect, h as removeChild, i as Instance, l as createInstance, m as refreshMeasure, n as Container, o as TextInstance, p as ownText, r as HostType, s as appendChild, u as createTextInstance, v as layoutOf, y as BORDER_CHARS } from "../host-CQGPghSs.js";
1
+ import { D as getYoga, E as YogaNode, T as Yoga, _ as computeLayout, c as applyProps, d as insertBefore, f as measureText, g as Rect, h as removeChild, i as Instance, l as createInstance, m as refreshMeasure, n as Container, o as TextInstance, p as ownText, r as HostType, s as appendChild, u as createTextInstance, v as layoutOf, y as BORDER_CHARS } from "../host-C98WW3Ai.js";
2
2
  import { t as Buffer } from "../cells-C-GthybI.js";
3
3
  //#region src/host/paint.d.ts
4
4
  export declare function paint(container: Container, width: number, height: number): Buffer;
@@ -311,6 +311,16 @@ function paintInstance(inst, buffer, offsetX, offsetY, inheritedBg = void 0, cli
311
311
  const ownBg = inst.props.backgroundColor;
312
312
  const effectiveBg = ownBg ?? inheritedBg;
313
313
  const offscreen = clip !== null && (box.left >= clip.left + clip.width || box.left + box.width <= clip.left || box.top >= clip.top + clip.height || box.top + box.height <= clip.top);
314
+ if (!offscreen && inst.props.backdrop === "dim") for (let y = box.top; y < box.top + box.height; y++) for (let x = box.left; x < box.left + box.width; x++) {
315
+ if (x < 0 || y < 0 || x >= buffer.width || y >= buffer.height) continue;
316
+ const under = buffer.get(x, y);
317
+ if (under.style.dim && !under.style.bold) continue;
318
+ const { bold: _bold, ...rest } = under.style;
319
+ setClipped(buffer, x, y, under.char, {
320
+ ...rest,
321
+ dim: true
322
+ }, clip);
323
+ }
314
324
  if (!offscreen && ownBg !== void 0) {
315
325
  const fillStyle = ownBg === "default" ? {} : { bg: ownBg };
316
326
  for (let y = box.top; y < box.top + box.height; y++) for (let x = box.left; x < box.left + box.width; x++) setClipped(buffer, x, y, " ", fillStyle, clip);
@@ -118,6 +118,12 @@ interface BoxProps {
118
118
  * 'hidden' clips ALL descendant writes including their backgrounds and borders.
119
119
  * Does NOT clip this box's own background or border (those are this box's own area). */
120
120
  overflow?: "visible" | "hidden";
121
+ /** Restyle what is ALREADY painted under this box instead of covering it:
122
+ * `'dim'` dims those cells and keeps their characters and colors — the scrim
123
+ * behind a modal. Painted before the box's own background, border, text and
124
+ * children, which therefore stay bright. `dim` is a flag on a cell, not an
125
+ * opacity, so stacked backdrops never darken anything twice. */
126
+ backdrop?: "dim";
121
127
  /** Scroll the content up by this many rows (0 = top). Setting either scroll
122
128
  * prop makes the box a scroll viewport: it clips like `overflow: 'hidden'`
123
129
  * and paints its flow children shifted. The value is clamped to the scrollable
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as GRID_CHARS, S as DEFAULT_BORDER_STYLE, a as ScrollMetrics, b as BorderChars, t as BoxProps, w as GridChars, x as BorderStyle } from "./host-CQGPghSs.js";
1
+ import { C as GRID_CHARS, S as DEFAULT_BORDER_STYLE, a as ScrollMetrics, b as BorderChars, t as BoxProps, w as GridChars, x as BorderStyle } from "./host-C98WW3Ai.js";
2
2
  import { a as NAMED_COLORS, i as Color, n as Cell, o as NamedColor, r as Style, t as Buffer } from "./cells-C-GthybI.js";
3
3
  import { a as NamedKey, i as NAMED_KEYS, n as Key, r as KeyName, t as Backend } from "./backend-CT8SGLO5.js";
4
4
  //#region src/wrap.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowtty/core",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.12",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {