@azure/communication-react 1.19.0-alpha-202408020014 → 1.19.0-alpha-202408070015

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 (51) hide show
  1. package/dist/communication-react.d.ts +7 -0
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DM13Kp5W.js → ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DM13Kp5W.js.map → ChatMessageComponentAsRichTextEditBox-BMVUY7HX.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-8FsFMpKF.js → RichTextSendBoxWrapper-UkjXSVQH.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-8FsFMpKF.js.map → RichTextSendBoxWrapper-UkjXSVQH.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-D84PSTZV.js → index-D46R0M5v.js} +207 -180
  7. package/dist/dist-cjs/communication-react/index-D46R0M5v.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +31 -9
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +5 -1
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +6 -2
  16. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -1
  18. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +2 -5
  20. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +48 -31
  21. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.d.ts +5 -1
  23. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +15 -12
  24. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.d.ts +9 -0
  26. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +7 -1
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +4 -0
  29. package/dist/dist-esm/react-components/src/components/VideoGallery.js +4 -4
  30. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +3 -1
  32. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +1 -0
  34. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +1 -0
  35. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +7 -3
  37. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -0
  39. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +2 -0
  40. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +6 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +3 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  45. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +4 -2
  46. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
  47. package/package.json +6 -6
  48. package/dist/dist-cjs/communication-react/index-D84PSTZV.js.map +0 -1
  49. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/LocalScreenShare.styles.d.ts +0 -22
  50. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/LocalScreenShare.styles.js +0 -44
  51. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/LocalScreenShare.styles.js.map +0 -1
@@ -26,7 +26,9 @@ export const richTextEditorWrapperStyle = (theme) => {
26
26
  maxWidth: '100%',
27
27
  color: theme.palette.neutralPrimary,
28
28
  '& img': {
29
- margin: '0.2rem'
29
+ margin: '0.2rem',
30
+ maxWidth: '100% !important', // Remove !important when resolving issue where rooster sets width/height in style attribute incorrectly
31
+ height: 'auto !important' // Remove !important when resolving issue where rooster sets width/height in style attribute incorrectly
30
32
  },
31
33
  '& table': {
32
34
  background: 'transparent',
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/RichTextEditor.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAA0E,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+C,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MAAM,0BAA0B,GAAG,WAAW,CAAC;IACpD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,QAAQ;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACpD,SAAS,EAAE,UAAU;CACtB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { IButtonStyles, ICommandBarStyles, IContextualMenuStyles, IStyle, Theme, mergeStyles } from '@fluentui/react';\nimport { editorTextBoxButtonStyle } from './SendBox.styles';\nimport { RichTextEditorStyleProps } from '../RichTextEditor/RichTextEditor';\n\n/**\n * @private\n */\nexport const richTextEditorStyle = (props: { minHeight: string; maxHeight: string }): string => {\n return mergeStyles({\n border: 'none',\n overflow: 'auto',\n outline: 'none',\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n maxWidth: '100%',\n paddingTop: '0.5rem'\n });\n};\n\n/**\n * @private\n */\nexport const richTextEditorWrapperStyle = (theme: Theme): string => {\n return mergeStyles({\n paddingInlineStart: `0.75rem`,\n paddingInlineEnd: `0.75rem`,\n maxWidth: '100%',\n color: theme.palette.neutralPrimary,\n '& img': {\n margin: '0.2rem'\n },\n '& table': {\n background: 'transparent',\n borderCollapse: 'collapse',\n width: '100%',\n borderSpacing: '0',\n tableLayout: 'auto',\n\n '& tr': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralSecondary}`,\n\n '& td': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralSecondary}`,\n wordBreak: 'normal',\n padding: '0.125rem 0.25rem',\n verticalAlign: 'top'\n }\n }\n }\n });\n};\n\n/**\n * @private\n */\nexport const richTextActionButtonsStackStyle = mergeStyles({\n paddingRight: `0.125rem`\n});\n\n/**\n * @private\n */\nexport const richTextActionButtonsStyle = mergeStyles({\n height: '2.25rem',\n width: '2.25rem',\n margin: 'auto'\n});\n\n/**\n * @private\n */\nexport const richTextActionButtonsDividerStyle = (theme: Theme): string => {\n return mergeStyles({\n color: theme.palette.neutralQuaternaryAlt,\n margin: '0.375rem -0.5rem 0 -0.5rem',\n backgroundColor: 'transparent'\n });\n};\n\n/**\n * @private\n */\nexport const ribbonOverflowButtonStyle = (theme: Theme): Partial<IContextualMenuStyles> => {\n return {\n subComponentStyles: {\n menuItem: {\n icon: { color: theme.palette.neutralPrimary, paddingTop: '0.5rem' },\n root: ribbonOverflowButtonRootStyles(theme)\n },\n callout: {}\n }\n };\n};\n\nconst ribbonOverflowButtonRootStyles = (theme: Theme): IStyle => {\n return {\n selectors: {\n // Icon's color doesn't work here because of the specificity\n '&:hover': {\n selectors: {\n '.ms-ContextualMenu-icon': {\n color: theme.palette.neutralPrimary\n }\n }\n },\n '.ribbon-table-button-regular-icon': {\n display: 'inline-block',\n margin: '0 0.25rem 0 0.25rem',\n width: '1.25rem',\n height: '1.25rem'\n },\n '.ribbon-table-button-filled-icon': {\n display: 'none'\n }\n }\n };\n};\n\nconst ribbonButtonRootStyles = (iconColor: string, hoverIconColor: string): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n // media query applies only if the device allows real hover interactions\n // and hover styles are not applied on touch- only devices where the hover state cannot be accurately detected\n '@media (hover: hover)': {\n ':hover .ms-Button-icon': {\n color: hoverIconColor\n },\n ':hover .ms-Button-menuIcon': {\n color: hoverIconColor\n }\n },\n // the classes needs here to apply to styles for icons because of the specificity\n '.ms-Button-icon': {\n color: iconColor\n },\n '.ms-Button-menuIcon': {\n color: iconColor\n }\n }\n };\n};\n\n/**\n * @private\n */\nexport const toolbarButtonStyle = (theme: Theme): Partial<IButtonStyles> => {\n return {\n icon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },\n menuIcon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },\n root: { minWidth: 'auto', backgroundColor: 'transparent' },\n rootChecked: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n // there is a bug for Android where the press action is considered hover sometimes\n rootHovered: ribbonButtonRootStyles(theme.palette.neutralPrimary, theme.palette.themePrimary),\n rootCheckedHovered: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootCheckedPressed: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootPressed: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootExpanded: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootExpandedHovered: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary)\n };\n};\n\nconst rootRibbonTableButtonStyle = (theme: Theme): IStyle => {\n // merge IStyles props\n return Object.assign({ minWidth: 'auto' }, ribbonTableButtonRootStyles(theme, false));\n};\n\n/**\n * @private\n */\nexport const toolbarTableButtonStyle = (theme: Theme): Partial<IButtonStyles> => {\n return {\n icon: { height: 'auto' },\n menuIcon: { height: 'auto' },\n root: rootRibbonTableButtonStyle(theme),\n rootChecked: ribbonTableButtonRootStyles(theme, true),\n rootHovered: ribbonTableButtonRootStyles(theme, true),\n rootCheckedHovered: ribbonTableButtonRootStyles(theme, true),\n rootCheckedPressed: ribbonTableButtonRootStyles(theme, true),\n rootPressed: ribbonTableButtonRootStyles(theme, true),\n rootExpanded: ribbonTableButtonRootStyles(theme, true),\n rootExpandedHovered: ribbonTableButtonRootStyles(theme, true)\n };\n};\nconst ribbonTableButtonRootStyles = (theme: Theme, isSelected: boolean): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n '.ribbon-table-button-regular-icon': {\n width: '1.25rem',\n height: '1.25rem',\n margin: '0 0.25rem 0 0.25rem',\n color: theme.palette.neutralPrimary,\n display: isSelected ? 'none' : 'inline-block'\n },\n '.ribbon-table-button-filled-icon': {\n width: '1.25rem',\n height: '1.25rem',\n margin: '0 0.25rem 0 0.25rem',\n color: theme.palette.themePrimary,\n display: isSelected ? 'inline-block' : 'none'\n }\n }\n };\n};\n\n/**\n * @private\n */\nexport const ribbonDividerStyle = (theme: Theme): string => {\n return mergeStyles({\n color: theme.palette.neutralQuaternaryAlt,\n margin: '0 -0.5rem',\n paddingTop: '0.25rem'\n });\n};\n\n/**\n * @private\n */\nexport const richTextToolbarStyle: Partial<ICommandBarStyles> = {\n // Override for the default white color of the Ribbon component\n root: { backgroundColor: 'transparent', padding: '0.25rem 0 0 0', height: '2rem' }\n};\n\n/**\n * @private\n */\nexport const richTextFormatButtonIconStyle = (theme: Theme, isSelected: boolean): string => {\n return mergeStyles(editorTextBoxButtonStyle, {\n color: isSelected ? theme.palette.themePrimary : theme.palette.neutralSecondary\n });\n};\n\n/**\n * @private\n */\nexport const editBoxRichTextEditorStyle = (): RichTextEditorStyleProps => {\n return {\n minHeight: '2.25rem',\n maxHeight: '8rem'\n };\n};\n\n/**\n * @private\n */\nexport const sendBoxRichTextEditorStyle = (isExpanded: boolean): RichTextEditorStyleProps => {\n return {\n minHeight: isExpanded ? '4rem' : '1.25rem',\n maxHeight: '8rem'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonStyles = (theme: Theme): IStyle => {\n return {\n width: '24px',\n height: '24px',\n border: `solid 1px ${theme.palette.neutralSecondaryAlt}`,\n cursor: 'pointer',\n background: 'transparent'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonSelectedStyles = (theme: Theme): IStyle => {\n return {\n background: theme.palette.themePrimary,\n border: `solid 1px ${theme.palette.themeLighterAlt}`\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTablePane = mergeStyles({\n padding: '8px 10px 12px 10px',\n boxSizing: 'content-box',\n minWidth: 'auto'\n});\n\n/**\n * @private\n */\nexport const insertTableMenuFocusZone = (theme: Theme): string => {\n return mergeStyles({\n display: 'inline-grid',\n gridTemplateColumns: 'auto auto auto auto auto',\n border: `solid 1px ${theme.palette.neutralSecondaryAlt}`\n });\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTitleStyles = mergeStyles({\n width: '100%',\n height: '1rem',\n fontSize: '0.75rem',\n marginBottom: '0.5rem'\n});\n\n/**\n * @private\n */\nexport const tableContextMenuIconStyles = mergeStyles({\n marginTop: '0.375rem'\n});\n"]}
1
+ {"version":3,"file":"RichTextEditor.styles.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/RichTextEditor.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAA0E,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+C,EAAU,EAAE;IAC7F,OAAO,WAAW,CAAC;QACjB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,QAAQ;KACrB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAU,EAAE;IACjE,OAAO,WAAW,CAAC;QACjB,kBAAkB,EAAE,SAAS;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;QACnC,OAAO,EAAE;YACP,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,iBAAiB,EAAE,wGAAwG;YACrI,MAAM,EAAE,iBAAiB,CAAC,wGAAwG;SACnI;QACD,SAAS,EAAE;YACT,UAAU,EAAE,aAAa;YACzB,cAAc,EAAE,UAAU;YAC1B,KAAK,EAAE,MAAM;YACb,aAAa,EAAE,GAAG;YAClB,WAAW,EAAE,MAAM;YAEnB,MAAM,EAAE;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AY;QACtC,MAAM,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE;KACrD,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;IAClD,OAAO,EAAE,oBAAoB;IAC7B,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,MAAM;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAY,EAAU,EAAE;IAC/D,OAAO,WAAW,CAAC;QACjB,OAAO,EAAE,aAAa;QACtB,mBAAmB,EAAE,0BAA0B;QAC/C,MAAM,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE;KACzD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACpD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,SAAS;IACnB,YAAY,EAAE,QAAQ;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACpD,SAAS,EAAE,UAAU;CACtB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { IButtonStyles, ICommandBarStyles, IContextualMenuStyles, IStyle, Theme, mergeStyles } from '@fluentui/react';\nimport { editorTextBoxButtonStyle } from './SendBox.styles';\nimport { RichTextEditorStyleProps } from '../RichTextEditor/RichTextEditor';\n\n/**\n * @private\n */\nexport const richTextEditorStyle = (props: { minHeight: string; maxHeight: string }): string => {\n return mergeStyles({\n border: 'none',\n overflow: 'auto',\n outline: 'none',\n minHeight: props.minHeight,\n maxHeight: props.maxHeight,\n maxWidth: '100%',\n paddingTop: '0.5rem'\n });\n};\n\n/**\n * @private\n */\nexport const richTextEditorWrapperStyle = (theme: Theme): string => {\n return mergeStyles({\n paddingInlineStart: `0.75rem`,\n paddingInlineEnd: `0.75rem`,\n maxWidth: '100%',\n color: theme.palette.neutralPrimary,\n '& img': {\n margin: '0.2rem',\n maxWidth: '100% !important', // Remove !important when resolving issue where rooster sets width/height in style attribute incorrectly\n height: 'auto !important' // Remove !important when resolving issue where rooster sets width/height in style attribute incorrectly\n },\n '& table': {\n background: 'transparent',\n borderCollapse: 'collapse',\n width: '100%',\n borderSpacing: '0',\n tableLayout: 'auto',\n\n '& tr': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralSecondary}`,\n\n '& td': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralSecondary}`,\n wordBreak: 'normal',\n padding: '0.125rem 0.25rem',\n verticalAlign: 'top'\n }\n }\n }\n });\n};\n\n/**\n * @private\n */\nexport const richTextActionButtonsStackStyle = mergeStyles({\n paddingRight: `0.125rem`\n});\n\n/**\n * @private\n */\nexport const richTextActionButtonsStyle = mergeStyles({\n height: '2.25rem',\n width: '2.25rem',\n margin: 'auto'\n});\n\n/**\n * @private\n */\nexport const richTextActionButtonsDividerStyle = (theme: Theme): string => {\n return mergeStyles({\n color: theme.palette.neutralQuaternaryAlt,\n margin: '0.375rem -0.5rem 0 -0.5rem',\n backgroundColor: 'transparent'\n });\n};\n\n/**\n * @private\n */\nexport const ribbonOverflowButtonStyle = (theme: Theme): Partial<IContextualMenuStyles> => {\n return {\n subComponentStyles: {\n menuItem: {\n icon: { color: theme.palette.neutralPrimary, paddingTop: '0.5rem' },\n root: ribbonOverflowButtonRootStyles(theme)\n },\n callout: {}\n }\n };\n};\n\nconst ribbonOverflowButtonRootStyles = (theme: Theme): IStyle => {\n return {\n selectors: {\n // Icon's color doesn't work here because of the specificity\n '&:hover': {\n selectors: {\n '.ms-ContextualMenu-icon': {\n color: theme.palette.neutralPrimary\n }\n }\n },\n '.ribbon-table-button-regular-icon': {\n display: 'inline-block',\n margin: '0 0.25rem 0 0.25rem',\n width: '1.25rem',\n height: '1.25rem'\n },\n '.ribbon-table-button-filled-icon': {\n display: 'none'\n }\n }\n };\n};\n\nconst ribbonButtonRootStyles = (iconColor: string, hoverIconColor: string): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n // media query applies only if the device allows real hover interactions\n // and hover styles are not applied on touch- only devices where the hover state cannot be accurately detected\n '@media (hover: hover)': {\n ':hover .ms-Button-icon': {\n color: hoverIconColor\n },\n ':hover .ms-Button-menuIcon': {\n color: hoverIconColor\n }\n },\n // the classes needs here to apply to styles for icons because of the specificity\n '.ms-Button-icon': {\n color: iconColor\n },\n '.ms-Button-menuIcon': {\n color: iconColor\n }\n }\n };\n};\n\n/**\n * @private\n */\nexport const toolbarButtonStyle = (theme: Theme): Partial<IButtonStyles> => {\n return {\n icon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },\n menuIcon: { color: theme.palette.neutralPrimary, height: 'auto', paddingTop: '0.25rem' },\n root: { minWidth: 'auto', backgroundColor: 'transparent' },\n rootChecked: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n // there is a bug for Android where the press action is considered hover sometimes\n rootHovered: ribbonButtonRootStyles(theme.palette.neutralPrimary, theme.palette.themePrimary),\n rootCheckedHovered: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootCheckedPressed: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootPressed: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootExpanded: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary),\n rootExpandedHovered: ribbonButtonRootStyles(theme.palette.themePrimary, theme.palette.themePrimary)\n };\n};\n\nconst rootRibbonTableButtonStyle = (theme: Theme): IStyle => {\n // merge IStyles props\n return Object.assign({ minWidth: 'auto' }, ribbonTableButtonRootStyles(theme, false));\n};\n\n/**\n * @private\n */\nexport const toolbarTableButtonStyle = (theme: Theme): Partial<IButtonStyles> => {\n return {\n icon: { height: 'auto' },\n menuIcon: { height: 'auto' },\n root: rootRibbonTableButtonStyle(theme),\n rootChecked: ribbonTableButtonRootStyles(theme, true),\n rootHovered: ribbonTableButtonRootStyles(theme, true),\n rootCheckedHovered: ribbonTableButtonRootStyles(theme, true),\n rootCheckedPressed: ribbonTableButtonRootStyles(theme, true),\n rootPressed: ribbonTableButtonRootStyles(theme, true),\n rootExpanded: ribbonTableButtonRootStyles(theme, true),\n rootExpandedHovered: ribbonTableButtonRootStyles(theme, true)\n };\n};\nconst ribbonTableButtonRootStyles = (theme: Theme, isSelected: boolean): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n '.ribbon-table-button-regular-icon': {\n width: '1.25rem',\n height: '1.25rem',\n margin: '0 0.25rem 0 0.25rem',\n color: theme.palette.neutralPrimary,\n display: isSelected ? 'none' : 'inline-block'\n },\n '.ribbon-table-button-filled-icon': {\n width: '1.25rem',\n height: '1.25rem',\n margin: '0 0.25rem 0 0.25rem',\n color: theme.palette.themePrimary,\n display: isSelected ? 'inline-block' : 'none'\n }\n }\n };\n};\n\n/**\n * @private\n */\nexport const ribbonDividerStyle = (theme: Theme): string => {\n return mergeStyles({\n color: theme.palette.neutralQuaternaryAlt,\n margin: '0 -0.5rem',\n paddingTop: '0.25rem'\n });\n};\n\n/**\n * @private\n */\nexport const richTextToolbarStyle: Partial<ICommandBarStyles> = {\n // Override for the default white color of the Ribbon component\n root: { backgroundColor: 'transparent', padding: '0.25rem 0 0 0', height: '2rem' }\n};\n\n/**\n * @private\n */\nexport const richTextFormatButtonIconStyle = (theme: Theme, isSelected: boolean): string => {\n return mergeStyles(editorTextBoxButtonStyle, {\n color: isSelected ? theme.palette.themePrimary : theme.palette.neutralSecondary\n });\n};\n\n/**\n * @private\n */\nexport const editBoxRichTextEditorStyle = (): RichTextEditorStyleProps => {\n return {\n minHeight: '2.25rem',\n maxHeight: '8rem'\n };\n};\n\n/**\n * @private\n */\nexport const sendBoxRichTextEditorStyle = (isExpanded: boolean): RichTextEditorStyleProps => {\n return {\n minHeight: isExpanded ? '4rem' : '1.25rem',\n maxHeight: '8rem'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonStyles = (theme: Theme): IStyle => {\n return {\n width: '24px',\n height: '24px',\n border: `solid 1px ${theme.palette.neutralSecondaryAlt}`,\n cursor: 'pointer',\n background: 'transparent'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonSelectedStyles = (theme: Theme): IStyle => {\n return {\n background: theme.palette.themePrimary,\n border: `solid 1px ${theme.palette.themeLighterAlt}`\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTablePane = mergeStyles({\n padding: '8px 10px 12px 10px',\n boxSizing: 'content-box',\n minWidth: 'auto'\n});\n\n/**\n * @private\n */\nexport const insertTableMenuFocusZone = (theme: Theme): string => {\n return mergeStyles({\n display: 'inline-grid',\n gridTemplateColumns: 'auto auto auto auto auto',\n border: `solid 1px ${theme.palette.neutralSecondaryAlt}`\n });\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTitleStyles = mergeStyles({\n width: '100%',\n height: '1rem',\n fontSize: '0.75rem',\n marginBottom: '0.5rem'\n});\n\n/**\n * @private\n */\nexport const tableContextMenuIconStyles = mergeStyles({\n marginTop: '0.375rem'\n});\n"]}
@@ -10,6 +10,7 @@ export declare enum PluginEventType {
10
10
  BeforeSetContent = "beforeSetContent",
11
11
  Input = "input",
12
12
  KeyDown = "keyDown",
13
+ BeforeCutCopy = "beforeCutCopy",
13
14
  BeforePaste = "beforePaste",
14
15
  ZoomChanged = "zoomChanged",
15
16
  MouseUp = "mouseUp"
@@ -12,6 +12,7 @@ export var PluginEventType;
12
12
  PluginEventType["BeforeSetContent"] = "beforeSetContent";
13
13
  PluginEventType["Input"] = "input";
14
14
  PluginEventType["KeyDown"] = "keyDown";
15
+ PluginEventType["BeforeCutCopy"] = "beforeCutCopy";
15
16
  PluginEventType["BeforePaste"] = "beforePaste";
16
17
  PluginEventType["ZoomChanged"] = "zoomChanged";
17
18
  PluginEventType["MouseUp"] = "mouseUp";
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditorUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextEditorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,CAAN,IAAY,eAUX;AAVD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,wDAAqC,CAAA;IACrC,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,8CAA2B,CAAA;IAC3B,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;AACrB,CAAC,EAVW,eAAe,KAAf,eAAe,QAU1B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,yBAEX;AAFD,WAAY,yBAAyB;IACnC,4CAAe,CAAA;AACjB,CAAC,EAFW,yBAAyB,KAAzB,yBAAyB,QAEpC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAE,OAAoB,EAAE,OAA0B,EAAQ,EAAE;IAC5G,IAAI,OAAO,YAAY,oBAAoB,EAAE,CAAC;QAC5C,kCAAkC;QAClC,wCAAwC;QACxC,iCAAiC;IACnC,CAAC;SAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC;QAChD,4CAA4C;QAC5C,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;AACH,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAqB,EAAE,OAAoB,EAAE,OAA0B,EAAQ,EAAE;IAC9G,IAAI,OAAO,YAAY,gBAAgB,EAAE,CAAC;QACxC,oCAAoC;QACpC,wCAAwC;QACxC,iCAAiC;IACnC,CAAC;SAAM,IAAI,OAAO,CAAC,qBAAq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CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,mBAA2C,EAAQ,EAAE;IACtF,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnD,qBAAqB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,CAAC,mBAA2C,EAAE,OAAe,EAAQ,EAAE;IACnG,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BorderFormat, DatasetFormat, ModelToDomContext } from 'roosterjs-content-model-types';\n\n/**\n * Plugin event type for RoosterJS plugins\n * @private\n */\nexport enum PluginEventType {\n EditorReady = 'editorReady',\n BeforeDispose = 'beforeDispose',\n ContentChanged = 'contentChanged',\n BeforeSetContent = 'beforeSetContent',\n Input = 'input',\n KeyDown = 'keyDown',\n BeforePaste = 'beforePaste',\n ZoomChanged = 'zoomChanged',\n MouseUp = 'mouseUp'\n}\n\n/**\n * ContentChanged event source for RoosterJS\n * @private\n */\nexport enum ContentChangedEventSource {\n Paste = 'Paste'\n}\n\n/**\n * Applies the border format to the specified element.\n * If the element is an HTMLTableCellElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, the default format applier is used.\n */\nexport const borderApplier = (format: BorderFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableCellElement) {\n // don't set format for table cell\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.border) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.border(format, element, context);\n }\n};\n\n/**\n * Applies the dataset format to the given HTML element.\n * If the element is an HTMLTableElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, it applies the default formats.\n */\nexport const dataSetApplier = (format: DatasetFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableElement) {\n // don't set editing info for tables\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.dataset) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.dataset(format, element, context);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getPreviousInlineImages = (content?: string): Record<string, string>[] => {\n if (!content) {\n return [];\n }\n const previousInlineImages: Record<string, string>[] = [];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageAttributes = getInlineImageAttributes(img);\n previousInlineImages.push(imageAttributes);\n });\n return previousInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getRemovedInlineImages = (\n content: string,\n previousInlineImages: Record<string, string>[]\n): Record<string, string>[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentIds = Array.from(document.querySelectorAll('img')).map((img) => img.id);\n previousInlineImages = previousInlineImages?.filter((img) => !currentContentIds?.includes(img.id));\n\n const removedInlineImages = [...previousInlineImages];\n return removedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInsertedInlineImages = (\n content: string,\n previousInlineImages: NodeListOf<HTMLImageElement>\n): HTMLImageElement[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentInlineImages = Array.from(document.querySelectorAll('img'));\n const previousContentIds = Array.from(previousInlineImages).map((img) => img.id);\n // if check is updated, also update getRemovedInlineImages\n const insertedInlineImages = currentContentInlineImages.filter((img) => !previousContentIds.includes(img.id));\n return insertedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInlineImageAttributes = (image: HTMLImageElement): Record<string, string> => {\n const imageAttributes: Record<string, string> = {};\n image.getAttributeNames().forEach((attrName) => {\n const attrValue = image.getAttribute(attrName);\n if (attrValue) {\n imageAttributes[attrName] = attrValue;\n }\n });\n return imageAttributes;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * @internal\n */\n/**\n * Update the scroll position of the editor to ensure the content is visible.\n */\nexport const scrollToBottomRichTextEditor = (): void => {\n // Get the current selection in the document\n const selection = document.getSelection();\n\n // Check if a selection exists and it has at least one range\n if (!selection || selection.rangeCount <= 0) {\n // If no selection or range, exit the function\n return;\n }\n\n // Get the first range of the selection\n // A user can normally only select one range at a time, so the rangeCount will usually be 1\n const range = selection.getRangeAt(0);\n\n // If the common ancestor container of the range is the document itself,\n // it might mean that the editable element is getting removed from the DOM\n // In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error\n if (range.commonAncestorContainer === document) {\n return;\n }\n\n // Create a temporary span element to use as an anchor for scrolling\n // We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error\n const tempElement = document.createElement('span');\n // Collapse the range to its end point\n // This means the start and end points of the range will be the same, and it will not contain any content\n range.collapse(false);\n // Insert the temporary element at the cursor's position at the end of the range\n range.insertNode(tempElement);\n // Scroll the temporary element into view\n // the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly\n tempElement.scrollIntoView({\n block: 'center'\n });\n tempElement.remove();\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke the blob urls in the removedInlineImages and remove them from the currentLocalBlobMap\n * @internal\n */\nexport const removeLocalBlobs = (\n currentLocalBlobMap: Record<string, string>,\n removedInlineImages: Record<string, string>[]\n): void => {\n removedInlineImages.forEach((image) => {\n removeSingleLocalBlob(currentLocalBlobMap, image.id);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke all the blob urls in the currentLocalBlobMap and clean up the currentLocalBlobMap\n * @internal\n */\nexport const cleanAllLocalBlobs = (currentLocalBlobMap: Record<string, string>): void => {\n Object.keys(currentLocalBlobMap).forEach((imageId) => {\n removeSingleLocalBlob(currentLocalBlobMap, imageId);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst removeSingleLocalBlob = (currentLocalBlobMap: Record<string, string>, imageId: string): void => {\n const blobUrl = currentLocalBlobMap[imageId];\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n delete currentLocalBlobMap[imageId];\n }\n};\n"]}
1
+ {"version":3,"file":"RichTextEditorUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextEditorUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;GAGG;AACH,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,wDAAqC,CAAA;IACrC,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,kDAA+B,CAAA;IAC/B,8CAA2B,CAAA;IAC3B,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;AACrB,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,yBAEX;AAFD,WAAY,yBAAyB;IACnC,4CAAe,CAAA;AACjB,CAAC,EAFW,yBAAyB,KAAzB,yBAAyB,QAEpC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAE,OAAoB,EAAE,OAA0B,EAAQ,EAAE;IAC5G,IAAI,OAAO,YAAY,oBAAoB,EAAE,CAA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AAC;IACnD,sCAAsC;IACtC,yGAAyG;IACzG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtB,gFAAgF;IAChF,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9B,yCAAyC;IACzC,8HAA8H;IAC9H,WAAW,CAAC,cAAc,CAAC;QACzB,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAC;IACH,WAAW,CAAC,MAAM,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,gEAAgE;AAChE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,mBAA2C,EAC3C,mBAA6C,EACvC,EAAE;IACR,mBAAmB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,qBAAqB,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,mBAA2C,EAAQ,EAAE;IACtF,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACnD,qBAAqB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,CAAC,mBAA2C,EAAE,OAAe,EAAQ,EAAE;IACnG,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC7B,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BorderFormat, DatasetFormat, ModelToDomContext } from 'roosterjs-content-model-types';\n\n/**\n * Plugin event type for RoosterJS plugins\n * @private\n */\nexport enum PluginEventType {\n EditorReady = 'editorReady',\n BeforeDispose = 'beforeDispose',\n ContentChanged = 'contentChanged',\n BeforeSetContent = 'beforeSetContent',\n Input = 'input',\n KeyDown = 'keyDown',\n BeforeCutCopy = 'beforeCutCopy',\n BeforePaste = 'beforePaste',\n ZoomChanged = 'zoomChanged',\n MouseUp = 'mouseUp'\n}\n\n/**\n * ContentChanged event source for RoosterJS\n * @private\n */\nexport enum ContentChangedEventSource {\n Paste = 'Paste'\n}\n\n/**\n * Applies the border format to the specified element.\n * If the element is an HTMLTableCellElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, the default format applier is used.\n */\nexport const borderApplier = (format: BorderFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableCellElement) {\n // don't set format for table cell\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.border) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.border(format, element, context);\n }\n};\n\n/**\n * Applies the dataset format to the given HTML element.\n * If the element is an HTMLTableElement, it skips setting editing info\n * and to use classes instead of inline styles.\n * For all other cases, it applies the default formats.\n */\nexport const dataSetApplier = (format: DatasetFormat, element: HTMLElement, context: ModelToDomContext): void => {\n if (element instanceof HTMLTableElement) {\n // don't set editing info for tables\n // as it will set inline styles for them\n // we want to use classes instead\n } else if (context.defaultFormatAppliers.dataset) {\n // apply default formats for all other cases\n context.defaultFormatAppliers.dataset(format, element, context);\n }\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getPreviousInlineImages = (content?: string): Record<string, string>[] => {\n if (!content) {\n return [];\n }\n const previousInlineImages: Record<string, string>[] = [];\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageAttributes = getInlineImageAttributes(img);\n previousInlineImages.push(imageAttributes);\n });\n return previousInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getRemovedInlineImages = (\n content: string,\n previousInlineImages: Record<string, string>[]\n): Record<string, string>[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentIds = Array.from(document.querySelectorAll('img')).map((img) => img.id);\n previousInlineImages = previousInlineImages?.filter((img) => !currentContentIds?.includes(img.id));\n\n const removedInlineImages = [...previousInlineImages];\n return removedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInsertedInlineImages = (\n content: string,\n previousInlineImages: NodeListOf<HTMLImageElement>\n): HTMLImageElement[] => {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n const currentContentInlineImages = Array.from(document.querySelectorAll('img'));\n const previousContentIds = Array.from(previousInlineImages).map((img) => img.id);\n // if check is updated, also update getRemovedInlineImages\n const insertedInlineImages = currentContentInlineImages.filter((img) => !previousContentIds.includes(img.id));\n return insertedInlineImages;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getInlineImageAttributes = (image: HTMLImageElement): Record<string, string> => {\n const imageAttributes: Record<string, string> = {};\n image.getAttributeNames().forEach((attrName) => {\n const attrValue = image.getAttribute(attrName);\n if (attrValue) {\n imageAttributes[attrName] = attrValue;\n }\n });\n return imageAttributes;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * @internal\n */\n/**\n * Update the scroll position of the editor to ensure the content is visible.\n */\nexport const scrollToBottomRichTextEditor = (): void => {\n // Get the current selection in the document\n const selection = document.getSelection();\n\n // Check if a selection exists and it has at least one range\n if (!selection || selection.rangeCount <= 0) {\n // If no selection or range, exit the function\n return;\n }\n\n // Get the first range of the selection\n // A user can normally only select one range at a time, so the rangeCount will usually be 1\n const range = selection.getRangeAt(0);\n\n // If the common ancestor container of the range is the document itself,\n // it might mean that the editable element is getting removed from the DOM\n // In such cases, especially in Safari, trying to modify the range might throw a HierarchyRequest error\n if (range.commonAncestorContainer === document) {\n return;\n }\n\n // Create a temporary span element to use as an anchor for scrolling\n // We can't use the anchor node directly because if it's a Text node, calling scrollIntoView() on it will throw an error\n const tempElement = document.createElement('span');\n // Collapse the range to its end point\n // This means the start and end points of the range will be the same, and it will not contain any content\n range.collapse(false);\n // Insert the temporary element at the cursor's position at the end of the range\n range.insertNode(tempElement);\n // Scroll the temporary element into view\n // the element will be aligned at the center of the scroll container, otherwise, text and images may be positioned incorrectly\n tempElement.scrollIntoView({\n block: 'center'\n });\n tempElement.remove();\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke the blob urls in the removedInlineImages and remove them from the currentLocalBlobMap\n * @internal\n */\nexport const removeLocalBlobs = (\n currentLocalBlobMap: Record<string, string>,\n removedInlineImages: Record<string, string>[]\n): void => {\n removedInlineImages.forEach((image) => {\n removeSingleLocalBlob(currentLocalBlobMap, image.id);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Revoke all the blob urls in the currentLocalBlobMap and clean up the currentLocalBlobMap\n * @internal\n */\nexport const cleanAllLocalBlobs = (currentLocalBlobMap: Record<string, string>): void => {\n Object.keys(currentLocalBlobMap).forEach((imageId) => {\n removeSingleLocalBlob(currentLocalBlobMap, imageId);\n });\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nconst removeSingleLocalBlob = (currentLocalBlobMap: Record<string, string>, imageId: string): void => {\n const blobUrl = currentLocalBlobMap[imageId];\n if (blobUrl) {\n URL.revokeObjectURL(blobUrl);\n delete currentLocalBlobMap[imageId];\n }\n};\n"]}
@@ -77,8 +77,7 @@ export const updateStylesOfInlineImages = (message, initialInlineImages) => __aw
77
77
  resolve();
78
78
  };
79
79
  imageElement.onerror = () => {
80
- console.log('Error loading image', img.src);
81
- rejects();
80
+ rejects(`Error loading image ${img.id}`);
82
81
  };
83
82
  });
84
83
  });
@@ -145,7 +144,12 @@ export const toAttachmentMetadata = (attachmentsWithProgress) => {
145
144
  export const modifyInlineImagesInContentString = (content, initialInlineImages, onCompleted) => __awaiter(void 0, void 0, void 0, function* () {
146
145
  let newContent = content;
147
146
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
148
- newContent = yield updateStylesOfInlineImages(content, initialInlineImages);
147
+ try {
148
+ newContent = yield updateStylesOfInlineImages(content, initialInlineImages);
149
+ }
150
+ catch (error) {
151
+ console.error('Error updating inline images: ', error);
152
+ }
149
153
  onCompleted === null || onCompleted === void 0 ? void 0 : onCompleted(newContent);
150
154
  });
151
155
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
@@ -1 +1 @@
1
- {"version":3,"file":"SendBoxUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/SendBoxUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAOlC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,uBAAmE,EAC1D,EAAE;IACX,OAAO,CAAC,CAAC,CACP,CAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,MAAM;QAC/B,CAAC,uBAAuB;aACrB,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;aACrD,KAAK,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,KAAK,CAAC,IAAI,gBAAgB,CAAC,QAAQ,KAAK,SAAS,CAAC,CAC3G,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,uBAAmE,EAC1D,EAAE;IACX,OAAO,CAAC,CAAC,CAAA,uBAAuB,aAAvB,uB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AAC,GAAG,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAC9C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,CACxE,CAAC;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC;YACxB,GAAG,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const MAXIMUM_LENGTH_OF_MESSAGE = 8000;\nconst EMPTY_MESSAGE_REGEX = /^\\s*$/;\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const hasIncompleteAttachmentUploads = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!(\n attachmentsWithProgress?.length &&\n !attachmentsWithProgress\n .filter((attachmentUpload) => !attachmentUpload.error)\n .every((attachmentUpload) => attachmentUpload.progress === 1 && attachmentUpload.progress !== undefined)\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const isAttachmentUploadCompleted = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!attachmentsWithProgress?.find((attachment) => !attachment.error);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Check if the content has inline image.\n * @internal\n */\nexport const hasInlineImageContent = (content: string): boolean => {\n const document = new DOMParser().parseFromString(content, 'text/html');\n return !!document.querySelector('img');\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n *\n * @param message - The message content to update.\n * @param initialInlineImages - The initial inline images that comes with the message before editing.\n *\n * @returns The updated message content.\n */\nexport const updateStylesOfInlineImages = async (\n message: string,\n initialInlineImages: Record<string, string>[]\n): Promise<string> => {\n if (message === '') {\n return message;\n }\n const initialInlineImagesIds = initialInlineImages.map((initialInlineImage) => initialInlineImage.id);\n const document = new DOMParser().parseFromString(message ?? '', 'text/html');\n const imagesPromise = Array.from(document.querySelectorAll('img')).map((img) => {\n return new Promise<void>((resolve, rejects) => {\n // The message might content images that comes with the message before editing.\n // This function should only modify the message content for images that are newly added.\n if (initialInlineImagesIds.includes(img.id)) {\n resolve();\n return;\n }\n const imageElement = new Image();\n imageElement.src = img.src;\n imageElement.onload = () => {\n // imageElement is a copy of original img element, so changes need to be made to the original img element\n img.width = imageElement.width;\n img.height = imageElement.height;\n img.style.aspectRatio = `${imageElement.width} / ${imageElement.height}`;\n // Clear maxWidth and maxHeight styles that are set by roosterJS.\n // This is so that they can be set in messageThread styles without using the important flag.\n img.style.maxWidth = '';\n img.style.maxHeight = '';\n resolve();\n };\n imageElement.onerror = () => {\n console.log('Error loading image', img.src);\n rejects();\n };\n });\n });\n await Promise.all(imagesPromise);\n const newMessage = document.body.innerHTML;\n return newMessage;\n};\n\n/**\n * @private\n */\nexport const isMessageTooLong = (valueLength: number): boolean => {\n return valueLength > MAXIMUM_LENGTH_OF_MESSAGE;\n};\n\n/**\n * @private\n */\nexport const sanitizeText = (message: string): string => {\n if (EMPTY_MESSAGE_REGEX.test(message)) {\n return '';\n } else {\n return message;\n }\n};\n\n/**\n * Determines whether the send box should be disabled for ARIA accessibility.\n *\n * @param hasContent - Indicates whether the send box has content.\n * @param hasCompletedAttachmentUploads - Indicates whether attachment uploads have completed.\n * @param hasError - Indicates whether there is an error.\n * @param disabled - Indicates whether the send box is disabled.\n * @returns A boolean value indicating whether the send box should be disabled for ARIA accessibility.\n */\nexport const isSendBoxButtonAriaDisabled = ({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads,\n hasError,\n disabled\n}: {\n hasContent: boolean;\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads: boolean;\n hasError: boolean;\n disabled: boolean;\n}): boolean => {\n return (\n // no content\n !(hasContent || /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads) ||\n //error message exists\n hasError ||\n disabled\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const toAttachmentMetadata = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): AttachmentMetadata[] | undefined => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n return {\n id: attachment.id,\n name: attachment.name,\n url: attachment.url ?? ''\n };\n });\n};\n\n/**\n * @internal\n */\nexport const modifyInlineImagesInContentString = async (\n content: string,\n initialInlineImages: Record<string, string>[],\n onCompleted?: (content: string) => void\n): Promise<void> => {\n let newContent = content;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n newContent = await updateStylesOfInlineImages(content, initialInlineImages);\n onCompleted?.(newContent);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const removeBrokenImageContentAndClearImageSizeStyles = (content: string): string => {\n const document = new DOMParser().parseFromString(content, 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n // Before submitting/resend the message, we need to trim the unnecessary attributes such as src,\n // which is set to a local svg of a broken image icon at this point.\n // Once message is submitted/resent, it will be fetched again and might not be a broken image anymore,\n // That's why we need to remove the class and data-ui-id attribute of 'broken-image-wrapper'\n if (img.className === 'broken-image-wrapper') {\n img.removeAttribute('class');\n img.removeAttribute('src');\n img.removeAttribute('data-ui-id');\n }\n // Clear maxWidth and maxHeight styles that are set by roosterJS.\n // Clear width and height styles as the width and height is set in attributes\n // This is so that they can be set in messageThread styles without using the important flag.\n img.style.width = '';\n img.style.height = '';\n img.style.maxWidth = '';\n img.style.maxHeight = '';\n });\n return document.body.innerHTML;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getContentWithUpdatedInlineImagesInfo = (\n content: string,\n inlineImageWithProgress: AttachmentMetadataInProgress[]\n): string => {\n if (!inlineImageWithProgress || inlineImageWithProgress.length <= 0) {\n return content;\n }\n const document = new DOMParser().parseFromString(content, 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageId = img.id;\n const inlineImage = inlineImageWithProgress.find(\n (image) => !image.error && image.progress === 1 && image.id === imageId\n );\n if (inlineImage) {\n img.id = inlineImage.id;\n img.src = inlineImage.url || img.src;\n }\n });\n return document.body.innerHTML;\n};\n"]}
1
+ {"version":3,"file":"SendBoxUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/SendBoxUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAOlC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,mDAAmD;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,uBAAmE,EAC1D,EAAE;IACX,OAAO,CAAC,CAAC,CACP,CAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAE,MAAM;QAC/B,CAAC,uBAAuB;aACrB,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC;aACrD,KAAK,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CA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,CAAC,MAAM,qCAAqC,GAAG,CACnD,OAAe,EACf,uBAAuD,EAC/C,EAAE;IACV,IAAI,CAAC,uBAAuB,IAAI,uBAAuB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACpE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACvE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAC9C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,CACxE,CAAC;QACF,IAAI,WAAW,EAAE,CAAC;YAChB,GAAG,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC;YACxB,GAAG,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;QACvC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AACjC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const MAXIMUM_LENGTH_OF_MESSAGE = 8000;\nconst EMPTY_MESSAGE_REGEX = /^\\s*$/;\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const hasIncompleteAttachmentUploads = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!(\n attachmentsWithProgress?.length &&\n !attachmentsWithProgress\n .filter((attachmentUpload) => !attachmentUpload.error)\n .every((attachmentUpload) => attachmentUpload.progress === 1 && attachmentUpload.progress !== undefined)\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @private\n */\nexport const isAttachmentUploadCompleted = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): boolean => {\n return !!attachmentsWithProgress?.find((attachment) => !attachment.error);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * Check if the content has inline image.\n * @internal\n */\nexport const hasInlineImageContent = (content: string): boolean => {\n const document = new DOMParser().parseFromString(content, 'text/html');\n return !!document.querySelector('img');\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n *\n * @param message - The message content to update.\n * @param initialInlineImages - The initial inline images that comes with the message before editing.\n *\n * @returns The updated message content.\n */\nexport const updateStylesOfInlineImages = async (\n message: string,\n initialInlineImages: Record<string, string>[]\n): Promise<string> => {\n if (message === '') {\n return message;\n }\n const initialInlineImagesIds = initialInlineImages.map((initialInlineImage) => initialInlineImage.id);\n const document = new DOMParser().parseFromString(message ?? '', 'text/html');\n const imagesPromise = Array.from(document.querySelectorAll('img')).map((img) => {\n return new Promise<void>((resolve, rejects) => {\n // The message might content images that comes with the message before editing.\n // This function should only modify the message content for images that are newly added.\n if (initialInlineImagesIds.includes(img.id)) {\n resolve();\n return;\n }\n const imageElement = new Image();\n imageElement.src = img.src;\n imageElement.onload = () => {\n // imageElement is a copy of original img element, so changes need to be made to the original img element\n img.width = imageElement.width;\n img.height = imageElement.height;\n img.style.aspectRatio = `${imageElement.width} / ${imageElement.height}`;\n // Clear maxWidth and maxHeight styles that are set by roosterJS.\n // This is so that they can be set in messageThread styles without using the important flag.\n img.style.maxWidth = '';\n img.style.maxHeight = '';\n resolve();\n };\n imageElement.onerror = () => {\n rejects(`Error loading image ${img.id}`);\n };\n });\n });\n await Promise.all(imagesPromise);\n const newMessage = document.body.innerHTML;\n return newMessage;\n};\n\n/**\n * @private\n */\nexport const isMessageTooLong = (valueLength: number): boolean => {\n return valueLength > MAXIMUM_LENGTH_OF_MESSAGE;\n};\n\n/**\n * @private\n */\nexport const sanitizeText = (message: string): string => {\n if (EMPTY_MESSAGE_REGEX.test(message)) {\n return '';\n } else {\n return message;\n }\n};\n\n/**\n * Determines whether the send box should be disabled for ARIA accessibility.\n *\n * @param hasContent - Indicates whether the send box has content.\n * @param hasCompletedAttachmentUploads - Indicates whether attachment uploads have completed.\n * @param hasError - Indicates whether there is an error.\n * @param disabled - Indicates whether the send box is disabled.\n * @returns A boolean value indicating whether the send box should be disabled for ARIA accessibility.\n */\nexport const isSendBoxButtonAriaDisabled = ({\n hasContent,\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads,\n hasError,\n disabled\n}: {\n hasContent: boolean;\n /* @conditional-compile-remove(file-sharing-acs) */\n hasCompletedAttachmentUploads: boolean;\n hasError: boolean;\n disabled: boolean;\n}): boolean => {\n return (\n // no content\n !(hasContent || /* @conditional-compile-remove(file-sharing-acs) */ hasCompletedAttachmentUploads) ||\n //error message exists\n hasError ||\n disabled\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const toAttachmentMetadata = (\n attachmentsWithProgress: AttachmentMetadataInProgress[] | undefined\n): AttachmentMetadata[] | undefined => {\n return attachmentsWithProgress\n ?.filter((attachment) => {\n return !('error' in attachment) && !attachment.error?.message;\n })\n .map((attachment) => {\n return {\n id: attachment.id,\n name: attachment.name,\n url: attachment.url ?? ''\n };\n });\n};\n\n/**\n * @internal\n */\nexport const modifyInlineImagesInContentString = async (\n content: string,\n initialInlineImages: Record<string, string>[],\n onCompleted?: (content: string) => void\n): Promise<void> => {\n let newContent = content;\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n try {\n newContent = await updateStylesOfInlineImages(content, initialInlineImages);\n } catch (error) {\n console.error('Error updating inline images: ', error);\n }\n onCompleted?.(newContent);\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const removeBrokenImageContentAndClearImageSizeStyles = (content: string): string => {\n const document = new DOMParser().parseFromString(content, 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n // Before submitting/resend the message, we need to trim the unnecessary attributes such as src,\n // which is set to a local svg of a broken image icon at this point.\n // Once message is submitted/resent, it will be fetched again and might not be a broken image anymore,\n // That's why we need to remove the class and data-ui-id attribute of 'broken-image-wrapper'\n if (img.className === 'broken-image-wrapper') {\n img.removeAttribute('class');\n img.removeAttribute('src');\n img.removeAttribute('data-ui-id');\n }\n // Clear maxWidth and maxHeight styles that are set by roosterJS.\n // Clear width and height styles as the width and height is set in attributes\n // This is so that they can be set in messageThread styles without using the important flag.\n img.style.width = '';\n img.style.height = '';\n img.style.maxWidth = '';\n img.style.maxHeight = '';\n });\n return document.body.innerHTML;\n};\n\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\n/**\n * @internal\n */\nexport const getContentWithUpdatedInlineImagesInfo = (\n content: string,\n inlineImageWithProgress: AttachmentMetadataInProgress[]\n): string => {\n if (!inlineImageWithProgress || inlineImageWithProgress.length <= 0) {\n return content;\n }\n const document = new DOMParser().parseFromString(content, 'text/html');\n document.querySelectorAll('img').forEach((img) => {\n const imageId = img.id;\n const inlineImage = inlineImageWithProgress.find(\n (image) => !image.error && image.progress === 1 && image.id === imageId\n );\n if (inlineImage) {\n img.id = inlineImage.id;\n img.src = inlineImage.url || img.src;\n }\n });\n return document.body.innerHTML;\n};\n"]}
@@ -457,6 +457,7 @@
457
457
  "videoGallery": {
458
458
  "screenIsBeingSharedMessage": "You are sharing your screen",
459
459
  "screenShareLoadingMessage": "Loading {participant}'s screen",
460
+ "localScreenShareLoadingMessage": "Loading your screen",
460
461
  "localVideoLabel": "You",
461
462
  "localVideoCameraSwitcherLabel": "Switch camera",
462
463
  "localVideoMovementLabel": "Movable Local Video Tile",
@@ -91,6 +91,8 @@ export interface VideoGalleryLocalParticipant extends VideoGalleryParticipant {
91
91
  *
92
92
  * */
93
93
  reaction?: Reaction;
94
+ /** Video stream of shared screen */
95
+ screenShareStream?: VideoGalleryStream;
94
96
  }
95
97
  /**
96
98
  * The state of a remote participant in the {@link VideoGallery}.
@@ -1 +1 @@
1
- {"version":3,"file":"VideoGalleryParticipant.js","sourceRoot":"","sources":["../../../../../../react-components/src/types/VideoGalleryParticipant.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from './ParticipantListParticipant';\n\nimport { RaisedHand } from './ParticipantListParticipant';\nimport { Reaction } from './ParticipantListParticipant';\nimport { Spotlight } from './ParticipantListParticipant';\n/**\n * Scaling mode of a {@link VideoGalleryStream}.\n *\n * @public\n */\nexport type ViewScalingMode = 'Stretch' | 'Crop' | 'Fit';\n\n/**\n * Options to control how video streams are rendered.\n *\n * @public\n */\nexport declare interface VideoStreamOptions {\n /** Whether the video stream is mirrored or not */\n isMirrored?: boolean;\n /** Scaling mode. It can be `Stretch`, `Crop` or `Fit` */\n scalingMode?: ViewScalingMode;\n}\n\n/**\n * The state of a participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport type VideoGalleryParticipant = {\n /** User ID of participant */\n userId: string;\n /** Whether participant is muted */\n isMuted?: boolean;\n /** Display name of participant */\n displayName?: string;\n /** Video stream of participant */\n videoStream?: VideoGalleryStream;\n /** Whether participant is screen sharing or not */\n isScreenSharingOn?: boolean;\n /** Whether participant is spotlighted **/\n spotlight?: Spotlight;\n};\n\n/**\n * Video stream of a participant in {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryStream {\n /** ID of the video stream */\n id?: number;\n /** Whether the video stream is available or not */\n isAvailable?: boolean;\n /** Whether the video stream is receiving data or not */\n isReceiving?: boolean;\n /** Whether the video stream is mirrored or not */\n isMirrored?: boolean;\n /** Render element of the video stream */\n renderElement?: HTMLElement;\n /** Scaling mode of the video stream */\n scalingMode?: ViewScalingMode;\n /** Stream Size of the video stream */\n streamSize?: { width: number; height: number };\n}\n\n/**\n * Object returned after creating a local or remote VideoStream.\n * This contains helper functions to manipulate the render of the stream.\n *\n * @public\n */\nexport interface CreateVideoStreamViewResult {\n /** View handle of the rendered video stream */\n view: {\n /**\n * Update the scale mode for this view.\n * @param scalingMode - The new scale mode.\n */\n updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void>;\n };\n}\n\n// set the required attribs in selector. (Further simplifying our component logic) For example\n// isLocalVideoReady can be calculated inside selector.\n/**\n * The state of the local participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryLocalParticipant extends VideoGalleryParticipant {\n /** Whether local participant is raised a hand */\n raisedHand?: RaisedHand;\n /**\n * Whether local participant has reacted\n *\n * */\n reaction?: Reaction;\n}\n\n/**\n * The state of a remote participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryRemoteParticipant extends VideoGalleryParticipant {\n /** Whether participant is speaking or not */\n isSpeaking?: boolean;\n /** Video stream of shared screen */\n screenShareStream?: VideoGalleryStream;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * @beta\n * The connection state of the participant. For example, 'Hold', 'Connecting' etc.\n */\n state?: ParticipantState;\n /** Whether participant is raised a hand */\n raisedHand?: RaisedHand;\n /**\n * Whether participant has reacted\n *\n * @public\n * */\n reaction?: Reaction;\n}\n"]}
1
+ {"version":3,"file":"VideoGalleryParticipant.js","sourceRoot":"","sources":["../../../../../../react-components/src/types/VideoGalleryParticipant.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from './ParticipantListParticipant';\n\nimport { RaisedHand } from './ParticipantListParticipant';\nimport { Reaction } from './ParticipantListParticipant';\nimport { Spotlight } from './ParticipantListParticipant';\n/**\n * Scaling mode of a {@link VideoGalleryStream}.\n *\n * @public\n */\nexport type ViewScalingMode = 'Stretch' | 'Crop' | 'Fit';\n\n/**\n * Options to control how video streams are rendered.\n *\n * @public\n */\nexport declare interface VideoStreamOptions {\n /** Whether the video stream is mirrored or not */\n isMirrored?: boolean;\n /** Scaling mode. It can be `Stretch`, `Crop` or `Fit` */\n scalingMode?: ViewScalingMode;\n}\n\n/**\n * The state of a participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport type VideoGalleryParticipant = {\n /** User ID of participant */\n userId: string;\n /** Whether participant is muted */\n isMuted?: boolean;\n /** Display name of participant */\n displayName?: string;\n /** Video stream of participant */\n videoStream?: VideoGalleryStream;\n /** Whether participant is screen sharing or not */\n isScreenSharingOn?: boolean;\n /** Whether participant is spotlighted **/\n spotlight?: Spotlight;\n};\n\n/**\n * Video stream of a participant in {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryStream {\n /** ID of the video stream */\n id?: number;\n /** Whether the video stream is available or not */\n isAvailable?: boolean;\n /** Whether the video stream is receiving data or not */\n isReceiving?: boolean;\n /** Whether the video stream is mirrored or not */\n isMirrored?: boolean;\n /** Render element of the video stream */\n renderElement?: HTMLElement;\n /** Scaling mode of the video stream */\n scalingMode?: ViewScalingMode;\n /** Stream Size of the video stream */\n streamSize?: { width: number; height: number };\n}\n\n/**\n * Object returned after creating a local or remote VideoStream.\n * This contains helper functions to manipulate the render of the stream.\n *\n * @public\n */\nexport interface CreateVideoStreamViewResult {\n /** View handle of the rendered video stream */\n view: {\n /**\n * Update the scale mode for this view.\n * @param scalingMode - The new scale mode.\n */\n updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void>;\n };\n}\n\n// set the required attribs in selector. (Further simplifying our component logic) For example\n// isLocalVideoReady can be calculated inside selector.\n/**\n * The state of the local participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryLocalParticipant extends VideoGalleryParticipant {\n /** Whether local participant is raised a hand */\n raisedHand?: RaisedHand;\n /**\n * Whether local participant has reacted\n *\n * */\n reaction?: Reaction;\n /** Video stream of shared screen */\n screenShareStream?: VideoGalleryStream;\n}\n\n/**\n * The state of a remote participant in the {@link VideoGallery}.\n *\n * @public\n */\nexport interface VideoGalleryRemoteParticipant extends VideoGalleryParticipant {\n /** Whether participant is speaking or not */\n isSpeaking?: boolean;\n /** Video stream of shared screen */\n screenShareStream?: VideoGalleryStream;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * @beta\n * The connection state of the participant. For example, 'Hold', 'Connecting' etc.\n */\n state?: ParticipantState;\n /** Whether participant is raised a hand */\n raisedHand?: RaisedHand;\n /**\n * Whether participant has reacted\n *\n * @public\n * */\n reaction?: Reaction;\n}\n"]}
@@ -506,7 +506,12 @@ export class AzureCommunicationCallAdapter {
506
506
  }
507
507
  disposeScreenShareStreamView(remoteUserId) {
508
508
  return __awaiter(this, void 0, void 0, function* () {
509
- yield this.handlers.onDisposeRemoteScreenShareStreamView(remoteUserId);
509
+ if (remoteUserId !== '') {
510
+ yield this.handlers.onDisposeRemoteScreenShareStreamView(remoteUserId);
511
+ }
512
+ else {
513
+ yield this.handlers.onDisposeLocalScreenShareStreamView();
514
+ }
510
515
  });
511
516
  }
512
517
  disposeRemoteVideoStreamView(remoteUserId) {