@atlaskit/editor-plugin-extension 4.0.4 → 4.0.6

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,21 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 4.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#119979](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119979)
8
+ [`97bfadcfddb29`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/97bfadcfddb29) -
9
+ ED-26342 - Legacy content macro has it's own 'fabric-editor-popup-scroll-parent' class. We want to
10
+ make the toolbar positioning ignore it if the given extension it's trying to create a toolbar for
11
+ is within the LCM.
12
+
13
+ ## 4.0.5
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 4.0.4
4
20
 
5
21
  ### Patch Changes
@@ -168,6 +168,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
168
168
  var possibleMbeParent = (0, _utils2.findParentNodeOfType)(schema.nodes.extensionFrame)(selection);
169
169
  // We only want to use calculated position in case of a bodiedExtension present inside an MBE node
170
170
  var isBodiedExtensionInsideMBE = possibleMbeParent && (extensionNode === null || extensionNode === void 0 ? void 0 : extensionNode.node.type.name) === 'bodiedExtension';
171
+ var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
171
172
  if ((0, _platformFeatureFlags.fg)('platform_editor_legacy_content_macro')) {
172
173
  if (!extensionNode) {
173
174
  return nextPos;
@@ -176,12 +177,17 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
176
177
  if (!isBodiedExtensionInsideMBE && !isInsideEditableExtensionArea) {
177
178
  return nextPos;
178
179
  }
180
+ if (isInsideEditableExtensionArea && scrollWrapper.parentElement) {
181
+ // The editable extension area may have its own scroll wrapper, so we want to keep searching up the tree for the page level scroll wrapper.
182
+
183
+ scrollWrapper = scrollWrapper.parentElement.closest('.fabric-editor-popup-scroll-parent') || scrollWrapper;
184
+ }
179
185
  } else {
180
186
  if (!isBodiedExtensionInsideMBE) {
181
187
  return nextPos;
182
188
  }
183
189
  }
184
- var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
190
+
185
191
  // Ignored via go/ees005
186
192
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
187
193
  var nestedBodiedExtensionDomElement = editorView.nodeDOM(extensionNode.pos);
@@ -165,6 +165,7 @@ export const getToolbarConfig = ({
165
165
  const possibleMbeParent = findParentNodeOfType(schema.nodes.extensionFrame)(selection);
166
166
  // We only want to use calculated position in case of a bodiedExtension present inside an MBE node
167
167
  const isBodiedExtensionInsideMBE = possibleMbeParent && (extensionNode === null || extensionNode === void 0 ? void 0 : extensionNode.node.type.name) === 'bodiedExtension';
168
+ let scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
168
169
  if (fg('platform_editor_legacy_content_macro')) {
169
170
  if (!extensionNode) {
170
171
  return nextPos;
@@ -173,12 +174,17 @@ export const getToolbarConfig = ({
173
174
  if (!isBodiedExtensionInsideMBE && !isInsideEditableExtensionArea) {
174
175
  return nextPos;
175
176
  }
177
+ if (isInsideEditableExtensionArea && scrollWrapper.parentElement) {
178
+ // The editable extension area may have its own scroll wrapper, so we want to keep searching up the tree for the page level scroll wrapper.
179
+
180
+ scrollWrapper = scrollWrapper.parentElement.closest('.fabric-editor-popup-scroll-parent') || scrollWrapper;
181
+ }
176
182
  } else {
177
183
  if (!isBodiedExtensionInsideMBE) {
178
184
  return nextPos;
179
185
  }
180
186
  }
181
- const scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
187
+
182
188
  // Ignored via go/ees005
183
189
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
184
190
  const nestedBodiedExtensionDomElement = editorView.nodeDOM(extensionNode.pos);
@@ -161,6 +161,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
161
161
  var possibleMbeParent = findParentNodeOfType(schema.nodes.extensionFrame)(selection);
162
162
  // We only want to use calculated position in case of a bodiedExtension present inside an MBE node
163
163
  var isBodiedExtensionInsideMBE = possibleMbeParent && (extensionNode === null || extensionNode === void 0 ? void 0 : extensionNode.node.type.name) === 'bodiedExtension';
164
+ var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
164
165
  if (fg('platform_editor_legacy_content_macro')) {
165
166
  if (!extensionNode) {
166
167
  return nextPos;
@@ -169,12 +170,17 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
169
170
  if (!isBodiedExtensionInsideMBE && !isInsideEditableExtensionArea) {
170
171
  return nextPos;
171
172
  }
173
+ if (isInsideEditableExtensionArea && scrollWrapper.parentElement) {
174
+ // The editable extension area may have its own scroll wrapper, so we want to keep searching up the tree for the page level scroll wrapper.
175
+
176
+ scrollWrapper = scrollWrapper.parentElement.closest('.fabric-editor-popup-scroll-parent') || scrollWrapper;
177
+ }
172
178
  } else {
173
179
  if (!isBodiedExtensionInsideMBE) {
174
180
  return nextPos;
175
181
  }
176
182
  }
177
- var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
183
+
178
184
  // Ignored via go/ees005
179
185
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
180
186
  var nestedBodiedExtensionDomElement = editorView.nodeDOM(extensionNode.pos);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/editor-plugin-feature-flags": "^1.3.0",
40
40
  "@atlaskit/editor-plugin-width": "^3.0.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-shared-styles": "^3.3.0",
42
+ "@atlaskit/editor-shared-styles": "^3.4.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
44
  "@atlaskit/empty-state": "^9.0.0",
45
45
  "@atlaskit/form": "^12.0.0",
@@ -49,14 +49,14 @@
49
49
  "@atlaskit/primitives": "^14.1.0",
50
50
  "@atlaskit/radio": "^8.0.0",
51
51
  "@atlaskit/section-message": "^8.0.0",
52
- "@atlaskit/select": "^19.0.0",
52
+ "@atlaskit/select": "^20.0.0",
53
53
  "@atlaskit/smart-user-picker": "^8.0.0",
54
54
  "@atlaskit/spinner": "^18.0.0",
55
55
  "@atlaskit/tabs": "^18.0.0",
56
56
  "@atlaskit/textarea": "^8.0.0",
57
57
  "@atlaskit/textfield": "^8.0.0",
58
58
  "@atlaskit/theme": "^17.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^3.2.0",
59
+ "@atlaskit/tmp-editor-statsig": "^3.3.0",
60
60
  "@atlaskit/toggle": "^15.0.0",
61
61
  "@atlaskit/tokens": "^4.2.0",
62
62
  "@atlaskit/tooltip": "^20.0.0",