@atlaskit/editor-core 187.28.0 → 187.28.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
  3. package/dist/cjs/create-editor/create-plugins-list.js +2 -2
  4. package/dist/cjs/index.js +0 -7
  5. package/dist/cjs/labs/next/presets/default.js +2 -2
  6. package/dist/cjs/plugins/base/index.js +7 -126
  7. package/dist/cjs/plugins/base/plugin.js +140 -0
  8. package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +3 -9
  9. package/dist/cjs/plugins/index.js +2 -2
  10. package/dist/cjs/plugins/list/index.js +17 -0
  11. package/dist/cjs/plugins/list/utils/find.js +4 -3
  12. package/dist/cjs/plugins/media/toolbar/index.js +1 -1
  13. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +7 -2
  14. package/dist/cjs/plugins/media/utils/media-single.js +7 -5
  15. package/dist/cjs/plugins/paste/handlers.js +27 -3
  16. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +2 -2
  17. package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -2
  18. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +58 -36
  19. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  20. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  21. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +8 -9
  22. package/dist/cjs/test-utils.js +2 -2
  23. package/dist/cjs/ui/ContentStyles/index.js +19 -18
  24. package/dist/cjs/ui/ToolbarFeedback/index.js +22 -16
  25. package/dist/cjs/version-wrapper.js +1 -1
  26. package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -3
  27. package/dist/es2019/create-editor/create-plugins-list.js +1 -1
  28. package/dist/es2019/index.js +0 -1
  29. package/dist/es2019/labs/next/presets/default.js +1 -1
  30. package/dist/es2019/plugins/base/index.js +2 -104
  31. package/dist/es2019/plugins/base/plugin.js +109 -0
  32. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -4
  33. package/dist/es2019/plugins/index.js +1 -1
  34. package/dist/es2019/plugins/list/index.js +19 -0
  35. package/dist/es2019/plugins/list/utils/find.js +2 -2
  36. package/dist/es2019/plugins/media/toolbar/index.js +2 -2
  37. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
  38. package/dist/es2019/plugins/media/utils/media-single.js +3 -4
  39. package/dist/es2019/plugins/paste/handlers.js +27 -3
  40. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  41. package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
  42. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +62 -38
  43. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  44. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  45. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  46. package/dist/es2019/test-utils.js +1 -1
  47. package/dist/es2019/ui/ContentStyles/index.js +25 -3
  48. package/dist/es2019/ui/ToolbarFeedback/index.js +14 -9
  49. package/dist/es2019/version-wrapper.js +1 -1
  50. package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -3
  51. package/dist/esm/create-editor/create-plugins-list.js +1 -1
  52. package/dist/esm/index.js +0 -1
  53. package/dist/esm/labs/next/presets/default.js +1 -1
  54. package/dist/esm/plugins/base/index.js +2 -123
  55. package/dist/esm/plugins/base/plugin.js +128 -0
  56. package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -4
  57. package/dist/esm/plugins/index.js +1 -1
  58. package/dist/esm/plugins/list/index.js +19 -0
  59. package/dist/esm/plugins/list/utils/find.js +2 -2
  60. package/dist/esm/plugins/media/toolbar/index.js +2 -2
  61. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
  62. package/dist/esm/plugins/media/utils/media-single.js +5 -4
  63. package/dist/esm/plugins/paste/handlers.js +25 -3
  64. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  65. package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
  66. package/dist/esm/plugins/toolbar-lists-indentation/index.js +60 -37
  67. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  68. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  69. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  70. package/dist/esm/test-utils.js +1 -1
  71. package/dist/esm/ui/ContentStyles/index.js +6 -5
  72. package/dist/esm/ui/ToolbarFeedback/index.js +20 -14
  73. package/dist/esm/version-wrapper.js +1 -1
  74. package/dist/types/index.d.ts +0 -1
  75. package/dist/types/plugins/base/index.d.ts +4 -16
  76. package/dist/types/plugins/base/plugin.d.ts +23 -0
  77. package/dist/types/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
  78. package/dist/types/plugins/index.d.ts +1 -1
  79. package/dist/types/plugins/list/types.d.ts +1 -8
  80. package/dist/types/plugins/list/utils/find.d.ts +1 -1
  81. package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
  82. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  83. package/dist/types/plugins/paste/handlers.d.ts +4 -2
  84. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  85. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -2
  86. package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
  87. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
  88. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
  89. package/dist/types/ui/ToolbarFeedback/index.d.ts +1 -19
  90. package/dist/types-ts4.5/index.d.ts +0 -1
  91. package/dist/types-ts4.5/plugins/base/index.d.ts +4 -18
  92. package/dist/types-ts4.5/plugins/base/plugin.d.ts +25 -0
  93. package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
  94. package/dist/types-ts4.5/plugins/index.d.ts +1 -1
  95. package/dist/types-ts4.5/plugins/list/types.d.ts +1 -8
  96. package/dist/types-ts4.5/plugins/list/utils/find.d.ts +1 -1
  97. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
  98. package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +1 -0
  99. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +4 -2
  100. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  101. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +5 -2
  102. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
  103. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
  104. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
  105. package/dist/types-ts4.5/ui/ToolbarFeedback/index.d.ts +1 -19
  106. package/package.json +2 -2
  107. package/report.api.md +4 -58
  108. package/tmp/api-report-tmp.d.ts +4 -47
  109. package/dist/cjs/plugins/list/styles.js +0 -15
  110. package/dist/cjs/utils/list-commands.js +0 -17
  111. package/dist/cjs/utils/lists.js +0 -31
  112. package/dist/es2019/plugins/list/styles.js +0 -26
  113. package/dist/es2019/utils/list-commands.js +0 -11
  114. package/dist/es2019/utils/lists.js +0 -26
  115. package/dist/esm/plugins/list/styles.js +0 -7
  116. package/dist/esm/utils/list-commands.js +0 -11
  117. package/dist/esm/utils/lists.js +0 -24
  118. package/dist/types/plugins/list/styles.d.ts +0 -1
  119. package/dist/types/utils/list-commands.d.ts +0 -6
  120. package/dist/types/utils/lists.d.ts +0 -2
  121. package/dist/types-ts4.5/plugins/list/styles.d.ts +0 -1
  122. package/dist/types-ts4.5/utils/list-commands.d.ts +0 -6
  123. package/dist/types-ts4.5/utils/lists.d.ts +0 -2
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.doesSelectionWhichStartsOrEndsInListContainEntireList = void 0;
7
8
  exports.flattenNestedListInSlice = flattenNestedListInSlice;
8
9
  exports.handleCodeBlock = handleCodeBlock;
9
10
  exports.handleExpandPasteInTable = handleExpandPasteInTable;
@@ -41,7 +42,6 @@ var _utils4 = require("@atlaskit/editor-common/utils");
41
42
  var _edgeCases = require("./edge-cases");
42
43
  var _commands = require("./commands");
43
44
  var _pluginFactory = require("./pm-plugins/plugin-factory");
44
- var _lists = require("../../utils/lists");
45
45
  var _mark = require("@atlaskit/editor-common/mark");
46
46
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
47
47
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -247,7 +247,31 @@ function handlePasteNonNestableBlockNodesIntoList(slice) {
247
247
  return false;
248
248
  };
249
249
  }
250
- function handlePastePanelOrDecisionContentIntoList(slice) {
250
+ var doesSelectionWhichStartsOrEndsInListContainEntireList = function doesSelectionWhichStartsOrEndsInListContainEntireList(selection, findRootParentListNode) {
251
+ var $from = selection.$from,
252
+ $to = selection.$to,
253
+ from = selection.from,
254
+ to = selection.to;
255
+ var selectionParentListItemNodeResolvedPos = findRootParentListNode ? findRootParentListNode($from) || findRootParentListNode($to) : null;
256
+ var selectionParentListNode = selectionParentListItemNodeResolvedPos === null || selectionParentListItemNodeResolvedPos === void 0 ? void 0 : selectionParentListItemNodeResolvedPos.parent;
257
+ if (!selectionParentListItemNodeResolvedPos || !selectionParentListNode) {
258
+ return false;
259
+ }
260
+ var startOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + $from.depth - 1 : selectionParentListItemNodeResolvedPos.pos + $to.depth - 1;
261
+ var endOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $to.depth - 1 : selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $from.depth - 1;
262
+ if (!startOfEntireList || !endOfEntireList) {
263
+ return false;
264
+ }
265
+ if (from < to) {
266
+ return startOfEntireList >= $from.pos && endOfEntireList <= $to.pos;
267
+ } else if (from > to) {
268
+ return startOfEntireList >= $to.pos && endOfEntireList <= $from.pos;
269
+ } else {
270
+ return false;
271
+ }
272
+ };
273
+ exports.doesSelectionWhichStartsOrEndsInListContainEntireList = doesSelectionWhichStartsOrEndsInListContainEntireList;
274
+ function handlePastePanelOrDecisionContentIntoList(slice, findRootParentListNode) {
251
275
  return function (state, dispatch) {
252
276
  var schema = state.schema,
253
277
  tr = state.tr;
@@ -256,7 +280,7 @@ function handlePastePanelOrDecisionContentIntoList(slice) {
256
280
  var blockNode = slice.content.firstChild;
257
281
  var isSliceWholeNode = slice.openStart === 0 && slice.openEnd === 0;
258
282
  var selectionParentListItemNode = selection.$to.node(selection.$to.depth - 1);
259
- var sliceIsWholeNodeButShouldNotReplaceSelection = isSliceWholeNode && !(0, _lists.doesSelectionWhichStartsOrEndsInListContainEntireList)(selection);
283
+ var sliceIsWholeNodeButShouldNotReplaceSelection = isSliceWholeNode && !doesSelectionWhichStartsOrEndsInListContainEntireList(selection, findRootParentListNode);
260
284
  if (!selectionParentListItemNode || (selectionParentListItemNode === null || selectionParentListItemNode === void 0 ? void 0 : selectionParentListItemNode.type) !== schema.nodes.listItem || !blockNode || !['panel', 'decisionList'].includes(blockNode === null || blockNode === void 0 ? void 0 : blockNode.type.name) || slice.content.childCount > 1 || (blockNode === null || blockNode === void 0 ? void 0 : blockNode.content.firstChild) === undefined || sliceIsWholeNodeButShouldNotReplaceSelection) {
261
285
  return false;
262
286
  }
@@ -305,10 +305,10 @@ function injectAnalyticsPayloadBeforeCommand(createPayloadByTransaction) {
305
305
  };
306
306
  };
307
307
  }
308
- var handlePastePanelOrDecisionIntoListWithAnalytics = function handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice) {
308
+ var handlePastePanelOrDecisionIntoListWithAnalytics = function handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice, findRootParentListNode) {
309
309
  return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
310
310
  type: _analytics.PasteTypes.richText
311
- }))((0, _handlers.handlePastePanelOrDecisionContentIntoList)(slice));
311
+ }))((0, _handlers.handlePastePanelOrDecisionContentIntoList)(slice, findRootParentListNode));
312
312
  };
313
313
  exports.handlePastePanelOrDecisionIntoListWithAnalytics = handlePastePanelOrDecisionIntoListWithAnalytics;
314
314
  var handlePasteNonNestableBlockNodesIntoListWithAnalytics = function handlePasteNonNestableBlockNodesIntoListWithAnalytics(view, event, slice) {
@@ -309,7 +309,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
309
309
 
310
310
  // finally, handle rich-text copy-paste
311
311
  if (isRichText) {
312
- var _pluginInjectionApi$d6, _pluginInjectionApi$d7;
312
+ var _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8;
313
313
  // linkify the text where possible
314
314
  slice = (0, _utils.linkifyContent)(state.schema)(slice);
315
315
  if ((0, _analytics.handlePasteLinkOnSelectedTextWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
@@ -374,7 +374,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
374
374
  if ((0, _analytics.handlePasteIntoCaptionWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
375
375
  return true;
376
376
  }
377
- if ((0, _analytics.handlePastePanelOrDecisionIntoListWithAnalytics)(view, event, slice)(state, dispatch)) {
377
+ if ((0, _analytics.handlePastePanelOrDecisionIntoListWithAnalytics)(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d8 = pluginInjectionApi.dependencies.list) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : _pluginInjectionApi$d8.actions.findRootParentListNode)(state, dispatch)) {
378
378
  return true;
379
379
  }
380
380
  if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && (0, _analytics.handlePasteNonNestableBlockNodesIntoListWithAnalytics)(view, event, slice)(state, dispatch)) {
@@ -6,19 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _hooks = require("@atlaskit/editor-common/hooks");
9
10
  var _ui = _interopRequireDefault(require("./ui"));
10
- var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
11
11
  var _types = require("../../ui/Toolbar/types");
12
- var _main = require("../list/pm-plugins/main");
13
12
  var _indentationButtons = require("./pm-plugins/indentation-buttons");
14
13
  var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref, api) {
15
- var _api$dependencies$ana;
14
+ var _api$dependencies$fea;
16
15
  var showIndentationButtons = _ref.showIndentationButtons,
17
16
  allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
18
- var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
19
- var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
17
+ var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
20
18
  return {
21
19
  name: 'toolbarListsIndentation',
20
+ getSharedState: function getSharedState(editorState) {
21
+ if (!editorState) {
22
+ return undefined;
23
+ }
24
+ return _indentationButtons.pluginKey.getState(editorState);
25
+ },
22
26
  pmPlugins: function pmPlugins() {
23
27
  return [{
24
28
  name: 'indentationButtons',
@@ -27,7 +31,8 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
27
31
  return (0, _indentationButtons.createPlugin)({
28
32
  dispatch: dispatch,
29
33
  showIndentationButtons: showIndentationButtons,
30
- allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation
34
+ allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation,
35
+ api: api
31
36
  });
32
37
  }
33
38
  }];
@@ -41,39 +46,56 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref,
41
46
  disabled = _ref3.disabled,
42
47
  isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing;
43
48
  var isSmall = toolbarSize < _types.ToolbarSize.L;
44
- return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
45
- plugins: {
46
- listState: _main.pluginKey,
47
- indentationState: _indentationButtons.pluginKey
48
- },
49
- render: function render(_ref4) {
50
- var listState = _ref4.listState,
51
- indentationState = _ref4.indentationState;
52
- if (!listState) {
53
- return null;
54
- }
55
- return /*#__PURE__*/_react.default.createElement(_ui.default, {
56
- featureFlags: featureFlags,
57
- isSmall: isSmall,
58
- isReducedSpacing: isToolbarReducedSpacing,
59
- disabled: disabled,
60
- editorView: editorView,
61
- popupsMountPoint: popupsMountPoint,
62
- popupsBoundariesElement: popupsBoundariesElement,
63
- popupsScrollableElement: popupsScrollableElement,
64
- bulletListActive: listState.bulletListActive,
65
- bulletListDisabled: listState.bulletListDisabled,
66
- orderedListActive: listState.orderedListActive,
67
- orderedListDisabled: listState.orderedListDisabled,
68
- showIndentationButtons: !!showIndentationButtons,
69
- indentDisabled: indentationState.indentDisabled,
70
- outdentDisabled: indentationState.outdentDisabled,
71
- editorAnalyticsAPI: editorAnalyticsAPI
72
- });
73
- }
49
+ return /*#__PURE__*/_react.default.createElement(PrimaryToolbarComponent, {
50
+ featureFlags: featureFlags,
51
+ popupsMountPoint: popupsMountPoint,
52
+ popupsBoundariesElement: popupsBoundariesElement,
53
+ popupsScrollableElement: popupsScrollableElement,
54
+ isSmall: isSmall,
55
+ isToolbarReducedSpacing: isToolbarReducedSpacing,
56
+ disabled: disabled,
57
+ editorView: editorView,
58
+ showIndentationButtons: showIndentationButtons,
59
+ pluginInjectionApi: api
74
60
  });
75
61
  }
76
62
  };
77
63
  };
64
+ function PrimaryToolbarComponent(_ref4) {
65
+ var featureFlags = _ref4.featureFlags,
66
+ popupsMountPoint = _ref4.popupsMountPoint,
67
+ popupsBoundariesElement = _ref4.popupsBoundariesElement,
68
+ popupsScrollableElement = _ref4.popupsScrollableElement,
69
+ isSmall = _ref4.isSmall,
70
+ isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing,
71
+ disabled = _ref4.disabled,
72
+ editorView = _ref4.editorView,
73
+ showIndentationButtons = _ref4.showIndentationButtons,
74
+ pluginInjectionApi = _ref4.pluginInjectionApi;
75
+ var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['list', 'toolbarListsIndentation']),
76
+ listState = _useSharedPluginState.listState,
77
+ toolbarListsIndentationState = _useSharedPluginState.toolbarListsIndentationState;
78
+ if (!listState) {
79
+ return null;
80
+ }
81
+ return /*#__PURE__*/_react.default.createElement(_ui.default, {
82
+ featureFlags: featureFlags,
83
+ isSmall: isSmall,
84
+ isReducedSpacing: isToolbarReducedSpacing,
85
+ disabled: disabled,
86
+ editorView: editorView,
87
+ popupsMountPoint: popupsMountPoint,
88
+ popupsBoundariesElement: popupsBoundariesElement,
89
+ popupsScrollableElement: popupsScrollableElement,
90
+ bulletListActive: listState.bulletListActive,
91
+ bulletListDisabled: listState.bulletListDisabled,
92
+ orderedListActive: listState.orderedListActive,
93
+ orderedListDisabled: listState.orderedListDisabled,
94
+ showIndentationButtons: !!showIndentationButtons,
95
+ indentDisabled: toolbarListsIndentationState.indentDisabled,
96
+ outdentDisabled: toolbarListsIndentationState.outdentDisabled,
97
+ pluginInjectionApi: pluginInjectionApi
98
+ });
99
+ }
78
100
  var _default = toolbarListsIndentationPlugin;
79
101
  exports.default = _default;
@@ -8,13 +8,12 @@ var _state = require("@atlaskit/editor-prosemirror/state");
8
8
  var _utils = require("@atlaskit/editor-prosemirror/utils");
9
9
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
10
  var _utils2 = require("@atlaskit/editor-common/utils");
11
- var _selection = require("../../list/utils/selection");
12
11
  var _helpers = require("../../tasks-and-decisions/pm-plugins/helpers");
13
12
  var _commands = require("../../indentation/commands");
14
13
  var _lists = require("@atlaskit/editor-common/lists");
15
14
  var pluginKey = new _state.PluginKey('indentationButtonsPlugin');
16
15
  exports.pluginKey = pluginKey;
17
- function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation) {
16
+ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndentation, api) {
18
17
  var state = {
19
18
  indentDisabled: true,
20
19
  outdentDisabled: true,
@@ -27,7 +26,7 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
27
26
  // not use the indentation mark.
28
27
  // Check for lists before paragraphs and headings in case
29
28
  // the selection is in a list nested in a layout column.
30
- if ((0, _selection.isInsideListItem)(editorState)) {
29
+ if (api !== null && api !== void 0 && api.dependencies.list.actions.isInsideListItem(editorState)) {
31
30
  var _getListItemAttribute = (0, _lists.getListItemAttributes)(selection.$head),
32
31
  indentLevel = _getListItemAttribute.indentLevel,
33
32
  itemIndex = _getListItemAttribute.itemIndex;
@@ -76,7 +75,8 @@ function getIndentationButtonsState(editorState, allowHeadingAndParagraphIndenta
76
75
  var createPlugin = function createPlugin(_ref) {
77
76
  var dispatch = _ref.dispatch,
78
77
  showIndentationButtons = _ref.showIndentationButtons,
79
- allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
78
+ allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation,
79
+ api = _ref.api;
80
80
  return new _safePlugin.SafePlugin({
81
81
  state: {
82
82
  init: function init(_config, state) {
@@ -85,11 +85,11 @@ var createPlugin = function createPlugin(_ref) {
85
85
  outdentDisabled: true,
86
86
  node: null
87
87
  };
88
- return showIndentationButtons ? getIndentationButtonsState(state, allowHeadingAndParagraphIndentation) : initialState;
88
+ return showIndentationButtons ? getIndentationButtonsState(state, allowHeadingAndParagraphIndentation, api) : initialState;
89
89
  },
90
90
  apply: function apply(_tr, pluginState, _oldState, newState) {
91
91
  if (showIndentationButtons) {
92
- var state = getIndentationButtonsState(newState, allowHeadingAndParagraphIndentation);
92
+ var state = getIndentationButtonsState(newState, allowHeadingAndParagraphIndentation, api);
93
93
  if (!(0, _utils2.shallowEqual)(pluginState, state)) {
94
94
  dispatch(pluginKey, state);
95
95
  return state;
@@ -25,7 +25,7 @@ function ToolbarListsIndentation(props) {
25
25
  indentDisabled = props.indentDisabled,
26
26
  outdentDisabled = props.outdentDisabled,
27
27
  featureFlags = props.featureFlags,
28
- editorAnalyticsAPI = props.editorAnalyticsAPI;
28
+ pluginInjectionApi = props.pluginInjectionApi;
29
29
  if (isSmall) {
30
30
  return (0, _react.jsx)(_ToolbarDropdown.ToolbarDropdown, {
31
31
  editorView: props.editorView,
@@ -41,7 +41,7 @@ function ToolbarListsIndentation(props) {
41
41
  indentDisabled: indentDisabled,
42
42
  outdentDisabled: outdentDisabled,
43
43
  disabled: disabled,
44
- onItemActivated: (0, _onItemActivated.onItemActivated)(editorAnalyticsAPI),
44
+ onItemActivated: (0, _onItemActivated.onItemActivated)(pluginInjectionApi),
45
45
  featureFlags: featureFlags
46
46
  });
47
47
  }
@@ -56,7 +56,7 @@ function ToolbarListsIndentation(props) {
56
56
  indentDisabled: indentDisabled,
57
57
  outdentDisabled: outdentDisabled,
58
58
  disabled: disabled,
59
- onItemActivated: (0, _onItemActivated.onItemActivated)(editorAnalyticsAPI),
59
+ onItemActivated: (0, _onItemActivated.onItemActivated)(pluginInjectionApi),
60
60
  featureFlags: featureFlags
61
61
  });
62
62
  }
@@ -4,32 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.onItemActivated = void 0;
7
- var _commands = require("../../list/commands");
8
- var _commands2 = require("../../indentation/commands");
7
+ var _commands = require("../../indentation/commands");
9
8
  var _keymaps = require("../../tasks-and-decisions/pm-plugins/keymaps");
10
9
  var _analytics = require("../../analytics");
11
10
  var _indentationButtons = require("../pm-plugins/indentation-buttons");
12
- var onItemActivated = function onItemActivated(editorAnalyticsAPI) {
11
+ var onItemActivated = function onItemActivated(pluginInjectionApi) {
13
12
  return function (_ref) {
14
13
  var buttonName = _ref.buttonName,
15
14
  editorView = _ref.editorView,
16
15
  featureFlags = _ref.featureFlags;
17
16
  switch (buttonName) {
18
17
  case 'bullet_list':
19
- (0, _commands.toggleBulletList)(editorAnalyticsAPI)(editorView, _analytics.INPUT_METHOD.TOOLBAR);
18
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleBulletList(editorView, _analytics.INPUT_METHOD.TOOLBAR);
20
19
  break;
21
20
  case 'ordered_list':
22
- (0, _commands.toggleOrderedList)(editorAnalyticsAPI)(editorView, _analytics.INPUT_METHOD.TOOLBAR);
21
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleOrderedList(editorView, _analytics.INPUT_METHOD.TOOLBAR);
23
22
  break;
24
23
  case 'indent':
25
24
  {
26
25
  var _indentationButtonsPl;
27
26
  var node = (_indentationButtonsPl = _indentationButtons.pluginKey.getState(editorView.state)) === null || _indentationButtonsPl === void 0 ? void 0 : _indentationButtonsPl.node;
28
27
  if (node === 'paragraph_heading') {
29
- (0, _commands2.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
28
+ (0, _commands.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
30
29
  }
31
30
  if (node === 'list') {
32
- (0, _commands.indentList)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
31
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.indentList(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
33
32
  }
34
33
  if (node === 'taskList') {
35
34
  (0, _keymaps.getIndentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -41,10 +40,10 @@ var onItemActivated = function onItemActivated(editorAnalyticsAPI) {
41
40
  var _indentationButtonsPl2;
42
41
  var _node = (_indentationButtonsPl2 = _indentationButtons.pluginKey.getState(editorView.state)) === null || _indentationButtonsPl2 === void 0 ? void 0 : _indentationButtonsPl2.node;
43
42
  if (_node === 'paragraph_heading') {
44
- (0, _commands2.getOutdentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
43
+ (0, _commands.getOutdentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
45
44
  }
46
45
  if (_node === 'list') {
47
- (0, _commands.outdentList)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
46
+ pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.outdentList(_analytics.INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
48
47
  }
49
48
  if (_node === 'taskList') {
50
49
  (0, _keymaps.getUnindentCommand)(_analytics.INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -39,7 +39,7 @@ var _preset = require("@atlaskit/editor-common/preset");
39
39
  var _createSchema = require("./create-editor/create-schema");
40
40
  var _sortByOrder = require("./create-editor/sort-by-order");
41
41
  var _pluginKey = require("./plugins/analytics/plugin-key");
42
- var _base = _interopRequireDefault(require("./plugins/base"));
42
+ var _base = require("./plugins/base");
43
43
  var _api = require("./plugins/type-ahead/api");
44
44
  var _eventDispatcher = require("./event-dispatcher");
45
45
  var _selection = require("./plugins/selection/gap-cursor/selection");
@@ -104,7 +104,7 @@ var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
104
104
  var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new _preset.EditorPresetBuilder();
105
105
  return function (pluginFactoryParams) {
106
106
  var editorPlugins = [];
107
- var preset = inputPreset.has(_base.default) ? inputPreset : inputPreset.add(_base.default);
107
+ var preset = inputPreset.has(_base.basePlugin) ? inputPreset : inputPreset.add(_base.basePlugin);
108
108
  editorPlugins = preset.build({
109
109
  pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
110
110
  });
@@ -18,33 +18,34 @@ var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
18
18
  var _styles5 = require("../../plugins/placeholder/styles");
19
19
  var _styles6 = require("../../plugins/block-type/styles");
20
20
  var _styles7 = require("../../plugins/code-block/styles");
21
- var _styles8 = require("../../plugins/list/styles");
22
- var _styles9 = require("../../plugins/rule/styles");
23
- var _styles10 = require("../../plugins/media/styles");
24
- var _styles11 = require("../../plugins/layout/styles");
25
- var _styles12 = require("../../plugins/panel/styles");
26
- var _styles13 = require("../../plugins/fake-text-cursor/styles");
27
- var _styles14 = require("../../plugins/mentions/styles");
28
- var _styles15 = require("../../plugins/emoji/styles");
29
- var _styles16 = require("../../plugins/placeholder-text/styles");
30
- var _styles17 = require("../../plugins/extension/ui/styles");
31
- var _styles18 = require("../../plugins/expand/ui/styles");
21
+ var _styles8 = require("../../plugins/rule/styles");
22
+ var _styles9 = require("../../plugins/media/styles");
23
+ var _styles10 = require("../../plugins/layout/styles");
24
+ var _styles11 = require("../../plugins/panel/styles");
25
+ var _styles12 = require("../../plugins/fake-text-cursor/styles");
26
+ var _styles13 = require("../../plugins/mentions/styles");
27
+ var _styles14 = require("../../plugins/emoji/styles");
28
+ var _styles15 = require("../../plugins/placeholder-text/styles");
29
+ var _styles16 = require("../../plugins/extension/ui/styles");
30
+ var _styles17 = require("../../plugins/expand/ui/styles");
32
31
  var _style = require("../../plugins/media/pm-plugins/alt-text/style");
33
- var _styles19 = require("../../plugins/find-replace/styles");
34
- var _styles20 = require("../../plugins/tasks-and-decisions/styles");
35
- var _styles21 = require("../../plugins/status/styles");
36
- var _styles22 = require("../../plugins/date/styles");
32
+ var _styles18 = require("../../plugins/find-replace/styles");
33
+ var _styles19 = require("../../plugins/tasks-and-decisions/styles");
34
+ var _styles20 = require("../../plugins/status/styles");
35
+ var _styles21 = require("../../plugins/date/styles");
37
36
  var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
38
- var _templateObject, _templateObject2;
37
+ var _utils = require("@atlaskit/editor-common/utils");
38
+ var _templateObject, _templateObject2, _templateObject3;
39
39
  /** @jsx jsx */
40
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
41
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
42
  var linkStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n"])), _styles.linkSharedStyle);
43
43
  exports.linkStyles = linkStyles;
44
+ var listsStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: 4px 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n }\n"])), _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
44
45
  var contentStyles = function contentStyles(props) {
45
- return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
46
+ return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
46
47
  theme: props.theme
47
- }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles16.placeholderTextStyles, _styles5.placeholderStyles, (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, (0, _styles11.layoutStyles)(props), _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles, _styles15.emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles17.extensionStyles, (0, _styles18.expandStyles)(props), _styles19.findReplaceStyles, _styles20.taskDecisionStyles, _styles21.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _styles22.dateStyles, _styles.embedCardStyles, _styles2.unsupportedStyles, _styles.resizerStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
48
+ }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles15.placeholderTextStyles, _styles5.placeholderStyles, (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, (0, _styles8.ruleStyles)(props), _styles9.mediaStyles, (0, _styles10.layoutStyles)(props), _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles11.panelStyles)(props), _styles12.fakeCursorStyles, _styles13.mentionsStyles, _styles14.emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles16.extensionStyles, (0, _styles17.expandStyles)(props), _styles18.findReplaceStyles, _styles19.taskDecisionStyles, _styles20.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _styles21.dateStyles, _styles.embedCardStyles, _styles2.unsupportedStyles, _styles.resizerStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
48
49
  };
49
50
  var createEditorContentStyle = function createEditorContentStyle(styles) {
50
51
  return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
@@ -4,8 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.default = ToolbarFeedback;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -31,7 +32,7 @@ var _feedbackDialog = require("../../plugins/feedback-dialog");
31
32
  var _deprecationWarnings = _interopRequireDefault(require("../../utils/deprecation-warnings"));
32
33
  var _pickBy = _interopRequireDefault(require("../../utils/pick-by"));
33
34
  var _consts = require("../../plugins/analytics/consts");
34
- var _contextIdentifier = require("../../plugins/base/pm-plugins/context-identifier");
35
+ var _context2 = require("../../presets/context");
35
36
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
36
37
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
38
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -56,12 +57,12 @@ var deprecations = [{
56
57
  var isNullOrUndefined = function isNullOrUndefined(attr) {
57
58
  return attr === null || attr === undefined;
58
59
  };
59
- var ToolbarFeedback = /*#__PURE__*/function (_PureComponent) {
60
- (0, _inherits2.default)(ToolbarFeedback, _PureComponent);
61
- var _super = _createSuper(ToolbarFeedback);
62
- function ToolbarFeedback(props) {
60
+ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
61
+ (0, _inherits2.default)(ToolbarFeedbackInternal, _PureComponent);
62
+ var _super = _createSuper(ToolbarFeedbackInternal);
63
+ function ToolbarFeedbackInternal(props) {
63
64
  var _this;
64
- (0, _classCallCheck2.default)(this, ToolbarFeedback);
65
+ (0, _classCallCheck2.default)(this, ToolbarFeedbackInternal);
65
66
  _this = _super.call(this, props);
66
67
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
67
68
  jiraIssueCollectorScriptLoading: false,
@@ -98,8 +99,8 @@ var ToolbarFeedback = /*#__PURE__*/function (_PureComponent) {
98
99
  });
99
100
  });
100
101
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openJiraIssueCollector", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
101
- var _window$localStorage$, _getContextIdentifier;
102
- var editorView, sessionId, contentId, tabId;
102
+ var _this$props$api, _window$localStorage$, _basePluginState$cont;
103
+ var basePluginState, sessionId, contentId, tabId;
103
104
  return _regenerator.default.wrap(function _callee$(_context) {
104
105
  while (1) switch (_context.prev = _context.next) {
105
106
  case 0:
@@ -107,9 +108,9 @@ var ToolbarFeedback = /*#__PURE__*/function (_PureComponent) {
107
108
  jiraIssueCollectorScriptLoading: true,
108
109
  showOptOutOption: false
109
110
  });
110
- editorView = _this.context.editorActions.editorView;
111
+ basePluginState = (_this$props$api = _this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.dependencies.base.sharedState.currentState();
111
112
  sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
112
- contentId = (_getContextIdentifier = (0, _contextIdentifier.getContextIdentifier)(editorView === null || editorView === void 0 ? void 0 : editorView.state)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId;
113
+ contentId = basePluginState === null || basePluginState === void 0 ? void 0 : (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
113
114
  tabId = window.sessionStorage['awc.tab.id'];
114
115
  _context.next = 7;
115
116
  return (0, _feedbackDialog.openFeedbackDialog)(_objectSpread(_objectSpread({}, _this.getFeedbackInfo()), {}, {
@@ -150,7 +151,7 @@ var ToolbarFeedback = /*#__PURE__*/function (_PureComponent) {
150
151
  (0, _deprecationWarnings.default)(ToolbarFeedback.name, props, deprecations);
151
152
  return _this;
152
153
  }
153
- (0, _createClass2.default)(ToolbarFeedback, [{
154
+ (0, _createClass2.default)(ToolbarFeedbackInternal, [{
154
155
  key: "render",
155
156
  value: function render() {
156
157
  var _this$props = this.props,
@@ -197,9 +198,14 @@ var ToolbarFeedback = /*#__PURE__*/function (_PureComponent) {
197
198
  }, "Learn more")))))) : null;
198
199
  }
199
200
  }]);
200
- return ToolbarFeedback;
201
+ return ToolbarFeedbackInternal;
201
202
  }(_react2.PureComponent);
202
- exports.default = ToolbarFeedback;
203
- (0, _defineProperty2.default)(ToolbarFeedback, "contextTypes", {
203
+ (0, _defineProperty2.default)(ToolbarFeedbackInternal, "contextTypes", {
204
204
  editorActions: _propTypes.default.object.isRequired
205
- });
205
+ });
206
+ function ToolbarFeedback(props) {
207
+ var api = (0, _context2.usePresetContext)();
208
+ return (0, _react.jsx)(ToolbarFeedbackInternal, (0, _extends2.default)({
209
+ api: api
210
+ }, props));
211
+ }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.28.0";
9
+ var version = "187.28.2";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -24,7 +24,6 @@ import { getParticipantsCount } from '../plugins/collab-edit/get-participants-co
24
24
  import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE, TransactionTracker } from '../utils/performance/track-transactions';
25
25
  import { countNodes } from '../utils/count-nodes';
26
26
  import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
27
- import { getContextIdentifier } from '../plugins/base/pm-plugins/context-identifier';
28
27
  import ReactEditorViewContext from './ReactEditorViewContext';
29
28
  import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
30
29
  import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
@@ -398,9 +397,10 @@ export class ReactEditorView extends React.Component {
398
397
  const forceSeverityTracking = typeof proseMirrorRenderedTracking === 'undefined' && shouldForceTracking();
399
398
  this.proseMirrorRenderedSeverity = !!forceSeverityTracking || proseMirrorRenderedTracking !== null && proseMirrorRenderedTracking !== void 0 && proseMirrorRenderedTracking.trackSeverity ? getAnalyticsEventSeverity(duration, (_proseMirrorRenderedT = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityNormalThreshold) !== null && _proseMirrorRenderedT !== void 0 ? _proseMirrorRenderedT : PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, (_proseMirrorRenderedT2 = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityDegradedThreshold) !== null && _proseMirrorRenderedT2 !== void 0 ? _proseMirrorRenderedT2 : PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD) : undefined;
400
399
  if (this.view) {
401
- var _getContextIdentifier, _this$experienceStore10;
400
+ var _this$pluginInjection, _this$experienceStore10;
402
401
  const nodes = getNodesCount(this.view.state.doc);
403
402
  const ttfb = getResponseEndTime();
403
+ const contextIdentifier = (_this$pluginInjection = this.pluginInjectionAPI.api().dependencies.base) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.sharedState.currentState();
404
404
  this.dispatchAnalyticsEvent({
405
405
  action: ACTION.PROSEMIRROR_RENDERED,
406
406
  actionSubject: ACTION_SUBJECT.EDITOR,
@@ -410,7 +410,7 @@ export class ReactEditorView extends React.Component {
410
410
  nodes,
411
411
  ttfb,
412
412
  severity: this.proseMirrorRenderedSeverity,
413
- objectId: (_getContextIdentifier = getContextIdentifier(this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId,
413
+ objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
414
414
  distortedDuration
415
415
  },
416
416
  eventType: EVENT_TYPE.OPERATIONAL
@@ -1,5 +1,5 @@
1
1
  import createUniversalPreset from '../labs/next/presets/universal';
2
- import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
2
+ import { GUTTER_SIZE_MOBILE_IN_PX } from '@atlaskit/editor-common/utils';
3
3
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
4
4
  import { createFeatureFlagsFromProps } from './feature-flags-from-props';
5
5
  const isCodeBlockAllowed = options => {
@@ -41,7 +41,6 @@ export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded } from './plugins
41
41
 
42
42
  // Used in editor-test-helpers and mobile bridge
43
43
  export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
44
- export { getListCommands } from './utils/list-commands';
45
44
  export { ReactEditorView, BaseReactEditorView } from './create-editor';
46
45
  export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
47
46
  export { default as EditorActions } from './actions';
@@ -7,7 +7,7 @@ import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
7
7
  import { textFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
8
8
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
9
9
  import unsupportedContentPlugin from '../../../plugins/unsupported-content';
10
- import basePlugin from '../../../plugins/base';
10
+ import { basePlugin } from '../../../plugins/base';
11
11
  import { focusPlugin } from '@atlaskit/editor-plugin-focus';
12
12
  import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
13
13
  import typeAheadPlugin from '../../../plugins/type-ahead';