@pega/cosmos-react-rte 8.0.1 → 8.2.0

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.
Files changed (29) hide show
  1. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +1 -1
  2. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  3. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  4. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +1 -332
  5. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
  6. package/lib/components/DynamicContentEditor/PegaCustomElement.js.map +1 -1
  7. package/lib/components/Editor/Editor.d.ts.map +1 -1
  8. package/lib/components/Editor/Editor.styles.d.ts.map +1 -1
  9. package/lib/components/Editor/FileItemElement.d.ts +1 -336
  10. package/lib/components/Editor/FileItemElement.d.ts.map +1 -1
  11. package/lib/components/Editor/FileItemElement.js +1 -2
  12. package/lib/components/Editor/FileItemElement.js.map +1 -1
  13. package/lib/components/Editor/Toolbar/TextSelect.d.ts.map +1 -1
  14. package/lib/components/RichTextEditor/DecoratorComponents/BlockQuote.d.ts.map +1 -1
  15. package/lib/components/RichTextEditor/DecoratorComponents/Code.d.ts.map +1 -1
  16. package/lib/components/RichTextEditor/DecoratorComponents/CodeBlock.d.ts.map +1 -1
  17. package/lib/components/RichTextEditor/DecoratorComponents/HorizontalRule.d.ts.map +1 -1
  18. package/lib/components/RichTextEditor/DecoratorComponents/Image.d.ts.map +1 -1
  19. package/lib/components/RichTextEditor/Toolbar/ToolbarButton.d.ts.map +1 -1
  20. package/lib/components/RichTextEditor/Toolbar/ToolbarButton.js +12 -3
  21. package/lib/components/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  22. package/lib/components/RichTextEditor/Toolbar/utils.d.ts.map +1 -1
  23. package/lib/components/RichTextEditor/utils/htmlConverter.d.ts.map +1 -1
  24. package/lib/components/RichTextEditor/utils/interactionRenderer.d.ts.map +1 -1
  25. package/lib/components/RichTextEditor/utils/markdownConverter.d.ts.map +1 -1
  26. package/lib/components/RichTextEditor/utils/renderers.d.ts.map +1 -1
  27. package/lib/components/RichTextEditor/utils/search.d.ts.map +1 -1
  28. package/lib/components/RichTextEditor/utils/slateConverter.d.ts.map +1 -1
  29. package/package.json +3 -8
@@ -3,7 +3,7 @@ import { forwardRef, useRef, useEffect, useState } from 'react';
3
3
  import styled from 'styled-components';
4
4
  import { Button, defaultThemeProp, Menu, menuHelpers, Modal, Popover, StyledPopover, useModalManager, useConsolidatedRef, useI18n, useUID, useTestIds, withTestIds, registerIcon } from '@pega/cosmos-react-core';
5
5
  import * as codeIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/code.icon';
6
- import { getKeyCommand } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/Toolbar/utils';
6
+ import { getKeyCommand } from '../RichTextEditor/Toolbar/utils';
7
7
  import { Editor } from '../Editor';
8
8
  import { isFieldMenuItem } from './DynamicContentEditor.types';
9
9
  import { pegaReferenceElementStyle, createPegaReferenceElement } from './PegaCustomElement';
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/DynamicContentEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,yBAAyB,CAAC;AAMjC,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,oEAAoE,CAAC;AAEnG,OAAO,EAA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O,CAAC,WAAW;gBAClC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,GAAG,EAAE;oBAChB,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBACnD,CAAC;gBACD,MAAM,EAAE,eAAe;gBACvB,QAAQ,EAAE;oBACR,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,OAAO;oBACpB,OAAO,EAAE,aAAa;iBACvB;aACF;YACD,GAAG,aAAa;SACjB,EACD,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,EAAE,EAAE,CAAC;YACX,WAAW,EAAE,CAAC;QAChB,CAAC,EACD,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,YAEzB,qBAAqB,GACf,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useState } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\nimport type { Bookmark, Editor as TinyMCEEditor, EditorSelection } from 'tinymce';\n\nimport {\n Button,\n defaultThemeProp,\n Menu,\n menuHelpers,\n Modal,\n Popover,\n StyledPopover,\n useModalManager,\n useConsolidatedRef,\n useI18n,\n useUID,\n useTestIds,\n withTestIds,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n ModalMethods,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\nimport * as codeIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/code.icon';\nimport { getKeyCommand } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/Toolbar/utils';\n\nimport { Editor } from '../Editor';\nimport type { EditorProps } from '../Editor';\n\nimport { isFieldMenuItem } from './DynamicContentEditor.types';\nimport type { DynamicContentEditorProps, FieldItems, ItemType } from './DynamicContentEditor.types';\nimport { pegaReferenceElementStyle, createPegaReferenceElement } from './PegaCustomElement';\nimport { getDynamicContentEditorTestIds } from './DynamicContentEditor.test-ids';\n\nregisterIcon(codeIcon);\n\ntype DynamicContentEditorPropsWithDefaults = PropsWithDefaults<DynamicContentEditorProps>;\n\nconst StyledDynamicContentEditor = styled.div<DynamicContentEditorPropsWithDefaults>``;\n\nexport const StyledSearchPopover = styled(StyledPopover)`\n min-width: 20rem;\n`;\n\nStyledDynamicContentEditor.defaultProps = defaultThemeProp;\n\nconst DynamicContentEditor: ForwardRefForwardPropsComponent<DynamicContentEditorProps> = forwardRef(\n function DynamicContentEditor(\n {\n testId,\n form: { dynamicContentPicker, onSubmit },\n onActiveFieldChange,\n label,\n toolbar,\n fieldItems,\n defaultValue,\n onBlur,\n onKeyDown: onKeyDownProp,\n customActions = [],\n customComponents = [],\n ...restProps\n }: PropsWithoutRef<DynamicContentEditorProps>,\n ref: DynamicContentEditorProps['ref']\n ) {\n const testIds = useTestIds(testId, getDynamicContentEditorTestIds);\n const menuID = useUID();\n const { create } = useModalManager();\n const t = useI18n();\n\n const modalMethods = useRef<ModalMethods>();\n const [editor, setEditor] = useState<TinyMCEEditor | undefined>();\n const [bookmark, setBookmark] = useState<Bookmark | undefined>();\n const [fieldMenuItems, setFieldMenuItems] = useState<FieldItems[]>(fieldItems || []);\n const [currentElementId, setCurrentElementId] = useState('');\n const [currentElementContent, setCurrentElementContent] = useState('');\n const [currentElementNamespace, setCurrentElementNamespace] = useState('');\n const [currentCursorPosition, setCurrentCursorPosition] = useState({\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n toJSON: () => {}\n });\n const [showFieldsPopover, setShowFieldsPopover] = useState<boolean>(false);\n\n const fieldPopoverRef = useRef<HTMLDivElement>(null);\n const editorRef = useConsolidatedRef(ref);\n\n const tooltip = getKeyCommand(\n navigator.appVersion.includes('Mac'),\n ({ ctrl }) => `${t('rte_insert_field')} (${ctrl}/)`\n );\n\n const insertField = (field: ItemType) => {\n if (!editor) return;\n\n const fieldContent = `<pega-reference role=\"button\" contenteditable=\"false\" data-rule-type='field' data-rule-id=${\n field.id\n } ${field.namespace && `data-rule-namespace=${field.namespace}`}>${\n field.text\n }</pega-reference>`;\n if (bookmark) {\n editor.selection.moveToBookmark(bookmark);\n editor.selection.setContent(fieldContent);\n } else {\n editor.insertContent(fieldContent);\n }\n\n modalMethods.current?.dismiss();\n };\n\n const modalProps = {\n 'data-testid': testIds.insertFieldModal,\n children: dynamicContentPicker,\n heading: t('rte_insert_field'),\n actions: (\n <>\n <Button\n data-testid={testIds.insertFieldModalCancel}\n variant='secondary'\n onClick={() => modalMethods.current?.dismiss()}\n >\n {t('cancel')}\n </Button>\n <Button\n data-testid={testIds.insertFieldModalSubmit}\n variant='primary'\n onClick={() => onSubmit(insertField)}\n >\n {t('submit')}\n </Button>\n </>\n ),\n center: true,\n onAfterClose: () => {\n setBookmark(undefined);\n setCurrentElementId('');\n setCurrentElementContent('');\n setCurrentElementNamespace('');\n onActiveFieldChange({ id: '', text: '', namespace: '' });\n },\n onBeforeOpen: () => {\n if (currentElementId) {\n onActiveFieldChange({\n id: currentElementId,\n text: currentElementContent,\n namespace: currentElementNamespace\n });\n }\n }\n };\n\n const findAndRenameField = (fieldId: string) => {\n if (!editor || !fieldMenuItems) return;\n\n const selectedRange = editor.selection.getRng();\n const endOffset = selectedRange.endOffset;\n const stringToSearch = selectedRange.commonAncestorContainer.nodeValue?.slice(0, endOffset);\n if (stringToSearch === undefined) return;\n\n const splitSearch = stringToSearch.split(' ');\n const fieldString = splitSearch[splitSearch.length - 1];\n const range = editor.getDoc().createRange();\n\n const startPos = stringToSearch.lastIndexOf(fieldString);\n const endPos = startPos + fieldString.length;\n range.setStart(selectedRange.commonAncestorContainer, startPos);\n range.setEnd(selectedRange.commonAncestorContainer, endPos);\n editor.getDoc().getSelection()?.removeAllRanges();\n editor.getDoc().getSelection()?.addRange(range);\n\n const selectedField = menuHelpers.getItem(fieldMenuItems, fieldId);\n if (selectedField && isFieldMenuItem(selectedField)) {\n editor.selection.setContent(\n `<pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"${\n selectedField.id\n }\" ${selectedField.namespace && `data-rule-namespace=${selectedField.namespace}`}>${\n selectedField.primary\n }</pega-reference>`\n );\n setShowFieldsPopover(false);\n }\n };\n\n const hidePopover = () => {\n if (fieldPopoverRef) setShowFieldsPopover(false);\n };\n\n const filterFieldMenu = (searchString: string) => {\n setShowFieldsPopover(true);\n setFieldMenuItems(fieldItems || []);\n if (/\\s/.test(searchString)) {\n setShowFieldsPopover(false);\n return;\n }\n if (searchString && fieldMenuItems) {\n const newFieldMenuItems: FieldItems[] = menuHelpers\n .flatten(fieldMenuItems)\n .filter(({ primary }) =>\n primary.toLowerCase().startsWith(searchString.toLocaleLowerCase())\n );\n if (newFieldMenuItems) {\n setShowFieldsPopover(true);\n setFieldMenuItems(newFieldMenuItems);\n } else setShowFieldsPopover(false);\n }\n };\n\n const updateBookmarkAndCurrentElement = (editorSelection: EditorSelection) => {\n const targetEl = editorSelection.getNode() as HTMLElement;\n const fieldId = targetEl.getAttribute('data-rule-id');\n const fieldNamespace = targetEl.getAttribute('data-rule-namespace');\n const fieldValue = targetEl.innerText;\n setBookmark(editorSelection.getBookmark());\n setCurrentElementId(fieldId || '');\n setCurrentElementContent(fieldValue);\n setCurrentElementNamespace(fieldNamespace || '');\n };\n\n const handleElementClick = ({ target }: MouseEvent) => {\n if (editor && target && (target as HTMLElement).tagName === 'PEGA-REFERENCE') {\n updateBookmarkAndCurrentElement(editor.selection);\n }\n hidePopover();\n };\n\n const onInsertField = (incEditor: TinyMCEEditor) => {\n const targetEl = incEditor.selection.getNode();\n if (targetEl.tagName === 'PEGA-REFERENCE') {\n updateBookmarkAndCurrentElement(incEditor.selection);\n } else {\n modalMethods.current = create(Modal, modalProps);\n }\n };\n\n const isPegaRefActive = (incEditor: TinyMCEEditor) => {\n const targetEl = incEditor.selection.getNode();\n return targetEl.tagName === 'PEGA-REFERENCE';\n };\n\n const fieldSelectionPopover = (\n <Popover\n show={showFieldsPopover}\n strategy='fixed'\n ref={fieldPopoverRef}\n target={{\n getBoundingClientRect() {\n return currentCursorPosition;\n }\n }}\n modifiers={[\n {\n name: 'offset',\n options: {\n offset: () => {\n const iframe = editorRef.current?.element?.querySelector('iframe');\n const iframeRect = iframe?.getBoundingClientRect();\n const x = iframeRect?.x ?? 0;\n const y = iframeRect?.y ?? 0;\n return [x, y] satisfies [number, number];\n }\n }\n }\n ]}\n placement='bottom-start'\n >\n {fieldMenuItems && (\n <Menu\n id={menuID}\n items={fieldMenuItems}\n as={StyledSearchPopover}\n focusControlEl={editor?.getBody() || undefined}\n mode='action'\n onItemClick={findAndRenameField}\n variant='drill-down'\n />\n )}\n </Popover>\n );\n\n useEffect(() => {\n if (currentElementId && currentElementContent)\n modalMethods.current = create(Modal, modalProps);\n }, [currentElementId, currentElementContent]);\n\n useEffect(() => {\n editor?.getDoc().addEventListener('click', handleElementClick);\n return () => {\n editor?.getDoc().removeEventListener('click', handleElementClick);\n };\n }, [editor, editorRef.current]);\n\n useEffect(() => {\n if (modalMethods.current) {\n modalMethods.current.update(modalProps);\n }\n }, [modalProps]);\n\n const onEditorChange: EditorProps['onChange'] = (formEditor?: TinyMCEEditor) => {\n if (formEditor) {\n const targetEl = formEditor.selection.getBoundingClientRect();\n const { left = 0, top = 0 } = targetEl ?? {};\n setCurrentCursorPosition({\n ...formEditor.selection.getBoundingClientRect(),\n x: left,\n y: top,\n toJSON: () => {}\n });\n\n if (formEditor.selection.isCollapsed()) {\n // get the full line string\n const selectedRange = formEditor.selection.getRng();\n const endOffset = selectedRange.endOffset;\n const stringToSearch = selectedRange.commonAncestorContainer.nodeValue?.slice(\n 0,\n endOffset\n );\n const fieldString = stringToSearch?.split(' ')[stringToSearch.split(' ').length - 1];\n if (\n fieldString?.startsWith('@') &&\n fieldString.indexOf('@') === fieldString.lastIndexOf('@')\n ) {\n filterFieldMenu(fieldString.slice(1));\n } else setShowFieldsPopover(false);\n }\n }\n };\n\n const onKeyDown: EditorProps['onKeyDown'] = event => {\n if (onKeyDownProp) {\n onKeyDownProp(event);\n }\n\n if (\n (event?.key === 'Enter' ||\n event?.key === 'ArrowLeft' ||\n event?.key === 'ArrowRight' ||\n event?.key === 'ArrowDown' ||\n event?.key === 'ArrowUp') &&\n !!fieldPopoverRef.current\n ) {\n event?.preventDefault();\n }\n if (event?.key === 'Escape' && !!fieldPopoverRef.current) {\n hidePopover();\n }\n };\n\n return (\n <Editor\n data-testid={testIds.root}\n ref={editorRef}\n {...restProps}\n label={label}\n toolbar={toolbar}\n customComponents={[\n {\n createCustomElement: createPegaReferenceElement,\n name: 'pega-reference',\n extensionAttributes: ['contenteditable'],\n style: pegaReferenceElementStyle\n },\n ...customComponents\n ]}\n customActions={[\n {\n 'data-testid': testIds.insertField,\n icon: 'code',\n text: tooltip,\n onMouseDown: () => {\n modalMethods.current = create(Modal, modalProps);\n },\n active: isPegaRefActive,\n shortcut: {\n pattern: 'meta+191',\n description: tooltip,\n command: onInsertField\n }\n },\n ...customActions\n ]}\n onInit={setEditor}\n onChange={onEditorChange}\n onBlur={() => {\n onBlur?.();\n hidePopover();\n }}\n onKeyDown={onKeyDown}\n defaultValue={defaultValue}\n >\n {fieldSelectionPopover}\n </Editor>\n );\n }\n);\n\nexport default withTestIds(DynamicContentEditor, getDynamicContentEditorTestIds);\n"]}
1
+ {"version":3,"file":"DynamicContentEditor.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/DynamicContentEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,WAAW,EACX,KAAK,EACL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,OAAO,EAChB,gBAAgB,EAAE;YAChB;gBACE,mBAAmB,EAAE,0BAA0B;gBAC/C,IAAI,EAAE,gBAAgB;gBACtB,mBAAmB,EAAE,CAAC,iBAAiB,CAAC;gBACxC,KAAK,EAAE,yBAAyB;aACjC;YACD,GAAG,gBAAgB;SACpB,EACD,aAAa,EAAE;YACb;gBACE,aAAa,EAAE,OAAO,CAAC,WAAW;gBAClC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,GAAG,EAAE;oBAChB,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;gBACnD,CAAC;gBACD,MAAM,EAAE,eAAe;gBACvB,QAAQ,EAAE;oBACR,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,OAAO;oBACpB,OAAO,EAAE,aAAa;iBACvB;aACF;YACD,GAAG,aAAa;SACjB,EACD,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,EAAE,EAAE,CAAC;YACX,WAAW,EAAE,CAAC;QAChB,CAAC,EACD,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,YAEzB,qBAAqB,GACf,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect, useState } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\nimport type { Bookmark, Editor as TinyMCEEditor, EditorSelection } from 'tinymce';\n\nimport {\n Button,\n defaultThemeProp,\n Menu,\n menuHelpers,\n Modal,\n Popover,\n StyledPopover,\n useModalManager,\n useConsolidatedRef,\n useI18n,\n useUID,\n useTestIds,\n withTestIds,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n ModalMethods,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\nimport * as codeIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/code.icon';\n\nimport { getKeyCommand } from '../RichTextEditor/Toolbar/utils';\nimport { Editor } from '../Editor';\nimport type { EditorProps } from '../Editor';\n\nimport { isFieldMenuItem } from './DynamicContentEditor.types';\nimport type { DynamicContentEditorProps, FieldItems, ItemType } from './DynamicContentEditor.types';\nimport { pegaReferenceElementStyle, createPegaReferenceElement } from './PegaCustomElement';\nimport { getDynamicContentEditorTestIds } from './DynamicContentEditor.test-ids';\n\nregisterIcon(codeIcon);\n\ntype DynamicContentEditorPropsWithDefaults = PropsWithDefaults<DynamicContentEditorProps>;\n\nconst StyledDynamicContentEditor = styled.div<DynamicContentEditorPropsWithDefaults>``;\n\nexport const StyledSearchPopover = styled(StyledPopover)`\n min-width: 20rem;\n`;\n\nStyledDynamicContentEditor.defaultProps = defaultThemeProp;\n\nconst DynamicContentEditor: ForwardRefForwardPropsComponent<DynamicContentEditorProps> = forwardRef(\n function DynamicContentEditor(\n {\n testId,\n form: { dynamicContentPicker, onSubmit },\n onActiveFieldChange,\n label,\n toolbar,\n fieldItems,\n defaultValue,\n onBlur,\n onKeyDown: onKeyDownProp,\n customActions = [],\n customComponents = [],\n ...restProps\n }: PropsWithoutRef<DynamicContentEditorProps>,\n ref: DynamicContentEditorProps['ref']\n ) {\n const testIds = useTestIds(testId, getDynamicContentEditorTestIds);\n const menuID = useUID();\n const { create } = useModalManager();\n const t = useI18n();\n\n const modalMethods = useRef<ModalMethods>();\n const [editor, setEditor] = useState<TinyMCEEditor | undefined>();\n const [bookmark, setBookmark] = useState<Bookmark | undefined>();\n const [fieldMenuItems, setFieldMenuItems] = useState<FieldItems[]>(fieldItems || []);\n const [currentElementId, setCurrentElementId] = useState('');\n const [currentElementContent, setCurrentElementContent] = useState('');\n const [currentElementNamespace, setCurrentElementNamespace] = useState('');\n const [currentCursorPosition, setCurrentCursorPosition] = useState({\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n toJSON: () => {}\n });\n const [showFieldsPopover, setShowFieldsPopover] = useState<boolean>(false);\n\n const fieldPopoverRef = useRef<HTMLDivElement>(null);\n const editorRef = useConsolidatedRef(ref);\n\n const tooltip = getKeyCommand(\n navigator.appVersion.includes('Mac'),\n ({ ctrl }) => `${t('rte_insert_field')} (${ctrl}/)`\n );\n\n const insertField = (field: ItemType) => {\n if (!editor) return;\n\n const fieldContent = `<pega-reference role=\"button\" contenteditable=\"false\" data-rule-type='field' data-rule-id=${\n field.id\n } ${field.namespace && `data-rule-namespace=${field.namespace}`}>${\n field.text\n }</pega-reference>`;\n if (bookmark) {\n editor.selection.moveToBookmark(bookmark);\n editor.selection.setContent(fieldContent);\n } else {\n editor.insertContent(fieldContent);\n }\n\n modalMethods.current?.dismiss();\n };\n\n const modalProps = {\n 'data-testid': testIds.insertFieldModal,\n children: dynamicContentPicker,\n heading: t('rte_insert_field'),\n actions: (\n <>\n <Button\n data-testid={testIds.insertFieldModalCancel}\n variant='secondary'\n onClick={() => modalMethods.current?.dismiss()}\n >\n {t('cancel')}\n </Button>\n <Button\n data-testid={testIds.insertFieldModalSubmit}\n variant='primary'\n onClick={() => onSubmit(insertField)}\n >\n {t('submit')}\n </Button>\n </>\n ),\n center: true,\n onAfterClose: () => {\n setBookmark(undefined);\n setCurrentElementId('');\n setCurrentElementContent('');\n setCurrentElementNamespace('');\n onActiveFieldChange({ id: '', text: '', namespace: '' });\n },\n onBeforeOpen: () => {\n if (currentElementId) {\n onActiveFieldChange({\n id: currentElementId,\n text: currentElementContent,\n namespace: currentElementNamespace\n });\n }\n }\n };\n\n const findAndRenameField = (fieldId: string) => {\n if (!editor || !fieldMenuItems) return;\n\n const selectedRange = editor.selection.getRng();\n const endOffset = selectedRange.endOffset;\n const stringToSearch = selectedRange.commonAncestorContainer.nodeValue?.slice(0, endOffset);\n if (stringToSearch === undefined) return;\n\n const splitSearch = stringToSearch.split(' ');\n const fieldString = splitSearch[splitSearch.length - 1];\n const range = editor.getDoc().createRange();\n\n const startPos = stringToSearch.lastIndexOf(fieldString);\n const endPos = startPos + fieldString.length;\n range.setStart(selectedRange.commonAncestorContainer, startPos);\n range.setEnd(selectedRange.commonAncestorContainer, endPos);\n editor.getDoc().getSelection()?.removeAllRanges();\n editor.getDoc().getSelection()?.addRange(range);\n\n const selectedField = menuHelpers.getItem(fieldMenuItems, fieldId);\n if (selectedField && isFieldMenuItem(selectedField)) {\n editor.selection.setContent(\n `<pega-reference role=\"button\" contenteditable=\"false\" data-rule-type=\"field\" data-rule-id=\"${\n selectedField.id\n }\" ${selectedField.namespace && `data-rule-namespace=${selectedField.namespace}`}>${\n selectedField.primary\n }</pega-reference>`\n );\n setShowFieldsPopover(false);\n }\n };\n\n const hidePopover = () => {\n if (fieldPopoverRef) setShowFieldsPopover(false);\n };\n\n const filterFieldMenu = (searchString: string) => {\n setShowFieldsPopover(true);\n setFieldMenuItems(fieldItems || []);\n if (/\\s/.test(searchString)) {\n setShowFieldsPopover(false);\n return;\n }\n if (searchString && fieldMenuItems) {\n const newFieldMenuItems: FieldItems[] = menuHelpers\n .flatten(fieldMenuItems)\n .filter(({ primary }) =>\n primary.toLowerCase().startsWith(searchString.toLocaleLowerCase())\n );\n if (newFieldMenuItems) {\n setShowFieldsPopover(true);\n setFieldMenuItems(newFieldMenuItems);\n } else setShowFieldsPopover(false);\n }\n };\n\n const updateBookmarkAndCurrentElement = (editorSelection: EditorSelection) => {\n const targetEl = editorSelection.getNode() as HTMLElement;\n const fieldId = targetEl.getAttribute('data-rule-id');\n const fieldNamespace = targetEl.getAttribute('data-rule-namespace');\n const fieldValue = targetEl.innerText;\n setBookmark(editorSelection.getBookmark());\n setCurrentElementId(fieldId || '');\n setCurrentElementContent(fieldValue);\n setCurrentElementNamespace(fieldNamespace || '');\n };\n\n const handleElementClick = ({ target }: MouseEvent) => {\n if (editor && target && (target as HTMLElement).tagName === 'PEGA-REFERENCE') {\n updateBookmarkAndCurrentElement(editor.selection);\n }\n hidePopover();\n };\n\n const onInsertField = (incEditor: TinyMCEEditor) => {\n const targetEl = incEditor.selection.getNode();\n if (targetEl.tagName === 'PEGA-REFERENCE') {\n updateBookmarkAndCurrentElement(incEditor.selection);\n } else {\n modalMethods.current = create(Modal, modalProps);\n }\n };\n\n const isPegaRefActive = (incEditor: TinyMCEEditor) => {\n const targetEl = incEditor.selection.getNode();\n return targetEl.tagName === 'PEGA-REFERENCE';\n };\n\n const fieldSelectionPopover = (\n <Popover\n show={showFieldsPopover}\n strategy='fixed'\n ref={fieldPopoverRef}\n target={{\n getBoundingClientRect() {\n return currentCursorPosition;\n }\n }}\n modifiers={[\n {\n name: 'offset',\n options: {\n offset: () => {\n const iframe = editorRef.current?.element?.querySelector('iframe');\n const iframeRect = iframe?.getBoundingClientRect();\n const x = iframeRect?.x ?? 0;\n const y = iframeRect?.y ?? 0;\n return [x, y] satisfies [number, number];\n }\n }\n }\n ]}\n placement='bottom-start'\n >\n {fieldMenuItems && (\n <Menu\n id={menuID}\n items={fieldMenuItems}\n as={StyledSearchPopover}\n focusControlEl={editor?.getBody() || undefined}\n mode='action'\n onItemClick={findAndRenameField}\n variant='drill-down'\n />\n )}\n </Popover>\n );\n\n useEffect(() => {\n if (currentElementId && currentElementContent)\n modalMethods.current = create(Modal, modalProps);\n }, [currentElementId, currentElementContent]);\n\n useEffect(() => {\n editor?.getDoc().addEventListener('click', handleElementClick);\n return () => {\n editor?.getDoc().removeEventListener('click', handleElementClick);\n };\n }, [editor, editorRef.current]);\n\n useEffect(() => {\n if (modalMethods.current) {\n modalMethods.current.update(modalProps);\n }\n }, [modalProps]);\n\n const onEditorChange: EditorProps['onChange'] = (formEditor?: TinyMCEEditor) => {\n if (formEditor) {\n const targetEl = formEditor.selection.getBoundingClientRect();\n const { left = 0, top = 0 } = targetEl ?? {};\n setCurrentCursorPosition({\n ...formEditor.selection.getBoundingClientRect(),\n x: left,\n y: top,\n toJSON: () => {}\n });\n\n if (formEditor.selection.isCollapsed()) {\n // get the full line string\n const selectedRange = formEditor.selection.getRng();\n const endOffset = selectedRange.endOffset;\n const stringToSearch = selectedRange.commonAncestorContainer.nodeValue?.slice(\n 0,\n endOffset\n );\n const fieldString = stringToSearch?.split(' ')[stringToSearch.split(' ').length - 1];\n if (\n fieldString?.startsWith('@') &&\n fieldString.indexOf('@') === fieldString.lastIndexOf('@')\n ) {\n filterFieldMenu(fieldString.slice(1));\n } else setShowFieldsPopover(false);\n }\n }\n };\n\n const onKeyDown: EditorProps['onKeyDown'] = event => {\n if (onKeyDownProp) {\n onKeyDownProp(event);\n }\n\n if (\n (event?.key === 'Enter' ||\n event?.key === 'ArrowLeft' ||\n event?.key === 'ArrowRight' ||\n event?.key === 'ArrowDown' ||\n event?.key === 'ArrowUp') &&\n !!fieldPopoverRef.current\n ) {\n event?.preventDefault();\n }\n if (event?.key === 'Escape' && !!fieldPopoverRef.current) {\n hidePopover();\n }\n };\n\n return (\n <Editor\n data-testid={testIds.root}\n ref={editorRef}\n {...restProps}\n label={label}\n toolbar={toolbar}\n customComponents={[\n {\n createCustomElement: createPegaReferenceElement,\n name: 'pega-reference',\n extensionAttributes: ['contenteditable'],\n style: pegaReferenceElementStyle\n },\n ...customComponents\n ]}\n customActions={[\n {\n 'data-testid': testIds.insertField,\n icon: 'code',\n text: tooltip,\n onMouseDown: () => {\n modalMethods.current = create(Modal, modalProps);\n },\n active: isPegaRefActive,\n shortcut: {\n pattern: 'meta+191',\n description: tooltip,\n command: onInsertField\n }\n },\n ...customActions\n ]}\n onInit={setEditor}\n onChange={onEditorChange}\n onBlur={() => {\n onBlur?.();\n hidePopover();\n }}\n onKeyDown={onKeyDown}\n defaultValue={defaultValue}\n >\n {fieldSelectionPopover}\n </Editor>\n );\n }\n);\n\nexport default withTestIds(DynamicContentEditor, getDynamicContentEditorTestIds);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicContentEditor.types.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor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,WAAW,gCAAiC,SAAQ,yBAAyB;IACjF,gBAAgB,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtD"}
1
+ {"version":3,"file":"DynamicContentEditor.types.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/DynamicContentEditor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,wDAAwD,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,cAAc,CAAC;AAExD,eAAO,MAAM,eAAe,GAAI,MAAM,UAAU,KAAG,IAAI,IAAI,aACjC,CAAC;AAE3B,MAAM,WAAW,yBAA0B,SAAQ,WAAW,EAAE,UAAU;IACxE,wBAAwB;IACxB,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,KAAK,IAAI,CAAC;QACnE,oBAAoB,EAAE,SAAS,CAAC;KACjC,CAAC;IACF,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC/C,+BAA+B;IAC/B,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,gCAAiC,SAAQ,yBAAyB;IACjF,gBAAgB,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtD"}
@@ -1,334 +1,3 @@
1
1
  export declare const pegaReferenceElementStyle = "pega-reference {\n color: #076bc9;\n cursor: pointer;\n}\n\npega-reference:hover{\n text-decoration: underline;\n}\n\npega-reference::before{\n content: '['\n}\n\npega-reference::after{\n content: ']'\n}";
2
- export declare const createPegaReferenceElement: (win: typeof globalThis) => {
3
- new (): {
4
- connectedCallback(): void;
5
- accessKey: string;
6
- readonly accessKeyLabel: string;
7
- autocapitalize: string;
8
- dir: string;
9
- draggable: boolean;
10
- hidden: boolean;
11
- inert: boolean;
12
- innerText: string;
13
- lang: string;
14
- readonly offsetHeight: number;
15
- readonly offsetLeft: number;
16
- readonly offsetParent: Element | null;
17
- readonly offsetTop: number;
18
- readonly offsetWidth: number;
19
- outerText: string;
20
- popover: string | null;
21
- spellcheck: boolean;
22
- title: string;
23
- translate: boolean;
24
- attachInternals(): ElementInternals;
25
- click(): void;
26
- hidePopover(): void;
27
- showPopover(): void;
28
- togglePopover(force?: boolean): boolean;
29
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
30
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
31
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
32
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
33
- readonly attributes: NamedNodeMap;
34
- readonly classList: DOMTokenList;
35
- className: string;
36
- readonly clientHeight: number;
37
- readonly clientLeft: number;
38
- readonly clientTop: number;
39
- readonly clientWidth: number;
40
- id: string;
41
- readonly localName: string;
42
- readonly namespaceURI: string | null;
43
- onfullscreenchange: ((this: Element, ev: Event) => any) | null;
44
- onfullscreenerror: ((this: Element, ev: Event) => any) | null;
45
- outerHTML: string;
46
- readonly ownerDocument: Document;
47
- readonly part: DOMTokenList;
48
- readonly prefix: string | null;
49
- readonly scrollHeight: number;
50
- scrollLeft: number;
51
- scrollTop: number;
52
- readonly scrollWidth: number;
53
- readonly shadowRoot: ShadowRoot | null;
54
- slot: string;
55
- readonly tagName: string;
56
- attachShadow(init: ShadowRootInit): ShadowRoot;
57
- checkVisibility(options?: CheckVisibilityOptions): boolean;
58
- closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
59
- closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
60
- closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
61
- closest<E extends Element = Element>(selectors: string): E | null;
62
- computedStyleMap(): StylePropertyMapReadOnly;
63
- getAttribute(qualifiedName: string): string | null;
64
- getAttributeNS(namespace: string | null, localName: string): string | null;
65
- getAttributeNames(): string[];
66
- getAttributeNode(qualifiedName: string): Attr | null;
67
- getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
68
- getBoundingClientRect(): DOMRect;
69
- getClientRects(): DOMRectList;
70
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
71
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
72
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
73
- getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
74
- getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
75
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
76
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
77
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
78
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
79
- getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
80
- hasAttribute(qualifiedName: string): boolean;
81
- hasAttributeNS(namespace: string | null, localName: string): boolean;
82
- hasAttributes(): boolean;
83
- hasPointerCapture(pointerId: number): boolean;
84
- insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
85
- insertAdjacentHTML(position: InsertPosition, text: string): void;
86
- insertAdjacentText(where: InsertPosition, data: string): void;
87
- matches(selectors: string): boolean;
88
- releasePointerCapture(pointerId: number): void;
89
- removeAttribute(qualifiedName: string): void;
90
- removeAttributeNS(namespace: string | null, localName: string): void;
91
- removeAttributeNode(attr: Attr): Attr;
92
- requestFullscreen(options?: FullscreenOptions): Promise<void>;
93
- requestPointerLock(): void;
94
- scroll(options?: ScrollToOptions): void;
95
- scroll(x: number, y: number): void;
96
- scrollBy(options?: ScrollToOptions): void;
97
- scrollBy(x: number, y: number): void;
98
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
99
- scrollTo(options?: ScrollToOptions): void;
100
- scrollTo(x: number, y: number): void;
101
- setAttribute(qualifiedName: string, value: string): void;
102
- setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
103
- setAttributeNode(attr: Attr): Attr | null;
104
- setAttributeNodeNS(attr: Attr): Attr | null;
105
- setHTMLUnsafe(html: string): void;
106
- setPointerCapture(pointerId: number): void;
107
- toggleAttribute(qualifiedName: string, force?: boolean): boolean;
108
- webkitMatchesSelector(selectors: string): boolean;
109
- readonly baseURI: string;
110
- readonly childNodes: NodeListOf<ChildNode>;
111
- readonly firstChild: ChildNode | null;
112
- readonly isConnected: boolean;
113
- readonly lastChild: ChildNode | null;
114
- readonly nextSibling: ChildNode | null;
115
- readonly nodeName: string;
116
- readonly nodeType: number;
117
- nodeValue: string | null;
118
- readonly parentElement: HTMLElement | null;
119
- readonly parentNode: ParentNode | null;
120
- readonly previousSibling: ChildNode | null;
121
- textContent: string | null;
122
- appendChild<T extends Node>(node: T): T;
123
- cloneNode(deep?: boolean): Node;
124
- compareDocumentPosition(other: Node): number;
125
- contains(other: Node | null): boolean;
126
- getRootNode(options?: GetRootNodeOptions): Node;
127
- hasChildNodes(): boolean;
128
- insertBefore<T extends Node>(node: T, child: Node | null): T;
129
- isDefaultNamespace(namespace: string | null): boolean;
130
- isEqualNode(otherNode: Node | null): boolean;
131
- isSameNode(otherNode: Node | null): boolean;
132
- lookupNamespaceURI(prefix: string | null): string | null;
133
- lookupPrefix(namespace: string | null): string | null;
134
- normalize(): void;
135
- removeChild<T extends Node>(child: T): T;
136
- replaceChild<T extends Node>(node: Node, child: T): T;
137
- readonly ELEMENT_NODE: 1;
138
- readonly ATTRIBUTE_NODE: 2;
139
- readonly TEXT_NODE: 3;
140
- readonly CDATA_SECTION_NODE: 4;
141
- readonly ENTITY_REFERENCE_NODE: 5;
142
- readonly ENTITY_NODE: 6;
143
- readonly PROCESSING_INSTRUCTION_NODE: 7;
144
- readonly COMMENT_NODE: 8;
145
- readonly DOCUMENT_NODE: 9;
146
- readonly DOCUMENT_TYPE_NODE: 10;
147
- readonly DOCUMENT_FRAGMENT_NODE: 11;
148
- readonly NOTATION_NODE: 12;
149
- readonly DOCUMENT_POSITION_DISCONNECTED: 1;
150
- readonly DOCUMENT_POSITION_PRECEDING: 2;
151
- readonly DOCUMENT_POSITION_FOLLOWING: 4;
152
- readonly DOCUMENT_POSITION_CONTAINS: 8;
153
- readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
154
- readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
155
- dispatchEvent(event: Event): boolean;
156
- ariaAtomic: string | null;
157
- ariaAutoComplete: string | null;
158
- ariaBrailleLabel: string | null;
159
- ariaBrailleRoleDescription: string | null;
160
- ariaBusy: string | null;
161
- ariaChecked: string | null;
162
- ariaColCount: string | null;
163
- ariaColIndex: string | null;
164
- ariaColSpan: string | null;
165
- ariaCurrent: string | null;
166
- ariaDescription: string | null;
167
- ariaDisabled: string | null;
168
- ariaExpanded: string | null;
169
- ariaHasPopup: string | null;
170
- ariaHidden: string | null;
171
- ariaInvalid: string | null;
172
- ariaKeyShortcuts: string | null;
173
- ariaLabel: string | null;
174
- ariaLevel: string | null;
175
- ariaLive: string | null;
176
- ariaModal: string | null;
177
- ariaMultiLine: string | null;
178
- ariaMultiSelectable: string | null;
179
- ariaOrientation: string | null;
180
- ariaPlaceholder: string | null;
181
- ariaPosInSet: string | null;
182
- ariaPressed: string | null;
183
- ariaReadOnly: string | null;
184
- ariaRequired: string | null;
185
- ariaRoleDescription: string | null;
186
- ariaRowCount: string | null;
187
- ariaRowIndex: string | null;
188
- ariaRowSpan: string | null;
189
- ariaSelected: string | null;
190
- ariaSetSize: string | null;
191
- ariaSort: string | null;
192
- ariaValueMax: string | null;
193
- ariaValueMin: string | null;
194
- ariaValueNow: string | null;
195
- ariaValueText: string | null;
196
- role: string | null;
197
- animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
198
- getAnimations(options?: GetAnimationsOptions): Animation[];
199
- after(...nodes: (Node | string)[]): void;
200
- before(...nodes: (Node | string)[]): void;
201
- remove(): void;
202
- replaceWith(...nodes: (Node | string)[]): void;
203
- innerHTML: string;
204
- readonly nextElementSibling: Element | null;
205
- readonly previousElementSibling: Element | null;
206
- readonly childElementCount: number;
207
- readonly children: HTMLCollection;
208
- readonly firstElementChild: Element | null;
209
- readonly lastElementChild: Element | null;
210
- append(...nodes: (Node | string)[]): void;
211
- prepend(...nodes: (Node | string)[]): void;
212
- querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
213
- querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
214
- querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
215
- querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
216
- querySelector<E extends Element = Element>(selectors: string): E | null;
217
- querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
218
- querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
219
- querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
220
- querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
221
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
222
- replaceChildren(...nodes: (Node | string)[]): void;
223
- readonly assignedSlot: HTMLSlotElement | null;
224
- readonly attributeStyleMap: StylePropertyMap;
225
- readonly style: CSSStyleDeclaration;
226
- contentEditable: string;
227
- enterKeyHint: string;
228
- inputMode: string;
229
- readonly isContentEditable: boolean;
230
- onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
231
- onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
232
- onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
233
- onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
234
- onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
235
- onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
236
- onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
237
- onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
238
- onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
239
- oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
240
- oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
241
- oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
- onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
243
- onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
244
- onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
245
- oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
246
- oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
247
- oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
248
- oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
249
- ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
250
- ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
251
- ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
252
- ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
253
- ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
254
- ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
255
- ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
256
- ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
257
- ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
258
- onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
259
- onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
260
- onerror: OnErrorEventHandler;
261
- onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
262
- onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
263
- ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
- oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
265
- oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
266
- onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
267
- onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
268
- onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
269
- onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
- onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
- onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
- onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
- onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
274
- onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
275
- onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
276
- onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
277
- onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
278
- onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
279
- onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
280
- onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
281
- onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
282
- onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
- onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
- onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
- onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
286
- onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
287
- onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
288
- onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
289
- onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
290
- onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
291
- onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
292
- onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
293
- onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
294
- onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
- onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
- onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
297
- onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
- onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
- onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
300
- onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
- onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
302
- onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
303
- onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
304
- onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
305
- onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
306
- onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
307
- onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
308
- onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
309
- ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
310
- ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
311
- ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
312
- ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
313
- ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
314
- ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
315
- ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
316
- ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
317
- ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
318
- ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
319
- onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
320
- onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
321
- onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
322
- onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
323
- onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
324
- onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
325
- onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
326
- autofocus: boolean;
327
- readonly dataset: DOMStringMap;
328
- nonce?: string;
329
- tabIndex: number;
330
- blur(): void;
331
- focus(options?: FocusOptions): void;
332
- };
333
- };
2
+ export declare const createPegaReferenceElement: (win: typeof globalThis) => new () => HTMLElement;
334
3
  //# sourceMappingURL=PegaCustomElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PegaCustomElement.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,qNAgBpC,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAAS,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQhE,CAAC"}
1
+ {"version":3,"file":"PegaCustomElement.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,qNAgBpC,CAAC;AAEH,eAAO,MAAM,0BAA0B,GAAI,KAAK,OAAO,UAAU,KAAG,UAAU,WAQ7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PegaCustomElement.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;EAgBvC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAsB,EAAE,EAAE;IACnE,OAAO,MAAM,oBAAqB,SAAQ,GAAG,CAAC,WAAW;QACvD,iBAAiB;YACf,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export const pegaReferenceElementStyle = `\\\npega-reference {\n color: #076bc9;\n cursor: pointer;\n}\n\npega-reference:hover{\n text-decoration: underline;\n}\n\npega-reference::before{\n content: '['\n}\n\npega-reference::after{\n content: ']'\n}`;\n\nexport const createPegaReferenceElement = (win: typeof globalThis) => {\n return class PegaReferenceElement extends win.HTMLElement {\n connectedCallback() {\n const template = document.createElement('template');\n const temp = document.importNode(template.content, true);\n this.append(temp);\n }\n };\n};\n"]}
1
+ {"version":3,"file":"PegaCustomElement.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;EAgBvC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAsB,EAAyB,EAAE;IAC1F,OAAO,MAAM,oBAAqB,SAAQ,GAAG,CAAC,WAAW;QACvD,iBAAiB;YACf,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export const pegaReferenceElementStyle = `\\\npega-reference {\n color: #076bc9;\n cursor: pointer;\n}\n\npega-reference:hover{\n text-decoration: underline;\n}\n\npega-reference::before{\n content: '['\n}\n\npega-reference::after{\n content: ']'\n}`;\n\nexport const createPegaReferenceElement = (win: typeof globalThis): new () => HTMLElement => {\n return class PegaReferenceElement extends win.HTMLElement {\n connectedCallback() {\n const template = document.createElement('template');\n const temp = document.importNode(template.content, true);\n this.append(temp);\n }\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":"AAEA,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,oBAAoB,CAAC;AAa5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAmBtD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAa/E,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqBnE,eAAO,MAAM,cAAc,UAAW,YAAY,WAQjD,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAAW,YAAY,WAiBvD,CAAC;;;;AA8pBF,wBAA4D"}
1
+ {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.tsx"],"names":[],"mappings":"AAEA,OAAO,uBAAuB,CAAC;AAC/B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,0BAA0B,CAAC;AAClC,OAAO,oBAAoB,CAAC;AAa5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAmBtD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAa/E,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAqBnE,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY,WAQjD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,YAAY,WAiBvD,CAAC;;;;AA8pBF,wBAA4D"}
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,oOAYpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,mEAIhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAgBhC,CAAC;AAIH,eAAO,MAAM,gBAAgB;2BAS+xE,CAAC,oEAAkC,yBAAa;uDATzzE,CAAC;AAEpD,eAAO,MAAM,iBAAiB,mSAE7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,iRAE5B,CAAC"}
1
+ {"version":3,"file":"Editor.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/Editor.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB,oOAYpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,mEAIhC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yGAgBhC,CAAC;AAIH,eAAO,MAAM,gBAAgB;2BAS+xE,CAAC;uDAT1wE,CAAC;AAEpD,eAAO,MAAM,iBAAiB,mSAE7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,iRAE5B,CAAC"}
@@ -1,338 +1,3 @@
1
- declare const createFileItemElement: (win: typeof globalThis) => {
2
- new (): {
3
- attributeChangedCallback(): void;
4
- mount(): void;
5
- connectedCallback(): void;
6
- disconnectedCallback(): void;
7
- accessKey: string;
8
- readonly accessKeyLabel: string;
9
- autocapitalize: string;
10
- dir: string;
11
- draggable: boolean;
12
- hidden: boolean;
13
- inert: boolean;
14
- innerText: string;
15
- lang: string;
16
- readonly offsetHeight: number;
17
- readonly offsetLeft: number;
18
- readonly offsetParent: Element | null;
19
- readonly offsetTop: number;
20
- readonly offsetWidth: number;
21
- outerText: string;
22
- popover: string | null;
23
- spellcheck: boolean;
24
- title: string;
25
- translate: boolean;
26
- attachInternals(): ElementInternals;
27
- click(): void;
28
- hidePopover(): void;
29
- showPopover(): void;
30
- togglePopover(force?: boolean): boolean;
31
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
32
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
33
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
34
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
35
- readonly attributes: NamedNodeMap;
36
- readonly classList: DOMTokenList;
37
- className: string;
38
- readonly clientHeight: number;
39
- readonly clientLeft: number;
40
- readonly clientTop: number;
41
- readonly clientWidth: number;
42
- id: string;
43
- readonly localName: string;
44
- readonly namespaceURI: string | null;
45
- onfullscreenchange: ((this: Element, ev: Event) => any) | null;
46
- onfullscreenerror: ((this: Element, ev: Event) => any) | null;
47
- outerHTML: string;
48
- readonly ownerDocument: Document;
49
- readonly part: DOMTokenList;
50
- readonly prefix: string | null;
51
- readonly scrollHeight: number;
52
- scrollLeft: number;
53
- scrollTop: number;
54
- readonly scrollWidth: number;
55
- readonly shadowRoot: ShadowRoot | null;
56
- slot: string;
57
- readonly tagName: string;
58
- attachShadow(init: ShadowRootInit): ShadowRoot;
59
- checkVisibility(options?: CheckVisibilityOptions): boolean;
60
- closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
61
- closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
62
- closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
63
- closest<E extends Element = Element>(selectors: string): E | null;
64
- computedStyleMap(): StylePropertyMapReadOnly;
65
- getAttribute(qualifiedName: string): string | null;
66
- getAttributeNS(namespace: string | null, localName: string): string | null;
67
- getAttributeNames(): string[];
68
- getAttributeNode(qualifiedName: string): Attr | null;
69
- getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
70
- getBoundingClientRect(): DOMRect;
71
- getClientRects(): DOMRectList;
72
- getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
73
- getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
74
- getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
75
- getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
76
- getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
77
- getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
78
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
79
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
80
- getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
81
- getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
82
- hasAttribute(qualifiedName: string): boolean;
83
- hasAttributeNS(namespace: string | null, localName: string): boolean;
84
- hasAttributes(): boolean;
85
- hasPointerCapture(pointerId: number): boolean;
86
- insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
87
- insertAdjacentHTML(position: InsertPosition, text: string): void;
88
- insertAdjacentText(where: InsertPosition, data: string): void;
89
- matches(selectors: string): boolean;
90
- releasePointerCapture(pointerId: number): void;
91
- removeAttribute(qualifiedName: string): void;
92
- removeAttributeNS(namespace: string | null, localName: string): void;
93
- removeAttributeNode(attr: Attr): Attr;
94
- requestFullscreen(options?: FullscreenOptions): Promise<void>;
95
- requestPointerLock(): void;
96
- scroll(options?: ScrollToOptions): void;
97
- scroll(x: number, y: number): void;
98
- scrollBy(options?: ScrollToOptions): void;
99
- scrollBy(x: number, y: number): void;
100
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
101
- scrollTo(options?: ScrollToOptions): void;
102
- scrollTo(x: number, y: number): void;
103
- setAttribute(qualifiedName: string, value: string): void;
104
- setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
105
- setAttributeNode(attr: Attr): Attr | null;
106
- setAttributeNodeNS(attr: Attr): Attr | null;
107
- setHTMLUnsafe(html: string): void;
108
- setPointerCapture(pointerId: number): void;
109
- toggleAttribute(qualifiedName: string, force?: boolean): boolean;
110
- webkitMatchesSelector(selectors: string): boolean;
111
- readonly baseURI: string;
112
- readonly childNodes: NodeListOf<ChildNode>;
113
- readonly firstChild: ChildNode | null;
114
- readonly isConnected: boolean;
115
- readonly lastChild: ChildNode | null;
116
- readonly nextSibling: ChildNode | null;
117
- readonly nodeName: string;
118
- readonly nodeType: number;
119
- nodeValue: string | null;
120
- readonly parentElement: HTMLElement | null;
121
- readonly parentNode: ParentNode | null;
122
- readonly previousSibling: ChildNode | null;
123
- textContent: string | null;
124
- appendChild<T extends Node>(node: T): T;
125
- cloneNode(deep?: boolean): Node;
126
- compareDocumentPosition(other: Node): number;
127
- contains(other: Node | null): boolean;
128
- getRootNode(options?: GetRootNodeOptions): Node;
129
- hasChildNodes(): boolean;
130
- insertBefore<T extends Node>(node: T, child: Node | null): T;
131
- isDefaultNamespace(namespace: string | null): boolean;
132
- isEqualNode(otherNode: Node | null): boolean;
133
- isSameNode(otherNode: Node | null): boolean;
134
- lookupNamespaceURI(prefix: string | null): string | null;
135
- lookupPrefix(namespace: string | null): string | null;
136
- normalize(): void;
137
- removeChild<T extends Node>(child: T): T;
138
- replaceChild<T extends Node>(node: Node, child: T): T;
139
- readonly ELEMENT_NODE: 1;
140
- readonly ATTRIBUTE_NODE: 2;
141
- readonly TEXT_NODE: 3;
142
- readonly CDATA_SECTION_NODE: 4;
143
- readonly ENTITY_REFERENCE_NODE: 5;
144
- readonly ENTITY_NODE: 6;
145
- readonly PROCESSING_INSTRUCTION_NODE: 7;
146
- readonly COMMENT_NODE: 8;
147
- readonly DOCUMENT_NODE: 9;
148
- readonly DOCUMENT_TYPE_NODE: 10;
149
- readonly DOCUMENT_FRAGMENT_NODE: 11;
150
- readonly NOTATION_NODE: 12;
151
- readonly DOCUMENT_POSITION_DISCONNECTED: 1;
152
- readonly DOCUMENT_POSITION_PRECEDING: 2;
153
- readonly DOCUMENT_POSITION_FOLLOWING: 4;
154
- readonly DOCUMENT_POSITION_CONTAINS: 8;
155
- readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
156
- readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
157
- dispatchEvent(event: Event): boolean;
158
- ariaAtomic: string | null;
159
- ariaAutoComplete: string | null;
160
- ariaBrailleLabel: string | null;
161
- ariaBrailleRoleDescription: string | null;
162
- ariaBusy: string | null;
163
- ariaChecked: string | null;
164
- ariaColCount: string | null;
165
- ariaColIndex: string | null;
166
- ariaColSpan: string | null;
167
- ariaCurrent: string | null;
168
- ariaDescription: string | null;
169
- ariaDisabled: string | null;
170
- ariaExpanded: string | null;
171
- ariaHasPopup: string | null;
172
- ariaHidden: string | null;
173
- ariaInvalid: string | null;
174
- ariaKeyShortcuts: string | null;
175
- ariaLabel: string | null;
176
- ariaLevel: string | null;
177
- ariaLive: string | null;
178
- ariaModal: string | null;
179
- ariaMultiLine: string | null;
180
- ariaMultiSelectable: string | null;
181
- ariaOrientation: string | null;
182
- ariaPlaceholder: string | null;
183
- ariaPosInSet: string | null;
184
- ariaPressed: string | null;
185
- ariaReadOnly: string | null;
186
- ariaRequired: string | null;
187
- ariaRoleDescription: string | null;
188
- ariaRowCount: string | null;
189
- ariaRowIndex: string | null;
190
- ariaRowSpan: string | null;
191
- ariaSelected: string | null;
192
- ariaSetSize: string | null;
193
- ariaSort: string | null;
194
- ariaValueMax: string | null;
195
- ariaValueMin: string | null;
196
- ariaValueNow: string | null;
197
- ariaValueText: string | null;
198
- role: string | null;
199
- animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
200
- getAnimations(options?: GetAnimationsOptions): Animation[];
201
- after(...nodes: (Node | string)[]): void;
202
- before(...nodes: (Node | string)[]): void;
203
- remove(): void;
204
- replaceWith(...nodes: (Node | string)[]): void;
205
- innerHTML: string;
206
- readonly nextElementSibling: Element | null;
207
- readonly previousElementSibling: Element | null;
208
- readonly childElementCount: number;
209
- readonly children: HTMLCollection;
210
- readonly firstElementChild: Element | null;
211
- readonly lastElementChild: Element | null;
212
- append(...nodes: (Node | string)[]): void;
213
- prepend(...nodes: (Node | string)[]): void;
214
- querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
215
- querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
216
- querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
217
- querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
218
- querySelector<E extends Element = Element>(selectors: string): E | null;
219
- querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
220
- querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
221
- querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
222
- querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
223
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
224
- replaceChildren(...nodes: (Node | string)[]): void;
225
- readonly assignedSlot: HTMLSlotElement | null;
226
- readonly attributeStyleMap: StylePropertyMap;
227
- readonly style: CSSStyleDeclaration;
228
- contentEditable: string;
229
- enterKeyHint: string;
230
- inputMode: string;
231
- readonly isContentEditable: boolean;
232
- onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
233
- onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
234
- onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
235
- onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
236
- onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
237
- onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
238
- onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
239
- onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
240
- onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
241
- oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
- oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
243
- oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
244
- onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
245
- onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
246
- onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
247
- oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
248
- oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
249
- oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
250
- oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
251
- ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
252
- ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
253
- ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
254
- ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
255
- ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
256
- ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
257
- ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
258
- ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
259
- ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
260
- onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
261
- onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
262
- onerror: OnErrorEventHandler;
263
- onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
264
- onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
265
- ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
- oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
267
- oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
268
- onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
269
- onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
270
- onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
271
- onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
272
- onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
- onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
- onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
- onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
276
- onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
277
- onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
278
- onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
279
- onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
280
- onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
281
- onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
282
- onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
283
- onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
284
- onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
- onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
286
- onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
287
- onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
288
- onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
289
- onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
290
- onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
291
- onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
292
- onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
293
- onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
294
- onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
295
- onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
296
- onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
- onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
- onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
299
- onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
300
- onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
- onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
302
- onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
303
- onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
304
- onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
305
- onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
306
- onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
307
- onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
308
- onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
309
- onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
310
- onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
311
- ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
312
- ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
313
- ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
314
- ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
315
- ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
316
- ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
317
- ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
318
- ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
319
- ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
320
- ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
321
- onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
322
- onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
323
- onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
324
- onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
325
- onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
326
- onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
327
- onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
328
- autofocus: boolean;
329
- readonly dataset: DOMStringMap;
330
- nonce?: string;
331
- tabIndex: number;
332
- blur(): void;
333
- focus(options?: FocusOptions): void;
334
- };
335
- readonly observedAttributes: string[];
336
- };
1
+ declare const createFileItemElement: (win: typeof globalThis) => new () => HTMLElement;
337
2
  export default createFileItemElement;
338
3
  //# sourceMappingURL=FileItemElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileItemElement.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/FileItemElement.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,QAAS,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDpD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"FileItemElement.d.ts","sourceRoot":"","sources":["../../../src/components/Editor/FileItemElement.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,GAAI,KAAK,OAAO,UAAU,KAAG,UAAU,WAqDjE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -2,8 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ReactDOM from 'react-dom';
3
3
  import { Configuration, FileItem } from '@pega/cosmos-react-core';
4
4
  const createFileItemElement = (win) => {
5
- const HtmlElement = win.HTMLElement;
6
- return class FileItemElement extends HtmlElement {
5
+ return class FileItemElement extends win.HTMLElement {
7
6
  static get observedAttributes() {
8
7
  return ['data-progress', 'data-error'];
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FileItemElement.js","sourceRoot":"","sources":["../../../src/components/Editor/FileItemElement.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,qBAAqB,GAAG,CAAC,GAAsB,EAAE,EAAE;IACvD,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IACpC,OAAO,MAAM,eAAgB,SAAQ,WAAW;QAC9C,MAAM,KAAK,kBAAkB;YAC3B,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QACzC,CAAC;QAED;YACE,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACtC,CAAC;QAED,wBAAwB;YACtB,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;QAED,KAAK;YACH,MAAM,KAAK,GAAG,IAAI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,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\n\nimport { Configuration, FileItem } from '@pega/cosmos-react-core';\n\nconst createFileItemElement = (win: typeof globalThis) => {\n const HtmlElement = win.HTMLElement;\n return class FileItemElement extends HtmlElement {\n static get observedAttributes() {\n return ['data-progress', 'data-error'];\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n attributeChangedCallback() {\n this.mount();\n }\n\n mount() {\n const error = this.getAttribute('data-error') ?? undefined;\n const progress = !error ? Number(this.getAttribute('data-progress')) : undefined;\n const name = this.getAttribute('data-name') ?? '';\n const url = this.getAttribute('data-url') ?? '';\n const id = this.getAttribute('data-id') ?? '';\n if (this.shadowRoot) {\n ReactDOM.render(\n <Configuration portalTarget={this.shadowRoot} styleSheetTarget={this.shadowRoot}>\n <FileItem\n id={id}\n name={name}\n progress={progress}\n onCancel={() => {\n this.remove();\n }}\n url={url}\n format={name?.split('.')?.pop()}\n error={error}\n />\n </Configuration>,\n this.shadowRoot\n );\n this.shadowRoot\n .querySelector('button[aria-label*=\"Cancel\"]')\n ?.setAttribute('tabindex', '-1');\n }\n }\n\n connectedCallback() {\n this.mount();\n this.setAttribute('contenteditable', 'false');\n }\n\n disconnectedCallback() {\n ReactDOM.render([], this);\n }\n };\n};\n\nexport default createFileItemElement;\n"]}
1
+ {"version":3,"file":"FileItemElement.js","sourceRoot":"","sources":["../../../src/components/Editor/FileItemElement.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,qBAAqB,GAAG,CAAC,GAAsB,EAAyB,EAAE;IAC9E,OAAO,MAAM,eAAgB,SAAQ,GAAG,CAAC,WAAW;QAClD,MAAM,KAAK,kBAAkB;YAC3B,OAAO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B,CAAC;oBAC9C,EAAE,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QAED,iBAAiB;YACf,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,oBAAoB;YAClB,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\n\nimport { Configuration, FileItem } from '@pega/cosmos-react-core';\n\nconst createFileItemElement = (win: typeof globalThis): new () => HTMLElement => {\n return class FileItemElement extends win.HTMLElement {\n static get observedAttributes() {\n return ['data-progress', 'data-error'];\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n attributeChangedCallback() {\n this.mount();\n }\n\n mount() {\n const error = this.getAttribute('data-error') ?? undefined;\n const progress = !error ? Number(this.getAttribute('data-progress')) : undefined;\n const name = this.getAttribute('data-name') ?? '';\n const url = this.getAttribute('data-url') ?? '';\n const id = this.getAttribute('data-id') ?? '';\n if (this.shadowRoot) {\n ReactDOM.render(\n <Configuration portalTarget={this.shadowRoot} styleSheetTarget={this.shadowRoot}>\n <FileItem\n id={id}\n name={name}\n progress={progress}\n onCancel={() => {\n this.remove();\n }}\n url={url}\n format={name?.split('.')?.pop()}\n error={error}\n />\n </Configuration>,\n this.shadowRoot\n );\n this.shadowRoot\n .querySelector('button[aria-label*=\"Cancel\"]')\n ?.setAttribute('tabindex', '-1');\n }\n }\n\n connectedCallback() {\n this.mount();\n this.setAttribute('contenteditable', 'false');\n }\n\n disconnectedCallback() {\n ReactDOM.render([], this);\n }\n };\n};\n\nexport default createFileItemElement;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Editor/Toolbar/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,CAAC,eAAe,CAAC,EACvC,MAAK,OAAe,KACnB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,EAiCjE,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA2IpD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlockQuote.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/BlockQuote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiB9D,KAAK,eAAe,GAAG,cAAc,CACnC,YAAY,EACZ;IACE,QAAQ,EAAE,SAAS,CAAC;CACrB,CACF,CAAC;AAEF,QAAA,MAAM,UAAU,+BAAgC,eAAe,4CAE9D,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"BlockQuote.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/BlockQuote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiB9D,KAAK,eAAe,GAAG,cAAc,CACnC,YAAY,EACZ;IACE,QAAQ,EAAE,SAAS,CAAC;CACrB,CACF,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,4BAA4B,eAAe,4CAE9D,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAoB9D,KAAK,SAAS,GAAG,cAAc,CAC7B,MAAM,EACN;IACE,QAAQ,EAAE,SAAS,CAAC;CACrB,CACF,CAAC;AAEF,QAAA,MAAM,IAAI,+BAAgC,SAAS,4CAMlD,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAoB9D,KAAK,SAAS,GAAG,cAAc,CAC7B,MAAM,EACN;IACE,QAAQ,EAAE,SAAS,CAAC;CACrB,CACF,CAAC;AAEF,QAAA,MAAM,IAAI,GAAI,4BAA4B,SAAS,4CAMlD,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAsB9D,KAAK,cAAc,GAAG,cAAc,CAClC,MAAM,EACN;IACE,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,QAAA,MAAM,SAAS,+BAAgC,cAAc,4CAM5D,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAsB9D,KAAK,cAAc,GAAG,cAAc,CAClC,MAAM,EACN;IACE,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,4BAA4B,cAAc,4CAM5D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalRule.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/HorizontalRule.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAc9D,KAAK,mBAAmB,GAAG,cAAc,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEtE,QAAA,MAAM,cAAc,+BAAgC,mBAAmB,4CAEtE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"HorizontalRule.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/HorizontalRule.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAc9D,KAAK,mBAAmB,GAAG,cAAc,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEtE,QAAA,MAAM,cAAc,GAAI,4BAA4B,mBAAmB,4CAEtE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/Image.tsx"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,UAAU,iBAAkB,eAAe,4CAMhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/DecoratorComponents/Image.tsx"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,UAAU,GAAI,cAAc,eAAe,4CAMhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarButton.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ToolbarButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,UAAU,EAAO,MAAM,OAAO,CAAC;AAYhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;CACvD;AAsDD,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CAkCvD,CAAC;AAEH,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ToolbarButton.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ToolbarButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,UAAU,EAAO,MAAM,OAAO,CAAC;AAYhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;CACvD;AA+DD,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CAkCvD,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -9,9 +9,9 @@ const StyledToolbarButton = styled.button(props => {
9
9
  const size = `calc(4 * ${props.theme.base.spacing})`;
10
10
  const activeColor = tryCatch(() => mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive));
11
11
  return css `
12
- background-color: ${active ? activeColor : 'transparent'};
12
+ background-color: transparent;
13
13
  border: none;
14
- color: ${active ? theme.base.palette.interactive : theme.base.palette['foreground-color']};
14
+ color: ${theme.base.palette['foreground-color']};
15
15
  outline: none;
16
16
  display: inline-flex;
17
17
  line-height: 1;
@@ -19,9 +19,18 @@ const StyledToolbarButton = styled.button(props => {
19
19
  justify-content: center;
20
20
  height: ${size};
21
21
  min-width: ${size};
22
- opacity: ${active ? 'inherit' : '0.7'};
22
+ opacity: '0.7';
23
23
  cursor: pointer;
24
24
 
25
+ ${active &&
26
+ css `
27
+ background-color: ${activeColor};
28
+ color: ${theme.base.palette.interactive};
29
+ opacity: inherit;
30
+ box-shadow: inset 0 -0.125rem 0 0 ${theme.base.palette.interactive};
31
+ border-inline: 0.25rem solid transparent;
32
+ `}
33
+
25
34
  &:focus {
26
35
  box-shadow: ${theme.base.shadow.focus};
27
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ToolbarButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,OAAO,EACR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAa1D,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAqB,KAAK,CAAC,EAAE;IACpE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,IAAI,GAAG,YAAY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC;IACrD,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,CAChC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CACpF,CAAC;IACF,OAAO,GAAG,CAAA;wBACY,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa;;aAE/C,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;;;;;;cAM/E,IAAI;iBACD,IAAI;eACN,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;;;;oBAIrB,KAAK,CAAC,IAAI,CAAC,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E,IAAI,OAAO,IAAI,CAChB,KAAC,OAAO,IAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACnD,OAAO,GACA,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FC, KeyboardEvent, MouseEvent, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport {\n defaultThemeProp,\n Tooltip,\n tryCatch,\n useConsolidatedRef,\n useElement,\n useI18n\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport { useRTEContext } from '../RichTextEditor.context';\n\nimport type { StyleType } from './Toolbar.types';\n\nexport interface ToolBarButtonProps {\n tooltip?: string;\n active?: boolean;\n styleType?: StyleType;\n disabled?: boolean;\n label?: string;\n onMouseDown?: (e: MouseEvent | KeyboardEvent) => void;\n}\n\nconst StyledToolbarButton = styled.button<ToolBarButtonProps>(props => {\n const { active, theme, styleType } = props;\n const size = `calc(4 * ${props.theme.base.spacing})`;\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n return css`\n background-color: ${active ? activeColor : 'transparent'};\n border: none;\n color: ${active ? theme.base.palette.interactive : theme.base.palette['foreground-color']};\n outline: none;\n display: inline-flex;\n line-height: 1;\n align-items: center;\n justify-content: center;\n height: ${size};\n min-width: ${size};\n opacity: ${active ? 'inherit' : '0.7'};\n cursor: pointer;\n\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n\n &:hover {\n opacity: 1;\n }\n\n &:disabled {\n cursor: not-allowed;\n box-shadow: none;\n }\n\n ${styleType === 'BOLD' &&\n css`\n font-weight: bold;\n `}\n\n ${styleType === 'ITALIC' &&\n css`\n font-style: italic;\n `}\n\n ${styleType === 'STRIKE-THROUGH' &&\n css`\n text-decoration: line-through;\n `}\n `;\n});\n\nStyledToolbarButton.defaultProps = defaultThemeProp;\n\nconst ToolbarButton: FC<ToolBarButtonProps & ForwardProps> = forwardRef(function ToolbarButton(\n { tooltip, active, styleType, disabled, label, onMouseDown, ...restProps },\n ref: Ref<HTMLButtonElement>\n) {\n const { disabled: contextDisabled } = useRTEContext();\n const [el, setEl] = useElement();\n const toolBarRef = useConsolidatedRef<HTMLButtonElement>(setEl, ref);\n const t = useI18n();\n return (\n <>\n <StyledToolbarButton\n active={active}\n styleType={styleType}\n ref={toolBarRef}\n disabled={contextDisabled || disabled}\n tabIndex={-1}\n onKeyPress={(e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter') {\n onMouseDown?.(e);\n }\n }}\n onMouseDown={onMouseDown}\n type='button'\n aria-label={`${label}${active ? ` - ${t('active')}` : ''}`}\n aria-pressed={active}\n {...restProps}\n />\n {el && tooltip && (\n <Tooltip target={el} showDelay='none' hideDelay='none'>\n {tooltip}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default ToolbarButton;\n"]}
1
+ {"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/ToolbarButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,UAAU,EACV,OAAO,EACR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAa1D,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAqB,KAAK,CAAC,EAAE;IACpE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,IAAI,GAA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AAE,CAAC;IACpB,OAAO,CACL,8BACE,KAAC,mBAAmB,IAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,eAAe,IAAI,QAAQ,EACrC,QAAQ,EAAE,CAAC,CAAC,EACZ,UAAU,EAAE,CAAC,CAAmC,EAAE,EAAE;oBAClD,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;wBACtB,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnB,CAAC;gBACH,CAAC,EACD,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,QAAQ,gBACD,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,kBAC5C,MAAM,KAChB,SAAS,GACb,EACD,EAAE,IAAI,OAAO,IAAI,CAChB,KAAC,OAAO,IAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,YACnD,OAAO,GACA,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FC, KeyboardEvent, MouseEvent, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport {\n defaultThemeProp,\n Tooltip,\n tryCatch,\n useConsolidatedRef,\n useElement,\n useI18n\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport { useRTEContext } from '../RichTextEditor.context';\n\nimport type { StyleType } from './Toolbar.types';\n\nexport interface ToolBarButtonProps {\n tooltip?: string;\n active?: boolean;\n styleType?: StyleType;\n disabled?: boolean;\n label?: string;\n onMouseDown?: (e: MouseEvent | KeyboardEvent) => void;\n}\n\nconst StyledToolbarButton = styled.button<ToolBarButtonProps>(props => {\n const { active, theme, styleType } = props;\n const size = `calc(4 * ${props.theme.base.spacing})`;\n const activeColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n return css`\n background-color: transparent;\n border: none;\n color: ${theme.base.palette['foreground-color']};\n outline: none;\n display: inline-flex;\n line-height: 1;\n align-items: center;\n justify-content: center;\n height: ${size};\n min-width: ${size};\n opacity: '0.7';\n cursor: pointer;\n\n ${active &&\n css`\n background-color: ${activeColor};\n color: ${theme.base.palette.interactive};\n opacity: inherit;\n box-shadow: inset 0 -0.125rem 0 0 ${theme.base.palette.interactive};\n border-inline: 0.25rem solid transparent;\n `}\n\n &:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n\n &:hover {\n opacity: 1;\n }\n\n &:disabled {\n cursor: not-allowed;\n box-shadow: none;\n }\n\n ${styleType === 'BOLD' &&\n css`\n font-weight: bold;\n `}\n\n ${styleType === 'ITALIC' &&\n css`\n font-style: italic;\n `}\n\n ${styleType === 'STRIKE-THROUGH' &&\n css`\n text-decoration: line-through;\n `}\n `;\n});\n\nStyledToolbarButton.defaultProps = defaultThemeProp;\n\nconst ToolbarButton: FC<ToolBarButtonProps & ForwardProps> = forwardRef(function ToolbarButton(\n { tooltip, active, styleType, disabled, label, onMouseDown, ...restProps },\n ref: Ref<HTMLButtonElement>\n) {\n const { disabled: contextDisabled } = useRTEContext();\n const [el, setEl] = useElement();\n const toolBarRef = useConsolidatedRef<HTMLButtonElement>(setEl, ref);\n const t = useI18n();\n return (\n <>\n <StyledToolbarButton\n active={active}\n styleType={styleType}\n ref={toolBarRef}\n disabled={contextDisabled || disabled}\n tabIndex={-1}\n onKeyPress={(e: KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter') {\n onMouseDown?.(e);\n }\n }}\n onMouseDown={onMouseDown}\n type='button'\n aria-label={`${label}${active ? ` - ${t('active')}` : ''}`}\n aria-pressed={active}\n {...restProps}\n />\n {el && tooltip && (\n <Tooltip target={el} showDelay='none' hideDelay='none'>\n {tooltip}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default ToolbarButton;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QACnB,OAAO,QACN,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,KACnE,MAUF,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/Toolbar/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GACxB,KAAK,OAAO,EACZ,MAAM,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,KACnE,MAUF,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/htmlConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAYnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAkBjB,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AA8IX,eAAO,MAAM,WAAW,SAChB,MAAM,yBACW,mBAAmB,CAAC,sBAAsB,CAAC,KACjE,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAe9B,CAAC"}
1
+ {"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/htmlConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAYnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAkBjB,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AA8IX,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,uBAAuB,mBAAmB,CAAC,sBAAsB,CAAC,KACjE,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAe9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interactionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/interactionRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,UAAU,UAAW,SAAQ,oBAAoB;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,UAAU,gBAAiB,SAAQ,oBAAoB;IACrD,IAAI,EAAE,MAAM,CAAC;CACd;AAKD,eAAO,MAAM,UAAU,WAAY,gBAAgB,iBAclD,CAAC;AAGF,eAAO,MAAM,gBAAgB,YAAa,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAc3E,CAAC;AAGF,QAAA,MAAM,2BAA2B,SACzB,MAAM,cACA,oBAAoB,EAAE,KACjC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAuG9B,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"interactionRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/interactionRenderer.ts"],"names":[],"mappings":"A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AE,gBAC/B,mBAAmB,CAAC,aAAa,CAAC,KAC/C,CAAC,OAAO,GAAG,IAAI,CAAC,EAIlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"markdownConverter.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/markdownConverter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAK1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAIzF,eAAO,MAAM,OAAO,GAClB,OAAO,WAAW,EAClB,uBAAuB,oBAAoB,EAAE,EAC7C,cAAc,mBAAmB,CAAC,aAAa,CAAC,KAC/C,OAAO,GAAG,IAyIZ,CAAC;AAYF,eAAO,MAAM,wBAAwB,GACnC,WAAO,EACP,kBAAkB,oBAAoB,EAAE,KACvC,CAAC,OAAO,GAAG,IAAI,CAAC,EAOlB,CAAC;AAIF,QAAA,MAAM,eAAe,GACnB,IAAI,MAAM,EACV,uBAAuB,oBAAoB,EAAE,EAC7C,cAAc,mBAAmB,CAAC,aAAa,CAAC,KAC/C,CAAC,OAAO,GAAG,IAAI,CAAC,EAIlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/renderers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAYpE,eAAO,MAAM,iBAAiB,UAAW,kBAAkB,gBAsG1D,CAAC;AAEF,KAAK,IAAI,GAAG;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,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,aAAa,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,YAAY,CAAA;KAAE,CAAC,CAAC;IAC7F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAGF,eAAO,MAAM,YAAY,GAAI,MAAM,IAAI,gBA4EtC,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe,4CAiCvD,CAAC;AAEF,eAAO,MAAM,UAAU,0GAEtB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,UAAU,CAAC,IAAI,4CAgCjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,OAAO,CAAC;AAItC,eAAO,MAAM,cAAc,WACjB,MAAM,+BACe;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;aAyCjF,CAAC"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,OAAO,CAAC;AAItC,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,6BAA6B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;aAyCjF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slateConverter.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/slateConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKtC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAyB1B,CAAC;AA8BF,eAAO,MAAM,aAAa,UAAW,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,KAAG,MAkCzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,KAAG,MAW9D,CAAC"}
1
+ {"version":3,"file":"slateConverter.d.ts","sourceRoot":"","sources":["../../../../src/components/RichTextEditor/utils/slateConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKtC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAyB1B,CAAC;AA8BF,eAAO,MAAM,aAAa,GAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,KAAG,MAkCzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,KAAG,MAW9D,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-rte",
3
- "version": "8.0.1",
4
- "repository": {
5
- "type": "git",
6
- "url": "git+https://github.com/pegasystems/cosmos-react.git",
7
- "directory": "packages/cosmos-rte"
8
- },
3
+ "version": "8.2.0",
9
4
  "license": "SEE LICENSE IN LICENSE",
10
5
  "author": "Pegasystems",
11
6
  "sideEffects": false,
@@ -19,7 +14,7 @@
19
14
  "build": "tsc -b tsconfig.build.json"
20
15
  },
21
16
  "dependencies": {
22
- "@pega/cosmos-react-core": "8.0.1",
17
+ "@pega/cosmos-react-core": "8.2.0",
23
18
  "@popperjs/core": "^2.11.6",
24
19
  "@types/parse5": "^6.0.0",
25
20
  "@types/react": "^17.0.62 || ^18.3.3",
@@ -45,6 +40,6 @@
45
40
  "@storybook/react": "~8.2.9",
46
41
  "@storybook/theming": "~8.2.9",
47
42
  "@testing-library/react": "^16.0.0",
48
- "typescript": "~5.5.4"
43
+ "typescript": "~5.8.3"
49
44
  }
50
45
  }