@m3ui-vue/m3ui-vue 0.1.0 → 0.1.2
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/README.md +80 -23
- package/dist/MIcon-CaEooCmZ.js +20 -0
- package/dist/MIcon-CaEooCmZ.js.map +1 -0
- package/dist/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +141 -0
- package/dist/chart.js.map +1 -0
- package/dist/code-editor.d.ts +2 -0
- package/dist/code-editor.js +379 -0
- package/dist/code-editor.js.map +1 -0
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendar.vue.d.ts +1 -1
- package/dist/components/MChart.vue.d.ts +2 -3
- package/dist/components/MCodeEditor.vue.d.ts +3 -1
- package/dist/components/MContainer.vue.d.ts +1 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +0 -2
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MProgressBar.vue.d.ts +1 -1
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheduler.vue.d.ts +1 -1
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpotlightSearch.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MTerminal.vue.d.ts +6 -6
- package/dist/components/MTextField.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/dist-Dsrzt6J5.js +1192 -0
- package/dist/dist-Dsrzt6J5.js.map +1 -0
- package/dist/index.d.ts +0 -6
- package/dist/m3ui-vue.css +2 -0
- package/dist/m3ui.js +2738 -3367
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.d.ts +1 -0
- package/dist/markdown.js +41 -0
- package/dist/markdown.js.map +1 -0
- package/dist/rich-text-editor.d.ts +1 -0
- package/dist/rich-text-editor.js +215 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/styles/theme.css +3 -0
- package/dist/styles.css +2 -0
- package/dist/terminal.d.ts +1 -0
- package/dist/terminal.js +97 -0
- package/dist/terminal.js.map +1 -0
- package/package.json +28 -2
- package/src/chart.ts +1 -0
- package/src/code-editor.ts +2 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MChart.vue +54 -47
- package/src/components/MCodeEditor.vue +149 -44
- package/src/components/MFab.vue +64 -48
- package/src/components/MMarkdown.vue +24 -17
- package/src/components/MMultiSelect.vue +3 -2
- package/src/components/MRichTextEditor.vue +101 -67
- package/src/components/MTerminal.vue +10 -8
- package/src/components/MTooltip.vue +8 -1
- package/src/index.ts +6 -6
- package/src/markdown.ts +1 -0
- package/src/rich-text-editor.ts +1 -0
- package/src/styles/theme.css +3 -0
- package/src/terminal.ts +1 -0
- package/dist/m3ui.css +0 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import MarkdownIt from 'markdown-it'
|
|
2
|
+
import { computed, ref, onMounted } from 'vue'
|
|
4
3
|
|
|
5
4
|
const props = withDefaults(
|
|
6
5
|
defineProps<{
|
|
@@ -11,23 +10,31 @@ const props = withDefaults(
|
|
|
11
10
|
{ breaks: true, linkify: true },
|
|
12
11
|
)
|
|
13
12
|
|
|
14
|
-
const md =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
const md = ref<any>(null)
|
|
14
|
+
|
|
15
|
+
onMounted(async () => {
|
|
16
|
+
const { default: MarkdownIt } = await import('markdown-it')
|
|
17
|
+
|
|
18
|
+
const instance = new MarkdownIt({
|
|
19
|
+
html: false,
|
|
20
|
+
breaks: props.breaks,
|
|
21
|
+
linkify: props.linkify,
|
|
22
|
+
typographer: true,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
instance.renderer.rules.link_open = (tokens: any, idx: number, options: any, _env: any, self: any) => {
|
|
26
|
+
const token = tokens[idx]
|
|
27
|
+
if (token) {
|
|
28
|
+
token.attrSet('target', '_blank')
|
|
29
|
+
token.attrSet('rel', 'noopener noreferrer')
|
|
30
|
+
}
|
|
31
|
+
return self.renderToken(tokens, idx, options)
|
|
26
32
|
}
|
|
27
|
-
return self.renderToken(tokens, idx, options)
|
|
28
|
-
}
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
md.value = instance
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const rendered = computed(() => md.value ? md.value.render(props.source) : '')
|
|
31
38
|
</script>
|
|
32
39
|
|
|
33
40
|
<template>
|
|
@@ -147,7 +147,8 @@ const triggerClasses = computed(() => {
|
|
|
147
147
|
|
|
148
148
|
return [
|
|
149
149
|
...base,
|
|
150
|
-
'rounded-t-sm bg-surface-container-highest border-b
|
|
150
|
+
'rounded-t-sm bg-surface-container-highest border-b pb-2',
|
|
151
|
+
hasValue.value || open.value ? 'pt-7' : 'pt-4',
|
|
151
152
|
open.value
|
|
152
153
|
? (props.error ? 'border-b-2 border-error' : 'border-b-2 border-primary')
|
|
153
154
|
: (props.error ? 'border-error' : 'border-on-surface-variant hover:border-on-surface'),
|
|
@@ -161,7 +162,7 @@ const labelClasses = computed(() => {
|
|
|
161
162
|
|
|
162
163
|
const floated = props.variant === 'outlined'
|
|
163
164
|
? '-top-2.5 translate-y-0 text-label-small bg-[var(--field-bg)] px-1 right-auto max-w-[calc(100%-1.5rem)]'
|
|
164
|
-
: 'top-
|
|
165
|
+
: 'top-2 translate-y-0 text-label-small'
|
|
165
166
|
|
|
166
167
|
const unFloated = 'top-1/2 -translate-y-1/2 text-body-large'
|
|
167
168
|
const active = open.value || hasValue.value
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { watch } from 'vue'
|
|
3
|
-
import { useEditor, EditorContent } from '@tiptap/vue-3'
|
|
4
|
-
import StarterKit from '@tiptap/starter-kit'
|
|
5
|
-
import Underline from '@tiptap/extension-underline'
|
|
6
|
-
import TextAlign from '@tiptap/extension-text-align'
|
|
7
|
-
import Link from '@tiptap/extension-link'
|
|
8
|
-
import Image from '@tiptap/extension-image'
|
|
9
|
-
import Highlight from '@tiptap/extension-highlight'
|
|
10
|
-
import Placeholder from '@tiptap/extension-placeholder'
|
|
11
|
-
import { TextStyle } from '@tiptap/extension-text-style'
|
|
12
|
-
import Color from '@tiptap/extension-color'
|
|
2
|
+
import { ref, watch, onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
|
13
3
|
import MIcon from './MIcon.vue'
|
|
14
4
|
|
|
15
5
|
const props = withDefaults(
|
|
@@ -24,28 +14,9 @@ const props = withDefaults(
|
|
|
24
14
|
|
|
25
15
|
const emit = defineEmits<{ 'update:modelValue': [string] }>()
|
|
26
16
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
extensions: [
|
|
31
|
-
StarterKit,
|
|
32
|
-
Underline,
|
|
33
|
-
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
34
|
-
Link.configure({ openOnClick: false }),
|
|
35
|
-
Image,
|
|
36
|
-
Highlight.configure({ multicolor: true }),
|
|
37
|
-
Placeholder.configure({ placeholder: props.placeholder }),
|
|
38
|
-
TextStyle,
|
|
39
|
-
Color,
|
|
40
|
-
],
|
|
41
|
-
onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
watch(() => props.modelValue, (val) => {
|
|
45
|
-
if (editor.value && editor.value.getHTML() !== val) editor.value.commands.setContent(val)
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
watch(() => props.disabled, (v) => editor.value?.setEditable(!v))
|
|
17
|
+
const ready = ref(false)
|
|
18
|
+
const editorRef = shallowRef<any>(null)
|
|
19
|
+
const editorContainer = ref<HTMLElement | null>(null)
|
|
49
20
|
|
|
50
21
|
interface ToolBtn {
|
|
51
22
|
icon: string
|
|
@@ -54,43 +25,106 @@ interface ToolBtn {
|
|
|
54
25
|
active?: () => boolean
|
|
55
26
|
}
|
|
56
27
|
|
|
57
|
-
const toolGroups
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
{
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
{
|
|
68
|
-
{
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
[
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
28
|
+
const toolGroups = ref<ToolBtn[][]>([])
|
|
29
|
+
|
|
30
|
+
onMounted(async () => {
|
|
31
|
+
const [
|
|
32
|
+
{ useEditor, EditorContent },
|
|
33
|
+
{ default: StarterKit },
|
|
34
|
+
{ default: Underline },
|
|
35
|
+
{ default: TextAlign },
|
|
36
|
+
{ default: Link },
|
|
37
|
+
{ default: Image },
|
|
38
|
+
{ default: Highlight },
|
|
39
|
+
{ default: Placeholder },
|
|
40
|
+
{ TextStyle },
|
|
41
|
+
{ default: Color },
|
|
42
|
+
] = await Promise.all([
|
|
43
|
+
import('@tiptap/vue-3'),
|
|
44
|
+
import('@tiptap/starter-kit'),
|
|
45
|
+
import('@tiptap/extension-underline'),
|
|
46
|
+
import('@tiptap/extension-text-align'),
|
|
47
|
+
import('@tiptap/extension-link'),
|
|
48
|
+
import('@tiptap/extension-image'),
|
|
49
|
+
import('@tiptap/extension-highlight'),
|
|
50
|
+
import('@tiptap/extension-placeholder'),
|
|
51
|
+
import('@tiptap/extension-text-style'),
|
|
52
|
+
import('@tiptap/extension-color'),
|
|
53
|
+
])
|
|
54
|
+
|
|
55
|
+
const editor = useEditor({
|
|
56
|
+
content: props.modelValue,
|
|
57
|
+
editable: !props.disabled,
|
|
58
|
+
extensions: [
|
|
59
|
+
StarterKit,
|
|
60
|
+
Underline,
|
|
61
|
+
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
62
|
+
Link.configure({ openOnClick: false }),
|
|
63
|
+
Image,
|
|
64
|
+
Highlight.configure({ multicolor: true }),
|
|
65
|
+
Placeholder.configure({ placeholder: props.placeholder }),
|
|
66
|
+
TextStyle,
|
|
67
|
+
Color,
|
|
68
|
+
],
|
|
69
|
+
onUpdate: ({ editor: e }) => emit('update:modelValue', e.getHTML()),
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
editorRef.value = editor
|
|
73
|
+
|
|
74
|
+
toolGroups.value = [
|
|
75
|
+
[
|
|
76
|
+
{ icon: 'format_bold', label: 'Negrita', action: () => editor.value?.chain().focus().toggleBold().run(), active: () => !!editor.value?.isActive('bold') },
|
|
77
|
+
{ icon: 'format_italic', label: 'Cursiva', action: () => editor.value?.chain().focus().toggleItalic().run(), active: () => !!editor.value?.isActive('italic') },
|
|
78
|
+
{ icon: 'format_underlined', label: 'Subrayado', action: () => editor.value?.chain().focus().toggleUnderline().run(), active: () => !!editor.value?.isActive('underline') },
|
|
79
|
+
{ icon: 'format_strikethrough', label: 'Tachado', action: () => editor.value?.chain().focus().toggleStrike().run(), active: () => !!editor.value?.isActive('strike') },
|
|
80
|
+
{ icon: 'ink_highlighter', label: 'Resaltar', action: () => editor.value?.chain().focus().toggleHighlight().run(), active: () => !!editor.value?.isActive('highlight') },
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
{ icon: 'format_list_bulleted', label: 'Lista', action: () => editor.value?.chain().focus().toggleBulletList().run(), active: () => !!editor.value?.isActive('bulletList') },
|
|
84
|
+
{ icon: 'format_list_numbered', label: 'Lista numerada', action: () => editor.value?.chain().focus().toggleOrderedList().run(), active: () => !!editor.value?.isActive('orderedList') },
|
|
85
|
+
{ icon: 'format_quote', label: 'Cita', action: () => editor.value?.chain().focus().toggleBlockquote().run(), active: () => !!editor.value?.isActive('blockquote') },
|
|
86
|
+
{ icon: 'code', label: 'Código', action: () => editor.value?.chain().focus().toggleCode().run(), active: () => !!editor.value?.isActive('code') },
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
{ icon: 'format_align_left', label: 'Izquierda', action: () => editor.value?.chain().focus().setTextAlign('left').run(), active: () => !!editor.value?.isActive({ textAlign: 'left' }) },
|
|
90
|
+
{ icon: 'format_align_center', label: 'Centro', action: () => editor.value?.chain().focus().setTextAlign('center').run(), active: () => !!editor.value?.isActive({ textAlign: 'center' }) },
|
|
91
|
+
{ icon: 'format_align_right', label: 'Derecha', action: () => editor.value?.chain().focus().setTextAlign('right').run(), active: () => !!editor.value?.isActive({ textAlign: 'right' }) },
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
{ icon: 'undo', label: 'Deshacer', action: () => editor.value?.chain().focus().undo().run() },
|
|
95
|
+
{ icon: 'redo', label: 'Rehacer', action: () => editor.value?.chain().focus().redo().run() },
|
|
96
|
+
],
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
// Mount EditorContent manually since we can't use the component from dynamic import in template
|
|
100
|
+
if (editorContainer.value) {
|
|
101
|
+
const app = await import('vue')
|
|
102
|
+
const editorApp = app.createApp(EditorContent, { editor: editor.value })
|
|
103
|
+
editorApp.mount(editorContainer.value)
|
|
104
|
+
onBeforeUnmount(() => editorApp.unmount())
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
watch(() => props.modelValue, (val) => {
|
|
108
|
+
if (editor.value && editor.value.getHTML() !== val) editor.value.commands.setContent(val)
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
watch(() => props.disabled, (v) => editor.value?.setEditable(!v))
|
|
112
|
+
|
|
113
|
+
ready.value = true
|
|
114
|
+
})
|
|
81
115
|
|
|
82
116
|
function insertLink() {
|
|
83
117
|
const url = window.prompt('URL del enlace:')
|
|
84
|
-
if (url)
|
|
118
|
+
if (url) editorRef.value?.value?.chain().focus().setLink({ href: url }).run()
|
|
85
119
|
}
|
|
86
120
|
|
|
87
121
|
function insertImage() {
|
|
88
122
|
const url = window.prompt('URL de la imagen:')
|
|
89
|
-
if (url)
|
|
123
|
+
if (url) editorRef.value?.value?.chain().focus().setImage({ src: url }).run()
|
|
90
124
|
}
|
|
91
125
|
|
|
92
126
|
function setHeading(level: 1 | 2 | 3) {
|
|
93
|
-
|
|
127
|
+
editorRef.value?.value?.chain().focus().toggleHeading({ level }).run()
|
|
94
128
|
}
|
|
95
129
|
</script>
|
|
96
130
|
|
|
@@ -100,19 +134,19 @@ function setHeading(level: 1 | 2 | 3) {
|
|
|
100
134
|
:class="disabled ? 'border-outline-variant/50 opacity-60' : 'border-outline-variant focus-within:border-primary'"
|
|
101
135
|
>
|
|
102
136
|
<!-- Toolbar -->
|
|
103
|
-
<div class="flex flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5">
|
|
137
|
+
<div v-if="ready" class="flex flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5">
|
|
104
138
|
<!-- Heading select -->
|
|
105
139
|
<select
|
|
106
140
|
class="h-8 cursor-pointer rounded bg-transparent px-2 text-label-large text-on-surface-variant outline-none hover:bg-on-surface/8"
|
|
107
141
|
:value="
|
|
108
|
-
|
|
109
|
-
:
|
|
110
|
-
:
|
|
142
|
+
editorRef?.value?.isActive('heading', { level: 1 }) ? '1'
|
|
143
|
+
: editorRef?.value?.isActive('heading', { level: 2 }) ? '2'
|
|
144
|
+
: editorRef?.value?.isActive('heading', { level: 3 }) ? '3'
|
|
111
145
|
: '0'
|
|
112
146
|
"
|
|
113
147
|
@change="(e: Event) => {
|
|
114
148
|
const v = (e.target as HTMLSelectElement).value
|
|
115
|
-
if (v === '0')
|
|
149
|
+
if (v === '0') editorRef?.value?.chain().focus().setParagraph().run()
|
|
116
150
|
else setHeading(Number(v) as 1 | 2 | 3)
|
|
117
151
|
}"
|
|
118
152
|
>
|
|
@@ -160,8 +194,8 @@ function setHeading(level: 1 | 2 | 3) {
|
|
|
160
194
|
</div>
|
|
161
195
|
|
|
162
196
|
<!-- Editor content -->
|
|
163
|
-
<
|
|
164
|
-
|
|
197
|
+
<div
|
|
198
|
+
ref="editorContainer"
|
|
165
199
|
class="rte-content bg-surface px-4 py-3 text-body-large text-on-surface"
|
|
166
200
|
:style="{ minHeight: minHeight }"
|
|
167
201
|
/>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
|
|
3
|
-
import { Terminal } from '@xterm/xterm'
|
|
4
|
-
import { FitAddon } from '@xterm/addon-fit'
|
|
5
3
|
import MIcon from './MIcon.vue'
|
|
6
4
|
|
|
7
5
|
const props = withDefaults(
|
|
@@ -25,8 +23,8 @@ const emit = defineEmits<{
|
|
|
25
23
|
}>()
|
|
26
24
|
|
|
27
25
|
const containerRef = ref<HTMLElement | null>(null)
|
|
28
|
-
let terminal:
|
|
29
|
-
let fitAddon:
|
|
26
|
+
let terminal: any = null
|
|
27
|
+
let fitAddon: any = null
|
|
30
28
|
let resizeObserver: ResizeObserver | null = null
|
|
31
29
|
let lineBuffer = ''
|
|
32
30
|
|
|
@@ -44,11 +42,16 @@ function getThemeColors() {
|
|
|
44
42
|
onMounted(async () => {
|
|
45
43
|
if (!containerRef.value) return
|
|
46
44
|
|
|
45
|
+
const [xtermMod, fitMod] = await Promise.all([
|
|
46
|
+
import('@xterm/xterm'),
|
|
47
|
+
import('@xterm/addon-fit'),
|
|
48
|
+
])
|
|
49
|
+
|
|
47
50
|
try { await import('@xterm/xterm/css/xterm.css') } catch { /* consumer will provide styles */ }
|
|
48
51
|
|
|
49
52
|
const colors = getThemeColors()
|
|
50
53
|
|
|
51
|
-
terminal = new Terminal({
|
|
54
|
+
terminal = new xtermMod.Terminal({
|
|
52
55
|
fontFamily: "'JetBrains Mono', 'Fira Code', 'Consolas', monospace",
|
|
53
56
|
fontSize: 14,
|
|
54
57
|
lineHeight: 1.4,
|
|
@@ -65,7 +68,7 @@ onMounted(async () => {
|
|
|
65
68
|
convertEol: true,
|
|
66
69
|
})
|
|
67
70
|
|
|
68
|
-
fitAddon = new FitAddon()
|
|
71
|
+
fitAddon = new fitMod.FitAddon()
|
|
69
72
|
terminal.loadAddon(fitAddon)
|
|
70
73
|
terminal.open(containerRef.value)
|
|
71
74
|
|
|
@@ -76,7 +79,7 @@ onMounted(async () => {
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
if (!props.readonly) {
|
|
79
|
-
terminal.onData((data) => {
|
|
82
|
+
terminal.onData((data: string) => {
|
|
80
83
|
emit('input', data)
|
|
81
84
|
|
|
82
85
|
if (data === '\r') {
|
|
@@ -143,4 +146,3 @@ defineExpose({
|
|
|
143
146
|
/>
|
|
144
147
|
</div>
|
|
145
148
|
</template>
|
|
146
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { nextTick, ref } from 'vue'
|
|
2
|
+
import { nextTick, onMounted, onUnmounted, ref } from 'vue'
|
|
3
3
|
|
|
4
4
|
const props = withDefaults(defineProps<{
|
|
5
5
|
text: string
|
|
@@ -27,6 +27,10 @@ function hide() {
|
|
|
27
27
|
visible.value = false
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function onScroll() {
|
|
31
|
+
if (visible.value) hide()
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
function reposition() {
|
|
31
35
|
if (!triggerEl.value || !tipEl.value) return
|
|
32
36
|
const tr = triggerEl.value.getBoundingClientRect()
|
|
@@ -45,6 +49,9 @@ function reposition() {
|
|
|
45
49
|
left = Math.max(6, Math.min(left, window.innerWidth - tt.width - 6))
|
|
46
50
|
tipStyle.value = { top: `${top}px`, left: `${left}px` }
|
|
47
51
|
}
|
|
52
|
+
|
|
53
|
+
onMounted(() => window.addEventListener('scroll', onScroll, true))
|
|
54
|
+
onUnmounted(() => window.removeEventListener('scroll', onScroll, true))
|
|
48
55
|
</script>
|
|
49
56
|
|
|
50
57
|
<template>
|
package/src/index.ts
CHANGED
|
@@ -21,10 +21,10 @@ export { default as MBreadcrumbs } from './components/MBreadcrumbs.vue'
|
|
|
21
21
|
export { default as MButton } from './components/MButton.vue'
|
|
22
22
|
export { default as MCalendar } from './components/MCalendar.vue'
|
|
23
23
|
export { default as MCard } from './components/MCard.vue'
|
|
24
|
-
|
|
24
|
+
// MChart — import from '@m3ui-vue/m3ui-vue/chart'
|
|
25
25
|
export { default as MCheckbox } from './components/MCheckbox.vue'
|
|
26
26
|
export { default as MChip } from './components/MChip.vue'
|
|
27
|
-
|
|
27
|
+
// MCodeEditor — import from '@m3ui-vue/m3ui-vue/code-editor'
|
|
28
28
|
export { default as MColorPicker } from './components/MColorPicker.vue'
|
|
29
29
|
export { default as MCommandPalette } from './components/MCommandPalette.vue'
|
|
30
30
|
export { default as MConfirmDialog } from './components/MConfirmDialog.vue'
|
|
@@ -45,11 +45,11 @@ export { default as MHotkeys } from './components/MHotkeys.vue'
|
|
|
45
45
|
export { default as MIcon } from './components/MIcon.vue'
|
|
46
46
|
export { default as MIconButton } from './components/MIconButton.vue'
|
|
47
47
|
export { default as MInfiniteScroll } from './components/MInfiniteScroll.vue'
|
|
48
|
-
|
|
48
|
+
// MJsonEditor — import from '@m3ui-vue/m3ui-vue/code-editor'
|
|
49
49
|
export { default as MJsonViewer } from './components/MJsonViewer.vue'
|
|
50
50
|
export { default as MKanban } from './components/MKanban.vue'
|
|
51
51
|
export { default as MLoadingOverlay } from './components/MLoadingOverlay.vue'
|
|
52
|
-
|
|
52
|
+
// MMarkdown — import from '@m3ui-vue/m3ui-vue/markdown'
|
|
53
53
|
export { default as MMasonry } from './components/MMasonry.vue'
|
|
54
54
|
export { default as MMenu } from './components/MMenu.vue'
|
|
55
55
|
export { default as MMenuItem } from './components/MMenuItem.vue'
|
|
@@ -63,7 +63,7 @@ export { default as MRadio } from './components/MRadio.vue'
|
|
|
63
63
|
export { default as MRadioGroup } from './components/MRadioGroup.vue'
|
|
64
64
|
export { default as MRating } from './components/MRating.vue'
|
|
65
65
|
export { default as MResult } from './components/MResult.vue'
|
|
66
|
-
|
|
66
|
+
// MRichTextEditor — import from '@m3ui-vue/m3ui-vue/rich-text-editor'
|
|
67
67
|
export { default as MScheduler } from './components/MScheduler.vue'
|
|
68
68
|
export { default as MSegmentedButton } from './components/MSegmentedButton.vue'
|
|
69
69
|
export { default as MSelect } from './components/MSelect.vue'
|
|
@@ -80,7 +80,7 @@ export { default as MStepper } from './components/MStepper.vue'
|
|
|
80
80
|
export { default as MSwitch } from './components/MSwitch.vue'
|
|
81
81
|
export { default as MTable } from './components/MTable.vue'
|
|
82
82
|
export { default as MTabs } from './components/MTabs.vue'
|
|
83
|
-
|
|
83
|
+
// MTerminal — import from '@m3ui-vue/m3ui-vue/terminal'
|
|
84
84
|
export { default as MTextField } from './components/MTextField.vue'
|
|
85
85
|
export { default as MTimeline } from './components/MTimeline.vue'
|
|
86
86
|
export { default as MTimePicker } from './components/MTimePicker.vue'
|
package/src/markdown.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MMarkdown } from './components/MMarkdown.vue'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MRichTextEditor } from './components/MRichTextEditor.vue'
|
package/src/styles/theme.css
CHANGED
package/src/terminal.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MTerminal } from './components/MTerminal.vue'
|
package/dist/m3ui.css
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
.bs-scrim[data-v-941a89e7]{transition:opacity .3s}.bs-enter-from .bs-scrim[data-v-941a89e7],.bs-leave-to .bs-scrim[data-v-941a89e7]{opacity:0}.bs-panel[data-v-941a89e7]{transition:transform .32s cubic-bezier(.2,0,0,1),opacity .24s}.bs-enter-from .bs-panel[data-v-941a89e7]{opacity:0;transform:translateY(40%)}.bs-leave-to .bs-panel[data-v-941a89e7]{opacity:0;transform:translateY(100%)!important}@keyframes m3-wavy-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes m3-wavy-travel{0%{stroke-dashoffset:0}to{stroke-dashoffset:calc(var(--m3-wave-len) * -1px)}}@media (prefers-reduced-motion:reduce){.animate-\[m3-wavy-spin_2\.8s_linear_infinite\]{animation:2.8s linear infinite m3-wavy-spin}.animate-\[m3-wavy-travel_2s_linear_infinite\]{animation:none!important}}.code-editor-container[data-v-13fd6808] .cm-editor{height:100%;min-height:inherit;font-family:JetBrains Mono,Fira Code,Consolas,monospace;font-size:.875rem}.code-editor-container[data-v-13fd6808] .cm-editor.cm-focused{outline:none}.code-editor-container[data-v-13fd6808] .cm-scroller{min-height:inherit}.code-editor-container[data-v-13fd6808] .cm-gutters{background:var(--color-surface-container);border-right:1px solid var(--color-outline-variant);color:var(--color-on-surface-variant)}.code-editor-container[data-v-13fd6808] .cm-activeLineGutter{background:var(--color-surface-container-high)}.code-editor-container[data-v-13fd6808] .cm-activeLine{background:var(--color-surface-container-lowest)}.code-editor-container[data-v-13fd6808] .cm-selectionBackground{background:var(--color-primary-container)!important}.code-editor-container[data-v-13fd6808] .cm-cursor{border-left-color:var(--color-primary)}.code-editor-container[data-v-13fd6808] .cm-matchingBracket{background:var(--color-tertiary-container);color:var(--color-on-tertiary-container)}.code-editor-container[data-v-13fd6808] .cm-foldGutter span{color:var(--color-on-surface-variant)}.hue-slider[data-v-9ee0043f]{background:linear-gradient(90deg,red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.hue-slider[data-v-9ee0043f]::-webkit-slider-thumb{-webkit-appearance:none;cursor:pointer;background:#fff;border-radius:50%;width:16px;height:16px;box-shadow:0 1px 3px #0006}.hue-slider[data-v-9ee0043f]::-moz-range-thumb{cursor:pointer;background:#fff;border:none;border-radius:50%;width:16px;height:16px;box-shadow:0 1px 3px #0006}.m3-cmd-enter-active[data-v-da578f14],.m3-cmd-leave-active[data-v-da578f14]{transition:opacity .15s}.m3-cmd-enter-from[data-v-da578f14],.m3-cmd-leave-to[data-v-da578f14]{opacity:0}.m3-cmd-enter-active .cmd-box[data-v-da578f14],.m3-cmd-leave-active .cmd-box[data-v-da578f14]{transition:transform .15s}.m3-cmd-enter-from .cmd-box[data-v-da578f14],.m3-cmd-leave-to .cmd-box[data-v-da578f14]{transform:scale(.95)translateY(-10px)}.m3-dialog-enter-active[data-v-e7dfca29],.m3-dialog-leave-active[data-v-e7dfca29]{transition:opacity .15s}.m3-dialog-enter-from[data-v-e7dfca29],.m3-dialog-leave-to[data-v-e7dfca29]{opacity:0}.m3-dialog-enter-active .dialog-box[data-v-e7dfca29],.m3-dialog-leave-active .dialog-box[data-v-e7dfca29]{transition:transform .15s}.m3-dialog-enter-from .dialog-box[data-v-e7dfca29],.m3-dialog-leave-to .dialog-box[data-v-e7dfca29]{transform:scale(.95)}.expand-grid[data-v-89e4475b]{grid-template-rows:1fr;display:grid}.expand-body[data-v-89e4475b]{min-height:0;overflow:hidden}.expand-enter-active[data-v-89e4475b]{transition:grid-template-rows .28s cubic-bezier(.2,0,0,1)}.expand-enter-active>.expand-body[data-v-89e4475b]{transition:opacity .22s}.expand-enter-from[data-v-89e4475b]{grid-template-rows:0fr}.expand-enter-from>.expand-body[data-v-89e4475b]{opacity:0}.expand-leave-active[data-v-89e4475b]{transition:grid-template-rows .22s cubic-bezier(.4,0,1,1)}.expand-leave-active>.expand-body[data-v-89e4475b]{transition:opacity .15s}.expand-leave-to[data-v-89e4475b]{grid-template-rows:0fr}.expand-leave-to>.expand-body[data-v-89e4475b]{opacity:0}.m3-file-enter-active[data-v-34a862f0],.m3-file-leave-active[data-v-34a862f0]{transition:all .2s}.m3-file-enter-from[data-v-34a862f0],.m3-file-leave-to[data-v-34a862f0]{opacity:0;transform:translateY(-8px)}.m3-markdown[data-v-34ce7e42] h1{font-size:var(--text-headline-large);line-height:var(--text-headline-large--line-height);color:var(--color-on-surface);margin:1em 0 .5em;font-weight:600}.m3-markdown[data-v-34ce7e42] h2{font-size:var(--text-headline-medium);line-height:var(--text-headline-medium--line-height);color:var(--color-on-surface);margin:1em 0 .5em;font-weight:600}.m3-markdown[data-v-34ce7e42] h3{font-size:var(--text-headline-small);line-height:var(--text-headline-small--line-height);color:var(--color-on-surface);margin:.75em 0 .25em;font-weight:600}.m3-markdown[data-v-34ce7e42] h4{font-size:var(--text-title-large);line-height:var(--text-title-large--line-height);color:var(--color-on-surface);margin:.75em 0 .25em;font-weight:600}.m3-markdown[data-v-34ce7e42] p{margin:.5em 0}.m3-markdown[data-v-34ce7e42] a{color:var(--color-primary);text-underline-offset:2px;text-decoration:underline}.m3-markdown[data-v-34ce7e42] a:hover{opacity:.8}.m3-markdown[data-v-34ce7e42] strong{color:var(--color-on-surface);font-weight:600}.m3-markdown[data-v-34ce7e42] em{font-style:italic}.m3-markdown[data-v-34ce7e42] ul,.m3-markdown[data-v-34ce7e42] ol{margin:.5em 0;padding-left:1.5em}.m3-markdown[data-v-34ce7e42] li{margin:.25em 0}.m3-markdown[data-v-34ce7e42] li::marker{color:var(--color-on-surface-variant)}.m3-markdown[data-v-34ce7e42] blockquote{border-left:3px solid var(--color-primary);background:var(--color-surface-container);color:var(--color-on-surface-variant);border-radius:0 8px 8px 0;margin:.75em 0;padding:.5em 1em}.m3-markdown[data-v-34ce7e42] code{background:var(--color-surface-container-highest);color:var(--color-primary);border-radius:4px;padding:.15em .4em;font-family:JetBrains Mono,Fira Code,monospace;font-size:.875em}.m3-markdown[data-v-34ce7e42] pre{background:var(--color-surface-container-highest);border:1px solid var(--color-outline-variant);border-radius:12px;margin:.75em 0;padding:1em;overflow-x:auto}.m3-markdown[data-v-34ce7e42] pre code{color:var(--color-on-surface);background:0 0;padding:0}.m3-markdown[data-v-34ce7e42] hr{border:none;border-top:1px solid var(--color-outline-variant);margin:1.5em 0}.m3-markdown[data-v-34ce7e42] table{border-collapse:collapse;width:100%;margin:.75em 0}.m3-markdown[data-v-34ce7e42] th{background:var(--color-surface-container);text-align:left;border-bottom:2px solid var(--color-outline-variant);font-weight:600;font-size:var(--text-label-large);color:var(--color-on-surface);padding:.5em .75em}.m3-markdown[data-v-34ce7e42] td{border-bottom:1px solid var(--color-outline-variant);padding:.5em .75em}.m3-markdown[data-v-34ce7e42] img{border-radius:12px;max-width:100%;height:auto;margin:.5em 0}.nd-scrim[data-v-98c11a62]{transition:opacity .28s}.nd-enter-from .nd-scrim[data-v-98c11a62],.nd-leave-to .nd-scrim[data-v-98c11a62]{opacity:0}.nd-panel[data-v-98c11a62]{transition:transform .3s cubic-bezier(.2,0,0,1)}.nd-enter-from .nd-panel[data-v-98c11a62],.nd-leave-to .nd-panel[data-v-98c11a62]{transform:translate(-100%)}@keyframes m3-wave-flow{0%{transform:translate(0)}to{transform:translate(-20px)}}@keyframes m3-progress-indeterminate{0%{left:-40%}to{left:100%}}@media (prefers-reduced-motion:reduce){.animate-\[m3-wave-flow_1\.2s_linear_infinite\],.animate-\[m3-wave-flow_0\.9s_linear_infinite\],.animate-\[m3-progress-indeterminate_1\.6s_ease-in-out_infinite\]{animation:none!important}}.m3-radio-dot[data-v-cdb650b5]{transform-box:fill-box;transform-origin:50%;transition:transform .15s;transform:scale(0)}.m3-radio-dot.is-checked[data-v-cdb650b5]{transform:scale(1)}.rte-content[data-v-bff72fc5] .tiptap{min-height:inherit;outline:none}.rte-content[data-v-bff72fc5] .tiptap p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:var(--color-on-surface-variant);opacity:.5;pointer-events:none;height:0}.rte-content[data-v-bff72fc5] h1{font-size:var(--text-headline-large);line-height:var(--text-headline-large--line-height);margin:.75em 0 .25em;font-weight:600}.rte-content[data-v-bff72fc5] h2{font-size:var(--text-headline-medium);line-height:var(--text-headline-medium--line-height);margin:.75em 0 .25em;font-weight:600}.rte-content[data-v-bff72fc5] h3{font-size:var(--text-headline-small);line-height:var(--text-headline-small--line-height);margin:.75em 0 .25em;font-weight:600}.rte-content[data-v-bff72fc5] p{margin:.5em 0}.rte-content[data-v-bff72fc5] ul,.rte-content[data-v-bff72fc5] ol{margin:.5em 0;padding-left:1.5em}.rte-content[data-v-bff72fc5] blockquote{border-left:3px solid var(--color-primary);color:var(--color-on-surface-variant);margin:.5em 0;padding-left:1em}.rte-content[data-v-bff72fc5] code{background:var(--color-surface-container-highest);border-radius:4px;padding:.15em .4em;font-size:.875em}.rte-content[data-v-bff72fc5] pre{background:var(--color-surface-container-highest);border-radius:8px;margin:.5em 0;padding:1em;overflow-x:auto}.rte-content[data-v-bff72fc5] pre code{background:0 0;padding:0}.rte-content[data-v-bff72fc5] a{color:var(--color-primary);text-decoration:underline}.rte-content[data-v-bff72fc5] mark{background:var(--color-tertiary-container);color:var(--color-on-tertiary-container);border-radius:2px;padding:.1em .2em}.rte-content[data-v-bff72fc5] img{border-radius:8px;max-width:100%;height:auto;margin:.5em 0}.ss-scrim[data-v-f8751672]{transition:opacity .28s}.ss-enter-from .ss-scrim[data-v-f8751672],.ss-leave-to .ss-scrim[data-v-f8751672]{opacity:0}.ss-panel[data-v-f8751672]{transition:transform .32s cubic-bezier(.2,0,0,1),opacity .24s}.ss-enter-from .ss-panel[data-v-f8751672]{opacity:0;transform:translate(40%)}.ss-leave-to .ss-panel[data-v-f8751672]{opacity:0;transform:translate(100%)!important}@keyframes skeleton-wave-move-32ecf05b{0%{transform:translate(-100%)}60%{transform:translate(100%)}to{transform:translate(100%)}}.skeleton-wave[data-v-32ecf05b]{position:relative;overflow:hidden}.skeleton-wave[data-v-32ecf05b]:after{content:"";background:linear-gradient(90deg, transparent 0%, var(--color-on-surface) 50%, transparent 100%);opacity:.06;animation:1.8s ease-in-out infinite skeleton-wave-move-32ecf05b;position:absolute;inset:0}.toast-row[data-v-e83a5c10]{grid-template-rows:1fr;padding-bottom:8px;display:grid}.toast-row>.toast-inner[data-v-e83a5c10]{min-height:0}.m3-toast-bot-enter-active[data-v-e83a5c10]{transition:grid-template-rows .22s cubic-bezier(.2,0,0,1),padding-bottom .22s cubic-bezier(.2,0,0,1);overflow:hidden}.m3-toast-bot-enter-active>.toast-inner[data-v-e83a5c10]{transition:opacity .18s,transform .22s cubic-bezier(.2,0,0,1)}.m3-toast-bot-enter-from[data-v-e83a5c10]{grid-template-rows:0fr;padding-bottom:0}.m3-toast-bot-enter-from>.toast-inner[data-v-e83a5c10]{opacity:0;transform:translateY(20px)scale(.94)}.m3-toast-bot-leave-active[data-v-e83a5c10]{transition:grid-template-rows .3s cubic-bezier(.2,0,0,1),padding-bottom .3s cubic-bezier(.2,0,0,1);overflow:hidden}.m3-toast-bot-leave-active>.toast-inner[data-v-e83a5c10]{transition:opacity .18s,transform .18s}.m3-toast-bot-leave-to[data-v-e83a5c10]{grid-template-rows:0fr;padding-bottom:0}.m3-toast-bot-leave-to>.toast-inner[data-v-e83a5c10]{opacity:0;transform:scale(.92)}.m3-toast-top-enter-active[data-v-e83a5c10]{transition:grid-template-rows .22s cubic-bezier(.2,0,0,1),padding-bottom .22s cubic-bezier(.2,0,0,1);overflow:hidden}.m3-toast-top-enter-active>.toast-inner[data-v-e83a5c10]{transition:opacity .18s,transform .22s cubic-bezier(.2,0,0,1)}.m3-toast-top-enter-from[data-v-e83a5c10]{grid-template-rows:0fr;padding-bottom:0}.m3-toast-top-enter-from>.toast-inner[data-v-e83a5c10]{opacity:0;transform:translateY(-20px)scale(.94)}.m3-toast-top-leave-active[data-v-e83a5c10]{transition:grid-template-rows .3s cubic-bezier(.2,0,0,1),padding-bottom .3s cubic-bezier(.2,0,0,1);overflow:hidden}.m3-toast-top-leave-active>.toast-inner[data-v-e83a5c10]{transition:opacity .18s,transform .18s}.m3-toast-top-leave-to[data-v-e83a5c10]{grid-template-rows:0fr;padding-bottom:0}.m3-toast-top-leave-to>.toast-inner[data-v-e83a5c10]{opacity:0;transform:scale(.92)}@keyframes m3-toast-progress-e83a5c10{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.m3-spot-enter-active[data-v-51b103ff],.m3-spot-leave-active[data-v-51b103ff]{transition:opacity .15s}.m3-spot-enter-from[data-v-51b103ff],.m3-spot-leave-to[data-v-51b103ff]{opacity:0}.m3-spot-enter-active .spot-box[data-v-51b103ff],.m3-spot-leave-active .spot-box[data-v-51b103ff]{transition:transform .15s,opacity .15s}.m3-spot-enter-from .spot-box[data-v-51b103ff]{opacity:0;transform:scale(.96)translateY(-8px)}.m3-spot-leave-to .spot-box[data-v-51b103ff]{opacity:0;transform:scale(.98)}.m3-tour-highlight{box-shadow:0 0 0 4px var(--color-primary), 0 0 0 9999px #0006;border-radius:8px;position:relative;z-index:101!important}.m3-tour-enter-active,.m3-tour-leave-active{transition:opacity .2s}.m3-tour-enter-from,.m3-tour-leave-to{opacity:0}
|
|
2
|
-
/*$vite$:1*/
|