@atlaskit/editor-plugin-floating-toolbar 4.0.8 → 4.1.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 4.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#150643](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150643)
8
+ [`ac4a612b39bbf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac4a612b39bbf) -
9
+ [ux] Sets aria-expanded and aria-haspopup for the dropdown-overflow following a11y best practice
10
+
11
+ ## 4.1.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#149482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149482)
16
+ [`1f1f73876c3c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f1f73876c3c8) -
17
+ ED-27860 Add analytics for copy and delete button in floating toolbars
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 4.0.8
4
24
 
5
25
  ### Patch Changes
@@ -169,8 +169,9 @@ var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToo
169
169
  forceFocusSelector: _forceFocus.forceFocusSelector
170
170
  },
171
171
  commands: {
172
- copyNode: function copyNode(nodeType) {
173
- return (0, _commands.copyNode)(nodeType);
172
+ copyNode: function copyNode(nodeType, inputMethod) {
173
+ var _api$analytics;
174
+ return (0, _commands.copyNode)(nodeType, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, inputMethod);
174
175
  }
175
176
  },
176
177
  getSharedState: function getSharedState(editorState) {
@@ -8,7 +8,8 @@ var _browser = require("@atlaskit/editor-common/browser");
8
8
  var _clipboard = require("@atlaskit/editor-common/clipboard");
9
9
  var _copyButton = require("@atlaskit/editor-common/copy-button");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
- var copyNode = exports.copyNode = function copyNode(nodeType, editorAnalyticsAp) {
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var copyNode = exports.copyNode = function copyNode(nodeType, editorAnalyticsApi, inputMethod) {
12
13
  return function (_ref) {
13
14
  var tr = _ref.tr;
14
15
  // const { tr, schema } = state;
@@ -53,6 +54,10 @@ var copyNode = exports.copyNode = function copyNode(nodeType, editorAnalyticsAp)
53
54
  (0, _clipboard.copyHTMLToClipboard)(div);
54
55
  }
55
56
  }
57
+ if (editorAnalyticsApi && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2')) {
58
+ var analyticsPayload = (0, _clipboard.getNodeCopiedAnalyticsPayload)(contentNodeWithPos.node, inputMethod);
59
+ editorAnalyticsApi.attachAnalyticsEvent(analyticsPayload)(copyToClipboardTr);
60
+ }
56
61
  copyToClipboardTr.setMeta('scrollIntoView', false);
57
62
  return copyToClipboardTr;
58
63
  };
@@ -18,6 +18,7 @@ var _ui = require("@atlaskit/editor-common/ui");
18
18
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
19
19
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
20
20
  var _chevronDown2 = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-down"));
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
22
  var _Divider = require("./Divider");
22
23
  var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
23
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -171,6 +172,7 @@ var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
171
172
  selected: isOpen,
172
173
  disabled: disabled,
173
174
  tooltipContent: tooltip,
175
+ ariaHasPopup: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_8') ? true : undefined,
174
176
  onMount: onMount,
175
177
  pulse: pulse,
176
178
  spotlightConfig: spotlightConfig
@@ -151,7 +151,10 @@ export const floatingToolbarPlugin = ({
151
151
  forceFocusSelector
152
152
  },
153
153
  commands: {
154
- copyNode: nodeType => copyNode(nodeType)
154
+ copyNode: (nodeType, inputMethod) => {
155
+ var _api$analytics;
156
+ return copyNode(nodeType, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, inputMethod);
157
+ }
155
158
  },
156
159
  getSharedState(editorState) {
157
160
  var _api$interaction, _api$interaction$shar;
@@ -1,8 +1,9 @@
1
1
  import { browser } from '@atlaskit/editor-common/browser';
2
- import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '@atlaskit/editor-common/clipboard';
2
+ import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getNodeCopiedAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
3
3
  import { getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
- export const copyNode = (nodeType, editorAnalyticsAp) => ({
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ export const copyNode = (nodeType, editorAnalyticsApi, inputMethod) => ({
6
7
  tr
7
8
  }) => {
8
9
  // const { tr, schema } = state;
@@ -47,6 +48,10 @@ export const copyNode = (nodeType, editorAnalyticsAp) => ({
47
48
  copyHTMLToClipboard(div);
48
49
  }
49
50
  }
51
+ if (editorAnalyticsApi && fg('platform_editor_controls_patch_analytics_2')) {
52
+ const analyticsPayload = getNodeCopiedAnalyticsPayload(contentNodeWithPos.node, inputMethod);
53
+ editorAnalyticsApi.attachAnalyticsEvent(analyticsPayload)(copyToClipboardTr);
54
+ }
50
55
  copyToClipboardTr.setMeta('scrollIntoView', false);
51
56
  return copyToClipboardTr;
52
57
  };
@@ -13,6 +13,7 @@ import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
13
13
  import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
14
14
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
15
15
  import ChevronDownIcon from '@atlaskit/icon/utility/chevron-down';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
16
17
  import { Divider } from './Divider';
17
18
  import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
18
19
 
@@ -152,6 +153,7 @@ export default class Dropdown extends Component {
152
153
  selected: isOpen,
153
154
  disabled: disabled,
154
155
  tooltipContent: tooltip,
156
+ ariaHasPopup: fg('platform_editor_controls_patch_8') ? true : undefined,
155
157
  onMount: onMount,
156
158
  pulse: pulse,
157
159
  spotlightConfig: spotlightConfig
@@ -157,8 +157,9 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
157
157
  forceFocusSelector: forceFocusSelector
158
158
  },
159
159
  commands: {
160
- copyNode: function copyNode(nodeType) {
161
- return _copyNode(nodeType);
160
+ copyNode: function copyNode(nodeType, inputMethod) {
161
+ var _api$analytics;
162
+ return _copyNode(nodeType, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, inputMethod);
162
163
  }
163
164
  },
164
165
  getSharedState: function getSharedState(editorState) {
@@ -1,8 +1,9 @@
1
1
  import { browser } from '@atlaskit/editor-common/browser';
2
- import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '@atlaskit/editor-common/clipboard';
2
+ import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getNodeCopiedAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
3
3
  import { getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
- export var copyNode = function copyNode(nodeType, editorAnalyticsAp) {
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
+ export var copyNode = function copyNode(nodeType, editorAnalyticsApi, inputMethod) {
6
7
  return function (_ref) {
7
8
  var tr = _ref.tr;
8
9
  // const { tr, schema } = state;
@@ -47,6 +48,10 @@ export var copyNode = function copyNode(nodeType, editorAnalyticsAp) {
47
48
  copyHTMLToClipboard(div);
48
49
  }
49
50
  }
51
+ if (editorAnalyticsApi && fg('platform_editor_controls_patch_analytics_2')) {
52
+ var analyticsPayload = getNodeCopiedAnalyticsPayload(contentNodeWithPos.node, inputMethod);
53
+ editorAnalyticsApi.attachAnalyticsEvent(analyticsPayload)(copyToClipboardTr);
54
+ }
50
55
  copyToClipboardTr.setMeta('scrollIntoView', false);
51
56
  return copyToClipboardTr;
52
57
  };
@@ -22,6 +22,7 @@ import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
22
22
  import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
23
23
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
24
24
  import ChevronDownIcon from '@atlaskit/icon/utility/chevron-down';
25
+ import { fg } from '@atlaskit/platform-feature-flags';
25
26
  import { Divider } from './Divider';
26
27
  import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
27
28
 
@@ -166,6 +167,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
166
167
  selected: isOpen,
167
168
  disabled: disabled,
168
169
  tooltipContent: tooltip,
170
+ ariaHasPopup: fg('platform_editor_controls_patch_8') ? true : undefined,
169
171
  onMount: onMount,
170
172
  pulse: pulse,
171
173
  spotlightConfig: spotlightConfig
@@ -1,4 +1,5 @@
1
1
  import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
2
3
  import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
3
4
  import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
4
5
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -37,7 +38,8 @@ export type FloatingToolbarPluginDependencies = [
37
38
  OptionalPlugin<FeatureFlagsPlugin>,
38
39
  OptionalPlugin<EmojiPlugin>,
39
40
  OptionalPlugin<UserIntentPlugin>,
40
- OptionalPlugin<InteractionPlugin>
41
+ OptionalPlugin<InteractionPlugin>,
42
+ OptionalPlugin<AnalyticsPlugin>
41
43
  ];
42
44
  export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
43
45
  dependencies: FloatingToolbarPluginDependencies;
@@ -1,6 +1,6 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
+ import { INPUT_METHOD, type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { NodeType } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
- export declare const copyNode: (nodeType: NodeType | Array<NodeType>, editorAnalyticsAp?: EditorAnalyticsAPI | undefined) => ({ tr }: {
4
+ export declare const copyNode: (nodeType: NodeType | Array<NodeType>, editorAnalyticsApi?: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD) => ({ tr }: {
5
5
  tr: Transaction;
6
6
  }) => Transaction;
@@ -1,4 +1,5 @@
1
1
  import type { FloatingToolbarConfig, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
2
3
  import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
3
4
  import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
4
5
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -37,7 +38,8 @@ export type FloatingToolbarPluginDependencies = [
37
38
  OptionalPlugin<FeatureFlagsPlugin>,
38
39
  OptionalPlugin<EmojiPlugin>,
39
40
  OptionalPlugin<UserIntentPlugin>,
40
- OptionalPlugin<InteractionPlugin>
41
+ OptionalPlugin<InteractionPlugin>,
42
+ OptionalPlugin<AnalyticsPlugin>
41
43
  ];
42
44
  export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
43
45
  dependencies: FloatingToolbarPluginDependencies;
@@ -1,6 +1,6 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
+ import { INPUT_METHOD, type EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { NodeType } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
- export declare const copyNode: (nodeType: NodeType | Array<NodeType>, editorAnalyticsAp?: EditorAnalyticsAPI | undefined) => ({ tr }: {
4
+ export declare const copyNode: (nodeType: NodeType | Array<NodeType>, editorAnalyticsApi?: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD) => ({ tr }: {
5
5
  tr: Transaction;
6
6
  }) => Transaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "4.0.8",
3
+ "version": "4.1.1",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,9 +28,10 @@
28
28
  "@atlaskit/adf-utils": "^19.19.0",
29
29
  "@atlaskit/button": "^23.0.0",
30
30
  "@atlaskit/checkbox": "^17.1.0",
31
- "@atlaskit/editor-common": "^103.22.0",
31
+ "@atlaskit/editor-common": "^104.0.0",
32
32
  "@atlaskit/editor-palette": "^2.1.0",
33
- "@atlaskit/editor-plugin-context-panel": "^4.0.0",
33
+ "@atlaskit/editor-plugin-analytics": "^2.2.0",
34
+ "@atlaskit/editor-plugin-context-panel": "^4.1.0",
34
35
  "@atlaskit/editor-plugin-copy-button": "^2.0.0",
35
36
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
36
37
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
@@ -49,7 +50,7 @@
49
50
  "@atlaskit/primitives": "^14.7.0",
50
51
  "@atlaskit/select": "^20.4.0",
51
52
  "@atlaskit/theme": "^18.0.0",
52
- "@atlaskit/tmp-editor-statsig": "^4.15.0",
53
+ "@atlaskit/tmp-editor-statsig": "^4.16.0",
53
54
  "@atlaskit/tokens": "^4.8.0",
54
55
  "@atlaskit/tooltip": "^20.0.0",
55
56
  "@babel/runtime": "^7.0.0",
@@ -141,6 +142,12 @@
141
142
  },
142
143
  "platform_editor_controls_patch_6": {
143
144
  "type": "boolean"
145
+ },
146
+ "platform_editor_controls_patch_analytics_2": {
147
+ "type": "boolean"
148
+ },
149
+ "platform_editor_controls_patch_8": {
150
+ "type": "boolean"
144
151
  }
145
152
  }
146
153
  }