@atlaskit/editor-core 198.1.1 → 198.2.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/composable-editor/core-editor.js +0 -7
  3. package/dist/cjs/ui/ChromeCollapsed/index.js +2 -1
  4. package/dist/cjs/ui/CollapsedEditor/index.js +2 -1
  5. package/dist/cjs/version-wrapper.js +1 -1
  6. package/dist/es2019/composable-editor/core-editor.js +0 -5
  7. package/dist/es2019/ui/ChromeCollapsed/index.js +2 -1
  8. package/dist/es2019/ui/CollapsedEditor/index.js +2 -1
  9. package/dist/es2019/version-wrapper.js +1 -1
  10. package/dist/esm/composable-editor/core-editor.js +0 -7
  11. package/dist/esm/ui/ChromeCollapsed/index.js +2 -1
  12. package/dist/esm/ui/CollapsedEditor/index.js +2 -1
  13. package/dist/esm/version-wrapper.js +1 -1
  14. package/dist/types/create-editor/create-universal-preset.d.ts +4 -1
  15. package/dist/types/presets/universal.d.ts +4 -1
  16. package/dist/types/presets/useUniversalPreset.d.ts +4 -1
  17. package/dist/types/ui/ChromeCollapsed/index.d.ts +1 -0
  18. package/dist/types/ui/CollapsedEditor/index.d.ts +1 -0
  19. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +4 -1
  20. package/dist/types-ts4.5/presets/universal.d.ts +4 -1
  21. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +4 -1
  22. package/dist/types-ts4.5/ui/ChromeCollapsed/index.d.ts +1 -0
  23. package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +1 -0
  24. package/docs/1-legacy-editor.tsx +5 -0
  25. package/package.json +15 -11
  26. package/dist/cjs/composable-editor/utils/trackEditorActions.js +0 -99
  27. package/dist/es2019/composable-editor/utils/trackEditorActions.js +0 -78
  28. package/dist/esm/composable-editor/utils/trackEditorActions.js +0 -92
  29. package/dist/types/composable-editor/utils/trackEditorActions.d.ts +0 -29
  30. package/dist/types-ts4.5/composable-editor/utils/trackEditorActions.d.ts +0 -29
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 198.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#147461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147461)
8
+ [`5f0dad925df3b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5f0dad925df3b) -
9
+ Remove content retrieval tracking to decouple editor-core from editor actions. Should have no
10
+ affect on functionality.
11
+
12
+ ## 198.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#146905](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146905)
17
+ [`fde71f816ee10`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fde71f816ee10) -
18
+ Add AssistiveLabel for CollapsedEditor(passing label down to chrome collapse) to improve a11y
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 198.1.1
4
25
 
5
26
  ### Patch Changes
@@ -14,7 +14,6 @@ var _v = _interopRequireDefault(require("uuid/v4"));
14
14
  var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
15
15
  var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
16
16
  var _analytics = require("@atlaskit/editor-common/analytics");
17
- var _hooks = require("@atlaskit/editor-common/hooks");
18
17
  var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
19
18
  var _ufo = require("@atlaskit/editor-common/ufo");
20
19
  var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
@@ -28,7 +27,6 @@ var _useMeasureEditorMountTime = _interopRequireDefault(require("./hooks/useMeas
28
27
  var _useMemoEditorProps = _interopRequireDefault(require("./hooks/useMemoEditorProps"));
29
28
  var _useProviderFactory = _interopRequireDefault(require("./hooks/useProviderFactory"));
30
29
  var _sendDurationAnalytics = _interopRequireDefault(require("./utils/sendDurationAnalytics"));
31
- var _trackEditorActions = _interopRequireDefault(require("./utils/trackEditorActions"));
32
30
  /**
33
31
  * @jsxRuntime classic
34
32
  * @jsx jsx
@@ -57,11 +55,6 @@ function Editor(passedProps) {
57
55
  var handleAnalyticsEvent = (0, _react.useCallback)(function (data) {
58
56
  (0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)(data);
59
57
  }, [createAnalyticsEvent]);
60
- (0, _hooks.useConstructor)(function () {
61
- (0, _trackEditorActions.default)(editorActions, props.performanceTracking, function (value) {
62
- return handleAnalyticsEvent(value);
63
- });
64
- });
65
58
  var getExperienceStore = (0, _react.useCallback)(function () {
66
59
  return experienceStore.current;
67
60
  }, []);
@@ -65,7 +65,8 @@ var ChromeCollapsed = /*#__PURE__*/function (_PureComponent) {
65
65
  css: _styles.inputStyle,
66
66
  ref: this.handleInputRef,
67
67
  onFocus: this.focusHandler,
68
- placeholder: placeholder
68
+ placeholder: placeholder,
69
+ "aria-label": this.props.label
69
70
  });
70
71
  }
71
72
  }]);
@@ -53,7 +53,8 @@ var CollapsedEditor = exports.default = /*#__PURE__*/function (_React$Component)
53
53
  if (!this.props.isExpanded) {
54
54
  return /*#__PURE__*/_react.default.createElement(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, /*#__PURE__*/_react.default.createElement(_ChromeCollapsed.default, {
55
55
  onFocus: this.props.onFocus,
56
- text: this.props.placeholder
56
+ text: this.props.placeholder,
57
+ label: this.props.assistiveLabel
57
58
  }));
58
59
  }
59
60
 
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "198.1.1";
8
+ var version = exports.version = "198.2.1";
@@ -12,7 +12,6 @@ import uuid from 'uuid/v4';
12
12
  import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
13
13
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
14
14
  import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
15
- import { useConstructor } from '@atlaskit/editor-common/hooks';
16
15
  import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
17
16
  import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
18
17
  import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
@@ -26,7 +25,6 @@ import useMeasureEditorMountTime from './hooks/useMeasureEditorMountTime';
26
25
  import useMemoEditorProps from './hooks/useMemoEditorProps';
27
26
  import useProviderFactory from './hooks/useProviderFactory';
28
27
  import sendDurationAnalytics from './utils/sendDurationAnalytics';
29
- import trackEditorActions from './utils/trackEditorActions';
30
28
 
31
29
  /**
32
30
  * Editor wrapper that deals with the lifecycle logic of the editor
@@ -48,9 +46,6 @@ function Editor(passedProps) {
48
46
  const handleAnalyticsEvent = useCallback(data => {
49
47
  fireAnalyticsEvent(createAnalyticsEvent)(data);
50
48
  }, [createAnalyticsEvent]);
51
- useConstructor(() => {
52
- trackEditorActions(editorActions, props.performanceTracking, value => handleAnalyticsEvent(value));
53
- });
54
49
  const getExperienceStore = useCallback(() => {
55
50
  return experienceStore.current;
56
51
  }, []);
@@ -41,7 +41,8 @@ class ChromeCollapsed extends PureComponent {
41
41
  css: inputStyle,
42
42
  ref: this.handleInputRef,
43
43
  onFocus: this.focusHandler,
44
- placeholder: placeholder
44
+ placeholder: placeholder,
45
+ "aria-label": this.props.label
45
46
  });
46
47
  }
47
48
  }
@@ -25,7 +25,8 @@ export default class CollapsedEditor extends React.Component {
25
25
  if (!this.props.isExpanded) {
26
26
  return /*#__PURE__*/React.createElement(IntlProviderIfMissingWrapper, null, /*#__PURE__*/React.createElement(ChromeCollapsed, {
27
27
  onFocus: this.props.onFocus,
28
- text: this.props.placeholder
28
+ text: this.props.placeholder,
29
+ label: this.props.assistiveLabel
29
30
  }));
30
31
  }
31
32
 
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "198.1.1";
2
+ export const version = "198.2.1";
@@ -12,7 +12,6 @@ import uuid from 'uuid/v4';
12
12
  import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
13
13
  import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
14
14
  import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
15
- import { useConstructor } from '@atlaskit/editor-common/hooks';
16
15
  import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
17
16
  import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
18
17
  import { getAnalyticsAppearance } from '@atlaskit/editor-common/utils/analytics';
@@ -26,7 +25,6 @@ import useMeasureEditorMountTime from './hooks/useMeasureEditorMountTime';
26
25
  import useMemoEditorProps from './hooks/useMemoEditorProps';
27
26
  import useProviderFactory from './hooks/useProviderFactory';
28
27
  import sendDurationAnalytics from './utils/sendDurationAnalytics';
29
- import trackEditorActions from './utils/trackEditorActions';
30
28
 
31
29
  /**
32
30
  * Editor wrapper that deals with the lifecycle logic of the editor
@@ -49,11 +47,6 @@ function Editor(passedProps) {
49
47
  var handleAnalyticsEvent = useCallback(function (data) {
50
48
  fireAnalyticsEvent(createAnalyticsEvent)(data);
51
49
  }, [createAnalyticsEvent]);
52
- useConstructor(function () {
53
- trackEditorActions(editorActions, props.performanceTracking, function (value) {
54
- return handleAnalyticsEvent(value);
55
- });
56
- });
57
50
  var getExperienceStore = useCallback(function () {
58
51
  return experienceStore.current;
59
52
  }, []);
@@ -59,7 +59,8 @@ var ChromeCollapsed = /*#__PURE__*/function (_PureComponent) {
59
59
  css: inputStyle,
60
60
  ref: this.handleInputRef,
61
61
  onFocus: this.focusHandler,
62
- placeholder: placeholder
62
+ placeholder: placeholder,
63
+ "aria-label": this.props.label
63
64
  });
64
65
  }
65
66
  }]);
@@ -46,7 +46,8 @@ var CollapsedEditor = /*#__PURE__*/function (_React$Component) {
46
46
  if (!this.props.isExpanded) {
47
47
  return /*#__PURE__*/React.createElement(IntlProviderIfMissingWrapper, null, /*#__PURE__*/React.createElement(ChromeCollapsed, {
48
48
  onFocus: this.props.onFocus,
49
- text: this.props.placeholder
49
+ text: this.props.placeholder,
50
+ label: this.props.assistiveLabel
50
51
  }));
51
52
  }
52
53
 
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "198.1.1";
2
+ export var version = "198.2.1";
@@ -3440,7 +3440,10 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
3440
3440
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
3441
3441
  sharedState: import("@atlaskit/editor-plugin-media-insert").MediaInsertPluginState;
3442
3442
  commands: {
3443
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3443
+ showMediaInsertPopup: (mountInfo?: {
3444
+ ref: HTMLElement;
3445
+ mountPoint: HTMLElement;
3446
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3444
3447
  };
3445
3448
  }, undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
3446
3449
  pluginConfiguration: import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined;
@@ -3491,7 +3491,10 @@ export default function createUniversalPresetInternal({ appearance, props, featu
3491
3491
  }, FeatureFlags>>];
3492
3492
  sharedState: import("@atlaskit/editor-plugins/media-insert").MediaInsertPluginState;
3493
3493
  commands: {
3494
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3494
+ showMediaInsertPopup: (mountInfo?: {
3495
+ ref: HTMLElement;
3496
+ mountPoint: HTMLElement;
3497
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3495
3498
  };
3496
3499
  }, undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
3497
3500
  pluginConfiguration: import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined;
@@ -3440,7 +3440,10 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
3440
3440
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
3441
3441
  sharedState: import("@atlaskit/editor-plugin-media-insert").MediaInsertPluginState;
3442
3442
  commands: {
3443
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3443
+ showMediaInsertPopup: (mountInfo?: {
3444
+ ref: HTMLElement;
3445
+ mountPoint: HTMLElement;
3446
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
3444
3447
  };
3445
3448
  }, undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
3446
3449
  pluginConfiguration: import("@atlaskit/editor-plugins/media/types").MediaOptions | undefined;
@@ -7,6 +7,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
7
7
  export interface Props {
8
8
  text?: string;
9
9
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
10
+ label?: string;
10
11
  }
11
12
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
12
13
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type Editor from '../../editor';
3
3
  export interface Props {
4
4
  placeholder?: string;
5
+ assistiveLabel?: string;
5
6
  children?: any;
6
7
  isExpanded?: boolean;
7
8
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
@@ -4219,7 +4219,10 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
4219
4219
  ];
4220
4220
  sharedState: import("@atlaskit/editor-plugin-media-insert").MediaInsertPluginState;
4221
4221
  commands: {
4222
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4222
+ showMediaInsertPopup: (mountInfo?: {
4223
+ ref: HTMLElement;
4224
+ mountPoint: HTMLElement;
4225
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4223
4226
  };
4224
4227
  }, undefined> | undefined,
4225
4228
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
@@ -4270,7 +4270,10 @@ export default function createUniversalPresetInternal({ appearance, props, featu
4270
4270
  ];
4271
4271
  sharedState: import("@atlaskit/editor-plugins/media-insert").MediaInsertPluginState;
4272
4272
  commands: {
4273
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4273
+ showMediaInsertPopup: (mountInfo?: {
4274
+ ref: HTMLElement;
4275
+ mountPoint: HTMLElement;
4276
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4274
4277
  };
4275
4278
  }, undefined> | undefined,
4276
4279
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
@@ -4219,7 +4219,10 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
4219
4219
  ];
4220
4220
  sharedState: import("@atlaskit/editor-plugin-media-insert").MediaInsertPluginState;
4221
4221
  commands: {
4222
- showMediaInsertPopup: (target?: HTMLElement | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4222
+ showMediaInsertPopup: (mountInfo?: {
4223
+ ref: HTMLElement;
4224
+ mountPoint: HTMLElement;
4225
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
4223
4226
  };
4224
4227
  }, undefined> | undefined,
4225
4228
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
@@ -7,6 +7,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
7
7
  export interface Props {
8
8
  text?: string;
9
9
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
10
+ label?: string;
10
11
  }
11
12
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
12
13
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type Editor from '../../editor';
3
3
  export interface Props {
4
4
  placeholder?: string;
5
+ assistiveLabel?: string;
5
6
  children?: any;
6
7
  isExpanded?: boolean;
7
8
  onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
@@ -74,6 +74,7 @@ ${code`
74
74
  placeholder="What would you like to say?"
75
75
  isExpanded={this.state.isExpanded}
76
76
  onFocus={this.expandEditor}
77
+ assistiveLabel="What would you like to say?"
77
78
  >
78
79
  <Editor
79
80
  appearance="comment"
@@ -90,6 +91,10 @@ ${code`
90
91
 
91
92
  EditorContext allows you, in conjunction with WithEditorActions, to manipulate the editor from anywhere inside the EditorContext. In the example below, notice that no reference is kept to the editor instance.
92
93
 
94
+ ## New assistiveLabel prop(optional)
95
+
96
+ assistiveLabel prop allosws you to set an aria-label for ChromeCollapsed to improve a11y
97
+
93
98
  ${code`
94
99
  import { EditorContext, WithEditorActions } from '@atlaskit/editor-core';
95
100
  import { CollapsibleEditor } from 'previous-example';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "198.1.1",
3
+ "version": "198.2.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,14 +43,14 @@
43
43
  "@atlaskit/analytics-next": "^10.1.0",
44
44
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
45
45
  "@atlaskit/button": "^20.2.0",
46
- "@atlaskit/editor-common": "^91.2.0",
46
+ "@atlaskit/editor-common": "^92.0.0",
47
47
  "@atlaskit/editor-json-transformer": "^8.18.0",
48
- "@atlaskit/editor-plugin-quick-insert": "1.4.3",
48
+ "@atlaskit/editor-plugin-quick-insert": "1.4.4",
49
49
  "@atlaskit/editor-plugins": "^5.5.0",
50
50
  "@atlaskit/editor-prosemirror": "6.0.0",
51
51
  "@atlaskit/editor-shared-styles": "^3.0.0",
52
52
  "@atlaskit/emoji": "^67.8.0",
53
- "@atlaskit/icon": "^22.19.0",
53
+ "@atlaskit/icon": "^22.20.0",
54
54
  "@atlaskit/media-card": "^78.5.0",
55
55
  "@atlaskit/mention": "^23.3.0",
56
56
  "@atlaskit/platform-feature-flags": "^0.3.0",
@@ -79,14 +79,14 @@
79
79
  "react-intl-next": "npm:react-intl@^5.18.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@af/editor-examples-helpers": "0.3.15",
82
+ "@af/editor-examples-helpers": "0.3.16",
83
83
  "@af/editor-libra": "*",
84
84
  "@af/visual-regression": "*",
85
85
  "@atlaskit/adf-utils": "^19.8.0",
86
86
  "@atlaskit/analytics-listeners": "^8.11.0",
87
- "@atlaskit/collab-provider": "9.42.0",
88
- "@atlaskit/editor-plugin-annotation": "1.19.9",
89
- "@atlaskit/editor-plugin-card": "^3.3.0",
87
+ "@atlaskit/collab-provider": "9.42.1",
88
+ "@atlaskit/editor-plugin-annotation": "1.19.10",
89
+ "@atlaskit/editor-plugin-card": "^3.4.0",
90
90
  "@atlaskit/editor-plugin-list": "^3.8.0",
91
91
  "@atlaskit/editor-plugin-paste": "^1.12.0",
92
92
  "@atlaskit/editor-test-helpers": "*",
@@ -97,15 +97,15 @@
97
97
  "@atlaskit/media-test-helpers": "^34.4.0",
98
98
  "@atlaskit/modal-dialog": "^12.17.0",
99
99
  "@atlaskit/primitives": "^12.2.0",
100
- "@atlaskit/renderer": "^110.6.0",
101
- "@atlaskit/smart-card": "^28.4.0",
100
+ "@atlaskit/renderer": "^111.0.0",
101
+ "@atlaskit/smart-card": "^29.0.0",
102
102
  "@atlaskit/synchrony-test-helpers": "^2.5.0",
103
103
  "@atlaskit/toggle": "^13.4.0",
104
104
  "@atlaskit/util-data-test": "^17.9.0",
105
105
  "@atlaskit/visual-regression": "*",
106
106
  "@atlassian/adf-schema-json": "^1.22.0",
107
107
  "@atlassian/feature-flags-test-utils": "*",
108
- "@atlassian/search-provider": "2.4.140",
108
+ "@atlassian/search-provider": "2.4.141",
109
109
  "@emotion/jest": "^11.8.0",
110
110
  "@storybook/addon-knobs": "^5.3.18",
111
111
  "@testing-library/react": "^12.1.5",
@@ -272,6 +272,10 @@
272
272
  },
273
273
  "platform_editor_remove_use_preset_context": {
274
274
  "type": "boolean"
275
+ },
276
+ "platform_editor_context_panel_support_multiple": {
277
+ "type": "boolean",
278
+ "referenceOnly": true
275
279
  }
276
280
  },
277
281
  "stricter": {
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = trackEditorActions;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _analytics = require("@atlaskit/editor-common/analytics");
11
- /**
12
- *
13
- * Util function to be used with the Editor to track the EditorActions prop
14
- *
15
- * @param editorActions
16
- * @param performanceTracking
17
- * @param handleAnalyticsEvent
18
- * @returns
19
- */
20
- function trackEditorActions(editorActions, performanceTracking, handleAnalyticsEvent) {
21
- var _performanceTracking$;
22
- if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled) {
23
- var DEFAULT_SAMPLING_RATE = 100;
24
- var getValue = editorActions.getValue.bind(editorActions);
25
- if (!editorActions._contentRetrievalTracking) {
26
- editorActions._contentRetrievalTracking = {
27
- samplingCounters: {
28
- success: 1,
29
- failure: 1
30
- },
31
- getValueTracked: false
32
- };
33
- }
34
- var _editorActions$_conte = editorActions._contentRetrievalTracking,
35
- samplingCounters = _editorActions$_conte.samplingCounters,
36
- getValueTracked = _editorActions$_conte.getValueTracked;
37
- if (!getValueTracked) {
38
- var getValueWithTracking = /*#__PURE__*/function () {
39
- var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
40
- var _performanceTracking$2, _performanceTracking$3, value, _performanceTracking$4, _performanceTracking$5, _performanceTracking$6;
41
- return _regenerator.default.wrap(function _callee$(_context) {
42
- while (1) switch (_context.prev = _context.next) {
43
- case 0:
44
- _context.prev = 0;
45
- _context.next = 3;
46
- return getValue();
47
- case 3:
48
- value = _context.sent;
49
- if (samplingCounters.success === ((_performanceTracking$2 = performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$3 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$3 === void 0 ? void 0 : _performanceTracking$3.successSamplingRate) !== null && _performanceTracking$2 !== void 0 ? _performanceTracking$2 : DEFAULT_SAMPLING_RATE)) {
50
- handleAnalyticsEvent({
51
- payload: {
52
- action: _analytics.ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
53
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
54
- attributes: {
55
- success: true
56
- },
57
- eventType: _analytics.EVENT_TYPE.OPERATIONAL
58
- }
59
- });
60
- samplingCounters.success = 0;
61
- }
62
- samplingCounters.success++;
63
- return _context.abrupt("return", value);
64
- case 9:
65
- _context.prev = 9;
66
- _context.t0 = _context["catch"](0);
67
- if (samplingCounters.failure === ((_performanceTracking$4 = performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$5 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$5 === void 0 ? void 0 : _performanceTracking$5.failureSamplingRate) !== null && _performanceTracking$4 !== void 0 ? _performanceTracking$4 : DEFAULT_SAMPLING_RATE)) {
68
- handleAnalyticsEvent({
69
- payload: {
70
- action: _analytics.ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
71
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
72
- attributes: {
73
- success: false,
74
- errorInfo: _context.t0.toString(),
75
- errorStack: performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$6 = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$6 !== void 0 && _performanceTracking$6.reportErrorStack ? _context.t0.stack : undefined
76
- },
77
- eventType: _analytics.EVENT_TYPE.OPERATIONAL
78
- }
79
- });
80
- samplingCounters.failure = 0;
81
- }
82
- samplingCounters.failure++;
83
- throw _context.t0;
84
- case 14:
85
- case "end":
86
- return _context.stop();
87
- }
88
- }, _callee, null, [[0, 9]]);
89
- }));
90
- return function getValueWithTracking() {
91
- return _ref.apply(this, arguments);
92
- };
93
- }();
94
- editorActions.getValue = getValueWithTracking;
95
- editorActions._contentRetrievalTracking.getValueTracked = true;
96
- }
97
- }
98
- return editorActions;
99
- }
@@ -1,78 +0,0 @@
1
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
- /**
3
- *
4
- * Util function to be used with the Editor to track the EditorActions prop
5
- *
6
- * @param editorActions
7
- * @param performanceTracking
8
- * @param handleAnalyticsEvent
9
- * @returns
10
- */
11
- export default function trackEditorActions(editorActions, performanceTracking, handleAnalyticsEvent) {
12
- var _performanceTracking$;
13
- if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled) {
14
- const DEFAULT_SAMPLING_RATE = 100;
15
- const getValue = editorActions.getValue.bind(editorActions);
16
- if (!editorActions._contentRetrievalTracking) {
17
- editorActions._contentRetrievalTracking = {
18
- samplingCounters: {
19
- success: 1,
20
- failure: 1
21
- },
22
- getValueTracked: false
23
- };
24
- }
25
- const {
26
- _contentRetrievalTracking: {
27
- samplingCounters,
28
- getValueTracked
29
- }
30
- } = editorActions;
31
- if (!getValueTracked) {
32
- const getValueWithTracking = async () => {
33
- try {
34
- var _performanceTracking$2, _performanceTracking$3;
35
- const value = await getValue();
36
- if (samplingCounters.success === ((_performanceTracking$2 = performanceTracking === null || performanceTracking === void 0 ? void 0 : (_performanceTracking$3 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$3 === void 0 ? void 0 : _performanceTracking$3.successSamplingRate) !== null && _performanceTracking$2 !== void 0 ? _performanceTracking$2 : DEFAULT_SAMPLING_RATE)) {
37
- handleAnalyticsEvent({
38
- payload: {
39
- action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
40
- actionSubject: ACTION_SUBJECT.EDITOR,
41
- attributes: {
42
- success: true
43
- },
44
- eventType: EVENT_TYPE.OPERATIONAL
45
- }
46
- });
47
- samplingCounters.success = 0;
48
- }
49
- samplingCounters.success++;
50
- return value;
51
- } catch (err) {
52
- var _performanceTracking$4, _performanceTracking$5;
53
- if (samplingCounters.failure === ((_performanceTracking$4 = performanceTracking === null || performanceTracking === void 0 ? void 0 : (_performanceTracking$5 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$5 === void 0 ? void 0 : _performanceTracking$5.failureSamplingRate) !== null && _performanceTracking$4 !== void 0 ? _performanceTracking$4 : DEFAULT_SAMPLING_RATE)) {
54
- var _performanceTracking$6;
55
- handleAnalyticsEvent({
56
- payload: {
57
- action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
58
- actionSubject: ACTION_SUBJECT.EDITOR,
59
- attributes: {
60
- success: false,
61
- errorInfo: err.toString(),
62
- errorStack: performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$6 = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$6 !== void 0 && _performanceTracking$6.reportErrorStack ? err.stack : undefined
63
- },
64
- eventType: EVENT_TYPE.OPERATIONAL
65
- }
66
- });
67
- samplingCounters.failure = 0;
68
- }
69
- samplingCounters.failure++;
70
- throw err;
71
- }
72
- };
73
- editorActions.getValue = getValueWithTracking;
74
- editorActions._contentRetrievalTracking.getValueTracked = true;
75
- }
76
- }
77
- return editorActions;
78
- }
@@ -1,92 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
4
- /**
5
- *
6
- * Util function to be used with the Editor to track the EditorActions prop
7
- *
8
- * @param editorActions
9
- * @param performanceTracking
10
- * @param handleAnalyticsEvent
11
- * @returns
12
- */
13
- export default function trackEditorActions(editorActions, performanceTracking, handleAnalyticsEvent) {
14
- var _performanceTracking$;
15
- if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled) {
16
- var DEFAULT_SAMPLING_RATE = 100;
17
- var getValue = editorActions.getValue.bind(editorActions);
18
- if (!editorActions._contentRetrievalTracking) {
19
- editorActions._contentRetrievalTracking = {
20
- samplingCounters: {
21
- success: 1,
22
- failure: 1
23
- },
24
- getValueTracked: false
25
- };
26
- }
27
- var _editorActions$_conte = editorActions._contentRetrievalTracking,
28
- samplingCounters = _editorActions$_conte.samplingCounters,
29
- getValueTracked = _editorActions$_conte.getValueTracked;
30
- if (!getValueTracked) {
31
- var getValueWithTracking = /*#__PURE__*/function () {
32
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
33
- var _performanceTracking$2, _performanceTracking$3, value, _performanceTracking$4, _performanceTracking$5, _performanceTracking$6;
34
- return _regeneratorRuntime.wrap(function _callee$(_context) {
35
- while (1) switch (_context.prev = _context.next) {
36
- case 0:
37
- _context.prev = 0;
38
- _context.next = 3;
39
- return getValue();
40
- case 3:
41
- value = _context.sent;
42
- if (samplingCounters.success === ((_performanceTracking$2 = performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$3 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$3 === void 0 ? void 0 : _performanceTracking$3.successSamplingRate) !== null && _performanceTracking$2 !== void 0 ? _performanceTracking$2 : DEFAULT_SAMPLING_RATE)) {
43
- handleAnalyticsEvent({
44
- payload: {
45
- action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
46
- actionSubject: ACTION_SUBJECT.EDITOR,
47
- attributes: {
48
- success: true
49
- },
50
- eventType: EVENT_TYPE.OPERATIONAL
51
- }
52
- });
53
- samplingCounters.success = 0;
54
- }
55
- samplingCounters.success++;
56
- return _context.abrupt("return", value);
57
- case 9:
58
- _context.prev = 9;
59
- _context.t0 = _context["catch"](0);
60
- if (samplingCounters.failure === ((_performanceTracking$4 = performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$5 = performanceTracking.contentRetrievalTracking) === null || _performanceTracking$5 === void 0 ? void 0 : _performanceTracking$5.failureSamplingRate) !== null && _performanceTracking$4 !== void 0 ? _performanceTracking$4 : DEFAULT_SAMPLING_RATE)) {
61
- handleAnalyticsEvent({
62
- payload: {
63
- action: ACTION.EDITOR_CONTENT_RETRIEVAL_PERFORMED,
64
- actionSubject: ACTION_SUBJECT.EDITOR,
65
- attributes: {
66
- success: false,
67
- errorInfo: _context.t0.toString(),
68
- errorStack: performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$6 = performanceTracking.contentRetrievalTracking) !== null && _performanceTracking$6 !== void 0 && _performanceTracking$6.reportErrorStack ? _context.t0.stack : undefined
69
- },
70
- eventType: EVENT_TYPE.OPERATIONAL
71
- }
72
- });
73
- samplingCounters.failure = 0;
74
- }
75
- samplingCounters.failure++;
76
- throw _context.t0;
77
- case 14:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }, _callee, null, [[0, 9]]);
82
- }));
83
- return function getValueWithTracking() {
84
- return _ref.apply(this, arguments);
85
- };
86
- }();
87
- editorActions.getValue = getValueWithTracking;
88
- editorActions._contentRetrievalTracking.getValueTracked = true;
89
- }
90
- }
91
- return editorActions;
92
- }
@@ -1,29 +0,0 @@
1
- import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
2
- import type EditorActions from '../../actions';
3
- import type { PerformanceTracking } from '../../types/performance-tracking';
4
- /**
5
- *
6
- * Util function to be used with the Editor to track the EditorActions prop
7
- *
8
- * @param editorActions
9
- * @param performanceTracking
10
- * @param handleAnalyticsEvent
11
- * @returns
12
- */
13
- export default function trackEditorActions(editorActions: EditorActions & {
14
- _contentRetrievalTracking?: {
15
- getValueTracked: boolean;
16
- samplingCounters: {
17
- success: number;
18
- failure: number;
19
- };
20
- };
21
- }, performanceTracking: PerformanceTracking | undefined, handleAnalyticsEvent: FireAnalyticsCallback): EditorActions<any> & {
22
- _contentRetrievalTracking?: {
23
- getValueTracked: boolean;
24
- samplingCounters: {
25
- success: number;
26
- failure: number;
27
- };
28
- } | undefined;
29
- };
@@ -1,29 +0,0 @@
1
- import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
2
- import type EditorActions from '../../actions';
3
- import type { PerformanceTracking } from '../../types/performance-tracking';
4
- /**
5
- *
6
- * Util function to be used with the Editor to track the EditorActions prop
7
- *
8
- * @param editorActions
9
- * @param performanceTracking
10
- * @param handleAnalyticsEvent
11
- * @returns
12
- */
13
- export default function trackEditorActions(editorActions: EditorActions & {
14
- _contentRetrievalTracking?: {
15
- getValueTracked: boolean;
16
- samplingCounters: {
17
- success: number;
18
- failure: number;
19
- };
20
- };
21
- }, performanceTracking: PerformanceTracking | undefined, handleAnalyticsEvent: FireAnalyticsCallback): EditorActions<any> & {
22
- _contentRetrievalTracking?: {
23
- getValueTracked: boolean;
24
- samplingCounters: {
25
- success: number;
26
- failure: number;
27
- };
28
- } | undefined;
29
- };