@bendyline/squisq 2.9.0 → 2.10.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-DBadkoP4.d.ts → Doc-DTyeaFuW.d.ts} +1 -1
- package/dist/{ImageEditDoc-Cq2a3c30.d.ts → ImageEditDoc-dFEclQ9l.d.ts} +1 -1
- package/dist/{annotationCoercion-CPHEggo3.d.ts → annotationCoercion-Ckqpu33y.d.ts} +1 -1
- package/dist/{chunk-W2GIFNLN.js → chunk-DRFJU4MK.js} +23 -1
- package/dist/{chunk-HXMV7WQB.js → chunk-IO5XO6XH.js} +1 -1
- package/dist/{chunk-6MVWWZHL.js → chunk-MIKKUKOD.js} +88 -2
- package/dist/{chunk-HEYR3TPL.js → chunk-NFHMHYUV.js} +107 -2
- package/dist/chunk-T3B4WJBR.js +167 -0
- package/dist/{chunk-KIAEJDZB.js → chunk-XSW4QTMB.js} +2 -2
- package/dist/doc/index.d.ts +7 -7
- package/dist/doc/index.js +3 -3
- 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 -7
- package/dist/index.js +43 -5
- package/dist/jsonForm/index.d.ts +2 -2
- package/dist/markdown/index.d.ts +3 -3
- package/dist/markdown/index.js +2 -2
- package/dist/{materializePageSection-Rss5thAj.d.ts → materializePageSection-BRNIINlU.d.ts} +2 -2
- package/dist/narration/index.d.ts +109 -4
- package/dist/narration/index.js +10 -2
- package/dist/proof/index.d.ts +179 -0
- package/dist/proof/index.js +32 -0
- package/dist/recommend/index.d.ts +1 -1
- package/dist/schemas/index.d.ts +5 -5
- package/dist/{themeLibrary-8BQMY2HV.d.ts → themeLibrary-xaxN5UYu.d.ts} +1 -1
- package/dist/transform/index.d.ts +3 -3
- package/dist/{types-CcrDFdWH.d.ts → types-Be6sBUBx.d.ts} +28 -2
- package/package.json +6 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a3 as Transition, a5 as TransitionType, M as MarkdownBlockNode, r as MarkdownHeading } from './types-Be6sBUBx.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Media-clip timing model.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ImageLayer, bf as TextLayer, b2 as ShapeLayer, aI as PathLayer } from './Doc-
|
|
1
|
+
import { $ as ImageLayer, bf as TextLayer, b2 as ShapeLayer, aI as PathLayer } from './Doc-DTyeaFuW.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ImageEditDoc — JSON document describing a layered, editable image.
|
|
@@ -1444,6 +1444,10 @@ function renderInlineHtml(nodes) {
|
|
|
1444
1444
|
return `<strong>${renderInlineHtml(node.children)}</strong>`;
|
|
1445
1445
|
case "delete":
|
|
1446
1446
|
return `<del>${renderInlineHtml(node.children)}</del>`;
|
|
1447
|
+
case "superscript":
|
|
1448
|
+
return `<sup>${renderInlineHtml(node.children)}</sup>`;
|
|
1449
|
+
case "subscript":
|
|
1450
|
+
return `<sub>${renderInlineHtml(node.children)}</sub>`;
|
|
1447
1451
|
case "inlineCode":
|
|
1448
1452
|
return `<code>${escapeInlineHtml(node.value)}</code>`;
|
|
1449
1453
|
case "link": {
|
|
@@ -7160,7 +7164,25 @@ var TEMPLATE_INPUT_DESCRIPTORS = {
|
|
|
7160
7164
|
// as unknown when supplied via a data fence's overriding params.
|
|
7161
7165
|
{ key: "rows", description: "Table rows (supply via a data fence)" },
|
|
7162
7166
|
{ key: "align", description: "Per-column alignment (supply via a data fence)" },
|
|
7163
|
-
{ key: "colorScheme", description: "Header color scheme", valueHint: COLOR_SCHEME_HINT }
|
|
7167
|
+
{ key: "colorScheme", description: "Header color scheme", valueHint: COLOR_SCHEME_HINT },
|
|
7168
|
+
// Spreadsheet provenance. These do not affect rendering — they record where
|
|
7169
|
+
// a table came from so `markdownDocToXlsx` can put it back at the right
|
|
7170
|
+
// address instead of piling every table at A1. Declared here for the same
|
|
7171
|
+
// reason `rows`/`align` are: so a round-tripped XLSX import doesn't light up
|
|
7172
|
+
// with `unknown-input` warnings.
|
|
7173
|
+
{ key: "sheet", description: "Source worksheet name (XLSX round-trip)" },
|
|
7174
|
+
{ key: "anchor", description: "Top-left cell of the region, e.g. 'B7'" },
|
|
7175
|
+
{
|
|
7176
|
+
key: "role",
|
|
7177
|
+
description: "What the table holds within its region",
|
|
7178
|
+
values: ["values", "formulas", "loose"]
|
|
7179
|
+
},
|
|
7180
|
+
{
|
|
7181
|
+
key: "headerRow",
|
|
7182
|
+
description: "Whether row 1 of the source region is a header row",
|
|
7183
|
+
coerce: "boolean"
|
|
7184
|
+
},
|
|
7185
|
+
{ key: "titleAnchor", description: "Cell this heading text was absorbed from" }
|
|
7164
7186
|
],
|
|
7165
7187
|
barChart: CHART_DESCRIPTORS([STACKED_DESCRIPTOR]),
|
|
7166
7188
|
columnChart: CHART_DESCRIPTORS([STACKED_DESCRIPTOR]),
|
|
@@ -259,7 +259,71 @@ function convertInlineChildren(children, parseHtml, applyIconSplit = true) {
|
|
|
259
259
|
if (node) result.push(node);
|
|
260
260
|
}
|
|
261
261
|
const mentioned = coalesceMentions(result);
|
|
262
|
-
|
|
262
|
+
const split = applyIconSplit ? splitInlineIcons(mentioned) : mentioned;
|
|
263
|
+
return foldPairedInlineHtml(split);
|
|
264
|
+
}
|
|
265
|
+
var PAIRED_INLINE_HTML = /* @__PURE__ */ new Map([
|
|
266
|
+
["sup", "superscript"],
|
|
267
|
+
["sub", "subscript"]
|
|
268
|
+
]);
|
|
269
|
+
function bareOpenTag(rawHtml) {
|
|
270
|
+
const m = /^<([a-zA-Z][a-zA-Z0-9]*)\s*>$/.exec(rawHtml);
|
|
271
|
+
return m ? m[1].toLowerCase() : null;
|
|
272
|
+
}
|
|
273
|
+
function bareCloseTag(rawHtml) {
|
|
274
|
+
const m = /^<\/([a-zA-Z][a-zA-Z0-9]*)\s*>$/.exec(rawHtml);
|
|
275
|
+
return m ? m[1].toLowerCase() : null;
|
|
276
|
+
}
|
|
277
|
+
function foldPairedInlineHtml(nodes) {
|
|
278
|
+
if (!nodes.some((n) => n.type === "htmlInline")) return nodes;
|
|
279
|
+
const root = [];
|
|
280
|
+
const stack = [];
|
|
281
|
+
const top = () => stack[stack.length - 1]?.children ?? root;
|
|
282
|
+
for (const node of nodes) {
|
|
283
|
+
if (node.type !== "htmlInline") {
|
|
284
|
+
top().push(node);
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
const open = bareOpenTag(node.rawHtml);
|
|
288
|
+
const foldType = open ? PAIRED_INLINE_HTML.get(open) : void 0;
|
|
289
|
+
if (open && foldType) {
|
|
290
|
+
stack.push({ tag: open, type: foldType, open: node, children: [] });
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
const close = bareCloseTag(node.rawHtml);
|
|
294
|
+
let closeIndex = -1;
|
|
295
|
+
if (close) {
|
|
296
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
297
|
+
if (stack[i].tag === close) {
|
|
298
|
+
closeIndex = i;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (close && closeIndex >= 0) {
|
|
304
|
+
while (stack.length - 1 > closeIndex) {
|
|
305
|
+
const orphan = stack.pop();
|
|
306
|
+
top().push(orphan.open, ...orphan.children);
|
|
307
|
+
}
|
|
308
|
+
const frame = stack.pop();
|
|
309
|
+
top().push({
|
|
310
|
+
type: frame.type,
|
|
311
|
+
children: frame.children,
|
|
312
|
+
...spanPosition(frame.open, node)
|
|
313
|
+
});
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
top().push(node);
|
|
317
|
+
}
|
|
318
|
+
while (stack.length > 0) {
|
|
319
|
+
const orphan = stack.pop();
|
|
320
|
+
top().push(orphan.open, ...orphan.children);
|
|
321
|
+
}
|
|
322
|
+
return root;
|
|
323
|
+
}
|
|
324
|
+
function spanPosition(open, close) {
|
|
325
|
+
if (!open.position || !close.position) return {};
|
|
326
|
+
return { position: { start: open.position.start, end: close.position.end } };
|
|
263
327
|
}
|
|
264
328
|
function splitInlineIcons(nodes) {
|
|
265
329
|
const recombined = recombineDirectiveTokens(nodes);
|
|
@@ -825,7 +889,12 @@ function tableCellToMdast(cell) {
|
|
|
825
889
|
function inlineChildrenToMdast(nodes) {
|
|
826
890
|
const out = [];
|
|
827
891
|
for (const n of nodes) {
|
|
828
|
-
if (n.type === "
|
|
892
|
+
if (n.type === "superscript" || n.type === "subscript") {
|
|
893
|
+
const tag = n.type === "superscript" ? "sup" : "sub";
|
|
894
|
+
out.push({ type: "html", value: `<${tag}>`, ...mdastPosField(n.position) });
|
|
895
|
+
out.push(...inlineChildrenToMdast(n.children));
|
|
896
|
+
out.push({ type: "html", value: `</${tag}>` });
|
|
897
|
+
} else if (n.type === "mention") {
|
|
829
898
|
out.push({ type: "text", value: "@" });
|
|
830
899
|
out.push({
|
|
831
900
|
type: "link",
|
|
@@ -944,6 +1013,13 @@ function inlineToMdast(node) {
|
|
|
944
1013
|
children: [{ type: "text", value: node.displayName }],
|
|
945
1014
|
...mdastPosField(node.position)
|
|
946
1015
|
};
|
|
1016
|
+
case "superscript":
|
|
1017
|
+
case "subscript":
|
|
1018
|
+
return {
|
|
1019
|
+
type: "text",
|
|
1020
|
+
value: inlineNodesToPlainText(node.children),
|
|
1021
|
+
...mdastPosField(node.position)
|
|
1022
|
+
};
|
|
947
1023
|
case "inlineIcon":
|
|
948
1024
|
return {
|
|
949
1025
|
type: "text",
|
|
@@ -954,6 +1030,16 @@ function inlineToMdast(node) {
|
|
|
954
1030
|
return { type: "text", value: "" };
|
|
955
1031
|
}
|
|
956
1032
|
}
|
|
1033
|
+
function inlineNodesToPlainText(nodes) {
|
|
1034
|
+
let out = "";
|
|
1035
|
+
for (const node of nodes) {
|
|
1036
|
+
if ("value" in node && typeof node.value === "string") out += node.value;
|
|
1037
|
+
else if ("children" in node && Array.isArray(node.children)) {
|
|
1038
|
+
out += inlineNodesToPlainText(node.children);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
return out;
|
|
1042
|
+
}
|
|
957
1043
|
function escapeHtmlText(value) {
|
|
958
1044
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
959
1045
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildNarrationScript,
|
|
2
3
|
expectedSyllablesAt,
|
|
4
|
+
flattenRenderableBlocks,
|
|
3
5
|
wordPosAtExpectedSyllables
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DRFJU4MK.js";
|
|
5
7
|
|
|
6
8
|
// src/narration/types.ts
|
|
7
9
|
var DEFAULT_FEATURE_CONFIG = Object.freeze({
|
|
@@ -872,6 +874,105 @@ function proportionalAlignment(script, effectiveDuration, takeDuration, c, detec
|
|
|
872
874
|
return { words, blocks, detectedSyllables, cost: 0 };
|
|
873
875
|
}
|
|
874
876
|
|
|
877
|
+
// src/narration/advanceTiming.ts
|
|
878
|
+
var EMPTY_ADVANCE_LOG = Object.freeze([]);
|
|
879
|
+
function recordSlideShown(log, blockId, atMs) {
|
|
880
|
+
if (!blockId || !Number.isFinite(atMs)) return log;
|
|
881
|
+
for (const entry of log) {
|
|
882
|
+
if (entry.blockId === blockId) return log;
|
|
883
|
+
}
|
|
884
|
+
const floor = log.length > 0 ? log[log.length - 1].atMs : 0;
|
|
885
|
+
return [...log, { blockId, atMs: Math.max(atMs, floor, 0) }];
|
|
886
|
+
}
|
|
887
|
+
function clampDuration(durationSec) {
|
|
888
|
+
return Number.isFinite(durationSec) && durationSec >= 0 ? durationSec : 0;
|
|
889
|
+
}
|
|
890
|
+
function firstShownSeconds(advances, knownIds, duration) {
|
|
891
|
+
const shown = /* @__PURE__ */ new Map();
|
|
892
|
+
let cursor = 0;
|
|
893
|
+
for (const advance of advances) {
|
|
894
|
+
if (!knownIds.has(advance.blockId) || shown.has(advance.blockId)) continue;
|
|
895
|
+
const raw = Number.isFinite(advance.atMs) ? advance.atMs / 1e3 : cursor;
|
|
896
|
+
const t = Math.min(duration, Math.max(cursor, raw));
|
|
897
|
+
shown.set(advance.blockId, t);
|
|
898
|
+
cursor = t;
|
|
899
|
+
}
|
|
900
|
+
const first = shown.keys().next();
|
|
901
|
+
if (!first.done) shown.set(first.value, 0);
|
|
902
|
+
return shown;
|
|
903
|
+
}
|
|
904
|
+
function buildAdvanceTimingJson(doc, advances, durationSec, options) {
|
|
905
|
+
const duration = clampDuration(durationSec);
|
|
906
|
+
const flat = flattenRenderableBlocks(doc.blocks);
|
|
907
|
+
const script = buildNarrationScript(doc, options?.script);
|
|
908
|
+
const scriptById = new Map(script.blocks.map((range) => [range.blockId, range]));
|
|
909
|
+
const shown = firstShownSeconds(advances, new Set(flat.map((block) => block.id)), duration);
|
|
910
|
+
const starts = new Array(flat.length);
|
|
911
|
+
let boundary = duration;
|
|
912
|
+
for (let i = flat.length - 1; i >= 0; i--) {
|
|
913
|
+
const at = shown.get(flat[i].id);
|
|
914
|
+
if (at !== void 0) {
|
|
915
|
+
starts[i] = at;
|
|
916
|
+
boundary = at;
|
|
917
|
+
} else {
|
|
918
|
+
starts[i] = boundary;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
const blocks = [];
|
|
922
|
+
let charCursor = 0;
|
|
923
|
+
for (let i = 0; i < flat.length; i++) {
|
|
924
|
+
const block = flat[i];
|
|
925
|
+
const range = scriptById.get(block.id);
|
|
926
|
+
const charStart = range ? range.charStart : charCursor;
|
|
927
|
+
const charEnd = range ? range.charEnd : charCursor;
|
|
928
|
+
charCursor = charEnd;
|
|
929
|
+
const startSec = starts[i];
|
|
930
|
+
const rawEnd = i + 1 < flat.length ? starts[i + 1] : duration;
|
|
931
|
+
blocks.push({
|
|
932
|
+
blockId: block.id,
|
|
933
|
+
...block.title ? { heading: block.title } : {},
|
|
934
|
+
blockIndex: i,
|
|
935
|
+
charStart,
|
|
936
|
+
charEnd,
|
|
937
|
+
startSec,
|
|
938
|
+
endSec: Math.max(startSec, Math.min(rawEnd, duration))
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
return {
|
|
942
|
+
version: 3,
|
|
943
|
+
sourceText: script.sourceText,
|
|
944
|
+
duration,
|
|
945
|
+
// No word-level timings exist on this path — the presenter gave us block
|
|
946
|
+
// boundaries, not speech. Bookmarks are documented as per-WORD, so filling
|
|
947
|
+
// them with block starts would misreport what was measured.
|
|
948
|
+
bookmarks: [],
|
|
949
|
+
blocks,
|
|
950
|
+
// `cameraOffsetSec` is deliberately omitted: a dual take already encodes
|
|
951
|
+
// its skew in the camera clip's `startAt`/`clipStart` attributes, and a
|
|
952
|
+
// second copy here invites a double correction.
|
|
953
|
+
generator: {
|
|
954
|
+
name: options?.generatorName ?? "squisq-recorder",
|
|
955
|
+
method: "presenter-advance"
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function advanceCoverage(doc, advances) {
|
|
960
|
+
const flat = flattenRenderableBlocks(doc.blocks);
|
|
961
|
+
const seen = new Set(advances.map((advance) => advance.blockId));
|
|
962
|
+
const unshownHeadings = [];
|
|
963
|
+
let shown = 0;
|
|
964
|
+
for (const block of flat) {
|
|
965
|
+
if (seen.has(block.id)) shown++;
|
|
966
|
+
else unshownHeadings.push(block.title || block.id);
|
|
967
|
+
}
|
|
968
|
+
return {
|
|
969
|
+
total: flat.length,
|
|
970
|
+
shown,
|
|
971
|
+
unshown: flat.length - shown,
|
|
972
|
+
unshownHeadings
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
|
|
875
976
|
export {
|
|
876
977
|
DEFAULT_FEATURE_CONFIG,
|
|
877
978
|
DEFAULT_VAD_CONFIG,
|
|
@@ -896,5 +997,9 @@ export {
|
|
|
896
997
|
reanchorSession,
|
|
897
998
|
traceWordPosAt,
|
|
898
999
|
downsampleTrace,
|
|
899
|
-
alignNarration
|
|
1000
|
+
alignNarration,
|
|
1001
|
+
EMPTY_ADVANCE_LOG,
|
|
1002
|
+
recordSlideShown,
|
|
1003
|
+
buildAdvanceTimingJson,
|
|
1004
|
+
advanceCoverage
|
|
900
1005
|
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// src/proof/types.ts
|
|
2
|
+
var PROOF_DIALECTS = Object.freeze([
|
|
3
|
+
"American",
|
|
4
|
+
"British",
|
|
5
|
+
"Australian",
|
|
6
|
+
"Canadian",
|
|
7
|
+
"Indian"
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
// src/proof/lintKinds.ts
|
|
11
|
+
var LINT_KIND_CATEGORIES = Object.freeze({
|
|
12
|
+
// Red — the word itself is wrong.
|
|
13
|
+
Spelling: "spelling",
|
|
14
|
+
Typo: "spelling",
|
|
15
|
+
// Green — the sentence is wrong; there is a definite fix.
|
|
16
|
+
Agreement: "grammar",
|
|
17
|
+
BoundaryError: "grammar",
|
|
18
|
+
Capitalization: "grammar",
|
|
19
|
+
Eggcorn: "grammar",
|
|
20
|
+
Grammar: "grammar",
|
|
21
|
+
Malapropism: "grammar",
|
|
22
|
+
Miscellaneous: "grammar",
|
|
23
|
+
Nonstandard: "grammar",
|
|
24
|
+
Punctuation: "grammar",
|
|
25
|
+
Repetition: "grammar",
|
|
26
|
+
Usage: "grammar",
|
|
27
|
+
WordChoice: "grammar",
|
|
28
|
+
WordOrder: "grammar",
|
|
29
|
+
// Blue — the text works but could read better.
|
|
30
|
+
Enhancement: "style",
|
|
31
|
+
Formatting: "style",
|
|
32
|
+
Readability: "style",
|
|
33
|
+
Redundancy: "style",
|
|
34
|
+
Regionalism: "style",
|
|
35
|
+
Style: "style"
|
|
36
|
+
});
|
|
37
|
+
function categorizeLintKind(kind) {
|
|
38
|
+
return LINT_KIND_CATEGORIES[kind] ?? "style";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/proof/masking.ts
|
|
42
|
+
var ANNOTATION_RE = /\{\[[^\n]*?\]\}/g;
|
|
43
|
+
function blankProtectedSpans(text) {
|
|
44
|
+
const blanked = [];
|
|
45
|
+
const out = text.replace(ANNOTATION_RE, (match, offset) => {
|
|
46
|
+
blanked.push({ start: offset, end: offset + match.length });
|
|
47
|
+
return " ".repeat(match.length);
|
|
48
|
+
});
|
|
49
|
+
return { text: out, blanked };
|
|
50
|
+
}
|
|
51
|
+
function dropMaskedFindings(findings, blanked) {
|
|
52
|
+
if (blanked.length === 0) return [...findings];
|
|
53
|
+
return findings.filter(
|
|
54
|
+
(finding) => !blanked.some((range) => finding.start < range.end && finding.end > range.start)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/proof/joining.ts
|
|
59
|
+
var PROOF_JOIN_SEPARATOR = "\n\n";
|
|
60
|
+
function buildJoinedText(segments) {
|
|
61
|
+
const starts = [];
|
|
62
|
+
const lengths = [];
|
|
63
|
+
let text = "";
|
|
64
|
+
for (const segment of segments) {
|
|
65
|
+
if (text.length > 0) text += PROOF_JOIN_SEPARATOR;
|
|
66
|
+
starts.push(text.length);
|
|
67
|
+
lengths.push(segment.length);
|
|
68
|
+
text += segment;
|
|
69
|
+
}
|
|
70
|
+
return { text, starts, lengths };
|
|
71
|
+
}
|
|
72
|
+
function mapJoinedSpanToSegment(joined, start, end) {
|
|
73
|
+
if (end <= start) return null;
|
|
74
|
+
const { starts, lengths } = joined;
|
|
75
|
+
let lo = 0;
|
|
76
|
+
let hi = starts.length - 1;
|
|
77
|
+
let index = -1;
|
|
78
|
+
while (lo <= hi) {
|
|
79
|
+
const mid = lo + hi >> 1;
|
|
80
|
+
if (starts[mid] <= start) {
|
|
81
|
+
index = mid;
|
|
82
|
+
lo = mid + 1;
|
|
83
|
+
} else {
|
|
84
|
+
hi = mid - 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (index < 0) return null;
|
|
88
|
+
const segmentStart = starts[index];
|
|
89
|
+
const segmentEnd = segmentStart + lengths[index];
|
|
90
|
+
if (start >= segmentEnd || end > segmentEnd) return null;
|
|
91
|
+
return { segmentIndex: index, start: start - segmentStart, end: end - segmentStart };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/proof/frontmatter.ts
|
|
95
|
+
var PROOF_FRONTMATTER_KEYS = Object.freeze({
|
|
96
|
+
enabled: { canonical: "squisq-proofing", legacy: "proofing" },
|
|
97
|
+
dialect: { canonical: "squisq-proof-dialect", legacy: "proof-dialect" },
|
|
98
|
+
dictionary: { canonical: "squisq-proof-dictionary", legacy: "proof-dictionary" }
|
|
99
|
+
});
|
|
100
|
+
var DEFAULT_PROOF_SETTINGS = Object.freeze({
|
|
101
|
+
enabled: true,
|
|
102
|
+
dialect: "American"
|
|
103
|
+
});
|
|
104
|
+
function readSetting(frontmatter, keys) {
|
|
105
|
+
if (!frontmatter) return void 0;
|
|
106
|
+
return Object.prototype.hasOwnProperty.call(frontmatter, keys.canonical) ? frontmatter[keys.canonical] : frontmatter[keys.legacy];
|
|
107
|
+
}
|
|
108
|
+
function resolveBoolean(value) {
|
|
109
|
+
if (typeof value === "boolean") return value;
|
|
110
|
+
if (typeof value !== "string") return void 0;
|
|
111
|
+
const normalized = value.trim().toLowerCase();
|
|
112
|
+
if (["true", "yes", "on"].includes(normalized)) return true;
|
|
113
|
+
if (["false", "no", "off"].includes(normalized)) return false;
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
function resolveProofDialect(value) {
|
|
117
|
+
if (typeof value !== "string") return void 0;
|
|
118
|
+
const normalized = value.trim().toLowerCase();
|
|
119
|
+
return PROOF_DIALECTS.find((dialect) => dialect.toLowerCase() === normalized);
|
|
120
|
+
}
|
|
121
|
+
function parseProofDictionary(value) {
|
|
122
|
+
const raw = [];
|
|
123
|
+
if (typeof value === "string") {
|
|
124
|
+
raw.push(...value.split(/[,\s]+/));
|
|
125
|
+
} else if (Array.isArray(value)) {
|
|
126
|
+
for (const entry of value) {
|
|
127
|
+
if (typeof entry === "string") raw.push(...entry.split(/[,\s]+/));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const seen = /* @__PURE__ */ new Set();
|
|
131
|
+
const words = [];
|
|
132
|
+
for (const candidate of raw) {
|
|
133
|
+
const word = candidate.trim();
|
|
134
|
+
if (word.length === 0 || seen.has(word)) continue;
|
|
135
|
+
seen.add(word);
|
|
136
|
+
words.push(word);
|
|
137
|
+
}
|
|
138
|
+
return words;
|
|
139
|
+
}
|
|
140
|
+
function formatProofDictionary(words) {
|
|
141
|
+
const deduped = parseProofDictionary([...words]);
|
|
142
|
+
return deduped.length > 0 ? deduped.join(", ") : null;
|
|
143
|
+
}
|
|
144
|
+
function readProofingSettings(frontmatter) {
|
|
145
|
+
return {
|
|
146
|
+
enabled: resolveBoolean(readSetting(frontmatter, PROOF_FRONTMATTER_KEYS.enabled)),
|
|
147
|
+
dialect: resolveProofDialect(readSetting(frontmatter, PROOF_FRONTMATTER_KEYS.dialect)),
|
|
148
|
+
dictionary: parseProofDictionary(readSetting(frontmatter, PROOF_FRONTMATTER_KEYS.dictionary))
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
PROOF_DIALECTS,
|
|
154
|
+
LINT_KIND_CATEGORIES,
|
|
155
|
+
categorizeLintKind,
|
|
156
|
+
blankProtectedSpans,
|
|
157
|
+
dropMaskedFindings,
|
|
158
|
+
PROOF_JOIN_SEPARATOR,
|
|
159
|
+
buildJoinedText,
|
|
160
|
+
mapJoinedSpanToSegment,
|
|
161
|
+
PROOF_FRONTMATTER_KEYS,
|
|
162
|
+
DEFAULT_PROOF_SETTINGS,
|
|
163
|
+
resolveProofDialect,
|
|
164
|
+
parseProofDictionary,
|
|
165
|
+
formatProofDictionary,
|
|
166
|
+
readProofingSettings
|
|
167
|
+
};
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
templateRegistry,
|
|
31
31
|
writeCustomTemplatesToFrontmatter,
|
|
32
32
|
writeCustomThemesToFrontmatter
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-DRFJU4MK.js";
|
|
34
34
|
import {
|
|
35
35
|
iconMarker
|
|
36
36
|
} from "./chunk-7ZAAICW4.js";
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
} from "./chunk-BAOV476U.js";
|
|
76
76
|
import {
|
|
77
77
|
parseMarkdown
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-MIKKUKOD.js";
|
|
79
79
|
import {
|
|
80
80
|
KNOWN_BLOCK_META_KEYS,
|
|
81
81
|
TEMPLATE_ALIASES,
|
package/dist/doc/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { bb as TemplateBlock, bc as TemplateContext, a3 as Layer, w as CustomTemplateDefinition, be as TemplateRegistry, bh as Theme, bL as ViewportConfig, aL as PersistentLayerConfig, P as DocBlock, bM as ViewportOrientation, aK as PersistentLayer, bu as TitleBlockInput, b0 as SectionHeaderInput, j as BigTextInput, u as ContentBlockInput, b6 as StatHighlightInput, aW as QuoteBlockInput, V as FactCardInput, bB as TwoColumnInput, H as DateEventInput, a1 as ImageWithCaptionInput, a6 as LeftFeatureInput, aZ as RightFeatureInput, aa as MapBlockInput, b5 as StartBlockConfig, Y as FullBleedQuoteInput, a9 as ListBlockInput, aP as PhotoGridInput, J as DefinitionCardInput, t as ComparisonBarInput, aV as PullQuoteInput, bK as VideoWithCaptionInput, bJ as VideoPullQuoteInput, G as DataTableInput, K as DiagramBlockInput, bw as TreeBlockInput, bq as TimelineBlockInput, k as Block, S as DrawingBlockInput, ae as MarkerStyle, A as AccentImage, a0 as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, bj as ThemeColorScheme, O as Doc, bl as ThemeRegistry, aD as PageEmphasis, bk as ThemePageStyle, Q as DocDiagnostic, N as DiagramTemplateNode, M as DiagramTemplateEdge, bt as TimelineTemplateTrack, bs as TimelineTemplateLink } from '../Doc-
|
|
2
|
-
export { T as FRONTMATTER_CUSTOM_TEMPLATES_KEY, U as FRONTMATTER_CUSTOM_THEMES_KEY, a5 as LayoutHints, aY as RenderStyle, bi as ThemeColorPalette, bo as ThemeStyle, bp as ThemeTypography, bC as VIEWPORT_PRESETS, bN as ViewportPreset, bS as createTemplateContext, bZ as getLayoutHints, c0 as getTwoColumnPositions, c1 as getViewport, c2 as getViewportOrientation, c5 as isTemplateBlock, c8 as scaledFontSize } from '../Doc-
|
|
3
|
-
import { L as MarkdownNode,
|
|
4
|
-
import { C as CoercedBlockMeta } from '../annotationCoercion-
|
|
5
|
-
import { c as PageSection } from '../materializePageSection-
|
|
6
|
-
export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, d as PageSectionDiagnostic, e as PageSectionItem, f as PageSectionMaterialization, g as PageSectionSource, h as PageSpatialKind, i as PageTransformHints, m as materializePageSection, j as materializePageSections, r as resolvePageStyle } from '../materializePageSection-
|
|
1
|
+
import { bb as TemplateBlock, bc as TemplateContext, a3 as Layer, w as CustomTemplateDefinition, be as TemplateRegistry, bh as Theme, bL as ViewportConfig, aL as PersistentLayerConfig, P as DocBlock, bM as ViewportOrientation, aK as PersistentLayer, bu as TitleBlockInput, b0 as SectionHeaderInput, j as BigTextInput, u as ContentBlockInput, b6 as StatHighlightInput, aW as QuoteBlockInput, V as FactCardInput, bB as TwoColumnInput, H as DateEventInput, a1 as ImageWithCaptionInput, a6 as LeftFeatureInput, aZ as RightFeatureInput, aa as MapBlockInput, b5 as StartBlockConfig, Y as FullBleedQuoteInput, a9 as ListBlockInput, aP as PhotoGridInput, J as DefinitionCardInput, t as ComparisonBarInput, aV as PullQuoteInput, bK as VideoWithCaptionInput, bJ as VideoPullQuoteInput, G as DataTableInput, K as DiagramBlockInput, bw as TreeBlockInput, bq as TimelineBlockInput, k as Block, S as DrawingBlockInput, ae as MarkerStyle, A as AccentImage, a0 as ImageTreatment, a as AccentPosition, c as Animation, d as AnimationType, bj as ThemeColorScheme, O as Doc, bl as ThemeRegistry, aD as PageEmphasis, bk as ThemePageStyle, Q as DocDiagnostic, N as DiagramTemplateNode, M as DiagramTemplateEdge, bt as TimelineTemplateTrack, bs as TimelineTemplateLink } from '../Doc-DTyeaFuW.js';
|
|
2
|
+
export { T as FRONTMATTER_CUSTOM_TEMPLATES_KEY, U as FRONTMATTER_CUSTOM_THEMES_KEY, a5 as LayoutHints, aY as RenderStyle, bi as ThemeColorPalette, bo as ThemeStyle, bp as ThemeTypography, bC as VIEWPORT_PRESETS, bN as ViewportPreset, bS as createTemplateContext, bZ as getLayoutHints, c0 as getTwoColumnPositions, c1 as getViewport, c2 as getViewportOrientation, c5 as isTemplateBlock, c8 as scaledFontSize } from '../Doc-DTyeaFuW.js';
|
|
3
|
+
import { L as MarkdownNode, a5 as TransitionType, a4 as TransitionDirection, M as MarkdownBlockNode, r as MarkdownHeading, n as MarkdownDocument, V as MarkdownTable, i as MarkdownCodeBlock, G as MarkdownList } from '../types-Be6sBUBx.js';
|
|
4
|
+
import { C as CoercedBlockMeta } from '../annotationCoercion-Ckqpu33y.js';
|
|
5
|
+
import { c as PageSection } from '../materializePageSection-BRNIINlU.js';
|
|
6
|
+
export { M as MaterializePageSectionOptions, a as MaterializePageSectionsOptions, P as PageMedia, b as PageRichText, d as PageSectionDiagnostic, e as PageSectionItem, f as PageSectionMaterialization, g as PageSectionSource, h as PageSpatialKind, i as PageTransformHints, m as materializePageSection, j as materializePageSections, r as resolvePageStyle } from '../materializePageSection-BRNIINlU.js';
|
|
7
7
|
import { C as ContentContainer } from '../ContentContainer-B2w9sUoL.js';
|
|
8
|
-
export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-
|
|
8
|
+
export { D as DEFAULT_THEME, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-xaxN5UYu.js';
|
|
9
9
|
|
|
10
10
|
/** Runtime registry composition for built-in and document-scoped templates. */
|
|
11
11
|
|
package/dist/doc/index.js
CHANGED
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
validateMarkdownDoc,
|
|
67
67
|
validateMarkdownSource,
|
|
68
68
|
writeDashboardLayoutsToFrontmatter
|
|
69
|
-
} from "../chunk-
|
|
69
|
+
} from "../chunk-XSW4QTMB.js";
|
|
70
70
|
import {
|
|
71
71
|
ASCII_CHAR_H,
|
|
72
72
|
ASCII_CHAR_W,
|
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
wrapWithPersistentLayers,
|
|
189
189
|
writeCustomTemplatesToFrontmatter,
|
|
190
190
|
writeCustomThemesToFrontmatter
|
|
191
|
-
} from "../chunk-
|
|
191
|
+
} from "../chunk-DRFJU4MK.js";
|
|
192
192
|
import {
|
|
193
193
|
PATH_SHAPE_KINDS,
|
|
194
194
|
anchorPoint,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
isTemplateBlock,
|
|
246
246
|
scaledFontSize2 as scaledFontSize
|
|
247
247
|
} from "../chunk-BAOV476U.js";
|
|
248
|
-
import "../chunk-
|
|
248
|
+
import "../chunk-MIKKUKOD.js";
|
|
249
249
|
import {
|
|
250
250
|
CONTAINER_TEMPLATES,
|
|
251
251
|
TABLE_FED_TEMPLATES,
|
package/dist/fence/index.d.ts
CHANGED
package/dist/generate/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as ExtractedElement } from '../contentExtractor-BNfVJV2U.js';
|
|
2
2
|
export { C as ComparisonData, D as DateData, a as DefinitionData, b as ExtractionOptions, c as ExtractionResult, d as ExtractionType, F as FactData, I as ImpactLineData, L as ListData, Q as QuoteData, S as StatData, e as extractContent, s as stripMarkdown } from '../contentExtractor-BNfVJV2U.js';
|
|
3
|
-
import { r as ColorScheme, A as AccentImage, bb as TemplateBlock } from '../Doc-
|
|
4
|
-
import '../types-
|
|
3
|
+
import { r as ColorScheme, A as AccentImage, bb as TemplateBlock } from '../Doc-DTyeaFuW.js';
|
|
4
|
+
import '../types-Be6sBUBx.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Template Mapper
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as ImageEditDoc, b as ImageEditLayer } from '../ImageEditDoc-
|
|
2
|
-
export { E as EditorLayerMeta, I as ImageEditCanvas, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-
|
|
1
|
+
import { a as ImageEditDoc, b as ImageEditLayer } from '../ImageEditDoc-dFEclQ9l.js';
|
|
2
|
+
export { E as EditorLayerMeta, I as ImageEditCanvas, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-dFEclQ9l.js';
|
|
3
3
|
import { C as ContentContainer } from '../ContentContainer-B2w9sUoL.js';
|
|
4
4
|
import { V as Version, C as CoalesceOptions, P as PrunePolicy } from '../types-8QjefM9J.js';
|
|
5
|
-
import '../Doc-
|
|
6
|
-
import '../types-
|
|
5
|
+
import '../Doc-DTyeaFuW.js';
|
|
6
|
+
import '../types-Be6sBUBx.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Pure helpers for constructing and mutating {@link ImageEditDoc} values.
|