@atlaskit/editor-plugin-card 11.5.6 → 11.5.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/pm-plugins/main.js +0 -16
- package/dist/cjs/ui/analytics/events-from-tr.js +2 -25
- package/dist/es2019/pm-plugins/main.js +0 -22
- package/dist/es2019/ui/analytics/events-from-tr.js +1 -24
- package/dist/esm/pm-plugins/main.js +0 -16
- package/dist/esm/ui/analytics/events-from-tr.js +2 -25
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 11.5.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
|
|
8
|
+
tsignores added for help-center local consumpton removed
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 11.5.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 11.5.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -75,7 +75,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
75
75
|
});
|
|
76
76
|
return new _safePlugin.SafePlugin({
|
|
77
77
|
state: {
|
|
78
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
79
78
|
init: function init() {
|
|
80
79
|
return {
|
|
81
80
|
requests: [],
|
|
@@ -91,7 +90,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
91
90
|
layout: undefined
|
|
92
91
|
};
|
|
93
92
|
},
|
|
94
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
95
93
|
apply: function apply(tr, pluginState, prevEditorState) {
|
|
96
94
|
var _pluginState$requests;
|
|
97
95
|
// Update all the positions of outstanding requests and
|
|
@@ -140,7 +138,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
140
138
|
return newState;
|
|
141
139
|
}
|
|
142
140
|
},
|
|
143
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
144
141
|
filterTransaction: function filterTransaction(tr) {
|
|
145
142
|
var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
|
|
146
143
|
if (isOutsideClicked) {
|
|
@@ -151,7 +148,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
151
148
|
}
|
|
152
149
|
return true;
|
|
153
150
|
},
|
|
154
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
155
151
|
view: function view(_view) {
|
|
156
152
|
var domAtPos = _view.domAtPos.bind(_view);
|
|
157
153
|
var rafCancellationCallbacks = [];
|
|
@@ -159,7 +155,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
159
155
|
(0, _resolve.handleProvider)('cardProvider', options.provider, _view);
|
|
160
156
|
}
|
|
161
157
|
return {
|
|
162
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
163
158
|
update: function update(view, prevState) {
|
|
164
159
|
var _selection$node;
|
|
165
160
|
var currentState = (0, _state2.getPluginState)(view.state);
|
|
@@ -204,8 +199,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
204
199
|
var newRequests = (0, _state2.getNewRequests)(oldState, currentState);
|
|
205
200
|
// Ask the CardProvider to resolve all new requests.
|
|
206
201
|
var _provider = currentState.provider;
|
|
207
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
208
|
-
|
|
209
202
|
newRequests.forEach(function (request) {
|
|
210
203
|
/**
|
|
211
204
|
* Queue each asynchronous resolve request on separate frames.
|
|
@@ -232,11 +225,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
232
225
|
*/
|
|
233
226
|
cardPluginEvents === null || cardPluginEvents === void 0 || cardPluginEvents.flush();
|
|
234
227
|
},
|
|
235
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
236
228
|
destroy: function destroy() {
|
|
237
229
|
// Cancel any outstanding raf callbacks.
|
|
238
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
239
|
-
|
|
240
230
|
rafCancellationCallbacks.forEach(function (cancellationCallback) {
|
|
241
231
|
return cancellationCallback();
|
|
242
232
|
});
|
|
@@ -244,8 +234,6 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
244
234
|
};
|
|
245
235
|
},
|
|
246
236
|
props: _objectSpread({
|
|
247
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
248
|
-
|
|
249
237
|
nodeViews: {
|
|
250
238
|
inlineCard: (0, _lazyInlineCard.lazyInlineCardView)({
|
|
251
239
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
@@ -276,14 +264,10 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
276
264
|
})
|
|
277
265
|
}
|
|
278
266
|
}, enableInlineUpgradeFeatures && {
|
|
279
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
280
|
-
|
|
281
267
|
handleKeyDown: function handleKeyDown(view) {
|
|
282
268
|
handleAwarenessOverlay(view);
|
|
283
269
|
return false;
|
|
284
270
|
},
|
|
285
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
286
|
-
|
|
287
271
|
handleClick: function handleClick(view) {
|
|
288
272
|
handleAwarenessOverlay(view);
|
|
289
273
|
return false;
|
|
@@ -83,9 +83,6 @@ var findChanged = exports.findChanged = function findChanged(tr, state) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
88
|
-
|
|
89
86
|
stepMap.forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
90
87
|
var _tr$docs2;
|
|
91
88
|
var before = tr.docs[i];
|
|
@@ -112,8 +109,6 @@ var findChanged = exports.findChanged = function findChanged(tr, state) {
|
|
|
112
109
|
* Skip/filter out links that have been queued, they will be tracked later
|
|
113
110
|
*/
|
|
114
111
|
var queuedPositions = getQueuedPositions(tr);
|
|
115
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
116
|
-
|
|
117
112
|
return links.filter(function (link) {
|
|
118
113
|
return !queuedPositions.includes(link.pos);
|
|
119
114
|
});
|
|
@@ -171,8 +166,6 @@ var findChanged = exports.findChanged = function findChanged(tr, state) {
|
|
|
171
166
|
var newLink = inserted[_i];
|
|
172
167
|
|
|
173
168
|
// what is the 2nd argument 'assoc = -1' doing here exactly?
|
|
174
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
175
|
-
|
|
176
169
|
var mappedPos = tr.mapping.map(newLink.pos, -1);
|
|
177
170
|
var previousDisplay = getResolveLinkPrevDisplay(state, mappedPos);
|
|
178
171
|
updated.push({
|
|
@@ -214,8 +207,6 @@ var UPDATE_ACTIONS = [_analytics.ACTION.CHANGED_TYPE, _analytics.ACTION.UPDATED]
|
|
|
214
207
|
* intended to be perceived as an update to links, rather than insertion+deletion
|
|
215
208
|
*/
|
|
216
209
|
var isUpdateTr = function isUpdateTr(tr, isUndoOrRedo) {
|
|
217
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
218
|
-
|
|
219
210
|
return !!tr.steps.find(function (step) {
|
|
220
211
|
if (!(step instanceof _steps.LinkMetaStep)) {
|
|
221
212
|
return false;
|
|
@@ -262,9 +253,6 @@ var getQueuedPositions = function getQueuedPositions(tr) {
|
|
|
262
253
|
if (!isMetadataQueue(pluginMeta)) {
|
|
263
254
|
return [];
|
|
264
255
|
}
|
|
265
|
-
|
|
266
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
267
|
-
|
|
268
256
|
return pluginMeta.requests.map(function (_ref) {
|
|
269
257
|
var pos = _ref.pos;
|
|
270
258
|
return pos;
|
|
@@ -279,13 +267,9 @@ var getResolvePositions = function getResolvePositions(tr, state) {
|
|
|
279
267
|
if (!isMetadataResolve(pluginMeta)) {
|
|
280
268
|
return [];
|
|
281
269
|
}
|
|
282
|
-
return cardState.requests
|
|
283
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
284
|
-
.filter(function (request) {
|
|
270
|
+
return cardState.requests.filter(function (request) {
|
|
285
271
|
return request.url === pluginMeta.url;
|
|
286
|
-
})
|
|
287
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
288
|
-
.map(function (request) {
|
|
272
|
+
}).map(function (request) {
|
|
289
273
|
return request.pos;
|
|
290
274
|
});
|
|
291
275
|
};
|
|
@@ -295,9 +279,6 @@ var getResolveLinkPrevDisplay = function getResolveLinkPrevDisplay(state, pos) {
|
|
|
295
279
|
if (!cardState) {
|
|
296
280
|
return undefined;
|
|
297
281
|
}
|
|
298
|
-
|
|
299
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
300
|
-
|
|
301
282
|
return (_cardState$requests$f = cardState.requests.find(function (request) {
|
|
302
283
|
return request.pos === pos;
|
|
303
284
|
})) === null || _cardState$requests$f === void 0 ? void 0 : _cardState$requests$f.previousAppearance;
|
|
@@ -318,8 +299,6 @@ function eventsFromTransaction(tr, state) {
|
|
|
318
299
|
*/
|
|
319
300
|
var isRemote = tr.getMeta('isRemote');
|
|
320
301
|
var isReplaceDocument = tr.getMeta('replaceDocument');
|
|
321
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
322
|
-
|
|
323
302
|
var isTableSort = tr.steps.find(function (step) {
|
|
324
303
|
return step instanceof _customSteps.TableSortStep;
|
|
325
304
|
});
|
|
@@ -342,8 +321,6 @@ function eventsFromTransaction(tr, state) {
|
|
|
342
321
|
inserted = _findChanged.inserted,
|
|
343
322
|
updated = _findChanged.updated;
|
|
344
323
|
var MAX_LINK_EVENTS = 50;
|
|
345
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
346
|
-
|
|
347
324
|
if ([removed, inserted, updated].some(function (arr) {
|
|
348
325
|
return arr.length > MAX_LINK_EVENTS;
|
|
349
326
|
})) {
|
|
@@ -65,8 +65,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
65
65
|
});
|
|
66
66
|
return new SafePlugin({
|
|
67
67
|
state: {
|
|
68
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
69
|
-
|
|
70
68
|
init() {
|
|
71
69
|
return {
|
|
72
70
|
requests: [],
|
|
@@ -82,8 +80,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
82
80
|
layout: undefined
|
|
83
81
|
};
|
|
84
82
|
},
|
|
85
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
86
|
-
|
|
87
83
|
apply(tr, pluginState, prevEditorState) {
|
|
88
84
|
var _pluginState$requests;
|
|
89
85
|
// Update all the positions of outstanding requests and
|
|
@@ -133,8 +129,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
133
129
|
return newState;
|
|
134
130
|
}
|
|
135
131
|
},
|
|
136
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
137
|
-
|
|
138
132
|
filterTransaction(tr) {
|
|
139
133
|
const isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
|
|
140
134
|
if (isOutsideClicked) {
|
|
@@ -145,8 +139,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
145
139
|
}
|
|
146
140
|
return true;
|
|
147
141
|
},
|
|
148
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
149
|
-
|
|
150
142
|
view(view) {
|
|
151
143
|
const domAtPos = view.domAtPos.bind(view);
|
|
152
144
|
const rafCancellationCallbacks = [];
|
|
@@ -154,8 +146,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
154
146
|
handleProvider('cardProvider', options.provider, view);
|
|
155
147
|
}
|
|
156
148
|
return {
|
|
157
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
158
|
-
|
|
159
149
|
update(view, prevState) {
|
|
160
150
|
var _selection$node;
|
|
161
151
|
const currentState = getPluginState(view.state);
|
|
@@ -208,8 +198,6 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
208
198
|
const {
|
|
209
199
|
provider
|
|
210
200
|
} = currentState;
|
|
211
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
212
|
-
|
|
213
201
|
newRequests.forEach(request => {
|
|
214
202
|
/**
|
|
215
203
|
* Queue each asynchronous resolve request on separate frames.
|
|
@@ -236,19 +224,13 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
236
224
|
*/
|
|
237
225
|
cardPluginEvents === null || cardPluginEvents === void 0 ? void 0 : cardPluginEvents.flush();
|
|
238
226
|
},
|
|
239
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
240
|
-
|
|
241
227
|
destroy() {
|
|
242
228
|
// Cancel any outstanding raf callbacks.
|
|
243
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
244
|
-
|
|
245
229
|
rafCancellationCallbacks.forEach(cancellationCallback => cancellationCallback());
|
|
246
230
|
}
|
|
247
231
|
};
|
|
248
232
|
},
|
|
249
233
|
props: {
|
|
250
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
251
|
-
|
|
252
234
|
nodeViews: {
|
|
253
235
|
inlineCard: lazyInlineCardView({
|
|
254
236
|
inlineCardViewProducer,
|
|
@@ -279,14 +261,10 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
279
261
|
})
|
|
280
262
|
},
|
|
281
263
|
...(enableInlineUpgradeFeatures && {
|
|
282
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
283
|
-
|
|
284
264
|
handleKeyDown: view => {
|
|
285
265
|
handleAwarenessOverlay(view);
|
|
286
266
|
return false;
|
|
287
267
|
},
|
|
288
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
289
|
-
|
|
290
268
|
handleClick: view => {
|
|
291
269
|
handleAwarenessOverlay(view);
|
|
292
270
|
return false;
|
|
@@ -74,9 +74,6 @@ export const findChanged = (tr, state) => {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
79
|
-
|
|
80
77
|
stepMap.forEach((oldStart, oldEnd, newStart, newEnd) => {
|
|
81
78
|
var _tr$docs2;
|
|
82
79
|
const before = tr.docs[i];
|
|
@@ -99,8 +96,6 @@ export const findChanged = (tr, state) => {
|
|
|
99
96
|
* Skip/filter out links that have been queued, they will be tracked later
|
|
100
97
|
*/
|
|
101
98
|
const queuedPositions = getQueuedPositions(tr);
|
|
102
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
103
|
-
|
|
104
99
|
return links.filter(link => !queuedPositions.includes(link.pos));
|
|
105
100
|
};
|
|
106
101
|
|
|
@@ -154,8 +149,6 @@ export const findChanged = (tr, state) => {
|
|
|
154
149
|
const newLink = inserted[i];
|
|
155
150
|
|
|
156
151
|
// what is the 2nd argument 'assoc = -1' doing here exactly?
|
|
157
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
158
|
-
|
|
159
152
|
const mappedPos = tr.mapping.map(newLink.pos, -1);
|
|
160
153
|
const previousDisplay = getResolveLinkPrevDisplay(state, mappedPos);
|
|
161
154
|
updated.push({
|
|
@@ -197,8 +190,6 @@ const UPDATE_ACTIONS = [ACTION.CHANGED_TYPE, ACTION.UPDATED];
|
|
|
197
190
|
* intended to be perceived as an update to links, rather than insertion+deletion
|
|
198
191
|
*/
|
|
199
192
|
const isUpdateTr = (tr, isUndoOrRedo) => {
|
|
200
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
201
|
-
|
|
202
193
|
return !!tr.steps.find(step => {
|
|
203
194
|
if (!(step instanceof LinkMetaStep)) {
|
|
204
195
|
return false;
|
|
@@ -246,9 +237,6 @@ const getQueuedPositions = tr => {
|
|
|
246
237
|
if (!isMetadataQueue(pluginMeta)) {
|
|
247
238
|
return [];
|
|
248
239
|
}
|
|
249
|
-
|
|
250
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
251
|
-
|
|
252
240
|
return pluginMeta.requests.map(({
|
|
253
241
|
pos
|
|
254
242
|
}) => pos);
|
|
@@ -262,11 +250,7 @@ const getResolvePositions = (tr, state) => {
|
|
|
262
250
|
if (!isMetadataResolve(pluginMeta)) {
|
|
263
251
|
return [];
|
|
264
252
|
}
|
|
265
|
-
return cardState.requests
|
|
266
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
267
|
-
.filter(request => request.url === pluginMeta.url)
|
|
268
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
269
|
-
.map(request => request.pos);
|
|
253
|
+
return cardState.requests.filter(request => request.url === pluginMeta.url).map(request => request.pos);
|
|
270
254
|
};
|
|
271
255
|
const getResolveLinkPrevDisplay = (state, pos) => {
|
|
272
256
|
var _cardState$requests$f;
|
|
@@ -274,9 +258,6 @@ const getResolveLinkPrevDisplay = (state, pos) => {
|
|
|
274
258
|
if (!cardState) {
|
|
275
259
|
return undefined;
|
|
276
260
|
}
|
|
277
|
-
|
|
278
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
279
|
-
|
|
280
261
|
return (_cardState$requests$f = cardState.requests.find(request => request.pos === pos)) === null || _cardState$requests$f === void 0 ? void 0 : _cardState$requests$f.previousAppearance;
|
|
281
262
|
};
|
|
282
263
|
const isDatasourceDowngrade = (previousSubject, currentSubject) => previousSubject === EVENT_SUBJECT.DATASOURCE && currentSubject === EVENT_SUBJECT.LINK;
|
|
@@ -291,8 +272,6 @@ export function eventsFromTransaction(tr, state) {
|
|
|
291
272
|
*/
|
|
292
273
|
const isRemote = tr.getMeta('isRemote');
|
|
293
274
|
const isReplaceDocument = tr.getMeta('replaceDocument');
|
|
294
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
295
|
-
|
|
296
275
|
const isTableSort = tr.steps.find(step => step instanceof TableSortStep);
|
|
297
276
|
if (isRemote || isReplaceDocument || isTableSort) {
|
|
298
277
|
return events;
|
|
@@ -315,8 +294,6 @@ export function eventsFromTransaction(tr, state) {
|
|
|
315
294
|
updated
|
|
316
295
|
} = findChanged(tr, state);
|
|
317
296
|
const MAX_LINK_EVENTS = 50;
|
|
318
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
319
|
-
|
|
320
297
|
if ([removed, inserted, updated].some(arr => arr.length > MAX_LINK_EVENTS)) {
|
|
321
298
|
return [];
|
|
322
299
|
}
|
|
@@ -68,7 +68,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
68
68
|
});
|
|
69
69
|
return new SafePlugin({
|
|
70
70
|
state: {
|
|
71
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
72
71
|
init: function init() {
|
|
73
72
|
return {
|
|
74
73
|
requests: [],
|
|
@@ -84,7 +83,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
84
83
|
layout: undefined
|
|
85
84
|
};
|
|
86
85
|
},
|
|
87
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
88
86
|
apply: function apply(tr, pluginState, prevEditorState) {
|
|
89
87
|
var _pluginState$requests;
|
|
90
88
|
// Update all the positions of outstanding requests and
|
|
@@ -133,7 +131,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
133
131
|
return newState;
|
|
134
132
|
}
|
|
135
133
|
},
|
|
136
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
137
134
|
filterTransaction: function filterTransaction(tr) {
|
|
138
135
|
var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
|
|
139
136
|
if (isOutsideClicked) {
|
|
@@ -144,7 +141,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
144
141
|
}
|
|
145
142
|
return true;
|
|
146
143
|
},
|
|
147
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
148
144
|
view: function view(_view) {
|
|
149
145
|
var domAtPos = _view.domAtPos.bind(_view);
|
|
150
146
|
var rafCancellationCallbacks = [];
|
|
@@ -152,7 +148,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
152
148
|
handleProvider('cardProvider', options.provider, _view);
|
|
153
149
|
}
|
|
154
150
|
return {
|
|
155
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
156
151
|
update: function update(view, prevState) {
|
|
157
152
|
var _selection$node;
|
|
158
153
|
var currentState = getPluginState(view.state);
|
|
@@ -197,8 +192,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
197
192
|
var newRequests = getNewRequests(oldState, currentState);
|
|
198
193
|
// Ask the CardProvider to resolve all new requests.
|
|
199
194
|
var _provider = currentState.provider;
|
|
200
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
201
|
-
|
|
202
195
|
newRequests.forEach(function (request) {
|
|
203
196
|
/**
|
|
204
197
|
* Queue each asynchronous resolve request on separate frames.
|
|
@@ -225,11 +218,8 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
225
218
|
*/
|
|
226
219
|
cardPluginEvents === null || cardPluginEvents === void 0 || cardPluginEvents.flush();
|
|
227
220
|
},
|
|
228
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
229
221
|
destroy: function destroy() {
|
|
230
222
|
// Cancel any outstanding raf callbacks.
|
|
231
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
232
|
-
|
|
233
223
|
rafCancellationCallbacks.forEach(function (cancellationCallback) {
|
|
234
224
|
return cancellationCallback();
|
|
235
225
|
});
|
|
@@ -237,8 +227,6 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
237
227
|
};
|
|
238
228
|
},
|
|
239
229
|
props: _objectSpread({
|
|
240
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
241
|
-
|
|
242
230
|
nodeViews: {
|
|
243
231
|
inlineCard: lazyInlineCardView({
|
|
244
232
|
inlineCardViewProducer: inlineCardViewProducer,
|
|
@@ -269,14 +257,10 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
269
257
|
})
|
|
270
258
|
}
|
|
271
259
|
}, enableInlineUpgradeFeatures && {
|
|
272
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
273
|
-
|
|
274
260
|
handleKeyDown: function handleKeyDown(view) {
|
|
275
261
|
handleAwarenessOverlay(view);
|
|
276
262
|
return false;
|
|
277
263
|
},
|
|
278
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
279
|
-
|
|
280
264
|
handleClick: function handleClick(view) {
|
|
281
265
|
handleAwarenessOverlay(view);
|
|
282
266
|
return false;
|
|
@@ -76,9 +76,6 @@ export var findChanged = function findChanged(tr, state) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
81
|
-
|
|
82
79
|
stepMap.forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
83
80
|
var _tr$docs2;
|
|
84
81
|
var before = tr.docs[i];
|
|
@@ -105,8 +102,6 @@ export var findChanged = function findChanged(tr, state) {
|
|
|
105
102
|
* Skip/filter out links that have been queued, they will be tracked later
|
|
106
103
|
*/
|
|
107
104
|
var queuedPositions = getQueuedPositions(tr);
|
|
108
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
109
|
-
|
|
110
105
|
return links.filter(function (link) {
|
|
111
106
|
return !queuedPositions.includes(link.pos);
|
|
112
107
|
});
|
|
@@ -164,8 +159,6 @@ export var findChanged = function findChanged(tr, state) {
|
|
|
164
159
|
var newLink = inserted[_i];
|
|
165
160
|
|
|
166
161
|
// what is the 2nd argument 'assoc = -1' doing here exactly?
|
|
167
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
168
|
-
|
|
169
162
|
var mappedPos = tr.mapping.map(newLink.pos, -1);
|
|
170
163
|
var previousDisplay = getResolveLinkPrevDisplay(state, mappedPos);
|
|
171
164
|
updated.push({
|
|
@@ -207,8 +200,6 @@ var UPDATE_ACTIONS = [ACTION.CHANGED_TYPE, ACTION.UPDATED];
|
|
|
207
200
|
* intended to be perceived as an update to links, rather than insertion+deletion
|
|
208
201
|
*/
|
|
209
202
|
var isUpdateTr = function isUpdateTr(tr, isUndoOrRedo) {
|
|
210
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
211
|
-
|
|
212
203
|
return !!tr.steps.find(function (step) {
|
|
213
204
|
if (!(step instanceof LinkMetaStep)) {
|
|
214
205
|
return false;
|
|
@@ -255,9 +246,6 @@ var getQueuedPositions = function getQueuedPositions(tr) {
|
|
|
255
246
|
if (!isMetadataQueue(pluginMeta)) {
|
|
256
247
|
return [];
|
|
257
248
|
}
|
|
258
|
-
|
|
259
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
260
|
-
|
|
261
249
|
return pluginMeta.requests.map(function (_ref) {
|
|
262
250
|
var pos = _ref.pos;
|
|
263
251
|
return pos;
|
|
@@ -272,13 +260,9 @@ var getResolvePositions = function getResolvePositions(tr, state) {
|
|
|
272
260
|
if (!isMetadataResolve(pluginMeta)) {
|
|
273
261
|
return [];
|
|
274
262
|
}
|
|
275
|
-
return cardState.requests
|
|
276
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
277
|
-
.filter(function (request) {
|
|
263
|
+
return cardState.requests.filter(function (request) {
|
|
278
264
|
return request.url === pluginMeta.url;
|
|
279
|
-
})
|
|
280
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
281
|
-
.map(function (request) {
|
|
265
|
+
}).map(function (request) {
|
|
282
266
|
return request.pos;
|
|
283
267
|
});
|
|
284
268
|
};
|
|
@@ -288,9 +272,6 @@ var getResolveLinkPrevDisplay = function getResolveLinkPrevDisplay(state, pos) {
|
|
|
288
272
|
if (!cardState) {
|
|
289
273
|
return undefined;
|
|
290
274
|
}
|
|
291
|
-
|
|
292
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
293
|
-
|
|
294
275
|
return (_cardState$requests$f = cardState.requests.find(function (request) {
|
|
295
276
|
return request.pos === pos;
|
|
296
277
|
})) === null || _cardState$requests$f === void 0 ? void 0 : _cardState$requests$f.previousAppearance;
|
|
@@ -311,8 +292,6 @@ export function eventsFromTransaction(tr, state) {
|
|
|
311
292
|
*/
|
|
312
293
|
var isRemote = tr.getMeta('isRemote');
|
|
313
294
|
var isReplaceDocument = tr.getMeta('replaceDocument');
|
|
314
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
315
|
-
|
|
316
295
|
var isTableSort = tr.steps.find(function (step) {
|
|
317
296
|
return step instanceof TableSortStep;
|
|
318
297
|
});
|
|
@@ -335,8 +314,6 @@ export function eventsFromTransaction(tr, state) {
|
|
|
335
314
|
inserted = _findChanged.inserted,
|
|
336
315
|
updated = _findChanged.updated;
|
|
337
316
|
var MAX_LINK_EVENTS = 50;
|
|
338
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
339
|
-
|
|
340
317
|
if ([removed, inserted, updated].some(function (arr) {
|
|
341
318
|
return arr.length > MAX_LINK_EVENTS;
|
|
342
319
|
})) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "11.5.
|
|
3
|
+
"version": "11.5.8",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^51.4.0",
|
|
33
33
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
34
|
-
"@atlaskit/button": "^23.6.0",
|
|
35
34
|
"@atlaskit/custom-steps": "^0.16.0",
|
|
36
|
-
"@atlaskit/editor-card-provider": "^6.1.0",
|
|
37
35
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
38
36
|
"@atlaskit/editor-plugin-base": "^7.2.0",
|
|
39
37
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
@@ -54,17 +52,17 @@
|
|
|
54
52
|
"@atlaskit/link-client-extension": "^6.0.0",
|
|
55
53
|
"@atlaskit/link-datasource": "^4.30.0",
|
|
56
54
|
"@atlaskit/link-extractors": "^2.4.0",
|
|
57
|
-
"@atlaskit/linking-common": "^9.
|
|
55
|
+
"@atlaskit/linking-common": "^9.9.0",
|
|
58
56
|
"@atlaskit/linking-types": "^14.2.0",
|
|
59
57
|
"@atlaskit/menu": "^8.4.0",
|
|
60
58
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
61
59
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
62
|
-
"@atlaskit/primitives": "^16.
|
|
60
|
+
"@atlaskit/primitives": "^16.4.0",
|
|
63
61
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
64
|
-
"@atlaskit/smart-card": "^43.
|
|
62
|
+
"@atlaskit/smart-card": "^43.11.0",
|
|
65
63
|
"@atlaskit/theme": "^21.0.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
67
|
-
"@atlaskit/tokens": "^8.
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^14.2.0",
|
|
65
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
68
66
|
"@babel/runtime": "^7.0.0",
|
|
69
67
|
"@emotion/react": "^11.7.1",
|
|
70
68
|
"lodash": "^4.17.21",
|
|
@@ -73,7 +71,7 @@
|
|
|
73
71
|
"uuid": "^3.1.0"
|
|
74
72
|
},
|
|
75
73
|
"peerDependencies": {
|
|
76
|
-
"@atlaskit/editor-common": "^110.
|
|
74
|
+
"@atlaskit/editor-common": "^110.36.0",
|
|
77
75
|
"@atlaskit/link-provider": "^4.0.0",
|
|
78
76
|
"react": "^18.2.0",
|
|
79
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|