@makeen.io/material-ui-kit
Version:
Makeen UI components kit. Based on material-ui.
37 lines (20 loc) • 2.53 kB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";import _createClass from "@babel/runtime/helpers/createClass";import _get from "@babel/runtime/helpers/get";import _inherits from "@babel/runtime/helpers/inherits";import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));return true;} catch (e) {return false;}}import { Quill } from "react-quill";
var BlockEmbed = Quill.import("blots/block");
var ATTRIBUTES = ["style", "align"];var
ParagraphBlot = /*#__PURE__*/function (_BlockEmbed) {_inherits(ParagraphBlot, _BlockEmbed);var _super = _createSuper(ParagraphBlot);function ParagraphBlot() {_classCallCheck(this, ParagraphBlot);return _super.apply(this, arguments);}_createClass(ParagraphBlot, [{ key: "format", value: function format(
name, value) {
if (ATTRIBUTES.indexOf(name) > -1) {
if (value) {
this.domNode.setAttribute(name, value);
} else
{
this.domNode.removeAttribute(name);
}
} else
{
_get(_getPrototypeOf(ParagraphBlot.prototype), "format", this).call(this, name, value);
}
} }], [{ key: "create", value: function create(value) {var node = _get(_getPrototypeOf(ParagraphBlot), "create", this).call(this, value);node.setAttribute("style", "margin: 0;");return node;} }, { key: "formats", value: function formats(domNode) {return ATTRIBUTES.reduce(function (formats, attribute) {if (domNode.hasAttribute(attribute)) {formats[attribute] = domNode.getAttribute(attribute);}return formats;}, {});} }, { key: "value", value: function value(domNode) {return true;} }]);return ParagraphBlot;}(BlockEmbed);
ParagraphBlot.tagName = "P";
export default ParagraphBlot;
//# sourceMappingURL=customParagpaph.js.map