@atlaskit/editor-plugin-emoji 7.2.0 → 7.3.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 +11 -0
- package/dist/cjs/emojiPlugin.js +2 -1
- package/dist/cjs/pm-plugins/ascii-input-rules.js +5 -1
- package/dist/es2019/emojiPlugin.js +2 -1
- package/dist/es2019/pm-plugins/ascii-input-rules.js +5 -1
- package/dist/esm/emojiPlugin.js +2 -1
- package/dist/esm/pm-plugins/ascii-input-rules.js +5 -1
- package/dist/types/emojiPluginType.d.ts +1 -0
- package/dist/types/pm-plugins/ascii-input-rules.d.ts +1 -1
- package/dist/types-ts4.5/emojiPluginType.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/ascii-input-rules.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-emoji
|
|
2
2
|
|
|
3
|
+
## 7.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`9daa116b53aaf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9daa116b53aaf) -
|
|
8
|
+
[ux] ED-29504 Add a new plugin option to disable emoji autoformatting
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 7.2.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/cjs/emojiPlugin.js
CHANGED
|
@@ -24,6 +24,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
24
24
|
var _emoji2 = require("@atlaskit/emoji");
|
|
25
25
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/core/comment"));
|
|
26
26
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
27
28
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
28
29
|
var _insertEmoji = require("./editor-commands/insert-emoji");
|
|
29
30
|
var _emojiNodeSpec = require("./nodeviews/emojiNodeSpec");
|
|
@@ -247,7 +248,7 @@ var emojiPlugin = exports.emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
247
248
|
plugin: function plugin(_ref8) {
|
|
248
249
|
var _api$analytics4;
|
|
249
250
|
var schema = _ref8.schema;
|
|
250
|
-
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);
|
|
251
|
+
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, (0, _expValEquals.expValEquals)('platform_editor_plain_text_support', 'isEnabled', true) ? options === null || options === void 0 ? void 0 : options.disableAutoformat : undefined);
|
|
251
252
|
}
|
|
252
253
|
}];
|
|
253
254
|
},
|
|
@@ -18,11 +18,15 @@ 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 _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
22
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
22
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
24
|
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
24
25
|
var matcher;
|
|
25
|
-
function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
26
|
+
function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
27
|
+
if (disableAutoformat && (0, _expValEquals.expValEquals)('platform_editor_plain_text_support', 'isEnabled', true)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
26
30
|
if (schema.nodes.emoji) {
|
|
27
31
|
initMatcher(pluginInjectionApi);
|
|
28
32
|
var asciiEmojiRule = (0, _utils.createRule)(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
|
@@ -11,6 +11,7 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
11
11
|
import { EmojiTypeAheadItem, preloadEmojiPicker, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
|
|
12
12
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
16
|
import { createEmojiFragment, insertEmoji } from './editor-commands/insert-emoji';
|
|
16
17
|
import { emojiNodeSpec } from './nodeviews/emojiNodeSpec';
|
|
@@ -233,7 +234,7 @@ export const emojiPlugin = ({
|
|
|
233
234
|
schema
|
|
234
235
|
}) => {
|
|
235
236
|
var _api$analytics4;
|
|
236
|
-
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);
|
|
237
|
+
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, expValEquals('platform_editor_plain_text_support', 'isEnabled', true) ? options === null || options === void 0 ? void 0 : options.disableAutoformat : undefined);
|
|
237
238
|
}
|
|
238
239
|
}];
|
|
239
240
|
},
|
|
@@ -3,8 +3,12 @@ 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 { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
let matcher;
|
|
7
|
-
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
8
|
+
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
9
|
+
if (disableAutoformat && expValEquals('platform_editor_plain_text_support', 'isEnabled', true)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
8
12
|
if (schema.nodes.emoji) {
|
|
9
13
|
initMatcher(pluginInjectionApi);
|
|
10
14
|
const asciiEmojiRule = createRule(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
package/dist/esm/emojiPlugin.js
CHANGED
|
@@ -16,6 +16,7 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
16
16
|
import { EmojiTypeAheadItem, preloadEmojiPicker, recordSelectionFailedSli, recordSelectionSucceededSli, SearchSort } from '@atlaskit/emoji';
|
|
17
17
|
import CommentIcon from '@atlaskit/icon/core/comment';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
21
|
import { createEmojiFragment, insertEmoji } from './editor-commands/insert-emoji';
|
|
21
22
|
import { emojiNodeSpec } from './nodeviews/emojiNodeSpec';
|
|
@@ -236,7 +237,7 @@ export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
|
236
237
|
plugin: function plugin(_ref8) {
|
|
237
238
|
var _api$analytics4;
|
|
238
239
|
var schema = _ref8.schema;
|
|
239
|
-
return asciiInputRulePlugin(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api);
|
|
240
|
+
return asciiInputRulePlugin(schema, api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions, api, expValEquals('platform_editor_plain_text_support', 'isEnabled', true) ? options === null || options === void 0 ? void 0 : options.disableAutoformat : undefined);
|
|
240
241
|
}
|
|
241
242
|
}];
|
|
242
243
|
},
|
|
@@ -13,8 +13,12 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
13
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
14
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
15
15
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
16
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
17
|
var matcher;
|
|
17
|
-
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi) {
|
|
18
|
+
export function inputRulePlugin(schema, editorAnalyticsAPI, pluginInjectionApi, disableAutoformat) {
|
|
19
|
+
if (disableAutoformat && expValEquals('platform_editor_plain_text_support', 'isEnabled', true)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
18
22
|
if (schema.nodes.emoji) {
|
|
19
23
|
initMatcher(pluginInjectionApi);
|
|
20
24
|
var asciiEmojiRule = createRule(AsciiEmojiMatcher.REGEX, inputRuleHandler(editorAnalyticsAPI));
|
|
@@ -28,6 +28,7 @@ type EditorViewModePluginType = NextEditorPlugin<'editorViewMode', {
|
|
|
28
28
|
sharedState: EditorViewModePluginState;
|
|
29
29
|
}>;
|
|
30
30
|
export interface EmojiPluginOptions {
|
|
31
|
+
disableAutoformat?: boolean;
|
|
31
32
|
emojiNodeDataProvider?: EmojiNodeDataProvider;
|
|
32
33
|
emojiProvider?: Promise<EmojiProvider>;
|
|
33
34
|
headless?: boolean;
|
|
@@ -4,6 +4,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { type EmojiPlugin } from '../emojiPluginType';
|
|
7
|
-
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined): SafePlugin | undefined;
|
|
7
|
+
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined, disableAutoformat?: boolean): SafePlugin | undefined;
|
|
8
8
|
declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined) => SafePlugin[];
|
|
9
9
|
export default plugins;
|
|
@@ -28,6 +28,7 @@ type EditorViewModePluginType = NextEditorPlugin<'editorViewMode', {
|
|
|
28
28
|
sharedState: EditorViewModePluginState;
|
|
29
29
|
}>;
|
|
30
30
|
export interface EmojiPluginOptions {
|
|
31
|
+
disableAutoformat?: boolean;
|
|
31
32
|
emojiNodeDataProvider?: EmojiNodeDataProvider;
|
|
32
33
|
emojiProvider?: Promise<EmojiProvider>;
|
|
33
34
|
headless?: boolean;
|
|
@@ -4,6 +4,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import { type EmojiPlugin } from '../emojiPluginType';
|
|
7
|
-
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined): SafePlugin | undefined;
|
|
7
|
+
export declare function inputRulePlugin(schema: Schema, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined, disableAutoformat?: boolean): SafePlugin | undefined;
|
|
8
8
|
declare const plugins: (schema: Schema, providerFactory: ProviderFactory, featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<EmojiPlugin> | undefined) => SafePlugin[];
|
|
9
9
|
export default plugins;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-emoji",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Emoji plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-metrics": "^7.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-type-ahead": "^6.4.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
32
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
32
|
+
"@atlaskit/editor-shared-styles": "^3.7.0",
|
|
33
33
|
"@atlaskit/emoji": "^69.5.0",
|
|
34
34
|
"@atlaskit/icon": "^28.5.0",
|
|
35
35
|
"@atlaskit/node-data-provider": "^7.1.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"react-loadable": "^5.1.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@atlaskit/editor-common": "^110.
|
|
48
|
+
"@atlaskit/editor-common": "^110.11.0",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
50
|
"react-dom": "^18.2.0"
|
|
51
51
|
},
|