@atlaskit/editor-core 187.41.1 → 187.41.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 +34 -18
- package/dist/cjs/plugins/extension/index.js +35 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +8 -15
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -2
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/commands.js +63 -25
- package/dist/cjs/plugins/media/toolbar/index.js +13 -17
- package/dist/cjs/plugins/media/ui/PixelEntry/index.js +6 -5
- package/dist/cjs/plugins/media/utils/analytics.js +1 -1
- package/dist/cjs/plugins/selection/pm-plugins/events/create-selection-between.js +1 -1
- package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +13 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/extension/index.js +30 -4
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +8 -15
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -2
- package/dist/es2019/plugins/media/styles.js +3 -5
- package/dist/es2019/plugins/media/toolbar/commands.js +31 -1
- package/dist/es2019/plugins/media/toolbar/index.js +14 -19
- package/dist/es2019/plugins/media/ui/PixelEntry/index.js +6 -5
- package/dist/es2019/plugins/media/utils/analytics.js +1 -1
- package/dist/es2019/plugins/selection/pm-plugins/events/create-selection-between.js +1 -1
- package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +13 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/extension/index.js +35 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +8 -15
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -2
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/toolbar/commands.js +37 -1
- package/dist/esm/plugins/media/toolbar/index.js +14 -18
- package/dist/esm/plugins/media/ui/PixelEntry/index.js +6 -5
- package/dist/esm/plugins/media/utils/analytics.js +1 -1
- package/dist/esm/plugins/selection/pm-plugins/events/create-selection-between.js +1 -1
- package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +13 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +44 -2
- package/dist/types/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types/plugins/media/toolbar/commands.d.ts +3 -1
- package/dist/types/plugins/media/ui/PixelEntry/types.d.ts +2 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +54 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/toolbar/commands.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/ui/PixelEntry/types.d.ts +2 -0
- package/package.json +4 -4
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
5
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
6
|
import { isNodeSelection, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { getMediaInputResizeAnalyticsEvent } from '../utils/analytics';
|
|
4
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { removeMediaGroupNode } from './utils';
|
|
9
|
+
import { removeMediaGroupNode, getSelectedMediaSingle } from './utils';
|
|
6
10
|
import { currentMediaNodeWithPos } from '../utils/current-media-node';
|
|
7
11
|
export var DEFAULT_BORDER_COLOR = '#091e4224';
|
|
8
12
|
export var DEFAULT_BORDER_SIZE = 2;
|
|
@@ -190,4 +194,36 @@ export var setBorderMark = function setBorderMark(editorAnalyticsAPI) {
|
|
|
190
194
|
return true;
|
|
191
195
|
};
|
|
192
196
|
};
|
|
197
|
+
};
|
|
198
|
+
export var updateMediaSingleWidth = function updateMediaSingleWidth(editorAnalyticsAPI) {
|
|
199
|
+
return function (width, validation, layout) {
|
|
200
|
+
return function (state, dispatch) {
|
|
201
|
+
var selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
202
|
+
if (!selectedMediaSingleNode) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
var tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, _objectSpread(_objectSpread({}, selectedMediaSingleNode.node.attrs), {}, {
|
|
206
|
+
width: width,
|
|
207
|
+
widthType: 'pixel',
|
|
208
|
+
layout: layout
|
|
209
|
+
}));
|
|
210
|
+
tr.setMeta('scrollIntoView', false);
|
|
211
|
+
tr.setSelection(NodeSelection.create(tr.doc, selectedMediaSingleNode.pos));
|
|
212
|
+
var $pos = state.doc.resolve(selectedMediaSingleNode.pos);
|
|
213
|
+
var parentNodeType = $pos ? $pos.parent.type.name : undefined;
|
|
214
|
+
var payload = getMediaInputResizeAnalyticsEvent('mediaSingle', {
|
|
215
|
+
width: width,
|
|
216
|
+
layout: layout,
|
|
217
|
+
validation: validation,
|
|
218
|
+
parentNode: parentNodeType
|
|
219
|
+
});
|
|
220
|
+
if (payload) {
|
|
221
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
222
|
+
}
|
|
223
|
+
if (dispatch) {
|
|
224
|
+
dispatch(tr);
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
193
229
|
};
|
|
@@ -24,7 +24,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
24
24
|
import { FilePreviewItem } from './filePreviewItem';
|
|
25
25
|
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement, calcNewLayout, getMaxToolbarWidth } from './utils';
|
|
26
26
|
import { isVideo } from '../utils/media-single';
|
|
27
|
-
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
27
|
+
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark, updateMediaSingleWidth } from './commands';
|
|
28
28
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
29
29
|
import ImageBorderItem from '../ui/ImageBorder';
|
|
30
30
|
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
@@ -305,15 +305,11 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
307
|
onSubmit: function onSubmit(_ref2) {
|
|
308
|
-
var
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}));
|
|
314
|
-
tr.setMeta('scrollIntoView', false);
|
|
315
|
-
tr.setSelection(NodeSelection.create(tr.doc, selectedMediaSingleNode.pos));
|
|
316
|
-
dispatch(tr);
|
|
308
|
+
var _pluginInjectionApi$a4;
|
|
309
|
+
var width = _ref2.width,
|
|
310
|
+
validation = _ref2.validation;
|
|
311
|
+
var newLayout = calcNewLayout(width, layout, contentWidth, options.fullWidthEnabled);
|
|
312
|
+
updateMediaSingleWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions)(width, validation, newLayout)(state, dispatch);
|
|
317
313
|
},
|
|
318
314
|
onMigrate: function onMigrate() {
|
|
319
315
|
var tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, _objectSpread(_objectSpread({}, selectedMediaSingleNode.node.attrs), {}, {
|
|
@@ -368,10 +364,10 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
368
364
|
};
|
|
369
365
|
var openLink = function openLink() {
|
|
370
366
|
if (editorView) {
|
|
371
|
-
var _pluginInjectionApi$
|
|
367
|
+
var _pluginInjectionApi$a5;
|
|
372
368
|
var tr = editorView.state.tr,
|
|
373
369
|
dispatch = editorView.dispatch;
|
|
374
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
370
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions.attachAnalyticsEvent({
|
|
375
371
|
eventType: EVENT_TYPE.TRACK,
|
|
376
372
|
action: ACTION.VISITED,
|
|
377
373
|
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
@@ -397,8 +393,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
397
393
|
}
|
|
398
394
|
}
|
|
399
395
|
if (allowAltTextOnImages) {
|
|
400
|
-
var _pluginInjectionApi$
|
|
401
|
-
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
396
|
+
var _pluginInjectionApi$a6;
|
|
397
|
+
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a6 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a6 === void 0 ? void 0 : _pluginInjectionApi$a6.actions), {
|
|
402
398
|
type: 'separator'
|
|
403
399
|
});
|
|
404
400
|
}
|
|
@@ -482,22 +478,22 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
482
478
|
selectedNodeType = state.selection.node.type;
|
|
483
479
|
}
|
|
484
480
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
485
|
-
var _pluginInjectionApi$
|
|
481
|
+
var _pluginInjectionApi$a7;
|
|
486
482
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
487
483
|
baseToolbar.getDomRef = function () {
|
|
488
484
|
var _mediaPluginState$ele;
|
|
489
485
|
var selector = mediaFilmstripItemDOMSelector(mediaOffset);
|
|
490
486
|
return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
|
|
491
487
|
};
|
|
492
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
488
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a7 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a7 === void 0 ? void 0 : _pluginInjectionApi$a7.actions);
|
|
493
489
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
494
|
-
var _pluginInjectionApi$
|
|
490
|
+
var _pluginInjectionApi$a8;
|
|
495
491
|
baseToolbar.getDomRef = function () {
|
|
496
492
|
var _mediaPluginState$ele2;
|
|
497
493
|
var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(MediaInlineNodeSelector));
|
|
498
494
|
return element || mediaPluginState.element;
|
|
499
495
|
};
|
|
500
|
-
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
496
|
+
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions);
|
|
501
497
|
} else {
|
|
502
498
|
baseToolbar.getDomRef = function () {
|
|
503
499
|
var _mediaPluginState$ele3;
|
|
@@ -49,25 +49,26 @@ export var PixelEntry = function PixelEntry(_ref) {
|
|
|
49
49
|
}
|
|
50
50
|
if (onSubmit) {
|
|
51
51
|
var widthToBeSumitted = data.inputWidth;
|
|
52
|
-
var
|
|
52
|
+
var validation = 'valid';
|
|
53
53
|
if (data.inputWidth < minWidth) {
|
|
54
54
|
widthToBeSumitted = minWidth;
|
|
55
|
-
|
|
55
|
+
validation = 'less-than-min';
|
|
56
56
|
}
|
|
57
57
|
if (data.inputWidth > maxWidth) {
|
|
58
58
|
widthToBeSumitted = maxWidth;
|
|
59
|
-
|
|
59
|
+
validation = 'greater-than-max';
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// If user keeps submitting an invalid input, node width attribute will be updated with the same value
|
|
63
63
|
// and won't upadte the state in useEffect (since width is the same)
|
|
64
64
|
// Thus, we set the state here to always display the correct dimension
|
|
65
|
-
if (
|
|
65
|
+
if (validation !== 'valid') {
|
|
66
66
|
setComputedWidth(widthToBeSumitted);
|
|
67
67
|
setComputedHeight(Math.round(ratioWidth * widthToBeSumitted));
|
|
68
68
|
}
|
|
69
69
|
onSubmit({
|
|
70
|
-
width: widthToBeSumitted
|
|
70
|
+
width: widthToBeSumitted,
|
|
71
|
+
validation: validation
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
74
|
};
|
|
@@ -35,7 +35,7 @@ export var getMediaInputResizeAnalyticsEvent = function getMediaInputResizeAnaly
|
|
|
35
35
|
return {
|
|
36
36
|
action: ACTION.EDITED,
|
|
37
37
|
actionSubject: actionSubject,
|
|
38
|
-
actionSubjectId: ACTION_SUBJECT_ID.
|
|
38
|
+
actionSubjectId: ACTION_SUBJECT_ID.RESIZED,
|
|
39
39
|
attributes: {
|
|
40
40
|
width: width,
|
|
41
41
|
layout: layout,
|
|
@@ -21,8 +21,20 @@ var isCollpasedExpand = function isCollpasedExpand(node) {
|
|
|
21
21
|
var isBodiedExtension = function isBodiedExtension(node) {
|
|
22
22
|
return Boolean(node && ['bodiedExtension'].includes(node.type.name));
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* ED-19861 - [Regression] keyboard selections within action items are unpredicatable
|
|
27
|
+
* Table was added to the list of problematic nodes because the desired behaviour when Shift+Up from outside the
|
|
28
|
+
* table is to select the table node itself, rather than the table cell content. Previously this behaviour was handled
|
|
29
|
+
* in `packages/editor/editor-core/src/plugins/selection/pm-plugins/events/create-selection-between.ts` but there was
|
|
30
|
+
* a bug in `create-selection-between` which after fixing the bug that code was no longer handling table selection
|
|
31
|
+
* correctly, so to fix that table was added here.
|
|
32
|
+
*/
|
|
33
|
+
var isTable = function isTable(node) {
|
|
34
|
+
return Boolean(node && ['table'].includes(node.type.name));
|
|
35
|
+
};
|
|
24
36
|
var isProblematicNode = function isProblematicNode(node) {
|
|
25
|
-
return isCollpasedExpand(node) || isBodiedExtension(node);
|
|
37
|
+
return isCollpasedExpand(node) || isBodiedExtension(node) || isTable(node);
|
|
26
38
|
};
|
|
27
39
|
var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction) {
|
|
28
40
|
if ($head.pos === 0 || $head.depth === 0) {
|
|
@@ -78,7 +78,28 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
78
78
|
actions: {
|
|
79
79
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
80
80
|
};
|
|
81
|
-
}, undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
81
|
+
}, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
82
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined;
|
|
83
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
84
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
85
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
86
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
87
|
+
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
88
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
89
|
+
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
90
|
+
actions: {
|
|
91
|
+
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
92
|
+
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
93
|
+
};
|
|
94
|
+
}, undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contextPanel", {
|
|
95
|
+
actions: {
|
|
96
|
+
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
97
|
+
};
|
|
98
|
+
}, undefined>>];
|
|
99
|
+
actions: {
|
|
100
|
+
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
101
|
+
};
|
|
102
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
82
103
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
83
104
|
}, undefined>];
|
|
84
105
|
actions: {
|
|
@@ -233,7 +254,28 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
233
254
|
actions: {
|
|
234
255
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
235
256
|
};
|
|
236
|
-
}, undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
257
|
+
}, undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
258
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined;
|
|
259
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
260
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
261
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
262
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
263
|
+
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
264
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
265
|
+
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
266
|
+
actions: {
|
|
267
|
+
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
268
|
+
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
269
|
+
};
|
|
270
|
+
}, undefined>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contextPanel", {
|
|
271
|
+
actions: {
|
|
272
|
+
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
273
|
+
};
|
|
274
|
+
}, undefined>>];
|
|
275
|
+
actions: {
|
|
276
|
+
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
277
|
+
};
|
|
278
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
237
279
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
238
280
|
}, undefined>];
|
|
239
281
|
actions: {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
|
|
5
6
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
6
7
|
interface Props {
|
|
7
8
|
node: PMNode;
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
editorView: EditorView;
|
|
10
11
|
separator?: 'start' | 'end' | 'both';
|
|
11
12
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
13
|
+
extensionApi: ExtensionAPI | undefined;
|
|
12
14
|
}
|
|
13
15
|
export declare const ExtensionsPlaceholder: (props: Props) => JSX.Element | null;
|
|
14
16
|
export {};
|
|
@@ -9,6 +9,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
9
9
|
import type { FloatingToolbarItem, FeatureFlags, PluginInjectionAPIWithDependencies, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
11
|
import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
12
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
12
13
|
export type Item = FloatingToolbarItem<Function>;
|
|
13
14
|
export interface Props {
|
|
14
15
|
items: Array<Item>;
|
|
@@ -28,7 +29,8 @@ export interface Props {
|
|
|
28
29
|
featureFlags: FeatureFlags;
|
|
29
30
|
api: PluginInjectionAPIWithDependencies<[
|
|
30
31
|
typeof decorationsPlugin,
|
|
31
|
-
OptionalPlugin<typeof contextPanelPlugin
|
|
32
|
+
OptionalPlugin<typeof contextPanelPlugin>,
|
|
33
|
+
OptionalPlugin<ExtensionPlugin>
|
|
32
34
|
]> | undefined;
|
|
33
35
|
}
|
|
34
36
|
export declare const isSameItem: (leftItem: Item, rightItem: Item) => boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
|
|
1
|
+
import type { BorderMarkAttributes, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../../types';
|
|
3
|
+
import type { PixelEntryValidation } from '../ui/PixelEntry/types';
|
|
3
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
5
6
|
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
@@ -8,3 +9,4 @@ export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyti
|
|
|
8
9
|
export declare const removeInlineCard: Command;
|
|
9
10
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
10
11
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
12
|
+
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, layout: RichMediaLayout) => Command;
|
|
@@ -51,6 +51,8 @@ export type PixelEntryFormValues = {
|
|
|
51
51
|
inputWidth: number | '';
|
|
52
52
|
inputHeight: number | '';
|
|
53
53
|
};
|
|
54
|
+
export type PixelEntryValidation = 'valid' | 'greater-than-max' | 'less-than-min';
|
|
54
55
|
export type PixelEntryFormData = {
|
|
55
56
|
width: number;
|
|
57
|
+
validation: PixelEntryValidation;
|
|
56
58
|
};
|
|
@@ -106,6 +106,33 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
106
106
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
107
107
|
};
|
|
108
108
|
}, undefined>>,
|
|
109
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
110
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined;
|
|
111
|
+
dependencies: [
|
|
112
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
113
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
114
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
115
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>,
|
|
116
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
117
|
+
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
118
|
+
}, undefined>,
|
|
119
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
120
|
+
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
121
|
+
actions: {
|
|
122
|
+
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
123
|
+
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
124
|
+
};
|
|
125
|
+
}, undefined>,
|
|
126
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contextPanel", {
|
|
127
|
+
actions: {
|
|
128
|
+
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
129
|
+
};
|
|
130
|
+
}, undefined>>
|
|
131
|
+
];
|
|
132
|
+
actions: {
|
|
133
|
+
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
134
|
+
};
|
|
135
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>,
|
|
109
136
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
110
137
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
111
138
|
}, undefined>
|
|
@@ -315,6 +342,33 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
315
342
|
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
316
343
|
};
|
|
317
344
|
}, undefined>>,
|
|
345
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"extension", {
|
|
346
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined;
|
|
347
|
+
dependencies: [
|
|
348
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
349
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
350
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
351
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>,
|
|
352
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
|
|
353
|
+
sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
354
|
+
}, undefined>,
|
|
355
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
356
|
+
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
357
|
+
actions: {
|
|
358
|
+
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
359
|
+
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
360
|
+
};
|
|
361
|
+
}, undefined>,
|
|
362
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contextPanel", {
|
|
363
|
+
actions: {
|
|
364
|
+
applyChange: (tr: import("prosemirror-state").Transaction) => import("prosemirror-state").Transaction;
|
|
365
|
+
};
|
|
366
|
+
}, undefined>>
|
|
367
|
+
];
|
|
368
|
+
actions: {
|
|
369
|
+
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
370
|
+
};
|
|
371
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>,
|
|
318
372
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
319
373
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
320
374
|
}, undefined>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import type { ExtensionAPI } from '@atlaskit/editor-common/extensions';
|
|
5
6
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
6
7
|
interface Props {
|
|
7
8
|
node: PMNode;
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
editorView: EditorView;
|
|
10
11
|
separator?: 'start' | 'end' | 'both';
|
|
11
12
|
applyChangeToContextPanel: ApplyChangeHandler | undefined;
|
|
13
|
+
extensionApi: ExtensionAPI | undefined;
|
|
12
14
|
}
|
|
13
15
|
export declare const ExtensionsPlaceholder: (props: Props) => JSX.Element | null;
|
|
14
16
|
export {};
|
|
@@ -9,6 +9,7 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
9
9
|
import type { FloatingToolbarItem, FeatureFlags, PluginInjectionAPIWithDependencies, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
11
|
import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
12
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
12
13
|
export type Item = FloatingToolbarItem<Function>;
|
|
13
14
|
export interface Props {
|
|
14
15
|
items: Array<Item>;
|
|
@@ -28,7 +29,8 @@ export interface Props {
|
|
|
28
29
|
featureFlags: FeatureFlags;
|
|
29
30
|
api: PluginInjectionAPIWithDependencies<[
|
|
30
31
|
typeof decorationsPlugin,
|
|
31
|
-
OptionalPlugin<typeof contextPanelPlugin
|
|
32
|
+
OptionalPlugin<typeof contextPanelPlugin>,
|
|
33
|
+
OptionalPlugin<ExtensionPlugin>
|
|
32
34
|
]> | undefined;
|
|
33
35
|
}
|
|
34
36
|
export declare const isSameItem: (leftItem: Item, rightItem: Item) => boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
|
|
1
|
+
import type { BorderMarkAttributes, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../../types';
|
|
3
|
+
import type { PixelEntryValidation } from '../ui/PixelEntry/types';
|
|
3
4
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
5
6
|
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
@@ -8,3 +9,4 @@ export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyti
|
|
|
8
9
|
export declare const removeInlineCard: Command;
|
|
9
10
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
10
11
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
12
|
+
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, layout: RichMediaLayout) => Command;
|
|
@@ -51,6 +51,8 @@ export type PixelEntryFormValues = {
|
|
|
51
51
|
inputWidth: number | '';
|
|
52
52
|
inputHeight: number | '';
|
|
53
53
|
};
|
|
54
|
+
export type PixelEntryValidation = 'valid' | 'greater-than-max' | 'less-than-min';
|
|
54
55
|
export type PixelEntryFormData = {
|
|
55
56
|
width: number;
|
|
57
|
+
validation: PixelEntryValidation;
|
|
56
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.41.
|
|
3
|
+
"version": "187.41.4",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
43
|
-
"@atlaskit/adf-schema": "
|
|
43
|
+
"@atlaskit/adf-schema": "^29.1.0",
|
|
44
44
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
45
45
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
46
46
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
68
68
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
69
69
|
"@atlaskit/editor-plugin-emoji": "^0.3.0",
|
|
70
|
-
"@atlaskit/editor-plugin-extension": "^0.
|
|
70
|
+
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
71
71
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
72
72
|
"@atlaskit/editor-plugin-floating-toolbar": "^0.4.0",
|
|
73
73
|
"@atlaskit/editor-plugin-focus": "^0.2.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"devDependencies": {
|
|
150
150
|
"@af/integration-testing": "*",
|
|
151
151
|
"@atlaskit/code": "^14.6.0",
|
|
152
|
-
"@atlaskit/collab-provider": "9.12.
|
|
152
|
+
"@atlaskit/collab-provider": "9.12.2",
|
|
153
153
|
"@atlaskit/dropdown-menu": "^11.13.0",
|
|
154
154
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
155
155
|
"@atlaskit/editor-plugin-table": "^2.13.0",
|