@atlaskit/editor-common 80.3.0 → 80.4.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 (61) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/analytics/index.js +6 -0
  3. package/dist/cjs/analytics/types/index.js +6 -0
  4. package/dist/cjs/analytics/types/inline-comment-events.js +6 -1
  5. package/dist/cjs/mark/commands.js +30 -6
  6. package/dist/cjs/mark/index.js +6 -0
  7. package/dist/cjs/messages/panel.js +5 -0
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/ui/DropList/index.js +1 -1
  10. package/dist/cjs/ui/Mention/index.js +3 -1
  11. package/dist/cjs/ui/Mention/mention-with-profilecard.js +3 -1
  12. package/dist/cjs/ui/Mention/mention-with-providers.js +3 -1
  13. package/dist/es2019/analytics/index.js +1 -1
  14. package/dist/es2019/analytics/types/index.js +1 -1
  15. package/dist/es2019/analytics/types/inline-comment-events.js +5 -0
  16. package/dist/es2019/mark/commands.js +27 -0
  17. package/dist/es2019/mark/index.js +1 -1
  18. package/dist/es2019/messages/panel.js +5 -0
  19. package/dist/es2019/monitoring/error.js +1 -1
  20. package/dist/es2019/ui/DropList/index.js +1 -1
  21. package/dist/es2019/ui/Mention/index.js +3 -1
  22. package/dist/es2019/ui/Mention/mention-with-profilecard.js +3 -1
  23. package/dist/es2019/ui/Mention/mention-with-providers.js +3 -1
  24. package/dist/esm/analytics/index.js +1 -1
  25. package/dist/esm/analytics/types/index.js +1 -1
  26. package/dist/esm/analytics/types/inline-comment-events.js +5 -0
  27. package/dist/esm/mark/commands.js +29 -5
  28. package/dist/esm/mark/index.js +1 -1
  29. package/dist/esm/messages/panel.js +5 -0
  30. package/dist/esm/monitoring/error.js +1 -1
  31. package/dist/esm/ui/DropList/index.js +1 -1
  32. package/dist/esm/ui/Mention/index.js +3 -1
  33. package/dist/esm/ui/Mention/mention-with-profilecard.js +3 -1
  34. package/dist/esm/ui/Mention/mention-with-providers.js +3 -1
  35. package/dist/types/analytics/index.d.ts +1 -1
  36. package/dist/types/analytics/types/highlight-events.d.ts +5 -1
  37. package/dist/types/analytics/types/index.d.ts +1 -1
  38. package/dist/types/analytics/types/inline-comment-events.d.ts +4 -0
  39. package/dist/types/mark/commands.d.ts +4 -0
  40. package/dist/types/mark/index.d.ts +1 -1
  41. package/dist/types/messages/panel.d.ts +5 -0
  42. package/dist/types/types/annotation/emitter.d.ts +2 -0
  43. package/dist/types/types/annotation/index.d.ts +1 -0
  44. package/dist/types/types/feature-flags.d.ts +14 -6
  45. package/dist/types/ui/Mention/index.d.ts +1 -0
  46. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -1
  47. package/dist/types/ui/Mention/mention-with-providers.d.ts +4 -3
  48. package/dist/types-ts4.5/analytics/index.d.ts +1 -1
  49. package/dist/types-ts4.5/analytics/types/highlight-events.d.ts +5 -1
  50. package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
  51. package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +4 -0
  52. package/dist/types-ts4.5/mark/commands.d.ts +4 -0
  53. package/dist/types-ts4.5/mark/index.d.ts +1 -1
  54. package/dist/types-ts4.5/messages/panel.d.ts +5 -0
  55. package/dist/types-ts4.5/types/annotation/emitter.d.ts +2 -0
  56. package/dist/types-ts4.5/types/annotation/index.d.ts +1 -0
  57. package/dist/types-ts4.5/types/feature-flags.d.ts +14 -6
  58. package/dist/types-ts4.5/ui/Mention/index.d.ts +1 -0
  59. package/dist/types-ts4.5/ui/Mention/mention-with-profilecard.d.ts +2 -1
  60. package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +4 -3
  61. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 80.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#100662](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100662)
8
+ [`3d61cd8f2afe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3d61cd8f2afe) -
9
+ [ED-23355] Update annotation viewed event to with attributes nodeType and method to capture
10
+ usage for comments on media
11
+ - [#100495](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100495)
12
+ [`dbb78a011fac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbb78a011fac) -
13
+ [ux] [ED-23150] Added `changeColor` command for editor-plugin-highlight, including new
14
+ `removeMark` command for editor-common. Fixed bug with editor-plugin-text-color which prevented
15
+ color from being removed when user selects all.
16
+
17
+ ## 80.3.1
18
+
19
+ ### Patch Changes
20
+
21
+ - [#99825](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99825)
22
+ [`f48158a56833`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f48158a56833) -
23
+ ECA11Y-195 Add missing aria-label for panels group in the floating toolbar
24
+ - Updated dependencies
25
+
3
26
  ## 80.3.0
4
27
 
5
28
  ### Minor Changes
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "USER_CONTEXT", {
249
249
  return _types.USER_CONTEXT;
250
250
  }
251
251
  });
252
+ Object.defineProperty(exports, "VIEW_METHOD", {
253
+ enumerable: true,
254
+ get: function get() {
255
+ return _types.VIEW_METHOD;
256
+ }
257
+ });
252
258
  Object.defineProperty(exports, "buildEditLinkPayload", {
253
259
  enumerable: true,
254
260
  get: function get() {
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "USER_CONTEXT", {
249
249
  return _insertEvents.USER_CONTEXT;
250
250
  }
251
251
  });
252
+ Object.defineProperty(exports, "VIEW_METHOD", {
253
+ enumerable: true,
254
+ get: function get() {
255
+ return _inlineCommentEvents.VIEW_METHOD;
256
+ }
257
+ });
252
258
  var _enums = require("./enums");
253
259
  var _formatEvents = require("./format-events");
254
260
  var _substituteEvents = require("./substitute-events");
@@ -3,10 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RESOLVE_METHOD = void 0;
6
+ exports.VIEW_METHOD = exports.RESOLVE_METHOD = void 0;
7
7
  var RESOLVE_METHOD = exports.RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
8
8
  RESOLVE_METHOD["COMPONENT"] = "component";
9
9
  RESOLVE_METHOD["CONSUMER"] = "consumer";
10
10
  RESOLVE_METHOD["ORPHANED"] = "orphaned";
11
11
  return RESOLVE_METHOD;
12
+ }({});
13
+ var VIEW_METHOD = exports.VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
14
+ VIEW_METHOD["BADGE"] = "badge";
15
+ VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
16
+ return VIEW_METHOD;
12
17
  }({});
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.applyMarkOnRange = void 0;
7
7
  exports.filterChildrenBetween = filterChildrenBetween;
8
- exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = void 0;
8
+ exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = exports.removeMark = void 0;
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -138,7 +138,7 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
138
138
  return function (_ref2) {
139
139
  var tr = _ref2.tr;
140
140
  if (tr.selection instanceof _cellSelection.CellSelection) {
141
- var removeMark = true;
141
+ var _removeMark = true;
142
142
  var cells = [];
143
143
  tr.selection.forEachCell(function (cell, cellPos) {
144
144
  cells.push({
@@ -147,13 +147,13 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
147
147
  });
148
148
  var from = cellPos;
149
149
  var to = cellPos + cell.nodeSize;
150
- removeMark && (removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
150
+ _removeMark && (_removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
151
151
  });
152
152
  for (var i = cells.length - 1; i >= 0; i--) {
153
153
  var cell = cells[i];
154
154
  var from = cell.pos;
155
155
  var to = from + cell.node.nodeSize;
156
- applyMarkOnRange(from, to, removeMark, mark, tr);
156
+ applyMarkOnRange(from, to, _removeMark, mark, tr);
157
157
  }
158
158
  } else {
159
159
  var _tr$selection = tr.selection,
@@ -164,8 +164,8 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
164
164
  // Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
165
165
  // Scenario 2: Selection contains only bold text -> un-bold entire selection
166
166
  // Scenario 3: Selection contains no bold text -> bold entire selection
167
- var _removeMark = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
168
- applyMarkOnRange($from.pos, $to.pos, _removeMark, mark, tr);
167
+ var _removeMark2 = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
168
+ applyMarkOnRange($from.pos, $to.pos, _removeMark2, mark, tr);
169
169
  }
170
170
  if (tr.docChanged) {
171
171
  return tr;
@@ -198,4 +198,28 @@ var toggleMark = exports.toggleMark = function toggleMark(markType, attrs) {
198
198
  tr: tr
199
199
  });
200
200
  };
201
+ };
202
+
203
+ /**
204
+ * A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
205
+ */
206
+ var removeMark = exports.removeMark = function removeMark(mark) {
207
+ return function (_ref4) {
208
+ var tr = _ref4.tr;
209
+ var selection = tr.selection;
210
+ if (selection instanceof _cellSelection.CellSelection) {
211
+ selection.forEachCell(function (cell, cellPos) {
212
+ var from = cellPos;
213
+ var to = cellPos + cell.nodeSize;
214
+ tr.removeMark(from, to, mark);
215
+ });
216
+ } else if (selection instanceof _state.TextSelection && selection.$cursor) {
217
+ tr.removeStoredMark(mark);
218
+ } else {
219
+ var from = selection.from,
220
+ to = selection.to;
221
+ tr.removeMark(from, to, mark);
222
+ }
223
+ return tr;
224
+ };
201
225
  };
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "isMarkExcluded", {
33
33
  return _textFormatting.isMarkExcluded;
34
34
  }
35
35
  });
36
+ Object.defineProperty(exports, "removeMark", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _commands.removeMark;
40
+ }
41
+ });
36
42
  Object.defineProperty(exports, "toggleMark", {
37
43
  enumerable: true,
38
44
  get: function get() {
@@ -40,5 +40,10 @@ var panelMessages = exports.panelMessages = (0, _reactIntlNext.defineMessages)({
40
40
  id: 'fabric.editor.panel.backgroundColor',
41
41
  defaultMessage: 'Background color',
42
42
  description: 'Select the panel background color.'
43
+ },
44
+ panelsGroup: {
45
+ id: 'fabric.editor.panel.panelsGroup',
46
+ defaultMessage: 'Panel Types',
47
+ description: 'aria-label for group of panels the floating toolbar'
43
48
  }
44
49
  });
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 = "80.3.0";
19
+ var packageVersion = "80.4.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  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); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "80.3.0";
23
+ var packageVersion = "80.4.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -32,13 +32,15 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
32
32
  accessLevel = _this$props.accessLevel,
33
33
  eventHandlers = _this$props.eventHandlers,
34
34
  id = _this$props.id,
35
- text = _this$props.text;
35
+ text = _this$props.text,
36
+ localId = _this$props.localId;
36
37
  var mentionProvider = providers.mentionProvider,
37
38
  profilecardProvider = providers.profilecardProvider;
38
39
  return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.default, {
39
40
  id: id,
40
41
  text: text,
41
42
  accessLevel: accessLevel,
43
+ localId: localId,
42
44
  eventHandlers: eventHandlers,
43
45
  mentionProvider: mentionProvider,
44
46
  profilecardProvider: profilecardProvider
@@ -19,7 +19,8 @@ function MentionWithProfileCard(_ref) {
19
19
  profilecardProvider = _ref.profilecardProvider,
20
20
  onClick = _ref.onClick,
21
21
  onMouseEnter = _ref.onMouseEnter,
22
- onMouseLeave = _ref.onMouseLeave;
22
+ onMouseLeave = _ref.onMouseLeave,
23
+ localId = _ref.localId;
23
24
  var cloudId = profilecardProvider.cloudId,
24
25
  resourceClient = profilecardProvider.resourceClient;
25
26
  var actions = (0, _react.useMemo)(function () {
@@ -38,6 +39,7 @@ function MentionWithProfileCard(_ref) {
38
39
  id: id,
39
40
  text: text,
40
41
  accessLevel: accessLevel,
42
+ localId: localId,
41
43
  mentionProvider: mentionProvider,
42
44
  onClick: onClick,
43
45
  onMouseEnter: onMouseEnter,
@@ -82,7 +82,8 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
82
82
  eventHandlers = _this$props.eventHandlers,
83
83
  id = _this$props.id,
84
84
  mentionProvider = _this$props.mentionProvider,
85
- text = _this$props.text;
85
+ text = _this$props.text,
86
+ localId = _this$props.localId;
86
87
  var profilecardProvider = this.state.profilecardProvider;
87
88
  var actionHandlers = {};
88
89
  ['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
@@ -93,6 +94,7 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
93
94
  id: id,
94
95
  text: text,
95
96
  accessLevel: accessLevel,
97
+ localId: localId,
96
98
  mentionProvider: mentionProvider,
97
99
  profilecardProvider: profilecardProvider
98
100
  }, actionHandlers));
@@ -1,4 +1,4 @@
1
- export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE } from './types';
1
+ export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
2
2
  export { editorAnalyticsChannel, fireAnalyticsEvent } from './fire-analytics-event';
3
3
  export { getAnalyticsEventsFromTransaction } from './utils';
4
4
  export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
@@ -7,7 +7,7 @@ export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STAT
7
7
  export { PasteContents, PasteSources, PasteTypes } from './paste-events';
8
8
  export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS } from './list-events';
9
9
  export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './extension-events';
10
- export { RESOLVE_METHOD } from './inline-comment-events';
10
+ export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
11
11
  export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
12
12
  export { SmartLinkNodeContexts } from './smart-links';
13
13
  export { TOOLBAR_ACTION_SUBJECT_ID } from './toolbar-button';
@@ -3,4 +3,9 @@ export let RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
3
3
  RESOLVE_METHOD["CONSUMER"] = "consumer";
4
4
  RESOLVE_METHOD["ORPHANED"] = "orphaned";
5
5
  return RESOLVE_METHOD;
6
+ }({});
7
+ export let VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
8
+ VIEW_METHOD["BADGE"] = "badge";
9
+ VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
10
+ return VIEW_METHOD;
6
11
  }({});
@@ -205,4 +205,31 @@ export const toggleMark = (markType, attrs) => ({
205
205
  return toggleMarkInRange(mark)({
206
206
  tr
207
207
  });
208
+ };
209
+
210
+ /**
211
+ * A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
212
+ */
213
+ export const removeMark = mark => ({
214
+ tr
215
+ }) => {
216
+ const {
217
+ selection
218
+ } = tr;
219
+ if (selection instanceof CellSelection) {
220
+ selection.forEachCell((cell, cellPos) => {
221
+ const from = cellPos;
222
+ const to = cellPos + cell.nodeSize;
223
+ tr.removeMark(from, to, mark);
224
+ });
225
+ } else if (selection instanceof TextSelection && selection.$cursor) {
226
+ tr.removeStoredMark(mark);
227
+ } else {
228
+ const {
229
+ from,
230
+ to
231
+ } = selection;
232
+ tr.removeMark(from, to, mark);
233
+ }
234
+ return tr;
208
235
  };
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -34,5 +34,10 @@ export const panelMessages = defineMessages({
34
34
  id: 'fabric.editor.panel.backgroundColor',
35
35
  defaultMessage: 'Background color',
36
36
  description: 'Select the panel background color.'
37
+ },
38
+ panelsGroup: {
39
+ id: 'fabric.editor.panel.panelsGroup',
40
+ defaultMessage: 'Panel Types',
41
+ description: 'aria-label for group of panels the floating toolbar'
37
42
  }
38
43
  });
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "80.3.0";
3
+ const packageVersion = "80.4.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "80.3.0";
10
+ const packageVersion = "80.4.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -10,7 +10,8 @@ export default class Mention extends PureComponent {
10
10
  accessLevel,
11
11
  eventHandlers,
12
12
  id,
13
- text
13
+ text,
14
+ localId
14
15
  } = this.props;
15
16
  const {
16
17
  mentionProvider,
@@ -20,6 +21,7 @@ export default class Mention extends PureComponent {
20
21
  id: id,
21
22
  text: text,
22
23
  accessLevel: accessLevel,
24
+ localId: localId,
23
25
  eventHandlers: eventHandlers,
24
26
  mentionProvider: mentionProvider,
25
27
  profilecardProvider: profilecardProvider
@@ -9,7 +9,8 @@ export default function MentionWithProfileCard({
9
9
  profilecardProvider,
10
10
  onClick,
11
11
  onMouseEnter,
12
- onMouseLeave
12
+ onMouseLeave,
13
+ localId
13
14
  }) {
14
15
  const {
15
16
  cloudId,
@@ -29,6 +30,7 @@ export default function MentionWithProfileCard({
29
30
  id: id,
30
31
  text: text,
31
32
  accessLevel: accessLevel,
33
+ localId: localId,
32
34
  mentionProvider: mentionProvider,
33
35
  onClick: onClick,
34
36
  onMouseEnter: onMouseEnter,
@@ -47,7 +47,8 @@ export default class MentionWithProviders extends PureComponent {
47
47
  eventHandlers,
48
48
  id,
49
49
  mentionProvider,
50
- text
50
+ text,
51
+ localId
51
52
  } = this.props;
52
53
  const {
53
54
  profilecardProvider
@@ -61,6 +62,7 @@ export default class MentionWithProviders extends PureComponent {
61
62
  id: id,
62
63
  text: text,
63
64
  accessLevel: accessLevel,
65
+ localId: localId,
64
66
  mentionProvider: mentionProvider,
65
67
  profilecardProvider: profilecardProvider
66
68
  }, actionHandlers));
@@ -1,4 +1,4 @@
1
- export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE } from './types';
1
+ export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
2
2
  export { editorAnalyticsChannel, fireAnalyticsEvent } from './fire-analytics-event';
3
3
  export { getAnalyticsEventsFromTransaction } from './utils';
4
4
  export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
@@ -7,7 +7,7 @@ export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STAT
7
7
  export { PasteContents, PasteSources, PasteTypes } from './paste-events';
8
8
  export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS } from './list-events';
9
9
  export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './extension-events';
10
- export { RESOLVE_METHOD } from './inline-comment-events';
10
+ export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
11
11
  export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
12
12
  export { SmartLinkNodeContexts } from './smart-links';
13
13
  export { TOOLBAR_ACTION_SUBJECT_ID } from './toolbar-button';
@@ -3,4 +3,9 @@ export var RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
3
3
  RESOLVE_METHOD["CONSUMER"] = "consumer";
4
4
  RESOLVE_METHOD["ORPHANED"] = "orphaned";
5
5
  return RESOLVE_METHOD;
6
+ }({});
7
+ export var VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
8
+ VIEW_METHOD["BADGE"] = "badge";
9
+ VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
10
+ return VIEW_METHOD;
6
11
  }({});
@@ -130,7 +130,7 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
130
130
  return function (_ref2) {
131
131
  var tr = _ref2.tr;
132
132
  if (tr.selection instanceof CellSelection) {
133
- var removeMark = true;
133
+ var _removeMark = true;
134
134
  var cells = [];
135
135
  tr.selection.forEachCell(function (cell, cellPos) {
136
136
  cells.push({
@@ -139,13 +139,13 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
139
139
  });
140
140
  var from = cellPos;
141
141
  var to = cellPos + cell.nodeSize;
142
- removeMark && (removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
142
+ _removeMark && (_removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
143
143
  });
144
144
  for (var i = cells.length - 1; i >= 0; i--) {
145
145
  var cell = cells[i];
146
146
  var from = cell.pos;
147
147
  var to = from + cell.node.nodeSize;
148
- applyMarkOnRange(from, to, removeMark, mark, tr);
148
+ applyMarkOnRange(from, to, _removeMark, mark, tr);
149
149
  }
150
150
  } else {
151
151
  var _tr$selection = tr.selection,
@@ -156,8 +156,8 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
156
156
  // Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
157
157
  // Scenario 2: Selection contains only bold text -> un-bold entire selection
158
158
  // Scenario 3: Selection contains no bold text -> bold entire selection
159
- var _removeMark = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
160
- applyMarkOnRange($from.pos, $to.pos, _removeMark, mark, tr);
159
+ var _removeMark2 = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
160
+ applyMarkOnRange($from.pos, $to.pos, _removeMark2, mark, tr);
161
161
  }
162
162
  if (tr.docChanged) {
163
163
  return tr;
@@ -190,4 +190,28 @@ export var toggleMark = function toggleMark(markType, attrs) {
190
190
  tr: tr
191
191
  });
192
192
  };
193
+ };
194
+
195
+ /**
196
+ * A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
197
+ */
198
+ export var removeMark = function removeMark(mark) {
199
+ return function (_ref4) {
200
+ var tr = _ref4.tr;
201
+ var selection = tr.selection;
202
+ if (selection instanceof CellSelection) {
203
+ selection.forEachCell(function (cell, cellPos) {
204
+ var from = cellPos;
205
+ var to = cellPos + cell.nodeSize;
206
+ tr.removeMark(from, to, mark);
207
+ });
208
+ } else if (selection instanceof TextSelection && selection.$cursor) {
209
+ tr.removeStoredMark(mark);
210
+ } else {
211
+ var from = selection.from,
212
+ to = selection.to;
213
+ tr.removeMark(from, to, mark);
214
+ }
215
+ return tr;
216
+ };
193
217
  };
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
@@ -34,5 +34,10 @@ export var panelMessages = defineMessages({
34
34
  id: 'fabric.editor.panel.backgroundColor',
35
35
  defaultMessage: 'Background color',
36
36
  description: 'Select the panel background color.'
37
+ },
38
+ panelsGroup: {
39
+ id: 'fabric.editor.panel.panelsGroup',
40
+ defaultMessage: 'Panel Types',
41
+ description: 'aria-label for group of panels the floating toolbar'
37
42
  }
38
43
  });
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "80.3.0";
9
+ var packageVersion = "80.4.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
15
15
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
16
16
  import Layer from '../Layer';
17
17
  var packageName = "@atlaskit/editor-common";
18
- var packageVersion = "80.3.0";
18
+ var packageVersion = "80.4.0";
19
19
  var halfFocusRing = 1;
20
20
  var dropOffset = '0, 8';
21
21
  var DropList = /*#__PURE__*/function (_Component) {
@@ -22,13 +22,15 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
22
22
  accessLevel = _this$props.accessLevel,
23
23
  eventHandlers = _this$props.eventHandlers,
24
24
  id = _this$props.id,
25
- text = _this$props.text;
25
+ text = _this$props.text,
26
+ localId = _this$props.localId;
26
27
  var mentionProvider = providers.mentionProvider,
27
28
  profilecardProvider = providers.profilecardProvider;
28
29
  return /*#__PURE__*/React.createElement(MentionWithProviders, {
29
30
  id: id,
30
31
  text: text,
31
32
  accessLevel: accessLevel,
33
+ localId: localId,
32
34
  eventHandlers: eventHandlers,
33
35
  mentionProvider: mentionProvider,
34
36
  profilecardProvider: profilecardProvider
@@ -9,7 +9,8 @@ export default function MentionWithProfileCard(_ref) {
9
9
  profilecardProvider = _ref.profilecardProvider,
10
10
  onClick = _ref.onClick,
11
11
  onMouseEnter = _ref.onMouseEnter,
12
- onMouseLeave = _ref.onMouseLeave;
12
+ onMouseLeave = _ref.onMouseLeave,
13
+ localId = _ref.localId;
13
14
  var cloudId = profilecardProvider.cloudId,
14
15
  resourceClient = profilecardProvider.resourceClient;
15
16
  var actions = useMemo(function () {
@@ -28,6 +29,7 @@ export default function MentionWithProfileCard(_ref) {
28
29
  id: id,
29
30
  text: text,
30
31
  accessLevel: accessLevel,
32
+ localId: localId,
31
33
  mentionProvider: mentionProvider,
32
34
  onClick: onClick,
33
35
  onMouseEnter: onMouseEnter,
@@ -72,7 +72,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
72
72
  eventHandlers = _this$props.eventHandlers,
73
73
  id = _this$props.id,
74
74
  mentionProvider = _this$props.mentionProvider,
75
- text = _this$props.text;
75
+ text = _this$props.text,
76
+ localId = _this$props.localId;
76
77
  var profilecardProvider = this.state.profilecardProvider;
77
78
  var actionHandlers = {};
78
79
  ['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
@@ -83,6 +84,7 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
83
84
  id: id,
84
85
  text: text,
85
86
  accessLevel: accessLevel,
87
+ localId: localId,
86
88
  mentionProvider: mentionProvider,
87
89
  profilecardProvider: profilecardProvider
88
90
  }, actionHandlers));
@@ -1,4 +1,4 @@
1
- export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, } from './types';
1
+ export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
2
2
  export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, OverflowStateInfo, } from './types';
3
3
  export type { EditorAnalyticsAPI } from './api';
4
4
  export { editorAnalyticsChannel, fireAnalyticsEvent, } from './fire-analytics-event';
@@ -1,4 +1,8 @@
1
1
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
2
  import type { TrackAEP } from './utils';
3
3
  export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED, ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, undefined, undefined>;
4
- export type HighlightEventPayload = HighlightToolbarToggleAEP;
4
+ export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
5
+ newColor: string;
6
+ previousColor: string;
7
+ }, undefined>;
8
+ export type HighlightEventPayload = HighlightToolbarToggleAEP | HighlightTextAEP;
@@ -21,7 +21,7 @@ export type { TextColorSelectedAttr, TextColorSelectedAEP, TextColorShowPaletteT
21
21
  export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE, } from './extension-events';
22
22
  export type { SelectionJson, ExtensionType, ExtensionEventPayload, } from './extension-events';
23
23
  export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './inline-comment-events';
24
- export { RESOLVE_METHOD } from './inline-comment-events';
24
+ export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
25
25
  export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
26
26
  export type { NodeEventPayload } from './node-events';
27
27
  export type { SelectNodeAEP, SelectRangeAEP, SelectAllAEP, SelectCellAEP, SelectionEventPayload, } from './selection-events';
@@ -15,3 +15,7 @@ export declare enum RESOLVE_METHOD {
15
15
  CONSUMER = "consumer",
16
16
  ORPHANED = "orphaned"
17
17
  }
18
+ export declare enum VIEW_METHOD {
19
+ BADGE = "badge",
20
+ COMMENT_BUTTON = "commentButton"
21
+ }
@@ -16,3 +16,7 @@ export declare const applyMarkOnRange: (from: number, to: number, removeMark: bo
16
16
  export declare const toggleMark: (markType: MarkType, attrs?: {
17
17
  [key: string]: any;
18
18
  } | undefined) => EditorCommand;
19
+ /**
20
+ * A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
21
+ */
22
+ export declare const removeMark: (mark: MarkType | Mark) => EditorCommand;
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -34,4 +34,9 @@ export declare const panelMessages: {
34
34
  defaultMessage: string;
35
35
  description: string;
36
36
  };
37
+ panelsGroup: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
37
42
  };
@@ -15,6 +15,8 @@ type SetFocusPayload = Record<'annotationId', AnnotationId>;
15
15
  export type OnAnnotationClickPayload = {
16
16
  annotationIds: Array<AnnotationId>;
17
17
  eventTarget: HTMLElement;
18
+ eventTargetType?: string;
19
+ viewMethod?: string;
18
20
  };
19
21
  type SetStatePayload = Record<AnnotationId, AnnotationState<AnnotationTypes.INLINE_COMMENT>>;
20
22
  export type AnnotationUpdateEventPayloads = {
@@ -126,6 +126,7 @@ interface AnnotationTypeProvider<Type> {
126
126
  allowCommentsOnMedia?: boolean;
127
127
  isCommentsOnMediaBugFixEnabled?: boolean;
128
128
  isCommentsOnMediaBugVideoCommentEnabled?: boolean;
129
+ isCommentsOnMediaAnalyticsEnabled?: boolean;
129
130
  }
130
131
  export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
131
132
  selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
@@ -246,13 +246,21 @@ export type FeatureFlags = {
246
246
  */
247
247
  macroInteractionUpdates?: boolean;
248
248
  /**
249
- * @description
250
- * Enables bug fix on media comments
251
- *
252
- // * @see https://product-fabric.atlassian.net/browse/ED-23093
253
- * @default false
254
- */
249
+ * @description
250
+ * Enables bug fix on media comments
251
+ *
252
+ // * @see https://product-fabric.atlassian.net/browse/ED-23093
253
+ * @default false
254
+ */
255
255
  commentsOnMediaBugFix?: boolean;
256
+ /**
257
+ * @description
258
+ * Enables extra analytics to be added for comments on media
259
+ *
260
+ * @see https://product-fabric.atlassian.net/browse/ED-23355
261
+ * @default false
262
+ */
263
+ commentsOnMediaAnalytics?: boolean;
256
264
  };
257
265
  export type FeatureFlagKey = keyof FeatureFlags;
258
266
  export type GetEditorFeatureFlags = () => FeatureFlags;
@@ -8,6 +8,7 @@ export interface MentionProps {
8
8
  eventHandlers?: MentionEventHandlers;
9
9
  text: string;
10
10
  accessLevel?: string;
11
+ localId?: string;
11
12
  }
12
13
  export interface MentionState {
13
14
  profilecardProvider: ProfilecardProvider | null;
@@ -11,5 +11,6 @@ export interface Props {
11
11
  onClick?: MentionEventHandler;
12
12
  onMouseEnter?: MentionEventHandler;
13
13
  onMouseLeave?: MentionEventHandler;
14
+ localId?: string;
14
15
  }
15
- export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, }: Props): JSX.Element;
16
+ export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { PureComponent } from 'react';
2
- import { MentionProvider } from '@atlaskit/mention/resource';
3
- import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
- import { MentionEventHandlers } from '../EventHandlers';
2
+ import type { MentionProvider } from '@atlaskit/mention/resource';
3
+ import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
+ import type { MentionEventHandlers } from '../EventHandlers';
5
5
  export interface Props {
6
6
  id: string;
7
7
  text: string;
@@ -9,6 +9,7 @@ export interface Props {
9
9
  mentionProvider?: Promise<MentionProvider>;
10
10
  profilecardProvider?: Promise<ProfilecardProvider>;
11
11
  eventHandlers?: MentionEventHandlers;
12
+ localId?: string;
12
13
  }
13
14
  export interface State {
14
15
  profilecardProvider: ProfilecardProvider | null;
@@ -1,4 +1,4 @@
1
- export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, } from './types';
1
+ export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
2
2
  export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, OverflowStateInfo, } from './types';
3
3
  export type { EditorAnalyticsAPI } from './api';
4
4
  export { editorAnalyticsChannel, fireAnalyticsEvent, } from './fire-analytics-event';
@@ -1,4 +1,8 @@
1
1
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
2
2
  import type { TrackAEP } from './utils';
3
3
  export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED, ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, undefined, undefined>;
4
- export type HighlightEventPayload = HighlightToolbarToggleAEP;
4
+ export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
5
+ newColor: string;
6
+ previousColor: string;
7
+ }, undefined>;
8
+ export type HighlightEventPayload = HighlightToolbarToggleAEP | HighlightTextAEP;
@@ -21,7 +21,7 @@ export type { TextColorSelectedAttr, TextColorSelectedAEP, TextColorShowPaletteT
21
21
  export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE, } from './extension-events';
22
22
  export type { SelectionJson, ExtensionType, ExtensionEventPayload, } from './extension-events';
23
23
  export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './inline-comment-events';
24
- export { RESOLVE_METHOD } from './inline-comment-events';
24
+ export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
25
25
  export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
26
26
  export type { NodeEventPayload } from './node-events';
27
27
  export type { SelectNodeAEP, SelectRangeAEP, SelectAllAEP, SelectCellAEP, SelectionEventPayload, } from './selection-events';
@@ -15,3 +15,7 @@ export declare enum RESOLVE_METHOD {
15
15
  CONSUMER = "consumer",
16
16
  ORPHANED = "orphaned"
17
17
  }
18
+ export declare enum VIEW_METHOD {
19
+ BADGE = "badge",
20
+ COMMENT_BUTTON = "commentButton"
21
+ }
@@ -16,3 +16,7 @@ export declare const applyMarkOnRange: (from: number, to: number, removeMark: bo
16
16
  export declare const toggleMark: (markType: MarkType, attrs?: {
17
17
  [key: string]: any;
18
18
  } | undefined) => EditorCommand;
19
+ /**
20
+ * A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
21
+ */
22
+ export declare const removeMark: (mark: MarkType | Mark) => EditorCommand;
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
2
2
  export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
@@ -34,4 +34,9 @@ export declare const panelMessages: {
34
34
  defaultMessage: string;
35
35
  description: string;
36
36
  };
37
+ panelsGroup: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
37
42
  };
@@ -15,6 +15,8 @@ type SetFocusPayload = Record<'annotationId', AnnotationId>;
15
15
  export type OnAnnotationClickPayload = {
16
16
  annotationIds: Array<AnnotationId>;
17
17
  eventTarget: HTMLElement;
18
+ eventTargetType?: string;
19
+ viewMethod?: string;
18
20
  };
19
21
  type SetStatePayload = Record<AnnotationId, AnnotationState<AnnotationTypes.INLINE_COMMENT>>;
20
22
  export type AnnotationUpdateEventPayloads = {
@@ -126,6 +126,7 @@ interface AnnotationTypeProvider<Type> {
126
126
  allowCommentsOnMedia?: boolean;
127
127
  isCommentsOnMediaBugFixEnabled?: boolean;
128
128
  isCommentsOnMediaBugVideoCommentEnabled?: boolean;
129
+ isCommentsOnMediaAnalyticsEnabled?: boolean;
129
130
  }
130
131
  export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
131
132
  selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
@@ -246,13 +246,21 @@ export type FeatureFlags = {
246
246
  */
247
247
  macroInteractionUpdates?: boolean;
248
248
  /**
249
- * @description
250
- * Enables bug fix on media comments
251
- *
252
- // * @see https://product-fabric.atlassian.net/browse/ED-23093
253
- * @default false
254
- */
249
+ * @description
250
+ * Enables bug fix on media comments
251
+ *
252
+ // * @see https://product-fabric.atlassian.net/browse/ED-23093
253
+ * @default false
254
+ */
255
255
  commentsOnMediaBugFix?: boolean;
256
+ /**
257
+ * @description
258
+ * Enables extra analytics to be added for comments on media
259
+ *
260
+ * @see https://product-fabric.atlassian.net/browse/ED-23355
261
+ * @default false
262
+ */
263
+ commentsOnMediaAnalytics?: boolean;
256
264
  };
257
265
  export type FeatureFlagKey = keyof FeatureFlags;
258
266
  export type GetEditorFeatureFlags = () => FeatureFlags;
@@ -8,6 +8,7 @@ export interface MentionProps {
8
8
  eventHandlers?: MentionEventHandlers;
9
9
  text: string;
10
10
  accessLevel?: string;
11
+ localId?: string;
11
12
  }
12
13
  export interface MentionState {
13
14
  profilecardProvider: ProfilecardProvider | null;
@@ -11,5 +11,6 @@ export interface Props {
11
11
  onClick?: MentionEventHandler;
12
12
  onMouseEnter?: MentionEventHandler;
13
13
  onMouseLeave?: MentionEventHandler;
14
+ localId?: string;
14
15
  }
15
- export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, }: Props): JSX.Element;
16
+ export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { PureComponent } from 'react';
2
- import { MentionProvider } from '@atlaskit/mention/resource';
3
- import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
- import { MentionEventHandlers } from '../EventHandlers';
2
+ import type { MentionProvider } from '@atlaskit/mention/resource';
3
+ import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
4
+ import type { MentionEventHandlers } from '../EventHandlers';
5
5
  export interface Props {
6
6
  id: string;
7
7
  text: string;
@@ -9,6 +9,7 @@ export interface Props {
9
9
  mentionProvider?: Promise<MentionProvider>;
10
10
  profilecardProvider?: Promise<ProfilecardProvider>;
11
11
  eventHandlers?: MentionEventHandlers;
12
+ localId?: string;
12
13
  }
13
14
  export interface State {
14
15
  profilecardProvider: ProfilecardProvider | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "80.3.0",
3
+ "version": "80.4.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/"
@@ -127,7 +127,7 @@
127
127
  "@atlaskit/media-ui": "^25.10.0",
128
128
  "@atlaskit/media-viewer": "48.5.4",
129
129
  "@atlaskit/mention": "^23.0.0",
130
- "@atlaskit/menu": "^2.2.0",
130
+ "@atlaskit/menu": "^2.3.0",
131
131
  "@atlaskit/platform-feature-flags": "^0.2.0",
132
132
  "@atlaskit/primitives": "^6.2.0",
133
133
  "@atlaskit/profilecard": "^19.13.0",