foldkit-richtext-dom 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-bundle.d.mts","names":[],"sources":["../../richtext/src/document.d.ts","../src/editor-bundle.ts"],"mappings":";;;;;;;cAEqB,QAAQ,OAAO,MAAM,OAAO;KACrC,gBAAgB,OAAO;cAqCd,MAAM,OAAO;WACrB,MAAM,OAAO;WACb,IAAI,OAAO,MAAM,OAAO;WACxB,MAAM,OAAO;WACb,OAAO,OAAO,OAAO,OAAO,gBAAgB,OAAO,gBAAgB,OAAO;aACtE,MAAM,OAAO;aACb,OAAO,OAAO,YAAY,OAAO,QAAQ,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM,OAAO;;;KAG9F,cAAc,KAAK;cACV,WAAW,OAAO;WAC1B,MAAM,OAAO;WACb,IAAI,OAAO,MAAM,OAAO;WACxB,UAAU,OAAO,OAAO,OAAO;aAC3B,MAAM,OAAO;aACb,IAAI,OAAO,MAAM,OAAO;aACxB,MAAM,OAAO;aACb,OAAO,OAAO,OAAO,OAAO,gBAAgB,OAAO,gBAAgB,OAAO;eACtE,MAAM,OAAO;eACb,OAAO,OAAO,YAAY,OAAO,QAAQ,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM,OAAO;;;;KAIlG,mBAAmB,UAAU;cACpB,SAAS,OAAO;WACxB,MAAM,OAAO;WACb,IAAI,OAAO,MAAM,OAAO;WACxB,OAAO,OAAO;WACd,UAAU,OAAO,OAAO,OAAO;aAC3B,MAAM,OAAO;aACb,IAAI,OAAO,MAAM,OAAO;aACxB,MAAM,OAAO;aACb,OAAO,OAAO,OAAO,OAAO,gBAAgB,OAAO,gBAAgB,OAAO;eACtE,MAAM,OAAO;eACb,OAAO,OAAO,YAAY,OAAO,QAAQ,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM,OAAO;;;;KAIlG,iBAAiB,QAAQ;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGN,SAAU,SAAS,YAAU;qBAC7B,QAAS,iBAAe;qBACxB,UAAW,oDAAkD;qBAE7D,UAAW,iBAAe;qBAC1B,WAAY,WAAW,SAAS,qBAAmB;qBAEnD,cAAa;qBACb,cAAa;qBACb,eAAc"}
@@ -0,0 +1,243 @@
1
+ import { placeRendering } from "./host.mjs";
2
+ import { Message, events, patchEditor } from "./editor.mjs";
3
+ import * as RichText from "foldkit-richtext";
4
+ import { Effect, Option, Schema } from "effect";
5
+ import { defineMessageUnion } from "foldkit/message";
6
+ import { Bundle, Link } from "foldkit-bundle";
7
+ import * as Submodel from "foldkit/submodel";
8
+ //#region src/editor-bundle.ts
9
+ /**
10
+ * The controlled-editor feasibility harness (§27): the authoritative Document
11
+ * lives in the parent Model, the editor Bundle reads it through its Link, and a
12
+ * single parent transition commits both the document and the interaction state.
13
+ *
14
+ * No DOM, no persistence, no collaboration: this exists to answer whether Bundle
15
+ * ownership can hold a rich-text editor without a second synchronized document
16
+ * copy or a Command that commits half the transition.
17
+ */
18
+ /** Interaction state the parent owns beside the document. */
19
+ const EditorState = Schema.Struct({
20
+ selection: Schema.NullOr(RichText.Selection),
21
+ /** Caller-owned identity source: a live edit mints, replay never does. */
22
+ nextId: Schema.Number,
23
+ /** Local undo history: snapshots of document plus selection. */
24
+ history: RichText.History,
25
+ /** Null inherits neighboring marks; an array explicitly sets them, even when empty. */
26
+ storedMarks: Schema.NullOr(Schema.Array(Schema.String)),
27
+ /**
28
+ * The host element the view renders and the patch Command finds (§118). It is
29
+ * per-placement, so it arrives as the Bundle's args and is carried here
30
+ * because `read` re-projects the whole child from the parent.
31
+ */
32
+ hostId: Schema.String
33
+ });
34
+ const Model = Schema.Struct({
35
+ document: RichText.Document,
36
+ editor: EditorState
37
+ });
38
+ /** What the child reads: the parent's document passes through, never stored. */
39
+ const EditorView = Schema.Struct({
40
+ document: RichText.Document,
41
+ selection: Schema.NullOr(RichText.Selection),
42
+ nextId: Schema.Number,
43
+ history: RichText.History,
44
+ storedMarks: Schema.NullOr(Schema.Array(Schema.String)),
45
+ hostId: Schema.String
46
+ });
47
+ const idsOf = (content) => new Set(content.children.flatMap((block) => [block.id, ...block.children.map((run) => run.id)]));
48
+ /** Everything that differs between two whole documents, for a replace patch. */
49
+ const replaceChangeSet = (previous, next) => {
50
+ const before = idsOf(previous);
51
+ const after = idsOf(next);
52
+ return {
53
+ dirtyNodes: after,
54
+ insertedNodes: new Set([...after].filter((id) => !before.has(id))),
55
+ removedNodes: new Set([...before].filter((id) => !after.has(id))),
56
+ textChanged: /* @__PURE__ */ new Set(),
57
+ structureChanged: true,
58
+ selectionChanged: false
59
+ };
60
+ };
61
+ const toCommand = (message) => {
62
+ switch (message._tag) {
63
+ case "Typed": return {
64
+ type: "InsertText",
65
+ text: message.text
66
+ };
67
+ case "Backspace": return { type: "DeleteBackward" };
68
+ case "DeletedForward": return { type: "DeleteForward" };
69
+ case "Entered": return { type: "SplitBlock" };
70
+ case "ToggledMark": return {
71
+ type: "ToggleMark",
72
+ mark: message.mark
73
+ };
74
+ case "Selected": return {
75
+ type: "SetSelection",
76
+ selection: message.selection
77
+ };
78
+ case "Pasted": return {
79
+ type: "Paste",
80
+ slice: message.slice
81
+ };
82
+ }
83
+ };
84
+ /**
85
+ * The rendering effect (§118): patch the host the view rendered, once the
86
+ * parent's transition has committed. It commits nothing, so the one-transition
87
+ * property the proof established is untouched.
88
+ */
89
+ const patch = (hostId, state, changeSet) => ({
90
+ name: "RichText.patch",
91
+ effect: Effect.as(Effect.sync(() => {
92
+ patchEditor(hostId, state, changeSet);
93
+ }), Message.Patched())
94
+ });
95
+ const Editor = Bundle.make({
96
+ name: "RichTextEditor",
97
+ Model: EditorView,
98
+ Message,
99
+ args: Schema.Struct({ hostId: Schema.String }),
100
+ init: (args) => ({ model: {
101
+ document: RichText.Document.make({
102
+ version: 1,
103
+ children: []
104
+ }),
105
+ selection: null,
106
+ nextId: 0,
107
+ history: RichText.emptyHistory,
108
+ storedMarks: null,
109
+ hostId: args.hostId
110
+ } }),
111
+ update: (model, message) => {
112
+ const state = {
113
+ document: model.document,
114
+ selection: model.selection
115
+ };
116
+ if (message._tag === "Patched") return { model };
117
+ if (message._tag === "Undone" || message._tag === "Redone") {
118
+ const restored = message._tag === "Undone" ? RichText.undo(model.history, state) : RichText.redo(model.history, state);
119
+ if (restored === void 0) return {
120
+ model,
121
+ outMessage: {
122
+ _tag: "Rejected",
123
+ error: message._tag === "Undone" ? "NothingToUndo" : "NothingToRedo"
124
+ }
125
+ };
126
+ const changeSet = replaceChangeSet(model.document, restored.state.document);
127
+ return {
128
+ model: {
129
+ ...model,
130
+ selection: restored.state.selection,
131
+ history: restored.history
132
+ },
133
+ outMessage: {
134
+ _tag: "Replaced",
135
+ state: restored.state,
136
+ changeSet
137
+ },
138
+ commands: [patch(model.hostId, restored.state, changeSet)]
139
+ };
140
+ }
141
+ let nextId = model.nextId;
142
+ const collapsed = model.selection?.type === "Range" && model.selection.anchor.node === model.selection.focus.node && model.selection.anchor.offset === model.selection.focus.offset;
143
+ if (message._tag === "ToggledMark" && collapsed && !RichText.shippedRegistry.declares(message.mark)) return {
144
+ model,
145
+ outMessage: {
146
+ _tag: "Rejected",
147
+ error: "InvalidInput"
148
+ }
149
+ };
150
+ const storedMarks = message._tag === "ToggledMark" && collapsed ? model.storedMarks?.includes(message.mark) ? model.storedMarks.filter((mark) => mark !== message.mark) : [...model.storedMarks ?? [], message.mark] : message._tag === "Selected" ? null : model.storedMarks;
151
+ const command = message._tag === "Typed" && storedMarks !== null ? {
152
+ type: "InsertText",
153
+ text: message.text,
154
+ marks: storedMarks
155
+ } : toCommand(message);
156
+ const result = RichText.run(state, command, { mint: () => `e${nextId++}` });
157
+ if (!result.ok) return {
158
+ model,
159
+ outMessage: {
160
+ _tag: "Rejected",
161
+ error: result.error
162
+ }
163
+ };
164
+ const contentChanged = result.state.document !== model.document;
165
+ return {
166
+ model: {
167
+ ...model,
168
+ selection: result.state.selection,
169
+ nextId,
170
+ storedMarks,
171
+ history: contentChanged ? RichText.commit(model.history, state, { group: RichText.groupFor(command) }) : model.history
172
+ },
173
+ outMessage: {
174
+ _tag: "Edited",
175
+ state: result.state,
176
+ changeSet: result.changeSet
177
+ },
178
+ commands: [patch(model.hostId, result.state, result.changeSet)]
179
+ };
180
+ },
181
+ view: Submodel.defineView((model, h) => h.div([h.Id(model.hostId), h.OnMount(events({ content: model.document }))], []))
182
+ });
183
+ const GotEditor = Link.wrapper("GotEditorMessage", Message);
184
+ const ParentMessage = defineMessageUnion({ ...GotEditor.cases });
185
+ const editorLink = Link.make({
186
+ read: (parent) => Option.some({
187
+ document: parent.document,
188
+ selection: parent.editor.selection,
189
+ nextId: parent.editor.nextId,
190
+ history: parent.editor.history,
191
+ storedMarks: parent.editor.storedMarks,
192
+ hostId: parent.editor.hostId
193
+ }),
194
+ write: (parent, child) => ({
195
+ ...parent,
196
+ editor: {
197
+ selection: child.selection,
198
+ nextId: child.nextId,
199
+ history: child.history,
200
+ storedMarks: child.storedMarks,
201
+ hostId: child.hostId
202
+ }
203
+ }),
204
+ wrapper: GotEditor,
205
+ path: ["editor"]
206
+ });
207
+ /**
208
+ * Places one editor, bound to the host element the view renders and the patch
209
+ * Command finds. Each placement picks its own id. A rendering registry (§121) is
210
+ * placed for that id rather than passed as an arg (§122): it holds functions, so
211
+ * the mount looks it up by host id instead.
212
+ */
213
+ const editorAt = (hostId, rendering = RichText.noRendering) => {
214
+ placeRendering(hostId, rendering);
215
+ return Editor.at(editorLink, {
216
+ args: { hostId },
217
+ onOut: (out) => (parent) => out._tag === "Edited" || out._tag === "Replaced" ? { model: {
218
+ ...parent,
219
+ document: out.state.document,
220
+ editor: {
221
+ ...parent.editor,
222
+ selection: out.state.selection
223
+ }
224
+ } } : { model: parent }
225
+ });
226
+ };
227
+ const editor = editorAt("richtext-editor");
228
+ const application = Bundle.assemble()([editor]);
229
+ /** The parent's update: placement Messages route to the editor, others stand still. */
230
+ const update = application.update();
231
+ /** Wraps one editor Message as the parent Message that carries it. */
232
+ const edited = (message) => GotEditor.make(message);
233
+ const typed = (text) => edited(Message.Typed({ text }));
234
+ const pressed = (tag) => edited(Message[tag]());
235
+ const toggled = (mark) => edited(Message.ToggledMark({ mark }));
236
+ const selected = (selection) => edited(Message.Selected({ selection }));
237
+ const undone = () => edited(Message.Undone());
238
+ const redone = () => edited(Message.Redone());
239
+ const patched = () => edited(Message.Patched());
240
+ //#endregion
241
+ export { Editor, EditorState, EditorView, Model, ParentMessage, application, edited, editor, editorAt, patched, pressed, redone, replaceChangeSet, selected, toggled, typed, undone, update };
242
+
243
+ //# sourceMappingURL=editor-bundle.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-bundle.mjs","names":[],"sources":["../src/editor-bundle.ts"],"sourcesContent":["/**\n * The controlled-editor feasibility harness (§27): the authoritative Document\n * lives in the parent Model, the editor Bundle reads it through its Link, and a\n * single parent transition commits both the document and the interaction state.\n *\n * No DOM, no persistence, no collaboration: this exists to answer whether Bundle\n * ownership can hold a rich-text editor without a second synchronized document\n * copy or a Command that commits half the transition.\n */\nimport { Effect, Option, Schema } from 'effect'\nimport { defineMessageUnion } from 'foldkit/message'\nimport { Bundle, Link, type Wrapped } from 'foldkit-bundle'\nimport * as RichText from 'foldkit-richtext'\nimport * as Submodel from 'foldkit/submodel'\nimport type * as Update from 'foldkit/update'\nimport { events, Message, patchEditor } from './editor.js'\nimport { placeRendering } from './host.js'\n\n/** Interaction state the parent owns beside the document. */\nexport const EditorState = Schema.Struct({\n selection: Schema.NullOr(RichText.Selection),\n /** Caller-owned identity source: a live edit mints, replay never does. */\n nextId: Schema.Number,\n /** Local undo history: snapshots of document plus selection. */\n history: RichText.History,\n /** Null inherits neighboring marks; an array explicitly sets them, even when empty. */\n storedMarks: Schema.NullOr(Schema.Array(Schema.String)),\n /**\n * The host element the view renders and the patch Command finds (§118). It is\n * per-placement, so it arrives as the Bundle's args and is carried here\n * because `read` re-projects the whole child from the parent.\n */\n hostId: Schema.String,\n})\nexport type EditorState = typeof EditorState.Type\n\nexport const Model = Schema.Struct({\n document: RichText.Document,\n editor: EditorState,\n})\nexport type Model = typeof Model.Type\n\n/** What the child reads: the parent's document passes through, never stored. */\nexport const EditorView = Schema.Struct({\n document: RichText.Document,\n selection: Schema.NullOr(RichText.Selection),\n nextId: Schema.Number,\n history: RichText.History,\n storedMarks: Schema.NullOr(Schema.Array(Schema.String)),\n hostId: Schema.String,\n})\nexport type EditorView = typeof EditorView.Type\n\n/** The committed edit, or the diagnostic that refused it. */\nexport type OutMessage =\n | {\n readonly _tag: 'Edited'\n readonly state: RichText.EditorState\n readonly changeSet: RichText.ChangeSet\n }\n | {\n /** Undo and redo replace the document wholesale; nothing was incremental. */\n readonly _tag: 'Replaced'\n readonly state: RichText.EditorState\n readonly changeSet: RichText.ChangeSet\n }\n | { readonly _tag: 'Rejected'; readonly error: string }\n\nconst idsOf = (content: RichText.Document): ReadonlySet<RichText.NodeId> =>\n new Set(content.children.flatMap(block => [block.id, ...block.children.map(run => run.id)]))\n\n/** Everything that differs between two whole documents, for a replace patch. */\nexport const replaceChangeSet = (\n previous: RichText.Document,\n next: RichText.Document,\n): RichText.ChangeSet => {\n const before = idsOf(previous)\n const after = idsOf(next)\n return {\n dirtyNodes: after,\n insertedNodes: new Set([...after].filter(id => !before.has(id))),\n removedNodes: new Set([...before].filter(id => !after.has(id))),\n textChanged: new Set(),\n structureChanged: true,\n selectionChanged: false,\n }\n}\n\ntype CommandMessage = Exclude<Message, { readonly _tag: 'Undone' | 'Redone' | 'Patched' }>\n\nconst toCommand = (message: CommandMessage): RichText.Command => {\n switch (message._tag) {\n case 'Typed':\n return { type: 'InsertText', text: message.text }\n case 'Backspace':\n return { type: 'DeleteBackward' }\n case 'DeletedForward':\n return { type: 'DeleteForward' }\n case 'Entered':\n return { type: 'SplitBlock' }\n case 'ToggledMark':\n return { type: 'ToggleMark', mark: message.mark }\n case 'Selected':\n return { type: 'SetSelection', selection: message.selection }\n case 'Pasted':\n return { type: 'Paste', slice: message.slice }\n }\n}\n\n/**\n * The rendering effect (§118): patch the host the view rendered, once the\n * parent's transition has committed. It commits nothing, so the one-transition\n * property the proof established is untouched.\n */\nconst patch = (hostId: string, state: RichText.EditorState, changeSet: RichText.ChangeSet) => ({\n name: 'RichText.patch',\n effect: Effect.as(\n Effect.sync(() => {\n patchEditor(hostId, state, changeSet)\n }),\n Message.Patched(),\n ),\n})\n\nexport const Editor = Bundle.make({\n name: 'RichTextEditor',\n Model: EditorView,\n Message,\n args: Schema.Struct({ hostId: Schema.String }),\n // A read-only projection has no initial content of its own; the placement\n // writes only the interaction fields back, so this never becomes the document.\n // The host id is the one thing the child seeds: it is per-placement, and `read`\n // re-projects everything else.\n init: args => ({\n model: {\n document: RichText.Document.make({ version: 1, children: [] }),\n selection: null,\n nextId: 0,\n history: RichText.emptyHistory,\n storedMarks: null,\n hostId: args.hostId,\n },\n }),\n update: (model, message): Update.ReturnWithOutMessage<EditorView, Message, OutMessage> => {\n const state: RichText.EditorState = { document: model.document, selection: model.selection }\n // The patch Command's own completion: the render already happened.\n if (message._tag === 'Patched') return { model }\n if (message._tag === 'Undone' || message._tag === 'Redone') {\n const restored =\n message._tag === 'Undone'\n ? RichText.undo(model.history, state)\n : RichText.redo(model.history, state)\n if (restored === undefined) {\n return {\n model,\n outMessage: {\n _tag: 'Rejected',\n error: message._tag === 'Undone' ? 'NothingToUndo' : 'NothingToRedo',\n },\n }\n }\n const changeSet = replaceChangeSet(model.document, restored.state.document)\n return {\n model: {\n ...model,\n selection: restored.state.selection,\n history: restored.history,\n },\n outMessage: { _tag: 'Replaced', state: restored.state, changeSet },\n commands: [patch(model.hostId, restored.state, changeSet)],\n }\n }\n let nextId = model.nextId\n // With nothing selected, a mark toggle is the caret's own state: the next\n // typed text lands with it. A caret move ends the format it was carrying.\n const collapsed =\n model.selection?.type === 'Range' &&\n model.selection.anchor.node === model.selection.focus.node &&\n model.selection.anchor.offset === model.selection.focus.offset\n // The caret never carries a mark the vocabulary cannot type, so an unknown\n // one is refused here rather than at the first keystroke after it.\n if (\n message._tag === 'ToggledMark' &&\n collapsed &&\n !RichText.shippedRegistry.declares(message.mark)\n ) {\n return { model, outMessage: { _tag: 'Rejected', error: 'InvalidInput' } }\n }\n const storedMarks =\n message._tag === 'ToggledMark' && collapsed\n ? model.storedMarks?.includes(message.mark)\n ? model.storedMarks.filter(mark => mark !== message.mark)\n : [...(model.storedMarks ?? []), message.mark]\n : message._tag === 'Selected'\n ? null\n : model.storedMarks\n const command =\n message._tag === 'Typed' && storedMarks !== null\n ? ({ type: 'InsertText', text: message.text, marks: storedMarks } as const)\n : toCommand(message)\n const result = RichText.run(state, command, { mint: () => `e${nextId++}` })\n if (!result.ok) {\n // A refused command changes nothing, so it does not burn identities.\n return { model, outMessage: { _tag: 'Rejected', error: result.error } }\n }\n // History holds content, not cursor movement: a selection change keeps the\n // redo stack, and a no-op edit adds no step to undo.\n const contentChanged = result.state.document !== model.document\n return {\n model: {\n ...model,\n selection: result.state.selection,\n nextId,\n storedMarks,\n history: contentChanged\n ? RichText.commit(model.history, state, { group: RichText.groupFor(command) })\n : model.history,\n },\n outMessage: { _tag: 'Edited', state: result.state, changeSet: result.changeSet },\n commands: [patch(model.hostId, result.state, result.changeSet)],\n }\n },\n // The host element belongs to the view; everything below it belongs to the\n // interpreter the mount attaches there.\n view: Submodel.defineView<EditorView, Message>((model, h) =>\n h.div([h.Id(model.hostId), h.OnMount(events({ content: model.document }))], []),\n ),\n})\n\nconst GotEditor = Link.wrapper('GotEditorMessage', Message)\n\nexport const ParentMessage = defineMessageUnion({ ...GotEditor.cases })\nexport type ParentMessage = typeof ParentMessage.Type\n\nconst editorLink: Link<\n Model,\n Wrapped<'GotEditorMessage', Message>,\n EditorView,\n Message\n> = Link.make({\n // The child sees the parent's document; the parent owns it.\n read: parent =>\n Option.some({\n document: parent.document,\n selection: parent.editor.selection,\n nextId: parent.editor.nextId,\n history: parent.editor.history,\n storedMarks: parent.editor.storedMarks,\n hostId: parent.editor.hostId,\n }),\n // Only interaction state is written back: the document is not the child's.\n write: (parent, child) => ({\n ...parent,\n editor: {\n selection: child.selection,\n nextId: child.nextId,\n history: child.history,\n storedMarks: child.storedMarks,\n hostId: child.hostId,\n },\n }),\n wrapper: GotEditor,\n path: ['editor'],\n})\n\n/**\n * Places one editor, bound to the host element the view renders and the patch\n * Command finds. Each placement picks its own id. A rendering registry (§121) is\n * placed for that id rather than passed as an arg (§122): it holds functions, so\n * the mount looks it up by host id instead.\n */\nexport const editorAt = (hostId: string, rendering: RichText.Rendering = RichText.noRendering) => {\n placeRendering(hostId, rendering)\n return Editor.at(editorLink, {\n args: { hostId },\n // Runs with the child already written back, in the same parent transition.\n onOut: (out: OutMessage) => (parent: Model) =>\n out._tag === 'Edited' || out._tag === 'Replaced'\n ? {\n model: {\n ...parent,\n document: out.state.document,\n editor: { ...parent.editor, selection: out.state.selection },\n },\n }\n : { model: parent },\n })\n}\n\nexport const editor = editorAt('richtext-editor')\n\nexport const application = Bundle.assemble<Model, ParentMessage>()([editor])\n\n/** The parent's update: placement Messages route to the editor, others stand still. */\nexport const update = application.update()\n\n/** Wraps one editor Message as the parent Message that carries it. */\nexport const edited = (message: Message): ParentMessage => GotEditor.make(message)\nexport const typed = (text: string): ParentMessage => edited(Message.Typed({ text }))\nexport const pressed = (tag: 'Backspace' | 'DeletedForward' | 'Entered'): ParentMessage =>\n edited(Message[tag]())\nexport const toggled = (mark: string): ParentMessage => edited(Message.ToggledMark({ mark }))\nexport const selected = (selection: RichText.Selection | null): ParentMessage =>\n edited(Message.Selected({ selection }))\nexport const undone = (): ParentMessage => edited(Message.Undone())\nexport const redone = (): ParentMessage => edited(Message.Redone())\nexport const patched = (): ParentMessage => edited(Message.Patched())\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAa,cAAc,OAAO,OAAO;CACvC,WAAW,OAAO,OAAO,SAAS,SAAS;;CAE3C,QAAQ,OAAO;;CAEf,SAAS,SAAS;;CAElB,aAAa,OAAO,OAAO,OAAO,MAAM,OAAO,MAAM,CAAC;;;;;;CAMtD,QAAQ,OAAO;AACjB,CAAC;AAGD,MAAa,QAAQ,OAAO,OAAO;CACjC,UAAU,SAAS;CACnB,QAAQ;AACV,CAAC;;AAID,MAAa,aAAa,OAAO,OAAO;CACtC,UAAU,SAAS;CACnB,WAAW,OAAO,OAAO,SAAS,SAAS;CAC3C,QAAQ,OAAO;CACf,SAAS,SAAS;CAClB,aAAa,OAAO,OAAO,OAAO,MAAM,OAAO,MAAM,CAAC;CACtD,QAAQ,OAAO;AACjB,CAAC;AAkBD,MAAM,SAAS,YACb,IAAI,IAAI,QAAQ,SAAS,SAAQ,UAAS,CAAC,MAAM,IAAI,GAAG,MAAM,SAAS,KAAI,QAAO,IAAI,EAAE,CAAC,CAAC,CAAC;;AAG7F,MAAa,oBACX,UACA,SACuB;CACvB,MAAM,SAAS,MAAM,QAAQ;CAC7B,MAAM,QAAQ,MAAM,IAAI;CACxB,OAAO;EACL,YAAY;EACZ,eAAe,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,QAAO,OAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;EAC/D,cAAc,IAAI,IAAI,CAAC,G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