暂无描述

index.js.map 7.3KB

1
  1. {"version":3,"file":"index.js","sources":["../../src/components/Editor/CommonTool/ControlsToolBar.tsx","../../src/components/Editor/ImgTxtEditor/SimpleEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { EditorState } from \"braft-editor\";\nimport { render } from '@testing-library/react';\n\nexport interface ToolListItem {\n key: any;\n color: string;\n iconClass: string;\n iconTextClass: string;\n onClick: any;\n text?: string;\n render?: (i: ToolListItem, innerIcon: any, innerText: any, divWrapStyle: React.CSSProperties | undefined) => any;\n};\ninterface ControlsToolBarProps {\n editorState: EditorState;\n setEditorState: any;\n toolList: Array<ToolListItem>;\n injectIconWrapStyle?: any;\n injectIconStyle?: any;\n injectIconTextStyle?: any;\n}\n\nexport const ControlsToolBar = (props: ControlsToolBarProps) => {\n const {\n editorState,\n setEditorState,\n toolList = [],\n injectIconWrapStyle = {},\n injectIconStyle = {},\n injectIconTextStyle = {},\n } = props;\n const IconWrapStyle = {\n display: 'flex',\n alignItems: 'center',\n cursor: \"pointer\",\n textAlign: \"center\" as const,\n minWidth: \"42px\",\n ...injectIconWrapStyle,\n };\n const IconStyle = { fontSize: \"21px\", ...injectIconStyle };\n const IconTextStyle = { margin: \"0 4px\", ...injectIconTextStyle };\n\n if (toolList.length < 1) {\n return null;\n }\n\n return (\n <>\n {\n toolList.map(i => {\n const innerIcon = <i className={i.iconClass} style={IconStyle} />;\n const innerText = i.text ? <span className={i.iconTextClass} style={IconTextStyle}>{i.text}</span> : null;\n const divWrapStyle = { color: i.color, ...IconWrapStyle };\n const wrapperDom = (\n <div\n key={`toolList_${i.key}`}\n style={divWrapStyle}\n onClick={i.onClick}\n >\n {innerIcon}\n {innerText}\n </div>\n );\n\n if (i.render) {\n return i.render(i, innerIcon, innerText, divWrapStyle);\n }\n\n return wrapperDom;\n })\n }\n </>\n );\n};\n","import React from 'react';\nimport { BarftEditorPage, BaseEditorProps } from \"@components/Editor/BraftEditor\";\nimport { ControlsToolBar, ToolListItem } from \"@components/Editor/CommonTool/ControlsToolBar\";\nimport { ContentUtils } from \"braft-utils\";\nimport styles from './index.less';\n\ninterface SimpleEditorProps extends BaseEditorProps {\n toolAlign?: 'inner' | 'bottom';\n toolList?: Array<ToolListItem>;\n injectControlsToolBar?: any;\n injectBraftEditorProps?: any;\n toolBarContainerStyle?: any;\n appendToolBtn?: any;\n}\n\nconst SimpleEditor = (props: SimpleEditorProps) => {\n const {\n value,\n onChange, \n toolAlign = 'inner',\n toolList = [],\n injectControlsToolBar = {},\n toolBarContainerStyle = {},\n injectBraftEditorProps = {},\n appendToolBtn = null,\n } = props;\n\n\n if (toolAlign === 'inner') {\n return (\n <BarftEditorPage\n value={value}\n onChange={onChange}\n controls={[]}\n FloatControls={({ editorState, setEditorState }: any) => (\n <ControlsToolBar\n editorState={editorState}\n setEditorState={setEditorState}\n toolList={toolList}\n {...injectControlsToolBar}\n />)\n }\n {...injectBraftEditorProps}\n />\n )\n }\n\n return (\n <div>\n <BarftEditorPage\n value={value}\n onChange={onChange}\n controls={[]}\n {...injectBraftEditorProps}\n />\n <div style={toolBarContainerStyle}>\n <div className={styles.bottomToolBarWrapper}>\n <ControlsToolBar\n editorState={value}\n setEditorState={onChange}\n toolList={toolList}\n {...injectControlsToolBar}\n />\n </div>\n {appendToolBtn}\n </div>\n </div>\n );\n}\n\nexport default SimpleEditor;"],"names":["ControlsToolBar","props","editorState","setEditorState","toolList","injectIconWrapStyle","injectIconStyle","injectIconTextStyle","IconWrapStyle","display","alignItems","cursor","textAlign","minWidth","IconStyle","fontSize","IconTextStyle","margin","length","React","createElement","Fragment","map","i","innerIcon","className","iconClass","style","innerText","text","iconTextClass","divWrapStyle","color","wrapperDom","key","onClick","render","SimpleEditor","value","onChange","toolAlign","injectControlsToolBar","toolBarContainerStyle","injectBraftEditorProps","appendToolBtn","BarftEditorPage","Object","assign","controls","FloatControls","styles","bottomToolBarWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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