@m3ui-vue/m3ui-vue 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/dist/API.md +2914 -348
  2. package/dist/MButton-CuNzpoxm.js +172 -0
  3. package/dist/MButton-CuNzpoxm.js.map +1 -0
  4. package/dist/MDialog-HxEL-m58.js +173 -0
  5. package/dist/MDialog-HxEL-m58.js.map +1 -0
  6. package/dist/MIconButton-DoNotQ9v.js +282 -0
  7. package/dist/MIconButton-DoNotQ9v.js.map +1 -0
  8. package/dist/MListItem-DnPtv-hY.js +824 -0
  9. package/dist/MListItem-DnPtv-hY.js.map +1 -0
  10. package/dist/MLoadingIndicator-BQMNX6Dx.js +115 -0
  11. package/dist/MLoadingIndicator-BQMNX6Dx.js.map +1 -0
  12. package/dist/MMenuItem-Bih0h4-n.js +604 -0
  13. package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
  14. package/dist/MProgressBar-BCoruxA-.js +184 -0
  15. package/dist/MProgressBar-BCoruxA-.js.map +1 -0
  16. package/dist/MSeekBar-LURE1Ah7.js +435 -0
  17. package/dist/MSeekBar-LURE1Ah7.js.map +1 -0
  18. package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
  19. package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
  20. package/dist/MSlider-_J4IS2_z.js +691 -0
  21. package/dist/MSlider-_J4IS2_z.js.map +1 -0
  22. package/dist/MSpinner-BhkMYKOM.js +65 -0
  23. package/dist/MSpinner-BhkMYKOM.js.map +1 -0
  24. package/dist/MTextField-CkzwNBWS.js +296 -0
  25. package/dist/MTextField-CkzwNBWS.js.map +1 -0
  26. package/dist/MTooltip-B67ZDSGp.js +756 -0
  27. package/dist/MTooltip-B67ZDSGp.js.map +1 -0
  28. package/dist/_storageKeys-CYXsUBwK.js +18 -0
  29. package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
  30. package/dist/_useEscapeStack-CjndQhqg.js +19 -0
  31. package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
  32. package/dist/api.json +1 -1
  33. package/dist/chart.js +1 -1
  34. package/dist/code-editor.js +1 -1
  35. package/dist/components/MAudioPlayer.vue.d.ts +115 -0
  36. package/dist/components/MBadge.vue.d.ts +1 -1
  37. package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
  38. package/dist/components/MBox.vue.d.ts +1 -1
  39. package/dist/components/MButton.vue.d.ts +1 -1
  40. package/dist/components/MConfirmDialog.vue.d.ts +1 -1
  41. package/dist/components/MCopyButton.vue.d.ts +2 -2
  42. package/dist/components/MDataTable.vue.d.ts +2 -2
  43. package/dist/components/MDialog.vue.d.ts +2 -2
  44. package/dist/components/MDivider.vue.d.ts +1 -1
  45. package/dist/components/MDragHandle.vue.d.ts +1 -1
  46. package/dist/components/MDrawCanvas.vue.d.ts +148 -0
  47. package/dist/components/MDrawLayers.vue.d.ts +3 -0
  48. package/dist/components/MDrawToolbar.vue.d.ts +34 -0
  49. package/dist/components/MExportButton.vue.d.ts +1 -1
  50. package/dist/components/MFab.vue.d.ts +2 -2
  51. package/dist/components/MFabMenu.vue.d.ts +2 -2
  52. package/dist/components/MFixed.vue.d.ts +1 -1
  53. package/dist/components/MFlex.vue.d.ts +2 -2
  54. package/dist/components/MFloorPlan.vue.d.ts +160 -0
  55. package/dist/components/MFlow.vue.d.ts +305 -0
  56. package/dist/components/MFlowControls.vue.d.ts +33 -0
  57. package/dist/components/MFlowHandle.vue.d.ts +16 -0
  58. package/dist/components/MFlowMinimap.vue.d.ts +22 -0
  59. package/dist/components/MFlowNode.vue.d.ts +35 -0
  60. package/dist/components/MGantt.vue.d.ts +141 -0
  61. package/dist/components/MGanttControls.vue.d.ts +32 -0
  62. package/dist/components/MIconButton.vue.d.ts +3 -1
  63. package/dist/components/MImageCropper.vue.d.ts +110 -0
  64. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  65. package/dist/components/MLightbox.vue.d.ts +2 -2
  66. package/dist/components/MList.vue.d.ts +1 -1
  67. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  68. package/dist/components/MMap.vue.d.ts +1 -1
  69. package/dist/components/MMapControl.vue.d.ts +1 -1
  70. package/dist/components/MMapSearch.vue.d.ts +1 -1
  71. package/dist/components/MMaskField.vue.d.ts +12 -1
  72. package/dist/components/MMenu.vue.d.ts +1 -1
  73. package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
  74. package/dist/components/MNumberField.vue.d.ts +11 -2
  75. package/dist/components/MPdfViewer.vue.d.ts +174 -0
  76. package/dist/components/MPullToRefresh.vue.d.ts +1 -1
  77. package/dist/components/MResourceTimeline.vue.d.ts +149 -0
  78. package/dist/components/MScheduler.vue.d.ts +3 -3
  79. package/dist/components/MScheme.vue.d.ts +1 -1
  80. package/dist/components/MSearchField.vue.d.ts +1 -1
  81. package/dist/components/MSeekBar.vue.d.ts +1 -1
  82. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  83. package/dist/components/MSkeleton.vue.d.ts +1 -1
  84. package/dist/components/MSlider.vue.d.ts +4 -4
  85. package/dist/components/MSparkline.vue.d.ts +1 -1
  86. package/dist/components/MSplitter.vue.d.ts +1 -1
  87. package/dist/components/MStack.vue.d.ts +2 -2
  88. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  89. package/dist/components/MSwitch.vue.d.ts +1 -1
  90. package/dist/components/MTable.vue.d.ts +1 -1
  91. package/dist/components/MTagInput.vue.d.ts +12 -1
  92. package/dist/components/MTextField.vue.d.ts +13 -2
  93. package/dist/components/MToolbar.vue.d.ts +1 -1
  94. package/dist/components/MTree.vue.d.ts +2 -2
  95. package/dist/components/MVideoPlayer.vue.d.ts +253 -0
  96. package/dist/components/MVirtualTable.vue.d.ts +1 -1
  97. package/dist/components/MWindow.vue.d.ts +3 -3
  98. package/dist/components/_MFlowEdge.vue.d.ts +9 -0
  99. package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
  100. package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
  101. package/dist/components/_MPdfPage.vue.d.ts +76 -0
  102. package/dist/components/_MTimeBackground.vue.d.ts +14 -0
  103. package/dist/components/_MTimeHeader.vue.d.ts +20 -0
  104. package/dist/composables/_effectCanvas.d.ts +23 -0
  105. package/dist/composables/_flowPanel.d.ts +2 -0
  106. package/dist/composables/_flowSlot.d.ts +5 -0
  107. package/dist/composables/_ganttTime.d.ts +41 -0
  108. package/dist/composables/_storageKeys.d.ts +9 -0
  109. package/dist/composables/_useTimeAxis.d.ts +90 -0
  110. package/dist/composables/drawGeometry.d.ts +119 -0
  111. package/dist/composables/flowFormats.d.ts +79 -0
  112. package/dist/composables/flowLayout.d.ts +45 -0
  113. package/dist/composables/flowPaths.d.ts +53 -0
  114. package/dist/composables/ganttFormats.d.ts +52 -0
  115. package/dist/composables/ganttSchedule.d.ts +99 -0
  116. package/dist/composables/themeInitScript.d.ts +2 -0
  117. package/dist/composables/useConfetti.d.ts +19 -8
  118. package/dist/composables/useDrawing.d.ts +44 -0
  119. package/dist/composables/useFireworks.d.ts +37 -0
  120. package/dist/composables/useFlow.d.ts +266 -0
  121. package/dist/composables/useGantt.d.ts +87 -0
  122. package/dist/composables/useLocale.d.ts +163 -0
  123. package/dist/composables/useMediaPlayer.d.ts +101 -0
  124. package/dist/composables/usePdf.d.ts +119 -0
  125. package/dist/composables/useReactions.d.ts +32 -0
  126. package/dist/composables/useResourceTimeline.d.ts +70 -0
  127. package/dist/composables/viewportHints.d.ts +2 -0
  128. package/dist/directives/vSparkle.d.ts +27 -0
  129. package/dist/draw.d.ts +7 -0
  130. package/dist/draw.js +1700 -0
  131. package/dist/draw.js.map +1 -0
  132. package/dist/flow.d.ts +14 -0
  133. package/dist/flow.js +3542 -0
  134. package/dist/flow.js.map +1 -0
  135. package/dist/flowPaths-CUc6X373.js +161 -0
  136. package/dist/flowPaths-CUc6X373.js.map +1 -0
  137. package/dist/gantt.d.ts +12 -0
  138. package/dist/gantt.js +3575 -0
  139. package/dist/gantt.js.map +1 -0
  140. package/dist/index.d.ts +11 -1
  141. package/dist/locales/index.js +1148 -7
  142. package/dist/locales/index.js.map +1 -1
  143. package/dist/m3ui-vue.css +1 -1
  144. package/dist/m3ui.js +7822 -7809
  145. package/dist/m3ui.js.map +1 -1
  146. package/dist/map.js +593 -588
  147. package/dist/map.js.map +1 -1
  148. package/dist/media.d.ts +5 -0
  149. package/dist/media.js +1311 -0
  150. package/dist/media.js.map +1 -0
  151. package/dist/pdf.d.ts +4 -0
  152. package/dist/pdf.js +1871 -0
  153. package/dist/pdf.js.map +1 -0
  154. package/dist/plugin.d.ts +10 -0
  155. package/dist/rich-text-editor.js +28 -26
  156. package/dist/rich-text-editor.js.map +1 -1
  157. package/dist/styles.css +1 -1
  158. package/dist/{useLocale-JYxDDeXC.js → useLocale-BpGxplLV.js} +165 -2
  159. package/dist/useLocale-BpGxplLV.js.map +1 -0
  160. package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-DQQcaWbE.js} +41 -40
  161. package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
  162. package/package.json +29 -5
  163. package/src/__tests__/MAudioPlayer.test.ts +75 -0
  164. package/src/__tests__/MDrawCanvas.test.ts +110 -0
  165. package/src/__tests__/MFloorPlan.test.ts +97 -0
  166. package/src/__tests__/MFlow.test.ts +575 -0
  167. package/src/__tests__/MGantt.test.ts +130 -0
  168. package/src/__tests__/MImageCropper.test.ts +89 -0
  169. package/src/__tests__/MPdfViewer.test.ts +235 -0
  170. package/src/__tests__/MResourceTimeline.test.ts +102 -0
  171. package/src/__tests__/MSlider.test.ts +36 -0
  172. package/src/__tests__/MVideoPlayer.test.ts +201 -0
  173. package/src/__tests__/drawGeometry.test.ts +58 -0
  174. package/src/__tests__/fieldExpose.test.ts +30 -0
  175. package/src/__tests__/flowFormats.test.ts +185 -0
  176. package/src/__tests__/flowLayout.test.ts +113 -0
  177. package/src/__tests__/ganttFormats.test.ts +76 -0
  178. package/src/__tests__/ganttSchedule.test.ts +136 -0
  179. package/src/__tests__/pdfMock.ts +83 -0
  180. package/src/__tests__/plugin.test.ts +56 -1
  181. package/src/__tests__/ssr.test.ts +1 -1
  182. package/src/__tests__/themeInitScript.test.ts +10 -0
  183. package/src/__tests__/useConfetti.test.ts +33 -2
  184. package/src/__tests__/useFireworks.test.ts +104 -0
  185. package/src/__tests__/useMediaPlayer.test.ts +182 -0
  186. package/src/__tests__/usePdf.test.ts +102 -0
  187. package/src/__tests__/useReactions.test.ts +51 -0
  188. package/src/__tests__/vSparkle.test.ts +83 -0
  189. package/src/components/MAudioPlayer.vue +319 -0
  190. package/src/components/MDrawCanvas.vue +813 -0
  191. package/src/components/MDrawLayers.vue +114 -0
  192. package/src/components/MDrawToolbar.vue +171 -0
  193. package/src/components/MEmojiSelector.vue +3 -2
  194. package/src/components/MFloorPlan.vue +581 -0
  195. package/src/components/MFlow.vue +2049 -0
  196. package/src/components/MFlowControls.vue +110 -0
  197. package/src/components/MFlowHandle.vue +60 -0
  198. package/src/components/MFlowMinimap.vue +134 -0
  199. package/src/components/MFlowNode.vue +98 -0
  200. package/src/components/MGantt.vue +1609 -0
  201. package/src/components/MGanttControls.vue +77 -0
  202. package/src/components/MIconButton.vue +3 -1
  203. package/src/components/MImageCropper.vue +507 -0
  204. package/src/components/MMap.vue +3 -2
  205. package/src/components/MMaskField.vue +13 -0
  206. package/src/components/MNumberField.vue +13 -0
  207. package/src/components/MPdfViewer.vue +1269 -0
  208. package/src/components/MResourceTimeline.vue +1020 -0
  209. package/src/components/MSlider.vue +22 -4
  210. package/src/components/MTagInput.vue +13 -0
  211. package/src/components/MTextField.vue +24 -4
  212. package/src/components/MVideoPlayer.vue +839 -0
  213. package/src/components/_MFlowEdge.vue +100 -0
  214. package/src/components/_MFlowEdgeLabel.vue +56 -0
  215. package/src/components/_MFlowNodeShell.vue +111 -0
  216. package/src/components/_MPdfPage.vue +456 -0
  217. package/src/components/_MTimeBackground.vue +16 -0
  218. package/src/components/_MTimeHeader.vue +31 -0
  219. package/src/composables/_colorUtils.ts +4 -2
  220. package/src/composables/_effectCanvas.ts +109 -0
  221. package/src/composables/_flowPanel.ts +13 -0
  222. package/src/composables/_flowSlot.ts +6 -0
  223. package/src/composables/_ganttTime.ts +200 -0
  224. package/src/composables/_ssrState.ts +2 -2
  225. package/src/composables/_storageKeys.ts +28 -0
  226. package/src/composables/_useTimeAxis.ts +224 -0
  227. package/src/composables/drawGeometry.ts +405 -0
  228. package/src/composables/flowFormats.ts +916 -0
  229. package/src/composables/flowLayout.ts +297 -0
  230. package/src/composables/flowPaths.ts +239 -0
  231. package/src/composables/ganttFormats.ts +366 -0
  232. package/src/composables/ganttSchedule.ts +403 -0
  233. package/src/composables/themeInitScript.ts +5 -2
  234. package/src/composables/useColorPalette.ts +36 -8
  235. package/src/composables/useConfetti.ts +84 -107
  236. package/src/composables/useDrawing.ts +53 -0
  237. package/src/composables/useFireworks.ts +360 -0
  238. package/src/composables/useFlow.ts +250 -0
  239. package/src/composables/useGantt.ts +92 -0
  240. package/src/composables/useLocale.ts +328 -0
  241. package/src/composables/useMediaPlayer.ts +406 -0
  242. package/src/composables/usePdf.ts +456 -0
  243. package/src/composables/useReactions.ts +131 -0
  244. package/src/composables/useResourceTimeline.ts +76 -0
  245. package/src/composables/useTheme.ts +21 -4
  246. package/src/composables/viewportHints.ts +6 -5
  247. package/src/directives/vSparkle.ts +180 -0
  248. package/src/draw.ts +25 -0
  249. package/src/flow.ts +26 -0
  250. package/src/gantt.ts +12 -0
  251. package/src/index.ts +11 -1
  252. package/src/locales/de.ts +163 -0
  253. package/src/locales/es.ts +163 -0
  254. package/src/locales/fr.ts +163 -0
  255. package/src/locales/ja.ts +163 -0
  256. package/src/locales/ko.ts +163 -0
  257. package/src/locales/pt.ts +163 -0
  258. package/src/locales/zh.ts +163 -0
  259. package/src/media.ts +5 -0
  260. package/src/pdf.ts +15 -0
  261. package/src/plugin.ts +21 -5
  262. package/dist/MMenuItem-DI351kIf.js +0 -929
  263. package/dist/MMenuItem-DI351kIf.js.map +0 -1
  264. package/dist/MSlider-BnEy5ieZ.js +0 -1500
  265. package/dist/MSlider-BnEy5ieZ.js.map +0 -1
  266. package/dist/MTextField-BBmkaIbO.js +0 -633
  267. package/dist/MTextField-BBmkaIbO.js.map +0 -1
  268. package/dist/useLocale-JYxDDeXC.js.map +0 -1
  269. package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
@@ -0,0 +1,44 @@
1
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
+ import type { DrawItem, DrawLayer, DrawPen, DrawShapeKind } from './drawGeometry';
3
+ /** What a pointer does on an MDrawCanvas */
4
+ export type DrawTool = DrawPen | 'eraser' | 'stroke-eraser' | DrawShapeKind | 'text' | 'select' | 'pan';
5
+ export interface DrawExportOptions {
6
+ /** In `mode="pages"`: the page to export (default 0) */
7
+ page?: number;
8
+ /** PNG: pixels per drawing unit (default 2) */
9
+ scale?: number;
10
+ /** Paint the paper color behind the drawing (default true) */
11
+ background?: boolean;
12
+ }
13
+ /** What an MDrawCanvas shares with MDrawToolbar, MDrawLayers and anything built with useDrawing() inside it */
14
+ export interface DrawContext {
15
+ tool: Ref<DrawTool>;
16
+ color: Ref<string>;
17
+ size: Ref<number>;
18
+ /** New rects and ellipses are filled with the color */
19
+ fill: Ref<boolean>;
20
+ items: ComputedRef<DrawItem[]>;
21
+ selection: Ref<string[]>;
22
+ layers: ComputedRef<DrawLayer[]>;
23
+ setLayers(layers: DrawLayer[]): void;
24
+ /** The layer new items go on */
25
+ layer: Ref<string | undefined>;
26
+ mode: ComputedRef<'infinite' | 'pages'>;
27
+ pages: Ref<number>;
28
+ addPage(): void;
29
+ zoom: ComputedRef<number>;
30
+ zoomIn(): void;
31
+ zoomOut(): void;
32
+ fitView(): void;
33
+ canUndo: ComputedRef<boolean>;
34
+ canRedo: ComputedRef<boolean>;
35
+ undo(): void;
36
+ redo(): void;
37
+ clear(): void;
38
+ deleteSelection(): void;
39
+ exportSvg(opts?: DrawExportOptions): string;
40
+ exportPng(opts?: DrawExportOptions): Promise<Blob>;
41
+ }
42
+ export declare const DRAW_KEY: InjectionKey<DrawContext>;
43
+ /** The surrounding MDrawCanvas' state and actions, for a toolbar or panel of your own inside it */
44
+ export declare function useDrawing(): DrawContext;
@@ -0,0 +1,37 @@
1
+ import { type ShapeName } from 'shape-morph';
2
+ export interface FireworksOptions {
3
+ /** How many rockets (default 6, launched over about a second and a half); with `duration`, rockets per second */
4
+ count?: number;
5
+ /**
6
+ * What the bursts look like, one picked per burst: `'classic'` (sparks thrown out from the center that fall as they
7
+ * fade) or an MShape's name the sparks are laid out along (`'Circle'` is a ring). Default: mostly classic, with a
8
+ * ring, a heart, a flower… now and then
9
+ */
10
+ shapes?: FireworkShape[];
11
+ /** Any CSS colors. Default: the theme's primary, secondary and tertiary roles and their containers */
12
+ colors?: string[];
13
+ /** Burst radius in px. Default: a sixth of the screen's smaller side, between 70 and 180 */
14
+ size?: number;
15
+ /** Keep launching for this long, in ms (`count` then being rockets per second); `Infinity` runs until `stop()` */
16
+ duration?: number;
17
+ }
18
+ /** A burst's look: `'classic'`, or an MShape's name its sparks are laid out along. */
19
+ export type FireworkShape = 'classic' | ShapeName;
20
+ /** Stops launching before `duration` ends; what's already in the air finishes. */
21
+ export type StopFireworks = () => void;
22
+ /**
23
+ * `n` points evenly spaced along a shape's outline, as offsets from its center scaled so the farthest is at 1
24
+ * (`[x0, y0, x1, y1, …]`). Exported for tests.
25
+ */
26
+ export declare function shapeOutline(shape: ShapeName, n?: number): Float32Array;
27
+ /**
28
+ * Launches fireworks: a few rockets, or with `duration` a show that keeps going (stop it early with the returned
29
+ * function). Browser only; does nothing under reduced motion.
30
+ */
31
+ export declare function launchFireworks(options?: FireworksOptions): StopFireworks;
32
+ /** Fireworks for a component: `launch()`, `launch({ shapes: ['classic'] })`, `launch({ shapes: ['Heart'] })`, `launch({ duration: 10000 })`. */
33
+ export declare function useFireworks(): {
34
+ launch: typeof launchFireworks;
35
+ };
36
+ /** Stops every firework and removes the canvas. Internal, for tests; not exported from index.ts. */
37
+ export declare function __resetFireworks(): void;
@@ -0,0 +1,266 @@
1
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
+ import type { FlowEdgePath, FlowPosition } from './flowPaths';
3
+ import type { FlowLayout, FlowLayoutOptions } from './flowLayout';
4
+ export type { FlowPosition };
5
+ /** A point in flow coordinates */
6
+ export interface FlowXY {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ /**
11
+ * A node. Treat nodes as immutable: MFlow emits new arrays with new objects for whatever changed (`v-model:nodes`),
12
+ * and the history (undo) keeps the old ones.
13
+ */
14
+ export interface FlowNode<D = any> {
15
+ id: string;
16
+ /**
17
+ * How it's drawn: `default` (an MFlowNode with a handle each side), `input` (only a source), `output` (only a
18
+ * target), `circle` (a round vertex, see `FlowCircleData`), `group` (a container for nodes whose `parentId` is this
19
+ * one), or any name you give a `#node-<type>` slot
20
+ */
21
+ type?: string;
22
+ /** Its top left corner, in flow coordinates (relative to the parent's corner when it has a `parentId`) */
23
+ position: FlowXY;
24
+ /** Anything; the default node shows `label`, `subtitle` and `icon` */
25
+ data?: D;
26
+ /** A fixed size; otherwise it's measured. A `group` without one wraps its children */
27
+ width?: number;
28
+ height?: number;
29
+ /** The group this node sits in: it moves with it */
30
+ parentId?: string;
31
+ /** `'parent'` keeps it inside its group */
32
+ extent?: 'parent';
33
+ /** Where the default node's handles go; default from MFlow's `direction` */
34
+ sourcePosition?: FlowPosition;
35
+ targetPosition?: FlowPosition;
36
+ hidden?: boolean;
37
+ draggable?: boolean;
38
+ selectable?: boolean;
39
+ connectable?: boolean;
40
+ deletable?: boolean;
41
+ /** `false` keeps it from splicing into an edge when dropped onto one */
42
+ insertable?: boolean;
43
+ class?: string;
44
+ }
45
+ /** What a `circle` node shows */
46
+ export interface FlowCircleData {
47
+ label?: string;
48
+ /** Its fill: a container role (default a neutral surface) */
49
+ color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral' | 'inverse';
50
+ /** A small count or tag on its top right (a level, an excess) */
51
+ badge?: string | number;
52
+ /** A soft halo around it, in a role's color */
53
+ ring?: 'primary' | 'secondary' | 'tertiary' | 'error';
54
+ /** Diameter in px (default 56) */
55
+ size?: number;
56
+ }
57
+ export type FlowMarker = 'arrow' | 'arrow-closed' | 'none';
58
+ export interface FlowEdge<D = any> {
59
+ id: string;
60
+ source: string;
61
+ target: string;
62
+ /** The handle's `id` when its node has several */
63
+ sourceHandle?: string | null;
64
+ targetHandle?: string | null;
65
+ /** `bezier` (default), `smoothstep`, `step`, `straight`, or a `#edge-<type>` slot */
66
+ type?: string;
67
+ /**
68
+ * For a `#edge-<type>` slot: how it's routed, which is the `path` the slot gets and where the edge is hit
69
+ * (default `bezier`)
70
+ */
71
+ pathType?: 'bezier' | 'smoothstep' | 'step' | 'straight';
72
+ label?: string;
73
+ /** The label chip's color (default a neutral chip) */
74
+ labelTone?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral';
75
+ /** Dashes that flow from source to target (`'reverse'`: from target to source) */
76
+ animated?: boolean | 'reverse';
77
+ /** The line's (and arrowhead's) color: an M3 role (`primary`, `tertiary`, `error`, `outline`…) or any CSS color. Changes animate */
78
+ color?: string;
79
+ /** The line's width in px (default 2). Changes animate */
80
+ width?: number;
81
+ /** A dashed line, standing still */
82
+ dashed?: boolean;
83
+ /** Default `arrow-closed` */
84
+ markerEnd?: FlowMarker;
85
+ markerStart?: FlowMarker;
86
+ data?: D;
87
+ hidden?: boolean;
88
+ selectable?: boolean;
89
+ deletable?: boolean;
90
+ /** Its ends can be dragged to other handles once selected; default MFlow's `edgesReconnectable` */
91
+ reconnectable?: boolean;
92
+ class?: string;
93
+ }
94
+ /** The view: `x`/`y` in px, where the flow's origin is on the canvas, and the zoom */
95
+ export interface FlowViewport {
96
+ x: number;
97
+ y: number;
98
+ zoom: number;
99
+ }
100
+ /** A connection being made or checked */
101
+ export interface FlowConnection {
102
+ source: string;
103
+ sourceHandle: string | null;
104
+ target: string;
105
+ targetHandle: string | null;
106
+ }
107
+ export interface FlowSelection {
108
+ nodes: string[];
109
+ edges: string[];
110
+ }
111
+ /** A handle as measured: its center relative to its node's corner, in flow units */
112
+ export interface FlowHandleBounds {
113
+ id: string | null;
114
+ type: 'source' | 'target';
115
+ position: FlowPosition;
116
+ x: number;
117
+ y: number;
118
+ connectable: boolean;
119
+ }
120
+ export interface FlowFitOptions {
121
+ /** Room around the nodes, a fraction of the view (default 0.1) */
122
+ padding?: number;
123
+ /** Only these nodes */
124
+ nodes?: string[];
125
+ maxZoom?: number;
126
+ minZoom?: number;
127
+ /** Default true */
128
+ animate?: boolean;
129
+ }
130
+ /** What MFlow provides to everything inside it, and `useFlow()` returns */
131
+ export interface FlowContext {
132
+ nodes: ComputedRef<FlowNode[]>;
133
+ edges: ComputedRef<FlowEdge[]>;
134
+ viewport: Readonly<Ref<FlowViewport>>;
135
+ selection: ComputedRef<FlowSelection>;
136
+ minZoom: ComputedRef<number>;
137
+ maxZoom: ComputedRef<number>;
138
+ /** Canvas size in px */
139
+ size: Readonly<Ref<{
140
+ width: number;
141
+ height: number;
142
+ }>>;
143
+ /** Interaction switched off by the lock button (or MFlow's `locked`) */
144
+ locked: Ref<boolean>;
145
+ getNode(id: string): FlowNode | undefined;
146
+ /** A node's top left corner in flow coordinates, its parents added, where it's drawn right now */
147
+ getAbsolutePosition(id: string): FlowXY;
148
+ /** A node's measured (or set) size */
149
+ getSize(id: string): {
150
+ width: number;
151
+ height: number;
152
+ };
153
+ /** Nodes overlapping this one (or a rectangle in flow coordinates), groups and its own family left out */
154
+ getIntersectingNodes(node: string | {
155
+ x: number;
156
+ y: number;
157
+ width: number;
158
+ height: number;
159
+ }): FlowNode[];
160
+ /** Page (client) coordinates → flow coordinates */
161
+ screenToFlow(p: {
162
+ x: number;
163
+ y: number;
164
+ }): FlowXY;
165
+ flowToScreen(p: FlowXY): {
166
+ x: number;
167
+ y: number;
168
+ };
169
+ setViewport(v: Partial<FlowViewport>, opts?: {
170
+ animate?: boolean;
171
+ }): void;
172
+ fitView(opts?: FlowFitOptions): void;
173
+ /** Centers the view on a flow point, at `zoom` or the current zoom */
174
+ setCenter(x: number, y: number, opts?: {
175
+ zoom?: number;
176
+ animate?: boolean;
177
+ }): void;
178
+ zoomIn(): void;
179
+ zoomOut(): void;
180
+ zoomTo(zoom: number, opts?: {
181
+ animate?: boolean;
182
+ }): void;
183
+ addNodes(nodes: FlowNode | FlowNode[]): void;
184
+ addEdges(edges: FlowEdge | FlowEdge[]): void;
185
+ updateNode(id: string, patch: Partial<FlowNode> | ((n: FlowNode) => FlowNode)): void;
186
+ updateEdge(id: string, patch: Partial<FlowEdge> | ((e: FlowEdge) => FlowEdge)): void;
187
+ /** Deletes nodes (with their edges and children) and edges by id */
188
+ remove(ids: {
189
+ nodes?: string[];
190
+ edges?: string[];
191
+ }): void;
192
+ setSelection(sel: Partial<FlowSelection>): void;
193
+ /** Runs a layout over the nodes' measured sizes; default MFlow's `layout` (or the tree layout). Animated and undoable */
194
+ layout(fn?: 'tree' | 'layered' | FlowLayout, options?: FlowLayoutOptions): Promise<void>;
195
+ undo(): void;
196
+ redo(): void;
197
+ canUndo: ComputedRef<boolean>;
198
+ canRedo: ComputedRef<boolean>;
199
+ copy(): void;
200
+ cut(): void;
201
+ /** Pastes what was copied, at a flow point (default a step from the originals) */
202
+ paste(at?: FlowXY): void;
203
+ /**
204
+ * Drags a node with a pointer that's already down, e.g. one just added from a palette outside the canvas: it
205
+ * follows the pointer from there (guides, splicing into an edge) until it's let go. With a finger, the page
206
+ * doesn't scroll under it meanwhile (start the drag from a long press, so a swipe still scrolls your palette)
207
+ */
208
+ startDrag(id: string, e: PointerEvent): void;
209
+ }
210
+ export interface FlowInternals extends FlowContext {
211
+ registerHandle(nodeId: string, el: HTMLElement, info: () => Omit<FlowHandleBounds, 'x' | 'y'>): () => void;
212
+ measureNode(nodeId: string): void;
213
+ startConnection(e: PointerEvent, nodeId: string, handleId: string | null, type: 'source' | 'target'): void;
214
+ /** The handle a connection being dragged would snap to (`nodeId:handleId:type`), and whether it's valid */
215
+ connectionTarget: Readonly<Ref<{
216
+ key: string;
217
+ valid: boolean;
218
+ } | null>>;
219
+ connecting: Readonly<Ref<boolean>>;
220
+ /** The edge a dragged node would splice into if dropped now */
221
+ insertEdge: Readonly<Ref<string | null>>;
222
+ /** Dragging an edge draws a branch from its source (edgeBranching) */
223
+ branching: ComputedRef<boolean>;
224
+ nodesConnectable: ComputedRef<boolean>;
225
+ direction: ComputedRef<'horizontal' | 'vertical'>;
226
+ registerNodeEl(id: string, el: HTMLElement | null): void;
227
+ selectedNodes: ComputedRef<Set<string>>;
228
+ selectedEdges: ComputedRef<Set<string>>;
229
+ dragging: Readonly<Ref<Set<string>>>;
230
+ isLifted(id: string): boolean;
231
+ zIndexOf(id: string): number;
232
+ edgeGeometry(e: FlowEdge): FlowEdgeGeometry | null;
233
+ isReconnectable(e: FlowEdge): boolean;
234
+ sidePositions(n: FlowNode): {
235
+ source: FlowPosition;
236
+ target: FlowPosition;
237
+ };
238
+ onNodeKey(e: KeyboardEvent, id: string): void;
239
+ onEdgeKey(e: KeyboardEvent, id: string): void;
240
+ }
241
+ export interface FlowEdgeGeometry extends FlowEdgePath {
242
+ sourceX: number;
243
+ sourceY: number;
244
+ targetX: number;
245
+ targetY: number;
246
+ sourcePosition: FlowPosition;
247
+ targetPosition: FlowPosition;
248
+ /** How far the end sits inside a handle (0 at a node's side) */
249
+ sourceInset: number;
250
+ targetInset: number;
251
+ }
252
+ export declare const FLOW_KEY: InjectionKey<FlowInternals>;
253
+ export interface FlowNodeState {
254
+ id: string;
255
+ node: ComputedRef<FlowNode>;
256
+ selected: ComputedRef<boolean>;
257
+ dragging: ComputedRef<boolean>;
258
+ }
259
+ export declare const FLOW_NODE_KEY: InjectionKey<FlowNodeState>;
260
+ /**
261
+ * The enclosing `<MFlow>`'s state and controls, from any component rendered inside it (a `#node-<type>` slot, a
262
+ * panel of your own). Outside one, use MFlow's template ref, which exposes the same.
263
+ */
264
+ export declare function useFlow(): FlowContext;
265
+ /** The node a component is rendered in (inside a `#node-<type>` slot), or null */
266
+ export declare function useFlowNode(): FlowNodeState | null;
@@ -0,0 +1,87 @@
1
+ import { type ComputedRef, type InjectionKey, type Ref } from 'vue';
2
+ import type { GanttCriticalPath, GanttDependency, GanttScheduleOptions, GanttTask } from './ganttSchedule';
3
+ import type { TimeUnit } from './_ganttTime';
4
+ /** MGantt's named zoom levels */
5
+ export type GanttScale = TimeUnit;
6
+ /** A column of MGantt's task list */
7
+ export interface GanttColumn {
8
+ /** `name`, `start`, `end`, `duration` and `progress` are built in; anything else reads `task.data[key]` (or the slot `#cell-<key>`) */
9
+ key: string;
10
+ label?: string;
11
+ /** px; the `name` column takes what's left when it has none */
12
+ width?: number;
13
+ align?: 'start' | 'center' | 'end';
14
+ /** Text for a cell */
15
+ format?: (task: GanttTask) => string;
16
+ }
17
+ /** What MGantt provides to everything inside it (MGanttControls, panels of yours), and its template ref exposes */
18
+ export interface GanttContext {
19
+ /** The tasks as drawn: summaries rolled up from their children */
20
+ tasks: ComputedRef<GanttTask[]>;
21
+ selection: ComputedRef<string[]>;
22
+ /** The closest named scale to the zoom */
23
+ scale: ComputedRef<GanttScale>;
24
+ /** The zoom, in px per day */
25
+ pxPerDay: Readonly<Ref<number>>;
26
+ readonly: ComputedRef<boolean>;
27
+ canUndo: ComputedRef<boolean>;
28
+ canRedo: ComputedRef<boolean>;
29
+ /** Every task id whose children are hidden */
30
+ collapsed: ComputedRef<string[]>;
31
+ undo(): void;
32
+ redo(): void;
33
+ zoomIn(): void;
34
+ zoomOut(): void;
35
+ setScale(scale: GanttScale): void;
36
+ /** Scrolls so a date (default now) sits at the view's `align` (default center) */
37
+ scrollToDate(date?: string, opts?: {
38
+ align?: 'start' | 'center';
39
+ animate?: boolean;
40
+ }): void;
41
+ /** Scrolls a task into view, its row and its bar */
42
+ scrollToTask(id: string): void;
43
+ toggle(id: string, expanded?: boolean): void;
44
+ expandAll(): void;
45
+ collapseAll(): void;
46
+ setSelection(ids: string[]): void;
47
+ /** Adds tasks (after `after`, or at the end); undoable */
48
+ addTasks(tasks: GanttTask | GanttTask[], opts?: {
49
+ after?: string;
50
+ }): void;
51
+ updateTask(id: string, patch: Partial<GanttTask> | ((t: GanttTask) => GanttTask)): void;
52
+ /** Deletes tasks with their children and the dependencies on them */
53
+ removeTasks(ids: string[]): void;
54
+ /** Makes `to` depend on `from` */
55
+ link(from: string, to: string, type?: GanttDependency['type'], lag?: number): void;
56
+ unlink(from: string, to: string): void;
57
+ /** Runs `scheduleTasks` over the tasks with MGantt's calendar; undoable */
58
+ schedule(options?: GanttScheduleOptions): void;
59
+ criticalPath: ComputedRef<GanttCriticalPath>;
60
+ /** The date (snapped) under a page x */
61
+ dateAt(clientX: number): string;
62
+ }
63
+ export declare const GANTT_KEY: InjectionKey<GanttContext>;
64
+ /** What MGanttControls drives, in an MGantt or an MResourceTimeline */
65
+ export interface TimelineControls {
66
+ scale: ComputedRef<GanttScale>;
67
+ readonly: ComputedRef<boolean>;
68
+ canUndo: ComputedRef<boolean>;
69
+ canRedo: ComputedRef<boolean>;
70
+ /** Whether anything can fold (summaries, resource groups) and whether something is folded */
71
+ foldable: ComputedRef<boolean>;
72
+ folded: ComputedRef<boolean>;
73
+ undo(): void;
74
+ redo(): void;
75
+ zoomIn(): void;
76
+ zoomOut(): void;
77
+ setScale(scale: GanttScale): void;
78
+ scrollToDate(date?: string): void;
79
+ expandAll(): void;
80
+ collapseAll(): void;
81
+ }
82
+ export declare const TIMELINE_CONTROLS_KEY: InjectionKey<TimelineControls>;
83
+ /**
84
+ * The enclosing `<MGantt>`'s state and controls, from a component rendered in its default slot. Outside one, use
85
+ * MGantt's template ref, which exposes the same.
86
+ */
87
+ export declare function useGantt(): GanttContext;
@@ -196,6 +196,169 @@ export interface M3Locale {
196
196
  /** MTimeline's button past `limit`; `{count}` is how many entries are hidden */
197
197
  timelineShowMore: string;
198
198
  timelineShowLess: string;
199
+ mediaPlayer: string;
200
+ mediaPlay: string;
201
+ mediaPause: string;
202
+ mediaReplay: string;
203
+ mediaSeekBack: string;
204
+ mediaSeekForward: string;
205
+ mediaSeconds: string;
206
+ mediaMute: string;
207
+ mediaUnmute: string;
208
+ mediaVolume: string;
209
+ mediaFullscreen: string;
210
+ mediaExitFullscreen: string;
211
+ mediaPictureInPicture: string;
212
+ mediaSettings: string;
213
+ mediaSpeed: string;
214
+ mediaSpeedNormal: string;
215
+ mediaSubtitles: string;
216
+ mediaSubtitlesOff: string;
217
+ mediaQuality: string;
218
+ mediaQualityAuto: string;
219
+ mediaLive: string;
220
+ mediaError: string;
221
+ mediaRepeat: string;
222
+ mediaRepeatOne: string;
223
+ mediaShuffle: string;
224
+ pdfViewer: string;
225
+ pdfThumbnails: string;
226
+ pdfOutline: string;
227
+ pdfPage: string;
228
+ pdfZoom: string;
229
+ pdfZoomIn: string;
230
+ pdfZoomOut: string;
231
+ pdfFitWidth: string;
232
+ pdfFitPage: string;
233
+ pdfSearch: string;
234
+ pdfSearchPrevious: string;
235
+ pdfSearchNext: string;
236
+ pdfMatchCount: string;
237
+ pdfNoMatches: string;
238
+ pdfMore: string;
239
+ pdfRotate: string;
240
+ pdfDownload: string;
241
+ pdfPrint: string;
242
+ pdfFullscreen: string;
243
+ pdfExitFullscreen: string;
244
+ pdfPassword: string;
245
+ pdfPasswordLabel: string;
246
+ pdfWrongPassword: string;
247
+ pdfOpen: string;
248
+ pdfError: string;
249
+ pdfLoading: string;
250
+ pdfAnnotate: string;
251
+ pdfSelect: string;
252
+ pdfHighlight: string;
253
+ pdfNote: string;
254
+ pdfDraw: string;
255
+ pdfEraser: string;
256
+ pdfInkWidth: string;
257
+ pdfColor: string;
258
+ pdfUndo: string;
259
+ pdfCopy: string;
260
+ pdfDelete: string;
261
+ pdfNotePlaceholder: string;
262
+ pdfAddComment: string;
263
+ flowCanvas: string;
264
+ flowNode: string;
265
+ flowEdge: string;
266
+ flowZoomIn: string;
267
+ flowZoomOut: string;
268
+ flowFitView: string;
269
+ flowLock: string;
270
+ flowUnlock: string;
271
+ flowUndo: string;
272
+ flowRedo: string;
273
+ flowMinimap: string;
274
+ flowMoved: string;
275
+ flowConnected: string;
276
+ flowDeleted: string;
277
+ flowDeleteEdge: string;
278
+ flowDelete: string;
279
+ ganttChart: string;
280
+ ganttTask: string;
281
+ ganttStart: string;
282
+ ganttEnd: string;
283
+ ganttDuration: string;
284
+ ganttProgress: string;
285
+ ganttDays: string;
286
+ ganttHours: string;
287
+ ganttMilestone: string;
288
+ ganttQuarter: string;
289
+ ganttToday: string;
290
+ ganttZoomIn: string;
291
+ ganttZoomOut: string;
292
+ ganttExpandAll: string;
293
+ ganttCollapseAll: string;
294
+ ganttExpand: string;
295
+ ganttCollapse: string;
296
+ ganttUndo: string;
297
+ ganttRedo: string;
298
+ ganttScaleHour: string;
299
+ ganttScaleDay: string;
300
+ ganttScaleWeek: string;
301
+ ganttScaleMonth: string;
302
+ ganttScaleQuarter: string;
303
+ ganttScaleYear: string;
304
+ ganttMoved: string;
305
+ ganttProgressSet: string;
306
+ ganttLinked: string;
307
+ ganttUnlink: string;
308
+ ganttDeleted: string;
309
+ ganttDelete: string;
310
+ ganttReordered: string;
311
+ ganttSlack: string;
312
+ ganttCritical: string;
313
+ ganttBaseline: string;
314
+ ganttEmpty: string;
315
+ ganttResize: string;
316
+ timelineResource: string;
317
+ timelineConflict: string;
318
+ timelineMoved: string;
319
+ timelineEmpty: string;
320
+ cropArea: string;
321
+ cropRotateLeft: string;
322
+ cropRotateRight: string;
323
+ cropFlip: string;
324
+ cropReset: string;
325
+ cropFree: string;
326
+ drawCanvas: string;
327
+ drawTools: string;
328
+ drawMore: string;
329
+ drawSelect: string;
330
+ drawPan: string;
331
+ drawPen: string;
332
+ drawBrush: string;
333
+ drawMarker: string;
334
+ drawHighlighter: string;
335
+ drawEraser: string;
336
+ drawStrokeEraser: string;
337
+ drawLine: string;
338
+ drawArrow: string;
339
+ drawRect: string;
340
+ drawEllipse: string;
341
+ drawText: string;
342
+ drawFill: string;
343
+ drawColor: string;
344
+ floorPlan: string;
345
+ floorSeats: string;
346
+ drawCustomColor: string;
347
+ drawSize: string;
348
+ drawUndo: string;
349
+ drawRedo: string;
350
+ drawDelete: string;
351
+ drawLayers: string;
352
+ drawLayer: string;
353
+ drawLayerName: string;
354
+ drawAddLayer: string;
355
+ drawDeleteLayer: string;
356
+ drawShowLayer: string;
357
+ drawHideLayer: string;
358
+ drawLockLayer: string;
359
+ drawUnlockLayer: string;
360
+ drawLayerUp: string;
361
+ drawLayerDown: string;
199
362
  }
200
363
  export declare const defaultLocale: M3Locale;
201
364
  export declare const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>>;