diff --git a/src/controls/richText/RichTextPropertyPane.tsx b/src/controls/richText/RichTextPropertyPane.tsx index 02afc1128..6c6ed878f 100644 --- a/src/controls/richText/RichTextPropertyPane.tsx +++ b/src/controls/richText/RichTextPropertyPane.tsx @@ -44,16 +44,16 @@ export default class RichTextPropertyPane extends React.Component { return ( + isBlocking={false} + isOpen={this.props.isOpen} + type={PanelType.smallFixedFar} + onDismiss={this.props.onClose} + closeButtonAriaLabel={strings.CloseButton} + onRenderNavigation={this.handleRenderNavigation} + focusTrapZoneProps={{ + forceFocusInsideTrap: false, + isClickableOutsideFocusTrap: true + }}>
@@ -106,45 +106,45 @@ export default class RichTextPropertyPane extends React.Component
+ id="undo-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> + className={styles.propertyPaneButton} + aria-describedby="undo-propertyPaneButton" + iconProps={{ + iconName: 'Undo', + style: { + fontSize: '20px' + } + }} /> + id="redo-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> + className={styles.propertyPaneButton} + aria-describedby="redo-propertyPaneButton" + iconProps={{ + iconName: 'Redo', + style: { + fontSize: '20px' + } + }} /> + id="clearFormatting-button-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> + className={styles.propertyPaneButton} + aria-describedby="clearFormatting-button-propertyPaneButton" + iconProps={{ + iconName: 'ClearFormatting', + style: { + fontSize: '20px' + } + }} />
@@ -161,17 +161,17 @@ export default class RichTextPropertyPane extends React.Component
); @@ -187,22 +187,22 @@ export default class RichTextPropertyPane extends React.Component
); @@ -217,93 +217,93 @@ export default class RichTextPropertyPane extends React.Component
+ id="bold-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('bold', !this.state.formats!.bold)} - className={styles.propertyPaneButton} - aria-describedby="bold-propertyPaneButton" - iconProps={{ - iconName: 'Bold', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('bold', !this.state.formats!.bold)} + className={styles.propertyPaneButton} + aria-describedby="bold-propertyPaneButton" + iconProps={{ + iconName: 'Bold', + style: { + fontSize: '20px' + } + }} /> + id="italic-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('italic', !this.state.formats!.italic)} - className={styles.propertyPaneButton} - aria-describedby="italic-propertyPaneButton" - iconProps={{ - iconName: 'Italic', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('italic', !this.state.formats!.italic)} + className={styles.propertyPaneButton} + aria-describedby="italic-propertyPaneButton" + iconProps={{ + iconName: 'Italic', + style: { + fontSize: '20px' + } + }} /> + id="underline-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('underline', !this.state.formats!.underline)} - className={styles.propertyPaneButton} - aria-describedby="underline-propertyPaneButton" - iconProps={{ - iconName: 'Underline', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('underline', !this.state.formats!.underline)} + className={styles.propertyPaneButton} + aria-describedby="underline-propertyPaneButton" + iconProps={{ + iconName: 'Underline', + style: { + fontSize: '20px' + } + }} /> + id="strikethrough-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('strike', !this.state.formats!.strike)} - className={styles.propertyPaneButton} - aria-describedby="strikethrough-propertyPaneButton" - iconProps={{ - iconName: 'Strikethrough', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('strike', !this.state.formats!.strike)} + className={styles.propertyPaneButton} + aria-describedby="strikethrough-propertyPaneButton" + iconProps={{ + iconName: 'Strikethrough', + style: { + fontSize: '20px' + } + }} /> + id="superscript-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('script', this.state.formats!.script === 'super' ? '' : 'super')} - className={styles.propertyPaneButton} - aria-describedby="superscript-propertyPaneButton" - iconProps={{ - iconName: 'Superscript', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('script', this.state.formats!.script === 'super' ? '' : 'super')} + className={styles.propertyPaneButton} + aria-describedby="superscript-propertyPaneButton" + iconProps={{ + iconName: 'Superscript', + style: { + fontSize: '20px' + } + }} /> + id="subscript-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('script', this.state.formats!.script === 'sub' ? '' : 'sub')} - className={styles.propertyPaneButton} - aria-describedby="subscript-propertyPaneButton" - iconProps={{ - iconName: 'Subscript', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('script', this.state.formats!.script === 'sub' ? '' : 'sub')} + className={styles.propertyPaneButton} + aria-describedby="subscript-propertyPaneButton" + iconProps={{ + iconName: 'Subscript', + style: { + fontSize: '20px' + } + }} />
@@ -329,27 +329,27 @@ export default class RichTextPropertyPane extends React.Component
this.handleFillColorChanged(undefined)} /> + customColors={this.props.customColors} + buttonLabel={strings.FontColorLabel} + id="fontColor-propertyPaneButton" + defaultButtonLabel={strings.AutomaticFontColor} + fillThemeColor={true} + previewColor={color} + selectedColor={color} + onColorChanged={this.handleFillColorChanged} + switchToDefaultColor={() => this.handleFillColorChanged(undefined)} /> this.handleHighlightColorChanged(undefined)} - previewColor={backgroundColor} - defaultButtonLabel={strings.NoColorHighlightColor} - selectedColor={backgroundColor} - id="highlightColor-propertyPaneButton" + colorPickerGroups={[ + "highlightColors" + ]} + fillThemeColor={false} + onColorChanged={this.handleHighlightColorChanged} + switchToDefaultColor={() => this.handleHighlightColorChanged(undefined)} + previewColor={backgroundColor} + defaultButtonLabel={strings.NoColorHighlightColor} + selectedColor={backgroundColor} + id="highlightColor-propertyPaneButton" />
@@ -366,93 +366,93 @@ export default class RichTextPropertyPane extends React.Component
+ id="left-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('align', undefined)} - className={styles.propertyPaneButton} - aria-describedby="left-propertyPaneButton" - iconProps={{ - iconName: 'AlignLeft', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('align', undefined)} + className={styles.propertyPaneButton} + aria-describedby="left-propertyPaneButton" + iconProps={{ + iconName: 'AlignLeft', + style: { + fontSize: '20px' + } + }} /> + id="center-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('align', 'center')} - className={styles.propertyPaneButton} - aria-describedby="center-propertyPaneButton" - iconProps={{ - iconName: 'AlignCenter', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('align', 'center')} + className={styles.propertyPaneButton} + aria-describedby="center-propertyPaneButton" + iconProps={{ + iconName: 'AlignCenter', + style: { + fontSize: '20px' + } + }} /> + id="right-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('align', 'right')} - className={styles.propertyPaneButton} - aria-describedby="right-propertyPaneButton" - iconProps={{ - iconName: 'AlignRight', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('align', 'right')} + className={styles.propertyPaneButton} + aria-describedby="right-propertyPaneButton" + iconProps={{ + iconName: 'AlignRight', + style: { + fontSize: '20px' + } + }} /> + id="justify-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('align', 'justify')} - className={styles.propertyPaneButton} - aria-describedby="justify-propertyPaneButton" - iconProps={{ - iconName: 'AlignJustify', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('align', 'justify')} + className={styles.propertyPaneButton} + aria-describedby="justify-propertyPaneButton" + iconProps={{ + iconName: 'AlignJustify', + style: { + fontSize: '20px' + } + }} /> - this.applyFormat('script', this.state.formats!.script === 'super' ? '' : 'super')} - className={styles.propertyPaneButton} - aria-describedby="increaseindent-propertyPaneButton" - iconProps={{ - iconName: 'IncreaseIndentLegacy', - style: { - fontSize: '20px' - } - }} /> + id="increaseindent-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> + this.onChangeIndent(1)} + className={styles.propertyPaneButton} + aria-describedby="increaseindent-propertyPaneButton" + iconProps={{ + iconName: 'IncreaseIndentLegacy', + style: { + fontSize: '20px' + } + }} /> - this.applyFormat('script', this.state.formats!.script === 'sub' ? '' : 'sub')} - className={styles.propertyPaneButton} - aria-describedby="decreaseindent-propertyPaneButton" - iconProps={{ - iconName: 'DecreaseIndentLegacy', - style: { - fontSize: '20px' - } - }} /> + id="decreaseindent-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> + this.onChangeIndent(-1)} + className={styles.propertyPaneButton} + aria-describedby="decreaseindent-propertyPaneButton" + iconProps={{ + iconName: 'DecreaseIndentLegacy', + style: { + fontSize: '20px' + } + }} />
@@ -468,33 +468,33 @@ export default class RichTextPropertyPane extends React.Component
+ id="bullet-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('list', 'bullet')} - className={styles.propertyPaneButton} - aria-describedby="bullet-propertyPaneButton" - iconProps={{ - iconName: 'BulletedList', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('list', 'bullet')} + className={styles.propertyPaneButton} + aria-describedby="bullet-propertyPaneButton" + iconProps={{ + iconName: 'BulletedList', + style: { + fontSize: '20px' + } + }} /> + id="ordered-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('list', 'ordered')} - className={styles.propertyPaneButton} - aria-describedby="ordered-propertyPaneButton" - iconProps={{ - iconName: 'NumberedList', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('list', 'ordered')} + className={styles.propertyPaneButton} + aria-describedby="ordered-propertyPaneButton" + iconProps={{ + iconName: 'NumberedList', + style: { + fontSize: '20px' + } + }} />
@@ -510,33 +510,33 @@ export default class RichTextPropertyPane extends React.Component
+ id="link-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.props.onLink()} - className={styles.propertyPaneButton} - aria-describedby="link-propertyPaneButton" - iconProps={{ - iconName: 'Link', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.props.onLink()} + className={styles.propertyPaneButton} + aria-describedby="link-propertyPaneButton" + iconProps={{ + iconName: 'Link', + style: { + fontSize: '20px' + } + }} /> + id="unlink-propertyPaneButton" + calloutProps={{ gapSpace: 0 }}> this.applyFormat('link', false)} - className={styles.propertyPaneButton} - aria-describedby="unlink-propertyPaneButton" - iconProps={{ - iconName: 'RemoveLink', - style: { - fontSize: '20px' - } - }} /> + onClick={() => this.applyFormat('link', false)} + className={styles.propertyPaneButton} + aria-describedby="unlink-propertyPaneButton" + iconProps={{ + iconName: 'RemoveLink', + style: { + fontSize: '20px' + } + }} />
@@ -566,6 +566,15 @@ export default class RichTextPropertyPane extends React.Component { + const quill = this.props.editor; + const current = +(quill.getFormat(quill.getSelection()).indent || 0); + this.applyFormat("indent", current + direction); + } + /** * On size change */ @@ -633,12 +642,12 @@ export default class RichTextPropertyPane extends React.Component