@atlaskit/editor-core 165.0.0 → 166.0.0
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 +31 -0
- package/dist/cjs/actions/index.js +9 -0
- package/dist/cjs/create-editor/ReactEditorView.js +14 -6
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +13 -0
- package/dist/cjs/event-dispatcher/index.js +9 -0
- package/dist/cjs/nodeviews/ReactNodeView.js +1 -11
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +157 -0
- package/dist/cjs/plugins/card/styles.js +3 -1
- package/dist/cjs/plugins/code-block/styles.js +6 -4
- package/dist/cjs/plugins/collab-edit/plugin-state.js +23 -5
- package/dist/cjs/plugins/date/styles.js +3 -1
- package/dist/cjs/plugins/emoji/index.js +30 -34
- package/dist/cjs/plugins/emoji/nodeviews/emoji.js +12 -66
- package/dist/cjs/plugins/emoji/styles.js +3 -17
- package/dist/cjs/plugins/expand/ui/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +1 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +1 -9
- package/dist/cjs/plugins/layout/styles.js +3 -1
- package/dist/cjs/plugins/list/commands/indent-list.js +5 -1
- package/dist/cjs/plugins/list/commands/outdent-list.js +5 -1
- package/dist/cjs/plugins/list/transforms.js +11 -3
- package/dist/cjs/plugins/media/styles.js +3 -1
- package/dist/cjs/plugins/mentions/index.js +10 -14
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +15 -67
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +19 -10
- package/dist/cjs/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/cjs/plugins/panel/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/cjs/plugins/rule/styles.js +3 -1
- package/dist/cjs/plugins/selection/utils.js +39 -23
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +24 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +6 -4
- package/dist/cjs/plugins/tasks-and-decisions/styles.js +3 -1
- package/dist/cjs/plugins/type-ahead/index.js +6 -2
- package/dist/cjs/plugins/unsupported-content/index.js +22 -10
- package/dist/cjs/plugins/unsupported-content/styles.js +4 -2
- package/dist/cjs/plugins/unsupported-content/unsupported-inline-node-view.js +21 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +3 -1
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +12 -1
- package/dist/es2019/create-editor/ReactEditorView.js +14 -6
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +14 -0
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -10
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +138 -80
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +128 -0
- package/dist/es2019/plugins/card/styles.js +9 -5
- package/dist/es2019/plugins/code-block/styles.js +11 -8
- package/dist/es2019/plugins/collab-edit/plugin-state.js +23 -8
- package/dist/es2019/plugins/date/styles.js +3 -1
- package/dist/es2019/plugins/emoji/index.js +16 -21
- package/dist/es2019/plugins/emoji/nodeviews/emoji.js +12 -31
- package/dist/es2019/plugins/emoji/styles.js +1 -82
- package/dist/es2019/plugins/expand/ui/styles.js +2 -2
- package/dist/es2019/plugins/extension/ui/styles.js +4 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/es2019/plugins/layout/styles.js +3 -2
- package/dist/es2019/plugins/list/commands/indent-list.js +4 -1
- package/dist/es2019/plugins/list/commands/outdent-list.js +4 -1
- package/dist/es2019/plugins/list/transforms.js +9 -4
- package/dist/es2019/plugins/media/styles.js +9 -7
- package/dist/es2019/plugins/mentions/index.js +1 -6
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -35
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/es2019/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/es2019/plugins/panel/styles.js +5 -4
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/es2019/plugins/rule/styles.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +35 -20
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +22 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
- package/dist/es2019/plugins/table/ui/consts.js +5 -4
- package/dist/es2019/plugins/tasks-and-decisions/styles.js +4 -2
- package/dist/es2019/plugins/type-ahead/index.js +5 -1
- package/dist/es2019/plugins/unsupported-content/index.js +23 -12
- package/dist/es2019/plugins/unsupported-content/styles.js +5 -3
- package/dist/es2019/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/es2019/ui/Appearance/Chromeless.js +5 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +5 -2
- package/dist/es2019/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +3 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +8 -0
- package/dist/esm/create-editor/ReactEditorView.js +14 -6
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +14 -0
- package/dist/esm/event-dispatcher/index.js +9 -0
- package/dist/esm/nodeviews/ReactNodeView.js +1 -10
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +128 -79
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +149 -0
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/code-block/styles.js +5 -4
- package/dist/esm/plugins/collab-edit/plugin-state.js +21 -6
- package/dist/esm/plugins/date/styles.js +2 -1
- package/dist/esm/plugins/emoji/index.js +26 -29
- package/dist/esm/plugins/emoji/nodeviews/emoji.js +11 -56
- package/dist/esm/plugins/emoji/styles.js +3 -14
- package/dist/esm/plugins/expand/ui/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +20 -22
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +1 -8
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -8
- package/dist/esm/plugins/layout/styles.js +2 -1
- package/dist/esm/plugins/list/commands/indent-list.js +4 -1
- package/dist/esm/plugins/list/commands/outdent-list.js +4 -1
- package/dist/esm/plugins/list/transforms.js +9 -4
- package/dist/esm/plugins/media/styles.js +2 -1
- package/dist/esm/plugins/mentions/index.js +10 -14
- package/dist/esm/plugins/mentions/nodeviews/mention.js +13 -58
- package/dist/esm/plugins/mentions/pm-plugins/main.js +18 -10
- package/dist/esm/plugins/mentions/type-ahead/index.js +7 -2
- package/dist/esm/plugins/panel/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +3 -1
- package/dist/esm/plugins/rule/styles.js +2 -1
- package/dist/esm/plugins/selection/utils.js +35 -20
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +23 -0
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +5 -4
- package/dist/esm/plugins/tasks-and-decisions/styles.js +2 -1
- package/dist/esm/plugins/type-ahead/index.js +6 -2
- package/dist/esm/plugins/unsupported-content/index.js +21 -11
- package/dist/esm/plugins/unsupported-content/styles.js +3 -2
- package/dist/esm/plugins/unsupported-content/unsupported-inline-node-view.js +7 -0
- package/dist/esm/ui/Appearance/Chromeless.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -4
- package/dist/esm/ui/ChromeCollapsed/styles.js +2 -1
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -1
- package/dist/types/editor.d.ts +3 -0
- package/dist/types/event-dispatcher/index.d.ts +1 -0
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -5
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +2 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +10 -1
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +44 -0
- package/dist/types/plugins/collab-edit/plugin-state.d.ts +4 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -6
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +4 -14
- package/dist/types/plugins/emoji/styles.d.ts +0 -1
- package/dist/types/plugins/emoji/types.d.ts +0 -1
- package/dist/types/plugins/list/transforms.d.ts +10 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +6 -14
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +2 -5
- package/dist/types/plugins/selection/utils.d.ts +7 -15
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +3 -0
- package/dist/types/plugins/table/ui/consts.d.ts +2 -2
- package/dist/types/plugins/type-ahead/types.d.ts +1 -0
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +11 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +0 -14
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +4 -4
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +22 -22
- package/dist/cjs/plugins/emoji/nodeviews/emoji-next.js +0 -250
- package/dist/es2019/plugins/emoji/nodeviews/emoji-next.js +0 -177
- package/dist/esm/plugins/emoji/nodeviews/emoji-next.js +0 -234
- package/dist/types/plugins/emoji/nodeviews/emoji-next.d.ts +0 -31
|
@@ -5,14 +5,13 @@ import { emoji } from '@atlaskit/adf-schema';
|
|
|
5
5
|
import { Fragment } from 'prosemirror-model';
|
|
6
6
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
7
7
|
import { EmojiTypeAheadItem, SearchSort, recordSelectionSucceededSli, recordSelectionFailedSli } from '@atlaskit/emoji';
|
|
8
|
+
import { getInlineNodeViewProducer } from '../../nodeviews/getInlineNodeViewProducer';
|
|
8
9
|
import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-input-rules';
|
|
9
10
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
|
|
10
11
|
import { IconEmoji } from '../quick-insert/assets';
|
|
11
|
-
import
|
|
12
|
-
import emojiNodeViewNext from './nodeviews/emoji-next';
|
|
12
|
+
import { EmojiNodeView } from './nodeviews/emoji';
|
|
13
13
|
import { EmojiContextProvider } from './ui/EmojiContextProvider';
|
|
14
14
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
15
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
16
15
|
import { openTypeAheadAtCursor } from '../type-ahead/transforms/open-typeahead-at-cursor';
|
|
17
16
|
export const emojiToTypeaheadItem = (emoji, emojiProvider) => ({
|
|
18
17
|
title: emoji.shortName || '',
|
|
@@ -181,12 +180,7 @@ const emojiPlugin = options => {
|
|
|
181
180
|
pmPlugins() {
|
|
182
181
|
return [{
|
|
183
182
|
name: 'emoji',
|
|
184
|
-
plugin: (
|
|
185
|
-
providerFactory,
|
|
186
|
-
dispatch,
|
|
187
|
-
portalProviderAPI,
|
|
188
|
-
eventDispatcher
|
|
189
|
-
}) => emojiPluginFactory(dispatch, providerFactory, portalProviderAPI, eventDispatcher, options)
|
|
183
|
+
plugin: pmPluginFactoryParams => createEmojiPlugin(pmPluginFactoryParams)
|
|
190
184
|
}, {
|
|
191
185
|
name: 'emojiAsciiInputRule',
|
|
192
186
|
plugin: ({
|
|
@@ -271,7 +265,7 @@ export const emojiPluginKey = new PluginKey('emojiPlugin');
|
|
|
271
265
|
export function getEmojiPluginState(state) {
|
|
272
266
|
return emojiPluginKey.getState(state) || {};
|
|
273
267
|
}
|
|
274
|
-
export function
|
|
268
|
+
export function createEmojiPlugin(pmPluginFactoryParams) {
|
|
275
269
|
return new SafePlugin({
|
|
276
270
|
key: emojiPluginKey,
|
|
277
271
|
state: {
|
|
@@ -294,14 +288,14 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
294
288
|
newPluginState = { ...pluginState,
|
|
295
289
|
emojiProvider: params.provider
|
|
296
290
|
};
|
|
297
|
-
dispatch(emojiPluginKey, newPluginState);
|
|
291
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
298
292
|
return newPluginState;
|
|
299
293
|
|
|
300
294
|
case ACTIONS.SET_ASCII_MAP:
|
|
301
295
|
newPluginState = { ...pluginState,
|
|
302
296
|
asciiMap: params.asciiMap
|
|
303
297
|
};
|
|
304
|
-
dispatch(emojiPluginKey, newPluginState);
|
|
298
|
+
pmPluginFactoryParams.dispatch(emojiPluginKey, newPluginState);
|
|
305
299
|
return newPluginState;
|
|
306
300
|
}
|
|
307
301
|
|
|
@@ -311,12 +305,13 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
311
305
|
},
|
|
312
306
|
props: {
|
|
313
307
|
nodeViews: {
|
|
314
|
-
emoji(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
308
|
+
emoji: getInlineNodeViewProducer({
|
|
309
|
+
pmPluginFactoryParams,
|
|
310
|
+
Component: EmojiNodeView,
|
|
311
|
+
extraComponentProps: {
|
|
312
|
+
providerFactory: pmPluginFactoryParams.providerFactory
|
|
313
|
+
}
|
|
314
|
+
})
|
|
320
315
|
}
|
|
321
316
|
},
|
|
322
317
|
|
|
@@ -340,11 +335,11 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
340
335
|
return;
|
|
341
336
|
};
|
|
342
337
|
|
|
343
|
-
providerFactory.subscribe('emojiProvider', providerHandler);
|
|
338
|
+
pmPluginFactoryParams.providerFactory.subscribe('emojiProvider', providerHandler);
|
|
344
339
|
return {
|
|
345
340
|
destroy() {
|
|
346
|
-
if (providerFactory) {
|
|
347
|
-
providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
341
|
+
if (pmPluginFactoryParams.providerFactory) {
|
|
342
|
+
pmPluginFactoryParams.providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
348
343
|
}
|
|
349
344
|
}
|
|
350
345
|
|
|
@@ -1,34 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
3
2
|
import Emoji from '../ui/Emoji';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
shortName,
|
|
17
|
-
id,
|
|
18
|
-
text
|
|
19
|
-
} = this.node.attrs;
|
|
20
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Emoji, {
|
|
21
|
-
providers: providerFactory,
|
|
22
|
-
id: id,
|
|
23
|
-
shortName: shortName,
|
|
24
|
-
fallback: text
|
|
25
|
-
}), options && options.allowZeroWidthSpaceAfter && ZERO_WIDTH_SPACE);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export default function emojiNodeView(portalProviderAPI, eventDispatcher, providerFactory, options) {
|
|
30
|
-
return (node, view, getPos) => new EmojiNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
31
|
-
providerFactory,
|
|
32
|
-
options
|
|
33
|
-
}).init();
|
|
3
|
+
export function EmojiNodeView(props) {
|
|
4
|
+
const {
|
|
5
|
+
shortName,
|
|
6
|
+
id,
|
|
7
|
+
text
|
|
8
|
+
} = props.node.attrs;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Emoji, {
|
|
10
|
+
providers: props.providerFactory,
|
|
11
|
+
id: id,
|
|
12
|
+
shortName: shortName,
|
|
13
|
+
fallback: text
|
|
14
|
+
});
|
|
34
15
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { N0, N20, N900 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { borderRadius, fontSizeSmall, gridSize } from '@atlaskit/theme/constants';
|
|
4
2
|
import { EmojiSharedCssClassName } from '@atlaskit/editor-common/emoji';
|
|
5
|
-
import { SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName
|
|
3
|
+
import { SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
4
|
export const emojiStyles = css`
|
|
7
5
|
.${EmojiSharedCssClassName.EMOJI_CONTAINER} {
|
|
8
6
|
display: inline-block;
|
|
@@ -24,83 +22,4 @@ export const emojiStyles = css`
|
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
|
-
`;
|
|
28
|
-
const grid = gridSize() / 2;
|
|
29
|
-
const fontSize = fontSizeSmall();
|
|
30
|
-
const lineHeight = 4 * grid / fontSize;
|
|
31
|
-
const maxWidth = 105 * grid; // ~420px
|
|
32
|
-
|
|
33
|
-
const leftAndRightTextPadding = 2 * grid;
|
|
34
|
-
const topAndBottomPadding = grid / 4;
|
|
35
|
-
const marginDistance = 2 * grid;
|
|
36
|
-
export const emojiStylesNext = css`
|
|
37
|
-
.editor-emoji {
|
|
38
|
-
position: relative;
|
|
39
|
-
display: inline-block;
|
|
40
|
-
width: 20px;
|
|
41
|
-
height: 20px;
|
|
42
|
-
background-repeat: none;
|
|
43
|
-
background-size: contain;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
vertical-align: middle;
|
|
46
|
-
|
|
47
|
-
&.editor-emoji-loading {
|
|
48
|
-
border-radius: ${borderRadius()}px;
|
|
49
|
-
background: ${N20};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&.editor-emoji-fallback {
|
|
53
|
-
display: inline;
|
|
54
|
-
background: transparent;
|
|
55
|
-
vertical-align: baseline;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&.ProseMirror-selectednode:empty {
|
|
59
|
-
outline: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&:not(.editor-emoji-fallback) {
|
|
63
|
-
font-size: 0px;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&:not(.editor-emoji-fallback)::before {
|
|
67
|
-
content: attr(data-emoji-shortname);
|
|
68
|
-
display: block;
|
|
69
|
-
box-sizing: border-box;
|
|
70
|
-
width: auto;
|
|
71
|
-
position: absolute;
|
|
72
|
-
top: 100%;
|
|
73
|
-
left: 50%;
|
|
74
|
-
transform: translate(-50%, ${marginDistance}px);
|
|
75
|
-
|
|
76
|
-
// packages/css-packs/reduced-ui-pack/src/tooltip.js:25
|
|
77
|
-
color: ${N0};
|
|
78
|
-
background-color: ${N900};
|
|
79
|
-
font-size: ${relativeFontSizeToBase16(fontSize)};
|
|
80
|
-
line-height: ${lineHeight};
|
|
81
|
-
max-width: ${maxWidth}px;
|
|
82
|
-
border-radius: ${borderRadius()}px;
|
|
83
|
-
overflow: hidden;
|
|
84
|
-
padding: ${topAndBottomPadding}px ${leftAndRightTextPadding}px;
|
|
85
|
-
pointer-events: none;
|
|
86
|
-
text-decoration: none;
|
|
87
|
-
text-overflow: ellipsis;
|
|
88
|
-
white-space: nowrap;
|
|
89
|
-
z-index: 10000;
|
|
90
|
-
|
|
91
|
-
opacity: 0; // invisible by default
|
|
92
|
-
transition: opacity 0.35s; // (durationStep * 14)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&:not(.editor-emoji-fallback):hover::before {
|
|
96
|
-
opacity: 1;
|
|
97
|
-
transition: opacity 0s 0.35s; // (durationStep * 14)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
&.${akEditorSelectedNodeClassName} {
|
|
101
|
-
z-index: 2;
|
|
102
|
-
border-radius: 2px;
|
|
103
|
-
${getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow])}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
25
|
`;
|
|
@@ -19,10 +19,10 @@ const EXPAND_ICON_COLOR = props => css`
|
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
const ACTIVE_STATE_BACKGROUND_COLOR = themed({
|
|
22
|
-
dark: `#
|
|
22
|
+
dark: `#0C294F4B`
|
|
23
23
|
});
|
|
24
24
|
const ACTIVE_STATE_BORDER = themed({
|
|
25
|
-
dark: `1px solid #
|
|
25
|
+
dark: `1px solid #4794ff4B`
|
|
26
26
|
});
|
|
27
27
|
const ACTIVE_STATE_BORDER_RADIUS = themed({
|
|
28
28
|
dark: '3px'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { blockNodesVerticalMargin, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackground, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export const extensionStyles = css`
|
|
4
5
|
.extensionView-content-wrap,
|
|
5
6
|
.bodiedExtensionView-content-wrap {
|
|
@@ -20,8 +21,9 @@ export const extensionStyles = css`
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
&.danger > span > .extension-container {
|
|
23
|
-
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
24
|
-
|
|
24
|
+
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
25
|
+
${token('color.border.danger', akEditorDeleteBorder)};
|
|
26
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)};
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
&.inline {
|
|
@@ -12,7 +12,7 @@ const safeNumberFeatureFlag = value => {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export function createFeatureFlagsFromProps(props) {
|
|
15
|
-
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$
|
|
15
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35;
|
|
16
16
|
|
|
17
17
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
18
18
|
return { ...normalizedFeatureFlags,
|
|
@@ -28,29 +28,27 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
28
28
|
singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
29
29
|
undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
|
|
30
30
|
catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
|
|
31
|
+
stickyHeadersOptimization: typeof ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.stickyHeadersOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
|
|
32
|
+
initialRenderOptimization: typeof ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.initialRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
|
|
33
|
+
mouseMoveOptimization: typeof ((_props$featureFlags5 = props.featureFlags) === null || _props$featureFlags5 === void 0 ? void 0 : _props$featureFlags5.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.mouseMoveOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
|
|
34
|
+
tableRenderOptimization: typeof ((_props$featureFlags7 = props.featureFlags) === null || _props$featureFlags7 === void 0 ? void 0 : _props$featureFlags7.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.tableRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables4 = props.allowTables) !== null && _props$allowTables4 !== void 0 && _props$allowTables4.tableRenderOptimization),
|
|
35
|
+
tableOverflowShadowsOptimization: typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables5 = props.allowTables) !== null && _props$allowTables5 !== void 0 && _props$allowTables5.tableOverflowShadowsOptimization),
|
|
37
36
|
extendFloatingToolbar: Boolean(typeof props.allowExtension === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ufo: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.ufo) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.ufo) : false),
|
|
37
|
+
useUnpredictableInputRule: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.useUnpredictableInputRule) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.useUnpredictableInputRule) : props.UNSAFE_allowUndoRedoButtons ? false : true),
|
|
38
|
+
showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.showAvatarGroupAsPlugin) : false),
|
|
39
|
+
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.useErrorBoundaryDocStructure) : false),
|
|
40
|
+
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.synchronyErrorDocStructure) : false),
|
|
41
|
+
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20.enableViewUpdateSubscription) : false),
|
|
42
|
+
plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags22 = props.featureFlags) !== null && _props$featureFlags22 !== void 0 && _props$featureFlags22.plainTextPasteLinkification) : false),
|
|
43
|
+
collabAvatarScroll: Boolean(typeof ((_props$featureFlags23 = props.featureFlags) === null || _props$featureFlags23 === void 0 ? void 0 : _props$featureFlags23.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags24 = props.featureFlags) !== null && _props$featureFlags24 !== void 0 && _props$featureFlags24.collabAvatarScroll) : false),
|
|
44
|
+
ufo: Boolean(typeof ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.ufo) === 'boolean' ? !!((_props$featureFlags26 = props.featureFlags) !== null && _props$featureFlags26 !== void 0 && _props$featureFlags26.ufo) : false),
|
|
47
45
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
48
|
-
twoLineEditorToolbar: Boolean(typeof ((_props$
|
|
49
|
-
codeBidiWarnings: Boolean(typeof ((_props$
|
|
50
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$
|
|
51
|
-
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$
|
|
46
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags27 = props.featureFlags) === null || _props$featureFlags27 === void 0 ? void 0 : _props$featureFlags27.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags28 = props.featureFlags) !== null && _props$featureFlags28 !== void 0 && _props$featureFlags28.twoLineEditorToolbar) : false),
|
|
47
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.codeBidiWarnings) : true),
|
|
48
|
+
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.saferDispatchedTransactions) : false)),
|
|
49
|
+
maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.maxUnsafeChromeSpellcheckingVersion),
|
|
52
50
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
53
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
54
|
-
viewChangingExperimentToolbarStyle: typeof ((_props$
|
|
51
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
52
|
+
viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined
|
|
55
53
|
};
|
|
56
54
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
2
2
|
import { LinkMatcher, normalizeUrl } from '../utils';
|
|
3
|
-
import { queueCards } from '../../card/pm-plugins/actions';
|
|
4
3
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
5
4
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
6
5
|
export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredictableInputRule = true) {
|
|
@@ -21,13 +20,7 @@ export function createLinkInputRule(regexp, skipAnalytics = false, useUnpredicta
|
|
|
21
20
|
});
|
|
22
21
|
const from = start;
|
|
23
22
|
const to = Math.min(start + link.text.length, state.doc.content.size);
|
|
24
|
-
const tr =
|
|
25
|
-
url: link.url,
|
|
26
|
-
pos: from,
|
|
27
|
-
appearance: 'inline',
|
|
28
|
-
compareLinkText: true,
|
|
29
|
-
source: INPUT_METHOD.AUTO_DETECT
|
|
30
|
-
}])(state.tr.addMark(from, to, markType)); // Keep old behavior that will delete the space after the link
|
|
23
|
+
const tr = state.tr.addMark(from, to, markType); // Keep old behavior that will delete the space after the link
|
|
31
24
|
|
|
32
25
|
if (useUnpredictableInputRule || to === end) {
|
|
33
26
|
tr.insertText(' ');
|
|
@@ -3,7 +3,6 @@ import { getLinkMatch } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import * as keymaps from '../../../keymaps';
|
|
4
4
|
import { stateKey } from '../pm-plugins/main';
|
|
5
5
|
import { showLinkToolbar, hideLinkToolbar } from '../commands';
|
|
6
|
-
import { queueCards } from '../../card/pm-plugins/actions';
|
|
7
6
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
8
7
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
9
8
|
export function createKeymapPlugin(skipAnalytics = false) {
|
|
@@ -54,13 +53,7 @@ const mayConvertLastWordToHyperlink = skipAnalytics => {
|
|
|
54
53
|
const markType = state.schema.mark('link', {
|
|
55
54
|
href: url
|
|
56
55
|
});
|
|
57
|
-
const tr =
|
|
58
|
-
url,
|
|
59
|
-
pos: start,
|
|
60
|
-
appearance: 'inline',
|
|
61
|
-
compareLinkText: true,
|
|
62
|
-
source: INPUT_METHOD.AUTO_DETECT
|
|
63
|
-
}])(state.tr.addMark(start, end, markType));
|
|
56
|
+
const tr = state.tr.addMark(start, end, markType);
|
|
64
57
|
|
|
65
58
|
if (dispatch) {
|
|
66
59
|
if (skipAnalytics) {
|
|
@@ -3,6 +3,7 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
3
3
|
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
4
4
|
import { columnLayoutSharedStyle } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { gridMediumMaxWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akLayoutGutterOffset, akEditorSwoopCubicBezier, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
import { TableCssClassName } from '../table/types';
|
|
7
8
|
import { tableMarginFullWidthMode } from '../table/ui/consts';
|
|
8
9
|
export const LAYOUT_SECTION_MARGIN = gridSize();
|
|
@@ -91,8 +92,8 @@ export const layoutStyles = css`
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
&.selected.danger > [data-layout-column] {
|
|
94
|
-
background-color: ${akEditorDeleteBackground};
|
|
95
|
-
border-color: ${akEditorDeleteBorder};
|
|
95
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)};
|
|
96
|
+
border-color: ${token('color.border.danger', akEditorDeleteBorder)};
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
&.${akEditorSelectedNodeClassName}:not(.danger) {
|
|
@@ -6,6 +6,7 @@ import { findFirstParentListNode } from '../utils/find';
|
|
|
6
6
|
import { MAX_NESTED_LIST_INDENTATION } from '../types';
|
|
7
7
|
import { isInsideListItem, isInsideTableCell, getListItemAttributes } from '../utils/selection';
|
|
8
8
|
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
9
|
+
import { closeHistory } from 'prosemirror-history';
|
|
9
10
|
export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
10
11
|
return function (state, dispatch) {
|
|
11
12
|
const {
|
|
@@ -17,8 +18,10 @@ export function indentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
|
17
18
|
|
|
18
19
|
if (!isInsideListItem(state)) {
|
|
19
20
|
return false;
|
|
20
|
-
}
|
|
21
|
+
} // Save the history, so it could undo/revert to the same state before the indent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
22
|
+
|
|
21
23
|
|
|
24
|
+
closeHistory(tr);
|
|
22
25
|
const firstListItemSelectedAttributes = getListItemAttributes($from);
|
|
23
26
|
const parentListNode = findFirstParentListNode($from);
|
|
24
27
|
|
|
@@ -4,6 +4,7 @@ import { isBulletList } from '../utils/node';
|
|
|
4
4
|
import { findFirstParentListNode } from '../utils/find';
|
|
5
5
|
import { getCommonListAnalyticsAttributes } from '../utils/analytics';
|
|
6
6
|
import { outdentListItemsSelected as outdentListAction } from '../actions/outdent-list-items-selected';
|
|
7
|
+
import { closeHistory } from 'prosemirror-history';
|
|
7
8
|
export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
8
9
|
return function (state, dispatch) {
|
|
9
10
|
if (!isInsideListItem(state)) {
|
|
@@ -18,8 +19,10 @@ export function outdentList(inputMethod = INPUT_METHOD.KEYBOARD) {
|
|
|
18
19
|
if (!parentListNode) {
|
|
19
20
|
// Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
|
|
20
21
|
return true;
|
|
21
|
-
}
|
|
22
|
+
} // Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
|
|
23
|
+
|
|
22
24
|
|
|
25
|
+
closeHistory(state.tr);
|
|
23
26
|
const actionSubjectId = isBulletList(parentListNode.node) ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
|
|
24
27
|
let customTr = state.tr;
|
|
25
28
|
outdentListAction(customTr);
|
|
@@ -227,7 +227,7 @@ const extractListFromParagraph = (node, parent, schema) => {
|
|
|
227
227
|
*/
|
|
228
228
|
|
|
229
229
|
|
|
230
|
-
const splitIntoParagraphs = ({
|
|
230
|
+
export const splitIntoParagraphs = ({
|
|
231
231
|
fragment,
|
|
232
232
|
blockMarks = [],
|
|
233
233
|
schema
|
|
@@ -239,8 +239,14 @@ const splitIntoParagraphs = ({
|
|
|
239
239
|
hardBreak,
|
|
240
240
|
paragraph
|
|
241
241
|
} = schema.nodes;
|
|
242
|
-
fragment.forEach(node => {
|
|
243
|
-
|
|
242
|
+
fragment.forEach((node, i) => {
|
|
243
|
+
// ED-14725 Fixed the issue that it make duplicated line
|
|
244
|
+
// when pasting <br /> from google docs.
|
|
245
|
+
if (i === 0 && node.type === hardBreak) {
|
|
246
|
+
paragraphs.push(paragraph.createChecked(undefined, curChildren, [...blockMarks]));
|
|
247
|
+
lastNode = node;
|
|
248
|
+
return;
|
|
249
|
+
} else if (lastNode && lastNode.type === hardBreak && node.type === hardBreak) {
|
|
244
250
|
// double hardbreak
|
|
245
251
|
// backtrack a little; remove the trailing hardbreak we added last loop
|
|
246
252
|
curChildren.pop(); // create a new paragraph
|
|
@@ -261,7 +267,6 @@ const splitIntoParagraphs = ({
|
|
|
261
267
|
|
|
262
268
|
return Fragment.from(paragraphs.length ? paragraphs : [paragraph.createAndFill(undefined, undefined, [...blockMarks])]);
|
|
263
269
|
};
|
|
264
|
-
|
|
265
270
|
export const splitParagraphs = (slice, schema) => {
|
|
266
271
|
// exclude Text nodes with a code mark, since we transform those later
|
|
267
272
|
// into a codeblock
|
|
@@ -3,6 +3,7 @@ import { mediaSingleSharedStyle, richMediaClassName } from '@atlaskit/editor-com
|
|
|
3
3
|
import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderBoldSize, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorSelectedNodeClassName, akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { N60, B200 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
export const mediaStyles = css`
|
|
7
8
|
.ProseMirror {
|
|
8
9
|
${mediaSingleSharedStyle} & [layout='full-width'] .${richMediaClassName},
|
|
@@ -115,35 +116,36 @@ export const mediaStyles = css`
|
|
|
115
116
|
/* Danger when top level node for smart cards / inline links */
|
|
116
117
|
.danger > div > div > .media-card-frame,
|
|
117
118
|
.danger > span > a {
|
|
118
|
-
background-color: ${akEditorDeleteBackground};
|
|
119
|
+
background-color: ${token('color.background.danger', akEditorDeleteBackground)};
|
|
119
120
|
box-shadow: 0px 0px 0px ${akEditorSelectedBorderBoldSize}px
|
|
120
|
-
${akEditorDeleteBorder};
|
|
121
|
+
${token('color.border.danger', akEditorDeleteBorder)};
|
|
121
122
|
transition: background-color 0s, box-shadow 0s;
|
|
122
123
|
}
|
|
123
124
|
.mediaGroupView-content-wrap.danger {
|
|
124
125
|
/* Media inline */
|
|
125
126
|
.${fileCardImageViewSelectedSelector}::after {
|
|
126
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
127
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
/* Danger when nested node or common */
|
|
130
131
|
.danger {
|
|
131
132
|
/* Media single */
|
|
132
133
|
.${richMediaClassName} .${fileCardImageViewSelector}::after {
|
|
133
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
134
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
134
135
|
}
|
|
135
136
|
/* Media single video player */
|
|
136
137
|
.${richMediaClassName} .${inlinePlayerClassName}::after {
|
|
137
|
-
border: 1px solid ${akEditorDeleteIconColor};
|
|
138
|
+
border: 1px solid ${token('color.border.danger', akEditorDeleteIconColor)};
|
|
138
139
|
}
|
|
139
140
|
/* New file experience */
|
|
140
141
|
.${richMediaClassName} .${newFileExperienceClassName} {
|
|
141
|
-
box-shadow: 0 0 0 1px
|
|
142
|
+
box-shadow: 0 0 0 1px
|
|
143
|
+
${token('color.border.danger', akEditorDeleteIconColor)} !important;
|
|
142
144
|
}
|
|
143
145
|
/* Media resize handlers */
|
|
144
146
|
.richMedia-resize-handle-right::after,
|
|
145
147
|
.richMedia-resize-handle-left::after {
|
|
146
|
-
background: ${akEditorDeleteIconColor};
|
|
148
|
+
background: ${token('color.icon.danger', akEditorDeleteIconColor)};
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
/* Smart cards */
|
|
@@ -52,12 +52,7 @@ const mentionsPlugin = options => {
|
|
|
52
52
|
pmPlugins() {
|
|
53
53
|
return [{
|
|
54
54
|
name: 'mention',
|
|
55
|
-
plugin: (
|
|
56
|
-
providerFactory,
|
|
57
|
-
dispatch,
|
|
58
|
-
portalProviderAPI,
|
|
59
|
-
eventDispatcher
|
|
60
|
-
}) => createMentionPlugin(dispatch, providerFactory, portalProviderAPI, eventDispatcher, fireEvent, options)
|
|
55
|
+
plugin: pmPluginFactoryParams => createMentionPlugin(pmPluginFactoryParams, fireEvent, options)
|
|
61
56
|
}];
|
|
62
57
|
},
|
|
63
58
|
|
|
@@ -1,37 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
3
2
|
import Mention from '../ui/Mention';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Mention, {
|
|
21
|
-
id: id,
|
|
22
|
-
text: text,
|
|
23
|
-
accessLevel: accessLevel,
|
|
24
|
-
providers: providerFactory
|
|
25
|
-
}), options && options.allowZeroWidthSpaceAfter && ZERO_WIDTH_SPACE);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
export default function mentionNodeView(portalProviderAPI, eventDispatcher, providerFactory, options) {
|
|
30
|
-
return (node, view, getPos) => {
|
|
31
|
-
const hasIntlContext = true;
|
|
32
|
-
return new MentionNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
33
|
-
providerFactory,
|
|
34
|
-
options
|
|
35
|
-
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
36
|
-
};
|
|
37
|
-
}
|
|
3
|
+
export const MentionNodeView = props => {
|
|
4
|
+
const {
|
|
5
|
+
providerFactory
|
|
6
|
+
} = props;
|
|
7
|
+
const {
|
|
8
|
+
id,
|
|
9
|
+
text,
|
|
10
|
+
accessLevel
|
|
11
|
+
} = props.node.attrs;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Mention, {
|
|
13
|
+
id: id,
|
|
14
|
+
text: text,
|
|
15
|
+
accessLevel: accessLevel,
|
|
16
|
+
providers: providerFactory
|
|
17
|
+
});
|
|
18
|
+
};
|