@atlaskit/editor-plugin-insert-block 2.1.0 → 2.1.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,24 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#144556](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144556)
8
+ [`69f78b13edfbe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/69f78b13edfbe) -
9
+ Don't wrap outer click listeners for insert menu when insert-menu-in-right-rail experiment is
10
+ rendered to fix focus issues with confluence legacy macros
11
+ - Updated dependencies
12
+
13
+ ## 2.1.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#143799](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/143799)
18
+ [`28c4ecb75a634`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/28c4ecb75a634) -
19
+ removed editorActions from onClick in Props, updated toolbar reference to it
20
+ - Updated dependencies
21
+
3
22
  ## 2.1.0
4
23
 
5
24
  ### Minor Changes
@@ -118,6 +118,34 @@ var InsertMenu = function InsertMenu(_ref) {
118
118
  return result;
119
119
  }, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.actions, quickInsertDropdownItems, isFullPageAppearance]);
120
120
  var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 || (_pluginInjectionApi$q8 = _pluginInjectionApi$q8.sharedState.currentState()) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.emptyStateHandler;
121
+
122
+ /**
123
+ * For insert menu in right rail experiment
124
+ * - Clean up ticket ED-24801
125
+ *
126
+ * The insert menu is not rendered in a popup so need to avoid wrapping it in outer click
127
+ * listeners because it will cause the editor to focus certain extensions (e.g. Jira legacy)
128
+ */
129
+
130
+ if (isFullPageAppearance && (0, _experiments.editorExperiment)('insert-menu-in-right-rail', true)) {
131
+ return (
132
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
133
+ (0, _react2.jsx)("div", {
134
+ css: insertMenuWrapper(itemCount, isFullPageAppearance)
135
+ }, (0, _react2.jsx)(FlexWrapper, null, (0, _react2.jsx)(_elementBrowser.ElementBrowser, {
136
+ mode: "inline",
137
+ getItems: getItems,
138
+ emptyStateHandler: emptyStateHandler,
139
+ onInsertItem: onInsertItem,
140
+ showSearch: true,
141
+ showCategories: false
142
+ // On page resize we want the InlineElementBrowser to show updated tools/overflow items
143
+ ,
144
+ key: quickInsertDropdownItems.length,
145
+ viewMoreItem: viewMoreItem
146
+ })))
147
+ );
148
+ }
121
149
  return (
122
150
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
123
151
  (0, _react2.jsx)("div", {
@@ -47,12 +47,12 @@ var buttonStyles = (0, _primitives.xcss)({
47
47
  });
48
48
  var disabledStyles = (0, _primitives.xcss)({
49
49
  color: 'color.text.disabled',
50
- backgroundColor: 'color.background.neutral',
50
+ backgroundColor: 'color.background.neutral.subtle',
51
51
  ':hover': {
52
- backgroundColor: 'color.background.neutral'
52
+ backgroundColor: 'color.background.neutral.subtle'
53
53
  },
54
54
  ':active': {
55
- backgroundColor: 'color.background.neutral'
55
+ backgroundColor: 'color.background.neutral.subtle'
56
56
  }
57
57
  });
58
58
  var activeStyles = (0, _primitives.xcss)({
@@ -437,7 +437,6 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
437
437
  inputMethod = _ref5.inputMethod;
438
438
  var _this$props10 = _this.props,
439
439
  editorView = _this$props10.editorView,
440
- editorActions = _this$props10.editorActions,
441
440
  handleImageUpload = _this$props10.handleImageUpload,
442
441
  expandEnabled = _this$props10.expandEnabled;
443
442
 
@@ -509,8 +508,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
509
508
 
510
509
  // eslint-disable-next-line no-fallthrough
511
510
  default:
512
- if (item && item.onClick && editorActions) {
513
- item.onClick(editorActions);
511
+ if (item && item.onClick) {
512
+ item.onClick();
514
513
  break;
515
514
  }
516
515
  }
@@ -101,6 +101,34 @@ const InsertMenu = ({
101
101
  return result;
102
102
  }, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.actions, quickInsertDropdownItems, isFullPageAppearance]);
103
103
  const emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : (_pluginInjectionApi$q9 = _pluginInjectionApi$q8.sharedState.currentState()) === null || _pluginInjectionApi$q9 === void 0 ? void 0 : _pluginInjectionApi$q9.emptyStateHandler;
104
+
105
+ /**
106
+ * For insert menu in right rail experiment
107
+ * - Clean up ticket ED-24801
108
+ *
109
+ * The insert menu is not rendered in a popup so need to avoid wrapping it in outer click
110
+ * listeners because it will cause the editor to focus certain extensions (e.g. Jira legacy)
111
+ */
112
+
113
+ if (isFullPageAppearance && editorExperiment('insert-menu-in-right-rail', true)) {
114
+ return (
115
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
116
+ jsx("div", {
117
+ css: insertMenuWrapper(itemCount, isFullPageAppearance)
118
+ }, jsx(FlexWrapper, null, jsx(ElementBrowser, {
119
+ mode: "inline",
120
+ getItems: getItems,
121
+ emptyStateHandler: emptyStateHandler,
122
+ onInsertItem: onInsertItem,
123
+ showSearch: true,
124
+ showCategories: false
125
+ // On page resize we want the InlineElementBrowser to show updated tools/overflow items
126
+ ,
127
+ key: quickInsertDropdownItems.length,
128
+ viewMoreItem: viewMoreItem
129
+ })))
130
+ );
131
+ }
104
132
  return (
105
133
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
106
134
  jsx("div", {
@@ -40,12 +40,12 @@ const buttonStyles = xcss({
40
40
  });
41
41
  const disabledStyles = xcss({
42
42
  color: 'color.text.disabled',
43
- backgroundColor: 'color.background.neutral',
43
+ backgroundColor: 'color.background.neutral.subtle',
44
44
  ':hover': {
45
- backgroundColor: 'color.background.neutral'
45
+ backgroundColor: 'color.background.neutral.subtle'
46
46
  },
47
47
  ':active': {
48
- backgroundColor: 'color.background.neutral'
48
+ backgroundColor: 'color.background.neutral.subtle'
49
49
  }
50
50
  });
51
51
  const activeStyles = xcss({
@@ -463,7 +463,6 @@ export class ToolbarInsertBlock extends React.PureComponent {
463
463
  }) => {
464
464
  const {
465
465
  editorView,
466
- editorActions,
467
466
  handleImageUpload,
468
467
  expandEnabled
469
468
  } = this.props;
@@ -538,8 +537,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
538
537
 
539
538
  // eslint-disable-next-line no-fallthrough
540
539
  default:
541
- if (item && item.onClick && editorActions) {
542
- item.onClick(editorActions);
540
+ if (item && item.onClick) {
541
+ item.onClick();
543
542
  break;
544
543
  }
545
544
  }
@@ -113,6 +113,34 @@ var InsertMenu = function InsertMenu(_ref) {
113
113
  return result;
114
114
  }, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.actions, quickInsertDropdownItems, isFullPageAppearance]);
115
115
  var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 || (_pluginInjectionApi$q8 = _pluginInjectionApi$q8.sharedState.currentState()) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.emptyStateHandler;
116
+
117
+ /**
118
+ * For insert menu in right rail experiment
119
+ * - Clean up ticket ED-24801
120
+ *
121
+ * The insert menu is not rendered in a popup so need to avoid wrapping it in outer click
122
+ * listeners because it will cause the editor to focus certain extensions (e.g. Jira legacy)
123
+ */
124
+
125
+ if (isFullPageAppearance && editorExperiment('insert-menu-in-right-rail', true)) {
126
+ return (
127
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
128
+ jsx("div", {
129
+ css: insertMenuWrapper(itemCount, isFullPageAppearance)
130
+ }, jsx(FlexWrapper, null, jsx(ElementBrowser, {
131
+ mode: "inline",
132
+ getItems: getItems,
133
+ emptyStateHandler: emptyStateHandler,
134
+ onInsertItem: onInsertItem,
135
+ showSearch: true,
136
+ showCategories: false
137
+ // On page resize we want the InlineElementBrowser to show updated tools/overflow items
138
+ ,
139
+ key: quickInsertDropdownItems.length,
140
+ viewMoreItem: viewMoreItem
141
+ })))
142
+ );
143
+ }
116
144
  return (
117
145
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
118
146
  jsx("div", {
@@ -40,12 +40,12 @@ var buttonStyles = xcss({
40
40
  });
41
41
  var disabledStyles = xcss({
42
42
  color: 'color.text.disabled',
43
- backgroundColor: 'color.background.neutral',
43
+ backgroundColor: 'color.background.neutral.subtle',
44
44
  ':hover': {
45
- backgroundColor: 'color.background.neutral'
45
+ backgroundColor: 'color.background.neutral.subtle'
46
46
  },
47
47
  ':active': {
48
- backgroundColor: 'color.background.neutral'
48
+ backgroundColor: 'color.background.neutral.subtle'
49
49
  }
50
50
  });
51
51
  var activeStyles = xcss({
@@ -428,7 +428,6 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
428
428
  inputMethod = _ref5.inputMethod;
429
429
  var _this$props10 = _this.props,
430
430
  editorView = _this$props10.editorView,
431
- editorActions = _this$props10.editorActions,
432
431
  handleImageUpload = _this$props10.handleImageUpload,
433
432
  expandEnabled = _this$props10.expandEnabled;
434
433
 
@@ -500,8 +499,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
500
499
 
501
500
  // eslint-disable-next-line no-fallthrough
502
501
  default:
503
- if (item && item.onClick && editorActions) {
504
- item.onClick(editorActions);
502
+ if (item && item.onClick) {
503
+ item.onClick();
505
504
  break;
506
505
  }
507
506
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.1.0",
35
- "@atlaskit/editor-common": "^90.2.0",
35
+ "@atlaskit/editor-common": "^91.0.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
37
37
  "@atlaskit/editor-plugin-block-type": "^3.15.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.3.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/editor-plugin-type-ahead": "^1.8.0",
59
59
  "@atlaskit/editor-prosemirror": "6.0.0",
60
60
  "@atlaskit/editor-shared-styles": "^2.13.0",
61
- "@atlaskit/emoji": "^67.7.0",
61
+ "@atlaskit/emoji": "^67.8.0",
62
62
  "@atlaskit/heading": "2.4.5",
63
63
  "@atlaskit/icon": "^22.18.0",
64
64
  "@atlaskit/icon-lab": "^0.2.0",