@azure/communication-react 1.17.0-alpha-202405170014 → 1.17.0-alpha-202405220013

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 (105) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-BLFNaheX.js → ChatMessageComponentAsRichTextEditBox-CDsn-zU7.js} +22 -17
  2. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CDsn-zU7.js.map +1 -0
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BhTpuspw.js → RichTextSendBoxWrapper-Dm4S2bpT.js} +6 -8
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BhTpuspw.js.map → RichTextSendBoxWrapper-Dm4S2bpT.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-C9I6Mcil.js → index-DO36MBbq.js} +907 -480
  6. package/dist/dist-cjs/communication-react/index-DO36MBbq.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +5 -7
  8. package/dist/dist-cjs/communication-react/index.js.map +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/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +17 -10
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1 -1
  14. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js +1 -3
  16. package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ReactionButton.js +1 -1
  18. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +9 -0
  20. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +29 -0
  21. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +1 -0
  22. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +1 -1
  23. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +15 -20
  24. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +12 -0
  26. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +23 -0
  27. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +1 -0
  28. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +15 -0
  29. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +39 -0
  30. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +1 -0
  31. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +24 -0
  32. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +66 -0
  33. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +1 -0
  34. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +20 -0
  35. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +46 -0
  36. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +1 -0
  37. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +29 -0
  38. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +71 -0
  39. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +1 -0
  40. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +7 -10
  41. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +170 -91
  42. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -1
  44. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +29 -12
  45. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +12 -46
  47. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +19 -0
  49. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +209 -0
  50. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -0
  51. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +7 -0
  52. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +49 -0
  53. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +1 -0
  54. package/dist/dist-esm/react-components/src/components/RichTextEditor/{Buttons → Toolbar}/Table/RichTextInsertTablePane.d.ts +2 -2
  55. package/dist/dist-esm/react-components/src/components/RichTextEditor/{Buttons → Toolbar}/Table/RichTextInsertTablePane.js +3 -3
  56. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +1 -0
  57. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +6 -0
  58. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +13 -0
  59. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +1 -0
  60. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +1 -1
  61. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  62. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +5 -7
  63. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +1 -1
  64. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +5 -3
  66. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +2 -8
  67. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +3 -1
  69. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +3 -3
  71. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +4 -5
  72. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  73. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +37 -0
  74. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +60 -0
  75. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -0
  76. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +11 -0
  77. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +95 -0
  78. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/components/utils.d.ts +1 -1
  80. package/dist/dist-esm/react-components/src/components/utils.js +1 -3
  81. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  82. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +7 -4
  83. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  84. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +4 -1
  85. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +3 -3
  86. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  87. package/package.json +6 -8
  88. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BLFNaheX.js.map +0 -1
  89. package/dist/dist-cjs/communication-react/index-C9I6Mcil.js.map +0 -1
  90. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.d.ts +0 -7
  91. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js +0 -86
  92. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +0 -1
  93. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.d.ts +0 -7
  94. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +0 -55
  95. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +0 -1
  96. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js.map +0 -1
  97. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.d.ts +0 -8
  98. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js +0 -66
  99. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js.map +0 -1
  100. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.d.ts +0 -9
  101. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js +0 -56
  102. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js.map +0 -1
  103. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.d.ts +0 -15
  104. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js +0 -39
  105. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js.map +0 -1
@@ -29,7 +29,6 @@ export const richTextEditorWrapperStyle = (theme, addTopOffset) => {
29
29
  paddingTop: `${addTopOffset ? '0.5rem' : '0'}`,
30
30
  paddingInlineStart: `0.75rem`,
31
31
  paddingInlineEnd: `0.75rem`,
32
- lineHeight: '1.25rem',
33
32
  maxWidth: '100%',
34
33
  color: theme.palette.neutralPrimary,
35
34
  '& table': {
@@ -130,7 +129,7 @@ const ribbonButtonRootStyles = (theme) => {
130
129
  /**
131
130
  * @private
132
131
  */
133
- export const ribbonButtonStyle = (theme) => {
132
+ export const toolbarButtonStyle = (theme) => {
134
133
  return {
135
134
  icon: { color: theme.palette.neutralPrimary, height: 'auto' },
136
135
  menuIcon: { color: theme.palette.neutralPrimary, height: 'auto' },
@@ -151,7 +150,7 @@ const rootRibbonTableButtonStyle = (theme) => {
151
150
  /**
152
151
  * @private
153
152
  */
154
- export const ribbonTableButtonStyle = (theme) => {
153
+ export const toolbarTableButtonStyle = (theme) => {
155
154
  return {
156
155
  icon: { height: 'auto' },
157
156
  menuIcon: { height: 'auto' },
@@ -199,9 +198,9 @@ export const ribbonDividerStyle = (theme) => {
199
198
  /**
200
199
  * @private
201
200
  */
202
- export const ribbonStyle = {
201
+ export const richTextToolbarStyle = {
203
202
  // Override for the default white color of the Ribbon component
204
- root: { backgroundColor: 'transparent' }
203
+ root: { backgroundColor: 'transparent', padding: '0px' }
205
204
  };
206
205
  /**
207
206
  * @private
@@ -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,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,qGAAqG;QACrG,uEAAuE;QACvE,iHAAiH;QACjH,cAAc,EAAE;YACd,eAAe,EAAE,GAAG;SACrB;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAE,YAAqB,EAAU,EAAE;IACxF,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE;QAC9C,kBAAkB,EAAE,SAAS;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;QAEnC,SAAS,EAAE;YACT,UAAU,EAAE,aAAa;YACzB,cAAc,EAAE,UAAU;YAC1B,KAAK,EAAE,MAAM;YAC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AAG,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 // this is needed to fix an issue when text has some indentation, indentation uses blockquote tag and\n // it gets both horizontal margins because of the user agent stylesheet\n // remove this code when RoosterJS content model packages are used as they use different approach for indentation\n '& blockquote': {\n marginInlineEnd: '0'\n }\n });\n};\n\n/**\n * @private\n */\nexport const richTextEditorWrapperStyle = (theme: Theme, addTopOffset: boolean): string => {\n return mergeStyles({\n paddingTop: `${addTopOffset ? '0.5rem' : '0'}`,\n paddingInlineStart: `0.75rem`,\n paddingInlineEnd: `0.75rem`,\n lineHeight: '1.25rem',\n maxWidth: '100%',\n color: theme.palette.neutralPrimary,\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.neutralLight}`,\n\n '& td': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralLight}`,\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.25rem 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 = (theme: Theme): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n // Icon's color doesn't work here because of the specificity\n '.ms-Button-icon': {\n color: theme.palette.themePrimary\n },\n '.ms-Button-menuIcon': {\n color: theme.palette.themePrimary\n }\n }\n };\n};\n\n/**\n * @private\n */\nexport const ribbonButtonStyle = (theme: Theme): Partial<IButtonStyles> => {\n return {\n icon: { color: theme.palette.neutralPrimary, height: 'auto' },\n menuIcon: { color: theme.palette.neutralPrimary, height: 'auto' },\n root: { minWidth: 'auto', backgroundColor: 'transparent' },\n rootChecked: ribbonButtonRootStyles(theme),\n rootHovered: ribbonButtonRootStyles(theme),\n rootCheckedHovered: ribbonButtonRootStyles(theme),\n rootCheckedPressed: ribbonButtonRootStyles(theme),\n rootPressed: ribbonButtonRootStyles(theme),\n rootExpanded: ribbonButtonRootStyles(theme),\n rootExpandedHovered: ribbonButtonRootStyles(theme)\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 ribbonTableButtonStyle = (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.25rem 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.25rem 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.5rem'\n });\n};\n\n/**\n * @private\n */\nexport const ribbonStyle: Partial<ICommandBarStyles> = {\n // Override for the default white color of the Ribbon component\n root: { backgroundColor: 'transparent' }\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: '1rem',\n height: '1rem',\n border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,\n display: 'inline-block',\n cursor: 'pointer',\n background: 'transparent',\n // include border into width value as the parent element has fixed width\n boxSizing: 'border-box'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonSelectedStyles = (theme: Theme): IStyle => {\n return {\n background: theme.palette.themePrimary\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTablePane = mergeStyles({\n padding: '0.5rem 0.625rem 0.75rem 0.625rem',\n boxSizing: 'content-box',\n minWidth: 'auto'\n});\n\n/**\n * @private\n */\nexport const insertTableMenuFocusZone = (theme: Theme): string => {\n return mergeStyles({\n lineHeight: '12px',\n // fixed width is required to show columns in a grid correctly\n width: '5rem',\n border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,\n // don't include border into width value as otherwise it may be broken when zoom value is changed\n boxSizing: 'content-box'\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,qGAAqG;QACrG,uEAAuE;QACvE,iHAAiH;QACjH,cAAc,EAAE;YACd,eAAe,EAAE,GAAG;SACrB;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAE,YAAqB,EAAU,EAAE;IACxF,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE;QAC9C,kBAAkB,EAAE,SAAS;QAC7B,gBAAgB,EAAE,SAAS;QAC3B,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;QAEnC,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;gBACN,UAAU,EAAE,aAAa;gBACzB,MAAM,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE;gBAEjD,MAAM,EAAE;oBACN,UAAU,EAAE,aAAa;oBACz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A0B,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 // this is needed to fix an issue when text has some indentation, indentation uses blockquote tag and\n // it gets both horizontal margins because of the user agent stylesheet\n // remove this code when RoosterJS content model packages are used as they use different approach for indentation\n '& blockquote': {\n marginInlineEnd: '0'\n }\n });\n};\n\n/**\n * @private\n */\nexport const richTextEditorWrapperStyle = (theme: Theme, addTopOffset: boolean): string => {\n return mergeStyles({\n paddingTop: `${addTopOffset ? '0.5rem' : '0'}`,\n paddingInlineStart: `0.75rem`,\n paddingInlineEnd: `0.75rem`,\n maxWidth: '100%',\n color: theme.palette.neutralPrimary,\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.neutralLight}`,\n\n '& td': {\n background: 'transparent',\n border: `1px solid ${theme.palette.neutralLight}`,\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.25rem 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 = (theme: Theme): IStyle => {\n return {\n backgroundColor: 'transparent',\n selectors: {\n // Icon's color doesn't work here because of the specificity\n '.ms-Button-icon': {\n color: theme.palette.themePrimary\n },\n '.ms-Button-menuIcon': {\n color: theme.palette.themePrimary\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' },\n menuIcon: { color: theme.palette.neutralPrimary, height: 'auto' },\n root: { minWidth: 'auto', backgroundColor: 'transparent' },\n rootChecked: ribbonButtonRootStyles(theme),\n rootHovered: ribbonButtonRootStyles(theme),\n rootCheckedHovered: ribbonButtonRootStyles(theme),\n rootCheckedPressed: ribbonButtonRootStyles(theme),\n rootPressed: ribbonButtonRootStyles(theme),\n rootExpanded: ribbonButtonRootStyles(theme),\n rootExpandedHovered: ribbonButtonRootStyles(theme)\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.25rem 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.25rem 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.5rem'\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: '0px' }\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: '1rem',\n height: '1rem',\n border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,\n display: 'inline-block',\n cursor: 'pointer',\n background: 'transparent',\n // include border into width value as the parent element has fixed width\n boxSizing: 'border-box'\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuCellButtonSelectedStyles = (theme: Theme): IStyle => {\n return {\n background: theme.palette.themePrimary\n };\n};\n\n/**\n * @private\n */\nexport const insertTableMenuTablePane = mergeStyles({\n padding: '0.5rem 0.625rem 0.75rem 0.625rem',\n boxSizing: 'content-box',\n minWidth: 'auto'\n});\n\n/**\n * @private\n */\nexport const insertTableMenuFocusZone = (theme: Theme): string => {\n return mergeStyles({\n lineHeight: '12px',\n // fixed width is required to show columns in a grid correctly\n width: '5rem',\n border: `solid 0.0625rem ${theme.palette.neutralTertiaryAlt}`,\n // don't include border into width value as otherwise it may be broken when zoom value is changed\n boxSizing: 'content-box'\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"]}
@@ -0,0 +1,37 @@
1
+ import type { BorderFormat, DatasetFormat, ModelToDomContext } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Plugin event type for RoosterJS plugins
4
+ * @private
5
+ */
6
+ export declare enum PluginEventType {
7
+ EditorReady = "editorReady",
8
+ BeforeDispose = "beforeDispose",
9
+ ContentChanged = "contentChanged",
10
+ Input = "input",
11
+ KeyDown = "keyDown",
12
+ BeforePaste = "beforePaste",
13
+ ZoomChanged = "zoomChanged",
14
+ MouseUp = "mouseUp"
15
+ }
16
+ /**
17
+ * ContentChanged event source for RoosterJS
18
+ * @private
19
+ */
20
+ export declare enum ContentChangedEventSource {
21
+ Paste = "Paste"
22
+ }
23
+ /**
24
+ * Applies the border format to the specified element.
25
+ * If the element is an HTMLTableCellElement, it skips setting editing info
26
+ * and to use classes instead of inline styles.
27
+ * For all other cases, the default format applier is used.
28
+ */
29
+ export declare const borderApplier: (format: BorderFormat, element: HTMLElement, context: ModelToDomContext) => void;
30
+ /**
31
+ * Applies the dataset format to the given HTML element.
32
+ * If the element is an HTMLTableElement, it skips setting editing info
33
+ * and to use classes instead of inline styles.
34
+ * For all other cases, it applies the default formats.
35
+ */
36
+ export declare const dataSetApplier: (format: DatasetFormat, element: HTMLElement, context: ModelToDomContext) => void;
37
+ //# sourceMappingURL=RichTextEditorUtils.d.ts.map
@@ -0,0 +1,60 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * Plugin event type for RoosterJS plugins
5
+ * @private
6
+ */
7
+ export var PluginEventType;
8
+ (function (PluginEventType) {
9
+ PluginEventType["EditorReady"] = "editorReady";
10
+ PluginEventType["BeforeDispose"] = "beforeDispose";
11
+ PluginEventType["ContentChanged"] = "contentChanged";
12
+ PluginEventType["Input"] = "input";
13
+ PluginEventType["KeyDown"] = "keyDown";
14
+ PluginEventType["BeforePaste"] = "beforePaste";
15
+ PluginEventType["ZoomChanged"] = "zoomChanged";
16
+ PluginEventType["MouseUp"] = "mouseUp";
17
+ })(PluginEventType || (PluginEventType = {}));
18
+ /**
19
+ * ContentChanged event source for RoosterJS
20
+ * @private
21
+ */
22
+ export var ContentChangedEventSource;
23
+ (function (ContentChangedEventSource) {
24
+ ContentChangedEventSource["Paste"] = "Paste";
25
+ })(ContentChangedEventSource || (ContentChangedEventSource = {}));
26
+ /**
27
+ * Applies the border format to the specified element.
28
+ * If the element is an HTMLTableCellElement, it skips setting editing info
29
+ * and to use classes instead of inline styles.
30
+ * For all other cases, the default format applier is used.
31
+ */
32
+ export const borderApplier = (format, element, context) => {
33
+ if (element instanceof HTMLTableCellElement) {
34
+ // don't set format for table cell
35
+ // as it will set inline styles for them
36
+ // we want to use classes instead
37
+ }
38
+ else if (context.defaultFormatAppliers.border) {
39
+ // apply default formats for all other cases
40
+ context.defaultFormatAppliers.border(format, element, context);
41
+ }
42
+ };
43
+ /**
44
+ * Applies the dataset format to the given HTML element.
45
+ * If the element is an HTMLTableElement, it skips setting editing info
46
+ * and to use classes instead of inline styles.
47
+ * For all other cases, it applies the default formats.
48
+ */
49
+ export const dataSetApplier = (format, element, context) => {
50
+ if (element instanceof HTMLTableElement) {
51
+ // don't set editing info for tables
52
+ // as it will set inline styles for them
53
+ // we want to use classes instead
54
+ }
55
+ else if (context.defaultFormatAppliers.dataset) {
56
+ // apply default formats for all other cases
57
+ context.defaultFormatAppliers.dataset(format, element, context);
58
+ }
59
+ };
60
+ //# sourceMappingURL=RichTextEditorUtils.js.map
@@ -0,0 +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,eASX;AATD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,kDAA+B,CAAA;IAC/B,oDAAiC,CAAA;IACjC,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,8CAA2B,CAAA;IAC3B,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;AACrB,CAAC,EATW,eAAe,KAAf,eAAe,QAS1B;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,qBAAqB,CAAC,OAAO,EAAE,CAAC;QACjD,4CAA4C;QAC5C,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAClE,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 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"]}
@@ -1,3 +1,6 @@
1
+ import { RichTextStrings } from '../RichTextEditor/RichTextSendBox';
2
+ import { IEditor } from 'roosterjs-content-model-types';
3
+ import { IContextualMenuItem } from '@fluentui/react';
1
4
  /**
2
5
  * @private
3
6
  *
@@ -19,4 +22,12 @@ export declare function parseKey(key: string): {
19
22
  row: number;
20
23
  column: number;
21
24
  };
25
+ /**
26
+ * Returns an array of context menu items for editing a rich text table.
27
+ *
28
+ * @param editor - The editor instance.
29
+ * @param strings - An object containing localized strings for the context menu items.
30
+ * @returns An array of context menu items.
31
+ */
32
+ export declare const getTableEditContextMenuItems: (editor: IEditor, strings: Partial<RichTextStrings>) => IContextualMenuItem[];
22
33
  //# sourceMappingURL=RichTextTableUtils.d.ts.map
@@ -1,5 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ import { editTable } from 'roosterjs-content-model-api';
4
+ import { tableContextMenuIconStyles } from '../styles/RichTextEditor.styles';
3
5
  /**
4
6
  * @private
5
7
  *
@@ -26,4 +28,97 @@ export function parseKey(key) {
26
28
  column: parseInt(column)
27
29
  };
28
30
  }
31
+ /**
32
+ * Returns an array of context menu items for editing a rich text table.
33
+ *
34
+ * @param editor - The editor instance.
35
+ * @param strings - An object containing localized strings for the context menu items.
36
+ * @returns An array of context menu items.
37
+ */
38
+ export const getTableEditContextMenuItems = (editor, strings) => {
39
+ return [
40
+ {
41
+ key: 'RichTextTableEditMenuTableInsert',
42
+ text: strings.richTextInsertRowOrColumnMenu,
43
+ ariaLabel: strings.richTextInsertRowOrColumnMenu,
44
+ iconProps: {
45
+ iconName: 'RichTextTableInsertMenuIcon',
46
+ styles: { root: tableContextMenuIconStyles }
47
+ },
48
+ subMenuProps: {
49
+ items: [
50
+ {
51
+ key: 'RichTextTableEditMenuTableInsertRowAbove',
52
+ text: strings.richTextInsertRowAboveMenu,
53
+ ariaLabel: strings.richTextInsertRowAboveMenu,
54
+ onClick: () => {
55
+ editTable(editor, 'insertAbove');
56
+ }
57
+ },
58
+ {
59
+ key: 'RichTextTableEditMenuTableInsertRowBelow',
60
+ text: strings.richTextInsertRowBelowMenu,
61
+ ariaLabel: strings.richTextInsertRowBelowMenu,
62
+ onClick: () => {
63
+ editTable(editor, 'insertBelow');
64
+ }
65
+ },
66
+ {
67
+ key: 'RichTextTableEditMenuTableInsertColumnLeft',
68
+ text: strings.richTextInsertColumnLeftMenu,
69
+ ariaLabel: strings.richTextInsertColumnLeftMenu,
70
+ onClick: () => {
71
+ editTable(editor, 'insertLeft');
72
+ }
73
+ },
74
+ {
75
+ key: 'RichTextTableEditMenuTableInsertColumnRight',
76
+ text: strings.richTextInsertColumnRightMenu,
77
+ ariaLabel: strings.richTextInsertColumnRightMenu,
78
+ onClick: () => {
79
+ editTable(editor, 'insertRight');
80
+ }
81
+ }
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ key: 'RichTextTableEditMenuTableDelete',
87
+ text: strings.richTextDeleteRowOrColumnMenu,
88
+ ariaLabel: strings.richTextDeleteRowOrColumnMenu,
89
+ iconProps: {
90
+ iconName: 'RichTextTableDeleteMenuIcon',
91
+ styles: { root: tableContextMenuIconStyles }
92
+ },
93
+ subMenuProps: {
94
+ items: [
95
+ {
96
+ key: 'RichTextTableEditMenuTableDeleteRow',
97
+ text: strings.richTextDeleteRowMenu,
98
+ ariaLabel: strings.richTextDeleteRowMenu,
99
+ onClick: () => {
100
+ editTable(editor, 'deleteRow');
101
+ }
102
+ },
103
+ {
104
+ key: 'RichTextTableEditMenuTableDeleteColumn',
105
+ text: strings.richTextDeleteColumnMenu,
106
+ ariaLabel: strings.richTextDeleteColumnMenu,
107
+ onClick: () => {
108
+ editTable(editor, 'deleteColumn');
109
+ }
110
+ },
111
+ {
112
+ key: 'RichTextTableEditMenuTableDeleteTable',
113
+ text: strings.richTextDeleteTableMenu,
114
+ ariaLabel: strings.richTextDeleteTableMenu,
115
+ onClick: () => {
116
+ editTable(editor, 'deleteTable');
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ }
122
+ ];
123
+ };
29
124
  //# sourceMappingURL=RichTextTableUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextTableUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextTableUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAc;IACnD,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;QAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @private\n *\n * String to be replaces by actual values of row and column.\n */\nexport const ColumnRowReplaceString = '{column} x {row}';\n\n/**\n * @private\n *\n * Function to create key pair for the selected table size.\n */\nexport function createKey(row: number, column: number): string {\n return `${row},${column}`;\n}\n\n/**\n * @private\n *\n * Function to parse key to the selected table size valules.\n */\nexport function parseKey(key: string): { row: number; column: number } {\n const [row, column] = key.split(',');\n return {\n row: parseInt(row),\n column: parseInt(column)\n };\n}\n"]}
1
+ {"version":3,"file":"RichTextTableUtils.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/utils/RichTextTableUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,MAAc;IACnD,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;QAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;KACzB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,MAAe,EACf,OAAiC,EACV,EAAE;IACzB,OAAO;QACL;YACE,GAAG,EAAE,kCAAkC;YACvC,IAAI,EAAE,OAAO,CAAC,6BAA6B;YAC3C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AAE,0BAA0B,EAAE;aAC7C;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE;oBACL;wBACE,GAAG,EAAE,qCAAqC;wBAC1C,IAAI,EAAE,OAAO,CAAC,qBAAqB;wBACnC,SAAS,EAAE,OAAO,CAAC,qBAAqB;wBACxC,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;wBACjC,CAAC;qBACF;oBACD;wBACE,GAAG,EAAE,wCAAwC;wBAC7C,IAAI,EAAE,OAAO,CAAC,wBAAwB;wBACtC,SAAS,EAAE,OAAO,CAAC,wBAAwB;wBAC3C,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;wBACpC,CAAC;qBACF;oBACD;wBACE,GAAG,EAAE,uCAAuC;wBAC5C,IAAI,EAAE,OAAO,CAAC,uBAAuB;wBACrC,SAAS,EAAE,OAAO,CAAC,uBAAuB;wBAC1C,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;wBACnC,CAAC;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { editTable } from 'roosterjs-content-model-api';\nimport { tableContextMenuIconStyles } from '../styles/RichTextEditor.styles';\nimport { RichTextStrings } from '../RichTextEditor/RichTextSendBox';\nimport { IEditor } from 'roosterjs-content-model-types';\nimport { IContextualMenuItem } from '@fluentui/react';\n\n/**\n * @private\n *\n * String to be replaces by actual values of row and column.\n */\nexport const ColumnRowReplaceString = '{column} x {row}';\n\n/**\n * @private\n *\n * Function to create key pair for the selected table size.\n */\nexport function createKey(row: number, column: number): string {\n return `${row},${column}`;\n}\n\n/**\n * @private\n *\n * Function to parse key to the selected table size valules.\n */\nexport function parseKey(key: string): { row: number; column: number } {\n const [row, column] = key.split(',');\n return {\n row: parseInt(row),\n column: parseInt(column)\n };\n}\n\n/**\n * Returns an array of context menu items for editing a rich text table.\n *\n * @param editor - The editor instance.\n * @param strings - An object containing localized strings for the context menu items.\n * @returns An array of context menu items.\n */\nexport const getTableEditContextMenuItems = (\n editor: IEditor,\n strings: Partial<RichTextStrings>\n): IContextualMenuItem[] => {\n return [\n {\n key: 'RichTextTableEditMenuTableInsert',\n text: strings.richTextInsertRowOrColumnMenu,\n ariaLabel: strings.richTextInsertRowOrColumnMenu,\n iconProps: {\n iconName: 'RichTextTableInsertMenuIcon',\n styles: { root: tableContextMenuIconStyles }\n },\n subMenuProps: {\n items: [\n {\n key: 'RichTextTableEditMenuTableInsertRowAbove',\n text: strings.richTextInsertRowAboveMenu,\n ariaLabel: strings.richTextInsertRowAboveMenu,\n onClick: () => {\n editTable(editor, 'insertAbove');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertRowBelow',\n text: strings.richTextInsertRowBelowMenu,\n ariaLabel: strings.richTextInsertRowBelowMenu,\n onClick: () => {\n editTable(editor, 'insertBelow');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertColumnLeft',\n text: strings.richTextInsertColumnLeftMenu,\n ariaLabel: strings.richTextInsertColumnLeftMenu,\n onClick: () => {\n editTable(editor, 'insertLeft');\n }\n },\n {\n key: 'RichTextTableEditMenuTableInsertColumnRight',\n text: strings.richTextInsertColumnRightMenu,\n ariaLabel: strings.richTextInsertColumnRightMenu,\n onClick: () => {\n editTable(editor, 'insertRight');\n }\n }\n ]\n }\n },\n {\n key: 'RichTextTableEditMenuTableDelete',\n text: strings.richTextDeleteRowOrColumnMenu,\n ariaLabel: strings.richTextDeleteRowOrColumnMenu,\n iconProps: {\n iconName: 'RichTextTableDeleteMenuIcon',\n styles: { root: tableContextMenuIconStyles }\n },\n subMenuProps: {\n items: [\n {\n key: 'RichTextTableEditMenuTableDeleteRow',\n text: strings.richTextDeleteRowMenu,\n ariaLabel: strings.richTextDeleteRowMenu,\n onClick: () => {\n editTable(editor, 'deleteRow');\n }\n },\n {\n key: 'RichTextTableEditMenuTableDeleteColumn',\n text: strings.richTextDeleteColumnMenu,\n ariaLabel: strings.richTextDeleteColumnMenu,\n onClick: () => {\n editTable(editor, 'deleteColumn');\n }\n },\n {\n key: 'RichTextTableEditMenuTableDeleteTable',\n text: strings.richTextDeleteTableMenu,\n ariaLabel: strings.richTextDeleteTableMenu,\n onClick: () => {\n editTable(editor, 'deleteTable');\n }\n }\n ]\n }\n }\n ];\n};\n"]}
@@ -83,7 +83,7 @@ export declare const defaultSpokenLanguage: _SupportedSpokenLanguage;
83
83
  *
84
84
  * @private
85
85
  */
86
- export declare const isEnterKeyEventFromCompositionSession: (e: React.KeyboardEvent<HTMLElement>) => boolean;
86
+ export declare const isEnterKeyEventFromCompositionSession: (e: KeyboardEvent) => boolean;
87
87
  /**
88
88
  * @private
89
89
  */
@@ -201,9 +201,7 @@ const SAFARI_COMPOSITION_KEYCODE = 229;
201
201
  */
202
202
  export const isEnterKeyEventFromCompositionSession = (e) =>
203
203
  // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)
204
- e.nativeEvent.isComposing ||
205
- e.nativeEvent.keyCode === SAFARI_COMPOSITION_KEYCODE ||
206
- e.nativeEvent.which === SAFARI_COMPOSITION_KEYCODE;
204
+ e.isComposing || e.keyCode === SAFARI_COMPOSITION_KEYCODE || e.which === SAFARI_COMPOSITION_KEYCODE;
207
205
  /**
208
206
  * @private
209
207
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAI7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAU,EAAE;IAC5E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CA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;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA6B,OAAO,CAAC;AAEvE;;GAEG;AACH,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAmC,EAAW,EAAE;AACpG,oIAAoI;AACpI,CAAC,CAAC,WAAW,CAAC,WAAW;IACzB,CAAC,CAAC,WAAW,CAAC,OAAO,KAAK,0BAA0B;IACpD,CAAC,CAAC,WAAW,CAAC,KAAK,KAAK,0BAA0B,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,KAAe,EAAiB,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\nimport { _SupportedSpokenLanguage } from '../types';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[],\n mountTimestamp?: Date\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n if (mountTimestamp && error.timestamp && mountTimestamp > error.timestamp) {\n // Error has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneAccessDeniedSafari':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAccessDeniedSafari':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n case 'startScreenShareGeneric':\n case 'cameraFrozenForRemoteParticipants':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n\n/**\n * @private\n */\nexport const isValidString = (string: string | undefined): string is string => {\n return !!string && string.length > 0;\n};\n\n/**\n * Chunk an array into rows of a given size.\n * @private\n */\nexport function chunk<T>(options: T[], itemsPerRow: number): T[][] {\n const rows: T[][] = [];\n let currentRow: T[] = [];\n for (const option of options) {\n currentRow.push(option);\n if (currentRow.length === itemsPerRow) {\n rows.push(currentRow);\n currentRow = [];\n }\n }\n if (currentRow.length > 0) {\n rows.push(currentRow);\n }\n return rows;\n}\n\n/**\n * @private\n */\nexport const defaultSpokenLanguage: _SupportedSpokenLanguage = 'en-us';\n\n/**\n * @private\n */\nconst SAFARI_COMPOSITION_KEYCODE = 229;\n/**\n * Determine if the press of the enter key is from a composition session or not (Safari only)\n *\n * @private\n */\nexport const isEnterKeyEventFromCompositionSession = (e: React.KeyboardEvent<HTMLElement>): boolean =>\n // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)\n e.nativeEvent.isComposing ||\n e.nativeEvent.keyCode === SAFARI_COMPOSITION_KEYCODE ||\n e.nativeEvent.which === SAFARI_COMPOSITION_KEYCODE;\n\n/**\n * @private\n */\nexport const nullToUndefined = <T>(value: T | null): T | undefined => (value === null ? undefined : value);\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAI7D;;;;;;GAMG;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AC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA6B,OAAO,CAAC;AAEvE;;GAEG;AACH,MAAM,0BAA0B,GAAG,GAAG,CAAC;AACvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAgB,EAAW,EAAE;AACjF,oIAAoI;AACpI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,KAAK,0BAA0B,IAAI,CAAC,CAAC,KAAK,KAAK,0BAA0B,CAAC;AAEtG;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,KAAe,EAAiB,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\nimport { _SupportedSpokenLanguage } from '../types';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n const toDismissTimestamp = toDismiss.timestamp ?? now;\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n // the error time could be sometimes later than the button click time, which cause the dismiss not working\n // so we set the dismiss time to the later one\n dismissedAt: now > toDismissTimestamp ? now : toDismissTimestamp,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[],\n mountTimestamp?: Date\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n if (mountTimestamp && error.timestamp && mountTimestamp > error.timestamp) {\n // Error has a timestamp and it is older than when the component was mounted.\n return false;\n }\n\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneAccessDeniedSafari':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAccessDeniedSafari':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n case 'startScreenShareGeneric':\n case 'cameraFrozenForRemoteParticipants':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneAccessDeniedSafari: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAccessDeniedSafari: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n\n/**\n * @private\n */\nexport const isValidString = (string: string | undefined): string is string => {\n return !!string && string.length > 0;\n};\n\n/**\n * Chunk an array into rows of a given size.\n * @private\n */\nexport function chunk<T>(options: T[], itemsPerRow: number): T[][] {\n const rows: T[][] = [];\n let currentRow: T[] = [];\n for (const option of options) {\n currentRow.push(option);\n if (currentRow.length === itemsPerRow) {\n rows.push(currentRow);\n currentRow = [];\n }\n }\n if (currentRow.length > 0) {\n rows.push(currentRow);\n }\n return rows;\n}\n\n/**\n * @private\n */\nexport const defaultSpokenLanguage: _SupportedSpokenLanguage = 'en-us';\n\n/**\n * @private\n */\nconst SAFARI_COMPOSITION_KEYCODE = 229;\n/**\n * Determine if the press of the enter key is from a composition session or not (Safari only)\n *\n * @private\n */\nexport const isEnterKeyEventFromCompositionSession = (e: KeyboardEvent): boolean =>\n // Uses KeyCode 229 and which code 229 to determine if the press of the enter key is from a composition session or not (Safari only)\n e.isComposing || e.keyCode === SAFARI_COMPOSITION_KEYCODE || e.which === SAFARI_COMPOSITION_KEYCODE;\n\n/**\n * @private\n */\nexport const nullToUndefined = <T>(value: T | null): T | undefined => (value === null ? undefined : value);\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import React, { useCallback, useEffect, useMemo } from 'react';
3
+ import React, { createRef, useCallback, useEffect, useMemo } from 'react';
4
4
  import { useIsParticularSidePaneOpen } from './SidePaneProvider';
5
5
  import { SidePaneHeader } from '../../../common/SidePaneHeader';
6
6
  import { useLocale } from '../../../localization';
@@ -22,12 +22,13 @@ export const useVideoEffectsPane = (updateSidePaneRenderer, mobileView, latestEr
22
22
  return (React.createElement(SidePaneHeader, { onClose: closePane, headingText: locale.strings.call.videoEffectsPaneTitle, dismissSidePaneButtonAriaLabel: (_b = (_a = locale.strings.call.dismissSidePaneButtonLabel) !== null && _a !== void 0 ? _a : locale.strings.callWithChat.dismissSidePaneButtonLabel) !== null && _b !== void 0 ? _b : 'Close', mobileView: mobileView }));
23
23
  }, [closePane, locale.strings, mobileView]);
24
24
  const latestVideoEffectError = latestErrors.find((error) => error.type === 'unableToStartVideoEffect');
25
+ const updateFocusHandle = useMemo(() => createRef(), []);
25
26
  const onRenderContent = useCallback(() => {
26
27
  return (React.createElement(VideoEffectsPaneContent, { onDismissError: onDismissError, activeVideoEffectError: latestVideoEffectError, activeVideoEffectChange: () => {
27
28
  // Clear any existing video effects error when the user clicks on a new video effect
28
29
  latestVideoEffectError && (onDismissError === null || onDismissError === void 0 ? void 0 : onDismissError(latestVideoEffectError));
29
- } }));
30
- }, [latestVideoEffectError, onDismissError]);
30
+ }, updateFocusHandle: updateFocusHandle }));
31
+ }, [latestVideoEffectError, onDismissError, updateFocusHandle]);
31
32
  const sidePaneRenderer = useMemo(() => ({
32
33
  headerRenderer: onRenderHeader,
33
34
  contentRenderer: onRenderContent,
@@ -35,7 +36,9 @@ export const useVideoEffectsPane = (updateSidePaneRenderer, mobileView, latestEr
35
36
  }), [onRenderContent, onRenderHeader]);
36
37
  const openPane = useCallback(() => {
37
38
  updateSidePaneRenderer(sidePaneRenderer);
38
- }, [sidePaneRenderer, updateSidePaneRenderer]);
39
+ // Run in a setTimeout as it must be called only once the imperative handle is available
40
+ setTimeout(() => { var _a; return (_a = updateFocusHandle.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 0);
41
+ }, [sidePaneRenderer, updateSidePaneRenderer, updateFocusHandle]);
39
42
  const isOpen = useIsParticularSidePaneOpen(VIDEO_EFFECTS_SIDE_PANE_ID);
40
43
  // Update pane renderer if it is open and the openPane dep changes
41
44
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"useVideoEffectsPane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAoB,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,eAAe;AACf,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAEzD,eAAe;AACf,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AAEtD,eAAe;AACf,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,sBAAwE,EACxE,UAAmB,EACnB,YAAkC,EAClC,cAAmD,EACnD,eAA0C,EAM1C,EAAE;IACF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;;QACjC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAClC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;;QACtC,OAAO,CACL,oBAAC,cAAc,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B,CAAC,0BAA0B,CAAC,CAAC;IAEvE,kEAAkE;IAClE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,MAAM,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;QACd,CAAC;aAAM,CAAC;YACN,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,oBAAoB,EAAE,QAAQ;QAC9B,qBAAqB,EAAE,SAAS;QAChC,sBAAsB,EAAE,UAAU;QAClC,sBAAsB,EAAE,MAAM;KAC/B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { SidePaneRenderer, useIsParticularSidePaneOpen } from './SidePaneProvider';\nimport { SidePaneHeader } from '../../../common/SidePaneHeader';\n\nimport { useLocale } from '../../../localization';\nimport { VideoEffectsPaneContent } from '../../../common/VideoEffectsPane';\nimport { ActiveErrorMessage } from '@internal/react-components';\nimport { IButton } from '@fluentui/react';\n\n/** @private */\nexport const VIDEO_EFFECTS_SIDE_PANE_ID = 'videoeffects';\n\n/** @private */\nexport const VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM = 17.5;\n\n/** @private */\nexport const useVideoEffectsPane = (\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void,\n mobileView: boolean,\n latestErrors: ActiveErrorMessage[],\n onDismissError: (error: ActiveErrorMessage) => void,\n cameraButtonRef?: React.RefObject<IButton>\n): {\n openVideoEffectsPane: () => void;\n closeVideoEffectsPane: () => void;\n toggleVideoEffectsPane: () => void;\n isVideoEffectsPaneOpen: boolean;\n} => {\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n cameraButtonRef?.current?.focus();\n }, [cameraButtonRef, updateSidePaneRenderer]);\n\n const locale = useLocale();\n\n const onRenderHeader = useCallback(() => {\n return (\n <SidePaneHeader\n onClose={closePane}\n headingText={locale.strings.call.videoEffectsPaneTitle}\n dismissSidePaneButtonAriaLabel={\n locale.strings.call.dismissSidePaneButtonLabel ??\n locale.strings.callWithChat.dismissSidePaneButtonLabel ??\n 'Close'\n }\n mobileView={mobileView}\n />\n );\n }, [closePane, locale.strings, mobileView]);\n\n const latestVideoEffectError = latestErrors.find((error) => error.type === 'unableToStartVideoEffect');\n\n const onRenderContent = useCallback((): JSX.Element => {\n return (\n <VideoEffectsPaneContent\n onDismissError={onDismissError}\n activeVideoEffectError={latestVideoEffectError}\n activeVideoEffectChange={() => {\n // Clear any existing video effects error when the user clicks on a new video effect\n\n latestVideoEffectError && onDismissError?.(latestVideoEffectError);\n }}\n />\n );\n }, [latestVideoEffectError, onDismissError]);\n\n const sidePaneRenderer: SidePaneRenderer = useMemo(\n () => ({\n headerRenderer: onRenderHeader,\n contentRenderer: onRenderContent,\n id: VIDEO_EFFECTS_SIDE_PANE_ID\n }),\n [onRenderContent, onRenderHeader]\n );\n\n const openPane = useCallback(() => {\n updateSidePaneRenderer(sidePaneRenderer);\n }, [sidePaneRenderer, updateSidePaneRenderer]);\n\n const isOpen = useIsParticularSidePaneOpen(VIDEO_EFFECTS_SIDE_PANE_ID);\n\n // Update pane renderer if it is open and the openPane dep changes\n useEffect(() => {\n if (isOpen) {\n openPane();\n }\n }, [isOpen, openPane]);\n\n const togglePane = useCallback(() => {\n if (isOpen) {\n closePane();\n } else {\n openPane();\n }\n }, [closePane, isOpen, openPane]);\n\n return {\n openVideoEffectsPane: openPane,\n closeVideoEffectsPane: closePane,\n toggleVideoEffectsPane: togglePane,\n isVideoEffectsPaneOpen: isOpen\n };\n};\n\n/**\n * Active video effect with timestamp.\n *\n * @private\n */\nexport interface ActiveVideoEffect {\n /**\n * Type of video effect that is active.\n */\n type: 'blur' | 'replacement';\n /**\n * The latest timestamp when this effect was activated.\n *\n */\n timestamp: Date;\n}\n"]}
1
+ {"version":3,"file":"useVideoEffectsPane.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAoB,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,eAAe;AACf,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAEzD,eAAe;AACf,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;AAEtD,eAAe;AACf,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,sBAAwE,EACxE,UAAmB,EACnB,YAAkC,EAClC,cAAmD,EACnD,eAA0C,EAM1C,EAAE;IACF,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;;QACjC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAClC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,0CAAE,KAAK,EAAE,CAAC;IACpC,CAAC,EAAE,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;;QACtC,OAAO,CACL,oBAAC,cAAc,IACb,OAAO,EAAE,SAAS,EAClB,WAA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,CAAC;QAEzC,wFAAwF;QACxF,UAAU,CAAC,GAAG,EAAE,WAAC,OAAA,MAAA,iBAAiB,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAA,EAAA,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAElE,MAAM,MAAM,GAAG,2BAA2B,CAAC,0BAA0B,CAAC,CAAC;IAEvE,kEAAkE;IAClE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,MAAM,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;QACd,CAAC;aAAM,CAAC;YACN,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,oBAAoB,EAAE,QAAQ;QAC9B,qBAAqB,EAAE,SAAS;QAChC,sBAAsB,EAAE,UAAU;QAClC,sBAAsB,EAAE,MAAM;KAC/B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { createRef, useCallback, useEffect, useMemo } from 'react';\nimport { SidePaneRenderer, useIsParticularSidePaneOpen } from './SidePaneProvider';\nimport { SidePaneHeader } from '../../../common/SidePaneHeader';\n\nimport { useLocale } from '../../../localization';\nimport { VideoEffectsPaneContent } from '../../../common/VideoEffectsPane';\nimport { ActiveErrorMessage } from '@internal/react-components';\nimport { IButton } from '@fluentui/react';\n\n/** @private */\nexport const VIDEO_EFFECTS_SIDE_PANE_ID = 'videoeffects';\n\n/** @private */\nexport const VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM = 17.5;\n\n/** @private */\nexport const useVideoEffectsPane = (\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void,\n mobileView: boolean,\n latestErrors: ActiveErrorMessage[],\n onDismissError: (error: ActiveErrorMessage) => void,\n cameraButtonRef?: React.RefObject<IButton>\n): {\n openVideoEffectsPane: () => void;\n closeVideoEffectsPane: () => void;\n toggleVideoEffectsPane: () => void;\n isVideoEffectsPaneOpen: boolean;\n} => {\n const closePane = useCallback(() => {\n updateSidePaneRenderer(undefined);\n cameraButtonRef?.current?.focus();\n }, [cameraButtonRef, updateSidePaneRenderer]);\n\n const locale = useLocale();\n\n const onRenderHeader = useCallback(() => {\n return (\n <SidePaneHeader\n onClose={closePane}\n headingText={locale.strings.call.videoEffectsPaneTitle}\n dismissSidePaneButtonAriaLabel={\n locale.strings.call.dismissSidePaneButtonLabel ??\n locale.strings.callWithChat.dismissSidePaneButtonLabel ??\n 'Close'\n }\n mobileView={mobileView}\n />\n );\n }, [closePane, locale.strings, mobileView]);\n\n const latestVideoEffectError = latestErrors.find((error) => error.type === 'unableToStartVideoEffect');\n const updateFocusHandle = useMemo(() => createRef<{ focus: () => void }>(), []);\n\n const onRenderContent = useCallback((): JSX.Element => {\n return (\n <VideoEffectsPaneContent\n onDismissError={onDismissError}\n activeVideoEffectError={latestVideoEffectError}\n activeVideoEffectChange={() => {\n // Clear any existing video effects error when the user clicks on a new video effect\n\n latestVideoEffectError && onDismissError?.(latestVideoEffectError);\n }}\n updateFocusHandle={updateFocusHandle}\n />\n );\n }, [latestVideoEffectError, onDismissError, updateFocusHandle]);\n\n const sidePaneRenderer: SidePaneRenderer = useMemo(\n () => ({\n headerRenderer: onRenderHeader,\n contentRenderer: onRenderContent,\n id: VIDEO_EFFECTS_SIDE_PANE_ID\n }),\n [onRenderContent, onRenderHeader]\n );\n\n const openPane = useCallback(() => {\n updateSidePaneRenderer(sidePaneRenderer);\n\n // Run in a setTimeout as it must be called only once the imperative handle is available\n setTimeout(() => updateFocusHandle.current?.focus(), 0);\n }, [sidePaneRenderer, updateSidePaneRenderer, updateFocusHandle]);\n\n const isOpen = useIsParticularSidePaneOpen(VIDEO_EFFECTS_SIDE_PANE_ID);\n\n // Update pane renderer if it is open and the openPane dep changes\n useEffect(() => {\n if (isOpen) {\n openPane();\n }\n }, [isOpen, openPane]);\n\n const togglePane = useCallback(() => {\n if (isOpen) {\n closePane();\n } else {\n openPane();\n }\n }, [closePane, isOpen, openPane]);\n\n return {\n openVideoEffectsPane: openPane,\n closeVideoEffectsPane: closePane,\n toggleVideoEffectsPane: togglePane,\n isVideoEffectsPaneOpen: isOpen\n };\n};\n\n/**\n * Active video effect with timestamp.\n *\n * @private\n */\nexport interface ActiveVideoEffect {\n /**\n * Type of video effect that is active.\n */\n type: 'blur' | 'replacement';\n /**\n * The latest timestamp when this effect was activated.\n *\n */\n timestamp: Date;\n}\n"]}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ActiveErrorMessage } from "../../../../react-components/src";
3
3
  import { ActiveVideoEffect } from '../CallComposite/components/SidePane/useVideoEffectsPane';
4
4
  /**
@@ -10,5 +10,8 @@ export declare const VideoEffectsPaneContent: (props: {
10
10
  activeVideoEffectError?: ActiveErrorMessage;
11
11
  onDismissError: (error: ActiveErrorMessage) => void;
12
12
  activeVideoEffectChange: (effect: ActiveVideoEffect) => void;
13
+ updateFocusHandle: React.RefObject<{
14
+ focus: () => void;
15
+ }>;
13
16
  }) => JSX.Element;
14
17
  //# sourceMappingURL=VideoEffectsPane.d.ts.map
@@ -114,9 +114,9 @@ export const VideoEffectsPaneContent = (props) => {
114
114
  };
115
115
  adapter.updateSelectedVideoBackgroundEffect(noneEffect);
116
116
  }
117
- return VideoEffectsPaneTrampoline(onDismissError, activeVideoEffectError, selectableVideoEffects, onEffectChange);
117
+ return VideoEffectsPaneTrampoline(onDismissError, props.updateFocusHandle, activeVideoEffectError, selectableVideoEffects, onEffectChange);
118
118
  };
119
- const VideoEffectsPaneTrampoline = (onDismissError, activeVideoEffectError, selectableVideoEffects, onEffectChange) => {
119
+ const VideoEffectsPaneTrampoline = (onDismissError, updateFocusHandle, activeVideoEffectError, selectableVideoEffects, onEffectChange) => {
120
120
  const selectedEffect = useSelector(activeVideoBackgroundEffectSelector);
121
121
  const isCameraOn = useSelector(localVideoSelector).isAvailable;
122
122
  const showWarning = !isCameraOn && selectedEffect !== 'none';
@@ -124,7 +124,7 @@ const VideoEffectsPaneTrampoline = (onDismissError, activeVideoEffectError, sele
124
124
  return (React.createElement(Stack, { tokens: { childrenGap: '0.75rem' }, className: mergeStyles({ paddingLeft: '0.5rem' }) },
125
125
  activeVideoEffectError && isCameraOn && (React.createElement(MessageBar, { messageBarType: MessageBarType.error, onDismiss: () => onDismissError(activeVideoEffectError) }, locale.strings.call.unableToStartVideoEffect)),
126
126
  showWarning && (React.createElement(MessageBar, { messageBarType: MessageBarType.warning }, locale.strings.call.cameraOffBackgroundEffectWarningText)),
127
- React.createElement(_VideoBackgroundEffectsPicker, { label: locale.strings.call.videoEffectsPaneBackgroundSelectionTitle, styles: backgroundPickerStyles, options: selectableVideoEffects !== null && selectableVideoEffects !== void 0 ? selectableVideoEffects : [], onChange: onEffectChange, selectedEffectKey: selectedEffect })));
127
+ React.createElement(_VideoBackgroundEffectsPicker, { label: locale.strings.call.videoEffectsPaneBackgroundSelectionTitle, styles: backgroundPickerStyles, options: selectableVideoEffects !== null && selectableVideoEffects !== void 0 ? selectableVideoEffects : [], onChange: onEffectChange, selectedEffectKey: selectedEffect, componentRef: updateFocusHandle })));
128
128
  return React.createElement(React.Fragment, null);
129
129
  };
130
130
  const backgroundPickerStyles = {