@m3ui-vue/m3ui-vue 1.10.2 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +19 -4
  2. package/dist/API.md +195 -56
  3. package/dist/MButton-gWoOzFWf.js +284 -0
  4. package/dist/MButton-gWoOzFWf.js.map +1 -0
  5. package/dist/MColorPickerModal-CJYMvlgK.js +466 -0
  6. package/dist/MColorPickerModal-CJYMvlgK.js.map +1 -0
  7. package/dist/MDialog-CU8EYgCC.js +226 -0
  8. package/dist/MDialog-CU8EYgCC.js.map +1 -0
  9. package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
  10. package/dist/MIcon-CkUc9kuQ.js.map +1 -0
  11. package/dist/MIconButton-DTFOfsTy.js +317 -0
  12. package/dist/MIconButton-DTFOfsTy.js.map +1 -0
  13. package/dist/MListItem-Cdw2FqCT.js +1306 -0
  14. package/dist/MListItem-Cdw2FqCT.js.map +1 -0
  15. package/dist/MLoadingIndicator-BxAy2x7P.js +115 -0
  16. package/dist/MLoadingIndicator-BxAy2x7P.js.map +1 -0
  17. package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
  18. package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
  19. package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-CEfyXGq2.js} +674 -671
  20. package/dist/MPdfViewer-CEfyXGq2.js.map +1 -0
  21. package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
  22. package/dist/MSeekBar-B3_D-PwH.js +435 -0
  23. package/dist/MSeekBar-B3_D-PwH.js.map +1 -0
  24. package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-Dg07j-4r.js} +4 -4
  25. package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-Dg07j-4r.js.map} +1 -1
  26. package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-3nddtLKI.js} +2 -2
  27. package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-3nddtLKI.js.map} +1 -1
  28. package/dist/{MSlider-7TzhFHKS.js → MSlider-BrpLbqwt.js} +4 -4
  29. package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BrpLbqwt.js.map} +1 -1
  30. package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CLwzDH33.js} +2 -2
  31. package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CLwzDH33.js.map} +1 -1
  32. package/dist/{MTextField-B6_iOczK.js → MTextField-CZRizAwA.js} +136 -134
  33. package/dist/MTextField-CZRizAwA.js.map +1 -0
  34. package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-DVcqyy9g.js} +2 -2
  35. package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-DVcqyy9g.js.map} +1 -1
  36. package/dist/api.json +1 -1
  37. package/dist/chart.js +1 -1
  38. package/dist/code-editor.js +3 -3
  39. package/dist/code-editor.js.map +1 -1
  40. package/dist/components/MAlert.vue.d.ts +1 -1
  41. package/dist/components/MAudioPlayer.vue.d.ts +3 -3
  42. package/dist/components/MAvatar.vue.d.ts +19 -1
  43. package/dist/components/MButton.vue.d.ts +2 -1
  44. package/dist/components/MChatBubble.vue.d.ts +2 -0
  45. package/dist/components/MCheckbox.vue.d.ts +2 -0
  46. package/dist/components/MDataTable.vue.d.ts +31 -3
  47. package/dist/components/MFlow.vue.d.ts +1 -1
  48. package/dist/components/MHotkeys.vue.d.ts +1 -0
  49. package/dist/components/MIcon.vue.d.ts +6 -0
  50. package/dist/components/MIconButton.vue.d.ts +5 -0
  51. package/dist/components/MKanban.vue.d.ts +1 -1
  52. package/dist/components/MLink.vue.d.ts +59 -0
  53. package/dist/components/MListItem.vue.d.ts +3 -1
  54. package/dist/components/MMapControl.vue.d.ts +1 -1
  55. package/dist/components/MNotificationCenter.vue.d.ts +1 -1
  56. package/dist/components/MNumberField.vue.d.ts +1 -1
  57. package/dist/components/MPagination.vue.d.ts +14 -1
  58. package/dist/components/MPdfSigner.vue.d.ts +2 -2
  59. package/dist/components/MRadio.vue.d.ts +2 -0
  60. package/dist/components/MRadioGroup.vue.d.ts +2 -0
  61. package/dist/components/MStatCard.vue.d.ts +2 -2
  62. package/dist/components/MSwitch.vue.d.ts +2 -0
  63. package/dist/components/MText.vue.d.ts +4 -2
  64. package/dist/components/MTextField.vue.d.ts +2 -0
  65. package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
  66. package/dist/composables/_menuGroups.d.ts +10 -1
  67. package/dist/composables/_splitAttrs.d.ts +6 -0
  68. package/dist/composables/_springAnimation.d.ts +2 -2
  69. package/dist/composables/_useFocusTrap.d.ts +15 -0
  70. package/dist/composables/_usePaneResize.d.ts +1 -1
  71. package/dist/composables/_useSpring.d.ts +4 -4
  72. package/dist/composables/dynamicColor.d.ts +9 -1
  73. package/dist/composables/motion.d.ts +63 -0
  74. package/dist/composables/useConfirm.d.ts +28 -0
  75. package/dist/composables/useDevice.d.ts +8 -1
  76. package/dist/composables/useLocale.d.ts +14 -0
  77. package/dist/composables/useScrollReveal.d.ts +1 -1
  78. package/dist/composables/useTheme.d.ts +1 -0
  79. package/dist/composables/useToast.d.ts +7 -0
  80. package/dist/draw.js +556 -556
  81. package/dist/draw.js.map +1 -1
  82. package/dist/flow.js +854 -851
  83. package/dist/flow.js.map +1 -1
  84. package/dist/gantt.js +1118 -1096
  85. package/dist/gantt.js.map +1 -1
  86. package/dist/index.d.ts +8 -5
  87. package/dist/locales/index.d.ts +1 -0
  88. package/dist/locales/index.js +833 -1
  89. package/dist/locales/index.js.map +1 -1
  90. package/dist/locales/pl.d.ts +2 -0
  91. package/dist/m3ui-vue.css +1 -1
  92. package/dist/m3ui.js +10327 -9796
  93. package/dist/m3ui.js.map +1 -1
  94. package/dist/map.js +860 -860
  95. package/dist/map.js.map +1 -1
  96. package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
  97. package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
  98. package/dist/media.js +7 -7
  99. package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
  100. package/dist/motion-BqYcqcim.js.map +1 -0
  101. package/dist/pdf-sign.js +140 -137
  102. package/dist/pdf-sign.js.map +1 -1
  103. package/dist/pdf.js +1 -1
  104. package/dist/plugin.d.ts +11 -0
  105. package/dist/rich-text-editor.js +7 -7
  106. package/dist/styles/theme.css +40 -0
  107. package/dist/styles.css +1 -1
  108. package/dist/terminal.js +1 -1
  109. package/dist/{useLocale-YRaOT12S.js → useLocale-BjcYauXr.js} +60 -4
  110. package/dist/useLocale-BjcYauXr.js.map +1 -0
  111. package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
  112. package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
  113. package/package.json +17 -2
  114. package/src/__tests__/MAvatarImage.test.ts +37 -0
  115. package/src/__tests__/MDataTableControlled.test.ts +68 -0
  116. package/src/__tests__/MHotkeysSequence.test.ts +53 -0
  117. package/src/__tests__/MIconAxes.test.ts +16 -0
  118. package/src/__tests__/MIconButtonWidth.test.ts +22 -0
  119. package/src/__tests__/MLink.test.ts +46 -0
  120. package/src/__tests__/MPaginationPages.test.ts +43 -0
  121. package/src/__tests__/MTextEmphasized.test.ts +14 -0
  122. package/src/__tests__/controlDescription.test.ts +34 -0
  123. package/src/__tests__/customColor.test.ts +27 -0
  124. package/src/__tests__/dynamicColor.test.ts +3 -2
  125. package/src/__tests__/focusTrap.test.ts +124 -0
  126. package/src/__tests__/formatMessage.test.ts +20 -0
  127. package/src/__tests__/inputAttrs.test.ts +103 -0
  128. package/src/__tests__/localePresets.test.ts +2 -0
  129. package/src/__tests__/menuGroupsRemount.test.ts +40 -0
  130. package/src/__tests__/menuHydration.test.ts +41 -0
  131. package/src/__tests__/motionPrefs.test.ts +28 -0
  132. package/src/__tests__/ssr.test.ts +11 -0
  133. package/src/__tests__/ssrToast.test.ts +20 -0
  134. package/src/__tests__/toastDetails.test.ts +39 -0
  135. package/src/__tests__/useConfirm.test.ts +47 -0
  136. package/src/__tests__/useTheme.test.ts +14 -0
  137. package/src/__tests__/warningRole.test.ts +22 -0
  138. package/src/components/MAlert.vue +2 -2
  139. package/src/components/MAnimatedNumber.vue +9 -3
  140. package/src/components/MAutocomplete.vue +16 -4
  141. package/src/components/MAvailabilityCalendar.vue +3 -3
  142. package/src/components/MAvatar.vue +32 -5
  143. package/src/components/MAvatarGroup.vue +7 -2
  144. package/src/components/MBottomSheet.vue +18 -2
  145. package/src/components/MButton.vue +18 -5
  146. package/src/components/MCarousel.vue +3 -3
  147. package/src/components/MChatBubble.vue +14 -1
  148. package/src/components/MCheckbox.vue +21 -4
  149. package/src/components/MChip.vue +4 -2
  150. package/src/components/MCollapse.vue +7 -1
  151. package/src/components/MCommandPalette.vue +6 -2
  152. package/src/components/MContextMenu.vue +4 -4
  153. package/src/components/MCreditCardInput.vue +5 -0
  154. package/src/components/MDashboardGrid.vue +2 -1
  155. package/src/components/MDataTable.vue +63 -16
  156. package/src/components/MDialog.vue +21 -3
  157. package/src/components/MDiffViewer.vue +3 -3
  158. package/src/components/MDrawLayers.vue +3 -3
  159. package/src/components/MFabMenu.vue +7 -0
  160. package/src/components/MFloorPlan.vue +3 -3
  161. package/src/components/MFloorPlanInspector.vue +3 -3
  162. package/src/components/MFlow.vue +9 -5
  163. package/src/components/MFlowControls.vue +6 -0
  164. package/src/components/MFormBuilder.vue +1 -1
  165. package/src/components/MGantt.vue +10 -10
  166. package/src/components/MHotkeys.vue +61 -16
  167. package/src/components/MIcon.vue +17 -1
  168. package/src/components/MIconButton.vue +29 -6
  169. package/src/components/MImageCropper.vue +1 -1
  170. package/src/components/MKanban.vue +2 -1
  171. package/src/components/MLightbox.vue +5 -4
  172. package/src/components/MLink.vue +136 -0
  173. package/src/components/MListDetail.vue +7 -0
  174. package/src/components/MListItem.vue +7 -4
  175. package/src/components/MLoadingIndicator.vue +2 -1
  176. package/src/components/MMap.vue +3 -0
  177. package/src/components/MMapCluster.vue +2 -2
  178. package/src/components/MMapControl.vue +2 -2
  179. package/src/components/MMapMeasure.vue +1 -1
  180. package/src/components/MMaskField.vue +16 -3
  181. package/src/components/MMenu.vue +4 -4
  182. package/src/components/MMenuItem.vue +2 -2
  183. package/src/components/MMeterGroup.vue +3 -2
  184. package/src/components/MMortgageCalculator.vue +3 -3
  185. package/src/components/MMultiAutocomplete.vue +19 -7
  186. package/src/components/MMultiSelect.vue +19 -7
  187. package/src/components/MNavigationDrawer.vue +10 -3
  188. package/src/components/MNavigationRail.vue +5 -1
  189. package/src/components/MNotificationCenter.vue +2 -1
  190. package/src/components/MNotificationHost.vue +3 -3
  191. package/src/components/MNumberField.vue +23 -6
  192. package/src/components/MOdontogram.vue +4 -4
  193. package/src/components/MOrderBook.vue +4 -0
  194. package/src/components/MPagination.vue +91 -12
  195. package/src/components/MPdfSigner.vue +3 -3
  196. package/src/components/MPdfViewer.vue +7 -7
  197. package/src/components/MPhoneInput.vue +17 -4
  198. package/src/components/MProductConfigurator.vue +4 -4
  199. package/src/components/MProgressBar.vue +5 -0
  200. package/src/components/MQuiz.vue +8 -5
  201. package/src/components/MRadio.vue +24 -5
  202. package/src/components/MRadioGroup.vue +3 -0
  203. package/src/components/MReactions.vue +2 -2
  204. package/src/components/MResourceTimeline.vue +3 -3
  205. package/src/components/MResult.vue +1 -1
  206. package/src/components/MScrollField.vue +1 -1
  207. package/src/components/MSearchField.vue +6 -5
  208. package/src/components/MSeatMap.vue +5 -0
  209. package/src/components/MSeekBar.vue +3 -2
  210. package/src/components/MSelect.vue +16 -4
  211. package/src/components/MSideSheet.vue +25 -3
  212. package/src/components/MSimpleCarousel.vue +2 -2
  213. package/src/components/MSnackbar.vue +16 -13
  214. package/src/components/MSparkline.vue +2 -1
  215. package/src/components/MSpinner.vue +8 -0
  216. package/src/components/MSplitter.vue +1 -1
  217. package/src/components/MSpotlightSearch.vue +6 -2
  218. package/src/components/MSpreadsheet.vue +1 -1
  219. package/src/components/MStatCard.vue +2 -1
  220. package/src/components/MSwitch.vue +21 -4
  221. package/src/components/MTabs.vue +2 -1
  222. package/src/components/MTagInput.vue +19 -6
  223. package/src/components/MText.vue +23 -4
  224. package/src/components/MTextField.vue +25 -6
  225. package/src/components/MTimeline.vue +5 -5
  226. package/src/components/MToolbar.vue +2 -2
  227. package/src/components/MTour.vue +3 -0
  228. package/src/components/MTrackingTimeline.vue +6 -0
  229. package/src/components/MTypewriter.vue +7 -1
  230. package/src/components/MWindow.vue +10 -1
  231. package/src/components/_MColorPanel.vue +4 -4
  232. package/src/components/_MComment.vue +3 -2
  233. package/src/components/_MFlowNodeShell.vue +1 -1
  234. package/src/components/_MPdfPage.vue +1 -1
  235. package/src/components/_MTransferPane.vue +10 -0
  236. package/src/composables/_effectCanvas.ts +2 -1
  237. package/src/composables/_menuGroups.ts +10 -1
  238. package/src/composables/_splitAttrs.ts +29 -0
  239. package/src/composables/_springAnimation.ts +3 -3
  240. package/src/composables/_themeTransition.ts +3 -2
  241. package/src/composables/_useFocusTrap.ts +142 -0
  242. package/src/composables/_useMenuNav.ts +3 -3
  243. package/src/composables/_usePaneResize.ts +2 -1
  244. package/src/composables/_useSheetMotion.ts +3 -4
  245. package/src/composables/_useSpring.ts +16 -10
  246. package/src/composables/cron.ts +7 -6
  247. package/src/composables/dynamicColor.ts +21 -2
  248. package/src/composables/motion.ts +27 -0
  249. package/src/composables/useConfirm.ts +116 -0
  250. package/src/composables/useDevice.ts +23 -3
  251. package/src/composables/useFieldBg.ts +4 -0
  252. package/src/composables/useLocale.ts +74 -0
  253. package/src/composables/useNotification.ts +3 -0
  254. package/src/composables/useScrollReveal.ts +3 -3
  255. package/src/composables/useTheme.ts +8 -2
  256. package/src/composables/useToast.ts +27 -4
  257. package/src/directives/vSparkle.ts +2 -1
  258. package/src/index.ts +8 -5
  259. package/src/locales/ar.ts +7 -0
  260. package/src/locales/de.ts +7 -0
  261. package/src/locales/es.ts +7 -0
  262. package/src/locales/fr.ts +7 -0
  263. package/src/locales/index.ts +1 -0
  264. package/src/locales/ja.ts +7 -0
  265. package/src/locales/ko.ts +7 -0
  266. package/src/locales/pl.ts +807 -0
  267. package/src/locales/pt.ts +7 -0
  268. package/src/locales/zh.ts +7 -0
  269. package/src/plugin.ts +16 -0
  270. package/src/styles/theme.css +40 -0
  271. package/dist/MButton-B9RCM06i.js +0 -171
  272. package/dist/MButton-B9RCM06i.js.map +0 -1
  273. package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
  274. package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
  275. package/dist/MDialog-dk07tify.js +0 -167
  276. package/dist/MDialog-dk07tify.js.map +0 -1
  277. package/dist/MIcon-BSsJZhK7.js.map +0 -1
  278. package/dist/MIconButton-CrBPZidd.js +0 -288
  279. package/dist/MIconButton-CrBPZidd.js.map +0 -1
  280. package/dist/MListItem-h9H223vx.js +0 -1239
  281. package/dist/MListItem-h9H223vx.js.map +0 -1
  282. package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
  283. package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
  284. package/dist/MMenuItem-US0Zbglq.js.map +0 -1
  285. package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
  286. package/dist/MSeekBar-JFZcoJ8y.js +0 -434
  287. package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
  288. package/dist/MTextField-B6_iOczK.js.map +0 -1
  289. package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
  290. package/dist/motion-BcejVTeX.js.map +0 -1
  291. package/dist/useLocale-YRaOT12S.js.map +0 -1
  292. package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
package/dist/chart.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./useThemeTokens-DyAdPQB0.js";
1
+ import { t as e } from "./useThemeTokens-D5nr5KHf.js";
2
2
  import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeStyle as o, onMounted as s, openBlock as c, ref as l, resolveDynamicComponent as u, shallowRef as d, watch as f } from "vue";
3
3
  // src/components/MChart.vue
4
4
  var p = /* @__PURE__ */ a({
@@ -1,7 +1,7 @@
1
- import { n as e, r as t, t as n } from "./_useFieldValidation-COBJ1tWr.js";
2
- import { t as r } from "./MIcon-BSsJZhK7.js";
1
+ import { n as e, r as t, t as n } from "./_useFieldValidation-DVcqyy9g.js";
2
+ import { t as r } from "./MIcon-CkUc9kuQ.js";
3
3
  import { t as i } from "./vTooltip-xESB2YOb.js";
4
- import { i as a } from "./useLocale-YRaOT12S.js";
4
+ import { a } from "./useLocale-BjcYauXr.js";
5
5
  import { t as o } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
6
6
  import { Fragment as s, computed as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, inject as h, mergeProps as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, openBlock as x, provide as S, ref as C, renderSlot as w, toDisplayString as T, unref as E, watch as D, withCtx as O, withDirectives as k } from "vue";
7
7
  // src/components/MCodeEditor.vue?vue&type=script&setup=true&lang.ts
@@ -1 +1 @@
1
- {"version":3,"file":"code-editor.js","names":["$attrs","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","_unref","_toDisplayString","_renderSlot","_withDirectives","_createVNode","MIcon","_normalizeClass","_normalizeStyle","_openBlock","_createElementBlock","_unref","_createVNode","MCodeEditor","_withCtx","_createElementVNode","_normalizeClass","MIcon","_createTextVNode","_toDisplayString","useFieldValidation","useFocusLeave","FORM_KEY","MIcon_default","vTooltip","useLocale","_plugin_vue_export_helper_default","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","MCodeEditor_default","defineComponent","__expose","__emit","props","__props","emit","containerRef","ref","view","rootEl","validation","v","errorMessage","onFocusOut","cmModules","t","copied","copyCode","langLabel","computed","loadModules","viewMod","stateMod","commandsMod","languageMod","highlightMod","oneDarkMod","jsMod","jsonMod","htmlMod","cssMod","pyMod","vueMod","cppMod","rustMod","asmMod","buildM3HighlightStyle","tags","getLangExtension","mods","buildExtensions","m3Style","exts","update","createEditor","onMounted","watch","val","onBeforeUnmount","openBlock","createElementBlock","Fragment","createElementVNode","mergeProps","_ctx","unref","hasError","messageId","_cache","args","toDisplayString","renderSlot","withDirectives","createVNode","normalizeClass","createCommentVNode","normalizeStyle","_hoisted_1","_hoisted_2","_hoisted_3","MJsonEditor_default","locale","inForm","inject","l","rawText","parseError","isValid","jsonRule","provide","current","onTextUpdate","text","parsed","formatJson","minifyJson","withCtx","createTextVNode"],"sources":["../src/components/MCodeEditor.vue","../src/components/MJsonEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A syntax-highlighted code editor built on CodeMirror 6, with a header bar, line numbers, and a copy button.\n *\n * @slot actions Extra controls rendered in the header bar, before the built-in copy button\n * @event update:modelValue Emitted on every document change — powers v-model\n * @event blur Emitted when focus leaves the editor\n */\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\nimport MIcon from './MIcon.vue'\nimport { vTooltip } from '../directives/vTooltip'\nimport { useLocale } from '../composables/useLocale'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n /** Editor content (v-model) */\n modelValue: string\n /** Syntax language */\n language?: Language\n /** Read-only mode */\n readonly?: boolean\n /** Show line numbers */\n lineNumbers?: boolean\n /** Color theme */\n theme?: 'light' | 'dark'\n /** Minimum editor height */\n minHeight?: string\n /** Maximum editor height */\n maxHeight?: string\n /** Placeholder text shown via CodeMirror when the editor is empty */\n placeholder?: string\n /** Error state. A string is also the message */\n error?: boolean | string\n /** Error message shown when `error` is true */\n errorLabel?: string\n /** Inside an `MForm` or with `rules`, the code can't be blank */\n required?: boolean\n /** Validation rules (functions or a Standard Schema); see `MForm` */\n rules?: ValidationRule | ValidationRule[]\n /** When the rules are checked and shown: on leaving it (default), on change, or only on submit */\n validateOn?: ValidateOn\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number\n /** The key of this field in its `MForm` */\n name?: string\n /** Word wrap */\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\n// Editor + its message: attributes go on the editor\ndefineOptions({ inheritAttrs: false })\n\nconst emit = defineEmits<{ 'update:modelValue': [string]; blur: [] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nconst rootEl = ref<HTMLElement | null>(null)\n\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => props.rules,\n required: () => props.required,\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.readonly,\n focus: () => { view?.focus() },\n el: () => rootEl.value,\n setValue: (v) => emit('update:modelValue', v as string),\n})\nconst { hasError, message: errorMessage, messageId } = validation\nconst onFocusOut = useFocusLeave(() => rootEl.value, () => {\n validation.onBlur()\n emit('blur')\n})\nlet cmModules: any = null\nconst t = useLocale()\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n\ndefineExpose({\n /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\n})\n</script>\n\n<template>\n <div dir=\"ltr\"\n ref=\"rootEl\"\n v-bind=\"$attrs\"\n class=\"flex flex-col overflow-hidden rounded-lg border\"\n :class=\"hasError ? 'border-error' : 'border-outline-variant'\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"errorMessage ? messageId : undefined\"\n @focusout=\"onFocusOut\"\n >\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n v-tooltip=\"copied ? undefined : t.codeCopy\"\n :aria-label=\"copied ? t.codeCopied : t.codeCopy\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">{{ t.codeCopied }}</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n <p v-if=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"mt-1 px-4 text-body-small text-error\">{{ errorMessage }}</p>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-size: 0.8125rem;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n /* Set here, not on .cm-editor: CodeMirror's base theme declares\n font-family: monospace and line-height: 1.4 on .cm-scroller itself,\n which beats inheritance */\n font-family: var(--font-mono, 'Roboto Mono', monospace);\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n /* CodeMirror renders the selection highlight on a layer with z-index: -1\n (@codemirror/view's selectionLayer has `above: false` by design, so it always\n sits behind the line content). An opaque active-line background would paint\n straight over it and hide the selection on the current line — this needs to\n stay a translucent tint so a selection underneath still shows through. */\n background: color-mix(in srgb, var(--color-on-surface) 5%, transparent);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A JSON-aware editor built on top of MCodeEditor — validates as you type and adds format/minify shortcuts.\n *\n * @event update:modelValue Emitted with the parsed value whenever the text is valid JSON — powers v-model\n * @event blur Emitted when focus leaves the editor\n */\nimport { ref, computed, inject, provide, watch } from 'vue'\nimport { FORM_KEY, useFieldValidation, useFocusLeave, type FormContext } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n// jsonRule is always there: `required` alone (no MForm, no rules) keeps today's behavior\nconst inForm = !!inject(FORM_KEY, null)\n\nconst props = withDefaults(\n defineProps<{\n /** JSON data (v-model, any valid JSON) */\n modelValue: unknown\n /** Read-only mode */\n readonly?: boolean\n /** Error state. A string is also the message */\n error?: boolean | string\n /** Error message shown when `error` is true */\n errorLabel?: string\n /** Inside an `MForm` or with `rules`, it can't be empty (null) */\n required?: boolean\n /** Validation rules (functions or a Standard Schema); see `MForm` */\n rules?: ValidationRule | ValidationRule[]\n /** When the rules are checked and shown: on leaving it (default), on change, or only on submit */\n validateOn?: ValidateOn\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number\n /** The key of this field in its `MForm` */\n name?: string\n /** Min height */\n minHeight?: string\n /** Max height */\n maxHeight?: string\n /**\n * Overrides for the valid/invalid badge and format/minify button text (see `JsonEditorLabels`) — defaults come\n * from useLocale()\n */\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown]; blur: [] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\n// Text that doesn't parse is one more rule: it blocks an MForm submit\nconst jsonRule: ValidationRule = () => !parseError.value || l.value.invalid\nconst rootEl = ref<HTMLElement | null>(null)\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => [...(props.rules ? (Array.isArray(props.rules) ? props.rules : [props.rules]) : []), jsonRule],\n required: () => props.required && (inForm || !!props.rules),\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.readonly,\n focus: () => { rootEl.value?.querySelector<HTMLElement>('.cm-content')?.focus() },\n el: () => rootEl.value,\n setValue: (v) => emit('update:modelValue', v),\n})\nconst { hasError, message: errorMessage, messageId } = validation\nconst onFocusOut = useFocusLeave(() => rootEl.value, () => {\n validation.onBlur()\n emit('blur')\n})\n// The inner MCodeEditor edits text, not this value: keep it out of the form\nprovide(FORM_KEY, null as unknown as FormContext)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\ndefineExpose({\n /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\n})\n</script>\n\n<template>\n <div ref=\"rootEl\" dir=\"ltr\" class=\"flex flex-col gap-0\" @focusout=\"onFocusOut\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :error=\"hasError && !parseError\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n <!-- The parse error above already says what's wrong with the text -->\n <p v-else-if=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"px-3 py-1.5 text-body-small text-error\">{{ errorMessage }}</p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,IAAM4C,IAAQC,GAiDRC,IAAOH,GAEPI,IAAeC,EAAwB,IAAI,GAC7CC,IAAY,MACVC,IAASF,EAAwB,IAAI,GAErCG,IAAazB,EAAmB;GACpC,aAAakB,EAAM;GACnB,aAAaA,EAAM;GACnB,gBAAgBA,EAAM;GACtB,aAAaA,EAAM;GACnB,kBAAkBA,EAAM;GACxB,YAAYA,EAAM;GAClB,kBAAkBA,EAAM;GACxB,wBAAwBA,EAAM;GAC9B,gBAAgBA,EAAM;GACtB,aAAa;IAAE,GAAM,MAAM;GAAE;GAC7B,UAAUM,EAAO;GACjB,WAAW,MAAMJ,EAAK,qBAAqBM,CAAW;EACxD,CAAC,GACK,EAAE,aAAU,SAASC,GAAc,iBAAcF,GACjDG,IAAa3B,QAAoBuB,EAAO,aAAa;GAEzD,AADAC,EAAW,OAAO,GAClBL,EAAK,MAAM;EACb,CAAC,GACGS,IAAiB,MACfC,IAAIzB,EAAU,GACd0B,IAAST,EAAI,EAAK;EAExB,eAAeU,IAAW;GAGxB,AAFA,MAAM,UAAU,UAAU,UAAUd,EAAM,UAAU,GACpD,EAAO,QAAQ,IACf,iBAAiB;IAAE,EAAO,QAAQ;GAAM,GAAG,IAAI;EACjD;EAEA,IAAMe,IAAYC,SAeT;GAbL,YAAY;GACZ,YAAY;GACZ,MAAM;GACN,MAAM;GACN,KAAK;GACL,QAAQ;GACR,KAAK;GACL,GAAG;GACH,KAAK;GACL,MAAM;GACN,KAAK;GACL,OAAO;EAEF,EAAA,CAAOhB,EAAM,SACrB;EAED,eAAeiB,IAAc;GAC3B,IAAIN,GAAW,OAAOA;GAEtB,IAAM,CAACO,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C,EAQS,UAAA;;KANP,MAAK;KACL,OAAM;KACL,SAAO6G;I,IAER3G,EAAkDK,GAAA;KAA3C,MAAK;KAA0B,MAAM;I,IAAMC,EAAA,MAClDC,EAAG0F,EAAA,MAAE,MAAM,GAAA,CAAA,C;IAGJtE,EAAA,W,aADT9B,EAAA,GAAAC,EAQS,UAAA;;KANP,MAAK;KACL,OAAM;KACL,SAAO8G;I,IAER5G,EAAoCK,GAAA;KAA7B,MAAK;KAAY,MAAM;I,IAAMC,EAAA,MACpCC,EAAG0F,EAAA,MAAE,MAAM,GAAA,CAAA,C;;;;;;;;;E,IAMVE,EAAA,SAATtG,EAAA,GAAAC,EAEI,KAFJ6F,GAEIpF,EADC4F,EAAA,KAAU,GAAA,CAAA,KAGDpG,EAAAoC,CAAA,KAAdtC,EAAA,GAAAC,EAA8H,KAAA;;GAAjG,IAAIC,EAAAiF,CAAA;GAAW,MAAK;GAAQ,OAAM;EAA4C,GAAAzE,EAAAR,EAAAoC,CAAA,CAAY,GAAA,GAAAyD,CAAA,K"}
1
+ {"version":3,"file":"code-editor.js","names":["$attrs","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","_unref","_toDisplayString","_renderSlot","_withDirectives","_createVNode","MIcon","_normalizeClass","_normalizeStyle","_openBlock","_createElementBlock","_unref","_createVNode","MCodeEditor","_withCtx","_createElementVNode","_normalizeClass","MIcon","_createTextVNode","_toDisplayString","useFieldValidation","useFocusLeave","FORM_KEY","MIcon_default","vTooltip","_plugin_vue_export_helper_default","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","MCodeEditor_default","defineComponent","__expose","__emit","props","__props","emit","containerRef","ref","view","rootEl","validation","v","errorMessage","onFocusOut","cmModules","t","useLocale","copied","copyCode","langLabel","computed","loadModules","viewMod","stateMod","commandsMod","languageMod","highlightMod","oneDarkMod","jsMod","jsonMod","htmlMod","cssMod","pyMod","vueMod","cppMod","rustMod","asmMod","buildM3HighlightStyle","tags","getLangExtension","mods","buildExtensions","m3Style","exts","update","createEditor","onMounted","watch","val","onBeforeUnmount","openBlock","createElementBlock","Fragment","createElementVNode","mergeProps","_ctx","unref","hasError","messageId","_cache","args","toDisplayString","renderSlot","withDirectives","createVNode","normalizeClass","createCommentVNode","normalizeStyle","_hoisted_1","_hoisted_2","_hoisted_3","MJsonEditor_default","locale","inForm","inject","l","rawText","parseError","isValid","jsonRule","provide","current","onTextUpdate","text","parsed","formatJson","minifyJson","withCtx","createTextVNode"],"sources":["../src/components/MCodeEditor.vue","../src/components/MJsonEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A syntax-highlighted code editor built on CodeMirror 6, with a header bar, line numbers, and a copy button.\n *\n * @slot actions Extra controls rendered in the header bar, before the built-in copy button\n * @event update:modelValue Emitted on every document change — powers v-model\n * @event blur Emitted when focus leaves the editor\n */\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\nimport MIcon from './MIcon.vue'\nimport { vTooltip } from '../directives/vTooltip'\nimport { useLocale } from '../composables/useLocale'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n /** Editor content (v-model) */\n modelValue: string\n /** Syntax language */\n language?: Language\n /** Read-only mode */\n readonly?: boolean\n /** Show line numbers */\n lineNumbers?: boolean\n /** Color theme */\n theme?: 'light' | 'dark'\n /** Minimum editor height */\n minHeight?: string\n /** Maximum editor height */\n maxHeight?: string\n /** Placeholder text shown via CodeMirror when the editor is empty */\n placeholder?: string\n /** Error state. A string is also the message */\n error?: boolean | string\n /** Error message shown when `error` is true */\n errorLabel?: string\n /** Inside an `MForm` or with `rules`, the code can't be blank */\n required?: boolean\n /** Validation rules (functions or a Standard Schema); see `MForm` */\n rules?: ValidationRule | ValidationRule[]\n /** When the rules are checked and shown: on leaving it (default), on change, or only on submit */\n validateOn?: ValidateOn\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number\n /** The key of this field in its `MForm` */\n name?: string\n /** Word wrap */\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\n// Editor + its message: attributes go on the editor\ndefineOptions({ inheritAttrs: false })\n\nconst emit = defineEmits<{ 'update:modelValue': [string]; blur: [] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nconst rootEl = ref<HTMLElement | null>(null)\n\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => props.rules,\n required: () => props.required,\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.readonly,\n focus: () => { view?.focus() },\n el: () => rootEl.value,\n setValue: (v) => emit('update:modelValue', v as string),\n})\nconst { hasError, message: errorMessage, messageId } = validation\nconst onFocusOut = useFocusLeave(() => rootEl.value, () => {\n validation.onBlur()\n emit('blur')\n})\nlet cmModules: any = null\nconst t = useLocale()\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n\ndefineExpose({\n /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\n})\n</script>\n\n<template>\n <div dir=\"ltr\"\n ref=\"rootEl\"\n v-bind=\"$attrs\"\n class=\"flex flex-col overflow-hidden rounded-lg border\"\n :class=\"hasError ? 'border-error' : 'border-outline-variant'\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"errorMessage ? messageId : undefined\"\n @focusout=\"onFocusOut\"\n >\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n v-tooltip=\"copied ? undefined : t.codeCopy\"\n :aria-label=\"copied ? t.codeCopied : t.codeCopy\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">{{ t.codeCopied }}</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n <p v-if=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"mt-1 px-4 text-body-small text-error\">{{ errorMessage }}</p>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-size: 0.8125rem;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n /* Set here, not on .cm-editor: CodeMirror's base theme declares\n font-family: monospace and line-height: 1.4 on .cm-scroller itself,\n which beats inheritance */\n font-family: var(--font-mono, 'Roboto Mono', monospace);\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n /* CodeMirror renders the selection highlight on a layer with z-index: -1\n (@codemirror/view's selectionLayer has `above: false` by design, so it always\n sits behind the line content). An opaque active-line background would paint\n straight over it and hide the selection on the current line — this needs to\n stay a translucent tint so a selection underneath still shows through. */\n background: color-mix(in srgb, var(--color-on-surface) 5%, transparent);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A JSON-aware editor built on top of MCodeEditor — validates as you type and adds format/minify shortcuts.\n *\n * @event update:modelValue Emitted with the parsed value whenever the text is valid JSON — powers v-model\n * @event blur Emitted when focus leaves the editor\n */\nimport { ref, computed, inject, provide, watch } from 'vue'\nimport { FORM_KEY, useFieldValidation, useFocusLeave, type FormContext } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n// jsonRule is always there: `required` alone (no MForm, no rules) keeps today's behavior\nconst inForm = !!inject(FORM_KEY, null)\n\nconst props = withDefaults(\n defineProps<{\n /** JSON data (v-model, any valid JSON) */\n modelValue: unknown\n /** Read-only mode */\n readonly?: boolean\n /** Error state. A string is also the message */\n error?: boolean | string\n /** Error message shown when `error` is true */\n errorLabel?: string\n /** Inside an `MForm` or with `rules`, it can't be empty (null) */\n required?: boolean\n /** Validation rules (functions or a Standard Schema); see `MForm` */\n rules?: ValidationRule | ValidationRule[]\n /** When the rules are checked and shown: on leaving it (default), on change, or only on submit */\n validateOn?: ValidateOn\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number\n /** The key of this field in its `MForm` */\n name?: string\n /** Min height */\n minHeight?: string\n /** Max height */\n maxHeight?: string\n /**\n * Overrides for the valid/invalid badge and format/minify button text (see `JsonEditorLabels`) — defaults come\n * from useLocale()\n */\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown]; blur: [] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\n// Text that doesn't parse is one more rule: it blocks an MForm submit\nconst jsonRule: ValidationRule = () => !parseError.value || l.value.invalid\nconst rootEl = ref<HTMLElement | null>(null)\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => [...(props.rules ? (Array.isArray(props.rules) ? props.rules : [props.rules]) : []), jsonRule],\n required: () => props.required && (inForm || !!props.rules),\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.readonly,\n focus: () => { rootEl.value?.querySelector<HTMLElement>('.cm-content')?.focus() },\n el: () => rootEl.value,\n setValue: (v) => emit('update:modelValue', v),\n})\nconst { hasError, message: errorMessage, messageId } = validation\nconst onFocusOut = useFocusLeave(() => rootEl.value, () => {\n validation.onBlur()\n emit('blur')\n})\n// The inner MCodeEditor edits text, not this value: keep it out of the form\nprovide(FORM_KEY, null as unknown as FormContext)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\ndefineExpose({\n /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\n})\n</script>\n\n<template>\n <div ref=\"rootEl\" dir=\"ltr\" class=\"flex flex-col gap-0\" @focusout=\"onFocusOut\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :error=\"hasError && !parseError\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n <!-- The parse error above already says what's wrong with the text -->\n <p v-else-if=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"px-3 py-1.5 text-body-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MAClDC,EAAG0F,EAAA,MAAE,MAAM,GAAA,CAAA,C;IAGJvE,EAAA,W,aADT7B,EAAA,GAAAC,EAQS,UAAA;;KANP,MAAK;KACL,OAAM;KACL,SAAO8G;I,IAER5G,EAAoCK,GAAA;KAA7B,MAAK;KAAY,MAAM;I,IAAMC,EAAA,MACpCC,EAAG0F,EAAA,MAAE,MAAM,GAAA,CAAA,C;;;;;;;;;E,IAMVE,EAAA,SAATtG,EAAA,GAAAC,EAEI,KAFJ6F,GAEIpF,EADC4F,EAAA,KAAU,GAAA,CAAA,KAGDpG,EAAAmC,CAAA,KAAdrC,EAAA,GAAAC,EAA8H,KAAA;;GAAjG,IAAIC,EAAAiF,CAAA;GAAW,MAAK;GAAQ,OAAM;EAA4C,GAAAzE,EAAAR,EAAAmC,CAAA,CAAY,GAAA,GAAA0D,CAAA,K"}
@@ -21,7 +21,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
21
21
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
22
  onClose?: (() => any) | undefined;
23
23
  }>, {
24
- type: "error" | "success" | "info" | "warning";
24
+ type: "error" | "success" | "warning" | "info";
25
25
  closeable: boolean;
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -78,7 +78,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
78
78
  "update:volume": (args_0: number) => any;
79
79
  "update:muted": (args_0: boolean) => any;
80
80
  "update:shuffle": (args_0: boolean) => any;
81
- "update:repeat": (args_0: "all" | "off" | "one") => any;
81
+ "update:repeat": (args_0: "one" | "all" | "off") => any;
82
82
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
83
83
  onError?: ((args_0: MediaError | null) => any) | undefined;
84
84
  onPrevious?: (() => any) | undefined;
@@ -91,10 +91,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
91
91
  "onUpdate:volume"?: ((args_0: number) => any) | undefined;
92
92
  "onUpdate:muted"?: ((args_0: boolean) => any) | undefined;
93
93
  "onUpdate:shuffle"?: ((args_0: boolean) => any) | undefined;
94
- "onUpdate:repeat"?: ((args_0: "all" | "off" | "one") => any) | undefined;
94
+ "onUpdate:repeat"?: ((args_0: "one" | "all" | "off") => any) | undefined;
95
95
  }>, {
96
96
  color: string;
97
- repeat: "all" | "off" | "one";
97
+ repeat: "one" | "all" | "off";
98
98
  seekBar: "line" | "wavy" | "slider";
99
99
  variant: "standard" | "mini";
100
100
  playing: boolean;
@@ -5,9 +5,27 @@ type __VLS_Props = {
5
5
  fallback?: string;
6
6
  /** Avatar size in px — also scales the font size proportionally (40%) */
7
7
  size?: number;
8
+ /** Photo URL. Shown instead of the initials; if it fails to load, the icon or initials show instead */
9
+ src?: string;
10
+ /** Alternative text for the photo. Defaults to `name`; an avatar without either is treated as decoration */
11
+ alt?: string;
12
+ /** Material Symbol shown instead of the initials (e.g. `person`, `group`), when there's no photo */
13
+ icon?: string;
8
14
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ declare const __VLS_template: () => {
16
+ __VLS_Slots: {
17
+ default?: (props: {}) => any;
18
+ };
19
+ };
20
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
22
  size: number;
11
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
25
  declare const _default: typeof __VLS_export;
13
26
  export default _default;
27
+ type __VLS_WithSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -4,7 +4,8 @@ type __VLS_Props = {
4
4
  /**
5
5
  * Named semantic color ('primary' | 'error') OR any CSS color string
6
6
  * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).
7
- * When a CSS color is passed, --color-primary is overridden for this button.
7
+ * When a CSS color is passed, --color-primary is overridden for this button; its text is black or white by
8
+ * contrast for a hex color, white for any other form (set `contentColor` to choose).
8
9
  */
9
10
  color?: string;
10
11
  /** HTML button type */
@@ -9,6 +9,8 @@ type __VLS_Props = {
9
9
  side?: 'left' | 'right';
10
10
  /** Avatar name — shows an MAvatar with these initials (left-side only) */
11
11
  avatar?: string;
12
+ /** Photo for the avatar (left-side only); the initials of `avatar` show while it's missing or broken */
13
+ avatarSrc?: string;
12
14
  /** Message status icon next to the timestamp (right-side only) */
13
15
  status?: 'sent' | 'delivered' | 'read';
14
16
  /** Bubble color for sent (right-side) messages */
@@ -8,6 +8,8 @@ type __VLS_Props = {
8
8
  disabled?: boolean;
9
9
  /** Label text — overridden by the default slot when present */
10
10
  label?: string;
11
+ /** Supporting text under the label (M3 list-style two-line control); screen readers read it as the description */
12
+ description?: string;
11
13
  /** Checked/indeterminate color */
12
14
  color?: "primary" | "secondary" | "tertiary" | "error";
13
15
  /** Accessible name for the input when there's no visible label (e.g. a list row's checkbox). */
@@ -8,8 +8,14 @@ export interface DataTableColumn {
8
8
  minWidth?: string;
9
9
  align?: 'left' | 'center' | 'right';
10
10
  pinned?: 'left' | 'right';
11
+ /** Starts hidden; the column menu (`columnToggle`) can show it */
11
12
  hidden?: boolean;
12
13
  }
14
+ /** The table's sort: a column key and its direction, or `null` for the rows' own order */
15
+ export type DataTableSort = {
16
+ key: string;
17
+ dir: 'asc' | 'desc';
18
+ } | null;
13
19
  export interface DataTableGroup {
14
20
  key: string;
15
21
  label: string;
@@ -23,8 +29,24 @@ type __VLS_Props = {
23
29
  loading?: boolean;
24
30
  /** Text when no rows (defaults to the locale string) */
25
31
  emptyText?: string;
26
- /** Unique key field in each row */
27
- rowKey?: string;
32
+ /** Unique key of each row: a field name, or a function of the row (e.g. a composite key) */
33
+ rowKey?: string | ((row: Record<string, any>) => string | number);
34
+ /** Classes for a row: a string for every row, or a function of the row and its index on the page */
35
+ rowClass?: string | ((row: Record<string, any>, index: number) => string | string[] | Record<string, boolean> | undefined);
36
+ /** The table's caption, for screen readers (visually hidden): what the table lists */
37
+ caption?: string;
38
+ /**
39
+ * The sort (v-model:sort): pass it to control or persist it (URL, storage), leave it out and the table keeps its
40
+ * own
41
+ */
42
+ sort?: DataTableSort;
43
+ /** Keys of the expanded rows (v-model:expanded); the table keeps its own when left out */
44
+ expanded?: (string | number)[];
45
+ /**
46
+ * Keys of the hidden columns (v-model:hidden-columns), the ones unchecked in the column menu. Left out, the table
47
+ * keeps its own, starting from the columns marked `hidden`
48
+ */
49
+ hiddenColumns?: string[];
28
50
  /**
29
51
  * Enable row selection with checkboxes (by default only the checkbox toggles a row; clicking the row itself
30
52
  * still emits row-click)
@@ -115,14 +137,20 @@ declare const __VLS_template: () => {
115
137
  type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
116
138
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
117
139
  "update:modelValue": (args_0: Record<string, any>[]) => any;
140
+ "update:expanded": (args_0: (string | number)[]) => any;
118
141
  "update:page": (args_0: number) => any;
119
142
  rowClick: (args_0: Record<string, any>) => any;
120
143
  fetch: (args_0: DataTableFetchParams) => any;
144
+ "update:sort": (args_0: DataTableSort) => any;
145
+ "update:hiddenColumns": (args_0: string[]) => any;
121
146
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
122
147
  "onUpdate:modelValue"?: ((args_0: Record<string, any>[]) => any) | undefined;
148
+ "onUpdate:expanded"?: ((args_0: (string | number)[]) => any) | undefined;
123
149
  "onUpdate:page"?: ((args_0: number) => any) | undefined;
124
150
  onRowClick?: ((args_0: Record<string, any>) => any) | undefined;
125
151
  onFetch?: ((args_0: DataTableFetchParams) => any) | undefined;
152
+ "onUpdate:sort"?: ((args_0: DataTableSort) => any) | undefined;
153
+ "onUpdate:hiddenColumns"?: ((args_0: string[]) => any) | undefined;
126
154
  }>, {
127
155
  loading: boolean;
128
156
  modelValue: Record<string, any>[];
@@ -131,7 +159,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
131
159
  dense: boolean;
132
160
  perPage: number;
133
161
  total: number;
134
- rowKey: string;
162
+ rowKey: string | ((row: Record<string, any>) => string | number);
135
163
  checkboxes: "hover" | "always";
136
164
  selectOnRowClick: boolean;
137
165
  searchable: boolean;
@@ -333,9 +333,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
333
333
  maxZoom: number;
334
334
  selection: FlowSelection;
335
335
  fitView: boolean;
336
+ nodes: FlowNode<any>[];
336
337
  locked: boolean;
337
338
  direction: "horizontal" | "vertical";
338
- nodes: FlowNode<any>[];
339
339
  edges: FlowEdge<any>[];
340
340
  gridSize: number;
341
341
  snapToGrid: boolean;
@@ -1,4 +1,5 @@
1
1
  export interface HotkeyBinding {
2
+ /** A combination (`mod+k`) or a sequence separated by spaces (`g n`, `mod+k mod+s`) */
2
3
  keys: string;
3
4
  label: string;
4
5
  handler: () => void;
@@ -9,6 +9,12 @@ type __VLS_Props = {
9
9
  label?: string;
10
10
  /** Mirror the glyph in a right-to-left layout. By default, only the directional icons in `MIRRORED_ICONS` are */
11
11
  mirror?: boolean;
12
+ /** Stroke weight, the font's `wght` axis: 100 (thin) to 700 (bold); 400 is the default */
13
+ weight?: number;
14
+ /** Grade, the `GRAD` axis: -50 (lighter, for light icons on dark) to 200 (heavier, for emphasis); 0 is the default */
15
+ grade?: number;
16
+ /** Optical size, the `opsz` axis (20–48): the stroke tuned for that size. Defaults to follow `size` */
17
+ opticalSize?: number;
12
18
  };
13
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
20
  size: number;
@@ -24,6 +24,11 @@ type __VLS_Props = {
24
24
  shape?: 'rounded' | 'squared';
25
25
  /** M3's 5-tier icon button sizing (xs:32, sm:40, md:56, lg:96, xl:136), or a custom pixel value */
26
26
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
27
+ /**
28
+ * M3 Expressive width option (IconButtonDefaults' IconButtonWidthOption): `narrow` and `wide` keep the height and
29
+ * change only the width (sm: 32 / 40 / 52px). Ignored with a numeric size
30
+ */
31
+ width?: 'narrow' | 'default' | 'wide';
27
32
  /** Icon size in px. Default the size tier's (or 55% of a custom pixel `size`) */
28
33
  iconSize?: number;
29
34
  /** Disables interaction */
@@ -6,7 +6,7 @@ export interface KanbanColumn {
6
6
  id: string | number;
7
7
  title: string;
8
8
  cards: KanbanCard[];
9
- color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
9
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'warning';
10
10
  /** Optional WIP limit: the header shows count/limit and turns error-colored when exceeded. */
11
11
  limit?: number;
12
12
  }
@@ -0,0 +1,59 @@
1
+ import type { ItemLink } from '../composables/_useItemLink';
2
+ type __VLS_Props = {
3
+ /** A vue-router location: a RouterLink with vue-router, an `<a href>` (string only) without it */
4
+ to?: ItemLink;
5
+ /** A plain URL, always rendered as `<a href>` */
6
+ href?: string;
7
+ /**
8
+ * Whether it leads to another site. Detected from the URL (an absolute `http(s)` URL on another host); set it to
9
+ * override. External links get `rel="noopener noreferrer"` and, by default, a new tab and the `open_in_new` icon
10
+ */
11
+ external?: boolean;
12
+ /** Open in a new tab (`target="_blank"`, with `noopener`). Defaults to `true` for external links */
13
+ newTab?: boolean;
14
+ /** A file to download: `true`, or the file name to save it as. Shows the `download` icon */
15
+ download?: boolean | string;
16
+ /** Leading Material Symbol */
17
+ icon?: string;
18
+ /** Trailing Material Symbol; `false` hides the automatic `open_in_new` / `download` one */
19
+ trailingIcon?: string | false;
20
+ /** Text color: a color role, or `inherit` to take the surrounding text's color */
21
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'inherit';
22
+ /**
23
+ * `always` (default; links inside running text should be told apart by more than color), `hover`, or `none` for
24
+ * links that are already clearly links (a nav list, a footer)
25
+ */
26
+ underline?: 'always' | 'hover' | 'none';
27
+ /** Shows the text dimmed and turns the link off (no navigation, out of the tab order) */
28
+ disabled?: boolean;
29
+ /** With `to` and vue-router: replace the current history entry instead of adding one */
30
+ replace?: boolean;
31
+ };
32
+ declare const __VLS_template: () => {
33
+ __VLS_Slots: {
34
+ default?: (props: {}) => any;
35
+ };
36
+ };
37
+ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
38
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
+ click: (args_0: MouseEvent) => any;
40
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
41
+ onClick?: ((args_0: MouseEvent) => any) | undefined;
42
+ }>, {
43
+ color: "primary" | "secondary" | "tertiary" | "error" | "inherit";
44
+ replace: boolean;
45
+ underline: "none" | "hover" | "always";
46
+ disabled: boolean;
47
+ trailingIcon: string | false;
48
+ download: string | boolean;
49
+ external: boolean;
50
+ newTab: boolean;
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
53
+ declare const _default: typeof __VLS_export;
54
+ export default _default;
55
+ type __VLS_WithSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };
@@ -19,10 +19,12 @@ type __VLS_Props = {
19
19
  leading?: ListItemLeading;
20
20
  /** Name for the avatar (when leading='avatar') */
21
21
  avatarName?: string;
22
+ /** Photo for the avatar (when leading='avatar'); the initials of `avatarName` show while it's missing or broken */
23
+ avatarSrc?: string;
22
24
  /** Image URL (when leading='image') */
23
25
  image?: string;
24
26
  /** Icon container background color (when leading='icon-container') */
25
- iconContainerColor?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
27
+ iconContainerColor?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'warning';
26
28
  /** Trailing icon name */
27
29
  trailingIcon?: string;
28
30
  /** Trailing text label */
@@ -28,8 +28,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
28
28
  "onUpdate:expanded"?: ((args_0: boolean) => any) | undefined;
29
29
  }>, {
30
30
  animate: boolean;
31
- position: MapControlPosition;
32
31
  group: boolean;
32
+ position: MapControlPosition;
33
33
  expanded: boolean;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -11,7 +11,7 @@ export interface InboxNotification {
11
11
  /** An image URL instead of the icon */
12
12
  avatar?: string;
13
13
  /** The icon's color: a theme role */
14
- color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
14
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'warning';
15
15
  }
16
16
  type __VLS_Props = {
17
17
  /** The notifications (v-model) */
@@ -25,7 +25,7 @@ type __VLS_Props = {
25
25
  validateOn?: ValidateOn;
26
26
  /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
27
27
  validateDebounce?: number;
28
- /** The key of this field in its `MForm`'s values, errors and schema */
28
+ /** Native `name`; also the key of this field in its `MForm`'s values, errors and schema */
29
29
  name?: string;
30
30
  /** Hint text */
31
31
  hint?: string;
@@ -5,11 +5,24 @@ type __VLS_Props = {
5
5
  perPage: number;
6
6
  /** Total number of items */
7
7
  total: number;
8
+ /** `simple`: range label + previous/next. `pages`: the page numbers between previous and next */
9
+ variant?: 'simple' | 'pages';
10
+ /** With `pages`: how many pages show on each side of the current one before a gap (…) */
11
+ siblings?: number;
12
+ /** Adds first-page and last-page buttons at the ends */
13
+ showFirstLast?: boolean;
14
+ /** With `pages`: also show the range label (“1–10 of 25”) */
15
+ showRange?: boolean;
8
16
  };
9
17
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
18
  "update:page": (args_0: number) => any;
11
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
20
  "onUpdate:page"?: ((args_0: number) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ }>, {
22
+ variant: "pages" | "simple";
23
+ siblings: number;
24
+ showFirstLast: boolean;
25
+ showRange: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
27
  declare const _default: typeof __VLS_export;
15
28
  export default _default;
@@ -235,7 +235,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
235
235
  "onUpdate:annotations"?: ((args_0: import("./MPdfViewer.vue").PdfAnnotation[]) => any) | undefined;
236
236
  "onUpdate:sidebar"?: ((args_0: "outline" | "thumbnails" | null) => any) | undefined;
237
237
  "onAnnotation-click"?: ((args_0: import("./MPdfViewer.vue").PdfAnnotation) => any) | undefined;
238
- }>, "search" | "undo" | "pdf" | "goToPage" | "setZoom" | ("colors" | "rotation" | "page" | "minZoom" | "maxZoom" | "tool" | "src" | "toolbar" | "zoom" | "annotations" | "annotate" | "inkWidths" | "sidebar" | "downloadable")> & {
238
+ }>, "search" | "undo" | "goToPage" | "pdf" | "setZoom" | ("colors" | "rotation" | "page" | "minZoom" | "maxZoom" | "tool" | "src" | "toolbar" | "zoom" | "annotations" | "annotate" | "inkWidths" | "sidebar" | "downloadable")> & {
239
239
  pdf: import("../pdf.ts").PdfState;
240
240
  goToPage: (p: number) => void;
241
241
  setZoom: (z: import("./MPdfViewer.vue").PdfZoom) => void;
@@ -451,7 +451,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
451
451
  "onUpdate:annotations"?: ((args_0: import("./MPdfViewer.vue").PdfAnnotation[]) => any) | undefined;
452
452
  "onUpdate:sidebar"?: ((args_0: "outline" | "thumbnails" | null) => any) | undefined;
453
453
  "onAnnotation-click"?: ((args_0: import("./MPdfViewer.vue").PdfAnnotation) => any) | undefined;
454
- }>, "search" | "undo" | "pdf" | "goToPage" | "setZoom" | ("colors" | "rotation" | "page" | "minZoom" | "maxZoom" | "tool" | "src" | "toolbar" | "zoom" | "annotations" | "annotate" | "inkWidths" | "sidebar" | "downloadable")> & {
454
+ }>, "search" | "undo" | "goToPage" | "pdf" | "setZoom" | ("colors" | "rotation" | "page" | "minZoom" | "maxZoom" | "tool" | "src" | "toolbar" | "zoom" | "annotations" | "annotate" | "inkWidths" | "sidebar" | "downloadable")> & {
455
455
  pdf: import("../pdf.ts").PdfState;
456
456
  goToPage: (p: number) => void;
457
457
  setZoom: (z: import("./MPdfViewer.vue").PdfZoom) => void;
@@ -5,6 +5,8 @@ type __VLS_Props = {
5
5
  value: unknown;
6
6
  /** Text next to the radio. Clicking it selects the radio too. */
7
7
  label?: string;
8
+ /** Supporting text under the label (M3 list-style two-line control); screen readers read it as the description */
9
+ description?: string;
8
10
  /** Grays the radio out and ignores clicks. */
9
11
  disabled?: boolean;
10
12
  /** Color role of the selected radio. */
@@ -2,6 +2,8 @@ import type { ValidateOn, ValidationRule } from '../composables/validation';
2
2
  interface Option {
3
3
  label: string;
4
4
  value: unknown;
5
+ /** Supporting text under the option's label */
6
+ description?: string;
5
7
  disabled?: boolean;
6
8
  }
7
9
  type __VLS_Props = {