@atlaskit/editor-plugin-block-menu 6.1.5 → 6.1.7

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,19 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 6.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f623524e57d49`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f623524e57d49) -
8
+ Add portalRoot type to ExperienceCheckPopupMutation
9
+ - Updated dependencies
10
+
11
+ ## 6.1.6
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.1.5
4
18
 
5
19
  ### Patch Changes
@@ -12,6 +12,10 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _experienceCheckUtils = require("./experience-check-utils");
14
14
  var TIMEOUT_DURATION = 1000;
15
+ var PORTAL_TEST_ID = {
16
+ LINK_COPIED_TO_CLIPBOARD: 'link-copied-to-clipboard',
17
+ SYNC_BLOCK_DELETE_CONFIRMATION: 'sync-block-delete-confirmation'
18
+ };
15
19
  var pluginKey = new _state.PluginKey('blockMenuExperiences');
16
20
  var START_METHOD = {
17
21
  DRAG_HANDLE_CLICK: 'dragHandleClick',
@@ -83,6 +87,9 @@ var getBlockMenuExperiencesPlugin = exports.getBlockMenuExperiencesPlugin = func
83
87
  }), new _experiences.ExperienceCheckDomMutation({
84
88
  onDomMutation: _experienceCheckUtils.handleDeleteDomMutation,
85
89
  observeConfig: actionObserveConfig
90
+ }), new _experiences.ExperienceCheckPopupMutation({
91
+ nestedElementQuery: "[data-testid=\"".concat(PORTAL_TEST_ID.SYNC_BLOCK_DELETE_CONFIRMATION, "\"]"),
92
+ type: 'portalRoot'
86
93
  })]
87
94
  });
88
95
  var blockTransformExperience = new _experiences.Experience(_experiences.EXPERIENCE_ID.MENU_ACTION, {
@@ -96,6 +103,17 @@ var getBlockMenuExperiencesPlugin = exports.getBlockMenuExperiencesPlugin = func
96
103
  observeConfig: actionObserveConfig
97
104
  })]
98
105
  });
106
+ var blockCopyLinkExperience = new _experiences.Experience(_experiences.EXPERIENCE_ID.MENU_ACTION, {
107
+ action: _analytics.ACTION.COPIED,
108
+ actionSubjectId: _analytics.ACTION_SUBJECT_ID.COPY_LINK_TO_BLOCK,
109
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
110
+ checks: [new _experiences.ExperienceCheckTimeout({
111
+ durationMs: TIMEOUT_DURATION
112
+ }), new _experiences.ExperienceCheckPopupMutation({
113
+ nestedElementQuery: "[data-testid=\"".concat(PORTAL_TEST_ID.LINK_COPIED_TO_CLIPBOARD, "\"]"),
114
+ type: 'portalRoot'
115
+ })]
116
+ });
99
117
  var handleMenuOpened = function handleMenuOpened(method) {
100
118
  // Don't start if block menu is already visible
101
119
  if ((0, _experienceCheckUtils.isBlockMenuVisible)(getPopupsTarget())) {
@@ -137,6 +155,9 @@ var getBlockMenuExperiencesPlugin = exports.getBlockMenuExperiencesPlugin = func
137
155
  case _blockMenu.BLOCK_MENU_ACTION_TEST_ID.DELETE:
138
156
  blockDeleteExperience.start();
139
157
  break;
158
+ case _blockMenu.BLOCK_MENU_ACTION_TEST_ID.COPY_LINK:
159
+ blockCopyLinkExperience.start();
160
+ break;
140
161
  }
141
162
  };
142
163
  var unbindClickListener = (0, _bindEventListener.bind)(document, {
@@ -201,6 +222,9 @@ var getBlockMenuExperiencesPlugin = exports.getBlockMenuExperiencesPlugin = func
201
222
  blockTransformExperience.abort({
202
223
  reason: ABORT_REASON.EDITOR_DESTROYED
203
224
  });
225
+ blockCopyLinkExperience.abort({
226
+ reason: ABORT_REASON.EDITOR_DESTROYED
227
+ });
204
228
  editorView = undefined;
205
229
  unbindClickListener();
206
230
  unbindKeydownListener();
@@ -9,6 +9,7 @@ exports.CopyLinkDropdownItem = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _reactIntlNext = require("react-intl-next");
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
+ var _blockMenu = require("@atlaskit/editor-common/block-menu");
12
13
  var _hooks = require("@atlaskit/editor-common/hooks");
13
14
  var _keymaps = require("@atlaskit/editor-common/keymaps");
14
15
  var _messages = require("@atlaskit/editor-common/messages");
@@ -107,7 +108,8 @@ var CopyLinkDropdownItemContent = function CopyLinkDropdownItemContent(_ref) {
107
108
  elemAfter: shortcut ? /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarKeyboardShortcutHint, {
108
109
  shortcut: shortcut
109
110
  }) : undefined,
110
- ariaKeyshortcuts: shortcut
111
+ ariaKeyshortcuts: shortcut,
112
+ testId: _blockMenu.BLOCK_MENU_ACTION_TEST_ID.COPY_LINK
111
113
  }, formatMessage(message));
112
114
  };
113
115
  var CopyLinkDropdownItem = exports.CopyLinkDropdownItem = (0, _reactIntlNext.injectIntl)(CopyLinkDropdownItemContent);
@@ -6,6 +6,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
7
  import { getParentDOMAtSelection, handleDeleteDomMutation, handleMoveDomMutation, handleTransformDomMutation, isBlockMenuVisible, isDragHandleElement } from './experience-check-utils';
8
8
  const TIMEOUT_DURATION = 1000;
9
+ const PORTAL_TEST_ID = {
10
+ LINK_COPIED_TO_CLIPBOARD: 'link-copied-to-clipboard',
11
+ SYNC_BLOCK_DELETE_CONFIRMATION: 'sync-block-delete-confirmation'
12
+ };
9
13
  const pluginKey = new PluginKey('blockMenuExperiences');
10
14
  const START_METHOD = {
11
15
  DRAG_HANDLE_CLICK: 'dragHandleClick',
@@ -76,6 +80,9 @@ export const getBlockMenuExperiencesPlugin = ({
76
80
  }), new ExperienceCheckDomMutation({
77
81
  onDomMutation: handleDeleteDomMutation,
78
82
  observeConfig: actionObserveConfig
83
+ }), new ExperienceCheckPopupMutation({
84
+ nestedElementQuery: `[data-testid="${PORTAL_TEST_ID.SYNC_BLOCK_DELETE_CONFIRMATION}"]`,
85
+ type: 'portalRoot'
79
86
  })]
80
87
  });
81
88
  const blockTransformExperience = new Experience(EXPERIENCE_ID.MENU_ACTION, {
@@ -89,6 +96,17 @@ export const getBlockMenuExperiencesPlugin = ({
89
96
  observeConfig: actionObserveConfig
90
97
  })]
91
98
  });
99
+ const blockCopyLinkExperience = new Experience(EXPERIENCE_ID.MENU_ACTION, {
100
+ action: ACTION.COPIED,
101
+ actionSubjectId: ACTION_SUBJECT_ID.COPY_LINK_TO_BLOCK,
102
+ dispatchAnalyticsEvent,
103
+ checks: [new ExperienceCheckTimeout({
104
+ durationMs: TIMEOUT_DURATION
105
+ }), new ExperienceCheckPopupMutation({
106
+ nestedElementQuery: `[data-testid="${PORTAL_TEST_ID.LINK_COPIED_TO_CLIPBOARD}"]`,
107
+ type: 'portalRoot'
108
+ })]
109
+ });
92
110
  const handleMenuOpened = method => {
93
111
  // Don't start if block menu is already visible
94
112
  if (isBlockMenuVisible(getPopupsTarget())) {
@@ -130,6 +148,9 @@ export const getBlockMenuExperiencesPlugin = ({
130
148
  case BLOCK_MENU_ACTION_TEST_ID.DELETE:
131
149
  blockDeleteExperience.start();
132
150
  break;
151
+ case BLOCK_MENU_ACTION_TEST_ID.COPY_LINK:
152
+ blockCopyLinkExperience.start();
153
+ break;
133
154
  }
134
155
  };
135
156
  const unbindClickListener = bind(document, {
@@ -194,6 +215,9 @@ export const getBlockMenuExperiencesPlugin = ({
194
215
  blockTransformExperience.abort({
195
216
  reason: ABORT_REASON.EDITOR_DESTROYED
196
217
  });
218
+ blockCopyLinkExperience.abort({
219
+ reason: ABORT_REASON.EDITOR_DESTROYED
220
+ });
197
221
  editorView = undefined;
198
222
  unbindClickListener();
199
223
  unbindKeydownListener();
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { injectIntl, useIntl } from 'react-intl-next';
3
3
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
4
+ import { BLOCK_MENU_ACTION_TEST_ID } from '@atlaskit/editor-common/block-menu';
4
5
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
6
  import { copyLinkToBlock, formatShortcut } from '@atlaskit/editor-common/keymaps';
6
7
  import { blockMenuMessages as messages } from '@atlaskit/editor-common/messages';
@@ -106,7 +107,8 @@ const CopyLinkDropdownItemContent = ({
106
107
  elemAfter: shortcut ? /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
107
108
  shortcut: shortcut
108
109
  }) : undefined,
109
- ariaKeyshortcuts: shortcut
110
+ ariaKeyshortcuts: shortcut,
111
+ testId: BLOCK_MENU_ACTION_TEST_ID.COPY_LINK
110
112
  }, formatMessage(message));
111
113
  };
112
114
  export const CopyLinkDropdownItem = injectIntl(CopyLinkDropdownItemContent);
@@ -6,6 +6,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
7
  import { getParentDOMAtSelection, handleDeleteDomMutation, handleMoveDomMutation, handleTransformDomMutation, isBlockMenuVisible, isDragHandleElement } from './experience-check-utils';
8
8
  var TIMEOUT_DURATION = 1000;
9
+ var PORTAL_TEST_ID = {
10
+ LINK_COPIED_TO_CLIPBOARD: 'link-copied-to-clipboard',
11
+ SYNC_BLOCK_DELETE_CONFIRMATION: 'sync-block-delete-confirmation'
12
+ };
9
13
  var pluginKey = new PluginKey('blockMenuExperiences');
10
14
  var START_METHOD = {
11
15
  DRAG_HANDLE_CLICK: 'dragHandleClick',
@@ -77,6 +81,9 @@ export var getBlockMenuExperiencesPlugin = function getBlockMenuExperiencesPlugi
77
81
  }), new ExperienceCheckDomMutation({
78
82
  onDomMutation: handleDeleteDomMutation,
79
83
  observeConfig: actionObserveConfig
84
+ }), new ExperienceCheckPopupMutation({
85
+ nestedElementQuery: "[data-testid=\"".concat(PORTAL_TEST_ID.SYNC_BLOCK_DELETE_CONFIRMATION, "\"]"),
86
+ type: 'portalRoot'
80
87
  })]
81
88
  });
82
89
  var blockTransformExperience = new Experience(EXPERIENCE_ID.MENU_ACTION, {
@@ -90,6 +97,17 @@ export var getBlockMenuExperiencesPlugin = function getBlockMenuExperiencesPlugi
90
97
  observeConfig: actionObserveConfig
91
98
  })]
92
99
  });
100
+ var blockCopyLinkExperience = new Experience(EXPERIENCE_ID.MENU_ACTION, {
101
+ action: ACTION.COPIED,
102
+ actionSubjectId: ACTION_SUBJECT_ID.COPY_LINK_TO_BLOCK,
103
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
104
+ checks: [new ExperienceCheckTimeout({
105
+ durationMs: TIMEOUT_DURATION
106
+ }), new ExperienceCheckPopupMutation({
107
+ nestedElementQuery: "[data-testid=\"".concat(PORTAL_TEST_ID.LINK_COPIED_TO_CLIPBOARD, "\"]"),
108
+ type: 'portalRoot'
109
+ })]
110
+ });
93
111
  var handleMenuOpened = function handleMenuOpened(method) {
94
112
  // Don't start if block menu is already visible
95
113
  if (isBlockMenuVisible(getPopupsTarget())) {
@@ -131,6 +149,9 @@ export var getBlockMenuExperiencesPlugin = function getBlockMenuExperiencesPlugi
131
149
  case BLOCK_MENU_ACTION_TEST_ID.DELETE:
132
150
  blockDeleteExperience.start();
133
151
  break;
152
+ case BLOCK_MENU_ACTION_TEST_ID.COPY_LINK:
153
+ blockCopyLinkExperience.start();
154
+ break;
134
155
  }
135
156
  };
136
157
  var unbindClickListener = bind(document, {
@@ -195,6 +216,9 @@ export var getBlockMenuExperiencesPlugin = function getBlockMenuExperiencesPlugi
195
216
  blockTransformExperience.abort({
196
217
  reason: ABORT_REASON.EDITOR_DESTROYED
197
218
  });
219
+ blockCopyLinkExperience.abort({
220
+ reason: ABORT_REASON.EDITOR_DESTROYED
221
+ });
198
222
  editorView = undefined;
199
223
  unbindClickListener();
200
224
  unbindKeydownListener();
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { injectIntl, useIntl } from 'react-intl-next';
3
3
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
4
+ import { BLOCK_MENU_ACTION_TEST_ID } from '@atlaskit/editor-common/block-menu';
4
5
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
6
  import { copyLinkToBlock, formatShortcut } from '@atlaskit/editor-common/keymaps';
6
7
  import { blockMenuMessages as messages } from '@atlaskit/editor-common/messages';
@@ -98,7 +99,8 @@ var CopyLinkDropdownItemContent = function CopyLinkDropdownItemContent(_ref) {
98
99
  elemAfter: shortcut ? /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
99
100
  shortcut: shortcut
100
101
  }) : undefined,
101
- ariaKeyshortcuts: shortcut
102
+ ariaKeyshortcuts: shortcut,
103
+ testId: BLOCK_MENU_ACTION_TEST_ID.COPY_LINK
102
104
  }, formatMessage(message));
103
105
  };
104
106
  export var CopyLinkDropdownItem = injectIntl(CopyLinkDropdownItemContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "6.1.5",
3
+ "version": "6.1.7",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@atlaskit/browser-apis": "^0.0.1",
32
32
  "@atlaskit/css": "^0.19.0",
33
- "@atlaskit/dropdown-menu": "^16.4.0",
33
+ "@atlaskit/dropdown-menu": "^16.5.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^7.0.0",
35
- "@atlaskit/editor-plugin-block-controls": "^8.6.0",
35
+ "@atlaskit/editor-plugin-block-controls": "^8.7.0",
36
36
  "@atlaskit/editor-plugin-decorations": "^7.0.0",
37
37
  "@atlaskit/editor-plugin-selection": "^7.0.0",
38
38
  "@atlaskit/editor-plugin-user-intent": "^5.0.0",
@@ -46,13 +46,13 @@
46
46
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
47
47
  "@atlaskit/primitives": "^18.0.0",
48
48
  "@atlaskit/prosemirror-history": "^0.2.0",
49
- "@atlaskit/tmp-editor-statsig": "^31.2.0",
49
+ "@atlaskit/tmp-editor-statsig": "^32.4.0",
50
50
  "@atlaskit/tokens": "^11.0.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^111.20.0",
55
+ "@atlaskit/editor-common": "^111.21.0",
56
56
  "react": "^18.2.0",
57
57
  "react-intl-next": "npm:react-intl@^5.18.1"
58
58
  },