@atlaskit/editor-plugin-block-controls 8.0.3 → 8.0.5
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/pm-plugins/selection-preservation/pm-plugin.js +9 -0
- package/dist/cjs/pm-plugins/utils/validation.js +1 -2
- package/dist/es2019/pm-plugins/selection-preservation/pm-plugin.js +10 -0
- package/dist/es2019/pm-plugins/utils/validation.js +1 -2
- package/dist/esm/pm-plugins/selection-preservation/pm-plugin.js +10 -0
- package/dist/esm/pm-plugins/utils/validation.js +1 -2
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 8.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0bf8d0bd8bf2c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0bf8d0bd8bf2c) -
|
|
8
|
+
[ux] EDITOR-4276 Apply block selection visual style only from drag handle
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 8.0.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`c4a774ad462fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4a774ad462fb) -
|
|
16
|
+
EDITOR-2477 Clean up remaining usages of `platform_editor_use_nested_table_pm_nodes` which are no
|
|
17
|
+
longer needed now that `isNestedTablesSupported` is fully rolled out.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 8.0.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -66,6 +66,15 @@ var createSelectionPreservationPlugin = exports.createSelectionPreservationPlugi
|
|
|
66
66
|
if (newState.preservedSelection && tr.docChanged) {
|
|
67
67
|
newState.preservedSelection = (0, _selection.mapPreservedSelection)(newState.preservedSelection, tr);
|
|
68
68
|
}
|
|
69
|
+
if (newState.preservedSelection !== pluginState.preservedSelection) {
|
|
70
|
+
if (newState !== null && newState !== void 0 && newState.preservedSelection) {
|
|
71
|
+
var _api$selection;
|
|
72
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.commands) === null || _api$selection === void 0 ? void 0 : _api$selection.setBlockSelection(newState.preservedSelection));
|
|
73
|
+
} else {
|
|
74
|
+
var _api$selection2;
|
|
75
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$selection2 = api.selection) === null || _api$selection2 === void 0 || (_api$selection2 = _api$selection2.commands) === null || _api$selection2 === void 0 ? void 0 : _api$selection2.clearBlockSelection());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
69
78
|
return newState;
|
|
70
79
|
}
|
|
71
80
|
},
|
|
@@ -12,7 +12,6 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
12
12
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
13
13
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var isInsideTable = exports.isInsideTable = function isInsideTable(nodeType) {
|
|
18
17
|
var _nodeType$schema$node = nodeType.schema.nodes,
|
|
@@ -113,7 +112,7 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNodePos,
|
|
|
113
112
|
var destParentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type;
|
|
114
113
|
var activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type;
|
|
115
114
|
var layoutColumnContent = srcNode.content;
|
|
116
|
-
var isNestingTablesSupported = (0, _nesting.isNestedTablesSupported)(schema) && (0,
|
|
115
|
+
var isNestingTablesSupported = (0, _nesting.isNestedTablesSupported)(schema) && (0, _experiments.editorExperiment)('nested-tables-in-tables', true, {
|
|
117
116
|
exposure: true
|
|
118
117
|
});
|
|
119
118
|
if (activeNodeType === layoutColumn && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
@@ -5,6 +5,7 @@ import { mapPreservedSelection } from '../utils/selection';
|
|
|
5
5
|
import { stopPreservingSelection } from './editor-commands';
|
|
6
6
|
import { selectionPreservationPluginKey } from './plugin-key';
|
|
7
7
|
import { getSelectionPreservationMeta, hasUserSelectionChange, isSelectionWithinCodeBlock } from './utils';
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Selection Preservation Plugin
|
|
10
11
|
*
|
|
@@ -57,6 +58,15 @@ export const createSelectionPreservationPlugin = api => () => {
|
|
|
57
58
|
if (newState.preservedSelection && tr.docChanged) {
|
|
58
59
|
newState.preservedSelection = mapPreservedSelection(newState.preservedSelection, tr);
|
|
59
60
|
}
|
|
61
|
+
if (newState.preservedSelection !== pluginState.preservedSelection) {
|
|
62
|
+
if (newState !== null && newState !== void 0 && newState.preservedSelection) {
|
|
63
|
+
var _api$selection, _api$selection$comman;
|
|
64
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : (_api$selection$comman = _api$selection.commands) === null || _api$selection$comman === void 0 ? void 0 : _api$selection$comman.setBlockSelection(newState.preservedSelection));
|
|
65
|
+
} else {
|
|
66
|
+
var _api$selection2, _api$selection2$comma;
|
|
67
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$selection2 = api.selection) === null || _api$selection2 === void 0 ? void 0 : (_api$selection2$comma = _api$selection2.commands) === null || _api$selection2$comma === void 0 ? void 0 : _api$selection2$comma.clearBlockSelection());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
return newState;
|
|
61
71
|
}
|
|
62
72
|
},
|
|
@@ -2,7 +2,6 @@ import memoizeOne from 'memoize-one';
|
|
|
2
2
|
import { getParentOfTypeCount, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
3
3
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
export const isInsideTable = nodeType => {
|
|
8
7
|
const {
|
|
@@ -104,7 +103,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
104
103
|
const destParentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type;
|
|
105
104
|
const activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type;
|
|
106
105
|
const layoutColumnContent = srcNode.content;
|
|
107
|
-
const isNestingTablesSupported = isNestedTablesSupported(schema) &&
|
|
106
|
+
const isNestingTablesSupported = isNestedTablesSupported(schema) && editorExperiment('nested-tables-in-tables', true, {
|
|
108
107
|
exposure: true
|
|
109
108
|
});
|
|
110
109
|
if (activeNodeType === layoutColumn && editorExperiment('advanced_layouts', true)) {
|
|
@@ -8,6 +8,7 @@ import { mapPreservedSelection } from '../utils/selection';
|
|
|
8
8
|
import { stopPreservingSelection } from './editor-commands';
|
|
9
9
|
import { selectionPreservationPluginKey } from './plugin-key';
|
|
10
10
|
import { getSelectionPreservationMeta, hasUserSelectionChange, isSelectionWithinCodeBlock } from './utils';
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Selection Preservation Plugin
|
|
13
14
|
*
|
|
@@ -59,6 +60,15 @@ export var createSelectionPreservationPlugin = function createSelectionPreservat
|
|
|
59
60
|
if (newState.preservedSelection && tr.docChanged) {
|
|
60
61
|
newState.preservedSelection = mapPreservedSelection(newState.preservedSelection, tr);
|
|
61
62
|
}
|
|
63
|
+
if (newState.preservedSelection !== pluginState.preservedSelection) {
|
|
64
|
+
if (newState !== null && newState !== void 0 && newState.preservedSelection) {
|
|
65
|
+
var _api$selection;
|
|
66
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 || (_api$selection = _api$selection.commands) === null || _api$selection === void 0 ? void 0 : _api$selection.setBlockSelection(newState.preservedSelection));
|
|
67
|
+
} else {
|
|
68
|
+
var _api$selection2;
|
|
69
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$selection2 = api.selection) === null || _api$selection2 === void 0 || (_api$selection2 = _api$selection2.commands) === null || _api$selection2 === void 0 ? void 0 : _api$selection2.clearBlockSelection());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
62
72
|
return newState;
|
|
63
73
|
}
|
|
64
74
|
},
|
|
@@ -2,7 +2,6 @@ import memoizeOne from 'memoize-one';
|
|
|
2
2
|
import { getParentOfTypeCount, isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
3
3
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
export var isInsideTable = function isInsideTable(nodeType) {
|
|
8
7
|
var _nodeType$schema$node = nodeType.schema.nodes,
|
|
@@ -103,7 +102,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, $destNo
|
|
|
103
102
|
var destParentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type;
|
|
104
103
|
var activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type;
|
|
105
104
|
var layoutColumnContent = srcNode.content;
|
|
106
|
-
var isNestingTablesSupported = isNestedTablesSupported(schema) &&
|
|
105
|
+
var isNestingTablesSupported = isNestedTablesSupported(schema) && editorExperiment('nested-tables-in-tables', true, {
|
|
107
106
|
exposure: true
|
|
108
107
|
});
|
|
109
108
|
if (activeNodeType === layoutColumn && editorExperiment('advanced_layouts', true)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.5",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
48
48
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
49
|
-
"@atlaskit/icon": "^29.
|
|
49
|
+
"@atlaskit/icon": "^29.4.0",
|
|
50
50
|
"@atlaskit/link": "^3.3.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
55
55
|
"@atlaskit/primitives": "^17.0.0",
|
|
56
56
|
"@atlaskit/theme": "^21.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
58
|
-
"@atlaskit/tokens": "^9.
|
|
59
|
-
"@atlaskit/tooltip": "^20.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^16.11.0",
|
|
58
|
+
"@atlaskit/tokens": "^9.1.0",
|
|
59
|
+
"@atlaskit/tooltip": "^20.12.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
61
61
|
"@emotion/react": "^11.7.1",
|
|
62
62
|
"@popperjs/core": "^2.11.8",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^111.
|
|
69
|
+
"@atlaskit/editor-common": "^111.7.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -110,9 +110,6 @@
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
"platform-feature-flags": {
|
|
113
|
-
"platform_editor_use_nested_table_pm_nodes": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
113
|
"platform_editor_track_node_types": {
|
|
117
114
|
"type": "boolean"
|
|
118
115
|
},
|