@atlaskit/editor-core 187.31.6 → 187.32.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 +42 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +14 -12
- package/dist/cjs/plugins/annotation/index.js +15 -13
- package/dist/cjs/plugins/avatar-group/index.js +16 -14
- package/dist/cjs/plugins/base/plugin.js +12 -10
- package/dist/cjs/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/cjs/plugins/block-type/index.js +32 -30
- package/dist/cjs/plugins/breakout/index.js +10 -8
- package/dist/cjs/plugins/caption/index.js +7 -6
- package/dist/cjs/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/code-bidi-warning/index.js +2 -4
- package/dist/cjs/plugins/code-block/index.js +14 -11
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/cjs/plugins/collab-edit/index.js +16 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +5 -5
- package/dist/cjs/plugins/date/index.js +18 -17
- package/dist/cjs/plugins/emoji/index.js +35 -33
- package/dist/cjs/plugins/expand/index.js +14 -13
- package/dist/cjs/plugins/extension/index.js +16 -15
- package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +11 -2
- package/dist/cjs/plugins/feedback-dialog/index.js +5 -4
- package/dist/cjs/plugins/find-replace/index.js +17 -15
- package/dist/cjs/plugins/floating-toolbar/index.js +31 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/help-dialog/index.js +18 -17
- package/dist/cjs/plugins/insert-block/index.js +52 -51
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/cjs/plugins/layout/index.js +15 -14
- package/dist/cjs/plugins/max-content-size/index.js +4 -3
- package/dist/cjs/plugins/media/index.js +49 -47
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
- package/dist/cjs/plugins/media/toolbar/index.js +29 -24
- package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
- package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +17 -15
- package/dist/cjs/plugins/panel/index.js +13 -12
- package/dist/cjs/plugins/paste/index.js +13 -10
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/cjs/plugins/placeholder/index.js +9 -7
- package/dist/cjs/plugins/placeholder-text/index.js +23 -16
- package/dist/cjs/plugins/quick-insert/index.js +13 -12
- package/dist/cjs/plugins/rule/index.js +8 -7
- package/dist/cjs/plugins/save-on-enter/index.js +4 -3
- package/dist/cjs/plugins/selection/index.js +5 -4
- package/dist/cjs/plugins/status/index.js +20 -14
- package/dist/cjs/plugins/submit-editor/index.js +4 -3
- package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/cjs/plugins/text-color/index.js +17 -15
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/cjs/plugins/type-ahead/index.js +21 -20
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/plugins/analytics/plugin.js +11 -8
- package/dist/es2019/plugins/annotation/index.js +4 -1
- package/dist/es2019/plugins/avatar-group/index.js +8 -5
- package/dist/es2019/plugins/base/plugin.js +6 -3
- package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
- package/dist/es2019/plugins/block-type/index.js +14 -11
- package/dist/es2019/plugins/breakout/index.js +6 -3
- package/dist/es2019/plugins/caption/index.js +3 -1
- package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
- package/dist/es2019/plugins/code-block/index.js +15 -9
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/es2019/plugins/collab-edit/index.js +9 -6
- package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
- package/dist/es2019/plugins/date/index.js +6 -3
- package/dist/es2019/plugins/emoji/index.js +16 -13
- package/dist/es2019/plugins/expand/index.js +7 -4
- package/dist/es2019/plugins/extension/index.js +11 -8
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +13 -2
- package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
- package/dist/es2019/plugins/find-replace/index.js +8 -5
- package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/es2019/plugins/help-dialog/index.js +9 -6
- package/dist/es2019/plugins/insert-block/index.js +12 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/max-content-size/index.js +3 -1
- package/dist/es2019/plugins/media/index.js +14 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
- package/dist/es2019/plugins/media/toolbar/index.js +29 -25
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
- package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/es2019/plugins/mentions/index.js +9 -6
- package/dist/es2019/plugins/panel/index.js +5 -2
- package/dist/es2019/plugins/paste/index.js +9 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/es2019/plugins/placeholder/index.js +10 -7
- package/dist/es2019/plugins/placeholder-text/index.js +12 -4
- package/dist/es2019/plugins/quick-insert/index.js +3 -1
- package/dist/es2019/plugins/rule/index.js +5 -3
- package/dist/es2019/plugins/save-on-enter/index.js +3 -1
- package/dist/es2019/plugins/selection/index.js +3 -1
- package/dist/es2019/plugins/status/index.js +11 -3
- package/dist/es2019/plugins/submit-editor/index.js +3 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
- package/dist/es2019/plugins/text-color/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/es2019/plugins/type-ahead/index.js +3 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
- package/dist/es2019/use-preset.js +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/plugins/analytics/plugin.js +14 -12
- package/dist/esm/plugins/annotation/index.js +15 -13
- package/dist/esm/plugins/avatar-group/index.js +16 -14
- package/dist/esm/plugins/base/plugin.js +12 -10
- package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/esm/plugins/block-type/index.js +32 -30
- package/dist/esm/plugins/breakout/index.js +10 -8
- package/dist/esm/plugins/caption/index.js +7 -6
- package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
- package/dist/esm/plugins/code-block/index.js +14 -11
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/esm/plugins/collab-edit/index.js +16 -14
- package/dist/esm/plugins/collab-edit/plugin.js +5 -5
- package/dist/esm/plugins/date/index.js +18 -17
- package/dist/esm/plugins/emoji/index.js +35 -33
- package/dist/esm/plugins/expand/index.js +14 -13
- package/dist/esm/plugins/extension/index.js +16 -15
- package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +11 -2
- package/dist/esm/plugins/feedback-dialog/index.js +5 -4
- package/dist/esm/plugins/find-replace/index.js +17 -15
- package/dist/esm/plugins/floating-toolbar/index.js +31 -30
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/esm/plugins/help-dialog/index.js +18 -17
- package/dist/esm/plugins/insert-block/index.js +52 -51
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/esm/plugins/layout/index.js +15 -14
- package/dist/esm/plugins/max-content-size/index.js +4 -3
- package/dist/esm/plugins/media/index.js +49 -47
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
- package/dist/esm/plugins/media/toolbar/index.js +30 -25
- package/dist/esm/plugins/media/toolbar/linking.js +4 -4
- package/dist/esm/plugins/media/toolbar/utils.js +19 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/esm/plugins/mentions/index.js +17 -15
- package/dist/esm/plugins/panel/index.js +13 -12
- package/dist/esm/plugins/paste/index.js +13 -10
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/esm/plugins/placeholder/index.js +9 -7
- package/dist/esm/plugins/placeholder-text/index.js +23 -16
- package/dist/esm/plugins/quick-insert/index.js +13 -12
- package/dist/esm/plugins/rule/index.js +8 -7
- package/dist/esm/plugins/save-on-enter/index.js +4 -3
- package/dist/esm/plugins/selection/index.js +5 -4
- package/dist/esm/plugins/status/index.js +20 -14
- package/dist/esm/plugins/submit-editor/index.js +4 -3
- package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/esm/plugins/text-color/index.js +17 -15
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/esm/plugins/type-ahead/index.js +21 -20
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +62 -618
- package/dist/types/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types/plugins/caption/index.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types/plugins/media/types.d.ts +1 -0
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/use-preset.d.ts +2 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
- package/dist/types-ts4.5/use-preset.d.ts +2 -2
- package/package.json +4 -4
|
@@ -60,8 +60,10 @@ var isFullShortName = function isFullShortName(query) {
|
|
|
60
60
|
return query && query.length > 1 && query.charAt(0) === ':' && query.charAt(query.length - 1) === ':';
|
|
61
61
|
};
|
|
62
62
|
var TRIGGER = ':';
|
|
63
|
-
export var emojiPlugin = function emojiPlugin(
|
|
64
|
-
var _api$
|
|
63
|
+
export var emojiPlugin = function emojiPlugin(_ref2) {
|
|
64
|
+
var _api$analytics5;
|
|
65
|
+
var options = _ref2.config,
|
|
66
|
+
api = _ref2.api;
|
|
65
67
|
var typeAhead = {
|
|
66
68
|
id: TypeAheadAvailableNodes.EMOJI,
|
|
67
69
|
trigger: TRIGGER,
|
|
@@ -69,9 +71,9 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
69
71
|
// so it's possible to use it without needing to scan through all triggers again
|
|
70
72
|
customRegex: '\\(?(:)',
|
|
71
73
|
headless: options ? options.headless : undefined,
|
|
72
|
-
getItems: function getItems(
|
|
73
|
-
var query =
|
|
74
|
-
editorState =
|
|
74
|
+
getItems: function getItems(_ref3) {
|
|
75
|
+
var query = _ref3.query,
|
|
76
|
+
editorState = _ref3.editorState;
|
|
75
77
|
var pluginState = getEmojiPluginState(editorState);
|
|
76
78
|
var emojiProvider = pluginState.emojiProvider;
|
|
77
79
|
if (!emojiProvider) {
|
|
@@ -99,12 +101,12 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
99
101
|
});
|
|
100
102
|
});
|
|
101
103
|
},
|
|
102
|
-
forceSelect: function forceSelect(
|
|
103
|
-
var query =
|
|
104
|
-
items =
|
|
105
|
-
editorState =
|
|
106
|
-
var
|
|
107
|
-
asciiMap =
|
|
104
|
+
forceSelect: function forceSelect(_ref4) {
|
|
105
|
+
var query = _ref4.query,
|
|
106
|
+
items = _ref4.items,
|
|
107
|
+
editorState = _ref4.editorState;
|
|
108
|
+
var _ref5 = emojiPluginKey.getState(editorState) || {},
|
|
109
|
+
asciiMap = _ref5.asciiMap;
|
|
108
110
|
var normalizedQuery = TRIGGER.concat(query);
|
|
109
111
|
|
|
110
112
|
// if the query has space at the end
|
|
@@ -121,9 +123,9 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
121
123
|
}) : undefined;
|
|
122
124
|
return matchedItem;
|
|
123
125
|
},
|
|
124
|
-
selectItem: function selectItem(state, item, insert,
|
|
125
|
-
var _api$
|
|
126
|
-
var mode =
|
|
126
|
+
selectItem: function selectItem(state, item, insert, _ref6) {
|
|
127
|
+
var _api$analytics3;
|
|
128
|
+
var mode = _ref6.mode;
|
|
127
129
|
var _item$emoji = item.emoji,
|
|
128
130
|
_item$emoji$id = _item$emoji.id,
|
|
129
131
|
id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
|
|
@@ -132,11 +134,11 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
132
134
|
var text = fallback || shortName;
|
|
133
135
|
var emojiPluginState = emojiPluginKey.getState(state);
|
|
134
136
|
if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
|
|
135
|
-
var _api$
|
|
137
|
+
var _api$analytics$shared, _api$analytics, _api$analytics$shared2, _api$analytics$shared3, _api$analytics2, _api$analytics2$share;
|
|
136
138
|
emojiPluginState.emojiProvider.recordSelection(item.emoji).then(recordSelectionSucceededSli({
|
|
137
|
-
createAnalyticsEvent: (_api$
|
|
139
|
+
createAnalyticsEvent: (_api$analytics$shared = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$shared2 = _api$analytics.sharedState.currentState()) === null || _api$analytics$shared2 === void 0 ? void 0 : _api$analytics$shared2.createAnalyticsEvent) !== null && _api$analytics$shared !== void 0 ? _api$analytics$shared : undefined
|
|
138
140
|
})).catch(recordSelectionFailedSli({
|
|
139
|
-
createAnalyticsEvent: (_api$
|
|
141
|
+
createAnalyticsEvent: (_api$analytics$shared3 = api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : (_api$analytics2$share = _api$analytics2.sharedState.currentState()) === null || _api$analytics2$share === void 0 ? void 0 : _api$analytics2$share.createAnalyticsEvent) !== null && _api$analytics$shared3 !== void 0 ? _api$analytics$shared3 : undefined
|
|
140
142
|
}));
|
|
141
143
|
}
|
|
142
144
|
var emojiNode = state.schema.nodes.emoji.createChecked({
|
|
@@ -146,7 +148,7 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
146
148
|
});
|
|
147
149
|
var space = state.schema.text(' ');
|
|
148
150
|
var tr = insert(Fragment.from([emojiNode, space]));
|
|
149
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
151
|
+
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
|
|
150
152
|
action: ACTION.INSERTED,
|
|
151
153
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
152
154
|
actionSubjectId: ACTION_SUBJECT_ID.EMOJI,
|
|
@@ -174,12 +176,12 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
174
176
|
}
|
|
175
177
|
}, {
|
|
176
178
|
name: 'emojiAsciiInputRule',
|
|
177
|
-
plugin: function plugin(
|
|
178
|
-
var _api$
|
|
179
|
-
var schema =
|
|
180
|
-
providerFactory =
|
|
181
|
-
featureFlags =
|
|
182
|
-
return asciiInputRulePlugin(schema, providerFactory, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
179
|
+
plugin: function plugin(_ref7) {
|
|
180
|
+
var _api$analytics4;
|
|
181
|
+
var schema = _ref7.schema,
|
|
182
|
+
providerFactory = _ref7.providerFactory,
|
|
183
|
+
featureFlags = _ref7.featureFlags;
|
|
184
|
+
return asciiInputRulePlugin(schema, providerFactory, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions);
|
|
183
185
|
}
|
|
184
186
|
}];
|
|
185
187
|
},
|
|
@@ -190,11 +192,11 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
190
192
|
return emojiPluginKey.getState(editorState);
|
|
191
193
|
},
|
|
192
194
|
commands: {
|
|
193
|
-
insertEmoji: insertEmoji(api === null || api === void 0 ? void 0 : (_api$
|
|
195
|
+
insertEmoji: insertEmoji(api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)
|
|
194
196
|
},
|
|
195
197
|
pluginsOptions: {
|
|
196
|
-
quickInsert: function quickInsert(
|
|
197
|
-
var formatMessage =
|
|
198
|
+
quickInsert: function quickInsert(_ref8) {
|
|
199
|
+
var formatMessage = _ref8.formatMessage;
|
|
198
200
|
return [{
|
|
199
201
|
id: 'emoji',
|
|
200
202
|
title: formatMessage(messages.emoji),
|
|
@@ -205,15 +207,15 @@ export var emojiPlugin = function emojiPlugin(options, api) {
|
|
|
205
207
|
return /*#__PURE__*/React.createElement(IconEmoji, null);
|
|
206
208
|
},
|
|
207
209
|
action: function action(insert, state) {
|
|
208
|
-
var _api$
|
|
210
|
+
var _api$analytics6;
|
|
209
211
|
var tr = insert(undefined);
|
|
210
|
-
api === null || api === void 0 ? void 0 : api.
|
|
212
|
+
api === null || api === void 0 ? void 0 : api.typeAhead.commands.openTypeAheadAtCursor({
|
|
211
213
|
triggerHandler: typeAhead,
|
|
212
214
|
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
213
215
|
})({
|
|
214
216
|
tr: tr
|
|
215
217
|
});
|
|
216
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
218
|
+
api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions.attachAnalyticsEvent({
|
|
217
219
|
action: ACTION.INVOKED,
|
|
218
220
|
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
219
221
|
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_EMOJI,
|
|
@@ -319,12 +321,12 @@ export function createEmojiPlugin(pmPluginFactoryParams) {
|
|
|
319
321
|
return {};
|
|
320
322
|
},
|
|
321
323
|
apply: function apply(tr, pluginState) {
|
|
322
|
-
var
|
|
324
|
+
var _ref9 = tr.getMeta(emojiPluginKey) || {
|
|
323
325
|
action: null,
|
|
324
326
|
params: null
|
|
325
327
|
},
|
|
326
|
-
action =
|
|
327
|
-
params =
|
|
328
|
+
action = _ref9.action,
|
|
329
|
+
params = _ref9.params;
|
|
328
330
|
var newPluginState = pluginState;
|
|
329
331
|
switch (action) {
|
|
330
332
|
case ACTIONS.SET_PROVIDER:
|
|
@@ -9,11 +9,12 @@ import { getToolbarConfig } from './toolbar';
|
|
|
9
9
|
import { createExpandNode } from './commands';
|
|
10
10
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
11
11
|
import { createWrapSelectionTransaction } from '../block-type/commands/block-type';
|
|
12
|
-
var expandPlugin = function expandPlugin() {
|
|
13
|
-
var _api$
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
var expandPlugin = function expandPlugin(_ref) {
|
|
13
|
+
var _api$featureFlags;
|
|
14
|
+
var _ref$config = _ref.config,
|
|
15
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
16
|
+
api = _ref.api;
|
|
17
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
17
18
|
return {
|
|
18
19
|
name: 'expand',
|
|
19
20
|
nodes: function nodes() {
|
|
@@ -28,9 +29,9 @@ var expandPlugin = function expandPlugin() {
|
|
|
28
29
|
pmPlugins: function pmPlugins() {
|
|
29
30
|
return [{
|
|
30
31
|
name: 'expand',
|
|
31
|
-
plugin: function plugin(
|
|
32
|
-
var dispatch =
|
|
33
|
-
getIntl =
|
|
32
|
+
plugin: function plugin(_ref2) {
|
|
33
|
+
var dispatch = _ref2.dispatch,
|
|
34
|
+
getIntl = _ref2.getIntl;
|
|
34
35
|
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, featureFlags);
|
|
35
36
|
}
|
|
36
37
|
}, {
|
|
@@ -39,9 +40,9 @@ var expandPlugin = function expandPlugin() {
|
|
|
39
40
|
}];
|
|
40
41
|
},
|
|
41
42
|
pluginsOptions: {
|
|
42
|
-
floatingToolbar: getToolbarConfig(api === null || api === void 0 ? void 0 : api.
|
|
43
|
-
quickInsert: function quickInsert(
|
|
44
|
-
var formatMessage =
|
|
43
|
+
floatingToolbar: getToolbarConfig(api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration),
|
|
44
|
+
quickInsert: function quickInsert(_ref3) {
|
|
45
|
+
var formatMessage = _ref3.formatMessage;
|
|
45
46
|
if (options && options.allowInsertion !== true) {
|
|
46
47
|
return [];
|
|
47
48
|
}
|
|
@@ -79,8 +80,8 @@ var expandPlugin = function expandPlugin() {
|
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
export default expandPlugin;
|
|
82
|
-
export function isExpandInsertionEnabled(
|
|
83
|
-
var allowExpand =
|
|
83
|
+
export function isExpandInsertionEnabled(_ref4) {
|
|
84
|
+
var allowExpand = _ref4.allowExpand;
|
|
84
85
|
if (allowExpand && _typeof(allowExpand) === 'object') {
|
|
85
86
|
return !!allowExpand.allowInsertion;
|
|
86
87
|
}
|
|
@@ -4,11 +4,12 @@ import keymapPlugin from './pm-plugins/keymap';
|
|
|
4
4
|
import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
|
|
5
5
|
import { getToolbarConfig } from './toolbar';
|
|
6
6
|
import { getContextPanel } from './context-panel';
|
|
7
|
-
var extensionPlugin = function extensionPlugin() {
|
|
8
|
-
var _api$
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var extensionPlugin = function extensionPlugin(_ref) {
|
|
8
|
+
var _api$featureFlags, _api$contextPanel2, _api$contextPanel3;
|
|
9
|
+
var _ref$config = _ref.config,
|
|
10
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
11
|
+
api = _ref.api;
|
|
12
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
12
13
|
return {
|
|
13
14
|
name: 'extension',
|
|
14
15
|
nodes: function nodes() {
|
|
@@ -26,11 +27,11 @@ var extensionPlugin = function extensionPlugin() {
|
|
|
26
27
|
pmPlugins: function pmPlugins() {
|
|
27
28
|
return [{
|
|
28
29
|
name: 'extension',
|
|
29
|
-
plugin: function plugin(
|
|
30
|
-
var dispatch =
|
|
31
|
-
providerFactory =
|
|
32
|
-
portalProviderAPI =
|
|
33
|
-
eventDispatcher =
|
|
30
|
+
plugin: function plugin(_ref2) {
|
|
31
|
+
var dispatch = _ref2.dispatch,
|
|
32
|
+
providerFactory = _ref2.providerFactory,
|
|
33
|
+
portalProviderAPI = _ref2.portalProviderAPI,
|
|
34
|
+
eventDispatcher = _ref2.eventDispatcher;
|
|
34
35
|
var extensionHandlers = options.extensionHandlers || {};
|
|
35
36
|
return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, api, options.useLongPressSelection, {
|
|
36
37
|
appearance: options.appearance
|
|
@@ -39,8 +40,8 @@ var extensionPlugin = function extensionPlugin() {
|
|
|
39
40
|
}, {
|
|
40
41
|
name: 'extensionKeymap',
|
|
41
42
|
plugin: function plugin() {
|
|
42
|
-
var _api$
|
|
43
|
-
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
43
|
+
var _api$contextPanel;
|
|
44
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange);
|
|
44
45
|
}
|
|
45
46
|
}, {
|
|
46
47
|
name: 'extensionUniqueId',
|
|
@@ -52,10 +53,10 @@ var extensionPlugin = function extensionPlugin() {
|
|
|
52
53
|
pluginsOptions: {
|
|
53
54
|
floatingToolbar: getToolbarConfig({
|
|
54
55
|
breakoutEnabled: options.breakoutEnabled,
|
|
55
|
-
hoverDecoration: api === null || api === void 0 ? void 0 : api.
|
|
56
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$
|
|
56
|
+
hoverDecoration: api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration,
|
|
57
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel2 = api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange
|
|
57
58
|
}),
|
|
58
|
-
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
59
|
+
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, api === null || api === void 0 ? void 0 : (_api$contextPanel3 = api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange)
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
62
|
};
|
|
@@ -199,13 +199,13 @@ export var handleUpdate = function handleUpdate(_ref4) {
|
|
|
199
199
|
return true;
|
|
200
200
|
};
|
|
201
201
|
var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi) {
|
|
202
|
-
var _pluginInjectionApi$
|
|
202
|
+
var _pluginInjectionApi$c;
|
|
203
203
|
var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
204
204
|
var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
|
|
205
205
|
var state = createPluginState(dispatch, {
|
|
206
206
|
showEditButton: false,
|
|
207
207
|
showContextPanel: false,
|
|
208
|
-
applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
208
|
+
applyChangeToContextPanel: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.applyChange
|
|
209
209
|
});
|
|
210
210
|
var extensionNodeViewOptions = {
|
|
211
211
|
appearance: options.appearance
|
|
@@ -220,13 +220,13 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
220
220
|
providerFactory.subscribe('contextIdentificationProvider', contextIdentificationProviderHandler);
|
|
221
221
|
return {
|
|
222
222
|
update: function update(view, prevState) {
|
|
223
|
-
var _pluginInjectionApi$
|
|
223
|
+
var _pluginInjectionApi$c2;
|
|
224
224
|
handleUpdate({
|
|
225
225
|
view: view,
|
|
226
226
|
prevState: prevState,
|
|
227
227
|
domAtPos: domAtPos,
|
|
228
228
|
extensionHandlers: extensionHandlers,
|
|
229
|
-
applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
229
|
+
applyChange: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.actions.applyChange
|
|
230
230
|
});
|
|
231
231
|
},
|
|
232
232
|
destroy: function destroy() {
|
|
@@ -31,8 +31,17 @@ function ExtensionWithPluginState(props) {
|
|
|
31
31
|
var isMobile = editorAppearance === 'mobile';
|
|
32
32
|
var hasChildren = !!children;
|
|
33
33
|
var removeBorder = hideFrame && !isMobile && !hasBody || false;
|
|
34
|
-
var
|
|
35
|
-
|
|
34
|
+
var getPos = props.getPos,
|
|
35
|
+
view = props.view;
|
|
36
|
+
var isTopLevelNode = React.useMemo(function () {
|
|
37
|
+
try {
|
|
38
|
+
var pos = typeof getPos === 'function' ? getPos() : undefined;
|
|
39
|
+
return typeof pos !== 'undefined' && !isNaN(pos) && view.state.doc.resolve(pos).depth === 0;
|
|
40
|
+
} catch (e) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}, [view, getPos]);
|
|
36
45
|
var shouldBreakout =
|
|
37
46
|
// Extension should breakout when the layout is set to 'full-width' or 'wide'.
|
|
38
47
|
['full-width', 'wide'].includes(node.attrs.layout) &&
|
|
@@ -80,13 +80,14 @@ export var openFeedbackDialog = /*#__PURE__*/function () {
|
|
|
80
80
|
return _ref.apply(this, arguments);
|
|
81
81
|
};
|
|
82
82
|
}();
|
|
83
|
-
var feedbackDialog = function feedbackDialog(
|
|
84
|
-
|
|
83
|
+
var feedbackDialog = function feedbackDialog(_ref3) {
|
|
84
|
+
var feedbackInfo = _ref3.config;
|
|
85
|
+
defaultFeedbackInfo = feedbackInfo !== null && feedbackInfo !== void 0 ? feedbackInfo : {};
|
|
85
86
|
return {
|
|
86
87
|
name: 'feedbackDialog',
|
|
87
88
|
pluginsOptions: {
|
|
88
|
-
quickInsert: function quickInsert(
|
|
89
|
-
var formatMessage =
|
|
89
|
+
quickInsert: function quickInsert(_ref4) {
|
|
90
|
+
var formatMessage = _ref4.formatMessage;
|
|
90
91
|
return [{
|
|
91
92
|
id: 'feedbackdialog',
|
|
92
93
|
title: formatMessage(messages.feedbackDialog),
|
|
@@ -2,16 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { createPlugin } from './plugin';
|
|
3
3
|
import keymapPlugin from './keymap';
|
|
4
4
|
import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
|
|
5
|
-
export var findReplacePlugin = function findReplacePlugin(
|
|
6
|
-
var _api$
|
|
7
|
-
var
|
|
5
|
+
export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
6
|
+
var _api$featureFlags;
|
|
7
|
+
var props = _ref.config,
|
|
8
|
+
api = _ref.api;
|
|
9
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
8
10
|
return {
|
|
9
11
|
name: 'findReplace',
|
|
10
12
|
pmPlugins: function pmPlugins() {
|
|
11
13
|
return [{
|
|
12
14
|
name: 'findReplace',
|
|
13
|
-
plugin: function plugin(
|
|
14
|
-
var dispatch =
|
|
15
|
+
plugin: function plugin(_ref2) {
|
|
16
|
+
var dispatch = _ref2.dispatch;
|
|
15
17
|
return createPlugin(dispatch);
|
|
16
18
|
}
|
|
17
19
|
}, {
|
|
@@ -21,15 +23,15 @@ export var findReplacePlugin = function findReplacePlugin(props, api) {
|
|
|
21
23
|
}
|
|
22
24
|
}];
|
|
23
25
|
},
|
|
24
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
25
|
-
var popupsBoundariesElement =
|
|
26
|
-
popupsMountPoint =
|
|
27
|
-
popupsScrollableElement =
|
|
28
|
-
isToolbarReducedSpacing =
|
|
29
|
-
editorView =
|
|
30
|
-
containerElement =
|
|
31
|
-
dispatchAnalyticsEvent =
|
|
32
|
-
if (props.twoLineEditorToolbar) {
|
|
26
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref3) {
|
|
27
|
+
var popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
28
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
29
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
30
|
+
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
31
|
+
editorView = _ref3.editorView,
|
|
32
|
+
containerElement = _ref3.containerElement,
|
|
33
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
34
|
+
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
33
35
|
return null;
|
|
34
36
|
} else {
|
|
35
37
|
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
@@ -40,7 +42,7 @@ export var findReplacePlugin = function findReplacePlugin(props, api) {
|
|
|
40
42
|
editorView: editorView,
|
|
41
43
|
containerElement: containerElement,
|
|
42
44
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
43
|
-
takeFullWidth: props.takeFullWidth,
|
|
45
|
+
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
44
46
|
featureFlags: featureFlags
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -110,7 +110,8 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
110
110
|
function filterUndefined(x) {
|
|
111
111
|
return !!x;
|
|
112
112
|
}
|
|
113
|
-
var floatingToolbarPlugin = function floatingToolbarPlugin(
|
|
113
|
+
var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
114
|
+
var api = _ref.api;
|
|
114
115
|
return {
|
|
115
116
|
name: 'floatingToolbar',
|
|
116
117
|
pmPlugins: function pmPlugins() {
|
|
@@ -118,10 +119,10 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
118
119
|
return [{
|
|
119
120
|
// Should be after all toolbar plugins
|
|
120
121
|
name: 'floatingToolbar',
|
|
121
|
-
plugin: function plugin(
|
|
122
|
-
var dispatch =
|
|
123
|
-
providerFactory =
|
|
124
|
-
getIntl =
|
|
122
|
+
plugin: function plugin(_ref2) {
|
|
123
|
+
var dispatch = _ref2.dispatch,
|
|
124
|
+
providerFactory = _ref2.providerFactory,
|
|
125
|
+
getIntl = _ref2.getIntl;
|
|
125
126
|
return floatingToolbarPluginFactory({
|
|
126
127
|
floatingToolbarHandlers: floatingToolbarHandlers,
|
|
127
128
|
dispatch: dispatch,
|
|
@@ -131,8 +132,8 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
131
132
|
}
|
|
132
133
|
}, {
|
|
133
134
|
name: 'floatingToolbarData',
|
|
134
|
-
plugin: function plugin(
|
|
135
|
-
var dispatch =
|
|
135
|
+
plugin: function plugin(_ref3) {
|
|
136
|
+
var dispatch = _ref3.dispatch;
|
|
136
137
|
return floatingToolbarDataPluginFactory(dispatch);
|
|
137
138
|
}
|
|
138
139
|
}, {
|
|
@@ -156,13 +157,13 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
156
157
|
floatingToolbarData: dataPluginKey.getState(editorState)
|
|
157
158
|
};
|
|
158
159
|
},
|
|
159
|
-
contentComponent: function contentComponent(
|
|
160
|
-
var popupsMountPoint =
|
|
161
|
-
popupsBoundariesElement =
|
|
162
|
-
popupsScrollableElement =
|
|
163
|
-
editorView =
|
|
164
|
-
providerFactory =
|
|
165
|
-
dispatchAnalyticsEvent =
|
|
160
|
+
contentComponent: function contentComponent(_ref4) {
|
|
161
|
+
var popupsMountPoint = _ref4.popupsMountPoint,
|
|
162
|
+
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
163
|
+
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
164
|
+
editorView = _ref4.editorView,
|
|
165
|
+
providerFactory = _ref4.providerFactory,
|
|
166
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
|
|
166
167
|
return /*#__PURE__*/React.createElement(ContentComponent, {
|
|
167
168
|
editorView: editorView,
|
|
168
169
|
pluginInjectionApi: api,
|
|
@@ -176,22 +177,22 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_, api) {
|
|
|
176
177
|
};
|
|
177
178
|
};
|
|
178
179
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
179
|
-
function ContentComponent(
|
|
180
|
-
var _pluginInjectionApi$
|
|
181
|
-
var pluginInjectionApi =
|
|
182
|
-
editorView =
|
|
183
|
-
popupsMountPoint =
|
|
184
|
-
popupsBoundariesElement =
|
|
185
|
-
popupsScrollableElement =
|
|
186
|
-
providerFactory =
|
|
187
|
-
dispatchAnalyticsEvent =
|
|
188
|
-
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
180
|
+
function ContentComponent(_ref5) {
|
|
181
|
+
var _pluginInjectionApi$f, _configWithNodeInfo$c, _configWithNodeInfo$c2;
|
|
182
|
+
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
183
|
+
editorView = _ref5.editorView,
|
|
184
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
185
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
186
|
+
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
187
|
+
providerFactory = _ref5.providerFactory,
|
|
188
|
+
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
189
|
+
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
|
|
189
190
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
|
|
190
191
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
191
192
|
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
192
|
-
var
|
|
193
|
-
configWithNodeInfo =
|
|
194
|
-
floatingToolbarData =
|
|
193
|
+
var _ref6 = floatingToolbarState !== null && floatingToolbarState !== void 0 ? floatingToolbarState : {},
|
|
194
|
+
configWithNodeInfo = _ref6.configWithNodeInfo,
|
|
195
|
+
floatingToolbarData = _ref6.floatingToolbarData;
|
|
195
196
|
if (!configWithNodeInfo || !configWithNodeInfo.config || typeof ((_configWithNodeInfo$c = configWithNodeInfo.config) === null || _configWithNodeInfo$c === void 0 ? void 0 : _configWithNodeInfo$c.visible) !== 'undefined' && !((_configWithNodeInfo$c2 = configWithNodeInfo.config) !== null && _configWithNodeInfo$c2 !== void 0 && _configWithNodeInfo$c2.visible)) {
|
|
196
197
|
return null;
|
|
197
198
|
}
|
|
@@ -219,7 +220,7 @@ function ContentComponent(_ref4) {
|
|
|
219
220
|
return null;
|
|
220
221
|
}
|
|
221
222
|
var customPositionCalculation;
|
|
222
|
-
var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
223
|
+
var toolbarItems = processCopyButtonItems(editorView.state)(Array.isArray(items) ? items : items(node), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.decorations.actions.hoverDecoration);
|
|
223
224
|
if (onPositionCalculated) {
|
|
224
225
|
customPositionCalculation = function customPositionCalculation(nextPos) {
|
|
225
226
|
return onPositionCalculated(editorView, nextPos);
|
|
@@ -230,8 +231,8 @@ function ContentComponent(_ref4) {
|
|
|
230
231
|
};
|
|
231
232
|
|
|
232
233
|
// Confirm dialog
|
|
233
|
-
var
|
|
234
|
-
confirmDialogForItem =
|
|
234
|
+
var _ref7 = floatingToolbarData || {},
|
|
235
|
+
confirmDialogForItem = _ref7.confirmDialogForItem;
|
|
235
236
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
236
237
|
var scrollable = featureFlags.floatingToolbarCopyButton && config.scrollable;
|
|
237
238
|
var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
@@ -59,7 +59,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
59
59
|
return jsx(ButtonGroup, null, items.filter(function (item) {
|
|
60
60
|
return !item.hidden;
|
|
61
61
|
}).map(function (item, idx) {
|
|
62
|
-
var _api$
|
|
62
|
+
var _api$contextPanel;
|
|
63
63
|
switch (item.type) {
|
|
64
64
|
case 'button':
|
|
65
65
|
var ButtonIcon = item.icon;
|
|
@@ -231,7 +231,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
231
231
|
editorView: editorView,
|
|
232
232
|
extensionProvider: extensionsProvider,
|
|
233
233
|
separator: item.separator,
|
|
234
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$
|
|
234
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
|
|
235
235
|
});
|
|
236
236
|
case 'separator':
|
|
237
237
|
return jsx(Separator, {
|
|
@@ -374,7 +374,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
374
374
|
if (table) {
|
|
375
375
|
return clearHoverSelection()(state, dispatch);
|
|
376
376
|
}
|
|
377
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.
|
|
377
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
}, {
|
|
@@ -37,29 +37,30 @@ export function createPlugin(dispatch, imageEnabled) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
var helpDialog = function helpDialog() {
|
|
41
|
-
var
|
|
42
|
-
|
|
40
|
+
var helpDialog = function helpDialog(_ref) {
|
|
41
|
+
var _ref$config = _ref.config,
|
|
42
|
+
imageUploadProviderExists = _ref$config === void 0 ? false : _ref$config,
|
|
43
|
+
api = _ref.api;
|
|
43
44
|
return {
|
|
44
45
|
name: 'helpDialog',
|
|
45
46
|
pmPlugins: function pmPlugins() {
|
|
46
47
|
return [{
|
|
47
48
|
name: 'helpDialog',
|
|
48
|
-
plugin: function plugin(
|
|
49
|
-
var dispatch =
|
|
49
|
+
plugin: function plugin(_ref2) {
|
|
50
|
+
var dispatch = _ref2.dispatch;
|
|
50
51
|
return createPlugin(dispatch, imageUploadProviderExists);
|
|
51
52
|
}
|
|
52
53
|
}, {
|
|
53
54
|
name: 'helpDialogKeymap',
|
|
54
55
|
plugin: function plugin() {
|
|
55
|
-
var _api$
|
|
56
|
-
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
56
|
+
var _api$analytics;
|
|
57
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
57
58
|
}
|
|
58
59
|
}];
|
|
59
60
|
},
|
|
60
61
|
pluginsOptions: {
|
|
61
|
-
quickInsert: function quickInsert(
|
|
62
|
-
var formatMessage =
|
|
62
|
+
quickInsert: function quickInsert(_ref3) {
|
|
63
|
+
var formatMessage = _ref3.formatMessage;
|
|
63
64
|
return [{
|
|
64
65
|
id: 'helpdialog',
|
|
65
66
|
title: formatMessage(messages.help),
|
|
@@ -73,10 +74,10 @@ var helpDialog = function helpDialog() {
|
|
|
73
74
|
});
|
|
74
75
|
},
|
|
75
76
|
action: function action(insert) {
|
|
76
|
-
var _api$
|
|
77
|
+
var _api$analytics2;
|
|
77
78
|
var tr = insert('');
|
|
78
79
|
openHelpCommand(tr);
|
|
79
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
80
|
+
api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions.attachAnalyticsEvent({
|
|
80
81
|
action: ACTION.HELP_OPENED,
|
|
81
82
|
actionSubject: ACTION_SUBJECT.HELP,
|
|
82
83
|
actionSubjectId: ACTION_SUBJECT_ID.HELP_QUICK_INSERT,
|
|
@@ -90,19 +91,19 @@ var helpDialog = function helpDialog() {
|
|
|
90
91
|
}];
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
|
-
contentComponent: function contentComponent(
|
|
94
|
-
var editorView =
|
|
94
|
+
contentComponent: function contentComponent(_ref4) {
|
|
95
|
+
var editorView = _ref4.editorView;
|
|
95
96
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
96
97
|
plugins: {
|
|
97
98
|
helpDialog: pluginKey
|
|
98
99
|
},
|
|
99
|
-
render: function render(
|
|
100
|
-
var
|
|
101
|
-
helpDialog =
|
|
100
|
+
render: function render(_ref5) {
|
|
101
|
+
var _ref5$helpDialog = _ref5.helpDialog,
|
|
102
|
+
helpDialog = _ref5$helpDialog === void 0 ? {} : _ref5$helpDialog;
|
|
102
103
|
return /*#__PURE__*/React.createElement(HelpDialogLoader, {
|
|
103
104
|
editorView: editorView,
|
|
104
105
|
isVisible: helpDialog.isVisible,
|
|
105
|
-
quickInsertEnabled: !!(api !== null && api !== void 0 && api.
|
|
106
|
+
quickInsertEnabled: !!(api !== null && api !== void 0 && api.quickInsert),
|
|
106
107
|
imageEnabled: helpDialog.imageEnabled
|
|
107
108
|
});
|
|
108
109
|
}
|