@m3ui-vue/m3ui-vue 0.8.0 → 0.8.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/README.md +9 -1
- package/dist/{MMenuItem-vSLbJGqe.js → MMenuItem-CDWfeU4F.js} +48 -36
- package/dist/MMenuItem-CDWfeU4F.js.map +1 -0
- package/dist/code-editor.js +1 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MButton.vue.d.ts +7 -0
- package/dist/components/MCalendar.vue.d.ts +0 -1
- package/dist/components/MCarousel.vue.d.ts +12 -14
- package/dist/components/MDatePicker.vue.d.ts +1 -3
- package/dist/components/MDatePickerModal.vue.d.ts +0 -1
- package/dist/components/MDateRangePicker.vue.d.ts +1 -3
- package/dist/components/MDateRangePickerModal.vue.d.ts +0 -1
- package/dist/components/MKanban.vue.d.ts +1 -0
- package/dist/components/MScheduler.vue.d.ts +0 -1
- package/dist/components/MShape.vue.d.ts +51 -0
- package/dist/components/MShortNavigationBar.vue.d.ts +34 -0
- package/dist/components/MSimpleCarousel.vue.d.ts +45 -0
- package/dist/components/MToggleButton.vue.d.ts +29 -0
- package/dist/components/MTree.vue.d.ts +0 -1
- package/dist/components/MTreeTable.vue.d.ts +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3773 -2277
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/styles/palettes.css +22 -22
- package/dist/styles.css +1 -1
- package/package.json +4 -1
- package/src/__tests__/MCarousel.test.ts +33 -0
- package/src/__tests__/MShape.test.ts +36 -0
- package/src/__tests__/MToggleButton.test.ts +27 -0
- package/src/components/MAutocomplete.vue +5 -1
- package/src/components/MButton.vue +15 -2
- package/src/components/MCalendar.vue +9 -5
- package/src/components/MCarousel.vue +123 -173
- package/src/components/MCodeEditor.vue +6 -1
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MDatePicker.vue +12 -9
- package/src/components/MDatePickerModal.vue +9 -4
- package/src/components/MDateRangePicker.vue +12 -9
- package/src/components/MDateRangePickerModal.vue +9 -4
- package/src/components/MKanban.vue +5 -1
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMultiAutocomplete.vue +5 -1
- package/src/components/MMultiSelect.vue +5 -1
- package/src/components/MScheduler.vue +10 -6
- package/src/components/MSearchBar.vue +5 -1
- package/src/components/MSelect.vue +5 -1
- package/src/components/MShape.vue +107 -0
- package/src/components/MShortNavigationBar.vue +113 -0
- package/src/components/MSimpleCarousel.vue +325 -0
- package/src/components/MToggleButton.vue +188 -0
- package/src/components/MTopAppBar.vue +6 -2
- package/src/components/MTree.vue +4 -2
- package/src/components/MTreeTable.vue +5 -1
- package/src/composables/useColorPalette.ts +1 -1
- package/src/index.ts +8 -1
- package/src/styles/palettes.css +22 -22
- package/dist/MMenuItem-vSLbJGqe.js.map +0 -1
package/dist/code-editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.js","names":[],"sources":["../src/components/MCodeEditor.vue","../src/components/MCodeEditor.vue","../src/components/MJsonEditor.vue","../src/components/MJsonEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string\n language?: Language\n readonly?: boolean\n lineNumbers?: boolean\n theme?: 'light' | 'dark'\n minHeight?: string\n maxHeight?: string\n placeholder?: string\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nlet cmModules: any = null\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n</script>\n\n<template>\n <div class=\"flex flex-col overflow-hidden rounded-lg border border-outline-variant\">\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n :title=\"copied ? 'Copied!' : 'Copy code'\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">Copied</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-family: 'Roboto Mono', 'Fira Code', 'Consolas', monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n background: var(--color-surface-container-lowest);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string\n language?: Language\n readonly?: boolean\n lineNumbers?: boolean\n theme?: 'light' | 'dark'\n minHeight?: string\n maxHeight?: string\n placeholder?: string\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nlet cmModules: any = null\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n</script>\n\n<template>\n <div class=\"flex flex-col overflow-hidden rounded-lg border border-outline-variant\">\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n :title=\"copied ? 'Copied!' : 'Copy code'\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">Copied</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-family: 'Roboto Mono', 'Fira Code', 'Consolas', monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n background: var(--color-surface-container-lowest);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n modelValue: unknown\n readonly?: boolean\n minHeight?: string\n maxHeight?: string\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-0\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.format\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.minify\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n modelValue: unknown\n readonly?: boolean\n minHeight?: string\n maxHeight?: string\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-0\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.format\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.minify\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,IAAM,IAAQ,GAuBR,IAAO,GAEP,IAAe,EAAwB,IAAI,GAC7C,IAAY,MACZ,IAAiB,MACf,IAAS,EAAI,EAAK;EAExB,eAAe,IAAW;GAGxB,AAFA,MAAM,UAAU,UAAU,UAAU,EAAM,UAAU,GACpD,EAAO,QAAQ,IACf,iBAAiB;IAAE,EAAO,QAAQ;GAAM,GAAG,IAAI;EACjD;EAEA,IAAM,IAAY,SAeT;GAbL,YAAY;GACZ,YAAY;GACZ,MAAM;GACN,MAAM;GACN,KAAK;GACL,QAAQ;GACR,KAAK;GACL,GAAG;GACH,KAAK;GACL,MAAM;GACN,KAAK;GACL,OAAO;EAEF,EAAA,CAAO,EAAM,SACrB;EAED,eAAe,IAAc;GAC3B,IAAI,GAAW,OAAO;GAEtB,IAAM,CAAC,GAAS,GAAU,GAAa,GAAa,GAAc,GAAY,GAAO,GAAS,GAAS,GAAQ,GAAO,GAAQ,GAAQ,GAAS,KAAU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AAA,QAAO,mDAAA,4CAAA,CAAA,EAAA,GAAA,CAEf,EAA+D,GAAA;KAAvD,MAAM,EAAA,QAAO,iBAAA;KAA8B,MAAM;IAAM,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,GAAA,EAAA,MAC/D,EAAG,EAAA,QAAU,EAAA,MAAE,QAAQ,EAAA,MAAE,OAAO,GAAA,CAAA,CAAA,GAAA,CAAA;IAIzB,EAAA,WAOI,EAAA,IAAA,EAAA,KARb,EAAA,GAAA,EASS,UAAA;;KAPP,MAAK;KACJ,OAAO,EAAA,MAAE;KACV,OAAM;KACL,SAAO;IAER,GAAA,CAAA,EAAkD,GAAA;KAA3C,MAAK;KAA0B,MAAM;IAAM,CAAA,GAAA,EAAA,MAClD,EAAG,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA;IAGJ,EAAA,WAOI,EAAA,IAAA,EAAA,KARb,EAAA,GAAA,EASS,UAAA;;KAPP,MAAK;KACJ,OAAO,EAAA,MAAE;KACV,OAAM;KACL,SAAO;IAER,GAAA,CAAA,EAAoC,GAAA;KAA7B,MAAK;KAAY,MAAM;IAAM,CAAA,GAAA,EAAA,MACpC,EAAG,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA;;;;;;;;EAMV,CAAA,GAAA,EAAA,SAAT,EAAA,GAAA,EAEI,KAFJ,GAEI,EADC,EAAA,KAAU,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"code-editor.js","names":[],"sources":["../src/components/MCodeEditor.vue","../src/components/MCodeEditor.vue","../src/components/MJsonEditor.vue","../src/components/MJsonEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string\n language?: Language\n readonly?: boolean\n lineNumbers?: boolean\n theme?: 'light' | 'dark'\n minHeight?: string\n maxHeight?: string\n placeholder?: string\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nlet cmModules: any = null\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n</script>\n\n<template>\n <div class=\"flex flex-col overflow-hidden rounded-lg border border-outline-variant\">\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n :title=\"copied ? 'Copied!' : 'Copy code'\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">Copied</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-family: 'Roboto Mono', 'Fira Code', 'Consolas', monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n /* CodeMirror renders the selection highlight on a layer with z-index: -1\n (@codemirror/view's selectionLayer has `above: false` by design, so it always\n sits behind the line content). An opaque active-line background would paint\n straight over it and hide the selection on the current line — this needs to\n stay a translucent tint so a selection underneath still shows through. */\n background: color-mix(in srgb, var(--color-on-surface) 5%, transparent);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'\nimport MIcon from './MIcon.vue'\n\ntype Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: string\n language?: Language\n readonly?: boolean\n lineNumbers?: boolean\n theme?: 'light' | 'dark'\n minHeight?: string\n maxHeight?: string\n placeholder?: string\n wrap?: boolean\n }>(),\n {\n language: 'javascript',\n readonly: false,\n lineNumbers: true,\n theme: 'light',\n minHeight: '200px',\n maxHeight: '600px',\n wrap: true,\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\n\nconst containerRef = ref<HTMLElement | null>(null)\nlet view: any = null\nlet cmModules: any = null\nconst copied = ref(false)\n\nasync function copyCode() {\n await navigator.clipboard.writeText(props.modelValue)\n copied.value = true\n setTimeout(() => { copied.value = false }, 1500)\n}\n\nconst langLabel = computed(() => {\n const labels: Record<Language, string> = {\n javascript: 'JavaScript',\n typescript: 'TypeScript',\n json: 'JSON',\n html: 'HTML',\n css: 'CSS',\n python: 'Python',\n vue: 'Vue',\n c: 'C',\n cpp: 'C++',\n rust: 'Rust',\n asm: 'Assembly',\n plain: 'Texto',\n }\n return labels[props.language]\n})\n\nasync function loadModules() {\n if (cmModules) return cmModules\n\n const [viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod] = await Promise.all([\n import('@codemirror/view'),\n import('@codemirror/state'),\n import('@codemirror/commands'),\n import('@codemirror/language'),\n import('@lezer/highlight'),\n import('@codemirror/theme-one-dark'),\n import('@codemirror/lang-javascript'),\n import('@codemirror/lang-json'),\n import('@codemirror/lang-html'),\n import('@codemirror/lang-css'),\n import('@codemirror/lang-python'),\n import('@codemirror/lang-vue'),\n import('@codemirror/lang-cpp'),\n import('@codemirror/lang-rust'),\n import('@codemirror/legacy-modes/mode/gas'),\n ])\n\n cmModules = { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod, jsMod, jsonMod, htmlMod, cssMod, pyMod, vueMod, cppMod, rustMod, asmMod }\n return cmModules\n}\n\nfunction buildM3HighlightStyle(languageMod: any, tags: any) {\n return languageMod.HighlightStyle.define([\n { tag: tags.keyword, color: 'var(--color-primary)' },\n { tag: tags.controlKeyword, color: 'var(--color-primary)', fontWeight: '500' },\n { tag: tags.operatorKeyword, color: 'var(--color-primary)' },\n { tag: tags.definitionKeyword, color: 'var(--color-primary)' },\n { tag: tags.moduleKeyword, color: 'var(--color-primary)' },\n\n { tag: tags.string, color: 'var(--color-tertiary)' },\n { tag: tags.regexp, color: 'var(--color-tertiary)' },\n\n { tag: tags.number, color: 'var(--color-error)' },\n { tag: tags.bool, color: 'var(--color-error)' },\n\n { tag: tags.function(tags.variableName), color: 'var(--color-secondary)' },\n { tag: tags.function(tags.definition(tags.variableName)), color: 'var(--color-secondary)', fontWeight: '500' },\n\n { tag: tags.typeName, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.className, color: 'var(--color-primary)', fontStyle: 'italic' },\n { tag: tags.namespace, color: 'var(--color-on-surface-variant)' },\n\n { tag: tags.propertyName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.propertyName), color: 'var(--color-on-surface)' },\n\n { tag: tags.variableName, color: 'var(--color-on-surface)' },\n { tag: tags.definition(tags.variableName), color: 'var(--color-on-surface)' },\n\n { tag: tags.comment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.lineComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n { tag: tags.blockComment, color: 'var(--color-outline)', fontStyle: 'italic' },\n\n { tag: tags.meta, color: 'var(--color-on-surface-variant)' },\n { tag: tags.tagName, color: 'var(--color-primary)' },\n { tag: tags.attributeName, color: 'var(--color-tertiary)' },\n { tag: tags.attributeValue, color: 'var(--color-secondary)' },\n\n { tag: tags.atom, color: 'var(--color-error)' },\n { tag: tags.null, color: 'var(--color-error)' },\n\n { tag: tags.punctuation, color: 'var(--color-on-surface-variant)' },\n { tag: tags.bracket, color: 'var(--color-on-surface-variant)' },\n { tag: tags.operator, color: 'var(--color-on-surface-variant)' },\n { tag: tags.separator, color: 'var(--color-on-surface-variant)' },\n ])\n}\n\nfunction getLangExtension(mods: any) {\n switch (props.language) {\n case 'javascript': return mods.jsMod.javascript()\n case 'typescript': return mods.jsMod.javascript({ typescript: true })\n case 'json': return mods.jsonMod.json()\n case 'html': return mods.htmlMod.html()\n case 'css': return mods.cssMod.css()\n case 'python': return mods.pyMod.python()\n case 'vue': return mods.vueMod.vue()\n case 'c': case 'cpp': return mods.cppMod.cpp()\n case 'rust': return mods.rustMod.rust()\n case 'asm': return mods.languageMod.StreamLanguage.define(mods.asmMod.gas)\n default: return []\n }\n}\n\nfunction buildExtensions(mods: any) {\n const { viewMod, stateMod, commandsMod, languageMod, highlightMod, oneDarkMod } = mods\n\n const m3Style = buildM3HighlightStyle(languageMod, highlightMod.tags)\n\n const exts = [\n viewMod.keymap.of([...commandsMod.defaultKeymap, ...commandsMod.historyKeymap, commandsMod.indentWithTab]),\n commandsMod.history(),\n languageMod.bracketMatching(),\n languageMod.indentOnInput(),\n languageMod.foldGutter(),\n viewMod.drawSelection(),\n viewMod.highlightActiveLine(),\n viewMod.highlightActiveLineGutter(),\n languageMod.syntaxHighlighting(m3Style),\n languageMod.syntaxHighlighting(languageMod.defaultHighlightStyle, { fallback: true }),\n getLangExtension(mods),\n viewMod.EditorView.updateListener.of((update: any) => {\n if (update.docChanged) emit('update:modelValue', update.state.doc.toString())\n }),\n stateMod.EditorState.readOnly.of(props.readonly),\n ]\n\n if (props.wrap) exts.push(viewMod.EditorView.lineWrapping)\n if (props.lineNumbers) exts.push(viewMod.lineNumbers())\n if (props.theme === 'dark') exts.push(oneDarkMod.oneDark)\n if (props.placeholder) exts.push(viewMod.placeholder(props.placeholder))\n\n return exts\n}\n\nasync function createEditor() {\n if (!containerRef.value) return\n const mods = await loadModules()\n const { viewMod, stateMod } = mods\n\n view?.destroy()\n\n view = new viewMod.EditorView({\n state: stateMod.EditorState.create({\n doc: props.modelValue,\n extensions: buildExtensions(mods),\n }),\n parent: containerRef.value,\n })\n}\n\nonMounted(createEditor)\n\nwatch(() => props.modelValue, (val) => {\n if (view && view.state.doc.toString() !== val) {\n view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: val } })\n }\n})\n\nwatch([() => props.language, () => props.theme, () => props.readonly, () => props.lineNumbers, () => props.wrap, () => props.placeholder], createEditor)\n\nonBeforeUnmount(() => view?.destroy())\n</script>\n\n<template>\n <div class=\"flex flex-col overflow-hidden rounded-lg border border-outline-variant\">\n <!-- Header bar -->\n <div class=\"flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2\">\n <span class=\"text-label-medium text-on-surface-variant\">{{ langLabel }}</span>\n <div class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n <button\n type=\"button\"\n class=\"flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n :title=\"copied ? 'Copied!' : 'Copy code'\"\n @click=\"copyCode\"\n >\n <MIcon :name=\"copied ? 'check' : 'content_copy'\" :size=\"16\" :class=\"copied ? 'text-primary' : ''\" />\n <span v-if=\"copied\" class=\"text-primary\">Copied</span>\n </button>\n </div>\n </div>\n\n <!-- Editor -->\n <div\n ref=\"containerRef\"\n class=\"code-editor-container overflow-auto bg-surface text-on-surface\"\n :style=\"{ minHeight, maxHeight }\"\n />\n </div>\n</template>\n\n<style scoped>\n.code-editor-container {\n /* .cm-editor/.cm-scroller/.cm-gutters all use height:100%, which only ever\n resolves against a genuinely definite ancestor height — a min-height (what\n this container has, so it can grow with content up to maxHeight) doesn't\n count as definite for that percentage chain, so .cm-gutters silently fell\n back to sizing off its own content instead of the real editor height.\n Making this a flex column and letting .cm-editor grow via flex instead of\n a % height gives the whole chain a real definite size to resolve against. */\n display: flex;\n flex-direction: column;\n /* Also grow to fill the outer wrapper (see the root element's own flex-col\n above) rather than just sitting at minHeight, whenever a consumer stretches\n the whole component taller than that — e.g. `class=\"h-full\"` in a grid\n cell next to taller content. Still hard-capped by maxHeight either way. */\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.code-editor-container :deep(.cm-editor) {\n flex: 1;\n min-height: 0;\n font-family: 'Roboto Mono', 'Fira Code', 'Consolas', monospace;\n font-size: 0.8125rem;\n line-height: 1.6;\n}\n\n.code-editor-container :deep(.cm-editor.cm-focused) {\n outline: none;\n}\n\n.code-editor-container :deep(.cm-scroller) {\n /* .cm-scroller normally sizes itself off a height:100% against .cm-editor,\n but that's a percentage-height-in-nested-flex-column case that browsers\n don't reliably resolve — grow it directly instead so it has a real,\n laid-out height for .cm-gutters to stretch against below. */\n flex: 1 !important;\n min-height: 0;\n /* .cm-scroller lays out .cm-gutters/.cm-content in a row (gutter | content),\n so .cm-gutters' height comes from cross-axis stretch, not flex-grow —\n CodeMirror's own base theme sets align-items: flex-start !important here,\n which is exactly what stops the gutter from stretching to full height in\n the first place. */\n align-items: stretch !important;\n}\n\n.code-editor-container :deep(.cm-content) {\n padding: 12px 0;\n}\n\n.code-editor-container :deep(.cm-line) {\n padding: 0 16px;\n}\n\n.code-editor-container :deep(.cm-gutters) {\n background: var(--color-surface-container);\n border-right: 1px solid var(--color-outline-variant);\n color: var(--color-outline);\n font-size: 0.75rem;\n padding: 0 4px;\n /* .cm-gutters ships with an explicit height:100% rather than auto, so the\n align-items:stretch above (on .cm-scroller) never actually kicks in —\n stretch only applies to items whose cross-size computes to auto. Forcing\n height back to auto here is what makes that stretch take effect. */\n height: auto !important;\n align-self: stretch !important;\n}\n\n.code-editor-container :deep(.cm-activeLineGutter) {\n background: var(--color-surface-container-high);\n color: var(--color-on-surface-variant);\n}\n\n.code-editor-container :deep(.cm-activeLine) {\n /* CodeMirror renders the selection highlight on a layer with z-index: -1\n (@codemirror/view's selectionLayer has `above: false` by design, so it always\n sits behind the line content). An opaque active-line background would paint\n straight over it and hide the selection on the current line — this needs to\n stay a translucent tint so a selection underneath still shows through. */\n background: color-mix(in srgb, var(--color-on-surface) 5%, transparent);\n}\n\n.code-editor-container :deep(.cm-selectionBackground) {\n background: var(--color-primary-container) !important;\n}\n\n.code-editor-container :deep(.cm-cursor) {\n border-left-color: var(--color-primary);\n border-left-width: 2px;\n}\n\n.code-editor-container :deep(.cm-matchingBracket) {\n background: var(--color-tertiary-container);\n color: var(--color-on-tertiary-container);\n border-radius: 2px;\n}\n\n.code-editor-container :deep(.cm-foldGutter span) {\n color: var(--color-on-surface-variant);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n modelValue: unknown\n readonly?: boolean\n minHeight?: string\n maxHeight?: string\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-0\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.format\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.minify\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\nimport MCodeEditor from './MCodeEditor.vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nexport interface JsonEditorLabels {\n valid?: string\n invalid?: string\n format?: string\n minify?: string\n}\n\nconst locale = useLocale()\n\nconst props = withDefaults(\n defineProps<{\n modelValue: unknown\n readonly?: boolean\n minHeight?: string\n maxHeight?: string\n labels?: JsonEditorLabels\n }>(),\n {\n readonly: false,\n minHeight: '200px',\n maxHeight: '600px',\n },\n)\n\nconst l = computed<Required<JsonEditorLabels>>(() => ({\n valid: locale.jsonValid,\n invalid: locale.jsonInvalid,\n format: locale.jsonFormat,\n minify: locale.jsonMinify,\n ...props.labels,\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [unknown] }>()\n\nconst rawText = ref(JSON.stringify(props.modelValue, null, 2))\nconst parseError = ref<string | null>(null)\n\nconst isValid = computed(() => !parseError.value)\n\nwatch(() => props.modelValue, (val) => {\n let current: unknown\n try {\n current = JSON.parse(rawText.value)\n } catch {\n current = undefined\n }\n // Only resync from outside when the actual data changed, not just its formatting —\n // otherwise the round-trip from formatJson/minifyJson emitting would immediately\n // overwrite the newly (re)formatted text with a pretty-printed copy.\n if (JSON.stringify(current) === JSON.stringify(val)) return\n rawText.value = JSON.stringify(val, null, 2)\n parseError.value = null\n})\n\nfunction onTextUpdate(text: string) {\n rawText.value = text\n try {\n const parsed = JSON.parse(text)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch (e) {\n parseError.value = (e as Error).message\n }\n}\n\nfunction formatJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed, null, 2)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n\nfunction minifyJson() {\n try {\n const parsed = JSON.parse(rawText.value)\n rawText.value = JSON.stringify(parsed)\n parseError.value = null\n emit('update:modelValue', parsed)\n } catch {\n // keep error state\n }\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-0\">\n <MCodeEditor\n :model-value=\"rawText\"\n language=\"json\"\n :readonly=\"readonly\"\n :min-height=\"minHeight\"\n :max-height=\"maxHeight\"\n @update:model-value=\"onTextUpdate\"\n >\n <template #actions>\n <div class=\"flex items-center gap-2\">\n <!-- Validation badge -->\n <span\n class=\"flex items-center gap-1 rounded-full px-2.5 py-0.5 text-label-small\"\n :class=\"isValid ? 'bg-success-container text-on-success-container' : 'bg-error-container text-on-error-container'\"\n >\n <MIcon :name=\"isValid ? 'check_circle' : 'error'\" :size=\"14\" />\n {{ isValid ? l.valid : l.invalid }}\n </span>\n\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.format\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"formatJson\"\n >\n <MIcon name=\"format_indent_increase\" :size=\"16\" />\n {{ l.format }}\n </button>\n <button\n v-if=\"!readonly\"\n type=\"button\"\n :title=\"l.minify\"\n class=\"flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8\"\n @click=\"minifyJson\"\n >\n <MIcon name=\"compress\" :size=\"16\" />\n {{ l.minify }}\n </button>\n </div>\n </template>\n </MCodeEditor>\n\n <p v-if=\"parseError\" class=\"px-3 py-1.5 text-body-small text-error\">\n {{ parseError }}\n </p>\n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EASS,UAAA;;KAPP,MAAK;KACJ,OAAO,EAAA,MAAE;KACV,OAAM;KACL,SAAO;IAER,GAAA,CAAA,EAAoC,GAAA;KAA7B,MAAK;KAAY,MAAM;IAAM,CAAA,GAAA,EAAA,MACpC,EAAG,EAAA,MAAE,MAAM,GAAA,CAAA,CAAA,GAAA,GAAA,CAAA;;;;;;;;EAMV,CAAA,GAAA,EAAA,SAAT,EAAA,GAAA,EAEI,KAFJ,GAEI,EADC,EAAA,KAAU,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -10,6 +10,12 @@ type __VLS_Props = {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
icon?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Which side of the label `icon` renders on. Real M3 buttons support both via
|
|
15
|
+
* `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical
|
|
16
|
+
* either way at every tier, so this only changes render order, not spacing.
|
|
17
|
+
*/
|
|
18
|
+
iconPos?: 'leading' | 'trailing';
|
|
13
19
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
14
20
|
shape?: 'rounded' | 'squared';
|
|
15
21
|
to?: string | Record<string, any>;
|
|
@@ -26,6 +32,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
26
32
|
variant: "filled" | "tonal" | "outlined" | "text" | "elevated";
|
|
27
33
|
shape: "rounded" | "squared";
|
|
28
34
|
disabled: boolean;
|
|
35
|
+
iconPos: "leading" | "trailing";
|
|
29
36
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
37
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
31
38
|
declare const _default: typeof __VLS_export;
|
|
@@ -19,7 +19,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
19
19
|
onDateClick?: ((args_0: string) => any) | undefined;
|
|
20
20
|
onEventClick?: ((args_0: CalendarEvent) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
|
-
locale: string;
|
|
23
22
|
events: CalendarEvent[];
|
|
24
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,44 +2,42 @@ export interface CarouselItem {
|
|
|
2
2
|
src: string;
|
|
3
3
|
alt?: string;
|
|
4
4
|
label?: string;
|
|
5
|
-
supportingText?: string;
|
|
6
|
-
ratio?: number;
|
|
7
5
|
}
|
|
8
6
|
type __VLS_Props = {
|
|
9
7
|
items: CarouselItem[];
|
|
10
|
-
|
|
8
|
+
/** Target width of the large, fully-visible focal item, in px (preferredItemWidth). */
|
|
9
|
+
itemWidth?: number;
|
|
10
|
+
/** Spacing between item slots, in px. Real default (CarouselDefaults.ItemSpacing) is 0. */
|
|
11
|
+
itemSpacing?: number;
|
|
12
|
+
/** Real default (CarouselDefaults.MinSmallItemSize) is 40. */
|
|
13
|
+
minSmallItemWidth?: number;
|
|
14
|
+
/** Real default (CarouselDefaults.MaxSmallItemSize) is 56. */
|
|
15
|
+
maxSmallItemWidth?: number;
|
|
11
16
|
height?: string;
|
|
12
17
|
showArrows?: boolean;
|
|
13
|
-
showIndicators?: boolean;
|
|
14
18
|
autoplay?: boolean;
|
|
15
19
|
interval?: number;
|
|
16
|
-
gap?: number;
|
|
17
|
-
visibleItems?: number;
|
|
18
|
-
animated?: boolean;
|
|
19
20
|
};
|
|
20
21
|
declare function scrollToItem(index: number): void;
|
|
21
|
-
declare function scrollToPage(page: number): void;
|
|
22
22
|
declare function next(): void;
|
|
23
23
|
declare function prev(): void;
|
|
24
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
25
25
|
next: typeof next;
|
|
26
26
|
prev: typeof prev;
|
|
27
27
|
scrollToItem: typeof scrollToItem;
|
|
28
|
-
scrollToPage: typeof scrollToPage;
|
|
29
28
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
29
|
change: (index: number) => any;
|
|
31
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
31
|
onChange?: ((index: number) => any) | undefined;
|
|
33
32
|
}>, {
|
|
34
33
|
height: string;
|
|
35
|
-
|
|
34
|
+
itemWidth: number;
|
|
35
|
+
itemSpacing: number;
|
|
36
|
+
minSmallItemWidth: number;
|
|
37
|
+
maxSmallItemWidth: number;
|
|
36
38
|
showArrows: boolean;
|
|
37
|
-
showIndicators: boolean;
|
|
38
39
|
autoplay: boolean;
|
|
39
40
|
interval: number;
|
|
40
|
-
gap: number;
|
|
41
|
-
visibleItems: number;
|
|
42
|
-
animated: boolean;
|
|
43
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
42
|
declare const _default: typeof __VLS_export;
|
|
45
43
|
export default _default;
|
|
@@ -17,8 +17,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
17
17
|
"update:modelValue": (args_0: string | null) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
19
|
"onUpdate:modelValue"?: ((args_0: string | null) => any) | undefined;
|
|
20
|
-
}>, {
|
|
21
|
-
locale: string;
|
|
22
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
21
|
declare const _default: typeof __VLS_export;
|
|
24
22
|
export default _default;
|
|
@@ -14,7 +14,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
"onUpdate:show"?: ((args_0: boolean) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
show: boolean;
|
|
17
|
-
locale: string;
|
|
18
17
|
modelValue: string | null;
|
|
19
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
19
|
declare const _default: typeof __VLS_export;
|
|
@@ -23,8 +23,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
23
23
|
"update:modelValue": (args_0: DateRange) => any;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
25
|
"onUpdate:modelValue"?: ((args_0: DateRange) => any) | undefined;
|
|
26
|
-
}>, {
|
|
27
|
-
locale: string;
|
|
28
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
27
|
declare const _default: typeof __VLS_export;
|
|
30
28
|
export default _default;
|
|
@@ -18,7 +18,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
18
18
|
"onUpdate:show"?: ((args_0: boolean) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
show: boolean;
|
|
21
|
-
locale: string;
|
|
22
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
22
|
declare const _default: typeof __VLS_export;
|
|
24
23
|
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ShapeName } from 'shape-morph';
|
|
2
|
+
export type { ShapeName };
|
|
3
|
+
export { shapeNames } from 'shape-morph';
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
7
|
+
/** One of M3's 35 named "expressive" shapes (MaterialShapes.kt), e.g. 'Cookie9Sided', 'Heart'. */
|
|
8
|
+
shape: ShapeName;
|
|
9
|
+
/**
|
|
10
|
+
* Fill color used when there's no default slot content to clip (a decorative solid shape).
|
|
11
|
+
* SVG `fill`, not a `background-color` — a `bg-*` Tailwind class on the component itself has
|
|
12
|
+
* no effect here; use `fill` (or a `text-*` class, since the default is `currentColor`).
|
|
13
|
+
*/
|
|
14
|
+
fill?: string;
|
|
15
|
+
/** Spring-morph into the new outline when `shape` changes — false snaps instantly instead. */
|
|
16
|
+
animate?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Multiplier on the morph spring's speed (1 = default). Scales stiffness by speed² and the
|
|
19
|
+
* damping coefficient by speed, which time-scales the spring uniformly without changing its
|
|
20
|
+
* character (same amount of overshoot/settle shape, just faster or slower).
|
|
21
|
+
*/
|
|
22
|
+
speed?: number;
|
|
23
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
24
|
+
/** One of M3's 35 named "expressive" shapes (MaterialShapes.kt), e.g. 'Cookie9Sided', 'Heart'. */
|
|
25
|
+
shape: ShapeName;
|
|
26
|
+
/**
|
|
27
|
+
* Fill color used when there's no default slot content to clip (a decorative solid shape).
|
|
28
|
+
* SVG `fill`, not a `background-color` — a `bg-*` Tailwind class on the component itself has
|
|
29
|
+
* no effect here; use `fill` (or a `text-*` class, since the default is `currentColor`).
|
|
30
|
+
*/
|
|
31
|
+
fill?: string;
|
|
32
|
+
/** Spring-morph into the new outline when `shape` changes — false snaps instantly instead. */
|
|
33
|
+
animate?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Multiplier on the morph spring's speed (1 = default). Scales stiffness by speed² and the
|
|
36
|
+
* damping coefficient by speed, which time-scales the spring uniformly without changing its
|
|
37
|
+
* character (same amount of overshoot/settle shape, just faster or slower).
|
|
38
|
+
*/
|
|
39
|
+
speed?: number;
|
|
40
|
+
}> & Readonly<{}>, {
|
|
41
|
+
animate: boolean;
|
|
42
|
+
fill: string;
|
|
43
|
+
speed: number;
|
|
44
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
45
|
+
default?: (props: {}) => any;
|
|
46
|
+
}>;
|
|
47
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
48
|
+
new (): {
|
|
49
|
+
$slots: S;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ShortNavBarItem {
|
|
2
|
+
value: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
badge?: number;
|
|
6
|
+
badgeDot?: boolean;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
modelValue: string | number;
|
|
10
|
+
items: ShortNavBarItem[];
|
|
11
|
+
/**
|
|
12
|
+
* 'equal' (ShortNavigationBarArrangement.EqualWeight): items evenly fill the bar — recommended
|
|
13
|
+
* for small-width screens. 'centered' (.Centered): items are grouped toward the center instead
|
|
14
|
+
* of stretching edge to edge — recommended for medium-width screens, paired with iconPosition
|
|
15
|
+
* 'start'. Real Compose computes this via a custom MeasurePolicy at layout time; ported here as
|
|
16
|
+
* the same closed-form percentage formula (calculateCenteredContentHorizontalPadding), since it
|
|
17
|
+
* only ever depends on the item count, not on measured content size.
|
|
18
|
+
*/
|
|
19
|
+
arrangement?: 'equal' | 'centered';
|
|
20
|
+
/** NavigationItemIconPosition — 'top' stacks icon above label (ShortNavigationBarItem's
|
|
21
|
+
* default); 'start' places the icon beside the label inside a single wider pill, meant for
|
|
22
|
+
* the 'centered' arrangement on wider/landscape layouts. */
|
|
23
|
+
iconPosition?: 'top' | 'start';
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
|
+
"update:modelValue": (args_0: string | number) => any;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
+
"onUpdate:modelValue"?: ((args_0: string | number) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
iconPosition: "top" | "start";
|
|
31
|
+
arrangement: "equal" | "centered";
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface SimpleCarouselItem {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
supportingText?: string;
|
|
6
|
+
ratio?: number;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
items: SimpleCarouselItem[];
|
|
10
|
+
layout?: 'hero' | 'multi-browse' | 'uncontained';
|
|
11
|
+
height?: string;
|
|
12
|
+
showArrows?: boolean;
|
|
13
|
+
showIndicators?: boolean;
|
|
14
|
+
autoplay?: boolean;
|
|
15
|
+
interval?: number;
|
|
16
|
+
gap?: number;
|
|
17
|
+
visibleItems?: number;
|
|
18
|
+
animated?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare function scrollToItem(index: number): void;
|
|
21
|
+
declare function scrollToPage(page: number): void;
|
|
22
|
+
declare function next(): void;
|
|
23
|
+
declare function prev(): void;
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
25
|
+
next: typeof next;
|
|
26
|
+
prev: typeof prev;
|
|
27
|
+
scrollToItem: typeof scrollToItem;
|
|
28
|
+
scrollToPage: typeof scrollToPage;
|
|
29
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
change: (index: number) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
+
onChange?: ((index: number) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
height: string;
|
|
35
|
+
layout: "hero" | "multi-browse" | "uncontained";
|
|
36
|
+
showArrows: boolean;
|
|
37
|
+
autoplay: boolean;
|
|
38
|
+
interval: number;
|
|
39
|
+
gap: number;
|
|
40
|
+
showIndicators: boolean;
|
|
41
|
+
visibleItems: number;
|
|
42
|
+
animated: boolean;
|
|
43
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default: typeof __VLS_export;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Whether the toggle button is checked/selected — v-model. */
|
|
3
|
+
checked: boolean;
|
|
4
|
+
variant?: 'filled' | 'tonal' | 'outlined' | 'elevated';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
icon?: string;
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_6: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_6) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:checked": (args_0: boolean) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:checked"?: ((args_0: boolean) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
19
|
+
variant: "filled" | "tonal" | "outlined" | "elevated";
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -54,7 +54,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
54
54
|
}>, {
|
|
55
55
|
selected: string | number | null;
|
|
56
56
|
checked: (string | number)[];
|
|
57
|
-
emptyText: string;
|
|
58
57
|
checkable: boolean;
|
|
59
58
|
defaultExpanded: (string | number)[] | "all" | "none";
|
|
60
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export type { ButtonGroupOption } from './components/MButtonGroup.vue';
|
|
|
32
32
|
export { default as MCalendar } from './components/MCalendar.vue';
|
|
33
33
|
export { default as MCard } from './components/MCard.vue';
|
|
34
34
|
export { default as MCarousel } from './components/MCarousel.vue';
|
|
35
|
+
export type { CarouselItem } from './components/MCarousel.vue';
|
|
35
36
|
export { default as MCenter } from './components/MCenter.vue';
|
|
36
37
|
export { default as MChatBubble } from './components/MChatBubble.vue';
|
|
37
38
|
export { default as MCheckbox } from './components/MCheckbox.vue';
|
|
@@ -117,8 +118,14 @@ export { default as MSelect } from './components/MSelect.vue';
|
|
|
117
118
|
export type { SelectOption } from './components/MSelect.vue';
|
|
118
119
|
export { default as MShader } from './components/MShader.vue';
|
|
119
120
|
export type { ShaderRenderer, ShaderStatus } from './components/MShader.vue';
|
|
121
|
+
export { default as MShape, shapeNames } from './components/MShape.vue';
|
|
122
|
+
export type { ShapeName } from './components/MShape.vue';
|
|
123
|
+
export { default as MShortNavigationBar } from './components/MShortNavigationBar.vue';
|
|
124
|
+
export type { ShortNavBarItem } from './components/MShortNavigationBar.vue';
|
|
120
125
|
export { default as MSideSheet } from './components/MSideSheet.vue';
|
|
121
126
|
export { default as MSignaturePad } from './components/MSignaturePad.vue';
|
|
127
|
+
export { default as MSimpleCarousel } from './components/MSimpleCarousel.vue';
|
|
128
|
+
export type { SimpleCarouselItem } from './components/MSimpleCarousel.vue';
|
|
122
129
|
export { default as MSkeleton } from './components/MSkeleton.vue';
|
|
123
130
|
export { default as MSlider } from './components/MSlider.vue';
|
|
124
131
|
export { default as MSnackbar } from './components/MSnackbar.vue';
|
|
@@ -143,6 +150,7 @@ export { default as MTimeline } from './components/MTimeline.vue';
|
|
|
143
150
|
export { default as MTimePicker } from './components/MTimePicker.vue';
|
|
144
151
|
export { default as MTimePickerModal } from './components/MTimePickerModal.vue';
|
|
145
152
|
export { default as MTitle } from './components/MTitle.vue';
|
|
153
|
+
export { default as MToggleButton } from './components/MToggleButton.vue';
|
|
146
154
|
export { default as MTooltip } from './components/MTooltip.vue';
|
|
147
155
|
export { default as MToolbar } from './components/MToolbar.vue';
|
|
148
156
|
export { default as MTopAppBar } from './components/MTopAppBar.vue';
|
|
@@ -157,7 +165,6 @@ export { emojiCategories, allEmojis, randomEmoji } from './data/emojis';
|
|
|
157
165
|
export type { Placement } from './components/MAbsolute.vue';
|
|
158
166
|
export type { BadgePosition, BadgeOverlap } from './components/MBadge.vue';
|
|
159
167
|
export type { CalendarEvent } from './components/MCalendar.vue';
|
|
160
|
-
export type { CarouselItem } from './components/MCarousel.vue';
|
|
161
168
|
export type { DataTableColumn, DataTableFetchParams } from './components/MDataTable.vue';
|
|
162
169
|
export type { DateRange } from './components/MDateRangePicker.vue';
|
|
163
170
|
export type { DragDropItem } from './components/MDragDropList.vue';
|