@atlaskit/editor-plugin-paste 2.0.9 → 2.0.11
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/{commands.js → editor-commands/commands.js} +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/pm-plugins/analytics.js +2 -2
- package/dist/cjs/pm-plugins/main.js +9 -12
- package/dist/cjs/pm-plugins/plugin-factory.js +1 -1
- package/dist/cjs/{reducer.js → pm-plugins/reducer.js} +1 -1
- package/dist/cjs/{edge-cases → pm-plugins/util/edge-cases}/index.js +5 -5
- package/dist/cjs/{handlers.js → pm-plugins/util/handlers.js} +12 -12
- package/dist/es2019/{commands.js → editor-commands/commands.js} +2 -2
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/pm-plugins/analytics.js +2 -2
- package/dist/es2019/pm-plugins/main.js +10 -8
- package/dist/es2019/pm-plugins/plugin-factory.js +1 -1
- package/dist/es2019/{reducer.js → pm-plugins/reducer.js} +1 -1
- package/dist/es2019/{edge-cases → pm-plugins/util/edge-cases}/index.js +1 -1
- package/dist/es2019/{handlers.js → pm-plugins/util/handlers.js} +4 -4
- package/dist/esm/{commands.js → editor-commands/commands.js} +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/pm-plugins/analytics.js +2 -2
- package/dist/esm/pm-plugins/main.js +10 -8
- package/dist/esm/pm-plugins/plugin-factory.js +1 -1
- package/dist/esm/{reducer.js → pm-plugins/reducer.js} +1 -1
- package/dist/esm/{edge-cases → pm-plugins/util/edge-cases}/index.js +1 -1
- package/dist/esm/{handlers.js → pm-plugins/util/handlers.js} +4 -4
- package/dist/types/{actions.d.ts → editor-actions/actions.d.ts} +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/pastePlugin.d.ts +2 -0
- package/dist/types/pm-plugins/main.d.ts +1 -2
- package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/reducer.d.ts +3 -0
- package/dist/types-ts4.5/{actions.d.ts → editor-actions/actions.d.ts} +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/pastePlugin.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/reducer.d.ts +3 -0
- package/package.json +7 -9
- package/dist/types/plugin.d.ts +0 -2
- package/dist/types/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugin.d.ts +0 -2
- package/dist/types-ts4.5/reducer.d.ts +0 -3
- /package/dist/cjs/{actions.js → editor-actions/actions.js} +0 -0
- /package/dist/cjs/{plugin.js → pastePlugin.js} +0 -0
- /package/dist/cjs/{types.js → pastePluginType.js} +0 -0
- /package/dist/cjs/{plugins → pm-plugins}/media.js +0 -0
- /package/dist/cjs/{edge-cases → pm-plugins/util/edge-cases}/lists.js +0 -0
- /package/dist/cjs/{util → pm-plugins/util}/index.js +0 -0
- /package/dist/cjs/{util → pm-plugins/util}/tinyMCE.js +0 -0
- /package/dist/es2019/{actions.js → editor-actions/actions.js} +0 -0
- /package/dist/es2019/{plugin.js → pastePlugin.js} +0 -0
- /package/dist/es2019/{types.js → pastePluginType.js} +0 -0
- /package/dist/es2019/{plugins → pm-plugins}/media.js +0 -0
- /package/dist/es2019/{edge-cases → pm-plugins/util/edge-cases}/lists.js +0 -0
- /package/dist/es2019/{util → pm-plugins/util}/index.js +0 -0
- /package/dist/es2019/{util → pm-plugins/util}/tinyMCE.js +0 -0
- /package/dist/esm/{actions.js → editor-actions/actions.js} +0 -0
- /package/dist/esm/{plugin.js → pastePlugin.js} +0 -0
- /package/dist/esm/{types.js → pastePluginType.js} +0 -0
- /package/dist/esm/{plugins → pm-plugins}/media.js +0 -0
- /package/dist/esm/{edge-cases → pm-plugins/util/edge-cases}/lists.js +0 -0
- /package/dist/esm/{util → pm-plugins/util}/index.js +0 -0
- /package/dist/esm/{util → pm-plugins/util}/tinyMCE.js +0 -0
- /package/dist/types/{commands.d.ts → editor-commands/commands.d.ts} +0 -0
- /package/dist/types/{types.d.ts → pastePluginType.d.ts} +0 -0
- /package/dist/types/{plugins → pm-plugins}/media.d.ts +0 -0
- /package/dist/types/{edge-cases → pm-plugins/util/edge-cases}/index.d.ts +0 -0
- /package/dist/types/{edge-cases → pm-plugins/util/edge-cases}/lists.d.ts +0 -0
- /package/dist/types/{handlers.d.ts → pm-plugins/util/handlers.d.ts} +0 -0
- /package/dist/types/{util → pm-plugins/util}/index.d.ts +0 -0
- /package/dist/types/{util → pm-plugins/util}/tinyMCE.d.ts +0 -0
- /package/dist/types-ts4.5/{commands.d.ts → editor-commands/commands.d.ts} +0 -0
- /package/dist/types-ts4.5/{types.d.ts → pastePluginType.d.ts} +0 -0
- /package/dist/types-ts4.5/{plugins → pm-plugins}/media.d.ts +0 -0
- /package/dist/types-ts4.5/{edge-cases → pm-plugins/util/edge-cases}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{edge-cases → pm-plugins/util/edge-cases}/lists.d.ts +0 -0
- /package/dist/types-ts4.5/{handlers.d.ts → pm-plugins/util/handlers.d.ts} +0 -0
- /package/dist/types-ts4.5/{util → pm-plugins/util}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{util → pm-plugins/util}/tinyMCE.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 2.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.0.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#179965](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/179965)
|
|
14
|
+
[`e3fc2cb96b727`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e3fc2cb96b727) -
|
|
15
|
+
ED-26051 add analytics for inserting layout
|
|
16
|
+
|
|
3
17
|
## 2.0.9
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,8 +11,8 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
12
12
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
-
var _actions = require("
|
|
15
|
-
var _pluginFactory = require("
|
|
14
|
+
var _actions = require("../editor-actions/actions");
|
|
15
|
+
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
16
16
|
/**
|
|
17
17
|
* Use this to register macro link positions during a paste operation, that you
|
|
18
18
|
* want to track in a document over time, through any document changes.
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "pastePlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _pastePlugin.pastePlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _pastePlugin = require("./pastePlugin");
|
|
@@ -15,8 +15,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
16
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
17
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var _util = require("./util");
|
|
19
|
+
var _handlers = require("./util/handlers");
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
22
|
var contentToPasteContent = {
|
|
@@ -6,12 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createPlugin = createPlugin;
|
|
8
8
|
exports.isInsideBlockQuote = void 0;
|
|
9
|
-
Object.defineProperty(exports, "stateKey", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _pluginFactory.pluginKey;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
16
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
11
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
@@ -29,15 +23,15 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
29
23
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
30
24
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
31
25
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
32
|
-
var _actions = require("../actions");
|
|
33
|
-
var _commands = require("../commands");
|
|
34
|
-
var
|
|
35
|
-
var _media = require("../plugins/media");
|
|
36
|
-
var _util = require("../util");
|
|
37
|
-
var _tinyMCE = require("../util/tinyMCE");
|
|
26
|
+
var _actions = require("../editor-actions/actions");
|
|
27
|
+
var _commands = require("../editor-commands/commands");
|
|
28
|
+
var _media = require("../pm-plugins/media");
|
|
38
29
|
var _analytics2 = require("./analytics");
|
|
39
30
|
var _clipboardTextSerializer = require("./clipboard-text-serializer");
|
|
40
31
|
var _pluginFactory = require("./plugin-factory");
|
|
32
|
+
var _util = require("./util");
|
|
33
|
+
var _handlers = require("./util/handlers");
|
|
34
|
+
var _tinyMCE = require("./util/tinyMCE");
|
|
41
35
|
var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
42
36
|
var blockquote = state.schema.nodes.blockquote;
|
|
43
37
|
return (0, _utils2.hasParentNodeOfType)(blockquote)(state.selection);
|
|
@@ -481,6 +475,9 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
481
475
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
482
476
|
slice = new _model.Slice(slice.content, 0, 0);
|
|
483
477
|
}
|
|
478
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_2')) {
|
|
479
|
+
slice = (0, _transforms.transformSingleColumnLayout)(slice, schema);
|
|
480
|
+
}
|
|
484
481
|
return slice;
|
|
485
482
|
},
|
|
486
483
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
|
-
var _reducer = require("
|
|
12
|
+
var _reducer = require("./reducer");
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
15
|
var pluginKey = exports.pluginKey = new _state.PluginKey('pastePlugin');
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.reducer = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _actions = require("
|
|
10
|
+
var _actions = require("../editor-actions/actions");
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
var reducer = exports.reducer = function reducer(state, action) {
|
|
@@ -12,7 +12,7 @@ var _model = require("@atlaskit/editor-prosemirror/model");
|
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
13
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
|
-
var
|
|
15
|
+
var _index = require("../index");
|
|
16
16
|
var _lists = require("./lists");
|
|
17
17
|
function insertSliceForLists(_ref) {
|
|
18
18
|
var _slice$content$firstC;
|
|
@@ -25,7 +25,7 @@ function insertSliceForLists(_ref) {
|
|
|
25
25
|
$from = _tr$selection.$from;
|
|
26
26
|
var _ref2 = selection,
|
|
27
27
|
$cursor = _ref2.$cursor;
|
|
28
|
-
var panelNode = (0,
|
|
28
|
+
var panelNode = (0, _index.isSelectionInsidePanel)(selection);
|
|
29
29
|
var selectionIsInsideList = $from.blockRange($to, _utils.isListNode);
|
|
30
30
|
if (!$cursor && selectionIsInsideList) {
|
|
31
31
|
return (0, _lists.insertSliceIntoRangeSelectionInsideList)({
|
|
@@ -35,7 +35,7 @@ function insertSliceForLists(_ref) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// if inside an empty panel, try and insert content inside it rather than replace it
|
|
38
|
-
if (panelNode && (0,
|
|
38
|
+
if (panelNode && (0, _index.isEmptyNode)(panelNode) && $from.node() === $to.node()) {
|
|
39
39
|
return (0, _lists.insertSliceInsideOfPanelNodeSelected)(panelNode)({
|
|
40
40
|
tr: tr,
|
|
41
41
|
slice: slice,
|
|
@@ -45,7 +45,7 @@ function insertSliceForLists(_ref) {
|
|
|
45
45
|
if (!$cursor || selectionIsInsideList) {
|
|
46
46
|
return tr.replaceSelection(slice);
|
|
47
47
|
}
|
|
48
|
-
if ((0,
|
|
48
|
+
if ((0, _index.isEmptyNode)(tr.doc.resolve($cursor.pos).node())) {
|
|
49
49
|
return (0, _lists.insertSliceIntoEmptyNode)({
|
|
50
50
|
tr: tr,
|
|
51
51
|
slice: slice
|
|
@@ -59,7 +59,7 @@ function insertSliceForLists(_ref) {
|
|
|
59
59
|
// it still inserts whole list node after the action/decision item).
|
|
60
60
|
var pastingIntoActionOrDecision = Boolean((0, _utils2.findParentNodeOfType)([schema.nodes.taskList, schema.nodes.decisionList])(selection));
|
|
61
61
|
var oneListItem = slice.content.childCount === 1 && (0, _utils.isListNode)(slice.content.firstChild) && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.childCount) === 1;
|
|
62
|
-
if (!(pastingIntoActionOrDecision && oneListItem) && (0,
|
|
62
|
+
if (!(pastingIntoActionOrDecision && oneListItem) && (0, _index.isCursorSelectionAtTextStartOrEnd)(selection)) {
|
|
63
63
|
return (0, _lists.insertSliceAtNodeEdge)({
|
|
64
64
|
tr: tr,
|
|
65
65
|
slice: slice
|
|
@@ -41,12 +41,12 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
41
41
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
42
42
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
43
43
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
44
|
-
var _commands = require("
|
|
44
|
+
var _commands = require("../../editor-commands/commands");
|
|
45
|
+
var _main = require("../main");
|
|
46
|
+
var _pluginFactory = require("../plugin-factory");
|
|
45
47
|
var _edgeCases = require("./edge-cases");
|
|
46
48
|
var _lists = require("./edge-cases/lists");
|
|
47
|
-
var
|
|
48
|
-
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
49
|
-
var _util = require("./util");
|
|
49
|
+
var _index = require("./index");
|
|
50
50
|
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; } } }; }
|
|
51
51
|
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; } }
|
|
52
52
|
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; }
|
|
@@ -122,7 +122,7 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
|
|
|
122
122
|
var selectionIsValidNode = state.selection instanceof _state.NodeSelection && ['decisionList', 'decisionItem', 'taskList', 'taskItem'].includes(state.selection.node.type.name);
|
|
123
123
|
var selectionHasValidParentNode = (0, _utils2.hasParentNodeOfType)([decisionItem, taskItem, panel])(state.selection);
|
|
124
124
|
var selectionIsCodeBlock = (0, _utils2.hasParentNodeOfType)([codeBlock])(state.selection);
|
|
125
|
-
var panelNode = (0,
|
|
125
|
+
var panelNode = (0, _index.isSelectionInsidePanel)(selection);
|
|
126
126
|
var selectionIsPanel = Boolean(panelNode);
|
|
127
127
|
|
|
128
128
|
// we avoid handling codeBlock-in-panel use case in this function
|
|
@@ -156,14 +156,14 @@ function handlePasteIntoTaskOrDecisionOrPanel(slice, queueCardsFromChangedTr) {
|
|
|
156
156
|
}
|
|
157
157
|
var filters = [(0, _utils.linkifyContent)(schema)];
|
|
158
158
|
var selectionMarks = selection.$head.marks();
|
|
159
|
-
if (selection instanceof _state.TextSelection && Array.isArray(selectionMarks) && selectionMarks.length > 0 && (0,
|
|
159
|
+
if (selection instanceof _state.TextSelection && Array.isArray(selectionMarks) && selectionMarks.length > 0 && (0, _index.hasOnlyNodesOfType)(paragraph, text, emoji, mention, hardBreak)(slice) && (!codeMark.isInSet(selectionMarks) || (0, _mark.anyMarkActive)(state, codeMark)) // check if there is a code mark anywhere in the selection
|
|
160
160
|
) {
|
|
161
|
-
filters.push((0,
|
|
161
|
+
filters.push((0, _index.applyTextMarksToSlice)(schema, selection.$head.marks()));
|
|
162
162
|
}
|
|
163
163
|
var transformedSlice = compose.apply(null, filters)(slice);
|
|
164
164
|
var isFirstChildTaskNode = transformedSlice.content.firstChild.type === taskList || transformedSlice.content.firstChild.type === taskItem;
|
|
165
165
|
var tr = (0, _history.closeHistory)(state.tr);
|
|
166
|
-
if (panelNode && sliceHasTask && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === panel && (0,
|
|
166
|
+
if (panelNode && sliceHasTask && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === panel && (0, _index.isEmptyNode)(panelNode) && selection.$from.node() === selection.$to.node()) {
|
|
167
167
|
return Boolean((0, _lists.insertSliceInsideOfPanelNodeSelected)(panelNode)({
|
|
168
168
|
tr: tr,
|
|
169
169
|
slice: slice
|
|
@@ -458,7 +458,7 @@ function handlePasteAsPlainText(slice, _event, editorAnalyticsAPI) {
|
|
|
458
458
|
tr = (0, _utils3.replaceSelectedTable)(state, slice);
|
|
459
459
|
|
|
460
460
|
// add analytics after replacing selected table
|
|
461
|
-
tr = (0,
|
|
461
|
+
tr = (0, _index.addReplaceSelectedTableAnalytics)(state, tr, editorAnalyticsAPI);
|
|
462
462
|
|
|
463
463
|
// otherwise just replace the selection
|
|
464
464
|
if (!tr.docChanged) {
|
|
@@ -508,8 +508,8 @@ function handlePastePreservingMarks(slice, queueCardsFromChangedTr) {
|
|
|
508
508
|
|
|
509
509
|
// if the pasted data is one of the node types below
|
|
510
510
|
// we apply current selection marks to the pasted slice
|
|
511
|
-
if ((0,
|
|
512
|
-
var transformedSlice = (0,
|
|
511
|
+
if ((0, _index.hasOnlyNodesOfType)(bulletList, hardBreak, heading, listItem, text, emoji, mention, orderedList)(slice) || selectionIsHeading || hasActiveCodeMark || hasAnnotationMark) {
|
|
512
|
+
var transformedSlice = (0, _index.applyTextMarksToSlice)(schema, selectionMarks)(slice);
|
|
513
513
|
var tr = (0, _history.closeHistory)(state.tr).replaceSelection(transformedSlice).setStoredMarks(selectionMarks).scrollIntoView();
|
|
514
514
|
queueCardsFromChangedTr === null || queueCardsFromChangedTr === void 0 || queueCardsFromChangedTr(state, tr, _analytics.INPUT_METHOD.CLIPBOARD);
|
|
515
515
|
if (dispatch) {
|
|
@@ -1095,7 +1095,7 @@ var handleSelectedTable = exports.handleSelectedTable = function handleSelectedT
|
|
|
1095
1095
|
var tr = (0, _utils3.replaceSelectedTable)(state, slice);
|
|
1096
1096
|
|
|
1097
1097
|
// add analytics after replacing selected table
|
|
1098
|
-
tr = (0,
|
|
1098
|
+
tr = (0, _index.addReplaceSelectedTableAnalytics)(state, tr, editorAnalyticsAPI);
|
|
1099
1099
|
if (tr.docChanged) {
|
|
1100
1100
|
if (dispatch) {
|
|
1101
1101
|
dispatch(tr);
|
|
@@ -2,8 +2,8 @@ import { isListNode, mapChildren, mapSlice } from '@atlaskit/editor-common/utils
|
|
|
2
2
|
import { autoJoin } from '@atlaskit/editor-prosemirror/commands';
|
|
3
3
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { PastePluginActionTypes as ActionTypes } from '
|
|
6
|
-
import { createCommand } from '
|
|
5
|
+
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
6
|
+
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Use this to register macro link positions during a paste operation, that you
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, PasteContents, PasteTypes } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { getLinkDomain, mapSlice } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { getPasteSource } from './util';
|
|
5
|
+
import { handleCodeBlock, handleExpandPaste, handleMarkdown, handleMediaSingle, handlePasteAsPlainText, handlePasteIntoCaption, handlePasteIntoTaskOrDecisionOrPanel, handlePasteLinkOnSelectedText, handlePasteNonNestableBlockNodesIntoList, handlePastePanelOrDecisionContentIntoList, handlePastePreservingMarks, handleRichText, handleSelectedTable, handleNestedTablePaste } from './util/handlers';
|
|
6
6
|
const contentToPasteContent = {
|
|
7
7
|
url: PasteContents.url,
|
|
8
8
|
paragraph: PasteContents.text,
|
|
@@ -6,23 +6,22 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
|
|
|
6
6
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
7
7
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
8
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
-
import { transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
|
|
9
|
+
import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
|
|
10
10
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
12
12
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
13
13
|
import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
14
14
|
import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
|
-
import { PastePluginActionTypes } from '../actions';
|
|
17
|
-
import { splitParagraphs, upgradeTextToLists } from '../commands';
|
|
18
|
-
import {
|
|
19
|
-
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../plugins/media';
|
|
20
|
-
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
|
|
21
|
-
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from '../util/tinyMCE';
|
|
16
|
+
import { PastePluginActionTypes } from '../editor-actions/actions';
|
|
17
|
+
import { splitParagraphs, upgradeTextToLists } from '../editor-commands/commands';
|
|
18
|
+
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../pm-plugins/media';
|
|
22
19
|
import { createPasteMeasurePayload, getContentNodeTypes, handleCodeBlockWithAnalytics, handleExpandWithAnalytics, handleMarkdownWithAnalytics, handleMediaSingleWithAnalytics, handlePasteAsPlainTextWithAnalytics, handlePasteIntoCaptionWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePastePreservingMarksWithAnalytics, handleRichTextWithAnalytics, handleSelectedTableWithAnalytics, sendPasteAnalyticsEvent, handleNestedTablePasteWithAnalytics } from './analytics';
|
|
23
20
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
24
21
|
import { createPluginState, pluginKey as stateKey } from './plugin-factory';
|
|
25
|
-
|
|
22
|
+
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from './util';
|
|
23
|
+
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from './util/handlers';
|
|
24
|
+
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from './util/tinyMCE';
|
|
26
25
|
export const isInsideBlockQuote = state => {
|
|
27
26
|
const {
|
|
28
27
|
blockquote
|
|
@@ -450,6 +449,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
450
449
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
451
450
|
slice = new Slice(slice.content, 0, 0);
|
|
452
451
|
}
|
|
452
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
|
|
453
|
+
slice = transformSingleColumnLayout(slice, schema);
|
|
454
|
+
}
|
|
453
455
|
return slice;
|
|
454
456
|
},
|
|
455
457
|
transformPastedHTML(html) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { reducer } from '
|
|
3
|
+
import { reducer } from './reducer';
|
|
4
4
|
export const pluginKey = new PluginKey('pastePlugin');
|
|
5
5
|
export const {
|
|
6
6
|
createPluginState,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PastePluginActionTypes as ActionTypes } from '
|
|
1
|
+
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
2
2
|
export const reducer = (state, action) => {
|
|
3
3
|
switch (action.type) {
|
|
4
4
|
case ActionTypes.START_TRACKING_PASTED_MACRO_POSITIONS:
|
|
@@ -3,7 +3,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../
|
|
6
|
+
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../index';
|
|
7
7
|
import { insertSliceAtNodeEdge, insertSliceInsideOfPanelNodeSelected, insertSliceIntoEmptyNode, insertSliceIntoRangeSelectionInsideList } from './lists';
|
|
8
8
|
export function insertSliceForLists({
|
|
9
9
|
tr,
|
|
@@ -13,12 +13,12 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
13
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
14
|
// TODO: ED-20519 Needs Macro extraction
|
|
15
15
|
|
|
16
|
-
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '
|
|
16
|
+
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
17
|
+
import { isInsideBlockQuote } from '../main';
|
|
18
|
+
import { getPluginState as getPastePluginState } from '../plugin-factory';
|
|
17
19
|
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
18
20
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
19
|
-
import {
|
|
20
|
-
import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
|
|
21
|
-
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './util';
|
|
21
|
+
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './index';
|
|
22
22
|
const insideExpand = state => {
|
|
23
23
|
const {
|
|
24
24
|
expand,
|
|
@@ -4,8 +4,8 @@ import { isListNode, mapChildren, mapSlice } from '@atlaskit/editor-common/utils
|
|
|
4
4
|
import { autoJoin } from '@atlaskit/editor-prosemirror/commands';
|
|
5
5
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { PastePluginActionTypes as ActionTypes } from '
|
|
8
|
-
import { createCommand } from '
|
|
7
|
+
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
8
|
+
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Use this to register macro link positions during a paste operation, that you
|
package/dist/esm/index.js
CHANGED
|
@@ -5,8 +5,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, PasteContents, PasteTypes } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { getLinkDomain, mapSlice } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { getPasteSource } from './util';
|
|
9
|
+
import { handleCodeBlock, handleExpandPaste, handleMarkdown, handleMediaSingle, handlePasteAsPlainText, handlePasteIntoCaption, handlePasteIntoTaskOrDecisionOrPanel, handlePasteLinkOnSelectedText, handlePasteNonNestableBlockNodesIntoList, handlePastePanelOrDecisionContentIntoList, handlePastePreservingMarks, handleRichText, handleSelectedTable, handleNestedTablePaste } from './util/handlers';
|
|
10
10
|
var contentToPasteContent = {
|
|
11
11
|
url: PasteContents.url,
|
|
12
12
|
paragraph: PasteContents.text,
|
|
@@ -8,23 +8,22 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
|
|
|
8
8
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
9
9
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
|
-
import { transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
|
|
11
|
+
import { transformSingleLineCodeBlockToCodeMark, transformSingleColumnLayout, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks } from '@atlaskit/editor-common/transforms';
|
|
12
12
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
14
14
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
15
15
|
import { contains, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
16
16
|
import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
17
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
|
-
import { PastePluginActionTypes } from '../actions';
|
|
19
|
-
import { splitParagraphs, upgradeTextToLists } from '../commands';
|
|
20
|
-
import {
|
|
21
|
-
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../plugins/media';
|
|
22
|
-
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
|
|
23
|
-
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from '../util/tinyMCE';
|
|
18
|
+
import { PastePluginActionTypes } from '../editor-actions/actions';
|
|
19
|
+
import { splitParagraphs, upgradeTextToLists } from '../editor-commands/commands';
|
|
20
|
+
import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../pm-plugins/media';
|
|
24
21
|
import { createPasteMeasurePayload, getContentNodeTypes, handleCodeBlockWithAnalytics, handleExpandWithAnalytics, handleMarkdownWithAnalytics, handleMediaSingleWithAnalytics, handlePasteAsPlainTextWithAnalytics, handlePasteIntoCaptionWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePastePreservingMarksWithAnalytics, handleRichTextWithAnalytics, handleSelectedTableWithAnalytics, sendPasteAnalyticsEvent, handleNestedTablePasteWithAnalytics } from './analytics';
|
|
25
22
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
26
23
|
import { createPluginState, pluginKey as stateKey } from './plugin-factory';
|
|
27
|
-
|
|
24
|
+
import { escapeLinks, getPasteSource, htmlContainsSingleFile, htmlHasInvalidLinkTags, isPastedFromExcel, isPastedFromWord, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from './util';
|
|
25
|
+
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks, handleTableContentPasteInBodiedExtension } from './util/handlers';
|
|
26
|
+
import { htmlHasIncompleteTable, isPastedFromTinyMCEConfluence, tryRebuildCompleteTableHtml } from './util/tinyMCE';
|
|
28
27
|
export var isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
29
28
|
var blockquote = state.schema.nodes.blockquote;
|
|
30
29
|
return hasParentNodeOfType(blockquote)(state.selection);
|
|
@@ -468,6 +467,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
468
467
|
if (slice.content.childCount && slice.content.lastChild.type === schema.nodes.codeBlock) {
|
|
469
468
|
slice = new Slice(slice.content, 0, 0);
|
|
470
469
|
}
|
|
470
|
+
if (fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
|
|
471
|
+
slice = transformSingleColumnLayout(slice, schema);
|
|
472
|
+
}
|
|
471
473
|
return slice;
|
|
472
474
|
},
|
|
473
475
|
transformPastedHTML: function transformPastedHTML(html) {
|
|
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import { reducer } from '
|
|
7
|
+
import { reducer } from './reducer';
|
|
8
8
|
export var pluginKey = new PluginKey('pastePlugin');
|
|
9
9
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
10
10
|
mapping: function mapping(tr, pluginState) {
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
-
import { PastePluginActionTypes as ActionTypes } from '
|
|
5
|
+
import { PastePluginActionTypes as ActionTypes } from '../editor-actions/actions';
|
|
6
6
|
export var reducer = function reducer(state, action) {
|
|
7
7
|
switch (action.type) {
|
|
8
8
|
case ActionTypes.START_TRACKING_PASTED_MACRO_POSITIONS:
|
|
@@ -3,7 +3,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
5
5
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../
|
|
6
|
+
import { isCursorSelectionAtTextStartOrEnd, isEmptyNode, isSelectionInsidePanel } from '../index';
|
|
7
7
|
import { insertSliceAtNodeEdge, insertSliceInsideOfPanelNodeSelected, insertSliceIntoEmptyNode, insertSliceIntoRangeSelectionInsideList } from './lists';
|
|
8
8
|
export function insertSliceForLists(_ref) {
|
|
9
9
|
var _slice$content$firstC;
|
|
@@ -21,12 +21,12 @@ import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
|
21
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
22
|
// TODO: ED-20519 Needs Macro extraction
|
|
23
23
|
|
|
24
|
-
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '
|
|
24
|
+
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from '../../editor-commands/commands';
|
|
25
|
+
import { isInsideBlockQuote } from '../main';
|
|
26
|
+
import { getPluginState as getPastePluginState } from '../plugin-factory';
|
|
25
27
|
import { insertSliceForLists, insertSliceForTaskInsideList, insertSliceInsideBlockquote } from './edge-cases';
|
|
26
28
|
import { insertSliceInsideOfPanelNodeSelected } from './edge-cases/lists';
|
|
27
|
-
import {
|
|
28
|
-
import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
|
|
29
|
-
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './util';
|
|
29
|
+
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType, isEmptyNode, isSelectionInsidePanel } from './index';
|
|
30
30
|
var insideExpand = function insideExpand(state) {
|
|
31
31
|
var _state$schema$nodes = state.schema.nodes,
|
|
32
32
|
expand = _state$schema$nodes.expand,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LastContentPasted } from '
|
|
1
|
+
import type { LastContentPasted } from '../pastePluginType';
|
|
2
2
|
export declare enum PastePluginActionTypes {
|
|
3
3
|
START_TRACKING_PASTED_MACRO_POSITIONS = "START_TRACKING_PASTED_MACRO_POSITIONS",
|
|
4
4
|
STOP_TRACKING_PASTED_MACRO_POSITIONS = "STOP_TRACKING_PASTED_MACRO_POSITIONS",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { PastePlugin, PastePluginOptions, PastePluginState, LastContentPasted } from './
|
|
2
|
-
export { pastePlugin } from './
|
|
1
|
+
export type { PastePlugin, PastePluginOptions, PastePluginState, LastContentPasted, } from './pastePluginType';
|
|
2
|
+
export { pastePlugin } from './pastePlugin';
|
|
@@ -7,6 +7,5 @@ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/
|
|
|
7
7
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import type { PastePlugin } from '../index';
|
|
10
|
-
export { pluginKey as stateKey } from './plugin-factory';
|
|
11
10
|
export declare const isInsideBlockQuote: (state: EditorState) => boolean;
|
|
12
|
-
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../
|
|
11
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../pastePluginType").PastePluginState>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("..").PastePluginState)) => import("prosemirror-state").SafeStateField<import("..").PastePluginState>, createCommand: <A = import("../actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").PastePluginState;
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("..").PastePluginState)) => import("prosemirror-state").SafeStateField<import("..").PastePluginState>, createCommand: <A = import("../editor-actions/actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").PastePluginState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LastContentPasted } from '
|
|
1
|
+
import type { LastContentPasted } from '../pastePluginType';
|
|
2
2
|
export declare enum PastePluginActionTypes {
|
|
3
3
|
START_TRACKING_PASTED_MACRO_POSITIONS = "START_TRACKING_PASTED_MACRO_POSITIONS",
|
|
4
4
|
STOP_TRACKING_PASTED_MACRO_POSITIONS = "STOP_TRACKING_PASTED_MACRO_POSITIONS",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { PastePlugin, PastePluginOptions, PastePluginState, LastContentPasted } from './
|
|
2
|
-
export { pastePlugin } from './
|
|
1
|
+
export type { PastePlugin, PastePluginOptions, PastePluginState, LastContentPasted, } from './pastePluginType';
|
|
2
|
+
export { pastePlugin } from './pastePlugin';
|
|
@@ -7,6 +7,5 @@ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/
|
|
|
7
7
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import type { PastePlugin } from '../index';
|
|
10
|
-
export { pluginKey as stateKey } from './plugin-factory';
|
|
11
10
|
export declare const isInsideBlockQuote: (state: EditorState) => boolean;
|
|
12
|
-
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../
|
|
11
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<PastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../pastePluginType").PastePluginState>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("..").PastePluginState)) => import("prosemirror-state").SafeStateField<import("..").PastePluginState>, createCommand: <A = import("../actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").PastePluginState;
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("..").PastePluginState | ((state: import("prosemirror-state").EditorState) => import("..").PastePluginState)) => import("prosemirror-state").SafeStateField<import("..").PastePluginState>, createCommand: <A = import("../editor-actions/actions").PastePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").PastePluginState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^97.0.0",
|
|
35
35
|
"@atlaskit/editor-markdown-transformer": "^5.13.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-annotation": "^1.26.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/media-client": "^28.6.0",
|
|
47
47
|
"@atlaskit/media-common": "^11.7.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^2.29.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
52
52
|
"uuid": "^3.1.0"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"techstack": {
|
|
71
71
|
"@atlassian/frontend": {
|
|
72
72
|
"code-structure": [
|
|
73
|
-
"
|
|
73
|
+
"editor-plugin"
|
|
74
74
|
],
|
|
75
75
|
"import-structure": [
|
|
76
76
|
"atlassian-conventions"
|
|
@@ -103,11 +103,6 @@
|
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
-
"techstackIgnore": {
|
|
107
|
-
"stricter": [
|
|
108
|
-
"@atlassian/tangerine/project-structure"
|
|
109
|
-
]
|
|
110
|
-
},
|
|
111
106
|
"platform-feature-flags": {
|
|
112
107
|
"platform_editor_media_extended_resize_experience": {
|
|
113
108
|
"type": "boolean"
|
|
@@ -123,6 +118,9 @@
|
|
|
123
118
|
},
|
|
124
119
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
125
120
|
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"platform_editor_advanced_layouts_post_fix_patch_2": {
|
|
123
|
+
"type": "boolean"
|
|
126
124
|
}
|
|
127
125
|
}
|
|
128
126
|
}
|
package/dist/types/plugin.d.ts
DELETED
package/dist/types/reducer.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|