UNPKG

@chief-editor/brick-control

Version:

Control Brick for chief editor

1 lines 1.28 kB
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var l in t=arguments[r])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var react_1=__importDefault(require("react")),quill_1=require("@chief-editor/quill"),Toolbar_1=require("./component/Toolbar");function RichEditorBrick(e){var t=e.styles,r=e.layout,i=e.dispatchEvent,l=e.value,a=(l.formats,l.deltaOps,l.placeholder,l.isEmpty,e.value,e.setValue,e.creator),o=e.env,s=e.state,c=e.getByExpression,u="flow"===o;console.log("------------set quillEditor",e.value,s);var n=c("$context.state.quillEditor");return react_1.default.createElement("div",{"data-id":a,style:__assign(__assign({},t),r),onClick:i},n?react_1.default.createElement(quill_1.QuillProvider,{quillEditor:n},react_1.default.createElement("div",{className:"rich-editor"},react_1.default.createElement(Toolbar_1.Toolbar,{showQuickToolbar:u}))):null)}require("@chief-editor/quill/css/index.less"),require("../../../css/RichEditor/index.less"),exports.RichEditorBrick=RichEditorBrick;