{"version":3,"file":"serializers-DUHL1s1g.js","sources":["../../../app/javascript/components/editor/Spoiler.tsx","../../../app/javascript/components/editor/Element.tsx","../../../app/javascript/components/editor/Leaf.tsx","../../../app/javascript/components/editor/serializers.tsx"],"sourcesContent":["import { useRef, useState } from \"react\";\nimport classNames from \"lib/classNames\";\n\nexport default function Spoiler({ children }) {\n const [visible, setVisible] = useState(false);\n const spoiler = useRef();\n const clicked = (e) => {\n e.preventDefault();\n e.stopPropagation();\n setVisible(!visible);\n };\n const toggleClicked = (e) => {\n if (e.currentTarget === spoiler.current) {\n if (e.key === \" \" || e.key === \"Enter\") {\n e.preventDefault();\n e.stopPropagation();\n setVisible(!visible);\n }\n }\n };\n return (\n \n {children}\n \n );\n}\n","/* eslint-disable react/jsx-props-no-spreading */\nimport Spoiler from \"./Spoiler\";\n\nconst Element = ({ attributes, children, element, key }) => {\n if (element.spoiler) {\n return (\n
\n {children}\n\n );\n case \"bulleted-list\":\n return (\n
\n {children}\n
\n );\n }\n};\n\nexport default Element;\n","/* eslint-disable react/jsx-props-no-spreading */\nimport Spoiler from \"./Spoiler\";\n\nexport function isLeaf(value): boolean {\n return typeof value === \"object\" && typeof value.text === \"string\";\n}\n\nconst Leaf = ({ attributes, children, leaf, key }) => {\n let inner = children;\n if (leaf.spoiler) {\n inner ={inner}
;\n }\n\n if (leaf.italic) {\n inner = {inner};\n }\n\n if (leaf.type === \"br\") {\n return