rapier-markdown-kit 1.2.45 → 1.2.48
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/LICENSE +12 -5
- package/README.md +134 -11
- package/dist/agent/vendor/BROWSER-ENTITIES.json +36 -0
- package/dist/agent/vendor/MARKDOWN-RUNTIME.json +136 -0
- package/dist/agent/vendor/MARKDOWNIT.json +582 -0
- package/dist/agent/vendor/NOTICE.txt +60 -0
- package/dist/agent/vendor/markdown-licenses/entities-LICENSE.txt +11 -0
- package/dist/agent/vendor/markdown-licenses/linkify-it-LICENSE.txt +22 -0
- package/dist/agent/vendor/markdown-licenses/markdown-it-LICENSE.txt +22 -0
- package/dist/agent/vendor/markdown-licenses/mdurl-LICENSE.txt +45 -0
- package/dist/agent/vendor/markdown-licenses/punycode.js-LICENSE-MIT.txt +20 -0
- package/dist/agent/vendor/markdown-licenses/uc.micro-LICENSE.txt +20 -0
- package/dist/agent/vendor/markdown-plugins.json +46 -0
- package/dist/agent/vendor/markdown-plugins.mjs +27 -0
- package/dist/agent/vendor/markdown-runtime.mjs +13 -0
- package/dist/kit/artifact-modules.mjs +19 -0
- package/dist/kit/assets.d.mts +106 -0
- package/dist/kit/export-fonts.mjs +28 -19
- package/dist/kit/index.d.mts +151 -0
- package/dist/kit/layout.d.mts +61 -0
- package/dist/kit/ledger/carried.d.mts +12 -6
- package/dist/kit/ledger/carried.mjs +17 -8
- package/dist/kit/ledger/format.mjs +5 -3
- package/dist/kit/ledger/source.mjs +31 -2
- package/dist/kit/ledger/text-merge.mjs +33 -0
- package/dist/kit/ledger/transport.mjs +61 -2
- package/dist/kit/ledger.d.mts +137 -31
- package/dist/kit/markdown-it.d.mts +2 -2
- package/dist/kit/marks.d.mts +241 -0
- package/dist/kit/marks.mjs +39 -1
- package/dist/kit/model.d.mts +191 -0
- package/dist/kit/pdf-source-digest.mjs +10 -0
- package/dist/kit/pdf-source.mjs +4 -1
- package/dist/kit/pdf-vectors.mjs +3 -2
- package/dist/kit/render-entry.d.mts +654 -0
- package/dist/kit/render-markdown.mjs +14 -8
- package/dist/kit/render-print.mjs +36 -7
- package/dist/kit/render.mjs +16 -14
- package/dist/kit/typography.d.mts +42 -0
- package/dist/kit/will.d.mts +26 -3
- package/dist/layout/initial-range.mjs +18 -0
- package/dist/layout/typography.mjs +2 -18
- package/dist/math/delimiters.mjs +38 -0
- package/dist/math/markdown-rules.mjs +103 -0
- package/dist/packages/rapier-diff/concerns.mjs +2 -2
- package/dist/spec/document-fonts.mjs +62 -16
- package/dist/spec/md-assets.mjs +1 -0
- package/dist/spec/md-comments.mjs +384 -0
- package/dist/spec/md-marks.mjs +9 -0
- package/dist/spec/md-parser-config.mjs +463 -0
- package/dist/spec/md-parser-runtime.mjs +23 -0
- package/package.json +30 -8
|
@@ -4,6 +4,7 @@ import {projectInverseSource} from './inverse-source.mjs';
|
|
|
4
4
|
import {authoredBasis, authoredPlacement, authoredPlacements} from './authored-origin.mjs';
|
|
5
5
|
import {sha256} from './hash.mjs';
|
|
6
6
|
import {canonicalJSON} from './data.mjs';
|
|
7
|
+
import {parseComments, commentSplices, derivedCommentEdits} from '../../spec/md-comments.mjs';
|
|
7
8
|
|
|
8
9
|
const whole = text => typeof text === 'string' && !/[\uD800-\uDFFF]/u.test(text);
|
|
9
10
|
function admitted(rows) {
|
|
@@ -59,7 +60,65 @@ function applyBatch(text, rows) {
|
|
|
59
60
|
return {text: after, splices: exact};
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
export function transposeRecord(base, splices, id, records) {
|
|
63
|
+
export function transposeRecord(base, splices, id, records, derivedCommentIndex) {
|
|
64
|
+
const comments = transposeCommentRecord(base, splices, id, records, derivedCommentIndex);
|
|
65
|
+
return comments || transposeTextRecord(base, splices, id, records);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function commentRecordProof(source, splices, index) {
|
|
69
|
+
if (typeof source !== 'string' || !source.includes('<!-- md-comments:') ||
|
|
70
|
+
!Array.isArray(splices) || !Number.isSafeInteger(index) || index !== splices.length - 1) return null;
|
|
71
|
+
try {
|
|
72
|
+
const parsed = parseComments(source), proof = derivedCommentEdits(source, splices);
|
|
73
|
+
if (!parsed.record || parsed.reason || !parsed.current || !proof || proof.edits.length !== index ||
|
|
74
|
+
canonicalJSON(proof.edits) !== canonicalJSON(splices.slice(0, index))) return null;
|
|
75
|
+
let start = parsed.record.start;
|
|
76
|
+
for (const row of proof.edits) {
|
|
77
|
+
if (row.pos >= start || row.pos + row.removed.length > start) return null;
|
|
78
|
+
start += row.inserted.length - row.removed.length;
|
|
79
|
+
}
|
|
80
|
+
const derived = commentSplices(source, proof.edits);
|
|
81
|
+
if (derived.length !== 1 || canonicalJSON(derived[0]) !== canonicalJSON(splices[index])) return null;
|
|
82
|
+
return {parsed, edits: proof.edits, text: _rapierTransformSplices(source, splices)};
|
|
83
|
+
} catch (_) { return null; }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function transposeCommentRecord(base, splices, id, records, derivedCommentIndex) {
|
|
87
|
+
if (!Array.isArray(records) || !records.length) return null;
|
|
88
|
+
const local = commentRecordProof(base, splices, derivedCommentIndex);
|
|
89
|
+
if (!local) return null;
|
|
90
|
+
const bodyRecords = []; let current = base;
|
|
91
|
+
for (const record of records) {
|
|
92
|
+
const proof = commentRecordProof(current, record.splices, record.derivedCommentIndex);
|
|
93
|
+
if (!proof) return null;
|
|
94
|
+
bodyRecords.push({...record, splices: proof.edits}); current = proof.text;
|
|
95
|
+
}
|
|
96
|
+
const moved = transposeTextRecord(local.parsed.body, local.edits, id, bodyRecords);
|
|
97
|
+
const derive = (source, rows) => {
|
|
98
|
+
const parsed = parseComments(source); let start = parsed.record?.start;
|
|
99
|
+
if (!parsed.record || parsed.reason || !parsed.current) throw new RangeError('canonical_act_rebase_conflict');
|
|
100
|
+
for (const row of rows) {
|
|
101
|
+
if (row.pos >= start || row.pos + row.removed.length > start) throw new RangeError('canonical_act_rebase_conflict');
|
|
102
|
+
start += row.inserted.length - row.removed.length;
|
|
103
|
+
}
|
|
104
|
+
const footer = commentSplices(source, rows), splices = [...rows, ...footer];
|
|
105
|
+
const text = _rapierTransformSplices(source, splices), after = text === null ? null : parseComments(text);
|
|
106
|
+
if (!after?.record || after.reason || !after.current) throw new RangeError('canonical_act_rebase_conflict');
|
|
107
|
+
return {text, splices, footer};
|
|
108
|
+
};
|
|
109
|
+
const accepted = derive(current, moved.splices);
|
|
110
|
+
let reciprocal = local.text;
|
|
111
|
+
const against = moved.against.map(record => {
|
|
112
|
+
const value = derive(reciprocal, record.splices); reciprocal = value.text;
|
|
113
|
+
return {...record, splices: value.splices};
|
|
114
|
+
});
|
|
115
|
+
if (reciprocal !== accepted.text || parseComments(accepted.text).body !== moved.text)
|
|
116
|
+
throw new RangeError('canonical_transport_invalid');
|
|
117
|
+
return {text: accepted.text, splices: accepted.splices, against,
|
|
118
|
+
sourceIndices: [...moved.sourceIndices, ...accepted.footer.map(() => derivedCommentIndex)]};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function transposeTextRecord(base, splices, id, records) {
|
|
63
122
|
if (typeof base !== 'string' || !Array.isArray(splices) || typeof id !== 'string' || !Array.isArray(records))
|
|
64
123
|
throw new RangeError('canonical_transport_invalid');
|
|
65
124
|
let source = base, current = base;
|
|
@@ -305,7 +364,7 @@ function authoredReplay(base, records, append = null) {
|
|
|
305
364
|
throw new RangeError('canonical_origin_invalid');
|
|
306
365
|
const accepted = projectInverse(text, aligned.records, id);
|
|
307
366
|
moved = {text: accepted.after, splices: accepted.splices};
|
|
308
|
-
} else moved = transposeRecord(basis.text, origin.splices, id, crossed);
|
|
367
|
+
} else moved = transposeRecord(basis.text, origin.splices, id, crossed, original.derivedCommentIndex);
|
|
309
368
|
if (_rapierTransformSplices(text, moved.splices) !== moved.text) throw new RangeError('canonical_origin_invalid');
|
|
310
369
|
placed.push({...original, splices: moved.splices}); text = moved.text; ids.add(id);
|
|
311
370
|
if (original.derivedCommentIndex != null) sourceIndices.set(id, moved.sourceIndices);
|
package/dist/kit/ledger.d.mts
CHANGED
|
@@ -2,17 +2,32 @@
|
|
|
2
2
|
// rapier-markdown-kit/rapier-ledger: a document's edit history with authorship, Undo of any act and offline merge.
|
|
3
3
|
// Offsets count UTF-16 code units; splices run in their recorded order.
|
|
4
4
|
export type ActorKind = 'human' | 'agent' | 'system';
|
|
5
|
-
export interface Actor { kind: ActorKind; id: string; }
|
|
5
|
+
export interface Actor { kind: ActorKind; id: string; name?: string; }
|
|
6
6
|
export type DocKind = 'markdown' | 'text' | 'code';
|
|
7
7
|
export interface Metadata { filename: string; docKind: DocKind; }
|
|
8
|
+
export interface MetadataEffect {
|
|
9
|
+
filename?: {before: string; after: string};
|
|
10
|
+
docKind?: {before: DocKind; after: DocKind};
|
|
11
|
+
}
|
|
12
|
+
export type LedgerData = null | boolean | number | string | LedgerData[] | {[key: string]: LedgerData};
|
|
8
13
|
export interface Splice { pos: number; removed: string; inserted: string; }
|
|
9
14
|
export interface Transaction {
|
|
10
15
|
id: string; documentAuthority: string; baseRevision: number; revision: number; actor: Actor;
|
|
11
|
-
transport:
|
|
12
|
-
affectedBlockIds:
|
|
13
|
-
createdAt:
|
|
16
|
+
transport: 'platform' | 'webmcp'; operation: string; requestId: string | null; sourceTransactionId: string | null;
|
|
17
|
+
affectedBlockIds: number[]; parent: string | null; reverts: string | null; reapplies: string | null;
|
|
18
|
+
createdAt: number | null; turnId?: string | null; sourceTransactionIds?: string[];
|
|
19
|
+
label?: string | null; turnLabel?: string | null; turnBaseRevision?: number;
|
|
20
|
+
contribution?: string; contributionBaseRevision?: number; remoteTransactionId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AuthoredPlacement { basis: string[]; source: string; splices: Splice[]; }
|
|
23
|
+
/** A retained journal may omit navigation splices: the target's exact rows supply them. */
|
|
24
|
+
export interface JournalRecord {
|
|
25
|
+
transaction: Transaction; splices?: Splice[]; beforeHash: string; afterHash: string;
|
|
26
|
+
metadata?: MetadataEffect; authored?: AuthoredPlacement; derivedCommentIndex?: number;
|
|
27
|
+
changeSet?: {[key: string]: LedgerData};
|
|
14
28
|
}
|
|
15
|
-
|
|
29
|
+
/** An exported envelope expands every navigation record to exact splices. */
|
|
30
|
+
export interface LedgerRecord extends JournalRecord { splices: Splice[]; }
|
|
16
31
|
/** rapier-ledger/2: plain JSON. */
|
|
17
32
|
export interface LedgerEnvelope {
|
|
18
33
|
format: 'rapier-ledger/2';
|
|
@@ -24,9 +39,9 @@ export interface LedgerEnvelope {
|
|
|
24
39
|
sha256: string;
|
|
25
40
|
}
|
|
26
41
|
/** Runs of [start, end, actor kind, actor id, createdAt] over the current text. */
|
|
27
|
-
export interface AuthorshipEnvelope { format: 'rapier-authorship/1'; sha256: string; runs: [number, number, ActorKind, string,
|
|
42
|
+
export interface AuthorshipEnvelope { format: 'rapier-authorship/1'; sha256: string; runs: [number, number, ActorKind, string, number | null][]; }
|
|
28
43
|
export interface ReadLedger { ledger: LedgerEnvelope; text: string; metadata: Metadata; root: string; revision: number; complete: boolean; }
|
|
29
|
-
export interface LedgerInput { text: string; metadata: Metadata; records:
|
|
44
|
+
export interface LedgerInput { text: string; metadata: Metadata; records: JournalRecord[]; earlier?: JournalRecord[]; documentAuthority?: string; revision?: number; root?: string; complete?: boolean; }
|
|
30
45
|
|
|
31
46
|
/** A new ledger with no history. Give every copy that may later merge the same documentAuthority. */
|
|
32
47
|
export function openLedger(text: string, options?: {filename?: string; docKind?: DocKind; documentAuthority?: string}): LedgerEnvelope;
|
|
@@ -34,20 +49,31 @@ export function exportLedger(input: LedgerInput): LedgerEnvelope;
|
|
|
34
49
|
/** Verifies the envelope (and, when given, that it describes this text and metadata); throws when it does not. */
|
|
35
50
|
export function readLedger(input: LedgerEnvelope, expectedText?: string, expectedMetadata?: Metadata): ReadLedger;
|
|
36
51
|
/** Records one replacement of the whole text as an act by `actor`. */
|
|
37
|
-
export function replaceLedgerText(input: LedgerEnvelope, text: string, options?: {actor?: Actor; operation?: string; at?:
|
|
52
|
+
export function replaceLedgerText(input: LedgerEnvelope, text: string, options?: {actor?: Actor; operation?: string; at?: number | null}): LedgerEnvelope;
|
|
38
53
|
export function ledgerWithStart(input: LedgerEnvelope, text: string): LedgerEnvelope;
|
|
39
|
-
export
|
|
54
|
+
export interface HistoryEnvelope<Segment = unknown> {
|
|
55
|
+
schemaVersion: 5; documentAuthority: string; documentRevision: number;
|
|
56
|
+
ledger: LedgerRecord[]; branch: string[]; cursor: number; earliestRevision: number;
|
|
57
|
+
earliestHash: string; sourceRootId: string; earliestMetadata: Metadata; documentMetadata: Metadata;
|
|
58
|
+
segmentIdentity: Segment[]; historyComplete: boolean; trimReason: '' | 'carried_start'; trimmedBytes: 0;
|
|
59
|
+
}
|
|
60
|
+
export function historyEnvelope<Segment = unknown>(input: LedgerEnvelope, segmentIdentity?: Segment[], expectedText?: string, expectedMetadata?: Metadata): HistoryEnvelope<Segment>;
|
|
40
61
|
/** The actor id an agent writes under, for a door and an agent name. */
|
|
41
|
-
export function agentActorId(door: string, agent: string): string;
|
|
62
|
+
export function agentActorId(door: string, agent?: {name: string} | null): string;
|
|
42
63
|
export function textRoot(text: string): string;
|
|
43
64
|
export function rootAfter(root: string, splice: Splice): string;
|
|
44
|
-
|
|
65
|
+
/** Feed bytes, then call finish once. `bytes` counts the input supplied so far. */
|
|
66
|
+
export function sha256State(): {update(input: Uint8Array): void; finish(): string; readonly bytes: number};
|
|
45
67
|
|
|
46
68
|
export function authorship(input: LedgerEnvelope): AuthorshipEnvelope;
|
|
47
69
|
export function readAuthorship(input: AuthorshipEnvelope, text: string): AuthorshipEnvelope;
|
|
48
70
|
export function ledgerFromAuthorship(input: AuthorshipEnvelope, text: string, documentAuthority: string, metadata: Metadata): LedgerEnvelope;
|
|
49
71
|
|
|
50
|
-
export
|
|
72
|
+
export type MergeConflict =
|
|
73
|
+
| {kind: 'identity'; code: 'act_identity_conflict' | 'act_order_conflict'; actId?: string}
|
|
74
|
+
| {kind: 'history'; code: 'record_transport_conflict'}
|
|
75
|
+
| {kind: 'metadata'; code: 'metadata_assignment_conflict' | 'inverse_target_unavailable' | 'record_transport_conflict'; fields?: (keyof Metadata)[]}
|
|
76
|
+
| (TextMergeConflict & {code: 'text_overlap_unpreserved'});
|
|
51
77
|
export interface MergeResult {
|
|
52
78
|
text: string; metadata: Metadata; ledger: LedgerEnvelope;
|
|
53
79
|
/** False when a person must review: conflicts, or Will keep regions that differ. */
|
|
@@ -60,29 +86,109 @@ export function merge(first: LedgerEnvelope, second: LedgerEnvelope): MergeResul
|
|
|
60
86
|
export function transportInterval(start: number, end: number, splices: Splice[]): {start: number; end: number} | null;
|
|
61
87
|
export function transportTouchedInterval(start: number, end: number, splices: Splice[]): {start: number; end: number};
|
|
62
88
|
|
|
63
|
-
export
|
|
64
|
-
export interface
|
|
89
|
+
export type HistoryTransaction = Pick<Transaction, 'id' | 'baseRevision' | 'revision' | 'actor' | 'createdAt'> & Partial<Transaction>;
|
|
90
|
+
export interface HistoryRecord {
|
|
91
|
+
transaction: HistoryTransaction; splices?: Splice[]; beforeHash?: string; afterHash?: string;
|
|
92
|
+
metadata?: MetadataEffect; authored?: AuthoredPlacement; derivedCommentIndex?: number;
|
|
93
|
+
changeSet?: {[key: string]: LedgerData};
|
|
94
|
+
}
|
|
95
|
+
export interface HistoryInput {
|
|
96
|
+
source: string; metadata: Metadata; records: HistoryRecord[];
|
|
97
|
+
revision?: number; earliestRevision?: number; earliestRoot?: string; complete?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface HistoryFailure {
|
|
100
|
+
ok: false;
|
|
101
|
+
reason: 'history_invalid' | 'history_unavailable' | 'range_invalid' | 'act_unavailable' | 'act_invalid' | 'act_forbidden' | 'will_refused';
|
|
102
|
+
}
|
|
103
|
+
export interface HistoryAct {
|
|
104
|
+
id: string; actor: Actor; createdAt: number | null; baseRevision: number; revision: number; operation: string;
|
|
105
|
+
turnId?: string; contribution?: string; sourceTransactionId?: string; sourceTransactionIds?: string[];
|
|
106
|
+
reverts?: string; reapplies?: string; label?: LedgerData; affectedBlockIds?: number[];
|
|
107
|
+
metadata?: MetadataEffect; active?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface HistoryGroup { id: string; actor: Actor; actIds: string[]; createdAt: number | null; turnId?: string; }
|
|
110
|
+
export interface HistorySnapshot { source: string; revision: number; earliestRevision: number; complete: boolean; }
|
|
111
|
+
export interface HistoryReplay extends HistorySnapshot {
|
|
112
|
+
ok: true; initialSource: string; metadata: Metadata; initialMetadata: Metadata;
|
|
113
|
+
acts: HistoryAct[]; effectiveActIds: string[]; groups: HistoryGroup[];
|
|
114
|
+
}
|
|
115
|
+
export interface HistorySourceBefore extends HistorySnapshot { ok: true; metadata: Metadata; act: HistoryAct; }
|
|
116
|
+
export interface HistoryRange { from?: number; to?: number; actId?: string; }
|
|
117
|
+
export interface HistorySourceRange { from: number; to: number; source: string; }
|
|
118
|
+
export interface ProjectedHistoryAct extends HistoryAct { before: HistorySourceRange; after: HistorySourceRange; }
|
|
119
|
+
export interface HistoryProjection extends HistorySnapshot, HistorySourceRange {
|
|
120
|
+
ok: true; acts: ProjectedHistoryAct[]; groups: HistoryGroup[]; before?: HistorySourceRange;
|
|
121
|
+
}
|
|
122
|
+
export interface HistoryBlock<Id = unknown> { id: Id; from: number; to: number; }
|
|
123
|
+
export interface HistoryPlaces<Id = unknown> extends HistorySnapshot {
|
|
124
|
+
ok: true; initialSource: string; acts: HistoryAct[];
|
|
125
|
+
blocks: (HistoryBlock<Id> & {source: string; acts: ProjectedHistoryAct[]})[]; reversed: string[];
|
|
126
|
+
}
|
|
127
|
+
export interface UndoHunk {
|
|
128
|
+
actId: string; spliceIndex: number; hunkIndex: number; splice: Splice;
|
|
129
|
+
beforeSource: string; actSource: string; priorSplices: Splice[];
|
|
130
|
+
}
|
|
131
|
+
export interface SelectiveUndoOptions {
|
|
132
|
+
actor?: Actor;
|
|
133
|
+
/** Retain this exact hunk while reversing the other selected hunks. */
|
|
134
|
+
keepHunk?: (hunk: UndoHunk) => boolean;
|
|
135
|
+
/** Refinements must replay to the same exact text as the supplied splice. */
|
|
136
|
+
splitSplice?: (input: {actId: string; beforeSource: string; splice: Splice}) => Splice[];
|
|
137
|
+
}
|
|
138
|
+
export interface SupersededHunk { actId: string; hunk: string; laterActIds: string[]; reason: 'later_edit' | 'already_undone'; }
|
|
139
|
+
export interface SelectiveUndo {
|
|
140
|
+
ok: true; splices: Splice[]; after: string; actIds: string[]; sourceTransactionIds: string[];
|
|
141
|
+
metadata: MetadataEffect | null; afterMetadata: Metadata; effectChanged: boolean; unchanged: boolean;
|
|
142
|
+
superseded: SupersededHunk[]; overlaps: SupersededHunk[];
|
|
143
|
+
}
|
|
65
144
|
/** Reverses chosen acts while later work stays. */
|
|
66
|
-
export function selectiveUndo(input: HistoryInput, actIds: string[], options?:
|
|
67
|
-
export function replayHistory(input: HistoryInput):
|
|
68
|
-
export function sourceBefore(input: HistoryInput, actId: string):
|
|
69
|
-
export function historyProjection(input: HistoryInput, range?:
|
|
70
|
-
export function historyProjections(input: HistoryInput, ranges:
|
|
71
|
-
export function historyPlaces(input: HistoryInput, blocks:
|
|
72
|
-
export function groupHistoryActs(acts:
|
|
73
|
-
export function pictureHistorySplices(input:
|
|
74
|
-
|
|
75
|
-
export
|
|
76
|
-
export
|
|
77
|
-
|
|
78
|
-
|
|
145
|
+
export function selectiveUndo(input: HistoryInput, actIds: string[], options?: SelectiveUndoOptions): SelectiveUndo | HistoryFailure;
|
|
146
|
+
export function replayHistory(input: HistoryInput): HistoryReplay | HistoryFailure;
|
|
147
|
+
export function sourceBefore(input: HistoryInput, actId: string): HistorySourceBefore | HistoryFailure;
|
|
148
|
+
export function historyProjection(input: HistoryInput, range?: HistoryRange): HistoryProjection | HistoryFailure;
|
|
149
|
+
export function historyProjections(input: HistoryInput, ranges: (HistoryRange | undefined)[]): {ok: true; projections: (HistoryProjection | HistoryFailure)[]} | HistoryFailure;
|
|
150
|
+
export function historyPlaces<Id>(input: HistoryInput, blocks: HistoryBlock<Id>[]): HistoryPlaces<Id> | HistoryFailure;
|
|
151
|
+
export function groupHistoryActs(acts: Pick<HistoryAct, 'id' | 'actor' | 'createdAt' | 'turnId'>[]): HistoryGroup[];
|
|
152
|
+
export function pictureHistorySplices(input: Pick<HistoryInput, 'source' | 'records'>, target: HistoryRecord, redo: boolean): Splice[] | null;
|
|
153
|
+
/** Canonical input splices use `pos/removed/inserted`; the host's reciprocal log uses `at/remove/insert`. */
|
|
154
|
+
export interface SourceTransportEntry { client: string; splices: {at: number; remove: number; insert: string}[]; }
|
|
155
|
+
export interface AuthoredRecord {
|
|
156
|
+
transaction: Pick<Transaction, 'id'> & Partial<Transaction>; splices: Splice[];
|
|
157
|
+
authored?: AuthoredPlacement; metadata?: MetadataEffect; derivedCommentIndex?: number;
|
|
158
|
+
}
|
|
159
|
+
export interface SourceTransposition {
|
|
160
|
+
text: string; splices: Splice[]; sourceIndices: number[];
|
|
161
|
+
against: {transaction: {id: string}; splices: Splice[]}[];
|
|
162
|
+
}
|
|
163
|
+
export interface AuthoredHistory<Record extends AuthoredRecord = AuthoredRecord> {
|
|
164
|
+
text: string; records: Record[]; origins: Map<string, AuthoredPlacement>;
|
|
165
|
+
}
|
|
166
|
+
export interface ProjectedAuthoredHistory<Record extends AuthoredRecord = AuthoredRecord> extends AuthoredHistory<Record> {
|
|
167
|
+
sourceIndices: Map<string, number[]>;
|
|
168
|
+
}
|
|
169
|
+
export interface AuthoredTransposition<Record extends AuthoredRecord = AuthoredRecord> {
|
|
170
|
+
text: string; splices: Splice[]; submittedBefore: string; submitted: string; against: Record[];
|
|
171
|
+
}
|
|
172
|
+
export function transposeSource(base: string, splices: Splice[], client: string, log: SourceTransportEntry[]): SourceTransposition;
|
|
173
|
+
export function authoredBasis(records: Pick<AuthoredRecord, 'transaction' | 'authored'>[]): string[];
|
|
174
|
+
export function authoredPlacement(source: string, splices: Splice[], basis: string[]): AuthoredPlacement;
|
|
175
|
+
export function authoredHistory<Record extends AuthoredRecord>(base: string, records: Record[], selected: ReadonlySet<string>): ProjectedAuthoredHistory<Record>;
|
|
176
|
+
export function authoredHistory<Record extends AuthoredRecord>(base: string, records: Record[], selected?: null): AuthoredHistory<Record>;
|
|
177
|
+
export function authoredHistory<Record extends AuthoredRecord>(base: string, records: Record[], selected?: ReadonlySet<string> | null): AuthoredHistory<Record> | ProjectedAuthoredHistory<Record>;
|
|
178
|
+
export function transposeAuthored<Record extends AuthoredRecord>(base: string, records: Record[], incoming: AuthoredRecord & {authored: AuthoredPlacement}, submitted: string[]): AuthoredTransposition<Record>;
|
|
79
179
|
|
|
80
180
|
export {writeDocument, readDocument, writeParts, readParts} from './ledger/carried.mjs';
|
|
81
181
|
|
|
82
|
-
export interface
|
|
83
|
-
export interface
|
|
182
|
+
export interface TextConflictVariant { device: string; text: string; }
|
|
183
|
+
export interface TextConflictDescriptor { start: number; end: number; block: string; variants: TextConflictVariant[]; }
|
|
184
|
+
export interface TextConflict extends TextConflictDescriptor { kind: 'text'; id: string; }
|
|
185
|
+
export type TextMergeConflict =
|
|
186
|
+
| (TextConflictDescriptor & {kind: 'text' | 'no-ancestor' | 'will' | 'document-bindings' | 'ambiguous-alignment-or-budget'; base: string | null})
|
|
187
|
+
| {kind: 'existing-conflict'; advisory: true};
|
|
188
|
+
export interface TextMerge { text: string; clean: boolean; conflicts: TextMergeConflict[]; }
|
|
189
|
+
export interface TextMergeOptions { oursId: string; theirsId: string; }
|
|
84
190
|
/** Exact three-way text merge; a region both sides changed becomes a marked choice in the text. */
|
|
85
|
-
export function mergeText(base: string | null, ours: string, theirs: string, options?:
|
|
191
|
+
export function mergeText(base: string | null, ours: string, theirs: string, options?: TextMergeOptions): TextMerge;
|
|
86
192
|
export function inspectTextConflicts(text: string, options?: {nested?: boolean}): TextConflict[];
|
|
87
|
-
export function resolveTextConflict(text: string, conflict:
|
|
193
|
+
export function resolveTextConflict(text: string, conflict: TextConflictDescriptor, device: string | number): string;
|
|
88
194
|
export function mapTextConflictVariants(text: string, mapper: (variant: string) => string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// md.use(rapierMarkdown): Self-contained Markdown in markdown-it, with the reference style's markup.
|
|
3
|
-
|
|
4
|
-
export function rapierMarkdown<T extends
|
|
3
|
+
import type {MarkdownParser} from './marks.mjs';
|
|
4
|
+
export function rapierMarkdown<T extends MarkdownParser>(md: T): T;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
export {};
|
|
3
|
+
export interface MarkdownReference {href: string; title: string}
|
|
4
|
+
/** Plugins may add their own entries; known references retain their concrete shape. */
|
|
5
|
+
export interface MarkdownEnvironment {
|
|
6
|
+
references?: Record<string, MarkdownReference>;
|
|
7
|
+
[name: string | symbol]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface MarkdownToken {
|
|
10
|
+
type: string;
|
|
11
|
+
tag: string;
|
|
12
|
+
nesting: -1 | 0 | 1;
|
|
13
|
+
attrs: [string, string | number][] | null;
|
|
14
|
+
map: [number, number] | null;
|
|
15
|
+
level: number;
|
|
16
|
+
children: MarkdownToken[] | null;
|
|
17
|
+
content: string;
|
|
18
|
+
markup: string;
|
|
19
|
+
info: string;
|
|
20
|
+
meta: Record<string, unknown> | null;
|
|
21
|
+
block: boolean;
|
|
22
|
+
hidden: boolean;
|
|
23
|
+
attrIndex(name: string): number;
|
|
24
|
+
attrPush(attr: [string, string | number]): void;
|
|
25
|
+
attrSet(name: string, value: string | number): void;
|
|
26
|
+
attrGet(name: string): string | number | null;
|
|
27
|
+
attrJoin(name: string, value: string | number): void;
|
|
28
|
+
}
|
|
29
|
+
export interface MarkdownOptions {
|
|
30
|
+
html?: boolean; xhtmlOut?: boolean; breaks?: boolean; langPrefix?: string;
|
|
31
|
+
linkify?: boolean; typographer?: boolean; quotes?: string | string[]; maxNesting?: number;
|
|
32
|
+
highlight?: ((source: string, language: string, attrs: string) => string) | null;
|
|
33
|
+
}
|
|
34
|
+
export interface MarkdownCoreState {
|
|
35
|
+
src: string;
|
|
36
|
+
env: MarkdownEnvironment;
|
|
37
|
+
tokens: MarkdownToken[];
|
|
38
|
+
inlineMode: boolean;
|
|
39
|
+
md: MarkdownParser;
|
|
40
|
+
}
|
|
41
|
+
export interface MarkdownInlineState {
|
|
42
|
+
src: string; env: MarkdownEnvironment; md: MarkdownParser; tokens: MarkdownToken[];
|
|
43
|
+
pos: number; posMax: number; level: number; pending: string; pendingLevel: number;
|
|
44
|
+
push(type: string, tag: string, nesting: -1 | 0 | 1): MarkdownToken;
|
|
45
|
+
pushPending(): MarkdownToken;
|
|
46
|
+
}
|
|
47
|
+
export interface MarkdownBlockState {
|
|
48
|
+
src: string; env: MarkdownEnvironment; md: MarkdownParser; tokens: MarkdownToken[];
|
|
49
|
+
bMarks: number[]; eMarks: number[]; tShift: number[]; sCount: number[]; bsCount: number[];
|
|
50
|
+
blkIndent: number; line: number; lineMax: number; tight: boolean; listIndent: number;
|
|
51
|
+
parentType: string; level: number;
|
|
52
|
+
push(type: string, tag: string, nesting: -1 | 0 | 1): MarkdownToken;
|
|
53
|
+
getLines(begin: number, end: number, indent: number, keepLastLF: boolean): string;
|
|
54
|
+
isEmpty(line: number): boolean;
|
|
55
|
+
}
|
|
56
|
+
// A parser may enrich these states. Rules receive the concrete state of their parser.
|
|
57
|
+
export type MarkdownCoreRule = {run(state: MarkdownCoreState): void}['run'];
|
|
58
|
+
export type MarkdownInlineRule = {run(state: MarkdownInlineState, silent: boolean): boolean}['run'];
|
|
59
|
+
export type MarkdownBlockRule = {run(state: MarkdownBlockState, start: number, end: number, silent: boolean): boolean}['run'];
|
|
60
|
+
export interface MarkdownRuler<Rule> {
|
|
61
|
+
/** Present on markdown-it at runtime; omitted by some upstream declaration versions. */
|
|
62
|
+
__rules__?: {name: string; fn: Rule; enabled: boolean; alt: string[]}[];
|
|
63
|
+
at(name: string, rule: Rule, options?: {alt: string[]}): void;
|
|
64
|
+
before(before: string, name: string, rule: Rule, options?: {alt: string[]}): void;
|
|
65
|
+
after(after: string, name: string, rule: Rule, options?: {alt: string[]}): void;
|
|
66
|
+
push(name: string, rule: Rule, options?: {alt: string[]}): void;
|
|
67
|
+
getRules(chain: string): Rule[];
|
|
68
|
+
}
|
|
69
|
+
export type MarkdownRenderRule = {render(tokens: MarkdownToken[], index: number, options: MarkdownOptions,
|
|
70
|
+
env: MarkdownEnvironment, renderer: MarkdownRenderer): string}['render'];
|
|
71
|
+
export interface MarkdownRenderer {
|
|
72
|
+
rules: Record<string, MarkdownRenderRule | undefined>;
|
|
73
|
+
rapierTransformHtml?(html: string): string;
|
|
74
|
+
renderToken(tokens: MarkdownToken[], index: number, options: MarkdownOptions): string;
|
|
75
|
+
renderInline(tokens: MarkdownToken[], options: MarkdownOptions, env: MarkdownEnvironment): string;
|
|
76
|
+
renderInlineAsText(tokens: MarkdownToken[], options: MarkdownOptions, env: MarkdownEnvironment): string;
|
|
77
|
+
render(tokens: MarkdownToken[], options: MarkdownOptions, env: MarkdownEnvironment): string;
|
|
78
|
+
}
|
|
79
|
+
/** The markdown-it instance hooks used by the portable kit. No parser package is required for these types. */
|
|
80
|
+
export interface MarkdownParser {
|
|
81
|
+
core: {ruler: MarkdownRuler<MarkdownCoreRule>};
|
|
82
|
+
inline: {
|
|
83
|
+
ruler: MarkdownRuler<MarkdownInlineRule>;
|
|
84
|
+
parse(source: string, parser: MarkdownParser, env: MarkdownEnvironment, tokens: MarkdownToken[]): void;
|
|
85
|
+
};
|
|
86
|
+
block: {ruler: MarkdownRuler<MarkdownBlockRule>};
|
|
87
|
+
renderer: MarkdownRenderer;
|
|
88
|
+
options: MarkdownOptions;
|
|
89
|
+
helpers: {
|
|
90
|
+
parseLinkDestination(source: string, start: number, end: number): {ok: boolean; pos: number; str: string};
|
|
91
|
+
parseLinkLabel(state: MarkdownInlineState, start: number, disableNested?: boolean): number;
|
|
92
|
+
};
|
|
93
|
+
utils: {unescapeAll(source: string): string; escapeHtml(source: string): string; normalizeReference(source: string): string};
|
|
94
|
+
validateLink(url: string): boolean;
|
|
95
|
+
normalizeLink(url: string): string;
|
|
96
|
+
parse(source: string, env: MarkdownEnvironment): MarkdownToken[];
|
|
97
|
+
parseInline(source: string, env: MarkdownEnvironment): MarkdownToken[];
|
|
98
|
+
render(source: string, env?: MarkdownEnvironment): string;
|
|
99
|
+
renderInline(source: string, env?: MarkdownEnvironment): string;
|
|
100
|
+
}
|
|
101
|
+
/** Direct parser-internal consumers require markdown-it's runtime state constructor and rule records. */
|
|
102
|
+
export interface MarkdownParserInternals extends MarkdownParser {
|
|
103
|
+
core: {ruler: MarkdownRuler<MarkdownCoreRule> & {__rules__: {name: string; fn: MarkdownCoreRule; enabled: boolean; alt: string[]}[]}};
|
|
104
|
+
inline: MarkdownParser['inline'] & {
|
|
105
|
+
State: new (source: string, parser: MarkdownParser, env: MarkdownEnvironment, tokens: MarkdownToken[]) => MarkdownInlineState;
|
|
106
|
+
ruler: MarkdownRuler<MarkdownInlineRule> & {__rules__: {name: string; fn: MarkdownInlineRule; enabled: boolean; alt: string[]}[]};
|
|
107
|
+
};
|
|
108
|
+
block: {ruler: MarkdownRuler<MarkdownBlockRule> & {__rules__: {name: string; fn: MarkdownBlockRule; enabled: boolean; alt: string[]}[]}};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const TEXT_COLOR_NAMES: Readonly<{
|
|
112
|
+
green: '#1c7547'; red: '#b32034'; blue: '#175dc4'; gold: '#865818'; purple: '#7924d7';
|
|
113
|
+
}>;
|
|
114
|
+
export const PAGE_BREAK_MARKER: '<!--md-break:v1 page-->';
|
|
115
|
+
export interface FontStack {readonly stack: string; readonly css: string; readonly word: string}
|
|
116
|
+
export const FONT_STACKS: Readonly<Record<'sans' | 'serif' | 'mono' | 'system' | 'hand', FontStack>>;
|
|
117
|
+
export interface TypographyFamily {readonly name: string; readonly css: string; readonly custom: boolean}
|
|
118
|
+
export interface TypographySize {
|
|
119
|
+
readonly css: string;
|
|
120
|
+
readonly unit: 'pt' | 'px';
|
|
121
|
+
readonly value: number;
|
|
122
|
+
readonly points: number;
|
|
123
|
+
readonly halfPoints: number;
|
|
124
|
+
}
|
|
125
|
+
export interface TypographyStyle {
|
|
126
|
+
readonly size?: string;
|
|
127
|
+
readonly color?: string;
|
|
128
|
+
readonly family?: TypographyFamily;
|
|
129
|
+
}
|
|
130
|
+
export interface TypographyInput {size?: string; color?: string; family?: string | TypographyFamily}
|
|
131
|
+
export interface TypographyChanges {size?: string | null; color?: string | null; family?: string | TypographyFamily | null}
|
|
132
|
+
export interface NormalizedTypographyChanges {
|
|
133
|
+
readonly size?: string | null;
|
|
134
|
+
readonly color?: string | null;
|
|
135
|
+
readonly family?: TypographyFamily | null;
|
|
136
|
+
}
|
|
137
|
+
export interface TypographySourceRange {start: number; innerStart: number; innerEnd: number; end: number; style: TypographyStyle}
|
|
138
|
+
export interface TypographyRuns {text: string; paint: TypographyStyle[]; leaves: {start: number; end: number; blocked: boolean}[]}
|
|
139
|
+
export interface TypographyGrammar {
|
|
140
|
+
normalizeFontFamily(value: unknown): string | null;
|
|
141
|
+
fontFamilyCss(value: unknown): string;
|
|
142
|
+
FONT_STACKS: Readonly<Record<string, FontStack>>;
|
|
143
|
+
}
|
|
144
|
+
export interface InlineTypography {
|
|
145
|
+
size(value: unknown): TypographySize | null;
|
|
146
|
+
color(value: unknown): string | null;
|
|
147
|
+
family(value: unknown): TypographyFamily | null;
|
|
148
|
+
familyCss(value: unknown): TypographyFamily | null;
|
|
149
|
+
normalize(value: TypographyInput, removals?: false): TypographyStyle;
|
|
150
|
+
normalize(value: TypographyChanges, removals: true): NormalizedTypographyChanges;
|
|
151
|
+
normalize(value: TypographyInput, removals: boolean): TypographyStyle;
|
|
152
|
+
parseStyle(value: unknown, editable?: false): TypographyStyle;
|
|
153
|
+
parseStyle(value: unknown, editable: boolean): TypographyStyle | null;
|
|
154
|
+
style(value: TypographyInput): string;
|
|
155
|
+
open(value: TypographyInput): string;
|
|
156
|
+
wrap(value: TypographyInput, content: string): string;
|
|
157
|
+
parseOpen(source: string, decode?: (source: string) => string, editable?: boolean): TypographyStyle | null;
|
|
158
|
+
nodeStyle(node: Pick<Element, 'getAttribute'> | null | undefined): TypographyStyle;
|
|
159
|
+
runs(root: Node): TypographyRuns;
|
|
160
|
+
install<P extends MarkdownParser>(parser: P): P;
|
|
161
|
+
}
|
|
162
|
+
export function normalizeFontFamily(value: unknown): string | null;
|
|
163
|
+
export function fontFamilyCss(value: unknown): string;
|
|
164
|
+
export function formatFontRun(family: string, content: string): string;
|
|
165
|
+
export function formatColorRun(hex: string, content: string): string;
|
|
166
|
+
/** This factory configures inline source typography, not DOM paragraph refinement. */
|
|
167
|
+
export function createTypography(grammar: TypographyGrammar): Readonly<InlineTypography>;
|
|
168
|
+
export const typography: Readonly<InlineTypography>;
|
|
169
|
+
export function typographySourceRanges(source: string, parser: MarkdownParser): TypographySourceRange[];
|
|
170
|
+
|
|
171
|
+
export type InkKind = 'under' | 'strike' | 'ring' | 'bracket' | 'free' | 'arrow' | 'end';
|
|
172
|
+
export const INK_KINDS: readonly ['under', 'strike', 'ring', 'bracket', 'free', 'arrow', 'end'];
|
|
173
|
+
export const INK_CLOSE: '<!--/ink-->';
|
|
174
|
+
export const INK_PATH_MAX: 160;
|
|
175
|
+
export const INK_INT_MAX: 999999;
|
|
176
|
+
export const INK_OPEN_PATTERN: string;
|
|
177
|
+
export type InkPoint = readonly [number, number];
|
|
178
|
+
interface InkStroke {
|
|
179
|
+
hex?: string | null;
|
|
180
|
+
width?: number | null;
|
|
181
|
+
box?: InkPoint | null;
|
|
182
|
+
at?: InkPoint | null;
|
|
183
|
+
}
|
|
184
|
+
export type InkInput =
|
|
185
|
+
| (InkStroke & {kind: 'under' | 'strike'; id?: never; path?: readonly InkPoint[] | null})
|
|
186
|
+
| (InkStroke & {kind: 'ring' | 'bracket' | 'free'; id?: never; path: readonly [InkPoint, ...InkPoint[]]})
|
|
187
|
+
| (InkStroke & {kind: 'arrow'; id: number; path?: readonly InkPoint[] | null})
|
|
188
|
+
| {kind: 'end'; id: number; hex?: null; width?: null; box?: null; at?: null; path?: readonly [] | null};
|
|
189
|
+
interface ParsedInkStroke {
|
|
190
|
+
readonly hex: string | null;
|
|
191
|
+
readonly width?: number;
|
|
192
|
+
readonly box: [number, number] | null;
|
|
193
|
+
readonly at: [number, number] | null;
|
|
194
|
+
}
|
|
195
|
+
export type ParsedInk =
|
|
196
|
+
| (ParsedInkStroke & {readonly kind: 'under' | 'strike'; readonly id?: never; readonly path: [number, number][]})
|
|
197
|
+
| (ParsedInkStroke & {readonly kind: 'ring' | 'bracket' | 'free'; readonly id?: never; readonly path: [[number, number], ...[number, number][]]})
|
|
198
|
+
| (ParsedInkStroke & {readonly kind: 'arrow'; readonly id: number; readonly path: [number, number][]})
|
|
199
|
+
| {readonly kind: 'end'; readonly id: number; readonly hex: null; readonly width?: never;
|
|
200
|
+
readonly box: null; readonly at: null; readonly path: []};
|
|
201
|
+
export function readInkMatch(match: RegExpMatchArray): Readonly<ParsedInk> | null;
|
|
202
|
+
export function parseInkOpen(comment: string): Readonly<ParsedInk> | null;
|
|
203
|
+
export function parseInkBody(body: string): Readonly<ParsedInk> | null;
|
|
204
|
+
export function formatInkOpen(mark: InkInput): string;
|
|
205
|
+
export function formatInkRun(mark: InkInput, content: string): string;
|
|
206
|
+
export function matchInkOpen(text: string): {mark: Readonly<ParsedInk>; length: number} | null;
|
|
207
|
+
export function inkOpenBody(opener: string): string | null;
|
|
208
|
+
export function formatInkOpenFromBody(body: string): string | null;
|
|
209
|
+
export function isInkClose(comment: unknown): boolean;
|
|
210
|
+
export interface InkSourceView {
|
|
211
|
+
readonly length: number;
|
|
212
|
+
contains(value: string): boolean;
|
|
213
|
+
readSlice(start: number, end: number): string;
|
|
214
|
+
}
|
|
215
|
+
export interface InkEdit {pos: number; removed: string; inserted: string}
|
|
216
|
+
export function mayRetireInk(source: InkSourceView, rows: readonly InkEdit[]): boolean;
|
|
217
|
+
export type InkMarker =
|
|
218
|
+
| {start: number; end: number; mark: Readonly<ParsedInk>; close: false}
|
|
219
|
+
| {start: number; end: number; mark: null; close: true; arrowId?: number};
|
|
220
|
+
export interface InkRun {start: number; end: number; innerStart: number; innerEnd: number; mark: Readonly<ParsedInk>}
|
|
221
|
+
export interface InkSpanPairs {runs: InkRun[]; strays: InkMarker[]}
|
|
222
|
+
export interface InkArrow {
|
|
223
|
+
id: number;
|
|
224
|
+
tail: Omit<InkRun, 'mark'> & {mark: Extract<ParsedInk, {kind: 'arrow'}>};
|
|
225
|
+
head: Omit<InkRun, 'mark'> & {mark: Extract<ParsedInk, {kind: 'end'}>};
|
|
226
|
+
}
|
|
227
|
+
export interface InkPairs extends InkSpanPairs {arrows: InkArrow[]}
|
|
228
|
+
export function scanInkMarkers(source: string): InkMarker[];
|
|
229
|
+
export function pairInkMarkers(source: string, markers?: readonly InkMarker[] | null): InkPairs;
|
|
230
|
+
export function pairInkSpans(source: string, markers?: readonly InkMarker[] | null): InkSpanPairs;
|
|
231
|
+
export function pairMarkers(source: string, kind: 'ink', markers?: readonly InkMarker[] | null): InkPairs;
|
|
232
|
+
export function quotedWillSpan(source: string, spans: readonly (readonly [number, number])[]): {
|
|
233
|
+
start: number; end: number; where: 'fence' | 'raw-pre' | 'raw-div' | 'raw-table' | 'raw-html' | 'frontmatter';
|
|
234
|
+
} | null;
|
|
235
|
+
export function sliceInkArrows(source: string, start?: number, end?: number, markers?: readonly InkMarker[] | null): string;
|
|
236
|
+
export function prepareInkPaste(source: string, existing?: string, markers?: readonly InkMarker[] | null): string;
|
|
237
|
+
export function stripInkMarkers(text: string): string;
|
|
238
|
+
export function hasInkMarker(text: string): boolean;
|
|
239
|
+
export function formatPageBreak(): typeof PAGE_BREAK_MARKER;
|
|
240
|
+
export function isPageBreakLine(text: unknown): boolean;
|
|
241
|
+
export function isPageBreakBlock(text: unknown): boolean;
|
package/dist/kit/marks.mjs
CHANGED
|
@@ -1,2 +1,40 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
|
-
export
|
|
2
|
+
export {
|
|
3
|
+
FONT_STACKS,
|
|
4
|
+
INK_CLOSE,
|
|
5
|
+
INK_INT_MAX,
|
|
6
|
+
INK_KINDS,
|
|
7
|
+
INK_OPEN_PATTERN,
|
|
8
|
+
INK_PATH_MAX,
|
|
9
|
+
PAGE_BREAK_MARKER,
|
|
10
|
+
TEXT_COLOR_NAMES,
|
|
11
|
+
createTypography,
|
|
12
|
+
fontFamilyCss,
|
|
13
|
+
formatColorRun,
|
|
14
|
+
formatFontRun,
|
|
15
|
+
formatInkOpen,
|
|
16
|
+
formatInkOpenFromBody,
|
|
17
|
+
formatInkRun,
|
|
18
|
+
formatPageBreak,
|
|
19
|
+
hasInkMarker,
|
|
20
|
+
inkOpenBody,
|
|
21
|
+
isInkClose,
|
|
22
|
+
isPageBreakBlock,
|
|
23
|
+
isPageBreakLine,
|
|
24
|
+
matchInkOpen,
|
|
25
|
+
mayRetireInk,
|
|
26
|
+
normalizeFontFamily,
|
|
27
|
+
pairInkMarkers,
|
|
28
|
+
pairInkSpans,
|
|
29
|
+
pairMarkers,
|
|
30
|
+
parseInkBody,
|
|
31
|
+
parseInkOpen,
|
|
32
|
+
prepareInkPaste,
|
|
33
|
+
quotedWillSpan,
|
|
34
|
+
readInkMatch,
|
|
35
|
+
scanInkMarkers,
|
|
36
|
+
sliceInkArrows,
|
|
37
|
+
stripInkMarkers,
|
|
38
|
+
typography,
|
|
39
|
+
typographySourceRanges
|
|
40
|
+
} from '../spec/md-marks.mjs';
|