@progress/kendo-vue-editor
Version:
62 lines (61 loc) • 1.62 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { Button as i } from "@progress/kendo-vue-buttons";
import { noop as c } from "@progress/kendo-vue-common";
import { provideLocalizationService as d } from "@progress/kendo-vue-intl";
import { messages as p } from "../messages/main.mjs";
import { defineComponent as l, h } from "vue";
const k = /* @__PURE__ */ l({
name: "KendoProseMirror",
props: {
view: Object,
settings: {
type: Object,
default: function() {
return {
messages: {}
};
}
},
...i.props
},
inject: {
kendoLocalizationService: {
default: null
}
},
computed: {
command() {
return this.settings.command || c;
}
},
render() {
const {
view: t,
settings: e,
...n
} = this.$props, r = d(this), o = e.messages.title, s = t && t.state, a = s ? !this.command(s) : !1, m = {
...n,
disabled: a,
title: r.toLanguageString(o, p[o]),
...e.props
};
return h(i, {
onClick: this.handleClick,
...m
});
},
methods: {
handleClick() {
this.view && this.command(this.view.state, (t) => this.view.dispatch(t.setMeta("commandName", this.settings.commandName)));
}
}
});
export {
k as ProseMirror
};