@m3ui-vue/m3ui-vue 1.1.4 → 1.2.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 (199) hide show
  1. package/dist/API.md +511 -34
  2. package/dist/MMenuItem-DI351kIf.js +929 -0
  3. package/dist/MMenuItem-DI351kIf.js.map +1 -0
  4. package/dist/{MSlider-JflHJ70q.js → MSlider-BnEy5ieZ.js} +295 -320
  5. package/dist/MSlider-BnEy5ieZ.js.map +1 -0
  6. package/dist/MTextField-BBmkaIbO.js +633 -0
  7. package/dist/MTextField-BBmkaIbO.js.map +1 -0
  8. package/dist/api.json +1 -1
  9. package/dist/chart.js +83 -49
  10. package/dist/chart.js.map +1 -1
  11. package/dist/code-editor.js +1 -1
  12. package/dist/components/MButton.vue.d.ts +7 -1
  13. package/dist/components/MButtonGroup.vue.d.ts +40 -31
  14. package/dist/components/MCarousel.vue.d.ts +2 -0
  15. package/dist/components/MChart.vue.d.ts +6 -0
  16. package/dist/components/MCircleProgressBar.vue.d.ts +5 -3
  17. package/dist/components/MContextMenu.vue.d.ts +2 -2
  18. package/dist/components/MCopyButton.vue.d.ts +1 -1
  19. package/dist/components/MExportButton.vue.d.ts +1 -1
  20. package/dist/components/MFab.vue.d.ts +2 -2
  21. package/dist/components/MFabMenu.vue.d.ts +1 -1
  22. package/dist/components/MIconButton.vue.d.ts +13 -1
  23. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  24. package/dist/components/MMap.vue.d.ts +20 -2
  25. package/dist/components/MMapBaseLayers.vue.d.ts +3 -0
  26. package/dist/components/MMapFilter.vue.d.ts +3 -0
  27. package/dist/components/MMapLayers.vue.d.ts +3 -0
  28. package/dist/components/MMenu.vue.d.ts +2 -2
  29. package/dist/components/MMenuItem.vue.d.ts +7 -3
  30. package/dist/components/MNavigationDrawer.vue.d.ts +13 -2
  31. package/dist/components/MOverlay.vue.d.ts +12 -1
  32. package/dist/components/MProgressBar.vue.d.ts +5 -3
  33. package/dist/components/MPullToRefresh.vue.d.ts +7 -2
  34. package/dist/components/MRichTextEditor.vue.d.ts +7 -1
  35. package/dist/components/MSearchField.vue.d.ts +58 -0
  36. package/dist/components/MSegmentedButton.vue.d.ts +31 -23
  37. package/dist/components/MSimpleCarousel.vue.d.ts +2 -0
  38. package/dist/components/MSkeleton.vue.d.ts +6 -3
  39. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  40. package/dist/components/MSwitch.vue.d.ts +1 -1
  41. package/dist/components/MTextField.vue.d.ts +5 -1
  42. package/dist/components/MTimeline.vue.d.ts +85 -22
  43. package/dist/components/MTooltip.vue.d.ts +1 -1
  44. package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
  45. package/dist/composables/_mapStyle.d.ts +13 -0
  46. package/dist/composables/_themeTransition.d.ts +2 -0
  47. package/dist/composables/_tooltipTrigger.d.ts +22 -0
  48. package/dist/composables/_useMenuNav.d.ts +28 -0
  49. package/dist/composables/useAutoGrow.d.ts +21 -0
  50. package/dist/composables/useColorPalette.d.ts +1 -1
  51. package/dist/composables/useLocale.d.ts +3 -0
  52. package/dist/composables/useMap.d.ts +19 -3
  53. package/dist/composables/useMapFilter.d.ts +4 -1
  54. package/dist/composables/useMapLayers.d.ts +5 -2
  55. package/dist/composables/useScrollReveal.d.ts +44 -0
  56. package/dist/composables/useThemeTokens.d.ts +21 -0
  57. package/dist/composables/viewportHints.d.ts +27 -0
  58. package/dist/directives/vClickOutside.d.ts +25 -0
  59. package/dist/directives/vFocusRing.d.ts +22 -0
  60. package/dist/directives/vLongPress.d.ts +27 -0
  61. package/dist/directives/vReveal.d.ts +10 -0
  62. package/dist/directives/vScrollElevation.d.ts +31 -0
  63. package/dist/directives/vSkeleton.d.ts +19 -0
  64. package/dist/directives/vStateLayer.d.ts +20 -0
  65. package/dist/directives/vSwipe.d.ts +45 -0
  66. package/dist/directives/vTooltip.d.ts +23 -0
  67. package/dist/index.d.ts +28 -1
  68. package/dist/locales/index.js +21 -7
  69. package/dist/locales/index.js.map +1 -1
  70. package/dist/m3ui-vue.css +1 -1
  71. package/dist/m3ui.js +7131 -6216
  72. package/dist/m3ui.js.map +1 -1
  73. package/dist/map.d.ts +1 -1
  74. package/dist/map.js +821 -791
  75. package/dist/map.js.map +1 -1
  76. package/dist/motion-DZiXG09o.js +150 -0
  77. package/dist/motion-DZiXG09o.js.map +1 -0
  78. package/dist/plugin.d.ts +24 -0
  79. package/dist/rich-text-editor.js +13 -9
  80. package/dist/rich-text-editor.js.map +1 -1
  81. package/dist/styles/theme.css +63 -0
  82. package/dist/styles.css +1 -1
  83. package/dist/{useLocale-CXibICQA.js → useLocale-JYxDDeXC.js} +4 -2
  84. package/dist/useLocale-JYxDDeXC.js.map +1 -0
  85. package/dist/useThemeTokens-Bv-Uv8eX.js +135 -0
  86. package/dist/useThemeTokens-Bv-Uv8eX.js.map +1 -0
  87. package/package.json +1 -1
  88. package/src/__tests__/MButton.test.ts +22 -0
  89. package/src/__tests__/MCarousel.test.ts +9 -0
  90. package/src/__tests__/MChart.test.ts +77 -5
  91. package/src/__tests__/MIconButton.test.ts +33 -0
  92. package/src/__tests__/MMap.test.ts +53 -1
  93. package/src/__tests__/MMapLayers.test.ts +46 -2
  94. package/src/__tests__/MMenu.test.ts +104 -1
  95. package/src/__tests__/MMenuItem.test.ts +18 -0
  96. package/src/__tests__/MNavigationDrawer.test.ts +80 -0
  97. package/src/__tests__/MOverlay.test.ts +49 -0
  98. package/src/__tests__/MProgressBar.test.ts +41 -0
  99. package/src/__tests__/MPullToRefresh.test.ts +33 -0
  100. package/src/__tests__/MRichTextEditor.test.ts +22 -0
  101. package/src/__tests__/MSearchField.test.ts +71 -0
  102. package/src/__tests__/MSkeleton.test.ts +38 -0
  103. package/src/__tests__/MTimeline.test.ts +238 -0
  104. package/src/__tests__/_fakeMaplibre.ts +3 -1
  105. package/src/__tests__/attrsFallthrough.test.ts +3 -0
  106. package/src/__tests__/escapeStack.test.ts +93 -0
  107. package/src/__tests__/ssr.test.ts +21 -2
  108. package/src/__tests__/useAutoGrow.test.ts +103 -0
  109. package/src/__tests__/useScrollReveal.test.ts +102 -0
  110. package/src/__tests__/useThemeTokens.test.ts +114 -0
  111. package/src/__tests__/vClickOutside.test.ts +82 -0
  112. package/src/__tests__/vFocusRing.test.ts +36 -0
  113. package/src/__tests__/vLongPress.test.ts +81 -0
  114. package/src/__tests__/vScrollElevation.test.ts +89 -0
  115. package/src/__tests__/vSkeleton.test.ts +48 -0
  116. package/src/__tests__/vStateLayer.test.ts +53 -0
  117. package/src/__tests__/vSwipe.test.ts +93 -0
  118. package/src/__tests__/vTooltip.test.ts +95 -0
  119. package/src/__tests__/viewportHints.test.ts +41 -0
  120. package/src/components/MAutocomplete.vue +5 -0
  121. package/src/components/MBottomSheet.vue +4 -1
  122. package/src/components/MButton.vue +15 -1
  123. package/src/components/MButtonGroup.vue +22 -17
  124. package/src/components/MCarousel.vue +7 -1
  125. package/src/components/MChart.vue +74 -34
  126. package/src/components/MCircleProgressBar.vue +14 -9
  127. package/src/components/MCommandPalette.vue +3 -2
  128. package/src/components/MContextMenu.vue +19 -60
  129. package/src/components/MDragDropList.vue +2 -0
  130. package/src/components/MIconButton.vue +40 -1
  131. package/src/components/MKanban.vue +2 -0
  132. package/src/components/MLightbox.vue +7 -2
  133. package/src/components/MMap.vue +38 -5
  134. package/src/components/MMapBaseLayers.vue +7 -3
  135. package/src/components/MMapFilter.vue +7 -4
  136. package/src/components/MMapGeoJson.vue +1 -1
  137. package/src/components/MMapLayers.vue +6 -2
  138. package/src/components/MMapMeasure.vue +5 -2
  139. package/src/components/MMenu.vue +18 -59
  140. package/src/components/MMenuItem.vue +11 -2
  141. package/src/components/MMultiAutocomplete.vue +5 -0
  142. package/src/components/MNavigationDrawer.vue +96 -11
  143. package/src/components/MNavigationRail.vue +4 -15
  144. package/src/components/MOverlay.vue +32 -13
  145. package/src/components/MProgressBar.vue +25 -27
  146. package/src/components/MPullToRefresh.vue +20 -1
  147. package/src/components/MRichTextEditor.vue +19 -5
  148. package/src/components/MSearchBar.vue +5 -0
  149. package/src/components/MSearchField.vue +142 -0
  150. package/src/components/MSegmentedButton.vue +19 -17
  151. package/src/components/MSelect.vue +10 -1
  152. package/src/components/MSideSheet.vue +5 -2
  153. package/src/components/MSimpleCarousel.vue +10 -1
  154. package/src/components/MSkeleton.vue +30 -8
  155. package/src/components/MSpotlightSearch.vue +3 -2
  156. package/src/components/MTextField.vue +15 -2
  157. package/src/components/MTimeline.vue +370 -81
  158. package/src/components/MTooltip.vue +20 -152
  159. package/src/components/_MDrawerItemList.vue +25 -6
  160. package/src/composables/_mapStyle.ts +45 -0
  161. package/src/composables/_themeTransition.ts +2 -0
  162. package/src/composables/_tooltipTrigger.ts +184 -0
  163. package/src/composables/_useMenuNav.ts +209 -0
  164. package/src/composables/useAutoGrow.ts +78 -0
  165. package/src/composables/useLocale.ts +5 -0
  166. package/src/composables/useMap.ts +43 -5
  167. package/src/composables/useMapFilter.ts +6 -5
  168. package/src/composables/useMapLayers.ts +7 -6
  169. package/src/composables/useScrollReveal.ts +151 -0
  170. package/src/composables/useThemeTokens.ts +116 -0
  171. package/src/composables/viewportHints.ts +80 -0
  172. package/src/directives/vClickOutside.ts +90 -0
  173. package/src/directives/vFocusRing.ts +60 -0
  174. package/src/directives/vLongPress.ts +134 -0
  175. package/src/directives/vReveal.ts +57 -0
  176. package/src/directives/vScrollElevation.ts +116 -0
  177. package/src/directives/vSkeleton.ts +87 -0
  178. package/src/directives/vStateLayer.ts +83 -0
  179. package/src/directives/vSwipe.ts +197 -0
  180. package/src/directives/vTooltip.ts +128 -0
  181. package/src/index.ts +28 -1
  182. package/src/locales/de.ts +2 -0
  183. package/src/locales/es.ts +2 -0
  184. package/src/locales/fr.ts +2 -0
  185. package/src/locales/ja.ts +2 -0
  186. package/src/locales/ko.ts +2 -0
  187. package/src/locales/pt.ts +2 -0
  188. package/src/locales/zh.ts +2 -0
  189. package/src/map.ts +1 -1
  190. package/src/plugin.ts +34 -0
  191. package/src/styles/theme.css +63 -0
  192. package/dist/MMenuItem-BfjqwcYP.js +0 -830
  193. package/dist/MMenuItem-BfjqwcYP.js.map +0 -1
  194. package/dist/MSlider-JflHJ70q.js.map +0 -1
  195. package/dist/MTextField-NaIB6RbM.js +0 -673
  196. package/dist/MTextField-NaIB6RbM.js.map +0 -1
  197. package/dist/composables/_useThemeTokens.d.ts +0 -7
  198. package/dist/useLocale-CXibICQA.js.map +0 -1
  199. package/src/composables/_useThemeTokens.ts +0 -42
@@ -0,0 +1,150 @@
1
+ //#region src/composables/motion.ts
2
+ var e = {
3
+ standard: {
4
+ fastSpatial: {
5
+ dampingRatio: .9,
6
+ stiffness: 1400
7
+ },
8
+ defaultSpatial: {
9
+ dampingRatio: .9,
10
+ stiffness: 700
11
+ },
12
+ slowSpatial: {
13
+ dampingRatio: .9,
14
+ stiffness: 300
15
+ },
16
+ fastEffects: {
17
+ dampingRatio: 1,
18
+ stiffness: 3800
19
+ },
20
+ defaultEffects: {
21
+ dampingRatio: 1,
22
+ stiffness: 1600
23
+ },
24
+ slowEffects: {
25
+ dampingRatio: 1,
26
+ stiffness: 800
27
+ }
28
+ },
29
+ expressive: {
30
+ fastSpatial: {
31
+ dampingRatio: .6,
32
+ stiffness: 800
33
+ },
34
+ defaultSpatial: {
35
+ dampingRatio: .8,
36
+ stiffness: 380
37
+ },
38
+ slowSpatial: {
39
+ dampingRatio: .8,
40
+ stiffness: 200
41
+ },
42
+ fastEffects: {
43
+ dampingRatio: 1,
44
+ stiffness: 3800
45
+ },
46
+ defaultEffects: {
47
+ dampingRatio: 1,
48
+ stiffness: 1600
49
+ },
50
+ slowEffects: {
51
+ dampingRatio: 1,
52
+ stiffness: 800
53
+ }
54
+ }
55
+ }, t = {
56
+ emphasized: [
57
+ .2,
58
+ 0,
59
+ 0,
60
+ 1
61
+ ],
62
+ emphasizedDecelerate: [
63
+ .05,
64
+ .7,
65
+ .1,
66
+ 1
67
+ ],
68
+ emphasizedAccelerate: [
69
+ .3,
70
+ 0,
71
+ .8,
72
+ .15
73
+ ],
74
+ standard: [
75
+ .2,
76
+ 0,
77
+ 0,
78
+ 1
79
+ ],
80
+ standardDecelerate: [
81
+ 0,
82
+ 0,
83
+ 0,
84
+ 1
85
+ ],
86
+ standardAccelerate: [
87
+ .3,
88
+ 0,
89
+ 1,
90
+ 1
91
+ ],
92
+ legacy: [
93
+ .4,
94
+ 0,
95
+ .2,
96
+ 1
97
+ ],
98
+ legacyDecelerate: [
99
+ 0,
100
+ 0,
101
+ .2,
102
+ 1
103
+ ],
104
+ legacyAccelerate: [
105
+ .4,
106
+ 0,
107
+ 1,
108
+ 1
109
+ ],
110
+ linear: [
111
+ 0,
112
+ 0,
113
+ 1,
114
+ 1
115
+ ]
116
+ }, n = {
117
+ short1: 50,
118
+ short2: 100,
119
+ short3: 150,
120
+ short4: 200,
121
+ medium1: 250,
122
+ medium2: 300,
123
+ medium3: 350,
124
+ medium4: 400,
125
+ long1: 450,
126
+ long2: 500,
127
+ long3: 550,
128
+ long4: 600,
129
+ extraLong1: 700,
130
+ extraLong2: 800,
131
+ extraLong3: 900,
132
+ extraLong4: 1e3
133
+ };
134
+ function r(e, t, n, r) {
135
+ return (i) => {
136
+ if (i <= 0) return 0;
137
+ if (i >= 1) return 1;
138
+ let a = i;
139
+ for (let t = 0; t < 8; t++) {
140
+ let t = 3 * a * (1 - a) ** 2 * e + 3 * a ** 2 * (1 - a) * n + a ** 3 - i, r = 3 * (1 - a) ** 2 * e + 6 * a * (1 - a) * (n - e) + 3 * a ** 2 * (1 - n);
141
+ if (Math.abs(r) < 1e-6) break;
142
+ a -= t / r;
143
+ }
144
+ return 3 * a * (1 - a) ** 2 * t + 3 * a ** 2 * (1 - a) * r + a ** 3;
145
+ };
146
+ }
147
+ //#endregion
148
+ export { e as i, n, t as r, r as t };
149
+
150
+ //# sourceMappingURL=motion-DZiXG09o.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion-DZiXG09o.js","names":[],"sources":["../src/composables/motion.ts"],"sourcesContent":["// Material 3's motion tokens for your own animations, from androidx's MotionTokens, StandardMotionTokens and\n// ExpressiveMotionTokens. The same easings and durations are CSS variables in theme.css (`--ease-*`, which\n// Tailwind turns into `ease-*` utilities, and `--duration-*`); the springs only make sense in JS, with\n// `useSpring` (exported next to these) or your own loop. No imports here: _useSpring builds on this file.\n\n/** A spring: dampingRatio 1 settles without overshoot, lower bounces; higher stiffness is faster */\nexport interface SpringSpec { dampingRatio: number; stiffness: number }\n\n/**\n * Spring specs of the two motion schemes. Spatial springs move things (position, size, shape); effects springs\n * change color and opacity and never overshoot. Standard is the default scheme; Expressive is bouncier, for\n * Expressive components and moments that should feel lively.\n */\nexport const motionSprings = {\n standard: {\n fastSpatial: { dampingRatio: 0.9, stiffness: 1400 },\n defaultSpatial: { dampingRatio: 0.9, stiffness: 700 },\n slowSpatial: { dampingRatio: 0.9, stiffness: 300 },\n fastEffects: { dampingRatio: 1, stiffness: 3800 },\n defaultEffects: { dampingRatio: 1, stiffness: 1600 },\n slowEffects: { dampingRatio: 1, stiffness: 800 },\n },\n expressive: {\n fastSpatial: { dampingRatio: 0.6, stiffness: 800 },\n defaultSpatial: { dampingRatio: 0.8, stiffness: 380 },\n slowSpatial: { dampingRatio: 0.8, stiffness: 200 },\n fastEffects: { dampingRatio: 1, stiffness: 3800 },\n defaultEffects: { dampingRatio: 1, stiffness: 1600 },\n slowEffects: { dampingRatio: 1, stiffness: 800 },\n },\n} as const satisfies Record<'standard' | 'expressive', Record<string, SpringSpec>>\n\n/** Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`) */\nexport const motionEasings = {\n emphasized: [0.2, 0, 0, 1],\n emphasizedDecelerate: [0.05, 0.7, 0.1, 1],\n emphasizedAccelerate: [0.3, 0, 0.8, 0.15],\n standard: [0.2, 0, 0, 1],\n standardDecelerate: [0, 0, 0, 1],\n standardAccelerate: [0.3, 0, 1, 1],\n legacy: [0.4, 0, 0.2, 1],\n legacyDecelerate: [0, 0, 0.2, 1],\n legacyAccelerate: [0.4, 0, 1, 1],\n linear: [0, 0, 1, 1],\n} as const satisfies Record<string, readonly [number, number, number, number]>\n\n/** Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`) */\nexport const motionDurations = {\n short1: 50, short2: 100, short3: 150, short4: 200,\n medium1: 250, medium2: 300, medium3: 350, medium4: 400,\n long1: 450, long2: 500, long3: 550, long4: 600,\n extraLong1: 700, extraLong2: 800, extraLong3: 900, extraLong4: 1000,\n} as const\n\n/**\n * A cubic-bezier easing as a function of progress (0–1), e.g. `cubicBezier(...motionEasings.emphasized)`, for\n * JS-driven tweens and for mapping a fraction through a curve\n */\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number {\n return (t: number) => {\n if (t <= 0) return 0\n if (t >= 1) return 1\n // Solve x(u) = t for the curve parameter u (Newton), then return y(u)\n let u = t\n for (let i = 0; i < 8; i++) {\n const x = 3 * u * (1 - u) ** 2 * x1 + 3 * u ** 2 * (1 - u) * x2 + u ** 3 - t\n const dx = 3 * (1 - u) ** 2 * x1 + 6 * u * (1 - u) * (x2 - x1) + 3 * u ** 2 * (1 - x2)\n if (Math.abs(dx) < 1e-6) break\n u -= x / dx\n }\n return 3 * u * (1 - u) ** 2 * y1 + 3 * u ** 2 * (1 - u) * y2 + u ** 3\n }\n}\n"],"mappings":";AAaA,IAAa,IAAgB;CAC3B,UAAU;EACR,aAAa;GAAE,cAAc;GAAK,WAAW;EAAK;EAClD,gBAAgB;GAAE,cAAc;GAAK,WAAW;EAAI;EACpD,aAAa;GAAE,cAAc;GAAK,WAAW;EAAI;EACjD,aAAa;GAAE,cAAc;GAAG,WAAW;EAAK;EAChD,gBAAgB;GAAE,cAAc;GAAG,WAAW;EAAK;EACnD,aAAa;GAAE,cAAc;GAAG,WAAW;EAAI;CACjD;CACA,YAAY;EACV,aAAa;GAAE,cAAc;GAAK,WAAW;EAAI;EACjD,gBAAgB;GAAE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AAK,IAAI,MAAM,IAAK,KAAM,IAAI,KAAK,KAAK,IAAI;GACnF,IAAI,KAAK,IAAI,CAAE,IAAI,MAAM;GACzB,KAAK,IAAI;EACX;EACA,OAAO,IAAI,KAAK,IAAI,MAAM,IAAI,IAAK,IAAI,KAAK,KAAK,IAAI,KAAK,IAAK,KAAK;CACtE;AACF"}
package/dist/plugin.d.ts CHANGED
@@ -3,6 +3,16 @@ import type { Palette, PaletteId } from './composables/useColorPalette';
3
3
  import type { ContrastLevel } from './composables/useColorPalette';
4
4
  import type { SeedOptions } from './composables/dynamicColor';
5
5
  import type { M3Locale } from './composables/useLocale';
6
+ import { vRipple } from './directives/vRipple';
7
+ import { vReveal } from './directives/vReveal';
8
+ import { vStateLayer } from './directives/vStateLayer';
9
+ import { vTooltip } from './directives/vTooltip';
10
+ import { vFocusRing } from './directives/vFocusRing';
11
+ import { vScrollElevation } from './directives/vScrollElevation';
12
+ import { vLongPress } from './directives/vLongPress';
13
+ import { vSwipe } from './directives/vSwipe';
14
+ import { vClickOutside } from './directives/vClickOutside';
15
+ import { vSkeleton } from './directives/vSkeleton';
6
16
  import { type M3InitialState } from './composables/_ssrState';
7
17
  export interface M3UIOptions {
8
18
  palette?: PaletteId | (string & {});
@@ -72,3 +82,17 @@ export interface M3UIOptions {
72
82
  export declare function createM3UI(options?: M3UIOptions): {
73
83
  install(app: App): void;
74
84
  };
85
+ declare module 'vue' {
86
+ interface GlobalDirectives {
87
+ vRipple: typeof vRipple;
88
+ vReveal: typeof vReveal;
89
+ vStateLayer: typeof vStateLayer;
90
+ vTooltip: typeof vTooltip;
91
+ vFocusRing: typeof vFocusRing;
92
+ vScrollElevation: typeof vScrollElevation;
93
+ vLongPress: typeof vLongPress;
94
+ vSwipe: typeof vSwipe;
95
+ vClickOutside: typeof vClickOutside;
96
+ vSkeleton: typeof vSkeleton;
97
+ }
98
+ }
@@ -1,13 +1,13 @@
1
- import { i as e } from "./useLocale-CXibICQA.js";
2
- import { t } from "./MTextField-NaIB6RbM.js";
1
+ import { i as e } from "./useLocale-JYxDDeXC.js";
2
+ import { t } from "./MTextField-BBmkaIbO.js";
3
3
  import { t as n } from "./MIcon-Bxh9j135.js";
4
4
  import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
5
- import { c as i, n as a, o, t as s } from "./MMenuItem-BfjqwcYP.js";
5
+ import { c as i, n as a, s as o, t as s } from "./MMenuItem-DI351kIf.js";
6
6
  import { Fragment as c, computed as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, ref as x, renderList as S, shallowRef as C, toDisplayString as w, watch as T, withCtx as E, withKeys as D } from "vue";
7
7
  //#region src/components/MRichTextEditor.vue?vue&type=script&setup=true&lang.ts
8
8
  var O = {
9
9
  key: 0,
10
- class: "flex flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5"
10
+ class: "flex shrink-0 flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5"
11
11
  }, k = {
12
12
  type: "button",
13
13
  class: "flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8"
@@ -24,6 +24,10 @@ var O = {
24
24
  default: !1
25
25
  },
26
26
  minHeight: { default: "200px" },
27
+ fill: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
27
31
  labels: {}
28
32
  },
29
33
  emits: ["update:modelValue"],
@@ -196,7 +200,7 @@ var O = {
196
200
  function Z() {
197
201
  G.value && z.value?.chain().focus().setImage({ src: G.value }).run(), W.value = !1;
198
202
  }
199
- return (e, l) => (b(), d("div", { class: g(["overflow-hidden rounded-lg border transition-colors duration-150", r.disabled ? "border-outline-variant/50 opacity-60" : "border-outline-variant focus-within:border-primary"]) }, [
203
+ return (e, l) => (b(), d("div", { class: g(["overflow-hidden rounded-lg border transition-colors duration-150", [r.disabled ? "border-outline-variant/50 opacity-60" : "border-outline-variant focus-within:border-primary", { "flex flex-col": r.fill }]]) }, [
200
204
  R.value ? (b(), d("div", O, [
201
205
  m(a, { align: "left" }, {
202
206
  trigger: E(() => [f("button", k, [p(w(K.value) + " ", 1), m(n, {
@@ -257,9 +261,9 @@ var O = {
257
261
  f("div", {
258
262
  ref_key: "editorContainer",
259
263
  ref: B,
260
- class: "rte-content bg-surface px-4 py-3 text-body-large text-on-surface",
261
- style: _({ minHeight: r.minHeight })
262
- }, null, 4),
264
+ class: g(["rte-content bg-surface px-4 py-3 text-body-large text-on-surface", { "rte-fill flex min-h-0 flex-1 flex-col overflow-y-auto": r.fill }]),
265
+ style: _(r.fill ? void 0 : { minHeight: r.minHeight })
266
+ }, null, 6),
263
267
  m(o, {
264
268
  modelValue: H.value,
265
269
  "onUpdate:modelValue": l[6] ||= (e) => H.value = e,
@@ -310,7 +314,7 @@ var O = {
310
314
  }, 8, ["modelValue", "title"])
311
315
  ], 2));
312
316
  }
313
- }), [["__scopeId", "data-v-201025d1"]]);
317
+ }), [["__scopeId", "data-v-d506d3d1"]]);
314
318
  //#endregion
315
319
  export { P as MRichTextEditor };
316
320
 
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-editor.js","names":[],"sources":["../src/components/MRichTextEditor.vue","../src/components/MRichTextEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A WYSIWYG editor built on tiptap, with a formatting toolbar covering text styles, lists, alignment, links,\n * and images.\n *\n * @event update:modelValue Emitted with the editor HTML on every content change — powers v-model\n */\nimport { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenu from './MMenu.vue'\nimport MMenuItem from './MMenuItem.vue'\nimport MDialog from './MDialog.vue'\nimport MTextField from './MTextField.vue'\nimport MButton from './MButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface RichTextEditorLabels {\n bold?: string\n italic?: string\n underline?: string\n strikethrough?: string\n highlight?: string\n bulletList?: string\n orderedList?: string\n blockquote?: string\n code?: string\n alignLeft?: string\n alignCenter?: string\n alignRight?: string\n undo?: string\n redo?: string\n link?: string\n image?: string\n paragraph?: string\n heading1?: string\n heading2?: string\n heading3?: string\n insertLink?: string\n insertImage?: string\n imageUrlLabel?: string\n cancel?: string\n insert?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n /** HTML content (v-model) */\n modelValue: string\n /** Placeholder text shown on an empty document */\n placeholder?: string\n /** Disables editing */\n disabled?: boolean\n /** Minimum editor height */\n minHeight?: string\n /**\n * Object with all toolbar/dialog label overrides for i18n (see `RichTextEditorLabels`) — defaults come from\n * useLocale()\n */\n labels?: RichTextEditorLabels\n }>(),\n { disabled: false, minHeight: '200px' },\n)\n\nconst l = computed<Required<RichTextEditorLabels>>(() => ({\n bold: locale.bold,\n italic: locale.italic,\n underline: locale.underline,\n strikethrough: locale.strikethrough,\n highlight: locale.highlight,\n bulletList: locale.bulletList,\n orderedList: locale.orderedList,\n blockquote: locale.blockquote,\n code: locale.code,\n alignLeft: locale.alignLeft,\n alignCenter: locale.alignCenter,\n alignRight: locale.alignRight,\n undo: locale.undo,\n redo: locale.redo,\n link: locale.link,\n image: locale.image,\n paragraph: locale.paragraph,\n heading1: locale.heading1,\n heading2: locale.heading2,\n heading3: locale.heading3,\n insertLink: locale.insertLink,\n insertImage: locale.insertImage,\n imageUrlLabel: locale.imageUrlLabel,\n cancel: locale.cancel,\n insert: locale.insert,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst ready = ref(false)\nconst editorRef = shallowRef<any>(null)\nconst editorContainer = ref<HTMLElement | null>(null)\n\ninterface ToolBtn {\n icon: string\n label: string\n action: () => void\n active?: () => boolean\n}\n\nconst toolGroups = ref<ToolBtn[][]>([])\n\nonMounted(async () => {\n const [\n { Editor },\n { default: StarterKit },\n { default: Underline },\n { default: TextAlign },\n { default: Link },\n { default: Image },\n { default: Highlight },\n { default: Placeholder },\n { TextStyle },\n { default: Color },\n ] = await Promise.all([\n import('@tiptap/vue-3'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-underline'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extension-link'),\n import('@tiptap/extension-image'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-placeholder'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-color'),\n ])\n\n const editor = new Editor({\n element: editorContainer.value!,\n content: props.modelValue,\n editable: !props.disabled,\n extensions: [\n StarterKit,\n Underline,\n TextAlign.configure({ types: ['heading', 'paragraph'] }),\n Link.configure({ openOnClick: false }),\n Image,\n Highlight.configure({ multicolor: true }),\n Placeholder.configure({ placeholder: props.placeholder ?? 'Start writing...' }),\n TextStyle,\n Color,\n ],\n onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),\n })\n\n editorRef.value = editor\n\n toolGroups.value = [\n [\n { icon: 'format_bold', label: l.value.bold, action: () => editor.chain().focus().toggleBold().run(), active: () => !!editor.isActive('bold') },\n { icon: 'format_italic', label: l.value.italic, action: () => editor.chain().focus().toggleItalic().run(), active: () => !!editor.isActive('italic') },\n { icon: 'format_underlined', label: l.value.underline, action: () => editor.chain().focus().toggleUnderline().run(), active: () => !!editor.isActive('underline') },\n { icon: 'format_strikethrough', label: l.value.strikethrough, action: () => editor.chain().focus().toggleStrike().run(), active: () => !!editor.isActive('strike') },\n { icon: 'ink_highlighter', label: l.value.highlight, action: () => editor.chain().focus().toggleHighlight().run(), active: () => !!editor.isActive('highlight') },\n ],\n [\n { icon: 'format_list_bulleted', label: l.value.bulletList, action: () => editor.chain().focus().toggleBulletList().run(), active: () => !!editor.isActive('bulletList') },\n { icon: 'format_list_numbered', label: l.value.orderedList, action: () => editor.chain().focus().toggleOrderedList().run(), active: () => !!editor.isActive('orderedList') },\n { icon: 'format_quote', label: l.value.blockquote, action: () => editor.chain().focus().toggleBlockquote().run(), active: () => !!editor.isActive('blockquote') },\n { icon: 'code', label: l.value.code, action: () => editor.chain().focus().toggleCode().run(), active: () => !!editor.isActive('code') },\n ],\n [\n { icon: 'format_align_left', label: l.value.alignLeft, action: () => editor.chain().focus().setTextAlign('left').run(), active: () => !!editor.isActive({ textAlign: 'left' }) },\n { icon: 'format_align_center', label: l.value.alignCenter, action: () => editor.chain().focus().setTextAlign('center').run(), active: () => !!editor.isActive({ textAlign: 'center' }) },\n { icon: 'format_align_right', label: l.value.alignRight, action: () => editor.chain().focus().setTextAlign('right').run(), active: () => !!editor.isActive({ textAlign: 'right' }) },\n ],\n [\n { icon: 'undo', label: l.value.undo, action: () => editor.chain().focus().undo().run() },\n { icon: 'redo', label: l.value.redo, action: () => editor.chain().focus().redo().run() },\n ],\n ]\n\n onBeforeUnmount(() => editor.destroy())\n\n watch(() => props.modelValue, (val) => {\n if (editor.getHTML() !== val) editor.commands.setContent(val)\n })\n\n watch(() => props.disabled, (v) => editor.setEditable(!v))\n\n ready.value = true\n})\n\nconst linkDialogOpen = ref(false)\nconst linkUrl = ref('')\nconst imageDialogOpen = ref(false)\nconst imageUrl = ref('')\n\nconst headingLabel = computed(() => {\n const e = editorRef.value\n if (!e) return l.value.paragraph\n if (e.isActive('heading', { level: 1 })) return l.value.heading1\n if (e.isActive('heading', { level: 2 })) return l.value.heading2\n if (e.isActive('heading', { level: 3 })) return l.value.heading3\n return l.value.paragraph\n})\n\nfunction setHeading(level: 0 | 1 | 2 | 3) {\n if (level === 0) editorRef.value?.chain().focus().setParagraph().run()\n else editorRef.value?.chain().focus().toggleHeading({ level }).run()\n}\n\nfunction openLinkDialog() {\n linkUrl.value = ''\n linkDialogOpen.value = true\n}\n\nfunction confirmLink() {\n if (linkUrl.value) editorRef.value?.chain().focus().setLink({ href: linkUrl.value }).run()\n linkDialogOpen.value = false\n}\n\nfunction openImageDialog() {\n imageUrl.value = ''\n imageDialogOpen.value = true\n}\n\nfunction confirmImage() {\n if (imageUrl.value) editorRef.value?.chain().focus().setImage({ src: imageUrl.value }).run()\n imageDialogOpen.value = false\n}\n</script>\n\n<template>\n <div\n class=\"overflow-hidden rounded-lg border transition-colors duration-150\"\n :class=\"disabled ? 'border-outline-variant/50 opacity-60' : 'border-outline-variant focus-within:border-primary'\"\n >\n <!-- Toolbar -->\n <div v-if=\"ready\" class=\"flex flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5\">\n <!-- Heading menu -->\n <MMenu align=\"left\">\n <template #trigger>\n <button\n type=\"button\"\n class=\"flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8\"\n >\n {{ headingLabel }}\n <MIcon name=\"arrow_drop_down\" :size=\"20\" />\n </button>\n </template>\n <MMenuItem @click=\"setHeading(0)\">{{ l.paragraph }}</MMenuItem>\n <MMenuItem @click=\"setHeading(1)\">{{ l.heading1 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(2)\">{{ l.heading2 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(3)\">{{ l.heading3 }}</MMenuItem>\n </MMenu>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <template v-for=\"(group, gi) in toolGroups\" :key=\"gi\">\n <button\n v-for=\"btn in group\"\n :key=\"btn.icon\"\n type=\"button\"\n :title=\"btn.label\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100\"\n :class=\"btn.active?.() ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'\"\n @click=\"btn.action\"\n >\n <MIcon :name=\"btn.icon\" :size=\"20\" />\n </button>\n <div v-if=\"gi < toolGroups.length - 1\" class=\"mx-1 h-6 w-px bg-outline-variant\" />\n </template>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <button\n type=\"button\"\n :title=\"l.link\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openLinkDialog\"\n >\n <MIcon name=\"link\" :size=\"20\" />\n </button>\n <button\n type=\"button\"\n :title=\"l.image\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openImageDialog\"\n >\n <MIcon name=\"image\" :size=\"20\" />\n </button>\n </div>\n\n <!-- Editor content -->\n <div\n ref=\"editorContainer\"\n class=\"rte-content bg-surface px-4 py-3 text-body-large text-on-surface\"\n :style=\"{ minHeight: minHeight }\"\n />\n\n <!-- Link dialog -->\n <MDialog v-model=\"linkDialogOpen\" :title=\"l.insertLink\">\n <MTextField v-model=\"linkUrl\" label=\"URL\" placeholder=\" \" @keydown.enter=\"confirmLink\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"linkDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmLink\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n\n <!-- Image dialog -->\n <MDialog v-model=\"imageDialogOpen\" :title=\"l.insertImage\">\n <MTextField v-model=\"imageUrl\" :label=\"l.imageUrlLabel\" placeholder=\" \" @keydown.enter=\"confirmImage\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"imageDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmImage\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n </div>\n</template>\n\n<style scoped>\n.rte-content :deep(.tiptap) {\n outline: none;\n min-height: inherit;\n}\n\n.rte-content :deep(.tiptap p.is-editor-empty:first-child::before) {\n content: attr(data-placeholder);\n float: left;\n color: var(--color-on-surface-variant);\n opacity: 0.5;\n pointer-events: none;\n height: 0;\n}\n\n.rte-content :deep(h1) { font-size: var(--text-headline-large); line-height: var(--text-headline-large--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h2) { font-size: var(--text-headline-medium); line-height: var(--text-headline-medium--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h3) { font-size: var(--text-headline-small); line-height: var(--text-headline-small--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(p) { margin: 0.5em 0; }\n.rte-content :deep(ul) { list-style-type: disc; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(ol) { list-style-type: decimal; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(blockquote) { border-left: 3px solid var(--color-primary); padding-left: 1em; margin: 0.5em 0; color: var(--color-on-surface-variant); }\n.rte-content :deep(code) { background: var(--color-surface-container-highest); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; }\n.rte-content :deep(pre) { background: var(--color-surface-container-highest); padding: 1em; border-radius: 8px; overflow-x: auto; margin: 0.5em 0; }\n.rte-content :deep(pre code) { background: none; padding: 0; }\n.rte-content :deep(a) { color: var(--color-primary); text-decoration: underline; }\n.rte-content :deep(mark) { background: var(--color-tertiary-container); color: var(--color-on-tertiary-container); padding: 0.1em 0.2em; border-radius: 2px; }\n.rte-content :deep(img) { max-width: 100%; height: auto; border-radius: 8px; margin: 0.5em 0; }\n</style>\n","<script setup lang=\"ts\">\n/**\n * A WYSIWYG editor built on tiptap, with a formatting toolbar covering text styles, lists, alignment, links,\n * and images.\n *\n * @event update:modelValue Emitted with the editor HTML on every content change — powers v-model\n */\nimport { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenu from './MMenu.vue'\nimport MMenuItem from './MMenuItem.vue'\nimport MDialog from './MDialog.vue'\nimport MTextField from './MTextField.vue'\nimport MButton from './MButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface RichTextEditorLabels {\n bold?: string\n italic?: string\n underline?: string\n strikethrough?: string\n highlight?: string\n bulletList?: string\n orderedList?: string\n blockquote?: string\n code?: string\n alignLeft?: string\n alignCenter?: string\n alignRight?: string\n undo?: string\n redo?: string\n link?: string\n image?: string\n paragraph?: string\n heading1?: string\n heading2?: string\n heading3?: string\n insertLink?: string\n insertImage?: string\n imageUrlLabel?: string\n cancel?: string\n insert?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n /** HTML content (v-model) */\n modelValue: string\n /** Placeholder text shown on an empty document */\n placeholder?: string\n /** Disables editing */\n disabled?: boolean\n /** Minimum editor height */\n minHeight?: string\n /**\n * Object with all toolbar/dialog label overrides for i18n (see `RichTextEditorLabels`) — defaults come from\n * useLocale()\n */\n labels?: RichTextEditorLabels\n }>(),\n { disabled: false, minHeight: '200px' },\n)\n\nconst l = computed<Required<RichTextEditorLabels>>(() => ({\n bold: locale.bold,\n italic: locale.italic,\n underline: locale.underline,\n strikethrough: locale.strikethrough,\n highlight: locale.highlight,\n bulletList: locale.bulletList,\n orderedList: locale.orderedList,\n blockquote: locale.blockquote,\n code: locale.code,\n alignLeft: locale.alignLeft,\n alignCenter: locale.alignCenter,\n alignRight: locale.alignRight,\n undo: locale.undo,\n redo: locale.redo,\n link: locale.link,\n image: locale.image,\n paragraph: locale.paragraph,\n heading1: locale.heading1,\n heading2: locale.heading2,\n heading3: locale.heading3,\n insertLink: locale.insertLink,\n insertImage: locale.insertImage,\n imageUrlLabel: locale.imageUrlLabel,\n cancel: locale.cancel,\n insert: locale.insert,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst ready = ref(false)\nconst editorRef = shallowRef<any>(null)\nconst editorContainer = ref<HTMLElement | null>(null)\n\ninterface ToolBtn {\n icon: string\n label: string\n action: () => void\n active?: () => boolean\n}\n\nconst toolGroups = ref<ToolBtn[][]>([])\n\nonMounted(async () => {\n const [\n { Editor },\n { default: StarterKit },\n { default: Underline },\n { default: TextAlign },\n { default: Link },\n { default: Image },\n { default: Highlight },\n { default: Placeholder },\n { TextStyle },\n { default: Color },\n ] = await Promise.all([\n import('@tiptap/vue-3'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-underline'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extension-link'),\n import('@tiptap/extension-image'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-placeholder'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-color'),\n ])\n\n const editor = new Editor({\n element: editorContainer.value!,\n content: props.modelValue,\n editable: !props.disabled,\n extensions: [\n StarterKit,\n Underline,\n TextAlign.configure({ types: ['heading', 'paragraph'] }),\n Link.configure({ openOnClick: false }),\n Image,\n Highlight.configure({ multicolor: true }),\n Placeholder.configure({ placeholder: props.placeholder ?? 'Start writing...' }),\n TextStyle,\n Color,\n ],\n onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),\n })\n\n editorRef.value = editor\n\n toolGroups.value = [\n [\n { icon: 'format_bold', label: l.value.bold, action: () => editor.chain().focus().toggleBold().run(), active: () => !!editor.isActive('bold') },\n { icon: 'format_italic', label: l.value.italic, action: () => editor.chain().focus().toggleItalic().run(), active: () => !!editor.isActive('italic') },\n { icon: 'format_underlined', label: l.value.underline, action: () => editor.chain().focus().toggleUnderline().run(), active: () => !!editor.isActive('underline') },\n { icon: 'format_strikethrough', label: l.value.strikethrough, action: () => editor.chain().focus().toggleStrike().run(), active: () => !!editor.isActive('strike') },\n { icon: 'ink_highlighter', label: l.value.highlight, action: () => editor.chain().focus().toggleHighlight().run(), active: () => !!editor.isActive('highlight') },\n ],\n [\n { icon: 'format_list_bulleted', label: l.value.bulletList, action: () => editor.chain().focus().toggleBulletList().run(), active: () => !!editor.isActive('bulletList') },\n { icon: 'format_list_numbered', label: l.value.orderedList, action: () => editor.chain().focus().toggleOrderedList().run(), active: () => !!editor.isActive('orderedList') },\n { icon: 'format_quote', label: l.value.blockquote, action: () => editor.chain().focus().toggleBlockquote().run(), active: () => !!editor.isActive('blockquote') },\n { icon: 'code', label: l.value.code, action: () => editor.chain().focus().toggleCode().run(), active: () => !!editor.isActive('code') },\n ],\n [\n { icon: 'format_align_left', label: l.value.alignLeft, action: () => editor.chain().focus().setTextAlign('left').run(), active: () => !!editor.isActive({ textAlign: 'left' }) },\n { icon: 'format_align_center', label: l.value.alignCenter, action: () => editor.chain().focus().setTextAlign('center').run(), active: () => !!editor.isActive({ textAlign: 'center' }) },\n { icon: 'format_align_right', label: l.value.alignRight, action: () => editor.chain().focus().setTextAlign('right').run(), active: () => !!editor.isActive({ textAlign: 'right' }) },\n ],\n [\n { icon: 'undo', label: l.value.undo, action: () => editor.chain().focus().undo().run() },\n { icon: 'redo', label: l.value.redo, action: () => editor.chain().focus().redo().run() },\n ],\n ]\n\n onBeforeUnmount(() => editor.destroy())\n\n watch(() => props.modelValue, (val) => {\n if (editor.getHTML() !== val) editor.commands.setContent(val)\n })\n\n watch(() => props.disabled, (v) => editor.setEditable(!v))\n\n ready.value = true\n})\n\nconst linkDialogOpen = ref(false)\nconst linkUrl = ref('')\nconst imageDialogOpen = ref(false)\nconst imageUrl = ref('')\n\nconst headingLabel = computed(() => {\n const e = editorRef.value\n if (!e) return l.value.paragraph\n if (e.isActive('heading', { level: 1 })) return l.value.heading1\n if (e.isActive('heading', { level: 2 })) return l.value.heading2\n if (e.isActive('heading', { level: 3 })) return l.value.heading3\n return l.value.paragraph\n})\n\nfunction setHeading(level: 0 | 1 | 2 | 3) {\n if (level === 0) editorRef.value?.chain().focus().setParagraph().run()\n else editorRef.value?.chain().focus().toggleHeading({ level }).run()\n}\n\nfunction openLinkDialog() {\n linkUrl.value = ''\n linkDialogOpen.value = true\n}\n\nfunction confirmLink() {\n if (linkUrl.value) editorRef.value?.chain().focus().setLink({ href: linkUrl.value }).run()\n linkDialogOpen.value = false\n}\n\nfunction openImageDialog() {\n imageUrl.value = ''\n imageDialogOpen.value = true\n}\n\nfunction confirmImage() {\n if (imageUrl.value) editorRef.value?.chain().focus().setImage({ src: imageUrl.value }).run()\n imageDialogOpen.value = false\n}\n</script>\n\n<template>\n <div\n class=\"overflow-hidden rounded-lg border transition-colors duration-150\"\n :class=\"disabled ? 'border-outline-variant/50 opacity-60' : 'border-outline-variant focus-within:border-primary'\"\n >\n <!-- Toolbar -->\n <div v-if=\"ready\" class=\"flex flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5\">\n <!-- Heading menu -->\n <MMenu align=\"left\">\n <template #trigger>\n <button\n type=\"button\"\n class=\"flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8\"\n >\n {{ headingLabel }}\n <MIcon name=\"arrow_drop_down\" :size=\"20\" />\n </button>\n </template>\n <MMenuItem @click=\"setHeading(0)\">{{ l.paragraph }}</MMenuItem>\n <MMenuItem @click=\"setHeading(1)\">{{ l.heading1 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(2)\">{{ l.heading2 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(3)\">{{ l.heading3 }}</MMenuItem>\n </MMenu>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <template v-for=\"(group, gi) in toolGroups\" :key=\"gi\">\n <button\n v-for=\"btn in group\"\n :key=\"btn.icon\"\n type=\"button\"\n :title=\"btn.label\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100\"\n :class=\"btn.active?.() ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'\"\n @click=\"btn.action\"\n >\n <MIcon :name=\"btn.icon\" :size=\"20\" />\n </button>\n <div v-if=\"gi < toolGroups.length - 1\" class=\"mx-1 h-6 w-px bg-outline-variant\" />\n </template>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <button\n type=\"button\"\n :title=\"l.link\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openLinkDialog\"\n >\n <MIcon name=\"link\" :size=\"20\" />\n </button>\n <button\n type=\"button\"\n :title=\"l.image\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openImageDialog\"\n >\n <MIcon name=\"image\" :size=\"20\" />\n </button>\n </div>\n\n <!-- Editor content -->\n <div\n ref=\"editorContainer\"\n class=\"rte-content bg-surface px-4 py-3 text-body-large text-on-surface\"\n :style=\"{ minHeight: minHeight }\"\n />\n\n <!-- Link dialog -->\n <MDialog v-model=\"linkDialogOpen\" :title=\"l.insertLink\">\n <MTextField v-model=\"linkUrl\" label=\"URL\" placeholder=\" \" @keydown.enter=\"confirmLink\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"linkDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmLink\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n\n <!-- Image dialog -->\n <MDialog v-model=\"imageDialogOpen\" :title=\"l.insertImage\">\n <MTextField v-model=\"imageUrl\" :label=\"l.imageUrlLabel\" placeholder=\" \" @keydown.enter=\"confirmImage\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"imageDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmImage\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n </div>\n</template>\n\n<style scoped>\n.rte-content :deep(.tiptap) {\n outline: none;\n min-height: inherit;\n}\n\n.rte-content :deep(.tiptap p.is-editor-empty:first-child::before) {\n content: attr(data-placeholder);\n float: left;\n color: var(--color-on-surface-variant);\n opacity: 0.5;\n pointer-events: none;\n height: 0;\n}\n\n.rte-content :deep(h1) { font-size: var(--text-headline-large); line-height: var(--text-headline-large--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h2) { font-size: var(--text-headline-medium); line-height: var(--text-headline-medium--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h3) { font-size: var(--text-headline-small); line-height: var(--text-headline-small--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(p) { margin: 0.5em 0; }\n.rte-content :deep(ul) { list-style-type: disc; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(ol) { list-style-type: decimal; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(blockquote) { border-left: 3px solid var(--color-primary); padding-left: 1em; margin: 0.5em 0; color: var(--color-on-surface-variant); }\n.rte-content :deep(code) { background: var(--color-surface-container-highest); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; }\n.rte-content :deep(pre) { background: var(--color-surface-container-highest); padding: 1em; border-radius: 8px; overflow-x: auto; margin: 0.5em 0; }\n.rte-content :deep(pre code) { background: none; padding: 0; }\n.rte-content :deep(a) { color: var(--color-primary); text-decoration: underline; }\n.rte-content :deep(mark) { background: var(--color-tertiary-container); color: var(--color-on-tertiary-container); padding: 0.1em 0.2em; border-radius: 2px; }\n.rte-content :deep(img) { max-width: 100%; height: auto; border-radius: 8px; margin: 0.5em 0; }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,IAAM,IAAS,EAAU,GAEnB,IAAQ,GAmBR,IAAI,SAAgD;GACxD,MAAM,EAAO;GACb,QAAQ,EAAO;GACf,WAAW,EAAO;GAClB,eAAe,EAAO;GACtB,WAAW,EAAO;GAClB,YAAY,EAAO;GACnB,aAAa,EAAO;GACpB,YAAY,EAAO;GACnB,MAAM,EAAO;GACb,WAAW,EAAO;GAClB,aAAa,EAAO;GACpB,YAAY,EAAO;GACnB,MAAM,EAAO;GACb,MAAM,EAAO;GACb,MAAM,EAAO;GACb,OAAO,EAAO;GACd,WAAW,EAAO;GAClB,UAAU,EAAO;GACjB,UAAU,EAAO;GACjB,UAAU,EAAO;GACjB,YAAY,EAAO;GACnB,aAAa,EAAO;GACpB,eAAe,EAAO;GACtB,QAAQ,EAAO;GACf,QAAQ,EAAO;GACf,GAAG,EAAM;EACX,EAAE,GAEI,IAAO,GAEP,IAAQ,EAAI,EAAK,GACjB,IAAY,EAAgB,IAAI,GAChC,IAAkB,EAAwB,IAAI,GAS9C,IAAa,EAAiB,CAAC,CAAC;EAEtC,EAAU,YAAY;GACpB,IAAM,CACJ,EAAE,aACF,EAAE,SAAS,KACX,EAAE,SAAS,KACX,EAAE,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AAU,SAAA,QAAc,CAAX,EAAA,EAAA,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,CAAA;;IACpE,CAAA,GAAA,EAAuD,GAAA,EAA7C,SAAO,EAAY,GAAA;KAAE,SAAA,QAAc,CAAX,EAAA,EAAA,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,CAAA;;;IAH5C,SAAA,QAAwG,CAAxG,EAAwG,GAAA;KAAnF,YAAA,EAAA;KAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAQ,QAAA;KAAG,OAAO,EAAA,MAAE;KAAe,aAAY;KAAK,WAAO,EAAQ,GAAY,CAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"rich-text-editor.js","names":[],"sources":["../src/components/MRichTextEditor.vue","../src/components/MRichTextEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A WYSIWYG editor built on tiptap, with a formatting toolbar covering text styles, lists, alignment, links,\n * and images.\n *\n * @event update:modelValue Emitted with the editor HTML on every content change — powers v-model\n */\nimport { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenu from './MMenu.vue'\nimport MMenuItem from './MMenuItem.vue'\nimport MDialog from './MDialog.vue'\nimport MTextField from './MTextField.vue'\nimport MButton from './MButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface RichTextEditorLabels {\n bold?: string\n italic?: string\n underline?: string\n strikethrough?: string\n highlight?: string\n bulletList?: string\n orderedList?: string\n blockquote?: string\n code?: string\n alignLeft?: string\n alignCenter?: string\n alignRight?: string\n undo?: string\n redo?: string\n link?: string\n image?: string\n paragraph?: string\n heading1?: string\n heading2?: string\n heading3?: string\n insertLink?: string\n insertImage?: string\n imageUrlLabel?: string\n cancel?: string\n insert?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n /** HTML content (v-model) */\n modelValue: string\n /** Placeholder text shown on an empty document */\n placeholder?: string\n /** Disables editing */\n disabled?: boolean\n /** Minimum height of the text area (not used with `fill`) */\n minHeight?: string\n /**\n * Fills the height you give the editor (`class=\"h-full\"`, `flex-1`…): the toolbar stays put and the text\n * scrolls inside, instead of the editor growing with its content\n */\n fill?: boolean\n /**\n * Object with all toolbar/dialog label overrides for i18n (see `RichTextEditorLabels`) — defaults come from\n * useLocale()\n */\n labels?: RichTextEditorLabels\n }>(),\n { disabled: false, minHeight: '200px', fill: false },\n)\n\nconst l = computed<Required<RichTextEditorLabels>>(() => ({\n bold: locale.bold,\n italic: locale.italic,\n underline: locale.underline,\n strikethrough: locale.strikethrough,\n highlight: locale.highlight,\n bulletList: locale.bulletList,\n orderedList: locale.orderedList,\n blockquote: locale.blockquote,\n code: locale.code,\n alignLeft: locale.alignLeft,\n alignCenter: locale.alignCenter,\n alignRight: locale.alignRight,\n undo: locale.undo,\n redo: locale.redo,\n link: locale.link,\n image: locale.image,\n paragraph: locale.paragraph,\n heading1: locale.heading1,\n heading2: locale.heading2,\n heading3: locale.heading3,\n insertLink: locale.insertLink,\n insertImage: locale.insertImage,\n imageUrlLabel: locale.imageUrlLabel,\n cancel: locale.cancel,\n insert: locale.insert,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst ready = ref(false)\nconst editorRef = shallowRef<any>(null)\nconst editorContainer = ref<HTMLElement | null>(null)\n\ninterface ToolBtn {\n icon: string\n label: string\n action: () => void\n active?: () => boolean\n}\n\nconst toolGroups = ref<ToolBtn[][]>([])\n\nonMounted(async () => {\n const [\n { Editor },\n { default: StarterKit },\n { default: Underline },\n { default: TextAlign },\n { default: Link },\n { default: Image },\n { default: Highlight },\n { default: Placeholder },\n { TextStyle },\n { default: Color },\n ] = await Promise.all([\n import('@tiptap/vue-3'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-underline'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extension-link'),\n import('@tiptap/extension-image'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-placeholder'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-color'),\n ])\n\n const editor = new Editor({\n element: editorContainer.value!,\n content: props.modelValue,\n editable: !props.disabled,\n extensions: [\n StarterKit,\n Underline,\n TextAlign.configure({ types: ['heading', 'paragraph'] }),\n Link.configure({ openOnClick: false }),\n Image,\n Highlight.configure({ multicolor: true }),\n Placeholder.configure({ placeholder: props.placeholder ?? 'Start writing...' }),\n TextStyle,\n Color,\n ],\n onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),\n })\n\n editorRef.value = editor\n\n toolGroups.value = [\n [\n { icon: 'format_bold', label: l.value.bold, action: () => editor.chain().focus().toggleBold().run(), active: () => !!editor.isActive('bold') },\n { icon: 'format_italic', label: l.value.italic, action: () => editor.chain().focus().toggleItalic().run(), active: () => !!editor.isActive('italic') },\n { icon: 'format_underlined', label: l.value.underline, action: () => editor.chain().focus().toggleUnderline().run(), active: () => !!editor.isActive('underline') },\n { icon: 'format_strikethrough', label: l.value.strikethrough, action: () => editor.chain().focus().toggleStrike().run(), active: () => !!editor.isActive('strike') },\n { icon: 'ink_highlighter', label: l.value.highlight, action: () => editor.chain().focus().toggleHighlight().run(), active: () => !!editor.isActive('highlight') },\n ],\n [\n { icon: 'format_list_bulleted', label: l.value.bulletList, action: () => editor.chain().focus().toggleBulletList().run(), active: () => !!editor.isActive('bulletList') },\n { icon: 'format_list_numbered', label: l.value.orderedList, action: () => editor.chain().focus().toggleOrderedList().run(), active: () => !!editor.isActive('orderedList') },\n { icon: 'format_quote', label: l.value.blockquote, action: () => editor.chain().focus().toggleBlockquote().run(), active: () => !!editor.isActive('blockquote') },\n { icon: 'code', label: l.value.code, action: () => editor.chain().focus().toggleCode().run(), active: () => !!editor.isActive('code') },\n ],\n [\n { icon: 'format_align_left', label: l.value.alignLeft, action: () => editor.chain().focus().setTextAlign('left').run(), active: () => !!editor.isActive({ textAlign: 'left' }) },\n { icon: 'format_align_center', label: l.value.alignCenter, action: () => editor.chain().focus().setTextAlign('center').run(), active: () => !!editor.isActive({ textAlign: 'center' }) },\n { icon: 'format_align_right', label: l.value.alignRight, action: () => editor.chain().focus().setTextAlign('right').run(), active: () => !!editor.isActive({ textAlign: 'right' }) },\n ],\n [\n { icon: 'undo', label: l.value.undo, action: () => editor.chain().focus().undo().run() },\n { icon: 'redo', label: l.value.redo, action: () => editor.chain().focus().redo().run() },\n ],\n ]\n\n onBeforeUnmount(() => editor.destroy())\n\n watch(() => props.modelValue, (val) => {\n if (editor.getHTML() !== val) editor.commands.setContent(val)\n })\n\n watch(() => props.disabled, (v) => editor.setEditable(!v))\n\n ready.value = true\n})\n\nconst linkDialogOpen = ref(false)\nconst linkUrl = ref('')\nconst imageDialogOpen = ref(false)\nconst imageUrl = ref('')\n\nconst headingLabel = computed(() => {\n const e = editorRef.value\n if (!e) return l.value.paragraph\n if (e.isActive('heading', { level: 1 })) return l.value.heading1\n if (e.isActive('heading', { level: 2 })) return l.value.heading2\n if (e.isActive('heading', { level: 3 })) return l.value.heading3\n return l.value.paragraph\n})\n\nfunction setHeading(level: 0 | 1 | 2 | 3) {\n if (level === 0) editorRef.value?.chain().focus().setParagraph().run()\n else editorRef.value?.chain().focus().toggleHeading({ level }).run()\n}\n\nfunction openLinkDialog() {\n linkUrl.value = ''\n linkDialogOpen.value = true\n}\n\nfunction confirmLink() {\n if (linkUrl.value) editorRef.value?.chain().focus().setLink({ href: linkUrl.value }).run()\n linkDialogOpen.value = false\n}\n\nfunction openImageDialog() {\n imageUrl.value = ''\n imageDialogOpen.value = true\n}\n\nfunction confirmImage() {\n if (imageUrl.value) editorRef.value?.chain().focus().setImage({ src: imageUrl.value }).run()\n imageDialogOpen.value = false\n}\n</script>\n\n<template>\n <div\n class=\"overflow-hidden rounded-lg border transition-colors duration-150\"\n :class=\"[\n disabled ? 'border-outline-variant/50 opacity-60' : 'border-outline-variant focus-within:border-primary',\n { 'flex flex-col': fill },\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"ready\" class=\"flex shrink-0 flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5\">\n <!-- Heading menu -->\n <MMenu align=\"left\">\n <template #trigger>\n <button\n type=\"button\"\n class=\"flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8\"\n >\n {{ headingLabel }}\n <MIcon name=\"arrow_drop_down\" :size=\"20\" />\n </button>\n </template>\n <MMenuItem @click=\"setHeading(0)\">{{ l.paragraph }}</MMenuItem>\n <MMenuItem @click=\"setHeading(1)\">{{ l.heading1 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(2)\">{{ l.heading2 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(3)\">{{ l.heading3 }}</MMenuItem>\n </MMenu>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <template v-for=\"(group, gi) in toolGroups\" :key=\"gi\">\n <button\n v-for=\"btn in group\"\n :key=\"btn.icon\"\n type=\"button\"\n :title=\"btn.label\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100\"\n :class=\"btn.active?.() ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'\"\n @click=\"btn.action\"\n >\n <MIcon :name=\"btn.icon\" :size=\"20\" />\n </button>\n <div v-if=\"gi < toolGroups.length - 1\" class=\"mx-1 h-6 w-px bg-outline-variant\" />\n </template>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <button\n type=\"button\"\n :title=\"l.link\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openLinkDialog\"\n >\n <MIcon name=\"link\" :size=\"20\" />\n </button>\n <button\n type=\"button\"\n :title=\"l.image\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openImageDialog\"\n >\n <MIcon name=\"image\" :size=\"20\" />\n </button>\n </div>\n\n <!-- Editor content -->\n <div\n ref=\"editorContainer\"\n class=\"rte-content bg-surface px-4 py-3 text-body-large text-on-surface\"\n :class=\"{ 'rte-fill flex min-h-0 flex-1 flex-col overflow-y-auto': fill }\"\n :style=\"fill ? undefined : { minHeight }\"\n />\n\n <!-- Link dialog -->\n <MDialog v-model=\"linkDialogOpen\" :title=\"l.insertLink\">\n <MTextField v-model=\"linkUrl\" label=\"URL\" placeholder=\" \" @keydown.enter=\"confirmLink\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"linkDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmLink\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n\n <!-- Image dialog -->\n <MDialog v-model=\"imageDialogOpen\" :title=\"l.insertImage\">\n <MTextField v-model=\"imageUrl\" :label=\"l.imageUrlLabel\" placeholder=\" \" @keydown.enter=\"confirmImage\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"imageDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmImage\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n </div>\n</template>\n\n<style scoped>\n.rte-content :deep(.tiptap) {\n outline: none;\n min-height: inherit;\n}\n\n/* Filling: the document takes the whole area, so a click anywhere below the text lands in it. */\n.rte-fill :deep(.tiptap) {\n flex: 1;\n}\n\n.rte-content :deep(.tiptap p.is-editor-empty:first-child::before) {\n content: attr(data-placeholder);\n float: left;\n color: var(--color-on-surface-variant);\n opacity: 0.5;\n pointer-events: none;\n height: 0;\n}\n\n.rte-content :deep(h1) { font-size: var(--text-headline-large); line-height: var(--text-headline-large--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h2) { font-size: var(--text-headline-medium); line-height: var(--text-headline-medium--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h3) { font-size: var(--text-headline-small); line-height: var(--text-headline-small--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(p) { margin: 0.5em 0; }\n.rte-content :deep(ul) { list-style-type: disc; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(ol) { list-style-type: decimal; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(blockquote) { border-left: 3px solid var(--color-primary); padding-left: 1em; margin: 0.5em 0; color: var(--color-on-surface-variant); }\n.rte-content :deep(code) { background: var(--color-surface-container-highest); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; }\n.rte-content :deep(pre) { background: var(--color-surface-container-highest); padding: 1em; border-radius: 8px; overflow-x: auto; margin: 0.5em 0; }\n.rte-content :deep(pre code) { background: none; padding: 0; }\n.rte-content :deep(a) { color: var(--color-primary); text-decoration: underline; }\n.rte-content :deep(mark) { background: var(--color-tertiary-container); color: var(--color-on-tertiary-container); padding: 0.1em 0.2em; border-radius: 2px; }\n.rte-content :deep(img) { max-width: 100%; height: auto; border-radius: 8px; margin: 0.5em 0; }\n</style>\n","<script setup lang=\"ts\">\n/**\n * A WYSIWYG editor built on tiptap, with a formatting toolbar covering text styles, lists, alignment, links,\n * and images.\n *\n * @event update:modelValue Emitted with the editor HTML on every content change — powers v-model\n */\nimport { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenu from './MMenu.vue'\nimport MMenuItem from './MMenuItem.vue'\nimport MDialog from './MDialog.vue'\nimport MTextField from './MTextField.vue'\nimport MButton from './MButton.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface RichTextEditorLabels {\n bold?: string\n italic?: string\n underline?: string\n strikethrough?: string\n highlight?: string\n bulletList?: string\n orderedList?: string\n blockquote?: string\n code?: string\n alignLeft?: string\n alignCenter?: string\n alignRight?: string\n undo?: string\n redo?: string\n link?: string\n image?: string\n paragraph?: string\n heading1?: string\n heading2?: string\n heading3?: string\n insertLink?: string\n insertImage?: string\n imageUrlLabel?: string\n cancel?: string\n insert?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n /** HTML content (v-model) */\n modelValue: string\n /** Placeholder text shown on an empty document */\n placeholder?: string\n /** Disables editing */\n disabled?: boolean\n /** Minimum height of the text area (not used with `fill`) */\n minHeight?: string\n /**\n * Fills the height you give the editor (`class=\"h-full\"`, `flex-1`…): the toolbar stays put and the text\n * scrolls inside, instead of the editor growing with its content\n */\n fill?: boolean\n /**\n * Object with all toolbar/dialog label overrides for i18n (see `RichTextEditorLabels`) — defaults come from\n * useLocale()\n */\n labels?: RichTextEditorLabels\n }>(),\n { disabled: false, minHeight: '200px', fill: false },\n)\n\nconst l = computed<Required<RichTextEditorLabels>>(() => ({\n bold: locale.bold,\n italic: locale.italic,\n underline: locale.underline,\n strikethrough: locale.strikethrough,\n highlight: locale.highlight,\n bulletList: locale.bulletList,\n orderedList: locale.orderedList,\n blockquote: locale.blockquote,\n code: locale.code,\n alignLeft: locale.alignLeft,\n alignCenter: locale.alignCenter,\n alignRight: locale.alignRight,\n undo: locale.undo,\n redo: locale.redo,\n link: locale.link,\n image: locale.image,\n paragraph: locale.paragraph,\n heading1: locale.heading1,\n heading2: locale.heading2,\n heading3: locale.heading3,\n insertLink: locale.insertLink,\n insertImage: locale.insertImage,\n imageUrlLabel: locale.imageUrlLabel,\n cancel: locale.cancel,\n insert: locale.insert,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst ready = ref(false)\nconst editorRef = shallowRef<any>(null)\nconst editorContainer = ref<HTMLElement | null>(null)\n\ninterface ToolBtn {\n icon: string\n label: string\n action: () => void\n active?: () => boolean\n}\n\nconst toolGroups = ref<ToolBtn[][]>([])\n\nonMounted(async () => {\n const [\n { Editor },\n { default: StarterKit },\n { default: Underline },\n { default: TextAlign },\n { default: Link },\n { default: Image },\n { default: Highlight },\n { default: Placeholder },\n { TextStyle },\n { default: Color },\n ] = await Promise.all([\n import('@tiptap/vue-3'),\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-underline'),\n import('@tiptap/extension-text-align'),\n import('@tiptap/extension-link'),\n import('@tiptap/extension-image'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-placeholder'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-color'),\n ])\n\n const editor = new Editor({\n element: editorContainer.value!,\n content: props.modelValue,\n editable: !props.disabled,\n extensions: [\n StarterKit,\n Underline,\n TextAlign.configure({ types: ['heading', 'paragraph'] }),\n Link.configure({ openOnClick: false }),\n Image,\n Highlight.configure({ multicolor: true }),\n Placeholder.configure({ placeholder: props.placeholder ?? 'Start writing...' }),\n TextStyle,\n Color,\n ],\n onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),\n })\n\n editorRef.value = editor\n\n toolGroups.value = [\n [\n { icon: 'format_bold', label: l.value.bold, action: () => editor.chain().focus().toggleBold().run(), active: () => !!editor.isActive('bold') },\n { icon: 'format_italic', label: l.value.italic, action: () => editor.chain().focus().toggleItalic().run(), active: () => !!editor.isActive('italic') },\n { icon: 'format_underlined', label: l.value.underline, action: () => editor.chain().focus().toggleUnderline().run(), active: () => !!editor.isActive('underline') },\n { icon: 'format_strikethrough', label: l.value.strikethrough, action: () => editor.chain().focus().toggleStrike().run(), active: () => !!editor.isActive('strike') },\n { icon: 'ink_highlighter', label: l.value.highlight, action: () => editor.chain().focus().toggleHighlight().run(), active: () => !!editor.isActive('highlight') },\n ],\n [\n { icon: 'format_list_bulleted', label: l.value.bulletList, action: () => editor.chain().focus().toggleBulletList().run(), active: () => !!editor.isActive('bulletList') },\n { icon: 'format_list_numbered', label: l.value.orderedList, action: () => editor.chain().focus().toggleOrderedList().run(), active: () => !!editor.isActive('orderedList') },\n { icon: 'format_quote', label: l.value.blockquote, action: () => editor.chain().focus().toggleBlockquote().run(), active: () => !!editor.isActive('blockquote') },\n { icon: 'code', label: l.value.code, action: () => editor.chain().focus().toggleCode().run(), active: () => !!editor.isActive('code') },\n ],\n [\n { icon: 'format_align_left', label: l.value.alignLeft, action: () => editor.chain().focus().setTextAlign('left').run(), active: () => !!editor.isActive({ textAlign: 'left' }) },\n { icon: 'format_align_center', label: l.value.alignCenter, action: () => editor.chain().focus().setTextAlign('center').run(), active: () => !!editor.isActive({ textAlign: 'center' }) },\n { icon: 'format_align_right', label: l.value.alignRight, action: () => editor.chain().focus().setTextAlign('right').run(), active: () => !!editor.isActive({ textAlign: 'right' }) },\n ],\n [\n { icon: 'undo', label: l.value.undo, action: () => editor.chain().focus().undo().run() },\n { icon: 'redo', label: l.value.redo, action: () => editor.chain().focus().redo().run() },\n ],\n ]\n\n onBeforeUnmount(() => editor.destroy())\n\n watch(() => props.modelValue, (val) => {\n if (editor.getHTML() !== val) editor.commands.setContent(val)\n })\n\n watch(() => props.disabled, (v) => editor.setEditable(!v))\n\n ready.value = true\n})\n\nconst linkDialogOpen = ref(false)\nconst linkUrl = ref('')\nconst imageDialogOpen = ref(false)\nconst imageUrl = ref('')\n\nconst headingLabel = computed(() => {\n const e = editorRef.value\n if (!e) return l.value.paragraph\n if (e.isActive('heading', { level: 1 })) return l.value.heading1\n if (e.isActive('heading', { level: 2 })) return l.value.heading2\n if (e.isActive('heading', { level: 3 })) return l.value.heading3\n return l.value.paragraph\n})\n\nfunction setHeading(level: 0 | 1 | 2 | 3) {\n if (level === 0) editorRef.value?.chain().focus().setParagraph().run()\n else editorRef.value?.chain().focus().toggleHeading({ level }).run()\n}\n\nfunction openLinkDialog() {\n linkUrl.value = ''\n linkDialogOpen.value = true\n}\n\nfunction confirmLink() {\n if (linkUrl.value) editorRef.value?.chain().focus().setLink({ href: linkUrl.value }).run()\n linkDialogOpen.value = false\n}\n\nfunction openImageDialog() {\n imageUrl.value = ''\n imageDialogOpen.value = true\n}\n\nfunction confirmImage() {\n if (imageUrl.value) editorRef.value?.chain().focus().setImage({ src: imageUrl.value }).run()\n imageDialogOpen.value = false\n}\n</script>\n\n<template>\n <div\n class=\"overflow-hidden rounded-lg border transition-colors duration-150\"\n :class=\"[\n disabled ? 'border-outline-variant/50 opacity-60' : 'border-outline-variant focus-within:border-primary',\n { 'flex flex-col': fill },\n ]\"\n >\n <!-- Toolbar -->\n <div v-if=\"ready\" class=\"flex shrink-0 flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5\">\n <!-- Heading menu -->\n <MMenu align=\"left\">\n <template #trigger>\n <button\n type=\"button\"\n class=\"flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8\"\n >\n {{ headingLabel }}\n <MIcon name=\"arrow_drop_down\" :size=\"20\" />\n </button>\n </template>\n <MMenuItem @click=\"setHeading(0)\">{{ l.paragraph }}</MMenuItem>\n <MMenuItem @click=\"setHeading(1)\">{{ l.heading1 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(2)\">{{ l.heading2 }}</MMenuItem>\n <MMenuItem @click=\"setHeading(3)\">{{ l.heading3 }}</MMenuItem>\n </MMenu>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <template v-for=\"(group, gi) in toolGroups\" :key=\"gi\">\n <button\n v-for=\"btn in group\"\n :key=\"btn.icon\"\n type=\"button\"\n :title=\"btn.label\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100\"\n :class=\"btn.active?.() ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'\"\n @click=\"btn.action\"\n >\n <MIcon :name=\"btn.icon\" :size=\"20\" />\n </button>\n <div v-if=\"gi < toolGroups.length - 1\" class=\"mx-1 h-6 w-px bg-outline-variant\" />\n </template>\n\n <div class=\"mx-1 h-6 w-px bg-outline-variant\" />\n\n <button\n type=\"button\"\n :title=\"l.link\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openLinkDialog\"\n >\n <MIcon name=\"link\" :size=\"20\" />\n </button>\n <button\n type=\"button\"\n :title=\"l.image\"\n class=\"flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"openImageDialog\"\n >\n <MIcon name=\"image\" :size=\"20\" />\n </button>\n </div>\n\n <!-- Editor content -->\n <div\n ref=\"editorContainer\"\n class=\"rte-content bg-surface px-4 py-3 text-body-large text-on-surface\"\n :class=\"{ 'rte-fill flex min-h-0 flex-1 flex-col overflow-y-auto': fill }\"\n :style=\"fill ? undefined : { minHeight }\"\n />\n\n <!-- Link dialog -->\n <MDialog v-model=\"linkDialogOpen\" :title=\"l.insertLink\">\n <MTextField v-model=\"linkUrl\" label=\"URL\" placeholder=\" \" @keydown.enter=\"confirmLink\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"linkDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmLink\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n\n <!-- Image dialog -->\n <MDialog v-model=\"imageDialogOpen\" :title=\"l.insertImage\">\n <MTextField v-model=\"imageUrl\" :label=\"l.imageUrlLabel\" placeholder=\" \" @keydown.enter=\"confirmImage\" />\n <template #actions>\n <MButton variant=\"text\" @click=\"imageDialogOpen = false\">{{ l.cancel }}</MButton>\n <MButton @click=\"confirmImage\">{{ l.insert }}</MButton>\n </template>\n </MDialog>\n </div>\n</template>\n\n<style scoped>\n.rte-content :deep(.tiptap) {\n outline: none;\n min-height: inherit;\n}\n\n/* Filling: the document takes the whole area, so a click anywhere below the text lands in it. */\n.rte-fill :deep(.tiptap) {\n flex: 1;\n}\n\n.rte-content :deep(.tiptap p.is-editor-empty:first-child::before) {\n content: attr(data-placeholder);\n float: left;\n color: var(--color-on-surface-variant);\n opacity: 0.5;\n pointer-events: none;\n height: 0;\n}\n\n.rte-content :deep(h1) { font-size: var(--text-headline-large); line-height: var(--text-headline-large--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h2) { font-size: var(--text-headline-medium); line-height: var(--text-headline-medium--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(h3) { font-size: var(--text-headline-small); line-height: var(--text-headline-small--line-height); font-weight: 600; margin: 0.75em 0 0.25em; }\n.rte-content :deep(p) { margin: 0.5em 0; }\n.rte-content :deep(ul) { list-style-type: disc; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(ol) { list-style-type: decimal; padding-left: 1.5em; margin: 0.5em 0; }\n.rte-content :deep(blockquote) { border-left: 3px solid var(--color-primary); padding-left: 1em; margin: 0.5em 0; color: var(--color-on-surface-variant); }\n.rte-content :deep(code) { background: var(--color-surface-container-highest); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; }\n.rte-content :deep(pre) { background: var(--color-surface-container-highest); padding: 1em; border-radius: 8px; overflow-x: auto; margin: 0.5em 0; }\n.rte-content :deep(pre code) { background: none; padding: 0; }\n.rte-content :deep(a) { color: var(--color-primary); text-decoration: underline; }\n.rte-content :deep(mark) { background: var(--color-tertiary-container); color: var(--color-on-tertiary-container); padding: 0.1em 0.2em; border-radius: 2px; }\n.rte-content :deep(img) { max-width: 100%; height: auto; border-radius: 8px; margin: 0.5em 0; }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,IAAM,IAAS,EAAU,GAEnB,IAAQ,GAwBR,IAAI,SAAgD;GACxD,MAAM,EAAO;GACb,QAAQ,EAAO;GACf,WAAW,EAAO;GAClB,eAAe,EAAO;GACtB,WAAW,EAAO;GAClB,YAAY,EAAO;GACnB,aAAa,EAAO;GACpB,YAAY,EAAO;GACnB,MAAM,EAAO;GACb,WAAW,EAAO;GAClB,aAAa,EAAO;GACpB,YAAY,EAAO;GACnB,MAAM,EAAO;GACb,MAAM,EAAO;GACb,MAAM,EAAO;GACb,OAAO,EAAO;GACd,WAAW,EAAO;GAClB,UAAU,EAAO;GACjB,UAAU,EAAO;GACjB,UAAU,EAAO;GACjB,YAAY,EAAO;GACnB,aAAa,EAAO;GACpB,eAAe,EAAO;GACtB,QAAQ,EAAO;GACf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AyF,CAAzF,EAAyF,GAAA;KAApE,YAAA,EAAA;KAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAO,QAAA;KAAE,OAAM;KAAM,aAAY;KAAK,WAAO,EAAQ,GAAW,CAAA,OAAA,CAAA;;;;GAQvF,EAMU,GAAA;IANQ,YAAA,EAAA;IAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAe,QAAA;IAAG,OAAO,EAAA,MAAE;;IAEhC,SAAO,QACiE,CAAjF,EAAiF,GAAA;KAAxE,SAAQ;KAAQ,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAe;;KAAU,SAAA,QAAc,CAAX,EAAA,EAAA,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,CAAA;;IACpE,CAAA,GAAA,EAAuD,GAAA,EAA7C,SAAO,EAAY,GAAA;KAAE,SAAA,QAAc,CAAX,EAAA,EAAA,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,CAAA;;;IAH5C,SAAA,QAAwG,CAAxG,EAAwG,GAAA;KAAnF,YAAA,EAAA;KAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAQ,QAAA;KAAG,OAAO,EAAA,MAAE;KAAe,aAAY;KAAK,WAAO,EAAQ,GAAY,CAAA,OAAA,CAAA"}
@@ -370,6 +370,69 @@ html.theme-transitioning *::after {
370
370
  animation: m3-ripple 450ms cubic-bezier(0.2, 0, 0.8, 1) forwards;
371
371
  }
372
372
 
373
+ /* v-state-layer: M3 state layer opacities (StateTokens: hover 8%, focus 10%, pressed 10%, dragged 16%). Hover
374
+ only where there's a real hover, so a tap on a phone doesn't leave the layer on */
375
+ .m3-state-layer {
376
+ position: absolute;
377
+ inset: 0;
378
+ border-radius: inherit;
379
+ background: currentColor;
380
+ opacity: 0;
381
+ pointer-events: none;
382
+ transition: opacity 150ms linear;
383
+ }
384
+ @media (hover: hover) {
385
+ [data-m3-state-layer='']:hover > .m3-state-layer { opacity: 0.08; }
386
+ }
387
+ [data-m3-state-layer='']:focus-visible > .m3-state-layer,
388
+ [data-m3-state-layer='']:active > .m3-state-layer { opacity: 0.1; }
389
+ [data-m3-state-layer='dragged'] > .m3-state-layer { opacity: 0.16; }
390
+ [data-m3-state-layer]:is(:disabled, [aria-disabled='true']) > .m3-state-layer { opacity: 0; }
391
+
392
+ /* v-focus-ring: M3's focus indicator (3dp, secondary, 2dp outside), on keyboard focus only. Unlayered on purpose:
393
+ it beats an `outline-none` utility on the same element */
394
+ [data-m3-focus-ring='']:focus-visible,
395
+ [data-m3-focus-ring='within']:is(:focus-visible, :has(:focus-visible)) {
396
+ outline: 3px solid var(--m3-focus-ring-color, var(--color-secondary));
397
+ outline-offset: var(--m3-focus-ring-offset, 2px);
398
+ }
399
+
400
+ /* v-skeleton: the element as its own placeholder (MSkeleton's tint and animations). Unlayered, so it beats the
401
+ element's own bg-*, text-*, border-* and shadow-* utilities while loading */
402
+ [data-m3-skeleton] {
403
+ background: color-mix(in srgb, var(--color-on-surface) 10%, transparent);
404
+ border-color: transparent;
405
+ box-shadow: none;
406
+ color: transparent;
407
+ pointer-events: none;
408
+ user-select: none;
409
+ }
410
+ [data-m3-skeleton] > :not(.m3-skeleton-shimmer) { visibility: hidden; }
411
+ [data-m3-skeleton='pulse'] { animation: m3-skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
412
+ @keyframes m3-skeleton-pulse { 50% { opacity: 0.5; } }
413
+ .m3-skeleton-shimmer {
414
+ position: absolute;
415
+ inset: 0;
416
+ overflow: hidden;
417
+ border-radius: inherit;
418
+ pointer-events: none;
419
+ }
420
+ .m3-skeleton-shimmer::after {
421
+ content: '';
422
+ position: absolute;
423
+ inset: 0;
424
+ background: linear-gradient(90deg, transparent 0%, var(--color-on-surface) 50%, transparent 100%);
425
+ opacity: 0.06;
426
+ animation: m3-skeleton-wave 1.8s ease-in-out infinite;
427
+ }
428
+ @keyframes m3-skeleton-wave {
429
+ 0% { transform: translateX(-100%); }
430
+ 60%, 100% { transform: translateX(100%); }
431
+ }
432
+ @media (prefers-reduced-motion: reduce) {
433
+ [data-m3-skeleton='pulse'], .m3-skeleton-shimmer::after { animation: none; }
434
+ }
435
+
373
436
  @keyframes m3-ctx-in {
374
437
  from { transform: translateY(-6px) scale(0.94); }
375
438
  to { transform: translateY(0) scale(1); }