@bendyline/squisq 2.3.3 → 2.4.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-BrgZC7SE.d.ts → Doc-DLpyOAXJ.d.ts} +87 -2
- package/dist/{ImageEditDoc-rum0Xb9P.d.ts → ImageEditDoc-Cu30xb9b.d.ts} +1 -1
- package/dist/{chunk-2ZWIXGAC.js → chunk-2S74DPJH.js} +4 -0
- package/dist/{chunk-RS5AP3J4.js → chunk-AE3IUKMM.js} +1 -1
- package/dist/{chunk-QWCFK5FN.js → chunk-CUYHFOFL.js} +5 -1
- package/dist/{chunk-G3JOS25T.js → chunk-D4LPP3P5.js} +43 -14
- package/dist/{chunk-GQNH7PLN.js → chunk-F2IEPSMA.js} +1320 -8
- package/dist/{chunk-IZLKI3IL.js → chunk-KPBZZVGY.js} +29 -5
- package/dist/{chunk-BCCXTMN5.js → chunk-O7JILDEF.js} +7 -0
- package/dist/{chunk-SPTY4C6F.js → chunk-REDUXXDJ.js} +1 -1
- package/dist/{chunk-ABP4LAJS.js → chunk-ZHLNKB2I.js} +1 -1
- package/dist/chunk-ZYO3DBTA.js +983 -0
- package/dist/doc/index.d.ts +103 -6
- package/dist/doc/index.js +8 -6
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +29 -11
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/jsonForm/index.js +2 -2
- package/dist/markdown/index.d.ts +118 -1
- package/dist/markdown/index.js +21 -5
- package/dist/{materializePageSection-CrZWYnXM.d.ts → materializePageSection-CgNs5Qmw.d.ts} +2 -2
- package/dist/narration/index.d.ts +1 -1
- package/dist/narration/index.js +4 -4
- package/dist/recommend/index.js +2 -2
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.js +2 -2
- package/dist/{themeLibrary-DJt89gyP.d.ts → themeLibrary-RWsNtlOu.d.ts} +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/transform/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-UA5DTYAY.js +0 -400
|
@@ -17,6 +17,14 @@ import { a0 as Transition, a2 as TransitionType, M as MarkdownBlockNode, r as Ma
|
|
|
17
17
|
* `doc.documentMedia` clip that spans the whole timeline.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* How an authored video participates in the composed document frame.
|
|
22
|
+
*
|
|
23
|
+
* `content` videos remain in the block body and are laid out by the block
|
|
24
|
+
* template. The other placements are scheduled player-level video and sit
|
|
25
|
+
* above the composed slide.
|
|
26
|
+
*/
|
|
27
|
+
type VideoPlacement = 'content' | 'picture-in-picture' | 'overlay';
|
|
20
28
|
/**
|
|
21
29
|
* A timed piece of media attached to a block (or the document).
|
|
22
30
|
*/
|
|
@@ -26,6 +34,14 @@ interface MediaClip {
|
|
|
26
34
|
/** Source path (mp3/mp4/…), relative to the article media dir. */
|
|
27
35
|
src: string;
|
|
28
36
|
kind: 'audio' | 'video';
|
|
37
|
+
/** Per-video placement. Omitted audio and legacy video use player defaults. */
|
|
38
|
+
placement?: Exclude<VideoPlacement, 'content'>;
|
|
39
|
+
/**
|
|
40
|
+
* Whether a placed video is locked to its owning block's timeline span.
|
|
41
|
+
* `true` clips start with and are capped by the block. `false` clips are
|
|
42
|
+
* document-timed and may cross block boundaries. Omitted for legacy media.
|
|
43
|
+
*/
|
|
44
|
+
lockToBlock?: boolean;
|
|
29
45
|
/**
|
|
30
46
|
* Seconds from the parent block's start when this clip begins. For an
|
|
31
47
|
* `anchor='document'` clip, seconds from the document start. Default 0.
|
|
@@ -64,6 +80,8 @@ interface MediaClip {
|
|
|
64
80
|
blockId: string;
|
|
65
81
|
index: number;
|
|
66
82
|
raw?: string;
|
|
83
|
+
/** Raw authoring form; omitted means a squiggly media annotation. */
|
|
84
|
+
format?: 'html';
|
|
67
85
|
};
|
|
68
86
|
}
|
|
69
87
|
/**
|
|
@@ -75,6 +93,10 @@ interface ScheduledClip {
|
|
|
75
93
|
id: string;
|
|
76
94
|
src: string;
|
|
77
95
|
kind: 'audio' | 'video';
|
|
96
|
+
/** Per-video placement carried through to the player-level compositor. */
|
|
97
|
+
placement?: Exclude<VideoPlacement, 'content'>;
|
|
98
|
+
/** Authored placed-video lock state, when applicable. */
|
|
99
|
+
lockToBlock?: boolean;
|
|
78
100
|
/** Absolute doc-timeline second the clip starts. */
|
|
79
101
|
absoluteStart: number;
|
|
80
102
|
/** Absolute doc-timeline second the clip ends (exclusive). */
|
|
@@ -939,10 +961,73 @@ interface DataTableInput extends BaseTemplateBlock {
|
|
|
939
961
|
/** Color scheme for the table header */
|
|
940
962
|
colorScheme?: ColorScheme;
|
|
941
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Fields shared by every chart template. Chart data normally arrives from
|
|
966
|
+
* the first markdown table in the block body (derived at materialize time);
|
|
967
|
+
* `headers`/`rows` may also be supplied via a ```json data fence. Column
|
|
968
|
+
* roles reference headers by name (case-insensitive) or 0-based index.
|
|
969
|
+
* A chart block with no chartable table renders as ordinary content.
|
|
970
|
+
*/
|
|
971
|
+
interface ChartBaseFields {
|
|
972
|
+
/** Optional title displayed above the chart */
|
|
973
|
+
title?: string;
|
|
974
|
+
/** Header cells (normally derived from the block's markdown table) */
|
|
975
|
+
headers?: string[];
|
|
976
|
+
/** Data rows (normally derived from the block's markdown table) */
|
|
977
|
+
rows?: string[][];
|
|
978
|
+
/** Category/label column — header name or 0-based index. Default: first column. */
|
|
979
|
+
labelColumn?: string;
|
|
980
|
+
/** Value columns — header names or 0-based indexes. Default: all numeric columns. */
|
|
981
|
+
valueColumns?: string[];
|
|
982
|
+
/** Render the source table beneath the chart */
|
|
983
|
+
showTable?: boolean;
|
|
984
|
+
/** Show a series legend (default: on whenever it adds information) */
|
|
985
|
+
showLegend?: boolean;
|
|
986
|
+
/** Print numeric value labels on marks */
|
|
987
|
+
showValues?: boolean;
|
|
988
|
+
/** Unit suffix for tick/value labels (e.g. "km") */
|
|
989
|
+
unit?: string;
|
|
990
|
+
/** Color scheme seeding the series color rotation */
|
|
991
|
+
colorScheme?: ColorScheme;
|
|
992
|
+
}
|
|
993
|
+
/** Horizontal bars — one bar (or bar group) per table row. */
|
|
994
|
+
interface BarChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
995
|
+
template: 'barChart';
|
|
996
|
+
/** Stack series instead of grouping them side by side */
|
|
997
|
+
stacked?: boolean;
|
|
998
|
+
}
|
|
999
|
+
/** Vertical columns — one column (or column group) per table row. */
|
|
1000
|
+
interface ColumnChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1001
|
+
template: 'columnChart';
|
|
1002
|
+
/** Stack series instead of grouping them side by side */
|
|
1003
|
+
stacked?: boolean;
|
|
1004
|
+
}
|
|
1005
|
+
/** Pie chart of the first value column (positive values only). */
|
|
1006
|
+
interface PieChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1007
|
+
template: 'pieChart';
|
|
1008
|
+
}
|
|
1009
|
+
/** Donut chart of the first value column (positive values only). */
|
|
1010
|
+
interface DonutChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1011
|
+
template: 'donutChart';
|
|
1012
|
+
}
|
|
1013
|
+
/** Line chart — one line per value column; unparseable cells become gaps. */
|
|
1014
|
+
interface LineChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1015
|
+
template: 'lineChart';
|
|
1016
|
+
}
|
|
1017
|
+
/** Area chart — filled lines, zero-based value axis. */
|
|
1018
|
+
interface AreaChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1019
|
+
template: 'areaChart';
|
|
1020
|
+
}
|
|
1021
|
+
/** Scatter plot — numeric label column as x-axis (row index fallback). */
|
|
1022
|
+
interface ScatterChartInput extends BaseTemplateBlock, ChartBaseFields {
|
|
1023
|
+
template: 'scatterChart';
|
|
1024
|
+
}
|
|
1025
|
+
/** Union of the chart template inputs (all render through one shared engine). */
|
|
1026
|
+
type ChartTemplateInput = BarChartInput | ColumnChartInput | PieChartInput | DonutChartInput | LineChartInput | AreaChartInput | ScatterChartInput;
|
|
942
1027
|
/**
|
|
943
1028
|
* Union of all template block types.
|
|
944
1029
|
*/
|
|
945
|
-
type TemplateBlock = TitleBlockInput | SectionHeaderInput | ContentBlockInput | StatHighlightInput | QuoteBlockInput | FactCardInput | TwoColumnInput | DateEventInput | ImageWithCaptionInput | LeftFeatureInput | RightFeatureInput | MapBlockInput | FullBleedQuoteInput | ListBlockInput | PhotoGridInput | DefinitionCardInput | ComparisonBarInput | PullQuoteInput | VideoWithCaptionInput | VideoPullQuoteInput | DataTableInput | DiagramBlockInput | TreeBlockInput | TimelineBlockInput | DrawingBlockInput | RawLayersInput;
|
|
1030
|
+
type TemplateBlock = TitleBlockInput | SectionHeaderInput | ContentBlockInput | StatHighlightInput | QuoteBlockInput | FactCardInput | TwoColumnInput | DateEventInput | ImageWithCaptionInput | LeftFeatureInput | RightFeatureInput | MapBlockInput | FullBleedQuoteInput | ListBlockInput | PhotoGridInput | DefinitionCardInput | ComparisonBarInput | PullQuoteInput | VideoWithCaptionInput | VideoPullQuoteInput | DataTableInput | BarChartInput | ColumnChartInput | PieChartInput | DonutChartInput | LineChartInput | AreaChartInput | ScatterChartInput | DiagramBlockInput | TreeBlockInput | TimelineBlockInput | DrawingBlockInput | RawLayersInput;
|
|
946
1031
|
/**
|
|
947
1032
|
* A block can be either a raw Block or a TemplateBlock.
|
|
948
1033
|
*/
|
|
@@ -2557,4 +2642,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
|
|
|
2557
2642
|
*/
|
|
2558
2643
|
declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
|
|
2559
2644
|
|
|
2560
|
-
export {
|
|
2645
|
+
export { LIGHT_SURFACE as $, type AccentImage as A, type BarChartInput as B, type CaptionPhrase as C, DARK_SURFACE as D, type DateEventInput as E, type DeepPartial as F, type DefinitionCardInput as G, type DiagramBlockInput as H, type DiagramEdgeAnchor as I, type DiagramTemplateEdge as J, type DiagramTemplateNode as K, type Doc as L, type DocBlock as M, type DocDiagnostic as N, type DonutChartInput as O, type DrawingBlockInput as P, FRONTMATTER_CUSTOM_TEMPLATES_KEY as Q, FRONTMATTER_CUSTOM_THEMES_KEY as R, type FactCardInput as S, type FontFamily as T, type FontFamilyKind as U, type FullBleedQuoteInput as V, type GradientBackgroundConfig as W, type ImageBackgroundConfig as X, type ImageLayer as Y, type ImageTreatment as Z, type ImageWithCaptionInput as _, type AccentPosition as a, type StartBlockConfig as a$, type Layer as a0, type LayerRepeat as a1, type LayoutHints as a2, type LeftFeatureInput as a3, type LineChartInput as a4, type LinearGradient as a5, type ListBlockInput as a6, type MapBlockInput as a7, type MapLayer as a8, type MapMarker as a9, type PageHeadingTreatment as aA, type PageSectionKind as aB, type PageSectionOverride as aC, type PageTokens as aD, type PathLayer as aE, type PatternBackgroundConfig as aF, type PersistentLayer as aG, type PersistentLayerConfig as aH, type PersistentLayerTemplate as aI, type PersistentLayerTemplateConfig as aJ, type PersistentLayerTemplateType as aK, type PhotoGridInput as aL, type PieChartInput as aM, type Position as aN, type ProgressIndicatorConfig as aO, type PullQuoteInput as aP, type QuoteBlockInput as aQ, type RawLayersInput as aR, type RenderStyle as aS, type RightFeatureInput as aT, type ScatterChartInput as aU, type ScheduledClip as aV, type SectionHeaderInput as aW, type ShapeFilter as aX, type ShapeLayer as aY, type ShapePattern as aZ, type SolidBackgroundConfig as a_, type MapTileStyle as aa, type MarkerStyle as ab, type MediaClip as ac, type MermaidLayer as ad, PAGE_ACCENT_STRATEGIES as ae, PAGE_BACKGROUNDS as af, PAGE_BACKGROUND_RHYTHMS as ag, PAGE_DESIGN_FAMILIES as ah, PAGE_DIVIDERS as ai, PAGE_EMPHASES as aj, PAGE_EYEBROWS as ak, PAGE_HEADING_CASES as al, PAGE_HEADING_SCALES as am, PAGE_HEADING_UNDERLINES as an, PAGE_HERO_STYLES as ao, PAGE_IMAGE_FRAMINGS as ap, PAGE_NUMERAL_STYLES as aq, PAGE_PATTERNS as ar, PAGE_QUOTE_MARKS as as, PAGE_SECTION_KINDS as at, PAGE_SECTION_SPACINGS as au, PAGE_SHADOWS as av, type PageAccentRotation as aw, type PageBackground as ax, type PageDesignFamily as ay, type PageEmphasis as az, type AmbientGradientConfig as b, type StatHighlightInput as b0, type SurfaceScheme as b1, THEME_SCHEMA_VERSION as b2, type TableLayer as b3, type TableLayerStyle as b4, type TemplateBlock as b5, type TemplateContext as b6, type TemplateFunction as b7, type TemplateRegistry as b8, type TextLayer as b9, type VideoWithCaptionInput as bA, type ViewportConfig as bB, type ViewportOrientation as bC, type ViewportPreset as bD, type VignetteConfig as bE, applySurface as bF, calculateDuration as bG, calculateFontScale as bH, createTemplateContext as bI, createTheme as bJ, createThemeRegistry as bK, getAspectRatioString as bL, getBlockAtTime as bM, getCaptionAtTime as bN, getDocPlaybackDuration as bO, getLayoutHints as bP, getSafeTextBounds as bQ, getSegmentAtTime as bR, getTwoColumnPositions as bS, getViewport as bT, getViewportOrientation as bU, isPersistentLayerTemplate as bV, isTemplateBlock as bW, scaledFontSize$1 as bX, resolveMediaSchedule as bY, scaledFontSize as bZ, type TextStyle as ba, type Theme as bb, type ThemeColorPalette as bc, type ThemeColorScheme as bd, type ThemePageStyle as be, type ThemeRegistry as bf, type ThemeSchemaVersion as bg, type ThemeSeedColors as bh, type ThemeStyle as bi, type ThemeTypography as bj, type TimelineBlockInput as bk, type TimelineTemplateEvent as bl, type TimelineTemplateLink as bm, type TimelineTemplateTrack as bn, type TitleBlockInput as bo, type TitleCaptionConfig 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 VideoLayer as bx, type VideoPlacement as by, type VideoPullQuoteInput as bz, type Animation as c, 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 Block as j, type BlockConnection as k, type BorderStyle as l, type CaptionTrack as m, type CaptionWord as n, type ChartBaseFields as o, type ChartTemplateInput as p, type ColorScheme as q, type ColumnChartInput as r, type ComparisonBarInput as s, type ContentBlockInput as t, type CornerBrandingConfig as u, type CustomTemplateDefinition as v, type CustomTemplateLayer as w, DEFAULT_DOC_FONT as x, DEFAULT_TITLE_FONT as y, type DataTableInput as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as ImageLayer, b9 as TextLayer, aY as ShapeLayer, aE as PathLayer } from './Doc-DLpyOAXJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -35,6 +35,8 @@ function resolveMediaSchedule(doc) {
|
|
|
35
35
|
id: clip.id,
|
|
36
36
|
src: clip.src,
|
|
37
37
|
kind: clip.kind,
|
|
38
|
+
...clip.placement ? { placement: clip.placement } : {},
|
|
39
|
+
...clip.lockToBlock != null ? { lockToBlock: clip.lockToBlock } : {},
|
|
38
40
|
absoluteStart: start,
|
|
39
41
|
absoluteEnd: Math.max(start, end),
|
|
40
42
|
sourceIn: clip.clipStart ?? 0,
|
|
@@ -52,6 +54,8 @@ function resolveMediaSchedule(doc) {
|
|
|
52
54
|
id: clip.id,
|
|
53
55
|
src: clip.src,
|
|
54
56
|
kind: clip.kind,
|
|
57
|
+
...clip.placement ? { placement: clip.placement } : {},
|
|
58
|
+
...clip.lockToBlock != null ? { lockToBlock: clip.lockToBlock } : {},
|
|
55
59
|
absoluteStart: start,
|
|
56
60
|
absoluteEnd: Math.max(start, end),
|
|
57
61
|
sourceIn: clip.clipStart ?? 0,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
extractPlainText,
|
|
3
3
|
findNodesByType,
|
|
4
4
|
walkMarkdownTree
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O7JILDEF.js";
|
|
6
6
|
|
|
7
7
|
// src/doc/asciiDiagram/chars.ts
|
|
8
8
|
function toCells(s) {
|
|
@@ -2435,6 +2435,10 @@ function recommendedNamesForProfile(profile) {
|
|
|
2435
2435
|
anyContentSignal = true;
|
|
2436
2436
|
names.add("dataTable");
|
|
2437
2437
|
names.add("comparisonBar");
|
|
2438
|
+
names.add("columnChart");
|
|
2439
|
+
names.add("barChart");
|
|
2440
|
+
names.add("lineChart");
|
|
2441
|
+
names.add("pieChart");
|
|
2438
2442
|
}
|
|
2439
2443
|
if (profile.hasDate) {
|
|
2440
2444
|
anyContentSignal = true;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
parseFrontmatter,
|
|
14
14
|
parseHtmlToNodes
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O7JILDEF.js";
|
|
16
16
|
|
|
17
17
|
// src/markdown/convert.ts
|
|
18
18
|
function convertPosition(pos) {
|
|
@@ -58,25 +58,54 @@ function extractText(node) {
|
|
|
58
58
|
return "";
|
|
59
59
|
}
|
|
60
60
|
function extractTemplateAnnotation(children) {
|
|
61
|
+
const trail = [];
|
|
61
62
|
for (let i = children.length - 1; i >= 0; i--) {
|
|
62
63
|
const child = children[i];
|
|
63
64
|
if (child.type === "text") {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} else {
|
|
72
|
-
children.splice(i, 1);
|
|
73
|
-
}
|
|
74
|
-
return annotation;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
65
|
+
trail.unshift({ value: child.value, index: i });
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const autolink = literalAutolinkText(child);
|
|
69
|
+
if (autolink != null) {
|
|
70
|
+
trail.unshift({ value: autolink, index: i });
|
|
71
|
+
continue;
|
|
77
72
|
}
|
|
78
73
|
break;
|
|
79
74
|
}
|
|
75
|
+
if (trail.length === 0) return null;
|
|
76
|
+
const joined = trail.map((part) => part.value).join("");
|
|
77
|
+
const match = matchTrailingTemplateAnnotation(joined);
|
|
78
|
+
if (!match) return null;
|
|
79
|
+
const annotation = parseAnnotationTokens(match.inner.trim());
|
|
80
|
+
let scannedLength = 0;
|
|
81
|
+
for (const part of trail) {
|
|
82
|
+
if (scannedLength + part.value.length <= match.index) {
|
|
83
|
+
scannedLength += part.value.length;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const boundaryNode = children[part.index];
|
|
87
|
+
const keepLength = match.index - scannedLength;
|
|
88
|
+
if (boundaryNode.type === "text" && keepLength > 0) {
|
|
89
|
+
const stripped = boundaryNode.value.slice(0, keepLength).replace(/\s+$/, "");
|
|
90
|
+
if (stripped) {
|
|
91
|
+
boundaryNode.value = stripped;
|
|
92
|
+
children.splice(part.index + 1);
|
|
93
|
+
} else {
|
|
94
|
+
children.splice(part.index);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
children.splice(part.index);
|
|
98
|
+
}
|
|
99
|
+
return annotation;
|
|
100
|
+
}
|
|
101
|
+
children.splice(trail[0].index);
|
|
102
|
+
return annotation;
|
|
103
|
+
}
|
|
104
|
+
function literalAutolinkText(node) {
|
|
105
|
+
if (node.type !== "link" || node.title != null) return null;
|
|
106
|
+
const label = extractInlineText(node.children);
|
|
107
|
+
if (label === node.url) return label;
|
|
108
|
+
if (/^www\./i.test(label) && node.url === `http://${label}`) return label;
|
|
80
109
|
return null;
|
|
81
110
|
}
|
|
82
111
|
function parseAnnotationTokens(inner) {
|