@mono-lit/helper 0.0.9 → 0.0.10

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 (161) hide show
  1. package/dist/accordion-core-DaNyPWRr.js +277 -0
  2. package/dist/alert-core-DWtHbX_-.js +134 -0
  3. package/dist/breadcrumb-list-core-Dh68T8Cf.js +747 -0
  4. package/dist/{mono-button-CLkHg3WW.js → button-core-DerXg84Q.js} +3 -276
  5. package/dist/button-dropdown-core-DKYEOyjy.js +654 -0
  6. package/dist/button-utils-D5-66M02.js +63 -0
  7. package/dist/card-utils-l80qAmrN.js +312 -0
  8. package/dist/chart-core-DV7hD3ZY.js +801 -0
  9. package/dist/checkbox-utils-DKdrhAzF.js +337 -0
  10. package/dist/chip-utils-DpRrd7Zj.js +403 -0
  11. package/dist/{data-source-controller-C6C4ej_M.js → data-source-controller-DS_JLrmS.js} +1 -1
  12. package/dist/{data-source-options-fxT5QIX4.js → data-source-options-DJUNU26C.js} +6 -6
  13. package/dist/{data-source-read-BL266IW0.js → data-source-read-uKJpRAzx.js} +2 -2
  14. package/dist/date-core-CyuSyvvG.js +734 -0
  15. package/dist/drawer-core-DbFWvNln.js +759 -0
  16. package/dist/dropdown-core-BCH1pK14.js +511 -0
  17. package/dist/dropdown-table-core-SfHUJVFq.js +1342 -0
  18. package/dist/export.js +1 -1
  19. package/dist/{field-path-BabiMrrA.js → field-path-DK2VBWHl.js} +1 -1
  20. package/dist/field-tooltip.css_raw-DVblekCl.js +5 -0
  21. package/dist/{field-validation.css_raw-Cx6SGrfP.js → field-validation.css_raw-BU7C6173.js} +1 -170
  22. package/dist/file-upload-core-Cz_dBQMx.js +624 -0
  23. package/dist/filter-builder-core-DyWjbBP7.js +381 -0
  24. package/dist/{filter-builder-B6Y2mmbM.js → filter-builder-vbqIuPhX.js} +1 -1
  25. package/dist/{filter-eval-ChDSaAUH.js → filter-eval-CqeBnMYh.js} +1 -1
  26. package/dist/{filter-odata-Bi27XUpQ.js → filter-odata-GsczYKNC.js} +1 -1
  27. package/dist/{hydration-flush-BaE9gN3C.js → hydration-flush-Volt9X7Q.js} +2 -1071
  28. package/dist/index.js +11 -11
  29. package/dist/{index.node-DTqDBca7.js → index.node-Csy9zrr1.js} +4 -4
  30. package/dist/index.node.js +11 -11
  31. package/dist/input-utils-BglY-k0H.js +1145 -0
  32. package/dist/menu-core-DkAYuCZ2.js +831 -0
  33. package/dist/modal-core-CSBSPN_m.js +844 -0
  34. package/dist/mono-button-DVvZ03P-.js +280 -0
  35. package/dist/{mono-button.shadow-DqZMpcqY.js → mono-button.shadow-BANxMGln.js} +6 -594
  36. package/dist/{mono-data-chart-NKPdAgVq.js → mono-data-chart-ChF4J9RT.js} +6 -6
  37. package/dist/{mono-data-dropdown-B2iRpJuI.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
  38. package/dist/{mono-data-grid-llJCX9MC.js → mono-data-grid-DJkp96N-.js} +144 -46
  39. package/dist/{mono-event-BPku9HpS.js → mono-event-CAZf0F_k.js} +14 -9
  40. package/dist/{mono-form-controller-BrA10erm.js → mono-form-controller-DxZLvyg6.js} +2 -1
  41. package/dist/mono-table-checkbox-core-BKOMx8R5.js +5288 -0
  42. package/dist/nav-core-B5qU2dzn.js +225 -0
  43. package/dist/{normalize-error-D93O4q8g.js → normalize-error-BEcd1tmS.js} +2 -2
  44. package/dist/otp-core-DXg3vFLh.js +758 -0
  45. package/dist/radio-utils-Dk9Tl1jz.js +319 -0
  46. package/dist/rich-text-editor-core-Ddd_QaLn.js +1280 -0
  47. package/dist/select-utils-BgArYHk8.js +2140 -0
  48. package/dist/sidebar-core-CD6txDo3.js +583 -0
  49. package/dist/slider-core-vcWr321-.js +1014 -0
  50. package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +2 -2
  51. package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +1 -1
  52. package/dist/src/components/dropdown-table/index.d.ts +1 -1
  53. package/dist/src/components/dropdown-table/index.shadow.d.ts +1 -1
  54. package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +1 -1
  55. package/dist/src/components/form/form-types.d.ts +9 -3
  56. package/dist/src/components/input/input-core.d.ts +1 -1
  57. package/dist/src/components/input/input-types.d.ts +1 -1
  58. package/dist/src/components/otp/otp-core.d.ts +1 -1
  59. package/dist/src/components/select/select-core.d.ts +1 -1
  60. package/dist/src/components/select/select-types.d.ts +1 -1
  61. package/dist/src/components/slider/slider-core.d.ts +1 -1
  62. package/dist/src/components/slider/slider-types.d.ts +1 -1
  63. package/dist/src/components/table/filter-suggestion.d.ts +171 -0
  64. package/dist/src/components/table/index.d.ts +5 -4
  65. package/dist/src/components/table/index.shadow.d.ts +5 -4
  66. package/dist/src/components/table/mono-data-grid.d.ts +22 -3
  67. package/dist/src/components/table/mono-table-empty-core.d.ts +37 -0
  68. package/dist/src/components/table/mono-table-search-core.d.ts +22 -3
  69. package/dist/src/components/table/table-types.d.ts +74 -4
  70. package/dist/src/components/tag-input/tag-input-core.d.ts +1 -1
  71. package/dist/src/components/tag-input/tag-input-types.d.ts +1 -1
  72. package/dist/src/components/textarea/textarea-core.d.ts +1 -1
  73. package/dist/src/composables/mono-event.d.ts +7 -1
  74. package/dist/src/entries/index.d.ts +8 -6
  75. package/dist/src/entries/index.node.d.ts +8 -6
  76. package/dist/src/search/index.d.ts +1 -1
  77. package/dist/src/utils/group-count.d.ts +36 -0
  78. package/dist/switch-utils-CTZ4id2V.js +338 -0
  79. package/dist/tabs-core-r5-B8k_N.js +317 -0
  80. package/dist/tag-input-utils-D2JA90DQ.js +3060 -0
  81. package/dist/textarea-utils-VU1KeXm8.js +821 -0
  82. package/dist/ui/accordion.js +2 -274
  83. package/dist/ui/alert.js +2 -131
  84. package/dist/ui/breadcrumb.js +4 -745
  85. package/dist/ui/button-dropdown.js +4 -652
  86. package/dist/ui/button.js +2 -63
  87. package/dist/ui/card.js +2 -310
  88. package/dist/ui/chart.js +4 -800
  89. package/dist/ui/checkbox.js +4 -335
  90. package/dist/ui/chip.js +4 -402
  91. package/dist/ui/date.js +3 -732
  92. package/dist/ui/drawer.js +3 -757
  93. package/dist/ui/dropdown-table.js +5 -1341
  94. package/dist/ui/dropdown.js +4 -509
  95. package/dist/ui/file-upload.js +3 -622
  96. package/dist/ui/filter.js +5 -380
  97. package/dist/ui/form.js +1 -1
  98. package/dist/ui/index.css +118 -1
  99. package/dist/ui/input.js +3 -1141
  100. package/dist/ui/menu.js +4 -828
  101. package/dist/ui/modal.js +4 -843
  102. package/dist/ui/nav.js +4 -223
  103. package/dist/ui/otp.js +4 -756
  104. package/dist/ui/radio.js +4 -317
  105. package/dist/ui/rich-text-editor.js +4 -1278
  106. package/dist/ui/select.js +5 -2138
  107. package/dist/ui/shadow/accordion.js +4 -273
  108. package/dist/ui/shadow/alert.js +4 -130
  109. package/dist/ui/shadow/breadcrumb.js +5 -744
  110. package/dist/ui/shadow/button-dropdown.js +6 -652
  111. package/dist/ui/shadow/button.js +3 -63
  112. package/dist/ui/shadow/card.js +4 -309
  113. package/dist/ui/shadow/chart.js +6 -1576
  114. package/dist/ui/shadow/checkbox.js +4 -334
  115. package/dist/ui/shadow/chip.js +4 -396
  116. package/dist/ui/shadow/date.js +7 -731
  117. package/dist/ui/shadow/drawer.js +4 -756
  118. package/dist/ui/shadow/dropdown-table.js +8 -1762
  119. package/dist/ui/shadow/dropdown.js +4 -508
  120. package/dist/ui/shadow/file-upload.js +4 -620
  121. package/dist/ui/shadow/filter.js +7 -379
  122. package/dist/ui/shadow/input.js +6 -1140
  123. package/dist/ui/shadow/menu.js +5 -828
  124. package/dist/ui/shadow/modal.js +6 -1063
  125. package/dist/ui/shadow/nav.js +5 -223
  126. package/dist/ui/shadow/otp.js +6 -754
  127. package/dist/ui/shadow/radio.js +4 -316
  128. package/dist/ui/shadow/rich-text-editor.js +4 -1276
  129. package/dist/ui/shadow/select.js +6 -2136
  130. package/dist/ui/shadow/sidebar.js +5 -581
  131. package/dist/ui/shadow/slider.js +5 -1010
  132. package/dist/ui/shadow/switch.js +4 -335
  133. package/dist/ui/shadow/table.js +10 -4501
  134. package/dist/ui/shadow/tabs.js +6 -315
  135. package/dist/ui/shadow/tag-input.js +7 -3057
  136. package/dist/ui/shadow/textarea.js +6 -817
  137. package/dist/ui/sidebar.js +3 -581
  138. package/dist/ui/slider.js +4 -1012
  139. package/dist/ui/switch.js +4 -336
  140. package/dist/ui/table.js +9 -4502
  141. package/dist/ui/tabs.js +4 -315
  142. package/dist/ui/tag-input.js +5 -3058
  143. package/dist/ui/textarea.js +4 -819
  144. package/dist/vue.d.ts +3 -2
  145. package/package.json +3 -3
  146. package/dist/chip-strip-bNfLn52Z.js +0 -215
  147. package/dist/data-source-controller-Dx6IQ2CN.js +0 -243
  148. package/dist/data-source-options-BM4r4PRw.js +0 -558
  149. package/dist/data-source-read-HyBCRg1t.js +0 -242
  150. package/dist/excel-BXzr3uI1.js +0 -784
  151. package/dist/export-ixRdCS2y.js +0 -2388
  152. package/dist/field-tooltip-addon-CWCp19mJ.js +0 -702
  153. package/dist/field-tooltip.css_raw-U5UeTa2d.js +0 -269
  154. package/dist/filter-builder-C0T3pMx2.js +0 -208
  155. package/dist/form-control-core-BbiACMtL.js +0 -226
  156. package/dist/icon-ClxnYhBG.js +0 -19
  157. package/dist/import-Dc4eXC02.js +0 -612
  158. package/dist/light-slots-_no0r2Z-.js +0 -246
  159. package/dist/markdown-uGlE_OfJ.js +0 -20191
  160. package/dist/mono-data-grid-e9ZVBlNN.js +0 -4240
  161. package/dist/normalize-error-BmLbgANw.js +0 -1048
@@ -1,1281 +1,9 @@
1
- import { _ as buildSizeStyle, a as __decorate, d as optionalNumberConverter, f as customElement, i as withShadowUtilityStyles, l as defineHybridPropAliases, r as toShadowCss, s as booleanStringConverter, t as flushSsrHydration, v as toCssSize } from "../../hydration-flush-BaE9gN3C.js";
2
- import { t as dispatchMonoEvent } from "../../mono-event-BPku9HpS.js";
3
- import { t as MonoFormControlCore } from "../../form-control-core-BbiACMtL.js";
1
+ import { t as customElement } from "../../mono-element-CKcT0rwv.js";
2
+ import { t as __decorate } from "../../decorate-DbYFpi8R.js";
3
+ import { a as TOOLBAR_DEFAULT, c as TOOLBAR_STANDARD, d as resolveToolbar, f as SUNEDITOR_LANG_CODES, g as loadSunEditorPlugins, h as loadSunEditorLang, i as TOOLBAR_BASIC, l as pruneToolbar, m as loadSunEditorCss, n as AUTO_EXCLUDED_PLUGINS, o as TOOLBAR_FULL, p as loadSunEditor, r as SUNEDITOR_CORE_BUTTONS, s as TOOLBAR_PRESETS, t as MonoRichTextEditorCore, u as resolvePlugins } from "../../rich-text-editor-core-Ddd_QaLn.js";
4
+ import { i as withShadowUtilityStyles, r as toShadowCss, t as flushSsrHydration } from "../../hydration-flush-Volt9X7Q.js";
4
5
  import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
5
- import { property, state } from "lit/decorators.js";
6
- import { styleMap } from "lit/directives/style-map.js";
7
6
 
8
- //#region src/components/rich-text-editor/rich-text-editor-loader.ts
9
- const INSTALL_HINT = "[mono-rich-text-editor] needs the optional peer dependency \"suneditor\". Install it in your app: pnpm add suneditor@^3.3.3";
10
- function withHint(err) {
11
- const message = err instanceof Error ? err.message : String(err);
12
- return /* @__PURE__ */ new Error(`${INSTALL_HINT}${message ? ` (original error: ${message})` : ""}`);
13
- }
14
- let _corePromise = null;
15
- /** The `suneditor` default export (`{ create, init }`), cached; a failure resets so a later attempt retries. */
16
- function loadSunEditor() {
17
- _corePromise ??= import("suneditor").then((m) => m?.default ?? m).catch((err) => {
18
- _corePromise = null;
19
- throw withHint(err);
20
- });
21
- return _corePromise;
22
- }
23
- let _cssPromise = null;
24
- /**
25
- * SunEditor's UI stylesheet (`suneditor/css/editor`), injected ONCE per page by
26
- * the consumer's bundler as a side-effect import. Failure is not fatal — the
27
- * editor still works, unstyled — so it is reported once and swallowed.
28
- */
29
- function loadSunEditorCss() {
30
- _cssPromise ??= import("suneditor/css/editor").then(() => void 0).catch((err) => {
31
- console.warn("[mono-rich-text-editor] could not load \"suneditor/css/editor\" — the editor will render unstyled. Import the stylesheet yourself and set load-css=\"false\" if your bundler cannot import CSS from a dynamic import.", err);
32
- });
33
- return _cssPromise;
34
- }
35
- let _pluginsPromise = null;
36
- /** Every built-in plugin, keyed by name (`suneditor/plugins`' default export). */
37
- function loadSunEditorPlugins() {
38
- _pluginsPromise ??= import("suneditor/plugins").then((m) => m?.default ?? m).catch((err) => {
39
- _pluginsPromise = null;
40
- throw withHint(err);
41
- });
42
- return _pluginsPromise;
43
- }
44
- /**
45
- * The language packs SunEditor ships, each behind its own static import so the
46
- * consumer's bundler can split them. Unknown codes fall back to English (the
47
- * editor's own default) with a warning rather than failing the build.
48
- */
49
- const LANGS = {
50
- ckb: () => import("suneditor/langs/ckb"),
51
- cs: () => import("suneditor/langs/cs"),
52
- da: () => import("suneditor/langs/da"),
53
- de: () => import("suneditor/langs/de"),
54
- en: () => import("suneditor/langs/en"),
55
- es: () => import("suneditor/langs/es"),
56
- fa: () => import("suneditor/langs/fa"),
57
- fr: () => import("suneditor/langs/fr"),
58
- he: () => import("suneditor/langs/he"),
59
- hu: () => import("suneditor/langs/hu"),
60
- it: () => import("suneditor/langs/it"),
61
- ja: () => import("suneditor/langs/ja"),
62
- km: () => import("suneditor/langs/km"),
63
- ko: () => import("suneditor/langs/ko"),
64
- lv: () => import("suneditor/langs/lv"),
65
- nl: () => import("suneditor/langs/nl"),
66
- pl: () => import("suneditor/langs/pl"),
67
- pt_br: () => import("suneditor/langs/pt_br"),
68
- ro: () => import("suneditor/langs/ro"),
69
- ru: () => import("suneditor/langs/ru"),
70
- se: () => import("suneditor/langs/se"),
71
- tr: () => import("suneditor/langs/tr"),
72
- uk: () => import("suneditor/langs/uk"),
73
- ur: () => import("suneditor/langs/ur"),
74
- zh_cn: () => import("suneditor/langs/zh_cn")
75
- };
76
- /** Codes `lang` accepts. */
77
- const SUNEDITOR_LANG_CODES = Object.keys(LANGS);
78
- const _langPromises = /* @__PURE__ */ new Map();
79
- /**
80
- * A language pack by code (`ko`, `pt-BR` → `pt_br`, `zh-CN` → `zh_cn`, …), or
81
- * `undefined` for English / an unknown code (SunEditor then uses its default).
82
- */
83
- function loadSunEditorLang(code) {
84
- const key = code.trim().toLowerCase().replace(/-/g, "_");
85
- if (!key || key === "en") return Promise.resolve(void 0);
86
- const loader = LANGS[key];
87
- if (!loader) {
88
- console.warn(`[mono-rich-text-editor] unknown lang "${code}" — SunEditor ships: ${SUNEDITOR_LANG_CODES.join(", ")}. Using English.`);
89
- return Promise.resolve(void 0);
90
- }
91
- let p = _langPromises.get(key);
92
- if (!p) {
93
- p = loader().then((m) => m?.default ?? m).catch((err) => {
94
- _langPromises.delete(key);
95
- throw withHint(err);
96
- });
97
- _langPromises.set(key, p);
98
- }
99
- return p;
100
- }
101
-
102
- //#endregion
103
- //#region src/components/rich-text-editor/rich-text-editor-toolbar.ts
104
- /**
105
- * Buttons SunEditor's core provides WITHOUT a plugin (v3 `_defaultButtons`).
106
- * Anything else in a `buttonList` is the `key` of a plugin that has to be in
107
- * `plugins`, so a preset is filtered against the plugins actually loaded.
108
- */
109
- const SUNEDITOR_CORE_BUTTONS = /* @__PURE__ */ new Set([
110
- "bold",
111
- "underline",
112
- "italic",
113
- "strike",
114
- "subscript",
115
- "superscript",
116
- "removeFormat",
117
- "copyFormat",
118
- "indent",
119
- "outdent",
120
- "fullScreen",
121
- "showBlocks",
122
- "codeView",
123
- "markdownView",
124
- "undo",
125
- "redo",
126
- "preview",
127
- "print",
128
- "copy",
129
- "dir",
130
- "dir_ltr",
131
- "dir_rtl",
132
- "finder",
133
- "save",
134
- "newDocument",
135
- "selectAll",
136
- "pageBreak",
137
- "pageUp",
138
- "pageDown",
139
- "pageNavigator"
140
- ]);
141
- /**
142
- * Built-ins `plugins="auto"` leaves OUT: each needs configuration SunEditor
143
- * warns about when it is missing (a server `url` / `uploadUrl`, a `templates` or
144
- * `layouts` list, an external KaTeX / MathJax / PDF service). Ask for them by
145
- * name — `plugins="auto, image­Gallery"` is not a thing, but
146
- * `:plugins.prop="[...]"` with the class or `plugins="font, link, template"`
147
- * is — and supply their options through `options`.
148
- */
149
- const AUTO_EXCLUDED_PLUGINS = /* @__PURE__ */ new Set([
150
- "exportPDF",
151
- "fileUpload",
152
- "layout",
153
- "template",
154
- "math",
155
- "imageGallery",
156
- "videoGallery",
157
- "audioGallery",
158
- "fileGallery",
159
- "fileBrowser"
160
- ]);
161
- /** Markers a `buttonList` may carry besides button names. */
162
- const SPECIAL = /^(\||\/|-left|-right|-center|#fix)$/;
163
- /**
164
- * SunEditor's own default (`DEFAULTS.BUTTON_LIST`) — no plugin buttons at all.
165
- * Mirrored here rather than imported so the presets stay pure.
166
- */
167
- const TOOLBAR_DEFAULT = [
168
- ["undo", "redo"],
169
- "|",
170
- [
171
- "bold",
172
- "underline",
173
- "italic",
174
- "strike",
175
- "|",
176
- "subscript",
177
- "superscript"
178
- ],
179
- "|",
180
- ["removeFormat"],
181
- "|",
182
- ["outdent", "indent"],
183
- "|",
184
- [
185
- "fullScreen",
186
- "showBlocks",
187
- "codeView"
188
- ],
189
- "|",
190
- ["preview", "print"]
191
- ];
192
- /** The essentials: a comment box, a note field. */
193
- const TOOLBAR_BASIC = [
194
- ["undo", "redo"],
195
- "|",
196
- [
197
- "bold",
198
- "underline",
199
- "italic",
200
- "strike"
201
- ],
202
- "|",
203
- [
204
- "list_bulleted",
205
- "list_numbered",
206
- "link"
207
- ],
208
- "|",
209
- ["removeFormat"]
210
- ];
211
- /** The default: what a document / description / email body needs. */
212
- const TOOLBAR_STANDARD = [
213
- ["undo", "redo"],
214
- "|",
215
- [
216
- "blockStyle",
217
- "font",
218
- "fontSize"
219
- ],
220
- "|",
221
- [
222
- "bold",
223
- "underline",
224
- "italic",
225
- "strike"
226
- ],
227
- ["fontColor", "backgroundColor"],
228
- "|",
229
- [
230
- "align",
231
- "list_bulleted",
232
- "list_numbered",
233
- "outdent",
234
- "indent"
235
- ],
236
- "|",
237
- [
238
- "table",
239
- "link",
240
- "image",
241
- "video"
242
- ],
243
- "|",
244
- [
245
- "blockquote",
246
- "codeBlock",
247
- "hr"
248
- ],
249
- "|",
250
- ["removeFormat"],
251
- "|",
252
- ["codeView", "fullScreen"]
253
- ];
254
- /**
255
- * Every built-in that works with no extra configuration. Left out on purpose:
256
- * the galleries / file browser (need a server `url`), `template` (needs a
257
- * `templates` list), `math` and `exportPDF` (need external libraries) — pass
258
- * those through `toolbar` + `options` when the app provides what they need.
259
- */
260
- const TOOLBAR_FULL = [
261
- ["undo", "redo"],
262
- "|",
263
- [
264
- "blockStyle",
265
- "paragraphStyle",
266
- "font",
267
- "fontSize",
268
- "lineHeight"
269
- ],
270
- "|",
271
- [
272
- "bold",
273
- "underline",
274
- "italic",
275
- "strike",
276
- "subscript",
277
- "superscript"
278
- ],
279
- [
280
- "fontColor",
281
- "backgroundColor",
282
- "textStyle",
283
- "copyFormat",
284
- "removeFormat"
285
- ],
286
- "|",
287
- [
288
- "align",
289
- "list_bulleted",
290
- "list_numbered",
291
- "outdent",
292
- "indent",
293
- "dir_ltr",
294
- "dir_rtl"
295
- ],
296
- "|",
297
- [
298
- "table",
299
- "layout",
300
- "link",
301
- "image",
302
- "video",
303
- "audio",
304
- "embed",
305
- "drawing"
306
- ],
307
- "|",
308
- [
309
- "blockquote",
310
- "codeBlock",
311
- "hr",
312
- "pageBreak"
313
- ],
314
- "|",
315
- [
316
- "showBlocks",
317
- "codeView",
318
- "markdownView",
319
- "fullScreen"
320
- ],
321
- "|",
322
- [
323
- "finder",
324
- "selectAll",
325
- "preview",
326
- "print"
327
- ]
328
- ];
329
- const TOOLBAR_PRESETS = {
330
- basic: TOOLBAR_BASIC,
331
- standard: TOOLBAR_STANDARD,
332
- full: TOOLBAR_FULL,
333
- default: TOOLBAR_DEFAULT
334
- };
335
- function isToolbarPreset(value) {
336
- return typeof value === "string" && value in TOOLBAR_PRESETS;
337
- }
338
- /**
339
- * The `buttonList` for a `toolbar` prop value: a preset name, an array, its
340
- * JSON, or a string of names — `bold, italic | link` (`|` and `/` are honoured
341
- * as separators, `,`/whitespace split the rest). Unknown → the `standard` preset.
342
- */
343
- function resolveToolbar(toolbar) {
344
- if (toolbar == null || toolbar === "") return TOOLBAR_STANDARD;
345
- if (Array.isArray(toolbar)) return toolbar;
346
- if (isToolbarPreset(toolbar)) return TOOLBAR_PRESETS[toolbar];
347
- if (typeof toolbar !== "string") return TOOLBAR_STANDARD;
348
- const trimmed = toolbar.trim();
349
- if (trimmed.startsWith("[")) try {
350
- const parsed = JSON.parse(trimmed);
351
- if (Array.isArray(parsed)) return parsed;
352
- } catch {}
353
- const out = [];
354
- let group = [];
355
- for (const token of trimmed.split(/[\s,]+/).filter(Boolean)) if (SPECIAL.test(token)) {
356
- if (group.length) out.push(group);
357
- group = [];
358
- out.push(token);
359
- } else group.push(token);
360
- if (group.length) out.push(group);
361
- return out.length ? out : TOOLBAR_STANDARD;
362
- }
363
- /**
364
- * Drop the plugin buttons a `buttonList` names that are NOT among `available`
365
- * plugin keys, so `plugins="none"` (or a trimmed list) with the default toolbar
366
- * degrades to the core buttons instead of SunEditor rejecting the list.
367
- * Separators left with nothing on either side are dropped too.
368
- */
369
- function pruneToolbar(list, available) {
370
- const keep = (name) => SPECIAL.test(name) || SUNEDITOR_CORE_BUTTONS.has(name) || available.has(name);
371
- const out = [];
372
- for (const item of list) if (Array.isArray(item)) {
373
- const group = item.filter(keep);
374
- if (group.some((n) => !SPECIAL.test(n))) out.push(group);
375
- } else if (keep(item)) out.push(item);
376
- const cleaned = [];
377
- for (const item of out) {
378
- const isSep = typeof item === "string" && SPECIAL.test(item);
379
- const prev = cleaned[cleaned.length - 1];
380
- if (isSep && (cleaned.length === 0 || typeof prev === "string" && SPECIAL.test(prev))) continue;
381
- cleaned.push(item);
382
- }
383
- while (cleaned.length && typeof cleaned[cleaned.length - 1] === "string") cleaned.pop();
384
- return cleaned;
385
- }
386
- /**
387
- * The plugin set to hand SunEditor, from the `plugins` prop and (when needed)
388
- * the full built-in map. Returns `{ plugins, keys }` — `keys` is what
389
- * `pruneToolbar` filters against.
390
- *
391
- * - `'auto'` / unset → every built-in that needs no configuration (`all` must
392
- * be supplied; see {@link AUTO_EXCLUDED_PLUGINS}).
393
- * - `'none'` → nothing.
394
- * - an array → plugin classes kept as they are, NAMES looked up in `all`.
395
- * - an object → SunEditor's own `{ name: class }` form.
396
- * - a string → comma/space-separated names.
397
- */
398
- function resolvePlugins(plugins, all) {
399
- const out = [];
400
- const keys = /* @__PURE__ */ new Set();
401
- const push = (key, cls) => {
402
- if (!cls || out.includes(cls)) return;
403
- out.push(cls);
404
- const k = key ?? pluginKey(cls);
405
- if (k) keys.add(k);
406
- };
407
- if (plugins == null || plugins === "" || plugins === "auto") {
408
- for (const [key, cls] of Object.entries(all ?? {})) if (!AUTO_EXCLUDED_PLUGINS.has(key)) push(key, cls);
409
- return {
410
- plugins: out,
411
- keys
412
- };
413
- }
414
- if (plugins === "none") return {
415
- plugins: out,
416
- keys
417
- };
418
- if (typeof plugins === "string") {
419
- for (const name of plugins.split(/[\s,]+/).filter(Boolean)) push(name, all?.[name]);
420
- return {
421
- plugins: out,
422
- keys
423
- };
424
- }
425
- if (Array.isArray(plugins)) {
426
- for (const entry of plugins) if (typeof entry === "string") push(entry, all?.[entry]);
427
- else push(void 0, entry);
428
- return {
429
- plugins: out,
430
- keys
431
- };
432
- }
433
- for (const [key, cls] of Object.entries(plugins)) push(key, cls);
434
- return {
435
- plugins: out,
436
- keys
437
- };
438
- }
439
- /** A SunEditor v3 plugin class carries its button name as `static key`. */
440
- function pluginKey(cls) {
441
- const key = cls?.key;
442
- return typeof key === "string" ? key : void 0;
443
- }
444
- /** Whether `plugins` needs the full built-in map to be resolved. */
445
- function pluginsNeedCatalog(plugins) {
446
- if (plugins == null || plugins === "" || plugins === "auto") return true;
447
- if (plugins === "none") return false;
448
- if (typeof plugins === "string") return true;
449
- if (Array.isArray(plugins)) return plugins.some((p) => typeof p === "string");
450
- return false;
451
- }
452
-
453
- //#endregion
454
- //#region src/components/rich-text-editor/rich-text-editor-core.ts
455
- /**
456
- * `MonoRichTextEditorCore` — render-mode-agnostic logic for `mono-rich-text-editor`,
457
- * a form field whose input is a [SunEditor](https://suneditor.com) v3 instance.
458
- *
459
- * **The peer is optional.** `suneditor` is externalized from mono's build and
460
- * loaded the first time an element renders (`rich-text-editor-loader.ts`). An
461
- * app that has not installed it gets an inline message naming the package and
462
- * the command, plus an `mno-error` event — never a crash.
463
- *
464
- * **The editor's DOM lives in LIGHT DOM, in both builds.** SunEditor is styled by
465
- * one global stylesheet and parks its modals in a `.sun-editor-carrier-wrapper`
466
- * on `<body>`, so neither could ever be adopted into a shadow root. The core
467
- * therefore creates ONE mount node (`.mono-rich-text-editor-mount`) and each
468
- * build decides where it shows: the light build re-homes it into the rendered
469
- * field frame, the shadow build keeps it as a light child projected through
470
- * `<slot name="editor">`. Either way it inherits the `--se-*` theme remap the
471
- * frame declares, and the page sheet reaches it. SSR renders the chrome only —
472
- * an editor is client state, exactly like `mono-chart` and `mono-date`.
473
- *
474
- * **Lifecycle mirrors `date-core`.** `_ensureEditor()` is idempotent and runs
475
- * from `firstUpdated`, `connectedCallback` and every `updated()` that finds no
476
- * instance, so a `v-if` / `<KeepAlive>` round trip rebuilds the editor instead
477
- * of leaving a dead field. A build token plus an `isConnected` re-check after
478
- * every `await` keeps a superseded build from constructing an editor on a
479
- * detached node that nothing would ever destroy. `disconnectedCallback`
480
- * destroys BEFORE `super` so the DOM is still in the tree.
481
- *
482
- * **Value model.** `modelValue` is the HTML. SunEditor → element: `onChange`
483
- * emits `mno-change`, `onInput` emits `mno-input` (the textarea detail shape),
484
- * an empty editor is published as `''` so `required` means what it says.
485
- * Element → editor: an outside `modelValue` write reaches `$.html.set()` only
486
- * when it differs from the last value the editor itself produced — no caret
487
- * jumps, no echo. `monoForm` binds through {@link MonoFormControlCore} exactly
488
- * as `mono-textarea` does.
489
- */
490
- const MonoRichTextEditorCore = (superClass) => {
491
- class MonoRichTextEditorCoreClass extends MonoFormControlCore(superClass) {
492
- constructor(...args) {
493
- super(...args);
494
- this.size = "md";
495
- this.color = "primary";
496
- this.variant = "outlined";
497
- this.modelValue = "";
498
- this.value = "";
499
- this.name = "";
500
- this.placeholder = "";
501
- this.label = "";
502
- this.helperText = "";
503
- this.validationState = "default";
504
- this.validationMessage = "";
505
- this.errorMessage = "";
506
- this.successMessage = "";
507
- this.disabled = false;
508
- this.readonly = false;
509
- this.required = false;
510
- this.cssClass = {};
511
- this.cssClassName = "";
512
- this.mode = "classic";
513
- this.charCounter = false;
514
- this.statusbar = true;
515
- this.loadCss = true;
516
- this._hasLabelSlotState = false;
517
- this._hasHelperSlotState = false;
518
- this._error = "";
519
- this._loading = false;
520
- this._fieldId = `mono-rich-text-editor-${Math.random().toString(36).slice(2)}`;
521
- this._messageId = `${this._fieldId}-message`;
522
- this._editor = null;
523
- this._building = false;
524
- this._buildToken = 0;
525
- this._lastEmitted = "";
526
- this._lastChanged = "";
527
- this._ready = false;
528
- this._titleObservers = [];
529
- this._onToggleFullScreen = (params) => {
530
- this._mount?.toggleAttribute("mono-fullscreen", !!params?.is);
531
- };
532
- this._onLoad = () => {
533
- this._ready = true;
534
- this._loading = false;
535
- this._applyState();
536
- this._applyAria();
537
- const editor = this._editor;
538
- if (editor) dispatchMonoEvent(this, "ready", { editor });
539
- };
540
- this._onChange = (params) => {
541
- this._publish("change", params);
542
- };
543
- this._onInput = (params) => {
544
- this._publish("input", params);
545
- };
546
- this._onFocus = (params) => {
547
- dispatchMonoEvent(this, "focus", {
548
- name: this.name || void 0,
549
- sourceEvent: params
550
- });
551
- };
552
- this._onBlur = (params) => {
553
- dispatchMonoEvent(this, "blur", {
554
- name: this.name || void 0,
555
- sourceEvent: params
556
- });
557
- };
558
- defineHybridPropAliases(this, [
559
- "modelValue",
560
- "helperText",
561
- "validationState",
562
- "validationMessage",
563
- "errorMessage",
564
- "successMessage",
565
- "charCounter",
566
- "maxLength",
567
- "loadCss",
568
- "textDirection",
569
- "ariaLabelText",
570
- "cssClass",
571
- "minWidth",
572
- "maxWidth",
573
- "minHeight",
574
- "maxHeight"
575
- ]);
576
- for (const alias of ["css-class", "cssclass"]) Object.defineProperty(this, alias, {
577
- get: () => this.cssClass,
578
- set: (value) => this._setCssClass(value),
579
- configurable: true,
580
- enumerable: false
581
- });
582
- for (const alias of [
583
- "ariaLabel",
584
- "aria-label",
585
- "arialabel"
586
- ]) Object.defineProperty(this, alias, {
587
- get: () => this.ariaLabelText,
588
- set: (value) => {
589
- this.ariaLabelText = value == null ? void 0 : String(value);
590
- },
591
- configurable: true,
592
- enumerable: false
593
- });
594
- }
595
- static get observedAttributes() {
596
- return [
597
- ...super.observedAttributes ?? [],
598
- "modelvalue",
599
- "helpertext",
600
- "validationstate",
601
- "validationmessage",
602
- "errormessage",
603
- "successmessage",
604
- "charcounter",
605
- "maxlength",
606
- "loadcss",
607
- "textdirection",
608
- "arialabeltext",
609
- "arialabel",
610
- "css-class",
611
- "cssclass"
612
- ];
613
- }
614
- attributeChangedCallback(name, oldValue, newValue) {
615
- super.attributeChangedCallback(name, oldValue, newValue);
616
- if (oldValue === newValue) return;
617
- switch (name) {
618
- case "modelvalue":
619
- this.modelValue = newValue ?? "";
620
- return;
621
- case "helpertext":
622
- this.helperText = newValue ?? "";
623
- return;
624
- case "validationstate":
625
- this.validationState = newValue ?? "default";
626
- return;
627
- case "validationmessage":
628
- this.validationMessage = newValue ?? "";
629
- return;
630
- case "errormessage":
631
- this.errorMessage = newValue ?? "";
632
- return;
633
- case "successmessage":
634
- this.successMessage = newValue ?? "";
635
- return;
636
- case "charcounter":
637
- this.charCounter = this._toBoolean(newValue);
638
- return;
639
- case "maxlength":
640
- this.maxLength = optionalNumberConverter.fromAttribute(newValue);
641
- return;
642
- case "loadcss":
643
- this.loadCss = this._toBoolean(newValue);
644
- return;
645
- case "textdirection":
646
- this.textDirection = newValue === "rtl" ? "rtl" : newValue === "ltr" ? "ltr" : void 0;
647
- return;
648
- case "arialabeltext":
649
- case "arialabel":
650
- this.ariaLabelText = newValue ?? void 0;
651
- return;
652
- case "css-class":
653
- case "cssclass": this._setCssClass(newValue);
654
- }
655
- }
656
- static {
657
- this._configKeys = [
658
- "mode",
659
- "toolbar",
660
- "plugins",
661
- "language",
662
- "textDirection",
663
- "charCounter",
664
- "maxLength",
665
- "statusbar",
666
- "sticky",
667
- "options",
668
- "placeholder",
669
- "height",
670
- "minHeight",
671
- "maxHeight"
672
- ];
673
- }
674
- willUpdate(changed) {
675
- super.willUpdate?.(changed);
676
- for (const key of [
677
- "disabled",
678
- "readonly",
679
- "required",
680
- "charCounter",
681
- "statusbar",
682
- "loadCss"
683
- ]) {
684
- const v = this[key];
685
- if (typeof v !== "boolean") this[key] = this._toBoolean(v);
686
- }
687
- if (changed.has("modelValue") && this.value !== this.modelValue) this.value = this.modelValue ?? "";
688
- if (changed.has("value") && this.modelValue !== this.value) this.modelValue = String(this.value ?? "");
689
- }
690
- connectedCallback() {
691
- super.connectedCallback();
692
- if (isServer) return;
693
- this._ensureMount();
694
- if (this.hasUpdated) this._ensureEditor();
695
- }
696
- disconnectedCallback() {
697
- this._destroyEditor();
698
- super.disconnectedCallback();
699
- }
700
- firstUpdated() {
701
- if (isServer) return;
702
- this._ensureEditor();
703
- }
704
- updated(changed) {
705
- super.updated?.(changed);
706
- if (isServer) return;
707
- this._placeMount();
708
- if (!this._editor) {
709
- if (!this._building && MonoRichTextEditorCoreClass._configKeys.some((k) => changed.has(k))) this._error = "";
710
- this._ensureEditor();
711
- return;
712
- }
713
- if (MonoRichTextEditorCoreClass._configKeys.some((k) => changed.has(k))) {
714
- this._rebuild();
715
- return;
716
- }
717
- if (changed.has("modelValue")) this._applyModelValue();
718
- if (changed.has("disabled") || changed.has("readonly")) this._applyState();
719
- if (changed.has("ariaLabelText") || changed.has("label") || changed.has("placeholder")) this._applyAria();
720
- }
721
- /** Create the light-DOM mount once. Where it goes is the build's call (`_placeMount`). */
722
- _ensureMount() {
723
- if (this._mount) return;
724
- const mount = document.createElement("div");
725
- mount.className = "mono-rich-text-editor-mount";
726
- mount.setAttribute("mono-rte-mount", "");
727
- this._mount = mount;
728
- }
729
- /**
730
- * Put the mount where this build shows it. Light: inside the rendered
731
- * `[data-mono-slot="editor"]` frame. Shadow: a light child of the host, with
732
- * `slot="editor"` so `<slot name="editor">` projects it. Idempotent.
733
- */
734
- _placeMount() {
735
- const mount = this._mount;
736
- if (!mount) return;
737
- if (this._useNativeSlots) {
738
- if (mount.getAttribute("slot") !== "editor") mount.setAttribute("slot", "editor");
739
- if (mount.parentNode !== this) this.appendChild(mount);
740
- return;
741
- }
742
- const outlet = this.renderRoot.querySelector("[data-mono-slot=\"editor\"]");
743
- if (outlet && mount.parentNode !== outlet) outlet.appendChild(mount);
744
- }
745
- /**
746
- * Build the instance if there is none — idempotent, safe from every hook.
747
- * Every `await` is followed by the token / connection re-check: an element
748
- * that left the tree mid-import must not end up owning an editor.
749
- */
750
- async _ensureEditor() {
751
- if (isServer || this._editor || this._building) return;
752
- const mount = this._mount;
753
- if (!mount?.isConnected) return;
754
- this._building = true;
755
- this._loading = true;
756
- const token = ++this._buildToken;
757
- try {
758
- const [SUNEDITOR] = await Promise.all([loadSunEditor(), this.loadCss ? loadSunEditorCss() : Promise.resolve()]);
759
- const catalog = pluginsNeedCatalog(this.plugins) ? await loadSunEditorPlugins() : null;
760
- const lang = typeof this.language === "string" ? await loadSunEditorLang(this.language) : this.language;
761
- if (token !== this._buildToken || !this.isConnected || !mount.isConnected || this._editor) return;
762
- mount.replaceChildren();
763
- const target = document.createElement("div");
764
- target.className = "mono-rich-text-editor-target";
765
- mount.appendChild(target);
766
- this._lastEmitted = this._lastChanged = this.modelValue || "";
767
- this._ready = false;
768
- this._editor = SUNEDITOR.create(target, this._buildOptions(catalog, lang));
769
- this._error = "";
770
- this._themeTooltips(mount);
771
- } catch (err) {
772
- if (token !== this._buildToken) return;
773
- const message = err instanceof Error ? err.message : String(err);
774
- this._error = message;
775
- this._loading = false;
776
- dispatchMonoEvent(this, "error", {
777
- message,
778
- error: err
779
- });
780
- } finally {
781
- if (token === this._buildToken) this._building = false;
782
- }
783
- }
784
- /**
785
- * SunEditor labels its dropdown items (font family, font size, the colour
786
- * palettes …) with `title`, which the browser draws as the OS tooltip — white,
787
- * system font, out of every theme's reach. Rewrite each into `data-tooltip`
788
- * (+ `aria-label`, so nothing is lost to assistive tech), which the sheet
789
- * paints as Basecoat's tooltip; a title that only repeats the item's own text
790
- * is dropped. The lists are built lazily, on first open, so the mount — and
791
- * the modal carrier SunEditor parks on <body> — are watched for new ones.
792
- */
793
- _themeTooltips(mount) {
794
- this._titleObservers.forEach((o) => o.disconnect());
795
- this._titleObservers = [];
796
- mount.style.setProperty("--_mono-rte-page-font", getComputedStyle(this).fontFamily);
797
- const retitle = (root) => {
798
- const nodes = root.matches("[title]") ? [root, ...root.querySelectorAll("[title]")] : [...root.querySelectorAll("[title]")];
799
- for (const el of nodes) {
800
- const title = el.getAttribute("title")?.trim();
801
- el.removeAttribute("title");
802
- if (!title) continue;
803
- if (!el.hasAttribute("aria-label")) el.setAttribute("aria-label", title);
804
- if ((el.textContent ?? "").trim() === title) continue;
805
- el.setAttribute("data-tooltip", title);
806
- }
807
- };
808
- const watch = (root) => {
809
- retitle(root);
810
- if (typeof MutationObserver === "undefined") return;
811
- const mo = new MutationObserver((records) => {
812
- for (const r of records) {
813
- if (r.type === "attributes") {
814
- if (r.target.hasAttribute("title")) retitle(r.target);
815
- continue;
816
- }
817
- r.addedNodes.forEach((n) => {
818
- if (n.nodeType === Node.ELEMENT_NODE) retitle(n);
819
- });
820
- }
821
- });
822
- mo.observe(root, {
823
- childList: true,
824
- subtree: true,
825
- attributes: true,
826
- attributeFilter: ["title"]
827
- });
828
- this._titleObservers.push(mo);
829
- };
830
- watch(mount);
831
- const carriers = document.querySelectorAll(".sun-editor-carrier-wrapper");
832
- const carrier = carriers[carriers.length - 1];
833
- if (carrier) {
834
- carrier.style.setProperty("--_mono-rte-page-font", getComputedStyle(this).fontFamily);
835
- watch(carrier);
836
- }
837
- }
838
- _buildOptions(catalog, lang) {
839
- const { plugins, keys } = resolvePlugins(this.plugins, catalog);
840
- const buttonList = pruneToolbar(resolveToolbar(this.toolbar), keys);
841
- const consumer = this.options ?? {};
842
- const consumerEvents = consumer.events ?? {};
843
- const chain = (mine, name) => (params) => {
844
- const theirs = consumerEvents[name];
845
- const result = typeof theirs === "function" ? theirs(params) : void 0;
846
- mine(params);
847
- return result;
848
- };
849
- const options = {
850
- value: this.modelValue || "",
851
- placeholder: this.placeholder || void 0,
852
- mode: this.mode,
853
- buttonList,
854
- plugins,
855
- lang: lang ?? void 0,
856
- textDirection: this.textDirection,
857
- charCounter: this.charCounter || this.maxLength != null,
858
- charCounter_max: this.maxLength ?? void 0,
859
- statusbar: this.statusbar,
860
- toolbar_sticky: this.sticky ?? -1,
861
- width: "100%",
862
- height: toCssSize(this.height) ?? "auto",
863
- minHeight: toCssSize(this.minHeight) ?? void 0,
864
- maxHeight: toCssSize(this.maxHeight) ?? void 0,
865
- ...consumer,
866
- events: {
867
- ...consumerEvents,
868
- onload: chain(this._onLoad, "onload"),
869
- onChange: chain(this._onChange, "onChange"),
870
- onInput: chain(this._onInput, "onInput"),
871
- onFocus: chain(this._onFocus, "onFocus"),
872
- onBlur: chain(this._onBlur, "onBlur"),
873
- onToggleFullScreen: chain(this._onToggleFullScreen, "onToggleFullScreen")
874
- }
875
- };
876
- for (const key of Object.keys(options)) if (options[key] === void 0) delete options[key];
877
- return options;
878
- }
879
- _destroyEditor() {
880
- this._buildToken++;
881
- this._building = false;
882
- const editor = this._editor;
883
- this._editor = null;
884
- this._ready = false;
885
- this._loading = false;
886
- this._titleObservers.forEach((o) => o.disconnect());
887
- this._titleObservers = [];
888
- if (editor) try {
889
- editor.destroy();
890
- } catch {}
891
- this._mount?.replaceChildren();
892
- }
893
- /** Destroy + create, keeping the current HTML (it lives in `modelValue`). */
894
- _rebuild() {
895
- this._destroyEditor();
896
- this._ensureEditor();
897
- }
898
- /** The editor's HTML as the field's value — `''` when it holds nothing. */
899
- _read(data) {
900
- const editor = this._editor;
901
- if (!editor) return "";
902
- try {
903
- if (editor.isEmpty()) return "";
904
- } catch {}
905
- return typeof data === "string" ? data : editor.$.html.get();
906
- }
907
- _publish(kind, params) {
908
- if (this.disabled || this.readonly) return;
909
- const next = this._read(params?.data);
910
- const oldValue = this.modelValue;
911
- if (kind === "change") {
912
- if (next === this._lastChanged) return;
913
- this._lastChanged = next;
914
- }
915
- this._lastEmitted = next;
916
- this.value = next;
917
- this.modelValue = next;
918
- dispatchMonoEvent(this, kind, {
919
- modelValue: next,
920
- currentValue: next,
921
- oldValue,
922
- value: next,
923
- name: this.name || void 0,
924
- sourceEvent: params
925
- });
926
- }
927
- /** Push an OUTSIDE `modelValue` into the editor — only when it is genuinely new. */
928
- _applyModelValue() {
929
- const editor = this._editor;
930
- if (!editor) return;
931
- const next = this.modelValue || "";
932
- if (next === this._lastEmitted) return;
933
- this._lastEmitted = this._lastChanged = next;
934
- try {
935
- editor.$.html.set(next);
936
- } catch (err) {
937
- console.warn("[mono-rich-text-editor] could not set the editor content", err);
938
- }
939
- }
940
- _applyState() {
941
- const editor = this._editor;
942
- if (!editor || !this._ready) return;
943
- try {
944
- if (this.disabled) editor.$.ui.disable();
945
- else {
946
- editor.$.ui.enable();
947
- editor.$.ui.readOnly(!!this.readonly);
948
- }
949
- } catch (err) {
950
- console.warn("[mono-rich-text-editor] could not apply disabled/readonly", err);
951
- }
952
- }
953
- _applyAria() {
954
- const editor = this._editor;
955
- if (!editor || !this._ready) return;
956
- const wysiwyg = editor.$.frameContext?.get?.("wysiwyg");
957
- if (!wysiwyg) return;
958
- const label = this.ariaLabelText || this.label || this.placeholder;
959
- if (label) wysiwyg.setAttribute("aria-label", label);
960
- else wysiwyg.removeAttribute("aria-label");
961
- wysiwyg.setAttribute("aria-invalid", this._resolvedValidationState === "invalid" ? "true" : "false");
962
- if (this._shouldShowFooter) wysiwyg.setAttribute("aria-describedby", this._messageId);
963
- else wysiwyg.removeAttribute("aria-describedby");
964
- }
965
- /** The live SunEditor instance, or `null` before it loads / when the peer is missing. */
966
- get editor() {
967
- return this._editor;
968
- }
969
- /** The HTML as SunEditor serialises it (`''` when empty). */
970
- getHtml() {
971
- return this._read();
972
- }
973
- /** Replace the content. Emits `mno-change` like a user edit would. */
974
- setHtml(html) {
975
- this.modelValue = html ?? "";
976
- this._applyModelValue();
977
- }
978
- /** Insert HTML at the caret. */
979
- insertHtml(html) {
980
- this._editor?.$.html.insert(html);
981
- }
982
- /** The plain text of the content. */
983
- getText() {
984
- return (this._editor?.$.frameContext?.get?.("wysiwyg"))?.innerText ?? "";
985
- }
986
- isEmpty() {
987
- return this._read() === "";
988
- }
989
- focus() {
990
- this._editor?.$.focusManager.focus();
991
- }
992
- blur() {
993
- this._editor?.$.focusManager.blur();
994
- }
995
- /** Toggle (or set) the HTML source view. */
996
- codeView(value) {
997
- this._editor?.$.viewer.codeView(value);
998
- }
999
- /** Toggle (or set) full screen. */
1000
- fullScreen(value) {
1001
- this._editor?.$.viewer.fullScreen(value);
1002
- }
1003
- _setCssClass(value) {
1004
- if (value == null) {
1005
- this.cssClass = {};
1006
- this.cssClassName = "";
1007
- return;
1008
- }
1009
- if (typeof value === "object") {
1010
- this.cssClass = value;
1011
- return;
1012
- }
1013
- if (typeof value === "string") {
1014
- const trimmed = value.trim();
1015
- if (!trimmed) {
1016
- this.cssClass = {};
1017
- this.cssClassName = "";
1018
- return;
1019
- }
1020
- if (trimmed.startsWith("{") && trimmed.endsWith("}")) try {
1021
- this.cssClass = JSON.parse(trimmed);
1022
- return;
1023
- } catch {}
1024
- this.cssClassName = trimmed;
1025
- }
1026
- }
1027
- _toBoolean(value) {
1028
- if (typeof value === "boolean") return value;
1029
- if (typeof value === "string") {
1030
- const normalized = value.toLowerCase().trim();
1031
- return normalized === "" || normalized === "true";
1032
- }
1033
- return Boolean(value);
1034
- }
1035
- _cls(base, key) {
1036
- const extra = this.cssClass?.[key];
1037
- return extra ? `${base} ${extra}` : base;
1038
- }
1039
- get _resolvedValidationState() {
1040
- if (this.validationState && this.validationState !== "default") return this.validationState;
1041
- if (this.errorMessage) return "invalid";
1042
- if (this.successMessage) return "valid";
1043
- return "default";
1044
- }
1045
- get _wrapperClasses() {
1046
- return [
1047
- "mono-rich-text-editor",
1048
- this.size,
1049
- this.color,
1050
- this.variant,
1051
- `mode-${this.mode.replace(":", "-")}`,
1052
- this.disabled ? "disabled" : "",
1053
- this.readonly ? "readonly" : "",
1054
- this._resolvedValidationState !== "default" ? `is-${this._resolvedValidationState}` : "",
1055
- this.value ? "has-value" : "",
1056
- this._loading ? "is-loading" : "",
1057
- this._error ? "is-unavailable" : "",
1058
- this.cssClassName,
1059
- this.cssClass?.root
1060
- ].filter(Boolean).join(" ");
1061
- }
1062
- get _fieldClasses() {
1063
- return [
1064
- this._cls("mono-rich-text-editor-field", "field"),
1065
- this.size,
1066
- this.color,
1067
- this.variant
1068
- ].filter(Boolean).join(" ");
1069
- }
1070
- get _shouldShowFooter() {
1071
- return Boolean(this.validationMessage || this.errorMessage || this.successMessage || this.helperText || this._hasHelperSlotState);
1072
- }
1073
- _renderLabel() {
1074
- const hasContent = !!this.label || this._hasLabelSlotState;
1075
- if (!hasContent && !this._slotsAlwaysRender) return nothing;
1076
- return html`
1077
- <label class=${this._cls("mono-rich-text-editor-label", "label")} mono-rte-label ?mono-empty=${!hasContent} ?data-empty=${!hasContent}>
1078
- ${this._slotOutlet("label", this.label)}
1079
- ${this.required ? html`<span class=${this._cls("mono-rich-text-editor-required", "required")} mono-rte-required-mark>*</span>` : nothing}
1080
- </label>
1081
- `;
1082
- }
1083
- _renderMessage() {
1084
- const base = this._cls("mono-rich-text-editor-message", "message");
1085
- if (this.validationMessage) {
1086
- const state = this._resolvedValidationState;
1087
- return html`<div class=${`${base} ${state}`} mono-rte-message=${state} role=${state === "invalid" ? "alert" : nothing}>${this.validationMessage}</div>`;
1088
- }
1089
- if (this.errorMessage) return html`<div class=${`${base} invalid`} mono-rte-message="invalid" role="alert">${this.errorMessage}</div>`;
1090
- if (this.successMessage) return html`<div class=${`${base} valid`} mono-rte-message="valid">${this.successMessage}</div>`;
1091
- if (this.helperText || this._hasHelperSlotState || this._slotsAlwaysRender) {
1092
- const empty = !this.helperText && !this._hasHelperSlotState;
1093
- return html`
1094
- <div class=${`${base} helper`} mono-rte-message="helper" ?mono-empty=${empty} ?data-empty=${empty}>
1095
- ${this._slotOutlet("helper", this.helperText)}
1096
- </div>
1097
- `;
1098
- }
1099
- return nothing;
1100
- }
1101
- _renderFooter() {
1102
- if (!this._shouldShowFooter && !this._slotsAlwaysRender) return nothing;
1103
- return html`
1104
- <div class=${this._cls("mono-rich-text-editor-footer", "footer")} mono-rte-footer ?mono-empty=${!this._shouldShowFooter} ?data-empty=${!this._shouldShowFooter}>
1105
- <div class=${this.cssClass?.messageWrap ?? ""} mono-rte-message-wrap>${this._renderMessage()}</div>
1106
- </div>
1107
- `;
1108
- }
1109
- /**
1110
- * The peer-missing / build-failure notice. A SIBLING of the field frame, never
1111
- * inside it: the frame's children are the mount the build re-homes there, and
1112
- * a Lit child part beside a node Lit did not render would clear it on update.
1113
- */
1114
- _renderUnavailable() {
1115
- if (!this._error) return nothing;
1116
- return html`<div class="mono-rich-text-editor-unavailable" mono-rte-unavailable role="alert">${this._error}</div>`;
1117
- }
1118
- render() {
1119
- const state = this._resolvedValidationState;
1120
- return html`
1121
- <div
1122
- class=${this._wrapperClasses}
1123
- style=${styleMap(buildSizeStyle({
1124
- width: this.width,
1125
- minWidth: this.minWidth,
1126
- maxWidth: this.maxWidth
1127
- }))}
1128
- mono-rich-text-editor
1129
- mono-size=${this.size === "md" ? nothing : this.size}
1130
- mono-color=${this.color === "primary" ? nothing : this.color}
1131
- mono-variant=${this.variant === "outlined" ? nothing : this.variant}
1132
- mono-validation-state=${state === "default" ? nothing : state}
1133
- mono-mode=${this.mode === "classic" ? nothing : this.mode}
1134
- ?mono-disabled=${this.disabled}
1135
- ?mono-readonly=${this.readonly}
1136
- ?mono-required=${this.required}
1137
- ?mono-loading=${this._loading}
1138
- ?mono-unavailable=${!!this._error}
1139
- ?mono-has-value=${!!this.value}
1140
- >
1141
- ${this._renderLabel()}
1142
- ${this._renderEditorOutlet(this._fieldClasses)}
1143
- ${this._renderUnavailable()}
1144
- <div id=${this._messageId} mono-rte-message-outlet>${this._renderFooter()}</div>
1145
- </div>
1146
- `;
1147
- }
1148
- /** Whether the `label` / `helper` regions render even when empty. Light: no. Shadow: yes. */
1149
- get _slotsAlwaysRender() {
1150
- return false;
1151
- }
1152
- /** Whether slots are native `<slot>`s (shadow) rather than captured placeholders (light). */
1153
- get _useNativeSlots() {
1154
- return false;
1155
- }
1156
- _setSlotState(name, has) {
1157
- if (name === "label") this._hasLabelSlotState = has;
1158
- else this._hasHelperSlotState = has;
1159
- }
1160
- /**
1161
- * Slot outlet for `label` / `helper`. Light (default): a `data-mono-slot`
1162
- * placeholder the captured nodes are re-parented into when present, else the
1163
- * prop `fallback`. Shadow overrides with a native `<slot name>`.
1164
- */
1165
- _slotOutlet(name, fallback = nothing) {
1166
- return (name === "label" ? this._hasLabelSlotState : this._hasHelperSlotState) ? html`<span data-mono-slot=${name}></span>` : html`${fallback}`;
1167
- }
1168
- /**
1169
- * The field frame the editor mount shows in. Its children are NOT Lit's:
1170
- * light — the mount is appended by `_placeMount`; shadow — overridden to hold
1171
- * a `<slot name="editor">`. Nothing else may ever render inside it.
1172
- */
1173
- _renderEditorOutlet(fieldClass) {
1174
- return html`<div class=${fieldClass} mono-rte-field data-mono-slot="editor"></div>`;
1175
- }
1176
- }
1177
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "size", void 0);
1178
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "color", void 0);
1179
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "variant", void 0);
1180
- __decorate([property({
1181
- type: String,
1182
- attribute: "model-value"
1183
- })], MonoRichTextEditorCoreClass.prototype, "modelValue", void 0);
1184
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "value", void 0);
1185
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "name", void 0);
1186
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "placeholder", void 0);
1187
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "label", void 0);
1188
- __decorate([property({
1189
- type: String,
1190
- attribute: "helper-text"
1191
- })], MonoRichTextEditorCoreClass.prototype, "helperText", void 0);
1192
- __decorate([property({
1193
- type: String,
1194
- attribute: "validation-state"
1195
- })], MonoRichTextEditorCoreClass.prototype, "validationState", void 0);
1196
- __decorate([property({
1197
- type: String,
1198
- attribute: "validation-message"
1199
- })], MonoRichTextEditorCoreClass.prototype, "validationMessage", void 0);
1200
- __decorate([property({
1201
- type: String,
1202
- attribute: "error-message"
1203
- })], MonoRichTextEditorCoreClass.prototype, "errorMessage", void 0);
1204
- __decorate([property({
1205
- type: String,
1206
- attribute: "success-message"
1207
- })], MonoRichTextEditorCoreClass.prototype, "successMessage", void 0);
1208
- __decorate([property({
1209
- type: String,
1210
- attribute: "aria-label"
1211
- })], MonoRichTextEditorCoreClass.prototype, "ariaLabelText", void 0);
1212
- __decorate([property({
1213
- reflect: true,
1214
- converter: booleanStringConverter
1215
- })], MonoRichTextEditorCoreClass.prototype, "disabled", void 0);
1216
- __decorate([property({
1217
- reflect: true,
1218
- converter: booleanStringConverter
1219
- })], MonoRichTextEditorCoreClass.prototype, "readonly", void 0);
1220
- __decorate([property({
1221
- reflect: true,
1222
- converter: booleanStringConverter
1223
- })], MonoRichTextEditorCoreClass.prototype, "required", void 0);
1224
- __decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "cssClass", void 0);
1225
- __decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "cssClassName", void 0);
1226
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "mode", void 0);
1227
- __decorate([property({ attribute: "toolbar" })], MonoRichTextEditorCoreClass.prototype, "toolbar", void 0);
1228
- __decorate([property({ attribute: "plugins" })], MonoRichTextEditorCoreClass.prototype, "plugins", void 0);
1229
- __decorate([property({ attribute: "language" })], MonoRichTextEditorCoreClass.prototype, "language", void 0);
1230
- __decorate([property({
1231
- type: String,
1232
- attribute: "text-direction"
1233
- })], MonoRichTextEditorCoreClass.prototype, "textDirection", void 0);
1234
- __decorate([property({
1235
- attribute: "char-counter",
1236
- reflect: true,
1237
- converter: booleanStringConverter
1238
- })], MonoRichTextEditorCoreClass.prototype, "charCounter", void 0);
1239
- __decorate([property({
1240
- attribute: "max-length",
1241
- converter: optionalNumberConverter
1242
- })], MonoRichTextEditorCoreClass.prototype, "maxLength", void 0);
1243
- __decorate([property({
1244
- reflect: true,
1245
- converter: booleanStringConverter
1246
- })], MonoRichTextEditorCoreClass.prototype, "statusbar", void 0);
1247
- __decorate([property({ converter: optionalNumberConverter })], MonoRichTextEditorCoreClass.prototype, "sticky", void 0);
1248
- __decorate([property({
1249
- attribute: "load-css",
1250
- converter: booleanStringConverter
1251
- })], MonoRichTextEditorCoreClass.prototype, "loadCss", void 0);
1252
- __decorate([property({ attribute: false })], MonoRichTextEditorCoreClass.prototype, "options", void 0);
1253
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "width", void 0);
1254
- __decorate([property({ type: String })], MonoRichTextEditorCoreClass.prototype, "height", void 0);
1255
- __decorate([property({
1256
- type: String,
1257
- attribute: "min-width"
1258
- })], MonoRichTextEditorCoreClass.prototype, "minWidth", void 0);
1259
- __decorate([property({
1260
- type: String,
1261
- attribute: "max-width"
1262
- })], MonoRichTextEditorCoreClass.prototype, "maxWidth", void 0);
1263
- __decorate([property({
1264
- type: String,
1265
- attribute: "min-height"
1266
- })], MonoRichTextEditorCoreClass.prototype, "minHeight", void 0);
1267
- __decorate([property({
1268
- type: String,
1269
- attribute: "max-height"
1270
- })], MonoRichTextEditorCoreClass.prototype, "maxHeight", void 0);
1271
- __decorate([state()], MonoRichTextEditorCoreClass.prototype, "_hasLabelSlotState", void 0);
1272
- __decorate([state()], MonoRichTextEditorCoreClass.prototype, "_hasHelperSlotState", void 0);
1273
- __decorate([state()], MonoRichTextEditorCoreClass.prototype, "_error", void 0);
1274
- __decorate([state()], MonoRichTextEditorCoreClass.prototype, "_loading", void 0);
1275
- return MonoRichTextEditorCoreClass;
1276
- };
1277
-
1278
- //#endregion
1279
7
  //#region \0raw:C:\Users\VCT-DEV\Desktop\libs\packages\helper\src\components\rich-text-editor\rich-text-editor.css?raw.js
1280
8
  var rich_text_editor_css_raw_default = "/* =========================================================================\r\n mono-rich-text-editor — a mono form field whose input is a SunEditor v3\r\n instance. An EXTENSION: Basecoat has no editor, so the CHROME is the ported\r\n textarea's `.field` (basecoat-css@1.0.2, vega style) — label, frame, message\r\n — and the EDITOR is SunEditor's own DOM, styled by ITS stylesheet\r\n (`suneditor/css/editor`, loaded by the element at runtime) and themed from\r\n here by remapping its `--se-*` tokens onto the Basecoat tokens.\r\n\r\n Styled by ATTRIBUTE, like Basecoat — and the attributes mirror the element's\r\n props one for one, so hand-written markup reads like the Lit / Vue tag:\r\n\r\n <mono-rich-text-editor size=\"sm\" color=\"danger\" label=\"Body\" helper-text=\"…\">\r\n <div mono-rich-text-editor mono-size=\"sm\" mono-color=\"danger\">\r\n <label mono-rte-label>Body</label>\r\n <div mono-rte-field><div mono-rte-mount>…SunEditor…</div></div>\r\n <div mono-rte-footer><div mono-rte-message-wrap><div mono-rte-message=\"helper\">…</div></div></div>\r\n </div>\r\n\r\n An absent attribute is the prop's default (`:not([mono-size])` = md,\r\n `:not([mono-color])` = primary, `:not([mono-variant])` = outlined). The element\r\n renders these on its root (both builds) plus the STATES `mono-disabled` /\r\n `mono-readonly` / `mono-required` / `mono-loading` / `mono-unavailable` /\r\n `mono-has-value` and `mono-validation-state=\"valid|invalid|warning\"`. The\r\n old classes (`.mono-rich-text-editor.md.primary.outlined`) are still emitted\r\n as inert hooks until 2.0 but no rule here reads them.\r\n\r\n THE PARTS ARE FAMILY-UNIQUE (`mono-rte-*`): the frame holds SunEditor's whole\r\n DOM, and a consumer's content may carry anything.\r\n\r\n Selector map (ours ≡ upstream):\r\n [mono-rich-text-editor] ≡ .field (flex w-full flex-col gap-3)\r\n [mono-rich-text-editor] > [mono-rte-label] ≡ .field > label / .label\r\n [mono-rte-field] ≡ .textarea's box (rounded-md border-input bg-transparent shadow-xs,\r\n focus-within: border-ring ring-3 ring-ring/50) — the editor sits inside\r\n [mono-rte-mount] .sun-editor .se-toolbar ≡ EXTENSION (a muted band under the frame's top edge)\r\n [mono-rte-footer] > [mono-rte-message-wrap] > [mono-rte-message=\"…\"] ≡ .field > p / .field [role='alert']\r\n [mono-validation-state=\"invalid\"] ≡ aria-invalid:border-destructive aria-invalid:ring-destructive/20\r\n [mono-validation-state=\"valid|warning\"] ≡ EXTENSION (the same treatment in --success / --warning)\r\n [mono-size=\"xs|sm|lg|xl|xxl\"] ≡ EXTENSION (the textarea's font ladder; icons step with it)\r\n [mono-variant=\"filled\"] ≡ EXTENSION (luma / mira / rhea's textarea)\r\n [mono-variant=\"underlined\"] ≡ EXTENSION (sera's: the bottom edge only, no ring)\r\n [mono-rte-unavailable] ≡ EXTENSION (the peer-missing notice)\r\n .se-tooltip-text (SunEditor's) ≡ [data-tooltip]::before (bg-foreground text-background rounded-md px-3 py-1.5 text-xs)\r\n\r\n FLAVORS: the frame IS the textarea's box, so every metric resolves\r\n `--mono-rich-text-editor-<k>` → `--mono-textarea-<k>` → the base through the\r\n SAME chains textarea.css uses — a flavour that retunes the textarea retunes\r\n this frame, and no flavour file carries an editor entry. SunEditor's own\r\n popovers (dropdowns, the modal layer it parks on <body>) take the select\r\n panel's popover chain (`--mono-select-dropdown-*`), like every other popover.\r\n\r\n The editor DOM is LIGHT DOM in both builds (see `rich-text-editor-core.ts`),\r\n so the `--se-*` remap is declared on the frame and inherited by the mount —\r\n through a `<slot>` in the shadow build, which custom properties cross — and\r\n DELIVERED on `.sun-editor` from the PAGE sheet (the shadow sheet cannot reach\r\n a slotted descendant). Nothing below reaches into SunEditor's selectors except\r\n to flatten the frame it paints around itself, which the mono frame replaces.\r\n ========================================================================= */\r\n\r\nmono-rich-text-editor {\r\n display: block;\r\n}\r\n\r\n/* The token block — on the element root AND on SunEditor's carrier (the layer it\r\n parks on <body> for its dropdown lists, dialogs and alerts), which is outside\r\n every frame and can inherit nothing from it. The element's own props (`color`,\r\n `size`) cannot reach the carrier either: it takes the defaults. */\r\n[mono-rich-text-editor],\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n /* ── palette: each slot is a public knob over the textarea's, over a Basecoat token ── */\r\n --_mono-rte-text: var(--mono-rich-text-editor-text, var(--mono-textarea-text, var(--foreground)));\r\n --_mono-rte-placeholder: var(--mono-rich-text-editor-placeholder, var(--mono-textarea-placeholder, var(--muted-foreground)));\r\n --_mono-rte-muted: var(--mono-rich-text-editor-muted, var(--mono-textarea-muted, var(--muted-foreground)));\r\n --_mono-rte-primary: var(--mono-rich-text-editor-primary, var(--mono-textarea-primary, var(--ring)));\r\n --_mono-rte-secondary: var(--mono-rich-text-editor-secondary, var(--mono-textarea-secondary, var(--muted-foreground)));\r\n --_mono-rte-success: var(--mono-rich-text-editor-success, var(--mono-textarea-success, var(--success)));\r\n --_mono-rte-danger: var(--mono-rich-text-editor-danger, var(--mono-textarea-danger, var(--destructive)));\r\n --_mono-rte-warning: var(--mono-rich-text-editor-warning, var(--mono-textarea-warning, var(--warning)));\r\n --_mono-rte-info: var(--mono-rich-text-editor-info, var(--mono-textarea-info, var(--info)));\r\n --_mono-rte-teal: var(--mono-rich-text-editor-teal, var(--mono-textarea-teal, var(--teal)));\r\n --_mono-rte-purple: var(--mono-rich-text-editor-purple, var(--mono-textarea-purple, var(--purple)));\r\n --_mono-rte-neutral: var(--mono-rich-text-editor-neutral, var(--mono-textarea-neutral, var(--neutral)));\r\n --_mono-rte-dark: var(--mono-rich-text-editor-dark, var(--mono-textarea-dark, var(--dark)));\r\n --_mono-rte-valid: var(--mono-rich-text-editor-valid, var(--mono-textarea-valid, var(--success)));\r\n --_mono-rte-invalid: var(--mono-rich-text-editor-invalid, var(--mono-textarea-invalid, var(--destructive)));\r\n\r\n /* ── the painted result — three tiers, base = vega's .textarea ─────────── */\r\n --_mono-rte-ring-color: var(--mono-rich-text-editor-ring-color, var(--mono-rich-text-editor-focus-color, var(--_mono-rte-ring-color-preset, var(--_mono-rte-primary))));\r\n --_mono-rte-ring-width: var(--mono-rich-text-editor-ring-width, var(--mono-textarea-ring-width, var(--_mono-rte-ring-width-preset, var(--mono-ring-width))));\r\n --_mono-rte-ring-alpha: var(--mono-rich-text-editor-ring-alpha, var(--mono-textarea-ring-alpha, var(--mono-ring-alpha)));\r\n --_mono-rte-border-color: var(--mono-rich-text-editor-rest-border, var(--mono-rich-text-editor-border-color, var(--mono-rich-text-editor-border, var(--mono-textarea-rest-border, var(--mono-textarea-border-color, var(--_mono-rte-border-color-preset, var(--input)))))));\r\n --_mono-rte-side-border-color: var(--_mono-rte-side-border-color-preset, var(--_mono-rte-border-color));\r\n --_mono-rte-bg: var(--mono-rich-text-editor-bg, var(--mono-rich-text-editor-surface, var(--mono-textarea-bg, var(--mono-textarea-surface, var(--_mono-rte-bg-preset, var(--mono-mode-surface))))));\r\n --_mono-rte-shadow: var(--mono-rich-text-editor-shadow, var(--mono-textarea-shadow, var(--_mono-rte-shadow-preset, var(--mono-shadow-xs))));\r\n --_mono-rte-border-width: var(--mono-rich-text-editor-border-width, var(--mono-textarea-border-width, var(--mono-border-width)));\r\n --_mono-rte-radius: var(--mono-rich-text-editor-radius, var(--mono-textarea-radius, var(--_mono-rte-radius-preset, var(--mono-radius-md))));\r\n\r\n /* ── md metrics live on the unqualified root ON PURPOSE: hand-written\r\n `<div mono-rich-text-editor>` that names no size renders like size=\"md\" ── */\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-md, var(--mono-textarea-font-md, var(--mono-text-sm))));\r\n --_mono-rte-icon-size: var(--mono-rich-text-editor-icon-size, var(--_mono-rte-icon-size-preset, 18px));\r\n --_mono-rte-font-family: var(--mono-rich-text-editor-font-family, inherit);\r\n --_mono-rte-min-height: var(--mono-rich-text-editor-min-height, 10rem);\r\n /* EXTENSION — the toolbar band: a muted wash under the frame's top edge */\r\n --_mono-rte-toolbar-bg: var(--mono-rich-text-editor-toolbar-bg, color-mix(in oklab, var(--muted) 60%, var(--_mono-rte-bg)));\r\n\r\n /* ── SunEditor's popovers (dropdowns, dialogs) are the select panel's popover ── */\r\n --_mono-rte-popover-bg: var(--mono-rich-text-editor-popover-bg, var(--mono-select-dropdown-bg, var(--popover)));\r\n --_mono-rte-popover-color: var(--mono-rich-text-editor-popover-color, var(--mono-select-dropdown-color, var(--popover-foreground)));\r\n --_mono-rte-popover-radius: var(--mono-rich-text-editor-popover-radius, var(--mono-select-dropdown-radius, var(--mono-radius-md)));\r\n --_mono-rte-popover-shadow: var(--mono-rich-text-editor-popover-shadow, var(--mono-select-dropdown-shadow, var(--mono-shadow-md)));\r\n\r\n /* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background rounded-md px-3 py-1.5 text-xs\r\n SunEditor's toolbar tooltips; the corner is the style's shared tooltip token */\r\n --_mono-rte-tooltip-bg: var(--mono-rich-text-editor-tooltip-bg, var(--mono-tooltip-bg, var(--foreground)));\r\n --_mono-rte-tooltip-color: var(--mono-rich-text-editor-tooltip-color, var(--mono-tooltip-color, var(--background)));\r\n --_mono-rte-tooltip-radius: var(--mono-rich-text-editor-tooltip-radius, var(--mono-tooltip-radius, var(--mono-radius-md)));\r\n\r\n /* ── SunEditor's tokens, remapped onto the theme ─────────────────────────\r\n Declared on the FRAME'S ancestor so the light-DOM mount inherits them in\r\n both builds. `.sun-editor` re-declares every one of these on itself with\r\n its defaults, so each is delivered again on `.sun-editor` below — this\r\n block is what a consumer sees and overrides; that one is the delivery. */\r\n --_se-main-color: var(--_mono-rte-text);\r\n --_se-main-color-lighter: var(--_mono-rte-muted);\r\n --_se-main-background: var(--_mono-rte-bg);\r\n --_se-main-border: var(--border);\r\n --_se-main-divider: var(--border);\r\n --_se-main-outline: var(--_mono-rte-ring-color);\r\n /* the accent: links and the focus outline */\r\n --_se-active: var(--_mono-rte-ring-color);\r\n --_se-active-dark: color-mix(in oklab, var(--_mono-rte-ring-color) 85%, var(--foreground));\r\n /* basecoat@1.0.2 styles/vega.css .btn[data-variant='ghost'] — hover:bg-accent hover:text-accent-foreground\r\n a pressed toolbar button and a checked list item are the toggle-on state:\r\n the accent WASH with the foreground ink, never a primary tint */\r\n --_se-active-ink: var(--mono-rich-text-editor-active-color, var(--accent-foreground, var(--_mono-rte-text)));\r\n --_se-active-light: var(--mono-rich-text-editor-active-bg, var(--accent, var(--muted)));\r\n --_se-active-light2: var(--mono-mode-surface-hover);\r\n --_se-hover: var(--_mono-rte-text);\r\n --_se-hover-light: var(--mono-mode-ghost-hover);\r\n --_se-hover-light2: var(--mono-mode-surface-hover);\r\n --_se-error: var(--_mono-rte-danger);\r\n --_se-success: var(--_mono-rte-success);\r\n --_se-placeholder: var(--_mono-rte-placeholder);\r\n --_se-radius: var(--mono-radius-sm);\r\n --_se-radius-lg: var(--_mono-rte-popover-radius);\r\n --_se-shadow-layer: var(--_mono-rte-popover-shadow);\r\n --_se-font-family: var(--_mono-rte-font-family);\r\n --_se-font-size: var(--_mono-rte-font-size);\r\n --_se-icon-size: var(--_mono-rte-icon-size);\r\n --_se-min-height: var(--_mono-rte-min-height);\r\n\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field — flex w-full flex-col gap-3 */\r\n[mono-rich-text-editor] {\r\n display: flex;\r\n flex-direction: column;\r\n gap: var(--mono-rich-text-editor-gap, var(--mono-textarea-gap, calc(var(--mono-spacing) * 3)));\r\n width: 100%;\r\n min-width: 0;\r\n color: var(--_mono-rte-text);\r\n font-family: inherit;\r\n}\r\n\r\n[mono-rich-text-editor],\r\n:where([mono-rich-text-editor]) > *,\r\n:where([mono-rich-text-editor]) > * > *::before,\r\n:where([mono-rich-text-editor]) > * > *::after {\r\n box-sizing: border-box;\r\n}\r\n\r\n/* the shadow build renders every region and marks the empty ones; the light\r\n build renders only what exists */\r\n[mono-rich-text-editor] :is([mono-rte-label], [mono-rte-message], [mono-rte-footer])[mono-empty] {\r\n display: none;\r\n}\r\n\r\n[mono-rich-text-editor] > [mono-rte-message-outlet]:not(:has([mono-rte-footer]:not([mono-empty]))) {\r\n display: none;\r\n}\r\n\r\n/* =========================================\r\n Sizes — EXTENSION: the textarea's font ladder; the icons step with it\r\n ========================================= */\r\n\r\n[mono-rich-text-editor][mono-size=\"xs\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xs, var(--mono-textarea-font-xs, var(--mono-text-xs))));\r\n --_mono-rte-icon-size-preset: 14px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"sm\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-sm, var(--mono-textarea-font-sm, var(--mono-textarea-font-md, var(--mono-text-sm)))));\r\n --_mono-rte-icon-size-preset: 16px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"lg\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-lg, var(--mono-textarea-font-lg, var(--mono-textarea-font-md, var(--mono-text-sm)))));\r\n --_mono-rte-icon-size-preset: 20px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"xl\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xl, var(--mono-textarea-font-xl, var(--mono-text-base))));\r\n --_mono-rte-icon-size-preset: 22px;\r\n}\r\n[mono-rich-text-editor][mono-size=\"xxl\"] {\r\n --_mono-rte-font-size: var(--mono-rich-text-editor-font-size, var(--mono-rich-text-editor-font-xxl, var(--mono-textarea-font-xxl, var(--mono-text-base))));\r\n --_mono-rte-icon-size-preset: 24px;\r\n}\r\n\r\n/* =========================================\r\n Colours — EXTENSION: the `color` prop is the FOCUS colour, which is also the\r\n editor's active state and links\r\n ========================================= */\r\n\r\n[mono-rich-text-editor][mono-color=\"secondary\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-secondary);\r\n}\r\n[mono-rich-text-editor][mono-color=\"success\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-success);\r\n}\r\n[mono-rich-text-editor][mono-color=\"danger\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-danger);\r\n}\r\n[mono-rich-text-editor][mono-color=\"warning\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-warning);\r\n}\r\n[mono-rich-text-editor][mono-color=\"info\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-info);\r\n}\r\n[mono-rich-text-editor][mono-color=\"teal\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-teal);\r\n}\r\n[mono-rich-text-editor][mono-color=\"purple\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-purple);\r\n}\r\n[mono-rich-text-editor][mono-color=\"neutral\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-neutral);\r\n}\r\n[mono-rich-text-editor][mono-color=\"dark\"] {\r\n --_mono-rte-ring-color-preset: var(--_mono-rte-dark);\r\n}\r\n\r\n/* =========================================\r\n Label\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > label, .label\r\n — text-sm leading-snug font-medium */\r\n:where([mono-rich-text-editor]) > [mono-rte-label] {\r\n display: flex;\r\n align-items: center;\r\n gap: calc(var(--mono-spacing) * 1);\r\n font-size: var(--mono-rich-text-editor-label-font-size, var(--mono-textarea-label-font-size, var(--mono-text-sm)));\r\n line-height: var(--mono-rich-text-editor-label-line-height, var(--mono-textarea-label-line-height, var(--mono-leading-snug)));\r\n font-weight: var(--mono-rich-text-editor-label-font-weight, var(--mono-textarea-label-font-weight, var(--mono-label-font-weight, var(--mono-font-weight-medium))));\r\n color: var(--mono-rich-text-editor-label-color, var(--mono-textarea-label-color, var(--_mono-rte-text)));\r\n}\r\n\r\n[mono-rich-text-editor][mono-validation-state=\"invalid\"] > [mono-rte-label] {\r\n color: var(--mono-rich-text-editor-label-color, var(--mono-textarea-label-color, var(--_mono-rte-invalid)));\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-required-mark] {\r\n color: var(--mono-rich-text-editor-required-color, var(--mono-textarea-required-color, var(--destructive)));\r\n}\r\n\r\n[mono-rich-text-editor][mono-disabled] > [mono-rte-label] {\r\n opacity: 0.5;\r\n}\r\n\r\n/* =========================================\r\n The frame — the textarea's box, holding the editor\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > textarea, .textarea\r\n — rounded-md border border-input bg-transparent shadow-xs\r\n transition-[color,box-shadow] (dark:bg-input/30 via --mono-mode-surface);\r\n mono: no padding — the editor's toolbar and page fill the box edge to edge */\r\n:where([mono-rich-text-editor]) [mono-rte-field] {\r\n --_mono-rte-ring: 0 0 #0000;\r\n position: relative;\r\n width: 100%;\r\n min-width: 0;\r\n border: var(--_mono-rte-border-width) solid var(--_mono-rte-side-border-color);\r\n border-bottom-color: var(--_mono-rte-border-color);\r\n border-radius: var(--_mono-rte-radius);\r\n background-color: var(--_mono-rte-bg);\r\n color: var(--_mono-rte-text);\r\n box-shadow: var(--_mono-rte-ring), var(--_mono-rte-shadow);\r\n /* the editor paints its own corners; clip so the toolbar's top corners follow\r\n the frame's radius */\r\n overflow: hidden;\r\n transition-property: color, background-color, border-color, box-shadow, opacity;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n\r\n/* Before the editor loads (and on the server) the frame is a quiet box the\r\n size of the editing area, so the form does not jump when it lands. */\r\n[mono-rich-text-editor][mono-loading] [mono-rte-field] {\r\n min-height: calc(var(--_mono-rte-min-height) + 2.75rem);\r\n}\r\n[mono-rich-text-editor][mono-unavailable] [mono-rte-field] {\r\n display: none;\r\n}\r\n\r\n/* focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 —\r\n the focus is on SunEditor's contenteditable inside the frame */\r\n:where([mono-rich-text-editor]) [mono-rte-field]:focus-within {\r\n border-color: var(--_mono-rte-side-border-color);\r\n border-bottom-color: var(--_mono-rte-ring-color);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-ring-color) var(--_mono-rte-ring-alpha), transparent);\r\n}\r\n[mono-rich-text-editor]:is(:not([mono-variant]), [mono-variant=\"outlined\"], [mono-variant=\"filled\"]) [mono-rte-field]:focus-within {\r\n border-color: var(--_mono-rte-ring-color);\r\n}\r\n\r\n/* aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20\r\n (dark: /50 and /40, carried by the mode tokens) */\r\n[mono-rich-text-editor][mono-validation-state=\"invalid\"] [mono-rte-field] {\r\n --_mono-rte-border-color: var(--mono-mode-invalid-border);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) var(--mono-mode-invalid-ring);\r\n}\r\n\r\n/* EXTENSION — the same treatment in the success / warning roles */\r\n[mono-rich-text-editor][mono-validation-state=\"valid\"] [mono-rte-field] {\r\n --_mono-rte-border-color: color-mix(in oklab, var(--_mono-rte-valid) var(--mono-mode-state-border-alpha), transparent);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-valid) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n[mono-rich-text-editor][mono-validation-state=\"warning\"] [mono-rte-field] {\r\n --_mono-rte-border-color: color-mix(in oklab, var(--_mono-rte-warning) var(--mono-mode-state-border-alpha), transparent);\r\n --_mono-rte-ring: 0 0 0 var(--_mono-rte-ring-width) color-mix(in oklab, var(--_mono-rte-warning) var(--mono-mode-state-ring-alpha), transparent);\r\n}\r\n\r\n/* disabled:cursor-not-allowed disabled:opacity-50 */\r\n[mono-rich-text-editor][mono-disabled] [mono-rte-field] {\r\n opacity: 0.5;\r\n cursor: not-allowed;\r\n background-color: var(--mono-rich-text-editor-disabled-bg, var(--mono-textarea-disabled-bg, var(--_mono-rte-bg)));\r\n}\r\n\r\n/* EXTENSION — readonly is legible, not dimmed: a muted surface */\r\n[mono-rich-text-editor][mono-readonly]:not([mono-disabled]) [mono-rte-field] {\r\n --_se-main-background: var(--mono-rich-text-editor-readonly-bg, var(--mono-textarea-readonly-bg, var(--muted)));\r\n background-color: var(--mono-rich-text-editor-readonly-bg, var(--mono-textarea-readonly-bg, var(--muted)));\r\n}\r\n\r\n/* =========================================\r\n Variants — EXTENSION: the two other looks Basecoat's styles ship, through\r\n the textarea's own knobs so a flavour that restyles the textarea restyles this\r\n ========================================= */\r\n\r\n[mono-rich-text-editor]:is(:not([mono-variant]), [mono-variant=\"outlined\"]) {\r\n --_mono-rte-bg-preset: var(--mono-rich-text-editor-outline-bg, var(--mono-textarea-outline-bg));\r\n --_mono-rte-border-color-preset: var(--mono-rich-text-editor-outline-border-color, var(--mono-textarea-outline-border-color));\r\n --_mono-rte-side-border-color-preset: var(--mono-rich-text-editor-outline-side-border-color, var(--mono-textarea-outline-side-border-color));\r\n --_mono-rte-shadow-preset: var(--mono-rich-text-editor-outline-shadow, var(--mono-textarea-outline-shadow, var(--mono-shadow-xs)));\r\n --_mono-rte-radius-preset: var(--mono-rich-text-editor-outline-radius, var(--mono-textarea-outline-radius));\r\n --_mono-rte-ring-width-preset: var(--mono-rich-text-editor-outline-ring-width, var(--mono-textarea-outline-ring-width));\r\n}\r\n\r\n/* `filled` ≡ luma / mira / rhea's textarea: a tinted surface, no border, no shadow */\r\n[mono-rich-text-editor][mono-variant=\"filled\"] {\r\n --_mono-rte-bg-preset: var(--mono-rich-text-editor-filled-bg, var(--mono-textarea-filled-bg, color-mix(in oklab, var(--input) 50%, transparent)));\r\n --_mono-rte-border-color-preset: transparent;\r\n --_mono-rte-shadow-preset: 0 0 #0000;\r\n}\r\n\r\n/* `underlined` ≡ sera's: square, the bottom edge only, and no ring */\r\n[mono-rich-text-editor][mono-variant=\"underlined\"] {\r\n --_mono-rte-radius-preset: 0;\r\n --_mono-rte-bg-preset: transparent;\r\n --_mono-rte-side-border-color-preset: transparent;\r\n --_mono-rte-shadow-preset: 0 0 #0000;\r\n --_mono-rte-ring-width-preset: 0px;\r\n}\r\n[mono-rich-text-editor][mono-variant=\"underlined\"] [mono-rte-field] {\r\n --_se-main-background: transparent;\r\n --_mono-rte-toolbar-bg: transparent;\r\n}\r\n\r\n/* =========================================\r\n Footer — the message row\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .fieldset legend + p, .field > p, .field section > p\r\n — text-sm text-muted-foreground leading-normal font-normal */\r\n:where([mono-rich-text-editor]) [mono-rte-footer] {\r\n display: flex;\r\n align-items: flex-start;\r\n justify-content: space-between;\r\n gap: calc(var(--mono-spacing) * 2);\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-message-wrap] {\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n}\r\n\r\n:where([mono-rich-text-editor]) [mono-rte-message] {\r\n font-size: var(--mono-rich-text-editor-message-font-size, var(--mono-textarea-message-font-size, var(--mono-text-sm)));\r\n line-height: var(--mono-rich-text-editor-message-line-height, var(--mono-textarea-message-line-height, var(--mono-leading-normal)));\r\n font-weight: var(--mono-font-weight-normal);\r\n color: var(--_mono-rte-muted);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field [role=\"alert\"] — text-destructive text-sm */\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"invalid\"] {\r\n color: var(--_mono-rte-invalid);\r\n}\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"valid\"] {\r\n color: var(--_mono-rte-valid);\r\n}\r\n:where([mono-rich-text-editor]) [mono-rte-message=\"warning\"] {\r\n color: var(--_mono-rte-warning);\r\n}\r\n\r\n/* EXTENSION — the peer-missing notice: reads like a validation message, never like a crash */\r\n:where([mono-rich-text-editor]) [mono-rte-unavailable] {\r\n padding: calc(var(--mono-spacing) * 2.5) calc(var(--mono-spacing) * 3);\r\n border: var(--mono-border-width) dashed var(--_mono-rte-danger);\r\n border-radius: var(--_mono-rte-radius);\r\n background: color-mix(in oklab, var(--_mono-rte-danger) var(--mono-mode-tint), transparent);\r\n color: var(--_mono-rte-danger);\r\n font-size: var(--mono-text-sm);\r\n line-height: var(--mono-leading-normal);\r\n overflow-wrap: anywhere;\r\n}\r\n\r\n/* =========================================\r\n SunEditor inside the frame — from the PAGE sheet (the mount is light DOM)\r\n ========================================= */\r\n\r\n[mono-rte-mount] {\r\n display: block;\r\n width: 100%;\r\n min-width: 0;\r\n}\r\n\r\n/* Deliver the remap. `.sun-editor` sets every `--se-*` on itself from\r\n SunEditor's sheet, so the same selector (plus ours for specificity) has to\r\n set them again — the values, though, come from the frame's `--_se-*` above,\r\n which the mount inherits. Only the tokens a theme is made of; the rest keep\r\n SunEditor's defaults. */\r\n[mono-rte-mount] .sun-editor,\r\n[mono-rte-mount] .sun-editor-editable,\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n --se-main-font-family: var(--_se-font-family);\r\n --se-content-font-family: var(--_se-font-family);\r\n --se-main-font-size: var(--_se-font-size);\r\n --se-btn-font-size: var(--_se-font-size);\r\n --se-edit-font-size: calc(var(--_se-font-size) * 1.1);\r\n --se-icon-size: var(--_se-icon-size);\r\n --se-min-height: var(--_se-min-height);\r\n --se-border-radius: var(--_se-radius);\r\n --se-border-radius-lg: var(--_se-radius-lg);\r\n\r\n --se-main-color: var(--_se-main-color);\r\n --se-main-color-lighter: var(--_se-main-color-lighter);\r\n --se-main-font-color: var(--_se-main-color);\r\n --se-main-background-color: var(--_se-main-background);\r\n --se-main-border-color: var(--_se-main-border);\r\n --se-main-divider-color: var(--_se-main-divider);\r\n --se-main-outline-color: var(--_se-main-outline);\r\n --se-main-shadow-color: var(--_se-main-divider);\r\n --se-statusbar-font-color: var(--_se-main-color-lighter);\r\n --se-dropdown-font-color: var(--_se-main-color);\r\n\r\n --se-edit-font-color: var(--_se-main-color);\r\n --se-edit-background-color: var(--_se-main-background);\r\n --se-edit-anchor: var(--_se-active);\r\n --se-caret-color: var(--_se-main-color);\r\n --se-placeholder-color: var(--_se-placeholder);\r\n\r\n --se-hover-color: var(--_se-hover);\r\n --se-hover-dark-color: var(--_se-main-border);\r\n --se-hover-light-color: var(--_se-hover-light);\r\n --se-hover-light2-color: var(--_se-hover-light2);\r\n --se-hover-light3-color: var(--_se-hover-light2);\r\n\r\n /* the accent for outlines and links; the toggle-on state for buttons and\r\n checked list items (ink = --se-active-dark3/4, wash = --se-active-light*) */\r\n --se-active-color: var(--_se-active);\r\n --se-active-hover-color: var(--_se-active-ink);\r\n --se-active-dark-color: var(--_se-main-border);\r\n --se-active-dark2-color: var(--_se-active-dark);\r\n --se-active-dark3-color: var(--_se-active-ink);\r\n --se-active-dark4-color: var(--_se-main-border);\r\n --se-active-dark5-color: var(--_se-active-dark);\r\n --se-active-light-color: var(--_se-active-light);\r\n --se-active-light2-color: var(--_se-active-light);\r\n --se-active-light3-color: var(--_se-active-light2);\r\n --se-active-light4-color: var(--_se-active-light);\r\n --se-active-light5-color: var(--_se-active-light2);\r\n --se-active-light6-color: var(--_se-active-light2);\r\n\r\n --se-error-color: var(--_se-error);\r\n --se-success-color: var(--_se-success);\r\n\r\n --se-select-menu-hover-bg: var(--_se-hover-light);\r\n --se-select-menu-active-bg: var(--_se-active-light);\r\n --se-modal-background-color: var(--_mono-rte-popover-bg);\r\n --se-modal-color: var(--_mono-rte-popover-color);\r\n --se-modal-border-color: var(--_se-main-border);\r\n --se-modal-anchor-color: var(--_se-active);\r\n --se-shadow-layer: var(--_se-shadow-layer);\r\n\r\n /* ── the sub-surfaces SunEditor paints from its own light palette ────────\r\n code view, the table picker, the floating controllers, the modal chrome,\r\n the overlay, the editing area's own colours — every one a page token now */\r\n --se-codeview-font-family: var(--font-mono, ui-monospace, monospace);\r\n --se-markdown-font-family: var(--font-mono, ui-monospace, monospace);\r\n --se-code-view-color: var(--_mono-rte-text);\r\n --se-code-view-background-color: var(--_se-main-background);\r\n --se-code-view-line-color: var(--_mono-rte-muted);\r\n --se-code-view-line-background-color: var(--muted);\r\n --se-markdown-view-color: var(--_mono-rte-text);\r\n --se-markdown-view-background-color: var(--_se-main-background);\r\n --se-markdown-view-line-color: var(--_mono-rte-muted);\r\n --se-markdown-view-line-background-color: var(--muted);\r\n\r\n --se-table-picker-color: var(--_mono-rte-popover-bg);\r\n --se-table-picker-border-color: var(--_se-main-border);\r\n --se-table-picker-highlight-color: color-mix(in oklab, var(--_se-active) var(--mono-mode-tint), var(--_mono-rte-popover-bg));\r\n --se-table-picker-highlight-border-color: var(--_se-active);\r\n\r\n --se-controller-background-color: var(--_mono-rte-popover-bg);\r\n --se-controller-color: var(--_mono-rte-popover-color);\r\n --se-controller-border-color: var(--_se-main-border);\r\n --se-shadow-controller: var(--_se-shadow-layer);\r\n --se-shadow-controller-color: transparent;\r\n --se-shadow-layer-color: transparent;\r\n --se-overlay-background-color: var(--mono-mode-backdrop, #000);\r\n\r\n --se-modal-preview-color: var(--_mono-rte-muted);\r\n --se-modal-file-input-background-color: var(--muted);\r\n --se-modal-input-disabled-color: var(--_mono-rte-muted);\r\n --se-modal-input-disabled-background-color: var(--muted);\r\n --se-input-btn-border-color: var(--_se-main-border);\r\n --se-input-btn-disabled-color: var(--_mono-rte-muted);\r\n --se-main-out-color: var(--_se-main-border);\r\n --se-hover-dark2-color: var(--_se-main-border);\r\n --se-hover-dark3-color: var(--_se-main-border);\r\n --se-loading-color: var(--_se-active);\r\n\r\n --se-drag-caret-color: var(--_se-active);\r\n --se-edit-active: var(--_se-active);\r\n --se-edit-hover: var(--_se-active-light);\r\n --se-edit-outline: var(--_se-main-border);\r\n --se-edit-font-pre: var(--_mono-rte-text);\r\n --se-edit-font-quote: var(--_mono-rte-muted);\r\n --se-edit-background-pre: var(--muted);\r\n --se-edit-border-light: var(--_se-main-border);\r\n --se-edit-border-dark: var(--_se-main-border);\r\n --se-edit-border-dark-n1: var(--_se-main-border);\r\n --se-edit-border-dark-n2: var(--_se-main-border);\r\n --se-edit-border-table: var(--_se-main-border);\r\n --se-edit-hr-color: var(--_se-main-border);\r\n --se-edit-hr-on-back: var(--_se-active-light);\r\n --se-edit-anchor-on-back: color-mix(in oklab, var(--_se-active) var(--mono-mode-tint), transparent);\r\n --se-edit-anchor-on-font: var(--_se-active);\r\n\r\n --se-success-dark-color: var(--_se-success);\r\n --se-success-dark2-color: var(--_se-success);\r\n --se-success-dark3-color: var(--_se-success);\r\n --se-success-light-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint), transparent);\r\n --se-success-light2-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint), transparent);\r\n --se-success-light3-color: color-mix(in oklab, var(--_se-success) var(--mono-mode-tint-hover), transparent);\r\n --se-success-light4-color: var(--_se-success);\r\n --se-success-light5-color: var(--_se-success);\r\n --se-error-dark-color: var(--_se-error);\r\n --se-error-dark2-color: var(--_se-error);\r\n --se-error-dark3-color: var(--_se-error);\r\n --se-error-light-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint-hover), transparent);\r\n --se-error-light2-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light3-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light4-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n --se-error-light5-color: color-mix(in oklab, var(--_se-error) var(--mono-mode-tint), transparent);\r\n}\r\n\r\n/* In the carrier \"main background\" is the LAYER surface — the dropdown lists,\r\n dialogs and alerts — so it is the popover surface there, not the editing\r\n surface (which is transparent in light mode: an invisible list). */\r\n.sun-editor.sun-editor-carrier-wrapper {\r\n --se-main-background-color: var(--_mono-rte-popover-bg);\r\n --se-main-font-color: var(--_mono-rte-popover-color);\r\n --se-dropdown-font-color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .select:not(select) [role='option'].active, .select:not(select) [role='option']:focus-visible — bg-muted text-foreground\r\n a checked list item (the current font, size, format …) is a selected option:\r\n SunEditor only re-inks it, and its ink was the primary tint */\r\n[mono-rte-mount] .sun-editor .se-list-inner li.se-checked > button,\r\n.sun-editor.sun-editor-carrier-wrapper .se-list-inner li.se-checked > button {\r\n background-color: var(--_se-active-light);\r\n color: var(--_se-active-ink);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .field > textarea, .textarea — placeholder:text-muted-foreground\r\n Every placeholder the editor shows — the Size / Font inputs in the toolbar,\r\n the empty editing area, a dialog's fields — is the field placeholder: the\r\n muted ink, OPAQUE. Left alone, a host page's preflight (Tailwind / UnoCSS)\r\n makes a placeholder 50% translucent currentColor, which over a tinted page\r\n reads as a colour of its own; and SunEditor inks its empty-area placeholder\r\n with its OUTLINE token, the accent. */\r\n[mono-rte-mount] .sun-editor input::placeholder,\r\n[mono-rte-mount] .sun-editor textarea::placeholder,\r\n.sun-editor.sun-editor-carrier-wrapper input::placeholder,\r\n.sun-editor.sun-editor-carrier-wrapper textarea::placeholder {\r\n color: var(--_mono-rte-placeholder);\r\n opacity: 1;\r\n}\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-placeholder,\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-placeholder-line:before {\r\n color: var(--_mono-rte-placeholder);\r\n}\r\n\r\n/* The frame replaces SunEditor's own — no double border, no second radius. */\r\n[mono-rte-mount] .sun-editor {\r\n border: 0;\r\n border-radius: 0;\r\n background: transparent;\r\n width: 100% !important;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs\r\n SunEditor's toolbar tooltips, painted as Basecoat's tooltip: it drew them in\r\n `--se-main-font-color` on `--se-main-background-color`, which in dark mode\r\n is a translucent wash under near-white text. (0,5,0) over SunEditor's (0,4,0). */\r\n[mono-rte-mount] .sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text,\r\n.sun-editor.sun-editor-carrier-wrapper .se-tooltip .se-tooltip-inner .se-tooltip-text {\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n border-radius: var(--_mono-rte-tooltip-radius);\r\n background-color: var(--_mono-rte-tooltip-bg);\r\n color: var(--_mono-rte-tooltip-color);\r\n /* the page font, handed over by the element: a tooltip inside the font list\r\n would otherwise inherit the item's own face */\r\n font-family: var(--_mono-rte-page-font, inherit);\r\n font-size: var(--mono-text-xs);\r\n line-height: var(--mono-text-xs--lh);\r\n font-weight: var(--mono-font-weight-normal);\r\n white-space: nowrap;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — the dropdown items (font family,\r\n font size, the colour palettes …) carried native `title` tooltips, which no theme can\r\n paint; the element rewrites them into `data-tooltip`, drawn here the way Basecoat\r\n draws its own: a pseudo-element with the attribute as content, above the item\r\n (the anchor is `position: relative`, as in Basecoat's compiled `[data-tooltip]`) */\r\n[mono-rte-mount] .sun-editor [data-tooltip],\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip] {\r\n position: relative;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip]::before — bg-foreground text-background inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs */\r\n[mono-rte-mount] .sun-editor [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]::after {\r\n content: attr(data-tooltip);\r\n position: absolute;\r\n left: 50%;\r\n bottom: calc(100% + calc(var(--mono-spacing) * 1.5));\r\n z-index: 60;\r\n width: max-content;\r\n max-width: 20rem;\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n border-radius: var(--_mono-rte-tooltip-radius);\r\n background-color: var(--_mono-rte-tooltip-bg);\r\n color: var(--_mono-rte-tooltip-color);\r\n font-family: var(--_mono-rte-page-font, inherit);\r\n font-size: var(--mono-text-xs);\r\n line-height: var(--mono-text-xs--lh);\r\n font-weight: var(--mono-font-weight-normal);\r\n font-style: normal;\r\n text-indent: 0;\r\n text-transform: none;\r\n letter-spacing: normal;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n pointer-events: none;\r\n visibility: hidden;\r\n opacity: 0;\r\n transform: translateX(-50%) scale(0.95);\r\n transform-origin: bottom center;\r\n transition-property: opacity, transform, visibility;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration-fast, 100ms);\r\n}\r\n\r\n[mono-rte-mount] .sun-editor [data-tooltip]:hover::after,\r\n[mono-rte-mount] .sun-editor [data-tooltip]:focus-visible::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]:hover::after,\r\n.sun-editor.sun-editor-carrier-wrapper [data-tooltip]:focus-visible::after {\r\n visibility: visible;\r\n opacity: 1;\r\n transform: translateX(-50%) scale(1);\r\n}\r\n\r\n/* a dropdown layer clips its own overflow, so a tooltip above the FIRST row of a\r\n palette would be cut off at the layer edge: that row opens its tooltips below */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet:first-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet:first-child [data-tooltip]::after {\r\n bottom: auto;\r\n top: calc(100% + calc(var(--mono-spacing) * 1.5));\r\n transform-origin: top center;\r\n}\r\n\r\n/* SunEditor shrinks a hovered / active swatch with `transform: scale(.8)`. A\r\n transform makes the button a stacking context, so its tooltip — a child —\r\n can never rise above the swatches painted after it (the next row covers a\r\n first-row tooltip) and shrinks with it. The same \"pressed\" read as an inset\r\n ring of the layer surface instead; the hovered swatch lifts above its row. */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button:hover,\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button.active,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button:hover,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button.active {\r\n transform: none;\r\n box-shadow: inset 0 0 0 3px var(--_mono-rte-popover-bg, var(--popover));\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet button:hover,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet button:hover {\r\n z-index: 1;\r\n}\r\n\r\n/* …and the same clip sideways: a centred tooltip on the first / last column of\r\n a palette row runs past the layer's edge, so those hang from the item's own\r\n outer edge instead */\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:first-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:first-child [data-tooltip]::after {\r\n left: 0;\r\n transform: scale(0.95);\r\n transform-origin: left center;\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:last-child [data-tooltip]::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:last-child [data-tooltip]::after {\r\n left: auto;\r\n right: 0;\r\n transform: scale(0.95);\r\n transform-origin: right center;\r\n}\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:hover::after,\r\n[mono-rte-mount] .sun-editor .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:focus-visible::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:hover::after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-dropdown .se-color-pallet li:is(:first-child, :last-child) [data-tooltip]:focus-visible::after {\r\n transform: scale(1);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css [data-tooltip][data-arrow]::after — bg-foreground */\r\n[mono-rte-mount] .sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after,\r\n.sun-editor.sun-editor-carrier-wrapper .se-tooltip .se-tooltip-inner .se-tooltip-text:after {\r\n border-color: transparent transparent var(--_mono-rte-tooltip-bg) transparent;\r\n}\r\n[mono-rte-mount] .sun-editor .se-toolbar.se-toolbar-bottom .se-tooltip .se-tooltip-inner .se-tooltip-text:after {\r\n border-color: var(--_mono-rte-tooltip-bg) transparent transparent transparent;\r\n}\r\n\r\n/* EXTENSION — the toolbar band, on a hairline */\r\n[mono-rte-mount] .sun-editor .se-toolbar {\r\n background: var(--_mono-rte-toolbar-bg);\r\n box-shadow: inset 0 calc(var(--mono-border-width) * -1) 0 0 var(--border);\r\n}\r\n\r\n/* The carrier — modals, alerts and the dropdown lists SunEditor parks on <body>\r\n — is in the token block and the delivery rule above: it paints exactly like\r\n the frame it belongs to, at the element's default `color` and `size`. */\r\n\r\n/* =========================================\r\n SunEditor's dialogs — the modal SunEditor parks in its carrier: its chrome\r\n is the page's dialog, its fields the ported input, its buttons the ported\r\n button, its tabs the ported tabs. Selectors mirror SunEditor's own chains\r\n (prefixed by the scope) so they out-weigh them by exactly the scope.\r\n ========================================= */\r\n\r\n/* basecoat@1.0.2 styles/vega.css .dialog > * — bg-popover text-popover-foreground */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-content {\r\n border: var(--mono-border-width) solid var(--_se-main-border);\r\n border-radius: var(--_mono-rte-popover-radius);\r\n box-shadow: var(--_mono-rte-popover-shadow);\r\n color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-header .se-modal-title {\r\n font-size: var(--mono-text-base);\r\n font-weight: var(--mono-font-weight-semibold);\r\n color: var(--_mono-rte-popover-color);\r\n}\r\n\r\n/* the close button: a ghost button, muted at rest */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-header .se-close-btn {\r\n color: var(--_mono-rte-muted);\r\n text-shadow: none;\r\n border-radius: var(--mono-radius-sm);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .tabs > [role='tablist'] — the modal's Image / Link tabs:\r\n a text tab with the accent under the active one, not a boxed strip */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs {\r\n /* SunEditor floats the tab buttons inside a 25px-high strip; as a flex row the\r\n strip is as tall as the tabs and stays in flow above the form */\r\n display: flex;\r\n align-items: stretch;\r\n gap: calc(var(--mono-spacing) * 1);\r\n height: auto;\r\n margin-bottom: calc(var(--mono-spacing) * 3);\r\n border-bottom: var(--mono-border-width) solid var(--_se-main-border);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button {\r\n background-color: transparent;\r\n border: 0;\r\n border-bottom: 2px solid transparent;\r\n margin-bottom: calc(var(--mono-border-width) * -1);\r\n padding: calc(var(--mono-spacing) * 1.5) calc(var(--mono-spacing) * 3);\r\n color: var(--_mono-rte-muted);\r\n font-size: var(--mono-text-sm);\r\n font-weight: var(--mono-font-weight-medium);\r\n transition-property: color, border-color;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button:hover {\r\n background-color: transparent;\r\n color: var(--_mono-rte-text);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-tabs button.active {\r\n background-color: transparent;\r\n border-bottom-color: var(--_se-active);\r\n color: var(--_mono-rte-text);\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .input-group — rounded-md border border-input\r\n the modal's text fields and selects are the ported input: its surface, edge,\r\n corner and ring, through the input's own public knobs */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-form,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-select,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form select,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller input[type='text'],\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller select {\r\n background-color: var(--mono-input-bg, var(--mono-input-surface, var(--mono-input-outline-bg, var(--mono-mode-surface))));\r\n border: var(--mono-border-width) solid var(--mono-input-rest-border, var(--mono-input-border-color, var(--mono-input-outline-border-color, var(--input))));\r\n border-radius: var(--mono-input-radius-sm, var(--mono-input-outline-radius, var(--mono-input-radius, var(--mono-radius-md))));\r\n color: var(--_mono-rte-text);\r\n box-shadow: var(--mono-input-outline-shadow, var(--mono-shadow-xs));\r\n font-size: var(--mono-text-sm);\r\n outline: none;\r\n transition-property: border-color, box-shadow;\r\n transition-timing-function: var(--mono-ease);\r\n transition-duration: var(--mono-duration);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-input-form:focus,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form select:focus {\r\n border-color: var(--_se-active);\r\n box-shadow: 0 0 0 var(--mono-ring-width) color-mix(in oklab, var(--_se-active) var(--mono-ring-alpha), transparent);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner input:disabled {\r\n opacity: 0.5;\r\n}\r\n\r\n/* the file drop area: a dashed muted panel */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-flex-input-wrapper > .se-input-form-abs {\r\n border-radius: var(--mono-input-radius-sm, var(--mono-input-outline-radius, var(--mono-input-radius, var(--mono-radius-md))));\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn — Submit is the primary button */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-content .se-btn-primary {\r\n background-color: var(--mono-button-bg, var(--primary));\r\n border: var(--mono-border-width) solid transparent;\r\n border-radius: var(--mono-button-sm-radius, var(--mono-button-radius, var(--mono-radius-md)));\r\n color: var(--mono-button-color, var(--primary-foreground));\r\n font-size: var(--mono-text-sm);\r\n font-weight: var(--mono-font-weight-medium);\r\n box-shadow: var(--mono-shadow-xs);\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:hover,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:focus {\r\n background-color: color-mix(in oklab, var(--mono-button-bg, var(--primary)) 90%, transparent);\r\n border-color: transparent;\r\n color: var(--mono-button-color, var(--primary-foreground));\r\n}\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-btn-primary:disabled {\r\n opacity: 0.5;\r\n}\r\n\r\n/* basecoat@1.0.2 styles/vega.css .btn[data-variant='outline'] — the modal's secondary buttons */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-btn-revert,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-modal-form-files .se-modal-files-edge-button,\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-modal-area .se-modal-inner .se-modal-form .se-modal-flex-form .se-btn {\r\n border: var(--mono-border-width) solid var(--input);\r\n border-radius: var(--mono-button-sm-radius, var(--mono-button-radius, var(--mono-radius-md)));\r\n background-color: var(--background);\r\n color: var(--_mono-rte-text);\r\n opacity: 1;\r\n}\r\n\r\n/* the native checkboxes and radios take the accent */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) input[type='checkbox'],\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) input[type='radio'] {\r\n accent-color: var(--_se-active);\r\n}\r\n\r\n/* the floating controllers (link / image / table) are popovers */\r\n:is([mono-rte-mount] .sun-editor, .sun-editor.sun-editor-carrier-wrapper) .se-controller {\r\n border-radius: var(--_mono-rte-popover-radius);\r\n}\r\n\r\n/* Full screen — SunEditor fixes its root over the page (inline style, no class of\r\n its own; the element marks the mount when SunEditor reports the toggle, and the\r\n inline style is the fallback). The frame stays behind, so the editor takes the\r\n PAGE surface itself: opaque, in the mode's colours, the toolbar band on top. */\r\n[mono-rte-mount][mono-fullscreen] .sun-editor,\r\n[mono-rte-mount] .sun-editor[style*=\"position: fixed\"] {\r\n --_se-main-background: var(--mono-rich-text-editor-fullscreen-bg, var(--background));\r\n --_mono-rte-toolbar-bg: var(--mono-rich-text-editor-toolbar-bg, color-mix(in oklab, var(--muted) 60%, var(--mono-rich-text-editor-fullscreen-bg, var(--background))));\r\n background: var(--mono-rich-text-editor-fullscreen-bg, var(--background));\r\n color: var(--_mono-rte-text);\r\n}\r\n\r\n/* code view: the page's mono face on the editing surface, the line column muted */\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-code-viewer,\r\n[mono-rte-mount] .sun-editor .se-wrapper .se-code-wrapper .se-code-view-line {\r\n font-family: var(--font-mono, ui-monospace, monospace);\r\n font-size: var(--mono-text-sm);\r\n}\r\n\r\n@media (prefers-reduced-motion: reduce) {\r\n :where([mono-rich-text-editor]) [mono-rte-field] {\r\n transition: none;\r\n }\r\n}\r\n";
1281
9