@atlaskit/editor-plugin-toolbar 3.4.4 → 3.4.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-toolbar
2
2
 
3
+ ## 3.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`373dccb169d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/373dccb169d0b) -
8
+ ED-29654 Editor experience custom tracking
9
+ - Updated dependencies
10
+
11
+ ## 3.4.5
12
+
13
+ ### Patch Changes
14
+
15
+ - [`54ccde94eb18c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/54ccde94eb18c) -
16
+ ED-29459 Clean up platform_editor_toolbar_aifc_toolbar_analytic
17
+ - Updated dependencies
18
+
3
19
  ## 3.4.4
4
20
 
5
21
  ### Patch Changes
@@ -28,7 +28,8 @@ var ABORT_REASON = {
28
28
  * Abort: When selection transition to empty or block menu is opened
29
29
  */
30
30
  var getSelectionToolbarOpenExperiencePlugin = exports.getSelectionToolbarOpenExperiencePlugin = function getSelectionToolbarOpenExperiencePlugin(_ref) {
31
- var refs = _ref.refs;
31
+ var refs = _ref.refs,
32
+ dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
32
33
  var targetEl;
33
34
  var editorViewEl;
34
35
  var getTarget = function getTarget() {
@@ -38,6 +39,7 @@ var getSelectionToolbarOpenExperiencePlugin = exports.getSelectionToolbarOpenExp
38
39
  return targetEl;
39
40
  };
40
41
  var experience = new _experiences.Experience('selection-toolbar-open', {
42
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
41
43
  checks: [new _experiences.ExperienceCheckTimeout({
42
44
  durationMs: 500,
43
45
  onTimeout: function onTimeout() {
@@ -189,7 +189,11 @@ var toolbarPlugin = exports.toolbarPlugin = function toolbarPlugin(_ref) {
189
189
  name: 'selectionToolbarOpenExperience',
190
190
  plugin: function plugin() {
191
191
  return (0, _selectionToolbarOpenExperience.getSelectionToolbarOpenExperiencePlugin)({
192
- refs: refs
192
+ refs: refs,
193
+ dispatchAnalyticsEvent: function dispatchAnalyticsEvent(payload) {
194
+ var _api$analytics;
195
+ return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent(payload);
196
+ }
193
197
  });
194
198
  }
195
199
  }] : []));
@@ -154,13 +154,11 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
154
154
  isOffline: isOffline
155
155
  }, /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarUIProvider, {
156
156
  api: api,
157
- isDisabled: patch6Enabled ? isDisabled : isOffline
158
- // supress type checks for now
159
- ,
160
- fireAnalyticsEvent: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? function (payload) {
157
+ isDisabled: patch6Enabled ? isDisabled : isOffline,
158
+ fireAnalyticsEvent: function fireAnalyticsEvent(payload) {
161
159
  var _api$analytics;
162
160
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payload);
163
- } : undefined,
161
+ },
164
162
  keyboardNavigation: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? keyboardNavigation : undefined
165
163
  }, /*#__PURE__*/_react.default.createElement(_editorToolbarModel.ToolbarModelRenderer, {
166
164
  toolbar: toolbar,
@@ -20,7 +20,8 @@ const ABORT_REASON = {
20
20
  * Abort: When selection transition to empty or block menu is opened
21
21
  */
22
22
  export const getSelectionToolbarOpenExperiencePlugin = ({
23
- refs
23
+ refs,
24
+ dispatchAnalyticsEvent
24
25
  }) => {
25
26
  let targetEl;
26
27
  let editorViewEl;
@@ -31,6 +32,7 @@ export const getSelectionToolbarOpenExperiencePlugin = ({
31
32
  return targetEl;
32
33
  };
33
34
  const experience = new Experience('selection-toolbar-open', {
35
+ dispatchAnalyticsEvent,
34
36
  checks: [new ExperienceCheckTimeout({
35
37
  durationMs: 500,
36
38
  onTimeout: () => {
@@ -178,7 +178,11 @@ export const toolbarPlugin = ({
178
178
  }, ...(!disableSelectionToolbar && expValEquals('platform_editor_experience_tracking', 'isEnabled', true) ? [{
179
179
  name: 'selectionToolbarOpenExperience',
180
180
  plugin: () => getSelectionToolbarOpenExperiencePlugin({
181
- refs
181
+ refs,
182
+ dispatchAnalyticsEvent: payload => {
183
+ var _api$analytics, _api$analytics$action;
184
+ return api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent(payload);
185
+ }
182
186
  })
183
187
  }] : [])];
184
188
  },
@@ -145,13 +145,11 @@ export const SelectionToolbar = ({
145
145
  isOffline: isOffline
146
146
  }, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
147
147
  api: api,
148
- isDisabled: patch6Enabled ? isDisabled : isOffline
149
- // supress type checks for now
150
- ,
151
- fireAnalyticsEvent: expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? payload => {
148
+ isDisabled: patch6Enabled ? isDisabled : isOffline,
149
+ fireAnalyticsEvent: payload => {
152
150
  var _api$analytics;
153
151
  api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent(payload);
154
- } : undefined,
152
+ },
155
153
  keyboardNavigation: expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? keyboardNavigation : undefined
156
154
  }, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
157
155
  toolbar: toolbar,
@@ -21,7 +21,8 @@ var ABORT_REASON = {
21
21
  * Abort: When selection transition to empty or block menu is opened
22
22
  */
23
23
  export var getSelectionToolbarOpenExperiencePlugin = function getSelectionToolbarOpenExperiencePlugin(_ref) {
24
- var refs = _ref.refs;
24
+ var refs = _ref.refs,
25
+ dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
25
26
  var targetEl;
26
27
  var editorViewEl;
27
28
  var getTarget = function getTarget() {
@@ -31,6 +32,7 @@ export var getSelectionToolbarOpenExperiencePlugin = function getSelectionToolba
31
32
  return targetEl;
32
33
  };
33
34
  var experience = new Experience('selection-toolbar-open', {
35
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
34
36
  checks: [new ExperienceCheckTimeout({
35
37
  durationMs: 500,
36
38
  onTimeout: function onTimeout() {
@@ -182,7 +182,11 @@ export var toolbarPlugin = function toolbarPlugin(_ref) {
182
182
  name: 'selectionToolbarOpenExperience',
183
183
  plugin: function plugin() {
184
184
  return getSelectionToolbarOpenExperiencePlugin({
185
- refs: refs
185
+ refs: refs,
186
+ dispatchAnalyticsEvent: function dispatchAnalyticsEvent(payload) {
187
+ var _api$analytics;
188
+ return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent(payload);
189
+ }
186
190
  });
187
191
  }
188
192
  }] : []));
@@ -146,13 +146,11 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
146
146
  isOffline: isOffline
147
147
  }, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
148
148
  api: api,
149
- isDisabled: patch6Enabled ? isDisabled : isOffline
150
- // supress type checks for now
151
- ,
152
- fireAnalyticsEvent: expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? function (payload) {
149
+ isDisabled: patch6Enabled ? isDisabled : isOffline,
150
+ fireAnalyticsEvent: function fireAnalyticsEvent(payload) {
153
151
  var _api$analytics;
154
152
  api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent(payload);
155
- } : undefined,
153
+ },
156
154
  keyboardNavigation: expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? keyboardNavigation : undefined
157
155
  }, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
158
156
  toolbar: toolbar,
@@ -1,5 +1,7 @@
1
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  type SelectionToolbarOpenExperienceOptions = {
4
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
3
5
  refs: {
4
6
  popupsMountPoint?: HTMLElement;
5
7
  };
@@ -12,5 +14,5 @@ type SelectionToolbarOpenExperienceOptions = {
12
14
  * Failure: When 500ms passes without the selection toolbar being added to the DOM
13
15
  * Abort: When selection transition to empty or block menu is opened
14
16
  */
15
- export declare const getSelectionToolbarOpenExperiencePlugin: ({ refs, }: SelectionToolbarOpenExperienceOptions) => SafePlugin<{}>;
17
+ export declare const getSelectionToolbarOpenExperiencePlugin: ({ refs, dispatchAnalyticsEvent, }: SelectionToolbarOpenExperienceOptions) => SafePlugin<{}>;
16
18
  export {};
@@ -1,5 +1,7 @@
1
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
1
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
3
  type SelectionToolbarOpenExperienceOptions = {
4
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
3
5
  refs: {
4
6
  popupsMountPoint?: HTMLElement;
5
7
  };
@@ -12,5 +14,5 @@ type SelectionToolbarOpenExperienceOptions = {
12
14
  * Failure: When 500ms passes without the selection toolbar being added to the DOM
13
15
  * Abort: When selection transition to empty or block menu is opened
14
16
  */
15
- export declare const getSelectionToolbarOpenExperiencePlugin: ({ refs, }: SelectionToolbarOpenExperienceOptions) => SafePlugin<{}>;
17
+ export declare const getSelectionToolbarOpenExperiencePlugin: ({ refs, dispatchAnalyticsEvent, }: SelectionToolbarOpenExperienceOptions) => SafePlugin<{}>;
16
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-toolbar",
3
- "version": "3.4.4",
3
+ "version": "3.4.6",
4
4
  "description": "Toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,13 +40,13 @@
40
40
  "@atlaskit/editor-toolbar-model": "^0.2.0",
41
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
42
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
43
- "@atlaskit/tmp-editor-statsig": "^13.22.0",
43
+ "@atlaskit/tmp-editor-statsig": "^13.33.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "bind-event-listener": "^3.0.0",
46
46
  "react-intl-next": "npm:react-intl@^5.18.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^110.19.0",
49
+ "@atlaskit/editor-common": "^110.25.0",
50
50
  "react": "^18.2.0"
51
51
  },
52
52
  "platform-feature-flags": {
@@ -1,60 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.post-office.json",
3
- "compilerOptions": {
4
- "target": "es5",
5
- "outDir": "../../../../../post-office/tsDist/@atlaskit__editor-plugin-toolbar/app",
6
- "rootDir": "../",
7
- "composite": true
8
- },
9
- "include": [
10
- "../src/**/*.ts",
11
- "../src/**/*.tsx"
12
- ],
13
- "exclude": [
14
- "../src/**/__tests__/*",
15
- "../src/**/*.test.*",
16
- "../src/**/test.*",
17
- "../src/**/examples.*"
18
- ],
19
- "references": [
20
- {
21
- "path": "../../../helpers/browser-apis/afm-post-office/tsconfig.json"
22
- },
23
- {
24
- "path": "../../editor-plugin-analytics/afm-post-office/tsconfig.json"
25
- },
26
- {
27
- "path": "../../editor-plugin-connectivity/afm-post-office/tsconfig.json"
28
- },
29
- {
30
- "path": "../../editor-plugin-editor-viewmode/afm-post-office/tsconfig.json"
31
- },
32
- {
33
- "path": "../../editor-plugin-selection/afm-post-office/tsconfig.json"
34
- },
35
- {
36
- "path": "../../editor-plugin-user-intent/afm-post-office/tsconfig.json"
37
- },
38
- {
39
- "path": "../../editor-plugin-user-preferences/afm-post-office/tsconfig.json"
40
- },
41
- {
42
- "path": "../../editor-toolbar/afm-post-office/tsconfig.json"
43
- },
44
- {
45
- "path": "../../editor-toolbar-model/afm-post-office/tsconfig.json"
46
- },
47
- {
48
- "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
49
- },
50
- {
51
- "path": "../../../platform/feature-flags-react/afm-post-office/tsconfig.json"
52
- },
53
- {
54
- "path": "../../tmp-editor-statsig/afm-post-office/tsconfig.json"
55
- },
56
- {
57
- "path": "../../editor-common/afm-post-office/tsconfig.json"
58
- }
59
- ]
60
- }