@atlaskit/emoji 64.1.1 → 64.3.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 +32 -0
- package/README.md +3 -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 +33 -5
- 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/ResourcedEmoji.js +25 -9
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +17 -0
- 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/styles.js +210 -266
- package/dist/cjs/components/picker/CategorySelector.js +13 -12
- package/dist/cjs/components/picker/EmojiPicker.js +6 -6
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +8 -14
- package/dist/cjs/components/picker/EmojiPickerComponent.js +9 -18
- 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 +8 -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 +9 -15
- 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 +10 -16
- package/dist/cjs/components/uploader/styles.js +4 -4
- package/dist/cjs/i18n/cs.js +2 -2
- package/dist/cjs/i18n/da.js +2 -2
- package/dist/cjs/i18n/de.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +51 -0
- package/dist/cjs/i18n/es.js +2 -2
- package/dist/cjs/i18n/et.js +2 -2
- package/dist/cjs/i18n/fi.js +2 -2
- package/dist/cjs/i18n/fr.js +2 -2
- package/dist/cjs/i18n/hu.js +2 -2
- package/dist/cjs/i18n/it.js +2 -2
- package/dist/cjs/i18n/ja.js +2 -2
- package/dist/cjs/i18n/ko.js +2 -2
- package/dist/cjs/i18n/nb.js +2 -2
- package/dist/cjs/i18n/nl.js +2 -2
- package/dist/cjs/i18n/pl.js +2 -2
- package/dist/cjs/i18n/pt_BR.js +2 -2
- package/dist/cjs/i18n/pt_PT.js +2 -2
- package/dist/cjs/i18n/ru.js +2 -2
- package/dist/cjs/i18n/sk.js +2 -2
- package/dist/cjs/i18n/sv.js +2 -2
- package/dist/cjs/i18n/th.js +2 -2
- package/dist/cjs/i18n/tr.js +2 -2
- package/dist/cjs/i18n/uk.js +2 -2
- package/dist/cjs/i18n/vi.js +2 -2
- package/dist/cjs/i18n/zh.js +2 -2
- package/dist/cjs/i18n/zh_TW.js +2 -2
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/types.js +12 -2
- package/dist/cjs/util/{analytics.js → analytics/analytics.js} +34 -2
- package/dist/cjs/util/analytics/index.js +203 -0
- package/dist/cjs/util/analytics/samplingUfo.js +278 -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 +29 -5
- 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/ResourcedEmoji.js +22 -5
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +16 -0
- 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/styles.js +195 -262
- package/dist/es2019/components/picker/CategorySelector.js +15 -12
- package/dist/es2019/components/picker/EmojiPicker.js +7 -5
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +8 -8
- package/dist/es2019/components/picker/EmojiPickerComponent.js +10 -10
- 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 +9 -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 +9 -8
- 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 +10 -9
- package/dist/es2019/components/uploader/styles.js +4 -4
- package/dist/es2019/i18n/cs.js +2 -2
- package/dist/es2019/i18n/da.js +2 -2
- package/dist/es2019/i18n/de.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +43 -0
- package/dist/es2019/i18n/es.js +2 -2
- package/dist/es2019/i18n/et.js +2 -2
- package/dist/es2019/i18n/fi.js +2 -2
- package/dist/es2019/i18n/fr.js +2 -2
- package/dist/es2019/i18n/hu.js +2 -2
- package/dist/es2019/i18n/it.js +2 -2
- package/dist/es2019/i18n/ja.js +2 -2
- package/dist/es2019/i18n/ko.js +2 -2
- package/dist/es2019/i18n/nb.js +2 -2
- package/dist/es2019/i18n/nl.js +2 -2
- package/dist/es2019/i18n/pl.js +2 -2
- package/dist/es2019/i18n/pt_BR.js +2 -2
- package/dist/es2019/i18n/pt_PT.js +2 -2
- package/dist/es2019/i18n/ru.js +2 -2
- package/dist/es2019/i18n/sk.js +2 -2
- package/dist/es2019/i18n/sv.js +2 -2
- package/dist/es2019/i18n/th.js +2 -2
- package/dist/es2019/i18n/tr.js +2 -2
- package/dist/es2019/i18n/uk.js +2 -2
- package/dist/es2019/i18n/vi.js +2 -2
- package/dist/es2019/i18n/zh.js +2 -2
- package/dist/es2019/i18n/zh_TW.js +2 -2
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/types.js +10 -1
- package/dist/es2019/util/{analytics.js → analytics/analytics.js} +28 -1
- package/dist/es2019/util/analytics/index.js +3 -0
- package/dist/es2019/util/analytics/samplingUfo.js +147 -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 +31 -5
- 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/ResourcedEmoji.js +22 -9
- package/dist/esm/components/common/ResourcedEmojiComponent.js +16 -0
- 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/styles.js +192 -242
- package/dist/esm/components/picker/CategorySelector.js +14 -12
- package/dist/esm/components/picker/EmojiPicker.js +6 -5
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +8 -8
- package/dist/esm/components/picker/EmojiPickerComponent.js +9 -10
- 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 +8 -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 +8 -8
- 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 +9 -9
- package/dist/esm/components/uploader/styles.js +4 -4
- package/dist/esm/i18n/cs.js +2 -2
- package/dist/esm/i18n/da.js +2 -2
- package/dist/esm/i18n/de.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +43 -0
- package/dist/esm/i18n/es.js +2 -2
- package/dist/esm/i18n/et.js +2 -2
- package/dist/esm/i18n/fi.js +2 -2
- package/dist/esm/i18n/fr.js +2 -2
- package/dist/esm/i18n/hu.js +2 -2
- package/dist/esm/i18n/it.js +2 -2
- package/dist/esm/i18n/ja.js +2 -2
- package/dist/esm/i18n/ko.js +2 -2
- package/dist/esm/i18n/nb.js +2 -2
- package/dist/esm/i18n/nl.js +2 -2
- package/dist/esm/i18n/pl.js +2 -2
- package/dist/esm/i18n/pt_BR.js +2 -2
- package/dist/esm/i18n/pt_PT.js +2 -2
- package/dist/esm/i18n/ru.js +2 -2
- package/dist/esm/i18n/sk.js +2 -2
- package/dist/esm/i18n/sv.js +2 -2
- package/dist/esm/i18n/th.js +2 -2
- package/dist/esm/i18n/tr.js +2 -2
- package/dist/esm/i18n/uk.js +2 -2
- package/dist/esm/i18n/vi.js +2 -2
- package/dist/esm/i18n/zh.js +2 -2
- package/dist/esm/i18n/zh_TW.js +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/types.js +10 -1
- package/dist/esm/util/{analytics.js → analytics/analytics.js} +28 -1
- package/dist/esm/util/analytics/index.js +3 -0
- package/dist/esm/util/analytics/samplingUfo.js +259 -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/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/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/styles.d.ts +17 -18
- package/dist/types/components/typeahead/styles.d.ts +8 -7
- package/dist/types/components/uploader/styles.d.ts +2 -2
- package/dist/types/i18n/cs.d.ts +1 -1
- package/dist/types/i18n/da.d.ts +1 -1
- package/dist/types/i18n/de.d.ts +1 -1
- package/dist/types/i18n/en_ZZ.d.ts +43 -0
- package/dist/types/i18n/es.d.ts +1 -1
- package/dist/types/i18n/et.d.ts +1 -1
- package/dist/types/i18n/fi.d.ts +1 -1
- package/dist/types/i18n/fr.d.ts +1 -1
- package/dist/types/i18n/hu.d.ts +1 -1
- package/dist/types/i18n/it.d.ts +1 -1
- package/dist/types/i18n/ja.d.ts +1 -1
- package/dist/types/i18n/ko.d.ts +1 -1
- package/dist/types/i18n/nb.d.ts +1 -1
- package/dist/types/i18n/nl.d.ts +1 -1
- package/dist/types/i18n/pl.d.ts +1 -1
- package/dist/types/i18n/pt_BR.d.ts +1 -1
- package/dist/types/i18n/pt_PT.d.ts +1 -1
- package/dist/types/i18n/ru.d.ts +1 -1
- package/dist/types/i18n/sk.d.ts +1 -1
- package/dist/types/i18n/sv.d.ts +1 -1
- package/dist/types/i18n/th.d.ts +1 -1
- package/dist/types/i18n/tr.d.ts +1 -1
- package/dist/types/i18n/uk.d.ts +1 -1
- package/dist/types/i18n/vi.d.ts +1 -1
- package/dist/types/i18n/zh.d.ts +1 -1
- package/dist/types/i18n/zh_TW.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/util/{analytics.d.ts → analytics/analytics.d.ts} +9 -5
- package/dist/types/util/analytics/index.d.ts +5 -0
- package/dist/types/util/analytics/samplingUfo.d.ts +31 -0
- package/dist/types/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
- package/dist/types/util/constants.d.ts +2 -0
- package/local-config-example.ts +3 -3
- package/package.json +14 -11
- package/dist/cjs/components/picker/EmojiPickerPreview.js +0 -87
- package/dist/es2019/components/picker/EmojiPickerPreview.js +0 -43
- package/dist/esm/components/picker/EmojiPickerPreview.js +0 -67
- package/dist/types/components/picker/EmojiPickerPreview.d.ts +0 -9
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { css } from '@emotion/core';
|
|
1
2
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
2
|
-
import * as colors from '@atlaskit/theme/colors';
|
|
3
3
|
import { token } from '@atlaskit/tokens';
|
|
4
4
|
import { defaultEmojiHeight } from '../../util/constants';
|
|
5
5
|
import { akEmojiSelectedBackgroundColor } from '../../util/shared-styles';
|
|
6
|
-
import {
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
6
|
+
import { N20, N200, N300, N900, R300, R400 } from '@atlaskit/theme/colors';
|
|
7
|
+
export const commonSelectedStyles = 'emoji-common-selected';
|
|
8
|
+
export const selectOnHoverStyles = 'emoji-common-select-on-hover';
|
|
9
9
|
export const emojiSprite = 'emoji-common-emoji-sprite';
|
|
10
|
-
export const
|
|
10
|
+
export const emojiNodeStyles = 'emoji-common-node';
|
|
11
11
|
export const emojiImage = 'emoji-common-emoji-image';
|
|
12
|
-
export const
|
|
12
|
+
export const emojiDeleteButton = 'emoji-common-deleteButton';
|
|
13
|
+
export const emojiMainStyle = 'emoji-common-main-styles';
|
|
14
|
+
export const deleteButton = css({
|
|
13
15
|
// hide by default
|
|
14
16
|
visibility: 'hidden',
|
|
15
17
|
display: 'flex',
|
|
@@ -22,7 +24,13 @@ export const deleteButton = style({
|
|
|
22
24
|
paddingTop: '4px',
|
|
23
25
|
marginBottom: '-4px'
|
|
24
26
|
});
|
|
25
|
-
export const
|
|
27
|
+
export const emojiToneSelectorContainer = css({
|
|
28
|
+
flex: 1,
|
|
29
|
+
display: 'flex',
|
|
30
|
+
justifyContent: 'flex-end',
|
|
31
|
+
padding: '8px 10px 8px 0'
|
|
32
|
+
});
|
|
33
|
+
export const emojiStyles = css({
|
|
26
34
|
borderRadius: '5px',
|
|
27
35
|
backgroundColor: 'transparent',
|
|
28
36
|
display: 'inline-block',
|
|
@@ -31,204 +39,148 @@ export const emoji = style({
|
|
|
31
39
|
// headings. Smaller headings get a slight increase in height, cannot add more negative margin
|
|
32
40
|
// as a "selected" emoji (e.g. in the editor) will not look good.
|
|
33
41
|
margin: '-1px 0',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
display: 'block'
|
|
44
|
-
}
|
|
42
|
+
[`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover`]: {
|
|
43
|
+
backgroundColor: akEmojiSelectedBackgroundColor
|
|
44
|
+
},
|
|
45
|
+
[`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover .${emojiDeleteButton}`]: {
|
|
46
|
+
// show delete button on hover
|
|
47
|
+
visibility: 'visible'
|
|
48
|
+
},
|
|
49
|
+
img: {
|
|
50
|
+
display: 'block'
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
|
-
export const emojiContainer =
|
|
53
|
+
export const emojiContainer = css({
|
|
48
54
|
display: 'inline-block',
|
|
49
55
|
// Ensure along with vertical align middle, we don't increase the line height for h1..h6, and p
|
|
50
56
|
margin: '-1px 0',
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
width: `${defaultEmojiHeight}px`
|
|
61
|
-
}
|
|
57
|
+
[`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover`]: {
|
|
58
|
+
backgroundColor: akEmojiSelectedBackgroundColor
|
|
59
|
+
},
|
|
60
|
+
[`.${emojiSprite}`]: {
|
|
61
|
+
background: 'transparent no-repeat',
|
|
62
|
+
display: 'inline-block',
|
|
63
|
+
verticalAlign: 'middle',
|
|
64
|
+
minHeight: `${defaultEmojiHeight}px`,
|
|
65
|
+
minWidth: `${defaultEmojiHeight}px`
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
export const placeholder = 'emoji-common-placeholder';
|
|
65
|
-
export const placeholderContainer =
|
|
69
|
+
export const placeholderContainer = css({
|
|
66
70
|
// Ensure no vertical reflow
|
|
67
71
|
margin: '-1px 0',
|
|
68
72
|
display: 'inline-block',
|
|
69
|
-
background: '#f7f7f7',
|
|
73
|
+
background: token('color.border', '#f7f7f7'),
|
|
70
74
|
borderRadius: '20%',
|
|
71
75
|
verticalAlign: 'middle',
|
|
72
76
|
whiteSpace: 'nowrap'
|
|
73
77
|
});
|
|
74
|
-
export const
|
|
75
|
-
display: 'inline-block',
|
|
76
|
-
verticalAlign: 'middle',
|
|
77
|
-
whiteSpace: 'nowrap'
|
|
78
|
-
});
|
|
79
|
-
export const emojiButton = style({
|
|
78
|
+
export const emojiButton = css({
|
|
80
79
|
backgroundColor: 'transparent',
|
|
81
80
|
border: '0',
|
|
82
81
|
cursor: 'pointer',
|
|
83
82
|
padding: 0,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
|
|
84
|
+
/* Firefox */
|
|
85
|
+
['&::-moz-focus-inner']: {
|
|
86
|
+
border: '0 none',
|
|
87
|
+
padding: 0
|
|
88
|
+
},
|
|
89
|
+
'&>span': {
|
|
90
|
+
borderRadius: '5px',
|
|
91
|
+
padding: '8px',
|
|
92
|
+
// Scale sprite to fit regardless of default emoji size
|
|
93
|
+
[`&>.${emojiSprite}`]: {
|
|
94
|
+
height: '24px',
|
|
95
|
+
width: '24px'
|
|
89
96
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// Scale sprite to fit regardless of default emoji size
|
|
95
|
-
[`&>.${emojiSprite}`]: {
|
|
96
|
-
height: '24px',
|
|
97
|
-
width: '24px'
|
|
98
|
-
},
|
|
99
|
-
// Scale image to fit regardless of default emoji size
|
|
100
|
-
[`&>img`]: {
|
|
101
|
-
height: '24px',
|
|
102
|
-
width: '24px'
|
|
103
|
-
}
|
|
104
|
-
}
|
|
97
|
+
// Scale image to fit regardless of default emoji size
|
|
98
|
+
[`&>img`]: {
|
|
99
|
+
height: '24px',
|
|
100
|
+
width: '24px'
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
103
|
});
|
|
108
|
-
export const hiddenToneButton =
|
|
104
|
+
export const hiddenToneButton = css({
|
|
109
105
|
// Hide currently selected tone that rendered in the ToneSelector to avoid duplication
|
|
110
|
-
|
|
111
|
-
display: 'none',
|
|
112
|
-
$unique: true
|
|
106
|
+
display: 'none'
|
|
113
107
|
}); // Emoji Preview
|
|
114
108
|
|
|
115
109
|
export const buttons = 'emoji-common-buttons';
|
|
116
|
-
export const preview = 'emoji-common-preview';
|
|
117
|
-
export const previewImg = 'emoji-common-preview-image';
|
|
118
|
-
export const previewText = 'emoji-common-preview-text';
|
|
119
|
-
export const name = 'emoji-common-name';
|
|
120
|
-
export const shortName = 'emoji-common-shortname';
|
|
121
|
-
export const previewSingleLine = 'emoji-common-preview-single-line';
|
|
122
110
|
export const toneSelectorContainer = 'emoji-common-tone-selector-container';
|
|
123
|
-
export const
|
|
124
|
-
export const
|
|
111
|
+
export const emojiPickerAddEmoji = 'emoji-picker-add-emoji';
|
|
112
|
+
export const previewText = css({
|
|
125
113
|
display: 'flex',
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
'&>span': {
|
|
146
|
-
width: '32px',
|
|
147
|
-
height: '32px',
|
|
148
|
-
padding: 0,
|
|
149
|
-
maxHeight: 'inherit',
|
|
150
|
-
$nest: {
|
|
151
|
-
'&>img': {
|
|
152
|
-
position: 'relative',
|
|
153
|
-
left: '50%',
|
|
154
|
-
top: '50%',
|
|
155
|
-
transform: 'translateX(-50%) translateY(-50%)',
|
|
156
|
-
maxHeight: '32px',
|
|
157
|
-
maxWidth: '32px',
|
|
158
|
-
padding: 0,
|
|
159
|
-
display: 'block'
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
[`.${previewText}`]: {
|
|
166
|
-
display: 'flex',
|
|
167
|
-
flexDirection: 'column',
|
|
168
|
-
marginLeft: '10px',
|
|
169
|
-
marginTop: '-2px',
|
|
170
|
-
maxWidth: '285px',
|
|
171
|
-
width: '285px'
|
|
172
|
-
/* IE */
|
|
173
|
-
,
|
|
174
|
-
flexGrow: 1,
|
|
175
|
-
flexShrink: 1,
|
|
176
|
-
$nest: {
|
|
177
|
-
[`.${name}`]: {
|
|
178
|
-
display: 'block',
|
|
179
|
-
color: token('color.text', colors.N900),
|
|
180
|
-
overflow: 'hidden',
|
|
181
|
-
textOverflow: 'ellipsis',
|
|
182
|
-
whiteSpace: 'nowrap',
|
|
183
|
-
$nest: {
|
|
184
|
-
['&:first-letter']: {
|
|
185
|
-
textTransform: 'uppercase'
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
[`.${shortName}`]: {
|
|
190
|
-
display: 'block',
|
|
191
|
-
color: token('color.text.subtle', colors.N200),
|
|
192
|
-
fontSize: '12px',
|
|
193
|
-
lineHeight: 1,
|
|
194
|
-
marginBottom: '-2px',
|
|
195
|
-
overflow: 'hidden',
|
|
196
|
-
paddingBottom: '2px',
|
|
197
|
-
textOverflow: 'ellipsis',
|
|
198
|
-
whiteSpace: 'nowrap'
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
[`.${previewSingleLine}`]: {
|
|
203
|
-
paddingTop: '10px',
|
|
204
|
-
$nest: {
|
|
205
|
-
[`.${name}`]: {
|
|
206
|
-
display: 'none'
|
|
207
|
-
},
|
|
208
|
-
[`.${shortName}`]: {
|
|
209
|
-
color: token('color.text', colors.N900),
|
|
210
|
-
fontSize: '14px'
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
[`.${previewText}`]: {
|
|
217
|
-
maxWidth: '235px',
|
|
218
|
-
width: '235px'
|
|
219
|
-
/* IE */
|
|
220
|
-
|
|
221
|
-
}
|
|
114
|
+
flexDirection: 'column',
|
|
115
|
+
alignSelf: 'center',
|
|
116
|
+
marginTop: '-2px',
|
|
117
|
+
marginLeft: '10px',
|
|
118
|
+
maxWidth: '285px',
|
|
119
|
+
width: '285px'
|
|
120
|
+
/* IE */
|
|
121
|
+
,
|
|
122
|
+
flexGrow: 1,
|
|
123
|
+
flexShrink: 1
|
|
124
|
+
});
|
|
125
|
+
export const emojiName = css({
|
|
126
|
+
display: 'block',
|
|
127
|
+
color: token('color.text', N900),
|
|
128
|
+
overflow: 'hidden',
|
|
129
|
+
textOverflow: 'ellipsis',
|
|
130
|
+
whiteSpace: 'nowrap',
|
|
131
|
+
['&:first-letter']: {
|
|
132
|
+
textTransform: 'uppercase'
|
|
222
133
|
}
|
|
223
134
|
});
|
|
224
|
-
export const
|
|
225
|
-
|
|
135
|
+
export const emojiShortName = css({
|
|
136
|
+
display: 'block',
|
|
137
|
+
color: token('color.text.subtle', N200),
|
|
138
|
+
fontSize: '12px',
|
|
139
|
+
lineHeight: 1,
|
|
140
|
+
marginBottom: '-2px',
|
|
141
|
+
overflow: 'hidden',
|
|
142
|
+
paddingBottom: '2px',
|
|
143
|
+
textOverflow: 'ellipsis',
|
|
144
|
+
whiteSpace: 'nowrap',
|
|
145
|
+
['&:first-of-type']: {
|
|
146
|
+
color: token('color.text', N900),
|
|
147
|
+
fontSize: '14px'
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
export const preview = css({
|
|
226
151
|
display: 'flex',
|
|
227
|
-
|
|
228
|
-
|
|
152
|
+
flexDirection: 'row',
|
|
153
|
+
flexWrap: 'nowrap',
|
|
154
|
+
padding: '10px'
|
|
155
|
+
});
|
|
156
|
+
export const previewImg = css({
|
|
157
|
+
display: 'inline-block',
|
|
158
|
+
flex: 'initial',
|
|
159
|
+
width: '32px',
|
|
160
|
+
[`& .${emojiSprite}, > span`]: {
|
|
161
|
+
width: '32px',
|
|
162
|
+
height: '32px',
|
|
163
|
+
padding: 0,
|
|
164
|
+
maxHeight: 'inherit'
|
|
165
|
+
},
|
|
166
|
+
[`& > span > img`]: {
|
|
167
|
+
position: 'relative',
|
|
168
|
+
left: '50%',
|
|
169
|
+
top: '50%',
|
|
170
|
+
transform: 'translateX(-50%) translateY(-50%)',
|
|
171
|
+
maxHeight: '32px',
|
|
172
|
+
maxWidth: '32px',
|
|
173
|
+
padding: 0,
|
|
174
|
+
display: 'block'
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
export const emojiPreview = css({
|
|
178
|
+
display: 'flex',
|
|
179
|
+
height: '50px',
|
|
180
|
+
boxSizing: 'border-box'
|
|
229
181
|
}); // Scrollable
|
|
230
182
|
|
|
231
|
-
export const emojiScrollable =
|
|
183
|
+
export const emojiScrollable = css({
|
|
232
184
|
border: `1px solid ${token('color.border', '#fff')}`,
|
|
233
185
|
borderRadius: `${borderRadius()}px`,
|
|
234
186
|
display: 'block',
|
|
@@ -238,192 +190,173 @@ export const emojiScrollable = style({
|
|
|
238
190
|
padding: '0'
|
|
239
191
|
}); // EmojiUpload
|
|
240
192
|
|
|
241
|
-
export const emojiUpload =
|
|
193
|
+
export const emojiUpload = css({
|
|
242
194
|
height: '78px',
|
|
243
195
|
padding: '10px',
|
|
244
196
|
display: 'flex',
|
|
245
197
|
flexDirection: 'column',
|
|
246
198
|
justifyContent: 'space-around'
|
|
247
199
|
});
|
|
248
|
-
export const uploadChooseFileMessage =
|
|
249
|
-
color: token('color.text.subtle',
|
|
200
|
+
export const uploadChooseFileMessage = css({
|
|
201
|
+
color: token('color.text.subtle', N300),
|
|
250
202
|
fontSize: '12px',
|
|
251
203
|
paddingBottom: '7px'
|
|
252
204
|
});
|
|
253
|
-
export const emojiUploadBottom =
|
|
205
|
+
export const emojiUploadBottom = css({
|
|
254
206
|
fontSize: '11px'
|
|
255
207
|
});
|
|
256
|
-
export const uploadChooseFileRow =
|
|
208
|
+
export const uploadChooseFileRow = css({
|
|
257
209
|
display: 'flex',
|
|
258
210
|
justifyContent: 'space-between'
|
|
259
211
|
});
|
|
260
|
-
export const uploadChooseFileEmojiName =
|
|
212
|
+
export const uploadChooseFileEmojiName = css({
|
|
261
213
|
flex: '1 1 auto',
|
|
262
214
|
marginRight: '5px',
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
['&::-ms-clear']: {
|
|
273
|
-
display: 'none'
|
|
274
|
-
}
|
|
275
|
-
}
|
|
215
|
+
input: {
|
|
216
|
+
background: 'transparent',
|
|
217
|
+
border: 0,
|
|
218
|
+
outline: 'none',
|
|
219
|
+
['&:invalid']: {
|
|
220
|
+
boxShadow: 'none'
|
|
221
|
+
},
|
|
222
|
+
['&::-ms-clear']: {
|
|
223
|
+
display: 'none'
|
|
276
224
|
}
|
|
277
225
|
}
|
|
278
226
|
});
|
|
279
|
-
export const uploadChooseFileBrowse =
|
|
227
|
+
export const uploadChooseFileBrowse = css({
|
|
280
228
|
flex: '0 0 auto'
|
|
281
229
|
});
|
|
282
|
-
export const uploadPreviewFooter =
|
|
230
|
+
export const uploadPreviewFooter = css({
|
|
283
231
|
display: 'flex',
|
|
284
232
|
flexDirection: 'column',
|
|
285
233
|
height: '100px',
|
|
286
234
|
padding: '10px'
|
|
287
235
|
});
|
|
288
|
-
export const uploadPreview =
|
|
236
|
+
export const uploadPreview = css({
|
|
289
237
|
display: 'flex',
|
|
290
238
|
justifyContent: 'space-between',
|
|
291
239
|
alignItems: 'center',
|
|
292
|
-
background: token('color.background.neutral',
|
|
240
|
+
background: token('color.background.neutral', N20),
|
|
293
241
|
borderRadius: `${borderRadius()}px`,
|
|
294
242
|
padding: '10px'
|
|
295
243
|
});
|
|
296
|
-
export const uploadPreviewText =
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
maxWidth: '50px'
|
|
306
|
-
}
|
|
244
|
+
export const uploadPreviewText = css({
|
|
245
|
+
h5: {
|
|
246
|
+
color: token('color.text.subtle', N300),
|
|
247
|
+
paddingBottom: '4px',
|
|
248
|
+
fontSize: '12px'
|
|
249
|
+
},
|
|
250
|
+
img: {
|
|
251
|
+
maxHeight: '20px',
|
|
252
|
+
maxWidth: '50px'
|
|
307
253
|
}
|
|
308
254
|
});
|
|
309
|
-
export const bigEmojiPreview =
|
|
255
|
+
export const bigEmojiPreview = css({
|
|
310
256
|
paddingLeft: '4px',
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
maxWidth: '100px'
|
|
315
|
-
}
|
|
257
|
+
img: {
|
|
258
|
+
maxHeight: '40px',
|
|
259
|
+
maxWidth: '100px'
|
|
316
260
|
}
|
|
317
261
|
});
|
|
318
|
-
export const uploadAddRow =
|
|
262
|
+
export const uploadAddRow = css({
|
|
319
263
|
display: 'flex',
|
|
320
264
|
justifyContent: 'flex-end',
|
|
321
265
|
alignItems: 'center',
|
|
322
266
|
paddingTop: '10px'
|
|
323
267
|
});
|
|
324
|
-
export const
|
|
268
|
+
export const addCustomEmoji = css({
|
|
325
269
|
alignSelf: 'center',
|
|
326
270
|
marginLeft: '10px',
|
|
327
271
|
marginBottom: '10px'
|
|
328
272
|
}); // Emoji Delete preview
|
|
329
273
|
|
|
330
274
|
export const submitDelete = 'emoji-submit-delete';
|
|
331
|
-
export const
|
|
332
|
-
export const deletePreview = style({
|
|
275
|
+
export const deletePreview = css({
|
|
333
276
|
height: '100px',
|
|
334
277
|
padding: '10px',
|
|
335
278
|
display: 'flex',
|
|
336
279
|
flexDirection: 'column',
|
|
337
280
|
justifyContent: 'flex-end'
|
|
338
281
|
});
|
|
339
|
-
export const deleteText =
|
|
282
|
+
export const deleteText = css({
|
|
340
283
|
height: '64px',
|
|
341
284
|
fontSize: '12px',
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
lineHeight: '16px'
|
|
346
|
-
}
|
|
285
|
+
'&:first-of-type': {
|
|
286
|
+
color: token('color.text.subtle', N300),
|
|
287
|
+
lineHeight: '16px'
|
|
347
288
|
}
|
|
348
289
|
});
|
|
349
|
-
export const
|
|
290
|
+
export const previewButtonGroup = css({
|
|
291
|
+
display: 'flex'
|
|
292
|
+
});
|
|
293
|
+
export const deleteFooter = css({
|
|
350
294
|
display: 'flex',
|
|
351
295
|
height: '40px',
|
|
352
296
|
alignItems: 'center',
|
|
353
297
|
justifyContent: 'space-between',
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
298
|
+
img: {
|
|
299
|
+
maxHeight: '32px',
|
|
300
|
+
maxWidth: '72px'
|
|
301
|
+
},
|
|
302
|
+
[`.${submitDelete}`]: {
|
|
303
|
+
width: '84px',
|
|
304
|
+
fontWeight: 'bold',
|
|
305
|
+
marginRight: '4px'
|
|
306
|
+
},
|
|
307
|
+
button: {
|
|
308
|
+
display: 'flex',
|
|
309
|
+
justifyContent: 'center',
|
|
310
|
+
fontSize: '14px',
|
|
311
|
+
div: {
|
|
360
312
|
display: 'flex'
|
|
361
|
-
},
|
|
362
|
-
[`.${submitDelete}`]: {
|
|
363
|
-
width: '84px',
|
|
364
|
-
fontWeight: 'bold',
|
|
365
|
-
marginRight: '4px'
|
|
366
|
-
},
|
|
367
|
-
button: {
|
|
368
|
-
display: 'flex',
|
|
369
|
-
justifyContent: 'center',
|
|
370
|
-
fontSize: '14px',
|
|
371
|
-
$nest: {
|
|
372
|
-
div: {
|
|
373
|
-
display: 'flex'
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
313
|
}
|
|
377
314
|
}
|
|
378
315
|
});
|
|
379
|
-
export const emojiDeleteErrorMessage =
|
|
316
|
+
export const emojiDeleteErrorMessage = css({
|
|
380
317
|
display: 'flex',
|
|
381
|
-
color: token('color.text.danger',
|
|
318
|
+
color: token('color.text.danger', R400),
|
|
382
319
|
alignItems: 'center',
|
|
383
320
|
justifyContent: 'flex-end',
|
|
384
321
|
paddingRight: '4px'
|
|
385
322
|
});
|
|
386
|
-
export const emojiChooseFileErrorMessage =
|
|
323
|
+
export const emojiChooseFileErrorMessage = css({
|
|
387
324
|
display: 'flex',
|
|
388
|
-
color: token('color.text.danger',
|
|
325
|
+
color: token('color.text.danger', R300),
|
|
389
326
|
paddingRight: '10px',
|
|
390
327
|
justifyContent: 'flex-start'
|
|
391
328
|
});
|
|
392
|
-
export const emojiPreviewErrorMessage =
|
|
329
|
+
export const emojiPreviewErrorMessage = css({
|
|
393
330
|
display: 'inline-flex',
|
|
394
|
-
color: token('color.text.danger',
|
|
331
|
+
color: token('color.text.danger', R400),
|
|
395
332
|
paddingRight: '10px',
|
|
396
333
|
justifyContent: 'flex-end',
|
|
397
334
|
alignItems: 'center'
|
|
398
335
|
});
|
|
399
|
-
export const addCustomEmojiButton =
|
|
336
|
+
export const addCustomEmojiButton = css({
|
|
400
337
|
maxWidth: '285px'
|
|
401
338
|
});
|
|
402
|
-
export const uploadRetryButton =
|
|
339
|
+
export const uploadRetryButton = css({
|
|
403
340
|
maxWidth: '172px',
|
|
404
341
|
justifyContent: 'center',
|
|
405
342
|
fontWeight: 'bold',
|
|
406
343
|
marginRight: '4px',
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
display: 'flex'
|
|
410
|
-
}
|
|
344
|
+
div: {
|
|
345
|
+
display: 'flex'
|
|
411
346
|
}
|
|
412
347
|
});
|
|
413
|
-
export const uploadEmojiButton =
|
|
348
|
+
export const uploadEmojiButton = css({
|
|
414
349
|
maxWidth: '187px',
|
|
415
350
|
justifyContent: 'center',
|
|
416
351
|
marginRight: '4px',
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
display: 'flex'
|
|
420
|
-
}
|
|
352
|
+
div: {
|
|
353
|
+
display: 'flex'
|
|
421
354
|
}
|
|
422
355
|
});
|
|
423
|
-
export const cancelButton =
|
|
356
|
+
export const cancelButton = css({
|
|
424
357
|
maxWidth: '100px'
|
|
425
358
|
});
|
|
426
|
-
export const buttonSpinner =
|
|
359
|
+
export const buttonSpinner = css({
|
|
427
360
|
marginRight: '10px',
|
|
428
361
|
marginLeft: '10px'
|
|
429
362
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx } from '@emotion/core';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
import { PureComponent } from 'react';
|
|
5
7
|
import { injectIntl } from 'react-intl-next';
|
|
6
8
|
import { defaultCategories } from '../../util/constants';
|
|
7
9
|
import { messages } from '../i18n';
|
|
8
10
|
import { CategoryDescriptionMap } from './categories';
|
|
9
|
-
import
|
|
11
|
+
import { active, categorySelector, disable, categoryStyles } from './styles';
|
|
10
12
|
export const sortCategories = (c1, c2) => CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
|
|
11
13
|
|
|
12
14
|
const addNewCategories = (oldCategories, newCategories) => {
|
|
@@ -75,37 +77,38 @@ class CategorySelector extends PureComponent {
|
|
|
75
77
|
const {
|
|
76
78
|
formatMessage
|
|
77
79
|
} = intl;
|
|
78
|
-
categoriesSection =
|
|
80
|
+
categoriesSection = jsx("ul", null, categories.map(categoryId => {
|
|
79
81
|
const category = CategoryDescriptionMap[categoryId];
|
|
80
|
-
const categoryClasses = [
|
|
82
|
+
const categoryClasses = [categoryStyles];
|
|
81
83
|
|
|
82
84
|
if (categoryId === this.props.activeCategoryId) {
|
|
83
|
-
categoryClasses.push(
|
|
85
|
+
categoryClasses.push(active);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
if (disableCategories) {
|
|
87
|
-
categoryClasses.push(
|
|
89
|
+
categoryClasses.push(disable);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
const Icon = category.icon;
|
|
91
93
|
const categoryName = formatMessage(messages[category.name]);
|
|
92
|
-
return
|
|
94
|
+
return jsx("li", {
|
|
93
95
|
key: category.id
|
|
94
|
-
},
|
|
96
|
+
}, jsx("button", {
|
|
95
97
|
"aria-label": categoryName,
|
|
96
98
|
"data-category-id": category.id,
|
|
97
|
-
|
|
99
|
+
disabled: disableCategories,
|
|
100
|
+
css: categoryClasses,
|
|
98
101
|
onClick: this.onClick,
|
|
99
102
|
title: categoryName,
|
|
100
103
|
type: "button"
|
|
101
|
-
},
|
|
104
|
+
}, jsx(Icon, {
|
|
102
105
|
label: categoryName
|
|
103
106
|
})));
|
|
104
107
|
}));
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
return
|
|
108
|
-
|
|
110
|
+
return jsx("div", {
|
|
111
|
+
css: categorySelector
|
|
109
112
|
}, categoriesSection);
|
|
110
113
|
}
|
|
111
114
|
|