@pie-element/extended-text-entry 16.0.2-next.20261007003844 → 16.0.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-BRPP6Mvf.js","names":[],"sources":["../../src/delivery/annotation/annotation-utils.ts","../../src/delivery/annotation/freeform-editor.tsx","../../src/delivery/annotation/annotation-menu.tsx","../../src/delivery/annotation/annotation-editor.tsx","../../src/delivery/main.tsx"],"sourcesContent":["// @ts-nocheck\n\n// returns DOM Nodes before the stopOffset\nconst getAllTextNodesBeforePosition = (node, stopOffset, nodeArray) => {\n const nodes = nodeArray ? nodeArray : [];\n const offset = nodes.reduce((acc, node) => acc + node.textContent.length, 0);\n let keepWalking = true;\n\n if (offset > stopOffset) {\n return false;\n }\n\n if (node) {\n // 3 = HTML DOM node value for text nodes\n if (node.nodeType === 3 && node.parentNode && !node.parentNode.hasAttribute('data-ann-id')) {\n nodes.push(node);\n }\n\n node = node.firstChild;\n }\n\n while (node && keepWalking) {\n keepWalking = getAllTextNodesBeforePosition(node, stopOffset, nodes);\n node = node.nextSibling;\n }\n\n return nodes;\n};\n\n// returns DOM Nodes that overlap the start or end position\nexport const getDOMNodes = (startOffset, endOffset, rootNode) => {\n const textNodesToEnd = getAllTextNodesBeforePosition(rootNode, endOffset);\n const domNodes = [];\n let start = 0;\n\n textNodesToEnd.forEach((node) => {\n const end = start + node.textContent.length;\n\n [startOffset, endOffset].forEach((offset) => {\n if (start <= offset && offset < end) {\n domNodes.push({\n node,\n offset: offset - start,\n });\n }\n });\n\n start = end;\n });\n\n return domNodes;\n};\n\n// returns [ textNodes, text ]\n// textNodes = DOM Text Nodes between start range and end range node\n// text = plain text in range\nconst getTextNodesBetween = (range) => {\n const {\n commonAncestorContainer: rootNode,\n startContainer: startNode,\n endContainer: endNode,\n startOffset,\n endOffset,\n } = range;\n const textNodes = [];\n let pastStartNode = false;\n let reachedEndNode = false;\n let text = '';\n\n const getTextNodes = (node) => {\n const { nodeValue: value, childNodes } = node;\n\n if (node === startNode && node === endNode) {\n if (value) {\n text += value.substring(startOffset, endOffset);\n }\n\n pastStartNode = reachedEndNode = true;\n } else if (node === startNode) {\n if (value) {\n text += value.substring(startOffset);\n }\n\n pastStartNode = true;\n } else if (node === endNode) {\n if (value) {\n text += value.substring(0, endOffset);\n }\n\n reachedEndNode = true;\n } else if (node && node.nodeType === 3 && node.parentNode && !node.parentNode.hasAttribute('data-ann-id')) {\n // 3 = HTML DOM node value for text nodes\n if (value && pastStartNode && !reachedEndNode) {\n text += value;\n textNodes.push(node);\n }\n }\n\n childNodes.forEach((childNode) => {\n if (!reachedEndNode) {\n getTextNodes(childNode);\n } else {\n return;\n }\n });\n };\n\n getTextNodes(rootNode);\n\n return [textNodes, text];\n};\n\nconst surroundContent = (range) => {\n const wrapper = document.createElement('SPAN');\n\n range.surroundContents(wrapper);\n\n return wrapper;\n};\n\n// wrap each DOM Text Node in range into a span\nexport const wrapRange = (range) => {\n if (range.startContainer === range.endContainer) {\n return [surroundContent(range)];\n }\n\n const [nodesBetween] = getTextNodesBetween(range);\n\n // wrap the start node\n const startRange = document.createRange();\n\n startRange.selectNodeContents(range.startContainer);\n startRange.setStart(range.startContainer, range.startOffset);\n\n const startWrapper = surroundContent(startRange);\n\n // wrap the end node\n const endRange = document.createRange();\n\n endRange.selectNode(range.endContainer);\n endRange.setEnd(range.endContainer, range.endOffset);\n\n const endWrapper = surroundContent(endRange);\n\n // wrap the nodes between start and end nodes, if any\n const centerWrappers = nodesBetween.map((node) => {\n const wrapper = document.createElement('SPAN');\n\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n });\n\n return [startWrapper, ...centerWrappers, endWrapper];\n};\n\n// returns text in range with start and end position in rootNode\nexport const getRangeDetails = (range, rootNode) => {\n const rangeBefore = document.createRange();\n\n rangeBefore.setStart(rootNode, 0);\n rangeBefore.setEnd(range.startContainer, range.startOffset);\n\n const [, text] = getTextNodesBetween(rangeBefore);\n const [, textSelected] = getTextNodesBetween(range);\n const start = text.length;\n const end = start + textSelected.length;\n\n return {\n quote: textSelected,\n start,\n end,\n };\n};\n\n// removes the annotation spans without changing the content inside\nexport const removeElemsWrapping = (elems, container) => {\n (elems || []).forEach((elem) => {\n const parent = elem.parentNode;\n const childNodes = elem.childNodes;\n const childNodesLength = childNodes.length;\n\n if (childNodesLength > 0) {\n for (let i = 0; i < childNodesLength; i++) {\n parent.insertBefore(childNodes[0], elem);\n }\n } else {\n parent.insertBefore(document.createTextNode(elem.textContent), elem);\n }\n\n parent.removeChild(elem);\n });\n\n container.normalize();\n};\n\n// also used in select-text\nexport const clearSelection = () => {\n if (document.getSelection) {\n // for all new browsers (IE9+, Chrome, Firefox)\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(document.createRange());\n } else if (window.getSelection) {\n // equals with the document.getSelection (MSDN info)\n if (window.getSelection().removeAllRanges) {\n // for all new browsers (IE9+, Chrome, Firefox)\n window.getSelection().removeAllRanges();\n window.getSelection().addRange(document.createRange());\n } else if (window.getSelection().empty) {\n // Chrome supports this as well\n window.getSelection().empty();\n }\n } else if (document.selection) {\n // IE8-\n document.selection.empty();\n }\n};\n\n// check if annotation label contains line breaks or its length >= 20 characters\nexport const isSideLabel = (text) => text.length >= 20 || text.search(/\\n|\\r|\\r\\n/) !== -1;\n\nexport const getAnnotationElements = (id) => Array.from(document.querySelectorAll(`[data-id='${id}']`));\n\nexport const getLabelElement = (id) => document.querySelector(`[data-ann-id='${id}']`);\n\n/*\n * The rings either side of the freeform editor's type band. The band's colour is the\n * annotation's type, information with no text label, so it needs 3:1 against what bounds it\n * (WCAG 1.4.11). The rings meet the fixed annotation fills as well as the themed surface, so they\n * are a literal: under the dark preset `--pie-border-dark` is #9E9E9E, 2.18:1 against the green.\n * #757575 clears 3:1 against both fills, white, and the dark preset's background. It stays fixed\n * until the annotation colours themselves follow the theme.\n */\nexport const ANNOTATION_STROKE = '#757575';\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Popover, TextField } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { color, createUniqueId } from '@pie-lib/render-ui';\nimport { ANNOTATION_STROKE } from './annotation-utils.js';\n\nconst StyledPopover: any = styled(Popover)(({ annotationType }) => ({\n '& .MuiPaper-root': {\n overflowX: 'unset',\n overflowY: 'unset',\n marginLeft: '16px',\n '&::before': {\n position: 'absolute',\n right: '100%',\n top: '13px',\n border: 'solid transparent',\n content: '\"\"',\n height: 0,\n width: 0,\n pointerEvents: 'none',\n borderWidth: '7px',\n borderRightColor: color.border(),\n },\n ...(annotationType === 'negative' && {\n '&::before': {\n borderRightColor: 'rgb(255, 204, 238) !important',\n },\n }),\n ...(annotationType === 'positive' && {\n '&::before': {\n borderRightColor: 'rgb(153, 255, 153) !important',\n },\n }),\n },\n}));\n\n// See annotation-menu: surface and text follow the theme together, and the text field takes\n// the same text colour as the buttons. The type colour is as light as the white fill, so a\n// 1px ANNOTATION_STROKE ring runs along both of its edges; the inner ring is drawn over the\n// content so a hovered button cannot cover it.\nconst Wrapper: any = styled('div')(({ theme, annotationType }) => ({\n width: '200px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: color.v('pie')('background', color.defaults.WHITE),\n color: color.v('pie')('text', theme.palette.text.primary),\n border: `4px solid ${color.border()}`,\n '& .MuiInputBase-root': {\n color: 'inherit',\n },\n ...((annotationType === 'negative' || annotationType === 'positive') && {\n position: 'relative',\n boxShadow: `0 0 0 1px ${ANNOTATION_STROKE}`,\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n border: `1px solid ${ANNOTATION_STROKE}`,\n pointerEvents: 'none',\n },\n }),\n ...(annotationType === 'negative' && {\n borderColor: 'rgb(255, 204, 238) !important',\n }),\n ...(annotationType === 'positive' && {\n borderColor: 'rgb(153, 255, 153) !important',\n }),\n}));\n\nconst Holder: any = styled('div')(() => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${color.border()}`,\n}));\n\n// The annotation fills stay light in every scheme, so text on them keeps the paper's dark text.\nconst Button: any = styled('div')(({ theme, variant, annotationType }) => ({\n flexGrow: 1,\n width: '28%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n '&:not(:nth-child(3n))': {\n borderRight: `1px solid ${color.border()}`,\n },\n '&:hover': {\n backgroundColor: color.backgroundDark(),\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n color: theme.palette.text.primary,\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n color: theme.palette.text.primary,\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'negative' && {\n '&:hover': {\n backgroundColor: 'rgb(153, 255, 153) !important',\n color: theme.palette.text.primary,\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'positive' && {\n '&:hover': {\n backgroundColor: 'rgb(255, 204, 238) !important',\n color: theme.palette.text.primary,\n },\n }),\n}));\n\nclass FreeformEditor extends React.Component {\n static propTypes = {\n anchorEl: PropTypes.object,\n open: PropTypes.bool,\n offset: PropTypes.number,\n value: PropTypes.string,\n type: PropTypes.string,\n onClose: PropTypes.func,\n onDelete: PropTypes.func,\n onSave: PropTypes.func,\n onTypeChange: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n this.state = { value: props.value };\n this.editorId = createUniqueId('annotation-editor');\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { value } = nextProps;\n const { value: propsValue } = this.props;\n\n if (value !== propsValue) {\n this.setState({ value });\n }\n }\n\n onValueChange = (event) => this.setState({ value: event.target.value });\n\n handleSave: any = () => {\n const { value: oldValue, onSave, onClose, onDelete } = this.props;\n const { value } = this.state;\n\n if (value === '') {\n onDelete();\n }\n\n if (oldValue !== value) {\n onSave(oldValue, value);\n }\n\n this.setState({ value: '' });\n onClose();\n };\n\n handleTypeChange: any = () => {\n const { onTypeChange, onDelete } = this.props;\n const { value } = this.state;\n\n if (value === '') {\n onDelete();\n } else {\n onTypeChange(value);\n }\n\n this.setState({ value: '' });\n };\n\n render() {\n const { anchorEl, offset, onDelete, open, type } = this.props;\n const { value } = this.state;\n\n return (\n <StyledPopover\n anchorEl={anchorEl}\n elevation={2}\n open={open}\n onClose={this.handleSave}\n annotationType={type}\n style={{ marginTop: `${offset}px`, transition: 'margin-top 2s ease-out' }}\n transitionDuration={{ enter: 225, exit: 195 }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n >\n <Wrapper annotationType={type}>\n <TextField\n id={this.editorId}\n style={{\n padding: '2px 5px',\n width: '95%',\n }}\n autoFocus\n multiline\n rows={1}\n maxRows={4}\n value={value}\n onChange={this.onValueChange}\n InputProps={{ disableUnderline: true }}\n />\n <Holder>\n <Button onClick={onDelete}>\n Delete\n </Button>\n <Button variant=\"typeChange\" annotationType={type} onClick={this.handleTypeChange}>\n {type === 'negative' ? 'Green' : 'Pink'}\n </Button>\n <Button onClick={this.handleSave}>\n Save\n </Button>\n </Holder>\n </Wrapper>\n </StyledPopover>\n );\n }\n}\n\nexport default FreeformEditor;\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { Popover } from '@mui/material';\nimport { color } from '@pie-lib/render-ui';\n\nconst StyledPopover: any = styled(Popover)({\n '& .MuiPaper-root': {\n overflowX: 'unset',\n overflowY: 'unset',\n marginTop: '-16px',\n '&::after': {\n position: 'absolute',\n left: 'calc(50% - 7px)',\n border: 'solid transparent',\n content: '\"\"',\n height: 0,\n width: 0,\n pointerEvents: 'none',\n borderWidth: '7px',\n borderTopColor: color.borderDark(),\n },\n },\n});\n\n/*\n * Surface and text move together. `--pie-background` and `--pie-text` follow both the colour\n * schemes and the dark theme; `--pie-white` stays white under the dark theme, and the popover\n * paper's own text stays near-black in every scheme. Without a theme the fallbacks are the\n * white and the paper text the menu has always had. The outline and pointer bound the menu\n * against its surface and the page, so they follow the theme's `--pie-border-dark`, which clears\n * 3:1 against both in every scheme. The cells are text-labelled buttons, so WCAG 1.4.11 needs no\n * contrasting boundary between the outline and the annotation fills.\n */\nconst MainWrapper: any = styled('div')(({ theme }) => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: color.v('pie')('background', color.defaults.WHITE),\n color: color.v('pie')('text', theme.palette.text.primary),\n border: `2px solid ${color.borderDark()}`,\n}));\n\nconst AnnotationsWrapper: any = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper: any = styled('div')(() => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${color.border()}`,\n}));\n\n// The annotation fills stay light in every scheme, so their labels keep the paper's dark text.\nconst Button: any = styled('div')(({ theme, variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${color.border()}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${color.border()}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: color.backgroundDark(),\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n color: theme.palette.text.primary,\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n color: theme.palette.text.primary,\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n}));\n\nclass AnnotationMenu extends React.Component {\n static propTypes = {\n anchorEl: PropTypes.object,\n open: PropTypes.bool,\n annotations: PropTypes.array,\n isNewAnnotation: PropTypes.bool,\n onClose: PropTypes.func,\n onDelete: PropTypes.func,\n onEdit: PropTypes.func,\n onWrite: PropTypes.func,\n onAnnotate: PropTypes.func,\n };\n\n render() {\n const { anchorEl, annotations, isNewAnnotation, onAnnotate, onClose, onEdit, onDelete, onWrite, open } =\n this.props;\n\n return (\n <StyledPopover\n anchorEl={anchorEl}\n open={open}\n onClose={onClose}\n elevation={5}\n transitionDuration={{ enter: 225, exit: 195 }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n >\n <MainWrapper>\n <AnnotationsWrapper>\n {annotations.map((annotation, index) => (\n <Button\n key={`annotation-${index}`}\n variant={annotation.type}\n onClick={() => onAnnotate(annotation)}\n >\n {annotation.label}\n </Button>\n ))}\n </AnnotationsWrapper>\n <ControlsWrapper>\n <Button onClick={onClose}>\n Cancel\n </Button>\n <Button style={{ pointerEvents: 'none' }} />\n {isNewAnnotation ? (\n <React.Fragment>\n <Button variant=\"positive\" onClick={() => onWrite('positive')}>\n Write\n </Button>\n <Button variant=\"negative\" onClick={() => onWrite('negative')}>\n Write\n </Button>\n </React.Fragment>\n ) : (\n <React.Fragment>\n <Button onClick={onDelete}>\n Delete\n </Button>\n <Button onClick={onEdit}>\n Edit\n </Button>\n </React.Fragment>\n )}\n </ControlsWrapper>\n </MainWrapper>\n </StyledPopover>\n );\n }\n}\n\nexport default AnnotationMenu;\n","// @ts-nocheck\n\nimport React from 'react';\nimport { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\n\nimport {\n clearSelection,\n isSideLabel,\n getAnnotationElements,\n getDOMNodes,\n getLabelElement,\n getRangeDetails,\n removeElemsWrapping,\n wrapRange,\n} from './annotation-utils.js';\nimport FreeformEditor from './freeform-editor.js';\nimport AnnotationMenu from './annotation-menu.js';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport Translator from '@pie-lib/translator';\nimport { sanitizeModelHtml } from '@pie-element/shared-utils';\n\nconst { translator } = Translator;\n\nconst TextContainer: any = styled('div')({\n padding: '10px 120px 10px 16px',\n backgroundColor: 'rgba(0, 0, 0, 0.06)',\n border: '1px solid #ccc',\n borderRadius: '4px',\n overflowY: 'scroll',\n lineHeight: '36px',\n whiteSpace: 'pre-wrap',\n overflowWrap: 'break-word',\n '& p': {\n margin: 0,\n },\n '& span[data-latex]': {\n userSelect: 'none',\n '-webkit-user-select': 'none',\n '-moz-user-select': 'none',\n '-ms-user-select': 'none',\n },\n});\n\nconst LabelsContainer: any = styled('div')({\n width: '230px',\n});\n\nconst Wrapper: any = styled('div')({\n position: 'relative',\n overflowX: 'hidden',\n display: 'flex',\n});\n\nconst CommentContainer: any = styled(InputContainer)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n width: '100%',\n}));\n\n// Global styles for pseudo-elements that can't be applied inline\nconst globalStyles = `\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: \"\";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n`;\n\n// Inject styles if not already injected\nif (!document.getElementById('annotation-editor-styles')) {\n const styleElement = document.createElement('style');\n styleElement.id = 'annotation-editor-styles';\n styleElement.textContent = globalStyles;\n document.head.appendChild(styleElement);\n}\n\nclass AnnotationEditor extends React.Component {\n static propTypes = {\n text: PropTypes.string,\n comment: PropTypes.string,\n annotations: PropTypes.array,\n predefinedAnnotations: PropTypes.array,\n onChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n width: PropTypes.number,\n height: PropTypes.number,\n maxHeight: PropTypes.string,\n disabled: PropTypes.bool,\n disabledMath: PropTypes.bool,\n customKeys: PropTypes.array,\n keypadMode: PropTypes.string,\n language: PropTypes.string,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n anchorEl: null,\n openedMenu: false,\n openedEditor: false,\n selectedElems: [],\n labelElem: null,\n selectionDetails: null,\n annotation: null,\n annotationIndex: null,\n };\n }\n\n componentDidMount() {\n const { annotations, text } = this.props;\n\n if (text) {\n annotations.forEach((annotation) => {\n const [domStart, domEnd] = getDOMNodes(annotation.start, annotation.end, this.textRef);\n\n if (domStart && domEnd) {\n const range = document.createRange();\n\n range.setStart(domStart.node, domStart.offset);\n range.setEnd(domEnd.node, domEnd.offset);\n\n const spans = wrapRange(range);\n\n this.createDOMAnnotation(spans, annotation);\n }\n });\n }\n\n if (this.textRef) {\n this.adjustAnnotationsPosition();\n this.textRef.addEventListener('scroll', this.adjustAnnotationsPosition);\n }\n }\n\n adjustAnnotationsPosition: any = () => {\n if (this.textRef && this.labelsRef) {\n const left = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;\n\n Array.from(this.labelsRef.children).forEach((label) => {\n const spans = getAnnotationElements(label.dataset.annId);\n const spanOffset = spans[0].offsetTop ? spans[0].offsetTop : spans[0].offsetParent.offsetTop;\n const top = spanOffset - this.textRef.scrollTop - 6;\n\n label.style.top = `${top}px`;\n label.style.left = `${left}px`;\n });\n }\n };\n\n handleClick: any = (event) => {\n const { annotations } = this.props;\n const { selectionDetails } = this.state;\n\n if (selectionDetails) {\n // new selection was made inside another annotation and should not update that annotation\n return;\n }\n\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const annotationIndex = annotations.findIndex((annotation) => annotation.id === annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n if (isSideLabel) {\n labelElem.style.zIndex = '10';\n }\n\n this.setState({\n anchorEl: selectedElems[0],\n openedMenu: !!id || (!!annId && !isSideLabel), // true if the annotation or the label was clicked\n openedEditor: !!annId && isSideLabel, // true if the side label was clicked\n selectedElems,\n labelElem,\n annotationIndex,\n annotation: annotations[annotationIndex],\n selectionDetails: null,\n });\n };\n\n handleHover: any = (event) => {\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n selectedElems.forEach((elem) => {\n elem.style.zIndex = '20';\n if (elem.classList.contains('positive')) {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.7)';\n } else if (elem.classList.contains('negative')) {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.55)';\n }\n });\n\n if (isSideLabel) {\n labelElem.style.zIndex = '20';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.backgroundColor = 'rgb(128, 255, 128)';\n labelElem.style.setProperty('--before-border-color', 'rgb(153, 255, 153)');\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.backgroundColor = 'rgb(255, 179, 230)';\n labelElem.style.setProperty('--before-border-color', 'rgb(255, 179, 230)');\n }\n } else {\n labelElem.style.zIndex = '20';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.color = 'rgb(0, 77, 0)';\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.color = 'rgb(153, 0, 102)';\n }\n }\n };\n\n handleCancelHover: any = (event) => {\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n selectedElems.forEach((elem) => {\n elem.style.zIndex = '';\n if (elem.classList.contains('positive')) {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.5)';\n } else if (elem.classList.contains('negative')) {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.4)';\n }\n });\n\n if (isSideLabel) {\n labelElem.style.zIndex = '';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.backgroundColor = 'rgb(153, 255, 153)';\n labelElem.style.removeProperty('--before-border-color');\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.backgroundColor = 'rgb(255, 204, 238)';\n labelElem.style.removeProperty('--before-border-color');\n }\n } else {\n labelElem.style.zIndex = '';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.color = 'rgb(0, 128, 0)';\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.color = 'rgb(204, 0, 136)';\n }\n }\n };\n\n handleClose: any = (event) => {\n const { selectedElems, labelElem } = this.state;\n\n if (selectedElems.length && !selectedElems[0].hasAttribute('data-id')) {\n removeElemsWrapping(selectedElems, this.textRef);\n }\n\n if (labelElem) {\n labelElem.style.zIndex = '';\n }\n\n this.setState({\n anchorEl: null,\n openedMenu: false,\n openedEditor: false,\n selectedElems: [],\n labelElem: null,\n selectionDetails: null,\n annotationIndex: null,\n annotation: null,\n });\n\n clearSelection();\n };\n\n handleSelection: any = (event) => {\n const selection = window.getSelection();\n\n // prevent unwanted selections\n if (event.detail > 2) {\n clearSelection();\n return;\n }\n\n if (selection && selection.rangeCount > 0) {\n const selectedRange = selection.getRangeAt(0);\n const selectedText = selectedRange.toString();\n const isSelectionInside = this.textRef.contains(selectedRange.commonAncestorContainer);\n\n if (!selection.isCollapsed && selectedText !== '' && isSelectionInside) {\n const selectionDetails = getRangeDetails(selectedRange, this.textRef);\n const selectedElems = wrapRange(selectedRange);\n\n this.setState({\n anchorEl: selectedElems[0],\n openedMenu: true,\n selectedElems,\n selectionDetails,\n });\n }\n }\n };\n\n deleteAnnotation: any = () => {\n const { annotations, onChange } = this.props;\n const { selectedElems, labelElem, annotationIndex, annotation } = this.state;\n const parentRef = isSideLabel(annotation.label) ? this.labelsRef : selectedElems[0];\n\n parentRef.removeChild(labelElem);\n removeElemsWrapping(selectedElems, this.textRef);\n annotations.splice(annotationIndex, 1);\n\n onChange(annotations);\n this.handleClose();\n };\n\n createDOMAnnotation: any = (elems, annotation) => {\n const { disabled } = this.props;\n const { id, label, type } = annotation;\n\n (elems || []).forEach((elem) => {\n elem.dataset.id = id;\n elem.className = `annotation ${type}`;\n // Apply annotation styles directly\n elem.style.position = 'relative';\n elem.style.cursor = 'pointer';\n if (type === 'positive') {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.5)';\n } else if (type === 'negative') {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.4)';\n }\n elem.onclick = !disabled && this.handleClick;\n elem.onmouseover = this.handleHover;\n elem.onmouseout = this.handleCancelHover;\n });\n\n const firstSpan = (elems && elems[0]) || {};\n const labelElem = document.createElement('SPAN');\n\n labelElem.dataset.annId = id;\n labelElem.innerHTML = sanitizeModelHtml(label);\n labelElem.onclick = !disabled && this.handleClick;\n labelElem.onmouseover = this.handleHover;\n labelElem.onmouseout = this.handleCancelHover;\n\n if (isSideLabel(label)) {\n const spanOffset = firstSpan.offsetTop ? firstSpan.offsetTop : firstSpan.offsetParent.offsetTop;\n const top = spanOffset - this.textRef.scrollTop;\n const left = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;\n\n labelElem.dataset.freeform = true;\n labelElem.className = `sideAnnotation ${type}`;\n \n // Apply side annotation styles directly\n labelElem.style.position = 'absolute';\n labelElem.style.padding = '4px';\n labelElem.style.borderRadius = '4px';\n labelElem.style.marginLeft = '8px';\n labelElem.style.width = '180px';\n labelElem.style.whiteSpace = 'pre-wrap';\n labelElem.style.wordBreak = 'break-word';\n labelElem.style.border = '2px solid #ffffff';\n labelElem.style.fontSize = '14px';\n labelElem.style.fontStyle = 'normal';\n labelElem.style.fontWeight = 'normal';\n labelElem.style.top = `${top}px`;\n labelElem.style.left = `${left}px`;\n \n if (type === 'negative') {\n labelElem.style.backgroundColor = 'rgb(255, 204, 238)';\n } else if (type === 'positive') {\n labelElem.style.backgroundColor = 'rgb(153, 255, 153)';\n }\n \n // Add pseudo-element styles via CSS\n labelElem.style.setProperty('--before-border-width', '7px');\n labelElem.style.setProperty('--before-top', '5px');\n labelElem.style.setProperty('--before-right', '100%');\n if (type === 'negative') {\n labelElem.style.setProperty('--before-border-color', 'rgb(255, 204, 238)');\n } else if (type === 'positive') {\n labelElem.style.setProperty('--before-border-color', 'rgb(153, 255, 153)');\n }\n\n this.labelsRef.appendChild(labelElem);\n } else {\n labelElem.className = `annotationLabel ${type}`;\n \n // Apply annotation label styles directly\n labelElem.style.backgroundColor = 'rgb(242, 242, 242)';\n labelElem.style.padding = '2px';\n labelElem.style.position = 'absolute';\n labelElem.style.userSelect = 'none';\n labelElem.style.whiteSpace = 'nowrap';\n labelElem.style.top = '-10px';\n labelElem.style.left = '-2px';\n labelElem.style.fontSize = '12px';\n labelElem.style.fontStyle = 'normal';\n labelElem.style.fontWeight = 'normal';\n labelElem.style.lineHeight = '6px';\n labelElem.style.webkitUserSelect = 'none';\n labelElem.style.mozUserSelect = 'none';\n labelElem.style.msUserSelect = 'none';\n \n if (type === 'positive') {\n labelElem.style.color = 'rgb(0, 128, 0)';\n } else if (type === 'negative') {\n labelElem.style.color = 'rgb(204, 0, 136)';\n }\n \n firstSpan.appendChild(labelElem);\n }\n };\n\n createNewAnnotation: any = (label, type) => {\n const { selectedElems, selectionDetails } = this.state;\n const annotation = {\n id: [selectionDetails.start, selectionDetails.end, new Date().getTime()].join('-'),\n label,\n type,\n ...selectionDetails,\n };\n\n this.createDOMAnnotation(selectedElems, annotation);\n\n return annotation;\n };\n\n handleMenuClick: any = (newAnnotation) => {\n const { annotations, onChange } = this.props;\n const { annotation, annotationIndex } = this.state;\n const { type, text: label } = newAnnotation;\n\n if (annotation) {\n const updatedAnnotation = { ...annotation, label, type };\n const { type: oldType, label: oldLabel } = annotation;\n\n this.updateLabel(oldLabel, updatedAnnotation, type !== oldType && oldType);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n } else {\n const newAnnotation = this.createNewAnnotation(label, type);\n\n annotations.push(newAnnotation);\n }\n\n onChange(annotations);\n this.handleClose();\n };\n\n editAnnotation: any = () => {\n this.setState({\n openedMenu: false,\n openedEditor: true,\n });\n };\n\n addAnnotation: any = (type) => {\n const { annotations, onChange } = this.props;\n const annotation = this.createNewAnnotation('', type);\n const labelElem = getLabelElement(annotation.id);\n\n annotations.push(annotation);\n\n this.setState({\n openedMenu: false,\n openedEditor: true,\n annotationIndex: annotations.length - 1,\n annotation,\n labelElem,\n });\n\n onChange(annotations);\n };\n\n updateLabel: any = (oldLabel, annotation, oldType) => {\n const { selectedElems, labelElem } = this.state;\n const { label, type } = annotation;\n\n if ((isSideLabel(label) && isSideLabel(oldLabel)) || (!isSideLabel(label) && !isSideLabel(oldLabel))) {\n labelElem.innerHTML = sanitizeModelHtml(label);\n\n if (oldType) {\n labelElem.classList.remove(oldType);\n labelElem.classList.add(type);\n\n selectedElems.forEach((elem) => {\n elem.classList.remove(oldType);\n elem.classList.add(type);\n });\n }\n } else if (isSideLabel(label) && !isSideLabel(oldLabel)) {\n selectedElems[0].removeChild(labelElem);\n this.createDOMAnnotation(selectedElems, annotation);\n } else if (!isSideLabel(label) && isSideLabel(oldLabel)) {\n this.labelsRef.removeChild(labelElem);\n this.createDOMAnnotation(selectedElems, annotation);\n }\n };\n\n changeAnnotationType: any = (newLabel) => {\n const { annotations, onChange } = this.props;\n const { annotationIndex, selectedElems } = this.state;\n const { type: oldType, label: oldLabel } = annotations[annotationIndex];\n const type = oldType === 'positive' ? 'negative' : 'positive';\n const updatedAnnotation = { ...annotations[annotationIndex], type, label: newLabel };\n\n selectedElems.forEach((span) => {\n span.classList.remove(oldType);\n span.classList.add(type);\n });\n\n this.updateLabel(oldLabel, updatedAnnotation, oldType);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n\n onChange(annotations);\n this.handleClose();\n };\n\n updateAnnotation: any = (oldLabel, newLabel) => {\n const { annotations, onChange } = this.props;\n const { annotationIndex } = this.state;\n const updatedAnnotation = { ...annotations[annotationIndex], label: newLabel };\n\n this.updateLabel(oldLabel, updatedAnnotation);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n\n onChange(annotations);\n };\n\n componentWillUnmount() {\n this.textRef.removeEventListener('scroll', this.adjustAnnotationsPosition);\n }\n\n render() {\n const {\n comment,\n customKeys,\n disabled,\n disabledMath,\n keypadMode,\n height,\n language,\n width,\n maxHeight,\n onCommentChange,\n predefinedAnnotations,\n text,\n } = this.props;\n const { anchorEl, annotation, openedMenu, openedEditor, selectionDetails } = this.state;\n\n const anchorOffset = anchorEl && (anchorEl.offsetTop ? anchorEl.offsetTop : anchorEl.offsetParent.offsetTop);\n const topOffset = this.textRef && anchorOffset ? anchorOffset - this.textRef.scrollTop - 8 : 0;\n const commentLabel = translator.t('extendedTextEntry.comment', { lng: language });\n\n return (\n <div>\n <Wrapper>\n <TextContainer\n style={{ width: width - 34, minHeight: height, maxHeight: maxHeight }}\n ref={(r) => (this.textRef = r)}\n onMouseDown={!disabled ? clearSelection : () => {}}\n onMouseUp={!disabled ? this.handleSelection : () => {}}\n dangerouslySetInnerHTML={{ __html: sanitizeModelHtml(text) }}\n />\n <LabelsContainer ref={(r) => (this.labelsRef = r)} />\n </Wrapper>\n\n <CommentContainer label={commentLabel}>\n <EditableHtml\n className=\"prompt\"\n markup={comment || ''}\n onChange={onCommentChange}\n width={width && (width + 104).toString()}\n disabled={disabled}\n ariaLabel={commentLabel}\n language={language}\n pluginProps={{\n math: {\n disabled: disabledMath,\n customKeys: customKeys,\n keypadMode: keypadMode,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n }}\n />\n </CommentContainer>\n\n <AnnotationMenu\n anchorEl={anchorEl}\n open={openedMenu && !disabled}\n annotations={predefinedAnnotations}\n isNewAnnotation={!!selectionDetails}\n onClose={this.handleClose}\n onDelete={this.deleteAnnotation}\n onEdit={this.editAnnotation}\n onWrite={this.addAnnotation}\n onAnnotate={this.handleMenuClick}\n />\n\n <FreeformEditor\n anchorEl={this.textRef}\n open={openedEditor && !disabled}\n offset={topOffset}\n value={(annotation && annotation.label) || ''}\n type={annotation && annotation.type}\n onClose={this.handleClose}\n onDelete={this.deleteAnnotation}\n onSave={this.updateAnnotation}\n onTypeChange={this.changeAnnotationType}\n />\n </div>\n );\n }\n}\n\nexport default AnnotationEditor;\n","// @ts-nocheck\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\n\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\n\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { color, Feedback as FeedbackImport, Collapsible as CollapsibleImport, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport Translator from '@pie-lib/translator';\nimport AnnotationEditor from './annotation/annotation-editor.js';\n\nconst { translator } = Translator;\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst MainContainer: any = styled(UiLayout)({\n backgroundColor: color.background(),\n color: color.text(),\n});\n\nconst StyledPrompt: any = styled(Typography)(({ theme }) => ({\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing(2),\n fontSize: 'inherit',\n display: 'block',\n}));\n\nconst TeacherInstructions: any = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst Editor: any = styled(EditableHtml)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n}));\n\nconst SrOnly: any = styled('h2')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onValueChange: PropTypes.func.isRequired,\n onAnnotationsChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n session: PropTypes.shape({\n value: PropTypes.string,\n annotations: PropTypes.array,\n comment: PropTypes.string,\n }).isRequired,\n };\n\n // Random rather than a counter: two versions of this element on one page would each count from 1.\n promptId = `ete-prompt-${Math.random().toString(36).slice(2, 10)}`;\n\n // The editor calls back on commit points (blur, `done` transactions), and the\n // custom element writes the session synchronously and defers only its\n // `session-changed` dispatch. Coalescing belongs on that dispatch, where a\n // teardown can flush it; holding the value here instead left `.session` stale\n // and unreadable by any other layer, so the callbacks pass straight through.\n render() {\n const { model, session, onAnnotationsChange, onCommentChange, onValueChange } = this.props;\n const {\n animationsDisabled,\n annotatorMode,\n customKeys,\n dimensions,\n disabled,\n disabledAnnotator,\n equationEditor,\n extraCSSRules,\n feedback,\n mathInput,\n pasteFormattingDisabled,\n playersToolbarPosition,\n predefinedAnnotations,\n prompt,\n spanishInput,\n specialInput,\n spellCheckEnabled,\n teacherInstructions,\n } = model;\n const { annotations, comment, value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = { position: playersToolbarPosition === 'top' ? 'top' : 'bottom' };\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const languageCharactersProps = [];\n\n if (spanishInput) {\n languageCharactersProps.push({ language: 'spanish' });\n }\n\n if (specialInput) {\n languageCharactersProps.push({ language: 'special' });\n }\n\n return (\n <MainContainer\n extraCSSRules={extraCSSRules}\n ref={(ref) => {\n this.containerRef = ref;\n }}\n >\n <SrOnly>{translator.t('extendedTextEntry.constructedResponseQuestion', { lng: model.language })}</SrOnly>\n\n {teacherInstructions && (\n <TeacherInstructions>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: translator.t('common:showTeacherInstructions', { lng: model.language }), visible: translator.t('common:hideTeacherInstructions', { lng: model.language }) }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </TeacherInstructions>\n )}\n\n {prompt && (\n <StyledPrompt component={'span'} id={this.promptId}>\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n {annotatorMode ? (\n <AnnotationEditor\n text={value || ''}\n annotations={annotations || []}\n comment={comment || ''}\n predefinedAnnotations={predefinedAnnotations || []}\n onChange={onAnnotationsChange}\n onCommentChange={onCommentChange}\n width={width}\n height={height}\n maxHeight={maxHeight}\n disabled={disabledAnnotator}\n disabledMath={!mathInput}\n customKeys={customKeys}\n keypadMode={equationEditor}\n language={model.language}\n />\n ) : (\n <Editor\n className=\"response-area-editor\"\n onChange={onValueChange}\n markup={value || ''}\n maxWidth={width && width.toString()}\n minWidth={'100px'}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n charactersLimit={50000}\n autoWidthToolbar\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n table: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n separateParagraphs: { disabled: false },\n ul_list: { disabled: true },\n ol_list: { disabled: true },\n pasteFormatting: { disabled: pasteFormattingDisabled === true },\n }}\n languageCharactersProps={languageCharactersProps}\n // The prompt names the response; the generic name covers no prompt, or one with no text.\n ariaLabelledBy={prompt ? this.promptId : undefined}\n ariaLabel={translator.t('extendedTextEntry.response', { lng: model.language })}\n language={model.language}\n />\n )}\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </MainContainer>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;kEAGM,KAAiC,GAAM,GAAY,MAAc;CACrE,IAAM,IAAQ,KAAwB,CAAC,GACjC,IAAS,EAAM,QAAQ,GAAK,MAAS,IAAM,EAAK,YAAY,QAAQ,CAAC,GACvE,IAAc;CAElB,IAAI,IAAS,GACX,OAAO;CAYT,KATA,AAME,OAJI,EAAK,aAAa,KAAK,EAAK,cAAc,CAAC,EAAK,WAAW,aAAa,aAAa,KACvF,EAAM,KAAK,CAAI,GAGV,EAAK,aAGP,KAAQ,IAEb,AADA,IAAc,EAA8B,GAAM,GAAY,CAAK,GACnE,IAAO,EAAK;CAGd,OAAO;AACT,GAGa,KAAe,GAAa,GAAW,MAAa;CAC/D,IAAM,IAAiB,EAA8B,GAAU,CAAS,GAClE,IAAW,CAAC,GACd,IAAQ;CAiBZ,OAfA,EAAe,SAAS,MAAS;EAC/B,IAAM,IAAM,IAAQ,EAAK,YAAY;EAWrC,AATA,CAAC,GAAa,CAAS,CAAC,CAAC,SAAS,MAAW;GAC3C,AAAI,KAAS,KAAU,IAAS,KAC9B,EAAS,KAAK;IACZ;IACA,QAAQ,IAAS;GACnB,CAAC;EAEL,CAAC,GAED,IAAQ;CACV,CAAC,GAEM;AACT,GAKM,KAAuB,MA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,iBAAiB,EAAE,UAAU,MAA4B,GAAK;KAChE;KACyB;KAEzB,gBAAgB,IAAS,KAAK,WAAW,KAAA;KACzC,WAAW,EAAW,EAAE,8BAA8B,EAAE,KAAK,EAAM,SAAS,CAAC;KAC7E,UAAU,EAAM;IACjB,CAAA;IAGF,KAAY,kBAAC,IAAD;KAAU,aAAY;KAAoB;IAAW,CAAA;GACrD;;CAEnB;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { i as e } from "../rolldown-runtime-CWhphoD1.js";
2
- import { F as t, M as n, b as r } from "../dist-Dcix7OLC.js";
2
+ import { I as t, N as n, b as r } from "../dist-j1vyVp3g.js";
3
3
  import { t as i } from "../browser-CcvjX8VA.js";
4
- import { t as a } from "../main-D5PwTUlN.js";
4
+ import { t as a } from "../main-BRPP6Mvf.js";
5
5
  import o from "react";
6
6
  import { createRoot as s } from "react-dom/client";
7
7
  var c = (0, (/* @__PURE__ */ e(i(), 1)).default)("pie-element:extended-text-entry:print"), l = (e, n) => {
@@ -8,8 +8,9 @@ import p from "@pie-lib/editable-html-tip-tap";
8
8
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
9
  import g from "@pie-lib/translator";
10
10
  import { InputContainer as _ } from "@pie-lib/config-ui";
11
+ import { sanitizeModelHtml as v } from "@pie-element/shared-utils";
11
12
  //#region src/delivery/annotation/annotation-editor.tsx
12
- var { translator: v } = g, y = f("div")({
13
+ var { translator: y } = g, b = f("div")({
13
14
  padding: "10px 120px 10px 16px",
14
15
  backgroundColor: "rgba(0, 0, 0, 0.06)",
15
16
  border: "1px solid #ccc",
@@ -25,21 +26,21 @@ var { translator: v } = g, y = f("div")({
25
26
  "-moz-user-select": "none",
26
27
  "-ms-user-select": "none"
27
28
  }
28
- }), b = f("div")({ width: "230px" }), x = f("div")({
29
+ }), x = f("div")({ width: "230px" }), S = f("div")({
29
30
  position: "relative",
30
31
  overflowX: "hidden",
31
32
  display: "flex"
32
- }), S = f(_)(({ theme: e }) => ({
33
+ }), C = f(_)(({ theme: e }) => ({
33
34
  paddingTop: e.spacing(2),
34
35
  marginBottom: e.spacing(2),
35
36
  marginTop: e.spacing(2),
36
37
  width: "100%"
37
- })), C = "\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: \"\";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n";
38
+ })), w = "\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: \"\";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n";
38
39
  if (!document.getElementById("annotation-editor-styles")) {
39
40
  let e = document.createElement("style");
40
- e.id = "annotation-editor-styles", e.textContent = C, document.head.appendChild(e);
41
+ e.id = "annotation-editor-styles", e.textContent = w, document.head.appendChild(e);
41
42
  }
42
- var w = class extends u.Component {
43
+ var T = class extends u.Component {
43
44
  static propTypes = {
44
45
  text: d.string,
45
46
  comment: d.string,
@@ -158,7 +159,7 @@ var w = class extends u.Component {
158
159
  e.dataset.id = r, e.className = `annotation ${o}`, e.style.position = "relative", e.style.cursor = "pointer", o === "positive" ? e.style.backgroundColor = "rgb(51, 255, 51, 0.5)" : o === "negative" && (e.style.backgroundColor = "rgba(255, 102, 204, 0.4)"), e.onclick = !n && this.handleClick, e.onmouseover = this.handleHover, e.onmouseout = this.handleCancelHover;
159
160
  });
160
161
  let s = e && e[0] || {}, c = document.createElement("SPAN");
161
- if (c.dataset.annId = r, c.innerHTML = i, c.onclick = !n && this.handleClick, c.onmouseover = this.handleHover, c.onmouseout = this.handleCancelHover, a(i)) {
162
+ if (c.dataset.annId = r, c.innerHTML = v(i), c.onclick = !n && this.handleClick, c.onmouseover = this.handleHover, c.onmouseout = this.handleCancelHover, a(i)) {
162
163
  let e = (s.offsetTop ? s.offsetTop : s.offsetParent.offsetTop) - this.textRef.scrollTop, t = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;
163
164
  c.dataset.freeform = !0, c.className = `sideAnnotation ${o}`, c.style.position = "absolute", c.style.padding = "4px", c.style.borderRadius = "4px", c.style.marginLeft = "8px", c.style.width = "180px", c.style.whiteSpace = "pre-wrap", c.style.wordBreak = "break-word", c.style.border = "2px solid #ffffff", c.style.fontSize = "14px", c.style.fontStyle = "normal", c.style.fontWeight = "normal", c.style.top = `${e}px`, c.style.left = `${t}px`, o === "negative" ? c.style.backgroundColor = "rgb(255, 204, 238)" : o === "positive" && (c.style.backgroundColor = "rgb(153, 255, 153)"), c.style.setProperty("--before-border-width", "7px"), c.style.setProperty("--before-top", "5px"), c.style.setProperty("--before-right", "100%"), o === "negative" ? c.style.setProperty("--before-border-color", "rgb(255, 204, 238)") : o === "positive" && c.style.setProperty("--before-border-color", "rgb(153, 255, 153)"), this.labelsRef.appendChild(c);
164
165
  } else c.className = `annotationLabel ${o}`, c.style.backgroundColor = "rgb(242, 242, 242)", c.style.padding = "2px", c.style.position = "absolute", c.style.userSelect = "none", c.style.whiteSpace = "nowrap", c.style.top = "-10px", c.style.left = "-2px", c.style.fontSize = "12px", c.style.fontStyle = "normal", c.style.fontWeight = "normal", c.style.lineHeight = "6px", c.style.webkitUserSelect = "none", c.style.mozUserSelect = "none", c.style.msUserSelect = "none", o === "positive" ? c.style.color = "rgb(0, 128, 0)" : o === "negative" && (c.style.color = "rgb(204, 0, 136)"), s.appendChild(c);
@@ -209,7 +210,7 @@ var w = class extends u.Component {
209
210
  };
210
211
  updateLabel = (e, t, n) => {
211
212
  let { selectedElems: r, labelElem: i } = this.state, { label: o, type: s } = t;
212
- a(o) && a(e) || !a(o) && !a(e) ? (i.innerHTML = o, n && (i.classList.remove(n), i.classList.add(s), r.forEach((e) => {
213
+ a(o) && a(e) || !a(o) && !a(e) ? (i.innerHTML = v(o), n && (i.classList.remove(n), i.classList.add(s), r.forEach((e) => {
213
214
  e.classList.remove(n), e.classList.add(s);
214
215
  }))) : a(o) && !a(e) ? (r[0].removeChild(i), this.createDOMAnnotation(r, t)) : !a(o) && a(e) && (this.labelsRef.removeChild(i), this.createDOMAnnotation(r, t));
215
216
  };
@@ -234,9 +235,9 @@ var w = class extends u.Component {
234
235
  this.textRef.removeEventListener("scroll", this.adjustAnnotationsPosition);
235
236
  }
236
237
  render() {
237
- let { comment: t, customKeys: n, disabled: r, disabledMath: i, keypadMode: a, height: o, language: s, width: u, maxHeight: d, onCommentChange: f, predefinedAnnotations: g, text: _ } = this.props, { anchorEl: C, annotation: w, openedMenu: T, openedEditor: E, selectionDetails: D } = this.state, O = C && (C.offsetTop ? C.offsetTop : C.offsetParent.offsetTop), k = this.textRef && O ? O - this.textRef.scrollTop - 8 : 0, A = v.t("extendedTextEntry.comment", { lng: s });
238
+ let { comment: t, customKeys: n, disabled: r, disabledMath: i, keypadMode: a, height: o, language: s, width: u, maxHeight: d, onCommentChange: f, predefinedAnnotations: g, text: _ } = this.props, { anchorEl: w, annotation: T, openedMenu: E, openedEditor: D, selectionDetails: O } = this.state, k = w && (w.offsetTop ? w.offsetTop : w.offsetParent.offsetTop), A = this.textRef && k ? k - this.textRef.scrollTop - 8 : 0, j = y.t("extendedTextEntry.comment", { lng: s });
238
239
  return /* @__PURE__ */ h("div", { children: [
239
- /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(y, {
240
+ /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(b, {
240
241
  style: {
241
242
  width: u - 34,
242
243
  minHeight: o,
@@ -245,17 +246,17 @@ var w = class extends u.Component {
245
246
  ref: (e) => this.textRef = e,
246
247
  onMouseDown: r ? () => {} : e,
247
248
  onMouseUp: r ? () => {} : this.handleSelection,
248
- dangerouslySetInnerHTML: { __html: _ }
249
- }), /* @__PURE__ */ m(b, { ref: (e) => this.labelsRef = e })] }),
250
- /* @__PURE__ */ m(S, {
251
- label: A,
249
+ dangerouslySetInnerHTML: { __html: v(_) }
250
+ }), /* @__PURE__ */ m(x, { ref: (e) => this.labelsRef = e })] }),
251
+ /* @__PURE__ */ m(C, {
252
+ label: j,
252
253
  children: /* @__PURE__ */ m(p, {
253
254
  className: "prompt",
254
255
  markup: t || "",
255
256
  onChange: f,
256
257
  width: u && (u + 104).toString(),
257
258
  disabled: r,
258
- ariaLabel: A,
259
+ ariaLabel: j,
259
260
  language: s,
260
261
  pluginProps: {
261
262
  math: {
@@ -272,10 +273,10 @@ var w = class extends u.Component {
272
273
  })
273
274
  }),
274
275
  /* @__PURE__ */ m(l, {
275
- anchorEl: C,
276
- open: T && !r,
276
+ anchorEl: w,
277
+ open: E && !r,
277
278
  annotations: g,
278
- isNewAnnotation: !!D,
279
+ isNewAnnotation: !!O,
279
280
  onClose: this.handleClose,
280
281
  onDelete: this.deleteAnnotation,
281
282
  onEdit: this.editAnnotation,
@@ -284,10 +285,10 @@ var w = class extends u.Component {
284
285
  }),
285
286
  /* @__PURE__ */ m(c, {
286
287
  anchorEl: this.textRef,
287
- open: E && !r,
288
- offset: k,
289
- value: w && w.label || "",
290
- type: w && w.type,
288
+ open: D && !r,
289
+ offset: A,
290
+ value: T && T.label || "",
291
+ type: T && T.type,
291
292
  onClose: this.handleClose,
292
293
  onDelete: this.deleteAnnotation,
293
294
  onSave: this.updateAnnotation,
@@ -297,4 +298,4 @@ var w = class extends u.Component {
297
298
  }
298
299
  };
299
300
  //#endregion
300
- export { w as default };
301
+ export { T as default };