@atlaskit/emoji 64.2.0 → 64.2.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/api/EmojiResource.js +36 -1
  3. package/dist/cjs/components/common/CachingEmoji.js +33 -5
  4. package/dist/cjs/components/common/Emoji.js +9 -2
  5. package/dist/cjs/components/common/ResourcedEmoji.js +25 -9
  6. package/dist/cjs/components/common/ResourcedEmojiComponent.js +17 -0
  7. package/dist/cjs/components/common/UfoErrorBoundary.js +52 -0
  8. package/dist/cjs/types.js +12 -2
  9. package/dist/cjs/util/{analytics.js → analytics/analytics.js} +34 -2
  10. package/dist/cjs/util/analytics/index.js +203 -0
  11. package/dist/cjs/util/analytics/samplingUfo.js +278 -0
  12. package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +49 -0
  13. package/dist/cjs/util/constants.js +10 -3
  14. package/dist/cjs/version.json +1 -1
  15. package/dist/es2019/api/EmojiResource.js +28 -1
  16. package/dist/es2019/components/common/CachingEmoji.js +29 -5
  17. package/dist/es2019/components/common/Emoji.js +8 -2
  18. package/dist/es2019/components/common/ResourcedEmoji.js +22 -5
  19. package/dist/es2019/components/common/ResourcedEmojiComponent.js +16 -0
  20. package/dist/es2019/components/common/UfoErrorBoundary.js +11 -0
  21. package/dist/es2019/types.js +10 -1
  22. package/dist/es2019/util/{analytics.js → analytics/analytics.js} +28 -1
  23. package/dist/es2019/util/analytics/index.js +3 -0
  24. package/dist/es2019/util/analytics/samplingUfo.js +147 -0
  25. package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +39 -0
  26. package/dist/es2019/util/constants.js +5 -1
  27. package/dist/es2019/version.json +1 -1
  28. package/dist/esm/api/EmojiResource.js +32 -1
  29. package/dist/esm/components/common/CachingEmoji.js +31 -5
  30. package/dist/esm/components/common/Emoji.js +8 -2
  31. package/dist/esm/components/common/ResourcedEmoji.js +22 -9
  32. package/dist/esm/components/common/ResourcedEmojiComponent.js +16 -0
  33. package/dist/esm/components/common/UfoErrorBoundary.js +38 -0
  34. package/dist/esm/types.js +10 -1
  35. package/dist/esm/util/{analytics.js → analytics/analytics.js} +28 -1
  36. package/dist/esm/util/analytics/index.js +3 -0
  37. package/dist/esm/util/analytics/samplingUfo.js +259 -0
  38. package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +39 -0
  39. package/dist/esm/util/constants.js +5 -1
  40. package/dist/esm/version.json +1 -1
  41. package/dist/types/api/EmojiResource.d.ts +1 -0
  42. package/dist/types/components/common/ResourcedEmoji.d.ts +2 -0
  43. package/dist/types/components/common/UfoErrorBoundary.d.ts +8 -0
  44. package/dist/types/types.d.ts +6 -0
  45. package/dist/types/util/{analytics.d.ts → analytics/analytics.d.ts} +9 -5
  46. package/dist/types/util/analytics/index.d.ts +5 -0
  47. package/dist/types/util/analytics/samplingUfo.d.ts +31 -0
  48. package/dist/types/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
  49. package/dist/types/util/constants.d.ts +2 -0
  50. package/package.json +3 -1
@@ -0,0 +1,259 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+
7
+ 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; }
8
+
9
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ 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; }
14
+
15
+ export var ufoExperiencesSampled = {};
16
+
17
+ var sampleChance = function sampleChance(min, max) {
18
+ // min and max included
19
+ return Math.floor(Math.random() * (max - min + 1) + min);
20
+ };
21
+
22
+ export var clearSampled = function clearSampled() {
23
+ var _iterator = _createForOfIteratorHelper(Object.getOwnPropertyNames(ufoExperiencesSampled)),
24
+ _step;
25
+
26
+ try {
27
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
28
+ var prop = _step.value;
29
+ delete ufoExperiencesSampled[prop];
30
+ }
31
+ } catch (err) {
32
+ _iterator.e(err);
33
+ } finally {
34
+ _iterator.f();
35
+ }
36
+ }; // default sampling function to determine which one to be sampled
37
+
38
+ export var isExperienceSampled = function isExperienceSampled(rate) {
39
+ // if invalid sampling rate provided, we sample it
40
+ if (rate > 1 || rate < 0) {
41
+ return true;
42
+ }
43
+
44
+ if (rate === 1) {
45
+ return true;
46
+ }
47
+
48
+ if (rate === 0) {
49
+ return false;
50
+ }
51
+
52
+ var maxCount = Math.ceil(1 / rate);
53
+ var chance = sampleChance(1, maxCount);
54
+ return chance === maxCount;
55
+ };
56
+
57
+ var hasSampledFromStart = function hasSampledFromStart(experience) {
58
+ if (!ufoExperiencesSampled[experience.id]) {
59
+ return false;
60
+ }
61
+
62
+ if (experience.instanceId) {
63
+ // if the instance of concurrent exp has been sampled from start, allow it.
64
+ return ufoExperiencesSampled[experience.id].sampledInstance[experience.instanceId];
65
+ }
66
+
67
+ return ufoExperiencesSampled[experience.id].sampled;
68
+ };
69
+
70
+ /**
71
+ * This function is a temp solution to reduce the event traffic, as UFO package does not support it.
72
+ *
73
+ * e.g. Emoji Picker contains thousands of emojis, which means will trigger a large number of renderred events without sampling
74
+ * @param ufoExperience
75
+ * @returns
76
+ */
77
+ export var withSampling = function withSampling(ufoExperience) {
78
+ var init = function init() {
79
+ if (!ufoExperiencesSampled[ufoExperience.id]) {
80
+ ufoExperiencesSampled[ufoExperience.id] = {
81
+ sampled: false,
82
+ sampledInstance: {}
83
+ };
84
+ }
85
+ };
86
+
87
+ var start = /*#__PURE__*/function () {
88
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
89
+ var isSampled;
90
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
91
+ while (1) {
92
+ switch (_context.prev = _context.next) {
93
+ case 0:
94
+ if (!hasSampledFromStart(ufoExperience)) {
95
+ _context.next = 2;
96
+ break;
97
+ }
98
+
99
+ return _context.abrupt("return");
100
+
101
+ case 2:
102
+ isSampled = options.samplingFunc || isExperienceSampled;
103
+
104
+ if (isSampled(options.samplingRate)) {
105
+ _context.next = 7;
106
+ break;
107
+ }
108
+
109
+ if (ufoExperience.instanceId) {
110
+ ufoExperiencesSampled[ufoExperience.id].sampledInstance[ufoExperience.instanceId] = false;
111
+ }
112
+
113
+ ufoExperiencesSampled[ufoExperience.id].sampled = false;
114
+ return _context.abrupt("return");
115
+
116
+ case 7:
117
+ // update sampled records
118
+ if (ufoExperience.instanceId) {
119
+ ufoExperiencesSampled[ufoExperience.id].sampledInstance[ufoExperience.instanceId] = true;
120
+ ufoExperiencesSampled[ufoExperience.id].sampled = true;
121
+ }
122
+
123
+ return _context.abrupt("return", ufoExperience.start(options.startTime));
124
+
125
+ case 9:
126
+ case "end":
127
+ return _context.stop();
128
+ }
129
+ }
130
+ }, _callee);
131
+ }));
132
+
133
+ return function start(_x) {
134
+ return _ref.apply(this, arguments);
135
+ };
136
+ }();
137
+
138
+ var success = /*#__PURE__*/function () {
139
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
140
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
141
+ while (1) {
142
+ switch (_context2.prev = _context2.next) {
143
+ case 0:
144
+ if (hasSampledFromStart(ufoExperience)) {
145
+ _context2.next = 2;
146
+ break;
147
+ }
148
+
149
+ return _context2.abrupt("return", null);
150
+
151
+ case 2:
152
+ return _context2.abrupt("return", ufoExperience.success(config));
153
+
154
+ case 3:
155
+ case "end":
156
+ return _context2.stop();
157
+ }
158
+ }
159
+ }, _callee2);
160
+ }));
161
+
162
+ return function success(_x2) {
163
+ return _ref2.apply(this, arguments);
164
+ };
165
+ }();
166
+
167
+ var failure = /*#__PURE__*/function () {
168
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(config) {
169
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
170
+ while (1) {
171
+ switch (_context3.prev = _context3.next) {
172
+ case 0:
173
+ if (hasSampledFromStart(ufoExperience)) {
174
+ _context3.next = 2;
175
+ break;
176
+ }
177
+
178
+ return _context3.abrupt("return", null);
179
+
180
+ case 2:
181
+ return _context3.abrupt("return", ufoExperience.failure(config));
182
+
183
+ case 3:
184
+ case "end":
185
+ return _context3.stop();
186
+ }
187
+ }
188
+ }, _callee3);
189
+ }));
190
+
191
+ return function failure(_x3) {
192
+ return _ref3.apply(this, arguments);
193
+ };
194
+ }();
195
+
196
+ var abort = /*#__PURE__*/function () {
197
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(config) {
198
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
199
+ while (1) {
200
+ switch (_context4.prev = _context4.next) {
201
+ case 0:
202
+ if (hasSampledFromStart(ufoExperience)) {
203
+ _context4.next = 2;
204
+ break;
205
+ }
206
+
207
+ return _context4.abrupt("return", null);
208
+
209
+ case 2:
210
+ return _context4.abrupt("return", ufoExperience.abort(config));
211
+
212
+ case 3:
213
+ case "end":
214
+ return _context4.stop();
215
+ }
216
+ }
217
+ }, _callee4);
218
+ }));
219
+
220
+ return function abort(_x4) {
221
+ return _ref4.apply(this, arguments);
222
+ };
223
+ }();
224
+
225
+ var mark = function mark(name, timestamp) {
226
+ if (!hasSampledFromStart(ufoExperience)) {
227
+ return;
228
+ }
229
+
230
+ return ufoExperience.mark(name, timestamp);
231
+ };
232
+
233
+ var markFMP = function markFMP(timestamp) {
234
+ if (!hasSampledFromStart(ufoExperience)) {
235
+ return;
236
+ }
237
+
238
+ return ufoExperience.markFMP(timestamp);
239
+ };
240
+
241
+ var markInlineResponse = function markInlineResponse(timestamp) {
242
+ if (!hasSampledFromStart(ufoExperience)) {
243
+ return;
244
+ }
245
+
246
+ return ufoExperience.markInlineResponse(timestamp);
247
+ };
248
+
249
+ init();
250
+ return _objectSpread(_objectSpread({}, ufoExperience), {}, {
251
+ start: start,
252
+ success: success,
253
+ failure: failure,
254
+ abort: abort,
255
+ mark: mark,
256
+ markFMP: markFMP,
257
+ markInlineResponse: markInlineResponse
258
+ });
259
+ };
@@ -0,0 +1,39 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { withSampling } from './samplingUfo';
3
+
4
+ var useConstructor = function useConstructor(callback) {
5
+ var hasBeenFired = useRef(false);
6
+
7
+ if (!hasBeenFired.current) {
8
+ callback();
9
+ hasBeenFired.current = true;
10
+ }
11
+
12
+ return null;
13
+ };
14
+ /**
15
+ * A hook to start an experience and to auto abort the experience when the parent component is unmounted.
16
+ * Use this instead of a direct call to `experience.start`. If you need to restart the experience
17
+ * simply trigger an unmount and remount of the parent component.
18
+ * @param experience the experience to start and abort
19
+ */
20
+
21
+
22
+ export var useSampledUFOComponentExperience = function useSampledUFOComponentExperience(experience, samplingRate, metadata) {
23
+ useEffect(function () {
24
+ return function () {
25
+ withSampling(experience).abort();
26
+ }; // we want this cleanup to only happen on unmount so this is a legit use of empty array
27
+ // eslint-disable-next-line react-hooks/exhaustive-deps
28
+ }, []);
29
+ useConstructor(function () {
30
+ withSampling(experience).start({
31
+ samplingRate: samplingRate
32
+ });
33
+
34
+ if (metadata) {
35
+ experience.addMetadata(metadata);
36
+ }
37
+ });
38
+ return null;
39
+ };
@@ -19,4 +19,8 @@ export var selectedToneStorageKey = "".concat(localStoragePrefix, ".selectedTone
19
19
  export var defaultCategories = ['PEOPLE', 'NATURE', 'FOODS', 'ACTIVITY', 'PLACES', 'OBJECTS', 'SYMBOLS', 'FLAGS'];
20
20
  export var defaultListLimit = 50;
21
21
  export var migrationUserId = 'hipchat_migration_emoticons';
22
- export var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker';
22
+ export var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker'; // This is the base sampling rate in Emoji
23
+
24
+ export var SAMPLING_RATE_EMOJI_RENDERED_EXP = 0.05; // This rate is used in ResourceEmoji which will be used in stead of base sampling rate above
25
+
26
+ export var SAMPLING_RATE_EMOJI_RENDERED_EXP_RESOURCEEMOJI = 0.1; // add more sampling rate in parent components like EmojiTypeAheadItem.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.2.0",
3
+ "version": "64.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -59,6 +59,7 @@ export declare class EmojiResource extends AbstractResource<string, EmojiSearchR
59
59
  protected selectedTone: ToneSelection;
60
60
  protected currentUser?: User;
61
61
  constructor(config: EmojiResourceConfig);
62
+ private getProviderType;
62
63
  protected initEmojiRepository(emojiResponses: EmojiResponse[]): void;
63
64
  protected initSiteEmojiResource(emojiResponse: EmojiResponse, provider: ServiceConfig): Promise<void>;
64
65
  private performRetries;
@@ -10,6 +10,8 @@ export default class ResourcedEmoji extends LoadingEmojiComponent<Props, Loading
10
10
  state: {
11
11
  asyncLoadedComponent: React.ComponentClass<ComponentProps, any>;
12
12
  };
13
+ constructor(props: Props);
14
+ componentWillUnmount(): void;
13
15
  asyncLoadComponent(): void;
14
16
  renderLoading(): JSX.Element;
15
17
  renderLoaded(loadedEmojiProvider: EmojiProvider, ResourcedEmojiComponent: ComponentClass<ComponentProps>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { UFOExperience } from '@atlaskit/ufo';
3
+ export declare class UfoErrorBoundary extends React.Component<{
4
+ experiences: UFOExperience[];
5
+ }> {
6
+ componentDidCatch(): void;
7
+ render(): React.ReactNode;
8
+ }
@@ -296,3 +296,9 @@ export interface User {
296
296
  }
297
297
  export declare type OptionalUser = User | undefined;
298
298
  export declare type Message = React.ReactNode;
299
+ export declare enum ProviderTypes {
300
+ SITE = "SITE",
301
+ STANDARD = "STANDARD",
302
+ ATLASSIAN = "ATLASSIAN",
303
+ UNKNOWN = "UNKNOWN"
304
+ }
@@ -1,5 +1,9 @@
1
1
  import { AnalyticsEventPayload, CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { EmojiDescription } from '../types';
2
+ import { EmojiDescription, EmojiId } from '../../types';
3
+ import { ConcurrentExperience } from '@atlaskit/ufo';
4
+ export declare type UfoExperienceName = 'emoji-rendered' | 'emoji-resource-fetched';
5
+ export declare const ufoExperiences: Record<UfoExperienceName, ConcurrentExperience>;
6
+ export declare const sampledUfoRenderedEmoji: (emojiId: EmojiId) => import("./samplingUfo").WithSampling;
3
7
  export declare const createAndFireEventInElementsChannel: (payload: Record<string, any>) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
4
8
  export declare type EmojiInsertionAnalytic = (source: 'picker' | 'typeahead') => AnalyticsEventPayload;
5
9
  export declare const insertionSucceeded: EmojiInsertionAnalytic;
@@ -42,12 +46,12 @@ export declare const uploadSucceededEvent: (attributes: Duration) => Record<stri
42
46
  export declare const uploadFailedEvent: (attributes: {
43
47
  reason: string;
44
48
  } & Duration) => Record<string, any>;
45
- interface EmojiId {
49
+ interface Attributes {
46
50
  emojiId?: string;
47
51
  }
48
- export declare const deleteBeginEvent: (attributes: EmojiId) => Record<string, any>;
49
- export declare const deleteConfirmEvent: (attributes: EmojiId) => Record<string, any>;
50
- export declare const deleteCancelEvent: (attributes: EmojiId) => Record<string, any>;
52
+ export declare const deleteBeginEvent: (attributes: Attributes) => Record<string, any>;
53
+ export declare const deleteConfirmEvent: (attributes: Attributes) => Record<string, any>;
54
+ export declare const deleteCancelEvent: (attributes: Attributes) => Record<string, any>;
51
55
  export declare const selectedFileEvent: () => Record<string, any>;
52
56
  export declare const typeaheadCancelledEvent: (duration: number, query?: string | undefined, emojiList?: EmojiDescription[] | undefined) => Record<string, any>;
53
57
  export declare const typeaheadSelectedEvent: (pressed: boolean, duration: number, emoji: EmojiDescription, emojiList?: EmojiDescription[] | undefined, query?: string | undefined, exactMatch?: boolean | undefined) => Record<string, any>;
@@ -0,0 +1,5 @@
1
+ export { ufoExperiencesSampled, clearSampled, isExperienceSampled, withSampling, } from './samplingUfo';
2
+ export type { UFOExperienceSampledRecords, WithSampling } from './samplingUfo';
3
+ export { categoryClickedEvent, createAndFireEventInElementsChannel, closedPickerEvent, deleteBeginEvent, deleteCancelEvent, deleteConfirmEvent, insertionFailed, insertionSucceeded, openedPickerEvent, pickerClickedEvent, pickerSearchedEvent, recordSelectionFailedSli, recordSelectionSucceededSli, sampledUfoRenderedEmoji, selectedFileEvent, toneSelectedEvent, toneSelectorClosedEvent, toneSelectorOpenedEvent, typeaheadCancelledEvent, typeaheadRenderedEvent, typeaheadSelectedEvent, ufoExperiences, uploadBeginButton, uploadCancelButton, uploadConfirmButton, uploadFailedEvent, uploadSucceededEvent, } from './analytics';
4
+ export type { EmojiInsertionAnalytic, UfoExperienceName } from './analytics';
5
+ export { useSampledUFOComponentExperience } from './useSampledUFOComponentExperience';
@@ -0,0 +1,31 @@
1
+ import { UFOExperience } from '@atlaskit/ufo';
2
+ export interface UFOExperienceSampledRecords {
3
+ [experienceName: string]: UFOExperienceSampledRecord;
4
+ }
5
+ interface SamplingInstancesRecord {
6
+ [key: string]: boolean;
7
+ }
8
+ interface UFOExperienceSampledRecord {
9
+ sampledInstance: SamplingInstancesRecord;
10
+ sampled: boolean;
11
+ }
12
+ export declare const ufoExperiencesSampled: UFOExperienceSampledRecords;
13
+ declare type SamplingFunc = (rate: number) => boolean;
14
+ export declare const clearSampled: () => void;
15
+ export declare const isExperienceSampled: (rate: number) => boolean;
16
+ export interface WithSampling extends Omit<UFOExperience, 'start'> {
17
+ start: (options: {
18
+ samplingRate: number;
19
+ samplingFunc?: SamplingFunc;
20
+ startTime?: number;
21
+ }) => Promise<void>;
22
+ }
23
+ /**
24
+ * This function is a temp solution to reduce the event traffic, as UFO package does not support it.
25
+ *
26
+ * e.g. Emoji Picker contains thousands of emojis, which means will trigger a large number of renderred events without sampling
27
+ * @param ufoExperience
28
+ * @returns
29
+ */
30
+ export declare const withSampling: (ufoExperience: UFOExperience) => WithSampling;
31
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CustomData, UFOExperience } from '@atlaskit/ufo';
2
+ /**
3
+ * A hook to start an experience and to auto abort the experience when the parent component is unmounted.
4
+ * Use this instead of a direct call to `experience.start`. If you need to restart the experience
5
+ * simply trigger an unmount and remount of the parent component.
6
+ * @param experience the experience to start and abort
7
+ */
8
+ export declare const useSampledUFOComponentExperience: (experience: UFOExperience, samplingRate: number, metadata?: CustomData | undefined) => null;
@@ -20,3 +20,5 @@ export declare const defaultCategories: CategoryId[];
20
20
  export declare const defaultListLimit = 50;
21
21
  export declare const migrationUserId = "hipchat_migration_emoticons";
22
22
  export declare const analyticsEmojiPrefix = "atlassian.fabric.emoji.picker";
23
+ export declare const SAMPLING_RATE_EMOJI_RENDERED_EXP = 0.05;
24
+ export declare const SAMPLING_RATE_EMOJI_RENDERED_EXP_RESOURCEEMOJI = 0.1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.2.0",
3
+ "version": "64.2.1",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,6 +35,7 @@
35
35
  "@atlaskit/theme": "^12.1.0",
36
36
  "@atlaskit/tokens": "^0.7.0",
37
37
  "@atlaskit/tooltip": "^17.5.0",
38
+ "@atlaskit/ufo": "^0.1.0",
38
39
  "@atlaskit/util-service-support": "^6.1.0",
39
40
  "@babel/runtime": "^7.0.0",
40
41
  "classnames": "^2.2.5",
@@ -59,6 +60,7 @@
59
60
  "@atlaskit/util-data-test": "^17.2.0",
60
61
  "@atlaskit/visual-regression": "*",
61
62
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
63
+ "@atlassian/ufo": "^0.1.10",
62
64
  "@testing-library/react": "^8.0.1",
63
65
  "@types/js-search": "^1.4.0",
64
66
  "@types/react-virtualized": "^9.18.12",