@rcarls/rc-markdown-editor 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  "name": "rc-editor-toolbar",
13
13
  "declaration": {
14
14
  "name": "RcEditorToolbar",
15
- "module": "/src/rc-editor-toolbar.ts"
15
+ "module": "/src/rc-editor-toolbar.js"
16
16
  }
17
17
  },
18
18
  {
@@ -20,7 +20,7 @@
20
20
  "name": "rc-markdown-editor",
21
21
  "declaration": {
22
22
  "name": "RcMarkdownEditor",
23
- "module": "/src/rc-markdown-editor.ts"
23
+ "module": "/src/rc-markdown-editor.js"
24
24
  }
25
25
  }
26
26
  ]
@@ -43,21 +43,21 @@
43
43
  "type": {
44
44
  "text": "string"
45
45
  },
46
- "description": "Full source editor value."
46
+ "description": "full source editor value"
47
47
  },
48
48
  {
49
49
  "name": "selectionStart",
50
50
  "type": {
51
51
  "text": "number"
52
52
  },
53
- "description": "Cursor offset used to locate the containing fence."
53
+ "description": "cursor offset used to locate the containing fence"
54
54
  },
55
55
  {
56
56
  "name": "language",
57
57
  "type": {
58
58
  "text": "string"
59
59
  },
60
- "description": "Language string to write (empty string removes the token)."
60
+ "description": "language string to write (empty string removes the token)"
61
61
  }
62
62
  ],
63
63
  "description": "Replaces the language token on the opening fence of the code block containing\n`selectionStart`. Returns the updated string, or `null` if the cursor is not\ninside a fenced code block."
@@ -146,7 +146,7 @@
146
146
  "name": "RcMarkdownEditor",
147
147
  "declaration": {
148
148
  "name": "RcMarkdownEditor",
149
- "module": "./rc-markdown-editor.ts"
149
+ "module": "./rc-markdown-editor.js"
150
150
  }
151
151
  },
152
152
  {
@@ -154,7 +154,7 @@
154
154
  "name": "RcEditorToolbar",
155
155
  "declaration": {
156
156
  "name": "RcEditorToolbar",
157
- "module": "./rc-editor-toolbar.ts"
157
+ "module": "./rc-editor-toolbar.js"
158
158
  }
159
159
  },
160
160
  {
@@ -162,7 +162,7 @@
162
162
  "name": "EditorToolbarAction",
163
163
  "declaration": {
164
164
  "name": "EditorToolbarAction",
165
- "module": "./types.ts"
165
+ "module": "./types.js"
166
166
  }
167
167
  },
168
168
  {
@@ -170,7 +170,7 @@
170
170
  "name": "EditorToolbarActionDetail",
171
171
  "declaration": {
172
172
  "name": "EditorToolbarActionDetail",
173
- "module": "./types.ts"
173
+ "module": "./types.js"
174
174
  }
175
175
  },
176
176
  {
@@ -178,7 +178,7 @@
178
178
  "name": "ActiveFormats",
179
179
  "declaration": {
180
180
  "name": "ActiveFormats",
181
- "module": "./types.ts"
181
+ "module": "./types.js"
182
182
  }
183
183
  },
184
184
  {
@@ -186,7 +186,7 @@
186
186
  "name": "EditorMode",
187
187
  "declaration": {
188
188
  "name": "EditorMode",
189
- "module": "./types.ts"
189
+ "module": "./types.js"
190
190
  }
191
191
  },
192
192
  {
@@ -194,7 +194,7 @@
194
194
  "name": "HeadingLevel",
195
195
  "declaration": {
196
196
  "name": "HeadingLevel",
197
- "module": "./types.ts"
197
+ "module": "./types.js"
198
198
  }
199
199
  }
200
200
  ]
@@ -203,20 +203,32 @@
203
203
  "kind": "javascript-module",
204
204
  "path": "src/rc-editor-toolbar.ts",
205
205
  "declarations": [
206
+ {
207
+ "kind": "variable",
208
+ "name": "DEFAULT_EDITOR_TOOLBAR_MESSAGES",
209
+ "type": {
210
+ "text": "Readonly<RCEditorToolbarMessages>"
211
+ }
212
+ },
206
213
  {
207
214
  "kind": "class",
208
- "description": "Formatting toolbar for `<rc-markdown-editor>`. Renders themed `rc-button`,\n`rc-select`, and `rc-toolbar` controls into its own light DOM so the parent\neditor can provide their shared appearance.\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 an\n`<rc-select>`. Code-block language is shown via a `<input>` when active.",
215
+ "description": "Formatting toolbar for `<rc-markdown-editor>`. Renders themed `rc-button` and\n`rc-toolbar` controls into its own light DOM so the parent editor can provide\ntheir shared appearance.\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\nnative `<select>`. Code-block language is shown via a `<input>` when active.",
209
216
  "name": "RcEditorToolbar",
210
217
  "members": [
211
218
  {
212
219
  "kind": "field",
213
- "name": "label",
220
+ "name": "messages",
214
221
  "type": {
215
- "text": "string"
222
+ "text": "Partial<RCEditorToolbarMessages> | undefined"
216
223
  },
217
- "default": "'Formatting'",
218
- "description": "Accessible label applied to the `rc-toolbar` container.",
219
- "attribute": "label"
224
+ "description": "Built-in text overrides; unset keys fall back to registered text, then English."
225
+ },
226
+ {
227
+ "kind": "field",
228
+ "name": "_messages",
229
+ "privacy": "private",
230
+ "readonly": true,
231
+ "default": "new MessagesController( this, 'rc-editor-toolbar', DEFAULT_EDITOR_TOOLBAR_MESSAGES, { overrides: () => this.messages }, )"
220
232
  },
221
233
  {
222
234
  "kind": "field",
@@ -471,15 +483,6 @@
471
483
  }
472
484
  ],
473
485
  "attributes": [
474
- {
475
- "description": "Accessible label applied to the `rc-toolbar` container.",
476
- "name": "label",
477
- "type": {
478
- "text": "string"
479
- },
480
- "default": "'Formatting'",
481
- "fieldName": "label"
482
- },
483
486
  {
484
487
  "description": "Whether Bold formatting is active at the cursor.",
485
488
  "name": "active-bold",
@@ -607,6 +610,14 @@
607
610
  }
608
611
  ],
609
612
  "exports": [
613
+ {
614
+ "kind": "js",
615
+ "name": "DEFAULT_EDITOR_TOOLBAR_MESSAGES",
616
+ "declaration": {
617
+ "name": "DEFAULT_EDITOR_TOOLBAR_MESSAGES",
618
+ "module": "src/rc-editor-toolbar.ts"
619
+ }
620
+ },
610
621
  {
611
622
  "kind": "js",
612
623
  "name": "RcEditorToolbar",
@@ -621,99 +632,246 @@
621
632
  "kind": "javascript-module",
622
633
  "path": "src/rc-markdown-editor.ts",
623
634
  "declarations": [
635
+ {
636
+ "kind": "variable",
637
+ "name": "DEFAULT_MARKDOWN_EDITOR_MESSAGES",
638
+ "type": {
639
+ "text": "Readonly<RCMarkdownEditorMessages>"
640
+ }
641
+ },
624
642
  {
625
643
  "kind": "class",
626
- "description": "Rich/source Markdown editor with a formatting toolbar, backed by rc-textarea.\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```",
644
+ "description": "Rich/source Markdown editor with a formatting toolbar, backed by rc-textarea.\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```\n\nBuilt-in text follows the element's own `lang`, else `<html lang>`: per\nelement through `messages`, or for every editor through\n`registerMessages()` from `@rcarls/rc-common` under `rc-markdown-editor`\nand, for the toolbar, `rc-editor-toolbar`. The toolbar takes the editor's\n`lang`.",
627
645
  "name": "RcMarkdownEditor",
628
646
  "cssProperties": [
629
647
  {
630
648
  "description": "Font family of the rich-text view",
631
- "name": "--rme-font-family",
649
+ "name": "--rc-markdown-editor-font-family",
632
650
  "default": "inherit"
633
651
  },
634
652
  {
635
653
  "description": "Font size of the rich-text view",
636
- "name": "--rme-font-size",
654
+ "name": "--rc-markdown-editor-font-size",
637
655
  "default": "inherit"
638
656
  },
639
657
  {
640
658
  "description": "Line height of the rich-text view",
641
- "name": "--rme-line-height",
659
+ "name": "--rc-markdown-editor-line-height",
642
660
  "default": "1.6"
643
661
  },
644
662
  {
645
663
  "description": "Padding inside the rich-text view",
646
- "name": "--rme-padding",
664
+ "name": "--rc-markdown-editor-padding",
647
665
  "default": "0.75em 1em"
648
666
  },
649
667
  {
650
668
  "description": "Background color of the rich-text view",
651
- "name": "--rme-background",
669
+ "name": "--rc-markdown-editor-background",
652
670
  "default": "Canvas"
653
671
  },
654
672
  {
655
673
  "description": "Text color of the rich-text view",
656
- "name": "--rme-color",
674
+ "name": "--rc-markdown-editor-color",
657
675
  "default": "CanvasText"
658
676
  },
659
677
  {
660
678
  "description": "Border around the rich-text view",
661
- "name": "--rme-border",
679
+ "name": "--rc-markdown-editor-border",
662
680
  "default": "1px solid ButtonBorder"
663
681
  },
664
682
  {
665
683
  "description": "Border radius of the rich-text view",
666
- "name": "--rme-border-radius",
684
+ "name": "--rc-markdown-editor-border-radius",
667
685
  "default": "0 0 4px 4px"
668
686
  },
669
687
  {
670
688
  "description": "Focus ring outline on the rich-text view",
671
- "name": "--rme-focus-outline",
689
+ "name": "--rc-markdown-editor-focus-outline",
672
690
  "default": "2px solid Highlight"
673
691
  },
674
692
  {
675
693
  "description": "Font family of the source editor",
676
- "name": "--rme-src-font-family",
694
+ "name": "--rc-markdown-editor-src-font-family",
677
695
  "default": "'Cascadia Code', 'Fira Code', ui-monospace, monospace"
678
696
  },
679
697
  {
680
698
  "description": "Gap between toolbar buttons",
681
- "name": "--rme-toolbar-gap",
699
+ "name": "--rc-markdown-editor-toolbar-gap",
682
700
  "default": "1px"
683
701
  },
702
+ {
703
+ "description": "Padding inside the toolbar",
704
+ "name": "--rc-markdown-editor-toolbar-padding",
705
+ "default": "4px"
706
+ },
707
+ {
708
+ "description": "Toolbar border radius",
709
+ "name": "--rc-markdown-editor-toolbar-radius",
710
+ "default": "4px 4px 0 0"
711
+ },
712
+ {
713
+ "description": "Toolbar border",
714
+ "name": "--rc-markdown-editor-toolbar-border",
715
+ "default": "1px solid ButtonBorder"
716
+ },
717
+ {
718
+ "description": "Toolbar background",
719
+ "name": "--rc-markdown-editor-toolbar-background",
720
+ "default": "Canvas"
721
+ },
722
+ {
723
+ "description": "Toolbar text color",
724
+ "name": "--rc-markdown-editor-toolbar-color",
725
+ "default": "CanvasText"
726
+ },
684
727
  {
685
728
  "description": "Minimum inline and block size of toolbar buttons",
686
- "name": "--rme-toolbar-button-size",
729
+ "name": "--rc-markdown-editor-toolbar-button-size",
687
730
  "default": "2rem"
688
731
  },
732
+ {
733
+ "description": "Toolbar button background",
734
+ "name": "--rc-markdown-editor-toolbar-button-background",
735
+ "default": "transparent"
736
+ },
737
+ {
738
+ "description": "Toolbar button text color",
739
+ "name": "--rc-markdown-editor-toolbar-button-color",
740
+ "default": "ButtonText"
741
+ },
742
+ {
743
+ "description": "Toolbar button border",
744
+ "name": "--rc-markdown-editor-toolbar-button-border",
745
+ "default": "1px solid transparent"
746
+ },
747
+ {
748
+ "description": "Toolbar button border radius",
749
+ "name": "--rc-markdown-editor-toolbar-button-radius",
750
+ "default": "3px"
751
+ },
752
+ {
753
+ "description": "Toolbar button hover state-layer opacity",
754
+ "name": "--rc-markdown-editor-toolbar-button-hover-opacity",
755
+ "default": "0.08"
756
+ },
757
+ {
758
+ "description": "Toolbar button focus state-layer opacity",
759
+ "name": "--rc-markdown-editor-toolbar-button-focus-opacity",
760
+ "default": "0.12"
761
+ },
762
+ {
763
+ "description": "Toolbar button pressed state-layer opacity",
764
+ "name": "--rc-markdown-editor-toolbar-button-pressed-opacity",
765
+ "default": "0.12"
766
+ },
767
+ {
768
+ "description": "Active toolbar button background",
769
+ "name": "--rc-markdown-editor-toolbar-button-active-background",
770
+ "default": "Highlight"
771
+ },
772
+ {
773
+ "description": "Active toolbar button text color",
774
+ "name": "--rc-markdown-editor-toolbar-button-active-color",
775
+ "default": "HighlightText"
776
+ },
777
+ {
778
+ "description": "Active toolbar button border",
779
+ "name": "--rc-markdown-editor-toolbar-button-active-border",
780
+ "default": "1px solid Highlight"
781
+ },
782
+ {
783
+ "description": "Toolbar control focus outline",
784
+ "name": "--rc-markdown-editor-toolbar-focus-outline",
785
+ "default": "2px solid Highlight"
786
+ },
787
+ {
788
+ "description": "Toolbar control focus outline offset",
789
+ "name": "--rc-markdown-editor-toolbar-focus-outline-offset",
790
+ "default": "1px"
791
+ },
792
+ {
793
+ "description": "Toolbar select border",
794
+ "name": "--rc-markdown-editor-toolbar-select-border",
795
+ "default": "1px solid ButtonBorder"
796
+ },
797
+ {
798
+ "description": "Toolbar select border radius",
799
+ "name": "--rc-markdown-editor-toolbar-select-radius",
800
+ "default": "3px"
801
+ },
802
+ {
803
+ "description": "Toolbar select background",
804
+ "name": "--rc-markdown-editor-toolbar-select-background",
805
+ "default": "ButtonFace"
806
+ },
807
+ {
808
+ "description": "Toolbar select text color",
809
+ "name": "--rc-markdown-editor-toolbar-select-color",
810
+ "default": "ButtonText"
811
+ },
812
+ {
813
+ "description": "Active toolbar select background",
814
+ "name": "--rc-markdown-editor-toolbar-select-active-background",
815
+ "default": "Highlight"
816
+ },
817
+ {
818
+ "description": "Active toolbar select text color",
819
+ "name": "--rc-markdown-editor-toolbar-select-active-color",
820
+ "default": "HighlightText"
821
+ },
822
+ {
823
+ "description": "Active toolbar select border color",
824
+ "name": "--rc-markdown-editor-toolbar-select-active-border-color",
825
+ "default": "Highlight"
826
+ },
827
+ {
828
+ "description": "Toolbar input border",
829
+ "name": "--rc-markdown-editor-toolbar-input-border",
830
+ "default": "1px solid ButtonBorder"
831
+ },
832
+ {
833
+ "description": "Toolbar input border radius",
834
+ "name": "--rc-markdown-editor-toolbar-input-radius",
835
+ "default": "3px"
836
+ },
837
+ {
838
+ "description": "Toolbar input background",
839
+ "name": "--rc-markdown-editor-toolbar-input-background",
840
+ "default": "Field"
841
+ },
842
+ {
843
+ "description": "Toolbar input text color",
844
+ "name": "--rc-markdown-editor-toolbar-input-color",
845
+ "default": "FieldText"
846
+ },
689
847
  {
690
848
  "description": "Source-mode heading token color",
691
- "name": "--rme-src-heading-color",
849
+ "name": "--rc-markdown-editor-src-heading-color",
692
850
  "default": "light-dark(#1d6fc4, #82b4f5)"
693
851
  },
694
852
  {
695
853
  "description": "Source-mode inline/fenced code token color",
696
- "name": "--rme-src-code-color",
854
+ "name": "--rc-markdown-editor-src-code-color",
697
855
  "default": "light-dark(#c94a1a, #f09060)"
698
856
  },
699
857
  {
700
858
  "description": "Source-mode link token color",
701
- "name": "--rme-src-link-color",
859
+ "name": "--rc-markdown-editor-src-link-color",
702
860
  "default": "light-dark(#0370b0, #60b8e8)"
703
861
  },
704
862
  {
705
863
  "description": "Source-mode blockquote token color",
706
- "name": "--rme-src-blockquote-color",
864
+ "name": "--rc-markdown-editor-src-blockquote-color",
707
865
  "default": "light-dark(#2d7a42, #70b880)"
708
866
  },
709
867
  {
710
868
  "description": "Source-mode list marker token color",
711
- "name": "--rme-src-list-color",
869
+ "name": "--rc-markdown-editor-src-list-color",
712
870
  "default": "light-dark(#7a5c0a, #d4ac48)"
713
871
  },
714
872
  {
715
873
  "description": "Source-mode strikethrough token color",
716
- "name": "--rme-src-dim-color",
874
+ "name": "--rc-markdown-editor-src-dim-color",
717
875
  "default": "GrayText"
718
876
  }
719
877
  ],
@@ -734,6 +892,21 @@
734
892
  }
735
893
  ],
736
894
  "members": [
895
+ {
896
+ "kind": "field",
897
+ "name": "messages",
898
+ "type": {
899
+ "text": "Partial<RCMarkdownEditorMessages> | undefined"
900
+ },
901
+ "description": "Built-in text overrides; unset keys fall back to registered text, then English."
902
+ },
903
+ {
904
+ "kind": "field",
905
+ "name": "_messages",
906
+ "privacy": "private",
907
+ "readonly": true,
908
+ "default": "new MessagesController( this, 'rc-markdown-editor', DEFAULT_MARKDOWN_EDITOR_MESSAGES, { overrides: () => this.messages }, )"
909
+ },
737
910
  {
738
911
  "kind": "field",
739
912
  "name": "_value",
@@ -936,7 +1109,7 @@
936
1109
  "kind": "field",
937
1110
  "name": "_cachedTree",
938
1111
  "type": {
939
- "text": "ReturnType<typeof fromMarkdown> | null"
1112
+ "text": "MarkdownTree | null"
940
1113
  },
941
1114
  "privacy": "protected",
942
1115
  "default": "null"
@@ -1062,7 +1235,7 @@
1062
1235
  {
1063
1236
  "name": "tree",
1064
1237
  "type": {
1065
- "text": "ReturnType<typeof fromMarkdown>"
1238
+ "text": "MarkdownTree"
1066
1239
  }
1067
1240
  },
1068
1241
  {
@@ -1383,6 +1556,14 @@
1383
1556
  }
1384
1557
  ],
1385
1558
  "exports": [
1559
+ {
1560
+ "kind": "js",
1561
+ "name": "DEFAULT_MARKDOWN_EDITOR_MESSAGES",
1562
+ "declaration": {
1563
+ "name": "DEFAULT_MARKDOWN_EDITOR_MESSAGES",
1564
+ "module": "src/rc-markdown-editor.ts"
1565
+ }
1566
+ },
1386
1567
  {
1387
1568
  "kind": "js",
1388
1569
  "name": "RcMarkdownEditor",