@atlaskit/editor-plugin-insert-block 2.4.0 → 2.4.2
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,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 2.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#156556](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156556)
|
|
8
|
+
[`fa4db989cfa70`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fa4db989cfa70) -
|
|
9
|
+
[HOT-112603] Reduce memory leak footage by using WeakRef to store HTML element
|
|
10
|
+
|
|
11
|
+
## 2.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#155333](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155333)
|
|
16
|
+
[`8b2c7d6c20aa1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2c7d6c20aa1) -
|
|
17
|
+
change logic to ensure plus menu can open in comment when insert-right-rail experiment is enabled
|
|
18
|
+
- [#155735](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155735)
|
|
19
|
+
[`1beeeda29023a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1beeeda29023a) -
|
|
20
|
+
Upgrades editor packages to react 18
|
|
21
|
+
- [#155345](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155345)
|
|
22
|
+
[`9f00717c4915b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f00717c4915b) -
|
|
23
|
+
[ux] Add layout placeholder behind feature gate
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 2.4.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -125,7 +125,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
125
125
|
});
|
|
126
126
|
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
127
127
|
var _ref2;
|
|
128
|
-
(_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || _ref2.focus();
|
|
128
|
+
(_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || (_ref2 = _ref2.deref()) === null || _ref2 === void 0 || _ref2.focus();
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleEmojiPicker", function () {
|
|
@@ -154,7 +154,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
154
154
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmojiPressEscape", function () {
|
|
155
155
|
var _this$emojiButtonRef;
|
|
156
156
|
_this.toggleEmojiPicker(_analytics.INPUT_METHOD.KEYBOARD);
|
|
157
|
-
(_this$emojiButtonRef = _this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 || _this$emojiButtonRef.focus();
|
|
157
|
+
(_this$emojiButtonRef = _this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 || (_this$emojiButtonRef = _this$emojiButtonRef.deref()) === null || _this$emojiButtonRef === void 0 || _this$emojiButtonRef.focus();
|
|
158
158
|
});
|
|
159
159
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmojiClickOutside", function (e) {
|
|
160
160
|
// Ignore click events for detached elements.
|
|
@@ -172,22 +172,22 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
172
172
|
}
|
|
173
173
|
switch (buttonName) {
|
|
174
174
|
case 'emoji':
|
|
175
|
-
_this.emojiButtonRef = ref;
|
|
175
|
+
_this.emojiButtonRef = new WeakRef(ref);
|
|
176
176
|
break;
|
|
177
177
|
case 'media':
|
|
178
|
-
_this.mediaButtonRef = ref;
|
|
178
|
+
_this.mediaButtonRef = new WeakRef(ref);
|
|
179
179
|
break;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
});
|
|
183
183
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlePlusButtonRef", function (ref) {
|
|
184
184
|
if (ref) {
|
|
185
|
-
_this.plusButtonRef = ref;
|
|
185
|
+
_this.plusButtonRef = new WeakRef(ref);
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDropDownButtonRef", function (ref) {
|
|
189
189
|
if (ref) {
|
|
190
|
-
_this.dropdownButtonRef = ref;
|
|
190
|
+
_this.dropdownButtonRef = new WeakRef(ref);
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleTableSelector", function () {
|
|
@@ -350,8 +350,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
350
350
|
var _pluginInjectionApi$l;
|
|
351
351
|
var _this$props4 = _this.props,
|
|
352
352
|
editorView = _this$props4.editorView,
|
|
353
|
-
pluginInjectionApi = _this$props4.pluginInjectionApi
|
|
354
|
-
|
|
353
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi,
|
|
354
|
+
intl = _this$props4.intl;
|
|
355
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod, intl.formatMessage)(editorView.state, editorView.dispatch);
|
|
355
356
|
return true;
|
|
356
357
|
});
|
|
357
358
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createStatus", function (inputMethod) {
|
|
@@ -364,10 +365,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
364
365
|
onShowMediaPicker = _this$props5.onShowMediaPicker,
|
|
365
366
|
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
|
|
366
367
|
if (onShowMediaPicker) {
|
|
367
|
-
var _this$props$popupsMou;
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
var _this$mediaButtonRef, _this$props$popupsMou;
|
|
369
|
+
var ref = (_this$mediaButtonRef = _this.mediaButtonRef) === null || _this$mediaButtonRef === void 0 ? void 0 : _this$mediaButtonRef.deref();
|
|
370
|
+
var args = ref ? {
|
|
371
|
+
ref: ref,
|
|
372
|
+
mountPoint: (_this$props$popupsMou = _this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : ref
|
|
371
373
|
} : undefined;
|
|
372
374
|
onShowMediaPicker(args);
|
|
373
375
|
if (dispatchAnalyticsEvent) {
|
|
@@ -554,7 +556,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
554
556
|
bubbles: true,
|
|
555
557
|
key: 'ArrowDown'
|
|
556
558
|
});
|
|
557
|
-
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 || _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
559
|
+
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 || (_this$dropdownButtonR = _this$dropdownButtonR.deref()) === null || _this$dropdownButtonR === void 0 || _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
558
560
|
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
559
561
|
isOpenedByKeyboard: false
|
|
560
562
|
}));
|
|
@@ -597,7 +599,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
597
599
|
});
|
|
598
600
|
};
|
|
599
601
|
return (0, _react2.jsx)(_ui.Popup, {
|
|
600
|
-
target: ref,
|
|
602
|
+
target: ref.deref(),
|
|
601
603
|
fitHeight: 350,
|
|
602
604
|
fitWidth: 350,
|
|
603
605
|
offset: [0, 3],
|
|
@@ -670,6 +672,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
670
672
|
_tableSelectorButton5,
|
|
671
673
|
_tableSelectorButton6,
|
|
672
674
|
_this$props$isDisable,
|
|
675
|
+
_this$plusButtonRef,
|
|
673
676
|
_this$props$pluginInj3;
|
|
674
677
|
var _this$state2 = this.state,
|
|
675
678
|
buttons = _this$state2.buttons,
|
|
@@ -786,8 +789,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
786
789
|
editorView: this.props.editorView,
|
|
787
790
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
788
791
|
label: this.props.intl.formatMessage(_messages.messages.insertMenu),
|
|
789
|
-
open:
|
|
790
|
-
plusButtonRef: this.plusButtonRef,
|
|
792
|
+
open: (0, _experiments.editorExperiment)('insert-menu-in-right-rail', true) ? !isFullPageAppearance && this.state.isPlusMenuOpen : this.state.isPlusMenuOpen,
|
|
793
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
791
794
|
items: this.state.dropdownItems,
|
|
792
795
|
onRef: this.handleDropDownButtonRef,
|
|
793
796
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
@@ -126,8 +126,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
126
126
|
isPlusMenuOpen: !isPlusMenuOpen
|
|
127
127
|
});
|
|
128
128
|
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
129
|
-
var _ref;
|
|
130
|
-
(_ref = this.plusButtonRef || this.dropdownButtonRef) === null || _ref === void 0 ? void 0 : _ref.focus();
|
|
129
|
+
var _ref, _ref$deref;
|
|
130
|
+
(_ref = this.plusButtonRef || this.dropdownButtonRef) === null || _ref === void 0 ? void 0 : (_ref$deref = _ref.deref()) === null || _ref$deref === void 0 ? void 0 : _ref$deref.focus();
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
_defineProperty(this, "toggleEmojiPicker", (inputMethod = INPUT_METHOD.TOOLBAR) => {
|
|
@@ -153,9 +153,9 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
155
|
_defineProperty(this, "handleEmojiPressEscape", () => {
|
|
156
|
-
var _this$emojiButtonRef
|
|
156
|
+
var _this$emojiButtonRef, _this$emojiButtonRef$;
|
|
157
157
|
this.toggleEmojiPicker(INPUT_METHOD.KEYBOARD);
|
|
158
|
-
(_this$emojiButtonRef = this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 ? void 0 : _this$emojiButtonRef.focus();
|
|
158
|
+
(_this$emojiButtonRef = this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 ? void 0 : (_this$emojiButtonRef$ = _this$emojiButtonRef.deref()) === null || _this$emojiButtonRef$ === void 0 ? void 0 : _this$emojiButtonRef$.focus();
|
|
159
159
|
});
|
|
160
160
|
_defineProperty(this, "handleEmojiClickOutside", e => {
|
|
161
161
|
// Ignore click events for detached elements.
|
|
@@ -172,21 +172,21 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
172
172
|
}
|
|
173
173
|
switch (buttonName) {
|
|
174
174
|
case 'emoji':
|
|
175
|
-
this.emojiButtonRef = ref;
|
|
175
|
+
this.emojiButtonRef = new WeakRef(ref);
|
|
176
176
|
break;
|
|
177
177
|
case 'media':
|
|
178
|
-
this.mediaButtonRef = ref;
|
|
178
|
+
this.mediaButtonRef = new WeakRef(ref);
|
|
179
179
|
break;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
_defineProperty(this, "handlePlusButtonRef", ref => {
|
|
183
183
|
if (ref) {
|
|
184
|
-
this.plusButtonRef = ref;
|
|
184
|
+
this.plusButtonRef = new WeakRef(ref);
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
187
|
_defineProperty(this, "handleDropDownButtonRef", ref => {
|
|
188
188
|
if (ref) {
|
|
189
|
-
this.dropdownButtonRef = ref;
|
|
189
|
+
this.dropdownButtonRef = new WeakRef(ref);
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
_defineProperty(this, "toggleTableSelector", (inputMethod = INPUT_METHOD.TOOLBAR) => {
|
|
@@ -360,9 +360,10 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
360
360
|
var _pluginInjectionApi$l;
|
|
361
361
|
const {
|
|
362
362
|
editorView,
|
|
363
|
-
pluginInjectionApi
|
|
363
|
+
pluginInjectionApi,
|
|
364
|
+
intl
|
|
364
365
|
} = this.props;
|
|
365
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod)(editorView.state, editorView.dispatch);
|
|
366
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod, intl.formatMessage)(editorView.state, editorView.dispatch);
|
|
366
367
|
return true;
|
|
367
368
|
});
|
|
368
369
|
_defineProperty(this, "createStatus", inputMethod => {
|
|
@@ -378,10 +379,11 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
378
379
|
dispatchAnalyticsEvent
|
|
379
380
|
} = this.props;
|
|
380
381
|
if (onShowMediaPicker) {
|
|
381
|
-
var _this$props$popupsMou;
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
var _this$mediaButtonRef, _this$props$popupsMou;
|
|
383
|
+
const ref = (_this$mediaButtonRef = this.mediaButtonRef) === null || _this$mediaButtonRef === void 0 ? void 0 : _this$mediaButtonRef.deref();
|
|
384
|
+
const args = ref ? {
|
|
385
|
+
ref,
|
|
386
|
+
mountPoint: (_this$props$popupsMou = this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : ref
|
|
385
387
|
} : undefined;
|
|
386
388
|
onShowMediaPicker(args);
|
|
387
389
|
if (dispatchAnalyticsEvent) {
|
|
@@ -606,12 +608,12 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
606
608
|
});
|
|
607
609
|
}
|
|
608
610
|
if (this.state.isOpenedByKeyboard) {
|
|
609
|
-
var _this$dropdownButtonR;
|
|
611
|
+
var _this$dropdownButtonR, _this$dropdownButtonR2;
|
|
610
612
|
const downArrowEvent = new KeyboardEvent('keydown', {
|
|
611
613
|
bubbles: true,
|
|
612
614
|
key: 'ArrowDown'
|
|
613
615
|
});
|
|
614
|
-
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 ? void 0 : _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
616
|
+
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 ? void 0 : (_this$dropdownButtonR2 = _this$dropdownButtonR.deref()) === null || _this$dropdownButtonR2 === void 0 ? void 0 : _this$dropdownButtonR2.dispatchEvent(downArrowEvent);
|
|
615
617
|
this.setState({
|
|
616
618
|
...this.state,
|
|
617
619
|
isOpenedByKeyboard: false
|
|
@@ -657,7 +659,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
657
659
|
});
|
|
658
660
|
};
|
|
659
661
|
return jsx(Popup, {
|
|
660
|
-
target: ref,
|
|
662
|
+
target: ref.deref(),
|
|
661
663
|
fitHeight: 350,
|
|
662
664
|
fitWidth: 350,
|
|
663
665
|
offset: [0, 3],
|
|
@@ -713,7 +715,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
713
715
|
});
|
|
714
716
|
}
|
|
715
717
|
render() {
|
|
716
|
-
var _tableButton, _tableButton2, _tableButton3, _tableButton4, _tableButton5, _tableButton6, _tableButton7, _tableSelectorButton, _tableSelectorButton2, _tableSelectorButton3, _tableSelectorButton4, _tableSelectorButton5, _tableSelectorButton6, _this$props$isDisable, _this$props$pluginInj7;
|
|
718
|
+
var _tableButton, _tableButton2, _tableButton3, _tableButton4, _tableButton5, _tableButton6, _tableButton7, _tableSelectorButton, _tableSelectorButton2, _tableSelectorButton3, _tableSelectorButton4, _tableSelectorButton5, _tableSelectorButton6, _this$props$isDisable, _this$plusButtonRef, _this$props$pluginInj7;
|
|
717
719
|
const {
|
|
718
720
|
buttons,
|
|
719
721
|
dropdownItems,
|
|
@@ -820,8 +822,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
820
822
|
editorView: this.props.editorView,
|
|
821
823
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
822
824
|
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
823
|
-
open:
|
|
824
|
-
plusButtonRef: this.plusButtonRef,
|
|
825
|
+
open: editorExperiment('insert-menu-in-right-rail', true) ? !isFullPageAppearance && this.state.isPlusMenuOpen : this.state.isPlusMenuOpen,
|
|
826
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
825
827
|
items: this.state.dropdownItems,
|
|
826
828
|
onRef: this.handleDropDownButtonRef,
|
|
827
829
|
onPlusButtonRef: this.handlePlusButtonRef,
|
|
@@ -116,7 +116,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
116
116
|
});
|
|
117
117
|
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
118
118
|
var _ref2;
|
|
119
|
-
(_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || _ref2.focus();
|
|
119
|
+
(_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || (_ref2 = _ref2.deref()) === null || _ref2 === void 0 || _ref2.focus();
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
_defineProperty(_assertThisInitialized(_this), "toggleEmojiPicker", function () {
|
|
@@ -145,7 +145,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
145
|
_defineProperty(_assertThisInitialized(_this), "handleEmojiPressEscape", function () {
|
|
146
146
|
var _this$emojiButtonRef;
|
|
147
147
|
_this.toggleEmojiPicker(INPUT_METHOD.KEYBOARD);
|
|
148
|
-
(_this$emojiButtonRef = _this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 || _this$emojiButtonRef.focus();
|
|
148
|
+
(_this$emojiButtonRef = _this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 || (_this$emojiButtonRef = _this$emojiButtonRef.deref()) === null || _this$emojiButtonRef === void 0 || _this$emojiButtonRef.focus();
|
|
149
149
|
});
|
|
150
150
|
_defineProperty(_assertThisInitialized(_this), "handleEmojiClickOutside", function (e) {
|
|
151
151
|
// Ignore click events for detached elements.
|
|
@@ -163,22 +163,22 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
163
163
|
}
|
|
164
164
|
switch (buttonName) {
|
|
165
165
|
case 'emoji':
|
|
166
|
-
_this.emojiButtonRef = ref;
|
|
166
|
+
_this.emojiButtonRef = new WeakRef(ref);
|
|
167
167
|
break;
|
|
168
168
|
case 'media':
|
|
169
|
-
_this.mediaButtonRef = ref;
|
|
169
|
+
_this.mediaButtonRef = new WeakRef(ref);
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
});
|
|
174
174
|
_defineProperty(_assertThisInitialized(_this), "handlePlusButtonRef", function (ref) {
|
|
175
175
|
if (ref) {
|
|
176
|
-
_this.plusButtonRef = ref;
|
|
176
|
+
_this.plusButtonRef = new WeakRef(ref);
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
179
|
_defineProperty(_assertThisInitialized(_this), "handleDropDownButtonRef", function (ref) {
|
|
180
180
|
if (ref) {
|
|
181
|
-
_this.dropdownButtonRef = ref;
|
|
181
|
+
_this.dropdownButtonRef = new WeakRef(ref);
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
184
|
_defineProperty(_assertThisInitialized(_this), "toggleTableSelector", function () {
|
|
@@ -341,8 +341,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
341
341
|
var _pluginInjectionApi$l;
|
|
342
342
|
var _this$props4 = _this.props,
|
|
343
343
|
editorView = _this$props4.editorView,
|
|
344
|
-
pluginInjectionApi = _this$props4.pluginInjectionApi
|
|
345
|
-
|
|
344
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi,
|
|
345
|
+
intl = _this$props4.intl;
|
|
346
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod, intl.formatMessage)(editorView.state, editorView.dispatch);
|
|
346
347
|
return true;
|
|
347
348
|
});
|
|
348
349
|
_defineProperty(_assertThisInitialized(_this), "createStatus", function (inputMethod) {
|
|
@@ -355,10 +356,11 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
355
356
|
onShowMediaPicker = _this$props5.onShowMediaPicker,
|
|
356
357
|
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
|
|
357
358
|
if (onShowMediaPicker) {
|
|
358
|
-
var _this$props$popupsMou;
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
var _this$mediaButtonRef, _this$props$popupsMou;
|
|
360
|
+
var ref = (_this$mediaButtonRef = _this.mediaButtonRef) === null || _this$mediaButtonRef === void 0 ? void 0 : _this$mediaButtonRef.deref();
|
|
361
|
+
var args = ref ? {
|
|
362
|
+
ref: ref,
|
|
363
|
+
mountPoint: (_this$props$popupsMou = _this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : ref
|
|
362
364
|
} : undefined;
|
|
363
365
|
onShowMediaPicker(args);
|
|
364
366
|
if (dispatchAnalyticsEvent) {
|
|
@@ -545,7 +547,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
545
547
|
bubbles: true,
|
|
546
548
|
key: 'ArrowDown'
|
|
547
549
|
});
|
|
548
|
-
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 || _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
550
|
+
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 || (_this$dropdownButtonR = _this$dropdownButtonR.deref()) === null || _this$dropdownButtonR === void 0 || _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
549
551
|
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
550
552
|
isOpenedByKeyboard: false
|
|
551
553
|
}));
|
|
@@ -588,7 +590,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
588
590
|
});
|
|
589
591
|
};
|
|
590
592
|
return jsx(Popup, {
|
|
591
|
-
target: ref,
|
|
593
|
+
target: ref.deref(),
|
|
592
594
|
fitHeight: 350,
|
|
593
595
|
fitWidth: 350,
|
|
594
596
|
offset: [0, 3],
|
|
@@ -661,6 +663,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
661
663
|
_tableSelectorButton5,
|
|
662
664
|
_tableSelectorButton6,
|
|
663
665
|
_this$props$isDisable,
|
|
666
|
+
_this$plusButtonRef,
|
|
664
667
|
_this$props$pluginInj3;
|
|
665
668
|
var _this$state2 = this.state,
|
|
666
669
|
buttons = _this$state2.buttons,
|
|
@@ -777,8 +780,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
777
780
|
editorView: this.props.editorView,
|
|
778
781
|
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
779
782
|
label: this.props.intl.formatMessage(messages.insertMenu),
|
|
780
|
-
open:
|
|
781
|
-
plusButtonRef: this.plusButtonRef,
|
|
783
|
+
open: editorExperiment('insert-menu-in-right-rail', true) ? !isFullPageAppearance && this.state.isPlusMenuOpen : this.state.isPlusMenuOpen,
|
|
784
|
+
plusButtonRef: (_this$plusButtonRef = this.plusButtonRef) === null || _this$plusButtonRef === void 0 ? void 0 : _this$plusButtonRef.deref(),
|
|
782
785
|
items: this.state.dropdownItems,
|
|
783
786
|
onRef: this.handleDropDownButtonRef,
|
|
784
787
|
onPlusButtonRef: this.handlePlusButtonRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Editor: Lego",
|
|
12
12
|
"singleton": true,
|
|
13
|
-
"runReact18":
|
|
13
|
+
"runReact18": true
|
|
14
14
|
},
|
|
15
15
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
16
16
|
"main": "dist/cjs/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/button": "^20.
|
|
35
|
-
"@atlaskit/editor-common": "^94.
|
|
34
|
+
"@atlaskit/button": "^20.3.0",
|
|
35
|
+
"@atlaskit/editor-common": "^94.3.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-block-type": "^3.16.0",
|
|
38
38
|
"@atlaskit/editor-plugin-code-block": "^3.5.0",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
61
61
|
"@atlaskit/emoji": "^67.8.0",
|
|
62
62
|
"@atlaskit/heading": "2.4.6",
|
|
63
|
-
"@atlaskit/icon": "^22.
|
|
63
|
+
"@atlaskit/icon": "^22.24.0",
|
|
64
64
|
"@atlaskit/icon-lab": "^1.0.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
66
66
|
"@atlaskit/primitives": "^12.2.0",
|
|
67
67
|
"@atlaskit/theme": "^14.0.0",
|
|
68
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
68
|
+
"@atlaskit/tmp-editor-statsig": "^2.9.0",
|
|
69
69
|
"@atlaskit/tokens": "^2.0.0",
|
|
70
70
|
"@atlaskit/tooltip": "18.8.5",
|
|
71
71
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"@atlaskit/ssr": "*",
|
|
86
86
|
"@atlaskit/visual-regression": "*",
|
|
87
87
|
"@testing-library/react": "^12.1.5",
|
|
88
|
-
"react-dom": "^16.8.0",
|
|
89
88
|
"typescript": "~5.4.2"
|
|
90
89
|
},
|
|
91
90
|
"techstack": {
|