@bendyline/squisq 2.9.0 → 2.11.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.
Files changed (39) hide show
  1. package/dist/{Doc-DBadkoP4.d.ts → Doc-CRPQCkHn.d.ts} +35 -3
  2. package/dist/{ImageEditDoc-Cq2a3c30.d.ts → ImageEditDoc-MbvJM1HE.d.ts} +1 -1
  3. package/dist/{annotationCoercion-CPHEggo3.d.ts → annotationCoercion-Ckqpu33y.d.ts} +1 -1
  4. package/dist/{chunk-HXMV7WQB.js → chunk-64I44JAP.js} +1 -1
  5. package/dist/{chunk-KIAEJDZB.js → chunk-EH4S7HXE.js} +193 -3
  6. package/dist/{chunk-7YEZFHLS.js → chunk-O7HLQ22N.js} +11 -0
  7. package/dist/chunk-T3B4WJBR.js +167 -0
  8. package/dist/{chunk-NBKAXPSX.js → chunk-TMOHAFYE.js} +1 -0
  9. package/dist/{chunk-6MVWWZHL.js → chunk-UBFT2CDQ.js} +117 -16
  10. package/dist/{chunk-FCG3BIZN.js → chunk-UNVHAK3A.js} +5 -1
  11. package/dist/{chunk-HEYR3TPL.js → chunk-ZWID3HM5.js} +107 -2
  12. package/dist/{chunk-W2GIFNLN.js → chunk-ZYCSRDSX.js} +374 -2
  13. package/dist/doc/index.d.ts +125 -8
  14. package/dist/doc/index.js +12 -4
  15. package/dist/fence/index.d.ts +2 -2
  16. package/dist/generate/index.d.ts +2 -2
  17. package/dist/imageEdit/index.d.ts +4 -4
  18. package/dist/index.d.ts +11 -9
  19. package/dist/index.js +58 -8
  20. package/dist/jsonForm/index.d.ts +2 -2
  21. package/dist/markdown/index.d.ts +3 -3
  22. package/dist/markdown/index.js +3 -3
  23. package/dist/{materializePageSection-Rss5thAj.d.ts → materializePageSection-BeUPHeCl.d.ts} +2 -2
  24. package/dist/narration/index.d.ts +109 -4
  25. package/dist/narration/index.js +11 -3
  26. package/dist/proof/index.d.ts +179 -0
  27. package/dist/proof/index.js +32 -0
  28. package/dist/recommend/index.d.ts +1 -1
  29. package/dist/schemas/index.d.ts +5 -5
  30. package/dist/storage/index.js +1 -1
  31. package/dist/table/index.d.ts +123 -0
  32. package/dist/table/index.js +298 -0
  33. package/dist/{themeLibrary-8BQMY2HV.d.ts → themeLibrary-BG3jr6mT.d.ts} +1 -1
  34. package/dist/transform/index.d.ts +3 -3
  35. package/dist/{types-CcrDFdWH.d.ts → types-Be6sBUBx.d.ts} +28 -2
  36. package/dist/versions/index.d.ts +15 -1
  37. package/dist/versions/index.js +5 -1
  38. package/dist/viewState-lTZS-hP_.d.ts +91 -0
  39. package/package.json +11 -1
@@ -1,5 +1,5 @@
1
- import { O as Doc, f as AudioBookmark } from '../Doc-DBadkoP4.js';
2
- import '../types-CcrDFdWH.js';
1
+ import { O as Doc, f as AudioBookmark } from '../Doc-CRPQCkHn.js';
2
+ import '../types-Be6sBUBx.js';
3
3
 
4
4
  /**
5
5
  * Shared types + tuning configs for the narration engine.
@@ -610,10 +610,19 @@ interface NarrationTimingJsonV3 {
610
610
  /** Provenance of the timing data. */
611
611
  generator?: {
612
612
  name: string;
613
- method: 'dsp-align';
613
+ method: NarrationTimingMethod;
614
614
  baseWpm?: number;
615
615
  };
616
616
  }
617
+ /**
618
+ * How a sidecar's block ranges were produced.
619
+ *
620
+ * - `'dsp-align'` — the teleprompter's offline banded-DTW aligner inferred
621
+ * them from the take's audio against the expected script.
622
+ * - `'presenter-advance'` — the presenter drove them directly, by advancing
623
+ * slides in the recorder while the take rolled. Observed, not inferred.
624
+ */
625
+ type NarrationTimingMethod = 'dsp-align' | 'presenter-advance';
617
626
  interface BuildNarrationTimingOptions {
618
627
  cameraOffsetSec?: number;
619
628
  baseWpm?: number;
@@ -628,4 +637,100 @@ declare function buildNarrationTimingJson(script: NarrationScript, alignment: Na
628
637
  */
629
638
  declare function parseNarrationTimingJson(data: ArrayBuffer | Uint8Array | string): NarrationTimingJsonV3 | null;
630
639
 
631
- export { type AlignConfig, type AlignInput, type BandpassState, type BuildNarrationTimingOptions, type BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, type FeatureConfig, type FeatureState, type FrameFeatures, type NarrationAlignment, type NarrationBlockRange, type NarrationScript, type NarrationSessionConfig, type NarrationSessionState, type NarrationTimingBlock, type NarrationTimingJsonV3, type NarrationTrace, type NucleiConfig, type NucleiState, type PacingConfig, type PacingState, type PacingTick, type ScriptBlockRange, type ScriptToken, type TraceSample, type VadConfig, type VadState, type WordTiming, alignNarration, bandpassRun, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables };
640
+ /**
641
+ * Presenter-advance block timings — the observed sibling of the DTW aligner.
642
+ *
643
+ * The teleprompter INFERS where each block began by matching the take's audio
644
+ * against the expected script (`alignNarration` → `deriveBlockRanges`). This
645
+ * module takes the other route: while a take rolls, the presenter advances
646
+ * slides themselves, and each first showing is stamped with take-relative
647
+ * time. Those observations ARE the block boundaries — nothing is inferred.
648
+ *
649
+ * The output is an ordinary {@link NarrationTimingJsonV3}, so the entire read
650
+ * path is unchanged: the recorder writes it to `<media>.timing.json`,
651
+ * `applyNarrationTiming` finds it through the doc-anchored clip, matches its
652
+ * entries to blocks (id → text similarity → order zip), and writes
653
+ * `block.startTime` / `block.duration`. Only `generator.method` distinguishes
654
+ * the two provenances.
655
+ *
656
+ * ## First-shown-only
657
+ *
658
+ * A revisit is a no-op ({@link recordSlideShown} returns its input). Block *k*
659
+ * therefore runs from its first showing until block *k+1*'s first showing —
660
+ * an excursion back to an earlier slide is billed to the slide the presenter
661
+ * was on. That is the direct consequence of "note the time a slide is first
662
+ * introduced", and it keeps the log monotonic, which every downstream
663
+ * consumer assumes.
664
+ *
665
+ * ## Blocks the presenter never showed
666
+ *
667
+ * They collapse to a ZERO-LENGTH range at the next shown block's start.
668
+ * `getBlockAtTime` selects on `time >= startTime && time < startTime +
669
+ * duration`, so a zero-length block is never on screen — it is skipped in
670
+ * playback, which is exactly what "never shown" means. Emitting them anyway
671
+ * (rather than omitting them) is what keeps the sidecar contiguous and
672
+ * complete: `applyNarrationTiming` places UNMATCHED doc blocks at its running
673
+ * cursor with their own reading-time duration, which would silently push
674
+ * every later block out of sync with the audio.
675
+ */
676
+
677
+ /** One block the presenter put on screen for the first time, in take-relative ms. */
678
+ interface SlideAdvance {
679
+ blockId: string;
680
+ atMs: number;
681
+ }
682
+ /**
683
+ * An ordered, first-shown-only advance log. Invariants, maintained by
684
+ * {@link recordSlideShown}: each `blockId` appears at most once, and `atMs` is
685
+ * non-decreasing.
686
+ */
687
+ type SlideAdvanceLog = readonly SlideAdvance[];
688
+ declare const EMPTY_ADVANCE_LOG: SlideAdvanceLog;
689
+ /**
690
+ * Append a first showing.
691
+ *
692
+ * Returns the SAME reference — not a copy — when the block is already logged
693
+ * (the presenter went backwards) or the stamp is unusable. Reference stability
694
+ * is what makes this safe to call from a React state updater: a no-op advance
695
+ * cannot trigger a re-render.
696
+ *
697
+ * `atMs` is clamped to at least the previous entry's, so a non-monotonic wall
698
+ * clock (an NTP step mid-take) can never produce a decreasing log.
699
+ */
700
+ declare function recordSlideShown(log: SlideAdvanceLog, blockId: string, atMs: number): SlideAdvanceLog;
701
+ interface BuildAdvanceTimingOptions {
702
+ /**
703
+ * Forwarded to `buildNarrationScript`. Must match whatever produced the
704
+ * script the sidecar's `sourceText` will be compared against.
705
+ */
706
+ script?: BuildScriptOptions;
707
+ /** `generator.name` written into provenance. Defaults to `'squisq-recorder'`. */
708
+ generatorName?: string;
709
+ }
710
+ /**
711
+ * Build a v3 timing sidecar from observed slide advances.
712
+ *
713
+ * Takes the `doc` rather than a prebuilt script on purpose: the payload needs
714
+ * BOTH `flattenRenderableBlocks` (the authoritative block list — the script
715
+ * skips blocks with no spoken text) and `buildNarrationScript` (`sourceText`
716
+ * plus the char ranges that make matching survive an id change). Deriving both
717
+ * here is what guarantees they cannot disagree.
718
+ *
719
+ * Pure — no clock, no I/O.
720
+ */
721
+ declare function buildAdvanceTimingJson(doc: Doc, advances: SlideAdvanceLog, durationSec: number, options?: BuildAdvanceTimingOptions): NarrationTimingJsonV3;
722
+ /** How much of the deck the presenter actually got through. */
723
+ interface AdvanceCoverage {
724
+ /** Renderable blocks in the doc. */
725
+ total: number;
726
+ /** Blocks shown at least once during the take. */
727
+ shown: number;
728
+ /** Blocks never shown — they save as zero-length and are skipped in playback. */
729
+ unshown: number;
730
+ /** Headings of the unshown blocks, in document order, for user-facing copy. */
731
+ unshownHeadings: string[];
732
+ }
733
+ /** Summarize an advance log against a doc. Pure; drives the review-panel warning. */
734
+ declare function advanceCoverage(doc: Doc, advances: SlideAdvanceLog): AdvanceCoverage;
735
+
736
+ export { type AdvanceCoverage, type AlignConfig, type AlignInput, type BandpassState, type BuildAdvanceTimingOptions, type BuildNarrationTimingOptions, type BuildScriptOptions, DEFAULT_ALIGN_CONFIG, DEFAULT_FEATURE_CONFIG, DEFAULT_NUCLEI_CONFIG, DEFAULT_PACING_CONFIG, DEFAULT_VAD_CONFIG, EMPTY_ADVANCE_LOG, type FeatureConfig, type FeatureState, type FrameFeatures, type NarrationAlignment, type NarrationBlockRange, type NarrationScript, type NarrationSessionConfig, type NarrationSessionState, type NarrationTimingBlock, type NarrationTimingJsonV3, type NarrationTimingMethod, type NarrationTrace, type NucleiConfig, type NucleiState, type PacingConfig, type PacingState, type PacingTick, type ScriptBlockRange, type ScriptToken, type SlideAdvance, type SlideAdvanceLog, type TraceSample, type VadConfig, type VadState, type WordTiming, advanceCoverage, alignNarration, bandpassRun, buildAdvanceTimingJson, buildNarrationScript, buildNarrationTimingJson, createBandpass, createFeatureState, createNarrationSession, createNucleiState, createPacingState, createVadState, detectSyllableOnsets, downsampleTrace, estimateSyllables, expectedSyllablesAt, extractFrameFeatures, featureStep, narrationSessionStep, nucleiStep, pacingStep, parseNarrationTimingJson, reanchorPacing, reanchorSession, recordSlideShown, traceWordPosAt, vadStep, wordIndexAtChar, wordIndexAtTime, wordPosAtExpectedSyllables };
@@ -4,8 +4,11 @@ import {
4
4
  DEFAULT_NUCLEI_CONFIG,
5
5
  DEFAULT_PACING_CONFIG,
6
6
  DEFAULT_VAD_CONFIG,
7
+ EMPTY_ADVANCE_LOG,
8
+ advanceCoverage,
7
9
  alignNarration,
8
10
  bandpassRun,
11
+ buildAdvanceTimingJson,
9
12
  createBandpass,
10
13
  createFeatureState,
11
14
  createNarrationSession,
@@ -21,9 +24,10 @@ import {
21
24
  pacingStep,
22
25
  reanchorPacing,
23
26
  reanchorSession,
27
+ recordSlideShown,
24
28
  traceWordPosAt,
25
29
  vadStep
26
- } from "../chunk-HEYR3TPL.js";
30
+ } from "../chunk-ZWID3HM5.js";
27
31
  import {
28
32
  buildNarrationScript,
29
33
  buildNarrationTimingJson,
@@ -33,12 +37,12 @@ import {
33
37
  wordIndexAtChar,
34
38
  wordIndexAtTime,
35
39
  wordPosAtExpectedSyllables
36
- } from "../chunk-W2GIFNLN.js";
40
+ } from "../chunk-ZYCSRDSX.js";
37
41
  import "../chunk-PUS54YU6.js";
38
42
  import "../chunk-CUYHFOFL.js";
39
43
  import "../chunk-SBAX4ZPO.js";
40
44
  import "../chunk-BAOV476U.js";
41
- import "../chunk-NBKAXPSX.js";
45
+ import "../chunk-TMOHAFYE.js";
42
46
  import "../chunk-O7JILDEF.js";
43
47
  import "../chunk-4VOD55SX.js";
44
48
  import "../chunk-XOFT65EX.js";
@@ -50,8 +54,11 @@ export {
50
54
  DEFAULT_NUCLEI_CONFIG,
51
55
  DEFAULT_PACING_CONFIG,
52
56
  DEFAULT_VAD_CONFIG,
57
+ EMPTY_ADVANCE_LOG,
58
+ advanceCoverage,
53
59
  alignNarration,
54
60
  bandpassRun,
61
+ buildAdvanceTimingJson,
55
62
  buildNarrationScript,
56
63
  buildNarrationTimingJson,
57
64
  createBandpass,
@@ -72,6 +79,7 @@ export {
72
79
  parseNarrationTimingJson,
73
80
  reanchorPacing,
74
81
  reanchorSession,
82
+ recordSlideShown,
75
83
  traceWordPosAt,
76
84
  vadStep,
77
85
  wordIndexAtChar,
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Plain-data types for the proofing (grammar + spellcheck) pipeline.
3
+ *
4
+ * These types are engine-agnostic: an editor host adapts a concrete
5
+ * engine (harper.js, a service, a test fake) to produce `ProofFinding`s,
6
+ * while this module stays pure and dependency-free so the mapping and
7
+ * masking helpers can run in Node tests and any consumer bundle.
8
+ */
9
+ /** Severity/color tier of a finding: red, green, or blue squiggle. */
10
+ type ProofCategory = 'spelling' | 'grammar' | 'style';
11
+ /** How a suggestion is applied relative to the finding's span. */
12
+ type ProofSuggestionKind = 'replace' | 'remove' | 'insertAfter';
13
+ /** One candidate fix for a finding. */
14
+ interface ProofSuggestion {
15
+ /** Replacement/insertion text (empty for `remove`). */
16
+ text: string;
17
+ kind: ProofSuggestionKind;
18
+ }
19
+ /** A half-open `[start, end)` range in UTF-16 code units. */
20
+ interface ProofRange {
21
+ start: number;
22
+ end: number;
23
+ }
24
+ /**
25
+ * One issue found in a linted text. Offsets index into the exact string
26
+ * that was linted (UTF-16 code units — the same coordinate space as
27
+ * ProseMirror, Monaco, and DOM Range).
28
+ */
29
+ interface ProofFinding extends ProofRange {
30
+ /** Stable within one lint pass; the provider maps id → engine handle. */
31
+ id: string;
32
+ category: ProofCategory;
33
+ /** Raw engine kind (e.g. `Typo`), for diagnostics and future filtering. */
34
+ kind: string;
35
+ /** Human-readable description of the issue. */
36
+ message: string;
37
+ /** Text at `[start, end)` when linted — staleness check before applying. */
38
+ originalText: string;
39
+ suggestions: ProofSuggestion[];
40
+ }
41
+ /** English dialects supported by the proofing engine. */
42
+ type ProofDialect = 'American' | 'British' | 'Australian' | 'Canadian' | 'Indian';
43
+ /** All supported dialects, in display order. */
44
+ declare const PROOF_DIALECTS: readonly ProofDialect[];
45
+
46
+ /**
47
+ * Mapping from harper's `LintKind` vocabulary to squisq's three proofing
48
+ * tiers. The keys pin the full 21-kind union of harper.js 2.7.0; a unit
49
+ * test asserts the map stays in sync with the installed engine so an
50
+ * upgrade that adds a kind is caught at review time rather than falling
51
+ * through silently. Unknown kinds degrade to `style` (the least alarming
52
+ * tier) instead of throwing.
53
+ */
54
+
55
+ /** harper `LintKind` → squisq tier. Spelling = red, grammar = green, style = blue. */
56
+ declare const LINT_KIND_CATEGORIES: Readonly<Record<string, ProofCategory>>;
57
+ /**
58
+ * Categorize a raw engine kind. Kinds this build doesn't know (added by a
59
+ * future harper release) fall back to `style` so they render as the least
60
+ * alarming squiggle rather than breaking the pass.
61
+ */
62
+ declare function categorizeLintKind(kind: string): ProofCategory;
63
+
64
+ /**
65
+ * Protected-span masking for proofing.
66
+ *
67
+ * Squisq markdown carries `{[…]}` annotations (block templates, inline
68
+ * icons, media directives) whose contents are machine vocabulary, not
69
+ * prose — a grammar engine flags `src`/`webm`/template ids as spelling
70
+ * errors. The engine's own masking option is unusable (inclusion-mask
71
+ * semantics and silent failure on an invalid pattern), so we blank the
72
+ * spans ourselves: replace each annotation with an equal-length run of
73
+ * spaces — every surrounding offset stays byte-identical — and afterwards
74
+ * drop any finding that intersects a blanked range (which also swallows
75
+ * the whitespace-formatting lints the blank runs themselves can induce).
76
+ */
77
+
78
+ interface BlankedText {
79
+ /** Input with every protected span replaced by spaces; same length. */
80
+ text: string;
81
+ /** The replaced ranges, in ascending order. */
82
+ blanked: ProofRange[];
83
+ }
84
+ /** Blank `{[…]}` annotation spans to equal-length spaces. */
85
+ declare function blankProtectedSpans(text: string): BlankedText;
86
+ /** Keep only findings whose span does not intersect any blanked range. */
87
+ declare function dropMaskedFindings<T extends ProofRange>(findings: readonly T[], blanked: readonly ProofRange[]): T[];
88
+
89
+ /**
90
+ * Joined-segment linting.
91
+ *
92
+ * The Write view lints many textblocks (paragraphs, headings, list
93
+ * items, table cells) in ONE engine call by joining their texts with a
94
+ * blank-line separator: one RPC per pass instead of one per block, and —
95
+ * measured — the engine treats each segment as its own paragraph while
96
+ * still using sentence context (`Its` → `It's` fires only with context).
97
+ * Findings come back in the joined coordinate space and are mapped back
98
+ * to their segment; a span that touches a separator or crosses segments
99
+ * is dropped rather than guessed at.
100
+ */
101
+
102
+ /** Separator between joined segments — a paragraph boundary to the engine. */
103
+ declare const PROOF_JOIN_SEPARATOR = "\n\n";
104
+ interface JoinedSegments {
105
+ /** All segments joined with {@link PROOF_JOIN_SEPARATOR}. */
106
+ text: string;
107
+ /** Start offset of each segment within `text`, ascending. */
108
+ starts: number[];
109
+ /** Length of each segment. */
110
+ lengths: number[];
111
+ }
112
+ /** Join segment texts, recording where each lands in the joined string. */
113
+ declare function buildJoinedText(segments: readonly string[]): JoinedSegments;
114
+ interface SegmentSpan extends ProofRange {
115
+ /** Index into the segment list handed to {@link buildJoinedText}. */
116
+ segmentIndex: number;
117
+ }
118
+ /**
119
+ * Map a `[start, end)` span in the joined text back to segment-local
120
+ * coordinates. Returns `null` for an empty span, a span outside every
121
+ * segment, or one that touches a separator / crosses segments.
122
+ */
123
+ declare function mapJoinedSpanToSegment(joined: JoinedSegments, start: number, end: number): SegmentSpan | null;
124
+
125
+ /**
126
+ * Doc-level proofing settings, persisted in frontmatter — the proofing
127
+ * analog of `coverSlideSettings`. Three keys:
128
+ *
129
+ * - `squisq-proofing` — per-doc enable override (boolean)
130
+ * - `squisq-proof-dialect` — English dialect for this doc
131
+ * - `squisq-proof-dictionary` — comma-separated accepted words
132
+ *
133
+ * Deliberately NOT here: ignored findings. Dismissing a finding is a
134
+ * personal preference about one person's editing session, not document
135
+ * content — it would otherwise land in everyone's copy through git. The
136
+ * editor hands that state to the host instead, scoped per document
137
+ * (`ProofingIgnoreStore` in `@bendyline/squisq-editor-react/proofing`).
138
+ */
139
+
140
+ /** Frontmatter keys (canonical `squisq-*` plus tolerated bare spellings). */
141
+ declare const PROOF_FRONTMATTER_KEYS: Readonly<{
142
+ enabled: {
143
+ canonical: string;
144
+ legacy: string;
145
+ };
146
+ dialect: {
147
+ canonical: string;
148
+ legacy: string;
149
+ };
150
+ dictionary: {
151
+ canonical: string;
152
+ legacy: string;
153
+ };
154
+ }>;
155
+ interface ProofingSettings {
156
+ /** Per-doc enable override; `undefined` = defer to the host default. */
157
+ enabled?: boolean;
158
+ /** Dialect override; `undefined` = provider/config default. */
159
+ dialect?: ProofDialect;
160
+ /** Doc-local accepted words (always an array; empty when unset). */
161
+ dictionary: string[];
162
+ }
163
+ declare const DEFAULT_PROOF_SETTINGS: Readonly<{
164
+ enabled: true;
165
+ dialect: ProofDialect;
166
+ }>;
167
+ /** Resolve a dialect value case-insensitively; `undefined` when unrecognized. */
168
+ declare function resolveProofDialect(value: unknown): ProofDialect | undefined;
169
+ /**
170
+ * Parse a dictionary value into a word list. Accepts the canonical
171
+ * comma-separated string plus (defensively) a parsed YAML list.
172
+ */
173
+ declare function parseProofDictionary(value: unknown): string[];
174
+ /** Encode a dictionary for frontmatter; `null` (remove the key) when empty. */
175
+ declare function formatProofDictionary(words: readonly string[]): string | null;
176
+ /** Read all proofing settings from a parsed frontmatter record. */
177
+ declare function readProofingSettings(frontmatter: Record<string, unknown> | undefined): ProofingSettings;
178
+
179
+ export { type BlankedText, DEFAULT_PROOF_SETTINGS, type JoinedSegments, LINT_KIND_CATEGORIES, PROOF_DIALECTS, PROOF_FRONTMATTER_KEYS, PROOF_JOIN_SEPARATOR, type ProofCategory, type ProofDialect, type ProofFinding, type ProofRange, type ProofSuggestion, type ProofSuggestionKind, type ProofingSettings, type SegmentSpan, blankProtectedSpans, buildJoinedText, categorizeLintKind, dropMaskedFindings, formatProofDictionary, mapJoinedSpanToSegment, parseProofDictionary, readProofingSettings, resolveProofDialect };
@@ -0,0 +1,32 @@
1
+ import {
2
+ DEFAULT_PROOF_SETTINGS,
3
+ LINT_KIND_CATEGORIES,
4
+ PROOF_DIALECTS,
5
+ PROOF_FRONTMATTER_KEYS,
6
+ PROOF_JOIN_SEPARATOR,
7
+ blankProtectedSpans,
8
+ buildJoinedText,
9
+ categorizeLintKind,
10
+ dropMaskedFindings,
11
+ formatProofDictionary,
12
+ mapJoinedSpanToSegment,
13
+ parseProofDictionary,
14
+ readProofingSettings,
15
+ resolveProofDialect
16
+ } from "../chunk-T3B4WJBR.js";
17
+ export {
18
+ DEFAULT_PROOF_SETTINGS,
19
+ LINT_KIND_CATEGORIES,
20
+ PROOF_DIALECTS,
21
+ PROOF_FRONTMATTER_KEYS,
22
+ PROOF_JOIN_SEPARATOR,
23
+ blankProtectedSpans,
24
+ buildJoinedText,
25
+ categorizeLintKind,
26
+ dropMaskedFindings,
27
+ formatProofDictionary,
28
+ mapJoinedSpanToSegment,
29
+ parseProofDictionary,
30
+ readProofingSettings,
31
+ resolveProofDialect
32
+ };
@@ -1,4 +1,4 @@
1
- import { M as MarkdownBlockNode } from '../types-CcrDFdWH.js';
1
+ import { M as MarkdownBlockNode } from '../types-Be6sBUBx.js';
2
2
 
3
3
  /**
4
4
  * Block template recommendations.
@@ -1,10 +1,10 @@
1
1
  export { B as BoundingBox, C as Coordinates } from '../Types-sh2VRxfo.js';
2
- import { O as Doc, bh as Theme, bk as ThemePageStyle, bj as ThemeColorScheme, I as DeepPartial, bn as ThemeSeedColors, bi as ThemeColorPalette, X as FontFamilyKind, W as FontFamily } from '../Doc-DBadkoP4.js';
3
- export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, C as CaptionPhrase, n as CaptionTrack, o as CaptionWord, p as ChartBaseFields, q as ChartTemplateInput, r as ColorScheme, s as ColumnChartInput, t as ComparisonBarInput, u as ContentBlockInput, v as CornerBrandingConfig, w as CustomTemplateDefinition, x as CustomTemplateLayer, y as CustomTemplateValidationError, z as CustomTemplateValidationResult, D as DARK_SURFACE, E as DEFAULT_DOC_FONT, F as DEFAULT_TITLE_FONT, G as DataTableInput, H as DateEventInput, J as DefinitionCardInput, K as DiagramBlockInput, L as DiagramEdgeAnchor, M as DiagramTemplateEdge, N as DiagramTemplateNode, P as DocBlock, Q as DocDiagnostic, R as DonutChartInput, S as DrawingBlockInput, T as FRONTMATTER_CUSTOM_TEMPLATES_KEY, U as FRONTMATTER_CUSTOM_THEMES_KEY, V as FactCardInput, Y as FullBleedQuoteInput, Z as GradientBackgroundConfig, _ as ImageBackgroundConfig, $ as ImageLayer, a0 as ImageTreatment, a1 as ImageWithCaptionInput, a2 as LIGHT_SURFACE, a3 as Layer, a4 as LayerRepeat, a5 as LayoutHints, a6 as LeftFeatureInput, a7 as LineChartInput, a8 as LinearGradient, a9 as ListBlockInput, aa as MapBlockInput, ab as MapLayer, ac as MapMarker, ad as MapTileStyle, ae as MarkerStyle, af as MediaClip, ag as MediaScheduleOptions, ah as MermaidLayer, ai as PAGE_ACCENT_STRATEGIES, aj as PAGE_BACKGROUNDS, ak as PAGE_BACKGROUND_RHYTHMS, al as PAGE_DESIGN_FAMILIES, am as PAGE_DIVIDERS, an as PAGE_EMPHASES, ao as PAGE_EYEBROWS, ap as PAGE_HEADING_CASES, aq as PAGE_HEADING_SCALES, ar as PAGE_HEADING_UNDERLINES, as as PAGE_HERO_STYLES, at as PAGE_IMAGE_FRAMINGS, au as PAGE_NUMERAL_STYLES, av as PAGE_PATTERNS, aw as PAGE_QUOTE_MARKS, ax as PAGE_SECTION_KINDS, ay as PAGE_SECTION_SPACINGS, az as PAGE_SHADOWS, aA as PageAccentRotation, aB as PageBackground, aC as PageDesignFamily, aD as PageEmphasis, aE as PageHeadingTreatment, aF as PageSectionKind, aG as PageSectionOverride, aH as PageTokens, aI as PathLayer, aJ as PatternBackgroundConfig, aK as PersistentLayer, aL as PersistentLayerConfig, aM as PersistentLayerTemplate, aN as PersistentLayerTemplateConfig, aO as PersistentLayerTemplateType, aP as PhotoGridInput, aQ as PieChartInput, aR as PipStyle, aS as Position, aT as ProgressIndicatorConfig, aU as PromotedBodyAnnotation, aV as PullQuoteInput, aW as QuoteBlockInput, aX as RawLayersInput, aY as RenderStyle, aZ as RightFeatureInput, a_ as ScatterChartInput, a$ as ScheduledClip, b0 as SectionHeaderInput, b1 as ShapeFilter, b2 as ShapeLayer, b3 as ShapePattern, b4 as SolidBackgroundConfig, b5 as StartBlockConfig, b6 as StatHighlightInput, b7 as SurfaceScheme, b8 as THEME_SCHEMA_VERSION, b9 as TableLayer, ba as TableLayerStyle, bb as TemplateBlock, bc as TemplateContext, bd as TemplateFunction, be as TemplateRegistry, bf as TextLayer, bg as TextStyle, bl as ThemeRegistry, bm as ThemeSchemaVersion, bo as ThemeStyle, bp as ThemeTypography, bq as TimelineBlockInput, br as TimelineTemplateEvent, bs as TimelineTemplateLink, bt as TimelineTemplateTrack, bu as TitleBlockInput, bv as TitleCaptionConfig, bw as TreeBlockInput, bx as TreeLayer, by as TreeLayerItem, bz as TreeLayerStyle, bA as TreeTemplateItem, bB as TwoColumnInput, bC as VIEWPORT_PRESETS, bD as VideoLayer, bE as VideoPipPosition, bF as VideoPipShape, bG as VideoPipSize, bH as VideoPlacement, bI as VideoPresentation, bJ as VideoPullQuoteInput, bK as VideoWithCaptionInput, bL as ViewportConfig, bM as ViewportOrientation, bN as ViewportPreset, bO as VignetteConfig, bP as applySurface, bQ as calculateDuration, bR as calculateFontScale, bS as createTemplateContext, bT as createTheme, bU as createThemeRegistry, bV as getAspectRatioString, bW as getBlockAtTime, bX as getCaptionAtTime, bY as getDocPlaybackDuration, bZ as getLayoutHints, b_ as getSafeTextBounds, b$ as getSegmentAtTime, c0 as getTwoColumnPositions, c1 as getViewport, c2 as getViewportOrientation, c3 as isCustomTemplateDefinition, c4 as isPersistentLayerTemplate, c5 as isTemplateBlock, c6 as layoutScaledFontSize, c7 as resolveMediaSchedule, c8 as scaledFontSize, c9 as validateCustomTemplateDefinition } from '../Doc-DBadkoP4.js';
4
- export { a as DEFAULT_TRANSITION_DURATION_SECONDS, $ as TRANSITION_DIRECTIONS, a0 as TRANSITION_TYPES, a1 as Transition, a2 as TransitionDirection, a3 as TransitionType, a6 as isTransitionType, a7 as normalizeTransitionDirection, a8 as normalizeTransitionType, a9 as resolveBlockTransition, ab as resolveTransitionDuration } from '../types-CcrDFdWH.js';
5
- export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-8BQMY2HV.js';
2
+ import { O as Doc, bh as Theme, bk as ThemePageStyle, bj as ThemeColorScheme, I as DeepPartial, bn as ThemeSeedColors, bi as ThemeColorPalette, X as FontFamilyKind, W as FontFamily } from '../Doc-CRPQCkHn.js';
3
+ export { A as AccentImage, a as AccentPosition, b as AmbientGradientConfig, c as Animation, d as AnimationType, e as AreaChartInput, f as AudioBookmark, g as AudioSegment, h as AudioTimingData, i as AudioTrack, B as BarChartInput, j as BigTextInput, k as Block, l as BlockConnection, m as BorderStyle, C as CaptionPhrase, n as CaptionTrack, o as CaptionWord, p as ChartBaseFields, q as ChartTemplateInput, r as ColorScheme, s as ColumnChartInput, t as ComparisonBarInput, u as ContentBlockInput, v as CornerBrandingConfig, w as CustomTemplateDefinition, x as CustomTemplateLayer, y as CustomTemplateValidationError, z as CustomTemplateValidationResult, D as DARK_SURFACE, E as DEFAULT_DOC_FONT, F as DEFAULT_TITLE_FONT, G as DataTableInput, H as DateEventInput, J as DefinitionCardInput, K as DiagramBlockInput, L as DiagramEdgeAnchor, M as DiagramTemplateEdge, N as DiagramTemplateNode, P as DocBlock, Q as DocDiagnostic, R as DonutChartInput, S as DrawingBlockInput, T as FRONTMATTER_CUSTOM_TEMPLATES_KEY, U as FRONTMATTER_CUSTOM_THEMES_KEY, V as FactCardInput, Y as FullBleedQuoteInput, Z as GradientBackgroundConfig, _ as ImageBackgroundConfig, $ as ImageLayer, a0 as ImageTreatment, a1 as ImageWithCaptionInput, a2 as LIGHT_SURFACE, a3 as Layer, a4 as LayerRepeat, a5 as LayoutHints, a6 as LeftFeatureInput, a7 as LineChartInput, a8 as LinearGradient, a9 as ListBlockInput, aa as MapBlockInput, ab as MapLayer, ac as MapMarker, ad as MapTileStyle, ae as MarkerStyle, af as MediaClip, ag as MediaScheduleOptions, ah as MermaidLayer, ai as PAGE_ACCENT_STRATEGIES, aj as PAGE_BACKGROUNDS, ak as PAGE_BACKGROUND_RHYTHMS, al as PAGE_DESIGN_FAMILIES, am as PAGE_DIVIDERS, an as PAGE_EMPHASES, ao as PAGE_EYEBROWS, ap as PAGE_HEADING_CASES, aq as PAGE_HEADING_SCALES, ar as PAGE_HEADING_UNDERLINES, as as PAGE_HERO_STYLES, at as PAGE_IMAGE_FRAMINGS, au as PAGE_NUMERAL_STYLES, av as PAGE_PATTERNS, aw as PAGE_QUOTE_MARKS, ax as PAGE_SECTION_KINDS, ay as PAGE_SECTION_SPACINGS, az as PAGE_SHADOWS, aA as PageAccentRotation, aB as PageBackground, aC as PageDesignFamily, aD as PageEmphasis, aE as PageHeadingTreatment, aF as PageSectionKind, aG as PageSectionOverride, aH as PageTokens, aI as PathLayer, aJ as PatternBackgroundConfig, aK as PersistentLayer, aL as PersistentLayerConfig, aM as PersistentLayerTemplate, aN as PersistentLayerTemplateConfig, aO as PersistentLayerTemplateType, aP as PhotoGridInput, aQ as PieChartInput, aR as PipStyle, aS as Position, aT as ProgressIndicatorConfig, aU as PromotedBodyAnnotation, aV as PullQuoteInput, aW as QuoteBlockInput, aX as RawLayersInput, aY as RenderStyle, aZ as RightFeatureInput, a_ as ScatterChartInput, a$ as ScheduledClip, b0 as SectionHeaderInput, b1 as ShapeFilter, b2 as ShapeLayer, b3 as ShapePattern, b4 as SolidBackgroundConfig, b5 as StartBlockConfig, b6 as StatHighlightInput, b7 as SurfaceScheme, b8 as THEME_SCHEMA_VERSION, b9 as TableLayer, ba as TableLayerStyle, bb as TemplateBlock, bc as TemplateContext, bd as TemplateFunction, be as TemplateRegistry, bf as TextLayer, bg as TextStyle, bl as ThemeRegistry, bm as ThemeSchemaVersion, bo as ThemeStyle, bp as ThemeTypography, bq as TimelineBlockInput, br as TimelineTemplateEvent, bs as TimelineTemplateLink, bt as TimelineTemplateTrack, bu as TitleBlockInput, bv as TitleCaptionConfig, bw as TranscriptBlockInput, bx as TreeBlockInput, by as TreeLayer, bz as TreeLayerItem, bA as TreeLayerStyle, bB as TreeTemplateItem, bC as TwoColumnInput, bD as VIEWPORT_PRESETS, bE as VideoLayer, bF as VideoPipPosition, bG as VideoPipShape, bH as VideoPipSize, bI as VideoPlacement, bJ as VideoPresentation, bK as VideoPullQuoteInput, bL as VideoWithCaptionInput, bM as ViewportConfig, bN as ViewportOrientation, bO as ViewportPreset, bP as VignetteConfig, bQ as applySurface, bR as calculateDuration, bS as calculateFontScale, bT as createTemplateContext, bU as createTheme, bV as createThemeRegistry, bW as getAspectRatioString, bX as getBlockAtTime, bY as getCaptionAtTime, bZ as getDocPlaybackDuration, b_ as getLayoutHints, b$ as getSafeTextBounds, c0 as getSegmentAtTime, c1 as getTwoColumnPositions, c2 as getViewport, c3 as getViewportOrientation, c4 as isCustomTemplateDefinition, c5 as isPersistentLayerTemplate, c6 as isTemplateBlock, c7 as layoutScaledFontSize, c8 as resolveMediaSchedule, c9 as scaledFontSize, ca as validateCustomTemplateDefinition } from '../Doc-CRPQCkHn.js';
4
+ export { a as DEFAULT_TRANSITION_DURATION_SECONDS, a1 as TRANSITION_DIRECTIONS, a2 as TRANSITION_TYPES, a3 as Transition, a4 as TransitionDirection, a5 as TransitionType, a8 as isTransitionType, a9 as normalizeTransitionDirection, aa as normalizeTransitionType, ab as resolveBlockTransition, ad as resolveTransitionDuration } from '../types-Be6sBUBx.js';
5
+ export { D as DEFAULT_THEME, a as DEFAULT_THEME_ID, T as THEMES, g as getAvailableThemes, b as getThemeSummaries, r as resolveTheme } from '../themeLibrary-BG3jr6mT.js';
6
6
  export { M as MediaEntry, a as MediaProvider } from '../MediaProvider-wpSe21B3.js';
7
- export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-Cq2a3c30.js';
7
+ export { E as EditorLayerMeta, I as ImageEditCanvas, a as ImageEditDoc, b as ImageEditLayer, c as ImageEditLayerKind, d as ImageEditMeta } from '../ImageEditDoc-MbvJM1HE.js';
8
8
 
9
9
  /**
10
10
  * Runtime validation for the canonical {@link Doc} JSON shape.
@@ -7,7 +7,7 @@ import {
7
7
  createMediaProviderFromContainer,
8
8
  findDocumentPath,
9
9
  scopeContainer
10
- } from "../chunk-FCG3BIZN.js";
10
+ } from "../chunk-UNVHAK3A.js";
11
11
  export {
12
12
  LocalForageAdapter,
13
13
  LocalStorageAdapter,
@@ -0,0 +1,123 @@
1
+ import { T as TableViewState, V as ViewIssue } from '../viewState-lTZS-hP_.js';
2
+ export { E as EMPTY_TABLE_VIEW_STATE, F as FilterClause, a as FilterOp, P as ParsedTableViewState, S as SortTerm, i as inferNumericColumn, b as isEmptyViewState, c as isNumericCellText, m as makeTableCollator, p as parseTableViewState, q as quoteViewToken, s as serializeTableViewState } from '../viewState-lTZS-hP_.js';
3
+
4
+ /**
5
+ * Reference implementation of table view state over a plain string matrix —
6
+ * the semantics contract the grid's worker kernel is parity-tested against,
7
+ * and what the sidecar data readers apply before windowing so previews and
8
+ * exports show the author's curated view.
9
+ *
10
+ * Semantics:
11
+ * - filter first (AND conjunction), then a STABLE multi-term sort;
12
+ * - a column is numeric per `inferNumericColumn` (all non-blank cells
13
+ * numeric, no leading-zero strings) — numeric columns compare by value,
14
+ * everything else via the shared collator (`numeric: true`, so "v2" <
15
+ * "v10" in text columns too);
16
+ * - blank cells sort LAST regardless of direction (Excel behavior) and
17
+ * match only `= ''` / `!=` filters;
18
+ * - text-matching ops (`= != ~ !~ ^~ $~`) are case-INSENSITIVE by default
19
+ * (Excel AutoFilter semantics); `clause.caseSensitive` (`*` in the
20
+ * grammar) makes them exact-case. Numeric equality is unaffected.
21
+ */
22
+
23
+ interface AppliedTableView {
24
+ /** Filtered + sorted rows (the same row arrays, re-ordered — not copies). */
25
+ rows: string[][];
26
+ /** Source-row index (0-based, header excluded) per output row. */
27
+ rowIds: number[];
28
+ /** Row count before filtering (equals `rows.length` with no filter). */
29
+ unfilteredRowCount: number;
30
+ }
31
+ /**
32
+ * Apply `view` to `rows`. Row identity is positional: `rowIds[i]` is the
33
+ * index of output row `i` in the input `rows`.
34
+ */
35
+ declare function applyTableViewState(headers: readonly string[], rows: readonly (readonly string[])[], view: TableViewState): AppliedTableView;
36
+
37
+ /**
38
+ * TableQueryProvider — the async, worker-ready contract a data grid renders
39
+ * against and a query backend implements. The default implementation is the
40
+ * in-house columnar worker store in `@bendyline/squisq-grid-react`; heavier
41
+ * backends (SQL engines, remote services) implement the same surface later.
42
+ *
43
+ * Design constraints baked in:
44
+ * - Everything is async: the reference backend lives in a Web Worker, and
45
+ * retrofitting async under a sync grid API is painful — so the contract
46
+ * is async from day one and renderers use windowed prefetch.
47
+ * - View state (sort/filter) is provider-side: the renderer never holds
48
+ * more than a window of rows, so ordering/filtering must happen where
49
+ * the full dataset lives.
50
+ * - Row identity is the immutable SOURCE row index (`rowId`), assigned at
51
+ * ingest — stable under any permutation and unaffected by edits changing
52
+ * sort keys.
53
+ */
54
+
55
+ type TableColumnKind = 'number' | 'string' | 'date' | 'boolean';
56
+ interface TableColumnSchema {
57
+ name: string;
58
+ kind: TableColumnKind;
59
+ }
60
+ interface TableSchema {
61
+ columns: TableColumnSchema[];
62
+ /** Total data rows in the source (before any filter). */
63
+ rowCount: number;
64
+ }
65
+ /** A cell value as providers exchange it. `null` = blank. */
66
+ type TableCellValue = string | number | boolean | null;
67
+ interface TableRowsPage {
68
+ /** View-coordinate index of the first returned row. */
69
+ start: number;
70
+ /** Source row id per returned row (edit/selection identity). */
71
+ rowIds: number[];
72
+ /** Raw values; formatting is the renderer's job. */
73
+ cells: TableCellValue[][];
74
+ }
75
+ interface TableViewResult {
76
+ /** Row count AFTER the active filter (the virtualizer's row count). */
77
+ viewRowCount: number;
78
+ issues: ViewIssue[];
79
+ }
80
+ interface TableCellEdit {
81
+ rowId: number;
82
+ col: number;
83
+ value: TableCellValue;
84
+ }
85
+ interface TableEditResult {
86
+ /**
87
+ * True when an edited cell touched an active sort/filter column — the
88
+ * current permutation may be outdated. Providers NEVER auto re-sort on
89
+ * edit (a row teleporting out from under the caret is hostile); the
90
+ * renderer offers an explicit refresh.
91
+ */
92
+ staleView: boolean;
93
+ }
94
+ /** Result of a {@link TableQueryProvider.distinct} sweep over one column. */
95
+ interface TableDistinctResult {
96
+ /**
97
+ * Distinct non-blank values as display text, sorted (numerically for
98
+ * numeric columns, collated otherwise), capped at the requested limit.
99
+ */
100
+ values: string[];
101
+ /** Total distinct non-blank values in the column (may exceed `values`). */
102
+ totalDistinct: number;
103
+ /** Whether any cell in the column is blank. */
104
+ hasBlank: boolean;
105
+ }
106
+ interface TableQueryProvider {
107
+ describe(): Promise<TableSchema>;
108
+ /** Apply a view; subsequent `rows()` windows are in view coordinates. */
109
+ setView(view: TableViewState): Promise<TableViewResult>;
110
+ rows(start: number, count: number): Promise<TableRowsPage>;
111
+ /** Optional: providers without write support omit it (read-only grid). */
112
+ applyEdits?(edits: TableCellEdit[]): Promise<TableEditResult>;
113
+ /**
114
+ * Optional: distinct values of one column over the FULL source (not the
115
+ * filtered view), for value-picker UIs. Cheap for the columnar store —
116
+ * string columns are dictionary-encoded — so renderers feature-detect
117
+ * this rather than aggregating rows themselves.
118
+ */
119
+ distinct?(col: number, limit: number): Promise<TableDistinctResult>;
120
+ dispose(): void;
121
+ }
122
+
123
+ export { type AppliedTableView, type TableCellEdit, type TableCellValue, type TableColumnKind, type TableColumnSchema, type TableDistinctResult, type TableEditResult, type TableQueryProvider, type TableRowsPage, type TableSchema, type TableViewResult, TableViewState, ViewIssue, applyTableViewState };