@bendyline/squisq 2.12.4 → 2.13.0
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.
- package/dist/{Doc-DaUT9d7i.d.ts → Doc-czvrR7Oy.d.ts} +50 -2
- package/dist/{ImageEditDoc-vFCJ_bT1.d.ts → ImageEditDoc-BDkpwCMN.d.ts} +1 -1
- package/dist/{annotationCoercion-m2qN3r1k.d.ts → annotationCoercion-hTvELpIN.d.ts} +1 -1
- package/dist/{chunk-HFDYPPNJ.js → chunk-2DXLKKTS.js} +3 -3
- package/dist/{chunk-LCMQCRRX.js → chunk-ECPR5JKY.js} +127 -23
- package/dist/{chunk-I3ENXLAN.js → chunk-FVFTJ64H.js} +46 -16
- package/dist/{chunk-7GVUWJQN.js → chunk-ILLLGZCE.js} +4 -3
- package/dist/{chunk-GGZCJ2MS.js → chunk-JDYWKGG7.js} +51 -6
- package/dist/{chunk-XZZFXXXR.js → chunk-PVFDR3XT.js} +147 -3
- package/dist/{chunk-XFE6WYDK.js → chunk-Y3HL26X3.js} +1 -1
- package/dist/doc/index.d.ts +43 -11
- package/dist/doc/index.js +7 -5
- package/dist/fence/index.d.ts +2 -2
- package/dist/generate/index.d.ts +2 -2
- package/dist/imageEdit/index.d.ts +4 -4
- package/dist/index.d.ts +8 -8
- package/dist/index.js +16 -8
- package/dist/jsonForm/index.d.ts +2 -2
- package/dist/markdown/index.d.ts +38 -4
- package/dist/markdown/index.js +9 -3
- package/dist/{materializePageSection-Kj9ROls1.d.ts → materializePageSection-mTAAHNlA.d.ts} +2 -2
- package/dist/mediaEdit/index.d.ts +3 -3
- package/dist/narration/index.d.ts +2 -2
- package/dist/narration/index.js +3 -3
- package/dist/recommend/index.d.ts +1 -1
- package/dist/recommend/index.js +1 -1
- package/dist/schemas/index.d.ts +5 -5
- package/dist/{themeLibrary-BRRm1Hna.d.ts → themeLibrary-Bsn4YNuq.d.ts} +1 -1
- package/dist/timing/index.d.ts +2 -2
- package/dist/transform/index.d.ts +3 -3
- package/dist/transform/index.js +4 -4
- package/dist/{types--c_Uqmlh.d.ts → types-Zk8qYuaT.d.ts} +4 -0
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BuildSpec, h as BuildTiming, ac as Transition, ae as TransitionType, g as BuildStep, M as MarkdownBlockNode, z as MarkdownHeading, d as BuildAdvance } from './types
|
|
1
|
+
import { f as BuildSpec, h as BuildTiming, ac as Transition, ae as TransitionType, g as BuildStep, M as MarkdownBlockNode, z as MarkdownHeading, d as BuildAdvance } from './types-Zk8qYuaT.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Media-edit recipes — the non-destructive edit list a media reference carries.
|
|
@@ -2708,10 +2708,58 @@ interface TextLayer extends BaseLayer {
|
|
|
2708
2708
|
html?: string;
|
|
2709
2709
|
/** Semantic steps targeted by generated data-squisq-build-step fragments. */
|
|
2710
2710
|
buildSteps?: BuildStep[];
|
|
2711
|
+
/**
|
|
2712
|
+
* Optional paragraph structure, for consumers that write native
|
|
2713
|
+
* paragraphs (PPTX text boxes): which paragraphs are list items, at what
|
|
2714
|
+
* depth, with their text free of the marker. When present, `text` is its
|
|
2715
|
+
* plain projection — each paragraph prefixed with its indent and marker
|
|
2716
|
+
* (` • item`, `2. item`), joined with `\n` — and must be kept in sync.
|
|
2717
|
+
* Consumers that draw `text` as-is ignore it.
|
|
2718
|
+
*/
|
|
2719
|
+
paragraphs?: TextParagraph[];
|
|
2720
|
+
/**
|
|
2721
|
+
* Marks this layer as one piece of a text flow split across layers for
|
|
2722
|
+
* layout — a list drawn as a marker column beside a body column, so the
|
|
2723
|
+
* SVG renderer gets a hanging indent. See {@link TextFlow}.
|
|
2724
|
+
*/
|
|
2725
|
+
flow?: TextFlow;
|
|
2711
2726
|
/** Text styling */
|
|
2712
2727
|
style: TextStyle;
|
|
2713
2728
|
};
|
|
2714
2729
|
}
|
|
2730
|
+
/** One paragraph of a text layer's structured projection (`TextLayer.content.paragraphs`). */
|
|
2731
|
+
interface TextParagraph {
|
|
2732
|
+
/**
|
|
2733
|
+
* The paragraph's text, with any list marker and indent removed. May hold
|
|
2734
|
+
* `\n` line breaks (they stay inside the paragraph); `''` is a blank line.
|
|
2735
|
+
*/
|
|
2736
|
+
text: string;
|
|
2737
|
+
/** Present when the paragraph is a list item. */
|
|
2738
|
+
list?: TextParagraphList;
|
|
2739
|
+
/** Extra space above the paragraph, in canvas px. */
|
|
2740
|
+
spaceBefore?: number;
|
|
2741
|
+
}
|
|
2742
|
+
/** List-item facts for a {@link TextParagraph}. */
|
|
2743
|
+
interface TextParagraphList {
|
|
2744
|
+
ordered: boolean;
|
|
2745
|
+
/** Nesting depth; 0 is the top level. */
|
|
2746
|
+
level: number;
|
|
2747
|
+
/** The item's number, for an ordered item. */
|
|
2748
|
+
number?: number;
|
|
2749
|
+
}
|
|
2750
|
+
/**
|
|
2751
|
+
* Ties together text layers that render one flow of text. A consumer that
|
|
2752
|
+
* lays text out natively (PPTX) draws the flow as ONE text box over the
|
|
2753
|
+
* combined area of its layers, from the `paragraphs` of the non-marker
|
|
2754
|
+
* layers in layer order, and drops the `marker` layers, whose job its own
|
|
2755
|
+
* list bullets take over. Every other consumer renders each layer as usual.
|
|
2756
|
+
*/
|
|
2757
|
+
interface TextFlow {
|
|
2758
|
+
/** Layers with the same id are one flow; unique within a block. */
|
|
2759
|
+
id: string;
|
|
2760
|
+
/** A layout-only list marker, replaced by native bullets. */
|
|
2761
|
+
role?: 'marker';
|
|
2762
|
+
}
|
|
2715
2763
|
/**
|
|
2716
2764
|
* A two-stop linear gradient fill, shared by shape/path fills and text
|
|
2717
2765
|
* backgrounds. When present it overrides the solid `fill` color.
|
|
@@ -3346,4 +3394,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
|
|
|
3346
3394
|
*/
|
|
3347
3395
|
declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
|
|
3348
3396
|
|
|
3349
|
-
export { type FullBleedQuoteInput as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateValidationError as D, type CustomTemplateValidationResult as E, DARK_SURFACE as F, DEFAULT_DOC_FONT as G, DEFAULT_TITLE_FONT as H, type DataTableInput as I, type DateEventInput as J, type DeepPartial as K, type DefinitionCardInput as L, type DiagramBlockInput as M, type DiagramEdgeAnchor as N, type DiagramTemplateEdge as O, type DiagramTemplateNode as P, type Doc as Q, type DocBlock as R, type DocDiagnostic as S, type DonutChartInput as T, type DrawingBlockInput as U, FRONTMATTER_CUSTOM_TEMPLATES_KEY as V, FRONTMATTER_CUSTOM_THEMES_KEY as W, FRONTMATTER_MOTION_KEY as X, type FactCardInput as Y, type FontFamily as Z, type FontFamilyKind as _, type AccentPosition as a, type PersistentLayerTemplate as a$, type GradientBackgroundConfig as a0, type ImageBackgroundConfig as a1, type ImageLayer as a2, type ImageTreatment as a3, type ImageWithCaptionInput as a4, LIGHT_SURFACE as a5, type Layer as a6, type LayerRepeat as a7, type LayoutHints as a8, type LeftFeatureInput as a9, PAGE_EMPHASES as aA, PAGE_EYEBROWS as aB, PAGE_HEADING_CASES as aC, PAGE_HEADING_SCALES as aD, PAGE_HEADING_UNDERLINES as aE, PAGE_HERO_STYLES as aF, PAGE_IMAGE_FRAMINGS as aG, PAGE_NUMERAL_STYLES as aH, PAGE_PATTERNS as aI, PAGE_QUOTE_MARKS as aJ, PAGE_SECTION_KINDS as aK, PAGE_SECTION_SPACINGS as aL, PAGE_SHADOWS as aM, PAGE_VARIANTS as aN, type PageAccentRotation as aO, type PageBackground as aP, type PageDesignFamily as aQ, type PageEmphasis as aR, type PageHeadingTreatment as aS, type PageSectionKind as aT, type PageSectionOverride as aU, type PageTokens as aV, type PageVariant as aW, type PathLayer as aX, type PatternBackgroundConfig as aY, type PersistentLayer as aZ, type PersistentLayerConfig as a_, type LineChartInput as aa, type LinearGradient as ab, type ListBlockInput as ac, MOTION_PROFILES as ad, type MapBlockInput as ae, type MapLayer as af, type MapMarker as ag, type MapTileStyle as ah, type MarkerStyle as ai, type MediaClip as aj, type MediaCrop as ak, type MediaCut as al, type MediaEdits as am, type MediaScheduleOptions as an, type MermaidLayer as ao, type MotionEntrance as ap, type MotionOrigin as aq, type MotionProfile as ar, type MotionProfileName as as, type MotionSpec as at, type MotionState as au, PAGE_ACCENT_STRATEGIES as av, PAGE_BACKGROUNDS as aw, PAGE_BACKGROUND_RHYTHMS as ax, PAGE_DESIGN_FAMILIES as ay, PAGE_DIVIDERS as az, type AmbientGradientConfig as b, type
|
|
3397
|
+
export { type FullBleedQuoteInput as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, type CustomTemplateValidationError as D, type CustomTemplateValidationResult as E, DARK_SURFACE as F, DEFAULT_DOC_FONT as G, DEFAULT_TITLE_FONT as H, type DataTableInput as I, type DateEventInput as J, type DeepPartial as K, type DefinitionCardInput as L, type DiagramBlockInput as M, type DiagramEdgeAnchor as N, type DiagramTemplateEdge as O, type DiagramTemplateNode as P, type Doc as Q, type DocBlock as R, type DocDiagnostic as S, type DonutChartInput as T, type DrawingBlockInput as U, FRONTMATTER_CUSTOM_TEMPLATES_KEY as V, FRONTMATTER_CUSTOM_THEMES_KEY as W, FRONTMATTER_MOTION_KEY as X, type FactCardInput as Y, type FontFamily as Z, type FontFamilyKind as _, type AccentPosition as a, type PersistentLayerTemplate as a$, type GradientBackgroundConfig as a0, type ImageBackgroundConfig as a1, type ImageLayer as a2, type ImageTreatment as a3, type ImageWithCaptionInput as a4, LIGHT_SURFACE as a5, type Layer as a6, type LayerRepeat as a7, type LayoutHints as a8, type LeftFeatureInput as a9, PAGE_EMPHASES as aA, PAGE_EYEBROWS as aB, PAGE_HEADING_CASES as aC, PAGE_HEADING_SCALES as aD, PAGE_HEADING_UNDERLINES as aE, PAGE_HERO_STYLES as aF, PAGE_IMAGE_FRAMINGS as aG, PAGE_NUMERAL_STYLES as aH, PAGE_PATTERNS as aI, PAGE_QUOTE_MARKS as aJ, PAGE_SECTION_KINDS as aK, PAGE_SECTION_SPACINGS as aL, PAGE_SHADOWS as aM, PAGE_VARIANTS as aN, type PageAccentRotation as aO, type PageBackground as aP, type PageDesignFamily as aQ, type PageEmphasis as aR, type PageHeadingTreatment as aS, type PageSectionKind as aT, type PageSectionOverride as aU, type PageTokens as aV, type PageVariant as aW, type PathLayer as aX, type PatternBackgroundConfig as aY, type PersistentLayer as aZ, type PersistentLayerConfig as a_, type LineChartInput as aa, type LinearGradient as ab, type ListBlockInput as ac, MOTION_PROFILES as ad, type MapBlockInput as ae, type MapLayer as af, type MapMarker as ag, type MapTileStyle as ah, type MarkerStyle as ai, type MediaClip as aj, type MediaCrop as ak, type MediaCut as al, type MediaEdits as am, type MediaScheduleOptions as an, type MermaidLayer as ao, type MotionEntrance as ap, type MotionOrigin as aq, type MotionProfile as ar, type MotionProfileName as as, type MotionSpec as at, type MotionState as au, PAGE_ACCENT_STRATEGIES as av, PAGE_BACKGROUNDS as aw, PAGE_BACKGROUND_RHYTHMS as ax, PAGE_DESIGN_FAMILIES as ay, PAGE_DIVIDERS as az, type AmbientGradientConfig as b, type VideoPipSize as b$, type PersistentLayerTemplateConfig as b0, type PersistentLayerTemplateType as b1, type PhotoGridInput as b2, type PieChartInput as b3, type PipStyle as b4, type Position as b5, type ProgressIndicatorConfig as b6, type PromotedBodyAnnotation as b7, type PullQuoteInput as b8, type QuoteBlockInput as b9, type Theme as bA, type ThemeColorPalette as bB, type ThemeColorScheme as bC, type ThemePageStyle as bD, type ThemeRegistry as bE, type ThemeSchemaVersion as bF, type ThemeSeedColors as bG, type ThemeStyle as bH, type ThemeTypography as bI, type TimelineBlockInput as bJ, type TimelineTemplateEvent as bK, type TimelineTemplateLink as bL, type TimelineTemplateTrack as bM, type TitleBlockInput as bN, type TitleCaptionConfig as bO, type TranscriptBlockInput as bP, type TreeBlockInput as bQ, type TreeLayer as bR, type TreeLayerItem as bS, type TreeLayerStyle as bT, type TreeTemplateItem as bU, type TwoColumnInput as bV, VIEWPORT_PRESETS as bW, type VideoEmbedLayer as bX, type VideoLayer as bY, type VideoPipPosition as bZ, type VideoPipShape as b_, type RawLayersInput as ba, type RenderStyle as bb, type RightFeatureInput as bc, type ScatterChartInput as bd, type ScheduledClip as be, type SectionHeaderInput as bf, type ShapeFilter as bg, type ShapeLayer as bh, type ShapePattern as bi, type SolidBackgroundConfig as bj, type StartBlockConfig as bk, type StatHighlightInput as bl, type SurfaceScheme as bm, type SvgLayer as bn, THEME_SCHEMA_VERSION as bo, type TableLayer as bp, type TableLayerStyle as bq, type TemplateBlock as br, type TemplateContext as bs, type TemplateFunction as bt, type TemplateRegistry as bu, type TextFlow as bv, type TextLayer as bw, type TextParagraph as bx, type TextParagraphList as by, type TextStyle as bz, type Animation as c, type VideoPlacement as c0, type VideoPresentation as c1, type VideoPullQuoteInput as c2, type VideoWithCaptionInput as c3, type ViewportConfig as c4, type ViewportOrientation as c5, type ViewportPreset as c6, type VignetteConfig as c7, applySurface as c8, calculateDuration as c9, type MediaFxOpId as cA, type MediaFxChain as cB, MEDIA_EDIT_PARAMS as cC, MEDIA_FX_ORDER as cD, MEDIA_FX_SPECS as cE, type MediaEditParamKey as cF, type MediaEditParamValues as cG, type MediaFxOp as cH, formatMediaNumber as cI, hasRenderableFx as cJ, mediaEditHtmlAttribute as cK, mediaEditValuesFromAttributes as cL, mediaEditValuesFromParams as cM, mediaRenderKey as cN, normalizeMediaCrop as cO, normalizeMediaCuts as cP, parseMediaCrop as cQ, parseMediaCuts as cR, parseMediaEdits as cS, parseMediaFx as cT, serializeMediaCrop as cU, serializeMediaCuts as cV, serializeMediaEdits as cW, serializeMediaFx as cX, calculateFontScale as ca, createTemplateContext as cb, createTheme as cc, createThemeRegistry as cd, getAspectRatioString as ce, getBlockAtTime as cf, getCaptionAtTime as cg, getDocPlaybackDuration as ch, getLayoutHints as ci, getSafeTextBounds as cj, getSegmentAtTime as ck, getTwoColumnPositions as cl, getViewport as cm, getViewportOrientation as cn, isCustomTemplateDefinition as co, isMotionProfileName as cp, isPersistentLayerTemplate as cq, isTemplateBlock as cr, scaledFontSize$1 as cs, readFrontmatterMotion as ct, resolveMediaSchedule as cu, resolveMotionForDoc as cv, resolveMotionProfile as cw, scaledFontSize as cx, scheduleMediaClip as cy, validateCustomTemplateDefinition as cz, type AnimationType as d, type AreaChartInput as e, type AudioBookmark as f, type AudioSegment as g, type AudioTimingData as h, type AudioTrack as i, type BigTextInput as j, type Block as k, type BlockConnection as l, type BorderStyle as m, type CaptionTrack as n, type CaptionWord as o, type ChartBaseFields as p, type ChartTemplateInput as q, type ColorScheme as r, type ColumnChartInput as s, type ComparisonBarInput as t, type ContentBlockInput as u, type CornerBrandingConfig as v, type CountUpSpec as w, type CreateTemplateContextOptions as x, type CustomTemplateDefinition as y, type CustomTemplateLayer as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a2 as ImageLayer,
|
|
1
|
+
import { a2 as ImageLayer, bw as TextLayer, bh as ShapeLayer, aX as PathLayer } from './Doc-czvrR7Oy.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as BuildSpec, aq as BlockConnection, ae as TransitionType, ad as TransitionDirection } from './types
|
|
1
|
+
import { f as BuildSpec, aq as BlockConnection, ae as TransitionType, ad as TransitionDirection } from './types-Zk8qYuaT.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Registry of known block-meta keys and their coercion strategies.
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
flattenRenderableBlocks,
|
|
5
5
|
getPinnedBlockMeta,
|
|
6
6
|
markdownToDoc
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FVFTJ64H.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveTemplateInputs,
|
|
10
10
|
extractImages,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isAsciiTimelineFence,
|
|
13
13
|
isPictureFence,
|
|
14
14
|
isTreeFence
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JDYWKGG7.js";
|
|
16
16
|
import {
|
|
17
17
|
extractContent,
|
|
18
18
|
mapElementToBlock,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-HYJ63N6V.js";
|
|
25
25
|
import {
|
|
26
26
|
parseMarkdown
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-PVFDR3XT.js";
|
|
28
28
|
import {
|
|
29
29
|
isContainerTemplate
|
|
30
30
|
} from "./chunk-Y25EJEZN.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-FTN6SGW5.js";
|
|
4
4
|
import {
|
|
5
5
|
applySavedPresentation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2DXLKKTS.js";
|
|
7
7
|
import {
|
|
8
8
|
SHAPE_NAMES,
|
|
9
9
|
buildChartData,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
templateRegistry,
|
|
33
33
|
writeCustomTemplatesToFrontmatter,
|
|
34
34
|
writeCustomThemesToFrontmatter
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-FVFTJ64H.js";
|
|
36
36
|
import {
|
|
37
37
|
ASCII_TREE_VOCAB,
|
|
38
38
|
ASCII_VOCAB,
|
|
@@ -50,10 +50,11 @@ import {
|
|
|
50
50
|
isLineChar,
|
|
51
51
|
isPictureFence,
|
|
52
52
|
isVert,
|
|
53
|
+
parseAsciiDiagram,
|
|
53
54
|
toCells,
|
|
54
55
|
toGrid,
|
|
55
56
|
traceBoxes
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-JDYWKGG7.js";
|
|
57
58
|
import {
|
|
58
59
|
iconMarker
|
|
59
60
|
} from "./chunk-7ZAAICW4.js";
|
|
@@ -86,7 +87,7 @@ import {
|
|
|
86
87
|
} from "./chunk-L7QZORLB.js";
|
|
87
88
|
import {
|
|
88
89
|
parseMarkdown
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-PVFDR3XT.js";
|
|
90
91
|
import {
|
|
91
92
|
TABLE_FED_TEMPLATES,
|
|
92
93
|
TEMPLATE_ALIASES,
|
|
@@ -5304,6 +5305,26 @@ function computeSideDegrees(nodes, edges) {
|
|
|
5304
5305
|
}
|
|
5305
5306
|
return deg;
|
|
5306
5307
|
}
|
|
5308
|
+
function leafBoxSize(node, deg) {
|
|
5309
|
+
const labelLines = normalizeLabelLines(node.label);
|
|
5310
|
+
const innerW = labelLines.reduce((w, l) => Math.max(w, cellWidth(l)), 0);
|
|
5311
|
+
const horizDeg = Math.max(deg.top, deg.bottom);
|
|
5312
|
+
const vertDeg = Math.max(deg.left, deg.right);
|
|
5313
|
+
return {
|
|
5314
|
+
wCols: Math.max(node.wCols, innerW + 4, 3, horizDeg > 0 ? 2 * horizDeg + 1 : 0),
|
|
5315
|
+
hRows: Math.max(node.hRows, labelLines.length + 2, 3, vertDeg > 0 ? 2 * vertDeg + 1 : 0)
|
|
5316
|
+
};
|
|
5317
|
+
}
|
|
5318
|
+
function containerBoxMargins(label) {
|
|
5319
|
+
const labelLines = normalizeLabelLines(label);
|
|
5320
|
+
const titleLen = cellWidth(labelLines[0] ?? "");
|
|
5321
|
+
const innerLinesW = labelLines.slice(1).reduce((w, l) => Math.max(w, cellWidth(l)), 0);
|
|
5322
|
+
return {
|
|
5323
|
+
top: 2 + Math.max(0, labelLines.length - 1),
|
|
5324
|
+
side: 2,
|
|
5325
|
+
minWidth: Math.max(titleLen > 0 ? titleLen + 6 : 3, innerLinesW > 0 ? innerLinesW + 4 : 3)
|
|
5326
|
+
};
|
|
5327
|
+
}
|
|
5307
5328
|
function layoutNodes(nodes, edges) {
|
|
5308
5329
|
const byId = /* @__PURE__ */ new Map();
|
|
5309
5330
|
for (const node of nodes) byId.set(node.id, node);
|
|
@@ -5357,17 +5378,8 @@ function layoutNodes(nodes, edges) {
|
|
|
5357
5378
|
const labelLines = normalizeLabelLines(node.label);
|
|
5358
5379
|
const children = childIds.get(id) ?? [];
|
|
5359
5380
|
if (children.length === 0) {
|
|
5360
|
-
const innerW = labelLines.reduce((w, l) => Math.max(w, cellWidth(l)), 0);
|
|
5361
5381
|
const deg = sideDeg.get(id) ?? { top: 0, bottom: 0, left: 0, right: 0 };
|
|
5362
|
-
const
|
|
5363
|
-
const vertDeg = Math.max(deg.left, deg.right);
|
|
5364
|
-
const wCols = Math.max(node.wCols, innerW + 4, 3, horizDeg > 0 ? 2 * horizDeg + 1 : 0);
|
|
5365
|
-
const hRows = Math.max(
|
|
5366
|
-
node.hRows,
|
|
5367
|
-
labelLines.length + 2,
|
|
5368
|
-
3,
|
|
5369
|
-
vertDeg > 0 ? 2 * vertDeg + 1 : 0
|
|
5370
|
-
);
|
|
5382
|
+
const { wCols, hRows } = leafBoxSize(node, deg);
|
|
5371
5383
|
const rect2 = {
|
|
5372
5384
|
r0: node.row,
|
|
5373
5385
|
c0: node.col,
|
|
@@ -5379,17 +5391,14 @@ function layoutNodes(nodes, edges) {
|
|
|
5379
5391
|
}
|
|
5380
5392
|
const childRects = placeSiblings(children, (childId) => layoutSubtree(childId, depth + 1));
|
|
5381
5393
|
const bbox = unionRects(childRects);
|
|
5382
|
-
const
|
|
5383
|
-
const titleLen = cellWidth(labelLines[0] ?? "");
|
|
5394
|
+
const margins = containerBoxMargins(node.label);
|
|
5384
5395
|
const rect = {
|
|
5385
|
-
r0: bbox.r0 -
|
|
5386
|
-
c0: bbox.c0 -
|
|
5387
|
-
r1: bbox.r1 +
|
|
5388
|
-
c1: bbox.c1 +
|
|
5396
|
+
r0: bbox.r0 - margins.top,
|
|
5397
|
+
c0: bbox.c0 - margins.side,
|
|
5398
|
+
r1: bbox.r1 + margins.side,
|
|
5399
|
+
c1: bbox.c1 + margins.side
|
|
5389
5400
|
};
|
|
5390
|
-
|
|
5391
|
-
const minW = Math.max(titleLen > 0 ? titleLen + 6 : 3, innerLinesW > 0 ? innerLinesW + 4 : 3);
|
|
5392
|
-
if (rect.c1 - rect.c0 + 1 < minW) rect.c1 = rect.c0 + minW - 1;
|
|
5401
|
+
if (rect.c1 - rect.c0 + 1 < margins.minWidth) rect.c1 = rect.c0 + margins.minWidth - 1;
|
|
5393
5402
|
if (rect.c1 - rect.c0 + 1 < node.wCols) rect.c1 = rect.c0 + node.wCols - 1;
|
|
5394
5403
|
placed.set(id, { node, rect, labelLines, isContainer: true, depth });
|
|
5395
5404
|
return rect;
|
|
@@ -6237,6 +6246,100 @@ function detectGridStyle(grid) {
|
|
|
6237
6246
|
return ascii > unicode ? "ascii" : "unicode";
|
|
6238
6247
|
}
|
|
6239
6248
|
|
|
6249
|
+
// src/doc/asciiDiagram/arrange.ts
|
|
6250
|
+
import { layoutGraph } from "@bendyline/squisq-graph";
|
|
6251
|
+
var CELL_ASPECT = 2;
|
|
6252
|
+
var TARGET_ASPECT = 1.6;
|
|
6253
|
+
function arrangeAsciiDiagram(diagram2, options = {}) {
|
|
6254
|
+
if (diagram2.nodes.length === 0) return diagram2;
|
|
6255
|
+
const first = options.direction ?? "down";
|
|
6256
|
+
const meaning = diagramMeaning(diagram2);
|
|
6257
|
+
const asRendered = diagramMeaning(parseAsciiDiagram(renderAsciiDiagram(diagram2)));
|
|
6258
|
+
for (const direction of [first, first === "down" ? "right" : "down"]) {
|
|
6259
|
+
const arranged = arrangeOnce(diagram2, direction);
|
|
6260
|
+
const back = diagramMeaning(parseAsciiDiagram(renderAsciiDiagram(arranged)));
|
|
6261
|
+
if (back === meaning || back === asRendered) return arranged;
|
|
6262
|
+
}
|
|
6263
|
+
return diagram2;
|
|
6264
|
+
}
|
|
6265
|
+
function diagramMeaning(d) {
|
|
6266
|
+
const labelOf = new Map(d.nodes.map((n) => [n.id, n.label]));
|
|
6267
|
+
const nodes = d.nodes.map((n) => JSON.stringify([n.label, n.containerId ? labelOf.get(n.containerId) : null])).sort();
|
|
6268
|
+
const edges = d.edges.map((e) => {
|
|
6269
|
+
const ends = [labelOf.get(e.source) ?? "", labelOf.get(e.target) ?? ""];
|
|
6270
|
+
if (!e.directed) ends.sort();
|
|
6271
|
+
return JSON.stringify([...ends, e.label ?? null, e.directed]);
|
|
6272
|
+
}).sort();
|
|
6273
|
+
return JSON.stringify([nodes, edges]);
|
|
6274
|
+
}
|
|
6275
|
+
function arrangeOnce(diagram2, direction) {
|
|
6276
|
+
const ids = new Set(diagram2.nodes.map((n) => n.id));
|
|
6277
|
+
const parentOf = (n) => n.containerId && n.containerId !== n.id && ids.has(n.containerId) ? n.containerId : void 0;
|
|
6278
|
+
const containers = new Set(diagram2.nodes.map(parentOf).filter((p) => !!p));
|
|
6279
|
+
const longestLabel = diagram2.edges.reduce((m, e) => Math.max(m, (e.label ?? "").length), 0);
|
|
6280
|
+
const titleRows = diagram2.nodes.filter((n) => containers.has(n.id)).reduce((m, n) => Math.max(m, containerBoxMargins(n.label).top), 2);
|
|
6281
|
+
const right = direction === "right";
|
|
6282
|
+
const settings = {
|
|
6283
|
+
direction,
|
|
6284
|
+
integerCoordinates: true,
|
|
6285
|
+
nodeSpacing: right ? 2 : 4,
|
|
6286
|
+
layerSpacing: right ? Math.max(8, longestLabel + 6) : 3,
|
|
6287
|
+
edgeSpacing: 2,
|
|
6288
|
+
componentSpacing: right ? 4 : 2,
|
|
6289
|
+
containerPadding: { top: titleRows, right: 2, bottom: 2, left: 2 },
|
|
6290
|
+
aspectRatio: TARGET_ASPECT * CELL_ASPECT
|
|
6291
|
+
};
|
|
6292
|
+
const degrees = new Map(
|
|
6293
|
+
diagram2.nodes.map((n) => [n.id, { top: 0, bottom: 0, left: 0, right: 0 }])
|
|
6294
|
+
);
|
|
6295
|
+
for (const e of diagram2.edges) {
|
|
6296
|
+
if (e.source === e.target || !ids.has(e.source) || !ids.has(e.target)) continue;
|
|
6297
|
+
degrees.get(e.source)[right ? "right" : "bottom"]++;
|
|
6298
|
+
degrees.get(e.target)[right ? "left" : "top"]++;
|
|
6299
|
+
}
|
|
6300
|
+
let arranged = diagram2.nodes;
|
|
6301
|
+
for (let pass = 0; pass < 3; pass++) {
|
|
6302
|
+
const graph = {
|
|
6303
|
+
nodes: diagram2.nodes.map((n) => {
|
|
6304
|
+
const parent = parentOf(n);
|
|
6305
|
+
if (containers.has(n.id)) {
|
|
6306
|
+
return { id: n.id, width: containerBoxMargins(n.label).minWidth, height: 3, parent };
|
|
6307
|
+
}
|
|
6308
|
+
const size = leafBoxSize(n, degrees.get(n.id));
|
|
6309
|
+
return { id: n.id, width: size.wCols, height: size.hRows, parent };
|
|
6310
|
+
}),
|
|
6311
|
+
edges: diagram2.edges.map((e, i) => ({ id: String(i), source: e.source, target: e.target }))
|
|
6312
|
+
};
|
|
6313
|
+
const result = layoutGraph(graph, settings);
|
|
6314
|
+
arranged = diagram2.nodes.map((n, i) => {
|
|
6315
|
+
const placed = result.nodes[i];
|
|
6316
|
+
return containers.has(n.id) ? { ...n, col: placed.x, row: placed.y, wCols: graph.nodes[i].width, hRows: 3 } : { ...n, col: placed.x, row: placed.y, wCols: placed.width, hRows: placed.height };
|
|
6317
|
+
});
|
|
6318
|
+
let grew = false;
|
|
6319
|
+
const actual = computeSideDegrees(arranged, diagram2.edges);
|
|
6320
|
+
for (const n of arranged) {
|
|
6321
|
+
if (containers.has(n.id)) continue;
|
|
6322
|
+
const need = leafBoxSize(n, actual.get(n.id));
|
|
6323
|
+
if (need.wCols > n.wCols || need.hRows > n.hRows) {
|
|
6324
|
+
const d = degrees.get(n.id);
|
|
6325
|
+
const a = actual.get(n.id);
|
|
6326
|
+
degrees.set(n.id, {
|
|
6327
|
+
top: Math.max(d.top, a.top),
|
|
6328
|
+
bottom: Math.max(d.bottom, a.bottom),
|
|
6329
|
+
left: Math.max(d.left, a.left),
|
|
6330
|
+
right: Math.max(d.right, a.right)
|
|
6331
|
+
});
|
|
6332
|
+
grew = true;
|
|
6333
|
+
}
|
|
6334
|
+
}
|
|
6335
|
+
if (!grew) break;
|
|
6336
|
+
}
|
|
6337
|
+
return {
|
|
6338
|
+
...diagram2,
|
|
6339
|
+
nodes: [...arranged].sort((a, b) => a.row - b.row || a.col - b.col)
|
|
6340
|
+
};
|
|
6341
|
+
}
|
|
6342
|
+
|
|
6240
6343
|
// src/doc/asciiTimeline/render.ts
|
|
6241
6344
|
var UNICODE_VOCAB2 = {
|
|
6242
6345
|
rail: "\u2500",
|
|
@@ -6589,6 +6692,7 @@ export {
|
|
|
6589
6692
|
renderAsciiDiagram,
|
|
6590
6693
|
isRepairableDiagram,
|
|
6591
6694
|
repairAsciiDiagram,
|
|
6695
|
+
arrangeAsciiDiagram,
|
|
6592
6696
|
renderAsciiTimeline,
|
|
6593
6697
|
renderTree
|
|
6594
6698
|
};
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
profileBlockContents,
|
|
28
28
|
renderMarkdownBlocksHtml,
|
|
29
29
|
treeToTemplateData
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JDYWKGG7.js";
|
|
31
31
|
import {
|
|
32
32
|
anchorPoint,
|
|
33
33
|
base64ToUtf8,
|
|
@@ -3155,6 +3155,7 @@ function fullBleedQuote(input, context) {
|
|
|
3155
3155
|
}
|
|
3156
3156
|
|
|
3157
3157
|
// src/doc/templates/listBlock.ts
|
|
3158
|
+
var LIST_ITEMS_FLOW = "list-items";
|
|
3158
3159
|
var LIST_ITEM_LINE_HEIGHT = 1.2;
|
|
3159
3160
|
var LIST_ITEM_BASE_FONT_PX = 34;
|
|
3160
3161
|
var LIST_ITEM_GAP_PX = 18;
|
|
@@ -3346,6 +3347,7 @@ function listBlock(input, context) {
|
|
|
3346
3347
|
content: {
|
|
3347
3348
|
// Bullets stay bullets; only ordered (or legacy, unflagged) lists count.
|
|
3348
3349
|
text: ordered ? `${i + 1}.` : "\u2022",
|
|
3350
|
+
flow: { id: LIST_ITEMS_FLOW, role: "marker" },
|
|
3349
3351
|
style: {
|
|
3350
3352
|
fontSize: itemFontSize,
|
|
3351
3353
|
fontFamily: getThemeFont(context, "body"),
|
|
@@ -3368,6 +3370,13 @@ function listBlock(input, context) {
|
|
|
3368
3370
|
content: {
|
|
3369
3371
|
text: itemText,
|
|
3370
3372
|
...itemHtml ? { html: itemHtml } : {},
|
|
3373
|
+
paragraphs: [
|
|
3374
|
+
{
|
|
3375
|
+
text: itemText,
|
|
3376
|
+
list: { ordered, level: 0, ...ordered ? { number: i + 1 } : {} }
|
|
3377
|
+
}
|
|
3378
|
+
],
|
|
3379
|
+
flow: { id: LIST_ITEMS_FLOW },
|
|
3371
3380
|
style: {
|
|
3372
3381
|
fontSize: itemFontSize,
|
|
3373
3382
|
fontFamily: getThemeFont(context, "body"),
|
|
@@ -11937,25 +11946,43 @@ function bodyNodes(context) {
|
|
|
11937
11946
|
(node) => !isMaterializedMediaNode(node)
|
|
11938
11947
|
);
|
|
11939
11948
|
}
|
|
11940
|
-
function
|
|
11941
|
-
const
|
|
11949
|
+
function listParagraphs(list, level = 0) {
|
|
11950
|
+
const ordered = Boolean(list.ordered);
|
|
11942
11951
|
return list.children.flatMap((item, index) => {
|
|
11943
11952
|
const ownText = item.children.filter((node) => node.type !== "list").map((node) => extractPlainText(node).trim()).filter(Boolean).join(" ");
|
|
11944
|
-
const
|
|
11945
|
-
|
|
11953
|
+
const paragraphs = ownText ? [
|
|
11954
|
+
{
|
|
11955
|
+
text: ownText,
|
|
11956
|
+
list: { ordered, level, ...ordered ? { number: (list.start ?? 1) + index } : {} }
|
|
11957
|
+
}
|
|
11958
|
+
] : [];
|
|
11946
11959
|
for (const child of item.children) {
|
|
11947
|
-
if (child.type === "list")
|
|
11960
|
+
if (child.type === "list") paragraphs.push(...listParagraphs(child, level + 1));
|
|
11948
11961
|
}
|
|
11949
|
-
return
|
|
11950
|
-
})
|
|
11962
|
+
return paragraphs;
|
|
11963
|
+
});
|
|
11951
11964
|
}
|
|
11952
|
-
function
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11965
|
+
function plainParagraphText({ text, list }) {
|
|
11966
|
+
if (!list) return text;
|
|
11967
|
+
const marker = list.ordered ? `${list.number ?? 1}.` : "\u2022";
|
|
11968
|
+
return `${" ".repeat(list.level)}${marker} ${text}`;
|
|
11969
|
+
}
|
|
11970
|
+
function completeBodyParagraphs(nodes) {
|
|
11971
|
+
const paragraphs = nodes.flatMap((node, index) => {
|
|
11972
|
+
const own = node.type === "list" ? listParagraphs(node) : [{ text: extractPlainText(node) }];
|
|
11973
|
+
if (index === 0) return own;
|
|
11974
|
+
const blankLines = markdownBlockSeparatorLines(nodes[index - 1], node) - 1;
|
|
11975
|
+
return [...Array.from({ length: blankLines }, () => ({ text: "" })), ...own];
|
|
11976
|
+
});
|
|
11977
|
+
while (paragraphs.length && !plainParagraphText(paragraphs[0]).trim()) paragraphs.shift();
|
|
11978
|
+
while (paragraphs.length && !plainParagraphText(paragraphs[paragraphs.length - 1]).trim()) {
|
|
11979
|
+
paragraphs.pop();
|
|
11980
|
+
}
|
|
11981
|
+
const first = paragraphs[0];
|
|
11982
|
+
if (first && !first.list) paragraphs[0] = { ...first, text: first.text.trimStart() };
|
|
11983
|
+
const last = paragraphs[paragraphs.length - 1];
|
|
11984
|
+
if (last) paragraphs[paragraphs.length - 1] = { ...last, text: last.text.trimEnd() };
|
|
11985
|
+
return paragraphs;
|
|
11959
11986
|
}
|
|
11960
11987
|
function bodyFontSize(body, context) {
|
|
11961
11988
|
const base = body.length > 1800 ? 18 : body.length > 1100 ? 21 : body.length > 650 ? 24 : 28;
|
|
@@ -11965,7 +11992,8 @@ function contentBlock(input, context) {
|
|
|
11965
11992
|
const { theme } = context;
|
|
11966
11993
|
const title = input.title ?? context.block?.title ?? "";
|
|
11967
11994
|
const markdown = bodyNodes(context);
|
|
11968
|
-
const
|
|
11995
|
+
const paragraphs = completeBodyParagraphs(markdown);
|
|
11996
|
+
const body = paragraphs.map(plainParagraphText).join("\n");
|
|
11969
11997
|
const builds = planContentBuilds(markdown, input.build ?? context.block?.build);
|
|
11970
11998
|
const bodyHtml = renderMarkdownBlocksHtml(markdown, builds);
|
|
11971
11999
|
const layers = [createBackgroundLayer("bg", theme.colors.background)];
|
|
@@ -11996,6 +12024,8 @@ function contentBlock(input, context) {
|
|
|
11996
12024
|
text: body,
|
|
11997
12025
|
...builds.steps.length ? { buildSteps: builds.steps } : {},
|
|
11998
12026
|
...bodyHtml ? { html: bodyHtml } : {},
|
|
12027
|
+
// Only a body with list items has structure `text` cannot carry.
|
|
12028
|
+
...paragraphs.some((paragraph) => paragraph.list) ? { paragraphs } : {},
|
|
11999
12029
|
style: {
|
|
12000
12030
|
fontSize: bodyFontSize(body, context),
|
|
12001
12031
|
fontFamily: getThemeFont(context, "body"),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertMarkdownDocumentWithinLimits,
|
|
3
3
|
parseMarkdown,
|
|
4
|
+
remarkWikiLinks,
|
|
4
5
|
toMdast
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PVFDR3XT.js";
|
|
6
7
|
import {
|
|
7
8
|
formatFrontmatterYaml,
|
|
8
9
|
getChildren,
|
|
@@ -171,7 +172,7 @@ function stringifyMarkdown(doc, options) {
|
|
|
171
172
|
let processor;
|
|
172
173
|
if (useDefaults) {
|
|
173
174
|
if (!defaultProcessor) {
|
|
174
|
-
defaultProcessor = unified().use(remarkGfm).use(remarkMath).use(remarkDirective).use(remarkStringify, {
|
|
175
|
+
defaultProcessor = unified().use(remarkWikiLinks).use(remarkGfm).use(remarkMath).use(remarkDirective).use(remarkStringify, {
|
|
175
176
|
bullet: "-",
|
|
176
177
|
bulletOrdered: ".",
|
|
177
178
|
emphasis: "*",
|
|
@@ -184,7 +185,7 @@ function stringifyMarkdown(doc, options) {
|
|
|
184
185
|
}
|
|
185
186
|
processor = defaultProcessor;
|
|
186
187
|
} else {
|
|
187
|
-
processor = unified();
|
|
188
|
+
processor = unified().use(remarkWikiLinks);
|
|
188
189
|
if (options?.gfm !== false) {
|
|
189
190
|
processor = processor.use(remarkGfm);
|
|
190
191
|
}
|
|
@@ -1212,12 +1212,16 @@ function isLattice(diagram) {
|
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
1214
|
// src/doc/templates/diagramLayout.ts
|
|
1215
|
+
import { layoutGraph } from "@bendyline/squisq-graph";
|
|
1215
1216
|
var DEFAULT_OPTS = {
|
|
1216
1217
|
gapX: 260,
|
|
1217
1218
|
gapY: 140,
|
|
1218
1219
|
gridPad: 80,
|
|
1219
1220
|
gridOriginX: 80,
|
|
1220
|
-
gridOriginY: 80
|
|
1221
|
+
gridOriginY: 80,
|
|
1222
|
+
nodeWidth: 180,
|
|
1223
|
+
nodeHeight: 64,
|
|
1224
|
+
direction: "right"
|
|
1221
1225
|
};
|
|
1222
1226
|
function computeDiagramLayout(children, options = {}) {
|
|
1223
1227
|
const opts = { ...DEFAULT_OPTS, ...options };
|
|
@@ -1236,7 +1240,6 @@ function computeDiagramLayout(children, options = {}) {
|
|
|
1236
1240
|
}
|
|
1237
1241
|
}
|
|
1238
1242
|
if (unpositionedIdx.length > 0) {
|
|
1239
|
-
const cols = Math.max(1, Math.ceil(Math.sqrt(unpositionedIdx.length)));
|
|
1240
1243
|
let baseX = opts.gridOriginX;
|
|
1241
1244
|
let baseY = opts.gridOriginY;
|
|
1242
1245
|
const pinned = entries.filter((e) => e.pinned);
|
|
@@ -1246,11 +1249,15 @@ function computeDiagramLayout(children, options = {}) {
|
|
|
1246
1249
|
baseX = minX;
|
|
1247
1250
|
baseY = maxY + opts.gridPad + opts.gapY;
|
|
1248
1251
|
}
|
|
1252
|
+
const placed = layeredPlacement(children, unpositionedIdx, opts);
|
|
1253
|
+
const cols = Math.max(1, Math.ceil(Math.sqrt(unpositionedIdx.length)));
|
|
1249
1254
|
unpositionedIdx.forEach((entryIdx, k) => {
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1255
|
+
const at = placed?.get(entryIdx) ?? {
|
|
1256
|
+
x: k % cols * opts.gapX,
|
|
1257
|
+
y: Math.floor(k / cols) * opts.gapY
|
|
1258
|
+
};
|
|
1259
|
+
entries[entryIdx].x = baseX + at.x;
|
|
1260
|
+
entries[entryIdx].y = baseY + at.y;
|
|
1254
1261
|
});
|
|
1255
1262
|
}
|
|
1256
1263
|
const nodes = entries.map((e) => ({
|
|
@@ -1284,6 +1291,44 @@ function computeDiagramLayout(children, options = {}) {
|
|
|
1284
1291
|
}
|
|
1285
1292
|
return { nodes, edges, warnings };
|
|
1286
1293
|
}
|
|
1294
|
+
function layeredPlacement(children, unpositionedIdx, opts) {
|
|
1295
|
+
const free = new Set(unpositionedIdx.map((i) => children[i].id));
|
|
1296
|
+
const edges = [];
|
|
1297
|
+
for (const i of unpositionedIdx) {
|
|
1298
|
+
for (const conn of children[i].connectsTo ?? []) {
|
|
1299
|
+
if (free.has(conn.target) && conn.target !== children[i].id) {
|
|
1300
|
+
edges.push({ id: String(edges.length), source: children[i].id, target: conn.target });
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
if (edges.length === 0) return null;
|
|
1305
|
+
const across = opts.direction === "right";
|
|
1306
|
+
const result = layoutGraph(
|
|
1307
|
+
{
|
|
1308
|
+
nodes: unpositionedIdx.map((i) => ({
|
|
1309
|
+
id: children[i].id,
|
|
1310
|
+
width: opts.nodeWidth,
|
|
1311
|
+
height: opts.nodeHeight
|
|
1312
|
+
})),
|
|
1313
|
+
edges
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
direction: opts.direction,
|
|
1317
|
+
layerSpacing: Math.max(0, across ? opts.gapX - opts.nodeWidth : opts.gapY - opts.nodeHeight),
|
|
1318
|
+
nodeSpacing: Math.max(0, across ? opts.gapY - opts.nodeHeight : opts.gapX - opts.nodeWidth),
|
|
1319
|
+
componentSpacing: Math.max(0, opts.gapX - opts.nodeWidth),
|
|
1320
|
+
// The template draws its own connectors between card sides; only the
|
|
1321
|
+
// positions are used, so no room is reserved for routing tracks.
|
|
1322
|
+
edgeSpacing: 1
|
|
1323
|
+
}
|
|
1324
|
+
);
|
|
1325
|
+
const out = /* @__PURE__ */ new Map();
|
|
1326
|
+
unpositionedIdx.forEach((entryIdx, k) => {
|
|
1327
|
+
const n = result.nodes[k];
|
|
1328
|
+
out.set(entryIdx, { x: Math.round(n.x), y: Math.round(n.y) });
|
|
1329
|
+
});
|
|
1330
|
+
return out;
|
|
1331
|
+
}
|
|
1287
1332
|
function makeEdgeId(source, conn) {
|
|
1288
1333
|
return conn.type ? `${source}->${conn.target}:${conn.type}` : `${source}->${conn.target}`;
|
|
1289
1334
|
}
|