@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
|
@@ -26,8 +26,20 @@ var isCollpasedExpand = function isCollpasedExpand(node) {
|
|
|
26
26
|
var isBodiedExtension = function isBodiedExtension(node) {
|
|
27
27
|
return Boolean(node && ['bodiedExtension'].includes(node.type.name));
|
|
28
28
|
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ED-19861 - [Regression] keyboard selections within action items are unpredicatable
|
|
32
|
+
* Table was added to the list of problematic nodes because the desired behaviour when Shift+Up from outside the
|
|
33
|
+
* table is to select the table node itself, rather than the table cell content. Previously this behaviour was handled
|
|
34
|
+
* in `packages/editor/editor-core/src/plugins/selection/pm-plugins/events/create-selection-between.ts` but there was
|
|
35
|
+
* a bug in `create-selection-between` which after fixing the bug that code was no longer handling table selection
|
|
36
|
+
* correctly, so to fix that table was added here.
|
|
37
|
+
*/
|
|
38
|
+
var isTable = function isTable(node) {
|
|
39
|
+
return Boolean(node && ['table'].includes(node.type.name));
|
|
40
|
+
};
|
|
29
41
|
var isProblematicNode = function isProblematicNode(node) {
|
|
30
|
-
return isCollpasedExpand(node) || isBodiedExtension(node);
|
|
42
|
+
return isCollpasedExpand(node) || isBodiedExtension(node) || isTable(node);
|
|
31
43
|
};
|
|
32
44
|
var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction) {
|
|
33
45
|
if ($head.pos === 0 || $head.depth === 0) {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.41.
|
|
9
|
+
var version = "187.41.4";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { extension, bodiedExtension, inlineExtension } from '@atlaskit/adf-schema';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
3
|
import { createPlugin } from './pm-plugins/main';
|
|
3
4
|
import keymapPlugin from './pm-plugins/keymap';
|
|
4
5
|
import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
|
|
@@ -9,8 +10,13 @@ const extensionPlugin = ({
|
|
|
9
10
|
config: options = {},
|
|
10
11
|
api
|
|
11
12
|
}) => {
|
|
12
|
-
var _api$featureFlags, _api$
|
|
13
|
+
var _api$featureFlags, _api$contextPanel3, _api$contextPanel4;
|
|
13
14
|
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
15
|
+
//Note: This is a hack to get the editor view reference in the plugin. Copied from table plugin.
|
|
16
|
+
//This is needed to get the current selection in the editor
|
|
17
|
+
const editorViewRef = {
|
|
18
|
+
current: null
|
|
19
|
+
};
|
|
14
20
|
return {
|
|
15
21
|
name: 'extension',
|
|
16
22
|
nodes() {
|
|
@@ -48,18 +54,38 @@ const extensionPlugin = ({
|
|
|
48
54
|
}, {
|
|
49
55
|
name: 'extensionUniqueId',
|
|
50
56
|
plugin: () => createUniqueIdPlugin()
|
|
57
|
+
}, {
|
|
58
|
+
name: 'extensionEditorViewRef',
|
|
59
|
+
plugin: () => {
|
|
60
|
+
return new SafePlugin({
|
|
61
|
+
view: editorView => {
|
|
62
|
+
editorViewRef.current = editorView;
|
|
63
|
+
return {
|
|
64
|
+
destroy: () => {
|
|
65
|
+
editorViewRef.current = null;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
51
71
|
}];
|
|
52
72
|
},
|
|
53
73
|
actions: {
|
|
54
|
-
|
|
74
|
+
api: () => {
|
|
75
|
+
var _api$contextPanel2;
|
|
76
|
+
return createExtensionAPI({
|
|
77
|
+
editorView: editorViewRef.current,
|
|
78
|
+
applyChange: api === null || api === void 0 ? void 0 : (_api$contextPanel2 = api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange
|
|
79
|
+
});
|
|
80
|
+
}
|
|
55
81
|
},
|
|
56
82
|
pluginsOptions: {
|
|
57
83
|
floatingToolbar: getToolbarConfig({
|
|
58
84
|
breakoutEnabled: options.breakoutEnabled,
|
|
59
85
|
hoverDecoration: api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration,
|
|
60
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$
|
|
86
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel3 = api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange
|
|
61
87
|
}),
|
|
62
|
-
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
88
|
+
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, api === null || api === void 0 ? void 0 : (_api$contextPanel4 = api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange)
|
|
63
89
|
}
|
|
64
90
|
};
|
|
65
91
|
};
|
|
@@ -3,7 +3,6 @@ import Loadable from 'react-loadable';
|
|
|
3
3
|
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
5
5
|
import { nodeToJSON } from '../../../utils';
|
|
6
|
-
import { createExtensionAPI } from '../../extension/extension-api';
|
|
7
6
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
8
7
|
import Separator from './Separator';
|
|
9
8
|
const noop = () => null;
|
|
@@ -21,8 +20,7 @@ const ExtensionButton = props => {
|
|
|
21
20
|
const {
|
|
22
21
|
item,
|
|
23
22
|
node,
|
|
24
|
-
|
|
25
|
-
applyChangeToContextPanel
|
|
23
|
+
extensionApi
|
|
26
24
|
} = props;
|
|
27
25
|
const ButtonIcon = React.useMemo(() => item.icon ? Loadable({
|
|
28
26
|
loader: async () => resolveExtensionIcon(item.icon),
|
|
@@ -33,11 +31,7 @@ const ExtensionButton = props => {
|
|
|
33
31
|
throw new Error(`'action' of context toolbar item '${item.key}' is not a function`);
|
|
34
32
|
}
|
|
35
33
|
const targetNodeAdf = nodeToJSON(node);
|
|
36
|
-
|
|
37
|
-
editorView,
|
|
38
|
-
applyChange: applyChangeToContextPanel
|
|
39
|
-
});
|
|
40
|
-
item.action(targetNodeAdf, api);
|
|
34
|
+
item.action(targetNodeAdf, extensionApi);
|
|
41
35
|
};
|
|
42
36
|
return /*#__PURE__*/React.createElement(Button, {
|
|
43
37
|
title: item.label,
|
|
@@ -56,7 +50,8 @@ export const ExtensionsPlaceholder = props => {
|
|
|
56
50
|
editorView,
|
|
57
51
|
extensionProvider,
|
|
58
52
|
separator,
|
|
59
|
-
applyChangeToContextPanel
|
|
53
|
+
applyChangeToContextPanel,
|
|
54
|
+
extensionApi
|
|
60
55
|
} = props;
|
|
61
56
|
const [extensions, setExtensions] = useState([]);
|
|
62
57
|
useEffect(() => {
|
|
@@ -72,11 +67,8 @@ export const ExtensionsPlaceholder = props => {
|
|
|
72
67
|
}, []);
|
|
73
68
|
const nodeAdf = React.useMemo(() => nodeToJSON(node), [node]);
|
|
74
69
|
const extensionItems = React.useMemo(() => {
|
|
75
|
-
return getContextualToolbarItemsFromModule(extensions, nodeAdf,
|
|
76
|
-
|
|
77
|
-
applyChange: applyChangeToContextPanel
|
|
78
|
-
}));
|
|
79
|
-
}, [extensions, nodeAdf, editorView, applyChangeToContextPanel]);
|
|
70
|
+
return getContextualToolbarItemsFromModule(extensions, nodeAdf, extensionApi);
|
|
71
|
+
}, [extensions, nodeAdf, extensionApi]);
|
|
80
72
|
if (!extensionItems.length) {
|
|
81
73
|
return null;
|
|
82
74
|
}
|
|
@@ -92,7 +84,8 @@ export const ExtensionsPlaceholder = props => {
|
|
|
92
84
|
node: node,
|
|
93
85
|
item: item,
|
|
94
86
|
editorView: editorView,
|
|
95
|
-
applyChangeToContextPanel: applyChangeToContextPanel
|
|
87
|
+
applyChangeToContextPanel: applyChangeToContextPanel,
|
|
88
|
+
extensionApi: extensionApi
|
|
96
89
|
}));
|
|
97
90
|
if (index < extensionItems.length - 1) {
|
|
98
91
|
children.push( /*#__PURE__*/React.createElement(Separator, null));
|
|
@@ -49,7 +49,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
49
49
|
useSomewhatSemanticTextColorNames: false
|
|
50
50
|
};
|
|
51
51
|
return jsx(ButtonGroup, null, items.filter(item => !item.hidden).map((item, idx) => {
|
|
52
|
-
var _api$contextPanel;
|
|
52
|
+
var _api$contextPanel, _api$extension;
|
|
53
53
|
switch (item.type) {
|
|
54
54
|
case 'button':
|
|
55
55
|
const ButtonIcon = item.icon;
|
|
@@ -206,7 +206,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
206
206
|
editorView: editorView,
|
|
207
207
|
extensionProvider: extensionsProvider,
|
|
208
208
|
separator: item.separator,
|
|
209
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
|
|
209
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange,
|
|
210
|
+
extensionApi: api === null || api === void 0 ? void 0 : (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
210
211
|
});
|
|
211
212
|
case 'separator':
|
|
212
213
|
return jsx(Separator, {
|
|
@@ -142,9 +142,8 @@ export const mediaStyles = css`
|
|
|
142
142
|
${`var(--ds-border-danger, ${akEditorDeleteIconColor})`} !important;
|
|
143
143
|
}
|
|
144
144
|
/* Media resize handlers */
|
|
145
|
-
.
|
|
146
|
-
|
|
147
|
-
background: ${`var(--ds-icon-danger, ${akEditorDeleteIconColor})`};
|
|
145
|
+
.resizer-handle-thumb {
|
|
146
|
+
background: ${`var(--ds-icon-danger, ${akEditorDeleteIconColor})`} !important;
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
/* Smart cards */
|
|
@@ -173,8 +172,7 @@ export const mediaStyles = css`
|
|
|
173
172
|
box-shadow: 0 0 0 1px ${`var(--ds-border-warning, ${Y500})`} !important;
|
|
174
173
|
}
|
|
175
174
|
|
|
176
|
-
.resizer-handle-
|
|
177
|
-
.resizer-handle-right::after {
|
|
175
|
+
.resizer-handle-thumb {
|
|
178
176
|
background: ${`var(--ds-icon-warning, ${Y500})`} !important;
|
|
179
177
|
}
|
|
180
178
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { isNodeSelection, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import { getMediaInputResizeAnalyticsEvent } from '../utils/analytics';
|
|
4
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { removeMediaGroupNode } from './utils';
|
|
6
|
+
import { removeMediaGroupNode, getSelectedMediaSingle } from './utils';
|
|
6
7
|
import { currentMediaNodeWithPos } from '../utils/current-media-node';
|
|
7
8
|
export const DEFAULT_BORDER_COLOR = '#091e4224';
|
|
8
9
|
export const DEFAULT_BORDER_SIZE = 2;
|
|
@@ -179,4 +180,33 @@ export const setBorderMark = editorAnalyticsAPI => attrs => (state, dispatch) =>
|
|
|
179
180
|
dispatch(tr);
|
|
180
181
|
}
|
|
181
182
|
return true;
|
|
183
|
+
};
|
|
184
|
+
export const updateMediaSingleWidth = editorAnalyticsAPI => (width, validation, layout) => (state, dispatch) => {
|
|
185
|
+
const selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
186
|
+
if (!selectedMediaSingleNode) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, {
|
|
190
|
+
...selectedMediaSingleNode.node.attrs,
|
|
191
|
+
width,
|
|
192
|
+
widthType: 'pixel',
|
|
193
|
+
layout
|
|
194
|
+
});
|
|
195
|
+
tr.setMeta('scrollIntoView', false);
|
|
196
|
+
tr.setSelection(NodeSelection.create(tr.doc, selectedMediaSingleNode.pos));
|
|
197
|
+
const $pos = state.doc.resolve(selectedMediaSingleNode.pos);
|
|
198
|
+
const parentNodeType = $pos ? $pos.parent.type.name : undefined;
|
|
199
|
+
const payload = getMediaInputResizeAnalyticsEvent('mediaSingle', {
|
|
200
|
+
width,
|
|
201
|
+
layout,
|
|
202
|
+
validation,
|
|
203
|
+
parentNode: parentNodeType
|
|
204
|
+
});
|
|
205
|
+
if (payload) {
|
|
206
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
207
|
+
}
|
|
208
|
+
if (dispatch) {
|
|
209
|
+
dispatch(tr);
|
|
210
|
+
}
|
|
211
|
+
return true;
|
|
182
212
|
};
|
|
@@ -20,7 +20,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
20
20
|
import { FilePreviewItem } from './filePreviewItem';
|
|
21
21
|
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement, calcNewLayout, getMaxToolbarWidth } from './utils';
|
|
22
22
|
import { isVideo } from '../utils/media-single';
|
|
23
|
-
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
23
|
+
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark, updateMediaSingleWidth } from './commands';
|
|
24
24
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
25
25
|
import ImageBorderItem from '../ui/ImageBorder';
|
|
26
26
|
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
@@ -318,17 +318,12 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
318
318
|
}
|
|
319
319
|
},
|
|
320
320
|
onSubmit: ({
|
|
321
|
-
width
|
|
321
|
+
width,
|
|
322
|
+
validation
|
|
322
323
|
}) => {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
widthType: 'pixel',
|
|
327
|
-
layout: calcNewLayout(width, layout, contentWidth, options.fullWidthEnabled)
|
|
328
|
-
});
|
|
329
|
-
tr.setMeta('scrollIntoView', false);
|
|
330
|
-
tr.setSelection(NodeSelection.create(tr.doc, selectedMediaSingleNode.pos));
|
|
331
|
-
dispatch(tr);
|
|
324
|
+
var _pluginInjectionApi$a4;
|
|
325
|
+
const newLayout = calcNewLayout(width, layout, contentWidth, options.fullWidthEnabled);
|
|
326
|
+
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);
|
|
332
327
|
},
|
|
333
328
|
onMigrate: () => {
|
|
334
329
|
const tr = state.tr.setNodeMarkup(selectedMediaSingleNode.pos, undefined, {
|
|
@@ -388,14 +383,14 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
388
383
|
};
|
|
389
384
|
const openLink = () => {
|
|
390
385
|
if (editorView) {
|
|
391
|
-
var _pluginInjectionApi$
|
|
386
|
+
var _pluginInjectionApi$a5;
|
|
392
387
|
const {
|
|
393
388
|
state: {
|
|
394
389
|
tr
|
|
395
390
|
},
|
|
396
391
|
dispatch
|
|
397
392
|
} = editorView;
|
|
398
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
393
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions.attachAnalyticsEvent({
|
|
399
394
|
eventType: EVENT_TYPE.TRACK,
|
|
400
395
|
action: ACTION.VISITED,
|
|
401
396
|
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
@@ -421,8 +416,8 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
421
416
|
}
|
|
422
417
|
}
|
|
423
418
|
if (allowAltTextOnImages) {
|
|
424
|
-
var _pluginInjectionApi$
|
|
425
|
-
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
419
|
+
var _pluginInjectionApi$a6;
|
|
420
|
+
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), {
|
|
426
421
|
type: 'separator'
|
|
427
422
|
});
|
|
428
423
|
}
|
|
@@ -506,22 +501,22 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
506
501
|
selectedNodeType = state.selection.node.type;
|
|
507
502
|
}
|
|
508
503
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
509
|
-
var _pluginInjectionApi$
|
|
504
|
+
var _pluginInjectionApi$a7;
|
|
510
505
|
const mediaOffset = state.selection.$from.parentOffset + 1;
|
|
511
506
|
baseToolbar.getDomRef = () => {
|
|
512
507
|
var _mediaPluginState$ele;
|
|
513
508
|
const selector = mediaFilmstripItemDOMSelector(mediaOffset);
|
|
514
509
|
return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
|
|
515
510
|
};
|
|
516
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
511
|
+
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);
|
|
517
512
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
518
|
-
var _pluginInjectionApi$
|
|
513
|
+
var _pluginInjectionApi$a8;
|
|
519
514
|
baseToolbar.getDomRef = () => {
|
|
520
515
|
var _mediaPluginState$ele2;
|
|
521
516
|
const element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(`.${MediaInlineNodeSelector}`);
|
|
522
517
|
return element || mediaPluginState.element;
|
|
523
518
|
};
|
|
524
|
-
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
519
|
+
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);
|
|
525
520
|
} else {
|
|
526
521
|
baseToolbar.getDomRef = () => {
|
|
527
522
|
var _mediaPluginState$ele3;
|
|
@@ -45,25 +45,26 @@ export const PixelEntry = ({
|
|
|
45
45
|
}
|
|
46
46
|
if (onSubmit) {
|
|
47
47
|
let widthToBeSumitted = data.inputWidth;
|
|
48
|
-
let
|
|
48
|
+
let validation = 'valid';
|
|
49
49
|
if (data.inputWidth < minWidth) {
|
|
50
50
|
widthToBeSumitted = minWidth;
|
|
51
|
-
|
|
51
|
+
validation = 'less-than-min';
|
|
52
52
|
}
|
|
53
53
|
if (data.inputWidth > maxWidth) {
|
|
54
54
|
widthToBeSumitted = maxWidth;
|
|
55
|
-
|
|
55
|
+
validation = 'greater-than-max';
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// If user keeps submitting an invalid input, node width attribute will be updated with the same value
|
|
59
59
|
// and won't upadte the state in useEffect (since width is the same)
|
|
60
60
|
// Thus, we set the state here to always display the correct dimension
|
|
61
|
-
if (
|
|
61
|
+
if (validation !== 'valid') {
|
|
62
62
|
setComputedWidth(widthToBeSumitted);
|
|
63
63
|
setComputedHeight(Math.round(ratioWidth * widthToBeSumitted));
|
|
64
64
|
}
|
|
65
65
|
onSubmit({
|
|
66
|
-
width: widthToBeSumitted
|
|
66
|
+
width: widthToBeSumitted,
|
|
67
|
+
validation
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
};
|
|
@@ -39,7 +39,7 @@ export const getMediaInputResizeAnalyticsEvent = (type, attributes) => {
|
|
|
39
39
|
return {
|
|
40
40
|
action: ACTION.EDITED,
|
|
41
41
|
actionSubject,
|
|
42
|
-
actionSubjectId: ACTION_SUBJECT_ID.
|
|
42
|
+
actionSubjectId: ACTION_SUBJECT_ID.RESIZED,
|
|
43
43
|
attributes: {
|
|
44
44
|
width,
|
|
45
45
|
layout,
|
|
@@ -21,8 +21,20 @@ const isCollpasedExpand = node => {
|
|
|
21
21
|
const 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
|
+
const isTable = node => {
|
|
34
|
+
return Boolean(node && ['table'].includes(node.type.name));
|
|
35
|
+
};
|
|
24
36
|
const isProblematicNode = node => {
|
|
25
|
-
return isCollpasedExpand(node) || isBodiedExtension(node);
|
|
37
|
+
return isCollpasedExpand(node) || isBodiedExtension(node) || isTable(node);
|
|
26
38
|
};
|
|
27
39
|
const findFixedProblematicNodePosition = (doc, $head, direction) => {
|
|
28
40
|
if ($head.pos === 0 || $head.depth === 0) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { extension, bodiedExtension, inlineExtension } from '@atlaskit/adf-schema';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
3
|
import { createPlugin } from './pm-plugins/main';
|
|
3
4
|
import keymapPlugin from './pm-plugins/keymap';
|
|
4
5
|
import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
|
|
@@ -6,11 +7,16 @@ import { getToolbarConfig } from './toolbar';
|
|
|
6
7
|
import { getContextPanel } from './context-panel';
|
|
7
8
|
import { createExtensionAPI } from './extension-api';
|
|
8
9
|
var extensionPlugin = function extensionPlugin(_ref) {
|
|
9
|
-
var _api$featureFlags, _api$
|
|
10
|
+
var _api$featureFlags, _api$contextPanel3, _api$contextPanel4;
|
|
10
11
|
var _ref$config = _ref.config,
|
|
11
12
|
options = _ref$config === void 0 ? {} : _ref$config,
|
|
12
|
-
|
|
13
|
-
var featureFlags = (
|
|
13
|
+
_api = _ref.api;
|
|
14
|
+
var featureFlags = (_api === null || _api === void 0 ? void 0 : (_api$featureFlags = _api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
15
|
+
//Note: This is a hack to get the editor view reference in the plugin. Copied from table plugin.
|
|
16
|
+
//This is needed to get the current selection in the editor
|
|
17
|
+
var editorViewRef = {
|
|
18
|
+
current: null
|
|
19
|
+
};
|
|
14
20
|
return {
|
|
15
21
|
name: 'extension',
|
|
16
22
|
nodes: function nodes() {
|
|
@@ -34,7 +40,7 @@ var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
34
40
|
portalProviderAPI = _ref2.portalProviderAPI,
|
|
35
41
|
eventDispatcher = _ref2.eventDispatcher;
|
|
36
42
|
var extensionHandlers = options.extensionHandlers || {};
|
|
37
|
-
return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher,
|
|
43
|
+
return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, _api, options.useLongPressSelection, {
|
|
38
44
|
appearance: options.appearance
|
|
39
45
|
});
|
|
40
46
|
}
|
|
@@ -42,25 +48,45 @@ var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
42
48
|
name: 'extensionKeymap',
|
|
43
49
|
plugin: function plugin() {
|
|
44
50
|
var _api$contextPanel;
|
|
45
|
-
return keymapPlugin(
|
|
51
|
+
return keymapPlugin(_api === null || _api === void 0 ? void 0 : (_api$contextPanel = _api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange);
|
|
46
52
|
}
|
|
47
53
|
}, {
|
|
48
54
|
name: 'extensionUniqueId',
|
|
49
55
|
plugin: function plugin() {
|
|
50
56
|
return createUniqueIdPlugin();
|
|
51
57
|
}
|
|
58
|
+
}, {
|
|
59
|
+
name: 'extensionEditorViewRef',
|
|
60
|
+
plugin: function plugin() {
|
|
61
|
+
return new SafePlugin({
|
|
62
|
+
view: function view(editorView) {
|
|
63
|
+
editorViewRef.current = editorView;
|
|
64
|
+
return {
|
|
65
|
+
destroy: function destroy() {
|
|
66
|
+
editorViewRef.current = null;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
52
72
|
}];
|
|
53
73
|
},
|
|
54
74
|
actions: {
|
|
55
|
-
|
|
75
|
+
api: function api() {
|
|
76
|
+
var _api$contextPanel2;
|
|
77
|
+
return createExtensionAPI({
|
|
78
|
+
editorView: editorViewRef.current,
|
|
79
|
+
applyChange: _api === null || _api === void 0 ? void 0 : (_api$contextPanel2 = _api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange
|
|
80
|
+
});
|
|
81
|
+
}
|
|
56
82
|
},
|
|
57
83
|
pluginsOptions: {
|
|
58
84
|
floatingToolbar: getToolbarConfig({
|
|
59
85
|
breakoutEnabled: options.breakoutEnabled,
|
|
60
|
-
hoverDecoration:
|
|
61
|
-
applyChangeToContextPanel:
|
|
86
|
+
hoverDecoration: _api === null || _api === void 0 ? void 0 : _api.decorations.actions.hoverDecoration,
|
|
87
|
+
applyChangeToContextPanel: _api === null || _api === void 0 ? void 0 : (_api$contextPanel3 = _api.contextPanel) === null || _api$contextPanel3 === void 0 ? void 0 : _api$contextPanel3.actions.applyChange
|
|
62
88
|
}),
|
|
63
|
-
contextPanel: getContextPanel(options.allowAutoSave, featureFlags,
|
|
89
|
+
contextPanel: getContextPanel(options.allowAutoSave, featureFlags, _api === null || _api === void 0 ? void 0 : (_api$contextPanel4 = _api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange)
|
|
64
90
|
}
|
|
65
91
|
};
|
|
66
92
|
};
|
|
@@ -6,7 +6,6 @@ import Loadable from 'react-loadable';
|
|
|
6
6
|
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
7
7
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
8
8
|
import { nodeToJSON } from '../../../utils';
|
|
9
|
-
import { createExtensionAPI } from '../../extension/extension-api';
|
|
10
9
|
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
11
10
|
import Separator from './Separator';
|
|
12
11
|
var noop = function noop() {
|
|
@@ -45,8 +44,7 @@ var resolveExtensionIcon = /*#__PURE__*/function () {
|
|
|
45
44
|
var ExtensionButton = function ExtensionButton(props) {
|
|
46
45
|
var item = props.item,
|
|
47
46
|
node = props.node,
|
|
48
|
-
|
|
49
|
-
applyChangeToContextPanel = props.applyChangeToContextPanel;
|
|
47
|
+
extensionApi = props.extensionApi;
|
|
50
48
|
var ButtonIcon = React.useMemo(function () {
|
|
51
49
|
return item.icon ? Loadable({
|
|
52
50
|
loader: function () {
|
|
@@ -74,11 +72,7 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
74
72
|
throw new Error("'action' of context toolbar item '".concat(item.key, "' is not a function"));
|
|
75
73
|
}
|
|
76
74
|
var targetNodeAdf = nodeToJSON(node);
|
|
77
|
-
|
|
78
|
-
editorView: editorView,
|
|
79
|
-
applyChange: applyChangeToContextPanel
|
|
80
|
-
});
|
|
81
|
-
item.action(targetNodeAdf, api);
|
|
75
|
+
item.action(targetNodeAdf, extensionApi);
|
|
82
76
|
};
|
|
83
77
|
return /*#__PURE__*/React.createElement(Button, {
|
|
84
78
|
title: item.label,
|
|
@@ -96,7 +90,8 @@ export var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
|
96
90
|
editorView = props.editorView,
|
|
97
91
|
extensionProvider = props.extensionProvider,
|
|
98
92
|
separator = props.separator,
|
|
99
|
-
applyChangeToContextPanel = props.applyChangeToContextPanel
|
|
93
|
+
applyChangeToContextPanel = props.applyChangeToContextPanel,
|
|
94
|
+
extensionApi = props.extensionApi;
|
|
100
95
|
var _useState = useState([]),
|
|
101
96
|
_useState2 = _slicedToArray(_useState, 2),
|
|
102
97
|
extensions = _useState2[0],
|
|
@@ -140,11 +135,8 @@ export var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
|
140
135
|
return nodeToJSON(node);
|
|
141
136
|
}, [node]);
|
|
142
137
|
var extensionItems = React.useMemo(function () {
|
|
143
|
-
return getContextualToolbarItemsFromModule(extensions, nodeAdf,
|
|
144
|
-
|
|
145
|
-
applyChange: applyChangeToContextPanel
|
|
146
|
-
}));
|
|
147
|
-
}, [extensions, nodeAdf, editorView, applyChangeToContextPanel]);
|
|
138
|
+
return getContextualToolbarItemsFromModule(extensions, nodeAdf, extensionApi);
|
|
139
|
+
}, [extensions, nodeAdf, extensionApi]);
|
|
148
140
|
if (!extensionItems.length) {
|
|
149
141
|
return null;
|
|
150
142
|
}
|
|
@@ -160,7 +152,8 @@ export var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
|
160
152
|
node: node,
|
|
161
153
|
item: item,
|
|
162
154
|
editorView: editorView,
|
|
163
|
-
applyChangeToContextPanel: applyChangeToContextPanel
|
|
155
|
+
applyChangeToContextPanel: applyChangeToContextPanel,
|
|
156
|
+
extensionApi: extensionApi
|
|
164
157
|
}));
|
|
165
158
|
if (index < extensionItems.length - 1) {
|
|
166
159
|
children.push( /*#__PURE__*/React.createElement(Separator, null));
|
|
@@ -59,7 +59,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
59
59
|
return jsx(ButtonGroup, null, items.filter(function (item) {
|
|
60
60
|
return !item.hidden;
|
|
61
61
|
}).map(function (item, idx) {
|
|
62
|
-
var _api$contextPanel;
|
|
62
|
+
var _api$contextPanel, _api$extension;
|
|
63
63
|
switch (item.type) {
|
|
64
64
|
case 'button':
|
|
65
65
|
var ButtonIcon = item.icon;
|
|
@@ -231,7 +231,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
231
231
|
editorView: editorView,
|
|
232
232
|
extensionProvider: extensionsProvider,
|
|
233
233
|
separator: item.separator,
|
|
234
|
-
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange
|
|
234
|
+
applyChangeToContextPanel: api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange,
|
|
235
|
+
extensionApi: api === null || api === void 0 ? void 0 : (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
235
236
|
});
|
|
236
237
|
case 'separator':
|
|
237
238
|
return jsx(Separator, {
|
|
@@ -5,7 +5,7 @@ import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-com
|
|
|
5
5
|
import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderBoldSize, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorSelectedNodeClassName, akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { N60, B200, Y500 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { fileCardImageViewSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
8
|
-
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .media-extended-resize-experience[layout^='wrap-'] {\n // override 'overflow: auto' when viewport <= 410 set by mediaSingleSharedStyle\n // to prevent scroll bar\n overflow: visible !important;\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: ", ";\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: ", ";\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .
|
|
8
|
+
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .media-extended-resize-experience[layout^='wrap-'] {\n // override 'overflow: auto' when viewport <= 410 set by mediaSingleSharedStyle\n // to prevent scroll bar\n overflow: visible !important;\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: ", ";\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: ", ";\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .resizer-handle-thumb {\n background: ", " !important;\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: ", "; /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n\n .warning {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n\n .", " .", "::after {\n border: 1px solid ", ";\n }\n\n .", " .", " {\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .resizer-handle-thumb {\n background: ", " !important;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, "var(--ds-space-150, 12px)", akEditorMediaResizeHandlerPadding, "var(--ds-space-150, 12px)", akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, "var(--ds-border, ".concat(N60, ")"), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, "var(--ds-border-focused, ".concat(B200, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), akEditorSelectedBorderBoldSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), richMediaClassName, fileCardImageViewSelector, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), richMediaClassName, inlinePlayerClassName, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), richMediaClassName, newFileExperienceClassName, "var(--ds-border-danger, ".concat(akEditorDeleteIconColor, ")"), "var(--ds-icon-danger, ".concat(akEditorDeleteIconColor, ")"), "var(--ds-blanket-danger, rgb(255, 189, 173, 0.5))", richMediaClassName, fileCardImageViewSelector, "var(--ds-border-warning, ".concat(Y500, ")"), richMediaClassName, inlinePlayerClassName, "var(--ds-border-warning, ".concat(Y500, ")"), richMediaClassName, newFileExperienceClassName, "var(--ds-border-warning, ".concat(Y500, ")"), "var(--ds-icon-warning, ".concat(Y500, ")"));
|
|
9
9
|
|
|
10
10
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|
|
11
11
|
* that style applied inside a container that has a scroll, causes any svgs on
|