@atlaskit/editor-plugin-block-controls 9.1.17 → 9.1.19
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/utils/getSelection.js +0 -11
- package/dist/cjs/ui/drag-handle.js +3 -3
- package/dist/es2019/pm-plugins/utils/getSelection.js +0 -9
- package/dist/es2019/ui/drag-handle.js +3 -3
- package/dist/esm/pm-plugins/utils/getSelection.js +0 -11
- package/dist/esm/ui/drag-handle.js +3 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 9.1.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7aff76124fe7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7aff76124fe7f) -
|
|
8
|
+
[ux] [EDITOR-6282] scale the size of the drag handle with the base font size
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 9.1.18
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`1bd298ad0a152`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bd298ad0a152) -
|
|
16
|
+
[ux] EDITOR-6280 Clean up platform_editor_block_menu_v2_patch_3 to fix icon and copy in jira block
|
|
17
|
+
menu
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 9.1.17
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
14
13
|
var getInlineNodePos = exports.getInlineNodePos = function getInlineNodePos(doc, start, nodeSize) {
|
|
15
14
|
var $startPos = doc.resolve(start);
|
|
@@ -97,21 +96,11 @@ var newGetSelection = exports.newGetSelection = function newGetSelection(doc, se
|
|
|
97
96
|
var nodeSize = node ? node.nodeSize : 1;
|
|
98
97
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
99
98
|
if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
|
|
100
|
-
var _doc$nodeAt;
|
|
101
99
|
// if mediaGroup only has a single child, we want to select the child
|
|
102
100
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
103
101
|
var $mediaStartPos = doc.resolve(start + 1);
|
|
104
102
|
return new _state.NodeSelection($mediaStartPos);
|
|
105
103
|
}
|
|
106
|
-
|
|
107
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
108
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
109
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
110
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(function (mark) {
|
|
111
|
-
return mark.type.name === 'alignment';
|
|
112
|
-
}) && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !(0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) {
|
|
113
|
-
return _state.TextSelection.create(doc, start, start + nodeSize);
|
|
114
|
-
}
|
|
115
104
|
return new _state.NodeSelection(doc.resolve(start));
|
|
116
105
|
}
|
|
117
106
|
|
|
@@ -140,8 +140,8 @@ var dragHandleButtonStyles = (0, _react2.css)({
|
|
|
140
140
|
|
|
141
141
|
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
142
142
|
// Default font size is 16px, scale proportionally
|
|
143
|
-
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w
|
|
144
|
-
var
|
|
143
|
+
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w, Jira: 14px -> 21h x 12w
|
|
144
|
+
var dragHandleButtonScaledStyles = (0, _react2.css)({
|
|
145
145
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
146
146
|
height: (0, _consts.relativeSizeToBaseFontSize)(_consts2.DRAG_HANDLE_HEIGHT),
|
|
147
147
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -1080,7 +1080,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
1080
1080
|
css: [(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && dragHandleColor,
|
|
1081
1081
|
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
1082
1082
|
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
1083
|
-
browser.gecko && dragHandleMultiLineSelectionFixFirefox, (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true) && (0, _experiments.editorExperiment)('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, (0, _experiments.editorExperiment)('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, ((0, _expValEquals.expValEquals)('confluence_compact_text_format', 'isEnabled', true) || (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp')) &&
|
|
1083
|
+
browser.gecko && dragHandleMultiLineSelectionFixFirefox, (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, (0, _experiments.editorExperiment)('platform_editor_preview_panel_responsiveness', true) && (0, _experiments.editorExperiment)('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, (0, _experiments.editorExperiment)('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, (0, _experiments.editorExperiment)('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, ((0, _expValEquals.expValEquals)('confluence_compact_text_format', 'isEnabled', true) || (0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') || (0, _experiments.editorExperiment)('platform_editor_block_menu', true) && (0, _platformFeatureFlags.fg)('platform_editor_block_menu_jira_patch_1')) && dragHandleButtonScaledStyles],
|
|
1084
1084
|
ref: buttonRef
|
|
1085
1085
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1086
1086
|
,
|
|
@@ -3,7 +3,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
3
3
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export const getInlineNodePos = (doc, start, nodeSize) => {
|
|
9
8
|
const $startPos = doc.resolve(start);
|
|
@@ -92,19 +91,11 @@ export const newGetSelection = (doc, selectionEmpty, start) => {
|
|
|
92
91
|
const nodeSize = node ? node.nodeSize : 1;
|
|
93
92
|
const nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
94
93
|
if (editorExperiment('platform_editor_block_menu', true)) {
|
|
95
|
-
var _doc$nodeAt;
|
|
96
94
|
// if mediaGroup only has a single child, we want to select the child
|
|
97
95
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
98
96
|
const $mediaStartPos = doc.resolve(start + 1);
|
|
99
97
|
return new NodeSelection($mediaStartPos);
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
103
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
104
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
105
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(mark => mark.type.name === 'alignment') && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !fg('platform_editor_block_menu_v2_patch_3')) {
|
|
106
|
-
return TextSelection.create(doc, start, start + nodeSize);
|
|
107
|
-
}
|
|
108
99
|
return new NodeSelection(doc.resolve(start));
|
|
109
100
|
}
|
|
110
101
|
|
|
@@ -131,8 +131,8 @@ const dragHandleButtonStyles = css({
|
|
|
131
131
|
|
|
132
132
|
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
133
133
|
// Default font size is 16px, scale proportionally
|
|
134
|
-
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w
|
|
135
|
-
const
|
|
134
|
+
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w, Jira: 14px -> 21h x 12w
|
|
135
|
+
const dragHandleButtonScaledStyles = css({
|
|
136
136
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
137
137
|
height: relativeSizeToBaseFontSize(DRAG_HANDLE_HEIGHT),
|
|
138
138
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -1061,7 +1061,7 @@ export const DragHandle = ({
|
|
|
1061
1061
|
css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
|
|
1062
1062
|
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
1063
1063
|
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
1064
|
-
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, editorExperiment('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, editorExperiment('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, (expValEquals('confluence_compact_text_format', 'isEnabled', true) || expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp')) &&
|
|
1064
|
+
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, editorExperiment('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, editorExperiment('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, (expValEquals('confluence_compact_text_format', 'isEnabled', true) || expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') || editorExperiment('platform_editor_block_menu', true) && fg('platform_editor_block_menu_jira_patch_1')) && dragHandleButtonScaledStyles],
|
|
1065
1065
|
ref: buttonRef
|
|
1066
1066
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1067
1067
|
,
|
|
@@ -3,7 +3,6 @@ import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-che
|
|
|
3
3
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
export var getInlineNodePos = function getInlineNodePos(doc, start, nodeSize) {
|
|
9
8
|
var $startPos = doc.resolve(start);
|
|
@@ -91,21 +90,11 @@ export var newGetSelection = function newGetSelection(doc, selectionEmpty, start
|
|
|
91
90
|
var nodeSize = node ? node.nodeSize : 1;
|
|
92
91
|
var nodeName = node === null || node === void 0 ? void 0 : node.type.name;
|
|
93
92
|
if (editorExperiment('platform_editor_block_menu', true)) {
|
|
94
|
-
var _doc$nodeAt;
|
|
95
93
|
// if mediaGroup only has a single child, we want to select the child
|
|
96
94
|
if (nodeName === 'mediaGroup' && (node === null || node === void 0 ? void 0 : node.childCount) === 1) {
|
|
97
95
|
var $mediaStartPos = doc.resolve(start + 1);
|
|
98
96
|
return new NodeSelection($mediaStartPos);
|
|
99
97
|
}
|
|
100
|
-
|
|
101
|
-
// if heading with alignment nested inside a layout column, return TextSelection
|
|
102
|
-
// As NodeSelection cause the desc.selectNode is not a function error in the syncNodeSelection in prosemirror view
|
|
103
|
-
// Results in block menu not open on the first 2 clicks for a heading with alignment nested inside a layout column
|
|
104
|
-
if (nodeName === 'heading' && node !== null && node !== void 0 && node.marks.some(function (mark) {
|
|
105
|
-
return mark.type.name === 'alignment';
|
|
106
|
-
}) && ((_doc$nodeAt = doc.nodeAt(start - 1)) === null || _doc$nodeAt === void 0 ? void 0 : _doc$nodeAt.type.name) === 'layoutColumn' && !fg('platform_editor_block_menu_v2_patch_3')) {
|
|
107
|
-
return TextSelection.create(doc, start, start + nodeSize);
|
|
108
|
-
}
|
|
109
98
|
return new NodeSelection(doc.resolve(start));
|
|
110
99
|
}
|
|
111
100
|
|
|
@@ -136,8 +136,8 @@ var dragHandleButtonStyles = css({
|
|
|
136
136
|
|
|
137
137
|
// Calculate scaled dimensions based on the base font size using CSS calc()
|
|
138
138
|
// Default font size is 16px, scale proportionally
|
|
139
|
-
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w
|
|
140
|
-
var
|
|
139
|
+
// Standard: 16px -> 24h x 12w, Dense: 13px -> 18h x 9w, Jira: 14px -> 21h x 12w
|
|
140
|
+
var dragHandleButtonScaledStyles = css({
|
|
141
141
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
142
142
|
height: relativeSizeToBaseFontSize(DRAG_HANDLE_HEIGHT),
|
|
143
143
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -1076,7 +1076,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
1076
1076
|
css: [editorExperiment('platform_editor_controls', 'variant1') ? dragHandleButtonStyles : dragHandleButtonStylesOld, editorExperiment('platform_editor_controls', 'variant1') && dragHandleColor,
|
|
1077
1077
|
// ED-26266: Fixed the drag handle highlight when selecting multiple line in Firefox
|
|
1078
1078
|
// See https://product-fabric.atlassian.net/browse/ED-26266
|
|
1079
|
-
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, editorExperiment('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, editorExperiment('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, (expValEquals('confluence_compact_text_format', 'isEnabled', true) || expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp')) &&
|
|
1079
|
+
browser.gecko && dragHandleMultiLineSelectionFixFirefox, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && hasHadInteraction && selectedStyles, editorExperiment('platform_editor_preview_panel_responsiveness', true) && editorExperiment('platform_editor_controls', 'control') && dragHandleButtonSmallScreenStyles, editorExperiment('platform_editor_block_menu', true) && isFocused && keyboardFocusedDragHandleStyles, editorExperiment('platform_editor_block_menu', true) ? focusedStyles : focusedStylesOld, (expValEquals('confluence_compact_text_format', 'isEnabled', true) || expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') || editorExperiment('platform_editor_block_menu', true) && fg('platform_editor_block_menu_jira_patch_1')) && dragHandleButtonScaledStyles],
|
|
1080
1080
|
ref: buttonRef
|
|
1081
1081
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
1082
1082
|
,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.19",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
57
57
|
"@atlaskit/primitives": "^19.0.0",
|
|
58
58
|
"@atlaskit/theme": "^23.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^62.3.0",
|
|
60
60
|
"@atlaskit/tokens": "^13.0.0",
|
|
61
61
|
"@atlaskit/tooltip": "^21.1.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"uuid": "^3.1.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@atlaskit/editor-common": "^112.
|
|
70
|
+
"@atlaskit/editor-common": "^112.22.0",
|
|
71
71
|
"react": "^18.2.0",
|
|
72
72
|
"react-dom": "^18.2.0",
|
|
73
73
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -132,15 +132,15 @@
|
|
|
132
132
|
"platform_editor_content_mode_button_mvp": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
|
-
"platform_editor_block_menu_v2_patch_3": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
135
|
"platform_editor_table_sticky_header_patch_6": {
|
|
139
136
|
"type": "boolean"
|
|
140
137
|
},
|
|
141
138
|
"platform_editor_expose_block_controls_deco_api": {
|
|
142
139
|
"type": "boolean"
|
|
143
140
|
},
|
|
141
|
+
"platform_editor_block_menu_jira_patch_1": {
|
|
142
|
+
"type": "boolean"
|
|
143
|
+
},
|
|
144
144
|
"confluence_remix_button_right_side_block_fg": {
|
|
145
145
|
"type": "boolean"
|
|
146
146
|
}
|