@atlaskit/editor-plugin-emoji 3.6.7 → 3.7.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-emoji
2
2
 
3
+ ## 3.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#160575](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160575)
8
+ [`c340cf0e2d6c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c340cf0e2d6c2) -
9
+ Expose emoji provider promise to initialise in the toolbar earlier.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 3.6.7
4
16
 
5
17
  ### Patch Changes
@@ -266,12 +266,14 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
266
266
  emojiResourceConfig = _ref9.emojiResourceConfig,
267
267
  asciiMap = _ref9.asciiMap,
268
268
  emojiProvider = _ref9.emojiProvider,
269
- inlineEmojiPopupOpen = _ref9.inlineEmojiPopupOpen;
269
+ inlineEmojiPopupOpen = _ref9.inlineEmojiPopupOpen,
270
+ emojiProviderPromise = _ref9.emojiProviderPromise;
270
271
  return {
271
272
  emojiResourceConfig: emojiResourceConfig,
272
273
  asciiMap: asciiMap,
273
274
  typeAheadHandler: typeAhead,
274
275
  emojiProvider: emojiProvider,
276
+ emojiProviderPromise: emojiProviderPromise,
275
277
  inlineEmojiPopupOpen: inlineEmojiPopupOpen
276
278
  };
277
279
  },
@@ -506,6 +508,11 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
506
508
  key: emojiPluginKey,
507
509
  state: {
508
510
  init: function init() {
511
+ if (options !== null && options !== void 0 && options.emojiProvider && (0, _experiments.editorExperiment)('platform_editor_prevent_toolbar_layout_shifts', true)) {
512
+ return {
513
+ emojiProviderPromise: options.emojiProvider
514
+ };
515
+ }
509
516
  return {};
510
517
  },
511
518
  apply: function apply(tr, pluginState) {
@@ -519,7 +526,8 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
519
526
  switch (action) {
520
527
  case _actions.ACTIONS.SET_PROVIDER:
521
528
  newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
522
- emojiProvider: params.provider
529
+ emojiProvider: params.provider,
530
+ emojiProviderPromise: (0, _experiments.editorExperiment)('platform_editor_prevent_toolbar_layout_shifts', true) ? Promise.resolve(params.provider) : undefined
523
531
  });
524
532
  pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
525
533
  return newPluginState;
@@ -248,13 +248,15 @@ export const emojiPlugin = ({
248
248
  emojiResourceConfig,
249
249
  asciiMap,
250
250
  emojiProvider,
251
- inlineEmojiPopupOpen
251
+ inlineEmojiPopupOpen,
252
+ emojiProviderPromise
252
253
  } = (_emojiPluginKey$getSt = emojiPluginKey.getState(editorState)) !== null && _emojiPluginKey$getSt !== void 0 ? _emojiPluginKey$getSt : {};
253
254
  return {
254
255
  emojiResourceConfig,
255
256
  asciiMap,
256
257
  typeAheadHandler: typeAhead,
257
258
  emojiProvider,
259
+ emojiProviderPromise,
258
260
  inlineEmojiPopupOpen
259
261
  };
260
262
  },
@@ -456,6 +458,11 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
456
458
  key: emojiPluginKey,
457
459
  state: {
458
460
  init() {
461
+ if (options !== null && options !== void 0 && options.emojiProvider && editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)) {
462
+ return {
463
+ emojiProviderPromise: options.emojiProvider
464
+ };
465
+ }
459
466
  return {};
460
467
  },
461
468
  apply(tr, pluginState) {
@@ -471,7 +478,8 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
471
478
  case ACTIONS.SET_PROVIDER:
472
479
  newPluginState = {
473
480
  ...pluginState,
474
- emojiProvider: params.provider
481
+ emojiProvider: params.provider,
482
+ emojiProviderPromise: editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true) ? Promise.resolve(params.provider) : undefined
475
483
  };
476
484
  pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
477
485
  return newPluginState;
@@ -251,12 +251,14 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
251
251
  emojiResourceConfig = _ref9.emojiResourceConfig,
252
252
  asciiMap = _ref9.asciiMap,
253
253
  emojiProvider = _ref9.emojiProvider,
254
- inlineEmojiPopupOpen = _ref9.inlineEmojiPopupOpen;
254
+ inlineEmojiPopupOpen = _ref9.inlineEmojiPopupOpen,
255
+ emojiProviderPromise = _ref9.emojiProviderPromise;
255
256
  return {
256
257
  emojiResourceConfig: emojiResourceConfig,
257
258
  asciiMap: asciiMap,
258
259
  typeAheadHandler: typeAhead,
259
260
  emojiProvider: emojiProvider,
261
+ emojiProviderPromise: emojiProviderPromise,
260
262
  inlineEmojiPopupOpen: inlineEmojiPopupOpen
261
263
  };
262
264
  },
@@ -491,6 +493,11 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
491
493
  key: emojiPluginKey,
492
494
  state: {
493
495
  init: function init() {
496
+ if (options !== null && options !== void 0 && options.emojiProvider && editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true)) {
497
+ return {
498
+ emojiProviderPromise: options.emojiProvider
499
+ };
500
+ }
494
501
  return {};
495
502
  },
496
503
  apply: function apply(tr, pluginState) {
@@ -504,7 +511,8 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
504
511
  switch (action) {
505
512
  case ACTIONS.SET_PROVIDER:
506
513
  newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
507
- emojiProvider: params.provider
514
+ emojiProvider: params.provider,
515
+ emojiProviderPromise: editorExperiment('platform_editor_prevent_toolbar_layout_shifts', true) ? Promise.resolve(params.provider) : undefined
508
516
  });
509
517
  pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
510
518
  return newPluginState;
@@ -37,6 +37,12 @@ export type EmojiPluginState = {
37
37
  emojiResourceConfig?: EmojiResourceConfig;
38
38
  asciiMap?: Map<string, EmojiDescription>;
39
39
  inlineEmojiPopupOpen?: boolean;
40
+ /**
41
+ * Occassionally it may be more convenient to deal with the
42
+ * promise version of the emoji provider. This is available
43
+ * immediately if used for the initial configuration
44
+ */
45
+ emojiProviderPromise?: Promise<EmojiProvider>;
40
46
  };
41
47
  export type EmojiPluginSharedState = EmojiPluginState & {
42
48
  typeAheadHandler: TypeAheadHandler;
@@ -37,6 +37,12 @@ export type EmojiPluginState = {
37
37
  emojiResourceConfig?: EmojiResourceConfig;
38
38
  asciiMap?: Map<string, EmojiDescription>;
39
39
  inlineEmojiPopupOpen?: boolean;
40
+ /**
41
+ * Occassionally it may be more convenient to deal with the
42
+ * promise version of the emoji provider. This is available
43
+ * immediately if used for the initial configuration
44
+ */
45
+ emojiProviderPromise?: Promise<EmojiProvider>;
40
46
  };
41
47
  export type EmojiPluginSharedState = EmojiPluginState & {
42
48
  typeAheadHandler: TypeAheadHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-emoji",
3
- "version": "3.6.7",
3
+ "version": "3.7.0",
4
4
  "description": "Emoji plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,23 +23,23 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@atlaskit/adf-schema": "^47.6.0",
26
- "@atlaskit/editor-common": "^105.2.0",
26
+ "@atlaskit/editor-common": "^105.10.0",
27
27
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
28
28
  "@atlaskit/editor-plugin-annotation": "^2.8.0",
29
29
  "@atlaskit/editor-plugin-base": "^3.0.0",
30
- "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
30
+ "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
31
31
  "@atlaskit/editor-plugin-metrics": "^3.4.0",
32
32
  "@atlaskit/editor-plugin-type-ahead": "^2.7.0",
33
33
  "@atlaskit/editor-prosemirror": "7.0.0",
34
34
  "@atlaskit/editor-shared-styles": "^3.4.0",
35
35
  "@atlaskit/emoji": "^69.2.0",
36
- "@atlaskit/icon": "^26.0.0",
36
+ "@atlaskit/icon": "^26.3.0",
37
37
  "@atlaskit/node-data-provider": "^4.1.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
40
40
  "@atlaskit/theme": "^18.0.0",
41
- "@atlaskit/tmp-editor-statsig": "^4.21.0",
42
- "@atlaskit/tokens": "^4.8.0",
41
+ "@atlaskit/tmp-editor-statsig": "^5.0.0",
42
+ "@atlaskit/tokens": "^4.9.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1",
45
45
  "react-intl-next": "npm:react-intl@^5.18.1",