@atlaskit/editor-common 134.2.2 → 134.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 (60) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cjs/extensibility/preserveRemixNodeView.js +16 -0
  3. package/dist/cjs/mark/cell-selection-has-any-mark.js +32 -0
  4. package/dist/cjs/mark/get-supported-mark-types.js +30 -0
  5. package/dist/cjs/mention-avatar.js +3 -1
  6. package/dist/cjs/messages/card.js +6 -0
  7. package/dist/cjs/messages/insert-block.js +6 -0
  8. package/dist/cjs/monitoring/error.js +1 -1
  9. package/dist/cjs/preserve-node-view.js +155 -0
  10. package/dist/cjs/quick-insert/rank.js +1 -1
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/cjs/vanilla-tooltip/index.js +1 -0
  13. package/dist/es2019/extensibility/preserveRemixNodeView.js +14 -0
  14. package/dist/es2019/mark/cell-selection-has-any-mark.js +23 -0
  15. package/dist/es2019/mark/get-supported-mark-types.js +20 -0
  16. package/dist/es2019/mention-avatar.js +2 -1
  17. package/dist/es2019/messages/card.js +6 -0
  18. package/dist/es2019/messages/insert-block.js +6 -0
  19. package/dist/es2019/monitoring/error.js +1 -1
  20. package/dist/es2019/preserve-node-view.js +137 -0
  21. package/dist/es2019/quick-insert/rank.js +3 -1
  22. package/dist/es2019/ui/DropList/index.js +1 -1
  23. package/dist/es2019/vanilla-tooltip/index.js +1 -0
  24. package/dist/esm/extensibility/preserveRemixNodeView.js +16 -0
  25. package/dist/esm/mark/cell-selection-has-any-mark.js +26 -0
  26. package/dist/esm/mark/get-supported-mark-types.js +24 -0
  27. package/dist/esm/mention-avatar.js +2 -1
  28. package/dist/esm/messages/card.js +6 -0
  29. package/dist/esm/messages/insert-block.js +6 -0
  30. package/dist/esm/monitoring/error.js +1 -1
  31. package/dist/esm/preserve-node-view.js +149 -0
  32. package/dist/esm/quick-insert/rank.js +1 -1
  33. package/dist/esm/ui/DropList/index.js +1 -1
  34. package/dist/esm/vanilla-tooltip/index.js +1 -0
  35. package/dist/types/collab/index.d.ts +8 -2
  36. package/dist/types/mark/cell-selection-has-any-mark.d.ts +4 -0
  37. package/dist/types/mark/get-supported-mark-types.d.ts +6 -0
  38. package/dist/types/messages/card.d.ts +75 -70
  39. package/dist/types/messages/insert-block.d.ts +5 -0
  40. package/dist/types/preserve-node-view.d.ts +39 -0
  41. package/mark/cell-selection-has-any-mark/package.json +10 -0
  42. package/mark/get-supported-mark-types/package.json +10 -0
  43. package/package.json +10 -10
  44. package/preserve-node-view/package.json +10 -0
  45. package/dist/cjs/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -42
  46. package/dist/cjs/prosemirror-node-view.js +0 -1
  47. package/dist/cjs/sync-block/types.js +0 -1
  48. package/dist/cjs/utils/isNodeTypeValidChildOf.js +0 -23
  49. package/dist/es2019/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -39
  50. package/dist/es2019/prosemirror-node-view.js +0 -0
  51. package/dist/es2019/sync-block/types.js +0 -0
  52. package/dist/es2019/utils/isNodeTypeValidChildOf.js +0 -17
  53. package/dist/esm/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -37
  54. package/dist/esm/prosemirror-node-view.js +0 -0
  55. package/dist/esm/sync-block/types.js +0 -0
  56. package/dist/esm/utils/isNodeTypeValidChildOf.js +0 -17
  57. package/dist/types/element-browser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
  58. package/dist/types/prosemirror-node-view.d.ts +0 -0
  59. package/dist/types/sync-block/types.d.ts +0 -4
  60. package/dist/types/utils/isNodeTypeValidChildOf.d.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 134.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`88f6eda39f497`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88f6eda39f497) -
8
+ Resolve agent telepointer colours from supplied display names and stable named IDs instead of
9
+ machine types. Under `confluence_ncs_step_diffing_version_history`, collab-provider carries
10
+ `agentId`, `agentName` and `agentNamedId` from received steps into local agent presence, retaining
11
+ known metadata when later steps omit it. This path uses no profile lookups. Missing presentation
12
+ metadata uses the generic agent palette; human participants keep their existing colours.
13
+
14
+ Telepointers identify agent participants from these explicit identity fields rather than
15
+ `agentType` or a human participant's display name.
16
+
17
+ `getParticipantColor(id, agentName?, agentNamedId?)` and
18
+ `collabEdit.actions.getAvatarColor(id, agentName?, agentNamedId?)` now accept a resolved display
19
+ name in the second argument. Callers previously passing a machine type should supply the agent's
20
+ name instead, and pass stable named IDs in the third argument. With
21
+ `confluence_ncs_step_diffing_version_history` enabled, named brand metadata takes precedence over
22
+ the display name. With the gate off, brand lookup is disabled. Human callers should continue to
23
+ omit agent metadata.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
29
+ ## 134.3.1
30
+
31
+ ### Patch Changes
32
+
33
+ - [`ce5f97ab62e45`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ce5f97ab62e45) -
34
+ [EDITOR-9779] Apply Hello slash menu naming and ranking behind platform_editor_slash_command:
35
+ rename the Loom record item to "Loom" and Insert Confluence list to "Confluence list", rank Assets
36
+ after the Spaces items in Data and charts, and stop forcing Smart button into Structure
37
+ - [`8f9c12c0398d2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f9c12c0398d2) -
38
+ Delete unreachable internal source files
39
+ - Updated dependencies
40
+
41
+ ## 134.3.0
42
+
43
+ ### Minor Changes
44
+
45
+ - [`b2cba09ce9ad0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2cba09ce9ad0) -
46
+ Add a shared cell-local mark-presence helper and use it for clear-formatting and block-type
47
+ formatting-presence checks behind `platform_editor_improve_inp`. Reuse resolved cell-selection
48
+ ranges and stop scanning at the first matching mark.
49
+
50
+ Share schema mark-name resolution through `getSupportedMarkTypes`, caching results per schema and
51
+ mark-name array to avoid repeated allocation during selection changes.
52
+
53
+ - [`9ed4f69277c0c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9ed4f69277c0c) -
54
+ Preserve Smart Card iframe state across editor width changes using a shared node-view preservation
55
+ helper, behind platform_editor_preserve_smart_card_embeds. Keep the existing Remix preservation
56
+ path when the experiment is disabled.
57
+
58
+ ### Patch Changes
59
+
60
+ - [`42f1409f3df4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/42f1409f3df4c) -
61
+ Enable mention avatars when the `canvas-rovo-comment-sessions` gate is on.
62
+ - Updated dependencies
63
+
3
64
  ## 134.2.2
4
65
 
5
66
  ### Patch Changes
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.preserveRemixNodeView = preserveRemixNodeView;
7
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
7
8
  var _nativeEmbedMauiExtensionKey = require("../extensions/native-embed-maui-extension-key");
9
+ var _preserveNodeView = require("../preserve-node-view");
8
10
  // Do not polyfill with insertBefore: it disconnects an iframe and resets its browsing context.
9
11
 
10
12
  var editors = new WeakMap();
@@ -35,6 +37,20 @@ function preserveRemixNodeView(_ref) {
35
37
  if (!isRemixNodeForPreservation(node)) {
36
38
  return createExtensionNode(node).init();
37
39
  }
40
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_preserve_smart_card_embeds')) {
41
+ return (0, _preserveNodeView.preserveNodeView)({
42
+ node: node,
43
+ view: view,
44
+ getPos: getPos,
45
+ renderProps: renderProps,
46
+ rendererKind: rendererKind,
47
+ createNodeView: createExtensionNode,
48
+ isSameNode: sameChart,
49
+ canUpdateNode: function canUpdateNode(previous, next) {
50
+ return previous.type === next.type && previous.attrs.localId === next.attrs.localId && previous.attrs.extensionKey === next.attrs.extensionKey;
51
+ }
52
+ });
53
+ }
38
54
  var ownerDocument = view.dom.ownerDocument;
39
55
  var slot = ownerDocument.createElement('div');
40
56
  if (!view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.cellSelectionHasAnyMark = void 0;
7
+ /** Check selected cells locally and stop as soon as any requested mark is found. */
8
+ var cellSelectionHasAnyMark = exports.cellSelectionHasAnyMark = function cellSelectionHasAnyMark(selection, markTypes) {
9
+ if (markTypes.length === 0) {
10
+ return false;
11
+ }
12
+ var _nodeHasAnyMark = function nodeHasAnyMark(node) {
13
+ if (markTypes.some(function (markType) {
14
+ return !!markType.isInSet(node.marks);
15
+ })) {
16
+ return true;
17
+ }
18
+ for (var index = 0; index < node.childCount; index++) {
19
+ if (_nodeHasAnyMark(node.child(index))) {
20
+ return true;
21
+ }
22
+ }
23
+ return false;
24
+ };
25
+
26
+ // CellSelection already has one resolved range per selected cell, including merged cells.
27
+ // Reuse those nodes instead of rebuilding the table rectangle and resolving each cell again.
28
+ return selection.ranges.some(function (_ref) {
29
+ var $from = _ref.$from;
30
+ return _nodeHasAnyMark($from.parent);
31
+ });
32
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getSupportedMarkTypes = void 0;
7
+ var supportedMarkTypesCache = new WeakMap();
8
+
9
+ /**
10
+ * Resolve mark names against a schema, omitting unsupported marks.
11
+ * Reuse the result for the same schema and mark-name array; callers must not mutate either input.
12
+ */
13
+ var getSupportedMarkTypes = exports.getSupportedMarkTypes = function getSupportedMarkTypes(schema, markNames) {
14
+ var schemaCache = supportedMarkTypesCache.get(schema);
15
+ if (!schemaCache) {
16
+ schemaCache = new WeakMap();
17
+ supportedMarkTypesCache.set(schema, schemaCache);
18
+ }
19
+ var cachedMarks = schemaCache.get(markNames);
20
+ if (cachedMarks) {
21
+ return cachedMarks;
22
+ }
23
+ var marks = markNames.map(function (name) {
24
+ return schema.marks[name];
25
+ }).filter(function (mark) {
26
+ return !!mark;
27
+ });
28
+ schemaCache.set(markNames, marks);
29
+ return marks;
30
+ };
@@ -1,9 +1,11 @@
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
  });
6
7
  exports.isMentionAvatarEnabled = isMentionAvatarEnabled;
8
+ var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
7
9
  var _expVal = require("@atlaskit/platform-feature-experiments/exp-val");
8
10
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
9
11
  var GENERIC_MENTION_IDS = ['HipChat', 'all', 'here'];
@@ -17,5 +19,5 @@ function isMentionAvatarEnabled(_ref) {
17
19
  canReportMissingProvider = _ref$canReportMissing === void 0 ? false : _ref$canReportMissing;
18
20
  // Preserve Platform's cohort exposure, including when a provider is missing.
19
21
  var cohort = (0, _expVal.expVal)('convo_ai_entity_hover_cards_non_hello_exp', 'hover_card_cohort', 'control');
20
- return (hasProvider || canReportMissingProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (cohort === 'person' || cohort === 'all' || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_graphql_provider') || (userType === 'APP' || userType === 'AGENT') && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_drop3_hexagon_agent_avatar'));
22
+ return (hasProvider || canReportMissingProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (cohort === 'person' || cohort === 'all' || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_avatar') || _featureGates.default.checkGate('canvas-rovo-comment-sessions') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_mention_node_graphql_provider') || (userType === 'APP' || userType === 'AGENT') && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_drop3_hexagon_agent_avatar'));
21
23
  }
@@ -171,11 +171,17 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
171
171
  defaultMessage: 'Go to link',
172
172
  description: 'An option in the configure link dropdown that informs the user they can click the option to open the link'
173
173
  },
174
+ // Remove when cleaning up platform_editor_slash_command
174
175
  datasourceConfluenceSearch: {
175
176
  id: 'fabric.editor.datasource.confluenceSearch',
176
177
  defaultMessage: 'Insert Confluence list',
177
178
  description: 'Title shown for Confluence Search datasource on QuickInsert options'
178
179
  },
180
+ datasourceConfluenceList: {
181
+ id: 'fabric.editor.datasource.confluenceList',
182
+ defaultMessage: 'Confluence list',
183
+ description: 'Title shown for Confluence Search datasource in the Data and charts section of the editor slash command menu'
184
+ },
179
185
  datasourceConfluenceSearchDescription: {
180
186
  id: 'fabric.editor.datasource.confluenceSearch.description',
181
187
  defaultMessage: 'Display filtered Confluence search results',
@@ -236,11 +236,17 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
236
236
  defaultMessage: 'Browse all the keyboard shortcuts and markdown options',
237
237
  description: 'Displayed as a description text for the help option in the editor insert menu, explaining that it opens a dialog where users can view all available keyboard shortcuts and markdown formatting options.'
238
238
  },
239
+ // Remove when cleaning up platform_editor_slash_command
239
240
  recordVideo: {
240
241
  id: 'fabric.editor.recordVideo',
241
242
  defaultMessage: 'Record a Loom video',
242
243
  description: 'Shown as a menu item label in the editor insert menu, used to trigger recording a Loom video to embed in the document.'
243
244
  },
245
+ loomTitle: {
246
+ id: 'fabric.editor.loomTitle',
247
+ defaultMessage: 'Loom',
248
+ description: 'Shown as a menu item label in the Create section of the editor slash command menu, used to trigger recording a Loom video to embed in the document.'
249
+ },
244
250
  addLoomVideo: {
245
251
  id: 'fabric.editor.addLoomVideo',
246
252
  defaultMessage: 'Record a Loom video',
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "134.2.1";
30
+ var packageVersion = "134.3.1";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.preserveNodeView = preserveNodeView;
7
+ // Do not polyfill with insertBefore: it disconnects an iframe and resets its browsing context.
8
+
9
+ var editors = new WeakMap();
10
+ /**
11
+ * Preserves an atomic React node view across ProseMirror redraws when native
12
+ * state-preserving DOM moves are available. A disposable slot parks the
13
+ * portal before ProseMirror disconnects its mark wrapper. After reconciliation, the
14
+ * replacement claims the parked portal without taking one from a still-live node.
15
+ */
16
+ function preserveNodeView(_ref) {
17
+ var node = _ref.node,
18
+ view = _ref.view,
19
+ getPos = _ref.getPos,
20
+ renderProps = _ref.renderProps,
21
+ rendererKind = _ref.rendererKind,
22
+ createNodeView = _ref.createNodeView,
23
+ isSameNode = _ref.isSameNode,
24
+ canUpdateNode = _ref.canUpdateNode,
25
+ canReuse = _ref.canReuse,
26
+ onAttach = _ref.onAttach,
27
+ _ref$requireUniqueMat = _ref.requireUniqueMatch,
28
+ requireUniqueMatch = _ref$requireUniqueMat === void 0 ? false : _ref$requireUniqueMat;
29
+ var ownerDocument = view.dom.ownerDocument;
30
+ var slot = ownerDocument.createElement('div');
31
+ if (!node.isAtom || !view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
32
+ return createNodeView(node).init();
33
+ }
34
+ var owner = {
35
+ getPos: getPos,
36
+ destroyed: false
37
+ };
38
+ var entries = editors.get(view);
39
+ if (!entries) {
40
+ entries = new Set();
41
+ editors.set(view, entries);
42
+ }
43
+ var registry = entries;
44
+ var entry;
45
+ var latestNode = node;
46
+ var latestDecorations = [];
47
+ var latestInnerDecorations;
48
+
49
+ // Construction can precede the old slot's destroy(). Defer portal adoption until
50
+ // both hooks have run; no rendering opportunity occurs between these microtasks.
51
+ queueMicrotask(function () {
52
+ if (owner.destroyed || view.isDestroyed || !slot.isConnected) {
53
+ return;
54
+ }
55
+ var matches = function matches(existing) {
56
+ return existing.rendererKind === rendererKind && isSameNode(existing.inner.node, latestNode) && (!canReuse || canReuse(existing.inner));
57
+ };
58
+ if (requireUniqueMatch) {
59
+ // Duplicate nodes can share a ProseMirror object while owning different iframe state.
60
+ var candidates = Array.from(registry).filter(matches);
61
+ entry = candidates.length === 1 && candidates[0].owner.destroyed ? candidates[0] : undefined;
62
+ } else {
63
+ entry = Array.from(registry).find(function (existing) {
64
+ return existing.owner.destroyed && matches(existing);
65
+ });
66
+ }
67
+ if (entry) {
68
+ var _slot$moveBefore, _entry$parking;
69
+ entry.owner = owner;
70
+ entry.inner.reactComponentProps = renderProps;
71
+ (_slot$moveBefore = slot.moveBefore) === null || _slot$moveBefore === void 0 || _slot$moveBefore.call(slot, entry.inner.dom, null);
72
+ (_entry$parking = entry.parking) === null || _entry$parking === void 0 || _entry$parking.remove();
73
+ entry.parking = undefined;
74
+ onAttach === null || onAttach === void 0 || onAttach(entry.inner, slot, function () {
75
+ return owner.destroyed ? undefined : owner.getPos();
76
+ });
77
+ if (!entry.inner.update(latestNode, latestDecorations, latestInnerDecorations)) {
78
+ // A renderer can reject an update even after its identity matches.
79
+ registry.delete(entry);
80
+ var dom = entry.inner.dom;
81
+ entry.inner.destroy();
82
+ dom.remove();
83
+ entry = undefined;
84
+ }
85
+ }
86
+ if (!entry) {
87
+ // Construct only after the old slot has had a chance to park its portal.
88
+ var inner = createNodeView(latestNode);
89
+ var retained = {
90
+ inner: inner,
91
+ owner: owner,
92
+ rendererKind: rendererKind
93
+ };
94
+ entry = retained;
95
+ inner.getPos = function () {
96
+ return retained.owner.destroyed ? undefined : retained.owner.getPos();
97
+ };
98
+ inner.init();
99
+ slot.appendChild(inner.dom);
100
+ onAttach === null || onAttach === void 0 || onAttach(inner, slot, function () {
101
+ return owner.destroyed ? undefined : owner.getPos();
102
+ });
103
+ registry.add(retained);
104
+ }
105
+ });
106
+ return {
107
+ dom: slot,
108
+ // ProseMirror must not manage the retained atom's portal children.
109
+ update: function update(next, decorations, innerDecorations) {
110
+ if (!canUpdateNode(node, next)) {
111
+ return false;
112
+ }
113
+ latestNode = next;
114
+ latestDecorations = decorations;
115
+ latestInnerDecorations = innerDecorations;
116
+ return entry ? entry.inner.update(next, decorations, innerDecorations) : true;
117
+ },
118
+ stopEvent: function stopEvent(event) {
119
+ var _entry$inner$stopEven, _entry;
120
+ return (_entry$inner$stopEven = (_entry = entry) === null || _entry === void 0 ? void 0 : _entry.inner.stopEvent(event)) !== null && _entry$inner$stopEven !== void 0 ? _entry$inner$stopEven : false;
121
+ },
122
+ ignoreMutation: function ignoreMutation(mutation) {
123
+ var _entry$inner$ignoreMu, _entry2, _entry2$inner$ignoreM, _entry2$inner;
124
+ return (_entry$inner$ignoreMu = (_entry2 = entry) === null || _entry2 === void 0 || (_entry2$inner$ignoreM = (_entry2$inner = _entry2.inner).ignoreMutation) === null || _entry2$inner$ignoreM === void 0 ? void 0 : _entry2$inner$ignoreM.call(_entry2$inner, mutation)) !== null && _entry$inner$ignoreMu !== void 0 ? _entry$inner$ignoreMu : mutation.type !== 'selection';
125
+ },
126
+ destroy: function destroy() {
127
+ owner.destroyed = true;
128
+ if (!entry) {
129
+ return;
130
+ }
131
+ var retained = entry;
132
+ if (retained.inner.dom.isConnected) {
133
+ var _parking$moveBefore;
134
+ var parking = ownerDocument.createElement('div');
135
+ // Transient, outside the editable document and inaccessible while awaiting handoff.
136
+ parking.hidden = true;
137
+ ownerDocument.body.appendChild(parking);
138
+ (_parking$moveBefore = parking.moveBefore) === null || _parking$moveBefore === void 0 || _parking$moveBefore.call(parking, retained.inner.dom, null);
139
+ retained.parking = parking;
140
+ }
141
+ // Give constructors queued after destroy() a chance to claim the portal first.
142
+ queueMicrotask(function () {
143
+ return queueMicrotask(function () {
144
+ if (retained.owner === owner && registry.delete(retained)) {
145
+ var _retained$parking;
146
+ var dom = retained.inner.dom;
147
+ retained.inner.destroy();
148
+ dom.remove();
149
+ (_retained$parking = retained.parking) === null || _retained$parking === void 0 || _retained$parking.remove();
150
+ }
151
+ });
152
+ });
153
+ }
154
+ };
155
+ }
@@ -15,7 +15,7 @@ var MEDIA_SECTION_RANK = exports.MEDIA_SECTION_RANK = (0, _defineProperty2.defau
15
15
  var CREATE_SECTION_RANK = exports.CREATE_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.JIRA_ISSUE_MENU_ITEM.key, 100), _keys.LOOM_MENU_ITEM.key, 200), _keys.CONFLUENCE_PAGE_MENU_ITEM.key, 300), _keys.DATABASE_MENU_ITEM.key, 400), _keys.WHITEBOARD_MENU_ITEM.key, 500), _keys.DIAGRAM_MENU_ITEM.key, 600), _keys.FLOWCHART_MENU_ITEM.key, 700), _keys.BRAINSTORMING_MENU_ITEM.key, 800), _keys.RETROSPECTIVE_MENU_ITEM.key, 900), _keys.ROADMAP_MENU_ITEM.key, 1000);
16
16
  var TEXT_FORMATTING_SECTION_RANK = exports.TEXT_FORMATTING_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.UNORDERED_LIST_MENU_ITEM.key, 100), _keys.ORDERED_LIST_MENU_ITEM.key, 200), _keys.HEADING_1_MENU_ITEM.key, 300), _keys.HEADING_2_MENU_ITEM.key, 400), _keys.HEADING_3_MENU_ITEM.key, 500), _keys.HEADING_4_MENU_ITEM.key, 600), _keys.HEADING_5_MENU_ITEM.key, 700), _keys.HEADING_6_MENU_ITEM.key, 800), _keys.BLOCKQUOTE_MENU_ITEM.key, 900), _keys.PLACEHOLDER_TEXT_MENU_ITEM.key, 1000);
17
17
  var ROVO_SECTION_RANK = exports.ROVO_SECTION_RANK = (0, _defineProperty2.default)({}, _keys.ASK_ROVO_MENU_ITEM.key, 100);
18
- var DATA_AND_CHARTS_SECTION_RANK = exports.DATA_AND_CHARTS_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.JIRA_WORK_ITEMS_MENU_ITEM.key, 300), _keys.CONFLUENCE_LIST_MENU_ITEM.key, 400), _keys.ASSETS_MENU_ITEM.key, 500);
18
+ var DATA_AND_CHARTS_SECTION_RANK = exports.DATA_AND_CHARTS_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.JIRA_WORK_ITEMS_MENU_ITEM.key, 300), _keys.CONFLUENCE_LIST_MENU_ITEM.key, 400), _keys.ASSETS_MENU_ITEM.key, 2450);
19
19
  var OTHER_SECTION_RANK = exports.OTHER_SECTION_RANK = (0, _defineProperty2.default)({}, _keys.HELP_DIALOG_MENU_ITEM.key, 100);
20
20
  var EXTENSION_ITEM_RANK = exports.EXTENSION_ITEM_RANK = 1500;
21
21
  var CATEGORY_VIEW_MORE_RANK = exports.CATEGORY_VIEW_MORE_RANK = Number.MAX_SAFE_INTEGER;
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "134.2.1";
26
+ var packageVersion = "134.3.1";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -147,6 +147,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
147
147
  var ownerDocument = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components') ? trigger.ownerDocument : document;
148
148
  var tooltip = ownerDocument.createElement('span');
149
149
  tooltip.role = 'tooltip';
150
+ // eslint-disable-next-line @atlaskit/design-system/no-native-popover-or-dialog -- a plain DOM tooltip for ProseMirror that hides on Escape with its own window listener, outside the shared Escape stack; TODO move to a top-layer primitive
150
151
  tooltip.popover = 'hint';
151
152
  tooltip.className = className;
152
153
  tooltip.id = id !== null && id !== void 0 ? id : generateTooltipId();
@@ -1,4 +1,6 @@
1
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
1
2
  import { NATIVE_EMBED_MAUI_EXTENSION_KEY } from '../extensions/native-embed-maui-extension-key';
3
+ import { preserveNodeView } from '../preserve-node-view';
2
4
 
3
5
  // Do not polyfill with insertBefore: it disconnects an iframe and resets its browsing context.
4
6
 
@@ -23,6 +25,18 @@ export function preserveRemixNodeView({
23
25
  if (!isRemixNodeForPreservation(node)) {
24
26
  return createExtensionNode(node).init();
25
27
  }
28
+ if (isExperimentEnabled('platform_editor_preserve_smart_card_embeds')) {
29
+ return preserveNodeView({
30
+ node,
31
+ view,
32
+ getPos,
33
+ renderProps,
34
+ rendererKind,
35
+ createNodeView: createExtensionNode,
36
+ isSameNode: sameChart,
37
+ canUpdateNode: (previous, next) => previous.type === next.type && previous.attrs.localId === next.attrs.localId && previous.attrs.extensionKey === next.attrs.extensionKey
38
+ });
39
+ }
26
40
  const ownerDocument = view.dom.ownerDocument;
27
41
  const slot = ownerDocument.createElement('div');
28
42
  if (!view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
@@ -0,0 +1,23 @@
1
+ /** Check selected cells locally and stop as soon as any requested mark is found. */
2
+ export const cellSelectionHasAnyMark = (selection, markTypes) => {
3
+ if (markTypes.length === 0) {
4
+ return false;
5
+ }
6
+ const nodeHasAnyMark = node => {
7
+ if (markTypes.some(markType => !!markType.isInSet(node.marks))) {
8
+ return true;
9
+ }
10
+ for (let index = 0; index < node.childCount; index++) {
11
+ if (nodeHasAnyMark(node.child(index))) {
12
+ return true;
13
+ }
14
+ }
15
+ return false;
16
+ };
17
+
18
+ // CellSelection already has one resolved range per selected cell, including merged cells.
19
+ // Reuse those nodes instead of rebuilding the table rectangle and resolving each cell again.
20
+ return selection.ranges.some(({
21
+ $from
22
+ }) => nodeHasAnyMark($from.parent));
23
+ };
@@ -0,0 +1,20 @@
1
+ const supportedMarkTypesCache = new WeakMap();
2
+
3
+ /**
4
+ * Resolve mark names against a schema, omitting unsupported marks.
5
+ * Reuse the result for the same schema and mark-name array; callers must not mutate either input.
6
+ */
7
+ export const getSupportedMarkTypes = (schema, markNames) => {
8
+ let schemaCache = supportedMarkTypesCache.get(schema);
9
+ if (!schemaCache) {
10
+ schemaCache = new WeakMap();
11
+ supportedMarkTypesCache.set(schema, schemaCache);
12
+ }
13
+ const cachedMarks = schemaCache.get(markNames);
14
+ if (cachedMarks) {
15
+ return cachedMarks;
16
+ }
17
+ const marks = markNames.map(name => schema.marks[name]).filter(mark => !!mark);
18
+ schemaCache.set(markNames, marks);
19
+ return marks;
20
+ };
@@ -1,3 +1,4 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
1
2
  import { expVal } from '@atlaskit/platform-feature-experiments/exp-val';
2
3
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  const GENERIC_MENTION_IDS = ['HipChat', 'all', 'here'];
@@ -11,5 +12,5 @@ export function isMentionAvatarEnabled({
11
12
  }) {
12
13
  // Preserve Platform's cohort exposure, including when a provider is missing.
13
14
  const cohort = expVal('convo_ai_entity_hover_cards_non_hello_exp', 'hover_card_cohort', 'control');
14
- return (hasProvider || canReportMissingProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider') || (userType === 'APP' || userType === 'AGENT') && isExperimentEnabled('platform_editor_drop3_hexagon_agent_avatar'));
15
+ return (hasProvider || canReportMissingProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (cohort === 'person' || cohort === 'all' || isExperimentEnabled('platform_editor_mention_node_avatar') || FeatureGates.checkGate('canvas-rovo-comment-sessions') || isExperimentEnabled('platform_editor_mention_node_graphql_provider') || (userType === 'APP' || userType === 'AGENT') && isExperimentEnabled('platform_editor_drop3_hexagon_agent_avatar'));
15
16
  }
@@ -165,11 +165,17 @@ export const messages = defineMessages({
165
165
  defaultMessage: 'Go to link',
166
166
  description: 'An option in the configure link dropdown that informs the user they can click the option to open the link'
167
167
  },
168
+ // Remove when cleaning up platform_editor_slash_command
168
169
  datasourceConfluenceSearch: {
169
170
  id: 'fabric.editor.datasource.confluenceSearch',
170
171
  defaultMessage: 'Insert Confluence list',
171
172
  description: 'Title shown for Confluence Search datasource on QuickInsert options'
172
173
  },
174
+ datasourceConfluenceList: {
175
+ id: 'fabric.editor.datasource.confluenceList',
176
+ defaultMessage: 'Confluence list',
177
+ description: 'Title shown for Confluence Search datasource in the Data and charts section of the editor slash command menu'
178
+ },
173
179
  datasourceConfluenceSearchDescription: {
174
180
  id: 'fabric.editor.datasource.confluenceSearch.description',
175
181
  defaultMessage: 'Display filtered Confluence search results',
@@ -230,11 +230,17 @@ export const toolbarInsertBlockMessages = defineMessages({
230
230
  defaultMessage: 'Browse all the keyboard shortcuts and markdown options',
231
231
  description: 'Displayed as a description text for the help option in the editor insert menu, explaining that it opens a dialog where users can view all available keyboard shortcuts and markdown formatting options.'
232
232
  },
233
+ // Remove when cleaning up platform_editor_slash_command
233
234
  recordVideo: {
234
235
  id: 'fabric.editor.recordVideo',
235
236
  defaultMessage: 'Record a Loom video',
236
237
  description: 'Shown as a menu item label in the editor insert menu, used to trigger recording a Loom video to embed in the document.'
237
238
  },
239
+ loomTitle: {
240
+ id: 'fabric.editor.loomTitle',
241
+ defaultMessage: 'Loom',
242
+ description: 'Shown as a menu item label in the Create section of the editor slash command menu, used to trigger recording a Loom video to embed in the document.'
243
+ },
238
244
  addLoomVideo: {
239
245
  id: 'fabric.editor.addLoomVideo',
240
246
  defaultMessage: 'Record a Loom video',
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "134.2.1";
16
+ const packageVersion = "134.3.1";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007