UNPKG

@makeen.io/material-ui-kit

Version:
24 lines (23 loc) 2.37 kB
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/embed");var AppPanelEmbed = /*#__PURE__*/function (_BlockEmbed) {_inherits(AppPanelEmbed, _BlockEmbed);var _super = _createSuper(AppPanelEmbed);function AppPanelEmbed() {_classCallCheck(this, AppPanelEmbed);return _super.apply(this, arguments);}_createClass(AppPanelEmbed, null, [{ key: "create", value: function create( value) { var node = _get(_getPrototypeOf(AppPanelEmbed), "create", this).call(this, value); node.setAttribute("contenteditable", "false"); node.setAttribute("width", "100%"); node.innerHTML = this.transformValue(value); return node; } }, { key: "transformValue", value: function transformValue( value) { var handleArr = value.split("\n"); handleArr = handleArr.map(function (e) {return e.replace(/^[\s]+/, "").replace(/[\s]+$/, "");}); return handleArr.join(""); } }, { key: "value", value: function value( node) { return node.innerHTML; } }]);return AppPanelEmbed;}(BlockEmbed); AppPanelEmbed.blotName = "AppPanelEmbed"; AppPanelEmbed.className = "embed-innerApp"; AppPanelEmbed.tagName = "div"; export default AppPanelEmbed; //# sourceMappingURL=appPanelEmbed.js.map