@atlaskit/editor-common 109.11.3 → 109.12.0

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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/analytics/types/enums.js +1 -1
  3. package/dist/cjs/analytics/types/table-events.js +1 -0
  4. package/dist/cjs/monitoring/error.js +1 -1
  5. package/dist/cjs/sync-block/sync-block-store-manager.js +58 -1
  6. package/dist/cjs/toolbar/EditorToolbarUIProvider.js +4 -2
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/utils/commands.js +2 -2
  9. package/dist/es2019/analytics/types/enums.js +1 -1
  10. package/dist/es2019/analytics/types/table-events.js +1 -0
  11. package/dist/es2019/monitoring/error.js +1 -1
  12. package/dist/es2019/sync-block/sync-block-store-manager.js +26 -2
  13. package/dist/es2019/toolbar/EditorToolbarUIProvider.js +4 -2
  14. package/dist/es2019/ui/DropList/index.js +1 -1
  15. package/dist/es2019/utils/commands.js +2 -2
  16. package/dist/esm/analytics/types/enums.js +1 -1
  17. package/dist/esm/analytics/types/table-events.js +1 -0
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/sync-block/sync-block-store-manager.js +58 -2
  20. package/dist/esm/toolbar/EditorToolbarUIProvider.js +4 -2
  21. package/dist/esm/ui/DropList/index.js +1 -1
  22. package/dist/esm/utils/commands.js +2 -2
  23. package/dist/types/analytics/types/enums.d.ts +1 -1
  24. package/dist/types/analytics/types/events.d.ts +1 -2
  25. package/dist/types/analytics/types/table-events.d.ts +12 -2
  26. package/dist/types/sync-block/sync-block-store-manager.d.ts +15 -0
  27. package/dist/types/toolbar/EditorToolbarUIProvider.d.ts +2 -2
  28. package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -1
  29. package/dist/types-ts4.5/analytics/types/events.d.ts +1 -2
  30. package/dist/types-ts4.5/analytics/types/table-events.d.ts +12 -2
  31. package/dist/types-ts4.5/sync-block/sync-block-store-manager.d.ts +15 -0
  32. package/dist/types-ts4.5/toolbar/EditorToolbarUIProvider.d.ts +2 -2
  33. package/package.json +1 -1
  34. package/dist/cjs/analytics/types/width-events.js +0 -5
  35. package/dist/es2019/analytics/types/width-events.js +0 -1
  36. package/dist/esm/analytics/types/width-events.js +0 -1
  37. package/dist/types/analytics/types/width-events.d.ts +0 -5
  38. package/dist/types-ts4.5/analytics/types/width-events.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 109.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`889f0cb60f68d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/889f0cb60f68d) -
8
+ EDITOR-1561 implement confirmation before deleting a source sync block
9
+
10
+ ### Patch Changes
11
+
12
+ - [`a77acd87fef67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a77acd87fef67) -
13
+ EDITOR-1391 add new analytics event which logs editor width and all table widths on the page once
14
+ after page is loaded in both editor and renderer. remove previous implementation in width plugin.
15
+ - [`bb498825fca37`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bb498825fca37) -
16
+ [ux] [ED-29266] add ToolbarKeyboardNavigationProvider to selection toolbar with Alt+F10 shortcut
17
+ to focus
18
+ - Updated dependencies
19
+
20
+ ## 109.11.4
21
+
22
+ ### Patch Changes
23
+
24
+ - [`ef686b3cfdbff`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef686b3cfdbff) -
25
+ ED-29222: Make empty line experiment dependent on block menu
26
+
3
27
  ## 109.11.3
4
28
 
5
29
  ### Patch Changes
@@ -197,7 +197,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
197
197
  ACTION["SUGGESTION_INSERTED"] = "suggestionInserted";
198
198
  ACTION["SUGGESTION_DISMISSED"] = "suggestionDismissed";
199
199
  ACTION["SUGGESTION_VIEWED"] = "suggestionViewed";
200
- ACTION["INITIAL_EDITOR_WIDTH"] = "initialEditorWidth";
200
+ ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
201
201
  return ACTION;
202
202
  }({});
203
203
  var INPUT_METHOD = exports.INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
@@ -44,6 +44,7 @@ var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
44
44
  TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
45
45
  // Temporary to track usage of CONFCLOUD-78239 bug
46
46
  TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
47
+ TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
47
48
  return TABLE_ACTION;
48
49
  }({});
49
50
  var TABLE_BREAKOUT = exports.TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "0.0.0-development";
19
+ var packageVersion = "109.11.4";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.SyncBlockStoreManager = void 0;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
12
  // Do this typedef to make it clear that
11
13
  // this is a local identifier for a resource for local use
12
- // Represents a SOURCE sync block within the editor.
13
14
  // A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
14
15
  // Supports create, read, update, and delete operations for sync blocks.
15
16
  // Designed to manage local in-memory state and synchronize with an external data provider.
@@ -22,6 +23,11 @@ var SyncBlockStoreManager = exports.SyncBlockStoreManager = /*#__PURE__*/functio
22
23
  this.dataProvider = dataProvider;
23
24
  }
24
25
  return (0, _createClass2.default)(SyncBlockStoreManager, [{
26
+ key: "setEditorView",
27
+ value: function setEditorView(editorView) {
28
+ this.editorView = editorView;
29
+ }
30
+ }, {
25
31
  key: "isSourceBlock",
26
32
  value: function isSourceBlock(node) {
27
33
  var _this$syncBlocks$get;
@@ -33,5 +39,56 @@ var SyncBlockStoreManager = exports.SyncBlockStoreManager = /*#__PURE__*/functio
33
39
  localId = _node$attrs.localId;
34
40
  return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
35
41
  }
42
+ }, {
43
+ key: "registerConfirmationCallback",
44
+ value: function registerConfirmationCallback(callback) {
45
+ var _this = this;
46
+ this.confirmationCallback = callback;
47
+ return function () {
48
+ _this.confirmationCallback = undefined;
49
+ };
50
+ }
51
+ }, {
52
+ key: "requireConfirmationBeforeDelete",
53
+ value: function requireConfirmationBeforeDelete() {
54
+ return !!this.confirmationCallback;
55
+ }
56
+ }, {
57
+ key: "deleteSyncBlocksWithConfirmation",
58
+ value: function () {
59
+ var _deleteSyncBlocksWithConfirmation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(tr, syncBlockIds) {
60
+ var _this2 = this;
61
+ var confirmed, _this$editorView;
62
+ return _regenerator.default.wrap(function _callee$(_context) {
63
+ while (1) switch (_context.prev = _context.next) {
64
+ case 0:
65
+ if (!this.confirmationCallback) {
66
+ _context.next = 5;
67
+ break;
68
+ }
69
+ _context.next = 3;
70
+ return this.confirmationCallback();
71
+ case 3:
72
+ confirmed = _context.sent;
73
+ if (confirmed) {
74
+ // TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
75
+ (_this$editorView = this.editorView) === null || _this$editorView === void 0 || _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
76
+ // Need to update the BE on deletion
77
+ syncBlockIds.forEach(function (_ref) {
78
+ var resourceId = _ref.resourceId;
79
+ return _this2.syncBlocks.delete(resourceId);
80
+ });
81
+ }
82
+ case 5:
83
+ case "end":
84
+ return _context.stop();
85
+ }
86
+ }, _callee, this);
87
+ }));
88
+ function deleteSyncBlocksWithConfirmation(_x, _x2) {
89
+ return _deleteSyncBlocksWithConfirmation.apply(this, arguments);
90
+ }
91
+ return deleteSyncBlocksWithConfirmation;
92
+ }()
36
93
  }]);
37
94
  }();
@@ -15,7 +15,8 @@ var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorT
15
15
  popupsMountPoint = _ref.popupsMountPoint,
16
16
  popupsBoundariesElement = _ref.popupsBoundariesElement,
17
17
  popupsScrollableElement = _ref.popupsScrollableElement,
18
- fireAnalyticsEvent = _ref.fireAnalyticsEvent;
18
+ fireAnalyticsEvent = _ref.fireAnalyticsEvent,
19
+ keyboardNavigation = _ref.keyboardNavigation;
19
20
  var onDropdownOpenChanged = (0, _react.useCallback)(function (_ref2) {
20
21
  var isOpen = _ref2.isOpen;
21
22
  if (!isOpen) {
@@ -37,6 +38,7 @@ var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorT
37
38
  popupsMountPoint: popupsMountPoint,
38
39
  popupsBoundariesElement: popupsBoundariesElement,
39
40
  popupsScrollableElement: popupsScrollableElement,
40
- fireAnalyticsEvent: fireAnalyticsEvent
41
+ fireAnalyticsEvent: fireAnalyticsEvent,
42
+ keyboardNavigation: keyboardNavigation
41
43
  }, children);
42
44
  };
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "0.0.0-development";
27
+ var packageVersion = "109.11.4";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -193,7 +193,7 @@ function canMoveUp(state) {
193
193
  if (selection instanceof _state.NodeSelection && (0, _nodes.isMediaNode)(selection.node)) {
194
194
  return true;
195
195
  }
196
- if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof _state.TextSelection) {
196
+ if (selection instanceof _state.TextSelection && !((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
197
197
  if (!selection.empty) {
198
198
  return true;
199
199
  }
@@ -209,7 +209,7 @@ function canMoveDown(state) {
209
209
  if (selection instanceof _state.NodeSelection && (0, _nodes.isMediaNode)(selection.node)) {
210
210
  return true;
211
211
  }
212
- if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof _state.TextSelection) {
212
+ if (selection instanceof _state.TextSelection && !((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
213
213
  if (!selection.empty) {
214
214
  return true;
215
215
  }
@@ -191,7 +191,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
191
191
  ACTION["SUGGESTION_INSERTED"] = "suggestionInserted";
192
192
  ACTION["SUGGESTION_DISMISSED"] = "suggestionDismissed";
193
193
  ACTION["SUGGESTION_VIEWED"] = "suggestionViewed";
194
- ACTION["INITIAL_EDITOR_WIDTH"] = "initialEditorWidth";
194
+ ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
195
195
  return ACTION;
196
196
  }({});
197
197
  export let INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
@@ -38,6 +38,7 @@ export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
38
38
  TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
39
39
  // Temporary to track usage of CONFCLOUD-78239 bug
40
40
  TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
41
+ TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
41
42
  return TABLE_ACTION;
42
43
  }({});
43
44
  export let TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "0.0.0-development";
4
+ const packageVersion = "109.11.4";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -1,8 +1,6 @@
1
1
  // Do this typedef to make it clear that
2
2
  // this is a local identifier for a resource for local use
3
3
 
4
- // Represents a SOURCE sync block within the editor.
5
-
6
4
  // A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
7
5
  // Supports create, read, update, and delete operations for sync blocks.
8
6
  // Designed to manage local in-memory state and synchronize with an external data provider.
@@ -13,6 +11,9 @@ export class SyncBlockStoreManager {
13
11
  this.syncBlocks = new Map();
14
12
  this.dataProvider = dataProvider;
15
13
  }
14
+ setEditorView(editorView) {
15
+ this.editorView = editorView;
16
+ }
16
17
  isSourceBlock(node) {
17
18
  var _this$syncBlocks$get;
18
19
  if (!this.dataProvider || node.type.name !== 'syncBlock') {
@@ -24,4 +25,27 @@ export class SyncBlockStoreManager {
24
25
  } = node.attrs;
25
26
  return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
26
27
  }
28
+ registerConfirmationCallback(callback) {
29
+ this.confirmationCallback = callback;
30
+ return () => {
31
+ this.confirmationCallback = undefined;
32
+ };
33
+ }
34
+ requireConfirmationBeforeDelete() {
35
+ return !!this.confirmationCallback;
36
+ }
37
+ async deleteSyncBlocksWithConfirmation(tr, syncBlockIds) {
38
+ if (this.confirmationCallback) {
39
+ const confirmed = await this.confirmationCallback();
40
+ if (confirmed) {
41
+ var _this$editorView;
42
+ // TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
43
+ (_this$editorView = this.editorView) === null || _this$editorView === void 0 ? void 0 : _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
44
+ // Need to update the BE on deletion
45
+ syncBlockIds.forEach(({
46
+ resourceId
47
+ }) => this.syncBlocks.delete(resourceId));
48
+ }
49
+ }
50
+ }
27
51
  }
@@ -7,7 +7,8 @@ export const EditorToolbarUIProvider = ({
7
7
  popupsMountPoint,
8
8
  popupsBoundariesElement,
9
9
  popupsScrollableElement,
10
- fireAnalyticsEvent
10
+ fireAnalyticsEvent,
11
+ keyboardNavigation
11
12
  }) => {
12
13
  const onDropdownOpenChanged = useCallback(({
13
14
  isOpen
@@ -29,6 +30,7 @@ export const EditorToolbarUIProvider = ({
29
30
  popupsMountPoint: popupsMountPoint,
30
31
  popupsBoundariesElement: popupsBoundariesElement,
31
32
  popupsScrollableElement: popupsScrollableElement,
32
- fireAnalyticsEvent: fireAnalyticsEvent
33
+ fireAnalyticsEvent: fireAnalyticsEvent,
34
+ keyboardNavigation: keyboardNavigation
33
35
  }, children);
34
36
  };
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "0.0.0-development";
17
+ const packageVersion = "109.11.4";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -186,7 +186,7 @@ function canMoveUp(state) {
186
186
  if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
187
187
  return true;
188
188
  }
189
- if (!expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof TextSelection) {
189
+ if (selection instanceof TextSelection && !(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
190
190
  if (!selection.empty) {
191
191
  return true;
192
192
  }
@@ -204,7 +204,7 @@ function canMoveDown(state) {
204
204
  if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
205
205
  return true;
206
206
  }
207
- if (!expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof TextSelection) {
207
+ if (selection instanceof TextSelection && !(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
208
208
  if (!selection.empty) {
209
209
  return true;
210
210
  }
@@ -191,7 +191,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
191
191
  ACTION["SUGGESTION_INSERTED"] = "suggestionInserted";
192
192
  ACTION["SUGGESTION_DISMISSED"] = "suggestionDismissed";
193
193
  ACTION["SUGGESTION_VIEWED"] = "suggestionViewed";
194
- ACTION["INITIAL_EDITOR_WIDTH"] = "initialEditorWidth";
194
+ ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
195
195
  return ACTION;
196
196
  }({});
197
197
  export var INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
@@ -38,6 +38,7 @@ export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
38
38
  TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
39
39
  // Temporary to track usage of CONFCLOUD-78239 bug
40
40
  TABLE_ACTION["TABLE_CELL_BACKGROUND_FIXED"] = "tableCellBackgroundFixed";
41
+ TABLE_ACTION["TABLE_WIDTH_INFO"] = "tableWidthInformation";
41
42
  return TABLE_ACTION;
42
43
  }({});
43
44
  export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "0.0.0-development";
10
+ var packageVersion = "109.11.4";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -1,10 +1,10 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
5
  // Do this typedef to make it clear that
4
6
  // this is a local identifier for a resource for local use
5
7
 
6
- // Represents a SOURCE sync block within the editor.
7
-
8
8
  // A store manager responsible for the lifecycle and state management of sync blocks in an editor instance.
9
9
  // Supports create, read, update, and delete operations for sync blocks.
10
10
  // Designed to manage local in-memory state and synchronize with an external data provider.
@@ -17,6 +17,11 @@ export var SyncBlockStoreManager = /*#__PURE__*/function () {
17
17
  this.dataProvider = dataProvider;
18
18
  }
19
19
  return _createClass(SyncBlockStoreManager, [{
20
+ key: "setEditorView",
21
+ value: function setEditorView(editorView) {
22
+ this.editorView = editorView;
23
+ }
24
+ }, {
20
25
  key: "isSourceBlock",
21
26
  value: function isSourceBlock(node) {
22
27
  var _this$syncBlocks$get;
@@ -28,5 +33,56 @@ export var SyncBlockStoreManager = /*#__PURE__*/function () {
28
33
  localId = _node$attrs.localId;
29
34
  return this.syncBlocks.has(resourceId) && ((_this$syncBlocks$get = this.syncBlocks.get(resourceId)) === null || _this$syncBlocks$get === void 0 ? void 0 : _this$syncBlocks$get.sourceLocalId) === localId;
30
35
  }
36
+ }, {
37
+ key: "registerConfirmationCallback",
38
+ value: function registerConfirmationCallback(callback) {
39
+ var _this = this;
40
+ this.confirmationCallback = callback;
41
+ return function () {
42
+ _this.confirmationCallback = undefined;
43
+ };
44
+ }
45
+ }, {
46
+ key: "requireConfirmationBeforeDelete",
47
+ value: function requireConfirmationBeforeDelete() {
48
+ return !!this.confirmationCallback;
49
+ }
50
+ }, {
51
+ key: "deleteSyncBlocksWithConfirmation",
52
+ value: function () {
53
+ var _deleteSyncBlocksWithConfirmation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(tr, syncBlockIds) {
54
+ var _this2 = this;
55
+ var confirmed, _this$editorView;
56
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
57
+ while (1) switch (_context.prev = _context.next) {
58
+ case 0:
59
+ if (!this.confirmationCallback) {
60
+ _context.next = 5;
61
+ break;
62
+ }
63
+ _context.next = 3;
64
+ return this.confirmationCallback();
65
+ case 3:
66
+ confirmed = _context.sent;
67
+ if (confirmed) {
68
+ // TODO: EDITOR-1779 - "rebase" the transaction to reflect the latest document state
69
+ (_this$editorView = this.editorView) === null || _this$editorView === void 0 || _this$editorView.dispatch(tr.setMeta('isConfirmedSyncBlockDeletion', true));
70
+ // Need to update the BE on deletion
71
+ syncBlockIds.forEach(function (_ref) {
72
+ var resourceId = _ref.resourceId;
73
+ return _this2.syncBlocks.delete(resourceId);
74
+ });
75
+ }
76
+ case 5:
77
+ case "end":
78
+ return _context.stop();
79
+ }
80
+ }, _callee, this);
81
+ }));
82
+ function deleteSyncBlocksWithConfirmation(_x, _x2) {
83
+ return _deleteSyncBlocksWithConfirmation.apply(this, arguments);
84
+ }
85
+ return deleteSyncBlocksWithConfirmation;
86
+ }()
31
87
  }]);
32
88
  }();
@@ -7,7 +7,8 @@ export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
7
7
  popupsMountPoint = _ref.popupsMountPoint,
8
8
  popupsBoundariesElement = _ref.popupsBoundariesElement,
9
9
  popupsScrollableElement = _ref.popupsScrollableElement,
10
- fireAnalyticsEvent = _ref.fireAnalyticsEvent;
10
+ fireAnalyticsEvent = _ref.fireAnalyticsEvent,
11
+ keyboardNavigation = _ref.keyboardNavigation;
11
12
  var onDropdownOpenChanged = useCallback(function (_ref2) {
12
13
  var isOpen = _ref2.isOpen;
13
14
  if (!isOpen) {
@@ -29,6 +30,7 @@ export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
29
30
  popupsMountPoint: popupsMountPoint,
30
31
  popupsBoundariesElement: popupsBoundariesElement,
31
32
  popupsScrollableElement: popupsScrollableElement,
32
- fireAnalyticsEvent: fireAnalyticsEvent
33
+ fireAnalyticsEvent: fireAnalyticsEvent,
34
+ keyboardNavigation: keyboardNavigation
33
35
  }, children);
34
36
  };
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "0.0.0-development";
24
+ var packageVersion = "109.11.4";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -180,7 +180,7 @@ function canMoveUp(state) {
180
180
  if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
181
181
  return true;
182
182
  }
183
- if (!expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof TextSelection) {
183
+ if (selection instanceof TextSelection && !(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
184
184
  if (!selection.empty) {
185
185
  return true;
186
186
  }
@@ -196,7 +196,7 @@ function canMoveDown(state) {
196
196
  if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
197
197
  return true;
198
198
  }
199
- if (!expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true) && selection instanceof TextSelection) {
199
+ if (selection instanceof TextSelection && !(expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true))) {
200
200
  if (!selection.empty) {
201
201
  return true;
202
202
  }
@@ -190,7 +190,7 @@ export declare enum ACTION {
190
190
  SUGGESTION_INSERTED = "suggestionInserted",
191
191
  SUGGESTION_DISMISSED = "suggestionDismissed",
192
192
  SUGGESTION_VIEWED = "suggestionViewed",
193
- INITIAL_EDITOR_WIDTH = "initialEditorWidth"
193
+ TABLE_WIDTH_INFO = "tableWidthInformation"
194
194
  }
195
195
  export declare enum INPUT_METHOD {
196
196
  ASCII = "ascii",
@@ -54,7 +54,6 @@ import type { TypeAheadPayload } from './type-ahead';
54
54
  import type { MediaUploadEventPayload } from './upload-media-events';
55
55
  import type { OperationalAEP, OperationalExposureAEP, TrackAEP } from './utils';
56
56
  import type { ViewEventPayload } from './view-events';
57
- import type { InitialEditorWidthPayload } from './width-events';
58
57
  type Dispatch<T = any> = (eventName: PluginKey | string, data: T) => void;
59
58
  export type SimplifiedNode = {
60
59
  content?: SimplifiedNode[];
@@ -63,7 +62,7 @@ export type SimplifiedNode = {
63
62
  pos: number;
64
63
  type: string;
65
64
  };
66
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | NcsSessionStepEventAEP | FloatingToolbarOverflowEventPayload | InitialEditorWidthPayload;
65
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | NcsSessionStepEventAEP | FloatingToolbarOverflowEventPayload;
67
66
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
68
67
  newColor: string;
69
68
  previousColor: string;
@@ -39,7 +39,8 @@ export declare enum TABLE_ACTION {
39
39
  ROW_OR_COLUMN_MOVED = "rowOrColumnMoved",
40
40
  CHANGED_DISPLAY_MODE = "changedDisplayMode",
41
41
  CHANGED_ALIGNMENT = "changedAlignment",
42
- TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed"
42
+ TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed",
43
+ TABLE_WIDTH_INFO = "tableWidthInformation"
43
44
  }
44
45
  export declare enum TABLE_BREAKOUT {
45
46
  WIDE = "wide",
@@ -205,5 +206,14 @@ type TableChangedAlignmentAEP = TableAEP<TABLE_ACTION.CHANGED_ALIGNMENT, {
205
206
  tableWidth: number | null;
206
207
  } & TotalRowAndColCount, undefined>;
207
208
  type TableBackgroundColorFixAEP = TableAEP<TABLE_ACTION.TABLE_CELL_BACKGROUND_FIXED, undefined, undefined>;
208
- export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP;
209
+ type TableWidthInfoAEP = TableAEP<TABLE_ACTION.TABLE_WIDTH_INFO, {
210
+ editorWidth: number;
211
+ mode: 'editor' | 'renderer';
212
+ tableWidthInfo: Array<{
213
+ hasScrollbar: boolean;
214
+ isNestedTable: boolean;
215
+ tableWidth: number;
216
+ }>;
217
+ }, undefined>;
218
+ export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP | TableWidthInfoAEP;
209
219
  export {};
@@ -1,6 +1,9 @@
1
1
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
5
  import type { SyncBlockDataProvider } from './types';
6
+ type ResourceId = string;
4
7
  export interface SyncBlock {
5
8
  /**
6
9
  * The local content of the block,
@@ -10,9 +13,21 @@ export interface SyncBlock {
10
13
  resourceId: string;
11
14
  sourceLocalId: string;
12
15
  }
16
+ type SyncBlockAttrs = {
17
+ localId: string;
18
+ resourceId: ResourceId;
19
+ };
20
+ type ConfirmationCallback = () => Promise<boolean>;
13
21
  export declare class SyncBlockStoreManager {
14
22
  private syncBlocks;
15
23
  private dataProvider?;
24
+ private confirmationCallback?;
25
+ private editorView?;
16
26
  constructor(dataProvider?: SyncBlockDataProvider);
27
+ setEditorView(editorView: EditorView | undefined): void;
17
28
  isSourceBlock(node: PMNode): boolean;
29
+ registerConfirmationCallback(callback: ConfirmationCallback): () => void;
30
+ requireConfirmationBeforeDelete(): boolean;
31
+ deleteSyncBlocksWithConfirmation(tr: Transaction, syncBlockIds: SyncBlockAttrs[]): Promise<void>;
18
32
  }
33
+ export {};
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ToolbarUIContextType } from '@atlaskit/editor-toolbar';
3
3
  import type { ExtractInjectionAPI, NextEditorPlugin } from '../types';
4
- type Props = Pick<ToolbarUIContextType, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement' | 'fireAnalyticsEvent'> & {
4
+ type Props = Pick<ToolbarUIContextType, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement' | 'fireAnalyticsEvent' | 'keyboardNavigation'> & {
5
5
  api: ExtractInjectionAPI<NextEditorPlugin<any, any>> | undefined;
6
6
  children: React.ReactNode;
7
7
  isDisabled?: boolean;
8
8
  };
9
- export declare const EditorToolbarUIProvider: ({ children, api, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, }: Props) => React.JSX.Element;
9
+ export declare const EditorToolbarUIProvider: ({ children, api, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, keyboardNavigation }: Props) => React.JSX.Element;
10
10
  export {};
@@ -190,7 +190,7 @@ export declare enum ACTION {
190
190
  SUGGESTION_INSERTED = "suggestionInserted",
191
191
  SUGGESTION_DISMISSED = "suggestionDismissed",
192
192
  SUGGESTION_VIEWED = "suggestionViewed",
193
- INITIAL_EDITOR_WIDTH = "initialEditorWidth"
193
+ TABLE_WIDTH_INFO = "tableWidthInformation"
194
194
  }
195
195
  export declare enum INPUT_METHOD {
196
196
  ASCII = "ascii",
@@ -54,7 +54,6 @@ import type { TypeAheadPayload } from './type-ahead';
54
54
  import type { MediaUploadEventPayload } from './upload-media-events';
55
55
  import type { OperationalAEP, OperationalExposureAEP, TrackAEP } from './utils';
56
56
  import type { ViewEventPayload } from './view-events';
57
- import type { InitialEditorWidthPayload } from './width-events';
58
57
  type Dispatch<T = any> = (eventName: PluginKey | string, data: T) => void;
59
58
  export type SimplifiedNode = {
60
59
  content?: SimplifiedNode[];
@@ -63,7 +62,7 @@ export type SimplifiedNode = {
63
62
  pos: number;
64
63
  type: string;
65
64
  };
66
- export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | NcsSessionStepEventAEP | FloatingToolbarOverflowEventPayload | InitialEditorWidthPayload;
65
+ export type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MoveContentEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | TextColorEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | HighlightActionsEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | OpenSettingsToolbarAEP | CustomPanelEventPayload | FeatureExposureAEP | NewCollabSyncUpErrorAEP | UnsupportedContentTooltipPayload | ReferentialityEventPayload | LoomEventPayload | MBEEventPayload | HighlightEventPayload | DatasourceClickedPayload | ElementEventPayload | VisitedLinkAEP | ViewEventPayload | MediaUploadEventPayload | MentionEventPayload | EngagementPlatformEventPayload | NestedTableActionsEventPayload | AICommandPaletteEventPayload | AIDefinitionsEventPayload | AIEventPayload | AIStreamingEventPayload | AIProactiveEventPayload | AIUnifiedEventPayload | BreakoutEventPayload | ActiveSessionEventPayload | AIInlineSuggestionPayload | SelectionExtensionEventPayload | TelepointerClickPayload | SelectionToolbarEventPayload | AlignmentEventPayload | UndoRedoAEP | OfflineEditingEventPayload | NcsSessionStepEventAEP | FloatingToolbarOverflowEventPayload;
67
66
  type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
68
67
  newColor: string;
69
68
  previousColor: string;
@@ -39,7 +39,8 @@ export declare enum TABLE_ACTION {
39
39
  ROW_OR_COLUMN_MOVED = "rowOrColumnMoved",
40
40
  CHANGED_DISPLAY_MODE = "changedDisplayMode",
41
41
  CHANGED_ALIGNMENT = "changedAlignment",
42
- TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed"
42
+ TABLE_CELL_BACKGROUND_FIXED = "tableCellBackgroundFixed",
43
+ TABLE_WIDTH_INFO = "tableWidthInformation"
43
44
  }
44
45
  export declare enum TABLE_BREAKOUT {
45
46
  WIDE = "wide",
@@ -205,5 +206,14 @@ type TableChangedAlignmentAEP = TableAEP<TABLE_ACTION.CHANGED_ALIGNMENT, {
205
206
  tableWidth: number | null;
206
207
  } & TotalRowAndColCount, undefined>;
207
208
  type TableBackgroundColorFixAEP = TableAEP<TABLE_ACTION.TABLE_CELL_BACKGROUND_FIXED, undefined, undefined>;
208
- export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP;
209
+ type TableWidthInfoAEP = TableAEP<TABLE_ACTION.TABLE_WIDTH_INFO, {
210
+ editorWidth: number;
211
+ mode: 'editor' | 'renderer';
212
+ tableWidthInfo: Array<{
213
+ hasScrollbar: boolean;
214
+ isNestedTable: boolean;
215
+ tableWidth: number;
216
+ }>;
217
+ }, undefined>;
218
+ export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableBackgroundColorFixAEP | TableChangedAlignmentAEP | TableWidthInfoAEP;
209
219
  export {};
@@ -1,6 +1,9 @@
1
1
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
5
  import type { SyncBlockDataProvider } from './types';
6
+ type ResourceId = string;
4
7
  export interface SyncBlock {
5
8
  /**
6
9
  * The local content of the block,
@@ -10,9 +13,21 @@ export interface SyncBlock {
10
13
  resourceId: string;
11
14
  sourceLocalId: string;
12
15
  }
16
+ type SyncBlockAttrs = {
17
+ localId: string;
18
+ resourceId: ResourceId;
19
+ };
20
+ type ConfirmationCallback = () => Promise<boolean>;
13
21
  export declare class SyncBlockStoreManager {
14
22
  private syncBlocks;
15
23
  private dataProvider?;
24
+ private confirmationCallback?;
25
+ private editorView?;
16
26
  constructor(dataProvider?: SyncBlockDataProvider);
27
+ setEditorView(editorView: EditorView | undefined): void;
17
28
  isSourceBlock(node: PMNode): boolean;
29
+ registerConfirmationCallback(callback: ConfirmationCallback): () => void;
30
+ requireConfirmationBeforeDelete(): boolean;
31
+ deleteSyncBlocksWithConfirmation(tr: Transaction, syncBlockIds: SyncBlockAttrs[]): Promise<void>;
18
32
  }
33
+ export {};
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ToolbarUIContextType } from '@atlaskit/editor-toolbar';
3
3
  import type { ExtractInjectionAPI, NextEditorPlugin } from '../types';
4
- type Props = Pick<ToolbarUIContextType, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement' | 'fireAnalyticsEvent'> & {
4
+ type Props = Pick<ToolbarUIContextType, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement' | 'fireAnalyticsEvent' | 'keyboardNavigation'> & {
5
5
  api: ExtractInjectionAPI<NextEditorPlugin<any, any>> | undefined;
6
6
  children: React.ReactNode;
7
7
  isDisabled?: boolean;
8
8
  };
9
- export declare const EditorToolbarUIProvider: ({ children, api, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, }: Props) => React.JSX.Element;
9
+ export declare const EditorToolbarUIProvider: ({ children, api, isDisabled, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, fireAnalyticsEvent, keyboardNavigation }: Props) => React.JSX.Element;
10
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "109.11.3",
3
+ "version": "109.12.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import type { ACTION, ACTION_SUBJECT } from './enums';
2
- import type { TrackAEP } from './utils';
3
- export type InitialEditorWidthPayload = TrackAEP<ACTION.INITIAL_EDITOR_WIDTH, ACTION_SUBJECT.EDITOR, undefined, {
4
- width: number;
5
- }, undefined>;
@@ -1,5 +0,0 @@
1
- import type { ACTION, ACTION_SUBJECT } from './enums';
2
- import type { TrackAEP } from './utils';
3
- export type InitialEditorWidthPayload = TrackAEP<ACTION.INITIAL_EDITOR_WIDTH, ACTION_SUBJECT.EDITOR, undefined, {
4
- width: number;
5
- }, undefined>;