@m3ui-vue/m3ui-vue 1.8.0 → 1.9.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 (297) hide show
  1. package/dist/API.md +34 -19
  2. package/dist/MButton-LiZRRP4h.js +171 -0
  3. package/dist/MButton-LiZRRP4h.js.map +1 -0
  4. package/dist/{MColorPickerModal-H8nuX0Wu.js → MColorPickerModal-IjciC8zh.js} +185 -184
  5. package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
  6. package/dist/MDialog-BLpfgIA3.js +167 -0
  7. package/dist/MDialog-BLpfgIA3.js.map +1 -0
  8. package/dist/MIcon-BSsJZhK7.js +116 -0
  9. package/dist/MIcon-BSsJZhK7.js.map +1 -0
  10. package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
  11. package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
  12. package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
  13. package/dist/MListItem-BBQ-6i3v.js.map +1 -0
  14. package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
  15. package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
  16. package/dist/MMenuItem-E31tMzOt.js +577 -0
  17. package/dist/MMenuItem-E31tMzOt.js.map +1 -0
  18. package/dist/MPdfViewer-B5Q9Xs9d.js +1866 -0
  19. package/dist/MPdfViewer-B5Q9Xs9d.js.map +1 -0
  20. package/dist/MProgressBar-CPrZhQbA.js +179 -0
  21. package/dist/MProgressBar-CPrZhQbA.js.map +1 -0
  22. package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
  23. package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
  24. package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
  25. package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
  26. package/dist/MSignaturePad-Bqr-1R9f.js +140 -0
  27. package/dist/MSignaturePad-Bqr-1R9f.js.map +1 -0
  28. package/dist/MSlider-B7dIcHVn.js +745 -0
  29. package/dist/MSlider-B7dIcHVn.js.map +1 -0
  30. package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
  31. package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
  32. package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
  33. package/dist/MTextField-CryHMs8-.js.map +1 -0
  34. package/dist/MTooltip-Cn_DYm9M.js +90 -0
  35. package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
  36. package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
  37. package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
  38. package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
  39. package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
  40. package/dist/api.json +1 -1
  41. package/dist/code-editor.js +129 -128
  42. package/dist/code-editor.js.map +1 -1
  43. package/dist/components/MAddressField.vue.d.ts +1 -1
  44. package/dist/components/MAudioPlayer.vue.d.ts +1 -1
  45. package/dist/components/MAutocomplete.vue.d.ts +1 -1
  46. package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
  47. package/dist/components/MBadge.vue.d.ts +2 -2
  48. package/dist/components/MBar.vue.d.ts +1 -1
  49. package/dist/components/MBeforeAfter.vue.d.ts +3 -3
  50. package/dist/components/MButton.vue.d.ts +1 -1
  51. package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
  52. package/dist/components/MChatBubble.vue.d.ts +1 -1
  53. package/dist/components/MCodeEditor.vue.d.ts +1 -1
  54. package/dist/components/MContainerTransform.vue.d.ts +1 -1
  55. package/dist/components/MCopyButton.vue.d.ts +2 -2
  56. package/dist/components/MCountrySelect.vue.d.ts +1 -1
  57. package/dist/components/MCreditCardInput.vue.d.ts +2 -2
  58. package/dist/components/MDiffViewer.vue.d.ts +1 -1
  59. package/dist/components/MDrawCanvas.vue.d.ts +2 -2
  60. package/dist/components/MExpansionPanel.vue.d.ts +1 -1
  61. package/dist/components/MExportButton.vue.d.ts +1 -1
  62. package/dist/components/MFab.vue.d.ts +1 -1
  63. package/dist/components/MFilterBuilder.vue.d.ts +1 -1
  64. package/dist/components/MFlex.vue.d.ts +2 -2
  65. package/dist/components/MFloorPlan.vue.d.ts +2 -2
  66. package/dist/components/MFlow.vue.d.ts +2 -2
  67. package/dist/components/MFormRenderer.vue.d.ts +2 -2
  68. package/dist/components/MGantt.vue.d.ts +2 -2
  69. package/dist/components/MGanttControls.vue.d.ts +1 -1
  70. package/dist/components/MGrid.vue.d.ts +1 -1
  71. package/dist/components/MIcon.vue.d.ts +3 -5
  72. package/dist/components/MIconButton.vue.d.ts +1 -1
  73. package/dist/components/MLightbox.vue.d.ts +2 -2
  74. package/dist/components/MMapMeasure.vue.d.ts +2 -2
  75. package/dist/components/MMenu.vue.d.ts +6 -3
  76. package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
  77. package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
  78. package/dist/components/MMultiSelect.vue.d.ts +1 -1
  79. package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
  80. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  81. package/dist/components/MNumberField.vue.d.ts +1 -1
  82. package/dist/components/MOdontogram.vue.d.ts +2 -2
  83. package/dist/components/MPdfSigner.vue.d.ts +1 -1
  84. package/dist/components/MPhoneInput.vue.d.ts +2 -2
  85. package/dist/components/MPinInput.vue.d.ts +3 -3
  86. package/dist/components/MPosKeypad.vue.d.ts +1 -1
  87. package/dist/components/MProductConfigurator.vue.d.ts +1 -1
  88. package/dist/components/MResourceTimeline.vue.d.ts +2 -2
  89. package/dist/components/MRichTextEditor.vue.d.ts +1 -1
  90. package/dist/components/MScheme.vue.d.ts +1 -1
  91. package/dist/components/MSearchBar.vue.d.ts +2 -2
  92. package/dist/components/MSearchField.vue.d.ts +1 -1
  93. package/dist/components/MSeatMap.vue.d.ts +1 -1
  94. package/dist/components/MSeekBar.vue.d.ts +2 -2
  95. package/dist/components/MSelect.vue.d.ts +1 -1
  96. package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
  97. package/dist/components/MSkeleton.vue.d.ts +1 -1
  98. package/dist/components/MSpreadsheet.vue.d.ts +2 -2
  99. package/dist/components/MStack.vue.d.ts +2 -2
  100. package/dist/components/MSubtitle.vue.d.ts +1 -1
  101. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  102. package/dist/components/MSwitch.vue.d.ts +1 -1
  103. package/dist/components/MTagInput.vue.d.ts +1 -1
  104. package/dist/components/MText.vue.d.ts +1 -1
  105. package/dist/components/MTextField.vue.d.ts +3 -3
  106. package/dist/components/MTimeScroll.vue.d.ts +1 -1
  107. package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
  108. package/dist/components/MTitle.vue.d.ts +1 -1
  109. package/dist/components/MToolbar.vue.d.ts +1 -1
  110. package/dist/components/MTooltip.vue.d.ts +1 -1
  111. package/dist/components/MTopAppBar.vue.d.ts +2 -2
  112. package/dist/components/MVitalsChart.vue.d.ts +1 -1
  113. package/dist/components/MWindow.vue.d.ts +3 -3
  114. package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
  115. package/dist/composables/_fieldLayout.d.ts +8 -8
  116. package/dist/composables/_popupPosition.d.ts +3 -2
  117. package/dist/composables/_rtl.d.ts +26 -0
  118. package/dist/composables/useColorPalette.d.ts +1 -1
  119. package/dist/composables/useLocale.d.ts +4 -0
  120. package/dist/draw.js +5 -5
  121. package/dist/flow.js +2 -2
  122. package/dist/gantt.js +3 -3
  123. package/dist/locales/ar.d.ts +6 -0
  124. package/dist/locales/index.d.ts +1 -0
  125. package/dist/locales/index.js +768 -1
  126. package/dist/locales/index.js.map +1 -1
  127. package/dist/m3ui-vue.css +1 -1
  128. package/dist/m3ui.js +11962 -12039
  129. package/dist/m3ui.js.map +1 -1
  130. package/dist/map.js +1127 -1149
  131. package/dist/map.js.map +1 -1
  132. package/dist/markdown.js +1 -1
  133. package/dist/markdown.js.map +1 -1
  134. package/dist/media.js +7 -7
  135. package/dist/pdf-sign.d.ts +3 -0
  136. package/dist/pdf-sign.js +548 -0
  137. package/dist/pdf-sign.js.map +1 -0
  138. package/dist/pdf.d.ts +0 -3
  139. package/dist/pdf.js +1 -2400
  140. package/dist/plugin.d.ts +8 -0
  141. package/dist/rich-text-editor.js +79 -77
  142. package/dist/rich-text-editor.js.map +1 -1
  143. package/dist/styles/theme.css +13 -0
  144. package/dist/styles.css +1 -1
  145. package/dist/terminal.js +5 -2
  146. package/dist/terminal.js.map +1 -1
  147. package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
  148. package/dist/useLocale-ybIju59R.js.map +1 -0
  149. package/dist/vTooltip-xESB2YOb.js +154 -0
  150. package/dist/vTooltip-xESB2YOb.js.map +1 -0
  151. package/package.json +5 -1
  152. package/src/__tests__/MAddressField.test.ts +1 -1
  153. package/src/__tests__/MChip.test.ts +3 -3
  154. package/src/__tests__/MFab.test.ts +6 -6
  155. package/src/__tests__/MListItemNestedControl.test.ts +2 -2
  156. package/src/__tests__/MScheduler.test.ts +1 -1
  157. package/src/__tests__/MTrackingTimeline.test.ts +1 -1
  158. package/src/__tests__/MWindow.test.ts +16 -0
  159. package/src/__tests__/fieldOverflow.test.ts +9 -9
  160. package/src/__tests__/hydration.test.ts +39 -0
  161. package/src/__tests__/localePresets.test.ts +2 -0
  162. package/src/__tests__/rtl.test.ts +167 -0
  163. package/src/__tests__/ssr.test.ts +6 -0
  164. package/src/components/MAlert.vue +1 -1
  165. package/src/components/MAutocomplete.vue +7 -7
  166. package/src/components/MAvailabilityCalendar.vue +5 -3
  167. package/src/components/MBadge.vue +12 -3
  168. package/src/components/MBar.vue +1 -1
  169. package/src/components/MBottomAppBar.vue +1 -1
  170. package/src/components/MCalendar.vue +3 -3
  171. package/src/components/MCalendarHeatmap.vue +3 -3
  172. package/src/components/MChatBubble.vue +3 -3
  173. package/src/components/MChip.vue +6 -6
  174. package/src/components/MCodeEditor.vue +7 -3
  175. package/src/components/MColorPicker.vue +1 -1
  176. package/src/components/MCommandPalette.vue +1 -1
  177. package/src/components/MContainerTransform.vue +1 -1
  178. package/src/components/MContextMenu.vue +1 -1
  179. package/src/components/MDataTable.vue +5 -5
  180. package/src/components/MDatePicker.vue +3 -2
  181. package/src/components/MDateRangePicker.vue +3 -2
  182. package/src/components/MDialog.vue +5 -5
  183. package/src/components/MDiffViewer.vue +1 -1
  184. package/src/components/MDivider.vue +1 -1
  185. package/src/components/MDragDropList.vue +1 -1
  186. package/src/components/MEmojiSelector.vue +11 -7
  187. package/src/components/MExpansionPanel.vue +1 -1
  188. package/src/components/MFab.vue +5 -5
  189. package/src/components/MFormBuilder.vue +3 -3
  190. package/src/components/MIcon.vue +14 -2
  191. package/src/components/MJsonEditor.vue +1 -3
  192. package/src/components/MJsonViewer.vue +1 -1
  193. package/src/components/MKanban.vue +2 -1
  194. package/src/components/MListDetail.vue +2 -2
  195. package/src/components/MListGroup.vue +1 -1
  196. package/src/components/MListItem.vue +5 -5
  197. package/src/components/MListSubheader.vue +1 -1
  198. package/src/components/MMapDraw.vue +3 -2
  199. package/src/components/MMapHover.vue +2 -1
  200. package/src/components/MMapMeasure.vue +2 -1
  201. package/src/components/MMapRoute.vue +2 -1
  202. package/src/components/MMarkdown.vue +9 -6
  203. package/src/components/MMaskField.vue +6 -6
  204. package/src/components/MMenu.vue +13 -6
  205. package/src/components/MMenuItem.vue +8 -6
  206. package/src/components/MMultiAutocomplete.vue +9 -8
  207. package/src/components/MMultiSelect.vue +9 -8
  208. package/src/components/MNavigationDrawer.vue +39 -27
  209. package/src/components/MNavigationRail.vue +28 -19
  210. package/src/components/MNavigationSuite.vue +1 -1
  211. package/src/components/MNotificationCenter.vue +1 -1
  212. package/src/components/MNotificationHost.vue +1 -1
  213. package/src/components/MNumberField.vue +6 -6
  214. package/src/components/MOrderTicket.vue +1 -1
  215. package/src/components/MPageProgress.vue +1 -1
  216. package/src/components/MPdfSigner.vue +1 -1
  217. package/src/components/MPhoneInput.vue +5 -4
  218. package/src/components/MPinInput.vue +3 -2
  219. package/src/components/MPosKeypad.vue +2 -1
  220. package/src/components/MProductConfigurator.vue +2 -1
  221. package/src/components/MProgressBar.vue +2 -2
  222. package/src/components/MRichTextEditor.vue +8 -4
  223. package/src/components/MScheduler.vue +14 -14
  224. package/src/components/MSearchField.vue +1 -1
  225. package/src/components/MSeatMap.vue +2 -1
  226. package/src/components/MSegmentedButton.vue +1 -1
  227. package/src/components/MSelect.vue +7 -7
  228. package/src/components/MSideSheet.vue +3 -2
  229. package/src/components/MSimpleCarousel.vue +20 -11
  230. package/src/components/MSlider.vue +15 -5
  231. package/src/components/MSnackbar.vue +2 -2
  232. package/src/components/MSplitButton.vue +3 -2
  233. package/src/components/MSplitter.vue +6 -3
  234. package/src/components/MSpotlightSearch.vue +1 -1
  235. package/src/components/MSwitch.vue +5 -5
  236. package/src/components/MTable.vue +3 -3
  237. package/src/components/MTabs.vue +4 -1
  238. package/src/components/MTagInput.vue +6 -6
  239. package/src/components/MTerminal.vue +1 -1
  240. package/src/components/MText.vue +1 -1
  241. package/src/components/MTextField.vue +7 -7
  242. package/src/components/MTimePicker.vue +3 -2
  243. package/src/components/MTimePickerModal.vue +2 -2
  244. package/src/components/MTimeScroll.vue +1 -1
  245. package/src/components/MTimeline.vue +12 -12
  246. package/src/components/MToolbar.vue +3 -3
  247. package/src/components/MTrackingTimeline.vue +3 -2
  248. package/src/components/MTransition.vue +8 -3
  249. package/src/components/MTreeTable.vue +1 -1
  250. package/src/components/MTypewriter.vue +1 -1
  251. package/src/components/MVirtualTable.vue +2 -2
  252. package/src/components/MWindow.vue +4 -3
  253. package/src/components/_MColorPanel.vue +5 -4
  254. package/src/components/_MDrawerItemList.vue +9 -5
  255. package/src/components/_MMapAttribution.vue +2 -1
  256. package/src/components/_MMonthYearButton.vue +1 -1
  257. package/src/components/_MTransferPane.vue +8 -1
  258. package/src/components/_MTreeNode.vue +3 -3
  259. package/src/components/_MYearGrid.vue +4 -2
  260. package/src/composables/_fieldLayout.ts +19 -19
  261. package/src/composables/_popupPosition.ts +5 -3
  262. package/src/composables/_rtl.ts +76 -0
  263. package/src/composables/_useMenuNav.ts +24 -17
  264. package/src/composables/_useSheetMotion.ts +10 -3
  265. package/src/composables/pdfSign.ts +2 -2
  266. package/src/composables/useLocale.ts +6 -0
  267. package/src/locales/ar.ts +798 -0
  268. package/src/locales/de.ts +2 -0
  269. package/src/locales/es.ts +2 -0
  270. package/src/locales/fr.ts +2 -0
  271. package/src/locales/index.ts +1 -0
  272. package/src/locales/ja.ts +2 -0
  273. package/src/locales/ko.ts +2 -0
  274. package/src/locales/pt.ts +2 -0
  275. package/src/locales/zh.ts +2 -0
  276. package/src/pdf-sign.ts +5 -0
  277. package/src/pdf.ts +0 -3
  278. package/src/plugin.ts +10 -0
  279. package/src/styles/theme.css +13 -0
  280. package/dist/MColorPickerModal-H8nuX0Wu.js.map +0 -1
  281. package/dist/MDialog-B42Mhn8W.js +0 -331
  282. package/dist/MDialog-B42Mhn8W.js.map +0 -1
  283. package/dist/MIcon-DpajuUTJ.js +0 -33
  284. package/dist/MIcon-DpajuUTJ.js.map +0 -1
  285. package/dist/MListItem-DiOAxaN7.js.map +0 -1
  286. package/dist/MMenuItem-BuxYoASE.js +0 -574
  287. package/dist/MMenuItem-BuxYoASE.js.map +0 -1
  288. package/dist/MSignaturePad-BTqGaPXA.js +0 -313
  289. package/dist/MSignaturePad-BTqGaPXA.js.map +0 -1
  290. package/dist/MSlider-D_O8J9YH.js +0 -739
  291. package/dist/MSlider-D_O8J9YH.js.map +0 -1
  292. package/dist/MTextField-CYk9yFvi.js.map +0 -1
  293. package/dist/MTooltip-CK39Zon4.js +0 -183
  294. package/dist/MTooltip-CK39Zon4.js.map +0 -1
  295. package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
  296. package/dist/pdf.js.map +0 -1
  297. package/dist/useLocale-DL96OFgr.js.map +0 -1
@@ -1,13 +1,14 @@
1
- import { n as e, r as t, t as n } from "./_useFieldValidation-B0B44M_t.js";
2
- import { t as r } from "./MIcon-DpajuUTJ.js";
3
- import { t as i } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
4
- import { i as a } from "./useLocale-DL96OFgr.js";
5
- import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, provide as x, ref as S, renderSlot as C, toDisplayString as w, unref as T, watch as E, withCtx as D } from "vue";
1
+ import { n as e, r as t, t as n } from "./_useFieldValidation-CvZnZfl-.js";
2
+ import { t as r } from "./MIcon-BSsJZhK7.js";
3
+ import { t as i } from "./vTooltip-xESB2YOb.js";
4
+ import { i as a } from "./useLocale-ybIju59R.js";
5
+ import { t as o } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
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";
6
7
  // src/components/MCodeEditor.vue?vue&type=script&setup=true&lang.ts
7
- var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2" }, A = { class: "text-label-medium text-on-surface-variant" }, j = { class: "flex items-center gap-2" }, M = ["title"], N = {
8
+ var A = ["aria-invalid", "aria-describedby"], j = { class: "flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2" }, M = { class: "text-label-medium text-on-surface-variant" }, N = { class: "flex items-center gap-2" }, P = ["aria-label"], F = {
8
9
  key: 0,
9
10
  class: "text-primary"
10
- }, P = ["id"], F = /*#__PURE__*/ i(/* @__PURE__ */ p({
11
+ }, I = ["id"], L = /*#__PURE__*/ o(/* @__PURE__ */ m({
11
12
  inheritAttrs: !1,
12
13
  __name: "MCodeEditor",
13
14
  props: {
@@ -38,31 +39,31 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
38
39
  }
39
40
  },
40
41
  emits: ["update:modelValue", "blur"],
41
- setup(n, { expose: i, emit: a }) {
42
- let d = n, p = a, m = S(null), x = null, D = S(null), F = e({
43
- value: () => d.modelValue,
44
- rules: () => d.rules,
45
- required: () => d.required,
46
- error: () => d.error,
47
- errorLabel: () => d.errorLabel,
48
- name: () => d.name,
49
- validateOn: () => d.validateOn,
50
- validateDebounce: () => d.validateDebounce,
51
- disabled: () => d.readonly,
42
+ setup(n, { expose: o, emit: f }) {
43
+ let m = n, h = f, S = C(null), O = null, L = C(null), R = e({
44
+ value: () => m.modelValue,
45
+ rules: () => m.rules,
46
+ required: () => m.required,
47
+ error: () => m.error,
48
+ errorLabel: () => m.errorLabel,
49
+ name: () => m.name,
50
+ validateOn: () => m.validateOn,
51
+ validateDebounce: () => m.validateDebounce,
52
+ disabled: () => m.readonly,
52
53
  focus: () => {
53
- x?.focus();
54
+ O?.focus();
54
55
  },
55
- el: () => D.value,
56
- setValue: (e) => p("update:modelValue", e)
57
- }), { hasError: I, message: L, messageId: R } = F, z = t(() => D.value, () => {
58
- F.onBlur(), p("blur");
59
- }), B = null, V = S(!1);
60
- async function H() {
61
- await navigator.clipboard.writeText(d.modelValue), V.value = !0, setTimeout(() => {
62
- V.value = !1;
56
+ el: () => L.value,
57
+ setValue: (e) => h("update:modelValue", e)
58
+ }), { hasError: z, message: B, messageId: V } = R, H = t(() => L.value, () => {
59
+ R.onBlur(), h("blur");
60
+ }), U = null, W = a(), G = C(!1);
61
+ async function K() {
62
+ await navigator.clipboard.writeText(m.modelValue), G.value = !0, setTimeout(() => {
63
+ G.value = !1;
63
64
  }, 1500);
64
65
  }
65
- let U = s(() => ({
66
+ let q = c(() => ({
66
67
  javascript: "JavaScript",
67
68
  typescript: "TypeScript",
68
69
  json: "JSON",
@@ -75,9 +76,9 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
75
76
  rust: "Rust",
76
77
  asm: "Assembly",
77
78
  plain: "Texto"
78
- })[d.language]);
79
- async function W() {
80
- if (B) return B;
79
+ })[m.language]);
80
+ async function J() {
81
+ if (U) return U;
81
82
  let [e, t, n, r, i, a, o, s, c, l, u, d, f, p, m] = await Promise.all([
82
83
  import("@codemirror/view"),
83
84
  import("@codemirror/state"),
@@ -95,7 +96,7 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
95
96
  import("@codemirror/lang-rust"),
96
97
  import("@codemirror/legacy-modes/mode/gas")
97
98
  ]);
98
- return B = {
99
+ return U = {
99
100
  viewMod: e,
100
101
  stateMod: t,
101
102
  commandsMod: n,
@@ -111,9 +112,9 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
111
112
  cppMod: f,
112
113
  rustMod: p,
113
114
  asmMod: m
114
- }, B;
115
+ }, U;
115
116
  }
116
- function G(e, t) {
117
+ function Y(e, t) {
117
118
  return e.HighlightStyle.define([
118
119
  {
119
120
  tag: t.keyword,
@@ -248,8 +249,8 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
248
249
  }
249
250
  ]);
250
251
  }
251
- function K(e) {
252
- switch (d.language) {
252
+ function X(e) {
253
+ switch (m.language) {
253
254
  case "javascript": return e.jsMod.javascript();
254
255
  case "typescript": return e.jsMod.javascript({ typescript: !0 });
255
256
  case "json": return e.jsonMod.json();
@@ -264,8 +265,8 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
264
265
  default: return [];
265
266
  }
266
267
  }
267
- function q(e) {
268
- let { viewMod: t, stateMod: n, commandsMod: r, languageMod: i, highlightMod: a, oneDarkMod: o } = e, s = G(i, a.tags), c = [
268
+ function Z(e) {
269
+ let { viewMod: t, stateMod: n, commandsMod: r, languageMod: i, highlightMod: a, oneDarkMod: o } = e, s = Y(i, a.tags), c = [
269
270
  t.keymap.of([
270
271
  ...r.defaultKeymap,
271
272
  ...r.historyKeymap,
@@ -280,77 +281,78 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
280
281
  t.highlightActiveLineGutter(),
281
282
  i.syntaxHighlighting(s),
282
283
  i.syntaxHighlighting(i.defaultHighlightStyle, { fallback: !0 }),
283
- K(e),
284
+ X(e),
284
285
  t.EditorView.updateListener.of((e) => {
285
- e.docChanged && p("update:modelValue", e.state.doc.toString());
286
+ e.docChanged && h("update:modelValue", e.state.doc.toString());
286
287
  }),
287
- n.EditorState.readOnly.of(d.readonly)
288
+ n.EditorState.readOnly.of(m.readonly)
288
289
  ];
289
- return d.wrap && c.push(t.EditorView.lineWrapping), d.lineNumbers && c.push(t.lineNumbers()), d.theme === "dark" && c.push(o.oneDark), d.placeholder && c.push(t.placeholder(d.placeholder)), c;
290
+ return m.wrap && c.push(t.EditorView.lineWrapping), m.lineNumbers && c.push(t.lineNumbers()), m.theme === "dark" && c.push(o.oneDark), m.placeholder && c.push(t.placeholder(m.placeholder)), c;
290
291
  }
291
- async function J() {
292
- if (!m.value) return;
293
- let e = await W(), { viewMod: t, stateMod: n } = e;
294
- x?.destroy(), x = new t.EditorView({
292
+ async function Q() {
293
+ if (!S.value) return;
294
+ let e = await J(), { viewMod: t, stateMod: n } = e;
295
+ O?.destroy(), O = new t.EditorView({
295
296
  state: n.EditorState.create({
296
- doc: d.modelValue,
297
- extensions: q(e)
297
+ doc: m.modelValue,
298
+ extensions: Z(e)
298
299
  }),
299
- parent: m.value
300
+ parent: S.value
300
301
  });
301
302
  }
302
- return y(J), E(() => d.modelValue, (e) => {
303
- x && x.state.doc.toString() !== e && x.dispatch({ changes: {
303
+ return b(Q), D(() => m.modelValue, (e) => {
304
+ O && O.state.doc.toString() !== e && O.dispatch({ changes: {
304
305
  from: 0,
305
- to: x.state.doc.length,
306
+ to: O.state.doc.length,
306
307
  insert: e
307
308
  } });
308
- }), E([
309
- () => d.language,
310
- () => d.theme,
311
- () => d.readonly,
312
- () => d.lineNumbers,
313
- () => d.wrap,
314
- () => d.placeholder
315
- ], J), v(() => x?.destroy()), i({
316
- validate: F.validate,
317
- resetValidation: F.resetValidation
318
- }), (e, t) => (b(), l(o, null, [u("div", h({
309
+ }), D([
310
+ () => m.language,
311
+ () => m.theme,
312
+ () => m.readonly,
313
+ () => m.lineNumbers,
314
+ () => m.wrap,
315
+ () => m.placeholder
316
+ ], Q), y(() => O?.destroy()), o({
317
+ validate: R.validate,
318
+ resetValidation: R.resetValidation
319
+ }), (e, t) => (x(), u(s, null, [d("div", g({
320
+ dir: "ltr",
319
321
  ref_key: "rootEl",
320
- ref: D
322
+ ref: L
321
323
  }, e.$attrs, {
322
- class: ["flex flex-col overflow-hidden rounded-lg border", T(I) ? "border-error" : "border-outline-variant"],
323
- "aria-invalid": T(I) || void 0,
324
- "aria-describedby": T(L) ? T(R) : void 0,
325
- onFocusout: t[0] ||= (...e) => T(z) && T(z)(...e)
326
- }), [u("div", k, [u("span", A, w(U.value), 1), u("div", j, [C(e.$slots, "actions", {}, void 0, !0), u("button", {
324
+ class: ["flex flex-col overflow-hidden rounded-lg border", E(z) ? "border-error" : "border-outline-variant"],
325
+ "aria-invalid": E(z) || void 0,
326
+ "aria-describedby": E(B) ? E(V) : void 0,
327
+ onFocusout: t[0] ||= (...e) => E(H) && E(H)(...e)
328
+ }), [d("div", j, [d("span", M, T(q.value), 1), d("div", N, [w(e.$slots, "actions", {}, void 0, !0), k((x(), u("button", {
327
329
  type: "button",
328
330
  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",
329
- title: V.value ? "Copied!" : "Copy code",
330
- onClick: H
331
- }, [f(r, {
332
- name: V.value ? "check" : "content_copy",
331
+ "aria-label": G.value ? E(W).codeCopied : E(W).codeCopy,
332
+ onClick: K
333
+ }, [p(r, {
334
+ name: G.value ? "check" : "content_copy",
333
335
  size: 16,
334
- class: g(V.value ? "text-primary" : "")
335
- }, null, 8, ["name", "class"]), V.value ? (b(), l("span", N, "Copied")) : c("", !0)], 8, M)])]), u("div", {
336
+ class: _(G.value ? "text-primary" : "")
337
+ }, null, 8, ["name", "class"]), G.value ? (x(), u("span", F, T(E(W).codeCopied), 1)) : l("", !0)], 8, P)), [[E(i), G.value ? void 0 : E(W).codeCopy]])])]), d("div", {
336
338
  ref_key: "containerRef",
337
- ref: m,
339
+ ref: S,
338
340
  class: "code-editor-container overflow-auto bg-surface text-on-surface",
339
- style: _({
341
+ style: v({
340
342
  minHeight: n.minHeight,
341
343
  maxHeight: n.maxHeight
342
344
  })
343
- }, null, 4)], 16, O), T(L) ? (b(), l("p", {
345
+ }, null, 4)], 16, A), E(B) ? (x(), u("p", {
344
346
  key: 0,
345
- id: T(R),
347
+ id: E(V),
346
348
  role: "alert",
347
349
  class: "mt-1 px-4 text-body-small text-error"
348
- }, w(T(L)), 9, P)) : c("", !0)], 64));
350
+ }, T(E(B)), 9, I)) : l("", !0)], 64));
349
351
  }
350
- }), [["__scopeId", "data-v-99aeb6f7"]]), I = { class: "flex items-center gap-2" }, L = ["title"], R = ["title"], z = {
352
+ }), [["__scopeId", "data-v-2bbb70b3"]]), R = { class: "flex items-center gap-2" }, z = {
351
353
  key: 0,
352
354
  class: "px-3 py-1.5 text-body-small text-error"
353
- }, B = ["id"], V = /* @__PURE__ */ p({
355
+ }, B = ["id"], V = /* @__PURE__ */ m({
354
356
  __name: "MJsonEditor",
355
357
  props: {
356
358
  modelValue: {},
@@ -370,17 +372,17 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
370
372
  labels: {}
371
373
  },
372
374
  emits: ["update:modelValue", "blur"],
373
- setup(i, { expose: o, emit: p }) {
374
- let h = a(), _ = !!m(n, null), v = i, y = s(() => ({
375
- valid: h.jsonValid,
376
- invalid: h.jsonInvalid,
377
- format: h.jsonFormat,
378
- minify: h.jsonMinify,
375
+ setup(i, { expose: o, emit: s }) {
376
+ let m = a(), g = !!h(n, null), v = i, y = c(() => ({
377
+ valid: m.jsonValid,
378
+ invalid: m.jsonInvalid,
379
+ format: m.jsonFormat,
380
+ minify: m.jsonMinify,
379
381
  ...v.labels
380
- })), C = p, O = S(JSON.stringify(v.modelValue, null, 2)), k = S(null), A = s(() => !k.value), j = () => !k.value || y.value.invalid, M = S(null), N = e({
382
+ })), b = s, w = C(JSON.stringify(v.modelValue, null, 2)), k = C(null), A = c(() => !k.value), j = () => !k.value || y.value.invalid, M = C(null), N = e({
381
383
  value: () => v.modelValue,
382
384
  rules: () => [...v.rules ? Array.isArray(v.rules) ? v.rules : [v.rules] : [], j],
383
- required: () => v.required && (_ || !!v.rules),
385
+ required: () => v.required && (g || !!v.rules),
384
386
  error: () => v.error,
385
387
  errorLabel: () => v.errorLabel,
386
388
  name: () => v.name,
@@ -391,82 +393,81 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
391
393
  M.value?.querySelector(".cm-content")?.focus();
392
394
  },
393
395
  el: () => M.value,
394
- setValue: (e) => C("update:modelValue", e)
395
- }), { hasError: P, message: V, messageId: H } = N, U = t(() => M.value, () => {
396
- N.onBlur(), C("blur");
396
+ setValue: (e) => b("update:modelValue", e)
397
+ }), { hasError: P, message: F, messageId: I } = N, V = t(() => M.value, () => {
398
+ N.onBlur(), b("blur");
397
399
  });
398
- x(n, null), E(() => v.modelValue, (e) => {
400
+ S(n, null), D(() => v.modelValue, (e) => {
399
401
  let t;
400
402
  try {
401
- t = JSON.parse(O.value);
403
+ t = JSON.parse(w.value);
402
404
  } catch {
403
405
  t = void 0;
404
406
  }
405
- JSON.stringify(t) !== JSON.stringify(e) && (O.value = JSON.stringify(e, null, 2), k.value = null);
407
+ JSON.stringify(t) !== JSON.stringify(e) && (w.value = JSON.stringify(e, null, 2), k.value = null);
406
408
  });
407
- function W(e) {
408
- O.value = e;
409
+ function H(e) {
410
+ w.value = e;
409
411
  try {
410
412
  let t = JSON.parse(e);
411
- k.value = null, C("update:modelValue", t);
413
+ k.value = null, b("update:modelValue", t);
412
414
  } catch (e) {
413
415
  k.value = e.message;
414
416
  }
415
417
  }
416
- function G() {
418
+ function U() {
417
419
  try {
418
- let e = JSON.parse(O.value);
419
- O.value = JSON.stringify(e, null, 2), k.value = null, C("update:modelValue", e);
420
+ let e = JSON.parse(w.value);
421
+ w.value = JSON.stringify(e, null, 2), k.value = null, b("update:modelValue", e);
420
422
  } catch {}
421
423
  }
422
- function K() {
424
+ function W() {
423
425
  try {
424
- let e = JSON.parse(O.value);
425
- O.value = JSON.stringify(e), k.value = null, C("update:modelValue", e);
426
+ let e = JSON.parse(w.value);
427
+ w.value = JSON.stringify(e), k.value = null, b("update:modelValue", e);
426
428
  } catch {}
427
429
  }
428
430
  return o({
429
431
  validate: N.validate,
430
432
  resetValidation: N.resetValidation
431
- }), (e, t) => (b(), l("div", {
433
+ }), (e, t) => (x(), u("div", {
432
434
  ref_key: "rootEl",
433
435
  ref: M,
436
+ dir: "ltr",
434
437
  class: "flex flex-col gap-0",
435
- onFocusout: t[0] ||= (...e) => T(U) && T(U)(...e)
436
- }, [f(F, {
437
- "model-value": O.value,
438
+ onFocusout: t[0] ||= (...e) => E(V) && E(V)(...e)
439
+ }, [p(L, {
440
+ "model-value": w.value,
438
441
  language: "json",
439
- error: T(P) && !k.value,
442
+ error: E(P) && !k.value,
440
443
  readonly: i.readonly,
441
444
  "min-height": i.minHeight,
442
445
  "max-height": i.maxHeight,
443
- "onUpdate:modelValue": W
446
+ "onUpdate:modelValue": H
444
447
  }, {
445
- actions: D(() => [u("div", I, [
446
- u("span", { class: g(["flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small", A.value ? "bg-success-container text-on-success-container" : "bg-error-container text-on-error-container"]) }, [f(r, {
448
+ actions: O(() => [d("div", R, [
449
+ d("span", { class: _(["flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small", A.value ? "bg-success-container text-on-success-container" : "bg-error-container text-on-error-container"]) }, [p(r, {
447
450
  name: A.value ? "check_circle" : "error",
448
451
  size: 14
449
- }, null, 8, ["name"]), d(" " + w(A.value ? y.value.valid : y.value.invalid), 1)], 2),
450
- i.readonly ? c("", !0) : (b(), l("button", {
452
+ }, null, 8, ["name"]), f(" " + T(A.value ? y.value.valid : y.value.invalid), 1)], 2),
453
+ i.readonly ? l("", !0) : (x(), u("button", {
451
454
  key: 0,
452
455
  type: "button",
453
- title: y.value.format,
454
456
  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",
455
- onClick: G
456
- }, [f(r, {
457
+ onClick: U
458
+ }, [p(r, {
457
459
  name: "format_indent_increase",
458
460
  size: 16
459
- }), d(" " + w(y.value.format), 1)], 8, L)),
460
- i.readonly ? c("", !0) : (b(), l("button", {
461
+ }), f(" " + T(y.value.format), 1)])),
462
+ i.readonly ? l("", !0) : (x(), u("button", {
461
463
  key: 1,
462
464
  type: "button",
463
- title: y.value.minify,
464
465
  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",
465
- onClick: K
466
- }, [f(r, {
466
+ onClick: W
467
+ }, [p(r, {
467
468
  name: "compress",
468
469
  size: 16
469
- }), d(" " + w(y.value.minify), 1)], 8, R))
470
+ }), f(" " + T(y.value.minify), 1)]))
470
471
  ])]),
471
472
  _: 1
472
473
  }, 8, [
@@ -475,14 +476,14 @@ var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center ju
475
476
  "readonly",
476
477
  "min-height",
477
478
  "max-height"
478
- ]), k.value ? (b(), l("p", z, w(k.value), 1)) : T(V) ? (b(), l("p", {
479
+ ]), k.value ? (x(), u("p", z, T(k.value), 1)) : E(F) ? (x(), u("p", {
479
480
  key: 1,
480
- id: T(H),
481
+ id: E(I),
481
482
  role: "alert",
482
483
  class: "px-3 py-1.5 text-body-small text-error"
483
- }, w(T(V)), 9, B)) : c("", !0)], 544));
484
+ }, T(E(F)), 9, B)) : l("", !0)], 544));
484
485
  }
485
486
  });
486
- export { F as MCodeEditor, V as MJsonEditor };
487
+ export { L as MCodeEditor, V as MJsonEditor };
487
488
 
488
489
  //# sourceMappingURL=code-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"code-editor.js","names":["$attrs","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","_unref","_toDisplayString","_renderSlot","_createVNode","MIcon","_normalizeClass","_normalizeStyle","_openBlock","_createElementBlock","_unref","_createVNode","MCodeEditor","_withCtx","_createElementVNode","_normalizeClass","MIcon","_createTextVNode","_toDisplayString","useFieldValidation","useFocusLeave","FORM_KEY","MIcon_default","_plugin_vue_export_helper_default","useLocale","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5$1","_hoisted_6","_hoisted_7","MCodeEditor_default","defineComponent","__expose","__emit","props","__props","emit","containerRef","ref","view","rootEl","validation","v","errorMessage","onFocusOut","cmModules","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","createVNode","normalizeClass","createCommentVNode","normalizeStyle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","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'\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 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\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 :title=\"copied ? 'Copied!' : 'Copy code'\"\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\">Copied</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\" 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 :title=\"l.format\"\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 :title=\"l.minify\"\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,IAAM2C,IAAQC,GAiDRC,IAAOH,GAEPI,IAAeC,EAAwB,IAAI,GAC7CC,IAAY,MACVC,IAASF,EAAwB,IAAI,GAErCG,IAAaxB,EAAmB;GACpC,aAAaiB,EAAM;GACnB,aAAaA,EAAM;GACnB,gBAAgBA,EAA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AAA,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","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,G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Update:modelValue"?: ((place: MapSearchResult | null) => any) | undefined;
60
60
  }>, {
61
- modelValue: MapSearchResult | null;
62
61
  variant: "filled" | "outlined";
62
+ modelValue: MapSearchResult | null;
63
63
  instant: boolean;
64
64
  leadingIcon: string;
65
65
  debounce: number;
@@ -96,8 +96,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
96
96
  color: string;
97
97
  repeat: "all" | "off" | "one";
98
98
  seekBar: "line" | "wavy" | "slider";
99
- playing: boolean;
100
99
  variant: "standard" | "mini";
100
+ playing: boolean;
101
101
  rate: number;
102
102
  muted: boolean;
103
103
  volume: number;
@@ -63,9 +63,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
63
63
  }>, {
64
64
  required: boolean;
65
65
  mode: "docked" | "modal";
66
- modelValue: undefined;
67
66
  variant: "filled" | "outlined";
68
67
  disabled: boolean;
68
+ modelValue: undefined;
69
69
  clearable: boolean;
70
70
  debounce: number;
71
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;