1.1.8 • Published 2 months ago

ckeditor5-build-task v1.1.8

Weekly downloads
-
License
GPL-2.0-or-later
Repository
-
Last release
2 months ago

Ckeditor-build

ckeditor 编辑器 - 自定义构建

Install

pnpm add ckeditor5-build-task

Hot to use

import CKEditor from 'ckeditor5-build-task';

function Editor(props) {
  return <CKEditor {...props} />;
}

Attributes

propsdescriptiontypesrequired
typeclassic, inline, balloonstring
datathe editor contentstring
disableddisabledboolean
openTaskClick the task name to open the task detail pagefunction*
apolloClientthe apollo client for mention and image upload pluginsobject*
imageStorageUrlthe image prefix urlstring*
disableImageUploaddisable image uploadboolean*
disableImageUploadTooltipimage upload toolbar tooltip when disabledstring*
onesAppLinkUrlthis ones app urlstring*
customFunctionsrender the custom functions to editorrenderTaskItem, renderMemberItem, renderLoading, openTask, uploadFileobject*
handleAfterCommandExecCallback events for the editor functionalityfunction
openImageViewerClick on the image for a larger viewfunction*
onSyncTaskChangeused in task detail page to control the task description submitfunction*
languagelanguagestring

renderReactComponents example

const renderReactComponents = useMemo(() => {
  renderTaskItem: (item, domElement) => {
      ReactDOM.render(
        <TaskItem
          title={item.title}
          completeStatus={item.completeStatus}
          uniqueSearchId={item.uniqueSearchId}
          assignee={item.assignee}
          category={item.category}
          dueDate={item.dueDate}
        />,
        domElement,
      );
    },
    renderMemberItem: (item, domElement) => {
      ReactDOM.render(
        <MemberItem
          avatar={processAvatarUrl(item.avatar)}
          name={item.name}
        />,
        domElement,
      );
    },
    renderLoading: (domElement) => {
      ReactDOM.render(
        <div>Loading</div>,
        domElement,
      );
    },
    openTask,
})