@pie-lib/editable-html-tip-tap 2.1.12-next.49 → 2.1.12-next.51
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.
|
@@ -166,6 +166,13 @@ var EditableHtml = exports.EditableHtml = function EditableHtml(props) {
|
|
|
166
166
|
trailingNode: {
|
|
167
167
|
node: 'paragraph',
|
|
168
168
|
notAfter: ['paragraph', 'div']
|
|
169
|
+
},
|
|
170
|
+
// StarterKit bundles the link extension, which turns anything that looks like a URL into
|
|
171
|
+
// a hyperlink as it is typed or pasted. See PIE-980 - we don't want that in any editor.
|
|
172
|
+
// The mark itself stays registered so links already in the markup keep round-tripping.
|
|
173
|
+
link: {
|
|
174
|
+
autolink: false,
|
|
175
|
+
linkOnPaste: false
|
|
169
176
|
}
|
|
170
177
|
}), _extendedListItem.ExtendedListItem, _divNode.DivNode, _headingParagraph.HeadingParagraph, _ensureEmptyRootDiv.EnsureEmptyRootIsDiv, _ensureListItemContentIsDiv.EnsureListItemContentIsDiv, _extensionPlaceholder["default"].configure({
|
|
171
178
|
placeholder: props.placeholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableHtml.js","names":["_react","_interopRequireWildcard","require","_debounce","_interopRequireDefault","_react2","_styles","_starterKit","_extensionTextStyle","_extensionCharacterCount","_extensionSuperscript","_extensionSubscript","_extensionTextAlign","_extensionImage","_extensionPlaceholder","_helper","_extendedTable","_extendedTableCell","_divNode","_ensureEmptyRootDiv","_ensureListItemContentIsDiv","_extensionTableRow","_responseArea","_math","_image","_media","_css","_extendedListItem","_headingParagraph","_TiptapContainer","_size","_extensions","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defaultToolbarOpts","position","alignment","alwaysVisible","showDone","doneOn","defaultResponseAreaProps","options","respAreaToolbar","onHandleAreaChange","DEFAULT_ACTIVE_PLUGINS","cssVariables","spellCheckAttributes","enabled","spellcheck","autocorrect","autocapitalize","EditableHtml","exports","props","_props$pluginProps","_ref","pluginProps","showParagraphs","separateParagraphs","_useState","useState","_useState2","_slicedToArray2","pendingImages","setPendingImages","_useState3","_useState4","scheduled","setScheduled","toolbarOpts","removePendingImage","useCallback","imagePos","prev","next","img","pos","toolbarOptsToUse","commitEditorContent","editor","html","getHTML","markup","_props$onChange","onChange","_props$onDone","onDone","responseAreaPropsToUse","useMemo","responseAreaProps","onInlineDropdownToolbarClose","activePluginsToUse","_ref3","_ref2","customPlugins","otherPluginProps","_objectWithoutProperties2","filteredActivePlugins","activePlugins","pluginName","nameToUse","PLUGINS_MAP","pluginInfo","disabled","buildExtensions","math","textAlign","extraCSSRules","image","imageSupport","toolbar","table","responseArea","type","languageCharacters","languageCharactersProps","keyPadCharacterRef","setKeypadInteraction","media","extensions","TextAlign","configure","types","alignments","TextStyleKit","CharacterCount","limit","charactersLimit","StarterKit","trailingNode","node","notAfter","ExtendedListItem","DivNode","HeadingParagraph","EnsureEmptyRootIsDiv","EnsureListItemContentIsDiv","Placeholder","placeholder","showOnlyWhenEditable","showOnlyCurrent","includeChildren","ExtendedTable","TableRow","ExtendedTableHeader","ExtendedTableCell","ResponseAreaExtension","ExplicitConstructedResponseNode","DragInTheBlankNode","InlineDropdownNode","MathTemplatedNode","MathNode","SubScript","SuperScript","Image","ImageUploadNode","imageHandling","disableImageAlignmentButtons","_props$onDone2","onDelete","src","attrs","insertImageRequested","imageInfo","getHandler","_imageInfo","addedImage","onFinish","result","_cb","cb","callback","handler","focusHandler","debounce","detach","window","removeEventListener","_insertingImage","addEventListener","add","concat","_toConsumableArray2","maxImageWidth","maxImageHeight","Media","uploadSoundSupport","CSSMark","spellCheckEnabled","spellCheck","useEditor","immediatelyRender","editorProps","attributes","handleKeyDown","view","event","onKeyDown","editable","content","normalizeInitialMarkup","onUpdate","_ref4","transaction","isDone","_props$onChange2","onBlur","_ref5","otherToolbarOpened","_toolbarOpened","isActive","schema","useEffect","editorRef","setEditable","_editor$options","_currentEditorProps$a","currentEditorProps","setOptions","nextMarkup","commands","setContent","emitUpdate","entries","_ref6","_ref7","key","value","document","documentElement","style","setProperty","editorState","useEditorState","selector","ctx","_ctx$editor","isFocused","sizeStyle","minWidth","width","maxWidth","minHeight","height","maxHeight","valueToSize","createElement","_extends2","StyledEditorContent","showParagraph","separateParagraph","styled","EditorContent","shouldForwardProp","prop","includes","_ref8","display","outline","flex","padding","margin","left","top","color","pointerEvents","whiteSpace","fontSize","marginBottom","_default"],"sources":["../../src/components/EditableHtml.jsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport debounce from 'lodash-es/debounce';\nimport { EditorContent, useEditor, useEditorState } from '@tiptap/react';\nimport { styled } from '@mui/material/styles';\nimport StarterKit from '@tiptap/starter-kit';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { CharacterCount } from '@tiptap/extension-character-count';\nimport SuperScript from '@tiptap/extension-superscript';\nimport SubScript from '@tiptap/extension-subscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport Image from '@tiptap/extension-image';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { normalizeInitialMarkup } from '../utils/helper';\n\nimport ExtendedTable from '../extensions/extended-table';\nimport { ExtendedTableCell, ExtendedTableHeader } from '../extensions/extended-table-cell';\nimport { DivNode } from '../extensions/div-node';\nimport { EnsureEmptyRootIsDiv } from '../extensions/ensure-empty-root-div';\nimport { EnsureListItemContentIsDiv } from '../extensions/ensure-list-item-content-is-div';\nimport { TableRow } from '@tiptap/extension-table-row';\nimport {\n DragInTheBlankNode,\n ExplicitConstructedResponseNode,\n InlineDropdownNode,\n MathTemplatedNode,\n ResponseAreaExtension,\n} from '../extensions/responseArea';\nimport { MathNode } from '../extensions/math';\nimport { ImageUploadNode } from '../extensions/image';\nimport { Media } from '../extensions/media';\nimport { CSSMark } from '../extensions/css';\nimport { ExtendedListItem } from '../extensions/extended-list-item';\nimport { HeadingParagraph } from '../extensions/heading-paragraph';\n\nimport EditorContainer from './TiptapContainer';\nimport { valueToSize } from '../utils/size';\nimport { buildExtensions, PLUGINS_MAP } from '../extensions';\n\nconst defaultToolbarOpts = {\n position: 'bottom',\n alignment: 'left',\n alwaysVisible: false,\n showDone: true,\n doneOn: 'blur',\n};\n\nconst defaultResponseAreaProps = {\n options: {},\n respAreaToolbar: () => {},\n onHandleAreaChange: () => {},\n};\n\nconst DEFAULT_ACTIVE_PLUGINS = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'code',\n 'bulleted-list',\n 'numbered-list',\n 'image',\n 'math',\n 'languageCharacters',\n 'text-align',\n 'table',\n 'video',\n 'audio',\n 'responseArea',\n 'superscript',\n 'subscript',\n 'css',\n 'h3',\n 'undo',\n 'redo',\n];\n\nconst cssVariables = {\n '--white': '#fff',\n '--black': '#2e2b29',\n '--black-contrast': '#110f0e',\n '--gray-1': 'rgba(61, 37, 20, .05)',\n '--gray-2': 'rgba(61, 37, 20, .08)',\n '--gray-3': 'rgba(61, 37, 20, .12)',\n '--gray-4': 'rgba(53, 38, 28, .3)',\n '--gray-5': 'rgba(28, 25, 23, .6)',\n '--green': '#22c55e',\n '--purple': '#6a00f5',\n '--purple-contrast': '#5800cc',\n '--purple-light': 'rgba(88, 5, 255, .05)',\n '--yellow-contrast': '#facc15',\n '--yellow': 'rgba(250, 204, 21, .4)',\n '--yellow-light': '#fffae5',\n '--red': '#ff5c33',\n '--red-light': '#ffebe5',\n '--shadow': `0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`,\n};\n\n// ProseMirror puts these on the contenteditable element. Without them the browser\n// spellchecks the editor regardless of the spellCheck prop.\nconst spellCheckAttributes = (enabled) => ({\n spellcheck: enabled ? 'true' : 'false',\n autocorrect: enabled ? 'on' : 'off',\n autocapitalize: enabled ? 'on' : 'off',\n});\n\nexport const EditableHtml = (props) => {\n const { showParagraphs, separateParagraphs } = props.pluginProps || {};\n const [pendingImages, setPendingImages] = useState([]);\n const [scheduled, setScheduled] = useState(false);\n const { toolbarOpts } = props;\n\n const removePendingImage = useCallback(\n (imagePos) => {\n setPendingImages((prev) => {\n const next = prev.filter((img) => img.pos !== imagePos);\n if (next.length === 0) {\n setScheduled(false);\n }\n return next;\n });\n },\n [setPendingImages],\n );\n\n const toolbarOptsToUse = {\n ...defaultToolbarOpts,\n ...toolbarOpts,\n };\n\n const commitEditorContent = useCallback(\n (editor) => {\n const html = editor.getHTML();\n\n if (props.markup !== html) {\n props.onChange?.(html);\n }\n\n if (toolbarOptsToUse.doneOn === 'blur') {\n props.onDone?.(html);\n }\n },\n [props.markup, props.onChange, props.onDone, toolbarOptsToUse.doneOn],\n );\n\n const responseAreaPropsToUse = useMemo(\n () => ({\n ...defaultResponseAreaProps,\n ...props.responseAreaProps,\n onInlineDropdownToolbarClose: commitEditorContent,\n }),\n [props.responseAreaProps, commitEditorContent],\n );\n\n const activePluginsToUse = useMemo(() => {\n let { customPlugins, ...otherPluginProps } = props.pluginProps || {};\n\n customPlugins = customPlugins || [];\n\n const filteredActivePlugins = (props.activePlugins || DEFAULT_ACTIVE_PLUGINS)?.filter((pluginName) => {\n const nameToUse = PLUGINS_MAP[pluginName] || pluginName;\n const pluginInfo = otherPluginProps[nameToUse] || {};\n\n return !pluginInfo || !pluginInfo.disabled;\n });\n\n return buildExtensions(filteredActivePlugins, customPlugins, {\n math: {},\n textAlign: props.textAlign,\n html: {},\n extraCSSRules: props.extraCSSRules || {},\n image: {\n ...props.imageSupport,\n },\n toolbar: {},\n table: {},\n responseArea: {\n type: responseAreaPropsToUse.type,\n },\n languageCharacters: props.languageCharactersProps,\n keyPadCharacterRef: {},\n setKeypadInteraction: {},\n media: {},\n });\n }, [props, responseAreaPropsToUse.type]);\n\n const extensions = [\n TextAlign.configure({\n types: ['heading', 'paragraph', 'div', 'headingParagraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'td', 'th'],\n alignments: ['left', 'right', 'center', 'justify'],\n }),\n TextStyleKit,\n CharacterCount.configure({\n limit: props.charactersLimit || 1000000,\n }),\n StarterKit.configure({\n trailingNode: {\n node: 'paragraph',\n notAfter: ['paragraph', 'div'],\n },\n }),\n ExtendedListItem,\n DivNode,\n HeadingParagraph,\n EnsureEmptyRootIsDiv,\n EnsureListItemContentIsDiv,\n Placeholder.configure({\n placeholder: props.placeholder,\n // show placeholder even when editor is focused\n showOnlyWhenEditable: true,\n showOnlyCurrent: false, // show on all empty nodes, not only the current one\n includeChildren: true,\n }),\n ExtendedTable,\n TableRow,\n ExtendedTableHeader,\n ExtendedTableCell,\n ResponseAreaExtension.configure(responseAreaPropsToUse),\n ExplicitConstructedResponseNode.configure(responseAreaPropsToUse),\n DragInTheBlankNode.configure(responseAreaPropsToUse),\n InlineDropdownNode.configure(responseAreaPropsToUse),\n MathTemplatedNode.configure(responseAreaPropsToUse),\n MathNode.configure({\n toolbarOpts: toolbarOptsToUse,\n math: props.pluginProps?.math || {},\n }),\n SubScript,\n SuperScript,\n Image,\n ImageUploadNode.configure({\n toolbarOpts: toolbarOptsToUse,\n imageHandling: {\n disableImageAlignmentButtons: props.disableImageAlignmentButtons,\n onDone: (editor) => props.onDone?.(editor.getHTML()),\n onDelete:\n props.imageSupport &&\n props.imageSupport.delete &&\n ((node) => {\n const { src } = node.attrs;\n\n props.imageSupport.delete(src, (e) => {\n removePendingImage(node.pos);\n });\n }),\n insertImageRequested:\n props.imageSupport &&\n ((editor, imageInfo, getHandler) => {\n const [addedImage, pos] = imageInfo;\n\n const onFinish = (result) => {\n let cb;\n\n if (scheduled && result) {\n // finish editing only on success\n cb = props.onChange;\n }\n\n removePendingImage(pos);\n cb?.(editor.getHTML());\n };\n\n const callback = () => {\n /**\n * The handler is the object through which the outer context\n * communicates file upload events like: fileChosen, cancel, progress\n */\n const handler = getHandler(onFinish);\n\n // If the user closes the file picker without choosing a file, the window regains\n // focus while _insertingImage is still true — drop the stale pending entry.\n const focusHandler = debounce(() => {\n const detach = () => window.removeEventListener('focus', focusHandler);\n\n if (!editor._insertingImage) {\n detach();\n return;\n }\n\n removePendingImage(pos);\n editor._insertingImage = false;\n detach();\n }, 500);\n\n window.addEventListener('focus', focusHandler);\n\n props.imageSupport.add(handler);\n };\n\n editor._insertingImage = true;\n setPendingImages((prev) => [...prev, addedImage]);\n callback();\n }),\n maxImageWidth: props.maxImageWidth,\n maxImageHeight: props.maxImageHeight,\n },\n limit: 3,\n }),\n Media.configure({\n uploadSoundSupport: props.uploadSoundSupport,\n }),\n CSSMark.configure({\n extraCSSRules: props.extraCSSRules,\n }),\n ];\n\n // Callers that don't pass spellCheck keep the browser default (on), as they did with the\n // slate-based editor. Players that have to default to off - extended-text-entry, see\n // PIE-978 - resolve that in their controller and pass an explicit false.\n const spellCheckEnabled = props.spellCheck !== false;\n\n const editor = useEditor(\n {\n extensions,\n immediatelyRender: false,\n editorProps: {\n attributes: spellCheckAttributes(spellCheckEnabled),\n handleKeyDown(view, event) {\n if (props.onKeyDown) {\n return props.onKeyDown(event);\n }\n\n // Return false to let default behavior continue\n return false;\n },\n },\n editable: !props.disabled,\n content: normalizeInitialMarkup(props.markup),\n onUpdate: ({ editor, transaction }) => {\n if (transaction.isDone) {\n props.onChange?.(editor.getHTML());\n }\n },\n onBlur: ({ editor }) => {\n const otherToolbarOpened =\n editor._insertingImage ||\n editor._toolbarOpened ||\n editor.isActive('inline_dropdown') ||\n editor.isActive('explicit_constructed_response');\n\n if (otherToolbarOpened || !editor.schema) {\n return;\n }\n\n commitEditorContent(editor);\n },\n },\n [props.charactersLimit],\n );\n\n useEffect(() => {\n if (props.editorRef) {\n props.editorRef(editor);\n }\n }, [props.editorRef, editor]);\n\n useEffect(() => {\n editor?.setEditable(!props.disabled);\n }, [props.disabled, editor]);\n\n // useEditor only re-applies options on its own when it is called with an empty dependency\n // array, and this call site depends on charactersLimit, so a spellCheck change on a mounted\n // editor has to be pushed in. Only the attributes are replaced - the rest of editorProps\n // stays as the editor already has it.\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const currentEditorProps = editor.options?.editorProps;\n const attributes = spellCheckAttributes(spellCheckEnabled);\n\n if (currentEditorProps?.attributes?.spellcheck === attributes.spellcheck) {\n return;\n }\n\n editor.setOptions({ editorProps: { ...currentEditorProps, attributes } });\n }, [spellCheckEnabled, editor]);\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n const nextMarkup = normalizeInitialMarkup(props.markup);\n\n if (nextMarkup !== editor.getHTML()) {\n editor.commands.setContent(nextMarkup, { emitUpdate: false });\n }\n }, [props.markup, editor]);\n\n useEffect(() => {\n Object.entries(cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n }, []);\n\n const editorState = useEditorState({\n editor,\n selector: (ctx) => ({\n isFocused: ctx.editor?.isFocused,\n }),\n });\n\n const sizeStyle = useMemo(() => {\n const { minWidth, width, maxWidth, minHeight, height, maxHeight } = props;\n\n return {\n width: valueToSize(width),\n minWidth: valueToSize(minWidth),\n maxWidth: valueToSize(maxWidth),\n height: valueToSize(height),\n minHeight: valueToSize(minHeight),\n maxHeight: valueToSize(maxHeight),\n };\n }, [props]);\n\n return (\n <EditorContainer\n {...{\n ...props,\n activePlugins: activePluginsToUse,\n toolbarOpts: toolbarOptsToUse,\n }}\n editorState={editorState}\n editor={editor}\n >\n {editor && (\n <StyledEditorContent\n style={{\n minHeight: sizeStyle.minHeight,\n height: sizeStyle.height,\n maxHeight: sizeStyle.maxHeight,\n }}\n showParagraph={showParagraphs && !showParagraphs.disabled}\n separateParagraph={separateParagraphs && !separateParagraphs.disabled}\n editor={editor}\n />\n )}\n </EditorContainer>\n );\n};\n\nconst StyledEditorContent = styled(EditorContent, {\n shouldForwardProp: (prop) => !['showParagraph', 'separateParagraph'].includes(prop),\n})(({ showParagraph, separateParagraph }) => ({\n display: 'flex',\n outline: 'none !important',\n '& .ProseMirror': {\n flex: 1,\n padding: '5px',\n maxHeight: '500px',\n outline: 'none !important',\n position: 'initial',\n\n // reset default margins for all block paragraphs/divs in the editor\n '& > p, & > div': {\n margin: '0',\n },\n\n // Out of flow so the caret stays at the start of the block; in-flow ::before pushes the caret after the hint text.\n // :only-child ensures the placeholder is hidden whenever the editor has other content (images, upload nodes, etc.)\n // and covers the type+backspace edge case where Tiptap only adds is-empty (not is-editor-empty).\n '& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child': {\n position: 'relative',\n },\n '& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before': {\n content: 'attr(data-placeholder)',\n position: 'absolute',\n left: 0,\n top: 0,\n color: '#9CA3AF',\n pointerEvents: 'none',\n whiteSpace: 'pre-wrap',\n },\n\n ...(showParagraph && {\n '& > p:has(+ p)::after, & > div:has(+ div)::after': {\n display: 'block',\n content: '\"¶\"',\n fontSize: '1em',\n color: '#146EB3',\n },\n }),\n ...(separateParagraph && {\n '& > p:has(+ p)': {\n marginBottom: '1em',\n },\n }),\n },\n}));\n\nexport default EditableHtml;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,mBAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,mBAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,eAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,qBAAA,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AC,eAAe,EAAE,mBAAmB,CAAC,CAACC,QAAQ,CAACD,IAAI,CAAC;EAAA;AACrF,CAAC,CAAC,CAAC,UAAAE,KAAA;EAAA,IAAGP,aAAa,GAAAO,KAAA,CAAbP,aAAa;IAAEC,iBAAiB,GAAAM,KAAA,CAAjBN,iBAAiB;EAAA,OAAQ;IAC5CO,OAAO,EAAE,MAAM;IACfC,OAAO,EAAE,iBAAiB;IAC1B,gBAAgB,EAAAvO,aAAA,CAAAA,aAAA;MACdwO,IAAI,EAAE,CAAC;MACPC,OAAO,EAAE,KAAK;MACdhB,SAAS,EAAE,OAAO;MAClBc,OAAO,EAAE,iBAAiB;MAC1B/N,QAAQ,EAAE,SAAS;MAEnB;MACA,gBAAgB,EAAE;QAChBkO,MAAM,EAAE;MACV,CAAC;MAED;MACA;MACA;MACA,wFAAwF,EAAE;QACxFlO,QAAQ,EAAE;MACZ,CAAC;MACD,wGAAwG,EAAE;QACxGoK,OAAO,EAAE,wBAAwB;QACjCpK,QAAQ,EAAE,UAAU;QACpBmO,IAAI,EAAE,CAAC;QACPC,GAAG,EAAE,CAAC;QACNC,KAAK,EAAE,SAAS;QAChBC,aAAa,EAAE,MAAM;QACrBC,UAAU,EAAE;MACd;IAAC,GAEGjB,aAAa,IAAI;MACnB,kDAAkD,EAAE;QAClDQ,OAAO,EAAE,OAAO;QAChB1D,OAAO,EAAE,KAAK;QACdoE,QAAQ,EAAE,KAAK;QACfH,KAAK,EAAE;MACT;IACF,CAAC,GACGd,iBAAiB,IAAI;MACvB,gBAAgB,EAAE;QAChBkB,YAAY,EAAE;MAChB;IACF,CAAC;EAEL,CAAC;AAAA,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAzN,OAAA,cAEWD,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"EditableHtml.js","names":["_react","_interopRequireWildcard","require","_debounce","_interopRequireDefault","_react2","_styles","_starterKit","_extensionTextStyle","_extensionCharacterCount","_extensionSuperscript","_extensionSubscript","_extensionTextAlign","_extensionImage","_extensionPlaceholder","_helper","_extendedTable","_extendedTableCell","_divNode","_ensureEmptyRootDiv","_ensureListItemContentIsDiv","_extensionTableRow","_responseArea","_math","_image","_media","_css","_extendedListItem","_headingParagraph","_TiptapContainer","_size","_extensions","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defaultToolbarOpts","position","alignment","alwaysVisible","showDone","doneOn","defaultResponseAreaProps","options","respAreaToolbar","onHandleAreaChange","DEFAULT_ACTIVE_PLUGINS","cssVariables","spellCheckAttributes","enabled","spellcheck","autocorrect","autocapitalize","EditableHtml","exports","props","_props$pluginProps","_ref","pluginProps","showParagraphs","separateParagraphs","_useState","useState","_useState2","_slicedToArray2","pendingImages","setPendingImages","_useState3","_useState4","scheduled","setScheduled","toolbarOpts","removePendingImage","useCallback","imagePos","prev","next","img","pos","toolbarOptsToUse","commitEditorContent","editor","html","getHTML","markup","_props$onChange","onChange","_props$onDone","onDone","responseAreaPropsToUse","useMemo","responseAreaProps","onInlineDropdownToolbarClose","activePluginsToUse","_ref3","_ref2","customPlugins","otherPluginProps","_objectWithoutProperties2","filteredActivePlugins","activePlugins","pluginName","nameToUse","PLUGINS_MAP","pluginInfo","disabled","buildExtensions","math","textAlign","extraCSSRules","image","imageSupport","toolbar","table","responseArea","type","languageCharacters","languageCharactersProps","keyPadCharacterRef","setKeypadInteraction","media","extensions","TextAlign","configure","types","alignments","TextStyleKit","CharacterCount","limit","charactersLimit","StarterKit","trailingNode","node","notAfter","link","autolink","linkOnPaste","ExtendedListItem","DivNode","HeadingParagraph","EnsureEmptyRootIsDiv","EnsureListItemContentIsDiv","Placeholder","placeholder","showOnlyWhenEditable","showOnlyCurrent","includeChildren","ExtendedTable","TableRow","ExtendedTableHeader","ExtendedTableCell","ResponseAreaExtension","ExplicitConstructedResponseNode","DragInTheBlankNode","InlineDropdownNode","MathTemplatedNode","MathNode","SubScript","SuperScript","Image","ImageUploadNode","imageHandling","disableImageAlignmentButtons","_props$onDone2","onDelete","src","attrs","insertImageRequested","imageInfo","getHandler","_imageInfo","addedImage","onFinish","result","_cb","cb","callback","handler","focusHandler","debounce","detach","window","removeEventListener","_insertingImage","addEventListener","add","concat","_toConsumableArray2","maxImageWidth","maxImageHeight","Media","uploadSoundSupport","CSSMark","spellCheckEnabled","spellCheck","useEditor","immediatelyRender","editorProps","attributes","handleKeyDown","view","event","onKeyDown","editable","content","normalizeInitialMarkup","onUpdate","_ref4","transaction","isDone","_props$onChange2","onBlur","_ref5","otherToolbarOpened","_toolbarOpened","isActive","schema","useEffect","editorRef","setEditable","_editor$options","_currentEditorProps$a","currentEditorProps","setOptions","nextMarkup","commands","setContent","emitUpdate","entries","_ref6","_ref7","key","value","document","documentElement","style","setProperty","editorState","useEditorState","selector","ctx","_ctx$editor","isFocused","sizeStyle","minWidth","width","maxWidth","minHeight","height","maxHeight","valueToSize","createElement","_extends2","StyledEditorContent","showParagraph","separateParagraph","styled","EditorContent","shouldForwardProp","prop","includes","_ref8","display","outline","flex","padding","margin","left","top","color","pointerEvents","whiteSpace","fontSize","marginBottom","_default"],"sources":["../../src/components/EditableHtml.jsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport debounce from 'lodash-es/debounce';\nimport { EditorContent, useEditor, useEditorState } from '@tiptap/react';\nimport { styled } from '@mui/material/styles';\nimport StarterKit from '@tiptap/starter-kit';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { CharacterCount } from '@tiptap/extension-character-count';\nimport SuperScript from '@tiptap/extension-superscript';\nimport SubScript from '@tiptap/extension-subscript';\nimport TextAlign from '@tiptap/extension-text-align';\nimport Image from '@tiptap/extension-image';\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { normalizeInitialMarkup } from '../utils/helper';\n\nimport ExtendedTable from '../extensions/extended-table';\nimport { ExtendedTableCell, ExtendedTableHeader } from '../extensions/extended-table-cell';\nimport { DivNode } from '../extensions/div-node';\nimport { EnsureEmptyRootIsDiv } from '../extensions/ensure-empty-root-div';\nimport { EnsureListItemContentIsDiv } from '../extensions/ensure-list-item-content-is-div';\nimport { TableRow } from '@tiptap/extension-table-row';\nimport {\n DragInTheBlankNode,\n ExplicitConstructedResponseNode,\n InlineDropdownNode,\n MathTemplatedNode,\n ResponseAreaExtension,\n} from '../extensions/responseArea';\nimport { MathNode } from '../extensions/math';\nimport { ImageUploadNode } from '../extensions/image';\nimport { Media } from '../extensions/media';\nimport { CSSMark } from '../extensions/css';\nimport { ExtendedListItem } from '../extensions/extended-list-item';\nimport { HeadingParagraph } from '../extensions/heading-paragraph';\n\nimport EditorContainer from './TiptapContainer';\nimport { valueToSize } from '../utils/size';\nimport { buildExtensions, PLUGINS_MAP } from '../extensions';\n\nconst defaultToolbarOpts = {\n position: 'bottom',\n alignment: 'left',\n alwaysVisible: false,\n showDone: true,\n doneOn: 'blur',\n};\n\nconst defaultResponseAreaProps = {\n options: {},\n respAreaToolbar: () => {},\n onHandleAreaChange: () => {},\n};\n\nconst DEFAULT_ACTIVE_PLUGINS = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'code',\n 'bulleted-list',\n 'numbered-list',\n 'image',\n 'math',\n 'languageCharacters',\n 'text-align',\n 'table',\n 'video',\n 'audio',\n 'responseArea',\n 'superscript',\n 'subscript',\n 'css',\n 'h3',\n 'undo',\n 'redo',\n];\n\nconst cssVariables = {\n '--white': '#fff',\n '--black': '#2e2b29',\n '--black-contrast': '#110f0e',\n '--gray-1': 'rgba(61, 37, 20, .05)',\n '--gray-2': 'rgba(61, 37, 20, .08)',\n '--gray-3': 'rgba(61, 37, 20, .12)',\n '--gray-4': 'rgba(53, 38, 28, .3)',\n '--gray-5': 'rgba(28, 25, 23, .6)',\n '--green': '#22c55e',\n '--purple': '#6a00f5',\n '--purple-contrast': '#5800cc',\n '--purple-light': 'rgba(88, 5, 255, .05)',\n '--yellow-contrast': '#facc15',\n '--yellow': 'rgba(250, 204, 21, .4)',\n '--yellow-light': '#fffae5',\n '--red': '#ff5c33',\n '--red-light': '#ffebe5',\n '--shadow': `0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`,\n};\n\n// ProseMirror puts these on the contenteditable element. Without them the browser\n// spellchecks the editor regardless of the spellCheck prop.\nconst spellCheckAttributes = (enabled) => ({\n spellcheck: enabled ? 'true' : 'false',\n autocorrect: enabled ? 'on' : 'off',\n autocapitalize: enabled ? 'on' : 'off',\n});\n\nexport const EditableHtml = (props) => {\n const { showParagraphs, separateParagraphs } = props.pluginProps || {};\n const [pendingImages, setPendingImages] = useState([]);\n const [scheduled, setScheduled] = useState(false);\n const { toolbarOpts } = props;\n\n const removePendingImage = useCallback(\n (imagePos) => {\n setPendingImages((prev) => {\n const next = prev.filter((img) => img.pos !== imagePos);\n if (next.length === 0) {\n setScheduled(false);\n }\n return next;\n });\n },\n [setPendingImages],\n );\n\n const toolbarOptsToUse = {\n ...defaultToolbarOpts,\n ...toolbarOpts,\n };\n\n const commitEditorContent = useCallback(\n (editor) => {\n const html = editor.getHTML();\n\n if (props.markup !== html) {\n props.onChange?.(html);\n }\n\n if (toolbarOptsToUse.doneOn === 'blur') {\n props.onDone?.(html);\n }\n },\n [props.markup, props.onChange, props.onDone, toolbarOptsToUse.doneOn],\n );\n\n const responseAreaPropsToUse = useMemo(\n () => ({\n ...defaultResponseAreaProps,\n ...props.responseAreaProps,\n onInlineDropdownToolbarClose: commitEditorContent,\n }),\n [props.responseAreaProps, commitEditorContent],\n );\n\n const activePluginsToUse = useMemo(() => {\n let { customPlugins, ...otherPluginProps } = props.pluginProps || {};\n\n customPlugins = customPlugins || [];\n\n const filteredActivePlugins = (props.activePlugins || DEFAULT_ACTIVE_PLUGINS)?.filter((pluginName) => {\n const nameToUse = PLUGINS_MAP[pluginName] || pluginName;\n const pluginInfo = otherPluginProps[nameToUse] || {};\n\n return !pluginInfo || !pluginInfo.disabled;\n });\n\n return buildExtensions(filteredActivePlugins, customPlugins, {\n math: {},\n textAlign: props.textAlign,\n html: {},\n extraCSSRules: props.extraCSSRules || {},\n image: {\n ...props.imageSupport,\n },\n toolbar: {},\n table: {},\n responseArea: {\n type: responseAreaPropsToUse.type,\n },\n languageCharacters: props.languageCharactersProps,\n keyPadCharacterRef: {},\n setKeypadInteraction: {},\n media: {},\n });\n }, [props, responseAreaPropsToUse.type]);\n\n const extensions = [\n TextAlign.configure({\n types: ['heading', 'paragraph', 'div', 'headingParagraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'td', 'th'],\n alignments: ['left', 'right', 'center', 'justify'],\n }),\n TextStyleKit,\n CharacterCount.configure({\n limit: props.charactersLimit || 1000000,\n }),\n StarterKit.configure({\n trailingNode: {\n node: 'paragraph',\n notAfter: ['paragraph', 'div'],\n },\n // StarterKit bundles the link extension, which turns anything that looks like a URL into\n // a hyperlink as it is typed or pasted. See PIE-980 - we don't want that in any editor.\n // The mark itself stays registered so links already in the markup keep round-tripping.\n link: {\n autolink: false,\n linkOnPaste: false,\n },\n }),\n ExtendedListItem,\n DivNode,\n HeadingParagraph,\n EnsureEmptyRootIsDiv,\n EnsureListItemContentIsDiv,\n Placeholder.configure({\n placeholder: props.placeholder,\n // show placeholder even when editor is focused\n showOnlyWhenEditable: true,\n showOnlyCurrent: false, // show on all empty nodes, not only the current one\n includeChildren: true,\n }),\n ExtendedTable,\n TableRow,\n ExtendedTableHeader,\n ExtendedTableCell,\n ResponseAreaExtension.configure(responseAreaPropsToUse),\n ExplicitConstructedResponseNode.configure(responseAreaPropsToUse),\n DragInTheBlankNode.configure(responseAreaPropsToUse),\n InlineDropdownNode.configure(responseAreaPropsToUse),\n MathTemplatedNode.configure(responseAreaPropsToUse),\n MathNode.configure({\n toolbarOpts: toolbarOptsToUse,\n math: props.pluginProps?.math || {},\n }),\n SubScript,\n SuperScript,\n Image,\n ImageUploadNode.configure({\n toolbarOpts: toolbarOptsToUse,\n imageHandling: {\n disableImageAlignmentButtons: props.disableImageAlignmentButtons,\n onDone: (editor) => props.onDone?.(editor.getHTML()),\n onDelete:\n props.imageSupport &&\n props.imageSupport.delete &&\n ((node) => {\n const { src } = node.attrs;\n\n props.imageSupport.delete(src, (e) => {\n removePendingImage(node.pos);\n });\n }),\n insertImageRequested:\n props.imageSupport &&\n ((editor, imageInfo, getHandler) => {\n const [addedImage, pos] = imageInfo;\n\n const onFinish = (result) => {\n let cb;\n\n if (scheduled && result) {\n // finish editing only on success\n cb = props.onChange;\n }\n\n removePendingImage(pos);\n cb?.(editor.getHTML());\n };\n\n const callback = () => {\n /**\n * The handler is the object through which the outer context\n * communicates file upload events like: fileChosen, cancel, progress\n */\n const handler = getHandler(onFinish);\n\n // If the user closes the file picker without choosing a file, the window regains\n // focus while _insertingImage is still true — drop the stale pending entry.\n const focusHandler = debounce(() => {\n const detach = () => window.removeEventListener('focus', focusHandler);\n\n if (!editor._insertingImage) {\n detach();\n return;\n }\n\n removePendingImage(pos);\n editor._insertingImage = false;\n detach();\n }, 500);\n\n window.addEventListener('focus', focusHandler);\n\n props.imageSupport.add(handler);\n };\n\n editor._insertingImage = true;\n setPendingImages((prev) => [...prev, addedImage]);\n callback();\n }),\n maxImageWidth: props.maxImageWidth,\n maxImageHeight: props.maxImageHeight,\n },\n limit: 3,\n }),\n Media.configure({\n uploadSoundSupport: props.uploadSoundSupport,\n }),\n CSSMark.configure({\n extraCSSRules: props.extraCSSRules,\n }),\n ];\n\n // Callers that don't pass spellCheck keep the browser default (on), as they did with the\n // slate-based editor. Players that have to default to off - extended-text-entry, see\n // PIE-978 - resolve that in their controller and pass an explicit false.\n const spellCheckEnabled = props.spellCheck !== false;\n\n const editor = useEditor(\n {\n extensions,\n immediatelyRender: false,\n editorProps: {\n attributes: spellCheckAttributes(spellCheckEnabled),\n handleKeyDown(view, event) {\n if (props.onKeyDown) {\n return props.onKeyDown(event);\n }\n\n // Return false to let default behavior continue\n return false;\n },\n },\n editable: !props.disabled,\n content: normalizeInitialMarkup(props.markup),\n onUpdate: ({ editor, transaction }) => {\n if (transaction.isDone) {\n props.onChange?.(editor.getHTML());\n }\n },\n onBlur: ({ editor }) => {\n const otherToolbarOpened =\n editor._insertingImage ||\n editor._toolbarOpened ||\n editor.isActive('inline_dropdown') ||\n editor.isActive('explicit_constructed_response');\n\n if (otherToolbarOpened || !editor.schema) {\n return;\n }\n\n commitEditorContent(editor);\n },\n },\n [props.charactersLimit],\n );\n\n useEffect(() => {\n if (props.editorRef) {\n props.editorRef(editor);\n }\n }, [props.editorRef, editor]);\n\n useEffect(() => {\n editor?.setEditable(!props.disabled);\n }, [props.disabled, editor]);\n\n // useEditor only re-applies options on its own when it is called with an empty dependency\n // array, and this call site depends on charactersLimit, so a spellCheck change on a mounted\n // editor has to be pushed in. Only the attributes are replaced - the rest of editorProps\n // stays as the editor already has it.\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const currentEditorProps = editor.options?.editorProps;\n const attributes = spellCheckAttributes(spellCheckEnabled);\n\n if (currentEditorProps?.attributes?.spellcheck === attributes.spellcheck) {\n return;\n }\n\n editor.setOptions({ editorProps: { ...currentEditorProps, attributes } });\n }, [spellCheckEnabled, editor]);\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n const nextMarkup = normalizeInitialMarkup(props.markup);\n\n if (nextMarkup !== editor.getHTML()) {\n editor.commands.setContent(nextMarkup, { emitUpdate: false });\n }\n }, [props.markup, editor]);\n\n useEffect(() => {\n Object.entries(cssVariables).forEach(([key, value]) => {\n document.documentElement.style.setProperty(key, value);\n });\n }, []);\n\n const editorState = useEditorState({\n editor,\n selector: (ctx) => ({\n isFocused: ctx.editor?.isFocused,\n }),\n });\n\n const sizeStyle = useMemo(() => {\n const { minWidth, width, maxWidth, minHeight, height, maxHeight } = props;\n\n return {\n width: valueToSize(width),\n minWidth: valueToSize(minWidth),\n maxWidth: valueToSize(maxWidth),\n height: valueToSize(height),\n minHeight: valueToSize(minHeight),\n maxHeight: valueToSize(maxHeight),\n };\n }, [props]);\n\n return (\n <EditorContainer\n {...{\n ...props,\n activePlugins: activePluginsToUse,\n toolbarOpts: toolbarOptsToUse,\n }}\n editorState={editorState}\n editor={editor}\n >\n {editor && (\n <StyledEditorContent\n style={{\n minHeight: sizeStyle.minHeight,\n height: sizeStyle.height,\n maxHeight: sizeStyle.maxHeight,\n }}\n showParagraph={showParagraphs && !showParagraphs.disabled}\n separateParagraph={separateParagraphs && !separateParagraphs.disabled}\n editor={editor}\n />\n )}\n </EditorContainer>\n );\n};\n\nconst StyledEditorContent = styled(EditorContent, {\n shouldForwardProp: (prop) => !['showParagraph', 'separateParagraph'].includes(prop),\n})(({ showParagraph, separateParagraph }) => ({\n display: 'flex',\n outline: 'none !important',\n '& .ProseMirror': {\n flex: 1,\n padding: '5px',\n maxHeight: '500px',\n outline: 'none !important',\n position: 'initial',\n\n // reset default margins for all block paragraphs/divs in the editor\n '& > p, & > div': {\n margin: '0',\n },\n\n // Out of flow so the caret stays at the start of the block; in-flow ::before pushes the caret after the hint text.\n // :only-child ensures the placeholder is hidden whenever the editor has other content (images, upload nodes, etc.)\n // and covers the type+backspace edge case where Tiptap only adds is-empty (not is-editor-empty).\n '& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child': {\n position: 'relative',\n },\n '& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before': {\n content: 'attr(data-placeholder)',\n position: 'absolute',\n left: 0,\n top: 0,\n color: '#9CA3AF',\n pointerEvents: 'none',\n whiteSpace: 'pre-wrap',\n },\n\n ...(showParagraph && {\n '& > p:has(+ p)::after, & > div:has(+ div)::after': {\n display: 'block',\n content: '\"¶\"',\n fontSize: '1em',\n color: '#146EB3',\n },\n }),\n ...(separateParagraph && {\n '& > p:has(+ p)': {\n marginBottom: '1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wB;QACjCvK,QAAQ,EAAE,UAAU;QACpBsO,IAAI,EAAE,CAAC;QACPC,GAAG,EAAE,CAAC;QACNC,KAAK,EAAE,SAAS;QAChBC,aAAa,EAAE,MAAM;QACrBC,UAAU,EAAE;MACd;IAAC,GAEGjB,aAAa,IAAI;MACnB,kDAAkD,EAAE;QAClDQ,OAAO,EAAE,OAAO;QAChB1D,OAAO,EAAE,KAAK;QACdoE,QAAQ,EAAE,KAAK;QACfH,KAAK,EAAE;MACT;IACF,CAAC,GACGd,iBAAiB,IAAI;MACvB,gBAAgB,EAAE;QAChBkB,YAAY,EAAE;MAChB;IACF,CAAC;EAEL,CAAC;AAAA,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAA5N,OAAA,cAEWD,YAAY","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.12-next.
|
|
6
|
+
"version": "2.1.12-next.51+b4ed5cf6a",
|
|
7
7
|
"description": "",
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"main": "lib/index.js",
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.2.0"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "b4ed5cf6ab4dc6d9ff3005f7d501135a3261dac9",
|
|
63
63
|
"scripts": {}
|
|
64
64
|
}
|
|
@@ -198,6 +198,13 @@ export const EditableHtml = (props) => {
|
|
|
198
198
|
node: 'paragraph',
|
|
199
199
|
notAfter: ['paragraph', 'div'],
|
|
200
200
|
},
|
|
201
|
+
// StarterKit bundles the link extension, which turns anything that looks like a URL into
|
|
202
|
+
// a hyperlink as it is typed or pasted. See PIE-980 - we don't want that in any editor.
|
|
203
|
+
// The mark itself stays registered so links already in the markup keep round-tripping.
|
|
204
|
+
link: {
|
|
205
|
+
autolink: false,
|
|
206
|
+
linkOnPaste: false,
|
|
207
|
+
},
|
|
201
208
|
}),
|
|
202
209
|
ExtendedListItem,
|
|
203
210
|
DivNode,
|