@bendyline/squisq 2.11.19 → 2.11.20

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.
@@ -313,15 +313,17 @@ function snapPoints(box) {
313
313
  const right = box.cx + box.rx;
314
314
  const top = box.cy - box.ry;
315
315
  const bottom = box.cy + box.ry;
316
+ const radius = Math.max(0, Math.min(box.radius ?? 0, box.rx, box.ry));
317
+ const inset = radius * (1 - Math.SQRT1_2);
316
318
  return [
317
319
  { port: "top", x: box.cx, y: top },
318
320
  { port: "right", x: right, y: box.cy },
319
321
  { port: "bottom", x: box.cx, y: bottom },
320
322
  { port: "left", x: left, y: box.cy },
321
- { port: "top-left", x: left, y: top },
322
- { port: "top-right", x: right, y: top },
323
- { port: "bottom-right", x: right, y: bottom },
324
- { port: "bottom-left", x: left, y: bottom }
323
+ { port: "top-left", x: left + inset, y: top + inset },
324
+ { port: "top-right", x: right - inset, y: top + inset },
325
+ { port: "bottom-right", x: right - inset, y: bottom - inset },
326
+ { port: "bottom-left", x: left + inset, y: bottom - inset }
325
327
  ];
326
328
  }
327
329
  function anchorPoint(box, anchor) {
@@ -8,7 +8,7 @@ import {
8
8
  expectedSyllablesAt,
9
9
  flattenRenderableBlocks,
10
10
  wordPosAtExpectedSyllables
11
- } from "./chunk-QLN6ILHM.js";
11
+ } from "./chunk-UWLEDXSU.js";
12
12
 
13
13
  // src/narration/types.ts
14
14
  var DEFAULT_FEATURE_CONFIG = Object.freeze({
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3XEABCT3.js";
4
4
  import {
5
5
  applySavedPresentation
6
- } from "./chunk-QKNFR55R.js";
6
+ } from "./chunk-QFC4JZZH.js";
7
7
  import {
8
8
  SHAPE_NAMES,
9
9
  buildChartData,
@@ -35,7 +35,7 @@ import {
35
35
  templateRegistry,
36
36
  writeCustomTemplatesToFrontmatter,
37
37
  writeCustomThemesToFrontmatter
38
- } from "./chunk-QLN6ILHM.js";
38
+ } from "./chunk-UWLEDXSU.js";
39
39
  import {
40
40
  ASCII_TREE_VOCAB,
41
41
  ASCII_VOCAB,
@@ -11,7 +11,7 @@ import {
11
11
  bytesToBase64,
12
12
  markerPath,
13
13
  shapePath
14
- } from "./chunk-PUS54YU6.js";
14
+ } from "./chunk-4KTLKEIY.js";
15
15
 
16
16
  // src/imageEdit/state.ts
17
17
  var IMAGE_EDIT_STATE_FILENAME = "state.json";
@@ -5,7 +5,7 @@ import {
5
5
  flattenRenderableBlocks,
6
6
  getPinnedBlockMeta,
7
7
  markdownToDoc
8
- } from "./chunk-QLN6ILHM.js";
8
+ } from "./chunk-UWLEDXSU.js";
9
9
  import {
10
10
  isAsciiDiagramFence,
11
11
  isAsciiTimelineFence,
@@ -21,7 +21,7 @@ import {
21
21
  lineStyleDasharray,
22
22
  shapePath,
23
23
  snapEndpoints
24
- } from "./chunk-PUS54YU6.js";
24
+ } from "./chunk-4KTLKEIY.js";
25
25
  import {
26
26
  DEFAULT_THEME,
27
27
  FRONTMATTER_CUSTOM_TEMPLATES_KEY,
@@ -6130,7 +6130,14 @@ function diagramBlock(input, context) {
6130
6130
  const positions = /* @__PURE__ */ new Map();
6131
6131
  for (const node of resolved.nodes) {
6132
6132
  const t = transform(node);
6133
- positions.set(node.id, { cx: t.x + t.w / 2, cy: t.y + t.h / 2, rx: t.w / 2, ry: t.h / 2 });
6133
+ positions.set(node.id, {
6134
+ cx: t.x + t.w / 2,
6135
+ cy: t.y + t.h / 2,
6136
+ rx: t.w / 2,
6137
+ ry: t.h / 2,
6138
+ // Matches the drawing below: containers always 10, leaf cards pill or 10.
6139
+ radius: !node.isContainer && input.nodeShape === "pill" ? t.h / 2 : 10
6140
+ });
6134
6141
  }
6135
6142
  const startMarker = input.startStyle ?? "none";
6136
6143
  const configuredEnd = input.endStyle ?? "arrow";
@@ -10651,6 +10658,7 @@ var TEMPLATE_AUTHORING_METADATA = {
10651
10658
  var COVER_TITLE_BASE_PX = 120;
10652
10659
  var COVER_TITLE_COMFORTABLE_CHARS = 26;
10653
10660
  var COVER_TITLE_MIN_BASE_PX = 62;
10661
+ var COVER_HERO_BOTTOM_MARGIN_PCT = 6;
10654
10662
  function fitCoverTitleSize(title) {
10655
10663
  const len = title.trim().length;
10656
10664
  if (len <= COVER_TITLE_COMFORTABLE_CHARS) return COVER_TITLE_BASE_PX;
@@ -10681,12 +10689,18 @@ function coverBlock(input, context) {
10681
10689
  const subtitleFontSize = themedFontSize(40, context, false);
10682
10690
  const titleYPct = subtitle ? parseFloat(layout.primaryY) : 50;
10683
10691
  const maxWidthPx = parseFloat(layout.maxTextWidth) / 100 * viewport.width;
10684
- const titleH = estimateTextHeight(title, titleFontSize, maxWidthPx, 1.4);
10692
+ const titleH = Math.max(
10693
+ estimateTextHeight(title, titleFontSize, maxWidthPx, 1.4),
10694
+ estimateProseLineCount(title, titleFontSize, maxWidthPx) * titleFontSize * 1.4
10695
+ );
10685
10696
  const px = (v) => v / viewport.height * 100;
10697
+ const subH = subtitle ? estimateTextHeight(subtitle, subtitleFontSize, maxWidthPx, 1.5) : 0;
10686
10698
  const titleBottomPct = titleYPct + px(titleH / 2);
10687
10699
  let accentYPct = titleBottomPct + px(40);
10700
+ const heroTitleBasePct = subtitle ? 70 : 75;
10701
+ const heroTitleLimitPct = subtitle ? 82 - px(subH / 2) : 100 - COVER_HERO_BOTTOM_MARGIN_PCT;
10702
+ const heroTitleYPct = Math.min(heroTitleBasePct, heroTitleLimitPct - px(titleH / 2));
10688
10703
  if (subtitle) {
10689
- const subH = estimateTextHeight(subtitle, subtitleFontSize, maxWidthPx, 1.5);
10690
10704
  const subtitleTopPct = parseFloat(layout.secondaryY) - px(subH / 2);
10691
10705
  accentYPct = Math.max(
10692
10706
  titleBottomPct,
@@ -10780,14 +10794,16 @@ function coverBlock(input, context) {
10780
10794
  fontWeight: "bold",
10781
10795
  color: theme.colors.text,
10782
10796
  textAlign: "center",
10783
- shadow: !standardLightCover
10797
+ shadow: !standardLightCover,
10798
+ shrinkToFit: true
10784
10799
  }
10785
10800
  },
10786
10801
  position: {
10787
10802
  x: "50%",
10788
- y: heroSrc ? subtitle ? "70%" : "75%" : `${titleYPct}%`,
10803
+ y: heroSrc ? `${Math.round(heroTitleYPct * 100) / 100}%` : `${titleYPct}%`,
10789
10804
  anchor: "center",
10790
- width: layout.maxTextWidth
10805
+ width: layout.maxTextWidth,
10806
+ height: `${Math.round(px(titleH) * 100) / 100}%`
10791
10807
  },
10792
10808
  // No animation delay - shown immediately at rest. Word-by-word reveal is
10793
10809
  // a profile opt-in (off by default: the cover doubles as the poster).
@@ -1427,6 +1427,12 @@ interface ClipBox {
1427
1427
  cy: number;
1428
1428
  rx: number;
1429
1429
  ry: number;
1430
+ /**
1431
+ * Corner radius of the drawn outline (a pill is `ry`). Corner ports sit on
1432
+ * the rounded corner instead of the bounding-box corner, which on a pill is
1433
+ * empty space beyond the curve. Omitted → square corners.
1434
+ */
1435
+ radius?: number;
1430
1436
  }
1431
1437
  type ConnectorPort = 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
1432
1438
  interface ConnectorSnapPoint {
@@ -1454,7 +1460,11 @@ declare function clipEndpoints(a: ClipBox, b: ClipBox): {
1454
1460
  y: number;
1455
1461
  };
1456
1462
  };
1457
- /** The stable connector ports exposed around a shape/card box. */
1463
+ /**
1464
+ * The stable connector ports exposed around a shape/card box. With a corner
1465
+ * `radius`, each corner port moves to the 45° point of its rounded corner,
1466
+ * inset by `r·(1 − √½)` on both axes, so an edge meets the drawn outline.
1467
+ */
1458
1468
  declare function snapPoints(box: ClipBox): ConnectorSnapPoint[];
1459
1469
  /** Resolve a normalized authored anchor to a concrete point on a box. */
1460
1470
  declare function anchorPoint(box: ClipBox, anchor: ConnectorAnchor): ConnectorSnapPoint;
package/dist/doc/index.js CHANGED
@@ -74,9 +74,9 @@ import {
74
74
  validateMarkdownSource,
75
75
  wordRevealDelay,
76
76
  writeDashboardLayoutsToFrontmatter
77
- } from "../chunk-BA5MMBI6.js";
77
+ } from "../chunk-KCD3SH5Z.js";
78
78
  import "../chunk-3XEABCT3.js";
79
- import "../chunk-QKNFR55R.js";
79
+ import "../chunk-QFC4JZZH.js";
80
80
  import {
81
81
  ASCII_CHAR_H,
82
82
  ASCII_CHAR_W,
@@ -210,7 +210,7 @@ import {
210
210
  wrapWithPersistentLayers,
211
211
  writeCustomTemplatesToFrontmatter,
212
212
  writeCustomThemesToFrontmatter
213
- } from "../chunk-QLN6ILHM.js";
213
+ } from "../chunk-UWLEDXSU.js";
214
214
  import {
215
215
  ASCII_DIAGRAM_FENCE_LANGS,
216
216
  ASCII_TIMELINE_FENCE_LANGS,
@@ -247,7 +247,7 @@ import {
247
247
  shapePath,
248
248
  snapEndpoints,
249
249
  snapPoints
250
- } from "../chunk-PUS54YU6.js";
250
+ } from "../chunk-4KTLKEIY.js";
251
251
  import "../chunk-7ZAAICW4.js";
252
252
  import "../chunk-2SRF5III.js";
253
253
  import {
@@ -26,9 +26,9 @@ import {
26
26
  touch,
27
27
  updateLayer,
28
28
  writeImageEditDoc
29
- } from "../chunk-OU5FYBOB.js";
29
+ } from "../chunk-PSC3KZEK.js";
30
30
  import "../chunk-OPO5K4DZ.js";
31
- import "../chunk-PUS54YU6.js";
31
+ import "../chunk-4KTLKEIY.js";
32
32
  export {
33
33
  IMAGE_EDIT_ASSETS_PREFIX,
34
34
  IMAGE_EDIT_DEFAULT_BASENAME,
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  recordSlideShown,
28
28
  traceWordPosAt,
29
29
  vadStep
30
- } from "./chunk-JVY3NH6H.js";
30
+ } from "./chunk-5F7AO4S5.js";
31
31
  import {
32
32
  fenceRendererLangs
33
33
  } from "./chunk-PGI7HSWE.js";
@@ -115,7 +115,7 @@ import {
115
115
  touch,
116
116
  updateLayer,
117
117
  writeImageEditDoc
118
- } from "./chunk-OU5FYBOB.js";
118
+ } from "./chunk-PSC3KZEK.js";
119
119
  import {
120
120
  VERSION_TIMESTAMP_PATTERN,
121
121
  formatVersionTimestamp,
@@ -229,7 +229,7 @@ import {
229
229
  validateMarkdownSource,
230
230
  wordRevealDelay,
231
231
  writeDashboardLayoutsToFrontmatter
232
- } from "./chunk-BA5MMBI6.js";
232
+ } from "./chunk-KCD3SH5Z.js";
233
233
  import {
234
234
  buildNarrationTimingJson,
235
235
  parseNarrationTimingJson,
@@ -261,7 +261,7 @@ import {
261
261
  serializePresentationPlan,
262
262
  transformNarratedSegment,
263
263
  usesDynamicPresentation
264
- } from "./chunk-QKNFR55R.js";
264
+ } from "./chunk-QFC4JZZH.js";
265
265
  import {
266
266
  ASCII_CHAR_H,
267
267
  ASCII_CHAR_W,
@@ -401,7 +401,7 @@ import {
401
401
  wrapWithPersistentLayers,
402
402
  writeCustomTemplatesToFrontmatter,
403
403
  writeCustomThemesToFrontmatter
404
- } from "./chunk-QLN6ILHM.js";
404
+ } from "./chunk-UWLEDXSU.js";
405
405
  import {
406
406
  ASCII_DIAGRAM_FENCE_LANGS,
407
407
  ASCII_TIMELINE_FENCE_LANGS,
@@ -444,7 +444,7 @@ import {
444
444
  shapePath,
445
445
  snapEndpoints,
446
446
  snapPoints
447
- } from "./chunk-PUS54YU6.js";
447
+ } from "./chunk-4KTLKEIY.js";
448
448
  import {
449
449
  hasIconMarker,
450
450
  iconClass,
@@ -27,7 +27,7 @@ import {
27
27
  recordSlideShown,
28
28
  traceWordPosAt,
29
29
  vadStep
30
- } from "../chunk-JVY3NH6H.js";
30
+ } from "../chunk-5F7AO4S5.js";
31
31
  import "../chunk-NEWNNLWN.js";
32
32
  import {
33
33
  buildNarrationTimingJson,
@@ -41,9 +41,9 @@ import {
41
41
  wordIndexAtChar,
42
42
  wordIndexAtTime,
43
43
  wordPosAtExpectedSyllables
44
- } from "../chunk-QLN6ILHM.js";
44
+ } from "../chunk-UWLEDXSU.js";
45
45
  import "../chunk-A5QJJZ5S.js";
46
- import "../chunk-PUS54YU6.js";
46
+ import "../chunk-4KTLKEIY.js";
47
47
  import "../chunk-PFH3WV6J.js";
48
48
  import "../chunk-L7QZORLB.js";
49
49
  import "../chunk-WSFXV5BT.js";
@@ -24,11 +24,11 @@ import {
24
24
  serializePresentationPlan,
25
25
  transformNarratedSegment,
26
26
  usesDynamicPresentation
27
- } from "../chunk-QKNFR55R.js";
28
- import "../chunk-QLN6ILHM.js";
27
+ } from "../chunk-QFC4JZZH.js";
28
+ import "../chunk-UWLEDXSU.js";
29
29
  import "../chunk-A5QJJZ5S.js";
30
30
  import "../chunk-SVN7T6BK.js";
31
- import "../chunk-PUS54YU6.js";
31
+ import "../chunk-4KTLKEIY.js";
32
32
  import "../chunk-PFH3WV6J.js";
33
33
  import "../chunk-L7QZORLB.js";
34
34
  import "../chunk-Y4OZ5DSG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq",
3
- "version": "2.11.19",
3
+ "version": "2.11.20",
4
4
  "description": "Headless utilities for doc/block rendering, spatial math, Markdown, and storage",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",