@atlaskit/editor-plugin-block-controls 6.1.0 → 6.2.0

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,24 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b367661ba720e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b367661ba720e) -
8
+ EDITOR-1562 bump adf-schema for afm
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 6.1.1
15
+
16
+ ### Patch Changes
17
+
18
+ - [`76eec7789481e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76eec7789481e) -
19
+ ED-29252: fix block menu not showing in safari
20
+ - Updated dependencies
21
+
3
22
  ## 6.1.0
4
23
 
5
24
  ### Minor Changes
@@ -294,8 +294,19 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
294
294
  } else {
295
295
  if (activeNode && (meta === null || meta === void 0 ? void 0 : meta.isDragging) !== true) {
296
296
  var _mappedRootPos$pos, _mappedRootPos;
297
- var _mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
298
- isActiveNodeDeleted = _mappedPos.deletedAfter;
297
+ var _mappedPos;
298
+ // In safari, when platform_editor_controls is on,
299
+ // sometimes the drag handle for the layout disppears after you click on the handle for a few times
300
+ // Which caused the drag handle onClick event not firing, then block menu wouldn't be opened
301
+ // This is caused by the mappedPos.deletedAfter sometimes returning true in webkit browsers even though the active node still exists
302
+ // This is likely a prosemirror and safari integration bug, but to unblock the issue, we are going to use mappedPos.deleted in safari for now
303
+ if (_browser.browser.webkit && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
304
+ _mappedPos = tr.mapping.mapResult(activeNode.pos);
305
+ isActiveNodeDeleted = _mappedPos.deleted;
306
+ } else {
307
+ _mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
308
+ isActiveNodeDeleted = _mappedPos.deletedAfter;
309
+ }
299
310
  // for editor controls, remap the rootPos as well
300
311
  var mappedRootPos;
301
312
  if (activeNode.rootPos !== undefined) {
@@ -293,8 +293,19 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
293
293
  } else {
294
294
  if (activeNode && (meta === null || meta === void 0 ? void 0 : meta.isDragging) !== true) {
295
295
  var _mappedRootPos$pos, _mappedRootPos;
296
- const mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
297
- isActiveNodeDeleted = mappedPos.deletedAfter;
296
+ let mappedPos;
297
+ // In safari, when platform_editor_controls is on,
298
+ // sometimes the drag handle for the layout disppears after you click on the handle for a few times
299
+ // Which caused the drag handle onClick event not firing, then block menu wouldn't be opened
300
+ // This is caused by the mappedPos.deletedAfter sometimes returning true in webkit browsers even though the active node still exists
301
+ // This is likely a prosemirror and safari integration bug, but to unblock the issue, we are going to use mappedPos.deleted in safari for now
302
+ if (browser.webkit && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
303
+ mappedPos = tr.mapping.mapResult(activeNode.pos);
304
+ isActiveNodeDeleted = mappedPos.deleted;
305
+ } else {
306
+ mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
307
+ isActiveNodeDeleted = mappedPos.deletedAfter;
308
+ }
298
309
  // for editor controls, remap the rootPos as well
299
310
  let mappedRootPos;
300
311
  if (activeNode.rootPos !== undefined) {
@@ -287,8 +287,19 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
287
287
  } else {
288
288
  if (activeNode && (meta === null || meta === void 0 ? void 0 : meta.isDragging) !== true) {
289
289
  var _mappedRootPos$pos, _mappedRootPos;
290
- var _mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
291
- isActiveNodeDeleted = _mappedPos.deletedAfter;
290
+ var _mappedPos;
291
+ // In safari, when platform_editor_controls is on,
292
+ // sometimes the drag handle for the layout disppears after you click on the handle for a few times
293
+ // Which caused the drag handle onClick event not firing, then block menu wouldn't be opened
294
+ // This is caused by the mappedPos.deletedAfter sometimes returning true in webkit browsers even though the active node still exists
295
+ // This is likely a prosemirror and safari integration bug, but to unblock the issue, we are going to use mappedPos.deleted in safari for now
296
+ if (browser.webkit && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
297
+ _mappedPos = tr.mapping.mapResult(activeNode.pos);
298
+ isActiveNodeDeleted = _mappedPos.deleted;
299
+ } else {
300
+ _mappedPos = tr.mapping.mapResult(activeNode.pos, -1);
301
+ isActiveNodeDeleted = _mappedPos.deletedAfter;
302
+ }
292
303
  // for editor controls, remap the rootPos as well
293
304
  var mappedRootPos;
294
305
  if (activeNode.rootPos !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,17 +28,17 @@
28
28
  ],
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^51.1.1",
31
+ "@atlaskit/adf-schema": "^51.1.2",
32
32
  "@atlaskit/editor-plugin-accessibility-utils": "^5.0.0",
33
- "@atlaskit/editor-plugin-analytics": "^5.1.0",
33
+ "@atlaskit/editor-plugin-analytics": "^5.2.0",
34
34
  "@atlaskit/editor-plugin-editor-disabled": "^5.0.0",
35
35
  "@atlaskit/editor-plugin-feature-flags": "^4.0.0",
36
36
  "@atlaskit/editor-plugin-interaction": "^7.0.0",
37
37
  "@atlaskit/editor-plugin-limited-mode": "^2.0.0",
38
- "@atlaskit/editor-plugin-metrics": "^6.1.0",
38
+ "@atlaskit/editor-plugin-metrics": "^6.2.0",
39
39
  "@atlaskit/editor-plugin-quick-insert": "^5.0.0",
40
40
  "@atlaskit/editor-plugin-selection": "^5.0.0",
41
- "@atlaskit/editor-plugin-type-ahead": "^5.1.0",
41
+ "@atlaskit/editor-plugin-type-ahead": "^5.2.0",
42
42
  "@atlaskit/editor-plugin-user-intent": "^3.0.0",
43
43
  "@atlaskit/editor-plugin-width": "^6.0.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
53
53
  "@atlaskit/primitives": "^14.14.0",
54
54
  "@atlaskit/theme": "^21.0.0",
55
- "@atlaskit/tmp-editor-statsig": "^12.14.0",
55
+ "@atlaskit/tmp-editor-statsig": "^12.18.0",
56
56
  "@atlaskit/tokens": "^6.3.0",
57
57
  "@atlaskit/tooltip": "^20.4.0",
58
58
  "@babel/runtime": "^7.0.0",
@@ -64,7 +64,7 @@
64
64
  "uuid": "^3.1.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@atlaskit/editor-common": "^109.3.0",
67
+ "@atlaskit/editor-common": "^109.5.0",
68
68
  "react": "^18.2.0",
69
69
  "react-dom": "^18.2.0",
70
70
  "react-intl-next": "npm:react-intl@^5.18.1"