@m3ui-vue/m3ui-vue 1.2.1 → 1.3.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 (269) hide show
  1. package/dist/API.md +2914 -348
  2. package/dist/MButton-CuNzpoxm.js +172 -0
  3. package/dist/MButton-CuNzpoxm.js.map +1 -0
  4. package/dist/MDialog-HxEL-m58.js +173 -0
  5. package/dist/MDialog-HxEL-m58.js.map +1 -0
  6. package/dist/MIconButton-DoNotQ9v.js +282 -0
  7. package/dist/MIconButton-DoNotQ9v.js.map +1 -0
  8. package/dist/MListItem-DnPtv-hY.js +824 -0
  9. package/dist/MListItem-DnPtv-hY.js.map +1 -0
  10. package/dist/MLoadingIndicator-BQMNX6Dx.js +115 -0
  11. package/dist/MLoadingIndicator-BQMNX6Dx.js.map +1 -0
  12. package/dist/MMenuItem-Bih0h4-n.js +604 -0
  13. package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
  14. package/dist/MProgressBar-BCoruxA-.js +184 -0
  15. package/dist/MProgressBar-BCoruxA-.js.map +1 -0
  16. package/dist/MSeekBar-LURE1Ah7.js +435 -0
  17. package/dist/MSeekBar-LURE1Ah7.js.map +1 -0
  18. package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
  19. package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
  20. package/dist/MSlider-_J4IS2_z.js +691 -0
  21. package/dist/MSlider-_J4IS2_z.js.map +1 -0
  22. package/dist/MSpinner-BhkMYKOM.js +65 -0
  23. package/dist/MSpinner-BhkMYKOM.js.map +1 -0
  24. package/dist/MTextField-CkzwNBWS.js +296 -0
  25. package/dist/MTextField-CkzwNBWS.js.map +1 -0
  26. package/dist/MTooltip-B67ZDSGp.js +756 -0
  27. package/dist/MTooltip-B67ZDSGp.js.map +1 -0
  28. package/dist/_storageKeys-CYXsUBwK.js +18 -0
  29. package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
  30. package/dist/_useEscapeStack-CjndQhqg.js +19 -0
  31. package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
  32. package/dist/api.json +1 -1
  33. package/dist/chart.js +1 -1
  34. package/dist/code-editor.js +1 -1
  35. package/dist/components/MAudioPlayer.vue.d.ts +115 -0
  36. package/dist/components/MBadge.vue.d.ts +1 -1
  37. package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
  38. package/dist/components/MBox.vue.d.ts +1 -1
  39. package/dist/components/MButton.vue.d.ts +1 -1
  40. package/dist/components/MConfirmDialog.vue.d.ts +1 -1
  41. package/dist/components/MCopyButton.vue.d.ts +2 -2
  42. package/dist/components/MDataTable.vue.d.ts +2 -2
  43. package/dist/components/MDialog.vue.d.ts +2 -2
  44. package/dist/components/MDivider.vue.d.ts +1 -1
  45. package/dist/components/MDragHandle.vue.d.ts +1 -1
  46. package/dist/components/MDrawCanvas.vue.d.ts +148 -0
  47. package/dist/components/MDrawLayers.vue.d.ts +3 -0
  48. package/dist/components/MDrawToolbar.vue.d.ts +34 -0
  49. package/dist/components/MExportButton.vue.d.ts +1 -1
  50. package/dist/components/MFab.vue.d.ts +2 -2
  51. package/dist/components/MFabMenu.vue.d.ts +2 -2
  52. package/dist/components/MFixed.vue.d.ts +1 -1
  53. package/dist/components/MFlex.vue.d.ts +2 -2
  54. package/dist/components/MFloorPlan.vue.d.ts +160 -0
  55. package/dist/components/MFlow.vue.d.ts +305 -0
  56. package/dist/components/MFlowControls.vue.d.ts +33 -0
  57. package/dist/components/MFlowHandle.vue.d.ts +16 -0
  58. package/dist/components/MFlowMinimap.vue.d.ts +22 -0
  59. package/dist/components/MFlowNode.vue.d.ts +35 -0
  60. package/dist/components/MGantt.vue.d.ts +141 -0
  61. package/dist/components/MGanttControls.vue.d.ts +32 -0
  62. package/dist/components/MIconButton.vue.d.ts +3 -1
  63. package/dist/components/MImageCropper.vue.d.ts +110 -0
  64. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  65. package/dist/components/MLightbox.vue.d.ts +2 -2
  66. package/dist/components/MList.vue.d.ts +1 -1
  67. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  68. package/dist/components/MMap.vue.d.ts +1 -1
  69. package/dist/components/MMapControl.vue.d.ts +1 -1
  70. package/dist/components/MMapSearch.vue.d.ts +1 -1
  71. package/dist/components/MMaskField.vue.d.ts +12 -1
  72. package/dist/components/MMenu.vue.d.ts +1 -1
  73. package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
  74. package/dist/components/MNumberField.vue.d.ts +11 -2
  75. package/dist/components/MPdfViewer.vue.d.ts +174 -0
  76. package/dist/components/MPullToRefresh.vue.d.ts +1 -1
  77. package/dist/components/MResourceTimeline.vue.d.ts +149 -0
  78. package/dist/components/MScheduler.vue.d.ts +3 -3
  79. package/dist/components/MScheme.vue.d.ts +1 -1
  80. package/dist/components/MSearchField.vue.d.ts +1 -1
  81. package/dist/components/MSeekBar.vue.d.ts +1 -1
  82. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  83. package/dist/components/MSkeleton.vue.d.ts +1 -1
  84. package/dist/components/MSlider.vue.d.ts +4 -4
  85. package/dist/components/MSparkline.vue.d.ts +1 -1
  86. package/dist/components/MSplitter.vue.d.ts +1 -1
  87. package/dist/components/MStack.vue.d.ts +2 -2
  88. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  89. package/dist/components/MSwitch.vue.d.ts +1 -1
  90. package/dist/components/MTable.vue.d.ts +1 -1
  91. package/dist/components/MTagInput.vue.d.ts +12 -1
  92. package/dist/components/MTextField.vue.d.ts +13 -2
  93. package/dist/components/MToolbar.vue.d.ts +1 -1
  94. package/dist/components/MTree.vue.d.ts +2 -2
  95. package/dist/components/MVideoPlayer.vue.d.ts +253 -0
  96. package/dist/components/MVirtualTable.vue.d.ts +1 -1
  97. package/dist/components/MWindow.vue.d.ts +3 -3
  98. package/dist/components/_MFlowEdge.vue.d.ts +9 -0
  99. package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
  100. package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
  101. package/dist/components/_MPdfPage.vue.d.ts +76 -0
  102. package/dist/components/_MTimeBackground.vue.d.ts +14 -0
  103. package/dist/components/_MTimeHeader.vue.d.ts +20 -0
  104. package/dist/composables/_effectCanvas.d.ts +23 -0
  105. package/dist/composables/_flowPanel.d.ts +2 -0
  106. package/dist/composables/_flowSlot.d.ts +5 -0
  107. package/dist/composables/_ganttTime.d.ts +41 -0
  108. package/dist/composables/_storageKeys.d.ts +9 -0
  109. package/dist/composables/_useTimeAxis.d.ts +90 -0
  110. package/dist/composables/drawGeometry.d.ts +119 -0
  111. package/dist/composables/flowFormats.d.ts +79 -0
  112. package/dist/composables/flowLayout.d.ts +45 -0
  113. package/dist/composables/flowPaths.d.ts +53 -0
  114. package/dist/composables/ganttFormats.d.ts +52 -0
  115. package/dist/composables/ganttSchedule.d.ts +99 -0
  116. package/dist/composables/themeInitScript.d.ts +2 -0
  117. package/dist/composables/useConfetti.d.ts +19 -8
  118. package/dist/composables/useDrawing.d.ts +44 -0
  119. package/dist/composables/useFireworks.d.ts +37 -0
  120. package/dist/composables/useFlow.d.ts +266 -0
  121. package/dist/composables/useGantt.d.ts +87 -0
  122. package/dist/composables/useLocale.d.ts +163 -0
  123. package/dist/composables/useMediaPlayer.d.ts +101 -0
  124. package/dist/composables/usePdf.d.ts +119 -0
  125. package/dist/composables/useReactions.d.ts +32 -0
  126. package/dist/composables/useResourceTimeline.d.ts +70 -0
  127. package/dist/composables/viewportHints.d.ts +2 -0
  128. package/dist/directives/vSparkle.d.ts +27 -0
  129. package/dist/draw.d.ts +7 -0
  130. package/dist/draw.js +1700 -0
  131. package/dist/draw.js.map +1 -0
  132. package/dist/flow.d.ts +14 -0
  133. package/dist/flow.js +3542 -0
  134. package/dist/flow.js.map +1 -0
  135. package/dist/flowPaths-CUc6X373.js +161 -0
  136. package/dist/flowPaths-CUc6X373.js.map +1 -0
  137. package/dist/gantt.d.ts +12 -0
  138. package/dist/gantt.js +3575 -0
  139. package/dist/gantt.js.map +1 -0
  140. package/dist/index.d.ts +11 -1
  141. package/dist/locales/index.js +1148 -7
  142. package/dist/locales/index.js.map +1 -1
  143. package/dist/m3ui-vue.css +1 -1
  144. package/dist/m3ui.js +7822 -7809
  145. package/dist/m3ui.js.map +1 -1
  146. package/dist/map.js +593 -588
  147. package/dist/map.js.map +1 -1
  148. package/dist/media.d.ts +5 -0
  149. package/dist/media.js +1311 -0
  150. package/dist/media.js.map +1 -0
  151. package/dist/pdf.d.ts +4 -0
  152. package/dist/pdf.js +1871 -0
  153. package/dist/pdf.js.map +1 -0
  154. package/dist/plugin.d.ts +10 -0
  155. package/dist/rich-text-editor.js +28 -26
  156. package/dist/rich-text-editor.js.map +1 -1
  157. package/dist/styles.css +1 -1
  158. package/dist/{useLocale-JYxDDeXC.js → useLocale-BpGxplLV.js} +165 -2
  159. package/dist/useLocale-BpGxplLV.js.map +1 -0
  160. package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-DQQcaWbE.js} +41 -40
  161. package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
  162. package/package.json +29 -5
  163. package/src/__tests__/MAudioPlayer.test.ts +75 -0
  164. package/src/__tests__/MDrawCanvas.test.ts +110 -0
  165. package/src/__tests__/MFloorPlan.test.ts +97 -0
  166. package/src/__tests__/MFlow.test.ts +575 -0
  167. package/src/__tests__/MGantt.test.ts +130 -0
  168. package/src/__tests__/MImageCropper.test.ts +89 -0
  169. package/src/__tests__/MPdfViewer.test.ts +235 -0
  170. package/src/__tests__/MResourceTimeline.test.ts +102 -0
  171. package/src/__tests__/MSlider.test.ts +36 -0
  172. package/src/__tests__/MVideoPlayer.test.ts +201 -0
  173. package/src/__tests__/drawGeometry.test.ts +58 -0
  174. package/src/__tests__/fieldExpose.test.ts +30 -0
  175. package/src/__tests__/flowFormats.test.ts +185 -0
  176. package/src/__tests__/flowLayout.test.ts +113 -0
  177. package/src/__tests__/ganttFormats.test.ts +76 -0
  178. package/src/__tests__/ganttSchedule.test.ts +136 -0
  179. package/src/__tests__/pdfMock.ts +83 -0
  180. package/src/__tests__/plugin.test.ts +56 -1
  181. package/src/__tests__/ssr.test.ts +1 -1
  182. package/src/__tests__/themeInitScript.test.ts +10 -0
  183. package/src/__tests__/useConfetti.test.ts +33 -2
  184. package/src/__tests__/useFireworks.test.ts +104 -0
  185. package/src/__tests__/useMediaPlayer.test.ts +182 -0
  186. package/src/__tests__/usePdf.test.ts +102 -0
  187. package/src/__tests__/useReactions.test.ts +51 -0
  188. package/src/__tests__/vSparkle.test.ts +83 -0
  189. package/src/components/MAudioPlayer.vue +319 -0
  190. package/src/components/MDrawCanvas.vue +813 -0
  191. package/src/components/MDrawLayers.vue +114 -0
  192. package/src/components/MDrawToolbar.vue +171 -0
  193. package/src/components/MEmojiSelector.vue +3 -2
  194. package/src/components/MFloorPlan.vue +581 -0
  195. package/src/components/MFlow.vue +2049 -0
  196. package/src/components/MFlowControls.vue +110 -0
  197. package/src/components/MFlowHandle.vue +60 -0
  198. package/src/components/MFlowMinimap.vue +134 -0
  199. package/src/components/MFlowNode.vue +98 -0
  200. package/src/components/MGantt.vue +1609 -0
  201. package/src/components/MGanttControls.vue +77 -0
  202. package/src/components/MIconButton.vue +3 -1
  203. package/src/components/MImageCropper.vue +507 -0
  204. package/src/components/MMap.vue +3 -2
  205. package/src/components/MMaskField.vue +13 -0
  206. package/src/components/MNumberField.vue +13 -0
  207. package/src/components/MPdfViewer.vue +1269 -0
  208. package/src/components/MResourceTimeline.vue +1020 -0
  209. package/src/components/MSlider.vue +22 -4
  210. package/src/components/MTagInput.vue +13 -0
  211. package/src/components/MTextField.vue +24 -4
  212. package/src/components/MVideoPlayer.vue +839 -0
  213. package/src/components/_MFlowEdge.vue +100 -0
  214. package/src/components/_MFlowEdgeLabel.vue +56 -0
  215. package/src/components/_MFlowNodeShell.vue +111 -0
  216. package/src/components/_MPdfPage.vue +456 -0
  217. package/src/components/_MTimeBackground.vue +16 -0
  218. package/src/components/_MTimeHeader.vue +31 -0
  219. package/src/composables/_colorUtils.ts +4 -2
  220. package/src/composables/_effectCanvas.ts +109 -0
  221. package/src/composables/_flowPanel.ts +13 -0
  222. package/src/composables/_flowSlot.ts +6 -0
  223. package/src/composables/_ganttTime.ts +200 -0
  224. package/src/composables/_ssrState.ts +2 -2
  225. package/src/composables/_storageKeys.ts +28 -0
  226. package/src/composables/_useTimeAxis.ts +224 -0
  227. package/src/composables/drawGeometry.ts +405 -0
  228. package/src/composables/flowFormats.ts +916 -0
  229. package/src/composables/flowLayout.ts +297 -0
  230. package/src/composables/flowPaths.ts +239 -0
  231. package/src/composables/ganttFormats.ts +366 -0
  232. package/src/composables/ganttSchedule.ts +403 -0
  233. package/src/composables/themeInitScript.ts +5 -2
  234. package/src/composables/useColorPalette.ts +36 -8
  235. package/src/composables/useConfetti.ts +84 -107
  236. package/src/composables/useDrawing.ts +53 -0
  237. package/src/composables/useFireworks.ts +360 -0
  238. package/src/composables/useFlow.ts +250 -0
  239. package/src/composables/useGantt.ts +92 -0
  240. package/src/composables/useLocale.ts +328 -0
  241. package/src/composables/useMediaPlayer.ts +406 -0
  242. package/src/composables/usePdf.ts +456 -0
  243. package/src/composables/useReactions.ts +131 -0
  244. package/src/composables/useResourceTimeline.ts +76 -0
  245. package/src/composables/useTheme.ts +21 -4
  246. package/src/composables/viewportHints.ts +6 -5
  247. package/src/directives/vSparkle.ts +180 -0
  248. package/src/draw.ts +25 -0
  249. package/src/flow.ts +26 -0
  250. package/src/gantt.ts +12 -0
  251. package/src/index.ts +11 -1
  252. package/src/locales/de.ts +163 -0
  253. package/src/locales/es.ts +163 -0
  254. package/src/locales/fr.ts +163 -0
  255. package/src/locales/ja.ts +163 -0
  256. package/src/locales/ko.ts +163 -0
  257. package/src/locales/pt.ts +163 -0
  258. package/src/locales/zh.ts +163 -0
  259. package/src/media.ts +5 -0
  260. package/src/pdf.ts +15 -0
  261. package/src/plugin.ts +21 -5
  262. package/dist/MMenuItem-DI351kIf.js +0 -929
  263. package/dist/MMenuItem-DI351kIf.js.map +0 -1
  264. package/dist/MSlider-BnEy5ieZ.js +0 -1500
  265. package/dist/MSlider-BnEy5ieZ.js.map +0 -1
  266. package/dist/MTextField-BBmkaIbO.js +0 -633
  267. package/dist/MTextField-BBmkaIbO.js.map +0 -1
  268. package/dist/useLocale-JYxDDeXC.js.map +0 -1
  269. package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
package/dist/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # @m3ui-vue/m3ui-vue 1.2.1 — API reference
1
+ # @m3ui-vue/m3ui-vue 1.3.0 — API reference
2
2
 
3
3
  Material Design 3 components for Vue 3 + Tailwind CSS v4. Generated from the source by
4
4
  `scripts/generate-api.mjs`; full docs with live demos at https://m3ui.dev.
@@ -24,7 +24,7 @@ app.use(createM3UI({ palette: 'blue', locale: esLocale }))
24
24
  - Icons use the Material Symbols Outlined font (load it yourself, e.g. from Google Fonts); `icon` props take a
25
25
  Material Symbols name such as `'home'`.
26
26
  - Import components by name: `import { MButton, MDialog } from '@m3ui-vue/m3ui-vue'`. Components with heavy optional peer
27
- dependencies live in their own entry points (noted on each one): `@m3ui-vue/m3ui-vue/chart`, `@m3ui-vue/m3ui-vue/code-editor`, `@m3ui-vue/m3ui-vue/markdown`, `@m3ui-vue/m3ui-vue/rich-text-editor`, `@m3ui-vue/m3ui-vue/terminal`, `@m3ui-vue/m3ui-vue/qrcode`, `@m3ui-vue/m3ui-vue/barcode`, `@m3ui-vue/m3ui-vue/map`.
27
+ dependencies live in their own entry points (noted on each one): `@m3ui-vue/m3ui-vue/chart`, `@m3ui-vue/m3ui-vue/code-editor`, `@m3ui-vue/m3ui-vue/markdown`, `@m3ui-vue/m3ui-vue/rich-text-editor`, `@m3ui-vue/m3ui-vue/terminal`, `@m3ui-vue/m3ui-vue/qrcode`, `@m3ui-vue/m3ui-vue/barcode`, `@m3ui-vue/m3ui-vue/map`, `@m3ui-vue/m3ui-vue/media`, `@m3ui-vue/m3ui-vue/pdf`, `@m3ui-vue/m3ui-vue/flow`, `@m3ui-vue/m3ui-vue/gantt`, `@m3ui-vue/m3ui-vue/draw`.
28
28
  - Dark mode is the `dark` class on `<html>` (`useTheme()` manages it); palettes are `data-palette="<id>"` on `<html>`
29
29
  (`useColorPalette()`, or a scheme generated from any color with `setSeed()` / `createM3UI({ seed })`); contrast levels
30
30
  are `data-contrast="medium|high"` (`setContrast()` / `createM3UI({ contrast })`, needs the `palettes-contrast` import).
@@ -161,6 +161,54 @@ Props:
161
161
  Slots:
162
162
  - `#default` — Content, sized to fill the box.
163
163
 
164
+ ### MAudioPlayer
165
+
166
+ Import from `@m3ui-vue/m3ui-vue/media`.
167
+
168
+ An audio player (not an M3 spec component). `mini` is a port of Media3's Compose Material3 `MiniController` (androidx/media `ui_compose_material3`): artwork, title and artist, previous / play-pause / next and a thin progress line, on an elevated card; a click on it emits `click` (open your full player). `standard` is a full player bar: artwork and text, an `MSeekBar`, shuffle / previous / play / next / repeat, and volume. Plays `src`/`sources` in a hidden `<audio>`, or drives a `player` from `useMediaPlayer()` (keep it outside a page to play on while the app navigates, or give it a clock for generated audio). The queue is yours: the buttons emit `previous`/`next`, and stay in place, disabled, without `hasPrevious`/`hasNext` (as Media3's).
169
+
170
+ Props:
171
+ - `variant?: "standard" | "mini" = "standard"` — `mini`: Media3's MiniController (a compact card). `standard`: a full player bar
172
+ - `src?: string` — Audio URL
173
+ - `sources?: VideoSource[]` — Several formats of the audio; the browser plays the first it can
174
+ - `title?: string` — Track title (also shown on the lock screen)
175
+ - `artist?: string` — Artist (also shown on the lock screen)
176
+ - `album?: string` — Album, for the lock screen
177
+ - `artwork?: string` — Cover image URL
178
+ - `duration?: number` — Length in seconds, for a clock without `src` (with a file it comes from the file)
179
+ - `player?: MediaPlayer` — Drive this player instead of one of its own (from `useMediaPlayer()`). Read once
180
+ - `playing?: boolean` (v-model:playing) — Playing (v-model)
181
+ - `currentTime?: number` (v-model:currentTime) — Position in seconds (v-model)
182
+ - `rate?: number` (v-model:rate) — Playback speed (v-model)
183
+ - `volume?: number` (v-model:volume) — Volume, 0 to 1 (v-model)
184
+ - `muted?: boolean` (v-model:muted) — Muted (v-model)
185
+ - `shuffle?: boolean` (v-model:shuffle) — Shuffle (v-model); unset hides the button
186
+ - `repeat?: "off" | "all" | "one"` (v-model:repeat) — Repeat mode (v-model); unset hides the button
187
+ - `autoplay?: boolean = false` — Starts playing when mounted (browsers block it with sound before a user gesture)
188
+ - `hasPrevious?: boolean = false` — There is a previous track: enables the previous button (emits `previous`)
189
+ - `hasNext?: boolean = false` — There is a next track: enables the next button (emits `next`)
190
+ - `speeds?: number[]` — Speeds offered in a speed menu (`standard`); unset hides it
191
+ - `seekBar?: "slider" | "line" | "wavy" = "slider"` — The seek bar's look (`standard`)
192
+ - `color?: string = "primary"` — Played part and play button: an M3 role or any CSS color
193
+
194
+ Events:
195
+ - `error(MediaError | null)` — The audio failed to load or play, with the media element's error
196
+ - `update:playing(boolean)`
197
+ - `update:currentTime(number)`
198
+ - `update:rate(number)`
199
+ - `update:volume(number)`
200
+ - `update:muted(boolean)`
201
+ - `update:shuffle(boolean)`
202
+ - `update:repeat("off" | "all" | "one")`
203
+ - `previous()` — The previous button (or the lock screen's) was pressed
204
+ - `next()` — The next button (or the lock screen's) was pressed
205
+ - `ended()` — The track reached its end
206
+ - `click(MouseEvent)` — The mini player was clicked (outside its buttons)
207
+
208
+ Slots:
209
+ - `#artwork { player: MediaPlayer; }` — Replaces the artwork. Props: `{ player }`
210
+ - `#actions { player: MediaPlayer; }` — Extra buttons at the end of the controls (a like, a queue button). Props: `{ player }`
211
+
164
212
  ### MAutocomplete
165
213
 
166
214
  Like MSelect but with a text input for filtering. Type to search, arrow keys to navigate, Enter to select.
@@ -274,7 +322,7 @@ M3's bottom app bar (a port of Compose's `BottomAppBar`): navigation and key act
274
322
 
275
323
  Props:
276
324
  - `flexible?: boolean = false` — M3 Expressive's FlexibleBottomAppBar: 64px instead of 80px, 16px side padding, no FAB slot
277
- - `arrangement?: "start" | "between" | "around" | "evenly" | "fixed"` — How the actions are spread: `start` (the standard bar's), `between` (the flexible bar's default), `around`, `evenly`, or `fixed` (centered, 32px apart: FlexibleFixedHorizontalArrangement)
325
+ - `arrangement?: "fixed" | "start" | "between" | "around" | "evenly"` — How the actions are spread: `start` (the standard bar's), `between` (the flexible bar's default), `around`, `evenly`, or `fixed` (centered, 32px apart: FlexibleFixedHorizontalArrangement)
278
326
  - `color?: "surface" | "primary" | "secondary" | "tertiary" = "surface"` — Container color: surface-container, or a color's container for a vibrant bar
279
327
  - `scrollBehavior?: "pinned" | "exit-always" = "pinned"` — `pinned` stays put; `exit-always` collapses while the content scrolls down and returns when it scrolls up
280
328
  - `scrollTarget?: string | HTMLElement | null = null` — What `exit-always` follows: an element or a CSS selector for it. Defaults to the window
@@ -538,7 +586,7 @@ Props:
538
586
  - `status?: "sent" | "delivered" | "read"` — Message status icon next to the timestamp (right-side only)
539
587
  - `color?: "primary" | "secondary" | "tertiary" = "primary"` — Bubble color for sent (right-side) messages
540
588
  - `tail?: boolean = true` — Show the bubble tail (a sharper corner on the side nearest the sender)
541
- - `size?: "medium" | "small" | "large" = "medium"` — Text size (body-small / body-medium / body-large)
589
+ - `size?: "small" | "medium" | "large" = "medium"` — Text size (body-small / body-medium / body-large)
542
590
  - `maxWidth?: string = "320px"` — Max bubble width (px, %, or var()) — supports a CSS variable for responsive control
543
591
  - `typing?: "text" | "audio"` — Shows a live indicator instead of the content: bouncing dots while the other person types, or a mic with a moving waveform while they record audio.
544
592
 
@@ -779,7 +827,7 @@ Props:
779
827
  - `copiedIcon?: string = "check"` — Icon shown right after a successful copy
780
828
  - `label?: string = "Copy"` — aria-label in the idle state
781
829
  - `copiedLabel?: string = "Copied"` — aria-label right after a successful copy
782
- - `variant?: "filled" | "outlined" | "tonal" | "standard" = "standard"` — Visual style (same as MIconButton)
830
+ - `variant?: "standard" | "filled" | "outlined" | "tonal" = "standard"` — Visual style (same as MIconButton)
783
831
  - `shape?: "rounded" | "squared" = "rounded"` — Button shape
784
832
  - `size?: number | "xs" | "sm" | "md" | "lg" | "xl" = "sm"` — Button size
785
833
  - `disabled?: boolean = false` — Disables the button
@@ -1017,6 +1065,91 @@ Props:
1017
1065
  - `orientation?: "horizontal" | "vertical" = "vertical"` — `vertical` is a tall capsule for horizontal drags (between side-by-side panes); `horizontal` is a wide one for vertical drags.
1018
1066
  - `dragging?: boolean = false` — Show the dragged look (the parent is dragging)
1019
1067
 
1068
+ ### MDrawCanvas
1069
+
1070
+ Import from `@m3ui-vue/m3ui-vue/draw`.
1071
+
1072
+ A drawing surface: pens that follow a stylus' pressure, an eraser that cuts strokes (and the pen's eraser end), lines, arrows, rectangles, ellipses, text, lasso selection to move, scale or delete, layers, undo and redo, pan and pinch zoom. An infinite canvas, or pages of a fixed size. The drawing is plain data (`v-model`, a list of strokes, shapes and texts), exported as SVG or PNG. Put an MDrawToolbar (or your own, with `useDrawing()`) in its default slot. Not an M3 spec component. Gestures: draw with the pen, mouse or a finger; two fingers pan and zoom (and cancel a stroke a finger just started); the wheel pans, Ctrl + wheel zooms; Space + drag or the middle button pans. With `penOnly` (by default once a stylus has been used) fingers only pan and zoom, so a palm on the screen doesn't draw. Keys: Ctrl+Z undo, Ctrl+Shift+Z or Ctrl+Y redo, Delete removes the selection, Escape drops it, Ctrl+A selects everything.
1073
+
1074
+ Props:
1075
+ - `mode?: "infinite" | "pages" = "infinite"` — An endless canvas, or pages of `pageSize` stacked one under another
1076
+ - `pageSize?: { width: number; height: number; } = { width: 794, height: 1123 }` — A page's size in drawing units (A4 at 96 dpi by default)
1077
+ - `paper?: string = "#ffffff"` — The paper's color (pages, or the whole infinite canvas)
1078
+ - `background?: "none" | "grid" | "dots" | "lines" = "none"` — A ruling drawn on the paper
1079
+ - `backgroundSize?: number = 24` — The ruling's spacing
1080
+ - `backgroundImage?: string` — An image under the drawing, to trace or annotate: fills each page, or sits at (0, 0) on an infinite canvas
1081
+ - `penOnly?: boolean | "auto" = "auto"` — Fingers only pan and zoom: `true`, `false`, or `'auto'` (once a stylus has touched the canvas)
1082
+ - `pressure?: boolean = true` — Use the stylus' pressure (without one, speed thins the line)
1083
+ - `smoothing?: number = 0.5` — How much strokes are smoothed, 0–1
1084
+ - `eraserSize?: number = 12` — The eraser's radius in screen pixels
1085
+ - `history?: boolean = true` — Undo and redo
1086
+ - `historySize?: number = 100`
1087
+ - `readonly?: boolean = false` — Look only: no drawing, but pan and zoom
1088
+ - `minZoom?: number = 0.1`
1089
+ - `maxZoom?: number = 8`
1090
+ - `label?: string` — Accessible name of the canvas
1091
+ - `modelValue?: DrawItem[] = []` (v-model) — The drawing: strokes, shapes and texts
1092
+ - `tool?: DrawTool = "pen"` (v-model:tool)
1093
+ - `color?: string = "#1d1b20"` (v-model:color)
1094
+ - `size?: number = 4` (v-model:size) — Pen width, shape line width or font size, by tool
1095
+ - `fill?: boolean = false` (v-model:fill) — New rects and ellipses are filled with the color
1096
+ - `layers?: DrawLayer[] = []` (v-model:layers) — Layers, bottom first (none: one implicit layer)
1097
+ - `layer?: string` (v-model:layer) — The layer new items go on (default: the top one)
1098
+ - `pages?: number = 1` (v-model:pages) — How many pages, in `mode="pages"`
1099
+ - `selection?: string[] = []` (v-model:selection) — The selected items' ids
1100
+ - `viewport?: { x: number; y: number; zoom: number; } = { x: 0, y: 0, zoom: 1 }` (v-model:viewport) — Pan and zoom: screen = drawing × zoom + (x, y)
1101
+
1102
+ Events:
1103
+ - `update:modelValue(value: DrawItem[])`
1104
+ - `update:tool(value: DrawTool)`
1105
+ - `update:color(value: string)`
1106
+ - `update:size(value: number)`
1107
+ - `update:fill(value: boolean)`
1108
+ - `update:layers(value: DrawLayer[])`
1109
+ - `update:layer(value: string | undefined)`
1110
+ - `update:pages(value: number)`
1111
+ - `update:selection(value: string[])`
1112
+ - `update:viewport(value: { x: number; y: number; zoom: number; })`
1113
+ - `change(items: DrawItem[])` — Fires after every edit with the new items (the same as `update:modelValue`)
1114
+
1115
+ Slots:
1116
+ - `#default` — Overlays: a toolbar (MDrawToolbar), a layers panel (MDrawLayers), anything positioned over the canvas
1117
+
1118
+ Exposed (template ref):
1119
+ - `undo: () => void`
1120
+ - `redo: () => void`
1121
+ - `clear: () => void`
1122
+ - `deleteSelection: () => void`
1123
+ - `fitView: () => void`
1124
+ - `zoomIn: () => void`
1125
+ - `zoomOut: () => void`
1126
+ - `exportSvg: (opts?: DrawExportOptions) => string`
1127
+ - `exportPng: (opts?: DrawExportOptions) => Promise<Blob>`
1128
+ - `toContent: (e: { clientX: number; clientY: number; }) => { x: number; y: number; }`
1129
+
1130
+ ### MDrawLayers
1131
+
1132
+ Import from `@m3ui-vue/m3ui-vue/draw`.
1133
+
1134
+ The layers of an MDrawCanvas (put it in its default slot, or anywhere inside it): pick the one you draw on, show or hide, lock, rename (double-click), reorder, add and delete. Top layer first, as drawing apps list them. Deleting a layer deletes what's on it. Not an M3 spec component.
1135
+
1136
+ ### MDrawToolbar
1137
+
1138
+ Import from `@m3ui-vue/m3ui-vue/draw`.
1139
+
1140
+ A floating toolbar for an MDrawCanvas (put it in its default slot): select and pan, the pens, the erasers, shapes (with fill), text, colors, sizes, undo and redo. Pens, erasers and shapes are each one button that remembers the last one picked, with a menu for the others. Sits at the bottom center by default (style its root to move it). Not an M3 spec component.
1141
+
1142
+ Props:
1143
+ - `tools?: DrawTool[] = ["select", "pan", "pen", "brush", "marker", "highlighter", "eraser", "stroke-eraser", "line", "arrow", "rect", "ellipse", "text"]` — The tools offered (in groups: pens, erasers and shapes share a button each)
1144
+ - `colors?: string[] = ["#1d1b20", "#e53935", "#fb8c00", "#fdd835", "#43a047", "#1e88e5", "#8e24aa", "#ffffff"]` — Color swatches
1145
+ - `sizes?: number[] = [2, 4, 8, 16]` — Sizes offered (pen width; a shape's line is the same, text is 4× it)
1146
+ - `history?: boolean = true` — Undo and redo
1147
+ - `customColor?: boolean = true` — A button that opens a color picker for any color
1148
+
1149
+ Slots:
1150
+ - `#default` — More controls at the start
1151
+ - `#end` — More controls at the end
1152
+
1020
1153
  ### MEmoji
1021
1154
 
1022
1155
  Renders a single emoji character at a fixed pixel size, with optional accessible labeling.
@@ -1123,7 +1256,7 @@ Props:
1123
1256
  - `label?: string` — Extended FAB label text
1124
1257
  - `expanded?: boolean = true` — Extended FAB only: false collapses it to a plain FAB (the label fades out and the width shrinks to a square), e.g. while the content scrolls. Compose's `expanded`
1125
1258
  - `color?: "surface" | "primary" | "secondary" | "tertiary"` — Color scheme; defaults to primary, or secondary inside an MBottomAppBar
1126
- - `size?: "medium" | "small" | "large" | "regular" = "regular"` — FAB size. With a `label`, small/medium/large are M3 Expressive's extended FABs (56/80/96px, title-medium, title-large and headline-small labels); regular is the baseline extended FAB
1259
+ - `size?: "small" | "medium" | "large" | "regular" = "regular"` — FAB size. With a `label`, small/medium/large are M3 Expressive's extended FABs (56/80/96px, title-medium, title-large and headline-small labels); regular is the baseline extended FAB
1127
1260
  - `disabled?: boolean = false` — Disables interaction
1128
1261
  - `items?: SpeedDialItem[]` — Speed-dial child items (see `SpeedDialItem`)
1129
1262
  - `direction?: "right" | "left" | "up" | "down" | "radial" = "up"` — Speed-dial expand direction
@@ -1250,6 +1383,292 @@ Props:
1250
1383
  Slots:
1251
1384
  - `#default` — The flex items.
1252
1385
 
1386
+ ### MFloorPlan
1387
+
1388
+ A floor plan of tables: to arrange them (`editable`: drag one or several, snapped to a grid, arrows nudge) and to run service (each table colored by its status, with a badge, a click to open it). Merged tables are drawn as one group. Positions are plan units scaled to the component's width, so the same plan fits a phone and a wall screen. Not an M3 spec component.
1389
+
1390
+ Props:
1391
+ - `width?: number = 1000` — The plan's size in plan units
1392
+ - `height?: number = 600`
1393
+ - `statuses?: Record<string, FloorStatus> = {
1394
+ free: { label: "Free", color: "surface" },
1395
+ occupied: { label: "Occupied", color: "primary", icon: "restaurant" },
1396
+ bill: { label: "Bill requested", color: "tertiary", icon: "receipt_long" },
1397
+ reserved: { label: "Reserved", color: "secondary", icon: "event" },
1398
+ }` — Status keys to their look
1399
+ - `editable?: boolean = false` — Drag tables around; otherwise a click opens one
1400
+ - `grid?: number = 10` — Grid step in plan units (0: no snapping)
1401
+ - `showGrid?: boolean = true` — Draw the grid while editing
1402
+ - `chairs?: boolean = true` — Draw chairs from `seats`
1403
+ - `label?: string` — Accessible name
1404
+ - `tables?: FloorTable[] = []` (v-model:tables)
1405
+ - `merges?: FloorMerge[] = []` (v-model:merges)
1406
+ - `selection?: (string | number)[] = []` (v-model:selection)
1407
+ - `areas?: FloorArea[] = []` (v-model:areas)
1408
+ - `walls?: FloorWall[] = []` (v-model:walls)
1409
+ - `decor?: FloorDecor[] = []` (v-model:decor)
1410
+ - `tool?: "select" | "area" | "wall" = "select"` (v-model:tool) — While editing: `select` moves things, `wall` draws a wall (click each corner, double-click or Enter to end), `area` drags out a zone
1411
+
1412
+ Events:
1413
+ - `update:tool(value: "select" | "area" | "wall")`
1414
+ - `update:selection(value: (string | number)[])`
1415
+ - `update:tables(value: FloorTable[])`
1416
+ - `update:merges(value: FloorMerge[])`
1417
+ - `update:areas(value: FloorArea[])`
1418
+ - `update:walls(value: FloorWall[])`
1419
+ - `update:decor(value: FloorDecor[])`
1420
+ - `table-click(table: FloorTable, event: MouseEvent | KeyboardEvent)` — A table was clicked or opened with Enter (not after a drag)
1421
+ - `move(moved: { id: string | number; x: number; y: number; }[])` — Tables moved by a drag or the arrows, with their new positions (`{ id, x, y }[]`), to save them
1422
+
1423
+ Slots:
1424
+ - `#table { table: FloorTable; status: FloorStatus | undefined; selected: boolean; }` — The inside of a table: `{ table, status, selected }`
1425
+
1426
+ ```ts
1427
+ /** A table on the plan, in plan units (not pixels) */
1428
+ export interface FloorTable {
1429
+ id: string | number
1430
+ label: string
1431
+ x: number
1432
+ y: number
1433
+ shape?: 'round' | 'square' | 'rect'
1434
+ seats?: number
1435
+ /** Size in plan units (default: from the shape and the seats) */
1436
+ width?: number
1437
+ height?: number
1438
+ /** Degrees */
1439
+ rotation?: number
1440
+ /** A key of `statuses` */
1441
+ status?: string
1442
+ /** A small badge: minutes seated, the total, a count… */
1443
+ badge?: string | number
1444
+ data?: Record<string, unknown>
1445
+ }
1446
+ ```
1447
+
1448
+ ```ts
1449
+ /** Tables joined together (drawn as one group) */
1450
+ export interface FloorMerge {
1451
+ id: string | number
1452
+ tables: (string | number)[]
1453
+ label?: string
1454
+ }
1455
+ ```
1456
+
1457
+ ```ts
1458
+ /** How a status looks: an M3 color role ('primary', 'tertiary', 'error'…) or any CSS color, an icon, a name */
1459
+ export interface FloorStatus {
1460
+ label: string
1461
+ color: string
1462
+ icon?: string
1463
+ }
1464
+ ```
1465
+
1466
+ ```ts
1467
+ /** A zone of the room (terrace, main hall, VIP): a rectangle behind the tables */
1468
+ export interface FloorArea {
1469
+ id: string | number
1470
+ label?: string
1471
+ x: number
1472
+ y: number
1473
+ width: number
1474
+ height: number
1475
+ /** An M3 color role or any CSS color */
1476
+ color?: string
1477
+ }
1478
+ ```
1479
+
1480
+ ```ts
1481
+ /** A wall: a line through its points */
1482
+ export interface FloorWall {
1483
+ id: string | number
1484
+ points: [number, number][]
1485
+ thickness?: number
1486
+ }
1487
+ ```
1488
+
1489
+ ```ts
1490
+ /** Something on the plan that isn't a table: a door, a window, a plant, a column, the register, a text label… */
1491
+ export interface FloorDecor {
1492
+ id: string | number
1493
+ kind: 'door' | 'window' | 'plant' | 'column' | 'restroom' | 'kitchen' | 'register' | 'stairs' | 'label'
1494
+ x: number
1495
+ y: number
1496
+ width?: number
1497
+ height?: number
1498
+ rotation?: number
1499
+ /** The text of a label (or a caption under the others) */
1500
+ label?: string
1501
+ }
1502
+ ```
1503
+
1504
+ ### MFlow
1505
+
1506
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1507
+
1508
+ A node editor (not an M3 spec component): nodes you drag around on a canvas that pans and zooms, joined by edges drawn from handle to handle. Built from M3 pieces (nodes are cards, the controls a floating toolbar) with the API shape of Vue Flow / React Flow. Nodes and edges are `v-model`s of plain objects; the view, the selection and the lock are too. Pan by dragging the background (or the wheel, or two fingers), zoom with Ctrl + wheel, a trackpad or touch pinch, or a double click. Shift + drag (or `selectionOnDrag`; on touch, a long press on the background) draws a selection box; Delete removes what's selected, Ctrl+Z/Ctrl+Shift+Z undo and redo, Ctrl+C/X/V/A copy, cut, paste and select all, and the arrows move the selected nodes. A drag from a handle to another connects them; dropped on nothing it fires `connect-end` with the spot, to offer a new node there. To disconnect: the × on a selected edge, Delete, dragging an edge's end (or a connected input) away and dropping it on nothing. Alignment guides show while dragging one node. Nodes are drawn by type: `default`/`input`/`output` (an MFlowNode), `circle` (a vertex: `data.label`, `color`, `badge`, `ring`, `size`; its edges run center to center in any direction), `group` (a box its children move with), or a `#node-<type>` slot of your own with MFlowHandles in it; edges are `bezier`, `smoothstep`, `step`, `straight` or a `#edge-<type>` slot (with `getBezierPath` and friends); `color`, `width`, `dashed`, `animated` and `labelTone` restyle one without a slot, with a transition. `layout` lays them out (`'tree'`, `'layered'` or a function, e.g. one calling dagre) whenever the graph's shape changes. Put `MFlowControls`, `MFlowMinimap` or anything of yours in the default slot: it's drawn over the canvas, the canvas's gestures and wheel leave it alone, and `useFlow()` works inside it. Inside a node, controls (buttons, inputs, links) never start a drag; mark anything else that shouldn't with `data-flow-nodrag`, and an area that scrolls on its own with `data-flow-nowheel`. `startDrag(id, event)` hands a pointer that's already down to a node, to drag something in from outside (a palette). Positions spring to their new place when they change from outside (a layout, an undo); the view springs on `fitView()`/zoom buttons. Nodes are rendered by small components of their own so moving one only redraws it and its edges.
1509
+
1510
+ Props:
1511
+ - `nodes?: FlowNode<any>[] = []` (v-model:nodes)
1512
+ - `edges?: FlowEdge<any>[] = []` (v-model:edges)
1513
+ - `viewport?: FlowViewport` (v-model:viewport) — The view (v-model)
1514
+ - `selection?: FlowSelection` (v-model:selection) — Selected node and edge ids (v-model)
1515
+ - `locked?: boolean = false` (v-model:locked) — Switches off moving, connecting, selecting and deleting; the view still pans and zooms (v-model)
1516
+ - `direction?: "horizontal" | "vertical" = "horizontal"` — Which way edges run by default: where the default node's handles go and the layout's direction
1517
+ - `background?: "none" | "grid" | "dots" = "dots"`
1518
+ - `gridSize?: number = 20` — The background's spacing, and the grid nodes snap to, px
1519
+ - `snapToGrid?: boolean = false`
1520
+ - `minZoom?: number = 0.2`
1521
+ - `maxZoom?: number = 4`
1522
+ - `fitView?: boolean = false` — Fits the nodes in view once they're measured, and again after each automatic `layout`
1523
+ - `wheel?: "pan" | "zoom" = "pan"` — What the plain wheel does (Ctrl + wheel always zooms)
1524
+ - `zoomOnDoubleClick?: boolean = true` — A double click on the background zooms in
1525
+ - `panOnDrag?: boolean = true` — Dragging the background pans; off, it draws a selection box
1526
+ - `selectionOnDrag?: boolean = false` — Dragging the background draws a selection box (Shift + drag always does)
1527
+ - `nodesDraggable?: boolean = true`
1528
+ - `nodesConnectable?: boolean = true`
1529
+ - `elementsSelectable?: boolean = true`
1530
+ - `edgesReconnectable?: boolean = true`
1531
+ - `defaultEdgeOptions?: Partial<FlowEdge<any>>` — Merged into edges made by connecting (`type`, `animated`, `markerEnd`…)
1532
+ - `autoConnect?: boolean = true` — Adds an edge to `edges` when a connection is made; off, only `connect` fires
1533
+ - `isValidConnection?: ((c: FlowConnection) => boolean)` — Whether a connection may be made (no duplicates or same-node loops are offered either way)
1534
+ - `connectionRadius?: number = 24` — How close to a handle a connection snaps to it, px
1535
+ - `beforeDelete?: ((items: { nodes: FlowNode<any>[]; edges: FlowEdge<any>[]; }) => boolean | Promise<boolean>)` — Asked before anything is deleted (the keyboard, an edge's ×, an edge dropped on nothing, `remove()`), with what would go: return false to keep it, or a Promise (a confirm dialog) that resolves to whether to delete
1536
+ - `deleteKeys?: string[] | null = ["Delete", "Backspace"]` — Keys that delete the selection; `null` turns deleting off
1537
+ - `history?: boolean = true` — Undo and redo (Ctrl+Z, Ctrl+Shift+Z / Ctrl+Y), over every change to nodes and edges
1538
+ - `historySize?: number = 100`
1539
+ - `guides?: boolean = true` — Alignment guides while dragging one node
1540
+ - `layout?: "tree" | "layered" | FlowLayout | null = null` — Lays the nodes out when the graph's shape changes (nodes or edges added, removed, hidden)
1541
+ - `layoutOptions?: FlowLayoutOptions`
1542
+ - `insertOnEdge?: boolean = true` — A node with no connections dropped onto an edge splices into it: A → C becomes A → B → C (the edge lights up while it's over one). Only when both new connections are valid. Without room between A and C, the node moves to sit after A and C moves on (with everything after it) along the flow's `direction`
1543
+ - `dropIntoGroups?: boolean = false` — Nodes dropped onto a `group` join it (and leave it when dropped outside)
1544
+ - `animate?: boolean = true` — Positions spring to their new place when they change from outside
1545
+ - `getId?: ((kind: "edge" | "node") => string)` — Makes ids for pasted nodes and new edges
1546
+ - `edgeBranching?: boolean = false` — A drag that starts on an edge draws a new edge from the same source, a branch, as in a circuit editor (the preview leaves from where you grabbed it). A click still selects the edge; with a finger, only a selected edge branches, so a swipe across one still pans
1547
+ - `label?: string` — The canvas's accessible name
1548
+
1549
+ Events:
1550
+ - `delete({ nodes: FlowNode<any>[]; edges: FlowEdge<any>[]; })` — Nodes and edges were deleted: `{ nodes, edges }`
1551
+ - `update:selection(FlowSelection)`
1552
+ - `update:viewport(FlowViewport)`
1553
+ - `update:nodes(FlowNode<any>[])`
1554
+ - `update:edges(FlowEdge<any>[])`
1555
+ - `update:locked(boolean)`
1556
+ - `connect(FlowConnection)` — A connection was made (it's also added to `edges` with `autoConnect`)
1557
+ - `connect-start({ nodeId: string; handleId: string | null; type: "source" | "target"; })` — A connection drag started from a handle
1558
+ - `connect-end({ connection: FlowConnection | null; position: FlowXY; from: { nodeId: string; handleId: string | null; type: "source" | "target"; }; })` — A connection drag ended: `{ connection }` when it connected, else the flow `position` it was dropped at and where it came from
1559
+ - `reconnect({ edge: FlowEdge<any>; connection: FlowConnection; })` — An edge's end was moved to another handle: `{ edge, connection }`
1560
+ - `insert({ node: FlowNode<any>; edge: FlowEdge<any>; connections: [FlowConnection, FlowConnection]; })` — A lone node was dropped onto an edge and spliced in: `{ node, edge, connections }` (with `autoConnect` the edge is replaced by the two connections, keeping its type and look)
1561
+ - `node-click(FlowNode<any>, MouseEvent)` — / node-dblclick / node-contextmenu `(node, event)`
1562
+ - `node-dblclick(FlowNode<any>, MouseEvent)`
1563
+ - `node-contextmenu(FlowNode<any>, MouseEvent)`
1564
+ - `node-drag-start(FlowNode<any>[], PointerEvent)` — / node-drag `(nodes, event)`
1565
+ - `node-drag(FlowNode<any>[], PointerEvent)`
1566
+ - `node-drag-stop({ nodes: FlowNode<any>[]; intersecting: FlowNode<any>[]; event: PointerEvent; })` — `{ nodes, intersecting, event }`: `intersecting` are the nodes under the dragged one
1567
+ - `edge-click(FlowEdge<any>, MouseEvent)` — / edge-dblclick / edge-contextmenu `(edge, event)`
1568
+ - `edge-dblclick(FlowEdge<any>, MouseEvent)`
1569
+ - `edge-contextmenu(FlowEdge<any>, MouseEvent)`
1570
+ - `pane-click(FlowXY, MouseEvent)` — / pane-dblclick / pane-contextmenu `(position, event)` with the flow position (turn `zoomOnDoubleClick` off to use the double click yourself, e.g. to add a node there)
1571
+ - `pane-contextmenu(FlowXY, MouseEvent)`
1572
+ - `pane-dblclick(FlowXY, MouseEvent)`
1573
+ - `init(FlowContext)` — The canvas measured its nodes (and laid out / fitted them): the flow context
1574
+
1575
+ Slots:
1576
+ - `#empty` — Shown while there are no nodes
1577
+ - `#default { flow: FlowInternals; }` — Drawn over the canvas: MFlowControls, MFlowMinimap, panels of yours. Props: `{ flow }`
1578
+
1579
+ Exposed (template ref):
1580
+ - `size: { width: number; height: number; }` — Canvas size in px
1581
+ - `getNode: (id: string) => FlowNode<any> | undefined`
1582
+ - `getAbsolutePosition: (id: string) => FlowXY` — A node's top left corner in flow coordinates, its parents added, where it's drawn right now
1583
+ - `getSize: (id: string) => { width: number; height: number; }` — A node's measured (or set) size
1584
+ - `getIntersectingNodes: (node: string | { x: number; y: number; width: number; height: number; }) => FlowNode<any>[]` — Nodes overlapping this one (or a rectangle in flow coordinates), groups and its own family left out
1585
+ - `screenToFlow: (p: { x: number; y: number; }) => FlowXY` — Page (client) coordinates → flow coordinates
1586
+ - `flowToScreen: (p: FlowXY) => { x: number; y: number; }`
1587
+ - `setViewport: (v: Partial<FlowViewport>, opts?: { animate?: boolean | undefined; } | undefined) => void`
1588
+ - `setCenter: (x: number, y: number, opts?: { zoom?: number | undefined; animate?: boolean | undefined; } | undefined) => void` — Centers the view on a flow point, at `zoom` or the current zoom
1589
+ - `zoomIn: () => void`
1590
+ - `zoomOut: () => void`
1591
+ - `zoomTo: (zoom: number, opts?: { animate?: boolean | undefined; } | undefined) => void`
1592
+ - `addNodes: (nodes: FlowNode<any> | FlowNode<any>[]) => void`
1593
+ - `addEdges: (edges: FlowEdge<any> | FlowEdge<any>[]) => void`
1594
+ - `updateNode: (id: string, patch: Partial<FlowNode<any>> | ((n: FlowNode<any>) => FlowNode<any>)) => void`
1595
+ - `updateEdge: (id: string, patch: Partial<FlowEdge<any>> | ((e: FlowEdge<any>) => FlowEdge<any>)) => void`
1596
+ - `remove: (ids: { nodes?: string[] | undefined; edges?: string[] | undefined; }) => void` — Deletes nodes (with their edges and children) and edges by id
1597
+ - `setSelection: (sel: Partial<FlowSelection>) => void`
1598
+ - `undo: () => void`
1599
+ - `redo: () => void`
1600
+ - `canUndo: boolean`
1601
+ - `canRedo: boolean`
1602
+ - `copy: () => void`
1603
+ - `cut: () => void`
1604
+ - `paste: (at?: FlowXY | undefined) => void` — Pastes what was copied, at a flow point (default a step from the originals)
1605
+ - `startDrag: (id: string, e: PointerEvent) => void` — Drags a node with a pointer that's already down, e.g. one just added from a palette outside the canvas: it follows the pointer from there (guides, splicing into an edge) until it's let go. With a finger, the page doesn't scroll under it meanwhile (start the drag from a long press, so a swipe still scrolls your palette)
1606
+
1607
+ ### MFlowControls
1608
+
1609
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1610
+
1611
+ Zoom, fit and lock buttons over an MFlow, as an M3 floating toolbar (put it in MFlow's default slot). Undo and redo with `history`; a delete button shows while something deletable is selected (`delete`). Not an M3 spec component.
1612
+
1613
+ Props:
1614
+ - `position?: FlowPanelPosition = "bottom-left"`
1615
+ - `orientation?: "horizontal" | "vertical" = "vertical"`
1616
+ - `zoom?: boolean = true`
1617
+ - `fit?: boolean = true`
1618
+ - `lock?: boolean = true`
1619
+ - `history?: boolean = false` — Undo and redo buttons
1620
+ - `delete?: boolean = true` — A delete button while something deletable is selected (touch has no Delete key)
1621
+
1622
+ Slots:
1623
+ - `#default` — More buttons at the end
1624
+
1625
+ ### MFlowHandle
1626
+
1627
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1628
+
1629
+ A connection point on a node in MFlow: drag from it to another node's handle to connect them. Sits centered on its node's side (`position`); move it with your own classes or style (it's measured where it ends up). Give each an `id` when a node has several of a type. Only inside a node (MFlowNode, or a `#node-<type>` slot).
1630
+
1631
+ Props:
1632
+ - `type?: "source" | "target" = "source"` — `source`: edges leave from it; `target`: they arrive
1633
+ - `position?: FlowPosition`
1634
+ - `id?: string`
1635
+ - `connectable?: boolean = true`
1636
+
1637
+ ### MFlowMinimap
1638
+
1639
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1640
+
1641
+ A small overview of an MFlow (put it in MFlow's default slot): every node as a block, the part in view outlined. Drag or click in it to move the view there; the wheel zooms. Not an M3 spec component.
1642
+
1643
+ Props:
1644
+ - `position?: FlowPanelPosition = "bottom-right"`
1645
+ - `width?: number = 200`
1646
+ - `height?: number = 140`
1647
+ - `nodeColor?: ((node: FlowNode<any>) => string)` — A node's fill (any CSS color); default outline-variant, primary when selected
1648
+ - `pannable?: boolean = true` — Drag and click move the view
1649
+ - `zoomable?: boolean = true` — The wheel zooms
1650
+
1651
+ ### MFlowNode
1652
+
1653
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1654
+
1655
+ MFlow's default node, also for `#node-<type>` slots of your own: an M3 card with an icon, a label and a subtitle, and a handle on each side edges run through (target where they arrive, source where they leave; the sides follow MFlow's `direction` or the node's `sourcePosition`/`targetPosition`). Selected it gets a primary outline; lifted while dragged (elevation level 4, like MKanban's cards). Not an M3 spec component.
1656
+
1657
+ Props:
1658
+ - `label?: string`
1659
+ - `subtitle?: string`
1660
+ - `icon?: string` — Material Symbol
1661
+ - `variant?: "elevated" | "filled" | "outlined" = "outlined"`
1662
+ - `color?: "error" | "primary" | "secondary" | "tertiary" | "neutral" = "primary"` — The icon container's color role
1663
+ - `handles?: "none" | "source" | "target" | "both" = "both"` — Which handles it draws
1664
+ - `sourcePosition?: FlowPosition`
1665
+ - `targetPosition?: FlowPosition`
1666
+
1667
+ Slots:
1668
+ - `#icon` — Instead of the `icon`
1669
+ - `#trailing` — At the end of the header (a status, a menu button). Controls in it don't start a drag
1670
+ - `#default` — Below the header, inside the card
1671
+
1253
1672
  ### MFooter
1254
1673
 
1255
1674
  Page footer with slots for brand, content, social links, and a bottom bar. Responsive padding adapts to screen size.
@@ -1275,6 +1694,94 @@ Props:
1275
1694
  Slots:
1276
1695
  - `#default` — The content that goes full screen.
1277
1696
 
1697
+ ### MGantt
1698
+
1699
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
1700
+
1701
+ A Gantt chart: a task list (a tree, with columns) beside a timeline of bars you drag to move, pull at the ends to resize, and join with dependencies. Not an M3 spec component: M3 parts (containers, state layers, motion) on the layout planning tools share (MS Project, GanttProject, Frappe Gantt). Tasks are a `v-model` of plain objects (`GanttTask`): dates as `YYYY-MM-DD` (whole days) or datetimes, `progress`, `parentId` for summaries (their dates roll up), `dependencies` (finish-to-start, start-to-start, finish-to-finish, start-to-finish, with a lag), milestones and a baseline. The zoom runs from hours to years (`v-model:scale`, Ctrl + wheel, a pinch); the timeline scrolls both ways, rows and columns rendered only near the view. Editing: drag a bar to move it (with a mouse, or a short press with a finger), its ends to resize it, the triangle under it to set the progress, the dots at its ends onto another bar to make a dependency (which end you leave and reach picks the type); click or tap a dependency for its × to remove it (or Delete). A summary moves with its tasks; selected bars move together. With `schedule="auto"` the tasks that depend on one follow it. Rows reorder by dragging them in the list (onto the middle of a row to put it inside). Every edit is undoable (Ctrl+Z / Ctrl+Shift+Z). Keyboard (in the list): arrows move and expand/collapse, Alt + ←/→ moves the task a step, Alt + Shift + ←/→ changes its end, Alt + ↑/↓ reorders it, Ctrl + ] / [ indents and outdents it, F2 renames, Enter opens it (`task-dblclick`), Delete deletes.
1702
+
1703
+ Props:
1704
+ - `tasks?: GanttTask<any>[] = []` (v-model:tasks)
1705
+ - `scale?: TimeUnit = "day"` (v-model:scale) — The zoom as a named level; `v-model:scale` follows Ctrl + wheel, pinches and MGanttControls
1706
+ - `pxPerDay?: number` — The starting zoom in px per day, between the named levels (instead of `scale`'s)
1707
+ - `selection?: string[]` (v-model:selection) — Selected task ids (`v-model:selection`)
1708
+ - `collapsed?: string[]` (v-model:collapsed) — Ids of tasks whose children are hidden (`v-model:collapsed`)
1709
+ - `columns?: GanttColumn[]` — The task list's columns (default name, start and duration); `[]` hides the list
1710
+ - `gridWidth?: number` (v-model:gridWidth) — The task list's width, px (`v-model:grid-width`; drag its edge)
1711
+ - `rowHeight?: number = 40`
1712
+ - `readonly?: boolean = false` — No editing: drag, resize, link, reorder, rename and delete off
1713
+ - `schedule?: "auto" | "manual" = "manual"` — `'auto'`: tasks that depend on a moved one follow it (`scheduleTasks` in push mode)
1714
+ - `calendar?: GanttCalendar` — Working days: shaded when they aren't, and counted by `schedule="auto"` (default Monday to Friday, no holidays)
1715
+ - `criticalPath?: boolean = false` — Highlights the tasks and dependencies whose delay delays the end
1716
+ - `baselines?: boolean = false` — Draws each task's `baselineStart`/`baselineEnd` under it
1717
+ - `today?: string | null` — Today, for the line across the timeline (default now; `null` hides it)
1718
+ - `snap?: number` — Minutes a datetime task snaps to (default by zoom); date-only tasks always snap to days
1719
+ - `weekStartsOn?: 0 | 1 = 1`
1720
+ - `minPxPerDay?: number = 0.15` — Zoom bounds, px per day
1721
+ - `maxPxPerDay?: number = 2400`
1722
+ - `locale?: string` — Locale for dates (Intl); default the app's
1723
+ - `label?: string` — Accessible name
1724
+ - `beforeDelete?: ((tasks: GanttTask<any>[]) => boolean | Promise<boolean>)` — Asked before deleting; return false (or a promise of it) to keep them
1725
+
1726
+ Events:
1727
+ - `link({ from: string; to: string; type: NonNullable<"FS" | "SS" | "FF" | "SF" | undefined>; })` — A dependency was drawn: `{ from, to, type }` (it's also added to the task)
1728
+ - `delete({ tasks: GanttTask<any>[]; })` — Tasks were deleted: `{ tasks }`
1729
+ - `update:selection(string[])`
1730
+ - `change({ tasks: GanttTask<any>[]; kind: "progress" | "reorder" | "move" | "resize" | "rename"; })` — A drag or a key changed tasks: `{ tasks, kind }` with the changed tasks and `'move' | 'resize' | 'progress' | 'reorder' | 'rename'`
1731
+ - `update:tasks(GanttTask<any>[])`
1732
+ - `update:scale(TimeUnit)`
1733
+ - `update:collapsed(string[])`
1734
+ - `update:gridWidth(number)`
1735
+ - `task-click(GanttTask<any>, MouseEvent)` — / task-dblclick / task-contextmenu `(task, event)`
1736
+ - `task-dblclick(GanttTask<any>, MouseEvent | KeyboardEvent)`
1737
+ - `task-contextmenu(GanttTask<any>, MouseEvent)`
1738
+ - `unlink({ from: string; to: string; })` — A dependency was removed: `{ from, to }`
1739
+
1740
+ Slots:
1741
+ - `#cell-name { task: GanttTask<any>; value: string; }`
1742
+ - `#default { gantt: GanttContext; }` — Above the chart: MGanttControls, filters of yours. Props: `{ gantt }`
1743
+ - `#bar { task: GanttTask<any>; selected: boolean; critical: boolean; }` — A bar's content instead of its label. Props: `{ task, selected, critical }`
1744
+ - `#empty` — Shown while there are no tasks
1745
+ - `#tooltip { task: GanttTask<any>; slack: number | undefined; }` — The card shown over a hovered or dragged bar. Props: `{ task, slack }`
1746
+
1747
+ Exposed (template ref):
1748
+ - `canUndo: boolean`
1749
+ - `canRedo: boolean`
1750
+ - `undo: () => void`
1751
+ - `redo: () => void`
1752
+ - `zoomIn: () => void`
1753
+ - `zoomOut: () => void`
1754
+ - `setScale: (scale: TimeUnit) => void`
1755
+ - `scrollToDate: (date?: string | undefined, opts?: { align?: "center" | "start" | undefined; animate?: boolean | undefined; } | undefined) => void` — Scrolls so a date (default now) sits at the view's `align` (default center)
1756
+ - `scrollToTask: (id: string) => void` — Scrolls a task into view, its row and its bar
1757
+ - `toggle: (id: string, expanded?: boolean | undefined) => void`
1758
+ - `expandAll: () => void`
1759
+ - `collapseAll: () => void`
1760
+ - `setSelection: (ids: string[]) => void`
1761
+ - `addTasks: (tasks: GanttTask<any> | GanttTask<any>[], opts?: { after?: string | undefined; } | undefined) => void` — Adds tasks (after `after`, or at the end); undoable
1762
+ - `updateTask: (id: string, patch: Partial<GanttTask<any>> | ((t: GanttTask<any>) => GanttTask<any>)) => void`
1763
+ - `removeTasks: (ids: string[]) => void` — Deletes tasks with their children and the dependencies on them
1764
+ - `link: (from: string, to: string, type?: "FS" | "SS" | "FF" | "SF" | undefined, lag?: number | undefined) => void` — Makes `to` depend on `from`
1765
+ - `unlink: (from: string, to: string) => void`
1766
+ - `dateAt: (clientX: number) => string` — The date (snapped) under a page x
1767
+
1768
+ ### MGanttControls
1769
+
1770
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
1771
+
1772
+ A toolbar for an MGantt or an MResourceTimeline (put it in their default slot): the zoom as named scales, zoom in and out, today, expand and collapse all, undo and redo. Not an M3 spec component.
1773
+
1774
+ Props:
1775
+ - `scales?: TimeUnit[] = ["day", "week", "month", "quarter"]` — The scales offered as a segmented button (`[]` hides it)
1776
+ - `zoom?: boolean = true`
1777
+ - `today?: boolean = true`
1778
+ - `fold?: boolean = true` — Expand all / collapse all
1779
+ - `history?: boolean = true` — Undo and redo
1780
+
1781
+ Slots:
1782
+ - `#default` — More controls at the start
1783
+ - `#end` — More controls at the end
1784
+
1278
1785
  ### MGrid
1279
1786
 
1280
1787
  A responsive CSS grid with per-breakpoint column counts.
@@ -1326,11 +1833,12 @@ A button that shows only an icon — four visual styles, the same 5-tier express
1326
1833
  Props:
1327
1834
  - `icon: string` — Material Symbol icon name
1328
1835
  - `label?: string` — Accessible label (its aria-label; no visible tooltip: wrap it in MTooltip for one)
1329
- - `variant?: "filled" | "outlined" | "tonal" | "standard" = "standard"` — Visual style
1836
+ - `variant?: "standard" | "filled" | "outlined" | "tonal" = "standard"` — Visual style
1330
1837
  - `color?: "error" | "primary" | "secondary" | "tertiary" | (string & {})` — An M3 role or any CSS color (`#fff` over a photo, `rgb(0 0 0 / 0.3)` for a scrim-like filled button, `currentColor` to follow the surrounding text). Standard and outlined use it for the icon; filled for the container with white (or the role's on-color) on it; tonal for a 20% container with the color on it. Disabled buttons and toggles keep their own colors
1331
1838
  - `contentColor?: string` — Icon color over what the variant and `color` give: an M3 role (`on-surface`…) or any CSS color (`#000` on a white filled button). Disabled buttons and toggles keep their own
1332
1839
  - `shape?: "rounded" | "squared" = "rounded"` — Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md, 28px lg/xl)
1333
1840
  - `size?: number | "xs" | "sm" | "md" | "lg" | "xl" = "sm"` — M3's 5-tier icon button sizing (xs:32, sm:40, md:56, lg:96, xl:136), or a custom pixel value
1841
+ - `iconSize?: number` — Icon size in px. Default the size tier's (or 55% of a custom pixel `size`)
1334
1842
  - `disabled?: boolean = false` — Disables interaction
1335
1843
  - `to?: string | Record<string, any>` — Vue Router destination — renders as RouterLink instead of button
1336
1844
  - `rippleColor?: string` — Any CSS color for the press ripple; defaults to the button's content color
@@ -1341,6 +1849,63 @@ Props:
1341
1849
  Events:
1342
1850
  - `update:checked(boolean)` — Emitted on click when `checked` is set — powers v-model:checked
1343
1851
 
1852
+ ### MImageCropper
1853
+
1854
+ An image cropper: the picture fitted in its box with a crop frame you drag and resize by its corners and edges (a rule-of-thirds grid while you do), locked to an `aspect` or free, square or round (`shape="circle"` for avatars). Rotate a quarter turn at a time and flip; the frame follows. Not an M3 spec component: M3 parts after Google Photos' crop tool. `v-model:crop` is the frame in the rotated picture's own pixels (`{ x, y, width, height }`), `v-model:rotation` (0, 90, 180, 270, applied after the mirror) and `v-model:flipped` (the picture mirrored left to right before it turns). The template ref's `toCanvas()` / `toBlob()` draw the result, at the crop's size or one you give (`width`, `height`, `maxSize`), round with a transparent outside for `circle`. `src` takes a URL, a `File` or a `Blob` (e.g. from MFileUpload); a picture from another origin must allow it (CORS) to be exported, and gets `crossorigin="anonymous"`. Keyboard (on the frame): arrows move it, Shift + arrows resize it (10 px steps with Alt).
1855
+
1856
+ Props:
1857
+ - `src?: string | Blob | null = null` — The picture: a URL, a File or a Blob
1858
+ - `crop?: CropRect | null = null` (v-model:crop) — The frame, in the rotated picture's pixels (`v-model:crop`)
1859
+ - `aspect?: number | null = null` (v-model:aspect) — Width over height (1 square, 16 / 9…); null is free
1860
+ - `aspects?: CropAspect[]` — Aspects offered in the toolbar as chips (`v-model:aspect` follows them)
1861
+ - `rotation?: 0 | 90 | 180 | 270 = 0` (v-model:rotation) — Quarter turns clockwise in degrees (`v-model:rotation`)
1862
+ - `flipped?: boolean = false` (v-model:flipped) — Mirrored left to right (`v-model:flipped`)
1863
+ - `shape?: "circle" | "rect" = "rect"`
1864
+ - `minSize?: number = 24` — The frame's smallest side, in the picture's px
1865
+ - `guides?: "drag" | "always" | "never" = "drag"` — The rule-of-thirds grid: while dragging (default), always or never
1866
+ - `controls?: boolean = true` — The toolbar under the picture
1867
+ - `alt?: string = ""` — Accessible name of the picture
1868
+
1869
+ Events:
1870
+ - `error(Event)` — The picture didn't load
1871
+ - `change(CropRect)` — A drag or a key changed the crop (after `update:crop`): the crop
1872
+ - `update:crop(CropRect)`
1873
+ - `update:aspect(number | null)`
1874
+ - `update:rotation(0 | 90 | 180 | 270)`
1875
+ - `update:flipped(boolean)`
1876
+ - `load({ width: number; height: number; })` — The picture loaded: `{ width, height }` (its natural size)
1877
+
1878
+ Slots:
1879
+ - `#controls { rotate: (dir: 1 | -1) => void; flip: () => void; reset: () => void; aspect: number | null; setAspect: (a: number | null) => void; }` — Instead of the toolbar under the picture. Props: `{ rotate, flip, reset, aspect, setAspect }`
1880
+
1881
+ Exposed (template ref):
1882
+ - `toCanvas: (options?: CropOutputOptions) => HTMLCanvasElement | null`
1883
+ - `toBlob: (options?: CropOutputOptions & { type?: string | undefined; quality?: number | undefined; }) => Promise<Blob | null>`
1884
+ - `rotate: (dir: 1 | -1) => void`
1885
+ - `flip: () => void`
1886
+ - `reset: () => void`
1887
+ - `setAspect: (a: number | null) => void`
1888
+
1889
+ ```ts
1890
+ export interface CropRect { x: number; y: number; width: number; height: number }
1891
+ ```
1892
+
1893
+ ```ts
1894
+ export interface CropAspect { label: string; value: number | null }
1895
+ ```
1896
+
1897
+ ```ts
1898
+ export interface CropOutputOptions {
1899
+ /** The result's size in px; one alone keeps the crop's proportions (default the crop's own size) */
1900
+ width?: number
1901
+ height?: number
1902
+ /** The longest side at most, px */
1903
+ maxSize?: number
1904
+ /** Round, transparent outside (default true for `shape="circle"`) */
1905
+ circle?: boolean
1906
+ }
1907
+ ```
1908
+
1344
1909
  ### MInfiniteScroll
1345
1910
 
1346
1911
  Wraps a scrollable list and emits load when an IntersectionObserver sentinel at the bottom becomes visible — hand it your own fetch-more logic.
@@ -1466,8 +2031,8 @@ Props:
1466
2031
 
1467
2032
  Events:
1468
2033
  - `update:modelValue(boolean)` — Fires when the lightbox opens or closes
1469
- - `update:index(number)` — Fires whenever the current index changes (next/prev/goTo/auto-detected image click)
1470
2034
  - `change(index: number)` — Fires alongside update:index with the new index
2035
+ - `update:index(number)` — Fires whenever the current index changes (next/prev/goTo/auto-detected image click)
1471
2036
 
1472
2037
  Slots:
1473
2038
  - `#default` — Content to scan for `<img>` elements when items is not given
@@ -1630,7 +2195,7 @@ Props:
1630
2195
  - `zoom?: number` (v-model:zoom) — Zoom level (v-model)
1631
2196
  - `bearing?: number` (v-model:bearing) — Rotation in degrees (v-model)
1632
2197
  - `pitch?: number` (v-model:pitch) — Tilt in degrees (v-model)
1633
- - `persist?: string | boolean = false` — Remember the view (center, zoom, bearing, pitch) in localStorage and start from it on the next visit: `true` under `m3-map-view`, or your own key (one per map)
2198
+ - `persist?: string | boolean = false` — Remember the view (center, zoom, bearing, pitch) in localStorage and start from it on the next visit: `true` under `m3-map-view` (after `createM3UI`'s `storagePrefix`, if any), or your own key (one per map)
1634
2199
  - `navigation?: boolean | MapControlPosition = true` — Zoom and compass buttons: `false`, or a corner (`true` is top-right)
1635
2200
  - `geolocate?: boolean | MapControlPosition = false` — A button that centers the map on the user's location and follows it: `false`, or a corner (`true` is top-right)
1636
2201
  - `fullscreen?: boolean | MapControlPosition = false` — A fullscreen button: `false`, or a corner (`true` is top-right)
@@ -1915,6 +2480,13 @@ Events:
1915
2480
  - `update:modelValue(string)` — Emitted on every keystroke — powers v-model
1916
2481
  - `debounced(string)` — Emitted debounce ms after the user stops typing (only when debounce > 0)
1917
2482
 
2483
+ Exposed (template ref):
2484
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
2485
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
2486
+ - `blur: () => void | undefined` — Takes focus away from the field
2487
+ - `select: () => void | undefined` — Selects all its text
2488
+ - `setSelectionRange: (start: number, end: number, direction?: "none" | "forward" | "backward" | undefined) => void | undefined` — Selects part of its text (e.g. a file name without its extension)
2489
+
1918
2490
  ```ts
1919
2491
  export type MaskPreset = 'credit-card' | 'phone' | 'date' | 'time' | 'cpf' | 'cnpj' | 'zip'
1920
2492
  ```
@@ -2215,6 +2787,12 @@ Events:
2215
2787
  - `update:modelValue(number | null)` — Emitted on every change — typing, stepper clicks, or arrow keys — powers v-model
2216
2788
  - `debounced(number | null)` — Emitted debounce ms after the user stops typing (only when debounce > 0). Stepper clicks/arrow keys still emit instantly
2217
2789
 
2790
+ Exposed (template ref):
2791
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
2792
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
2793
+ - `blur: () => void | undefined` — Takes focus away from the field
2794
+ - `select: () => void | undefined` — Selects all its text
2795
+
2218
2796
  ### MOverlay
2219
2797
 
2220
2798
  Full-screen overlay with scrim and teleport to body. A generic low-level building block — content is entirely up to you via the default slot. Your class, role and aria attributes go on the content layer (over the scrim), so `class="flex items-center justify-center bg-black"` lays out and paints the slot.
@@ -2267,6 +2845,91 @@ Props:
2267
2845
  Events:
2268
2846
  - `score(number)` — Emitted whenever value changes — -1 for an empty value, or 0-4 otherwise
2269
2847
 
2848
+ ### MPdfViewer
2849
+
2850
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
2851
+
2852
+ A PDF viewer on pdf.js (not an M3 spec component; after androidx.pdf's `PdfView` and Google Drive's viewer). The pages scroll continuously, each rendered only near the viewport, with selectable text and working links. Zoom: fit to width (the default) or the page, a percentage, Ctrl + wheel or a trackpad pinch, a pinch on touch, and a double click or double tap (zooms in there, or back to the width). A top bar with the page, zoom, search (hits marked in the text), and download, print, rotate and full screen; a side panel with thumbnails and the outline; a page indicator while scrolling (a draggable thumb on touch). With `annotate`, an edit button opens a floating toolbar to highlight text, place notes and draw, kept in `v-model:annotations` as JSON (not written into the file). Needs the `pdfjs-dist` package. Set its worker once with `setPdfWorker()` (or `worker-src`); without it pdf.js runs on the main thread.
2853
+
2854
+ Props:
2855
+ - `src?: PdfSource | null = null` — The PDF: a URL, its bytes, or a `File`/`Blob`
2856
+ - `title?: string` — Shown in the top bar; default the document's own title
2857
+ - `page?: number` (v-model:page) — Current page, 1-based (v-model)
2858
+ - `zoom?: PdfZoom = "fit-width"` (v-model:zoom) — `fit-width`, `fit-page`, or a zoom where 1 is 100% (v-model)
2859
+ - `rotation?: number = 0` (v-model:rotation) — Extra rotation in degrees, a multiple of 90 (v-model)
2860
+ - `annotations?: PdfAnnotation[] = []` (v-model:annotations) — Annotations to draw (v-model)
2861
+ - `annotate?: boolean = false` — Shows the edit button and the annotation toolbar
2862
+ - `tool?: PdfTool = "select"` (v-model:tool) — The active tool (v-model)
2863
+ - `colors?: string[] = ["#FFE14D", "#7ED957", "#5EB8FF", "#FF7EB6", "#B388FF", "#1F1F1F"]` — Colors offered for annotations
2864
+ - `inkWidths?: number[] = [1, 2, 4, 8]` — The pen's widths offered in the toolbar, in PDF points (the first one is the default)
2865
+ - `author?: string` — Written into new annotations' `author`
2866
+ - `sidebar?: "thumbnails" | "outline" | null = null` (v-model:sidebar) — The side panel: thumbnails, the outline, or closed (v-model)
2867
+ - `toolbar?: boolean = true` — Shows the top bar
2868
+ - `downloadable?: boolean = true` — Shows download and print
2869
+ - `fileName?: string` — File name for downloads; default the URL's or the document's title
2870
+ - `password?: string` — A password to try first
2871
+ - `workerSrc?: string` — The pdf.js worker URL (or `setPdfWorker()` once for the app)
2872
+ - `minZoom?: number = 0.25`
2873
+ - `maxZoom?: number = 8`
2874
+
2875
+ Events:
2876
+ - `error(Error)` — The document failed to load
2877
+ - `link({ url?: string | undefined; page?: number | undefined; })` — A link was followed: `{ url }` (opens in a new tab) or `{ page }` (scrolled to)
2878
+ - `update:page(number)`
2879
+ - `update:tool(PdfTool)`
2880
+ - `update:rotation(number)`
2881
+ - `update:zoom(PdfZoom)`
2882
+ - `update:annotations(PdfAnnotation[])`
2883
+ - `update:sidebar("thumbnails" | "outline" | null)`
2884
+ - `loaded(PDFDocumentProxy)` — The document loaded, with its pdf.js proxy
2885
+ - `annotation-click(PdfAnnotation)` — An annotation was clicked with the select tool
2886
+
2887
+ Slots:
2888
+ - `#actions { pdf: PdfState; }` — Extra buttons at the end of the top bar. Props: `{ pdf }`
2889
+ - `#empty` — Shown without a `src`
2890
+
2891
+ Exposed (template ref):
2892
+ - `pdf: PdfState`
2893
+ - `goToPage: (p: number) => void`
2894
+ - `setZoom: (z: PdfZoom) => void`
2895
+ - `search: (q: string) => void`
2896
+ - `undo: () => void`
2897
+
2898
+ ```ts
2899
+ /** One annotation, in PDF points (origin at the page's bottom left), so it survives zoom, rotation and reflows */
2900
+ export interface PdfAnnotation {
2901
+ id: string
2902
+ type: 'highlight' | 'note' | 'ink'
2903
+ /** 1-based page */
2904
+ page: number
2905
+ /** Any CSS color */
2906
+ color: string
2907
+ /** highlight: the selected lines, `[x1, y1, x2, y2]` each */
2908
+ rects?: [number, number, number, number][]
2909
+ /** highlight: the text it covers */
2910
+ quote?: string
2911
+ /** note: where its icon sits */
2912
+ at?: [number, number]
2913
+ /** ink: strokes, each a list of points */
2914
+ paths?: [number, number][][]
2915
+ /** ink: stroke width in points */
2916
+ width?: number
2917
+ /** A note's text, or a comment on a highlight or drawing */
2918
+ text?: string
2919
+ author?: string
2920
+ /** ISO date */
2921
+ createdAt: string
2922
+ }
2923
+ ```
2924
+
2925
+ ```ts
2926
+ export type PdfTool = 'select' | 'highlight' | 'note' | 'ink' | 'eraser'
2927
+ ```
2928
+
2929
+ ```ts
2930
+ export type PdfZoom = number | 'fit-width' | 'fit-page'
2931
+ ```
2932
+
2270
2933
  ### MPinInput
2271
2934
 
2272
2935
  One box per character for OTP/PIN/verification codes. Typing advances to the next box, backspace on an empty box goes back, and pasting a full code fills every box at once.
@@ -2339,7 +3002,7 @@ Props:
2339
3002
  - `background?: string = "#ffffff"` — Light module / background color
2340
3003
  - `label?: string` — aria-label for the svg. Defaults to value
2341
3004
  - `rounded?: boolean = true` — Rounds the outer container corners.
2342
- - `moduleStyle?: "square" | "dots" = "square"` — 'square' is the classic scannable pixel grid. 'dots' rounds each module — still fully scannable, just a softer look.
3005
+ - `moduleStyle?: "dots" | "square" = "square"` — 'square' is the classic scannable pixel grid. 'dots' rounds each module — still fully scannable, just a softer look.
2343
3006
 
2344
3007
  Slots:
2345
3008
  - `#error` — Shown instead of the SVG when value is too large to encode at the given errorCorrectionLevel
@@ -2413,6 +3076,77 @@ Props:
2413
3076
  - `value: string | number | Date` — Required. The timestamp to format: an ISO string, epoch milliseconds, or a Date
2414
3077
  - `locale?: string` — BCP-47 locale tag (e.g. 'es-ES'). Defaults to the app's locale (via createM3UI/useLocale), then the browser's locale.
2415
3078
 
3079
+ ### MResourceTimeline
3080
+
3081
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
3082
+
3083
+ A resource timeline: one row per person, table, room or machine, with their bookings (shifts, reservations, jobs) along a timeline you zoom from hours to months. Not an M3 spec component: MGantt's timeline, for planning who or what is busy when rather than tasks and their order. Bookings are a `v-model` of plain objects (`TimelineEvent`: `resourceId`, `start`/`end` datetimes or whole days, `title`, `color`). Drag one along its row to move it, to another row to give it to that resource, or by its ends to resize it; snapped to `snap` minutes. Bookings that overlap share the row in lanes, and more than a resource's `capacity` at once are marked as conflicts (`overlap="prevent"` refuses a drop that makes one). With `creatable`, dragging across empty time (a short press first with a finger) asks for a new booking there (`create`). Resources with a `group` sit under headers that fold. Rows and time render only near the view; every edit is undoable. Keyboard (on a booking): ←/→ move it a step, Shift + ←/→ change its end, ↑/↓ move it to the resource above or below, Enter opens it (`event-dblclick`), Delete deletes, Ctrl+Z / Ctrl+Shift+Z undo and redo.
3084
+
3085
+ Props:
3086
+ - `events?: TimelineEvent<any>[] = []` (v-model:events)
3087
+ - `resources?: TimelineResource<any>[] = []`
3088
+ - `scale?: TimeUnit = "day"` (v-model:scale) — The zoom as a named level (`v-model:scale`)
3089
+ - `pxPerDay?: number = 240` — The starting zoom in px per day, between the named levels (default 240: 10 px an hour)
3090
+ - `selection?: string[]` (v-model:selection) — Selected booking ids (`v-model:selection`)
3091
+ - `collapsed?: string[]` (v-model:collapsed) — Folded group names (`v-model:collapsed`)
3092
+ - `listWidth?: number` (v-model:listWidth) — The resource column's width, px (`v-model:list-width`; drag its edge); 0 hides it
3093
+ - `rowHeight?: number = 56` — A row's least height; rows grow with their lanes
3094
+ - `laneHeight?: number = 40` — One lane's height (a booking and its gap)
3095
+ - `overlap?: "stack" | "prevent" = "stack"` — `'stack'` (default): overlaps share the row in lanes and show as conflicts past `capacity`; `'prevent'` also refuses a drop that makes one
3096
+ - `creatable?: boolean = false` — Dragging across empty time asks for a booking there (`create`)
3097
+ - `readonly?: boolean = false`
3098
+ - `snap?: number` — Minutes bookings snap to (default 15; by zoom when zoomed far out); whole-day bookings snap to days
3099
+ - `calendar?: GanttCalendar` — Days worked (shaded when they aren't)
3100
+ - `workHours?: [number, number]` — Working hours, shaded outside them when zoomed in to hours, e.g. `[9, 18]`
3101
+ - `now?: string | null` — Now, for the line across the timeline (default the current time; `null` hides it)
3102
+ - `start?: string` — Where the view starts (default now, or the first booking)
3103
+ - `weekStartsOn?: 0 | 1 = 1`
3104
+ - `minPxPerDay?: number = 2`
3105
+ - `maxPxPerDay?: number = 4800`
3106
+ - `locale?: string`
3107
+ - `label?: string`
3108
+ - `beforeDelete?: ((events: TimelineEvent<any>[]) => boolean | Promise<boolean>)`
3109
+
3110
+ Events:
3111
+ - `delete({ events: TimelineEvent<any>[]; })` — Bookings were deleted: `{ events }`
3112
+ - `update:selection(string[])`
3113
+ - `change({ events: TimelineEvent<any>[]; kind: "move" | "resize"; })` — A drag or a key changed bookings: `{ events, kind: 'move' | 'resize' }`
3114
+ - `update:scale(TimeUnit)`
3115
+ - `update:collapsed(string[])`
3116
+ - `update:events(TimelineEvent<any>[])`
3117
+ - `update:listWidth(number)`
3118
+ - `event-click(TimelineEvent<any>, MouseEvent)` — / event-dblclick / event-contextmenu `(event, mouseEvent)`
3119
+ - `event-dblclick(TimelineEvent<any>, MouseEvent | KeyboardEvent)`
3120
+ - `event-contextmenu(TimelineEvent<any>, MouseEvent)`
3121
+ - `create({ resourceId: string; start: string; end: string; })` — Empty time was dragged across (or long pressed) on a resource: `{ resourceId, start, end }`; add the booking yourself
3122
+ - `slot-click({ resourceId: string; start: string; })` — Empty time was clicked: `{ resourceId, start }`
3123
+ - `conflict({ event: TimelineEvent<any>; with: TimelineEvent<any>[]; })` — A drop was refused (`overlap="prevent"`): `{ event, with }`
3124
+
3125
+ Slots:
3126
+ - `#default { timeline: ResourceTimelineContext; }` — Above the timeline: MGanttControls, filters of yours. Props: `{ timeline }`
3127
+ - `#group { group: string; resources: TimelineResource<any>[]; collapsed: boolean; }` — A group's header. Props: `{ group, resources, collapsed }`
3128
+ - `#resource { resource: TimelineResource<any>; events: TimelineEvent<any>[]; hours: number; }` — A resource's cell. Props: `{ resource, events, hours }` (`hours`: booked in total)
3129
+ - `#event { event: TimelineEvent<any>; resource: TimelineResource<any> | undefined; selected: boolean; conflict: boolean; }` — A booking's content. Props: `{ event, resource, selected, conflict }`
3130
+ - `#empty` — Shown while there are no resources
3131
+
3132
+ Exposed (template ref):
3133
+ - `conflicts: Set<string>` — Ids of events that overlap more than their resource's capacity
3134
+ - `canUndo: boolean`
3135
+ - `canRedo: boolean`
3136
+ - `undo: () => void`
3137
+ - `redo: () => void`
3138
+ - `zoomIn: () => void`
3139
+ - `zoomOut: () => void`
3140
+ - `setScale: (scale: TimeUnit) => void`
3141
+ - `scrollToDate: (date?: string | undefined, opts?: { align?: "center" | "start" | undefined; animate?: boolean | undefined; } | undefined) => void`
3142
+ - `scrollToEvent: (id: string) => void`
3143
+ - `setSelection: (ids: string[]) => void`
3144
+ - `addEvents: (events: TimelineEvent<any> | TimelineEvent<any>[]) => void`
3145
+ - `updateEvent: (id: string, patch: Partial<TimelineEvent<any>> | ((e: TimelineEvent<any>) => TimelineEvent<any>)) => void`
3146
+ - `removeEvents: (ids: string[]) => void`
3147
+ - `dateAt: (clientX: number) => string` — The time (snapped, as a datetime) under a page x
3148
+ - `resourceAt: (clientY: number) => TimelineResource<any> | undefined` — The resource whose row is under a page y
3149
+
2416
3150
  ### MResponsive
2417
3151
 
2418
3152
  Shows or hides content at specific breakpoints using pure CSS (Tailwind's `hidden`/`block` utilities) — no JS resize listener.
@@ -2495,7 +3229,7 @@ A week or day calendar grid. Events sit at their exact times, overlapping ones s
2495
3229
 
2496
3230
  Props:
2497
3231
  - `events?: SchedulerEvent[] = []` — Events to show (see `SchedulerEvent`)
2498
- - `view?: "week" | "day" = "week"` (v-model:view) — 'week' or 'day'; use v-model:view to follow the header's toggle.
3232
+ - `view?: "day" | "week" = "week"` (v-model:view) — 'week' or 'day'; use v-model:view to follow the header's toggle.
2499
3233
  - `date?: string` (v-model:date) — The date shown (`YYYY-MM-DD`), today by default; use v-model:date to follow navigation.
2500
3234
  - `startHour?: number = 7` — First visible hour
2501
3235
  - `endHour?: number = 22` — Hour the grid ends at
@@ -2514,7 +3248,7 @@ Events:
2514
3248
  - `eventClick(SchedulerEvent)` — An event (in the grid or the all-day row) was clicked
2515
3249
  - `slotClick({ date: string; hour: number; })` — An empty spot in the grid was clicked
2516
3250
  - `update:date(string)` — Navigation changed the date shown (YYYY-MM-DD)
2517
- - `update:view("week" | "day")` — The Day/Week toggle (or a day header) changed the view
3251
+ - `update:view("day" | "week")` — The Day/Week toggle (or a day header) changed the view
2518
3252
 
2519
3253
  Slots:
2520
3254
  - `#event { event: SchedulerEvent; allDay: boolean; }` — Content of an event block.
@@ -2669,7 +3403,7 @@ Props:
2669
3403
  - `playing?: boolean = false` — The media is playing: the bar moves on its own between updates, and the wavy line waves
2670
3404
  - `playbackRate?: number = 1` — Playback speed, for that motion between updates
2671
3405
  - `live?: boolean = false` — Updates the v-model continuously while dragging (the media follows the thumb), not only on release
2672
- - `variant?: "line" | "wavy" | "slider" = "slider"` — `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing
3406
+ - `variant?: "slider" | "line" | "wavy" = "slider"` — `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing
2673
3407
  - `size?: "xs" | "sm" | "md" = "md"` — Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video)
2674
3408
  - `time?: "none" | "below" | "sides" = "below"` — Where the elapsed and total time go
2675
3409
  - `remaining?: boolean = false` (v-model:remaining) — The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining)
@@ -2864,8 +3598,8 @@ Props:
2864
3598
  - `disabled?: boolean = false` — Disables drawing
2865
3599
 
2866
3600
  Events:
2867
- - `end(string)` — Fires after a stroke ends, with a PNG data: URL of the canvas
2868
3601
  - `change(string)` — Fires alongside end, and also after undo() — same data: URL payload
3602
+ - `end(string)` — Fires after a stroke ends, with a PNG data: URL of the canvas
2869
3603
  - `begin()` — Fires on the first pointerdown of a new stroke
2870
3604
 
2871
3605
  Exposed (template ref):
@@ -2930,7 +3664,7 @@ Props:
2930
3664
  - `modelValue: number | [number, number]` (v-model) — Current value — a tuple when variant is range
2931
3665
  - `min?: number = 0` — Minimum value
2932
3666
  - `max?: number = 100` — Maximum value
2933
- - `step?: number = 1` — Step increment
3667
+ - `step?: number = 1` — Step increment: the values emitted snap to it; while dragging (without stops) the thumb still follows the pointer smoothly and settles on its step when released
2934
3668
  - `disabled?: boolean = false` — Disables the slider
2935
3669
  - `label?: string` — Label text
2936
3670
  - `showValue?: boolean = false` — Show current value beside label
@@ -2938,7 +3672,7 @@ Props:
2938
3672
  - `orientation?: "horizontal" | "vertical" = "horizontal"` — Slider orientation
2939
3673
  - `size?: "xs" | "sm" | "md" | "lg" | "xl" = "xs"` — Track and thumb size
2940
3674
  - `variant?: "standard" | "centered" | "range" = "standard"` — Standard, centered (from middle), or range (two thumbs)
2941
- - `stops?: boolean = false` — Show stop dots at each step (max 30 visible)
3675
+ - `stops?: boolean = false` — Show stop dots at each step (max 30 visible), and make a dragged thumb snap from step to step instead of following the pointer smoothly (a discrete slider)
2942
3676
  - `icon?: string` — Material Symbol icon shown before the slider — hides once the fill reaches it
2943
3677
  - `color?: "error" | "primary" | "secondary" | "tertiary" = "primary"` — Base color — used for the fill and thumb unless overridden by fillColor/thumbColor
2944
3678
  - `fillColor?: string` — Custom color (hex, rgb(), a CSS var, etc.) for the filled/active portion of the track and the corner dot. Defaults to `color`'s M3 token.
@@ -3134,7 +3868,7 @@ Slots:
3134
3868
  Secondary text component with muted color by default — a thin wrapper around `MText`.
3135
3869
 
3136
3870
  Props:
3137
- - `size?: "medium" | "small" | "large" = "large"` — Subtitle size (maps to body-large/medium/small)
3871
+ - `size?: "small" | "medium" | "large" = "large"` — Subtitle size (maps to body-large/medium/small)
3138
3872
  - `color?: "error" | "primary" | "secondary" | "tertiary" | "on-surface-variant" | "on-surface" | "inherit" = "on-surface-variant"` — Text color
3139
3873
  - `align?: "right" | "left" | "center"` — Text alignment
3140
3874
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
@@ -3300,6 +4034,13 @@ Events:
3300
4034
  - `update:modelValue(string[])` — Emitted whenever a tag is added or removed — powers v-model
3301
4035
  - `debounced(string[])` — Emitted debounce ms after the tag list stops changing (only when debounce > 0)
3302
4036
 
4037
+ Exposed (template ref):
4038
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
4039
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
4040
+ - `blur: () => void | undefined` — Takes focus away from the field
4041
+ - `select: () => void | undefined` — Selects all its text
4042
+ - `setSelectionRange: (start: number, end: number, direction?: "none" | "forward" | "backward" | undefined) => void | undefined` — Selects part of its text (e.g. a file name without its extension)
4043
+
3303
4044
  ### MTerminal
3304
4045
 
3305
4046
  Import from `@m3ui-vue/m3ui-vue/terminal`.
@@ -3333,7 +4074,7 @@ Props:
3333
4074
  - `align?: "right" | "left" | "center" = "left"` — Text alignment
3334
4075
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
3335
4076
  - `lines?: 1 | 2 | 3 | 4 | 5 | 6` — Clamp text to a specific number of lines
3336
- - `weight?: "medium" | "bold" | "regular"` — Font weight override
4077
+ - `weight?: "bold" | "medium" | "regular"` — Font weight override
3337
4078
 
3338
4079
  Slots:
3339
4080
  - `#default` — The text.
@@ -3378,6 +4119,13 @@ Events:
3378
4119
  Slots:
3379
4120
  - `#trailing` — Custom trailing content (e.g. an icon button) — replaces the built-in clear button when present
3380
4121
 
4122
+ Exposed (template ref):
4123
+ - `inputEl: HTMLInputElement | HTMLTextAreaElement | null` — The `<input>` (or `<textarea>`) element
4124
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
4125
+ - `blur: () => void | undefined` — Takes focus away from the field
4126
+ - `select: () => void | undefined` — Selects all its text
4127
+ - `setSelectionRange: (start: number, end: number, direction?: "none" | "forward" | "backward" | undefined) => void | undefined` — Selects part of its text (e.g. a file name without its extension)
4128
+
3381
4129
  ### MTimeline
3382
4130
 
3383
4131
  An event timeline with icon dots, dates, and colors — a single column, alternating left/right, or horizontal. With `current` (or items' `status`) it tracks progress: done steps filled with a solid line, the current one pulsing, the rest outlined with a dashed line. Every part can be replaced through slots, which receive `{ item, index }`; your item type flows into them.
@@ -3485,7 +4233,7 @@ Events:
3485
4233
  Semantic heading component in three sizes — a thin wrapper around `MText` at medium weight.
3486
4234
 
3487
4235
  Props:
3488
- - `size?: "medium" | "small" | "large" = "large"` — Title size (maps to headline-large/medium/small)
4236
+ - `size?: "small" | "medium" | "large" = "large"` — Title size (maps to headline-large/medium/small)
3489
4237
  - `color?: "error" | "primary" | "secondary" | "tertiary" | "on-surface-variant" | "on-surface" | "inherit" = "inherit"` — Text color
3490
4238
  - `align?: "right" | "left" | "center"` — Text alignment
3491
4239
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
@@ -3555,7 +4303,7 @@ A top app bar in four M3 layouts — center-aligned, small, medium, and large
3555
4303
  Props:
3556
4304
  - `title?: string` — App bar title
3557
4305
  - `subtitle?: string` — A line below the title (Compose's `subtitle`): small, center-aligned and flexible medium/large bars
3558
- - `variant?: "center" | "medium" | "small" | "large" = "small"` — 64dp small/center-aligned row, or a 112dp medium / 152dp large two-row layout with the title below
4306
+ - `variant?: "center" | "small" | "medium" | "large" = "small"` — 64dp small/center-aligned row, or a 112dp medium / 152dp large two-row layout with the title below
3559
4307
  - `flexible?: boolean = false` — Medium/large only: M3 Expressive's MediumFlexibleTopAppBar / LargeFlexibleTopAppBar, with a headline-medium / display-small title and room for a subtitle (112/136dp and 120/152dp tall)
3560
4308
  - `titleAlignment?: "center" | "start" = "start"` — Medium/large only: where the title row sits (Compose's `titleHorizontalAlignment`)
3561
4309
  - `navigationIcon?: string` — Leading icon (e.g. menu, arrow_back)
@@ -3660,13 +4408,13 @@ Props:
3660
4408
  - `selected?: string | number | null = null` (v-model:selected) — Currently selected node id (single-select).
3661
4409
  - `checked?: (string | number)[] = []` (v-model:checked) — Checked node ids (checkable multi-select).
3662
4410
  - `checkable?: boolean = false` — Show checkboxes with cascade selection.
3663
- - `defaultExpanded?: "none" | (string | number)[] | "all" = "none"` — Which nodes start expanded. 'all' | 'none' | array of ids (default: 'none').
4411
+ - `defaultExpanded?: "all" | "none" | (string | number)[] = "none"` — Which nodes start expanded. 'all' | 'none' | array of ids (default: 'none').
3664
4412
  - `emptyText?: string` — Text shown when nodes is empty. Falls back to the app's configured locale's noItems string
3665
4413
 
3666
4414
  Events:
3667
4415
  - `update:selected(string | number | null)` — Fires when a node is clicked, toggling selection (clicking the already-selected node clears it)
3668
- - `update:checked((string | number)[])` — Fires when a checkbox toggles a node (checkable mode)
3669
4416
  - `node-click(TreeNode)` — Fires whenever a node row is clicked, alongside update:selected
4417
+ - `update:checked((string | number)[])` — Fires when a checkbox toggles a node (checkable mode)
3670
4418
 
3671
4419
  Exposed (template ref):
3672
4420
  - `expandAll: () => void`
@@ -3720,6 +4468,114 @@ export interface TreeTableRow {
3720
4468
  }
3721
4469
  ```
3722
4470
 
4471
+ ### MVideoPlayer
4472
+
4473
+ Import from `@m3ui-vue/m3ui-vue/media`.
4474
+
4475
+ A video player (not an M3 spec component: a port of Media3's Compose Material3 `Player`, androidx/media `ui_compose_material3`): controls in three slots like Media3's, top (empty, the title in full screen), center (previous, back, a large play/pause, forward, next, centered on the picture) and bottom (an `MSeekBar`, the time and chapter, volume, subtitles, settings, picture in picture and full screen). Unlike Media3's they keep a dark scrim and white content in both themes, as they sit on the picture; the play button is primary-container, a circle while paused that squares off while playing. Controls hide while playing after `hideDelay`. A click plays/pauses and a double click goes full screen; on touch a tap shows or hides the controls, a double tap on either side skips (taps add up), and a long press plays at 2× while held. Keys (with the player focused): Space/K, J/L, arrows, F, M, C, 0–9, Home/End, `<`/`>`. Plays `src`/`sources` in a `<video>`, or anything else through `#media` over a clock of `duration` seconds. HLS (`.m3u8`) plays natively where the browser can; elsewhere pass `:hls="() => import("hls.js")"`.
4476
+
4477
+ Props:
4478
+ - `src?: string` — Video URL
4479
+ - `sources?: VideoSource[]` — Several formats of the video; the browser plays the first it can
4480
+ - `poster?: string` — Image shown before playing
4481
+ - `tracks?: VideoTrack[]` — Subtitle tracks (WebVTT)
4482
+ - `chapters?: SeekBarChapter[]` — Chapters, drawn on the seek bar
4483
+ - `title?: string` — Shown at the top in full screen, and on the lock screen while playing
4484
+ - `duration?: number` — Length in seconds, for `#media` content (with a `<video>` it comes from the file)
4485
+ - `player?: MediaPlayer` — Drive this player instead of one of its own (from `useMediaPlayer()`, kept outside to survive page changes). Read once
4486
+ - `playing?: boolean` (v-model:playing) — Playing (v-model)
4487
+ - `currentTime?: number` (v-model:currentTime) — Position in seconds (v-model)
4488
+ - `rate?: number` (v-model:rate) — Playback speed (v-model)
4489
+ - `volume?: number` (v-model:volume) — Volume, 0 to 1 (v-model)
4490
+ - `muted?: boolean` (v-model:muted) — Muted (v-model)
4491
+ - `autoplay?: boolean = false` — Starts playing when mounted; muted if the browser blocks sound before a user gesture
4492
+ - `loop?: boolean = false` — Starts over at the end
4493
+ - `controls?: boolean = true` — Shows the controls. Off: just the video and its gestures
4494
+ - `hasPrevious?: boolean = false` — Adds previous and next buttons (emits `previous`); with only one of the two, the other shows disabled
4495
+ - `hasNext?: boolean = false` — Adds previous and next buttons (emits `next`); with only one of the two, the other shows disabled
4496
+ - `seekStep?: number = 10` — Seconds the skip buttons, J/L and double taps move
4497
+ - `speeds?: number[] = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]` — Speeds offered in the settings menu
4498
+ - `aspectRatio?: string = "16/9"` — Box ratio, as CSS `aspect-ratio`; `auto` follows the video
4499
+ - `fit?: "contain" | "cover" = "contain"` — How the video fills the box
4500
+ - `hideDelay?: number = 3000` — Milliseconds without activity before the controls hide while playing
4501
+ - `color?: string = "primary"` — Played part of the seek bar: an M3 role or any CSS color
4502
+ - `crossorigin?: "anonymous" | "use-credentials"` — The video's CORS mode. Subtitles from another origin need `anonymous` (and a video host that allows it, as the `<track>` is fetched in the video's mode)
4503
+ - `hls?: (() => Promise<HlsModule>)` — Loads hls.js for `.m3u8` where the browser can't play HLS: `() => import("hls.js")`
4504
+
4505
+ Events:
4506
+ - `error(MediaError | null)` — The video failed to load or play, with the media element's error
4507
+ - `fullscreen(boolean)` — Full screen was entered (true) or left (false)
4508
+ - `update:playing(boolean)`
4509
+ - `update:currentTime(number)`
4510
+ - `update:rate(number)`
4511
+ - `update:volume(number)`
4512
+ - `update:muted(boolean)`
4513
+ - `previous()` — The previous button (or the lock screen's) was pressed
4514
+ - `next()` — The next button (or the lock screen's) was pressed
4515
+ - `ended()` — The video reached its end
4516
+
4517
+ Slots:
4518
+ - `#media { time: number; playing: boolean; rate: number; duration: number; }` — Replaces the `<video>` (a canvas, a shader, a 3D scene). Props: `{ time, playing, rate, duration }`
4519
+ - `#error { error: MediaError; }` — Replaces the error message. Props: `{ error }`
4520
+ - `#end { player: MediaPlayer; replay: () => Promise<void>; }` — Shown over the video when it ends (an "up next", say). Props: `{ player, replay }`
4521
+ - `#top { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Top controls. Props: `VideoPlayerSlotProps`
4522
+ - `#center { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Replaces the center controls. Props: `VideoPlayerSlotProps`
4523
+ - `#bottom { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Replaces the bottom controls. Props: `VideoPlayerSlotProps`
4524
+ - `#settings { player: MediaPlayer; }` — Extra `MMenuItem`s at the end of the settings menu. Props: `{ player }`
4525
+
4526
+ ```ts
4527
+ export interface VideoSource {
4528
+ src: string
4529
+ /** MIME type, e.g. `video/webm` or `application/vnd.apple.mpegurl` (HLS) */
4530
+ type?: string
4531
+ }
4532
+ ```
4533
+
4534
+ ```ts
4535
+ export interface VideoTrack {
4536
+ /** WebVTT file */
4537
+ src: string
4538
+ /** Language code, e.g. `es` */
4539
+ srclang: string
4540
+ /** Shown in the subtitles menu */
4541
+ label: string
4542
+ /** Shown from the start */
4543
+ default?: boolean
4544
+ /** Default `subtitles` */
4545
+ kind?: 'subtitles' | 'captions'
4546
+ }
4547
+ ```
4548
+
4549
+ ```ts
4550
+ /** What the control slots receive */
4551
+ export interface VideoPlayerSlotProps {
4552
+ player: MediaPlayer
4553
+ /** The controls are showing (slots usually fade with them) */
4554
+ shown: boolean
4555
+ fullscreen: boolean
4556
+ /** The player is narrower than 480px (a phone in portrait) */
4557
+ compact: boolean
4558
+ }
4559
+ ```
4560
+
4561
+ ```ts
4562
+ /** The bits of hls.js the player uses, so the library doesn't depend on it */
4563
+ export interface HlsLike {
4564
+ loadSource(src: string): void
4565
+ attachMedia(el: HTMLMediaElement): void
4566
+ destroy(): void
4567
+ on(event: string, fn: (...args: any[]) => void): void
4568
+ levels: { height?: number; bitrate?: number }[]
4569
+ currentLevel: number
4570
+ }
4571
+ ```
4572
+
4573
+ ```ts
4574
+ export interface HlsModule {
4575
+ default: { new (config?: Record<string, unknown>): HlsLike; isSupported(): boolean; Events: Record<string, string> }
4576
+ }
4577
+ ```
4578
+
3723
4579
  ### MVirtualTable
3724
4580
 
3725
4581
  Renders only the rows currently in (or near) the viewport, so a table with thousands of rows stays smooth — no pagination needed. Trade-off: no built-in search/filtering, sort is a client-side full-array sort.
@@ -3904,614 +4760,2062 @@ OpenStreetMap's Nominatim geocoder. Its public server allows one search per seco
3904
4760
  nominatimProvider(options: NominatimOptions = {}): MapSearchProvider
3905
4761
  ```
3906
4762
 
3907
- ### shapeNames
4763
+ ### useMediaPlayer
3908
4764
 
3909
- ```ts
3910
- shapeNames: ("Circle" | "Square" | "Slanted" | "Arch" | "Fan" | "Arrow" | "SemiCircle" | "Oval" | "Pill" | "Triangle" | "Diamond" | "ClamShell" | "Pentagon" | "Gem" | "Sunny" | "VerySunny" | "Cookie4Sided" | "Cookie6Sided" | "Cookie7Sided" | "Cookie9Sided" | "Cookie12Sided" | "Ghostish" | "Clover4Leaf" | "Clover8Leaf" | "Burst" | "SoftBurst" | "Boom" | "SoftBoom" | "Flower" | "Puffy" | "PuffyDiamond" | "PixelCircle" | "PixelTriangle" | "Bun" | "Heart")[]
3911
- ```
4765
+ Import from `@m3ui-vue/m3ui-vue/media`.
3912
4766
 
3913
- ### createM3UI
4767
+ The state and controls of something that plays: an `<audio>`/`<video>` element, or a clock of its own for anything else. Everything is reactive, the writable parts (`playing`, `currentTime`, `rate`, `volume`, `muted`) act on the media when written, and the player takes the Media Session while it plays (lock screen and notification controls, with `metadata`). `MVideoPlayer` and `MAudioPlayer` are built on it; pass one to their `player` prop to keep playing across pages, or build a player UI of your own on it. ```ts const audio = ref<HTMLAudioElement>() const player = useMediaPlayer({ media: audio, metadata: () => ({ title: track.value.title }) }) // <audio ref="audio" :src="track.src" /> … <button
3914
4768
 
3915
4769
  ```ts
3916
- createM3UI(options: M3UIOptions = {}): {
3917
- install: (app: App<any>) => void
3918
- }
4770
+ useMediaPlayer(options: MediaPlayerOptions = {}): MediaPlayer
3919
4771
  ```
3920
4772
 
3921
- ### useTheme
4773
+ ### usePdf
3922
4774
 
3923
- ```ts
3924
- useTheme(): {
3925
- theme: Ref<Theme>
3926
- cycle: () => void
3927
- }
3928
- ```
4775
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
3929
4776
 
3930
- ### useColorPalette
4777
+ Loads a PDF with pdf.js and exposes what a viewer needs: pages and their sizes, the outline, metadata, text search, thumbnails, download and print. `MPdfViewer` is built on it; use it for a viewer of your own, a thumbnail grid, or a search over a document. Reactive to `src`: a new one replaces the document. ```ts const pdf = usePdf(() => file.value) watchEffect(async () => { if (pdf.doc.value) cover.value = await pdf.thumbnail(1, 160) }) const hits = await pdf.search('invoice') ```
3931
4778
 
3932
4779
  ```ts
3933
- useColorPalette(): {
3934
- palette: Ref<string>
3935
- palettes: Palette[]
3936
- set: (id: PaletteId | (string & {})) => void
3937
- seed: Readonly<Ref<{ readonly seed: string; readonly variant?: SchemeVariant; readonly contrast?: number; } | null>>
3938
- setSeed: (seed: string, options?: SeedOptions) => Promise<void>
3939
- contrast: Readonly<Ref<ContrastLevel>>
3940
- activeContrast: Ref<"standard" | "medium" | "high">
3941
- setContrast: (level: ContrastLevel) => void
3942
- persistPalette: Ref<boolean>
3943
- setPersistPalette: (enabled: boolean) => void
3944
- }
4780
+ usePdf(src: MaybeRefOrGetter<PdfSource | null | undefined>, options: PdfOptions = {}): PdfState
3945
4781
  ```
3946
4782
 
3947
- ### palettes
4783
+ ### setPdfWorker
3948
4784
 
3949
- Every palette: the built-in ones, plus `createM3UI({ customPalettes })`.
4785
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
4786
+
4787
+ Sets the pdf.js worker URL for every `usePdf`/`MPdfViewer` of the app (see `PdfOptions.workerSrc`)
3950
4788
 
3951
4789
  ```ts
3952
- palettes: Palette[]
4790
+ setPdfWorker(src: string): void
3953
4791
  ```
3954
4792
 
3955
- ### useConfetti
4793
+ ### useFlow
4794
+
4795
+ Import from `@m3ui-vue/m3ui-vue/flow`.
3956
4796
 
3957
- Confetti for a component: `fire(event)` from the pointer, `fire(el)` from an element, `fire({ from: 'top' })`.
4797
+ The enclosing `<MFlow>`'s state and controls, from any component rendered inside it (a `#node-<type>` slot, a panel of your own). Outside one, use MFlow's template ref, which exposes the same.
3958
4798
 
3959
4799
  ```ts
3960
- useConfetti(): {
3961
- fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => void
3962
- }
4800
+ useFlow(): FlowContext
3963
4801
  ```
3964
4802
 
3965
- ### fireConfetti
4803
+ ### useFlowNode
4804
+
4805
+ Import from `@m3ui-vue/m3ui-vue/flow`.
3966
4806
 
3967
- Fires a burst of confetti. Browser only; does nothing under reduced motion.
4807
+ The node a component is rendered in (inside a `#node-<type>` slot), or null
3968
4808
 
3969
4809
  ```ts
3970
- fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}): void
4810
+ useFlowNode(): FlowNodeState | null
3971
4811
  ```
3972
4812
 
3973
- ### useContainerTransform
4813
+ ### getBezierPath
3974
4814
 
3975
- Material's container transform for elements that live apart from their expanded view: one controller, many elements opening it (a grid of cards), and one `<MContainerTransform :controller>` wherever the expanded view belongs. `open(event, item)` from a click grows that element into the expanded view, with `item` for it to show. ```ts const detail = useContainerTransform<Recipe>() // <MCard v-for="r in recipes"
4815
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4816
+
4817
+ A cubic curve that leaves and arrives square to the nodes' sides. `curvature` (default 0.25) bends it more when the target is behind the source
3976
4818
 
3977
4819
  ```ts
3978
- useContainerTransform(): ContainerTransformController<T>
4820
+ getBezierPath(p: FlowEdgePathParams & { curvature?: number }): FlowEdgePath
3979
4821
  ```
3980
4822
 
3981
- ### SEED_PALETTE
4823
+ ### getSmoothStepPath
3982
4824
 
3983
- The palette id used while a seed color is active (`useColorPalette().setSeed()`).
4825
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4826
+
4827
+ Right-angled steps with rounded corners (`borderRadius`, default 8; 0 gives sharp steps). `offset` (default 20) is how far it leaves a node before turning
3984
4828
 
3985
4829
  ```ts
3986
- SEED_PALETTE: "seed"
4830
+ getSmoothStepPath(p: FlowEdgePathParams & { borderRadius?: number; offset?: number }): FlowEdgePath
3987
4831
  ```
3988
4832
 
3989
- ### themeInitScript
4833
+ ### getStepPath
3990
4834
 
3991
- A script to inline in `<head>` of a server-rendered page (Nuxt, Vite SSR), so dark mode, the palette and the contrast level are on `<html>` before the first paint instead of when the app's JS loads. It does what `useTheme` and `useColorPalette` do when they load in the browser (the stored choice, or the given `createM3UI` defaults; a choice only in a cookie, from `createM3UI({ cookies })`, counts too), so pass it the same options as the plugin. A `seed` default can't be generated this early: its first visit still shows the baseline until the app loads (later visits use the cached CSS). ```ts useHead({ script: [{ innerHTML: themeInitScript({ palette: 'red' }) }] }) ```
4835
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4836
+
4837
+ `getSmoothStepPath` with sharp corners
3992
4838
 
3993
4839
  ```ts
3994
- themeInitScript(options: ThemeInitOptions = {}): string
4840
+ getStepPath(p: FlowEdgePathParams & { offset?: number }): FlowEdgePath
3995
4841
  ```
3996
4842
 
3997
- ### viewportFromHeaders
4843
+ ### getStraightPath
4844
+
4845
+ Import from `@m3ui-vue/m3ui-vue/flow`.
3998
4846
 
3999
- The window size to server-render the adaptive layouts at, from a request's headers: the size `createM3UI({ cookies: true })` keeps in the `m3-viewport` cookie (any visit after the first); the viewport client hints (Chromium, once the server asked for them with `VIEWPORT_HINTS`); or, on a first visit, a size standing for the kind of device (`Sec-CH-UA-Mobile`, then the user agent: a phone, a tablet or a desktop), unless `guess: false`. Undefined when nothing tells: the layouts then render compact. ```ts createM3UI({ cookies: true, initialState: { viewport: viewportFromHeaders(request.headers) } }) ```
4847
+ A straight line between the ends
4000
4848
 
4001
4849
  ```ts
4002
- viewportFromHeaders(headers: RequestHeaders, options: { guess?: boolean } = {}): ViewportSize | undefined
4850
+ getStraightPath(p: FlowEdgePathParams): FlowEdgePath
4003
4851
  ```
4004
4852
 
4005
- ### VIEWPORT_HINTS
4853
+ ### smoothStepPoints
4006
4854
 
4007
- The client hints that carry the window's size (Chromium), for a server's `Accept-CH` and `Critical-CH` response headers. With `Critical-CH`, Chromium repeats the very first request once to send them; later requests carry them after `Accept-CH` alone.
4855
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4856
+
4857
+ The corners of an orthogonal route between the ends, leaving and arriving square to the sides
4008
4858
 
4009
4859
  ```ts
4010
- VIEWPORT_HINTS: "Sec-CH-Viewport-Width, Sec-CH-Viewport-Height"
4860
+ smoothStepPoints(p: FlowEdgePathParams & { offset?: number }): Pt[]
4011
4861
  ```
4012
4862
 
4013
- ### generateScheme
4863
+ ### arrowPath
4014
4864
 
4015
- Generates the light and dark schemes for a seed color (`#rrggbb`).
4865
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4866
+
4867
+ An arrowhead's path at (x, y) pointing along `angle`: open (two strokes) or closed (a filled triangle's outline)
4016
4868
 
4017
4869
  ```ts
4018
- generateScheme(seed: string, options: SeedOptions = {}): Promise<GeneratedScheme>
4870
+ arrowPath(x: number, y: number, angle: number, size = 10, closed = false): string
4019
4871
  ```
4020
4872
 
4021
- ### schemeToCss
4873
+ ### layoutTree
4022
4874
 
4023
- CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css.
4875
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4876
+
4877
+ A tidy tree: each parent centered over its children, every subtree side by side without overlapping, levels aligned. Roots are the nodes nothing points to (in the nodes' order); a child's place among its siblings follows the edges' order. Extra parents and cycles are ignored (a node goes under the first parent reached).
4024
4878
 
4025
4879
  ```ts
4026
- schemeToCss(scheme: GeneratedScheme, id: string): string
4880
+ layoutTree(nodes: FlowNode[], edges: FlowEdge[], options: FlowLayoutOptions = {}): FlowLayoutResult
4027
4881
  ```
4028
4882
 
4029
- ### schemeRoles
4883
+ ### layoutLayered
4030
4884
 
4031
- The `--color-*` roles a generated scheme sets. `success*` is a library extension and stays as themed.
4885
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4886
+
4887
+ A layered layout for directed graphs: every edge points one level onwards where it can (longest path from the sources), the order within a level reduces crossings (barycenter sweeps), and nodes line up with what they're connected to without overlapping. Edges that close a cycle are laid out as if reversed.
4032
4888
 
4033
4889
  ```ts
4034
- schemeRoles: readonly ["primary", "on-primary", "primary-container", "on-primary-container", "secondary", "on-secondary", "secondary-container", "on-secondary-container", "tertiary", "on-tertiary", "tertiary-container", "on-tertiary-container", "error", "on-error", "error-container", "on-error-container", "background", "on-background", "surface", "on-surface", "surface-variant", "on-surface-variant", "surface-dim", "surface-bright", "surface-container-lowest", "surface-container-low", "surface-container", "surface-container-high", "surface-container-highest", "outline", "outline-variant", "inverse-surface", "inverse-on-surface", "inverse-primary", "scrim", "shadow", "primary-fixed", "primary-fixed-dim", "on-primary-fixed", "on-primary-fixed-variant", "secondary-fixed", "secondary-fixed-dim", "on-secondary-fixed", "on-secondary-fixed-variant", "tertiary-fixed", "tertiary-fixed-dim", "on-tertiary-fixed", "on-tertiary-fixed-variant"]
4890
+ layoutLayered(nodes: FlowNode[], edges: FlowEdge[], options: FlowLayoutOptions = {}): FlowLayoutResult
4035
4891
  ```
4036
4892
 
4037
- ### seedFromImage
4893
+ ### parseDot
4038
4894
 
4039
- The seed color of an image, for `generateScheme`, `useColorPalette().setSeed()` or `MScheme`: what Android does with the wallpaper. Takes a URL (cross-origin images need CORS headers, or the canvas can't be read), an `<img>`, an `ImageBitmap` or a `Blob` (a file the user picked). Browser only.
4895
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4896
+
4897
+ Reads a Graphviz DOT graph (`digraph`/`graph`, `strict`, subgraphs, defaults, ports, HTML labels): nodes take their `label` (default the id), `shape=circle`/`doublecircle`/`point` makes a `circle` node, `style=invis` hides; edges take `label`, `color`, `penwidth`, `style=dashed`/`dotted`/`bold`/`invis` and `dir`/`arrowhead`/`arrowtail`; `cluster` subgraphs become groups. Every attribute as written is kept in each node's and edge's `data.attrs` (ports as `tailport`/`headport`), to map the rest yourself. Laid out in layers along `rankdir`, unless every node has a `pos`. Throws a SyntaxError (with line and column) on what isn't DOT.
4040
4898
 
4041
4899
  ```ts
4042
- seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>
4900
+ parseDot(source: string, options: FlowImportOptions = {}): FlowGraph
4043
4901
  ```
4044
4902
 
4045
- ### seedFromPixels
4903
+ ### toDot
4046
4904
 
4047
- The seed color of an image's pixels (RGBA bytes, as `ImageData.data`): its colors quantized and scored the way Android picks a wallpaper's source color (QuantizerCelebi + Score). Fully transparent pixels are skipped.
4905
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4906
+
4907
+ Writes nodes and edges as a Graphviz DOT graph: labels, `circle` nodes as `shape=circle` (`doublecircle` with a ring), groups as `cluster` subgraphs, edge labels, colors (CSS ones; M3 roles are left out), widths, dashes, arrows and hidden ones. Attributes kept in `data.attrs` (as `parseDot` leaves them) are written back too.
4048
4908
 
4049
4909
  ```ts
4050
- seedFromPixels(rgba: ArrayLike<number>): Promise<string>
4910
+ toDot(nodes: FlowNode[], edges: FlowEdge[], options: FlowDotExportOptions = {}): string
4051
4911
  ```
4052
4912
 
4053
- ### useToast
4913
+ ### parseMermaid
4914
+
4915
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4916
+
4917
+ Reads a Mermaid flowchart (`flowchart`/`graph` with TB/TD/BT/LR/RL): node shapes (`(( ))` makes a `circle` node, `((( )))` one with a ring; every other shape is kept as `data.shape`), the `@{ shape, label }` syntax, chains and `&`, links `-->` `---` `-.->` `==>` `~~~` `<-->` `--o` `--x` with `|labels|` or `-- labels -->`, and subgraphs as groups. `classDef`, `style`, `click` and the like are skipped. Laid out in layers along its direction. Throws a SyntaxError (with line and column) on what it can't read.
4054
4918
 
4055
4919
  ```ts
4056
- useToast(): {
4057
- toasts: Ref<Toast[]>
4058
- position: Ref<ToastPosition>
4059
- show: (message: string, variant: ToastVariant = 'info', options: number | ToastOptions = {}) => number
4060
- success: (msg: string, opts?: ToastOptions) => number
4061
- error: (msg: string, opts?: ToastOptions) => number
4062
- warning: (msg: string, opts?: ToastOptions) => number
4063
- info: (msg: string, opts?: ToastOptions) => number
4064
- loading: (msg: string, opts?: Omit<ToastOptions, 'loading'>) => number
4065
- update: (id: number, patch: Partial<Omit<Toast, 'id'>>) => void
4066
- dismiss: (id: number) => void
4067
- }
4920
+ parseMermaid(source: string, options: FlowImportOptions = {}): FlowGraph
4068
4921
  ```
4069
4922
 
4070
- ### useFieldBg
4923
+ ### toMermaid
4071
4924
 
4072
- Auto-detects the background behind `containerEl` and exposes it as `--field-bg`. Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a raw computed color so the outlined label cutout transitions in sync with the rest of the theme switch instead of lagging behind.
4925
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4926
+
4927
+ Writes nodes and edges as a Mermaid flowchart: labels, `circle` nodes as `(( ))` (`((( )))` with a ring), the shape kept in `data.shape` (as `parseMermaid` leaves it), groups as subgraphs, and edges as `-->`, `---` (no arrow), `-.->` (dashed), `==>` (3px or wider), `~~~` (hidden) or `<-->`, with their labels. Ids Mermaid can't take are renamed (`n1`, `n2`…).
4073
4928
 
4074
4929
  ```ts
4075
- useFieldBg(containerEl: Ref<HTMLElement | null>, fieldBgProp: () => string | undefined): {
4076
- resolvedFieldBg: ComputedRef<string>
4077
- }
4930
+ toMermaid(nodes: FlowNode[], edges: FlowEdge[], options: FlowExportOptions = {}): string
4078
4931
  ```
4079
4932
 
4080
- ### useLocale
4933
+ ### useGantt
4934
+
4935
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4936
+
4937
+ The enclosing `<MGantt>`'s state and controls, from a component rendered in its default slot. Outside one, use MGantt's template ref, which exposes the same.
4081
4938
 
4082
4939
  ```ts
4083
- useLocale(): M3Locale
4940
+ useGantt(): GanttContext
4084
4941
  ```
4085
4942
 
4086
- ### defaultLocale
4943
+ ### scheduleTasks
4944
+
4945
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4946
+
4947
+ Moves tasks so every dependency holds: by default only later (`'push'`, what dragging a predecessor does), or as soon as possible (`'asap'`), keeping each task's duration. Summaries follow their tasks. Returns the same array when nothing moves.
4087
4948
 
4088
4949
  ```ts
4089
- defaultLocale: M3Locale
4950
+ scheduleTasks(tasks: readonly T[], options: GanttScheduleOptions = {}): T[]
4090
4951
  ```
4091
4952
 
4092
- ### useDevice
4953
+ ### criticalPath
4954
+
4955
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4956
+
4957
+ The critical path over the tasks' current dates: tasks whose delay would delay the last one's end (no slack), through their dependencies. Slack is in calendar days, or working days with a calendar (so a weekend between two tasks isn't slack).
4093
4958
 
4094
4959
  ```ts
4095
- useDevice(): {
4096
- isMobile: Ref<boolean>
4097
- }
4960
+ criticalPath(tasks: readonly GanttTask[], options: { calendar?: GanttCalendar } = {}): GanttCriticalPath
4098
4961
  ```
4099
4962
 
4100
- ### useAutoGrow
4963
+ ### rollupSummaries
4101
4964
 
4102
- Makes a `<textarea>` grow with its text, between `minRows` and `maxRows` rows, scrolling past the last one: a chat composer, a comment box. Works on any textarea, styled however you like (rows are measured from its computed line height, padding and border). It also follows width changes, which rewrap the text. Returns `resize()` for anything else that changes the text.
4965
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4966
+
4967
+ Summaries take the span of their children (deepest first) and their progress, weighted by duration. Returns the same array when nothing changes.
4103
4968
 
4104
4969
  ```ts
4105
- useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}): {
4106
- resize: () => void
4107
- }
4970
+ rollupSummaries(tasks: readonly T[]): T[]
4108
4971
  ```
4109
4972
 
4110
- ### useThemeTokens
4973
+ ### workingDays
4111
4974
 
4112
- The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across light/dark, palette, contrast and generated (seed) palette changes: for what can't use CSS variables, like a Chart.js dataset, a canvas or a MapLibre layer's paint. Values settle after the theme switch's color transition; with `{ live: true }` they also follow it frame by frame (as `rgba()` midway). Empty strings on the server. ```ts const colors = useThemeTokens(['primary', 'tertiary', 'outline-variant'] as const) const data = computed(() => ({ datasets: [{ data: sales, borderColor: colors.value.primary }] })) ```
4975
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4976
+
4977
+ Working days from `start` to `end`, both included (`YYYY-MM-DD`)
4113
4978
 
4114
4979
  ```ts
4115
- useThemeTokens(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>, Record<T, string>>
4980
+ workingDays(start: string, end: string, calendar?: GanttCalendar): number
4116
4981
  ```
4117
4982
 
4118
- ### useScrollReveal
4983
+ ### addWorkingDays
4119
4984
 
4120
- Reveals elements as they scroll into view: they fade (and slide or grow) in on M3's springs, cascading when several enter together. Pass an element, a template ref, an array of them, or a getter. Off with reduced motion: everything is simply there. For a single element in a template, `v-reveal` does the same.
4985
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4986
+
4987
+ The date `n` working days after `date` (before it when negative); 0 moves a day off to the next working day
4121
4988
 
4122
4989
  ```ts
4123
- useScrollReveal(target: MaybeRefOrGetter<Target>, options: ScrollRevealOptions = {}): {
4124
- stop: () => void
4125
- }
4990
+ addWorkingDays(date: string, n: number, calendar?: GanttCalendar): string
4126
4991
  ```
4127
4992
 
4128
- ### useWindowSizeClass
4993
+ ### taskSpan
4129
4994
 
4130
- The M3 width/height size classes, reactive. With no argument it tracks the browser window. Pass an element (ref or getter) to classify that element's own size instead, which is what the adaptive layout components do, so they adapt to the space they actually get (a column, a dialog, a resizable panel).
4995
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
4996
+
4997
+ A task's span in ms, end exclusive: a date-only end runs to the next midnight; a milestone has none
4131
4998
 
4132
4999
  ```ts
4133
- useWindowSizeClass(target?: MaybeRefOrGetter<HTMLElement | null | undefined>): WindowSizeClassInfo
5000
+ taskSpan(t: Pick<GanttTask, 'start' | 'end' | 'type'>): { start: number; end: number; dateOnly: boolean; }
4134
5001
  ```
4135
5002
 
4136
- ### widthSizeClass
5003
+ ### toGanttCsv
5004
+
5005
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5006
+
5007
+ Tasks as CSV, one row each: id, name, start, end, progress, type, parent, dependencies (`a; b SS+2`), color and the baseline. `data` isn't written (keep it in JSON).
4137
5008
 
4138
5009
  ```ts
4139
- widthSizeClass(width: number): WidthSizeClass
5010
+ toGanttCsv(tasks: readonly GanttTask[], options: GanttCsvOptions = {}): string
4140
5011
  ```
4141
5012
 
4142
- ### heightSizeClass
5013
+ ### parseGanttCsv
5014
+
5015
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5016
+
5017
+ Reads tasks from CSV with a header row: the columns `toGanttCsv` writes, or what other tools call them (Task Name, Start Date, Finish, % Complete, Predecessors…; case and spaces don't matter). Rows without an id get one; without an end, a milestone. `dayFirst` reads `03/04/2026` as the 3rd of April (default true).
4143
5018
 
4144
5019
  ```ts
4145
- heightSizeClass(height: number): HeightSizeClass
5020
+ parseGanttCsv(text: string, options: GanttCsvOptions & { dayFirst?: boolean } = {}): GanttTask<any>[]
4146
5021
  ```
4147
5022
 
4148
- ### useNotification
5023
+ ### toGanttJson
5024
+
5025
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5026
+
5027
+ Tasks as JSON, `{ format: 'm3ui-gantt', version: 1, tasks }`, everything included (`data` too)
4149
5028
 
4150
5029
  ```ts
4151
- useNotification(): {
4152
- notifications: Ref<Notification[]>
4153
- position: Ref<NotificationPosition>
4154
- show: (message: string, variant: NotificationVariant = 'info', options: NotificationOptions = {}) => number
4155
- success: (msg: string, opts?: NotificationOptions) => number
4156
- error: (msg: string, opts?: NotificationOptions) => number
4157
- warning: (msg: string, opts?: NotificationOptions) => number
4158
- info: (msg: string, opts?: NotificationOptions) => number
4159
- loading: (msg: string, opts?: Omit<NotificationOptions, 'loading'>) => number
4160
- update: (id: number, patch: Partial<Omit<Notification, 'id'>>) => void
4161
- dismiss: (id: number) => void
4162
- }
5030
+ toGanttJson(tasks: readonly GanttTask[], options: { space?: number } = {}): string
4163
5031
  ```
4164
5032
 
4165
- ### useDebounce
5033
+ ### parseGanttJson
5034
+
5035
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5036
+
5037
+ Reads tasks from JSON: what `toGanttJson` writes, a bare array of tasks, or `{ tasks: [...] }`. Each needs a name and a start; ids are filled in when missing. Throws a SyntaxError on anything else.
4166
5038
 
4167
5039
  ```ts
4168
- useDebounce(fn: (...args: any[]) => void, ms: number): {
4169
- debounced: (...args: any[]) => void
4170
- cancel: () => void
4171
- }
5040
+ parseGanttJson(text: string): GanttTask<any>[]
4172
5041
  ```
4173
5042
 
4174
- ### usePageProgress
5043
+ ### toMsProjectXml
4175
5044
 
4176
- Shared page-loading progress state (e.g. for a top progress bar between route navigations). Module-level so any number of callers/components stay in sync — call `start()`/`done()` from a router guard, a fetch wrapper, or by hand.
5045
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5046
+
5047
+ Tasks as a Microsoft Project XML file (MSPDI): outline levels for summaries, start and finish (a date-only task's days from `dayStart` to `dayEnd`), duration, percent complete, milestones, predecessors with their type and lag (in days), and the baseline. Project, ProjectLibre and GanttProject open it.
4177
5048
 
4178
5049
  ```ts
4179
- usePageProgress(): {
4180
- progress: Ref<number>
4181
- isActive: Ref<boolean>
4182
- start: () => void
4183
- set: (pct: number) => void
4184
- done: () => void
4185
- }
5050
+ toMsProjectXml(tasks: readonly GanttTask[], options: GanttXmlOptions = {}): string
4186
5051
  ```
4187
5052
 
4188
- ### useSpring
5053
+ ### parseMsProjectXml
5054
+
5055
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5056
+
5057
+ Reads a Microsoft Project XML file (MSPDI, as Project, ProjectLibre or GanttProject save it): the outline (summaries from outline levels), names, start and finish, percent complete, milestones, predecessors (type and lag in days) and the first baseline. With `dates: 'auto'` (default) a project whose tasks all start and finish at the day's working hours comes in as whole days; `'datetime'` keeps the times. The project's name comes back too.
4189
5058
 
4190
5059
  ```ts
4191
- useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec: SpringSpec = FAST_SPATIAL): {
4192
- snap: () => void
4193
- }
5060
+ parseMsProjectXml(text: string, options: { dates?: 'auto' | 'date' | 'datetime' } = {}): { name?: string; tasks: GanttTask<any>[]; }
4194
5061
  ```
4195
5062
 
4196
- ### motionSprings
5063
+ ### useResourceTimeline
4197
5064
 
4198
- Spring specs of the two motion schemes. Spatial springs move things (position, size, shape); effects springs change color and opacity and never overshoot. Standard is the default scheme; Expressive is bouncier, for Expressive components and moments that should feel lively.
5065
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5066
+
5067
+ The enclosing `<MResourceTimeline>`'s state and controls, from a component in its default slot
4199
5068
 
4200
5069
  ```ts
4201
- motionSprings: { readonly standard: { readonly fastSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 1400; }; readonly defaultSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 700; }; readonly slowSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 300; }; readonly fastEffects: { readonly dampingRatio: 1; readonly stiffness: 3800; }; readonly defaultEffects: { readonly dampingRatio: 1; readonly stiffness: 1600; }; readonly slowEffects: { readonly dampingRatio: 1; readonly stiffness: 800; }; }; readonly expressive: { readonly fastSpatial: { readonly dampingRatio: 0.6; readonly stiffness: 800; }; readonly defaultSpatial: { readonly dampingRatio: 0.8; readonly stiffness: 380; }; readonly slowSpatial: { readonly dampingRatio: 0.8; readonly stiffness: 200; }; readonly fastEffects: { readonly dampingRatio: 1; readonly stiffness: 3800; }; readonly defaultEffects: { readonly dampingRatio: 1; readonly stiffness: 1600; }; readonly slowEffects: { readonly dampingRatio: 1; readonly stiffness: 800; }; }; }
5070
+ useResourceTimeline(): ResourceTimelineContext
4202
5071
  ```
4203
5072
 
4204
- ### motionEasings
5073
+ ### useDrawing
4205
5074
 
4206
- Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`)
5075
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5076
+
5077
+ The surrounding MDrawCanvas' state and actions, for a toolbar or panel of your own inside it
4207
5078
 
4208
5079
  ```ts
4209
- motionEasings: { readonly emphasized: readonly [0.2, 0, 0, 1]; readonly emphasizedDecelerate: readonly [0.05, 0.7, 0.1, 1]; readonly emphasizedAccelerate: readonly [0.3, 0, 0.8, 0.15]; readonly standard: readonly [0.2, 0, 0, 1]; readonly standardDecelerate: readonly [0, 0, 0, 1]; readonly standardAccelerate: readonly [0.3, 0, 1, 1]; readonly legacy: readonly [0.4, 0, 0.2, 1]; readonly legacyDecelerate: readonly [0, 0, 0.2, 1]; readonly legacyAccelerate: readonly [0.4, 0, 1, 1]; readonly linear: readonly [0, 0, 1, 1]; }
5080
+ useDrawing(): DrawContext
4210
5081
  ```
4211
5082
 
4212
- ### motionDurations
5083
+ ### strokePath
4213
5084
 
4214
- Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`)
5085
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5086
+
5087
+ A stroke as the SVG path of its filled outline (round caps, its width following pressure)
4215
5088
 
4216
5089
  ```ts
4217
- motionDurations: { readonly short1: 50; readonly short2: 100; readonly short3: 150; readonly short4: 200; readonly medium1: 250; readonly medium2: 300; readonly medium3: 350; readonly medium4: 400; readonly long1: 450; readonly long2: 500; readonly long3: 550; readonly long4: 600; readonly extraLong1: 700; readonly extraLong2: 800; readonly extraLong3: 900; readonly extraLong4: 1000; }
5090
+ strokePath(s: Pick<DrawStroke, 'points' | 'size' | 'pen'>): string
4218
5091
  ```
4219
5092
 
4220
- ### cubicBezier
5093
+ ### shapePath
4221
5094
 
4222
- A cubic-bezier easing as a function of progress (0–1), e.g. `cubicBezier(...motionEasings.emphasized)`, for JS-driven tweens and for mapping a fraction through a curve
5095
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5096
+
5097
+ A shape's outline as an SVG path (stroked), plus an arrow's head (filled)
4223
5098
 
4224
5099
  ```ts
4225
- cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number
5100
+ shapePath(s: Pick<DrawShape, 'shape' | 'from' | 'to' | 'size'>): { d: string; head?: string; }
4226
5101
  ```
4227
5102
 
4228
- ### vRipple
5103
+ ### smoothPoints
4229
5104
 
4230
- The M3 press ripple for any element: `<div v-ripple>`, `v-ripple="false"`, `v-ripple="'#e91e63'"` or `v-ripple="{ disabled, color }"`. A statically positioned element is made `position: relative`. Registered globally as `v-ripple` by `createM3UI()`; import `vRipple` to use it without the plugin.
5105
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5106
+
5107
+ Smooths raw input points: each one moves part of the way toward the next sample (`smoothing` 0 keeps them as they are, 1 follows lazily), and points closer than a fraction of the size are merged. Pressure is kept.
4231
5108
 
4232
5109
  ```ts
4233
- vRipple: Directive<HTMLElement, RippleValue>
5110
+ smoothPoints(points: DrawPoint[], smoothing = 0.5, size = 4): DrawPoint[]
4234
5111
  ```
4235
5112
 
4236
- ### vReveal
5113
+ ### simulatePressure
4237
5114
 
4238
- Reveals the element as it scrolls into view, on M3's springs (see `useScrollReveal` for the options): `v-reveal`, `v-reveal="'scale'"`, `v-reveal="{ effect: 'slide-left', delay: 100 }"`. Items of a `v-for` with the same options cascade in. Off with reduced motion. Registered by `createM3UI()`, or import `vReveal`.
5115
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5116
+
5117
+ Pressure made up from speed, for a mouse or a finger: slow is heavy, fast is light
4239
5118
 
4240
5119
  ```ts
4241
- vReveal: Directive<HTMLElement, RevealValue>
5120
+ simulatePressure(points: DrawPoint[], size: number): DrawPoint[]
4242
5121
  ```
4243
5122
 
4244
- ### vStateLayer
5123
+ ### constrain
4245
5124
 
4246
- The M3 state layer for any element: a tint in its text color at 8% on hover, 10% on keyboard focus and press, 16% while dragged. `<div v-state-layer>`, `v-state-layer="false"`, `v-state-layer="'#e91e63'"` or `v-state-layer="{ disabled, color, dragged }"`. Pairs with `v-ripple`. A statically positioned element is made `position: relative`. Registered globally as `v-state-layer` by `createM3UI()`; import `vStateLayer` to use it without the plugin.
5125
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5126
+
5127
+ Holding Shift: lines snap to 45°, rects and ellipses become squares and circles
4247
5128
 
4248
5129
  ```ts
4249
- vStateLayer: Directive<HTMLElement, StateLayerValue>
5130
+ constrain(kind: DrawShapeKind, from: [number, number], to: [number, number]): [number, number]
4250
5131
  ```
4251
5132
 
4252
- ### vTooltip
5133
+ ### itemBox
4253
5134
 
4254
- MTooltip's plain tooltip on any element, without wrapping it: `v-tooltip="'Save'"` or `v-tooltip="{ text, placement, delay, disabled }"`. Shows after a delay on mouse hover, on keyboard focus, and on a long press on touch (swallowing that press's click, hiding 1.5s after the finger lifts); Escape and scrolling hide it. Registered globally as `v-tooltip` by `createM3UI()`; import `vTooltip` to use it without the plugin.
5135
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5136
+
5137
+ An item's bounds
4255
5138
 
4256
5139
  ```ts
4257
- vTooltip: Directive<HTMLElement, TooltipValue>
5140
+ itemBox(item: DrawItem): DrawBox
4258
5141
  ```
4259
5142
 
4260
- ### vFocusRing
5143
+ ### unionBox
4261
5144
 
4262
- The M3 focus indicator on any element: a 3dp ring in `secondary`, 2dp outside the element, shown on keyboard focus only (`:focus-visible`), never on a click or tap. `<div v-focus-ring tabindex="0">`, `v-focus-ring="false"`, `v-focus-ring="'#e91e63'"` or `v-focus-ring="{ disabled, color, inset, within }"`. It wins over an `outline-none` class on the same element. Registered globally as `v-focus-ring` by `createM3UI()`; import `vFocusRing` to use it without the plugin.
5145
+ Import from `@m3ui-vue/m3ui-vue/draw`.
4263
5146
 
4264
5147
  ```ts
4265
- vFocusRing: Directive<HTMLElement, FocusRingValue>
5148
+ unionBox(boxes: DrawBox[]): DrawBox | null
4266
5149
  ```
4267
5150
 
4268
- ### vScrollElevation
5151
+ ### textBox
4269
5152
 
4270
- Marks an element while the content under it has scrolled, as M3's top app bar does on scroll: it takes the scrolled container color (`surface-container`) and gets a `data-scrolled` attribute for your own styles (`data-scrolled:shadow-elevation-2`). Follows the window, or `v-scroll-elevation="'#list'"` / `{ target, threshold, color, onChange, disabled }`. Add `transition-colors` to the element for a fade. Registered globally as `v-scroll-elevation` by `createM3UI()`; import `vScrollElevation` to use it without the plugin.
5153
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5154
+
5155
+ A text's box, estimated from its characters (good enough to hit and select it)
4271
5156
 
4272
5157
  ```ts
4273
- vScrollElevation: Directive<HTMLElement, ScrollElevationValue>
5158
+ textBox(t: Pick<DrawText, 'at' | 'text' | 'size'>): DrawBox
5159
+ ```
5160
+
5161
+ ### hitItem
5162
+
5163
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5164
+
5165
+ Whether a point (with a tolerance) touches an item
5166
+
5167
+ ```ts
5168
+ hitItem(item: DrawItem, x: number, y: number, tolerance = 4): boolean
5169
+ ```
5170
+
5171
+ ### eraseAt
5172
+
5173
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5174
+
5175
+ The stroke-cutting eraser: the parts of a stroke within `r` of (x, y) go, what's left splits into separate strokes. Returns the item unchanged when it isn't touched, `[]` when it's all gone. Shapes and text go whole.
5176
+
5177
+ ```ts
5178
+ eraseAt(item: DrawItem, x: number, y: number, r: number): DrawItem[]
5179
+ ```
5180
+
5181
+ ### inLasso
5182
+
5183
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5184
+
5185
+ Whether a lasso (a closed polygon) takes an item: most of its points inside
5186
+
5187
+ ```ts
5188
+ inLasso(item: DrawItem, poly: [number, number][]): boolean
5189
+ ```
5190
+
5191
+ ### transformItem
5192
+
5193
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5194
+
5195
+ An item moved by (dx, dy) and scaled by (sx, sy) around (ox, oy)
5196
+
5197
+ ```ts
5198
+ transformItem(item: DrawItem, t: { dx?: number; dy?: number; sx?: number; sy?: number; ox?: number; oy?: number }): DrawItem
5199
+ ```
5200
+
5201
+ ### sortByLayer
5202
+
5203
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5204
+
5205
+ Items in drawing order: by layer, then as they come
5206
+
5207
+ ```ts
5208
+ sortByLayer(items: DrawItem[], layers?: string[]): DrawItem[]
5209
+ ```
5210
+
5211
+ ### itemSvg
5212
+
5213
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5214
+
5215
+ One item as SVG markup
5216
+
5217
+ ```ts
5218
+ itemSvg(item: DrawItem, fontFamily = 'sans-serif'): string
5219
+ ```
5220
+
5221
+ ### toDrawSvg
5222
+
5223
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5224
+
5225
+ A drawing (or one page of it) as a standalone SVG document
5226
+
5227
+ ```ts
5228
+ toDrawSvg(items: DrawItem[], opts: DrawSvgOptions = {}): string
5229
+ ```
5230
+
5231
+ ### svgToPng
5232
+
5233
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5234
+
5235
+ An SVG document rendered to a PNG blob (in a browser), `scale` times its size
5236
+
5237
+ ```ts
5238
+ svgToPng(svg: string, scale = 2): Promise<Blob>
5239
+ ```
5240
+
5241
+ ### drawId
5242
+
5243
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5244
+
5245
+ ```ts
5246
+ drawId(): string
5247
+ ```
5248
+
5249
+ ### shapeNames
5250
+
5251
+ ```ts
5252
+ shapeNames: ("Circle" | "Square" | "Slanted" | "Arch" | "Fan" | "Arrow" | "SemiCircle" | "Oval" | "Pill" | "Triangle" | "Diamond" | "ClamShell" | "Pentagon" | "Gem" | "Sunny" | "VerySunny" | "Cookie4Sided" | "Cookie6Sided" | "Cookie7Sided" | "Cookie9Sided" | "Cookie12Sided" | "Ghostish" | "Clover4Leaf" | "Clover8Leaf" | "Burst" | "SoftBurst" | "Boom" | "SoftBoom" | "Flower" | "Puffy" | "PuffyDiamond" | "PixelCircle" | "PixelTriangle" | "Bun" | "Heart")[]
5253
+ ```
5254
+
5255
+ ### createM3UI
5256
+
5257
+ ```ts
5258
+ createM3UI(options: M3UIOptions = {}): {
5259
+ install: (app: App<any>) => void
5260
+ }
5261
+ ```
5262
+
5263
+ ### useTheme
5264
+
5265
+ ```ts
5266
+ useTheme(): {
5267
+ theme: Ref<Theme>
5268
+ cycle: () => void
5269
+ }
5270
+ ```
5271
+
5272
+ ### useColorPalette
5273
+
5274
+ ```ts
5275
+ useColorPalette(): {
5276
+ palette: Ref<string>
5277
+ palettes: Palette[]
5278
+ set: (id: PaletteId | (string & {})) => void
5279
+ seed: Readonly<Ref<{ readonly seed: string; readonly variant?: SchemeVariant; readonly contrast?: number; } | null>>
5280
+ setSeed: (seed: string, options?: SeedOptions) => Promise<void>
5281
+ contrast: Readonly<Ref<ContrastLevel>>
5282
+ activeContrast: Ref<"standard" | "medium" | "high">
5283
+ setContrast: (level: ContrastLevel) => void
5284
+ persistPalette: Ref<boolean>
5285
+ setPersistPalette: (enabled: boolean) => void
5286
+ }
5287
+ ```
5288
+
5289
+ ### palettes
5290
+
5291
+ Every palette: the built-in ones, plus `createM3UI({ customPalettes })`.
5292
+
5293
+ ```ts
5294
+ palettes: Palette[]
5295
+ ```
5296
+
5297
+ ### useConfetti
5298
+
5299
+ Confetti for a component: `fire(event)` from the pointer, `fire(el)` from an element, `fire({ from: 'top' })`, `fire({ from: 'top', duration: 5000 })` for a rain that lasts. Returns a function that stops it early.
5300
+
5301
+ ```ts
5302
+ useConfetti(): {
5303
+ fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => StopConfetti
5304
+ }
5305
+ ```
5306
+
5307
+ ### fireConfetti
5308
+
5309
+ Fires confetti: one burst, or with `duration` a rain or fountain that keeps going (stop it early with the returned function). Browser only; does nothing under reduced motion.
5310
+
5311
+ ```ts
5312
+ fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}): StopConfetti
5313
+ ```
5314
+
5315
+ ### useFireworks
5316
+
5317
+ Fireworks for a component: `launch()`, `launch({ shapes: ['classic'] })`, `launch({ shapes: ['Heart'] })`, `launch({ duration: 10000 })`.
5318
+
5319
+ ```ts
5320
+ useFireworks(): {
5321
+ launch: (options: FireworksOptions = {}) => StopFireworks
5322
+ }
5323
+ ```
5324
+
5325
+ ### launchFireworks
5326
+
5327
+ Launches fireworks: a few rockets, or with `duration` a show that keeps going (stop it early with the returned function). Browser only; does nothing under reduced motion.
5328
+
5329
+ ```ts
5330
+ launchFireworks(options: FireworksOptions = {}): StopFireworks
5331
+ ```
5332
+
5333
+ ### useReactions
5334
+
5335
+ Floating reactions for a component: `react(event, '🎉')` from the pointer, `react(el, { icon: 'favorite' })` from an element, `react(el, '👏', { count: 5 })` for a handful.
5336
+
5337
+ ```ts
5338
+ useReactions(): {
5339
+ react: (origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}) => void
5340
+ }
5341
+ ```
5342
+
5343
+ ### fireReaction
5344
+
5345
+ Sends a reaction floating up from a point. Browser only.
5346
+
5347
+ ```ts
5348
+ fireReaction(origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}): void
5349
+ ```
5350
+
5351
+ ### useContainerTransform
5352
+
5353
+ Material's container transform for elements that live apart from their expanded view: one controller, many elements opening it (a grid of cards), and one `<MContainerTransform :controller>` wherever the expanded view belongs. `open(event, item)` from a click grows that element into the expanded view, with `item` for it to show. ```ts const detail = useContainerTransform<Recipe>() // <MCard v-for="r in recipes"
5354
+
5355
+ ```ts
5356
+ useContainerTransform(): ContainerTransformController<T>
5357
+ ```
5358
+
5359
+ ### SEED_PALETTE
5360
+
5361
+ The palette id used while a seed color is active (`useColorPalette().setSeed()`).
5362
+
5363
+ ```ts
5364
+ SEED_PALETTE: "seed"
5365
+ ```
5366
+
5367
+ ### themeInitScript
5368
+
5369
+ A script to inline in `<head>` of a server-rendered page (Nuxt, Vite SSR), so dark mode, the palette and the contrast level are on `<html>` before the first paint instead of when the app's JS loads. It does what `useTheme` and `useColorPalette` do when they load in the browser (the stored choice, or the given `createM3UI` defaults; a choice only in a cookie, from `createM3UI({ cookies })`, counts too), so pass it the same options as the plugin. A `seed` default can't be generated this early: its first visit still shows the baseline until the app loads (later visits use the cached CSS). ```ts useHead({ script: [{ innerHTML: themeInitScript({ palette: 'red' }) }] }) ```
5370
+
5371
+ ```ts
5372
+ themeInitScript(options: ThemeInitOptions = {}): string
5373
+ ```
5374
+
5375
+ ### viewportFromHeaders
5376
+
5377
+ The window size to server-render the adaptive layouts at, from a request's headers: the size `createM3UI({ cookies: true })` keeps in the `m3-viewport` cookie (any visit after the first); the viewport client hints (Chromium, once the server asked for them with `VIEWPORT_HINTS`); or, on a first visit, a size standing for the kind of device (`Sec-CH-UA-Mobile`, then the user agent: a phone, a tablet or a desktop), unless `guess: false`. With `createM3UI({ storagePrefix })`, pass the same `storagePrefix` so the right cookie is read. Undefined when nothing tells: the layouts then render compact. ```ts createM3UI({ cookies: true, initialState: { viewport: viewportFromHeaders(request.headers) } }) ```
5378
+
5379
+ ```ts
5380
+ viewportFromHeaders(headers: RequestHeaders, options: { guess?: boolean; storagePrefix?: string } = {}): ViewportSize | undefined
5381
+ ```
5382
+
5383
+ ### VIEWPORT_HINTS
5384
+
5385
+ The client hints that carry the window's size (Chromium), for a server's `Accept-CH` and `Critical-CH` response headers. With `Critical-CH`, Chromium repeats the very first request once to send them; later requests carry them after `Accept-CH` alone.
5386
+
5387
+ ```ts
5388
+ VIEWPORT_HINTS: "Sec-CH-Viewport-Width, Sec-CH-Viewport-Height"
5389
+ ```
5390
+
5391
+ ### generateScheme
5392
+
5393
+ Generates the light and dark schemes for a seed color (`#rrggbb`).
5394
+
5395
+ ```ts
5396
+ generateScheme(seed: string, options: SeedOptions = {}): Promise<GeneratedScheme>
5397
+ ```
5398
+
5399
+ ### schemeToCss
5400
+
5401
+ CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css.
5402
+
5403
+ ```ts
5404
+ schemeToCss(scheme: GeneratedScheme, id: string): string
5405
+ ```
5406
+
5407
+ ### schemeRoles
5408
+
5409
+ The `--color-*` roles a generated scheme sets. `success*` is a library extension and stays as themed.
5410
+
5411
+ ```ts
5412
+ schemeRoles: readonly ["primary", "on-primary", "primary-container", "on-primary-container", "secondary", "on-secondary", "secondary-container", "on-secondary-container", "tertiary", "on-tertiary", "tertiary-container", "on-tertiary-container", "error", "on-error", "error-container", "on-error-container", "background", "on-background", "surface", "on-surface", "surface-variant", "on-surface-variant", "surface-dim", "surface-bright", "surface-container-lowest", "surface-container-low", "surface-container", "surface-container-high", "surface-container-highest", "outline", "outline-variant", "inverse-surface", "inverse-on-surface", "inverse-primary", "scrim", "shadow", "primary-fixed", "primary-fixed-dim", "on-primary-fixed", "on-primary-fixed-variant", "secondary-fixed", "secondary-fixed-dim", "on-secondary-fixed", "on-secondary-fixed-variant", "tertiary-fixed", "tertiary-fixed-dim", "on-tertiary-fixed", "on-tertiary-fixed-variant"]
5413
+ ```
5414
+
5415
+ ### seedFromImage
5416
+
5417
+ The seed color of an image, for `generateScheme`, `useColorPalette().setSeed()` or `MScheme`: what Android does with the wallpaper. Takes a URL (cross-origin images need CORS headers, or the canvas can't be read), an `<img>`, an `ImageBitmap` or a `Blob` (a file the user picked). Browser only.
5418
+
5419
+ ```ts
5420
+ seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>
5421
+ ```
5422
+
5423
+ ### seedFromPixels
5424
+
5425
+ The seed color of an image's pixels (RGBA bytes, as `ImageData.data`): its colors quantized and scored the way Android picks a wallpaper's source color (QuantizerCelebi + Score). Fully transparent pixels are skipped.
5426
+
5427
+ ```ts
5428
+ seedFromPixels(rgba: ArrayLike<number>): Promise<string>
5429
+ ```
5430
+
5431
+ ### useToast
5432
+
5433
+ ```ts
5434
+ useToast(): {
5435
+ toasts: Ref<Toast[]>
5436
+ position: Ref<ToastPosition>
5437
+ show: (message: string, variant: ToastVariant = 'info', options: number | ToastOptions = {}) => number
5438
+ success: (msg: string, opts?: ToastOptions) => number
5439
+ error: (msg: string, opts?: ToastOptions) => number
5440
+ warning: (msg: string, opts?: ToastOptions) => number
5441
+ info: (msg: string, opts?: ToastOptions) => number
5442
+ loading: (msg: string, opts?: Omit<ToastOptions, 'loading'>) => number
5443
+ update: (id: number, patch: Partial<Omit<Toast, 'id'>>) => void
5444
+ dismiss: (id: number) => void
5445
+ }
5446
+ ```
5447
+
5448
+ ### useFieldBg
5449
+
5450
+ Auto-detects the background behind `containerEl` and exposes it as `--field-bg`. Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a raw computed color so the outlined label cutout transitions in sync with the rest of the theme switch instead of lagging behind.
5451
+
5452
+ ```ts
5453
+ useFieldBg(containerEl: Ref<HTMLElement | null>, fieldBgProp: () => string | undefined): {
5454
+ resolvedFieldBg: ComputedRef<string>
5455
+ }
5456
+ ```
5457
+
5458
+ ### useLocale
5459
+
5460
+ ```ts
5461
+ useLocale(): M3Locale
5462
+ ```
5463
+
5464
+ ### defaultLocale
5465
+
5466
+ ```ts
5467
+ defaultLocale: M3Locale
5468
+ ```
5469
+
5470
+ ### useDevice
5471
+
5472
+ ```ts
5473
+ useDevice(): {
5474
+ isMobile: Ref<boolean>
5475
+ }
5476
+ ```
5477
+
5478
+ ### useAutoGrow
5479
+
5480
+ Makes a `<textarea>` grow with its text, between `minRows` and `maxRows` rows, scrolling past the last one: a chat composer, a comment box. Works on any textarea, styled however you like (rows are measured from its computed line height, padding and border). It also follows width changes, which rewrap the text. Returns `resize()` for anything else that changes the text.
5481
+
5482
+ ```ts
5483
+ useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}): {
5484
+ resize: () => void
5485
+ }
5486
+ ```
5487
+
5488
+ ### useThemeTokens
5489
+
5490
+ The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across light/dark, palette, contrast and generated (seed) palette changes: for what can't use CSS variables, like a Chart.js dataset, a canvas or a MapLibre layer's paint. Values settle after the theme switch's color transition; with `{ live: true }` they also follow it frame by frame (as `rgba()` midway). Empty strings on the server. ```ts const colors = useThemeTokens(['primary', 'tertiary', 'outline-variant'] as const) const data = computed(() => ({ datasets: [{ data: sales, borderColor: colors.value.primary }] })) ```
5491
+
5492
+ ```ts
5493
+ useThemeTokens(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>, Record<T, string>>
5494
+ ```
5495
+
5496
+ ### useScrollReveal
5497
+
5498
+ Reveals elements as they scroll into view: they fade (and slide or grow) in on M3's springs, cascading when several enter together. Pass an element, a template ref, an array of them, or a getter. Off with reduced motion: everything is simply there. For a single element in a template, `v-reveal` does the same.
5499
+
5500
+ ```ts
5501
+ useScrollReveal(target: MaybeRefOrGetter<Target>, options: ScrollRevealOptions = {}): {
5502
+ stop: () => void
5503
+ }
5504
+ ```
5505
+
5506
+ ### useWindowSizeClass
5507
+
5508
+ The M3 width/height size classes, reactive. With no argument it tracks the browser window. Pass an element (ref or getter) to classify that element's own size instead, which is what the adaptive layout components do, so they adapt to the space they actually get (a column, a dialog, a resizable panel).
5509
+
5510
+ ```ts
5511
+ useWindowSizeClass(target?: MaybeRefOrGetter<HTMLElement | null | undefined>): WindowSizeClassInfo
5512
+ ```
5513
+
5514
+ ### widthSizeClass
5515
+
5516
+ ```ts
5517
+ widthSizeClass(width: number): WidthSizeClass
5518
+ ```
5519
+
5520
+ ### heightSizeClass
5521
+
5522
+ ```ts
5523
+ heightSizeClass(height: number): HeightSizeClass
5524
+ ```
5525
+
5526
+ ### useNotification
5527
+
5528
+ ```ts
5529
+ useNotification(): {
5530
+ notifications: Ref<Notification[]>
5531
+ position: Ref<NotificationPosition>
5532
+ show: (message: string, variant: NotificationVariant = 'info', options: NotificationOptions = {}) => number
5533
+ success: (msg: string, opts?: NotificationOptions) => number
5534
+ error: (msg: string, opts?: NotificationOptions) => number
5535
+ warning: (msg: string, opts?: NotificationOptions) => number
5536
+ info: (msg: string, opts?: NotificationOptions) => number
5537
+ loading: (msg: string, opts?: Omit<NotificationOptions, 'loading'>) => number
5538
+ update: (id: number, patch: Partial<Omit<Notification, 'id'>>) => void
5539
+ dismiss: (id: number) => void
5540
+ }
5541
+ ```
5542
+
5543
+ ### useDebounce
5544
+
5545
+ ```ts
5546
+ useDebounce(fn: (...args: any[]) => void, ms: number): {
5547
+ debounced: (...args: any[]) => void
5548
+ cancel: () => void
5549
+ }
5550
+ ```
5551
+
5552
+ ### usePageProgress
5553
+
5554
+ Shared page-loading progress state (e.g. for a top progress bar between route navigations). Module-level so any number of callers/components stay in sync — call `start()`/`done()` from a router guard, a fetch wrapper, or by hand.
5555
+
5556
+ ```ts
5557
+ usePageProgress(): {
5558
+ progress: Ref<number>
5559
+ isActive: Ref<boolean>
5560
+ start: () => void
5561
+ set: (pct: number) => void
5562
+ done: () => void
5563
+ }
5564
+ ```
5565
+
5566
+ ### useSpring
5567
+
5568
+ ```ts
5569
+ useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec: SpringSpec = FAST_SPATIAL): {
5570
+ snap: () => void
5571
+ }
5572
+ ```
5573
+
5574
+ ### motionSprings
5575
+
5576
+ Spring specs of the two motion schemes. Spatial springs move things (position, size, shape); effects springs change color and opacity and never overshoot. Standard is the default scheme; Expressive is bouncier, for Expressive components and moments that should feel lively.
5577
+
5578
+ ```ts
5579
+ motionSprings: { readonly standard: { readonly fastSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 1400; }; readonly defaultSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 700; }; readonly slowSpatial: { readonly dampingRatio: 0.9; readonly stiffness: 300; }; readonly fastEffects: { readonly dampingRatio: 1; readonly stiffness: 3800; }; readonly defaultEffects: { readonly dampingRatio: 1; readonly stiffness: 1600; }; readonly slowEffects: { readonly dampingRatio: 1; readonly stiffness: 800; }; }; readonly expressive: { readonly fastSpatial: { readonly dampingRatio: 0.6; readonly stiffness: 800; }; readonly defaultSpatial: { readonly dampingRatio: 0.8; readonly stiffness: 380; }; readonly slowSpatial: { readonly dampingRatio: 0.8; readonly stiffness: 200; }; readonly fastEffects: { readonly dampingRatio: 1; readonly stiffness: 3800; }; readonly defaultEffects: { readonly dampingRatio: 1; readonly stiffness: 1600; }; readonly slowEffects: { readonly dampingRatio: 1; readonly stiffness: 800; }; }; }
5580
+ ```
5581
+
5582
+ ### motionEasings
5583
+
5584
+ Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`)
5585
+
5586
+ ```ts
5587
+ motionEasings: { readonly emphasized: readonly [0.2, 0, 0, 1]; readonly emphasizedDecelerate: readonly [0.05, 0.7, 0.1, 1]; readonly emphasizedAccelerate: readonly [0.3, 0, 0.8, 0.15]; readonly standard: readonly [0.2, 0, 0, 1]; readonly standardDecelerate: readonly [0, 0, 0, 1]; readonly standardAccelerate: readonly [0.3, 0, 1, 1]; readonly legacy: readonly [0.4, 0, 0.2, 1]; readonly legacyDecelerate: readonly [0, 0, 0.2, 1]; readonly legacyAccelerate: readonly [0.4, 0, 1, 1]; readonly linear: readonly [0, 0, 1, 1]; }
5588
+ ```
5589
+
5590
+ ### motionDurations
5591
+
5592
+ Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`)
5593
+
5594
+ ```ts
5595
+ motionDurations: { readonly short1: 50; readonly short2: 100; readonly short3: 150; readonly short4: 200; readonly medium1: 250; readonly medium2: 300; readonly medium3: 350; readonly medium4: 400; readonly long1: 450; readonly long2: 500; readonly long3: 550; readonly long4: 600; readonly extraLong1: 700; readonly extraLong2: 800; readonly extraLong3: 900; readonly extraLong4: 1000; }
5596
+ ```
5597
+
5598
+ ### cubicBezier
5599
+
5600
+ A cubic-bezier easing as a function of progress (0–1), e.g. `cubicBezier(...motionEasings.emphasized)`, for JS-driven tweens and for mapping a fraction through a curve
5601
+
5602
+ ```ts
5603
+ cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number
5604
+ ```
5605
+
5606
+ ### vRipple
5607
+
5608
+ The M3 press ripple for any element: `<div v-ripple>`, `v-ripple="false"`, `v-ripple="'#e91e63'"` or `v-ripple="{ disabled, color }"`. A statically positioned element is made `position: relative`. Registered globally as `v-ripple` by `createM3UI()`; import `vRipple` to use it without the plugin.
5609
+
5610
+ ```ts
5611
+ vRipple: Directive<HTMLElement, RippleValue>
5612
+ ```
5613
+
5614
+ ### vReveal
5615
+
5616
+ Reveals the element as it scrolls into view, on M3's springs (see `useScrollReveal` for the options): `v-reveal`, `v-reveal="'scale'"`, `v-reveal="{ effect: 'slide-left', delay: 100 }"`. Items of a `v-for` with the same options cascade in. Off with reduced motion. Registered by `createM3UI()`, or import `vReveal`.
5617
+
5618
+ ```ts
5619
+ vReveal: Directive<HTMLElement, RevealValue>
5620
+ ```
5621
+
5622
+ ### vStateLayer
5623
+
5624
+ The M3 state layer for any element: a tint in its text color at 8% on hover, 10% on keyboard focus and press, 16% while dragged. `<div v-state-layer>`, `v-state-layer="false"`, `v-state-layer="'#e91e63'"` or `v-state-layer="{ disabled, color, dragged }"`. Pairs with `v-ripple`. A statically positioned element is made `position: relative`. Registered globally as `v-state-layer` by `createM3UI()`; import `vStateLayer` to use it without the plugin.
5625
+
5626
+ ```ts
5627
+ vStateLayer: Directive<HTMLElement, StateLayerValue>
5628
+ ```
5629
+
5630
+ ### vTooltip
5631
+
5632
+ MTooltip's plain tooltip on any element, without wrapping it: `v-tooltip="'Save'"` or `v-tooltip="{ text, placement, delay, disabled }"`. Shows after a delay on mouse hover, on keyboard focus, and on a long press on touch (swallowing that press's click, hiding 1.5s after the finger lifts); Escape and scrolling hide it. Registered globally as `v-tooltip` by `createM3UI()`; import `vTooltip` to use it without the plugin.
5633
+
5634
+ ```ts
5635
+ vTooltip: Directive<HTMLElement, TooltipValue>
5636
+ ```
5637
+
5638
+ ### vFocusRing
5639
+
5640
+ The M3 focus indicator on any element: a 3dp ring in `secondary`, 2dp outside the element, shown on keyboard focus only (`:focus-visible`), never on a click or tap. `<div v-focus-ring tabindex="0">`, `v-focus-ring="false"`, `v-focus-ring="'#e91e63'"` or `v-focus-ring="{ disabled, color, inset, within }"`. It wins over an `outline-none` class on the same element. Registered globally as `v-focus-ring` by `createM3UI()`; import `vFocusRing` to use it without the plugin.
5641
+
5642
+ ```ts
5643
+ vFocusRing: Directive<HTMLElement, FocusRingValue>
5644
+ ```
5645
+
5646
+ ### vScrollElevation
5647
+
5648
+ Marks an element while the content under it has scrolled, as M3's top app bar does on scroll: it takes the scrolled container color (`surface-container`) and gets a `data-scrolled` attribute for your own styles (`data-scrolled:shadow-elevation-2`). Follows the window, or `v-scroll-elevation="'#list'"` / `{ target, threshold, color, onChange, disabled }`. Add `transition-colors` to the element for a fade. Registered globally as `v-scroll-elevation` by `createM3UI()`; import `vScrollElevation` to use it without the plugin.
5649
+
5650
+ ```ts
5651
+ vScrollElevation: Directive<HTMLElement, ScrollElevationValue>
5652
+ ```
5653
+
5654
+ ### vLongPress
5655
+
5656
+ Calls a handler when the element is pressed and held: `v-long-press="onHold"` or `v-long-press="{ handler, duration, tolerance, haptic, mouse, disabled }"`. Moving past the tolerance (a scroll or a drag) cancels it; once it fires, the click the press ends in and the browser's own long-press menu are swallowed, so a long-pressed button doesn't also click. While held, the element has `data-long-pressing` (`data-long-pressing:scale-95`). Registered globally as `v-long-press` by `createM3UI()`; import `vLongPress` to use it without the plugin.
5657
+
5658
+ ```ts
5659
+ vLongPress: Directive<HTMLElement, LongPressValue>
5660
+ ```
5661
+
5662
+ ### vSwipe
5663
+
5664
+ Calls handlers when an element is swiped: `v-swipe="onSwipe"` (any direction, `info.direction` says which) or `v-swipe="{ left, right, up, down, threshold, velocity, onMove, onEnd, mouse, disabled }"`. A swipe counts past `threshold` px, or at any length when flicked faster than `velocity`. The element's `touch-action` is set from the directions you listen to: only left/right leaves vertical scrolling to the page (`pan-y`), only up/down the horizontal (`pan-x`), both block panning from it (`none`). The click a swipe ends in is swallowed. Registered globally as `v-swipe` by `createM3UI()`; import `vSwipe` to use it without the plugin.
5665
+
5666
+ ```ts
5667
+ vSwipe: Directive<HTMLElement, SwipeValue>
5668
+ ```
5669
+
5670
+ ### vClickOutside
5671
+
5672
+ Calls a handler when a press lands outside the element: `v-click-outside="close"` or `v-click-outside="{ handler, exclude, event, disabled }"`. `exclude` takes elements or selectors that count as inside (the toggle button, a teleported popup). Only the primary button counts. Starts listening after the event that mounted it, so the click that opened a panel doesn't close it. Registered globally as `v-click-outside` by `createM3UI()`; import `vClickOutside` to use it without the plugin.
5673
+
5674
+ ```ts
5675
+ vClickOutside: Directive<HTMLElement, ClickOutsideValue>
5676
+ ```
5677
+
5678
+ ### vSkeleton
5679
+
5680
+ Turns an element into its own loading placeholder: `v-skeleton="loading"` or `v-skeleton="{ loading, animation }"`. While loading it keeps its size and corners, hides its content (which still sizes it: placeholder text like `{{ user?.name ?? 'Loading name' }}` gives an empty element a width), takes MSkeleton's tint and animation (`pulse`, `wave` or `none`; still with reduced motion), ignores the pointer and is `aria-busy`. Registered globally as `v-skeleton` by `createM3UI()`; import `vSkeleton` to use it without the plugin.
5681
+
5682
+ ```ts
5683
+ vSkeleton: Directive<HTMLElement, SkeletonValue>
5684
+ ```
5685
+
5686
+ ### vSparkle
5687
+
5688
+ Sparkles that twinkle over an element, to draw the eye to something new or special: `v-sparkle`, `v-sparkle="'hover'"`, `v-sparkle="'#f5b400'"` or `v-sparkle="{ trigger, color, size, rate, shapes, disabled }"`. They're drawn in a layer over the element (a statically positioned one is made `position: relative`), hidden from assistive technology, and pause while it's off screen or the tab is hidden; none under reduced motion. Registered globally as `v-sparkle` by `createM3UI()`; import `vSparkle` to use it without the plugin.
5689
+
5690
+ ```ts
5691
+ vSparkle: Directive<HTMLElement, SparkleValue>
5692
+ ```
5693
+
5694
+ ### emojiCategories
5695
+
5696
+ ```ts
5697
+ emojiCategories: EmojiCategory[]
5698
+ ```
5699
+
5700
+ ### allEmojis
5701
+
5702
+ ```ts
5703
+ allEmojis: string[]
5704
+ ```
5705
+
5706
+ ### randomEmoji
5707
+
5708
+ ```ts
5709
+ randomEmoji(from?: string[]): string
5710
+ ```
5711
+
5712
+ ### withSkinTone
5713
+
5714
+ `emoji` with skin tone `tone` (0 = none, 1–5 = light to dark), if it takes one.
5715
+
5716
+ ```ts
5717
+ withSkinTone(emoji: string, tone: number): string
5718
+ ```
5719
+
5720
+ ### toneableEmojis
5721
+
5722
+ Emoji that take a skin tone (all five one-tone variants exist).
5723
+
5724
+ ```ts
5725
+ toneableEmojis: Set<string>
5726
+ ```
5727
+
5728
+ ### skinTones
5729
+
5730
+ The five Fitzpatrick modifiers, light to dark.
5731
+
5732
+ ```ts
5733
+ skinTones: readonly ["🏻", "🏼", "🏽", "🏾", "🏿"]
5734
+ ```
5735
+
5736
+ ## Types
5737
+
5738
+ ```ts
5739
+ /** What `MMap` provides to everything inside it. */
5740
+ export interface MapContext {
5741
+ /** The MapLibre map, once created (never on the server) */
5742
+ map: ShallowRef<Maplibre.Map | undefined>
5743
+ /** The `maplibre-gl` module, loaded with the map (so nothing imports it on the server) */
5744
+ maplibre: ShallowRef<MaplibreModule | undefined>
5745
+ /** Bumped on every `style.load`: sources and layers added by components are re-added after a style change */
5746
+ styleVersion: Ref<number>
5747
+ /** The style as `MMap`'s `adapter` reads it (undefined without one) */
5748
+ model: ShallowRef<MapLayerModel | undefined>
5749
+ /** Visibility and opacity of the model's layers */
5750
+ layerState: MapLayerState
5751
+ /**
5752
+ * The tool that owns the map's clicks right now (`'measure'` while measuring), or null: `MMapIdentify` stays quiet
5753
+ * meanwhile. Set it from tools of your own the same way
5754
+ */
5755
+ activeTool: Ref<string | null>
5756
+ }
5757
+ ```
5758
+
5759
+ ```ts
5760
+ /**
5761
+ * A map to use from outside `<MMap>`: the `MMap` itself (a template ref: `<MMap ref="map">` → `:map="map"`) or its
5762
+ * `context`. Null or undefined until it mounts.
5763
+ */
5764
+ export type MapSource = { context: MapContext } | MapContext | null | undefined
5765
+ ```
5766
+
5767
+ ```ts
5768
+ /** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
5769
+ export type MaplibreModule = typeof import('maplibre-gl')
5770
+ ```
5771
+
5772
+ ```ts
5773
+ /** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
5774
+ export interface MapLayerState {
5775
+ visible: Record<string, boolean>
5776
+ opacity: Record<string, number>
5777
+ }
5778
+ ```
5779
+
5780
+ ```ts
5781
+ /** Reads a style's conventions (usually its `metadata`) into the model the map's UI components use. */
5782
+ export type MapAdapter = (style: Maplibre.StyleSpecification, context: MapAdapterContext) => MapLayerModel
5783
+ ```
5784
+
5785
+ ```ts
5786
+ /** What an adapter gets besides the style. */
5787
+ export interface MapAdapterContext {
5788
+ /** The style's URL, when `MMap`'s `mapStyle` is one */
5789
+ styleUrl?: string
5790
+ }
5791
+ ```
5792
+
5793
+ ```ts
5794
+ /** How to show one property of a feature. */
5795
+ export interface MapFieldFormat {
5796
+ /** The label (the key, capitalized, by default) */
5797
+ label?: string
5798
+ /** Text before the value */
5799
+ prefix?: string
5800
+ /** Text after the value */
5801
+ suffix?: string
5802
+ /** A number mask: its decimals set the fraction digits (`#.00` → 2) and a comma turns on grouping (`#,###`) */
5803
+ mask?: string
5804
+ /** Leave it out */
5805
+ hidden?: boolean
5806
+ }
5807
+ ```
5808
+
5809
+ ```ts
5810
+ /** What `MMapIdentify` found on one layer at a point. */
5811
+ export interface MapIdentifyResult {
5812
+ layer: MapLayerInfo
5813
+ feature: Maplibre.MapGeoJSONFeature
5814
+ /** Its properties as the layer's `identify` shows them, formatted */
5815
+ fields: { key: string; label: string; value: string }[]
5816
+ }
5817
+ ```
5818
+
5819
+ ```ts
5820
+ /** One layer of the style, as the map's UI components see it. */
5821
+ export interface MapLayerInfo {
5822
+ /** The style layer's id */
5823
+ id: string
5824
+ /** Its name in the UI */
5825
+ title: string
5826
+ description?: string
5827
+ /** The `name` of its group in `MapLayerModel.groups` */
5828
+ group?: string
5829
+ /** Shown in `MMapLayers` */
5830
+ listed: boolean
5831
+ /** A base layer: `MMapBaseLayers` shows one of them at a time, with this thumbnail */
5832
+ base?: { image?: string }
5833
+ /** Layer ids shown, hidden and faded along with it */
5834
+ children: string[]
5835
+ /** Listed by `MMapIdentify` on click: every property, formatted by `format`, minus `exclude` */
5836
+ identify: false | { format: Record<string, MapFieldFormat>; exclude: string[] }
5837
+ /** Shown by `MMapHover` under the pointer: these properties, in order */
5838
+ hover: false | { fields: (MapFieldFormat & { key: string })[] }
5839
+ /** A legend image URL (an SVG, typically) */
5840
+ legend?: string
5841
+ /** A download URL for its data */
5842
+ download?: string
5843
+ }
5844
+ ```
5845
+
5846
+ ```ts
5847
+ /** The style as the map's UI components see it: layers with names, groups, base layers, what to identify. */
5848
+ export interface MapLayerModel {
5849
+ /** The style's name */
5850
+ title?: string
5851
+ /** Groups, in order */
5852
+ groups: { name: string; title: string }[]
5853
+ /** Layers, in the style's order (bottom to top) */
5854
+ layers: MapLayerInfo[]
5855
+ }
5856
+ ```
5857
+
5858
+ ```ts
5859
+ export interface OrvianAdapterOptions {
5860
+ /**
5861
+ * A layer's legend image. By default, for a style served by mvt-rs (`…/services/styles/<style>`), its legend service
5862
+ * (`…/services/legends/<style>?layer_id=<id>`), unless the layer's `metadata.legend.show` is false;
5863
+ * `metadata.legend.wmslegend` overrides it
5864
+ */
5865
+ legend?: (layer: Maplibre.LayerSpecification, styleUrl?: string) => string | undefined
5866
+ }
5867
+ ```
5868
+
5869
+ ```ts
5870
+ /** Finds places for `MMapSearch`: the text in, results out. `signal` aborts a search the user replaced. */
5871
+ export type MapSearchProvider = (query: string, signal: AbortSignal) => Promise<MapSearchResult[]>
5872
+ ```
5873
+
5874
+ ```ts
5875
+ /** A place found by a `MapSearchProvider`. */
5876
+ export interface MapSearchResult {
5877
+ /** What to show */
5878
+ label: string
5879
+ /** Where it is */
5880
+ lngLat: [number, number]
5881
+ /** Its extent, `[west, south, east, north]`: the map fits it instead of zooming to the point */
5882
+ bbox?: [number, number, number, number]
5883
+ /** Its kind (`city`, `road`, `park`, `restaurant`…), for the icon */
5884
+ type?: string
5885
+ }
5886
+ ```
5887
+
5888
+ ```ts
5889
+ export interface NominatimOptions {
5890
+ /** The Nominatim server (`https://nominatim.openstreetmap.org` by default; mind its usage policy, or run your own) */
5891
+ url?: string
5892
+ /** How many results (6) */
5893
+ limit?: number
5894
+ /** The results' language (`es`, `en`…); by default the page's (`<html lang>`) */
5895
+ language?: string
5896
+ /** Only these countries (ISO codes: `['ar']`) */
5897
+ countryCodes?: string[]
5898
+ /** Prefer (or with `bounded`, only) this area: `[west, south, east, north]` */
5899
+ viewbox?: [number, number, number, number]
5900
+ bounded?: boolean
5901
+ }
5902
+ ```
5903
+
5904
+ ```ts
5905
+ export interface MediaPlayer {
5906
+ /** The media element being driven, or null (clock, or not mounted yet) */
5907
+ media: Readonly<Ref<HTMLMediaElement | null>>
5908
+ /** Playing or paused; writing it plays or pauses */
5909
+ playing: WritableComputedRef<boolean>
5910
+ /** Position in seconds; writing it seeks */
5911
+ currentTime: WritableComputedRef<number>
5912
+ /** Length in seconds: 0 until known, Infinity for a live stream */
5913
+ duration: Readonly<Ref<number>>
5914
+ /** Loaded time ranges, `[[start, end], …]` (the clock reports all of it) */
5915
+ buffered: Readonly<Ref<[number, number][]>>
5916
+ /** Playback speed; writing it changes it */
5917
+ rate: WritableComputedRef<number>
5918
+ /** Volume, 0 to 1; writing it changes it */
5919
+ volume: WritableComputedRef<number>
5920
+ /** Muted; writing it mutes or unmutes */
5921
+ muted: WritableComputedRef<boolean>
5922
+ /** Stalled for data (a spinner's moment). Writable for the clock, to simulate buffering: it stops advancing meanwhile */
5923
+ waiting: Ref<boolean>
5924
+ /** Reached the end; `play()` or `toggle()` start over */
5925
+ ended: Readonly<Ref<boolean>>
5926
+ /** A live stream (infinite duration): no seeking */
5927
+ live: Readonly<Ref<boolean>>
5928
+ /** The media element's error, if loading or decoding failed */
5929
+ error: Readonly<Ref<MediaError | null>>
5930
+ /** The browser refused to start playing (autoplay with sound before any user gesture) */
5931
+ blocked: Readonly<Ref<boolean>>
5932
+ /** Whether there is a previous / next item (see the options of the same names) */
5933
+ hasPrevious: Readonly<Ref<boolean>>
5934
+ hasNext: Readonly<Ref<boolean>>
5935
+ play: () => Promise<void>
5936
+ pause: () => void
5937
+ toggle: () => Promise<void>
5938
+ /** Seeks to a time in seconds (clamped to the media) */
5939
+ seek: (time: number) => void
5940
+ /** Seeks by an offset in seconds, `seekStep` by default (negative goes back) */
5941
+ skip: (seconds?: number) => void
5942
+ /** Pauses and goes back to the start */
5943
+ stop: () => void
5944
+ previous: () => void
5945
+ next: () => void
5946
+ /**
5947
+ * Drives this element instead of the `media` option (null: the clock; undefined: back to `media`). What
5948
+ * `MVideoPlayer`/`MAudioPlayer` call with their own element when given a `player`: rate, volume and mute carry over
5949
+ */
5950
+ attach: (el: HTMLMediaElement | null | undefined) => void
5951
+ }
5952
+ ```
5953
+
5954
+ ```ts
5955
+ export interface MediaPlayerOptions {
5956
+ /**
5957
+ * The `<audio>` or `<video>` element to drive (a ref or a getter; it may come and go). Without one the player
5958
+ * runs its own clock over `duration`: for anything that isn't a media file (a canvas, a shader, generated audio)
5959
+ * that should still play, pause, seek and change speed like one.
5960
+ */
5961
+ media?: MaybeRefOrGetter<HTMLMediaElement | null | undefined>
5962
+ /** The length in seconds, for the clock (without `media`) */
5963
+ duration?: MaybeRefOrGetter<number | undefined>
5964
+ /** Shown on the lock screen and the system's media notification while this player plays (Media Session API) */
5965
+ metadata?: MaybeRefOrGetter<MediaPlayerMetadata | null | undefined>
5966
+ /** The previous button (and the lock screen's); without it there is none */
5967
+ onPrevious?: () => void
5968
+ /** The next button (and the lock screen's); without it there is none */
5969
+ onNext?: () => void
5970
+ /** Whether there is a previous item right now (the first of a playlist has none). Default: `onPrevious` was given */
5971
+ hasPrevious?: MaybeRefOrGetter<boolean>
5972
+ /** Whether there is a next item right now. Default: `onNext` was given */
5973
+ hasNext?: MaybeRefOrGetter<boolean>
5974
+ /** Seconds `skip()` and the lock screen's seek buttons move by default. Default 10 */
5975
+ seekStep?: number
5976
+ /** The clock starts over at the end instead of stopping (with `media`, set the element's `loop`) */
5977
+ loop?: MaybeRefOrGetter<boolean | undefined>
5978
+ }
5979
+ ```
5980
+
5981
+ ```ts
5982
+ /** What the lock screen and the system's media notification show (the Media Session API's metadata) */
5983
+ export interface MediaPlayerMetadata {
5984
+ title?: string
5985
+ artist?: string
5986
+ album?: string
5987
+ /** Cover images, largest last is fine: `[{ src, sizes: '512x512', type: 'image/png' }]` or plain URLs */
5988
+ artwork?: (string | { src: string; sizes?: string; type?: string })[]
5989
+ }
5990
+ ```
5991
+
5992
+ ```ts
5993
+ export type PdfDocument = Pdfjs.PDFDocumentProxy
5994
+ ```
5995
+
5996
+ ```ts
5997
+ export interface PdfMetadata {
5998
+ title?: string
5999
+ author?: string
6000
+ subject?: string
6001
+ creator?: string
6002
+ producer?: string
6003
+ creationDate?: Date
6004
+ modificationDate?: Date
6005
+ }
6006
+ ```
6007
+
6008
+ ```ts
6009
+ export interface PdfOptions {
6010
+ /** A password to try first (the `needsPassword` flow handles the rest) */
6011
+ password?: MaybeRefOrGetter<string | undefined>
6012
+ /** Send cookies with a cross-origin URL */
6013
+ withCredentials?: boolean
6014
+ /**
6015
+ * The pdf.js worker's URL (with Vite: `import workerSrc from 'pdfjs-dist/build/pdf.worker.min.mjs?url'`), or
6016
+ * set it once for the app with `setPdfWorker()`. Without one, pdf.js runs on the main thread: it works, but
6017
+ * parsing a big file blocks the page meanwhile
6018
+ */
6019
+ workerSrc?: string
6020
+ }
6021
+ ```
6022
+
6023
+ ```ts
6024
+ export interface PdfOutlineItem {
6025
+ title: string
6026
+ /** 1-based page it points to (undefined for an external link or a destination that can't be resolved) */
6027
+ page?: number
6028
+ /** Where on that page, in PDF points from the bottom, when the destination says */
6029
+ top?: number
6030
+ /** An external link */
6031
+ url?: string
6032
+ children: PdfOutlineItem[]
6033
+ }
6034
+ ```
6035
+
6036
+ ```ts
6037
+ export type PdfPage = Pdfjs.PDFPageProxy
6038
+ ```
6039
+
6040
+ ```ts
6041
+ /** A page's text as `usePdf` indexes it: its text items joined, and where each item starts */
6042
+ export interface PdfPageText {
6043
+ text: string
6044
+ /** Start offset of each text item (the text layer's spans, in order) */
6045
+ starts: number[]
6046
+ }
6047
+ ```
6048
+
6049
+ ```ts
6050
+ export interface PdfSearchMatch {
6051
+ /** 1-based page */
6052
+ page: number
6053
+ /** Index of the match on its page */
6054
+ index: number
6055
+ /** Character offsets in the page's text (see `pageText`) */
6056
+ start: number
6057
+ end: number
6058
+ /** The text around it, for a results list */
6059
+ context: string
6060
+ }
6061
+ ```
6062
+
6063
+ ```ts
6064
+ /** What `usePdf` loads: a URL, the file's bytes, or a `File`/`Blob` (an upload) */
6065
+ export type PdfSource = string | URL | Uint8Array | ArrayBuffer | Blob
6066
+ ```
6067
+
6068
+ ```ts
6069
+ export interface PdfState {
6070
+ /** The pdf.js document, once loaded */
6071
+ doc: ShallowRef<PdfDocument | null>
6072
+ /** The `pdfjs-dist` module, loaded with the first document */
6073
+ pdfjs: ShallowRef<PdfjsModule | null>
6074
+ loading: Readonly<Ref<boolean>>
6075
+ /** Download progress, 0 to 1 (0 while the size is unknown) */
6076
+ progress: Readonly<Ref<number>>
6077
+ error: Readonly<Ref<Error | null>>
6078
+ /** The file is encrypted: call `submitPassword()` */
6079
+ needsPassword: Readonly<Ref<boolean>>
6080
+ /** The last password was wrong */
6081
+ wrongPassword: Readonly<Ref<boolean>>
6082
+ submitPassword: (password: string) => void
6083
+ numPages: Readonly<Ref<number>>
6084
+ /**
6085
+ * Each page's size in PDF points at zoom 1, with its own rotation (index 0 = page 1). Every page starts as the
6086
+ * first one's size and gets its own as the pages are read, in the background
6087
+ */
6088
+ pageSizes: Readonly<Ref<{ width: number; height: number }[]>>
6089
+ outline: Readonly<Ref<PdfOutlineItem[]>>
6090
+ metadata: Readonly<Ref<PdfMetadata>>
6091
+ getPage: (page: number) => Promise<PdfPage>
6092
+ /** A page's text (cached) */
6093
+ pageText: (page: number) => Promise<PdfPageText>
6094
+ /** Finds text in every page (case and accent insensitive unless `caseSensitive`) */
6095
+ search: (query: string, options?: { caseSensitive?: boolean; signal?: AbortSignal }) => Promise<PdfSearchMatch[]>
6096
+ /** A picture of a page `width` CSS pixels wide, as an object URL (cached; revoked when the document changes) */
6097
+ thumbnail: (page: number, width?: number) => Promise<string>
6098
+ /** Resolves a link destination (a name or an explicit array) to a page and a position */
6099
+ resolveDest: (dest: unknown) => Promise<{ page: number; top?: number } | null>
6100
+ /** The file's bytes */
6101
+ getData: () => Promise<Uint8Array>
6102
+ /** Saves the file */
6103
+ download: (fileName?: string) => Promise<void>
6104
+ /** Opens the browser's print dialog for the file */
6105
+ print: () => Promise<void>
6106
+ }
6107
+ ```
6108
+
6109
+ ```ts
6110
+ /** The `pdfjs-dist` module */
6111
+ export type PdfjsModule = typeof import('pdfjs-dist')
6112
+ ```
6113
+
6114
+ ```ts
6115
+ /** What a `circle` node shows */
6116
+ export interface FlowCircleData {
6117
+ label?: string
6118
+ /** Its fill: a container role (default a neutral surface) */
6119
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral' | 'inverse'
6120
+ /** A small count or tag on its top right (a level, an excess) */
6121
+ badge?: string | number
6122
+ /** A soft halo around it, in a role's color */
6123
+ ring?: 'primary' | 'secondary' | 'tertiary' | 'error'
6124
+ /** Diameter in px (default 56) */
6125
+ size?: number
6126
+ }
6127
+ ```
6128
+
6129
+ ```ts
6130
+ /** A connection being made or checked */
6131
+ export interface FlowConnection {
6132
+ source: string
6133
+ sourceHandle: string | null
6134
+ target: string
6135
+ targetHandle: string | null
6136
+ }
6137
+ ```
6138
+
6139
+ ```ts
6140
+ /** What MFlow provides to everything inside it, and `useFlow()` returns */
6141
+ export interface FlowContext {
6142
+ nodes: ComputedRef<FlowNode[]>
6143
+ edges: ComputedRef<FlowEdge[]>
6144
+ viewport: Readonly<Ref<FlowViewport>>
6145
+ selection: ComputedRef<FlowSelection>
6146
+ minZoom: ComputedRef<number>
6147
+ maxZoom: ComputedRef<number>
6148
+ /** Canvas size in px */
6149
+ size: Readonly<Ref<{ width: number; height: number }>>
6150
+ /** Interaction switched off by the lock button (or MFlow's `locked`) */
6151
+ locked: Ref<boolean>
6152
+ getNode(id: string): FlowNode | undefined
6153
+ /** A node's top left corner in flow coordinates, its parents added, where it's drawn right now */
6154
+ getAbsolutePosition(id: string): FlowXY
6155
+ /** A node's measured (or set) size */
6156
+ getSize(id: string): { width: number; height: number }
6157
+ /** Nodes overlapping this one (or a rectangle in flow coordinates), groups and its own family left out */
6158
+ getIntersectingNodes(node: string | { x: number; y: number; width: number; height: number }): FlowNode[]
6159
+ /** Page (client) coordinates → flow coordinates */
6160
+ screenToFlow(p: { x: number; y: number }): FlowXY
6161
+ flowToScreen(p: FlowXY): { x: number; y: number }
6162
+ setViewport(v: Partial<FlowViewport>, opts?: { animate?: boolean }): void
6163
+ fitView(opts?: FlowFitOptions): void
6164
+ /** Centers the view on a flow point, at `zoom` or the current zoom */
6165
+ setCenter(x: number, y: number, opts?: { zoom?: number; animate?: boolean }): void
6166
+ zoomIn(): void
6167
+ zoomOut(): void
6168
+ zoomTo(zoom: number, opts?: { animate?: boolean }): void
6169
+ addNodes(nodes: FlowNode | FlowNode[]): void
6170
+ addEdges(edges: FlowEdge | FlowEdge[]): void
6171
+ updateNode(id: string, patch: Partial<FlowNode> | ((n: FlowNode) => FlowNode)): void
6172
+ updateEdge(id: string, patch: Partial<FlowEdge> | ((e: FlowEdge) => FlowEdge)): void
6173
+ /** Deletes nodes (with their edges and children) and edges by id */
6174
+ remove(ids: { nodes?: string[]; edges?: string[] }): void
6175
+ setSelection(sel: Partial<FlowSelection>): void
6176
+ /** Runs a layout over the nodes' measured sizes; default MFlow's `layout` (or the tree layout). Animated and undoable */
6177
+ layout(fn?: 'tree' | 'layered' | FlowLayout, options?: FlowLayoutOptions): Promise<void>
6178
+ undo(): void
6179
+ redo(): void
6180
+ canUndo: ComputedRef<boolean>
6181
+ canRedo: ComputedRef<boolean>
6182
+ copy(): void
6183
+ cut(): void
6184
+ /** Pastes what was copied, at a flow point (default a step from the originals) */
6185
+ paste(at?: FlowXY): void
6186
+ /**
6187
+ * Drags a node with a pointer that's already down, e.g. one just added from a palette outside the canvas: it
6188
+ * follows the pointer from there (guides, splicing into an edge) until it's let go. With a finger, the page
6189
+ * doesn't scroll under it meanwhile (start the drag from a long press, so a swipe still scrolls your palette)
6190
+ */
6191
+ startDrag(id: string, e: PointerEvent): void
6192
+ }
6193
+ ```
6194
+
6195
+ ```ts
6196
+ export interface FlowEdge<D = any> {
6197
+ id: string
6198
+ source: string
6199
+ target: string
6200
+ /** The handle's `id` when its node has several */
6201
+ sourceHandle?: string | null
6202
+ targetHandle?: string | null
6203
+ /** `bezier` (default), `smoothstep`, `step`, `straight`, or a `#edge-<type>` slot */
6204
+ type?: string
6205
+ /**
6206
+ * For a `#edge-<type>` slot: how it's routed, which is the `path` the slot gets and where the edge is hit
6207
+ * (default `bezier`)
6208
+ */
6209
+ pathType?: 'bezier' | 'smoothstep' | 'step' | 'straight'
6210
+ label?: string
6211
+ /** The label chip's color (default a neutral chip) */
6212
+ labelTone?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral'
6213
+ /** Dashes that flow from source to target (`'reverse'`: from target to source) */
6214
+ animated?: boolean | 'reverse'
6215
+ /** The line's (and arrowhead's) color: an M3 role (`primary`, `tertiary`, `error`, `outline`…) or any CSS color. Changes animate */
6216
+ color?: string
6217
+ /** The line's width in px (default 2). Changes animate */
6218
+ width?: number
6219
+ /** A dashed line, standing still */
6220
+ dashed?: boolean
6221
+ /** Default `arrow-closed` */
6222
+ markerEnd?: FlowMarker
6223
+ markerStart?: FlowMarker
6224
+ data?: D
6225
+ hidden?: boolean
6226
+ selectable?: boolean
6227
+ deletable?: boolean
6228
+ /** Its ends can be dragged to other handles once selected; default MFlow's `edgesReconnectable` */
6229
+ reconnectable?: boolean
6230
+ class?: string
6231
+ }
6232
+ ```
6233
+
6234
+ ```ts
6235
+ export interface FlowFitOptions {
6236
+ /** Room around the nodes, a fraction of the view (default 0.1) */
6237
+ padding?: number
6238
+ /** Only these nodes */
6239
+ nodes?: string[]
6240
+ maxZoom?: number
6241
+ minZoom?: number
6242
+ /** Default true */
6243
+ animate?: boolean
6244
+ }
6245
+ ```
6246
+
6247
+ ```ts
6248
+ /** A handle as measured: its center relative to its node's corner, in flow units */
6249
+ export interface FlowHandleBounds {
6250
+ id: string | null
6251
+ type: 'source' | 'target'
6252
+ position: FlowPosition
6253
+ x: number
6254
+ y: number
6255
+ connectable: boolean
6256
+ }
6257
+ ```
6258
+
6259
+ ```ts
6260
+ export type FlowMarker = 'arrow' | 'arrow-closed' | 'none'
6261
+ ```
6262
+
6263
+ ```ts
6264
+ /**
6265
+ * A node. Treat nodes as immutable: MFlow emits new arrays with new objects for whatever changed (`v-model:nodes`),
6266
+ * and the history (undo) keeps the old ones.
6267
+ */
6268
+ export interface FlowNode<D = any> {
6269
+ id: string
6270
+ /**
6271
+ * How it's drawn: `default` (an MFlowNode with a handle each side), `input` (only a source), `output` (only a
6272
+ * target), `circle` (a round vertex, see `FlowCircleData`), `group` (a container for nodes whose `parentId` is this
6273
+ * one), or any name you give a `#node-<type>` slot
6274
+ */
6275
+ type?: string
6276
+ /** Its top left corner, in flow coordinates (relative to the parent's corner when it has a `parentId`) */
6277
+ position: FlowXY
6278
+ /** Anything; the default node shows `label`, `subtitle` and `icon` */
6279
+ data?: D
6280
+ /** A fixed size; otherwise it's measured. A `group` without one wraps its children */
6281
+ width?: number
6282
+ height?: number
6283
+ /** The group this node sits in: it moves with it */
6284
+ parentId?: string
6285
+ /** `'parent'` keeps it inside its group */
6286
+ extent?: 'parent'
6287
+ /** Where the default node's handles go; default from MFlow's `direction` */
6288
+ sourcePosition?: FlowPosition
6289
+ targetPosition?: FlowPosition
6290
+ hidden?: boolean
6291
+ draggable?: boolean
6292
+ selectable?: boolean
6293
+ connectable?: boolean
6294
+ deletable?: boolean
6295
+ /** `false` keeps it from splicing into an edge when dropped onto one */
6296
+ insertable?: boolean
6297
+ class?: string
6298
+ }
6299
+ ```
6300
+
6301
+ ```ts
6302
+ export interface FlowSelection { nodes: string[]; edges: string[] }
6303
+ ```
6304
+
6305
+ ```ts
6306
+ /** The view: `x`/`y` in px, where the flow's origin is on the canvas, and the zoom */
6307
+ export interface FlowViewport { x: number; y: number; zoom: number }
6308
+ ```
6309
+
6310
+ ```ts
6311
+ /** A point in flow coordinates */
6312
+ export interface FlowXY { x: number; y: number }
6313
+ ```
6314
+
6315
+ ```ts
6316
+ export interface FlowEdgePath {
6317
+ /** The SVG path (`d`) */
6318
+ path: string
6319
+ /** Where the label goes: the path's middle */
6320
+ labelX: number
6321
+ labelY: number
6322
+ /** The direction the path leaves the source in, in radians (0 = right, π/2 = down) */
6323
+ sourceAngle: number
6324
+ /** The direction the path arrives at the target in, in radians: the way an arrowhead points */
6325
+ targetAngle: number
6326
+ }
6327
+ ```
6328
+
6329
+ ```ts
6330
+ export interface FlowEdgePathParams {
6331
+ sourceX: number
6332
+ sourceY: number
6333
+ /** Default 'bottom' */
6334
+ sourcePosition?: FlowPosition
6335
+ targetX: number
6336
+ targetY: number
6337
+ /** Default 'top' */
6338
+ targetPosition?: FlowPosition
6339
+ }
4274
6340
  ```
4275
6341
 
4276
- ### vLongPress
6342
+ ```ts
6343
+ // Edge paths for MFlow, also exported for edges of your own (`#edge-<type>` slots). Every function takes the two
6344
+ // ends in flow coordinates plus the side of its node each end leaves from, and returns an SVG path, the point
6345
+ // where a label sits and the direction the path arrives in (for an arrowhead).
4277
6346
 
4278
- Calls a handler when the element is pressed and held: `v-long-press="onHold"` or `v-long-press="{ handler, duration, tolerance, haptic, mouse, disabled }"`. Moving past the tolerance (a scroll or a drag) cancels it; once it fires, the click the press ends in and the browser's own long-press menu are swallowed, so a long-pressed button doesn't also click. While held, the element has `data-long-pressing` (`data-long-pressing:scale-95`). Registered globally as `v-long-press` by `createM3UI()`; import `vLongPress` to use it without the plugin.
6347
+ /** A side of a node: where a handle sits and the direction an edge leaves it in */
6348
+ export type FlowPosition = 'top' | 'right' | 'bottom' | 'left'
6349
+ ```
4279
6350
 
4280
6351
  ```ts
4281
- vLongPress: Directive<HTMLElement, LongPressValue>
6352
+ /** A layout: MFlow's `layout` prop and `layout()` take one */
6353
+ export type FlowLayout = (
6354
+ nodes: FlowNode[],
6355
+ edges: FlowEdge[],
6356
+ options: FlowLayoutOptions & { sizes: Map<string, { width: number; height: number }>; direction: FlowLayoutDirection },
6357
+ ) => FlowLayoutResult | Promise<FlowLayoutResult>
4282
6358
  ```
4283
6359
 
4284
- ### vSwipe
4285
-
4286
- Calls handlers when an element is swiped: `v-swipe="onSwipe"` (any direction, `info.direction` says which) or `v-swipe="{ left, right, up, down, threshold, velocity, onMove, onEnd, mouse, disabled }"`. A swipe counts past `threshold` px, or at any length when flicked faster than `velocity`. The element's `touch-action` is set from the directions you listen to: only left/right leaves vertical scrolling to the page (`pan-y`), only up/down the horizontal (`pan-x`), both block panning from it (`none`). The click a swipe ends in is swallowed. Registered globally as `v-swipe` by `createM3UI()`; import `vSwipe` to use it without the plugin.
4287
-
4288
6360
  ```ts
4289
- vSwipe: Directive<HTMLElement, SwipeValue>
6361
+ export type FlowLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL'
4290
6362
  ```
4291
6363
 
4292
- ### vClickOutside
6364
+ ```ts
6365
+ export interface FlowLayoutOptions {
6366
+ /** TB (top to bottom, the default for a vertical MFlow), BT, LR (default for a horizontal one) or RL */
6367
+ direction?: FlowLayoutDirection
6368
+ /** Space between neighbors in a level, px (default 40) */
6369
+ gap?: number
6370
+ /** Space between levels, px (default 80) */
6371
+ levelGap?: number
6372
+ /** Node sizes; MFlow passes the measured ones */
6373
+ sizes?: Map<string, { width: number; height: number }> | Record<string, { width: number; height: number }>
6374
+ /** Size of a node missing from `sizes` (default 180 × 60) */
6375
+ defaultSize?: { width: number; height: number }
6376
+ }
6377
+ ```
4293
6378
 
4294
- Calls a handler when a press lands outside the element: `v-click-outside="close"` or `v-click-outside="{ handler, exclude, event, disabled }"`. `exclude` takes elements or selectors that count as inside (the toggle button, a teleported popup). Only the primary button counts. Starts listening after the event that mounted it, so the click that opened a panel doesn't close it. Registered globally as `v-click-outside` by `createM3UI()`; import `vClickOutside` to use it without the plugin.
6379
+ ```ts
6380
+ /** Top left corners by node id */
6381
+ export type FlowLayoutResult = Record<string, FlowXY>
6382
+ ```
4295
6383
 
4296
6384
  ```ts
4297
- vClickOutside: Directive<HTMLElement, ClickOutsideValue>
6385
+ // Where MFlowControls / MFlowMinimap (or a panel of yours) sit over MFlow's canvas
6386
+ export type FlowPanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right'
4298
6387
  ```
4299
6388
 
4300
- ### vSkeleton
6389
+ ```ts
6390
+ /** A graph read from text */
6391
+ export interface FlowGraph {
6392
+ nodes: FlowNode[]
6393
+ edges: FlowEdge[]
6394
+ /** The graph's own direction (DOT `rankdir`, Mermaid `flowchart LR`) */
6395
+ rankdir: FlowLayoutDirection
6396
+ /** The same, as MFlow's `direction` prop */
6397
+ direction: 'horizontal' | 'vertical'
6398
+ /** False for a DOT `graph` (edges without arrows) */
6399
+ directed: boolean
6400
+ /** The DOT graph's name */
6401
+ name?: string
6402
+ /** The DOT graph's `label` */
6403
+ label?: string
6404
+ /** Every graph-level DOT attribute, as written */
6405
+ attrs: Record<string, string>
6406
+ }
6407
+ ```
4301
6408
 
4302
- Turns an element into its own loading placeholder: `v-skeleton="loading"` or `v-skeleton="{ loading, animation }"`. While loading it keeps its size and corners, hides its content (which still sizes it: placeholder text like `{{ user?.name ?? 'Loading name' }}` gives an empty element a width), takes MSkeleton's tint and animation (`pulse`, `wave` or `none`; still with reduced motion), ignores the pointer and is `aria-busy`. Registered globally as `v-skeleton` by `createM3UI()`; import `vSkeleton` to use it without the plugin.
6409
+ ```ts
6410
+ export interface FlowImportOptions {
6411
+ /** How to place the nodes: `'layered'` (default), `'tree'`, or `false` to leave them at 0,0 (for MFlow's `layout` prop, which measures them first) */
6412
+ layout?: 'layered' | 'tree' | false
6413
+ /** Gaps, sizes and direction for the layout (the direction defaults to the graph's own) */
6414
+ layoutOptions?: FlowLayoutOptions
6415
+ /** The type given to plain nodes (default none: MFlow's default node) */
6416
+ nodeType?: string
6417
+ /** The type given to every edge (e.g. `'smoothstep'`; default none: a bezier) */
6418
+ edgeType?: string
6419
+ }
6420
+ ```
4303
6421
 
4304
6422
  ```ts
4305
- vSkeleton: Directive<HTMLElement, SkeletonValue>
6423
+ export interface FlowExportOptions {
6424
+ /** The direction written (`rankdir` / `flowchart XX`): a layout direction or MFlow's `direction` (default TB) */
6425
+ direction?: FlowLayoutDirection | 'horizontal' | 'vertical'
6426
+ /** Node sizes, for `positions` (default each node's `width`/`height`, else 180 × 60) */
6427
+ sizes?: Map<string, { width: number; height: number }> | Record<string, { width: number; height: number }>
6428
+ }
4306
6429
  ```
4307
6430
 
4308
- ### emojiCategories
6431
+ ```ts
6432
+ export interface FlowDotExportOptions extends FlowExportOptions {
6433
+ /** The graph's name */
6434
+ name?: string
6435
+ /** `digraph` (default) or `graph`, whose edges have no direction */
6436
+ directed?: boolean
6437
+ /** Writes each node's place as `pos` (in points, y up), for `neato -n` */
6438
+ positions?: boolean
6439
+ }
6440
+ ```
4309
6441
 
4310
6442
  ```ts
4311
- emojiCategories: EmojiCategory[]
6443
+ /** A column of MGantt's task list */
6444
+ export interface GanttColumn {
6445
+ /** `name`, `start`, `end`, `duration` and `progress` are built in; anything else reads `task.data[key]` (or the slot `#cell-<key>`) */
6446
+ key: string
6447
+ label?: string
6448
+ /** px; the `name` column takes what's left when it has none */
6449
+ width?: number
6450
+ align?: 'start' | 'center' | 'end'
6451
+ /** Text for a cell */
6452
+ format?: (task: GanttTask) => string
6453
+ }
4312
6454
  ```
4313
6455
 
4314
- ### allEmojis
6456
+ ```ts
6457
+ /** What MGantt provides to everything inside it (MGanttControls, panels of yours), and its template ref exposes */
6458
+ export interface GanttContext {
6459
+ /** The tasks as drawn: summaries rolled up from their children */
6460
+ tasks: ComputedRef<GanttTask[]>
6461
+ selection: ComputedRef<string[]>
6462
+ /** The closest named scale to the zoom */
6463
+ scale: ComputedRef<GanttScale>
6464
+ /** The zoom, in px per day */
6465
+ pxPerDay: Readonly<Ref<number>>
6466
+ readonly: ComputedRef<boolean>
6467
+ canUndo: ComputedRef<boolean>
6468
+ canRedo: ComputedRef<boolean>
6469
+ /** Every task id whose children are hidden */
6470
+ collapsed: ComputedRef<string[]>
6471
+ undo(): void
6472
+ redo(): void
6473
+ zoomIn(): void
6474
+ zoomOut(): void
6475
+ setScale(scale: GanttScale): void
6476
+ /** Scrolls so a date (default now) sits at the view's `align` (default center) */
6477
+ scrollToDate(date?: string, opts?: { align?: 'start' | 'center'; animate?: boolean }): void
6478
+ /** Scrolls a task into view, its row and its bar */
6479
+ scrollToTask(id: string): void
6480
+ toggle(id: string, expanded?: boolean): void
6481
+ expandAll(): void
6482
+ collapseAll(): void
6483
+ setSelection(ids: string[]): void
6484
+ /** Adds tasks (after `after`, or at the end); undoable */
6485
+ addTasks(tasks: GanttTask | GanttTask[], opts?: { after?: string }): void
6486
+ updateTask(id: string, patch: Partial<GanttTask> | ((t: GanttTask) => GanttTask)): void
6487
+ /** Deletes tasks with their children and the dependencies on them */
6488
+ removeTasks(ids: string[]): void
6489
+ /** Makes `to` depend on `from` */
6490
+ link(from: string, to: string, type?: GanttDependency['type'], lag?: number): void
6491
+ unlink(from: string, to: string): void
6492
+ /** Runs `scheduleTasks` over the tasks with MGantt's calendar; undoable */
6493
+ schedule(options?: GanttScheduleOptions): void
6494
+ criticalPath: ComputedRef<GanttCriticalPath>
6495
+ /** The date (snapped) under a page x */
6496
+ dateAt(clientX: number): string
6497
+ }
6498
+ ```
4315
6499
 
4316
6500
  ```ts
4317
- allEmojis: string[]
6501
+ /** MGantt's named zoom levels */
6502
+ export type GanttScale = TimeUnit
4318
6503
  ```
4319
6504
 
4320
- ### randomEmoji
6505
+ ```ts
6506
+ /** A task. MGantt emits new arrays with new objects for whatever changed (`v-model:tasks`) */
6507
+ export interface GanttTask<D = any> {
6508
+ id: string
6509
+ name: string
6510
+ /** `YYYY-MM-DD` (whole days) or a datetime (`YYYY-MM-DDTHH:mm`, local, or ISO with a zone) */
6511
+ start: string
6512
+ /** A date is the last day (inclusive); a datetime is when it ends. A milestone needs none */
6513
+ end?: string
6514
+ /** 0 to 100 */
6515
+ progress?: number
6516
+ /** `summary` is implied for a task with children (its dates and progress roll up from them) */
6517
+ type?: 'task' | 'milestone' | 'summary'
6518
+ /** The summary task it belongs to */
6519
+ parentId?: string
6520
+ /** Its predecessors: ids (finish-to-start) or `GanttDependency` */
6521
+ dependencies?: (string | GanttDependency)[]
6522
+ /** An M3 role (default `primary`; `summary` defaults to `neutral`) */
6523
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'neutral'
6524
+ /** The plan it's compared with (MGantt's `baselines`) */
6525
+ baselineStart?: string
6526
+ baselineEnd?: string
6527
+ /** `false` keeps it from being moved, resized, linked, deleted or selected */
6528
+ draggable?: boolean
6529
+ resizable?: boolean
6530
+ linkable?: boolean
6531
+ deletable?: boolean
6532
+ selectable?: boolean
6533
+ class?: string
6534
+ data?: D
6535
+ }
6536
+ ```
4321
6537
 
4322
6538
  ```ts
4323
- randomEmoji(from?: string[]): string
6539
+ /** A predecessor of a task: finish-to-start (default), start-to-start, finish-to-finish or start-to-finish */
6540
+ export interface GanttDependency {
6541
+ /** The predecessor's id */
6542
+ id: string
6543
+ type?: 'FS' | 'SS' | 'FF' | 'SF'
6544
+ /** Days between them (negative overlaps them); working days with a calendar */
6545
+ lag?: number
6546
+ }
4324
6547
  ```
4325
6548
 
4326
- ### withSkinTone
6549
+ ```ts
6550
+ /** Which days are worked: weekdays (0 Sunday … 6 Saturday, default Monday to Friday) and holidays (`YYYY-MM-DD`) */
6551
+ export interface GanttCalendar {
6552
+ workingDays?: number[]
6553
+ holidays?: string[]
6554
+ }
6555
+ ```
4327
6556
 
4328
- `emoji` with skin tone `tone` (0 = none, 1–5 = light to dark), if it takes one.
6557
+ ```ts
6558
+ export interface GanttScheduleOptions {
6559
+ /** `'push'` (default) moves tasks only as late as their dependencies need; `'asap'` also pulls them back to the earliest they can start */
6560
+ mode?: 'push' | 'asap'
6561
+ /** Count durations and lags in working days (date-only tasks), starting on working days */
6562
+ calendar?: GanttCalendar
6563
+ }
6564
+ ```
4329
6565
 
4330
6566
  ```ts
4331
- withSkinTone(emoji: string, tone: number): string
6567
+ export interface GanttCriticalPath {
6568
+ /** Tasks with no slack (and summaries holding one) */
6569
+ tasks: string[]
6570
+ /** Dependencies on the path, as `'<predecessor>><successor>'` */
6571
+ dependencies: string[]
6572
+ /** Each task's total slack in days: how late it can finish without delaying the end */
6573
+ slack: Record<string, number>
6574
+ /** When the last task ends */
6575
+ finish: string
6576
+ }
4332
6577
  ```
4333
6578
 
4334
- ### toneableEmojis
6579
+ ```ts
6580
+ // ── CSV ───────────────────────────────────────────────────────────────────────────────────────────────────
4335
6581
 
4336
- Emoji that take a skin tone (all five one-tone variants exist).
6582
+ export interface GanttCsvOptions {
6583
+ /** Field separator (default `,`; reading, `;` and tabs are detected) */
6584
+ separator?: string
6585
+ }
6586
+ ```
4337
6587
 
4338
6588
  ```ts
4339
- toneableEmojis: Set<string>
6589
+ export interface GanttXmlOptions {
6590
+ /** The project's name */
6591
+ name?: string
6592
+ /** Working hours a date-only task's days run, for Project's datetimes (default 8 to 17) */
6593
+ dayStart?: number
6594
+ dayEnd?: number
6595
+ }
4340
6596
  ```
4341
6597
 
4342
- ### skinTones
4343
-
4344
- The five Fitzpatrick modifiers, light to dark.
4345
-
4346
6598
  ```ts
4347
- skinTones: readonly ["🏻", "🏼", "🏽", "🏾", "🏿"]
6599
+ /** A booking on a resource's row: a shift, a reservation, a job */
6600
+ export interface TimelineEvent<D = any> {
6601
+ id: string
6602
+ /** The resource (row) it's on */
6603
+ resourceId: string
6604
+ /** A datetime (`YYYY-MM-DDTHH:mm`, local, or ISO with a zone), or `YYYY-MM-DD` for whole days */
6605
+ start: string
6606
+ /** A datetime is when it ends; a date is the last day (inclusive) */
6607
+ end: string
6608
+ title: string
6609
+ subtitle?: string
6610
+ /** An M3 role (default the resource's, else `primary`) */
6611
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'neutral'
6612
+ /** `false` keeps it from being moved (in time or to another resource), resized, deleted or selected */
6613
+ draggable?: boolean
6614
+ resizable?: boolean
6615
+ deletable?: boolean
6616
+ selectable?: boolean
6617
+ class?: string
6618
+ data?: D
6619
+ }
4348
6620
  ```
4349
6621
 
4350
- ## Types
6622
+ ```ts
6623
+ /** A row: a person, a table, a room, a machine */
6624
+ export interface TimelineResource<D = any> {
6625
+ id: string
6626
+ name: string
6627
+ subtitle?: string
6628
+ /** Rows with the same group sit under a header that folds */
6629
+ group?: string
6630
+ /** A picture; else `icon`, else initials */
6631
+ avatar?: string
6632
+ icon?: string
6633
+ color?: TimelineEvent['color']
6634
+ /** Bookings it can hold at once before they conflict (default 1) */
6635
+ capacity?: number
6636
+ data?: D
6637
+ }
6638
+ ```
4351
6639
 
4352
6640
  ```ts
4353
- /** What `MMap` provides to everything inside it. */
4354
- export interface MapContext {
4355
- /** The MapLibre map, once created (never on the server) */
4356
- map: ShallowRef<Maplibre.Map | undefined>
4357
- /** The `maplibre-gl` module, loaded with the map (so nothing imports it on the server) */
4358
- maplibre: ShallowRef<MaplibreModule | undefined>
4359
- /** Bumped on every `style.load`: sources and layers added by components are re-added after a style change */
4360
- styleVersion: Ref<number>
4361
- /** The style as `MMap`'s `adapter` reads it (undefined without one) */
4362
- model: ShallowRef<MapLayerModel | undefined>
4363
- /** Visibility and opacity of the model's layers */
4364
- layerState: MapLayerState
4365
- /**
4366
- * The tool that owns the map's clicks right now (`'measure'` while measuring), or null: `MMapIdentify` stays quiet
4367
- * meanwhile. Set it from tools of your own the same way
4368
- */
4369
- activeTool: Ref<string | null>
6641
+ /** What MResourceTimeline provides to components in its default slot, and its template ref exposes */
6642
+ export interface ResourceTimelineContext {
6643
+ events: ComputedRef<TimelineEvent[]>
6644
+ selection: ComputedRef<string[]>
6645
+ /** Ids of events that overlap more than their resource's capacity */
6646
+ conflicts: ComputedRef<Set<string>>
6647
+ scale: ComputedRef<GanttScale>
6648
+ pxPerDay: Readonly<Ref<number>>
6649
+ canUndo: ComputedRef<boolean>
6650
+ canRedo: ComputedRef<boolean>
6651
+ undo(): void
6652
+ redo(): void
6653
+ zoomIn(): void
6654
+ zoomOut(): void
6655
+ setScale(scale: GanttScale): void
6656
+ scrollToDate(date?: string, opts?: { align?: 'start' | 'center'; animate?: boolean }): void
6657
+ scrollToEvent(id: string): void
6658
+ setSelection(ids: string[]): void
6659
+ addEvents(events: TimelineEvent | TimelineEvent[]): void
6660
+ updateEvent(id: string, patch: Partial<TimelineEvent> | ((e: TimelineEvent) => TimelineEvent)): void
6661
+ removeEvents(ids: string[]): void
6662
+ /** The time (snapped, as a datetime) under a page x */
6663
+ dateAt(clientX: number): string
6664
+ /** The resource whose row is under a page y */
6665
+ resourceAt(clientY: number): TimelineResource | undefined
4370
6666
  }
4371
6667
  ```
4372
6668
 
4373
6669
  ```ts
4374
- /**
4375
- * A map to use from outside `<MMap>`: the `MMap` itself (a template ref: `<MMap ref="map">` → `:map="map"`) or its
4376
- * `context`. Null or undefined until it mounts.
4377
- */
4378
- export type MapSource = { context: MapContext } | MapContext | null | undefined
6670
+ /** What MGanttControls drives, in an MGantt or an MResourceTimeline */
6671
+ export interface TimelineControls {
6672
+ scale: ComputedRef<GanttScale>
6673
+ readonly: ComputedRef<boolean>
6674
+ canUndo: ComputedRef<boolean>
6675
+ canRedo: ComputedRef<boolean>
6676
+ /** Whether anything can fold (summaries, resource groups) and whether something is folded */
6677
+ foldable: ComputedRef<boolean>
6678
+ folded: ComputedRef<boolean>
6679
+ undo(): void
6680
+ redo(): void
6681
+ zoomIn(): void
6682
+ zoomOut(): void
6683
+ setScale(scale: GanttScale): void
6684
+ scrollToDate(date?: string): void
6685
+ expandAll(): void
6686
+ collapseAll(): void
6687
+ }
4379
6688
  ```
4380
6689
 
4381
6690
  ```ts
4382
- /** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
4383
- export type MaplibreModule = typeof import('maplibre-gl')
6691
+ /** What a pointer does on an MDrawCanvas */
6692
+ export type DrawTool = DrawPen | 'eraser' | 'stroke-eraser' | DrawShapeKind | 'text' | 'select' | 'pan'
6693
+ ```
6694
+
6695
+ ```ts
6696
+ /** What an MDrawCanvas shares with MDrawToolbar, MDrawLayers and anything built with useDrawing() inside it */
6697
+ export interface DrawContext {
6698
+ tool: Ref<DrawTool>
6699
+ color: Ref<string>
6700
+ size: Ref<number>
6701
+ /** New rects and ellipses are filled with the color */
6702
+ fill: Ref<boolean>
6703
+ items: ComputedRef<DrawItem[]>
6704
+ selection: Ref<string[]>
6705
+ layers: ComputedRef<DrawLayer[]>
6706
+ setLayers(layers: DrawLayer[]): void
6707
+ /** The layer new items go on */
6708
+ layer: Ref<string | undefined>
6709
+ mode: ComputedRef<'infinite' | 'pages'>
6710
+ pages: Ref<number>
6711
+ addPage(): void
6712
+ zoom: ComputedRef<number>
6713
+ zoomIn(): void
6714
+ zoomOut(): void
6715
+ fitView(): void
6716
+ canUndo: ComputedRef<boolean>
6717
+ canRedo: ComputedRef<boolean>
6718
+ undo(): void
6719
+ redo(): void
6720
+ clear(): void
6721
+ deleteSelection(): void
6722
+ exportSvg(opts?: DrawExportOptions): string
6723
+ exportPng(opts?: DrawExportOptions): Promise<Blob>
6724
+ }
4384
6725
  ```
4385
6726
 
4386
6727
  ```ts
4387
- /** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
4388
- export interface MapLayerState {
4389
- visible: Record<string, boolean>
4390
- opacity: Record<string, number>
6728
+ export interface DrawExportOptions {
6729
+ /** In `mode="pages"`: the page to export (default 0) */
6730
+ page?: number
6731
+ /** PNG: pixels per drawing unit (default 2) */
6732
+ scale?: number
6733
+ /** Paint the paper color behind the drawing (default true) */
6734
+ background?: boolean
4391
6735
  }
4392
6736
  ```
4393
6737
 
4394
6738
  ```ts
4395
- /** Reads a style's conventions (usually its `metadata`) into the model the map's UI components use. */
4396
- export type MapAdapter = (style: Maplibre.StyleSpecification, context: MapAdapterContext) => MapLayerModel
6739
+ export type DrawItem = DrawStroke | DrawShape | DrawText
4397
6740
  ```
4398
6741
 
4399
6742
  ```ts
4400
- /** What an adapter gets besides the style. */
4401
- export interface MapAdapterContext {
4402
- /** The style's URL, when `MMap`'s `mapStyle` is one */
4403
- styleUrl?: string
6743
+ export interface DrawStroke extends DrawItemBase {
6744
+ type: 'stroke'
6745
+ pen: DrawPen
6746
+ /** Width at full pressure, in drawing units */
6747
+ size: number
6748
+ points: DrawPoint[]
4404
6749
  }
4405
6750
  ```
4406
6751
 
4407
6752
  ```ts
4408
- /** How to show one property of a feature. */
4409
- export interface MapFieldFormat {
4410
- /** The label (the key, capitalized, by default) */
4411
- label?: string
4412
- /** Text before the value */
4413
- prefix?: string
4414
- /** Text after the value */
4415
- suffix?: string
4416
- /** A number mask: its decimals set the fraction digits (`#.00` → 2) and a comma turns on grouping (`#,###`) */
4417
- mask?: string
4418
- /** Leave it out */
4419
- hidden?: boolean
6753
+ export interface DrawShape extends DrawItemBase {
6754
+ type: 'shape'
6755
+ shape: DrawShapeKind
6756
+ from: [number, number]
6757
+ to: [number, number]
6758
+ size: number
6759
+ /** Fill of a rect or an ellipse (`null`/absent: none) */
6760
+ fill?: string | null
4420
6761
  }
4421
6762
  ```
4422
6763
 
4423
6764
  ```ts
4424
- /** What `MMapIdentify` found on one layer at a point. */
4425
- export interface MapIdentifyResult {
4426
- layer: MapLayerInfo
4427
- feature: Maplibre.MapGeoJSONFeature
4428
- /** Its properties as the layer's `identify` shows them, formatted */
4429
- fields: { key: string; label: string; value: string }[]
6765
+ export interface DrawText extends DrawItemBase {
6766
+ type: 'text'
6767
+ /** Top-left corner */
6768
+ at: [number, number]
6769
+ text: string
6770
+ /** Font size */
6771
+ size: number
4430
6772
  }
4431
6773
  ```
4432
6774
 
4433
6775
  ```ts
4434
- /** One layer of the style, as the map's UI components see it. */
4435
- export interface MapLayerInfo {
4436
- /** The style layer's id */
6776
+ export interface DrawLayer {
4437
6777
  id: string
4438
- /** Its name in the UI */
4439
- title: string
4440
- description?: string
4441
- /** The `name` of its group in `MapLayerModel.groups` */
4442
- group?: string
4443
- /** Shown in `MMapLayers` */
4444
- listed: boolean
4445
- /** A base layer: `MMapBaseLayers` shows one of them at a time, with this thumbnail */
4446
- base?: { image?: string }
4447
- /** Layer ids shown, hidden and faded along with it */
4448
- children: string[]
4449
- /** Listed by `MMapIdentify` on click: every property, formatted by `format`, minus `exclude` */
4450
- identify: false | { format: Record<string, MapFieldFormat>; exclude: string[] }
4451
- /** Shown by `MMapHover` under the pointer: these properties, in order */
4452
- hover: false | { fields: (MapFieldFormat & { key: string })[] }
4453
- /** A legend image URL (an SVG, typically) */
4454
- legend?: string
4455
- /** A download URL for its data */
4456
- download?: string
6778
+ name: string
6779
+ visible?: boolean
6780
+ locked?: boolean
4457
6781
  }
4458
6782
  ```
4459
6783
 
4460
6784
  ```ts
4461
- /** The style as the map's UI components see it: layers with names, groups, base layers, what to identify. */
4462
- export interface MapLayerModel {
4463
- /** The style's name */
4464
- title?: string
4465
- /** Groups, in order */
4466
- groups: { name: string; title: string }[]
4467
- /** Layers, in the style's order (bottom to top) */
4468
- layers: MapLayerInfo[]
4469
- }
6785
+ // The Drawing family's data and geometry: strokes with pressure turned into filled outlines, shapes, text, hit tests,
6786
+ // the stroke-cutting eraser, moving and scaling, and SVG export. Pure functions, no Vue, so they work on the server
6787
+ // and in tests, and an app can render or process a drawing without the canvas.
6788
+
6789
+ /** A point of a stroke: x, y, and the pressure (0–1) */
6790
+ export type DrawPoint = [x: number, y: number, pressure: number]
4470
6791
  ```
4471
6792
 
4472
6793
  ```ts
4473
- export interface OrvianAdapterOptions {
4474
- /**
4475
- * A layer's legend image. By default, for a style served by mvt-rs (`…/services/styles/<style>`), its legend service
4476
- * (`…/services/legends/<style>?layer_id=<id>`), unless the layer's `metadata.legend.show` is false;
4477
- * `metadata.legend.wmslegend` overrides it
4478
- */
4479
- legend?: (layer: Maplibre.LayerSpecification, styleUrl?: string) => string | undefined
4480
- }
6794
+ export type DrawPen = 'pen' | 'brush' | 'marker' | 'highlighter'
4481
6795
  ```
4482
6796
 
4483
6797
  ```ts
4484
- /** Finds places for `MMapSearch`: the text in, results out. `signal` aborts a search the user replaced. */
4485
- export type MapSearchProvider = (query: string, signal: AbortSignal) => Promise<MapSearchResult[]>
6798
+ export type DrawShapeKind = 'line' | 'arrow' | 'rect' | 'ellipse'
4486
6799
  ```
4487
6800
 
4488
6801
  ```ts
4489
- /** A place found by a `MapSearchProvider`. */
4490
- export interface MapSearchResult {
4491
- /** What to show */
4492
- label: string
4493
- /** Where it is */
4494
- lngLat: [number, number]
4495
- /** Its extent, `[west, south, east, north]`: the map fits it instead of zooming to the point */
4496
- bbox?: [number, number, number, number]
4497
- /** Its kind (`city`, `road`, `park`, `restaurant`…), for the icon */
4498
- type?: string
4499
- }
6802
+ export interface DrawBox { x: number; y: number; width: number; height: number }
4500
6803
  ```
4501
6804
 
4502
6805
  ```ts
4503
- export interface NominatimOptions {
4504
- /** The Nominatim server (`https://nominatim.openstreetmap.org` by default; mind its usage policy, or run your own) */
4505
- url?: string
4506
- /** How many results (6) */
4507
- limit?: number
4508
- /** The results' language (`es`, `en`…); by default the page's (`<html lang>`) */
4509
- language?: string
4510
- /** Only these countries (ISO codes: `['ar']`) */
4511
- countryCodes?: string[]
4512
- /** Prefer (or with `bounded`, only) this area: `[west, south, east, north]` */
4513
- viewbox?: [number, number, number, number]
4514
- bounded?: boolean
6806
+ export interface DrawSvgOptions {
6807
+ /** The area to export (default: the items' bounds plus `padding`) */
6808
+ box?: DrawBox
6809
+ padding?: number
6810
+ /** A background fill (default: none, transparent) */
6811
+ background?: string
6812
+ /** Only the items of this page */
6813
+ page?: number
6814
+ /** Leave out these layers (hidden ones, say) */
6815
+ hiddenLayers?: string[]
6816
+ /** The layers' order, bottom first (items of other layers go first) */
6817
+ layers?: string[]
6818
+ fontFamily?: string
4515
6819
  }
4516
6820
  ```
4517
6821
 
@@ -4571,6 +6875,14 @@ export interface M3UIOptions {
4571
6875
  * and render with the user's choice and for their screen through `initialState`.
4572
6876
  */
4573
6877
  cookies?: boolean
6878
+ /**
6879
+ * A prefix for every key the library stores in localStorage and cookies (`'admin'` → `admin-m3-theme`,
6880
+ * `admin-m3-palette`…), so apps served from the same origin under different paths (`example.com/admin`,
6881
+ * `example.com/shop`) each keep their own theme, palette, contrast and recent colors/emoji instead of sharing them.
6882
+ * Letters, digits, `-` and `_` (it's also part of the cookie names). Pass the same one to `themeInitScript()` and
6883
+ * `viewportFromHeaders()` when you use them.
6884
+ */
6885
+ storagePrefix?: string
4574
6886
  /**
4575
6887
  * Server-side rendering: the user's theme, palette and contrast as the server knows them (from the cookies that
4576
6888
  * `cookies` writes), on the server and on the client alike. `useTheme()` and `useColorPalette()` report them on
@@ -4616,12 +6928,76 @@ export interface ConfettiOptions {
4616
6928
  velocity?: number
4617
6929
  /** Piece size in px (default 14) */
4618
6930
  size?: number
6931
+ /**
6932
+ * Keep it going for this long, in ms: a rain that keeps falling (`from: 'top'`) or a fountain from the point,
6933
+ * `count` then being pieces per second. `Infinity` runs until the returned `stop()`. Unset: one burst
6934
+ */
6935
+ duration?: number
4619
6936
  }
4620
6937
  ```
4621
6938
 
4622
6939
  ```ts
4623
6940
  /** Where a burst starts: the pointer of an event, an element's center, or a point in viewport pixels */
4624
- export type ConfettiOrigin = MouseEvent | PointerEvent | Element | { x: number; y: number }
6941
+ export type ConfettiOrigin = EffectOrigin
6942
+ ```
6943
+
6944
+ ```ts
6945
+ /** Stops a running confetti before its `duration` ends; the pieces already out finish falling. */
6946
+ export type StopConfetti = () => void
6947
+ ```
6948
+
6949
+ ```ts
6950
+ /** A burst's look: `'classic'`, or an MShape's name its sparks are laid out along. */
6951
+ export type FireworkShape = 'classic' | ShapeName
6952
+ ```
6953
+
6954
+ ```ts
6955
+ export interface FireworksOptions {
6956
+ /** How many rockets (default 6, launched over about a second and a half); with `duration`, rockets per second */
6957
+ count?: number
6958
+ /**
6959
+ * What the bursts look like, one picked per burst: `'classic'` (sparks thrown out from the center that fall as they
6960
+ * fade) or an MShape's name the sparks are laid out along (`'Circle'` is a ring). Default: mostly classic, with a
6961
+ * ring, a heart, a flower… now and then
6962
+ */
6963
+ shapes?: FireworkShape[]
6964
+ /** Any CSS colors. Default: the theme's primary, secondary and tertiary roles and their containers */
6965
+ colors?: string[]
6966
+ /** Burst radius in px. Default: a sixth of the screen's smaller side, between 70 and 180 */
6967
+ size?: number
6968
+ /** Keep launching for this long, in ms (`count` then being rockets per second); `Infinity` runs until `stop()` */
6969
+ duration?: number
6970
+ }
6971
+ ```
6972
+
6973
+ ```ts
6974
+ /** Stops launching before `duration` ends; what's already in the air finishes. */
6975
+ export type StopFireworks = () => void
6976
+ ```
6977
+
6978
+ ```ts
6979
+ /** What floats up: any text (an emoji, `'+1'`), or a Material Symbol (`{ icon: 'favorite' }`, filled by default). */
6980
+ export type ReactionContent = string | { icon: string; filled?: boolean; color?: string }
6981
+ ```
6982
+
6983
+ ```ts
6984
+ export interface ReactionOptions {
6985
+ /** How many float up together, a little apart (default 1) */
6986
+ count?: number
6987
+ /** Size in px (default 32) */
6988
+ size?: number
6989
+ /** How far it rises, in px (default 260) */
6990
+ distance?: number
6991
+ /** How long it floats, in ms (default 2200) */
6992
+ duration?: number
6993
+ /** How far it sways to each side, in px (default 20) */
6994
+ sway?: number
6995
+ }
6996
+ ```
6997
+
6998
+ ```ts
6999
+ /** Where a reaction starts: the pointer of an event, an element's center, or a point in viewport pixels */
7000
+ export type ReactionOrigin = EffectOrigin
4625
7001
  ```
4626
7002
 
4627
7003
  ```ts
@@ -4685,6 +7061,8 @@ export interface ThemeInitOptions {
4685
7061
  contrast?: ContrastLevel
4686
7062
  /** `createM3UI`'s `persistPalette`. */
4687
7063
  persistPalette?: boolean
7064
+ /** `createM3UI`'s `storagePrefix`. */
7065
+ storagePrefix?: string
4688
7066
  }
4689
7067
  ```
4690
7068
 
@@ -5013,6 +7391,171 @@ export interface M3Locale {
5013
7391
  /** MTimeline's button past `limit`; `{count}` is how many entries are hidden */
5014
7392
  timelineShowMore: string
5015
7393
  timelineShowLess: string
7394
+ // Media players (MVideoPlayer, MAudioPlayer); `{seconds}` is the skip length
7395
+ mediaPlayer: string
7396
+ mediaPlay: string
7397
+ mediaPause: string
7398
+ mediaReplay: string
7399
+ mediaSeekBack: string
7400
+ mediaSeekForward: string
7401
+ mediaSeconds: string
7402
+ mediaMute: string
7403
+ mediaUnmute: string
7404
+ mediaVolume: string
7405
+ mediaFullscreen: string
7406
+ mediaExitFullscreen: string
7407
+ mediaPictureInPicture: string
7408
+ mediaSettings: string
7409
+ mediaSpeed: string
7410
+ mediaSpeedNormal: string
7411
+ mediaSubtitles: string
7412
+ mediaSubtitlesOff: string
7413
+ mediaQuality: string
7414
+ mediaQualityAuto: string
7415
+ mediaLive: string
7416
+ mediaError: string
7417
+ mediaRepeat: string
7418
+ mediaRepeatOne: string
7419
+ mediaShuffle: string
7420
+ // MPdfViewer; `{current}`/`{total}` count search matches
7421
+ pdfViewer: string
7422
+ pdfThumbnails: string
7423
+ pdfOutline: string
7424
+ pdfPage: string
7425
+ pdfZoom: string
7426
+ pdfZoomIn: string
7427
+ pdfZoomOut: string
7428
+ pdfFitWidth: string
7429
+ pdfFitPage: string
7430
+ pdfSearch: string
7431
+ pdfSearchPrevious: string
7432
+ pdfSearchNext: string
7433
+ pdfMatchCount: string
7434
+ pdfNoMatches: string
7435
+ pdfMore: string
7436
+ pdfRotate: string
7437
+ pdfDownload: string
7438
+ pdfPrint: string
7439
+ pdfFullscreen: string
7440
+ pdfExitFullscreen: string
7441
+ pdfPassword: string
7442
+ pdfPasswordLabel: string
7443
+ pdfWrongPassword: string
7444
+ pdfOpen: string
7445
+ pdfError: string
7446
+ pdfLoading: string
7447
+ pdfAnnotate: string
7448
+ pdfSelect: string
7449
+ pdfHighlight: string
7450
+ pdfNote: string
7451
+ pdfDraw: string
7452
+ pdfEraser: string
7453
+ pdfInkWidth: string
7454
+ pdfColor: string
7455
+ pdfUndo: string
7456
+ pdfCopy: string
7457
+ pdfDelete: string
7458
+ pdfNotePlaceholder: string
7459
+ pdfAddComment: string
7460
+ flowCanvas: string
7461
+ flowNode: string
7462
+ flowEdge: string
7463
+ flowZoomIn: string
7464
+ flowZoomOut: string
7465
+ flowFitView: string
7466
+ flowLock: string
7467
+ flowUnlock: string
7468
+ flowUndo: string
7469
+ flowRedo: string
7470
+ flowMinimap: string
7471
+ flowMoved: string
7472
+ flowConnected: string
7473
+ flowDeleted: string
7474
+ flowDeleteEdge: string
7475
+ flowDelete: string
7476
+ ganttChart: string
7477
+ ganttTask: string
7478
+ ganttStart: string
7479
+ ganttEnd: string
7480
+ ganttDuration: string
7481
+ ganttProgress: string
7482
+ ganttDays: string
7483
+ ganttHours: string
7484
+ ganttMilestone: string
7485
+ ganttQuarter: string
7486
+ ganttToday: string
7487
+ ganttZoomIn: string
7488
+ ganttZoomOut: string
7489
+ ganttExpandAll: string
7490
+ ganttCollapseAll: string
7491
+ ganttExpand: string
7492
+ ganttCollapse: string
7493
+ ganttUndo: string
7494
+ ganttRedo: string
7495
+ ganttScaleHour: string
7496
+ ganttScaleDay: string
7497
+ ganttScaleWeek: string
7498
+ ganttScaleMonth: string
7499
+ ganttScaleQuarter: string
7500
+ ganttScaleYear: string
7501
+ ganttMoved: string
7502
+ ganttProgressSet: string
7503
+ ganttLinked: string
7504
+ ganttUnlink: string
7505
+ ganttDeleted: string
7506
+ ganttDelete: string
7507
+ ganttReordered: string
7508
+ ganttSlack: string
7509
+ ganttCritical: string
7510
+ ganttBaseline: string
7511
+ ganttEmpty: string
7512
+ ganttResize: string
7513
+ timelineResource: string
7514
+ timelineConflict: string
7515
+ timelineMoved: string
7516
+ timelineEmpty: string
7517
+ cropArea: string
7518
+ cropRotateLeft: string
7519
+ cropRotateRight: string
7520
+ cropFlip: string
7521
+ cropReset: string
7522
+ cropFree: string
7523
+ drawCanvas: string
7524
+ drawTools: string
7525
+ drawMore: string
7526
+ drawSelect: string
7527
+ drawPan: string
7528
+ drawPen: string
7529
+ drawBrush: string
7530
+ drawMarker: string
7531
+ drawHighlighter: string
7532
+ drawEraser: string
7533
+ drawStrokeEraser: string
7534
+ drawLine: string
7535
+ drawArrow: string
7536
+ drawRect: string
7537
+ drawEllipse: string
7538
+ drawText: string
7539
+ drawFill: string
7540
+ drawColor: string
7541
+ floorPlan: string
7542
+ floorSeats: string
7543
+ drawCustomColor: string
7544
+ drawSize: string
7545
+ drawUndo: string
7546
+ drawRedo: string
7547
+ drawDelete: string
7548
+ drawLayers: string
7549
+ drawLayer: string
7550
+ drawLayerName: string
7551
+ drawAddLayer: string
7552
+ drawDeleteLayer: string
7553
+ drawShowLayer: string
7554
+ drawHideLayer: string
7555
+ drawLockLayer: string
7556
+ drawUnlockLayer: string
7557
+ drawLayerUp: string
7558
+ drawLayerDown: string
5016
7559
  }
5017
7560
  ```
5018
7561
 
@@ -5344,6 +7887,29 @@ export interface SkeletonOptions {
5344
7887
  export type SkeletonValue = boolean | SkeletonOptions | null | undefined
5345
7888
  ```
5346
7889
 
7890
+ ```ts
7891
+ /** Options for `v-sparkle`. */
7892
+ export interface SparkleOptions {
7893
+ /** No sparkles while true */
7894
+ disabled?: boolean
7895
+ /** `'always'` (default) sparkles all the time; `'hover'` only while the pointer is over it or focus is in it */
7896
+ trigger?: 'always' | 'hover'
7897
+ /** Any CSS colors, one picked per sparkle. Default: the theme's primary and tertiary where the element is */
7898
+ color?: string | string[]
7899
+ /** Sparkle size in px, each one a bit bigger or smaller (default 14) */
7900
+ size?: number
7901
+ /** Sparkles per second (default 3) */
7902
+ rate?: number
7903
+ /** MShape's shapes instead of the four-pointed star */
7904
+ shapes?: ShapeName[]
7905
+ }
7906
+ ```
7907
+
7908
+ ```ts
7909
+ /** `v-sparkle` value: nothing or `true` (on), `false` (off), `'hover'`, a CSS color, or an options object. */
7910
+ export type SparkleValue = boolean | string | SparkleOptions | null | undefined
7911
+ ```
7912
+
5347
7913
  ```ts
5348
7914
  // Generated by scripts/generate-emoji-data.mjs from Unicode emoji-test.txt (Emoji 15). Don't edit by hand.
5349
7915
  // Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
@@ -5362,7 +7928,7 @@ export interface EmojiCategory {
5362
7928
  `M3Locale` keys (pass a partial object to `createM3UI({ locale })`; presets from `@m3ui-vue/m3ui-vue/locales`:
5363
7929
  `esLocale`, `frLocale`, `ptLocale`, `deLocale`, `jaLocale`, `zhLocale`, `koLocale`):
5364
7930
 
5365
- lang, search, noResults, close, cancel, confirm, loading, menu, previous, next, today, more, selectedCount, recordCount, expand, collapse, clear, columns, exportCsv, noGroup, finish, dropText, selectText, maxSizePrefix, remove, selectDate, ok, dateToggleInput, dateToggleCalendar, dateInputLabel, selectTime, timeHourSelection, timeMinuteSelection, timePeriodToggle, timeToggleKeyboard, timeToggleDial, timeToggleScroll, sheetExpand, sheetCollapse, sheetDismiss, seekBar, seekBarValue, seekBarShowRemaining, seekBarShowDuration, selectRange, pickStart, pickEnd, previousMonth, nextMonth, selectColor, colorHue, colorSaturation, colorBrightness, colorAlpha, colorEyedropper, colorOriginal, colorFormat, colorRecent, colorPresets, dayView, weekView, allDay, emojiSearch, emojiNoResults, emojiRecent, emojiSkinTone, emojiSkinTones, emojiCategorySmileys, emojiCategoryGestures, emojiCategoryPeople, emojiCategoryAnimals, emojiCategoryNature, emojiCategoryFood, emojiCategoryActivities, emojiCategoryTravel, emojiCategoryObjects, emojiCategorySymbols, emojiCategoryFlags, available, selected, noItems, moveAllRight, moveRight, moveLeft, moveAllLeft, searchCommand, navigateHint, selectHint, openHint, closeHint, loadingMore, noMoreItems, bold, italic, underline, strikethrough, highlight, bulletList, orderedList, blockquote, code, alignLeft, alignCenter, alignRight, undo, redo, link, image, paragraph, heading1, heading2, heading3, insertLink, insertImage, imageUrlLabel, insert, jsonValid, jsonInvalid, jsonFormat, jsonMinify, jsonElements, jsonFields, resultSuccessTitle, resultSuccessDesc, resultErrorTitle, resultErrorDesc, resultWarningTitle, resultWarningDesc, resultInfoTitle, resultInfoDesc, result404Title, result404Desc, result403Title, result403Desc, result500Title, result500Desc, chatTyping, chatRecordingAudio, reorderHandle, reorderGrabbed, reorderMoved, reorderDropped, reorderCancelled, selectAll, clearSearch, kanbanMoved, windowMinimize, windowMaximize, windowRestore, paginationRange, paginationPage, previousPage, nextPage, carousel, carouselItem, sparklineSummary, sliderRangeStart, sliderRangeEnd, mapTitle, mapMarker, mapZoomIn, mapZoomOut, mapResetBearing, mapFindMyLocation, mapLocationNotAvailable, mapEnterFullscreen, mapExitFullscreen, mapToggleAttribution, mapFeedback, mapCtrlScroll, mapCmdScroll, mapTwoFingers, mapLayers, mapSearchLayers, mapNoLayers, mapShowLayer, mapHideLayer, mapOpacity, mapDownload, mapNoBaseLayer, mapHoverInfo, mapNoValue, mapMeasureDistance, mapMeasureArea, mapClearMeasurements, mapDeleteMeasurement, mapTotal, mapSearchPlaces, timelineShowMore, timelineShowLess
7931
+ lang, search, noResults, close, cancel, confirm, loading, menu, previous, next, today, more, selectedCount, recordCount, expand, collapse, clear, columns, exportCsv, noGroup, finish, dropText, selectText, maxSizePrefix, remove, selectDate, ok, dateToggleInput, dateToggleCalendar, dateInputLabel, selectTime, timeHourSelection, timeMinuteSelection, timePeriodToggle, timeToggleKeyboard, timeToggleDial, timeToggleScroll, sheetExpand, sheetCollapse, sheetDismiss, seekBar, seekBarValue, seekBarShowRemaining, seekBarShowDuration, selectRange, pickStart, pickEnd, previousMonth, nextMonth, selectColor, colorHue, colorSaturation, colorBrightness, colorAlpha, colorEyedropper, colorOriginal, colorFormat, colorRecent, colorPresets, dayView, weekView, allDay, emojiSearch, emojiNoResults, emojiRecent, emojiSkinTone, emojiSkinTones, emojiCategorySmileys, emojiCategoryGestures, emojiCategoryPeople, emojiCategoryAnimals, emojiCategoryNature, emojiCategoryFood, emojiCategoryActivities, emojiCategoryTravel, emojiCategoryObjects, emojiCategorySymbols, emojiCategoryFlags, available, selected, noItems, moveAllRight, moveRight, moveLeft, moveAllLeft, searchCommand, navigateHint, selectHint, openHint, closeHint, loadingMore, noMoreItems, bold, italic, underline, strikethrough, highlight, bulletList, orderedList, blockquote, code, alignLeft, alignCenter, alignRight, undo, redo, link, image, paragraph, heading1, heading2, heading3, insertLink, insertImage, imageUrlLabel, insert, jsonValid, jsonInvalid, jsonFormat, jsonMinify, jsonElements, jsonFields, resultSuccessTitle, resultSuccessDesc, resultErrorTitle, resultErrorDesc, resultWarningTitle, resultWarningDesc, resultInfoTitle, resultInfoDesc, result404Title, result404Desc, result403Title, result403Desc, result500Title, result500Desc, chatTyping, chatRecordingAudio, reorderHandle, reorderGrabbed, reorderMoved, reorderDropped, reorderCancelled, selectAll, clearSearch, kanbanMoved, windowMinimize, windowMaximize, windowRestore, paginationRange, paginationPage, previousPage, nextPage, carousel, carouselItem, sparklineSummary, sliderRangeStart, sliderRangeEnd, mapTitle, mapMarker, mapZoomIn, mapZoomOut, mapResetBearing, mapFindMyLocation, mapLocationNotAvailable, mapEnterFullscreen, mapExitFullscreen, mapToggleAttribution, mapFeedback, mapCtrlScroll, mapCmdScroll, mapTwoFingers, mapLayers, mapSearchLayers, mapNoLayers, mapShowLayer, mapHideLayer, mapOpacity, mapDownload, mapNoBaseLayer, mapHoverInfo, mapNoValue, mapMeasureDistance, mapMeasureArea, mapClearMeasurements, mapDeleteMeasurement, mapTotal, mapSearchPlaces, timelineShowMore, timelineShowLess, mediaPlayer, mediaPlay, mediaPause, mediaReplay, mediaSeekBack, mediaSeekForward, mediaSeconds, mediaMute, mediaUnmute, mediaVolume, mediaFullscreen, mediaExitFullscreen, mediaPictureInPicture, mediaSettings, mediaSpeed, mediaSpeedNormal, mediaSubtitles, mediaSubtitlesOff, mediaQuality, mediaQualityAuto, mediaLive, mediaError, mediaRepeat, mediaRepeatOne, mediaShuffle, pdfViewer, pdfThumbnails, pdfOutline, pdfPage, pdfZoom, pdfZoomIn, pdfZoomOut, pdfFitWidth, pdfFitPage, pdfSearch, pdfSearchPrevious, pdfSearchNext, pdfMatchCount, pdfNoMatches, pdfMore, pdfRotate, pdfDownload, pdfPrint, pdfFullscreen, pdfExitFullscreen, pdfPassword, pdfPasswordLabel, pdfWrongPassword, pdfOpen, pdfError, pdfLoading, pdfAnnotate, pdfSelect, pdfHighlight, pdfNote, pdfDraw, pdfEraser, pdfInkWidth, pdfColor, pdfUndo, pdfCopy, pdfDelete, pdfNotePlaceholder, pdfAddComment, flowCanvas, flowNode, flowEdge, flowZoomIn, flowZoomOut, flowFitView, flowLock, flowUnlock, flowUndo, flowRedo, flowMinimap, flowMoved, flowConnected, flowDeleted, flowDeleteEdge, flowDelete, ganttChart, ganttTask, ganttStart, ganttEnd, ganttDuration, ganttProgress, ganttDays, ganttHours, ganttMilestone, ganttQuarter, ganttToday, ganttZoomIn, ganttZoomOut, ganttExpandAll, ganttCollapseAll, ganttExpand, ganttCollapse, ganttUndo, ganttRedo, ganttScaleHour, ganttScaleDay, ganttScaleWeek, ganttScaleMonth, ganttScaleQuarter, ganttScaleYear, ganttMoved, ganttProgressSet, ganttLinked, ganttUnlink, ganttDeleted, ganttDelete, ganttReordered, ganttSlack, ganttCritical, ganttBaseline, ganttEmpty, ganttResize, timelineResource, timelineConflict, timelineMoved, timelineEmpty, cropArea, cropRotateLeft, cropRotateRight, cropFlip, cropReset, cropFree, drawCanvas, drawTools, drawMore, drawSelect, drawPan, drawPen, drawBrush, drawMarker, drawHighlighter, drawEraser, drawStrokeEraser, drawLine, drawArrow, drawRect, drawEllipse, drawText, drawFill, drawColor, floorPlan, floorSeats, drawCustomColor, drawSize, drawUndo, drawRedo, drawDelete, drawLayers, drawLayer, drawLayerName, drawAddLayer, drawDeleteLayer, drawShowLayer, drawHideLayer, drawLockLayer, drawUnlockLayer, drawLayerUp, drawLayerDown
5366
7932
 
5367
7933
  ## Theme tokens
5368
7934