@atlaskit/editor-plugin-media 1.43.6 → 1.43.8
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 +12 -0
- package/dist/cjs/mediaPlugin.js +2 -0
- package/dist/cjs/nodeviews/lazy-media-group.js +4 -1
- package/dist/cjs/nodeviews/lazy-media-inline.js +4 -1
- package/dist/cjs/nodeviews/lazy-media.js +4 -1
- package/dist/cjs/nodeviews/mediaGroup.js +7 -1
- package/dist/cjs/nodeviews/mediaInline.js +6 -1
- package/dist/cjs/nodeviews/mediaNodeView/index.js +6 -2
- package/dist/cjs/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/cjs/nodeviews/mediaSingle.js +41 -8
- package/dist/cjs/nodeviews/toDOM-fixes/toDOMAttrs.js +7 -3
- package/dist/cjs/pm-plugins/alt-text/commands.js +2 -0
- package/dist/cjs/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/cjs/pm-plugins/commands/captions.js +4 -1
- package/dist/cjs/pm-plugins/commands/linking.js +10 -2
- package/dist/cjs/pm-plugins/keymap-media.js +10 -0
- package/dist/cjs/pm-plugins/keymap.js +54 -7
- package/dist/cjs/pm-plugins/linking/keymap.js +3 -0
- package/dist/cjs/pm-plugins/main.js +24 -3
- package/dist/cjs/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/cjs/pm-plugins/picker-facade.js +8 -0
- package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/cjs/pm-plugins/utils/media-files.js +8 -2
- package/dist/cjs/pm-plugins/utils/media-single.js +19 -4
- package/dist/cjs/ui/CaptionPlaceholder/index.js +8 -2
- package/dist/cjs/ui/ImageBorder/index.js +44 -38
- package/dist/cjs/ui/ImageBorder/styles.js +2 -0
- package/dist/cjs/ui/MediaLinkingToolbar.js +2 -1
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/cjs/ui/MediaPicker/index.js +3 -0
- package/dist/cjs/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/cjs/ui/PixelEntry/index.js +61 -51
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/cjs/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/cjs/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/cjs/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/cjs/ui/toolbar/commands.js +4 -1
- package/dist/cjs/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/cjs/ui/toolbar/index.js +21 -3
- package/dist/cjs/ui/toolbar/layout-group.js +8 -1
- package/dist/cjs/ui/toolbar/linking.js +4 -1
- package/dist/cjs/ui/toolbar/utils.js +2 -0
- package/dist/es2019/mediaPlugin.js +2 -0
- package/dist/es2019/nodeviews/lazy-media-group.js +4 -1
- package/dist/es2019/nodeviews/lazy-media-inline.js +4 -1
- package/dist/es2019/nodeviews/lazy-media-single.js +4 -1
- package/dist/es2019/nodeviews/lazy-media.js +4 -1
- package/dist/es2019/nodeviews/mediaGroup.js +7 -1
- package/dist/es2019/nodeviews/mediaInline.js +6 -1
- package/dist/es2019/nodeviews/mediaNodeView/index.js +6 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/es2019/nodeviews/mediaSingle.js +43 -8
- package/dist/es2019/nodeviews/toDOM-fixes/toDOMAttrs.js +4 -1
- package/dist/es2019/pm-plugins/alt-text/commands.js +2 -0
- package/dist/es2019/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/es2019/pm-plugins/commands/captions.js +4 -1
- package/dist/es2019/pm-plugins/commands/linking.js +10 -2
- package/dist/es2019/pm-plugins/keymap-media.js +10 -0
- package/dist/es2019/pm-plugins/keymap.js +54 -7
- package/dist/es2019/pm-plugins/linking/keymap.js +3 -0
- package/dist/es2019/pm-plugins/main.js +24 -2
- package/dist/es2019/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/es2019/pm-plugins/picker-facade.js +8 -0
- package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/es2019/pm-plugins/utils/media-files.js +8 -2
- package/dist/es2019/pm-plugins/utils/media-single.js +19 -4
- package/dist/es2019/ui/CaptionPlaceholder/index.js +8 -2
- package/dist/es2019/ui/ImageBorder/index.js +44 -38
- package/dist/es2019/ui/ImageBorder/styles.js +2 -0
- package/dist/es2019/ui/MediaLinkingToolbar.js +4 -2
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/es2019/ui/MediaPicker/index.js +3 -0
- package/dist/es2019/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/es2019/ui/PixelEntry/index.js +59 -49
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/es2019/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/es2019/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/es2019/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/es2019/ui/toolbar/commands.js +4 -1
- package/dist/es2019/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/es2019/ui/toolbar/index.js +21 -3
- package/dist/es2019/ui/toolbar/layout-group.js +8 -1
- package/dist/es2019/ui/toolbar/linking.js +4 -1
- package/dist/es2019/ui/toolbar/mediaInline.js +8 -2
- package/dist/es2019/ui/toolbar/utils.js +6 -1
- package/dist/esm/mediaPlugin.js +2 -0
- package/dist/esm/nodeviews/lazy-media-group.js +4 -1
- package/dist/esm/nodeviews/lazy-media-inline.js +4 -1
- package/dist/esm/nodeviews/lazy-media.js +4 -1
- package/dist/esm/nodeviews/mediaGroup.js +7 -1
- package/dist/esm/nodeviews/mediaInline.js +6 -1
- package/dist/esm/nodeviews/mediaNodeView/index.js +6 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +10 -0
- package/dist/esm/nodeviews/mediaSingle.js +41 -8
- package/dist/esm/nodeviews/toDOM-fixes/toDOMAttrs.js +7 -3
- package/dist/esm/pm-plugins/alt-text/commands.js +2 -0
- package/dist/esm/pm-plugins/alt-text/keymap.js +6 -0
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +4 -0
- package/dist/esm/pm-plugins/commands/captions.js +4 -1
- package/dist/esm/pm-plugins/commands/linking.js +10 -2
- package/dist/esm/pm-plugins/keymap-media.js +10 -0
- package/dist/esm/pm-plugins/keymap.js +54 -7
- package/dist/esm/pm-plugins/linking/keymap.js +3 -0
- package/dist/esm/pm-plugins/main.js +24 -2
- package/dist/esm/pm-plugins/mediaTaskManager.js +7 -0
- package/dist/esm/pm-plugins/picker-facade.js +8 -0
- package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +2 -0
- package/dist/esm/pm-plugins/utils/media-files.js +8 -2
- package/dist/esm/pm-plugins/utils/media-single.js +19 -4
- package/dist/esm/ui/CaptionPlaceholder/index.js +8 -2
- package/dist/esm/ui/ImageBorder/index.js +44 -38
- package/dist/esm/ui/ImageBorder/styles.js +2 -0
- package/dist/esm/ui/MediaLinkingToolbar.js +4 -2
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +2 -0
- package/dist/esm/ui/MediaPicker/index.js +3 -0
- package/dist/esm/ui/MediaViewer/PortalWrapper.js +8 -2
- package/dist/esm/ui/PixelEntry/index.js +61 -51
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +10 -2
- package/dist/esm/ui/ResizableMediaSingle/index.js +6 -1
- package/dist/esm/ui/ResizableMediaSingle/styles.js +3 -0
- package/dist/esm/ui/toolbar/assets/commentWithDotIcon.js +2 -0
- package/dist/esm/ui/toolbar/commands.js +4 -1
- package/dist/esm/ui/toolbar/filePreviewItem.js +4 -1
- package/dist/esm/ui/toolbar/index.js +21 -3
- package/dist/esm/ui/toolbar/layout-group.js +8 -1
- package/dist/esm/ui/toolbar/linking.js +4 -1
- package/dist/esm/ui/toolbar/utils.js +2 -0
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +1 -2
- package/dist/types/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types/ui/toolbar/commands.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +1 -2
- package/package.json +8 -8
|
@@ -42,9 +42,13 @@ export var getMediaAttrs = function getMediaAttrs(nodeName, node) {
|
|
|
42
42
|
return attrs;
|
|
43
43
|
};
|
|
44
44
|
export var camelCaseToKebabCase = function camelCaseToKebabCase(str) {
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
return (
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
48
|
+
str.replace(/([^A-Z]+)([A-Z])/g, function (_, x, y) {
|
|
49
|
+
return "".concat(x, "-").concat(y.toLowerCase());
|
|
50
|
+
})
|
|
51
|
+
);
|
|
48
52
|
};
|
|
49
53
|
|
|
50
54
|
/**
|
|
@@ -19,6 +19,8 @@ var createCommandWithAnalytics = function createCommandWithAnalytics(actionType,
|
|
|
19
19
|
eventType: EVENT_TYPE.TRACK,
|
|
20
20
|
attributes: {
|
|
21
21
|
type: type,
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
24
|
mediaType: mediaNode.attrs.type
|
|
23
25
|
}
|
|
24
26
|
};
|
|
@@ -3,7 +3,13 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
3
3
|
import { closeMediaAltTextMenu, openMediaAltTextMenu } from './commands';
|
|
4
4
|
export default function keymapPlugin(schema, editorAnalyticsAPI) {
|
|
5
5
|
var list = {};
|
|
6
|
+
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
9
|
bindKeymapWithCommand(addAltText.common, openMediaAltTextMenu(editorAnalyticsAPI), list);
|
|
10
|
+
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
13
|
bindKeymapWithCommand(escape.common, closeMediaAltTextMenu, list);
|
|
8
14
|
return keymap(list);
|
|
9
15
|
}
|
|
@@ -94,6 +94,8 @@ export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
94
94
|
// We need to pass down the ESCAPE keymap
|
|
95
95
|
// because when we focus on the Toolbar, Prosemirror blur,
|
|
96
96
|
// making all keyboard shortcuts not working
|
|
97
|
+
// Ignored via go/ees005
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
99
|
view.someProp('handleKeyDown', function (fn) {
|
|
98
100
|
return fn(view, event);
|
|
99
101
|
});
|
|
@@ -172,6 +174,8 @@ export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
172
174
|
shortcutOverride: "Esc"
|
|
173
175
|
});
|
|
174
176
|
var errorsList = (this.state.validationErrors || []).map(function (error, index) {
|
|
177
|
+
// Ignored via go/ees005
|
|
178
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
175
179
|
return jsx(ErrorMessage, {
|
|
176
180
|
key: index
|
|
177
181
|
}, error);
|
|
@@ -48,6 +48,9 @@ export var insertAndSelectCaptionFromMediaSinglePos = function insertAndSelectCa
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
|
|
51
|
+
var setSelectionAtEndOfCaption = function setSelectionAtEndOfCaption(tr, mediaSingleNodePos, mediaNodeSize, captionNodeSize
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
54
|
+
) {
|
|
52
55
|
return setTextSelection(mediaSingleNodePos + mediaNodeSize + captionNodeSize)(tr);
|
|
53
56
|
};
|
|
@@ -63,7 +63,10 @@ export var showLinkingToolbarWithMediaTypeCheck = function showLinkingToolbarWit
|
|
|
63
63
|
var hideLinkingToolbarCommand = createMediaLinkingCommand({
|
|
64
64
|
type: MediaLinkingActionsTypes.hideToolbar
|
|
65
65
|
});
|
|
66
|
-
export var hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar
|
|
66
|
+
export var hideLinkingToolbar = function hideLinkingToolbar(state, dispatch, view, focusFloatingToolbar
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
69
|
+
) {
|
|
67
70
|
hideLinkingToolbarCommand(state, dispatch, view);
|
|
68
71
|
|
|
69
72
|
// restore focus on the editor so keyboard shortcuts aren't lost to the browser
|
|
@@ -86,6 +89,8 @@ function getCurrentUrl(state) {
|
|
|
86
89
|
if (!hasLink) {
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
94
|
var link = node.marks.find(function (mark) {
|
|
90
95
|
return mark.type === linkType;
|
|
91
96
|
}); // Already check exist
|
|
@@ -155,7 +160,10 @@ function toggleLinkMark(tr, state, _ref) {
|
|
|
155
160
|
}
|
|
156
161
|
var fireAnalyticForMediaLink = function fireAnalyticForMediaLink(tr, action) {
|
|
157
162
|
var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
158
|
-
var editorAnalyticsAPI
|
|
163
|
+
var editorAnalyticsAPI
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
166
|
+
= arguments.length > 3 ? arguments[3] : undefined;
|
|
159
167
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
160
168
|
action: action,
|
|
161
169
|
eventType: EVENT_TYPE.TRACK,
|
|
@@ -79,6 +79,9 @@ function handleSelectionAfterWrapRight(isEmptyNode) {
|
|
|
79
79
|
// the last is the image so should let the default behaviour delete the image
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
// Ignored via go/ees005
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
82
85
|
var mediaSingle = getSibling(state.selection, -1); // Sibling is a media single already checked in main code
|
|
83
86
|
var mediaSinglePos = $from.pos - mediaSingle.nodeSize;
|
|
84
87
|
|
|
@@ -108,6 +111,8 @@ function handleSelectionAfterWrapRight(isEmptyNode) {
|
|
|
108
111
|
} else {
|
|
109
112
|
// If is any other kind of block just add the paragraph after it
|
|
110
113
|
var endOfBlockPos = maybeAnyBlockPos + maybeSibling.nodeSize - 1;
|
|
114
|
+
// Ignored via go/ees005
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
111
116
|
safeInsert($from.parent.copy($from.parent.content), endOfBlockPos)(tr);
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -136,6 +141,9 @@ var backspaceAfterMediaNode = function backspaceAfterMediaNode(schema) {
|
|
|
136
141
|
if (!isSiblingOfType(state.selection, schema.nodes.mediaSingle, previousSibling) && !isSiblingOfType(state.selection, schema.nodes.mediaGroup, previousSibling)) {
|
|
137
142
|
return false;
|
|
138
143
|
}
|
|
144
|
+
|
|
145
|
+
// Ignored via go/ees005
|
|
146
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
139
147
|
var media = getSibling(state.selection, previousSibling);
|
|
140
148
|
|
|
141
149
|
// if media single
|
|
@@ -170,6 +178,8 @@ var backspaceAfterMediaNode = function backspaceAfterMediaNode(schema) {
|
|
|
170
178
|
export default function keymapPlugin(schema) {
|
|
171
179
|
var list = {};
|
|
172
180
|
var backspaceAfterMediaCommand = backspaceAfterMediaNode(schema);
|
|
181
|
+
// Ignored via go/ees005
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
173
183
|
bindKeymapWithCommand(backspace.common, backspaceAfterMediaCommand, list);
|
|
174
184
|
return keymap(list);
|
|
175
185
|
}
|
|
@@ -10,21 +10,49 @@ import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSingleP
|
|
|
10
10
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
11
11
|
import { updateMediaSingleWidth } from '../ui/toolbar/commands';
|
|
12
12
|
import { calcNewLayout, getSelectedMediaSingle } from '../ui/toolbar/utils';
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
13
15
|
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI, widthPlugin, getIntl) {
|
|
14
16
|
var list = {};
|
|
17
|
+
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
20
|
bindKeymapWithCommand(undo.common, ignoreLinksInSteps, list);
|
|
16
21
|
if (options !== null && options !== void 0 && options.allowCaptions) {
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
24
|
bindKeymapWithCommand(moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
27
|
bindKeymapWithCommand(tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
28
|
+
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
31
|
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
34
|
bindKeymapWithCommand(moveRight.common, arrowRightFromMediaSingle(editorSelectionAPI), list);
|
|
21
35
|
}
|
|
36
|
+
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
22
39
|
bindKeymapWithCommand(insertNewLine.common, splitMediaGroup, list);
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
23
42
|
bindKeymapWithCommand(enter.common, splitMediaGroup, list);
|
|
24
43
|
if (fg('platform_editor_media_extended_resize_experience')) {
|
|
25
|
-
bindKeymapWithCommand(
|
|
26
|
-
|
|
44
|
+
bindKeymapWithCommand(
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
47
|
+
increaseMediaSize.common, handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl), list);
|
|
48
|
+
bindKeymapWithCommand(
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
|
+
decreaseMediaSize.common, handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl), list);
|
|
27
52
|
}
|
|
53
|
+
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
56
|
bindKeymapWithCommand(activateVideoControls.common, focusPlayButton, list);
|
|
29
57
|
return keymap(list);
|
|
30
58
|
}
|
|
@@ -46,7 +74,10 @@ var focusPlayButton = function focusPlayButton(state) {
|
|
|
46
74
|
}
|
|
47
75
|
return true;
|
|
48
76
|
};
|
|
49
|
-
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation
|
|
77
|
+
var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, validation
|
|
78
|
+
// Ignored via go/ees005
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
+
) {
|
|
50
81
|
var newWidthValidated;
|
|
51
82
|
if (newWidth > maxWidth) {
|
|
52
83
|
newWidthValidated = maxWidth;
|
|
@@ -63,7 +94,10 @@ var validationMaxMin = function validationMaxMin(newWidth, maxWidth, minWidth, v
|
|
|
63
94
|
validation: validation
|
|
64
95
|
};
|
|
65
96
|
};
|
|
66
|
-
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl
|
|
97
|
+
var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount, validation, getIntl
|
|
98
|
+
// Ignored via go/ees005
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
|
+
) {
|
|
67
101
|
var announcerContainer = document.getElementById('media-announcer') || document.createElement('div');
|
|
68
102
|
var intl = getIntl();
|
|
69
103
|
if (!announcerContainer.id) {
|
|
@@ -71,6 +105,8 @@ var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount,
|
|
|
71
105
|
announcerContainer.setAttribute('role', 'status');
|
|
72
106
|
announcerContainer.setAttribute('aria-live', 'polite');
|
|
73
107
|
announcerContainer.setAttribute('aria-atomic', 'true');
|
|
108
|
+
// Ignored via go/ees005
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
110
|
var style = announcerContainer.style;
|
|
75
111
|
style.position = 'absolute';
|
|
76
112
|
style.width = '1px';
|
|
@@ -92,7 +128,10 @@ var createAnnouncer = function createAnnouncer(action, mediaWidth, changeAmount,
|
|
|
92
128
|
}
|
|
93
129
|
}
|
|
94
130
|
};
|
|
95
|
-
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl
|
|
131
|
+
var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, changeAmount, action, getIntl
|
|
132
|
+
// Ignored via go/ees005
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
134
|
+
) {
|
|
96
135
|
return function (state, dispatch) {
|
|
97
136
|
var _getSelectedMediaSing, _widthPlugin$sharedSt, _widthPlugin$sharedSt2, _getSelectedMediaSing2;
|
|
98
137
|
var selection = state.selection;
|
|
@@ -104,6 +143,8 @@ var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, w
|
|
|
104
143
|
var mediaPluginState = stateKey.getState(state);
|
|
105
144
|
var maxWidthForNestedNode = mediaPluginState.currentMaxWidth;
|
|
106
145
|
var minWidth = MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH;
|
|
146
|
+
// Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
148
|
var maxWidth = maxWidthForNestedNode;
|
|
108
149
|
var currentMaxWidth = (widthPlugin === null || widthPlugin === void 0 || (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.width) || maxWidth;
|
|
109
150
|
if (maxWidth === undefined && maxWidthForNestedNode === undefined) {
|
|
@@ -127,10 +168,16 @@ var handleMediaSizeChange = function handleMediaSizeChange(editorAnalyticsAPI, w
|
|
|
127
168
|
return true;
|
|
128
169
|
};
|
|
129
170
|
};
|
|
130
|
-
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
171
|
+
var handleMediaIncrease = function handleMediaIncrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
172
|
+
// Ignored via go/ees005
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
174
|
+
) {
|
|
131
175
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, 1, 'increased', getIntl);
|
|
132
176
|
};
|
|
133
|
-
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
177
|
+
var handleMediaDecrease = function handleMediaDecrease(editorAnalyticsAPI, widthPlugin, options, getIntl
|
|
178
|
+
// Ignored via go/ees005
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
180
|
+
) {
|
|
134
181
|
return handleMediaSizeChange(editorAnalyticsAPI, widthPlugin, options, -1, 'decreased', getIntl);
|
|
135
182
|
};
|
|
136
183
|
var insertAndSelectCaption = function insertAndSelectCaption(editorAnalyticsAPI) {
|
|
@@ -3,6 +3,9 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
3
3
|
import { showLinkingToolbarWithMediaTypeCheck } from '../commands/linking';
|
|
4
4
|
export default function keymapPlugin(schema) {
|
|
5
5
|
var list = {};
|
|
6
|
+
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
6
9
|
bindKeymapWithCommand(addLink.common, showLinkingToolbarWithMediaTypeCheck, list);
|
|
7
10
|
return keymap(list);
|
|
8
11
|
}
|
|
@@ -27,6 +27,8 @@ import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
|
27
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
28
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
29
29
|
import { updateMediaNodeAttrs } from '../pm-plugins/commands/helpers';
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line import/no-namespace
|
|
30
32
|
import * as helpers from '../pm-plugins/commands/helpers';
|
|
31
33
|
import { getMediaFromSupportedMediaNodesFromSelection, isNodeDoubleClickSupportedInLivePagesViewMode, removeMediaNode, splitMediaGroup } from '../pm-plugins/utils/media-common';
|
|
32
34
|
import { insertMediaGroupNode, insertMediaInlineNode } from '../pm-plugins/utils/media-files';
|
|
@@ -40,7 +42,10 @@ import { stateKey } from './plugin-key';
|
|
|
40
42
|
export var MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
41
43
|
export var MEDIA_PLUGIN_IS_RESIZING_KEY = 'mediaSinglePlugin.isResizing';
|
|
42
44
|
export var MEDIA_PLUGIN_RESIZING_WIDTH_KEY = 'mediaSinglePlugin.resizing-width';
|
|
43
|
-
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine
|
|
45
|
+
var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalProviderAPI, dropPlaceholderKey, allowDropLine
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
48
|
+
) {
|
|
44
49
|
var dropPlaceholder = document.createElement('div');
|
|
45
50
|
var createElement = React.createElement;
|
|
46
51
|
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
@@ -78,6 +83,8 @@ var createDropPlaceholder = function createDropPlaceholder(intl, nodeViewPortalP
|
|
|
78
83
|
};
|
|
79
84
|
var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
80
85
|
export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
86
|
+
// Ignored via go/ees005
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
81
88
|
function MediaPluginStateImplementation(_state, options, mediaOptions, _dispatch, pluginInjectionApi) {
|
|
82
89
|
var _this = this,
|
|
83
90
|
_this$mediaOptions2,
|
|
@@ -132,6 +139,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
132
139
|
*
|
|
133
140
|
* called when we insert a new file via the picker (connected via pickerfacade)
|
|
134
141
|
*/
|
|
142
|
+
// Ignored via go/ees005
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
135
144
|
_defineProperty(this, "insertFile", function (mediaState, onMediaStateChanged, pickerType, insertMediaVia) {
|
|
136
145
|
var _this$pluginInjection, _this$pluginInjection2, _mediaState$collectio, _this$pluginInjection3;
|
|
137
146
|
var state = _this.view.state;
|
|
@@ -209,6 +218,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
209
218
|
});
|
|
210
219
|
_this.selectLastAddedMediaNode();
|
|
211
220
|
});
|
|
221
|
+
// Ignored via go/ees005
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
212
223
|
_defineProperty(this, "addPendingTask", function (task) {
|
|
213
224
|
_this.taskManager.addPendingTask(task);
|
|
214
225
|
});
|
|
@@ -376,6 +387,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
376
387
|
return false;
|
|
377
388
|
}
|
|
378
389
|
var from = view.state.selection.from;
|
|
390
|
+
// Ignored via go/ees005
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
379
392
|
removeMediaNode(view, selectedNode.firstChild, function () {
|
|
380
393
|
return from + 1;
|
|
381
394
|
});
|
|
@@ -742,7 +755,10 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
742
755
|
export var getMediaPluginState = function getMediaPluginState(state) {
|
|
743
756
|
return stateKey.getState(state);
|
|
744
757
|
};
|
|
745
|
-
export var createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions
|
|
758
|
+
export var createPlugin = function createPlugin(_schema, options, getIntl, pluginInjectionApi, nodeViewPortalProviderAPI, dispatch, mediaOptions
|
|
759
|
+
// Ignored via go/ees005
|
|
760
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
761
|
+
) {
|
|
746
762
|
var intl = getIntl();
|
|
747
763
|
return new SafePlugin({
|
|
748
764
|
state: {
|
|
@@ -904,6 +920,8 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
|
|
|
904
920
|
return DecorationSet.create(state.doc, dropPlaceholders);
|
|
905
921
|
},
|
|
906
922
|
nodeViews: options.nodeViews,
|
|
923
|
+
// Ignored via go/ees005
|
|
924
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
907
925
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
908
926
|
var selection = view.state.selection;
|
|
909
927
|
if (text === ' ' && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
@@ -924,6 +942,8 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
|
|
|
924
942
|
},
|
|
925
943
|
handleClick: function handleClick(_editorView, _pos, event) {
|
|
926
944
|
var _event$target;
|
|
945
|
+
// Ignored via go/ees005
|
|
946
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
927
947
|
var clickedInsideCaptionPlaceholder = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest("[data-id=\"".concat(CAPTION_PLACEHOLDER_ID, "\"]"));
|
|
928
948
|
|
|
929
949
|
// Workaround for Chrome given a regression introduced in prosemirror-view@1.18.6
|
|
@@ -937,6 +957,8 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
|
|
|
937
957
|
// @see https://product-fabric.atlassian.net/browse/MEX-2012
|
|
938
958
|
if (browser.ios) {
|
|
939
959
|
var _event$target2;
|
|
960
|
+
// Ignored via go/ees005
|
|
961
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
940
962
|
return !!((_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest("[class=\"".concat(MEDIA_CONTENT_WRAP_CLASS_NAME, "\"]")));
|
|
941
963
|
}
|
|
942
964
|
return false;
|
|
@@ -14,6 +14,8 @@ export var MediaTaskManager = /*#__PURE__*/_createClass(function MediaTaskManage
|
|
|
14
14
|
task.cancelController.abort();
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line require-await
|
|
17
19
|
_defineProperty(this, "waitForPendingTasks", /*#__PURE__*/function () {
|
|
18
20
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(timeout, lastTask) {
|
|
19
21
|
var chainedPromise, rejectTimeout, timeoutPromise;
|
|
@@ -64,6 +66,8 @@ export var MediaTaskManager = /*#__PURE__*/_createClass(function MediaTaskManage
|
|
|
64
66
|
_this.addPendingTask(mediaTask.task, id);
|
|
65
67
|
}
|
|
66
68
|
});
|
|
69
|
+
// Ignored via go/ees005
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
71
|
_defineProperty(this, "addPendingTask", function (task, id) {
|
|
68
72
|
var currentTask = task;
|
|
69
73
|
if (id) {
|
|
@@ -73,6 +77,9 @@ export var MediaTaskManager = /*#__PURE__*/_createClass(function MediaTaskManage
|
|
|
73
77
|
task: task,
|
|
74
78
|
cancelController: cancelController
|
|
75
79
|
});
|
|
80
|
+
|
|
81
|
+
// Ignored via go/ees005
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
83
|
currentTask = new Promise(function (resolve) {
|
|
77
84
|
task.then(resolve, resolve).finally(function () {
|
|
78
85
|
_this.taskMap.delete(id);
|
|
@@ -5,6 +5,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import { isImagePreview } from '@atlaskit/media-picker';
|
|
7
7
|
var PickerFacade = /*#__PURE__*/function () {
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
8
10
|
function PickerFacade(pickerType, config, pickerConfig, analyticsName) {
|
|
9
11
|
var _this = this;
|
|
10
12
|
_classCallCheck(this, PickerFacade);
|
|
@@ -107,6 +109,9 @@ var PickerFacade = /*#__PURE__*/function () {
|
|
|
107
109
|
this.analyticsName = analyticsName;
|
|
108
110
|
this.erroredFiles = new Set();
|
|
109
111
|
}
|
|
112
|
+
|
|
113
|
+
// Ignored via go/ees005
|
|
114
|
+
// eslint-disable-next-line require-await
|
|
110
115
|
return _createClass(PickerFacade, [{
|
|
111
116
|
key: "init",
|
|
112
117
|
value: function () {
|
|
@@ -175,6 +180,9 @@ var PickerFacade = /*#__PURE__*/function () {
|
|
|
175
180
|
value: function onNewMedia(cb) {
|
|
176
181
|
this.onStartListeners.push(cb);
|
|
177
182
|
}
|
|
183
|
+
|
|
184
|
+
// Ignored via go/ees005
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
186
|
}, {
|
|
179
187
|
key: "onDrag",
|
|
180
188
|
value: function onDrag(cb) {
|
|
@@ -31,6 +31,8 @@ import { batchStepsUpdate } from './batchSteps';
|
|
|
31
31
|
* const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
|
|
32
32
|
* debouncedFunction(arg1, arg2);
|
|
33
33
|
*/
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
34
36
|
function memoizeDebounce(func) {
|
|
35
37
|
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
36
38
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -77,7 +77,10 @@ function shouldAppendParagraph(state, node) {
|
|
|
77
77
|
* @param collection Collection for the media to be added
|
|
78
78
|
*/
|
|
79
79
|
export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalyticsAPI) {
|
|
80
|
-
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia
|
|
80
|
+
return function (view, mediaState, collection, allowInlineImages, inputMethod, insertMediaVia
|
|
81
|
+
// Ignored via go/ees005
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
83
|
+
) {
|
|
81
84
|
var state = view.state,
|
|
82
85
|
dispatch = view.dispatch;
|
|
83
86
|
var schema = state.schema,
|
|
@@ -142,7 +145,10 @@ export var insertMediaInlineNode = function insertMediaInlineNode(editorAnalytic
|
|
|
142
145
|
* @param collection Collection for the media to be added
|
|
143
146
|
*/
|
|
144
147
|
export var insertMediaGroupNode = function insertMediaGroupNode(editorAnalyticsAPI) {
|
|
145
|
-
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia
|
|
148
|
+
return function (view, mediaStates, collection, inputMethod, isNestingInQuoteSupported, insertMediaVia
|
|
149
|
+
// Ignored via go/ees005
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
151
|
+
) {
|
|
146
152
|
var state = view.state,
|
|
147
153
|
dispatch = view.dispatch;
|
|
148
154
|
var tr = state.tr,
|
|
@@ -32,6 +32,9 @@ var getInsertMediaAnalytics = function getInsertMediaAnalytics(inputMethod, file
|
|
|
32
32
|
function shouldAddParagraph(state) {
|
|
33
33
|
return atTheBeginningOfBlock(state) && !checkNodeDown(state.selection, state.doc, isEmptyParagraph);
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
38
|
function insertNodesWithOptionalParagraph(nodes) {
|
|
36
39
|
var analyticsAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
37
40
|
var editorAnalyticsAPI = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -82,7 +85,10 @@ function insertNodesWithOptionalParagraph(nodes) {
|
|
|
82
85
|
export var isMediaSingle = function isMediaSingle(schema, fileMimeType) {
|
|
83
86
|
return !!schema.nodes.mediaSingle && isImage(fileMimeType);
|
|
84
87
|
};
|
|
85
|
-
export var insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia
|
|
88
|
+
export var insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, node, inputMethod, editorAnalyticsAPI, isNestingInQuoteSupported, insertMediaVia
|
|
89
|
+
// Ignored via go/ees005
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
91
|
+
) {
|
|
86
92
|
var _node$attrs$width;
|
|
87
93
|
var state = view.state,
|
|
88
94
|
dispatch = view.dispatch;
|
|
@@ -119,7 +125,10 @@ var getFileExtension = function getFileExtension(fileName) {
|
|
|
119
125
|
}
|
|
120
126
|
return undefined;
|
|
121
127
|
};
|
|
122
|
-
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia
|
|
128
|
+
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, widthPluginState, editorAnalyticsAPI, onNodeInserted, isNestingInQuoteSupported, insertMediaVia
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
131
|
+
) {
|
|
123
132
|
var _state$selection$$fro;
|
|
124
133
|
if (collection === undefined) {
|
|
125
134
|
return false;
|
|
@@ -166,7 +175,10 @@ export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaSta
|
|
|
166
175
|
}
|
|
167
176
|
return true;
|
|
168
177
|
};
|
|
169
|
-
export var changeFromMediaInlineToMediaSingleNode = function changeFromMediaInlineToMediaSingleNode(view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported
|
|
178
|
+
export var changeFromMediaInlineToMediaSingleNode = function changeFromMediaInlineToMediaSingleNode(view, fromNode, widthPluginState, editorAnalyticsAPI, isNestingInQuoteSupported
|
|
179
|
+
// Ignored via go/ees005
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
181
|
+
) {
|
|
170
182
|
var _state$selection$$fro2;
|
|
171
183
|
var state = view.state,
|
|
172
184
|
dispatch = view.dispatch;
|
|
@@ -208,7 +220,10 @@ export var changeFromMediaInlineToMediaSingleNode = function changeFromMediaInli
|
|
|
208
220
|
}
|
|
209
221
|
return true;
|
|
210
222
|
};
|
|
211
|
-
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert
|
|
223
|
+
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert
|
|
224
|
+
// Ignored via go/ees005
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
226
|
+
) {
|
|
212
227
|
return function (mediaState) {
|
|
213
228
|
var id = mediaState.id,
|
|
214
229
|
dimensions = mediaState.dimensions,
|
|
@@ -37,7 +37,10 @@ export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, re
|
|
|
37
37
|
onClick: onClick,
|
|
38
38
|
"data-id": CAPTION_PLACEHOLDER_ID,
|
|
39
39
|
"data-testid": "caption-placeholder"
|
|
40
|
-
}, jsx(FormattedMessage
|
|
40
|
+
}, jsx(FormattedMessage
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
43
|
+
, message))
|
|
41
44
|
);
|
|
42
45
|
});
|
|
43
46
|
export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
@@ -60,5 +63,8 @@ export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_r
|
|
|
60
63
|
}, jsx(Text, {
|
|
61
64
|
color: "color.text.subtlest",
|
|
62
65
|
size: "large"
|
|
63
|
-
}, jsx(FormattedMessage
|
|
66
|
+
}, jsx(FormattedMessage
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
69
|
+
, message)));
|
|
64
70
|
});
|
|
@@ -221,50 +221,56 @@ var ImageBorder = function ImageBorder(_ref) {
|
|
|
221
221
|
var name = _ref2.name,
|
|
222
222
|
value = _ref2.value,
|
|
223
223
|
icon = _ref2.icon;
|
|
224
|
+
// Ignored via go/ees005
|
|
225
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
226
|
var ButtonIcon = icon;
|
|
225
|
-
return
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
setIsOpen(false);
|
|
242
|
-
},
|
|
243
|
-
onKeyDown: function onKeyDown(event) {
|
|
244
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
245
|
-
var _openDropdownButtonRe2;
|
|
227
|
+
return (
|
|
228
|
+
// Ignored via go/ees005
|
|
229
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
230
|
+
jsx(Tooltip, {
|
|
231
|
+
key: idx,
|
|
232
|
+
content: name
|
|
233
|
+
}, jsx("span", {
|
|
234
|
+
css: buttonWrapperStyle
|
|
235
|
+
}, jsx("button", {
|
|
236
|
+
type: "button"
|
|
237
|
+
/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */,
|
|
238
|
+
css: buttonStyle(value === size),
|
|
239
|
+
"aria-label": name,
|
|
240
|
+
role: "radio",
|
|
241
|
+
"aria-checked": value === size,
|
|
242
|
+
onClick: function onClick() {
|
|
246
243
|
setBorder({
|
|
247
244
|
size: value
|
|
248
245
|
});
|
|
249
246
|
setIsOpen(false);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
(
|
|
247
|
+
},
|
|
248
|
+
onKeyDown: function onKeyDown(event) {
|
|
249
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
250
|
+
var _openDropdownButtonRe2;
|
|
251
|
+
setBorder({
|
|
252
|
+
size: value
|
|
253
|
+
});
|
|
254
|
+
setIsOpen(false);
|
|
255
|
+
setIsColorSubmenuOpen(false);
|
|
256
|
+
setIsSizeSubmenuOpen(false);
|
|
257
|
+
(_openDropdownButtonRe2 = openDropdownButtonRef.current) === null || _openDropdownButtonRe2 === void 0 || _openDropdownButtonRe2.focus();
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
onMouseDown: function onMouseDown(e) {
|
|
261
|
+
e.preventDefault();
|
|
253
262
|
}
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
spacing: "spacious",
|
|
266
|
-
label: name
|
|
267
|
-
}))));
|
|
263
|
+
}, !fg('platform-visual-refresh-icons') ?
|
|
264
|
+
//eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
265
|
+
jsx("div", {
|
|
266
|
+
css: line(value, value === size),
|
|
267
|
+
role: "presentation"
|
|
268
|
+
}) : jsx(ButtonIcon, {
|
|
269
|
+
color: value === size ? "var(--ds-icon-inverse, #FFFFFF)" : 'currentColor',
|
|
270
|
+
spacing: "spacious",
|
|
271
|
+
label: name
|
|
272
|
+
}))))
|
|
273
|
+
);
|
|
268
274
|
}))))),
|
|
269
275
|
'data-testid': 'dropdown-item__Size',
|
|
270
276
|
key: 'dropdown-menu-image-border-size-button',
|
|
@@ -4,6 +4,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line import/no-namespace
|
|
7
9
|
import * as colors from '@atlaskit/theme/colors';
|
|
8
10
|
import { N0, N20A, N50, N60A, N800, N90 } from '@atlaskit/theme/colors';
|
|
9
11
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|