@atlaskit/editor-plugin-block-controls 2.1.3 → 2.1.4

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#144925](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144925)
8
+ [`9faf9ff89ad37`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9faf9ff89ad37) -
9
+ ED-24822 - Add padding to panels with no icon and unhide drag handle in first bodied node
10
+
3
11
  ## 2.1.3
4
12
 
5
13
  ### Patch Changes
@@ -67,7 +67,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
67
67
 
68
68
  // We want to exlude handles showing for first element in a Panel, ignoring widgets like gapcursor
69
69
  var firstChildIsWidget = parentRootElement === null || parentRootElement === void 0 || (_parentRootElement$ch = parentRootElement.children[0]) === null || _parentRootElement$ch === void 0 ? void 0 : _parentRootElement$ch.classList.contains('ProseMirror-widget');
70
- if (parentElement && parentElementType === 'panel' && (index === 0 || firstChildIsWidget && index === 1)) {
70
+ if (parentElement && parentElementType === 'panel' && ((0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? !parentElement.classList.contains('ak-editor-panel__no-icon') : true) && (index === 0 || firstChildIsWidget && index === 1)) {
71
71
  return false;
72
72
  }
73
73
  } else {
@@ -111,6 +111,7 @@ var paragraphWithPlaceholder = '+ p > .placeholder-decoration';
111
111
  var dragHandleContainer = '.ProseMirror-widget[data-blocks-drag-handle-container="true"]';
112
112
  var dragHandleSelector = 'button[data-testid="block-ctrl-drag-handle"]';
113
113
  var withInlineNodeStyleSelectors = [".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreakAsOnlyChild, ")"), ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(indentatedParagraphWithTrailingBreakAsOnlyChild, ")"), ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithPlaceholder, ")")].join(', ');
114
+ var dividerBodiedInCustomPanelWithNoIconSelector = '[data-panel-type].ak-editor-panel__no-icon .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + hr, [data-panel-type] hr:first-child';
114
115
  var withInlineNodeStyle = (0, _react.css)((0, _defineProperty2.default)({}, withInlineNodeStyleSelectors, {
115
116
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
116
117
  display: 'none !important'
@@ -137,6 +138,10 @@ var globalStyles = (0, _experiments.editorExperiment)('nested-dnd', true) ? (0,
137
138
  marginTop: '0 !important'
138
139
  }
139
140
  });
141
+ var withDividerInPanelStyleFix = (0, _react.css)((0, _defineProperty2.default)({}, "".concat(dividerBodiedInCustomPanelWithNoIconSelector), {
142
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
143
+ marginTop: '0 !important'
144
+ }));
140
145
  var withDeleteLinesStyleFix = (0, _react.css)((0, _defineProperty2.default)({}, "p[data-drag-handler-anchor-name] ".concat(dragHandleContainer), {
141
146
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
142
147
  display: 'none !important'
@@ -155,6 +160,6 @@ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWra
155
160
  return (0, _react.jsx)(_react.Global, {
156
161
  styles: [globalStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested : extendedHoverZone, getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, (0, _experiments.editorExperiment)('platform_editor_empty_line_prompt', true, {
157
162
  exposure: false
158
- }) ? _globalStyles.emptyBlockExperimentGlobalStyles : undefined]
163
+ }) ? _globalStyles.emptyBlockExperimentGlobalStyles : undefined, (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined]
159
164
  });
160
165
  };
@@ -62,7 +62,7 @@ export const handleMouseOver = (view, event, api) => {
62
62
 
63
63
  // We want to exlude handles showing for first element in a Panel, ignoring widgets like gapcursor
64
64
  const firstChildIsWidget = parentRootElement === null || parentRootElement === void 0 ? void 0 : (_parentRootElement$ch = parentRootElement.children[0]) === null || _parentRootElement$ch === void 0 ? void 0 : _parentRootElement$ch.classList.contains('ProseMirror-widget');
65
- if (parentElement && parentElementType === 'panel' && (index === 0 || firstChildIsWidget && index === 1)) {
65
+ if (parentElement && parentElementType === 'panel' && (fg('platform_editor_element_dnd_nested_fix_patch_1') ? !parentElement.classList.contains('ak-editor-panel__no-icon') : true) && (index === 0 || firstChildIsWidget && index === 1)) {
66
66
  return false;
67
67
  }
68
68
  } else {
@@ -102,6 +102,7 @@ const paragraphWithPlaceholder = '+ p > .placeholder-decoration';
102
102
  const dragHandleContainer = '.ProseMirror-widget[data-blocks-drag-handle-container="true"]';
103
103
  const dragHandleSelector = 'button[data-testid="block-ctrl-drag-handle"]';
104
104
  const withInlineNodeStyleSelectors = [`.ProseMirror-widget[data-blocks-drag-handle-container="true"]:has(${paragraphWithTrailingBreakAsOnlyChild})`, `.ProseMirror-widget[data-blocks-drag-handle-container="true"]:has(${indentatedParagraphWithTrailingBreakAsOnlyChild})`, `.ProseMirror-widget[data-blocks-drag-handle-container="true"]:has(${paragraphWithPlaceholder})`].join(', ');
105
+ const dividerBodiedInCustomPanelWithNoIconSelector = '[data-panel-type].ak-editor-panel__no-icon .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + hr, [data-panel-type] hr:first-child';
105
106
  const withInlineNodeStyle = css({
106
107
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
107
108
  [withInlineNodeStyleSelectors]: {
@@ -134,6 +135,13 @@ const globalStyles = editorExperiment('nested-dnd', true) ? css({
134
135
  marginTop: '0 !important'
135
136
  }
136
137
  });
138
+ const withDividerInPanelStyleFix = css({
139
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
140
+ [`${dividerBodiedInCustomPanelWithNoIconSelector}`]: {
141
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
142
+ marginTop: '0 !important'
143
+ }
144
+ });
137
145
  const withDeleteLinesStyleFix = css({
138
146
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
139
147
  [`p[data-drag-handler-anchor-name] ${dragHandleContainer}`]: {
@@ -158,6 +166,6 @@ export const GlobalStylesWrapper = () => {
158
166
  return jsx(Global, {
159
167
  styles: [globalStyles, editorExperiment('nested-dnd', true) ? extendedHoverZoneNested : extendedHoverZone, getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, editorExperiment('platform_editor_empty_line_prompt', true, {
160
168
  exposure: false
161
- }) ? emptyBlockExperimentGlobalStyles : undefined]
169
+ }) ? emptyBlockExperimentGlobalStyles : undefined, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined]
162
170
  });
163
171
  };
@@ -61,7 +61,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
61
61
 
62
62
  // We want to exlude handles showing for first element in a Panel, ignoring widgets like gapcursor
63
63
  var firstChildIsWidget = parentRootElement === null || parentRootElement === void 0 || (_parentRootElement$ch = parentRootElement.children[0]) === null || _parentRootElement$ch === void 0 ? void 0 : _parentRootElement$ch.classList.contains('ProseMirror-widget');
64
- if (parentElement && parentElementType === 'panel' && (index === 0 || firstChildIsWidget && index === 1)) {
64
+ if (parentElement && parentElementType === 'panel' && (fg('platform_editor_element_dnd_nested_fix_patch_1') ? !parentElement.classList.contains('ak-editor-panel__no-icon') : true) && (index === 0 || firstChildIsWidget && index === 1)) {
65
65
  return false;
66
66
  }
67
67
  } else {
@@ -103,6 +103,7 @@ var paragraphWithPlaceholder = '+ p > .placeholder-decoration';
103
103
  var dragHandleContainer = '.ProseMirror-widget[data-blocks-drag-handle-container="true"]';
104
104
  var dragHandleSelector = 'button[data-testid="block-ctrl-drag-handle"]';
105
105
  var withInlineNodeStyleSelectors = [".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithTrailingBreakAsOnlyChild, ")"), ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(indentatedParagraphWithTrailingBreakAsOnlyChild, ")"), ".ProseMirror-widget[data-blocks-drag-handle-container=\"true\"]:has(".concat(paragraphWithPlaceholder, ")")].join(', ');
106
+ var dividerBodiedInCustomPanelWithNoIconSelector = '[data-panel-type].ak-editor-panel__no-icon .ProseMirror-widget:first-child + .ProseMirror-widget:nth-child(2) + hr, [data-panel-type] hr:first-child';
106
107
  var withInlineNodeStyle = css(_defineProperty({}, withInlineNodeStyleSelectors, {
107
108
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
108
109
  display: 'none !important'
@@ -129,6 +130,10 @@ var globalStyles = editorExperiment('nested-dnd', true) ? css({
129
130
  marginTop: '0 !important'
130
131
  }
131
132
  });
133
+ var withDividerInPanelStyleFix = css(_defineProperty({}, "".concat(dividerBodiedInCustomPanelWithNoIconSelector), {
134
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
135
+ marginTop: '0 !important'
136
+ }));
132
137
  var withDeleteLinesStyleFix = css(_defineProperty({}, "p[data-drag-handler-anchor-name] ".concat(dragHandleContainer), {
133
138
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
134
139
  display: 'none !important'
@@ -147,6 +152,6 @@ export var GlobalStylesWrapper = function GlobalStylesWrapper() {
147
152
  return jsx(Global, {
148
153
  styles: [globalStyles, editorExperiment('nested-dnd', true) ? extendedHoverZoneNested : extendedHoverZone, getTextNodeStyle(), withDeleteLinesStyleFix, withMediaSingleStyleFix, editorExperiment('platform_editor_empty_line_prompt', true, {
149
154
  exposure: false
150
- }) ? emptyBlockExperimentGlobalStyles : undefined]
155
+ }) ? emptyBlockExperimentGlobalStyles : undefined, fg('platform_editor_element_dnd_nested_fix_patch_1') ? withDividerInPanelStyleFix : undefined]
151
156
  });
152
157
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -135,6 +135,9 @@
135
135
  },
136
136
  "platform_editor_empty_line_prompt_delay": {
137
137
  "type": "boolean"
138
+ },
139
+ "platform_editor_element_dnd_nested_fix_patch_1": {
140
+ "type": "boolean"
138
141
  }
139
142
  }
140
143
  }