@atlaskit/editor-plugin-insert-block 2.4.25 → 2.4.27

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/insertBlockPlugin.js +7 -1
  3. package/dist/cjs/types/index.js +5 -0
  4. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +8 -4
  5. package/dist/cjs/ui/ToolbarInsertBlock/index.js +13 -0
  6. package/dist/cjs/ui/ToolbarInsertBlock/table-selector-popup.js +4 -1
  7. package/dist/cjs/ui/templateOptions.js +5 -5
  8. package/dist/cjs/ui/transformOptions.js +1 -1
  9. package/dist/es2019/insertBlockPlugin.js +6 -1
  10. package/dist/es2019/types/index.js +1 -0
  11. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +8 -4
  12. package/dist/es2019/ui/ElementRail/index.js +1 -1
  13. package/dist/es2019/ui/ToolbarInsertBlock/index.js +15 -2
  14. package/dist/es2019/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +1 -1
  15. package/dist/es2019/ui/ToolbarInsertBlock/table-selector-popup.js +4 -1
  16. package/dist/es2019/ui/templateOptions.js +5 -5
  17. package/dist/es2019/ui/transformOptions.js +1 -1
  18. package/dist/esm/insertBlockPlugin.js +6 -1
  19. package/dist/esm/types/index.js +1 -0
  20. package/dist/esm/ui/ElementBrowser/InsertMenu.js +8 -4
  21. package/dist/esm/ui/ToolbarInsertBlock/index.js +13 -0
  22. package/dist/esm/ui/ToolbarInsertBlock/table-selector-popup.js +4 -1
  23. package/dist/esm/ui/templateOptions.js +5 -5
  24. package/dist/esm/ui/transformOptions.js +1 -1
  25. package/dist/types/index.d.ts +2 -2
  26. package/dist/types/insertBlockPlugin.d.ts +2 -24
  27. package/dist/types/insertBlockPluginType.d.ts +10 -53
  28. package/dist/types/types/index.d.ts +67 -0
  29. package/dist/types/ui/ElementRail/index.d.ts +4 -3
  30. package/dist/types/ui/ElementRail/useInsertMenuRailItems.d.ts +2 -1
  31. package/dist/types/ui/ToolbarInsertBlock/shallow-equals.d.ts +1 -1
  32. package/dist/types/ui/templateOptions.d.ts +1 -1
  33. package/dist/types/ui/transformOptions.d.ts +2 -2
  34. package/dist/types-ts4.5/index.d.ts +2 -2
  35. package/dist/types-ts4.5/insertBlockPlugin.d.ts +2 -24
  36. package/dist/types-ts4.5/insertBlockPluginType.d.ts +10 -53
  37. package/dist/types-ts4.5/types/index.d.ts +67 -0
  38. package/dist/types-ts4.5/ui/ElementRail/index.d.ts +4 -3
  39. package/dist/types-ts4.5/ui/ElementRail/useInsertMenuRailItems.d.ts +2 -1
  40. package/dist/types-ts4.5/ui/ToolbarInsertBlock/shallow-equals.d.ts +1 -1
  41. package/dist/types-ts4.5/ui/templateOptions.d.ts +1 -1
  42. package/dist/types-ts4.5/ui/transformOptions.d.ts +2 -2
  43. package/package.json +8 -5
  44. /package/dist/cjs/{assets → ui/assets}/action-list.js +0 -0
  45. /package/dist/cjs/{assets → ui/assets}/approvals-tracker.js +0 -0
  46. /package/dist/cjs/{assets → ui/assets}/decision-matrix.js +0 -0
  47. /package/dist/cjs/{assets → ui/assets}/discussion-notes.js +0 -0
  48. /package/dist/cjs/{assets → ui/assets}/expand.js +0 -0
  49. /package/dist/cjs/{assets → ui/assets}/instructions-outline.js +0 -0
  50. /package/dist/cjs/{assets → ui/assets}/switch.js +0 -0
  51. /package/dist/cjs/{assets → ui/assets}/use-icon-themed.js +0 -0
  52. /package/dist/es2019/{assets → ui/assets}/action-list.js +0 -0
  53. /package/dist/es2019/{assets → ui/assets}/approvals-tracker.js +0 -0
  54. /package/dist/es2019/{assets → ui/assets}/decision-matrix.js +0 -0
  55. /package/dist/es2019/{assets → ui/assets}/discussion-notes.js +0 -0
  56. /package/dist/es2019/{assets → ui/assets}/expand.js +0 -0
  57. /package/dist/es2019/{assets → ui/assets}/instructions-outline.js +0 -0
  58. /package/dist/es2019/{assets → ui/assets}/switch.js +0 -0
  59. /package/dist/es2019/{assets → ui/assets}/use-icon-themed.js +0 -0
  60. /package/dist/esm/{assets → ui/assets}/action-list.js +0 -0
  61. /package/dist/esm/{assets → ui/assets}/approvals-tracker.js +0 -0
  62. /package/dist/esm/{assets → ui/assets}/decision-matrix.js +0 -0
  63. /package/dist/esm/{assets → ui/assets}/discussion-notes.js +0 -0
  64. /package/dist/esm/{assets → ui/assets}/expand.js +0 -0
  65. /package/dist/esm/{assets → ui/assets}/instructions-outline.js +0 -0
  66. /package/dist/esm/{assets → ui/assets}/switch.js +0 -0
  67. /package/dist/esm/{assets → ui/assets}/use-icon-themed.js +0 -0
  68. /package/dist/types/{assets → ui/assets}/action-list.d.ts +0 -0
  69. /package/dist/types/{assets → ui/assets}/approvals-tracker.d.ts +0 -0
  70. /package/dist/types/{assets → ui/assets}/decision-matrix.d.ts +0 -0
  71. /package/dist/types/{assets → ui/assets}/discussion-notes.d.ts +0 -0
  72. /package/dist/types/{assets → ui/assets}/expand.d.ts +0 -0
  73. /package/dist/types/{assets → ui/assets}/instructions-outline.d.ts +0 -0
  74. /package/dist/types/{assets → ui/assets}/switch.d.ts +0 -0
  75. /package/dist/types/{assets → ui/assets}/use-icon-themed.d.ts +0 -0
  76. /package/dist/types-ts4.5/{assets → ui/assets}/action-list.d.ts +0 -0
  77. /package/dist/types-ts4.5/{assets → ui/assets}/approvals-tracker.d.ts +0 -0
  78. /package/dist/types-ts4.5/{assets → ui/assets}/decision-matrix.d.ts +0 -0
  79. /package/dist/types-ts4.5/{assets → ui/assets}/discussion-notes.d.ts +0 -0
  80. /package/dist/types-ts4.5/{assets → ui/assets}/expand.d.ts +0 -0
  81. /package/dist/types-ts4.5/{assets → ui/assets}/instructions-outline.d.ts +0 -0
  82. /package/dist/types-ts4.5/{assets → ui/assets}/switch.d.ts +0 -0
  83. /package/dist/types-ts4.5/{assets → ui/assets}/use-icon-themed.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.4.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 2.4.26
10
+
11
+ ### Patch Changes
12
+
13
+ - [#181001](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181001)
14
+ [`fc8a0ad4362f4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fc8a0ad4362f4) -
15
+ NO-ISSUE: refactor insert block plugin to meet folder standards
16
+
3
17
  ## 2.4.25
4
18
 
5
19
  ### Patch Changes
@@ -19,15 +19,18 @@ var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _consts = require("@atlaskit/editor-plugin-block-type/consts");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
21
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
- var _switch = _interopRequireDefault(require("./assets/switch"));
23
22
  var _elementBrowser2 = require("./pm-plugins/elementBrowser");
24
23
  var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
24
+ var _switch = _interopRequireDefault(require("./ui/assets/switch"));
25
25
  var _ElementRail = require("./ui/ElementRail");
26
26
  var _templateOptions = require("./ui/templateOptions");
27
27
  var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
28
28
  var _transformOptions = require("./ui/transformOptions");
29
29
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
30
30
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line import/no-named-as-default
33
+
31
34
  var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
32
35
  // Different button numbers for full-page to better match full page toolbar breakpoints
33
36
  if (appearance === 'full-page' && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_responsive_fixes')) {
@@ -69,6 +72,7 @@ var toolbarSizeToButtons = exports.toolbarSizeToButtons = function toolbarSizeTo
69
72
  }
70
73
  }
71
74
  };
75
+
72
76
  /**
73
77
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
74
78
  * @param name Block name
@@ -309,6 +313,8 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
309
313
  if (
310
314
  // @ts-ignore
311
315
  ['full-page', 'full-width'].includes((_options$appearance4 = options.appearance) !== null && _options$appearance4 !== void 0 ? _options$appearance4 : '') && (0, _experiments.editorExperiment)('insert-menu-in-right-rail', true)) {
316
+ // Ignored via go/ees005
317
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
312
318
  plugin.pluginsOptions.contextPanel = function (state) {
313
319
  // api.getSharedState() will have an outdated reference to editorState on first mount of this component
314
320
  // so instead just rely on plugin key as we don't need to be reactive to changes here
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -273,10 +273,14 @@ var FlexWrapper = function FlexWrapper(props) {
273
273
  var setOutsideClickTargetRef = (0, _react.useContext)(_uiReact.OutsideClickTargetRefContext);
274
274
  var children = props.children,
275
275
  divProps = (0, _objectWithoutProperties2.default)(props, _excluded);
276
- return (0, _react2.jsx)("div", (0, _extends2.default)({
277
- ref: setOutsideClickTargetRef,
278
- css: flexWrapperStyles
279
- }, divProps), children);
276
+ return (
277
+ // Ignored via go/ees005
278
+ // eslint-disable-next-line react/jsx-props-no-spreading
279
+ (0, _react2.jsx)("div", (0, _extends2.default)({
280
+ ref: setOutsideClickTargetRef,
281
+ css: flexWrapperStyles
282
+ }, divProps), children)
283
+ );
280
284
  };
281
285
  var ElementBrowserWrapper = (0, _uiReact.withReactEditorViewOuterListeners)(FlexWrapper);
282
286
  var _default = exports.default = InsertMenu;
@@ -38,6 +38,10 @@ var _templateObject;
38
38
  * @jsx jsx
39
39
  */
40
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
41
+ // Ignored via go/ees005
42
+ // eslint-disable-next-line import/no-namespace
43
+ // Ignored via go/ees005
44
+ // eslint-disable-next-line import/no-named-as-default
41
45
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
42
46
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
43
47
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
@@ -61,6 +65,8 @@ var getHoverStyles = function getHoverStyles(selector) {
61
65
  };
62
66
  var EmojiPicker = function EmojiPicker(props) {
63
67
  var setOutsideClickTargetRef = _react.default.useContext(_uiReact.OutsideClickTargetRefContext);
68
+ // Ignored via go/ees005
69
+ // eslint-disable-next-line react/jsx-props-no-spreading
64
70
  return (0, _react2.jsx)(_picker.EmojiPicker, (0, _extends2.default)({
65
71
  onPickerRef: setOutsideClickTargetRef
66
72
  }, props));
@@ -165,6 +171,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
165
171
  // Workaround for FS-1322 - where two onClicks fire - one when the upload button is
166
172
  // still in the document, and one once it's detached. Does not always occur, and
167
173
  // may be a side effect of a react render optimisation
174
+ // Ignored via go/ees005
175
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
168
176
  if (e.target && !isDetachedElement(e.target)) {
169
177
  _this.toggleEmojiPicker(_analytics.INPUT_METHOD.TOOLBAR);
170
178
  }
@@ -213,6 +221,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
213
221
  });
214
222
  (0, _defineProperty2.default)(_this, "handleTableSelectorClickOutside", function (e) {
215
223
  // Ignore click events for detached elements.
224
+ // Ignored via go/ees005
225
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
216
226
  if (e.target && !isDetachedElement(e.target)) {
217
227
  _this.toggleTableSelector(_analytics.INPUT_METHOD.TOOLBAR);
218
228
  }
@@ -426,6 +436,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
426
436
  onInsertBlockType = _this$props9.onInsertBlockType;
427
437
  var state = editorView.state,
428
438
  dispatch = editorView.dispatch;
439
+
440
+ // Ignored via go/ees005
441
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
429
442
  onInsertBlockType(itemName)(state, dispatch);
430
443
  return true;
431
444
  };
@@ -132,7 +132,10 @@ var TableSelectorPopup = function TableSelectorPopup(_ref3) {
132
132
  row = _ref4.row;
133
133
  var isCurrentFocused = isFocused && selectedCol === col && selectedRow === row;
134
134
  var isActive = selectedCol >= col && selectedRow >= row ? true : false;
135
- return (0, _react2.jsx)(TableSelectorButton, {
135
+ return (0, _react2.jsx)(TableSelectorButton
136
+ // Ignored via go/ees005
137
+ // eslint-disable-next-line react/no-array-index-key
138
+ , {
136
139
  key: index,
137
140
  isActive: isActive,
138
141
  col: col,
@@ -8,11 +8,11 @@ exports.templateOptions = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
- var _actionList = _interopRequireDefault(require("../assets/action-list"));
12
- var _approvalsTracker = _interopRequireDefault(require("../assets/approvals-tracker"));
13
- var _decisionMatrix = _interopRequireDefault(require("../assets/decision-matrix"));
14
- var _discussionNotes = _interopRequireDefault(require("../assets/discussion-notes"));
15
- var _instructionsOutline = _interopRequireDefault(require("../assets/instructions-outline"));
11
+ var _actionList = _interopRequireDefault(require("./assets/action-list"));
12
+ var _approvalsTracker = _interopRequireDefault(require("./assets/approvals-tracker"));
13
+ var _decisionMatrix = _interopRequireDefault(require("./assets/decision-matrix"));
14
+ var _discussionNotes = _interopRequireDefault(require("./assets/discussion-notes"));
15
+ var _instructionsOutline = _interopRequireDefault(require("./assets/instructions-outline"));
16
16
  var _templates = require("./templates");
17
17
  var getTemplateInsertionPayload = function getTemplateInsertionPayload(templateType, source) {
18
18
  return {
@@ -9,7 +9,7 @@ var _messages = require("@atlaskit/editor-common/messages");
9
9
  var _code = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/code"));
10
10
  var _info = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/info"));
11
11
  var _quote = _interopRequireDefault(require("@atlaskit/icon/glyph/quote"));
12
- var _expand = _interopRequireDefault(require("../assets/expand"));
12
+ var _expand = _interopRequireDefault(require("./assets/expand"));
13
13
  var transformationOptions = exports.transformationOptions = function transformationOptions(api, schema) {
14
14
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
15
15
  return [{
@@ -11,11 +11,13 @@ import { getWrappingOptions } from '@atlaskit/editor-common/utils';
11
11
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
- import SwitchIcon from './assets/switch';
15
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
16
15
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
16
+ import SwitchIcon from './ui/assets/switch';
17
17
  import { InsertMenuRail } from './ui/ElementRail';
18
18
  import { templateOptions } from './ui/templateOptions';
19
+ // Ignored via go/ees005
20
+ // eslint-disable-next-line import/no-named-as-default
19
21
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
20
22
  import { transformationOptions } from './ui/transformOptions';
21
23
  export const toolbarSizeToButtons = (toolbarSize, appearance) => {
@@ -59,6 +61,7 @@ export const toolbarSizeToButtons = (toolbarSize, appearance) => {
59
61
  }
60
62
  }
61
63
  };
64
+
62
65
  /**
63
66
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
64
67
  * @param name Block name
@@ -297,6 +300,8 @@ export const insertBlockPlugin = ({
297
300
  if (
298
301
  // @ts-ignore
299
302
  ['full-page', 'full-width'].includes((_options$appearance4 = options.appearance) !== null && _options$appearance4 !== void 0 ? _options$appearance4 : '') && editorExperiment('insert-menu-in-right-rail', true)) {
303
+ // Ignored via go/ees005
304
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
300
305
  plugin.pluginsOptions.contextPanel = state => {
301
306
  // api.getSharedState() will have an outdated reference to editorState on first mount of this component
302
307
  // so instead just rely on plugin key as we don't need to be reactive to changes here
@@ -0,0 +1 @@
1
+ export {};
@@ -255,10 +255,14 @@ const FlexWrapper = props => {
255
255
  children,
256
256
  ...divProps
257
257
  } = props;
258
- return jsx("div", _extends({
259
- ref: setOutsideClickTargetRef,
260
- css: flexWrapperStyles
261
- }, divProps), children);
258
+ return (
259
+ // Ignored via go/ees005
260
+ // eslint-disable-next-line react/jsx-props-no-spreading
261
+ jsx("div", _extends({
262
+ ref: setOutsideClickTargetRef,
263
+ css: flexWrapperStyles
264
+ }, divProps), children)
265
+ );
262
266
  };
263
267
  const ElementBrowserWrapper = withOuterListeners(FlexWrapper);
264
268
  export default InsertMenu;
@@ -41,7 +41,7 @@ export const InsertMenuRail = ({
41
41
  state,
42
42
  dispatch
43
43
  } = editorView;
44
- let inputMethod = INPUT_METHOD.INSERT_MENU_RIGHT_RAIL;
44
+ const inputMethod = INPUT_METHOD.INSERT_MENU_RIGHT_RAIL;
45
45
  if (!api) {
46
46
  return;
47
47
  }
@@ -17,11 +17,15 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
17
17
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
18
18
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
19
19
  import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
20
+ // Ignored via go/ees005
21
+ // eslint-disable-next-line import/no-namespace
20
22
  import * as colors from '@atlaskit/theme/colors';
21
23
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
24
  import { toggleInsertMenuRightRail } from '../../pm-plugins/commands';
23
25
  import { BlockInsertMenu } from './block-insert-menu';
24
26
  import { createItems } from './create-items';
27
+ // Ignored via go/ees005
28
+ // eslint-disable-next-line import/no-named-as-default
25
29
  import TableSelectorPopup from './table-selector-popup-with-listeners';
26
30
  /**
27
31
  * Checks if an element is detached (i.e. not in the current document)
@@ -39,6 +43,8 @@ const getHoverStyles = selector => `&:hover ${selector} {
39
43
  }`;
40
44
  const EmojiPicker = props => {
41
45
  const setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
46
+ // Ignored via go/ees005
47
+ // eslint-disable-next-line react/jsx-props-no-spreading
42
48
  return jsx(AkEmojiPicker, _extends({
43
49
  onPickerRef: setOutsideClickTargetRef
44
50
  }, props));
@@ -169,6 +175,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
169
175
  // Workaround for FS-1322 - where two onClicks fire - one when the upload button is
170
176
  // still in the document, and one once it's detached. Does not always occur, and
171
177
  // may be a side effect of a react render optimisation
178
+ // Ignored via go/ees005
179
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
172
180
  if (e.target && !isDetachedElement(e.target)) {
173
181
  this.toggleEmojiPicker(INPUT_METHOD.TOOLBAR);
174
182
  }
@@ -212,6 +220,8 @@ export class ToolbarInsertBlock extends React.PureComponent {
212
220
  });
213
221
  _defineProperty(this, "handleTableSelectorClickOutside", e => {
214
222
  // Ignore click events for detached elements.
223
+ // Ignored via go/ees005
224
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
215
225
  if (e.target && !isDetachedElement(e.target)) {
216
226
  this.toggleTableSelector(INPUT_METHOD.TOOLBAR);
217
227
  }
@@ -449,6 +459,9 @@ export class ToolbarInsertBlock extends React.PureComponent {
449
459
  state,
450
460
  dispatch
451
461
  } = editorView;
462
+
463
+ // Ignored via go/ees005
464
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
452
465
  onInsertBlockType(itemName)(state, dispatch);
453
466
  return true;
454
467
  });
@@ -743,12 +756,12 @@ export class ToolbarInsertBlock extends React.PureComponent {
743
756
  if (buttons.length === 0 && dropdownItems.length === 0) {
744
757
  return null;
745
758
  }
746
- let toolbarButtons = [];
759
+ const toolbarButtons = [];
747
760
  let tableSelectorButton;
748
761
  let tableButton;
749
762
 
750
763
  // Seperate table buttons from toolbar buttons
751
- for (let btn of buttons) {
764
+ for (const btn of buttons) {
752
765
  if (btn.value.name === TABLE_SELECTOR_STRING) {
753
766
  tableSelectorButton = btn;
754
767
  } else if (btn.value.name === 'table' && this.props.tableSelectorSupported) {
@@ -185,7 +185,7 @@ export const TableSelectorPopup = props => {
185
185
  enableKeyboardMode();
186
186
  setSize(prevSize => {
187
187
  const getRow = (prevRow, prevCol) => {
188
- let row = prevRow;
188
+ const row = prevRow;
189
189
  // Move to previous row for wrap around
190
190
  if (prevSize.col === 1 && prevSize.row > 1) {
191
191
  return prevRow - 1;
@@ -124,7 +124,10 @@ const TableSelectorPopup = ({
124
124
  }, index) => {
125
125
  const isCurrentFocused = isFocused && selectedCol === col && selectedRow === row;
126
126
  const isActive = selectedCol >= col && selectedRow >= row ? true : false;
127
- return jsx(TableSelectorButton, {
127
+ return jsx(TableSelectorButton
128
+ // Ignored via go/ees005
129
+ // eslint-disable-next-line react/no-array-index-key
130
+ , {
128
131
  key: index,
129
132
  isActive: isActive,
130
133
  col: col,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import ActionListIcon from '../assets/action-list';
5
- import ApprovalsTrackerIcon from '../assets/approvals-tracker';
6
- import DecisionMatrixIcon from '../assets/decision-matrix';
7
- import DiscussionNotesIcon from '../assets/discussion-notes';
8
- import InstructionsOutlineIcon from '../assets/instructions-outline';
4
+ import ActionListIcon from './assets/action-list';
5
+ import ApprovalsTrackerIcon from './assets/approvals-tracker';
6
+ import DecisionMatrixIcon from './assets/decision-matrix';
7
+ import DiscussionNotesIcon from './assets/discussion-notes';
8
+ import InstructionsOutlineIcon from './assets/instructions-outline';
9
9
  import { actionList, approvalsTracker, decisionMatrix, discussionNotes, instructionsOutline } from './templates';
10
10
  const getTemplateInsertionPayload = (templateType, source) => ({
11
11
  action: ACTION.INSERTED,
@@ -2,7 +2,7 @@ import { blockTypeMessages as messages, toolbarInsertBlockMessages as toolbarMes
2
2
  import EditorCodeIcon from '@atlaskit/icon/glyph/editor/code';
3
3
  import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
4
4
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
5
- import ExpandIcon from '../assets/expand';
5
+ import ExpandIcon from './assets/expand';
6
6
  export const transformationOptions = (api, schema) => {
7
7
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
8
8
  return [{
@@ -11,11 +11,13 @@ import { getWrappingOptions } from '@atlaskit/editor-common/utils';
11
11
  import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
- import SwitchIcon from './assets/switch';
15
14
  import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
16
15
  import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
16
+ import SwitchIcon from './ui/assets/switch';
17
17
  import { InsertMenuRail } from './ui/ElementRail';
18
18
  import { templateOptions } from './ui/templateOptions';
19
+ // Ignored via go/ees005
20
+ // eslint-disable-next-line import/no-named-as-default
19
21
  import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
20
22
  import { transformationOptions } from './ui/transformOptions';
21
23
  export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
@@ -59,6 +61,7 @@ export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, app
59
61
  }
60
62
  }
61
63
  };
64
+
62
65
  /**
63
66
  * Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
64
67
  * @param name Block name
@@ -299,6 +302,8 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
299
302
  if (
300
303
  // @ts-ignore
301
304
  ['full-page', 'full-width'].includes((_options$appearance4 = options.appearance) !== null && _options$appearance4 !== void 0 ? _options$appearance4 : '') && editorExperiment('insert-menu-in-right-rail', true)) {
305
+ // Ignored via go/ees005
306
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
302
307
  plugin.pluginsOptions.contextPanel = function (state) {
303
308
  // api.getSharedState() will have an outdated reference to editorState on first mount of this component
304
309
  // so instead just rely on plugin key as we don't need to be reactive to changes here
@@ -0,0 +1 @@
1
+ export {};
@@ -270,10 +270,14 @@ var FlexWrapper = function FlexWrapper(props) {
270
270
  var setOutsideClickTargetRef = useContext(OutsideClickTargetRefContext);
271
271
  var children = props.children,
272
272
  divProps = _objectWithoutProperties(props, _excluded);
273
- return jsx("div", _extends({
274
- ref: setOutsideClickTargetRef,
275
- css: flexWrapperStyles
276
- }, divProps), children);
273
+ return (
274
+ // Ignored via go/ees005
275
+ // eslint-disable-next-line react/jsx-props-no-spreading
276
+ jsx("div", _extends({
277
+ ref: setOutsideClickTargetRef,
278
+ css: flexWrapperStyles
279
+ }, divProps), children)
280
+ );
277
281
  };
278
282
  var ElementBrowserWrapper = withOuterListeners(FlexWrapper);
279
283
  export default InsertMenu;
@@ -32,11 +32,15 @@ import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
32
32
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
33
33
  import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
34
34
  import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
35
+ // Ignored via go/ees005
36
+ // eslint-disable-next-line import/no-namespace
35
37
  import * as colors from '@atlaskit/theme/colors';
36
38
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
37
39
  import { toggleInsertMenuRightRail } from '../../pm-plugins/commands';
38
40
  import { BlockInsertMenu } from './block-insert-menu';
39
41
  import { createItems } from './create-items';
42
+ // Ignored via go/ees005
43
+ // eslint-disable-next-line import/no-named-as-default
40
44
  import TableSelectorPopup from './table-selector-popup-with-listeners';
41
45
  /**
42
46
  * Checks if an element is detached (i.e. not in the current document)
@@ -52,6 +56,8 @@ var getHoverStyles = function getHoverStyles(selector) {
52
56
  };
53
57
  var EmojiPicker = function EmojiPicker(props) {
54
58
  var setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
59
+ // Ignored via go/ees005
60
+ // eslint-disable-next-line react/jsx-props-no-spreading
55
61
  return jsx(AkEmojiPicker, _extends({
56
62
  onPickerRef: setOutsideClickTargetRef
57
63
  }, props));
@@ -156,6 +162,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
156
162
  // Workaround for FS-1322 - where two onClicks fire - one when the upload button is
157
163
  // still in the document, and one once it's detached. Does not always occur, and
158
164
  // may be a side effect of a react render optimisation
165
+ // Ignored via go/ees005
166
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
159
167
  if (e.target && !isDetachedElement(e.target)) {
160
168
  _this.toggleEmojiPicker(INPUT_METHOD.TOOLBAR);
161
169
  }
@@ -204,6 +212,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
204
212
  });
205
213
  _defineProperty(_this, "handleTableSelectorClickOutside", function (e) {
206
214
  // Ignore click events for detached elements.
215
+ // Ignored via go/ees005
216
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
207
217
  if (e.target && !isDetachedElement(e.target)) {
208
218
  _this.toggleTableSelector(INPUT_METHOD.TOOLBAR);
209
219
  }
@@ -417,6 +427,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
417
427
  onInsertBlockType = _this$props9.onInsertBlockType;
418
428
  var state = editorView.state,
419
429
  dispatch = editorView.dispatch;
430
+
431
+ // Ignored via go/ees005
432
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
420
433
  onInsertBlockType(itemName)(state, dispatch);
421
434
  return true;
422
435
  };
@@ -124,7 +124,10 @@ var TableSelectorPopup = function TableSelectorPopup(_ref3) {
124
124
  row = _ref4.row;
125
125
  var isCurrentFocused = isFocused && selectedCol === col && selectedRow === row;
126
126
  var isActive = selectedCol >= col && selectedRow >= row ? true : false;
127
- return jsx(TableSelectorButton, {
127
+ return jsx(TableSelectorButton
128
+ // Ignored via go/ees005
129
+ // eslint-disable-next-line react/no-array-index-key
130
+ , {
128
131
  key: index,
129
132
  isActive: isActive,
130
133
  col: col,
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
- import ActionListIcon from '../assets/action-list';
5
- import ApprovalsTrackerIcon from '../assets/approvals-tracker';
6
- import DecisionMatrixIcon from '../assets/decision-matrix';
7
- import DiscussionNotesIcon from '../assets/discussion-notes';
8
- import InstructionsOutlineIcon from '../assets/instructions-outline';
4
+ import ActionListIcon from './assets/action-list';
5
+ import ApprovalsTrackerIcon from './assets/approvals-tracker';
6
+ import DecisionMatrixIcon from './assets/decision-matrix';
7
+ import DiscussionNotesIcon from './assets/discussion-notes';
8
+ import InstructionsOutlineIcon from './assets/instructions-outline';
9
9
  import { actionList, approvalsTracker, decisionMatrix, discussionNotes, instructionsOutline } from './templates';
10
10
  var getTemplateInsertionPayload = function getTemplateInsertionPayload(templateType, source) {
11
11
  return {
@@ -2,7 +2,7 @@ import { blockTypeMessages as messages, toolbarInsertBlockMessages as toolbarMes
2
2
  import EditorCodeIcon from '@atlaskit/icon/glyph/editor/code';
3
3
  import EditorInfoIcon from '@atlaskit/icon/glyph/editor/info';
4
4
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
5
- import ExpandIcon from '../assets/expand';
5
+ import ExpandIcon from './assets/expand';
6
6
  export var transformationOptions = function transformationOptions(api, schema) {
7
7
  var _api$panel, _api$expand, _api$codeBlock, _api$blockType;
8
8
  return [{
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './insertBlockPlugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState, } from './insertBlockPlugin';
3
- export type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ export type { InsertBlockPlugin } from './insertBlockPluginType';
3
+ export type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState, } from './types';
@@ -1,27 +1,5 @@
1
1
  import { ToolbarSize } from '@atlaskit/editor-common/types';
2
- import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { InsertBlockPlugin } from './insertBlockPluginType';
4
4
  export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 0 | 2 | 3 | 5 | 7;
5
- export interface InsertBlockOptions {
6
- allowTables?: boolean;
7
- allowExpand?: boolean;
8
- insertMenuItems?: any;
9
- horizontalRuleEnabled?: boolean;
10
- nativeStatusSupported?: boolean;
11
- showElementBrowserLink?: boolean;
12
- tableSelectorSupported?: boolean;
13
- appearance?: EditorAppearance;
14
- }
15
- export interface InsertBlockPluginState {
16
- showElementBrowser: boolean;
17
- menuBrowserOpen?: boolean;
18
- }
19
- export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
20
- pluginConfiguration: InsertBlockOptions | undefined;
21
- dependencies: InsertBlockPluginDependencies;
22
- actions: {
23
- toggleAdditionalMenu: () => void;
24
- };
25
- sharedState: InsertBlockPluginState | undefined;
26
- }>;
27
5
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -1,53 +1,10 @@
1
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
- import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
- import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
- export type InsertBlockPluginDependencies = [
28
- TypeAheadPlugin,
29
- OptionalPlugin<TablePlugin>,
30
- OptionalPlugin<HyperlinkPlugin>,
31
- OptionalPlugin<DatePlugin>,
32
- OptionalPlugin<BlockTypePlugin>,
33
- OptionalPlugin<AnalyticsPlugin>,
34
- OptionalPlugin<ImageUploadPlugin>,
35
- OptionalPlugin<EmojiPlugin>,
36
- OptionalPlugin<QuickInsertPlugin>,
37
- OptionalPlugin<RulePlugin>,
38
- OptionalPlugin<CodeBlockPlugin>,
39
- OptionalPlugin<PanelPlugin>,
40
- OptionalPlugin<MediaPlugin>,
41
- OptionalPlugin<MediaInsertPlugin>,
42
- OptionalPlugin<MentionsPlugin>,
43
- OptionalPlugin<StatusPlugin>,
44
- OptionalPlugin<LayoutPlugin>,
45
- OptionalPlugin<ExpandPlugin>,
46
- OptionalPlugin<PlaceholderTextPlugin>,
47
- OptionalPlugin<ExtensionPlugin>,
48
- OptionalPlugin<TasksAndDecisionsPlugin>,
49
- OptionalPlugin<PrimaryToolbarPlugin>,
50
- OptionalPlugin<FeatureFlagsPlugin>,
51
- OptionalPlugin<ContextPanelPlugin>,
52
- OptionalPlugin<ConnectivityPlugin>
53
- ];
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
3
+ export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
4
+ pluginConfiguration: InsertBlockOptions | undefined;
5
+ dependencies: InsertBlockPluginDependencies;
6
+ actions: {
7
+ toggleAdditionalMenu: () => void;
8
+ };
9
+ sharedState: InsertBlockPluginState | undefined;
10
+ }>;
@@ -0,0 +1,67 @@
1
+ import type { EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
+ import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
+ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
+ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
+ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
+ import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
+ import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
+ import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
+ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
+ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
+ import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
+ import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
+ import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
+ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
+ import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
+ import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
+ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
+ import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
+ export type InsertBlockPluginDependencies = [
28
+ TypeAheadPlugin,
29
+ OptionalPlugin<TablePlugin>,
30
+ OptionalPlugin<HyperlinkPlugin>,
31
+ OptionalPlugin<DatePlugin>,
32
+ OptionalPlugin<BlockTypePlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>,
34
+ OptionalPlugin<ImageUploadPlugin>,
35
+ OptionalPlugin<EmojiPlugin>,
36
+ OptionalPlugin<QuickInsertPlugin>,
37
+ OptionalPlugin<RulePlugin>,
38
+ OptionalPlugin<CodeBlockPlugin>,
39
+ OptionalPlugin<PanelPlugin>,
40
+ OptionalPlugin<MediaPlugin>,
41
+ OptionalPlugin<MediaInsertPlugin>,
42
+ OptionalPlugin<MentionsPlugin>,
43
+ OptionalPlugin<StatusPlugin>,
44
+ OptionalPlugin<LayoutPlugin>,
45
+ OptionalPlugin<ExpandPlugin>,
46
+ OptionalPlugin<PlaceholderTextPlugin>,
47
+ OptionalPlugin<ExtensionPlugin>,
48
+ OptionalPlugin<TasksAndDecisionsPlugin>,
49
+ OptionalPlugin<PrimaryToolbarPlugin>,
50
+ OptionalPlugin<FeatureFlagsPlugin>,
51
+ OptionalPlugin<ContextPanelPlugin>,
52
+ OptionalPlugin<ConnectivityPlugin>
53
+ ];
54
+ export interface InsertBlockOptions {
55
+ allowTables?: boolean;
56
+ allowExpand?: boolean;
57
+ insertMenuItems?: any;
58
+ horizontalRuleEnabled?: boolean;
59
+ nativeStatusSupported?: boolean;
60
+ showElementBrowserLink?: boolean;
61
+ tableSelectorSupported?: boolean;
62
+ appearance?: EditorAppearance;
63
+ }
64
+ export interface InsertBlockPluginState {
65
+ showElementBrowser: boolean;
66
+ menuBrowserOpen?: boolean;
67
+ }
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import { type InsertBlockOptions, type InsertBlockPlugin } from '../../insertBlockPlugin';
4
+ import { type InsertBlockPlugin } from '../../insertBlockPluginType';
5
+ import { type InsertBlockOptions } from '../../types';
5
6
  /**
6
7
  * For insert menu in right rail experiment
7
8
  * - Clean up ticket ED-24801
@@ -11,10 +12,10 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
11
12
  options: InsertBlockOptions;
12
13
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
13
14
  pluginConfiguration: InsertBlockOptions | undefined;
14
- dependencies: import("../..").InsertBlockPluginDependencies;
15
+ dependencies: import("../../types").InsertBlockPluginDependencies;
15
16
  actions: {
16
17
  toggleAdditionalMenu: () => void;
17
18
  };
18
- sharedState: import("../../insertBlockPlugin").InsertBlockPluginState | undefined;
19
+ sharedState: import("../../types").InsertBlockPluginState | undefined;
19
20
  }> | undefined;
20
21
  }) => JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { InsertBlockOptions, insertBlockPlugin } from '../../insertBlockPlugin';
3
+ import type { insertBlockPlugin } from '../../insertBlockPlugin';
4
+ import type { InsertBlockOptions } from '../../types';
4
5
  export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -1 +1 @@
1
- export declare const shallowEquals: <T extends {}>([aRaw]: ReadonlyArray<unknown>, [bRaw]: ReadonlyArray<unknown>) => boolean;
1
+ export declare const shallowEquals: <T extends Object>([aRaw]: ReadonlyArray<unknown>, [bRaw]: ReadonlyArray<unknown>) => boolean;
@@ -1,4 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
2
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../insertBlockPlugin';
3
+ import { type InsertBlockPlugin } from '../insertBlockPluginType';
4
4
  export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];
@@ -1,8 +1,8 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
4
- import ExpandIcon from '../assets/expand';
5
- import type { InsertBlockPlugin } from '../insertBlockPlugin';
4
+ import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
+ import ExpandIcon from './assets/expand';
6
6
  export declare const transformationOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined, schema: Schema) => ({
7
7
  type: import("prosemirror-model").NodeType;
8
8
  title: {
@@ -1,3 +1,3 @@
1
1
  export { insertBlockPlugin } from './insertBlockPlugin';
2
- export type { InsertBlockPlugin, InsertBlockOptions, InsertBlockPluginState, } from './insertBlockPlugin';
3
- export type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ export type { InsertBlockPlugin } from './insertBlockPluginType';
3
+ export type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState, } from './types';
@@ -1,27 +1,5 @@
1
1
  import { ToolbarSize } from '@atlaskit/editor-common/types';
2
- import type { EditorAppearance, NextEditorPlugin } from '@atlaskit/editor-common/types';
3
- import type { InsertBlockPluginDependencies } from './insertBlockPluginType';
2
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
3
+ import type { InsertBlockPlugin } from './insertBlockPluginType';
4
4
  export declare const toolbarSizeToButtons: (toolbarSize: ToolbarSize, appearance?: EditorAppearance) => 0 | 2 | 3 | 5 | 7;
5
- export interface InsertBlockOptions {
6
- allowTables?: boolean;
7
- allowExpand?: boolean;
8
- insertMenuItems?: any;
9
- horizontalRuleEnabled?: boolean;
10
- nativeStatusSupported?: boolean;
11
- showElementBrowserLink?: boolean;
12
- tableSelectorSupported?: boolean;
13
- appearance?: EditorAppearance;
14
- }
15
- export interface InsertBlockPluginState {
16
- showElementBrowser: boolean;
17
- menuBrowserOpen?: boolean;
18
- }
19
- export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
20
- pluginConfiguration: InsertBlockOptions | undefined;
21
- dependencies: InsertBlockPluginDependencies;
22
- actions: {
23
- toggleAdditionalMenu: () => void;
24
- };
25
- sharedState: InsertBlockPluginState | undefined;
26
- }>;
27
5
  export declare const insertBlockPlugin: InsertBlockPlugin;
@@ -1,53 +1,10 @@
1
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
- import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
- import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
- import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
- import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
- import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
- import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
- import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
- import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
- import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
- import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
- import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
- import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
- import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
- import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
- import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
- import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
- import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
- import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
- import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
- export type InsertBlockPluginDependencies = [
28
- TypeAheadPlugin,
29
- OptionalPlugin<TablePlugin>,
30
- OptionalPlugin<HyperlinkPlugin>,
31
- OptionalPlugin<DatePlugin>,
32
- OptionalPlugin<BlockTypePlugin>,
33
- OptionalPlugin<AnalyticsPlugin>,
34
- OptionalPlugin<ImageUploadPlugin>,
35
- OptionalPlugin<EmojiPlugin>,
36
- OptionalPlugin<QuickInsertPlugin>,
37
- OptionalPlugin<RulePlugin>,
38
- OptionalPlugin<CodeBlockPlugin>,
39
- OptionalPlugin<PanelPlugin>,
40
- OptionalPlugin<MediaPlugin>,
41
- OptionalPlugin<MediaInsertPlugin>,
42
- OptionalPlugin<MentionsPlugin>,
43
- OptionalPlugin<StatusPlugin>,
44
- OptionalPlugin<LayoutPlugin>,
45
- OptionalPlugin<ExpandPlugin>,
46
- OptionalPlugin<PlaceholderTextPlugin>,
47
- OptionalPlugin<ExtensionPlugin>,
48
- OptionalPlugin<TasksAndDecisionsPlugin>,
49
- OptionalPlugin<PrimaryToolbarPlugin>,
50
- OptionalPlugin<FeatureFlagsPlugin>,
51
- OptionalPlugin<ContextPanelPlugin>,
52
- OptionalPlugin<ConnectivityPlugin>
53
- ];
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { InsertBlockOptions, InsertBlockPluginDependencies, InsertBlockPluginState } from './types';
3
+ export type InsertBlockPlugin = NextEditorPlugin<'insertBlock', {
4
+ pluginConfiguration: InsertBlockOptions | undefined;
5
+ dependencies: InsertBlockPluginDependencies;
6
+ actions: {
7
+ toggleAdditionalMenu: () => void;
8
+ };
9
+ sharedState: InsertBlockPluginState | undefined;
10
+ }>;
@@ -0,0 +1,67 @@
1
+ import type { EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
4
+ import type { CodeBlockPlugin } from '@atlaskit/editor-plugin-code-block';
5
+ import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
6
+ import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
7
+ import type { DatePlugin } from '@atlaskit/editor-plugin-date';
8
+ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
9
+ import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
10
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
11
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
12
+ import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
13
+ import type { ImageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
14
+ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
+ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
+ import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
+ import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
+ import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
+ import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
21
+ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
22
+ import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
23
+ import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
24
+ import type { TablePlugin } from '@atlaskit/editor-plugin-table';
25
+ import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
26
+ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
27
+ export type InsertBlockPluginDependencies = [
28
+ TypeAheadPlugin,
29
+ OptionalPlugin<TablePlugin>,
30
+ OptionalPlugin<HyperlinkPlugin>,
31
+ OptionalPlugin<DatePlugin>,
32
+ OptionalPlugin<BlockTypePlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>,
34
+ OptionalPlugin<ImageUploadPlugin>,
35
+ OptionalPlugin<EmojiPlugin>,
36
+ OptionalPlugin<QuickInsertPlugin>,
37
+ OptionalPlugin<RulePlugin>,
38
+ OptionalPlugin<CodeBlockPlugin>,
39
+ OptionalPlugin<PanelPlugin>,
40
+ OptionalPlugin<MediaPlugin>,
41
+ OptionalPlugin<MediaInsertPlugin>,
42
+ OptionalPlugin<MentionsPlugin>,
43
+ OptionalPlugin<StatusPlugin>,
44
+ OptionalPlugin<LayoutPlugin>,
45
+ OptionalPlugin<ExpandPlugin>,
46
+ OptionalPlugin<PlaceholderTextPlugin>,
47
+ OptionalPlugin<ExtensionPlugin>,
48
+ OptionalPlugin<TasksAndDecisionsPlugin>,
49
+ OptionalPlugin<PrimaryToolbarPlugin>,
50
+ OptionalPlugin<FeatureFlagsPlugin>,
51
+ OptionalPlugin<ContextPanelPlugin>,
52
+ OptionalPlugin<ConnectivityPlugin>
53
+ ];
54
+ export interface InsertBlockOptions {
55
+ allowTables?: boolean;
56
+ allowExpand?: boolean;
57
+ insertMenuItems?: any;
58
+ horizontalRuleEnabled?: boolean;
59
+ nativeStatusSupported?: boolean;
60
+ showElementBrowserLink?: boolean;
61
+ tableSelectorSupported?: boolean;
62
+ appearance?: EditorAppearance;
63
+ }
64
+ export interface InsertBlockPluginState {
65
+ showElementBrowser: boolean;
66
+ menuBrowserOpen?: boolean;
67
+ }
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import { type InsertBlockOptions, type InsertBlockPlugin } from '../../insertBlockPlugin';
4
+ import { type InsertBlockPlugin } from '../../insertBlockPluginType';
5
+ import { type InsertBlockOptions } from '../../types';
5
6
  /**
6
7
  * For insert menu in right rail experiment
7
8
  * - Clean up ticket ED-24801
@@ -11,10 +12,10 @@ export declare const InsertMenuRail: ({ editorView, options, api, }: {
11
12
  options: InsertBlockOptions;
12
13
  api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"insertBlock", {
13
14
  pluginConfiguration: InsertBlockOptions | undefined;
14
- dependencies: import("../..").InsertBlockPluginDependencies;
15
+ dependencies: import("../../types").InsertBlockPluginDependencies;
15
16
  actions: {
16
17
  toggleAdditionalMenu: () => void;
17
18
  };
18
- sharedState: import("../../insertBlockPlugin").InsertBlockPluginState | undefined;
19
+ sharedState: import("../../types").InsertBlockPluginState | undefined;
19
20
  }> | undefined;
20
21
  }) => JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { InsertBlockOptions, insertBlockPlugin } from '../../insertBlockPlugin';
3
+ import type { insertBlockPlugin } from '../../insertBlockPlugin';
4
+ import type { InsertBlockOptions } from '../../types';
4
5
  export declare const useInsertMenuRailItems: (editorView: EditorView, options: InsertBlockOptions, api?: ExtractInjectionAPI<typeof insertBlockPlugin>) => import("../ToolbarInsertBlock/create-items").BlockMenuItem[];
@@ -1 +1 @@
1
- export declare const shallowEquals: <T extends {}>([aRaw]: ReadonlyArray<unknown>, [bRaw]: ReadonlyArray<unknown>) => boolean;
1
+ export declare const shallowEquals: <T extends Object>([aRaw]: ReadonlyArray<unknown>, [bRaw]: ReadonlyArray<unknown>) => boolean;
@@ -1,4 +1,4 @@
1
1
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
2
2
  import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { type InsertBlockPlugin } from '../insertBlockPlugin';
3
+ import { type InsertBlockPlugin } from '../insertBlockPluginType';
4
4
  export declare const templateOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined) => QuickInsertItem[];
@@ -1,8 +1,8 @@
1
1
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import { type Schema } from '@atlaskit/editor-prosemirror/model';
3
3
  import QuoteIcon from '@atlaskit/icon/glyph/quote';
4
- import ExpandIcon from '../assets/expand';
5
- import type { InsertBlockPlugin } from '../insertBlockPlugin';
4
+ import type { InsertBlockPlugin } from '../insertBlockPluginType';
5
+ import ExpandIcon from './assets/expand';
6
6
  export declare const transformationOptions: (api: ExtractInjectionAPI<InsertBlockPlugin> | undefined, schema: Schema) => ({
7
7
  type: import("prosemirror-model").NodeType;
8
8
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.4.25",
3
+ "version": "2.4.27",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.3.0",
35
- "@atlaskit/editor-common": "^97.0.0",
35
+ "@atlaskit/editor-common": "^98.0.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
- "@atlaskit/editor-plugin-block-type": "^4.0.0",
37
+ "@atlaskit/editor-plugin-block-type": "^4.1.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.5.0",
39
39
  "@atlaskit/editor-plugin-connectivity": "^1.1.0",
40
40
  "@atlaskit/editor-plugin-date": "^2.4.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/editor-plugin-quick-insert": "^1.8.0",
55
55
  "@atlaskit/editor-plugin-rule": "^1.9.0",
56
56
  "@atlaskit/editor-plugin-status": "^2.6.0",
57
- "@atlaskit/editor-plugin-table": "^8.4.0",
57
+ "@atlaskit/editor-plugin-table": "^9.0.0",
58
58
  "@atlaskit/editor-plugin-tasks-and-decisions": "^2.12.0",
59
59
  "@atlaskit/editor-plugin-type-ahead": "^1.11.0",
60
60
  "@atlaskit/editor-prosemirror": "6.2.1",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/platform-feature-flags": "^0.3.0",
67
67
  "@atlaskit/primitives": "^13.3.0",
68
68
  "@atlaskit/theme": "^14.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^2.29.0",
69
+ "@atlaskit/tmp-editor-statsig": "^2.31.0",
70
70
  "@atlaskit/tokens": "^2.5.0",
71
71
  "@atlaskit/tooltip": "19.0.0",
72
72
  "@babel/runtime": "^7.0.0",
@@ -92,6 +92,9 @@
92
92
  },
93
93
  "techstack": {
94
94
  "@atlassian/frontend": {
95
+ "code-structure": [
96
+ "editor-plugin"
97
+ ],
95
98
  "import-structure": [
96
99
  "atlassian-conventions"
97
100
  ],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes