Aucune description

index.js.map 7.1KB

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 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 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 />)\n }\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","divWrapStyle","color","wrapperDom","key","onClick","render","SimpleEditor","value","onChange","toolAlign","injectControlsToolBar","toolBarContainerStyle","injectBraftEditorProps","appendToolBtn","BarftEditorPage","controls","FloatControls","Object","assign","styles","bottomToolBarWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAgC;MA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