@rcarls/rc-textarea 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.
Files changed (28) hide show
  1. package/README.md +1311 -0
  2. package/dist/custom-elements.json +2103 -0
  3. package/dist/demo.css +85 -0
  4. package/dist/demo.js +40 -0
  5. package/dist/line-actions-controller-BsM6DJ0b.js +2334 -0
  6. package/dist/line-actions-controller-BsM6DJ0b.js.map +1 -0
  7. package/dist/rc-textarea-define.js +10 -0
  8. package/dist/rc-textarea-define.js.map +1 -0
  9. package/dist/rc-textarea.js +8 -0
  10. package/dist/rc-textarea.js.map +1 -0
  11. package/dist/types/packages/rc-textarea/src/blots.d.ts +39 -0
  12. package/dist/types/packages/rc-textarea/src/decoration.d.ts +65 -0
  13. package/dist/types/packages/rc-textarea/src/decoration.test.d.ts +1 -0
  14. package/dist/types/packages/rc-textarea/src/define.d.ts +1 -0
  15. package/dist/types/packages/rc-textarea/src/document.d.ts +19 -0
  16. package/dist/types/packages/rc-textarea/src/index.d.ts +7 -0
  17. package/dist/types/packages/rc-textarea/src/line-actions-controller.d.ts +91 -0
  18. package/dist/types/packages/rc-textarea/src/line-decorator.d.ts +57 -0
  19. package/dist/types/packages/rc-textarea/src/line-decorator.test.d.ts +1 -0
  20. package/dist/types/packages/rc-textarea/src/pattern-matcher.d.ts +23 -0
  21. package/dist/types/packages/rc-textarea/src/pattern-matcher.test.d.ts +1 -0
  22. package/dist/types/packages/rc-textarea/src/rc-textarea.d.ts +194 -0
  23. package/dist/types/packages/rc-textarea/src/rc-textarea.styles.d.ts +1 -0
  24. package/dist/types/packages/rc-textarea/src/rc-textarea.test.d.ts +0 -0
  25. package/dist/types/packages/rc-textarea/src/selection.d.ts +39 -0
  26. package/dist/types/packages/rc-textarea/src/test-helpers.d.ts +18 -0
  27. package/dist/types/packages/rc-textarea/src/types.d.ts +394 -0
  28. package/package.json +68 -0
@@ -0,0 +1,2103 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/decoration.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "function",
11
+ "name": "findEdit",
12
+ "return": {
13
+ "type": {
14
+ "text": "Edit"
15
+ }
16
+ },
17
+ "parameters": [
18
+ {
19
+ "name": "oldValue",
20
+ "type": {
21
+ "text": "string"
22
+ }
23
+ },
24
+ {
25
+ "name": "newValue",
26
+ "type": {
27
+ "text": "string"
28
+ }
29
+ }
30
+ ],
31
+ "description": "Find the single contiguous edit region that transforms `oldValue` into\n`newValue` by trimming equal prefix and suffix.\n\nThis is a heuristic (\"longest common prefix/suffix\"), not a full LCS diff.\nIt assumes the browser makes one contiguous edit per input event, which holds\ntrue for normal typing, deletion, and paste."
32
+ },
33
+ {
34
+ "kind": "function",
35
+ "name": "mapDecorationsThroughChange",
36
+ "return": {
37
+ "type": {
38
+ "text": "Decoration[]"
39
+ }
40
+ },
41
+ "parameters": [
42
+ {
43
+ "name": "decorations",
44
+ "type": {
45
+ "text": "Decoration[]"
46
+ }
47
+ },
48
+ {
49
+ "name": "oldValue",
50
+ "type": {
51
+ "text": "string"
52
+ }
53
+ },
54
+ {
55
+ "name": "newValue",
56
+ "type": {
57
+ "text": "string"
58
+ }
59
+ }
60
+ ],
61
+ "description": "Remap all decorations in `decorations` from positions in `oldValue` to\npositions in `newValue`, assuming a single contiguous edit.\n\n- `MarkDecoration`: remapped via `remapMarkRange`; dropped if collapsed.\n- `LineDecoration`: dropped if its line falls within the deleted region;\n otherwise shifted by the line delta.\n- `WidgetDecoration`: treated like a zero-width mark at its offset.\n\nReturns a new array. The input array and its elements are not mutated."
62
+ },
63
+ {
64
+ "kind": "function",
65
+ "name": "isLargeChange",
66
+ "return": {
67
+ "type": {
68
+ "text": "boolean"
69
+ }
70
+ },
71
+ "parameters": [
72
+ {
73
+ "name": "oldValue",
74
+ "type": {
75
+ "text": "string"
76
+ }
77
+ },
78
+ {
79
+ "name": "edit",
80
+ "type": {
81
+ "text": "Edit"
82
+ }
83
+ }
84
+ ],
85
+ "description": "Heuristic: returns `true` when an edit is large enough that remapping\ndecorations would likely produce incorrect results and it's better to\nclear them entirely.\n\nThreshold: the change affects > 50 characters **and** > 50% of the document.\nThis covers paste of large blocks, select-all + type, and programmatic value\nsets with substantially different content. It deliberately ignores inserts\ninto an empty document (no existing decorations to preserve)."
86
+ },
87
+ {
88
+ "kind": "function",
89
+ "name": "mapOrClear",
90
+ "return": {
91
+ "type": {
92
+ "text": "Decoration[]"
93
+ }
94
+ },
95
+ "parameters": [
96
+ {
97
+ "name": "decorations",
98
+ "type": {
99
+ "text": "Decoration[]"
100
+ }
101
+ },
102
+ {
103
+ "name": "oldValue",
104
+ "type": {
105
+ "text": "string"
106
+ }
107
+ },
108
+ {
109
+ "name": "newValue",
110
+ "type": {
111
+ "text": "string"
112
+ }
113
+ }
114
+ ],
115
+ "description": "Map decorations through a text change, or clear them entirely if the change\nis classified as \"large\" (see `isLargeChange`).\n\nThis is the primary entry point used by the component on each input event."
116
+ },
117
+ {
118
+ "kind": "function",
119
+ "name": "addDecoration",
120
+ "return": {
121
+ "type": {
122
+ "text": "string"
123
+ }
124
+ },
125
+ "parameters": [
126
+ {
127
+ "name": "map",
128
+ "type": {
129
+ "text": "Map<string, Decoration>"
130
+ }
131
+ },
132
+ {
133
+ "name": "input",
134
+ "type": {
135
+ "text": "DecorationInput"
136
+ }
137
+ }
138
+ ],
139
+ "description": "Add a single decoration to `map`, assigning it a fresh UUID as its `id`.\nReturns the assigned ID."
140
+ },
141
+ {
142
+ "kind": "function",
143
+ "name": "setDecorations",
144
+ "return": {
145
+ "type": {
146
+ "text": "void"
147
+ }
148
+ },
149
+ "parameters": [
150
+ {
151
+ "name": "map",
152
+ "type": {
153
+ "text": "Map<string, Decoration>"
154
+ }
155
+ },
156
+ {
157
+ "name": "inputs",
158
+ "type": {
159
+ "text": "DecorationInput[]"
160
+ }
161
+ }
162
+ ],
163
+ "description": "Replace all decorations in `map` with a new set derived from `inputs`.\nEach input is assigned a fresh UUID."
164
+ }
165
+ ],
166
+ "exports": [
167
+ {
168
+ "kind": "js",
169
+ "name": "generateId",
170
+ "declaration": {
171
+ "name": "generateId",
172
+ "module": "./types.ts"
173
+ }
174
+ },
175
+ {
176
+ "kind": "js",
177
+ "name": "findEdit",
178
+ "declaration": {
179
+ "name": "findEdit",
180
+ "module": "src/decoration.ts"
181
+ }
182
+ },
183
+ {
184
+ "kind": "js",
185
+ "name": "mapDecorationsThroughChange",
186
+ "declaration": {
187
+ "name": "mapDecorationsThroughChange",
188
+ "module": "src/decoration.ts"
189
+ }
190
+ },
191
+ {
192
+ "kind": "js",
193
+ "name": "isLargeChange",
194
+ "declaration": {
195
+ "name": "isLargeChange",
196
+ "module": "src/decoration.ts"
197
+ }
198
+ },
199
+ {
200
+ "kind": "js",
201
+ "name": "mapOrClear",
202
+ "declaration": {
203
+ "name": "mapOrClear",
204
+ "module": "src/decoration.ts"
205
+ }
206
+ },
207
+ {
208
+ "kind": "js",
209
+ "name": "addDecoration",
210
+ "declaration": {
211
+ "name": "addDecoration",
212
+ "module": "src/decoration.ts"
213
+ }
214
+ },
215
+ {
216
+ "kind": "js",
217
+ "name": "setDecorations",
218
+ "declaration": {
219
+ "name": "setDecorations",
220
+ "module": "src/decoration.ts"
221
+ }
222
+ },
223
+ {
224
+ "kind": "js",
225
+ "name": "MarkDecoration",
226
+ "declaration": {
227
+ "name": "MarkDecoration",
228
+ "module": "src/decoration.ts"
229
+ }
230
+ },
231
+ {
232
+ "kind": "js",
233
+ "name": "LineDecoration",
234
+ "declaration": {
235
+ "name": "LineDecoration",
236
+ "module": "src/decoration.ts"
237
+ }
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "kind": "javascript-module",
243
+ "path": "src/define.ts",
244
+ "declarations": [],
245
+ "exports": [
246
+ {
247
+ "kind": "custom-element-definition",
248
+ "name": "rc-textarea",
249
+ "declaration": {
250
+ "name": "RCTextarea",
251
+ "module": "/src/index.js"
252
+ }
253
+ },
254
+ {
255
+ "kind": "js",
256
+ "name": "*",
257
+ "declaration": {
258
+ "name": "*",
259
+ "module": "src/index.js"
260
+ }
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "kind": "javascript-module",
266
+ "path": "src/document.ts",
267
+ "declarations": [
268
+ {
269
+ "kind": "class",
270
+ "description": "",
271
+ "name": "V2Document",
272
+ "members": [
273
+ {
274
+ "kind": "field",
275
+ "name": "scroll",
276
+ "type": {
277
+ "text": "V2ScrollBlot"
278
+ },
279
+ "privacy": "private",
280
+ "readonly": true,
281
+ "default": "new V2ScrollBlot(registry, editorEl)"
282
+ },
283
+ {
284
+ "kind": "method",
285
+ "name": "build",
286
+ "return": {
287
+ "type": {
288
+ "text": "void"
289
+ }
290
+ },
291
+ "parameters": [
292
+ {
293
+ "name": "value",
294
+ "type": {
295
+ "text": "string"
296
+ }
297
+ },
298
+ {
299
+ "name": "decorations",
300
+ "type": {
301
+ "text": "Decoration[]"
302
+ }
303
+ }
304
+ ],
305
+ "description": "Rebuild the document tree from `value` + `decorations`.\nReuses existing `.v2-line` elements in place to preserve DOM identity\nacross renders (fixes DevTools node tracking and mouse gesture continuity).\nOnly the children of each line are replaced; the line element itself survives."
306
+ },
307
+ {
308
+ "kind": "method",
309
+ "name": "destroy",
310
+ "return": {
311
+ "type": {
312
+ "text": "void"
313
+ }
314
+ }
315
+ }
316
+ ]
317
+ },
318
+ {
319
+ "kind": "function",
320
+ "name": "extractEditorText",
321
+ "return": {
322
+ "type": {
323
+ "text": "string"
324
+ }
325
+ },
326
+ "parameters": [
327
+ {
328
+ "name": "editorEl",
329
+ "type": {
330
+ "text": "HTMLElement"
331
+ }
332
+ }
333
+ ],
334
+ "description": "Extracts plain text directly from the editor's contenteditable DOM.\nHandles our structured .v2-line divs as well as browser-inserted markup\nfrom edits that happen between render frames."
335
+ }
336
+ ],
337
+ "exports": [
338
+ {
339
+ "kind": "js",
340
+ "name": "V2Document",
341
+ "declaration": {
342
+ "name": "V2Document",
343
+ "module": "src/document.ts"
344
+ }
345
+ },
346
+ {
347
+ "kind": "js",
348
+ "name": "extractEditorText",
349
+ "declaration": {
350
+ "name": "extractEditorText",
351
+ "module": "src/document.ts"
352
+ }
353
+ }
354
+ ]
355
+ },
356
+ {
357
+ "kind": "javascript-module",
358
+ "path": "src/index.ts",
359
+ "declarations": [],
360
+ "exports": [
361
+ {
362
+ "kind": "js",
363
+ "name": "RCTextarea",
364
+ "declaration": {
365
+ "name": "RCTextarea",
366
+ "module": "./rc-textarea.ts"
367
+ }
368
+ },
369
+ {
370
+ "kind": "js",
371
+ "name": "Decoration",
372
+ "declaration": {
373
+ "name": "Decoration",
374
+ "module": "./types.ts"
375
+ }
376
+ },
377
+ {
378
+ "kind": "js",
379
+ "name": "DecorationInput",
380
+ "declaration": {
381
+ "name": "DecorationInput",
382
+ "module": "./types.ts"
383
+ }
384
+ },
385
+ {
386
+ "kind": "js",
387
+ "name": "MarkDecoration",
388
+ "declaration": {
389
+ "name": "MarkDecoration",
390
+ "module": "./types.ts"
391
+ }
392
+ },
393
+ {
394
+ "kind": "js",
395
+ "name": "MarkDecorationStyle",
396
+ "declaration": {
397
+ "name": "MarkDecorationStyle",
398
+ "module": "./types.ts"
399
+ }
400
+ },
401
+ {
402
+ "kind": "js",
403
+ "name": "LineDecoration",
404
+ "declaration": {
405
+ "name": "LineDecoration",
406
+ "module": "./types.ts"
407
+ }
408
+ },
409
+ {
410
+ "kind": "js",
411
+ "name": "WidgetDecoration",
412
+ "declaration": {
413
+ "name": "WidgetDecoration",
414
+ "module": "./types.ts"
415
+ }
416
+ },
417
+ {
418
+ "kind": "js",
419
+ "name": "RCTextareaPlugin",
420
+ "declaration": {
421
+ "name": "RCTextareaPlugin",
422
+ "module": "./types.ts"
423
+ }
424
+ },
425
+ {
426
+ "kind": "js",
427
+ "name": "RCTextareaPluginAPI",
428
+ "declaration": {
429
+ "name": "RCTextareaPluginAPI",
430
+ "module": "./types.ts"
431
+ }
432
+ },
433
+ {
434
+ "kind": "js",
435
+ "name": "TextPattern",
436
+ "declaration": {
437
+ "name": "TextPattern",
438
+ "module": "./types.ts"
439
+ }
440
+ },
441
+ {
442
+ "kind": "js",
443
+ "name": "LineDecoratorPlugin",
444
+ "declaration": {
445
+ "name": "LineDecoratorPlugin",
446
+ "module": "./types.ts"
447
+ }
448
+ },
449
+ {
450
+ "kind": "js",
451
+ "name": "Token",
452
+ "declaration": {
453
+ "name": "Token",
454
+ "module": "./types.ts"
455
+ }
456
+ },
457
+ {
458
+ "kind": "js",
459
+ "name": "matchPatternResults",
460
+ "declaration": {
461
+ "name": "matchPatternResults",
462
+ "module": "./pattern-matcher.ts"
463
+ }
464
+ },
465
+ {
466
+ "kind": "js",
467
+ "name": "createLineDecoratorPlugin",
468
+ "declaration": {
469
+ "name": "createLineDecoratorPlugin",
470
+ "module": "./line-decorator.ts"
471
+ }
472
+ },
473
+ {
474
+ "kind": "js",
475
+ "name": "LineDecoratorPluginOptions",
476
+ "declaration": {
477
+ "name": "LineDecoratorPluginOptions",
478
+ "module": "./line-decorator.ts"
479
+ }
480
+ },
481
+ {
482
+ "kind": "js",
483
+ "name": "LineActionsController",
484
+ "declaration": {
485
+ "name": "LineActionsController",
486
+ "module": "./line-actions-controller.ts"
487
+ }
488
+ },
489
+ {
490
+ "kind": "js",
491
+ "name": "LineAction",
492
+ "declaration": {
493
+ "name": "LineAction",
494
+ "module": "./line-actions-controller.ts"
495
+ }
496
+ },
497
+ {
498
+ "kind": "js",
499
+ "name": "LineActionsOptions",
500
+ "declaration": {
501
+ "name": "LineActionsOptions",
502
+ "module": "./line-actions-controller.ts"
503
+ }
504
+ }
505
+ ]
506
+ },
507
+ {
508
+ "kind": "javascript-module",
509
+ "path": "src/line-actions-controller.ts",
510
+ "declarations": [
511
+ {
512
+ "kind": "class",
513
+ "description": "Helper class for plugins that need to show inline action buttons next to a\nline, or a floating popover panel anchored to the active line.\n\nInstantiate in `mount()`, call `getDecorations()` / `getDecorationsForLines()`\nfrom `update()`, and call `destroy()` from the plugin's `destroy()`.",
514
+ "name": "LineActionsController",
515
+ "members": [
516
+ {
517
+ "kind": "field",
518
+ "name": "_api",
519
+ "type": {
520
+ "text": "RCTextareaPluginAPI"
521
+ },
522
+ "privacy": "private",
523
+ "readonly": true,
524
+ "default": "api"
525
+ },
526
+ {
527
+ "kind": "field",
528
+ "name": "_options",
529
+ "type": {
530
+ "text": "LineActionsOptions"
531
+ },
532
+ "privacy": "private",
533
+ "readonly": true
534
+ },
535
+ {
536
+ "kind": "field",
537
+ "name": "_popover",
538
+ "type": {
539
+ "text": "HTMLDivElement | null"
540
+ },
541
+ "privacy": "private",
542
+ "default": "null"
543
+ },
544
+ {
545
+ "kind": "field",
546
+ "name": "_lastActionsKey",
547
+ "type": {
548
+ "text": "string"
549
+ },
550
+ "privacy": "private",
551
+ "default": "''"
552
+ },
553
+ {
554
+ "kind": "field",
555
+ "name": "_blurHandler",
556
+ "type": {
557
+ "text": "() => void"
558
+ },
559
+ "privacy": "private",
560
+ "readonly": true
561
+ },
562
+ {
563
+ "kind": "method",
564
+ "name": "getDecorations",
565
+ "return": {
566
+ "type": {
567
+ "text": "DecorationInput[]"
568
+ }
569
+ },
570
+ "parameters": [
571
+ {
572
+ "name": "lineIndex",
573
+ "type": {
574
+ "text": "number"
575
+ }
576
+ },
577
+ {
578
+ "name": "actions",
579
+ "type": {
580
+ "text": "LineAction[]"
581
+ }
582
+ },
583
+ {
584
+ "name": "value",
585
+ "type": {
586
+ "text": "string"
587
+ }
588
+ },
589
+ {
590
+ "name": "renderMode",
591
+ "type": {
592
+ "text": "'inline' | 'popover'"
593
+ }
594
+ }
595
+ ],
596
+ "description": "Call from plugin's `update()`. Pass the line index, its actions, the full\nvalue, and the current render mode.\n\n- `'inline'`: returns a `WidgetDecoration[]` to merge into `setDecorations()`.\n- `'popover'`: returns `[]` and manages a floating panel as a side effect.\n\nPassing an empty actions array hides the popover and returns `[]`."
597
+ },
598
+ {
599
+ "kind": "method",
600
+ "name": "getDecorationsForLines",
601
+ "return": {
602
+ "type": {
603
+ "text": "DecorationInput[]"
604
+ }
605
+ },
606
+ "parameters": [
607
+ {
608
+ "name": "lineActions",
609
+ "type": {
610
+ "text": "Map<number, LineAction[]>"
611
+ }
612
+ },
613
+ {
614
+ "name": "value",
615
+ "type": {
616
+ "text": "string"
617
+ }
618
+ },
619
+ {
620
+ "name": "renderMode",
621
+ "type": {
622
+ "text": "'inline' | 'popover'"
623
+ }
624
+ },
625
+ {
626
+ "name": "activeLineIndex",
627
+ "optional": true,
628
+ "type": {
629
+ "text": "number"
630
+ }
631
+ }
632
+ ],
633
+ "description": "Variant for `showOn: 'always'` — one entry per line with actions.\n\nIn popover mode only the `activeLineIndex` line is shown; in inline mode\nevery line with non-empty actions gets a widget."
634
+ },
635
+ {
636
+ "kind": "method",
637
+ "name": "destroy",
638
+ "return": {
639
+ "type": {
640
+ "text": "void"
641
+ }
642
+ },
643
+ "description": "Remove the floating panel and detach all listeners. Call from plugin `destroy()`."
644
+ },
645
+ {
646
+ "kind": "method",
647
+ "name": "getActiveLineIndex",
648
+ "static": true,
649
+ "return": {
650
+ "type": {
651
+ "text": "number"
652
+ }
653
+ },
654
+ "parameters": [
655
+ {
656
+ "name": "value",
657
+ "type": {
658
+ "text": "string"
659
+ }
660
+ },
661
+ {
662
+ "name": "selectionStart",
663
+ "type": {
664
+ "text": "number"
665
+ }
666
+ }
667
+ ],
668
+ "description": "Derive the 0-based line index from a plain-text character offset."
669
+ },
670
+ {
671
+ "kind": "method",
672
+ "name": "_lineEndOffset",
673
+ "privacy": "private",
674
+ "static": true,
675
+ "return": {
676
+ "type": {
677
+ "text": "number"
678
+ }
679
+ },
680
+ "parameters": [
681
+ {
682
+ "name": "value",
683
+ "type": {
684
+ "text": "string"
685
+ }
686
+ },
687
+ {
688
+ "name": "lineIndex",
689
+ "type": {
690
+ "text": "number"
691
+ }
692
+ }
693
+ ],
694
+ "description": "Character offset of the end of the given 0-based line (points at the\nnewline character, or end-of-string for the last line)."
695
+ },
696
+ {
697
+ "kind": "method",
698
+ "name": "_showPopover",
699
+ "privacy": "private",
700
+ "return": {
701
+ "type": {
702
+ "text": "void"
703
+ }
704
+ },
705
+ "parameters": [
706
+ {
707
+ "name": "actions",
708
+ "type": {
709
+ "text": "LineAction[]"
710
+ }
711
+ }
712
+ ]
713
+ },
714
+ {
715
+ "kind": "method",
716
+ "name": "_positionPopover",
717
+ "privacy": "private",
718
+ "return": {
719
+ "type": {
720
+ "text": "void"
721
+ }
722
+ }
723
+ },
724
+ {
725
+ "kind": "method",
726
+ "name": "_hidePopover",
727
+ "privacy": "private",
728
+ "return": {
729
+ "type": {
730
+ "text": "void"
731
+ }
732
+ }
733
+ }
734
+ ]
735
+ }
736
+ ],
737
+ "exports": [
738
+ {
739
+ "kind": "js",
740
+ "name": "LineActionsController",
741
+ "declaration": {
742
+ "name": "LineActionsController",
743
+ "module": "src/line-actions-controller.ts"
744
+ }
745
+ }
746
+ ]
747
+ },
748
+ {
749
+ "kind": "javascript-module",
750
+ "path": "src/line-decorator.ts",
751
+ "declarations": [
752
+ {
753
+ "kind": "function",
754
+ "name": "createLineDecoratorPlugin",
755
+ "return": {
756
+ "type": {
757
+ "text": "RCTextareaPlugin"
758
+ }
759
+ },
760
+ "parameters": [
761
+ {
762
+ "name": "decorator",
763
+ "type": {
764
+ "text": "LineDecoratorPlugin"
765
+ }
766
+ },
767
+ {
768
+ "name": "options",
769
+ "default": "{}",
770
+ "type": {
771
+ "text": "LineDecoratorPluginOptions"
772
+ }
773
+ }
774
+ ],
775
+ "description": "Factory that wraps a `LineDecoratorPlugin` in a full `RCTextareaPlugin`.\n\nHandles the boilerplate that every per-line decorator needs:\n- CSS injection via `api.adoptStyleSheet` on mount\n- `lineStart` offset bookkeeping when converting line-relative offsets to\n absolute document offsets\n- Subscribing to external change signals and calling `api.scheduleUpdate()`\n- Cleanup of subscribers on destroy"
776
+ }
777
+ ],
778
+ "exports": [
779
+ {
780
+ "kind": "js",
781
+ "name": "createLineDecoratorPlugin",
782
+ "declaration": {
783
+ "name": "createLineDecoratorPlugin",
784
+ "module": "src/line-decorator.ts"
785
+ }
786
+ }
787
+ ]
788
+ },
789
+ {
790
+ "kind": "javascript-module",
791
+ "path": "src/pattern-matcher.ts",
792
+ "declarations": [
793
+ {
794
+ "kind": "function",
795
+ "name": "matchPatternResults",
796
+ "return": {
797
+ "type": {
798
+ "text": "{ markDecorations: Omit<MarkDecoration, 'id'>[]; lineDecorations: Omit<LineDecoration, 'id'>[] }"
799
+ }
800
+ },
801
+ "parameters": [
802
+ {
803
+ "name": "value",
804
+ "type": {
805
+ "text": "string"
806
+ }
807
+ },
808
+ {
809
+ "name": "patterns",
810
+ "type": {
811
+ "text": "TextPattern[]"
812
+ }
813
+ }
814
+ ],
815
+ "description": "Run all `patterns` against `value` and collect every match as decorations.\n\nFor each pattern:\n- If `captureGroups` is set, one `MarkDecoration` is emitted **per named\n capture group** instead of one for the whole match. Unmatched optional\n groups are silently skipped. The `d` flag (match indices) is added to\n the regex automatically.\n- Otherwise, one `MarkDecoration` covering the entire match is emitted,\n using the styling fields copied directly from the pattern.\n- If `createLineDecoration` is provided, it is called for every match\n (regardless of `captureGroups`) and may produce a paired `LineDecoration`.\n\nThe global flag is added automatically if missing to ensure all occurrences\nare found and to avoid stateful `lastIndex` bugs on the caller's regex.\nZero-length matches are skipped to prevent infinite loops."
816
+ }
817
+ ],
818
+ "exports": [
819
+ {
820
+ "kind": "js",
821
+ "name": "TextPattern",
822
+ "declaration": {
823
+ "name": "TextPattern",
824
+ "module": "src/pattern-matcher.ts"
825
+ }
826
+ },
827
+ {
828
+ "kind": "js",
829
+ "name": "matchPatternResults",
830
+ "declaration": {
831
+ "name": "matchPatternResults",
832
+ "module": "src/pattern-matcher.ts"
833
+ }
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ "kind": "javascript-module",
839
+ "path": "src/rc-textarea.ts",
840
+ "declarations": [
841
+ {
842
+ "kind": "class",
843
+ "description": "Enhanced textarea with line decorations, gutter, and plugin API.",
844
+ "name": "RCTextarea",
845
+ "cssProperties": [
846
+ {
847
+ "description": "Border around the editor",
848
+ "name": "--rc-textarea-border",
849
+ "default": "1px solid ButtonBorder"
850
+ },
851
+ {
852
+ "description": "Border radius of the editor",
853
+ "name": "--rc-textarea-border-radius",
854
+ "default": "2px"
855
+ },
856
+ {
857
+ "description": "Background color of the editor",
858
+ "name": "--rc-textarea-background",
859
+ "default": "Field"
860
+ },
861
+ {
862
+ "description": "Text color; falls back through --rc-text",
863
+ "name": "--rc-textarea-color",
864
+ "default": "FieldText"
865
+ },
866
+ {
867
+ "description": "Font family",
868
+ "name": "--rc-textarea-font-family",
869
+ "default": "monospace"
870
+ },
871
+ {
872
+ "description": "Font size",
873
+ "name": "--rc-textarea-font-size",
874
+ "default": "1em"
875
+ },
876
+ {
877
+ "description": "Line height",
878
+ "name": "--rc-textarea-line-height",
879
+ "default": "1.5"
880
+ },
881
+ {
882
+ "description": "Padding inside the editor area",
883
+ "name": "--rc-textarea-padding",
884
+ "default": "0.5em"
885
+ },
886
+ {
887
+ "description": "Focus ring outline",
888
+ "name": "--rc-textarea-focus-outline",
889
+ "default": "2px solid Highlight"
890
+ },
891
+ {
892
+ "description": "Caret color",
893
+ "name": "--rc-textarea-caret-color",
894
+ "default": "FieldText"
895
+ },
896
+ {
897
+ "description": "Active line highlight color",
898
+ "name": "--rc-textarea-active-line-bg",
899
+ "default": "transparent"
900
+ },
901
+ {
902
+ "description": "Gutter background color",
903
+ "name": "--rc-textarea-gutter-bg",
904
+ "default": "Canvas"
905
+ },
906
+ {
907
+ "description": "Gutter text color",
908
+ "name": "--rc-textarea-gutter-color",
909
+ "default": "GrayText"
910
+ },
911
+ {
912
+ "description": "Gutter right border",
913
+ "name": "--rc-textarea-gutter-border",
914
+ "default": "1px solid ButtonBorder"
915
+ }
916
+ ],
917
+ "slots": [
918
+ {
919
+ "description": "Accepts a native `<textarea>` element for form wiring and progressive enhancement.",
920
+ "name": ""
921
+ }
922
+ ],
923
+ "members": [
924
+ {
925
+ "kind": "field",
926
+ "name": "shadowRootOptions",
927
+ "type": {
928
+ "text": "object"
929
+ },
930
+ "static": true,
931
+ "default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }"
932
+ },
933
+ {
934
+ "kind": "field",
935
+ "name": "lineNumbers",
936
+ "type": {
937
+ "text": "boolean"
938
+ },
939
+ "default": "false",
940
+ "attribute": "line-numbers",
941
+ "reflects": true
942
+ },
943
+ {
944
+ "kind": "field",
945
+ "name": "listNumbers",
946
+ "type": {
947
+ "text": "boolean"
948
+ },
949
+ "default": "false",
950
+ "attribute": "list-numbers",
951
+ "reflects": true
952
+ },
953
+ {
954
+ "kind": "field",
955
+ "name": "gutter",
956
+ "type": {
957
+ "text": "boolean"
958
+ },
959
+ "default": "false",
960
+ "attribute": "gutter",
961
+ "reflects": true
962
+ },
963
+ {
964
+ "kind": "field",
965
+ "name": "wordWrap",
966
+ "type": {
967
+ "text": "boolean"
968
+ },
969
+ "default": "false",
970
+ "attribute": "word-wrap",
971
+ "reflects": true
972
+ },
973
+ {
974
+ "kind": "field",
975
+ "name": "autoGrow",
976
+ "type": {
977
+ "text": "boolean"
978
+ },
979
+ "default": "false",
980
+ "attribute": "auto-grow",
981
+ "reflects": true
982
+ },
983
+ {
984
+ "kind": "field",
985
+ "name": "readOnly",
986
+ "type": {
987
+ "text": "boolean"
988
+ },
989
+ "default": "false",
990
+ "attribute": "read-only",
991
+ "reflects": true
992
+ },
993
+ {
994
+ "kind": "field",
995
+ "name": "label",
996
+ "type": {
997
+ "text": "string | null"
998
+ },
999
+ "default": "null",
1000
+ "attribute": "label"
1001
+ },
1002
+ {
1003
+ "kind": "field",
1004
+ "name": "plugin",
1005
+ "type": {
1006
+ "text": "RCTextareaPlugin | null"
1007
+ },
1008
+ "description": "Declarative plugin hook for framework integrations."
1009
+ },
1010
+ {
1011
+ "kind": "field",
1012
+ "name": "decorations",
1013
+ "type": {
1014
+ "text": "DecorationInput[]"
1015
+ },
1016
+ "description": "Reactive decorations — set from outside the component without registering a plugin.\nIdeal for reactive frameworks (Solid, React 19+, Vue 3) where decorations are\ncomputed as reactive state and passed directly as a property:\n\n```tsx\n// Solid\n<rc-textarea decorations={decorations()} />\n\n// React 19+\n<rc-textarea decorations={decorations} />\n```\n\nMerges with plugin decorations and pattern decorations on every render.\nSetting this property triggers a new render; setting it to `undefined` or `[]`\nclears any previously set external decorations."
1017
+ },
1018
+ {
1019
+ "kind": "field",
1020
+ "name": "_value",
1021
+ "type": {
1022
+ "text": "string"
1023
+ },
1024
+ "privacy": "private",
1025
+ "default": "''"
1026
+ },
1027
+ {
1028
+ "kind": "field",
1029
+ "name": "_defaultValue",
1030
+ "type": {
1031
+ "text": "string | undefined"
1032
+ },
1033
+ "privacy": "private"
1034
+ },
1035
+ {
1036
+ "kind": "field",
1037
+ "name": "_initialValueResolved",
1038
+ "type": {
1039
+ "text": "boolean"
1040
+ },
1041
+ "privacy": "private",
1042
+ "default": "false"
1043
+ },
1044
+ {
1045
+ "kind": "field",
1046
+ "name": "_valueSetByHost",
1047
+ "type": {
1048
+ "text": "boolean"
1049
+ },
1050
+ "privacy": "private",
1051
+ "default": "false"
1052
+ },
1053
+ {
1054
+ "kind": "field",
1055
+ "name": "_document",
1056
+ "type": {
1057
+ "text": "V2Document | null"
1058
+ },
1059
+ "privacy": "private",
1060
+ "default": "null"
1061
+ },
1062
+ {
1063
+ "kind": "field",
1064
+ "name": "_textareaRef",
1065
+ "type": {
1066
+ "text": "WeakRef<HTMLTextAreaElement> | null"
1067
+ },
1068
+ "privacy": "private",
1069
+ "default": "null"
1070
+ },
1071
+ {
1072
+ "kind": "field",
1073
+ "name": "_pluginDecorations",
1074
+ "privacy": "protected",
1075
+ "default": "new Map<string, Decoration>()",
1076
+ "description": "Plugin-owned decorations (set via PluginAPI.setDecorations / addDecoration)."
1077
+ },
1078
+ {
1079
+ "kind": "field",
1080
+ "name": "_patternDecorations",
1081
+ "type": {
1082
+ "text": "Decoration[]"
1083
+ },
1084
+ "privacy": "private",
1085
+ "default": "[]",
1086
+ "description": "Pattern-generated decorations (rebuilt on each value change)."
1087
+ },
1088
+ {
1089
+ "kind": "field",
1090
+ "name": "_externalDecorations",
1091
+ "type": {
1092
+ "text": "DecorationInput[]"
1093
+ },
1094
+ "privacy": "private",
1095
+ "default": "[]",
1096
+ "description": "Decorations set directly via the `decorations` property (reactive-framework-friendly)."
1097
+ },
1098
+ {
1099
+ "kind": "field",
1100
+ "name": "_patterns",
1101
+ "privacy": "private",
1102
+ "default": "new Map<string, TextPattern>()",
1103
+ "description": "Registered patterns."
1104
+ },
1105
+ {
1106
+ "kind": "field",
1107
+ "name": "_plugin",
1108
+ "type": {
1109
+ "text": "RCTextareaPlugin | null"
1110
+ },
1111
+ "privacy": "protected",
1112
+ "default": "null"
1113
+ },
1114
+ {
1115
+ "kind": "field",
1116
+ "name": "_pluginProperty",
1117
+ "type": {
1118
+ "text": "RCTextareaPlugin | null"
1119
+ },
1120
+ "privacy": "private",
1121
+ "default": "null"
1122
+ },
1123
+ {
1124
+ "kind": "field",
1125
+ "name": "_pluginApi",
1126
+ "type": {
1127
+ "text": "RCTextareaPluginAPI | null"
1128
+ },
1129
+ "privacy": "protected",
1130
+ "default": "null"
1131
+ },
1132
+ {
1133
+ "kind": "field",
1134
+ "name": "_pluginSeq",
1135
+ "type": {
1136
+ "text": "number"
1137
+ },
1138
+ "privacy": "private",
1139
+ "default": "0",
1140
+ "description": "Sequence counter for async plugin safety (discard stale results)."
1141
+ },
1142
+ {
1143
+ "kind": "field",
1144
+ "name": "_pluginSheets",
1145
+ "privacy": "private",
1146
+ "default": "new Set<CSSStyleSheet>()",
1147
+ "description": "Stylesheets adopted into the shadow root by the active plugin."
1148
+ },
1149
+ {
1150
+ "kind": "field",
1151
+ "name": "_savedSelection",
1152
+ "type": {
1153
+ "text": "SavedSelection | null"
1154
+ },
1155
+ "privacy": "protected",
1156
+ "default": "null"
1157
+ },
1158
+ {
1159
+ "kind": "field",
1160
+ "name": "_rafHandle",
1161
+ "type": {
1162
+ "text": "number | null"
1163
+ },
1164
+ "privacy": "private",
1165
+ "default": "null"
1166
+ },
1167
+ {
1168
+ "kind": "field",
1169
+ "name": "_composing",
1170
+ "type": {
1171
+ "text": "boolean"
1172
+ },
1173
+ "privacy": "private",
1174
+ "default": "false"
1175
+ },
1176
+ {
1177
+ "kind": "field",
1178
+ "name": "_isRendering",
1179
+ "type": {
1180
+ "text": "boolean"
1181
+ },
1182
+ "privacy": "private",
1183
+ "default": "false"
1184
+ },
1185
+ {
1186
+ "kind": "field",
1187
+ "name": "_activeLine",
1188
+ "type": {
1189
+ "text": "HTMLElement | null"
1190
+ },
1191
+ "privacy": "private",
1192
+ "default": "null",
1193
+ "description": "The currently highlighted `.v2-line` element (active line)."
1194
+ },
1195
+ {
1196
+ "kind": "field",
1197
+ "name": "_cursorCallbacks",
1198
+ "privacy": "private",
1199
+ "default": "new Set<(start: number, end: number) => void>()",
1200
+ "description": "Callbacks registered via PluginAPI.onCursorMove()."
1201
+ },
1202
+ {
1203
+ "kind": "field",
1204
+ "name": "_docSelectionChangeHandler",
1205
+ "privacy": "private"
1206
+ },
1207
+ {
1208
+ "kind": "field",
1209
+ "name": "_undoStack",
1210
+ "type": {
1211
+ "text": "UndoEntry[]"
1212
+ },
1213
+ "privacy": "private",
1214
+ "default": "[]",
1215
+ "description": "Undo/redo stack — necessary because DOM rebuilds invalidate browser's native undo."
1216
+ },
1217
+ {
1218
+ "kind": "field",
1219
+ "name": "_undoIndex",
1220
+ "type": {
1221
+ "text": "number"
1222
+ },
1223
+ "privacy": "private",
1224
+ "default": "-1"
1225
+ },
1226
+ {
1227
+ "kind": "field",
1228
+ "name": "_resizeObserver",
1229
+ "type": {
1230
+ "text": "ResizeObserver | null"
1231
+ },
1232
+ "privacy": "private",
1233
+ "default": "null"
1234
+ },
1235
+ {
1236
+ "kind": "field",
1237
+ "name": "_gutterLabels",
1238
+ "type": {
1239
+ "text": "(string | null)[]"
1240
+ },
1241
+ "privacy": "private",
1242
+ "default": "[]",
1243
+ "description": "Cached per-line gutter labels from the last render — reused by ResizeObserver."
1244
+ },
1245
+ {
1246
+ "kind": "field",
1247
+ "name": "value",
1248
+ "type": {
1249
+ "text": "string"
1250
+ },
1251
+ "attribute": "value"
1252
+ },
1253
+ {
1254
+ "kind": "field",
1255
+ "name": "defaultValue",
1256
+ "type": {
1257
+ "text": "string | undefined"
1258
+ },
1259
+ "description": "Initial uncontrolled editor value.",
1260
+ "attribute": "defaultValue"
1261
+ },
1262
+ {
1263
+ "kind": "method",
1264
+ "name": "_onSlotChange",
1265
+ "privacy": "private",
1266
+ "return": {
1267
+ "type": {
1268
+ "text": "void"
1269
+ }
1270
+ }
1271
+ },
1272
+ {
1273
+ "kind": "method",
1274
+ "name": "_bindEditorEvents",
1275
+ "privacy": "private",
1276
+ "return": {
1277
+ "type": {
1278
+ "text": "void"
1279
+ }
1280
+ },
1281
+ "parameters": [
1282
+ {
1283
+ "name": "editorEl",
1284
+ "type": {
1285
+ "text": "HTMLElement"
1286
+ }
1287
+ }
1288
+ ]
1289
+ },
1290
+ {
1291
+ "kind": "field",
1292
+ "name": "_onInputEvent",
1293
+ "privacy": "private"
1294
+ },
1295
+ {
1296
+ "kind": "method",
1297
+ "name": "_onInput",
1298
+ "privacy": "private",
1299
+ "return": {
1300
+ "type": {
1301
+ "text": "void"
1302
+ }
1303
+ }
1304
+ },
1305
+ {
1306
+ "kind": "field",
1307
+ "name": "_onSelectionChange",
1308
+ "privacy": "private"
1309
+ },
1310
+ {
1311
+ "kind": "method",
1312
+ "name": "_updateActiveLine",
1313
+ "privacy": "private",
1314
+ "return": {
1315
+ "type": {
1316
+ "text": "void"
1317
+ }
1318
+ }
1319
+ },
1320
+ {
1321
+ "kind": "method",
1322
+ "name": "_updateActiveGutterCell",
1323
+ "privacy": "private",
1324
+ "return": {
1325
+ "type": {
1326
+ "text": "void"
1327
+ }
1328
+ }
1329
+ },
1330
+ {
1331
+ "kind": "field",
1332
+ "name": "_onKeyDown",
1333
+ "privacy": "private"
1334
+ },
1335
+ {
1336
+ "kind": "method",
1337
+ "name": "_insertText",
1338
+ "privacy": "protected",
1339
+ "return": {
1340
+ "type": {
1341
+ "text": "void"
1342
+ }
1343
+ },
1344
+ "parameters": [
1345
+ {
1346
+ "name": "text",
1347
+ "type": {
1348
+ "text": "string"
1349
+ }
1350
+ }
1351
+ ]
1352
+ },
1353
+ {
1354
+ "kind": "method",
1355
+ "name": "wrapSelection",
1356
+ "return": {
1357
+ "type": {
1358
+ "text": "void"
1359
+ }
1360
+ },
1361
+ "parameters": [
1362
+ {
1363
+ "name": "prefix",
1364
+ "type": {
1365
+ "text": "string"
1366
+ }
1367
+ },
1368
+ {
1369
+ "name": "suffix",
1370
+ "type": {
1371
+ "text": "string"
1372
+ }
1373
+ }
1374
+ ],
1375
+ "description": "Wrap the current selection with `prefix` and `suffix`.\nNo-op when the selection is collapsed (no text selected).\n\nUses the model path directly (not `execCommand`) because callers such as\ntoolbar buttons move focus away from the editor before this fires, which\nclears the DOM selection. `_savedSelection` retains the last model-level\nanchor/focus offsets."
1376
+ },
1377
+ {
1378
+ "kind": "method",
1379
+ "name": "replaceSelection",
1380
+ "return": {
1381
+ "type": {
1382
+ "text": "void"
1383
+ }
1384
+ },
1385
+ "parameters": [
1386
+ {
1387
+ "name": "text",
1388
+ "type": {
1389
+ "text": "string"
1390
+ }
1391
+ }
1392
+ ],
1393
+ "description": "Replace the current selection with `text`.\nWhen the selection is collapsed this is equivalent to `insertText`."
1394
+ },
1395
+ {
1396
+ "kind": "field",
1397
+ "name": "_onPaste",
1398
+ "privacy": "private"
1399
+ },
1400
+ {
1401
+ "kind": "method",
1402
+ "name": "clearHistory",
1403
+ "return": {
1404
+ "type": {
1405
+ "text": "void"
1406
+ }
1407
+ },
1408
+ "description": "Reset the undo/redo history. Call when the editor receives entirely new content."
1409
+ },
1410
+ {
1411
+ "kind": "method",
1412
+ "name": "_pushUndo",
1413
+ "privacy": "protected",
1414
+ "return": {
1415
+ "type": {
1416
+ "text": "void"
1417
+ }
1418
+ },
1419
+ "parameters": [
1420
+ {
1421
+ "name": "sel",
1422
+ "type": {
1423
+ "text": "SavedSelection | null"
1424
+ }
1425
+ }
1426
+ ]
1427
+ },
1428
+ {
1429
+ "kind": "method",
1430
+ "name": "_undo",
1431
+ "privacy": "private",
1432
+ "return": {
1433
+ "type": {
1434
+ "text": "void"
1435
+ }
1436
+ }
1437
+ },
1438
+ {
1439
+ "kind": "method",
1440
+ "name": "_redo",
1441
+ "privacy": "private",
1442
+ "return": {
1443
+ "type": {
1444
+ "text": "void"
1445
+ }
1446
+ }
1447
+ },
1448
+ {
1449
+ "kind": "method",
1450
+ "name": "_applyUndoEntry",
1451
+ "privacy": "private",
1452
+ "return": {
1453
+ "type": {
1454
+ "text": "void"
1455
+ }
1456
+ },
1457
+ "parameters": [
1458
+ {
1459
+ "name": "entry",
1460
+ "type": {
1461
+ "text": "UndoEntry"
1462
+ }
1463
+ }
1464
+ ]
1465
+ },
1466
+ {
1467
+ "kind": "method",
1468
+ "name": "usePlugin",
1469
+ "return": {
1470
+ "type": {
1471
+ "text": "void"
1472
+ }
1473
+ },
1474
+ "parameters": [
1475
+ {
1476
+ "name": "plugin",
1477
+ "type": {
1478
+ "text": "RCTextareaPlugin"
1479
+ }
1480
+ }
1481
+ ]
1482
+ },
1483
+ {
1484
+ "kind": "method",
1485
+ "name": "removePlugin",
1486
+ "return": {
1487
+ "type": {
1488
+ "text": "void"
1489
+ }
1490
+ }
1491
+ },
1492
+ {
1493
+ "kind": "method",
1494
+ "name": "_buildPluginApi",
1495
+ "privacy": "private",
1496
+ "return": {
1497
+ "type": {
1498
+ "text": "RCTextareaPluginAPI"
1499
+ }
1500
+ },
1501
+ "description": "Build the `RCTextareaPluginAPI` object passed to the active plugin's\n`mount()` call. Each getter delegates to the component's live state so the\nAPI stays accurate across render frames without needing to be rebuilt."
1502
+ },
1503
+ {
1504
+ "kind": "method",
1505
+ "name": "_clearPluginSheets",
1506
+ "privacy": "private",
1507
+ "return": {
1508
+ "type": {
1509
+ "text": "void"
1510
+ }
1511
+ }
1512
+ },
1513
+ {
1514
+ "kind": "method",
1515
+ "name": "addPattern",
1516
+ "return": {
1517
+ "type": {
1518
+ "text": "string"
1519
+ }
1520
+ },
1521
+ "parameters": [
1522
+ {
1523
+ "name": "pattern",
1524
+ "type": {
1525
+ "text": "Omit<TextPattern, 'id'>"
1526
+ }
1527
+ }
1528
+ ]
1529
+ },
1530
+ {
1531
+ "kind": "method",
1532
+ "name": "removePattern",
1533
+ "return": {
1534
+ "type": {
1535
+ "text": "void"
1536
+ }
1537
+ },
1538
+ "parameters": [
1539
+ {
1540
+ "name": "id",
1541
+ "type": {
1542
+ "text": "string"
1543
+ }
1544
+ }
1545
+ ]
1546
+ },
1547
+ {
1548
+ "kind": "method",
1549
+ "name": "clearPatterns",
1550
+ "return": {
1551
+ "type": {
1552
+ "text": "void"
1553
+ }
1554
+ }
1555
+ },
1556
+ {
1557
+ "kind": "method",
1558
+ "name": "_scheduleRender",
1559
+ "privacy": "protected",
1560
+ "return": {
1561
+ "type": {
1562
+ "text": "void"
1563
+ }
1564
+ }
1565
+ },
1566
+ {
1567
+ "kind": "method",
1568
+ "name": "_performRender",
1569
+ "privacy": "private",
1570
+ "return": {
1571
+ "type": {
1572
+ "text": "Promise<void>"
1573
+ }
1574
+ }
1575
+ },
1576
+ {
1577
+ "kind": "method",
1578
+ "name": "_computeGutterLabels",
1579
+ "privacy": "private",
1580
+ "return": {
1581
+ "type": {
1582
+ "text": "(string | null)[]"
1583
+ }
1584
+ },
1585
+ "parameters": [
1586
+ {
1587
+ "name": "allDecorations",
1588
+ "type": {
1589
+ "text": "Decoration[]"
1590
+ }
1591
+ },
1592
+ {
1593
+ "name": "value",
1594
+ "default": "this._value"
1595
+ }
1596
+ ],
1597
+ "description": "Compute the label string for each gutter cell based on the current gutter\nmode (`lineNumbers`, `listNumbers`, `gutter`) and any\n`LineDecoration.gutterContent` overrides in `allDecorations`.\n\nReturns one entry per line (same length as `value.split('\\n')`):\n- `string` — the label to display\n- `null` — render an empty cell"
1598
+ },
1599
+ {
1600
+ "kind": "method",
1601
+ "name": "_syncGutterHeights",
1602
+ "privacy": "private",
1603
+ "return": {
1604
+ "type": {
1605
+ "text": "void"
1606
+ }
1607
+ },
1608
+ "description": "Synchronize the pixel height of each gutter cell to match the\ncorresponding `.v2-line` element in the editor.\n\nIn non-word-wrap mode the gutter uses a uniform `line-height` mirrored\nfrom the editor's first line. In word-wrap mode each cell gets an explicit\n`height` so wrapped lines stay vertically aligned with their gutter label.\nAlso copies the editor's computed `paddingTop`/`paddingBottom` to the\ngutter to compensate for browser UA overrides on contenteditable."
1609
+ },
1610
+ {
1611
+ "kind": "method",
1612
+ "name": "_syncGutter",
1613
+ "privacy": "private",
1614
+ "return": {
1615
+ "type": {
1616
+ "text": "void"
1617
+ }
1618
+ },
1619
+ "parameters": [
1620
+ {
1621
+ "name": "labels",
1622
+ "optional": true,
1623
+ "type": {
1624
+ "text": "(string | null)[]"
1625
+ }
1626
+ }
1627
+ ],
1628
+ "description": "Add, remove, or update `.gutter-cell` spans so their count and text\ncontent match `labels`. When `labels` is provided the cached\n`_gutterLabels` is updated first; otherwise the cached labels are reused\n(called by the `ResizeObserver` without a new render pass)."
1629
+ },
1630
+ {
1631
+ "kind": "method",
1632
+ "name": "_syncTypography",
1633
+ "privacy": "private",
1634
+ "return": {
1635
+ "type": {
1636
+ "text": "void"
1637
+ }
1638
+ },
1639
+ "parameters": [
1640
+ {
1641
+ "name": "textarea",
1642
+ "type": {
1643
+ "text": "HTMLTextAreaElement"
1644
+ }
1645
+ }
1646
+ ]
1647
+ },
1648
+ {
1649
+ "kind": "method",
1650
+ "name": "_syncTextareaValue",
1651
+ "privacy": "protected",
1652
+ "return": {
1653
+ "type": {
1654
+ "text": "void"
1655
+ }
1656
+ },
1657
+ "parameters": [
1658
+ {
1659
+ "name": "fromUser",
1660
+ "default": "false"
1661
+ }
1662
+ ]
1663
+ },
1664
+ {
1665
+ "kind": "method",
1666
+ "name": "_dispatchChange",
1667
+ "privacy": "protected",
1668
+ "return": {
1669
+ "type": {
1670
+ "text": "void"
1671
+ }
1672
+ },
1673
+ "parameters": [
1674
+ {
1675
+ "name": "value",
1676
+ "type": {
1677
+ "text": "string"
1678
+ }
1679
+ }
1680
+ ]
1681
+ },
1682
+ {
1683
+ "kind": "method",
1684
+ "name": "_getEditorEl",
1685
+ "privacy": "private",
1686
+ "return": {
1687
+ "type": {
1688
+ "text": "HTMLElement | null"
1689
+ }
1690
+ }
1691
+ }
1692
+ ],
1693
+ "events": [
1694
+ {
1695
+ "name": "rc-textarea-focus",
1696
+ "type": {
1697
+ "text": "CustomEvent"
1698
+ }
1699
+ },
1700
+ {
1701
+ "name": "rc-textarea-blur",
1702
+ "type": {
1703
+ "text": "CustomEvent"
1704
+ },
1705
+ "description": "Fired when the editor loses focus"
1706
+ },
1707
+ {
1708
+ "name": "rc-textarea-change",
1709
+ "type": {
1710
+ "text": "CustomEvent"
1711
+ },
1712
+ "description": "Fired when the editor value changes"
1713
+ }
1714
+ ],
1715
+ "attributes": [
1716
+ {
1717
+ "name": "line-numbers",
1718
+ "type": {
1719
+ "text": "boolean"
1720
+ },
1721
+ "default": "false",
1722
+ "fieldName": "lineNumbers"
1723
+ },
1724
+ {
1725
+ "name": "list-numbers",
1726
+ "type": {
1727
+ "text": "boolean"
1728
+ },
1729
+ "default": "false",
1730
+ "fieldName": "listNumbers"
1731
+ },
1732
+ {
1733
+ "name": "gutter",
1734
+ "type": {
1735
+ "text": "boolean"
1736
+ },
1737
+ "default": "false",
1738
+ "fieldName": "gutter"
1739
+ },
1740
+ {
1741
+ "name": "word-wrap",
1742
+ "type": {
1743
+ "text": "boolean"
1744
+ },
1745
+ "default": "false",
1746
+ "fieldName": "wordWrap"
1747
+ },
1748
+ {
1749
+ "name": "auto-grow",
1750
+ "type": {
1751
+ "text": "boolean"
1752
+ },
1753
+ "default": "false",
1754
+ "fieldName": "autoGrow"
1755
+ },
1756
+ {
1757
+ "name": "read-only",
1758
+ "type": {
1759
+ "text": "boolean"
1760
+ },
1761
+ "default": "false",
1762
+ "fieldName": "readOnly"
1763
+ },
1764
+ {
1765
+ "name": "label",
1766
+ "type": {
1767
+ "text": "string | null"
1768
+ },
1769
+ "default": "null",
1770
+ "fieldName": "label"
1771
+ },
1772
+ {
1773
+ "name": "value",
1774
+ "type": {
1775
+ "text": "string"
1776
+ },
1777
+ "fieldName": "value"
1778
+ },
1779
+ {
1780
+ "name": "defaultValue",
1781
+ "type": {
1782
+ "text": "string | undefined"
1783
+ },
1784
+ "description": "Initial uncontrolled editor value.",
1785
+ "fieldName": "defaultValue"
1786
+ }
1787
+ ],
1788
+ "superclass": {
1789
+ "name": "LitElement",
1790
+ "package": "lit"
1791
+ },
1792
+ "tagName": "rc-textarea",
1793
+ "customElement": true
1794
+ }
1795
+ ],
1796
+ "exports": [
1797
+ {
1798
+ "kind": "js",
1799
+ "name": "RCTextarea",
1800
+ "declaration": {
1801
+ "name": "RCTextarea",
1802
+ "module": "src/rc-textarea.ts"
1803
+ }
1804
+ }
1805
+ ]
1806
+ },
1807
+ {
1808
+ "kind": "javascript-module",
1809
+ "path": "src/selection.ts",
1810
+ "declarations": [
1811
+ {
1812
+ "kind": "function",
1813
+ "name": "domToTextOffset",
1814
+ "return": {
1815
+ "type": {
1816
+ "text": "number"
1817
+ }
1818
+ },
1819
+ "parameters": [
1820
+ {
1821
+ "name": "root",
1822
+ "type": {
1823
+ "text": "Element"
1824
+ }
1825
+ },
1826
+ {
1827
+ "name": "targetNode",
1828
+ "type": {
1829
+ "text": "Node"
1830
+ }
1831
+ },
1832
+ {
1833
+ "name": "targetNodeOffset",
1834
+ "type": {
1835
+ "text": "number"
1836
+ }
1837
+ }
1838
+ ],
1839
+ "description": "Converts a DOM (node, nodeOffset) pair inside `root` to a plain-text offset.\nReturns -1 if the target was not found inside root."
1840
+ },
1841
+ {
1842
+ "kind": "function",
1843
+ "name": "textOffsetToDom",
1844
+ "return": {
1845
+ "type": {
1846
+ "text": "DomPosition | null"
1847
+ }
1848
+ },
1849
+ "parameters": [
1850
+ {
1851
+ "name": "root",
1852
+ "type": {
1853
+ "text": "Element"
1854
+ }
1855
+ },
1856
+ {
1857
+ "name": "targetOffset",
1858
+ "type": {
1859
+ "text": "number"
1860
+ }
1861
+ }
1862
+ ],
1863
+ "description": "Converts a plain-text offset to a (node, nodeOffset) DOM position inside `root`.\nReturns null if offset is out of range."
1864
+ },
1865
+ {
1866
+ "kind": "function",
1867
+ "name": "saveSelection",
1868
+ "return": {
1869
+ "type": {
1870
+ "text": "SavedSelection | null"
1871
+ }
1872
+ },
1873
+ "parameters": [
1874
+ {
1875
+ "name": "root",
1876
+ "type": {
1877
+ "text": "Element"
1878
+ }
1879
+ }
1880
+ ],
1881
+ "description": "Captures the current browser selection as plain-text offsets relative to `root`.\nReturns null if there is no selection or the selection is outside `root`."
1882
+ },
1883
+ {
1884
+ "kind": "function",
1885
+ "name": "restoreSelection",
1886
+ "return": {
1887
+ "type": {
1888
+ "text": "void"
1889
+ }
1890
+ },
1891
+ "parameters": [
1892
+ {
1893
+ "name": "root",
1894
+ "type": {
1895
+ "text": "Element"
1896
+ }
1897
+ },
1898
+ {
1899
+ "name": "saved",
1900
+ "type": {
1901
+ "text": "SavedSelection"
1902
+ }
1903
+ }
1904
+ ],
1905
+ "description": "Restores a previously saved selection inside `root`.\nSilently does nothing if the saved offsets are out of range."
1906
+ }
1907
+ ],
1908
+ "exports": [
1909
+ {
1910
+ "kind": "js",
1911
+ "name": "domToTextOffset",
1912
+ "declaration": {
1913
+ "name": "domToTextOffset",
1914
+ "module": "src/selection.ts"
1915
+ }
1916
+ },
1917
+ {
1918
+ "kind": "js",
1919
+ "name": "textOffsetToDom",
1920
+ "declaration": {
1921
+ "name": "textOffsetToDom",
1922
+ "module": "src/selection.ts"
1923
+ }
1924
+ },
1925
+ {
1926
+ "kind": "js",
1927
+ "name": "saveSelection",
1928
+ "declaration": {
1929
+ "name": "saveSelection",
1930
+ "module": "src/selection.ts"
1931
+ }
1932
+ },
1933
+ {
1934
+ "kind": "js",
1935
+ "name": "restoreSelection",
1936
+ "declaration": {
1937
+ "name": "restoreSelection",
1938
+ "module": "src/selection.ts"
1939
+ }
1940
+ }
1941
+ ]
1942
+ },
1943
+ {
1944
+ "kind": "javascript-module",
1945
+ "path": "src/test-helpers.ts",
1946
+ "declarations": [
1947
+ {
1948
+ "kind": "function",
1949
+ "name": "getEditor",
1950
+ "return": {
1951
+ "type": {
1952
+ "text": "HTMLDivElement"
1953
+ }
1954
+ },
1955
+ "parameters": [
1956
+ {
1957
+ "name": "host",
1958
+ "type": {
1959
+ "text": "RCTextarea"
1960
+ }
1961
+ }
1962
+ ]
1963
+ },
1964
+ {
1965
+ "kind": "function",
1966
+ "name": "getGutterCells",
1967
+ "return": {
1968
+ "type": {
1969
+ "text": "HTMLDivElement"
1970
+ }
1971
+ },
1972
+ "parameters": [
1973
+ {
1974
+ "name": "host",
1975
+ "type": {
1976
+ "text": "RCTextarea"
1977
+ }
1978
+ }
1979
+ ]
1980
+ },
1981
+ {
1982
+ "kind": "function",
1983
+ "name": "getSlottedTextarea",
1984
+ "return": {
1985
+ "type": {
1986
+ "text": "HTMLTextAreaElement"
1987
+ }
1988
+ },
1989
+ "parameters": [
1990
+ {
1991
+ "name": "host",
1992
+ "type": {
1993
+ "text": "RCTextarea"
1994
+ }
1995
+ }
1996
+ ]
1997
+ },
1998
+ {
1999
+ "kind": "function",
2000
+ "name": "waitRender",
2001
+ "return": {
2002
+ "type": {
2003
+ "text": "Promise<void>"
2004
+ }
2005
+ },
2006
+ "description": "Wait one animation frame for _performRender to start, then flush one microtask\ntick so that synchronous plugin `update()` calls complete before the test asserts."
2007
+ },
2008
+ {
2009
+ "kind": "function",
2010
+ "name": "simulatePaste",
2011
+ "return": {
2012
+ "type": {
2013
+ "text": "void"
2014
+ }
2015
+ },
2016
+ "parameters": [
2017
+ {
2018
+ "name": "editor",
2019
+ "type": {
2020
+ "text": "HTMLElement"
2021
+ }
2022
+ },
2023
+ {
2024
+ "name": "text",
2025
+ "type": {
2026
+ "text": "string"
2027
+ }
2028
+ }
2029
+ ],
2030
+ "description": "Dispatches a synthetic paste event carrying plain text onto `editor`.\n\nUsing a plain Event + manual clipboardData override because `new ClipboardEvent`\nwith a DataTransfer in the init dict is not reliable across browsers (Firefox\nignores the init's clipboardData). The paste handler only calls\n`e.clipboardData?.getData('text/plain')`, so a minimal duck-typed mock is enough."
2031
+ }
2032
+ ],
2033
+ "exports": [
2034
+ {
2035
+ "kind": "js",
2036
+ "name": "getEditor",
2037
+ "declaration": {
2038
+ "name": "getEditor",
2039
+ "module": "src/test-helpers.ts"
2040
+ }
2041
+ },
2042
+ {
2043
+ "kind": "js",
2044
+ "name": "getGutterCells",
2045
+ "declaration": {
2046
+ "name": "getGutterCells",
2047
+ "module": "src/test-helpers.ts"
2048
+ }
2049
+ },
2050
+ {
2051
+ "kind": "js",
2052
+ "name": "getSlottedTextarea",
2053
+ "declaration": {
2054
+ "name": "getSlottedTextarea",
2055
+ "module": "src/test-helpers.ts"
2056
+ }
2057
+ },
2058
+ {
2059
+ "kind": "js",
2060
+ "name": "waitRender",
2061
+ "declaration": {
2062
+ "name": "waitRender",
2063
+ "module": "src/test-helpers.ts"
2064
+ }
2065
+ },
2066
+ {
2067
+ "kind": "js",
2068
+ "name": "simulatePaste",
2069
+ "declaration": {
2070
+ "name": "simulatePaste",
2071
+ "module": "src/test-helpers.ts"
2072
+ }
2073
+ }
2074
+ ]
2075
+ },
2076
+ {
2077
+ "kind": "javascript-module",
2078
+ "path": "src/types.ts",
2079
+ "declarations": [
2080
+ {
2081
+ "kind": "function",
2082
+ "name": "generateId",
2083
+ "return": {
2084
+ "type": {
2085
+ "text": "string"
2086
+ }
2087
+ },
2088
+ "description": "Generate a unique decoration ID (UUID v4)."
2089
+ }
2090
+ ],
2091
+ "exports": [
2092
+ {
2093
+ "kind": "js",
2094
+ "name": "generateId",
2095
+ "declaration": {
2096
+ "name": "generateId",
2097
+ "module": "src/types.ts"
2098
+ }
2099
+ }
2100
+ ]
2101
+ }
2102
+ ]
2103
+ }