@atlaskit/emoji 64.2.0 → 64.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/api/EmojiResource.js +36 -1
- package/dist/cjs/api/media/SiteEmojiResource.js +10 -2
- package/dist/cjs/components/common/CachingEmoji.js +38 -12
- package/dist/cjs/components/common/DeleteButton.js +9 -13
- package/dist/cjs/components/common/Emoji.js +25 -36
- package/dist/cjs/components/common/EmojiActions.js +26 -31
- package/dist/cjs/components/common/EmojiButton.js +7 -7
- package/dist/cjs/components/common/EmojiDeletePreview.js +20 -26
- package/dist/cjs/components/common/EmojiErrorMessage.js +10 -14
- package/dist/cjs/components/common/EmojiPlaceholder.js +5 -12
- package/dist/cjs/components/common/EmojiPreview.js +20 -40
- package/dist/cjs/components/common/EmojiPreviewComponent.js +34 -0
- package/dist/cjs/components/common/EmojiUploadPicker.js +26 -24
- package/dist/cjs/components/common/EmojiUploadPreview.js +22 -28
- package/dist/cjs/components/common/RecordSelectionDefault.js +8 -2
- package/dist/cjs/components/common/ResourcedEmoji.js +25 -9
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +33 -11
- package/dist/cjs/components/common/RetryableButton.js +12 -18
- package/dist/cjs/components/common/Scrollable.js +5 -10
- package/dist/cjs/components/common/UfoErrorBoundary.js +52 -0
- package/dist/cjs/components/common/UploadEmoji.js +8 -0
- package/dist/cjs/components/common/styles.js +210 -266
- package/dist/cjs/components/picker/CategorySelector.js +13 -12
- package/dist/cjs/components/picker/EmojiPicker.js +17 -6
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +8 -14
- package/dist/cjs/components/picker/EmojiPickerComponent.js +51 -30
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +8 -12
- package/dist/cjs/components/picker/EmojiPickerFooter.js +8 -14
- package/dist/cjs/components/picker/EmojiPickerList.js +28 -9
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +10 -8
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +9 -15
- package/dist/cjs/components/picker/styles.js +113 -161
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +40 -24
- package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +10 -13
- package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +17 -22
- package/dist/cjs/components/typeahead/styles.js +17 -19
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +22 -15
- package/dist/cjs/components/uploader/styles.js +4 -4
- package/dist/cjs/index.js +9 -3
- package/dist/cjs/types.js +12 -2
- package/dist/cjs/util/{analytics.js → analytics/analytics.js} +12 -10
- package/dist/cjs/util/analytics/index.js +205 -0
- package/dist/cjs/util/analytics/samplingUfo.js +278 -0
- package/dist/cjs/util/analytics/ufoExperiences.js +46 -0
- package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +49 -0
- package/dist/cjs/util/constants.js +10 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiResource.js +28 -1
- package/dist/es2019/api/media/SiteEmojiResource.js +10 -2
- package/dist/es2019/components/common/CachingEmoji.js +34 -12
- package/dist/es2019/components/common/DeleteButton.js +8 -6
- package/dist/es2019/components/common/Emoji.js +27 -36
- package/dist/es2019/components/common/EmojiActions.js +26 -24
- package/dist/es2019/components/common/EmojiButton.js +6 -6
- package/dist/es2019/components/common/EmojiDeletePreview.js +20 -20
- package/dist/es2019/components/common/EmojiErrorMessage.js +9 -8
- package/dist/es2019/components/common/EmojiPlaceholder.js +5 -8
- package/dist/es2019/components/common/EmojiPreview.js +19 -35
- package/dist/es2019/components/common/EmojiPreviewComponent.js +21 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +25 -22
- package/dist/es2019/components/common/EmojiUploadPreview.js +22 -22
- package/dist/es2019/components/common/RecordSelectionDefault.js +9 -2
- package/dist/es2019/components/common/ResourcedEmoji.js +22 -5
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +32 -11
- package/dist/es2019/components/common/RetryableButton.js +10 -11
- package/dist/es2019/components/common/Scrollable.js +6 -10
- package/dist/es2019/components/common/UfoErrorBoundary.js +11 -0
- package/dist/es2019/components/common/UploadEmoji.js +4 -0
- package/dist/es2019/components/common/styles.js +195 -262
- package/dist/es2019/components/picker/CategorySelector.js +15 -12
- package/dist/es2019/components/picker/EmojiPicker.js +15 -6
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +8 -8
- package/dist/es2019/components/picker/EmojiPickerComponent.js +46 -22
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +8 -7
- package/dist/es2019/components/picker/EmojiPickerFooter.js +8 -8
- package/dist/es2019/components/picker/EmojiPickerList.js +28 -8
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +11 -8
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +10 -8
- package/dist/es2019/components/picker/styles.js +112 -160
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +35 -17
- package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +12 -13
- package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +18 -19
- package/dist/es2019/components/typeahead/styles.js +14 -15
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +19 -9
- package/dist/es2019/components/uploader/styles.js +4 -4
- package/dist/es2019/index.js +4 -3
- package/dist/es2019/types.js +10 -1
- package/dist/es2019/util/{analytics.js → analytics/analytics.js} +17 -11
- package/dist/es2019/util/analytics/index.js +4 -0
- package/dist/es2019/util/analytics/samplingUfo.js +147 -0
- package/dist/es2019/util/analytics/ufoExperiences.js +34 -0
- package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +39 -0
- package/dist/es2019/util/constants.js +5 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiResource.js +32 -1
- package/dist/esm/api/media/SiteEmojiResource.js +10 -2
- package/dist/esm/components/common/CachingEmoji.js +36 -12
- package/dist/esm/components/common/DeleteButton.js +8 -6
- package/dist/esm/components/common/Emoji.js +26 -29
- package/dist/esm/components/common/EmojiActions.js +26 -25
- package/dist/esm/components/common/EmojiButton.js +6 -6
- package/dist/esm/components/common/EmojiDeletePreview.js +19 -20
- package/dist/esm/components/common/EmojiErrorMessage.js +9 -8
- package/dist/esm/components/common/EmojiPlaceholder.js +5 -8
- package/dist/esm/components/common/EmojiPreview.js +19 -33
- package/dist/esm/components/common/EmojiPreviewComponent.js +20 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +27 -25
- package/dist/esm/components/common/EmojiUploadPreview.js +21 -22
- package/dist/esm/components/common/RecordSelectionDefault.js +6 -3
- package/dist/esm/components/common/ResourcedEmoji.js +22 -9
- package/dist/esm/components/common/ResourcedEmojiComponent.js +32 -10
- package/dist/esm/components/common/RetryableButton.js +11 -12
- package/dist/esm/components/common/Scrollable.js +6 -10
- package/dist/esm/components/common/UfoErrorBoundary.js +38 -0
- package/dist/esm/components/common/UploadEmoji.js +4 -0
- package/dist/esm/components/common/styles.js +192 -242
- package/dist/esm/components/picker/CategorySelector.js +14 -12
- package/dist/esm/components/picker/EmojiPicker.js +13 -6
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +8 -8
- package/dist/esm/components/picker/EmojiPickerComponent.js +47 -22
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +8 -7
- package/dist/esm/components/picker/EmojiPickerFooter.js +8 -8
- package/dist/esm/components/picker/EmojiPickerList.js +29 -8
- package/dist/esm/components/picker/EmojiPickerListSearch.js +10 -8
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +9 -8
- package/dist/esm/components/picker/styles.js +108 -149
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +35 -17
- package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +11 -13
- package/dist/esm/components/typeahead/EmojiTypeAheadList.js +17 -19
- package/dist/esm/components/typeahead/styles.js +14 -14
- package/dist/esm/components/uploader/EmojiUploadComponent.js +19 -9
- package/dist/esm/components/uploader/styles.js +4 -4
- package/dist/esm/index.js +4 -3
- package/dist/esm/types.js +10 -1
- package/dist/esm/util/{analytics.js → analytics/analytics.js} +9 -7
- package/dist/esm/util/analytics/index.js +4 -0
- package/dist/esm/util/analytics/samplingUfo.js +259 -0
- package/dist/esm/util/analytics/ufoExperiences.js +34 -0
- package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +39 -0
- package/dist/esm/util/constants.js +5 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/api/EmojiResource.d.ts +1 -0
- package/dist/types/components/common/CachingEmoji.d.ts +8 -6
- package/dist/types/components/common/EmojiActions.d.ts +2 -3
- package/dist/types/components/common/EmojiDeletePreview.d.ts +3 -3
- package/dist/types/components/common/EmojiErrorMessage.d.ts +2 -1
- package/dist/types/components/common/EmojiPreview.d.ts +2 -3
- package/dist/types/components/common/EmojiPreviewComponent.d.ts +7 -0
- package/dist/types/components/common/EmojiUploadPreview.d.ts +3 -3
- package/dist/types/components/common/ResourcedEmoji.d.ts +2 -0
- package/dist/types/components/common/ResourcedEmojiComponent.d.ts +6 -0
- package/dist/types/components/common/RetryableButton.d.ts +0 -2
- package/dist/types/components/common/UfoErrorBoundary.d.ts +8 -0
- package/dist/types/components/common/styles.d.ts +44 -44
- package/dist/types/components/picker/EmojiPicker.d.ts +2 -3
- package/dist/types/components/picker/EmojiPickerComponent.d.ts +6 -0
- package/dist/types/components/picker/EmojiPickerList.d.ts +10 -0
- package/dist/types/components/picker/styles.d.ts +17 -18
- package/dist/types/components/typeahead/EmojiTypeAheadComponent.d.ts +6 -0
- package/dist/types/components/typeahead/styles.d.ts +8 -7
- package/dist/types/components/uploader/EmojiUploadComponent.d.ts +1 -0
- package/dist/types/components/uploader/styles.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/types.d.ts +6 -0
- package/dist/types/util/{analytics.d.ts → analytics/analytics.d.ts} +7 -7
- package/dist/types/util/analytics/index.d.ts +6 -0
- package/dist/types/util/analytics/samplingUfo.d.ts +31 -0
- package/dist/types/util/analytics/ufoExperiences.d.ts +12 -0
- package/dist/types/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
- package/dist/types/util/constants.d.ts +2 -0
- package/package.json +10 -9
- package/dist/cjs/components/picker/EmojiPickerPreview.js +0 -87
- package/dist/cjs/context/EmojiContext.js +0 -11
- package/dist/cjs/context/EmojiContextProvider.js +0 -22
- package/dist/es2019/components/picker/EmojiPickerPreview.js +0 -43
- package/dist/es2019/context/EmojiContext.js +0 -2
- package/dist/es2019/context/EmojiContextProvider.js +0 -10
- package/dist/esm/components/picker/EmojiPickerPreview.js +0 -67
- package/dist/esm/context/EmojiContext.js +0 -2
- package/dist/esm/context/EmojiContextProvider.js +0 -9
- package/dist/types/components/picker/EmojiPickerPreview.d.ts +0 -9
- package/dist/types/context/EmojiContext.d.ts +0 -4
- package/dist/types/context/EmojiContextProvider.d.ts +0 -7
|
@@ -5,14 +5,16 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { jsx } from '@emotion/core';
|
|
9
10
|
import React from 'react';
|
|
10
11
|
import { shouldUseAltRepresentation } from '../../api/EmojiUtils';
|
|
11
12
|
import { deleteEmojiLabel } from '../../util/constants';
|
|
12
13
|
import { isImageRepresentation, isMediaRepresentation, isSpriteRepresentation, toEmojiId } from '../../util/type-helpers';
|
|
13
14
|
import { leftClick } from '../../util/mouse';
|
|
14
|
-
import * as styles from './styles';
|
|
15
15
|
import DeleteButton from './DeleteButton';
|
|
16
|
+
import { emojiContainer, emojiNodeStyles, commonSelectedStyles, selectOnHoverStyles, emojiSprite, emojiMainStyle, emojiStyles, emojiImage } from './styles';
|
|
17
|
+
import { sampledUfoRenderedEmoji } from '../../util/analytics';
|
|
16
18
|
|
|
17
19
|
var handleMouseDown = function handleMouseDown(props, event) {
|
|
18
20
|
// Clicked emoji delete button
|
|
@@ -79,8 +81,6 @@ var handleImageError = function handleImageError(props, event) {
|
|
|
79
81
|
|
|
80
82
|
|
|
81
83
|
var renderAsSprite = function renderAsSprite(props) {
|
|
82
|
-
var _classes;
|
|
83
|
-
|
|
84
84
|
var emoji = props.emoji,
|
|
85
85
|
fitToHeight = props.fitToHeight,
|
|
86
86
|
selected = props.selected,
|
|
@@ -90,18 +90,15 @@ var renderAsSprite = function renderAsSprite(props) {
|
|
|
90
90
|
shouldBeInteractive = props.shouldBeInteractive;
|
|
91
91
|
var representation = emoji.representation;
|
|
92
92
|
var sprite = representation.sprite;
|
|
93
|
-
var classes = (
|
|
94
|
-
|
|
95
|
-
if (className) {
|
|
96
|
-
classes[className] = true;
|
|
97
|
-
}
|
|
98
|
-
|
|
93
|
+
var classes = "".concat(emojiNodeStyles, " ").concat(selected ? commonSelectedStyles : '', " ").concat(selectOnHover ? selectOnHoverStyles : '', " ").concat(className ? className : '');
|
|
99
94
|
var sizing = {};
|
|
100
95
|
|
|
101
96
|
if (fitToHeight) {
|
|
102
97
|
sizing = {
|
|
103
98
|
width: "".concat(fitToHeight, "px"),
|
|
104
|
-
height: "".concat(fitToHeight, "px")
|
|
99
|
+
height: "".concat(fitToHeight, "px"),
|
|
100
|
+
minHeight: "".concat(fitToHeight, "px"),
|
|
101
|
+
minWidth: "".concat(fitToHeight, "px")
|
|
105
102
|
};
|
|
106
103
|
}
|
|
107
104
|
|
|
@@ -114,14 +111,15 @@ var renderAsSprite = function renderAsSprite(props) {
|
|
|
114
111
|
backgroundSize: "".concat(sprite.column * 100, "% ").concat(sprite.row * 100, "%")
|
|
115
112
|
}, sizing);
|
|
116
113
|
|
|
117
|
-
var emojiNode =
|
|
118
|
-
className:
|
|
114
|
+
var emojiNode = jsx("span", {
|
|
115
|
+
className: emojiSprite,
|
|
119
116
|
style: style
|
|
120
117
|
}, "\xA0");
|
|
121
|
-
return
|
|
118
|
+
return jsx("span", {
|
|
122
119
|
tabIndex: shouldBeInteractive ? 0 : undefined,
|
|
123
120
|
role: shouldBeInteractive ? 'button' : undefined,
|
|
124
|
-
|
|
121
|
+
css: emojiContainer,
|
|
122
|
+
className: classes,
|
|
125
123
|
onKeyPress: function onKeyPress(event) {
|
|
126
124
|
return handleKeyPress(props, event);
|
|
127
125
|
},
|
|
@@ -138,8 +136,6 @@ var renderAsSprite = function renderAsSprite(props) {
|
|
|
138
136
|
|
|
139
137
|
|
|
140
138
|
var renderAsImage = function renderAsImage(props) {
|
|
141
|
-
var _classes2;
|
|
142
|
-
|
|
143
139
|
var emoji = props.emoji,
|
|
144
140
|
fitToHeight = props.fitToHeight,
|
|
145
141
|
selected = props.selected,
|
|
@@ -148,12 +144,7 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
148
144
|
showTooltip = props.showTooltip,
|
|
149
145
|
showDelete = props.showDelete,
|
|
150
146
|
shouldBeInteractive = props.shouldBeInteractive;
|
|
151
|
-
var classes = (
|
|
152
|
-
|
|
153
|
-
if (className) {
|
|
154
|
-
classes[className] = true;
|
|
155
|
-
}
|
|
156
|
-
|
|
147
|
+
var classes = "".concat(emojiMainStyle, " ").concat(emojiNodeStyles, " ").concat(selected ? commonSelectedStyles : '', " ").concat(selectOnHover ? selectOnHoverStyles : '', " ").concat(emojiImage, " ").concat(className ? className : '');
|
|
157
148
|
var width;
|
|
158
149
|
var height;
|
|
159
150
|
var src;
|
|
@@ -172,7 +163,7 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
172
163
|
var deleteButton;
|
|
173
164
|
|
|
174
165
|
if (showDelete) {
|
|
175
|
-
deleteButton =
|
|
166
|
+
deleteButton = jsx(DeleteButton, {
|
|
176
167
|
onClick: function onClick(event) {
|
|
177
168
|
return handleDelete(props, event);
|
|
178
169
|
}
|
|
@@ -191,6 +182,10 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
191
182
|
|
|
192
183
|
var onError = function onError(event) {
|
|
193
184
|
handleImageError(props, event);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
var onLoad = function onLoad() {
|
|
188
|
+
sampledUfoRenderedEmoji(emoji).success();
|
|
194
189
|
}; // Pass src attribute as key to force React to rerender img node since browser does not
|
|
195
190
|
// change preview image until loaded
|
|
196
191
|
// We currently have the following error: property 'loading' does not exist on type 'DetailedHTMLProps<ImgHTMLAttributes, HTMLImageElement>'
|
|
@@ -198,7 +193,7 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
198
193
|
// TODO: remove @ts-ignore for the <img> below when the @types/react will be bumped from v16.8.0 to v16.9.20 or higher.
|
|
199
194
|
|
|
200
195
|
|
|
201
|
-
var emojiNode =
|
|
196
|
+
var emojiNode = jsx("img", _extends({
|
|
202
197
|
// @ts-ignore
|
|
203
198
|
loading: "lazy",
|
|
204
199
|
src: src,
|
|
@@ -211,12 +206,14 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
211
206
|
style: {
|
|
212
207
|
visibility: 'visible'
|
|
213
208
|
},
|
|
214
|
-
onError: onError
|
|
209
|
+
onError: onError,
|
|
210
|
+
onLoad: onLoad
|
|
215
211
|
}, sizing));
|
|
216
|
-
return
|
|
212
|
+
return jsx("span", {
|
|
213
|
+
css: emojiStyles,
|
|
217
214
|
tabIndex: shouldBeInteractive ? 0 : undefined,
|
|
218
215
|
role: shouldBeInteractive ? 'button' : undefined,
|
|
219
|
-
className:
|
|
216
|
+
className: classes,
|
|
220
217
|
onKeyPress: function onKeyPress(event) {
|
|
221
218
|
return handleKeyPress(props, event);
|
|
222
219
|
},
|
|
@@ -232,7 +229,7 @@ var renderAsImage = function renderAsImage(props) {
|
|
|
232
229
|
};
|
|
233
230
|
|
|
234
231
|
export var Emoji = function Emoji(props) {
|
|
235
|
-
var emoji = props.emoji;
|
|
232
|
+
var emoji = props.emoji; // TODO: We always prefer render as image as having accessibility issues with sprite representation
|
|
236
233
|
|
|
237
234
|
if (isSpriteRepresentation(emoji.representation)) {
|
|
238
235
|
return renderAsSprite(props);
|
|
@@ -10,14 +10,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
import
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
import { jsx } from '@emotion/core';
|
|
15
15
|
import { PureComponent } from 'react';
|
|
16
16
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
17
17
|
import EmojiDeletePreview from '../common/EmojiDeletePreview';
|
|
18
18
|
import EmojiUploadPicker from '../common/EmojiUploadPicker';
|
|
19
|
-
import * as styles from './styles';
|
|
20
|
-
import * as footerStyles from '../picker/styles';
|
|
21
19
|
import EmojiPickerListSearch from '../picker/EmojiPickerListSearch';
|
|
22
20
|
import ToneSelector from './ToneSelector';
|
|
23
21
|
import EmojiButton from './EmojiButton';
|
|
@@ -25,6 +23,8 @@ import { messages } from '../i18n';
|
|
|
25
23
|
import AkButton from '@atlaskit/button/standard-button';
|
|
26
24
|
import AddIcon from '@atlaskit/icon/glyph/add';
|
|
27
25
|
import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
|
|
26
|
+
import { addCustomEmoji, addCustomEmojiButton, emojiPickerAddEmoji, emojiToneSelectorContainer } from './styles';
|
|
27
|
+
import { emojiActionsContainerWithBottomShadow, emojiPickerFooter } from '../picker/styles';
|
|
28
28
|
export var EmojiActions = /*#__PURE__*/function (_PureComponent) {
|
|
29
29
|
_inherits(EmojiActions, _PureComponent);
|
|
30
30
|
|
|
@@ -96,13 +96,13 @@ export var EmojiActions = /*#__PURE__*/function (_PureComponent) {
|
|
|
96
96
|
previewEmoji = previewEmoji.skinVariations[(selectedTone || 1) - 1];
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
}, this.state.selectingTone &&
|
|
99
|
+
return jsx("div", {
|
|
100
|
+
css: emojiToneSelectorContainer
|
|
101
|
+
}, this.state.selectingTone && jsx(ToneSelector, {
|
|
102
102
|
emoji: toneEmoji,
|
|
103
103
|
onToneSelected: this.onToneSelected,
|
|
104
104
|
previewEmojiId: previewEmoji.id
|
|
105
|
-
}),
|
|
105
|
+
}), jsx(EmojiButton, {
|
|
106
106
|
ariaExpanded: this.state.selectingTone,
|
|
107
107
|
emoji: previewEmoji,
|
|
108
108
|
selectOnHover: true,
|
|
@@ -126,17 +126,18 @@ export var EmojiActions = /*#__PURE__*/function (_PureComponent) {
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
return
|
|
129
|
+
return jsx("div", {
|
|
130
|
+
css: addCustomEmoji
|
|
131
|
+
}, jsx(FormattedMessage, messages.addCustomEmojiLabel, function (label) {
|
|
132
|
+
return jsx(AkButton, {
|
|
133
133
|
onClick: onOpenUpload,
|
|
134
|
-
iconBefore:
|
|
134
|
+
iconBefore: jsx(AddIcon, {
|
|
135
135
|
label: formatMessage(messages.addCustomEmojiLabel),
|
|
136
136
|
size: "small"
|
|
137
137
|
}),
|
|
138
138
|
appearance: "subtle",
|
|
139
|
-
|
|
139
|
+
css: addCustomEmojiButton,
|
|
140
|
+
className: emojiPickerAddEmoji
|
|
140
141
|
}, label);
|
|
141
142
|
}));
|
|
142
143
|
}
|
|
@@ -155,12 +156,12 @@ export var EmojiActions = /*#__PURE__*/function (_PureComponent) {
|
|
|
155
156
|
emojiToDelete = _this$props3.emojiToDelete,
|
|
156
157
|
onChange = _this$props3.onChange,
|
|
157
158
|
query = _this$props3.query;
|
|
158
|
-
var previewFooterClassnames =
|
|
159
|
+
var previewFooterClassnames = [emojiPickerFooter, emojiActionsContainerWithBottomShadow];
|
|
159
160
|
|
|
160
161
|
if (uploading) {
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
},
|
|
162
|
+
return jsx("div", {
|
|
163
|
+
css: previewFooterClassnames
|
|
164
|
+
}, jsx(EmojiUploadPicker, {
|
|
164
165
|
onUploadCancelled: onUploadCancelled,
|
|
165
166
|
onUploadEmoji: onUploadEmoji,
|
|
166
167
|
onFileChooserClicked: onFileChooserClicked,
|
|
@@ -170,25 +171,25 @@ export var EmojiActions = /*#__PURE__*/function (_PureComponent) {
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
if (emojiToDelete) {
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
},
|
|
174
|
+
return jsx("div", {
|
|
175
|
+
css: previewFooterClassnames
|
|
176
|
+
}, jsx(EmojiDeletePreview, {
|
|
176
177
|
emoji: emojiToDelete,
|
|
177
178
|
onDeleteEmoji: onDeleteEmoji,
|
|
178
179
|
onCloseDelete: onCloseDelete
|
|
179
180
|
}));
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
return
|
|
183
|
-
|
|
183
|
+
return jsx("div", {
|
|
184
|
+
css: previewFooterClassnames,
|
|
184
185
|
onMouseLeave: this.onMouseLeave
|
|
185
|
-
},
|
|
186
|
+
}, jsx("div", {
|
|
186
187
|
style: {
|
|
187
188
|
display: 'flex',
|
|
188
189
|
justifyContent: 'flex-end',
|
|
189
190
|
alignItems: 'center'
|
|
190
191
|
}
|
|
191
|
-
}, !this.state.selectingTone &&
|
|
192
|
+
}, !this.state.selectingTone && jsx(EmojiPickerListSearch, {
|
|
192
193
|
onChange: onChange,
|
|
193
194
|
query: query
|
|
194
195
|
}), this.renderTones()), this.renderAddOwnEmoji());
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/core';
|
|
2
3
|
import React, { forwardRef } from 'react';
|
|
3
|
-
import * as styles from './styles';
|
|
4
4
|
import Emoji from './Emoji';
|
|
5
5
|
import { leftClick } from '../../util/mouse';
|
|
6
|
+
import { emojiButton, hiddenToneButton } from './styles';
|
|
6
7
|
|
|
7
8
|
var handleMouseDown = function handleMouseDown(props, event) {
|
|
8
9
|
var onSelected = props.onSelected;
|
|
@@ -28,11 +29,10 @@ export var EmojiButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
28
29
|
ariaLabelText = props.ariaLabelText,
|
|
29
30
|
ariaExpanded = props.ariaExpanded,
|
|
30
31
|
shouldHideButton = props.shouldHideButton;
|
|
31
|
-
|
|
32
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
32
|
+
return jsx("button", {
|
|
33
33
|
ref: ref,
|
|
34
34
|
"aria-expanded": ariaExpanded,
|
|
35
|
-
|
|
35
|
+
css: shouldHideButton ? hiddenToneButton : emojiButton,
|
|
36
36
|
onMouseDown: function onMouseDown(event) {
|
|
37
37
|
handleMouseDown(props, event);
|
|
38
38
|
},
|
|
@@ -40,7 +40,7 @@ export var EmojiButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
40
40
|
handleKeyPress(props, event);
|
|
41
41
|
},
|
|
42
42
|
"aria-label": ariaLabelText
|
|
43
|
-
},
|
|
43
|
+
}, jsx(Emoji, {
|
|
44
44
|
emoji: emoji,
|
|
45
45
|
selectOnHover: selectOnHover
|
|
46
46
|
}));
|
|
@@ -11,15 +11,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
15
|
+
import { jsx } from '@emotion/core';
|
|
14
16
|
import AkButton from '@atlaskit/button/custom-theme-button';
|
|
15
|
-
import React from 'react';
|
|
16
17
|
import { Component } from 'react';
|
|
17
18
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
18
19
|
import { messages } from '../i18n';
|
|
19
20
|
import CachingEmoji from './CachingEmoji';
|
|
20
21
|
import EmojiErrorMessage from './EmojiErrorMessage';
|
|
21
22
|
import RetryableButton from './RetryableButton';
|
|
22
|
-
import
|
|
23
|
+
import { cancelButton, deleteFooter, deletePreview, deleteText, emojiDeleteErrorMessage, previewButtonGroup } from './styles';
|
|
23
24
|
|
|
24
25
|
var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
|
|
25
26
|
_inherits(EmojiDeletePreview, _Component);
|
|
@@ -88,37 +89,35 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
|
|
|
88
89
|
loading = _this$state.loading,
|
|
89
90
|
error = _this$state.error;
|
|
90
91
|
var formatMessage = intl.formatMessage;
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
},
|
|
92
|
+
return jsx("div", {
|
|
93
|
+
css: deletePreview
|
|
94
|
+
}, jsx("div", {
|
|
95
|
+
css: deleteText
|
|
96
|
+
}, jsx("h5", null, jsx(FormattedMessage, messages.deleteEmojiTitle)), jsx(FormattedMessage, _extends({}, messages.deleteEmojiDescription, {
|
|
96
97
|
values: {
|
|
97
98
|
emojiShortName: emoji.shortName
|
|
98
99
|
}
|
|
99
|
-
}))),
|
|
100
|
-
|
|
101
|
-
},
|
|
100
|
+
}))), jsx("div", {
|
|
101
|
+
css: deleteFooter
|
|
102
|
+
}, jsx(CachingEmoji, {
|
|
102
103
|
emoji: emoji
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
}, error ? !loading ?
|
|
104
|
+
}), jsx("div", {
|
|
105
|
+
css: previewButtonGroup
|
|
106
|
+
}, error ? !loading ? jsx(EmojiErrorMessage, {
|
|
106
107
|
message: formatMessage(messages.deleteEmojiFailed),
|
|
107
|
-
|
|
108
|
+
messageStyles: emojiDeleteErrorMessage,
|
|
108
109
|
tooltip: true
|
|
109
|
-
}) : null : null,
|
|
110
|
-
className: styles.uploadEmojiButton,
|
|
111
|
-
retryClassName: styles.uploadRetryButton,
|
|
110
|
+
}) : null : null, jsx(RetryableButton, {
|
|
112
111
|
label: formatMessage(messages.deleteEmojiLabel),
|
|
113
112
|
onSubmit: this.onSubmit,
|
|
114
113
|
appearance: "danger",
|
|
115
114
|
loading: loading,
|
|
116
115
|
error: error
|
|
117
|
-
}),
|
|
116
|
+
}), jsx(AkButton, {
|
|
118
117
|
appearance: "subtle",
|
|
119
118
|
onClick: this.onCancel,
|
|
120
|
-
|
|
121
|
-
},
|
|
119
|
+
css: cancelButton
|
|
120
|
+
}, jsx(FormattedMessage, messages.cancelLabel)))));
|
|
122
121
|
}
|
|
123
122
|
}]);
|
|
124
123
|
|
|
@@ -8,8 +8,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
import { jsx } from '@emotion/core';
|
|
11
13
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
12
|
-
import React from 'react';
|
|
13
14
|
import { PureComponent } from 'react';
|
|
14
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
16
|
|
|
@@ -27,12 +28,12 @@ var EmojiErrorMessage = /*#__PURE__*/function (_PureComponent) {
|
|
|
27
28
|
_createClass(EmojiErrorMessage, [{
|
|
28
29
|
key: "renderWithTooltip",
|
|
29
30
|
value: function renderWithTooltip() {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
},
|
|
31
|
+
return jsx("div", {
|
|
32
|
+
css: this.props.messageStyles
|
|
33
|
+
}, jsx(Tooltip, {
|
|
33
34
|
content: this.props.message,
|
|
34
35
|
position: "top"
|
|
35
|
-
},
|
|
36
|
+
}, jsx(ErrorIcon, {
|
|
36
37
|
label: "Error",
|
|
37
38
|
size: "medium"
|
|
38
39
|
})));
|
|
@@ -40,9 +41,9 @@ var EmojiErrorMessage = /*#__PURE__*/function (_PureComponent) {
|
|
|
40
41
|
}, {
|
|
41
42
|
key: "renderInline",
|
|
42
43
|
value: function renderInline() {
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
},
|
|
44
|
+
return jsx("div", {
|
|
45
|
+
css: this.props.messageStyles
|
|
46
|
+
}, jsx(ErrorIcon, {
|
|
46
47
|
label: "Error",
|
|
47
48
|
size: "small"
|
|
48
49
|
}), " ", this.props.message);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import classNames from 'classnames';
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/core';
|
|
4
3
|
import { placeholder, placeholderContainer } from './styles';
|
|
5
4
|
import { defaultEmojiHeight } from '../../util/constants';
|
|
6
5
|
import { isImageRepresentation, isMediaRepresentation } from '../../util/type-helpers';
|
|
7
6
|
|
|
8
7
|
var EmojiPlaceholder = function EmojiPlaceholder(props) {
|
|
9
|
-
var _classes;
|
|
10
|
-
|
|
11
8
|
var shortName = props.shortName,
|
|
12
9
|
_props$size = props.size,
|
|
13
10
|
size = _props$size === void 0 ? defaultEmojiHeight : _props$size,
|
|
@@ -33,10 +30,10 @@ var EmojiPlaceholder = function EmojiPlaceholder(props) {
|
|
|
33
30
|
width: "".concat(width, "px"),
|
|
34
31
|
height: "".concat(height, "px")
|
|
35
32
|
};
|
|
36
|
-
|
|
37
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
return jsx("span", {
|
|
38
34
|
"aria-label": shortName,
|
|
39
|
-
className:
|
|
35
|
+
className: placeholder,
|
|
36
|
+
css: placeholderContainer,
|
|
40
37
|
style: style,
|
|
41
38
|
title: showTooltip ? shortName : ''
|
|
42
39
|
});
|
|
@@ -10,18 +10,18 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
10
10
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
import { jsx } from '@emotion/core';
|
|
13
15
|
import AkButton from '@atlaskit/button/standard-button';
|
|
14
16
|
import AddIcon from '@atlaskit/icon/glyph/add';
|
|
15
|
-
import classNames from 'classnames';
|
|
16
|
-
import React from 'react';
|
|
17
17
|
import { PureComponent } from 'react';
|
|
18
18
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
19
|
-
import CachingEmoji from '../../components/common/CachingEmoji';
|
|
20
19
|
import EmojiButton from '../../components/common/EmojiButton';
|
|
21
20
|
import { messages } from '../i18n';
|
|
22
|
-
import * as styles from './styles';
|
|
23
21
|
import ToneSelector from './ToneSelector';
|
|
24
22
|
import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
|
|
23
|
+
import { addCustomEmoji, addCustomEmojiButton, emojiPickerAddEmoji, emojiPreview, toneSelectorContainer } from './styles';
|
|
24
|
+
import { EmojiPreviewComponent } from './EmojiPreviewComponent';
|
|
25
25
|
export var EmojiPreview = /*#__PURE__*/function (_PureComponent) {
|
|
26
26
|
_inherits(EmojiPreview, _PureComponent);
|
|
27
27
|
|
|
@@ -93,13 +93,13 @@ export var EmojiPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
93
93
|
previewEmoji = previewEmoji.skinVariations[(selectedTone || 1) - 1];
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
return
|
|
97
|
-
className:
|
|
98
|
-
}, this.state.selectingTone &&
|
|
96
|
+
return jsx("div", {
|
|
97
|
+
className: toneSelectorContainer
|
|
98
|
+
}, this.state.selectingTone && jsx(ToneSelector, {
|
|
99
99
|
emoji: toneEmoji,
|
|
100
100
|
onToneSelected: this.onToneSelected,
|
|
101
101
|
previewEmojiId: previewEmoji.id
|
|
102
|
-
}),
|
|
102
|
+
}), jsx(EmojiButton, {
|
|
103
103
|
ariaExpanded: this.state.selectingTone,
|
|
104
104
|
emoji: previewEmoji,
|
|
105
105
|
selectOnHover: true,
|
|
@@ -112,8 +112,6 @@ export var EmojiPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
112
|
}, {
|
|
113
113
|
key: "renderEmojiPreview",
|
|
114
114
|
value: function renderEmojiPreview() {
|
|
115
|
-
var _classNames2;
|
|
116
|
-
|
|
117
115
|
var selectingTone = this.state.selectingTone;
|
|
118
116
|
var _this$props2 = this.props,
|
|
119
117
|
emoji = _this$props2.emoji,
|
|
@@ -123,21 +121,9 @@ export var EmojiPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
123
121
|
return null;
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
var previewTextClasses = classNames((_classNames2 = {}, _defineProperty(_classNames2, styles.previewText, true), _defineProperty(_classNames2, styles.previewSingleLine, !emoji.name), _classNames2));
|
|
128
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: previewClasses
|
|
130
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
131
|
-
className: styles.previewImg
|
|
132
|
-
}, /*#__PURE__*/React.createElement(CachingEmoji, {
|
|
124
|
+
return jsx(EmojiPreviewComponent, {
|
|
133
125
|
emoji: emoji
|
|
134
|
-
})
|
|
135
|
-
className: previewTextClasses
|
|
136
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
137
|
-
className: styles.name
|
|
138
|
-
}, emoji.name), /*#__PURE__*/React.createElement("span", {
|
|
139
|
-
className: styles.shortName
|
|
140
|
-
}, emoji.shortName)));
|
|
126
|
+
});
|
|
141
127
|
} // note: emoji-picker-add-emoji className is used by pollinator synthetic checks
|
|
142
128
|
|
|
143
129
|
}, {
|
|
@@ -154,26 +140,26 @@ export var EmojiPreview = /*#__PURE__*/function (_PureComponent) {
|
|
|
154
140
|
return null;
|
|
155
141
|
}
|
|
156
142
|
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
return
|
|
143
|
+
return jsx("div", {
|
|
144
|
+
css: addCustomEmoji
|
|
145
|
+
}, jsx(FormattedMessage, messages.addCustomEmojiLabel, function (label) {
|
|
146
|
+
return jsx(AkButton, {
|
|
161
147
|
onClick: onOpenUpload,
|
|
162
|
-
iconBefore:
|
|
148
|
+
iconBefore: jsx(AddIcon, {
|
|
163
149
|
label: formatMessage(messages.addCustomEmojiLabel),
|
|
164
150
|
size: "small"
|
|
165
151
|
}),
|
|
166
152
|
appearance: "subtle",
|
|
167
|
-
|
|
153
|
+
css: addCustomEmojiButton,
|
|
154
|
+
className: emojiPickerAddEmoji
|
|
168
155
|
}, label);
|
|
169
156
|
}));
|
|
170
157
|
}
|
|
171
158
|
}, {
|
|
172
159
|
key: "render",
|
|
173
160
|
value: function render() {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
className: sectionClasses,
|
|
161
|
+
return jsx("div", {
|
|
162
|
+
css: emojiPreview,
|
|
177
163
|
onMouseLeave: this.onMouseLeave
|
|
178
164
|
}, this.renderAddOwnEmoji(), this.renderEmojiPreview(), this.renderTones());
|
|
179
165
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/core';
|
|
3
|
+
import CachingEmoji from './CachingEmoji';
|
|
4
|
+
import { emojiName, emojiShortName, preview, previewImg, previewText } from './styles';
|
|
5
|
+
export var EmojiPreviewComponent = function EmojiPreviewComponent(_ref) {
|
|
6
|
+
var emoji = _ref.emoji;
|
|
7
|
+
return jsx("div", {
|
|
8
|
+
css: preview
|
|
9
|
+
}, jsx("span", {
|
|
10
|
+
css: previewImg
|
|
11
|
+
}, jsx(CachingEmoji, {
|
|
12
|
+
emoji: emoji
|
|
13
|
+
})), jsx("div", {
|
|
14
|
+
css: previewText
|
|
15
|
+
}, emoji.name && jsx("div", {
|
|
16
|
+
css: emojiName
|
|
17
|
+
}, emoji.name), jsx("div", {
|
|
18
|
+
css: emojiShortName
|
|
19
|
+
}, emoji.shortName)));
|
|
20
|
+
};
|