@bendyline/squisq 2.13.6 → 2.13.8
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-BQUVDooL.d.ts → Doc-BCrrYAuK.d.ts} +1 -1
- package/dist/{ImageEditDoc-glA5UUau.d.ts → ImageEditDoc-CSuevovH.d.ts} +1 -1
- package/dist/{chunk-VQXOX3YN.js → chunk-5C6ZO5FV.js} +7 -5
- package/dist/{chunk-4O26IMVA.js → chunk-CS3MAZZX.js} +4 -4
- package/dist/{chunk-CSR6VCSJ.js → chunk-HGXZMB7K.js} +191 -191
- package/dist/{chunk-KVEOD57Z.js → chunk-L3KSFLTP.js} +0 -29
- package/dist/{chunk-B2MOGSWY.js → chunk-NROIOJKY.js} +1 -1
- package/dist/{chunk-FGN4OZVK.js → chunk-PJHMZ26J.js} +5 -5
- package/dist/{chunk-FJNTG3VZ.js → chunk-S76W65BB.js} +2 -2
- package/dist/{chunk-CPD3MFX7.js → chunk-XDOSE5M3.js} +1 -1
- package/dist/doc/index.d.ts +155 -6
- package/dist/doc/index.js +16 -6
- package/dist/fence/index.d.ts +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +18 -8
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/markdown/index.d.ts +7 -3
- package/dist/markdown/index.js +3 -3
- package/dist/{materializePageSection-_ftXlwvB.d.ts → materializePageSection-FT1B5NOo.d.ts} +1 -1
- package/dist/mediaEdit/index.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/{themeLibrary-D6GK29l3.d.ts → themeLibrary-BWvtBQ42.d.ts} +1 -1
- package/dist/timing/index.d.ts +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/transform/index.js +5 -5
- package/package.json +2 -2
|
@@ -3026,7 +3026,7 @@ interface VideoLayer extends BaseLayer {
|
|
|
3026
3026
|
};
|
|
3027
3027
|
}
|
|
3028
3028
|
/**
|
|
3029
|
-
* Hosted video layer — the YouTube / Vimeo / Loom /
|
|
3029
|
+
* Hosted video layer — the YouTube / Vimeo / Loom / Wistia
|
|
3030
3030
|
* player for a paragraph that is only a link to the video's page.
|
|
3031
3031
|
*
|
|
3032
3032
|
* Carries the page URL, never a player URL: renderers re-derive the iframe
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a3 as ImageLayer, by as TextLayer, bj as ShapeLayer, aZ as PathLayer } from './Doc-
|
|
1
|
+
import { a3 as ImageLayer, by as TextLayer, bj as ShapeLayer, aZ as PathLayer } from './Doc-BCrrYAuK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
profileBlockContents,
|
|
33
33
|
renderMarkdownBlocksHtml,
|
|
34
34
|
treeToTemplateData
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-HGXZMB7K.js";
|
|
36
36
|
import {
|
|
37
37
|
anchorPoint,
|
|
38
38
|
base64ToUtf8,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
parseVideoEmbedUrl,
|
|
82
82
|
readFrontmatterThemeId,
|
|
83
83
|
walkMarkdownTree
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-L3KSFLTP.js";
|
|
85
85
|
import {
|
|
86
86
|
resolveBlockTransition
|
|
87
87
|
} from "./chunk-P53Z4RYC.js";
|
|
@@ -10030,7 +10030,7 @@ var TEMPLATE_METADATA = {
|
|
|
10030
10030
|
},
|
|
10031
10031
|
photoGrid: {
|
|
10032
10032
|
label: "Photo Grid",
|
|
10033
|
-
description: "Arranges
|
|
10033
|
+
description: "Arranges up to four photos in a mosaic grid."
|
|
10034
10034
|
},
|
|
10035
10035
|
definitionCard: {
|
|
10036
10036
|
label: "Definition Card",
|
|
@@ -10050,7 +10050,7 @@ var TEMPLATE_METADATA = {
|
|
|
10050
10050
|
},
|
|
10051
10051
|
videoPullQuote: {
|
|
10052
10052
|
label: "Video Pull Quote",
|
|
10053
|
-
description: "
|
|
10053
|
+
description: "A highlighted pull quote over a full-bleed background video."
|
|
10054
10054
|
},
|
|
10055
10055
|
dataTable: {
|
|
10056
10056
|
label: "Data Table",
|
|
@@ -10086,7 +10086,7 @@ var TEMPLATE_METADATA = {
|
|
|
10086
10086
|
},
|
|
10087
10087
|
diagram: {
|
|
10088
10088
|
label: "Diagram",
|
|
10089
|
-
description: "
|
|
10089
|
+
description: "Draws a box-and-line diagram fence as connected nodes \u2014 edit it visually on a canvas."
|
|
10090
10090
|
},
|
|
10091
10091
|
tree: {
|
|
10092
10092
|
label: "Tree",
|
|
@@ -12615,6 +12615,7 @@ export {
|
|
|
12615
12615
|
videoWithCaption,
|
|
12616
12616
|
videoPullQuote,
|
|
12617
12617
|
dataTable,
|
|
12618
|
+
normalizeChartTable,
|
|
12618
12619
|
buildChartData,
|
|
12619
12620
|
BLOCK_MEDIA_LAYOUT_POLICIES,
|
|
12620
12621
|
getBlockMediaLayoutPolicy,
|
|
@@ -12661,6 +12662,7 @@ export {
|
|
|
12661
12662
|
parseYamlSubset,
|
|
12662
12663
|
findFirstTable,
|
|
12663
12664
|
extractTableData,
|
|
12665
|
+
detectPromotableBodyAnnotation,
|
|
12664
12666
|
getPinnedBlockMeta,
|
|
12665
12667
|
markdownToDoc,
|
|
12666
12668
|
flattenBlocks,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
flattenRenderableBlocks,
|
|
5
5
|
getPinnedBlockMeta,
|
|
6
6
|
markdownToDoc
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5C6ZO5FV.js";
|
|
8
8
|
import {
|
|
9
9
|
deriveTemplateInputs,
|
|
10
10
|
extractEmbeddedVideos,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isPictureParagraph,
|
|
19
19
|
isStandaloneHtmlVideo,
|
|
20
20
|
isTreeFence
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HGXZMB7K.js";
|
|
22
22
|
import {
|
|
23
23
|
extractContent,
|
|
24
24
|
mapElementToBlock,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-WNEH3BZP.js";
|
|
32
32
|
import {
|
|
33
33
|
parseMarkdown
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XDOSE5M3.js";
|
|
35
35
|
import {
|
|
36
36
|
isContainerTemplate
|
|
37
37
|
} from "./chunk-DOOUVVOM.js";
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
getChildren,
|
|
42
42
|
parseTimeSeconds,
|
|
43
43
|
stringifyHtmlNodes
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-L3KSFLTP.js";
|
|
45
45
|
import {
|
|
46
46
|
parseBuildSpec
|
|
47
47
|
} from "./chunk-P53Z4RYC.js";
|
|
@@ -16,7 +16,197 @@ import {
|
|
|
16
16
|
splitKeyValueToken,
|
|
17
17
|
tokenizeAttrTokens,
|
|
18
18
|
walkMarkdownTree
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L3KSFLTP.js";
|
|
20
|
+
|
|
21
|
+
// src/doc/standaloneAnnotation.ts
|
|
22
|
+
function parseAnnotationInner(inner) {
|
|
23
|
+
const tokens = tokenizeAttrTokens(inner.trim());
|
|
24
|
+
const firstIsParam = tokens.length > 0 && tokens[0].indexOf("=") > 0;
|
|
25
|
+
const template = firstIsParam || tokens.length === 0 ? void 0 : tokens[0];
|
|
26
|
+
const startIdx = firstIsParam ? 0 : 1;
|
|
27
|
+
const params = {};
|
|
28
|
+
for (let i = startIdx; i < tokens.length; i++) {
|
|
29
|
+
const kv = splitKeyValueToken(tokens[i]);
|
|
30
|
+
if (kv) params[kv.key] = kv.value;
|
|
31
|
+
}
|
|
32
|
+
return { template, params };
|
|
33
|
+
}
|
|
34
|
+
function parseStandaloneAnnotation(node) {
|
|
35
|
+
if (node.type !== "paragraph") return null;
|
|
36
|
+
const children = node.children ?? [];
|
|
37
|
+
if (children.length !== 1 || children[0].type !== "text") return null;
|
|
38
|
+
const text = children[0].value.trim();
|
|
39
|
+
const match = matchTrailingTemplateAnnotation(text);
|
|
40
|
+
if (!match || match.index !== 0) return null;
|
|
41
|
+
return parseAnnotationInner(match.inner);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/doc/mediaAnnotations.ts
|
|
45
|
+
var MEDIA_TEMPLATES = /* @__PURE__ */ new Set(["audio", "video", "media"]);
|
|
46
|
+
function isMediaAnnotationName(name) {
|
|
47
|
+
return name != null && MEDIA_TEMPLATES.has(name);
|
|
48
|
+
}
|
|
49
|
+
function time(raw) {
|
|
50
|
+
if (raw == null) return null;
|
|
51
|
+
return parseTimeSeconds(raw);
|
|
52
|
+
}
|
|
53
|
+
function videoPlacement(params) {
|
|
54
|
+
const explicit = params.placement ?? params.presentation;
|
|
55
|
+
if (explicit === "content") return "content";
|
|
56
|
+
if (explicit === "pip" || explicit === "picture-in-picture") return "picture-in-picture";
|
|
57
|
+
if (explicit === "overlay" || explicit === "full-frame") return "overlay";
|
|
58
|
+
if (params.pip === "" || params.pip === "true") return "picture-in-picture";
|
|
59
|
+
if (params.overlay === "" || params.overlay === "true") return "overlay";
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
function lockToBlock(raw) {
|
|
63
|
+
return raw !== "false" && raw !== "0";
|
|
64
|
+
}
|
|
65
|
+
function videoPipSize(raw) {
|
|
66
|
+
return raw === "small" || raw === "large" ? raw : void 0;
|
|
67
|
+
}
|
|
68
|
+
function videoPipShape(raw) {
|
|
69
|
+
return raw === "square" || raw === "wide" ? raw : void 0;
|
|
70
|
+
}
|
|
71
|
+
function videoPipPosition(raw) {
|
|
72
|
+
return raw === "top-left" || raw === "top-right" || raw === "bottom-left" || raw === "bottom-right" ? raw : void 0;
|
|
73
|
+
}
|
|
74
|
+
function toMediaClip(parsed, id) {
|
|
75
|
+
const { template, params } = parsed;
|
|
76
|
+
if (!template || !MEDIA_TEMPLATES.has(template)) return null;
|
|
77
|
+
const src = params.src;
|
|
78
|
+
if (!src) return null;
|
|
79
|
+
const kind = template === "video" ? "video" : "audio";
|
|
80
|
+
const anchor = params.anchor === "document" || params.span === "document" ? "document" : "block";
|
|
81
|
+
const clip = {
|
|
82
|
+
id,
|
|
83
|
+
src,
|
|
84
|
+
kind,
|
|
85
|
+
startAt: time(params.startAt ?? params.startTime) ?? 0,
|
|
86
|
+
anchor
|
|
87
|
+
};
|
|
88
|
+
const placement = kind === "video" ? videoPlacement(params) : void 0;
|
|
89
|
+
if (placement && placement !== "content") clip.placement = placement;
|
|
90
|
+
const pipSize = videoPipSize(params.pipSize);
|
|
91
|
+
const pipShape = videoPipShape(params.pipShape);
|
|
92
|
+
const pipPosition = videoPipPosition(params.pipPosition);
|
|
93
|
+
if (pipSize) clip.pipSize = pipSize;
|
|
94
|
+
if (pipShape) clip.pipShape = pipShape;
|
|
95
|
+
if (pipPosition) clip.pipPosition = pipPosition;
|
|
96
|
+
if (kind === "video" && placement && placement !== "content" && params.lockToBlock != null) {
|
|
97
|
+
const locked = lockToBlock(params.lockToBlock);
|
|
98
|
+
clip.lockToBlock = locked;
|
|
99
|
+
clip.anchor = locked ? "block" : "document";
|
|
100
|
+
if (locked) clip.startAt = 0;
|
|
101
|
+
}
|
|
102
|
+
const clipStart = time(params.clipStart);
|
|
103
|
+
const clipEnd = time(params.clipEnd);
|
|
104
|
+
if (clipStart != null) clip.clipStart = clipStart;
|
|
105
|
+
if (clipEnd != null) clip.clipEnd = clipEnd;
|
|
106
|
+
if (clip.lockToBlock === true) delete clip.clipEnd;
|
|
107
|
+
if (params.spillover === "true" || params.spillover === "") clip.spillover = true;
|
|
108
|
+
const edits = parseMediaEdits(mediaEditValuesFromParams(params));
|
|
109
|
+
if (edits) clip.edits = edits;
|
|
110
|
+
return clip;
|
|
111
|
+
}
|
|
112
|
+
function firstVideoElement(children) {
|
|
113
|
+
const visit = (nodes) => {
|
|
114
|
+
for (const child of nodes) {
|
|
115
|
+
if (child.type !== "htmlElement") continue;
|
|
116
|
+
if (child.tagName === "video") return child;
|
|
117
|
+
const nested = visit(child.children);
|
|
118
|
+
if (nested) return nested;
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
};
|
|
122
|
+
return visit(children);
|
|
123
|
+
}
|
|
124
|
+
function standaloneHtmlVideo(node) {
|
|
125
|
+
if (node.type === "htmlBlock") {
|
|
126
|
+
if (!/^\s*<video\b/i.test(node.rawHtml)) return null;
|
|
127
|
+
const element = firstVideoElement(node.htmlChildren);
|
|
128
|
+
return element ? { element, raw: node.rawHtml.trim() } : null;
|
|
129
|
+
}
|
|
130
|
+
if (node.type !== "paragraph" || !node.children.every((child) => child.type === "htmlInline")) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
const raw = node.children.map((child) => child.type === "htmlInline" ? child.rawHtml : "").join("");
|
|
134
|
+
if (!/^\s*<video\b[\s\S]*<\/video>\s*$/i.test(raw)) return null;
|
|
135
|
+
for (const child of node.children) {
|
|
136
|
+
if (child.type !== "htmlInline") continue;
|
|
137
|
+
const element = firstVideoElement(child.htmlChildren);
|
|
138
|
+
if (element) return { element, raw: raw.trim() };
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
function isStandaloneHtmlVideo(node) {
|
|
143
|
+
return standaloneHtmlVideo(node) !== null;
|
|
144
|
+
}
|
|
145
|
+
function htmlVideoClip(node, id) {
|
|
146
|
+
const authored = standaloneHtmlVideo(node);
|
|
147
|
+
if (!authored) return null;
|
|
148
|
+
const { element } = authored;
|
|
149
|
+
const placement = videoPlacement({
|
|
150
|
+
placement: element.attributes["data-squisq-video-placement"] ?? ""
|
|
151
|
+
});
|
|
152
|
+
if (!placement || placement === "content") return null;
|
|
153
|
+
const src = element.attributes.src;
|
|
154
|
+
if (!src) return null;
|
|
155
|
+
const locked = lockToBlock(element.attributes["data-squisq-video-lock-to-block"]);
|
|
156
|
+
const clip = {
|
|
157
|
+
id,
|
|
158
|
+
src,
|
|
159
|
+
kind: "video",
|
|
160
|
+
placement,
|
|
161
|
+
lockToBlock: locked,
|
|
162
|
+
startAt: locked ? 0 : time(element.attributes["data-squisq-video-start-at"]) ?? 0,
|
|
163
|
+
anchor: locked ? "block" : "document"
|
|
164
|
+
};
|
|
165
|
+
const pipSize = videoPipSize(element.attributes["data-squisq-video-pip-size"]);
|
|
166
|
+
const pipShape = videoPipShape(element.attributes["data-squisq-video-pip-shape"]);
|
|
167
|
+
const pipPosition = videoPipPosition(element.attributes["data-squisq-video-pip-position"]);
|
|
168
|
+
if (pipSize) clip.pipSize = pipSize;
|
|
169
|
+
if (pipShape) clip.pipShape = pipShape;
|
|
170
|
+
if (pipPosition) clip.pipPosition = pipPosition;
|
|
171
|
+
const clipStart = time(element.attributes["data-squisq-video-clip-start"]);
|
|
172
|
+
const clipEnd = time(element.attributes["data-squisq-video-clip-end"]);
|
|
173
|
+
if (clipStart != null) clip.clipStart = clipStart;
|
|
174
|
+
if (!locked && clipEnd != null) clip.clipEnd = clipEnd;
|
|
175
|
+
const edits = parseMediaEdits(mediaEditValuesFromAttributes("video", element.attributes));
|
|
176
|
+
if (edits) clip.edits = edits;
|
|
177
|
+
return clip;
|
|
178
|
+
}
|
|
179
|
+
function extractMediaFromContents(contents, makeId, blockId) {
|
|
180
|
+
const media = [];
|
|
181
|
+
const documentMedia = [];
|
|
182
|
+
const remaining = [];
|
|
183
|
+
let index = 0;
|
|
184
|
+
let originalIndex = 0;
|
|
185
|
+
for (const node of contents ?? []) {
|
|
186
|
+
const parsed = parseStandaloneAnnotation(node);
|
|
187
|
+
const clip = parsed ? toMediaClip(parsed, "") : htmlVideoClip(node, "");
|
|
188
|
+
if (clip) {
|
|
189
|
+
clip.id = makeId(clip.src, index++);
|
|
190
|
+
const line = node.position?.start.line;
|
|
191
|
+
if (line != null) clip.sourceLine = line;
|
|
192
|
+
if (blockId !== void 0) {
|
|
193
|
+
const authoredHtml = standaloneHtmlVideo(node);
|
|
194
|
+
const rawText = node.type === "paragraph" && node.children?.[0]?.type === "text" ? node.children[0].value.trim() : authoredHtml?.raw;
|
|
195
|
+
clip.origin = {
|
|
196
|
+
blockId,
|
|
197
|
+
index: originalIndex,
|
|
198
|
+
...rawText !== void 0 ? { raw: rawText } : {},
|
|
199
|
+
...authoredHtml ? { format: "html" } : {}
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
(clip.anchor === "document" ? documentMedia : media).push(clip);
|
|
203
|
+
} else {
|
|
204
|
+
remaining.push(node);
|
|
205
|
+
}
|
|
206
|
+
originalIndex++;
|
|
207
|
+
}
|
|
208
|
+
return { media, documentMedia, remaining };
|
|
209
|
+
}
|
|
20
210
|
|
|
21
211
|
// src/doc/asciiDiagram/chars.ts
|
|
22
212
|
function toCells(s) {
|
|
@@ -2872,196 +3062,6 @@ function matchNumberHighlight(text) {
|
|
|
2872
3062
|
};
|
|
2873
3063
|
}
|
|
2874
3064
|
|
|
2875
|
-
// src/doc/standaloneAnnotation.ts
|
|
2876
|
-
function parseAnnotationInner(inner) {
|
|
2877
|
-
const tokens = tokenizeAttrTokens(inner.trim());
|
|
2878
|
-
const firstIsParam = tokens.length > 0 && tokens[0].indexOf("=") > 0;
|
|
2879
|
-
const template = firstIsParam || tokens.length === 0 ? void 0 : tokens[0];
|
|
2880
|
-
const startIdx = firstIsParam ? 0 : 1;
|
|
2881
|
-
const params = {};
|
|
2882
|
-
for (let i = startIdx; i < tokens.length; i++) {
|
|
2883
|
-
const kv = splitKeyValueToken(tokens[i]);
|
|
2884
|
-
if (kv) params[kv.key] = kv.value;
|
|
2885
|
-
}
|
|
2886
|
-
return { template, params };
|
|
2887
|
-
}
|
|
2888
|
-
function parseStandaloneAnnotation(node) {
|
|
2889
|
-
if (node.type !== "paragraph") return null;
|
|
2890
|
-
const children = node.children ?? [];
|
|
2891
|
-
if (children.length !== 1 || children[0].type !== "text") return null;
|
|
2892
|
-
const text = children[0].value.trim();
|
|
2893
|
-
const match = matchTrailingTemplateAnnotation(text);
|
|
2894
|
-
if (!match || match.index !== 0) return null;
|
|
2895
|
-
return parseAnnotationInner(match.inner);
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
// src/doc/mediaAnnotations.ts
|
|
2899
|
-
var MEDIA_TEMPLATES = /* @__PURE__ */ new Set(["audio", "video", "media"]);
|
|
2900
|
-
function isMediaAnnotationName(name) {
|
|
2901
|
-
return name != null && MEDIA_TEMPLATES.has(name);
|
|
2902
|
-
}
|
|
2903
|
-
function time(raw) {
|
|
2904
|
-
if (raw == null) return null;
|
|
2905
|
-
return parseTimeSeconds(raw);
|
|
2906
|
-
}
|
|
2907
|
-
function videoPlacement(params) {
|
|
2908
|
-
const explicit = params.placement ?? params.presentation;
|
|
2909
|
-
if (explicit === "content") return "content";
|
|
2910
|
-
if (explicit === "pip" || explicit === "picture-in-picture") return "picture-in-picture";
|
|
2911
|
-
if (explicit === "overlay" || explicit === "full-frame") return "overlay";
|
|
2912
|
-
if (params.pip === "" || params.pip === "true") return "picture-in-picture";
|
|
2913
|
-
if (params.overlay === "" || params.overlay === "true") return "overlay";
|
|
2914
|
-
return void 0;
|
|
2915
|
-
}
|
|
2916
|
-
function lockToBlock(raw) {
|
|
2917
|
-
return raw !== "false" && raw !== "0";
|
|
2918
|
-
}
|
|
2919
|
-
function videoPipSize(raw) {
|
|
2920
|
-
return raw === "small" || raw === "large" ? raw : void 0;
|
|
2921
|
-
}
|
|
2922
|
-
function videoPipShape(raw) {
|
|
2923
|
-
return raw === "square" || raw === "wide" ? raw : void 0;
|
|
2924
|
-
}
|
|
2925
|
-
function videoPipPosition(raw) {
|
|
2926
|
-
return raw === "top-left" || raw === "top-right" || raw === "bottom-left" || raw === "bottom-right" ? raw : void 0;
|
|
2927
|
-
}
|
|
2928
|
-
function toMediaClip(parsed, id) {
|
|
2929
|
-
const { template, params } = parsed;
|
|
2930
|
-
if (!template || !MEDIA_TEMPLATES.has(template)) return null;
|
|
2931
|
-
const src = params.src;
|
|
2932
|
-
if (!src) return null;
|
|
2933
|
-
const kind = template === "video" ? "video" : "audio";
|
|
2934
|
-
const anchor = params.anchor === "document" || params.span === "document" ? "document" : "block";
|
|
2935
|
-
const clip = {
|
|
2936
|
-
id,
|
|
2937
|
-
src,
|
|
2938
|
-
kind,
|
|
2939
|
-
startAt: time(params.startAt ?? params.startTime) ?? 0,
|
|
2940
|
-
anchor
|
|
2941
|
-
};
|
|
2942
|
-
const placement = kind === "video" ? videoPlacement(params) : void 0;
|
|
2943
|
-
if (placement && placement !== "content") clip.placement = placement;
|
|
2944
|
-
const pipSize = videoPipSize(params.pipSize);
|
|
2945
|
-
const pipShape = videoPipShape(params.pipShape);
|
|
2946
|
-
const pipPosition = videoPipPosition(params.pipPosition);
|
|
2947
|
-
if (pipSize) clip.pipSize = pipSize;
|
|
2948
|
-
if (pipShape) clip.pipShape = pipShape;
|
|
2949
|
-
if (pipPosition) clip.pipPosition = pipPosition;
|
|
2950
|
-
if (kind === "video" && placement && placement !== "content" && params.lockToBlock != null) {
|
|
2951
|
-
const locked = lockToBlock(params.lockToBlock);
|
|
2952
|
-
clip.lockToBlock = locked;
|
|
2953
|
-
clip.anchor = locked ? "block" : "document";
|
|
2954
|
-
if (locked) clip.startAt = 0;
|
|
2955
|
-
}
|
|
2956
|
-
const clipStart = time(params.clipStart);
|
|
2957
|
-
const clipEnd = time(params.clipEnd);
|
|
2958
|
-
if (clipStart != null) clip.clipStart = clipStart;
|
|
2959
|
-
if (clipEnd != null) clip.clipEnd = clipEnd;
|
|
2960
|
-
if (clip.lockToBlock === true) delete clip.clipEnd;
|
|
2961
|
-
if (params.spillover === "true" || params.spillover === "") clip.spillover = true;
|
|
2962
|
-
const edits = parseMediaEdits(mediaEditValuesFromParams(params));
|
|
2963
|
-
if (edits) clip.edits = edits;
|
|
2964
|
-
return clip;
|
|
2965
|
-
}
|
|
2966
|
-
function firstVideoElement(children) {
|
|
2967
|
-
const visit = (nodes) => {
|
|
2968
|
-
for (const child of nodes) {
|
|
2969
|
-
if (child.type !== "htmlElement") continue;
|
|
2970
|
-
if (child.tagName === "video") return child;
|
|
2971
|
-
const nested = visit(child.children);
|
|
2972
|
-
if (nested) return nested;
|
|
2973
|
-
}
|
|
2974
|
-
return null;
|
|
2975
|
-
};
|
|
2976
|
-
return visit(children);
|
|
2977
|
-
}
|
|
2978
|
-
function standaloneHtmlVideo(node) {
|
|
2979
|
-
if (node.type === "htmlBlock") {
|
|
2980
|
-
if (!/^\s*<video\b/i.test(node.rawHtml)) return null;
|
|
2981
|
-
const element = firstVideoElement(node.htmlChildren);
|
|
2982
|
-
return element ? { element, raw: node.rawHtml.trim() } : null;
|
|
2983
|
-
}
|
|
2984
|
-
if (node.type !== "paragraph" || !node.children.every((child) => child.type === "htmlInline")) {
|
|
2985
|
-
return null;
|
|
2986
|
-
}
|
|
2987
|
-
const raw = node.children.map((child) => child.type === "htmlInline" ? child.rawHtml : "").join("");
|
|
2988
|
-
if (!/^\s*<video\b[\s\S]*<\/video>\s*$/i.test(raw)) return null;
|
|
2989
|
-
for (const child of node.children) {
|
|
2990
|
-
if (child.type !== "htmlInline") continue;
|
|
2991
|
-
const element = firstVideoElement(child.htmlChildren);
|
|
2992
|
-
if (element) return { element, raw: raw.trim() };
|
|
2993
|
-
}
|
|
2994
|
-
return null;
|
|
2995
|
-
}
|
|
2996
|
-
function isStandaloneHtmlVideo(node) {
|
|
2997
|
-
return standaloneHtmlVideo(node) !== null;
|
|
2998
|
-
}
|
|
2999
|
-
function htmlVideoClip(node, id) {
|
|
3000
|
-
const authored = standaloneHtmlVideo(node);
|
|
3001
|
-
if (!authored) return null;
|
|
3002
|
-
const { element } = authored;
|
|
3003
|
-
const placement = videoPlacement({
|
|
3004
|
-
placement: element.attributes["data-squisq-video-placement"] ?? ""
|
|
3005
|
-
});
|
|
3006
|
-
if (!placement || placement === "content") return null;
|
|
3007
|
-
const src = element.attributes.src;
|
|
3008
|
-
if (!src) return null;
|
|
3009
|
-
const locked = lockToBlock(element.attributes["data-squisq-video-lock-to-block"]);
|
|
3010
|
-
const clip = {
|
|
3011
|
-
id,
|
|
3012
|
-
src,
|
|
3013
|
-
kind: "video",
|
|
3014
|
-
placement,
|
|
3015
|
-
lockToBlock: locked,
|
|
3016
|
-
startAt: locked ? 0 : time(element.attributes["data-squisq-video-start-at"]) ?? 0,
|
|
3017
|
-
anchor: locked ? "block" : "document"
|
|
3018
|
-
};
|
|
3019
|
-
const pipSize = videoPipSize(element.attributes["data-squisq-video-pip-size"]);
|
|
3020
|
-
const pipShape = videoPipShape(element.attributes["data-squisq-video-pip-shape"]);
|
|
3021
|
-
const pipPosition = videoPipPosition(element.attributes["data-squisq-video-pip-position"]);
|
|
3022
|
-
if (pipSize) clip.pipSize = pipSize;
|
|
3023
|
-
if (pipShape) clip.pipShape = pipShape;
|
|
3024
|
-
if (pipPosition) clip.pipPosition = pipPosition;
|
|
3025
|
-
const clipStart = time(element.attributes["data-squisq-video-clip-start"]);
|
|
3026
|
-
const clipEnd = time(element.attributes["data-squisq-video-clip-end"]);
|
|
3027
|
-
if (clipStart != null) clip.clipStart = clipStart;
|
|
3028
|
-
if (!locked && clipEnd != null) clip.clipEnd = clipEnd;
|
|
3029
|
-
const edits = parseMediaEdits(mediaEditValuesFromAttributes("video", element.attributes));
|
|
3030
|
-
if (edits) clip.edits = edits;
|
|
3031
|
-
return clip;
|
|
3032
|
-
}
|
|
3033
|
-
function extractMediaFromContents(contents, makeId, blockId) {
|
|
3034
|
-
const media = [];
|
|
3035
|
-
const documentMedia = [];
|
|
3036
|
-
const remaining = [];
|
|
3037
|
-
let index = 0;
|
|
3038
|
-
let originalIndex = 0;
|
|
3039
|
-
for (const node of contents ?? []) {
|
|
3040
|
-
const parsed = parseStandaloneAnnotation(node);
|
|
3041
|
-
const clip = parsed ? toMediaClip(parsed, "") : htmlVideoClip(node, "");
|
|
3042
|
-
if (clip) {
|
|
3043
|
-
clip.id = makeId(clip.src, index++);
|
|
3044
|
-
const line = node.position?.start.line;
|
|
3045
|
-
if (line != null) clip.sourceLine = line;
|
|
3046
|
-
if (blockId !== void 0) {
|
|
3047
|
-
const authoredHtml = standaloneHtmlVideo(node);
|
|
3048
|
-
const rawText = node.type === "paragraph" && node.children?.[0]?.type === "text" ? node.children[0].value.trim() : authoredHtml?.raw;
|
|
3049
|
-
clip.origin = {
|
|
3050
|
-
blockId,
|
|
3051
|
-
index: originalIndex,
|
|
3052
|
-
...rawText !== void 0 ? { raw: rawText } : {},
|
|
3053
|
-
...authoredHtml ? { format: "html" } : {}
|
|
3054
|
-
};
|
|
3055
|
-
}
|
|
3056
|
-
(clip.anchor === "document" ? documentMedia : media).push(clip);
|
|
3057
|
-
} else {
|
|
3058
|
-
remaining.push(node);
|
|
3059
|
-
}
|
|
3060
|
-
originalIndex++;
|
|
3061
|
-
}
|
|
3062
|
-
return { media, documentMedia, remaining };
|
|
3063
|
-
}
|
|
3064
|
-
|
|
3065
3065
|
// src/doc/templateInputs.ts
|
|
3066
3066
|
var VIDEO_FILE_RE = /\.(?:webm|mp4|mov|m4v|ogv)(?:[?#].*)?$/i;
|
|
3067
3067
|
var INLINE_MEDIA_TAG_RE = /^<\/?(?:video|audio|source|track)\b/i;
|
|
@@ -933,7 +933,6 @@ var VIDEO_EMBED_PROVIDERS = [
|
|
|
933
933
|
name: "Loom",
|
|
934
934
|
example: "https://www.loom.com/share/0281766fa2d04bb788eaf19e65135184"
|
|
935
935
|
},
|
|
936
|
-
{ id: "dailymotion", name: "Dailymotion", example: "https://www.dailymotion.com/video/x7tgad0" },
|
|
937
936
|
{ id: "wistia", name: "Wistia", example: "https://home.wistia.com/medias/e4a27b971d" }
|
|
938
937
|
];
|
|
939
938
|
var PROVIDER_NAMES = Object.fromEntries(
|
|
@@ -1121,33 +1120,6 @@ function parseLoom(url) {
|
|
|
1121
1120
|
watchUrl: `https://www.loom.com/share/${id}`
|
|
1122
1121
|
});
|
|
1123
1122
|
}
|
|
1124
|
-
var DAILYMOTION_ID_RE = /^[A-Za-z0-9]{5,20}$/;
|
|
1125
|
-
function parseDailymotion(url) {
|
|
1126
|
-
const host = baseHost(url);
|
|
1127
|
-
const segments = pathSegments(url);
|
|
1128
|
-
let raw = null;
|
|
1129
|
-
if (host === "dai.ly") raw = segments[0] ?? null;
|
|
1130
|
-
else if (host === "dailymotion.com") {
|
|
1131
|
-
if (segments[0] === "video") raw = segments[1] ?? null;
|
|
1132
|
-
else if (segments[0] === "embed" && segments[1] === "video") raw = segments[2] ?? null;
|
|
1133
|
-
else return null;
|
|
1134
|
-
} else if (host === "geo.dailymotion.com") {
|
|
1135
|
-
raw = url.searchParams.get("video");
|
|
1136
|
-
} else {
|
|
1137
|
-
return null;
|
|
1138
|
-
}
|
|
1139
|
-
const id = raw?.split("_")[0];
|
|
1140
|
-
if (!id || !DAILYMOTION_ID_RE.test(id)) return null;
|
|
1141
|
-
const startSeconds = parseVideoStartTime(url.searchParams.get("start"));
|
|
1142
|
-
const start = startSeconds ? String(startSeconds) : void 0;
|
|
1143
|
-
return build("dailymotion", {
|
|
1144
|
-
id,
|
|
1145
|
-
startSeconds,
|
|
1146
|
-
embedUrl: withQuery(`https://www.dailymotion.com/embed/video/${id}`, [["start", start]]),
|
|
1147
|
-
watchUrl: withQuery(`https://www.dailymotion.com/video/${id}`, [["start", start]]),
|
|
1148
|
-
thumbnailUrl: `https://www.dailymotion.com/thumbnail/video/${id}`
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
1123
|
var WISTIA_ID_RE = /^[a-z0-9]{10}$/;
|
|
1152
1124
|
var WISTIA_ACCOUNT_HOST_RE = /^[a-z0-9-]{1,63}\.wistia\.com$/;
|
|
1153
1125
|
function parseWistia(url) {
|
|
@@ -1175,7 +1147,6 @@ var PARSERS = [
|
|
|
1175
1147
|
parseYouTube,
|
|
1176
1148
|
parseVimeo,
|
|
1177
1149
|
parseLoom,
|
|
1178
|
-
parseDailymotion,
|
|
1179
1150
|
parseWistia
|
|
1180
1151
|
];
|
|
1181
1152
|
function parseVideoEmbedUrl(input) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-FTN6SGW5.js";
|
|
4
4
|
import {
|
|
5
5
|
applySavedPresentation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CS3MAZZX.js";
|
|
7
7
|
import {
|
|
8
8
|
SHAPE_NAMES,
|
|
9
9
|
buildChartData,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
templateRegistry,
|
|
32
32
|
writeCustomTemplatesToFrontmatter,
|
|
33
33
|
writeCustomThemesToFrontmatter
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5C6ZO5FV.js";
|
|
35
35
|
import {
|
|
36
36
|
ASCII_TREE_VOCAB,
|
|
37
37
|
ASCII_VOCAB,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
toCells,
|
|
55
55
|
toGrid,
|
|
56
56
|
traceBoxes
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-HGXZMB7K.js";
|
|
58
58
|
import {
|
|
59
59
|
iconMarker
|
|
60
60
|
} from "./chunk-7ZAAICW4.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
} from "./chunk-L7QZORLB.js";
|
|
88
88
|
import {
|
|
89
89
|
parseMarkdown
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-XDOSE5M3.js";
|
|
91
91
|
import {
|
|
92
92
|
TABLE_FED_TEMPLATES,
|
|
93
93
|
TEMPLATE_ALIASES,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
parseVideoEmbedUrl,
|
|
106
106
|
readFrontmatterThemeId,
|
|
107
107
|
serializeAnnotation
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-L3KSFLTP.js";
|
|
109
109
|
import {
|
|
110
110
|
BUILD_PARAM_KEYS,
|
|
111
111
|
buildSpecParams
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
parseMarkdown,
|
|
4
4
|
remarkWikiLinks,
|
|
5
5
|
toMdast
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XDOSE5M3.js";
|
|
7
7
|
import {
|
|
8
8
|
formatFrontmatterYaml,
|
|
9
9
|
getChildren,
|
|
10
10
|
splitFrontmatterBlock,
|
|
11
11
|
stringifyHtmlNodes,
|
|
12
12
|
walkMarkdownTree
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-L3KSFLTP.js";
|
|
14
14
|
|
|
15
15
|
// src/markdown/stringify.ts
|
|
16
16
|
import { unified } from "unified";
|