@atlaskit/editor-core 191.4.3 → 191.4.4
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 +7 -0
- package/dist/cjs/presets/default.js +14 -33
- package/dist/cjs/presets/universal.js +94 -304
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/presets/default.js +14 -35
- package/dist/es2019/presets/universal.js +101 -314
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/presets/default.js +14 -33
- package/dist/esm/presets/universal.js +94 -304
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/presets/default.d.ts +1403 -329
- package/dist/types-ts4.5/presets/default.d.ts +1740 -374
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 191.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#67576](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67576) [`8c6c03bcb2f7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8c6c03bcb2f7) - [ED-21835] Migrate preset to use the new EditorPresetBuilder.maybeAdd to keep type safety
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 191.4.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -21,6 +21,7 @@ var _editorPluginEditorDisabled = require("@atlaskit/editor-plugin-editor-disabl
|
|
|
21
21
|
var _editorPluginFeatureFlags = require("@atlaskit/editor-plugin-feature-flags");
|
|
22
22
|
var _editorPluginFloatingToolbar = require("@atlaskit/editor-plugin-floating-toolbar");
|
|
23
23
|
var _editorPluginFocus = require("@atlaskit/editor-plugin-focus");
|
|
24
|
+
var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
|
|
24
25
|
var _editorPluginHyperlink = require("@atlaskit/editor-plugin-hyperlink");
|
|
25
26
|
var _editorPluginPaste = require("@atlaskit/editor-plugin-paste");
|
|
26
27
|
var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
|
|
@@ -43,41 +44,21 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
43
44
|
* their placement in the editor toolbar
|
|
44
45
|
*/
|
|
45
46
|
function createDefaultPreset(options) {
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}).add(_editorPluginBetterTypeHistory.betterTypeHistoryPlugin).add([_editorPluginPaste.pastePlugin, options.paste]).add(_editorPluginClipboard.clipboardPlugin).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_editorPluginBase.basePlugin, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_editorPluginUndoRedo.undoRedoPlugin, function (p, builder) {
|
|
57
|
-
var _options$featureFlags;
|
|
58
|
-
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
59
|
-
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
60
|
-
return builder.add(p);
|
|
61
|
-
}
|
|
62
|
-
return builder;
|
|
63
|
-
}).add([_editorPluginBlockType.blockTypePlugin, options.blockType]).add(_editorPluginClearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd(_editorPluginAnnotation.annotationPlugin, function (p, builder) {
|
|
64
|
-
if (options.annotationProviders) {
|
|
65
|
-
return builder.add([p, options.annotationProviders]);
|
|
66
|
-
}
|
|
67
|
-
return builder;
|
|
68
|
-
})
|
|
69
|
-
/**
|
|
70
|
-
* Do not use this plugin - it is for AI purposes only.
|
|
71
|
-
*/.maybeAdd(_editorPluginSelectionToolbar.selectionToolbarPlugin, function (plugin, builder) {
|
|
47
|
+
var _options$featureFlags;
|
|
48
|
+
var isMobile = options.appearance === 'mobile';
|
|
49
|
+
var preset = new _preset.EditorPresetBuilder().add([_editorPluginFeatureFlags.featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([_editorPluginAnalytics.analyticsPlugin, {
|
|
50
|
+
createAnalyticsEvent: options.createAnalyticsEvent,
|
|
51
|
+
performanceTracking: options.performanceTracking
|
|
52
|
+
}], Boolean(options.allowAnalyticsGASV3)).add(_editorPluginBetterTypeHistory.betterTypeHistoryPlugin).add([_editorPluginPaste.pastePlugin, options.paste]).add(_editorPluginClipboard.clipboardPlugin).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_editorPluginBase.basePlugin, options.base]).add(_editorPluginDecorations.decorationsPlugin).add([_editorPluginTypeAhead.typeAheadPlugin, options.typeAhead || {
|
|
53
|
+
createAnalyticsEvent: options.createAnalyticsEvent
|
|
54
|
+
}]).maybeAdd(_editorPluginHistory.historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(_editorPluginUndoRedo.undoRedoPlugin, Boolean((_options$featureFlags = options.featureFlags) === null || _options$featureFlags === void 0 ? void 0 : _options$featureFlags.undoRedoButtons)).add([_editorPluginBlockType.blockTypePlugin, options.blockType]).add(_editorPluginClearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd([_editorPluginAnnotation.annotationPlugin, options.annotationProviders], Boolean(options.annotationProviders)).maybeAdd([_editorPluginSelectionToolbar.selectionToolbarPlugin, {
|
|
55
|
+
preferenceToolbarAboveSelection: false
|
|
56
|
+
}], function () {
|
|
72
57
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
73
|
-
return
|
|
74
|
-
preferenceToolbarAboveSelection: false
|
|
75
|
-
}]);
|
|
58
|
+
return true;
|
|
76
59
|
}
|
|
77
|
-
return
|
|
78
|
-
}).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([
|
|
79
|
-
createAnalyticsEvent: options.createAnalyticsEvent
|
|
80
|
-
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_editorPluginSubmitEditor.submitEditorPlugin, options.submitEditor]).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_editorPluginCodeBlock.codeBlockPlugin, options.codeBlock || {
|
|
60
|
+
return false;
|
|
61
|
+
}).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_editorPluginSubmitEditor.submitEditorPlugin, options.submitEditor]).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_editorPluginCodeBlock.codeBlockPlugin, options.codeBlock || {
|
|
81
62
|
appearance: 'full-page'
|
|
82
63
|
}]);
|
|
83
64
|
return preset;
|
|
@@ -33,7 +33,6 @@ var _editorPluginFragment = require("@atlaskit/editor-plugin-fragment");
|
|
|
33
33
|
var _editorPluginGrid = require("@atlaskit/editor-plugin-grid");
|
|
34
34
|
var _editorPluginGuideline = require("@atlaskit/editor-plugin-guideline");
|
|
35
35
|
var _editorPluginHelpDialog = require("@atlaskit/editor-plugin-help-dialog");
|
|
36
|
-
var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
|
|
37
36
|
var _editorPluginImageUpload = require("@atlaskit/editor-plugin-image-upload");
|
|
38
37
|
var _editorPluginIndentation = require("@atlaskit/editor-plugin-indentation");
|
|
39
38
|
var _editorPluginInsertBlock = require("@atlaskit/editor-plugin-insert-block");
|
|
@@ -72,7 +71,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
72
71
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
73
72
|
*/
|
|
74
73
|
function createUniversalPreset(appearance, props, featureFlags, prevAppearance, createAnalyticsEvent) {
|
|
75
|
-
var _featureFlags$lpLinkP;
|
|
74
|
+
var _featureFlags$lpLinkP, _props$media, _props$media2, _props$media3, _props$media4, _props$media5, _props$mention$insert, _props$mention, _props$mention2, _props$collabEdit$EXP, _props$collabEdit, _props$linking, _props$linking2, _featureFlags$lpLinkP2, _props$linking3, _props$primaryToolbar;
|
|
76
75
|
var isMobile = appearance === 'mobile';
|
|
77
76
|
var isComment = appearance === 'comment';
|
|
78
77
|
var isChromeless = appearance === 'chromeless';
|
|
@@ -81,6 +80,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
81
80
|
return featureFlags;
|
|
82
81
|
};
|
|
83
82
|
var defaultPreset = (0, _default.createDefaultPreset)(_objectSpread(_objectSpread({}, props), {}, {
|
|
83
|
+
appearance: appearance,
|
|
84
84
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
85
85
|
hyperlinkOptions: _objectSpread({
|
|
86
86
|
lpLinkPicker: (_featureFlags$lpLinkP = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP !== void 0 ? _featureFlags$lpLinkP : false
|
|
@@ -93,276 +93,85 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
93
93
|
}
|
|
94
94
|
return false;
|
|
95
95
|
};
|
|
96
|
-
var finalPreset = defaultPreset.add(_editorPluginDataConsumer.dataConsumerPlugin).add(_editorPluginContentInsertion.contentInsertionPlugin).maybeAdd(_editorPluginBreakout.breakoutPlugin,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}).maybeAdd(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
var _props$mention$insert, _props$mention, _props$mention2;
|
|
176
|
-
return builder.add([plugin, {
|
|
177
|
-
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
178
|
-
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
179
|
-
allowZeroWidthSpaceAfter: !isMobile,
|
|
180
|
-
HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent
|
|
181
|
-
}]);
|
|
182
|
-
}
|
|
183
|
-
return builder;
|
|
184
|
-
}).maybeAdd(_editorPluginEmoji.emojiPlugin, function (plugin, builder) {
|
|
185
|
-
if (props.emojiProvider) {
|
|
186
|
-
return builder.add(plugin);
|
|
187
|
-
}
|
|
188
|
-
return builder;
|
|
189
|
-
}).maybeAdd(_editorPluginTable.tablesPlugin, function (plugin, builder) {
|
|
190
|
-
if (props.allowTables) {
|
|
191
|
-
var tableOptions = !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables;
|
|
192
|
-
return builder.add([plugin, {
|
|
193
|
-
tableOptions: tableOptions,
|
|
194
|
-
// tableResizingEnabled will replace breakoutEnabled once FF is 100% rolled out,
|
|
195
|
-
// logic below is to help codemod during cleanup
|
|
196
|
-
tableResizingEnabled: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && ['full-page', 'full-width'].includes(appearance || ''),
|
|
197
|
-
dragAndDropEnabled: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') && isFullPage,
|
|
198
|
-
breakoutEnabled: appearance === 'full-page',
|
|
199
|
-
allowContextualMenu: !isMobile,
|
|
200
|
-
fullWidthEnabled: appearance === 'full-width',
|
|
201
|
-
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
202
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
203
|
-
}]);
|
|
204
|
-
}
|
|
205
|
-
return builder;
|
|
206
|
-
}).maybeAdd(_editorPluginTasksAndDecisions.tasksAndDecisionsPlugin, function (plugin, builder) {
|
|
207
|
-
if (props.allowTasksAndDecisions || props.taskDecisionProvider) {
|
|
208
|
-
return builder.add([plugin, {
|
|
209
|
-
allowNestedTasks: props.allowNestedTasks,
|
|
210
|
-
consumeTabs: isFullPage,
|
|
211
|
-
useLongPressSelection: false
|
|
212
|
-
}]);
|
|
213
|
-
}
|
|
214
|
-
return builder;
|
|
215
|
-
}).maybeAdd(_editorPluginFeedbackDialog.feedbackDialogPlugin, function (plugin, builder) {
|
|
216
|
-
if (props.feedbackInfo) {
|
|
217
|
-
return builder.add([plugin, _objectSpread({
|
|
218
|
-
coreVersion: _versionWrapper.version
|
|
219
|
-
}, props.feedbackInfo)]);
|
|
220
|
-
}
|
|
221
|
-
return builder;
|
|
222
|
-
}).maybeAdd(_editorPluginHelpDialog.helpDialogPlugin, function (plugin, builder) {
|
|
223
|
-
if (props.allowHelpDialog) {
|
|
224
|
-
return builder.add([plugin, !!props.legacyImageUploadProvider]);
|
|
225
|
-
}
|
|
226
|
-
return builder;
|
|
227
|
-
}).maybeAdd(_editorPluginSaveOnEnter.saveOnEnterPlugin, function (plugin, builder) {
|
|
228
|
-
if (props.saveOnEnter && props.onSave) {
|
|
229
|
-
return builder.add([plugin, props.onSave]);
|
|
230
|
-
}
|
|
231
|
-
return builder;
|
|
232
|
-
}).maybeAdd(_editorPluginImageUpload.imageUploadPlugin, function (plugin, builder) {
|
|
233
|
-
if (props.legacyImageUploadProvider) {
|
|
234
|
-
return builder.add(plugin);
|
|
235
|
-
}
|
|
236
|
-
return builder;
|
|
237
|
-
}).maybeAdd(_editorPluginMedia.mediaPlugin, function (plugin, builder) {
|
|
238
|
-
if (props.legacyImageUploadProvider && !props.media) {
|
|
239
|
-
return builder.add([plugin, {
|
|
240
|
-
allowMediaSingle: {
|
|
241
|
-
disableLayout: true
|
|
242
|
-
},
|
|
243
|
-
allowMediaGroup: false,
|
|
244
|
-
isCopyPasteEnabled: true
|
|
245
|
-
}]);
|
|
246
|
-
}
|
|
247
|
-
return builder;
|
|
248
|
-
}).maybeAdd(_editorPluginCollabEdit.collabEditPlugin, function (plugin, builder) {
|
|
249
|
-
if (props.collabEdit || props.collabEditProvider) {
|
|
250
|
-
var _collabEditOptions$EX;
|
|
251
|
-
var collabEditOptions = {
|
|
252
|
-
sanitizePrivateContent: props.sanitizePrivateContent
|
|
253
|
-
};
|
|
254
|
-
if (props.collabEdit) {
|
|
255
|
-
collabEditOptions = _objectSpread(_objectSpread({}, props.collabEdit), collabEditOptions);
|
|
256
|
-
}
|
|
257
|
-
return builder.add([plugin, _objectSpread(_objectSpread({}, collabEditOptions), {}, {
|
|
258
|
-
EXPERIMENTAL_allowInternalErrorAnalytics: (_collabEditOptions$EX = collabEditOptions.EXPERIMENTAL_allowInternalErrorAnalytics) !== null && _collabEditOptions$EX !== void 0 ? _collabEditOptions$EX : (0, _utils.shouldForceTracking)()
|
|
259
|
-
})]);
|
|
260
|
-
}
|
|
261
|
-
return builder;
|
|
262
|
-
}).maybeAdd(_editorPluginMaxContentSize.maxContentSizePlugin, function (plugin, builder) {
|
|
263
|
-
if (props.maxContentSize) {
|
|
264
|
-
return builder.add([plugin, props.maxContentSize]);
|
|
265
|
-
}
|
|
266
|
-
return builder;
|
|
267
|
-
}).maybeAdd(_editorPluginPanel.panelPlugin, function (plugin, builder) {
|
|
268
|
-
if (props.allowPanel) {
|
|
269
|
-
var allowPanel = (0, _typeof2.default)(props.allowPanel) === 'object' ? props.allowPanel : {};
|
|
270
|
-
return builder.add([plugin, {
|
|
271
|
-
useLongPressSelection: false,
|
|
272
|
-
allowCustomPanel: allowPanel.allowCustomPanel,
|
|
273
|
-
allowCustomPanelEdit: allowPanel.allowCustomPanelEdit
|
|
274
|
-
}]);
|
|
275
|
-
}
|
|
276
|
-
return builder;
|
|
277
|
-
}).maybeAdd(_editorPluginContextPanel.contextPanelPlugin, function (plugin, builder) {
|
|
278
|
-
if (isFullPage) {
|
|
279
|
-
return builder.add(_editorPluginContextPanel.contextPanelPlugin);
|
|
280
|
-
}
|
|
281
|
-
return builder;
|
|
282
|
-
}).maybeAdd(_editorPluginExtension.extensionPlugin, function (plugin, builder) {
|
|
283
|
-
if (props.allowExtension) {
|
|
284
|
-
var extensionConfig = (0, _typeof2.default)(props.allowExtension) === 'object' ? props.allowExtension : {};
|
|
285
|
-
return builder.add([plugin, {
|
|
286
|
-
breakoutEnabled: appearance === 'full-page' && extensionConfig.allowBreakout !== false,
|
|
287
|
-
allowAutoSave: extensionConfig.allowAutoSave,
|
|
288
|
-
extensionHandlers: props.extensionHandlers,
|
|
289
|
-
useLongPressSelection: false,
|
|
290
|
-
appearance: appearance
|
|
291
|
-
}]);
|
|
292
|
-
}
|
|
293
|
-
return builder;
|
|
294
|
-
}).maybeAdd(_editorPluginAnnotation.annotationPlugin, function (plugin, builder) {
|
|
295
|
-
// See default list for when adding annotations with a provider
|
|
296
|
-
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
297
|
-
return builder.add([plugin, undefined]);
|
|
298
|
-
}
|
|
299
|
-
return builder;
|
|
300
|
-
}).maybeAdd(_editorPluginDate.datePlugin, function (plugin, builder) {
|
|
301
|
-
if (props.allowDate) {
|
|
302
|
-
var dateConfig = (0, _typeof2.default)(props.allowDate) === 'object' ? props.allowDate : {};
|
|
303
|
-
return builder.add([plugin, {
|
|
304
|
-
weekStartDay: dateConfig.weekStartDay
|
|
305
|
-
}]);
|
|
306
|
-
}
|
|
307
|
-
return builder;
|
|
308
|
-
}).maybeAdd(_editorPluginPlaceholderText.placeholderTextPlugin, function (plugin, builder) {
|
|
309
|
-
if (props.allowTemplatePlaceholders) {
|
|
310
|
-
var options = props.allowTemplatePlaceholders !== true ? props.allowTemplatePlaceholders : {};
|
|
311
|
-
return builder.add([plugin, options]);
|
|
312
|
-
}
|
|
313
|
-
return builder;
|
|
314
|
-
}).maybeAdd(_editorPluginLayout.layoutPlugin, function (plugin, builder) {
|
|
315
|
-
if (props.allowLayouts) {
|
|
316
|
-
var layoutOptions = (0, _typeof2.default)(props.allowLayouts) === 'object' ? props.allowLayouts : {};
|
|
317
|
-
return builder.add([plugin, _objectSpread(_objectSpread({}, layoutOptions), {}, {
|
|
318
|
-
useLongPressSelection: false,
|
|
319
|
-
UNSAFE_allowSingleColumnLayout: layoutOptions.UNSAFE_allowSingleColumnLayout
|
|
320
|
-
})]);
|
|
321
|
-
}
|
|
322
|
-
return builder;
|
|
323
|
-
}).maybeAdd(_editorPluginCard.cardPlugin, function (plugin, builder) {
|
|
324
|
-
var _props$linking;
|
|
325
|
-
if ((_props$linking = props.linking) !== null && _props$linking !== void 0 && _props$linking.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
326
|
-
var _props$linking2, _props$linking3, _featureFlags$lpLinkP2;
|
|
327
|
-
var fullWidthMode = appearance === 'full-width';
|
|
328
|
-
return builder.add([plugin, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.smartLinks), {}, {
|
|
329
|
-
platform: isMobile ? 'mobile' : 'web',
|
|
330
|
-
fullWidthMode: fullWidthMode,
|
|
331
|
-
linkPicker: (_props$linking3 = props.linking) === null || _props$linking3 === void 0 ? void 0 : _props$linking3.linkPicker,
|
|
332
|
-
lpLinkPicker: (_featureFlags$lpLinkP2 = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP2 !== void 0 ? _featureFlags$lpLinkP2 : false,
|
|
333
|
-
editorAppearance: appearance
|
|
334
|
-
})]);
|
|
335
|
-
}
|
|
336
|
-
return builder;
|
|
337
|
-
}).maybeAdd(_editorPluginCustomAutoformat.customAutoformatPlugin, function (plugin, builder) {
|
|
338
|
-
if (props.autoformattingProvider) {
|
|
339
|
-
return builder.add(plugin);
|
|
340
|
-
}
|
|
341
|
-
return builder;
|
|
342
|
-
}).maybeAdd(_editorPluginStatus.statusPlugin, function (plugin, builder) {
|
|
343
|
-
if (props.allowStatus) {
|
|
344
|
-
return builder.add([plugin, {
|
|
345
|
-
menuDisabled: statusMenuDisabled,
|
|
346
|
-
allowZeroWidthSpaceAfter: !isMobile
|
|
347
|
-
}]);
|
|
348
|
-
}
|
|
349
|
-
return builder;
|
|
350
|
-
}).maybeAdd(_editorPluginIndentation.indentationPlugin, function (plugin, builder) {
|
|
351
|
-
if (props.allowIndentation) {
|
|
352
|
-
return builder.add(plugin);
|
|
353
|
-
}
|
|
354
|
-
return builder;
|
|
355
|
-
}).maybeAdd(_editorPluginScrollIntoView.scrollIntoViewPlugin, function (plugin, builder) {
|
|
356
|
-
if (props.autoScrollIntoView !== false) {
|
|
357
|
-
return builder.add(_editorPluginScrollIntoView.scrollIntoViewPlugin);
|
|
358
|
-
}
|
|
359
|
-
return builder;
|
|
360
|
-
}).maybeAdd(_editorPluginHistory.historyPlugin, function (plugin, builder) {
|
|
361
|
-
if (isMobile || props.allowUndoRedoButtons) {
|
|
362
|
-
return builder.add(_editorPluginHistory.historyPlugin);
|
|
363
|
-
}
|
|
364
|
-
return builder;
|
|
365
|
-
}).add([_editorPluginToolbarListsIndentation.toolbarListsIndentationPlugin, {
|
|
96
|
+
var finalPreset = defaultPreset.add(_editorPluginDataConsumer.dataConsumerPlugin).add(_editorPluginContentInsertion.contentInsertionPlugin).maybeAdd([_editorPluginBreakout.breakoutPlugin, {
|
|
97
|
+
allowBreakoutButton: appearance === 'full-page'
|
|
98
|
+
}], Boolean(props.allowBreakout && isFullPage)).maybeAdd(_editorPluginAlignment.alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([_editorPluginTextColor.textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(_editorPluginList.listPlugin).maybeAdd(_editorPluginRule.rulePlugin, Boolean(props.allowRule)).maybeAdd([_editorPluginExpand.expandPlugin, {
|
|
99
|
+
allowInsertion: isExpandInsertionEnabled(props),
|
|
100
|
+
useLongPressSelection: false,
|
|
101
|
+
appearance: appearance,
|
|
102
|
+
allowInteractiveExpand: featureFlags.interactiveExpand
|
|
103
|
+
}], Boolean(props.allowExpand)).maybeAdd(_editorPluginGuideline.guidelinePlugin, Boolean(!isMobile && !isComment && !isChromeless && (props.media || props.allowTables))).maybeAdd([_editorPluginGrid.gridPlugin, {
|
|
104
|
+
shouldCalcBreakoutGridLines: isFullPage
|
|
105
|
+
}], Boolean(props.media)).maybeAdd([_editorPluginMedia.mediaPlugin, _objectSpread(_objectSpread({}, props.media), {}, {
|
|
106
|
+
allowLazyLoading: !isMobile,
|
|
107
|
+
allowBreakoutSnapPoints: isFullPage,
|
|
108
|
+
allowAdvancedToolBarOptions: typeof ((_props$media = props.media) === null || _props$media === void 0 ? void 0 : _props$media.allowAdvancedToolBarOptions) !== 'undefined' ? (_props$media2 = props.media) === null || _props$media2 === void 0 ? void 0 : _props$media2.allowAdvancedToolBarOptions : isFullPage || isComment,
|
|
109
|
+
allowDropzoneDropLine: isFullPage,
|
|
110
|
+
allowMediaSingleEditable: !isMobile,
|
|
111
|
+
allowRemoteDimensionsFetch: !isMobile,
|
|
112
|
+
allowMarkingUploadsAsIncomplete: isMobile,
|
|
113
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
114
|
+
uploadErrorHandler: props.uploadErrorHandler,
|
|
115
|
+
waitForMediaUpload: props.waitForMediaUpload,
|
|
116
|
+
isCopyPasteEnabled: !isMobile,
|
|
117
|
+
alignLeftOnInsert: typeof ((_props$media3 = props.media) === null || _props$media3 === void 0 ? void 0 : _props$media3.alignLeftOnInsert) !== 'undefined' ? (_props$media4 = props.media) === null || _props$media4 === void 0 ? void 0 : _props$media4.alignLeftOnInsert : isComment,
|
|
118
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
119
|
+
})], Boolean(props.media)).maybeAdd(_editorPluginCaption.captionPlugin, Boolean((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.allowCaptions)).maybeAdd([_editorPluginMentions.mentionsPlugin, {
|
|
120
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
121
|
+
insertDisplayName: (_props$mention$insert = (_props$mention = props.mention) === null || _props$mention === void 0 ? void 0 : _props$mention.insertDisplayName) !== null && _props$mention$insert !== void 0 ? _props$mention$insert : props.mentionInsertDisplayName,
|
|
122
|
+
allowZeroWidthSpaceAfter: !isMobile,
|
|
123
|
+
HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent
|
|
124
|
+
}], Boolean(props.mentionProvider)).maybeAdd(_editorPluginEmoji.emojiPlugin, Boolean(props.emojiProvider)).maybeAdd([_editorPluginTable.tablesPlugin, {
|
|
125
|
+
tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
|
|
126
|
+
tableResizingEnabled: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && ['full-page', 'full-width'].includes(appearance || ''),
|
|
127
|
+
dragAndDropEnabled: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') && isFullPage,
|
|
128
|
+
breakoutEnabled: appearance === 'full-page',
|
|
129
|
+
allowContextualMenu: !isMobile,
|
|
130
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
131
|
+
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
132
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
133
|
+
}], Boolean(props.allowTables)).maybeAdd([_editorPluginTasksAndDecisions.tasksAndDecisionsPlugin, {
|
|
134
|
+
allowNestedTasks: props.allowNestedTasks,
|
|
135
|
+
consumeTabs: isFullPage,
|
|
136
|
+
useLongPressSelection: false
|
|
137
|
+
}], Boolean(props.allowTasksAndDecisions || props.taskDecisionProvider)).maybeAdd([_editorPluginFeedbackDialog.feedbackDialogPlugin, _objectSpread({
|
|
138
|
+
coreVersion: _versionWrapper.version
|
|
139
|
+
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([_editorPluginHelpDialog.helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([_editorPluginSaveOnEnter.saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(_editorPluginImageUpload.imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd([_editorPluginMedia.mediaPlugin, {
|
|
140
|
+
allowMediaSingle: {
|
|
141
|
+
disableLayout: true
|
|
142
|
+
},
|
|
143
|
+
allowMediaGroup: false,
|
|
144
|
+
isCopyPasteEnabled: true
|
|
145
|
+
}], Boolean(props.legacyImageUploadProvider && !props.media)).maybeAdd([_editorPluginCollabEdit.collabEditPlugin, _objectSpread(_objectSpread({}, props.collabEdit), {}, {
|
|
146
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
147
|
+
EXPERIMENTAL_allowInternalErrorAnalytics: (_props$collabEdit$EXP = (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.EXPERIMENTAL_allowInternalErrorAnalytics) !== null && _props$collabEdit$EXP !== void 0 ? _props$collabEdit$EXP : (0, _utils.shouldForceTracking)()
|
|
148
|
+
})], Boolean(props.collabEdit || props.collabEditProvider)).maybeAdd([_editorPluginMaxContentSize.maxContentSizePlugin, props.maxContentSize], Boolean(props.maxContentSize)).maybeAdd([_editorPluginPanel.panelPlugin, {
|
|
149
|
+
useLongPressSelection: false,
|
|
150
|
+
allowCustomPanel: (0, _typeof2.default)(props.allowPanel) === 'object' ? props.allowPanel.allowCustomPanel : false,
|
|
151
|
+
allowCustomPanelEdit: (0, _typeof2.default)(props.allowPanel) === 'object' ? props.allowPanel.allowCustomPanelEdit : false
|
|
152
|
+
}], Boolean(props.allowPanel)).maybeAdd(_editorPluginContextPanel.contextPanelPlugin, Boolean(isFullPage)).maybeAdd([_editorPluginExtension.extensionPlugin, {
|
|
153
|
+
breakoutEnabled: appearance === 'full-page' && ((0, _typeof2.default)(props.allowExtension) === 'object' ? props.allowExtension.allowBreakout : true) !== false,
|
|
154
|
+
allowAutoSave: (0, _typeof2.default)(props.allowExtension) === 'object' ? props.allowExtension.allowAutoSave : false,
|
|
155
|
+
extensionHandlers: props.extensionHandlers,
|
|
156
|
+
useLongPressSelection: false,
|
|
157
|
+
appearance: appearance
|
|
158
|
+
}], Boolean(props.allowExtension)).maybeAdd([_editorPluginAnnotation.annotationPlugin, undefined], Boolean(!props.annotationProviders && props.allowConfluenceInlineComment)).maybeAdd([_editorPluginDate.datePlugin, {
|
|
159
|
+
weekStartDay: (0, _typeof2.default)(props.allowDate) === 'object' ? props.allowDate.weekStartDay : undefined
|
|
160
|
+
}], Boolean(props.allowDate)).maybeAdd([_editorPluginPlaceholderText.placeholderTextPlugin,
|
|
161
|
+
// @ts-expect-error 2322: Type 'false | PlaceholderTextOptions | undefined'
|
|
162
|
+
props.allowTemplatePlaceholders !== true ? props.allowTemplatePlaceholders : {}], Boolean(props.allowTemplatePlaceholders)).maybeAdd([_editorPluginLayout.layoutPlugin, _objectSpread(_objectSpread({}, (0, _typeof2.default)(props.allowLayouts) === 'object' ? props.allowLayouts : {}), {}, {
|
|
163
|
+
useLongPressSelection: false,
|
|
164
|
+
UNSAFE_allowSingleColumnLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' ? props.allowLayouts.UNSAFE_allowSingleColumnLayout : undefined
|
|
165
|
+
})], Boolean(props.allowLayouts)).maybeAdd([_editorPluginCard.cardPlugin, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), (_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks), {}, {
|
|
166
|
+
platform: isMobile ? 'mobile' : 'web',
|
|
167
|
+
fullWidthMode: appearance === 'full-width',
|
|
168
|
+
linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
|
|
169
|
+
lpLinkPicker: (_featureFlags$lpLinkP2 = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP2 !== void 0 ? _featureFlags$lpLinkP2 : false,
|
|
170
|
+
editorAppearance: appearance
|
|
171
|
+
})], Boolean(((_props$linking3 = props.linking) === null || _props$linking3 === void 0 ? void 0 : _props$linking3.smartLinks) || props.smartLinks || props.UNSAFE_cards)).maybeAdd(_editorPluginCustomAutoformat.customAutoformatPlugin, Boolean(props.autoformattingProvider)).maybeAdd([_editorPluginStatus.statusPlugin, {
|
|
172
|
+
menuDisabled: statusMenuDisabled,
|
|
173
|
+
allowZeroWidthSpaceAfter: !isMobile
|
|
174
|
+
}], Boolean(props.allowStatus)).maybeAdd(_editorPluginIndentation.indentationPlugin, Boolean(props.allowIndentation)).maybeAdd(_editorPluginScrollIntoView.scrollIntoViewPlugin, Boolean(props.autoScrollIntoView !== false)).add([_editorPluginToolbarListsIndentation.toolbarListsIndentationPlugin, {
|
|
366
175
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
367
176
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
368
177
|
}]).add([_editorPluginInsertBlock.insertBlockPlugin, {
|
|
@@ -374,14 +183,10 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
374
183
|
nativeStatusSupported: !statusMenuDisabled,
|
|
375
184
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
376
185
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
377
|
-
}]).maybeAdd(_editorPluginBeforePrimaryToolbar.beforePrimaryToolbarPlugin,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}]);
|
|
382
|
-
}
|
|
383
|
-
return builder;
|
|
384
|
-
}).add([_editorPluginAvatarGroup.avatarGroupPlugin, {
|
|
186
|
+
}]).maybeAdd([_editorPluginBeforePrimaryToolbar.beforePrimaryToolbarPlugin, {
|
|
187
|
+
beforePrimaryToolbarComponents: // @ts-expect-error 2339: Property 'before' does not exist on type 'PrimaryToolbarComponents'.
|
|
188
|
+
(_props$primaryToolbar = props.primaryToolbarComponents) === null || _props$primaryToolbar === void 0 ? void 0 : _props$primaryToolbar.before
|
|
189
|
+
}], Boolean(hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar)).add([_editorPluginAvatarGroup.avatarGroupPlugin, {
|
|
385
190
|
// Avatars are moved to Confluence codebase for Edit in Context
|
|
386
191
|
// When Edit in Context is enabled primaryToolbarComponents is undefined
|
|
387
192
|
// For more details please check
|
|
@@ -389,36 +194,21 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
389
194
|
collabEdit: props.collabEdit,
|
|
390
195
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
391
196
|
showAvatarGroup: !props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
392
|
-
}]).maybeAdd(_editorPluginFindReplace.findReplacePlugin,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
397
|
-
}]);
|
|
398
|
-
}
|
|
399
|
-
return builder;
|
|
400
|
-
}).maybeAdd(_editorPluginBorder.borderPlugin, function (plugin, builder) {
|
|
401
|
-
if (props.allowBorderMark || props.UNSAFE_allowBorderMark) {
|
|
402
|
-
return builder.add(plugin);
|
|
403
|
-
}
|
|
404
|
-
return builder;
|
|
405
|
-
}).maybeAdd(_editorPluginFragment.fragmentPlugin, function (plugin, builder) {
|
|
406
|
-
if (props.allowFragmentMark) {
|
|
407
|
-
return builder.add(plugin);
|
|
408
|
-
}
|
|
409
|
-
return builder;
|
|
410
|
-
}).maybeAdd(_editorPluginPasteOptionsToolbar.pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
197
|
+
}]).maybeAdd([_editorPluginFindReplace.findReplacePlugin, {
|
|
198
|
+
takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
199
|
+
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
200
|
+
}], Boolean(props.allowFindReplace)).maybeAdd(_editorPluginBorder.borderPlugin, Boolean(props.allowBorderMark || props.UNSAFE_allowBorderMark)).maybeAdd(_editorPluginFragment.fragmentPlugin, Boolean(props.allowFragmentMark)).maybeAdd(_editorPluginPasteOptionsToolbar.pasteOptionsToolbarPlugin, function () {
|
|
411
201
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-options-toolbar')) {
|
|
412
|
-
return
|
|
202
|
+
return true;
|
|
413
203
|
}
|
|
414
|
-
return
|
|
204
|
+
return false;
|
|
415
205
|
}).add([_editorPluginCodeBidiWarning.codeBidiWarningPlugin, {
|
|
416
206
|
appearance: appearance
|
|
417
|
-
}]).maybeAdd(_editorPluginLoom.loomPlugin, function (
|
|
207
|
+
}]).maybeAdd(_editorPluginLoom.loomPlugin, function () {
|
|
418
208
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.loom-integration')) {
|
|
419
|
-
return
|
|
209
|
+
return true;
|
|
420
210
|
}
|
|
421
|
-
return
|
|
211
|
+
return false;
|
|
422
212
|
});
|
|
423
213
|
return finalPreset;
|
|
424
214
|
}
|
|
@@ -16,6 +16,7 @@ import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
|
16
16
|
import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
17
17
|
import { floatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
18
18
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
19
|
+
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
19
20
|
import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
20
21
|
import { pastePlugin } from '@atlaskit/editor-plugin-paste';
|
|
21
22
|
import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
@@ -37,43 +38,21 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
37
38
|
* their placement in the editor toolbar
|
|
38
39
|
*/
|
|
39
40
|
export function createDefaultPreset(options) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
return builder;
|
|
52
|
-
}).add(betterTypeHistoryPlugin).add([pastePlugin, options.paste]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([basePlugin, options.base]).add(decorationsPlugin).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
53
|
-
var _options$featureFlags;
|
|
54
|
-
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
55
|
-
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
56
|
-
return builder.add(p);
|
|
57
|
-
}
|
|
58
|
-
return builder;
|
|
59
|
-
}).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd(annotationPlugin, (p, builder) => {
|
|
60
|
-
if (options.annotationProviders) {
|
|
61
|
-
return builder.add([p, options.annotationProviders]);
|
|
62
|
-
}
|
|
63
|
-
return builder;
|
|
64
|
-
})
|
|
65
|
-
/**
|
|
66
|
-
* Do not use this plugin - it is for AI purposes only.
|
|
67
|
-
*/.maybeAdd(selectionToolbarPlugin, (plugin, builder) => {
|
|
41
|
+
var _options$featureFlags;
|
|
42
|
+
const isMobile = options.appearance === 'mobile';
|
|
43
|
+
const preset = new EditorPresetBuilder().add([featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([analyticsPlugin, {
|
|
44
|
+
createAnalyticsEvent: options.createAnalyticsEvent,
|
|
45
|
+
performanceTracking: options.performanceTracking
|
|
46
|
+
}], Boolean(options.allowAnalyticsGASV3)).add(betterTypeHistoryPlugin).add([pastePlugin, options.paste]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead || {
|
|
47
|
+
createAnalyticsEvent: options.createAnalyticsEvent
|
|
48
|
+
}]).maybeAdd(historyPlugin, Boolean(isMobile || options.allowUndoRedoButtons)).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = options.featureFlags) === null || _options$featureFlags === void 0 ? void 0 : _options$featureFlags.undoRedoButtons)).add([blockTypePlugin, options.blockType]).add(clearMarksOnEmptyDocPlugin).maybeAdd([annotationPlugin, options.annotationProviders], Boolean(options.annotationProviders)).maybeAdd([selectionToolbarPlugin, {
|
|
49
|
+
preferenceToolbarAboveSelection: false
|
|
50
|
+
}], () => {
|
|
68
51
|
if (getBooleanFF('platform.editor.enable-selection-toolbar_ucdwd')) {
|
|
69
|
-
return
|
|
70
|
-
preferenceToolbarAboveSelection: false
|
|
71
|
-
}]);
|
|
52
|
+
return true;
|
|
72
53
|
}
|
|
73
|
-
return
|
|
74
|
-
}).add([hyperlinkPlugin, options.hyperlinkOptions]).add([textFormattingPlugin, options.textFormatting]).add(widthPlugin).add([quickInsertPlugin, options.quickInsert]).add([
|
|
75
|
-
createAnalyticsEvent: options.createAnalyticsEvent
|
|
76
|
-
}]).add([placeholderPlugin, options.placeholder]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(copyButtonPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
|
|
54
|
+
return false;
|
|
55
|
+
}).add([hyperlinkPlugin, options.hyperlinkOptions]).add([textFormattingPlugin, options.textFormatting]).add(widthPlugin).add([quickInsertPlugin, options.quickInsert]).add([placeholderPlugin, options.placeholder]).add(unsupportedContentPlugin).add(editorDisabledPlugin).add([submitEditorPlugin, options.submitEditor]).add(copyButtonPlugin).add(floatingToolbarPlugin).add([selectionPlugin, options.selection]).add([codeBlockPlugin, options.codeBlock || {
|
|
77
56
|
appearance: 'full-page'
|
|
78
57
|
}]);
|
|
79
58
|
return preset;
|