@atlaskit/editor-plugin-block-controls 2.13.27 → 2.13.29
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 +17 -0
- package/dist/cjs/{plugin.js → blockControlsPlugin.js} +3 -3
- package/dist/cjs/{commands → editor-commands}/move-node.js +5 -5
- package/dist/cjs/{commands → editor-commands}/move-to-layout.js +4 -4
- package/dist/cjs/{commands → editor-commands}/show-drag-handle.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/pm-plugins/decorations-anchor.js +1 -1
- package/dist/cjs/pm-plugins/decorations-drop-target.js +9 -9
- package/dist/cjs/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +3 -3
- package/dist/cjs/pm-plugins/main.js +5 -5
- package/dist/cjs/{consts.js → pm-plugins/utils/consts.js} +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/drag-handle-positions.js +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/inline-drop-target.js +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/remove-from-source.js +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/update-column-widths.js +1 -1
- package/dist/cjs/{utils → pm-plugins/utils}/validation.js +1 -1
- package/dist/cjs/ui/drag-handle.js +3 -3
- package/dist/cjs/ui/drop-target-layout.js +3 -3
- package/dist/cjs/ui/drop-target-v2.js +5 -5
- package/dist/cjs/ui/drop-target.js +2 -2
- package/dist/cjs/ui/global-styles.js +16 -1
- package/dist/cjs/ui/inline-drop-target.js +20 -8
- package/dist/es2019/{plugin.js → blockControlsPlugin.js} +3 -3
- package/dist/es2019/{commands → editor-commands}/move-node.js +5 -5
- package/dist/es2019/{commands → editor-commands}/move-to-layout.js +4 -4
- package/dist/es2019/{commands → editor-commands}/show-drag-handle.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/pm-plugins/decorations-anchor.js +1 -1
- package/dist/es2019/pm-plugins/decorations-drop-target.js +4 -4
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +3 -3
- package/dist/es2019/pm-plugins/main.js +5 -5
- package/dist/es2019/{consts.js → pm-plugins/utils/consts.js} +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/drag-handle-positions.js +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/inline-drop-target.js +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/remove-from-source.js +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/update-column-widths.js +1 -1
- package/dist/es2019/{utils → pm-plugins/utils}/validation.js +1 -1
- package/dist/es2019/ui/drag-handle.js +3 -3
- package/dist/es2019/ui/drop-target-layout.js +3 -3
- package/dist/es2019/ui/drop-target-v2.js +5 -5
- package/dist/es2019/ui/drop-target.js +2 -2
- package/dist/es2019/ui/global-styles.js +17 -2
- package/dist/es2019/ui/inline-drop-target.js +20 -8
- package/dist/esm/{plugin.js → blockControlsPlugin.js} +3 -3
- package/dist/esm/{commands → editor-commands}/move-node.js +5 -5
- package/dist/esm/{commands → editor-commands}/move-to-layout.js +4 -4
- package/dist/esm/{commands → editor-commands}/show-drag-handle.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/pm-plugins/decorations-anchor.js +1 -1
- package/dist/esm/pm-plugins/decorations-drop-target.js +4 -4
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +3 -3
- package/dist/esm/pm-plugins/main.js +5 -5
- package/dist/esm/{consts.js → pm-plugins/utils/consts.js} +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/drag-handle-positions.js +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/inline-drop-target.js +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/remove-from-source.js +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/update-column-widths.js +1 -1
- package/dist/esm/{utils → pm-plugins/utils}/validation.js +1 -1
- package/dist/esm/ui/drag-handle.js +3 -3
- package/dist/esm/ui/drop-target-layout.js +3 -3
- package/dist/esm/ui/drop-target-v2.js +5 -5
- package/dist/esm/ui/drop-target.js +2 -2
- package/dist/esm/ui/global-styles.js +17 -2
- package/dist/esm/ui/inline-drop-target.js +20 -8
- package/dist/types/blockControlsPlugin.d.ts +2 -0
- package/dist/types/{commands → editor-commands}/move-node.d.ts +2 -2
- package/dist/types/{commands → editor-commands}/move-to-layout.d.ts +1 -1
- package/dist/types/{commands → editor-commands}/show-drag-handle.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/pm-plugins/decorations-drag-handle.d.ts +1 -1
- package/dist/types/pm-plugins/decorations-drop-target.d.ts +2 -2
- package/dist/types/pm-plugins/handle-mouse-over.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/{utils → pm-plugins/utils}/active-anchor-tracker.d.ts +1 -1
- package/dist/types/{consts.d.ts → pm-plugins/utils/consts.d.ts} +1 -1
- package/dist/{types-ts4.5 → types/pm-plugins}/utils/inline-drop-target.d.ts +1 -1
- package/dist/types/ui/drag-handle-menu.d.ts +1 -1
- package/dist/types/ui/drag-handle.d.ts +1 -1
- package/dist/types/ui/drop-target-layout.d.ts +2 -2
- package/dist/types/ui/drop-target-v2.d.ts +1 -1
- package/dist/types/ui/drop-target.d.ts +1 -1
- package/dist/types/ui/inline-drop-target.d.ts +1 -1
- package/dist/types-ts4.5/blockControlsPlugin.d.ts +2 -0
- package/dist/types-ts4.5/{commands → editor-commands}/move-node.d.ts +2 -2
- package/dist/types-ts4.5/{commands → editor-commands}/move-to-layout.d.ts +1 -1
- package/dist/types-ts4.5/{commands → editor-commands}/show-drag-handle.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/decorations-drag-handle.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/decorations-drop-target.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/handle-mouse-over.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/{utils → pm-plugins/utils}/active-anchor-tracker.d.ts +1 -1
- package/dist/types-ts4.5/{consts.d.ts → pm-plugins/utils/consts.d.ts} +1 -1
- package/dist/{types → types-ts4.5/pm-plugins}/utils/inline-drop-target.d.ts +1 -1
- package/dist/types-ts4.5/ui/drag-handle-menu.d.ts +1 -1
- package/dist/types-ts4.5/ui/drag-handle.d.ts +1 -1
- package/dist/types-ts4.5/ui/drop-target-layout.d.ts +2 -2
- package/dist/types-ts4.5/ui/drop-target-v2.d.ts +1 -1
- package/dist/types-ts4.5/ui/drop-target.d.ts +1 -1
- package/dist/types-ts4.5/ui/inline-drop-target.d.ts +1 -1
- package/package.json +9 -6
- package/dist/types/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugin.d.ts +0 -2
- /package/dist/cjs/{types.js → blockControlsPluginType.js} +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/active-anchor-tracker.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/advanced-layouts-flags.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/anchor-utils.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/check-media-layout.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/drag-target-debug.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/getNestedNodePosition.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/getSelection.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/cjs/{utils → pm-plugins/utils}/transactions.js +0 -0
- /package/dist/es2019/{types.js → blockControlsPluginType.js} +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/active-anchor-tracker.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/advanced-layouts-flags.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/anchor-utils.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/check-media-layout.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/drag-target-debug.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/getNestedNodePosition.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/getSelection.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/es2019/{utils → pm-plugins/utils}/transactions.js +0 -0
- /package/dist/esm/{types.js → blockControlsPluginType.js} +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/active-anchor-tracker.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/advanced-layouts-flags.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/anchor-utils.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/check-media-layout.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/drag-target-debug.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/getNestedNodePosition.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/getSelection.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/index.js +0 -0
- /package/dist/esm/{utils → pm-plugins/utils}/transactions.js +0 -0
- /package/dist/types/{types.d.ts → blockControlsPluginType.d.ts} +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/advanced-layouts-flags.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/anchor-utils.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/check-media-layout.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/drag-handle-positions.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/drag-target-debug.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/getNestedNodePosition.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/getSelection.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/index.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/remove-from-source.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/transactions.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/update-column-widths.d.ts +0 -0
- /package/dist/types/{utils → pm-plugins/utils}/validation.d.ts +0 -0
- /package/dist/types-ts4.5/{types.d.ts → blockControlsPluginType.d.ts} +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/advanced-layouts-flags.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/anchor-utils.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/check-media-layout.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/drag-handle-positions.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/drag-target-debug.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/getNestedNodePosition.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/getSelection.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/index.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/remove-from-source.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/transactions.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/update-column-widths.d.ts +0 -0
- /package/dist/types-ts4.5/{utils → pm-plugins/utils}/validation.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 2.13.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#169341](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169341)
|
|
8
|
+
[`b8cceed0c0786`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8cceed0c0786) -
|
|
9
|
+
ED-25806: migrates file structure to editor engineering standards
|
|
10
|
+
|
|
11
|
+
## 2.13.28
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#170667](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170667)
|
|
16
|
+
[`4932e429b1256`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4932e429b1256) -
|
|
17
|
+
[ED-25679] Fix inline drop target positioning for block card, embeded card and chart extension
|
|
18
|
+
with breakout layout
|
|
19
|
+
|
|
3
20
|
## 2.13.27
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.blockControlsPlugin = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
-
var _moveNode = require("./commands/move-node");
|
|
11
|
-
var _moveToLayout = require("./commands/move-to-layout");
|
|
10
|
+
var _moveNode = require("./editor-commands/move-node");
|
|
11
|
+
var _moveToLayout = require("./editor-commands/move-to-layout");
|
|
12
12
|
var _main = require("./pm-plugins/main");
|
|
13
|
+
var _utils = require("./pm-plugins/utils");
|
|
13
14
|
var _dragHandleMenu = require("./ui/drag-handle-menu");
|
|
14
15
|
var _globalStyles = require("./ui/global-styles");
|
|
15
|
-
var _utils = require("./utils");
|
|
16
16
|
var blockControlsPlugin = exports.blockControlsPlugin = function blockControlsPlugin(_ref) {
|
|
17
17
|
var api = _ref.api;
|
|
18
18
|
return {
|
|
@@ -17,12 +17,12 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
|
17
17
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
19
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
20
|
-
var _consts = require("../consts");
|
|
21
20
|
var _main = require("../pm-plugins/main");
|
|
22
|
-
var _utils4 = require("../utils");
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
21
|
+
var _utils4 = require("../pm-plugins/utils");
|
|
22
|
+
var _consts = require("../pm-plugins/utils/consts");
|
|
23
|
+
var _getSelection = require("../pm-plugins/utils/getSelection");
|
|
24
|
+
var _removeFromSource = require("../pm-plugins/utils/remove-from-source");
|
|
25
|
+
var _validation = require("../pm-plugins/utils/validation");
|
|
26
26
|
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; }
|
|
27
27
|
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; }
|
|
28
28
|
/**
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.moveToLayout = void 0;
|
|
7
7
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
-
var _consts = require("../consts");
|
|
9
|
+
var _consts = require("../pm-plugins/utils/consts");
|
|
10
|
+
var _removeFromSource = require("../pm-plugins/utils/remove-from-source");
|
|
11
|
+
var _updateColumnWidths = require("../pm-plugins/utils/update-column-widths");
|
|
12
|
+
var _validation = require("../pm-plugins/utils/validation");
|
|
10
13
|
var _consts2 = require("../ui/consts");
|
|
11
|
-
var _removeFromSource = require("../utils/remove-from-source");
|
|
12
|
-
var _updateColumnWidths = require("../utils/update-column-widths");
|
|
13
|
-
var _validation = require("../utils/validation");
|
|
14
14
|
var createNewLayout = function createNewLayout(schema, layoutContents) {
|
|
15
15
|
if (layoutContents.length === 0 || layoutContents.length > (0, _consts.maxLayoutColumnSupported)()) {
|
|
16
16
|
return null;
|
|
@@ -8,7 +8,7 @@ var _utils = require("@atlaskit/editor-tables/utils");
|
|
|
8
8
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
9
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
10
|
var _main = require("../pm-plugins/main");
|
|
11
|
-
var _utils2 = require("../utils");
|
|
11
|
+
var _utils2 = require("../pm-plugins/utils");
|
|
12
12
|
var showDragHandleAtSelection = exports.showDragHandleAtSelection = function showDragHandleAtSelection(api, shouldFocusParentNode) {
|
|
13
13
|
return function (state, _, view) {
|
|
14
14
|
var $from = state.selection.$from;
|
package/dist/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "blockControlsPlugin", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _blockControlsPlugin.blockControlsPlugin;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _blockControlsPlugin = require("./blockControlsPlugin");
|
|
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
10
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
13
12
|
var _decorationsCommon = require("./decorations-common");
|
|
13
|
+
var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
|
|
14
14
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
15
15
|
var IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
|
|
16
16
|
var IGNORE_NODE_DESCENDANTS = ['listItem', 'taskList', 'decisionList', 'mediaSingle'];
|
|
@@ -13,15 +13,15 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
13
13
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
|
-
var _consts = require("../consts");
|
|
17
|
-
var _consts2 = require("../ui/consts");
|
|
16
|
+
var _consts = require("../ui/consts");
|
|
18
17
|
var _dropTarget = require("../ui/drop-target");
|
|
19
18
|
var _dropTargetLayout = require("../ui/drop-target-layout");
|
|
20
19
|
var _dropTargetV = require("../ui/drop-target-v2");
|
|
21
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
22
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
23
|
-
var _validation = require("../utils/validation");
|
|
24
20
|
var _decorationsCommon = require("./decorations-common");
|
|
21
|
+
var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
|
|
22
|
+
var _consts2 = require("./utils/consts");
|
|
23
|
+
var _dragTargetDebug = require("./utils/drag-target-debug");
|
|
24
|
+
var _validation = require("./utils/validation");
|
|
25
25
|
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; }
|
|
26
26
|
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; }
|
|
27
27
|
var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'listItem', 'caption'];
|
|
@@ -35,13 +35,13 @@ var shouldDescend = function shouldDescend(node) {
|
|
|
35
35
|
};
|
|
36
36
|
var getNodeMargins = function getNodeMargins(node) {
|
|
37
37
|
if (!node) {
|
|
38
|
-
return
|
|
38
|
+
return _consts.nodeMargins['default'];
|
|
39
39
|
}
|
|
40
40
|
var nodeTypeName = node.type.name;
|
|
41
41
|
if (nodeTypeName === 'heading') {
|
|
42
|
-
return
|
|
42
|
+
return _consts.nodeMargins["heading".concat(node.attrs.level)] || _consts.nodeMargins['default'];
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return _consts.nodeMargins[nodeTypeName] || _consts.nodeMargins['default'];
|
|
45
45
|
};
|
|
46
46
|
var shouldCollapseMargin = function shouldCollapseMargin(prevNode, nextNode) {
|
|
47
47
|
if (((prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) === 'mediaSingle' || (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'mediaSingle') && (prevNode === null || prevNode === void 0 ? void 0 : prevNode.type.name) !== (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name)) {
|
|
@@ -201,7 +201,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
201
201
|
}
|
|
202
202
|
if (node.type.name === 'layoutColumn' && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutSection' && index !== 0 && (
|
|
203
203
|
// Not the first node
|
|
204
|
-
(parent === null || parent === void 0 ? void 0 : parent.childCount) < (0,
|
|
204
|
+
(parent === null || parent === void 0 ? void 0 : parent.childCount) < (0, _consts2.maxLayoutColumnSupported)() || isSameLayout)) {
|
|
205
205
|
// Add drop target for layout columns
|
|
206
206
|
decs.push(createLayoutDropTargetDecoration(pos, {
|
|
207
207
|
api: api,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.handleMouseOver = void 0;
|
|
7
7
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
8
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
|
-
var _advancedLayoutsFlags = require("
|
|
9
|
+
var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
|
|
10
10
|
var isEmptyNestedParagraphOrHeading = function isEmptyNestedParagraphOrHeading(target) {
|
|
11
11
|
if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
|
|
12
12
|
var _target$parentElement;
|
|
@@ -8,9 +8,9 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
8
8
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
9
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
10
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
|
-
var _moveNode = require("../commands/move-node");
|
|
12
|
-
var _showDragHandle = require("../commands/show-drag-handle");
|
|
13
|
-
var _consts = require("
|
|
11
|
+
var _moveNode = require("../editor-commands/move-node");
|
|
12
|
+
var _showDragHandle = require("../editor-commands/show-drag-handle");
|
|
13
|
+
var _consts = require("./utils/consts");
|
|
14
14
|
function keymapList(api, formatMessage) {
|
|
15
15
|
var keymapList = {};
|
|
16
16
|
if (api && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_23873')) {
|
|
@@ -19,16 +19,16 @@ var _element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
|
|
|
19
19
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
20
20
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
21
21
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
|
-
var _activeAnchorTracker = require("../utils/active-anchor-tracker");
|
|
23
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
24
|
-
var _anchorUtils = require("../utils/anchor-utils");
|
|
25
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
26
|
-
var _transactions = require("../utils/transactions");
|
|
27
22
|
var _decorationsAnchor = require("./decorations-anchor");
|
|
28
23
|
var _decorationsDragHandle = require("./decorations-drag-handle");
|
|
29
24
|
var _decorationsDropTarget = require("./decorations-drop-target");
|
|
30
25
|
var _handleMouseOver = require("./handle-mouse-over");
|
|
31
26
|
var _keymap = require("./keymap");
|
|
27
|
+
var _activeAnchorTracker = require("./utils/active-anchor-tracker");
|
|
28
|
+
var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
|
|
29
|
+
var _anchorUtils = require("./utils/anchor-utils");
|
|
30
|
+
var _dragTargetDebug = require("./utils/drag-target-debug");
|
|
31
|
+
var _transactions = require("./utils/transactions");
|
|
32
32
|
var key = exports.key = new _state.PluginKey('blockControls');
|
|
33
33
|
var isHTMLElement = function isHTMLElement(element) {
|
|
34
34
|
return element instanceof HTMLElement;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.maxLayoutColumnSupported = exports.MIN_LAYOUT_COLUMN = exports.DIRECTION = void 0;
|
|
7
|
-
var _advancedLayoutsFlags = require("./
|
|
7
|
+
var _advancedLayoutsFlags = require("./advanced-layouts-flags");
|
|
8
8
|
var DIRECTION = exports.DIRECTION = /*#__PURE__*/function (DIRECTION) {
|
|
9
9
|
DIRECTION["UP"] = "up";
|
|
10
10
|
DIRECTION["DOWN"] = "down";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getTopPosition = exports.getLeftPosition = void 0;
|
|
7
|
-
var _consts = require("
|
|
7
|
+
var _consts = require("../../ui/consts");
|
|
8
8
|
var getTopPosition = exports.getTopPosition = function getTopPosition(dom, type) {
|
|
9
9
|
if (!dom) {
|
|
10
10
|
return 'auto';
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shouldAllowInlineDropTarget = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
|
-
var _consts = require("../consts");
|
|
9
8
|
var _advancedLayoutsFlags = require("./advanced-layouts-flags");
|
|
10
9
|
var _checkMediaLayout = require("./check-media-layout");
|
|
10
|
+
var _consts = require("./consts");
|
|
11
11
|
var shouldAllowInlineDropTarget = exports.shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(isNested, node) {
|
|
12
12
|
var isSameLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
13
13
|
var activeNode = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeFromSource = void 0;
|
|
7
|
-
var _consts = require("
|
|
7
|
+
var _consts = require("./consts");
|
|
8
8
|
var _updateColumnWidths = require("./update-column-widths");
|
|
9
9
|
var removeFromSource = exports.removeFromSource = function removeFromSource(tr, $from) {
|
|
10
10
|
var sourceNode = $from.nodeAfter;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.updateColumnWidths = void 0;
|
|
7
|
-
var _consts = require("
|
|
7
|
+
var _consts = require("../../ui/consts");
|
|
8
8
|
var updateColumnWidths = exports.updateColumnWidths = function updateColumnWidths(tr, layoutNode, layoutNodePos, childCount) {
|
|
9
9
|
var newColumnWidth = _consts.DEFAULT_COLUMN_DISTRIBUTIONS[childCount];
|
|
10
10
|
if (newColumnWidth) {
|
|
@@ -9,7 +9,7 @@ exports.transformSliceExpandToNestedExpand = exports.transformExpandToNestedExpa
|
|
|
9
9
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
10
10
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
12
|
-
var _advancedLayoutsFlags = require("
|
|
12
|
+
var _advancedLayoutsFlags = require("./advanced-layouts-flags");
|
|
13
13
|
var isInsideTable = exports.isInsideTable = function isInsideTable(nodeType) {
|
|
14
14
|
var _nodeType$schema$node = nodeType.schema.nodes,
|
|
15
15
|
tableCell = _nodeType$schema$node.tableCell,
|
|
@@ -22,9 +22,9 @@ var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/ele
|
|
|
22
22
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
23
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
24
24
|
var _main = require("../pm-plugins/main");
|
|
25
|
-
var _utils = require("../utils");
|
|
26
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
27
|
-
var _dragHandlePositions = require("../utils/drag-handle-positions");
|
|
25
|
+
var _utils = require("../pm-plugins/utils");
|
|
26
|
+
var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
|
|
27
|
+
var _dragHandlePositions = require("../pm-plugins/utils/drag-handle-positions");
|
|
28
28
|
var _consts = require("./consts");
|
|
29
29
|
var _dragPreview = require("./drag-preview");
|
|
30
30
|
/**
|
|
@@ -14,9 +14,9 @@ var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box")
|
|
|
14
14
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
15
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
16
|
var _decorationsCommon = require("../pm-plugins/decorations-common");
|
|
17
|
-
var _activeAnchorTracker = require("../utils/active-anchor-tracker");
|
|
18
|
-
var _anchorUtils = require("../utils/anchor-utils");
|
|
19
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
17
|
+
var _activeAnchorTracker = require("../pm-plugins/utils/active-anchor-tracker");
|
|
18
|
+
var _anchorUtils = require("../pm-plugins/utils/anchor-utils");
|
|
19
|
+
var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
|
|
20
20
|
/**
|
|
21
21
|
* @jsxRuntime classic
|
|
22
22
|
* @jsx jsx
|
|
@@ -16,11 +16,11 @@ var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
18
|
var _decorationsCommon = require("../pm-plugins/decorations-common");
|
|
19
|
-
var _activeAnchorTracker = require("../utils/active-anchor-tracker");
|
|
20
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
21
|
-
var _anchorUtils = require("../utils/anchor-utils");
|
|
22
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
23
|
-
var _inlineDropTarget = require("../utils/inline-drop-target");
|
|
19
|
+
var _activeAnchorTracker = require("../pm-plugins/utils/active-anchor-tracker");
|
|
20
|
+
var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
|
|
21
|
+
var _anchorUtils = require("../pm-plugins/utils/anchor-utils");
|
|
22
|
+
var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
|
|
23
|
+
var _inlineDropTarget = require("../pm-plugins/utils/inline-drop-target");
|
|
24
24
|
var _consts = require("./consts");
|
|
25
25
|
var _inlineDropTarget2 = require("./inline-drop-target");
|
|
26
26
|
/**
|
|
@@ -15,7 +15,7 @@ var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box")
|
|
|
15
15
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
18
|
+
var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
|
|
19
19
|
var _consts = require("./consts");
|
|
20
20
|
/**
|
|
21
21
|
* @jsxRuntime classic
|
|
@@ -120,7 +120,7 @@ var DropTarget = exports.DropTarget = function DropTarget(_ref3) {
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// This should be moved to platform/packages/editor/editor-plugin-block-controls/src/utils/validation.ts
|
|
123
|
+
// This should be moved to platform/packages/editor/editor-plugin-block-controls/src/pm-plugins/utils/validation.ts
|
|
124
124
|
// Since we are moved to drop-target-v2
|
|
125
125
|
// Place experiments here instead of just inside move-node.ts as it stops the drag marker from appearing.
|
|
126
126
|
if ((0, _experiments.editorExperiment)('nest-media-and-codeblock-in-quote', false)) {
|
|
@@ -202,8 +202,23 @@ var withAnchorNameZindexNestedStyle = (0, _react.css)({
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
|
+
|
|
206
|
+
// This style is used to define width for block card (with datasource) that does not have layout
|
|
207
|
+
// In full-width editor, block card has width of full-width layout
|
|
208
|
+
// In fixed-width editor, block card has width of wide layout
|
|
209
|
+
var blockCardWithoutLayout = (0, _react.css)({
|
|
210
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
211
|
+
'.ak-editor-content-area.fabric-editor--full-width-mode .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
213
|
+
'--ak-editor-block-card-width': "min(calc(100cqw - ".concat(_editorSharedStyles.akEditorBreakoutPadding, "px), 1800px)")
|
|
214
|
+
},
|
|
215
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
216
|
+
'.ak-editor-content-area .ProseMirror .ProseMirror-widget[data-blocks-drop-target-container="true"]': {
|
|
217
|
+
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
218
|
+
}
|
|
219
|
+
});
|
|
205
220
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
206
221
|
return (0, _react.jsx)(_react.Global, {
|
|
207
|
-
styles: [globalStyles(), (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
222
|
+
styles: [globalStyles(), (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_2') ? withFormatInLayoutStyleFix : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_3') ? [withRelativePosStyle, topLevelNodeMarginStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle] : undefined]
|
|
208
223
|
});
|
|
209
224
|
};
|
|
@@ -8,14 +8,15 @@ exports.InlineDropTarget = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
12
|
var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
|
|
12
13
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
13
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
14
15
|
var _decorationsCommon = require("../pm-plugins/decorations-common");
|
|
15
|
-
var _activeAnchorTracker = require("../utils/active-anchor-tracker");
|
|
16
|
-
var _advancedLayoutsFlags = require("../utils/advanced-layouts-flags");
|
|
17
|
-
var _anchorUtils = require("../utils/anchor-utils");
|
|
18
|
-
var _dragTargetDebug = require("../utils/drag-target-debug");
|
|
16
|
+
var _activeAnchorTracker = require("../pm-plugins/utils/active-anchor-tracker");
|
|
17
|
+
var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
|
|
18
|
+
var _anchorUtils = require("../pm-plugins/utils/anchor-utils");
|
|
19
|
+
var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
|
|
19
20
|
/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
|
|
20
21
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
21
22
|
/**
|
|
@@ -51,9 +52,11 @@ var defaultNodeDimension = {
|
|
|
51
52
|
bottom: 'unset'
|
|
52
53
|
};
|
|
53
54
|
var getWidthOffset = function getWidthOffset(node, width, position) {
|
|
54
|
-
if (
|
|
55
|
+
if (['mediaSingle', 'table', 'embedCard'].includes(node.type.name) ||
|
|
56
|
+
// block card (without datasource) is positioned left-aligned, hence share the same logic as align-start
|
|
57
|
+
node.type.name === 'blockCard' && !node.attrs.datasource) {
|
|
55
58
|
var isLeftPosition = position === 'left';
|
|
56
|
-
if (node.attrs.layout === 'align-start') {
|
|
59
|
+
if (node.attrs.layout === 'align-start' || node.type.name === 'blockCard') {
|
|
57
60
|
return isLeftPosition ? "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
58
61
|
} else if ((node === null || node === void 0 ? void 0 : node.attrs.layout) === 'align-end') {
|
|
59
62
|
return isLeftPosition ? "0.5*(var(--ak-editor--line-length) - ".concat(width, ")") : "-0.5*(var(--ak-editor--line-length) - ".concat(width, ")");
|
|
@@ -89,11 +92,20 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
|
|
|
89
92
|
}
|
|
90
93
|
var innerContainerWidth = null;
|
|
91
94
|
var targetAnchorName = anchorName;
|
|
92
|
-
if (['blockCard', 'embedCard'].includes(nextNode.type.name)) {
|
|
95
|
+
if (['blockCard', 'embedCard', 'extension'].includes(nextNode.type.name)) {
|
|
93
96
|
if (nextNode.attrs.layout === 'wide') {
|
|
94
97
|
innerContainerWidth = "max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))";
|
|
95
98
|
} else if (nextNode.attrs.layout === 'full-width') {
|
|
96
|
-
innerContainerWidth =
|
|
99
|
+
innerContainerWidth = "min(calc(100cqw - ".concat(_editorSharedStyles.akEditorBreakoutPadding, "px), 1800px)");
|
|
100
|
+
}
|
|
101
|
+
if (nextNode.type.name === 'blockCard' && !nextNode.attrs.layout && nextNode.attrs.datasource) {
|
|
102
|
+
// block card with sourceNode and without layout has different width in full-width vs fixed-width editor
|
|
103
|
+
// Hence we need to set it based on editor mode
|
|
104
|
+
innerContainerWidth = 'var(--ak-editor-block-card-width)';
|
|
105
|
+
}
|
|
106
|
+
if (nextNode.type.name === 'embedCard' && ['center', 'align-start', 'align-end'].includes(nextNode.attrs.layout)) {
|
|
107
|
+
var percentageWidth = ((parseFloat(nextNode.attrs.width) || 100) / 100).toFixed(2);
|
|
108
|
+
innerContainerWidth = "calc(var(--ak-editor--line-length) * ".concat(percentageWidth, ")");
|
|
97
109
|
}
|
|
98
110
|
} else if (nextNode.type.name === 'table' && nextNode.firstChild) {
|
|
99
111
|
var tableWidthAnchor = (0, _decorationsCommon.getNodeAnchor)(nextNode.firstChild);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import { moveNode } from './commands/move-node';
|
|
4
|
-
import { moveToLayout } from './commands/move-to-layout';
|
|
3
|
+
import { moveNode } from './editor-commands/move-node';
|
|
4
|
+
import { moveToLayout } from './editor-commands/move-to-layout';
|
|
5
5
|
import { createPlugin, key } from './pm-plugins/main';
|
|
6
|
+
import { selectNode } from './pm-plugins/utils';
|
|
6
7
|
import { DragHandleMenu } from './ui/drag-handle-menu';
|
|
7
8
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
8
|
-
import { selectNode } from './utils';
|
|
9
9
|
export const blockControlsPlugin = ({
|
|
10
10
|
api
|
|
11
11
|
}) => ({
|
|
@@ -9,12 +9,12 @@ import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
9
9
|
import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
|
-
import { DIRECTION } from '../consts';
|
|
13
12
|
import { key } from '../pm-plugins/main';
|
|
14
|
-
import { getNestedNodePosition, selectNode } from '../utils';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { getNestedNodePosition, selectNode } from '../pm-plugins/utils';
|
|
14
|
+
import { DIRECTION } from '../pm-plugins/utils/consts';
|
|
15
|
+
import { setCursorPositionAtMovedNode } from '../pm-plugins/utils/getSelection';
|
|
16
|
+
import { removeFromSource } from '../pm-plugins/utils/remove-from-source';
|
|
17
|
+
import { canMoveNodeToIndex, isInsideTable, transformSliceExpandToNestedExpand } from '../pm-plugins/utils/validation';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* This function transforms the slice to move
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { maxLayoutColumnSupported } from '../consts';
|
|
3
|
+
import { maxLayoutColumnSupported } from '../pm-plugins/utils/consts';
|
|
4
|
+
import { removeFromSource } from '../pm-plugins/utils/remove-from-source';
|
|
5
|
+
import { updateColumnWidths } from '../pm-plugins/utils/update-column-widths';
|
|
6
|
+
import { isInSameLayout } from '../pm-plugins/utils/validation';
|
|
4
7
|
import { DEFAULT_COLUMN_DISTRIBUTIONS } from '../ui/consts';
|
|
5
|
-
import { removeFromSource } from '../utils/remove-from-source';
|
|
6
|
-
import { updateColumnWidths } from '../utils/update-column-widths';
|
|
7
|
-
import { isInSameLayout } from '../utils/validation';
|
|
8
8
|
const createNewLayout = (schema, layoutContents) => {
|
|
9
9
|
if (layoutContents.length === 0 || layoutContents.length > maxLayoutColumnSupported()) {
|
|
10
10
|
return null;
|
|
@@ -2,7 +2,7 @@ import { isInTable } from '@atlaskit/editor-tables/utils';
|
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
4
|
import { key } from '../pm-plugins/main';
|
|
5
|
-
import { getNestedNodePosition } from '../utils';
|
|
5
|
+
import { getNestedNodePosition } from '../pm-plugins/utils';
|
|
6
6
|
export const showDragHandleAtSelection = (api, shouldFocusParentNode) => (state, _, view) => {
|
|
7
7
|
const {
|
|
8
8
|
$from
|
package/dist/es2019/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { blockControlsPlugin } from './
|
|
1
|
+
export { blockControlsPlugin } from './blockControlsPlugin';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
|
-
import { isPreRelease1, isPreRelease2 } from '../utils/advanced-layouts-flags';
|
|
5
4
|
import { getNestedDepth, getNodeAnchor, TYPE_NODE_DEC } from './decorations-common';
|
|
5
|
+
import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
|
|
6
6
|
const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
|
|
7
7
|
const IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
|
|
8
8
|
const IGNORE_NODE_DESCENDANTS = ['listItem', 'taskList', 'decisionList', 'mediaSingle'];
|
|
@@ -5,15 +5,15 @@ import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
|
5
5
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
|
-
import { maxLayoutColumnSupported } from '../consts';
|
|
9
8
|
import { nodeMargins } from '../ui/consts';
|
|
10
9
|
import { DropTarget } from '../ui/drop-target';
|
|
11
10
|
import { DropTargetLayout } from '../ui/drop-target-layout';
|
|
12
11
|
import { DropTargetV2, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target-v2';
|
|
13
|
-
import { isPreRelease2 } from '../utils/advanced-layouts-flags';
|
|
14
|
-
import { isBlocksDragTargetDebug } from '../utils/drag-target-debug';
|
|
15
|
-
import { canMoveNodeToIndex, isInSameLayout } from '../utils/validation';
|
|
16
12
|
import { getNestedDepth, TYPE_DROP_TARGET_DEC, unmountDecorations } from './decorations-common';
|
|
13
|
+
import { isPreRelease2 } from './utils/advanced-layouts-flags';
|
|
14
|
+
import { maxLayoutColumnSupported } from './utils/consts';
|
|
15
|
+
import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
|
|
16
|
+
import { canMoveNodeToIndex, isInSameLayout } from './utils/validation';
|
|
17
17
|
const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'layoutColumn', 'listItem', 'caption'];
|
|
18
18
|
const PARENT_WITH_END_DROP_TARGET = ['tableCell', 'tableHeader', 'panel', 'layoutColumn', 'expand', 'nestedExpand', 'bodiedExtension'];
|
|
19
19
|
const DISABLE_CHILD_DROP_TARGET = ['orderedList', 'bulletList'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
|
-
import { isPreRelease1, isPreRelease2 } from '
|
|
3
|
+
import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
|
|
4
4
|
const isEmptyNestedParagraphOrHeading = target => {
|
|
5
5
|
if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
|
|
6
6
|
var _target$parentElement;
|
|
@@ -2,9 +2,9 @@ import { bindKeymapWithCommand, dragToMoveDown, dragToMoveLeft, dragToMoveRight,
|
|
|
2
2
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import { moveNodeViaShortcut } from '../commands/move-node';
|
|
6
|
-
import { showDragHandleAtSelection } from '../commands/show-drag-handle';
|
|
7
|
-
import { DIRECTION } from '
|
|
5
|
+
import { moveNodeViaShortcut } from '../editor-commands/move-node';
|
|
6
|
+
import { showDragHandleAtSelection } from '../editor-commands/show-drag-handle';
|
|
7
|
+
import { DIRECTION } from './utils/consts';
|
|
8
8
|
function keymapList(api, formatMessage) {
|
|
9
9
|
let keymapList = {};
|
|
10
10
|
if (api && fg('platform_editor_element_drag_and_drop_ed_23873')) {
|
|
@@ -11,16 +11,16 @@ import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-sc
|
|
|
11
11
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
12
12
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
13
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
|
-
import { defaultActiveAnchorTracker } from '../utils/active-anchor-tracker';
|
|
15
|
-
import { isPreRelease2 } from '../utils/advanced-layouts-flags';
|
|
16
|
-
import { AnchorRectCache, isAnchorSupported } from '../utils/anchor-utils';
|
|
17
|
-
import { isBlocksDragTargetDebug } from '../utils/drag-target-debug';
|
|
18
|
-
import { getTrMetadata } from '../utils/transactions';
|
|
19
14
|
import { findNodeDecs, nodeDecorations } from './decorations-anchor';
|
|
20
15
|
import { dragHandleDecoration, emptyParagraphNodeDecorations, findHandleDec } from './decorations-drag-handle';
|
|
21
16
|
import { dropTargetDecorations, findDropTargetDecs } from './decorations-drop-target';
|
|
22
17
|
import { handleMouseOver } from './handle-mouse-over';
|
|
23
18
|
import { boundKeydownHandler } from './keymap';
|
|
19
|
+
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
20
|
+
import { isPreRelease2 } from './utils/advanced-layouts-flags';
|
|
21
|
+
import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
|
|
22
|
+
import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
|
|
23
|
+
import { getTrMetadata } from './utils/transactions';
|
|
24
24
|
export const key = new PluginKey('blockControls');
|
|
25
25
|
const isHTMLElement = element => {
|
|
26
26
|
return element instanceof HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H3_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '
|
|
1
|
+
import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H3_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
|
|
2
2
|
export const getTopPosition = (dom, type) => {
|
|
3
3
|
if (!dom) {
|
|
4
4
|
return 'auto';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
2
|
-
import { maxLayoutColumnSupported } from '../consts';
|
|
3
2
|
import { isPreRelease1, isPreRelease2 } from './advanced-layouts-flags';
|
|
4
3
|
import { isWrappedMedia } from './check-media-layout';
|
|
4
|
+
import { maxLayoutColumnSupported } from './consts';
|
|
5
5
|
export const shouldAllowInlineDropTarget = (isNested, node,
|
|
6
6
|
/**
|
|
7
7
|
* Is the active node in the same layout as the target node
|