@atlaskit/editor-core 190.1.27 → 190.1.28

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 (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/plugins/index.js +0 -7
  4. package/dist/cjs/presets/universal.js +6 -2
  5. package/dist/cjs/ui/ToolbarFeedback/index.js +20 -17
  6. package/dist/cjs/version-wrapper.js +1 -1
  7. package/dist/es2019/plugins/index.js +0 -1
  8. package/dist/es2019/presets/universal.js +7 -2
  9. package/dist/es2019/ui/ToolbarFeedback/index.js +23 -8
  10. package/dist/es2019/version-wrapper.js +1 -1
  11. package/dist/esm/plugins/index.js +0 -1
  12. package/dist/esm/presets/universal.js +6 -2
  13. package/dist/esm/ui/ToolbarFeedback/index.js +20 -17
  14. package/dist/esm/version-wrapper.js +1 -1
  15. package/dist/types/editor.d.ts +2 -1
  16. package/dist/types/plugins/index.d.ts +0 -1
  17. package/dist/types/types/editor-props.d.ts +1 -10
  18. package/dist/types/types/index.d.ts +1 -1
  19. package/dist/types-ts4.5/editor.d.ts +2 -1
  20. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  21. package/dist/types-ts4.5/types/editor-props.d.ts +1 -10
  22. package/dist/types-ts4.5/types/index.d.ts +1 -1
  23. package/package.json +5 -4
  24. package/dist/cjs/plugins/feedback-dialog/getBrowserInfo.js +0 -70
  25. package/dist/cjs/plugins/feedback-dialog/getDeviceInfo.js +0 -118
  26. package/dist/cjs/plugins/feedback-dialog/index.js +0 -127
  27. package/dist/cjs/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +0 -67
  28. package/dist/cjs/utils/pick-by.js +0 -16
  29. package/dist/es2019/plugins/feedback-dialog/getBrowserInfo.js +0 -64
  30. package/dist/es2019/plugins/feedback-dialog/getDeviceInfo.js +0 -112
  31. package/dist/es2019/plugins/feedback-dialog/index.js +0 -82
  32. package/dist/es2019/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +0 -47
  33. package/dist/es2019/utils/pick-by.js +0 -5
  34. package/dist/esm/plugins/feedback-dialog/getBrowserInfo.js +0 -64
  35. package/dist/esm/plugins/feedback-dialog/getDeviceInfo.js +0 -112
  36. package/dist/esm/plugins/feedback-dialog/index.js +0 -120
  37. package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +0 -60
  38. package/dist/esm/utils/pick-by.js +0 -9
  39. package/dist/types/plugins/feedback-dialog/getBrowserInfo.d.ts +0 -6
  40. package/dist/types/plugins/feedback-dialog/getDeviceInfo.d.ts +0 -6
  41. package/dist/types/plugins/feedback-dialog/index.d.ts +0 -10
  42. package/dist/types/plugins/feedback-dialog/loadJiraCollectorDialogScript.d.ts +0 -8
  43. package/dist/types/utils/pick-by.d.ts +0 -2
  44. package/dist/types-ts4.5/plugins/feedback-dialog/getBrowserInfo.d.ts +0 -6
  45. package/dist/types-ts4.5/plugins/feedback-dialog/getDeviceInfo.d.ts +0 -6
  46. package/dist/types-ts4.5/plugins/feedback-dialog/index.d.ts +0 -12
  47. package/dist/types-ts4.5/plugins/feedback-dialog/loadJiraCollectorDialogScript.d.ts +0 -8
  48. package/dist/types-ts4.5/utils/pick-by.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 190.1.28
4
+
5
+ ### Patch Changes
6
+
7
+ - [#63849](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63849) [`75e0c3b954b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/75e0c3b954b3) - Extract feedback dialog plugin from editor-core as @atlaskit/editor-plugin-feedback-dialog
8
+ - Updated dependencies
9
+
3
10
  ## 190.1.27
4
11
 
5
12
  ### Patch Changes
@@ -136,6 +136,9 @@
136
136
  {
137
137
  "path": "../../editor-plugin-feature-flags/afm-cc/tsconfig.json"
138
138
  },
139
+ {
140
+ "path": "../../editor-plugin-feedback-dialog/afm-cc/tsconfig.json"
141
+ },
139
142
  {
140
143
  "path": "../../editor-plugin-floating-toolbar/afm-cc/tsconfig.json"
141
144
  },
@@ -28,12 +28,6 @@ Object.defineProperty(exports, "extensionPlugin", {
28
28
  return _extension.default;
29
29
  }
30
30
  });
31
- Object.defineProperty(exports, "feedbackDialogPlugin", {
32
- enumerable: true,
33
- get: function get() {
34
- return _feedbackDialog.default;
35
- }
36
- });
37
31
  Object.defineProperty(exports, "findReplacePlugin", {
38
32
  enumerable: true,
39
33
  get: function get() {
@@ -49,7 +43,6 @@ Object.defineProperty(exports, "jiraIssuePlugin", {
49
43
  var _collabEdit = _interopRequireDefault(require("./collab-edit"));
50
44
  var _extension = _interopRequireDefault(require("./extension"));
51
45
  var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
52
- var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
53
46
  var _findReplace = _interopRequireDefault(require("./find-replace"));
54
47
  var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
55
48
  var _beforePrimaryToolbar = _interopRequireDefault(require("./before-primaryToolbar"));
@@ -49,9 +49,11 @@ var _editorPluginDataConsumer = require("@atlaskit/editor-plugin-data-consumer")
49
49
  var _editorPluginAnnotation = require("@atlaskit/editor-plugin-annotation");
50
50
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
51
51
  var _plugins = require("../plugins");
52
+ var _editorPluginFeedbackDialog = require("@atlaskit/editor-plugin-feedback-dialog");
52
53
  var _utils = require("@atlaskit/editor-common/utils");
53
54
  var _isFullPage = require("../utils/is-full-page");
54
55
  var _default = require("./default");
56
+ var _versionWrapper = require("../version-wrapper");
55
57
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
56
58
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
57
59
  /**
@@ -202,9 +204,11 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
202
204
  }]);
203
205
  }
204
206
  return builder;
205
- }).maybeAdd(_plugins.feedbackDialogPlugin, function (plugin, builder) {
207
+ }).maybeAdd(_editorPluginFeedbackDialog.feedbackDialogPlugin, function (plugin, builder) {
206
208
  if (props.feedbackInfo) {
207
- return builder.add([plugin, props.feedbackInfo]);
209
+ return builder.add([plugin, _objectSpread({
210
+ coreVersion: _versionWrapper.version
211
+ }, props.feedbackInfo)]);
208
212
  }
209
213
  return builder;
210
214
  }).maybeAdd(_editorPluginHelpDialog.helpDialogPlugin, function (plugin, builder) {
@@ -28,9 +28,7 @@ var _withOuterListeners = _interopRequireDefault(require("../with-outer-listener
28
28
  var _styles = require("./styles");
29
29
  var _analytics = require("@atlaskit/editor-common/analytics");
30
30
  var _eventDispatcher = require("../../event-dispatcher");
31
- var _feedbackDialog = require("../../plugins/feedback-dialog");
32
31
  var _deprecationWarnings = _interopRequireDefault(require("../../utils/deprecation-warnings"));
33
- var _pickBy = _interopRequireDefault(require("../../utils/pick-by"));
34
32
  var _utils = require("@atlaskit/editor-common/utils");
35
33
  var _context2 = require("../../presets/context");
36
34
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -54,9 +52,6 @@ var deprecations = [{
54
52
  description: 'To pass feedback labels use feedbackInfo property – <Editor feedbackInfo={{ labels }} />',
55
53
  type: 'removed'
56
54
  }];
57
- var isNullOrUndefined = function isNullOrUndefined(attr) {
58
- return attr === null || attr === undefined;
59
- };
60
55
  var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
61
56
  (0, _inherits2.default)(ToolbarFeedbackInternal, _PureComponent);
62
57
  var _super = _createSuper(ToolbarFeedbackInternal);
@@ -77,12 +72,20 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
77
72
  });
78
73
  // Create a FeedbackInfo instance from props.
79
74
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFeedbackInfo", function () {
80
- var isFeedbackInfoAttr = function isFeedbackInfoAttr(attr) {
81
- return ['product', 'packageVersion', 'packageName', 'labels'].indexOf(attr) >= 0;
82
- };
83
- return (0, _pickBy.default)(function (key, value) {
84
- return isFeedbackInfoAttr(key) && !isNullOrUndefined(value);
85
- }, _this.props);
75
+ var _this$props = _this.props,
76
+ product = _this$props.product,
77
+ packageVersion = _this$props.packageVersion,
78
+ packageName = _this$props.packageName,
79
+ labels = _this$props.labels;
80
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, product !== undefined && {
81
+ product: product
82
+ }), packageVersion !== undefined && {
83
+ packageVersion: packageVersion
84
+ }), packageName !== undefined && {
85
+ packageName: packageName
86
+ }), labels !== undefined && {
87
+ labels: labels
88
+ });
86
89
  });
87
90
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "collectFeedback", function () {
88
91
  if (_this.props.product === 'bitbucket') {
@@ -99,7 +102,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
99
102
  });
100
103
  });
101
104
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openJiraIssueCollector", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
102
- var _this$props$api, _window$localStorage$, _basePluginState$cont;
105
+ var _this$props$api, _window$localStorage$, _basePluginState$cont, _this$props$api2;
103
106
  var basePluginState, sessionId, contentId, tabId;
104
107
  return _regenerator.default.wrap(function _callee$(_context) {
105
108
  while (1) switch (_context.prev = _context.next) {
@@ -113,7 +116,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
113
116
  contentId = basePluginState === null || basePluginState === void 0 || (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
114
117
  tabId = window.sessionStorage['awc.tab.id'];
115
118
  _context.next = 7;
116
- return (0, _feedbackDialog.openFeedbackDialog)(_objectSpread(_objectSpread({}, _this.getFeedbackInfo()), {}, {
119
+ return (_this$props$api2 = _this.props.api) === null || _this$props$api2 === void 0 || (_this$props$api2 = _this$props$api2.feedbackDialog) === null || _this$props$api2 === void 0 ? void 0 : _this$props$api2.actions.openFeedbackDialog(_objectSpread(_objectSpread({}, _this.getFeedbackInfo()), {}, {
117
120
  sessionId: sessionId,
118
121
  contentId: contentId,
119
122
  tabId: tabId
@@ -154,10 +157,10 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
154
157
  (0, _createClass2.default)(ToolbarFeedbackInternal, [{
155
158
  key: "render",
156
159
  value: function render() {
157
- var _this$props = this.props,
158
- popupsMountPoint = _this$props.popupsMountPoint,
159
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
160
- popupsScrollableElement = _this$props.popupsScrollableElement;
160
+ var _this$props2 = this.props,
161
+ popupsMountPoint = _this$props2.popupsMountPoint,
162
+ popupsBoundariesElement = _this$props2.popupsBoundariesElement,
163
+ popupsScrollableElement = _this$props2.popupsScrollableElement;
161
164
  var iconBefore = this.state.jiraIssueCollectorScriptLoading ? (0, _react.jsx)(_spinner.default, null) : undefined;
162
165
 
163
166
  // JIRA issue collector script is using jQuery internally
@@ -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 = "190.1.27";
8
+ var version = exports.version = "190.1.28";
@@ -1,7 +1,6 @@
1
1
  export { default as collabEditPlugin } from './collab-edit';
2
2
  export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
- export { default as feedbackDialogPlugin } from './feedback-dialog';
5
4
  export { default as findReplacePlugin } from './find-replace';
6
5
  export { default as avatarGroupPlugin } from './avatar-group';
7
6
  export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
@@ -38,10 +38,12 @@ import { alignmentPlugin } from '@atlaskit/editor-plugin-alignment';
38
38
  import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
39
39
  import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
40
40
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
41
- import { avatarGroupPlugin, beforePrimaryToolbarPlugin, collabEditPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
41
+ import { avatarGroupPlugin, beforePrimaryToolbarPlugin, collabEditPlugin, extensionPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
42
+ import { feedbackDialogPlugin } from '@atlaskit/editor-plugin-feedback-dialog';
42
43
  import { shouldForceTracking } from '@atlaskit/editor-common/utils';
43
44
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
44
45
  import { createDefaultPreset } from './default';
46
+ import { version as coreVersion } from '../version-wrapper';
45
47
  /**
46
48
  * Creates a preset with all of the available plugins.
47
49
  * Basis for create-plugins-list and can be used to migrate from Editor -> EditorNext (Presets project)
@@ -192,7 +194,10 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
192
194
  return builder;
193
195
  }).maybeAdd(feedbackDialogPlugin, (plugin, builder) => {
194
196
  if (props.feedbackInfo) {
195
- return builder.add([plugin, props.feedbackInfo]);
197
+ return builder.add([plugin, {
198
+ coreVersion,
199
+ ...props.feedbackInfo
200
+ }]);
196
201
  }
197
202
  return builder;
198
203
  }).maybeAdd(helpDialogPlugin, (plugin, builder) => {
@@ -14,9 +14,7 @@ import withOuterListeners from '../with-outer-listeners';
14
14
  import { wrapper, buttonContent, confirmationPopup, confirmationText, confirmationHeader, confirmationImg } from './styles';
15
15
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
16
16
  import { createDispatch } from '../../event-dispatcher';
17
- import { openFeedbackDialog } from '../../plugins/feedback-dialog';
18
17
  import deprecationWarnings from '../../utils/deprecation-warnings';
19
- import pickBy from '../../utils/pick-by';
20
18
  import { analyticsEventKey } from '@atlaskit/editor-common/utils';
21
19
  import { usePresetContext } from '../../presets/context';
22
20
  const PopupWithOutsideListeners = withOuterListeners(Popup);
@@ -36,7 +34,6 @@ const deprecations = [{
36
34
  description: 'To pass feedback labels use feedbackInfo property – <Editor feedbackInfo={{ labels }} />',
37
35
  type: 'removed'
38
36
  }];
39
- const isNullOrUndefined = attr => attr === null || attr === undefined;
40
37
  class ToolbarFeedbackInternal extends PureComponent {
41
38
  constructor(props) {
42
39
  super(props);
@@ -53,8 +50,26 @@ class ToolbarFeedbackInternal extends PureComponent {
53
50
  });
54
51
  // Create a FeedbackInfo instance from props.
55
52
  _defineProperty(this, "getFeedbackInfo", () => {
56
- const isFeedbackInfoAttr = attr => ['product', 'packageVersion', 'packageName', 'labels'].indexOf(attr) >= 0;
57
- return pickBy((key, value) => isFeedbackInfoAttr(key) && !isNullOrUndefined(value), this.props);
53
+ const {
54
+ product,
55
+ packageVersion,
56
+ packageName,
57
+ labels
58
+ } = this.props;
59
+ return {
60
+ ...(product !== undefined && {
61
+ product
62
+ }),
63
+ ...(packageVersion !== undefined && {
64
+ packageVersion
65
+ }),
66
+ ...(packageName !== undefined && {
67
+ packageName
68
+ }),
69
+ ...(labels !== undefined && {
70
+ labels
71
+ })
72
+ };
58
73
  });
59
74
  _defineProperty(this, "collectFeedback", () => {
60
75
  if (this.props.product === 'bitbucket') {
@@ -71,7 +86,7 @@ class ToolbarFeedbackInternal extends PureComponent {
71
86
  });
72
87
  });
73
88
  _defineProperty(this, "openJiraIssueCollector", async () => {
74
- var _this$props$api, _this$props$api$base, _window$localStorage$, _basePluginState$cont;
89
+ var _this$props$api, _this$props$api$base, _window$localStorage$, _basePluginState$cont, _this$props$api2, _this$props$api2$feed;
75
90
  this.setState({
76
91
  jiraIssueCollectorScriptLoading: true,
77
92
  showOptOutOption: false
@@ -80,12 +95,12 @@ class ToolbarFeedbackInternal extends PureComponent {
80
95
  const sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
81
96
  const contentId = basePluginState === null || basePluginState === void 0 ? void 0 : (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
82
97
  const tabId = window.sessionStorage['awc.tab.id'];
83
- await openFeedbackDialog({
98
+ await ((_this$props$api2 = this.props.api) === null || _this$props$api2 === void 0 ? void 0 : (_this$props$api2$feed = _this$props$api2.feedbackDialog) === null || _this$props$api2$feed === void 0 ? void 0 : _this$props$api2$feed.actions.openFeedbackDialog({
84
99
  ...this.getFeedbackInfo(),
85
100
  sessionId,
86
101
  contentId,
87
102
  tabId
88
- });
103
+ }));
89
104
  this.setState({
90
105
  jiraIssueCollectorScriptLoading: false
91
106
  });
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "190.1.27";
2
+ export const version = "190.1.28";
@@ -1,7 +1,6 @@
1
1
  export { default as collabEditPlugin } from './collab-edit';
2
2
  export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
- export { default as feedbackDialogPlugin } from './feedback-dialog';
5
4
  export { default as findReplacePlugin } from './find-replace';
6
5
  export { default as avatarGroupPlugin } from './avatar-group';
7
6
  export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
@@ -42,10 +42,12 @@ import { alignmentPlugin } from '@atlaskit/editor-plugin-alignment';
42
42
  import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
43
43
  import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
44
44
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
45
- import { avatarGroupPlugin, beforePrimaryToolbarPlugin, collabEditPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
45
+ import { avatarGroupPlugin, beforePrimaryToolbarPlugin, collabEditPlugin, extensionPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
46
+ import { feedbackDialogPlugin } from '@atlaskit/editor-plugin-feedback-dialog';
46
47
  import { shouldForceTracking } from '@atlaskit/editor-common/utils';
47
48
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
48
49
  import { createDefaultPreset } from './default';
50
+ import { version as coreVersion } from '../version-wrapper';
49
51
  /**
50
52
  * Creates a preset with all of the available plugins.
51
53
  * Basis for create-plugins-list and can be used to migrate from Editor -> EditorNext (Presets project)
@@ -196,7 +198,9 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
196
198
  return builder;
197
199
  }).maybeAdd(feedbackDialogPlugin, function (plugin, builder) {
198
200
  if (props.feedbackInfo) {
199
- return builder.add([plugin, props.feedbackInfo]);
201
+ return builder.add([plugin, _objectSpread({
202
+ coreVersion: coreVersion
203
+ }, props.feedbackInfo)]);
200
204
  }
201
205
  return builder;
202
206
  }).maybeAdd(helpDialogPlugin, function (plugin, builder) {
@@ -26,9 +26,7 @@ import withOuterListeners from '../with-outer-listeners';
26
26
  import { wrapper, buttonContent, confirmationPopup, confirmationText, confirmationHeader, confirmationImg } from './styles';
27
27
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
28
28
  import { createDispatch } from '../../event-dispatcher';
29
- import { openFeedbackDialog } from '../../plugins/feedback-dialog';
30
29
  import deprecationWarnings from '../../utils/deprecation-warnings';
31
- import pickBy from '../../utils/pick-by';
32
30
  import { analyticsEventKey } from '@atlaskit/editor-common/utils';
33
31
  import { usePresetContext } from '../../presets/context';
34
32
  var PopupWithOutsideListeners = withOuterListeners(Popup);
@@ -48,9 +46,6 @@ var deprecations = [{
48
46
  description: 'To pass feedback labels use feedbackInfo property – <Editor feedbackInfo={{ labels }} />',
49
47
  type: 'removed'
50
48
  }];
51
- var isNullOrUndefined = function isNullOrUndefined(attr) {
52
- return attr === null || attr === undefined;
53
- };
54
49
  var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
55
50
  _inherits(ToolbarFeedbackInternal, _PureComponent);
56
51
  var _super = _createSuper(ToolbarFeedbackInternal);
@@ -71,12 +66,20 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
71
66
  });
72
67
  // Create a FeedbackInfo instance from props.
73
68
  _defineProperty(_assertThisInitialized(_this), "getFeedbackInfo", function () {
74
- var isFeedbackInfoAttr = function isFeedbackInfoAttr(attr) {
75
- return ['product', 'packageVersion', 'packageName', 'labels'].indexOf(attr) >= 0;
76
- };
77
- return pickBy(function (key, value) {
78
- return isFeedbackInfoAttr(key) && !isNullOrUndefined(value);
79
- }, _this.props);
69
+ var _this$props = _this.props,
70
+ product = _this$props.product,
71
+ packageVersion = _this$props.packageVersion,
72
+ packageName = _this$props.packageName,
73
+ labels = _this$props.labels;
74
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, product !== undefined && {
75
+ product: product
76
+ }), packageVersion !== undefined && {
77
+ packageVersion: packageVersion
78
+ }), packageName !== undefined && {
79
+ packageName: packageName
80
+ }), labels !== undefined && {
81
+ labels: labels
82
+ });
80
83
  });
81
84
  _defineProperty(_assertThisInitialized(_this), "collectFeedback", function () {
82
85
  if (_this.props.product === 'bitbucket') {
@@ -93,7 +96,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
93
96
  });
94
97
  });
95
98
  _defineProperty(_assertThisInitialized(_this), "openJiraIssueCollector", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
96
- var _this$props$api, _window$localStorage$, _basePluginState$cont;
99
+ var _this$props$api, _window$localStorage$, _basePluginState$cont, _this$props$api2;
97
100
  var basePluginState, sessionId, contentId, tabId;
98
101
  return _regeneratorRuntime.wrap(function _callee$(_context) {
99
102
  while (1) switch (_context.prev = _context.next) {
@@ -107,7 +110,7 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
107
110
  contentId = basePluginState === null || basePluginState === void 0 || (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
108
111
  tabId = window.sessionStorage['awc.tab.id'];
109
112
  _context.next = 7;
110
- return openFeedbackDialog(_objectSpread(_objectSpread({}, _this.getFeedbackInfo()), {}, {
113
+ return (_this$props$api2 = _this.props.api) === null || _this$props$api2 === void 0 || (_this$props$api2 = _this$props$api2.feedbackDialog) === null || _this$props$api2 === void 0 ? void 0 : _this$props$api2.actions.openFeedbackDialog(_objectSpread(_objectSpread({}, _this.getFeedbackInfo()), {}, {
111
114
  sessionId: sessionId,
112
115
  contentId: contentId,
113
116
  tabId: tabId
@@ -148,10 +151,10 @@ var ToolbarFeedbackInternal = /*#__PURE__*/function (_PureComponent) {
148
151
  _createClass(ToolbarFeedbackInternal, [{
149
152
  key: "render",
150
153
  value: function render() {
151
- var _this$props = this.props,
152
- popupsMountPoint = _this$props.popupsMountPoint,
153
- popupsBoundariesElement = _this$props.popupsBoundariesElement,
154
- popupsScrollableElement = _this$props.popupsScrollableElement;
154
+ var _this$props2 = this.props,
155
+ popupsMountPoint = _this$props2.popupsMountPoint,
156
+ popupsBoundariesElement = _this$props2.popupsBoundariesElement,
157
+ popupsScrollableElement = _this$props2.popupsScrollableElement;
155
158
  var iconBefore = this.state.jiraIssueCollectorScriptLoading ? jsx(Spinner, null) : undefined;
156
159
 
157
160
  // JIRA issue collector script is using jQuery internally
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "190.1.27";
2
+ export var version = "190.1.28";
@@ -2,7 +2,8 @@
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { EditorProps } from './types/editor-props';
5
- export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
5
+ export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
6
+ export type { FeedbackInfo } from '@atlaskit/editor-common/types';
6
7
  export default class Editor extends React.Component<EditorProps> {
7
8
  static defaultProps: EditorProps;
8
9
  constructor(props: EditorProps);
@@ -1,7 +1,6 @@
1
1
  export { default as collabEditPlugin } from './collab-edit';
2
2
  export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
- export { default as feedbackDialogPlugin } from './feedback-dialog';
5
4
  export { default as findReplacePlugin } from './find-replace';
6
5
  export { default as avatarGroupPlugin } from './avatar-group';
7
6
  export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
@@ -6,7 +6,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
6
6
  import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
7
7
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
8
8
  import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
9
- import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions, QuickInsertOptions } from '@atlaskit/editor-common/types';
9
+ import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions, QuickInsertOptions, FeedbackInfo } from '@atlaskit/editor-common/types';
10
10
  import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
11
11
  import type { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
12
12
  import type { MentionProvider } from '@atlaskit/mention/resource';
@@ -37,15 +37,6 @@ export type ReactComponents = ReactElement<any> | ReactElement<any>[];
37
37
  type ExtensionProviders = (ExtensionProvider | Promise<ExtensionProvider>)[];
38
38
  type ExtensionProvidersWithEditorAction = (editorActions?: EditorActions) => ExtensionProviders;
39
39
  export type ExtensionProvidersProp = ExtensionProviders | ExtensionProvidersWithEditorAction;
40
- export type FeedbackInfo = {
41
- product?: string;
42
- packageVersion?: string;
43
- packageName?: string;
44
- labels?: Array<string>;
45
- sessionId?: string;
46
- contentId?: string;
47
- tabId?: string;
48
- };
49
40
  export type BeforeAndAfterToolbarComponents = {
50
41
  before: ReactComponents;
51
42
  after: ReactComponents;
@@ -3,7 +3,7 @@ export type { EditorInstance } from './editor-instance';
3
3
  export type { EditorConfig } from './editor-config';
4
4
  export type { NextEditorPlugin, EditorPlugin, PluginsOptions, } from './editor-plugin';
5
5
  export type { EditorReactContext } from './editor-react-context';
6
- export type { EditorProps, FeedbackInfo, ReactComponents, ExtensionProvidersProp, PrimaryToolbarComponents, ContentComponents, } from './editor-props';
6
+ export type { EditorProps, ReactComponents, ExtensionProvidersProp, PrimaryToolbarComponents, ContentComponents, } from './editor-props';
7
7
  export type { EditorAppearanceComponentProps } from './editor-appearance-component';
8
8
  export type { Command, CommandDispatch } from './command';
9
9
  export type { MessageDescriptor } from './i18n';
@@ -2,7 +2,8 @@
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { EditorProps } from './types/editor-props';
5
- export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, FeedbackInfo, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
5
+ export type { AllowedBlockTypes, Command, CommandDispatch, DomAtPos, EditorAppearance, EditorAppearanceComponentProps, EditorConfig, EditorInstance, EditorPlugin, EditorProps, ExtensionConfig, ExtensionProvidersProp, MarkConfig, MessageDescriptor, NodeConfig, NodeViewConfig, PluginsOptions, PMPlugin, PMPluginCreateConfig, PMPluginFactory, PMPluginFactoryParams, ReactComponents, ToolbarUIComponentFactory, ToolbarUiComponentFactoryParams, UIComponentFactory, UiComponentFactoryParams, } from './types';
6
+ export type { FeedbackInfo } from '@atlaskit/editor-common/types';
6
7
  export default class Editor extends React.Component<EditorProps> {
7
8
  static defaultProps: EditorProps;
8
9
  constructor(props: EditorProps);
@@ -1,7 +1,6 @@
1
1
  export { default as collabEditPlugin } from './collab-edit';
2
2
  export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
- export { default as feedbackDialogPlugin } from './feedback-dialog';
5
4
  export { default as findReplacePlugin } from './find-replace';
6
5
  export { default as avatarGroupPlugin } from './avatar-group';
7
6
  export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
@@ -6,7 +6,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
6
6
  import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
7
7
  import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
8
8
  import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
9
- import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions, QuickInsertOptions } from '@atlaskit/editor-common/types';
9
+ import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions, QuickInsertOptions, FeedbackInfo } from '@atlaskit/editor-common/types';
10
10
  import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
11
11
  import type { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
12
12
  import type { MentionProvider } from '@atlaskit/mention/resource';
@@ -37,15 +37,6 @@ export type ReactComponents = ReactElement<any> | ReactElement<any>[];
37
37
  type ExtensionProviders = (ExtensionProvider | Promise<ExtensionProvider>)[];
38
38
  type ExtensionProvidersWithEditorAction = (editorActions?: EditorActions) => ExtensionProviders;
39
39
  export type ExtensionProvidersProp = ExtensionProviders | ExtensionProvidersWithEditorAction;
40
- export type FeedbackInfo = {
41
- product?: string;
42
- packageVersion?: string;
43
- packageName?: string;
44
- labels?: Array<string>;
45
- sessionId?: string;
46
- contentId?: string;
47
- tabId?: string;
48
- };
49
40
  export type BeforeAndAfterToolbarComponents = {
50
41
  before: ReactComponents;
51
42
  after: ReactComponents;
@@ -3,7 +3,7 @@ export type { EditorInstance } from './editor-instance';
3
3
  export type { EditorConfig } from './editor-config';
4
4
  export type { NextEditorPlugin, EditorPlugin, PluginsOptions, } from './editor-plugin';
5
5
  export type { EditorReactContext } from './editor-react-context';
6
- export type { EditorProps, FeedbackInfo, ReactComponents, ExtensionProvidersProp, PrimaryToolbarComponents, ContentComponents, } from './editor-props';
6
+ export type { EditorProps, ReactComponents, ExtensionProvidersProp, PrimaryToolbarComponents, ContentComponents, } from './editor-props';
7
7
  export type { EditorAppearanceComponentProps } from './editor-appearance-component';
8
8
  export type { Command, CommandDispatch } from './command';
9
9
  export type { MessageDescriptor } from './i18n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "190.1.27",
3
+ "version": "190.1.28",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/checkbox": "^13.0.0",
53
53
  "@atlaskit/date": "^0.10.0",
54
54
  "@atlaskit/datetime-picker": "^13.0.3",
55
- "@atlaskit/editor-common": "^76.30.0",
55
+ "@atlaskit/editor-common": "^76.31.0",
56
56
  "@atlaskit/editor-json-transformer": "^8.10.0",
57
57
  "@atlaskit/editor-plugin-alignment": "^0.1.0",
58
58
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
@@ -81,6 +81,7 @@
81
81
  "@atlaskit/editor-plugin-expand": "^0.3.0",
82
82
  "@atlaskit/editor-plugin-extension": "^0.4.0",
83
83
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
84
+ "@atlaskit/editor-plugin-feedback-dialog": "^0.1.0",
84
85
  "@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
85
86
  "@atlaskit/editor-plugin-focus": "^0.2.0",
86
87
  "@atlaskit/editor-plugin-fragment": "^0.1.0",
@@ -93,7 +94,7 @@
93
94
  "@atlaskit/editor-plugin-indentation": "^0.2.0",
94
95
  "@atlaskit/editor-plugin-insert-block": "^0.2.0",
95
96
  "@atlaskit/editor-plugin-layout": "^0.1.0",
96
- "@atlaskit/editor-plugin-list": "^3.0.0",
97
+ "@atlaskit/editor-plugin-list": "^3.1.0",
97
98
  "@atlaskit/editor-plugin-loom": "^0.2.0",
98
99
  "@atlaskit/editor-plugin-max-content-size": "^0.1.0",
99
100
  "@atlaskit/editor-plugin-media": "^0.9.0",
@@ -174,7 +175,7 @@
174
175
  "@af/visual-regression": "*",
175
176
  "@atlaskit/analytics-listeners": "^8.7.0",
176
177
  "@atlaskit/code": "^15.1.0",
177
- "@atlaskit/collab-provider": "9.20.7",
178
+ "@atlaskit/collab-provider": "9.21.0",
178
179
  "@atlaskit/dropdown-menu": "^12.1.0",
179
180
  "@atlaskit/editor-extension-dropbox": "^0.4.0",
180
181
  "@atlaskit/editor-palette": "1.5.2",
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /**
8
- * Inspired from:
9
- * https://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript
10
- */
11
- var getBrowserInfo = function getBrowserInfo(nAgt) {
12
- var browserName;
13
- var browserVersion;
14
- var nameOffset;
15
- var verOffset;
16
- var index;
17
-
18
- // In Opera 15+, version is after "OPR/"
19
- if ((verOffset = nAgt.indexOf('OPR/')) !== -1) {
20
- browserName = 'Opera';
21
- browserVersion = nAgt.substring(verOffset + 4);
22
- } else if ((verOffset = nAgt.indexOf('Opera')) !== -1) {
23
- // In older Opera, version is after "Opera" or after "Version"
24
- browserName = 'Opera';
25
- if ((verOffset = nAgt.indexOf('Version')) !== -1) {
26
- browserVersion = nAgt.substring(verOffset + 8);
27
- } else {
28
- browserVersion = nAgt.substring(verOffset + 6);
29
- }
30
- } else if ((verOffset = nAgt.indexOf('MSIE')) !== -1) {
31
- // In MSIE, version is after "MSIE" in userAgent
32
- browserName = 'Microsoft Internet Explorer';
33
- browserVersion = nAgt.substring(verOffset + 5);
34
- } else if ((verOffset = nAgt.indexOf('Chrome')) !== -1) {
35
- // In Chrome, version is after "Chrome"
36
- browserName = 'Chrome';
37
- browserVersion = nAgt.substring(verOffset + 7);
38
- } else if ((verOffset = nAgt.indexOf('Safari')) !== -1) {
39
- // In Safari, version is after "Safari" or after "Version"
40
- browserName = 'Safari';
41
- if ((verOffset = nAgt.indexOf('Version')) !== -1) {
42
- browserVersion = nAgt.substring(verOffset + 8);
43
- } else {
44
- browserVersion = nAgt.substring(verOffset + 7);
45
- }
46
- } else if ((verOffset = nAgt.indexOf('Firefox')) !== -1) {
47
- // In Firefox, version is after "Firefox"
48
- browserName = 'Firefox';
49
- browserVersion = nAgt.substring(verOffset + 8);
50
- } else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
51
- // In most other browsers, "name/version" is at the end of userAgent
52
- browserName = nAgt.substring(nameOffset, verOffset);
53
- browserVersion = nAgt.substring(verOffset + 1);
54
- if (browserName.toLowerCase() === browserName.toUpperCase()) {
55
- browserName = navigator.appName;
56
- }
57
- } else {
58
- browserName = navigator.appName;
59
- browserVersion = '' + parseFloat(navigator.appVersion);
60
- }
61
- // trim the versionStr string at semicolon/space if present
62
- if ((index = browserVersion.indexOf(';')) !== -1) {
63
- browserVersion = browserVersion.substring(0, index);
64
- }
65
- if ((index = browserVersion.indexOf(' ')) !== -1) {
66
- browserVersion = browserVersion.substring(0, index);
67
- }
68
- return "".concat(browserName, " ").concat(browserVersion);
69
- };
70
- var _default = exports.default = getBrowserInfo;