@atlaskit/editor-plugin-media 2.3.8 → 2.3.9
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 +9 -0
- package/dist/cjs/mediaPlugin.js +7 -0
- package/dist/cjs/pm-plugins/pixel-resizing/commands.js +22 -0
- package/dist/cjs/pm-plugins/pixel-resizing/index.js +31 -0
- package/dist/cjs/pm-plugins/pixel-resizing/reducer.js +28 -0
- package/dist/cjs/pm-plugins/pixel-resizing/ui/constants.js +11 -0
- package/dist/cjs/pm-plugins/pixel-resizing/ui/index.js +124 -0
- package/dist/cjs/{ui/PixelEntry/index.js → pm-plugins/pixel-resizing/ui/pixel-entry.js} +168 -13
- package/dist/cjs/ui/toolbar/commands.js +29 -22
- package/dist/cjs/ui/toolbar/index.js +55 -94
- package/dist/cjs/ui/toolbar/linking.js +1 -1
- package/dist/cjs/ui/toolbar/pixel-resizing.js +47 -0
- package/dist/es2019/mediaPlugin.js +7 -0
- package/dist/es2019/pm-plugins/pixel-resizing/commands.js +16 -0
- package/dist/es2019/pm-plugins/pixel-resizing/index.js +27 -0
- package/dist/es2019/pm-plugins/pixel-resizing/reducer.js +20 -0
- package/dist/es2019/pm-plugins/pixel-resizing/ui/constants.js +5 -0
- package/dist/es2019/pm-plugins/pixel-resizing/ui/index.js +126 -0
- package/dist/es2019/{ui/PixelEntry/index.js → pm-plugins/pixel-resizing/ui/pixel-entry.js} +170 -19
- package/dist/es2019/ui/toolbar/commands.js +9 -2
- package/dist/es2019/ui/toolbar/index.js +47 -88
- package/dist/es2019/ui/toolbar/linking.js +1 -1
- package/dist/es2019/ui/toolbar/pixel-resizing.js +37 -0
- package/dist/esm/mediaPlugin.js +7 -0
- package/dist/esm/pm-plugins/pixel-resizing/commands.js +16 -0
- package/dist/esm/pm-plugins/pixel-resizing/index.js +25 -0
- package/dist/esm/pm-plugins/pixel-resizing/reducer.js +21 -0
- package/dist/esm/pm-plugins/pixel-resizing/ui/constants.js +5 -0
- package/dist/esm/pm-plugins/pixel-resizing/ui/index.js +120 -0
- package/dist/esm/{ui/PixelEntry/index.js → pm-plugins/pixel-resizing/ui/pixel-entry.js} +172 -17
- package/dist/esm/ui/toolbar/commands.js +28 -21
- package/dist/esm/ui/toolbar/index.js +47 -86
- package/dist/esm/ui/toolbar/linking.js +1 -1
- package/dist/esm/ui/toolbar/pixel-resizing.js +40 -0
- package/dist/types/pm-plugins/pixel-resizing/commands.d.ts +4 -0
- package/dist/types/pm-plugins/pixel-resizing/index.d.ts +13 -0
- package/dist/types/pm-plugins/pixel-resizing/reducer.d.ts +12 -0
- package/dist/types/pm-plugins/pixel-resizing/ui/constants.d.ts +3 -0
- package/dist/types/pm-plugins/pixel-resizing/ui/index.d.ts +21 -0
- package/dist/types/pm-plugins/pixel-resizing/ui/pixel-entry.d.ts +4 -0
- package/dist/types/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/types.d.ts +18 -0
- package/dist/types/ui/toolbar/commands.d.ts +2 -1
- package/dist/types/ui/toolbar/pixel-resizing.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/commands.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +13 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/reducer.d.ts +12 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/constants.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +21 -0
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/pixel-entry.d.ts +4 -0
- package/dist/types-ts4.5/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/types.d.ts +18 -0
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +2 -1
- package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +4 -0
- package/package.json +5 -5
- package/dist/cjs/ui/PixelEntry/constants.js +0 -7
- package/dist/es2019/ui/PixelEntry/constants.js +0 -1
- package/dist/esm/ui/PixelEntry/constants.js +0 -1
- package/dist/types/ui/PixelEntry/constants.d.ts +0 -1
- package/dist/types/ui/PixelEntry/index.d.ts +0 -7
- package/dist/types-ts4.5/ui/PixelEntry/constants.d.ts +0 -1
- package/dist/types-ts4.5/ui/PixelEntry/index.d.ts +0 -7
- /package/dist/cjs/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/styles.js +0 -0
- /package/dist/cjs/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/types.js +0 -0
- /package/dist/es2019/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/styles.js +0 -0
- /package/dist/es2019/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/types.js +0 -0
- /package/dist/esm/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/styles.js +0 -0
- /package/dist/esm/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/types.js +0 -0
- /package/dist/types/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/styles.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/PixelEntry → pm-plugins/pixel-resizing/ui}/styles.d.ts +0 -0
|
@@ -8,11 +8,9 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
|
|
|
8
8
|
import { alignmentIcons, buildLayoutButtons, IconCard, IconEmbed, IconInline, layoutToMessages, wrappingIcons } from '@atlaskit/editor-common/card';
|
|
9
9
|
import { altTextMessages } from '@atlaskit/editor-common/media';
|
|
10
10
|
import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
|
|
11
|
-
import { calcMinWidth, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
12
11
|
import commonMessages, { cardMessages, mediaAndEmbedToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
13
12
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
|
-
import { contains, findParentNodeOfType,
|
|
15
|
-
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
13
|
+
import { contains, findParentNodeOfType, hasParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
16
14
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
17
15
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
18
16
|
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
@@ -34,20 +32,23 @@ import { getPluginState as getMediaAltTextPluginState } from '../../pm-plugins/a
|
|
|
34
32
|
import { openMediaAltTextMenu } from '../../pm-plugins/alt-text/commands';
|
|
35
33
|
import { showLinkingToolbar } from '../../pm-plugins/commands/linking';
|
|
36
34
|
import { getMediaLinkingState } from '../../pm-plugins/linking';
|
|
35
|
+
import { getPluginState as getMediaPixelResizingPluginState } from '../../pm-plugins/pixel-resizing';
|
|
36
|
+
import { openPixelEditor } from '../../pm-plugins/pixel-resizing/commands';
|
|
37
|
+
import { FullWidthDisplay, PixelEntry } from '../../pm-plugins/pixel-resizing/ui';
|
|
37
38
|
import { stateKey } from '../../pm-plugins/plugin-key';
|
|
38
39
|
import { currentMediaOrInlineNodeBorderMark } from '../../pm-plugins/utils/current-media-node';
|
|
39
40
|
import { isVideo } from '../../pm-plugins/utils/media-single';
|
|
40
41
|
import ImageBorderItem from '../../ui/ImageBorder';
|
|
41
|
-
import { FullWidthDisplay, PixelEntry } from '../../ui/PixelEntry';
|
|
42
42
|
import { altTextButton, getAltTextToolbar } from './alt-text';
|
|
43
|
-
import { changeMediaCardToInline, changeMediaSingleToMediaInline, setBorderMark, toggleBorderMark
|
|
43
|
+
import { changeMediaCardToInline, changeMediaSingleToMediaInline, setBorderMark, toggleBorderMark } from './commands';
|
|
44
44
|
import { commentButton } from './comments';
|
|
45
45
|
import { shouldShowImageBorder } from './imageBorder';
|
|
46
46
|
import { LayoutGroup } from './layout-group';
|
|
47
47
|
import { getLinkingDropdownOptions, getLinkingToolbar, getOpenLinkToolbarButtonOption, shouldShowMediaLinkToolbar } from './linking';
|
|
48
48
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
49
49
|
import { generateMediaInlineFloatingToolbar } from './mediaInline';
|
|
50
|
-
import {
|
|
50
|
+
import { getPixelResizingToolbar } from './pixel-resizing';
|
|
51
|
+
import { canShowSwitchButtons, downloadMedia, getMaxToolbarWidth, getSelectedLayoutIcon, getSelectedMediaSingle, getSelectedNearestMediaContainerNodeAttrs, removeMediaGroupNode } from './utils';
|
|
51
52
|
var mediaTypeMessages = {
|
|
52
53
|
image: messages.file_image_is_selected,
|
|
53
54
|
video: messages.file_video_is_selected,
|
|
@@ -372,69 +373,17 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
372
373
|
type: 'custom',
|
|
373
374
|
fallback: [],
|
|
374
375
|
render: function render(editorView) {
|
|
375
|
-
var _widthPlugin$sharedSt2, _pluginInjectionApi$m;
|
|
376
376
|
if (!editorView || !selectedMediaSingleNode) {
|
|
377
377
|
return null;
|
|
378
378
|
}
|
|
379
|
-
var state = editorView.state,
|
|
380
|
-
dispatch = editorView.dispatch;
|
|
381
|
-
var contentWidth = (widthPlugin === null || widthPlugin === void 0 || (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || akEditorDefaultLayoutWidth;
|
|
382
|
-
var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
|
|
383
|
-
if (!selectedMediaNode) {
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
var _selectedMediaSingleN = selectedMediaSingleNode.node.attrs,
|
|
387
|
-
mediaSingleWidth = _selectedMediaSingleN.width,
|
|
388
|
-
widthType = _selectedMediaSingleN.widthType,
|
|
389
|
-
layout = _selectedMediaSingleN.layout;
|
|
390
|
-
var _selectedMediaNode$at = selectedMediaNode.attrs,
|
|
391
|
-
mediaWidth = _selectedMediaNode$at.width,
|
|
392
|
-
mediaHeight = _selectedMediaNode$at.height;
|
|
393
|
-
var maxWidthForNestedNode = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.media) === null || _pluginInjectionApi$m === void 0 || (_pluginInjectionApi$m = _pluginInjectionApi$m.sharedState.currentState()) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.currentMaxWidth;
|
|
394
|
-
var maxWidth = maxWidthForNestedNode || akEditorFullWidthLayoutWidth;
|
|
395
|
-
var isVideoFile = isVideo(selectedMediaNode.attrs.__fileMimeType);
|
|
396
|
-
var minWidth = calcMinWidth(isVideoFile, maxWidthForNestedNode || contentWidth);
|
|
397
|
-
var hasPixelType = widthType === 'pixel';
|
|
398
|
-
var pixelWidthFromElement = getPixelWidthOfElement(editorView, selectedMediaSingleNode.pos + 1,
|
|
399
|
-
// get pos of media node
|
|
400
|
-
mediaWidth || DEFAULT_IMAGE_WIDTH);
|
|
401
|
-
var pixelWidth = hasPixelType ? mediaSingleWidth : pixelWidthFromElement;
|
|
402
|
-
|
|
403
|
-
//hasParentNode will return falsey value if selection depth === 0
|
|
404
|
-
var isNested = hasParentNode(function (n) {
|
|
405
|
-
return n.type !== state.schema.nodes.doc;
|
|
406
|
-
})(state.selection);
|
|
407
379
|
return /*#__PURE__*/React.createElement(PixelEntry, {
|
|
380
|
+
editorView: editorView,
|
|
408
381
|
intl: intl,
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
maxWidth: maxWidth,
|
|
415
|
-
onChange: function onChange(valid) {
|
|
416
|
-
if (valid) {
|
|
417
|
-
hoverDecoration === null || hoverDecoration === void 0 || hoverDecoration(mediaSingle, true, 'warning')(editorView.state, dispatch, editorView);
|
|
418
|
-
} else {
|
|
419
|
-
hoverDecoration === null || hoverDecoration === void 0 || hoverDecoration(mediaSingle, false)(editorView.state, dispatch, editorView);
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
onSubmit: function onSubmit(_ref3) {
|
|
423
|
-
var _pluginInjectionApi$a6;
|
|
424
|
-
var width = _ref3.width,
|
|
425
|
-
validation = _ref3.validation;
|
|
426
|
-
var newLayout = calcNewLayout(width, layout, contentWidth, options.fullWidthEnabled, isNested);
|
|
427
|
-
updateMediaSingleWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a6 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a6 === void 0 ? void 0 : _pluginInjectionApi$a6.actions)(width, validation, 'floatingToolBar', newLayout)(state, dispatch);
|
|
428
|
-
},
|
|
429
|
-
onMigrate: function onMigrate() {
|
|
430
|
-
var tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, _objectSpread(_objectSpread({}, selectedMediaSingleNode.node.attrs), {}, {
|
|
431
|
-
width: pixelWidthFromElement,
|
|
432
|
-
widthType: 'pixel'
|
|
433
|
-
}));
|
|
434
|
-
tr.setMeta('scrollIntoView', false);
|
|
435
|
-
tr.setSelection(NodeSelection.create(tr.doc, selectedMediaSingleNode.pos));
|
|
436
|
-
dispatch(tr);
|
|
437
|
-
}
|
|
382
|
+
selectedMediaSingleNode: selectedMediaSingleNode,
|
|
383
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
384
|
+
pluginState: pluginState,
|
|
385
|
+
hoverDecoration: hoverDecoration,
|
|
386
|
+
isEditorFullWidthEnabled: options.fullWidthEnabled
|
|
438
387
|
});
|
|
439
388
|
}
|
|
440
389
|
};
|
|
@@ -488,10 +437,10 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
488
437
|
};
|
|
489
438
|
var openLink = function openLink() {
|
|
490
439
|
if (editorView) {
|
|
491
|
-
var _pluginInjectionApi$
|
|
440
|
+
var _pluginInjectionApi$a6;
|
|
492
441
|
var tr = editorView.state.tr,
|
|
493
442
|
dispatch = editorView.dispatch;
|
|
494
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
443
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a6 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a6 === void 0 || _pluginInjectionApi$a6.actions.attachAnalyticsEvent({
|
|
495
444
|
eventType: EVENT_TYPE.TRACK,
|
|
496
445
|
action: ACTION.VISITED,
|
|
497
446
|
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
@@ -565,8 +514,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
565
514
|
});
|
|
566
515
|
}
|
|
567
516
|
if (allowAltTextOnImages && editorExperiment('platform_editor_controls', 'control')) {
|
|
568
|
-
var _pluginInjectionApi$
|
|
569
|
-
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
517
|
+
var _pluginInjectionApi$a7;
|
|
518
|
+
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a7 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a7 === void 0 ? void 0 : _pluginInjectionApi$a7.actions), {
|
|
570
519
|
type: 'separator'
|
|
571
520
|
});
|
|
572
521
|
}
|
|
@@ -681,11 +630,13 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
681
630
|
providerFactory = options.providerFactory,
|
|
682
631
|
allowMediaInline = options.allowMediaInline,
|
|
683
632
|
allowResizing = options.allowResizing,
|
|
684
|
-
isViewOnly = options.isViewOnly
|
|
633
|
+
isViewOnly = options.isViewOnly,
|
|
634
|
+
allowResizingInTables = options.allowResizingInTables,
|
|
635
|
+
allowAdvancedToolBarOptions = options.allowAdvancedToolBarOptions;
|
|
685
636
|
var mediaPluginState = stateKey.getState(state);
|
|
686
637
|
var mediaLinkingState = getMediaLinkingState(state);
|
|
687
|
-
var
|
|
688
|
-
hoverDecoration =
|
|
638
|
+
var _ref3 = (_pluginInjectionApi$d3 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d4 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : _pluginInjectionApi$d4.actions) !== null && _pluginInjectionApi$d3 !== void 0 ? _pluginInjectionApi$d3 : {},
|
|
639
|
+
hoverDecoration = _ref3.hoverDecoration;
|
|
689
640
|
if (!mediaPluginState) {
|
|
690
641
|
return;
|
|
691
642
|
}
|
|
@@ -713,6 +664,20 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
713
664
|
});
|
|
714
665
|
}
|
|
715
666
|
}
|
|
667
|
+
var selection = state.selection;
|
|
668
|
+
var isWithinTable = hasParentNodeOfType([state.schema.nodes.table])(selection);
|
|
669
|
+
if (allowAdvancedToolBarOptions && allowResizing && (!isWithinTable || allowResizingInTables === true) && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_media_extended_resize_experience')) {
|
|
670
|
+
var mediaPixelResizingPluginState = getMediaPixelResizingPluginState(state);
|
|
671
|
+
if (mediaPixelResizingPluginState !== null && mediaPixelResizingPluginState !== void 0 && mediaPixelResizingPluginState.isPixelEditorOpen) {
|
|
672
|
+
return getPixelResizingToolbar(baseToolbar, {
|
|
673
|
+
intl: intl,
|
|
674
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
675
|
+
pluginState: mediaPluginState,
|
|
676
|
+
hoverDecoration: hoverDecoration,
|
|
677
|
+
isEditorFullWidthEnabled: options.fullWidthEnabled
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
}
|
|
716
681
|
var items = [];
|
|
717
682
|
var parentMediaGroupNode = findParentNodeOfType(mediaGroup)(state.selection);
|
|
718
683
|
var selectedNodeType;
|
|
@@ -720,7 +685,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
720
685
|
selectedNodeType = state.selection.node.type;
|
|
721
686
|
}
|
|
722
687
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
723
|
-
var _pluginInjectionApi$
|
|
688
|
+
var _pluginInjectionApi$a8, _pluginInjectionApi$f2;
|
|
724
689
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
725
690
|
baseToolbar.getDomRef = function () {
|
|
726
691
|
var _mediaPluginState$ele;
|
|
@@ -729,7 +694,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
729
694
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
730
695
|
return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
|
|
731
696
|
};
|
|
732
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
697
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
|
|
733
698
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
734
699
|
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
|
|
735
700
|
} else {
|
|
@@ -743,7 +708,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
743
708
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
744
709
|
}
|
|
745
710
|
if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
746
|
-
var _pluginInjectionApi$
|
|
711
|
+
var _pluginInjectionApi$a9;
|
|
747
712
|
var lastItem = items.at(-1);
|
|
748
713
|
if ((lastItem === null || lastItem === void 0 ? void 0 : lastItem.type) === 'separator') {
|
|
749
714
|
lastItem.fullHeight = true;
|
|
@@ -758,21 +723,17 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
758
723
|
type: 'overflow-dropdown',
|
|
759
724
|
options: [].concat(_toConsumableArray(getLinkingDropdownOptions(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), [{
|
|
760
725
|
title: altTextTitle,
|
|
761
|
-
onClick: openMediaAltTextMenu(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
726
|
+
onClick: openMediaAltTextMenu(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a9 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a9 === void 0 ? void 0 : _pluginInjectionApi$a9.actions),
|
|
762
727
|
icon: /*#__PURE__*/React.createElement(TextIcon, {
|
|
763
|
-
label:
|
|
728
|
+
label: ""
|
|
764
729
|
})
|
|
765
730
|
}, {
|
|
766
731
|
title: 'Resize',
|
|
767
|
-
onClick:
|
|
768
|
-
// Ignored via go/ees007
|
|
769
|
-
// eslint-disable-next-line @atlaskit/editor/enforce-todo-comment-format
|
|
770
|
-
// TODO open resize dialog?
|
|
771
|
-
return true;
|
|
772
|
-
},
|
|
732
|
+
onClick: openPixelEditor(),
|
|
773
733
|
icon: /*#__PURE__*/React.createElement(GrowHorizontalIcon, {
|
|
774
|
-
label: "
|
|
775
|
-
})
|
|
734
|
+
label: ""
|
|
735
|
+
}),
|
|
736
|
+
testId: 'media-pixel-resizing-dropdown-option'
|
|
776
737
|
}, {
|
|
777
738
|
type: 'separator'
|
|
778
739
|
}, {
|
|
@@ -784,13 +745,13 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
784
745
|
return true;
|
|
785
746
|
},
|
|
786
747
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
787
|
-
label: "
|
|
748
|
+
label: ""
|
|
788
749
|
})
|
|
789
750
|
}, {
|
|
790
751
|
title: 'Delete',
|
|
791
752
|
onClick: remove,
|
|
792
753
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
793
|
-
label: "
|
|
754
|
+
label: ""
|
|
794
755
|
})
|
|
795
756
|
}])
|
|
796
757
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
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; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { PixelEntry } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
|
+
import { PIXEL_RESIZING_TOOLBAR_WIDTH } from '../../pm-plugins/pixel-resizing/ui/constants';
|
|
7
|
+
import { getSelectedMediaSingle } from './utils';
|
|
8
|
+
export var getPixelResizingToolbar = function getPixelResizingToolbar(toolbarBaseConfig, _ref) {
|
|
9
|
+
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
10
|
+
intl = _ref.intl,
|
|
11
|
+
pluginState = _ref.pluginState,
|
|
12
|
+
hoverDecoration = _ref.hoverDecoration,
|
|
13
|
+
isEditorFullWidthEnabled = _ref.isEditorFullWidthEnabled;
|
|
14
|
+
return _objectSpread(_objectSpread({}, toolbarBaseConfig), {}, {
|
|
15
|
+
width: PIXEL_RESIZING_TOOLBAR_WIDTH,
|
|
16
|
+
scrollable: true,
|
|
17
|
+
items: [{
|
|
18
|
+
type: 'custom',
|
|
19
|
+
fallback: [],
|
|
20
|
+
render: function render(editorView) {
|
|
21
|
+
if (!editorView) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
var selectedMediaSingleNode = getSelectedMediaSingle(editorView.state);
|
|
25
|
+
if (!editorView || !selectedMediaSingleNode) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement(PixelEntry, {
|
|
29
|
+
editorView: editorView,
|
|
30
|
+
intl: intl,
|
|
31
|
+
selectedMediaSingleNode: selectedMediaSingleNode,
|
|
32
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
33
|
+
pluginState: pluginState,
|
|
34
|
+
hoverDecoration: hoverDecoration,
|
|
35
|
+
isEditorFullWidthEnabled: isEditorFullWidthEnabled
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Transaction, EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare const openPixelEditor: () => import("@atlaskit/editor-common/types").Command;
|
|
3
|
+
export declare const closePixelEditor: () => import("@atlaskit/editor-common/types").Command;
|
|
4
|
+
export declare const closePixelEditorAndSave: (saveTransform: (tr: Transaction, state: EditorState) => Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
declare const createCommand: <A = {
|
|
4
|
+
type: "openPixelEditor";
|
|
5
|
+
} | {
|
|
6
|
+
type: "closePixelEditor";
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
|
+
isPixelEditorOpen: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
11
|
+
isPixelEditorOpen: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export { createCommand, getPluginState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type mediaPixelResizingState = {
|
|
2
|
+
isPixelEditorOpen: boolean;
|
|
3
|
+
};
|
|
4
|
+
type OpenPixelEditor = {
|
|
5
|
+
type: 'openPixelEditor';
|
|
6
|
+
};
|
|
7
|
+
type ClosePixelEditor = {
|
|
8
|
+
type: 'closePixelEditor';
|
|
9
|
+
};
|
|
10
|
+
type MediaPixelResizingAction = OpenPixelEditor | ClosePixelEditor;
|
|
11
|
+
declare const _default: (state: mediaPixelResizingState, action: MediaPixelResizingAction) => mediaPixelResizingState;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
+
import { MediaPluginState } from '../../../types';
|
|
9
|
+
export type Props = {
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
selectedMediaSingleNode: ContentNodeWithPos;
|
|
12
|
+
pluginInjectionApi?: ExtractInjectionAPI<MediaNextEditorPluginType>;
|
|
13
|
+
intl: IntlShape;
|
|
14
|
+
pluginState: MediaPluginState;
|
|
15
|
+
hoverDecoration: HoverDecorationHandler | undefined;
|
|
16
|
+
isEditorFullWidthEnabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const PixelEntry: ({ editorView, selectedMediaSingleNode, pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, }: Props) => jsx.JSX.Element | null;
|
|
19
|
+
export declare const FullWidthDisplay: ({ intl: { formatMessage } }: {
|
|
20
|
+
intl: IntlShape;
|
|
21
|
+
}) => jsx.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { PixelEntryComponentNextProps, PixelEntryProps } from './types';
|
|
3
|
+
export declare const PixelEntryComponent: ({ width, mediaWidth, mediaHeight, onSubmit, minWidth, maxWidth, onChange, intl: { formatMessage }, showMigration, onMigrate, onCloseAndSave, isViewMode, }: PixelEntryProps) => jsx.JSX.Element;
|
|
4
|
+
export declare const PixelEntryComponentNext: ({ maxWidth, formatMessage, handleFieldChange, computedWidth, computedHeight, handleCloseAndSave, isViewMode, }: PixelEntryComponentNextProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
1
2
|
import type { IntlShape } from 'react-intl-next';
|
|
2
3
|
export type PixelEntryProps = {
|
|
3
4
|
/**
|
|
@@ -46,6 +47,14 @@ export type PixelEntryProps = {
|
|
|
46
47
|
* Migration handler called when the CTA button is clicked
|
|
47
48
|
*/
|
|
48
49
|
onMigrate?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when the Enter key is pressed or close button is clicked
|
|
52
|
+
*/
|
|
53
|
+
onCloseAndSave?: (data: PixelEntryFormData) => void;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
isViewMode?: boolean;
|
|
49
58
|
};
|
|
50
59
|
export type PixelEntryFormValues = {
|
|
51
60
|
inputWidth: number | '';
|
|
@@ -56,4 +65,13 @@ type PixelEntryFormData = {
|
|
|
56
65
|
width: number;
|
|
57
66
|
validation: PixelEntryValidation;
|
|
58
67
|
};
|
|
68
|
+
export type PixelEntryComponentNextProps = {
|
|
69
|
+
maxWidth: number;
|
|
70
|
+
computedWidth: number | '';
|
|
71
|
+
computedHeight: number | '';
|
|
72
|
+
handleFieldChange: (type: string) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
73
|
+
formatMessage: IntlShape['formatMessage'];
|
|
74
|
+
handleCloseAndSave: (data: PixelEntryFormValues) => void;
|
|
75
|
+
isViewMode?: boolean;
|
|
76
|
+
};
|
|
59
77
|
export {};
|
|
@@ -3,8 +3,8 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Command, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import type { PixelEntryValidation } from '../../pm-plugins/pixel-resizing/ui/types';
|
|
6
7
|
import type { EventInput } from '../../pm-plugins/types';
|
|
7
|
-
import type { PixelEntryValidation } from '../../ui/PixelEntry/types';
|
|
8
8
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
9
9
|
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
10
10
|
export declare const getNodeType: (state: EditorState) => "mediaSingle" | "mediaInline";
|
|
@@ -14,5 +14,6 @@ export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: Editor
|
|
|
14
14
|
export declare const removeInlineCard: Command;
|
|
15
15
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
16
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
17
|
+
export declare const updateMediaSingleWidthTr: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, state: EditorState, width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => import("prosemirror-state").Transaction | null;
|
|
17
18
|
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => Command;
|
|
18
19
|
export declare const changeMediaSingleToMediaInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
3
|
+
import { MediaToolbarBaseConfig } from '../../types';
|
|
4
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, }: Omit<Props, 'editorView' | 'selectedMediaSingleNode'>) => FloatingToolbarConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Transaction, EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare const openPixelEditor: () => import("@atlaskit/editor-common/types").Command;
|
|
3
|
+
export declare const closePixelEditor: () => import("@atlaskit/editor-common/types").Command;
|
|
4
|
+
export declare const closePixelEditorAndSave: (saveTransform: (tr: Transaction, state: EditorState) => Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
declare const createCommand: <A = {
|
|
4
|
+
type: "openPixelEditor";
|
|
5
|
+
} | {
|
|
6
|
+
type: "closePixelEditor";
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
|
+
isPixelEditorOpen: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
11
|
+
isPixelEditorOpen: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export { createCommand, getPluginState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type mediaPixelResizingState = {
|
|
2
|
+
isPixelEditorOpen: boolean;
|
|
3
|
+
};
|
|
4
|
+
type OpenPixelEditor = {
|
|
5
|
+
type: 'openPixelEditor';
|
|
6
|
+
};
|
|
7
|
+
type ClosePixelEditor = {
|
|
8
|
+
type: 'closePixelEditor';
|
|
9
|
+
};
|
|
10
|
+
type MediaPixelResizingAction = OpenPixelEditor | ClosePixelEditor;
|
|
11
|
+
declare const _default: (state: mediaPixelResizingState, action: MediaPixelResizingAction) => mediaPixelResizingState;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { IntlShape } from 'react-intl-next';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
import { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
+
import { MediaPluginState } from '../../../types';
|
|
9
|
+
export type Props = {
|
|
10
|
+
editorView: EditorView;
|
|
11
|
+
selectedMediaSingleNode: ContentNodeWithPos;
|
|
12
|
+
pluginInjectionApi?: ExtractInjectionAPI<MediaNextEditorPluginType>;
|
|
13
|
+
intl: IntlShape;
|
|
14
|
+
pluginState: MediaPluginState;
|
|
15
|
+
hoverDecoration: HoverDecorationHandler | undefined;
|
|
16
|
+
isEditorFullWidthEnabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const PixelEntry: ({ editorView, selectedMediaSingleNode, pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, }: Props) => jsx.JSX.Element | null;
|
|
19
|
+
export declare const FullWidthDisplay: ({ intl: { formatMessage } }: {
|
|
20
|
+
intl: IntlShape;
|
|
21
|
+
}) => jsx.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { PixelEntryComponentNextProps, PixelEntryProps } from './types';
|
|
3
|
+
export declare const PixelEntryComponent: ({ width, mediaWidth, mediaHeight, onSubmit, minWidth, maxWidth, onChange, intl: { formatMessage }, showMigration, onMigrate, onCloseAndSave, isViewMode, }: PixelEntryProps) => jsx.JSX.Element;
|
|
4
|
+
export declare const PixelEntryComponentNext: ({ maxWidth, formatMessage, handleFieldChange, computedWidth, computedHeight, handleCloseAndSave, isViewMode, }: PixelEntryComponentNextProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
1
2
|
import type { IntlShape } from 'react-intl-next';
|
|
2
3
|
export type PixelEntryProps = {
|
|
3
4
|
/**
|
|
@@ -46,6 +47,14 @@ export type PixelEntryProps = {
|
|
|
46
47
|
* Migration handler called when the CTA button is clicked
|
|
47
48
|
*/
|
|
48
49
|
onMigrate?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when the Enter key is pressed or close button is clicked
|
|
52
|
+
*/
|
|
53
|
+
onCloseAndSave?: (data: PixelEntryFormData) => void;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
isViewMode?: boolean;
|
|
49
58
|
};
|
|
50
59
|
export type PixelEntryFormValues = {
|
|
51
60
|
inputWidth: number | '';
|
|
@@ -56,4 +65,13 @@ type PixelEntryFormData = {
|
|
|
56
65
|
width: number;
|
|
57
66
|
validation: PixelEntryValidation;
|
|
58
67
|
};
|
|
68
|
+
export type PixelEntryComponentNextProps = {
|
|
69
|
+
maxWidth: number;
|
|
70
|
+
computedWidth: number | '';
|
|
71
|
+
computedHeight: number | '';
|
|
72
|
+
handleFieldChange: (type: string) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
73
|
+
formatMessage: IntlShape['formatMessage'];
|
|
74
|
+
handleCloseAndSave: (data: PixelEntryFormValues) => void;
|
|
75
|
+
isViewMode?: boolean;
|
|
76
|
+
};
|
|
59
77
|
export {};
|
|
@@ -3,8 +3,8 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Command, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import type { PixelEntryValidation } from '../../pm-plugins/pixel-resizing/ui/types';
|
|
6
7
|
import type { EventInput } from '../../pm-plugins/types';
|
|
7
|
-
import type { PixelEntryValidation } from '../../ui/PixelEntry/types';
|
|
8
8
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
9
9
|
export declare const DEFAULT_BORDER_SIZE = 2;
|
|
10
10
|
export declare const getNodeType: (state: EditorState) => "mediaSingle" | "mediaInline";
|
|
@@ -14,5 +14,6 @@ export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: Editor
|
|
|
14
14
|
export declare const removeInlineCard: Command;
|
|
15
15
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
16
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
17
|
+
export declare const updateMediaSingleWidthTr: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, state: EditorState, width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => import("prosemirror-state").Transaction | null;
|
|
17
18
|
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => Command;
|
|
18
19
|
export declare const changeMediaSingleToMediaInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
3
|
+
import { MediaToolbarBaseConfig } from '../../types';
|
|
4
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, }: Omit<Props, 'editorView' | 'selectedMediaSingleNode'>) => FloatingToolbarConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.9",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/button": "^21.1.0",
|
|
41
|
-
"@atlaskit/editor-common": "^102.
|
|
41
|
+
"@atlaskit/editor-common": "^102.11.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.1.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
48
48
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
|
|
49
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^3.
|
|
49
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^3.3.0",
|
|
50
50
|
"@atlaskit/editor-plugin-focus": "^1.5.0",
|
|
51
51
|
"@atlaskit/editor-plugin-grid": "^2.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"@atlaskit/media-ui": "^28.0.0",
|
|
67
67
|
"@atlaskit/media-viewer": "^52.0.0",
|
|
68
68
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
69
|
-
"@atlaskit/primitives": "^14.
|
|
69
|
+
"@atlaskit/primitives": "^14.2.0",
|
|
70
70
|
"@atlaskit/textfield": "^8.0.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^4.1.0",
|
|
73
73
|
"@atlaskit/tokens": "^4.5.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.0.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const PIXELENTRY_MIGRATION_BUTTON_TESTID = 'pixel-entry-convert-pixels-btn';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var PIXELENTRY_MIGRATION_BUTTON_TESTID = 'pixel-entry-convert-pixels-btn';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PIXELENTRY_MIGRATION_BUTTON_TESTID = "pixel-entry-convert-pixels-btn";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx } from '@emotion/react';
|
|
2
|
-
import type { IntlShape } from 'react-intl-next';
|
|
3
|
-
import type { PixelEntryProps } from './types';
|
|
4
|
-
export declare const PixelEntry: ({ width, mediaWidth, mediaHeight, onSubmit, minWidth, maxWidth, onChange, intl: { formatMessage }, showMigration, onMigrate, }: PixelEntryProps) => jsx.JSX.Element;
|
|
5
|
-
export declare const FullWidthDisplay: ({ intl: { formatMessage } }: {
|
|
6
|
-
intl: IntlShape;
|
|
7
|
-
}) => jsx.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PIXELENTRY_MIGRATION_BUTTON_TESTID = "pixel-entry-convert-pixels-btn";
|