@m3ui-vue/m3ui-vue 1.2.2 → 1.3.1

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 (241) hide show
  1. package/dist/API.md +3010 -376
  2. package/dist/MButton-Bl_BSUep.js +172 -0
  3. package/dist/MButton-Bl_BSUep.js.map +1 -0
  4. package/dist/MDialog-D_Yik8ou.js +173 -0
  5. package/dist/MDialog-D_Yik8ou.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-BxifHJdU.js +824 -0
  9. package/dist/MListItem-BxifHJdU.js.map +1 -0
  10. package/dist/MLoadingIndicator-BxbFhSX6.js +115 -0
  11. package/dist/MLoadingIndicator-BxbFhSX6.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-BeN9QcB3.js +435 -0
  17. package/dist/MSeekBar-BeN9QcB3.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-BVSbJlGS.js +691 -0
  21. package/dist/MSlider-BVSbJlGS.js.map +1 -0
  22. package/dist/MSpinner-C2SUnWk4.js +65 -0
  23. package/dist/MSpinner-C2SUnWk4.js.map +1 -0
  24. package/dist/MTextField-CEkWSZ2v.js +296 -0
  25. package/dist/MTextField-CEkWSZ2v.js.map +1 -0
  26. package/dist/MTooltip-CodJGEO-.js +756 -0
  27. package/dist/MTooltip-CodJGEO-.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 +150 -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 +248 -0
  55. package/dist/components/MFloorPlanInspector.vue.d.ts +56 -0
  56. package/dist/components/MFloorPlanToolbar.vue.d.ts +51 -0
  57. package/dist/components/MFlow.vue.d.ts +318 -0
  58. package/dist/components/MFlowControls.vue.d.ts +33 -0
  59. package/dist/components/MFlowHandle.vue.d.ts +16 -0
  60. package/dist/components/MFlowMinimap.vue.d.ts +22 -0
  61. package/dist/components/MFlowNode.vue.d.ts +35 -0
  62. package/dist/components/MGantt.vue.d.ts +141 -0
  63. package/dist/components/MGanttControls.vue.d.ts +32 -0
  64. package/dist/components/MIconButton.vue.d.ts +3 -1
  65. package/dist/components/MImageCropper.vue.d.ts +110 -0
  66. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  67. package/dist/components/MLightbox.vue.d.ts +2 -2
  68. package/dist/components/MList.vue.d.ts +1 -1
  69. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  70. package/dist/components/MMapControl.vue.d.ts +1 -1
  71. package/dist/components/MMapSearch.vue.d.ts +1 -1
  72. package/dist/components/MMaskField.vue.d.ts +12 -1
  73. package/dist/components/MMenu.vue.d.ts +1 -1
  74. package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
  75. package/dist/components/MNumberField.vue.d.ts +11 -2
  76. package/dist/components/MPdfViewer.vue.d.ts +174 -0
  77. package/dist/components/MPullToRefresh.vue.d.ts +1 -1
  78. package/dist/components/MResourceTimeline.vue.d.ts +149 -0
  79. package/dist/components/MScheduler.vue.d.ts +3 -3
  80. package/dist/components/MScheme.vue.d.ts +1 -1
  81. package/dist/components/MSearchField.vue.d.ts +1 -1
  82. package/dist/components/MSeekBar.vue.d.ts +1 -1
  83. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  84. package/dist/components/MSkeleton.vue.d.ts +1 -1
  85. package/dist/components/MSlider.vue.d.ts +2 -2
  86. package/dist/components/MSparkline.vue.d.ts +1 -1
  87. package/dist/components/MSplitter.vue.d.ts +1 -1
  88. package/dist/components/MStack.vue.d.ts +2 -2
  89. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  90. package/dist/components/MSwitch.vue.d.ts +1 -1
  91. package/dist/components/MTable.vue.d.ts +1 -1
  92. package/dist/components/MTagInput.vue.d.ts +12 -1
  93. package/dist/components/MTextField.vue.d.ts +13 -2
  94. package/dist/components/MToolbar.vue.d.ts +1 -1
  95. package/dist/components/MTree.vue.d.ts +2 -2
  96. package/dist/components/MVideoPlayer.vue.d.ts +253 -0
  97. package/dist/components/MVirtualTable.vue.d.ts +1 -1
  98. package/dist/components/MWindow.vue.d.ts +3 -3
  99. package/dist/components/_MFlowEdge.vue.d.ts +9 -0
  100. package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
  101. package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
  102. package/dist/components/_MPdfPage.vue.d.ts +76 -0
  103. package/dist/components/_MTimeBackground.vue.d.ts +14 -0
  104. package/dist/components/_MTimeHeader.vue.d.ts +20 -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/_useTimeAxis.d.ts +90 -0
  109. package/dist/composables/drawGeometry.d.ts +119 -0
  110. package/dist/composables/flowFormats.d.ts +79 -0
  111. package/dist/composables/flowLayout.d.ts +45 -0
  112. package/dist/composables/flowPaths.d.ts +53 -0
  113. package/dist/composables/ganttFormats.d.ts +52 -0
  114. package/dist/composables/ganttSchedule.d.ts +99 -0
  115. package/dist/composables/useDrawing.d.ts +44 -0
  116. package/dist/composables/useFloorPlan.d.ts +58 -0
  117. package/dist/composables/useFlow.d.ts +266 -0
  118. package/dist/composables/useGantt.d.ts +87 -0
  119. package/dist/composables/useLocale.d.ts +204 -0
  120. package/dist/composables/useMediaPlayer.d.ts +101 -0
  121. package/dist/composables/usePdf.d.ts +119 -0
  122. package/dist/composables/useResourceTimeline.d.ts +70 -0
  123. package/dist/draw.d.ts +7 -0
  124. package/dist/draw.js +1702 -0
  125. package/dist/draw.js.map +1 -0
  126. package/dist/flow.d.ts +14 -0
  127. package/dist/flow.js +3547 -0
  128. package/dist/flow.js.map +1 -0
  129. package/dist/flowPaths-CUc6X373.js +161 -0
  130. package/dist/flowPaths-CUc6X373.js.map +1 -0
  131. package/dist/gantt.d.ts +12 -0
  132. package/dist/gantt.js +3575 -0
  133. package/dist/gantt.js.map +1 -0
  134. package/dist/index.d.ts +9 -0
  135. package/dist/locales/index.js +1435 -7
  136. package/dist/locales/index.js.map +1 -1
  137. package/dist/m3ui-vue.css +1 -1
  138. package/dist/m3ui.js +8248 -7637
  139. package/dist/m3ui.js.map +1 -1
  140. package/dist/map.js +113 -108
  141. package/dist/map.js.map +1 -1
  142. package/dist/media.d.ts +5 -0
  143. package/dist/media.js +1311 -0
  144. package/dist/media.js.map +1 -0
  145. package/dist/pdf.d.ts +4 -0
  146. package/dist/pdf.js +1871 -0
  147. package/dist/pdf.js.map +1 -0
  148. package/dist/rich-text-editor.js +28 -26
  149. package/dist/rich-text-editor.js.map +1 -1
  150. package/dist/styles.css +1 -1
  151. package/dist/{useLocale-JYxDDeXC.js → useLocale-CaWwi-b6.js} +206 -2
  152. package/dist/useLocale-CaWwi-b6.js.map +1 -0
  153. package/dist/{useThemeTokens-y0HZpyhL.js → useThemeTokens-DQQcaWbE.js} +40 -54
  154. package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
  155. package/package.json +29 -5
  156. package/src/__tests__/MAudioPlayer.test.ts +75 -0
  157. package/src/__tests__/MDrawCanvas.test.ts +118 -0
  158. package/src/__tests__/MFloorPlan.test.ts +299 -0
  159. package/src/__tests__/MFlow.test.ts +590 -0
  160. package/src/__tests__/MGantt.test.ts +130 -0
  161. package/src/__tests__/MImageCropper.test.ts +89 -0
  162. package/src/__tests__/MPdfViewer.test.ts +235 -0
  163. package/src/__tests__/MResourceTimeline.test.ts +102 -0
  164. package/src/__tests__/MVideoPlayer.test.ts +201 -0
  165. package/src/__tests__/drawGeometry.test.ts +58 -0
  166. package/src/__tests__/fieldExpose.test.ts +30 -0
  167. package/src/__tests__/flowFormats.test.ts +185 -0
  168. package/src/__tests__/flowLayout.test.ts +113 -0
  169. package/src/__tests__/ganttFormats.test.ts +76 -0
  170. package/src/__tests__/ganttSchedule.test.ts +136 -0
  171. package/src/__tests__/pdfMock.ts +83 -0
  172. package/src/__tests__/useMediaPlayer.test.ts +182 -0
  173. package/src/__tests__/usePdf.test.ts +102 -0
  174. package/src/components/MAudioPlayer.vue +319 -0
  175. package/src/components/MDrawCanvas.vue +819 -0
  176. package/src/components/MDrawLayers.vue +114 -0
  177. package/src/components/MDrawToolbar.vue +171 -0
  178. package/src/components/MFloorPlan.vue +1080 -0
  179. package/src/components/MFloorPlanInspector.vue +169 -0
  180. package/src/components/MFloorPlanToolbar.vue +128 -0
  181. package/src/components/MFlow.vue +2060 -0
  182. package/src/components/MFlowControls.vue +110 -0
  183. package/src/components/MFlowHandle.vue +60 -0
  184. package/src/components/MFlowMinimap.vue +134 -0
  185. package/src/components/MFlowNode.vue +98 -0
  186. package/src/components/MGantt.vue +1609 -0
  187. package/src/components/MGanttControls.vue +77 -0
  188. package/src/components/MIconButton.vue +3 -1
  189. package/src/components/MImageCropper.vue +507 -0
  190. package/src/components/MMaskField.vue +13 -0
  191. package/src/components/MNumberField.vue +13 -0
  192. package/src/components/MPdfViewer.vue +1270 -0
  193. package/src/components/MResourceTimeline.vue +1020 -0
  194. package/src/components/MTagInput.vue +13 -0
  195. package/src/components/MTextField.vue +16 -0
  196. package/src/components/MVideoPlayer.vue +839 -0
  197. package/src/components/_MFlowEdge.vue +100 -0
  198. package/src/components/_MFlowEdgeLabel.vue +56 -0
  199. package/src/components/_MFlowNodeShell.vue +111 -0
  200. package/src/components/_MPdfPage.vue +456 -0
  201. package/src/components/_MTimeBackground.vue +16 -0
  202. package/src/components/_MTimeHeader.vue +31 -0
  203. package/src/composables/_flowPanel.ts +13 -0
  204. package/src/composables/_flowSlot.ts +6 -0
  205. package/src/composables/_ganttTime.ts +200 -0
  206. package/src/composables/_useTimeAxis.ts +224 -0
  207. package/src/composables/drawGeometry.ts +405 -0
  208. package/src/composables/flowFormats.ts +916 -0
  209. package/src/composables/flowLayout.ts +297 -0
  210. package/src/composables/flowPaths.ts +239 -0
  211. package/src/composables/ganttFormats.ts +366 -0
  212. package/src/composables/ganttSchedule.ts +403 -0
  213. package/src/composables/useDrawing.ts +53 -0
  214. package/src/composables/useFloorPlan.ts +73 -0
  215. package/src/composables/useFlow.ts +250 -0
  216. package/src/composables/useGantt.ts +92 -0
  217. package/src/composables/useLocale.ts +410 -0
  218. package/src/composables/useMediaPlayer.ts +406 -0
  219. package/src/composables/usePdf.ts +456 -0
  220. package/src/composables/useResourceTimeline.ts +76 -0
  221. package/src/draw.ts +25 -0
  222. package/src/flow.ts +26 -0
  223. package/src/gantt.ts +12 -0
  224. package/src/index.ts +9 -0
  225. package/src/locales/de.ts +204 -0
  226. package/src/locales/es.ts +204 -0
  227. package/src/locales/fr.ts +204 -0
  228. package/src/locales/ja.ts +204 -0
  229. package/src/locales/ko.ts +204 -0
  230. package/src/locales/pt.ts +204 -0
  231. package/src/locales/zh.ts +204 -0
  232. package/src/media.ts +5 -0
  233. package/src/pdf.ts +15 -0
  234. package/dist/MMenuItem-D4Gx_l3F.js +0 -929
  235. package/dist/MMenuItem-D4Gx_l3F.js.map +0 -1
  236. package/dist/MSlider-Dx_S3vJ9.js +0 -1506
  237. package/dist/MSlider-Dx_S3vJ9.js.map +0 -1
  238. package/dist/MTextField-Bz8JIsnl.js +0 -633
  239. package/dist/MTextField-Bz8JIsnl.js.map +0 -1
  240. package/dist/useLocale-JYxDDeXC.js.map +0 -1
  241. package/dist/useThemeTokens-y0HZpyhL.js.map +0 -1
package/dist/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # @m3ui-vue/m3ui-vue 1.2.2 — API reference
1
+ # @m3ui-vue/m3ui-vue 1.3.1 — 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,92 @@ 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
+ - `backgroundImageBox?: DrawBox` — Infinite canvas: where the background image goes and its size, in drawing units (fitView takes it in too)
1082
+ - `penOnly?: boolean | "auto" = "auto"` — Fingers only pan and zoom: `true`, `false`, or `'auto'` (once a stylus has touched the canvas)
1083
+ - `pressure?: boolean = true` — Use the stylus' pressure (without one, speed thins the line)
1084
+ - `smoothing?: number = 0.5` — How much strokes are smoothed, 0–1
1085
+ - `eraserSize?: number = 12` — The eraser's radius in screen pixels
1086
+ - `history?: boolean = true` — Undo and redo
1087
+ - `historySize?: number = 100`
1088
+ - `readonly?: boolean = false` — Look only: no drawing, but pan and zoom
1089
+ - `minZoom?: number = 0.1`
1090
+ - `maxZoom?: number = 8`
1091
+ - `label?: string` — Accessible name of the canvas
1092
+ - `modelValue?: DrawItem[] = []` (v-model) — The drawing: strokes, shapes and texts
1093
+ - `tool?: DrawTool = "pen"` (v-model:tool)
1094
+ - `color?: string = "#1d1b20"` (v-model:color)
1095
+ - `size?: number = 4` (v-model:size) — Pen width, shape line width or font size, by tool
1096
+ - `fill?: boolean = false` (v-model:fill) — New rects and ellipses are filled with the color
1097
+ - `layers?: DrawLayer[] = []` (v-model:layers) — Layers, bottom first (none: one implicit layer)
1098
+ - `layer?: string` (v-model:layer) — The layer new items go on (default: the top one)
1099
+ - `pages?: number = 1` (v-model:pages) — How many pages, in `mode="pages"`
1100
+ - `selection?: string[] = []` (v-model:selection) — The selected items' ids
1101
+ - `viewport?: { x: number; y: number; zoom: number; } = { x: 0, y: 0, zoom: 1 }` (v-model:viewport) — Pan and zoom: screen = drawing × zoom + (x, y)
1102
+
1103
+ Events:
1104
+ - `update:modelValue(value: DrawItem[])`
1105
+ - `update:tool(value: DrawTool)`
1106
+ - `update:color(value: string)`
1107
+ - `update:size(value: number)`
1108
+ - `update:fill(value: boolean)`
1109
+ - `update:layers(value: DrawLayer[])`
1110
+ - `update:layer(value: string | undefined)`
1111
+ - `update:pages(value: number)`
1112
+ - `update:selection(value: string[])`
1113
+ - `update:viewport(value: { x: number; y: number; zoom: number; })`
1114
+ - `change(items: DrawItem[])` — Fires after every edit with the new items (the same as `update:modelValue`)
1115
+
1116
+ Slots:
1117
+ - `#default` — Overlays: a toolbar (MDrawToolbar), a layers panel (MDrawLayers), anything positioned over the canvas
1118
+
1119
+ Exposed (template ref):
1120
+ - `undo: () => void`
1121
+ - `redo: () => void`
1122
+ - `clear: () => void`
1123
+ - `deleteSelection: () => void`
1124
+ - `fitView: () => void`
1125
+ - `zoomIn: () => void`
1126
+ - `zoomOut: () => void`
1127
+ - `exportSvg: (opts?: DrawExportOptions) => string`
1128
+ - `exportPng: (opts?: DrawExportOptions) => Promise<Blob>`
1129
+ - `toContent: (e: { clientX: number; clientY: number; }) => { x: number; y: number; }`
1130
+
1131
+ ### MDrawLayers
1132
+
1133
+ Import from `@m3ui-vue/m3ui-vue/draw`.
1134
+
1135
+ 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.
1136
+
1137
+ ### MDrawToolbar
1138
+
1139
+ Import from `@m3ui-vue/m3ui-vue/draw`.
1140
+
1141
+ 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.
1142
+
1143
+ Props:
1144
+ - `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)
1145
+ - `colors?: string[] = ["#1d1b20", "#e53935", "#fb8c00", "#fdd835", "#43a047", "#1e88e5", "#8e24aa", "#ffffff"]` — Color swatches
1146
+ - `sizes?: number[] = [2, 4, 8, 16]` — Sizes offered (pen width; a shape's line is the same, text is 4× it)
1147
+ - `history?: boolean = true` — Undo and redo
1148
+ - `customColor?: boolean = true` — A button that opens a color picker for any color
1149
+
1150
+ Slots:
1151
+ - `#default` — More controls at the start
1152
+ - `#end` — More controls at the end
1153
+
1020
1154
  ### MEmoji
1021
1155
 
1022
1156
  Renders a single emoji character at a fixed pixel size, with optional accessible labeling.
@@ -1123,7 +1257,7 @@ Props:
1123
1257
  - `label?: string` — Extended FAB label text
1124
1258
  - `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
1259
  - `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
1260
+ - `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
1261
  - `disabled?: boolean = false` — Disables interaction
1128
1262
  - `items?: SpeedDialItem[]` — Speed-dial child items (see `SpeedDialItem`)
1129
1263
  - `direction?: "right" | "left" | "up" | "down" | "radial" = "up"` — Speed-dial expand direction
@@ -1250,6 +1384,387 @@ Props:
1250
1384
  Slots:
1251
1385
  - `#default` — The flex items.
1252
1386
 
1387
+ ### MFloorPlan
1388
+
1389
+ 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. Editing: drag tables (Shift-click picks several), zones (resize by any corner), walls (drag a corner once picked; double-click a wall for a new corner) and decor (resize by its corner); rotate the picked table or decor by the handle above it (15° steps, Shift for free). Arrows nudge, Delete removes what's picked (a wall's picked corner, or the selected tables), Ctrl+D duplicates, Ctrl+Z / Ctrl+Shift+Z undo and redo. `v-model:picked` says which zone, wall or decor is picked, for an inspector of your own.
1390
+
1391
+ Props:
1392
+ - `width?: number = 1000` — The plan's size in plan units
1393
+ - `height?: number = 600`
1394
+ - `statuses?: Record<string, FloorStatus> = {
1395
+ free: { label: "Free", color: "surface" },
1396
+ occupied: { label: "Occupied", color: "primary", icon: "restaurant" },
1397
+ bill: { label: "Bill requested", color: "tertiary", icon: "receipt_long" },
1398
+ reserved: { label: "Reserved", color: "secondary", icon: "event" },
1399
+ }` — Status keys to their look
1400
+ - `editable?: boolean = false` — Drag tables around; otherwise a click opens one
1401
+ - `grid?: number = 10` — Grid step in plan units (0: no snapping)
1402
+ - `showGrid?: boolean = true` — Draw the grid while editing
1403
+ - `chairs?: boolean = true` — Draw chairs from `seats`
1404
+ - `decorKinds?: Record<string, FloorDecorKind>` — Decor kinds of yours, or the built-in ones restyled (merged over them by name)
1405
+ - `selectable?: "none" | "multiple" | "single" = "none"` — Outside editing, what a click on a table selects: nothing, one, or several (toggling; to merge them)
1406
+ - `canMerge?: ((ids: (string | number)[]) => string | boolean)` — Whether these tables may be merged: `true`, or `false` / a reason to refuse (shown by `merge-refused`)
1407
+ - `label?: string` — Accessible name
1408
+ - `tables?: FloorTable[] = []` (v-model:tables)
1409
+ - `merges?: FloorMerge[] = []` (v-model:merges)
1410
+ - `selection?: (string | number)[] = []` (v-model:selection)
1411
+ - `areas?: FloorArea[] = []` (v-model:areas)
1412
+ - `walls?: FloorWall[] = []` (v-model:walls)
1413
+ - `decor?: FloorDecor[] = []` (v-model:decor)
1414
+ - `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
1415
+ - `picked?: FloorPick = null` (v-model:picked) — While editing: the zone, wall (and corner) or decor item picked, for an inspector of your own
1416
+
1417
+ Events:
1418
+ - `split(merge: FloorMerge)`
1419
+ - `update:tool(value: "select" | "area" | "wall")`
1420
+ - `update:selection(value: (string | number)[])`
1421
+ - `update:tables(value: FloorTable[])`
1422
+ - `update:merges(value: FloorMerge[])`
1423
+ - `update:areas(value: FloorArea[])`
1424
+ - `update:walls(value: FloorWall[])`
1425
+ - `update:decor(value: FloorDecor[])`
1426
+ - `update:picked(value: FloorPick)`
1427
+ - `merge(merge: FloorMerge)`
1428
+ - `merge-refused(ids: (string | number)[], reason: string)`
1429
+ - `table-click(table: FloorTable, event: MouseEvent | KeyboardEvent)` — A table was clicked or opened with Enter (not after a drag)
1430
+ - `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
1431
+
1432
+ Slots:
1433
+ - `#area { area: FloorArea; picked: boolean; scale: number; }`
1434
+ - `#decor { item: FloorDecor; kind: FloorDecorKind; picked: boolean; scale: number; }`
1435
+ - `#merge { merge: FloorMerge; tables: (string | number)[]; }`
1436
+ - `#table { table: FloorTable; status: FloorStatus | undefined; selected: boolean; }` — The inside of a table: `{ table, status, selected }`
1437
+ - `#overlay { scale: number; toPx: (v: number) => number; }`
1438
+
1439
+ Exposed (template ref):
1440
+ - `context: FloorPlanContext` — Everything above and more, for MFloorPlanToolbar / MFloorPlanInspector outside the plan (`:plan="plan"`)
1441
+ - `addTable: (t?: Partial<FloorTable>) => FloorTable`
1442
+ - `addDecor: (kind: string, d?: Partial<FloorDecor>) => FloorDecor`
1443
+ - `update: (kind: FloorItemKind, id: string | number, patch: Record<string, unknown>) => void`
1444
+ - `removeSelected: () => void`
1445
+ - `merge: (ids?: (string | number)[], label?: string | undefined) => FloorMerge | null` — Merge tables (default: the selection) / split a merge (by its id or a table's)
1446
+ - `split: (idOrTable: string | number) => void`
1447
+ - `undo: () => void` — Undo / redo the plan's own edits (also Ctrl+Z, Ctrl+Shift+Z or Ctrl+Y)
1448
+ - `redo: () => void`
1449
+ - `canUndo: boolean`
1450
+ - `canRedo: boolean`
1451
+ - `duplicate: () => void` — Copy the selected tables, or the picked zone or decor (also Ctrl+D)
1452
+ - `removeTables: (ids: (string | number)[]) => void` — Remove tables, taking them out of their merges (Delete does it for the selection)
1453
+
1454
+ ```ts
1455
+ /** A table on the plan, in plan units (not pixels) */
1456
+ export interface FloorTable {
1457
+ id: string | number
1458
+ label: string
1459
+ x: number
1460
+ y: number
1461
+ shape?: 'round' | 'square' | 'rect'
1462
+ seats?: number
1463
+ /** Size in plan units (default: from the shape and the seats) */
1464
+ width?: number
1465
+ height?: number
1466
+ /** Degrees */
1467
+ rotation?: number
1468
+ /** A key of `statuses` */
1469
+ status?: string
1470
+ /** A small badge: minutes seated, the total, a count… */
1471
+ badge?: string | number
1472
+ data?: Record<string, unknown>
1473
+ }
1474
+ ```
1475
+
1476
+ ```ts
1477
+ /** Tables joined together (drawn as one group) */
1478
+ export interface FloorMerge {
1479
+ id: string | number
1480
+ tables: (string | number)[]
1481
+ label?: string
1482
+ }
1483
+ ```
1484
+
1485
+ ```ts
1486
+ /** How a status looks: an M3 color role ('primary', 'tertiary', 'error'…) or any CSS color, an icon, a name */
1487
+ export interface FloorStatus {
1488
+ label: string
1489
+ color: string
1490
+ icon?: string
1491
+ }
1492
+ ```
1493
+
1494
+ ```ts
1495
+ /** A zone of the room (terrace, main hall, VIP): a rectangle behind the tables */
1496
+ export interface FloorArea {
1497
+ id: string | number
1498
+ label?: string
1499
+ x: number
1500
+ y: number
1501
+ width: number
1502
+ height: number
1503
+ /** An M3 color role or any CSS color */
1504
+ color?: string
1505
+ }
1506
+ ```
1507
+
1508
+ ```ts
1509
+ /** A wall: a line through its points */
1510
+ export interface FloorWall {
1511
+ id: string | number
1512
+ points: [number, number][]
1513
+ thickness?: number
1514
+ }
1515
+ ```
1516
+
1517
+ ```ts
1518
+ /** Something on the plan that isn't a table: a door, a window, a plant, a column, the register, a text label… */
1519
+ export interface FloorDecor {
1520
+ id: string | number
1521
+ /** A built-in kind, or one of yours from `decorKinds` */
1522
+ kind: FloorDecorBuiltin | (string & {})
1523
+ x: number
1524
+ y: number
1525
+ width?: number
1526
+ height?: number
1527
+ rotation?: number
1528
+ /** The text of a label (or a caption under the others) */
1529
+ label?: string
1530
+ }
1531
+ ```
1532
+
1533
+ ```ts
1534
+ /** What's picked on the plan besides tables: a zone, a wall (and one of its corners) or a decor item */
1535
+ export type FloorPick = { kind: 'area' | 'wall' | 'decor'; id: string | number; vertex?: number } | null
1536
+ ```
1537
+
1538
+ ```ts
1539
+ /** How a decor kind looks: its default size, an icon, a shape and fill; yours or a built-in one restyled */
1540
+ export interface FloorDecorKind {
1541
+ /** Name, for the accessible label */
1542
+ label?: string
1543
+ icon?: string
1544
+ width: number
1545
+ height: number
1546
+ /** `box` a rounded rectangle, `round` a circle, `bar` a thin slab (doors, windows), `text` the item's label only */
1547
+ shape?: 'box' | 'round' | 'bar' | 'text'
1548
+ /** Fill: an M3 color role (`surface`, `primary`…) or any CSS color */
1549
+ color?: string
1550
+ }
1551
+ ```
1552
+
1553
+ ```ts
1554
+ export type FloorDecorBuiltin = 'door' | 'window' | 'plant' | 'column' | 'restroom' | 'kitchen' | 'register' | 'stairs' | 'label'
1555
+ ```
1556
+
1557
+ ### MFloorPlanInspector
1558
+
1559
+ Edits what's picked on an MFloorPlan: a table (name, seats, shape, angle; split it if merged), several tables (merge them), a zone (name, color), a wall (thickness, delete a corner) or decor (text, size, angle); duplicate and delete. A slot per kind adds fields of your own below the built-in ones, with an `update` to change the item (an undo step). Inside the plan's `#overlay` slot it finds the plan by itself; anywhere else, pass the plan's template ref as `plan`. Not an M3 spec component.
1560
+
1561
+ Props:
1562
+ - `plan?: FloorPlanContext | { context: FloorPlanContext; } | null = null` — The plan: its template ref (or its `context`). Not needed inside the plan's slots
1563
+ - `zoneColors?: string[] = ["secondary", "tertiary", "primary", "success", "error"]` — Colors offered for zones: M3 color roles or CSS colors
1564
+ - `merging?: boolean = true` — Merge and split buttons
1565
+
1566
+ Slots:
1567
+ - `#table { table: FloorTable; update: (p: Partial<FloorTable>) => void; }` — Below a table's fields: `{ table, update }`
1568
+ - `#tables { ids: (string | number)[]; }` — Below several picked tables: `{ ids }`
1569
+ - `#area { area: FloorArea; update: (p: Partial<FloorArea>) => void; }` — Below a zone's fields: `{ area, update }`
1570
+ - `#wall { wall: FloorWall; update: (p: Partial<FloorWall>) => void; }` — Below a wall's fields: `{ wall, update }`
1571
+ - `#decor { item: FloorDecor; kind: FloorDecorKind | undefined; update: (p: Partial<FloorDecor>) => void; }` — Below a decor item's fields: `{ item, kind, update }`
1572
+ - `#empty` — When nothing is picked
1573
+
1574
+ ### MFloorPlanToolbar
1575
+
1576
+ A toolbar for editing an MFloorPlan: move / draw a wall / drag out a zone, add a table (your presets) or decor (any kind, yours too), duplicate, delete, undo and redo. Inside the plan's `#overlay` slot it finds the plan by itself; anywhere else, pass the plan's template ref as `plan`. Not an M3 spec component.
1577
+
1578
+ Props:
1579
+ - `plan?: FloorPlanContext | { context: FloorPlanContext; } | null = null` — The plan: its template ref (or its `context`). Not needed inside the plan's slots
1580
+ - `tables?: FloorTablePreset[] = [
1581
+ { shape: "round", seats: 2 },
1582
+ { shape: "round", seats: 4 },
1583
+ { shape: "square", seats: 4 },
1584
+ { shape: "rect", seats: 6 },
1585
+ ]` — Tables offered by Add a table (name, shape, seats, size…)
1586
+ - `decor?: string[]` — Decor kinds offered (default: every kind the plan knows, yours included)
1587
+ - `tools?: boolean = true` — Move / wall / zone
1588
+ - `history?: boolean = true` — Undo and redo
1589
+
1590
+ Slots:
1591
+ - `#default` — More controls at the start
1592
+ - `#end` — More controls at the end
1593
+
1594
+ ```ts
1595
+ /** A table offered by the toolbar's Add a table menu */
1596
+ export type FloorTablePreset = Partial<FloorTable> & { name?: string }
1597
+ ```
1598
+
1599
+ ### MFlow
1600
+
1601
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1602
+
1603
+ 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.
1604
+
1605
+ Props:
1606
+ - `nodes?: FlowNode<any>[] = []` (v-model:nodes)
1607
+ - `edges?: FlowEdge<any>[] = []` (v-model:edges)
1608
+ - `viewport?: FlowViewport` (v-model:viewport) — The view (v-model)
1609
+ - `selection?: FlowSelection` (v-model:selection) — Selected node and edge ids (v-model)
1610
+ - `locked?: boolean = false` (v-model:locked) — Switches off moving, connecting, selecting and deleting; the view still pans and zooms (v-model)
1611
+ - `direction?: "horizontal" | "vertical" = "horizontal"` — Which way edges run by default: where the default node's handles go and the layout's direction
1612
+ - `background?: "none" | "grid" | "dots" = "dots"`
1613
+ - `gridSize?: number = 20` — The background's spacing, and the grid nodes snap to, px
1614
+ - `snapToGrid?: boolean = false`
1615
+ - `minZoom?: number = 0.2`
1616
+ - `maxZoom?: number = 4`
1617
+ - `fitView?: boolean = false` — Fits the nodes in view once they're measured, and again after each automatic `layout`
1618
+ - `wheel?: "pan" | "zoom" = "pan"` — What the plain wheel does (Ctrl + wheel always zooms)
1619
+ - `zoomOnDoubleClick?: boolean = true` — A double click on the background zooms in
1620
+ - `panOnDrag?: boolean = true` — Dragging the background pans; off, it draws a selection box
1621
+ - `selectionOnDrag?: boolean = false` — Dragging the background draws a selection box (Shift + drag always does)
1622
+ - `nodesDraggable?: boolean = true`
1623
+ - `nodesConnectable?: boolean = true`
1624
+ - `elementsSelectable?: boolean = true`
1625
+ - `edgesReconnectable?: boolean = true`
1626
+ - `defaultEdgeOptions?: Partial<FlowEdge<any>>` — Merged into edges made by connecting (`type`, `animated`, `markerEnd`…)
1627
+ - `autoConnect?: boolean = true` — Adds an edge to `edges` when a connection is made; off, only `connect` fires
1628
+ - `isValidConnection?: ((c: FlowConnection) => boolean)` — Whether a connection may be made (no duplicates or same-node loops are offered either way)
1629
+ - `connectionRadius?: number = 24` — How close to a handle a connection snaps to it, px
1630
+ - `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
1631
+ - `deleteKeys?: string[] | null = ["Delete", "Backspace"]` — Keys that delete the selection; `null` turns deleting off
1632
+ - `history?: boolean = true` — Undo and redo (Ctrl+Z, Ctrl+Shift+Z / Ctrl+Y), over every change to nodes and edges
1633
+ - `historySize?: number = 100`
1634
+ - `guides?: boolean = true` — Alignment guides while dragging one node
1635
+ - `layout?: "tree" | "layered" | FlowLayout | null = null` — Lays the nodes out when the graph's shape changes (nodes or edges added, removed, hidden)
1636
+ - `layoutOptions?: FlowLayoutOptions`
1637
+ - `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`
1638
+ - `dropIntoGroups?: boolean = false` — Nodes dropped onto a `group` join it (and leave it when dropped outside)
1639
+ - `animate?: boolean = true` — Positions spring to their new place when they change from outside
1640
+ - `getId?: ((kind: "edge" | "node") => string)` — Makes ids for pasted nodes and new edges
1641
+ - `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
1642
+ - `nativeContextMenu?: boolean = false` — Let the browser's own context menu open on the canvas (right click, or a long press on a phone). Off by default: the `*-contextmenu` events still fire, for a menu of your own (MContextMenu's `showAt`). Text fields inside nodes always keep it, for copy and paste
1643
+ - `label?: string` — The canvas's accessible name
1644
+
1645
+ Events:
1646
+ - `delete({ nodes: FlowNode<any>[]; edges: FlowEdge<any>[]; })` — Nodes and edges were deleted: `{ nodes, edges }`
1647
+ - `update:selection(FlowSelection)`
1648
+ - `update:viewport(FlowViewport)`
1649
+ - `update:nodes(FlowNode<any>[])`
1650
+ - `update:edges(FlowEdge<any>[])`
1651
+ - `update:locked(boolean)`
1652
+ - `connect(FlowConnection)` — A connection was made (it's also added to `edges` with `autoConnect`)
1653
+ - `connect-start({ nodeId: string; handleId: string | null; type: "source" | "target"; })` — A connection drag started from a handle
1654
+ - `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
1655
+ - `reconnect({ edge: FlowEdge<any>; connection: FlowConnection; })` — An edge's end was moved to another handle: `{ edge, connection }`
1656
+ - `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)
1657
+ - `node-click(FlowNode<any>, MouseEvent)` — / node-dblclick / node-contextmenu `(node, event)`
1658
+ - `node-dblclick(FlowNode<any>, MouseEvent)`
1659
+ - `node-contextmenu(FlowNode<any>, MouseEvent)`
1660
+ - `node-drag-start(FlowNode<any>[], PointerEvent)` — / node-drag `(nodes, event)`
1661
+ - `node-drag(FlowNode<any>[], PointerEvent)`
1662
+ - `node-drag-stop({ nodes: FlowNode<any>[]; intersecting: FlowNode<any>[]; event: PointerEvent; })` — `{ nodes, intersecting, event }`: `intersecting` are the nodes under the dragged one
1663
+ - `edge-click(FlowEdge<any>, MouseEvent)` — / edge-dblclick / edge-contextmenu `(edge, event)`
1664
+ - `edge-dblclick(FlowEdge<any>, MouseEvent)`
1665
+ - `edge-contextmenu(FlowEdge<any>, MouseEvent)`
1666
+ - `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)
1667
+ - `pane-contextmenu(FlowXY, MouseEvent)`
1668
+ - `pane-dblclick(FlowXY, MouseEvent)`
1669
+ - `init(FlowContext)` — The canvas measured its nodes (and laid out / fitted them): the flow context
1670
+
1671
+ Slots:
1672
+ - `#empty` — Shown while there are no nodes
1673
+ - `#default { flow: FlowInternals; }` — Drawn over the canvas: MFlowControls, MFlowMinimap, panels of yours. Props: `{ flow }`
1674
+
1675
+ Exposed (template ref):
1676
+ - `size: { width: number; height: number; }` — Canvas size in px
1677
+ - `getNode: (id: string) => FlowNode<any> | undefined`
1678
+ - `getAbsolutePosition: (id: string) => FlowXY` — A node's top left corner in flow coordinates, its parents added, where it's drawn right now
1679
+ - `getSize: (id: string) => { width: number; height: number; }` — A node's measured (or set) size
1680
+ - `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
1681
+ - `screenToFlow: (p: { x: number; y: number; }) => FlowXY` — Page (client) coordinates → flow coordinates
1682
+ - `flowToScreen: (p: FlowXY) => { x: number; y: number; }`
1683
+ - `setViewport: (v: Partial<FlowViewport>, opts?: { animate?: boolean | undefined; } | undefined) => void`
1684
+ - `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
1685
+ - `zoomIn: () => void`
1686
+ - `zoomOut: () => void`
1687
+ - `zoomTo: (zoom: number, opts?: { animate?: boolean | undefined; } | undefined) => void`
1688
+ - `addNodes: (nodes: FlowNode<any> | FlowNode<any>[]) => void`
1689
+ - `addEdges: (edges: FlowEdge<any> | FlowEdge<any>[]) => void`
1690
+ - `updateNode: (id: string, patch: Partial<FlowNode<any>> | ((n: FlowNode<any>) => FlowNode<any>)) => void`
1691
+ - `updateEdge: (id: string, patch: Partial<FlowEdge<any>> | ((e: FlowEdge<any>) => FlowEdge<any>)) => void`
1692
+ - `remove: (ids: { nodes?: string[] | undefined; edges?: string[] | undefined; }) => void` — Deletes nodes (with their edges and children) and edges by id
1693
+ - `setSelection: (sel: Partial<FlowSelection>) => void`
1694
+ - `undo: () => void`
1695
+ - `redo: () => void`
1696
+ - `canUndo: boolean`
1697
+ - `canRedo: boolean`
1698
+ - `copy: () => void`
1699
+ - `cut: () => void`
1700
+ - `paste: (at?: FlowXY | undefined) => void` — Pastes what was copied, at a flow point (default a step from the originals)
1701
+ - `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)
1702
+
1703
+ ### MFlowControls
1704
+
1705
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1706
+
1707
+ 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.
1708
+
1709
+ Props:
1710
+ - `position?: FlowPanelPosition = "bottom-left"`
1711
+ - `orientation?: "horizontal" | "vertical" = "vertical"`
1712
+ - `zoom?: boolean = true`
1713
+ - `fit?: boolean = true`
1714
+ - `lock?: boolean = true`
1715
+ - `history?: boolean = false` — Undo and redo buttons
1716
+ - `delete?: boolean = true` — A delete button while something deletable is selected (touch has no Delete key)
1717
+
1718
+ Slots:
1719
+ - `#default` — More buttons at the end
1720
+
1721
+ ### MFlowHandle
1722
+
1723
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1724
+
1725
+ 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).
1726
+
1727
+ Props:
1728
+ - `type?: "source" | "target" = "source"` — `source`: edges leave from it; `target`: they arrive
1729
+ - `position?: FlowPosition`
1730
+ - `id?: string`
1731
+ - `connectable?: boolean = true`
1732
+
1733
+ ### MFlowMinimap
1734
+
1735
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1736
+
1737
+ 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.
1738
+
1739
+ Props:
1740
+ - `position?: FlowPanelPosition = "bottom-right"`
1741
+ - `width?: number = 200`
1742
+ - `height?: number = 140`
1743
+ - `nodeColor?: ((node: FlowNode<any>) => string)` — A node's fill (any CSS color); default outline-variant, primary when selected
1744
+ - `pannable?: boolean = true` — Drag and click move the view
1745
+ - `zoomable?: boolean = true` — The wheel zooms
1746
+
1747
+ ### MFlowNode
1748
+
1749
+ Import from `@m3ui-vue/m3ui-vue/flow`.
1750
+
1751
+ 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.
1752
+
1753
+ Props:
1754
+ - `label?: string`
1755
+ - `subtitle?: string`
1756
+ - `icon?: string` — Material Symbol
1757
+ - `variant?: "elevated" | "filled" | "outlined" = "outlined"`
1758
+ - `color?: "error" | "primary" | "secondary" | "tertiary" | "neutral" = "primary"` — The icon container's color role
1759
+ - `handles?: "none" | "source" | "target" | "both" = "both"` — Which handles it draws
1760
+ - `sourcePosition?: FlowPosition`
1761
+ - `targetPosition?: FlowPosition`
1762
+
1763
+ Slots:
1764
+ - `#icon` — Instead of the `icon`
1765
+ - `#trailing` — At the end of the header (a status, a menu button). Controls in it don't start a drag
1766
+ - `#default` — Below the header, inside the card
1767
+
1253
1768
  ### MFooter
1254
1769
 
1255
1770
  Page footer with slots for brand, content, social links, and a bottom bar. Responsive padding adapts to screen size.
@@ -1275,6 +1790,94 @@ Props:
1275
1790
  Slots:
1276
1791
  - `#default` — The content that goes full screen.
1277
1792
 
1793
+ ### MGantt
1794
+
1795
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
1796
+
1797
+ 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.
1798
+
1799
+ Props:
1800
+ - `tasks?: GanttTask<any>[] = []` (v-model:tasks)
1801
+ - `scale?: TimeUnit = "day"` (v-model:scale) — The zoom as a named level; `v-model:scale` follows Ctrl + wheel, pinches and MGanttControls
1802
+ - `pxPerDay?: number` — The starting zoom in px per day, between the named levels (instead of `scale`'s)
1803
+ - `selection?: string[]` (v-model:selection) — Selected task ids (`v-model:selection`)
1804
+ - `collapsed?: string[]` (v-model:collapsed) — Ids of tasks whose children are hidden (`v-model:collapsed`)
1805
+ - `columns?: GanttColumn[]` — The task list's columns (default name, start and duration); `[]` hides the list
1806
+ - `gridWidth?: number` (v-model:gridWidth) — The task list's width, px (`v-model:grid-width`; drag its edge)
1807
+ - `rowHeight?: number = 40`
1808
+ - `readonly?: boolean = false` — No editing: drag, resize, link, reorder, rename and delete off
1809
+ - `schedule?: "auto" | "manual" = "manual"` — `'auto'`: tasks that depend on a moved one follow it (`scheduleTasks` in push mode)
1810
+ - `calendar?: GanttCalendar` — Working days: shaded when they aren't, and counted by `schedule="auto"` (default Monday to Friday, no holidays)
1811
+ - `criticalPath?: boolean = false` — Highlights the tasks and dependencies whose delay delays the end
1812
+ - `baselines?: boolean = false` — Draws each task's `baselineStart`/`baselineEnd` under it
1813
+ - `today?: string | null` — Today, for the line across the timeline (default now; `null` hides it)
1814
+ - `snap?: number` — Minutes a datetime task snaps to (default by zoom); date-only tasks always snap to days
1815
+ - `weekStartsOn?: 0 | 1 = 1`
1816
+ - `minPxPerDay?: number = 0.15` — Zoom bounds, px per day
1817
+ - `maxPxPerDay?: number = 2400`
1818
+ - `locale?: string` — Locale for dates (Intl); default the app's
1819
+ - `label?: string` — Accessible name
1820
+ - `beforeDelete?: ((tasks: GanttTask<any>[]) => boolean | Promise<boolean>)` — Asked before deleting; return false (or a promise of it) to keep them
1821
+
1822
+ Events:
1823
+ - `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)
1824
+ - `delete({ tasks: GanttTask<any>[]; })` — Tasks were deleted: `{ tasks }`
1825
+ - `update:selection(string[])`
1826
+ - `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'`
1827
+ - `update:tasks(GanttTask<any>[])`
1828
+ - `update:scale(TimeUnit)`
1829
+ - `update:collapsed(string[])`
1830
+ - `update:gridWidth(number)`
1831
+ - `task-click(GanttTask<any>, MouseEvent)` — / task-dblclick / task-contextmenu `(task, event)`
1832
+ - `task-dblclick(GanttTask<any>, MouseEvent | KeyboardEvent)`
1833
+ - `task-contextmenu(GanttTask<any>, MouseEvent)`
1834
+ - `unlink({ from: string; to: string; })` — A dependency was removed: `{ from, to }`
1835
+
1836
+ Slots:
1837
+ - `#cell-name { task: GanttTask<any>; value: string; }`
1838
+ - `#default { gantt: GanttContext; }` — Above the chart: MGanttControls, filters of yours. Props: `{ gantt }`
1839
+ - `#bar { task: GanttTask<any>; selected: boolean; critical: boolean; }` — A bar's content instead of its label. Props: `{ task, selected, critical }`
1840
+ - `#empty` — Shown while there are no tasks
1841
+ - `#tooltip { task: GanttTask<any>; slack: number | undefined; }` — The card shown over a hovered or dragged bar. Props: `{ task, slack }`
1842
+
1843
+ Exposed (template ref):
1844
+ - `canUndo: boolean`
1845
+ - `canRedo: boolean`
1846
+ - `undo: () => void`
1847
+ - `redo: () => void`
1848
+ - `zoomIn: () => void`
1849
+ - `zoomOut: () => void`
1850
+ - `setScale: (scale: TimeUnit) => void`
1851
+ - `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)
1852
+ - `scrollToTask: (id: string) => void` — Scrolls a task into view, its row and its bar
1853
+ - `toggle: (id: string, expanded?: boolean | undefined) => void`
1854
+ - `expandAll: () => void`
1855
+ - `collapseAll: () => void`
1856
+ - `setSelection: (ids: string[]) => void`
1857
+ - `addTasks: (tasks: GanttTask<any> | GanttTask<any>[], opts?: { after?: string | undefined; } | undefined) => void` — Adds tasks (after `after`, or at the end); undoable
1858
+ - `updateTask: (id: string, patch: Partial<GanttTask<any>> | ((t: GanttTask<any>) => GanttTask<any>)) => void`
1859
+ - `removeTasks: (ids: string[]) => void` — Deletes tasks with their children and the dependencies on them
1860
+ - `link: (from: string, to: string, type?: "FS" | "SS" | "FF" | "SF" | undefined, lag?: number | undefined) => void` — Makes `to` depend on `from`
1861
+ - `unlink: (from: string, to: string) => void`
1862
+ - `dateAt: (clientX: number) => string` — The date (snapped) under a page x
1863
+
1864
+ ### MGanttControls
1865
+
1866
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
1867
+
1868
+ 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.
1869
+
1870
+ Props:
1871
+ - `scales?: TimeUnit[] = ["day", "week", "month", "quarter"]` — The scales offered as a segmented button (`[]` hides it)
1872
+ - `zoom?: boolean = true`
1873
+ - `today?: boolean = true`
1874
+ - `fold?: boolean = true` — Expand all / collapse all
1875
+ - `history?: boolean = true` — Undo and redo
1876
+
1877
+ Slots:
1878
+ - `#default` — More controls at the start
1879
+ - `#end` — More controls at the end
1880
+
1278
1881
  ### MGrid
1279
1882
 
1280
1883
  A responsive CSS grid with per-breakpoint column counts.
@@ -1326,11 +1929,12 @@ A button that shows only an icon — four visual styles, the same 5-tier express
1326
1929
  Props:
1327
1930
  - `icon: string` — Material Symbol icon name
1328
1931
  - `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
1932
+ - `variant?: "standard" | "filled" | "outlined" | "tonal" = "standard"` — Visual style
1330
1933
  - `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
1934
  - `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
1935
  - `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
1936
  - `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
1937
+ - `iconSize?: number` — Icon size in px. Default the size tier's (or 55% of a custom pixel `size`)
1334
1938
  - `disabled?: boolean = false` — Disables interaction
1335
1939
  - `to?: string | Record<string, any>` — Vue Router destination — renders as RouterLink instead of button
1336
1940
  - `rippleColor?: string` — Any CSS color for the press ripple; defaults to the button's content color
@@ -1341,6 +1945,63 @@ Props:
1341
1945
  Events:
1342
1946
  - `update:checked(boolean)` — Emitted on click when `checked` is set — powers v-model:checked
1343
1947
 
1948
+ ### MImageCropper
1949
+
1950
+ 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).
1951
+
1952
+ Props:
1953
+ - `src?: string | Blob | null = null` — The picture: a URL, a File or a Blob
1954
+ - `crop?: CropRect | null = null` (v-model:crop) — The frame, in the rotated picture's pixels (`v-model:crop`)
1955
+ - `aspect?: number | null = null` (v-model:aspect) — Width over height (1 square, 16 / 9…); null is free
1956
+ - `aspects?: CropAspect[]` — Aspects offered in the toolbar as chips (`v-model:aspect` follows them)
1957
+ - `rotation?: 0 | 90 | 180 | 270 = 0` (v-model:rotation) — Quarter turns clockwise in degrees (`v-model:rotation`)
1958
+ - `flipped?: boolean = false` (v-model:flipped) — Mirrored left to right (`v-model:flipped`)
1959
+ - `shape?: "circle" | "rect" = "rect"`
1960
+ - `minSize?: number = 24` — The frame's smallest side, in the picture's px
1961
+ - `guides?: "drag" | "always" | "never" = "drag"` — The rule-of-thirds grid: while dragging (default), always or never
1962
+ - `controls?: boolean = true` — The toolbar under the picture
1963
+ - `alt?: string = ""` — Accessible name of the picture
1964
+
1965
+ Events:
1966
+ - `error(Event)` — The picture didn't load
1967
+ - `change(CropRect)` — A drag or a key changed the crop (after `update:crop`): the crop
1968
+ - `update:crop(CropRect)`
1969
+ - `update:aspect(number | null)`
1970
+ - `update:rotation(0 | 90 | 180 | 270)`
1971
+ - `update:flipped(boolean)`
1972
+ - `load({ width: number; height: number; })` — The picture loaded: `{ width, height }` (its natural size)
1973
+
1974
+ Slots:
1975
+ - `#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 }`
1976
+
1977
+ Exposed (template ref):
1978
+ - `toCanvas: (options?: CropOutputOptions) => HTMLCanvasElement | null`
1979
+ - `toBlob: (options?: CropOutputOptions & { type?: string | undefined; quality?: number | undefined; }) => Promise<Blob | null>`
1980
+ - `rotate: (dir: 1 | -1) => void`
1981
+ - `flip: () => void`
1982
+ - `reset: () => void`
1983
+ - `setAspect: (a: number | null) => void`
1984
+
1985
+ ```ts
1986
+ export interface CropRect { x: number; y: number; width: number; height: number }
1987
+ ```
1988
+
1989
+ ```ts
1990
+ export interface CropAspect { label: string; value: number | null }
1991
+ ```
1992
+
1993
+ ```ts
1994
+ export interface CropOutputOptions {
1995
+ /** The result's size in px; one alone keeps the crop's proportions (default the crop's own size) */
1996
+ width?: number
1997
+ height?: number
1998
+ /** The longest side at most, px */
1999
+ maxSize?: number
2000
+ /** Round, transparent outside (default true for `shape="circle"`) */
2001
+ circle?: boolean
2002
+ }
2003
+ ```
2004
+
1344
2005
  ### MInfiniteScroll
1345
2006
 
1346
2007
  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 +2127,8 @@ Props:
1466
2127
 
1467
2128
  Events:
1468
2129
  - `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
2130
  - `change(index: number)` — Fires alongside update:index with the new index
2131
+ - `update:index(number)` — Fires whenever the current index changes (next/prev/goTo/auto-detected image click)
1471
2132
 
1472
2133
  Slots:
1473
2134
  - `#default` — Content to scan for `<img>` elements when items is not given
@@ -1915,6 +2576,13 @@ Events:
1915
2576
  - `update:modelValue(string)` — Emitted on every keystroke — powers v-model
1916
2577
  - `debounced(string)` — Emitted debounce ms after the user stops typing (only when debounce > 0)
1917
2578
 
2579
+ Exposed (template ref):
2580
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
2581
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
2582
+ - `blur: () => void | undefined` — Takes focus away from the field
2583
+ - `select: () => void | undefined` — Selects all its text
2584
+ - `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)
2585
+
1918
2586
  ```ts
1919
2587
  export type MaskPreset = 'credit-card' | 'phone' | 'date' | 'time' | 'cpf' | 'cnpj' | 'zip'
1920
2588
  ```
@@ -2215,6 +2883,12 @@ Events:
2215
2883
  - `update:modelValue(number | null)` — Emitted on every change — typing, stepper clicks, or arrow keys — powers v-model
2216
2884
  - `debounced(number | null)` — Emitted debounce ms after the user stops typing (only when debounce > 0). Stepper clicks/arrow keys still emit instantly
2217
2885
 
2886
+ Exposed (template ref):
2887
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
2888
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
2889
+ - `blur: () => void | undefined` — Takes focus away from the field
2890
+ - `select: () => void | undefined` — Selects all its text
2891
+
2218
2892
  ### MOverlay
2219
2893
 
2220
2894
  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 +2941,91 @@ Props:
2267
2941
  Events:
2268
2942
  - `score(number)` — Emitted whenever value changes — -1 for an empty value, or 0-4 otherwise
2269
2943
 
2944
+ ### MPdfViewer
2945
+
2946
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
2947
+
2948
+ 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.
2949
+
2950
+ Props:
2951
+ - `src?: PdfSource | null = null` — The PDF: a URL, its bytes, or a `File`/`Blob`
2952
+ - `title?: string` — Shown in the top bar; default the document's own title
2953
+ - `page?: number` (v-model:page) — Current page, 1-based (v-model)
2954
+ - `zoom?: PdfZoom = "fit-width"` (v-model:zoom) — `fit-width`, `fit-page`, or a zoom where 1 is 100% (v-model)
2955
+ - `rotation?: number = 0` (v-model:rotation) — Extra rotation in degrees, a multiple of 90 (v-model)
2956
+ - `annotations?: PdfAnnotation[] = []` (v-model:annotations) — Annotations to draw (v-model)
2957
+ - `annotate?: boolean = false` — Shows the edit button and the annotation toolbar
2958
+ - `tool?: PdfTool = "select"` (v-model:tool) — The active tool (v-model)
2959
+ - `colors?: string[] = ["#FFE14D", "#7ED957", "#5EB8FF", "#FF7EB6", "#B388FF", "#1F1F1F"]` — Colors offered for annotations
2960
+ - `inkWidths?: number[] = [1, 2, 4, 8]` — The pen's widths offered in the toolbar, in PDF points (the first one is the default)
2961
+ - `author?: string` — Written into new annotations' `author`
2962
+ - `sidebar?: "thumbnails" | "outline" | null = null` (v-model:sidebar) — The side panel: thumbnails, the outline, or closed (v-model)
2963
+ - `toolbar?: boolean = true` — Shows the top bar
2964
+ - `downloadable?: boolean = true` — Shows download and print
2965
+ - `fileName?: string` — File name for downloads; default the URL's or the document's title
2966
+ - `password?: string` — A password to try first
2967
+ - `workerSrc?: string` — The pdf.js worker URL (or `setPdfWorker()` once for the app)
2968
+ - `minZoom?: number = 0.25`
2969
+ - `maxZoom?: number = 8`
2970
+
2971
+ Events:
2972
+ - `error(Error)` — The document failed to load
2973
+ - `link({ url?: string | undefined; page?: number | undefined; })` — A link was followed: `{ url }` (opens in a new tab) or `{ page }` (scrolled to)
2974
+ - `update:page(number)`
2975
+ - `update:tool(PdfTool)`
2976
+ - `update:rotation(number)`
2977
+ - `update:zoom(PdfZoom)`
2978
+ - `update:annotations(PdfAnnotation[])`
2979
+ - `update:sidebar("thumbnails" | "outline" | null)`
2980
+ - `loaded(PDFDocumentProxy)` — The document loaded, with its pdf.js proxy
2981
+ - `annotation-click(PdfAnnotation)` — An annotation was clicked with the select tool
2982
+
2983
+ Slots:
2984
+ - `#actions { pdf: PdfState; }` — Extra buttons at the end of the top bar. Props: `{ pdf }`
2985
+ - `#empty` — Shown without a `src`
2986
+
2987
+ Exposed (template ref):
2988
+ - `pdf: PdfState`
2989
+ - `goToPage: (p: number) => void`
2990
+ - `setZoom: (z: PdfZoom) => void`
2991
+ - `search: (q: string) => void`
2992
+ - `undo: () => void`
2993
+
2994
+ ```ts
2995
+ /** One annotation, in PDF points (origin at the page's bottom left), so it survives zoom, rotation and reflows */
2996
+ export interface PdfAnnotation {
2997
+ id: string
2998
+ type: 'highlight' | 'note' | 'ink'
2999
+ /** 1-based page */
3000
+ page: number
3001
+ /** Any CSS color */
3002
+ color: string
3003
+ /** highlight: the selected lines, `[x1, y1, x2, y2]` each */
3004
+ rects?: [number, number, number, number][]
3005
+ /** highlight: the text it covers */
3006
+ quote?: string
3007
+ /** note: where its icon sits */
3008
+ at?: [number, number]
3009
+ /** ink: strokes, each a list of points */
3010
+ paths?: [number, number][][]
3011
+ /** ink: stroke width in points */
3012
+ width?: number
3013
+ /** A note's text, or a comment on a highlight or drawing */
3014
+ text?: string
3015
+ author?: string
3016
+ /** ISO date */
3017
+ createdAt: string
3018
+ }
3019
+ ```
3020
+
3021
+ ```ts
3022
+ export type PdfTool = 'select' | 'highlight' | 'note' | 'ink' | 'eraser'
3023
+ ```
3024
+
3025
+ ```ts
3026
+ export type PdfZoom = number | 'fit-width' | 'fit-page'
3027
+ ```
3028
+
2270
3029
  ### MPinInput
2271
3030
 
2272
3031
  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 +3098,7 @@ Props:
2339
3098
  - `background?: string = "#ffffff"` — Light module / background color
2340
3099
  - `label?: string` — aria-label for the svg. Defaults to value
2341
3100
  - `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.
3101
+ - `moduleStyle?: "dots" | "square" = "square"` — 'square' is the classic scannable pixel grid. 'dots' rounds each module — still fully scannable, just a softer look.
2343
3102
 
2344
3103
  Slots:
2345
3104
  - `#error` — Shown instead of the SVG when value is too large to encode at the given errorCorrectionLevel
@@ -2413,6 +3172,77 @@ Props:
2413
3172
  - `value: string | number | Date` — Required. The timestamp to format: an ISO string, epoch milliseconds, or a Date
2414
3173
  - `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
3174
 
3175
+ ### MResourceTimeline
3176
+
3177
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
3178
+
3179
+ 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.
3180
+
3181
+ Props:
3182
+ - `events?: TimelineEvent<any>[] = []` (v-model:events)
3183
+ - `resources?: TimelineResource<any>[] = []`
3184
+ - `scale?: TimeUnit = "day"` (v-model:scale) — The zoom as a named level (`v-model:scale`)
3185
+ - `pxPerDay?: number = 240` — The starting zoom in px per day, between the named levels (default 240: 10 px an hour)
3186
+ - `selection?: string[]` (v-model:selection) — Selected booking ids (`v-model:selection`)
3187
+ - `collapsed?: string[]` (v-model:collapsed) — Folded group names (`v-model:collapsed`)
3188
+ - `listWidth?: number` (v-model:listWidth) — The resource column's width, px (`v-model:list-width`; drag its edge); 0 hides it
3189
+ - `rowHeight?: number = 56` — A row's least height; rows grow with their lanes
3190
+ - `laneHeight?: number = 40` — One lane's height (a booking and its gap)
3191
+ - `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
3192
+ - `creatable?: boolean = false` — Dragging across empty time asks for a booking there (`create`)
3193
+ - `readonly?: boolean = false`
3194
+ - `snap?: number` — Minutes bookings snap to (default 15; by zoom when zoomed far out); whole-day bookings snap to days
3195
+ - `calendar?: GanttCalendar` — Days worked (shaded when they aren't)
3196
+ - `workHours?: [number, number]` — Working hours, shaded outside them when zoomed in to hours, e.g. `[9, 18]`
3197
+ - `now?: string | null` — Now, for the line across the timeline (default the current time; `null` hides it)
3198
+ - `start?: string` — Where the view starts (default now, or the first booking)
3199
+ - `weekStartsOn?: 0 | 1 = 1`
3200
+ - `minPxPerDay?: number = 2`
3201
+ - `maxPxPerDay?: number = 4800`
3202
+ - `locale?: string`
3203
+ - `label?: string`
3204
+ - `beforeDelete?: ((events: TimelineEvent<any>[]) => boolean | Promise<boolean>)`
3205
+
3206
+ Events:
3207
+ - `delete({ events: TimelineEvent<any>[]; })` — Bookings were deleted: `{ events }`
3208
+ - `update:selection(string[])`
3209
+ - `change({ events: TimelineEvent<any>[]; kind: "move" | "resize"; })` — A drag or a key changed bookings: `{ events, kind: 'move' | 'resize' }`
3210
+ - `update:scale(TimeUnit)`
3211
+ - `update:collapsed(string[])`
3212
+ - `update:events(TimelineEvent<any>[])`
3213
+ - `update:listWidth(number)`
3214
+ - `event-click(TimelineEvent<any>, MouseEvent)` — / event-dblclick / event-contextmenu `(event, mouseEvent)`
3215
+ - `event-dblclick(TimelineEvent<any>, MouseEvent | KeyboardEvent)`
3216
+ - `event-contextmenu(TimelineEvent<any>, MouseEvent)`
3217
+ - `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
3218
+ - `slot-click({ resourceId: string; start: string; })` — Empty time was clicked: `{ resourceId, start }`
3219
+ - `conflict({ event: TimelineEvent<any>; with: TimelineEvent<any>[]; })` — A drop was refused (`overlap="prevent"`): `{ event, with }`
3220
+
3221
+ Slots:
3222
+ - `#default { timeline: ResourceTimelineContext; }` — Above the timeline: MGanttControls, filters of yours. Props: `{ timeline }`
3223
+ - `#group { group: string; resources: TimelineResource<any>[]; collapsed: boolean; }` — A group's header. Props: `{ group, resources, collapsed }`
3224
+ - `#resource { resource: TimelineResource<any>; events: TimelineEvent<any>[]; hours: number; }` — A resource's cell. Props: `{ resource, events, hours }` (`hours`: booked in total)
3225
+ - `#event { event: TimelineEvent<any>; resource: TimelineResource<any> | undefined; selected: boolean; conflict: boolean; }` — A booking's content. Props: `{ event, resource, selected, conflict }`
3226
+ - `#empty` — Shown while there are no resources
3227
+
3228
+ Exposed (template ref):
3229
+ - `conflicts: Set<string>` — Ids of events that overlap more than their resource's capacity
3230
+ - `canUndo: boolean`
3231
+ - `canRedo: boolean`
3232
+ - `undo: () => void`
3233
+ - `redo: () => void`
3234
+ - `zoomIn: () => void`
3235
+ - `zoomOut: () => void`
3236
+ - `setScale: (scale: TimeUnit) => void`
3237
+ - `scrollToDate: (date?: string | undefined, opts?: { align?: "center" | "start" | undefined; animate?: boolean | undefined; } | undefined) => void`
3238
+ - `scrollToEvent: (id: string) => void`
3239
+ - `setSelection: (ids: string[]) => void`
3240
+ - `addEvents: (events: TimelineEvent<any> | TimelineEvent<any>[]) => void`
3241
+ - `updateEvent: (id: string, patch: Partial<TimelineEvent<any>> | ((e: TimelineEvent<any>) => TimelineEvent<any>)) => void`
3242
+ - `removeEvents: (ids: string[]) => void`
3243
+ - `dateAt: (clientX: number) => string` — The time (snapped, as a datetime) under a page x
3244
+ - `resourceAt: (clientY: number) => TimelineResource<any> | undefined` — The resource whose row is under a page y
3245
+
2416
3246
  ### MResponsive
2417
3247
 
2418
3248
  Shows or hides content at specific breakpoints using pure CSS (Tailwind's `hidden`/`block` utilities) — no JS resize listener.
@@ -2495,7 +3325,7 @@ A week or day calendar grid. Events sit at their exact times, overlapping ones s
2495
3325
 
2496
3326
  Props:
2497
3327
  - `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.
3328
+ - `view?: "day" | "week" = "week"` (v-model:view) — 'week' or 'day'; use v-model:view to follow the header's toggle.
2499
3329
  - `date?: string` (v-model:date) — The date shown (`YYYY-MM-DD`), today by default; use v-model:date to follow navigation.
2500
3330
  - `startHour?: number = 7` — First visible hour
2501
3331
  - `endHour?: number = 22` — Hour the grid ends at
@@ -2514,7 +3344,7 @@ Events:
2514
3344
  - `eventClick(SchedulerEvent)` — An event (in the grid or the all-day row) was clicked
2515
3345
  - `slotClick({ date: string; hour: number; })` — An empty spot in the grid was clicked
2516
3346
  - `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
3347
+ - `update:view("day" | "week")` — The Day/Week toggle (or a day header) changed the view
2518
3348
 
2519
3349
  Slots:
2520
3350
  - `#event { event: SchedulerEvent; allDay: boolean; }` — Content of an event block.
@@ -2669,7 +3499,7 @@ Props:
2669
3499
  - `playing?: boolean = false` — The media is playing: the bar moves on its own between updates, and the wavy line waves
2670
3500
  - `playbackRate?: number = 1` — Playback speed, for that motion between updates
2671
3501
  - `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
3502
+ - `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
3503
  - `size?: "xs" | "sm" | "md" = "md"` — Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video)
2674
3504
  - `time?: "none" | "below" | "sides" = "below"` — Where the elapsed and total time go
2675
3505
  - `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 +3694,8 @@ Props:
2864
3694
  - `disabled?: boolean = false` — Disables drawing
2865
3695
 
2866
3696
  Events:
2867
- - `end(string)` — Fires after a stroke ends, with a PNG data: URL of the canvas
2868
3697
  - `change(string)` — Fires alongside end, and also after undo() — same data: URL payload
3698
+ - `end(string)` — Fires after a stroke ends, with a PNG data: URL of the canvas
2869
3699
  - `begin()` — Fires on the first pointerdown of a new stroke
2870
3700
 
2871
3701
  Exposed (template ref):
@@ -3134,7 +3964,7 @@ Slots:
3134
3964
  Secondary text component with muted color by default — a thin wrapper around `MText`.
3135
3965
 
3136
3966
  Props:
3137
- - `size?: "medium" | "small" | "large" = "large"` — Subtitle size (maps to body-large/medium/small)
3967
+ - `size?: "small" | "medium" | "large" = "large"` — Subtitle size (maps to body-large/medium/small)
3138
3968
  - `color?: "error" | "primary" | "secondary" | "tertiary" | "on-surface-variant" | "on-surface" | "inherit" = "on-surface-variant"` — Text color
3139
3969
  - `align?: "right" | "left" | "center"` — Text alignment
3140
3970
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
@@ -3300,6 +4130,13 @@ Events:
3300
4130
  - `update:modelValue(string[])` — Emitted whenever a tag is added or removed — powers v-model
3301
4131
  - `debounced(string[])` — Emitted debounce ms after the tag list stops changing (only when debounce > 0)
3302
4132
 
4133
+ Exposed (template ref):
4134
+ - `inputEl: HTMLInputElement | null` — The `<input>` (or `<textarea>`) element
4135
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
4136
+ - `blur: () => void | undefined` — Takes focus away from the field
4137
+ - `select: () => void | undefined` — Selects all its text
4138
+ - `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)
4139
+
3303
4140
  ### MTerminal
3304
4141
 
3305
4142
  Import from `@m3ui-vue/m3ui-vue/terminal`.
@@ -3333,7 +4170,7 @@ Props:
3333
4170
  - `align?: "right" | "left" | "center" = "left"` — Text alignment
3334
4171
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
3335
4172
  - `lines?: 1 | 2 | 3 | 4 | 5 | 6` — Clamp text to a specific number of lines
3336
- - `weight?: "medium" | "bold" | "regular"` — Font weight override
4173
+ - `weight?: "bold" | "medium" | "regular"` — Font weight override
3337
4174
 
3338
4175
  Slots:
3339
4176
  - `#default` — The text.
@@ -3378,6 +4215,13 @@ Events:
3378
4215
  Slots:
3379
4216
  - `#trailing` — Custom trailing content (e.g. an icon button) — replaces the built-in clear button when present
3380
4217
 
4218
+ Exposed (template ref):
4219
+ - `inputEl: HTMLInputElement | HTMLTextAreaElement | null` — The `<input>` (or `<textarea>`) element
4220
+ - `focus: (options?: FocusOptions | undefined) => void | undefined` — Focuses the field
4221
+ - `blur: () => void | undefined` — Takes focus away from the field
4222
+ - `select: () => void | undefined` — Selects all its text
4223
+ - `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)
4224
+
3381
4225
  ### MTimeline
3382
4226
 
3383
4227
  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 +4329,7 @@ Events:
3485
4329
  Semantic heading component in three sizes — a thin wrapper around `MText` at medium weight.
3486
4330
 
3487
4331
  Props:
3488
- - `size?: "medium" | "small" | "large" = "large"` — Title size (maps to headline-large/medium/small)
4332
+ - `size?: "small" | "medium" | "large" = "large"` — Title size (maps to headline-large/medium/small)
3489
4333
  - `color?: "error" | "primary" | "secondary" | "tertiary" | "on-surface-variant" | "on-surface" | "inherit" = "inherit"` — Text color
3490
4334
  - `align?: "right" | "left" | "center"` — Text alignment
3491
4335
  - `truncate?: boolean` — Truncate text with ellipsis on overflow
@@ -3555,7 +4399,7 @@ A top app bar in four M3 layouts — center-aligned, small, medium, and large
3555
4399
  Props:
3556
4400
  - `title?: string` — App bar title
3557
4401
  - `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
4402
+ - `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
4403
  - `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
4404
  - `titleAlignment?: "center" | "start" = "start"` — Medium/large only: where the title row sits (Compose's `titleHorizontalAlignment`)
3561
4405
  - `navigationIcon?: string` — Leading icon (e.g. menu, arrow_back)
@@ -3660,13 +4504,13 @@ Props:
3660
4504
  - `selected?: string | number | null = null` (v-model:selected) — Currently selected node id (single-select).
3661
4505
  - `checked?: (string | number)[] = []` (v-model:checked) — Checked node ids (checkable multi-select).
3662
4506
  - `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').
4507
+ - `defaultExpanded?: "all" | "none" | (string | number)[] = "none"` — Which nodes start expanded. 'all' | 'none' | array of ids (default: 'none').
3664
4508
  - `emptyText?: string` — Text shown when nodes is empty. Falls back to the app's configured locale's noItems string
3665
4509
 
3666
4510
  Events:
3667
4511
  - `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
4512
  - `node-click(TreeNode)` — Fires whenever a node row is clicked, alongside update:selected
4513
+ - `update:checked((string | number)[])` — Fires when a checkbox toggles a node (checkable mode)
3670
4514
 
3671
4515
  Exposed (template ref):
3672
4516
  - `expandAll: () => void`
@@ -3720,6 +4564,114 @@ export interface TreeTableRow {
3720
4564
  }
3721
4565
  ```
3722
4566
 
4567
+ ### MVideoPlayer
4568
+
4569
+ Import from `@m3ui-vue/m3ui-vue/media`.
4570
+
4571
+ 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")"`.
4572
+
4573
+ Props:
4574
+ - `src?: string` — Video URL
4575
+ - `sources?: VideoSource[]` — Several formats of the video; the browser plays the first it can
4576
+ - `poster?: string` — Image shown before playing
4577
+ - `tracks?: VideoTrack[]` — Subtitle tracks (WebVTT)
4578
+ - `chapters?: SeekBarChapter[]` — Chapters, drawn on the seek bar
4579
+ - `title?: string` — Shown at the top in full screen, and on the lock screen while playing
4580
+ - `duration?: number` — Length in seconds, for `#media` content (with a `<video>` it comes from the file)
4581
+ - `player?: MediaPlayer` — Drive this player instead of one of its own (from `useMediaPlayer()`, kept outside to survive page changes). Read once
4582
+ - `playing?: boolean` (v-model:playing) — Playing (v-model)
4583
+ - `currentTime?: number` (v-model:currentTime) — Position in seconds (v-model)
4584
+ - `rate?: number` (v-model:rate) — Playback speed (v-model)
4585
+ - `volume?: number` (v-model:volume) — Volume, 0 to 1 (v-model)
4586
+ - `muted?: boolean` (v-model:muted) — Muted (v-model)
4587
+ - `autoplay?: boolean = false` — Starts playing when mounted; muted if the browser blocks sound before a user gesture
4588
+ - `loop?: boolean = false` — Starts over at the end
4589
+ - `controls?: boolean = true` — Shows the controls. Off: just the video and its gestures
4590
+ - `hasPrevious?: boolean = false` — Adds previous and next buttons (emits `previous`); with only one of the two, the other shows disabled
4591
+ - `hasNext?: boolean = false` — Adds previous and next buttons (emits `next`); with only one of the two, the other shows disabled
4592
+ - `seekStep?: number = 10` — Seconds the skip buttons, J/L and double taps move
4593
+ - `speeds?: number[] = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]` — Speeds offered in the settings menu
4594
+ - `aspectRatio?: string = "16/9"` — Box ratio, as CSS `aspect-ratio`; `auto` follows the video
4595
+ - `fit?: "contain" | "cover" = "contain"` — How the video fills the box
4596
+ - `hideDelay?: number = 3000` — Milliseconds without activity before the controls hide while playing
4597
+ - `color?: string = "primary"` — Played part of the seek bar: an M3 role or any CSS color
4598
+ - `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)
4599
+ - `hls?: (() => Promise<HlsModule>)` — Loads hls.js for `.m3u8` where the browser can't play HLS: `() => import("hls.js")`
4600
+
4601
+ Events:
4602
+ - `error(MediaError | null)` — The video failed to load or play, with the media element's error
4603
+ - `fullscreen(boolean)` — Full screen was entered (true) or left (false)
4604
+ - `update:playing(boolean)`
4605
+ - `update:currentTime(number)`
4606
+ - `update:rate(number)`
4607
+ - `update:volume(number)`
4608
+ - `update:muted(boolean)`
4609
+ - `previous()` — The previous button (or the lock screen's) was pressed
4610
+ - `next()` — The next button (or the lock screen's) was pressed
4611
+ - `ended()` — The video reached its end
4612
+
4613
+ Slots:
4614
+ - `#media { time: number; playing: boolean; rate: number; duration: number; }` — Replaces the `<video>` (a canvas, a shader, a 3D scene). Props: `{ time, playing, rate, duration }`
4615
+ - `#error { error: MediaError; }` — Replaces the error message. Props: `{ error }`
4616
+ - `#end { player: MediaPlayer; replay: () => Promise<void>; }` — Shown over the video when it ends (an "up next", say). Props: `{ player, replay }`
4617
+ - `#top { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Top controls. Props: `VideoPlayerSlotProps`
4618
+ - `#center { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Replaces the center controls. Props: `VideoPlayerSlotProps`
4619
+ - `#bottom { player: MediaPlayer; shown: boolean; fullscreen: boolean; compact: boolean; }` — Replaces the bottom controls. Props: `VideoPlayerSlotProps`
4620
+ - `#settings { player: MediaPlayer; }` — Extra `MMenuItem`s at the end of the settings menu. Props: `{ player }`
4621
+
4622
+ ```ts
4623
+ export interface VideoSource {
4624
+ src: string
4625
+ /** MIME type, e.g. `video/webm` or `application/vnd.apple.mpegurl` (HLS) */
4626
+ type?: string
4627
+ }
4628
+ ```
4629
+
4630
+ ```ts
4631
+ export interface VideoTrack {
4632
+ /** WebVTT file */
4633
+ src: string
4634
+ /** Language code, e.g. `es` */
4635
+ srclang: string
4636
+ /** Shown in the subtitles menu */
4637
+ label: string
4638
+ /** Shown from the start */
4639
+ default?: boolean
4640
+ /** Default `subtitles` */
4641
+ kind?: 'subtitles' | 'captions'
4642
+ }
4643
+ ```
4644
+
4645
+ ```ts
4646
+ /** What the control slots receive */
4647
+ export interface VideoPlayerSlotProps {
4648
+ player: MediaPlayer
4649
+ /** The controls are showing (slots usually fade with them) */
4650
+ shown: boolean
4651
+ fullscreen: boolean
4652
+ /** The player is narrower than 480px (a phone in portrait) */
4653
+ compact: boolean
4654
+ }
4655
+ ```
4656
+
4657
+ ```ts
4658
+ /** The bits of hls.js the player uses, so the library doesn't depend on it */
4659
+ export interface HlsLike {
4660
+ loadSource(src: string): void
4661
+ attachMedia(el: HTMLMediaElement): void
4662
+ destroy(): void
4663
+ on(event: string, fn: (...args: any[]) => void): void
4664
+ levels: { height?: number; bitrate?: number }[]
4665
+ currentLevel: number
4666
+ }
4667
+ ```
4668
+
4669
+ ```ts
4670
+ export interface HlsModule {
4671
+ default: { new (config?: Record<string, unknown>): HlsLike; isSupported(): boolean; Events: Record<string, string> }
4672
+ }
4673
+ ```
4674
+
3723
4675
  ### MVirtualTable
3724
4676
 
3725
4677
  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,658 +4856,2078 @@ OpenStreetMap's Nominatim geocoder. Its public server allows one search per seco
3904
4856
  nominatimProvider(options: NominatimOptions = {}): MapSearchProvider
3905
4857
  ```
3906
4858
 
3907
- ### shapeNames
4859
+ ### useMediaPlayer
4860
+
4861
+ Import from `@m3ui-vue/m3ui-vue/media`.
4862
+
4863
+ 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
3908
4864
 
3909
4865
  ```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")[]
4866
+ useMediaPlayer(options: MediaPlayerOptions = {}): MediaPlayer
3911
4867
  ```
3912
4868
 
3913
- ### createM3UI
4869
+ ### usePdf
4870
+
4871
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
4872
+
4873
+ 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') ```
3914
4874
 
3915
4875
  ```ts
3916
- createM3UI(options: M3UIOptions = {}): {
3917
- install: (app: App<any>) => void
3918
- }
4876
+ usePdf(src: MaybeRefOrGetter<PdfSource | null | undefined>, options: PdfOptions = {}): PdfState
3919
4877
  ```
3920
4878
 
3921
- ### useTheme
4879
+ ### setPdfWorker
4880
+
4881
+ Import from `@m3ui-vue/m3ui-vue/pdf`.
4882
+
4883
+ Sets the pdf.js worker URL for every `usePdf`/`MPdfViewer` of the app (see `PdfOptions.workerSrc`)
3922
4884
 
3923
4885
  ```ts
3924
- useTheme(): {
3925
- theme: Ref<Theme>
3926
- cycle: () => void
3927
- }
4886
+ setPdfWorker(src: string): void
3928
4887
  ```
3929
4888
 
3930
- ### useColorPalette
4889
+ ### useFlow
4890
+
4891
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4892
+
4893
+ 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.
3931
4894
 
3932
4895
  ```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
- }
4896
+ useFlow(): FlowContext
3945
4897
  ```
3946
4898
 
3947
- ### palettes
4899
+ ### useFlowNode
3948
4900
 
3949
- Every palette: the built-in ones, plus `createM3UI({ customPalettes })`.
4901
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4902
+
4903
+ The node a component is rendered in (inside a `#node-<type>` slot), or null
3950
4904
 
3951
4905
  ```ts
3952
- palettes: Palette[]
4906
+ useFlowNode(): FlowNodeState | null
3953
4907
  ```
3954
4908
 
3955
- ### useConfetti
4909
+ ### getBezierPath
3956
4910
 
3957
- 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.
4911
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4912
+
4913
+ 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
3958
4914
 
3959
4915
  ```ts
3960
- useConfetti(): {
3961
- fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => StopConfetti
3962
- }
4916
+ getBezierPath(p: FlowEdgePathParams & { curvature?: number }): FlowEdgePath
3963
4917
  ```
3964
4918
 
3965
- ### fireConfetti
4919
+ ### getSmoothStepPath
3966
4920
 
3967
- 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.
4921
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4922
+
4923
+ 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
3968
4924
 
3969
4925
  ```ts
3970
- fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}): StopConfetti
4926
+ getSmoothStepPath(p: FlowEdgePathParams & { borderRadius?: number; offset?: number }): FlowEdgePath
3971
4927
  ```
3972
4928
 
3973
- ### useFireworks
4929
+ ### getStepPath
3974
4930
 
3975
- Fireworks for a component: `launch()`, `launch({ shapes: ['classic'] })`, `launch({ shapes: ['Heart'] })`, `launch({ duration: 10000 })`.
4931
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4932
+
4933
+ `getSmoothStepPath` with sharp corners
3976
4934
 
3977
4935
  ```ts
3978
- useFireworks(): {
3979
- launch: (options: FireworksOptions = {}) => StopFireworks
3980
- }
4936
+ getStepPath(p: FlowEdgePathParams & { offset?: number }): FlowEdgePath
3981
4937
  ```
3982
4938
 
3983
- ### launchFireworks
4939
+ ### getStraightPath
3984
4940
 
3985
- 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.
4941
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4942
+
4943
+ A straight line between the ends
3986
4944
 
3987
4945
  ```ts
3988
- launchFireworks(options: FireworksOptions = {}): StopFireworks
4946
+ getStraightPath(p: FlowEdgePathParams): FlowEdgePath
3989
4947
  ```
3990
4948
 
3991
- ### useReactions
4949
+ ### smoothStepPoints
3992
4950
 
3993
- Floating reactions for a component: `react(event, '🎉')` from the pointer, `react(el, { icon: 'favorite' })` from an element, `react(el, '👏', { count: 5 })` for a handful.
4951
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4952
+
4953
+ The corners of an orthogonal route between the ends, leaving and arriving square to the sides
3994
4954
 
3995
4955
  ```ts
3996
- useReactions(): {
3997
- react: (origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}) => void
3998
- }
4956
+ smoothStepPoints(p: FlowEdgePathParams & { offset?: number }): Pt[]
3999
4957
  ```
4000
4958
 
4001
- ### fireReaction
4959
+ ### arrowPath
4002
4960
 
4003
- Sends a reaction floating up from a point. Browser only.
4961
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4962
+
4963
+ An arrowhead's path at (x, y) pointing along `angle`: open (two strokes) or closed (a filled triangle's outline)
4004
4964
 
4005
4965
  ```ts
4006
- fireReaction(origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}): void
4966
+ arrowPath(x: number, y: number, angle: number, size = 10, closed = false): string
4007
4967
  ```
4008
4968
 
4009
- ### useContainerTransform
4969
+ ### layoutTree
4010
4970
 
4011
- 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"
4971
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4972
+
4973
+ 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).
4012
4974
 
4013
4975
  ```ts
4014
- useContainerTransform(): ContainerTransformController<T>
4976
+ layoutTree(nodes: FlowNode[], edges: FlowEdge[], options: FlowLayoutOptions = {}): FlowLayoutResult
4015
4977
  ```
4016
4978
 
4017
- ### SEED_PALETTE
4979
+ ### layoutLayered
4018
4980
 
4019
- The palette id used while a seed color is active (`useColorPalette().setSeed()`).
4981
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4982
+
4983
+ 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.
4020
4984
 
4021
4985
  ```ts
4022
- SEED_PALETTE: "seed"
4986
+ layoutLayered(nodes: FlowNode[], edges: FlowEdge[], options: FlowLayoutOptions = {}): FlowLayoutResult
4023
4987
  ```
4024
4988
 
4025
- ### themeInitScript
4989
+ ### parseDot
4026
4990
 
4027
- 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' }) }] }) ```
4991
+ Import from `@m3ui-vue/m3ui-vue/flow`.
4992
+
4993
+ 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.
4028
4994
 
4029
4995
  ```ts
4030
- themeInitScript(options: ThemeInitOptions = {}): string
4996
+ parseDot(source: string, options: FlowImportOptions = {}): FlowGraph
4031
4997
  ```
4032
4998
 
4033
- ### viewportFromHeaders
4999
+ ### toDot
4034
5000
 
4035
- 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) } }) ```
5001
+ Import from `@m3ui-vue/m3ui-vue/flow`.
5002
+
5003
+ 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.
4036
5004
 
4037
5005
  ```ts
4038
- viewportFromHeaders(headers: RequestHeaders, options: { guess?: boolean; storagePrefix?: string } = {}): ViewportSize | undefined
5006
+ toDot(nodes: FlowNode[], edges: FlowEdge[], options: FlowDotExportOptions = {}): string
4039
5007
  ```
4040
5008
 
4041
- ### VIEWPORT_HINTS
5009
+ ### parseMermaid
4042
5010
 
4043
- 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.
5011
+ Import from `@m3ui-vue/m3ui-vue/flow`.
5012
+
5013
+ 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.
4044
5014
 
4045
5015
  ```ts
4046
- VIEWPORT_HINTS: "Sec-CH-Viewport-Width, Sec-CH-Viewport-Height"
5016
+ parseMermaid(source: string, options: FlowImportOptions = {}): FlowGraph
4047
5017
  ```
4048
5018
 
4049
- ### generateScheme
5019
+ ### toMermaid
4050
5020
 
4051
- Generates the light and dark schemes for a seed color (`#rrggbb`).
5021
+ Import from `@m3ui-vue/m3ui-vue/flow`.
5022
+
5023
+ 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`…).
4052
5024
 
4053
5025
  ```ts
4054
- generateScheme(seed: string, options: SeedOptions = {}): Promise<GeneratedScheme>
5026
+ toMermaid(nodes: FlowNode[], edges: FlowEdge[], options: FlowExportOptions = {}): string
4055
5027
  ```
4056
5028
 
4057
- ### schemeToCss
5029
+ ### useGantt
4058
5030
 
4059
- CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css.
5031
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5032
+
5033
+ 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.
4060
5034
 
4061
5035
  ```ts
4062
- schemeToCss(scheme: GeneratedScheme, id: string): string
5036
+ useGantt(): GanttContext
4063
5037
  ```
4064
5038
 
4065
- ### schemeRoles
5039
+ ### scheduleTasks
4066
5040
 
4067
- The `--color-*` roles a generated scheme sets. `success*` is a library extension and stays as themed.
5041
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5042
+
5043
+ 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.
4068
5044
 
4069
5045
  ```ts
4070
- 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"]
5046
+ scheduleTasks(tasks: readonly T[], options: GanttScheduleOptions = {}): T[]
4071
5047
  ```
4072
5048
 
4073
- ### seedFromImage
5049
+ ### criticalPath
4074
5050
 
4075
- 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.
5051
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5052
+
5053
+ 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).
4076
5054
 
4077
5055
  ```ts
4078
- seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>
5056
+ criticalPath(tasks: readonly GanttTask[], options: { calendar?: GanttCalendar } = {}): GanttCriticalPath
4079
5057
  ```
4080
5058
 
4081
- ### seedFromPixels
5059
+ ### rollupSummaries
4082
5060
 
4083
- 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.
5061
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5062
+
5063
+ Summaries take the span of their children (deepest first) and their progress, weighted by duration. Returns the same array when nothing changes.
4084
5064
 
4085
5065
  ```ts
4086
- seedFromPixels(rgba: ArrayLike<number>): Promise<string>
5066
+ rollupSummaries(tasks: readonly T[]): T[]
4087
5067
  ```
4088
5068
 
4089
- ### useToast
5069
+ ### workingDays
5070
+
5071
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5072
+
5073
+ Working days from `start` to `end`, both included (`YYYY-MM-DD`)
4090
5074
 
4091
5075
  ```ts
4092
- useToast(): {
4093
- toasts: Ref<Toast[]>
4094
- position: Ref<ToastPosition>
4095
- show: (message: string, variant: ToastVariant = 'info', options: number | ToastOptions = {}) => number
4096
- success: (msg: string, opts?: ToastOptions) => number
4097
- error: (msg: string, opts?: ToastOptions) => number
4098
- warning: (msg: string, opts?: ToastOptions) => number
4099
- info: (msg: string, opts?: ToastOptions) => number
4100
- loading: (msg: string, opts?: Omit<ToastOptions, 'loading'>) => number
4101
- update: (id: number, patch: Partial<Omit<Toast, 'id'>>) => void
4102
- dismiss: (id: number) => void
4103
- }
5076
+ workingDays(start: string, end: string, calendar?: GanttCalendar): number
4104
5077
  ```
4105
5078
 
4106
- ### useFieldBg
5079
+ ### addWorkingDays
4107
5080
 
4108
- 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.
5081
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5082
+
5083
+ The date `n` working days after `date` (before it when negative); 0 moves a day off to the next working day
4109
5084
 
4110
5085
  ```ts
4111
- useFieldBg(containerEl: Ref<HTMLElement | null>, fieldBgProp: () => string | undefined): {
4112
- resolvedFieldBg: ComputedRef<string>
4113
- }
5086
+ addWorkingDays(date: string, n: number, calendar?: GanttCalendar): string
4114
5087
  ```
4115
5088
 
4116
- ### useLocale
5089
+ ### taskSpan
5090
+
5091
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5092
+
5093
+ A task's span in ms, end exclusive: a date-only end runs to the next midnight; a milestone has none
4117
5094
 
4118
5095
  ```ts
4119
- useLocale(): M3Locale
5096
+ taskSpan(t: Pick<GanttTask, 'start' | 'end' | 'type'>): { start: number; end: number; dateOnly: boolean; }
4120
5097
  ```
4121
5098
 
4122
- ### defaultLocale
5099
+ ### toGanttCsv
5100
+
5101
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5102
+
5103
+ 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).
4123
5104
 
4124
5105
  ```ts
4125
- defaultLocale: M3Locale
5106
+ toGanttCsv(tasks: readonly GanttTask[], options: GanttCsvOptions = {}): string
4126
5107
  ```
4127
5108
 
4128
- ### useDevice
5109
+ ### parseGanttCsv
5110
+
5111
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5112
+
5113
+ 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).
4129
5114
 
4130
5115
  ```ts
4131
- useDevice(): {
4132
- isMobile: Ref<boolean>
4133
- }
5116
+ parseGanttCsv(text: string, options: GanttCsvOptions & { dayFirst?: boolean } = {}): GanttTask<any>[]
4134
5117
  ```
4135
5118
 
4136
- ### useAutoGrow
5119
+ ### toGanttJson
4137
5120
 
4138
- 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.
5121
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5122
+
5123
+ Tasks as JSON, `{ format: 'm3ui-gantt', version: 1, tasks }`, everything included (`data` too)
4139
5124
 
4140
5125
  ```ts
4141
- useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}): {
4142
- resize: () => void
4143
- }
5126
+ toGanttJson(tasks: readonly GanttTask[], options: { space?: number } = {}): string
4144
5127
  ```
4145
5128
 
4146
- ### useThemeTokens
5129
+ ### parseGanttJson
4147
5130
 
4148
- 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 }] })) ```
5131
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5132
+
5133
+ 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.
4149
5134
 
4150
5135
  ```ts
4151
- useThemeTokens(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>, Record<T, string>>
5136
+ parseGanttJson(text: string): GanttTask<any>[]
4152
5137
  ```
4153
5138
 
4154
- ### useScrollReveal
5139
+ ### toMsProjectXml
4155
5140
 
4156
- 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.
5141
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5142
+
5143
+ 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.
4157
5144
 
4158
5145
  ```ts
4159
- useScrollReveal(target: MaybeRefOrGetter<Target>, options: ScrollRevealOptions = {}): {
4160
- stop: () => void
4161
- }
5146
+ toMsProjectXml(tasks: readonly GanttTask[], options: GanttXmlOptions = {}): string
4162
5147
  ```
4163
5148
 
4164
- ### useWindowSizeClass
5149
+ ### parseMsProjectXml
4165
5150
 
4166
- 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).
5151
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5152
+
5153
+ 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.
4167
5154
 
4168
5155
  ```ts
4169
- useWindowSizeClass(target?: MaybeRefOrGetter<HTMLElement | null | undefined>): WindowSizeClassInfo
5156
+ parseMsProjectXml(text: string, options: { dates?: 'auto' | 'date' | 'datetime' } = {}): { name?: string; tasks: GanttTask<any>[]; }
4170
5157
  ```
4171
5158
 
4172
- ### widthSizeClass
5159
+ ### useResourceTimeline
5160
+
5161
+ Import from `@m3ui-vue/m3ui-vue/gantt`.
5162
+
5163
+ The enclosing `<MResourceTimeline>`'s state and controls, from a component in its default slot
4173
5164
 
4174
5165
  ```ts
4175
- widthSizeClass(width: number): WidthSizeClass
5166
+ useResourceTimeline(): ResourceTimelineContext
4176
5167
  ```
4177
5168
 
4178
- ### heightSizeClass
5169
+ ### useDrawing
5170
+
5171
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5172
+
5173
+ The surrounding MDrawCanvas' state and actions, for a toolbar or panel of your own inside it
4179
5174
 
4180
5175
  ```ts
4181
- heightSizeClass(height: number): HeightSizeClass
5176
+ useDrawing(): DrawContext
4182
5177
  ```
4183
5178
 
4184
- ### useNotification
5179
+ ### strokePath
5180
+
5181
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5182
+
5183
+ A stroke as the SVG path of its filled outline (round caps, its width following pressure)
4185
5184
 
4186
5185
  ```ts
4187
- useNotification(): {
4188
- notifications: Ref<Notification[]>
4189
- position: Ref<NotificationPosition>
4190
- show: (message: string, variant: NotificationVariant = 'info', options: NotificationOptions = {}) => number
4191
- success: (msg: string, opts?: NotificationOptions) => number
4192
- error: (msg: string, opts?: NotificationOptions) => number
4193
- warning: (msg: string, opts?: NotificationOptions) => number
4194
- info: (msg: string, opts?: NotificationOptions) => number
4195
- loading: (msg: string, opts?: Omit<NotificationOptions, 'loading'>) => number
4196
- update: (id: number, patch: Partial<Omit<Notification, 'id'>>) => void
4197
- dismiss: (id: number) => void
4198
- }
5186
+ strokePath(s: Pick<DrawStroke, 'points' | 'size' | 'pen'>): string
4199
5187
  ```
4200
5188
 
4201
- ### useDebounce
5189
+ ### shapePath
5190
+
5191
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5192
+
5193
+ A shape's outline as an SVG path (stroked), plus an arrow's head (filled)
4202
5194
 
4203
5195
  ```ts
4204
- useDebounce(fn: (...args: any[]) => void, ms: number): {
4205
- debounced: (...args: any[]) => void
4206
- cancel: () => void
4207
- }
5196
+ shapePath(s: Pick<DrawShape, 'shape' | 'from' | 'to' | 'size'>): { d: string; head?: string; }
4208
5197
  ```
4209
5198
 
4210
- ### usePageProgress
5199
+ ### smoothPoints
4211
5200
 
4212
- 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.
5201
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5202
+
5203
+ 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.
4213
5204
 
4214
5205
  ```ts
4215
- usePageProgress(): {
4216
- progress: Ref<number>
4217
- isActive: Ref<boolean>
4218
- start: () => void
4219
- set: (pct: number) => void
4220
- done: () => void
4221
- }
5206
+ smoothPoints(points: DrawPoint[], smoothing = 0.5, size = 4): DrawPoint[]
4222
5207
  ```
4223
5208
 
4224
- ### useSpring
5209
+ ### simulatePressure
5210
+
5211
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5212
+
5213
+ Pressure made up from speed, for a mouse or a finger: slow is heavy, fast is light
4225
5214
 
4226
5215
  ```ts
4227
- useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec: SpringSpec = FAST_SPATIAL): {
4228
- snap: () => void
4229
- }
5216
+ simulatePressure(points: DrawPoint[], size: number): DrawPoint[]
4230
5217
  ```
4231
5218
 
4232
- ### motionSprings
5219
+ ### constrain
4233
5220
 
4234
- 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.
5221
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5222
+
5223
+ Holding Shift: lines snap to 45°, rects and ellipses become squares and circles
4235
5224
 
4236
5225
  ```ts
4237
- 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; }; }; }
5226
+ constrain(kind: DrawShapeKind, from: [number, number], to: [number, number]): [number, number]
4238
5227
  ```
4239
5228
 
4240
- ### motionEasings
5229
+ ### itemBox
4241
5230
 
4242
- Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`)
5231
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5232
+
5233
+ An item's bounds
4243
5234
 
4244
5235
  ```ts
4245
- 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]; }
5236
+ itemBox(item: DrawItem): DrawBox
4246
5237
  ```
4247
5238
 
4248
- ### motionDurations
5239
+ ### unionBox
4249
5240
 
4250
- Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`)
5241
+ Import from `@m3ui-vue/m3ui-vue/draw`.
4251
5242
 
4252
5243
  ```ts
4253
- 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; }
5244
+ unionBox(boxes: DrawBox[]): DrawBox | null
4254
5245
  ```
4255
5246
 
4256
- ### cubicBezier
5247
+ ### textBox
4257
5248
 
4258
- 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
5249
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5250
+
5251
+ A text's box, estimated from its characters (good enough to hit and select it)
5252
+
5253
+ ```ts
5254
+ textBox(t: Pick<DrawText, 'at' | 'text' | 'size'>): DrawBox
5255
+ ```
5256
+
5257
+ ### hitItem
5258
+
5259
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5260
+
5261
+ Whether a point (with a tolerance) touches an item
5262
+
5263
+ ```ts
5264
+ hitItem(item: DrawItem, x: number, y: number, tolerance = 4): boolean
5265
+ ```
5266
+
5267
+ ### eraseAt
5268
+
5269
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5270
+
5271
+ 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.
5272
+
5273
+ ```ts
5274
+ eraseAt(item: DrawItem, x: number, y: number, r: number): DrawItem[]
5275
+ ```
5276
+
5277
+ ### inLasso
5278
+
5279
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5280
+
5281
+ Whether a lasso (a closed polygon) takes an item: most of its points inside
5282
+
5283
+ ```ts
5284
+ inLasso(item: DrawItem, poly: [number, number][]): boolean
5285
+ ```
5286
+
5287
+ ### transformItem
5288
+
5289
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5290
+
5291
+ An item moved by (dx, dy) and scaled by (sx, sy) around (ox, oy)
5292
+
5293
+ ```ts
5294
+ transformItem(item: DrawItem, t: { dx?: number; dy?: number; sx?: number; sy?: number; ox?: number; oy?: number }): DrawItem
5295
+ ```
5296
+
5297
+ ### sortByLayer
5298
+
5299
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5300
+
5301
+ Items in drawing order: by layer, then as they come
5302
+
5303
+ ```ts
5304
+ sortByLayer(items: DrawItem[], layers?: string[]): DrawItem[]
5305
+ ```
5306
+
5307
+ ### itemSvg
5308
+
5309
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5310
+
5311
+ One item as SVG markup
5312
+
5313
+ ```ts
5314
+ itemSvg(item: DrawItem, fontFamily = 'sans-serif'): string
5315
+ ```
5316
+
5317
+ ### toDrawSvg
5318
+
5319
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5320
+
5321
+ A drawing (or one page of it) as a standalone SVG document
5322
+
5323
+ ```ts
5324
+ toDrawSvg(items: DrawItem[], opts: DrawSvgOptions = {}): string
5325
+ ```
5326
+
5327
+ ### svgToPng
5328
+
5329
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5330
+
5331
+ An SVG document rendered to a PNG blob (in a browser), `scale` times its size
5332
+
5333
+ ```ts
5334
+ svgToPng(svg: string, scale = 2): Promise<Blob>
5335
+ ```
5336
+
5337
+ ### drawId
5338
+
5339
+ Import from `@m3ui-vue/m3ui-vue/draw`.
5340
+
5341
+ ```ts
5342
+ drawId(): string
5343
+ ```
5344
+
5345
+ ### shapeNames
5346
+
5347
+ ```ts
5348
+ 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")[]
5349
+ ```
5350
+
5351
+ ### createM3UI
5352
+
5353
+ ```ts
5354
+ createM3UI(options: M3UIOptions = {}): {
5355
+ install: (app: App<any>) => void
5356
+ }
5357
+ ```
5358
+
5359
+ ### useTheme
5360
+
5361
+ ```ts
5362
+ useTheme(): {
5363
+ theme: Ref<Theme>
5364
+ cycle: () => void
5365
+ }
5366
+ ```
5367
+
5368
+ ### useColorPalette
5369
+
5370
+ ```ts
5371
+ useColorPalette(): {
5372
+ palette: Ref<string>
5373
+ palettes: Palette[]
5374
+ set: (id: PaletteId | (string & {})) => void
5375
+ seed: Readonly<Ref<{ readonly seed: string; readonly variant?: SchemeVariant; readonly contrast?: number; } | null>>
5376
+ setSeed: (seed: string, options?: SeedOptions) => Promise<void>
5377
+ contrast: Readonly<Ref<ContrastLevel>>
5378
+ activeContrast: Ref<"standard" | "medium" | "high">
5379
+ setContrast: (level: ContrastLevel) => void
5380
+ persistPalette: Ref<boolean>
5381
+ setPersistPalette: (enabled: boolean) => void
5382
+ }
5383
+ ```
5384
+
5385
+ ### palettes
5386
+
5387
+ Every palette: the built-in ones, plus `createM3UI({ customPalettes })`.
5388
+
5389
+ ```ts
5390
+ palettes: Palette[]
5391
+ ```
5392
+
5393
+ ### useConfetti
5394
+
5395
+ 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.
5396
+
5397
+ ```ts
5398
+ useConfetti(): {
5399
+ fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => StopConfetti
5400
+ }
5401
+ ```
5402
+
5403
+ ### fireConfetti
5404
+
5405
+ 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.
5406
+
5407
+ ```ts
5408
+ fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}): StopConfetti
5409
+ ```
5410
+
5411
+ ### useFireworks
5412
+
5413
+ Fireworks for a component: `launch()`, `launch({ shapes: ['classic'] })`, `launch({ shapes: ['Heart'] })`, `launch({ duration: 10000 })`.
5414
+
5415
+ ```ts
5416
+ useFireworks(): {
5417
+ launch: (options: FireworksOptions = {}) => StopFireworks
5418
+ }
5419
+ ```
5420
+
5421
+ ### launchFireworks
5422
+
5423
+ 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.
5424
+
5425
+ ```ts
5426
+ launchFireworks(options: FireworksOptions = {}): StopFireworks
5427
+ ```
5428
+
5429
+ ### useReactions
5430
+
5431
+ Floating reactions for a component: `react(event, '🎉')` from the pointer, `react(el, { icon: 'favorite' })` from an element, `react(el, '👏', { count: 5 })` for a handful.
5432
+
5433
+ ```ts
5434
+ useReactions(): {
5435
+ react: (origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}) => void
5436
+ }
5437
+ ```
5438
+
5439
+ ### fireReaction
5440
+
5441
+ Sends a reaction floating up from a point. Browser only.
5442
+
5443
+ ```ts
5444
+ fireReaction(origin: ReactionOrigin | undefined, content: ReactionContent, options: ReactionOptions = {}): void
5445
+ ```
5446
+
5447
+ ### useContainerTransform
5448
+
5449
+ 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"
5450
+
5451
+ ```ts
5452
+ useContainerTransform(): ContainerTransformController<T>
5453
+ ```
5454
+
5455
+ ### SEED_PALETTE
5456
+
5457
+ The palette id used while a seed color is active (`useColorPalette().setSeed()`).
5458
+
5459
+ ```ts
5460
+ SEED_PALETTE: "seed"
5461
+ ```
5462
+
5463
+ ### themeInitScript
5464
+
5465
+ 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' }) }] }) ```
5466
+
5467
+ ```ts
5468
+ themeInitScript(options: ThemeInitOptions = {}): string
5469
+ ```
5470
+
5471
+ ### viewportFromHeaders
5472
+
5473
+ 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) } }) ```
5474
+
5475
+ ```ts
5476
+ viewportFromHeaders(headers: RequestHeaders, options: { guess?: boolean; storagePrefix?: string } = {}): ViewportSize | undefined
5477
+ ```
5478
+
5479
+ ### VIEWPORT_HINTS
5480
+
5481
+ 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.
5482
+
5483
+ ```ts
5484
+ VIEWPORT_HINTS: "Sec-CH-Viewport-Width, Sec-CH-Viewport-Height"
5485
+ ```
5486
+
5487
+ ### generateScheme
5488
+
5489
+ Generates the light and dark schemes for a seed color (`#rrggbb`).
5490
+
5491
+ ```ts
5492
+ generateScheme(seed: string, options: SeedOptions = {}): Promise<GeneratedScheme>
5493
+ ```
5494
+
5495
+ ### schemeToCss
5496
+
5497
+ CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css.
5498
+
5499
+ ```ts
5500
+ schemeToCss(scheme: GeneratedScheme, id: string): string
5501
+ ```
5502
+
5503
+ ### schemeRoles
5504
+
5505
+ The `--color-*` roles a generated scheme sets. `success*` is a library extension and stays as themed.
5506
+
5507
+ ```ts
5508
+ 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"]
5509
+ ```
5510
+
5511
+ ### seedFromImage
5512
+
5513
+ 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.
5514
+
5515
+ ```ts
5516
+ seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>
5517
+ ```
5518
+
5519
+ ### seedFromPixels
5520
+
5521
+ 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.
5522
+
5523
+ ```ts
5524
+ seedFromPixels(rgba: ArrayLike<number>): Promise<string>
5525
+ ```
5526
+
5527
+ ### useToast
5528
+
5529
+ ```ts
5530
+ useToast(): {
5531
+ toasts: Ref<Toast[]>
5532
+ position: Ref<ToastPosition>
5533
+ show: (message: string, variant: ToastVariant = 'info', options: number | ToastOptions = {}) => number
5534
+ success: (msg: string, opts?: ToastOptions) => number
5535
+ error: (msg: string, opts?: ToastOptions) => number
5536
+ warning: (msg: string, opts?: ToastOptions) => number
5537
+ info: (msg: string, opts?: ToastOptions) => number
5538
+ loading: (msg: string, opts?: Omit<ToastOptions, 'loading'>) => number
5539
+ update: (id: number, patch: Partial<Omit<Toast, 'id'>>) => void
5540
+ dismiss: (id: number) => void
5541
+ }
5542
+ ```
5543
+
5544
+ ### useFieldBg
5545
+
5546
+ 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.
5547
+
5548
+ ```ts
5549
+ useFieldBg(containerEl: Ref<HTMLElement | null>, fieldBgProp: () => string | undefined): {
5550
+ resolvedFieldBg: ComputedRef<string>
5551
+ }
5552
+ ```
5553
+
5554
+ ### useLocale
5555
+
5556
+ ```ts
5557
+ useLocale(): M3Locale
5558
+ ```
5559
+
5560
+ ### defaultLocale
5561
+
5562
+ ```ts
5563
+ defaultLocale: M3Locale
5564
+ ```
5565
+
5566
+ ### useDevice
5567
+
5568
+ ```ts
5569
+ useDevice(): {
5570
+ isMobile: Ref<boolean>
5571
+ }
5572
+ ```
5573
+
5574
+ ### useAutoGrow
5575
+
5576
+ 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.
5577
+
5578
+ ```ts
5579
+ useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}): {
5580
+ resize: () => void
5581
+ }
5582
+ ```
5583
+
5584
+ ### useThemeTokens
5585
+
5586
+ 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 }] })) ```
5587
+
5588
+ ```ts
5589
+ useThemeTokens(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>, Record<T, string>>
5590
+ ```
5591
+
5592
+ ### useScrollReveal
5593
+
5594
+ 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.
5595
+
5596
+ ```ts
5597
+ useScrollReveal(target: MaybeRefOrGetter<Target>, options: ScrollRevealOptions = {}): {
5598
+ stop: () => void
5599
+ }
5600
+ ```
5601
+
5602
+ ### useWindowSizeClass
5603
+
5604
+ 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).
5605
+
5606
+ ```ts
5607
+ useWindowSizeClass(target?: MaybeRefOrGetter<HTMLElement | null | undefined>): WindowSizeClassInfo
5608
+ ```
5609
+
5610
+ ### widthSizeClass
5611
+
5612
+ ```ts
5613
+ widthSizeClass(width: number): WidthSizeClass
5614
+ ```
5615
+
5616
+ ### heightSizeClass
5617
+
5618
+ ```ts
5619
+ heightSizeClass(height: number): HeightSizeClass
5620
+ ```
5621
+
5622
+ ### useNotification
5623
+
5624
+ ```ts
5625
+ useNotification(): {
5626
+ notifications: Ref<Notification[]>
5627
+ position: Ref<NotificationPosition>
5628
+ show: (message: string, variant: NotificationVariant = 'info', options: NotificationOptions = {}) => number
5629
+ success: (msg: string, opts?: NotificationOptions) => number
5630
+ error: (msg: string, opts?: NotificationOptions) => number
5631
+ warning: (msg: string, opts?: NotificationOptions) => number
5632
+ info: (msg: string, opts?: NotificationOptions) => number
5633
+ loading: (msg: string, opts?: Omit<NotificationOptions, 'loading'>) => number
5634
+ update: (id: number, patch: Partial<Omit<Notification, 'id'>>) => void
5635
+ dismiss: (id: number) => void
5636
+ }
5637
+ ```
5638
+
5639
+ ### useDebounce
5640
+
5641
+ ```ts
5642
+ useDebounce(fn: (...args: any[]) => void, ms: number): {
5643
+ debounced: (...args: any[]) => void
5644
+ cancel: () => void
5645
+ }
5646
+ ```
5647
+
5648
+ ### usePageProgress
5649
+
5650
+ 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.
5651
+
5652
+ ```ts
5653
+ usePageProgress(): {
5654
+ progress: Ref<number>
5655
+ isActive: Ref<boolean>
5656
+ start: () => void
5657
+ set: (pct: number) => void
5658
+ done: () => void
5659
+ }
5660
+ ```
5661
+
5662
+ ### useSpring
5663
+
5664
+ ```ts
5665
+ useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec: SpringSpec = FAST_SPATIAL): {
5666
+ snap: () => void
5667
+ }
5668
+ ```
5669
+
5670
+ ### motionSprings
5671
+
5672
+ 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.
5673
+
5674
+ ```ts
5675
+ 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; }; }; }
5676
+ ```
5677
+
5678
+ ### motionEasings
5679
+
5680
+ Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`)
5681
+
5682
+ ```ts
5683
+ 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]; }
5684
+ ```
5685
+
5686
+ ### motionDurations
5687
+
5688
+ Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`)
5689
+
5690
+ ```ts
5691
+ 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; }
5692
+ ```
5693
+
5694
+ ### cubicBezier
5695
+
5696
+ 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
5697
+
5698
+ ```ts
5699
+ cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number
5700
+ ```
5701
+
5702
+ ### vRipple
5703
+
5704
+ 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.
5705
+
5706
+ ```ts
5707
+ vRipple: Directive<HTMLElement, RippleValue>
5708
+ ```
5709
+
5710
+ ### vReveal
5711
+
5712
+ 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`.
5713
+
5714
+ ```ts
5715
+ vReveal: Directive<HTMLElement, RevealValue>
5716
+ ```
5717
+
5718
+ ### vStateLayer
5719
+
5720
+ 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.
5721
+
5722
+ ```ts
5723
+ vStateLayer: Directive<HTMLElement, StateLayerValue>
5724
+ ```
5725
+
5726
+ ### vTooltip
5727
+
5728
+ 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.
5729
+
5730
+ ```ts
5731
+ vTooltip: Directive<HTMLElement, TooltipValue>
5732
+ ```
5733
+
5734
+ ### vFocusRing
5735
+
5736
+ 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.
5737
+
5738
+ ```ts
5739
+ vFocusRing: Directive<HTMLElement, FocusRingValue>
5740
+ ```
5741
+
5742
+ ### vScrollElevation
5743
+
5744
+ 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.
5745
+
5746
+ ```ts
5747
+ vScrollElevation: Directive<HTMLElement, ScrollElevationValue>
5748
+ ```
5749
+
5750
+ ### vLongPress
5751
+
5752
+ 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.
5753
+
5754
+ ```ts
5755
+ vLongPress: Directive<HTMLElement, LongPressValue>
5756
+ ```
5757
+
5758
+ ### vSwipe
5759
+
5760
+ 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.
5761
+
5762
+ ```ts
5763
+ vSwipe: Directive<HTMLElement, SwipeValue>
5764
+ ```
5765
+
5766
+ ### vClickOutside
5767
+
5768
+ 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.
5769
+
5770
+ ```ts
5771
+ vClickOutside: Directive<HTMLElement, ClickOutsideValue>
5772
+ ```
5773
+
5774
+ ### vSkeleton
5775
+
5776
+ 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.
5777
+
5778
+ ```ts
5779
+ vSkeleton: Directive<HTMLElement, SkeletonValue>
5780
+ ```
5781
+
5782
+ ### vSparkle
5783
+
5784
+ 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.
5785
+
5786
+ ```ts
5787
+ vSparkle: Directive<HTMLElement, SparkleValue>
5788
+ ```
5789
+
5790
+ ### useFloorPlan
5791
+
5792
+ The enclosing MFloorPlan's state and actions (inside its slots)
5793
+
5794
+ ```ts
5795
+ useFloorPlan(): FloorPlanContext
5796
+ ```
5797
+
5798
+ ### floorDecorName
5799
+
5800
+ A decor kind's name: a built-in one in the app's language (unless renamed), else its label or key
5801
+
5802
+ ```ts
5803
+ floorDecorName(kind: string, kinds: Record<string, FloorDecorKind>, locale: M3Locale): string
5804
+ ```
5805
+
5806
+ ### emojiCategories
5807
+
5808
+ ```ts
5809
+ emojiCategories: EmojiCategory[]
5810
+ ```
5811
+
5812
+ ### allEmojis
5813
+
5814
+ ```ts
5815
+ allEmojis: string[]
5816
+ ```
5817
+
5818
+ ### randomEmoji
5819
+
5820
+ ```ts
5821
+ randomEmoji(from?: string[]): string
5822
+ ```
5823
+
5824
+ ### withSkinTone
5825
+
5826
+ `emoji` with skin tone `tone` (0 = none, 1–5 = light to dark), if it takes one.
5827
+
5828
+ ```ts
5829
+ withSkinTone(emoji: string, tone: number): string
5830
+ ```
5831
+
5832
+ ### toneableEmojis
5833
+
5834
+ Emoji that take a skin tone (all five one-tone variants exist).
5835
+
5836
+ ```ts
5837
+ toneableEmojis: Set<string>
5838
+ ```
5839
+
5840
+ ### skinTones
5841
+
5842
+ The five Fitzpatrick modifiers, light to dark.
5843
+
5844
+ ```ts
5845
+ skinTones: readonly ["🏻", "🏼", "🏽", "🏾", "🏿"]
5846
+ ```
5847
+
5848
+ ## Types
5849
+
5850
+ ```ts
5851
+ /** What `MMap` provides to everything inside it. */
5852
+ export interface MapContext {
5853
+ /** The MapLibre map, once created (never on the server) */
5854
+ map: ShallowRef<Maplibre.Map | undefined>
5855
+ /** The `maplibre-gl` module, loaded with the map (so nothing imports it on the server) */
5856
+ maplibre: ShallowRef<MaplibreModule | undefined>
5857
+ /** Bumped on every `style.load`: sources and layers added by components are re-added after a style change */
5858
+ styleVersion: Ref<number>
5859
+ /** The style as `MMap`'s `adapter` reads it (undefined without one) */
5860
+ model: ShallowRef<MapLayerModel | undefined>
5861
+ /** Visibility and opacity of the model's layers */
5862
+ layerState: MapLayerState
5863
+ /**
5864
+ * The tool that owns the map's clicks right now (`'measure'` while measuring), or null: `MMapIdentify` stays quiet
5865
+ * meanwhile. Set it from tools of your own the same way
5866
+ */
5867
+ activeTool: Ref<string | null>
5868
+ }
5869
+ ```
5870
+
5871
+ ```ts
5872
+ /**
5873
+ * A map to use from outside `<MMap>`: the `MMap` itself (a template ref: `<MMap ref="map">` → `:map="map"`) or its
5874
+ * `context`. Null or undefined until it mounts.
5875
+ */
5876
+ export type MapSource = { context: MapContext } | MapContext | null | undefined
5877
+ ```
5878
+
5879
+ ```ts
5880
+ /** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
5881
+ export type MaplibreModule = typeof import('maplibre-gl')
5882
+ ```
5883
+
5884
+ ```ts
5885
+ /** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
5886
+ export interface MapLayerState {
5887
+ visible: Record<string, boolean>
5888
+ opacity: Record<string, number>
5889
+ }
5890
+ ```
5891
+
5892
+ ```ts
5893
+ /** Reads a style's conventions (usually its `metadata`) into the model the map's UI components use. */
5894
+ export type MapAdapter = (style: Maplibre.StyleSpecification, context: MapAdapterContext) => MapLayerModel
5895
+ ```
5896
+
5897
+ ```ts
5898
+ /** What an adapter gets besides the style. */
5899
+ export interface MapAdapterContext {
5900
+ /** The style's URL, when `MMap`'s `mapStyle` is one */
5901
+ styleUrl?: string
5902
+ }
5903
+ ```
5904
+
5905
+ ```ts
5906
+ /** How to show one property of a feature. */
5907
+ export interface MapFieldFormat {
5908
+ /** The label (the key, capitalized, by default) */
5909
+ label?: string
5910
+ /** Text before the value */
5911
+ prefix?: string
5912
+ /** Text after the value */
5913
+ suffix?: string
5914
+ /** A number mask: its decimals set the fraction digits (`#.00` → 2) and a comma turns on grouping (`#,###`) */
5915
+ mask?: string
5916
+ /** Leave it out */
5917
+ hidden?: boolean
5918
+ }
5919
+ ```
5920
+
5921
+ ```ts
5922
+ /** What `MMapIdentify` found on one layer at a point. */
5923
+ export interface MapIdentifyResult {
5924
+ layer: MapLayerInfo
5925
+ feature: Maplibre.MapGeoJSONFeature
5926
+ /** Its properties as the layer's `identify` shows them, formatted */
5927
+ fields: { key: string; label: string; value: string }[]
5928
+ }
5929
+ ```
5930
+
5931
+ ```ts
5932
+ /** One layer of the style, as the map's UI components see it. */
5933
+ export interface MapLayerInfo {
5934
+ /** The style layer's id */
5935
+ id: string
5936
+ /** Its name in the UI */
5937
+ title: string
5938
+ description?: string
5939
+ /** The `name` of its group in `MapLayerModel.groups` */
5940
+ group?: string
5941
+ /** Shown in `MMapLayers` */
5942
+ listed: boolean
5943
+ /** A base layer: `MMapBaseLayers` shows one of them at a time, with this thumbnail */
5944
+ base?: { image?: string }
5945
+ /** Layer ids shown, hidden and faded along with it */
5946
+ children: string[]
5947
+ /** Listed by `MMapIdentify` on click: every property, formatted by `format`, minus `exclude` */
5948
+ identify: false | { format: Record<string, MapFieldFormat>; exclude: string[] }
5949
+ /** Shown by `MMapHover` under the pointer: these properties, in order */
5950
+ hover: false | { fields: (MapFieldFormat & { key: string })[] }
5951
+ /** A legend image URL (an SVG, typically) */
5952
+ legend?: string
5953
+ /** A download URL for its data */
5954
+ download?: string
5955
+ }
5956
+ ```
5957
+
5958
+ ```ts
5959
+ /** The style as the map's UI components see it: layers with names, groups, base layers, what to identify. */
5960
+ export interface MapLayerModel {
5961
+ /** The style's name */
5962
+ title?: string
5963
+ /** Groups, in order */
5964
+ groups: { name: string; title: string }[]
5965
+ /** Layers, in the style's order (bottom to top) */
5966
+ layers: MapLayerInfo[]
5967
+ }
5968
+ ```
5969
+
5970
+ ```ts
5971
+ export interface OrvianAdapterOptions {
5972
+ /**
5973
+ * A layer's legend image. By default, for a style served by mvt-rs (`…/services/styles/<style>`), its legend service
5974
+ * (`…/services/legends/<style>?layer_id=<id>`), unless the layer's `metadata.legend.show` is false;
5975
+ * `metadata.legend.wmslegend` overrides it
5976
+ */
5977
+ legend?: (layer: Maplibre.LayerSpecification, styleUrl?: string) => string | undefined
5978
+ }
5979
+ ```
5980
+
5981
+ ```ts
5982
+ /** Finds places for `MMapSearch`: the text in, results out. `signal` aborts a search the user replaced. */
5983
+ export type MapSearchProvider = (query: string, signal: AbortSignal) => Promise<MapSearchResult[]>
5984
+ ```
5985
+
5986
+ ```ts
5987
+ /** A place found by a `MapSearchProvider`. */
5988
+ export interface MapSearchResult {
5989
+ /** What to show */
5990
+ label: string
5991
+ /** Where it is */
5992
+ lngLat: [number, number]
5993
+ /** Its extent, `[west, south, east, north]`: the map fits it instead of zooming to the point */
5994
+ bbox?: [number, number, number, number]
5995
+ /** Its kind (`city`, `road`, `park`, `restaurant`…), for the icon */
5996
+ type?: string
5997
+ }
5998
+ ```
5999
+
6000
+ ```ts
6001
+ export interface NominatimOptions {
6002
+ /** The Nominatim server (`https://nominatim.openstreetmap.org` by default; mind its usage policy, or run your own) */
6003
+ url?: string
6004
+ /** How many results (6) */
6005
+ limit?: number
6006
+ /** The results' language (`es`, `en`…); by default the page's (`<html lang>`) */
6007
+ language?: string
6008
+ /** Only these countries (ISO codes: `['ar']`) */
6009
+ countryCodes?: string[]
6010
+ /** Prefer (or with `bounded`, only) this area: `[west, south, east, north]` */
6011
+ viewbox?: [number, number, number, number]
6012
+ bounded?: boolean
6013
+ }
6014
+ ```
6015
+
6016
+ ```ts
6017
+ export interface MediaPlayer {
6018
+ /** The media element being driven, or null (clock, or not mounted yet) */
6019
+ media: Readonly<Ref<HTMLMediaElement | null>>
6020
+ /** Playing or paused; writing it plays or pauses */
6021
+ playing: WritableComputedRef<boolean>
6022
+ /** Position in seconds; writing it seeks */
6023
+ currentTime: WritableComputedRef<number>
6024
+ /** Length in seconds: 0 until known, Infinity for a live stream */
6025
+ duration: Readonly<Ref<number>>
6026
+ /** Loaded time ranges, `[[start, end], …]` (the clock reports all of it) */
6027
+ buffered: Readonly<Ref<[number, number][]>>
6028
+ /** Playback speed; writing it changes it */
6029
+ rate: WritableComputedRef<number>
6030
+ /** Volume, 0 to 1; writing it changes it */
6031
+ volume: WritableComputedRef<number>
6032
+ /** Muted; writing it mutes or unmutes */
6033
+ muted: WritableComputedRef<boolean>
6034
+ /** Stalled for data (a spinner's moment). Writable for the clock, to simulate buffering: it stops advancing meanwhile */
6035
+ waiting: Ref<boolean>
6036
+ /** Reached the end; `play()` or `toggle()` start over */
6037
+ ended: Readonly<Ref<boolean>>
6038
+ /** A live stream (infinite duration): no seeking */
6039
+ live: Readonly<Ref<boolean>>
6040
+ /** The media element's error, if loading or decoding failed */
6041
+ error: Readonly<Ref<MediaError | null>>
6042
+ /** The browser refused to start playing (autoplay with sound before any user gesture) */
6043
+ blocked: Readonly<Ref<boolean>>
6044
+ /** Whether there is a previous / next item (see the options of the same names) */
6045
+ hasPrevious: Readonly<Ref<boolean>>
6046
+ hasNext: Readonly<Ref<boolean>>
6047
+ play: () => Promise<void>
6048
+ pause: () => void
6049
+ toggle: () => Promise<void>
6050
+ /** Seeks to a time in seconds (clamped to the media) */
6051
+ seek: (time: number) => void
6052
+ /** Seeks by an offset in seconds, `seekStep` by default (negative goes back) */
6053
+ skip: (seconds?: number) => void
6054
+ /** Pauses and goes back to the start */
6055
+ stop: () => void
6056
+ previous: () => void
6057
+ next: () => void
6058
+ /**
6059
+ * Drives this element instead of the `media` option (null: the clock; undefined: back to `media`). What
6060
+ * `MVideoPlayer`/`MAudioPlayer` call with their own element when given a `player`: rate, volume and mute carry over
6061
+ */
6062
+ attach: (el: HTMLMediaElement | null | undefined) => void
6063
+ }
6064
+ ```
6065
+
6066
+ ```ts
6067
+ export interface MediaPlayerOptions {
6068
+ /**
6069
+ * The `<audio>` or `<video>` element to drive (a ref or a getter; it may come and go). Without one the player
6070
+ * runs its own clock over `duration`: for anything that isn't a media file (a canvas, a shader, generated audio)
6071
+ * that should still play, pause, seek and change speed like one.
6072
+ */
6073
+ media?: MaybeRefOrGetter<HTMLMediaElement | null | undefined>
6074
+ /** The length in seconds, for the clock (without `media`) */
6075
+ duration?: MaybeRefOrGetter<number | undefined>
6076
+ /** Shown on the lock screen and the system's media notification while this player plays (Media Session API) */
6077
+ metadata?: MaybeRefOrGetter<MediaPlayerMetadata | null | undefined>
6078
+ /** The previous button (and the lock screen's); without it there is none */
6079
+ onPrevious?: () => void
6080
+ /** The next button (and the lock screen's); without it there is none */
6081
+ onNext?: () => void
6082
+ /** Whether there is a previous item right now (the first of a playlist has none). Default: `onPrevious` was given */
6083
+ hasPrevious?: MaybeRefOrGetter<boolean>
6084
+ /** Whether there is a next item right now. Default: `onNext` was given */
6085
+ hasNext?: MaybeRefOrGetter<boolean>
6086
+ /** Seconds `skip()` and the lock screen's seek buttons move by default. Default 10 */
6087
+ seekStep?: number
6088
+ /** The clock starts over at the end instead of stopping (with `media`, set the element's `loop`) */
6089
+ loop?: MaybeRefOrGetter<boolean | undefined>
6090
+ }
6091
+ ```
6092
+
6093
+ ```ts
6094
+ /** What the lock screen and the system's media notification show (the Media Session API's metadata) */
6095
+ export interface MediaPlayerMetadata {
6096
+ title?: string
6097
+ artist?: string
6098
+ album?: string
6099
+ /** Cover images, largest last is fine: `[{ src, sizes: '512x512', type: 'image/png' }]` or plain URLs */
6100
+ artwork?: (string | { src: string; sizes?: string; type?: string })[]
6101
+ }
6102
+ ```
6103
+
6104
+ ```ts
6105
+ export type PdfDocument = Pdfjs.PDFDocumentProxy
6106
+ ```
6107
+
6108
+ ```ts
6109
+ export interface PdfMetadata {
6110
+ title?: string
6111
+ author?: string
6112
+ subject?: string
6113
+ creator?: string
6114
+ producer?: string
6115
+ creationDate?: Date
6116
+ modificationDate?: Date
6117
+ }
6118
+ ```
6119
+
6120
+ ```ts
6121
+ export interface PdfOptions {
6122
+ /** A password to try first (the `needsPassword` flow handles the rest) */
6123
+ password?: MaybeRefOrGetter<string | undefined>
6124
+ /** Send cookies with a cross-origin URL */
6125
+ withCredentials?: boolean
6126
+ /**
6127
+ * The pdf.js worker's URL (with Vite: `import workerSrc from 'pdfjs-dist/build/pdf.worker.min.mjs?url'`), or
6128
+ * set it once for the app with `setPdfWorker()`. Without one, pdf.js runs on the main thread: it works, but
6129
+ * parsing a big file blocks the page meanwhile
6130
+ */
6131
+ workerSrc?: string
6132
+ }
6133
+ ```
6134
+
6135
+ ```ts
6136
+ export interface PdfOutlineItem {
6137
+ title: string
6138
+ /** 1-based page it points to (undefined for an external link or a destination that can't be resolved) */
6139
+ page?: number
6140
+ /** Where on that page, in PDF points from the bottom, when the destination says */
6141
+ top?: number
6142
+ /** An external link */
6143
+ url?: string
6144
+ children: PdfOutlineItem[]
6145
+ }
6146
+ ```
6147
+
6148
+ ```ts
6149
+ export type PdfPage = Pdfjs.PDFPageProxy
6150
+ ```
6151
+
6152
+ ```ts
6153
+ /** A page's text as `usePdf` indexes it: its text items joined, and where each item starts */
6154
+ export interface PdfPageText {
6155
+ text: string
6156
+ /** Start offset of each text item (the text layer's spans, in order) */
6157
+ starts: number[]
6158
+ }
6159
+ ```
6160
+
6161
+ ```ts
6162
+ export interface PdfSearchMatch {
6163
+ /** 1-based page */
6164
+ page: number
6165
+ /** Index of the match on its page */
6166
+ index: number
6167
+ /** Character offsets in the page's text (see `pageText`) */
6168
+ start: number
6169
+ end: number
6170
+ /** The text around it, for a results list */
6171
+ context: string
6172
+ }
6173
+ ```
6174
+
6175
+ ```ts
6176
+ /** What `usePdf` loads: a URL, the file's bytes, or a `File`/`Blob` (an upload) */
6177
+ export type PdfSource = string | URL | Uint8Array | ArrayBuffer | Blob
6178
+ ```
6179
+
6180
+ ```ts
6181
+ export interface PdfState {
6182
+ /** The pdf.js document, once loaded */
6183
+ doc: ShallowRef<PdfDocument | null>
6184
+ /** The `pdfjs-dist` module, loaded with the first document */
6185
+ pdfjs: ShallowRef<PdfjsModule | null>
6186
+ loading: Readonly<Ref<boolean>>
6187
+ /** Download progress, 0 to 1 (0 while the size is unknown) */
6188
+ progress: Readonly<Ref<number>>
6189
+ error: Readonly<Ref<Error | null>>
6190
+ /** The file is encrypted: call `submitPassword()` */
6191
+ needsPassword: Readonly<Ref<boolean>>
6192
+ /** The last password was wrong */
6193
+ wrongPassword: Readonly<Ref<boolean>>
6194
+ submitPassword: (password: string) => void
6195
+ numPages: Readonly<Ref<number>>
6196
+ /**
6197
+ * Each page's size in PDF points at zoom 1, with its own rotation (index 0 = page 1). Every page starts as the
6198
+ * first one's size and gets its own as the pages are read, in the background
6199
+ */
6200
+ pageSizes: Readonly<Ref<{ width: number; height: number }[]>>
6201
+ outline: Readonly<Ref<PdfOutlineItem[]>>
6202
+ metadata: Readonly<Ref<PdfMetadata>>
6203
+ getPage: (page: number) => Promise<PdfPage>
6204
+ /** A page's text (cached) */
6205
+ pageText: (page: number) => Promise<PdfPageText>
6206
+ /** Finds text in every page (case and accent insensitive unless `caseSensitive`) */
6207
+ search: (query: string, options?: { caseSensitive?: boolean; signal?: AbortSignal }) => Promise<PdfSearchMatch[]>
6208
+ /** A picture of a page `width` CSS pixels wide, as an object URL (cached; revoked when the document changes) */
6209
+ thumbnail: (page: number, width?: number) => Promise<string>
6210
+ /** Resolves a link destination (a name or an explicit array) to a page and a position */
6211
+ resolveDest: (dest: unknown) => Promise<{ page: number; top?: number } | null>
6212
+ /** The file's bytes */
6213
+ getData: () => Promise<Uint8Array>
6214
+ /** Saves the file */
6215
+ download: (fileName?: string) => Promise<void>
6216
+ /** Opens the browser's print dialog for the file */
6217
+ print: () => Promise<void>
6218
+ }
6219
+ ```
6220
+
6221
+ ```ts
6222
+ /** The `pdfjs-dist` module */
6223
+ export type PdfjsModule = typeof import('pdfjs-dist')
6224
+ ```
6225
+
6226
+ ```ts
6227
+ /** What a `circle` node shows */
6228
+ export interface FlowCircleData {
6229
+ label?: string
6230
+ /** Its fill: a container role (default a neutral surface) */
6231
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral' | 'inverse'
6232
+ /** A small count or tag on its top right (a level, an excess) */
6233
+ badge?: string | number
6234
+ /** A soft halo around it, in a role's color */
6235
+ ring?: 'primary' | 'secondary' | 'tertiary' | 'error'
6236
+ /** Diameter in px (default 56) */
6237
+ size?: number
6238
+ }
6239
+ ```
6240
+
6241
+ ```ts
6242
+ /** A connection being made or checked */
6243
+ export interface FlowConnection {
6244
+ source: string
6245
+ sourceHandle: string | null
6246
+ target: string
6247
+ targetHandle: string | null
6248
+ }
6249
+ ```
6250
+
6251
+ ```ts
6252
+ /** What MFlow provides to everything inside it, and `useFlow()` returns */
6253
+ export interface FlowContext {
6254
+ nodes: ComputedRef<FlowNode[]>
6255
+ edges: ComputedRef<FlowEdge[]>
6256
+ viewport: Readonly<Ref<FlowViewport>>
6257
+ selection: ComputedRef<FlowSelection>
6258
+ minZoom: ComputedRef<number>
6259
+ maxZoom: ComputedRef<number>
6260
+ /** Canvas size in px */
6261
+ size: Readonly<Ref<{ width: number; height: number }>>
6262
+ /** Interaction switched off by the lock button (or MFlow's `locked`) */
6263
+ locked: Ref<boolean>
6264
+ getNode(id: string): FlowNode | undefined
6265
+ /** A node's top left corner in flow coordinates, its parents added, where it's drawn right now */
6266
+ getAbsolutePosition(id: string): FlowXY
6267
+ /** A node's measured (or set) size */
6268
+ getSize(id: string): { width: number; height: number }
6269
+ /** Nodes overlapping this one (or a rectangle in flow coordinates), groups and its own family left out */
6270
+ getIntersectingNodes(node: string | { x: number; y: number; width: number; height: number }): FlowNode[]
6271
+ /** Page (client) coordinates → flow coordinates */
6272
+ screenToFlow(p: { x: number; y: number }): FlowXY
6273
+ flowToScreen(p: FlowXY): { x: number; y: number }
6274
+ setViewport(v: Partial<FlowViewport>, opts?: { animate?: boolean }): void
6275
+ fitView(opts?: FlowFitOptions): void
6276
+ /** Centers the view on a flow point, at `zoom` or the current zoom */
6277
+ setCenter(x: number, y: number, opts?: { zoom?: number; animate?: boolean }): void
6278
+ zoomIn(): void
6279
+ zoomOut(): void
6280
+ zoomTo(zoom: number, opts?: { animate?: boolean }): void
6281
+ addNodes(nodes: FlowNode | FlowNode[]): void
6282
+ addEdges(edges: FlowEdge | FlowEdge[]): void
6283
+ updateNode(id: string, patch: Partial<FlowNode> | ((n: FlowNode) => FlowNode)): void
6284
+ updateEdge(id: string, patch: Partial<FlowEdge> | ((e: FlowEdge) => FlowEdge)): void
6285
+ /** Deletes nodes (with their edges and children) and edges by id */
6286
+ remove(ids: { nodes?: string[]; edges?: string[] }): void
6287
+ setSelection(sel: Partial<FlowSelection>): void
6288
+ /** Runs a layout over the nodes' measured sizes; default MFlow's `layout` (or the tree layout). Animated and undoable */
6289
+ layout(fn?: 'tree' | 'layered' | FlowLayout, options?: FlowLayoutOptions): Promise<void>
6290
+ undo(): void
6291
+ redo(): void
6292
+ canUndo: ComputedRef<boolean>
6293
+ canRedo: ComputedRef<boolean>
6294
+ copy(): void
6295
+ cut(): void
6296
+ /** Pastes what was copied, at a flow point (default a step from the originals) */
6297
+ paste(at?: FlowXY): void
6298
+ /**
6299
+ * Drags a node with a pointer that's already down, e.g. one just added from a palette outside the canvas: it
6300
+ * follows the pointer from there (guides, splicing into an edge) until it's let go. With a finger, the page
6301
+ * doesn't scroll under it meanwhile (start the drag from a long press, so a swipe still scrolls your palette)
6302
+ */
6303
+ startDrag(id: string, e: PointerEvent): void
6304
+ }
6305
+ ```
6306
+
6307
+ ```ts
6308
+ export interface FlowEdge<D = any> {
6309
+ id: string
6310
+ source: string
6311
+ target: string
6312
+ /** The handle's `id` when its node has several */
6313
+ sourceHandle?: string | null
6314
+ targetHandle?: string | null
6315
+ /** `bezier` (default), `smoothstep`, `step`, `straight`, or a `#edge-<type>` slot */
6316
+ type?: string
6317
+ /**
6318
+ * For a `#edge-<type>` slot: how it's routed, which is the `path` the slot gets and where the edge is hit
6319
+ * (default `bezier`)
6320
+ */
6321
+ pathType?: 'bezier' | 'smoothstep' | 'step' | 'straight'
6322
+ label?: string
6323
+ /** The label chip's color (default a neutral chip) */
6324
+ labelTone?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral'
6325
+ /** Dashes that flow from source to target (`'reverse'`: from target to source) */
6326
+ animated?: boolean | 'reverse'
6327
+ /** The line's (and arrowhead's) color: an M3 role (`primary`, `tertiary`, `error`, `outline`…) or any CSS color. Changes animate */
6328
+ color?: string
6329
+ /** The line's width in px (default 2). Changes animate */
6330
+ width?: number
6331
+ /** A dashed line, standing still */
6332
+ dashed?: boolean
6333
+ /** Default `arrow-closed` */
6334
+ markerEnd?: FlowMarker
6335
+ markerStart?: FlowMarker
6336
+ data?: D
6337
+ hidden?: boolean
6338
+ selectable?: boolean
6339
+ deletable?: boolean
6340
+ /** Its ends can be dragged to other handles once selected; default MFlow's `edgesReconnectable` */
6341
+ reconnectable?: boolean
6342
+ class?: string
6343
+ }
6344
+ ```
6345
+
6346
+ ```ts
6347
+ export interface FlowFitOptions {
6348
+ /** Room around the nodes, a fraction of the view (default 0.1) */
6349
+ padding?: number
6350
+ /** Only these nodes */
6351
+ nodes?: string[]
6352
+ maxZoom?: number
6353
+ minZoom?: number
6354
+ /** Default true */
6355
+ animate?: boolean
6356
+ }
6357
+ ```
6358
+
6359
+ ```ts
6360
+ /** A handle as measured: its center relative to its node's corner, in flow units */
6361
+ export interface FlowHandleBounds {
6362
+ id: string | null
6363
+ type: 'source' | 'target'
6364
+ position: FlowPosition
6365
+ x: number
6366
+ y: number
6367
+ connectable: boolean
6368
+ }
6369
+ ```
6370
+
6371
+ ```ts
6372
+ export type FlowMarker = 'arrow' | 'arrow-closed' | 'none'
6373
+ ```
6374
+
6375
+ ```ts
6376
+ /**
6377
+ * A node. Treat nodes as immutable: MFlow emits new arrays with new objects for whatever changed (`v-model:nodes`),
6378
+ * and the history (undo) keeps the old ones.
6379
+ */
6380
+ export interface FlowNode<D = any> {
6381
+ id: string
6382
+ /**
6383
+ * How it's drawn: `default` (an MFlowNode with a handle each side), `input` (only a source), `output` (only a
6384
+ * target), `circle` (a round vertex, see `FlowCircleData`), `group` (a container for nodes whose `parentId` is this
6385
+ * one), or any name you give a `#node-<type>` slot
6386
+ */
6387
+ type?: string
6388
+ /** Its top left corner, in flow coordinates (relative to the parent's corner when it has a `parentId`) */
6389
+ position: FlowXY
6390
+ /** Anything; the default node shows `label`, `subtitle` and `icon` */
6391
+ data?: D
6392
+ /** A fixed size; otherwise it's measured. A `group` without one wraps its children */
6393
+ width?: number
6394
+ height?: number
6395
+ /** The group this node sits in: it moves with it */
6396
+ parentId?: string
6397
+ /** `'parent'` keeps it inside its group */
6398
+ extent?: 'parent'
6399
+ /** Where the default node's handles go; default from MFlow's `direction` */
6400
+ sourcePosition?: FlowPosition
6401
+ targetPosition?: FlowPosition
6402
+ hidden?: boolean
6403
+ draggable?: boolean
6404
+ selectable?: boolean
6405
+ connectable?: boolean
6406
+ deletable?: boolean
6407
+ /** `false` keeps it from splicing into an edge when dropped onto one */
6408
+ insertable?: boolean
6409
+ class?: string
6410
+ }
6411
+ ```
4259
6412
 
4260
6413
  ```ts
4261
- cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number
6414
+ export interface FlowSelection { nodes: string[]; edges: string[] }
4262
6415
  ```
4263
6416
 
4264
- ### vRipple
4265
-
4266
- 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.
4267
-
4268
6417
  ```ts
4269
- vRipple: Directive<HTMLElement, RippleValue>
6418
+ /** The view: `x`/`y` in px, where the flow's origin is on the canvas, and the zoom */
6419
+ export interface FlowViewport { x: number; y: number; zoom: number }
4270
6420
  ```
4271
6421
 
4272
- ### vReveal
4273
-
4274
- 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`.
4275
-
4276
6422
  ```ts
4277
- vReveal: Directive<HTMLElement, RevealValue>
6423
+ /** A point in flow coordinates */
6424
+ export interface FlowXY { x: number; y: number }
4278
6425
  ```
4279
6426
 
4280
- ### vStateLayer
4281
-
4282
- 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.
4283
-
4284
6427
  ```ts
4285
- vStateLayer: Directive<HTMLElement, StateLayerValue>
6428
+ export interface FlowEdgePath {
6429
+ /** The SVG path (`d`) */
6430
+ path: string
6431
+ /** Where the label goes: the path's middle */
6432
+ labelX: number
6433
+ labelY: number
6434
+ /** The direction the path leaves the source in, in radians (0 = right, π/2 = down) */
6435
+ sourceAngle: number
6436
+ /** The direction the path arrives at the target in, in radians: the way an arrowhead points */
6437
+ targetAngle: number
6438
+ }
4286
6439
  ```
4287
6440
 
4288
- ### vTooltip
4289
-
4290
- 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.
4291
-
4292
6441
  ```ts
4293
- vTooltip: Directive<HTMLElement, TooltipValue>
6442
+ export interface FlowEdgePathParams {
6443
+ sourceX: number
6444
+ sourceY: number
6445
+ /** Default 'bottom' */
6446
+ sourcePosition?: FlowPosition
6447
+ targetX: number
6448
+ targetY: number
6449
+ /** Default 'top' */
6450
+ targetPosition?: FlowPosition
6451
+ }
4294
6452
  ```
4295
6453
 
4296
- ### vFocusRing
6454
+ ```ts
6455
+ // Edge paths for MFlow, also exported for edges of your own (`#edge-<type>` slots). Every function takes the two
6456
+ // ends in flow coordinates plus the side of its node each end leaves from, and returns an SVG path, the point
6457
+ // where a label sits and the direction the path arrives in (for an arrowhead).
4297
6458
 
4298
- 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.
6459
+ /** A side of a node: where a handle sits and the direction an edge leaves it in */
6460
+ export type FlowPosition = 'top' | 'right' | 'bottom' | 'left'
6461
+ ```
4299
6462
 
4300
6463
  ```ts
4301
- vFocusRing: Directive<HTMLElement, FocusRingValue>
6464
+ /** A layout: MFlow's `layout` prop and `layout()` take one */
6465
+ export type FlowLayout = (
6466
+ nodes: FlowNode[],
6467
+ edges: FlowEdge[],
6468
+ options: FlowLayoutOptions & { sizes: Map<string, { width: number; height: number }>; direction: FlowLayoutDirection },
6469
+ ) => FlowLayoutResult | Promise<FlowLayoutResult>
4302
6470
  ```
4303
6471
 
4304
- ### vScrollElevation
4305
-
4306
- 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.
4307
-
4308
6472
  ```ts
4309
- vScrollElevation: Directive<HTMLElement, ScrollElevationValue>
6473
+ export type FlowLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL'
4310
6474
  ```
4311
6475
 
4312
- ### vLongPress
4313
-
4314
- 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.
4315
-
4316
6476
  ```ts
4317
- vLongPress: Directive<HTMLElement, LongPressValue>
6477
+ export interface FlowLayoutOptions {
6478
+ /** TB (top to bottom, the default for a vertical MFlow), BT, LR (default for a horizontal one) or RL */
6479
+ direction?: FlowLayoutDirection
6480
+ /** Space between neighbors in a level, px (default 40) */
6481
+ gap?: number
6482
+ /** Space between levels, px (default 80) */
6483
+ levelGap?: number
6484
+ /** Node sizes; MFlow passes the measured ones */
6485
+ sizes?: Map<string, { width: number; height: number }> | Record<string, { width: number; height: number }>
6486
+ /** Size of a node missing from `sizes` (default 180 × 60) */
6487
+ defaultSize?: { width: number; height: number }
6488
+ }
4318
6489
  ```
4319
6490
 
4320
- ### vSwipe
4321
-
4322
- 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.
4323
-
4324
6491
  ```ts
4325
- vSwipe: Directive<HTMLElement, SwipeValue>
6492
+ /** Top left corners by node id */
6493
+ export type FlowLayoutResult = Record<string, FlowXY>
4326
6494
  ```
4327
6495
 
4328
- ### vClickOutside
4329
-
4330
- 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.
4331
-
4332
6496
  ```ts
4333
- vClickOutside: Directive<HTMLElement, ClickOutsideValue>
6497
+ // Where MFlowControls / MFlowMinimap (or a panel of yours) sit over MFlow's canvas
6498
+ export type FlowPanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-right'
4334
6499
  ```
4335
6500
 
4336
- ### vSkeleton
4337
-
4338
- 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.
4339
-
4340
6501
  ```ts
4341
- vSkeleton: Directive<HTMLElement, SkeletonValue>
6502
+ /** A graph read from text */
6503
+ export interface FlowGraph {
6504
+ nodes: FlowNode[]
6505
+ edges: FlowEdge[]
6506
+ /** The graph's own direction (DOT `rankdir`, Mermaid `flowchart LR`) */
6507
+ rankdir: FlowLayoutDirection
6508
+ /** The same, as MFlow's `direction` prop */
6509
+ direction: 'horizontal' | 'vertical'
6510
+ /** False for a DOT `graph` (edges without arrows) */
6511
+ directed: boolean
6512
+ /** The DOT graph's name */
6513
+ name?: string
6514
+ /** The DOT graph's `label` */
6515
+ label?: string
6516
+ /** Every graph-level DOT attribute, as written */
6517
+ attrs: Record<string, string>
6518
+ }
4342
6519
  ```
4343
6520
 
4344
- ### vSparkle
4345
-
4346
- 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.
6521
+ ```ts
6522
+ export interface FlowImportOptions {
6523
+ /** 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) */
6524
+ layout?: 'layered' | 'tree' | false
6525
+ /** Gaps, sizes and direction for the layout (the direction defaults to the graph's own) */
6526
+ layoutOptions?: FlowLayoutOptions
6527
+ /** The type given to plain nodes (default none: MFlow's default node) */
6528
+ nodeType?: string
6529
+ /** The type given to every edge (e.g. `'smoothstep'`; default none: a bezier) */
6530
+ edgeType?: string
6531
+ }
6532
+ ```
4347
6533
 
4348
6534
  ```ts
4349
- vSparkle: Directive<HTMLElement, SparkleValue>
6535
+ export interface FlowExportOptions {
6536
+ /** The direction written (`rankdir` / `flowchart XX`): a layout direction or MFlow's `direction` (default TB) */
6537
+ direction?: FlowLayoutDirection | 'horizontal' | 'vertical'
6538
+ /** Node sizes, for `positions` (default each node's `width`/`height`, else 180 × 60) */
6539
+ sizes?: Map<string, { width: number; height: number }> | Record<string, { width: number; height: number }>
6540
+ }
4350
6541
  ```
4351
6542
 
4352
- ### emojiCategories
6543
+ ```ts
6544
+ export interface FlowDotExportOptions extends FlowExportOptions {
6545
+ /** The graph's name */
6546
+ name?: string
6547
+ /** `digraph` (default) or `graph`, whose edges have no direction */
6548
+ directed?: boolean
6549
+ /** Writes each node's place as `pos` (in points, y up), for `neato -n` */
6550
+ positions?: boolean
6551
+ }
6552
+ ```
4353
6553
 
4354
6554
  ```ts
4355
- emojiCategories: EmojiCategory[]
6555
+ /** A column of MGantt's task list */
6556
+ export interface GanttColumn {
6557
+ /** `name`, `start`, `end`, `duration` and `progress` are built in; anything else reads `task.data[key]` (or the slot `#cell-<key>`) */
6558
+ key: string
6559
+ label?: string
6560
+ /** px; the `name` column takes what's left when it has none */
6561
+ width?: number
6562
+ align?: 'start' | 'center' | 'end'
6563
+ /** Text for a cell */
6564
+ format?: (task: GanttTask) => string
6565
+ }
4356
6566
  ```
4357
6567
 
4358
- ### allEmojis
6568
+ ```ts
6569
+ /** What MGantt provides to everything inside it (MGanttControls, panels of yours), and its template ref exposes */
6570
+ export interface GanttContext {
6571
+ /** The tasks as drawn: summaries rolled up from their children */
6572
+ tasks: ComputedRef<GanttTask[]>
6573
+ selection: ComputedRef<string[]>
6574
+ /** The closest named scale to the zoom */
6575
+ scale: ComputedRef<GanttScale>
6576
+ /** The zoom, in px per day */
6577
+ pxPerDay: Readonly<Ref<number>>
6578
+ readonly: ComputedRef<boolean>
6579
+ canUndo: ComputedRef<boolean>
6580
+ canRedo: ComputedRef<boolean>
6581
+ /** Every task id whose children are hidden */
6582
+ collapsed: ComputedRef<string[]>
6583
+ undo(): void
6584
+ redo(): void
6585
+ zoomIn(): void
6586
+ zoomOut(): void
6587
+ setScale(scale: GanttScale): void
6588
+ /** Scrolls so a date (default now) sits at the view's `align` (default center) */
6589
+ scrollToDate(date?: string, opts?: { align?: 'start' | 'center'; animate?: boolean }): void
6590
+ /** Scrolls a task into view, its row and its bar */
6591
+ scrollToTask(id: string): void
6592
+ toggle(id: string, expanded?: boolean): void
6593
+ expandAll(): void
6594
+ collapseAll(): void
6595
+ setSelection(ids: string[]): void
6596
+ /** Adds tasks (after `after`, or at the end); undoable */
6597
+ addTasks(tasks: GanttTask | GanttTask[], opts?: { after?: string }): void
6598
+ updateTask(id: string, patch: Partial<GanttTask> | ((t: GanttTask) => GanttTask)): void
6599
+ /** Deletes tasks with their children and the dependencies on them */
6600
+ removeTasks(ids: string[]): void
6601
+ /** Makes `to` depend on `from` */
6602
+ link(from: string, to: string, type?: GanttDependency['type'], lag?: number): void
6603
+ unlink(from: string, to: string): void
6604
+ /** Runs `scheduleTasks` over the tasks with MGantt's calendar; undoable */
6605
+ schedule(options?: GanttScheduleOptions): void
6606
+ criticalPath: ComputedRef<GanttCriticalPath>
6607
+ /** The date (snapped) under a page x */
6608
+ dateAt(clientX: number): string
6609
+ }
6610
+ ```
4359
6611
 
4360
6612
  ```ts
4361
- allEmojis: string[]
6613
+ /** MGantt's named zoom levels */
6614
+ export type GanttScale = TimeUnit
4362
6615
  ```
4363
6616
 
4364
- ### randomEmoji
6617
+ ```ts
6618
+ /** A task. MGantt emits new arrays with new objects for whatever changed (`v-model:tasks`) */
6619
+ export interface GanttTask<D = any> {
6620
+ id: string
6621
+ name: string
6622
+ /** `YYYY-MM-DD` (whole days) or a datetime (`YYYY-MM-DDTHH:mm`, local, or ISO with a zone) */
6623
+ start: string
6624
+ /** A date is the last day (inclusive); a datetime is when it ends. A milestone needs none */
6625
+ end?: string
6626
+ /** 0 to 100 */
6627
+ progress?: number
6628
+ /** `summary` is implied for a task with children (its dates and progress roll up from them) */
6629
+ type?: 'task' | 'milestone' | 'summary'
6630
+ /** The summary task it belongs to */
6631
+ parentId?: string
6632
+ /** Its predecessors: ids (finish-to-start) or `GanttDependency` */
6633
+ dependencies?: (string | GanttDependency)[]
6634
+ /** An M3 role (default `primary`; `summary` defaults to `neutral`) */
6635
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'neutral'
6636
+ /** The plan it's compared with (MGantt's `baselines`) */
6637
+ baselineStart?: string
6638
+ baselineEnd?: string
6639
+ /** `false` keeps it from being moved, resized, linked, deleted or selected */
6640
+ draggable?: boolean
6641
+ resizable?: boolean
6642
+ linkable?: boolean
6643
+ deletable?: boolean
6644
+ selectable?: boolean
6645
+ class?: string
6646
+ data?: D
6647
+ }
6648
+ ```
4365
6649
 
4366
6650
  ```ts
4367
- randomEmoji(from?: string[]): string
6651
+ /** A predecessor of a task: finish-to-start (default), start-to-start, finish-to-finish or start-to-finish */
6652
+ export interface GanttDependency {
6653
+ /** The predecessor's id */
6654
+ id: string
6655
+ type?: 'FS' | 'SS' | 'FF' | 'SF'
6656
+ /** Days between them (negative overlaps them); working days with a calendar */
6657
+ lag?: number
6658
+ }
4368
6659
  ```
4369
6660
 
4370
- ### withSkinTone
6661
+ ```ts
6662
+ /** Which days are worked: weekdays (0 Sunday … 6 Saturday, default Monday to Friday) and holidays (`YYYY-MM-DD`) */
6663
+ export interface GanttCalendar {
6664
+ workingDays?: number[]
6665
+ holidays?: string[]
6666
+ }
6667
+ ```
4371
6668
 
4372
- `emoji` with skin tone `tone` (0 = none, 1–5 = light to dark), if it takes one.
6669
+ ```ts
6670
+ export interface GanttScheduleOptions {
6671
+ /** `'push'` (default) moves tasks only as late as their dependencies need; `'asap'` also pulls them back to the earliest they can start */
6672
+ mode?: 'push' | 'asap'
6673
+ /** Count durations and lags in working days (date-only tasks), starting on working days */
6674
+ calendar?: GanttCalendar
6675
+ }
6676
+ ```
4373
6677
 
4374
6678
  ```ts
4375
- withSkinTone(emoji: string, tone: number): string
6679
+ export interface GanttCriticalPath {
6680
+ /** Tasks with no slack (and summaries holding one) */
6681
+ tasks: string[]
6682
+ /** Dependencies on the path, as `'<predecessor>><successor>'` */
6683
+ dependencies: string[]
6684
+ /** Each task's total slack in days: how late it can finish without delaying the end */
6685
+ slack: Record<string, number>
6686
+ /** When the last task ends */
6687
+ finish: string
6688
+ }
4376
6689
  ```
4377
6690
 
4378
- ### toneableEmojis
6691
+ ```ts
6692
+ // ── CSV ───────────────────────────────────────────────────────────────────────────────────────────────────
4379
6693
 
4380
- Emoji that take a skin tone (all five one-tone variants exist).
6694
+ export interface GanttCsvOptions {
6695
+ /** Field separator (default `,`; reading, `;` and tabs are detected) */
6696
+ separator?: string
6697
+ }
6698
+ ```
4381
6699
 
4382
6700
  ```ts
4383
- toneableEmojis: Set<string>
6701
+ export interface GanttXmlOptions {
6702
+ /** The project's name */
6703
+ name?: string
6704
+ /** Working hours a date-only task's days run, for Project's datetimes (default 8 to 17) */
6705
+ dayStart?: number
6706
+ dayEnd?: number
6707
+ }
4384
6708
  ```
4385
6709
 
4386
- ### skinTones
4387
-
4388
- The five Fitzpatrick modifiers, light to dark.
4389
-
4390
6710
  ```ts
4391
- skinTones: readonly ["🏻", "🏼", "🏽", "🏾", "🏿"]
6711
+ /** A booking on a resource's row: a shift, a reservation, a job */
6712
+ export interface TimelineEvent<D = any> {
6713
+ id: string
6714
+ /** The resource (row) it's on */
6715
+ resourceId: string
6716
+ /** A datetime (`YYYY-MM-DDTHH:mm`, local, or ISO with a zone), or `YYYY-MM-DD` for whole days */
6717
+ start: string
6718
+ /** A datetime is when it ends; a date is the last day (inclusive) */
6719
+ end: string
6720
+ title: string
6721
+ subtitle?: string
6722
+ /** An M3 role (default the resource's, else `primary`) */
6723
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'neutral'
6724
+ /** `false` keeps it from being moved (in time or to another resource), resized, deleted or selected */
6725
+ draggable?: boolean
6726
+ resizable?: boolean
6727
+ deletable?: boolean
6728
+ selectable?: boolean
6729
+ class?: string
6730
+ data?: D
6731
+ }
4392
6732
  ```
4393
6733
 
4394
- ## Types
6734
+ ```ts
6735
+ /** A row: a person, a table, a room, a machine */
6736
+ export interface TimelineResource<D = any> {
6737
+ id: string
6738
+ name: string
6739
+ subtitle?: string
6740
+ /** Rows with the same group sit under a header that folds */
6741
+ group?: string
6742
+ /** A picture; else `icon`, else initials */
6743
+ avatar?: string
6744
+ icon?: string
6745
+ color?: TimelineEvent['color']
6746
+ /** Bookings it can hold at once before they conflict (default 1) */
6747
+ capacity?: number
6748
+ data?: D
6749
+ }
6750
+ ```
4395
6751
 
4396
6752
  ```ts
4397
- /** What `MMap` provides to everything inside it. */
4398
- export interface MapContext {
4399
- /** The MapLibre map, once created (never on the server) */
4400
- map: ShallowRef<Maplibre.Map | undefined>
4401
- /** The `maplibre-gl` module, loaded with the map (so nothing imports it on the server) */
4402
- maplibre: ShallowRef<MaplibreModule | undefined>
4403
- /** Bumped on every `style.load`: sources and layers added by components are re-added after a style change */
4404
- styleVersion: Ref<number>
4405
- /** The style as `MMap`'s `adapter` reads it (undefined without one) */
4406
- model: ShallowRef<MapLayerModel | undefined>
4407
- /** Visibility and opacity of the model's layers */
4408
- layerState: MapLayerState
4409
- /**
4410
- * The tool that owns the map's clicks right now (`'measure'` while measuring), or null: `MMapIdentify` stays quiet
4411
- * meanwhile. Set it from tools of your own the same way
4412
- */
4413
- activeTool: Ref<string | null>
6753
+ /** What MResourceTimeline provides to components in its default slot, and its template ref exposes */
6754
+ export interface ResourceTimelineContext {
6755
+ events: ComputedRef<TimelineEvent[]>
6756
+ selection: ComputedRef<string[]>
6757
+ /** Ids of events that overlap more than their resource's capacity */
6758
+ conflicts: ComputedRef<Set<string>>
6759
+ scale: ComputedRef<GanttScale>
6760
+ pxPerDay: Readonly<Ref<number>>
6761
+ canUndo: ComputedRef<boolean>
6762
+ canRedo: ComputedRef<boolean>
6763
+ undo(): void
6764
+ redo(): void
6765
+ zoomIn(): void
6766
+ zoomOut(): void
6767
+ setScale(scale: GanttScale): void
6768
+ scrollToDate(date?: string, opts?: { align?: 'start' | 'center'; animate?: boolean }): void
6769
+ scrollToEvent(id: string): void
6770
+ setSelection(ids: string[]): void
6771
+ addEvents(events: TimelineEvent | TimelineEvent[]): void
6772
+ updateEvent(id: string, patch: Partial<TimelineEvent> | ((e: TimelineEvent) => TimelineEvent)): void
6773
+ removeEvents(ids: string[]): void
6774
+ /** The time (snapped, as a datetime) under a page x */
6775
+ dateAt(clientX: number): string
6776
+ /** The resource whose row is under a page y */
6777
+ resourceAt(clientY: number): TimelineResource | undefined
4414
6778
  }
4415
6779
  ```
4416
6780
 
4417
6781
  ```ts
4418
- /**
4419
- * A map to use from outside `<MMap>`: the `MMap` itself (a template ref: `<MMap ref="map">` → `:map="map"`) or its
4420
- * `context`. Null or undefined until it mounts.
4421
- */
4422
- export type MapSource = { context: MapContext } | MapContext | null | undefined
6782
+ /** What MGanttControls drives, in an MGantt or an MResourceTimeline */
6783
+ export interface TimelineControls {
6784
+ scale: ComputedRef<GanttScale>
6785
+ readonly: ComputedRef<boolean>
6786
+ canUndo: ComputedRef<boolean>
6787
+ canRedo: ComputedRef<boolean>
6788
+ /** Whether anything can fold (summaries, resource groups) and whether something is folded */
6789
+ foldable: ComputedRef<boolean>
6790
+ folded: ComputedRef<boolean>
6791
+ undo(): void
6792
+ redo(): void
6793
+ zoomIn(): void
6794
+ zoomOut(): void
6795
+ setScale(scale: GanttScale): void
6796
+ scrollToDate(date?: string): void
6797
+ expandAll(): void
6798
+ collapseAll(): void
6799
+ }
4423
6800
  ```
4424
6801
 
4425
6802
  ```ts
4426
- /** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
4427
- export type MaplibreModule = typeof import('maplibre-gl')
6803
+ /** What a pointer does on an MDrawCanvas */
6804
+ export type DrawTool = DrawPen | 'eraser' | 'stroke-eraser' | DrawShapeKind | 'text' | 'select' | 'pan'
6805
+ ```
6806
+
6807
+ ```ts
6808
+ /** What an MDrawCanvas shares with MDrawToolbar, MDrawLayers and anything built with useDrawing() inside it */
6809
+ export interface DrawContext {
6810
+ tool: Ref<DrawTool>
6811
+ color: Ref<string>
6812
+ size: Ref<number>
6813
+ /** New rects and ellipses are filled with the color */
6814
+ fill: Ref<boolean>
6815
+ items: ComputedRef<DrawItem[]>
6816
+ selection: Ref<string[]>
6817
+ layers: ComputedRef<DrawLayer[]>
6818
+ setLayers(layers: DrawLayer[]): void
6819
+ /** The layer new items go on */
6820
+ layer: Ref<string | undefined>
6821
+ mode: ComputedRef<'infinite' | 'pages'>
6822
+ pages: Ref<number>
6823
+ addPage(): void
6824
+ zoom: ComputedRef<number>
6825
+ zoomIn(): void
6826
+ zoomOut(): void
6827
+ fitView(): void
6828
+ canUndo: ComputedRef<boolean>
6829
+ canRedo: ComputedRef<boolean>
6830
+ undo(): void
6831
+ redo(): void
6832
+ clear(): void
6833
+ deleteSelection(): void
6834
+ exportSvg(opts?: DrawExportOptions): string
6835
+ exportPng(opts?: DrawExportOptions): Promise<Blob>
6836
+ }
4428
6837
  ```
4429
6838
 
4430
6839
  ```ts
4431
- /** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
4432
- export interface MapLayerState {
4433
- visible: Record<string, boolean>
4434
- opacity: Record<string, number>
6840
+ export interface DrawExportOptions {
6841
+ /** In `mode="pages"`: the page to export (default 0) */
6842
+ page?: number
6843
+ /** PNG: pixels per drawing unit (default 2) */
6844
+ scale?: number
6845
+ /** Paint the paper color behind the drawing (default true) */
6846
+ background?: boolean
4435
6847
  }
4436
6848
  ```
4437
6849
 
4438
6850
  ```ts
4439
- /** Reads a style's conventions (usually its `metadata`) into the model the map's UI components use. */
4440
- export type MapAdapter = (style: Maplibre.StyleSpecification, context: MapAdapterContext) => MapLayerModel
6851
+ export type DrawItem = DrawStroke | DrawShape | DrawText
4441
6852
  ```
4442
6853
 
4443
6854
  ```ts
4444
- /** What an adapter gets besides the style. */
4445
- export interface MapAdapterContext {
4446
- /** The style's URL, when `MMap`'s `mapStyle` is one */
4447
- styleUrl?: string
6855
+ export interface DrawStroke extends DrawItemBase {
6856
+ type: 'stroke'
6857
+ pen: DrawPen
6858
+ /** Width at full pressure, in drawing units */
6859
+ size: number
6860
+ points: DrawPoint[]
4448
6861
  }
4449
6862
  ```
4450
6863
 
4451
6864
  ```ts
4452
- /** How to show one property of a feature. */
4453
- export interface MapFieldFormat {
4454
- /** The label (the key, capitalized, by default) */
4455
- label?: string
4456
- /** Text before the value */
4457
- prefix?: string
4458
- /** Text after the value */
4459
- suffix?: string
4460
- /** A number mask: its decimals set the fraction digits (`#.00` → 2) and a comma turns on grouping (`#,###`) */
4461
- mask?: string
4462
- /** Leave it out */
4463
- hidden?: boolean
6865
+ export interface DrawShape extends DrawItemBase {
6866
+ type: 'shape'
6867
+ shape: DrawShapeKind
6868
+ from: [number, number]
6869
+ to: [number, number]
6870
+ size: number
6871
+ /** Fill of a rect or an ellipse (`null`/absent: none) */
6872
+ fill?: string | null
4464
6873
  }
4465
6874
  ```
4466
6875
 
4467
6876
  ```ts
4468
- /** What `MMapIdentify` found on one layer at a point. */
4469
- export interface MapIdentifyResult {
4470
- layer: MapLayerInfo
4471
- feature: Maplibre.MapGeoJSONFeature
4472
- /** Its properties as the layer's `identify` shows them, formatted */
4473
- fields: { key: string; label: string; value: string }[]
6877
+ export interface DrawText extends DrawItemBase {
6878
+ type: 'text'
6879
+ /** Top-left corner */
6880
+ at: [number, number]
6881
+ text: string
6882
+ /** Font size */
6883
+ size: number
4474
6884
  }
4475
6885
  ```
4476
6886
 
4477
6887
  ```ts
4478
- /** One layer of the style, as the map's UI components see it. */
4479
- export interface MapLayerInfo {
4480
- /** The style layer's id */
6888
+ export interface DrawLayer {
4481
6889
  id: string
4482
- /** Its name in the UI */
4483
- title: string
4484
- description?: string
4485
- /** The `name` of its group in `MapLayerModel.groups` */
4486
- group?: string
4487
- /** Shown in `MMapLayers` */
4488
- listed: boolean
4489
- /** A base layer: `MMapBaseLayers` shows one of them at a time, with this thumbnail */
4490
- base?: { image?: string }
4491
- /** Layer ids shown, hidden and faded along with it */
4492
- children: string[]
4493
- /** Listed by `MMapIdentify` on click: every property, formatted by `format`, minus `exclude` */
4494
- identify: false | { format: Record<string, MapFieldFormat>; exclude: string[] }
4495
- /** Shown by `MMapHover` under the pointer: these properties, in order */
4496
- hover: false | { fields: (MapFieldFormat & { key: string })[] }
4497
- /** A legend image URL (an SVG, typically) */
4498
- legend?: string
4499
- /** A download URL for its data */
4500
- download?: string
6890
+ name: string
6891
+ visible?: boolean
6892
+ locked?: boolean
4501
6893
  }
4502
6894
  ```
4503
6895
 
4504
6896
  ```ts
4505
- /** The style as the map's UI components see it: layers with names, groups, base layers, what to identify. */
4506
- export interface MapLayerModel {
4507
- /** The style's name */
4508
- title?: string
4509
- /** Groups, in order */
4510
- groups: { name: string; title: string }[]
4511
- /** Layers, in the style's order (bottom to top) */
4512
- layers: MapLayerInfo[]
4513
- }
6897
+ // The Drawing family's data and geometry: strokes with pressure turned into filled outlines, shapes, text, hit tests,
6898
+ // the stroke-cutting eraser, moving and scaling, and SVG export. Pure functions, no Vue, so they work on the server
6899
+ // and in tests, and an app can render or process a drawing without the canvas.
6900
+
6901
+ /** A point of a stroke: x, y, and the pressure (0–1) */
6902
+ export type DrawPoint = [x: number, y: number, pressure: number]
4514
6903
  ```
4515
6904
 
4516
6905
  ```ts
4517
- export interface OrvianAdapterOptions {
4518
- /**
4519
- * A layer's legend image. By default, for a style served by mvt-rs (`…/services/styles/<style>`), its legend service
4520
- * (`…/services/legends/<style>?layer_id=<id>`), unless the layer's `metadata.legend.show` is false;
4521
- * `metadata.legend.wmslegend` overrides it
4522
- */
4523
- legend?: (layer: Maplibre.LayerSpecification, styleUrl?: string) => string | undefined
4524
- }
6906
+ export type DrawPen = 'pen' | 'brush' | 'marker' | 'highlighter'
4525
6907
  ```
4526
6908
 
4527
6909
  ```ts
4528
- /** Finds places for `MMapSearch`: the text in, results out. `signal` aborts a search the user replaced. */
4529
- export type MapSearchProvider = (query: string, signal: AbortSignal) => Promise<MapSearchResult[]>
6910
+ export type DrawShapeKind = 'line' | 'arrow' | 'rect' | 'ellipse'
4530
6911
  ```
4531
6912
 
4532
6913
  ```ts
4533
- /** A place found by a `MapSearchProvider`. */
4534
- export interface MapSearchResult {
4535
- /** What to show */
4536
- label: string
4537
- /** Where it is */
4538
- lngLat: [number, number]
4539
- /** Its extent, `[west, south, east, north]`: the map fits it instead of zooming to the point */
4540
- bbox?: [number, number, number, number]
4541
- /** Its kind (`city`, `road`, `park`, `restaurant`…), for the icon */
4542
- type?: string
4543
- }
6914
+ export interface DrawBox { x: number; y: number; width: number; height: number }
4544
6915
  ```
4545
6916
 
4546
6917
  ```ts
4547
- export interface NominatimOptions {
4548
- /** The Nominatim server (`https://nominatim.openstreetmap.org` by default; mind its usage policy, or run your own) */
4549
- url?: string
4550
- /** How many results (6) */
4551
- limit?: number
4552
- /** The results' language (`es`, `en`…); by default the page's (`<html lang>`) */
4553
- language?: string
4554
- /** Only these countries (ISO codes: `['ar']`) */
4555
- countryCodes?: string[]
4556
- /** Prefer (or with `bounded`, only) this area: `[west, south, east, north]` */
4557
- viewbox?: [number, number, number, number]
4558
- bounded?: boolean
6918
+ export interface DrawSvgOptions {
6919
+ /** The area to export (default: the items' bounds plus `padding`) */
6920
+ box?: DrawBox
6921
+ padding?: number
6922
+ /** A background fill (default: none, transparent) */
6923
+ background?: string
6924
+ /** Only the items of this page */
6925
+ page?: number
6926
+ /** Leave out these layers (hidden ones, say) */
6927
+ hiddenLayers?: string[]
6928
+ /** The layers' order, bottom first (items of other layers go first) */
6929
+ layers?: string[]
6930
+ fontFamily?: string
4559
6931
  }
4560
6932
  ```
4561
6933
 
@@ -5131,6 +7503,212 @@ export interface M3Locale {
5131
7503
  /** MTimeline's button past `limit`; `{count}` is how many entries are hidden */
5132
7504
  timelineShowMore: string
5133
7505
  timelineShowLess: string
7506
+ // Media players (MVideoPlayer, MAudioPlayer); `{seconds}` is the skip length
7507
+ mediaPlayer: string
7508
+ mediaPlay: string
7509
+ mediaPause: string
7510
+ mediaReplay: string
7511
+ mediaSeekBack: string
7512
+ mediaSeekForward: string
7513
+ mediaSeconds: string
7514
+ mediaMute: string
7515
+ mediaUnmute: string
7516
+ mediaVolume: string
7517
+ mediaFullscreen: string
7518
+ mediaExitFullscreen: string
7519
+ mediaPictureInPicture: string
7520
+ mediaSettings: string
7521
+ mediaSpeed: string
7522
+ mediaSpeedNormal: string
7523
+ mediaSubtitles: string
7524
+ mediaSubtitlesOff: string
7525
+ mediaQuality: string
7526
+ mediaQualityAuto: string
7527
+ mediaLive: string
7528
+ mediaError: string
7529
+ mediaRepeat: string
7530
+ mediaRepeatOne: string
7531
+ mediaShuffle: string
7532
+ // MPdfViewer; `{current}`/`{total}` count search matches
7533
+ pdfViewer: string
7534
+ pdfThumbnails: string
7535
+ pdfOutline: string
7536
+ pdfPage: string
7537
+ pdfZoom: string
7538
+ pdfZoomIn: string
7539
+ pdfZoomOut: string
7540
+ pdfFitWidth: string
7541
+ pdfFitPage: string
7542
+ pdfSearch: string
7543
+ pdfSearchPrevious: string
7544
+ pdfSearchNext: string
7545
+ pdfMatchCount: string
7546
+ pdfNoMatches: string
7547
+ pdfMore: string
7548
+ pdfRotate: string
7549
+ pdfDownload: string
7550
+ pdfPrint: string
7551
+ pdfFullscreen: string
7552
+ pdfExitFullscreen: string
7553
+ pdfPassword: string
7554
+ pdfPasswordLabel: string
7555
+ pdfWrongPassword: string
7556
+ pdfOpen: string
7557
+ pdfError: string
7558
+ pdfLoading: string
7559
+ pdfAnnotate: string
7560
+ pdfSelect: string
7561
+ pdfHighlight: string
7562
+ pdfNote: string
7563
+ pdfDraw: string
7564
+ pdfEraser: string
7565
+ pdfInkWidth: string
7566
+ pdfColor: string
7567
+ pdfUndo: string
7568
+ pdfCopy: string
7569
+ pdfDelete: string
7570
+ pdfNotePlaceholder: string
7571
+ pdfAddComment: string
7572
+ flowCanvas: string
7573
+ flowNode: string
7574
+ flowEdge: string
7575
+ flowZoomIn: string
7576
+ flowZoomOut: string
7577
+ flowFitView: string
7578
+ flowLock: string
7579
+ flowUnlock: string
7580
+ flowUndo: string
7581
+ flowRedo: string
7582
+ flowMinimap: string
7583
+ flowMoved: string
7584
+ flowConnected: string
7585
+ flowDeleted: string
7586
+ flowDeleteEdge: string
7587
+ flowDelete: string
7588
+ ganttChart: string
7589
+ ganttTask: string
7590
+ ganttStart: string
7591
+ ganttEnd: string
7592
+ ganttDuration: string
7593
+ ganttProgress: string
7594
+ ganttDays: string
7595
+ ganttHours: string
7596
+ ganttMilestone: string
7597
+ ganttQuarter: string
7598
+ ganttToday: string
7599
+ ganttZoomIn: string
7600
+ ganttZoomOut: string
7601
+ ganttExpandAll: string
7602
+ ganttCollapseAll: string
7603
+ ganttExpand: string
7604
+ ganttCollapse: string
7605
+ ganttUndo: string
7606
+ ganttRedo: string
7607
+ ganttScaleHour: string
7608
+ ganttScaleDay: string
7609
+ ganttScaleWeek: string
7610
+ ganttScaleMonth: string
7611
+ ganttScaleQuarter: string
7612
+ ganttScaleYear: string
7613
+ ganttMoved: string
7614
+ ganttProgressSet: string
7615
+ ganttLinked: string
7616
+ ganttUnlink: string
7617
+ ganttDeleted: string
7618
+ ganttDelete: string
7619
+ ganttReordered: string
7620
+ ganttSlack: string
7621
+ ganttCritical: string
7622
+ ganttBaseline: string
7623
+ ganttEmpty: string
7624
+ ganttResize: string
7625
+ timelineResource: string
7626
+ timelineConflict: string
7627
+ timelineMoved: string
7628
+ timelineEmpty: string
7629
+ cropArea: string
7630
+ cropRotateLeft: string
7631
+ cropRotateRight: string
7632
+ cropFlip: string
7633
+ cropReset: string
7634
+ cropFree: string
7635
+ drawCanvas: string
7636
+ drawTools: string
7637
+ drawMore: string
7638
+ drawSelect: string
7639
+ drawPan: string
7640
+ drawPen: string
7641
+ drawBrush: string
7642
+ drawMarker: string
7643
+ drawHighlighter: string
7644
+ drawEraser: string
7645
+ drawStrokeEraser: string
7646
+ drawLine: string
7647
+ drawArrow: string
7648
+ drawRect: string
7649
+ drawEllipse: string
7650
+ drawText: string
7651
+ drawFill: string
7652
+ drawColor: string
7653
+ floorPlan: string
7654
+ floorSeats: string
7655
+ floorRotate: string
7656
+ floorTools: string
7657
+ floorMove: string
7658
+ floorDrawWall: string
7659
+ floorDrawZone: string
7660
+ floorAddTable: string
7661
+ floorAddDecor: string
7662
+ floorDuplicate: string
7663
+ floorDelete: string
7664
+ floorUndo: string
7665
+ floorRedo: string
7666
+ floorLabel: string
7667
+ floorSeatsField: string
7668
+ floorShape: string
7669
+ floorRound: string
7670
+ floorSquare: string
7671
+ floorLong: string
7672
+ floorAngle: string
7673
+ floorColor: string
7674
+ floorThickness: string
7675
+ floorWidth: string
7676
+ floorHeight: string
7677
+ floorMerge: string
7678
+ floorSplit: string
7679
+ floorNothingPicked: string
7680
+ floorTablesPicked: string
7681
+ floorTableN: string
7682
+ floorZone: string
7683
+ floorWall: string
7684
+ floorDeleteCorner: string
7685
+ floorFinishWall: string
7686
+ floorCancel: string
7687
+ floorDecorDoor: string
7688
+ floorDecorWindow: string
7689
+ floorDecorPlant: string
7690
+ floorDecorColumn: string
7691
+ floorDecorRestroom: string
7692
+ floorDecorKitchen: string
7693
+ floorDecorRegister: string
7694
+ floorDecorStairs: string
7695
+ floorDecorLabel: string
7696
+ drawCustomColor: string
7697
+ drawSize: string
7698
+ drawUndo: string
7699
+ drawRedo: string
7700
+ drawDelete: string
7701
+ drawLayers: string
7702
+ drawLayer: string
7703
+ drawLayerName: string
7704
+ drawAddLayer: string
7705
+ drawDeleteLayer: string
7706
+ drawShowLayer: string
7707
+ drawHideLayer: string
7708
+ drawLockLayer: string
7709
+ drawUnlockLayer: string
7710
+ drawLayerUp: string
7711
+ drawLayerDown: string
5134
7712
  }
5135
7713
  ```
5136
7714
 
@@ -5485,6 +8063,62 @@ export interface SparkleOptions {
5485
8063
  export type SparkleValue = boolean | string | SparkleOptions | null | undefined
5486
8064
  ```
5487
8065
 
8066
+ ```ts
8067
+ /**
8068
+ * An MFloorPlan's state and actions. MFloorPlanToolbar and MFloorPlanInspector are built on it, and so can controls
8069
+ * of your own: inside the plan's slots with `useFloorPlan()`, or anywhere from its template ref (`plan.context`).
8070
+ * Every edit made through it is a step of the plan's undo history.
8071
+ */
8072
+ export interface FloorPlanContext {
8073
+ tables: Ref<FloorTable[]>
8074
+ areas: Ref<FloorArea[]>
8075
+ walls: Ref<FloorWall[]>
8076
+ decor: Ref<FloorDecor[]>
8077
+ merges: Ref<FloorMerge[]>
8078
+ selection: Ref<(string | number)[]>
8079
+ picked: Ref<FloorPick>
8080
+ tool: Ref<FloorTool>
8081
+ editable: ComputedRef<boolean>
8082
+ /** A wall is being drawn (tool `wall`): finish it (also double-click / Enter) or cancel it (Escape) */
8083
+ drawingWall: ComputedRef<boolean>
8084
+ finishWall(): void
8085
+ cancelWall(): void
8086
+ /** The decor kinds: built-in ones merged with `decorKinds` */
8087
+ kinds: ComputedRef<Record<string, FloorDecorKind>>
8088
+ statuses: ComputedRef<Record<string, FloorStatus>>
8089
+ /** The plan's size in plan units */
8090
+ size: ComputedRef<{ width: number; height: number }>
8091
+ canUndo: ComputedRef<boolean>
8092
+ canRedo: ComputedRef<boolean>
8093
+ undo(): void
8094
+ redo(): void
8095
+ /** Adds a table (at the plan's middle unless placed; numbered after the highest numbered one) and selects it */
8096
+ addTable(table?: Partial<FloorTable>): FloorTable
8097
+ /** Adds a decor item of a kind and picks it */
8098
+ addDecor(kind: string, item?: Partial<FloorDecor>): FloorDecor
8099
+ /** Changes one item (consecutive changes to the same item within a moment are one undo step) */
8100
+ update(kind: 'table', id: string | number, patch: Partial<FloorTable>): void
8101
+ update(kind: 'area', id: string | number, patch: Partial<FloorArea>): void
8102
+ update(kind: 'wall', id: string | number, patch: Partial<FloorWall>): void
8103
+ update(kind: 'decor', id: string | number, patch: Partial<FloorDecor>): void
8104
+ /** Removes what's picked (a wall's picked corner, or the whole item), or else the selected tables */
8105
+ removeSelected(): void
8106
+ removeTables(ids: (string | number)[]): void
8107
+ /** Copies the selected tables, or the picked zone or decor */
8108
+ duplicate(): void
8109
+ merge(ids?: (string | number)[], label?: string): FloorMerge | null
8110
+ split(idOrTable: string | number): void
8111
+ }
8112
+ ```
8113
+
8114
+ ```ts
8115
+ export type FloorTool = 'select' | 'wall' | 'area'
8116
+ ```
8117
+
8118
+ ```ts
8119
+ export type FloorItemKind = 'table' | 'area' | 'wall' | 'decor'
8120
+ ```
8121
+
5488
8122
  ```ts
5489
8123
  // Generated by scripts/generate-emoji-data.mjs from Unicode emoji-test.txt (Emoji 15). Don't edit by hand.
5490
8124
  // Emoji data © Unicode, Inc., under the Unicode License v3 (dist/THIRD_PARTY_LICENSES.md, scripts/licenses/unicode-license-v3.txt).
@@ -5503,7 +8137,7 @@ export interface EmojiCategory {
5503
8137
  `M3Locale` keys (pass a partial object to `createM3UI({ locale })`; presets from `@m3ui-vue/m3ui-vue/locales`:
5504
8138
  `esLocale`, `frLocale`, `ptLocale`, `deLocale`, `jaLocale`, `zhLocale`, `koLocale`):
5505
8139
 
5506
- 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
8140
+ 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, floorRotate, floorTools, floorMove, floorDrawWall, floorDrawZone, floorAddTable, floorAddDecor, floorDuplicate, floorDelete, floorUndo, floorRedo, floorLabel, floorSeatsField, floorShape, floorRound, floorSquare, floorLong, floorAngle, floorColor, floorThickness, floorWidth, floorHeight, floorMerge, floorSplit, floorNothingPicked, floorTablesPicked, floorTableN, floorZone, floorWall, floorDeleteCorner, floorFinishWall, floorCancel, floorDecorDoor, floorDecorWindow, floorDecorPlant, floorDecorColumn, floorDecorRestroom, floorDecorKitchen, floorDecorRegister, floorDecorStairs, floorDecorLabel, drawCustomColor, drawSize, drawUndo, drawRedo, drawDelete, drawLayers, drawLayer, drawLayerName, drawAddLayer, drawDeleteLayer, drawShowLayer, drawHideLayer, drawLockLayer, drawUnlockLayer, drawLayerUp, drawLayerDown
5507
8141
 
5508
8142
  ## Theme tokens
5509
8143