@pie-element/extended-text-entry 15.1.2-next.1 → 15.1.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.
- package/CHANGELOG.json +1282 -0
- package/CHANGELOG.md +2270 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +922 -0
- package/configure/CHANGELOG.md +1959 -0
- package/configure/lib/defaults.js +224 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +125 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +247 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +23 -0
- package/controller/CHANGELOG.json +362 -0
- package/controller/CHANGELOG.md +1183 -0
- package/controller/lib/defaults.js +91 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +101 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +16 -0
- package/docs/config-schema.json +1782 -0
- package/docs/config-schema.json.md +1333 -0
- package/docs/demo/config.js +7 -0
- package/docs/demo/generate.js +14 -0
- package/docs/demo/index.html +3 -0
- package/docs/demo/session.js +7 -0
- package/docs/pie-schema.json +954 -0
- package/docs/pie-schema.json.md +717 -0
- package/lib/annotation/annotation-editor.js +636 -0
- package/lib/annotation/annotation-editor.js.map +1 -0
- package/lib/annotation/annotation-menu.js +147 -0
- package/lib/annotation/annotation-menu.js.map +1 -0
- package/lib/annotation/annotation-utils.js +205 -0
- package/lib/annotation/annotation-utils.js.map +1 -0
- package/lib/annotation/freeform-editor.js +241 -0
- package/lib/annotation/freeform-editor.js.map +1 -0
- package/lib/index.js +108 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +205 -0
- package/lib/main.js.map +1 -0
- package/lib/print.js +86 -0
- package/lib/print.js.map +1 -0
- package/module/configure.js +1 -0
- package/module/controller.js +139 -0
- package/module/demo.js +38 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +22 -0
- package/module/print-demo.js +76 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +22 -88
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/defaults.d.ts +0 -166
- package/dist/author/defaults.js +0 -209
- package/dist/author/index.d.ts +0 -52
- package/dist/author/index.js +0 -74
- package/dist/author/main.d.ts +0 -26
- package/dist/author/main.js +0 -166
- package/dist/browser/author/index.js +0 -495
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-kkT1XVKw.js +0 -219
- package/dist/browser/browser-kkT1XVKw.js.map +0 -1
- package/dist/browser/controller/index.js +0 -184
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -98
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-CfUys1Kx.js +0 -47872
- package/dist/browser/dist-CfUys1Kx.js.map +0 -1
- package/dist/browser/extended-text-entry.css +0 -2
- package/dist/browser/main-BVg6yw7a.js +0 -714
- package/dist/browser/main-BVg6yw7a.js.map +0 -1
- package/dist/browser/print/index.js +0 -48
- package/dist/browser/print/index.js.map +0 -1
- package/dist/controller/defaults.d.ts +0 -33
- package/dist/controller/defaults.js +0 -104
- package/dist/controller/index.d.ts +0 -59
- package/dist/controller/index.js +0 -72
- package/dist/delivery/annotation/annotation-editor.d.ts +0 -47
- package/dist/delivery/annotation/annotation-editor.js +0 -296
- package/dist/delivery/annotation/annotation-menu.d.ts +0 -25
- package/dist/delivery/annotation/annotation-menu.js +0 -113
- package/dist/delivery/annotation/annotation-utils.d.ts +0 -20
- package/dist/delivery/annotation/annotation-utils.js +0 -65
- package/dist/delivery/annotation/freeform-editor.d.ts +0 -30
- package/dist/delivery/annotation/freeform-editor.js +0 -143
- package/dist/delivery/index.d.ts +0 -23
- package/dist/delivery/index.js +0 -68
- package/dist/delivery/main.d.ts +0 -27
- package/dist/delivery/main.js +0 -134
- package/dist/extended-text-entry.css +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -403
- package/dist/index.js +0 -2
- package/dist/print/index.d.ts +0 -15
- package/dist/print/index.js +0 -48
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main-BVg6yw7a.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 * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\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","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/freeform-editor.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Popover, TextField } from '@mui/material';\nimport { styled } from '@mui/material/styles';\n\nconst StyledPopover: any = styled(Popover)(({ theme, 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: theme.palette.grey[100],\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\nconst Wrapper: any = styled('div')(({ theme, annotationType }) => ({\n width: '200px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: '#ffffff',\n border: `4px solid ${theme.palette.grey[100]}`,\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')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\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 ${theme.palette.grey[100]}`,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'negative' && {\n '&:hover': {\n backgroundColor: 'rgb(153, 255, 153) !important',\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'positive' && {\n '&:hover': {\n backgroundColor: 'rgb(255, 204, 238) !important',\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 }\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=\"annotation-editor\"\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/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-menu.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { Popover } from '@mui/material';\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: 'black',\n },\n },\n});\n\nconst MainWrapper: any = styled('div')(({ theme }) => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: theme.palette.common.white,\n border: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst AnnotationsWrapper: any = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper: any = styled('div')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst Button: any = styled('div')(({ theme, variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${theme.palette.grey[100]}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${theme.palette.grey[100]}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\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/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-editor.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\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';\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 };\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 = 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 = 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 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\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: text }}\n />\n <LabelsContainer ref={(r) => (this.labelsRef = r)} />\n </Wrapper>\n\n <CommentContainer label={'Comment'}>\n <EditableHtml\n className=\"prompt\"\n markup={comment || ''}\n onChange={onCommentChange}\n width={width && (width + 104).toString()}\n disabled={disabled}\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/**\n * @synced-from pie-elements/packages/extended-text-entry/src/main.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce } from '@pie-element/shared-lodash';\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 AnnotationEditor from './annotation/annotation-editor.js';\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}));\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 changeSessionValue = debounce(this.props.onValueChange, 1500);\n\n changeSessionComment = debounce(this.props.onCommentChange, 1500);\n\n render() {\n const { model, session, onAnnotationsChange } = 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 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>Constructed Response Question</SrOnly>\n\n {teacherInstructions && (\n <TeacherInstructions>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </TeacherInstructions>\n )}\n\n {prompt && (\n <StyledPrompt component={'span'}>\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={this.changeSessionComment}\n width={width}\n height={height}\n maxHeight={maxHeight}\n disabled={disabledAnnotator}\n disabledMath={!mathInput}\n customKeys={customKeys}\n keypadMode={equationEditor}\n />\n ) : (\n <Editor\n className=\"response-area-editor\"\n onChange={this.changeSessionValue}\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 }}\n languageCharactersProps={languageCharactersProps}\n />\n )}\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </MainContainer>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;kEAWA,KAAA,GAAA,GAAA,MAAA;;;;;AAwBA,GAGA,KAAA,GAAA,GAAA,MAAA;;;;;;;;;;;AAqBA,GAKA,KAAA,MAAA;;;;;;;;;AAsDA,GAEA,KAAA,MAAA;;;AAMA,GAGA,KAAA,MAAA;;;;;;;;;;;;;;;AAkCA,GAGA,KAAA,GAAA,MAAA;;;;;;;;;AAgBA,GAGA,KAAA,GAAA,MAAA;;;;;;;AAkBA,GAGA,UAAA;;AAmBA,GAGA,KAAA,MAAA,EAAA,UAAA,MAAA,EAAA,OAAA,YAAA,MAAA,IAEA,KAAA,MAAA,MAAA,KAAA,SAAA,iBAAA,aAAA,EAAA,GAAA,CAAA,GAEA,KAAA,MAAA,SAAA,cAAA,iBAAA,EAAA,GAAA,GCzNM,IAAqB,EAAO,CAAO,GAAG,EAAE,UAAO,yBAAsB,EACzE,oBAAoB;CAClB,WAAW;CACX,WAAW;CACX,YAAY;CACZ,aAAa;EACX,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
|
-
import { a as e, t } from "../browser-kkT1XVKw.js";
|
|
2
|
-
import { d as n, v as r, y as i } from "../dist-CfUys1Kx.js";
|
|
3
|
-
import { t as a } from "../main-BVg6yw7a.js";
|
|
4
|
-
import o from "react";
|
|
5
|
-
import { createRoot as s } from "react-dom/client";
|
|
6
|
-
var c = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entry:print"), l = (e, t) => {
|
|
7
|
-
let n = t.role === "instructor", r = i(e);
|
|
8
|
-
return r.prompt = r.promptEnabled === !1 ? void 0 : r.prompt, r.teacherInstructions = n && r.teacherInstructionsEnabled !== !1 ? r.teacherInstructions : void 0, r.showTeacherInstructions = n, r.mode = n ? "evaluate" : r.mode, r.dimensions = {
|
|
9
|
-
height: 100,
|
|
10
|
-
width: 500,
|
|
11
|
-
...r.dimensions
|
|
12
|
-
}, r.disabled = !0, r.feedback = void 0, r.animationsDisabled = !0, r;
|
|
13
|
-
}, u = class extends HTMLElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = r(() => {
|
|
16
|
-
if (this._model && this._session && this._options) {
|
|
17
|
-
let e = l(this._model, this._options), t = o.createElement(a, {
|
|
18
|
-
model: e,
|
|
19
|
-
session: {},
|
|
20
|
-
onChange: () => {},
|
|
21
|
-
onValueChange: () => {},
|
|
22
|
-
onAnnotationsChange: () => {},
|
|
23
|
-
onCommentChange: () => {}
|
|
24
|
-
});
|
|
25
|
-
this._root ||= s(this), this._root.render(t), queueMicrotask(() => {
|
|
26
|
-
c("render complete - render math"), n(this);
|
|
27
|
-
});
|
|
28
|
-
} else c("skip");
|
|
29
|
-
}, 50, {
|
|
30
|
-
leading: !1,
|
|
31
|
-
trailing: !0
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
set options(e) {
|
|
35
|
-
this._options = e, this._rerender();
|
|
36
|
-
}
|
|
37
|
-
set model(e) {
|
|
38
|
-
this._model = e, this._rerender();
|
|
39
|
-
}
|
|
40
|
-
connectedCallback() {}
|
|
41
|
-
disconnectedCallback() {
|
|
42
|
-
this._root && this._root.unmount();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
export { u as default };
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/print/index.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/print.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { cloneDeep, debounce } from '@pie-element/shared-lodash';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nimport debug from 'debug';\n\nconst log = debug('pie-element:extended-text-entry:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n const printModel = cloneDeep(model);\n\n printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;\n printModel.teacherInstructions =\n instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;\n printModel.showTeacherInstructions = instr;\n printModel.mode = instr ? 'evaluate' : printModel.mode;\n\n const defaultDimensions = { height: 100, width: 500 };\n\n printModel.dimensions = {\n ...defaultDimensions,\n ...printModel.dimensions,\n };\n\n printModel.disabled = true;\n printModel.feedback = undefined;\n printModel.animationsDisabled = true;\n\n return printModel;\n};\n\nexport default class ExtendedTextEntryPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session && this._options) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element = React.createElement(Main, {\n model: printModel,\n session: {},\n onChange: () => {},\n onValueChange: () => {},\n onAnnotationsChange: () => {},\n onCommentChange: () => {},\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n queueMicrotask(() => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n // re-render so role changes (student/instructor) propagate\n this._rerender();\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;AAkBA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,uCAAuC,GAEnD,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS,cACtB,IAAa,EAAU,CAAK;CAmBlC,OAjBA,EAAW,SAAS,EAAW,kBAAkB,KAA4B,KAAA,IAApB,EAAW,QACpE,EAAW,sBACT,KAAS,EAAW,+BAA+B,KAAQ,EAAW,sBAAsB,KAAA,GAC9F,EAAW,0BAA0B,GACrC,EAAW,OAAO,IAAQ,aAAa,EAAW,MAIlD,EAAW,aAAa;EAFI,QAAQ;EAAK,OAAO;EAI9C,GAAG,EAAW;CAChB,GAEA,EAAW,WAAW,IACtB,EAAW,WAAW,KAAA,GACtB,EAAW,qBAAqB,IAEzB;AACT,GAEqB,IAArB,cAAoD,YAAY;CAC9D,cAAc;EAMZ,AALA,MAAM,GACN,KAAK,WAAW,MAChB,KAAK,SAAS,MACd,KAAK,WAAW,CAAC,GACjB,KAAK,QAAQ,MACb,KAAK,YAAY,QACT;GACJ,IAAI,KAAK,UAAU,KAAK,YAAY,KAAK,UAAU;IACjD,IAAM,IAAa,EAAkB,KAAK,QAAQ,KAAK,QAAQ,GAEzD,IAAU,EAAM,cAAc,GAAM;KACxC,OAAO;KACP,SAAS,CAAC;KACV,gBAAgB,CAAC;KACjB,qBAAqB,CAAC;KACtB,2BAA2B,CAAC;KAC5B,uBAAuB,CAAC;IAC1B,CAAC;IAMD,AAJA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO,GACzB,qBAAqB;KAEnB,AADA,EAAI,+BAA+B,GACnC,EAAW,IAAI;IACjB,CAAC;GACH,OACE,EAAI,MAAM;EAEd,GACA,IACA;GAAE,SAAS;GAAO,UAAU;EAAK,CACnC;CACF;CACA,IAAI,QAAQ,GAAG;EAGb,AAFA,KAAK,WAAW,GAEhB,KAAK,UAAU;CACjB;CAEA,IAAI,MAAM,GAAG;EAEX,AADA,KAAK,SAAS,GACd,KAAK,UAAU;CACjB;CAEA,oBAAoB,CAAC;CAErB,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/extended-text-entry/controller/src/defaults.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
annotationsEnabled: boolean;
|
|
11
|
-
dimensions: {
|
|
12
|
-
height: number;
|
|
13
|
-
width: number;
|
|
14
|
-
};
|
|
15
|
-
equationEditor: string;
|
|
16
|
-
feedbackEnabled: boolean;
|
|
17
|
-
mathInput: boolean;
|
|
18
|
-
playerSpellCheckDisabled: boolean;
|
|
19
|
-
predefinedAnnotations: {
|
|
20
|
-
label: string;
|
|
21
|
-
text: string;
|
|
22
|
-
type: string;
|
|
23
|
-
}[];
|
|
24
|
-
prompt: string;
|
|
25
|
-
promptEnabled: boolean;
|
|
26
|
-
rationale: string;
|
|
27
|
-
rationaleEnabled: boolean;
|
|
28
|
-
studentInstructionsEnabled: boolean;
|
|
29
|
-
teacherInstructions: string;
|
|
30
|
-
teacherInstructionsEnabled: boolean;
|
|
31
|
-
toolbarEditorPosition: string;
|
|
32
|
-
};
|
|
33
|
-
export default _default;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
//#region src/controller/defaults.ts
|
|
2
|
-
var e = {
|
|
3
|
-
annotationsEnabled: !1,
|
|
4
|
-
dimensions: {
|
|
5
|
-
height: 100,
|
|
6
|
-
width: 500
|
|
7
|
-
},
|
|
8
|
-
equationEditor: "Grade 8 - HS",
|
|
9
|
-
feedbackEnabled: !1,
|
|
10
|
-
mathInput: !1,
|
|
11
|
-
playerSpellCheckDisabled: !0,
|
|
12
|
-
predefinedAnnotations: [
|
|
13
|
-
{
|
|
14
|
-
label: "good",
|
|
15
|
-
text: "good",
|
|
16
|
-
type: "positive"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "★",
|
|
20
|
-
text: "★",
|
|
21
|
-
type: "positive"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: ":-)",
|
|
25
|
-
text: ":-)",
|
|
26
|
-
type: "positive"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "creative",
|
|
30
|
-
text: "creative",
|
|
31
|
-
type: "positive"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: "run-on",
|
|
35
|
-
text: "run-on",
|
|
36
|
-
type: "negative"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: "frag",
|
|
40
|
-
text: "fragment",
|
|
41
|
-
type: "negative"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "tran",
|
|
45
|
-
text: "transition",
|
|
46
|
-
type: "negative"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: "supp",
|
|
50
|
-
text: "support needed",
|
|
51
|
-
type: "negative"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: "punc",
|
|
55
|
-
text: "punctuation",
|
|
56
|
-
type: "negative"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
label: "agr",
|
|
60
|
-
text: "agreement wrong",
|
|
61
|
-
type: "negative"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "unclear",
|
|
65
|
-
text: "unclear",
|
|
66
|
-
type: "negative"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: "cut",
|
|
70
|
-
text: "cut",
|
|
71
|
-
type: "negative"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: "sp",
|
|
75
|
-
text: "spelling",
|
|
76
|
-
type: "negative"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
label: "cap",
|
|
80
|
-
text: "capitalization",
|
|
81
|
-
type: "negative"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: "inf",
|
|
85
|
-
text: "informal",
|
|
86
|
-
type: "negative"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
label: "awk",
|
|
90
|
-
text: "awkward",
|
|
91
|
-
type: "negative"
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
prompt: "",
|
|
95
|
-
promptEnabled: !0,
|
|
96
|
-
rationale: "",
|
|
97
|
-
rationaleEnabled: !0,
|
|
98
|
-
studentInstructionsEnabled: !0,
|
|
99
|
-
teacherInstructions: "",
|
|
100
|
-
teacherInstructionsEnabled: !0,
|
|
101
|
-
toolbarEditorPosition: "bottom"
|
|
102
|
-
};
|
|
103
|
-
//#endregion
|
|
104
|
-
export { e as default };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/extended-text-entry/controller/src/index.js
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createDefaultModel(model?: {}): Promise<{
|
|
10
|
-
annotationsEnabled: boolean;
|
|
11
|
-
dimensions: {
|
|
12
|
-
height: number;
|
|
13
|
-
width: number;
|
|
14
|
-
};
|
|
15
|
-
equationEditor: string;
|
|
16
|
-
feedbackEnabled: boolean;
|
|
17
|
-
mathInput: boolean;
|
|
18
|
-
playerSpellCheckDisabled: boolean;
|
|
19
|
-
predefinedAnnotations: {
|
|
20
|
-
label: string;
|
|
21
|
-
text: string;
|
|
22
|
-
type: string;
|
|
23
|
-
}[];
|
|
24
|
-
prompt: string;
|
|
25
|
-
promptEnabled: boolean;
|
|
26
|
-
rationale: string;
|
|
27
|
-
rationaleEnabled: boolean;
|
|
28
|
-
studentInstructionsEnabled: boolean;
|
|
29
|
-
teacherInstructions: string;
|
|
30
|
-
teacherInstructionsEnabled: boolean;
|
|
31
|
-
toolbarEditorPosition: string;
|
|
32
|
-
}>;
|
|
33
|
-
export declare const normalize: (question: any) => any;
|
|
34
|
-
export declare function model(question: any, session: any, env: any): Promise<{
|
|
35
|
-
prompt: any;
|
|
36
|
-
dimensions: any;
|
|
37
|
-
customKeys: any;
|
|
38
|
-
id: any;
|
|
39
|
-
disabled: boolean;
|
|
40
|
-
feedback: string | undefined;
|
|
41
|
-
teacherInstructions: any;
|
|
42
|
-
language: any;
|
|
43
|
-
mathInput: any;
|
|
44
|
-
spanishInput: any;
|
|
45
|
-
specialInput: any;
|
|
46
|
-
equationEditor: any;
|
|
47
|
-
spellCheckEnabled: boolean;
|
|
48
|
-
playersToolbarPosition: any;
|
|
49
|
-
annotatorMode: any;
|
|
50
|
-
disabledAnnotator: boolean;
|
|
51
|
-
predefinedAnnotations: any;
|
|
52
|
-
extraCSSRules: any;
|
|
53
|
-
}>;
|
|
54
|
-
export declare function outcome(): Promise<{
|
|
55
|
-
score: number;
|
|
56
|
-
completed: string;
|
|
57
|
-
note: string;
|
|
58
|
-
}>;
|
|
59
|
-
export declare const validate: (model?: {}, config?: {}) => {};
|
package/dist/controller/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import e from "./defaults.js";
|
|
2
|
-
import t from "debug";
|
|
3
|
-
import { getFeedback as n } from "@pie-element/shared-feedback";
|
|
4
|
-
//#region src/controller/index.ts
|
|
5
|
-
var r = t("@pie-element:extended-text-entry:controller");
|
|
6
|
-
async function i(t = {}) {
|
|
7
|
-
return r("[createDefaultModel]", t), {
|
|
8
|
-
...e,
|
|
9
|
-
...t
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
var a = (t) => ({
|
|
13
|
-
...e,
|
|
14
|
-
...t
|
|
15
|
-
});
|
|
16
|
-
async function o(e, t, i) {
|
|
17
|
-
r("[question]", e);
|
|
18
|
-
let o = a(e), s = i.mode === "evaluate" && o.feedbackEnabled ? n(o.feedback, "Your answer has been submitted") : Promise.resolve(void 0), c = null;
|
|
19
|
-
c = i.role === "instructor" && (i.mode === "view" || i.mode === "evaluate") && o.teacherInstructionsEnabled ? o.teacherInstructions : null;
|
|
20
|
-
let l = o.equationEditor || "miscellaneous";
|
|
21
|
-
switch (o.equationEditor) {
|
|
22
|
-
case "Grade 1 - 2":
|
|
23
|
-
l = 1;
|
|
24
|
-
break;
|
|
25
|
-
case "Grade 3 - 5":
|
|
26
|
-
l = 3;
|
|
27
|
-
break;
|
|
28
|
-
case "Grade 6 - 7":
|
|
29
|
-
l = 6;
|
|
30
|
-
break;
|
|
31
|
-
case "Grade 8 - HS":
|
|
32
|
-
l = 8;
|
|
33
|
-
break;
|
|
34
|
-
default: break;
|
|
35
|
-
}
|
|
36
|
-
let u = o.annotationsEnabled && (i.role === "instructor" || i.mode === "evaluate");
|
|
37
|
-
return s.then((e) => ({
|
|
38
|
-
prompt: o.promptEnabled ? o.prompt : null,
|
|
39
|
-
dimensions: o.dimensions,
|
|
40
|
-
customKeys: o.customKeys || [],
|
|
41
|
-
id: o.id,
|
|
42
|
-
disabled: i.mode !== "gather",
|
|
43
|
-
feedback: e,
|
|
44
|
-
teacherInstructions: c,
|
|
45
|
-
language: o.language,
|
|
46
|
-
mathInput: o.mathInput,
|
|
47
|
-
spanishInput: o.spanishInput,
|
|
48
|
-
specialInput: o.specialInput,
|
|
49
|
-
equationEditor: l,
|
|
50
|
-
spellCheckEnabled: !o.playerSpellCheckDisabled,
|
|
51
|
-
playersToolbarPosition: o.playersToolbarPosition || "bottom",
|
|
52
|
-
annotatorMode: u,
|
|
53
|
-
disabledAnnotator: o.annotationsEnabled ? i.role !== "instructor" : !0,
|
|
54
|
-
predefinedAnnotations: o.annotationsEnabled ? o.predefinedAnnotations : [],
|
|
55
|
-
extraCSSRules: o.extraCSSRules
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
async function s() {
|
|
59
|
-
return {
|
|
60
|
-
score: 0,
|
|
61
|
-
completed: "n/a",
|
|
62
|
-
note: "Requires manual scoring"
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
var c = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), l = (e = {}, t = {}) => {
|
|
66
|
-
let n = {};
|
|
67
|
-
return ["teacherInstructions", "prompt"].forEach((r) => {
|
|
68
|
-
t[r]?.required && !c(e[r]) && (n[r] = "This field is required.");
|
|
69
|
-
}), n;
|
|
70
|
-
};
|
|
71
|
-
//#endregion
|
|
72
|
-
export { i as createDefaultModel, o as model, a as normalize, s as outcome, l as validate };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-editor.jsx
|
|
3
|
-
* @auto-generated
|
|
4
|
-
*
|
|
5
|
-
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
-
* Manual edits will be overwritten on next sync.
|
|
7
|
-
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
-
*/
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
declare class AnnotationEditor extends React.Component {
|
|
12
|
-
static propTypes: {
|
|
13
|
-
text: PropTypes.Requireable<string>;
|
|
14
|
-
comment: PropTypes.Requireable<string>;
|
|
15
|
-
annotations: PropTypes.Requireable<any[]>;
|
|
16
|
-
predefinedAnnotations: PropTypes.Requireable<any[]>;
|
|
17
|
-
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
-
onCommentChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
-
width: PropTypes.Requireable<number>;
|
|
20
|
-
height: PropTypes.Requireable<number>;
|
|
21
|
-
maxHeight: PropTypes.Requireable<string>;
|
|
22
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
23
|
-
disabledMath: PropTypes.Requireable<boolean>;
|
|
24
|
-
customKeys: PropTypes.Requireable<any[]>;
|
|
25
|
-
keypadMode: PropTypes.Requireable<string>;
|
|
26
|
-
};
|
|
27
|
-
constructor(props: any);
|
|
28
|
-
componentDidMount(): void;
|
|
29
|
-
adjustAnnotationsPosition: any;
|
|
30
|
-
handleClick: any;
|
|
31
|
-
handleHover: any;
|
|
32
|
-
handleCancelHover: any;
|
|
33
|
-
handleClose: any;
|
|
34
|
-
handleSelection: any;
|
|
35
|
-
deleteAnnotation: any;
|
|
36
|
-
createDOMAnnotation: any;
|
|
37
|
-
createNewAnnotation: any;
|
|
38
|
-
handleMenuClick: any;
|
|
39
|
-
editAnnotation: any;
|
|
40
|
-
addAnnotation: any;
|
|
41
|
-
updateLabel: any;
|
|
42
|
-
changeAnnotationType: any;
|
|
43
|
-
updateAnnotation: any;
|
|
44
|
-
componentWillUnmount(): void;
|
|
45
|
-
render(): React.JSX.Element;
|
|
46
|
-
}
|
|
47
|
-
export default AnnotationEditor;
|