@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
|
@@ -27,7 +27,6 @@ import { fragmentPlugin } from '@atlaskit/editor-plugin-fragment';
|
|
|
27
27
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
28
28
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
29
29
|
import { helpDialogPlugin } from '@atlaskit/editor-plugin-help-dialog';
|
|
30
|
-
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
31
30
|
import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
|
|
32
31
|
import { indentationPlugin } from '@atlaskit/editor-plugin-indentation';
|
|
33
32
|
import { insertBlockPlugin } from '@atlaskit/editor-plugin-insert-block';
|
|
@@ -64,7 +63,7 @@ import { createDefaultPreset } from './default';
|
|
|
64
63
|
* @returns a full featured preset configured according to the provided props - basis for create-plugins-list
|
|
65
64
|
*/
|
|
66
65
|
export default function createUniversalPreset(appearance, props, featureFlags, prevAppearance, createAnalyticsEvent) {
|
|
67
|
-
var _featureFlags$lpLinkP;
|
|
66
|
+
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;
|
|
68
67
|
var isMobile = appearance === 'mobile';
|
|
69
68
|
var isComment = appearance === 'comment';
|
|
70
69
|
var isChromeless = appearance === 'chromeless';
|
|
@@ -73,6 +72,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
73
72
|
return featureFlags;
|
|
74
73
|
};
|
|
75
74
|
var defaultPreset = createDefaultPreset(_objectSpread(_objectSpread({}, props), {}, {
|
|
75
|
+
appearance: appearance,
|
|
76
76
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
77
77
|
hyperlinkOptions: _objectSpread({
|
|
78
78
|
lpLinkPicker: (_featureFlags$lpLinkP = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP !== void 0 ? _featureFlags$lpLinkP : false
|
|
@@ -85,276 +85,85 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
85
85
|
}
|
|
86
86
|
return false;
|
|
87
87
|
};
|
|
88
|
-
var finalPreset = defaultPreset.add(dataConsumerPlugin).add(contentInsertionPlugin).maybeAdd(breakoutPlugin,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}).maybeAdd(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
var _props$mention$insert, _props$mention, _props$mention2;
|
|
168
|
-
return builder.add([plugin, {
|
|
169
|
-
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
170
|
-
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,
|
|
171
|
-
allowZeroWidthSpaceAfter: !isMobile,
|
|
172
|
-
HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent
|
|
173
|
-
}]);
|
|
174
|
-
}
|
|
175
|
-
return builder;
|
|
176
|
-
}).maybeAdd(emojiPlugin, function (plugin, builder) {
|
|
177
|
-
if (props.emojiProvider) {
|
|
178
|
-
return builder.add(plugin);
|
|
179
|
-
}
|
|
180
|
-
return builder;
|
|
181
|
-
}).maybeAdd(tablesPlugin, function (plugin, builder) {
|
|
182
|
-
if (props.allowTables) {
|
|
183
|
-
var tableOptions = !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables;
|
|
184
|
-
return builder.add([plugin, {
|
|
185
|
-
tableOptions: tableOptions,
|
|
186
|
-
// tableResizingEnabled will replace breakoutEnabled once FF is 100% rolled out,
|
|
187
|
-
// logic below is to help codemod during cleanup
|
|
188
|
-
tableResizingEnabled: getBooleanFF('platform.editor.custom-table-width') && ['full-page', 'full-width'].includes(appearance || ''),
|
|
189
|
-
dragAndDropEnabled: getBooleanFF('platform.editor.table.drag-and-drop') && isFullPage,
|
|
190
|
-
breakoutEnabled: appearance === 'full-page',
|
|
191
|
-
allowContextualMenu: !isMobile,
|
|
192
|
-
fullWidthEnabled: appearance === 'full-width',
|
|
193
|
-
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
194
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
195
|
-
}]);
|
|
196
|
-
}
|
|
197
|
-
return builder;
|
|
198
|
-
}).maybeAdd(tasksAndDecisionsPlugin, function (plugin, builder) {
|
|
199
|
-
if (props.allowTasksAndDecisions || props.taskDecisionProvider) {
|
|
200
|
-
return builder.add([plugin, {
|
|
201
|
-
allowNestedTasks: props.allowNestedTasks,
|
|
202
|
-
consumeTabs: isFullPage,
|
|
203
|
-
useLongPressSelection: false
|
|
204
|
-
}]);
|
|
205
|
-
}
|
|
206
|
-
return builder;
|
|
207
|
-
}).maybeAdd(feedbackDialogPlugin, function (plugin, builder) {
|
|
208
|
-
if (props.feedbackInfo) {
|
|
209
|
-
return builder.add([plugin, _objectSpread({
|
|
210
|
-
coreVersion: coreVersion
|
|
211
|
-
}, props.feedbackInfo)]);
|
|
212
|
-
}
|
|
213
|
-
return builder;
|
|
214
|
-
}).maybeAdd(helpDialogPlugin, function (plugin, builder) {
|
|
215
|
-
if (props.allowHelpDialog) {
|
|
216
|
-
return builder.add([plugin, !!props.legacyImageUploadProvider]);
|
|
217
|
-
}
|
|
218
|
-
return builder;
|
|
219
|
-
}).maybeAdd(saveOnEnterPlugin, function (plugin, builder) {
|
|
220
|
-
if (props.saveOnEnter && props.onSave) {
|
|
221
|
-
return builder.add([plugin, props.onSave]);
|
|
222
|
-
}
|
|
223
|
-
return builder;
|
|
224
|
-
}).maybeAdd(imageUploadPlugin, function (plugin, builder) {
|
|
225
|
-
if (props.legacyImageUploadProvider) {
|
|
226
|
-
return builder.add(plugin);
|
|
227
|
-
}
|
|
228
|
-
return builder;
|
|
229
|
-
}).maybeAdd(mediaPlugin, function (plugin, builder) {
|
|
230
|
-
if (props.legacyImageUploadProvider && !props.media) {
|
|
231
|
-
return builder.add([plugin, {
|
|
232
|
-
allowMediaSingle: {
|
|
233
|
-
disableLayout: true
|
|
234
|
-
},
|
|
235
|
-
allowMediaGroup: false,
|
|
236
|
-
isCopyPasteEnabled: true
|
|
237
|
-
}]);
|
|
238
|
-
}
|
|
239
|
-
return builder;
|
|
240
|
-
}).maybeAdd(collabEditPlugin, function (plugin, builder) {
|
|
241
|
-
if (props.collabEdit || props.collabEditProvider) {
|
|
242
|
-
var _collabEditOptions$EX;
|
|
243
|
-
var collabEditOptions = {
|
|
244
|
-
sanitizePrivateContent: props.sanitizePrivateContent
|
|
245
|
-
};
|
|
246
|
-
if (props.collabEdit) {
|
|
247
|
-
collabEditOptions = _objectSpread(_objectSpread({}, props.collabEdit), collabEditOptions);
|
|
248
|
-
}
|
|
249
|
-
return builder.add([plugin, _objectSpread(_objectSpread({}, collabEditOptions), {}, {
|
|
250
|
-
EXPERIMENTAL_allowInternalErrorAnalytics: (_collabEditOptions$EX = collabEditOptions.EXPERIMENTAL_allowInternalErrorAnalytics) !== null && _collabEditOptions$EX !== void 0 ? _collabEditOptions$EX : shouldForceTracking()
|
|
251
|
-
})]);
|
|
252
|
-
}
|
|
253
|
-
return builder;
|
|
254
|
-
}).maybeAdd(maxContentSizePlugin, function (plugin, builder) {
|
|
255
|
-
if (props.maxContentSize) {
|
|
256
|
-
return builder.add([plugin, props.maxContentSize]);
|
|
257
|
-
}
|
|
258
|
-
return builder;
|
|
259
|
-
}).maybeAdd(panelPlugin, function (plugin, builder) {
|
|
260
|
-
if (props.allowPanel) {
|
|
261
|
-
var allowPanel = _typeof(props.allowPanel) === 'object' ? props.allowPanel : {};
|
|
262
|
-
return builder.add([plugin, {
|
|
263
|
-
useLongPressSelection: false,
|
|
264
|
-
allowCustomPanel: allowPanel.allowCustomPanel,
|
|
265
|
-
allowCustomPanelEdit: allowPanel.allowCustomPanelEdit
|
|
266
|
-
}]);
|
|
267
|
-
}
|
|
268
|
-
return builder;
|
|
269
|
-
}).maybeAdd(contextPanelPlugin, function (plugin, builder) {
|
|
270
|
-
if (isFullPage) {
|
|
271
|
-
return builder.add(contextPanelPlugin);
|
|
272
|
-
}
|
|
273
|
-
return builder;
|
|
274
|
-
}).maybeAdd(extensionPlugin, function (plugin, builder) {
|
|
275
|
-
if (props.allowExtension) {
|
|
276
|
-
var extensionConfig = _typeof(props.allowExtension) === 'object' ? props.allowExtension : {};
|
|
277
|
-
return builder.add([plugin, {
|
|
278
|
-
breakoutEnabled: appearance === 'full-page' && extensionConfig.allowBreakout !== false,
|
|
279
|
-
allowAutoSave: extensionConfig.allowAutoSave,
|
|
280
|
-
extensionHandlers: props.extensionHandlers,
|
|
281
|
-
useLongPressSelection: false,
|
|
282
|
-
appearance: appearance
|
|
283
|
-
}]);
|
|
284
|
-
}
|
|
285
|
-
return builder;
|
|
286
|
-
}).maybeAdd(annotationPlugin, function (plugin, builder) {
|
|
287
|
-
// See default list for when adding annotations with a provider
|
|
288
|
-
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
289
|
-
return builder.add([plugin, undefined]);
|
|
290
|
-
}
|
|
291
|
-
return builder;
|
|
292
|
-
}).maybeAdd(datePlugin, function (plugin, builder) {
|
|
293
|
-
if (props.allowDate) {
|
|
294
|
-
var dateConfig = _typeof(props.allowDate) === 'object' ? props.allowDate : {};
|
|
295
|
-
return builder.add([plugin, {
|
|
296
|
-
weekStartDay: dateConfig.weekStartDay
|
|
297
|
-
}]);
|
|
298
|
-
}
|
|
299
|
-
return builder;
|
|
300
|
-
}).maybeAdd(placeholderTextPlugin, function (plugin, builder) {
|
|
301
|
-
if (props.allowTemplatePlaceholders) {
|
|
302
|
-
var options = props.allowTemplatePlaceholders !== true ? props.allowTemplatePlaceholders : {};
|
|
303
|
-
return builder.add([plugin, options]);
|
|
304
|
-
}
|
|
305
|
-
return builder;
|
|
306
|
-
}).maybeAdd(layoutPlugin, function (plugin, builder) {
|
|
307
|
-
if (props.allowLayouts) {
|
|
308
|
-
var layoutOptions = _typeof(props.allowLayouts) === 'object' ? props.allowLayouts : {};
|
|
309
|
-
return builder.add([plugin, _objectSpread(_objectSpread({}, layoutOptions), {}, {
|
|
310
|
-
useLongPressSelection: false,
|
|
311
|
-
UNSAFE_allowSingleColumnLayout: layoutOptions.UNSAFE_allowSingleColumnLayout
|
|
312
|
-
})]);
|
|
313
|
-
}
|
|
314
|
-
return builder;
|
|
315
|
-
}).maybeAdd(cardPlugin, function (plugin, builder) {
|
|
316
|
-
var _props$linking;
|
|
317
|
-
if ((_props$linking = props.linking) !== null && _props$linking !== void 0 && _props$linking.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
318
|
-
var _props$linking2, _props$linking3, _featureFlags$lpLinkP2;
|
|
319
|
-
var fullWidthMode = appearance === 'full-width';
|
|
320
|
-
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), {}, {
|
|
321
|
-
platform: isMobile ? 'mobile' : 'web',
|
|
322
|
-
fullWidthMode: fullWidthMode,
|
|
323
|
-
linkPicker: (_props$linking3 = props.linking) === null || _props$linking3 === void 0 ? void 0 : _props$linking3.linkPicker,
|
|
324
|
-
lpLinkPicker: (_featureFlags$lpLinkP2 = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP2 !== void 0 ? _featureFlags$lpLinkP2 : false,
|
|
325
|
-
editorAppearance: appearance
|
|
326
|
-
})]);
|
|
327
|
-
}
|
|
328
|
-
return builder;
|
|
329
|
-
}).maybeAdd(customAutoformatPlugin, function (plugin, builder) {
|
|
330
|
-
if (props.autoformattingProvider) {
|
|
331
|
-
return builder.add(plugin);
|
|
332
|
-
}
|
|
333
|
-
return builder;
|
|
334
|
-
}).maybeAdd(statusPlugin, function (plugin, builder) {
|
|
335
|
-
if (props.allowStatus) {
|
|
336
|
-
return builder.add([plugin, {
|
|
337
|
-
menuDisabled: statusMenuDisabled,
|
|
338
|
-
allowZeroWidthSpaceAfter: !isMobile
|
|
339
|
-
}]);
|
|
340
|
-
}
|
|
341
|
-
return builder;
|
|
342
|
-
}).maybeAdd(indentationPlugin, function (plugin, builder) {
|
|
343
|
-
if (props.allowIndentation) {
|
|
344
|
-
return builder.add(plugin);
|
|
345
|
-
}
|
|
346
|
-
return builder;
|
|
347
|
-
}).maybeAdd(scrollIntoViewPlugin, function (plugin, builder) {
|
|
348
|
-
if (props.autoScrollIntoView !== false) {
|
|
349
|
-
return builder.add(scrollIntoViewPlugin);
|
|
350
|
-
}
|
|
351
|
-
return builder;
|
|
352
|
-
}).maybeAdd(historyPlugin, function (plugin, builder) {
|
|
353
|
-
if (isMobile || props.allowUndoRedoButtons) {
|
|
354
|
-
return builder.add(historyPlugin);
|
|
355
|
-
}
|
|
356
|
-
return builder;
|
|
357
|
-
}).add([toolbarListsIndentationPlugin, {
|
|
88
|
+
var finalPreset = defaultPreset.add(dataConsumerPlugin).add(contentInsertionPlugin).maybeAdd([breakoutPlugin, {
|
|
89
|
+
allowBreakoutButton: appearance === 'full-page'
|
|
90
|
+
}], Boolean(props.allowBreakout && isFullPage)).maybeAdd(alignmentPlugin, Boolean(props.allowTextAlignment)).maybeAdd([textColorPlugin, props.allowTextColor], Boolean(props.allowTextColor)).add(listPlugin).maybeAdd(rulePlugin, Boolean(props.allowRule)).maybeAdd([expandPlugin, {
|
|
91
|
+
allowInsertion: isExpandInsertionEnabled(props),
|
|
92
|
+
useLongPressSelection: false,
|
|
93
|
+
appearance: appearance,
|
|
94
|
+
allowInteractiveExpand: featureFlags.interactiveExpand
|
|
95
|
+
}], Boolean(props.allowExpand)).maybeAdd(guidelinePlugin, Boolean(!isMobile && !isComment && !isChromeless && (props.media || props.allowTables))).maybeAdd([gridPlugin, {
|
|
96
|
+
shouldCalcBreakoutGridLines: isFullPage
|
|
97
|
+
}], Boolean(props.media)).maybeAdd([mediaPlugin, _objectSpread(_objectSpread({}, props.media), {}, {
|
|
98
|
+
allowLazyLoading: !isMobile,
|
|
99
|
+
allowBreakoutSnapPoints: isFullPage,
|
|
100
|
+
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,
|
|
101
|
+
allowDropzoneDropLine: isFullPage,
|
|
102
|
+
allowMediaSingleEditable: !isMobile,
|
|
103
|
+
allowRemoteDimensionsFetch: !isMobile,
|
|
104
|
+
allowMarkingUploadsAsIncomplete: isMobile,
|
|
105
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
106
|
+
uploadErrorHandler: props.uploadErrorHandler,
|
|
107
|
+
waitForMediaUpload: props.waitForMediaUpload,
|
|
108
|
+
isCopyPasteEnabled: !isMobile,
|
|
109
|
+
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,
|
|
110
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
111
|
+
})], Boolean(props.media)).maybeAdd(captionPlugin, Boolean((_props$media5 = props.media) === null || _props$media5 === void 0 ? void 0 : _props$media5.allowCaptions)).maybeAdd([mentionsPlugin, {
|
|
112
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
113
|
+
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,
|
|
114
|
+
allowZeroWidthSpaceAfter: !isMobile,
|
|
115
|
+
HighlightComponent: (_props$mention2 = props.mention) === null || _props$mention2 === void 0 ? void 0 : _props$mention2.HighlightComponent
|
|
116
|
+
}], Boolean(props.mentionProvider)).maybeAdd(emojiPlugin, Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, {
|
|
117
|
+
tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
|
|
118
|
+
tableResizingEnabled: getBooleanFF('platform.editor.custom-table-width') && ['full-page', 'full-width'].includes(appearance || ''),
|
|
119
|
+
dragAndDropEnabled: getBooleanFF('platform.editor.table.drag-and-drop') && isFullPage,
|
|
120
|
+
breakoutEnabled: appearance === 'full-page',
|
|
121
|
+
allowContextualMenu: !isMobile,
|
|
122
|
+
fullWidthEnabled: appearance === 'full-width',
|
|
123
|
+
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
124
|
+
getEditorFeatureFlags: getEditorFeatureFlags
|
|
125
|
+
}], Boolean(props.allowTables)).maybeAdd([tasksAndDecisionsPlugin, {
|
|
126
|
+
allowNestedTasks: props.allowNestedTasks,
|
|
127
|
+
consumeTabs: isFullPage,
|
|
128
|
+
useLongPressSelection: false
|
|
129
|
+
}], Boolean(props.allowTasksAndDecisions || props.taskDecisionProvider)).maybeAdd([feedbackDialogPlugin, _objectSpread({
|
|
130
|
+
coreVersion: coreVersion
|
|
131
|
+
}, props.feedbackInfo)], Boolean(props.feedbackInfo)).maybeAdd([helpDialogPlugin, !!props.legacyImageUploadProvider], Boolean(props.allowHelpDialog)).maybeAdd([saveOnEnterPlugin, props.onSave], Boolean(props.saveOnEnter && props.onSave)).maybeAdd(imageUploadPlugin, Boolean(props.legacyImageUploadProvider)).maybeAdd([mediaPlugin, {
|
|
132
|
+
allowMediaSingle: {
|
|
133
|
+
disableLayout: true
|
|
134
|
+
},
|
|
135
|
+
allowMediaGroup: false,
|
|
136
|
+
isCopyPasteEnabled: true
|
|
137
|
+
}], Boolean(props.legacyImageUploadProvider && !props.media)).maybeAdd([collabEditPlugin, _objectSpread(_objectSpread({}, props.collabEdit), {}, {
|
|
138
|
+
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
139
|
+
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 : shouldForceTracking()
|
|
140
|
+
})], Boolean(props.collabEdit || props.collabEditProvider)).maybeAdd([maxContentSizePlugin, props.maxContentSize], Boolean(props.maxContentSize)).maybeAdd([panelPlugin, {
|
|
141
|
+
useLongPressSelection: false,
|
|
142
|
+
allowCustomPanel: _typeof(props.allowPanel) === 'object' ? props.allowPanel.allowCustomPanel : false,
|
|
143
|
+
allowCustomPanelEdit: _typeof(props.allowPanel) === 'object' ? props.allowPanel.allowCustomPanelEdit : false
|
|
144
|
+
}], Boolean(props.allowPanel)).maybeAdd(contextPanelPlugin, Boolean(isFullPage)).maybeAdd([extensionPlugin, {
|
|
145
|
+
breakoutEnabled: appearance === 'full-page' && (_typeof(props.allowExtension) === 'object' ? props.allowExtension.allowBreakout : true) !== false,
|
|
146
|
+
allowAutoSave: _typeof(props.allowExtension) === 'object' ? props.allowExtension.allowAutoSave : false,
|
|
147
|
+
extensionHandlers: props.extensionHandlers,
|
|
148
|
+
useLongPressSelection: false,
|
|
149
|
+
appearance: appearance
|
|
150
|
+
}], Boolean(props.allowExtension)).maybeAdd([annotationPlugin, undefined], Boolean(!props.annotationProviders && props.allowConfluenceInlineComment)).maybeAdd([datePlugin, {
|
|
151
|
+
weekStartDay: _typeof(props.allowDate) === 'object' ? props.allowDate.weekStartDay : undefined
|
|
152
|
+
}], Boolean(props.allowDate)).maybeAdd([placeholderTextPlugin,
|
|
153
|
+
// @ts-expect-error 2322: Type 'false | PlaceholderTextOptions | undefined'
|
|
154
|
+
props.allowTemplatePlaceholders !== true ? props.allowTemplatePlaceholders : {}], Boolean(props.allowTemplatePlaceholders)).maybeAdd([layoutPlugin, _objectSpread(_objectSpread({}, _typeof(props.allowLayouts) === 'object' ? props.allowLayouts : {}), {}, {
|
|
155
|
+
useLongPressSelection: false,
|
|
156
|
+
UNSAFE_allowSingleColumnLayout: _typeof(props.allowLayouts) === 'object' ? props.allowLayouts.UNSAFE_allowSingleColumnLayout : undefined
|
|
157
|
+
})], Boolean(props.allowLayouts)).maybeAdd([cardPlugin, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props.UNSAFE_cards), props.smartLinks), (_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks), {}, {
|
|
158
|
+
platform: isMobile ? 'mobile' : 'web',
|
|
159
|
+
fullWidthMode: appearance === 'full-width',
|
|
160
|
+
linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
|
|
161
|
+
lpLinkPicker: (_featureFlags$lpLinkP2 = featureFlags.lpLinkPicker) !== null && _featureFlags$lpLinkP2 !== void 0 ? _featureFlags$lpLinkP2 : false,
|
|
162
|
+
editorAppearance: appearance
|
|
163
|
+
})], Boolean(((_props$linking3 = props.linking) === null || _props$linking3 === void 0 ? void 0 : _props$linking3.smartLinks) || props.smartLinks || props.UNSAFE_cards)).maybeAdd(customAutoformatPlugin, Boolean(props.autoformattingProvider)).maybeAdd([statusPlugin, {
|
|
164
|
+
menuDisabled: statusMenuDisabled,
|
|
165
|
+
allowZeroWidthSpaceAfter: !isMobile
|
|
166
|
+
}], Boolean(props.allowStatus)).maybeAdd(indentationPlugin, Boolean(props.allowIndentation)).maybeAdd(scrollIntoViewPlugin, Boolean(props.autoScrollIntoView !== false)).add([toolbarListsIndentationPlugin, {
|
|
358
167
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
359
168
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
360
169
|
}]).add([insertBlockPlugin, {
|
|
@@ -366,14 +175,10 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
366
175
|
nativeStatusSupported: !statusMenuDisabled,
|
|
367
176
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
368
177
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
369
|
-
}]).maybeAdd(beforePrimaryToolbarPlugin,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}]);
|
|
374
|
-
}
|
|
375
|
-
return builder;
|
|
376
|
-
}).add([avatarGroupPlugin, {
|
|
178
|
+
}]).maybeAdd([beforePrimaryToolbarPlugin, {
|
|
179
|
+
beforePrimaryToolbarComponents: // @ts-expect-error 2339: Property 'before' does not exist on type 'PrimaryToolbarComponents'.
|
|
180
|
+
(_props$primaryToolbar = props.primaryToolbarComponents) === null || _props$primaryToolbar === void 0 ? void 0 : _props$primaryToolbar.before
|
|
181
|
+
}], Boolean(hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar)).add([avatarGroupPlugin, {
|
|
377
182
|
// Avatars are moved to Confluence codebase for Edit in Context
|
|
378
183
|
// When Edit in Context is enabled primaryToolbarComponents is undefined
|
|
379
184
|
// For more details please check
|
|
@@ -381,36 +186,21 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
381
186
|
collabEdit: props.collabEdit,
|
|
382
187
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
383
188
|
showAvatarGroup: !props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
384
|
-
}]).maybeAdd(findReplacePlugin,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
389
|
-
}]);
|
|
390
|
-
}
|
|
391
|
-
return builder;
|
|
392
|
-
}).maybeAdd(borderPlugin, function (plugin, builder) {
|
|
393
|
-
if (props.allowBorderMark || props.UNSAFE_allowBorderMark) {
|
|
394
|
-
return builder.add(plugin);
|
|
395
|
-
}
|
|
396
|
-
return builder;
|
|
397
|
-
}).maybeAdd(fragmentPlugin, function (plugin, builder) {
|
|
398
|
-
if (props.allowFragmentMark) {
|
|
399
|
-
return builder.add(plugin);
|
|
400
|
-
}
|
|
401
|
-
return builder;
|
|
402
|
-
}).maybeAdd(pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
189
|
+
}]).maybeAdd([findReplacePlugin, {
|
|
190
|
+
takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
191
|
+
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
192
|
+
}], Boolean(props.allowFindReplace)).maybeAdd(borderPlugin, Boolean(props.allowBorderMark || props.UNSAFE_allowBorderMark)).maybeAdd(fragmentPlugin, Boolean(props.allowFragmentMark)).maybeAdd(pasteOptionsToolbarPlugin, function () {
|
|
403
193
|
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
404
|
-
return
|
|
194
|
+
return true;
|
|
405
195
|
}
|
|
406
|
-
return
|
|
196
|
+
return false;
|
|
407
197
|
}).add([codeBidiWarningPlugin, {
|
|
408
198
|
appearance: appearance
|
|
409
|
-
}]).maybeAdd(loomPlugin, function (
|
|
199
|
+
}]).maybeAdd(loomPlugin, function () {
|
|
410
200
|
if (getBooleanFF('platform.editor.loom-integration')) {
|
|
411
|
-
return
|
|
201
|
+
return true;
|
|
412
202
|
}
|
|
413
|
-
return
|
|
203
|
+
return false;
|
|
414
204
|
});
|
|
415
205
|
return finalPreset;
|
|
416
206
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "191.4.
|
|
2
|
+
export var version = "191.4.4";
|