@atlaskit/editor-plugin-paste 1.11.4 → 1.12.1
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
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 1.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.12.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#138305](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138305)
|
|
14
|
+
[`c79d9c18032b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c79d9c18032b6) -
|
|
15
|
+
Passing task local ID from editor mentions plugin
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.11.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/handlers.js
CHANGED
|
@@ -43,9 +43,9 @@ var _edgeCases = require("./edge-cases");
|
|
|
43
43
|
var _lists = require("./edge-cases/lists");
|
|
44
44
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
45
45
|
var _util = require("./util");
|
|
46
|
-
function _createForOfIteratorHelper(
|
|
47
|
-
function _unsupportedIterableToArray(
|
|
48
|
-
function _arrayLikeToArray(
|
|
46
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
47
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
48
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
49
49
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
50
50
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // TODO: ED-20519 Needs Macro extraction
|
|
51
51
|
var insideExpand = function insideExpand(state) {
|
|
@@ -191,19 +191,39 @@ function createPasteAnalyticsPayloadBySelection(event, slice, pasteContext, plug
|
|
|
191
191
|
var source = (0, _util.getPasteSource)(event);
|
|
192
192
|
var mentionIds = [];
|
|
193
193
|
var mentionLocalIds = [];
|
|
194
|
-
var mentionsInserted = [];
|
|
195
194
|
slice.content.descendants(function (node) {
|
|
196
195
|
if (node.type.name === 'mention') {
|
|
197
196
|
mentionIds.push(node.attrs.id);
|
|
198
197
|
mentionLocalIds.push(node.attrs.localId);
|
|
199
|
-
mentionsInserted.push({
|
|
200
|
-
type: 'added',
|
|
201
|
-
id: node.attrs.id,
|
|
202
|
-
localId: node.attrs.localId
|
|
203
|
-
});
|
|
204
198
|
}
|
|
205
199
|
});
|
|
206
|
-
pluginInjectionApi
|
|
200
|
+
if (pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mention) !== null && _pluginInjectionApi$m !== void 0 && (_pluginInjectionApi$m = _pluginInjectionApi$m.actions) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.announceMentionsInsertion) {
|
|
201
|
+
var _pluginInjectionApi$m2;
|
|
202
|
+
var mentionsInserted = [];
|
|
203
|
+
slice.content.descendants(function (node) {
|
|
204
|
+
if (node.type.name === 'mention') {
|
|
205
|
+
mentionsInserted.push({
|
|
206
|
+
type: 'added',
|
|
207
|
+
id: node.attrs.id,
|
|
208
|
+
localId: node.attrs.localId
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
if (node.type.name === 'taskItem') {
|
|
212
|
+
node.content.forEach(function (nodeContent) {
|
|
213
|
+
if (nodeContent.type.name === 'mention') {
|
|
214
|
+
mentionsInserted.push({
|
|
215
|
+
type: 'added',
|
|
216
|
+
localId: nodeContent.attrs.localId,
|
|
217
|
+
id: nodeContent.attrs.id,
|
|
218
|
+
taskLocalId: node.attrs.localId
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 || (_pluginInjectionApi$m2 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m2 === void 0 || _pluginInjectionApi$m2.announceMentionsInsertion(mentionsInserted);
|
|
226
|
+
}
|
|
207
227
|
if (pasteContext.type === _analytics.PasteTypes.plain) {
|
|
208
228
|
return createPastePayload(actionSubjectId, {
|
|
209
229
|
pasteSize: text.length,
|
|
@@ -186,19 +186,39 @@ function createPasteAnalyticsPayloadBySelection(event, slice, pasteContext, plug
|
|
|
186
186
|
const source = getPasteSource(event);
|
|
187
187
|
const mentionIds = [];
|
|
188
188
|
const mentionLocalIds = [];
|
|
189
|
-
const mentionsInserted = [];
|
|
190
189
|
slice.content.descendants(node => {
|
|
191
190
|
if (node.type.name === 'mention') {
|
|
192
191
|
mentionIds.push(node.attrs.id);
|
|
193
192
|
mentionLocalIds.push(node.attrs.localId);
|
|
194
|
-
mentionsInserted.push({
|
|
195
|
-
type: 'added',
|
|
196
|
-
id: node.attrs.id,
|
|
197
|
-
localId: node.attrs.localId
|
|
198
|
-
});
|
|
199
193
|
}
|
|
200
194
|
});
|
|
201
|
-
pluginInjectionApi
|
|
195
|
+
if (pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mention) !== null && _pluginInjectionApi$m !== void 0 && (_pluginInjectionApi$m2 = _pluginInjectionApi$m.actions) !== null && _pluginInjectionApi$m2 !== void 0 && _pluginInjectionApi$m2.announceMentionsInsertion) {
|
|
196
|
+
var _pluginInjectionApi$m3, _pluginInjectionApi$m4;
|
|
197
|
+
const mentionsInserted = [];
|
|
198
|
+
slice.content.descendants(node => {
|
|
199
|
+
if (node.type.name === 'mention') {
|
|
200
|
+
mentionsInserted.push({
|
|
201
|
+
type: 'added',
|
|
202
|
+
id: node.attrs.id,
|
|
203
|
+
localId: node.attrs.localId
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (node.type.name === 'taskItem') {
|
|
207
|
+
node.content.forEach(nodeContent => {
|
|
208
|
+
if (nodeContent.type.name === 'mention') {
|
|
209
|
+
mentionsInserted.push({
|
|
210
|
+
type: 'added',
|
|
211
|
+
localId: nodeContent.attrs.localId,
|
|
212
|
+
id: nodeContent.attrs.id,
|
|
213
|
+
taskLocalId: node.attrs.localId
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m3 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : (_pluginInjectionApi$m4 = _pluginInjectionApi$m3.actions) === null || _pluginInjectionApi$m4 === void 0 ? void 0 : _pluginInjectionApi$m4.announceMentionsInsertion(mentionsInserted);
|
|
221
|
+
}
|
|
202
222
|
if (pasteContext.type === PasteTypes.plain) {
|
|
203
223
|
return createPastePayload(actionSubjectId, {
|
|
204
224
|
pasteSize: text.length,
|
package/dist/esm/handlers.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
function _createForOfIteratorHelper(
|
|
5
|
-
function _unsupportedIterableToArray(
|
|
6
|
-
function _arrayLikeToArray(
|
|
4
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
import uuid from 'uuid/v4';
|
|
@@ -179,19 +179,39 @@ function createPasteAnalyticsPayloadBySelection(event, slice, pasteContext, plug
|
|
|
179
179
|
var source = getPasteSource(event);
|
|
180
180
|
var mentionIds = [];
|
|
181
181
|
var mentionLocalIds = [];
|
|
182
|
-
var mentionsInserted = [];
|
|
183
182
|
slice.content.descendants(function (node) {
|
|
184
183
|
if (node.type.name === 'mention') {
|
|
185
184
|
mentionIds.push(node.attrs.id);
|
|
186
185
|
mentionLocalIds.push(node.attrs.localId);
|
|
187
|
-
mentionsInserted.push({
|
|
188
|
-
type: 'added',
|
|
189
|
-
id: node.attrs.id,
|
|
190
|
-
localId: node.attrs.localId
|
|
191
|
-
});
|
|
192
186
|
}
|
|
193
187
|
});
|
|
194
|
-
pluginInjectionApi
|
|
188
|
+
if (pluginInjectionApi !== null && pluginInjectionApi !== void 0 && (_pluginInjectionApi$m = pluginInjectionApi.mention) !== null && _pluginInjectionApi$m !== void 0 && (_pluginInjectionApi$m = _pluginInjectionApi$m.actions) !== null && _pluginInjectionApi$m !== void 0 && _pluginInjectionApi$m.announceMentionsInsertion) {
|
|
189
|
+
var _pluginInjectionApi$m2;
|
|
190
|
+
var mentionsInserted = [];
|
|
191
|
+
slice.content.descendants(function (node) {
|
|
192
|
+
if (node.type.name === 'mention') {
|
|
193
|
+
mentionsInserted.push({
|
|
194
|
+
type: 'added',
|
|
195
|
+
id: node.attrs.id,
|
|
196
|
+
localId: node.attrs.localId
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (node.type.name === 'taskItem') {
|
|
200
|
+
node.content.forEach(function (nodeContent) {
|
|
201
|
+
if (nodeContent.type.name === 'mention') {
|
|
202
|
+
mentionsInserted.push({
|
|
203
|
+
type: 'added',
|
|
204
|
+
localId: nodeContent.attrs.localId,
|
|
205
|
+
id: nodeContent.attrs.id,
|
|
206
|
+
taskLocalId: node.attrs.localId
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 || (_pluginInjectionApi$m2 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m2 === void 0 || _pluginInjectionApi$m2.announceMentionsInsertion(mentionsInserted);
|
|
214
|
+
}
|
|
195
215
|
if (pasteContext.type === PasteTypes.plain) {
|
|
196
216
|
return createPastePayload(actionSubjectId, {
|
|
197
217
|
pasteSize: text.length,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^89.0.0",
|
|
35
35
|
"@atlaskit/editor-markdown-transformer": "^5.12.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
37
37
|
"@atlaskit/editor-plugin-annotation": "^1.19.0",
|
|
38
38
|
"@atlaskit/editor-plugin-better-type-history": "^1.8.0",
|
|
39
|
-
"@atlaskit/editor-plugin-card": "^
|
|
39
|
+
"@atlaskit/editor-plugin-card": "^3.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-feature-flags": "^1.2.0",
|
|
41
41
|
"@atlaskit/editor-plugin-list": "^3.8.0",
|
|
42
|
-
"@atlaskit/editor-plugin-media": "^1.
|
|
43
|
-
"@atlaskit/editor-plugin-mentions": "^2.
|
|
42
|
+
"@atlaskit/editor-plugin-media": "^1.31.0",
|
|
43
|
+
"@atlaskit/editor-plugin-mentions": "^2.6.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
46
46
|
"@atlaskit/media-client": "^27.6.0",
|