foldkit-richtext-dom 0.4.1 → 0.6.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/README.md +100 -29
- package/dist/{editor-DbYswARG.d.mts → editor-Cmo24yol.d.mts} +408 -11
- package/dist/editor-Cmo24yol.d.mts.map +1 -0
- package/dist/editor-bundle.d.mts +1659 -79
- package/dist/editor-bundle.d.mts.map +1 -1
- package/dist/editor-bundle.mjs +134 -14
- package/dist/editor-bundle.mjs.map +1 -1
- package/dist/editor.d.mts +2 -2
- package/dist/editor.mjs +184 -25
- package/dist/editor.mjs.map +1 -1
- package/dist/{events-Dasls6a_.d.mts → events-De4SvZil.d.mts} +25 -5
- package/dist/events-De4SvZil.d.mts.map +1 -0
- package/dist/events.d.mts +1 -1
- package/dist/events.mjs +431 -19
- package/dist/events.mjs.map +1 -1
- package/dist/filler-D2_wc_8Z.mjs +8 -0
- package/dist/filler-D2_wc_8Z.mjs.map +1 -0
- package/dist/{host-1dtxuKIA.d.mts → host-BKvhyPj-.d.mts} +27 -8
- package/dist/host-BKvhyPj-.d.mts.map +1 -0
- package/dist/host.d.mts +2 -2
- package/dist/host.mjs +25 -8
- package/dist/host.mjs.map +1 -1
- package/dist/html.d.mts.map +1 -1
- package/dist/html.mjs +2 -0
- package/dist/html.mjs.map +1 -1
- package/dist/index-DDV_JesZ.d.mts.map +1 -1
- package/dist/index.mjs +52 -19
- package/dist/index.mjs.map +1 -1
- package/dist/input.d.mts +259 -3
- package/dist/input.d.mts.map +1 -1
- package/dist/input.mjs +2 -1
- package/dist/input.mjs.map +1 -1
- package/dist/toolbar.d.mts +7 -0
- package/dist/toolbar.d.mts.map +1 -1
- package/dist/toolbar.mjs +143 -14
- package/dist/toolbar.mjs.map +1 -1
- package/dist/view.d.mts.map +1 -1
- package/dist/view.mjs +26 -2
- package/dist/view.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/editor-DbYswARG.d.mts.map +0 -1
- package/dist/events-Dasls6a_.d.mts.map +0 -1
- package/dist/host-1dtxuKIA.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Attachment, r as Decorate } from "./events-
|
|
1
|
+
import { a as KeyBinding, n as Attachment, r as Decorate } from "./events-De4SvZil.mjs";
|
|
2
2
|
import * as RichText from "foldkit-richtext";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
import * as Mount from "foldkit/mount";
|
|
@@ -20,9 +20,15 @@ declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
20
20
|
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
21
21
|
}>]>;
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The named mark off the selection, or off the mark's extent at a caret: unlinking. A mark
|
|
25
|
+
* value clears only the runs carrying exactly it.
|
|
26
|
+
*/
|
|
24
27
|
readonly ClearedMark: {
|
|
25
|
-
mark: Schema.
|
|
28
|
+
mark: Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
29
|
+
readonly name: Schema.NonEmptyString;
|
|
30
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
31
|
+
}>]>;
|
|
26
32
|
};
|
|
27
33
|
readonly RetypedBlock: {
|
|
28
34
|
block: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -59,6 +65,256 @@ declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
59
65
|
readonly before: Schema.optionalKey<Schema.Never>;
|
|
60
66
|
}>]>;
|
|
61
67
|
};
|
|
68
|
+
/** A block put beside another, under fresh identities: an insert menu's choice, a Duplicate. */
|
|
69
|
+
readonly InsertedBlock: {
|
|
70
|
+
block: Schema.Union<readonly [Schema.Struct<{
|
|
71
|
+
readonly type: Schema.Literal<"Paragraph">;
|
|
72
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
73
|
+
readonly children: Schema.$Array<Schema.Struct<{
|
|
74
|
+
readonly type: Schema.Literal<"Text">;
|
|
75
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
76
|
+
readonly text: Schema.String;
|
|
77
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
78
|
+
readonly name: Schema.NonEmptyString;
|
|
79
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
80
|
+
}>]>>;
|
|
81
|
+
}>>;
|
|
82
|
+
}>, Schema.Struct<{
|
|
83
|
+
readonly type: Schema.Literal<"Heading">;
|
|
84
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
85
|
+
readonly level: Schema.Literals<readonly [1, 2, 3, 4, 5, 6]>;
|
|
86
|
+
readonly children: Schema.$Array<Schema.Struct<{
|
|
87
|
+
readonly type: Schema.Literal<"Text">;
|
|
88
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
89
|
+
readonly text: Schema.String;
|
|
90
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
91
|
+
readonly name: Schema.NonEmptyString;
|
|
92
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
93
|
+
}>]>>;
|
|
94
|
+
}>>;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
readonly type: Schema.Literal<"Node">;
|
|
97
|
+
readonly kind: Schema.NonEmptyString;
|
|
98
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
99
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
100
|
+
readonly children: Schema.$Array<Schema.Struct<{
|
|
101
|
+
readonly type: Schema.Literal<"Text">;
|
|
102
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
103
|
+
readonly text: Schema.String;
|
|
104
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
105
|
+
readonly name: Schema.NonEmptyString;
|
|
106
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
107
|
+
}>]>>;
|
|
108
|
+
}>>;
|
|
109
|
+
readonly blocks: Schema.optionalKey<Schema.suspend<Schema.Codec<readonly RichText.Block[], readonly ({
|
|
110
|
+
readonly type: 'Node';
|
|
111
|
+
readonly kind: string;
|
|
112
|
+
readonly id: string;
|
|
113
|
+
readonly props: {
|
|
114
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
115
|
+
};
|
|
116
|
+
readonly children: readonly {
|
|
117
|
+
readonly type: "Text";
|
|
118
|
+
readonly id: string;
|
|
119
|
+
readonly text: string;
|
|
120
|
+
readonly marks: readonly (string | {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly props?: {
|
|
123
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
124
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
125
|
+
} | null;
|
|
126
|
+
};
|
|
127
|
+
})[];
|
|
128
|
+
}[];
|
|
129
|
+
readonly blocks?: readonly (any | {
|
|
130
|
+
readonly type: "Paragraph";
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly children: readonly {
|
|
133
|
+
readonly type: "Text";
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly text: string;
|
|
136
|
+
readonly marks: readonly (string | {
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly props?: {
|
|
139
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
140
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
141
|
+
} | null;
|
|
142
|
+
};
|
|
143
|
+
})[];
|
|
144
|
+
}[];
|
|
145
|
+
} | {
|
|
146
|
+
readonly type: "Heading";
|
|
147
|
+
readonly id: string;
|
|
148
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
149
|
+
readonly children: readonly {
|
|
150
|
+
readonly type: "Text";
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly text: string;
|
|
153
|
+
readonly marks: readonly (string | {
|
|
154
|
+
readonly name: string;
|
|
155
|
+
readonly props?: {
|
|
156
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
157
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
158
|
+
} | null;
|
|
159
|
+
};
|
|
160
|
+
})[];
|
|
161
|
+
}[];
|
|
162
|
+
} | {
|
|
163
|
+
readonly type: "Unknown";
|
|
164
|
+
readonly id: string;
|
|
165
|
+
readonly originalType: string;
|
|
166
|
+
readonly props: {
|
|
167
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
168
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
169
|
+
} | null;
|
|
170
|
+
};
|
|
171
|
+
readonly children: readonly {
|
|
172
|
+
readonly type: "Text";
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly text: string;
|
|
175
|
+
readonly marks: readonly (string | {
|
|
176
|
+
readonly name: string;
|
|
177
|
+
readonly props?: {
|
|
178
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
179
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
180
|
+
} | null;
|
|
181
|
+
};
|
|
182
|
+
})[];
|
|
183
|
+
}[];
|
|
184
|
+
})[];
|
|
185
|
+
} | {
|
|
186
|
+
readonly type: "Paragraph";
|
|
187
|
+
readonly id: string;
|
|
188
|
+
readonly children: readonly {
|
|
189
|
+
readonly type: "Text";
|
|
190
|
+
readonly id: string;
|
|
191
|
+
readonly text: string;
|
|
192
|
+
readonly marks: readonly (string | {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly props?: {
|
|
195
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
196
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
197
|
+
} | null;
|
|
198
|
+
};
|
|
199
|
+
})[];
|
|
200
|
+
}[];
|
|
201
|
+
} | {
|
|
202
|
+
readonly type: "Heading";
|
|
203
|
+
readonly id: string;
|
|
204
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
205
|
+
readonly children: readonly {
|
|
206
|
+
readonly type: "Text";
|
|
207
|
+
readonly id: string;
|
|
208
|
+
readonly text: string;
|
|
209
|
+
readonly marks: readonly (string | {
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly props?: {
|
|
212
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
213
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
214
|
+
} | null;
|
|
215
|
+
};
|
|
216
|
+
})[];
|
|
217
|
+
}[];
|
|
218
|
+
} | {
|
|
219
|
+
readonly type: "Unknown";
|
|
220
|
+
readonly id: string;
|
|
221
|
+
readonly originalType: string;
|
|
222
|
+
readonly props: {
|
|
223
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
224
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
225
|
+
} | null;
|
|
226
|
+
};
|
|
227
|
+
readonly children: readonly {
|
|
228
|
+
readonly type: "Text";
|
|
229
|
+
readonly id: string;
|
|
230
|
+
readonly text: string;
|
|
231
|
+
readonly marks: readonly (string | {
|
|
232
|
+
readonly name: string;
|
|
233
|
+
readonly props?: {
|
|
234
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | {
|
|
235
|
+
readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
|
|
236
|
+
} | null;
|
|
237
|
+
};
|
|
238
|
+
})[];
|
|
239
|
+
}[];
|
|
240
|
+
})[], never, never>>>;
|
|
241
|
+
}>, Schema.Struct<{
|
|
242
|
+
readonly type: Schema.Literal<"Unknown">;
|
|
243
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
244
|
+
readonly originalType: Schema.NonEmptyString;
|
|
245
|
+
readonly props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
246
|
+
readonly children: Schema.$Array<Schema.Struct<{
|
|
247
|
+
readonly type: Schema.Literal<"Text">;
|
|
248
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
249
|
+
readonly text: Schema.String;
|
|
250
|
+
readonly marks: Schema.$Array<Schema.Union<readonly [Schema.NonEmptyString, Schema.Struct<{
|
|
251
|
+
readonly name: Schema.NonEmptyString;
|
|
252
|
+
readonly props: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
253
|
+
}>]>>;
|
|
254
|
+
}>>;
|
|
255
|
+
}>]>;
|
|
256
|
+
to: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
257
|
+
readonly before: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
258
|
+
readonly after: Schema.optionalKey<Schema.Never>;
|
|
259
|
+
}>, Schema.Struct<{
|
|
260
|
+
readonly after: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
261
|
+
readonly before: Schema.optionalKey<Schema.Never>;
|
|
262
|
+
}>]>>;
|
|
263
|
+
};
|
|
264
|
+
/** A block and what it holds, deleted: a block handle's Delete. */
|
|
265
|
+
readonly DeletedBlock: {
|
|
266
|
+
node: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
267
|
+
};
|
|
268
|
+
/** A row above or below the caret's table cell. */
|
|
269
|
+
readonly InsertedRow: {
|
|
270
|
+
where: Schema.Literals<readonly ["before", "after"]>;
|
|
271
|
+
};
|
|
272
|
+
/** A column before or after the caret's table cell. */
|
|
273
|
+
readonly InsertedColumn: {
|
|
274
|
+
where: Schema.Literals<readonly ["before", "after"]>;
|
|
275
|
+
};
|
|
276
|
+
/** The caret's table row, deleted. */
|
|
277
|
+
readonly DeletedRow: {};
|
|
278
|
+
/** The caret's table column, deleted. */
|
|
279
|
+
readonly DeletedColumn: {};
|
|
280
|
+
/** Tab: indentation in code, the next cell in a table. */
|
|
281
|
+
readonly Indented: {};
|
|
282
|
+
/**
|
|
283
|
+
* Find and replace: the match at index `at` of `query`, or every match when `at` is absent,
|
|
284
|
+
* becomes `replacement`, as one undo step.
|
|
285
|
+
*/
|
|
286
|
+
readonly ReplacedText: {
|
|
287
|
+
query: Schema.String;
|
|
288
|
+
replacement: Schema.String;
|
|
289
|
+
caseSensitive: Schema.optionalKey<Schema.Boolean>;
|
|
290
|
+
at: Schema.optionalKey<Schema.Number>;
|
|
291
|
+
};
|
|
292
|
+
/** `InsertFootnote`: a reference at the caret, its definition last, the caret in it. */
|
|
293
|
+
readonly InsertedFootnote: {
|
|
294
|
+
text: Schema.optionalKey<Schema.String>;
|
|
295
|
+
};
|
|
296
|
+
/** `RenameFootnote`: a footnote's label, on its definition and every reference. */
|
|
297
|
+
readonly RenamedFootnote: {
|
|
298
|
+
from: Schema.String;
|
|
299
|
+
to: Schema.String;
|
|
300
|
+
};
|
|
301
|
+
/** Shift+Tab: less indentation in code, the previous cell in a table. */
|
|
302
|
+
readonly Outdented: {};
|
|
303
|
+
/**
|
|
304
|
+
* An adornment with an `action` was clicked: a code block's Copy, say. Not an edit, so the
|
|
305
|
+
* editor changes nothing; it is the application's to act on.
|
|
306
|
+
*/
|
|
307
|
+
readonly ActivatedAdornment: {
|
|
308
|
+
node: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
309
|
+
action: Schema.String;
|
|
310
|
+
};
|
|
311
|
+
/** Escape over a slash menu: it closes until its query ends, and Enter splits again. */
|
|
312
|
+
readonly DismissedSlash: {};
|
|
313
|
+
/** Props of a node block, set: a task's checkbox, a toggle's arrow, an image's caption. */
|
|
314
|
+
readonly ChangedProps: {
|
|
315
|
+
node: Schema.brand<Schema.NonEmptyString, "foldkit-richtext/NodeId">;
|
|
316
|
+
props: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
317
|
+
};
|
|
62
318
|
readonly Selected: {
|
|
63
319
|
selection: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
64
320
|
readonly type: Schema.Literal<"Range">;
|
|
@@ -276,12 +532,12 @@ declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
276
532
|
}>;
|
|
277
533
|
type Message = typeof Message.Type;
|
|
278
534
|
/**
|
|
279
|
-
* What the DOM can ask for: the vocabulary without the patch acknowledgement,
|
|
280
|
-
* which
|
|
535
|
+
* What the DOM can ask for: the vocabulary without the patch acknowledgement, which only the
|
|
536
|
+
* Command produces, and a slash menu's dismissal, which the application's menu sends. The adapter's stream is typed by this, so a
|
|
281
537
|
* mount's result union names every Message it can actually emit.
|
|
282
538
|
*/
|
|
283
539
|
type EditorEvent = Exclude<Message, {
|
|
284
|
-
readonly _tag: 'Patched';
|
|
540
|
+
readonly _tag: 'Patched' | 'DismissedSlash';
|
|
285
541
|
}>;
|
|
286
542
|
/**
|
|
287
543
|
* What a browser intent means to an editor. The adapter reports only plain
|
|
@@ -310,6 +566,12 @@ interface SlashEntry<Payload> {
|
|
|
310
566
|
readonly keywords: ReadonlyArray<string>;
|
|
311
567
|
/** What choosing this entry sends: an editor Message here, a caller's in a view. */
|
|
312
568
|
readonly message: Payload;
|
|
569
|
+
/** A line under the label saying what the entry makes. */
|
|
570
|
+
readonly description?: string | undefined;
|
|
571
|
+
/** The heading the entry is listed under while no query narrows the menu. */
|
|
572
|
+
readonly group?: string | undefined;
|
|
573
|
+
/** The icon a menu draws for it, by name; a view's own set says what names it knows. */
|
|
574
|
+
readonly icon?: string | undefined;
|
|
313
575
|
}
|
|
314
576
|
/**
|
|
315
577
|
* The query the caret is in, or `undefined` when the text before it is not a slash
|
|
@@ -327,8 +589,9 @@ declare const slashQuery: (textBefore: string) => string | undefined;
|
|
|
327
589
|
*/
|
|
328
590
|
declare const slashEntries: ReadonlyArray<SlashEntry<EditorEvent>>;
|
|
329
591
|
/**
|
|
330
|
-
* The entries
|
|
331
|
-
*
|
|
592
|
+
* The entries a query matches, case-insensitively, the best first: a label it starts, a word of
|
|
593
|
+
* a label it starts, a keyword it starts, then any it appears in, each in catalogue order.
|
|
594
|
+
* Every entry, grouped, when the query is empty, which is what `/` alone offers.
|
|
332
595
|
*/
|
|
333
596
|
declare const matchingEntries: <Payload>(entries: ReadonlyArray<SlashEntry<Payload>>, query: string) => ReadonlyArray<SlashEntry<Payload>>;
|
|
334
597
|
/** What a menu shows for one caret: its query, what matches, and what Enter would send. */
|
|
@@ -356,6 +619,12 @@ interface EditorDrawing {
|
|
|
356
619
|
readonly decorate?: Decorate | undefined;
|
|
357
620
|
/** What a blank document shows. */
|
|
358
621
|
readonly placeholder?: string | undefined;
|
|
622
|
+
/** What the empty paragraph the caret is in shows. */
|
|
623
|
+
readonly lineHint?: string | undefined;
|
|
624
|
+
/** The node vocabulary, which says where Tab means something (`RichText.takesTab`). */
|
|
625
|
+
readonly nodes?: RichText.NodeRegistry | undefined;
|
|
626
|
+
/** Chords beside the built-in ones, checked first (`AttachOptions.keymap`). */
|
|
627
|
+
readonly keymap?: ReadonlyArray<KeyBinding> | undefined;
|
|
359
628
|
}
|
|
360
629
|
/**
|
|
361
630
|
* Attaches the translation to a host element and reports each Message through
|
|
@@ -369,8 +638,15 @@ declare const attachEditor: (host: Element, content: RichText.Document, emit: (m
|
|
|
369
638
|
* while the transition was in flight — so it reports whether it patched.
|
|
370
639
|
*/
|
|
371
640
|
declare const patchEditor: (hostId: string, state: RichText.EditorState, changeSet: RichText.ChangeSet) => boolean;
|
|
641
|
+
/** Tells the editor at `hostId` that an edit it asked for is drawn or refused (`Attachment.answered`). */
|
|
642
|
+
declare const answerEditor: (hostId: string) => void;
|
|
372
643
|
/** Draws the decorations of the editor at `hostId` again; false when none is attached there. */
|
|
373
644
|
declare const redecorateEditor: (hostId: string) => boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Focuses the editor at `hostId` with `selection` in the browser (`Attachment.focus`); false
|
|
647
|
+
* when none is attached there.
|
|
648
|
+
*/
|
|
649
|
+
declare const focusEditor: (hostId: string, selection: RichText.Selection) => boolean;
|
|
374
650
|
/**
|
|
375
651
|
* The latest document the editor at `hostId` holds (`Attachment.held`), or undefined when none
|
|
376
652
|
* is attached there.
|
|
@@ -570,6 +846,10 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
570
846
|
}>]>>;
|
|
571
847
|
}>;
|
|
572
848
|
}, {
|
|
849
|
+
readonly _tag: "ActivatedAdornment";
|
|
850
|
+
readonly node: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
851
|
+
readonly action: string;
|
|
852
|
+
} | {
|
|
573
853
|
readonly _tag: "AppliedMark";
|
|
574
854
|
readonly mark: string | {
|
|
575
855
|
readonly name: string;
|
|
@@ -579,9 +859,20 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
579
859
|
};
|
|
580
860
|
} | {
|
|
581
861
|
readonly _tag: "Backspace";
|
|
862
|
+
} | {
|
|
863
|
+
readonly _tag: "ChangedProps";
|
|
864
|
+
readonly node: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
865
|
+
readonly props: {
|
|
866
|
+
readonly [x: string]: Schema.Json;
|
|
867
|
+
};
|
|
582
868
|
} | {
|
|
583
869
|
readonly _tag: "ClearedMark";
|
|
584
|
-
readonly mark: string
|
|
870
|
+
readonly mark: string | {
|
|
871
|
+
readonly name: string;
|
|
872
|
+
readonly props?: {
|
|
873
|
+
readonly [x: string]: Schema.Json;
|
|
874
|
+
};
|
|
875
|
+
};
|
|
585
876
|
} | {
|
|
586
877
|
readonly _tag: "ConvertedBlock";
|
|
587
878
|
readonly to: {
|
|
@@ -590,10 +881,104 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
590
881
|
readonly [x: string]: Schema.Json;
|
|
591
882
|
};
|
|
592
883
|
};
|
|
884
|
+
} | {
|
|
885
|
+
readonly _tag: "DeletedBlock";
|
|
886
|
+
readonly node: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
887
|
+
} | {
|
|
888
|
+
readonly _tag: "DeletedColumn";
|
|
593
889
|
} | {
|
|
594
890
|
readonly _tag: "DeletedForward";
|
|
891
|
+
} | {
|
|
892
|
+
readonly _tag: "DeletedRow";
|
|
595
893
|
} | {
|
|
596
894
|
readonly _tag: "Entered";
|
|
895
|
+
} | {
|
|
896
|
+
readonly _tag: "Indented";
|
|
897
|
+
} | {
|
|
898
|
+
readonly _tag: "InsertedBlock";
|
|
899
|
+
readonly block: {
|
|
900
|
+
readonly type: "Paragraph";
|
|
901
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
902
|
+
readonly children: readonly {
|
|
903
|
+
readonly type: "Text";
|
|
904
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
905
|
+
readonly text: string;
|
|
906
|
+
readonly marks: readonly (string | {
|
|
907
|
+
readonly name: string;
|
|
908
|
+
readonly props?: {
|
|
909
|
+
readonly [x: string]: Schema.Json;
|
|
910
|
+
};
|
|
911
|
+
})[];
|
|
912
|
+
}[];
|
|
913
|
+
} | {
|
|
914
|
+
readonly type: "Heading";
|
|
915
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
916
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
917
|
+
readonly children: readonly {
|
|
918
|
+
readonly type: "Text";
|
|
919
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
920
|
+
readonly text: string;
|
|
921
|
+
readonly marks: readonly (string | {
|
|
922
|
+
readonly name: string;
|
|
923
|
+
readonly props?: {
|
|
924
|
+
readonly [x: string]: Schema.Json;
|
|
925
|
+
};
|
|
926
|
+
})[];
|
|
927
|
+
}[];
|
|
928
|
+
} | {
|
|
929
|
+
readonly type: "Node";
|
|
930
|
+
readonly kind: string;
|
|
931
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
932
|
+
readonly props: {
|
|
933
|
+
readonly [x: string]: Schema.Json;
|
|
934
|
+
};
|
|
935
|
+
readonly children: readonly {
|
|
936
|
+
readonly type: "Text";
|
|
937
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
938
|
+
readonly text: string;
|
|
939
|
+
readonly marks: readonly (string | {
|
|
940
|
+
readonly name: string;
|
|
941
|
+
readonly props?: {
|
|
942
|
+
readonly [x: string]: Schema.Json;
|
|
943
|
+
};
|
|
944
|
+
})[];
|
|
945
|
+
}[];
|
|
946
|
+
readonly blocks?: readonly RichText.Block[];
|
|
947
|
+
} | {
|
|
948
|
+
readonly type: "Unknown";
|
|
949
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
950
|
+
readonly originalType: string;
|
|
951
|
+
readonly props: {
|
|
952
|
+
readonly [x: string]: Schema.Json;
|
|
953
|
+
};
|
|
954
|
+
readonly children: readonly {
|
|
955
|
+
readonly type: "Text";
|
|
956
|
+
readonly id: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
957
|
+
readonly text: string;
|
|
958
|
+
readonly marks: readonly (string | {
|
|
959
|
+
readonly name: string;
|
|
960
|
+
readonly props?: {
|
|
961
|
+
readonly [x: string]: Schema.Json;
|
|
962
|
+
};
|
|
963
|
+
})[];
|
|
964
|
+
}[];
|
|
965
|
+
};
|
|
966
|
+
readonly to?: {
|
|
967
|
+
readonly before: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
968
|
+
readonly after?: never;
|
|
969
|
+
} | {
|
|
970
|
+
readonly after: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
971
|
+
readonly before?: never;
|
|
972
|
+
};
|
|
973
|
+
} | {
|
|
974
|
+
readonly _tag: "InsertedColumn";
|
|
975
|
+
readonly where: "after" | "before";
|
|
976
|
+
} | {
|
|
977
|
+
readonly _tag: "InsertedFootnote";
|
|
978
|
+
readonly text?: string;
|
|
979
|
+
} | {
|
|
980
|
+
readonly _tag: "InsertedRow";
|
|
981
|
+
readonly where: "after" | "before";
|
|
597
982
|
} | {
|
|
598
983
|
readonly _tag: "LiftedBlock";
|
|
599
984
|
} | {
|
|
@@ -606,6 +991,8 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
606
991
|
readonly after: string & import("effect/Brand").Brand<"foldkit-richtext/NodeId">;
|
|
607
992
|
readonly before?: never;
|
|
608
993
|
};
|
|
994
|
+
} | {
|
|
995
|
+
readonly _tag: "Outdented";
|
|
609
996
|
} | {
|
|
610
997
|
readonly _tag: "Pasted";
|
|
611
998
|
readonly slice: {
|
|
@@ -680,6 +1067,16 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
680
1067
|
};
|
|
681
1068
|
} | {
|
|
682
1069
|
readonly _tag: "Redone";
|
|
1070
|
+
} | {
|
|
1071
|
+
readonly _tag: "RenamedFootnote";
|
|
1072
|
+
readonly from: string;
|
|
1073
|
+
readonly to: string;
|
|
1074
|
+
} | {
|
|
1075
|
+
readonly _tag: "ReplacedText";
|
|
1076
|
+
readonly query: string;
|
|
1077
|
+
readonly replacement: string;
|
|
1078
|
+
readonly caseSensitive?: boolean;
|
|
1079
|
+
readonly at?: number;
|
|
683
1080
|
} | {
|
|
684
1081
|
readonly _tag: "RetypedBlock";
|
|
685
1082
|
readonly block: {
|
|
@@ -724,5 +1121,5 @@ declare const events: Mount.MountDefinitionWithArgs<"RichTextDomEvents", {
|
|
|
724
1121
|
}[];
|
|
725
1122
|
}>;
|
|
726
1123
|
//#endregion
|
|
727
|
-
export { SlashMenu as a,
|
|
728
|
-
//# sourceMappingURL=editor-
|
|
1124
|
+
export { toMessage as _, SlashMenu as a, events as c, matchingEntries as d, patchEditor as f, slashQuery as g, slashMenu as h, SlashEntry as i, focusEditor as l, slashEntries as m, EditorEvent as n, answerEditor as o, redecorateEditor as p, Message as r, attachEditor as s, EditorDrawing as t, heldDocument as u };
|
|
1125
|
+
//# sourceMappingURL=editor-Cmo24yol.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-Cmo24yol.d.mts","names":["_$__events_js0.Attachment"],"sources":["../src/editor.ts"],"mappings":";;;;;cAyBa,mCAAO;;IACT,MAAI,OAAA;;;;;;IAIE,MAAI,OAAA;;;;IAEJ,MAAI,OAAA,gBAAA,OAAA,gBAAA,OAAA;;;;;;;;;;IAKJ,MAAI,OAAA,gBAAA,OAAA,gBAAA,OAAA;;;;;;IACH,OAAK,OAAA,gBAAA,OAAA;;;;;;;;;IAEL,YAAU,OAAA,OAAA,OAAA;;;;;;;IAER,IAAE,OAAA;;;;;;;;;IAIN,MAAI,OAAA,MAAA,OAAA;IAAmB,IAAE,OAAA,gBAAA,OAAA;;;;;;;;;;IAEtB,OAAK,OAAA,gBAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAkB,IAAE,OAAA,YAAA,OAAA,gBAAA,OAAA;;;;;;;;;;IAE1B,MAAI,OAAA,MAAA,OAAA;;;;IAEL,OAAK,OAAA;;;;IAEF,OAAK,OAAA;;;;;;;;;;;;;IAYrB,OAAK,OAAA;IACL,aAAW,OAAA;IACX,eAAa,OAAA,YAAA,OAAA;IACb,IAAE,OAAA,YAAA,OAAA;;;;IAGgB,MAAI,OAAA,YAAA,OAAA;;;;IAEL,MAAI,OAAA;IAAiB,IAAE,OAAA;;;;;;;;;IAOpB,MAAI,OAAA,MAAA,OAAA;IAAmB,QAAM,OAAA;;;;;;IAInC,MAAI,OAAA,MAAA,OAAA;IAAmB,OAAK,OAAA,QAAA,OAAA,QAAA,OAAA,MAAA,OAAA,MAAA,OAAA;;;IAChC,WAAS,OAAA,OAAA,OAAA,gBAAA,OAAA;;;;;;;;;;;;;;;;;;IACX,OAAK,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOL,iBAAiB,QAAQ;;;;;;KAOzB,cAAc,QAAQ;WAAoB;;;;;;;;cAQzC,YAAS,SAAa,SAAS,YAAU;;;;;;;;;;;;UAwCrC,WAAW;;WAEjB;;WAEA;;WAEA,UAAU;;WAEV,SAAS;;WAET;;WAEA;;WAEA;;;;;;;;cASE,aAAU;;;;;;;;cA8BV,cAAc,cAAc,WAAW;;;;;;cAoGvC,kBAAmB,SAAO,SAC5B,cAAc,WAAW,WAAS,kBAE1C,cAAc,WAAW;;UAaX,UAAU;WAChB;WACA,SAAS,cAAc,WAAW;;WAElC,aAAa,WAAW;;;;;;;;;;;;;cActB,YAAa,SAAO,SACtB,cAAc,WAAW,WAAS,oBACzB,kBAEjB,UAAU;;UAQI;WACN,YAAY,SAAS;WACrB,WAAW;;WAEX;;WAEA;;WAEA,QAAQ,SAAS;;WAEjB,SAAS,cAAc;;;;;;;cAQrB,eAAY,MACjB,SAAO,SACJ,SAAS,UAAQ,OACnB,SAAS,sBAAoB,UAC3B,kBAAAA;;;;;;cA2BE,cAAW,gBACR,OACP,SAAS,aAAW,WAChB,SAAS;;cAWT,eAAY;;cAMZ,mBAAgB;;;;;cAWhB,cAAW,gBAAkB,WAAa,SAAS;;;;;cAWnD,eAAY,mBAAqB,SAAS;;;;cAQ1C,QAAM,MAAA"}
|