@atlaskit/editor-plugin-emoji 2.6.2 → 2.6.3
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 +8 -0
- package/dist/cjs/plugin.js +8 -20
- package/dist/cjs/pm-plugins/ascii-input-rules.js +11 -26
- package/dist/es2019/plugin.js +8 -20
- package/dist/es2019/pm-plugins/ascii-input-rules.js +12 -27
- package/dist/esm/plugin.js +8 -20
- package/dist/esm/pm-plugins/ascii-input-rules.js +11 -26
- package/dist/types/pm-plugins/ascii-input-rules.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/ascii-input-rules.d.ts +1 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 2.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#146966](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/146966)
|
|
8
|
+
[`ee4562a10804e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ee4562a10804e) -
|
|
9
|
+
cleaned up platform_editor_get_emoji_provider_from_config feature flag
|
|
10
|
+
|
|
3
11
|
## 2.6.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -206,10 +206,8 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
206
206
|
name: 'emojiAsciiInputRule',
|
|
207
207
|
plugin: function plugin(_ref7) {
|
|
208
208
|
var _api$analytics4;
|
|
209
|
-
var schema = _ref7.schema
|
|
210
|
-
|
|
211
|
-
featureFlags = _ref7.featureFlags;
|
|
212
|
-
return (0, _asciiInputRules.inputRulePlugin)(schema, providerFactory, featureFlags, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
209
|
+
var schema = _ref7.schema;
|
|
210
|
+
return (0, _asciiInputRules.inputRulePlugin)(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
213
211
|
}
|
|
214
212
|
}];
|
|
215
213
|
},
|
|
@@ -388,17 +386,13 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
388
386
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
389
387
|
emojiProvider: params.provider
|
|
390
388
|
});
|
|
391
|
-
|
|
392
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
393
|
-
}
|
|
389
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
394
390
|
return newPluginState;
|
|
395
391
|
case _actions.ACTIONS.SET_ASCII_MAP:
|
|
396
392
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
397
393
|
asciiMap: params.asciiMap
|
|
398
394
|
});
|
|
399
|
-
|
|
400
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
401
|
-
}
|
|
395
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
402
396
|
return newPluginState;
|
|
403
397
|
}
|
|
404
398
|
return newPluginState;
|
|
@@ -439,19 +433,13 @@ function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
439
433
|
}
|
|
440
434
|
return;
|
|
441
435
|
};
|
|
442
|
-
if (
|
|
443
|
-
|
|
444
|
-
providerHandler('emojiProvider', options.emojiProvider);
|
|
445
|
-
}
|
|
446
|
-
} else {
|
|
447
|
-
pmPluginFactoryParams.providerFactory.subscribe('emojiProvider', providerHandler);
|
|
436
|
+
if (options !== null && options !== void 0 && options.emojiProvider) {
|
|
437
|
+
providerHandler('emojiProvider', options.emojiProvider);
|
|
448
438
|
}
|
|
449
439
|
return {
|
|
450
440
|
destroy: function destroy() {
|
|
451
|
-
if (
|
|
452
|
-
|
|
453
|
-
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
454
|
-
}
|
|
441
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
442
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
455
443
|
}
|
|
456
444
|
}
|
|
457
445
|
};
|
|
@@ -18,43 +18,28 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
18
18
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
23
22
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
24
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
24
|
var matcher;
|
|
26
|
-
function inputRulePlugin(schema,
|
|
27
|
-
if (schema.nodes.emoji
|
|
28
|
-
initMatcher(
|
|
25
|
+
function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
26
|
+
if (schema.nodes.emoji) {
|
|
27
|
+
initMatcher(pluginInjectionApi);
|
|
29
28
|
var asciiEmojiRule = (0, _utils.createRule)(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
|
30
29
|
return new _safePlugin.SafePlugin((0, _prosemirrorInputRules.createPlugin)('emoji', [asciiEmojiRule]));
|
|
31
30
|
}
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
|
-
function initMatcher(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
provider.then(function (emojiProvider) {
|
|
33
|
+
function initMatcher(pluginInjectionApi) {
|
|
34
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.emoji.sharedState.onChange(function (_ref) {
|
|
35
|
+
var nextSharedState = _ref.nextSharedState;
|
|
36
|
+
var emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
37
|
+
if (emojiProvider) {
|
|
40
38
|
emojiProvider.getAsciiMap().then(function (map) {
|
|
41
39
|
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
42
40
|
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_get_emoji_provider_from_config')) {
|
|
46
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.emoji.sharedState.onChange(function (_ref) {
|
|
47
|
-
var nextSharedState = _ref.nextSharedState;
|
|
48
|
-
var emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
49
|
-
if (emojiProvider) {
|
|
50
|
-
emojiProvider.getAsciiMap().then(function (map) {
|
|
51
|
-
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
providerFactory.subscribe('emojiProvider', handleProvider);
|
|
57
|
-
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
58
43
|
}
|
|
59
44
|
var inputRuleHandler = function inputRuleHandler(editorAnalyticsAPI) {
|
|
60
45
|
return function (state, matchParts, start, end) {
|
|
@@ -241,7 +226,7 @@ var AsciiEmojiTransactionCreator = /*#__PURE__*/function () {
|
|
|
241
226
|
}();
|
|
242
227
|
var stateKey = exports.stateKey = new _state.PluginKey('asciiEmojiPlugin');
|
|
243
228
|
var plugins = function plugins(schema, providerFactory, featureFlags, editorAnalyticsAPI, pluginInjectionApi) {
|
|
244
|
-
return [inputRulePlugin(schema,
|
|
229
|
+
return [inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi)].filter(function (plugin) {
|
|
245
230
|
return !!plugin;
|
|
246
231
|
});
|
|
247
232
|
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -186,12 +186,10 @@ export const emojiPlugin = ({
|
|
|
186
186
|
}, {
|
|
187
187
|
name: 'emojiAsciiInputRule',
|
|
188
188
|
plugin: ({
|
|
189
|
-
schema
|
|
190
|
-
providerFactory,
|
|
191
|
-
featureFlags
|
|
189
|
+
schema
|
|
192
190
|
}) => {
|
|
193
191
|
var _api$analytics4;
|
|
194
|
-
return asciiInputRulePlugin(schema,
|
|
192
|
+
return asciiInputRulePlugin(schema, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
195
193
|
}
|
|
196
194
|
}];
|
|
197
195
|
},
|
|
@@ -341,18 +339,14 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
341
339
|
...pluginState,
|
|
342
340
|
emojiProvider: params.provider
|
|
343
341
|
};
|
|
344
|
-
|
|
345
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
346
|
-
}
|
|
342
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
347
343
|
return newPluginState;
|
|
348
344
|
case ACTIONS.SET_ASCII_MAP:
|
|
349
345
|
newPluginState = {
|
|
350
346
|
...pluginState,
|
|
351
347
|
asciiMap: params.asciiMap
|
|
352
348
|
};
|
|
353
|
-
|
|
354
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
355
|
-
}
|
|
349
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
356
350
|
return newPluginState;
|
|
357
351
|
}
|
|
358
352
|
return newPluginState;
|
|
@@ -393,19 +387,13 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
393
387
|
}
|
|
394
388
|
return;
|
|
395
389
|
};
|
|
396
|
-
if (
|
|
397
|
-
|
|
398
|
-
providerHandler('emojiProvider', options.emojiProvider);
|
|
399
|
-
}
|
|
400
|
-
} else {
|
|
401
|
-
pmPluginFactoryParams.providerFactory.subscribe('emojiProvider', providerHandler);
|
|
390
|
+
if (options !== null && options !== void 0 && options.emojiProvider) {
|
|
391
|
+
providerHandler('emojiProvider', options.emojiProvider);
|
|
402
392
|
}
|
|
403
393
|
return {
|
|
404
394
|
destroy() {
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
408
|
-
}
|
|
395
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
396
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
409
397
|
}
|
|
410
398
|
}
|
|
411
399
|
};
|
|
@@ -3,42 +3,27 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
8
7
|
let matcher;
|
|
9
|
-
export function inputRulePlugin(schema,
|
|
10
|
-
if (schema.nodes.emoji
|
|
11
|
-
initMatcher(
|
|
8
|
+
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
9
|
+
if (schema.nodes.emoji) {
|
|
10
|
+
initMatcher(pluginInjectionApi);
|
|
12
11
|
const asciiEmojiRule = createRule(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
|
13
12
|
return new SafePlugin(createPlugin('emoji', [asciiEmojiRule]));
|
|
14
13
|
}
|
|
15
14
|
return;
|
|
16
15
|
}
|
|
17
|
-
function initMatcher(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function initMatcher(pluginInjectionApi) {
|
|
17
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.emoji.sharedState.onChange(({
|
|
18
|
+
nextSharedState
|
|
19
|
+
}) => {
|
|
20
|
+
const emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
21
|
+
if (emojiProvider) {
|
|
23
22
|
emojiProvider.getAsciiMap().then(map => {
|
|
24
23
|
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
25
24
|
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
if (fg('platform_editor_get_emoji_provider_from_config')) {
|
|
29
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.emoji.sharedState.onChange(({
|
|
30
|
-
nextSharedState
|
|
31
|
-
}) => {
|
|
32
|
-
const emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
33
|
-
if (emojiProvider) {
|
|
34
|
-
emojiProvider.getAsciiMap().then(map => {
|
|
35
|
-
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
} else {
|
|
40
|
-
providerFactory.subscribe('emojiProvider', handleProvider);
|
|
41
|
-
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
42
27
|
}
|
|
43
28
|
const inputRuleHandler = editorAnalyticsAPI => (state, matchParts, start, end) => {
|
|
44
29
|
if (!matcher) {
|
|
@@ -179,6 +164,6 @@ class AsciiEmojiTransactionCreator {
|
|
|
179
164
|
}
|
|
180
165
|
export const stateKey = new PluginKey('asciiEmojiPlugin');
|
|
181
166
|
const plugins = (schema, providerFactory, featureFlags, editorAnalyticsAPI, pluginInjectionApi) => {
|
|
182
|
-
return [inputRulePlugin(schema,
|
|
167
|
+
return [inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi)].filter(plugin => !!plugin);
|
|
183
168
|
};
|
|
184
169
|
export default plugins;
|
package/dist/esm/plugin.js
CHANGED
|
@@ -194,10 +194,8 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
194
194
|
name: 'emojiAsciiInputRule',
|
|
195
195
|
plugin: function plugin(_ref7) {
|
|
196
196
|
var _api$analytics4;
|
|
197
|
-
var schema = _ref7.schema
|
|
198
|
-
|
|
199
|
-
featureFlags = _ref7.featureFlags;
|
|
200
|
-
return asciiInputRulePlugin(schema, providerFactory, featureFlags, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
197
|
+
var schema = _ref7.schema;
|
|
198
|
+
return asciiInputRulePlugin(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
201
199
|
}
|
|
202
200
|
}];
|
|
203
201
|
},
|
|
@@ -376,17 +374,13 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
376
374
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
377
375
|
emojiProvider: params.provider
|
|
378
376
|
});
|
|
379
|
-
|
|
380
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
381
|
-
}
|
|
377
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
382
378
|
return newPluginState;
|
|
383
379
|
case ACTIONS.SET_ASCII_MAP:
|
|
384
380
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
385
381
|
asciiMap: params.asciiMap
|
|
386
382
|
});
|
|
387
|
-
|
|
388
|
-
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
389
|
-
}
|
|
383
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
390
384
|
return newPluginState;
|
|
391
385
|
}
|
|
392
386
|
return newPluginState;
|
|
@@ -427,19 +421,13 @@ export function createEmojiPlugin(pmPluginFactoryParams, options, api) {
|
|
|
427
421
|
}
|
|
428
422
|
return;
|
|
429
423
|
};
|
|
430
|
-
if (
|
|
431
|
-
|
|
432
|
-
providerHandler('emojiProvider', options.emojiProvider);
|
|
433
|
-
}
|
|
434
|
-
} else {
|
|
435
|
-
pmPluginFactoryParams.providerFactory.subscribe('emojiProvider', providerHandler);
|
|
424
|
+
if (options !== null && options !== void 0 && options.emojiProvider) {
|
|
425
|
+
providerHandler('emojiProvider', options.emojiProvider);
|
|
436
426
|
}
|
|
437
427
|
return {
|
|
438
428
|
destroy: function destroy() {
|
|
439
|
-
if (
|
|
440
|
-
|
|
441
|
-
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
442
|
-
}
|
|
429
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
430
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
443
431
|
}
|
|
444
432
|
}
|
|
445
433
|
};
|
|
@@ -11,41 +11,26 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
11
11
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
12
12
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
16
15
|
var matcher;
|
|
17
|
-
export function inputRulePlugin(schema,
|
|
18
|
-
if (schema.nodes.emoji
|
|
19
|
-
initMatcher(
|
|
16
|
+
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
17
|
+
if (schema.nodes.emoji) {
|
|
18
|
+
initMatcher(pluginInjectionApi);
|
|
20
19
|
var asciiEmojiRule = createRule(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
|
21
20
|
return new SafePlugin(createPlugin('emoji', [asciiEmojiRule]));
|
|
22
21
|
}
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
function initMatcher(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
provider.then(function (emojiProvider) {
|
|
24
|
+
function initMatcher(pluginInjectionApi) {
|
|
25
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.emoji.sharedState.onChange(function (_ref) {
|
|
26
|
+
var nextSharedState = _ref.nextSharedState;
|
|
27
|
+
var emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
28
|
+
if (emojiProvider) {
|
|
31
29
|
emojiProvider.getAsciiMap().then(function (map) {
|
|
32
30
|
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
33
31
|
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
if (fg('platform_editor_get_emoji_provider_from_config')) {
|
|
37
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.emoji.sharedState.onChange(function (_ref) {
|
|
38
|
-
var nextSharedState = _ref.nextSharedState;
|
|
39
|
-
var emojiProvider = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.emojiProvider;
|
|
40
|
-
if (emojiProvider) {
|
|
41
|
-
emojiProvider.getAsciiMap().then(function (map) {
|
|
42
|
-
matcher = new RecordingAsciiEmojiMatcher(emojiProvider, map);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
providerFactory.subscribe('emojiProvider', handleProvider);
|
|
48
|
-
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
49
34
|
}
|
|
50
35
|
var inputRuleHandler = function inputRuleHandler(editorAnalyticsAPI) {
|
|
51
36
|
return function (state, matchParts, start, end) {
|
|
@@ -232,7 +217,7 @@ var AsciiEmojiTransactionCreator = /*#__PURE__*/function () {
|
|
|
232
217
|
}();
|
|
233
218
|
export var stateKey = new PluginKey('asciiEmojiPlugin');
|
|
234
219
|
var plugins = function plugins(schema, providerFactory, featureFlags, editorAnalyticsAPI, pluginInjectionApi) {
|
|
235
|
-
return [inputRulePlugin(schema,
|
|
220
|
+
return [inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi)].filter(function (plugin) {
|
|
236
221
|
return !!plugin;
|
|
237
222
|
});
|
|
238
223
|
};
|
|
@@ -5,7 +5,7 @@ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/
|
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { type EmojiPlugin } from '../types';
|
|
8
|
-
export declare function inputRulePlugin(schema: Schema,
|
|
8
|
+
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined): SafePlugin | undefined;
|
|
9
9
|
export declare const stateKey: PluginKey<any>;
|
|
10
10
|
declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined) => SafePlugin<any>[];
|
|
11
11
|
export default plugins;
|
|
@@ -5,7 +5,7 @@ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/
|
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { type EmojiPlugin } from '../types';
|
|
8
|
-
export declare function inputRulePlugin(schema: Schema,
|
|
8
|
+
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined): SafePlugin | undefined;
|
|
9
9
|
export declare const stateKey: PluginKey<any>;
|
|
10
10
|
declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined) => SafePlugin<any>[];
|
|
11
11
|
export default plugins;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
24
|
-
"@atlaskit/editor-common": "^91.
|
|
24
|
+
"@atlaskit/editor-common": "^91.2.0",
|
|
25
25
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
26
26
|
"@atlaskit/editor-plugin-type-ahead": "^1.8.0",
|
|
27
27
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
28
|
-
"@atlaskit/emoji": "^67.
|
|
28
|
+
"@atlaskit/emoji": "^67.8.0",
|
|
29
29
|
"@atlaskit/node-data-provider": "^2.0.0",
|
|
30
30
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
31
31
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
@@ -96,9 +96,6 @@
|
|
|
96
96
|
"platform-feature-flags": {
|
|
97
97
|
"editor_inline_comments_paste_insert_nodes": {
|
|
98
98
|
"type": "boolean"
|
|
99
|
-
},
|
|
100
|
-
"platform_editor_get_emoji_provider_from_config": {
|
|
101
|
-
"type": "boolean"
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
101
|
}
|