@atlaskit/editor-plugin-insert-block 2.1.1 → 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,15 @@
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
+
3
13
  ## 2.1.1
4
14
 
5
15
  ### Patch 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)({
@@ -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({
@@ -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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.1.1",
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",
@@ -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",