@atlaskit/emoji 67.7.7 → 67.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 67.7.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#137821](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/137821)
8
+ [`f2d1d60fbb2dd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f2d1d60fbb2dd) -
9
+ Feature flagged a change to allow emoji to be lazily indexed
10
+
3
11
  ## 67.7.7
4
12
 
5
13
  ### Patch Changes
@@ -33,6 +33,9 @@
33
33
  {
34
34
  "path": "../../../media/media-client-react/afm-cc/tsconfig.json"
35
35
  },
36
+ {
37
+ "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
38
+ },
36
39
  {
37
40
  "path": "../../../design-system/primitives/afm-cc/tsconfig.json"
38
41
  },
@@ -32,6 +32,9 @@
32
32
  {
33
33
  "path": "../../../media/media-client-react/afm-jira/tsconfig.json"
34
34
  },
35
+ {
36
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
37
+ },
35
38
  {
36
39
  "path": "../../../design-system/primitives/afm-jira/tsconfig.json"
37
40
  },
@@ -32,6 +32,9 @@
32
32
  {
33
33
  "path": "../../../media/media-client-react/afm-post-office/tsconfig.json"
34
34
  },
35
+ {
36
+ "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
37
+ },
35
38
  {
36
39
  "path": "../../../design-system/primitives/afm-post-office/tsconfig.json"
37
40
  },
@@ -16,6 +16,7 @@ var _types = require("../types");
16
16
  var _EmojiRepositoryRegex = require("./EmojiRepositoryRegex");
17
17
  var _Comparators = require("./internal/Comparators");
18
18
  var _UsageFrequencyTracker = require("./internal/UsageFrequencyTracker");
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  // FS-1097 - duplicated in mentions - extract at some point into a shared library
20
21
  var Tokenizer = /*#__PURE__*/function () {
21
22
  function Tokenizer() {
@@ -119,6 +120,7 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
119
120
 
120
121
  function EmojiRepository(emojis, usageTracker) {
121
122
  (0, _classCallCheck2.default)(this, EmojiRepository);
123
+ (0, _defineProperty2.default)(this, "fullSearchReady", false);
122
124
  this.emojis = emojis;
123
125
  this.initMembers(usageTracker);
124
126
  }
@@ -152,7 +154,7 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
152
154
  nameQuery = _splitQuery.nameQuery,
153
155
  asciiQuery = _splitQuery.asciiQuery;
154
156
  if (nameQuery) {
155
- filteredEmoji = this.fullSearch.search(nameQuery);
157
+ filteredEmoji = this.getSearchIndex().search(nameQuery);
156
158
  if (asciiQuery) {
157
159
  filteredEmoji = this.withAsciiMatch(asciiQuery, filteredEmoji);
158
160
  }
@@ -212,7 +214,7 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
212
214
  key: "addUnknownEmoji",
213
215
  value: function addUnknownEmoji(emoji) {
214
216
  this.emojis = [].concat((0, _toConsumableArray2.default)(this.emojis), [emoji]);
215
- this.fullSearch.addDocuments([emoji]);
217
+ this.getSearchIndex().addDocuments([emoji]);
216
218
  this.addToMaps(emoji);
217
219
  this.addToDynamicCategories(emoji);
218
220
  }
@@ -334,7 +336,9 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
334
336
  value: function initMembers(usageTracker) {
335
337
  this.usageTracker = usageTracker || new _UsageFrequencyTracker.UsageFrequencyTracker();
336
338
  this.initRepositoryMetadata();
337
- this.initSearchIndex();
339
+ if (!(0, _platformFeatureFlags.fg)('platform_index_emoji_just_in_time')) {
340
+ this.initSearchIndex();
341
+ }
338
342
  }
339
343
 
340
344
  /**
@@ -368,6 +372,15 @@ var EmojiRepository = exports.default = /*#__PURE__*/function () {
368
372
  this.fullSearch.addIndex('name');
369
373
  this.fullSearch.addIndex('shortName');
370
374
  this.fullSearch.addDocuments(this.getAllSearchableEmojis());
375
+ this.fullSearchReady = true;
376
+ }
377
+ }, {
378
+ key: "getSearchIndex",
379
+ value: function getSearchIndex() {
380
+ if (!this.fullSearchReady) {
381
+ this.initSearchIndex();
382
+ }
383
+ return this.fullSearch;
371
384
  }
372
385
  }, {
373
386
  key: "getAllSearchableEmojis",
@@ -19,7 +19,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
19
19
  actionSubjectId: actionSubjectId,
20
20
  attributes: _objectSpread({
21
21
  packageName: "@atlaskit/emoji",
22
- packageVersion: "67.7.7"
22
+ packageVersion: "67.7.8"
23
23
  }, attributes)
24
24
  };
25
25
  };
@@ -6,6 +6,7 @@ import { SearchSort } from '../types';
6
6
  import { tokenizerRegex } from './EmojiRepositoryRegex';
7
7
  import { createSearchEmojiComparator, createUsageOnlyEmojiComparator } from './internal/Comparators';
8
8
  import { UsageFrequencyTracker } from './internal/UsageFrequencyTracker';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  // FS-1097 - duplicated in mentions - extract at some point into a shared library
10
11
  class Tokenizer {
11
12
  tokenize(text) {
@@ -94,6 +95,7 @@ export default class EmojiRepository {
94
95
  // protected to allow subclasses to access (for testing and storybooks).
95
96
 
96
97
  constructor(emojis, usageTracker) {
98
+ _defineProperty(this, "fullSearchReady", false);
97
99
  this.emojis = emojis;
98
100
  this.initMembers(usageTracker);
99
101
  }
@@ -124,7 +126,7 @@ export default class EmojiRepository {
124
126
  asciiQuery
125
127
  } = splitQuery(query);
126
128
  if (nameQuery) {
127
- filteredEmoji = this.fullSearch.search(nameQuery);
129
+ filteredEmoji = this.getSearchIndex().search(nameQuery);
128
130
  if (asciiQuery) {
129
131
  filteredEmoji = this.withAsciiMatch(asciiQuery, filteredEmoji);
130
132
  }
@@ -170,7 +172,7 @@ export default class EmojiRepository {
170
172
  }
171
173
  addUnknownEmoji(emoji) {
172
174
  this.emojis = [...this.emojis, emoji];
173
- this.fullSearch.addDocuments([emoji]);
175
+ this.getSearchIndex().addDocuments([emoji]);
174
176
  this.addToMaps(emoji);
175
177
  this.addToDynamicCategories(emoji);
176
178
  }
@@ -268,7 +270,9 @@ export default class EmojiRepository {
268
270
  initMembers(usageTracker) {
269
271
  this.usageTracker = usageTracker || new UsageFrequencyTracker();
270
272
  this.initRepositoryMetadata();
271
- this.initSearchIndex();
273
+ if (!fg('platform_index_emoji_just_in_time')) {
274
+ this.initSearchIndex();
275
+ }
272
276
  }
273
277
 
274
278
  /**
@@ -295,6 +299,13 @@ export default class EmojiRepository {
295
299
  this.fullSearch.addIndex('name');
296
300
  this.fullSearch.addIndex('shortName');
297
301
  this.fullSearch.addDocuments(this.getAllSearchableEmojis());
302
+ this.fullSearchReady = true;
303
+ }
304
+ getSearchIndex() {
305
+ if (!this.fullSearchReady) {
306
+ this.initSearchIndex();
307
+ }
308
+ return this.fullSearch;
298
309
  }
299
310
  getAllSearchableEmojis() {
300
311
  return this.emojis.filter(emojiDescription => emojiDescription.searchable);
@@ -7,7 +7,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
7
7
  actionSubjectId,
8
8
  attributes: {
9
9
  packageName: "@atlaskit/emoji",
10
- packageVersion: "67.7.7",
10
+ packageVersion: "67.7.8",
11
11
  ...attributes
12
12
  }
13
13
  });
@@ -9,6 +9,7 @@ import { SearchSort } from '../types';
9
9
  import { tokenizerRegex } from './EmojiRepositoryRegex';
10
10
  import { createSearchEmojiComparator, createUsageOnlyEmojiComparator } from './internal/Comparators';
11
11
  import { UsageFrequencyTracker } from './internal/UsageFrequencyTracker';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
12
13
  // FS-1097 - duplicated in mentions - extract at some point into a shared library
13
14
  var Tokenizer = /*#__PURE__*/function () {
14
15
  function Tokenizer() {
@@ -112,6 +113,7 @@ var EmojiRepository = /*#__PURE__*/function () {
112
113
 
113
114
  function EmojiRepository(emojis, usageTracker) {
114
115
  _classCallCheck(this, EmojiRepository);
116
+ _defineProperty(this, "fullSearchReady", false);
115
117
  this.emojis = emojis;
116
118
  this.initMembers(usageTracker);
117
119
  }
@@ -145,7 +147,7 @@ var EmojiRepository = /*#__PURE__*/function () {
145
147
  nameQuery = _splitQuery.nameQuery,
146
148
  asciiQuery = _splitQuery.asciiQuery;
147
149
  if (nameQuery) {
148
- filteredEmoji = this.fullSearch.search(nameQuery);
150
+ filteredEmoji = this.getSearchIndex().search(nameQuery);
149
151
  if (asciiQuery) {
150
152
  filteredEmoji = this.withAsciiMatch(asciiQuery, filteredEmoji);
151
153
  }
@@ -205,7 +207,7 @@ var EmojiRepository = /*#__PURE__*/function () {
205
207
  key: "addUnknownEmoji",
206
208
  value: function addUnknownEmoji(emoji) {
207
209
  this.emojis = [].concat(_toConsumableArray(this.emojis), [emoji]);
208
- this.fullSearch.addDocuments([emoji]);
210
+ this.getSearchIndex().addDocuments([emoji]);
209
211
  this.addToMaps(emoji);
210
212
  this.addToDynamicCategories(emoji);
211
213
  }
@@ -327,7 +329,9 @@ var EmojiRepository = /*#__PURE__*/function () {
327
329
  value: function initMembers(usageTracker) {
328
330
  this.usageTracker = usageTracker || new UsageFrequencyTracker();
329
331
  this.initRepositoryMetadata();
330
- this.initSearchIndex();
332
+ if (!fg('platform_index_emoji_just_in_time')) {
333
+ this.initSearchIndex();
334
+ }
331
335
  }
332
336
 
333
337
  /**
@@ -361,6 +365,15 @@ var EmojiRepository = /*#__PURE__*/function () {
361
365
  this.fullSearch.addIndex('name');
362
366
  this.fullSearch.addIndex('shortName');
363
367
  this.fullSearch.addDocuments(this.getAllSearchableEmojis());
368
+ this.fullSearchReady = true;
369
+ }
370
+ }, {
371
+ key: "getSearchIndex",
372
+ value: function getSearchIndex() {
373
+ if (!this.fullSearchReady) {
374
+ this.initSearchIndex();
375
+ }
376
+ return this.fullSearch;
364
377
  }
365
378
  }, {
366
379
  key: "getAllSearchableEmojis",
@@ -12,7 +12,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
12
12
  actionSubjectId: actionSubjectId,
13
13
  attributes: _objectSpread({
14
14
  packageName: "@atlaskit/emoji",
15
- packageVersion: "67.7.7"
15
+ packageVersion: "67.7.8"
16
16
  }, attributes)
17
17
  };
18
18
  };
@@ -5,6 +5,7 @@ export declare const getEmojiVariation: (emoji: EmojiDescription, options?: Sear
5
5
  export default class EmojiRepository {
6
6
  private emojis;
7
7
  private fullSearch;
8
+ private fullSearchReady;
8
9
  private shortNameMap;
9
10
  private idMap;
10
11
  private asciiMap;
@@ -66,6 +67,7 @@ export default class EmojiRepository {
66
67
  */
67
68
  private initRepositoryMetadata;
68
69
  private initSearchIndex;
70
+ private getSearchIndex;
69
71
  private getAllSearchableEmojis;
70
72
  private addToMaps;
71
73
  private addToDynamicCategories;
@@ -5,6 +5,7 @@ export declare const getEmojiVariation: (emoji: EmojiDescription, options?: Sear
5
5
  export default class EmojiRepository {
6
6
  private emojis;
7
7
  private fullSearch;
8
+ private fullSearchReady;
8
9
  private shortNameMap;
9
10
  private idMap;
10
11
  private asciiMap;
@@ -66,6 +67,7 @@ export default class EmojiRepository {
66
67
  */
67
68
  private initRepositoryMetadata;
68
69
  private initSearchIndex;
70
+ private getSearchIndex;
69
71
  private getAllSearchableEmojis;
70
72
  private addToMaps;
71
73
  private addToDynamicCategories;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "67.7.7",
3
+ "version": "67.7.8",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,10 +24,6 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Editor: Collaboration",
27
- "releaseModel": "continuous",
28
- "productPushConsumption": [
29
- "jira"
30
- ],
31
27
  "website": {
32
28
  "name": "Emoji"
33
29
  },
@@ -39,10 +35,11 @@
39
35
  "dependencies": {
40
36
  "@atlaskit/analytics-next": "^10.1.0",
41
37
  "@atlaskit/button": "^20.1.0",
42
- "@atlaskit/icon": "^22.15.0",
38
+ "@atlaskit/icon": "^22.16.0",
43
39
  "@atlaskit/media-client": "^27.6.0",
44
40
  "@atlaskit/media-client-react": "^2.2.0",
45
- "@atlaskit/primitives": "^12.0.0",
41
+ "@atlaskit/platform-feature-flags": "^0.3.0",
42
+ "@atlaskit/primitives": "^12.1.0",
46
43
  "@atlaskit/spinner": "^16.3.0",
47
44
  "@atlaskit/textfield": "^6.5.0",
48
45
  "@atlaskit/theme": "^13.0.0",
@@ -119,6 +116,11 @@
119
116
  ]
120
117
  }
121
118
  },
119
+ "platform-feature-flags": {
120
+ "platform_index_emoji_just_in_time": {
121
+ "type": "boolean"
122
+ }
123
+ },
122
124
  "scripts": {
123
125
  "setup-first-time": "yarn run setup-local-config; yarn run setup-env",
124
126
  "setup-local-config": "cp -nv local-config-template.ts local-config.ts",