@opentiny/fluent-editor
Version:
A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It's powerful and out-of-the-box.
29 lines (28 loc) • 879 B
JavaScript
import Quill from "quill";
const BlockEmbed = Quill.imports["blots/block/embed"];
class CustomerWidgetLink extends BlockEmbed {
static create(value) {
const node = super.create(value);
node.setAttribute("data-widget-type", value.type);
node.setAttribute("data-widget-id", value.id);
node.setAttribute("src", value.value);
return node;
}
static value(domNode) {
return {
type: domNode.getAttribute("data-widget-type"),
id: domNode.getAttribute("data-widget-id"),
value: domNode.getAttribute("src")
};
}
constructor(scroll, domNode, data) {
super(scroll, domNode, data);
}
}
CustomerWidgetLink.blotName = "customer-widget-link";
CustomerWidgetLink.tagName = "img";
CustomerWidgetLink.className = "ql-customer-widget-link";
export {
CustomerWidgetLink as default
};
//# sourceMappingURL=customer-widget-link.es.js.map