@atlaskit/emoji 64.2.1 → 64.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/api/media/SiteEmojiResource.js +10 -2
- package/dist/cjs/components/common/CachingEmoji.js +6 -8
- package/dist/cjs/components/common/DeleteButton.js +9 -13
- package/dist/cjs/components/common/Emoji.js +18 -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/ResourcedEmojiComponent.js +17 -12
- package/dist/cjs/components/common/RetryableButton.js +12 -18
- package/dist/cjs/components/common/Scrollable.js +5 -10
- 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 +21 -3
- package/dist/cjs/types.js +23 -2
- package/dist/cjs/util/analytics/analytics.js +11 -41
- package/dist/cjs/util/analytics/index.js +16 -14
- package/dist/cjs/util/analytics/ufoExperiences.js +48 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/media/SiteEmojiResource.js +10 -2
- package/dist/es2019/components/common/CachingEmoji.js +5 -7
- package/dist/es2019/components/common/DeleteButton.js +8 -6
- package/dist/es2019/components/common/Emoji.js +19 -34
- 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/ResourcedEmojiComponent.js +16 -11
- package/dist/es2019/components/common/RetryableButton.js +10 -11
- package/dist/es2019/components/common/Scrollable.js +6 -10
- 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 +5 -4
- package/dist/es2019/types.js +20 -1
- package/dist/es2019/util/analytics/analytics.js +16 -37
- package/dist/es2019/util/analytics/index.js +2 -1
- package/dist/es2019/util/analytics/ufoExperiences.js +35 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/media/SiteEmojiResource.js +10 -2
- package/dist/esm/components/common/CachingEmoji.js +5 -7
- package/dist/esm/components/common/DeleteButton.js +8 -6
- package/dist/esm/components/common/Emoji.js +18 -27
- 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/ResourcedEmojiComponent.js +16 -10
- package/dist/esm/components/common/RetryableButton.js +11 -12
- package/dist/esm/components/common/Scrollable.js +6 -10
- 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 +5 -4
- package/dist/esm/types.js +20 -1
- package/dist/esm/util/analytics/analytics.js +8 -33
- package/dist/esm/util/analytics/index.js +2 -1
- package/dist/esm/util/analytics/ufoExperiences.js +35 -0
- package/dist/esm/version.json +1 -1
- 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/ResourcedEmojiComponent.d.ts +6 -0
- package/dist/types/components/common/RetryableButton.d.ts +0 -2
- 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 +4 -4
- package/dist/types/types.d.ts +13 -0
- package/dist/types/util/analytics/analytics.d.ts +3 -7
- package/dist/types/util/analytics/index.d.ts +3 -2
- package/dist/types/util/analytics/ufoExperiences.d.ts +11 -0
- package/package.json +9 -10
- 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
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _css4, _css5, _css6;
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { css } from '@emotion/core';
|
|
6
6
|
import { token } from '@atlaskit/tokens';
|
|
7
7
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { emojiSprite, placeholder, emojiNode } from '../common/styles';
|
|
8
|
+
import { emojiPickerBorderColor, emojiPickerBoxShadow } from '../../util/shared-styles';
|
|
9
|
+
import { emojiSprite, placeholder, emojiNodeStyles } from '../common/styles';
|
|
11
10
|
import { emojiPickerHeight, emojiPickerWidth } from '../../util/constants';
|
|
12
|
-
|
|
13
|
-
export var disable = 'emoji-picker-disable'; // Level 1 - picker
|
|
11
|
+
import { B200, B300, N100A, N200, N30, N30A, N50, N900 } from '@atlaskit/theme/colors'; // Level 1 - picker
|
|
14
12
|
|
|
15
|
-
export var emojiPicker =
|
|
13
|
+
export var emojiPicker = css({
|
|
16
14
|
display: 'flex',
|
|
17
15
|
flexDirection: 'column',
|
|
18
16
|
justifyContent: 'space-between',
|
|
@@ -28,62 +26,57 @@ export var emojiPicker = style({
|
|
|
28
26
|
/// Category Selector
|
|
29
27
|
|
|
30
28
|
export var addButton = 'emoji-picker-add-button';
|
|
31
|
-
export var categorySelector =
|
|
29
|
+
export var categorySelector = css(_defineProperty({
|
|
32
30
|
flex: '0 0 auto',
|
|
33
|
-
backgroundColor: token('elevation.surface.sunken',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
button: {
|
|
49
|
-
verticalAlign: 'middle'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
31
|
+
backgroundColor: token('elevation.surface.sunken', N30),
|
|
32
|
+
ul: {
|
|
33
|
+
listStyle: 'none',
|
|
34
|
+
margin: '0 4px',
|
|
35
|
+
padding: '3px 0',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
justifyContent: 'space-around'
|
|
39
|
+
},
|
|
40
|
+
li: {
|
|
41
|
+
display: 'inline-block',
|
|
42
|
+
margin: 0,
|
|
43
|
+
padding: 0,
|
|
44
|
+
button: {
|
|
45
|
+
verticalAlign: 'middle'
|
|
52
46
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
export var
|
|
47
|
+
}
|
|
48
|
+
}, ".".concat(addButton), {
|
|
49
|
+
color: token('color.text.subtlest', N200),
|
|
50
|
+
margin: '0 0 0 5px',
|
|
51
|
+
verticalAlign: 'middle'
|
|
52
|
+
}));
|
|
53
|
+
export var active = css(_defineProperty({
|
|
54
|
+
color: token('color.text.selected', B300)
|
|
55
|
+
}, '&:hover', {
|
|
56
|
+
color: token('color.text.selected', B300)
|
|
57
|
+
}));
|
|
58
|
+
export var disable = css(_defineProperty({
|
|
59
|
+
color: token('color.text.subtlest', N50),
|
|
60
|
+
cursor: 'default'
|
|
61
|
+
}, '&:hover', {
|
|
62
|
+
color: token('color.text.subtlest', N50)
|
|
63
|
+
}));
|
|
64
|
+
export var categoryStyles = css((_css4 = {
|
|
60
65
|
backgroundColor: 'transparent',
|
|
61
66
|
border: 0,
|
|
62
|
-
color: token('color.text.subtlest',
|
|
67
|
+
color: token('color.text.subtlest', N100A),
|
|
63
68
|
cursor: 'pointer',
|
|
64
69
|
margin: '2px 0',
|
|
65
70
|
padding: 0,
|
|
66
|
-
transition: 'color 0.2s ease'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
color: token('color.text.brand', colors.B300)
|
|
74
|
-
})
|
|
75
|
-
}), _defineProperty(_$nest4, '&:hover', {
|
|
76
|
-
color: token('color.text.brand', colors.B200)
|
|
77
|
-
}), _defineProperty(_$nest4, "&.".concat(disable), {
|
|
78
|
-
color: token('color.text.subtlest', colors.N50),
|
|
79
|
-
cursor: 'default',
|
|
80
|
-
$nest: _defineProperty({}, '&:hover', {
|
|
81
|
-
color: token('color.text.subtlest', colors.N50)
|
|
82
|
-
})
|
|
83
|
-
}), _$nest4)
|
|
84
|
-
}); /// EmojiPickerList
|
|
71
|
+
transition: 'color 0.2s ease'
|
|
72
|
+
}, _defineProperty(_css4, '&::-moz-focus-inner', {
|
|
73
|
+
border: '0 none',
|
|
74
|
+
padding: 0
|
|
75
|
+
}), _defineProperty(_css4, '&:hover', {
|
|
76
|
+
color: token('color.text.selected', B200)
|
|
77
|
+
}), _css4)); /// EmojiPickerList
|
|
85
78
|
|
|
86
|
-
export var emojiPickerList =
|
|
79
|
+
export var emojiPickerList = css({
|
|
87
80
|
display: 'flex',
|
|
88
81
|
flexDirection: 'column',
|
|
89
82
|
flex: '1 1 auto',
|
|
@@ -91,128 +84,94 @@ export var emojiPickerList = style({
|
|
|
91
84
|
height: '0'
|
|
92
85
|
}); // react-virtualized enables focus style by default - turn it off
|
|
93
86
|
|
|
94
|
-
export var virtualList =
|
|
95
|
-
|
|
96
|
-
'
|
|
97
|
-
outline: 'none'
|
|
98
|
-
}
|
|
87
|
+
export var virtualList = css({
|
|
88
|
+
'&:focus': {
|
|
89
|
+
outline: 'none'
|
|
99
90
|
}
|
|
100
91
|
}); //// Search
|
|
101
92
|
|
|
102
|
-
export var searchIcon =
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
export var searchIcon = css({
|
|
94
|
+
opacity: 0.5
|
|
95
|
+
});
|
|
96
|
+
export var input = css((_css5 = {
|
|
97
|
+
boxSizing: 'border-box',
|
|
98
|
+
color: 'inherit',
|
|
99
|
+
cursor: 'inherit',
|
|
100
|
+
fontSize: '14px',
|
|
101
|
+
outline: 'none',
|
|
102
|
+
padding: '1px 0 2px 6px',
|
|
103
|
+
width: '100%'
|
|
104
|
+
}, _defineProperty(_css5, '&:invalid', {
|
|
105
|
+
boxShadow: 'none'
|
|
106
|
+
}), _defineProperty(_css5, '&::-ms-clear', {
|
|
107
|
+
display: 'none'
|
|
108
|
+
}), _css5));
|
|
109
|
+
export var pickerSearch = css({
|
|
105
110
|
boxSizing: 'border-box',
|
|
106
111
|
padding: '10px 10px 11px 10px',
|
|
107
|
-
width: '100%'
|
|
108
|
-
$nest: (_$nest6 = {}, _defineProperty(_$nest6, ".".concat(searchIcon), {
|
|
109
|
-
opacity: 0.5
|
|
110
|
-
}), _defineProperty(_$nest6, ".".concat(input), {
|
|
111
|
-
boxSizing: 'border-box',
|
|
112
|
-
color: 'inherit',
|
|
113
|
-
cursor: 'inherit',
|
|
114
|
-
fontSize: '14px',
|
|
115
|
-
outline: 'none',
|
|
116
|
-
padding: '1px 0 2px 6px',
|
|
117
|
-
width: '100%',
|
|
118
|
-
$nest: (_$nest5 = {}, _defineProperty(_$nest5, '&:invalid', {
|
|
119
|
-
boxShadow: 'none'
|
|
120
|
-
}), _defineProperty(_$nest5, '&::-ms-clear', {
|
|
121
|
-
display: 'none'
|
|
122
|
-
}), _$nest5)
|
|
123
|
-
}), _$nest6)
|
|
112
|
+
width: '100%'
|
|
124
113
|
}); //// Loading/Spinner
|
|
125
114
|
|
|
126
|
-
export var emojiPickerSpinner =
|
|
115
|
+
export var emojiPickerSpinner = css({
|
|
127
116
|
display: 'flex',
|
|
128
117
|
width: '100%',
|
|
129
118
|
height: '150px',
|
|
130
119
|
justifyContent: 'center',
|
|
131
120
|
alignItems: 'center',
|
|
132
|
-
|
|
133
|
-
'
|
|
134
|
-
flex: '0 0 auto'
|
|
135
|
-
}
|
|
121
|
+
'>div': {
|
|
122
|
+
flex: '0 0 auto'
|
|
136
123
|
}
|
|
137
124
|
}); //// Category/Result
|
|
138
125
|
|
|
139
|
-
export var emojiPickerRow =
|
|
126
|
+
export var emojiPickerRow = css({
|
|
140
127
|
marginLeft: '8px'
|
|
141
128
|
});
|
|
142
|
-
export var emojiCategoryTitle =
|
|
129
|
+
export var emojiCategoryTitle = css({
|
|
143
130
|
boxSizing: 'border-box',
|
|
144
|
-
color: token('color.text',
|
|
131
|
+
color: token('color.text', N900),
|
|
145
132
|
fontSize: '14px',
|
|
146
133
|
padding: '5px 8px',
|
|
147
134
|
textTransform: 'lowercase',
|
|
148
|
-
|
|
149
|
-
'
|
|
150
|
-
textTransform: 'uppercase'
|
|
151
|
-
}
|
|
135
|
+
'&:first-letter': {
|
|
136
|
+
textTransform: 'uppercase'
|
|
152
137
|
}
|
|
153
138
|
});
|
|
154
|
-
export var emojiItem =
|
|
139
|
+
export var emojiItem = css((_css6 = {
|
|
155
140
|
display: 'inline-block',
|
|
156
141
|
textAlign: 'center',
|
|
157
|
-
width: '40px'
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
margin: '7px',
|
|
182
|
-
minWidth: '24px',
|
|
183
|
-
maxWidth: '24px'
|
|
184
|
-
}), _$nest8)
|
|
185
|
-
});
|
|
186
|
-
export var addEmoji = style({
|
|
187
|
-
border: '2px dashed #ccc',
|
|
188
|
-
borderRadius: "".concat(borderRadius(), "px"),
|
|
189
|
-
backgroundColor: 'transparent',
|
|
190
|
-
width: '32px',
|
|
191
|
-
height: '32px',
|
|
192
|
-
padding: 0,
|
|
193
|
-
margin: '4px',
|
|
194
|
-
verticalAlign: 'middle',
|
|
195
|
-
$nest: {
|
|
196
|
-
'&:hover': {
|
|
197
|
-
backgroundColor: akEmojiSelectedBackgroundColor
|
|
198
|
-
},
|
|
199
|
-
'&:focus': {
|
|
200
|
-
outline: '0'
|
|
201
|
-
},
|
|
202
|
-
span: {
|
|
203
|
-
backgroundColor: 'inherit'
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}); /// Footer
|
|
142
|
+
width: '40px'
|
|
143
|
+
}, _defineProperty(_css6, "& .".concat(emojiNodeStyles), {
|
|
144
|
+
cursor: 'pointer',
|
|
145
|
+
padding: '8px',
|
|
146
|
+
borderRadius: '5px',
|
|
147
|
+
width: '24px',
|
|
148
|
+
height: '24px'
|
|
149
|
+
}), _defineProperty(_css6, "& .".concat(placeholder), {
|
|
150
|
+
padding: '0',
|
|
151
|
+
margin: '7px',
|
|
152
|
+
minWidth: '24px',
|
|
153
|
+
maxWidth: '24px'
|
|
154
|
+
}), _defineProperty(_css6, "& .".concat(emojiNodeStyles, " > img"), {
|
|
155
|
+
position: 'relative',
|
|
156
|
+
left: '50%',
|
|
157
|
+
top: '50%',
|
|
158
|
+
transform: 'translateX(-50%) translateY(-50%)',
|
|
159
|
+
maxHeight: '24px',
|
|
160
|
+
maxWidth: '24px',
|
|
161
|
+
display: 'block'
|
|
162
|
+
}), _defineProperty(_css6, "& .".concat(emojiNodeStyles, " > .").concat(emojiSprite), {
|
|
163
|
+
height: '24px',
|
|
164
|
+
width: '24px'
|
|
165
|
+
}), _css6)); /// Footer
|
|
207
166
|
|
|
208
|
-
export var emojiPickerFooter =
|
|
167
|
+
export var emojiPickerFooter = css({
|
|
209
168
|
flex: '0 0 auto'
|
|
210
169
|
});
|
|
211
|
-
export var emojiPickerFooterWithTopShadow =
|
|
212
|
-
borderTop: "2px solid ".concat(token('color.border',
|
|
170
|
+
export var emojiPickerFooterWithTopShadow = css({
|
|
171
|
+
borderTop: "2px solid ".concat(token('color.border', N30A)),
|
|
213
172
|
boxShadow: "0px -1px 1px 0px ".concat(token('color.border', 'rgba(0, 0, 0, 0.1)'))
|
|
214
173
|
});
|
|
215
|
-
export var emojiActionsContainerWithBottomShadow =
|
|
216
|
-
borderBottom: "2px solid ".concat(token('color.border',
|
|
174
|
+
export var emojiActionsContainerWithBottomShadow = css({
|
|
175
|
+
borderBottom: "2px solid ".concat(token('color.border', N30A)),
|
|
217
176
|
boxShadow: "0px 1px 1px 0px ".concat(token('color.border', 'rgba(0, 0, 0, 0.1)'))
|
|
218
177
|
});
|
|
@@ -16,19 +16,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
16
16
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
import
|
|
19
|
+
/** @jsx jsx */
|
|
20
|
+
import { jsx } from '@emotion/core';
|
|
21
21
|
import uuid from 'uuid';
|
|
22
|
+
import PropTypes from 'prop-types';
|
|
22
23
|
import { PureComponent } from 'react';
|
|
23
24
|
import { defaultListLimit } from '../../util/constants';
|
|
24
25
|
import { toEmojiId } from '../../util/type-helpers';
|
|
25
26
|
import { SearchSort } from '../../types';
|
|
26
27
|
import debug from '../../util/logger';
|
|
27
|
-
import { typeaheadCancelledEvent, typeaheadSelectedEvent, typeaheadRenderedEvent } from '../../util/analytics';
|
|
28
|
+
import { typeaheadCancelledEvent, typeaheadSelectedEvent, typeaheadRenderedEvent, ufoExperiences } from '../../util/analytics';
|
|
28
29
|
import { createRecordSelectionDefault } from '../common/RecordSelectionDefault';
|
|
29
30
|
import EmojiList from './EmojiTypeAheadList';
|
|
30
|
-
import
|
|
31
|
-
import { EmojiContextProvider } from '../../context/EmojiContextProvider';
|
|
31
|
+
import { emojiTypeAhead } from './styles';
|
|
32
32
|
|
|
33
33
|
var isFullShortName = function isFullShortName(query) {
|
|
34
34
|
return query && query.length > 1 && query.charAt(0) === ':' && query.charAt(query.length - 1) === ':';
|
|
@@ -124,6 +124,11 @@ var EmojiTypeAheadComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
124
124
|
|
|
125
125
|
_this.fireAnalyticsEvent(typeaheadRenderedEvent(Date.now() - _this.renderStartTime, query, emojis));
|
|
126
126
|
|
|
127
|
+
ufoExperiences['emoji-searched'].success({
|
|
128
|
+
metadata: {
|
|
129
|
+
emojisLength: emojis.length
|
|
130
|
+
}
|
|
131
|
+
});
|
|
127
132
|
debug('emoji-typeahead.applyPropChanges', emojis.length, wasVisible, visible);
|
|
128
133
|
|
|
129
134
|
_this.setState({
|
|
@@ -187,6 +192,15 @@ var EmojiTypeAheadComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
_createClass(EmojiTypeAheadComponent, [{
|
|
195
|
+
key: "getChildContext",
|
|
196
|
+
value: function getChildContext() {
|
|
197
|
+
return {
|
|
198
|
+
emoji: {
|
|
199
|
+
emojiProvider: this.props.emojiProvider
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
190
204
|
key: "componentDidMount",
|
|
191
205
|
value: function componentDidMount() {
|
|
192
206
|
var emojiProvider = this.props.emojiProvider;
|
|
@@ -206,6 +220,8 @@ var EmojiTypeAheadComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
206
220
|
this.fireAnalyticsEvent(typeaheadCancelledEvent(Date.now() - this.openTime, query, emojis));
|
|
207
221
|
}
|
|
208
222
|
|
|
223
|
+
ufoExperiences['emoji-searched'].abort();
|
|
224
|
+
ufoExperiences['emoji-selection-recorded'].abort();
|
|
209
225
|
this.sessionId = uuid();
|
|
210
226
|
this.selected = false;
|
|
211
227
|
}
|
|
@@ -251,6 +267,11 @@ var EmojiTypeAheadComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
251
267
|
options.sort = SearchSort.UsageFrequency;
|
|
252
268
|
}
|
|
253
269
|
|
|
270
|
+
ufoExperiences['emoji-searched'].start();
|
|
271
|
+
ufoExperiences['emoji-searched'].addMetadata({
|
|
272
|
+
queryLength: (query === null || query === void 0 ? void 0 : query.length) || 0,
|
|
273
|
+
source: 'typeahead'
|
|
274
|
+
});
|
|
254
275
|
this.renderStartTime = Date.now();
|
|
255
276
|
emojiProvider.filter(query, options);
|
|
256
277
|
}
|
|
@@ -286,29 +307,26 @@ var EmojiTypeAheadComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
286
307
|
var style = {
|
|
287
308
|
display: visible ? 'block' : 'none'
|
|
288
309
|
};
|
|
289
|
-
|
|
290
|
-
var emojiContextValue = {
|
|
291
|
-
emoji: {
|
|
292
|
-
emojiProvider: this.props.emojiProvider
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
return /*#__PURE__*/React.createElement(EmojiContextProvider, {
|
|
296
|
-
emojiContextValue: emojiContextValue
|
|
297
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
310
|
+
return jsx("div", {
|
|
298
311
|
style: style,
|
|
299
|
-
className:
|
|
300
|
-
|
|
312
|
+
className: 'ak-emoji-typeahead',
|
|
313
|
+
css: emojiTypeAhead
|
|
314
|
+
}, jsx(EmojiList, {
|
|
301
315
|
emojis: emojis,
|
|
302
316
|
onEmojiSelected: recordUsageOnSelection,
|
|
303
317
|
ref: this.onEmojiListRef,
|
|
304
318
|
loading: loading
|
|
305
|
-
}))
|
|
319
|
+
}));
|
|
306
320
|
}
|
|
307
321
|
}]);
|
|
308
322
|
|
|
309
323
|
return EmojiTypeAheadComponent;
|
|
310
324
|
}(PureComponent);
|
|
311
325
|
|
|
326
|
+
_defineProperty(EmojiTypeAheadComponent, "childContextTypes", {
|
|
327
|
+
emoji: PropTypes.object
|
|
328
|
+
});
|
|
329
|
+
|
|
312
330
|
_defineProperty(EmojiTypeAheadComponent, "defaultProps", {
|
|
313
331
|
onSelection: function onSelection() {},
|
|
314
332
|
onOpen: function onOpen() {},
|
|
@@ -10,13 +10,14 @@ 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
|
-
|
|
13
|
+
/** @jsx jsx */
|
|
14
|
+
import { jsx } from '@emotion/core';
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import { PureComponent } from 'react';
|
|
16
17
|
import { toEmojiId } from '../../util/type-helpers';
|
|
17
18
|
import { leftClick } from '../../util/mouse';
|
|
18
|
-
import
|
|
19
|
-
import
|
|
19
|
+
import { EmojiPreviewComponent } from '../common/EmojiPreviewComponent';
|
|
20
|
+
import { typeAheadItem, selected as selectedStyles, typeAheadItemRow, typeaheadSelected } from './styles';
|
|
20
21
|
|
|
21
22
|
var EmojiTypeAheadItem = /*#__PURE__*/function (_PureComponent) {
|
|
22
23
|
_inherits(EmojiTypeAheadItem, _PureComponent);
|
|
@@ -61,22 +62,19 @@ var EmojiTypeAheadItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
61
62
|
_createClass(EmojiTypeAheadItem, [{
|
|
62
63
|
key: "render",
|
|
63
64
|
value: function render() {
|
|
64
|
-
var _classNames;
|
|
65
|
-
|
|
66
65
|
var _this$props3 = this.props,
|
|
67
66
|
selected = _this$props3.selected,
|
|
68
67
|
emoji = _this$props3.emoji;
|
|
69
|
-
var classes =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
className: classes,
|
|
68
|
+
var classes = [typeAheadItem, selected && selectedStyles];
|
|
69
|
+
return jsx("div", {
|
|
70
|
+
className: "ak-emoji-typeahead-item ".concat(selected ? typeaheadSelected : ''),
|
|
71
|
+
css: classes,
|
|
74
72
|
onMouseDown: this.onEmojiSelected,
|
|
75
73
|
onMouseMove: this.onEmojiMenuItemMouseMove,
|
|
76
74
|
"data-emoji-id": emoji.shortName
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
},
|
|
75
|
+
}, jsx("div", {
|
|
76
|
+
css: typeAheadItemRow
|
|
77
|
+
}, emoji && jsx(EmojiPreviewComponent, {
|
|
80
78
|
emoji: emoji
|
|
81
79
|
})));
|
|
82
80
|
}
|
|
@@ -10,8 +10,9 @@ 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 Spinner from '@atlaskit/spinner';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
16
|
import React from 'react';
|
|
16
17
|
import { PureComponent } from 'react';
|
|
17
18
|
import { emojiTypeAheadMaxHeight } from '../../util/shared-styles';
|
|
@@ -20,7 +21,7 @@ import debug from '../../util/logger';
|
|
|
20
21
|
import { actualMouseMove, mouseLocation } from '../../util/mouse';
|
|
21
22
|
import Scrollable from '../common/Scrollable';
|
|
22
23
|
import EmojiItem from './EmojiTypeAheadItem';
|
|
23
|
-
import
|
|
24
|
+
import { emojiTypeAheadSpinner, emojiTypeAheadSpinnerContainer, typeAheadEmpty, typeAheadList, typeAheadListContainer } from './styles';
|
|
24
25
|
|
|
25
26
|
function wrapIndex(emojis, index) {
|
|
26
27
|
var len = emojis.length;
|
|
@@ -209,9 +210,9 @@ var EmojiTypeAheadList = /*#__PURE__*/function (_PureComponent) {
|
|
|
209
210
|
|
|
210
211
|
if (emojis && emojis.length) {
|
|
211
212
|
this.items = {};
|
|
212
|
-
return
|
|
213
|
+
return jsx("div", null, emojis.map(function (emoji, idx) {
|
|
213
214
|
var key = getKey(emoji);
|
|
214
|
-
var item =
|
|
215
|
+
var item = jsx(EmojiItem, {
|
|
215
216
|
emoji: emoji,
|
|
216
217
|
key: key,
|
|
217
218
|
selected: _this2.isSelectedEmoji(emoji, idx),
|
|
@@ -240,34 +241,31 @@ var EmojiTypeAheadList = /*#__PURE__*/function (_PureComponent) {
|
|
|
240
241
|
}, {
|
|
241
242
|
key: "render",
|
|
242
243
|
value: function render() {
|
|
243
|
-
var _classNames;
|
|
244
|
-
|
|
245
244
|
var _this$props2 = this.props,
|
|
246
245
|
emojis = _this$props2.emojis,
|
|
247
246
|
loading = _this$props2.loading;
|
|
248
247
|
var hasEmoji = emojis && emojis.length;
|
|
249
|
-
var classes =
|
|
250
|
-
'ak-emoji-typeahead-list': true
|
|
251
|
-
}, _defineProperty(_classNames, styles.typeAheadList, true), _defineProperty(_classNames, styles.typeAheadEmpty, !hasEmoji && !loading), _classNames));
|
|
248
|
+
var classes = [typeAheadList, !hasEmoji && !loading && typeAheadEmpty];
|
|
252
249
|
var listBody;
|
|
253
250
|
|
|
254
251
|
if (loading) {
|
|
255
|
-
listBody =
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
},
|
|
252
|
+
listBody = jsx("div", {
|
|
253
|
+
css: emojiTypeAheadSpinnerContainer
|
|
254
|
+
}, jsx("div", {
|
|
255
|
+
css: emojiTypeAheadSpinner
|
|
256
|
+
}, jsx(Spinner, {
|
|
260
257
|
size: "medium"
|
|
261
258
|
})));
|
|
262
259
|
} else {
|
|
263
260
|
listBody = this.renderItems(emojis);
|
|
264
261
|
}
|
|
265
262
|
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
},
|
|
269
|
-
className:
|
|
270
|
-
|
|
263
|
+
return jsx("div", {
|
|
264
|
+
css: typeAheadListContainer
|
|
265
|
+
}, jsx("div", {
|
|
266
|
+
className: 'ak-emoji-typeahead-list',
|
|
267
|
+
css: classes
|
|
268
|
+
}, jsx(Scrollable, {
|
|
271
269
|
ref: this.handleScrollableRef,
|
|
272
270
|
maxHeight: "".concat(emojiTypeAheadMaxHeight, "px")
|
|
273
271
|
}, listBody)));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { style } from 'typestyle';
|
|
1
|
+
import { css } from '@emotion/core';
|
|
3
2
|
import { token } from '@atlaskit/tokens';
|
|
4
3
|
import { emojiPreviewSelectedColor, emojiTypeAheadMaxHeight, emojiTypeAheadWidth, noDialogContainerBorderColor, noDialogContainerBorderRadius, noDialogContainerBoxShadow } from '../../util/shared-styles';
|
|
5
|
-
export var selected = 'emoji-typeahead-selected';
|
|
6
4
|
export var emojiTypeAhead = 'emoji-typeahead-element';
|
|
7
|
-
export var typeAheadListContainer = 'emoji-typeahead-list-container';
|
|
8
|
-
|
|
5
|
+
export var typeAheadListContainer = 'emoji-typeahead-list-container'; // editor-core is using this static class name for testing
|
|
6
|
+
|
|
7
|
+
export var typeaheadSelected = 'emoji-typeahead-selected';
|
|
8
|
+
export var typeAheadList = css({
|
|
9
9
|
background: token('elevation.surface.overlay', 'white'),
|
|
10
10
|
border: "1px solid ".concat(noDialogContainerBorderColor),
|
|
11
11
|
borderRadius: noDialogContainerBorderRadius,
|
|
@@ -13,31 +13,31 @@ export var typeAheadList = style({
|
|
|
13
13
|
color: token('color.text.subtle', '#333'),
|
|
14
14
|
width: emojiTypeAheadWidth
|
|
15
15
|
});
|
|
16
|
-
export var typeAheadEmpty =
|
|
16
|
+
export var typeAheadEmpty = css({
|
|
17
17
|
display: 'none'
|
|
18
18
|
});
|
|
19
|
-
export var
|
|
19
|
+
export var selected = css({
|
|
20
|
+
backgroundColor: emojiPreviewSelectedColor
|
|
21
|
+
});
|
|
22
|
+
export var typeAheadItem = css({
|
|
20
23
|
cursor: 'pointer',
|
|
21
24
|
display: 'block',
|
|
22
25
|
listStyleType: 'none',
|
|
23
26
|
overflow: 'hidden',
|
|
24
|
-
width: emojiTypeAheadWidth
|
|
25
|
-
$nest: _defineProperty({}, "&.".concat(selected), {
|
|
26
|
-
backgroundColor: emojiPreviewSelectedColor
|
|
27
|
-
})
|
|
27
|
+
width: emojiTypeAheadWidth
|
|
28
28
|
});
|
|
29
|
-
export var typeAheadItemRow =
|
|
29
|
+
export var typeAheadItemRow = css({
|
|
30
30
|
display: 'flex',
|
|
31
31
|
flexDirection: 'row',
|
|
32
32
|
flexWrap: 'wrap',
|
|
33
33
|
verticalAlign: 'middle'
|
|
34
34
|
});
|
|
35
|
-
export var emojiTypeAheadSpinnerContainer =
|
|
35
|
+
export var emojiTypeAheadSpinnerContainer = css({
|
|
36
36
|
position: 'relative',
|
|
37
37
|
height: "".concat(emojiTypeAheadMaxHeight, "px"),
|
|
38
38
|
paddingTop: "".concat(((emojiTypeAheadMaxHeight - 30) / 2).toFixed(), "px"),
|
|
39
39
|
boxSizing: 'border-box'
|
|
40
40
|
});
|
|
41
|
-
export var emojiTypeAheadSpinner =
|
|
41
|
+
export var emojiTypeAheadSpinner = css({
|
|
42
42
|
textAlign: 'center'
|
|
43
43
|
});
|