@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.
- package/CHANGELOG.md +61 -0
- package/dist/cjs/extensibility/preserveRemixNodeView.js +16 -0
- package/dist/cjs/mark/cell-selection-has-any-mark.js +32 -0
- package/dist/cjs/mark/get-supported-mark-types.js +30 -0
- package/dist/cjs/mention-avatar.js +3 -1
- package/dist/cjs/messages/card.js +6 -0
- package/dist/cjs/messages/insert-block.js +6 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preserve-node-view.js +155 -0
- package/dist/cjs/quick-insert/rank.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/vanilla-tooltip/index.js +1 -0
- package/dist/es2019/extensibility/preserveRemixNodeView.js +14 -0
- package/dist/es2019/mark/cell-selection-has-any-mark.js +23 -0
- package/dist/es2019/mark/get-supported-mark-types.js +20 -0
- package/dist/es2019/mention-avatar.js +2 -1
- package/dist/es2019/messages/card.js +6 -0
- package/dist/es2019/messages/insert-block.js +6 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preserve-node-view.js +137 -0
- package/dist/es2019/quick-insert/rank.js +3 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/vanilla-tooltip/index.js +1 -0
- package/dist/esm/extensibility/preserveRemixNodeView.js +16 -0
- package/dist/esm/mark/cell-selection-has-any-mark.js +26 -0
- package/dist/esm/mark/get-supported-mark-types.js +24 -0
- package/dist/esm/mention-avatar.js +2 -1
- package/dist/esm/messages/card.js +6 -0
- package/dist/esm/messages/insert-block.js +6 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preserve-node-view.js +149 -0
- package/dist/esm/quick-insert/rank.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/vanilla-tooltip/index.js +1 -0
- package/dist/types/collab/index.d.ts +8 -2
- package/dist/types/mark/cell-selection-has-any-mark.d.ts +4 -0
- package/dist/types/mark/get-supported-mark-types.d.ts +6 -0
- package/dist/types/messages/card.d.ts +75 -70
- package/dist/types/messages/insert-block.d.ts +5 -0
- package/dist/types/preserve-node-view.d.ts +39 -0
- package/mark/cell-selection-has-any-mark/package.json +10 -0
- package/mark/get-supported-mark-types/package.json +10 -0
- package/package.json +10 -10
- package/preserve-node-view/package.json +10 -0
- package/dist/cjs/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -42
- package/dist/cjs/prosemirror-node-view.js +0 -1
- package/dist/cjs/sync-block/types.js +0 -1
- package/dist/cjs/utils/isNodeTypeValidChildOf.js +0 -23
- package/dist/es2019/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -39
- package/dist/es2019/prosemirror-node-view.js +0 -0
- package/dist/es2019/sync-block/types.js +0 -0
- package/dist/es2019/utils/isNodeTypeValidChildOf.js +0 -17
- package/dist/esm/element-browser/components/ElementList/cellSizeAndPositionGetter.js +0 -37
- package/dist/esm/prosemirror-node-view.js +0 -0
- package/dist/esm/sync-block/types.js +0 -0
- package/dist/esm/utils/isNodeTypeValidChildOf.js +0 -17
- package/dist/types/element-browser/components/ElementList/cellSizeAndPositionGetter.d.ts +0 -7
- package/dist/types/prosemirror-node-view.d.ts +0 -0
- package/dist/types/sync-block/types.d.ts +0 -4
- package/dist/types/utils/isNodeTypeValidChildOf.d.ts +0 -7
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Do not polyfill with insertBefore: it disconnects an iframe and resets its browsing context.
|
|
2
|
+
|
|
3
|
+
const editors = new WeakMap();
|
|
4
|
+
/**
|
|
5
|
+
* Preserves an atomic React node view across ProseMirror redraws when native
|
|
6
|
+
* state-preserving DOM moves are available. A disposable slot parks the
|
|
7
|
+
* portal before ProseMirror disconnects its mark wrapper. After reconciliation, the
|
|
8
|
+
* replacement claims the parked portal without taking one from a still-live node.
|
|
9
|
+
*/
|
|
10
|
+
export function preserveNodeView({
|
|
11
|
+
node,
|
|
12
|
+
view,
|
|
13
|
+
getPos,
|
|
14
|
+
renderProps,
|
|
15
|
+
rendererKind,
|
|
16
|
+
createNodeView,
|
|
17
|
+
isSameNode,
|
|
18
|
+
canUpdateNode,
|
|
19
|
+
canReuse,
|
|
20
|
+
onAttach,
|
|
21
|
+
requireUniqueMatch = false
|
|
22
|
+
}) {
|
|
23
|
+
const ownerDocument = view.dom.ownerDocument;
|
|
24
|
+
const slot = ownerDocument.createElement('div');
|
|
25
|
+
if (!node.isAtom || !view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
|
|
26
|
+
return createNodeView(node).init();
|
|
27
|
+
}
|
|
28
|
+
const owner = {
|
|
29
|
+
getPos,
|
|
30
|
+
destroyed: false
|
|
31
|
+
};
|
|
32
|
+
let entries = editors.get(view);
|
|
33
|
+
if (!entries) {
|
|
34
|
+
entries = new Set();
|
|
35
|
+
editors.set(view, entries);
|
|
36
|
+
}
|
|
37
|
+
const registry = entries;
|
|
38
|
+
let entry;
|
|
39
|
+
let latestNode = node;
|
|
40
|
+
let latestDecorations = [];
|
|
41
|
+
let latestInnerDecorations;
|
|
42
|
+
|
|
43
|
+
// Construction can precede the old slot's destroy(). Defer portal adoption until
|
|
44
|
+
// both hooks have run; no rendering opportunity occurs between these microtasks.
|
|
45
|
+
queueMicrotask(() => {
|
|
46
|
+
if (owner.destroyed || view.isDestroyed || !slot.isConnected) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const matches = existing => existing.rendererKind === rendererKind && isSameNode(existing.inner.node, latestNode) && (!canReuse || canReuse(existing.inner));
|
|
50
|
+
if (requireUniqueMatch) {
|
|
51
|
+
// Duplicate nodes can share a ProseMirror object while owning different iframe state.
|
|
52
|
+
const candidates = Array.from(registry).filter(matches);
|
|
53
|
+
entry = candidates.length === 1 && candidates[0].owner.destroyed ? candidates[0] : undefined;
|
|
54
|
+
} else {
|
|
55
|
+
entry = Array.from(registry).find(existing => existing.owner.destroyed && matches(existing));
|
|
56
|
+
}
|
|
57
|
+
if (entry) {
|
|
58
|
+
var _slot$moveBefore, _entry$parking;
|
|
59
|
+
entry.owner = owner;
|
|
60
|
+
entry.inner.reactComponentProps = renderProps;
|
|
61
|
+
(_slot$moveBefore = slot.moveBefore) === null || _slot$moveBefore === void 0 ? void 0 : _slot$moveBefore.call(slot, entry.inner.dom, null);
|
|
62
|
+
(_entry$parking = entry.parking) === null || _entry$parking === void 0 ? void 0 : _entry$parking.remove();
|
|
63
|
+
entry.parking = undefined;
|
|
64
|
+
onAttach === null || onAttach === void 0 ? void 0 : onAttach(entry.inner, slot, () => owner.destroyed ? undefined : owner.getPos());
|
|
65
|
+
if (!entry.inner.update(latestNode, latestDecorations, latestInnerDecorations)) {
|
|
66
|
+
// A renderer can reject an update even after its identity matches.
|
|
67
|
+
registry.delete(entry);
|
|
68
|
+
const dom = entry.inner.dom;
|
|
69
|
+
entry.inner.destroy();
|
|
70
|
+
dom.remove();
|
|
71
|
+
entry = undefined;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!entry) {
|
|
75
|
+
// Construct only after the old slot has had a chance to park its portal.
|
|
76
|
+
const inner = createNodeView(latestNode);
|
|
77
|
+
const retained = {
|
|
78
|
+
inner,
|
|
79
|
+
owner,
|
|
80
|
+
rendererKind
|
|
81
|
+
};
|
|
82
|
+
entry = retained;
|
|
83
|
+
inner.getPos = () => retained.owner.destroyed ? undefined : retained.owner.getPos();
|
|
84
|
+
inner.init();
|
|
85
|
+
slot.appendChild(inner.dom);
|
|
86
|
+
onAttach === null || onAttach === void 0 ? void 0 : onAttach(inner, slot, () => owner.destroyed ? undefined : owner.getPos());
|
|
87
|
+
registry.add(retained);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
dom: slot,
|
|
92
|
+
// ProseMirror must not manage the retained atom's portal children.
|
|
93
|
+
update(next, decorations, innerDecorations) {
|
|
94
|
+
if (!canUpdateNode(node, next)) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
latestNode = next;
|
|
98
|
+
latestDecorations = decorations;
|
|
99
|
+
latestInnerDecorations = innerDecorations;
|
|
100
|
+
return entry ? entry.inner.update(next, decorations, innerDecorations) : true;
|
|
101
|
+
},
|
|
102
|
+
stopEvent: event => {
|
|
103
|
+
var _entry$inner$stopEven, _entry;
|
|
104
|
+
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;
|
|
105
|
+
},
|
|
106
|
+
ignoreMutation: mutation => {
|
|
107
|
+
var _entry$inner$ignoreMu, _entry2, _entry2$inner$ignoreM, _entry2$inner;
|
|
108
|
+
return (_entry$inner$ignoreMu = (_entry2 = entry) === null || _entry2 === void 0 ? 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';
|
|
109
|
+
},
|
|
110
|
+
destroy() {
|
|
111
|
+
owner.destroyed = true;
|
|
112
|
+
if (!entry) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const retained = entry;
|
|
116
|
+
if (retained.inner.dom.isConnected) {
|
|
117
|
+
var _parking$moveBefore;
|
|
118
|
+
const parking = ownerDocument.createElement('div');
|
|
119
|
+
// Transient, outside the editable document and inaccessible while awaiting handoff.
|
|
120
|
+
parking.hidden = true;
|
|
121
|
+
ownerDocument.body.appendChild(parking);
|
|
122
|
+
(_parking$moveBefore = parking.moveBefore) === null || _parking$moveBefore === void 0 ? void 0 : _parking$moveBefore.call(parking, retained.inner.dom, null);
|
|
123
|
+
retained.parking = parking;
|
|
124
|
+
}
|
|
125
|
+
// Give constructors queued after destroy() a chance to claim the portal first.
|
|
126
|
+
queueMicrotask(() => queueMicrotask(() => {
|
|
127
|
+
if (retained.owner === owner && registry.delete(retained)) {
|
|
128
|
+
var _retained$parking;
|
|
129
|
+
const dom = retained.inner.dom;
|
|
130
|
+
retained.inner.destroy();
|
|
131
|
+
dom.remove();
|
|
132
|
+
(_retained$parking = retained.parking) === null || _retained$parking === void 0 ? void 0 : _retained$parking.remove();
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
@@ -71,7 +71,9 @@ export const ROVO_SECTION_RANK = {
|
|
|
71
71
|
export const DATA_AND_CHARTS_SECTION_RANK = {
|
|
72
72
|
[JIRA_WORK_ITEMS_MENU_ITEM.key]: 300,
|
|
73
73
|
[CONFLUENCE_LIST_MENU_ITEM.key]: 400,
|
|
74
|
-
|
|
74
|
+
// Extension items in this section rank at EXTENSION_ITEM_RANK (1500) + priority, so Assets sits
|
|
75
|
+
// after the Spaces items (priority 900) and before Calendar (2500).
|
|
76
|
+
[ASSETS_MENU_ITEM.key]: 2450
|
|
75
77
|
};
|
|
76
78
|
export const OTHER_SECTION_RANK = {
|
|
77
79
|
[HELP_DIALOG_MENU_ITEM.key]: 100
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "134.
|
|
16
|
+
const packageVersion = "134.3.1";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -134,6 +134,7 @@ export class VanillaTooltip {
|
|
|
134
134
|
const ownerDocument = isExperimentEnabled('platform_editor_use_vanilla_components') ? trigger.ownerDocument : document;
|
|
135
135
|
const tooltip = ownerDocument.createElement('span');
|
|
136
136
|
tooltip.role = 'tooltip';
|
|
137
|
+
// 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
|
|
137
138
|
tooltip.popover = 'hint';
|
|
138
139
|
tooltip.className = className;
|
|
139
140
|
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
|
|
|
@@ -30,6 +32,20 @@ export function preserveRemixNodeView(_ref) {
|
|
|
30
32
|
if (!isRemixNodeForPreservation(node)) {
|
|
31
33
|
return createExtensionNode(node).init();
|
|
32
34
|
}
|
|
35
|
+
if (isExperimentEnabled('platform_editor_preserve_smart_card_embeds')) {
|
|
36
|
+
return preserveNodeView({
|
|
37
|
+
node: node,
|
|
38
|
+
view: view,
|
|
39
|
+
getPos: getPos,
|
|
40
|
+
renderProps: renderProps,
|
|
41
|
+
rendererKind: rendererKind,
|
|
42
|
+
createNodeView: createExtensionNode,
|
|
43
|
+
isSameNode: sameChart,
|
|
44
|
+
canUpdateNode: function canUpdateNode(previous, next) {
|
|
45
|
+
return previous.type === next.type && previous.attrs.localId === next.attrs.localId && previous.attrs.extensionKey === next.attrs.extensionKey;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
33
49
|
var ownerDocument = view.dom.ownerDocument;
|
|
34
50
|
var slot = ownerDocument.createElement('div');
|
|
35
51
|
if (!view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Check selected cells locally and stop as soon as any requested mark is found. */
|
|
2
|
+
export var cellSelectionHasAnyMark = function cellSelectionHasAnyMark(selection, markTypes) {
|
|
3
|
+
if (markTypes.length === 0) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
var _nodeHasAnyMark = function nodeHasAnyMark(node) {
|
|
7
|
+
if (markTypes.some(function (markType) {
|
|
8
|
+
return !!markType.isInSet(node.marks);
|
|
9
|
+
})) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
for (var index = 0; index < node.childCount; index++) {
|
|
13
|
+
if (_nodeHasAnyMark(node.child(index))) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// CellSelection already has one resolved range per selected cell, including merged cells.
|
|
21
|
+
// Reuse those nodes instead of rebuilding the table rectangle and resolving each cell again.
|
|
22
|
+
return selection.ranges.some(function (_ref) {
|
|
23
|
+
var $from = _ref.$from;
|
|
24
|
+
return _nodeHasAnyMark($from.parent);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var 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 var getSupportedMarkTypes = function getSupportedMarkTypes(schema, markNames) {
|
|
8
|
+
var schemaCache = supportedMarkTypesCache.get(schema);
|
|
9
|
+
if (!schemaCache) {
|
|
10
|
+
schemaCache = new WeakMap();
|
|
11
|
+
supportedMarkTypesCache.set(schema, schemaCache);
|
|
12
|
+
}
|
|
13
|
+
var cachedMarks = schemaCache.get(markNames);
|
|
14
|
+
if (cachedMarks) {
|
|
15
|
+
return cachedMarks;
|
|
16
|
+
}
|
|
17
|
+
var marks = markNames.map(function (name) {
|
|
18
|
+
return schema.marks[name];
|
|
19
|
+
}).filter(function (mark) {
|
|
20
|
+
return !!mark;
|
|
21
|
+
});
|
|
22
|
+
schemaCache.set(markNames, marks);
|
|
23
|
+
return marks;
|
|
24
|
+
};
|
|
@@ -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
|
var GENERIC_MENTION_IDS = ['HipChat', 'all', 'here'];
|
|
@@ -11,5 +12,5 @@ export function isMentionAvatarEnabled(_ref) {
|
|
|
11
12
|
canReportMissingProvider = _ref$canReportMissing === void 0 ? false : _ref$canReportMissing;
|
|
12
13
|
// Preserve Platform's cohort exposure, including when a provider is missing.
|
|
13
14
|
var 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 var 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 var 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',
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
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 = "134.
|
|
22
|
+
var packageVersion = "134.3.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Do not polyfill with insertBefore: it disconnects an iframe and resets its browsing context.
|
|
2
|
+
|
|
3
|
+
var editors = new WeakMap();
|
|
4
|
+
/**
|
|
5
|
+
* Preserves an atomic React node view across ProseMirror redraws when native
|
|
6
|
+
* state-preserving DOM moves are available. A disposable slot parks the
|
|
7
|
+
* portal before ProseMirror disconnects its mark wrapper. After reconciliation, the
|
|
8
|
+
* replacement claims the parked portal without taking one from a still-live node.
|
|
9
|
+
*/
|
|
10
|
+
export function preserveNodeView(_ref) {
|
|
11
|
+
var node = _ref.node,
|
|
12
|
+
view = _ref.view,
|
|
13
|
+
getPos = _ref.getPos,
|
|
14
|
+
renderProps = _ref.renderProps,
|
|
15
|
+
rendererKind = _ref.rendererKind,
|
|
16
|
+
createNodeView = _ref.createNodeView,
|
|
17
|
+
isSameNode = _ref.isSameNode,
|
|
18
|
+
canUpdateNode = _ref.canUpdateNode,
|
|
19
|
+
canReuse = _ref.canReuse,
|
|
20
|
+
onAttach = _ref.onAttach,
|
|
21
|
+
_ref$requireUniqueMat = _ref.requireUniqueMatch,
|
|
22
|
+
requireUniqueMatch = _ref$requireUniqueMat === void 0 ? false : _ref$requireUniqueMat;
|
|
23
|
+
var ownerDocument = view.dom.ownerDocument;
|
|
24
|
+
var slot = ownerDocument.createElement('div');
|
|
25
|
+
if (!node.isAtom || !view.dom.isConnected || typeof getPos !== 'function' || typeof slot.moveBefore !== 'function') {
|
|
26
|
+
return createNodeView(node).init();
|
|
27
|
+
}
|
|
28
|
+
var owner = {
|
|
29
|
+
getPos: getPos,
|
|
30
|
+
destroyed: false
|
|
31
|
+
};
|
|
32
|
+
var entries = editors.get(view);
|
|
33
|
+
if (!entries) {
|
|
34
|
+
entries = new Set();
|
|
35
|
+
editors.set(view, entries);
|
|
36
|
+
}
|
|
37
|
+
var registry = entries;
|
|
38
|
+
var entry;
|
|
39
|
+
var latestNode = node;
|
|
40
|
+
var latestDecorations = [];
|
|
41
|
+
var latestInnerDecorations;
|
|
42
|
+
|
|
43
|
+
// Construction can precede the old slot's destroy(). Defer portal adoption until
|
|
44
|
+
// both hooks have run; no rendering opportunity occurs between these microtasks.
|
|
45
|
+
queueMicrotask(function () {
|
|
46
|
+
if (owner.destroyed || view.isDestroyed || !slot.isConnected) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var matches = function matches(existing) {
|
|
50
|
+
return existing.rendererKind === rendererKind && isSameNode(existing.inner.node, latestNode) && (!canReuse || canReuse(existing.inner));
|
|
51
|
+
};
|
|
52
|
+
if (requireUniqueMatch) {
|
|
53
|
+
// Duplicate nodes can share a ProseMirror object while owning different iframe state.
|
|
54
|
+
var candidates = Array.from(registry).filter(matches);
|
|
55
|
+
entry = candidates.length === 1 && candidates[0].owner.destroyed ? candidates[0] : undefined;
|
|
56
|
+
} else {
|
|
57
|
+
entry = Array.from(registry).find(function (existing) {
|
|
58
|
+
return existing.owner.destroyed && matches(existing);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (entry) {
|
|
62
|
+
var _slot$moveBefore, _entry$parking;
|
|
63
|
+
entry.owner = owner;
|
|
64
|
+
entry.inner.reactComponentProps = renderProps;
|
|
65
|
+
(_slot$moveBefore = slot.moveBefore) === null || _slot$moveBefore === void 0 || _slot$moveBefore.call(slot, entry.inner.dom, null);
|
|
66
|
+
(_entry$parking = entry.parking) === null || _entry$parking === void 0 || _entry$parking.remove();
|
|
67
|
+
entry.parking = undefined;
|
|
68
|
+
onAttach === null || onAttach === void 0 || onAttach(entry.inner, slot, function () {
|
|
69
|
+
return owner.destroyed ? undefined : owner.getPos();
|
|
70
|
+
});
|
|
71
|
+
if (!entry.inner.update(latestNode, latestDecorations, latestInnerDecorations)) {
|
|
72
|
+
// A renderer can reject an update even after its identity matches.
|
|
73
|
+
registry.delete(entry);
|
|
74
|
+
var dom = entry.inner.dom;
|
|
75
|
+
entry.inner.destroy();
|
|
76
|
+
dom.remove();
|
|
77
|
+
entry = undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!entry) {
|
|
81
|
+
// Construct only after the old slot has had a chance to park its portal.
|
|
82
|
+
var inner = createNodeView(latestNode);
|
|
83
|
+
var retained = {
|
|
84
|
+
inner: inner,
|
|
85
|
+
owner: owner,
|
|
86
|
+
rendererKind: rendererKind
|
|
87
|
+
};
|
|
88
|
+
entry = retained;
|
|
89
|
+
inner.getPos = function () {
|
|
90
|
+
return retained.owner.destroyed ? undefined : retained.owner.getPos();
|
|
91
|
+
};
|
|
92
|
+
inner.init();
|
|
93
|
+
slot.appendChild(inner.dom);
|
|
94
|
+
onAttach === null || onAttach === void 0 || onAttach(inner, slot, function () {
|
|
95
|
+
return owner.destroyed ? undefined : owner.getPos();
|
|
96
|
+
});
|
|
97
|
+
registry.add(retained);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
dom: slot,
|
|
102
|
+
// ProseMirror must not manage the retained atom's portal children.
|
|
103
|
+
update: function update(next, decorations, innerDecorations) {
|
|
104
|
+
if (!canUpdateNode(node, next)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
latestNode = next;
|
|
108
|
+
latestDecorations = decorations;
|
|
109
|
+
latestInnerDecorations = innerDecorations;
|
|
110
|
+
return entry ? entry.inner.update(next, decorations, innerDecorations) : true;
|
|
111
|
+
},
|
|
112
|
+
stopEvent: function stopEvent(event) {
|
|
113
|
+
var _entry$inner$stopEven, _entry;
|
|
114
|
+
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;
|
|
115
|
+
},
|
|
116
|
+
ignoreMutation: function ignoreMutation(mutation) {
|
|
117
|
+
var _entry$inner$ignoreMu, _entry2, _entry2$inner$ignoreM, _entry2$inner;
|
|
118
|
+
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';
|
|
119
|
+
},
|
|
120
|
+
destroy: function destroy() {
|
|
121
|
+
owner.destroyed = true;
|
|
122
|
+
if (!entry) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
var retained = entry;
|
|
126
|
+
if (retained.inner.dom.isConnected) {
|
|
127
|
+
var _parking$moveBefore;
|
|
128
|
+
var parking = ownerDocument.createElement('div');
|
|
129
|
+
// Transient, outside the editable document and inaccessible while awaiting handoff.
|
|
130
|
+
parking.hidden = true;
|
|
131
|
+
ownerDocument.body.appendChild(parking);
|
|
132
|
+
(_parking$moveBefore = parking.moveBefore) === null || _parking$moveBefore === void 0 || _parking$moveBefore.call(parking, retained.inner.dom, null);
|
|
133
|
+
retained.parking = parking;
|
|
134
|
+
}
|
|
135
|
+
// Give constructors queued after destroy() a chance to claim the portal first.
|
|
136
|
+
queueMicrotask(function () {
|
|
137
|
+
return queueMicrotask(function () {
|
|
138
|
+
if (retained.owner === owner && registry.delete(retained)) {
|
|
139
|
+
var _retained$parking;
|
|
140
|
+
var dom = retained.inner.dom;
|
|
141
|
+
retained.inner.destroy();
|
|
142
|
+
dom.remove();
|
|
143
|
+
(_retained$parking = retained.parking) === null || _retained$parking === void 0 || _retained$parking.remove();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
@@ -9,7 +9,7 @@ export var MEDIA_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(
|
|
|
9
9
|
export var CREATE_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, JIRA_ISSUE_MENU_ITEM.key, 100), LOOM_MENU_ITEM.key, 200), CONFLUENCE_PAGE_MENU_ITEM.key, 300), DATABASE_MENU_ITEM.key, 400), WHITEBOARD_MENU_ITEM.key, 500), DIAGRAM_MENU_ITEM.key, 600), FLOWCHART_MENU_ITEM.key, 700), BRAINSTORMING_MENU_ITEM.key, 800), RETROSPECTIVE_MENU_ITEM.key, 900), ROADMAP_MENU_ITEM.key, 1000);
|
|
10
10
|
export var TEXT_FORMATTING_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, UNORDERED_LIST_MENU_ITEM.key, 100), ORDERED_LIST_MENU_ITEM.key, 200), HEADING_1_MENU_ITEM.key, 300), HEADING_2_MENU_ITEM.key, 400), HEADING_3_MENU_ITEM.key, 500), HEADING_4_MENU_ITEM.key, 600), HEADING_5_MENU_ITEM.key, 700), HEADING_6_MENU_ITEM.key, 800), BLOCKQUOTE_MENU_ITEM.key, 900), PLACEHOLDER_TEXT_MENU_ITEM.key, 1000);
|
|
11
11
|
export var ROVO_SECTION_RANK = _defineProperty({}, ASK_ROVO_MENU_ITEM.key, 100);
|
|
12
|
-
export var DATA_AND_CHARTS_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty({}, JIRA_WORK_ITEMS_MENU_ITEM.key, 300), CONFLUENCE_LIST_MENU_ITEM.key, 400), ASSETS_MENU_ITEM.key,
|
|
12
|
+
export var DATA_AND_CHARTS_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty({}, JIRA_WORK_ITEMS_MENU_ITEM.key, 300), CONFLUENCE_LIST_MENU_ITEM.key, 400), ASSETS_MENU_ITEM.key, 2450);
|
|
13
13
|
export var OTHER_SECTION_RANK = _defineProperty({}, HELP_DIALOG_MENU_ITEM.key, 100);
|
|
14
14
|
export var EXTENSION_ITEM_RANK = 1500;
|
|
15
15
|
export var CATEGORY_VIEW_MORE_RANK = Number.MAX_SAFE_INTEGER;
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "134.
|
|
23
|
+
var packageVersion = "134.3.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -140,6 +140,7 @@ export var VanillaTooltip = /*#__PURE__*/function () {
|
|
|
140
140
|
var ownerDocument = isExperimentEnabled('platform_editor_use_vanilla_components') ? trigger.ownerDocument : document;
|
|
141
141
|
var tooltip = ownerDocument.createElement('span');
|
|
142
142
|
tooltip.role = 'tooltip';
|
|
143
|
+
// 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
|
|
143
144
|
tooltip.popover = 'hint';
|
|
144
145
|
tooltip.className = className;
|
|
145
146
|
tooltip.id = id !== null && id !== void 0 ? id : generateTooltipId();
|
|
@@ -312,8 +312,6 @@ export interface BaseStepPM extends StepMetadata {
|
|
|
312
312
|
/** The agent's own id, as opposed to `agentId`, which carries its Atlassian account id. */
|
|
313
313
|
agentSourceId?: string;
|
|
314
314
|
agentType?: string;
|
|
315
|
-
/** True for a Forge / third-party / remote agent, so collaborators match its presentation. */
|
|
316
|
-
isThirdPartyAgent?: boolean;
|
|
317
315
|
clientId: number | string;
|
|
318
316
|
from?: number;
|
|
319
317
|
/**
|
|
@@ -326,6 +324,8 @@ export interface BaseStepPM extends StepMetadata {
|
|
|
326
324
|
* that do not send it, and never validated for format by the frontend.
|
|
327
325
|
*/
|
|
328
326
|
invocationId?: string;
|
|
327
|
+
/** True for a Forge / third-party / remote agent, so collaborators match its presentation. */
|
|
328
|
+
isThirdPartyAgent?: boolean;
|
|
329
329
|
slice?: SliceJson;
|
|
330
330
|
stepType: string;
|
|
331
331
|
to?: number;
|
|
@@ -411,6 +411,12 @@ type ProviderParticipantPermitLevel = {
|
|
|
411
411
|
};
|
|
412
412
|
export interface CollabParticipant {
|
|
413
413
|
actingUserId?: string;
|
|
414
|
+
/** Agent identity supplied by an agent-authored step, distinct from a human participant ID. */
|
|
415
|
+
agentId?: string;
|
|
416
|
+
/** Agent display name supplied by a step, distinct from the shared participant name. */
|
|
417
|
+
agentName?: string;
|
|
418
|
+
/** Stable external configuration reference supplied by an agent-authored step. */
|
|
419
|
+
agentNamedId?: string;
|
|
414
420
|
agentType?: string;
|
|
415
421
|
avatar: string;
|
|
416
422
|
cursorPos?: number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
3
|
+
/** Check selected cells locally and stop as soon as any requested mark is found. */
|
|
4
|
+
export declare const cellSelectionHasAnyMark: (selection: CellSelection, markTypes: ReadonlyArray<MarkType>) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MarkType, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve mark names against a schema, omitting unsupported marks.
|
|
4
|
+
* Reuse the result for the same schema and mark-name array; callers must not mutate either input.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getSupportedMarkTypes: (schema: Schema, markNames: ReadonlyArray<string>) => ReadonlyArray<MarkType>;
|