@rcarls/rc-markdown-editor 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,1061 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/define.ts",
8
+ "declarations": [],
9
+ "exports": [
10
+ {
11
+ "kind": "custom-element-definition",
12
+ "name": "rc-editor-toolbar",
13
+ "declaration": {
14
+ "name": "RcEditorToolbar",
15
+ "module": "/src/rc-editor-toolbar.ts"
16
+ }
17
+ },
18
+ {
19
+ "kind": "custom-element-definition",
20
+ "name": "rc-markdown-editor",
21
+ "declaration": {
22
+ "name": "RcMarkdownEditor",
23
+ "module": "/src/rc-markdown-editor.ts"
24
+ }
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "kind": "javascript-module",
30
+ "path": "src/formatting.ts",
31
+ "declarations": [
32
+ {
33
+ "kind": "function",
34
+ "name": "getFormatsFromDecorations",
35
+ "return": {
36
+ "type": {
37
+ "text": "Omit<ActiveFormats, 'codeLanguage'>"
38
+ }
39
+ },
40
+ "parameters": [
41
+ {
42
+ "name": "decorations",
43
+ "type": {
44
+ "text": "readonly Decoration[]"
45
+ }
46
+ },
47
+ {
48
+ "name": "start",
49
+ "type": {
50
+ "text": "number"
51
+ }
52
+ },
53
+ {
54
+ "name": "end",
55
+ "type": {
56
+ "text": "number"
57
+ }
58
+ }
59
+ ],
60
+ "description": "Derives active inline and block formats from the decoration array at a given\nselection range in the markdown source editor. Used for toolbar state sync in\nsource mode."
61
+ }
62
+ ],
63
+ "exports": [
64
+ {
65
+ "kind": "js",
66
+ "name": "getFormatsFromDecorations",
67
+ "declaration": {
68
+ "name": "getFormatsFromDecorations",
69
+ "module": "src/formatting.ts"
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "kind": "javascript-module",
76
+ "path": "src/icons.ts",
77
+ "declarations": [
78
+ {
79
+ "kind": "variable",
80
+ "name": "icons",
81
+ "type": {
82
+ "text": "object"
83
+ },
84
+ "default": "{ bold: icon(svg` <path fill=\"currentColor\" d=\"M8.21 13c2.106 0 3.412-1.087 3.412-2.823c0-1.306-.984-2.283-2.324-2.386v-.055a2.176 2.176 0 0 0 1.852-2.14c0-1.51-1.162-2.46-3.014-2.46H3.843V13zM5.908 4.674h1.696c.963 0 1.517.451 1.517 1.244c0 .834-.629 1.32-1.73 1.32H5.908V4.673zm0 6.788V8.598h1.73c1.217 0 1.88.492 1.88 1.415c0 .943-.643 1.449-1.832 1.449H5.907z\"/> `), italic: icon(svg` <path fill=\"currentColor\" d=\"M7.991 11.674L9.53 4.455c.123-.595.246-.71 1.347-.807l.11-.52H7.211l-.11.52c1.06.096 1.128.212 1.005.807L6.57 11.674c-.123.595-.246.71-1.346.806l-.11.52h3.774l.11-.52c-1.06-.095-1.129-.211-1.006-.806z\"/> `), underline: icon(svg` <path fill=\"currentColor\" d=\"M5.313 3.136h-1.23V9.54c0 2.105 1.47 3.623 3.917 3.623s3.917-1.518 3.917-3.623V3.136h-1.23v6.323c0 1.49-.978 2.57-2.687 2.57s-2.687-1.08-2.687-2.57zM12.5 15h-9v-1h9z\"/> `), strikethrough: icon(svg` <path fill=\"currentColor\" d=\"M6.333 5.686c0 .31.083.581.27.814H5.166a2.8 2.8 0 0 1-.099-.76c0-1.627 1.436-2.768 3.48-2.768c1.969 0 3.39 1.175 3.445 2.85h-1.23c-.11-1.08-.964-1.743-2.25-1.743c-1.23 0-2.18.602-2.18 1.607zm2.194 7.478c-2.153 0-3.589-1.107-3.705-2.81h1.23c.144 1.06 1.129 1.703 2.544 1.703c1.34 0 2.31-.705 2.31-1.675c0-.827-.547-1.374-1.914-1.675L8.046 8.5H1v-1h14v1h-3.504c.468.437.675.994.675 1.697c0 1.826-1.436 2.967-3.644 2.967\"/> `), code: icon(svg` <path fill=\"currentColor\" d=\"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8z\"/> `), link: icon(svg` <g fill=\"currentColor\"> <path d=\"M4.715 6.542L3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199a2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z\"/> <path d=\"M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z\"/> </g> `), blockquote: icon(svg` <path fill=\"currentColor\" d=\"M2.5 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm5 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1zm-5 3a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1zm.79-5.373q.168-.117.444-.275L3.524 6q-.183.111-.452.287q-.27.176-.51.428a2.4 2.4 0 0 0-.398.562Q2 7.587 2 7.969q0 .54.217.873q.217.328.72.328q.322 0 .504-.211a.7.7 0 0 0 .188-.463q0-.345-.211-.521q-.205-.182-.568-.182h-.282q.036-.305.123-.498a1.4 1.4 0 0 1 .252-.37a2 2 0 0 1 .346-.298zm2.167 0q.17-.117.445-.275L5.692 6q-.183.111-.452.287q-.27.176-.51.428a2.4 2.4 0 0 0-.398.562q-.165.31-.164.692q0 .54.217.873q.217.328.72.328q.322 0 .504-.211a.7.7 0 0 0 .188-.463q0-.345-.211-.521q-.205-.182-.568-.182h-.282a1.8 1.8 0 0 1 .118-.492q.087-.194.257-.375a2 2 0 0 1 .346-.3z\"/> `), bulletList: icon(svg` <path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m-3 1a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 4a1 1 0 1 0 0-2a1 1 0 0 0 0 2\"/> `), orderedList: icon(svg` <g fill=\"currentColor\"> <path fill-rule=\"evenodd\" d=\"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5\"/> <path d=\"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317c0-.185-.158-.31-.361-.31c-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787c.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8c-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309c.254 0 .424-.145.422-.35c-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844c.583 0 .96.326.96.756c0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508c0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635z\"/> </g> `), codeBlock: icon(svg` <path fill=\"currentColor\" d=\"M2.114 8.063V7.9c1.005-.102 1.497-.615 1.497-1.6V4.503c0-1.094.39-1.538 1.354-1.538h.273V2h-.376C3.25 2 2.49 2.759 2.49 4.352v1.524c0 1.094-.376 1.456-1.49 1.456v1.299c1.114 0 1.49.362 1.49 1.456v1.524c0 1.593.759 2.352 2.372 2.352h.376v-.964h-.273c-.964 0-1.354-.444-1.354-1.538V9.663c0-.984-.492-1.497-1.497-1.6M13.886 7.9v.163c-1.005.103-1.497.616-1.497 1.6v1.798c0 1.094-.39 1.538-1.354 1.538h-.273v.964h.376c1.613 0 2.372-.759 2.372-2.352v-1.524c0-1.094.376-1.456 1.49-1.456V7.332c-1.114 0-1.49-.362-1.49-1.456V4.352C13.51 2.759 12.75 2 11.138 2h-.376v.964h.273c.964 0 1.354.444 1.354 1.538V6.3c0 .984.492 1.497 1.497 1.6\"/> `), source: icon(svg` <g fill=\"currentColor\"> <path d=\"M14 3a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zM2 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z\"/> <path fill-rule=\"evenodd\" d=\"M9.146 8.146a.5.5 0 0 1 .708 0L11.5 9.793l1.646-1.647a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 0-.708\"/> <path fill-rule=\"evenodd\" d=\"M11.5 5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 1 .5-.5\"/> <path d=\"M3.56 11V7.01h.056l1.428 3.239h.774l1.42-3.24h.056V11h1.073V5.001h-1.2l-1.71 3.894h-.039l-1.71-3.894H2.5V11z\"/> </g> `), }"
85
+ }
86
+ ],
87
+ "exports": [
88
+ {
89
+ "kind": "js",
90
+ "name": "icons",
91
+ "declaration": {
92
+ "name": "icons",
93
+ "module": "src/icons.ts"
94
+ }
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "kind": "javascript-module",
100
+ "path": "src/index.ts",
101
+ "declarations": [],
102
+ "exports": [
103
+ {
104
+ "kind": "js",
105
+ "name": "RcMarkdownEditor",
106
+ "declaration": {
107
+ "name": "RcMarkdownEditor",
108
+ "module": "./rc-markdown-editor.ts"
109
+ }
110
+ },
111
+ {
112
+ "kind": "js",
113
+ "name": "RcEditorToolbar",
114
+ "declaration": {
115
+ "name": "RcEditorToolbar",
116
+ "module": "./rc-editor-toolbar.ts"
117
+ }
118
+ },
119
+ {
120
+ "kind": "js",
121
+ "name": "EditorToolbarAction",
122
+ "declaration": {
123
+ "name": "EditorToolbarAction",
124
+ "module": "./types.ts"
125
+ }
126
+ },
127
+ {
128
+ "kind": "js",
129
+ "name": "EditorToolbarActionDetail",
130
+ "declaration": {
131
+ "name": "EditorToolbarActionDetail",
132
+ "module": "./types.ts"
133
+ }
134
+ },
135
+ {
136
+ "kind": "js",
137
+ "name": "ActiveFormats",
138
+ "declaration": {
139
+ "name": "ActiveFormats",
140
+ "module": "./types.ts"
141
+ }
142
+ },
143
+ {
144
+ "kind": "js",
145
+ "name": "EditorMode",
146
+ "declaration": {
147
+ "name": "EditorMode",
148
+ "module": "./types.ts"
149
+ }
150
+ },
151
+ {
152
+ "kind": "js",
153
+ "name": "HeadingLevel",
154
+ "declaration": {
155
+ "name": "HeadingLevel",
156
+ "module": "./types.ts"
157
+ }
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ "kind": "javascript-module",
163
+ "path": "src/rc-editor-toolbar.ts",
164
+ "declarations": [
165
+ {
166
+ "kind": "class",
167
+ "description": "Formatting toolbar for `<rc-markdown-editor>`. Renders into its own light DOM\nso the parent shadow stylesheet can reach `rc-editor-toolbar button` directly.\n\nActive-format properties are set by the parent editor and reflected as\n`aria-pressed` on the corresponding buttons. Heading level is shown via a\n`<select>`. Code-block language is shown via a `<input>` when active.",
168
+ "name": "RcEditorToolbar",
169
+ "members": [
170
+ {
171
+ "kind": "field",
172
+ "name": "label",
173
+ "type": {
174
+ "text": "string"
175
+ },
176
+ "default": "'Formatting'",
177
+ "description": "`aria-label` applied to the `[role=\"toolbar\"]` container.",
178
+ "attribute": "label"
179
+ },
180
+ {
181
+ "kind": "field",
182
+ "name": "activeBold",
183
+ "type": {
184
+ "text": "boolean"
185
+ },
186
+ "default": "false",
187
+ "attribute": "active-bold",
188
+ "reflects": true
189
+ },
190
+ {
191
+ "kind": "field",
192
+ "name": "activeItalic",
193
+ "type": {
194
+ "text": "boolean"
195
+ },
196
+ "default": "false",
197
+ "attribute": "active-italic",
198
+ "reflects": true
199
+ },
200
+ {
201
+ "kind": "field",
202
+ "name": "activeUnderline",
203
+ "type": {
204
+ "text": "boolean"
205
+ },
206
+ "default": "false",
207
+ "attribute": "active-underline",
208
+ "reflects": true
209
+ },
210
+ {
211
+ "kind": "field",
212
+ "name": "activeStrikethrough",
213
+ "type": {
214
+ "text": "boolean"
215
+ },
216
+ "default": "false",
217
+ "attribute": "active-strikethrough",
218
+ "reflects": true
219
+ },
220
+ {
221
+ "kind": "field",
222
+ "name": "activeCode",
223
+ "type": {
224
+ "text": "boolean"
225
+ },
226
+ "default": "false",
227
+ "attribute": "active-code",
228
+ "reflects": true
229
+ },
230
+ {
231
+ "kind": "field",
232
+ "name": "activeHeading",
233
+ "type": {
234
+ "text": "HeadingLevel | null"
235
+ },
236
+ "default": "null",
237
+ "attribute": "active-heading"
238
+ },
239
+ {
240
+ "kind": "field",
241
+ "name": "activeBlockquote",
242
+ "type": {
243
+ "text": "boolean"
244
+ },
245
+ "default": "false",
246
+ "attribute": "active-blockquote",
247
+ "reflects": true
248
+ },
249
+ {
250
+ "kind": "field",
251
+ "name": "activeBulletList",
252
+ "type": {
253
+ "text": "boolean"
254
+ },
255
+ "default": "false",
256
+ "attribute": "active-bullet-list",
257
+ "reflects": true
258
+ },
259
+ {
260
+ "kind": "field",
261
+ "name": "activeOrderedList",
262
+ "type": {
263
+ "text": "boolean"
264
+ },
265
+ "default": "false",
266
+ "attribute": "active-ordered-list",
267
+ "reflects": true
268
+ },
269
+ {
270
+ "kind": "field",
271
+ "name": "activeCodeBlock",
272
+ "type": {
273
+ "text": "boolean"
274
+ },
275
+ "default": "false",
276
+ "attribute": "active-code-block",
277
+ "reflects": true
278
+ },
279
+ {
280
+ "kind": "field",
281
+ "name": "codeLanguage",
282
+ "type": {
283
+ "text": "string | null"
284
+ },
285
+ "default": "null",
286
+ "description": "Language of the code block at the cursor. `null` means not in a code block\n(hides the language input). `''` means no language is set.",
287
+ "attribute": "code-language"
288
+ },
289
+ {
290
+ "kind": "field",
291
+ "name": "sourceMode",
292
+ "type": {
293
+ "text": "boolean"
294
+ },
295
+ "default": "false",
296
+ "description": "Whether the editor is in source mode.",
297
+ "attribute": "source-mode",
298
+ "reflects": true
299
+ },
300
+ {
301
+ "kind": "field",
302
+ "name": "_langInputValue",
303
+ "type": {
304
+ "text": "string"
305
+ },
306
+ "privacy": "private",
307
+ "default": "''",
308
+ "description": "Tracks the in-progress language input value before commit."
309
+ },
310
+ {
311
+ "kind": "method",
312
+ "name": "_dispatch",
313
+ "privacy": "private",
314
+ "parameters": [
315
+ {
316
+ "name": "action",
317
+ "type": {
318
+ "text": "EditorToolbarAction"
319
+ }
320
+ },
321
+ {
322
+ "name": "extra",
323
+ "optional": true,
324
+ "type": {
325
+ "text": "Partial<EditorToolbarActionDetail>"
326
+ }
327
+ }
328
+ ]
329
+ },
330
+ {
331
+ "kind": "field",
332
+ "name": "_onClick",
333
+ "privacy": "private"
334
+ },
335
+ {
336
+ "kind": "field",
337
+ "name": "_onHeadingChange",
338
+ "privacy": "private"
339
+ },
340
+ {
341
+ "kind": "field",
342
+ "name": "_onLangInput",
343
+ "privacy": "private"
344
+ },
345
+ {
346
+ "kind": "field",
347
+ "name": "_onLangCommit",
348
+ "privacy": "private"
349
+ },
350
+ {
351
+ "kind": "field",
352
+ "name": "_onLangKeyDown",
353
+ "privacy": "private"
354
+ }
355
+ ],
356
+ "events": [
357
+ {
358
+ "name": "rc-toolbar-action",
359
+ "type": {
360
+ "text": "CustomEvent"
361
+ },
362
+ "description": "When a formatting button or select is activated."
363
+ }
364
+ ],
365
+ "attributes": [
366
+ {
367
+ "name": "label",
368
+ "type": {
369
+ "text": "string"
370
+ },
371
+ "default": "'Formatting'",
372
+ "description": "`aria-label` applied to the `[role=\"toolbar\"]` container.",
373
+ "fieldName": "label"
374
+ },
375
+ {
376
+ "name": "active-bold",
377
+ "type": {
378
+ "text": "boolean"
379
+ },
380
+ "default": "false",
381
+ "fieldName": "activeBold"
382
+ },
383
+ {
384
+ "name": "active-italic",
385
+ "type": {
386
+ "text": "boolean"
387
+ },
388
+ "default": "false",
389
+ "fieldName": "activeItalic"
390
+ },
391
+ {
392
+ "name": "active-underline",
393
+ "type": {
394
+ "text": "boolean"
395
+ },
396
+ "default": "false",
397
+ "fieldName": "activeUnderline"
398
+ },
399
+ {
400
+ "name": "active-strikethrough",
401
+ "type": {
402
+ "text": "boolean"
403
+ },
404
+ "default": "false",
405
+ "fieldName": "activeStrikethrough"
406
+ },
407
+ {
408
+ "name": "active-code",
409
+ "type": {
410
+ "text": "boolean"
411
+ },
412
+ "default": "false",
413
+ "fieldName": "activeCode"
414
+ },
415
+ {
416
+ "name": "active-heading",
417
+ "type": {
418
+ "text": "HeadingLevel | null"
419
+ },
420
+ "default": "null",
421
+ "fieldName": "activeHeading"
422
+ },
423
+ {
424
+ "name": "active-blockquote",
425
+ "type": {
426
+ "text": "boolean"
427
+ },
428
+ "default": "false",
429
+ "fieldName": "activeBlockquote"
430
+ },
431
+ {
432
+ "name": "active-bullet-list",
433
+ "type": {
434
+ "text": "boolean"
435
+ },
436
+ "default": "false",
437
+ "fieldName": "activeBulletList"
438
+ },
439
+ {
440
+ "name": "active-ordered-list",
441
+ "type": {
442
+ "text": "boolean"
443
+ },
444
+ "default": "false",
445
+ "fieldName": "activeOrderedList"
446
+ },
447
+ {
448
+ "name": "active-code-block",
449
+ "type": {
450
+ "text": "boolean"
451
+ },
452
+ "default": "false",
453
+ "fieldName": "activeCodeBlock"
454
+ },
455
+ {
456
+ "name": "code-language",
457
+ "type": {
458
+ "text": "string | null"
459
+ },
460
+ "default": "null",
461
+ "description": "Language of the code block at the cursor. `null` means not in a code block\n(hides the language input). `''` means no language is set.",
462
+ "fieldName": "codeLanguage"
463
+ },
464
+ {
465
+ "name": "source-mode",
466
+ "type": {
467
+ "text": "boolean"
468
+ },
469
+ "default": "false",
470
+ "description": "Whether the editor is in source mode.",
471
+ "fieldName": "sourceMode"
472
+ }
473
+ ],
474
+ "superclass": {
475
+ "name": "LitElement",
476
+ "package": "lit"
477
+ },
478
+ "tagName": "rc-editor-toolbar",
479
+ "customElement": true
480
+ }
481
+ ],
482
+ "exports": [
483
+ {
484
+ "kind": "js",
485
+ "name": "RcEditorToolbar",
486
+ "declaration": {
487
+ "name": "RcEditorToolbar",
488
+ "module": "src/rc-editor-toolbar.ts"
489
+ }
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ "kind": "javascript-module",
495
+ "path": "src/rc-markdown-editor.ts",
496
+ "declarations": [
497
+ {
498
+ "kind": "class",
499
+ "description": "Markdown-backed rich-text editor with two first-class modes:\n\n- **Rich mode (default)**: A `contenteditable` div shows micromark-rendered\n HTML. DOM mutations are converted back to markdown via turndown and\n written to the backing `<textarea>` for form participation.\n- **Source mode**: An `<rc-textarea>` instance shows the markdown source\n with live decorations. Toggle via `source-mode` attribute or Ctrl+Shift+S.\n\nConsumer markup follows the same progressive-enhancement contract as\n`<rc-textarea>`:\n\n```html\n<rc-markdown-editor>\n <label for=\"body\">Content</label>\n <textarea id=\"body\" name=\"body\"></textarea>\n</rc-markdown-editor>\n```",
500
+ "name": "RcMarkdownEditor",
501
+ "members": [
502
+ {
503
+ "kind": "field",
504
+ "name": "_value",
505
+ "type": {
506
+ "text": "string | undefined"
507
+ },
508
+ "privacy": "private"
509
+ },
510
+ {
511
+ "kind": "field",
512
+ "name": "_defaultValue",
513
+ "type": {
514
+ "text": "string"
515
+ },
516
+ "privacy": "private",
517
+ "default": "''"
518
+ },
519
+ {
520
+ "kind": "field",
521
+ "name": "_valueInitialized",
522
+ "type": {
523
+ "text": "boolean"
524
+ },
525
+ "privacy": "private",
526
+ "default": "false"
527
+ },
528
+ {
529
+ "kind": "field",
530
+ "name": "defaultValue",
531
+ "type": {
532
+ "text": "string"
533
+ },
534
+ "attribute": "default-value"
535
+ },
536
+ {
537
+ "kind": "field",
538
+ "name": "value",
539
+ "type": {
540
+ "text": "string"
541
+ }
542
+ },
543
+ {
544
+ "kind": "field",
545
+ "name": "_sourceMode",
546
+ "type": {
547
+ "text": "boolean | undefined"
548
+ },
549
+ "privacy": "private"
550
+ },
551
+ {
552
+ "kind": "field",
553
+ "name": "_defaultSourceMode",
554
+ "type": {
555
+ "text": "boolean"
556
+ },
557
+ "privacy": "private",
558
+ "default": "false"
559
+ },
560
+ {
561
+ "kind": "field",
562
+ "name": "_sourceModeInitialized",
563
+ "type": {
564
+ "text": "boolean"
565
+ },
566
+ "privacy": "private",
567
+ "default": "false"
568
+ },
569
+ {
570
+ "kind": "field",
571
+ "name": "defaultSourceMode",
572
+ "type": {
573
+ "text": "boolean"
574
+ },
575
+ "attribute": "default-source-mode"
576
+ },
577
+ {
578
+ "kind": "field",
579
+ "name": "sourceMode",
580
+ "type": {
581
+ "text": "boolean"
582
+ },
583
+ "attribute": "source-mode",
584
+ "reflects": true
585
+ },
586
+ {
587
+ "kind": "field",
588
+ "name": "toolbar",
589
+ "type": {
590
+ "text": "boolean"
591
+ },
592
+ "default": "true",
593
+ "description": "Show the formatting toolbar.",
594
+ "attribute": "toolbar",
595
+ "reflects": true
596
+ },
597
+ {
598
+ "kind": "field",
599
+ "name": "readOnly",
600
+ "type": {
601
+ "text": "boolean"
602
+ },
603
+ "default": "false",
604
+ "description": "Make the editor read-only.",
605
+ "attribute": "read-only",
606
+ "reflects": true
607
+ },
608
+ {
609
+ "kind": "field",
610
+ "name": "_richView",
611
+ "type": {
612
+ "text": "HTMLDivElement"
613
+ },
614
+ "privacy": "private"
615
+ },
616
+ {
617
+ "kind": "field",
618
+ "name": "_sourceEditor",
619
+ "type": {
620
+ "text": "RCTextarea"
621
+ },
622
+ "privacy": "private"
623
+ },
624
+ {
625
+ "kind": "field",
626
+ "name": "_toolbarEl",
627
+ "type": {
628
+ "text": "HTMLElement | undefined"
629
+ },
630
+ "privacy": "private"
631
+ },
632
+ {
633
+ "kind": "field",
634
+ "name": "_observer",
635
+ "type": {
636
+ "text": "MutationObserver | null"
637
+ },
638
+ "privacy": "private",
639
+ "default": "null"
640
+ },
641
+ {
642
+ "kind": "field",
643
+ "name": "_savedRichRange",
644
+ "type": {
645
+ "text": "Range | null"
646
+ },
647
+ "privacy": "private",
648
+ "default": "null"
649
+ },
650
+ {
651
+ "kind": "field",
652
+ "name": "_activeFormats",
653
+ "type": {
654
+ "text": "ActiveFormats"
655
+ },
656
+ "privacy": "private",
657
+ "default": "{}"
658
+ },
659
+ {
660
+ "kind": "field",
661
+ "name": "_syncTimer",
662
+ "type": {
663
+ "text": "ReturnType<typeof setTimeout> | null"
664
+ },
665
+ "privacy": "private",
666
+ "default": "null"
667
+ },
668
+ {
669
+ "kind": "field",
670
+ "name": "_pluginApi",
671
+ "type": {
672
+ "text": "RCTextareaPluginAPI | null"
673
+ },
674
+ "privacy": "private",
675
+ "default": "null"
676
+ },
677
+ {
678
+ "kind": "field",
679
+ "name": "_ignoreRichMutations",
680
+ "type": {
681
+ "text": "boolean"
682
+ },
683
+ "privacy": "private",
684
+ "default": "false"
685
+ },
686
+ {
687
+ "kind": "field",
688
+ "name": "_richViewRendered",
689
+ "type": {
690
+ "text": "boolean"
691
+ },
692
+ "privacy": "private",
693
+ "default": "false"
694
+ },
695
+ {
696
+ "kind": "field",
697
+ "name": "_skipNextModeSwitch",
698
+ "type": {
699
+ "text": "boolean"
700
+ },
701
+ "privacy": "private",
702
+ "default": "false"
703
+ },
704
+ {
705
+ "kind": "method",
706
+ "name": "_setRichViewContent",
707
+ "privacy": "private",
708
+ "parameters": [
709
+ {
710
+ "name": "markdown",
711
+ "type": {
712
+ "text": "string"
713
+ }
714
+ }
715
+ ]
716
+ },
717
+ {
718
+ "kind": "method",
719
+ "name": "_renderMarkdown",
720
+ "privacy": "private",
721
+ "return": {
722
+ "type": {
723
+ "text": "string"
724
+ }
725
+ },
726
+ "parameters": [
727
+ {
728
+ "name": "markdown",
729
+ "type": {
730
+ "text": "string"
731
+ }
732
+ }
733
+ ]
734
+ },
735
+ {
736
+ "kind": "method",
737
+ "name": "_scheduleMarkdownSync",
738
+ "privacy": "private"
739
+ },
740
+ {
741
+ "kind": "method",
742
+ "name": "_syncMarkdownFromRichView",
743
+ "privacy": "private"
744
+ },
745
+ {
746
+ "kind": "method",
747
+ "name": "_switchToSource",
748
+ "privacy": "private"
749
+ },
750
+ {
751
+ "kind": "method",
752
+ "name": "_switchToRich",
753
+ "privacy": "private"
754
+ },
755
+ {
756
+ "kind": "field",
757
+ "name": "_cachedTree",
758
+ "type": {
759
+ "text": "ReturnType<typeof fromMarkdown> | null"
760
+ },
761
+ "privacy": "private",
762
+ "default": "null"
763
+ },
764
+ {
765
+ "kind": "method",
766
+ "name": "_setupSourcePlugin",
767
+ "privacy": "private"
768
+ },
769
+ {
770
+ "kind": "method",
771
+ "name": "_getCodeBlockLanguage",
772
+ "privacy": "private",
773
+ "return": {
774
+ "type": {
775
+ "text": "string | null"
776
+ }
777
+ },
778
+ "parameters": [
779
+ {
780
+ "name": "tree",
781
+ "type": {
782
+ "text": "ReturnType<typeof fromMarkdown>"
783
+ }
784
+ },
785
+ {
786
+ "name": "offset",
787
+ "type": {
788
+ "text": "number"
789
+ }
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "kind": "field",
795
+ "name": "_onSourceChange",
796
+ "privacy": "private"
797
+ },
798
+ {
799
+ "kind": "field",
800
+ "name": "_onToolbarAction",
801
+ "privacy": "private"
802
+ },
803
+ {
804
+ "kind": "method",
805
+ "name": "_applyRichFormat",
806
+ "privacy": "private",
807
+ "parameters": [
808
+ {
809
+ "name": "action",
810
+ "type": {
811
+ "text": "EditorToolbarAction"
812
+ }
813
+ }
814
+ ]
815
+ },
816
+ {
817
+ "kind": "method",
818
+ "name": "_applySourceFormat",
819
+ "privacy": "private",
820
+ "parameters": [
821
+ {
822
+ "name": "action",
823
+ "type": {
824
+ "text": "EditorToolbarAction"
825
+ }
826
+ }
827
+ ]
828
+ },
829
+ {
830
+ "kind": "method",
831
+ "name": "_setSourceHeadingLevel",
832
+ "privacy": "private",
833
+ "parameters": [
834
+ {
835
+ "name": "level",
836
+ "type": {
837
+ "text": "HeadingLevel | null"
838
+ }
839
+ }
840
+ ],
841
+ "description": "Sets the heading level on the cursor's line in source mode. null = paragraph."
842
+ },
843
+ {
844
+ "kind": "method",
845
+ "name": "_setSourceCodeBlockLanguage",
846
+ "privacy": "private",
847
+ "parameters": [
848
+ {
849
+ "name": "lang",
850
+ "type": {
851
+ "text": "string"
852
+ }
853
+ }
854
+ ],
855
+ "description": "Updates the language of the code block at the cursor in source mode."
856
+ },
857
+ {
858
+ "kind": "method",
859
+ "name": "_setRichCodeBlockLanguage",
860
+ "privacy": "private",
861
+ "parameters": [
862
+ {
863
+ "name": "lang",
864
+ "type": {
865
+ "text": "string"
866
+ }
867
+ }
868
+ ],
869
+ "description": "Updates the data-lang attribute on the <pre> at the cursor in rich mode."
870
+ },
871
+ {
872
+ "kind": "method",
873
+ "name": "_toggleLinePrefix",
874
+ "privacy": "private",
875
+ "parameters": [
876
+ {
877
+ "name": "prefix",
878
+ "type": {
879
+ "text": "string"
880
+ }
881
+ }
882
+ ],
883
+ "description": "Toggles a line prefix (e.g. `'# '`, `'> '`, `'- '`) on the cursor's line."
884
+ },
885
+ {
886
+ "kind": "method",
887
+ "name": "_toggleSourceCodeFence",
888
+ "privacy": "private",
889
+ "description": "Wraps the current selection (or cursor line) with a fenced code block."
890
+ },
891
+ {
892
+ "kind": "method",
893
+ "name": "_wrapRichSelection",
894
+ "privacy": "private",
895
+ "parameters": [
896
+ {
897
+ "name": "tag",
898
+ "type": {
899
+ "text": "string"
900
+ }
901
+ }
902
+ ]
903
+ },
904
+ {
905
+ "kind": "method",
906
+ "name": "_toggleRichCodeBlock",
907
+ "privacy": "private"
908
+ },
909
+ {
910
+ "kind": "field",
911
+ "name": "_onKeyDown",
912
+ "privacy": "private"
913
+ },
914
+ {
915
+ "kind": "field",
916
+ "name": "_onSelectionChange",
917
+ "privacy": "private"
918
+ },
919
+ {
920
+ "kind": "method",
921
+ "name": "_pushToolbarState",
922
+ "privacy": "private"
923
+ },
924
+ {
925
+ "kind": "method",
926
+ "name": "_syncNativeTextarea",
927
+ "privacy": "private"
928
+ },
929
+ {
930
+ "kind": "method",
931
+ "name": "_connectLabel",
932
+ "privacy": "private"
933
+ },
934
+ {
935
+ "kind": "method",
936
+ "name": "_dispatchChange",
937
+ "privacy": "private",
938
+ "parameters": [
939
+ {
940
+ "name": "value",
941
+ "type": {
942
+ "text": "string"
943
+ }
944
+ }
945
+ ]
946
+ },
947
+ {
948
+ "kind": "method",
949
+ "name": "_dispatchModeChange",
950
+ "privacy": "private",
951
+ "parameters": [
952
+ {
953
+ "name": "mode",
954
+ "type": {
955
+ "text": "EditorMode"
956
+ }
957
+ }
958
+ ]
959
+ }
960
+ ],
961
+ "events": [
962
+ {
963
+ "name": "rc-formatting-change",
964
+ "type": {
965
+ "text": "CustomEvent"
966
+ },
967
+ "description": "Active formats at cursor changed. Detail: `ActiveFormats`."
968
+ },
969
+ {
970
+ "name": "rc-change",
971
+ "type": {
972
+ "text": "CustomEvent"
973
+ },
974
+ "description": "Value changed. Detail: `{ value: string }`."
975
+ },
976
+ {
977
+ "name": "rc-mode-change",
978
+ "type": {
979
+ "text": "CustomEvent"
980
+ },
981
+ "description": "Mode toggled. Detail: `{ mode: EditorMode }`."
982
+ }
983
+ ],
984
+ "attributes": [
985
+ {
986
+ "type": {
987
+ "text": "boolean"
988
+ },
989
+ "description": "Show the formatting toolbar.",
990
+ "name": "toolbar",
991
+ "default": "true",
992
+ "fieldName": "toolbar"
993
+ },
994
+ {
995
+ "type": {
996
+ "text": "boolean"
997
+ },
998
+ "description": "Controlled: show the markdown source editor.",
999
+ "name": "source-mode",
1000
+ "fieldName": "sourceMode"
1001
+ },
1002
+ {
1003
+ "type": {
1004
+ "text": "boolean"
1005
+ },
1006
+ "description": "Uncontrolled initial source-mode state.",
1007
+ "name": "default-source-mode",
1008
+ "fieldName": "defaultSourceMode"
1009
+ },
1010
+ {
1011
+ "type": {
1012
+ "text": "boolean"
1013
+ },
1014
+ "description": "Make the editor read-only.",
1015
+ "name": "read-only",
1016
+ "default": "false",
1017
+ "fieldName": "readOnly"
1018
+ },
1019
+ {
1020
+ "name": "default-value",
1021
+ "type": {
1022
+ "text": "string"
1023
+ },
1024
+ "fieldName": "defaultValue"
1025
+ }
1026
+ ],
1027
+ "superclass": {
1028
+ "name": "LitElement",
1029
+ "package": "lit"
1030
+ },
1031
+ "tagName": "rc-markdown-editor",
1032
+ "customElement": true
1033
+ },
1034
+ {
1035
+ "kind": "variable",
1036
+ "name": "from"
1037
+ },
1038
+ {
1039
+ "kind": "variable",
1040
+ "name": "to"
1041
+ }
1042
+ ],
1043
+ "exports": [
1044
+ {
1045
+ "kind": "js",
1046
+ "name": "RcMarkdownEditor",
1047
+ "declaration": {
1048
+ "name": "RcMarkdownEditor",
1049
+ "module": "src/rc-markdown-editor.ts"
1050
+ }
1051
+ }
1052
+ ]
1053
+ },
1054
+ {
1055
+ "kind": "javascript-module",
1056
+ "path": "src/types.ts",
1057
+ "declarations": [],
1058
+ "exports": []
1059
+ }
1060
+ ]
1061
+ }