foldkit-richtext 0.5.3 → 0.7.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/clipboard.d.ts +224 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +208 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/code.d.ts +27 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +45 -0
- package/dist/code.js.map +1 -0
- package/dist/command.d.ts +300 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +1438 -0
- package/dist/command.js.map +1 -0
- package/dist/decoration.d.ts +44 -0
- package/dist/decoration.d.ts.map +1 -0
- package/dist/decoration.js +96 -0
- package/dist/decoration.js.map +1 -0
- package/dist/document.d.ts +1045 -0
- package/dist/document.d.ts.map +1 -0
- package/dist/document.js +544 -0
- package/dist/document.js.map +1 -0
- package/dist/footnote.d.ts +35 -0
- package/dist/footnote.d.ts.map +1 -0
- package/dist/footnote.js +100 -0
- package/dist/footnote.js.map +1 -0
- package/dist/history.d.ts +470 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +81 -0
- package/dist/history.js.map +1 -0
- package/dist/html.d.ts +27 -0
- package/dist/html.d.ts.map +1 -0
- package/dist/html.js +99 -0
- package/dist/html.js.map +1 -0
- package/dist/indent.d.ts +16 -0
- package/dist/indent.d.ts.map +1 -0
- package/dist/indent.js +101 -0
- package/dist/indent.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/input.d.ts +54 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +37 -0
- package/dist/input.js.map +1 -0
- package/dist/kit.d.ts +179 -0
- package/dist/kit.d.ts.map +1 -0
- package/dist/kit.js +202 -0
- package/dist/kit.js.map +1 -0
- package/dist/marks.d.ts +79 -0
- package/dist/marks.d.ts.map +1 -0
- package/dist/marks.js +127 -0
- package/dist/marks.js.map +1 -0
- package/dist/media.d.ts +30 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +148 -0
- package/dist/media.js.map +1 -0
- package/dist/migration.d.ts +55 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +124 -0
- package/dist/migration.js.map +1 -0
- package/dist/outline.d.ts +15 -0
- package/dist/outline.d.ts.map +1 -0
- package/dist/outline.js +39 -0
- package/dist/outline.js.map +1 -0
- package/dist/rendering.d.ts +96 -0
- package/dist/rendering.d.ts.map +1 -0
- package/dist/rendering.js +106 -0
- package/dist/rendering.js.map +1 -0
- package/dist/replicated.d.ts +340 -0
- package/dist/replicated.d.ts.map +1 -0
- package/dist/replicated.js +1727 -0
- package/dist/replicated.js.map +1 -0
- package/dist/search.d.ts +28 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +61 -0
- package/dist/search.js.map +1 -0
- package/dist/standard.d.ts +61 -0
- package/dist/standard.d.ts.map +1 -0
- package/dist/standard.js +231 -0
- package/dist/standard.js.map +1 -0
- package/dist/table.d.ts +38 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +160 -0
- package/dist/table.js.map +1 -0
- package/dist/transaction.d.ts +712 -0
- package/dist/transaction.d.ts.map +1 -0
- package/dist/transaction.js +993 -0
- package/dist/transaction.js.map +1 -0
- package/dist/transform.d.ts +48 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/transform.js +94 -0
- package/dist/transform.js.map +1 -0
- package/dist/url.d.ts +16 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/url.js +32 -0
- package/dist/url.js.map +1 -0
- package/package.json +7 -7
- package/dist/index.d.mts +0 -3787
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -6688
- package/dist/index.mjs.map +0 -1
- package/dist/rolldown-runtime-D8jQpDG7.mjs +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendering.js","names":[],"sources":["../src/rendering.ts"],"sourcesContent":["import type { NodeBlock, RunMark, Text } from './document.js'\nimport { markName } from './marks.js'\n\n/**\n * How an element is rendered: a tag and its attributes. Data, not a view (§121),\n * so the DOM-free serializer writes it and the DOM interpreters build it without\n * the core learning about Foldkit or the DOM.\n */\nexport interface ElementRendering {\n readonly tag: string\n /** Values are escaped when written; a name that would end the markup is refused. */\n readonly attributes: Readonly<Record<string, string>>\n /**\n * An element the nested blocks go inside, where HTML's parser would insert one anyway: a\n * `table`'s rows go in a `tbody`. Without it, markup sent from a server parses to a tree\n * the renderer did not write, and Foldkit refuses to serialize it.\n */\n readonly inner?: string | undefined\n /**\n * Elements drawn inside the block before its content that are not content: a task's\n * checkbox, an image's picture and caption, a callout's icon. They hold no position, are\n * never edited as text, and an HTML import skips them, so a block's text stays its runs'.\n */\n readonly adornments?: ReadonlyArray<Adornment> | undefined\n}\n\n/**\n * One element of a block's adornments. `toggles` names a boolean prop of the block that a click\n * on the element flips, through the editor's own Message (a task's `checked`, a toggle's\n * `open`), so the document stays the one place that state lives. `action` names something a\n * click on it asks the application for that is not an edit, a code block's Copy or its language\n * menu: the editor reports it, with the block, and changes nothing.\n */\nexport interface Adornment {\n readonly tag: string\n readonly attributes: Readonly<Record<string, string>>\n readonly text?: string | undefined\n readonly toggles?: string | undefined\n readonly action?: string | undefined\n}\n\n/** The attribute that marks an element as an adornment, which every interpreter skips as content. */\nexport const ADORNMENT_ATTRIBUTE = 'data-adornment'\n/** The attribute naming the prop an adornment's click flips. */\nexport const TOGGLES_ATTRIBUTE = 'data-toggles'\n/** The attribute naming what an adornment's click asks the application for. */\nexport const ACTION_ATTRIBUTE = 'data-action'\n\n/** An adornment's attributes as every interpreter writes them: its own, then the markers. */\nexport const adornmentAttributes = (\n adornment: Adornment,\n): ReadonlyArray<readonly [string, string]> => [\n ...Object.entries(adornment.attributes).filter(\n ([name]) =>\n name !== ADORNMENT_ATTRIBUTE && name !== TOGGLES_ATTRIBUTE && name !== ACTION_ATTRIBUTE,\n ),\n [ADORNMENT_ATTRIBUTE, ''],\n ...(adornment.toggles === undefined ? [] : [[TOGGLES_ATTRIBUTE, adornment.toggles] as const]),\n ...(adornment.action === undefined ? [] : [[ACTION_ATTRIBUTE, adornment.action] as const]),\n]\n\n/** Whether two renderings draw the same element: tag, attributes, holder and adornments. */\nexport const sameElementRendering = (left: ElementRendering, right: ElementRendering): boolean =>\n left.tag === right.tag &&\n left.inner === right.inner &&\n sameRecord(left.attributes, right.attributes) &&\n (left.adornments ?? []).length === (right.adornments ?? []).length &&\n (left.adornments ?? []).every((adornment, at) => {\n const other = right.adornments![at]!\n return (\n adornment.tag === other.tag &&\n adornment.text === other.text &&\n adornment.toggles === other.toggles &&\n adornment.action === other.action &&\n sameRecord(adornment.attributes, other.attributes)\n )\n })\n\nconst sameRecord = (\n left: Readonly<Record<string, string>>,\n right: Readonly<Record<string, string>>,\n): boolean => {\n const names = Object.keys(left)\n return (\n names.length === Object.keys(right).length &&\n names.every(name => Object.hasOwn(right, name) && left[name] === right[name])\n )\n}\n\n/**\n * A rendering entry: fixed data, or computed from the value being rendered, which\n * is how a mark's attributes reach its props. `undefined` means the entry does not\n * apply, so the name falls back the way an entry-less name does.\n */\nexport type RenderingEntry<Value> =\n | ElementRendering\n | ((value: Value) => ElementRendering | undefined)\n\n/**\n * A vocabulary of renderings built *over* a Kit, never inside it (§34, §121). A\n * name with no entry renders the shipped way: its mark nests in `strong`, `em`, or\n * `code`, an application node keeps its default element, and any other name rides\n * on `data-marks` — which is what keeps the slice format and an HTML round trip\n * lossless rather than lossy.\n */\nexport interface Rendering {\n readonly marks: Readonly<Record<string, RenderingEntry<RunMark>>>\n readonly nodes: Readonly<Record<string, RenderingEntry<NodeBlock>>>\n}\n\n/** The nesting the shipped marks get, innermost first. */\nconst BUILT_IN_MARK_TAGS: ReadonlyArray<readonly [string, string]> = [\n ['Bold', 'strong'],\n ['Italic', 'em'],\n ['Code', 'code'],\n]\n\n/**\n * Own-property lookup: a mark or node name is document content, so a plain or\n * hand-built `Rendering` must not let `__proto__` resolve to a prototype.\n */\nconst entryFor = <Value>(\n entries: Readonly<Record<string, RenderingEntry<Value>>>,\n name: string,\n): RenderingEntry<Value> | undefined => (Object.hasOwn(entries, name) ? entries[name] : undefined)\n\nconst resolve = <Value>(\n entry: RenderingEntry<Value>,\n value: Value,\n): ElementRendering | undefined => (typeof entry === 'function' ? entry(value) : entry)\n\n/** A name's own entry map, with no prototype for a content-chosen name to reach. */\nconst entryMap = <Value>(\n entries: Readonly<Record<string, RenderingEntry<Value>>> | undefined,\n): Readonly<Record<string, RenderingEntry<Value>>> => {\n const map: Record<string, RenderingEntry<Value>> = Object.create(null)\n for (const [name, entry] of Object.entries(entries ?? {})) map[name] = entry\n return Object.freeze(map)\n}\n\nexport const rendering = (\n definition: {\n readonly marks?: Readonly<Record<string, RenderingEntry<RunMark>>>\n readonly nodes?: Readonly<Record<string, RenderingEntry<NodeBlock>>>\n } = {},\n): Rendering =>\n Object.freeze({ marks: entryMap(definition.marks), nodes: entryMap(definition.nodes) })\n\n/** The behaviour without a renderer: shipped tags for shipped marks, names otherwise. */\nexport const noRendering: Rendering = rendering()\n\n/**\n * A registry built over another: an entry named here wins, and every name the base\n * renders keeps its entry, so an application extends a vocabulary like the standard one\n * without restating it.\n */\nexport const renderingOver = (\n base: Rendering,\n definition: {\n readonly marks?: Readonly<Record<string, RenderingEntry<RunMark>>>\n readonly nodes?: Readonly<Record<string, RenderingEntry<NodeBlock>>>\n } = {},\n): Rendering =>\n rendering({\n marks: { ...base.marks, ...definition.marks },\n nodes: { ...base.nodes, ...definition.nodes },\n })\n\n/** What a run's marks nest in, and which names nest nowhere. */\nexport interface RunRendering {\n /** Elements to wrap the run's text in, innermost first. */\n readonly nest: ReadonlyArray<ElementRendering>\n /** Names with neither an entry nor a shipped tag, sorted so output is stable. */\n readonly unrendered: ReadonlyArray<string>\n}\n\nconst byName = (left: string, right: string): number => (left < right ? -1 : left > right ? 1 : 0)\n\n/**\n * Resolves a run's marks to elements. Order is the vocabulary's, then names\n * alphabetically, never the order marks happen to be stored in — the same set of\n * marks must serialize the same way however it was assembled. An entry for a\n * shipped name replaces that name's tag but keeps its place in the nesting.\n */\nexport const runRendering = (definition: Rendering, run: Text): RunRendering => {\n const nest: Array<ElementRendering> = []\n const unrendered: Array<string> = []\n for (const [name, tag] of BUILT_IN_MARK_TAGS) {\n const mark = run.marks.find(candidate => markName(candidate) === name)\n if (mark === undefined) continue\n const entry = entryFor(definition.marks, name)\n nest.push(\n entry === undefined\n ? { tag, attributes: {} }\n : (resolve(entry, mark) ?? { tag, attributes: {} }),\n )\n }\n const others = run.marks\n .filter(mark => !BUILT_IN_MARK_TAGS.some(([name]) => name === markName(mark)))\n .sort((left, right) => byName(markName(left), markName(right)))\n for (const mark of others) {\n const name = markName(mark)\n const entry = entryFor(definition.marks, name)\n const element = entry === undefined ? undefined : resolve(entry, mark)\n if (element === undefined) unrendered.push(name)\n else nest.push(element)\n }\n return { nest, unrendered }\n}\n\n/** The element a node kind renders as, or undefined when no entry applies. */\nexport const nodeRendering = (\n definition: Rendering,\n block: NodeBlock,\n): ElementRendering | undefined => {\n const entry = entryFor(definition.nodes, block.kind)\n return entry === undefined ? undefined : resolve(entry, block)\n}\n"],"mappings":";;;AA0CA,MAAa,sBAAsB;;AAEnC,MAAa,oBAAoB;;AAEjC,MAAa,mBAAmB;;AAGhC,MAAa,uBACX,cAC6C;CAC7C,GAAG,OAAO,QAAQ,UAAU,UAAU,CAAC,CAAC,QACrC,CAAC,UACA,SAAA,oBAAgC,SAAA,kBAA8B,SAAA,aAClE;CACA,CAAC,qBAAqB,EAAE;CACxB,GAAI,UAAU,YAAY,KAAA,IAAY,CAAC,IAAI,CAAC,CAAC,mBAAmB,UAAU,OAAO,CAAU;CAC3F,GAAI,UAAU,WAAW,KAAA,IAAY,CAAC,IAAI,CAAC,CAAC,kBAAkB,UAAU,MAAM,CAAU;AAC1F;;AAGA,MAAa,wBAAwB,MAAwB,UAC3D,KAAK,QAAQ,MAAM,OACnB,KAAK,UAAU,MAAM,SACrB,WAAW,KAAK,YAA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|
|
2
|
+
import { Document, Selection } from "./document.js";
|
|
3
|
+
import { TransactionResult } from "./transaction.js";
|
|
4
|
+
/**
|
|
5
|
+
* A document shared by several replicas, where every character has an identity that
|
|
6
|
+
* outlives the edits around it.
|
|
7
|
+
*
|
|
8
|
+
* The editor keeps working on a plain `Document`: `project` derives one from this state.
|
|
9
|
+
* An edit runs as an ordinary command against that projection, `translate` restates the
|
|
10
|
+
* transactions it applied as `ReplicatedOp`s that name characters and blocks rather than
|
|
11
|
+
* offsets and indices, and `applyOps` folds those ops into the state. Replicas converge
|
|
12
|
+
* because a server gives every op one order and `applyOps` is a deterministic, total
|
|
13
|
+
* function of the state and the ops: it never throws.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* An identity this state minted: segments joined by `:`, at least two of them. The colon
|
|
17
|
+
* keeps an id from ever naming an `Object.prototype` key, which is why the block record is
|
|
18
|
+
* indexed directly, and the absent `.` is what separates an id from a character reference
|
|
19
|
+
* built on it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ReplicatedId: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
22
|
+
export type ReplicatedId = typeof ReplicatedId.Type;
|
|
23
|
+
/** A character: the insert that created it, and its index within that insert's text. */
|
|
24
|
+
export declare const CharRef: Schema.brand<Schema.String, "foldkit-richtext/CharRef">;
|
|
25
|
+
export type CharRef = typeof CharRef.Type;
|
|
26
|
+
/** Characters `from` up to, not including, `to` of one insert. */
|
|
27
|
+
export declare const CharRange: Schema.Struct<{
|
|
28
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
29
|
+
readonly from: Schema.Number;
|
|
30
|
+
readonly to: Schema.Number;
|
|
31
|
+
}>;
|
|
32
|
+
export type CharRange = typeof CharRange.Type;
|
|
33
|
+
/** What a block is, apart from its content and place. */
|
|
34
|
+
export declare const BlockShape: Schema.Union<readonly [Schema.Struct<{
|
|
35
|
+
readonly type: Schema.Literal<"Paragraph">;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly type: Schema.Literal<"Heading">;
|
|
38
|
+
readonly level: Schema.Literals<readonly [1, 2, 3, 4, 5, 6]>;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly type: Schema.Literal<"Node">;
|
|
41
|
+
readonly kind: Schema.NonEmptyString;
|
|
42
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
43
|
+
/** What the node holds: runs, nested blocks, or nothing (an atom such as an image). */
|
|
44
|
+
readonly holds: Schema.Literals<readonly ["text", "blocks", "none"]>;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly type: Schema.Literal<"Unknown">;
|
|
47
|
+
readonly originalType: Schema.NonEmptyString;
|
|
48
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
49
|
+
}>]>;
|
|
50
|
+
export type BlockShape = typeof BlockShape.Type;
|
|
51
|
+
export declare const ReplicatedState: Schema.Struct<{
|
|
52
|
+
readonly version: Schema.Literal<1>;
|
|
53
|
+
readonly root: Schema.$Array<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
54
|
+
readonly blocks: Schema.$Record<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">, Schema.Struct<{
|
|
55
|
+
readonly shape: Schema.Union<readonly [Schema.Struct<{
|
|
56
|
+
readonly type: Schema.Literal<"Paragraph">;
|
|
57
|
+
}>, Schema.Struct<{
|
|
58
|
+
readonly type: Schema.Literal<"Heading">;
|
|
59
|
+
readonly level: Schema.Literals<readonly [1, 2, 3, 4, 5, 6]>;
|
|
60
|
+
}>, Schema.Struct<{
|
|
61
|
+
readonly type: Schema.Literal<"Node">;
|
|
62
|
+
readonly kind: Schema.NonEmptyString;
|
|
63
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
64
|
+
/** What the node holds: runs, nested blocks, or nothing (an atom such as an image). */
|
|
65
|
+
readonly holds: Schema.Literals<readonly ["text", "blocks", "none"]>;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly type: Schema.Literal<"Unknown">;
|
|
68
|
+
readonly originalType: Schema.NonEmptyString;
|
|
69
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
70
|
+
}>]>;
|
|
71
|
+
readonly parent: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
72
|
+
readonly spans: Schema.$Array<Schema.Struct<{
|
|
73
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
74
|
+
readonly offset: Schema.Number;
|
|
75
|
+
readonly text: Schema.NonEmptyString;
|
|
76
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
77
|
+
readonly name: Schema.NonEmptyString;
|
|
78
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
79
|
+
}>]>>;
|
|
80
|
+
readonly deleted: Schema.Boolean;
|
|
81
|
+
/** Deleted when a `Collect` ran, so the next one removes it. */
|
|
82
|
+
readonly swept: Schema.optionalKey<Schema.Boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* The last character of a collected stretch, kept only so its insert's indexes are never
|
|
85
|
+
* reused. It is never shown again, not even by an undo.
|
|
86
|
+
*/
|
|
87
|
+
readonly kept: Schema.optionalKey<Schema.Literal<true>>;
|
|
88
|
+
}>>;
|
|
89
|
+
/** Nested blocks in order, deleted ones included, so a sibling anchor still resolves. */
|
|
90
|
+
readonly children: Schema.$Array<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
91
|
+
readonly deleted: Schema.Boolean;
|
|
92
|
+
/** Deleted when a `Collect` ran, so the next one removes the text it holds. */
|
|
93
|
+
readonly swept: Schema.optionalKey<Schema.Boolean>;
|
|
94
|
+
/** Where a joined block's start now is: after this character of `into`, or its start. */
|
|
95
|
+
readonly joined: Schema.optionalKey<Schema.Struct<{
|
|
96
|
+
readonly into: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
97
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
98
|
+
}>>;
|
|
99
|
+
}>>;
|
|
100
|
+
}>;
|
|
101
|
+
export type ReplicatedState = typeof ReplicatedState.Type;
|
|
102
|
+
/**
|
|
103
|
+
* One change, naming what it touches by identity. Inserts and splits anchor after a
|
|
104
|
+
* character, or at a block's start when `after` is null; block ops anchor after a sibling,
|
|
105
|
+
* or at the start of the container when `after` is null.
|
|
106
|
+
*/
|
|
107
|
+
export declare const ReplicatedOp: Schema.Union<readonly [Schema.Struct<{
|
|
108
|
+
readonly type: Schema.Literal<"Insert">;
|
|
109
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
110
|
+
/** The block the anchor was in when the op was made: where a lost anchor falls back to. */
|
|
111
|
+
readonly block: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
112
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
113
|
+
readonly text: Schema.NonEmptyString;
|
|
114
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
115
|
+
readonly name: Schema.NonEmptyString;
|
|
116
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
117
|
+
}>]>>;
|
|
118
|
+
/**
|
|
119
|
+
* The index of its first character, when it continues an insert of the same id rather
|
|
120
|
+
* than starting one: `id.from` onwards. Absent means 0.
|
|
121
|
+
*/
|
|
122
|
+
readonly from: Schema.optionalKey<Schema.Number>;
|
|
123
|
+
}>, Schema.Struct<{
|
|
124
|
+
readonly type: Schema.Literal<"Delete">;
|
|
125
|
+
readonly ranges: Schema.$Array<Schema.Struct<{
|
|
126
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
127
|
+
readonly from: Schema.Number;
|
|
128
|
+
readonly to: Schema.Number;
|
|
129
|
+
}>>;
|
|
130
|
+
}>, Schema.Struct<{
|
|
131
|
+
readonly type: Schema.Literal<"Mark">;
|
|
132
|
+
readonly ranges: Schema.$Array<Schema.Struct<{
|
|
133
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
134
|
+
readonly from: Schema.Number;
|
|
135
|
+
readonly to: Schema.Number;
|
|
136
|
+
}>>;
|
|
137
|
+
readonly mark: Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
138
|
+
readonly name: Schema.NonEmptyString;
|
|
139
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
140
|
+
}>]>;
|
|
141
|
+
}>, Schema.Struct<{
|
|
142
|
+
readonly type: Schema.Literal<"Unmark">;
|
|
143
|
+
readonly ranges: Schema.$Array<Schema.Struct<{
|
|
144
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
145
|
+
readonly from: Schema.Number;
|
|
146
|
+
readonly to: Schema.Number;
|
|
147
|
+
}>>;
|
|
148
|
+
readonly name: Schema.NonEmptyString;
|
|
149
|
+
}>, Schema.Struct<{
|
|
150
|
+
readonly type: Schema.Literal<"InsertBlock">;
|
|
151
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
152
|
+
readonly shape: Schema.Union<readonly [Schema.Struct<{
|
|
153
|
+
readonly type: Schema.Literal<"Paragraph">;
|
|
154
|
+
}>, Schema.Struct<{
|
|
155
|
+
readonly type: Schema.Literal<"Heading">;
|
|
156
|
+
readonly level: Schema.Literals<readonly [1, 2, 3, 4, 5, 6]>;
|
|
157
|
+
}>, Schema.Struct<{
|
|
158
|
+
readonly type: Schema.Literal<"Node">;
|
|
159
|
+
readonly kind: Schema.NonEmptyString;
|
|
160
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
161
|
+
/** What the node holds: runs, nested blocks, or nothing (an atom such as an image). */
|
|
162
|
+
readonly holds: Schema.Literals<readonly ["text", "blocks", "none"]>;
|
|
163
|
+
}>, Schema.Struct<{
|
|
164
|
+
readonly type: Schema.Literal<"Unknown">;
|
|
165
|
+
readonly originalType: Schema.NonEmptyString;
|
|
166
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
167
|
+
}>]>;
|
|
168
|
+
readonly parent: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
169
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
170
|
+
}>, Schema.Struct<{
|
|
171
|
+
readonly type: Schema.Literal<"DeleteBlock">;
|
|
172
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
173
|
+
}>, Schema.Struct<{
|
|
174
|
+
readonly type: Schema.Literal<"MoveBlock">;
|
|
175
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
176
|
+
readonly parent: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
177
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
178
|
+
}>, Schema.Struct<{
|
|
179
|
+
readonly type: Schema.Literal<"Split">;
|
|
180
|
+
readonly block: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
181
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
182
|
+
readonly into: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
183
|
+
}>, Schema.Struct<{
|
|
184
|
+
readonly type: Schema.Literal<"Join">;
|
|
185
|
+
readonly into: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
186
|
+
readonly removed: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
187
|
+
/**
|
|
188
|
+
* The last character of `into` when the op was made, or null when it had none: the
|
|
189
|
+
* removed block's text goes right after it, wherever it has gone since, so a join still
|
|
190
|
+
* lands where it was made after `into` is split or joined itself.
|
|
191
|
+
*/
|
|
192
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
193
|
+
/**
|
|
194
|
+
* `'end'` puts the text at the end of the block holding `after` (of `into` when null) as
|
|
195
|
+
* that block is when the join applies, so text typed at its end since stays before it.
|
|
196
|
+
* Only undo makes it: rejoining halves someone has typed into since.
|
|
197
|
+
*/
|
|
198
|
+
readonly at: Schema.optionalKey<Schema.Literal<"end">>;
|
|
199
|
+
}>, Schema.Struct<{
|
|
200
|
+
readonly type: Schema.Literal<"Retype">;
|
|
201
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
202
|
+
readonly to: Schema.Union<readonly [Schema.Struct<{
|
|
203
|
+
readonly type: Schema.Literal<"Paragraph">;
|
|
204
|
+
}>, Schema.Struct<{
|
|
205
|
+
readonly type: Schema.Literal<"Heading">;
|
|
206
|
+
readonly level: Schema.Literals<readonly [1, 2, 3, 4, 5, 6]>;
|
|
207
|
+
}>, Schema.Struct<{
|
|
208
|
+
readonly type: Schema.Literal<"Node">;
|
|
209
|
+
readonly kind: Schema.NonEmptyString;
|
|
210
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
211
|
+
}>]>;
|
|
212
|
+
}>, Schema.Struct<{
|
|
213
|
+
readonly type: Schema.Literal<"SetProps">;
|
|
214
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
215
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
216
|
+
}>, Schema.Struct<{
|
|
217
|
+
readonly type: Schema.Literal<"Undelete">;
|
|
218
|
+
readonly ranges: Schema.$Array<Schema.Struct<{
|
|
219
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
220
|
+
readonly from: Schema.Number;
|
|
221
|
+
readonly to: Schema.Number;
|
|
222
|
+
}>>;
|
|
223
|
+
}>, Schema.Struct<{
|
|
224
|
+
readonly type: Schema.Literal<"UndeleteBlock">;
|
|
225
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
226
|
+
}>, Schema.Struct<{
|
|
227
|
+
readonly type: Schema.Literal<"Unjoin">;
|
|
228
|
+
/** The block a join removed, restored where it stood. */
|
|
229
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
230
|
+
/** The characters it held, taken back from wherever they are now. */
|
|
231
|
+
readonly ranges: Schema.$Array<Schema.Struct<{
|
|
232
|
+
readonly id: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
233
|
+
readonly from: Schema.Number;
|
|
234
|
+
readonly to: Schema.Number;
|
|
235
|
+
}>>;
|
|
236
|
+
/** The nested blocks it held, taken back from the container they were joined into. */
|
|
237
|
+
readonly children: Schema.$Array<Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">>;
|
|
238
|
+
}>, Schema.Struct<{
|
|
239
|
+
readonly type: Schema.Literal<"Collect">;
|
|
240
|
+
}>]>;
|
|
241
|
+
export type ReplicatedOp = typeof ReplicatedOp.Type;
|
|
242
|
+
export declare const empty: ReplicatedState;
|
|
243
|
+
/**
|
|
244
|
+
* Folds ops into the state in order. Total: an op whose target is gone, whose ids are
|
|
245
|
+
* already taken, or that would make the tree cyclic changes nothing, and an insert or split
|
|
246
|
+
* anchored on a character that is gone (never arrived, or collected) lands at the end of the
|
|
247
|
+
* block it names, or of the block that one was joined into. It trusts the
|
|
248
|
+
* state to be one these functions made (the ops are the untrusted input): a state decoded
|
|
249
|
+
* from elsewhere is not checked for a block listed twice or a cycle of parents.
|
|
250
|
+
*
|
|
251
|
+
* The same ops on the same state give back the same state object, so the edit that made
|
|
252
|
+
* the ops and the durable Message that replays them agree on identity, and whatever is
|
|
253
|
+
* derived from it (`project`, an editor host's key) is derived once. The ops array is
|
|
254
|
+
* remembered by identity, so do not change one after applying it.
|
|
255
|
+
*/
|
|
256
|
+
export declare const applyOps: (state: ReplicatedState, ops: ReadonlyArray<ReplicatedOp>) => ReplicatedState;
|
|
257
|
+
/**
|
|
258
|
+
* The same ops with each insert that continues the one right before it folded into that one:
|
|
259
|
+
* a run of typing `translate` carried on as one insert becomes one op again. For ops
|
|
260
|
+
* `translate` made, which never reuse a character, applying the result shows what applying
|
|
261
|
+
* `ops` does.
|
|
262
|
+
*/
|
|
263
|
+
export declare const coalesce: (ops: ReadonlyArray<ReplicatedOp>) => ReadonlyArray<ReplicatedOp>;
|
|
264
|
+
/**
|
|
265
|
+
* The ops that undo `ops`, made against `state`, the state `ops` were applied to. Applied
|
|
266
|
+
* after `ops` and after whatever else has happened since, they take back what `ops` did
|
|
267
|
+
* and leave the rest alone. Characters it inserted are deleted, and characters it deleted
|
|
268
|
+
* come back. Marks, block types and props return to what they were, a split is joined and
|
|
269
|
+
* a join split out, and a moved block goes back beside the sibling it followed. A prop it
|
|
270
|
+
* added where there was none stays, since `SetProps` cannot delete one. Inverting the
|
|
271
|
+
* result gives the ops that redo it.
|
|
272
|
+
*/
|
|
273
|
+
export declare const invert: (state: ReplicatedState, ops: ReadonlyArray<ReplicatedOp>) => ReadonlyArray<ReplicatedOp>;
|
|
274
|
+
/** The document a state shows: visible blocks and characters, with runs merged by marks. */
|
|
275
|
+
export declare const project: (state: ReplicatedState) => Document;
|
|
276
|
+
/**
|
|
277
|
+
* A state that shows `document`, with every block and character given a new identity
|
|
278
|
+
* under `key`, which must be unique among the keys this state's ops are minted under.
|
|
279
|
+
*/
|
|
280
|
+
export declare const fromDocument: (document: Document, key: string) => ReplicatedState;
|
|
281
|
+
/** A caret or selection end held by what it sits after, so it survives others' edits. */
|
|
282
|
+
export declare const AnchoredPosition: Schema.Struct<{
|
|
283
|
+
readonly block: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
284
|
+
/** The character just before the position, or null at the block's start. */
|
|
285
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
286
|
+
readonly affinity: Schema.Literals<readonly ["before", "after"]>;
|
|
287
|
+
}>;
|
|
288
|
+
export type AnchoredPosition = typeof AnchoredPosition.Type;
|
|
289
|
+
export declare const AnchoredSelection: Schema.Union<readonly [Schema.Struct<{
|
|
290
|
+
readonly type: Schema.Literal<"Range">;
|
|
291
|
+
readonly anchor: Schema.Struct<{
|
|
292
|
+
readonly block: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
293
|
+
/** The character just before the position, or null at the block's start. */
|
|
294
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
295
|
+
readonly affinity: Schema.Literals<readonly ["before", "after"]>;
|
|
296
|
+
}>;
|
|
297
|
+
readonly focus: Schema.Struct<{
|
|
298
|
+
readonly block: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
299
|
+
/** The character just before the position, or null at the block's start. */
|
|
300
|
+
readonly after: Schema.NullOr<Schema.brand<Schema.String, "foldkit-richtext/CharRef">>;
|
|
301
|
+
readonly affinity: Schema.Literals<readonly ["before", "after"]>;
|
|
302
|
+
}>;
|
|
303
|
+
}>, Schema.Struct<{
|
|
304
|
+
readonly type: Schema.Literal<"Node">;
|
|
305
|
+
readonly node: Schema.brand<Schema.String, "foldkit-richtext/ReplicatedId">;
|
|
306
|
+
}>]>;
|
|
307
|
+
export type AnchoredSelection = typeof AnchoredSelection.Type;
|
|
308
|
+
/**
|
|
309
|
+
* Restates an edit's transactions as ops against `state`, which the edit ran on the
|
|
310
|
+
* projection of. `key` must be unique to this edit among everything the state has seen: it
|
|
311
|
+
* names the edit's new characters and blocks. Also anchors the edit's resulting selection.
|
|
312
|
+
* Throws if the transactions do not apply to the projection, which is a caller's bug. The
|
|
313
|
+
* transactions are replayed with `apply`'s default transforms, as `RichText.run` applies
|
|
314
|
+
* them; an edit normalized by other transforms does not translate.
|
|
315
|
+
*
|
|
316
|
+
* Text typed right after the last character of an insert `continues` accepts carries on that
|
|
317
|
+
* insert (`from` its next index) instead of starting one, so `coalesce` can fold a run of
|
|
318
|
+
* typing into one op. Accept only inserts this replica minted: two replicas continuing one
|
|
319
|
+
* insert at once would both claim its next characters, and the later would be dropped.
|
|
320
|
+
*/
|
|
321
|
+
export declare const translate: (state: ReplicatedState, result: Pick<Extract<TransactionResult, {
|
|
322
|
+
readonly ok: true;
|
|
323
|
+
}>, 'transactions' | 'state'>, key: string, options?: {
|
|
324
|
+
readonly continues?: (id: ReplicatedId) => boolean;
|
|
325
|
+
}) => {
|
|
326
|
+
readonly ops: ReadonlyArray<ReplicatedOp>;
|
|
327
|
+
readonly selection: AnchoredSelection | null;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Anchors a selection on the projection of `state`, so it can be resolved again after
|
|
331
|
+
* other replicas' ops change the text around it.
|
|
332
|
+
*/
|
|
333
|
+
export declare const anchor: (state: ReplicatedState, selection: Selection | null) => AnchoredSelection | null;
|
|
334
|
+
/**
|
|
335
|
+
* The selection an anchored one names in the projection of `state`. A position whose
|
|
336
|
+
* character was deleted moves back to the nearest character still shown; one whose block
|
|
337
|
+
* is gone resolves to nothing, and so does the selection.
|
|
338
|
+
*/
|
|
339
|
+
export declare const resolve: (state: ReplicatedState, selection: AnchoredSelection | null) => Selection | null;
|
|
340
|
+
//# sourceMappingURL=replicated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replicated.d.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