@atlaskit/editor-plugin-block-controls 1.4.35 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/ui/global-styles.js +13 -6
- package/dist/es2019/ui/global-styles.js +18 -7
- package/dist/esm/ui/global-styles.js +13 -6
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 1.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#113204](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113204)
|
|
8
|
+
[`6c05be5902ad7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6c05be5902ad7) -
|
|
9
|
+
hide handle on empty p fix under a ff
|
|
10
|
+
|
|
11
|
+
## 1.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#115247](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115247)
|
|
16
|
+
[`251d23ff9e6c8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/251d23ff9e6c8) -
|
|
17
|
+
upgrade adf-schema version to 38.0.0
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 1.4.35
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -36,18 +36,25 @@ var extendedHoverZone = (0, _react.css)({
|
|
|
36
36
|
});
|
|
37
37
|
var paragraphWithTrailingBreak = '+ p > .ProseMirror-trailingBreak';
|
|
38
38
|
var paragraphWithCursorTarget = '+ p > .cursor-target';
|
|
39
|
-
var
|
|
39
|
+
var paragraphWithTrailingBreakAsOnlyChild = '+ p > .ProseMirror-trailingBreak:only-child';
|
|
40
|
+
var paragraphWithPlaceholder = '+ p > .placeholder-decoration';
|
|
41
|
+
var withoutInlineNodeStyleFix = (0, _react.css)((0, _defineProperty2.default)({}, ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreak, "):not(:has(").concat(paragraphWithCursorTarget, "))"), {
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
43
|
+
display: 'none !important'
|
|
44
|
+
}));
|
|
45
|
+
var withInlineNodeStyleFix = (0, _react.css)((0, _defineProperty2.default)({}, ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreakAsOnlyChild, "), .ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(").concat(paragraphWithPlaceholder, ")"), {
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
47
|
+
display: 'none !important'
|
|
48
|
+
}));
|
|
49
|
+
var globalStyles = (0, _react.css)({
|
|
40
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
41
51
|
'.ProseMirror-widget:first-child + *': {
|
|
42
52
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
43
53
|
marginTop: '0 !important'
|
|
44
54
|
}
|
|
45
|
-
}
|
|
46
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
47
|
-
display: 'none !important'
|
|
48
|
-
}));
|
|
55
|
+
});
|
|
49
56
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
50
57
|
return (0, _react.jsx)(_react.Global, {
|
|
51
|
-
styles: [globalStyles, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone]
|
|
58
|
+
styles: [globalStyles, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-ED-23868') ? withInlineNodeStyleFix : withoutInlineNodeStyleFix]
|
|
52
59
|
});
|
|
53
60
|
};
|
|
@@ -27,12 +27,9 @@ const extendedHoverZone = css({
|
|
|
27
27
|
});
|
|
28
28
|
const paragraphWithTrailingBreak = '+ p > .ProseMirror-trailingBreak';
|
|
29
29
|
const paragraphWithCursorTarget = '+ p > .cursor-target';
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
34
|
-
marginTop: '0 !important'
|
|
35
|
-
},
|
|
30
|
+
const paragraphWithTrailingBreakAsOnlyChild = '+ p > .ProseMirror-trailingBreak:only-child';
|
|
31
|
+
const paragraphWithPlaceholder = '+ p > .placeholder-decoration';
|
|
32
|
+
const withoutInlineNodeStyleFix = css({
|
|
36
33
|
// Currently, we are hiding the drag handle container by checking if the paragraph has a trailing break and no cursor target
|
|
37
34
|
// TODO ED-23827 add a classname to empty paragraphs for easier targeting
|
|
38
35
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
@@ -41,8 +38,22 @@ const globalStyles = css({
|
|
|
41
38
|
display: 'none !important'
|
|
42
39
|
}
|
|
43
40
|
});
|
|
41
|
+
const withInlineNodeStyleFix = css({
|
|
42
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
43
|
+
[`.ProseMirror-widget[data-blocks-drag-handle-container="true"]:has(${paragraphWithTrailingBreakAsOnlyChild}), .ProseMirror-widget[data-blocks-drag-handle-container="true"]:has(${paragraphWithPlaceholder})`]: {
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
45
|
+
display: 'none !important'
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const globalStyles = css({
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
50
|
+
'.ProseMirror-widget:first-child + *': {
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
52
|
+
marginTop: '0 !important'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
44
55
|
export const GlobalStylesWrapper = () => {
|
|
45
56
|
return jsx(Global, {
|
|
46
|
-
styles: [globalStyles, getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone]
|
|
57
|
+
styles: [globalStyles, getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone, getBooleanFF('platform.editor.elements.drag-and-drop-ED-23868') ? withInlineNodeStyleFix : withoutInlineNodeStyleFix]
|
|
47
58
|
});
|
|
48
59
|
};
|
|
@@ -28,18 +28,25 @@ var extendedHoverZone = css({
|
|
|
28
28
|
});
|
|
29
29
|
var paragraphWithTrailingBreak = '+ p > .ProseMirror-trailingBreak';
|
|
30
30
|
var paragraphWithCursorTarget = '+ p > .cursor-target';
|
|
31
|
-
var
|
|
31
|
+
var paragraphWithTrailingBreakAsOnlyChild = '+ p > .ProseMirror-trailingBreak:only-child';
|
|
32
|
+
var paragraphWithPlaceholder = '+ p > .placeholder-decoration';
|
|
33
|
+
var withoutInlineNodeStyleFix = css(_defineProperty({}, ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreak, "):not(:has(").concat(paragraphWithCursorTarget, "))"), {
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
35
|
+
display: 'none !important'
|
|
36
|
+
}));
|
|
37
|
+
var withInlineNodeStyleFix = css(_defineProperty({}, ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreakAsOnlyChild, "), .ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(").concat(paragraphWithPlaceholder, ")"), {
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
39
|
+
display: 'none !important'
|
|
40
|
+
}));
|
|
41
|
+
var globalStyles = css({
|
|
32
42
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
33
43
|
'.ProseMirror-widget:first-child + *': {
|
|
34
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
35
45
|
marginTop: '0 !important'
|
|
36
46
|
}
|
|
37
|
-
}
|
|
38
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
39
|
-
display: 'none !important'
|
|
40
|
-
}));
|
|
47
|
+
});
|
|
41
48
|
export var GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
42
49
|
return jsx(Global, {
|
|
43
|
-
styles: [globalStyles, getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone]
|
|
50
|
+
styles: [globalStyles, getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && extendedHoverZone, getBooleanFF('platform.editor.elements.drag-and-drop-ED-23868') ? withInlineNodeStyleFix : withoutInlineNodeStyleFix]
|
|
44
51
|
});
|
|
45
52
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
-
"@atlaskit/editor-common": "^83.
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
34
|
+
"@atlaskit/adf-schema": "^38.0.0",
|
|
35
|
+
"@atlaskit/editor-common": "^83.3.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.5",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-width": "^1.1.0",
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
"platform.editor.elements.drag-and-drop-doc-size-limit_7k4vq": {
|
|
96
96
|
"type": "boolean"
|
|
97
97
|
},
|
|
98
|
+
"platform.editor.elements.drag-and-drop-ED-23868": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
98
101
|
"platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2": {
|
|
99
102
|
"type": "boolean"
|
|
100
103
|
},
|