{"version":3,"file":"TagInputField-tJiWxfPz.js","sources":["../../../app/javascript/components/common/Outputs/TagInputField.tsx"],"sourcesContent":["import React, { useImperativeHandle, forwardRef, useRef, useEffect, useState } from \"react\";\nimport { getImageUrl } from \"../../../commons/assets_path\";\nimport { OutputDataArray } from \"../../../types/types\";\n\ntype Props = {\n initialContent: string;\n onContentChange?: (content: string) => void;\n outputs: OutputDataArray;\n handleFocus?: () => void;\n handleInput?: (value: string) => void;\n handleBlur?: (value: string) => void;\n handleClick?: () => void;\n name?: string;\n id?: string;\n errorClass?: string;\n type?: \"text\";\n style?: object;\n testId?: string;\n};\n\nexport type TagValue = {\n icon_path: string;\n display_name: string;\n test_value: string;\n};\n\nexport type HandlerType = {\n target: React.RefObject;\n value: string;\n formatForBackend: string;\n handleInsertTag: (value: TagValue) => void;\n overrideContent: (value: string) => void;\n handleChangeInputWithSeparator: (value: string) => void;\n setValue: React.Dispatch>;\n};\n\nconst TagInputField = forwardRef(\n (\n {\n initialContent,\n outputs,\n handleFocus = null,\n handleInput = null,\n handleClick = null,\n onContentChange = null, // NOTE:不要な可能性があるので後に削除するかも\n handleBlur = null,\n name = \"\",\n id = \"\",\n errorClass = \"\",\n type = \"text\",\n style = {},\n testId = \"\",\n },\n ref,\n ) => {\n const [value, setValue] = useState(\"\");\n const [isRefReady, setIsRefReady] = useState(false);\n const localRef = useRef(null);\n // const contentRef = useRef(initialContent);\n const savedRangeRef = useRef(null);\n\n useImperativeHandle(ref, () => ({\n target: localRef,\n formatForBackend: value,\n handleInsertTag,\n overrideContent,\n value,\n setValue,\n handleChangeInputWithSeparator,\n }));\n\n // キャレット位置を保存\n const saveCaretPosition = () => {\n const selection = window.getSelection();\n if (selection && selection.rangeCount > 0) {\n savedRangeRef.current = selection.getRangeAt(0);\n }\n };\n\n // キャレット位置を復元\n const restoreCaretPosition = () => {\n const selection = window.getSelection();\n if (selection && savedRangeRef.current) {\n selection.removeAllRanges();\n selection.addRange(savedRangeRef.current);\n }\n };\n\n // キャレットを末尾に設定\n const setCaretToEnd = () => {\n if (!localRef.current) return;\n localRef.current.focus(); // 要素にフォーカスを設定\n\n const selection = window.getSelection();\n const range = document.createRange();\n\n // 要素の内容全体を選択し、末尾にキャレットを移動\n range.selectNodeContents(localRef.current);\n range.collapse(false); // falseで末尾にキャレットを設定\n\n // 選択範囲をクリアし、新しいキャレット位置を適用\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n };\n\n const handleInputChange = () => {\n if (localRef.current) {\n const content = localRef.current.innerHTML;\n if (onContentChange) {\n onContentChange(content);\n }\n saveCaretPosition();\n setValue(formatForBackend());\n if (handleInput) {\n handleInput(formatForBackend());\n }\n }\n };\n\n const handleTagClick = (e: React.MouseEvent) => {\n const target = e.target as HTMLElement;\n if (target.className === \"removeTag\") {\n target.closest(\".react-tag-input__tag__outer\")?.remove();\n handleInputChange(); // 削除後の内容を更新\n } else {\n // タグがクリックされた場合、キャレットをタグの後ろに移動\n const selection = window.getSelection();\n if (selection && selection.rangeCount > 0) {\n const range = selection.getRangeAt(0);\n const clickedTag = target.closest(\".react-tag-input__tag__outer\");\n if (clickedTag) {\n range.setStartAfter(clickedTag);\n range.collapse(true);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n }\n };\n\n // NOTE: BEに送る値に、HTMLエンティティが含まれないようにデコード\n const decodeHTMLEntities = (text: string) => {\n const textarea = document.createElement(\"textarea\");\n textarea.innerHTML = text;\n\n return textarea.value\n .replace(//gi, \"\")\n .replace(/<\\/div>/gi, \"\")\n .replace(/
/gi, \"\");\n };\n\n // NOTE: BEに送るために{{output}}に変換する\n const formatForBackend = () => {\n if (localRef?.current) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = localRef.current.innerHTML;\n // HTMLの無駄な空白を削除する\n tempDiv.innerHTML = tempDiv.innerHTML.replace(/\\s*(<[^>]+>)\\s*/g, \"$1\").trim();\n\n // タグを探して{{}}形式に変換\n const tags = tempDiv.querySelectorAll(\".react-tag-input__tag__outer\");\n tags.forEach((tag) => {\n const tagContent = tag.querySelector(\".react-tag-input__tag__content\");\n\n if (tagContent instanceof HTMLElement) {\n // タグを{{タグ名}}形式に置換\n const displayName = tagContent.innerText;\n tag.replaceWith(`{{${displayName}}}`);\n }\n });\n // {{}}内の空白や改行を削除\n tempDiv.innerHTML = tempDiv.innerHTML.replace(/{{\\s*(.*?)\\s*}}/g, (match, p1) => {\n return `{{${p1.trim()}}}`;\n });\n\n return decodeHTMLEntities(tempDiv.innerHTML);\n } else {\n return \"\";\n }\n };\n\n // NOTE: タグHTMLを生成\n const tagFormat = (value: TagValue) => {\n const iconPath = value?.icon_path ? getImageUrl(value.icon_path) : \"\";\n const iconNode = iconPath ? `\"\"` : \"\";\n const removeIconPath = getImageUrl(\"images/icons/grayCancel.svg\");\n const displayName = value.display_name.replace(/{{(.*?)}}/, \"$1\");\n const testValue = value?.test_value ? `

${value.test_value}

` : \"\";\n const htmlString = `\n \n
\n ${iconNode}\n
\n ${displayName}\n
\n ${testValue}\n \n
\n
\n `;\n\n return htmlString.trim();\n };\n\n // アウトプットからタグを入力\n const handleInsertTag = (value: TagValue) => {\n restoreCaretPosition();\n const htmlString = tagFormat(value);\n const selection = window.getSelection();\n if (!selection || selection.rangeCount === 0) return;\n\n const range = selection.getRangeAt(0);\n\n // contentEditableなdiv要素内にいるか確認\n if (!localRef.current || !range.commonAncestorContainer) return;\n\n // キャレット位置がcontentEditable内にあるかチェック\n const isInsideContentEditable = localRef.current.contains(range.commonAncestorContainer);\n if (!isInsideContentEditable) return;\n\n const template = document.createElement(\"template\");\n template.innerHTML = htmlString.replace(/\\s*(<[^>]+>)\\s*/g, \"$1\").trim();\n\n // template.contentEditable = \"false\";\n const insertNode = template.content.childNodes[0];\n range.insertNode(insertNode);\n\n range.setStartAfter(insertNode);\n range.collapse(true);\n\n selection.removeAllRanges();\n selection.addRange(range);\n\n saveCaretPosition();\n handleInputChange();\n };\n\n // NOTE: 入力値のreffererがapi-pulldownタイプだった場合用\n const overrideContent = (value: string) => {\n if (localRef.current) {\n setValue(value);\n localRef.current.innerHTML = value;\n }\n };\n\n const handleChangeInputWithSeparator = (targetValue: string) => {\n if (localRef.current) {\n const result = value ? `${value},${targetValue}` : targetValue;\n\n setValue(result);\n localRef.current.innerHTML = /{{(.*?)}}/.test(value) ? `${localRef.current.innerHTML},${targetValue}` : result;\n\n handleInputChange();\n setCaretToEnd();\n }\n };\n\n // NOTE: propsで受け取った値からアウトプットの箇所をタグにリプレイスする\n const replaceTemplateTags = () => {\n if (!initialContent) return \"\";\n\n // {{}}を探して置換\n const replacedText = initialContent.replace(/{{(.*?)}}/g, (match, p1) => {\n const output = findOutputByDisplayName(p1);\n return output ? tagFormat(output as TagValue) : match; // 対象外は元のテキストをそのまま保持\n });\n\n return replacedText;\n };\n // NOTE: タグへのリプレイスに必要な値をoutputsから取得\n const findOutputByDisplayName = (targetDisplayName: string) => {\n for (const item of outputs) {\n const match = item.outputs.find((output) => output.display_name === targetDisplayName);\n\n if (match) {\n return {\n display_name: match.display_name,\n test_value: match.test_value,\n icon_path: item.icon_path,\n };\n }\n }\n return {\n display_name: targetDisplayName,\n };\n };\n\n // NOTE: コピー元のフォントをリセットする\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault(); // デフォルトのペースト動作を無効化\n\n // クリップボードからプレーンテキストを取得\n const text = e.clipboardData.getData(\"text/plain\");\n\n // キャレット位置を取得してテキストを挿入\n const selection = window.getSelection();\n if (selection && selection.rangeCount > 0) {\n const range = selection.getRangeAt(0);\n range.deleteContents(); // 現在の選択範囲を削除\n const textNode = document.createTextNode(text);\n range.insertNode(textNode);\n\n // キャレットを挿入したテキストの後ろに移動\n range.setStartAfter(textNode);\n range.setEndAfter(textNode);\n selection.removeAllRanges();\n selection.addRange(range);\n\n if (handleInput) {\n handleInput(formatForBackend());\n }\n }\n };\n\n const handleTextFormattingShortcuts = (event: React.KeyboardEvent) => {\n const isBoldShortcut = (event.metaKey && event.key === \"b\") || (event.ctrlKey && event.key === \"b\");\n const isItalicShortcut = (event.metaKey && event.key === \"i\") || (event.ctrlKey && event.key === \"i\");\n const isUnderlineShortcut = (event.metaKey && event.key === \"u\") || (event.ctrlKey && event.key === \"u\");\n\n if (isBoldShortcut || isItalicShortcut || isUnderlineShortcut) {\n event.preventDefault(); // デフォルトのショートカット処理を無効化\n }\n };\n\n useEffect(() => {\n if (localRef.current) {\n setIsRefReady(true); // 初回レンダリング後にrefの設定を確定\n localRef.current.innerHTML = replaceTemplateTags();\n setValue(initialContent);\n }\n }, [initialContent]);\n\n return (\n <>\n \n {\n if (handleFocus) {\n handleFocus();\n }\n const element = localRef.current;\n if (element && element.scrollWidth > element.clientWidth) {\n element.scrollLeft = element.scrollWidth;\n }\n restoreCaretPosition();\n setIsRefReady(true);\n }}\n onBlur={(e) => {\n saveCaretPosition();\n setValue(formatForBackend());\n if (handleBlur) {\n handleBlur(formatForBackend());\n }\n\n if (localRef.current) {\n localRef.current.scrollLeft = -localRef.current.scrollWidth;\n }\n }}\n onKeyDown={(e) => {\n if (!localRef.current) return;\n if (e.key === \"Enter\" || (e.key === \"Enter\" && e.shiftKey)) {\n e.preventDefault();\n }\n handleTextFormattingShortcuts(e);\n if (e.key === \"Backspace\" || e.key === \"Delete\") {\n // textNode削除&carret位置の右側にタグがある時、最後の一文字の削除だけ無効化して、手動で消す\n // contentEditableのデフォルト機能で無駄なbrが入るため。\n const selection = window.getSelection();\n\n if (selection && selection.rangeCount > 0) {\n const range = selection.getRangeAt(0);\n const startContainer = range.startContainer; // キャレットがあるノード\n const startOffset = range.startOffset; // キャレットのオフセット\n\n if (startContainer.nodeType === Node.TEXT_NODE) {\n const textNode = startContainer;\n\n // キャレットがテキストノードの末尾にある場合\n if (startOffset === textNode.textContent?.length && textNode.textContent.length === 1) {\n // テキストノードの次の兄弟ノードを取得\n const parentElement = textNode.parentElement; // テキストノードの親要素\n const childNodes = parentElement?.childNodes;\n\n if (childNodes) {\n const textNodeIndex = Array.from(childNodes).indexOf(textNode as ChildNode);\n\n // テキストノードの次のノードを確認\n const nextNode = childNodes[textNodeIndex + 1];\n if (\n nextNode &&\n nextNode.nodeType === Node.ELEMENT_NODE &&\n (nextNode as HTMLElement).classList.contains(\"react-tag-input__tag__outer\")\n ) {\n e.preventDefault();\n textNode.textContent = \"\";\n }\n }\n }\n }\n }\n }\n }}\n onPaste={handlePaste}\n style={{\n outline: \"none\",\n boxShadow: \"none\",\n overflowX: \"auto\",\n whiteSpace: \"nowrap\",\n maxHeight: \"44px\",\n height: \"44px\",\n lineHeight: \"2.2\",\n ...style,\n }}\n />\n \n );\n },\n);\n\nexport default TagInputField;\n"],"names":["TagInputField","forwardRef","initialContent","outputs","handleFocus","handleInput","handleClick","onContentChange","handleBlur","name","id","errorClass","type","style","testId","ref","value","setValue","useState","isRefReady","setIsRefReady","localRef","useRef","savedRangeRef","useImperativeHandle","handleInsertTag","overrideContent","handleChangeInputWithSeparator","saveCaretPosition","selection","restoreCaretPosition","setCaretToEnd","range","handleInputChange","content","formatForBackend","handleTagClick","e","target","_a","clickedTag","decodeHTMLEntities","text","textarea","tempDiv","tag","tagContent","displayName","match","p1","tagFormat","iconPath","getImageUrl","iconNode","removeIconPath","testValue","htmlString","template","insertNode","targetValue","result","replaceTemplateTags","output","findOutputByDisplayName","targetDisplayName","item","handlePaste","textNode","handleTextFormattingShortcuts","event","isBoldShortcut","isItalicShortcut","isUnderlineShortcut","useEffect","jsxs","Fragment","jsx","element","startContainer","startOffset","parentElement","childNodes","textNodeIndex","nextNode"],"mappings":"mGAoCA,MAAMA,EAAgBC,EAAA,WACpB,CACE,CACE,eAAAC,EACA,QAAAC,EACA,YAAAC,EAAc,KACd,YAAAC,EAAc,KACd,YAAAC,EAAc,KACd,gBAAAC,EAAkB,KAClB,WAAAC,EAAa,KACb,KAAAC,EAAO,GACP,GAAAC,EAAK,GACL,WAAAC,EAAa,GACb,KAAAC,EAAO,OACP,MAAAC,EAAQ,CAAC,EACT,OAAAC,EAAS,IA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