@pega/cosmos-react-rte 8.0.0-build.9.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js +8 -4
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
- package/lib/components/Editor/Editor.d.ts +3 -6
- package/lib/components/Editor/Editor.d.ts.map +1 -1
- package/lib/components/Editor/Editor.js +120 -55
- package/lib/components/Editor/Editor.js.map +1 -1
- package/lib/components/Editor/Editor.styles.d.ts +2 -1
- package/lib/components/Editor/Editor.styles.d.ts.map +1 -1
- package/lib/components/Editor/Editor.styles.js +7 -12
- package/lib/components/Editor/Editor.styles.js.map +1 -1
- package/lib/components/Editor/Editor.types.d.ts +2 -0
- package/lib/components/Editor/Editor.types.d.ts.map +1 -1
- package/lib/components/Editor/Editor.types.js.map +1 -1
- package/lib/components/Editor/ImageEditor.d.ts.map +1 -1
- package/lib/components/Editor/ImageEditor.js +56 -40
- package/lib/components/Editor/ImageEditor.js.map +1 -1
- package/lib/components/Editor/Toolbar/AnchorButton.d.ts.map +1 -1
- package/lib/components/Editor/Toolbar/AnchorButton.js +5 -4
- package/lib/components/Editor/Toolbar/AnchorButton.js.map +1 -1
- package/lib/components/Editor/Toolbar/TextSelect.d.ts +18 -3
- package/lib/components/Editor/Toolbar/TextSelect.d.ts.map +1 -1
- package/lib/components/Editor/Toolbar/TextSelect.js +63 -23
- package/lib/components/Editor/Toolbar/TextSelect.js.map +1 -1
- package/lib/components/Editor/Toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/Editor/Toolbar/Toolbar.js +4 -2
- package/lib/components/Editor/Toolbar/Toolbar.js.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/BlockQuote.d.ts +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/BlockQuote.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Code.d.ts +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Code.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/CodeBlock.d.ts +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/CodeBlock.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/HorizontalRule.d.ts +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/HorizontalRule.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Image.d.ts +5 -2
- package/lib/components/RichTextEditor/DecoratorComponents/Image.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Image.js.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Table.d.ts +4 -5
- package/lib/components/RichTextEditor/DecoratorComponents/Table.d.ts.map +1 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Table.js.map +1 -1
- package/lib/components/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/lib/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/lib/components/RichTextEditor/RichTextEditor.js +12 -3
- package/lib/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/lib/components/RichTextEditor/RichTextEditor.styles.d.ts.map +1 -1
- package/lib/components/RichTextEditor/RichTextEditor.styles.js +4 -0
- package/lib/components/RichTextEditor/RichTextEditor.styles.js.map +1 -1
- package/lib/components/RichTextEditor/RichTextTreeRenderer.d.ts +2 -2
- package/lib/components/RichTextEditor/RichTextTreeRenderer.d.ts.map +1 -1
- package/lib/components/RichTextEditor/RichTextTreeRenderer.js.map +1 -1
- package/lib/components/RichTextEditor/RichTextViewer.d.ts +2 -3
- package/lib/components/RichTextEditor/RichTextViewer.d.ts.map +1 -1
- package/lib/components/RichTextEditor/RichTextViewer.js +34 -3
- package/lib/components/RichTextEditor/RichTextViewer.js.map +1 -1
- package/lib/components/RichTextEditor/RichTextViewer.types.d.ts +13 -7
- package/lib/components/RichTextEditor/RichTextViewer.types.d.ts.map +1 -1
- package/lib/components/RichTextEditor/RichTextViewer.types.js.map +1 -1
- package/lib/components/RichTextEditor/Toolbar/TextSelect.d.ts.map +1 -1
- package/lib/components/RichTextEditor/Toolbar/TextSelect.js +10 -2
- package/lib/components/RichTextEditor/Toolbar/TextSelect.js.map +1 -1
- package/lib/components/RichTextEditor/utils/EditorCommands.d.ts.map +1 -1
- package/lib/components/RichTextEditor/utils/EditorCommands.js.map +1 -1
- package/lib/components/RichTextEditor/utils/ListCommands.js.map +1 -1
- package/lib/components/RichTextEditor/utils/htmlConverter.js.map +1 -1
- package/lib/components/RichTextEditor/utils/markdownConverter.d.ts +2 -2
- package/lib/components/RichTextEditor/utils/markdownConverter.d.ts.map +1 -1
- package/lib/components/RichTextEditor/utils/markdownConverter.js +1 -3
- package/lib/components/RichTextEditor/utils/markdownConverter.js.map +1 -1
- package/lib/components/RichTextEditor/utils/renderers.d.ts +7 -5
- package/lib/components/RichTextEditor/utils/renderers.d.ts.map +1 -1
- package/lib/components/RichTextEditor/utils/renderers.js.map +1 -1
- package/lib/components/RichTextEditor/utils/slateConverter.js.map +1 -1
- package/package.json +10 -11
- package/lib/components/RichTextEditor/DecoratorComponents/Link.d.ts +0 -4
- package/lib/components/RichTextEditor/DecoratorComponents/Link.d.ts.map +0 -1
- package/lib/components/RichTextEditor/DecoratorComponents/Link.js +0 -8
- package/lib/components/RichTextEditor/DecoratorComponents/Link.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AACl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,EAAE,MAAM,EACd,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,aAElC,MAAC,qBAAqB,IACpB,OAAO,EAAE,GAAG,EAAE;gCACZ,IAAI,CAAC,QAAQ,EAAE,CAAC;oCACd,MAAM,EAAE,KAAK,EAAE,CAAC;gCAClB,CAAC;4BACH,CAAC,EACD,GAAG,EAAE,mBAAmB,aAExB,mBACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,CAAC,OAAO,IAAI,EAAE,EAC1B,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,gBACN,GAAG,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,qBAClE,OAAO,EACxB,GAAG,EAAE,UAAU,GACf,EACD,mBAAmB,CAAC,OAAO,IAAI,MAAM,IAAI,CAAC,QAAQ,IAAI,CACrD,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB,CAAC,OAAO,EACrC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,GAClC,CACH,IACqB,EACvB,aAAa,IAAI,CAChB,KAAC,OAAO,IACN,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,GAC5B,CACH,IACW,GACG,EAClB,QAAQ,IACc,CAC1B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import tinymce from 'tinymce/tinymce';\nimport type { Editor as TinymceEditor, EditorEvent } from 'tinymce/tinymce';\nimport 'tinymce/icons/default';\nimport 'tinymce/themes/silver';\nimport 'tinymce/plugins/advlist';\nimport 'tinymce/plugins/lists';\nimport 'tinymce/plugins/autolink';\nimport 'tinymce/models/dom';\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n useLayoutEffect,\n useImperativeHandle,\n useCallback,\n useMemo\n} from 'react';\nimport type { FC, PropsWithoutRef, FocusEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { compile, serialize, stringify } from 'stylis';\nimport { stripUnit } from 'polished';\n\nimport {\n createUID,\n FormControl,\n useAfterInitialEffect,\n useTheme,\n useUID,\n useI18n,\n useConsolidatedRef,\n defaultThemeProp,\n useAutoResize,\n useConfiguration,\n useTestIds,\n withTestIds,\n documentIsAvailable,\n getActiveElement\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport { getHtmlStyles } from '@pega/cosmos-react-core/lib/components/HTML/HTML';\nimport {\n createGlobalBodyStyles,\n createGlobalRootStyles,\n globalSpacingStyles\n} from '@pega/cosmos-react-core/lib/styles/GlobalStyle';\n\nimport StyledRichTextEditor from '../RichTextEditor/RichTextEditor.styles';\n\nimport Toolbar from './Toolbar/Toolbar';\nimport EditorContext from './Editor.context';\nimport { getTextFormats } from './Toolbar/TextSelect';\nimport type { CustomComponent, EditorProps, EditorState } from './Editor.types';\nimport ImageEditor, { imgHoverClass } from './ImageEditor';\nimport {\n offscreenSelectionStyles,\n placeholderStyles,\n mceContentBodyStyles,\n StyledEditorContainer,\n StyledEditorRoot\n} from './Editor.styles';\nimport { getEditorTestIds } from './Editor.test-ids';\nimport createFileItemElement from './FileItemElement';\n\ntype ImageInfoArray = { id: string; url: string; name: string }[];\n\nconst getFileFromUrl = async (url: string, name: string) => {\n const response = await fetch(url);\n const data = await response.blob();\n return new File([data], name, {\n type: data.type\n });\n};\n\nexport const getImageStyles = (theme: DefaultTheme) => {\n return `\n img:hover,\n img.${imgHoverClass} {\n box-shadow: 0 0 0 0.06125rem ${theme.base.palette['primary-background']},\n 0 0 0 0.125rem ${theme.base.palette.interactive}, 0 0 0 0.25rem rgba(0, 118, 209, 0.3);\n }\n `;\n};\n\nexport const StyledInnerEditor = styled.div<{ showPlaceholder: boolean }>(\n ({ theme, showPlaceholder }) => {\n return css`\n ${showPlaceholder &&\n css`\n ::before {\n color: ${theme.base.colors.slate.medium};\n position: absolute;\n content: attr(data-mce-placeholder);\n }\n `}\n `;\n }\n);\n\nStyledInnerEditor.defaultProps = defaultThemeProp;\n\nconst Editor: FC<EditorProps & ForwardProps> = forwardRef(function Editor(\n props: PropsWithoutRef<EditorProps> & ForwardProps,\n ref: EditorProps['ref']\n) {\n const theme = useTheme();\n const {\n components: {\n 'text-area': { 'min-height': textAreaMinHeight }\n }\n } = theme;\n const { styleSheetTarget } = useConfiguration();\n const [editor, setEditor] = useState<TinymceEditor>();\n const [focused, setFocused] = useState(false);\n const t = useI18n();\n const uid = useUID();\n const labelId = useUID();\n const editorRef = useConsolidatedRef(ref);\n const tinyMceRef = useRef<HTMLTextAreaElement>(null);\n const tinyMceContainerRef = useRef<HTMLDivElement>(null);\n const initialized = useRef(false);\n\n const pastedImages = useRef<File[]>([]);\n\n const {\n testId,\n id = uid,\n toolbar = [],\n label,\n labelHidden,\n info,\n status,\n required,\n disabled,\n readOnly,\n onChange,\n onKeyDown,\n onFocus,\n onBlur,\n onImageAdded,\n onInit,\n defaultValue,\n customComponents = [],\n height,\n autoResize = true,\n customActions,\n placeholder,\n children,\n spellcheck = true,\n additionalInfo,\n initOptions,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getEditorTestIds);\n\n const baseHeight: EditorProps['height'] = {\n min: height?.min ?? (stripUnit(textAreaMinHeight) as number) * 16,\n max: height?.max ?? undefined\n };\n const getHeight = (type: 'max' | 'min') => {\n if (typeof baseHeight === 'number') {\n return stripUnit(baseHeight) as number;\n }\n if (baseHeight[type]) {\n return stripUnit(baseHeight[type] as number) as number;\n }\n return undefined;\n };\n\n const imagesEnabled = toolbar.includes('images');\n const maxHeight = autoResize ? getHeight('max') : undefined;\n const minHeight = autoResize ? getHeight('min') : undefined;\n const [autoResizeRef, resizeEditor] = useAutoResize<HTMLIFrameElement>(maxHeight, minHeight);\n const formFieldRef = useRef<HTMLElement>(null);\n const value = useRef(defaultValue);\n const customActionsLength = customActions?.length ?? 0;\n const renderToolbar =\n editor && (toolbar.length > 0 || customActionsLength > 0) && !readOnly && !disabled;\n\n const processPastedImgUrls = async (infoArr: ImageInfoArray) => {\n const files = await Promise.all(\n infoArr.map(({ id: imgId, url }) => getFileFromUrl(url, imgId))\n );\n files.forEach((file, i) => {\n onImageAdded?.(file, infoArr[i].id);\n });\n };\n\n const pastePreprocess = (plugin: unknown, args: { content: string }) => {\n const isImg = args.content.includes('<img');\n if (!imagesEnabled && isImg) {\n args.content = args.content.replace(/<img(.*)\\/>/g, '');\n }\n if (imagesEnabled && isImg) {\n const pastedHtml: HTMLElement = new DOMParser().parseFromString(\n args.content,\n 'text/html'\n ).body;\n const imgInfo: ImageInfoArray = [];\n pastedHtml.querySelectorAll('img').forEach(imgEl => {\n const imgId = createUID();\n const url = imgEl.src;\n const name = pastedImages.current.shift()?.name || id;\n imgInfo.push({ id: imgId, url, name });\n const uploadEl = document.createElement('pega-file');\n uploadEl.setAttribute('data-id', imgId);\n uploadEl.setAttribute('data-name', name);\n uploadEl.setAttribute('data-url', url);\n uploadEl.setAttribute('data-progress', '0');\n uploadEl.setAttribute('contenteditable', 'false');\n const uploadElString = `<br/>${uploadEl.outerHTML}<br/>`;\n const uploadElHtml = new DOMParser().parseFromString(uploadElString, 'text/html').body;\n\n imgEl.replaceWith(uploadElHtml);\n });\n args.content = pastedHtml.innerHTML;\n processPastedImgUrls(imgInfo);\n }\n };\n\n useImperativeHandle<any, EditorState>(\n editorRef,\n () => ({\n focus: () => {\n editor?.focus();\n },\n getPlainText: () => {\n return editor ? editor.getContent({ format: 'text' }) : '';\n },\n getRichText: () => {\n return editor ? JSON.stringify(editor.getContent({ format: 'raw' })) : '';\n },\n getHtml: () => {\n return editor ? editor.getContent({ format: 'html' }) : '';\n },\n clear: () => {\n editor?.setContent('');\n },\n updateAttachmentAttributes: (imageId, progress, error) => {\n if (editor) {\n const editorEl = editor.getDoc();\n const imageCustomEl = editorEl.querySelector(`pega-file[data-id=\"${imageId}\"]`);\n if (imageCustomEl) {\n if (error) imageCustomEl.setAttribute('data-error', error);\n else if (progress) imageCustomEl.setAttribute('data-progress', `${progress}`);\n }\n }\n },\n appendImage: ({ src, alt, attachmentId }, imageId) => {\n if (editor) {\n const editorEl = editor.getDoc();\n const imageUploadEl = editorEl.querySelector(`pega-file[data-id=\"${imageId}\"]`);\n if (imageUploadEl) {\n const imgEl = editorEl.createElement('img');\n imgEl.setAttribute('src', src);\n imgEl.setAttribute('alt', alt);\n if (attachmentId) {\n imgEl.setAttribute('data-attachment-id', attachmentId);\n }\n imageUploadEl.replaceWith(imgEl);\n imageUploadEl?.remove();\n resizeEditor();\n }\n }\n },\n insertText: (text: string) => {\n let activeElement: Element | null = null;\n if (documentIsAvailable) {\n activeElement = getActiveElement();\n }\n editor?.insertContent(text);\n\n if (activeElement) (activeElement as HTMLElement).focus();\n },\n setCursorLocationToStart: () => {\n editor?.selection.setCursorLocation();\n editor?.selection.getNode().scrollIntoView();\n },\n insertHtml: (html: string, overwrite: boolean = false) => {\n if (overwrite && html === editor?.getContent({ format: 'html' })) return;\n\n let activeElement: Element | null = null;\n if (documentIsAvailable) {\n activeElement = getActiveElement();\n }\n if (overwrite) {\n editor?.setContent('');\n }\n editor?.insertContent(html);\n\n if (activeElement) (activeElement as HTMLElement).focus();\n },\n getEditor: () => {\n return editor;\n },\n element: formFieldRef.current || undefined\n }),\n [editor]\n );\n\n useLayoutEffect(() => {\n if (!tinyMceRef.current || !tinyMceContainerRef.current) return;\n const styles = serialize(compile(getHtmlStyles(theme)), stringify);\n const imageStyles = serialize(compile(getImageStyles(theme)), stringify);\n const FileItemStyle = css`\n /* stylelint-disable-next-line selector-type-no-unknown */\n pega-file {\n display: inline-block;\n width: ${theme.base['content-width'].md};\n }\n `;\n\n const customElements: CustomComponent[] = [\n {\n createCustomElement: createFileItemElement,\n name: 'pega-file',\n style: FileItemStyle.toString(),\n extensionAttributes: ['contenteditable']\n },\n ...customComponents\n ];\n\n tinymce\n .init({\n readonly: readOnly || disabled,\n skin: false,\n target: tinyMceRef.current,\n toolbar: false,\n min_height: 60,\n height: 60,\n menubar: false,\n plugins: 'lists advlist autolink',\n paste_block_drop: true,\n paste_data_images: initOptions?.pasteDataImages ?? true,\n lists_indent_on_tab: true,\n text_patterns: initOptions?.textPatterns,\n icons: '',\n branding: false,\n elementpath: false,\n placeholder,\n content_css: false,\n browser_spellcheck: spellcheck,\n relative_urls: false,\n remove_script_host: false,\n paste_preprocess: pastePreprocess,\n convert_unsafe_embeds: true,\n content_style: `\n ${createGlobalRootStyles(theme)}\n ${globalSpacingStyles}\n ${createGlobalBodyStyles(theme)}\n\n html {\n overflow: hidden;\n }\n\n body {\n min-height: 3rem;\n padding: ${theme.base.spacing};\n }\n\n ${offscreenSelectionStyles}\n ${mceContentBodyStyles}\n ${placeholderStyles}\n ${imageStyles}\n ${styles}\n ${initOptions?.contentStyle}\n `,\n init_instance_callback: initializedEditor => {\n if (initOptions?.initInstanceCallback) {\n initOptions.initInstanceCallback(initializedEditor);\n }\n initializedEditor.dom.setAttrib('tinymce', 'aria-label', null);\n const iframeWindow = (\n tinyMceContainerRef.current?.querySelector('iframe') as HTMLIFrameElement\n ).contentWindow;\n const editorCustomElements = iframeWindow?.customElements;\n\n if (editorCustomElements) {\n customElements.forEach(({ name, createCustomElement: customElementCreator, style }) => {\n if (!editorCustomElements.get(name)) {\n editorCustomElements.define(\n name,\n customElementCreator(iframeWindow as unknown as typeof globalThis)\n );\n }\n if (style) {\n const styleEl = document.createElement('style');\n styleEl.innerText = style;\n styleEl.nonce = window.__webpack_nonce__;\n initializedEditor.getDoc().head.appendChild(styleEl);\n }\n });\n }\n },\n extended_valid_elements: `${customElements\n .map(\n comp =>\n `${comp.name}${\n comp.extensionAttributes ? `[${comp.extensionAttributes.join('|')}]` : ''\n }`\n )\n .join(',')}`,\n custom_elements: customElements.map(comp => `~${comp.name}`).join('~,'),\n invalid_elements: 'iframe',\n setup: editorSettings => {\n editorSettings.on('keydown', e => {\n const activeElement = editorSettings?.getDoc().activeElement;\n if (e.key === 'Enter' && activeElement?.nodeName === 'PEGA-FILE') {\n e.preventDefault();\n const bookmark = editorSettings.selection.getBookmark();\n activeElement.shadowRoot?.querySelector('button')?.click();\n editorSettings?.selection.moveToBookmark(bookmark);\n } else onKeyDown?.(e);\n });\n getTextFormats().forEach((format, i) => {\n editorSettings.addShortcut(\n `meta+alt+${i}`,\n `${t('rte_change_text_format')} ${format.text}`,\n () => {\n editorSettings.execCommand('FormatBlock', false, format.type);\n }\n );\n });\n editorSettings.addShortcut('meta+shift+b', t('rte_bold'), () => {\n editorSettings.execCommand('Bold');\n });\n editorSettings.addShortcut('meta+shift+i', t('rte_italic'), () => {\n editorSettings.execCommand('Italic');\n });\n editorSettings.addShortcut('meta+shift+x', t('rte_strike_through'), () => {\n editorSettings.execCommand('Strikethrough');\n });\n editorSettings.addShortcut('meta+shift+l', t('rte_toggle_unordered_list'), () => {\n editorSettings.execCommand('InsertUnorderedList');\n });\n editorSettings.addShortcut('alt+m', t('rte_indent_selection'), () => {\n editorSettings.execCommand('Indent');\n });\n editorSettings.addShortcut('alt+shift+m', t('rte_unindent_selection'), () => {\n editorSettings.execCommand('Outdent');\n });\n customActions?.forEach(action => {\n if (action.shortcut) {\n editorSettings.addShortcut(\n action.shortcut.pattern,\n action.shortcut.description,\n () => {\n action.shortcut?.command(editorSettings);\n }\n );\n }\n });\n }\n })\n .then(tinymceEditors => {\n setEditor(tinymceEditors[0]);\n tinymceEditors[0]?.editorContainer?.setAttribute('style', '');\n const iframe = tinyMceContainerRef.current?.querySelector('iframe');\n if (iframe) {\n const globalStyles =\n styleSheetTarget?.querySelectorAll('[data-cosmos-global-style]') ??\n ([] as HTMLElement[]);\n const extraStyles =\n document.querySelectorAll('[data-cosmos-global-style]') ?? ([] as HTMLElement[]);\n const iframeContentHead = iframe?.contentDocument?.querySelector('head');\n [...globalStyles, ...extraStyles].forEach(sheet => {\n iframeContentHead?.appendChild(sheet.cloneNode(true));\n });\n autoResizeRef.current = iframe;\n\n if (autoResize) resizeEditor();\n }\n });\n }, []);\n\n useEffect(() => {\n if (editor) {\n editor.options.set('paste_preprocess', pastePreprocess);\n }\n }, [imagesEnabled]);\n\n useEffect(() => {\n if (!editor) return;\n const onChangeEvents = ['input', 'paste', 'FormatApply', 'FormatRemove', 'ExecCommand'];\n const onEditorKeyDown = () => {\n const activeElement = editor.selection.getNode();\n if (activeElement.nodeName === 'PEGA-FILE') {\n (\n activeElement.shadowRoot?.querySelector('button[aria-label*=\"Cancel\"]') as HTMLElement\n )?.focus();\n }\n\n if (autoResize) resizeEditor();\n };\n const onEditorChange = (\n event: EditorEvent<Event & { command?: string; clipboardData?: { files: File[] } }>\n ) => {\n if (event.type === 'paste' && event.clipboardData?.files) {\n pastedImages.current = Array.from(event.clipboardData?.files);\n }\n if (event.type !== 'execcommand' || event.command !== 'mceFocus') {\n onChange?.(editor);\n }\n };\n const onEditorFocus = () => {\n setFocused(true);\n onFocus?.();\n };\n const onEditorBlur = () => {\n setFocused(false);\n onBlur?.();\n };\n onChangeEvents.forEach(event => {\n editor.on(event, onEditorChange);\n });\n editor.on('keydown', onEditorKeyDown);\n if (autoResize) editor.on('paste', resizeEditor);\n\n editor.on('focus', onEditorFocus);\n editor.on('blur', onEditorBlur);\n return () => {\n onChangeEvents.forEach(event => {\n editor.off(event, onEditorChange);\n });\n editor.off('keydown', onEditorKeyDown);\n if (autoResize) editor.off('paste', resizeEditor);\n editor.off('focus', onEditorFocus);\n editor.off('blur', onEditorBlur);\n };\n }, [editor, onFocus, onBlur]);\n\n useEffect(() => {\n if (!editor || initialized.current) return;\n initialized.current = true;\n onInit?.(editor);\n }, [editor, onInit]);\n\n useAfterInitialEffect(() => {\n editor?.mode.set(readOnly || disabled ? 'readonly' : 'design');\n }, [readOnly, disabled]);\n\n const addImage = useCallback(\n (image: File, imageId?: string) => {\n if (editor) {\n const imageUid = imageId ?? createUID();\n editor.insertContent(\n `<br/><pega-file data-id='${imageUid}' data-progress='0' data-name='${image.name}' > </pega-file><br/>`\n );\n onImageAdded?.(image, imageUid);\n }\n },\n [editor]\n );\n\n const ctx = useMemo(\n () => ({ addImage, editor: editor || ({} as TinymceEditor) }),\n [editor, addImage]\n );\n\n useEffect(() => {\n const onEditorDrop = (e: DragEvent) => {\n e.preventDefault();\n if (e.dataTransfer) {\n Array.from(e.dataTransfer.files).forEach(file => {\n if (file.type.includes('image') && imagesEnabled) {\n addImage(file);\n }\n });\n }\n };\n editor?.on('drop', onEditorDrop);\n const body = editor?.getDoc().body;\n\n let resizeObserver: ResizeObserver | undefined;\n\n if (autoResize) {\n resizeObserver = new ResizeObserver(() => {\n resizeEditor();\n });\n if (body) {\n resizeObserver.observe(body);\n }\n }\n\n return () => {\n editor?.off('drop', onEditorDrop);\n\n resizeObserver?.disconnect();\n };\n }, [editor, resizeEditor]);\n\n return (\n <EditorContext.Provider value={ctx}>\n <StyledEditorRoot\n testId={testIds}\n toolbar={renderToolbar}\n label={\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <span\n onClick={() => {\n editor?.focus();\n }}\n >\n {label}\n </span>\n }\n labelFor=''\n labelId={labelId}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onFocus={(e: FocusEvent) => {\n if (e.target === formFieldRef.current && !disabled) {\n editor?.focus();\n }\n }}\n ref={formFieldRef}\n tabIndex={disabled ? -1 : undefined}\n additionalInfo={additionalInfo}\n >\n <FormControl\n {...restProps}\n ref={editorRef}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n as={StyledRichTextEditor}\n focused={focused}\n tabIndex={readOnly ? 0 : undefined}\n >\n <StyledEditorContainer\n onClick={() => {\n if (!disabled) {\n editor?.focus();\n }\n }}\n ref={tinyMceContainerRef}\n >\n <textarea\n id={id}\n value={value.current || ''}\n onChange={() => {}}\n aria-label={`${label}${renderToolbar ? `. ${t('rte_toolbar_instructions')}.` : ''}`}\n aria-labelledby={labelId}\n ref={tinyMceRef}\n />\n {tinyMceContainerRef.current && editor && !readOnly && (\n <ImageEditor\n editor={editor}\n editorEl={tinyMceContainerRef.current}\n onChange={() => onChange?.(editor)}\n />\n )}\n </StyledEditorContainer>\n {renderToolbar && (\n <Toolbar\n testId={testIds}\n features={toolbar}\n editor={editor}\n customActions={customActions}\n />\n )}\n </FormControl>\n </StyledEditorRoot>\n {children}\n </EditorContext.Provider>\n );\n});\n\nexport default withTestIds(Editor, getEditorTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":";;AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAEtC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,SAAS,EACT,MAAM,EACN,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,SAAS,EACT,WAAW,EACX,qBAAqB,EACrB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB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,QAAQ,IAAI,CAAC,QAAQ,IAAI,CACnF,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,mBAAmB,CAAC,OAAO,EACrC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,GAClC,CACH,IACqB,EACvB,aAAa,IAAI,CAChB,KAAC,OAAO,IACN,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,GAC5B,CACH,IACW,GACG,EAClB,QAAQ,IACc,CAC1B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,MAAM,aAAa,GAAiD,UAAU,CAC5E,SAAS,aAAa,CAAC,KAAmC,EAAE,GAAuB;IACjF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IAC3E,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAE1C,OAAO,CACL,eAAC,MAAM,OACD,KAAK,EACT,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,eAAe,CAAC,KAAK,CAAC,CAAC;YACvB,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACtB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import tinymce from 'tinymce/tinymce';\nimport type { Editor as TinymceEditor, EditorEvent } from 'tinymce/tinymce';\nimport 'tinymce/icons/default';\nimport 'tinymce/themes/silver';\nimport 'tinymce/plugins/advlist';\nimport 'tinymce/plugins/lists';\nimport 'tinymce/plugins/autolink';\nimport 'tinymce/models/dom';\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n useLayoutEffect,\n useImperativeHandle,\n useCallback,\n useMemo\n} from 'react';\nimport type { PropsWithoutRef, FocusEvent } from 'react';\nimport { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { compile, serialize, stringify } from 'stylis';\nimport { mix, stripUnit } from 'polished';\n\nimport {\n createUID,\n FormControl,\n useAfterInitialEffect,\n useTheme,\n useUID,\n useI18n,\n useConsolidatedRef,\n useAutoResize,\n useConfiguration,\n useTestIds,\n withTestIds,\n documentIsAvailable,\n getActiveElement\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport { getHtmlStyles } from '@pega/cosmos-react-core/lib/components/HTML/HTML';\nimport {\n createGlobalBodyStyles,\n createGlobalRootStyles,\n globalSpacingStyles\n} from '@pega/cosmos-react-core/lib/styles/GlobalStyle';\n\nimport StyledRichTextEditor from '../RichTextEditor/RichTextEditor.styles';\n\nimport Toolbar from './Toolbar/Toolbar';\nimport EditorContext from './Editor.context';\nimport { getTextFormats } from './Toolbar/TextSelect';\nimport type { CustomComponent, EditorProps } from './Editor.types';\nimport ImageEditor, { imgHoverClass } from './ImageEditor';\nimport {\n offscreenSelectionStyles,\n mceContentBodyStyles,\n StyledEditorContainer,\n StyledEditorRoot\n} from './Editor.styles';\nimport { getEditorTestIds } from './Editor.test-ids';\nimport createFileItemElement from './FileItemElement';\n\ntype ImageInfoArray = { id: string; url: string; name: string }[];\n\nconst getFileFromUrl = async (url: string, name: string) => {\n const response = await fetch(url);\n const data = await response.blob();\n return new File([data], name, {\n type: data.type\n });\n};\n\nexport const getImageStyles = (theme: DefaultTheme) => {\n return `\n img:hover,\n img.${imgHoverClass} {\n box-shadow: 0 0 0 0.06125rem ${theme.base.palette['primary-background']},\n 0 0 0 0.125rem ${theme.base.palette.interactive}, 0 0 0 0.25rem rgba(0, 118, 209, 0.3);\n }\n `;\n};\n\nexport const getPlaceholderStyles = (theme: DefaultTheme) => {\n return `\n .mce-content-body[data-mce-placeholder] {\n position: relative;\n }\n\n .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n cursor: text;\n color: ${mix(\n theme.base.transparency['transparent-3'],\n theme.base.palette['foreground-color'],\n theme.components['form-control']['background-color']\n )};\n content: attr(data-mce-placeholder);\n position: absolute;\n }\n `;\n};\n\nconst Editor: ForwardRefForwardPropsComponent<EditorProps & { onUnload: (value: string) => void }> =\n forwardRef(function Editor(\n props: PropsWithoutRef<EditorProps & { onUnload: (value: string) => void }>,\n ref: EditorProps['ref']\n ) {\n const theme = useTheme();\n const {\n components: {\n 'text-area': { 'min-height': textAreaMinHeight }\n }\n } = theme;\n const { styleSheetTarget } = useConfiguration();\n const [editor, setEditor] = useState<TinymceEditor>();\n const [focused, setFocused] = useState(false);\n const t = useI18n();\n const uid = useUID();\n const labelId = useUID();\n const editorRef = useConsolidatedRef(ref);\n const tinyMceRef = useRef<HTMLTextAreaElement>(null);\n const tinyMceContainerRef = useRef<HTMLDivElement>(null);\n const initialized = useRef(false);\n\n const pastedImages = useRef<File[]>([]);\n\n const {\n testId,\n id = uid,\n toolbar = [],\n label,\n labelHidden,\n info,\n status,\n required,\n disabled,\n readOnly,\n onChange,\n onKeyDown,\n onFocus,\n onBlur,\n onImageAdded,\n onInit,\n onUnload,\n defaultValue,\n customComponents = [],\n height,\n autoResize = true,\n customActions,\n placeholder,\n children,\n spellcheck = true,\n additionalInfo,\n initOptions,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getEditorTestIds);\n\n const baseHeight: EditorProps['height'] = {\n min: height?.min ?? (stripUnit(textAreaMinHeight) as number) * 16,\n max: height?.max ?? undefined\n };\n const getHeight = (type: 'max' | 'min') => {\n if (typeof baseHeight === 'number') {\n return stripUnit(baseHeight) as number;\n }\n if (baseHeight[type]) {\n return stripUnit(baseHeight[type] as number) as number;\n }\n return undefined;\n };\n\n const imagesEnabled = toolbar.includes('images');\n const maxHeight = autoResize ? getHeight('max') : undefined;\n const minHeight = autoResize ? getHeight('min') : undefined;\n const [autoResizeRef, resizeEditor] = useAutoResize<HTMLIFrameElement>(maxHeight, minHeight);\n const formFieldRef = useRef<HTMLElement>(null);\n const value = useRef(defaultValue);\n const customActionsLength = customActions?.length ?? 0;\n const renderToolbar =\n editor && (toolbar.length > 0 || customActionsLength > 0) && !readOnly && !disabled;\n\n const processPastedImgUrls = async (infoArr: ImageInfoArray) => {\n const files = await Promise.all(\n infoArr.map(({ id: imgId, url }) => getFileFromUrl(url, imgId))\n );\n files.forEach((file, i) => {\n onImageAdded?.(file, infoArr[i].id);\n });\n };\n\n const pastePreprocess = (plugin: unknown, args: { content: string }) => {\n const isImg = args.content.includes('<img');\n if (!imagesEnabled && isImg) {\n args.content = args.content.replace(/<img(.*)\\/>/g, '');\n }\n if (imagesEnabled && isImg) {\n const pastedHtml: HTMLElement = new DOMParser().parseFromString(\n args.content,\n 'text/html'\n ).body;\n const imgInfo: ImageInfoArray = [];\n pastedHtml.querySelectorAll('img').forEach(imgEl => {\n const imgId = createUID();\n const url = imgEl.src;\n const name = pastedImages.current.shift()?.name || id;\n imgInfo.push({ id: imgId, url, name });\n const uploadEl = document.createElement('pega-file');\n uploadEl.setAttribute('data-id', imgId);\n uploadEl.setAttribute('data-name', name);\n uploadEl.setAttribute('data-url', url);\n uploadEl.setAttribute('data-progress', '0');\n uploadEl.setAttribute('contenteditable', 'false');\n const uploadElString = `<br/>${uploadEl.outerHTML}<br/>`;\n const uploadElHtml = new DOMParser().parseFromString(uploadElString, 'text/html').body;\n\n imgEl.replaceWith(uploadElHtml);\n });\n args.content = pastedHtml.innerHTML;\n processPastedImgUrls(imgInfo);\n }\n };\n\n useImperativeHandle(\n editorRef,\n () => ({\n focus: () => {\n editor?.focus();\n },\n getPlainText: () => {\n return editor ? editor.getContent({ format: 'text' }) : '';\n },\n getRichText: () => {\n return editor ? JSON.stringify(editor.getContent({ format: 'raw' })) : '';\n },\n getHtml: () => {\n return editor ? editor.getContent({ format: 'html' }) : '';\n },\n clear: () => {\n editor?.setContent('');\n },\n updateAttachmentAttributes: (imageId, progress, error) => {\n if (editor) {\n const editorEl = editor.getDoc();\n const imageCustomEl = editorEl.querySelector(`pega-file[data-id=\"${imageId}\"]`);\n if (imageCustomEl) {\n if (error) imageCustomEl.setAttribute('data-error', error);\n else if (progress) imageCustomEl.setAttribute('data-progress', `${progress}`);\n }\n }\n },\n appendImage: ({ src, alt, attachmentId }, imageId) => {\n if (editor) {\n const editorEl = editor.getDoc();\n const imageUploadEl = editorEl.querySelector(`pega-file[data-id=\"${imageId}\"]`);\n\n if (imageUploadEl) {\n const imgEl = editorEl.createElement('img');\n imgEl.setAttribute('src', src);\n imgEl.setAttribute('alt', alt);\n if (attachmentId) {\n imgEl.setAttribute('data-attachment-id', attachmentId);\n }\n imageUploadEl.replaceWith(imgEl);\n imageUploadEl?.remove();\n if (autoResize) resizeEditor();\n }\n }\n },\n insertText: (text: string) => {\n let activeElement: Element | null = null;\n if (documentIsAvailable) {\n activeElement = getActiveElement();\n }\n editor?.insertContent(text);\n\n if (activeElement) (activeElement as HTMLElement).focus();\n },\n setCursorLocationToStart: () => {\n editor?.selection.setCursorLocation();\n editor?.selection.getNode().scrollIntoView();\n },\n insertHtml: (html: string, overwrite: boolean = false) => {\n if (overwrite && html === editor?.getContent({ format: 'html' })) return;\n\n let activeElement: Element | null = null;\n if (documentIsAvailable) {\n activeElement = getActiveElement();\n }\n if (overwrite) {\n editor?.setContent(html);\n } else {\n editor?.insertContent(html);\n }\n\n if (activeElement) (activeElement as HTMLElement).focus();\n },\n getEditor: () => {\n return editor;\n },\n element: formFieldRef.current || undefined\n }),\n [editor]\n );\n\n useLayoutEffect(() => {\n if (!tinyMceRef.current || !tinyMceContainerRef.current) return;\n const styles = serialize(compile(getHtmlStyles(theme)), stringify);\n const imageStyles = serialize(compile(getImageStyles(theme)), stringify);\n const placeholderStyles = serialize(compile(getPlaceholderStyles(theme)), stringify);\n const FileItemStyle = css`\n /* stylelint-disable-next-line selector-type-no-unknown */\n pega-file {\n display: inline-block;\n width: ${theme.base['content-width'].md};\n }\n `;\n\n const contentStyle = `\n ${createGlobalRootStyles(theme)}\n ${globalSpacingStyles}\n ${createGlobalBodyStyles(theme)}\n\n html {\n overflow: hidden;\n }\n\n body {\n min-height: 3rem;\n padding: ${theme.base.spacing};\n background: unset;\n }\n\n ${offscreenSelectionStyles}\n ${mceContentBodyStyles}\n ${placeholderStyles}\n ${imageStyles}\n ${styles}\n ${initOptions?.contentStyle}\n `;\n\n const customElements: CustomComponent[] = [\n {\n createCustomElement: createFileItemElement,\n name: 'pega-file',\n style: FileItemStyle.toString(),\n extensionAttributes: ['contenteditable']\n },\n ...customComponents\n ];\n\n tinymce\n .init({\n readonly: readOnly || disabled,\n skin: false,\n target: tinyMceRef.current,\n toolbar: false,\n min_height: 60,\n height: 60,\n menubar: false,\n plugins: 'lists advlist autolink',\n paste_block_drop: true,\n paste_data_images: initOptions?.pasteDataImages ?? true,\n lists_indent_on_tab: true,\n text_patterns: initOptions?.textPatterns,\n icons: '',\n branding: false,\n elementpath: false,\n placeholder,\n content_css: false,\n browser_spellcheck: spellcheck,\n relative_urls: false,\n remove_script_host: false,\n paste_preprocess: pastePreprocess,\n convert_unsafe_embeds: true,\n sandbox_iframes: true,\n paste_as_text: initOptions?.pasteAsText,\n init_instance_callback: initializedEditor => {\n if (initOptions?.initInstanceCallback) {\n initOptions.initInstanceCallback(initializedEditor);\n }\n if (typeof label === 'string') {\n initializedEditor.getBody().setAttribute('aria-label', label);\n }\n const iframeWindow = (\n tinyMceContainerRef.current?.querySelector('iframe') as HTMLIFrameElement\n ).contentWindow;\n const editorCustomElements = iframeWindow?.customElements;\n\n // Manually add content style to allow setting nonce attribute\n const contentStyleEl = document.createElement('style');\n contentStyleEl.innerText = contentStyle;\n contentStyleEl.nonce = window.__webpack_nonce__;\n initializedEditor.getDoc().head.appendChild(contentStyleEl);\n\n if (editorCustomElements) {\n customElements.forEach(\n ({ name, createCustomElement: customElementCreator, style }) => {\n if (!editorCustomElements.get(name)) {\n editorCustomElements.define(\n name,\n customElementCreator(iframeWindow as unknown as typeof globalThis)\n );\n }\n if (style) {\n const customElementStyleEl = document.createElement('style');\n customElementStyleEl.innerText = style;\n customElementStyleEl.nonce = window.__webpack_nonce__;\n initializedEditor.getDoc().head.appendChild(customElementStyleEl);\n }\n }\n );\n }\n },\n extended_valid_elements: `${customElements\n .map(\n comp =>\n `${comp.name}${\n comp.extensionAttributes ? `[${comp.extensionAttributes.join('|')}]` : ''\n }`\n )\n .join(',')}`,\n custom_elements: customElements.map(comp => `~${comp.name}`).join('~,'),\n invalid_elements: 'iframe',\n setup: editorSettings => {\n editorSettings.on('keydown', e => {\n const activeElement = editorSettings?.getDoc().activeElement;\n if (e.key === 'Enter' && activeElement?.nodeName === 'PEGA-FILE') {\n e.preventDefault();\n const bookmark = editorSettings.selection.getBookmark();\n activeElement.shadowRoot?.querySelector('button')?.click();\n editorSettings?.selection.moveToBookmark(bookmark);\n } else onKeyDown?.(e);\n });\n getTextFormats(t).forEach((format, i) => {\n editorSettings.addShortcut(\n `meta+alt+${i}`,\n `${t('rte_change_text_format')} ${format.text}`,\n () => {\n editorSettings.execCommand('FormatBlock', false, format.type);\n }\n );\n });\n editorSettings.addShortcut('meta+shift+b', t('rte_bold'), () => {\n editorSettings.execCommand('Bold');\n });\n editorSettings.addShortcut('meta+shift+i', t('rte_italic'), () => {\n editorSettings.execCommand('Italic');\n });\n editorSettings.addShortcut('meta+shift+x', t('rte_strike_through'), () => {\n editorSettings.execCommand('Strikethrough');\n });\n editorSettings.addShortcut('meta+shift+l', t('rte_toggle_unordered_list'), () => {\n editorSettings.execCommand('InsertUnorderedList');\n });\n editorSettings.addShortcut('alt+m', t('rte_indent_selection'), () => {\n editorSettings.execCommand('Indent');\n });\n editorSettings.addShortcut('alt+shift+m', t('rte_unindent_selection'), () => {\n editorSettings.execCommand('Outdent');\n });\n customActions?.forEach(action => {\n if (action.shortcut) {\n editorSettings.addShortcut(\n action.shortcut.pattern,\n action.shortcut.description,\n () => {\n action.shortcut?.command(editorSettings);\n }\n );\n }\n });\n }\n })\n .then(tinymceEditors => {\n setEditor(tinymceEditors[0]);\n tinymceEditors[0]?.editorContainer?.removeAttribute('style');\n const iframe = tinyMceContainerRef.current?.querySelector('iframe');\n if (iframe) {\n const globalStyles =\n styleSheetTarget?.querySelectorAll('[data-cosmos-global-style]') ??\n ([] as HTMLElement[]);\n const extraStyles =\n document.querySelectorAll('[data-cosmos-global-style]') ?? ([] as HTMLElement[]);\n const iframeContentHead = iframe?.contentDocument?.querySelector('head');\n [...globalStyles, ...extraStyles].forEach(sheet => {\n iframeContentHead?.appendChild(sheet.cloneNode(true));\n });\n autoResizeRef.current = iframe;\n\n if (autoResize) resizeEditor();\n }\n });\n }, []);\n\n useEffect(() => {\n if (editor) {\n editor.options.set('paste_preprocess', pastePreprocess);\n }\n }, [imagesEnabled]);\n\n useEffect(() => {\n if (!editor) return;\n const onChangeEvents = ['input', 'paste', 'FormatApply', 'FormatRemove', 'ExecCommand'];\n const onEditorKeyDown = () => {\n const activeElement = editor.selection.getNode();\n if (activeElement.nodeName === 'PEGA-FILE') {\n (\n activeElement.shadowRoot?.querySelector('button[aria-label*=\"Cancel\"]') as HTMLElement\n )?.focus();\n }\n\n if (autoResize) resizeEditor();\n };\n const onEditorChange = (\n event: EditorEvent<Event & { command?: string; clipboardData?: { files: File[] } }>\n ) => {\n if (event.type === 'paste' && event.clipboardData?.files) {\n pastedImages.current = Array.from(event.clipboardData?.files);\n }\n if (event.type !== 'execcommand' || event.command !== 'mceFocus') {\n onChange?.(editor);\n }\n };\n const onEditorFocus = () => {\n setFocused(true);\n onFocus?.();\n };\n const onEditorBlur = () => {\n setFocused(false);\n onBlur?.();\n };\n onChangeEvents.forEach(event => {\n editor.on(event, onEditorChange);\n });\n editor.on('keydown', onEditorKeyDown);\n if (autoResize) editor.on('paste', resizeEditor);\n\n editor.on('focus', onEditorFocus);\n editor.on('blur', onEditorBlur);\n return () => {\n onChangeEvents.forEach(event => {\n editor.off(event, onEditorChange);\n });\n editor.off('keydown', onEditorKeyDown);\n if (autoResize) editor.off('paste', resizeEditor);\n editor.off('focus', onEditorFocus);\n editor.off('blur', onEditorBlur);\n };\n }, [editor, onFocus, onBlur]);\n\n useEffect(() => {\n if (!editor || initialized.current) return;\n initialized.current = true;\n onInit?.(editor);\n }, [editor, onInit]);\n\n useAfterInitialEffect(() => {\n editor?.mode.set(readOnly || disabled ? 'readonly' : 'design');\n }, [readOnly, disabled]);\n\n const addImage = useCallback(\n (image: File, imageId?: string) => {\n if (editor) {\n const imageUid = imageId ?? createUID();\n editor.insertContent(\n `<br/><pega-file data-id='${imageUid}' data-progress='0' data-name='${image.name}' > </pega-file><br/>`\n );\n onImageAdded?.(image, imageUid);\n }\n },\n [editor]\n );\n\n const ctx = useMemo(\n () => ({ addImage, editor: editor || ({} as TinymceEditor) }),\n [editor, addImage]\n );\n\n useEffect(() => {\n const onEditorDrop = (e: DragEvent) => {\n e.preventDefault();\n if (e.dataTransfer) {\n Array.from(e.dataTransfer.files).forEach(file => {\n if (file.type.includes('image') && imagesEnabled) {\n addImage(file);\n }\n });\n }\n };\n editor?.on('drop', onEditorDrop);\n const body = editor?.getDoc().body;\n\n let resizeObserver: ResizeObserver | undefined;\n\n if (autoResize) {\n resizeObserver = new ResizeObserver(() => {\n resizeEditor();\n });\n if (body) {\n resizeObserver.observe(body);\n }\n }\n\n return () => {\n editor?.off('drop', onEditorDrop);\n\n resizeObserver?.disconnect();\n };\n }, [editor, resizeEditor]);\n\n useEffect(() => {\n if (!editor || !autoResize) return;\n\n const imgEls = editor.getDoc().querySelectorAll('img');\n\n imgEls.forEach(imgEl => {\n imgEl.addEventListener('load', resizeEditor);\n imgEl.addEventListener('error', resizeEditor);\n });\n\n return () => {\n imgEls.forEach(imgEl => {\n imgEl.removeEventListener('load', resizeEditor);\n imgEl.removeEventListener('error', resizeEditor);\n });\n };\n });\n\n useEffect(() => {\n if (!editor) return;\n\n const body = editor.getBody();\n\n const mutationObserver = new MutationObserver(() => {\n if (body.hasAttribute('aria-placeholder')) {\n body.removeAttribute('aria-placeholder');\n }\n });\n\n mutationObserver.observe(body, { attributes: true, attributeFilter: ['aria-placeholder'] });\n\n return () => {\n mutationObserver.disconnect();\n };\n }, [editor]);\n\n useEffect(() => {\n if (!editor) return;\n\n const win = editor.getWin();\n const ac = new AbortController();\n\n win.addEventListener(\n 'unload',\n () => {\n onUnload(editor.getContent({ format: 'html' }));\n },\n { signal: ac.signal }\n );\n\n return () => {\n ac.abort();\n };\n }, [editor]);\n\n return (\n <EditorContext.Provider value={ctx}>\n <StyledEditorRoot\n testId={testIds}\n toolbar={renderToolbar}\n label={\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events\n <span\n onClick={() => {\n editor?.focus();\n }}\n >\n {label}\n </span>\n }\n labelFor=''\n labelId={labelId}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onFocus={(e: FocusEvent) => {\n if (e.target === formFieldRef.current && !disabled) {\n editor?.focus();\n }\n }}\n ref={formFieldRef}\n tabIndex={disabled ? -1 : undefined}\n additionalInfo={additionalInfo}\n >\n <FormControl\n {...restProps}\n ref={editorRef}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n as={StyledRichTextEditor}\n focused={focused}\n tabIndex={readOnly ? 0 : undefined}\n >\n <StyledEditorContainer\n onClick={() => {\n if (!disabled) {\n editor?.focus();\n }\n }}\n ref={tinyMceContainerRef}\n >\n <textarea\n id={id}\n value={value.current || ''}\n onChange={() => {}}\n aria-label={`${label}${renderToolbar ? `. ${t('rte_toolbar_instructions')}.` : ''}`}\n aria-labelledby={labelId}\n ref={tinyMceRef}\n />\n {tinyMceContainerRef.current && editor && imagesEnabled && !readOnly && !disabled && (\n <ImageEditor\n editor={editor}\n editorEl={tinyMceContainerRef.current}\n onChange={() => onChange?.(editor)}\n />\n )}\n </StyledEditorContainer>\n {renderToolbar && (\n <Toolbar\n testId={testIds}\n features={toolbar}\n editor={editor}\n customActions={customActions}\n />\n )}\n </FormControl>\n </StyledEditorRoot>\n {children}\n </EditorContext.Provider>\n );\n });\n\nconst EditorWrapper: ForwardRefForwardPropsComponent<EditorProps> = forwardRef(\n function EditorWrapper(props: PropsWithoutRef<EditorProps>, ref: EditorProps['ref']) {\n const [defaultValue, setDefaultValue] = useState(props.defaultValue ?? '');\n const [key, setKey] = useState(createUID);\n\n return (\n <Editor\n {...props}\n defaultValue={defaultValue}\n onUnload={value => {\n setDefaultValue(value);\n setKey(createUID());\n }}\n ref={ref}\n key={key}\n />\n );\n }\n);\n\nexport default withTestIds(EditorWrapper, getEditorTestIds);\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare const offscreenSelectionStyles = "\n .mce-offscreen-selection {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n whiteSpace: nowrap;\n width: 1px;\n }\n";
|
|
2
2
|
export declare const mceContentBodyStyles = "\n .mce-content-body {\n overflow-wrap: break-word;\n }\n";
|
|
3
|
-
export declare const placeholderStyles = "\n .mce-content-body[data-mce-placeholder] {\n position: relative;\n }\n .mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n cursor: text;\n color: rgb(117, 117, 117);\n content: attr(data-mce-placeholder);\n position: absolute;\n }\n";
|
|
4
3
|
export declare const StyledEditorContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
4
|
export declare const StyledEditorRoot: import("styled-components").StyledComponent<import("react").FC<import("@pega/cosmos-react-core").FormFieldProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
6
5
|
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
7
6
|
}, import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledEditPopover: import("styled-components").StyledComponent<(<Modifiers extends string = string>(props: import("@pega/cosmos-react-core").PopoverProps<Modifiers> & import("@pega/cosmos-react-core").ForwardProps) => import("react").ReactElement | null), import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
export declare const StyledFormDialog: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<import("@pega/cosmos-react-core").FormDialogProps> & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
8
9
|
//# sourceMappingURL=Editor.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,oOAYpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,mEAIhC,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Editor.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,oOAYpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,mEAIhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAgBhC,CAAC;AAIH,eAAO,MAAM,gBAAgB;2BAS+xE,CAAC,oEAAkC,yBAAa;uDATzzE,CAAC;AAEpD,eAAO,MAAM,iBAAiB,mSAE7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,iRAE5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { FormField, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
2
|
+
import { FormDialog, FormField, Popover, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
3
|
export const offscreenSelectionStyles = `
|
|
4
4
|
.mce-offscreen-selection {
|
|
5
5
|
border: 0;
|
|
@@ -18,17 +18,6 @@ export const mceContentBodyStyles = `
|
|
|
18
18
|
overflow-wrap: break-word;
|
|
19
19
|
}
|
|
20
20
|
`;
|
|
21
|
-
export const placeholderStyles = `
|
|
22
|
-
.mce-content-body[data-mce-placeholder] {
|
|
23
|
-
position: relative;
|
|
24
|
-
}
|
|
25
|
-
.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {
|
|
26
|
-
cursor: text;
|
|
27
|
-
color: rgb(117, 117, 117);
|
|
28
|
-
content: attr(data-mce-placeholder);
|
|
29
|
-
position: absolute;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
21
|
export const StyledEditorContainer = styled.div(({ theme }) => {
|
|
33
22
|
return css `
|
|
34
23
|
&:hover {
|
|
@@ -48,4 +37,10 @@ export const StyledEditorContainer = styled.div(({ theme }) => {
|
|
|
48
37
|
});
|
|
49
38
|
StyledEditorContainer.defaultProps = defaultThemeProp;
|
|
50
39
|
export const StyledEditorRoot = styled(FormField) ``;
|
|
40
|
+
export const StyledEditPopover = styled(Popover) `
|
|
41
|
+
overflow: auto;
|
|
42
|
+
`;
|
|
43
|
+
export const StyledFormDialog = styled(FormDialog) `
|
|
44
|
+
overflow: auto;
|
|
45
|
+
`;
|
|
51
46
|
//# sourceMappingURL=Editor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.styles.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Editor.styles.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;CAYvC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;CAInC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,OAAO,GAAG,CAAA;;;;;;;;gBAQI,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;;;;;;GAMxD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;;CAE/C,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;CAEjD,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { FormDialog, FormField, Popover, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const offscreenSelectionStyles = `\n .mce-offscreen-selection {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n whiteSpace: nowrap;\n width: 1px;\n }\n`;\n\nexport const mceContentBodyStyles = `\n .mce-content-body {\n overflow-wrap: break-word;\n }\n`;\n\nexport const StyledEditorContainer = styled.div(({ theme }) => {\n return css`\n &:hover {\n cursor: text;\n }\n\n iframe {\n display: block;\n width: 100%;\n height: ${theme.components['text-area']['min-height']};\n }\n\n .tox-statusbar {\n display: none !important;\n }\n `;\n});\n\nStyledEditorContainer.defaultProps = defaultThemeProp;\n\nexport const StyledEditorRoot = styled(FormField)``;\n\nexport const StyledEditPopover = styled(Popover)`\n overflow: auto;\n`;\n\nexport const StyledFormDialog = styled(FormDialog)`\n overflow: auto;\n`;\n"]}
|
|
@@ -73,6 +73,8 @@ export interface EditorProps extends FormControlProps, BaseProps, TestIdProp {
|
|
|
73
73
|
initOptions?: {
|
|
74
74
|
/** Disables pasting of images in editor when false */
|
|
75
75
|
pasteDataImages?: RawEditorOptions['paste_data_images'];
|
|
76
|
+
/** Converts formatted text to plain text upon pasting */
|
|
77
|
+
pasteAsText?: RawEditorOptions['paste_as_text'];
|
|
76
78
|
/** Disables inline, block, and replacement text patterns when false and can be array of allowed formats */
|
|
77
79
|
textPatterns?: RawEditorOptions['text_patterns'];
|
|
78
80
|
/** Function called during init_instance_callback as part of editor init */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.types.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,GAAG,EACH,UAAU,IAAI,eAAe,EAC7B,aAAa,IAAI,kBAAkB,EACpC,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjF,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE/F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG;IAC9C,SAAS,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IAC3C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,0BAA0B,EAAE,CAAC,EAAE,E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,eAAe,EAAE,CAAC;IACrC,iEAAiE;IACjE,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE;QACZ,sDAAsD;QACtD,eAAe,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;QACxD,yDAAyD;QACzD,WAAW,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;QAChD,2GAA2G;QAC3G,YAAY,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;QACjD,2EAA2E;QAC3E,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;QAClE,iDAAiD;QACjD,YAAY,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;KAClD,CAAC;IACF,2BAA2B;IAC3B,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.types.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ReactNode,\n Ref,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport type { RawEditorOptions, Editor as TinymceEditor } from 'tinymce/tinymce';\n\nimport type { Action, BaseProps, FormControlProps, TestIdProp } from '@pega/cosmos-react-core';\n\nimport type { Features } from '../RichTextEditor/Toolbar/Toolbar.types';\nimport type { RichTextEditorState } from '../RichTextEditor';\n\nexport type EditorState = RichTextEditorState & {\n getEditor: () => TinymceEditor | undefined;\n element?: HTMLElement;\n setCursorLocationToStart?: () => void;\n updateAttachmentAttributes: (id: string, progress?: number, error?: string) => void;\n};\n\nexport type CustomAction = {\n text: Action['text'];\n icon: NonNullable<Action['icon']>;\n onMouseDown: (e: ReactMouseEvent | ReactKeyboardEvent) => void;\n active?: (editor: TinymceEditor) => void;\n shortcut?: { pattern: string; description: string; command: (editor: TinymceEditor) => void };\n 'data-testid'?: string;\n};\n\nexport type CustomComponent = {\n createCustomElement: (window: typeof globalThis) => CustomElementConstructor;\n name: string;\n extensionAttributes?: string[];\n style?: string;\n};\n\nexport interface EditorProps extends FormControlProps, BaseProps, TestIdProp {\n /** An array of strings that activate features on the toolbar */\n toolbar?: Features[];\n /** Children content */\n children?: ReactNode;\n /** A callback that supplies an object with functions that can manipulate the editor and retrieve it's content/state */\n onChange?: (editor?: TinymceEditor) => void;\n /** KeyDown event custom handlers for the editor */\n onKeyDown?: (event?: KeyboardEvent) => void;\n /** A callback that runs if the editor is focused */\n onFocus?: () => void;\n /** A callback that runs if the editor loses focus */\n onBlur?: () => void;\n /** A callback when an image is added through the toolbar image feature */\n onImageAdded?: (image: File, id: string) => void;\n /** A callback for when tinymce is finished initializing */\n onInit?: (editor: TinymceEditor) => void;\n /** Standard placeholder for an input */\n placeholder?: string;\n /** Default value for the RTE - HTML String */\n defaultValue?: string;\n /** Will automatically focus the RTE on render if true */\n autoFocus?: boolean;\n /** Sets the height for the RTE. If no max height is set the RTE will continue to expand, otherwise an overflow will be applied */\n height?: {\n min?: number;\n max?: number;\n };\n /**\n * Determines if the editor resizes its height based on content and user interactions.\n * @default true;\n */\n autoResize?: boolean;\n /** An array of custom components, custom components must use web component API */\n customComponents?: CustomComponent[];\n /** An array of custom buttons to be inserted into the toolbar */\n customActions?: CustomAction[];\n /**\n * Enables browser spellcheck.\n * @default true\n */\n spellcheck?: boolean;\n /** Options used during init of the editor */\n initOptions?: {\n /** Disables pasting of images in editor when false */\n pasteDataImages?: RawEditorOptions['paste_data_images'];\n /** Disables inline, block, and replacement text patterns when false and can be array of allowed formats */\n textPatterns?: RawEditorOptions['text_patterns'];\n /** Function called during init_instance_callback as part of editor init */\n initInstanceCallback?: RawEditorOptions['init_instance_callback'];\n /** Styles to set within the iframe's document */\n contentStyle?: RawEditorOptions['content_style'];\n };\n /** Handle to the state. */\n ref?: Ref<EditorState>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Editor.types.js","sourceRoot":"","sources":["../../../src/components/Editor/Editor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ReactNode,\n Ref,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport type { RawEditorOptions, Editor as TinymceEditor } from 'tinymce/tinymce';\n\nimport type { Action, BaseProps, FormControlProps, TestIdProp } from '@pega/cosmos-react-core';\n\nimport type { Features } from '../RichTextEditor/Toolbar/Toolbar.types';\nimport type { RichTextEditorState } from '../RichTextEditor';\n\nexport type EditorState = RichTextEditorState & {\n getEditor: () => TinymceEditor | undefined;\n element?: HTMLElement;\n setCursorLocationToStart?: () => void;\n updateAttachmentAttributes: (id: string, progress?: number, error?: string) => void;\n};\n\nexport type CustomAction = {\n text: Action['text'];\n icon: NonNullable<Action['icon']>;\n onMouseDown: (e: ReactMouseEvent | ReactKeyboardEvent) => void;\n active?: (editor: TinymceEditor) => void;\n shortcut?: { pattern: string; description: string; command: (editor: TinymceEditor) => void };\n 'data-testid'?: string;\n};\n\nexport type CustomComponent = {\n createCustomElement: (window: typeof globalThis) => CustomElementConstructor;\n name: string;\n extensionAttributes?: string[];\n style?: string;\n};\n\nexport interface EditorProps extends FormControlProps, BaseProps, TestIdProp {\n /** An array of strings that activate features on the toolbar */\n toolbar?: Features[];\n /** Children content */\n children?: ReactNode;\n /** A callback that supplies an object with functions that can manipulate the editor and retrieve it's content/state */\n onChange?: (editor?: TinymceEditor) => void;\n /** KeyDown event custom handlers for the editor */\n onKeyDown?: (event?: KeyboardEvent) => void;\n /** A callback that runs if the editor is focused */\n onFocus?: () => void;\n /** A callback that runs if the editor loses focus */\n onBlur?: () => void;\n /** A callback when an image is added through the toolbar image feature */\n onImageAdded?: (image: File, id: string) => void;\n /** A callback for when tinymce is finished initializing */\n onInit?: (editor: TinymceEditor) => void;\n /** Standard placeholder for an input */\n placeholder?: string;\n /** Default value for the RTE - HTML String */\n defaultValue?: string;\n /** Will automatically focus the RTE on render if true */\n autoFocus?: boolean;\n /** Sets the height for the RTE. If no max height is set the RTE will continue to expand, otherwise an overflow will be applied */\n height?: {\n min?: number;\n max?: number;\n };\n /**\n * Determines if the editor resizes its height based on content and user interactions.\n * @default true;\n */\n autoResize?: boolean;\n /** An array of custom components, custom components must use web component API */\n customComponents?: CustomComponent[];\n /** An array of custom buttons to be inserted into the toolbar */\n customActions?: CustomAction[];\n /**\n * Enables browser spellcheck.\n * @default true\n */\n spellcheck?: boolean;\n /** Options used during init of the editor */\n initOptions?: {\n /** Disables pasting of images in editor when false */\n pasteDataImages?: RawEditorOptions['paste_data_images'];\n /** Converts formatted text to plain text upon pasting */\n pasteAsText?: RawEditorOptions['paste_as_text'];\n /** Disables inline, block, and replacement text patterns when false and can be array of allowed formats */\n textPatterns?: RawEditorOptions['text_patterns'];\n /** Function called during init_instance_callback as part of editor init */\n initInstanceCallback?: RawEditorOptions['init_instance_callback'];\n /** Styles to set within the iframe's document */\n contentStyle?: RawEditorOptions['content_style'];\n };\n /** Handle to the state. */\n ref?: Ref<EditorState>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/ImageEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,EAAE,EAKH,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageEditor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/ImageEditor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,EAAE,EAKH,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA0BtC,eAAO,MAAM,aAAa,QAAc,CAAC;AAEzC,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;CAAE,CA0YpF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState, useLayoutEffect } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import {
|
|
4
|
+
import { remToPx, stripUnit } from 'polished';
|
|
5
|
+
import { Button, Checkbox, createUID, Grid, Icon, Input, NumberInput, useAfterInitialEffect, useElement, useI18n, useTheme, useUID, VisuallyHiddenText } from '@pega/cosmos-react-core';
|
|
6
|
+
import { StyledFormDialog } from './Editor.styles';
|
|
5
7
|
const IgnoreMouseEventsIcon = styled(Icon) `
|
|
6
8
|
pointer-events: none;
|
|
7
9
|
`;
|
|
@@ -9,45 +11,51 @@ export const imgHoverClass = createUID();
|
|
|
9
11
|
const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
10
12
|
const t = useI18n();
|
|
11
13
|
const id = useUID();
|
|
12
|
-
const
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const [showImageDialog, setShowImageDialog] = useState(false);
|
|
13
16
|
const [imageEditHover, setImageEditHover] = useState(false);
|
|
14
17
|
const [imageEditFocus, setImageEditFocus] = useState(false);
|
|
15
|
-
const [
|
|
18
|
+
const [canShowButtons, setCanShowButtons] = useState(false);
|
|
16
19
|
const [imgEl, setImageEl] = useState(null);
|
|
17
20
|
const [imgElements, setImageElements] = useState([]);
|
|
18
|
-
const [
|
|
21
|
+
const [editButtonEl, setEditButtonEl] = useElement(null);
|
|
22
|
+
const [deleteButtonEl, setDeleteButtonEl] = useElement(null);
|
|
19
23
|
const [width, setWidth] = useState(0);
|
|
20
24
|
const [height, setHeight] = useState(0);
|
|
21
25
|
const [aspectRatio, setAspectRatio] = useState(0);
|
|
22
26
|
const [altText, setAltText] = useState('');
|
|
23
27
|
const [customSize, setCustomSize] = useState(false);
|
|
24
28
|
const [keyCommandText, setKeyCommandText] = useState('');
|
|
25
|
-
const
|
|
29
|
+
const imageDialogRef = useRef(null);
|
|
26
30
|
const altTextInputRef = useRef(null);
|
|
27
31
|
const editorOpenedWithEnter = useRef(false);
|
|
28
32
|
const [btnStyle, setBtnStyle] = useState({});
|
|
29
33
|
const onImageClick = (e) => {
|
|
30
34
|
e.preventDefault();
|
|
31
35
|
e.stopPropagation();
|
|
32
|
-
|
|
36
|
+
setShowImageDialog(true);
|
|
33
37
|
};
|
|
34
38
|
const calculateBtnStyles = (el) => {
|
|
35
39
|
const elementRect = el.getBoundingClientRect();
|
|
40
|
+
const padding = Number(stripUnit(remToPx(theme.base.spacing)));
|
|
36
41
|
return {
|
|
37
42
|
position: 'absolute',
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
display: 'flex',
|
|
44
|
+
top: elementRect.top + padding,
|
|
45
|
+
left: elementRect.right +
|
|
46
|
+
padding -
|
|
47
|
+
((editButtonEl?.scrollWidth ?? 0) + (deleteButtonEl?.scrollWidth ?? 0) * 2)
|
|
40
48
|
};
|
|
41
49
|
};
|
|
42
50
|
const onImageMouseEnter = (e) => {
|
|
43
|
-
if (!
|
|
51
|
+
if (!showImageDialog) {
|
|
44
52
|
const el = e.target;
|
|
45
53
|
setImageEditHover(true);
|
|
46
54
|
setImageEl(el);
|
|
47
55
|
}
|
|
48
56
|
};
|
|
49
57
|
const onImageMouseLeave = (e) => {
|
|
50
|
-
if (e.relatedTarget && e.relatedTarget.id !== id && !
|
|
58
|
+
if (e.relatedTarget && e.relatedTarget.id !== id && !showImageDialog) {
|
|
51
59
|
setImageEl(null);
|
|
52
60
|
setImageEditHover(false);
|
|
53
61
|
}
|
|
@@ -78,10 +86,6 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
78
86
|
setCustomSize(hasHeightOrWidthAttribute);
|
|
79
87
|
}
|
|
80
88
|
};
|
|
81
|
-
useOuterEvent('mousedown', [imagePopoverRef], () => {
|
|
82
|
-
setImageState();
|
|
83
|
-
setShowImagePopover(false);
|
|
84
|
-
});
|
|
85
89
|
const onCheckBoxClick = (e) => {
|
|
86
90
|
e.stopPropagation();
|
|
87
91
|
};
|
|
@@ -108,8 +112,7 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
108
112
|
setWidth(inputWidth);
|
|
109
113
|
setHeight(inputWidth / aspectRatio);
|
|
110
114
|
};
|
|
111
|
-
const onImageChangeSubmit = (
|
|
112
|
-
e.preventDefault();
|
|
115
|
+
const onImageChangeSubmit = () => {
|
|
113
116
|
if (imgEl) {
|
|
114
117
|
if (customSize) {
|
|
115
118
|
if (Number.isNaN(height) || Number.isNaN(width)) {
|
|
@@ -131,19 +134,20 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
131
134
|
}
|
|
132
135
|
editor.selection.select(editor.dom.select(`img[src="${imgEl?.src}"]`)[0]);
|
|
133
136
|
setImageEl(null);
|
|
134
|
-
|
|
137
|
+
setShowImageDialog(false);
|
|
135
138
|
onChange();
|
|
136
139
|
};
|
|
137
140
|
const onImageChangeCancel = () => {
|
|
138
141
|
setImageEl(null);
|
|
139
|
-
|
|
142
|
+
setShowImageDialog(false);
|
|
140
143
|
};
|
|
141
144
|
const onImageDelete = () => {
|
|
142
145
|
if (imgEl) {
|
|
143
146
|
imgEl.remove();
|
|
144
147
|
}
|
|
145
148
|
setImageEl(null);
|
|
146
|
-
|
|
149
|
+
setShowImageDialog(false);
|
|
150
|
+
setImageEditFocus(false);
|
|
147
151
|
onChange();
|
|
148
152
|
};
|
|
149
153
|
// Keeps the imageElements state up to date with existing and newly added img tags inside of TinyMCE
|
|
@@ -188,11 +192,11 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
188
192
|
useEffect(() => {
|
|
189
193
|
setImageState();
|
|
190
194
|
imgEl?.setAttribute('class', imgHoverClass);
|
|
191
|
-
if (imgEl && imgEl.clientHeight >
|
|
192
|
-
|
|
195
|
+
if (imgEl && imgEl.clientHeight > 64 && imgEl.clientWidth > 104) {
|
|
196
|
+
setCanShowButtons(true);
|
|
193
197
|
}
|
|
194
198
|
else {
|
|
195
|
-
|
|
199
|
+
setCanShowButtons(false);
|
|
196
200
|
}
|
|
197
201
|
return () => {
|
|
198
202
|
imgEl?.removeAttribute('class');
|
|
@@ -212,7 +216,7 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
212
216
|
nextToImg = true;
|
|
213
217
|
// If your selection is next to an image that breaks text up inside of a paragraph
|
|
214
218
|
}
|
|
215
|
-
else if (selection
|
|
219
|
+
else if (selection?.anchorNode?.nextSibling?.nodeName === 'IMG') {
|
|
216
220
|
setImageEl(selection.anchorNode.nextSibling);
|
|
217
221
|
setImageEditFocus(true);
|
|
218
222
|
nextToImg = true;
|
|
@@ -226,26 +230,36 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
226
230
|
setKeyCommandText(t('rte_image_key_command'));
|
|
227
231
|
}
|
|
228
232
|
};
|
|
233
|
+
const onMouseUp = () => {
|
|
234
|
+
const selection = editor.selection.getSel();
|
|
235
|
+
// If your selection is next to an image
|
|
236
|
+
if (selection?.anchorNode?.firstChild?.nodeName === 'IMG') {
|
|
237
|
+
setImageEl(selection.anchorNode.firstChild);
|
|
238
|
+
setImageEditFocus(true);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
229
241
|
const onKeyDown = (e) => {
|
|
230
242
|
if (e.key === 'Enter' && imageEditFocus) {
|
|
231
243
|
e.stopPropagation();
|
|
232
244
|
e.preventDefault();
|
|
233
245
|
editorOpenedWithEnter.current = true;
|
|
234
|
-
|
|
246
|
+
setShowImageDialog(true);
|
|
235
247
|
}
|
|
236
|
-
else if (e.key === 'Del' && imageEditFocus) {
|
|
248
|
+
else if ((e.key === 'Del' || e.key === 'Backspace') && imageEditFocus) {
|
|
237
249
|
onImageDelete();
|
|
238
250
|
}
|
|
239
251
|
};
|
|
240
252
|
editor.on('keyup', onKeyUp);
|
|
253
|
+
editor.on('mouseup', onMouseUp);
|
|
241
254
|
editor.on('keydown', onKeyDown, true);
|
|
242
255
|
return () => {
|
|
243
256
|
editor.off('keyup', onKeyUp);
|
|
257
|
+
editor.off('mouseup', onMouseUp);
|
|
244
258
|
editor.off('keydown', onKeyDown);
|
|
245
259
|
};
|
|
246
260
|
}, [editor, imgEl, imageEditFocus]);
|
|
247
261
|
useAfterInitialEffect(() => {
|
|
248
|
-
if (
|
|
262
|
+
if (showImageDialog) {
|
|
249
263
|
editor.selection.getSel()?.collapseToEnd();
|
|
250
264
|
if (editorOpenedWithEnter.current) {
|
|
251
265
|
altTextInputRef.current?.focus();
|
|
@@ -255,22 +269,24 @@ const ImageEditor = ({ editorEl, editor, onChange }) => {
|
|
|
255
269
|
else {
|
|
256
270
|
editor.focus();
|
|
257
271
|
}
|
|
258
|
-
}, [
|
|
272
|
+
}, [showImageDialog]);
|
|
259
273
|
useLayoutEffect(() => {
|
|
260
|
-
if (imgEl &&
|
|
274
|
+
if (imgEl && editButtonEl && deleteButtonEl) {
|
|
261
275
|
setBtnStyle(calculateBtnStyles(imgEl));
|
|
262
276
|
}
|
|
263
|
-
}, [imgEl,
|
|
264
|
-
return (_jsxs(_Fragment, { children: [(imageEditFocus || imageEditHover) && imgEl &&
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
277
|
+
}, [imgEl, editButtonEl, deleteButtonEl]);
|
|
278
|
+
return (_jsxs(_Fragment, { children: [(imageEditFocus || imageEditHover) && imgEl && canShowButtons && (_jsxs("div", { id: id, style: btnStyle, children: [_jsx(Button, { ref: setEditButtonEl, icon: true, label: t('rte_edit_image'), "aria-label": t('rte_edit_image', [altText]), onClick: () => {
|
|
279
|
+
setShowImageDialog(true);
|
|
280
|
+
}, children: _jsx(IgnoreMouseEventsIcon, { name: 'pencil' }) }), _jsx(Button, { ref: setDeleteButtonEl, icon: true, label: t('rte_delete_image'), "aria-label": t('rte_delete_image', [altText]), onClick: onImageDelete, children: _jsx(IgnoreMouseEventsIcon, { name: 'trash' }) })] })), _jsx(VisuallyHiddenText, { "aria-live": 'polite', children: keyCommandText }), showImageDialog && (editButtonEl || !canShowButtons) && imgEl && (_jsx(StyledFormDialog, { ref: imageDialogRef, target: editButtonEl && canShowButtons ? editButtonEl : imgEl, heading: t('rte_image_settings'), onCancel: onImageChangeCancel, onSubmit: onImageChangeSubmit, onDismiss: () => {
|
|
281
|
+
setShowImageDialog(false);
|
|
282
|
+
}, children: _jsxs(Grid, { container: {
|
|
283
|
+
gap: 2,
|
|
284
|
+
areas: customSize
|
|
285
|
+
? '"desc desc" "radio radio" "width height"'
|
|
286
|
+
: '"desc desc" "radio radio"'
|
|
287
|
+
}, children: [_jsx(Grid, { item: { area: 'desc' }, children: _jsx(Input, { label: t('description'), value: altText, onClick: onInputClick, onChange: onAltTextChange, onFocus: onInputFocus, info: t('rte_image_description_info'), ref: altTextInputRef }) }), _jsx(Grid, { item: { area: 'radio' }, children: _jsx(Checkbox, { checked: customSize, label: t('rte_image_custom_size'), onClick: onCheckBoxClick, onChange: (e) => {
|
|
288
|
+
setCustomSize(e.target.checked);
|
|
289
|
+
} }) }), customSize && (_jsxs(_Fragment, { children: [_jsx(Grid, { item: { area: 'width' }, children: _jsx(NumberInput, { label: t('rte_width_in_pixels'), value: Math.floor(Math.max(width, 1)).toString(), onClick: onInputClick, onChange: onWidthChange }) }), _jsx(Grid, { item: { area: 'height' }, children: _jsx(NumberInput, { label: t('rte_height_in_pixels'), value: Math.floor(Math.max(height, 1)).toString(), onClick: onInputClick, onChange: onHeightChange }) })] }))] }) }))] }));
|
|
274
290
|
};
|
|
275
291
|
export default ImageEditor;
|
|
276
292
|
//# sourceMappingURL=ImageEditor.js.map
|