@atlaskit/editor-plugin-insert-block 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 3.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#146116](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146116)
|
|
8
|
+
[`67279b54bce62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/67279b54bce62) -
|
|
9
|
+
[ux] Add all block insert actions in Editor primary toolbar
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.2.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -669,8 +669,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
669
669
|
_tableSelectorButton4,
|
|
670
670
|
_tableSelectorButton5,
|
|
671
671
|
_tableSelectorButton6,
|
|
672
|
-
_this$props$
|
|
673
|
-
_this$
|
|
672
|
+
_this$props$isDisable,
|
|
673
|
+
_this$plusButtonRef,
|
|
674
674
|
_this$props$pluginInj;
|
|
675
675
|
var _this$state2 = this.state,
|
|
676
676
|
buttons = _this$state2.buttons,
|
|
@@ -682,32 +682,6 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
682
682
|
isReducedSpacing = _this$props13.isReducedSpacing,
|
|
683
683
|
editorAppearance = _this$props13.editorAppearance;
|
|
684
684
|
var isFullPageAppearance = ['full-page', 'full-width'].includes(editorAppearance !== null && editorAppearance !== void 0 ? editorAppearance : '');
|
|
685
|
-
if (isFullPageAppearance && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_insert_button_on_primary_toolbar')) {
|
|
686
|
-
var _this$props$isDisable, _this$plusButtonRef;
|
|
687
|
-
return (0, _react2.jsx)(_ui.ToolbarButtonGroup, null, (0, _react2.jsx)(_ui.ToolbarDropdownWrapper, null, this.renderPopup(), this.renderTableSelectorPopup(), (0, _react2.jsx)(_blockInsertMenu.BlockInsertMenu, {
|
|
688
|
-
popupsMountPoint: this.props.popupsMountPoint,
|
|
689
|
-
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
690
|
-
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
691
|
-
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
692
|
-
editorView: this.props.editorView,
|
|
693
|
-
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
694
|
-
label: this.props.intl.formatMessage(_messages.toolbarInsertBlockMessages.insertMenu),
|
|
695
|
-
open: this.state.isPlusMenuOpen,
|
|
696
|
-
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
697
|
-
items: this.state.dropdownItems,
|
|
698
|
-
onRef: this.handleDropDownButtonRef,
|
|
699
|
-
onPlusButtonRef: this.handlePlusButtonRef,
|
|
700
|
-
onClick: this.handleClick,
|
|
701
|
-
onKeyDown: this.handleOpenByKeyboard,
|
|
702
|
-
onItemActivated: this.insertInsertMenuItem,
|
|
703
|
-
onInsert: this.insertInsertMenuItem,
|
|
704
|
-
onOpenChange: this.onOpenChange,
|
|
705
|
-
togglePlusMenuVisibility: this.togglePlusMenuVisibility,
|
|
706
|
-
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
707
|
-
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
708
|
-
isFullPageAppearance: isFullPageAppearance
|
|
709
|
-
})), (0, _react2.jsx)(_ui.ToolbarSeparator, null));
|
|
710
|
-
}
|
|
711
685
|
var isTableButtonVisible = buttons.some(function (_ref7) {
|
|
712
686
|
var value = _ref7.value;
|
|
713
687
|
return value.name === 'table';
|
|
@@ -813,12 +787,12 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
813
787
|
popupsMountPoint: this.props.popupsMountPoint,
|
|
814
788
|
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
815
789
|
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
816
|
-
disabled: (_this$props$
|
|
790
|
+
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
817
791
|
editorView: this.props.editorView,
|
|
818
792
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
819
793
|
label: this.props.intl.formatMessage(_messages.toolbarInsertBlockMessages.insertMenu),
|
|
820
794
|
open: this.state.isPlusMenuOpen,
|
|
821
|
-
plusButtonRef: (_this$
|
|
795
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
822
796
|
items: this.state.dropdownItems,
|
|
823
797
|
onRef: this.handleDropDownButtonRef,
|
|
824
798
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
@@ -831,7 +805,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
831
805
|
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
832
806
|
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
833
807
|
isFullPageAppearance: isFullPageAppearance
|
|
834
|
-
})), !((_this$props$pluginInj = this.props.pluginInjectionApi) !== null && _this$props$pluginInj !== void 0 && _this$props$pluginInj.primaryToolbar) && this.props.showSeparator && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
808
|
+
})), (!((_this$props$pluginInj = this.props.pluginInjectionApi) !== null && _this$props$pluginInj !== void 0 && _this$props$pluginInj.primaryToolbar) && this.props.showSeparator || isFullPageAppearance && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_insert_button_on_primary_toolbar')) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
835
809
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
836
810
|
(0, _react2.jsx)("span", {
|
|
837
811
|
css: _styles.separatorStyles
|
|
@@ -13,7 +13,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
13
13
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
15
|
import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
16
|
-
import { Popup, TableSelectorPopup
|
|
16
|
+
import { Popup, TableSelectorPopup } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
18
18
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
19
19
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -718,7 +718,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
render() {
|
|
721
|
-
var _tableButton, _tableButton2, _tableButton3, _tableButton4, _tableButton5, _tableButton6, _tableButton7, _tableSelectorButton, _tableSelectorButton2, _tableSelectorButton3, _tableSelectorButton4, _tableSelectorButton5, _tableSelectorButton6, _this$props$
|
|
721
|
+
var _tableButton, _tableButton2, _tableButton3, _tableButton4, _tableButton5, _tableButton6, _tableButton7, _tableSelectorButton, _tableSelectorButton2, _tableSelectorButton3, _tableSelectorButton4, _tableSelectorButton5, _tableSelectorButton6, _this$props$isDisable, _this$plusButtonRef, _this$props$pluginInj4;
|
|
722
722
|
const {
|
|
723
723
|
buttons,
|
|
724
724
|
dropdownItems,
|
|
@@ -731,32 +731,6 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
731
731
|
editorAppearance
|
|
732
732
|
} = this.props;
|
|
733
733
|
const isFullPageAppearance = ['full-page', 'full-width'].includes(editorAppearance !== null && editorAppearance !== void 0 ? editorAppearance : '');
|
|
734
|
-
if (isFullPageAppearance && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_insert_button_on_primary_toolbar')) {
|
|
735
|
-
var _this$props$isDisable, _this$plusButtonRef;
|
|
736
|
-
return jsx(ToolbarButtonGroup, null, jsx(ToolbarDropdownWrapper, null, this.renderPopup(), this.renderTableSelectorPopup(), jsx(BlockInsertMenu, {
|
|
737
|
-
popupsMountPoint: this.props.popupsMountPoint,
|
|
738
|
-
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
739
|
-
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
740
|
-
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
741
|
-
editorView: this.props.editorView,
|
|
742
|
-
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
743
|
-
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
744
|
-
open: this.state.isPlusMenuOpen,
|
|
745
|
-
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
746
|
-
items: this.state.dropdownItems,
|
|
747
|
-
onRef: this.handleDropDownButtonRef,
|
|
748
|
-
onPlusButtonRef: this.handlePlusButtonRef,
|
|
749
|
-
onClick: this.handleClick,
|
|
750
|
-
onKeyDown: this.handleOpenByKeyboard,
|
|
751
|
-
onItemActivated: this.insertInsertMenuItem,
|
|
752
|
-
onInsert: this.insertInsertMenuItem,
|
|
753
|
-
onOpenChange: this.onOpenChange,
|
|
754
|
-
togglePlusMenuVisibility: this.togglePlusMenuVisibility,
|
|
755
|
-
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
756
|
-
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
757
|
-
isFullPageAppearance: isFullPageAppearance
|
|
758
|
-
})), jsx(ToolbarSeparator, null));
|
|
759
|
-
}
|
|
760
734
|
const isTableButtonVisible = buttons.some(({
|
|
761
735
|
value
|
|
762
736
|
}) => value.name === 'table');
|
|
@@ -851,12 +825,12 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
851
825
|
popupsMountPoint: this.props.popupsMountPoint,
|
|
852
826
|
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
853
827
|
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
854
|
-
disabled: (_this$props$
|
|
828
|
+
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
855
829
|
editorView: this.props.editorView,
|
|
856
830
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
857
831
|
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
858
832
|
open: this.state.isPlusMenuOpen,
|
|
859
|
-
plusButtonRef: (_this$
|
|
833
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
860
834
|
items: this.state.dropdownItems,
|
|
861
835
|
onRef: this.handleDropDownButtonRef,
|
|
862
836
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
@@ -869,7 +843,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
869
843
|
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
870
844
|
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
871
845
|
isFullPageAppearance: isFullPageAppearance
|
|
872
|
-
})), !((_this$props$pluginInj4 = this.props.pluginInjectionApi) !== null && _this$props$pluginInj4 !== void 0 && _this$props$pluginInj4.primaryToolbar) && this.props.showSeparator && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
846
|
+
})), (!((_this$props$pluginInj4 = this.props.pluginInjectionApi) !== null && _this$props$pluginInj4 !== void 0 && _this$props$pluginInj4.primaryToolbar) && this.props.showSeparator || isFullPageAppearance && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_insert_button_on_primary_toolbar')) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
873
847
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
874
848
|
jsx("span", {
|
|
875
849
|
css: separatorStyles
|
|
@@ -28,7 +28,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
28
28
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
29
29
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
30
30
|
import { buttonGroupStyle, buttonGroupStyleBeforeVisualRefresh, separatorStyles, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
31
|
-
import { Popup, TableSelectorPopup
|
|
31
|
+
import { Popup, TableSelectorPopup } from '@atlaskit/editor-common/ui';
|
|
32
32
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
33
33
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
34
34
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -663,8 +663,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
663
663
|
_tableSelectorButton4,
|
|
664
664
|
_tableSelectorButton5,
|
|
665
665
|
_tableSelectorButton6,
|
|
666
|
-
_this$props$
|
|
667
|
-
_this$
|
|
666
|
+
_this$props$isDisable,
|
|
667
|
+
_this$plusButtonRef,
|
|
668
668
|
_this$props$pluginInj;
|
|
669
669
|
var _this$state2 = this.state,
|
|
670
670
|
buttons = _this$state2.buttons,
|
|
@@ -676,32 +676,6 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
676
676
|
isReducedSpacing = _this$props13.isReducedSpacing,
|
|
677
677
|
editorAppearance = _this$props13.editorAppearance;
|
|
678
678
|
var isFullPageAppearance = ['full-page', 'full-width'].includes(editorAppearance !== null && editorAppearance !== void 0 ? editorAppearance : '');
|
|
679
|
-
if (isFullPageAppearance && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_insert_button_on_primary_toolbar')) {
|
|
680
|
-
var _this$props$isDisable, _this$plusButtonRef;
|
|
681
|
-
return jsx(ToolbarButtonGroup, null, jsx(ToolbarDropdownWrapper, null, this.renderPopup(), this.renderTableSelectorPopup(), jsx(BlockInsertMenu, {
|
|
682
|
-
popupsMountPoint: this.props.popupsMountPoint,
|
|
683
|
-
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
684
|
-
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
685
|
-
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
686
|
-
editorView: this.props.editorView,
|
|
687
|
-
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
688
|
-
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
689
|
-
open: this.state.isPlusMenuOpen,
|
|
690
|
-
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
691
|
-
items: this.state.dropdownItems,
|
|
692
|
-
onRef: this.handleDropDownButtonRef,
|
|
693
|
-
onPlusButtonRef: this.handlePlusButtonRef,
|
|
694
|
-
onClick: this.handleClick,
|
|
695
|
-
onKeyDown: this.handleOpenByKeyboard,
|
|
696
|
-
onItemActivated: this.insertInsertMenuItem,
|
|
697
|
-
onInsert: this.insertInsertMenuItem,
|
|
698
|
-
onOpenChange: this.onOpenChange,
|
|
699
|
-
togglePlusMenuVisibility: this.togglePlusMenuVisibility,
|
|
700
|
-
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
701
|
-
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
702
|
-
isFullPageAppearance: isFullPageAppearance
|
|
703
|
-
})), jsx(ToolbarSeparator, null));
|
|
704
|
-
}
|
|
705
679
|
var isTableButtonVisible = buttons.some(function (_ref7) {
|
|
706
680
|
var value = _ref7.value;
|
|
707
681
|
return value.name === 'table';
|
|
@@ -807,12 +781,12 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
807
781
|
popupsMountPoint: this.props.popupsMountPoint,
|
|
808
782
|
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
809
783
|
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
810
|
-
disabled: (_this$props$
|
|
784
|
+
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
811
785
|
editorView: this.props.editorView,
|
|
812
786
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
813
787
|
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
814
788
|
open: this.state.isPlusMenuOpen,
|
|
815
|
-
plusButtonRef: (_this$
|
|
789
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
816
790
|
items: this.state.dropdownItems,
|
|
817
791
|
onRef: this.handleDropDownButtonRef,
|
|
818
792
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
@@ -825,7 +799,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
825
799
|
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
826
800
|
pluginInjectionApi: this.props.pluginInjectionApi,
|
|
827
801
|
isFullPageAppearance: isFullPageAppearance
|
|
828
|
-
})), !((_this$props$pluginInj = this.props.pluginInjectionApi) !== null && _this$props$pluginInj !== void 0 && _this$props$pluginInj.primaryToolbar) && this.props.showSeparator && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
802
|
+
})), (!((_this$props$pluginInj = this.props.pluginInjectionApi) !== null && _this$props$pluginInj !== void 0 && _this$props$pluginInj.primaryToolbar) && this.props.showSeparator || isFullPageAppearance && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_insert_button_on_primary_toolbar')) && /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage */
|
|
829
803
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
830
804
|
jsx("span", {
|
|
831
805
|
css: separatorStyles
|