@bendyline/squisq 2.11.15 → 2.11.17
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-C-cv1g4G.d.ts → Doc-CXx1WL8G.d.ts} +28 -3
- package/dist/{ImageEditDoc-3J4PRw8N.d.ts → ImageEditDoc-BVLXI-Zd.d.ts} +1 -1
- package/dist/{annotationCoercion-Ckqpu33y.d.ts → annotationCoercion-BgL52343.d.ts} +1 -1
- package/dist/{chunk-4IQ2DHCI.js → chunk-54RU7TBZ.js} +34 -7
- package/dist/{chunk-C3NAY5YP.js → chunk-A5QJJZ5S.js} +8 -5
- package/dist/{chunk-HVJ6VFDX.js → chunk-GB7OFYUK.js} +4 -0
- package/dist/{chunk-4P557IPH.js → chunk-KNC4ZBQC.js} +5 -5
- package/dist/{chunk-YPI2VJSB.js → chunk-L7IIFWWW.js} +127 -20
- package/dist/{chunk-UVQPK6A3.js → chunk-LJZHC6GN.js} +146 -11
- package/dist/{chunk-GQWIUBJU.js → chunk-MY46W5O5.js} +2 -2
- package/dist/{chunk-HUXK7EOT.js → chunk-PGWYC3S2.js} +93 -4
- package/dist/{chunk-Z35TG4WR.js → chunk-PNXBDMNS.js} +1 -1
- package/dist/{chunk-X7BNDUNI.js → chunk-Q6ELOAOQ.js} +383 -1
- package/dist/{chunk-TMOHAFYE.js → chunk-WSFXV5BT.js} +17 -0
- package/dist/doc/index.d.ts +54 -9
- package/dist/doc/index.js +13 -7
- 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 +37 -11
- package/dist/jsonForm/index.d.ts +2 -2
- package/dist/jsonForm/index.js +1 -1
- package/dist/markdown/index.d.ts +171 -5
- package/dist/markdown/index.js +24 -4
- package/dist/{materializePageSection-Dmy_-AUQ.d.ts → materializePageSection-BX1uOAlN.d.ts} +7 -2
- package/dist/mediaEdit/index.d.ts +3 -3
- package/dist/narration/index.d.ts +2 -2
- package/dist/narration/index.js +6 -6
- package/dist/recommend/index.d.ts +1 -1
- package/dist/recommend/index.js +2 -2
- package/dist/schemas/index.d.ts +5 -5
- package/dist/schemas/index.js +1 -1
- package/dist/{themeLibrary-CROfw3YK.d.ts → themeLibrary-Bnq_x-db.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 +6 -6
- package/dist/{types-Be6sBUBx.d.ts → types-C6VvDDL2.d.ts} +5 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3 as Transition, a5 as TransitionType, M as MarkdownBlockNode, r as MarkdownHeading } from './types-
|
|
1
|
+
import { a3 as Transition, a5 as TransitionType, M as MarkdownBlockNode, r as MarkdownHeading } from './types-C6VvDDL2.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Media-edit recipes — the non-destructive edit list a media reference carries.
|
|
@@ -2620,7 +2620,7 @@ interface Block {
|
|
|
2620
2620
|
* A visual element within a block.
|
|
2621
2621
|
* Layers are composited back-to-front (first layer is background).
|
|
2622
2622
|
*/
|
|
2623
|
-
type Layer = ImageLayer | TextLayer | ShapeLayer | PathLayer | MapLayer | VideoLayer | TableLayer | TreeLayer | MermaidLayer;
|
|
2623
|
+
type Layer = ImageLayer | TextLayer | ShapeLayer | PathLayer | MapLayer | VideoLayer | VideoEmbedLayer | TableLayer | TreeLayer | MermaidLayer;
|
|
2624
2624
|
interface BaseLayer {
|
|
2625
2625
|
/** Unique identifier for this layer */
|
|
2626
2626
|
id: string;
|
|
@@ -2885,6 +2885,31 @@ interface VideoLayer extends BaseLayer {
|
|
|
2885
2885
|
license?: string;
|
|
2886
2886
|
};
|
|
2887
2887
|
}
|
|
2888
|
+
/**
|
|
2889
|
+
* Hosted video layer — the YouTube / Vimeo / Loom / Dailymotion / Wistia
|
|
2890
|
+
* player for a paragraph that is only a link to the video's page.
|
|
2891
|
+
*
|
|
2892
|
+
* Carries the page URL, never a player URL: renderers re-derive the iframe
|
|
2893
|
+
* `src` with `parseVideoEmbedUrl` (`@bendyline/squisq/markdown`), so an
|
|
2894
|
+
* authored layer cannot smuggle in an arbitrary frame, and a URL that is not a
|
|
2895
|
+
* supported video renders nothing. The player keeps the video's aspect ratio
|
|
2896
|
+
* (16:9, or 9:16 for Shorts), letterboxed within the layer's bounds.
|
|
2897
|
+
*
|
|
2898
|
+
* Unlike {@link VideoLayer} this is not a clip on the document timeline: it
|
|
2899
|
+
* does not follow play/pause, is never sought by frame capture, and adds no
|
|
2900
|
+
* audio to exports. Live players appear only where a viewer can use them (the
|
|
2901
|
+
* player's current slide); thumbnails, exports and frame capture draw a
|
|
2902
|
+
* poster instead.
|
|
2903
|
+
*/
|
|
2904
|
+
interface VideoEmbedLayer extends BaseLayer {
|
|
2905
|
+
type: 'videoEmbed';
|
|
2906
|
+
content: {
|
|
2907
|
+
/** The video's page URL — any form `parseVideoEmbedUrl` recognizes. */
|
|
2908
|
+
url: string;
|
|
2909
|
+
/** Names the player for assistive tech and labels the poster. */
|
|
2910
|
+
title?: string;
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2888
2913
|
/**
|
|
2889
2914
|
* Table layer - renders a data table with themed styling.
|
|
2890
2915
|
* Uses foreignObject inside SVG for HTML-based table layout.
|
|
@@ -3277,4 +3302,4 @@ declare function getBlockAtTime(blocks: Block[], time: number): Block | null;
|
|
|
3277
3302
|
*/
|
|
3278
3303
|
declare function getCaptionAtTime(captions: CaptionTrack | undefined, time: number): CaptionPhrase | null;
|
|
3279
3304
|
|
|
3280
|
-
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
|
|
3305
|
+
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 VideoWithCaptionInput 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 ThemeRegistry as bA, type ThemeSchemaVersion as bB, type ThemeSeedColors as bC, type ThemeStyle as bD, type ThemeTypography as bE, type TimelineBlockInput as bF, type TimelineTemplateEvent as bG, type TimelineTemplateLink as bH, type TimelineTemplateTrack as bI, type TitleBlockInput as bJ, type TitleCaptionConfig as bK, type TranscriptBlockInput as bL, type TreeBlockInput as bM, type TreeLayer as bN, type TreeLayerItem as bO, type TreeLayerStyle as bP, type TreeTemplateItem as bQ, type TwoColumnInput as bR, VIEWPORT_PRESETS as bS, type VideoEmbedLayer as bT, type VideoLayer as bU, type VideoPipPosition as bV, type VideoPipShape as bW, type VideoPipSize as bX, type VideoPlacement as bY, type VideoPresentation as bZ, type VideoPullQuoteInput 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, THEME_SCHEMA_VERSION as bn, type TableLayer as bo, type TableLayerStyle as bp, type TemplateBlock as bq, type TemplateContext as br, type TemplateFunction as bs, type TemplateRegistry as bt, type TextLayer as bu, type TextStyle as bv, type Theme as bw, type ThemeColorPalette as bx, type ThemeColorScheme as by, type ThemePageStyle as bz, type Animation as c, type ViewportConfig as c0, type ViewportOrientation as c1, type ViewportPreset as c2, type VignetteConfig as c3, applySurface as c4, calculateDuration as c5, calculateFontScale as c6, createTemplateContext as c7, createTheme as c8, createThemeRegistry as c9, MEDIA_FX_SPECS as cA, type MediaEditParamKey as cB, type MediaEditParamValues as cC, type MediaFxOp as cD, formatMediaNumber as cE, hasRenderableFx as cF, mediaEditHtmlAttribute as cG, mediaEditValuesFromAttributes as cH, mediaEditValuesFromParams as cI, mediaRenderKey as cJ, normalizeMediaCrop as cK, normalizeMediaCuts as cL, parseMediaCrop as cM, parseMediaCuts as cN, parseMediaEdits as cO, parseMediaFx as cP, serializeMediaCrop as cQ, serializeMediaCuts as cR, serializeMediaEdits as cS, serializeMediaFx as cT, getAspectRatioString as ca, getBlockAtTime as cb, getCaptionAtTime as cc, getDocPlaybackDuration as cd, getLayoutHints as ce, getSafeTextBounds as cf, getSegmentAtTime as cg, getTwoColumnPositions as ch, getViewport as ci, getViewportOrientation as cj, isCustomTemplateDefinition as ck, isMotionProfileName as cl, isPersistentLayerTemplate as cm, isTemplateBlock as cn, scaledFontSize$1 as co, readFrontmatterMotion as cp, resolveMediaSchedule as cq, resolveMotionForDoc as cr, resolveMotionProfile as cs, scaledFontSize as ct, scheduleMediaClip as cu, validateCustomTemplateDefinition as cv, type MediaFxOpId as cw, type MediaFxChain as cx, MEDIA_EDIT_PARAMS as cy, MEDIA_FX_ORDER 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, bu as TextLayer, bh as ShapeLayer, aX as PathLayer } from './Doc-
|
|
1
|
+
import { a2 as ImageLayer, bu as TextLayer, bh as ShapeLayer, aX as PathLayer } from './Doc-CXx1WL8G.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildNarrationScript,
|
|
3
3
|
parseNarrationTimingJson
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PNXBDMNS.js";
|
|
5
5
|
import {
|
|
6
6
|
SHAPE_NAMES,
|
|
7
7
|
buildChartData,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
templateRegistry,
|
|
33
33
|
writeCustomTemplatesToFrontmatter,
|
|
34
34
|
writeCustomThemesToFrontmatter
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-L7IIFWWW.js";
|
|
36
36
|
import {
|
|
37
37
|
ASCII_TREE_VOCAB,
|
|
38
38
|
ASCII_VOCAB,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
toCells,
|
|
50
50
|
toGrid,
|
|
51
51
|
traceBoxes
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-A5QJJZ5S.js";
|
|
53
53
|
import {
|
|
54
54
|
iconMarker
|
|
55
55
|
} from "./chunk-7ZAAICW4.js";
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
} from "./chunk-L7QZORLB.js";
|
|
83
83
|
import {
|
|
84
84
|
parseMarkdown
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-PGWYC3S2.js";
|
|
86
86
|
import {
|
|
87
87
|
KNOWN_BLOCK_META_KEYS,
|
|
88
88
|
TABLE_FED_TEMPLATES,
|
|
@@ -91,13 +91,16 @@ import {
|
|
|
91
91
|
isContainerTemplate,
|
|
92
92
|
resolveTemplateName,
|
|
93
93
|
serializeAnnotation
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-WSFXV5BT.js";
|
|
95
95
|
import {
|
|
96
96
|
extractPlainText,
|
|
97
|
+
findBlockVideoEmbed,
|
|
97
98
|
getChildren,
|
|
99
|
+
isVideoEmbedUrl,
|
|
98
100
|
parseHtmlToNodes,
|
|
101
|
+
parseVideoEmbedUrl,
|
|
99
102
|
readFrontmatterThemeId
|
|
100
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-Q6ELOAOQ.js";
|
|
101
104
|
import {
|
|
102
105
|
buildCaptionTrack
|
|
103
106
|
} from "./chunk-4OQFLZ6G.js";
|
|
@@ -894,6 +897,9 @@ function getTemplateDefaults(templateName, headingText, block) {
|
|
|
894
897
|
return deriveTemplateInputs(templateName, headingText, block.contents) ?? {
|
|
895
898
|
items: ["Item 1", "Item 2", "Item 3"]
|
|
896
899
|
};
|
|
900
|
+
case "videoWithCaption":
|
|
901
|
+
case "videoPullQuote":
|
|
902
|
+
return deriveTemplateInputs(templateName, headingText, block.contents) ?? {};
|
|
897
903
|
case "definitionCard":
|
|
898
904
|
return { term: headingText, definition: body || headingText };
|
|
899
905
|
case "dateEvent":
|
|
@@ -1467,6 +1473,20 @@ var pullQuote = (input) => {
|
|
|
1467
1473
|
};
|
|
1468
1474
|
var videoWithCaption = (input) => {
|
|
1469
1475
|
const v = input;
|
|
1476
|
+
if (isVideoEmbedUrl(v.videoSrc)) {
|
|
1477
|
+
return {
|
|
1478
|
+
kind: "media-figure",
|
|
1479
|
+
variant: "video",
|
|
1480
|
+
slots: {
|
|
1481
|
+
media: {
|
|
1482
|
+
type: "videoEmbed",
|
|
1483
|
+
url: v.videoSrc,
|
|
1484
|
+
...v.videoAlt ? { title: v.videoAlt } : {}
|
|
1485
|
+
},
|
|
1486
|
+
caption: v.caption
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1470
1490
|
return {
|
|
1471
1491
|
kind: "media-figure",
|
|
1472
1492
|
variant: "video",
|
|
@@ -1665,8 +1685,14 @@ function markdownNodeContainsMedia(value) {
|
|
|
1665
1685
|
function unconsumedRichContent(block, draft, widgetFenceLangs) {
|
|
1666
1686
|
if (!block.contents || block.contents.length === 0) return void 0;
|
|
1667
1687
|
const templateHasMedia = Boolean(draft.slots.media) || Boolean(draft.slots.items?.some((item) => item.media !== void 0));
|
|
1688
|
+
const media = draft.slots.media;
|
|
1689
|
+
const playedVideo = media?.type === "videoEmbed" ? parseVideoEmbedUrl(media.url)?.watchUrl ?? media.url : null;
|
|
1690
|
+
const isUnplayedVideo = (node) => {
|
|
1691
|
+
const video = findBlockVideoEmbed(node);
|
|
1692
|
+
return video !== null && video.embed.watchUrl !== playedVideo;
|
|
1693
|
+
};
|
|
1668
1694
|
const markdown = block.contents.filter(
|
|
1669
|
-
(node) => isWidgetFence(node, widgetFenceLangs) || !templateHasMedia && markdownNodeContainsMedia(node)
|
|
1695
|
+
(node) => isWidgetFence(node, widgetFenceLangs) || !templateHasMedia && markdownNodeContainsMedia(node) || isUnplayedVideo(node)
|
|
1670
1696
|
);
|
|
1671
1697
|
if (markdown.length === 0) return void 0;
|
|
1672
1698
|
return {
|
|
@@ -2369,6 +2395,7 @@ var PAGE_BASE_CSS = `
|
|
|
2369
2395
|
/* \u2500\u2500 Media figure \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
2370
2396
|
.squisq-page-figure { margin: 0; }
|
|
2371
2397
|
.squisq-page-figure img, .squisq-page-figure video { width: 100%; display: block; }
|
|
2398
|
+
.squisq-page-figure .squisq-video-embed { max-width: none; margin: 0; }
|
|
2372
2399
|
.squisq-page-figure figcaption { margin-top: 0.9em; font-size: 0.9rem; color: var(--squisq-page-text-muted); text-align: center; }
|
|
2373
2400
|
.squisq-page-media-credit { font-size: 0.78rem; opacity: 0.75; }
|
|
2374
2401
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractPlainText,
|
|
3
3
|
findNodesByType,
|
|
4
|
+
isVideoEmbedUrl,
|
|
5
|
+
mediaKindForUrl,
|
|
4
6
|
walkMarkdownTree
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q6ELOAOQ.js";
|
|
6
8
|
|
|
7
9
|
// src/doc/asciiDiagram/chars.ts
|
|
8
10
|
function toCells(s) {
|
|
@@ -2483,7 +2485,6 @@ var DATE_PATTERNS = [
|
|
|
2483
2485
|
/\b\d{4}s\b/,
|
|
2484
2486
|
/\b\d{1,2}(st|nd|rd|th)\s+century\b/i
|
|
2485
2487
|
];
|
|
2486
|
-
var VIDEO_HOST_RE = /(youtube\.com|youtu\.be|vimeo\.com|wistia\.|loom\.com)/i;
|
|
2487
2488
|
function htmlElementsByTag(root, tagNames) {
|
|
2488
2489
|
const blocks = findNodesByType(root, "htmlBlock");
|
|
2489
2490
|
const inline = findNodesByType(root, "htmlInline");
|
|
@@ -2508,7 +2509,9 @@ function profileBlockContents(nodes) {
|
|
|
2508
2509
|
let hasTable = false;
|
|
2509
2510
|
const plainParts = [];
|
|
2510
2511
|
for (const node of nodes) {
|
|
2511
|
-
imageCount += findNodesByType(node, "image").
|
|
2512
|
+
imageCount += findNodesByType(node, "image").filter(
|
|
2513
|
+
(img) => !mediaKindForUrl(img.url ?? "")
|
|
2514
|
+
).length;
|
|
2512
2515
|
imageCount += findNodesByType(node, "imageReference").length;
|
|
2513
2516
|
if (findNodesByType(node, "blockquote").length > 0) hasBlockquote = true;
|
|
2514
2517
|
if (findNodesByType(node, "list").length > 0) hasList = true;
|
|
@@ -2526,7 +2529,7 @@ function profileBlockContents(nodes) {
|
|
|
2526
2529
|
break;
|
|
2527
2530
|
}
|
|
2528
2531
|
const src = el.attributes.src || el.attributes.href || "";
|
|
2529
|
-
if (
|
|
2532
|
+
if (isVideoEmbedUrl(src)) {
|
|
2530
2533
|
hasVideo = true;
|
|
2531
2534
|
break;
|
|
2532
2535
|
}
|
|
@@ -2534,7 +2537,7 @@ function profileBlockContents(nodes) {
|
|
|
2534
2537
|
if (!hasVideo) {
|
|
2535
2538
|
const links = findNodesByType(root, "link");
|
|
2536
2539
|
for (const link of links) {
|
|
2537
|
-
if (
|
|
2540
|
+
if (isVideoEmbedUrl(link.url)) {
|
|
2538
2541
|
hasVideo = true;
|
|
2539
2542
|
break;
|
|
2540
2543
|
}
|
|
@@ -57,6 +57,7 @@ var LAYER_TYPES = /* @__PURE__ */ new Set([
|
|
|
57
57
|
"path",
|
|
58
58
|
"map",
|
|
59
59
|
"video",
|
|
60
|
+
"videoEmbed",
|
|
60
61
|
"table",
|
|
61
62
|
"tree",
|
|
62
63
|
"mermaid"
|
|
@@ -199,6 +200,9 @@ function validateLayerContent(type, content, path, issues) {
|
|
|
199
200
|
requiredFiniteNumber(content, "clipStart", `${path}.clipStart`, issues, { min: 0 });
|
|
200
201
|
requiredFiniteNumber(content, "clipEnd", `${path}.clipEnd`, issues, { min: 0 });
|
|
201
202
|
break;
|
|
203
|
+
case "videoEmbed":
|
|
204
|
+
requiredString(content, "url", `${path}.url`, issues);
|
|
205
|
+
break;
|
|
202
206
|
case "table":
|
|
203
207
|
requiredStringArray(content, "headers", `${path}.headers`, issues);
|
|
204
208
|
validateStringRows(content.rows, `${path}.rows`, issues);
|
|
@@ -8,27 +8,27 @@ import {
|
|
|
8
8
|
deriveTemplateInputs,
|
|
9
9
|
flattenRenderableBlocks,
|
|
10
10
|
markdownToDoc
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L7IIFWWW.js";
|
|
12
12
|
import {
|
|
13
13
|
isAsciiDiagramFence,
|
|
14
14
|
isAsciiTimelineFence,
|
|
15
15
|
isTreeFence
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-A5QJJZ5S.js";
|
|
17
17
|
import {
|
|
18
18
|
cloneAndFreezeData,
|
|
19
19
|
isTemplateBlock
|
|
20
20
|
} from "./chunk-PFH3WV6J.js";
|
|
21
21
|
import {
|
|
22
22
|
parseMarkdown
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-PGWYC3S2.js";
|
|
24
24
|
import {
|
|
25
25
|
isContainerTemplate
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WSFXV5BT.js";
|
|
27
27
|
import {
|
|
28
28
|
extractPlainText,
|
|
29
29
|
getChildren,
|
|
30
30
|
stringifyHtmlNodes
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-Q6ELOAOQ.js";
|
|
32
32
|
import {
|
|
33
33
|
estimateTimeFromText
|
|
34
34
|
} from "./chunk-GHOPHGOK.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
parseAsciiTimeline,
|
|
14
14
|
pickAutoTemplate,
|
|
15
15
|
profileBlockContents
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-A5QJJZ5S.js";
|
|
17
17
|
import {
|
|
18
18
|
anchorPoint,
|
|
19
19
|
base64ToUtf8,
|
|
@@ -61,12 +61,16 @@ import {
|
|
|
61
61
|
sanitizeUrl,
|
|
62
62
|
splitKeyValueToken,
|
|
63
63
|
tokenizeAttrTokens
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-WSFXV5BT.js";
|
|
65
65
|
import {
|
|
66
66
|
extractPlainText,
|
|
67
|
+
findBlockVideoEmbed,
|
|
68
|
+
isVideoEmbedUrl,
|
|
69
|
+
mediaKindForUrl,
|
|
70
|
+
parseVideoEmbedUrl,
|
|
67
71
|
readFrontmatterThemeId,
|
|
68
72
|
walkMarkdownTree
|
|
69
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-Q6ELOAOQ.js";
|
|
70
74
|
import {
|
|
71
75
|
resolveBlockTransition
|
|
72
76
|
} from "./chunk-4VOD55SX.js";
|
|
@@ -762,6 +766,11 @@ function mapAmbientMotion(motion, duration) {
|
|
|
762
766
|
var ACCENT_STRIP_SIZE = 35;
|
|
763
767
|
var STRIP_SIZE = ACCENT_STRIP_SIZE;
|
|
764
768
|
var STRIP_SIZE_PCT = `${STRIP_SIZE}%`;
|
|
769
|
+
function accentForViewport(accent, viewport) {
|
|
770
|
+
if (!accent || accent.position === "bottom-strip") return accent;
|
|
771
|
+
if (getViewportOrientation(viewport) !== "portrait") return accent;
|
|
772
|
+
return { ...accent, position: "bottom-strip" };
|
|
773
|
+
}
|
|
765
774
|
function getAccentLayout(position) {
|
|
766
775
|
switch (position) {
|
|
767
776
|
case "left-strip":
|
|
@@ -1569,9 +1578,29 @@ function findFirstList(contents) {
|
|
|
1569
1578
|
|
|
1570
1579
|
// src/doc/templateInputs.ts
|
|
1571
1580
|
var VIDEO_FILE_RE = /\.(?:webm|mp4|mov|m4v|ogv)(?:[?#].*)?$/i;
|
|
1581
|
+
function extractHostedVideos(contents, limit = Infinity) {
|
|
1582
|
+
const found = [];
|
|
1583
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1584
|
+
for (const node of contents ?? []) {
|
|
1585
|
+
if (found.length >= limit) break;
|
|
1586
|
+
const video = findBlockVideoEmbed(node);
|
|
1587
|
+
if (!video || seen.has(video.embed.watchUrl)) continue;
|
|
1588
|
+
seen.add(video.embed.watchUrl);
|
|
1589
|
+
found.push({
|
|
1590
|
+
url: video.embed.watchUrl,
|
|
1591
|
+
title: video.title,
|
|
1592
|
+
aspectRatio: video.embed.aspectRatio
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
return found;
|
|
1596
|
+
}
|
|
1597
|
+
function isMaterializedMediaNode(node) {
|
|
1598
|
+
if (node.type === "code") return node.lang?.trim().toLowerCase() === "mermaid";
|
|
1599
|
+
return findBlockVideoEmbed(node) !== null;
|
|
1600
|
+
}
|
|
1572
1601
|
function extractBodyPlainText(contents) {
|
|
1573
1602
|
if (!contents || contents.length === 0) return "";
|
|
1574
|
-
return contents.filter((node) => !(node
|
|
1603
|
+
return contents.filter((node) => !isMaterializedMediaNode(node)).map((n) => extractPlainText(n)).join("\n").trim();
|
|
1575
1604
|
}
|
|
1576
1605
|
function extractListItems(contents) {
|
|
1577
1606
|
return extractRichListItems(contents).map((item) => item.text);
|
|
@@ -1745,7 +1774,9 @@ function extractImages(contents, limit = Infinity) {
|
|
|
1745
1774
|
if (!node || typeof node !== "object") return;
|
|
1746
1775
|
const n = node;
|
|
1747
1776
|
if (n.type === "image" && typeof n.url === "string" && n.url) {
|
|
1748
|
-
|
|
1777
|
+
if (!mediaKindForUrl(n.url)) {
|
|
1778
|
+
found.push({ src: n.url, alt: typeof n.alt === "string" ? n.alt : "" });
|
|
1779
|
+
}
|
|
1749
1780
|
return;
|
|
1750
1781
|
}
|
|
1751
1782
|
if ((n.type === "htmlBlock" || n.type === "htmlInline") && Array.isArray(n.htmlChildren)) {
|
|
@@ -1946,7 +1977,7 @@ function autoTemplatePreservesContent(templateName, contents) {
|
|
|
1946
1977
|
}
|
|
1947
1978
|
case "videoWithCaption": {
|
|
1948
1979
|
const videos = extractEmbeddedVideos(nodes);
|
|
1949
|
-
if (videos.length !== 1) return false;
|
|
1980
|
+
if (videos.length + extractHostedVideos(nodes).length !== 1) return false;
|
|
1950
1981
|
const bodyText3 = normalizeCoverageText(extractBodyPlainText(nodes));
|
|
1951
1982
|
return bodyText3 === normalizeCoverageText(videos[0]?.alt ?? "");
|
|
1952
1983
|
}
|
|
@@ -2092,7 +2123,17 @@ function deriveTemplateInputs(templateName, headingText, contents, options = {})
|
|
|
2092
2123
|
}
|
|
2093
2124
|
case "videoWithCaption": {
|
|
2094
2125
|
const video = extractFirstEmbeddedVideo(contents);
|
|
2095
|
-
if (!video)
|
|
2126
|
+
if (!video) {
|
|
2127
|
+
const hosted = extractHostedVideos(contents, 1)[0];
|
|
2128
|
+
if (hosted) {
|
|
2129
|
+
return {
|
|
2130
|
+
videoSrc: hosted.url,
|
|
2131
|
+
videoAlt: hosted.title || headingText,
|
|
2132
|
+
caption: headingText
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
return placeholders ? { caption: headingText } : null;
|
|
2136
|
+
}
|
|
2096
2137
|
return {
|
|
2097
2138
|
videoSrc: video.src,
|
|
2098
2139
|
posterSrc: video.posterSrc,
|
|
@@ -2155,10 +2196,10 @@ function deriveTemplateInputs(templateName, headingText, contents, options = {})
|
|
|
2155
2196
|
function bodyNodes(context) {
|
|
2156
2197
|
if (context.block?.summaryMode === "headings-and-features") return [];
|
|
2157
2198
|
return (context.block?.contents ?? []).filter(
|
|
2158
|
-
// Mermaid source
|
|
2159
|
-
//
|
|
2160
|
-
// preserving any additional
|
|
2161
|
-
(node) => !(node
|
|
2199
|
+
// Mermaid source and hosted-video links are already materialized as
|
|
2200
|
+
// visual layers (a diagram, a player). Repeating them as prose makes the
|
|
2201
|
+
// loss-averse default noisy without preserving any additional meaning.
|
|
2202
|
+
(node) => !isMaterializedMediaNode(node)
|
|
2162
2203
|
);
|
|
2163
2204
|
}
|
|
2164
2205
|
function plainListText(list, depth = 0) {
|
|
@@ -2301,8 +2342,9 @@ var STAT_LINE_HEIGHT = 1.1;
|
|
|
2301
2342
|
var DESC_LINE_HEIGHT = 1.5;
|
|
2302
2343
|
var DETAIL_LINE_HEIGHT = 1.4;
|
|
2303
2344
|
function statHighlight(input, context) {
|
|
2304
|
-
const { stat, colorScheme = "blue"
|
|
2345
|
+
const { stat, colorScheme = "blue" } = input;
|
|
2305
2346
|
const { theme, viewport } = context;
|
|
2347
|
+
const accentImage = accentForViewport(input.accentImage, viewport);
|
|
2306
2348
|
const colors = resolveColorScheme(context, colorScheme);
|
|
2307
2349
|
const rawDescription = (input.description ?? "").trim();
|
|
2308
2350
|
const description = rawDescription === stat.trim() ? "" : rawDescription;
|
|
@@ -2456,8 +2498,9 @@ var LOCKUP_CENTRE = 0.5;
|
|
|
2456
2498
|
var BODY_FILL = 0.94;
|
|
2457
2499
|
var MIN_DECO_PX = 90;
|
|
2458
2500
|
function quoteBlock(input, context) {
|
|
2459
|
-
const { title, quote, attribution
|
|
2501
|
+
const { title, quote, attribution } = input;
|
|
2460
2502
|
const { theme, viewport } = context;
|
|
2503
|
+
const accentImage = accentForViewport(input.accentImage, viewport);
|
|
2461
2504
|
const H = viewport.height;
|
|
2462
2505
|
const W = viewport.width;
|
|
2463
2506
|
const pct = (px) => `${Number((px / H * 100).toFixed(3))}%`;
|
|
@@ -2647,10 +2690,11 @@ var FACT_LINE_HEIGHT = 1.3;
|
|
|
2647
2690
|
var EXPLAIN_LINE_HEIGHT = 1.5;
|
|
2648
2691
|
var SOURCE_LINE_HEIGHT = 1.4;
|
|
2649
2692
|
function factCard(input, context) {
|
|
2650
|
-
const { fact
|
|
2693
|
+
const { fact } = input;
|
|
2651
2694
|
const explanation = (input.explanation ?? "").trim();
|
|
2652
2695
|
const source = (input.source ?? "").trim();
|
|
2653
2696
|
const { theme, viewport } = context;
|
|
2697
|
+
const accentImage = accentForViewport(input.accentImage, viewport);
|
|
2654
2698
|
const accentLayout = accentImage ? getAccentLayout(accentImage.position) : DEFAULT_LAYOUT;
|
|
2655
2699
|
const factFontSize = themedFontSize(56, context, true);
|
|
2656
2700
|
const explainFontSize = themedFontSize(34, context, false);
|
|
@@ -3023,8 +3067,9 @@ var BODY_SLACK = 0.05;
|
|
|
3023
3067
|
var HERO_MAX_SHARE3 = 0.28;
|
|
3024
3068
|
var BOX_SLACK_EM = 0.35;
|
|
3025
3069
|
function dateEvent(input, context) {
|
|
3026
|
-
const { date, description, footer, mood = "neutral"
|
|
3070
|
+
const { date, description, footer, mood = "neutral" } = input;
|
|
3027
3071
|
const { theme, viewport } = context;
|
|
3072
|
+
const accentImage = accentForViewport(input.accentImage, viewport);
|
|
3028
3073
|
const moodAccent = MOOD_ACCENTS[mood];
|
|
3029
3074
|
const dateColor = relativeLuminance(theme.colors.background) > 0.5 ? oklchDarken(moodAccent, 0.25) : moodAccent;
|
|
3030
3075
|
const accentLayout = accentImage ? getAccentLayout(accentImage.position) : DEFAULT_LAYOUT;
|
|
@@ -3764,7 +3809,8 @@ function measureListHeightPx(items, fontSize, geometry) {
|
|
|
3764
3809
|
return heightPx;
|
|
3765
3810
|
}
|
|
3766
3811
|
function listBlock(input, context) {
|
|
3767
|
-
const { title
|
|
3812
|
+
const { title } = input;
|
|
3813
|
+
const accentImage = accentForViewport(input.accentImage, context.viewport);
|
|
3768
3814
|
const items = Array.isArray(input.items) ? input.items : [];
|
|
3769
3815
|
const ordered = input.ordered !== false;
|
|
3770
3816
|
const richItems = extractRichListItems(context.block?.contents);
|
|
@@ -4070,8 +4116,9 @@ var BODY_SLACK2 = 0.05;
|
|
|
4070
4116
|
var HERO_MAX_SHARE4 = 0.28;
|
|
4071
4117
|
var BOX_SLACK_EM2 = 0.35;
|
|
4072
4118
|
function definitionCard(input, context) {
|
|
4073
|
-
const { term, definition, origin, colorScheme = "blue"
|
|
4119
|
+
const { term, definition, origin, colorScheme = "blue" } = input;
|
|
4074
4120
|
const { theme, viewport } = context;
|
|
4121
|
+
const accentImage = accentForViewport(input.accentImage, viewport);
|
|
4075
4122
|
const colors = resolveColorScheme(context, colorScheme);
|
|
4076
4123
|
const accentLayout = accentImage ? getAccentLayout(accentImage.position) : DEFAULT_LAYOUT;
|
|
4077
4124
|
const columnWidthPct = parseFloat(accentLayout.textWidth);
|
|
@@ -4568,6 +4615,37 @@ function videoWithCaption(input, context) {
|
|
|
4568
4615
|
const resolvedClipEnd = Math.max(clipStart, clipEnd ?? clipStart + Math.max(0, input.duration));
|
|
4569
4616
|
const captionFontSize = themedFontSize(30, context, false);
|
|
4570
4617
|
const creditFontSize = themedFontSize(16, context, false);
|
|
4618
|
+
if (isVideoEmbedUrl(videoSrc)) {
|
|
4619
|
+
const layers2 = [
|
|
4620
|
+
createBackgroundLayer("bg", theme.colors.background),
|
|
4621
|
+
{
|
|
4622
|
+
type: "videoEmbed",
|
|
4623
|
+
id: "bg-video",
|
|
4624
|
+
content: { url: videoSrc, ...videoAlt ? { title: videoAlt } : {} },
|
|
4625
|
+
position: caption ? { x: "4%", y: "4%", width: "92%", height: "78%" } : { x: "4%", y: "4%", width: "92%", height: "92%" }
|
|
4626
|
+
}
|
|
4627
|
+
];
|
|
4628
|
+
if (caption) {
|
|
4629
|
+
layers2.push({
|
|
4630
|
+
type: "text",
|
|
4631
|
+
id: "caption",
|
|
4632
|
+
content: {
|
|
4633
|
+
text: caption,
|
|
4634
|
+
style: {
|
|
4635
|
+
fontSize: captionFontSize,
|
|
4636
|
+
fontFamily: getThemeFont(context, "body"),
|
|
4637
|
+
color: theme.colors.text,
|
|
4638
|
+
textAlign: "center",
|
|
4639
|
+
lineHeight: 1.18,
|
|
4640
|
+
maxLines: 2
|
|
4641
|
+
}
|
|
4642
|
+
},
|
|
4643
|
+
position: { x: "50%", y: "90%", anchor: "center", width: "84%" },
|
|
4644
|
+
animation: { type: "fadeIn", duration: 1.5, delay: 0.5 }
|
|
4645
|
+
});
|
|
4646
|
+
}
|
|
4647
|
+
return layers2;
|
|
4648
|
+
}
|
|
4571
4649
|
const layers = [
|
|
4572
4650
|
// Background video clip
|
|
4573
4651
|
{
|
|
@@ -5657,7 +5735,7 @@ function resolveSupplementalMediaLayout(layers, template, viewport, mediaCount,
|
|
|
5657
5735
|
const policy = getBlockMediaLayoutPolicy(template);
|
|
5658
5736
|
const shape = mediaShape(mediaCount, aspectRatios);
|
|
5659
5737
|
const alreadyOwnsMedia = layers.some(
|
|
5660
|
-
(layer) => layer.type === "image" || layer.type === "video" || layer.type === "map" || layer.type === "mermaid"
|
|
5738
|
+
(layer) => layer.type === "image" || layer.type === "video" || layer.type === "videoEmbed" || layer.type === "map" || layer.type === "mermaid"
|
|
5661
5739
|
);
|
|
5662
5740
|
if (!alreadyOwnsMedia && (policy?.nativeLayout === "feature-left" || policy?.nativeLayout === "feature-right")) {
|
|
5663
5741
|
const { position } = featureMediaSlot(
|
|
@@ -9910,6 +9988,9 @@ function collectRichMediaItems(layers, block) {
|
|
|
9910
9988
|
const existingMermaid = new Set(
|
|
9911
9989
|
layers.filter((layer) => layer.type === "mermaid").map((layer) => layer.content.source)
|
|
9912
9990
|
);
|
|
9991
|
+
const existingEmbeds = new Set(
|
|
9992
|
+
layers.filter((layer) => layer.type === "videoEmbed").map((layer) => parseVideoEmbedUrl(layer.content.url)?.watchUrl ?? layer.content.url)
|
|
9993
|
+
);
|
|
9913
9994
|
const embeddedVideos = extractEmbeddedVideos(block.contents);
|
|
9914
9995
|
const videos = embeddedVideos.filter((video) => !existingVideos.has(video.src));
|
|
9915
9996
|
const videoSources = new Set(embeddedVideos.map((video) => video.src));
|
|
@@ -9920,6 +10001,9 @@ function collectRichMediaItems(layers, block) {
|
|
|
9920
10001
|
return true;
|
|
9921
10002
|
});
|
|
9922
10003
|
const sources = mermaidSources(block).filter((source) => !existingMermaid.has(source));
|
|
10004
|
+
const hosted = extractHostedVideos(block.contents).filter(
|
|
10005
|
+
(video) => !existingEmbeds.has(video.url)
|
|
10006
|
+
);
|
|
9923
10007
|
return [
|
|
9924
10008
|
...images.map(
|
|
9925
10009
|
(image) => ({
|
|
@@ -9941,6 +10025,14 @@ function collectRichMediaItems(layers, block) {
|
|
|
9941
10025
|
...video.clipEnd != null ? { clipEnd: video.clipEnd } : {}
|
|
9942
10026
|
})
|
|
9943
10027
|
),
|
|
10028
|
+
...hosted.map(
|
|
10029
|
+
(video) => ({
|
|
10030
|
+
kind: "videoEmbed",
|
|
10031
|
+
url: video.url,
|
|
10032
|
+
title: video.title,
|
|
10033
|
+
aspectRatio: video.aspectRatio
|
|
10034
|
+
})
|
|
10035
|
+
),
|
|
9944
10036
|
...sources.map((source) => ({ kind: "mermaid", source, aspectRatio: 16 / 9 })),
|
|
9945
10037
|
...embeddedSpatialMedia(block)
|
|
9946
10038
|
];
|
|
@@ -10012,6 +10104,17 @@ function richMediaLayers(item, position, block, theme, kindIndex) {
|
|
|
10012
10104
|
}
|
|
10013
10105
|
];
|
|
10014
10106
|
}
|
|
10107
|
+
if (item.kind === "videoEmbed") {
|
|
10108
|
+
const title = item.title || block.title;
|
|
10109
|
+
return [
|
|
10110
|
+
{
|
|
10111
|
+
id: `${block.id}-video-embed-${kindIndex}`,
|
|
10112
|
+
type: "videoEmbed",
|
|
10113
|
+
position,
|
|
10114
|
+
content: { url: item.url, ...title ? { title } : {} }
|
|
10115
|
+
}
|
|
10116
|
+
];
|
|
10117
|
+
}
|
|
10015
10118
|
if (item.kind === "mermaid") {
|
|
10016
10119
|
return [
|
|
10017
10120
|
{
|
|
@@ -10096,6 +10199,7 @@ function appendRichContentLayers(layers, block, theme, viewport, mediaAspectRati
|
|
|
10096
10199
|
const counters = {
|
|
10097
10200
|
image: 0,
|
|
10098
10201
|
video: 0,
|
|
10202
|
+
videoEmbed: 0,
|
|
10099
10203
|
mermaid: 0,
|
|
10100
10204
|
spatial: 0
|
|
10101
10205
|
};
|
|
@@ -12261,7 +12365,7 @@ function getBlockBodyText2(block) {
|
|
|
12261
12365
|
if (!block.contents || block.contents.length === 0) return "";
|
|
12262
12366
|
const tmpl = resolveTemplateName(block.template ?? "");
|
|
12263
12367
|
const consumedFence = tmpl === "diagram" && block.templateData !== void 0 && "nodes" in block.templateData || tmpl === "timeline" && block.templateData !== void 0 && "tracks" in block.templateData || tmpl === "tree" && block.templateData !== void 0 && "items" in block.templateData;
|
|
12264
|
-
return block.contents.filter((node) => !(consumedFence && node.type === "code")).map((node) => extractPlainText(node)).join("\n").trim();
|
|
12368
|
+
return block.contents.filter((node) => !(consumedFence && node.type === "code")).filter((node) => findBlockVideoEmbed(node) === null).map((node) => extractPlainText(node)).join("\n").trim();
|
|
12265
12369
|
}
|
|
12266
12370
|
var MAX_PHRASE_WORDS = 12;
|
|
12267
12371
|
function splitIntoSentences(text) {
|
|
@@ -12323,7 +12427,7 @@ function findFirstHtmlImage(nodes) {
|
|
|
12323
12427
|
function findFirstImage(node) {
|
|
12324
12428
|
if (node.type === "image") {
|
|
12325
12429
|
const img = node;
|
|
12326
|
-
return { url: img.url, alt: img.alt };
|
|
12430
|
+
return mediaKindForUrl(img.url) ? void 0 : { url: img.url, alt: img.alt };
|
|
12327
12431
|
}
|
|
12328
12432
|
if (node.type === "htmlBlock" || node.type === "htmlInline") {
|
|
12329
12433
|
const html = node;
|
|
@@ -12403,6 +12507,7 @@ export {
|
|
|
12403
12507
|
getTemplateHint,
|
|
12404
12508
|
titleBlock,
|
|
12405
12509
|
DEFAULT_LAYOUT,
|
|
12510
|
+
accentForViewport,
|
|
12406
12511
|
getAccentLayout,
|
|
12407
12512
|
createAccentLayers,
|
|
12408
12513
|
adjustY,
|
|
@@ -12422,6 +12527,8 @@ export {
|
|
|
12422
12527
|
treeFromTemplateData,
|
|
12423
12528
|
treeFromMarkdownList,
|
|
12424
12529
|
findFirstList,
|
|
12530
|
+
extractHostedVideos,
|
|
12531
|
+
isMaterializedMediaNode,
|
|
12425
12532
|
extractBodyPlainText,
|
|
12426
12533
|
extractListItems,
|
|
12427
12534
|
renderMarkdownBlocksHtml,
|