@atlaskit/emoji 71.7.4 → 71.7.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/emoji
2
2
 
3
+ ## 71.7.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 71.7.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`2e769066c051f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e769066c051f) -
14
+ Stop propagation to stop Add emoji click closing picker
15
+ - [`400e0ad47f25f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/400e0ad47f25f) -
16
+ Do not close picker on cancel/delete emoji in post update
17
+ - Updated dependencies
18
+
3
19
  ## 71.7.4
4
20
 
5
21
  ### Patch Changes
@@ -12,12 +12,22 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
15
16
  var _reactIntl = require("react-intl");
16
17
  var _i18n = require("../i18n");
17
18
  var _new = _interopRequireDefault(require("@atlaskit/button/new"));
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
20
  var emojiActionsTestId = exports.emojiActionsTestId = 'emoji-actions';
20
21
  var uploadEmojiTestId = exports.uploadEmojiTestId = 'upload-emoji';
22
+ var isRefreshEmojiPickerEnabled = function isRefreshEmojiPickerEnabled() {
23
+ if (!_featureGates.default.initializeCompleted()) {
24
+ return false;
25
+ }
26
+
27
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
28
+ var isEnabled = _featureGates.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
29
+ return isEnabled;
30
+ };
21
31
  var addCustomEmoji = null;
22
32
 
23
33
  // Generic Type for the wrapped functional component
@@ -26,7 +36,7 @@ var AddOwnEmoji = exports.AddOwnEmoji = function AddOwnEmoji(props) {
26
36
  var onOpenUpload = props.onOpenUpload,
27
37
  uploadEnabled = props.uploadEnabled;
28
38
  var handleOpenUpload = (0, _react.useCallback)(function (event) {
29
- if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload')) {
39
+ if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
30
40
  event.preventDefault();
31
41
  event.stopPropagation();
32
42
  }
@@ -115,7 +115,7 @@ var AddOwnEmoji = exports.AddOwnEmoji = function AddOwnEmoji(props) {
115
115
  var onOpenUpload = props.onOpenUpload,
116
116
  uploadEnabled = props.uploadEnabled;
117
117
  var handleOpenUpload = (0, _react.useCallback)(function (event) {
118
- if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload')) {
118
+ if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
119
119
  event.preventDefault();
120
120
  event.stopPropagation();
121
121
  }
@@ -56,7 +56,13 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
56
56
  var _this;
57
57
  (0, _classCallCheck2.default)(this, EmojiDeletePreview);
58
58
  _this = _callSuper(this, EmojiDeletePreview, [props]);
59
- (0, _defineProperty2.default)(_this, "onSubmit", function () {
59
+ (0, _defineProperty2.default)(_this, "stopClickPropagationForRefreshEmojiPicker", function (event) {
60
+ if (isRefreshEmojiPickerEnabled()) {
61
+ event === null || event === void 0 || event.stopPropagation();
62
+ }
63
+ });
64
+ (0, _defineProperty2.default)(_this, "onSubmit", function (event) {
65
+ _this.stopClickPropagationForRefreshEmojiPicker(event);
60
66
  var _this$props = _this.props,
61
67
  emoji = _this$props.emoji,
62
68
  onDeleteEmoji = _this$props.onDeleteEmoji,
@@ -77,7 +83,8 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
77
83
  });
78
84
  }
79
85
  });
80
- (0, _defineProperty2.default)(_this, "onCancel", function () {
86
+ (0, _defineProperty2.default)(_this, "onCancel", function (event) {
87
+ _this.stopClickPropagationForRefreshEmojiPicker(event);
81
88
  _this.props.onCloseDelete();
82
89
  });
83
90
  _this.state = {
@@ -409,7 +409,7 @@ var EmojiUploadPicker = function EmojiUploadPicker(props) {
409
409
  }
410
410
  }, [cancelChooseFile, errorOnUpload, onFileLoad]);
411
411
  var cancelUpload = (0, _react.useCallback)(function (event) {
412
- if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload')) {
412
+ if ((0, _platformFeatureFlags.fg)('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
413
413
  event === null || event === void 0 || event.preventDefault();
414
414
  event === null || event === void 0 || event.stopPropagation();
415
415
  }
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
20
20
  actionSubjectId: actionSubjectId,
21
21
  attributes: _objectSpread({
22
22
  packageName: "@atlaskit/emoji",
23
- packageVersion: "71.7.3"
23
+ packageVersion: "71.7.5"
24
24
  }, attributes)
25
25
  };
26
26
  };
@@ -4,11 +4,21 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Fragment, useCallback } from 'react';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
7
8
  import { FormattedMessage } from 'react-intl';
8
9
  import { messages } from '../i18n';
9
10
  import Button from '@atlaskit/button/new';
10
11
  export const emojiActionsTestId = 'emoji-actions';
11
12
  export const uploadEmojiTestId = 'upload-emoji';
13
+ const isRefreshEmojiPickerEnabled = () => {
14
+ if (!FeatureGates.initializeCompleted()) {
15
+ return false;
16
+ }
17
+
18
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
19
+ const isEnabled = FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
20
+ return isEnabled;
21
+ };
12
22
  const addCustomEmoji = null;
13
23
 
14
24
  // Generic Type for the wrapped functional component
@@ -19,7 +29,7 @@ export const AddOwnEmoji = props => {
19
29
  uploadEnabled
20
30
  } = props;
21
31
  const handleOpenUpload = useCallback(event => {
22
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
32
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
23
33
  event.preventDefault();
24
34
  event.stopPropagation();
25
35
  }
@@ -106,7 +106,7 @@ export const AddOwnEmoji = props => {
106
106
  uploadEnabled
107
107
  } = props;
108
108
  const handleOpenUpload = useCallback(event => {
109
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
109
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
110
110
  event.preventDefault();
111
111
  event.stopPropagation();
112
112
  }
@@ -38,7 +38,13 @@ const deleteEmojiLabelId = 'fabric.emoji.delete.label.id';
38
38
  class EmojiDeletePreview extends Component {
39
39
  constructor(props) {
40
40
  super(props);
41
- _defineProperty(this, "onSubmit", () => {
41
+ _defineProperty(this, "stopClickPropagationForRefreshEmojiPicker", event => {
42
+ if (isRefreshEmojiPickerEnabled()) {
43
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
44
+ }
45
+ });
46
+ _defineProperty(this, "onSubmit", event => {
47
+ this.stopClickPropagationForRefreshEmojiPicker(event);
42
48
  const {
43
49
  emoji,
44
50
  onDeleteEmoji,
@@ -60,7 +66,8 @@ class EmojiDeletePreview extends Component {
60
66
  });
61
67
  }
62
68
  });
63
- _defineProperty(this, "onCancel", () => {
69
+ _defineProperty(this, "onCancel", event => {
70
+ this.stopClickPropagationForRefreshEmojiPicker(event);
64
71
  this.props.onCloseDelete();
65
72
  });
66
73
  this.state = {
@@ -360,7 +360,7 @@ const EmojiUploadPicker = props => {
360
360
  }
361
361
  }, [cancelChooseFile, errorOnUpload, onFileLoad]);
362
362
  const cancelUpload = useCallback(event => {
363
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
363
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
364
364
  event === null || event === void 0 ? void 0 : event.preventDefault();
365
365
  event === null || event === void 0 ? void 0 : event.stopPropagation();
366
366
  }
@@ -9,7 +9,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
9
9
  actionSubjectId,
10
10
  attributes: {
11
11
  packageName: "@atlaskit/emoji",
12
- packageVersion: "71.7.3",
12
+ packageVersion: "71.7.5",
13
13
  ...attributes
14
14
  }
15
15
  });
@@ -4,11 +4,21 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Fragment, useCallback } from 'react';
6
6
  import { fg } from '@atlaskit/platform-feature-flags';
7
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
7
8
  import { FormattedMessage } from 'react-intl';
8
9
  import { messages } from '../i18n';
9
10
  import Button from '@atlaskit/button/new';
10
11
  export var emojiActionsTestId = 'emoji-actions';
11
12
  export var uploadEmojiTestId = 'upload-emoji';
13
+ var isRefreshEmojiPickerEnabled = function isRefreshEmojiPickerEnabled() {
14
+ if (!FeatureGates.initializeCompleted()) {
15
+ return false;
16
+ }
17
+
18
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
19
+ var isEnabled = FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
20
+ return isEnabled;
21
+ };
12
22
  var addCustomEmoji = null;
13
23
 
14
24
  // Generic Type for the wrapped functional component
@@ -17,7 +27,7 @@ export var AddOwnEmoji = function AddOwnEmoji(props) {
17
27
  var onOpenUpload = props.onOpenUpload,
18
28
  uploadEnabled = props.uploadEnabled;
19
29
  var handleOpenUpload = useCallback(function (event) {
20
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
30
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
21
31
  event.preventDefault();
22
32
  event.stopPropagation();
23
33
  }
@@ -106,7 +106,7 @@ export var AddOwnEmoji = function AddOwnEmoji(props) {
106
106
  var onOpenUpload = props.onOpenUpload,
107
107
  uploadEnabled = props.uploadEnabled;
108
108
  var handleOpenUpload = useCallback(function (event) {
109
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
109
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
110
110
  event.preventDefault();
111
111
  event.stopPropagation();
112
112
  }
@@ -47,7 +47,13 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
47
47
  var _this;
48
48
  _classCallCheck(this, EmojiDeletePreview);
49
49
  _this = _callSuper(this, EmojiDeletePreview, [props]);
50
- _defineProperty(_this, "onSubmit", function () {
50
+ _defineProperty(_this, "stopClickPropagationForRefreshEmojiPicker", function (event) {
51
+ if (isRefreshEmojiPickerEnabled()) {
52
+ event === null || event === void 0 || event.stopPropagation();
53
+ }
54
+ });
55
+ _defineProperty(_this, "onSubmit", function (event) {
56
+ _this.stopClickPropagationForRefreshEmojiPicker(event);
51
57
  var _this$props = _this.props,
52
58
  emoji = _this$props.emoji,
53
59
  onDeleteEmoji = _this$props.onDeleteEmoji,
@@ -68,7 +74,8 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
68
74
  });
69
75
  }
70
76
  });
71
- _defineProperty(_this, "onCancel", function () {
77
+ _defineProperty(_this, "onCancel", function (event) {
78
+ _this.stopClickPropagationForRefreshEmojiPicker(event);
72
79
  _this.props.onCloseDelete();
73
80
  });
74
81
  _this.state = {
@@ -401,7 +401,7 @@ var EmojiUploadPicker = function EmojiUploadPicker(props) {
401
401
  }
402
402
  }, [cancelChooseFile, errorOnUpload, onFileLoad]);
403
403
  var cancelUpload = useCallback(function (event) {
404
- if (fg('platform_emoji_keep_picker_open_on_upload')) {
404
+ if (fg('platform_emoji_keep_picker_open_on_upload') || isRefreshEmojiPickerEnabled()) {
405
405
  event === null || event === void 0 || event.preventDefault();
406
406
  event === null || event === void 0 || event.stopPropagation();
407
407
  }
@@ -14,7 +14,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
14
14
  actionSubjectId: actionSubjectId,
15
15
  attributes: _objectSpread({
16
16
  packageName: "@atlaskit/emoji",
17
- packageVersion: "71.7.3"
17
+ packageVersion: "71.7.5"
18
18
  }, attributes)
19
19
  };
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "71.7.4",
3
+ "version": "71.7.6",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,18 +30,18 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@atlaskit/afm-i18n-platform-elements-emoji": "2.168.0",
33
- "@atlaskit/analytics-next": "^12.1.0",
33
+ "@atlaskit/analytics-next": "^12.2.0",
34
34
  "@atlaskit/browser-apis": "^1.1.0",
35
35
  "@atlaskit/button": "^24.3.0",
36
36
  "@atlaskit/css": "^1.0.0",
37
37
  "@atlaskit/feature-gate-js-client": "^6.0.0",
38
38
  "@atlaskit/form": "^16.1.0",
39
39
  "@atlaskit/heading": "^6.1.0",
40
- "@atlaskit/icon": "^36.1.0",
41
- "@atlaskit/icon-lab": "^7.2.0",
40
+ "@atlaskit/icon": "^36.2.0",
41
+ "@atlaskit/icon-lab": "^7.3.0",
42
42
  "@atlaskit/image": "^4.1.0",
43
43
  "@atlaskit/logo": "^21.3.0",
44
- "@atlaskit/media-client": "^37.1.0",
44
+ "@atlaskit/media-client": "^37.2.0",
45
45
  "@atlaskit/media-client-react": "^6.1.0",
46
46
  "@atlaskit/platform-feature-flags": "^2.0.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
@@ -50,8 +50,8 @@
50
50
  "@atlaskit/spinner": "^20.1.0",
51
51
  "@atlaskit/textfield": "^9.1.0",
52
52
  "@atlaskit/theme": "^26.1.0",
53
- "@atlaskit/tmp-editor-statsig": "^120.1.0",
54
- "@atlaskit/tokens": "^15.3.0",
53
+ "@atlaskit/tmp-editor-statsig": "^121.0.0",
54
+ "@atlaskit/tokens": "^15.4.0",
55
55
  "@atlaskit/tooltip": "^23.1.0",
56
56
  "@atlaskit/ufo": "^1.0.0",
57
57
  "@atlaskit/util-service-support": "^7.1.0",