svg-terminal 1.1.0 → 1.1.1

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.
@@ -1392,6 +1392,15 @@ function generateAllLines(frames, terminal, lineHeight, colors, chrome, animatio
1392
1392
  return Array.from(processedLines.entries()).sort((a, b) => a[0] - b[0]).map(([, content]) => content).join("\n");
1393
1393
  }
1394
1394
 
1395
+ // src/core/strict-mode.ts
1396
+ var STRICT = false;
1397
+ function setStrict(enabled) {
1398
+ STRICT = enabled;
1399
+ }
1400
+ function isStrict() {
1401
+ return STRICT;
1402
+ }
1403
+
1395
1404
  // src/core/svg-generator.ts
1396
1405
  function animationHeight(frames) {
1397
1406
  return Math.max(1, ...frames.map((f) => f.length));
@@ -1649,6 +1658,11 @@ function createAnimationFrames(sequences, terminal, maxVisibleLines, scrollDurat
1649
1658
  }
1650
1659
  if (seq.frames && seq.frames.length > 0) {
1651
1660
  const height = animationHeight(seq.frames);
1661
+ if (height > maxVisibleLines) {
1662
+ const msg = `[svg-terminal] An animated block is ${height} rows tall but only ${maxVisibleLines} row(s) fit the terminal \u2014 the overflow is clipped. Use window.autoHeight (default) or a taller window.height / maxHeight. (#124)`;
1663
+ if (isStrict()) throw new Error(msg);
1664
+ console.warn(msg);
1665
+ }
1652
1666
  for (let r = 0; r < height; r++) buffer.push({ type: "output" });
1653
1667
  frames.push({
1654
1668
  time: currentTime,
@@ -2288,7 +2302,7 @@ async function readCappedText(response, url) {
2288
2302
  }
2289
2303
  return new TextDecoder().decode(Buffer.concat(chunks));
2290
2304
  }
2291
- var USER_AGENT = `svg-terminal/${true ? "1.1.0" : "0.0.0-dev"}`;
2305
+ var USER_AGENT = `svg-terminal/${true ? "1.1.1" : "0.0.0-dev"}`;
2292
2306
  async function fetchWithTimeout(url, timeoutMs = DEFAULT_FETCH_TIMEOUT) {
2293
2307
  const blocked = fetchBlockReason(url);
2294
2308
  if (blocked) {
@@ -4531,9 +4545,8 @@ function registerBuiltinBlocks() {
4531
4545
 
4532
4546
  // src/index.ts
4533
4547
  registerBuiltinBlocks();
4534
- var STRICT_BLOCK_CONFIG = false;
4535
4548
  function setStrictBlockConfig(enabled) {
4536
- STRICT_BLOCK_CONFIG = enabled;
4549
+ setStrict(enabled);
4537
4550
  }
4538
4551
  function validateBlockEntry(block, entry, index) {
4539
4552
  const cfg = entry.config ?? {};
@@ -4572,7 +4585,7 @@ ${issues}`
4572
4585
  const known = block.allowedKeys.join(", ");
4573
4586
  const msg = `Unknown config key(s) [${list}] for block "${block.name}" at blocks[${index}]
4574
4587
  Known keys: ${known}`;
4575
- if (STRICT_BLOCK_CONFIG) {
4588
+ if (isStrict()) {
4576
4589
  throw new BlockConfigError(block.name, index, msg);
4577
4590
  }
4578
4591
  console.warn(`[svg-terminal] warning: ${msg}`);
@@ -4739,4 +4752,4 @@ export {
4739
4752
  inspectCache,
4740
4753
  generateStatic
4741
4754
  };
4742
- //# sourceMappingURL=chunk-DVACBVLX.js.map
4755
+ //# sourceMappingURL=chunk-24NH6UUG.js.map
package/dist/cli.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  mergeConfig,
12
12
  setStrictBlockConfig,
13
13
  themes
14
- } from "./chunk-DVACBVLX.js";
14
+ } from "./chunk-24NH6UUG.js";
15
15
 
16
16
  // src/cli.ts
17
17
  import { writeFileSync, watch as fsWatch } from "fs";
@@ -127,7 +127,7 @@ function isZodOptional(t) {
127
127
  }
128
128
 
129
129
  // src/cli.ts
130
- var VERSION = true ? "1.1.0" : "0.0.0-dev";
130
+ var VERSION = true ? "1.1.1" : "0.0.0-dev";
131
131
  var args = process.argv.slice(2);
132
132
  var command = args[0];
133
133
  function getFlag(name) {
package/dist/index.d.ts CHANGED
@@ -716,7 +716,13 @@ interface GenerateOptions {
716
716
  */
717
717
  onCacheEvent?: (event: CacheEventType, key: string) => void;
718
718
  }
719
- /** Enable strict mode globally — unknown block-config keys throw instead of warning. */
719
+ /**
720
+ * Enable strict mode globally — soft warnings (unknown block-config keys for
721
+ * schemaless blocks; an over-tall animated band, #124) become hard errors.
722
+ * The flag lives in `./core/strict-mode.js` so `svg-generator.ts` can read it
723
+ * without importing this module (which would be circular). Re-exported here as
724
+ * `setStrictBlockConfig` for back-compat with the CLI + library consumers.
725
+ */
720
726
  declare function setStrictBlockConfig(enabled: boolean): void;
721
727
  /**
722
728
  * Generate an animated SVG terminal from a declarative config.
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  themes,
48
48
  tokyoNight,
49
49
  win95
50
- } from "./chunk-DVACBVLX.js";
50
+ } from "./chunk-24NH6UUG.js";
51
51
  export {
52
52
  BlockConfigError,
53
53
  ConfigError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg-terminal",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Generate animated SVG terminals for GitHub READMEs from a declarative YAML config. 47 built-in blocks, 12 themes, zero runtime deps in the output.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",