@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.
- package/dist/API.md +3010 -376
- package/dist/MButton-Bl_BSUep.js +172 -0
- package/dist/MButton-Bl_BSUep.js.map +1 -0
- package/dist/MDialog-D_Yik8ou.js +173 -0
- package/dist/MDialog-D_Yik8ou.js.map +1 -0
- package/dist/MIconButton-DoNotQ9v.js +282 -0
- package/dist/MIconButton-DoNotQ9v.js.map +1 -0
- package/dist/MListItem-BxifHJdU.js +824 -0
- package/dist/MListItem-BxifHJdU.js.map +1 -0
- package/dist/MLoadingIndicator-BxbFhSX6.js +115 -0
- package/dist/MLoadingIndicator-BxbFhSX6.js.map +1 -0
- package/dist/MMenuItem-Bih0h4-n.js +604 -0
- package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
- package/dist/MProgressBar-BCoruxA-.js +184 -0
- package/dist/MProgressBar-BCoruxA-.js.map +1 -0
- package/dist/MSeekBar-BeN9QcB3.js +435 -0
- package/dist/MSeekBar-BeN9QcB3.js.map +1 -0
- package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
- package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
- package/dist/MSlider-BVSbJlGS.js +691 -0
- package/dist/MSlider-BVSbJlGS.js.map +1 -0
- package/dist/MSpinner-C2SUnWk4.js +65 -0
- package/dist/MSpinner-C2SUnWk4.js.map +1 -0
- package/dist/MTextField-CEkWSZ2v.js +296 -0
- package/dist/MTextField-CEkWSZ2v.js.map +1 -0
- package/dist/MTooltip-CodJGEO-.js +756 -0
- package/dist/MTooltip-CodJGEO-.js.map +1 -0
- package/dist/_storageKeys-CYXsUBwK.js +18 -0
- package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
- package/dist/_useEscapeStack-CjndQhqg.js +19 -0
- package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +115 -0
- package/dist/components/MBadge.vue.d.ts +1 -1
- package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
- package/dist/components/MBox.vue.d.ts +1 -1
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MConfirmDialog.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MDataTable.vue.d.ts +2 -2
- package/dist/components/MDialog.vue.d.ts +2 -2
- package/dist/components/MDivider.vue.d.ts +1 -1
- package/dist/components/MDragHandle.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +150 -0
- package/dist/components/MDrawLayers.vue.d.ts +3 -0
- package/dist/components/MDrawToolbar.vue.d.ts +34 -0
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MFabMenu.vue.d.ts +2 -2
- package/dist/components/MFixed.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +248 -0
- package/dist/components/MFloorPlanInspector.vue.d.ts +56 -0
- package/dist/components/MFloorPlanToolbar.vue.d.ts +51 -0
- package/dist/components/MFlow.vue.d.ts +318 -0
- package/dist/components/MFlowControls.vue.d.ts +33 -0
- package/dist/components/MFlowHandle.vue.d.ts +16 -0
- package/dist/components/MFlowMinimap.vue.d.ts +22 -0
- package/dist/components/MFlowNode.vue.d.ts +35 -0
- package/dist/components/MGantt.vue.d.ts +141 -0
- package/dist/components/MGanttControls.vue.d.ts +32 -0
- package/dist/components/MIconButton.vue.d.ts +3 -1
- package/dist/components/MImageCropper.vue.d.ts +110 -0
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MList.vue.d.ts +1 -1
- package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MMapSearch.vue.d.ts +1 -1
- package/dist/components/MMaskField.vue.d.ts +12 -1
- package/dist/components/MMenu.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +11 -2
- package/dist/components/MPdfViewer.vue.d.ts +174 -0
- package/dist/components/MPullToRefresh.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +149 -0
- package/dist/components/MScheduler.vue.d.ts +3 -3
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSlider.vue.d.ts +2 -2
- package/dist/components/MSparkline.vue.d.ts +1 -1
- package/dist/components/MSplitter.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +12 -1
- package/dist/components/MTextField.vue.d.ts +13 -2
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTree.vue.d.ts +2 -2
- package/dist/components/MVideoPlayer.vue.d.ts +253 -0
- package/dist/components/MVirtualTable.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MFlowEdge.vue.d.ts +9 -0
- package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
- package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
- package/dist/components/_MPdfPage.vue.d.ts +76 -0
- package/dist/components/_MTimeBackground.vue.d.ts +14 -0
- package/dist/components/_MTimeHeader.vue.d.ts +20 -0
- package/dist/composables/_flowPanel.d.ts +2 -0
- package/dist/composables/_flowSlot.d.ts +5 -0
- package/dist/composables/_ganttTime.d.ts +41 -0
- package/dist/composables/_useTimeAxis.d.ts +90 -0
- package/dist/composables/drawGeometry.d.ts +119 -0
- package/dist/composables/flowFormats.d.ts +79 -0
- package/dist/composables/flowLayout.d.ts +45 -0
- package/dist/composables/flowPaths.d.ts +53 -0
- package/dist/composables/ganttFormats.d.ts +52 -0
- package/dist/composables/ganttSchedule.d.ts +99 -0
- package/dist/composables/useDrawing.d.ts +44 -0
- package/dist/composables/useFloorPlan.d.ts +58 -0
- package/dist/composables/useFlow.d.ts +266 -0
- package/dist/composables/useGantt.d.ts +87 -0
- package/dist/composables/useLocale.d.ts +204 -0
- package/dist/composables/useMediaPlayer.d.ts +101 -0
- package/dist/composables/usePdf.d.ts +119 -0
- package/dist/composables/useResourceTimeline.d.ts +70 -0
- package/dist/draw.d.ts +7 -0
- package/dist/draw.js +1702 -0
- package/dist/draw.js.map +1 -0
- package/dist/flow.d.ts +14 -0
- package/dist/flow.js +3547 -0
- package/dist/flow.js.map +1 -0
- package/dist/flowPaths-CUc6X373.js +161 -0
- package/dist/flowPaths-CUc6X373.js.map +1 -0
- package/dist/gantt.d.ts +12 -0
- package/dist/gantt.js +3575 -0
- package/dist/gantt.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/locales/index.js +1435 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +8248 -7637
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +113 -108
- package/dist/map.js.map +1 -1
- package/dist/media.d.ts +5 -0
- package/dist/media.js +1311 -0
- package/dist/media.js.map +1 -0
- package/dist/pdf.d.ts +4 -0
- package/dist/pdf.js +1871 -0
- package/dist/pdf.js.map +1 -0
- package/dist/rich-text-editor.js +28 -26
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-JYxDDeXC.js → useLocale-CaWwi-b6.js} +206 -2
- package/dist/useLocale-CaWwi-b6.js.map +1 -0
- package/dist/{useThemeTokens-y0HZpyhL.js → useThemeTokens-DQQcaWbE.js} +40 -54
- package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
- package/package.json +29 -5
- package/src/__tests__/MAudioPlayer.test.ts +75 -0
- package/src/__tests__/MDrawCanvas.test.ts +118 -0
- package/src/__tests__/MFloorPlan.test.ts +299 -0
- package/src/__tests__/MFlow.test.ts +590 -0
- package/src/__tests__/MGantt.test.ts +130 -0
- package/src/__tests__/MImageCropper.test.ts +89 -0
- package/src/__tests__/MPdfViewer.test.ts +235 -0
- package/src/__tests__/MResourceTimeline.test.ts +102 -0
- package/src/__tests__/MVideoPlayer.test.ts +201 -0
- package/src/__tests__/drawGeometry.test.ts +58 -0
- package/src/__tests__/fieldExpose.test.ts +30 -0
- package/src/__tests__/flowFormats.test.ts +185 -0
- package/src/__tests__/flowLayout.test.ts +113 -0
- package/src/__tests__/ganttFormats.test.ts +76 -0
- package/src/__tests__/ganttSchedule.test.ts +136 -0
- package/src/__tests__/pdfMock.ts +83 -0
- package/src/__tests__/useMediaPlayer.test.ts +182 -0
- package/src/__tests__/usePdf.test.ts +102 -0
- package/src/components/MAudioPlayer.vue +319 -0
- package/src/components/MDrawCanvas.vue +819 -0
- package/src/components/MDrawLayers.vue +114 -0
- package/src/components/MDrawToolbar.vue +171 -0
- package/src/components/MFloorPlan.vue +1080 -0
- package/src/components/MFloorPlanInspector.vue +169 -0
- package/src/components/MFloorPlanToolbar.vue +128 -0
- package/src/components/MFlow.vue +2060 -0
- package/src/components/MFlowControls.vue +110 -0
- package/src/components/MFlowHandle.vue +60 -0
- package/src/components/MFlowMinimap.vue +134 -0
- package/src/components/MFlowNode.vue +98 -0
- package/src/components/MGantt.vue +1609 -0
- package/src/components/MGanttControls.vue +77 -0
- package/src/components/MIconButton.vue +3 -1
- package/src/components/MImageCropper.vue +507 -0
- package/src/components/MMaskField.vue +13 -0
- package/src/components/MNumberField.vue +13 -0
- package/src/components/MPdfViewer.vue +1270 -0
- package/src/components/MResourceTimeline.vue +1020 -0
- package/src/components/MTagInput.vue +13 -0
- package/src/components/MTextField.vue +16 -0
- package/src/components/MVideoPlayer.vue +839 -0
- package/src/components/_MFlowEdge.vue +100 -0
- package/src/components/_MFlowEdgeLabel.vue +56 -0
- package/src/components/_MFlowNodeShell.vue +111 -0
- package/src/components/_MPdfPage.vue +456 -0
- package/src/components/_MTimeBackground.vue +16 -0
- package/src/components/_MTimeHeader.vue +31 -0
- package/src/composables/_flowPanel.ts +13 -0
- package/src/composables/_flowSlot.ts +6 -0
- package/src/composables/_ganttTime.ts +200 -0
- package/src/composables/_useTimeAxis.ts +224 -0
- package/src/composables/drawGeometry.ts +405 -0
- package/src/composables/flowFormats.ts +916 -0
- package/src/composables/flowLayout.ts +297 -0
- package/src/composables/flowPaths.ts +239 -0
- package/src/composables/ganttFormats.ts +366 -0
- package/src/composables/ganttSchedule.ts +403 -0
- package/src/composables/useDrawing.ts +53 -0
- package/src/composables/useFloorPlan.ts +73 -0
- package/src/composables/useFlow.ts +250 -0
- package/src/composables/useGantt.ts +92 -0
- package/src/composables/useLocale.ts +410 -0
- package/src/composables/useMediaPlayer.ts +406 -0
- package/src/composables/usePdf.ts +456 -0
- package/src/composables/useResourceTimeline.ts +76 -0
- package/src/draw.ts +25 -0
- package/src/flow.ts +26 -0
- package/src/gantt.ts +12 -0
- package/src/index.ts +9 -0
- package/src/locales/de.ts +204 -0
- package/src/locales/es.ts +204 -0
- package/src/locales/fr.ts +204 -0
- package/src/locales/ja.ts +204 -0
- package/src/locales/ko.ts +204 -0
- package/src/locales/pt.ts +204 -0
- package/src/locales/zh.ts +204 -0
- package/src/media.ts +5 -0
- package/src/pdf.ts +15 -0
- package/dist/MMenuItem-D4Gx_l3F.js +0 -929
- package/dist/MMenuItem-D4Gx_l3F.js.map +0 -1
- package/dist/MSlider-Dx_S3vJ9.js +0 -1506
- package/dist/MSlider-Dx_S3vJ9.js.map +0 -1
- package/dist/MTextField-Bz8JIsnl.js +0 -633
- package/dist/MTextField-Bz8JIsnl.js.map +0 -1
- package/dist/useLocale-JYxDDeXC.js.map +0 -1
- package/dist/useThemeTokens-y0HZpyhL.js.map +0 -1
|
@@ -190,7 +190,211 @@ var a = {
|
|
|
190
190
|
mapTotal: "Total",
|
|
191
191
|
mapSearchPlaces: "Search places",
|
|
192
192
|
timelineShowMore: "Show {count} more",
|
|
193
|
-
timelineShowLess: "Show less"
|
|
193
|
+
timelineShowLess: "Show less",
|
|
194
|
+
mediaPlayer: "Media player",
|
|
195
|
+
mediaPlay: "Play",
|
|
196
|
+
mediaPause: "Pause",
|
|
197
|
+
mediaReplay: "Replay",
|
|
198
|
+
mediaSeekBack: "Back {seconds} seconds",
|
|
199
|
+
mediaSeekForward: "Forward {seconds} seconds",
|
|
200
|
+
mediaSeconds: "{seconds} seconds",
|
|
201
|
+
mediaMute: "Mute",
|
|
202
|
+
mediaUnmute: "Unmute",
|
|
203
|
+
mediaVolume: "Volume",
|
|
204
|
+
mediaFullscreen: "Full screen",
|
|
205
|
+
mediaExitFullscreen: "Exit full screen",
|
|
206
|
+
mediaPictureInPicture: "Picture-in-picture",
|
|
207
|
+
mediaSettings: "Settings",
|
|
208
|
+
mediaSpeed: "Playback speed",
|
|
209
|
+
mediaSpeedNormal: "Normal",
|
|
210
|
+
mediaSubtitles: "Subtitles",
|
|
211
|
+
mediaSubtitlesOff: "Off",
|
|
212
|
+
mediaQuality: "Quality",
|
|
213
|
+
mediaQualityAuto: "Auto",
|
|
214
|
+
mediaLive: "Live",
|
|
215
|
+
mediaError: "This media can't be played",
|
|
216
|
+
mediaRepeat: "Repeat",
|
|
217
|
+
mediaRepeatOne: "Repeat one",
|
|
218
|
+
mediaShuffle: "Shuffle",
|
|
219
|
+
pdfViewer: "PDF viewer",
|
|
220
|
+
pdfThumbnails: "Pages",
|
|
221
|
+
pdfOutline: "Contents",
|
|
222
|
+
pdfPage: "Page",
|
|
223
|
+
pdfZoom: "Zoom",
|
|
224
|
+
pdfZoomIn: "Zoom in",
|
|
225
|
+
pdfZoomOut: "Zoom out",
|
|
226
|
+
pdfFitWidth: "Fit to width",
|
|
227
|
+
pdfFitPage: "Fit page",
|
|
228
|
+
pdfSearch: "Find in document",
|
|
229
|
+
pdfSearchPrevious: "Previous match",
|
|
230
|
+
pdfSearchNext: "Next match",
|
|
231
|
+
pdfMatchCount: "{current} of {total}",
|
|
232
|
+
pdfNoMatches: "No matches",
|
|
233
|
+
pdfMore: "More options",
|
|
234
|
+
pdfRotate: "Rotate",
|
|
235
|
+
pdfDownload: "Download",
|
|
236
|
+
pdfPrint: "Print",
|
|
237
|
+
pdfFullscreen: "Full screen",
|
|
238
|
+
pdfExitFullscreen: "Exit full screen",
|
|
239
|
+
pdfPassword: "This document is password protected",
|
|
240
|
+
pdfPasswordLabel: "Password",
|
|
241
|
+
pdfWrongPassword: "Wrong password",
|
|
242
|
+
pdfOpen: "Open",
|
|
243
|
+
pdfError: "This PDF can't be opened",
|
|
244
|
+
pdfLoading: "Loading document",
|
|
245
|
+
pdfAnnotate: "Annotate",
|
|
246
|
+
pdfSelect: "Select",
|
|
247
|
+
pdfHighlight: "Highlight",
|
|
248
|
+
pdfNote: "Note",
|
|
249
|
+
pdfDraw: "Draw",
|
|
250
|
+
pdfEraser: "Eraser",
|
|
251
|
+
pdfInkWidth: "Line width {n} pt",
|
|
252
|
+
pdfColor: "Color",
|
|
253
|
+
pdfUndo: "Undo",
|
|
254
|
+
pdfCopy: "Copy",
|
|
255
|
+
pdfDelete: "Delete",
|
|
256
|
+
pdfNotePlaceholder: "Write a note",
|
|
257
|
+
pdfAddComment: "Add a comment",
|
|
258
|
+
flowCanvas: "Diagram",
|
|
259
|
+
flowNode: "node",
|
|
260
|
+
flowEdge: "Connection from {source} to {target}",
|
|
261
|
+
flowZoomIn: "Zoom in",
|
|
262
|
+
flowZoomOut: "Zoom out",
|
|
263
|
+
flowFitView: "Fit view",
|
|
264
|
+
flowLock: "Lock",
|
|
265
|
+
flowUnlock: "Unlock",
|
|
266
|
+
flowUndo: "Undo",
|
|
267
|
+
flowRedo: "Redo",
|
|
268
|
+
flowMinimap: "Mini map",
|
|
269
|
+
flowMoved: "{label} moved",
|
|
270
|
+
flowConnected: "Connected {source} to {target}",
|
|
271
|
+
flowDeleted: "{count} deleted",
|
|
272
|
+
flowDeleteEdge: "Delete connection",
|
|
273
|
+
flowDelete: "Delete",
|
|
274
|
+
ganttChart: "Gantt chart",
|
|
275
|
+
ganttTask: "Task",
|
|
276
|
+
ganttStart: "Start",
|
|
277
|
+
ganttEnd: "End",
|
|
278
|
+
ganttDuration: "Duration",
|
|
279
|
+
ganttProgress: "Progress",
|
|
280
|
+
ganttDays: "{n} d",
|
|
281
|
+
ganttHours: "{n} h",
|
|
282
|
+
ganttMilestone: "Milestone",
|
|
283
|
+
ganttQuarter: "Q{n}",
|
|
284
|
+
ganttToday: "Today",
|
|
285
|
+
ganttZoomIn: "Zoom in",
|
|
286
|
+
ganttZoomOut: "Zoom out",
|
|
287
|
+
ganttExpandAll: "Expand all",
|
|
288
|
+
ganttCollapseAll: "Collapse all",
|
|
289
|
+
ganttExpand: "Expand",
|
|
290
|
+
ganttCollapse: "Collapse",
|
|
291
|
+
ganttUndo: "Undo",
|
|
292
|
+
ganttRedo: "Redo",
|
|
293
|
+
ganttScaleHour: "Hours",
|
|
294
|
+
ganttScaleDay: "Days",
|
|
295
|
+
ganttScaleWeek: "Weeks",
|
|
296
|
+
ganttScaleMonth: "Months",
|
|
297
|
+
ganttScaleQuarter: "Quarters",
|
|
298
|
+
ganttScaleYear: "Years",
|
|
299
|
+
ganttMoved: "{name}: {start} to {end}",
|
|
300
|
+
ganttProgressSet: "{name}: {progress}% done",
|
|
301
|
+
ganttLinked: "{from} linked to {to}",
|
|
302
|
+
ganttUnlink: "Remove dependency",
|
|
303
|
+
ganttDeleted: "{count} deleted",
|
|
304
|
+
ganttDelete: "Delete",
|
|
305
|
+
ganttReordered: "{name} moved to row {pos}",
|
|
306
|
+
ganttSlack: "Slack: {n} d",
|
|
307
|
+
ganttCritical: "Critical",
|
|
308
|
+
ganttBaseline: "Baseline",
|
|
309
|
+
ganttEmpty: "No tasks yet",
|
|
310
|
+
ganttResize: "Resize the task list",
|
|
311
|
+
timelineResource: "Resource",
|
|
312
|
+
timelineConflict: "Overlaps another booking",
|
|
313
|
+
timelineMoved: "{title}: {resource}, {start} to {end}",
|
|
314
|
+
timelineEmpty: "No resources",
|
|
315
|
+
cropArea: "Crop area",
|
|
316
|
+
cropRotateLeft: "Rotate left",
|
|
317
|
+
cropRotateRight: "Rotate right",
|
|
318
|
+
cropFlip: "Flip horizontally",
|
|
319
|
+
cropReset: "Reset",
|
|
320
|
+
cropFree: "Free",
|
|
321
|
+
drawCanvas: "Drawing canvas",
|
|
322
|
+
drawTools: "Drawing tools",
|
|
323
|
+
drawMore: "More tools",
|
|
324
|
+
drawSelect: "Select",
|
|
325
|
+
drawPan: "Pan",
|
|
326
|
+
drawPen: "Pen",
|
|
327
|
+
drawBrush: "Brush",
|
|
328
|
+
drawMarker: "Marker",
|
|
329
|
+
drawHighlighter: "Highlighter",
|
|
330
|
+
drawEraser: "Eraser",
|
|
331
|
+
drawStrokeEraser: "Stroke eraser",
|
|
332
|
+
drawLine: "Line",
|
|
333
|
+
drawArrow: "Arrow",
|
|
334
|
+
drawRect: "Rectangle",
|
|
335
|
+
drawEllipse: "Ellipse",
|
|
336
|
+
drawText: "Text",
|
|
337
|
+
drawFill: "Fill",
|
|
338
|
+
drawColor: "Color",
|
|
339
|
+
floorPlan: "Floor plan",
|
|
340
|
+
floorSeats: "{n} seats",
|
|
341
|
+
floorRotate: "Rotate",
|
|
342
|
+
floorTools: "Floor plan tools",
|
|
343
|
+
floorMove: "Move",
|
|
344
|
+
floorDrawWall: "Wall",
|
|
345
|
+
floorDrawZone: "Zone",
|
|
346
|
+
floorAddTable: "Add a table",
|
|
347
|
+
floorAddDecor: "Add decor",
|
|
348
|
+
floorDuplicate: "Duplicate",
|
|
349
|
+
floorDelete: "Delete",
|
|
350
|
+
floorUndo: "Undo",
|
|
351
|
+
floorRedo: "Redo",
|
|
352
|
+
floorLabel: "Label",
|
|
353
|
+
floorSeatsField: "Seats",
|
|
354
|
+
floorShape: "Shape",
|
|
355
|
+
floorRound: "Round",
|
|
356
|
+
floorSquare: "Square",
|
|
357
|
+
floorLong: "Long",
|
|
358
|
+
floorAngle: "Angle",
|
|
359
|
+
floorColor: "Color",
|
|
360
|
+
floorThickness: "Thickness",
|
|
361
|
+
floorWidth: "Width",
|
|
362
|
+
floorHeight: "Height",
|
|
363
|
+
floorMerge: "Merge tables",
|
|
364
|
+
floorSplit: "Split",
|
|
365
|
+
floorNothingPicked: "Pick a table, a zone, a wall or decor to change it",
|
|
366
|
+
floorTablesPicked: "{n} tables picked",
|
|
367
|
+
floorTableN: "Table {label}",
|
|
368
|
+
floorZone: "Zone",
|
|
369
|
+
floorWall: "Wall",
|
|
370
|
+
floorDeleteCorner: "Delete the corner",
|
|
371
|
+
floorFinishWall: "Finish the wall",
|
|
372
|
+
floorCancel: "Cancel",
|
|
373
|
+
floorDecorDoor: "Door",
|
|
374
|
+
floorDecorWindow: "Window",
|
|
375
|
+
floorDecorPlant: "Plant",
|
|
376
|
+
floorDecorColumn: "Column",
|
|
377
|
+
floorDecorRestroom: "Restroom",
|
|
378
|
+
floorDecorKitchen: "Kitchen",
|
|
379
|
+
floorDecorRegister: "Register",
|
|
380
|
+
floorDecorStairs: "Stairs",
|
|
381
|
+
floorDecorLabel: "Text",
|
|
382
|
+
drawCustomColor: "Custom color",
|
|
383
|
+
drawSize: "Size",
|
|
384
|
+
drawUndo: "Undo",
|
|
385
|
+
drawRedo: "Redo",
|
|
386
|
+
drawDelete: "Delete selection",
|
|
387
|
+
drawLayers: "Layers",
|
|
388
|
+
drawLayer: "Layer {n}",
|
|
389
|
+
drawLayerName: "Layer name",
|
|
390
|
+
drawAddLayer: "Add layer",
|
|
391
|
+
drawDeleteLayer: "Delete layer",
|
|
392
|
+
drawShowLayer: "Show layer",
|
|
393
|
+
drawHideLayer: "Hide layer",
|
|
394
|
+
drawLockLayer: "Lock layer",
|
|
395
|
+
drawUnlockLayer: "Unlock layer",
|
|
396
|
+
drawLayerUp: "Move layer up",
|
|
397
|
+
drawLayerDown: "Move layer down"
|
|
194
398
|
}, o = Symbol("m3-locale"), s = n(null);
|
|
195
399
|
function c(e) {
|
|
196
400
|
s.value = e ? { locale: e } : null;
|
|
@@ -204,4 +408,4 @@ function l() {
|
|
|
204
408
|
//#endregion
|
|
205
409
|
export { l as i, c as n, a as r, o as t };
|
|
206
410
|
|
|
207
|
-
//# sourceMappingURL=useLocale-
|
|
411
|
+
//# sourceMappingURL=useLocale-CaWwi-b6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocale-CaWwi-b6.js","names":[],"sources":["../src/composables/useLocale.ts"],"sourcesContent":["import { inject, reactive, shallowRef, watchEffect, toValue, type InjectionKey, type MaybeRef } from 'vue'\n\nexport interface M3Locale {\n /** BCP-47 language tag (e.g. 'en', 'es', 'pt') — read by locale-aware components (MRelativeTime) that use Intl formatting. */\n lang: string\n\n // Common\n search: string\n noResults: string\n close: string\n cancel: string\n confirm: string\n loading: string\n menu: string\n\n // Navigation\n previous: string\n next: string\n today: string\n more: string\n\n // Tables\n selectedCount: string\n recordCount: string\n expand: string\n /** Collapses an expanded item (the opposite of `expand`) */\n collapse: string\n /** Clears a field's value (the × at its end) */\n clear: string\n columns: string\n exportCsv: string\n noGroup: string\n\n // Tour\n finish: string\n\n // File upload\n dropText: string\n selectText: string\n maxSizePrefix: string\n remove: string\n\n // Pickers\n selectDate: string\n ok: string\n dateToggleInput: string\n dateToggleCalendar: string\n dateInputLabel: string\n selectTime: string\n timeHourSelection: string\n timeMinuteSelection: string\n timePeriodToggle: string\n timeToggleKeyboard: string\n timeToggleDial: string\n timeToggleScroll: string\n sheetExpand: string\n sheetCollapse: string\n sheetDismiss: string\n seekBar: string\n seekBarValue: string\n seekBarShowRemaining: string\n seekBarShowDuration: string\n selectRange: string\n pickStart: string\n pickEnd: string\n previousMonth: string\n nextMonth: string\n\n // Color picker\n selectColor: string\n colorHue: string\n colorSaturation: string\n colorBrightness: string\n colorAlpha: string\n colorEyedropper: string\n colorOriginal: string\n colorFormat: string\n colorRecent: string\n colorPresets: string\n\n // Scheduler\n dayView: string\n weekView: string\n allDay: string\n emojiSearch: string\n emojiNoResults: string\n emojiRecent: string\n emojiSkinTone: string\n emojiSkinTones: string\n emojiCategorySmileys: string\n emojiCategoryGestures: string\n emojiCategoryPeople: string\n emojiCategoryAnimals: string\n emojiCategoryNature: string\n emojiCategoryFood: string\n emojiCategoryActivities: string\n emojiCategoryTravel: string\n emojiCategoryObjects: string\n emojiCategorySymbols: string\n emojiCategoryFlags: string\n\n // Transfer list\n available: string\n selected: string\n noItems: string\n moveAllRight: string\n moveRight: string\n moveLeft: string\n moveAllLeft: string\n\n // Command palette / Spotlight\n searchCommand: string\n navigateHint: string\n selectHint: string\n openHint: string\n closeHint: string\n\n // Infinite scroll\n loadingMore: string\n noMoreItems: string\n\n // Rich text editor\n bold: string\n italic: string\n underline: string\n strikethrough: string\n highlight: string\n bulletList: string\n orderedList: string\n blockquote: string\n code: string\n alignLeft: string\n alignCenter: string\n alignRight: string\n undo: string\n redo: string\n link: string\n image: string\n paragraph: string\n heading1: string\n heading2: string\n heading3: string\n insertLink: string\n insertImage: string\n imageUrlLabel: string\n insert: string\n\n // JSON editor\n jsonValid: string\n jsonInvalid: string\n jsonFormat: string\n jsonMinify: string\n\n // JSON viewer\n jsonElements: string\n jsonFields: string\n\n // Result\n resultSuccessTitle: string\n resultSuccessDesc: string\n resultErrorTitle: string\n resultErrorDesc: string\n resultWarningTitle: string\n resultWarningDesc: string\n resultInfoTitle: string\n resultInfoDesc: string\n result404Title: string\n result404Desc: string\n result403Title: string\n result403Desc: string\n result500Title: string\n result500Desc: string\n\n // Chat bubble\n chatTyping: string\n chatRecordingAudio: string\n\n // Drag & drop list ({pos}/{total} are replaced at runtime)\n reorderHandle: string\n reorderGrabbed: string\n reorderMoved: string\n reorderDropped: string\n reorderCancelled: string\n\n // Transfer list (panes)\n selectAll: string\n clearSearch: string\n\n // Kanban ({column}/{pos}/{total} are replaced at runtime)\n kanbanMoved: string\n // MWindow title bar buttons\n windowMinimize: string\n windowMaximize: string\n windowRestore: string\n // MPagination ({from}/{to}/{total} and {page}/{pages} are replaced at runtime)\n paginationRange: string\n paginationPage: string\n previousPage: string\n nextPage: string\n carousel: string\n carouselItem: string\n /** MSparkline's summary for screen readers: {first}, {last}, {min}, {max} */\n sparklineSummary: string\n /** MSlider range: its two thumbs */\n sliderRangeStart: string\n sliderRangeEnd: string\n // MMap (maplibre controls)\n mapTitle: string\n mapMarker: string\n mapZoomIn: string\n mapZoomOut: string\n mapResetBearing: string\n mapFindMyLocation: string\n mapLocationNotAvailable: string\n mapEnterFullscreen: string\n mapExitFullscreen: string\n mapToggleAttribution: string\n mapFeedback: string\n mapCtrlScroll: string\n mapCmdScroll: string\n mapTwoFingers: string\n mapLayers: string\n mapSearchLayers: string\n mapNoLayers: string\n mapShowLayer: string\n mapHideLayer: string\n mapOpacity: string\n mapDownload: string\n mapNoBaseLayer: string\n mapHoverInfo: string\n mapNoValue: string\n mapMeasureDistance: string\n mapMeasureArea: string\n mapClearMeasurements: string\n mapDeleteMeasurement: string\n mapTotal: string\n mapSearchPlaces: string\n /** MTimeline's button past `limit`; `{count}` is how many entries are hidden */\n timelineShowMore: string\n timelineShowLess: string\n // Media players (MVideoPlayer, MAudioPlayer); `{seconds}` is the skip length\n mediaPlayer: string\n mediaPlay: string\n mediaPause: string\n mediaReplay: string\n mediaSeekBack: string\n mediaSeekForward: string\n mediaSeconds: string\n mediaMute: string\n mediaUnmute: string\n mediaVolume: string\n mediaFullscreen: string\n mediaExitFullscreen: string\n mediaPictureInPicture: string\n mediaSettings: string\n mediaSpeed: string\n mediaSpeedNormal: string\n mediaSubtitles: string\n mediaSubtitlesOff: string\n mediaQuality: string\n mediaQualityAuto: string\n mediaLive: string\n mediaError: string\n mediaRepeat: string\n mediaRepeatOne: string\n mediaShuffle: string\n // MPdfViewer; `{current}`/`{total}` count search matches\n pdfViewer: string\n pdfThumbnails: string\n pdfOutline: string\n pdfPage: string\n pdfZoom: string\n pdfZoomIn: string\n pdfZoomOut: string\n pdfFitWidth: string\n pdfFitPage: string\n pdfSearch: string\n pdfSearchPrevious: string\n pdfSearchNext: string\n pdfMatchCount: string\n pdfNoMatches: string\n pdfMore: string\n pdfRotate: string\n pdfDownload: string\n pdfPrint: string\n pdfFullscreen: string\n pdfExitFullscreen: string\n pdfPassword: string\n pdfPasswordLabel: string\n pdfWrongPassword: string\n pdfOpen: string\n pdfError: string\n pdfLoading: string\n pdfAnnotate: string\n pdfSelect: string\n pdfHighlight: string\n pdfNote: string\n pdfDraw: string\n pdfEraser: string\n pdfInkWidth: string\n pdfColor: string\n pdfUndo: string\n pdfCopy: string\n pdfDelete: string\n pdfNotePlaceholder: string\n pdfAddComment: string\n flowCanvas: string\n flowNode: string\n flowEdge: string\n flowZoomIn: string\n flowZoomOut: string\n flowFitView: string\n flowLock: string\n flowUnlock: string\n flowUndo: string\n flowRedo: string\n flowMinimap: string\n flowMoved: string\n flowConnected: string\n flowDeleted: string\n flowDeleteEdge: string\n flowDelete: string\n ganttChart: string\n ganttTask: string\n ganttStart: string\n ganttEnd: string\n ganttDuration: string\n ganttProgress: string\n ganttDays: string\n ganttHours: string\n ganttMilestone: string\n ganttQuarter: string\n ganttToday: string\n ganttZoomIn: string\n ganttZoomOut: string\n ganttExpandAll: string\n ganttCollapseAll: string\n ganttExpand: string\n ganttCollapse: string\n ganttUndo: string\n ganttRedo: string\n ganttScaleHour: string\n ganttScaleDay: string\n ganttScaleWeek: string\n ganttScaleMonth: string\n ganttScaleQuarter: string\n ganttScaleYear: string\n ganttMoved: string\n ganttProgressSet: string\n ganttLinked: string\n ganttUnlink: string\n ganttDeleted: string\n ganttDelete: string\n ganttReordered: string\n ganttSlack: string\n ganttCritical: string\n ganttBaseline: string\n ganttEmpty: string\n ganttResize: string\n timelineResource: string\n timelineConflict: string\n timelineMoved: string\n timelineEmpty: string\n cropArea: string\n cropRotateLeft: string\n cropRotateRight: string\n cropFlip: string\n cropReset: string\n cropFree: string\n drawCanvas: string\n drawTools: string\n drawMore: string\n drawSelect: string\n drawPan: string\n drawPen: string\n drawBrush: string\n drawMarker: string\n drawHighlighter: string\n drawEraser: string\n drawStrokeEraser: string\n drawLine: string\n drawArrow: string\n drawRect: string\n drawEllipse: string\n drawText: string\n drawFill: string\n drawColor: string\n floorPlan: string\n floorSeats: string\n floorRotate: string\n floorTools: string\n floorMove: string\n floorDrawWall: string\n floorDrawZone: string\n floorAddTable: string\n floorAddDecor: string\n floorDuplicate: string\n floorDelete: string\n floorUndo: string\n floorRedo: string\n floorLabel: string\n floorSeatsField: string\n floorShape: string\n floorRound: string\n floorSquare: string\n floorLong: string\n floorAngle: string\n floorColor: string\n floorThickness: string\n floorWidth: string\n floorHeight: string\n floorMerge: string\n floorSplit: string\n floorNothingPicked: string\n floorTablesPicked: string\n floorTableN: string\n floorZone: string\n floorWall: string\n floorDeleteCorner: string\n floorFinishWall: string\n floorCancel: string\n floorDecorDoor: string\n floorDecorWindow: string\n floorDecorPlant: string\n floorDecorColumn: string\n floorDecorRestroom: string\n floorDecorKitchen: string\n floorDecorRegister: string\n floorDecorStairs: string\n floorDecorLabel: string\n drawCustomColor: string\n drawSize: string\n drawUndo: string\n drawRedo: string\n drawDelete: string\n drawLayers: string\n drawLayer: string\n drawLayerName: string\n drawAddLayer: string\n drawDeleteLayer: string\n drawShowLayer: string\n drawHideLayer: string\n drawLockLayer: string\n drawUnlockLayer: string\n drawLayerUp: string\n drawLayerDown: string\n}\n\nexport const defaultLocale: M3Locale = {\n lang: 'en',\n\n search: 'Search...',\n noResults: 'No results',\n close: 'Close',\n menu: 'Menu',\n cancel: 'Cancel',\n confirm: 'Confirm',\n loading: 'Loading',\n\n previous: 'Previous',\n next: 'Next',\n today: 'Today',\n more: 'more',\n\n selectedCount: 'selected',\n recordCount: 'record',\n expand: 'Expand',\n collapse: 'Collapse',\n clear: 'Clear',\n columns: 'Columns',\n exportCsv: 'Export CSV',\n noGroup: 'No group',\n\n finish: 'Finish',\n\n dropText: 'Drop files here or',\n selectText: 'browse',\n maxSizePrefix: 'Max.',\n remove: 'Remove',\n\n selectDate: 'Select date',\n ok: 'OK',\n dateToggleInput: 'Switch to text input',\n dateToggleCalendar: 'Switch to calendar',\n dateInputLabel: 'Date',\n selectTime: 'Select time',\n timeHourSelection: 'Select hour',\n timeMinuteSelection: 'Select minutes',\n timePeriodToggle: 'Select AM or PM',\n timeToggleKeyboard: 'Switch to text input mode',\n timeToggleDial: 'Switch to clock mode',\n timeToggleScroll: 'Switch to scroll mode',\n sheetExpand: 'Expand bottom sheet',\n sheetCollapse: 'Collapse bottom sheet',\n sheetDismiss: 'Dismiss bottom sheet',\n seekBar: 'Seek',\n seekBarValue: '{position} of {duration}',\n seekBarShowRemaining: 'Show remaining time',\n seekBarShowDuration: 'Show total time',\n selectRange: 'Select range',\n pickStart: 'Select start',\n pickEnd: 'Select end',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n selectColor: 'Select color',\n colorHue: 'Hue',\n colorSaturation: 'Saturation',\n colorBrightness: 'Brightness',\n colorAlpha: 'Opacity',\n colorEyedropper: 'Pick a color from the screen',\n colorOriginal: 'Original color',\n colorFormat: 'Color format',\n colorRecent: 'Recent',\n colorPresets: 'Presets',\n\n dayView: 'Day',\n weekView: 'Week',\n allDay: 'All day',\n emojiSearch: 'Search emoji',\n emojiNoResults: 'No emoji found',\n emojiRecent: 'Recently used',\n emojiSkinTone: 'Skin tone',\n emojiSkinTones: 'No skin tone|Light|Medium-light|Medium|Medium-dark|Dark',\n emojiCategorySmileys: 'Smileys',\n emojiCategoryGestures: 'Gestures',\n emojiCategoryPeople: 'People',\n emojiCategoryAnimals: 'Animals',\n emojiCategoryNature: 'Nature',\n emojiCategoryFood: 'Food & drink',\n emojiCategoryActivities: 'Activities',\n emojiCategoryTravel: 'Travel & places',\n emojiCategoryObjects: 'Objects',\n emojiCategorySymbols: 'Symbols',\n emojiCategoryFlags: 'Flags',\n\n available: 'Available',\n selected: 'Selected',\n noItems: 'No items',\n moveAllRight: 'Move all right',\n moveRight: 'Move selected right',\n moveLeft: 'Move selected left',\n moveAllLeft: 'Move all left',\n\n searchCommand: 'Search command...',\n navigateHint: 'navigate',\n selectHint: 'select',\n openHint: 'open',\n closeHint: 'close',\n\n loadingMore: 'Loading...',\n noMoreItems: 'No more items',\n\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n strikethrough: 'Strikethrough',\n highlight: 'Highlight',\n bulletList: 'Bullet list',\n orderedList: 'Ordered list',\n blockquote: 'Blockquote',\n code: 'Code',\n alignLeft: 'Align left',\n alignCenter: 'Align center',\n alignRight: 'Align right',\n undo: 'Undo',\n redo: 'Redo',\n link: 'Link',\n image: 'Image',\n paragraph: 'Paragraph',\n heading1: 'Heading 1',\n heading2: 'Heading 2',\n heading3: 'Heading 3',\n insertLink: 'Insert link',\n insertImage: 'Insert image',\n imageUrlLabel: 'Image URL',\n insert: 'Insert',\n\n jsonValid: 'Valid',\n jsonInvalid: 'Invalid',\n jsonFormat: 'Format',\n jsonMinify: 'Minify',\n\n jsonElements: 'elements',\n jsonFields: 'fields',\n\n // Result\n resultSuccessTitle: 'Success',\n resultSuccessDesc: 'The action was completed successfully.',\n resultErrorTitle: 'Something went wrong',\n resultErrorDesc: 'An unexpected error occurred. Please try again.',\n resultWarningTitle: 'Warning',\n resultWarningDesc: 'Something needs your attention.',\n resultInfoTitle: 'Information',\n resultInfoDesc: 'Here is something you should know.',\n result404Title: 'Page not found',\n result404Desc: 'The page you are looking for does not exist or has been moved.',\n result403Title: 'Access denied',\n result403Desc: 'You don\\'t have permission to view this resource.',\n result500Title: 'Server error',\n result500Desc: 'The server could not process the request.',\n\n // Chat bubble\n chatTyping: 'Typing…',\n chatRecordingAudio: 'Recording audio…',\n\n // Drag & drop list ({pos}/{total} are replaced at runtime)\n reorderHandle: 'Reorder',\n reorderGrabbed: 'Item grabbed, position {pos} of {total}. Use the arrow keys to move it, Space to drop it, Escape to cancel.',\n reorderMoved: 'Moved to position {pos} of {total}.',\n reorderDropped: 'Item dropped at position {pos} of {total}.',\n reorderCancelled: 'Reorder cancelled.',\n\n // Transfer list (panes)\n selectAll: 'Select all',\n clearSearch: 'Clear search',\n\n // Kanban ({column}/{pos}/{total} are replaced at runtime)\n kanbanMoved: 'Moved to {column}, position {pos} of {total}.',\n windowMinimize: 'Minimize',\n windowMaximize: 'Maximize',\n windowRestore: 'Restore',\n // MPagination ({from}/{to}/{total} and {page}/{pages} are replaced at runtime)\n paginationRange: '{from}–{to} of {total}',\n paginationPage: 'Page {page} of {pages}',\n previousPage: 'Previous page',\n nextPage: 'Next page',\n carousel: 'Carousel',\n carouselItem: '{index} of {count}',\n sparklineSummary: 'From {first} to {last}, low {min}, high {max}',\n sliderRangeStart: 'Range start',\n sliderRangeEnd: 'Range end',\n // MMap (maplibre controls)\n mapTitle: 'Map',\n mapMarker: 'Map marker',\n mapZoomIn: 'Zoom in',\n mapZoomOut: 'Zoom out',\n mapResetBearing: 'Reset bearing to north',\n mapFindMyLocation: 'Find my location',\n mapLocationNotAvailable: 'Location not available',\n mapEnterFullscreen: 'Enter fullscreen',\n mapExitFullscreen: 'Exit fullscreen',\n mapToggleAttribution: 'Toggle attribution',\n mapFeedback: 'Map feedback',\n mapCtrlScroll: 'Use Ctrl + scroll to zoom the map',\n mapCmdScroll: 'Use ⌘ + scroll to zoom the map',\n mapTwoFingers: 'Use two fingers to move the map',\n mapLayers: 'Layers',\n mapSearchLayers: 'Search layers',\n mapNoLayers: 'No layers',\n mapShowLayer: 'Show layer',\n mapHideLayer: 'Hide layer',\n mapOpacity: 'Opacity',\n mapDownload: 'Download',\n mapNoBaseLayer: 'No base layer',\n mapHoverInfo: 'Info on hover',\n mapNoValue: 'Not available',\n mapMeasureDistance: 'Measure distance',\n mapMeasureArea: 'Measure area',\n mapClearMeasurements: 'Clear measurements',\n mapDeleteMeasurement: 'Delete measurement',\n mapTotal: 'Total',\n mapSearchPlaces: 'Search places',\n timelineShowMore: 'Show {count} more',\n timelineShowLess: 'Show less',\n mediaPlayer: 'Media player',\n mediaPlay: 'Play',\n mediaPause: 'Pause',\n mediaReplay: 'Replay',\n mediaSeekBack: 'Back {seconds} seconds',\n mediaSeekForward: 'Forward {seconds} seconds',\n mediaSeconds: '{seconds} seconds',\n mediaMute: 'Mute',\n mediaUnmute: 'Unmute',\n mediaVolume: 'Volume',\n mediaFullscreen: 'Full screen',\n mediaExitFullscreen: 'Exit full screen',\n mediaPictureInPicture: 'Picture-in-picture',\n mediaSettings: 'Settings',\n mediaSpeed: 'Playback speed',\n mediaSpeedNormal: 'Normal',\n mediaSubtitles: 'Subtitles',\n mediaSubtitlesOff: 'Off',\n mediaQuality: 'Quality',\n mediaQualityAuto: 'Auto',\n mediaLive: 'Live',\n mediaError: 'This media can\\'t be played',\n mediaRepeat: 'Repeat',\n mediaRepeatOne: 'Repeat one',\n mediaShuffle: 'Shuffle',\n pdfViewer: 'PDF viewer',\n pdfThumbnails: 'Pages',\n pdfOutline: 'Contents',\n pdfPage: 'Page',\n pdfZoom: 'Zoom',\n pdfZoomIn: 'Zoom in',\n pdfZoomOut: 'Zoom out',\n pdfFitWidth: 'Fit to width',\n pdfFitPage: 'Fit page',\n pdfSearch: 'Find in document',\n pdfSearchPrevious: 'Previous match',\n pdfSearchNext: 'Next match',\n pdfMatchCount: '{current} of {total}',\n pdfNoMatches: 'No matches',\n pdfMore: 'More options',\n pdfRotate: 'Rotate',\n pdfDownload: 'Download',\n pdfPrint: 'Print',\n pdfFullscreen: 'Full screen',\n pdfExitFullscreen: 'Exit full screen',\n pdfPassword: 'This document is password protected',\n pdfPasswordLabel: 'Password',\n pdfWrongPassword: 'Wrong password',\n pdfOpen: 'Open',\n pdfError: 'This PDF can\\'t be opened',\n pdfLoading: 'Loading document',\n pdfAnnotate: 'Annotate',\n pdfSelect: 'Select',\n pdfHighlight: 'Highlight',\n pdfNote: 'Note',\n pdfDraw: 'Draw',\n pdfEraser: 'Eraser',\n pdfInkWidth: 'Line width {n} pt',\n pdfColor: 'Color',\n pdfUndo: 'Undo',\n pdfCopy: 'Copy',\n pdfDelete: 'Delete',\n pdfNotePlaceholder: 'Write a note',\n pdfAddComment: 'Add a comment',\n flowCanvas: 'Diagram',\n flowNode: 'node',\n flowEdge: 'Connection from {source} to {target}',\n flowZoomIn: 'Zoom in',\n flowZoomOut: 'Zoom out',\n flowFitView: 'Fit view',\n flowLock: 'Lock',\n flowUnlock: 'Unlock',\n flowUndo: 'Undo',\n flowRedo: 'Redo',\n flowMinimap: 'Mini map',\n flowMoved: '{label} moved',\n flowConnected: 'Connected {source} to {target}',\n flowDeleted: '{count} deleted',\n flowDeleteEdge: 'Delete connection',\n flowDelete: 'Delete',\n ganttChart: 'Gantt chart',\n ganttTask: 'Task',\n ganttStart: 'Start',\n ganttEnd: 'End',\n ganttDuration: 'Duration',\n ganttProgress: 'Progress',\n ganttDays: '{n} d',\n ganttHours: '{n} h',\n ganttMilestone: 'Milestone',\n ganttQuarter: 'Q{n}',\n ganttToday: 'Today',\n ganttZoomIn: 'Zoom in',\n ganttZoomOut: 'Zoom out',\n ganttExpandAll: 'Expand all',\n ganttCollapseAll: 'Collapse all',\n ganttExpand: 'Expand',\n ganttCollapse: 'Collapse',\n ganttUndo: 'Undo',\n ganttRedo: 'Redo',\n ganttScaleHour: 'Hours',\n ganttScaleDay: 'Days',\n ganttScaleWeek: 'Weeks',\n ganttScaleMonth: 'Months',\n ganttScaleQuarter: 'Quarters',\n ganttScaleYear: 'Years',\n ganttMoved: '{name}: {start} to {end}',\n ganttProgressSet: '{name}: {progress}% done',\n ganttLinked: '{from} linked to {to}',\n ganttUnlink: 'Remove dependency',\n ganttDeleted: '{count} deleted',\n ganttDelete: 'Delete',\n ganttReordered: '{name} moved to row {pos}',\n ganttSlack: 'Slack: {n} d',\n ganttCritical: 'Critical',\n ganttBaseline: 'Baseline',\n ganttEmpty: 'No tasks yet',\n ganttResize: 'Resize the task list',\n timelineResource: 'Resource',\n timelineConflict: 'Overlaps another booking',\n timelineMoved: '{title}: {resource}, {start} to {end}',\n timelineEmpty: 'No resources',\n cropArea: 'Crop area',\n cropRotateLeft: 'Rotate left',\n cropRotateRight: 'Rotate right',\n cropFlip: 'Flip horizontally',\n cropReset: 'Reset',\n cropFree: 'Free',\n drawCanvas: 'Drawing canvas',\n drawTools: 'Drawing tools',\n drawMore: 'More tools',\n drawSelect: 'Select',\n drawPan: 'Pan',\n drawPen: 'Pen',\n drawBrush: 'Brush',\n drawMarker: 'Marker',\n drawHighlighter: 'Highlighter',\n drawEraser: 'Eraser',\n drawStrokeEraser: 'Stroke eraser',\n drawLine: 'Line',\n drawArrow: 'Arrow',\n drawRect: 'Rectangle',\n drawEllipse: 'Ellipse',\n drawText: 'Text',\n drawFill: 'Fill',\n drawColor: 'Color',\n floorPlan: 'Floor plan',\n floorSeats: '{n} seats',\n floorRotate: 'Rotate',\n floorTools: 'Floor plan tools',\n floorMove: 'Move',\n floorDrawWall: 'Wall',\n floorDrawZone: 'Zone',\n floorAddTable: 'Add a table',\n floorAddDecor: 'Add decor',\n floorDuplicate: 'Duplicate',\n floorDelete: 'Delete',\n floorUndo: 'Undo',\n floorRedo: 'Redo',\n floorLabel: 'Label',\n floorSeatsField: 'Seats',\n floorShape: 'Shape',\n floorRound: 'Round',\n floorSquare: 'Square',\n floorLong: 'Long',\n floorAngle: 'Angle',\n floorColor: 'Color',\n floorThickness: 'Thickness',\n floorWidth: 'Width',\n floorHeight: 'Height',\n floorMerge: 'Merge tables',\n floorSplit: 'Split',\n floorNothingPicked: 'Pick a table, a zone, a wall or decor to change it',\n floorTablesPicked: '{n} tables picked',\n floorTableN: 'Table {label}',\n floorZone: 'Zone',\n floorWall: 'Wall',\n floorDeleteCorner: 'Delete the corner',\n floorFinishWall: 'Finish the wall',\n floorCancel: 'Cancel',\n floorDecorDoor: 'Door',\n floorDecorWindow: 'Window',\n floorDecorPlant: 'Plant',\n floorDecorColumn: 'Column',\n floorDecorRestroom: 'Restroom',\n floorDecorKitchen: 'Kitchen',\n floorDecorRegister: 'Register',\n floorDecorStairs: 'Stairs',\n floorDecorLabel: 'Text',\n drawCustomColor: 'Custom color',\n drawSize: 'Size',\n drawUndo: 'Undo',\n drawRedo: 'Redo',\n drawDelete: 'Delete selection',\n drawLayers: 'Layers',\n drawLayer: 'Layer {n}',\n drawLayerName: 'Layer name',\n drawAddLayer: 'Add layer',\n drawDeleteLayer: 'Delete layer',\n drawShowLayer: 'Show layer',\n drawHideLayer: 'Hide layer',\n drawLockLayer: 'Lock layer',\n drawUnlockLayer: 'Unlock layer',\n drawLayerUp: 'Move layer up',\n drawLayerDown: 'Move layer down',\n}\n\nexport const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>> = Symbol('m3-locale')\n\n/**\n * The locale given to `createM3UI()`, for components rendered outside the app that installed it:\n * `useToast()` and `useNotification()` mount their hosts with an app of their own, where the\n * plugin's `provide` doesn't reach. Inside the user's app the provided locale still wins.\n */\n// Wrapped in an object: a shallowRef holding a ref directly gets that ref unwrapped in its type.\nconst appLocale = shallowRef<{ locale: MaybeRef<Partial<M3Locale>> } | null>(null)\n\n/** @internal Called by `createM3UI()`; not exported from the package. */\nexport function __setAppLocale(locale: MaybeRef<Partial<M3Locale>> | null) {\n appLocale.value = locale ? { locale } : null\n}\n\nexport function useLocale(): M3Locale {\n const provided = inject(M3_LOCALE_KEY, null)\n const locale = reactive({ ...defaultLocale }) as M3Locale\n\n watchEffect(() => {\n Object.assign(locale, defaultLocale, toValue(provided ?? appLocale.value?.locale ?? {}))\n })\n\n return locale\n}\n"],"mappings":";;AAgcA,IAAa,IAA0B;CACrC,MAAM;CAEN,QAAQ;CACR,WAAW;CACX,OAAO;CACP,MAAM;CACN,QAAQ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CAAC;CAM5C,OAJA,QAAkB;EAChB,OAAO,OAAO,GAAQ,GAAe,EAAQ,KAAY,EAAU,OAAO,UAAU,CAAC,CAAC,CAAC;CACzF,CAAC,GAEM;AACT"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "./_storageKeys-CYXsUBwK.js";
|
|
2
|
+
import { t } from "./motion-DZiXG09o.js";
|
|
3
|
+
import { onBeforeUnmount as n, onMounted as r, ref as i } from "vue";
|
|
3
4
|
//#region src/composables/_themeTransition.ts
|
|
4
|
-
var
|
|
5
|
+
var a = [
|
|
5
6
|
"background",
|
|
6
7
|
"on-background",
|
|
7
8
|
"surface",
|
|
@@ -44,42 +45,27 @@ var i = [
|
|
|
44
45
|
`on-${e}-fixed`,
|
|
45
46
|
`on-${e}-fixed-variant`
|
|
46
47
|
])
|
|
47
|
-
].map((e) => `--color-${e}`),
|
|
48
|
-
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }`,
|
|
49
|
-
function
|
|
48
|
+
].map((e) => `--color-${e}`), o = 250, s = "m3-theme-transition", c = a.map((e) => `@property ${e} { syntax: '<color>'; inherits: true; initial-value: transparent; }`).join("\n") + `\nhtml.theme-switching { transition: ${a.map((e) => `${e} ${o}ms ease`).join(", ")}; }
|
|
49
|
+
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }`, l = () => typeof CSS < "u" && !!CSS.supports?.("-moz-appearance", "none") || typeof navigator < "u" && /\bGecko\/\d|\bFirefox\//.test(navigator.userAgent), u = () => typeof CSS < "u" && typeof CSS.registerProperty == "function", d;
|
|
50
|
+
function f(e) {
|
|
50
51
|
if (typeof document > "u" || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return e();
|
|
51
52
|
let t = document.documentElement;
|
|
52
|
-
if (!
|
|
53
|
-
if (!document.getElementById(
|
|
53
|
+
if (!l() && u()) {
|
|
54
|
+
if (!document.getElementById(s)) {
|
|
54
55
|
let e = document.createElement("style");
|
|
55
|
-
e.id =
|
|
56
|
+
e.id = s, e.textContent = c, document.head.appendChild(e);
|
|
56
57
|
}
|
|
57
|
-
t.classList.add("theme-switching"), t.offsetHeight, e(), clearTimeout(
|
|
58
|
-
t.classList.remove("theme-switching"), document.getElementById(
|
|
58
|
+
t.classList.add("theme-switching"), t.offsetHeight, e(), clearTimeout(d), d = setTimeout(() => {
|
|
59
|
+
t.classList.remove("theme-switching"), document.getElementById(s)?.remove();
|
|
59
60
|
}, 300);
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
t.classList.add("theme-transitioning"), t.offsetHeight, e(), setTimeout(() => t.classList.remove("theme-transitioning"), 300);
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
65
|
-
//#region src/composables/_storageKeys.ts
|
|
66
|
-
var f = "m3-theme", p = "m3-dynamic-palette", m = "m3-viewport", h = "", g = /* @__PURE__ */ new Set();
|
|
67
|
-
function _(e, t = h) {
|
|
68
|
-
return t ? `${t}-${e}` : e;
|
|
69
|
-
}
|
|
70
|
-
function v(e) {
|
|
71
|
-
if (e !== h) {
|
|
72
|
-
h = e;
|
|
73
|
-
for (let e of g) e();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function y(e) {
|
|
77
|
-
g.add(e);
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
66
|
//#region src/composables/useThemeTokens.ts
|
|
81
|
-
var
|
|
82
|
-
function
|
|
67
|
+
var p = t(.25, .1, .25, 1);
|
|
68
|
+
function m(e) {
|
|
83
69
|
let t = e.trim(), n = /^#([0-9a-f]{3,8})$/i.exec(t)?.[1];
|
|
84
70
|
if (n && n.length !== 5 && n.length !== 7) {
|
|
85
71
|
let e = n.length <= 4 ? [...n].map((e) => e + e).join("") : n, t = (t) => parseInt(e.slice(t, t + 2), 16);
|
|
@@ -102,32 +88,32 @@ function x(e) {
|
|
|
102
88
|
];
|
|
103
89
|
return s.every(Number.isFinite) ? s : null;
|
|
104
90
|
}
|
|
105
|
-
function
|
|
106
|
-
let r =
|
|
91
|
+
function h(e, t, n) {
|
|
92
|
+
let r = m(e), i = m(t);
|
|
107
93
|
if (!r || !i) return n < 1 ? e : t;
|
|
108
94
|
let [a, o, s, c] = r.map((e, t) => e + (i[t] - e) * n);
|
|
109
95
|
return `rgba(${Math.round(a)}, ${Math.round(o)}, ${Math.round(s)}, ${+c.toFixed(3)})`;
|
|
110
96
|
}
|
|
111
|
-
function
|
|
112
|
-
let
|
|
113
|
-
let
|
|
114
|
-
return Object.fromEntries(
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
function
|
|
119
|
-
cancelAnimationFrame(
|
|
120
|
-
let n =
|
|
121
|
-
let n = Math.min(1, (
|
|
122
|
-
i ?
|
|
97
|
+
function g(t, a = {}) {
|
|
98
|
+
let o = () => {
|
|
99
|
+
let e = getComputedStyle(document.documentElement);
|
|
100
|
+
return Object.fromEntries(t.map((t) => [t, e.getPropertyValue(`--color-${t}`).trim()]));
|
|
101
|
+
}, s = i(typeof document > "u" ? Object.fromEntries(t.map((e) => [e, ""])) : o()), c, l, u = 0, d = (e) => {
|
|
102
|
+
t.some((t) => e[t] !== s.value[t]) && (s.value = e);
|
|
103
|
+
}, f = () => d(o());
|
|
104
|
+
function m(e) {
|
|
105
|
+
cancelAnimationFrame(u);
|
|
106
|
+
let n = e.classList.contains("theme-switching"), r = { ...s.value }, i = n ? null : o(), a = performance.now(), c = (e) => {
|
|
107
|
+
let n = Math.min(1, (e - a) / 250);
|
|
108
|
+
i ? d(n < 1 ? Object.fromEntries(t.map((e) => [e, h(r[e], i[e], p(n))])) : i) : f(), n < 1 && (u = requestAnimationFrame(c));
|
|
123
109
|
};
|
|
124
|
-
|
|
110
|
+
u = requestAnimationFrame(c);
|
|
125
111
|
}
|
|
126
|
-
return
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}),
|
|
112
|
+
return r(() => {
|
|
113
|
+
let t = document.documentElement, n = (t) => (t instanceof Element ? t : t?.parentElement)?.id === e;
|
|
114
|
+
c = new MutationObserver((e) => {
|
|
115
|
+
e.some((e) => e.target === t || n(e.target) || Array.from(e.addedNodes).some(n)) && (a.live && (t.classList.contains("theme-switching") || t.classList.contains("theme-transitioning")) ? m(t) : f(), clearTimeout(l), l = setTimeout(f, 300));
|
|
116
|
+
}), c.observe(t, {
|
|
131
117
|
attributes: !0,
|
|
132
118
|
attributeFilter: [
|
|
133
119
|
"class",
|
|
@@ -135,16 +121,16 @@ function C(e, i = {}) {
|
|
|
135
121
|
"data-palette",
|
|
136
122
|
"data-contrast"
|
|
137
123
|
]
|
|
138
|
-
}),
|
|
124
|
+
}), c.observe(document.head, {
|
|
139
125
|
childList: !0,
|
|
140
126
|
characterData: !0,
|
|
141
127
|
subtree: !0
|
|
142
128
|
});
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
}),
|
|
129
|
+
}), n(() => {
|
|
130
|
+
c?.disconnect(), clearTimeout(l), cancelAnimationFrame(u);
|
|
131
|
+
}), s;
|
|
146
132
|
}
|
|
147
133
|
//#endregion
|
|
148
|
-
export {
|
|
134
|
+
export { f as n, g as t };
|
|
149
135
|
|
|
150
|
-
//# sourceMappingURL=useThemeTokens-
|
|
136
|
+
//# sourceMappingURL=useThemeTokens-DQQcaWbE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThemeTokens-DQQcaWbE.js","names":[],"sources":["../src/composables/_themeTransition.ts","../src/composables/useThemeTokens.ts"],"sourcesContent":["// Internal: animates a theme change (dark mode, palette, contrast).\n//\n// Firefox (and any browser without @property) transitions six color properties on every element\n// (`.theme-transitioning` in theme.css): smooth there, but in Chromium it recalculates every element's transitions\n// each frame and stutters. Chromium and WebKit instead transition the color tokens themselves, once, on <html>:\n// registered as <color> with @property they interpolate, and every element follows them through var(). Components'\n// own color transitions (transition-colors) are turned off meanwhile, or they would restart on every frame of the\n// token's change and trail behind the rest (the navbar and buttons did). A view transition was tried first: it\n// cross-fades two snapshots, which looks washed out midway compared to the colors moving.\n\n// The tokens of theme.css, palettes.css and generated palettes\nconst COLOR_TOKENS = [\n 'background', 'on-background', 'surface', 'surface-dim', 'surface-bright', 'surface-variant', 'on-surface',\n 'on-surface-variant', 'surface-container-lowest', 'surface-container-low', 'surface-container',\n 'surface-container-high', 'surface-container-highest', 'inverse-surface', 'inverse-on-surface', 'inverse-primary',\n 'outline', 'outline-variant', 'shadow', 'scrim',\n ...['primary', 'secondary', 'tertiary', 'error', 'success'].flatMap((c) => [c, `on-${c}`, `${c}-container`, `on-${c}-container`]),\n ...['primary', 'secondary', 'tertiary'].flatMap((c) => [`${c}-fixed`, `${c}-fixed-dim`, `on-${c}-fixed`, `on-${c}-fixed-variant`]),\n].map((t) => `--color-${t}`)\n\nconst DURATION = 250\n/** How long a theme switch's color transition takes, in ms (both paths) */\nexport const THEME_TRANSITION_MS = DURATION\nconst STYLE_ID = 'm3-theme-transition'\n\n// Injected only while switching: a registered <color> computes to rgb(), and code reading a token with\n// getPropertyValue() expects it as written\nconst css = COLOR_TOKENS.map((t) => `@property ${t} { syntax: '<color>'; inherits: true; initial-value: transparent; }`).join('\\n')\n + `\\nhtml.theme-switching { transition: ${COLOR_TOKENS.map((t) => `${t} ${DURATION}ms ease`).join(', ')}; }`\n + '\\nhtml.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }'\n\n// Gecko: a CSS feature only it has, or its user agent (\"Gecko/<version>\" or \"Firefox/\"; Chromium and WebKit only\n// say \"like Gecko\", and Firefox on iOS is WebKit and says \"FxiOS\")\nconst isGecko = () =>\n (typeof CSS !== 'undefined' && !!CSS.supports?.('-moz-appearance', 'none'))\n || (typeof navigator !== 'undefined' && /\\bGecko\\/\\d|\\bFirefox\\//.test(navigator.userAgent))\nconst hasProperty = () => typeof CSS !== 'undefined' && typeof CSS.registerProperty === 'function'\n\nlet timer: ReturnType<typeof setTimeout> | undefined\n\n/** Runs `apply` (the DOM writes of a theme change) with the theme transition. */\nexport function themeTransition(apply: () => void) {\n if (typeof document === 'undefined') return apply()\n const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n if (reduced) return apply()\n const root = document.documentElement\n\n if (!isGecko() && hasProperty()) {\n if (!document.getElementById(STYLE_ID)) {\n const style = document.createElement('style')\n style.id = STYLE_ID\n style.textContent = css\n document.head.appendChild(style)\n }\n root.classList.add('theme-switching')\n // Style flush: the tokens' current values are computed as registered colors and the transition is in place\n // before they change\n void root.offsetHeight\n apply()\n clearTimeout(timer)\n timer = setTimeout(() => {\n root.classList.remove('theme-switching')\n document.getElementById(STYLE_ID)?.remove()\n }, DURATION + 50)\n return\n }\n\n root.classList.add('theme-transitioning')\n // Force a style flush so the transition is in place before the colors change\n void root.offsetHeight\n apply()\n setTimeout(() => root.classList.remove('theme-transitioning'), 300)\n}\n","import { onBeforeUnmount, onMounted, ref, type Ref } from 'vue'\nimport { STYLE_ID } from './_storageKeys'\nimport { THEME_TRANSITION_MS } from './_themeTransition'\nimport { cubicBezier } from './motion'\n\nexport interface ThemeTokensOptions {\n /**\n * Updates every animation frame while the theme switch's colors fade, so a canvas redrawn on change fades with\n * the page instead of jumping to the new colors. Off by default: what animates color changes itself (Chart.js,\n * MChart, maps) only needs the final values, and would otherwise redraw ~15 times per switch.\n */\n live?: boolean\n}\n\n// The CSS `ease` the switch uses (_themeTransition.ts, and `.theme-transitioning` in theme.css)\nconst ease = cubicBezier(0.25, 0.1, 0.25, 1)\n\ntype Rgba = [number, number, number, number]\n\n// Hex (#rgb, #rgba, #rrggbb, #rrggbbaa) or rgb()/rgba(), the forms tokens are written in or computed to; null for\n// anything else (that token then switches at once)\nfunction parseColor(value: string): Rgba | null {\n const v = value.trim()\n const hex = /^#([0-9a-f]{3,8})$/i.exec(v)?.[1]\n if (hex && hex.length !== 5 && hex.length !== 7) {\n const full = hex.length <= 4 ? [...hex].map((c) => c + c).join('') : hex\n const n = (i: number) => parseInt(full.slice(i, i + 2), 16)\n return [n(0), n(2), n(4), full.length === 8 ? n(6) / 255 : 1]\n }\n const fn = /^rgba?\\(([^)]+)\\)$/i.exec(v)?.[1]\n if (!fn) return null\n const parts = fn.split(/[\\s,/]+/).filter(Boolean)\n if (parts.length < 3) return null\n const channel = (p: string) => (p.endsWith('%') ? parseFloat(p) * 2.55 : parseFloat(p))\n const alpha = parts[3] == null ? 1 : parts[3].endsWith('%') ? parseFloat(parts[3]) / 100 : parseFloat(parts[3])\n const rgba = [channel(parts[0]!), channel(parts[1]!), channel(parts[2]!), alpha] as Rgba\n return rgba.every(Number.isFinite) ? rgba : null\n}\n\nfunction mix(from: string, to: string, t: number): string {\n const a = parseColor(from)\n const b = parseColor(to)\n if (!a || !b) return t < 1 ? from : to\n const [r, g, bl, al] = a.map((x, i) => x + (b[i]! - x) * t)\n return `rgba(${Math.round(r!)}, ${Math.round(g!)}, ${Math.round(bl!)}, ${+al!.toFixed(3)})`\n}\n\n/**\n * The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across\n * light/dark, palette, contrast and generated (seed) palette changes: for what can't use CSS variables, like a\n * Chart.js dataset, a canvas or a MapLibre layer's paint. Values settle after the theme switch's color transition;\n * with `{ live: true }` they also follow it frame by frame (as `rgba()` midway). Empty strings on the server.\n *\n * ```ts\n * const colors = useThemeTokens(['primary', 'tertiary', 'outline-variant'] as const)\n * const data = computed(() => ({ datasets: [{ data: sales, borderColor: colors.value.primary }] }))\n * ```\n */\nexport function useThemeTokens<T extends string>(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>> {\n const read = () => {\n const style = getComputedStyle(document.documentElement)\n return Object.fromEntries(names.map((n) => [n, style.getPropertyValue(`--color-${n}`).trim()])) as Record<T, string>\n }\n const tokens = ref(typeof document === 'undefined' ? Object.fromEntries(names.map((n) => [n, ''])) as Record<T, string> : read()) as Ref<Record<T, string>>\n let observer: MutationObserver | undefined\n let settle: ReturnType<typeof setTimeout> | undefined\n let frame = 0\n\n const set = (next: Record<T, string>) => {\n if (names.some((n) => next[n] !== tokens.value[n])) tokens.value = next\n }\n const update = () => set(read())\n\n // Follows a switch already under way. Chromium/WebKit animate the tokens themselves (`theme-switching`), so\n // reading them each frame gives the page's own colors; Firefox fades each element's colors instead\n // (`theme-transitioning`) while the tokens jump, so the same `ease` is replayed here from the old values\n function follow(root: HTMLElement) {\n cancelAnimationFrame(frame)\n const native = root.classList.contains('theme-switching')\n const from = { ...tokens.value }\n const to = native ? null : read()\n const start = performance.now()\n const step = (now: number) => {\n const t = Math.min(1, (now - start) / THEME_TRANSITION_MS)\n // The last frame lands on the values as written, not their rgba() form\n if (to) set(t < 1 ? Object.fromEntries(names.map((n) => [n, mix(from[n], to[n], ease(t))])) as Record<T, string> : to)\n else update()\n if (t < 1) frame = requestAnimationFrame(step)\n }\n frame = requestAnimationFrame(step)\n }\n\n onMounted(() => {\n const root = document.documentElement\n // Dark mode (class), a palette or contrast (attributes), or a generated palette rewriting its <style> in <head>\n const isPaletteStyle = (node: Node | null) => (node instanceof Element ? node : node?.parentElement)?.id === STYLE_ID\n observer = new MutationObserver((records) => {\n if (!records.some((r) => r.target === root || isPaletteStyle(r.target)\n || Array.from(r.addedNodes).some(isPaletteStyle))) return\n if (options.live && (root.classList.contains('theme-switching') || root.classList.contains('theme-transitioning'))) follow(root)\n else update()\n // Chromium animates the tokens on a theme switch (_themeTransition, 250ms): read the settled values too\n clearTimeout(settle)\n settle = setTimeout(update, THEME_TRANSITION_MS + 50)\n })\n observer.observe(root, { attributes: true, attributeFilter: ['class', 'style', 'data-palette', 'data-contrast'] })\n observer.observe(document.head, { childList: true, characterData: true, subtree: true })\n })\n onBeforeUnmount(() => {\n observer?.disconnect()\n clearTimeout(settle)\n cancelAnimationFrame(frame)\n })\n\n return tokens\n}\n"],"mappings":";;;;AAWA,IAAM,IAAe;CACnB;CAAc;CAAiB;CAAW;CAAe;CAAkB;CAAmB;CAC9F;CAAsB;CAA4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AI,IAAI,IAAI,OAAO,YAAY,EAAM,KAAK,MAAM,CAAC,GAAG,EAAI,EAAK,IAAI,EAAG,IAAI,EAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAyB,CAAE,IAChH,EAAO,GACR,IAAI,MAAG,IAAQ,sBAAsB,CAAI;EAC/C;EACA,IAAQ,sBAAsB,CAAI;CACpC;CAwBA,OAtBA,QAAgB;EACd,IAAM,IAAO,SAAS,iBAEhB,KAAkB,OAAuB,aAAgB,UAAU,IAAO,GAAM,cAAA,EAAgB,OAAO;EAW7G,AAVA,IAAW,IAAI,kBAAkB,MAAY;GACtC,EAAQ,MAAM,MAAM,EAAE,WAAW,KAAQ,EAAe,EAAE,MAAM,KAChE,MAAM,KAAK,EAAE,UAAU,CAAC,CAAC,KAAK,CAAc,CAAC,MAC9C,EAAQ,SAAS,EAAK,UAAU,SAAS,iBAAiB,KAAK,EAAK,UAAU,SAAS,qBAAqB,KAAI,EAAO,CAAI,IAC1H,EAAO,GAEZ,aAAa,CAAM,GACnB,IAAS,WAAW,GAAA,GAAgC;EACtD,CAAC,GACD,EAAS,QAAQ,GAAM;GAAE,YAAY;GAAM,iBAAiB;IAAC;IAAS;IAAS;IAAgB;GAAe;EAAE,CAAC,GACjH,EAAS,QAAQ,SAAS,MAAM;GAAE,WAAW;GAAM,eAAe;GAAM,SAAS;EAAK,CAAC;CACzF,CAAC,GACD,QAAsB;EAGpB,AAFA,GAAU,WAAW,GACrB,aAAa,CAAM,GACnB,qBAAqB,CAAK;CAC5B,CAAC,GAEM;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3ui-vue/m3ui-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Material 3 component library for Vue 3 + Tailwind CSS v4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,6 +60,26 @@
|
|
|
60
60
|
"types": "./dist/map.d.ts",
|
|
61
61
|
"import": "./dist/map.js"
|
|
62
62
|
},
|
|
63
|
+
"./media": {
|
|
64
|
+
"types": "./dist/media.d.ts",
|
|
65
|
+
"import": "./dist/media.js"
|
|
66
|
+
},
|
|
67
|
+
"./pdf": {
|
|
68
|
+
"types": "./dist/pdf.d.ts",
|
|
69
|
+
"import": "./dist/pdf.js"
|
|
70
|
+
},
|
|
71
|
+
"./flow": {
|
|
72
|
+
"types": "./dist/flow.d.ts",
|
|
73
|
+
"import": "./dist/flow.js"
|
|
74
|
+
},
|
|
75
|
+
"./gantt": {
|
|
76
|
+
"types": "./dist/gantt.d.ts",
|
|
77
|
+
"import": "./dist/gantt.js"
|
|
78
|
+
},
|
|
79
|
+
"./draw": {
|
|
80
|
+
"types": "./dist/draw.d.ts",
|
|
81
|
+
"import": "./dist/draw.js"
|
|
82
|
+
},
|
|
63
83
|
"./styles": "./dist/styles.css",
|
|
64
84
|
"./theme": "./src/styles/theme.css",
|
|
65
85
|
"./palettes": "./src/styles/palettes.css",
|
|
@@ -74,8 +94,8 @@
|
|
|
74
94
|
"src"
|
|
75
95
|
],
|
|
76
96
|
"scripts": {
|
|
77
|
-
"build": "pnpm build:js && pnpm build:types && pnpm build:css
|
|
78
|
-
"build:js": "vite build && cp dist/m3ui-vue.css dist/styles.css && node scripts/third-party-licenses.mjs",
|
|
97
|
+
"build": "pnpm build:js && pnpm build:types && pnpm build:css",
|
|
98
|
+
"build:js": "vite build && cp dist/m3ui-vue.css dist/styles.css && node scripts/third-party-licenses.mjs && node scripts/generate-api.mjs",
|
|
79
99
|
"build:types": "vue-tsc -p tsconfig.build.json",
|
|
80
100
|
"build:css": "cp -r src/styles dist/",
|
|
81
101
|
"build:api": "node scripts/generate-api.mjs",
|
|
@@ -85,9 +105,9 @@
|
|
|
85
105
|
"prepublishOnly": "pnpm build"
|
|
86
106
|
},
|
|
87
107
|
"peerDependencies": {
|
|
108
|
+
"maplibre-gl": "^5.0.0",
|
|
88
109
|
"tailwindcss": "^4.0.0",
|
|
89
|
-
"vue": "^3.5.0"
|
|
90
|
-
"maplibre-gl": "^5.0.0"
|
|
110
|
+
"vue": "^3.5.0"
|
|
91
111
|
},
|
|
92
112
|
"peerDependenciesMeta": {
|
|
93
113
|
"@tiptap/vue-3": {
|
|
@@ -194,6 +214,9 @@
|
|
|
194
214
|
},
|
|
195
215
|
"maplibre-gl": {
|
|
196
216
|
"optional": true
|
|
217
|
+
},
|
|
218
|
+
"pdfjs-dist": {
|
|
219
|
+
"optional": true
|
|
197
220
|
}
|
|
198
221
|
},
|
|
199
222
|
"devDependencies": {
|
|
@@ -238,6 +261,7 @@
|
|
|
238
261
|
"jsbarcode": "^3.12.3",
|
|
239
262
|
"maplibre-gl": "^5.24.0",
|
|
240
263
|
"markdown-it": "^15.0.2",
|
|
264
|
+
"pdfjs-dist": "^6.4.299",
|
|
241
265
|
"qrcode-generator": "^2.0.4",
|
|
242
266
|
"typescript": "~6.0.3",
|
|
243
267
|
"vite": "^8.3.0",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { describe, it, expect, afterEach, vi } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { nextTick } from 'vue'
|
|
4
|
+
import MAudioPlayer from '../components/MAudioPlayer.vue'
|
|
5
|
+
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
vi.useRealTimers()
|
|
8
|
+
vi.restoreAllMocks()
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
describe('MAudioPlayer', () => {
|
|
12
|
+
it('mini: artwork, text, play/pause, and a click outside the buttons', async () => {
|
|
13
|
+
const w = mount(MAudioPlayer, { props: { variant: 'mini', duration: 60, title: 'Song', artist: 'Band', artwork: '/c.png' } })
|
|
14
|
+
expect(w.find('img').attributes('src')).toBe('/c.png')
|
|
15
|
+
expect(w.text()).toContain('Song')
|
|
16
|
+
expect(w.text()).toContain('Band')
|
|
17
|
+
await w.find('[aria-label="Play"]').trigger('click')
|
|
18
|
+
expect(w.emitted('update:playing')![0]).toEqual([true])
|
|
19
|
+
expect(w.emitted('click')).toBeUndefined()
|
|
20
|
+
await w.find('p').trigger('click')
|
|
21
|
+
expect(w.emitted('click')).toHaveLength(1)
|
|
22
|
+
// position/display come from @layer base (.m3-audio-mini), so a consumer's classes win
|
|
23
|
+
expect(w.classes()).not.toContain('relative')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('mini: the progress line follows the position', async () => {
|
|
27
|
+
const w = mount(MAudioPlayer, { props: { variant: 'mini', duration: 200, currentTime: 50 } })
|
|
28
|
+
await nextTick()
|
|
29
|
+
expect(w.find('.origin-left').attributes('style')).toContain('scaleX(0.25)')
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('standard: shuffle and repeat only when bound, repeat cycles off → all → one', async () => {
|
|
33
|
+
const w = mount(MAudioPlayer, { props: { duration: 60 } })
|
|
34
|
+
expect(w.find('[aria-label="Shuffle"]').exists()).toBe(false)
|
|
35
|
+
expect(w.find('[aria-label="Repeat"]').exists()).toBe(false)
|
|
36
|
+
await w.setProps({ shuffle: false, repeat: 'off' })
|
|
37
|
+
await w.find('[aria-label="Shuffle"]').trigger('click')
|
|
38
|
+
expect(w.emitted('update:shuffle')![0]).toEqual([true])
|
|
39
|
+
await w.find('[aria-label="Repeat"]').trigger('click')
|
|
40
|
+
expect(w.emitted('update:repeat')![0]).toEqual(['all'])
|
|
41
|
+
await w.setProps({ repeat: 'all' })
|
|
42
|
+
await w.find('[aria-label="Repeat"]').trigger('click')
|
|
43
|
+
expect(w.emitted('update:repeat')![1]).toEqual(['one'])
|
|
44
|
+
await w.setProps({ repeat: 'one' })
|
|
45
|
+
expect(w.find('[aria-label="Repeat one"]').exists()).toBe(true)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('emits previous and next; without one its button stays in place, disabled', async () => {
|
|
49
|
+
const w = mount(MAudioPlayer, { props: { duration: 60, hasNext: true } })
|
|
50
|
+
expect(w.find('[aria-label="Previous"]').attributes('disabled')).toBeDefined()
|
|
51
|
+
expect(w.find('[aria-label="Next"]').attributes('disabled')).toBeUndefined()
|
|
52
|
+
await w.find('[aria-label="Next"]').trigger('click')
|
|
53
|
+
expect(w.emitted('next')).toHaveLength(1)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('plays a file in a hidden audio element, looping with repeat one', () => {
|
|
57
|
+
const w = mount(MAudioPlayer, { props: { src: '/s.mp3', repeat: 'one' } })
|
|
58
|
+
const audio = w.find('audio')
|
|
59
|
+
expect(audio.find('source').attributes('src')).toBe('/s.mp3')
|
|
60
|
+
expect((audio.element as HTMLAudioElement).loop).toBe(true)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('a new track keeps playing', async () => {
|
|
64
|
+
const play = vi.spyOn(HTMLMediaElement.prototype, 'play').mockResolvedValue(undefined)
|
|
65
|
+
vi.spyOn(HTMLMediaElement.prototype, 'load').mockImplementation(() => {})
|
|
66
|
+
const w = mount(MAudioPlayer, { props: { src: '/a.mp3' } })
|
|
67
|
+
const el = w.find('audio').element
|
|
68
|
+
Object.defineProperty(el, 'paused', { value: false, configurable: true })
|
|
69
|
+
el.dispatchEvent(new Event('play'))
|
|
70
|
+
play.mockClear()
|
|
71
|
+
await w.setProps({ src: '/b.mp3' })
|
|
72
|
+
await nextTick()
|
|
73
|
+
expect(play).toHaveBeenCalled()
|
|
74
|
+
})
|
|
75
|
+
})
|