@atlaskit/editor-common 111.8.6 → 111.8.8

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 (64) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/afm-jira/tsconfig.json +1 -1
  3. package/dist/cjs/analytics/types/enums.js +12 -0
  4. package/dist/cjs/experiences/consts.js +9 -2
  5. package/dist/cjs/experiences/experience-utils.js +16 -1
  6. package/dist/cjs/experiences/index.js +12 -0
  7. package/dist/cjs/experiences/types.js +15 -1
  8. package/dist/cjs/extensibility/Extension/Extension/index.js +3 -2
  9. package/dist/cjs/link/LinkSearch/index.js +2 -1
  10. package/dist/cjs/monitoring/error.js +1 -1
  11. package/dist/cjs/selection/index.js +6 -0
  12. package/dist/cjs/selection/utils.js +36 -1
  13. package/dist/cjs/ui/DropList/index.js +1 -1
  14. package/dist/es2019/analytics/types/enums.js +12 -0
  15. package/dist/es2019/experiences/consts.js +8 -1
  16. package/dist/es2019/experiences/experience-utils.js +13 -0
  17. package/dist/es2019/experiences/index.js +2 -2
  18. package/dist/es2019/experiences/types.js +14 -0
  19. package/dist/es2019/extensibility/Extension/Extension/index.js +3 -2
  20. package/dist/es2019/link/LinkSearch/index.js +2 -1
  21. package/dist/es2019/monitoring/error.js +1 -1
  22. package/dist/es2019/selection/index.js +1 -1
  23. package/dist/es2019/selection/utils.js +32 -0
  24. package/dist/es2019/ui/DropList/index.js +1 -1
  25. package/dist/esm/analytics/types/enums.js +12 -0
  26. package/dist/esm/experiences/consts.js +8 -1
  27. package/dist/esm/experiences/experience-utils.js +15 -0
  28. package/dist/esm/experiences/index.js +2 -2
  29. package/dist/esm/experiences/types.js +14 -0
  30. package/dist/esm/extensibility/Extension/Extension/index.js +3 -2
  31. package/dist/esm/link/LinkSearch/index.js +2 -1
  32. package/dist/esm/monitoring/error.js +1 -1
  33. package/dist/esm/selection/index.js +1 -1
  34. package/dist/esm/selection/utils.js +32 -0
  35. package/dist/esm/ui/DropList/index.js +1 -1
  36. package/dist/types/analytics/types/ai-streaming.d.ts +2 -0
  37. package/dist/types/analytics/types/enums.d.ts +12 -0
  38. package/dist/types/analytics/types/sync-block-events.d.ts +14 -2
  39. package/dist/types/analytics/types/utils.d.ts +1 -0
  40. package/dist/types/experiences/Experience.d.ts +2 -2
  41. package/dist/types/experiences/consts.d.ts +7 -0
  42. package/dist/types/experiences/experience-utils.d.ts +7 -0
  43. package/dist/types/experiences/index.d.ts +2 -2
  44. package/dist/types/experiences/types.d.ts +4 -1
  45. package/dist/types/extensibility/Extension/Extension/index.d.ts +58 -58
  46. package/dist/types/link/LinkSearch/index.d.ts +43 -41
  47. package/dist/types/selection/index.d.ts +1 -1
  48. package/dist/types/selection/utils.d.ts +19 -0
  49. package/dist/types/utils/browser.d.ts +2 -1
  50. package/dist/types-ts4.5/analytics/types/ai-streaming.d.ts +2 -0
  51. package/dist/types-ts4.5/analytics/types/enums.d.ts +12 -0
  52. package/dist/types-ts4.5/analytics/types/sync-block-events.d.ts +14 -2
  53. package/dist/types-ts4.5/analytics/types/utils.d.ts +1 -0
  54. package/dist/types-ts4.5/experiences/Experience.d.ts +2 -2
  55. package/dist/types-ts4.5/experiences/consts.d.ts +7 -0
  56. package/dist/types-ts4.5/experiences/experience-utils.d.ts +7 -0
  57. package/dist/types-ts4.5/experiences/index.d.ts +2 -2
  58. package/dist/types-ts4.5/experiences/types.d.ts +4 -1
  59. package/dist/types-ts4.5/extensibility/Extension/Extension/index.d.ts +58 -58
  60. package/dist/types-ts4.5/link/LinkSearch/index.d.ts +43 -41
  61. package/dist/types-ts4.5/selection/index.d.ts +1 -1
  62. package/dist/types-ts4.5/selection/utils.d.ts +19 -0
  63. package/dist/types-ts4.5/utils/browser.d.ts +2 -1
  64. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.8.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7f41011a1b0ff`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f41011a1b0ff) -
8
+ EDITOR-1665 update sync block experience events to use general experience ids, keep existing error
9
+ events and add success events
10
+ - Updated dependencies
11
+
12
+ ## 111.8.7
13
+
14
+ ### Patch Changes
15
+
16
+ - [`d34e6bd1197a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d34e6bd1197a5) -
17
+ EDITOR-4178 update document inserted event to have is inside synced block attribute
18
+ - [`e04e057af7743`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e04e057af7743) -
19
+ Adds scrubbed localId and commands to analytics to help narrow root cause issues.
20
+ - Updated dependencies
21
+
3
22
  ## 111.8.6
4
23
 
5
24
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.jira.json",
2
+ "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
5
  "target": "es5",
@@ -66,6 +66,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
66
66
  ACTION["EXPERIENCE_MEASURED"] = "experienceMeasured";
67
67
  ACTION["EXPERIENCE_SAMPLED"] = "experienceSampled";
68
68
  ACTION["EXPOSED"] = "exposed";
69
+ ACTION["FETCHED"] = "fetched";
69
70
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
70
71
  ACTION["FAILED_TO_INSERT"] = "failedToInsert";
71
72
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
@@ -108,6 +109,8 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
108
109
  ACTION["PRESSED"] = "pressed";
109
110
  ACTION["PROSEMIRROR_RENDERED"] = "proseMirrorRendered";
110
111
  ACTION["REACT_NODEVIEW_RENDERED"] = "reactNodeViewRendered";
112
+ ACTION["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
113
+ ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
111
114
  ACTION["REPLACED_ALL"] = "replacedAll";
112
115
  ACTION["REPLACED_ONE"] = "replacedOne";
113
116
  ACTION["RESOLVED"] = "resolved";
@@ -119,6 +122,11 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
119
122
  ACTION["STOPPED"] = "stopped";
120
123
  ACTION["SUBMITTED"] = "submitted";
121
124
  ACTION["SUBSTITUTED"] = "autoSubstituted";
125
+ ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
126
+ ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
127
+ ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
128
+ ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
129
+ ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
122
130
  ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
123
131
  ACTION["SYNCHRONY_ENTITY_ERROR"] = "synchronyEntityError";
124
132
  ACTION["SYNCHRONY_ERROR"] = "synchronyError";
@@ -371,6 +379,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
371
379
  ACTION_SUBJECT_ID["ALT_TEXT"] = "altText";
372
380
  ACTION_SUBJECT_ID["ANNOTATE_BUTTON"] = "annotateButton";
373
381
  ACTION_SUBJECT_ID["AVATAR_GROUP_PLUGIN"] = "AvatarGroupInPlugin";
382
+ ACTION_SUBJECT_ID["BLOCK_MENU"] = "blockMenu";
374
383
  ACTION_SUBJECT_ID["BLOCK_QUOTE"] = "blockQuote";
375
384
  ACTION_SUBJECT_ID["BORDER"] = "border";
376
385
  ACTION_SUBJECT_ID["BUTTON_CATEGORY"] = "categoryButton";
@@ -485,10 +494,12 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
485
494
  ACTION_SUBJECT_ID["PLACEHOLDER_TEXT"] = "placeholderText";
486
495
  ACTION_SUBJECT_ID["POST_QUERY_SEARCH_RESULTS"] = "postQuerySearchResults";
487
496
  ACTION_SUBJECT_ID["PRE_QUERY_SEARCH_RESULTS"] = "preQuerySearchResults";
497
+ ACTION_SUBJECT_ID["PRIMARY_TOOLBAR"] = "primaryToolbar";
488
498
  ACTION_SUBJECT_ID["PROACTIVE_SUGGESTION"] = "proactiveSuggestion";
489
499
  ACTION_SUBJECT_ID["PRODUCT_NAME"] = "productName";
490
500
  ACTION_SUBJECT_ID["PUNC"] = "punctuation";
491
501
  ACTION_SUBJECT_ID["QUICK_SEARCH"] = "quickSearch";
502
+ ACTION_SUBJECT_ID["QUICK_INSERT"] = "quickInsert";
492
503
  ACTION_SUBJECT_ID["RANGE"] = "range";
493
504
  ACTION_SUBJECT_ID["REACT_NODE_VIEW"] = "reactNodeView";
494
505
  ACTION_SUBJECT_ID["RECENT_ACTIVITIES"] = "recentActivities";
@@ -528,6 +539,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
528
539
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_ITEM"] = "editorPluginSelectionExtensionItem";
529
540
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_COMPONENT"] = "editorPluginSelectionExtensionComponent";
530
541
  ACTION_SUBJECT_ID["TRANSFORM"] = "transform";
542
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_TOOLBAR"] = "syncedBlockToolbar";
531
543
  ACTION_SUBJECT_ID["SYNCED_BLOCK_SOURCE_URL"] = "syncedBlockSourceUrl";
532
544
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE_CACHE"] = "syncedBlockUpdateCache";
533
545
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EXPERIENCE_FAILURE_REASON = exports.EXPERIENCE_ABORT_REASON = exports.DEFAULT_EXPERIENCE_SAMPLE_RATE = void 0;
6
+ exports.EXPERIENCE_ID = exports.EXPERIENCE_FAILURE_REASON = exports.EXPERIENCE_ABORT_REASON = exports.DEFAULT_EXPERIENCE_SAMPLE_RATE = void 0;
7
7
  /**
8
8
  * Built-in failure reasons for experience checks
9
9
  *
@@ -48,4 +48,11 @@ var EXPERIENCE_ABORT_REASON = exports.EXPERIENCE_ABORT_REASON = {
48
48
  * The expectation is that measurements will be gathered after initial
49
49
  * instrumentation, then the sample rate can be tuned up to a safe threshold.
50
50
  */
51
- var DEFAULT_EXPERIENCE_SAMPLE_RATE = exports.DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
51
+ var DEFAULT_EXPERIENCE_SAMPLE_RATE = exports.DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
52
+ var EXPERIENCE_ID = exports.EXPERIENCE_ID = {
53
+ ASYNC_OPERATION: 'asyncOperation',
54
+ MENU_ACTION: 'menuAction',
55
+ MENU_OPEN: 'menu-open',
56
+ TOOLBAR_ACTION: 'toolbarAction',
57
+ TOOLBAR_OPEN: 'toolbar-open'
58
+ };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.popupWithNestedElement = exports.getPopupContainerFromEditorView = exports.containsPopupWithNestedElement = void 0;
6
+ exports.popupWithNestedElement = exports.getPopupContainerFromEditorView = exports.getNodeQuery = exports.containsPopupWithNestedElement = void 0;
7
7
  /**
8
8
  * Checks if a given node contains a popup with a nested element identified by a specific test ID.
9
9
  *
@@ -56,4 +56,19 @@ var getPopupContainerFromEditorView = exports.getPopupContainerFromEditorView =
56
56
  var editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
57
57
  var pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
58
58
  return pluginsComponentsWrapper || undefined;
59
+ };
60
+
61
+ /**
62
+ * Checks if a node matches or contains the node given by the provided query css selector
63
+ *
64
+ * @param query - CSS selector string
65
+ * @returns true if node matches or contains query or false otherwise
66
+ */
67
+ var getNodeQuery = exports.getNodeQuery = function getNodeQuery(query) {
68
+ return function (node) {
69
+ if (!node || !(node instanceof Element)) {
70
+ return false;
71
+ }
72
+ return node.matches(query) || node.querySelector(query) !== null;
73
+ };
59
74
  };
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "EXPERIENCE_FAILURE_REASON", {
15
15
  return _consts.EXPERIENCE_FAILURE_REASON;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "EXPERIENCE_ID", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _consts.EXPERIENCE_ID;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "Experience", {
19
25
  enumerable: true,
20
26
  get: function get() {
@@ -45,6 +51,12 @@ Object.defineProperty(exports, "containsPopupWithNestedElement", {
45
51
  return _experienceUtils.containsPopupWithNestedElement;
46
52
  }
47
53
  });
54
+ Object.defineProperty(exports, "getNodeQuery", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _experienceUtils.getNodeQuery;
58
+ }
59
+ });
48
60
  Object.defineProperty(exports, "getPopupContainerFromEditorView", {
49
61
  enumerable: true,
50
62
  get: function get() {
@@ -1 +1,15 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ var _consts = require("./consts");
4
+ /**
5
+ * Allow any additional custom metadata to be attached to experience events.
6
+ */
7
+
8
+ /**
9
+ * Represents the state of an experience throughout its lifecycle.
10
+ */
11
+
12
+ /*
13
+ * ID for the the experience. These are broad experiences used for SLOs for all of editor, not at individual feature level.
14
+ */
15
+ var EXPERIENCE_IDS = Object.values(_consts.EXPERIENCE_ID);
@@ -256,6 +256,7 @@ var Extension = function Extension(props) {
256
256
  // eslint-disable-next-line react/jsx-props-no-spreading
257
257
  }, props));
258
258
  };
259
- var _default = exports.default = (0, _ui.overflowShadow)(Extension, {
259
+ var _default_1 = (0, _ui.overflowShadow)(Extension, {
260
260
  overflowSelector: '.extension-overflow-wrapper'
261
- });
261
+ });
262
+ var _default = exports.default = _default_1;
@@ -327,4 +327,5 @@ var RecentLink = /*#__PURE__*/function (_React$Component) {
327
327
  (0, _defineProperty2.default)(RecentLink, "defaultProps", {
328
328
  limit: DEFAULT_ITEMS_LIMIT
329
329
  });
330
- var _default = exports.default = (0, _withActivityProvider.default)((0, _reactIntlNext.injectIntl)(RecentLink));
330
+ var _default_1 = (0, _withActivityProvider.default)((0, _reactIntlNext.injectIntl)(RecentLink));
331
+ var _default = exports.default = _default_1;
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  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); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "111.8.5";
22
+ var packageVersion = "111.8.7";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -98,6 +98,12 @@ exports.getAllSelectionAnalyticsPayload = getAllSelectionAnalyticsPayload;
98
98
  exports.getCellSelectionAnalyticsPayload = getCellSelectionAnalyticsPayload;
99
99
  exports.getNodeSelectionAnalyticsPayload = getNodeSelectionAnalyticsPayload;
100
100
  exports.getRangeSelectionAnalyticsPayload = getRangeSelectionAnalyticsPayload;
101
+ Object.defineProperty(exports, "getSourceNodesFromSelectionRange", {
102
+ enumerable: true,
103
+ get: function get() {
104
+ return _utils2.getSourceNodesFromSelectionRange;
105
+ }
106
+ });
101
107
  Object.defineProperty(exports, "hideCaretModifier", {
102
108
  enumerable: true,
103
109
  get: function get() {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -9,13 +10,17 @@ exports.atTheEndOfBlock = atTheEndOfBlock;
9
10
  exports.atTheEndOfDoc = atTheEndOfDoc;
10
11
  exports.deleteSelectedRange = void 0;
11
12
  exports.endPositionOfParent = endPositionOfParent;
12
- exports.isMultiBlockRange = exports.expandToBlockRange = exports.expandSelectionToBlockRange = exports.expandSelectionBounds = void 0;
13
+ exports.expandToBlockRange = exports.expandSelectionToBlockRange = exports.expandSelectionBounds = void 0;
14
+ exports.getSourceNodesFromSelectionRange = getSourceNodesFromSelectionRange;
15
+ exports.isMultiBlockRange = void 0;
13
16
  exports.isMultiBlockSelection = isMultiBlockSelection;
14
17
  exports.isSelectionAtStartOfNode = exports.isSelectionAtEndOfNode = void 0;
15
18
  exports.selectionIsAtTheBeginningOfBlock = selectionIsAtTheBeginningOfBlock;
16
19
  exports.startPositionOfParent = startPositionOfParent;
20
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
21
  var _state = require("@atlaskit/editor-prosemirror/state");
18
22
  var _utils = require("@atlaskit/editor-tables/utils");
23
+ var _utils2 = require("../utils");
19
24
  var _selection = require("./gap-cursor/selection");
20
25
  var isSelectionAtStartOfNode = exports.isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
21
26
  if (!parentNode) {
@@ -241,4 +246,34 @@ function isMultiBlockSelection(selection) {
241
246
  return false;
242
247
  }
243
248
  return isMultiBlockRange(range);
249
+ }
250
+
251
+ /**
252
+ * Extracts the source nodes from a selection range.
253
+ *
254
+ * This function expands the given selection to its block range boundaries and returns
255
+ * an array of the nodes contained within that range. It handles special cases like
256
+ * list nodes, where the slice positions are adjusted to include the list wrapper.
257
+ *
258
+ * @param tr - The transaction containing the document
259
+ * @param selection - The selection to extract nodes from
260
+ * @returns An array of ProseMirror nodes within the expanded selection range
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * const selection = tr.selection;
265
+ * const nodes = getSourceNodesFromSelectionRange(tr, selection);
266
+ * // nodes will contain all block-level nodes in the selection
267
+ * ```
268
+ */
269
+ function getSourceNodesFromSelectionRange(tr, selection) {
270
+ var _expandSelectionToBlo2 = expandSelectionToBlockRange(selection),
271
+ $from = _expandSelectionToBlo2.$from,
272
+ $to = _expandSelectionToBlo2.$to;
273
+ var selectedParent = $from.parent;
274
+ var isList = (0, _utils2.isListNode)(selectedParent);
275
+ var sliceStart = isList ? $from.pos - 1 : $from.pos;
276
+ var sliceEnd = isList ? $to.pos + 1 : $to.pos;
277
+ var slice = tr.doc.slice(sliceStart, sliceEnd);
278
+ return (0, _toConsumableArray2.default)(slice.content.content);
244
279
  }
@@ -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 = "111.8.5";
27
+ var packageVersion = "111.8.7";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -60,6 +60,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
60
60
  ACTION["EXPERIENCE_MEASURED"] = "experienceMeasured";
61
61
  ACTION["EXPERIENCE_SAMPLED"] = "experienceSampled";
62
62
  ACTION["EXPOSED"] = "exposed";
63
+ ACTION["FETCHED"] = "fetched";
63
64
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
64
65
  ACTION["FAILED_TO_INSERT"] = "failedToInsert";
65
66
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
@@ -102,6 +103,8 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
102
103
  ACTION["PRESSED"] = "pressed";
103
104
  ACTION["PROSEMIRROR_RENDERED"] = "proseMirrorRendered";
104
105
  ACTION["REACT_NODEVIEW_RENDERED"] = "reactNodeViewRendered";
106
+ ACTION["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
107
+ ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
105
108
  ACTION["REPLACED_ALL"] = "replacedAll";
106
109
  ACTION["REPLACED_ONE"] = "replacedOne";
107
110
  ACTION["RESOLVED"] = "resolved";
@@ -113,6 +116,11 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
113
116
  ACTION["STOPPED"] = "stopped";
114
117
  ACTION["SUBMITTED"] = "submitted";
115
118
  ACTION["SUBSTITUTED"] = "autoSubstituted";
119
+ ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
120
+ ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
121
+ ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
122
+ ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
123
+ ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
116
124
  ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
117
125
  ACTION["SYNCHRONY_ENTITY_ERROR"] = "synchronyEntityError";
118
126
  ACTION["SYNCHRONY_ERROR"] = "synchronyError";
@@ -365,6 +373,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
365
373
  ACTION_SUBJECT_ID["ALT_TEXT"] = "altText";
366
374
  ACTION_SUBJECT_ID["ANNOTATE_BUTTON"] = "annotateButton";
367
375
  ACTION_SUBJECT_ID["AVATAR_GROUP_PLUGIN"] = "AvatarGroupInPlugin";
376
+ ACTION_SUBJECT_ID["BLOCK_MENU"] = "blockMenu";
368
377
  ACTION_SUBJECT_ID["BLOCK_QUOTE"] = "blockQuote";
369
378
  ACTION_SUBJECT_ID["BORDER"] = "border";
370
379
  ACTION_SUBJECT_ID["BUTTON_CATEGORY"] = "categoryButton";
@@ -479,10 +488,12 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
479
488
  ACTION_SUBJECT_ID["PLACEHOLDER_TEXT"] = "placeholderText";
480
489
  ACTION_SUBJECT_ID["POST_QUERY_SEARCH_RESULTS"] = "postQuerySearchResults";
481
490
  ACTION_SUBJECT_ID["PRE_QUERY_SEARCH_RESULTS"] = "preQuerySearchResults";
491
+ ACTION_SUBJECT_ID["PRIMARY_TOOLBAR"] = "primaryToolbar";
482
492
  ACTION_SUBJECT_ID["PROACTIVE_SUGGESTION"] = "proactiveSuggestion";
483
493
  ACTION_SUBJECT_ID["PRODUCT_NAME"] = "productName";
484
494
  ACTION_SUBJECT_ID["PUNC"] = "punctuation";
485
495
  ACTION_SUBJECT_ID["QUICK_SEARCH"] = "quickSearch";
496
+ ACTION_SUBJECT_ID["QUICK_INSERT"] = "quickInsert";
486
497
  ACTION_SUBJECT_ID["RANGE"] = "range";
487
498
  ACTION_SUBJECT_ID["REACT_NODE_VIEW"] = "reactNodeView";
488
499
  ACTION_SUBJECT_ID["RECENT_ACTIVITIES"] = "recentActivities";
@@ -522,6 +533,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
522
533
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_ITEM"] = "editorPluginSelectionExtensionItem";
523
534
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_COMPONENT"] = "editorPluginSelectionExtensionComponent";
524
535
  ACTION_SUBJECT_ID["TRANSFORM"] = "transform";
536
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_TOOLBAR"] = "syncedBlockToolbar";
525
537
  ACTION_SUBJECT_ID["SYNCED_BLOCK_SOURCE_URL"] = "syncedBlockSourceUrl";
526
538
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE_CACHE"] = "syncedBlockUpdateCache";
527
539
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
@@ -42,4 +42,11 @@ export const EXPERIENCE_ABORT_REASON = {
42
42
  * The expectation is that measurements will be gathered after initial
43
43
  * instrumentation, then the sample rate can be tuned up to a safe threshold.
44
44
  */
45
- export const DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
45
+ export const DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
46
+ export const EXPERIENCE_ID = {
47
+ ASYNC_OPERATION: 'asyncOperation',
48
+ MENU_ACTION: 'menuAction',
49
+ MENU_OPEN: 'menu-open',
50
+ TOOLBAR_ACTION: 'toolbarAction',
51
+ TOOLBAR_OPEN: 'toolbar-open'
52
+ };
@@ -50,4 +50,17 @@ export const getPopupContainerFromEditorView = editorViewEl => {
50
50
  const editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
51
51
  const pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
52
52
  return pluginsComponentsWrapper || undefined;
53
+ };
54
+
55
+ /**
56
+ * Checks if a node matches or contains the node given by the provided query css selector
57
+ *
58
+ * @param query - CSS selector string
59
+ * @returns true if node matches or contains query or false otherwise
60
+ */
61
+ export const getNodeQuery = query => node => {
62
+ if (!node || !(node instanceof Element)) {
63
+ return false;
64
+ }
65
+ return node.matches(query) || node.querySelector(query) !== null;
53
66
  };
@@ -2,8 +2,8 @@
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
4
  export { Experience } from './Experience';
5
- export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
5
+ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON, EXPERIENCE_ID } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
8
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
- export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
9
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, getNodeQuery } from './experience-utils';
@@ -0,0 +1,14 @@
1
+ import { EXPERIENCE_ID } from "./consts";
2
+
3
+ /**
4
+ * Allow any additional custom metadata to be attached to experience events.
5
+ */
6
+
7
+ /**
8
+ * Represents the state of an experience throughout its lifecycle.
9
+ */
10
+
11
+ /*
12
+ * ID for the the experience. These are broad experiences used for SLOs for all of editor, not at individual feature level.
13
+ */
14
+ const EXPERIENCE_IDS = Object.values(EXPERIENCE_ID);
@@ -251,6 +251,7 @@ const Extension = props => {
251
251
  // eslint-disable-next-line react/jsx-props-no-spreading
252
252
  }, props));
253
253
  };
254
- export default overflowShadow(Extension, {
254
+ const _default_1 = overflowShadow(Extension, {
255
255
  overflowSelector: '.extension-overflow-wrapper'
256
- });
256
+ });
257
+ export default _default_1;
@@ -220,4 +220,5 @@ class RecentLink extends React.Component {
220
220
  _defineProperty(RecentLink, "defaultProps", {
221
221
  limit: DEFAULT_ITEMS_LIMIT
222
222
  });
223
- export default withActivityProvider(injectIntl(RecentLink));
223
+ const _default_1 = withActivityProvider(injectIntl(RecentLink));
224
+ export default _default_1;
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "111.8.5";
7
+ const packageVersion = "111.8.7";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -12,7 +12,7 @@ export { isIgnored } from './gap-cursor/utils/is-ignored';
12
12
  export { isValidTargetNode } from './gap-cursor/utils/is-valid-target-node';
13
13
  export { setGapCursorSelection } from './gap-cursor/utils/setGapCursorSelection';
14
14
  export { hideCaretModifier, gapCursorStyles } from './gap-cursor/styles';
15
- export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
15
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, deleteSelectedRange, endPositionOfParent, expandSelectionBounds, expandSelectionToBlockRange, expandToBlockRange, getSourceNodesFromSelectionRange, isMultiBlockRange, isMultiBlockSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, selectionIsAtTheBeginningOfBlock, startPositionOfParent } from './utils';
16
16
  export function getNodeSelectionAnalyticsPayload(selection) {
17
17
  if (selection instanceof NodeSelection) {
18
18
  return {
@@ -1,5 +1,6 @@
1
1
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
3
+ import { isListNode } from '../utils';
3
4
  import { GapCursorSelection } from './gap-cursor/selection';
4
5
  export const isSelectionAtStartOfNode = ($pos, parentNode) => {
5
6
  if (!parentNode) {
@@ -237,4 +238,35 @@ export function isMultiBlockSelection(selection) {
237
238
  return false;
238
239
  }
239
240
  return isMultiBlockRange(range);
241
+ }
242
+
243
+ /**
244
+ * Extracts the source nodes from a selection range.
245
+ *
246
+ * This function expands the given selection to its block range boundaries and returns
247
+ * an array of the nodes contained within that range. It handles special cases like
248
+ * list nodes, where the slice positions are adjusted to include the list wrapper.
249
+ *
250
+ * @param tr - The transaction containing the document
251
+ * @param selection - The selection to extract nodes from
252
+ * @returns An array of ProseMirror nodes within the expanded selection range
253
+ *
254
+ * @example
255
+ * ```typescript
256
+ * const selection = tr.selection;
257
+ * const nodes = getSourceNodesFromSelectionRange(tr, selection);
258
+ * // nodes will contain all block-level nodes in the selection
259
+ * ```
260
+ */
261
+ export function getSourceNodesFromSelectionRange(tr, selection) {
262
+ const {
263
+ $from,
264
+ $to
265
+ } = expandSelectionToBlockRange(selection);
266
+ const selectedParent = $from.parent;
267
+ const isList = isListNode(selectedParent);
268
+ const sliceStart = isList ? $from.pos - 1 : $from.pos;
269
+ const sliceEnd = isList ? $to.pos + 1 : $to.pos;
270
+ const slice = tr.doc.slice(sliceStart, sliceEnd);
271
+ return [...slice.content.content];
240
272
  }
@@ -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 = "111.8.5";
17
+ const packageVersion = "111.8.7";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -60,6 +60,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
60
60
  ACTION["EXPERIENCE_MEASURED"] = "experienceMeasured";
61
61
  ACTION["EXPERIENCE_SAMPLED"] = "experienceSampled";
62
62
  ACTION["EXPOSED"] = "exposed";
63
+ ACTION["FETCHED"] = "fetched";
63
64
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
64
65
  ACTION["FAILED_TO_INSERT"] = "failedToInsert";
65
66
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
@@ -102,6 +103,8 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
102
103
  ACTION["PRESSED"] = "pressed";
103
104
  ACTION["PROSEMIRROR_RENDERED"] = "proseMirrorRendered";
104
105
  ACTION["REACT_NODEVIEW_RENDERED"] = "reactNodeViewRendered";
106
+ ACTION["REFERENCE_SYNCED_BLOCK_DELETE"] = "referenceSyncedBlockDelete";
107
+ ACTION["REFERENCE_SYNCED_BLOCK_UPDATE"] = "referenceSyncedBlockUpdate";
105
108
  ACTION["REPLACED_ALL"] = "replacedAll";
106
109
  ACTION["REPLACED_ONE"] = "replacedOne";
107
110
  ACTION["RESOLVED"] = "resolved";
@@ -113,6 +116,11 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
113
116
  ACTION["STOPPED"] = "stopped";
114
117
  ACTION["SUBMITTED"] = "submitted";
115
118
  ACTION["SUBSTITUTED"] = "autoSubstituted";
119
+ ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
120
+ ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
121
+ ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
122
+ ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
123
+ ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
116
124
  ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
117
125
  ACTION["SYNCHRONY_ENTITY_ERROR"] = "synchronyEntityError";
118
126
  ACTION["SYNCHRONY_ERROR"] = "synchronyError";
@@ -365,6 +373,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
365
373
  ACTION_SUBJECT_ID["ALT_TEXT"] = "altText";
366
374
  ACTION_SUBJECT_ID["ANNOTATE_BUTTON"] = "annotateButton";
367
375
  ACTION_SUBJECT_ID["AVATAR_GROUP_PLUGIN"] = "AvatarGroupInPlugin";
376
+ ACTION_SUBJECT_ID["BLOCK_MENU"] = "blockMenu";
368
377
  ACTION_SUBJECT_ID["BLOCK_QUOTE"] = "blockQuote";
369
378
  ACTION_SUBJECT_ID["BORDER"] = "border";
370
379
  ACTION_SUBJECT_ID["BUTTON_CATEGORY"] = "categoryButton";
@@ -479,10 +488,12 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
479
488
  ACTION_SUBJECT_ID["PLACEHOLDER_TEXT"] = "placeholderText";
480
489
  ACTION_SUBJECT_ID["POST_QUERY_SEARCH_RESULTS"] = "postQuerySearchResults";
481
490
  ACTION_SUBJECT_ID["PRE_QUERY_SEARCH_RESULTS"] = "preQuerySearchResults";
491
+ ACTION_SUBJECT_ID["PRIMARY_TOOLBAR"] = "primaryToolbar";
482
492
  ACTION_SUBJECT_ID["PROACTIVE_SUGGESTION"] = "proactiveSuggestion";
483
493
  ACTION_SUBJECT_ID["PRODUCT_NAME"] = "productName";
484
494
  ACTION_SUBJECT_ID["PUNC"] = "punctuation";
485
495
  ACTION_SUBJECT_ID["QUICK_SEARCH"] = "quickSearch";
496
+ ACTION_SUBJECT_ID["QUICK_INSERT"] = "quickInsert";
486
497
  ACTION_SUBJECT_ID["RANGE"] = "range";
487
498
  ACTION_SUBJECT_ID["REACT_NODE_VIEW"] = "reactNodeView";
488
499
  ACTION_SUBJECT_ID["RECENT_ACTIVITIES"] = "recentActivities";
@@ -522,6 +533,7 @@ export var ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
522
533
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_ITEM"] = "editorPluginSelectionExtensionItem";
523
534
  ACTION_SUBJECT_ID["EDITOR_PLUGIN_SELECTION_EXTENSION_COMPONENT"] = "editorPluginSelectionExtensionComponent";
524
535
  ACTION_SUBJECT_ID["TRANSFORM"] = "transform";
536
+ ACTION_SUBJECT_ID["SYNCED_BLOCK_TOOLBAR"] = "syncedBlockToolbar";
525
537
  ACTION_SUBJECT_ID["SYNCED_BLOCK_SOURCE_URL"] = "syncedBlockSourceUrl";
526
538
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE_CACHE"] = "syncedBlockUpdateCache";
527
539
  ACTION_SUBJECT_ID["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
@@ -42,4 +42,11 @@ export var EXPERIENCE_ABORT_REASON = {
42
42
  * The expectation is that measurements will be gathered after initial
43
43
  * instrumentation, then the sample rate can be tuned up to a safe threshold.
44
44
  */
45
- export var DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
45
+ export var DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
46
+ export var EXPERIENCE_ID = {
47
+ ASYNC_OPERATION: 'asyncOperation',
48
+ MENU_ACTION: 'menuAction',
49
+ MENU_OPEN: 'menu-open',
50
+ TOOLBAR_ACTION: 'toolbarAction',
51
+ TOOLBAR_OPEN: 'toolbar-open'
52
+ };
@@ -50,4 +50,19 @@ export var getPopupContainerFromEditorView = function getPopupContainerFromEdito
50
50
  var editorContentArea = editorViewEl === null || editorViewEl === void 0 ? void 0 : editorViewEl.closest('.ak-editor-content-area');
51
51
  var pluginsComponentsWrapper = editorContentArea === null || editorContentArea === void 0 ? void 0 : editorContentArea.querySelector(':scope > [data-testid="plugins-components-wrapper"]');
52
52
  return pluginsComponentsWrapper || undefined;
53
+ };
54
+
55
+ /**
56
+ * Checks if a node matches or contains the node given by the provided query css selector
57
+ *
58
+ * @param query - CSS selector string
59
+ * @returns true if node matches or contains query or false otherwise
60
+ */
61
+ export var getNodeQuery = function getNodeQuery(query) {
62
+ return function (node) {
63
+ if (!node || !(node instanceof Element)) {
64
+ return false;
65
+ }
66
+ return node.matches(query) || node.querySelector(query) !== null;
67
+ };
53
68
  };
@@ -2,8 +2,8 @@
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
4
  export { Experience } from './Experience';
5
- export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON } from './consts';
5
+ export { EXPERIENCE_ABORT_REASON, EXPERIENCE_FAILURE_REASON, EXPERIENCE_ID } from './consts';
6
6
  export { ExperienceCheckComposite } from './ExperienceCheckComposite';
7
7
  export { ExperienceCheckDomMutation } from './ExperienceCheckDomMutation';
8
8
  export { ExperienceCheckTimeout } from './ExperienceCheckTimeout';
9
- export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView } from './experience-utils';
9
+ export { containsPopupWithNestedElement, popupWithNestedElement, getPopupContainerFromEditorView, getNodeQuery } from './experience-utils';
@@ -0,0 +1,14 @@
1
+ import { EXPERIENCE_ID } from "./consts";
2
+
3
+ /**
4
+ * Allow any additional custom metadata to be attached to experience events.
5
+ */
6
+
7
+ /**
8
+ * Represents the state of an experience throughout its lifecycle.
9
+ */
10
+
11
+ /*
12
+ * ID for the the experience. These are broad experiences used for SLOs for all of editor, not at individual feature level.
13
+ */
14
+ var EXPERIENCE_IDS = Object.values(EXPERIENCE_ID);