@atlaskit/editor-plugin-floating-toolbar 4.0.7 → 4.1.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,26 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#149482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149482)
8
+ [`1f1f73876c3c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f1f73876c3c8) -
9
+ ED-27860 Add analytics for copy and delete button in floating toolbars
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 4.0.8
16
+
17
+ ### Patch Changes
18
+
19
+ - [#149852](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149852)
20
+ [`62fbcc86c35ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62fbcc86c35ba) -
21
+ clean up platform_editor_fix_floating_toolbar_scrollbar
22
+ - Updated dependencies
23
+
3
24
  ## 4.0.7
4
25
 
5
26
  ### 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
  };
@@ -479,18 +479,11 @@ var toolbarOverflow = function toolbarOverflow(_ref2) {
479
479
  overflow: 'hidden'
480
480
  }) :
481
481
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
482
- (0, _platformFeatureFlags.fg)('platform_editor_fix_floating_toolbar_scrollbar') ?
483
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
484
482
  (0, _react2.css)({
485
483
  overflowX: 'auto',
486
484
  overflowY: 'hidden',
487
485
  // When scrollable is true, ScrollButtons will be shown, hence we want to hide show default horizontal scrollbar
488
486
  scrollbarWidth: 'none'
489
- }) :
490
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
491
- (0, _react2.css)({
492
- overflowX: 'auto',
493
- overflowY: 'hidden'
494
487
  }), {
495
488
  WebkitOverflowScrolling: 'touch',
496
489
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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
  };
@@ -444,18 +444,11 @@ css({
444
444
  overflow: 'hidden'
445
445
  }) :
446
446
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
447
- fg('platform_editor_fix_floating_toolbar_scrollbar') ?
448
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
449
447
  css({
450
448
  overflowX: 'auto',
451
449
  overflowY: 'hidden',
452
450
  // When scrollable is true, ScrollButtons will be shown, hence we want to hide show default horizontal scrollbar
453
451
  scrollbarWidth: 'none'
454
- }) :
455
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
456
- css({
457
- overflowX: 'auto',
458
- overflowY: 'hidden'
459
452
  }), {
460
453
  WebkitOverflowScrolling: 'touch',
461
454
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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
  };
@@ -472,18 +472,11 @@ var toolbarOverflow = function toolbarOverflow(_ref2) {
472
472
  overflow: 'hidden'
473
473
  }) :
474
474
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
475
- fg('platform_editor_fix_floating_toolbar_scrollbar') ?
476
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
477
475
  css({
478
476
  overflowX: 'auto',
479
477
  overflowY: 'hidden',
480
478
  // When scrollable is true, ScrollButtons will be shown, hence we want to hide show default horizontal scrollbar
481
479
  scrollbarWidth: 'none'
482
- }) :
483
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
484
- css({
485
- overflowX: 'auto',
486
- overflowY: 'hidden'
487
480
  }), {
488
481
  WebkitOverflowScrolling: 'touch',
489
482
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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.7",
3
+ "version": "4.1.0",
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.21.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",
@@ -46,10 +47,10 @@
46
47
  "@atlaskit/menu": "^5.0.0",
47
48
  "@atlaskit/modal-dialog": "^14.1.0",
48
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/primitives": "^14.4.0",
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",
@@ -130,9 +131,6 @@
130
131
  "editor_a11y_remove_redundant_wrap_icon_label": {
131
132
  "type": "boolean"
132
133
  },
133
- "platform_editor_fix_floating_toolbar_scrollbar": {
134
- "type": "boolean"
135
- },
136
134
  "platform_editor_controls_patch_4": {
137
135
  "type": "boolean"
138
136
  },
@@ -144,6 +142,9 @@
144
142
  },
145
143
  "platform_editor_controls_patch_6": {
146
144
  "type": "boolean"
145
+ },
146
+ "platform_editor_controls_patch_analytics_2": {
147
+ "type": "boolean"
147
148
  }
148
149
  }
149
150
  }