@atlaskit/editor-plugin-quick-insert 6.0.11 → 6.0.13

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,22 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 6.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
8
+ ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
9
+ project refs are setup
10
+ - Updated dependencies
11
+
12
+ ## 6.0.12
13
+
14
+ ### Patch Changes
15
+
16
+ - [`24092f8832d34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24092f8832d34) -
17
+ [EDITOR-3321] Clean up platform_editor_update_modal_close_button
18
+ - Updated dependencies
19
+
3
20
  ## 6.0.11
4
21
 
5
22
  ### Patch Changes
@@ -44,6 +44,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
44
44
  }), new _experiences.ExperienceCheckDomMutation({
45
45
  onDomMutation: function onDomMutation(_ref2) {
46
46
  var mutations = _ref2.mutations;
47
+ // @ts-ignore - Workaround for help-center local consumption
48
+
47
49
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
48
50
  return {
49
51
  status: 'success'
@@ -63,7 +65,11 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
63
65
  return new _safePlugin.SafePlugin({
64
66
  key: pluginKey,
65
67
  props: {
68
+ // @ts-ignore - Workaround for help-center local consumption
69
+
66
70
  handleDOMEvents: {
71
+ // @ts-ignore - Workaround for help-center local consumption
72
+
67
73
  click: function click(_view, event) {
68
74
  if (isTargetQuickInsertButton(event.target)) {
69
75
  experience.start({
@@ -71,6 +77,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
71
77
  });
72
78
  }
73
79
  },
80
+ // @ts-ignore - Workaround for help-center local consumption
81
+
74
82
  beforeinput: function beforeinput(view, event) {
75
83
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
76
84
  experience.start({
@@ -78,6 +86,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
78
86
  });
79
87
  }
80
88
  },
89
+ // @ts-ignore - Workaround for help-center local consumption
90
+
81
91
  keydown: function keydown(_view, event) {
82
92
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
83
93
  experience.abort({
@@ -113,6 +123,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
113
123
  if ($from.parent.type.name === 'codeBlock') {
114
124
  return false;
115
125
  }
126
+
127
+ // @ts-ignore - Workaround for help-center local consumption
128
+
116
129
  if ($from.marks().some(function (mark) {
117
130
  return mark.type.name === 'code';
118
131
  })) {
@@ -137,6 +150,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
137
150
  var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
138
151
  var type = _ref5.type,
139
152
  addedNodes = _ref5.addedNodes;
153
+ // @ts-ignore - Workaround for help-center local consumption
154
+
140
155
  return type === 'childList' && (0, _toConsumableArray2.default)(addedNodes).some(isQuickInsertMenuWithinNode);
141
156
  };
142
157
  var isQuickInsertMenuWithinNode = function isQuickInsertMenuWithinNode(node) {
@@ -203,6 +203,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
203
203
  return new _safePlugin.SafePlugin({
204
204
  key: _pluginKey.pluginKey,
205
205
  state: {
206
+ // @ts-ignore - Workaround for help-center local consumption
206
207
  init: function init() {
207
208
  return {
208
209
  isElementBrowserModalOpen: false,
@@ -215,10 +216,13 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
215
216
  }
216
217
  };
217
218
  },
219
+ // @ts-ignore - Workaround for help-center local consumption
218
220
  apply: function apply(tr, pluginState) {
219
221
  var meta = tr.getMeta(_pluginKey.pluginKey);
220
222
  if (meta) {
221
223
  var keys = Object.keys(meta);
224
+ // @ts-ignore - Workaround for help-center local consumption
225
+
222
226
  var changed = keys.some(function (key) {
223
227
  return pluginState[key] !== meta[key];
224
228
  });
@@ -231,6 +235,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
231
235
  return pluginState;
232
236
  }
233
237
  },
238
+ // @ts-ignore - Workaround for help-center local consumption
234
239
  view: function view(editorView) {
235
240
  var providerHandler = /*#__PURE__*/function () {
236
241
  var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
@@ -274,6 +279,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
274
279
  }();
275
280
  providerFactory.subscribe('quickInsertProvider', providerHandler);
276
281
  return {
282
+ // @ts-ignore - Workaround for help-center local consumption
277
283
  destroy: function destroy() {
278
284
  providerFactory.unsubscribe('quickInsertProvider', providerHandler);
279
285
  }
@@ -65,7 +65,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
65
65
  var helpUrl = props.helpUrl,
66
66
  intl = props.intl,
67
67
  onInsertItemFn = props.onInsertItem;
68
- var isUpdateModalCloseButtonEnabled = (0, _platformFeatureFlags.fg)('platform_editor_update_modal_close_button');
69
68
  var onSelectItem = (0, _react.useCallback)(function (item) {
70
69
  setSelectedItem(item);
71
70
  }, [setSelectedItem]);
@@ -95,9 +94,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
95
94
  onSelectItem: onSelectItem,
96
95
  onInsertItem: onInsertItem,
97
96
  emptyStateHandler: props.emptyStateHandler,
98
- autoFocusSearch: !isUpdateModalCloseButtonEnabled
97
+ autoFocusSearch: false
99
98
  }));
100
- }, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler, isUpdateModalCloseButtonEnabled]);
99
+ }, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
101
100
  var label = (0, _platformFeatureFlags.fg)('platform_editor_fix_browse_modal_header') ? intl.formatMessage(_quickInsert.messages.browse) : undefined;
102
101
  return (0, _react2.jsx)("div", {
103
102
  "data-editor-popup": true
@@ -111,7 +110,7 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
111
110
  height: "664px",
112
111
  width: "x-large",
113
112
  shouldReturnFocus: props.shouldReturnFocus
114
- }, isUpdateModalCloseButtonEnabled && (0, _react2.jsx)("div", {
113
+ }, (0, _react2.jsx)("div", {
115
114
  css: modalCloseButtonStyles
116
115
  }, (0, _react2.jsx)(_modalDialog.CloseButton, {
117
116
  onClick: props.onClose
@@ -38,6 +38,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
38
38
  onDomMutation: ({
39
39
  mutations
40
40
  }) => {
41
+ // @ts-ignore - Workaround for help-center local consumption
42
+
41
43
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
42
44
  return {
43
45
  status: 'success'
@@ -55,7 +57,11 @@ export const getQuickInsertOpenExperiencePlugin = ({
55
57
  return new SafePlugin({
56
58
  key: pluginKey,
57
59
  props: {
60
+ // @ts-ignore - Workaround for help-center local consumption
61
+
58
62
  handleDOMEvents: {
63
+ // @ts-ignore - Workaround for help-center local consumption
64
+
59
65
  click: (_view, event) => {
60
66
  if (isTargetQuickInsertButton(event.target)) {
61
67
  experience.start({
@@ -63,6 +69,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
63
69
  });
64
70
  }
65
71
  },
72
+ // @ts-ignore - Workaround for help-center local consumption
73
+
66
74
  beforeinput: (view, event) => {
67
75
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
68
76
  experience.start({
@@ -70,6 +78,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
70
78
  });
71
79
  }
72
80
  },
81
+ // @ts-ignore - Workaround for help-center local consumption
82
+
73
83
  keydown: (_view, event) => {
74
84
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
75
85
  experience.abort({
@@ -108,6 +118,9 @@ const isSelectionWhichSupportsTypeahead = ({
108
118
  if ($from.parent.type.name === 'codeBlock') {
109
119
  return false;
110
120
  }
121
+
122
+ // @ts-ignore - Workaround for help-center local consumption
123
+
111
124
  if ($from.marks().some(mark => mark.type.name === 'code')) {
112
125
  return false;
113
126
  }
@@ -131,6 +144,8 @@ const isQuickInsertMenuAddedInMutation = ({
131
144
  type,
132
145
  addedNodes
133
146
  }) => {
147
+ // @ts-ignore - Workaround for help-center local consumption
148
+
134
149
  return type === 'childList' && [...addedNodes].some(isQuickInsertMenuWithinNode);
135
150
  };
136
151
  const isQuickInsertMenuWithinNode = node => {
@@ -190,6 +190,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
190
190
  return new SafePlugin({
191
191
  key: pluginKey,
192
192
  state: {
193
+ // @ts-ignore - Workaround for help-center local consumption
194
+
193
195
  init() {
194
196
  return {
195
197
  isElementBrowserModalOpen: false,
@@ -200,10 +202,14 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
200
202
  lazyDefaultItems: () => memoProcessQuickInsertItems(defaultItems || [], getIntl())
201
203
  };
202
204
  },
205
+ // @ts-ignore - Workaround for help-center local consumption
206
+
203
207
  apply(tr, pluginState) {
204
208
  const meta = tr.getMeta(pluginKey);
205
209
  if (meta) {
206
210
  const keys = Object.keys(meta);
211
+ // @ts-ignore - Workaround for help-center local consumption
212
+
207
213
  const changed = keys.some(key => {
208
214
  return pluginState[key] !== meta[key];
209
215
  });
@@ -219,6 +225,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
219
225
  return pluginState;
220
226
  }
221
227
  },
228
+ // @ts-ignore - Workaround for help-center local consumption
229
+
222
230
  view(editorView) {
223
231
  const providerHandler = async (_name, providerPromise) => {
224
232
  if (providerPromise) {
@@ -237,6 +245,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
237
245
  };
238
246
  providerFactory.subscribe('quickInsertProvider', providerHandler);
239
247
  return {
248
+ // @ts-ignore - Workaround for help-center local consumption
249
+
240
250
  destroy() {
241
251
  providerFactory.unsubscribe('quickInsertProvider', providerHandler);
242
252
  }
@@ -53,7 +53,6 @@ const ModalElementBrowser = props => {
53
53
  intl,
54
54
  onInsertItem: onInsertItemFn
55
55
  } = props;
56
- const isUpdateModalCloseButtonEnabled = fg('platform_editor_update_modal_close_button');
57
56
  const onSelectItem = useCallback(item => {
58
57
  setSelectedItem(item);
59
58
  }, [setSelectedItem]);
@@ -78,8 +77,8 @@ const ModalElementBrowser = props => {
78
77
  onSelectItem: onSelectItem,
79
78
  onInsertItem: onInsertItem,
80
79
  emptyStateHandler: props.emptyStateHandler,
81
- autoFocusSearch: !isUpdateModalCloseButtonEnabled
82
- })), [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler, isUpdateModalCloseButtonEnabled]);
80
+ autoFocusSearch: false
81
+ })), [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
83
82
  const label = fg('platform_editor_fix_browse_modal_header') ? intl.formatMessage(messages.browse) : undefined;
84
83
  return jsx("div", {
85
84
  "data-editor-popup": true
@@ -93,7 +92,7 @@ const ModalElementBrowser = props => {
93
92
  height: "664px",
94
93
  width: "x-large",
95
94
  shouldReturnFocus: props.shouldReturnFocus
96
- }, isUpdateModalCloseButtonEnabled && jsx("div", {
95
+ }, jsx("div", {
97
96
  css: modalCloseButtonStyles
98
97
  }, jsx(CloseButton, {
99
98
  onClick: props.onClose
@@ -37,6 +37,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
37
37
  }), new ExperienceCheckDomMutation({
38
38
  onDomMutation: function onDomMutation(_ref2) {
39
39
  var mutations = _ref2.mutations;
40
+ // @ts-ignore - Workaround for help-center local consumption
41
+
40
42
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
41
43
  return {
42
44
  status: 'success'
@@ -56,7 +58,11 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
56
58
  return new SafePlugin({
57
59
  key: pluginKey,
58
60
  props: {
61
+ // @ts-ignore - Workaround for help-center local consumption
62
+
59
63
  handleDOMEvents: {
64
+ // @ts-ignore - Workaround for help-center local consumption
65
+
60
66
  click: function click(_view, event) {
61
67
  if (isTargetQuickInsertButton(event.target)) {
62
68
  experience.start({
@@ -64,6 +70,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
64
70
  });
65
71
  }
66
72
  },
73
+ // @ts-ignore - Workaround for help-center local consumption
74
+
67
75
  beforeinput: function beforeinput(view, event) {
68
76
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
69
77
  experience.start({
@@ -71,6 +79,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
71
79
  });
72
80
  }
73
81
  },
82
+ // @ts-ignore - Workaround for help-center local consumption
83
+
74
84
  keydown: function keydown(_view, event) {
75
85
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
76
86
  experience.abort({
@@ -106,6 +116,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
106
116
  if ($from.parent.type.name === 'codeBlock') {
107
117
  return false;
108
118
  }
119
+
120
+ // @ts-ignore - Workaround for help-center local consumption
121
+
109
122
  if ($from.marks().some(function (mark) {
110
123
  return mark.type.name === 'code';
111
124
  })) {
@@ -130,6 +143,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
130
143
  var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
131
144
  var type = _ref5.type,
132
145
  addedNodes = _ref5.addedNodes;
146
+ // @ts-ignore - Workaround for help-center local consumption
147
+
133
148
  return type === 'childList' && _toConsumableArray(addedNodes).some(isQuickInsertMenuWithinNode);
134
149
  };
135
150
  var isQuickInsertMenuWithinNode = function isQuickInsertMenuWithinNode(node) {
@@ -196,6 +196,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
196
196
  return new SafePlugin({
197
197
  key: pluginKey,
198
198
  state: {
199
+ // @ts-ignore - Workaround for help-center local consumption
199
200
  init: function init() {
200
201
  return {
201
202
  isElementBrowserModalOpen: false,
@@ -208,10 +209,13 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
208
209
  }
209
210
  };
210
211
  },
212
+ // @ts-ignore - Workaround for help-center local consumption
211
213
  apply: function apply(tr, pluginState) {
212
214
  var meta = tr.getMeta(pluginKey);
213
215
  if (meta) {
214
216
  var keys = Object.keys(meta);
217
+ // @ts-ignore - Workaround for help-center local consumption
218
+
215
219
  var changed = keys.some(function (key) {
216
220
  return pluginState[key] !== meta[key];
217
221
  });
@@ -224,6 +228,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
224
228
  return pluginState;
225
229
  }
226
230
  },
231
+ // @ts-ignore - Workaround for help-center local consumption
227
232
  view: function view(editorView) {
228
233
  var providerHandler = /*#__PURE__*/function () {
229
234
  var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
@@ -267,6 +272,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
267
272
  }();
268
273
  providerFactory.subscribe('quickInsertProvider', providerHandler);
269
274
  return {
275
+ // @ts-ignore - Workaround for help-center local consumption
270
276
  destroy: function destroy() {
271
277
  providerFactory.unsubscribe('quickInsertProvider', providerHandler);
272
278
  }
@@ -55,7 +55,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
55
55
  var helpUrl = props.helpUrl,
56
56
  intl = props.intl,
57
57
  onInsertItemFn = props.onInsertItem;
58
- var isUpdateModalCloseButtonEnabled = fg('platform_editor_update_modal_close_button');
59
58
  var onSelectItem = useCallback(function (item) {
60
59
  setSelectedItem(item);
61
60
  }, [setSelectedItem]);
@@ -85,9 +84,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
85
84
  onSelectItem: onSelectItem,
86
85
  onInsertItem: onInsertItem,
87
86
  emptyStateHandler: props.emptyStateHandler,
88
- autoFocusSearch: !isUpdateModalCloseButtonEnabled
87
+ autoFocusSearch: false
89
88
  }));
90
- }, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler, isUpdateModalCloseButtonEnabled]);
89
+ }, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
91
90
  var label = fg('platform_editor_fix_browse_modal_header') ? intl.formatMessage(messages.browse) : undefined;
92
91
  return jsx("div", {
93
92
  "data-editor-popup": true
@@ -101,7 +100,7 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
101
100
  height: "664px",
102
101
  width: "x-large",
103
102
  shouldReturnFocus: props.shouldReturnFocus
104
- }, isUpdateModalCloseButtonEnabled && jsx("div", {
103
+ }, jsx("div", {
105
104
  css: modalCloseButtonStyles
106
105
  }, jsx(CloseButton, {
107
106
  onClick: props.onClose
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "6.0.11",
3
+ "version": "6.0.13",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,13 +39,13 @@
39
39
  "@atlaskit/modal-dialog": "^14.7.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
41
  "@atlaskit/theme": "^21.0.0",
42
- "@atlaskit/tmp-editor-statsig": "^13.41.0",
43
- "@atlaskit/tokens": "^8.2.0",
42
+ "@atlaskit/tmp-editor-statsig": "^13.42.0",
43
+ "@atlaskit/tokens": "^8.3.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },
47
47
  "peerDependencies": {
48
- "@atlaskit/editor-common": "^110.33.0",
48
+ "@atlaskit/editor-common": "^110.34.0",
49
49
  "react": "^18.2.0",
50
50
  "react-dom": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -105,9 +105,6 @@
105
105
  "platform_editor_controls_fix_view_more_in_comment": {
106
106
  "type": "boolean"
107
107
  },
108
- "platform_editor_update_modal_close_button": {
109
- "type": "boolean"
110
- },
111
108
  "platform_editor_fix_browse_modal_header": {
112
109
  "type": "boolean"
113
110
  }